Browse Source

新增加功能

master
wugang 7 years ago
parent
commit
6eb2d9d212
3 changed files with 18 additions and 9 deletions
  1. +13
    -5
      CowOutputClient/OperateWindow.xaml.cs
  2. +3
    -2
      WeighBusiness/BL/ProductCatalogBL.cs
  3. +2
    -2
      WeighBusiness/BL/ProductPlanBL.cs

+ 13
- 5
CowOutputClient/OperateWindow.xaml.cs View File

@ -104,7 +104,8 @@ namespace CowOutputClient
for (int i = 1; i < list.Count; i++) { for (int i = 1; i < list.Count; i++) {
ProductPlanBL.UpdateButhcerDetailFinish(list[i].Value); ProductPlanBL.UpdateButhcerDetailFinish(list[i].Value);
var result = butDetails.Where(x => x.DetailID == list[i].Value); var result = butDetails.Where(x => x.DetailID == list[i].Value);
butDetails.Remove(result.First());
if (result.Count() > 0)
butDetails.Remove(result.First());
} }
var resultList = new List<ButcherDetailData>(); var resultList = new List<ButcherDetailData>();
foreach (var item in butDetails) { foreach (var item in butDetails) {
@ -272,6 +273,8 @@ namespace CowOutputClient
//weight.Weight = goodsWeight.Value; //weight.Weight = goodsWeight.Value;
weight.SubWeight = tare; weight.SubWeight = tare;
weight.NetWeight = weight.Weight - (weight.SubWeight??0); weight.NetWeight = weight.Weight - (weight.SubWeight??0);
if (weight.NetWeight < 0)
throw new ApplicationException("毛重"+weight.Weight+",皮重"+weight.SubWeight+",净重"+weight.NetWeight+"小于零,不能录入");
weight.CreateTime = DateTime.Now; weight.CreateTime = DateTime.Now;
if (rbSingleWeight.IsChecked == true) if (rbSingleWeight.IsChecked == true)
weight.ProductNum = 1; weight.ProductNum = 1;
@ -281,8 +284,10 @@ namespace CowOutputClient
if (mButcherDetailData != null && detail.Goods_ID == mButcherDetailData.Goods_ID) { if (mButcherDetailData != null && detail.Goods_ID == mButcherDetailData.Goods_ID) {
weight.ButcDetailID = mButcherDetailData.DetailID; weight.ButcDetailID = mButcherDetailData.DetailID;
finishNum = (mButcherDetailData.FinishNum ?? 0) + weight.NetWeight; finishNum = (mButcherDetailData.FinishNum ?? 0) + weight.NetWeight;
if (finishNum > mButcherDetailData.PlanNumber)
throw new ApplicationException("计划数量【"+mButcherDetailData.PlanNumber+"】完工数量【"+finishNum+"】超出【"+(finishNum-mButcherDetailData.PlanNumber)+"】");
if (finishNum > mButcherDetailData.PlanNumber) {
var infoWindow = new AutoCloseWindow("计划数量【" + mButcherDetailData.PlanNumber + "】完工数量【" + finishNum + "】超出【" + (finishNum - mButcherDetailData.PlanNumber) + "】");
infoWindow.ShowDialog();
}
ProductPlanBL.UpdateButhcerDetailFinishNum(finishNum, mButcherDetailData.DetailID, mButcherDetailData.Goods_ID, she); ProductPlanBL.UpdateButhcerDetailFinishNum(finishNum, mButcherDetailData.DetailID, mButcherDetailData.Goods_ID, she);
//weight.DetailSequence = WeightInfoBL.GetCurrentSequence(mButcherDetailData.DetailID); //weight.DetailSequence = WeightInfoBL.GetCurrentSequence(mButcherDetailData.DetailID);
} }
@ -429,7 +434,8 @@ namespace CowOutputClient
for (int i = 1; i < list.Count; i++) { for (int i = 1; i < list.Count; i++) {
ProductPlanBL.UpdateButhcerDetailFinish(list[i].Value); ProductPlanBL.UpdateButhcerDetailFinish(list[i].Value);
var result = butDetails.Where(x => x.DetailID == list[i].Value); var result = butDetails.Where(x => x.DetailID == list[i].Value);
butDetails.Remove(result.First());
if(result.Count() > 0)
butDetails.Remove(result.First());
} }
var resultList = new List<ButcherDetailData>(); var resultList = new List<ButcherDetailData>();
foreach (var item in butDetails) { foreach (var item in butDetails) {
@ -441,7 +447,9 @@ namespace CowOutputClient
WindowUtil.Inf("生成产出单No." + outputId); WindowUtil.Inf("生成产出单No." + outputId);
} }
mButcherDetailData = null;
if (mButcherDetailData!=null && mButcherDetailData.DetailID == selectedItem.DetailID) {
mButcherDetailData = null;
}
//var num = RpcFacade.Call<int>("/MainSystem/B3_HaoYue/Rpcs/B3CowButcherManageRpc/FinishButcherDetail", selectedItem.DetailID); //var num = RpcFacade.Call<int>("/MainSystem/B3_HaoYue/Rpcs/B3CowButcherManageRpc/FinishButcherDetail", selectedItem.DetailID);
//if (num == 1) { //if (num == 1) {
// ProductPlanBL.UpdateButhcerDetailFinish(selectedItem.DetailID); // ProductPlanBL.UpdateButhcerDetailFinish(selectedItem.DetailID);


+ 3
- 2
WeighBusiness/BL/ProductCatalogBL.cs View File

@ -111,8 +111,9 @@ namespace WeighBusiness.BL
var method = "/MainSystem/B3_HaoYue/Rpcs/B3CowButcherManageRpc/GetProductCatalogRowVersion"; var method = "/MainSystem/B3_HaoYue/Rpcs/B3CowButcherManageRpc/GetProductCatalogRowVersion";
if (domain_ID != null && !string.IsNullOrEmpty(domain_ID.ToString())) { if (domain_ID != null && !string.IsNullOrEmpty(domain_ID.ToString())) {
var productCatalogRowVersion = RpcFacade.Call<List<Tuple<long?, int?, string>>>(method, long.Parse(domain_ID)); var productCatalogRowVersion = RpcFacade.Call<List<Tuple<long?, int?, string>>>(method, long.Parse(domain_ID));
var oldpCatalogRowVersion = GetProductCatalogRowVersion();
Delete();
//var oldpCatalogRowVersion = GetProductCatalogRowVersion();
var oldpCatalogRowVersion = new List<ProductCatalog>();
var needInsertCatalogID = new List<long?>(); var needInsertCatalogID = new List<long?>();
var needDeleteAndInsertCatalogID = new List<long?>(); var needDeleteAndInsertCatalogID = new List<long?>();
if (productCatalogRowVersion.Count > 0) { if (productCatalogRowVersion.Count > 0) {


+ 2
- 2
WeighBusiness/BL/ProductPlanBL.cs View File

@ -274,9 +274,9 @@ namespace WeighBusiness.BL
var list = new List<ProductBatch>(); var list = new List<ProductBatch>();
var querySql = string.Empty; var querySql = string.Empty;
if (!isLoad) { if (!isLoad) {
querySql = "select Batch_ID,Batch from {0} where BillDate >='{1}' and BillDate < '{2}'".FormatWith(TableNames., startDate, date.AddDays(1));
querySql = "select Batch_ID,Batch from {0} where BillDate >='{1}' and BillDate < '{2}' order by BillDate desc".FormatWith(TableNames., startDate, date.AddDays(1));
} else { } else {
querySql = "select Batch_ID,Batch from {0}".FormatWith(TableNames., startDate.AddDays(1));
querySql = "select Batch_ID,Batch from {0} order by BillDate desc".FormatWith(TableNames., startDate.AddDays(1));
} }
var table = SqlHelperEx.DoQuery(querySql); var table = SqlHelperEx.DoQuery(querySql);
if (table.Rows.Count == 0) if (table.Rows.Count == 0)


Loading…
Cancel
Save