yangle
2022-05-26 50bade35ce7a6d9b7e9d1a832662ada666a6d7bd
叫料平台完善
4个文件已修改
76 ■■■■ 已修改文件
WebAPI/Controllers/SCGL/Sc_ComplementGoodBillController.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/SCGL/Sc_ComplementGoodsController.cs 33 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/SCGL/日计划管理/JIT_DayPlanPlatFormImportController.cs 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/SCGL/日计划管理/Sc_WorkBillSortBillController.cs 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/SCGL/Sc_ComplementGoodBillController.cs
@@ -396,7 +396,7 @@
                        ds = oCN.RunProcReturn("select sum(HQty) from JIT_CallGoodsBackRequestBillSub " +
                   $"where HSourceInterID={listCa[i].HSouceInterID} and HSourceEntryID ={listCa[i].HSourceEntryID} and HSourceBillNo = '{listCa[i].HSourceBillNo}' and HMaterID={listCa[i].HMaterialID}", "JIT_CallGoodsBackRequestBillSub");
                        if ((double.Parse(ds.Tables[0].Rows[0][0].ToString())+listCa[i].退料数量) > listCa[i].已叫料数量)
                        if ((double.Parse(ds.Tables[0].Rows[0][0].ToString()==""?"0": ds.Tables[0].Rows[0][0].ToString()) +listCa[i].退料数量) > listCa[i].已叫料数量)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
@@ -533,7 +533,7 @@
                        ds = oCN.RunProcReturn("select sum(HQty) from JIT_CallGoodsBackRequestBillSub " +
                $"where HSourceInterID={listCa[i].HSouceInterID} and HSourceEntryID ={listCa[i].HSourceEntryID} and HSourceBillNo = '{listCa[i].HSourceBillNo}' and HMaterID={listCa[i].HMaterialID}", "JIT_CallGoodsBackRequestBillSub");
                        if ((double.Parse(ds.Tables[0].Rows[0][0].ToString()) + listCa[i].退料数量) > listCa[i].已叫料数量)
                        if ((double.Parse(ds.Tables[0].Rows[0][0].ToString() == "" ? "0" : ds.Tables[0].Rows[0][0].ToString()) + listCa[i].退料数量) > listCa[i].已叫料数量)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
@@ -630,7 +630,7 @@
                        ds = oCN.RunProcReturn("select sum(HQty) from JIT_CallGoodsBackRequestBillSub " +
               $"where HSourceInterID={listCa[i].HSouceInterID} and HSourceEntryID ={listCa[i].HSourceEntryID} and HSourceBillNo = '{listCa[i].HSourceBillNo}' and HMaterID={listCa[i].HMaterialID}", "JIT_CallGoodsBackRequestBillSub");
                        if ((double.Parse(ds.Tables[0].Rows[0][0].ToString()) + listCa[i].退料数量) > listCa[i].已叫料数量)
                        if ((double.Parse(ds.Tables[0].Rows[0][0].ToString() == "" ? "0" : ds.Tables[0].Rows[0][0].ToString()) + listCa[i].退料数量) > listCa[i].已叫料数量)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
