1
zrg
2024-11-25 59f31f0caeef6fb37f397646efbcd19738299122
WebAPI/Controllers/LMESController.cs
@@ -1210,7 +1210,7 @@
        #region 工艺路线分页列表
        [Route("Gy_RoutingBill/page")]
        [HttpGet]
        public json Gy_RoutingBillPage(string sWhere, string user, int page, int size)
        public object Gy_RoutingBillPage(string sWhere, string user, int page, int size)
        {
            DataSet ds;
            json res = new json();
@@ -1256,7 +1256,7 @@
                res.count = CountConstant.FAIL;
                res.Message = "Exception!" + e.ToString();
                res.data = null;
                return objJsonResult;
                return res;
            }
        }
        #endregion
@@ -1326,7 +1326,7 @@
                {
                    string sql1 = "select * from h_v_Gy_RoutingBillList where 1 = 1 ";
                    //客户自定义
                    if (oSystemParameter.omodel.WMS_CampanyName == "瑞与祺" || oSystemParameter.omodel.WMS_CampanyName == "凯贝奈特" || oSystemParameter.omodel.WMS_CampanyName == "添康科技")
                    if (oSystemParameter.omodel.WMS_CampanyName == "瑞与祺" || oSystemParameter.omodel.WMS_CampanyName == "凯贝奈特" )
                    {
                         sql1 = "select top 1000 * from h_v_Gy_RoutingBillList where 1 = 1 ";
                    }
@@ -1456,7 +1456,7 @@
                if (oSystemParameter.ShowBill(ref Ret))
                {
                    //判断客户为龙山汽配
                    if (oSystemParameter.omodel.WMS_CampanyName == "龙山汽配")
                    if (oSystemParameter.omodel.WMS_CampanyName == "龙山汽配" || oSystemParameter.omodel.WMS_CampanyName == "添康科技")
                    {
                        //判断是否有查询工价权限
                        if (!DBUtility.ClsPub.Security_Log("Gy_RoutingBill_CheckProcPrice", 1, false, UserName))
@@ -1599,6 +1599,18 @@
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据已经审核,不能删除!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                DataSet dss;
                //判断工艺路线是否被引用
                dss = oCN.RunProcReturn("select COUNT(*) as number from Sc_ProcessExchangeBillMain where HRoutingBillID = " + lngBillKey, "Gy_RoutingBillMain");
                //判断是否可编辑
                if (dss.Tables[0].Rows[0]["number"].ToString() != "0")
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "此单据已经被引用,不允许删除!";
                    objJsonResult.data = 1;
                    return objJsonResult;
                }
                //if (hdeleteman != "")
@@ -3547,7 +3559,23 @@
                        return objJsonResult;
                    }
                }
                //获取系统参数判断工艺路线是否启用多级审批禁用普通审批
                Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
                string sReturn = "";
                if (oSystemParameter.ShowBill(ref sReturn) == true)
                {
                    if (oSystemParameter.omodel.Gy_RoutingBill_EnableMultiLevel.ToUpper() == "Y") //系统参数  启用自动审核
                    {
                        objJsonResult.code = CodeConstant.FAIL;
                        objJsonResult.count = CountConstant.FAIL;
                        objJsonResult.Message = "工艺路线已启用多级审批普通审核禁用";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                if (string.IsNullOrWhiteSpace(HInterID))
                {
@@ -3583,9 +3611,18 @@
                    //审核工艺路线
                    oCN.RunProc(" Update Gy_RoutingBillMain set HChecker='" + user + "',HCheckDate=getdate(),HBillStatus=2 Where HInterID=" + HInterID.ToString());
                    ////刷新默认工艺路线
                    //oCN.RunProc("exec h_p_Gy_RoutingBillCheck " + HInterID);
                    //获取系统参数
                    string Ret = "";
                    if (oSystemParameter.ShowBill(ref Ret))
                    {
                        //判断客户
                        if (oSystemParameter.omodel.WMS_CampanyName == "添康科技") //系统参数
                        {
                            //刷新默认工艺路线
                            oCN.RunProc("exec h_p_Gy_RoutingBillCheck " + HInterID + ",'" + user + "'");
                        }
                    }
                    ////审核单据
                    //if (!BillOld.CheckBill(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo))
@@ -3751,6 +3788,17 @@
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //获取系统参数设置失效时间
                    string Ret = "";
                    if (oSystemParameter.ShowBill(ref Ret))
                    {
                        //判断客户
                        if (oSystemParameter.omodel.WMS_CampanyName == "添康科技") //系统参数
                        {
                            //刷新失效时间
                            oCN.RunProc("update Gy_RoutingBillMain set HEndDate = CONVERT(date, DATEADD(day, -1, GETDATE())) where HInterID = " + HInterID);
                        }
                    }
                }
                else
                {