|
|
|
@ -113,6 +113,7 @@ namespace WeighBusiness.BL |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//以前逻辑
|
|
|
|
public static void UpdateButhcerDetailFinishNum(decimal? finishNum,decimal? detailID,long? goodsId, SqlHelperEx she2 = null) |
|
|
|
{ |
|
|
|
string excuteSql = string.Empty; |
|
|
|
@ -143,7 +144,69 @@ namespace WeighBusiness.BL |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//现在逻辑
|
|
|
|
public static void UpdateButhcerDetailFinishNum(ButcherDetailData data,decimal? finishNum, decimal? detailID, long? goodsId, SqlHelperEx she2 = null) |
|
|
|
{ |
|
|
|
string excuteSql = string.Empty; |
|
|
|
var table = SqlHelperEx.DoQuery("select ID from {0} where DetailID = {1}".FormatWith(TableNames.生产计划分割明细完工数量, detailID)); |
|
|
|
if (table.Rows.Count > 0) |
|
|
|
{ |
|
|
|
excuteSql = string.Format("update " + TableNames.生产计划分割明细完工数量 + " set FinishNumber = {0} where DetailID ={1}", finishNum, detailID); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
excuteSql = InsertUtil.GetInsertSql(TableNames.生产计划分割明细完工数量, |
|
|
|
new string[] { "DetailID", "Goods_ID", "FinishNumber" }, |
|
|
|
new string[] { detailID.ToString(), goodsId.ToString(), (finishNum ?? 0).ToString() }); |
|
|
|
} |
|
|
|
|
|
|
|
bool success = true; |
|
|
|
if (she2 == null) |
|
|
|
{ |
|
|
|
using (var she = new SqlHelperEx()) |
|
|
|
{ |
|
|
|
she.CreateTransaction(); |
|
|
|
she.ExecuteNonQuery(excuteSql, out success); |
|
|
|
if (!success) |
|
|
|
{ |
|
|
|
she.Rollback(); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
she.Commit(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
she2.ExecuteNonQuery(excuteSql, out success); |
|
|
|
if (!success) |
|
|
|
{ |
|
|
|
she2.Rollback(); |
|
|
|
} |
|
|
|
} |
|
|
|
if (success) |
|
|
|
{ |
|
|
|
try |
|
|
|
{ |
|
|
|
var usId = UserBL.CurrentUser.ERP_User_ID; |
|
|
|
//更新数量
|
|
|
|
var method = "/MainSystem/B3_HaoYue/Rpcs/DeliveryNumberInfoRpc/InsertOrUpdateDeliveryNumber"; |
|
|
|
var deliveryNum = RpcFacade.Call<decimal>(method, usId, finishNum, detailID); |
|
|
|
data.DeliveryNumber = deliveryNum; |
|
|
|
|
|
|
|
} |
|
|
|
catch |
|
|
|
{ |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public static string Delete(long ID) |
|
|
|
{ |
|
|
|
@ -339,6 +402,28 @@ namespace WeighBusiness.BL |
|
|
|
list.Add(outDetail); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
try |
|
|
|
{ |
|
|
|
//获取全部的完工数量
|
|
|
|
var details = list.Select(x => x.DetailID).Distinct().ToList(); |
|
|
|
var method = "/MainSystem/B3_HaoYue/Rpcs/DeliveryNumberInfoRpc/GetDeliveryNumberInfo"; |
|
|
|
var deliveryInfo = RpcFacade.Call<List<Tuple<long?, decimal?>>>(method, details.ToArray()); |
|
|
|
foreach(var tuple in deliveryInfo) |
|
|
|
{ |
|
|
|
if (tuple.Item1 == null) |
|
|
|
continue; |
|
|
|
foreach(var detail in list.Where(x=> x.DetailID == tuple.Item1.Value)) |
|
|
|
{ |
|
|
|
detail.DeliveryNumber = tuple.Item2; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
catch |
|
|
|
{ |
|
|
|
|
|
|
|
} |
|
|
|
return list; |
|
|
|
} |
|
|
|
} |
|
|
|
@ -356,6 +441,9 @@ namespace WeighBusiness.BL |
|
|
|
public DateTime? DeliveryDate { get; set; } |
|
|
|
public string DeliveryDateStr { get; set; } |
|
|
|
private decimal? mFinishNum; |
|
|
|
/// <summary>
|
|
|
|
/// 本机完工数量
|
|
|
|
/// </summary>
|
|
|
|
public decimal? FinishNum |
|
|
|
{ |
|
|
|
get |
|
|
|
@ -372,6 +460,29 @@ namespace WeighBusiness.BL |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private decimal? mDeliveryNumber; |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 整个系统中的完工数量
|
|
|
|
/// </summary>
|
|
|
|
public decimal? DeliveryNumber |
|
|
|
{ |
|
|
|
get |
|
|
|
{ |
|
|
|
return mDeliveryNumber; |
|
|
|
} |
|
|
|
|
|
|
|
set |
|
|
|
{ |
|
|
|
mDeliveryNumber = value; |
|
|
|
if (PropertyChanged != null) |
|
|
|
{ |
|
|
|
PropertyChanged(this, new PropertyChangedEventArgs("DeliveryNumber")); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private decimal? mSurplusNum; |
|
|
|
public decimal? SurplusNum |
|
|
|
{ |
|
|
|
|