From c9324a4a47a26b7e9df93337bb74c2e95af63da8 Mon Sep 17 00:00:00 2001
From: zzr99 <1940172413@qq.com>
Date: 星期四, 11 十一月 2021 19:04:35 +0800
Subject: [PATCH] 1、器具档案新增编辑页面增加货主类型、预警寿命 2、新增器具保养规程单

---
 WebAPI/ListModels.cs                                          |   26 +++
 WebAPI/Properties/PublishProfiles/FolderProfile.pubxml.user   |   34 ++--
 Model/基础资料/基础资料/ClsGy_MouldFileMain.cs                        |    3 
 WebAPI/Models/Gy_Mould.cs                                     |    3 
 WebAPI/Controllers/BaseSet/Gy_MaterialController.cs           |   13 +
 DBUtility/业务单据/ClsXt_BaseBillMain.cs                          |    2 
 DAL/生产管理/模具管理/ClsSc_MouldMaintainRuleBill.cs                  |   28 ---
 WebAPI/Controllers/MJGL/Sc_MouldMaintainRuleBillController.cs |  338 ++++++++++++++++++++++++++++++++++++++++++
 WebAPI/WebAPI.csproj                                          |    1 
 WebAPI/Controllers/Sc_MouldOtherInBillController.cs           |    1 
 10 files changed, 394 insertions(+), 55 deletions(-)

diff --git "a/DAL/\347\224\237\344\272\247\347\256\241\347\220\206/\346\250\241\345\205\267\347\256\241\347\220\206/ClsSc_MouldMaintainRuleBill.cs" "b/DAL/\347\224\237\344\272\247\347\256\241\347\220\206/\346\250\241\345\205\267\347\256\241\347\220\206/ClsSc_MouldMaintainRuleBill.cs"
index 2fa48e5..5c1a4bb 100644
--- "a/DAL/\347\224\237\344\272\247\347\256\241\347\220\206/\346\250\241\345\205\267\347\256\241\347\220\206/ClsSc_MouldMaintainRuleBill.cs"
+++ "b/DAL/\347\224\237\344\272\247\347\256\241\347\220\206/\346\250\241\345\205\267\347\256\241\347\220\206/ClsSc_MouldMaintainRuleBill.cs"
@@ -179,34 +179,6 @@
                       "," + oSub.HMaintainItemID.ToString() + ",'" + oSub.HMaintainItem + "','" + oSub.HMaintainPart + "','" + oSub.HClaim + "'," + oSub.HManagerID.ToString() +
                       ") ");
                 }
-                //foreach (Model.ClsSc_MouldMaintainRuleBillSub_Entrust oSub in DetailColl_Entrust)
-                //{
-                //    oCn.RunProc("Insert into Sc_MouldMaintainRuleBillSub_Entrust " +
-                //     " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" +
-                //     ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
-                //     ",HMaterID,HUnitID,HProcID" +
-                //     ",HQty,HPrice,HMoney" +
-                //     ") values("
-                //     + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "'," + oSub.HEntryCloseDate.ToShortDateString() + "," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" +
-                //     "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() +
-                //     "," + oSub.HMaterID.ToString() + "," + oSub.HUnitID.ToString() + "," + oSub.HProcID.ToString() +
-                //     "," + oSub.HQty.ToString() + "," + oSub.HPrice.ToString() + "," + oSub.HMoney.ToString() +
-                //     ") ");
-                //}
-                //foreach (Model.ClsSc_MouldMaintainRuleBillSub_Money oSub in DetailColl_Money)
-                //{
-                //    oCn.RunProc("Insert into Sc_MouldMaintainRuleBillSub_Money " +
-                //     " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" +
-                //     ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
-                //     ",HItMoneyID" +
-                //     ",HQty,HPrice,HMoney" +
-                //     ") values("
-                //     + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "'," + oSub.HEntryCloseDate.ToShortDateString() + "," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" +
-                //     "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() +
-                //     "," + oSub.HItMoneyID.ToString() +
-                //     "," + oSub.HQty.ToString() + "," + oSub.HPrice.ToString() + "," + oSub.HMoney.ToString() +
-                //     ") ");
-                //}
                 sReturn = "鏂板鍗曟嵁鎴愬姛锛�";
                 oCn.Commit();
                 return true;
