zzr99
2022-04-12 3e02cd0efd250e502655103921252bf28bfa7e5b
WebAPI/Controllers/Éú²ú¹ÜÀí/Éú²úÈÎÎñµ¥/Sc_ICMOBillController.cs
@@ -82,14 +82,15 @@
        {
            try
            {
                string sql = string.Format(@"select a.HInterID,a.HBillNo,a.HMaterID,m.HName HMaterName, a.HUnitID,u.HName HUnitName,a.HPlanQty,a.HCusID, c.HName HCusName,a.HEmpID,e.HName HEmpName,a.HDeptID,d.HName HDeptName,a.HPlanEndDate,0 HMinQty,0 HTotalQty,0 HSpsQty
                string sql = string.Format(@"select a.HInterID,a.HBillNo,a.HMaterID,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
                                            from Sc_ICMOBillMain a 
                                            left join Gy_Material m on a.HMaterID=m.HItemID
                                            left join Gy_Unit u on a.HUnitID=u.HItemID
                                            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 HSeOrderInterID=(select HSeOrderInterID from Sc_ICMOBillMain where HBillNo='" + HBillNo + "')");
                                            where b.HSeOrderInterID=(select HSeOrderInterID from Sc_ICMOBillMain where HBillNo='" + HBillNo + "')");
               
                ds = oCN.RunProcReturn(sql, "Sc_ICMOBillMain");
                if (ds.Tables[0].Rows.Count != 0 || ds != null)
@@ -185,7 +186,7 @@
                                        + ",0"
                                        + ",'" + oItemSub.HMaterName + "','','',0,'','')");
                            string sql1 = string.Format(@"update Sc_ICMOBillMain set HPlanQty=" + oItemSub.HSpsQty + " where HInterID=" + oItemSub.HInterID);
                            string sql1 = string.Format(@"update Sc_ICMOBillSub set HQty=" + oItemSub.HSpsQty + " where HInterID=" + oItemSub.HInterID);
                            oCN.RunProc(sql1);
                        }
                    }
@@ -238,7 +239,7 @@
                                                   "0,0,"+ oItemSub.HMaterID+","+ oItemSub.HUnitID+","+ oItemSub.HPlanQty+", 0,0,0,0,"+
                                                   "getdate(),'"+ LSH + "','" +HBillNo+"')");
                        //更改生产订单的数量
                        string sql1 = string.Format(@"update Sc_ICMOBillMain set HPlanQty=" + oItemSub.HSpsQty + " where HInterID=" + oItemSub.HInterID);
                        string sql1 = string.Format(@"update Sc_ICMOBillSub set HQty=" + oItemSub.HSpsQty + " where HInterID=" + oItemSub.HInterID);
                        oCN.RunProc(sql);
                        oCN.RunProc(sql1);
@@ -343,7 +344,7 @@
        #region[墙咔装箱列表]
        /// <summary>
        /// æ¨¡å…·ä¿å…»è®°å½•表列表
        /// å¢™å’”装箱列表
        /// </summary>
        /// <returns></returns>
        [Route("Sc_ICMOBillController/QK_GetPackingBillList")]
@@ -422,7 +423,7 @@
                    ds = oCN.RunProcReturn("select * from Gy_BarCodeBill where HItemID=" + HInterID, "Gy_BarCodeBill");
                    DataRow dr = ds.Tables[0].Rows[0];
                    string sql = string.Format(@"delete from Gy_BarCodeBill where HItemID=" + HInterID);
                    string sql1 = string.Format(@"update Sc_ICMOBillMain set HPlanQty=HPlanQty+" + dr["HQty"] +" where HInterID=(select HSourceInterID from Gy_BarCodeBill where HItemID="+ HInterID + ")");
                    string sql1 = string.Format(@"update Sc_ICMOBillSub set HQty=HPlanQty+" + dr["HQty"] +" where HInterID=(select HSourceInterID from Gy_BarCodeBill where HItemID="+ HInterID + ")");
                    oCN.RunProc(sql);
                    oCN.RunProc(sql1);
                }
@@ -443,7 +444,7 @@
                            DataRow dr1 = ds.Tables[0].Rows[0];
                            string sql = string.Format(@"delete from Gy_BarCodeBill where HBarCode='" + dr["HBarCode"].ToString()+"'");
                            string sql1 = string.Format(@"update Sc_ICMOBillMain set HPlanQty=HPlanQty+" + dr1["HQty"] + " where HInterID=(select HSourceInterID from Gy_BarCodeBill where HBarCode='" + dr["HBarCode"].ToString() + "')");
                            string sql1 = string.Format(@"update Sc_ICMOBillSub set HQty=HPlanQty+" + dr1["HQty"] + " where HInterID=(select HSourceInterID from Gy_BarCodeBill where HBarCode='" + dr["HBarCode"].ToString() + "')");
                            oCN.RunProc(sql);
                            oCN.RunProc(sql1);
                        }