From c193ef49cf93c007b8b908574e92ba5d8b0f6fc3 Mon Sep 17 00:00:00 2001
From: yusijie <ysj@hz-kingdee.com>
Date: 星期三, 06 三月 2024 08:37:37 +0800
Subject: [PATCH] PDA,设备 质量模块扫码

---
 WebAPI/DLL/ClsSb_EquipDotCheckBill.cs                        |   12 +++--
 WebAPI/Controllers/SBGL/Sb_EquipMaintainBillController.cs    |    4 +-
 WebAPI/Controllers/CJGL/Cj_StationEntrustInBillController.cs |    9 +++-
 WebAPI/Models/ClsSb_EquipDotCheckBillMain.cs                 |    3 +
 WebAPI/Controllers/SBGL/Sb_EquipDotCheckBillController.cs    |    4 +-
 WebAPI/Controllers/WebAPIController.cs                       |    5 +-
 WebAPI/DLL/ClsSc_ICMOReportBill.cs                           |    9 ++--
 WebAPI/Controllers/Sb_CheckEqpRepairWorkBillController.cs    |   17 +++++---
 8 files changed, 39 insertions(+), 24 deletions(-)

diff --git a/WebAPI/Controllers/CJGL/Cj_StationEntrustInBillController.cs b/WebAPI/Controllers/CJGL/Cj_StationEntrustInBillController.cs
index fceb653..702f2bb 100644
--- a/WebAPI/Controllers/CJGL/Cj_StationEntrustInBillController.cs
+++ b/WebAPI/Controllers/CJGL/Cj_StationEntrustInBillController.cs
@@ -1099,6 +1099,9 @@
                 bool HLastResult = list[0].HLastResult;//璇曟牱缁撹
                 long HProcExchInterID = list[0].HProcExchInterID;//娴佽浆鍗D
                 long HProcExchEntryID = list[0].HProcExchEntryID;//娴佽浆鍗″瓙ID
+                long HMainSourceInterID = list[0].HMainSourceInterID;//婧愬崟ID
+                long HMainSourceEntryID = list[0].HMainSourceEntryID;//婧愬崟瀛怚D
+                string HMainSourceBillNo = list[0].HMainSourceBillNo;//娴佽浆鍗″瓙ID
 
                 //琛ㄤ綋鏁版嵁
                 List<Model.ClsQC_FirstPieceCheckBillSub> subList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsQC_FirstPieceCheckBillSub>>(msg_entry);
@@ -1155,7 +1158,7 @@
                 }
 
                 //鍗曟嵁瀹屾暣鎬у垽鏂�
-                if (HProcExchBillNo == "")
+                if (HProcExchBillNo == "" && HMainSourceBillNo.Substring(0, Math.Min(2, HMainSourceBillNo.Length)) != "MO" )
                 {
                     objJsonResult.code = "0";
                     objJsonResult.count = 0;
@@ -1184,10 +1187,10 @@
                     oCN.RunProc("Insert Into QC_FirstPieceCheckBillMain " +
                     "(HBillType,HBillSubType,HInterID,HBillNo,HBillStatus,HDate,HMaker,HMakeDate" +
                     ",HYear,HPeriod,HMaterID,HSourceID,HICMOInterID,HICMOEntryID,HICMOBillNo,HProcExchBillNo" +
-                    ",HPRDORGID,HLastResult,HProcExchInterID,HProcExchEntryID)" +
+                    ",HPRDORGID,HLastResult,HProcExchInterID,HProcExchEntryID,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo)" +
                     " values('" + BillType + "','" + HBillSubType + "'," + HInterID + ",'" + HBillNo + "'," + HBillStatus + ",getdate(),'" + HMaker + "',getdate()" +
                     "," + HYear + "," + HPeriod + ",'" + HMaterID + "','" + HSourceID + "'," + HICMOInterID + "," + HICMOEntryID + ",'" + HICMOBillNo + "','" + HProcExchBillNo + "'" +  
-                    "," + HPRDORGID + ",'" + HLastResult + "'," + HProcExchInterID + "," + HProcExchEntryID + ") ");
+                    "," + HPRDORGID + ",'" + HLastResult + "'," + HProcExchInterID + "," + HProcExchEntryID + "," + HMainSourceInterID + "," + HMainSourceEntryID + ",'" + HMainSourceBillNo + "'" + ") ");
 
                     //鎻掑叆瀛愯〃
                     foreach (Model.ClsQC_FirstPieceCheckBillSub oSub in BillNew.DetailColl)
