yangle
2022-05-20 01437b53f9b7ef99bb614b6f3df94351ab03acc0
功能完善
4个文件已修改
271 ■■■■ 已修改文件
WebAPI/Controllers/SCGL/日计划管理/JIT_Cg_PODemandPlanBillController.cs 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/SCGL/日计划管理/Sc_JIT_ComplementGoodBillController.cs 189 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/SCGL/日计划管理/Sc_WorkBillSortBillController.cs 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/SCGL/日计划管理/Sc_WorkDemandPlanBillController.cs 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/SCGL/Èռƻ®¹ÜÀí/JIT_Cg_PODemandPlanBillController.cs
@@ -86,10 +86,8 @@
            string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
            string msg2 = sArray[0].ToString();
            string msg3 = sArray[1].ToString();
            int hentryid = int.Parse(sArray[2].ToString());//子表的顺序id
            int OperationType = int.Parse(sArray[3].ToString());//数据类型 1添加 3修改
            string user = sArray[4].ToString();
            int OperationType = int.Parse(sArray[2].ToString());//数据类型 1添加 3修改
            string user = sArray[3].ToString();
            try
            {
                if (!DBUtility.ClsPub.Security_Log("Cg_PODemandPlanBill_Edit", 1, false, user))
@@ -103,7 +101,11 @@
                omdelMian = Newtonsoft.Json.JsonConvert.DeserializeObject<JIT_Cg_PODemandPlanBillMain>(msg2);
                string BillType = "4608";
                ds = ds = oCN.RunProcReturn($"select * from  h_v_JIT_Cg_PODemandPlanBillList where hmainid={omdelMian.HInterID} and  å•据号='{omdelMian.HBillNo}'", "h_v_JIT_Cg_PODemandPlanBillList");
                if (ds.Tables[0].Rows.Count > 0)
                {
                    OperationType = 3;
                }
                if (OperationType == 1)//新增
                {
@@ -126,7 +128,7 @@
                                $",HRemark='{omdelMian.HRemark}',HExplanation='{omdelMian.HExplanation}' where HInterID={omdelMian.HInterID}");
                }
                //保存子表
                objJsonResult = AddBillSub(msg3, hentryid);
                objJsonResult = AddBillSub(msg3);
                if (objJsonResult.code == "0")
                {
                    objJsonResult.code = "0";
@@ -152,16 +154,10 @@
            }
        }
        public json AddBillSub(string msg3, int hentryid)
        public json AddBillSub(string msg3)
        {
            if (hentryid != -1)
            {
                //获取表格数据
                ds = oCN.RunProcReturn($"select * from  h_v_JIT_Cg_PODemandPlanBillList where å•据号='{omdelMian.HBillNo}'", "h_v_JIT_Cg_PODemandPlanBillList");
                //删除子表
                oCN.RunProc("delete from JIT_Cg_PODemandPlanBillSub where HInterID='" + omdelMian.HInterID.ToString() + "' and HEntryID='" + hentryid + "'");
            }
            //删除子表
            oCN.RunProc("delete from JIT_Cg_PODemandPlanBillSub where HInterID='" + omdelMian.HInterID.ToString() + "'");
            omodelsub = Newtonsoft.Json.JsonConvert.DeserializeObject<List<JIT_Cg_PODemandPlanBillSub>>(msg3);
            int i = 1;
@@ -177,7 +173,7 @@
                            ", HCloseMan, HEntryCloseDate, HSendQty, HReciveQty, HCloseStatus" +
                            ", HRemoveQty, HSeOrderBillNo, HUnReciveQty, HPOOrderBillDate, HPOOrderBillDeliveryDate" +
                            ", HPOOrderBillRemark, HPOOrderBillNote)" +
                            $"values({omdelMian.HInterID}, {(hentryid == -1 ? i : omodelsub.Count == 1 ? hentryid : i == 1 ? hentryid : (i + ds.Tables[0].Rows.Count - 1))}, '{oSub.HLaterReason}', {(oSub.HMaterID == null ? 0 : oSub.HMaterID)}, '{oSub.HMaterName}'" +
                            $"values({omdelMian.HInterID}, {i}, '{oSub.HLaterReason}', {(oSub.HMaterID == null ? 0 : oSub.HMaterID)}, '{oSub.HMaterName}'" +
                            $", '{oSub.HMaterModel}', {(oSub.HUnitID == null ? 0 : oSub.HUnitID)}, '{oSub.HErpClsID}', {(oSub.HQty == null ? 0 : oSub.HQty)}, '{oSub.HRemark}'" +
                            $", {(oSub.HPURCHASEORGID == null ? 0 : oSub.HPURCHASEORGID)}, '{oSub.HStatus}', {(oSub.HFixleadTime == null ? 0 : oSub.HFixleadTime)}, '{oSub.HDayPlanBillNo}', {oSub.HSourceInterID}" +
                            $", {oSub.HSourceEntryID}, '{oSub.HSourceBillNo}', '{oSub.HSourceBillType}', {(oSub.HWorkShopID == null ? 0 : oSub.HWorkShopID)}, '{oSub.HDayPlanDate}'" +
WebAPI/Controllers/SCGL/Èռƻ®¹ÜÀí/Sc_JIT_ComplementGoodBillController.cs
@@ -91,9 +91,8 @@
            string msg2 = sArray[0].ToString();
            string msg3 = sArray[1].ToString();
            int hentryid = int.Parse(sArray[2].ToString());//子表的顺序id
            int OperationType = int.Parse(sArray[3].ToString());//数据类型 1添加 3修改
            string user = sArray[4].ToString();
            int OperationType = int.Parse(sArray[2].ToString());//数据类型 1添加 3修改
            string user = sArray[3].ToString();
            try
            {
                if (!DBUtility.ClsPub.Security_Log("JIT_ComplementGoodBill_Edit", 1, false, user))
@@ -106,8 +105,23 @@
                }
                omdelMian = Newtonsoft.Json.JsonConvert.DeserializeObject<ClsXt_BaseBillMain>(msg2);
                if (omdelMian.HPRDORGID.ToString() == "")
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "组织不能为空";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                string BillType = "4612";
                ds = ds = oCN.RunProcReturn($"select * from  h_v_JIT_Gy_WorkWarehouseBillList where hmainid={omdelMian.HInterID} and  å•据号='{omdelMian.HBillNo}'", "h_v_JIT_Gy_WorkWarehouseBillList");
                if (ds.Tables[0].Rows.Count > 0)
                {
                    OperationType = 3;
                }
                if (OperationType == 1)//新增
                {
@@ -123,12 +137,9 @@
                ",HUpDater='" + omdelMian.HMaker + "'" +
                ",HUpDateDate='" + DateTime.Now+ "'" +
                " where HInterID=" + omdelMian.HInterID.ToString());
                    //删除子表
                    oCN.RunProc("delete from Gy_WorkWarehouseBillMainSub where HInterID='" + omdelMian.HInterID.ToString() + "' and HEntryID='" + hentryid + "'");
                }
                //保存子表
                objJsonResult = AddBillSub(msg3, hentryid);
                objJsonResult = AddBillSub(msg3);
                if (objJsonResult.code == "0")
                {
                    objJsonResult.code = "0";
@@ -154,9 +165,33 @@
            }
        }
        public json AddBillSub(string msg3, int hentryid)
        public json AddBillSub(string msg3)
        {
            omodelsub = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Gy_WorkWarehouseBillMainSub>>(msg3);
            foreach (Models.Gy_WorkWarehouseBillMainSub oSub in omodelsub)
            {
                if (oSub.HWorkShopID == 0 || oSub.HWorkShopID ==null)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "生产车间不能为空";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (oSub.HWHID == 0|| oSub.HWHID == null)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "仓库不能为空";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
            }
            //删除子表
            oCN.RunProc("delete from Gy_WorkWarehouseBillMainSub where HInterID='" + omdelMian.HInterID.ToString() + "'");
            int i = 1;
            //插入子表
            foreach (Models.Gy_WorkWarehouseBillMainSub oSub in omodelsub)
@@ -164,7 +199,7 @@
                oCN.RunProc("insert into Gy_WorkWarehouseBillMainSub(HInterID,HEntryID,HRemark,HWorkShopID," +
                    "HWorkShopName,HWHID,HWHName) " +
                   "values("
                   + omdelMian.HInterID.ToString() + "," + (hentryid == -1 ? i : hentryid) + ",'" + oSub.HRemark + "'," + (oSub.HWorkShopID==null?0:oSub.HWorkShopID)
                   + omdelMian.HInterID.ToString() + "," + i + ",'" + oSub.HRemark + "'," + (oSub.HWorkShopID==null?0:oSub.HWorkShopID)
                   + ",'" +oSub.HWorkShopName + "'," + (oSub.HWHID==null?0: oSub.HWHID) + ",'" + oSub.HWHName.ToString()+ "') ");
                i++;
            }
