Browse Source

领料

master
luanhui 8 years ago
parent
commit
160ffc0680
4 changed files with 134 additions and 0 deletions
  1. +3
    -0
      B3ClientService/B3ClientService.csproj
  2. +37
    -0
      B3ClientService/BO/MaterialRequisitionRecord_/MaterialRequisitionRecord.cs
  3. +27
    -0
      B3ClientService/Rpcs/BillRpc/MaterialRequisitionRecordRpc_/MaterialRequisitionRecordDto.cs
  4. +67
    -0
      B3ClientService/Rpcs/BillRpc/MaterialRequisitionRecordRpc_/MaterialRequisitionRecordRpc.cs

+ 3
- 0
B3ClientService/B3ClientService.csproj View File

@ -115,6 +115,7 @@
<Compile Include="BO\ClientGoodsSet_\ClientGoodsSet_Detail.cs" />
<Compile Include="BO\ClientSyncBase.cs" />
<Compile Include="BO\ClientSyncBaseDto.cs" />
<Compile Include="BO\MaterialRequisitionRecord_\MaterialRequisitionRecord.cs" />
<Compile Include="BO\ProductTask_\ProductTask.cs" />
<Compile Include="BO\SegmentationByPproductTrace_\SegmentationByPproductTrace.cs" />
<Compile Include="BO\SegmentationInStoreRecord_\SegmentationInStoreRecord.cs" />
@ -137,6 +138,8 @@
<Compile Include="Rpcs\BillRpc\ByProductWeightRecordRpc.cs" />
<Compile Include="Rpcs\BillRpc\ClientGoodsSetRpc.cs" />
<Compile Include="Rpcs\BillRpc\DropPigRpc.cs" />
<Compile Include="Rpcs\BillRpc\MaterialRequisitionRecordRpc_\MaterialRequisitionRecordDto.cs" />
<Compile Include="Rpcs\BillRpc\MaterialRequisitionRecordRpc_\MaterialRequisitionRecordRpc.cs" />
<Compile Include="Rpcs\BillRpc\ProductTaskRpc.cs" />
<Compile Include="Rpcs\BillRpc\SaleOutStoreRpc.cs" />
<Compile Include="Rpcs\BillRpc\SegmentationInStoreRecordRpc_\SegmentationInStoreRecordDto.cs" />


+ 37
- 0
B3ClientService/BO/MaterialRequisitionRecord_/MaterialRequisitionRecord.cs View File

@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using BWP.B3Frameworks.BO;
using Forks.EnterpriseServices.DataForm;
using Forks.EnterpriseServices.DomainObjects2;
namespace BWP.B3ClientService.BO
{
[Serializable]
[DFClass]
public class MaterialRequisitionRecord : Base
{
public long? B3_ID { get; set; }
public DateTime? SyncToB3DateTime { get; set; }
private DateTime mCreateTime = DateTime.Now;
[DbColumn(DbType = SqlDbType.DateTime)]
public DateTime CreateTime { get { return mCreateTime; } set { mCreateTime = value; } }
public string BarCode { get; set; }//条码
public long Goods_ID { get; set; }
public string Goods_Name { get; set; }
public string Goods_Spec { get; set; }
public decimal Weight { get; set; }//净重
public string CardBarCode { get; set; }//放产品的车的条码
public string BiaoShi { get; set; }//用来记录那个工作台或者哪台触摸屏做的
public string CreateUserName { get; set; }
}
}

+ 27
- 0
B3ClientService/Rpcs/BillRpc/MaterialRequisitionRecordRpc_/MaterialRequisitionRecordDto.cs View File

@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BWP.B3ClientService.BO;
using Forks.EnterpriseServices.DataForm;
namespace BWP.B3ClientService.Rpcs.BillRpc
{
[Serializable, DFClass]
public class MaterialRequisitionRecordDto : ClientSyncBaseDto
{
public string BarCode { get; set; }//条码
public long Goods_ID { get; set; }
public string Goods_Name { get; set; }
public string Goods_Spec { get; set; }
public decimal Weight { get; set; }//净重
public string CardBarCode { get; set; }//放产品的车的条码
public string BiaoShi { get; set; }//用来记录那个工作台或者哪台触摸屏做的
public string CreateUserName { get; set; }
}
}

+ 67
- 0
B3ClientService/Rpcs/BillRpc/MaterialRequisitionRecordRpc_/MaterialRequisitionRecordRpc.cs View File

@ -0,0 +1,67 @@
using System;
using BWP.B3ClientService.BO;
using BWP.B3Frameworks.Utils;
using Forks.EnterpriseServices.DomainObjects2;
using Forks.EnterpriseServices.DomainObjects2.DQuery;
using Forks.EnterpriseServices.JsonRpc;
using Newtonsoft.Json;
namespace BWP.B3ClientService.Rpcs.BillRpc
{
[Rpc]
public static class MaterialRequisitionRecordRpc
{
private static readonly object _insertObj = new object();
[Rpc]
public static long Insert(string json)
{
lock (_insertObj)
{
var record = JsonConvert.DeserializeObject<MaterialRequisitionRecord>(json);
record.CreateTime = DateTime.Now;
using (var session = Dmo.NewSession())
{
session.Insert(record);
session.Commit();
}
return record.ID;
}
}
private static readonly object _updateObj = new object();
[Rpc]
public static int Update(string json)
{
lock (_updateObj)
{
var clientRecord = JsonConvert.DeserializeObject<MaterialRequisitionRecordDto>(json);
using (var session = Dmo.NewSession())
{
var record = session.Load(new DmoIdentity(typeof(MaterialRequisitionRecord), clientRecord.Service_ID ?? 0));
if (record == null)
{
return 0;
}
DmoUtil.CopyDmoFields(clientRecord, record, "ID", "B3_ID");
session.Update(record);
session.Commit();
}
return 1;
}
}
[Rpc]
public static int Delete(long id)
{
var delDom = new DQDeleteDom(typeof(MaterialRequisitionRecord));
delDom.Where.Conditions.Add(DQCondition.EQ("ID", id));
using (var session = Dmo.NewSession())
{
session.ExecuteNonQuery(delDom);
session.Commit();
}
return 1;
}
}
}

Loading…
Cancel
Save