duhe
2025-04-15 d03c33eeebd11111ee6c116b35ccf8cd7372de8d
WebAPI/Controllers/SCGL/Èռƻ®¹ÜÀí/Sc_JIT_ComplementGoodBillController.cs
@@ -467,7 +467,7 @@
                    return objJsonResult;
                }
                if (oSystemParameter.omodel.WMS_CampanyName != "帅威")
                if (oSystemParameter.omodel.WMS_CampanyName != "帅威"&& oSystemParameter.omodel.WMS_CampanyName != "宝工" && oSystemParameter.omodel.WMS_CampanyName != "三升")
                {
                    if (oSub.HLeadTime_Sec == 0 || oSub.HLeadTime_Sec == null)
                    {
@@ -807,66 +807,82 @@
                            tb2.Rows[i]["HUnitID"] = ds.Tables[0].Rows[0]["HItemID"].ToString();
                        }
                        //JIT物料分类
                        if (JITType == "")
                        string msg = "";
                        oSystemParameter.ShowBill(ref msg);
                        if (oSystemParameter.omodel.WMS_CampanyName == "宝工")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "第" + index + "行,JIT物料分类为空!";
                            objJsonResult.data = null;
                            return objJsonResult;
                            //JIT供货提前期(天)
                            if (JISLT == "")
                            {
                                objJsonResult.code = "0";
                                objJsonResult.count = 0;
                                objJsonResult.Message = "第" + index + "行,JIT供货提前期(天)为空!";
                                objJsonResult.data = null;
                                return objJsonResult;
                            }
                        }
                        //JIT提货经济批量
                        if (JIPEB == "")
                        else
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "第" + index + "行,JIT提货经济批量为空!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                            //JIT物料分类
                            if (JITType == "")
                            {
                                objJsonResult.code = "0";
                                objJsonResult.count = 0;
                                objJsonResult.Message = "第" + index + "行,JIT物料分类为空!";
                                objJsonResult.data = null;
                                return objJsonResult;
                            }
                        //JIT供货提前期(天)
                        if (JISLT == "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "第" + index + "行,JIT供货提前期(天)为空!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                            //JIT提货经济批量
                            if (JIPEB == "")
                            {
                                objJsonResult.code = "0";
                                objJsonResult.count = 0;
                                objJsonResult.Message = "第" + index + "行,JIT提货经济批量为空!";
                                objJsonResult.data = null;
                                return objJsonResult;
                            }
                        //JIT到货前置期(天)
                        if (JIDLT == "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "第" + index + "行,JIT到货前置期(天)为空!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                            //JIT供货提前期(天)
                            if (JISLT == "")
                            {
                                objJsonResult.code = "0";
                                objJsonResult.count = 0;
                                objJsonResult.Message = "第" + index + "行,JIT供货提前期(天)为空!";
                                objJsonResult.data = null;
                                return objJsonResult;
                            }
                        //JIT最小起送量
                        if (JIMLC == "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "第" + index + "行,JIT最小起送量为空!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                            //JIT到货前置期(天)
                            if (JIDLT == "")
                            {
                                objJsonResult.code = "0";
                                objJsonResult.count = 0;
                                objJsonResult.Message = "第" + index + "行,JIT到货前置期(天)为空!";
                                objJsonResult.data = null;
                                return objJsonResult;
                            }
                        //审核代码是否合理
                        if (!DBUtility.ClsPub.AllowNumber(HMaterNumer))
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "第" + index + "行,物料代码中不能出现连续‘.’并且首位末位不能为‘.’!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                            //JIT最小起送量
                            if (JIMLC == "")
                            {
                                objJsonResult.code = "0";
                                objJsonResult.count = 0;
                                objJsonResult.Message = "第" + index + "行,JIT最小起送量为空!";
                                objJsonResult.data = null;
                                return objJsonResult;
                            }
                            //审核代码是否合理
                            if (!DBUtility.ClsPub.AllowNumber(HMaterNumer))
                            {
                                objJsonResult.code = "0";
                                objJsonResult.count = 0;
                                objJsonResult.Message = "第" + index + "行,物料代码中不能出现连续‘.’并且首位末位不能为‘.’!";
                                objJsonResult.data = null;
                                return objJsonResult;
                            }
                        }
                    }
                    else
                    {
@@ -967,7 +983,7 @@
                       "HLeadTime, HLeadTime_Sec, HDeliveryMode, HDeliveryDaysCtrl,HUnitID,HJITMinDeliveryQty)values" +
                       $"({HInterID}, 1, '{HRemark}', {(HSupID == "" ? "0" : HSupID)}, '{HSupplierName}', {(HMaterID == "" ? "0" : HMaterID)}," +
                       $" '{HMaterName}', '{HMaterModel}', '{JITType}', {(JITPSL == "" ? "0" : JITPSL)}, {(JITMDSC == "" ? "0" : JITMDSC)},{(JIPEB == "" ? "0" : JIPEB)},{(JITPBCC == "" ? "0" : JITPBCC)}," +
                       $" {(JISLT == "" ? "0" : JISLT)}, {(JIDLT == "" ? "0" : JIDLT)}, '', {(JITDCD == "" ? "0" : JITDCD)} ,{HUnitID},{JIMLC})";
                       $" {(JISLT == "" ? "0" : JISLT)}, {(JIDLT == "" ? "0" : JIDLT)}, '', {(JITDCD == "" ? "0" : JITDCD)} ,{HUnitID},{(JIMLC==""?"0": JIMLC)})";
                        //主表
                        oCN.RunProc(sql);
                        //子表
@@ -1142,8 +1158,9 @@
        public json AddNeedBillSub(string msg3)
        {
            string Ret = "";
            omodelNeedsub = Newtonsoft.Json.JsonConvert.DeserializeObject<List<JIT_NeedMaterPlanConfigBillSub>>(msg3);
            oSystemParameter.ShowBill(ref Ret);
            foreach (Models.JIT_NeedMaterPlanConfigBillSub oSub in omodelNeedsub)
            {
                if (oSub.HWorkShopID == 0 || oSub.HWorkShopID == null)
@@ -1178,14 +1195,18 @@
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (oSub.HDeliveryDaysCtrl == 0 || oSub.HDeliveryDaysCtrl == null)
                if (oSystemParameter.omodel.WMS_CampanyName != "宝工"&& oSystemParameter.omodel.WMS_CampanyName != "三升")
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = " JIT送货控制天数不能为空";
                    objJsonResult.data = null;
                    return objJsonResult;
                    if (oSub.HDeliveryDaysCtrl == 0 || oSub.HDeliveryDaysCtrl == null)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = " JIT送货控制天数不能为空";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
            }
            //删除子表