| | |
| | | var HBillNo = ""; |
| | | if (list[i]["åæ®å·"].ToString() == "" && list[i]["hmainid"].ToString() == "") |
| | | { |
| | | HBillNo = DBUtility.ClsPub.CreateBillCode_Prod(BillType, ref DBUtility.ClsPub.sExeReturnInfo, true);//è·å¾ä¸ä¸ªæ°çåæ®å· |
| | | HInterID = DBUtility.ClsPub.CreateBillID_Prod(BillType, ref DBUtility.ClsPub.sExeReturnInfo);//è·å¾ä¸ä¸ªæ°çid |
| | | |
| | | var HICMOBillNo = list[i]["ç产订åå·"].ToString(); |
| | | var HOrderType = list[i]["订åç±»å"].ToString(); |
| | | var HICMOEntrySEQ = list[i]["ç产订åæç»è¡å·"].ToString(); |
| | |
| | | var HSourceStockInQty = list[i]["产线å
¥åºæ°é"].ToString(); |
| | | var HLeftPlanQty = list[i]["æªææ°é"].ToString(); |
| | | var HOrderLev = list[i]["订åç级"].ToString(); |
| | | var HMainSourceInterID = list[i]["æºå主å
ç "].ToString(); |
| | | var HMainSourceEntryID = list[i]["æºååå
ç "].ToString(); |
| | | |
| | | if (HSourceID=="") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = $"第{i+1}è¡çäº§èµæºä¸è½ä¸ºç©º!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | ds = oCN.RunProcReturn($"select * from Sc_WorkBillSortBillMain where HMainSourceEntryID={HMainSourceEntryID}" + |
| | | $" 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; |
| | | } |
| | | |
| | | //æ°å¢åæ®å· id |
| | | HBillNo = DBUtility.ClsPub.CreateBillCode_Prod(BillType, ref DBUtility.ClsPub.sExeReturnInfo, true);//è·å¾ä¸ä¸ªæ°çåæ®å· |
| | | HInterID = DBUtility.ClsPub.CreateBillID_Prod(BillType, ref DBUtility.ClsPub.sExeReturnInfo);//è·å¾ä¸ä¸ªæ°çid |
| | | |
| | | //主表 |
| | | oCN.RunProc("insert into Sc_WorkBillSortBillMain(HInterID,HBillNo,HYear,HPeriod,HBillType," + |
| | |
| | | $"'{HSeOrderBillNo}','{HICMOBillType}',{(HSourceStockInQty == "" ? 0.ToString() : HSourceStockInQty)},{(HLeftPlanQty == "" ? 0.ToString() : HLeftPlanQty)},'{HOrderLev}',getdate())"); |
| | | } |
| | | |
| | | oCN.RunProc($"update Sc_WorkBillSortBillMain set HDayPlanSumQty={list[i]["æ¥è®¡åæ°éæ»é"].ToString()} where HInterID={list[i]["hmainid"].ToString()} and HBillNo='{list[i]["åæ®å·"].ToString()}'"); |
| | | |
| | | int SumDay = 31; //卿䏤æä¹å·® DateTime.Now.AddMonths(1).AddDays(-1).Subtract(DateTime.Now).Days; |
| | | |
| | | for (int j = 0; j < SumDay; j++) |