WebAPI/Controllers/SCGL/Sc_MESEndWorkBillController.cs
@@ -15,6 +15,9 @@
        private json objJsonResult = new json();
        public DataSet ds = new DataSet();
        public WebServer webserver = new WebServer();
        //获取系统参数
        Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
        Pub_Class.ClsXt_SystemParameterMain oSystemParameterMain = new Pub_Class.ClsXt_SystemParameterMain();
        #region 完工单
@@ -191,14 +194,14 @@
        public object DeltetMESEndWorkBill(string HInterID)
        {
            //编辑权限
            //if (!DBUtility.ClsPub.Security_Log("Sc_MESEndWorkBill_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_MESEndWorkBill_Delete", 1, true, DBUtility.ClsPub.CurUserName))
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "无删除权限!";
                objJsonResult.data = null;
                return objJsonResult;
            }
            Int64 lngBillKey = 0;
@@ -406,7 +409,7 @@
        #region 报工平台完工单保存/编辑
        /// <summary>
        /// 开工单
        /// 完工单
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
@@ -414,6 +417,28 @@
        [HttpPost]
        public object SaveGetMESEndFrom([FromBody] JObject msg)
        {
            //保存权限
            if (!DBUtility.ClsPub.Security_Log("MES_MESEndWorkBill_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);
@@ -434,6 +459,7 @@
                {
                    //oItem.HMaker = "";
                    UserName = oItem.HMaker;  //制单人
                    DBUtility.ClsPub.CurUserName = oItem.HMaker;
                    oItem.HBillType = "3788";
                    oItem.HBillSubType = "3788";
                    oItem.HReportType = "3";//(1条码扫描,2机器汇报,3手工录入)
@@ -457,12 +483,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_MESEndWorkBill_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)
                {