From 1cab96305b8558b70cc2f6cd225d546e8d27756c Mon Sep 17 00:00:00 2001
From: yxj <yxj@hz-kingdee.com>
Date: 星期二, 09 四月 2024 09:44:55 +0800
Subject: [PATCH] 新增网页版班次模块调用方法,直接调拨校验扫描物料条码方法修改,新增系统参数(当下一个生产日计划是相同产品时,MES系统自动开工下一单)

---
 DAL/基础资料/公用基础资料/ClsGy_Shifts_Ctl.cs                   |   22 +
 Pub_Class/CustomerCls/ClsXt_SystemParameter.cs        |   10 
 WebAPI/Controllers/基础资料/生产基础资料/Gy_ShiftsController.cs |  561 ++++++++++++++++++++++++++++++++++++++++++++++
 WebAPI/Controllers/ProductInController.cs             |   57 +++-
 Pub_Class/CustomerCls/ClsXt_SystemParameterMain.cs    |    1 
 WebAPI/WebAPI.csproj                                  |    1 
 WebAPI/Controllers/BaseSet/Gy_EmployeeController.cs   |   51 ++++
 7 files changed, 683 insertions(+), 20 deletions(-)

diff --git "a/DAL/\345\237\272\347\241\200\350\265\204\346\226\231/\345\205\254\347\224\250\345\237\272\347\241\200\350\265\204\346\226\231/ClsGy_Shifts_Ctl.cs" "b/DAL/\345\237\272\347\241\200\350\265\204\346\226\231/\345\205\254\347\224\250\345\237\272\347\241\200\350\265\204\346\226\231/ClsGy_Shifts_Ctl.cs"
index d2303b1..d2a60c1 100644
--- "a/DAL/\345\237\272\347\241\200\350\265\204\346\226\231/\345\205\254\347\224\250\345\237\272\347\241\200\350\265\204\346\226\231/ClsGy_Shifts_Ctl.cs"
+++ "b/DAL/\345\237\272\347\241\200\350\265\204\346\226\231/\345\205\254\347\224\250\345\237\272\347\241\200\350\265\204\346\226\231/ClsGy_Shifts_Ctl.cs"
@@ -20,11 +20,14 @@
                 oCn.BeginTran();
                 oCn.RunProc("Insert into " + MvarItemKey + " " +
                     " (HNumber,HName,HHelpCode,HShortNumber,HParentID" +
-                    ",HDeptID,HBeginTimes,HEndTimes,HWorkTimes" +
-                    ",HLevel,HEndFlag,HStopflag,HRemark) " +
+                    ",HLevel,HEndFlag,HStopflag,HRemark" +
+                    ",HMakeEmp,HMakeTime,HUSEORGID,HCREATEORGID" +
+                    ",HDeptID,HBeginTimes,HEndTimes,HWorkTimes) " +
                     " Values('" + oModel.HNumber + "','" + oModel.HName + "','" + oModel.HHelpCode + "','" + oModel.HShortNumber + "'," + oModel.HParentID.ToString() +
+                    "," + oModel.HLevel.ToString() + "," + Convert.ToString(oModel.HEndFlag ? 1 : 0) + "," + Convert.ToString(oModel.HStopflag ? 1 : 0) + ",'" + oModel.HRemark + "'" +
+                    ",'" + oModel.HMakeEmp + "',getdate()" + "," + oModel.HUSEORGID.ToString() + "," + oModel.HCREATEORGID.ToString() +
                     "," + oModel.HDeptID.ToString() + ",'" + oModel.HBeginTimes + "','" + oModel.HEndTimes + "'," + oModel.HWorkTimes.ToString() +
-                    "," + oModel.HLevel.ToString() + "," + Convert.ToString(oModel.HEndFlag ? 1 : 0) + "," + Convert.ToString(oModel.HStopflag ? 1 : 0) + ",'" + oModel.HRemark + "')", ref DBUtility.ClsPub.sExeReturnInfo);
+                    ")", ref DBUtility.ClsPub.sExeReturnInfo);
                 //淇敼涓婄骇涓洪潪鏈骇浠g爜
                 oCn.RunProc("Update " + MvarItemKey + " set HEndflag=0 where HItemID=" + oModel.HParentID, ref DBUtility.ClsPub.sExeReturnInfo);
                 oCn.Commit();