diff --git "a/DBUtility/\344\270\232\345\212\241\345\215\225\346\215\256/ClsXt_BaseBillMain.cs" "b/DBUtility/\344\270\232\345\212\241\345\215\225\346\215\256/ClsXt_BaseBillMain.cs"
index f1d8f76..fa6bb96 100644
--- "a/DBUtility/\344\270\232\345\212\241\345\215\225\346\215\256/ClsXt_BaseBillMain.cs"
+++ "b/DBUtility/\344\270\232\345\212\241\345\215\225\346\215\256/ClsXt_BaseBillMain.cs"
@@ -40,7 +40,7 @@
         public string HMainSourceBillType; 
         public Int64 HMainSourceInterID;
         public Int64 HMainSourceEntryID;
-
+        public Int64 HItemMainID;
         //组织
         public Int64 HPRDORGID;
     }
diff --git "a/Model/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/ClsGy_MouldFileMain.cs" "b/Model/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/ClsGy_MouldFileMain.cs"
index ad732b9..72b9df8 100644
--- "a/Model/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/ClsGy_MouldFileMain.cs"
+++ "b/Model/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/ClsGy_MouldFileMain.cs"
@@ -46,8 +46,9 @@
         public double HLeaveLife;//		money			//剩余寿命(不允许编辑)
         public double HProdQty;//		money			//已生产数量(不允许编辑)
         public double HProdWeight;//		money			//已生产重量(不允许编辑)
-
+        public string HMouldOWNER;//货主类型
         public string HBarCode;
         public string HInitModel;
+        public string HSaveLife;
     }
 }
diff --git a/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs b/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
index 0bdeb9f..4189e68 100644
--- a/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
+++ b/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
@@ -599,7 +599,8 @@
                 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;
 
                 //涓昏〃
                 oCN.RunProc("Insert Into Gy_MouldFileMain   " +
@@ -611,7 +612,7 @@
                 ",HOutComDate,HOutComNo,HDeptID,HSupID,HSupNumber" +
                 ",HPrintQty,HMouldStatus,HWhID,HRoutingID" +
                 ",HBomID,HVersion,HSPGroupID,HSPID,HDesignLife" +
-                ",HUseLife,HLeaveLife,HProdQty,HProdWeight" +
+                ",HUseLife,HLeaveLife,HProdQty,HProdWeight,HMouldOWNER,HSaveLife" +
                 ") " +
                 " values('" + BillType + "','" + BillType + "'," + HInterID + ",'" + HBillNo + "','" + HDate + "'" +
                 "," + HYear + "," + HPeriod + ",'" + HRemark + "','" + HMaker + "',getdate()" +
@@ -621,7 +622,7 @@
                 ",'" + HOutComDate + "','" + HOutComNo + "'," + HDeptID + "," + HSupID + ",'" + HSupNumber + "'" +
                 "," + HPrintQty + ",'" + HMouldStatus + "'," + HWHID + "," + HRoutingID + 
                 "," + HBOMID + ",'" + HVersion + "'," + HSPGroupID + "," + HSPID + ",'" + HDesignLife + "'" +
-                ",'" + HUseLife + "','" + HLeaveLife + "','" + HProdQty + "','" + HProdWeight + "'" +
+                ",'" + HUseLife + "','" + HLeaveLife + "','" + HProdQty + "','" + HProdWeight + "','" + HMouldOWNER +"',"+ "','" + HSaveLife + "'," +
                 ") ");
 
 
@@ -731,9 +732,9 @@
                 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;
 
-
-             
 
 
                 //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
@@ -768,6 +769,7 @@
                 ",HSupNumber='" + HSupNumber + "'" +
                 ",HPrintQty=" + HPrintQty.ToString() +
                 ",HMouldStatus='" + HMouldStatus + "'" +
+                ",HSaveLife='"+ HSaveLife+"'"+
                 ",HWhID=" + HWHID.ToString() +
                 ",HRoutingID=" + HRoutingID.ToString() +
                 ",HBomID=" + HBOMID.ToString() +
