From 7c9837e90ff7ae572de650cabab8a71262247c24 Mon Sep 17 00:00:00 2001
From: zzr99 <1940172413@qq.com>
Date: 星期三, 15 十二月 2021 17:59:43 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API

---
 WebAPI/Controllers/BaseSet/Gy_MaterialController.cs |   86 +++++++++++++++++++++++++++++++++++++++---
 1 files changed, 79 insertions(+), 7 deletions(-)

diff --git a/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs b/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
index f7ab835..0c3a0cc 100644
--- a/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
+++ b/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
@@ -589,6 +589,12 @@
                 string HMaterNumber = mainList[0].HMaterNumber;
                 string HSupNumber = mainList[0].HSupNumber;
                 long HPrintQty = mainList[0].HPrintQty;
+                string HMouldOWNER = mainList[0].HMouldOWNER;
+                string HSaveLife = mainList[0].HSaveLife;
+                int HCaveQty = mainList[0].HCaveQty;
+                int HMouldDotCheckRuleInterID= mainList[0].HMouldDotCheckRuleInterID;
+                int HMouldMaintainRuleInterID= mainList[0].HMouldMaintainRuleInterID;
+
 
 
                 //涓昏〃
@@ -599,9 +605,9 @@
                 ",HSubjoin,HSubjoin2,HPICNo,HWorkMaterModel" +
                 ",HMaterID,HMaterNumber,HMouldType,HUnitID" +
                 ",HOutComDate,HOutComNo,HDeptID,HSupID,HSupNumber" +
-                ",HPrintQty,HMouldStatus,HWhID,HRoutingID" +
+                ",HPrintQty,HMouldStatus,HWhID,HRoutingID,HCaveQty" +
                 ",HBomID,HVersion,HSPGroupID,HSPID,HDesignLife" +
-                ",HUseLife,HLeaveLife,HProdQty,HProdWeight" +
+                ",HUseLife,HLeaveLife,HProdQty,HProdWeight,HMouldOWNER,HSaveLife,HMouldDotCheckRuleInterID,HMouldMaintainRuleInterID" +
                 ") " +
                 " values('" + BillType + "','" + BillType + "'," + HInterID + ",'" + HBillNo + "','" + HDate + "'" +
                 "," + HYear + "," + HPeriod + ",'" + HRemark + "','" + HMaker + "',getdate()" +
@@ -609,9 +615,9 @@
                 ",'" + HSubjoin + "','" + HSubjoin2 + "','" + HPICNo + "','" + HWorkMaterModel + "'" +
                 "," + HMaterID + ",'" + HMaterNumber + "'," + HMouleTypeID + "," + HUnitID +
                 ",'" + HOutComDate + "','" + HOutComNo + "'," + HDeptID + "," + HSupID + ",'" + HSupNumber + "'" +
-                "," + HPrintQty + ",'" + HMouldStatus + "'," + HWHID + "," + HRoutingID +
+                "," + HPrintQty + ",'" + HMouldStatus + "'," + HWHID + "," + HRoutingID +","+ HCaveQty+
                 "," + HBOMID + ",'" + HVersion + "'," + HSPGroupID + "," + HSPID + ",'" + HDesignLife + "'" +
-                ",'" + HUseLife + "','" + HLeaveLife + "','" + HProdQty + "','" + HProdWeight + "'" +
+                ",'" + HUseLife + "','" + HLeaveLife + "','" + HProdQty + "','" + HProdWeight + "','" + HMouldOWNER + "','" + HSaveLife + "','" + HMouldDotCheckRuleInterID+"','"+ HMouldMaintainRuleInterID+"'"+
                 ") ");
 
 
@@ -721,9 +727,11 @@
                 string HMaterNumber = mainList[0].HMaterNumber;
                 string HSupNumber = mainList[0].HSupNumber;
                 long HPrintQty = mainList[0].HPrintQty;
-
-
-
+                string HMouldOWNER = mainList[0].HMouldOWNER;
+                string HSaveLife = mainList[0].HSaveLife;
+                int HCaveQty = mainList[0].HCaveQty;
+                int HMouldDotCheckRuleInterID = mainList[0].HMouldDotCheckRuleInterID;
+                int HMouldMaintainRuleInterID = mainList[0].HMouldMaintainRuleInterID;
 
 
                 //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
@@ -758,6 +766,7 @@
                 ",HSupNumber='" + HSupNumber + "'" +
                 ",HPrintQty=" + HPrintQty.ToString() +
                 ",HMouldStatus='" + HMouldStatus + "'" +
+                ",HSaveLife='" + HSaveLife + "'" +
                 ",HWhID=" + HWHID.ToString() +
                 ",HRoutingID=" + HRoutingID.ToString() +
                 ",HBomID=" + HBOMID.ToString() +
@@ -765,9 +774,13 @@
                 ",HSPGroupID=" + HSPGroupID.ToString() +
                 ",HSPID=" + HSPID.ToString() +
                 ",HDesignLife=" + HDesignLife.ToString() +
+                ",HCaveQty="+ HCaveQty.ToString()+
                 ",HUseLife=" + HUseLife.ToString() +
                 ",HLeaveLife=" + HLeaveLife.ToString() +
                 ",HProdQty=" + HProdQty.ToString() +
+                ",HMouldDotCheckRuleInterID="+ HMouldDotCheckRuleInterID.ToString()+
+                ",HMouldMaintainRuleInterID=" + HMouldMaintainRuleInterID.ToString() +
+                ",HMouldOWNER='" + HMouldOWNER + "'" +
                 ",HProdWeight=" + HProdWeight.ToString() +
                 " where HInterID=" + HInterID.ToString());
 
@@ -877,6 +890,65 @@
             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,string userID)
+        {
+            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"  +
+
+                ") ";
+                string sql1 = string.Format(@"Insert Into Sc_MouldStockBillSub   (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark,HSourceInterID,
+                HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney,HMaterID,HPropertyID,HSecUnitRate,HSecUnitID,HUnitID,
+                HBatchNo,HQtyMust,HQty,HPrice,HMoney,HDesignLife,HLeaveLife,HUseLife,HWHID,HSCWHID,HSPID,HSCSPID,HSPGroupID,HCorrespondentTypeID,HCorrespondentID,
+                HStockOrgID,HOWNERID,HOtherOrgID,HOWNERTYPEID) values(" + HInterID+ ",1,'',getdate(),0,'',0,0,'','',"+
+                "0,0,"+dr["HInterID"].ToString()+",0,0,0,"+ dr["HUnitID"].ToString()+",0,"+ dr["HProdQty"].ToString() +","+ dr["HProdQty"].ToString()+",0,"+
+                "0,"+ dr["HDesignLife"].ToString()+","+ dr["HLeaveLife"].ToString() + ","+dr["HUseLife"].ToString() + "," + dr["HWHID"].ToString() + ",0," + dr["HSPID"].ToString()+",0,0"
+                + ",0,0,"+ userID + ",0,0,'')");
+                //涓昏〃
+                oCN.RunProc(sql);
+                oCN.RunProc(sql1);
+
+                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