From b129762a4bb5ec2cde5edf16bc9cbda57c73587d Mon Sep 17 00:00:00 2001
From: yangle <admin@YINMOU>
Date: 星期三, 24 五月 2023 09:33:10 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API

---
 WebAPI/Controllers/JHGL/Gy_RoutingBillController.cs |   76 ++++++++++++++++++-------------------
 1 files changed, 37 insertions(+), 39 deletions(-)

diff --git a/WebAPI/Controllers/JHGL/Gy_RoutingBillController.cs b/WebAPI/Controllers/JHGL/Gy_RoutingBillController.cs
index 7635a40..2afdfbc 100644
--- a/WebAPI/Controllers/JHGL/Gy_RoutingBillController.cs
+++ b/WebAPI/Controllers/JHGL/Gy_RoutingBillController.cs
@@ -10,6 +10,7 @@
 using System.IO;
 using System.Web;
 using System.Web.Http;
+using System.Windows.Forms;
 using WebAPI.Controllers.SCGL.鏃ヨ鍒掔鐞�;
 using WebAPI.Models;
 
@@ -124,6 +125,7 @@
             //int hentryid = int.Parse(sArray[2].ToString());//瀛愯〃鐨勯『搴廼d
             int OperationType = int.Parse(sArray[2].ToString());//鏁版嵁绫诲瀷 1娣诲姞 3淇敼 2 澶嶅埗
             string user = sArray[3].ToString();//鐢ㄦ埛鍚�
+            string HComputerName = SystemInformation.ComputerName; //璁惧鍚嶇О
             try
             {
                 //鍒ゆ柇鏄惁鏈夌紪杈戞潈闄�
@@ -203,6 +205,9 @@
                     "," + HMainGroupID + "," + HMainProcID + "," + HMainCenterID + ",'" + HMainTimeUnit + "'," + HMainUnitTime + "," + HMainWorkQty +
                     "," + HMainPrice + "," + HStdSourceQty + "," + HAddSourceRate + "," + HPRDORGID + "," + HDelSourceRate +
                     ",'" + HPicNumVer + "','" + HPicNumAssemble + "','" + HMaterTexture + "','" + HProductNum + "','" + HVerNum + "'," + HOrgID + ") ");
+
+                    LogService.Write("鐢ㄦ埛:" + user + ",鏃ユ湡:" + DateTime.Now + ",鏂板宸ヨ壓璺嚎鍗曟嵁:" + HBillNo);
+                    oCN.RunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + user + "','" + HComputerName + "','" + "鏂板宸ヨ壓璺嚎鍗曟嵁锛�" + HBillNo + "','LMES-宸ヨ壓璺嚎妯″潡','" + DBUtility.ClsPub.IPAddress + "','鏂板鍗曟嵁'", ref DBUtility.ClsPub.sExeReturnInfo);
                 }
                 else if (OperationType == 3 || ds.Tables[0].Rows.Count != 0)
                 { //淇敼
@@ -218,7 +223,10 @@
                         ",HProductNum='" + HProductNum + "',HVerNum='" + HVerNum + "' where HInterID='" + HInterID + "'");
 
                     //鍒犻櫎瀛愯〃
-                    oCN.RunProc("delete from Gy_RoutingBillSub where HInterID='" + HInterID + "' and HProcNo!='9999'");
+                    oCN.RunProc("delete from Gy_RoutingBillSub where HInterID='" + HInterID + "'");
+
+                    LogService.Write("鐢ㄦ埛:" + user + ",鏃ユ湡:" + DateTime.Now + ",淇敼宸ヨ壓璺嚎鍗曟嵁:" + HBillNo);
+                    oCN.RunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + user + "','" + HComputerName + "','" + "淇敼宸ヨ壓璺嚎鍗曟嵁锛�" + HBillNo + "','LMES-宸ヨ壓璺嚎妯″潡','" + DBUtility.ClsPub.IPAddress + "','淇敼鍗曟嵁'", ref DBUtility.ClsPub.sExeReturnInfo);
                 }
                 //淇濆瓨瀛愯〃
                 objJsonResult = AddBillSub(msg3, HInterID, OperationType);
@@ -337,34 +345,31 @@
                     return objJsonResult;
                 }
 