@@ -47,16 +50,21 @@
                     " HNumber='" + oModel.HNumber + "'" +
                     ",HName='" + oModel.HName + "'" +
                     ",HShortNumber='" + oModel.HShortNumber + "'" +
-                    ",HHelpCode='" + oModel.HHelpCode + "'" +
-                    ",HLevel=" + oModel.HLevel.ToString() +
                     ",HParentID=" + oModel.HParentID.ToString() +
+                    ",HLevel=" + oModel.HLevel.ToString() +
                     ",HEndflag=" + Convert.ToString(oModel.HEndFlag ? 1 : 0) +
                     ",HStopflag=" + Convert.ToString(oModel.HStopflag ? 1 : 0) +
+                    ",HRemark= '" + oModel.HRemark + "'" +
+                    ",HModifyEmp= '" + oModel.HModifyEmp + "'" +
+                    ",HModifyTime=getdate()" +
+                    ",HUSEORGID=" + oModel.HUSEORGID.ToString() +
+                    ",HCREATEORGID=" + oModel.HCREATEORGID.ToString() +
+                    //===========================================================
                     ",HDeptID=" + oModel.HDeptID.ToString() +
                     ",HBeginTimes='" + oModel.HBeginTimes + "'" +
                     ",HEndTimes='" + oModel.HEndTimes + "'" +
                     ",HWorkTimes=" + oModel.HWorkTimes.ToString() +
-                    ",HRemark= '" + oModel.HRemark + "' Where HItemID=" + sItemID, ref DBUtility.ClsPub.sExeReturnInfo);
+                    " where HItemID=" + sItemID, ref DBUtility.ClsPub.sExeReturnInfo);
                 //淇敼瀛愰」鐩唬鐮�
                 oCn.RunProc("exec h_p_Gy_UpdateNumber '" + MvarItemKey + "','" + oModel.HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo);
                 //灏嗕笂绾� 涓洪潪鏈骇
@@ -95,7 +103,7 @@
         public ClsGy_Shifts_Ctl()
         {
             MvarItemKey = "Gy_Shifts";
-            MvarReportTitle = "鐝璁剧疆";
+            MvarReportTitle = "鐝";
             oModel = new Model.ClsGy_Shifts_Model();
         } 
     }
diff --git a/Pub_Class/CustomerCls/ClsXt_SystemParameter.cs b/Pub_Class/CustomerCls/ClsXt_SystemParameter.cs
index 0673bac..fecbba8 100644
--- a/Pub_Class/CustomerCls/ClsXt_SystemParameter.cs
+++ b/Pub_Class/CustomerCls/ClsXt_SystemParameter.cs
@@ -1600,6 +1600,11 @@
                     {
                         omodel.Sc_ICMOBillWorkQtyStatus_AutoCheck = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                     }
+                    //当下一个生产日计划是相同产品时,MES系统自动开工下一单
+                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Sc_ICMOBillWorkQtyStatus_AutoNextWorkBill")
+                    {
+                        omodel.Sc_ICMOBillWorkQtyStatus_AutoNextWorkBill = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
+                    }
                     //==========质量汇报单
                     //自动审核
                     if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Sc_ICMOBillQualityStatus_AutoCheck")
@@ -3257,6 +3262,11 @@
                     {
                         omodel.Sc_ICMOBillWorkQtyStatus_AutoCheck = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                     }
+                    //当下一个生产日计划是相同产品时,MES系统自动开工下一单
+                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Sc_ICMOBillWorkQtyStatus_AutoNextWorkBill")
+                    {
+                        omodel.Sc_ICMOBillWorkQtyStatus_AutoNextWorkBill = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
+                    }
                     //==========质量汇报单
                     //自动审核
                     if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Sc_ICMOBillQualityStatus_AutoCheck")