@@ -778,6 +780,7 @@
                 ",HUseLife=" + HUseLife.ToString() +
                 ",HLeaveLife=" + HLeaveLife.ToString() +
                 ",HProdQty=" + HProdQty.ToString() +
+                ",HMouldOWNER='"+ HMouldOWNER+"'"+
                 ",HProdWeight=" + HProdWeight.ToString() +
                 " where HInterID=" + HInterID.ToString());
           
diff --git a/WebAPI/Controllers/MJGL/Sc_MouldMaintainRuleBillController.cs b/WebAPI/Controllers/MJGL/Sc_MouldMaintainRuleBillController.cs
new file mode 100644
index 0000000..6a3a178
--- /dev/null
+++ b/WebAPI/Controllers/MJGL/Sc_MouldMaintainRuleBillController.cs
@@ -0,0 +1,338 @@
+锘縰sing Newtonsoft.Json.Linq;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Linq;
+using System.Net;
+using System.Net.Http;
+using System.Web.Http;
+using WebAPI.Models;
+
+namespace WebAPI.Controllers.MJGL
+{
+    public class Sc_MouldMaintainRuleBillController : ApiController
+    {
+        private json objJsonResult = new json();
+        public DataSet ds = new DataSet();
+
+        public DBUtility.ClsPub.Enum_BillStatus BillStatus;//鍗曟嵁鐘舵�侊紙鏂板锛屼慨鏀癸紝娴忚锛屾洿鏂板崟浠凤紝鍙樻洿锛�
+        SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+        public DAL.ClsSc_MouldMaintainRuleBill BillNew = new DAL.ClsSc_MouldMaintainRuleBill();   //瀵瑰簲鍗曟嵁绫�
+        public DAL.ClsSc_MouldMaintainRuleBill BillOld = new DAL.ClsSc_MouldMaintainRuleBill();   //瀵瑰簲鍗曟嵁绫�
+
+        #region 鍣ㄥ叿淇濆吇瑙勭▼鍗曞垪琛�
+        [Route("Sc_MouldMaintainRuleBill/GetMouldMaintainRuleList")]
+        [HttpGet]
+        public object GetMouldMaintainRuleList(string sWhere)
+        {
+            try
+            {
+                if (sWhere == null || sWhere.Equals(""))
+                {
+                    ds = oCN.RunProcReturn("select * from h_v_Sc_MouldMaintainRuleBillList " + sWhere + " order by hmainid desc", "h_v_Sc_MouldMaintainRuleBillList");
+                }
+                else
+                {
+                    string sql1 = "select * from h_v_Sc_MouldMaintainRuleBillList where 1 = 1";
+                    string sql = sql1 + sWhere + " order by hmainid desc";
+                    ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldMaintainRuleBillList");
+                }
+                if (ds == null || ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "娌℃湁浣犺鎵剧殑璁板綍锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else
+                {
+                    objJsonResult.code = "1";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "杩斿洖璁板綍鎴愬姛锛�";
+                    objJsonResult.data = ds.Tables[0];
+                    return objJsonResult;
+                }
+            }
+            catch (Exception ex)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + ex.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #region 鍣ㄥ叿淇濆吇瑙勭▼璁板綍鍒犻櫎鍔熻兘
+        [Route("Sc_MouldMaintainRuleBill/DeltetMouldMaintainRuleBillList")]
+        [HttpGet]
+        public object DeltetMouldMaintainRuleBillList(string HInterID)
+        {
+            Int64 lngBillKey = 0;
+            lngBillKey = DBUtility.ClsPub.isLong(HInterID);
+            if (lngBillKey == 0)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鍗曟嵁ID涓虹┖锛�";
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+            DAL.ClsSc_MouldMaintainRuleBill oBill = new DAL.ClsSc_MouldMaintainRuleBill();
+            if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo))
+            {
+                if (oBill.omodel.HBillStatus > 1)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鍗曟嵁褰撳墠澶勪簬涓嶈兘鍒犻櫎鐘舵��,涓嶈兘鍒犻櫎锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                if (oBill.omodel.HChecker != "")
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鍗曟嵁宸茬粡瀹℃牳,涓嶈兘鍒犻櫎锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                bool IsDete = oBill.DeleteBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
+                if (IsDete)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo;
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo;
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+            }
+            else
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鍗曟嵁鏈壘鍒�";
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        # region 鍣ㄥ叿淇濆吇瑙勭▼璁板綍鐐规椂鑾峰彇琛ㄤ綋鏁版嵁鏂�(淇濆吇椤瑰垪琛ㄣ�侀厤浠堕」鍒楄〃)
+        [Route("Sc_MouldMaintainRuleBill/Sc_MouldMaintainRuleBillListProjectDetaiNew")]
+        [HttpGet]
+        public object Sc_MouldMaintainRuleBillListProjectDetaiNew(string HInterID)
+        {
+
+            DataSet ds, ds1;
+            List<object> list = new List<object>();
+            string Swhere = "";
+            try
+            {
+                if (HInterID != "" || HInterID != null)
+                {
+                    Swhere = " and hmainid='" + HInterID + "'";
+                }
+                else
+                {
+                    Swhere = HInterID;
+                }
+                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+                //鑾峰彇淇濆吇椤圭洰缂栬緫鏁版嵁
+                string sql = "select * from h_v_Sc_MouldMaintainRuleBillSub_Item where 1 = 1 " + Swhere + "";
+                ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldMaintainRuleBillSub_Item");
+                //鑾峰彇閰嶄欢椤圭洰缂栬緫鏁版嵁
+                string sql1 = "select 閰嶄欢ID,閰嶄欢浠g爜,閰嶄欢鍚嶇О,鍗曚綅ID,璁¢噺鍗曚綅浠g爜,璁¢噺鍗曚綅鍚嶇О,鐢ㄩ噺,鏍囧噯鐢ㄩ噺,瀛愬娉� from h_v_Sc_MouldMaintainRuleBillList where 1 = 1 " + Swhere + "";
+                ds1 = oCN.RunProcReturn(sql1, "h_v_Sc_MouldMaintainRuleBillList");
+
+                list.Add(ds.Tables[0]);
+                list.Add(ds1.Tables[0]);
+                objJsonResult.code = "0";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
+                objJsonResult.list = list;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString();
+                objJsonResult.data = null;
+            }
+            return objJsonResult;
+        }
+        #endregion
+
+        #region 鍣ㄥ叿淇濆吇瑙勭▼琛ㄧ紪杈戞椂鑾峰彇琛ㄥご鏁版嵁
+        [Route("Sc_MouldMaintainRuleBill/Sc_MouldMaintainRuleBillListCheckDetai")]
+        [HttpGet]
+        public ApiResult<DataSet> Sc_MouldMaintainRuleBillListCheckDetai(string HID)
+        {
+            if (string.IsNullOrEmpty(HID))
+                return new ApiResult<DataSet> { code = -1, msg = "ID涓嶈兘涓虹┖" };
+            SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+            var dataSet = oCN.RunProcReturn("select top 1 * from h_v_Sc_MouldMaintainRuleBillList  where hmainid= " + HID + " ", "h_v_Sc_MouldMaintainRuleBillList");
+            if (dataSet == null || dataSet.Tables[0].Rows.Count == 0)
+                return new ApiResult<DataSet> { code = -1, msg = "涓嶅瓨鍦ㄥ櫒鍏蜂繚鍏昏绋嬭褰�" };
+            return new ApiResult<DataSet> { code = 1, msg = "鏌ヨ鎴愬姛", data = dataSet };
+        }
+        #endregion
+
+        #region 鍣ㄥ叿淇濆吇瑙勭▼琛� 淇濆瓨/缂栬緫
+        [Route("Sc_MouldMaintainRuleBill/SaveMouldMaintainRuleBillList")]
+        [HttpPost]
+        public object SaveMouldMaintainRuleBillList([FromBody] JObject msg)
+        {
+            var _value = msg["msg"].ToString();
+            string msg1 = _value.ToString();
+            string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
+            string msg2 = sArray[0].ToString();
+            string msg3 = sArray[1].ToString();
+            string msg4 = sArray[2].ToString();
+
+            string UserName = "";
+            ListModels oListModels = new ListModels();
+            try
+            {
+                DAL.ClsSc_MouldMaintainRuleBill oBill = new DAL.ClsSc_MouldMaintainRuleBill();
+                List<Model.ClsSc_MouldMaintainRuleBillMain> lsmain = new List<Model.ClsSc_MouldMaintainRuleBillMain>();
+                msg2 = msg2.Replace("\\", "");
+                msg2 = msg2.Replace("\n", "");  //\n
+                lsmain = oListModels.getObjectByJson_Sc_MouldMaintainRuleBillMain(msg2);
+                foreach (Model.ClsSc_MouldMaintainRuleBillMain oItem in lsmain)
+                {
+                    //oItem.HMaker = "";
+                    UserName = oItem.HMaker;  //鍒跺崟浜�
+                    oItem.HBillType = "3833";
+                    oItem.HBillSubType = "3833";
+
+                    //oItem.HInterID =0;
+                    //oItem.HBillNo = "";
+                    oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));//  --鏃ユ湡
+                    oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year);
+                    
+                    //oItem.HInterID = DBUtility.ClsPub.CreateBillID_SRMProd("1103", ref DBUtility.ClsPub.sExeReturnInfo);
+                    if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "")
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "淇濆瓨澶辫触锛佹病鏈夊崟鎹棩鏈燂紝鏃犳硶淇濆瓨锛�";
+                        objJsonResult.data = 1;
+                        return objJsonResult;
+                    }
+                    oBill.omodel = oItem;
+                }
+
+                //淇濆吇椤硅〃浣撴暟鎹�
+                //鎸� },{鏉ユ媶鍒嗘暟缁� //鍘绘帀銆愬拰銆�
+                msg3 = msg3.Substring(1, msg3.Length - 2);
+                msg3 = msg3.Replace("\\", "");
+                msg3 = msg3.Replace("\n", "");  //\n
+                //msg2 = msg2.Replace("'", "鈥�");
+                List<Model.ClsSc_MouldMaintainRuleBillSub_Item> ls = new List<Model.ClsSc_MouldMaintainRuleBillSub_Item>();
+                ls = oListModels.getObjectByJson_Sc_MouldMaintainRuleBillSub_Item(msg3);
+                int i = 0;
+                foreach (Model.ClsSc_MouldMaintainRuleBillSub_Item item in ls)
+                {
+
+                    i++;
+                    item.HEntryID = i;
+                    //oItemSub.HCloseMan = "";       //琛屽叧闂�
+                    item.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now);
+                    item.HCloseType = false;   //鍏抽棴绫诲瀷
+                    //oItemSub.HRemark = "";         //澶囨敞
+                    item.HSourceInterID = 0;     // 婧愬崟涓诲唴鐮�
+                    item.HSourceEntryID = 0;   //婧愬崟瀛愬唴鐮�
+                    //oItemSub.HSourceBillNo = "";  //婧愬崟鍗曞彿
+                    //oItemSub.HSourceBillType = ""; //婧愬崟绫诲瀷
+                    item.HRelationQty = 0;     //鍏宠仈鏁伴噺
+                    oBill.DetailColl_Pay.Add(item);
+
+                }
+
+                //閰嶄欢琛ㄤ綋鏁版嵁
+                //鎸� },{鏉ユ媶鍒嗘暟缁� //鍘绘帀銆愬拰銆�
+                msg4 = msg4.Substring(1, msg4.Length - 2);
+                msg4 = msg4.Replace("\\", "");
+                msg4 = msg4.Replace("\n", "");  //\n
+                                                //msg2 = msg2.Replace("'", "鈥�");
+                List<Model.ClsSc_MouldMaintainRuleBillSub> ls1 = new List<Model.ClsSc_MouldMaintainRuleBillSub>();
+                ls1 = oListModels.getObjectByJson_Sc_MouldMaintainRuleBillSub(msg4);
+                int j = 0;
+                foreach (Model.ClsSc_MouldMaintainRuleBillSub oItemSub in ls1)
+                {
+
+                    j++;
+                    oItemSub.HEntryID = i;
+                    //oItemSub.HCloseMan = "";       //琛屽叧闂�
+                    oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now);
+                    oItemSub.HCloseType = false;   //鍏抽棴绫诲瀷
+                                                   //oItemSub.HRemark = "";         //澶囨敞
+                    oItemSub.HSourceInterID = 0;     // 婧愬崟涓诲唴鐮�
+                    oItemSub.HSourceEntryID = 0;   //婧愬崟瀛愬唴鐮�
+                                                   //oItemSub.HSourceBillNo = "";  //婧愬崟鍗曞彿
+                                                   //oItemSub.HSourceBillType = ""; //婧愬崟绫诲瀷
+                    oItemSub.HRelationQty = 0;     //鍏宠仈鏁伴噺
+                                                   //oItemSub.HRelationMoney = 0;   //鍏宠仈閲戦
+                                                   //HMaterID = "";//閰嶄欢浠g爜
+                                                   //HUnitID = "";//鍗曚綅浠g爜
+                                                   //HQty = "";//瀹為檯鐢ㄩ噺
+                                                   //HQtyMust = "";//鍗曚綅鐢ㄩ噺
+                                                   //HRemark = "";//澶囨敞
+
+                    oBill.DetailColl_Mater.Add(oItemSub);
+
+                }
+                //淇濆瓨
+                //淇濆瓨瀹屾瘯鍚庡鐞�
+                bool bResult;
+                if (oBill.omodel.HInterID == 0)
+                {
+                    // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
+                    bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
+                }
+                else
+                {
+                    bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
+                }
+                if (bResult)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "淇濆瓨鎴愬姛锛�";
+                    //WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�");
+                    objJsonResult.data = 1;
+                    return objJsonResult;
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.sExeReturnInfo;
+                    objJsonResult.data = 1;
+                    return objJsonResult;
+                }
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "淇濆瓨澶辫触锛�" + e.ToString();
+                objJsonResult.data = 1;
+                return objJsonResult;
+            }
+        }
+        #endregion
+    }
+}
diff --git a/WebAPI/Controllers/Sc_MouldOtherInBillController.cs b/WebAPI/Controllers/Sc_MouldOtherInBillController.cs
index 38cc047..f65f3ab 100644
--- a/WebAPI/Controllers/Sc_MouldOtherInBillController.cs
+++ b/WebAPI/Controllers/Sc_MouldOtherInBillController.cs
@@ -169,7 +169,6 @@
                 }
                 else
                 {
-
                     //string sql1 = "select HRepairCheckID,HRepairCheckContent,HManagerID,HRemark  from Sc_MouldRepairCheckBillSub where 1 = 1 ";
                     string sql1 = string.Format(@"SELECT HMaterID,妯″叿浠g爜 HMaterCode,妯″叿鍚嶇О HMaterName,瑙勬牸鍨嬪彿 HMaterSpec,鎵规 HBatchNo,
                                                 璁捐瀵垮懡 HDesignLife, 鍓╀綑瀵垮懡 HLeaveLife, 绱Н浣跨敤瀵垮懡 HUseLife, 搴斿彂鏁伴噺 HQtyMust, 瀹炲彂鏁伴噺 HQty, 
diff --git a/WebAPI/ListModels.cs b/WebAPI/ListModels.cs
index 3fa16b9..331046b 100644
--- a/WebAPI/ListModels.cs
+++ b/WebAPI/ListModels.cs
@@ -559,7 +559,7 @@
         }
 
         /// <summary>
-        /// 澶勭悊鏂板妯″叿淇濆吇璁板綍琛ㄥ瓙琛ㄤ繚鍏婚」鐩殑json
+        /// 澶勭悊鏂板鍣ㄥ叿淇濆吇瑙勭▼瀛愯〃1椤圭洰鐨刯son
         /// </summary>
         /// <param name="jsonString"></param>
         /// <returns></returns>
@@ -571,6 +571,30 @@
         }
 
         /// <summary>