diff --git a/WebAPI/Controllers/SBGL/Sb_EquipDotCheckBillController.cs b/WebAPI/Controllers/SBGL/Sb_EquipDotCheckBillController.cs
index 99fa4a8..5545e83 100644
--- a/WebAPI/Controllers/SBGL/Sb_EquipDotCheckBillController.cs
+++ b/WebAPI/Controllers/SBGL/Sb_EquipDotCheckBillController.cs
@@ -528,8 +528,8 @@
                     oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now);
                     oItemSub.HCloseType = false;   //鍏抽棴绫诲瀷
                     //oItemSub.HRemark = "";         //澶囨敞
-                    oItemSub.HSourceInterID = 0;     // 婧愬崟涓诲唴鐮�
-                    oItemSub.HSourceEntryID = 0;   //婧愬崟瀛愬唴鐮�
+                    //oItemSub.HSourceInterID = 0;     // 婧愬崟涓诲唴鐮�
+                    //oItemSub.HSourceEntryID = 0;   //婧愬崟瀛愬唴鐮�
                     //oItemSub.HSourceBillNo = "";  //婧愬崟鍗曞彿
                     //oItemSub.HSourceBillType = ""; //婧愬崟绫诲瀷
                     //oItemSub.HRelationQty = 0;     //鍏宠仈鏁伴噺
diff --git a/WebAPI/Controllers/SBGL/Sb_EquipMaintainBillController.cs b/WebAPI/Controllers/SBGL/Sb_EquipMaintainBillController.cs
index 54a1659..20bbcc2 100644
--- a/WebAPI/Controllers/SBGL/Sb_EquipMaintainBillController.cs
+++ b/WebAPI/Controllers/SBGL/Sb_EquipMaintainBillController.cs
@@ -643,8 +643,8 @@
                     item.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now);
                     item.HCloseType = false;   //鍏抽棴绫诲瀷
                     //oItemSub.HRemark = "";         //澶囨敞
-                    item.HSourceInterID = 0;     // 婧愬崟涓诲唴鐮�
-                    item.HSourceEntryID = 0;   //婧愬崟瀛愬唴鐮�
+                    //item.HSourceInterID = 0;     // 婧愬崟涓诲唴鐮�
+                    //item.HSourceEntryID = 0;   //婧愬崟瀛愬唴鐮�
                     //oItemSub.HSourceBillNo = "";  //婧愬崟鍗曞彿
                     //oItemSub.HSourceBillType = ""; //婧愬崟绫诲瀷
                     item.HRelationQty = 0;     //鍏宠仈鏁伴噺
diff --git a/WebAPI/Controllers/Sb_CheckEqpRepairWorkBillController.cs b/WebAPI/Controllers/Sb_CheckEqpRepairWorkBillController.cs
index bf064c1..718192f 100644
--- a/WebAPI/Controllers/Sb_CheckEqpRepairWorkBillController.cs
+++ b/WebAPI/Controllers/Sb_CheckEqpRepairWorkBillController.cs
@@ -1000,6 +1000,7 @@
             string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
             string msg2 = sArray[0].ToString();
             string msg3 = sArray[1].ToString();
+
             string msg4 = sArray[2].ToString();
 
             //string UserName = "";
@@ -1314,13 +1315,13 @@
                     return objJsonResult;
                 }
                 //寰楀埌淇℃伅
-                ds = oCN.RunProcReturn("select top 1 * from Gy_EquipFileBillMain  where HEquipFileNumber= '" + HBarCode + "'", "Gy_EquipFileBillMain");
+                ds = oCN.RunProcReturn("select top 1 * from h_v_Gy_EquipFileBillList where HEquipFileNumber= '" + HBarCode + "'", "Gy_EquipFileBillMain");
                 //鍐欏叆淇℃伅
                 if (ds == null || ds.Tables[0].Rows.Count == 0)
                 {
                     objJsonResult.code = "0";
                     objJsonResult.count = 0;
-                    objJsonResult.Message = "鏈煡璇㈠埌璁惧淇℃伅锛�";
+                    objJsonResult.Message = "1.鏈煡璇㈠埌璁惧淇℃伅锛� 2.璁惧娌℃湁缁存姢鏁呴殰鐧昏鍗�";
                     objJsonResult.data = null;
                     return objJsonResult;
                 }
@@ -1351,6 +1352,7 @@
             string msg1 = _value.ToString();
             string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
             string msg2 = sArray[0].ToString();
+            string msg3 = sArray[1].ToString();
 
             string UserName = "";
 
@@ -1407,9 +1409,12 @@
                     oBill.omodel = oItem;
                 }
                 //瀛愯〃浣撴暟鎹�
