|
|
@ -4,20 +4,59 @@ using BWP.B3Frameworks.Utils; |
|
|
using Forks.EnterpriseServices.DomainObjects2; |
|
|
using Forks.EnterpriseServices.DomainObjects2; |
|
|
using Forks.EnterpriseServices.DomainObjects2.DQuery; |
|
|
using Forks.EnterpriseServices.DomainObjects2.DQuery; |
|
|
using Forks.EnterpriseServices.JsonRpc; |
|
|
using Forks.EnterpriseServices.JsonRpc; |
|
|
|
|
|
using Forks.EnterpriseServices.SqlDoms; |
|
|
using Newtonsoft.Json; |
|
|
using Newtonsoft.Json; |
|
|
|
|
|
using TSingSoft.WebPluginFramework; |
|
|
|
|
|
|
|
|
namespace BWP.B3ClientService.Rpcs.BillRpc.TrunksIousOutInStoreRecord_ |
|
|
namespace BWP.B3ClientService.Rpcs.BillRpc.TrunksIousOutInStoreRecord_ |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
|
//todo 这里需要维护大表
|
|
|
|
|
|
|
|
|
|
|
|
[Rpc] |
|
|
[Rpc] |
|
|
public static class TrunksIousOutInStoreRecordRpc |
|
|
public static class TrunksIousOutInStoreRecordRpc |
|
|
{ |
|
|
{ |
|
|
|
|
|
[Rpc] |
|
|
|
|
|
public static string GetUnSubmitList() |
|
|
|
|
|
{ |
|
|
|
|
|
var query = new DQueryDom(new JoinAlias(typeof(TrunksIousOutInStoreRecord))); |
|
|
|
|
|
query.Where.Conditions.Add(DQCondition.Or(DQCondition.IsNull(DQExpression.Field("IsSubmited")), DQCondition.EQ("IsSubmited", false))); |
|
|
|
|
|
query.OrderBy.Expressions.Add(DQOrderByExpression.Create("ID", true)); |
|
|
|
|
|
var list = query.EExecuteDmoList<TrunksIousOutInStoreRecord>("ID", "BarCode", "Goods_Name", "Number", "Weight", "LossWeight"); |
|
|
|
|
|
|
|
|
|
|
|
return JsonConvert.SerializeObject(list); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
[Rpc] |
|
|
|
|
|
public static string GetSubmitedList() |
|
|
|
|
|
{ |
|
|
|
|
|
var query = new DQueryDom(new JoinAlias(typeof(TrunksIousOutInStoreRecord))); |
|
|
|
|
|
query.Where.Conditions.Add(DQCondition.EQ("IsSubmited", true)); |
|
|
|
|
|
query.OrderBy.Expressions.Add(DQOrderByExpression.Create("ID", true)); |
|
|
|
|
|
query.Range = SelectRange.Top(50); |
|
|
|
|
|
|
|
|
|
|
|
var list = query.EExecuteDmoList<TrunksIousOutInStoreRecord>("ID", "BarCode", "Goods_Name", "Number", "Weight", "LossWeight"); |
|
|
|
|
|
|
|
|
|
|
|
return JsonConvert.SerializeObject(list); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
[Rpc] |
|
|
|
|
|
public static long SetWeight(long id,decimal weight) |
|
|
|
|
|
{ |
|
|
|
|
|
var query = new DQUpdateDom(typeof(TrunksIousOutInStoreRecord)); |
|
|
|
|
|
query.Columns.Add(new DQUpdateColumn("Weight", weight)); |
|
|
|
|
|
query.Columns.Add(new DQUpdateColumn("IsSubmited", true)); |
|
|
|
|
|
// query.Columns.Add(new DQUpdateColumn("LossWeight", ));
|
|
|
|
|
|
//todo 这里要算损耗
|
|
|
|
|
|
query.Where.Conditions.Add(DQCondition.EQ("ID", id)); |
|
|
|
|
|
query.EExecute(); |
|
|
|
|
|
return id; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
[Rpc] |
|
|
[Rpc] |
|
|
public static long Insert(string json) |
|
|
public static long Insert(string json) |
|
|
{ |
|
|
{ |
|
|
var clientRecord = JsonConvert.DeserializeObject<TrunksIousOutInStoreRecordDto>(json); |
|
|
var clientRecord = JsonConvert.DeserializeObject<TrunksIousOutInStoreRecordDto>(json); |
|
|
using (var session=Dmo.NewSession()) |
|
|
|
|
|
|
|
|
using (var session = Dmo.NewSession()) |
|
|
{ |
|
|
{ |
|
|
var record = new TrunksIousOutInStoreRecord(); |
|
|
var record = new TrunksIousOutInStoreRecord(); |
|
|
DmoUtil.CopyDmoFields(clientRecord, record, "ID", "B3_ID"); |
|
|
DmoUtil.CopyDmoFields(clientRecord, record, "ID", "B3_ID"); |
|
|
@ -25,17 +64,34 @@ namespace BWP.B3ClientService.Rpcs.BillRpc.TrunksIousOutInStoreRecord_ |
|
|
session.Commit(); |
|
|
session.Commit(); |
|
|
return record.ID; |
|
|
return record.ID; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
[Rpc] |
|
|
|
|
|
public static long SimpleInsert(long goodsId,string goodsName,string barCode) |
|
|
|
|
|
{ |
|
|
|
|
|
using (var session = Dmo.NewSession()) |
|
|
|
|
|
{ |
|
|
|
|
|
var record = new TrunksIousOutInStoreRecord(); |
|
|
|
|
|
record.Goods_ID = goodsId; |
|
|
|
|
|
record.Goods_Name = goodsName; |
|
|
|
|
|
record.BarCode = barCode; |
|
|
|
|
|
record.IsSubmited = false; |
|
|
|
|
|
session.Insert(record); |
|
|
|
|
|
session.Commit(); |
|
|
|
|
|
return record.ID; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
[Rpc] |
|
|
[Rpc] |
|
|
public static int Update(string json) |
|
|
public static int Update(string json) |
|
|
{ |
|
|
{ |
|
|
var clientRecord = JsonConvert.DeserializeObject<TrunksIousOutInStoreRecordDto>(json); |
|
|
var clientRecord = JsonConvert.DeserializeObject<TrunksIousOutInStoreRecordDto>(json); |
|
|
using (var session=Dmo.NewSession()) |
|
|
|
|
|
|
|
|
using (var session = Dmo.NewSession()) |
|
|
{ |
|
|
{ |
|
|
var record = session.Load(new DmoIdentity(typeof(TrunksIousOutInStoreRecord), clientRecord.Service_ID??0)); |
|
|
|
|
|
DmoUtil.CopyDmoFields(clientRecord,record,"ID", "B3_ID"); |
|
|
|
|
|
|
|
|
var record = session.Load(new DmoIdentity(typeof(TrunksIousOutInStoreRecord), clientRecord.Service_ID ?? 0)); |
|
|
|
|
|
DmoUtil.CopyDmoFields(clientRecord, record, "ID", "B3_ID"); |
|
|
session.Update(record); |
|
|
session.Update(record); |
|
|
} |
|
|
} |
|
|
return 1; |
|
|
return 1; |
|
|
@ -45,8 +101,8 @@ namespace BWP.B3ClientService.Rpcs.BillRpc.TrunksIousOutInStoreRecord_ |
|
|
public static int Delete(long id) |
|
|
public static int Delete(long id) |
|
|
{ |
|
|
{ |
|
|
var delDom = new DQDeleteDom(typeof(TrunksIousOutInStoreRecord)); |
|
|
var delDom = new DQDeleteDom(typeof(TrunksIousOutInStoreRecord)); |
|
|
delDom.Where.Conditions.Add(DQCondition.EQ("ID",id)); |
|
|
|
|
|
using (var session=Dmo.NewSession()) |
|
|
|
|
|
|
|
|
delDom.Where.Conditions.Add(DQCondition.EQ("ID", id)); |
|
|
|
|
|
using (var session = Dmo.NewSession()) |
|
|
{ |
|
|
{ |
|
|
session.Update(delDom); |
|
|
session.Update(delDom); |
|
|
} |
|
|
} |
|
|
|