+        /// 澶勭悊鏂板鍣ㄥ叿淇濆吇瑙勭▼瀛愯〃2椤圭洰鐨刯son
+        /// </summary>
+        /// <param name="jsonString"></param>
+        /// <returns></returns>
+        public List<Model.ClsSc_MouldMaintainRuleBillSub> getObjectByJson_Sc_MouldMaintainRuleBillSub(string jsonString)
+        {
+            jsonString = "[" + jsonString.ToString() + "]";
+            List<Model.ClsSc_MouldMaintainRuleBillSub> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_MouldMaintainRuleBillSub>>(jsonString);
+            return list;
+        }
+
+        /// <summary>
+        /// 澶勭悊鏂板鍣ㄥ叿淇濆吇瑙勭▼椤圭洰鐨刯son
+        /// </summary>
+        /// <param name="jsonString"></param>
+        /// <returns></returns>
+        public List<Model.ClsSc_MouldMaintainRuleBillMain> getObjectByJson_Sc_MouldMaintainRuleBillMain(string jsonString)
+        {
+            jsonString = "[" + jsonString.ToString() + "]";
+            List<Model.ClsSc_MouldMaintainRuleBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_MouldMaintainRuleBillMain>>(jsonString);
+            return list;
+        }
+
+        /// <summary>
         /// 澶勭悊鏂板妯″叿淇濆吇璁板綍琛ㄥ瓙琛ㄩ厤浠堕」鐨刯son
         /// </summary>
         /// <param name="jsonString"></param>