-
+                //鎸� },{鏉ユ媶鍒嗘暟缁� //鍘绘帀銆愬拰銆�
+                msg3 = msg3.Substring(1, msg3.Length - 2);
+                msg3 = msg3.Replace("\\", "");
+                msg3 = msg3.Replace("\n", "");  //\n
                 List<Models.ClsSb_EquipRepairWorkBillSub> ls = new List<Models.ClsSb_EquipRepairWorkBillSub>();
-                ls = oListModels.getObjectByJson_Sb_EquipRepairWorkBillSubPDA(msg2);
+                ls = oListModels.getObjectByJson_Sb_EquipRepairWorkBillSubPDA(msg3);
                 int i = 0;
                 foreach (Models.ClsSb_EquipRepairWorkBillSub oItemSub in ls)
                 {
@@ -1424,8 +1429,8 @@
                     oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now);
                     oItemSub.HCloseType = false;   //鍏抽棴绫诲瀷
                     //oItemSub.HRemark = "";         //澶囨敞
-                    oItemSub.HSourceInterID = 0;     // 婧愬崟涓诲唴鐮�
-                    oItemSub.HSourceEntryID = 0;   //婧愬崟瀛愬唴鐮�
+                    //oItemSub.HSourceInterID = 0;     // 婧愬崟涓诲唴鐮�
+                    //oItemSub.HSourceEntryID = 0;   //婧愬崟瀛愬唴鐮�
                     //oItemSub.HSourceBillNo = "";  //婧愬崟鍗曞彿
                     //oItemSub.HSourceBillType = ""; //婧愬崟绫诲瀷
                     //oItemSub.HRelationQty = 0;     //鍏宠仈鏁伴噺
diff --git a/WebAPI/Controllers/WebAPIController.cs b/WebAPI/Controllers/WebAPIController.cs
index fd1ac4e..ca443ac 100644
--- a/WebAPI/Controllers/WebAPIController.cs
+++ b/WebAPI/Controllers/WebAPIController.cs
@@ -9703,7 +9703,7 @@
         /// <returns></returns>
         [Route("Web/GetItemByEquipFile")]
         [HttpGet]
-        public object GetItemByEquipFile(int EquipProjectID,string Type)
+        public object GetItemByEquipFile(int EquipProjectID,string Type,string HDate)
         {
             if (EquipProjectID <= 0)
             {
@@ -9733,7 +9733,8 @@
                 }
 
                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
-                string sql = string.Format(@"select * from " + HView + " where HInterID = " + EquipProjectID);
+                //string sql = string.Format(@"select * from " + HView + " where HInterID = " + EquipProjectID);
+                string sql = string.Format(@"Exec h_p_Sb_GetCheckItem_PDA '" + EquipProjectID + "','" + Type + "','" + HDate + "'");
                 ds = oCN.RunProcReturn(sql, HView);
                 if (ds == null || ds.Tables[0].Rows.Count <= 0)
                 {
diff --git a/WebAPI/DLL/ClsSb_EquipDotCheckBill.cs b/WebAPI/DLL/ClsSb_EquipDotCheckBill.cs
index 05e57f1..a6b7346 100644
--- a/WebAPI/DLL/ClsSb_EquipDotCheckBill.cs
+++ b/WebAPI/DLL/ClsSb_EquipDotCheckBill.cs
@@ -114,12 +114,12 @@
                 "(HBillType,HBillSubType,HInterID,HBillNo,HDate,HMaker,HMakeDate" +
                 ",HYear,HPeriod,HRemark,HEquipID" +
                 ",HBeginDate,HEndDate,HPlanNo,HExplanation,HInnerBillNo" +
-                ",HDeptID,HQty" +
+                ",HDeptID,HQty,HEquipDotCheckRuleInterID" +
                 ") " +
                 " values('" + this.BillType + "','"  + this.HBillSubType + "'," +omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "','" + omodel.HMaker + "',getdate()" +
                 "," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "'," + omodel.HEquipID.ToString() +
                 ",'" + omodel.HBeginDate + "','" + omodel.HEndDate + "','" + omodel.HPlanNo + "','" + omodel.HExplanation + "','" + omodel.HInnerBillNo + "'" +
-               ",'" + omodel.HDeptID + "'," + omodel.HQty +
+               ",'" + omodel.HDeptID + "'," + omodel.HQty + "," + omodel.HEquipDotCheckRuleInterID +
                 ") ");
                 //鎻掑叆瀛愯〃
                 foreach (Models.ClsSb_EquipDotCheckBillSub oSub in DetailColl)
@@ -129,15 +129,17 @@
                       "HCloseMan,HEntryCloseDate,HCloseType,HRemark," +
                       "HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney," +
                       "HDotCheckItem,HDotCheckPart,HClaim," +
-                      "HManagerID,HManagerNumber,HDotCheckResult " +
+                      "HManagerID,HManagerNumber,HDotCheckResult,HDotCheckItemID " +
                       ") values("
                       + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() +
                       ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" +
-                      "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() +
+                      "," + oSub.HSourceInterID.ToString()  + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() +
                       ",'" + oSub.HDotCheckItem + "','" + oSub.HDotCheckPart + "','" + oSub.HClaim +
-                      "'," + oSub.HManagerID.ToString() + ",'" + oSub.HManagerNumber + "','" + oSub.HDotCheckResult + "'" +
+                      "'," + oSub.HManagerID.ToString() + ",'" + oSub.HManagerNumber + "','" + oSub.HDotCheckResult + "'," + oSub.HDotCheckItemID +
                       ") ");
                 }
