Browse Source

修改。

master
yibo 8 years ago
parent
commit
1059bbe0d4
7 changed files with 38 additions and 18 deletions
  1. +2
    -0
      BO/BO/Bill/OrderDetail/HurryRecord.cs
  2. +22
    -0
      BO/CTuple.cs
  3. +2
    -2
      BO/Utils/BillRpc/WeightBillRpc.cs
  4. +3
    -0
      ButcherWeight/WeightForm.cs
  5. +3
    -14
      QualityAndOrder/HurryRecordPrint.cs
  6. +4
    -1
      QualityAndOrder/HurryRecordView.cs
  7. +2
    -1
      QualityAndOrder/QualityOrderFormForTab3.cs

+ 2
- 0
BO/BO/Bill/OrderDetail/HurryRecord.cs View File

@ -25,5 +25,7 @@ namespace BO.BO.Bill
public DateTime Time { get; set; } public DateTime Time { get; set; }
public long? ToOrderDetail_ID { get; set; } public long? ToOrderDetail_ID { get; set; }
public int TotalNumber { get; set; }
} }
} }

+ 22
- 0
BO/CTuple.cs View File

@ -39,4 +39,26 @@ namespace BO
Item3 = t3; Item3 = t3;
} }
} }
public class CTuple<T1, T2, T3, T4>
{
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;
}
}
} }

+ 2
- 2
BO/Utils/BillRpc/WeightBillRpc.cs View File

@ -92,11 +92,11 @@ namespace BO.Utils.BillRpc
return serializer.Deserialize<List<CTuple<long, long>>>(json); return serializer.Deserialize<List<CTuple<long, long>>>(json);
} }
public static List<CTuple<long, long?, decimal?>> SyncBillB3IdsAndSanctionMoney()
public static List<CTuple<long, long?, decimal?, string>> SyncBillB3IdsAndSanctionMoney()
{ {
const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/WeightBillRpc/SyncBillB3IdsAndSanctionMoney"; const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/WeightBillRpc/SyncBillB3IdsAndSanctionMoney";
var json = RpcFacade.Call<string>(method, DateTime.Today); var json = RpcFacade.Call<string>(method, DateTime.Today);
return serializer.Deserialize<List<CTuple<long, long?, decimal?>>>(json);
return serializer.Deserialize<List<CTuple<long, long?, decimal?, string>>>(json);
} }
public static PrintWeightBill GetPrintWeightBill(long id) public static PrintWeightBill GetPrintWeightBill(long id)


+ 3
- 0
ButcherWeight/WeightForm.cs View File

@ -94,6 +94,7 @@ namespace ButcherWeight
{ {
first.B3ID = item.Item2; first.B3ID = item.Item2;
first.SanctionMoney = item.Item3; first.SanctionMoney = item.Item3;
first.HouseNames = item.Item4;
if (!changed) if (!changed)
changed = true; changed = true;
} }
@ -529,6 +530,8 @@ namespace ButcherWeight
if (Dmo.ID == 0) if (Dmo.ID == 0)
throw new Exception("请先保存"); throw new Exception("请先保存");
var entity = WeightBillRpc.GetPrintWeightBill(Dmo.ID); 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()); ClientPrint.BwpClientPrint print = new ClientPrint.BwpClientPrint("WeightBillPrint.xaml", entity, new DocumentRenderer());
print.PrintDirect(); print.PrintDirect();
WeightBillRpc.DoCheck(Dmo.ID); WeightBillRpc.DoCheck(Dmo.ID);


+ 3
- 14
QualityAndOrder/HurryRecordPrint.cs View File

@ -20,22 +20,11 @@ namespace QualityAndOrder
var y = 50; var y = 50;
var cIdx = 1; 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)); 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<string>();
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); 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)); 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));


+ 4
- 1
QualityAndOrder/HurryRecordView.cs View File

@ -17,11 +17,13 @@ namespace QualityAndOrder
{ {
bool changed = false; bool changed = false;
List<HurryRecord> mRecords; List<HurryRecord> mRecords;
public HurryRecordView(long fromOrderID)
int mTotalNumber = 0;
public HurryRecordView(long fromOrderID,int totalNumbet)
{ {
InitializeComponent(); InitializeComponent();
recordGridView.AutoGenerateColumns = false; recordGridView.AutoGenerateColumns = false;
mRecords = OrderDetailRpc.GetHurryRecordList(fromOrderID).OrderBy(x => x.ID).ToList(); mRecords = OrderDetailRpc.GetHurryRecordList(fromOrderID).OrderBy(x => x.ID).ToList();
mTotalNumber = totalNumbet;
recordGridView.DataSource = null; recordGridView.DataSource = null;
recordGridView.DataSource = mRecords; recordGridView.DataSource = mRecords;
recordGridView.Refresh(); recordGridView.Refresh();
@ -56,6 +58,7 @@ namespace QualityAndOrder
} }
else else
{ {
entity.TotalNumber = mTotalNumber;
HurryRecordPrint.Print(entity); HurryRecordPrint.Print(entity);
} }
} }


+ 2
- 1
QualityAndOrder/QualityOrderFormForTab3.cs View File

@ -143,6 +143,7 @@ namespace QualityAndOrder
throw new Exception("急宰头数多余排宰头数"); throw new Exception("急宰头数多余排宰头数");
bool hasError = false; bool hasError = false;
var record = OrderDetailRpc.InsertHurryRecord(lastHurry,out hasError); var record = OrderDetailRpc.InsertHurryRecord(lastHurry,out hasError);
record.TotalNumber = lastHurry.WeightNumber;
if (hasError) if (hasError)
UMessageBox.Show("排宰顺序出现多条记录,请手动修改", "注意"); UMessageBox.Show("排宰顺序出现多条记录,请手动修改", "注意");
lastHurry.HurryNumber = OrderDetailRpc.GetHurryRecordNumber(lastHurry.WeightBill_ID); lastHurry.HurryNumber = OrderDetailRpc.GetHurryRecordNumber(lastHurry.WeightBill_ID);
@ -151,7 +152,7 @@ namespace QualityAndOrder
} }
else//查看 else//查看
{ {
var view = new HurryRecordView(lastHurry.WeightBill_ID);
var view = new HurryRecordView(lastHurry.WeightBill_ID, lastHurry.WeightNumber);
if (view.ShowDialog() == DialogResult.OK) if (view.ShowDialog() == DialogResult.OK)
{ {
lastHurry.HurryNumber -= view.Result; lastHurry.HurryNumber -= view.Result;


Loading…
Cancel
Save