diff --git a/WebAPI/Models/Gy_Mould.cs b/WebAPI/Models/Gy_Mould.cs
index a19da8b..357dc0e 100644
--- a/WebAPI/Models/Gy_Mould.cs
+++ b/WebAPI/Models/Gy_Mould.cs
@@ -55,8 +55,9 @@
         public long HLifeUnitID { get; set; }
 
         public long HBOMID { get; set; }
-
+        public string HSaveLife { get; set; }
         public long HPrintQty { get; set; }
+        public string HMouldOWNER { get; set; }
 
     }
 }
\ No newline at end of file
diff --git a/WebAPI/Properties/PublishProfiles/FolderProfile.pubxml.user b/WebAPI/Properties/PublishProfiles/FolderProfile.pubxml.user
index 34c3bf0..1487a98 100644
--- a/WebAPI/Properties/PublishProfiles/FolderProfile.pubxml.user
+++ b/WebAPI/Properties/PublishProfiles/FolderProfile.pubxml.user
@@ -18,25 +18,25 @@
       <publishTime>02/22/2013 08:43:40</publishTime>
     </File>
     <File Include="bin/BLL.dll">
-      <publishTime>11/05/2021 14:35:36</publishTime>
+      <publishTime>11/11/2021 19:03:07</publishTime>
     </File>
     <File Include="bin/BLL.pdb">
