From 7cda563f00da59e4c733135d90c196e34494348d Mon Sep 17 00:00:00 2001
From: zrg <z18737863051@163.com>
Date: 星期三, 17 七月 2024 14:11:57 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API

---
 DAL/生产管理/模具管理/ClsSb_MouldRepairWorkBill.cs                      |   33 +
 WebAPI/Controllers/仓存管理/条码生成/Sc_BarCodeController.cs            |   13 
 WebAPI/Controllers/仓存管理/领料发货/Kf_MateOutRequestBillController.cs |  254 ++++++++++++++
 Model/生产管理/模具管理/ClsSc_MouldDotCheckBillMain.cs                  |    4 
 WebAPI/Controllers/SBGL/Sb_EquipReportController.cs             |  237 +++++++++++++
 WebAPI/Controllers/Sc_MouldRepairInBillListController.cs        |    2 
 WebAPI/DLL/ClsSc_MouldRepairCheckBill.cs                        |   43 ++
 DAL/生产管理/模具管理/ClsSc_MouldDotCheckBill.cs                        |   36 ++
 DAL/生产管理/模具管理/ClsSc_MouldMaintainBill.cs                        |    2 
 WebAPI/Models/HSouceOrderList.cs                                |    1 
 Model/生产管理/模具管理/ClsSc_MouldMaintainPlanBillMain.cs              |    1 
 WebAPI/Controllers/仓存管理/领料发货/Kf_MateOutBillController.cs        |   42 --
 WebAPI/Controllers/MJGL/Sc_MouldDotCheckRuleBillController.cs   |   39 ++
 WebAPI/DLL/ClsSb_EquipRepairCheckBill.cs                        |   41 ++
 WebAPI/Controllers/MJGL/Sc_MouldReportController.cs             |  237 +++++++++++++
 WebAPI/WebAPI.csproj                                            |    2 
 DAL/生产管理/模具管理/ClsSc_MouldMaintainPlanBill.cs                    |    5 
 WebAPI/Models/HBarCodeList.cs                                   |    1 
 18 files changed, 942 insertions(+), 51 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/ClsSb_MouldRepairWorkBill.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/ClsSb_MouldRepairWorkBill.cs"
index 1e6dc1c..064804d 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/ClsSb_MouldRepairWorkBill.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/ClsSb_MouldRepairWorkBill.cs"
@@ -135,6 +135,22 @@
             {
                 //寰楀埌mainid
                 omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo);
+
+                //淇濆瓨鍓嶆帶鍒�=========================================
+                string HBillNote = "";
+                DataSet ds = oCn.RunProcReturn("Exec h_p_Sc_MouldRepairWorkBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1,1 ", "h_p_Sc_MouldRepairWorkBill_BeforeSaveCtrl");
+                if (ds == null)
+                {
+                    sReturn = "淇濆瓨鍓嶅垽鏂け璐ワ紒";
+                    return false;
+                }
+                if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
+                {
+                    sReturn = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+                    return false;
+                }
+                //=========================================================
+
                 //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
                 oCn.BeginTran();
                 //涓昏〃
@@ -194,6 +210,23 @@
                 //    }
                 //}
                 //
+
+                //=========================淇濆瓨鍚庢帶鍒�  
+                DataSet ds2 = oCn.RunProcReturn("Exec h_p_Sc_MouldRepairWorkBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',1,1 ", "h_p_Sc_MouldRepairWorkBill_AfterSaveCtrl");
+                if (ds2 == null)
+                {
+                    sReturn = "淇濆瓨鍚庢帶鍒跺垽鏂け璐ワ紒";
+                    oCn.RollBack();
+                    return false;
+                }
+                if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
+                {
+                    sReturn = "淇濆瓨澶辫触2锛�" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]);
+                    oCn.RollBack();
+                    return false;
+                }
+                //============================
+
                 sReturn = "鏂板鍗曟嵁鎴愬姛锛�";
                 oCn.Commit();
                 return true;
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_MouldDotCheckBill.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_MouldDotCheckBill.cs"
index 5634a35..7458fb9 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_MouldDotCheckBill.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_MouldDotCheckBill.cs"
@@ -137,6 +137,22 @@
             {
                 //寰楀埌mainid
                 omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo);
+
+                //淇濆瓨鍓嶆帶鍒�=========================================
+                string HBillNote = "";
+                DataSet ds = oCn.RunProcReturn("Exec h_p_Sb_MouldDotCheckBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1,1 ", "h_p_Sb_MouldDotCheckBill_BeforeSaveCtrl");
+                if (ds == null)
+                {
+                    sReturn = "淇濆瓨鍓嶅垽鏂け璐ワ紒";
+                    return false;
+                }
+                if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
+                {
+                    sReturn = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+                    return false;
+                }
+                //=========================================================
+
                 //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
                 oCn.BeginTran();
                 //涓昏〃
@@ -173,6 +189,9 @@
                       ") ");
                 }
 
+                //鐐规瀹屾垚锛屽弽鍐欏櫒鍏风偣妫�璁″垝鍗曞瓙琛ㄦ槸鍚︾偣妫�鏍囪
+                oCn.RunProc("exec h_p_Sb_MouldDotCheck_AfterSaveCtrl " + omodel.HMouldDotCheckPlanInterID + "," + omodel.HMouldDotCheckPlanEntryID);
+
                 ////閰嶄欢椤圭洰
                 //foreach (Model.ClsSc_MouldDotCheckBillSub_Item oSub in DetailCol)
                 //{
@@ -201,6 +220,23 @@
                 //    }
                 //}
                 //
+
+                //=========================淇濆瓨鍚庢帶鍒�  
+                DataSet ds2 = oCn.RunProcReturn("Exec h_p_Sc_MouldDotCheckBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',1,1 ", "h_p_Sc_MouldDotCheckBill_AfterSaveCtrl");
+                if (ds2 == null)
+                {
+                    sReturn = "淇濆瓨鍚庢帶鍒跺垽鏂け璐ワ紒";
+                    oCn.RollBack();
+                    return false;
+                }
+                if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
+                {
+                    sReturn = "淇濆瓨澶辫触2锛�" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]);
+                    oCn.RollBack();
+                    return false;
+                }
+                //============================
+
                 sReturn = "鏂板鍗曟嵁鎴愬姛锛�";
                 oCn.Commit();
                 return true;
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_MouldMaintainBill.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_MouldMaintainBill.cs"
index 32929b1..276ef2d 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_MouldMaintainBill.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_MouldMaintainBill.cs"
@@ -274,7 +274,7 @@
                 //}
                 //
 
-                //淇濆吇瀹屾垚锛屽弽鍐欒澶囦繚鍏昏鍒掑崟瀛愯〃鏄惁鐐规鏍囪
+                //淇濆吇瀹屾垚锛屽弽鍐欏櫒鍏蜂繚鍏昏鍒掑崟瀛愯〃鏄惁鐐规鏍囪
                 oCn.RunProc("exec h_p_Sc_MouldMaintain_AfterSaveCtrl " + omodel.HMouldMaintainPlanInterID + "," + omodel.HMouldMaintainPlanEntryID);
 
                 //淇濆瓨鍚庢帶鍒�
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_MouldMaintainPlanBill.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_MouldMaintainPlanBill.cs"
index f54c039..0db8750 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_MouldMaintainPlanBill.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_MouldMaintainPlanBill.cs"
@@ -67,6 +67,7 @@
                 ",HMaintainLevID=" + omodel.HMaintainLevID +
                 ",HMainSourceInterID=" + omodel.HMainSourceInterID +
                 ",HMainSourceBillNo='" + omodel.HMainSourceBillNo + "'" +
+                ",HMouldID=" + omodel.HMouldID +
                 " where HInterID=" + lngBillKey.ToString());
                 //鍒犻櫎鍏宠仈
                 DeleteRelation(ref sReturn, lngBillKey);
@@ -145,13 +146,13 @@
                 "(HBillType,HBillSubType,HInterID,HBillNo,HDate,HMaker,HMakeDate" + 
                 ",HYear,HPeriod,HRemark" +
                 ",HCycleUnit,HCheckCycle,HBeginDate,HEndDate"+
-                ",HInnerBillNo,HExplanation,HMouldMaintainRuleID,HMaintainLevID,HMainSourceInterID,HMainSourceBillNo" +
+                ",HInnerBillNo,HExplanation,HMouldMaintainRuleID,HMaintainLevID,HMainSourceInterID,HMainSourceBillNo,HMouldID" +
                 ") " +
                 " values('" + this.BillType + "','"  + this.HBillSubType + "'," +omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "','" + DBUtility.ClsPub.CurUserName + "',getdate()" +
                 "," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "'"+
                 ",'" + omodel.HCycleUnit + "'," + omodel.HCheckCycle.ToString() + ",'" + omodel.HBeginDate + "','" + omodel.HEndDate + "'" +
                 ",'" + omodel.HInnerBillNo + "','" + omodel.HExplanation  + "','" + omodel.HMouldMaintainRuleID + "'," + omodel.HMaintainLevID +
