From da458077fb008ba91b5552130ce78ae0c0caa30f Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期一, 09 十二月 2024 16:50:29 +0800
Subject: [PATCH] 四维尔工业二期:根据plc采集信息,使用MQTT通讯,实现接收信息后打印条码
---
WebAPI/Controllers/品质管理/车间自检单/QC_WorkSelfCheckBillController.cs | 74 ++++++++++++++++++++++++++++++++++--
1 files changed, 69 insertions(+), 5 deletions(-)
diff --git "a/WebAPI/Controllers/\345\223\201\350\264\250\347\256\241\347\220\206/\350\275\246\351\227\264\350\207\252\346\243\200\345\215\225/QC_WorkSelfCheckBillController.cs" "b/WebAPI/Controllers/\345\223\201\350\264\250\347\256\241\347\220\206/\350\275\246\351\227\264\350\207\252\346\243\200\345\215\225/QC_WorkSelfCheckBillController.cs"
index 0459c16..e8b06ec 100644
--- "a/WebAPI/Controllers/\345\223\201\350\264\250\347\256\241\347\220\206/\350\275\246\351\227\264\350\207\252\346\243\200\345\215\225/QC_WorkSelfCheckBillController.cs"
+++ "b/WebAPI/Controllers/\345\223\201\350\264\250\347\256\241\347\220\206/\350\275\246\351\227\264\350\207\252\346\243\200\345\215\225/QC_WorkSelfCheckBillController.cs"
@@ -33,6 +33,16 @@
{
List<object> columnNameList = new List<object>();
+ //鍒ゆ柇鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log("QC_WorkSelfCheckBill_Query", 3, false, user))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鎮ㄦ病鏈夎妯″潡鏉冮檺,璇蜂笌绠$悊鍛樿仈绯伙紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
string sql1 = "select * from h_v_QC_WorkSelfCheckBill where 1 = 1 ";
string sql = sql1 + sWhere + " order by hmainid desc";
ds = oCN.RunProcReturn(sql, "h_v_QC_WorkSelfCheckBill");
@@ -47,6 +57,59 @@
objJsonResult.code = "1";
objJsonResult.count = 1;
+ objJsonResult.Message = "Sucess锛�";
+ objJsonResult.list = columnNameList;
+ objJsonResult.data = ds.Tables[0];
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "Exception锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region 杞﹂棿鑷鍗曞垎椤靛垪琛�
+ [Route("QC_WorkSelfCheckBill/QC_WorkSelfCheckBillListPage")]
+ [HttpGet]
+ public object QC_ProcessCheckMainBillListPage(string sWhere, string user, int page, int size)
+ {
+ try
+ {
+ List<object> columnNameList = new List<object>();
+ //缂栬緫鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log_second("QC_WorkSelfCheckBill_Query", 3, false, user))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏃犳煡鐪嬫潈闄愶紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ sWhere = sWhere.Replace("'", "''");
+ if (sWhere == null || sWhere.Equals(""))
+ {
+ ds = oCN.RunProcReturn("exec h_p_QC_WorkSelfCheckBillListPage " + page + "," + size + ",''", "h_p_QC_WorkSelfCheckBillListPage");
+ }
+ else
+ {
+ ds = oCN.RunProcReturn("exec h_p_QC_WorkSelfCheckBillListPage " + page + "," + size + ",'" + sWhere + "'", "h_p_QC_WorkSelfCheckBillListPage");
+ }
+
+ //娣诲姞鍒楀悕
+ foreach (DataColumn col in ds.Tables[0].Columns)
+ {
+ Type dataType = col.DataType;
+ string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+ columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+ }
+
+ objJsonResult.code = "1";
+ objJsonResult.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString());
objJsonResult.Message = "Sucess锛�";
objJsonResult.list = columnNameList;
objJsonResult.data = ds.Tables[0];
@@ -128,6 +191,7 @@
BillNew.omodel.HProcExchEntryID = ClsPub.isLong(mainList[0].HProcExchEntryID);
BillNew.omodel.HProcExchBillNo = ClsPub.isStrNull(mainList[0].HProcExchBillNo);
BillNew.omodel.HProcExchQty = ClsPub.isLong(mainList[0].HProcExchQty);
+ BillNew.omodel.HProcID = ClsPub.isLong(mainList[0].HProcID);
BillNew.omodel.HMaterID = ClsPub.isLong(mainList[0].HMaterID);
BillNew.omodel.HFirstCheckEmp = ClsPub.isLong(mainList[0].HFirstCheckEmp);
BillNew.omodel.HLastResult = ClsPub.isBool(mainList[0].HLastResult);
@@ -187,7 +251,7 @@
oSub.HUpOffSet= DBUtility.ClsPub.isStrNull(subList[i].HUpOffSet);
oSub.HDownOffSet= DBUtility.ClsPub.isStrNull(subList[i].HDownOffSet);
oSub.HAnalysisMethod = DBUtility.ClsPub.isStrNull(subList[i].HAnalysisMethod);
- oSub.HKeyInspect = DBUtility.ClsPub.isLong(subList[i].HKeyInspect);
+ oSub.HKeyInspect = DBUtility.ClsPub.isBool(subList[i].HKeyInspect);
oSub.HInspectInstruMentID = DBUtility.ClsPub.isLong(subList[i].HInspectInstruMentID);
oSub.HInspectResult = DBUtility.ClsPub.isStrNull(subList[i].HResult);
BillNew.DetailColl.Add(oSub);
@@ -913,7 +977,7 @@
#region 杞﹂棿妫�楠屽崟鏍规嵁婧愬崟绫诲瀷鑾峰彇淇℃伅-婧愬崟涓哄伐搴忔祦杞崱
[Route("QC_WorkSelfCheckBill/get_ProcessExchangeBill")]
[HttpGet]
- public object get_ProcessExchangeBill(string HInterID, string user)
+ public object get_ProcessExchangeBill(string HInterID, string HEntryID, string user)
{
try
{
@@ -926,13 +990,13 @@
switch (oSystemParameter.omodel.QC_FirstPieceCheckBill_QCSchemeSource)
{
case "宸ュ簭":
- sql = "exec h_p_QC_FirstPiece_GetProcessExchangeBillList " + "'宸ュ簭','" + HInterID + "'";
+ sql = "exec h_p_QC_FirstPiece_GetProcessExchangeBillList " + "'宸ュ簭','" + HInterID + "','" + HEntryID + "'";
break;
case "鐗╂枡":
- sql = "exec h_p_QC_FirstPiece_GetProcessExchangeBillList " + "'鐗╂枡','" + HInterID + "'";
+ sql = "exec h_p_QC_FirstPiece_GetProcessExchangeBillList " + "'鐗╂枡','" + HInterID + "','" + HEntryID + "'";
break;
case "宸ヨ壓璺嚎":
- sql = "exec h_p_QC_FirstPiece_GetProcessExchangeBillList " + "'宸ヨ壓璺嚎','" + HInterID + "'";
+ sql = "exec h_p_QC_FirstPiece_GetProcessExchangeBillList " + "'宸ヨ壓璺嚎','" + HInterID + "','" + HEntryID + "'";
break;
}
--
Gitblit v1.9.1