-      <publishTime>11/05/2021 14:35:36</publishTime>
+      <publishTime>11/11/2021 19:03:07</publishTime>
     </File>
     <File Include="bin/DAL.dll">
-      <publishTime>11/05/2021 14:35:33</publishTime>
+      <publishTime>11/11/2021 19:03:04</publishTime>
     </File>
     <File Include="bin/DAL.pdb">
-      <publishTime>11/05/2021 14:35:33</publishTime>
+      <publishTime>11/11/2021 19:03:04</publishTime>
     </File>
     <File Include="bin/Dapper.dll">
       <publishTime>07/22/2016 14:52:40</publishTime>
     </File>
     <File Include="bin/DBUtility.dll">
-      <publishTime>11/05/2021 14:35:27</publishTime>
+      <publishTime>11/11/2021 19:02:58</publishTime>
     </File>
     <File Include="bin/DBUtility.pdb">
-      <publishTime>11/05/2021 14:35:27</publishTime>
+      <publishTime>11/11/2021 19:02:58</publishTime>
     </File>
     <File Include="bin/Interop.gregn6Lib.dll">
       <publishTime>08/25/2021 10:28:25</publishTime>
@@ -60,10 +60,10 @@
       <publishTime>07/25/2012 11:48:56</publishTime>
     </File>
     <File Include="bin/Model.dll">