-                if (oSub.HProcNo != "9999" || OperationType == 2)
-                {
-                    oCN.RunProc("Insert into Gy_RoutingBillSub " +
-                    "(HInterID,HEntryID,HProcID,HProcNO,HSupID,HSupFlag" +
-                    ",HWorkQty,HCenterID,HTimeUnit,HUnitTime" +
-                    ",HReadyTime,HQueueTime,HMoveTime" +
-                    ",HCloseMan,HCloseType,HRemark,HProcType,HNextProcFlag,HFlowProc" +
-                    ",HFixPrice,HProcPrice,HBadPrice,HWasterPrice,HStdFlag,HBeginDayQty,HBeginFixQty" +
-                    ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney,HAutoTrunFlag" +
-                    ",HFixWorkDays,HTrunWorkDays,HReadyTimes,HICMOReadyTimes,HSubStdEmpQty,HSubCanUseSourceQty" +
-                    ",HProcID_S,HCenterID_S,HWorkQty_S,HSubStdEmpQty_S,HMouldNo,HChangeMould" +
-                    ",HPackStd,HPack,HPutArea,HMyWorkDays,HMyFixWorkDays,HPassRate" +
-                    ",HTechnologyParameter,HPicNum,HProcCheckNote" +
-                    ",HOverRate,HProcWorkNum,HBadWHID,HWasterWHID, HWHID " +
-                    ") 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() +
-                    "," + oSub.HReadyTime.ToString() + "," + oSub.HQueueTime.ToString() + "," + oSub.HMoveTime.ToString() +
-                    ",'" + oSub.HCloseMan + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "','" + oSub.HProcType + "'," + Convert.ToString(oSub.HNextProcFlag ? 1 : 0) + "," + Convert.ToString(oSub.HFlowProc ? 1 : 0) +
-                    "," + oSub.HFixPrice.ToString() + "," + oSub.HProcPrice.ToString() + "," + oSub.HBadPrice.ToString() + "," + oSub.HWasterPrice.ToString() + "," + Convert.ToString(oSub.HStdFlag ? 1 : 0) + "," + oSub.HBeginDayQty.ToString() + "," + oSub.HBeginFixQty.ToString() +
-                    "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() + "," + Convert.ToString(oSub.HAutoTrunFlag ? 1 : 0) +
-                   "," + oSub.HFixWorkDays.ToString() + "," + oSub.HTrunWorkDays.ToString() + "," + oSub.HReadyTimes.ToString() + "," + oSub.HICMOReadyTimes.ToString() + "," + oSub.HSubStdEmpQty.ToString() + "," + oSub.HSubCanUseSourceQty.ToString() +
-                   "," + oSub.HProcID_S.ToString() + "," + oSub.HCenterID_S.ToString() + "," + oSub.HWorkQty_S.ToString() + ", " + oSub.HSubStdEmpQty_S.ToString() + ",'" + oSub.HMouldNo + "'," + oSub.HChangeMould.ToString() +
-                   ",'" + 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() +
-                    ") ");
-                }
+                oCN.RunProc("Insert into Gy_RoutingBillSub " +
+                "(HInterID,HEntryID,HProcID,HProcNO,HSupID,HSupFlag" +
+                ",HWorkQty,HCenterID,HTimeUnit,HUnitTime" +
+                ",HReadyTime,HQueueTime,HMoveTime" +
+                ",HCloseMan,HCloseType,HRemark,HProcType,HNextProcFlag,HFlowProc" +
+                ",HFixPrice,HProcPrice,HBadPrice,HWasterPrice,HStdFlag,HBeginDayQty,HBeginFixQty" +
+                ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney,HAutoTrunFlag" +
+                ",HFixWorkDays,HTrunWorkDays,HReadyTimes,HICMOReadyTimes,HSubStdEmpQty,HSubCanUseSourceQty" +
+                ",HProcID_S,HCenterID_S,HWorkQty_S,HSubStdEmpQty_S,HMouldNo,HChangeMould" +
+                ",HPackStd,HPack,HPutArea,HMyWorkDays,HMyFixWorkDays,HPassRate" +
+                ",HTechnologyParameter,HPicNum,HProcCheckNote" +
+                ",HOverRate,HProcWorkNum,HBadWHID,HWasterWHID, HWHID " +
+                ") 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() +
+                "," + oSub.HReadyTime.ToString() + "," + oSub.HQueueTime.ToString() + "," + oSub.HMoveTime.ToString() +
+                ",'" + oSub.HCloseMan + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "','" + oSub.HProcType + "'," + Convert.ToString(oSub.HNextProcFlag ? 1 : 0) + "," + Convert.ToString(oSub.HFlowProc ? 1 : 0) +
+                "," + oSub.HFixPrice.ToString() + "," + oSub.HProcPrice.ToString() + "," + oSub.HBadPrice.ToString() + "," + oSub.HWasterPrice.ToString() + "," + Convert.ToString(oSub.HStdFlag ? 1 : 0) + "," + oSub.HBeginDayQty.ToString() + "," + oSub.HBeginFixQty.ToString() +
+                "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() + "," + Convert.ToString(oSub.HAutoTrunFlag ? 1 : 0) +
+               "," + oSub.HFixWorkDays.ToString() + "," + oSub.HTrunWorkDays.ToString() + "," + oSub.HReadyTimes.ToString() + "," + oSub.HICMOReadyTimes.ToString() + "," + oSub.HSubStdEmpQty.ToString() + "," + oSub.HSubCanUseSourceQty.ToString() +
+               "," + oSub.HProcID_S.ToString() + "," + oSub.HCenterID_S.ToString() + "," + oSub.HWorkQty_S.ToString() + ", " + oSub.HSubStdEmpQty_S.ToString() + ",'" + oSub.HMouldNo + "'," + oSub.HChangeMould.ToString() +
+               ",'" + 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() +
+                ") ");
             }
 
             objJsonResult.code = "1";
@@ -388,20 +393,13 @@
         {
             try
             {
-                string flag = "flase";
                 string sErrMsg = "";
-                if (oSystemParameter.ShowBill(ref sErrMsg))
-                {
-                    if (oSystemParameter.omodel.Gy_RoutingBill_SaveAutoLastProc == "Y")
-                    {
-                        flag = "true";
-                    }
-                }
-                
+                oSystemParameter.ShowBill(ref sErrMsg);
+
                 objJsonResult.code = "1";
                 objJsonResult.count = 1;
                 objJsonResult.Message = "";
-                objJsonResult.data = flag;
+                objJsonResult.data = oSystemParameter.omodel;
                 return objJsonResult;
             }
             catch (Exception e)

--
Gitblit v1.9.1