-                "," + omodel.HMainSourceInterID + ",'" + omodel.HMainSourceBillNo + "'" +
+                "," + omodel.HMainSourceInterID + ",'" + omodel.HMainSourceBillNo + "'," + omodel.HMouldID + 
                 ") ");
                 //鎻掑叆瀛愯〃閰嶄欢淇℃伅
                 foreach (Model.ClsSc_MouldMaintainPlanBillSub oSub in DetailColl)
diff --git "a/Model/\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_MouldDotCheckBillMain.cs" "b/Model/\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_MouldDotCheckBillMain.cs"
index 64d5123..053bd5c 100644
--- "a/Model/\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_MouldDotCheckBillMain.cs"
+++ "b/Model/\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_MouldDotCheckBillMain.cs"
@@ -20,5 +20,9 @@
         public string HBigSafeNote;// 重大安全隐患记录 
         public Int64 HShiftsID;// 生产班次(Gy_Shifts) 
         public string HDotCheckNote;// 点检数据
+
+        public long HMouldDotCheckPlanInterID;//	int		--点检计划内码
+        public long HMouldDotCheckPlanEntryID;//	int		--点检计划子内码
+
     }
 }
diff --git "a/Model/\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_MouldMaintainPlanBillMain.cs" "b/Model/\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_MouldMaintainPlanBillMain.cs"
index bfd30a8..add8370 100644
--- "a/Model/\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_MouldMaintainPlanBillMain.cs"
+++ "b/Model/\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_MouldMaintainPlanBillMain.cs"
@@ -18,5 +18,6 @@
         public string HMouldMaintainRuleNo;//保养规程单号
 
         public Int64 HMaintainLevID; //保养级别(gy_HMaintainLev)
+        public Int64 HMouldID; //器具内码
     }
 }
diff --git a/WebAPI/Controllers/MJGL/Sc_MouldDotCheckRuleBillController.cs b/WebAPI/Controllers/MJGL/Sc_MouldDotCheckRuleBillController.cs
index d17c116..9e1745f 100644
--- a/WebAPI/Controllers/MJGL/Sc_MouldDotCheckRuleBillController.cs
+++ b/WebAPI/Controllers/MJGL/Sc_MouldDotCheckRuleBillController.cs
@@ -392,5 +392,44 @@
             }
         }
         #endregion
+
+        #region[鍣ㄥ叿鐐规璁板綍琛紝閫夌偣妫�璁″垝鑾峰彇鐐规璁″垝娓呭崟淇℃伅]
+        [Route("Sc_MouldDotCheckPlanBill/Sc_MouldDotCheckPlanBill_PlanList")]
+        [HttpGet]
+        public object Sc_MouldDotCheckPlanBill_PlanList(string HInterID, string HDate)
+        {
+            DataSet ds;
+            try
+            {
+                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+
+                ds = oCN.RunProcReturn("exec h_p_Sc_MouldDotCheck_GetPlanList " + HInterID + ",'" + HDate + "'", "h_p_Sc_MouldDotCheck_GetPlanList");
+
+                if (ds.Tables[0].Rows.Count != 0 || ds != null)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
+                    objJsonResult.data = ds.Tables[0];
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "娌℃湁鏌ヨ鍒版暟鎹俊鎭紒";
+                    objJsonResult.data = ds.Tables[0];
+                }
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鍙戠敓寮傚父锛屾病鏈夎繑鍥炰换浣曡鍒掞紒" + e.ToString();
+                objJsonResult.data = null;
+            }
+            return objJsonResult;
+        }
+        #endregion
+
     }
 }
