ch
2022-11-15 3e7e7c306659ed86e091ea89b626359125362908
WebAPI/Controllers/JHGL/Gy_RoutingBillController.cs
@@ -170,9 +170,22 @@
                string HProductNum = mainList[0].HProductNum;//成品编号
                string HVerNum = mainList[0].HVerNum;//版本
                if (OperationType == 2)
                {
                    ds = oCN.RunProcReturn("select * from h_v_Gy_RoutingBillList where  单据号='" + HBillNo + "'", "h_v_Gy_RoutingBillList");
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "单据号重复,请重新输入!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                ds = oCN.RunProcReturn("select * from h_v_Gy_RoutingBillList where hmainid=" + HInterID + " and 单据号='" + HBillNo + "'", "h_v_Gy_RoutingBillList");
                if (OperationType == 1 && ds.Tables[0].Rows.Count == 0)//新增
                if ((OperationType == 1 || OperationType == 2) && ds.Tables[0].Rows.Count == 0)//新增
                {
                    //主表
                    oCN.RunProc("Insert Into Gy_RoutingBillMain   " +
@@ -205,7 +218,7 @@
                    oCN.RunProc("delete from Gy_RoutingBillSub where HInterID='" + HInterID+ "' and HProcNo!='9999'");
                }
                //保存子表
                objJsonResult = AddBillSub(msg3, HInterID);
                objJsonResult = AddBillSub(msg3, HInterID, OperationType);
                if (objJsonResult.code == "0")
                {
                    objJsonResult.code = "0";
@@ -257,7 +270,7 @@
            }
        }
        public json AddBillSub(string msg3, long HInterID)
        public json AddBillSub(string msg3, long HInterID,int OperationType)
        {
            List<Gy_RoutingBillSub> DetailColl = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Gy_RoutingBillSub>>(msg3);
            int i = 0;
@@ -273,7 +286,7 @@
                    return objJsonResult;
                }
                if (oSub.HProcNo!="9999")
                if (oSub.HProcNo != "9999" || OperationType == 2)
                {
                    oCN.RunProc("Insert into Gy_RoutingBillSub " +
                    "(HInterID,HEntryID,HProcID,HProcNO,HSupID,HSupFlag" +