zzr99
2022-05-17 76c42727bf5a17e2e520401b7de8108e7aec3a49
nothing
2个文件已修改
302 ■■■■ 已修改文件
WebAPI/Controllers/生产管理/生产任务单/Sc_ICMOBillController.cs 301 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Models/ClsQK_PackingBill.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/Éú²ú¹ÜÀí/Éú²úÈÎÎñµ¥/Sc_ICMOBillController.cs
@@ -109,33 +109,33 @@
        {
            try
            {
                //string sql = string.Format(@"select a.HInterID,a.HBillNo,a.HMaterID,m.HNumber HMaterNumber,m.HName HMaterName, a.HUnitID,u.HName HUnitName,b.HQty HPlanQty,a.HCusID, c.HName HCusName,a.HEmpID,e.HName HEmpName,a.HDeptID,d.HName HDeptName,a.HPlanEndDate,0 HMinQty,0 HTotalQty,0 HSpsQty,a.HSeOrderBillNo
                //                            from Sc_ICMOBillMain a
                //                            left join Sc_ICMOBillSub b on a.HInterID=b.HInterID
                //                            left join Gy_Material m on b.HMaterID=m.HItemID
                //                            left join Gy_Unit u on b.HUnitID=u.HItemID
                //                            left join Gy_Customer c on a.HCusID=c.HItemID
                //                            left join Gy_Employee e on a.HEmpID=e.HItemID
                //                            left join Gy_Department d on a.HDeptID=d.HItemID
                //                            where b.HInterID=(select HICMOInterID from Sc_PPBomBillMain where HBillNo='" + HBillNo + "')");
                string sql = string.Format(@" select a.HInterID,a.HBillNo,a.HMaterID,m.HNumber HMaterNumber,m.HName HMaterName, a.HUnitID,u.HName HUnitName,b.HQty HPlanQty,a.HCusID,
                    c.HName HCusName,a.HEmpID,e.HName HEmpName,a.HDeptID,d.HName HDeptName,a.HPlanEndDate,0 HMinQty,0 HTotalQty,0 HSpsQty,a.HSeOrderBillNo
                     ,fo.FBILLNO FBillNo,fo.F_ZZZZ_TEXT7 FLXName,fo.FRECEIVEADDRESS FInAddress,fm1.FOLDNUMBER FMaterName,fo.F_ZZZZ_TEXT FBZFS,fu.FDATAVALUE FHX,
                    fu1.FDATAVALUE FQK,fo.F_ZZZZ_WBBZ FWBBZ
                    from Sc_ICMOBillMain a
                    left join Sc_ICMOBillSub b on a.HInterID=b.HInterID
                    left join Gy_Material m on b.HMaterID=m.HItemID
                    left join Gy_Unit u on b.HUnitID=u.HItemID
                    left join Gy_Customer c on a.HCusID=c.HItemID
                    left join Gy_Employee e on a.HEmpID=e.HItemID
                    left join Gy_Department d on a.HDeptID=d.HItemID
                     left join AIS20200908101915zs..T_PRD_MOENTRY f1 on b.HERPEntryID=f1.FENTRYID
                    left join AIS20200908101915zs..T_SAL_ORDER fo on f1.FSaleOrderId =fo.FID
                    left join AIS20200908101915zs..T_SAL_ORDERENTRY fo1 on fo.FID=fo1.FID
                    left join AIS20200908101915zs..T_BD_MATERIAL fm1 on fo1.FSUBMATERIALNUMBER=fm1.FMATERIALID
                    LEFT JOIN AIS20200908101915zs..T_BAS_ASSISTANTDATAENTRY_L fu1 on fo1.F_ZZZZ_ASSISTANT1=fu1.FENTRYID
                    LEFT JOIN AIS20200908101915zs..T_BAS_ASSISTANTDATAENTRY_L fu on fo1.F_ZZZZ_ASSISTANT2=fu.FENTRYID
                     where b.HInterID=(select HICMOInterID from Sc_PPBomBillMain where HBillNo='" + HBillNo + "')");
                string sql = string.Format(@"select a.HInterID,a.HBillNo,b.HEntryID,a.HMaterID,m.HNumber HMaterNumber,m.HName HMaterName, a.HUnitID,u.HName HUnitName,b.HQty HPlanQty,a.HCusID, c.HName HCusName,a.HEmpID,e.HName HEmpName,a.HDeptID,d.HName HDeptName,a.HPlanEndDate,0 HMinQty,0 HTotalQty,0 HSpsQty,a.HSeOrderBillNo
                                            from Sc_ICMOBillMain a
                                            left join Sc_ICMOBillSub b on a.HInterID=b.HInterID
                                            left join Gy_Material m on b.HMaterID=m.HItemID
                                            left join Gy_Unit u on b.HUnitID=u.HItemID
                                            left join Gy_Customer c on a.HCusID=c.HItemID
                                            left join Gy_Employee e on a.HEmpID=e.HItemID
                                            left join Gy_Department d on a.HDeptID=d.HItemID
                                            where b.HInterID=(select HICMOInterID from Sc_PPBomBillMain where HBillNo='" + HBillNo + "')");
                //string sql = string.Format(@" select a.HInterID,a.HBillNo,b.HEntryID,a.HMaterID,m.HNumber HMaterNumber,m.HName HMaterName, a.HUnitID,u.HName HUnitName,b.HQty HPlanQty,a.HCusID,
                //    c.HName HCusName,a.HEmpID,e.HName HEmpName,a.HDeptID,d.HName HDeptName,a.HPlanEndDate,0 HMinQty,0 HTotalQty,0 HSpsQty,a.HSeOrderBillNo
                //     ,fo.FBILLNO FBillNo,fo.F_ZZZZ_TEXT7 FLXName,fo.FRECEIVEADDRESS FInAddress,fm1.FOLDNUMBER FMaterName,fo.F_ZZZZ_TEXT FBZFS,fu.FDATAVALUE FHX,
                //    fu1.FDATAVALUE FQK,fo.F_ZZZZ_WBBZ FWBBZ
                //    from Sc_ICMOBillMain a
                //    left join Sc_ICMOBillSub b on a.HInterID=b.HInterID
                //    left join Gy_Material m on b.HMaterID=m.HItemID
                //    left join Gy_Unit u on b.HUnitID=u.HItemID
                //    left join Gy_Customer c on a.HCusID=c.HItemID
                //    left join Gy_Employee e on a.HEmpID=e.HItemID
                //    left join Gy_Department d on a.HDeptID=d.HItemID
                //     left join AIS20200908101915zs..T_PRD_MOENTRY f1 on b.HERPEntryID=f1.FENTRYID
                //    left join AIS20200908101915zs..T_SAL_ORDER fo on f1.FSaleOrderId =fo.FID
                //    left join AIS20200908101915zs..T_SAL_ORDERENTRY fo1 on fo.FID=fo1.FID
                //    left join AIS20200908101915zs..T_BD_MATERIAL fm1 on fo1.FSUBMATERIALNUMBER=fm1.FMATERIALID
                //    LEFT JOIN AIS20200908101915zs..T_BAS_ASSISTANTDATAENTRY_L fu1 on fo1.F_ZZZZ_ASSISTANT1=fu1.FENTRYID
                //    LEFT JOIN AIS20200908101915zs..T_BAS_ASSISTANTDATAENTRY_L fu on fo1.F_ZZZZ_ASSISTANT2=fu.FENTRYID
                //     where b.HInterID=(select HICMOInterID from Sc_PPBomBillMain where HBillNo='" + HBillNo + "')");
                ds = oCN.RunProcReturn(sql, "Sc_ICMOBillMain");
                if (ds.Tables[0].Rows.Count != 0 || ds != null)
@@ -197,81 +197,31 @@
                string month = DateTime.Now.Month.ToString();
                string day = DateTime.Now.Day.ToString();
                string nowDate = year + month + day;
                string materid = "";
                //string materid = "";
                //long sum = 0;
                //if (msg4 == "ZZ")
                //{
                string FID = "";
                int LSH;
                string LSH2;
                string TM = "";
                long sum = 0;
                if (msg4 == "ZZ")
                foreach (Models.ClsQK_PackingBill oItemSub in ls)
                {
                    string FID = "";
                    oCN.BeginTran();
                    foreach (Models.ClsQK_PackingBill oItemSub in ls)
                    //根据生成条数生成相应数量条码
                    for (int i = 0; i < oItemSub.HTotalQty; i++)
                    {
                        //根据生成条数生成相应数量条码
                        foreach (var item in oItemSub.HTotalQty.ToString())
                        {
                            //生成唯一条码   æ¡ç å‰ç¼€ = ç»„织代码 + ç‰©æ–™ä»£ç  + å¹´ + æœˆ + æ—¥
                            string sTMNumber = OrgNum + oItemSub.HMaterNumber + nowDate;
                            Ds1 = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo");    //获取最大流水号
                            LSH = ClsPub.isInt(Ds1.Tables[0].Rows[0][0]);//唯一码
                            LSH = LSH + 1;
                            LSH2 = LSH.ToString();
                            while (LSH2.Length<6)
                            {
                                LSH2 = "0" + LSH2;
                            }
                            TM = sTMNumber + LSH2;
                            //获取内码
                            long HInterID = DBUtility.ClsPub.CreateBillID_Prod("85", ref DBUtility.ClsPub.sExeReturnInfo);
                            string str = string.Format(@"insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty" +
                                        ",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty" +
                                        ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty " +
                                        ",HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark " +
                                        ",HCusID,HCusType,HEndDate,HWorkLineName,HBarCodeDate " +
                                        ",HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID " +
                                        ",HGiveAwayFlag " +
                                        ",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo " +
                                        ") values ("
                                        + "'" + TM + "','唯一条码'," + oItemSub.HMaterID.ToString() + "," + oItemSub.HUnitID.ToString() + "," + oItemSub.HMinQty.ToString()
                                        + ",'',0,0,'" + msg3 + "',getdate(),0," + oItemSub.HMinQty.ToString()
                                        + ", " + oItemSub.HInterID.ToString() + "," + oItemSub.HInterID.ToString() + ",'" + oItemSub.HBillNo + "','3710',''"
                                        + ",1,1," + oItemSub.HDeptID.ToString() + ",0,0,''"
                                        + ", " + oItemSub.HCusID.ToString() + ",'',getdate(),'',getdate()"
                                        + ", " + msg5.ToString() + "," + OrgNum.ToString() + ",'" + oItemSub.HSeOrderBillNo.ToString() + "'," + HInterID.ToString()
                                        + ",0"
                                        + ",'" + oItemSub.HMaterName + "','','',0,'','')");
                            oCN.RunProc(str);
                            oCN.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'");
                            string sql1 = string.Format(@"update Sc_ICMOBillSub set HQty=" + oItemSub.HSpsQty + " where HInterID=" + oItemSub.HInterID);
                            oCN.RunProc(sql1);
                            FID = FID + HInterID + ",";
                        }
                    }
                    oCN.Commit();
                    objJsonResult.code = FID;
                    objJsonResult.count = 1;
                    objJsonResult.Message = "整装生成成功!";
                    objJsonResult.data = 1;
                    return objJsonResult;
                }
                else
                {
                    var HInterID = DBUtility.ClsPub.CreateBillID("3783", ref DBUtility.ClsPub.sExeReturnInfo);
                    var HBillNo = DBUtility.ClsPub.CreateBillCode("3783", ref DBUtility.ClsPub.sExeReturnInfo, true);
                    oCN.BeginTran();
                    foreach (Models.ClsQK_PackingBill oItemSub in ls)
                    {
                        sum += oItemSub.HMinQty;
                        materid = oItemSub.HMaterNumber;
                        //获取内码
                        long HInterID2 = DBUtility.ClsPub.CreateBillID_Prod("85", ref DBUtility.ClsPub.sExeReturnInfo);
                        //生成唯一条码   æ¡ç å‰ç¼€ = ç»„织代码 + ç‰©æ–™ä»£ç  + å¹´ + æœˆ + æ—¥
                        long HInterID = DBUtility.ClsPub.CreateBillID_Prod("85", ref DBUtility.ClsPub.sExeReturnInfo);
                        string sTMNumber = OrgNum + oItemSub.HMaterNumber + nowDate;
                        Ds1 = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo");    //获取最大流水号
                        LSH = ClsPub.isInt(Ds1.Tables[0].Rows[0][0]);//唯一码
                        //插入条码档案
                        LSH = ClsPub.isInt(Ds1.Tables[0].Rows[0][0]);//
                        LSH = LSH + 1;
                        LSH2 = LSH.ToString();
                        while (LSH2.Length < 6)
                        {
                            LSH2 = "0" + LSH2;
                        }
                        TM = sTMNumber + LSH2;
                        //获取内码
                        oCN.RunProc("insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty" +
                                    ",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty" +
                                    ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty " +
@@ -281,76 +231,119 @@
                                    ",HGiveAwayFlag " +
                                    ",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo " +
                                    ") values ("
                                    + "'" + LSH + "','唯一条码'," + oItemSub.HMaterID.ToString() + "," + oItemSub.HUnitID.ToString() + "," + oItemSub.HMinQty.ToString()
                                    + "'" + TM + "','唯一条码'," + oItemSub.HMaterID.ToString() + "," + oItemSub.HUnitID.ToString() + "," + oItemSub.HMinQty.ToString()
                                    + ",'',0,0,'" + msg3 + "',getdate(),0," + oItemSub.HMinQty.ToString()
                                    + ", " + oItemSub.HInterID.ToString() + "," + oItemSub.HInterID.ToString() + ",'" + oItemSub.HBillNo + "','3710',''"
                                    + ",1,1," + oItemSub.HDeptID.ToString() + ",0,0,''"
                                    + ", " + oItemSub.HCusID.ToString() + ",'',getdate(),'',getdate()"
                                    + ", " + msg5.ToString() + "," + OrgNum.ToString() + ",''," + HInterID2.ToString()
                                    + ", " + msg5.ToString() + "," + OrgNum.ToString() + ",'" + oItemSub.HSeOrderBillNo.ToString() + "'," + HInterID.ToString()
                                    + ",0"
                                    + ",'" + oItemSub.HMaterName + "','','',0,'','')");
                        //插入组托单子表
                        string sql = string.Format(@"insert into Sc_PackUnionBillSub(HInterID,HEntryID,HCloseMan,HCloseType,HRemark,
                                                    HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,
                                                    HRelationQty,HRelationMoney,HMaterID,HUnitID,HQty,HSourceID,HEquipID,HGroupID,HWorkerID,
                                                    HScanDate,HBarCode,HBarCode_Pack)
                                                    values(" + HInterID + ",'','',0,'自动绑定'," + oItemSub.HInterID + ",'','" + oItemSub.HBillNo + "','3710'," +
                                                    "0,0," + oItemSub.HMaterID + "," + oItemSub.HUnitID + "," + oItemSub.HPlanQty + ", 0,0,0,0," +
                                                    "getdate(),'" + LSH + "','" + HBillNo + "')");
                        //更改生产订单的数量
                        string sql1 = string.Format(@"update Sc_ICMOBillSub set HQty=" + oItemSub.HSpsQty + " where HInterID=" + oItemSub.HInterID);
                        oCN.RunProc(sql);
                        oCN.RunProc(sql1);
                        oCN.RunProc("update Sc_ICMOBillSub set HQty=" + (oItemSub.HPlanQty- oItemSub.HMinQty).ToString() + " where HEntryID=" + oItemSub.HEntryID);
                        oCN.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'");
                        FID = FID + HInterID + ",";
                    }
                    //生成组托单主表
                    string sql2 = string.Format(@"Insert Sc_PackUnionBillMain(HYear,HPeriod,HBillType,HInterID,HDate,HBillNo,HBillStatus,HCheckItemNowID,HCheckItemNextID,
                                                    HRemark,HBacker,HChecker,HMaker,HMakeDate,HUpDater,HCloseMan,HCloseType,HDeleteMan,HICMOInterID,HICMOBillNo,
                                                    HBarCode_Pack,HMaterID,HUnitID,HWeight,HMWeight,HPWeight,
                                                    HProdOrgID,HDeptID,HEmpID,HSNum,HPackNum,HBarCode_Cus,HBatchNo,HBillSubType)
                                                    values('2022',1,'3783'," + HInterID + ",getdate(),'" + HBillNo + "',1,0,0," +
                                                        "'自动绑定','','', '" + msg3 + "',getdate(),'','',0,'',0,0,'" +
                                                         HBillNo + "',0,0,0,0,0," +
                                                        "0,0,0,0,0,'','','')");
                    oCN.RunProc(sql2);
                    //再次生成唯一码
                    //获取内码
                    long HInterID3 = DBUtility.ClsPub.CreateBillID_Prod("85", ref DBUtility.ClsPub.sExeReturnInfo);
                    //生成唯一条码   æ¡ç å‰ç¼€ = ç»„织代码 + ç‰©æ–™ä»£ç  + å¹´ + æœˆ + æ—¥
                    string sTMNumber1 = OrgNum + materid + nowDate;
                    Ds1 = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber1 + "'", "h_p_WMS_GetMaxNo");    //获取最大流水号
                    int LSH1 = ClsPub.isInt(Ds1.Tables[0].Rows[0][0]);//唯一码
                    string sql3 = string.Format(@"insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty" +
                                ",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty" +
                                ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty " +
                                ",HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark " +
                                ",HCusID,HCusType,HEndDate,HWorkLineName,HBarCodeDate " +
                                ",HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID " +
                                ",HGiveAwayFlag " +
                                ",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo " +
                                ") values ("
                                + "'" + LSH1 + "','唯一条码','" + materid.ToString() + "',0," + sum.ToString()
                                + ",'',0,0,'" + msg3 + "',getdate(),0," + sum.ToString()
                                + ", 0,0,'" + HBillNo + "','3710','',"
                                + sum.ToString() + "," + HInterID.ToString() + ",0,0,0,''"
                                + ",0,'',getdate(),'',getdate()"
                                + ", " + msg5.ToString() + "," + OrgNum.ToString() + ",''," + HInterID3.ToString()
                                + ",0"
                                + ",'','','',0,'','')");
                    oCN.RunProc(sql3);
                    oCN.Commit();
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "拼装生成成功";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                objJsonResult.code = FID;
                objJsonResult.count = 1;
                objJsonResult.Message = "整装生成成功!";
                objJsonResult.data = 1;
                return objJsonResult;
                //}
                //else
                //{
                //    var HInterID = DBUtility.ClsPub.CreateBillID("3783", ref DBUtility.ClsPub.sExeReturnInfo);
                //    var HBillNo = DBUtility.ClsPub.CreateBillCode("3783", ref DBUtility.ClsPub.sExeReturnInfo, true);
                //    oCN.BeginTran();
                //    foreach (Models.ClsQK_PackingBill oItemSub in ls)
                //    {
                //        sum += oItemSub.HMinQty;
                //        materid = oItemSub.HMaterNumber;
                //        //获取内码
                //        long HInterID2 = DBUtility.ClsPub.CreateBillID_Prod("85", ref DBUtility.ClsPub.sExeReturnInfo);
                //        //生成唯一条码   æ¡ç å‰ç¼€ = ç»„织代码 + ç‰©æ–™ä»£ç  + å¹´ + æœˆ + æ—¥
                //        string sTMNumber = OrgNum + oItemSub.HMaterNumber + nowDate;
                //        Ds1 = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo");    //获取最大流水号
                //        LSH = ClsPub.isInt(Ds1.Tables[0].Rows[0][0]);//唯一码
                //        //插入条码档案
                //        oCN.RunProc("insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty" +
                //                    ",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty" +
                //                    ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty " +
                //                    ",HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark " +
                //                    ",HCusID,HCusType,HEndDate,HWorkLineName,HBarCodeDate " +
                //                    ",HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID " +
                //                    ",HGiveAwayFlag " +
                //                    ",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo " +
                //                    ") values ("
                //                    + "'" + LSH + "','唯一条码'," + oItemSub.HMaterID.ToString() + "," + oItemSub.HUnitID.ToString() + "," + oItemSub.HMinQty.ToString()
                //                    + ",'',0,0,'" + msg3 + "',getdate(),0," + oItemSub.HMinQty.ToString()
                //                    + ", " + oItemSub.HInterID.ToString() + "," + oItemSub.HInterID.ToString() + ",'" + oItemSub.HBillNo + "','3710',''"
                //                    + ",1,1," + oItemSub.HDeptID.ToString() + ",0,0,''"
                //                    + ", " + oItemSub.HCusID.ToString() + ",'',getdate(),'',getdate()"
                //                    + ", " + msg5.ToString() + "," + OrgNum.ToString() + ",''," + HInterID2.ToString()
                //                    + ",0"
                //                    + ",'" + oItemSub.HMaterName + "','','',0,'','')");
                //        //插入组托单子表
                //        string sql = string.Format(@"insert into Sc_PackUnionBillSub(HInterID,HEntryID,HCloseMan,HCloseType,HRemark,
                //                                    HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,
                //                                    HRelationQty,HRelationMoney,HMaterID,HUnitID,HQty,HSourceID,HEquipID,HGroupID,HWorkerID,
                //                                 HScanDate,HBarCode,HBarCode_Pack)
                //                                    values(" + HInterID + ",'','',0,'自动绑定'," + oItemSub.HInterID + ",'','" + oItemSub.HBillNo + "','3710'," +
                //                                    "0,0," + oItemSub.HMaterID + "," + oItemSub.HUnitID + "," + oItemSub.HPlanQty + ", 0,0,0,0," +
                //                                    "getdate(),'" + LSH + "','" + HBillNo + "')");
                //        //更改生产订单的数量
                //        string sql1 = string.Format(@"update Sc_ICMOBillSub set HQty=" + oItemSub.HSpsQty + " where HInterID=" + oItemSub.HInterID);
                //        oCN.RunProc(sql);
                //        oCN.RunProc(sql1);
                //    }
                //    //生成组托单主表
                //    string sql2 = string.Format(@"Insert Sc_PackUnionBillMain(HYear,HPeriod,HBillType,HInterID,HDate,HBillNo,HBillStatus,HCheckItemNowID,HCheckItemNextID,
                //                                    HRemark,HBacker,HChecker,HMaker,HMakeDate,HUpDater,HCloseMan,HCloseType,HDeleteMan,HICMOInterID,HICMOBillNo,
                //                                    HBarCode_Pack,HMaterID,HUnitID,HWeight,HMWeight,HPWeight,
                //                                    HProdOrgID,HDeptID,HEmpID,HSNum,HPackNum,HBarCode_Cus,HBatchNo,HBillSubType)
                //                                    values('2022',1,'3783'," + HInterID + ",getdate(),'" + HBillNo + "',1,0,0," +
                //                                        "'自动绑定','','', '" + msg3 + "',getdate(),'','',0,'',0,0,'" +
                //                                         HBillNo + "',0,0,0,0,0," +
                //                                        "0,0,0,0,0,'','','')");
                //    oCN.RunProc(sql2);
                //    //再次生成唯一码
                //    //获取内码
                //    long HInterID3 = DBUtility.ClsPub.CreateBillID_Prod("85", ref DBUtility.ClsPub.sExeReturnInfo);
                //    //生成唯一条码   æ¡ç å‰ç¼€ = ç»„织代码 + ç‰©æ–™ä»£ç  + å¹´ + æœˆ + æ—¥
                //    string sTMNumber1 = OrgNum + materid + nowDate;
                //    Ds1 = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber1 + "'", "h_p_WMS_GetMaxNo");    //获取最大流水号
                //    int LSH1 = ClsPub.isInt(Ds1.Tables[0].Rows[0][0]);//唯一码
                //    string sql3 = string.Format(@"insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty" +
                //                ",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty" +
                //                ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty " +
                //                ",HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark " +
                //                ",HCusID,HCusType,HEndDate,HWorkLineName,HBarCodeDate " +
                //                ",HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID " +
                //                ",HGiveAwayFlag " +
                //                ",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo " +
                //                ") values ("
                //                + "'" + LSH1 + "','唯一条码','" + materid.ToString() + "',0," + sum.ToString()
                //                + ",'',0,0,'" + msg3 + "',getdate(),0," + sum.ToString()
                //                + ", 0,0,'" + HBillNo + "','3710','',"
                //                + sum.ToString() + "," + HInterID.ToString() + ",0,0,0,''"
                //                + ",0,'',getdate(),'',getdate()"
                //                + ", " + msg5.ToString() + "," + OrgNum.ToString() + ",''," + HInterID3.ToString()
                //                + ",0"
                //                + ",'','','',0,'','')");
                //    oCN.RunProc(sql3);
                //    oCN.Commit();
                //    objJsonResult.code = "1";
                //    objJsonResult.count = 1;
                //    objJsonResult.Message = "拼装生成成功";
                //    objJsonResult.data = null;
                //    return objJsonResult;
                //}
            }
            catch (Exception e)
            {
                oCN.RollBack();
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "获取失败!" + e.ToString();
@@ -538,6 +531,6 @@
        }
        #endregion
    }
}
WebAPI/Models/ClsQK_PackingBill.cs
@@ -24,6 +24,7 @@
        public string HDeptName;
        public string HPlanEndDate;
        public Int64 HInterID;
        public Int64 HEntryID;
        public string HBillNo;
        public string HSeOrderBillNo;
        public string FBillNo;