-      <publishTime>11/05/2021 14:35:28</publishTime>
+      <publishTime>11/11/2021 19:02:59</publishTime>
     </File>
     <File Include="bin/Model.pdb">
-      <publishTime>11/05/2021 14:35:28</publishTime>
+      <publishTime>11/11/2021 19:02:59</publishTime>
     </File>
     <File Include="bin/Models/ClsSc_MouldScrapOutBillMain.cs">
       <publishTime>08/16/2021 17:23:15</publishTime>
@@ -72,22 +72,22 @@
       <publishTime>08/03/2014 20:33:56</publishTime>
     </File>
     <File Include="bin/Pub_Class.dll">
-      <publishTime>11/05/2021 14:35:23</publishTime>
+      <publishTime>11/11/2021 19:02:54</publishTime>
     </File>
     <File Include="bin/Pub_Class.pdb">
-      <publishTime>11/05/2021 14:35:23</publishTime>
+      <publishTime>11/11/2021 19:02:54</publishTime>
     </File>
     <File Include="bin/Pub_Control.dll">
-      <publishTime>11/05/2021 14:35:25</publishTime>
+      <publishTime>11/11/2021 19:02:55</publishTime>
     </File>
     <File Include="bin/Pub_Control.pdb">
-      <publishTime>11/05/2021 14:35:25</publishTime>
+      <publishTime>11/11/2021 19:02:55</publishTime>
     </File>
     <File Include="bin/SQLHelper.dll">
