| | |
| | | tb2.Columns.Add("ICMOBillHInterID", typeof(Int32));//ç产订å主id |
| | | tb2.Columns.Add("ICMOBillHEntryID", typeof(Int32));//ç产订ååid |
| | | tb2.Columns.Add("HProdORGID", typeof(Int32));//ç»ç»id |
| | | tb2.Columns.Add("HSeOrderBillNo", typeof(string));//éå®è®¢åå· |
| | | |
| | | //æ·»å æ°æ® |
| | | for (int i = 1; i < ExcelDs.Tables[0].Rows.Count; i++) |
| | |
| | | tb2.Rows[i]["ICMOBillHInterID"] = ds.Tables[0].Rows[0]["hmainid"].ToString();//ç产订å主id |
| | | tb2.Rows[i]["ICMOBillHEntryID"] = ds.Tables[0].Rows[0]["HEntryID"].ToString();//ç产订ååid |
| | | tb2.Rows[i]["çäº§è®¢åæ°é"] = ds.Tables[0].Rows[0]["ç产任å¡åæ°é"].ToString();//çäº§è®¢åæ°é |
| | | tb2.Rows[i]["HSeOrderBillNo"] = ds.Tables[0].Rows[0]["éå®è®¢åå·"].ToString();//éå®è®¢åå· |
| | | } |
| | | |
| | | ds = oCN.RunProcReturn("select * from h_v_JIT_Sc_WorkBillSortBillList " + |
| | |
| | | } |
| | | |
| | | |
| | | int TrueCount = 0, SumCount = 0; |
| | | |
| | | |
| | | for (int i = 0; i < list.Count; i++) |
| | | { |
| | | int TrueCount = 0, SumCount = 0; |
| | | long HInterID = 0; |
| | | var HBillNo = ""; |
| | | if (list[i]["åæ®å·"].ToString() == "" && list[i]["hmainid"].ToString() == "") |
| | |
| | | var HDate = omdelMian.HDate; |
| | | var HMainSourceInterID = list[i]["ICMOBillHInterID"].ToString(); |
| | | var HMainSourceEntryID = list[i]["ICMOBillHEntryID"].ToString(); |
| | | var HSeOrderBillNo = list[i]["HSeOrderBillNo"].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"); |
| | | string sql = $"select * from Sc_WorkBillSortBillMain where HMainSourceInterID={HMainSourceInterID}" + |
| | | $" and HMainSourceEntryID={HMainSourceEntryID} and HICMOBillNo='{HICMOBillNo}' and HICMOEntrySEQ={HICMOEntrySEQ} and HSourceID={HSourceID}"; |
| | | LogService.Write("sql:" + sql); |
| | | ds = oCN.RunProcReturn(sql, "Sc_WorkBillSortBillMain"); |
| | | if (ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | |
| | | "HICMOEntrySEQ,HWorkShopID,HSourceID, HYX, HEmpID," + |
| | | " HMaterID, HMaterName, HMaterModel, HUnitID, HBatchNo," + |
| | | " HSeOrderBillQty, HPlanQty, HCompleteQty,HPreparatDate," + |
| | | "HMainSourceInterID,HMainSourceEntryID,HProdORGID,HICMOInterID_Sec,HICMOEntryID_Sec)values" + |
| | | "HMainSourceInterID,HMainSourceEntryID,HProdORGID,HICMOInterID_Sec,HICMOEntryID_Sec" + |
| | | ",HSeOrderBillNo)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})"); |
| | | $" {HMainSourceInterID},{HMainSourceEntryID},{HProdORGID}, {HMainSourceInterID},{HMainSourceEntryID}" + |
| | | $",'{HSeOrderBillNo}')"); |
| | | } |
| | | |
| | | int SumDay = 31; //卿䏤æä¹å·® DateTime.Now.AddMonths(1).AddDays(-1).Subtract(DateTime.Now).Days; |
| | | |
| | | for (int j = 0; j < SumDay; j++) |
| | | { |
| | | LogService.Write("1:" + list[i][DateTime.Now.AddDays(j).ToString("yyyy-MM-dd")].ToString()); |
| | | LogService.Write("2:" + DateTime.Now.AddDays(j).ToString("yyyy-MM-dd")); |
| | | //主表åè¡¨é½ææ°æ® |
| | | if (list[i][DateTime.Now.AddDays(j).ToString("yyyy-MM-dd")].ToString() != "") |
| | | { |
| | |
| | | objJsonResult = AddBillSub(HInterID.ToString(), HBillNo, DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd").ToString()), 0); |
| | | } |
| | | } |
| | | if (TrueCount != SumCount) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = objJsonResult.Message; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | if (TrueCount != SumCount) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = objJsonResult.Message; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | |
| | | { |
| | | //è·åè¡¨æ ¼æ°æ® |
| | | ds = oCN.RunProcReturn($"select * from h_v_JIT_Sc_WorkBillSortBillList where åæ®å·='{HBillNo}'", "h_v_JIT_Sc_WorkBillSortBillList"); |
| | | |
| | | int count = 0; |
| | | if (ds.Tables[0].Rows.Count > 0) |
| | | { |