| | |
| | | } |
| | | } |
| | | |
| | | [Route("JIT_DayPlanPlatFormBill/JIT_DayPlanPlatFormBillListExtendMakeDate")] |
| | | [HttpGet] |
| | | public object JIT_DayPlanPlatFormBillListExtendMakeDate(string sWhere, string user) |
| | | { |
| | | try |
| | | { |
| | | //æ¥çæé |
| | | if (!DBUtility.ClsPub.Security_Log("Sc_WorkBillSortBill_Query", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ æ¥çæéï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | List<object> columnNameList = new List<object>(); //å®ä¹å£°æåé ï¼æéè¿ new List<object>()å建ç å®ä¾ï¼èµå¼ç»åé |
| | | omdelMian = JsonConvert.DeserializeObject<Sc_WorkBillSortBillMain>(sWhere); |
| | | |
| | | ds = oCN.RunProcReturn($"exec h_p_JIT_Sc_WorkBillSortBill_Query_ExtendMakeDate '{omdelMian.HPlanBeginDate}',{(omdelMian.HProdORGID == null ? 0 : omdelMian.HProdORGID)},'{omdelMian.HSeOrderBillNo}'" + |
| | | $",'{omdelMian.HPlanEndDate.AddDays(1)}',{omdelMian.HMaterID},'{omdelMian.HICMOBillNo}',{omdelMian.HWorkShopID}" + |
| | | $",'{omdelMian.HMastersDate}','{ omdelMian.HMakeDate }','{omdelMian.sWheres}'", "h_p_JIT_Sc_WorkBillSortBill_QueryExtendMakeDate"); |
| | | |
| | | |
| | | foreach (DataColumn col in ds.Tables[0].Columns)//éådsä¸ç¬¬ä¸ä¸ªè¡¨ï¼Tables[0]ï¼çææåï¼Columnsï¼æ¯æ¬¡å¾ªç¯ä¸ï¼colåé伿æå½ååçå¼ç¨ |
| | | { |
| | | Type dataType = col.DataType; //è·åå½åæ°æ®ç±»åä¼ å
¥ èªå®ä¹åédatadataType |
| | | string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; //åç¬¦ä¸²æ¼æ¥ // å°åååæ°æ®ç±»åä¿¡æ¯æ¼æ¥æä¸ä¸ªJSONæ ¼å¼çå符串 |
| | | columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//è·åå°DataColumnå对象çåå |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | objJsonResult.list = columnNameList; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®IDæ¥è¯¢ é½å¥ç¶æ å éå®ç¶æ |
| | | /// </summary> |
| | |
| | | var HEmpID = list[i]["HEmpID"].ToString(); |
| | | var HWorkQty = list[i]["å°æ¶äº§è½"].ToString(); |
| | | var HSourceName = list[i]["çäº§èµæº"].ToString(); |
| | | var HWorkQty_ProdLine = list[i]["产线æ»äº§è½"].ToString(); |
| | | var HMouldID = list[i]["HMouldID"].ToString(); |
| | | //var HWorkQty_ProdLine = list[i]["产线æ»äº§è½"].ToString(); |
| | | |
| | | LogService.CustomWriteLog("2.05:" + i, DateTime.Now.ToString("yyyy-MM-dd")); |
| | | |
| | | if (oSystemParameter.omodel.WMS_CampanyName != "æ·»åº·ç§æ") //ç³»ç»åæ° å®¢æ·å®å¶ååç§° 空ç½ä¸ºéç¨ |
| | | if (oSystemParameter.omodel.WMS_CampanyName != "æ·»åº·ç§æ"&& oSystemParameter.omodel.WMS_CampanyName != "ä¸å") //ç³»ç»åæ° å®¢æ·å®å¶ååç§° 空ç½ä¸ºéç¨ |
| | | { |
| | | if (HSourceID == "" || HSourceID == "0") |
| | | { |
| | |
| | | " HOrderNeedQty, HSplitQty, HDayPlanSumQty,HPlanBeginDate," + |
| | | "HSeOrderBillNo,HICMOBillType,HSourceStockInQty,HLeftPlanQty,HOrderLev,HPreparatDate," + |
| | | "HMainSourceInterID,HMainSourceEntryID,HICMOInterID_Sec,HICMOEntryID_Sec,HPlanQty" + |
| | | ",HICMOInterID,HICMOEntryID,HPlanEndDate,HEmpID,HWorkQty,HSourceName,HWorkQty_ProdLine)values" + |
| | | ",HICMOInterID,HICMOEntryID,HPlanEndDate,HEmpID,HWorkQty,HSourceName,HMouldID)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}','{HWorkQty}','{HSourceName}','{HWorkQty_ProdLine}')"; |
| | | $"{HMainSourceInterID},{HMainSourceEntryID},'{HPlanEndDate}','{HEmpID}','{HWorkQty}','{HSourceName}','{HMouldID}')"; |
| | | |
| | | //LogService.Write("sql:" + sql); |
| | | //主表 |
| | |
| | | var HOrderLev = list[i]["订åç级"].ToString(); |
| | | var HPlanQty = list[i]["è®¡åæ°é"].ToString(); |
| | | var HEmpID = list[i]["HEmpID"].ToString(); |
| | | var HMouldID = list[i]["HMouldID"].ToString(); |
| | | |
| | | LogService.CustomWriteLog("2.1:"+i, DateTime.Now.ToString("yyyy-MM-dd")); |
| | | |
| | | if (oSystemParameter.omodel.WMS_CampanyName != "æ·»åº·ç§æ") //ç³»ç»åæ° å®¢æ·å®å¶ååç§° 空ç½ä¸ºéç¨ |
| | | if (oSystemParameter.omodel.WMS_CampanyName != "æ·»åº·ç§æ" && oSystemParameter.omodel.WMS_CampanyName != "ä¸å") //ç³»ç»åæ° å®¢æ·å®å¶ååç§° 空ç½ä¸ºéç¨ |
| | | { |
| | | if (HSourceID == "" || HSourceID == "0") |
| | | { |
| | |
| | | |
| | | oCN.RunProc($"update Sc_WorkBillSortBillMain set HSourceID={(HSourceID == "" ? 0.ToString() : HSourceID)},HYX={HYX}" + |
| | | $",HWorkQty={HWorkQty},HProdTimes={HProdTimes},HReadyTimes={HReadyTimes},HLastBeginDate='{HLastBeginDate}'" + |
| | | $",HLastEndDate='{HLastEndDate}',HOrderNeedQty={HOrderNeedQty},HOrderCommitDate='{HOrderCommitDate}',HPlanEndDate='{HPlanEndDate}',HSplitQty={HSplitQty},HSourceName='{HSourceName}',HWorkQty_ProdLine={HWorkQty_ProdLine}" + |
| | | $",HLastEndDate='{HLastEndDate}',HOrderNeedQty={HOrderNeedQty},HOrderCommitDate='{HOrderCommitDate}',HPlanEndDate='{HPlanEndDate}',HSplitQty={HSplitQty},HSourceName='{HSourceName}',HWorkQty_ProdLine={HWorkQty_ProdLine},HMouldID={HMouldID}" + |
| | | $" where HInterID={list[i]["hmainid"].ToString()} and HBillNo='{list[i]["åæ®å·"].ToString()}'"); |
| | | } |
| | | } |
| | |
| | | for (int j = 0; j < SumDay; j++) |
| | | { |
| | | //主表åè¡¨é½ææ°æ® |
| | | if (list[i][DateTime.Now.AddDays(j).ToString("yyyy-MM-dd")].ToString() != "") |
| | | if (list[i][DateTime.Now.AddDays(j).ToString("yyyy-MM-dd")].ToString() != ""&& Math.Round(double.Parse(list[i][DateTime.Now.AddDays(j).ToString("yyyy-MM-dd")].ToString()),1)>0) |
| | | { |
| | | SumCount += 1; |
| | | ////ä¿åå表 |
| | |
| | | |
| | | #endregion |
| | | |
| | | #region ç产æ¥è®¡åå¹³å° è¦æè¿ç® |
| | | |
| | | [Route("JIT_DayPlanPlatFormBill/JIT_YLYS")] |
| | | [HttpGet] |
| | | public object JIT_YLYS(string sWhere, string user) |
| | | { |
| | | try |
| | | { |
| | | omdelMian = JsonConvert.DeserializeObject<Sc_WorkBillSortBillMain>(sWhere); |
| | | string HWorkShopID = omdelMian.HWorkShopID.ToString(); |
| | | var HStockOrgID = omdelMian.HProdORGID; |
| | | |
| | | ds = oCN.RunProcReturn("exec h_p_JIT_WorkDemandPlanBill_MOMaterReady " + HWorkShopID.ToString() + ",'" + user + "'," + HStockOrgID.ToString(), "h_p_JIT_WorkDemandPlanBill_MOMaterReady"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "è¦æè¿ç®åçé误ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else if (DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0]["HBack"]) == 1) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HRemark"]); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HRemark"]); //è¿ç®æå |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "è¦æè¿ç®å¤±è´¥ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region ç产æ¥è®¡åå¹³å° éå® |
| | | [Route("JIT_DayPlanPlatFormBill/JIT_DayPlanPlatFormBillHLockedDay")] |
| | | [HttpGet] |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region ç产æ¥è®¡åå¹³å° æ°æ®åå¤ è®¾ç½®ä»»å¡åç¸å
³ä¿¡æ¯(ä¸å) |
| | | [Route("JIT_DayPlanPlatFormBill/ReadyData_SS")] |
| | | [HttpGet] |
| | | public object ReadyData_SS(string SWhere) |
| | | { |
| | | try |
| | | { |
| | | var list = SWhere.Split(','); |
| | | DataTable dt = new DataTable("date"); |
| | | dt.Columns.Add("HICMOInterID", typeof(string)); |
| | | dt.Columns.Add("HICMOEntryID", typeof(string)); |
| | | dt.Columns.Add("å°æ¶äº§è½", typeof(string)); |
| | | dt.Columns.Add("çäº§å¨æ", typeof(decimal)); |
| | | dt.Columns.Add("å¼å·¥ä½é", typeof(decimal)); |
| | | dt.Columns.Add("æè¿å¼å·¥æ¥æ", typeof(DateTime)); |
| | | dt.Columns.Add("æè¿å®å·¥æ¥æ", typeof(DateTime)); |
| | | dt.Columns.Add("订åéæ±æ°é", typeof(decimal)); |
| | | dt.Columns.Add("订å交货æ", typeof(DateTime)); |
| | | dt.Columns.Add("HSourceID", typeof(decimal)); |
| | | dt.Columns.Add("çäº§èµæº", typeof(string)); |
| | | |
| | | for (int i = 0; i < list.Length; i++) |
| | | { |
| | | string HICMOInterID = list[i].Split(';')[0].ToString(); |
| | | string HICMOEntryID = list[i].Split(';')[1].ToString(); |
| | | string HSourceID = list[i].Split(';')[2].ToString(); |
| | | |
| | | Thread.Sleep(100); |
| | | ds = oCN.RunProcReturn("exec h_p_Sc_GetInfoByICMOBillNo " + HICMOInterID + "," + HICMOEntryID + "," + HSourceID, "h_p_Sc_GetInfoByICMOBillNo"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | |
| | | } |
| | | else |
| | | { |
| | | DataRow dr = dt.NewRow(); |
| | | dr["HSourceID"] = DBUtility.ClsPub.isSingle(ds.Tables[0].Rows[0]["HSourceID"]); |
| | | dr["çäº§èµæº"] = ds.Tables[0].Rows[0]["çäº§èµæº"].ToString(); |
| | | dr["å°æ¶äº§è½"] = DBUtility.ClsPub.isSingle(ds.Tables[0].Rows[0]["产è½"]); |
| | | dr["çäº§å¨æ"] = DBUtility.ClsPub.isSingle(ds.Tables[0].Rows[0]["çäº§å¨æ"]); |
| | | dr["å¼å·¥ä½é"] = DBUtility.ClsPub.isSingle(ds.Tables[0].Rows[0]["å¼å·¥ä½é"]); |
| | | dr["æè¿å¼å·¥æ¥æ"] = DBUtility.ClsPub.isDate(ds.Tables[0].Rows[0]["æè¿å¼å·¥æ¥æ"]); |
| | | dr["æè¿å®å·¥æ¥æ"] = DBUtility.ClsPub.isDate(ds.Tables[0].Rows[0]["æè¿å®å·¥æ¥æ"]); |
| | | dr["订åéæ±æ°é"] = DBUtility.ClsPub.isSingle(ds.Tables[0].Rows[0]["订åéæ±æ°"]); |
| | | dr["订å交货æ"] = DBUtility.ClsPub.isDate(ds.Tables[0].Rows[0]["订å交货æ"]); |
| | | dr["HICMOInterID"] = DBUtility.ClsPub.isSingle(ds.Tables[0].Rows[0]["HICMOInterID"]); |
| | | dr["HICMOEntryID"] = DBUtility.ClsPub.isSingle(ds.Tables[0].Rows[0]["HICMOEntryID"]); |
| | | dt.Rows.Add(dr); |
| | | } |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = dt; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region 缺æåææ¥è¡¨ |
| | | public class MaterialShorAnalysis |
| | | { |