-      <publishTime>11/05/2021 14:35:25</publishTime>
+      <publishTime>11/11/2021 19:02:56</publishTime>
     </File>
     <File Include="bin/SQLHelper.pdb">
-      <publishTime>11/05/2021 14:35:25</publishTime>
+      <publishTime>11/11/2021 19:02:56</publishTime>
     </File>
     <File Include="bin/stdole.dll">
       <publishTime>05/09/2021 13:35:37</publishTime>
@@ -189,10 +189,10 @@
       <publishTime>11/24/2014 11:18:48</publishTime>
     </File>
     <File Include="bin/WebAPI.dll">
-      <publishTime>11/05/2021 14:35:41</publishTime>
+      <publishTime>11/11/2021 19:03:13</publishTime>
     </File>
     <File Include="bin/WebAPI.pdb">
-      <publishTime>11/05/2021 14:35:41</publishTime>
+      <publishTime>11/11/2021 19:03:13</publishTime>
     </File>
     <File Include="bin/WebGrease.dll">
       <publishTime>07/17/2013 17:03:52</publishTime>
@@ -363,7 +363,7 @@
       <publishTime>08/06/2021 22:57:28</publishTime>
     </File>
     <File Include="Web.config">
-      <publishTime>11/05/2021 14:36:03</publishTime>
+      <publishTime>11/11/2021 19:04:02</publishTime>
     </File>
   </ItemGroup>
 </Project>
\ No newline at end of file
diff --git a/WebAPI/WebAPI.csproj b/WebAPI/WebAPI.csproj
index 28bdd20..e0a4616 100644
--- a/WebAPI/WebAPI.csproj
+++ b/WebAPI/WebAPI.csproj
@@ -330,6 +330,7 @@
     <Compile Include="Controllers\GZGL\Gy_WorkPayTypeBillController.cs" />
     <Compile Include="Controllers\GZGL\Gy_WorkTypeBillController.cs" />
     <Compile Include="Controllers\JHGL\Gy_RoutingBillController.cs" />
+    <Compile Include="Controllers\MJGL\Sc_MouldMaintainRuleBillController.cs" />
     <Compile Include="Controllers\MJGL\Sc_MouldMoveStockStepInBillListController .cs" />
     <Compile Include="Controllers\MJGL\Sc_MouldProdMoveBillListController.cs" />
     <Compile Include="Controllers\MJGL\Sc_MouldMoveStockStepOutBillController.cs" />

--
Gitblit v1.9.1