|
|
@ -116,23 +116,19 @@ namespace ButcherFactory.BO.LocalBL |
|
|
list.Add(new Tuple<string, object>("ProductBatch_ID", first.ProductBatch_ID)); |
|
|
list.Add(new Tuple<string, object>("ProductBatch_ID", first.ProductBatch_ID)); |
|
|
} |
|
|
} |
|
|
else |
|
|
else |
|
|
{ |
|
|
|
|
|
try |
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
var json = RpcFacade.Call<string>("/MainSystem/B3ButcherManage/Rpcs/CarcassStoreDetailRpc/GetCarcassInstoreInfo", barCode); |
|
|
|
|
|
var mesInfo = JsonConvert.DeserializeObject<SaleOutCarcassObj>(json); |
|
|
|
|
|
if (!string.IsNullOrEmpty(mesInfo.Goods_Code)) |
|
|
{ |
|
|
{ |
|
|
var json = ButcherFactoryUtil.SecondUrlCall<string>(MESPath + "CarcassSaleOutStoreRpc/GetCarcassInstoreInfo", barCode); |
|
|
|
|
|
var mesInfo = JsonConvert.DeserializeObject<SaleOutCarcassObj>(json); |
|
|
|
|
|
if (!string.IsNullOrEmpty(mesInfo.Goods_Code)) |
|
|
|
|
|
{ |
|
|
|
|
|
if (mesInfo.Goods_Code == "X002")//特殊处理,有个存货编码不存在。
|
|
|
|
|
|
mesInfo.Goods_Code = "0001"; |
|
|
|
|
|
var gInfo = GetGoodsInfo(mesInfo.Goods_Code); |
|
|
|
|
|
first.Goods_Code = mesInfo.Goods_Code; |
|
|
|
|
|
first.InStoreWeight = mesInfo.InStoreWeight; |
|
|
|
|
|
first.Goods_ID = gInfo.Item1; |
|
|
|
|
|
first.Goods_Name = gInfo.Item2; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if (mesInfo.Goods_Code == "X002")//特殊处理,有个存货编码不存在。
|
|
|
|
|
|
mesInfo.Goods_Code = "0001"; |
|
|
|
|
|
var gInfo = GetGoodsInfo(mesInfo.Goods_Code); |
|
|
|
|
|
first.Goods_Code = mesInfo.Goods_Code; |
|
|
|
|
|
first.InStoreWeight = mesInfo.InStoreWeight; |
|
|
|
|
|
first.Goods_ID = gInfo.Item1; |
|
|
|
|
|
first.Goods_Name = gInfo.Item2; |
|
|
} |
|
|
} |
|
|
catch { }; |
|
|
|
|
|
first.BarCode = barCode; |
|
|
first.BarCode = barCode; |
|
|
list.Add(new Tuple<string, object>("BarCode", first.BarCode)); |
|
|
list.Add(new Tuple<string, object>("BarCode", first.BarCode)); |
|
|
list.Add(new Tuple<string, object>("InStoreWeight", first.InStoreWeight)); |
|
|
list.Add(new Tuple<string, object>("InStoreWeight", first.InStoreWeight)); |
|
|
@ -199,9 +195,9 @@ namespace ButcherFactory.BO.LocalBL |
|
|
return JsonConvert.DeserializeObject<List<ProductBatch>>(json); |
|
|
return JsonConvert.DeserializeObject<List<ProductBatch>>(json); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public static void SubmitDetails(IEnumerable<CarcassSaleOut_Detail> details, SaleOutStore_Detail detail) |
|
|
|
|
|
{ |
|
|
|
|
|
var arr = details.Select(x => new WeightRecord { Flag = (!string.IsNullOrEmpty(x.BarCode) && x.BarCode.StartsWith("P")) ? -1 : 0, ID = x.ID, WeightTime = x.Time, MainUnitNum = x.Weight, SecondNumber = x.Number, ProductBatch_ID = x.ProductBatch_ID, BarCode = x.BarCode }); |
|
|
|
|
|
|
|
|
public static void SubmitDetails(IEnumerable<CarcassSaleOut_Detail> details, SaleOutStore_Detail detail,DateTime? mProductTime) |
|
|
|
|
|
{ |
|
|
|
|
|
var arr = details.Select(x => new WeightRecord { Flag = (!string.IsNullOrEmpty(x.BarCode) && x.BarCode.StartsWith("P")) ? -1 : 0, ID = x.ID, WeightTime = x.Time, MainUnitNum = x.Weight, SecondNumber = x.Number, ProductBatch_ID = x.ProductBatch_ID, BarCode = x.BarCode, ProductTime = mProductTime }); |
|
|
var json = RpcFacade.Call<string>(RpcPath + "SaleOutStoreRpc/SaveWeightRecord", JsonConvert.SerializeObject(arr), detail.ID); |
|
|
var json = RpcFacade.Call<string>(RpcPath + "SaleOutStoreRpc/SaveWeightRecord", JsonConvert.SerializeObject(arr), detail.ID); |
|
|
var back = JsonConvert.DeserializeObject<Tuple<decimal?, decimal?, List<ExtensionObj>>>(json); |
|
|
var back = JsonConvert.DeserializeObject<Tuple<decimal?, decimal?, List<ExtensionObj>>>(json); |
|
|
using (var session = DmoSession.New()) |
|
|
using (var session = DmoSession.New()) |
|
|
@ -239,12 +235,12 @@ namespace ButcherFactory.BO.LocalBL |
|
|
delete.EExecute(); |
|
|
delete.EExecute(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public static void AddAndUpdate(CarcassSaleOut_Detail detail, int flag) |
|
|
|
|
|
|
|
|
public static void AddAndUpdate(CarcassSaleOut_Detail detail, int flag,DateTime? productTime) |
|
|
{ |
|
|
{ |
|
|
using (var session = DmoSession.New()) |
|
|
using (var session = DmoSession.New()) |
|
|
{ |
|
|
{ |
|
|
session.Insert(detail); |
|
|
|
|
|
var arr = new List<WeightRecord> { new WeightRecord { Flag = flag, ID = detail.ID, WeightTime = detail.Time, MainUnitNum = detail.Weight, SecondNumber = detail.Number } }; |
|
|
|
|
|
|
|
|
session.Insert(detail); |
|
|
|
|
|
var arr = new List<WeightRecord> { new WeightRecord { Flag = flag, ID = detail.ID, WeightTime = detail.Time, MainUnitNum = detail.Weight, SecondNumber = detail.Number, ProductTime = productTime } }; |
|
|
var json = RpcFacade.Call<string>(RpcPath + "SaleOutStoreRpc/SaveWeightRecord", JsonConvert.SerializeObject(arr), detail.DetailID); |
|
|
var json = RpcFacade.Call<string>(RpcPath + "SaleOutStoreRpc/SaveWeightRecord", JsonConvert.SerializeObject(arr), detail.DetailID); |
|
|
var back = JsonConvert.DeserializeObject<Tuple<decimal?, decimal?, List<ExtensionObj>>>(json); |
|
|
var back = JsonConvert.DeserializeObject<Tuple<decimal?, decimal?, List<ExtensionObj>>>(json); |
|
|
|
|
|
|
|
|
@ -428,6 +424,7 @@ namespace ButcherFactory.BO.LocalBL |
|
|
public long? ProductBatch_ID { get; set; } |
|
|
public long? ProductBatch_ID { get; set; } |
|
|
public DateTime WeightTime { get; set; } |
|
|
public DateTime WeightTime { get; set; } |
|
|
public decimal? MainUnitNum { get; set; } |
|
|
public decimal? MainUnitNum { get; set; } |
|
|
public decimal? SecondNumber { get; set; } |
|
|
|
|
|
|
|
|
public decimal? SecondNumber { get; set; } |
|
|
|
|
|
public DateTime? ProductTime { get; set; } |
|
|
} |
|
|
} |
|
|
} |
|
|
} |