WebAPI/Controllers/SCGL/Sc_MESStopWorkBillController.cs
@@ -18,6 +18,9 @@
        private json objJsonResult = new json();
        SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
        DataSet ds;
        //获取系统参数
        Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
        Pub_Class.ClsXt_SystemParameterMain oSystemParameterMain = new Pub_Class.ClsXt_SystemParameterMain();
        #region 停工单
@@ -185,14 +188,14 @@
        public object DeltetMESStopWorkBill(string HInterID)
        {
            //编辑权限
            //if (!DBUtility.ClsPub.Security_Log("Sc_MESStopWorkBill_Delete", 1, true, DBUtility.ClsPub.CurUserName))
            //{
            //    objJsonResult.code = "0";
            //    objJsonResult.count = 0;
            //    objJsonResult.Message = "无删除权限!";
            //    objJsonResult.data = null;
            //    return objJsonResult;
            //}
            if (!DBUtility.ClsPub.Security_Log("MES_MESStopWorkBill_Delete", 1, true, DBUtility.ClsPub.CurUserName))
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "无删除权限!";
                objJsonResult.data = null;
                return objJsonResult;
            }
            Int64 lngBillKey = 0;
@@ -409,6 +412,28 @@
        [HttpPost]
        public object SaveGetMESStopFrom([FromBody] JObject msg)
        {
            //保存权限
            if (!DBUtility.ClsPub.Security_Log("MES_MESStopWorkBill_Edit", 1, true, DBUtility.ClsPub.CurUserName))
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "无保存权限!";
                objJsonResult.data = null;
                return objJsonResult;
            }
            //判断会计期是否合理
            string s = "";
            int sYear = 0;
            int sPeriod = 0;
            if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(DateTime.Now, ref sYear, ref sPeriod, ref s) == false)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = s;
                objJsonResult.data = null;
                return objJsonResult;
            }
            var _value = msg["msg"].ToString();
            string msg1 = _value.ToString();
            string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
@@ -428,6 +453,7 @@
                foreach (Models.ClsSc_MESStopWorkBillMain oItem in lsmain)
                {
                    //oItem.HMaker = "";
                    DBUtility.ClsPub.CurUserName = oItem.HMaker;
                    UserName = oItem.HMaker;  //制单人
                    oItem.HBillType = "3789";
                    oItem.HBillSubType = "3789";
@@ -452,12 +478,29 @@
                bool bResult;
                if (oBill.omodel.HInterID == 0)
                {
                    // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
                    bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
                    if (bResult)
                    {
                        objJsonResult.HInterID = DBUtility.ClsPub.sExeReturnInfo; //返回主ID
                        //系统参数  自动审核
                        string sReturn = "";
                        if (oSystemParameter.ShowBill(ref sReturn) == true)
                        {
                            if (oSystemParameterMain.Sc_MESStopWorkBill_AutoCheck == "Y") //系统参数  自动审核
                            {
                                objJsonResult.Verify = "Y";
                            }
                            else
                            {
                                objJsonResult.Verify = "N";
                            }
                        }
                    }
                }
                else
                {
                    bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
                    objJsonResult.Verify = "N";
                }
                if (bResult)
                {