From 17026667d6fa0683257dbee07325acdfb5c29dd3 Mon Sep 17 00:00:00 2001
From: yangle <admin@YINMOU>
Date: 星期二, 16 一月 2024 13:42:49 +0800
Subject: [PATCH] 工艺路线 子表增加 字段 排产工序标记, 并且界面上 只有一行 是打勾的,要么全部不打勾,要么一行打勾;不能超过一行 排产工序标记 打勾。 HSortProcFlag bit //排产工序标记(一个工艺路线只有一行可以打勾,物料的产能获取这个是1的) 增加单品过站工序控制

---
 WebAPI/Controllers/JHGL/Gy_RoutingBillController.cs |   60 ++++++++++++++++++++++++++++++++++++++++--------------------
 1 files changed, 40 insertions(+), 20 deletions(-)

diff --git a/WebAPI/Controllers/JHGL/Gy_RoutingBillController.cs b/WebAPI/Controllers/JHGL/Gy_RoutingBillController.cs
index 118d58b..fce79d7 100644
--- a/WebAPI/Controllers/JHGL/Gy_RoutingBillController.cs
+++ b/WebAPI/Controllers/JHGL/Gy_RoutingBillController.cs
@@ -132,16 +132,32 @@
             string user = sArray[3].ToString();//鐢ㄦ埛鍚�
             string HComputerName = SystemInformation.ComputerName; //璁惧鍚嶇О
             user_LongShan = sArray[3].ToString();//鐢ㄦ埛鍚�
+            string HBillSubType = sArray[4].ToString();//鍗曟嵁瀛愮被鍨�
             try
             {
-                //鍒ゆ柇鏄惁鏈夌紪杈戞潈闄�
-                if (!DBUtility.ClsPub.Security_Log("Gy_RoutingBill_Edit", 1, false, user))
+                if (HBillSubType == "3301")
                 {
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 0;
-                    objJsonResult.Message = "鏃犳潈闄愮紪杈�!";
-                    objJsonResult.data = null;
-                    return objJsonResult;
+                    //鍒ゆ柇鏄惁鏈夌紪杈戞潈闄�
+                    if (!DBUtility.ClsPub.Security_Log("Gy_RoutingBill_Edit", 1, false, user))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "宸ヨ壓璺嚎鏃犳潈闄愮紪杈�!";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+
+                }
+                else {
+                    //鍒ゆ柇鏄惁鏈夌紪杈戞潈闄�
+                    if (!DBUtility.ClsPub.Security_Log("Gy_RoutingBill_Sub_Edit", 1, false, user))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "瀛愬伐鑹鸿矾绾挎棤鏉冮檺缂栬緫!";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
                 }
 
                 msg2 = "[" + msg2.ToString() + "]";
@@ -149,7 +165,7 @@
 
                 long HInterID = mainList[0].HInterID;//閫掑叆type寰楀埌鐨勫崟鎹甀D
                 string HBillNo = mainList[0].HBillNo;//閫掑叆type寰楀埌鐨勫崟鎹彿
-                DateTime HDate = mainList[0].HDate;//鏃ユ湡
+                DateTime HDate = OperationType == 4 ? DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd")) : mainList[0].HDate;//鏃ユ湡
                 int HYear = DateTime.Now.Year;
                 double HPeriod = DateTime.Now.Month;
                 string HRemark = mainList[0].HRemark;//澶囨敞
@@ -241,7 +257,7 @@
 
                 ds = oCN.RunProcReturn("select * from h_v_Gy_RoutingBillList where hmainid=" + HInterID + " and 鍗曟嵁鍙�='" + HBillNo + "'", "h_v_Gy_RoutingBillList");
 
-                if ((OperationType == 1 || OperationType == 2|| OperationType == 4) && ds.Tables[0].Rows.Count == 0)//鏂板
+                if ((OperationType == 1 || OperationType == 2) && ds.Tables[0].Rows.Count == 0)//鏂板
                 {
                     //涓昏〃
                     oCN.RunProc("Insert Into Gy_RoutingBillMain   " +
@@ -251,7 +267,7 @@
                     ",HMainGroupID,HMainProcID,HMainCenterID,HMainTimeUnit,HMainUnitTime,HMainWorkQty" +
                     ",HMainPrice,HStdSourceQty,HAddSourceRate,HPRDORGID,HDelSourceRate" +
                     ",HPicNumVer,HPicNumAssemble,HMaterTexture,HProductNum,HVerNum,HOrgID) " + 
-                    " values('" + BillType + "','"+(OperationType==4?"SUB":"") +"'," + HInterID + ",'" + HBillNo + "','" + HDate + "'" +
+                    " values('" + BillType + "','"+ HBillSubType + "'," + HInterID + ",'" + HBillNo + "','" + HDate + "'" +
                     "," + HYear + "," + HPeriod + ",'" + HRemark + "','" + HMaker + "',getdate()," + HMaterID + ",'" + HName + "'," + HMaterTypeID +
                     "," + HRoutingGroupID + "," + HUnitID + ",'" + HMaterNumber + "','" + HUnitNumber + "'," + Convert.ToString(HStandard ? 1 : 0) +
                     "," + HMainGroupID + "," + HMainProcID + "," + HMainCenterID + ",'" + HMainTimeUnit + "'," + HMainUnitTime + "," + HMainWorkQty +
@@ -310,7 +326,7 @@
                         oCN.RunProc("exec Gy_RoutingBill_LastProNo " + HInterID);
                     }
                 }
-                else if (IsProNo == 1 && (OperationType == 1 || OperationType == 4))
+                else if (IsProNo == 1 && (OperationType == 1))
                 {
                     ds = oCN.RunProcReturn("select * from Gy_Process Where HTProcessFlag = 1 and HNumber='9999' ", "Gy_Process");
 
@@ -414,6 +430,7 @@
                     ",HPackStd,HPack,HPutArea,HMyWorkDays,HMyFixWorkDays,HPassRate" +
                     ",HTechnologyParameter,HPicNum,HProcCheckNote" +
                     ",HOverRate,HProcWorkNum,HBadWHID,HWasterWHID, HWHID,HIsTime,HEstimate " +
+                    ",HWorkTimes_S,HSortProcFlag " +
                     ") values("
                     + HInterID + "," + i + "," + oSub.HProcID.ToString() + ",'" + oSub.HProcNo + "'," + oSub.HSupID.ToString() + "," + Convert.ToString(oSub.HSupFlag ? 1 : 0) + "" +
                     "," + oSub.HWorkQty.ToString() + "," + oSub.HCenterID.ToString() + ",'" + oSub.HTimeUnit.ToString() + "'," + oSub.HUnitTime.ToString() +
@@ -426,6 +443,7 @@
                    ",'" + oSub.HPackStd + "','" + oSub.HPack + "','" + oSub.HPutArea + "'," + oSub.HMyWorkDays.ToString() + "," + oSub.HMyFixWorkDays.ToString() + "," + oSub.HPassRate.ToString() +
                    ",'" + oSub.HTechnologyParameter.ToString() + "','" + oSub.HPicNum.ToString() + "','" + oSub.HProcCheckNote.ToString() +
                    "', " + oSub.HOverRate.ToString() + ",'" + oSub.HProcWorkNum.ToString() + "'," + oSub.HBadWHID.ToString() + "," + oSub.HWasterWHID.ToString() + "," + oSub.HWHID.ToString() + "," + Convert.ToString(oSub.HIsTime ? 1 : 0) + "," + oSub.HEstimate.ToString() +
+                   ", " + oSub.HWorkTimes_S.ToString() + "," + Convert.ToString(oSub.HSortProcFlag ? 1 : 0) +
                     ") ");
                     //璁′环鏂瑰紡涓嶄负璁℃椂锛屽垯鎶婅鏃舵殏浼板瓧娈垫洿鏂颁负绌�
                     if (oSub.HIsTime == false)
@@ -455,6 +473,7 @@
                     ",HTechnologyParameter,HPicNum,HProcCheckNote" +
                     ",HOverRate,HProcWorkNum,HBadWHID,HWasterWHID, HWHID,HEstimate,HIsTime" +
                     ",HQCSchemeID_Fst,HQCSchemeID_Proc,HQCSchemeID_Patrol" +
+                    ",HWorkTimes_S,HSortProcFlag " +
                     ") values("
                     + HInterID + "," + i + "," + oSub.HProcID.ToString() + ",'" + oSub.HProcNo + "'," + oSub.HSupID.ToString() + "," + Convert.ToString(oSub.HSupFlag ? 1 : 0) + "" +
                     "," + oSub.HWorkQty.ToString() + "," + oSub.HCenterID.ToString() + ",'" + oSub.HTimeUnit.ToString() + "'," + oSub.HUnitTime.ToString() +
@@ -468,6 +487,7 @@
                    ",'" + oSub.HTechnologyParameter.ToString() + "','" + oSub.HPicNum.ToString() + "','" + oSub.HProcCheckNote.ToString() +
                    "', " + oSub.HOverRate.ToString() + ",'" + oSub.HProcWorkNum.ToString() + "'," + oSub.HBadWHID.ToString() + "," + oSub.HWasterWHID.ToString() + "," + oSub.HWHID.ToString() + "," + oSub.HEstimate.ToString() + "," + Convert.ToString(oSub.HIsTime ? 1 : 0) + "," + oSub.HQCSchemeID_Fst + "," +
                      oSub.HQCSchemeID_Proc + "," + oSub.HQCSchemeID_Patrol +
+                   ", " + oSub.HWorkTimes_S.ToString() + "," + Convert.ToString(oSub.HSortProcFlag ? 1 : 0) +
                     ") ");
                     //璁′环鏂瑰紡涓嶄负璁℃椂锛屽垯鎶婅鏃舵殏浼板瓧娈垫洿鏂颁负绌�
                     if (oSub.HIsTime == false)
@@ -1223,14 +1243,14 @@
             try
             {
                 //鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄�
-                //if (!DBUtility.ClsPub.Security_Log("Gy_RoutingBill_Query", 1, false, user))
-                //{
-                //    objJsonResult.code = "0";
-                //    objJsonResult.count = 0;
-                //    objJsonResult.Message = "鏃犳潈闄愭煡璇�!";
-                //    objJsonResult.data = null;
-                //    return objJsonResult;
-                //}
+                if (!DBUtility.ClsPub.Security_Log("Gy_RoutingBill_Query", 1, false, user))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犳潈闄愭煡璇�!";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
 
                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                 string sql1 = "select  top 1000 * from h_v_Gy_RoutingBillQuery where 1 = 1 ";
@@ -1263,7 +1283,7 @@
             DataSet ds;
             try
             {
-                
+
                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                 string sql1 = "select  top 1000 * from h_v_Gy_RoutingBillQuerySub where 1 = 1 and hmainid=" + sWhere;
                 string sql = sql1  + " order by hmainid desc,cast(宸ュ簭鍙� as int)";

--
Gitblit v1.9.1