1
duhe
2024-12-18 ba76af92c90c52823b8140ac3be26fbf69d467bd
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();
@@ -1218,14 +1218,14 @@
            {
                List<object> columnNameList = new List<object>();
                //编辑权限
                if (!DBUtility.ClsPub.Security_Log_second("Gy_RoutingBill_Query", 1, false, user))
                {
                    res.code = "0";
                    res.count = 0;
                    res.Message = "无查看权限!";
                    res.data = null;
                    return res;
                }
                //if (!DBUtility.ClsPub.Security_Log_second("Gy_RoutingBill_Query", 1, false, user))
                //{
                //    res.code = "0";
                //    res.count = 0;
                //    res.Message = "无查看权限!";
                //    res.data = null;
                //    return res;
                //}
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("exec h_p_Gy_RoutingBillList " + page + "," + size + ",''", "h_p_Gy_RoutingBillList");
@@ -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 ";
                    }
@@ -1598,6 +1598,16 @@
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据已经审核,不能删除!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                string HBillStatus = Convert.ToString(ds.Tables[0].Rows[0]["HBillStatus"]);
                //string hdeleteman = Convert.ToString(ds.Tables[0].Rows[0]["hdeleteman"]);
                if (HBillStatus == "6")
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据在审核中,不能删除!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
@@ -3559,7 +3569,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))
                {
@@ -3604,7 +3630,7 @@
                        if (oSystemParameter.omodel.WMS_CampanyName == "添康科技") //系统参数                      
                        {
                            //刷新默认工艺路线
                            oCN.RunProc("exec h_p_Gy_RoutingBillCheck " + HInterID);
                            oCN.RunProc("exec h_p_Gy_RoutingBillCheck " + HInterID + ",'" + user + "'");
                        }
                    }                 
@@ -3763,6 +3789,16 @@
                            return objJsonResult;
                        }
                    }
                    string HBillStatus = Convert.ToString(ds.Tables[0].Rows[0]["HBillStatus"]);
                    //string hdeleteman = Convert.ToString(ds.Tables[0].Rows[0]["hdeleteman"]);
                    if (HBillStatus == "6")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "单据在审核中,不能关闭!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //关闭单据
                    if (!BillOld.CloseBill(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo))
                    {
@@ -3771,6 +3807,17 @@
                        objJsonResult.Message = "关闭失败!原因:" + ClsPub.sExeReturnInfo;
                        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
@@ -3790,6 +3837,16 @@
                            return objJsonResult;
                        }
                    }
                    string HBillStatus = Convert.ToString(ds.Tables[0].Rows[0]["HBillStatus"]);
                    //string hdeleteman = Convert.ToString(ds.Tables[0].Rows[0]["hdeleteman"]);
                    if (HBillStatus == "6")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "单据在审核中,不能反关闭!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //反关闭单据
                    if (!BillOld.CancelClose(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo))
                    {