diff --git a/Pub_Class/CustomerCls/ClsXt_SystemParameterMain.cs b/Pub_Class/CustomerCls/ClsXt_SystemParameterMain.cs
index 76ec6c0..b16841f 100644
--- a/Pub_Class/CustomerCls/ClsXt_SystemParameterMain.cs
+++ b/Pub_Class/CustomerCls/ClsXt_SystemParameterMain.cs
@@ -501,6 +501,7 @@
         public string Sc_ICMOBillWorkQtyStatus_AutoCheck;                   //保存后是否自动审核
         public string Sc_ICMOBillWorkQtyStatus_SaveAutoAddnew;               //保存后变为新增状态
         public string Sc_ICMOBillWorkQtyStatus_DeleterAndMakerMustSame;      //删除人必须是制单人
+        public string Sc_ICMOBillWorkQtyStatus_AutoNextWorkBill;            //当下一个生产日计划是相同产品时,MES系统自动开工下一单
         //质量汇报单
         public string Sc_ICMOBillQualityStatus_AutoCheck;                       //保存后是否自动审核
         public string Sc_ICMOBillQualityStatus_SaveAutoAddnew;               //保存后变为新增状态
diff --git a/WebAPI/Controllers/BaseSet/Gy_EmployeeController.cs b/WebAPI/Controllers/BaseSet/Gy_EmployeeController.cs
index a596213..38d1b4c 100644
--- a/WebAPI/Controllers/BaseSet/Gy_EmployeeController.cs
+++ b/WebAPI/Controllers/BaseSet/Gy_EmployeeController.cs
@@ -1308,5 +1308,56 @@
         }
         #endregion
 
