From c9b9cff93130a51deac36c49372ab0d3f5b5b5ff Mon Sep 17 00:00:00 2001
From: jingh <jingh@LAPTOP-I53VDLOO>
Date: 星期四, 18 十一月 2021 07:07:58 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API

---
 WebAPI/Controllers/BaseSet/Gy_MaterialController.cs |   67 +++++++++++++++++++++++++++++++--
 1 files changed, 62 insertions(+), 5 deletions(-)

diff --git a/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs b/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
index e2877bc..e15478b 100644
--- a/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
+++ b/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
@@ -591,6 +591,10 @@
                 long HPrintQty = mainList[0].HPrintQty;
                 string HMouldOWNER = mainList[0].HMouldOWNER;
                 string HSaveLife = mainList[0].HSaveLife;
+                int HMouldDotCheckRuleInterID= mainList[0].HMouldDotCheckRuleInterID;
+                int HMouldMaintainRuleInterID= mainList[0].HMouldMaintainRuleInterID;
+
+
 
                 //涓昏〃
                 oCN.RunProc("Insert Into Gy_MouldFileMain   " +
@@ -602,7 +606,7 @@
                 ",HOutComDate,HOutComNo,HDeptID,HSupID,HSupNumber" +
                 ",HPrintQty,HMouldStatus,HWhID,HRoutingID" +
                 ",HBomID,HVersion,HSPGroupID,HSPID,HDesignLife" +
-                ",HUseLife,HLeaveLife,HProdQty,HProdWeight,HMouldOWNER,HSaveLife" +
+                ",HUseLife,HLeaveLife,HProdQty,HProdWeight,HMouldOWNER,HSaveLife,HMouldDotCheckRuleInterID,HMouldMaintainRuleInterID" +
                 ") " +
                 " values('" + BillType + "','" + BillType + "'," + HInterID + ",'" + HBillNo + "','" + HDate + "'" +
                 "," + HYear + "," + HPeriod + ",'" + HRemark + "','" + HMaker + "',getdate()" +
@@ -612,7 +616,7 @@
                 ",'" + HOutComDate + "','" + HOutComNo + "'," + HDeptID + "," + HSupID + ",'" + HSupNumber + "'" +
                 "," + HPrintQty + ",'" + HMouldStatus + "'," + HWHID + "," + HRoutingID +
                 "," + HBOMID + ",'" + HVersion + "'," + HSPGroupID + "," + HSPID + ",'" + HDesignLife + "'" +
-                ",'" + HUseLife + "','" + HLeaveLife + "','" + HProdQty + "','" + HProdWeight + "','" + HMouldOWNER +"',"+ "','" + HSaveLife + "'," +
+                ",'" + HUseLife + "','" + HLeaveLife + "','" + HProdQty + "','" + HProdWeight + "','" + HMouldOWNER + "','" + HSaveLife + "','" + HMouldDotCheckRuleInterID+"','"+ HMouldMaintainRuleInterID+"'"+
                 ") ");
 
 
@@ -724,7 +728,8 @@
                 long HPrintQty = mainList[0].HPrintQty;
                 string HMouldOWNER = mainList[0].HMouldOWNER;
                 string HSaveLife = mainList[0].HSaveLife;
-
+                int HMouldDotCheckRuleInterID = mainList[0].HMouldDotCheckRuleInterID;
+                int HMouldMaintainRuleInterID = mainList[0].HMouldMaintainRuleInterID;
 
 
                 //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
@@ -759,7 +764,7 @@
                 ",HSupNumber='" + HSupNumber + "'" +
                 ",HPrintQty=" + HPrintQty.ToString() +
                 ",HMouldStatus='" + HMouldStatus + "'" +
-                ",HSaveLife='"+ HSaveLife+"'"+
+                ",HSaveLife='" + HSaveLife + "'" +
                 ",HWhID=" + HWHID.ToString() +
                 ",HRoutingID=" + HRoutingID.ToString() +
                 ",HBomID=" + HBOMID.ToString() +
@@ -770,7 +775,9 @@
                 ",HUseLife=" + HUseLife.ToString() +
                 ",HLeaveLife=" + HLeaveLife.ToString() +
                 ",HProdQty=" + HProdQty.ToString() +
-                ",HMouldOWNER='"+ HMouldOWNER+"'"+
+                ",HMouldDotCheckRuleInterID="+ HMouldDotCheckRuleInterID.ToString()+
+                ",HMouldMaintainRuleInterID=" + HMouldMaintainRuleInterID.ToString() +
+                ",HMouldOWNER='" + HMouldOWNER + "'" +
                 ",HProdWeight=" + HProdWeight.ToString() +
                 " where HInterID=" + HInterID.ToString());
 
@@ -880,6 +887,56 @@
             return objJsonResult;
         }
 
+        /// <summary>
+        /// 妯″叿妗f鍒濆鍖栨寜閽�
+        /// </summary>
+        /// <param name="hmainid"></param>
+        /// <param name="user"></param>
+        /// <returns></returns>
+        [Route("Gy_Material/InitializeProdInBill")]
+        [HttpGet]
+        public object InitializeProdInBill(long hmainid, string user)
+        {
+            DAL.ClsGy_MouldFile oBill = new DAL.ClsGy_MouldFile();
+            try
+            {
+                string HBillNo = "";
+                Int64 HInterID = 0;//鏄剧ず鐨勫瓧娈�
+                ds = oCN.RunProcReturn("select * from Gy_MouldFileMain where HInterID='" + hmainid + "'", "Gy_MouldFileMain");
+                DataRow dr = ds.Tables[0].Rows[0];
+                HInterID = DBUtility.ClsPub.CreateBillID("3801", ref DBUtility.ClsPub.sExeReturnInfo);
+                HBillNo = DBUtility.ClsPub.CreateBillCode("3801", ref DBUtility.ClsPub.sExeReturnInfo, true);
+                string sql = "Insert Into Sc_MouldStockBillMain   " +
+                "(HBillType,HBillSubType,HInterID,HBillNo,HDate" +
+                ",HMaker,HMakeDate" + /*"HYear, HPeriod,"*/
+                ",HSupID,HSupTypeID,HWHID,HSCWHID,HEmpID,HManagerID,HSecManagerID" +
+                ",HKeeperID,HDeptID,HInnerBillNo,HRedBlueFlag" +
+                ") " +
+                " values('3801','3801'," + HInterID + ",'" + HBillNo + "',' getdate()'" +
+                ", '" + user + "',getdate()" +
+                ", " + dr["HSupID"].ToString() + ", 1," + dr["HWhID"].ToString() + ",0,0,0,0" +
+                ", 0," + dr["HDeptID"].ToString() +  ",' ',0"  +
+
+                ") ";
+                //涓昏〃
+                oCN.RunProc(sql);
+
+                objJsonResult.code = "0";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "鍒濆鍖栨垚鍔燂紒";
+                //WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�");
+                objJsonResult.data = 1;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鍒濆鍖栧け璐ワ紒";
+                objJsonResult.data = null;
+            }
+            return objJsonResult;
+        }
 
         #region [妯″叿妗f瀹℃牳銆佸弽瀹℃牳]
         /// <summary>

--
Gitblit v1.9.1