WebAPI/Controllers/SCGL/Sc_ComplementGoodsController.cs
@@ -332,10 +332,35 @@
                        oCN.RunProc($"update b  set b.HQty=b.HQty+{listCa[i].本次拣料数量} from JIT_SendGoodsBillMain a  with(nolock) inner join JIT_SendGoodsBillSub b with(nolock) on a.HInterID = b.HInterID  " +
                            $"where  HMainSourceInterID ={SourceInterID} and b.HMaterID ={listCa[i].HMaterID} and a.HBillStatus =1 ");
                    }
                    //修改调拨数量
                    oCN.RunProc($"update JIT_ComplementGoodsBillSub_LK set HSendQTY=HSendQTY+{listCa[i].本次拣料数量} where HMaterID={listCa[i].HMaterID} " +
                        $" and HSourceInterID=(select top 1 HSourceInterID from JIT_ComplementGoodsBillSub_LK " +
                        $"where HMaterID={listCa[i].HMaterID}  and HInterID={SourceInterID} order by HSourceInterID )  and HInterID={SourceInterID} ");
                    DataSet dsTable = new DataSet();
                    //查询JIT_ComplementGoodsBillSub_LK
                    dsTable = oCN.RunProcReturn($"select  * from JIT_ComplementGoodsBillSub_LK where HMaterID={listCa[i].HMaterID}  and HInterID={SourceInterID} order by HSourceInterID ", "JIT_ComplementGoodsBillSub_LK");
                    for (int j = 0; j < dsTable.Tables[0].Rows.Count; j++)
                    {
                        if (double.Parse(dsTable.Tables[0].Rows[j]["HCallQTY"].ToString()) != double.Parse(dsTable.Tables[0].Rows[j]["HSendQTY"].ToString()))
                        {
                            if (double.Parse(dsTable.Tables[0].Rows[j]["HSendQTY"].ToString()) + listCa[i].本次拣料数量 > double.Parse(dsTable.Tables[0].Rows[j]["HCallQTY"].ToString()))
                            {
                                var HCallQTY = double.Parse(dsTable.Tables[0].Rows[j]["HCallQTY"].ToString()) - double.Parse(dsTable.Tables[0].Rows[j]["HSendQTY"].ToString());
                                //修改调拨数量 è¶…出部分给予下一列数据
                                oCN.RunProc($"update JIT_ComplementGoodsBillSub_LK set HSendQTY=HSendQTY+{HCallQTY} where HMaterID={listCa[i].HMaterID} " +
                                    $" and HSourceInterID={double.Parse(dsTable.Tables[0].Rows[j]["HSourceInterID"].ToString())} and HInterID={SourceInterID} ");
                                oCN.RunProc($"update JIT_ComplementGoodsBillSub_LK set HSendQTY=HSendQTY+{(listCa[i].本次拣料数量 - HCallQTY)} where HMaterID={listCa[i].HMaterID} " +
                                   $" and HSourceInterID={dsTable.Tables[0].Rows[j + 1]["HSourceInterID"].ToString()} and HInterID={SourceInterID} ");
                                break;
                            }
                            else
                            {
                                //修改调拨数量
                                oCN.RunProc($"update JIT_ComplementGoodsBillSub_LK set HSendQTY=HSendQTY+{listCa[i].本次拣料数量} where HMaterID={listCa[i].HMaterID} " +
                                    $" and HSourceInterID={dsTable.Tables[0].Rows[j]["HSourceInterID"].ToString()} and HInterID={SourceInterID} ");
                                break;
                            }
                        }
                    }
                }
                sReturn = "新增单据成功!";
WebAPI/Controllers/SCGL/Èռƻ®¹ÜÀí/JIT_DayPlanPlatFormImportController.cs
@@ -58,6 +58,8 @@
                tb2.Columns.Add("HEmpID", typeof(Int32));//职员
                tb2.Columns.Add("HUnitID", typeof(Int32));//计量单位
                tb2.Columns.Add("HSourceID", typeof(Int32));//生产资源id
                tb2.Columns.Add("ICMOBillHInterID", typeof(Int32));//生产订单主id
                tb2.Columns.Add("ICMOBillHEntryID", typeof(Int32));//生产订单子id
                //添加数据
                for (int i = 1; i < ExcelDs.Tables[0].Rows.Count; i++)