@@ -316,9 +351,8 @@
            string msg2 = sArray[0].ToString();//主表数据
            string msg3 = sArray[1].ToString();//子表数据
            int hentryid = int.Parse(sArray[2].ToString());//子表的顺序id
            int OperationType = int.Parse(sArray[3].ToString());//数据类型 1添加 3修改
            string user = sArray[4].ToString();
            int OperationType = int.Parse(sArray[2].ToString());//数据类型 1添加 3修改
            string user = sArray[3].ToString();
            try
            {
                if (!DBUtility.ClsPub.Security_Log("Cg_PODemandPlanConfigBill_Edit", 1, false, user))
@@ -333,6 +367,11 @@
                omdelMian = Newtonsoft.Json.JsonConvert.DeserializeObject<ClsXt_BaseBillMain>(msg2);
                string BillType = "4611";
                ds = ds = oCN.RunProcReturn($"select * from  h_v_JIT_Cg_PODemandPlanConfigBillList where hmainid={omdelMian.HInterID} and  å•据号='{omdelMian.HBillNo}'", "h_v_JIT_Cg_PODemandPlanConfigBillList");
                if (ds.Tables[0].Rows.Count > 0)
                {
                    OperationType = 3;
                }
                if (OperationType == 1)//新增
                {
@@ -348,12 +387,9 @@
                ",HUpDater='" + omdelMian.HMaker + "'" +
                ",HUpDateDate='" + DateTime.Now + "'" +
                " where HInterID=" + omdelMian.HInterID.ToString());
                    //删除子表
                    oCN.RunProc("delete from Cg_PODemandPlanConfigBillSub where HInterID='" + omdelMian.HInterID.ToString() + "' and HEntryID='" + hentryid + "'");
                }
                //保存子表
                objJsonResult = AddPODBillSub(msg3, hentryid);
                objJsonResult = AddPODBillSub(msg3);
                if (objJsonResult.code == "0")
                {
                    objJsonResult.code = "0";
@@ -379,9 +415,58 @@
            }
        }
        public json AddPODBillSub(string msg3, int hentryid)
        public json AddPODBillSub(string msg3)
        {
            omodelPODsub = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Cg_PODemandPlanConfigBillSub>>(msg3);
            foreach (Models.Cg_PODemandPlanConfigBillSub oSub in omodelPODsub)
            {
                if (oSub.HSupplierID == 0 || oSub.HSupplierID == null)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "供应商不能为空";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (oSub.HMaterID == 0 || oSub.HMaterID == null)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "物料不能为空";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (oSub.HLeadTime == 0 || oSub.HLeadTime == null)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = " JIT供货提前期不能为空";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (oSub.HLeadTime_Sec == 0 || oSub.HLeadTime_Sec == null)
                {
                    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;
                }
            }
            //删除子表
            oCN.RunProc("delete from Cg_PODemandPlanConfigBillSub where HInterID='" + omdelMian.HInterID.ToString() + "'");
            int i = 1;
            //插入子表
            foreach (Models.Cg_PODemandPlanConfigBillSub oSub in omodelPODsub)
@@ -389,7 +474,7 @@
                oCN.RunProc("insert into Cg_PODemandPlanConfigBillSub(HInterID,HEntryID,HRemark,HSupplierID,HSupplierName,HMaterID," +
                    "HMaterName, HMaterModel, HJITMaterGroup, HJITSafeStock, HJITMaterDemand, HJITBatchQty, HDeliveryPeriod, " +
                    "HLeadTime, HLeadTime_Sec, HDeliveryMode, HDeliveryDaysCtrl)values" +
                    $"({omdelMian.HInterID}, {(hentryid == -1 ? i : hentryid) }, '{oSub.HRemark}', {(oSub.HSupplierID==null?0: oSub.HSupplierID)}, '{oSub.HSupplierName}', {(oSub.HMaterID == null ? 0 : oSub.HMaterID)}," +
                    $"({omdelMian.HInterID}, {i}, '{oSub.HRemark}', {(oSub.HSupplierID==null?0: oSub.HSupplierID)}, '{oSub.HSupplierName}', {(oSub.HMaterID == null ? 0 : oSub.HMaterID)}," +
                    $" '{oSub.HMaterName}', '{oSub.HMaterModel}', '{oSub.HJITMaterGroup}', {(oSub.HJITSafeStock == null ? 0 : oSub.HJITSafeStock)}, {(oSub.HJITMaterDemand == null ? 0 : oSub.HJITMaterDemand)},{(oSub.HJITBatchQty == null ? 0 : oSub.HJITBatchQty)},{(oSub.HDeliveryPeriod == null ? 0 : oSub.HDeliveryPeriod)}," +
                    $" {(oSub.HLeadTime == null ? 0 : oSub.HLeadTime)}, {(oSub.HLeadTime_Sec == null ? 0 : oSub.HLeadTime_Sec)}, '{oSub.HDeliveryMode}', {(oSub.HDeliveryDaysCtrl == null ? 0 : oSub.HDeliveryDaysCtrl)}) ");
                i++;
@@ -542,9 +627,8 @@
            string msg2 = sArray[0].ToString();//主表数据
            string msg3 = sArray[1].ToString();//子表数据
            int hentryid = int.Parse(sArray[2].ToString());//子表的顺序id
            int OperationType = int.Parse(sArray[3].ToString());//数据类型 1添加 3修改
            string user = sArray[4].ToString();
            int OperationType = int.Parse(sArray[2].ToString());//数据类型 1添加 3修改
            string user = sArray[3].ToString();
            try
            {
                if (!DBUtility.ClsPub.Security_Log("JIT_NeedMaterPlanConfigBill_Edit", 1, false, user))
@@ -558,6 +642,12 @@
                omdelMian = Newtonsoft.Json.JsonConvert.DeserializeObject<ClsXt_BaseBillMain>(msg2);
                string BillType = "4615";
                ds = ds = oCN.RunProcReturn($"select * from  h_v_JIT_NeedMaterPlanConfigBillList where hmainid={omdelMian.HInterID} and  å•据号='{omdelMian.HBillNo}'", "h_v_JIT_NeedMaterPlanConfigBillList");
                if (ds.Tables[0].Rows.Count > 0)
                {
                    OperationType = 3;
                }
                if (OperationType == 1)//新增
@@ -575,12 +665,9 @@
                ",HUpDater='" + omdelMian.HMaker + "'" +
                ",HUpDateDate='" + DateTime.Now + "'" +
                " where HInterID=" + omdelMian.HInterID.ToString());
                    //删除子表
                    oCN.RunProc("delete from JIT_NeedMaterPlanConfigBillSub where HInterID='" + omdelMian.HInterID.ToString() + "' and HEntryID='" + hentryid + "'");
                }
                //保存子表
                objJsonResult = AddNeedBillSub(msg3, hentryid);
                objJsonResult = AddNeedBillSub(msg3);
                if (objJsonResult.code == "0")
                {
                    objJsonResult.code = "0";
@@ -606,9 +693,57 @@
            }
        }
        public json AddNeedBillSub(string msg3, int hentryid)
        public json AddNeedBillSub(string msg3)
        {
            omodelNeedsub = Newtonsoft.Json.JsonConvert.DeserializeObject<List<JIT_NeedMaterPlanConfigBillSub>>(msg3);
            foreach (Models.Cg_PODemandPlanConfigBillSub oSub in omodelPODsub)
            {
                if (oSub.HSupplierID == 0 || oSub.HSupplierID == null)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "供应商不能为空";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (oSub.HMaterID == 0 || oSub.HMaterID == null)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "物料不能为空";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (oSub.HLeadTime == 0 || oSub.HLeadTime == null)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = " JIT供货提前期不能为空";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (oSub.HLeadTime_Sec == 0 || oSub.HLeadTime_Sec == null)
                {
                    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;
                }
            }
            //删除子表
            oCN.RunProc("delete from JIT_NeedMaterPlanConfigBillSub where HInterID='" + omdelMian.HInterID.ToString() + "'");
            int i = 1;
            //插入子表
            foreach (Models.JIT_NeedMaterPlanConfigBillSub oSub in omodelNeedsub)
@@ -616,7 +751,7 @@
                oCN.RunProc("insert into JIT_NeedMaterPlanConfigBillSub(HInterID,HEntryID,HRemark,HWorkShopID,HWorkShopName,HMaterID," +
                    "HMaterName, HMaterModel, HJITMaterGroup, HJITSafeStock, HJITMaterDemand, HJITBatchQty, HDeliveryPeriod, " +
                    "HLeadTime, HLeadTime_Sec, HDeliveryMode, HDeliveryDaysCtrl)values" +
                    $"({omdelMian.HInterID}, {(hentryid == -1 ? i : hentryid) }, '{oSub.HRemark}', {(oSub.HWorkShopID == null ? 0 : oSub.HWorkShopID)}, '{oSub.HWorkShopName}', {(oSub.HMaterID == null ? 0 : oSub.HMaterID)}," +
                    $"({omdelMian.HInterID}, {i}, '{oSub.HRemark}', {(oSub.HWorkShopID == null ? 0 : oSub.HWorkShopID)}, '{oSub.HWorkShopName}', {(oSub.HMaterID == null ? 0 : oSub.HMaterID)}," +
                    $" '{oSub.HMaterName}', '{oSub.HMaterModel}', '{oSub.HJITMaterGroup}', {(oSub.HJITSafeStock == null ? 0 : oSub.HJITSafeStock)}, {(oSub.HJITMaterDemand == null ? 0 : oSub.HJITMaterDemand)},{(oSub.HJITBatchQty == null ? 0 : oSub.HJITBatchQty)},{(oSub.HDeliveryPeriod == null ? 0 : oSub.HDeliveryPeriod)}," +
                    $" {(oSub.HLeadTime == null ? 0 : oSub.HLeadTime)}, {(oSub.HLeadTime_Sec == null ? 0 : oSub.HLeadTime_Sec)}, '{oSub.HDeliveryMode}', {(oSub.HDeliveryDaysCtrl == null ? 0 : oSub.HDeliveryDaysCtrl)}) ");
                i++;
WebAPI/Controllers/SCGL/Èռƻ®¹ÜÀí/Sc_WorkBillSortBillController.cs
@@ -35,7 +35,7 @@
                    return objJsonResult;
                }
                ds = oCN.RunProcReturn("select * from  h_v_JIT_Sc_WorkBillSortBillList where 1=1" + sWhere + "order by hmainid desc ", "h_v_JIT_Sc_WorkBillSortBillList");
                ds = oCN.RunProcReturn("select * from  h_v_JIT_Sc_WorkBillSortBillList where 1=1" + sWhere + "order by å•据号 desc ", "h_v_JIT_Sc_WorkBillSortBillList");
                objJsonResult.code = "1";
                objJsonResult.count = 1;
