From 1059bbe0d411d9f3f0c24b24e09db119d88cd9f4 Mon Sep 17 00:00:00 2001 From: yibo <361071264@qq.com> Date: Tue, 31 Oct 2017 22:33:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BO/BO/Bill/OrderDetail/HurryRecord.cs | 2 ++ BO/CTuple.cs | 22 ++++++++++++++++++++++ BO/Utils/BillRpc/WeightBillRpc.cs | 4 ++-- ButcherWeight/WeightForm.cs | 3 +++ QualityAndOrder/HurryRecordPrint.cs | 17 +++-------------- QualityAndOrder/HurryRecordView.cs | 5 ++++- QualityAndOrder/QualityOrderFormForTab3.cs | 3 ++- 7 files changed, 38 insertions(+), 18 deletions(-) diff --git a/BO/BO/Bill/OrderDetail/HurryRecord.cs b/BO/BO/Bill/OrderDetail/HurryRecord.cs index 813a67e..b303877 100644 --- a/BO/BO/Bill/OrderDetail/HurryRecord.cs +++ b/BO/BO/Bill/OrderDetail/HurryRecord.cs @@ -25,5 +25,7 @@ namespace BO.BO.Bill public DateTime Time { get; set; } public long? ToOrderDetail_ID { get; set; } + + public int TotalNumber { get; set; } } } diff --git a/BO/CTuple.cs b/BO/CTuple.cs index 15306f5..4f1e3dc 100644 --- a/BO/CTuple.cs +++ b/BO/CTuple.cs @@ -39,4 +39,26 @@ namespace BO Item3 = t3; } } + + public class CTuple + { + public T1 Item1 { get; set; } + + public T2 Item2 { get; set; } + + public T3 Item3 { get; set; } + + public T4 Item4 { get; set; } + + public CTuple() + { } + + public CTuple(T1 t1, T2 t2, T3 t3, T4 t4) + { + Item1 = t1; + Item2 = t2; + Item3 = t3; + Item4 = t4; + } + } } diff --git a/BO/Utils/BillRpc/WeightBillRpc.cs b/BO/Utils/BillRpc/WeightBillRpc.cs index 60da9f4..2805772 100644 --- a/BO/Utils/BillRpc/WeightBillRpc.cs +++ b/BO/Utils/BillRpc/WeightBillRpc.cs @@ -92,11 +92,11 @@ namespace BO.Utils.BillRpc return serializer.Deserialize>>(json); } - public static List> SyncBillB3IdsAndSanctionMoney() + public static List> SyncBillB3IdsAndSanctionMoney() { const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/WeightBillRpc/SyncBillB3IdsAndSanctionMoney"; var json = RpcFacade.Call(method, DateTime.Today); - return serializer.Deserialize>>(json); + return serializer.Deserialize>>(json); } public static PrintWeightBill GetPrintWeightBill(long id) diff --git a/ButcherWeight/WeightForm.cs b/ButcherWeight/WeightForm.cs index 155b902..391ce0b 100644 --- a/ButcherWeight/WeightForm.cs +++ b/ButcherWeight/WeightForm.cs @@ -94,6 +94,7 @@ namespace ButcherWeight { first.B3ID = item.Item2; first.SanctionMoney = item.Item3; + first.HouseNames = item.Item4; if (!changed) changed = true; } @@ -529,6 +530,8 @@ namespace ButcherWeight if (Dmo.ID == 0) throw new Exception("请先保存"); var entity = WeightBillRpc.GetPrintWeightBill(Dmo.ID); + if (string.IsNullOrEmpty(entity.Supplier_Name)) + throw new Exception("缺少供应商信息,打印失败"); ClientPrint.BwpClientPrint print = new ClientPrint.BwpClientPrint("WeightBillPrint.xaml", entity, new DocumentRenderer()); print.PrintDirect(); WeightBillRpc.DoCheck(Dmo.ID); diff --git a/QualityAndOrder/HurryRecordPrint.cs b/QualityAndOrder/HurryRecordPrint.cs index 4871567..d514bc6 100644 --- a/QualityAndOrder/HurryRecordPrint.cs +++ b/QualityAndOrder/HurryRecordPrint.cs @@ -20,22 +20,11 @@ namespace QualityAndOrder var y = 50; var cIdx = 1; PrintAPI.B_Prn_Text_TrueType(300, y += 40, 32, "宋体", 1, 600, 0, 0, 0, "C" + (++cIdx), string.Format("磅单号:{0}", entity.B3WeighBill_ID)); - var supplierName = new List(); - if (entity.Supplier_Name.Length > 6) - { - supplierName.Add(entity.Supplier_Name.Substring(0, 6)); - supplierName.Add(entity.Supplier_Name.Substring(6)); - if (supplierName[1].Length > 11) - supplierName[1] = supplierName[1].Substring(0, 11); - } - else - supplierName.Add(entity.Supplier_Name); + ; - PrintAPI.B_Prn_Text_TrueType(300, y += 40, 32, "宋体", 1, 600, 0, 0, 0, "C" + (++cIdx), string.Format("供应商:{0}", supplierName[0])); - if (supplierName.Count == 2) - PrintAPI.B_Prn_Text_TrueType(300, y += 40, 32, "宋体", 1, 600, 0, 0, 0, "C" + (++cIdx), supplierName[1]); + PrintAPI.B_Prn_Text_TrueType(300, y += 40, 32, "宋体", 1, 600, 0, 0, 0, "C" + (++cIdx), string.Format("总头数:{0}", entity.TotalNumber)); - PrintAPI.B_Prn_Text_TrueType(300, y += 40, 32, "宋体", 1, 600, 0, 0, 0, "C" + (++cIdx), string.Format("头 数:{0}", entity.HurryNumber)); + PrintAPI.B_Prn_Text_TrueType(300, y += 40, 32, "宋体", 1, 600, 0, 0, 0, "C" + (++cIdx), string.Format("急宰头数:{0}", entity.HurryNumber)); var names = GetHouseNames(entity.LiveColonyHouse_Name); PrintAPI.B_Prn_Text_TrueType(300, y += 40, 32, "宋体", 1, 600, 0, 0, 0, "C" + (++cIdx), string.Format("圈 舍:{0}", names.Any() ? names[0] : string.Empty)); diff --git a/QualityAndOrder/HurryRecordView.cs b/QualityAndOrder/HurryRecordView.cs index ac7f425..fff9e03 100644 --- a/QualityAndOrder/HurryRecordView.cs +++ b/QualityAndOrder/HurryRecordView.cs @@ -17,11 +17,13 @@ namespace QualityAndOrder { bool changed = false; List mRecords; - public HurryRecordView(long fromOrderID) + int mTotalNumber = 0; + public HurryRecordView(long fromOrderID,int totalNumbet) { InitializeComponent(); recordGridView.AutoGenerateColumns = false; mRecords = OrderDetailRpc.GetHurryRecordList(fromOrderID).OrderBy(x => x.ID).ToList(); + mTotalNumber = totalNumbet; recordGridView.DataSource = null; recordGridView.DataSource = mRecords; recordGridView.Refresh(); @@ -56,6 +58,7 @@ namespace QualityAndOrder } else { + entity.TotalNumber = mTotalNumber; HurryRecordPrint.Print(entity); } } diff --git a/QualityAndOrder/QualityOrderFormForTab3.cs b/QualityAndOrder/QualityOrderFormForTab3.cs index 4929904..5c10bf2 100644 --- a/QualityAndOrder/QualityOrderFormForTab3.cs +++ b/QualityAndOrder/QualityOrderFormForTab3.cs @@ -143,6 +143,7 @@ namespace QualityAndOrder throw new Exception("急宰头数多余排宰头数"); bool hasError = false; var record = OrderDetailRpc.InsertHurryRecord(lastHurry,out hasError); + record.TotalNumber = lastHurry.WeightNumber; if (hasError) UMessageBox.Show("排宰顺序出现多条记录,请手动修改", "注意"); lastHurry.HurryNumber = OrderDetailRpc.GetHurryRecordNumber(lastHurry.WeightBill_ID); @@ -151,7 +152,7 @@ namespace QualityAndOrder } else//查看 { - var view = new HurryRecordView(lastHurry.WeightBill_ID); + var view = new HurryRecordView(lastHurry.WeightBill_ID, lastHurry.WeightNumber); if (view.ShowDialog() == DialogResult.OK) { lastHurry.HurryNumber -= view.Result;