| | |
| | | LogService.CustomWriteLog("2:", DateTime.Now.ToString("yyyy-MM-dd")); |
| | | int TrueCount = 0, SumCount = 0; |
| | | LogService.CustomWriteLog("list.Count:"+ list.Count, DateTime.Now.ToString("yyyy-MM-dd")); |
| | | |
| | | string sReturn = ""; |
| | | oSystemParameter.ShowBill(ref sReturn); |
| | | |
| | | for (int i = 0; i < list.Count; i++) |
| | | { |
| | | TrueCount = 0; |
| | |
| | | var HMainSourceEntryID = list[i]["æºååå
ç "].ToString(); |
| | | var HPlanQty = list[i]["è®¡åæ°é"].ToString(); |
| | | var HEmpID = list[i]["HEmpID"].ToString(); |
| | | var HWorkQty = list[i]["å°æ¶äº§è½"].ToString(); |
| | | |
| | | LogService.CustomWriteLog("2.05:" + i, DateTime.Now.ToString("yyyy-MM-dd")); |
| | | |
| | | if (HSourceID == ""|| HSourceID == "0") |
| | | if (oSystemParameter.omodel.WMS_CampanyName != "æ·»åº·ç§æ") //ç³»ç»åæ° å®¢æ·å®å¶ååç§° 空ç½ä¸ºéç¨ |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = $"第{i + 1}è¡çäº§èµæºä¸è½ä¸ºç©º!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (HSourceID == "" || HSourceID == "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = $"第{i + 1}è¡çäº§èµæºä¸è½ä¸ºç©º!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | ds = oCN.RunProcReturn($"select * from Sc_WorkBillSortBillMain where HMainSourceInterID={HMainSourceInterID}" + |
| | | $" and HMainSourceEntryID={HMainSourceEntryID} and HICMOBillNo='{HICMOBillNo}' and HICMOEntrySEQ={HICMOEntrySEQ} and HSourceID={HSourceID}", "Sc_WorkBillSortBillMain"); |
| | |
| | | " HOrderNeedQty, HSplitQty, HDayPlanSumQty,HPlanBeginDate," + |
| | | "HSeOrderBillNo,HICMOBillType,HSourceStockInQty,HLeftPlanQty,HOrderLev,HPreparatDate," + |
| | | "HMainSourceInterID,HMainSourceEntryID,HICMOInterID_Sec,HICMOEntryID_Sec,HPlanQty" + |
| | | ",HICMOInterID,HICMOEntryID,HPlanEndDate,HEmpID)values" + |
| | | ",HICMOInterID,HICMOEntryID,HPlanEndDate,HEmpID,HWorkQty)values" + |
| | | $"({HInterID},'{HBillNo}',{DateTime.Now.Year},{DateTime.Now.Month},'{BillType}'," + |
| | | $"'{BillType}',GETDATE(),1,'{user}',getdate(),'{HICMOBillNo}','{HOrderType}'," + |
| | | $"{(HICMOEntrySEQ == "" ? 0.ToString() : HICMOEntrySEQ)},{(HWorkShopID == "" ? 0.ToString() : HWorkShopID)},{(HSourceID == "" ? 0.ToString() : HSourceID)}, {(HYX == "" ? 0.ToString() : HYX)}, {(HProdORGID == "" ? 0.ToString() : HProdORGID)}," + |
| | |
| | | $" 0, {(HSplitQty == "" ? 0.ToString() : HSplitQty)}, {(HDayPlanSumQty == "" ? 0.ToString() : HDayPlanSumQty)},'{HPlanBeginDate}'," + |
| | | $"'{HSeOrderBillNo}','{HICMOBillType}',{(HSourceStockInQty == "" ? 0.ToString() : HSourceStockInQty)},{(HLeftPlanQty == "" ? 0.ToString() : HLeftPlanQty)},'{HOrderLev}',getdate()," + |
| | | $"{HMainSourceInterID},{HMainSourceEntryID},{HMainSourceInterID},{HMainSourceEntryID},{HPlanQty}," + |
| | | $"{HMainSourceInterID},{HMainSourceEntryID},'{HPlanEndDate}','{HEmpID}')"; |
| | | $"{HMainSourceInterID},{HMainSourceEntryID},'{HPlanEndDate}','{HEmpID}','{HWorkQty}')"; |
| | | |
| | | //LogService.Write("sql:" + sql); |
| | | //主表 |
| | |
| | | var HSplitQty = list[i]["æåæ°é"].ToString(); |
| | | |
| | | LogService.CustomWriteLog("2.1:"+i, DateTime.Now.ToString("yyyy-MM-dd")); |
| | | |
| | | if (HSourceID == "" || HSourceID == "0") |
| | | |
| | | if (oSystemParameter.omodel.WMS_CampanyName != "æ·»åº·ç§æ") //ç³»ç»åæ° å®¢æ·å®å¶ååç§° 空ç½ä¸ºéç¨ |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = $"第{i + 1}è¡çäº§èµæºä¸è½ä¸ºç©º!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | if (HSourceID == "" || HSourceID == "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = $"第{i + 1}è¡çäº§èµæºä¸è½ä¸ºç©º!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | var str = 0; |
| | | if (!int.TryParse(HYX, out str)) |
| | | { |
| | |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region ç产æ¥è®¡åå¹³å° æ ¹æ®è½¦é´æ·»å æªæäº§ç产订å |
| | | [Route("JIT_DayPlanPlatFormBill/JIT_ICMOBillListByDept")] |
| | | [HttpGet] |
| | | public object JIT_ICMOBillListByDept(string HDeptID) |
| | | { |
| | | try |
| | | { |
| | | //æ¥è¯¢éæ©è½¦é´ä¸æªæäº§è¿çç产订åä¿¡æ¯ï¼æ·»åº·ç§æ--ç产订åç¶æä¸ºä¸è¾¾ï¼ |
| | | ds = oCN.RunProcReturn($"exec h_p_JIT_ICMOBillListByDept '{HDeptID}'", "h_p_JIT_ICMOBillListByDept"); |
| | | |
| | | if (ds.Tables[0].Rows.Count > 0 && ds != null) |
| | | { |
| | | //æ°æ®è¡¨æ ¼æ·»å å¨ææ¥æ |
| | | for (int j = 1; j <= 31; j++) |
| | | { |
| | | ds.Tables[0].Columns.Add(DateTime.Now.AddDays(j - 1).ToString("yyyy-MM-dd"), typeof(Int32)); |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ¥æ æ°æ®ï¼å½åæé车é´ä¸ææ æªæäº§ä¸è®¢åç¶æä¸ºä¸è¾¾çç产订åä¿¡æ¯ï¼"; |
| | | objJsonResult.data = ""; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | } |
| | | } |