@@ -122,6 +124,8 @@
                        tb2.Rows[i]["物料名称"] = ds.Tables[0].Rows[0]["产品名称"].ToString();
                        tb2.Rows[i]["规格型号"] = ds.Tables[0].Rows[0]["规格型号"].ToString();
                        tb2.Rows[i]["HWorkShopID"] = ds.Tables[0].Rows[0]["HDeptID"].ToString();
                        tb2.Rows[i]["ICMOBillHInterID"] = ds.Tables[0].Rows[0]["hmainid"].ToString();//生产订单主id
                        tb2.Rows[i]["ICMOBillHEntryID"] = ds.Tables[0].Rows[0]["HEntryID"].ToString();//生产订单子id
                    }
                    ds = oCN.RunProcReturn("select * from h_v_JIT_Sc_WorkBillSortBillList " +
@@ -270,18 +274,33 @@
                        var HCompleteQty = list[i]["总齐套数量"].ToString();
                        var HOrderType = omdelMian.HOrderType;
                        var HDate = omdelMian.HDate;
                        var HMainSourceInterID = list[i]["ICMOBillHInterID"].ToString();
                        var HMainSourceEntryID = list[i]["ICMOBillHEntryID"].ToString();
                        ds = oCN.RunProcReturn($"select * from  Sc_WorkBillSortBillMain where HMainSourceInterID={HMainSourceInterID}" +
                          $" and HMainSourceEntryID={HMainSourceEntryID} and HICMOBillNo='{HICMOBillNo}' and HICMOEntrySEQ={HICMOEntrySEQ} and HSourceID={HSourceID}", "Sc_WorkBillSortBillMain");
                        if (ds.Tables[0].Rows.Count > 0)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = $"第{i + 1}行生产资源有重复,请修改!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        //主表
                        oCN.RunProc("insert into Sc_WorkBillSortBillMain(HInterID,HBillNo,HYear,HPeriod,HBillType," +
                            "HBillSubType,HDate,HBillStatus,HMaker,HMakeDate,HICMOBillNo,HOrderType," +
                            "HICMOEntrySEQ,HWorkShopID,HSourceID, HYX, HEmpID," +
                            " HMaterID, HMaterName, HMaterModel, HUnitID, HBatchNo," +
                            " HSeOrderBillQty, HOrderNeedQty, HCompleteQty,HPreparatDate)values" +
                            " HSeOrderBillQty, HOrderNeedQty, HCompleteQty,HPreparatDate," +
                            "HMainSourceInterID,HMainSourceEntryID)values" +
                            $"({HInterID},'{HBillNo}',{DateTime.Now.Year},{DateTime.Now.Month},'{BillType}'," +
                            $"'{BillType}',GETDATE(),1,'{user}','{HDate}','{HICMOBillNo}','{HOrderType}'," +
                            $"{(HICMOEntrySEQ == "" ? 0.ToString() : HICMOEntrySEQ)},{(HWorkShopID == "" ? 0.ToString() : HWorkShopID)},{(HSourceID == "" ? 0.ToString() : HSourceID)}, {(HYX == "" ? 0.ToString() : HYX)}, {(HEmpID == "" ? 0.ToString() : HEmpID)}," +
                            $" {(HMaterID == "" ? 0.ToString() : HMaterID)}, '{HMaterName}', '{HMaterModel}', {(HUnitID == "" ? 0.ToString() : HUnitID)}, '{HBatchNo}'," +
                            $" {(HSeOrderBillQty == "" ? 0.ToString() : HSeOrderBillQty)}, {(HOrderNeedQty == "" ? 0.ToString() : HOrderNeedQty)}, {(HCompleteQty == "" ? 0.ToString() : HCompleteQty)},getdate())");
                            $" {(HSeOrderBillQty == "" ? 0.ToString() : HSeOrderBillQty)}, {(HOrderNeedQty == "" ? 0.ToString() : HOrderNeedQty)}, {(HCompleteQty == "" ? 0.ToString() : HCompleteQty)},getdate()," +
                            $" {HMainSourceInterID},{HMainSourceEntryID})");
                    }
                    int SumDay = 31; //动态两月之差 DateTime.Now.AddMonths(1).AddDays(-1).Subtract(DateTime.Now).Days;
WebAPI/Controllers/SCGL/Èռƻ®¹ÜÀí/Sc_WorkBillSortBillController.cs
@@ -91,7 +91,7 @@
            string user = sArray[3].ToString();
            try
            {
                if (!DBUtility.ClsPub.Security_Log("Sc_WorkBillSortBill_Edit", 1, false, user))
                if (!DBUtility.ClsPub.Security_Log("Sc_WorkBillSortBill_Edit", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
@@ -140,6 +140,18 @@
                }
                else if (OperationType == 3)
                {
                    ds = oCN.RunProcReturn($"select * from  Sc_WorkBillSortBillMain where HMainSourceInterID={omdelMian.HMainSourceInterID}" +
                      $" and HMainSourceEntryID={omdelMian.HMainSourceEntryID} and HICMOBillNo='{omdelMian.HICMOBillNo}' and HICMOEntrySEQ={omdelMian.HICMOEntrySEQ} and HSourceID={omdelMian.HSourceID}", "Sc_WorkBillSortBillMain");
                    if ((ds.Tables[0].Rows.Count == 1 && ds.Tables[0].Rows[0]["HInterID"].ToString() != omdelMian.HInterID.ToString()))
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "生产资源有重复,请修改!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //修改
                    oCN.RunProc($"update Sc_WorkBillSortBillMain set HDate='{omdelMian.HDate}',HUpDater='{omdelMian.HMaker}',HUpDateDate=GETDATE()" +
                                  $", HRemark='{omdelMian.HRemark}', HPrintQty={(omdelMian.HPrintQty == null ? 0 : omdelMian.HPrintQty)}" +