+                //鏇存柊鐐规璁″垝瀛愯〃鍏宠仈鏍囪
+                oCn.RunProc("update Sb_EquipDotCheckPlanBillSub_Plan set HRelationFlag = 1 where HInterID = " + omodel.HPlanInterID + " and HEntryID = " + omodel.HPlanEntryID);
                 //
                 //foreach (Model.ClsSb_EquipDotCheckBillSub oSub in DetailColl)
                 //{
diff --git a/WebAPI/DLL/ClsSc_ICMOReportBill.cs b/WebAPI/DLL/ClsSc_ICMOReportBill.cs
index 0221832..35ebae6 100644
--- a/WebAPI/DLL/ClsSc_ICMOReportBill.cs
+++ b/WebAPI/DLL/ClsSc_ICMOReportBill.cs
@@ -261,7 +261,7 @@
 
                     //鍙嶅啓浜ч噺姹囨姤鍗曪紝璐ㄩ噺姹囨姤鍗曞叧鑱斿瓧娈�,鐢熶骇璁㈠崟鍏宠仈鏁伴噺
                     ds = oCn.RunProcReturn("exec h_p_Sc_ICMOReportBill_ReverseWriteQty " + omodel.HInterID + "," + oSub.HEntryID + ",'" + omodel.HBillNo + "'," +
-                        DetailColl[0].HICMOInterID + "," + DetailColl[0].HICMOEntryID + "," + DetailColl[0].HICMOBillNo + ",'" + DetailColl[0].HSourceID + "','" +
+                        DetailColl[0].HICMOInterID + "," + DetailColl[0].HICMOEntryID + ",'" + DetailColl[0].HICMOBillNo + "','" + DetailColl[0].HSourceID + "','" +
                         "Add" + "'," + 0
                         , "h_p_Sc_ICMOReportBill_ReverseWriteQty");
                     if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) == "1")
@@ -498,10 +498,11 @@
                                                                                                           //
                         if (oSystemParameter.omodel.WMS_CampanyName == "涔濊彵") //绯荤粺鍙傛暟  瀹㈡埛瀹氬埗鍖栧悕绉�     绌虹櫧涓洪�氱敤
                         {
-                            FentityModel.Add("FShiftGroupId", new JObject() { ["FNumber"] = item["FShiftGroupId"].ToString() });//鐝粍
-                            FentityModel.Add("F_UUBK_CZG1", new JObject() { ["FSTAFFNUMBER"] = item["F_UUBK_CZG1"].ToString() });// 鎿嶄綔鍛�
+                           
                         }
-                      
+                        FentityModel.Add("FShiftGroupId", new JObject() { ["FNumber"] = item["FShiftGroupId"].ToString() });//鐝粍
+                        FentityModel.Add("F_UUBK_CZG1", new JObject() { ["FSTAFFNUMBER"] = item["F_UUBK_CZG1"].ToString() });// 鎿嶄綔鍛�
+
                         FentityModel.Add("FBOMID", new JObject() { ["FNumber"] = item["FBOMID"].ToString() });// BOM鐗堟湰
 
                         //sJson_BatchNo +
diff --git a/WebAPI/Models/ClsSb_EquipDotCheckBillMain.cs b/WebAPI/Models/ClsSb_EquipDotCheckBillMain.cs
index 706eb7f..b9ca54a 100644
--- a/WebAPI/Models/ClsSb_EquipDotCheckBillMain.cs
+++ b/WebAPI/Models/ClsSb_EquipDotCheckBillMain.cs
@@ -10,9 +10,12 @@
         public DateTime HBeginDate;
         public DateTime HEndDate;
         public string HPlanNo;
+        public Int64 HPlanInterID;
+        public Int64 HPlanEntryID;
         public string HExplanation;
         public string HInnerBillNo;
         public long HDeptID;//     int	--部门ID
         public decimal HQty; //数量
+        public Int64 HEquipDotCheckRuleInterID; //点检规程
     }
 }

--
Gitblit v1.9.1