+
+        #region 鏍规嵁鐝粍杩斿洖鑱屽憳淇℃伅
+        /// <summary>
+        /// 鏍规嵁鐝粍杩斿洖鑱屽憳淇℃伅
+        /// </summary>
+        /// <returns></returns>
+        [Route("Gy_EmployeeController/GetEmpInfoByGroup_Json")]
+        [HttpGet]
+        public object GetEmpInfoByGroup_Json(Int64 HGroupID)
+        {
+            try
+            {
+                //杩斿洖鍒楄〃淇℃伅
+                ds = oCN.RunProcReturn("select * from h_v_IF_EmployeeList where 绂佺敤鏍囪='' and HGroupID=" + HGroupID + " order by 鑱屽憳浠g爜", "h_v_IF_EmployeeList");
+                if (ds == null || ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鎵�閫夌彮缁勬棤瀵瑰簲鑱屽憳淇℃伅锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else
+                {
+                    List<object> columnNameList = new List<object>();
+                    //娣诲姞鍒楀悕
+                    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 = "0";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "鎴愬姛锛�";
+                    objJsonResult.data = ds.Tables[0];
+                    objJsonResult.list = columnNameList;
+                    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/Controllers/ProductInController.cs b/WebAPI/Controllers/ProductInController.cs
index d134bff..81e5847 100644
--- a/WebAPI/Controllers/ProductInController.cs
+++ b/WebAPI/Controllers/ProductInController.cs
@@ -42,6 +42,7 @@
         public ClsGy_BarCodeBill_WMS_Model_View oView =new ClsGy_BarCodeBill_WMS_Model_View();
         public ClsKF_PonderationBillMain_Temp model = new ClsKF_PonderationBillMain_Temp();
         public ClsKf_ICStockBill_WMS oBar = new Model.ClsKf_ICStockBill_WMS();
+        Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
         //public ClsKf_ICStockBill_WMS oBar = new ClsKf_ICStockBill_WMS();
         public double sRelQty = 0;
        // private DataBaseServices objDataBaseServices = new DataBaseServices();
@@ -393,24 +394,54 @@
         {
             WebS.WebService1 oWebs = new WebS.WebService1();
             WebS.ClsKf_ICStockBill_WMS WebSoBar = new WebS.ClsKf_ICStockBill_WMS();
-            var sJXCode = POStockInBillController.JX_Json(sCode, sInterID, HBillType, HOWNERID, sBillNo, sMaker);
-            string sExpressNumber = "";
-            //WebSoBar = oWebs.get_CheckTypeByBarCode_All(sCode, sInterID, HBillType, sBillNo, sMaker, WhID, SPID, sQty, sRedBlue, SourceFlag, sSourceBillNo, sSourceType, HOWNERID, sExpressNumber, ref DBUtility.ClsPub.sErrInfo);
-            WebSoBar = oWebs.get_BarCode_MoveStockBillCheck(sJXCode, sInterID, HBillType, sBillNo, sMaker, WhID, SPID, SCWhID, SCSPID, sQty, HOWNERID, ref DBUtility.ClsPub.sErrInfo);
-            if (WebSoBar == null)
+            //鑾峰彇绯荤粺鍙傛暟
+            string sErrMsg = "";
+            string sJXCode = "";
+            if (oSystemParameter.ShowBill(ref sErrMsg) == true)
             {
-                objJsonResult.code = "0";
-                objJsonResult.count = 0;
-                objJsonResult.Message = DBUtility.ClsPub.sErrInfo;
-                objJsonResult.data = null;
-                return objJsonResult;
+                if (oSystemParameter.omodel.WMS_CampanyName == "瀹夌憺") //绯荤粺鍙傛暟  瀹㈡埛瀹氬埗鍖栧悕绉�     绌虹櫧涓洪�氱敤
+                {
+                    sJXCode = POStockInBillController.JX_Json(sCode, sInterID, HBillType, HOWNERID, sBillNo, sMaker);
+                }
+                else
+                {
+                    sJXCode = sCode;
+                }
+                try
+                {
+                    WebSoBar = oWebs.get_BarCode_MoveStockBillCheck(sJXCode, sInterID, HBillType, sBillNo, sMaker, WhID, SPID, SCWhID, SCSPID, sQty, HOWNERID, ref DBUtility.ClsPub.sErrInfo);
+                    if (WebSoBar == null)
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = DBUtility.ClsPub.sErrInfo;
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    else
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 1;
+                        objJsonResult.Message = DBUtility.ClsPub.sErrInfo;
+                        objJsonResult.data = WebSoBar;
+                        return objJsonResult;
+                    }
+                }
+                catch (Exception e)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鎵弿鏉$爜澶辫触锛�" + e.ToString();
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
             }
             else
             {
                 objJsonResult.code = "0";
-                objJsonResult.count = 1;
-                objJsonResult.Message = DBUtility.ClsPub.sErrInfo;
-                objJsonResult.data = WebSoBar;
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鑾峰彇绯荤粺鍙傛暟澶辫触锛� " + sErrMsg;
+                objJsonResult.data = null;
                 return objJsonResult;
             }
         }
diff --git "a/WebAPI/Controllers/\345\237\272\347\241\200\350\265\204\346\226\231/\347\224\237\344\272\247\345\237\272\347\241\200\350\265\204\346\226\231/Gy_ShiftsController.cs" "b/WebAPI/Controllers/\345\237\272\347\241\200\350\265\204\346\226\231/\347\224\237\344\272\247\345\237\272\347\241\200\350\265\204\346\226\231/Gy_ShiftsController.cs"
new file mode 100644
index 0000000..81c3de7
--- /dev/null
+++ "b/WebAPI/Controllers/\345\237\272\347\241\200\350\265\204\346\226\231/\347\224\237\344\272\247\345\237\272\347\241\200\350\265\204\346\226\231/Gy_ShiftsController.cs"
@@ -0,0 +1,561 @@
+锘縰sing DBUtility;
+using Newtonsoft.Json;
+using 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
+{
+    public class Gy_ShiftsController : ApiController
+    {
+        public DBUtility.ClsPub.Enum_BillStatus BillStatus;
+        const string ModCaption = "鐝";
+        public const string ModRightName = "Gy_Shifts";
+        public const string ModRightNameAdd = ModRightName + "_Add";        //鏂板
+        public const string ModRightNameEdit = ModRightName + "_Edit";      //缂栬緫
+        public const string ModRightNameCheck = ModRightName + "_Check";    //瀹℃牳
+        public const string ModRightNameClose = ModRightName + "_Stop";     //绂佺敤
+        public const string ModRightNameDelete = ModRightName + "_Delete";  //鍒犻櫎
+        public DataSet ds = new DataSet();
+        private json objJsonResult = new json();
+        SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
+        DAL.ClsGy_Shifts_Ctl oBill = new DAL.ClsGy_Shifts_Ctl();
+        DAL.ClsGy_Shifts_View oBillHlp = new DAL.ClsGy_Shifts_View();
+
+
+        #region 鐝鍒楄〃
+        /// <summary>
+        /// 鑾峰彇鐝鍒楄〃淇℃伅
+        /// </summary>
+        /// <returns></returns>
+        [Route("Gy_ShiftsController/GetGy_ShiftsList_Json")]
+        [HttpGet]
+        public object GetGy_ShiftsList_Json(string sWhere, string HMaker, string OperationType)
+        {
+            try
+            {
+                //鍒ゆ柇鏉冮檺
+                if (OperationType == "1")
+                {
+                    //鍒ゆ柇鏉冮檺
+                    if (!DBUtility.ClsPub.Security_Log(ModRightName, 3, false, HMaker))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鎮ㄦ病鏈夎妯″潡鏉冮檺,璇蜂笌绠$悊鍛樿仈绯伙紒";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                }
+
+                //杩斿洖鍒楄〃淇℃伅
+                ds = oCn.RunProcReturn("select * from h_v_Gy_ShiftsList where " + sWhere + " order by " + ModCaption + "浠g爜" , "h_v_Gy_ShiftsList");
+                List<object> columnNameList = new List<object>();
+                //娣诲姞鍒楀悕
+                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 = "0";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "鎴愬姛锛�";
+                objJsonResult.data = ds.Tables[0];
+                objJsonResult.list = columnNameList;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鏌ヨ鍒楄〃淇℃伅澶辫触锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #region 鐝鍒犻櫎
+        /// <summary>
+        /// 鍒犻櫎鐝
+        /// </summary>
+        /// <returns></returns>
+        [Route("Gy_ShiftsController/GetGy_Shifts_Delete_Json")]
+        [HttpGet]
+        public object GetGy_Shifts_Delete_Json(Int64 HItemID, string HMaker)
+        {
+            try
+            {
+                //鍒ゆ柇鏉冮檺
+                if (!DBUtility.ClsPub.Security_Log(ModRightNameDelete, 3, false, HMaker))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鎮ㄦ病鏈夎妯″潡鍒犻櫎鍔熻兘鏉冮檺,璇蜂笌绠$悊鍛樿仈绯伙紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                //鍒ゆ柇瀛樺湪鎬�
+                if (oBillHlp.GetInfoByID(HItemID))
+                {
+                    //鍒ゆ柇鏄惁瀛樺湪瀛愰」
+                    if (oBill.HavChildCodes(HItemID))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "姝ょ彮娆″瓨鍦ㄥ瓙椤圭洰,涓嶈兘鍒犻櫎锛�";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    //鍒犻櫎鏁版嵁
+                    if (oBill.DeleteByID(HItemID))
+                    {
+                        //鍐欏叆鏃ュ織
+                        DBUtility.ClsPub.Add_Log("", "鍒犻櫎鐝锛屼唬鐮侊細" + oBillHlp.omodel.HNumber + ",鍚嶇О锛�" + oBillHlp.omodel.HName, HMaker);
+                        objJsonResult.code = "1";
+                        objJsonResult.count = 1;
+                        objJsonResult.Message = "鍒犻櫎鐝鎴愬姛锛�";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    else
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鍒犻櫎鐝澶辫触锛�";
+                        objJsonResult.data = null;
+                        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 = "鍒犻櫎鐝澶辫触锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #region 鐝瀹℃牳銆佸弽瀹℃牳
+        /// <summary>
+        /// 瀹℃牳銆佸弽瀹℃牳鐝
+        /// </summary>
+        /// <param name="HItemID">鍐呯爜</param>
+        /// <param name="IsAudit">瀹℃牳(0),鍙嶅鏍�(1)</param>
+        /// <param name="HMaker">鎿嶄綔浜�</param>
+        /// <returns></returns>
+        [Route("Gy_ShiftsController/GetGy_Shifts_Check_Json")]
+        [HttpGet]
+        public object GetGy_Shifts_Check_Json(Int64 HItemID, int IsAudit, string HMaker)
+        {
+            string sErrMsg = "";
+            try
+            {
+                //鍒ゆ柇鏉冮檺
+                if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 3, false, HMaker))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鎮ㄦ病鏈夎妯″潡瀹℃牳/鍙嶅鏍稿姛鑳芥潈闄�,璇蜂笌绠$悊鍛樿仈绯伙紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                if (IsAudit == 0)   //瀹℃牳鍒ゆ柇
+                {
+                    if (oBill.CheckByHItemID(HItemID, HMaker, ref sErrMsg))
+                    {
+                        objJsonResult.code = "1";
+                        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;
+                    }
+                }
+                else if (IsAudit == 1)  //鍙嶅鏍稿垽鏂�
+                {
+                    if (oBill.AbandonCheckByHItemID(HItemID, HMaker, ref sErrMsg))
+                    {
+                        objJsonResult.code = "1";
+                        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;
+                    }
+                }
+                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 = "瀹℃牳鎴栧弽瀹℃牳鐝澶辫触锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #region 鐝绂佺敤銆佸弽绂佺敤
+        /// <summary>
+        /// 绂佺敤銆佸弽绂佺敤鐝
+        /// </summary>
+        /// <param name="HItemID">鍐呯爜</param>
+        /// <param name="IsStop">绂佺敤(0),鍙嶇鐢�(1)</param>
+        /// <param name="HMaker">鎿嶄綔浜�</param>
+        /// <returns></returns>
+        [Route("Gy_ShiftsController/GetGy_Shifts_Stop_Json")]
+        [HttpGet]
+        public object GetGy_Shifts_Stop_Json(Int64 HItemID, int IsStop, string HMaker)
+        {
+            string sErrMsg = "";
+            try
+            {
+                //鍒ゆ柇鏉冮檺
+                if (!DBUtility.ClsPub.Security_Log(ModRightNameClose, 3, false, HMaker))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鎮ㄦ病鏈夎妯″潡绂佺敤/鍙嶇鐢ㄥ姛鑳芥潈闄�,璇蜂笌绠$悊鍛樿仈绯伙紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                if (IsStop == 0)   //绂佺敤鍒ゆ柇
+                {
+                    if (oBill.StopByHItemID(HItemID, HMaker, ref sErrMsg))
+                    {
+                        objJsonResult.code = "1";
+                        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;
+                    }
+                }
+                else if (IsStop == 1)  //鍙嶇鐢ㄥ垽鏂�
+                {
+                    if (oBill.AbandonStopByHItemID(HItemID, HMaker, ref sErrMsg))
+                    {
+                        objJsonResult.code = "1";
+                        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;
+                    }
+                }
+                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 = "绂佺敤鎴栧弽绂佺敤鐝澶辫触锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #region 鐝淇濆瓨
+        /// <summary>
+        /// 鐝淇濆瓨
+        /// </summary>
+        [Route("Gy_ShiftsController/GetGy_Shifts_Save_Json")]
+        [HttpPost]
+        public object GetGy_Shifts_Save_Json([FromBody] JObject oMain)
+        {
+            try
+            {
+                var _value = oMain["oMain"].ToString();
+                string msg1 = _value.ToString();
+                string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
+                string msg2 = sArray[0].ToString();
+                string HMaker = sArray[1].ToString();
+                string OperationType = sArray[2].ToString();    //鎿嶄綔绫诲瀷锛�1鏂板銆�2缂栬緫锛�
+
+                //鍒ゆ柇鏉冮檺
+                if (OperationType == "1")
+                {
+                    //鍒ゆ柇鏂板鏉冮檺
+                    if (!DBUtility.ClsPub.Security_Log(ModRightNameAdd, 1, false, HMaker))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鎮ㄦ病鏈夎妯″潡鏂板鏉冮檺,璇蜂笌绠$悊鍛樿仈绯伙紒";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                }
+                else
+                {
+                    //鍒ゆ柇缂栬緫鏉冮檺
+                    if (!DBUtility.ClsPub.Security_Log(ModRightNameEdit, 1, false, HMaker))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鎮ㄦ病鏈夎妯″潡缂栬緫鏉冮檺,璇蜂笌绠$悊鍛樿仈绯伙紒";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                }
+
+                //鍙嶅簭鍒楀寲
+                msg2 = msg2.Replace("\\", "");
+                msg2 = msg2.Replace("\n", "");
+                msg2 = "[" + msg2.ToString() + "]";
+                List<Model.ClsGy_Shifts_Model> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsGy_Shifts_Model>>(msg2);
+                oBill.oModel.HItemID = list[0].HItemID;
+                oBill.oModel.HNumber = list[0].HNumber;
+                oBill.oModel.HName = list[0].HName;
+                oBill.oModel.HShortNumber = DBUtility.ClsPub.GetShortNumber(list[0].HNumber);
+                oBill.oModel.HLevel = DBUtility.ClsPub.GetLevel(list[0].HNumber);
+                oBill.oModel.HEndFlag = true;
+                oBill.oModel.HStopflag = list[0].HStopflag;
+                oBill.oModel.HUseFlag = list[0].HUseFlag;
+                oBill.oModel.HRemark = list[0].HRemark;
+                oBill.oModel.HMakeEmp = HMaker;
+                oBill.oModel.HModifyEmp = HMaker;
+                oBill.oModel.HCheckEmp = list[0].HCheckEmp;
+                oBill.oModel.HUSEORGID = list[0].HUSEORGID;
+                oBill.oModel.HCREATEORGID = list[0].HUSEORGID;
+                //
+                oBill.oModel.HDeptID = list[0].HDeptID;
+                oBill.oModel.HBeginTimes = list[0].HBeginTimes;
+                oBill.oModel.HEndTimes = list[0].HEndTimes;
+                oBill.oModel.HWorkTimes = list[0].HWorkTimes;
+
+                //妫�鏌ョ埗绾ф槸鍚﹀瓨鍦�
+                string sParent = DBUtility.ClsPub.GetParentCode(list[0].HNumber);
+                if (sParent.Trim() == "")
+                {
+                    oBill.oModel.HParentID = 0;
+                }
+                else
+                {
+                    ds = oCn.RunProcReturn("select * from " + ModRightName + " where HStopflag=0 and HNumber='" + sParent + "' and HItemID<>" + oBill.oModel.HItemID, ModRightName);
+                    if (ds.Tables[0].Rows.Count > 0)
+                    {
+                        oBill.oModel.HParentID = long.Parse(ds.Tables[0].Rows[0]["HItemID"].ToString());
+                    }
+                    else
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "淇濆瓨澶辫触锛佷笂绾т唬鐮佷笉瀛樺湪鎴栬绂佺敤锛�";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                }
+                //淇濆瓨鍘熶唬鐮�
+
+                DataSet dsOldNumber = oCn.RunProcReturn("select * from " + ModRightName + " where HItemID='" + oBill.oModel.HItemID + "'", ModRightName);
+                if (dsOldNumber.Tables[0].Rows.Count > 0)
+                {
+                    oBill.HOldNumber = DBUtility.ClsPub.isStrNull(dsOldNumber.Tables[0].Rows[0]["HNumber"]);
+                    //鏄惁鏂颁唬鐮佹槸鑷繁瀛愰」鐩殑銆�瀛愰」鐩�
+                    if (sParent.Length >= oBill.HOldNumber.Length)
+                    {
+                        if (sParent.Substring(0, oBill.HOldNumber.ToString().Length) == oBill.HOldNumber.Trim())
+                        {
+                            objJsonResult.code = "0";
+                            objJsonResult.count = 0;
+                            objJsonResult.Message = "鏂颁唬鐮佷笉鑳芥槸鑷繁鐨勪笅绾х殑瀛愰」鐩紒";
+                            objJsonResult.data = null;
+                            return objJsonResult;
+                        }
+                    }
+                }
+                else
+                {
+                    oBill.HOldNumber = "";
+                }
+
+                //淇濆瓨鍓嶅垽鏂�
+                //瀹℃牳浠g爜鏄惁鍚堢悊
+                if (!DBUtility.ClsPub.AllowNumber(oBill.oModel.HNumber))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "浠g爜涓笉鑳藉嚭鐜拌繛缁��.鈥欏苟涓旈浣嶆湯浣嶄笉鑳戒负鈥�.鈥欙紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                //鏄惁閲嶅浠g爜
+                if (oBill.HavSameNumber(oBill.oModel.HItemID, oBill.oModel.HNumber))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "浠g爜閲嶅锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                //淇濆瓨
+                if (OperationType == "1")
+                {
+                    //鏂板
+                    if (oBill.AddNew())
+                    {
+                        objJsonResult.code = "1";
+                        objJsonResult.count = 1;
+                        objJsonResult.Message = "鏂板鎴愬姛锛�";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    else
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鏂板澶辫触锛�";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                }
+                else
+                {
+                    if(oBill.oModel.HCheckEmp!="")
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鍗曟嵁宸插鏍革紝涓嶅厑璁镐慨鏀癸紒";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    //淇敼
+                    if (oBill.ModifyByID(oBill.oModel.HItemID))
+                    {
+                        objJsonResult.code = "1";
+                        objJsonResult.count = 1;
+                        objJsonResult.Message = "淇敼鎴愬姛锛�";
+                        objJsonResult.data = null;
+                        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 = "淇濆瓨澶辫触锛�" + e.Message;
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+
+        #endregion
+
+        #region 鏄剧ず鐝淇℃伅
+        /// <summary>
+        /// 鏍规嵁鍩虹璧勬枡ID 鏌ユ壘璁板綍
+        /// </summary>
+        [Route("Gy_ShiftsController/GetGy_Shifts_Json")]
+        [HttpGet]
+        public object GetGy_Shifts_Json(Int64 HItemID)
+        {
+            try
+            {
+                ds = oCn.RunProcReturn("select * from h_v_Gy_ShiftsListDetail where HItemID=" + HItemID, "h_v_Gy_ShiftsListDetail");
+                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 e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "杩斿洖鐝淇℃伅澶辫触锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+
+        #endregion
+
+    }
+}
diff --git a/WebAPI/WebAPI.csproj b/WebAPI/WebAPI.csproj
index acce925..c150707 100644
--- a/WebAPI/WebAPI.csproj
+++ b/WebAPI/WebAPI.csproj
@@ -553,6 +553,7 @@
     <Compile Include="Controllers\鍩虹璧勬枡\宸ヨ祫鍩虹璧勬枡\Gy_WorkTypeController.cs" />
     <Compile Include="Controllers\鍩虹璧勬枡\宸ヨ祫鍩虹璧勬枡\Gy_WorkPayTypeController.cs" />
     <Compile Include="Controllers\鍩虹璧勬枡\宸ヨ祫鍩虹璧勬枡\Gy_ClassTimePrjGroupController.cs" />
+    <Compile Include="Controllers\鍩虹璧勬枡\鐢熶骇鍩虹璧勬枡\Gy_ShiftsController.cs" />
     <Compile Include="Controllers\宸ヨ祫绠$悊\HR_EmployeeSkillBillController.cs" />
     <Compile Include="Controllers\宸ヨ祫绠$悊\Pay_OutApplyBillController.cs" />
     <Compile Include="Controllers\宸ヨ祫绠$悊\Pay_OverApplyBillController.cs" />

--
Gitblit v1.9.1