@@ -87,9 +87,8 @@
            string msg2 = sArray[0].ToString();
            string msg3 = sArray[1].ToString();
            int hentryid = int.Parse(sArray[2].ToString());//子表的顺序id
            int OperationType = int.Parse(sArray[3].ToString());//数据类型 1添加 3修改
            string user = sArray[4].ToString();
            int OperationType = int.Parse(sArray[2].ToString());//数据类型 1添加 3修改
            string user = sArray[3].ToString();
            try
            {
                if (!DBUtility.ClsPub.Security_Log("Sc_WorkBillSortBill_Edit", 1, false, user))
@@ -103,7 +102,11 @@
                omdelMian = Newtonsoft.Json.JsonConvert.DeserializeObject<Sc_WorkBillSortBillMain>(msg2);
                string BillType = "4610";
                ds = ds = oCN.RunProcReturn($"select * from  h_v_JIT_Sc_WorkBillSortBillList where hmainid={omdelMian.HInterID} and  å•据号='{omdelMian.HBillNo}'", "h_v_JIT_Sc_WorkBillSortBillList");
                if (ds.Tables[0].Rows.Count > 0)
                {
                    OperationType = 3;
                }
                if (OperationType == 1)//新增
                {
@@ -168,7 +171,7 @@
                                  $", HHangUp='{(omdelMian.HHangUp == true ? 1 : 0)}' where HInterID={omdelMian.HInterID}");
                }
                //保存子表
                objJsonResult = AddBillSub(msg3, hentryid);
                objJsonResult = AddBillSub(msg3);
                if (objJsonResult.code == "0")
                {
                    objJsonResult.code = "0";
@@ -194,13 +197,10 @@
            }
        }
        public json AddBillSub(string msg3, int hentryid)
        public json AddBillSub(string msg3)
        {
            //获取表格数据
            ds = oCN.RunProcReturn($"select * from  h_v_JIT_Sc_WorkBillSortBillList where å•据号='{omdelMian.HBillNo}'", "h_v_JIT_Sc_WorkBillSortBillList");
            //删除子表
            oCN.RunProc("delete from Sc_WorkBillSortBillSub where HInterID='" + omdelMian.HInterID.ToString() + "' and HEntryID='" + hentryid + "'");
            oCN.RunProc("delete from Sc_WorkBillSortBillSub where HInterID='" + omdelMian.HInterID.ToString() + "'");
            omodelsub = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Sc_WorkBillSortBillSub>>(msg3);
            int i = 1;
@@ -211,7 +211,7 @@
                            ", HRptFinishQty, HTimes, HUseTimes, HBTimes, HETimes" +
                            ", HDateSub, HCloseMan, HEntryCloseDate, HCloseTypeSub, HColumn" +
                            ", HLockedSub, HComplete, HStatusTag, HIsHandModify)" +
                            $"values({omdelMian.HInterID}, {(hentryid == -1 ? i : omodelsub.Count==1? hentryid:i==1? hentryid:(i+ds.Tables[0].Rows.Count-1))}, '{oSub.HRemark}', '{oSub.HMasterDate}', {(oSub.HQty == null ? 0: oSub.HQty)}" +
                            $"values({omdelMian.HInterID}, {i}, '{oSub.HRemark}', '{oSub.HMasterDate}', {(oSub.HQty == null ? 0: oSub.HQty)}" +
                            $", {(oSub.HRptFinishQty == null ? 0: oSub.HRptFinishQty)}, {(oSub.HTimes == null ? 0: oSub.HTimes)}, {(oSub.HUseTimes == null ? 0: oSub.HUseTimes)}, '{oSub.HBTimes}', '{oSub.HETimes}'" +
                            $", '{oSub.HDateSub}', '{oSub.HCloseMan}', '{oSub.HEntryCloseDate}', {(oSub.HCloseTypeSub == true ? 1 : 0)}, '{oSub.HColumn}'" +
                            $", '{(oSub.HLockedSub == true ? 1 : 0)}', '{oSub.HComplete}', '{(oSub.HStatusTag == true ? 1 : 0)}', '{(oSub.HIsHandModify == true ? 1 : 0)}')");
