From 0730f6b611def04228e179bf0e6d9b61458eb3d8 Mon Sep 17 00:00:00 2001
From: yibo <361071264@qq.com>
Date: Tue, 19 Sep 2017 21:19:40 +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.csproj | 3 +
BO/BO/Bill/GradeAndWeight/GradeAndWeight.cs | 23 +
.../GradeAndWeight/GradeAndWeight_Detail.cs | 31 +
BO/Utils/AfterLoginUtil.cs | 6 +-
BO/Utils/BaseInfoRpcUtil.cs | 9 +
BO/Utils/BillRpc/GradeAndWeightRpc.cs | 43 +
BWP.WinFormControl/BWP.WinFormControl.csproj | 5 +-
BWP.WinFormControl/TabButtonBackground.bmp | Bin 7314 -> 0 bytes
BWP.WinFormControl/UComboBox.cs | 47 ++
BWP.WinFormControl/User32ClassUtil.cs | 53 ++
BWP.WinFormControl/WinApiSendMessage.cs | 23 -
ButcherWeight/WeightContext.cs | 2 +-
ButcherWeight/WeightForm.Designer.cs | 355 +++++----
ButcherWeight/WeightForm.resx | 3 +
Setup/Release/Setup.msi | Bin 1290240 -> 1306112 bytes
WeighAndGrading/GradeContext.cs | 80 ++
WeighAndGrading/GradeFrom.Designer.cs | 735 ++++++++++++++----
WeighAndGrading/GradeFrom.cs | 484 +++++++++++-
WeighAndGrading/GradeFrom.resx | 38 +-
WeighAndGrading/GradeSettingFrom.Designer.cs | 229 ++++++
WeighAndGrading/GradeSettingFrom.cs | 78 ++
WeighAndGrading/GradeSettingFrom.resx | 120 +++
WeighAndGrading/PrintAPI.cs | 93 +++
WeighAndGrading/WeighAndGrading.csproj | 19 +
24 files changed, 2116 insertions(+), 363 deletions(-)
create mode 100644 BO/BO/Bill/GradeAndWeight/GradeAndWeight.cs
create mode 100644 BO/BO/Bill/GradeAndWeight/GradeAndWeight_Detail.cs
create mode 100644 BO/Utils/BillRpc/GradeAndWeightRpc.cs
delete mode 100644 BWP.WinFormControl/TabButtonBackground.bmp
create mode 100644 BWP.WinFormControl/User32ClassUtil.cs
delete mode 100644 BWP.WinFormControl/WinApiSendMessage.cs
create mode 100644 WeighAndGrading/GradeContext.cs
create mode 100644 WeighAndGrading/GradeSettingFrom.Designer.cs
create mode 100644 WeighAndGrading/GradeSettingFrom.cs
create mode 100644 WeighAndGrading/GradeSettingFrom.resx
create mode 100644 WeighAndGrading/PrintAPI.cs
diff --git a/BO/BO.csproj b/BO/BO.csproj
index 97a3412..fce95d8 100644
--- a/BO/BO.csproj
+++ b/BO/BO.csproj
@@ -53,12 +53,15 @@
+
+
+
diff --git a/BO/BO/Bill/GradeAndWeight/GradeAndWeight.cs b/BO/BO/Bill/GradeAndWeight/GradeAndWeight.cs
new file mode 100644
index 0000000..fbea778
--- /dev/null
+++ b/BO/BO/Bill/GradeAndWeight/GradeAndWeight.cs
@@ -0,0 +1,23 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BO.BO.Bill
+{
+ public class GradeAndWeight
+ {
+ public long OrderDetail_ID { get; set; }
+
+ public int Order { get; set; }
+
+ public string Technics_Name { get; set; }
+
+ public int Number { get; set; }
+
+ public int Already { get; set; }
+
+ public bool Finish { get { return Number == Already; } set { } }
+ }
+}
diff --git a/BO/BO/Bill/GradeAndWeight/GradeAndWeight_Detail.cs b/BO/BO/Bill/GradeAndWeight/GradeAndWeight_Detail.cs
new file mode 100644
index 0000000..9192c6b
--- /dev/null
+++ b/BO/BO/Bill/GradeAndWeight/GradeAndWeight_Detail.cs
@@ -0,0 +1,31 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BO.BO.Bill
+{
+ public class GradeAndWeight_Detail
+ {
+ public long ID { get; set; }
+
+ public int Index { get; set; }
+
+ public long OrderDetail_ID { get; set; }
+
+ public int Order { get; set; }
+
+ public short Technics { get; set; }
+
+ public string Technics_Name { get; set; }
+
+ public long Livestock_ID { get; set; }
+
+ public string Livestock_Name { get; set; }
+
+ public decimal? Weight { get; set; }
+
+ public DateTime Time { get; set; }
+ }
+}
diff --git a/BO/Utils/AfterLoginUtil.cs b/BO/Utils/AfterLoginUtil.cs
index 98efbca..bc11500 100644
--- a/BO/Utils/AfterLoginUtil.cs
+++ b/BO/Utils/AfterLoginUtil.cs
@@ -21,12 +21,12 @@ namespace BO.Utils
//#if debug
static List> roleToAssemblies = new List>(){new Tuple("排宰员",@"C:\BwpB3Project\src\B3ButcherManageClient\ButcherOrder\bin\Debug\ButcherOrder"),
new Tuple("过磅员",@"C:\BwpB3Project\src\B3ButcherManageClient\ButcherWeight\bin\Debug\ButcherWeight"),
- new Tuple("验质员",@"C:\BwpB3Project\src\B3ButcherManageClient\QualityAndOrder\bin\Debug\QualityAndOrder")};
+ new Tuple("验质员",@"C:\BwpB3Project\src\B3ButcherManageClient\QualityAndOrder\bin\Debug\QualityAndOrder"),new Tuple("定级员",@"C:\BwpB3Project\src\B3ButcherManageClient\WeighAndGrading\bin\Debug\WeighAndGrading")};
//#endif
//#if !debug
// static List> roleToAssemblies = new List>(){new Tuple("排宰员",@"ButcherOrder"),
//new Tuple("过磅员",@"ButcherWeight"),
- // new Tuple("验质员",@"QualityAndOrder")};
+ // new Tuple("验质员",@"QualityAndOrder"),new Tuple("定级员",@"WeighAndGrading")};
//#endif
@@ -39,7 +39,7 @@ namespace BO.Utils
var filePath = string.Format("{0}.dll", first.Item2);
//#endif
//#if !debug
- //var filePath = Path.Combine(Application.StartupPath, string.Format("{0}.dll", first.Item2));
+ // var filePath = Path.Combine(Application.StartupPath, string.Format("{0}.dll", first.Item2));
//#endif
if (!File.Exists(filePath))
throw new Exception("相关模块不存在");
diff --git a/BO/Utils/BaseInfoRpcUtil.cs b/BO/Utils/BaseInfoRpcUtil.cs
index c6fd97e..217b366 100644
--- a/BO/Utils/BaseInfoRpcUtil.cs
+++ b/BO/Utils/BaseInfoRpcUtil.cs
@@ -6,11 +6,14 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
+using System.Web.Script.Serialization;
namespace BO.Utils
{
public static class BaseInfoRpcUtil
{
+ static JavaScriptSerializer serializer = new JavaScriptSerializer();
+
public static List> GetBaseInfoEntity(string rpcName)
{
var list = RpcFacade.Call>(string.Format("/MainSystem/B3ClientService/Rpcs/BaseInfoRpc/{0}", rpcName), null, null, -1);
@@ -34,5 +37,11 @@ namespace BO.Utils
}
return result;
}
+
+ public static List> GetLivestockList()
+ {
+ var list = RpcFacade.Call("/MainSystem/B3ClientService/Rpcs/BaseInfoRpc/GetLivestock");
+ return serializer.Deserialize>>(list);
+ }
}
}
diff --git a/BO/Utils/BillRpc/GradeAndWeightRpc.cs b/BO/Utils/BillRpc/GradeAndWeightRpc.cs
new file mode 100644
index 0000000..aa857f1
--- /dev/null
+++ b/BO/Utils/BillRpc/GradeAndWeightRpc.cs
@@ -0,0 +1,43 @@
+using BO.BO.Bill;
+using Forks.JsonRpc.Client;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Web.Script.Serialization;
+
+namespace BO.Utils.BillRpc
+{
+ public static class GradeAndWeightRpc
+ {
+ static JavaScriptSerializer serializer = new JavaScriptSerializer();
+
+ public static List GetGradeAndWeightList(DateTime date)
+ {
+ const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/GradeAndWeightRpc/GetGradeAndWeightList";
+ var result = RpcFacade.Call(method, date);
+ return serializer.Deserialize>(result);
+ }
+
+ public static List GetDetails(DateTime startDate, DateTime endDate, int? order, int type)
+ {
+ const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/GradeAndWeightRpc/GetDetailsList";
+ var result = RpcFacade.Call(method, startDate, endDate, order, type);
+ result = result.ESerializeDateTime();
+ return serializer.Deserialize>(result);
+ }
+
+ public static void InsertDetail(GradeAndWeight_Detail detail)
+ {
+ const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/GradeAndWeightRpc/InsertDetail";
+ detail.ID = RpcFacade.Call(method, serializer.Serialize(detail));
+ }
+
+ public static void FillDetailWeight(long id, decimal weight)
+ {
+ const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/GradeAndWeightRpc/FillWeight";
+ RpcFacade.Call(method, id, weight);
+ }
+ }
+}
diff --git a/BWP.WinFormControl/BWP.WinFormControl.csproj b/BWP.WinFormControl/BWP.WinFormControl.csproj
index 301a76d..4d5942c 100644
--- a/BWP.WinFormControl/BWP.WinFormControl.csproj
+++ b/BWP.WinFormControl/BWP.WinFormControl.csproj
@@ -88,7 +88,7 @@
WeightControl.cs
-
+
@@ -110,9 +110,6 @@
WeightControl.cs
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/WeighAndGrading/PrintAPI.cs b/WeighAndGrading/PrintAPI.cs
new file mode 100644
index 0000000..1eb669f
--- /dev/null
+++ b/WeighAndGrading/PrintAPI.cs
@@ -0,0 +1,93 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.InteropServices;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace WeighAndGrading
+{
+ public static class PrintAPI
+ {
+ [DllImport("Winpplb.dll")]
+ private static extern int B_GetUSBBufferLen();
+
+ [DllImport("Winpplb.dll")]
+ private static extern int B_EnumUSB(byte[] buf);
+
+ [DllImport("Winpplb.dll")]
+ private static extern int B_CreateUSBPort(int nPort);
+
+ [DllImport("Winpplb.dll")]
+ private static extern int B_Set_Direction(char direction);
+
+ [DllImport("Winpplb.dll")]
+ private static extern int B_Prn_Text_TrueType(int x, int y, int FSize, string FType,
+ int Fspin, int FWeight, int FItalic, int FUnline, int FStrikeOut, string id_name,
+ string data);
+
+ [DllImport("Winpplb.dll")]
+ private static extern int B_Prn_Barcode(int x, int y, int ori, string type, int narrow,
+ int width, int height, char human, string data);
+
+ [DllImport("Winpplb.dll")]
+ private static extern int B_Bar2d_QR(int x, int y, int model, int scl, char error,
+ char dinput, int c, int d, int p, string data);
+
+ [DllImport("Winpplb.dll")]
+ private static extern int B_Print_Out(int labset);
+
+ [DllImport("Winpplb.dll")]
+ private static extern void B_ClosePrn();
+
+
+ public static void Print(PrintEntity entity)
+ {
+ B_GetUSBBufferLen();
+ B_EnumUSB(new byte[128]);
+ B_CreateUSBPort(1);
+
+ B_Prn_Text_TrueType(110, 31, 31, "宋体", 1, 700, 0, 0, 0, "C1", entity.AccountingUnit_Name);
+ B_Prn_Text_TrueType(42, 75, 31, "宋体", 1, 700, 0, 0, 0, "C2", "合格证");
+ B_Prn_Text_TrueType(440, 75, 31, "宋体", 1, 700, 0, 0, 0, "C3", entity.Goods_Name);
+
+ B_Prn_Text_TrueType(42, 125, 27, "宋体", 1, 400, 0, 0, 0, "C4", string.Format("生产日期:{0}", entity.Date.ToString("yyyy/MM/dd")));
+ B_Prn_Text_TrueType(42, 165, 27, "宋体", 1, 400, 0, 0, 0, "C5", string.Format("检 验 员:{0}", entity.Checker));
+ B_Prn_Text_TrueType(42, 205, 27, "宋体", 1, 400, 0, 0, 0, "C6", string.Format("保 质 期:{0}", entity.StoreCondition));
+
+ B_Prn_Text_TrueType(42, 255, 23, "宋体", 1, 400, 0, 0, 0, "C7", string.Format("产地:{0} 电话:{1}", entity.Place, entity.TelNumber));
+ B_Prn_Text_TrueType(42, 290, 23, "宋体", 1, 400, 0, 0, 0, "C8", string.Format("地址:{0}", entity.Address));
+
+ B_Prn_Barcode(42, 330, 0, "1", 3, 22, 35, 'N', entity.BarCode);
+ B_Prn_Text_TrueType(175, 370, 25, "宋体", 1, 500, 0, 0, 0, "C9", entity.BarCode);
+ B_Bar2d_QR(430, 120, 2, 7, 'M', 'A', 0, 0, 0, entity._2DQRCode);
+
+ B_Set_Direction('B');
+ B_Print_Out(1);
+ B_ClosePrn();
+ }
+ }
+
+ public class PrintEntity
+ {
+ public string AccountingUnit_Name { get; set; }
+
+ public string Goods_Name { get; set; }
+
+ public DateTime Date { get; set; }
+
+ public string Checker { get; set; }
+
+ public string StoreCondition { get; set; }
+
+ public string Place { get; set; }
+
+ public string TelNumber { get; set; }
+
+ public string Address { get; set; }
+
+ public string BarCode { get; set; }
+
+ public string _2DQRCode { get; set; }
+ }
+}
diff --git a/WeighAndGrading/WeighAndGrading.csproj b/WeighAndGrading/WeighAndGrading.csproj
index 97283b0..f269ea1 100644
--- a/WeighAndGrading/WeighAndGrading.csproj
+++ b/WeighAndGrading/WeighAndGrading.csproj
@@ -11,6 +11,7 @@
WeighAndGrading
v4.5
512
+
true
@@ -20,6 +21,8 @@
DEBUG;TRACE
prompt
4
+ false
+ AnyCPU
pdbonly
@@ -28,6 +31,7 @@
TRACE
prompt
4
+ false
@@ -46,20 +50,35 @@
+
Form
GradeFrom.cs
+
+ Form
+
+
+ GradeSettingFrom.cs
+
+
GradeFrom.cs
+
+ GradeSettingFrom.cs
+
+
+ {8968f14a-c7c7-4751-96ce-b114fbfd65ef}
+ BO
+
{A782B23E-BE6D-4F51-B5CB-5CD259BA97CC}
BWP.WinFormControl