\ No newline at end of file
diff --git a/WebAPI/Controllers/MJGL/Sc_MouldReportController.cs b/WebAPI/Controllers/MJGL/Sc_MouldReportController.cs
new file mode 100644
index 0000000..c83b66b
--- /dev/null
+++ b/WebAPI/Controllers/MJGL/Sc_MouldReportController.cs
@@ -0,0 +1,237 @@
+锘縰sing Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
+using Pub_Class;
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Data;
+using System.Data.SqlClient;
+using System.Web.Http;
+using WebAPI.Models;
+
+namespace WebAPI.Controllers.MJGL
+{
+    public class Sc_MouldReportController : ApiController
+    {
+        private json objJsonResult = new json();
+        SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+        DataSet ds;
+
+        #region  鍣ㄥ叿鐐规浠诲姟锛堜粖鏃ュ緟鐐规銆佷粖鏃ュ凡鐐规銆佷粖澶╁叏閮ㄤ换鍔★級
+        /// <summary>
+        /// 杩斿洖鍣ㄥ叿鐐规浠诲姟
+        ///鍙傛暟锛歴tring sql銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("Sc_MouldDotCheckTaskReport/CheckList")]
+        [HttpGet]
+        public object CheckList(string user)
+        {
+            try
+            {
+                List<object> columnNameList = new List<object>();
+
+                ds = oCN.RunProcReturn("exec h_p_Sc_MouldDotCheckTaskReport " + user, "h_p_Sc_MouldDotCheckTaskReport");
+
+                if (ds.Tables[0].Rows.Count != 0 || ds != null)
+                {
+                    //娣诲姞鍒楀悕
+                    foreach (DataColumn col in ds.Tables[0].Columns)
+                    {
+                        Type dataType = col.DataType;
+                        string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+                        columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+                    }
+
+                    objJsonResult.code = "1";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "Sucess锛�";
+                    objJsonResult.data = ds;
+                    objJsonResult.list = columnNameList;
+                    return objJsonResult;
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犳暟鎹�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #region  鍣ㄥ叿淇濆吇浠诲姟锛堜粖鏃ュ緟淇濆吇銆佷粖鏃ュ凡淇濆吇銆佷粖澶╁叏閮ㄤ换鍔★級
+        /// <summary>
+        /// 杩斿洖鍣ㄥ叿淇濆吇浠诲姟
+        ///鍙傛暟锛歴tring sql銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("Sc_MouldMaintainTaskReport/MaintainList")]
+        [HttpGet]
+        public object MaintainList(string user)
+        {
+            try
+            {
+                List<object> columnNameList = new List<object>();
+
+                ds = oCN.RunProcReturn("exec h_p_Sc_MouldMaintainTaskReport " + user, "h_p_Sc_MouldMaintainTaskReport");
+
+                if (ds.Tables[0].Rows.Count != 0 || ds != null)
+                {
+                    //娣诲姞鍒楀悕
+                    foreach (DataColumn col in ds.Tables[0].Columns)
+                    {
+                        Type dataType = col.DataType;
+                        string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+                        columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+                    }
+
+                    objJsonResult.code = "1";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "Sucess锛�";
+                    objJsonResult.data = ds;
+                    objJsonResult.list = columnNameList;
+                    return objJsonResult;
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犳暟鎹�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #region  鍣ㄥ叿缁翠慨浠诲姟锛堝緟缁翠慨銆佸凡缁翠慨銆佸叏閮ㄤ换鍔★級
+        /// <summary>
+        /// 杩斿洖鍣ㄥ叿缁翠慨浠诲姟
+        ///鍙傛暟锛歴tring sql銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("Sc_MouldRepairTaskReport/RepairList")]
+        [HttpGet]
+        public object RepairList(string user)
+        {
+            try
+            {
+                List<object> columnNameList = new List<object>();
+
+                ds = oCN.RunProcReturn("exec h_p_Sc_MouldRepairTaskReport " + user, "h_p_Sc_MouldRepairTaskReport");
+
+                if (ds.Tables[0].Rows.Count != 0 || ds != null)
+                {
+                    //娣诲姞鍒楀悕
+                    foreach (DataColumn col in ds.Tables[0].Columns)
+                    {
+                        Type dataType = col.DataType;
+                        string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+                        columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+                    }
+
+                    objJsonResult.code = "1";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "Sucess锛�";
+                    objJsonResult.data = ds;
+                    objJsonResult.list = columnNameList;
+                    return objJsonResult;
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犳暟鎹�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #region  鏁呴殰鐧昏璺熻釜锛堝緟缁翠慨銆佸凡缁翠慨銆佸凡楠屾敹锛�
+        /// <summary>
+        /// 杩斿洖鏁呴殰鐧昏璺熻釜
+        ///鍙傛暟锛歴tring sql銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("Sc_MouldRepairCheckTaskReport/RepairCheckList")]
+        [HttpGet]
+        public object RepairCheckList(string user)
+        {
+            try
+            {
+                List<object> columnNameList = new List<object>();
+
+                ds = oCN.RunProcReturn("exec h_p_Sc_MouldRepairCheckTaskReport " + user, "h_p_Sc_MouldRepairCheckTaskReport");
+
+                if (ds.Tables[0].Rows.Count != 0 || ds != null)
+                {
+                    //娣诲姞鍒楀悕
+                    foreach (DataColumn col in ds.Tables[0].Columns)
+                    {
+                        Type dataType = col.DataType;
+                        string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+                        columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+                    }
+
+                    objJsonResult.code = "1";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "Sucess锛�";
+                    objJsonResult.data = ds;
+                    objJsonResult.list = columnNameList;
+                    return objJsonResult;
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犳暟鎹�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+    }
+}
diff --git a/WebAPI/Controllers/SBGL/Sb_EquipReportController.cs b/WebAPI/Controllers/SBGL/Sb_EquipReportController.cs
new file mode 100644
index 0000000..28d4597
--- /dev/null
+++ b/WebAPI/Controllers/SBGL/Sb_EquipReportController.cs
@@ -0,0 +1,237 @@
+锘縰sing Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
+using Pub_Class;
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Data;
+using System.Data.SqlClient;
+using System.Web.Http;
+using WebAPI.Models;
+
+namespace WebAPI.Controllers.SBGL
+{
+    public class Sb_EquipReportController : ApiController
+    {
+        private json objJsonResult = new json();
+        SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+        DataSet ds;
+
+        #region  璁惧鐐规浠诲姟锛堜粖鏃ュ緟鐐规銆佷粖鏃ュ凡鐐规銆佷粖澶╁叏閮ㄤ换鍔★級
+        /// <summary>
+        /// 杩斿洖璁惧鐐规浠诲姟
+        ///鍙傛暟锛歴tring sql銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("Sb_EquipDotCheckTaskReport/CheckList")]
+        [HttpGet]
+        public object CheckList(string user)
+        {
+            try
+            {
+                List<object> columnNameList = new List<object>();
+
+                ds = oCN.RunProcReturn("exec h_p_Sb_EquipDotCheckTaskReport " + user, "h_p_Sb_EquipDotCheckTaskReport");
+
+                if (ds.Tables[0].Rows.Count != 0 || ds != null)
+                {
+                    //娣诲姞鍒楀悕
+                    foreach (DataColumn col in ds.Tables[0].Columns)
+                    {
+                        Type dataType = col.DataType;
+                        string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+                        columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+                    }
+                   
+                    objJsonResult.code = "1";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "Sucess锛�";
+                    objJsonResult.data = ds;
+                    objJsonResult.list = columnNameList;
+                    return objJsonResult;
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犳暟鎹�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #region  璁惧淇濆吇浠诲姟锛堜粖鏃ュ緟淇濆吇銆佷粖鏃ュ凡淇濆吇銆佷粖澶╁叏閮ㄤ换鍔★級
+        /// <summary>
+        /// 杩斿洖璁惧淇濆吇浠诲姟
+        ///鍙傛暟锛歴tring sql銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("Sb_EquipMaintainTaskReport/MaintainList")]
+        [HttpGet]
+        public object MaintainList(string user)
+        {
+            try
+            {
+                List<object> columnNameList = new List<object>();
+
+                ds = oCN.RunProcReturn("exec h_p_Sb_EquipMaintainTaskReport " + user, "h_p_Sb_EquipMaintainTaskReport");
+
+                if (ds.Tables[0].Rows.Count != 0 || ds != null)
+                {
+                    //娣诲姞鍒楀悕
+                    foreach (DataColumn col in ds.Tables[0].Columns)
+                    {
+                        Type dataType = col.DataType;
+                        string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+                        columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+                    }
+
+                    objJsonResult.code = "1";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "Sucess锛�";
+                    objJsonResult.data = ds;
+                    objJsonResult.list = columnNameList;
+                    return objJsonResult;
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犳暟鎹�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #region  璁惧缁翠慨浠诲姟锛堝緟缁翠慨銆佸凡缁翠慨銆佸叏閮ㄤ换鍔★級
+        /// <summary>
+        /// 杩斿洖璁惧缁翠慨浠诲姟
+        ///鍙傛暟锛歴tring sql銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("Sb_EquipRepairTaskReport/RepairList")]
+        [HttpGet]
+        public object RepairList(string user)
+        {
+            try
+            {
+                List<object> columnNameList = new List<object>();
+
+                ds = oCN.RunProcReturn("exec h_p_Sb_EquipRepairTaskReport " + user, "h_p_Sb_EquipRepairTaskReport");
+
+                if (ds.Tables[0].Rows.Count != 0 || ds != null)
+                {
+                    //娣诲姞鍒楀悕
+                    foreach (DataColumn col in ds.Tables[0].Columns)
+                    {
+                        Type dataType = col.DataType;
+                        string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+                        columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+                    }
+
+                    objJsonResult.code = "1";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "Sucess锛�";
+                    objJsonResult.data = ds;
+                    objJsonResult.list = columnNameList;
+                    return objJsonResult;
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犳暟鎹�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #region  鏁呴殰鐧昏璺熻釜锛堝緟缁翠慨銆佸凡缁翠慨銆佸凡楠屾敹锛�
+        /// <summary>
+        /// 杩斿洖鏁呴殰鐧昏璺熻釜
+        ///鍙傛暟锛歴tring sql銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("Sb_EquipRepairCheckTaskReport/RepairCheckList")]
+        [HttpGet]
+        public object RepairCheckList(string user)
+        {
+            try
+            {
+                List<object> columnNameList = new List<object>();
+
+                ds = oCN.RunProcReturn("exec h_p_Sb_EquipRepairCheckTaskReport " + user, "h_p_Sb_EquipRepairCheckTaskReport");
+
+                if (ds.Tables[0].Rows.Count != 0 || ds != null)
+                {
+                    //娣诲姞鍒楀悕
+                    foreach (DataColumn col in ds.Tables[0].Columns)
+                    {
+                        Type dataType = col.DataType;
+                        string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+                        columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+                    }
+
+                    objJsonResult.code = "1";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "Sucess锛�";
+                    objJsonResult.data = ds;
+                    objJsonResult.list = columnNameList;
+                    return objJsonResult;
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犳暟鎹�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+    }
+}
diff --git a/WebAPI/Controllers/Sc_MouldRepairInBillListController.cs b/WebAPI/Controllers/Sc_MouldRepairInBillListController.cs
index bf8953e..d59bf75 100644
--- a/WebAPI/Controllers/Sc_MouldRepairInBillListController.cs
+++ b/WebAPI/Controllers/Sc_MouldRepairInBillListController.cs
@@ -5247,7 +5247,7 @@
             {
                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                 //鑾峰彇淇濆吇椤圭洰缂栬緫鏁版嵁
-                string sql = "select 淇濆吇椤圭洰ID HMaintainItemID, 淇濆吇椤圭洰浠g爜 HMaintainItemNumber,淇濆吇椤圭洰 HMaintainItem,淇濆吇閮ㄤ綅 HMaintainPart,鍏蜂綋瑕佹眰 HClaim,璐熻矗浜篒D,璐熻矗浜轰唬鐮� HManagerNumber,璐熻矗浜哄悕绉� HManagerName,瀛愬娉�2 HRemark,HMouldMaintainRuleID,HEquipDotCheckNo  from h_v_Sc_MouldMaintainPlanBillSub_Item where 1 = 1 " + sqlWhere + "";
+                string sql = "select 淇濆吇椤圭洰ID HMaintainItemID, 淇濆吇椤圭洰浠g爜 HMaintainItemNumber,淇濆吇椤圭洰 HMaintainItem,淇濆吇閮ㄤ綅 HMaintainPart,鍏蜂綋瑕佹眰 HClaim,璐熻矗浜篒D HManagerID,璐熻矗浜轰唬鐮� HManagerNumber,璐熻矗浜哄悕绉� HManagerName,瀛愬娉�2 HRemark,HMouldMaintainRuleID,HEquipDotCheckNo  from h_v_Sc_MouldMaintainPlanBillSub_Item where 1 = 1 " + sqlWhere + "";
 
                 ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldMaintainPlanBillSub_Item");
                 //鑾峰彇閰嶄欢椤圭洰缂栬緫鏁版嵁
diff --git "a/WebAPI/Controllers/\344\273\223\345\255\230\347\256\241\347\220\206/\346\235\241\347\240\201\347\224\237\346\210\220/Sc_BarCodeController.cs" "b/WebAPI/Controllers/\344\273\223\345\255\230\347\256\241\347\220\206/\346\235\241\347\240\201\347\224\237\346\210\220/Sc_BarCodeController.cs"
index d66e65e..a1d9e86 100644
--- "a/WebAPI/Controllers/\344\273\223\345\255\230\347\256\241\347\220\206/\346\235\241\347\240\201\347\224\237\346\210\220/Sc_BarCodeController.cs"
+++ "b/WebAPI/Controllers/\344\273\223\345\255\230\347\256\241\347\220\206/\346\235\241\347\240\201\347\224\237\346\210\220/Sc_BarCodeController.cs"
@@ -835,6 +835,7 @@
             long HEmpID = 0;
             string HCusModel = ""; //瀹㈡埛鐗╂枡瑙勬牸
             string HCusMaterName = ""; //瀹㈡埛鐗╂枡鍚嶇О
+            string HCheckEmpName = ""; //妫�楠屽憳鍚嶇О
 
             DataSet Ds;
             msg2 = msg2.Replace("\\", "");
@@ -858,6 +859,7 @@
                     HEmpID = ClsPub.isLong(ordrlist[j].HEmpID);
                     HCusModel = ClsPub.isStrNull(ordrlist[j].HCusModel);
                     HCusMaterName = ClsPub.isStrNull(ordrlist[j].HCusMaterName);
+                    HCheckEmpName = ClsPub.isStrNull(ordrlist[j].HCheckEmpName);
                     //鏃ユ湡鑾峰彇鏂瑰紡
                     sDate = DateTime.Now.ToString();
                     //
@@ -870,6 +872,10 @@
                         sDate = DBUtility.ClsPub.isStrNull(ordrlist[j].HEndDate);
                     }
                     else if (CampanyName == "澶忓疂鐢靛櫒")// 鏃ユ湡锛氱敓浜ц鍗� 鏉$爜鏃ユ湡
+                    {
+                        sDate = DBUtility.ClsPub.isStrNull(ordrlist[j].HDate);
+                    }
+                    else if (CampanyName == "涔濊彵")// 鏃ユ湡锛氱敓浜ц鍗� 鏉$爜鏃ユ湡
                     {
                         sDate = DBUtility.ClsPub.isStrNull(ordrlist[j].HDate);
                     }
@@ -1209,6 +1215,7 @@
                         barcode.HEmpID2 = ordrlist[j].HEmpID;
                         barcode.HCusModel2 = ordrlist[j].HCusModel;
                         barcode.HCusMaterName2 = ordrlist[j].HCusMaterName;
+                        barcode.HCheckEmpName2 = ordrlist[j].HCheckEmpName;
                         ListRows.Add(barcode);
                         k = k + 1;
                         n = n + 1;
@@ -1260,6 +1267,7 @@
             long HEmpID2 = 0;
             string HCusModel2 = "";
             string HCusMaterName2 = "";
+            string HCheckEmpName2 = "";
 
             try
             {
@@ -1317,6 +1325,7 @@
                         HEmpID2 = ClsPub.isLong(ListRows[i].HEmpID2);
                         HCusModel2 = ClsPub.isStrNull(ListRows[i].HCusModel2);
                         HCusMaterName2 = ClsPub.isStrNull(ListRows[i].HCusMaterName2);
+                        HCheckEmpName2 = ClsPub.isStrNull(ListRows[i].HCheckEmpName2);
                         oCN.RunProc("insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty" +
                                     ",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty" +
                                     ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty " +
@@ -1325,7 +1334,7 @@
                                     ",HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID,HEntryID " +
                                     ",HGiveAwayFlag " +
                                     ",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo" +
-                                    ",HCoilNO,HFurnaceNO,HFactory,HAuxQty,HheatNO,HProduceDate,HExpiryDate,HEmpID,HCusModel,HCusMaterName " +
+                                    ",HCoilNO,HFurnaceNO,HFactory,HAuxQty,HheatNO,HProduceDate,HExpiryDate,HEmpID,HCusModel,HCusMaterName,HCheckEmpName " +
                                     ") values ("
                                     + "'" + HBarCode + "','" + HBarCodeType + "'," + HMaterID.ToString() + "," + HUnitID.ToString() + "," + HQty2.ToString()
                                     + ",'" + HBatchNo2 + "'," + HSupID.ToString() + "," + HGroupID2.ToString() + ",'" + ClsPub.CurUserName + "',getdate()," + HPrintQty.ToString() + "," + HQty2.ToString()
@@ -1334,7 +1343,7 @@
                                     + ", " + HCusID.ToString() + ",'" + HCusType + "','" + HEndDate.ToShortDateString() + "','" + HWorkLineName + "','" + sDate + "'"
                                     + ", " + HOrgID.ToString() + "," + HOrgID.ToString() + ",'" + HSeOrderBillNo + "'," + HInterID.ToString() + "," + HEntryID.ToString() + ""
                                     + ", " + DBUtility.ClsPub.BoolToString(HGiveAwayFlag)
-                                    + ",'" + HMaterName + "','" + HMaterModel + "','" + HPinfan + "'," + HAuxPropID.ToString() + ",'" + HMTONo + "','" + HInnerBillNo + "','" + HCoilNO2 + "','" + HFurnaceNO2 + "','" + HFactory2 + "'," + HAuxQty2 + ",'" + HheatNO2 + "','" + HProduceDate + "','" + HExpiryDate + "'," + HEmpID2.ToString() + ",'" + HCusModel2 + "','" + HCusMaterName2 + "'" + ")");
+                                    + ",'" + HMaterName + "','" + HMaterModel + "','" + HPinfan + "'," + HAuxPropID.ToString() + ",'" + HMTONo + "','" + HInnerBillNo + "','" + HCoilNO2 + "','" + HFurnaceNO2 + "','" + HFactory2 + "'," + HAuxQty2 + ",'" + HheatNO2 + "','" + HProduceDate + "','" + HExpiryDate + "'," + HEmpID2.ToString() + ",'" + HCusModel2 + "','" + HCusMaterName2 + "','" + HCheckEmpName2 + "'" + ")");
 
 
                         //HNumber = ClsPub.isStrNull(grdSub.Rows[i].Cells[HMaterID2Col].Value);
diff --git "a/WebAPI/Controllers/\344\273\223\345\255\230\347\256\241\347\220\206/\351\242\206\346\226\231\345\217\221\350\264\247/Kf_MateOutBillController.cs" "b/WebAPI/Controllers/\344\273\223\345\255\230\347\256\241\347\220\206/\351\242\206\346\226\231\345\217\221\350\264\247/Kf_MateOutBillController.cs"
index 72c6435..b861fd2 100644
--- "a/WebAPI/Controllers/\344\273\223\345\255\230\347\256\241\347\220\206/\351\242\206\346\226\231\345\217\221\350\264\247/Kf_MateOutBillController.cs"
+++ "b/WebAPI/Controllers/\344\273\223\345\255\230\347\256\241\347\220\206/\351\242\206\346\226\231\345\217\221\350\264\247/Kf_MateOutBillController.cs"
@@ -1338,48 +1338,6 @@
                         oCn.RunProc("Delete b from Kf_ICStockBillMain a inner join Kf_ICStockBillSub b on a.HInterID=b.HInterID where a.HBillNo = '" + HBillNo + "' and a.HBillType='1204'", ref DBUtility.ClsPub.sExeReturnInfo);
                         oCn.RunProc("Delete from Kf_ICStockBillMain where HBillNo = '" + HBillNo + "' and HBillType='1204'", ref DBUtility.ClsPub.sExeReturnInfo);
 
-                        ////涓昏〃鏁版嵁璧嬪��
-                        //var MainData = new
-                        //{
-                        //    HInterID = HNewInterID,
-                        //    HBillNo = DBUtility.ClsPub.isStrNull(_saveObj["Result"]["Result"]["BillNo"]),
-                        //    HBillType = "1204",
-                        //    HBillSubType = "1204",
-                        //    HMainSourceBillType = "",
-                        //    HDate = DBUtility.ClsPub.isDate(_saveObj["Result"]["Result"]["Date"]),
-                        //    HSupID = 0,
-                        //    HWHID = 0,
-                        //    HSCWHID = 0,
-                        //    HEmpID = 0,
-                        //    HManagerID = 0,
-                        //    HSecManagerID = DBUtility.ClsPub.isLong(_saveObj["Result"]["Result"]["PickerId_Id"]),
-                        //    HKeeperID = DBUtility.ClsPub.isLong(_saveObj["Result"]["Result"]["FSTOCKERID_Id"]),
-                        //    HDeptID = 0,
-                        //    HCurID = DBUtility.ClsPub.isLong(_saveObj["Result"]["Result"]["CurrId_Id"]),
-                        //    HSeOrderBillNo = "",
-                        //    HExplanation = "CLD瀵煎叆",
-                        //    HRemark = "",
-                        //    HInnerBillNo = "",
-                        //    HRedBlueFlag = 0,
-                        //    HBillStatus = DBUtility.ClsPub.isLong(_saveObj["Result"]["Result"]["ApproverId_Id"]) == 0 ? 1 : 2,
-                        //    HMaker = DBUtility.ClsPub.isStrNull(_saveObj["Result"]["Result"]["CreatorId"]["Name"]),
-                        //    HMakeDate = DBUtility.ClsPub.isDate(_saveObj["Result"]["Result"]["CreateDate"]),
-                        //    //HChecker = DBUtility.ClsPub.isStrNull(_saveObj["Result"]["Result"]["ApproverId"]),
-                        //    HChecker = DBUtility.ClsPub.isLong(_saveObj["Result"]["Result"]["ApproverId_Id"]) == 0 ? "" : DBUtility.ClsPub.isStrNull(_saveObj["Result"]["Result"]["ApproverId"]["Name"]),
-                        //    HCheckDate = DBUtility.ClsPub.isDate(_saveObj["Result"]["Result"]["ApproveDate"]),
-                        //    HUpDater = DBUtility.ClsPub.isStrNull(_saveObj["Result"]["Result"]["ModifierId_Id"]),
-                        //    HUpDateDate = DBUtility.ClsPub.isDate(_saveObj["Result"]["Result"]["ModifyDate"]),
-                        //    HDeleteMan = DBUtility.ClsPub.isStrNull(_saveObj["Result"]["Result"]["CANCELER_Id"]),
-                        //    HDeleteDate = DBUtility.ClsPub.isDate(_saveObj["Result"]["Result"]["CancelDate"]),
-                        //    HOWNERID = DBUtility.ClsPub.isLong(_saveObj["Result"]["Result"]["OwnerId_Id"]),
-                        //    HOWNERTYPEID = DBUtility.ClsPub.isStrNull(_saveObj["Result"]["Result"]["OwnerTypeId"]),
-                        //    HERPInterID = DBUtility.ClsPub.isLong(_saveObj["Result"]["Result"]["Id"]),
-                        //    HERPBillType = DBUtility.ClsPub.isStrNull(_saveObj["Result"]["Result"]["BillType_Id"]),
-                        //    HERPBillNo = DBUtility.ClsPub.isStrNull(_saveObj["Result"]["Result"]["BillNo"]),
-                        //    HPRDORGID = DBUtility.ClsPub.isLong(_saveObj["Result"]["Result"]["PrdOrgId_Id"]),
-                        //    HSTOCKORGID = DBUtility.ClsPub.isLong(_saveObj["Result"]["Result"]["StockOrgId_Id"]),
-                        //};
-
                         //涓昏〃鏁版嵁璧嬪��
                         var MainData = new
                         {
diff --git "a/WebAPI/Controllers/\344\273\223\345\255\230\347\256\241\347\220\206/\351\242\206\346\226\231\345\217\221\350\264\247/Kf_MateOutRequestBillController.cs" "b/WebAPI/Controllers/\344\273\223\345\255\230\347\256\241\347\220\206/\351\242\206\346\226\231\345\217\221\350\264\247/Kf_MateOutRequestBillController.cs"
index 80b8606..5130162 100644
--- "a/WebAPI/Controllers/\344\273\223\345\255\230\347\256\241\347\220\206/\351\242\206\346\226\231\345\217\221\350\264\247/Kf_MateOutRequestBillController.cs"
+++ "b/WebAPI/Controllers/\344\273\223\345\255\230\347\256\241\347\220\206/\351\242\206\346\226\231\345\217\221\350\264\247/Kf_MateOutRequestBillController.cs"
@@ -19,6 +19,7 @@
         private json objJsonResult = new json();
         public DataSet ds = new DataSet();
         public SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
+        Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
 
         public string HManagerID { get; private set; }
 
@@ -329,5 +330,258 @@
             }
         }
 
+
+        #region 鏍规嵁鍗曟嵁鍙凤紝鍚屾鐢熶骇鍙戞枡閫氱煡鍗�(棰嗙敤鐢宠鍗�)
+        [Route("Kf_MateOutRequestBillController/GetKf_MateOutRequestBill_Sync_Json")]
+        [HttpGet]
+        public json GetKf_MateOutRequestBill_Sync_Json(string HBillNo, string HBillType)
+        {
+            try
+            {
+                //鑾峰彇绯荤粺鍙傛暟
+                string sql = string.Empty;
+                string sErrMsg = "";
+                if (oSystemParameter.ShowBill(ref sErrMsg) == true)
+                {
+                    //绯荤粺鍙傛暟鏄惁涓虹鏈変簯妯″紡,N涓哄叕鏈変簯妯″紡锛孻涓虹鏈変簯妯″紡
+                    //绉佹湁浜戞ā寮忥紝閫氳繃璋冪敤瀛樺偍杩囩▼杩涜鍚屾
+                    if (oSystemParameter.omodel.WMS_CloudMode.ToUpper() == "Y")
+                    {
+                        ds = oCn.RunProcReturn("exec h_p_IFCLD_ERPSourceBillToLocal_MateOutRequest '" + HBillNo + "'", "h_p_IFCLD_ERPSourceBillToLocal_MateOutRequest");
+                        if (ds == null || ds.Tables[0].Rows.Count == 0)
+                        {
+                            objJsonResult.code = "0";
+                            objJsonResult.count = 0;
+                            objJsonResult.Message = "鍗曟嵁鍚屾鍙戠敓閿欒锛�";
+                            objJsonResult.data = null;
+                            return objJsonResult;
+                        }
+                        else
+                        {
+                            if (DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0]["HBack"]) == 2)
+                            {
+                                objJsonResult.code = "0";
+                                objJsonResult.count = 0;
+                                objJsonResult.Message = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+                                objJsonResult.data = null;
+                                return objJsonResult;
+                            }
+                            else
+                            {
+                                objJsonResult.code = "0";
+                                objJsonResult.count = 1;
+                                objJsonResult.Message = "鍗曟嵁鍚屾鎴愬姛锛�";
+                                objJsonResult.data = null;
+                                return objJsonResult;
+                            }
+                        }
+                    }
+                    //鍏湁浜戞ā寮忥紝閫氳繃璋冪敤WEBAPI鏂瑰紡杩涜鍚屾
+                    else if (oSystemParameter.omodel.WMS_CloudMode.ToUpper() == "N")
+                    {
+                        //鍒ゆ柇閲戣澏浜戞槸鍚︾櫥褰曟垚鍔�
+                        var loginRet = InvokeHelper.Login();
+                        var isSuccess = JObject.Parse(loginRet)["LoginResultType"].Value<int>();
+                        //鍒ゆ柇鏄惁鐧诲綍鎴愬姛
+                        if (isSuccess <= 0)
+                        {
+                            objJsonResult.code = "0";
+                            objJsonResult.count = 0;
+                            objJsonResult.Message = "鍚屾澶辫触锛岄噾铦朵簯鐧诲叆涓嶆垚鍔燂紝璇风‘璁鐩橀厤缃枃浠舵墍璁剧疆閲戣澏浜戝搴旂綉鍧�銆佽处濂椼�佺櫥褰曠敤鎴枫�佺櫥褰曞瘑鐮佹槸鍚︽纭紒";
+                            objJsonResult.data = null;
+                            return objJsonResult;
+                        }
+
+                        var json = new
+                        {
+                            CreateOrgId = 0,
+                            Number = HBillNo,
+                            Id = ""
+                        };
+                        //鏌ョ湅 鑾峰彇鏁版嵁                    
+                        var _result = InvokeHelper.View("PRD_ISSUEMTRNOTICE", JsonConvert.SerializeObject(json));
+                        var _saveObj = JObject.Parse(_result);
+                        //鍒ゆ柇閲戣澏浜戞暟鎹槸鍚﹁幏鍙栨垚鍔�
+                        if (_saveObj["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE")
+                        {
+                            objJsonResult.code = "0";
+                            objJsonResult.count = 0;
+                            objJsonResult.Message = "閲戣澏浜戠敓浜у彂鏂欓�氱煡鍗曡幏鍙栧け璐ワ細" + _result;
+                            objJsonResult.data = null;
+                            return objJsonResult;
+                        }
+
+                        oCn.BeginTran();
+                        //鏍规嵁鍗曟嵁鍙峰垹闄ゆ湰鍦扮敓浜у彂鏂欓�氱煡鍗曚腑瀵瑰簲鍗曟嵁
+                        oCn.RunProc("Delete b from Kf_MateOutRequestBillMain a inner join Kf_MateOutRequestBillSub b on a.HInterID=b.HInterID where a.HBillNo = '" + HBillNo + "'", ref DBUtility.ClsPub.sExeReturnInfo);
+                        oCn.RunProc("Delete from Kf_MateOutRequestBillMain where HBillNo = '" + HBillNo + "'", ref DBUtility.ClsPub.sExeReturnInfo);
+
+                        //涓昏〃鏁版嵁璧嬪��
+                        var MainData = new
+                        {
+                            HInterID = DBUtility.ClsPub.isLong(_saveObj["Result"]["Result"]["Id"]),
+                            HBillNo = DBUtility.ClsPub.isStrNull(_saveObj["Result"]["Result"]["BillNo"]),
+                            HBillType = "1214",
+                            HBillSubType = "1214",
+                            HDate = DBUtility.ClsPub.isDate(_saveObj["Result"]["Result"]["Date"]),
+                            HBillStatus = DBUtility.ClsPub.isLong(_saveObj["Result"]["Result"]["ApproverId_Id"]) == 0 ? 1 : 2,
+                            HInnerBillNo = DBUtility.ClsPub.isStrNull(_saveObj["Result"]["Result"]["BillNo"]),
+                            HRemark = "CLD瀵煎叆",
+                            HEmpID = 0,
+                            HManagerID = 0,
+                            HSecManagerID = 0,
+                            HKeeperID = 0,
+                            HDeptID = DBUtility.ClsPub.isLong(_saveObj["Result"]["Result"]["WorkShopId_Id"]),
+                            HExplanation = "",
+                            HICCard = "",
+                            HSUPPLYType = DBUtility.ClsPub.isStrNull(_saveObj["Result"]["Result"]["IssueType"]),
+                            HPRDORGID = DBUtility.ClsPub.isLong(_saveObj["Result"]["Result"]["PrdOrgId_Id"]),
+                            HMaker = DBUtility.ClsPub.isStrNull(_saveObj["Result"]["Result"]["CreatorId"]["Name"]),
+                            HMakeDate = DBUtility.ClsPub.isDate(_saveObj["Result"]["Result"]["CreateDate"]),
+                            HChecker = DBUtility.ClsPub.isLong(_saveObj["Result"]["Result"]["ApproverId_Id"]) == 0 ? "" : DBUtility.ClsPub.isStrNull(_saveObj["Result"]["Result"]["ApproverId"]["Name"]),
+                            HCheckDate = DBUtility.ClsPub.isDate(_saveObj["Result"]["Result"]["ApproveDate"]),
+                            HUpDater = DBUtility.ClsPub.isLong(_saveObj["Result"]["Result"]["ModifierId_Id"]) == 0 ? "" : DBUtility.ClsPub.isStrNull(_saveObj["Result"]["Result"]["ModifierId"]["Name"]),
+                            HUpDateDate = DBUtility.ClsPub.isDate(_saveObj["Result"]["Result"]["ModifyDate"]),
+                            HDeleteMan = DBUtility.ClsPub.isLong(_saveObj["Result"]["Result"]["CANCELER_Id"]) == 0 ? "" : DBUtility.ClsPub.isStrNull(_saveObj["Result"]["Result"]["CANCELER"]["Name"]),
+                            HDeleteDate = DBUtility.ClsPub.isDate(_saveObj["Result"]["Result"]["CancelDate"]),
+                        };
+                        //鍐欏叆涓昏〃
+                        sql = $@"Insert into Kf_MateOutRequestBillMain
+	                                (HInterID,HYear,HPeriod,HBillType,HBillSubType,HDate
+	                                ,HBillNo,HBillStatus,HInnerBillNo,HRemark
+	                                ,HEmpID,HManagerID,HSecManagerID,HKeeperID,HDeptID
+	                                ,HExplanation,HICCard,HSUPPLYType,HPRDORGID
+	                                ,HMaker,HMakeDate
+                                    ,HChecker,HCheckDate
+	                                ,HUpDater,HUpDateDate
+                                    ,HDeleteMan,HDeleteDate)
+                                    Values({MainData.HInterID},year('{MainData.HDate}'),month('{MainData.HDate}'),'{MainData.HBillType}','{MainData.HBillSubType}','{MainData.HDate}'
+                                    ,'{MainData.HBillNo}',{MainData.HBillStatus},'{MainData.HInnerBillNo}','{MainData.HRemark}'
+                                    , {MainData.HEmpID},{MainData.HManagerID},{MainData.HSecManagerID},{MainData.HKeeperID},{MainData.HDeptID}
+                                    ,'{MainData.HExplanation}','{MainData.HICCard}','{MainData.HSUPPLYType}',{MainData.HPRDORGID}
+                                    ,'{MainData.HMaker}','{MainData.HMakeDate}'
+                                    ,'{MainData.HChecker}',case when '{MainData.HCheckDate}' = '1900/1/1 0:00:00' then NULL else '{MainData.HCheckDate}' end
+                                    ,'{MainData.HUpDater}',case when '{MainData.HUpDateDate}' = '1900/1/1 0:00:00' then NULL else '{MainData.HUpDateDate}' end
+                                    ,'{MainData.HDeleteMan}',case when '{MainData.HDeleteDate}' = '1900/1/1 0:00:00' then NULL else '{MainData.HDeleteDate}' end)";
+                        oCn.RunProc(sql.Replace("\r\n", ""));
+
+                        //瀛愯〃鏁版嵁璧嬪��
+                        var dataArr = _saveObj["Result"]["Result"]["DetailEntity"];
+                        foreach (var oSub in dataArr)
+                        {
+                            var subData = new
+                            {
+                                HInterID = DBUtility.ClsPub.isLong(_saveObj["Result"]["Result"]["Id"]),
+                                HEntryID = DBUtility.ClsPub.isLong(oSub["Id"]),
+                                HERPInterID = DBUtility.ClsPub.isLong(_saveObj["Result"]["Result"]["Id"]),
+                                HERPEntryID = DBUtility.ClsPub.isLong(oSub["Id"]),
+                                HSEQ = DBUtility.ClsPub.isLong(oSub["Seq"]),
+                                HRemark = "",
+                                HMaterID = DBUtility.ClsPub.isLong(oSub["MATERIALID_Id"]),
+                                HProdMaterID = DBUtility.ClsPub.isLong(oSub["PMATERIALID_Id"]),
+                                HUnitID = DBUtility.ClsPub.isLong(oSub["UnitID_Id"]),
+                                HAuxPropID = DBUtility.ClsPub.isLong(oSub["AuxPropID_Id"]),
+                                HBatchNO = DBUtility.ClsPub.isStrNull(oSub["Lot_Text"]),
+                                HWHID = DBUtility.ClsPub.isLong(oSub["StockID_Id"]),
+                                HSPID = DBUtility.ClsPub.isLong(oSub["StockLOCID_Id"]),
+                                HPrice = 0,
+                                HMoney = 0,
+                                HMTONo = DBUtility.ClsPub.isStrNull(oSub["CHILDMTONO"]),
+                                HPlanMode = 0,
+                                HStockStatusID = DBUtility.ClsPub.isLong(oSub["StockStatusId_Id"]),
+                                HQty = DBUtility.ClsPub.isDoule(oSub["AppQty"]),
+                                HQtyMust = DBUtility.ClsPub.isDoule(oSub["MustQty"]),
+                                HRelationQty = DBUtility.ClsPub.isDoule(oSub["ActPickedQty"]),
+                                HMoveStockQty = 0,
+                                HRelationMoney = 0,
+                                HSourceInterID = 0,
+                                HSourceEntryID = 0,
+                                HSourceBillNo = DBUtility.ClsPub.isStrNull(oSub["MOBILLNO"]),
+                                HSourceBillType = "3710",
+                                HPPBOMInterID = DBUtility.ClsPub.isLong(oSub["PPBomId"]),
+                                HPPBOMEntryID = DBUtility.ClsPub.isLong(oSub["PPBomEntryId"]),
+                                HPPBOMEntrySEQ = 0,
+                                HPPBOMBillNo = "",
+                                HICMOInterID = 0,
+                                HICMOEntryID = 0,
+                                HICMOEntrySEQ = DBUtility.ClsPub.isLong(oSub["MOBILLSEQ"]),
+                                HICMOBillNo = DBUtility.ClsPub.isStrNull(oSub["MOBILLNO"]),
+                                HPOOrderInterID = 0,
+                                HPOOrderEntryID = 0,
+                                HPOOrderBillNo = "",
+                                HOWNERID = DBUtility.ClsPub.isLong(oSub["OwnerID_Id"]),
+                                HOWNERTYPEID = DBUtility.ClsPub.isStrNull(oSub["OwnerTypeId"]),
+                                HKEEPERID = DBUtility.ClsPub.isLong(oSub["KeeperId_Id"]),
+                                HKEEPERTYPEID = DBUtility.ClsPub.isStrNull(oSub["KeeperTypeId"]),
+                                HSUPPLYORGID = DBUtility.ClsPub.isLong(oSub["SupplyOrgId_Id"]),
+                                HBOMID = DBUtility.ClsPub.isLong(oSub["FChildBomID_Id"]),
+                                HProcessID = DBUtility.ClsPub.isLong(oSub["ProcessID_Id"]),
+                                HBaseUnitID = DBUtility.ClsPub.isLong(oSub["BaseUnitID_Id"]),
+                                HOperID = DBUtility.ClsPub.isLong(oSub["OperID"]),
+                                HOptQueue = DBUtility.ClsPub.isStrNull(oSub["OptQueue"]),
+                                HGroupRowId = DBUtility.ClsPub.isStrNull(oSub["GroupRowId"]),
+                            };
+
+                            //鍐欏叆瀛愯〃
+                            sql = $@"Insert into Kf_MateOutRequestBillSub
+	                                    (HInterID,HEntryID,HERPInterID,HERPEntryID,HSEQ,HRemark
+	                                    ,HMaterID,HProdMaterID,HUnitID,HAuxPropID,HBatchNO,HWHID,HSPID
+	                                    ,HPrice,HMoney,HMTONo,HPlanMode,HStockStatusID,HDate
+	                                    ,HQty,HQtyMust,HRelationQty,HMoveStockQty,HRelationMoney
+	                                    ,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType
+	                                    ,HPPBOMInterID,HPPBOMEntryID,HPPBOMEntrySEQ,HPPBOMBillNo
+	                                    ,HICMOInterID,HICMOEntryID,HICMOEntrySEQ,HICMOBillNo
+	                                    ,HPOOrderInterID,HPOOrderEntryID,HPOOrderBillNo
+	                                    ,HOWNERID,HOWNERTYPEID,HKEEPERID,HKEEPERTYPEID,HSUPPLYORGID
+	                                    ,HBOMID,HProcessID,HBaseUnitID,HOperID,HOptQueue,HGroupRowId)
+                                        Values ({subData.HInterID},{subData.HEntryID},{subData.HERPInterID},{subData.HERPEntryID},{subData.HSEQ},'{subData.HRemark}'
+                                        ,{subData.HMaterID},{subData.HProdMaterID},{subData.HUnitID},{subData.HAuxPropID},'{subData.HBatchNO}',{subData.HWHID},{subData.HSPID}
+                                        ,{subData.HPrice},{subData.HMoney},'{subData.HMTONo}',{subData.HPlanMode},{subData.HStockStatusID},getdate()
+                                        ,{subData.HQty},{subData.HQtyMust},{subData.HRelationQty},{subData.HMoveStockQty},{subData.HRelationMoney}
+                                        ,{subData.HSourceInterID},{subData.HSourceEntryID},'{subData.HSourceBillNo}','{subData.HSourceBillType}'
+                                        ,{subData.HPPBOMInterID},{subData.HPPBOMEntryID},{subData.HPPBOMEntrySEQ},'{subData.HPPBOMBillNo}'
+                                        ,{subData.HICMOInterID},{subData.HICMOEntryID},{subData.HICMOEntrySEQ},'{subData.HICMOBillNo}'
+                                        ,{subData.HPOOrderInterID},{subData.HPOOrderEntryID},'{subData.HPOOrderBillNo}'
+                                        ,{subData.HOWNERID},'{subData.HOWNERTYPEID}',{subData.HKEEPERID},'{subData.HKEEPERTYPEID}',{subData.HSUPPLYORGID}
+                                        ,{ subData.HBOMID},{subData.HProcessID},{ subData.HBaseUnitID},{subData.HOperID},'{ subData.HOptQueue}','{ subData.HGroupRowId}')";
+                            oCn.RunProc(sql.Replace("\r\n", ""));
+                        }
+
+                        oCn.Commit();
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 1;
+                        objJsonResult.Message = "鍗曟嵁鍚屾鎴愬姛锛�";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    else
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 1;
+                        objJsonResult.Message = "涓嶆敮鎸佸悓姝ュ姛鑳斤紒";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鑾峰彇绯荤粺鍙傛暟澶辫触锛� " + sErrMsg;
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鍗曟嵁鍚屾澶辫触锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
     }
 }
\ No newline at end of file
diff --git a/WebAPI/DLL/ClsSb_EquipRepairCheckBill.cs b/WebAPI/DLL/ClsSb_EquipRepairCheckBill.cs
index e9a7b99..2f2c7e7 100644
--- a/WebAPI/DLL/ClsSb_EquipRepairCheckBill.cs
+++ b/WebAPI/DLL/ClsSb_EquipRepairCheckBill.cs
@@ -55,6 +55,10 @@
                 ",HCheckResult='" + omodel.HCheckResult + "'" +
                 ",HExplanation='" + omodel.HExplanation + "'" +
                 ",HInnerBillNo='" + omodel.HInnerBillNo + "'" +
+                ",HMainSourceBillType='" + omodel.HMainSourceBillType + "'" +
+                ",HMainSourceInterID=" + omodel.HMainSourceInterID + 
+                ",HMainSourceEntryID=" + omodel.HMainSourceEntryID + 
+                ",HMainSourceBillNo='" + omodel.HMainSourceBillNo + "'" +
                 " where HInterID=" + lngBillKey.ToString());                
                 //鍒犻櫎鍏宠仈
                 //DeleteRelation(ref sReturn, lngBillKey);
@@ -92,6 +96,22 @@
             {
                 //寰楀埌mainid
                 omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo);
+
+                //淇濆瓨鍓嶆帶鍒�=========================================
+                string HBillNote = "";
+                DataSet ds = oCn.RunProcReturn("Exec h_p_Sb_EquipRepairCheckBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1 ,1", "h_p_Sb_EquipRepairCheckBill_BeforeSaveCtrl");
+                if (ds == null)
+                {
+                    sReturn = "淇濆瓨鍓嶅垽鏂け璐ワ紒";
+                    return false;
+                }
+                if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
+                {
+                    sReturn = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+                    return false;
+                }
+                //=========================================================
+
                 //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
                 oCn.BeginTran();
                 //涓昏〃
@@ -100,11 +120,13 @@
                 ",HYear,HPeriod,HRemark,HMaker,HMakeDate" +
                 ",HEquipID,HExplanation,HInnerBillNo,HEmpID" +
                 ",HManagerID,HDeptID,HCheckResult,HCheckBeginDate,HMouldRepairWorkID,HRepairCheckMainID,HRepairCheckMainContent" +
+                ",HMainSourceBillType,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo" +
                 ") " +
                 " values('" + this.BillType + "','" + this.HBillSubType + "'," + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "'" +
                 ", " + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "','" + omodel.HMaker+ "',getdate()" +
                 ", " + omodel.HEquipID.ToString() + ",'" + omodel.HExplanation + "','" + omodel.HInnerBillNo + "'," + omodel.HEmpID.ToString() +
-                "," + omodel.HManagerID.ToString() + "," + omodel.HDeptID.ToString() + ",'" + omodel.HCheckResult + "','" + omodel.HCheckBeginDate + "'," + omodel.HMouldRepairWorkID + "," + omodel.HRepairCheckMainID + ",'" + omodel.HRepairCheckMainContent + "'" +
+                "," + omodel.HManagerID.ToString() + "," + omodel.HDeptID.ToString() + ",'" + omodel.HCheckResult + "','" + omodel.HCheckBeginDate + "'," + omodel.HMouldRepairWorkID + "," + omodel.HRepairCheckMainID + ",'" + omodel.HRepairCheckMainContent + "','" + omodel.HMainSourceBillType + 
+                "'," + omodel.HMainSourceInterID + "," + omodel.HMainSourceEntryID + ",'" + omodel.HMainSourceBillNo + "'" +
                 ") ");
                 ////鎻掑叆瀛愯〃
                 foreach (Model.ClsSb_EquipRepairCheckBillSub oSub in DetailColl)
@@ -119,6 +141,23 @@
                       "," + oSub.HRepairCheckID.ToString() + "," + oSub.HManagerID.ToString() + ",'" + oSub.HRepairCheckContent + "'" +
                       ") ");
                 }
+
+                //=========================淇濆瓨鍚庢帶鍒�  
+                DataSet ds2 = oCn.RunProcReturn("Exec h_p_Sb_EquipRepairCheckBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote  + "',1,1 ", "h_p_Sb_EquipRepairCheckBill_AfterSaveCtrl");
+                if (ds2 == null)
+                {
+                    sReturn = "淇濆瓨鍚庢帶鍒跺垽鏂け璐ワ紒";
+                    oCn.RollBack();
+                    return false;
+                }
+                if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
+                {
+                    sReturn = "淇濆瓨澶辫触2锛�" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]);
+                    oCn.RollBack();
+                    return false;
+                }
+                //============================
+
                 sReturn = "鏂板鍗曟嵁鎴愬姛锛�";
                 oCn.Commit();
                 return true;
diff --git a/WebAPI/DLL/ClsSc_MouldRepairCheckBill.cs b/WebAPI/DLL/ClsSc_MouldRepairCheckBill.cs
index 82866f8..5f96c7c 100644
--- a/WebAPI/DLL/ClsSc_MouldRepairCheckBill.cs
+++ b/WebAPI/DLL/ClsSc_MouldRepairCheckBill.cs
@@ -55,7 +55,11 @@
                 ",HEmpID=" + omodel.HEmpID.ToString() +
                 ",HManagerID=" + omodel.HManagerID.ToString() +
                 ",HDeptID=" + omodel.HDeptID.ToString() +
-                  ",HMouldRepairWorkID=" + omodel.HMouldRepairWorkID.ToString() +
+                ",HMouldRepairWorkID=" + omodel.HMouldRepairWorkID.ToString() +
+                ",HMainSourceBillType='" + omodel.HMainSourceBillType + "'" +
+                ",HMainSourceInterID=" + omodel.HMainSourceInterID +
+                ",HMainSourceEntryID=" + omodel.HMainSourceEntryID +
+                ",HMainSourceBillNo='" + omodel.HMainSourceBillNo + "'" +
 
                 ",HExplanation='" + omodel.HExplanation + "'" +
                 ",HInnerBillNo='" + omodel.HInnerBillNo + "'" +
@@ -119,6 +123,22 @@
             {
                 //寰楀埌mainid
                 omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo);
+
+                //淇濆瓨鍓嶆帶鍒�=========================================
+                string HBillNote = "";
+                DataSet ds = oCn.RunProcReturn("Exec h_p_Sc_MouldRepairCheckBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1 ,1", "h_p_Sc_MouldRepairCheckBill_BeforeSaveCtrl");
+                if (ds == null)
+                {
+                    sReturn = "淇濆瓨鍓嶅垽鏂け璐ワ紒";
+                    return false;
+                }
+                if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
+                {
+                    sReturn = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+                    return false;
+                }
+                //=========================================================
+
                 //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
                 oCn.BeginTran();
                 //涓昏〃
@@ -128,12 +148,14 @@
                 ",HMouldID,HCheckBeginDate,HCheckResult" +
                 ",HEmpID,HManagerID,HDeptID"+
                 ",HInnerBillNo,HExplanation,HMouldRepairWorkID" +
+                 ",HMainSourceBillType,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo" +
                 ") " +
                 " values('" + this.BillType + "','"  + this.HBillSubType + "'," +omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "','" + omodel.HMaker + "',getdate()" +
                 "," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "'"+
                 "," + omodel.HMouldID.ToString() + ",'" + omodel.HCheckBeginDate + "','" + omodel.HCheckResult + "'" +
                 "," + omodel.HEmpID.ToString() + "," + omodel.HManagerID.ToString() + "," + omodel.HDeptID.ToString() +
-                ",'" + omodel.HInnerBillNo + "','" + omodel.HExplanation + "'" + "," + omodel.HMouldRepairWorkID + 
+                ",'" + omodel.HInnerBillNo + "','" + omodel.HExplanation + "'" + "," + omodel.HMouldRepairWorkID + ",'" + omodel.HMainSourceBillType +
+                "'," + omodel.HMainSourceInterID + "," + omodel.HMainSourceEntryID + ",'" + omodel.HMainSourceBillNo + "'" +
                 ") ");
                 //鎻掑叆瀛愯〃
                 foreach (Model.ClsSc_MouldRepairCheckBillSub oSub in DetailColl)
@@ -163,6 +185,23 @@
                 //    }
                 //}
                 //
+
+                //=========================淇濆瓨鍚庢帶鍒�  
+                DataSet ds2 = oCn.RunProcReturn("Exec h_p_Sc_MouldRepairCheckBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1,1 ", "h_p_Sc_MouldRepairCheckBill_AfterSaveCtrl");
+                if (ds2 == null)
+                {
+                    sReturn = "淇濆瓨鍚庢帶鍒跺垽鏂け璐ワ紒";
+                    oCn.RollBack();
+                    return false;
+                }
+                if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
+                {
+                    sReturn = "淇濆瓨澶辫触2锛�" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]);
+                    oCn.RollBack();
+                    return false;
+                }
+                //============================
+
                 sReturn = "鏂板鍗曟嵁鎴愬姛锛�";
                 oCn.Commit();
                 return true;
diff --git a/WebAPI/Models/HBarCodeList.cs b/WebAPI/Models/HBarCodeList.cs
index bbc6fad..f69b85e 100644
--- a/WebAPI/Models/HBarCodeList.cs
+++ b/WebAPI/Models/HBarCodeList.cs
@@ -75,6 +75,7 @@
         public Int64 HEmpID2 { get; set; } //"鎿嶄綔鍛�";
         public string HCusModel2 { get; set; } //"瀹㈡埛鐗╂枡瑙勬牸";
         public string HCusMaterName2 { get; set; } //"瀹㈡埛鐗╂枡鍚嶇О";
+        public string HCheckEmpName2 { get; set; } //"妫�楠屽憳鍚嶇О";
 
     }
 }
\ No newline at end of file
diff --git a/WebAPI/Models/HSouceOrderList.cs b/WebAPI/Models/HSouceOrderList.cs
index f9c08d7..5ffb466 100644
--- a/WebAPI/Models/HSouceOrderList.cs
+++ b/WebAPI/Models/HSouceOrderList.cs
@@ -78,5 +78,6 @@
         public string HEmpName { get; set; } //"鎿嶄綔鍛�";
         public string HCusModel { get; set; } //"瀹㈡埛鐗╂枡瑙勬牸";
         public string HCusMaterName { get; set; } //"瀹㈡埛鐗╂枡鍚嶇О";
+        public string HCheckEmpName { get; set; } //"妫�楠屽憳鍚嶇О";
     }
 }
\ No newline at end of file
diff --git a/WebAPI/WebAPI.csproj b/WebAPI/WebAPI.csproj
index 72fc43d..a1fd20d 100644
--- a/WebAPI/WebAPI.csproj
+++ b/WebAPI/WebAPI.csproj
@@ -428,6 +428,7 @@
     <Compile Include="Controllers\MJGL\Sc_MouldinventoryBillController.cs" />
     <Compile Include="Controllers\MJGL\Sc_MouldDotCheckRuleBillController.cs" />
     <Compile Include="Controllers\MJGL\Sc_MouldLifeUseBillController.cs" />
+    <Compile Include="Controllers\MJGL\Sc_MouldReportController.cs" />
     <Compile Include="Controllers\MJGL\Sc_MouldScrapRequestBillController.cs" />
     <Compile Include="Controllers\MJGL\Sc_MouldStatusChangeBillController.cs" />
     <Compile Include="Controllers\MJGL\Sc_MouldUpperBillController.cs" />
@@ -437,6 +438,7 @@
     <Compile Include="Controllers\SBGL\Gy_FixCardBillController.cs" />
     <Compile Include="Controllers\SBGL\SB_EquipICMOTechParamBillController.cs" />
     <Compile Include="Controllers\SBGL\Sb_EquipBeginBillController.cs" />
+    <Compile Include="Controllers\SBGL\Sb_EquipReportController.cs" />
     <Compile Include="Controllers\SBGL\Sb_EquipStopBillController.cs" />
     <Compile Include="Controllers\SBGL\Sb_EquipConkBookBillController.cs" />
     <Compile Include="Controllers\SBGL\Sb_EquipSparepartsBillController.cs" />

--
Gitblit v1.9.1