yxj
2024-09-20 f34c6a21dc58bc0d40a011d6d7366c5eb3f15f15
WebAPI/Controllers/CJGL/Sc_ProcessExchangeBillController.cs
@@ -1065,7 +1065,7 @@
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                string sql = string.Format(@"exec h_p_Sc_GetProcessExchangeBillSubTech ");
                ds = oCN.RunProcReturn(sql +  HInterID, "h_p_Sc_GetProcessExchangeBillSubTech");
                ds = oCN.RunProcReturn(sql + " '" +  HInterID + "'", "h_p_Sc_GetProcessExchangeBillSubTech");
                //添加列名
                foreach (DataColumn col in ds.Tables[0].Columns)
@@ -2083,18 +2083,24 @@
                DateTime dt = DateTime.Now;
                string sql = "";
                Int64 HInterID = 0;
                string HBillNo = "";
                Int64 HICMOInterID = 0;
                Int64 HICMOEntryID = 0;
                string HICMOBillNo = "";
                double HQty = 0;
                double HProQty = 0;
                foreach (Model.ClsSc_ProcessExchangeBillSub_BatchSplit oItemSub in ls)
                {
                    HBillNo = DBUtility.ClsPub.CreateBillCode_Prod("3772", ref DBUtility.ClsPub.sExeReturnInfo, true);
                    //HBillNo = DBUtility.ClsPub.CreateBillCode_Prod("3772", ref DBUtility.ClsPub.sExeReturnInfo, true);
                    HInterID = oItemSub.HInterID;
                    HBillNo = oItemSub.HBillNo;
                    HICMOInterID = oItemSub.HICMOInterID;
                    HICMOEntryID = oItemSub.HICMOEntryID;
                    HICMOBillNo = oItemSub.HICMOBillNo;
                    HQty = oItemSub.HQty;
                    HProQty = oItemSub.HProQty;
                    sql = "select * from h_v_Sc_ProcessExchangeBill_BatchSplit where hmainid = " + oItemSub.HICMOInterID + " and hentryid = " 
                         + oItemSub.HICMOEntryID;
@@ -2102,6 +2108,7 @@
                    //主表赋值
                    if (ds.Tables[0].Rows.Count > 0 && ds != null)
                    {
                        oBill.omodel.HInterID = HInterID;
                        oBill.omodel.HBillNo = HBillNo;
                        oBill.omodel.HBillSubType = "3772";
                        oBill.omodel.HMainSourceBillSubType = "3710";
@@ -2112,7 +2119,7 @@
                        oBill.omodel.HYear = DBUtility.ClsPub.isLong(oItemSub.HDate.Year);
                        oBill.omodel.HPeriod = DBUtility.ClsPub.isLong(oItemSub.HDate.Month);
                        oBill.omodel.HRemark = "";
                        oBill.omodel.HBatchNo = "";
                        oBill.omodel.HBatchNo = oItemSub.HBatchNo;
                        oBill.omodel.HMainMaterID = 0;
                        oBill.omodel.HKeyMaterID = 0;
                        oBill.omodel.HNo = 0;
@@ -2205,7 +2212,7 @@
                        oBill.omodel.HRemark_New = "";
                        oBill.omodel.HWeight_New = 0;
                        oBill.omodel.HPlanOrderProcNo = ds.Tables[0].Rows[0]["HPlanOrderProcNo"].ToString();
                        oBill.omodel.HMouldNum = "0";
                        oBill.omodel.HMouldNum = "0";
                    }   
                    //子表赋值
                    for(int i = 0; i < ds.Tables[0].Rows.Count; i++)
@@ -2235,11 +2242,11 @@
                        oItemSubs.HDeptID = Pub_Class.ClsPub.isLong(ds.Tables[0].Rows[i]["HDeptID"]);
                        oItemSubs.HDeptNumber = ds.Tables[0].Rows[i]["HDeptNumber"].ToString();
                        oItemSubs.HGroupID = 0;
                        oItemSubs.HGroupNumber = "";
                        oItemSubs.HGroupNumber = oItemSub.HGroupNumber;
                        oItemSubs.HWorkerID = 0;
                        oItemSubs.HWorkerNumber = "";
                        oItemSubs.HSourceID = 0;
                        oItemSubs.HQty = HQty;
                        oItemSubs.HQty = HProQty;
                        oItemSubs.HTimeUnit = "";
                        oItemSubs.HPlanWorkTimes = 0;
                        oItemSubs.HPlanBeginDate = Convert.ToDateTime(dt.ToShortDateString().ToString());