| | |
| | | tb2.Columns.Add("åæ®å·", typeof(string)); |
| | | tb2.Columns.Add("HWorkShopID", typeof(Int32));//çäº§è½¦é´ |
| | | tb2.Columns.Add("HEmpID", typeof(Int32));//èå |
| | | tb2.Columns.Add("åå·¥", typeof(string));//èå |
| | | 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 |
| | | tb2.Columns.Add("HProdORGID", typeof(Int32));//ç»ç»id |
| | | |
| | | //æ·»å æ°æ® |
| | | for (int i = 1; i < ExcelDs.Tables[0].Rows.Count; i++) |
| | |
| | | ds = oCN.RunProcReturn(sql1, "h_v_IF_ICMOBillList"); |
| | | |
| | | if (ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | error += $"没æç产订åä¿¡æ¯ï¼ç产订åå·:{ tb2.Rows[i]["ç产订åå·*"].ToString()},ç产车é´ç¼ç :{tb2.Rows[i]["ç产车é´ç¼ç *"].ToString()}" + |
| | | $",ç产订åæç»è¡å·:{ tb2.Rows[i]["ç产订åæç»è¡å·*"].ToString()},ç©æç¼ç :{ tb2.Rows[i]["ç©æç¼ç *"].ToString()}"; |
| | | $",ç产订åæç»è¡å·:{ tb2.Rows[i]["ç产订åæç»è¡å·*"].ToString()},ç©æç¼ç :{ tb2.Rows[i]["ç©æç¼ç *"].ToString()}"; |
| | | } |
| | | |
| | | if (error.Length > 0) |
| | | { |
| | |
| | | tb2.Rows[i]["HSourceID"] = ds.Tables[0].Rows[0]["HSourceID"].ToString(); |
| | | tb2.Rows[i]["HEmpID"] = ds.Tables[0].Rows[0]["HEmpID"].ToString(); |
| | | tb2.Rows[i]["åå·¥ç¼ç "] = ds.Tables[0].Rows[0]["èå代ç "].ToString(); |
| | | tb2.Rows[i]["åå·¥"] = ds.Tables[0].Rows[0]["èå"].ToString(); |
| | | tb2.Rows[i]["HUnitID"] = ds.Tables[0].Rows[0]["HUnitID"].ToString(); |
| | | tb2.Rows[i]["计éåä½"] = ds.Tables[0].Rows[0]["计éåä½"].ToString(); |
| | | tb2.Rows[i]["æ¹æ¬¡å·"] = ds.Tables[0].Rows[0]["æ¹æ¬¡"].ToString(); |
| | |
| | | { |
| | | //åå·¥ |
| | | ds = oCN.RunProcReturn($"select * from Gy_Employee where HNumber='{tb2.Rows[i]["åå·¥ç¼ç "].ToString()}'", "Gy_Employee"); |
| | | if (ds.Tables[0].Rows.Count > 0) |
| | | tb2.Rows[i]["åå·¥ç¼ç "] = ds.Tables[0].Rows[0]["HItemID"].ToString(); |
| | | if (ds.Tables[0].Rows.Count > 0) { |
| | | tb2.Rows[i]["HEmpID"] = ds.Tables[0].Rows[0]["HItemID"].ToString(); |
| | | tb2.Rows[i]["åå·¥"] = ds.Tables[0].Rows[0]["HName"].ToString(); |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = $"第{i + 1}è¡,åå·¥æ¥æ æ°æ®!"; |
| | | objJsonResult.data = tb2; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //计éåä½ |
| | | ds = oCN.RunProcReturn($"select * from Gy_Unit where HNumber='{tb2.Rows[i]["计éåä½"].ToString()}'", "Gy_Unit"); |
| | | if (ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | tb2.Rows[i]["HUnitID"] = ds.Tables[0].Rows[0]["HItemID"].ToString(); |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = $"第{i + 1}è¡,计éå使¥æ æ°æ®!"; |
| | | objJsonResult.data = tb2; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //çäº§èµæº |
| | | ds = oCN.RunProcReturn($"select * from Gy_Source where HNumber='{tb2.Rows[i]["çäº§èµæºç¼ç *"].ToString()}'", "Gy_Source"); |
| | | if (ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | tb2.Rows[i]["HSourceID"] = ds.Tables[0].Rows[0]["HItemID"].ToString(); |
| | | } |
| | | else { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = $"第{i+1}è¡,çäº§èµæºæ¥æ æ°æ®!"; |
| | | objJsonResult.data = tb2; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | //ç»ç» |
| | | ds = oCN.RunProcReturn($"select * from Xt_ORGANIZATIONS where HNumber='{tb2.Rows[i]["ç»ç»ç¼ç *"].ToString()}'", "Xt_ORGANIZATIONS"); |
| | | if (ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | tb2.Rows[i]["HProdORGID"] = ds.Tables[0].Rows[0]["HItemID"].ToString(); |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = $"第{i + 1}è¡,ç»ç»æ¥æ æ°æ®!"; |
| | | objJsonResult.data = tb2; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | |
| | | 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 HProdORGID = list[i]["HProdORGID"].ToString(); |
| | | var HWorkShopID = list[i]["HWorkShopID"].ToString(); |
| | | var HSourceID = list[i]["HSourceID"].ToString(); |
| | | var HYX = list[i]["ä¼å
级"].ToString(); |
| | |
| | | "HICMOEntrySEQ,HWorkShopID,HSourceID, HYX, HEmpID," + |
| | | " HMaterID, HMaterName, HMaterModel, HUnitID, HBatchNo," + |
| | | " HSeOrderBillQty, HPlanQty, HCompleteQty,HPreparatDate," + |
| | | "HMainSourceInterID,HMainSourceEntryID,HProdORGID)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},{HProdORGID})"); |
| | | $" {HMainSourceInterID},{HMainSourceEntryID},{HProdORGID}, {HMainSourceInterID},{HMainSourceEntryID})"); |
| | | } |
| | | |
| | | int SumDay = 31; //卿䏤æä¹å·® DateTime.Now.AddMonths(1).AddDays(-1).Subtract(DateTime.Now).Days; |