zzr99
2022-05-27 65abf21e0f3f3c0d9e5c3d348dce4c56c92e9bde
WebAPI/Controllers/Éú²ú¹ÜÀí/Éú²úÈÎÎñµ¥/Sc_ICMOBillController.cs
@@ -173,14 +173,17 @@
            var _value = msg["msg"].ToString();
            string msg1 = _value.ToString();
            string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
            string msg2 = sArray[0].ToString();
            string msg3 = sArray[1].ToString();
            string msg5 = sArray[2].ToString();
            string msg2 = sArray[0].ToString();//表格数据
            string msg3 = sArray[1].ToString();//登录人
            string msg5 = sArray[2].ToString();//登录组织
            string msg6 = sArray[3].ToString();//标记
            string msg7 = sArray[4].ToString();//当前用料清单
            ListModels oListModels = new ListModels();
            DataSet ds = new DataSet();
            ds = oCN.RunProcReturn("select * from Xt_ORGANIZATIONS where HItemID=" + msg5, "Xt_ORGANIZATIONS");
            string OrgNum = ds.Tables[0].Rows[0]["HNumber"].ToString();//组织代码
            DataSet d = oCN.RunProcReturn("select HRemark from Sc_PPBomBillMain where HBillNo='" + msg7 + "'", "Sc_ICMOBillMain");//查找该用料清单上次生成的箱号(HRemark存放箱号)
            DataSet Ds1 = new DataSet();
            try
            {
@@ -206,6 +209,8 @@
                int LSH;
                string LSH2;
                string TM = "";
                int XH = Convert.ToInt32(d.Tables[0].Rows[0]["HRemark"].ToString() == ""? 0 : Convert.ToInt32(d.Tables[0].Rows[0]["HRemark"].ToString()));
                foreach (Models.ClsQK_PackingBill oItemSub in ls)
                {
                    //根据生成条数生成相应数量条码
@@ -222,6 +227,16 @@
                            LSH2 = "0" + LSH2;
                        }
                        TM = sTMNumber + LSH2;
                        if (msg6 == "ZZ")
                        {
                            XH = XH +1;
                        }
                        else if (msg6 == "PZ"&& ls.IndexOf(oItemSub) == 0)
                        {
                            XH = XH + 1;
                        }
                        //获取内码
                        oCN.RunProc("insert into Gy_BarCodeBill (HEntryID,HBarCode,HBarCodeType,HMaterID,HUnitID,HQty" +
                                    ",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty" +
@@ -235,7 +250,7 @@
                                    + ",'" + TM + "','唯一条码'," + oItemSub.HMaterID.ToString() + "," + oItemSub.HUnitID.ToString() + "," + oItemSub.HMinQty.ToString()
                                    + ",'',0,0,'" + msg3 + "',getdate(),0," + oItemSub.HMinQty.ToString()
                                    + ", " + oItemSub.HInterID.ToString() + "," + oItemSub.HEntryID.ToString() + ",'" + oItemSub.HBillNo + "','3710',''"
                                    + ",1,1," + oItemSub.HDeptID.ToString() + ",0,0,'"+ (int.Parse(oItemSub.HXH.ToString())+i) + "'"
                                    + ",1,1," + oItemSub.HDeptID.ToString() + ",0,0,'"+ XH + "'"
                                    + ", " + oItemSub.HCusID.ToString() + ",'',getdate(),'',getdate()"
                                    + ", " + msg5.ToString() + "," + OrgNum.ToString() + ",'" + oItemSub.HSeOrderBillNo.ToString() + "'," + HInterID.ToString()
                                    + ",0"
@@ -245,6 +260,7 @@
                        
                    }
                    oCN.RunProc("update Sc_ICMOBillSub set HQty=" + oItemSub.HSpsQty  + " where HEntryID=" + oItemSub.HEntryID);
                    oCN.RunProc("update Sc_PPBomBillMain set HRemark=" +XH+ " where HBillNo='" + msg7+"'");
                    DataSet Dsn = oCN.RunProcReturn("select top " + oItemSub.HTotalQty + " HItemID from Gy_BarCodeBill order by HItemID desc", "Gy_BarCodeBill");    //获取最大流水号
                    for (int i = 0; i < oItemSub.HTotalQty; i++)
                    {