yangle
2022-12-28 eb22fa59bce6c5e1a90f2e6613847c4b9e5e4df3
WebAPI/Controllers/SCGL/Èռƻ®¹ÜÀí/JIT_DayPlanPlatFormImportController.cs
@@ -36,14 +36,13 @@
                file.SaveAs(ExcelPath);
                NpoiHelper np = new NpoiHelper();
                DataSet ExcelDs = np.ReadExcel(ExcelPath, 1);
                DataSet ExcelDs = np.ReadExcel(ExcelPath, 1,1,"0");
                //删除文件
                File.Delete(ExcelPath);
                //创建临时表
                DataTable tb2 = new DataTable("dt2");
                DataTable tb3 = new DataTable("dt3");
                //添加列名
                for (int i = 0; i < ExcelDs.Tables[0].Columns.Count; i++)
@@ -71,8 +70,6 @@
                    }
                    tb2.Rows.Add(row);
                }
                ExcelDs.Tables.Add(tb2);
                var error = "";
                var ErrorResult = "";
@@ -260,6 +257,7 @@
                        HInterID = DBUtility.ClsPub.CreateBillID_Prod(BillType, ref DBUtility.ClsPub.sExeReturnInfo);//获得一个新的id
                        var HICMOBillNo = list[i]["生产订单号*"].ToString();
                        var HICMOEntrySEQ = list[i]["生产订单明细行号*"].ToString();
                        var HProdORGID = list[i]["组织编码*"].ToString();
                        var HWorkShopID = list[i]["HWorkShopID"].ToString();
                        var HSourceID = list[i]["HSourceID"].ToString();
                        var HYX = list[i]["优先级"].ToString();
@@ -294,13 +292,13 @@
                            "HICMOEntrySEQ,HWorkShopID,HSourceID, HYX, HEmpID," +
                            " HMaterID, HMaterName, HMaterModel, HUnitID, HBatchNo," +
                            " HSeOrderBillQty, HPlanQty, HCompleteQty,HPreparatDate," +
                            "HMainSourceInterID,HMainSourceEntryID)values" +
                            "HMainSourceInterID,HMainSourceEntryID,HProdORGID,HICMOInterID_Sec,HICMOEntryID_Sec)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)}, {(HPlanQty == "" ? 0.ToString() : HPlanQty)}, {(HCompleteQty == "" ? 0.ToString() : HCompleteQty)},getdate()," +
                            $" {HMainSourceInterID},{HMainSourceEntryID})");
                            $" {HMainSourceInterID},{HMainSourceEntryID},{HProdORGID}, {HMainSourceInterID},{HMainSourceEntryID})");
                    }
                    int SumDay = 31; //动态两月之差 DateTime.Now.AddMonths(1).AddDays(-1).Subtract(DateTime.Now).Days;
@@ -378,7 +376,7 @@
            if (count != 1)
            {
                //插入子表
                oCN.RunProc("insert into Sc_WorkBillSortBillSub(HInterID,HEntryID," +
                oCN.RunProc("insert into Sc_WorkBillSortBillSub(HInterID,HSEQ," +
                    "HMasterDate,HQty)" +
                            $"values({HInterID}, {(ds.Tables[0].Rows.Count + 1)}," +
                            $" '{date}', {HQTY})");