生产订单编辑 加 客户规格型号 客户物料名称
客户订单报表增加两字段(业务状态、备注取生产订单),报表增加两个按钮,可以去变更两个字段的值。(业务状态修改成完工之后,报表就显示ok,选择其中一行变更后反写到生产订单当中)
| | |
| | | public double HWidth; //å¹
宽 |
| | | public double HWeight; //å
é |
| | | public string HColorRemark; //æè²è¦æ± |
| | | |
| | | public string HCusMaterName; //客æ·ç©æåç§° |
| | | public string HCusModel; //客æ·è§æ ¼åå· |
| | | |
| | | } |
| | | } |
| | |
| | | { |
| | | string sql1 = "select * from h_v_Gy_RoutingBillList where 1 = 1 "; |
| | | //客æ·èªå®ä¹ |
| | | if (oSystemParameter.omodel.WMS_CampanyName == "çä¸ç¥º") |
| | | if (oSystemParameter.omodel.WMS_CampanyName == "çä¸ç¥º" || oSystemParameter.omodel.WMS_CampanyName == "å¯è´å¥ç¹") |
| | | { |
| | | sql1 = "select top 1000 * from h_v_Gy_RoutingBillList where 1 = 1 "; |
| | | } |
| | |
| | | { |
| | | string sql1 = "select * from h_v_Gy_RoutingBillList_His where 1 = 1 "; |
| | | //客æ·èªå®ä¹ |
| | | if (oSystemParameter.omodel.WMS_CampanyName == "çä¸ç¥º") |
| | | if (oSystemParameter.omodel.WMS_CampanyName == "çä¸ç¥º"|| oSystemParameter.omodel.WMS_CampanyName == "å¯è´å¥ç¹") |
| | | { |
| | | sql1 = "select top 1000 * from h_v_Gy_RoutingBillList_His where 1 = 1 "; |
| | | } |
| | |
| | | return GetObjectJson(ds); |
| | | } |
| | | |
| | | #region 客æ·è®¢å ç产订åå®å·¥ |
| | | [Route("LEMS/sc_ICOMReportClose")] |
| | | [HttpPost] |
| | | public object sc_ICOMReportClose([FromBody] JObject sMainSub) |
| | | { |
| | | DataSet ds; |
| | | try |
| | | { |
| | | var _value = sMainSub["sMainSub"].ToString(); |
| | | string[] sArray = _value.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string HICOMBillNoNum = sArray[0].ToString(); |
| | | string user = sArray[1].ToString(); |
| | | |
| | | //夿æ¯å¦ææ¥è¯¢æé |
| | | if (!DBUtility.ClsPub.Security_Log("Sc_ICMOBill_Edit", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ æéæ¥è¯¢!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | var HICOMBillNo = HICOMBillNoNum.Split(','); |
| | | |
| | | oCN.BeginTran(); |
| | | for (int i = 0; i < HICOMBillNo.Length; i++) |
| | | { |
| | | ds = oCN.RunProcReturn("select * from Sc_ICMOBillMain where HBillNo='" + HICOMBillNo[i] + "'", "Sc_ICMOBillMain"); |
| | | if (ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ¥æ æ°æ®ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | oCN.RunProc("update Sc_ICMOBillSub set HSTATUS=5 where HInterID=" + ds.Tables[0].Rows[0]["HInterID"].ToString()); |
| | | } |
| | | oCN.Commit(); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "æåå®å·¥è®¢å!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "没æè¿åä»»ä½è®°å½ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region 客æ·è®¢å çäº§è®¢åæ·»å 夿³¨ |
| | | [Route("LEMS/sc_ICOMReportAddHRemark")] |
| | | [HttpPost] |
| | | public object sc_ICOMReportAddHRemark([FromBody] JObject sMainSub) |
| | | { |
| | | DataSet ds; |
| | | try |
| | | { |
| | | var _value = sMainSub["sMainSub"].ToString(); |
| | | string[] sArray = _value.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string HICOMBillNo = sArray[0].ToString(); |
| | | string HRemark = sArray[1].ToString(); |
| | | string user = sArray[2].ToString(); |
| | | |
| | | //夿æ¯å¦ææ¥è¯¢æé |
| | | if (!DBUtility.ClsPub.Security_Log("Sc_ICMOBill_Edit", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ æéæ¥è¯¢!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | oCN.BeginTran(); |
| | | |
| | | ds = oCN.RunProcReturn("select * from Sc_ICMOBillMain where HBillNo='" + HICOMBillNo + "'", "Sc_ICMOBillMain"); |
| | | if (ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ¥æ æ°æ®ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | oCN.RunProc("update Sc_ICMOBillMain set HRemark2='" + HRemark + "' where HBillNo='" + HICOMBillNo + "'"); |
| | | |
| | | oCN.Commit(); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "ä¿åæå!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "没æè¿åä»»ä½è®°å½ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region 夿䏿¨ççäº§è®¢åæ¯å¦å®¡æ ¸ |
| | | [Route("LEMS/ICMOBillCheck")] |
| | | [HttpGet] |
| | |
| | | oCN.RunProc("Insert into Gy_EquipFileBillMain " + |
| | | " (hbillno,HEquipFileNumber,HEquipFileNo,HName,HModel,HModel2,HMaterID,HUnitID,HOutComDate" + |
| | | ",HOutComNo,HDeptID,HUseEmpID,HRepairEmpID,HAddress,HSetupDate,HStartupDate,HStatus," + |
| | | "HEquipFileTypeID,HProNum,HBarCode,HWorkArea,HLogo,HSellSupID,HMakeSupID,hbilltype,HDate,HYear,HMaker,HMakeDate,HEquipMaintainRuleInterID,HEquipDotCheckRuleInterID,HSourceID) " + |
| | | "HEquipFileTypeID,HProNum,HBarCode,HWorkArea,HLogo,HSellSupID,HMakeSupID,hbilltype,HDate,HYear,HMaker,HMakeDate,HEquipMaintainRuleInterID,HEquipDotCheckRuleInterID,HSourceID) " + |
| | | " Values('" + hbillno + "','" + HEquipFileNumber + "','" + HEquipFileNo + "','" + HName + "','" + HModel + "','" + HModel2 + "'," + HMaterID + "," + HUnitID + |
| | | ",'" + HOutComDate + "','" + HOutComNo + "'," + HDeptID + "," + HUseEmpID + "," + HRepairEmpID + ",'" + HAddress + |
| | | "','" + HSetupDate + "','" + HStartupDate + "','" + HStatus + "'," + HEquipFileTypeID + ",'" + HProNum + |
| | |
| | | using Newtonsoft.Json; |
| | | using Newtonsoft.Json.Linq; |
| | | using System.Diagnostics; |
| | | using System.Threading; |
| | | |
| | | namespace WebAPI.Controllers.SCGL.æ¥è®¡å管ç |
| | | { |
| | |
| | | " HMaterID, HMaterName, HMaterModel, HUnitID, HSeOrderBillQty," + |
| | | " HOrderNeedQty, HSplitQty, HDayPlanSumQty,HPlanBeginDate," + |
| | | "HSeOrderBillNo,HICMOBillType,HSourceStockInQty,HLeftPlanQty,HOrderLev,HPreparatDate," + |
| | | "HMainSourceInterID,HMainSourceEntryID,HICMOInterID_Sec,HICMOEntryID_Sec,HPlanQty)values" + |
| | | "HMainSourceInterID,HMainSourceEntryID,HICMOInterID_Sec,HICMOEntryID_Sec,HPlanQty" + |
| | | ",HICMOInterID,HICMOEntryID)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)}," + |
| | | $" {(HMaterID == "" ? 0.ToString() : HMaterID)}, '{HMaterName}', '{HMaterModel}', {(HUnitID == "" ? 0.ToString() : HUnitID)}, {(HSeOrderBillQty == "" ? 0.ToString() : HSeOrderBillQty)}," + |
| | | $" 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},{HMainSourceInterID},{HMainSourceEntryID},{HPlanQty}," + |
| | | $"{HMainSourceInterID},{HMainSourceEntryID})"; |
| | | |
| | | //LogService.Write("sql:" + sql); |
| | | //主表 |
| | |
| | | var HICMOEntrySEQ = list[i]["ç产订åæç»è¡å·"].ToString(); |
| | | var HSourceID = list[i]["HSourceID"].ToString(); |
| | | var HYX = list[i]["ä¼å
级"].ToString(); |
| | | var HWorkQty = list[i]["å°æ¶äº§è½"].ToString(); |
| | | var HProdTimes = list[i]["çäº§å¨æ"].ToString(); |
| | | var HReadyTimes = list[i]["å¼å·¥ä½é"].ToString(); |
| | | var HLastBeginDate = list[i]["æè¿å¼å·¥æ¥æ"].ToString(); |
| | | var HLastEndDate = list[i]["æè¿å®å·¥æ¥æ"].ToString(); |
| | | var HOrderNeedQty = list[i]["订åéæ±æ°é"].ToString(); |
| | | var HOrderCommitDate = list[i]["订å交货æ"].ToString(); |
| | | |
| | | if (HSourceID == "" || HSourceID == "0") |
| | | { |
| | |
| | | return objJsonResult; |
| | | } |
| | | |
| | | oCN.RunProc($"update Sc_WorkBillSortBillMain set HSourceID={(HSourceID == "" ? 0.ToString() : HSourceID)},HYX={HYX} where HInterID={list[i]["hmainid"].ToString()} and HBillNo='{list[i]["åæ®å·"].ToString()}'"); |
| | | 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}'" + |
| | | $" where HInterID={list[i]["hmainid"].ToString()} and HBillNo='{list[i]["åæ®å·"].ToString()}'"); |
| | | } |
| | | |
| | | oCN.RunProc($"update Sc_WorkBillSortBillMain set HDayPlanSumQty={list[i]["æ¥è®¡åæ°éæ»é"].ToString()} where HInterID={(HInterID==0?int.Parse(list[i]["hmainid"].ToString()):HInterID)} and HBillNo='{(HBillNo==""?list[i]["åæ®å·"].ToString(): HBillNo)}'"); |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region ç产æ¥è®¡åå¹³å° æ°æ®åå¤ è®¾ç½®ä»»å¡åç¸å
³ä¿¡æ¯ |
| | | [Route("JIT_DayPlanPlatFormBill/ReadyData")] |
| | | [HttpGet] |
| | | public object ReadyData(string HICOMNum) |
| | | { |
| | | try |
| | | { |
| | | var list = HICOMNum.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)); |
| | | |
| | | for (int i = 0; i < list.Length; i++) |
| | | { |
| | | string HICMOInterID = list[i].Split(';')[0].ToString(); |
| | | string HICMOEntryID = list[i].Split(';')[1].ToString(); |
| | | |
| | | Thread.Sleep(100); |
| | | ds = oCN.RunProcReturn("exec h_p_Sc_GetInfoByICMOBillNo " + HICMOInterID+","+ HICMOEntryID, "h_p_Sc_GetInfoByICMOBillNo"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | |
| | | } |
| | | else |
| | | { |
| | | DataRow dr = dt.NewRow(); |
| | | 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 |
| | | |
| | | } |
| | | } |
| | |
| | | string HMaker = user;//å¶å人 |
| | | string HIsStockQty = mainList[0].HIsStockQty; |
| | | string HRemark3 = mainList[0].HRemark3; |
| | | |
| | | |
| | | ds = oCN.RunProcReturn("select * from h_v_IF_ICMOBillList where hmainid=" + HInterID + " and åæ®å·='" + HBillNo + "'", "h_v_IF_ICMOBillList"); |
| | | |
| | |
| | | ,HMaterID,HUnitID,HRemark,HSourceID,HDeptID,HSTATUS |
| | | ,HBomID,HEntryCusID,HSTOCKINORGID |
| | | ,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney |
| | | ,HAuxQty,HAuxUnit,HWidth,HWeight,HColorRemark) |
| | | ,HAuxQty,HAuxUnit,HWidth,HWeight,HColorRemark,HCusMaterName,HCusModel) |
| | | values({HInterID},{HEntryID},{(oSub.HQty == null ? 0 : oSub.HQty)} |
| | | ,'{(oSub.HPlanBeginDate == null ? DateTime.Now.ToString("yyyy-MM-dd") : oSub.HPlanBeginDate.ToString())}','{(oSub.HPlanEndDate == null ? DateTime.Now.AddDays(1).ToString("yyyy-MM-dd") : oSub.HPlanEndDate.ToString())}' |
| | | ,'{(oSub.HBeginDate == null ? DateTime.Now.ToString("yyyy-MM-dd") : oSub.HBeginDate.ToString())}','{(oSub.HEndDate == null ? DateTime.Now.AddDays(1).ToString("yyyy-MM-dd") : oSub.HEndDate.ToString())}' |
| | | ,{oSub.HMaterID},{oSub.HUnitID},'{oSub.HRemark}',{oSub.HSourceID},{oSub.HDeptID},{oSub.HSTATUS} |
| | | ,{oSub.HBomID} ,{oSub.HCusID} ,{oSub.HSTOCKINORGID} |
| | | ,0,0,'','',0,0 |
| | | ,{oSub.HAuxQty},{oSub.HAuxUnit},{oSub.HWidth},{oSub.HWeight},'{oSub.HColorRemark}')"); |
| | | |
| | | ,{oSub.HAuxQty},{oSub.HAuxUnit},{oSub.HWidth},{oSub.HWeight},'{oSub.HColorRemark}','{oSub.HCusMaterName}','{oSub.HCusModel}')"); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |