From 0b8e0449fda540cf3546a3feb376cbabe07aa3ca Mon Sep 17 00:00:00 2001
From: yangle <admin@YINMOU>
Date: 星期二, 14 十一月 2023 09:23:25 +0800
Subject: [PATCH] 不良原因加 不良类型选项 不良类型编辑页面 不良类型列表 单品过站功能完善

---
 WebAPI/Controllers/CJGL/Cj_SingleStationController.cs |  113 ++++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 109 insertions(+), 4 deletions(-)

diff --git a/WebAPI/Controllers/CJGL/Cj_SingleStationController.cs b/WebAPI/Controllers/CJGL/Cj_SingleStationController.cs
index 1a67950..e8537aa 100644
--- a/WebAPI/Controllers/CJGL/Cj_SingleStationController.cs
+++ b/WebAPI/Controllers/CJGL/Cj_SingleStationController.cs
@@ -83,7 +83,7 @@
                     return objJsonResult;
                 }
 
-                if (ds.Tables[0].Rows[0]["HStatus"].ToString() != "")
+                if (ds.Tables[0].Rows[0]["HStatus"].ToString() != "姝e父")
                 {
                     objJsonResult.code = "0";
                     objJsonResult.count = 0;
@@ -534,6 +534,9 @@
                 oCN.RunProc($@"insert into Sc_StationOutBillSub_SN(HInterID,HBillNo_bak,HEntryID,HBarCode,HBarCodeQty,HMakeTime,HRemark,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney)
 values({omodel.HInterID}, '{omodel.HBillNo}', {ds.Tables[0].Rows.Count + 1}, '{omodel.HBarCode_P}', 1, GETDATE(), '', 0, 0, '', '', 0, 0)");
 
+                //鍙嶅啓宸ュ簭鍑虹珯鍗曠殑鍚堟牸鏁伴噺
+                oCN.RunProc("update Sc_StationOutBillMain set HQty+=1  where HProcExchInterID='" + HProcExchInterID + "' and HProcExchEntryID=" + HProcExchEntryID);
+
                 oCN.Commit();
 
                 objJsonResult.code = "1";
@@ -625,7 +628,7 @@
                     return objJsonResult;
                 }
 
-                if (ds.Tables[0].Rows[0]["HStatus"].ToString() != "") {
+                if (ds.Tables[0].Rows[0]["HStatus"].ToString() != "姝e父") {
                     objJsonResult.code = "0";
                     objJsonResult.count = 0;
                     objJsonResult.Message = "褰撳墠鏉$爜鐘舵�佷负"+ ds.Tables[0].Rows[0]["HStatus"].ToString() + "!";
@@ -682,12 +685,12 @@
         #region  宸ュ簭鍗曞搧杩囩珯 鏌ヨ鍚堟牸璁板綍
         [Route("Cj_SingleStation/HGRecordsList")]
         [HttpGet]
-        public object HGRecordsList(string HBarCode, string user)
+        public object HGRecordsList(string sWhere, string user)
         {
             try
             {
 
-                ds = oCN.RunProcReturn(@"select * from h_v_Sc_AssemblyBillList where HProcExchBillNo='" + HBarCode + "'", "h_v_Sc_AssemblyBillList");
+                ds = oCN.RunProcReturn(@"select * from h_v_Gy_QualifiedRecordsList where 1=1"+ sWhere, "h_v_Gy_QualifiedRecordsList");
 
                 objJsonResult.code = "1";
                 objJsonResult.count = 1;
@@ -707,6 +710,108 @@
         }
         #endregion
 
+        #region 宸ュ簭鍗曞搧杩囩珯 鍒犻櫎涓嶈壇璁板綍
+        [Route("Cj_SingleStation/DelBadRecords")]
+        [HttpGet]
+        public object DelBadRecords(int HInterID, int HEntryID, string user,int HProcID)
+        {
+            try
+            {
+                ds = oCN.RunProcReturn("select * from h_v_Gy_BadRecordsList  where HInterID = " + HInterID, "h_v_Gy_BadRecordsList");
+
+                if (ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏌ユ棤鏁版嵁锛�";
+                    objJsonResult.data = null;
+                }
+
+                oCN.BeginTran();
+
+                string sql = "";
+                sql = "delete from Sc_QualityReportBillMain where HInterID = " + HInterID;
+                oCN.RunProc(sql);
+                sql = "delete from Sc_QualityReportBillSub where HInterID = " + HInterID + " and HEntryID = " + HEntryID;
+                oCN.RunProc(sql);
+                string HProcExchInterID = ds.Tables[0].Rows[0]["HProcExchInterID"].ToString();
+                string HProcExchEntryID = ds.Tables[0].Rows[0]["HProcExchEntryID"].ToString();
+                //鍙嶅啓宸ュ簭鍑虹珯鍗曠殑涓嶈壇鏁伴噺
+                oCN.RunProc("update Sc_StationOutBillMain set HBadCount-=1  where HProcExchInterID='" + HProcExchInterID + "' and HProcExchEntryID=" + HProcExchEntryID);
+
+
+                oCN.Commit();
+
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "Sucess锛�";
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                oCN.RollBack();
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #region 宸ュ簭鍗曞搧杩囩珯 鍒犻櫎鍚堟牸璁板綍
+        [Route("Cj_SingleStation/DelQualifiedRecords")]
+        [HttpGet]
+        public object DelQualifiedRecords(int HInterID, int HEntryID, string user)
+        {
+            try
+            {
+                ds = oCN.RunProcReturn("select * from h_v_Gy_QualifiedRecordsList  where hmainid = " + HInterID, "h_v_Gy_QualifiedRecordsList");
+
+                if (ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏌ユ棤鏁版嵁锛�";
+                    objJsonResult.data = null;
+                }
+
+                oCN.BeginTran();
+
+                string sql = "";
+                if (ds.Tables[0].Rows.Count == 1) {
+                    sql = "delete from Sc_StationOutBillMain where HInterID = " + HInterID;
+                    oCN.RunProc(sql);
+                }
+                sql = "delete from Sc_StationOutBillSub_SN where HInterID = " + HInterID + " and HEntryID = " + HEntryID;
+                oCN.RunProc(sql);
+                string HProcExchInterID = ds.Tables[0].Rows[0]["HProcExchInterID"].ToString();
+                string HProcExchEntryID = ds.Tables[0].Rows[0]["HProcExchEntryID"].ToString();
+                //鍙嶅啓宸ュ簭鍑虹珯鍗曠殑鍚堟牸鏁伴噺
+                oCN.RunProc("update Sc_StationOutBillMain set HBadCount-=1  where HProcExchInterID='" + HProcExchInterID + "' and HProcExchEntryID=" + HProcExchEntryID);
+
+
+                oCN.Commit();
+
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "Sucess锛�";
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                oCN.RollBack();
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
         #region  宸ュ簭鍗曞搧杩斾慨鍙� 鎵爜鏌ヨ
         [Route("Cj_SingleStation/HFBardCodeList")]
         [HttpGet]

--
Gitblit v1.9.1