WebAPI/Controllers/SCGL/Èռƻ®¹ÜÀí/Sc_WorkDemandPlanBillController.cs
@@ -87,10 +87,8 @@
            string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
            string msg2 = sArray[0].ToString();
            string msg3 = sArray[1].ToString();
            int hentryid = int.Parse(sArray[2].ToString());//子表的顺序id
            int OperationType = int.Parse(sArray[3].ToString());//数据类型 1添加 3修改
            string user = sArray[4].ToString();
            int OperationType = int.Parse(sArray[2].ToString());//数据类型 1添加 3修改
            string user = sArray[3].ToString();
            try
            {
                if (!DBUtility.ClsPub.Security_Log("Cg_PODemandPlanBill_Edit", 1, false, user))
@@ -104,7 +102,11 @@
                omdelMian = Newtonsoft.Json.JsonConvert.DeserializeObject<Sc_WorkDemandPlanBillMain>(msg2);
                string BillType = "4609";
                ds = ds = oCN.RunProcReturn($"select * from  h_v_JIT_Sc_WorkDemandPlanBillList where hmainid={omdelMian.HInterID} and  å•据号='{omdelMian.HBillNo}'", "h_v_JIT_Sc_WorkDemandPlanBillList");
                if (ds.Tables[0].Rows.Count > 0)
                {
                    OperationType = 3;
                }
                if (OperationType == 1)//新增
                {
@@ -127,7 +129,7 @@
                                $" where HInterID={omdelMian.HInterID}");
                }
                //保存子表
                objJsonResult = AddBillSub(msg3, hentryid);
                objJsonResult = AddBillSub(msg3);
                if (objJsonResult.code == "0")
                {
                    objJsonResult.code = "0";
@@ -153,16 +155,10 @@
            }
        }
        public json AddBillSub(string msg3, int hentryid)
        public json AddBillSub(string msg3)
        {
            if (hentryid != -1)
            {
                //获取表格数据
                ds = oCN.RunProcReturn($"select * from  h_v_JIT_Sc_WorkDemandPlanBillList where å•据号='{omdelMian.HBillNo}'", "h_v_JIT_Sc_WorkDemandPlanBillList");
                //删除子表
                oCN.RunProc("delete from Sc_WorkDemandPlanBillSub where HInterID='" + omdelMian.HInterID.ToString() + "' and HEntryID='" + hentryid + "'");
            }
            //删除子表
            oCN.RunProc("delete from Sc_WorkDemandPlanBillSub where HInterID='" + omdelMian.HInterID.ToString() + "'");
            omodelsub = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Sc_WorkDemandPlanBillSub>>(msg3);
            int i = 1;
@@ -177,7 +173,7 @@
                            ", HEntryCloseDate, HCloseTypeSub, HReciveQty, HCloseStatus, HRemoveQty" +
                            ", HSeOrderBillNo, HUnReciveQty, HICMOBillDate, HICMOBillDeliveryDate, HICMOBillRemark" +
                            ", HICMOBillNote,HICMOEmpID)" +
                            $"values({omdelMian.HInterID}, '{(hentryid == -1 ? i : omodelsub.Count == 1 ? hentryid : i == 1 ? hentryid : (i + ds.Tables[0].Rows.Count - 1))}', '{oSub.HLaterReason}', {(oSub.HMaterID==null?0: oSub.HMaterID)}, '{oSub.HMaterName}'" +
                            $"values({omdelMian.HInterID},'{i}','{oSub.HLaterReason}', {(oSub.HMaterID==null?0: oSub.HMaterID)}, '{oSub.HMaterName}'" +
                            $", '{oSub.HMaterModel}',{(oSub.HUnitID == null ? 0: oSub.HUnitID)}, '{oSub.HErpClsID}',{(oSub.HQty == null ? 0: oSub.HQty)}, '{oSub.HRemark}'" +
                            $",{(oSub.HProdORGID == null ? 0: oSub.HProdORGID)}, '{oSub.HStatus}',{(oSub.HFixleadTime == null ? 0: oSub.HFixleadTime)},{oSub.HSourceInterID}" +
                            $",{oSub.HSourceEntryID}, '{oSub.HSourceBillNo}', '{oSub.HSourceBillType}','{oSub.HDayPlanDate}'" +
@@ -262,7 +258,7 @@
        }
        #endregion
        #region ææ–™è®¡åˆ’单 å…³é—­
        #region è¦æ–™è®¡åˆ’单 å…³é—­
        [Route("Sc_WorkDemandPlanBill/CloseWorkDemandPlanBillList")]
        [HttpGet]
        public object CloseWorkDemandPlanBillList(string HInterID, string User)