产品器具清单新增字段:器具类型,工装优先级,工位数;生产资源新增字段:工位数量,产线标准人数;工序新增字段:标准工价;工艺路线编辑修改查询视图;焊接排产:协同生产资源写入排产记录;物料新增字段:工位数;
| | |
| | | "" + |
| | | "" + |
| | | "(HInterID,HEntryID,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType" + |
| | | ",HMouldID,HQty,HMouldQty,HRate) " + |
| | | ",HMouldID,HQty,HMouldQty,HRate,HMouldType,HMouldPriority,HCubicleQty) " + |
| | | " values(" + |
| | | "" + omodel.HInterID.ToString() + |
| | | "," + oSub.HEntryID.ToString() + |
| | |
| | | "','" + oSub.HMouldID + |
| | | "'," + oSub.HQty + |
| | | "," + oSub.HMouldQty + |
| | | ",'" + oSub.HRate + |
| | | "')"; |
| | | ",'" + oSub.HRate + |
| | | "','" + oSub.HMouldType + |
| | | "','" + oSub.HMouldPriority + |
| | | "'," + oSub.HCubicleQty + |
| | | ")"; |
| | | oCn.RunProc(subSql); |
| | | } |
| | | |
| | |
| | | "" + |
| | | "" + |
| | | "(HInterID,HEntryID,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType" + |
| | | ",HMouldID,HQty,HMouldQty,HRate) " + |
| | | ",HMouldID,HQty,HMouldQty,HRate,HMouldType,HMouldPriority,HCubicleQty) " + |
| | | " values(" + |
| | | "" + omodel.HInterID.ToString() + |
| | | "," + oSub.HEntryID.ToString() + |
| | |
| | | "'," + oSub.HQty + |
| | | "," + oSub.HMouldQty + |
| | | ",'" + oSub.HRate + |
| | | "')"; |
| | | "','" + oSub.HMouldType + |
| | | "','" + oSub.HMouldPriority + |
| | | "'," + oSub.HCubicleQty + |
| | | ")"; |
| | | oCn.RunProc(subSql); |
| | | } |
| | | sReturn = "æ°å¢åæ®æåï¼"; |
| | |
| | | public Int64 HMouldQty; |
| | | public decimal HQty; |
| | | public decimal HRate; |
| | | public string HMouldType; //å¨å
·ç±»å« |
| | | public string HMouldPriority; //å¨å
·ä¼å
级 |
| | | public Int64 HCubicleQty; //å ç¨å·¥ä½æ° |
| | | } |
| | | } |
| | |
| | | public int HUSEORGID; |
| | | public int HEmpID; //è´è´£äºº |
| | | public string HMacAddr; //macå°å |
| | | public int HCubicleQty; //工使°é |
| | | public int HProdLinePeopleNum; //产线æ åäººæ° |
| | | } |
| | | } |
| | |
| | | long HWHID = list[0].HWHID; //è¯åä»åº |
| | | |
| | | string HPayMentType = list[0].HPayMentType; //计件工èµç±»å |
| | | decimal HStandardWages = list[0].HStandardWages; //æ å工价 |
| | | |
| | | |
| | | //夿æé |
| | |
| | | ",HLevel,HEndFlag,HStopflag,HRemark,HDeptID,HBarCodeForBase,HProcessID_K3,HBillSubType,HAutoTrunFlag" + |
| | | ",HFixPrice,HOverFixPrice,HProcMulID,HProcCheckNote" + |
| | | ",HUSEORGID,HWorkCenterID,HBadWHID,HWasterWHID,HBadCountDevelopWHID,HWWBadWHID,HWWWasterWHID,HWHID,HTProcessFlag" + |
| | | ",HQCSchemeID_Fst,HQCSchemeID_Proc,HQCSchemeID_Patrol,HPayMentType) " + |
| | | ",HQCSchemeID_Fst,HQCSchemeID_Proc,HQCSchemeID_Patrol,HPayMentType,HStandardWages) " + |
| | | " Values('" + HNumber + "','" + HName + "','" + HHelpCode + "','" + HShortNumber + "'," + HParentID.ToString() + |
| | | "," + Convert.ToString(HTypeFlow ? 1 : 0) + "," + Convert.ToString(HTypeCount ? 1 : 0) + ",'" + HDeptNumber + "','" + HSNo.ToString() + |
| | | "'," + HLevel.ToString() + "," + Convert.ToString(HEndFlag ? 1 : 0) + "," + Convert.ToString(HStopflag ? 1 : 0) + ",'" + HRemark + "'," + HDeptID + |
| | | ",'" + HBarCodeForBase + "'," + HProcessID_K3 + ",'" + HBillSubType + "'," + Convert.ToString(HAutoTrunFlag ? 1 : 0) + |
| | | ",'" + HFixPrice.ToString() + "'," + HOverFixPrice.ToString() + "," + HProcMulID.ToString() + ",'" + HProcCheckNote.ToString() + "'" + |
| | | "," + HUSEORGID + "," + HWorkCenterID + "," + HBadWHID + "," + HWasterWHID + "," + HBadCountDevelopWHID + "," + HWWBadWHID + "," + HWWWasterWHID + "," + HWHID + "," + Convert.ToString(HTProcessFlag ? 1 : 0) + "," + HQCSchemeID_Fst + "," + HQCSchemeID_Proc + "," + HQCSchemeID_Patrol |
| | | + ",'" + HPayMentType + "'" + ")", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | + ",'" + HPayMentType + "'," + HStandardWages + ")", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //ä¿®æ¹ä¸çº§ä¸ºéæ«çº§ä»£ç |
| | | oCN.RunProc("Update Gy_Process set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | oCN.Commit(); |
| | |
| | | ",HQCSchemeID_Proc= " + HQCSchemeID_Proc + |
| | | ",HQCSchemeID_Patrol= " + HQCSchemeID_Patrol + |
| | | ",HPayMentType= '" + HPayMentType + "'" + |
| | | ",HStandardWages= " + HStandardWages + |
| | | ",HProcCheckNote='" + HProcCheckNote + "' Where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //ä¿®æ¹ä¸çº§ä¸ºéæ«çº§ä»£ç |
| | | oCN.RunProc("Update Gy_Process set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | |
| | | try |
| | | { |
| | | |
| | | ds = oCN.RunProcReturn("select a.*,m.HProcPriceType,m.HBeginDate,m.HEndDate,s.HQCProc,s.HQCFst,s.HQCPatrol,s.HMaterToSourceCtrl from h_v_Gy_RoutingBillList as a,Gy_RoutingBillMain as m,Gy_RoutingBillSub as s where m.HInterID = hmainid and s.HInterID = hmainid and s.HEntryID = hsubid and hmainid =" + HInterID, "h_v_Gy_RoutingBillList"); |
| | | ds = oCN.RunProcReturn("select a.*,m.HProcPriceType,m.HBeginDate,m.HEndDate,s.HQCProc,s.HQCFst,s.HQCPatrol,s.HMaterToSourceCtrl from h_v_Gy_RoutingBill_Edit as a,Gy_RoutingBillMain as m,Gy_RoutingBillSub as s where m.HInterID = hmainid and s.HInterID = hmainid and s.HEntryID = hsubid and hmainid =" + HInterID, "h_v_Gy_RoutingBillList"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | |
| | | var HPlanQty = list[i]["è®¡åæ°é"].ToString(); |
| | | var HEmpID = list[i]["HEmpID"].ToString(); |
| | | var HWorkQty = list[i]["å°æ¶äº§è½"].ToString(); |
| | | var HSourceName = list[i]["çäº§èµæº"].ToString(); |
| | | var HWorkQty_ProdLine = list[i]["产线æ»äº§è½"].ToString(); |
| | | |
| | | LogService.CustomWriteLog("2.05:" + i, DateTime.Now.ToString("yyyy-MM-dd")); |
| | | |
| | |
| | | " HOrderNeedQty, HSplitQty, HDayPlanSumQty,HPlanBeginDate," + |
| | | "HSeOrderBillNo,HICMOBillType,HSourceStockInQty,HLeftPlanQty,HOrderLev,HPreparatDate," + |
| | | "HMainSourceInterID,HMainSourceEntryID,HICMOInterID_Sec,HICMOEntryID_Sec,HPlanQty" + |
| | | ",HICMOInterID,HICMOEntryID,HPlanEndDate,HEmpID,HWorkQty)values" + |
| | | ",HICMOInterID,HICMOEntryID,HPlanEndDate,HEmpID,HWorkQty,HSourceName,HWorkQty_ProdLine)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}')"; |
| | | $"{HMainSourceInterID},{HMainSourceEntryID},'{HPlanEndDate}','{HEmpID}','{HWorkQty}','{HSourceName}','{HWorkQty_ProdLine}')"; |
| | | |
| | | //LogService.Write("sql:" + sql); |
| | | //主表 |
| | |
| | | var HOrderCommitDate = list[i]["订å交货æ"].ToString(); |
| | | var HPlanEndDate = list[i]["计åç»ææ¥æ"].ToString(); |
| | | var HSplitQty = list[i]["æåæ°é"].ToString(); |
| | | var HSourceName = list[i]["çäº§èµæº"].ToString(); |
| | | var HWorkQty_ProdLine = list[i]["产线æ»äº§è½"].ToString(); |
| | | |
| | | var HOrderType = list[i]["订åç±»å"].ToString(); |
| | | var HWorkShopID = list[i]["HWorkShopID"].ToString(); |
| | | var HProdORGID = list[i]["HProdORGID"].ToString(); |
| | | var HMaterID = list[i]["HMaterID"].ToString(); |
| | | var HMaterName = list[i]["ç©æåç§°"].ToString(); |
| | | var HMaterModel = list[i]["è§æ ¼åå·"].ToString().Replace("'", "''"); |
| | | var HUnitID = list[i]["HUnitID"].ToString(); |
| | | var HSeOrderBillQty = list[i]["éå®è®¢åæ°é"].ToString(); |
| | | var HDayPlanSumQty = list[i]["æ¥è®¡åæ°éæ»é"].ToString(); |
| | | var HPlanBeginDate = list[i]["计åå¼å§æ¥æ"].ToString(); |
| | | var HSeOrderBillNo = list[i]["éå®è®¢åå·"].ToString(); |
| | | var HICMOBillType = list[i]["ç产订ååæ®ç±»å"].ToString(); |
| | | var HSourceStockInQty = list[i]["产线å
¥åºæ°é"].ToString(); |
| | | var HLeftPlanQty = list[i]["æªææ°é"].ToString(); |
| | | var HOrderLev = list[i]["订åç级"].ToString(); |
| | | var HPlanQty = list[i]["è®¡åæ°é"].ToString(); |
| | | var HEmpID = list[i]["HEmpID"].ToString(); |
| | | |
| | | LogService.CustomWriteLog("2.1:"+i, DateTime.Now.ToString("yyyy-MM-dd")); |
| | | |
| | |
| | | return objJsonResult; |
| | | } |
| | | |
| | | ds = oCN.RunProcReturn($"select HInterID,HICMOBillNo from Sc_WorkBillSortBillMain with(nolock) where HMainSourceInterID={HMainSourceInterID}" + |
| | | $" and HMainSourceEntryID={HMainSourceEntryID} and HICMOBillNo='{HICMOBillNo}' and HICMOEntrySEQ={HICMOEntrySEQ} and HSourceID={HSourceID}", "Sc_WorkBillSortBillMain"); |
| | | |
| | | if (ds.Tables[0].Rows.Count > 1) |
| | | if (oSystemParameter.omodel.WMS_CampanyName == "æ·»åº·ç§æ") //ç³»ç»åæ° å®¢æ·å®å¶ååç§° 空ç½ä¸ºéç¨ |
| | | { |
| | | LogService.CustomWriteLog("第" + i + 1 + "è¡çäº§èµæºæéå¤,请修æ¹", DateTime.Now.ToString("yyyy-MM-dd")); |
| | | LogService.CustomWriteLog($"select * from Sc_WorkBillSortBillMain where HMainSourceInterID={HMainSourceInterID}" + |
| | | $" and HMainSourceEntryID={HMainSourceEntryID} and HICMOBillNo='{HICMOBillNo}' and HICMOEntrySEQ={HICMOEntrySEQ} and HSourceID={HSourceID}", DateTime.Now.ToString("yyyy-MM-dd")); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = $"第{i + 1}è¡çäº§èµæºæéå¤,请修æ¹!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | LogService.CustomWriteLog("2.2:" + i, DateTime.Now.ToString("yyyy-MM-dd")); |
| | | //çæå å°çäº§èµæºååç产 |
| | | string[] HSourceNameArr = HSourceName.Split(new char[]{'&'}); |
| | | |
| | | 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}" + |
| | | $" where HInterID={list[i]["hmainid"].ToString()} and HBillNo='{list[i]["åæ®å·"].ToString()}'"); |
| | | if (HSourceNameArr.Length >= 2) |
| | | { |
| | | for (int s = 0; s < HSourceNameArr.Length; s++) |
| | | { |
| | | if (s == 0) |
| | | { |
| | | ds = oCN.RunProcReturn("select HItemID from Gy_Source with(nolock) where HName = '" + HSourceNameArr[s] + "'", "Gy_Source"); |
| | | |
| | | var HSourceID_Child = ds.Tables[0].Rows[0]["HItemID"]; |
| | | |
| | | oCN.RunProc($"update Sc_WorkBillSortBillMain set HSourceID={(HSourceID_Child == "" ? 0.ToString() : HSourceID_Child)}" + |
| | | $",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}" + |
| | | $" where HInterID={list[i]["hmainid"].ToString()} and HBillNo='{list[i]["åæ®å·"].ToString()}'"); |
| | | } |
| | | else |
| | | { |
| | | ds = oCN.RunProcReturn("select HItemID from Gy_Source with(nolock) where HName = '" + HSourceNameArr[s] + "'", "Gy_Source"); |
| | | |
| | | var HSourceID_Child = ds.Tables[0].Rows[0]["HItemID"]; |
| | | |
| | | //æ°å¢ååçäº§èµæºçæäº§è®°å½ |
| | | ds = oCN.RunProcReturn($"select HInterID,HICMOBillNo from Sc_WorkBillSortBillMain with(nolock) where HMainSourceInterID={HMainSourceInterID}" + |
| | | $" and HMainSourceEntryID={HMainSourceEntryID} and HICMOBillNo='{HICMOBillNo}' and HICMOEntrySEQ={HICMOEntrySEQ} and HSourceID={HSourceID_Child}", "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 |
| | | var HBillNo_New = DBUtility.ClsPub.CreateBillCode_Prod(BillType, ref DBUtility.ClsPub.sExeReturnInfo, true);//è·å¾ä¸ä¸ªæ°çåæ®å· |
| | | var HInterID_New = DBUtility.ClsPub.CreateBillID_Prod(BillType, ref DBUtility.ClsPub.sExeReturnInfo);//è·å¾ä¸ä¸ªæ°çid |
| | | |
| | | string sql = $"insert into Sc_WorkBillSortBillMain(HInterID,HBillNo,HYear,HPeriod,HBillType," + |
| | | "HBillSubType,HDate,HBillStatus,HMaker,HMakeDate,HICMOBillNo,HOrderType," + |
| | | "HICMOEntrySEQ,HWorkShopID,HSourceID, HYX, HProdORGID," + |
| | | " HMaterID, HMaterName, HMaterModel, HUnitID, HSeOrderBillQty," + |
| | | " 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,HRemark)values" + |
| | | $"({HInterID_New},'{HBillNo_New}',{DateTime.Now.Year},{DateTime.Now.Month},'{BillType}'," + |
| | | $"'{BillType}',GETDATE(),1,'{user}',getdate(),'{HICMOBillNo}','{HOrderType}'," + |
| | | $"{(HICMOEntrySEQ == "" ? 0.ToString() : HICMOEntrySEQ)},{(HWorkShopID == "" ? 0.ToString() : HWorkShopID)},{(HSourceID_Child == "" ? 0.ToString() : HSourceID_Child)}, {(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},'{HPlanEndDate}','{HEmpID}','{HWorkQty}','{HSourceName}','{HWorkQty_ProdLine}','{"ååç产"}')"; |
| | | |
| | | //LogService.Write("sql:" + sql); |
| | | //主表 |
| | | oCN.RunProc(sql); |
| | | |
| | | //æå
¥åè¡¨æ°æ® |
| | | for (int j = 0; j < 180; j++) |
| | | { |
| | | //ä¸»è¡¨ææ°æ® åè¡¨æ æ°æ® |
| | | //if (j == 180 - 1 && SumCount == 0 && HInterID_New != 0 && HBillNo_New != "") |
| | | //{ |
| | | // objJsonResult = AddBillSub(HInterID_New.ToString(), HBillNo_New, DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd").ToString()), 0, list[i]); |
| | | //} |
| | | |
| | | |
| | | if (list[i][DateTime.Now.AddDays(j).ToString("yyyy-MM-dd")].ToString() != "") |
| | | { |
| | | ////ä¿åå表 |
| | | objJsonResult = AddBillSub(HInterID_New == 0 ? list[i]["hmainid"].ToString() : HInterID_New.ToString() |
| | | , HBillNo_New == "" ? list[i]["åæ®å·"].ToString() : HBillNo_New |
| | | , DateTime.Parse(DateTime.Now.AddDays(j).ToString("yyyy-MM-dd").ToString()) |
| | | , 0 |
| | | , list[i]); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | ds = oCN.RunProcReturn($"select HInterID,HICMOBillNo from Sc_WorkBillSortBillMain with(nolock) where HMainSourceInterID={HMainSourceInterID}" + |
| | | $" and HMainSourceEntryID={HMainSourceEntryID} and HICMOBillNo='{HICMOBillNo}' and HICMOEntrySEQ={HICMOEntrySEQ} and HSourceID={HSourceID}", "Sc_WorkBillSortBillMain"); |
| | | |
| | | if (ds.Tables[0].Rows.Count > 1) |
| | | { |
| | | LogService.CustomWriteLog("第" + i + 1 + "è¡çäº§èµæºæéå¤,请修æ¹", DateTime.Now.ToString("yyyy-MM-dd")); |
| | | LogService.CustomWriteLog($"select * from Sc_WorkBillSortBillMain where HMainSourceInterID={HMainSourceInterID}" + |
| | | $" and HMainSourceEntryID={HMainSourceEntryID} and HICMOBillNo='{HICMOBillNo}' and HICMOEntrySEQ={HICMOEntrySEQ} and HSourceID={HSourceID}", DateTime.Now.ToString("yyyy-MM-dd")); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = $"第{i + 1}è¡çäº§èµæºæéå¤,请修æ¹!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | LogService.CustomWriteLog("2.2:" + i, DateTime.Now.ToString("yyyy-MM-dd")); |
| | | |
| | | 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}" + |
| | | $" where HInterID={list[i]["hmainid"].ToString()} and HBillNo='{list[i]["åæ®å·"].ToString()}'"); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | ds = oCN.RunProcReturn($"select HInterID,HICMOBillNo from Sc_WorkBillSortBillMain with(nolock) where HMainSourceInterID={HMainSourceInterID}" + |
| | | $" and HMainSourceEntryID={HMainSourceEntryID} and HICMOBillNo='{HICMOBillNo}' and HICMOEntrySEQ={HICMOEntrySEQ} and HSourceID={HSourceID}", "Sc_WorkBillSortBillMain"); |
| | | |
| | | if (ds.Tables[0].Rows.Count > 1) |
| | | { |
| | | LogService.CustomWriteLog("第" + i + 1 + "è¡çäº§èµæºæéå¤,请修æ¹", DateTime.Now.ToString("yyyy-MM-dd")); |
| | | LogService.CustomWriteLog($"select * from Sc_WorkBillSortBillMain where HMainSourceInterID={HMainSourceInterID}" + |
| | | $" and HMainSourceEntryID={HMainSourceEntryID} and HICMOBillNo='{HICMOBillNo}' and HICMOEntrySEQ={HICMOEntrySEQ} and HSourceID={HSourceID}", DateTime.Now.ToString("yyyy-MM-dd")); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = $"第{i + 1}è¡çäº§èµæºæéå¤,请修æ¹!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | LogService.CustomWriteLog("2.2:" + i, DateTime.Now.ToString("yyyy-MM-dd")); |
| | | |
| | | 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}" + |
| | | $" 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)}'"); |
| | |
| | | #region éè¿ç©æå¹é
产åå¨å
·æ¸
å |
| | | [Route("JIT_DayPlanPlatFormBill/GetMouldByMater")] |
| | | [HttpGet] |
| | | public object GetMouldByMater(string HMaterID,string HSourceID) |
| | | public object GetMouldByMater(string HMaterID,string HSourceID,string HPCDate) |
| | | { |
| | | try |
| | | { |
| | | ds = oCN.RunProcReturn("exec h_p_Gy_MaterialMouldByMater " + HMaterID + "," + HSourceID, "h_p_Gy_MaterialMouldByMater"); |
| | | ds = oCN.RunProcReturn("exec h_p_Gy_MaterialMouldByMater " + HMaterID + "," + HSourceID + ",'" + HPCDate + "'", "h_p_Gy_MaterialMouldByMater"); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | |
| | | #region æäº§åå°å¨å
·å ç¨æ¶é´åå
¥æ°æ®åº |
| | | [Route("JIT_DayPlanPlatFormBill/AddMouldOccupancyTime")] |
| | | [HttpGet] |
| | | public object AddMouldOccupancyTime(string HMouldID, string HSourceID, string HICMOInterID, string HICMOEntryID, string HMouldPCTime) |
| | | public object AddMouldOccupancyTime(string HMouldID, string HSourceID, string HICMOInterID, string HICMOEntryID, string HICMOBillNo, string HMouldPCTime) |
| | | { |
| | | try |
| | | { |
| | | ds = oCN.RunProcReturn("exec h_p_JIT_AddMouldOccupancyTime " + HMouldID + "," + HSourceID + "," + HICMOInterID + "," + HICMOEntryID + ",'" + HMouldPCTime + "'", "h_p_JIT_AddMouldOccupancyTime"); |
| | | ds = oCN.RunProcReturn("exec h_p_JIT_AddMouldOccupancyTime " + HMouldID + "," + HSourceID + "," + HICMOInterID + "," + HICMOEntryID + ",'" + HICMOBillNo + "','" + HMouldPCTime + "'", "h_p_JIT_AddMouldOccupancyTime"); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ""; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region éè¿ä¸»èµæºå¹é
åèµæº |
| | | [Route("JIT_DayPlanPlatFormBill/GetChildSource")] |
| | | [HttpGet] |
| | | public object GetChildSource(string HSourceID) |
| | | { |
| | | try |
| | | { |
| | | ds = oCN.RunProcReturn("select HItemID åèµæºID,HNumber åèµæºä»£ç ,HName åèµæºåç§°,HCubicleQty åèµæºå·¥ä½æ° from Gy_Source with(nolock) where HParentID = " + HSourceID + " order by HName asc", "Gy_Source"); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region å¤æç©ææ¯å¦å¯ä»¥æ¾å¨åä¸èµæºä¸ä¸èµ·ç产 |
| | | [Route("JIT_DayPlanPlatFormBill/GetSourceByMater")] |
| | | [HttpGet] |
| | | public object GetSourceByMater(string HMaterID) |
| | | { |
| | | try |
| | | { |
| | | ds = oCN.RunProcReturn("exec h_p_Sc_ICMOGetWorkSource_TK " + HMaterID + ",'',''", "h_p_Sc_ICMOGetWorkSource_TK"); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | |
| | | ",HMaterRuleType,HColorNo,HPieceMaxQty,HCommonUseFlag,HAvgStockPrice,HFootPrice,HTaxCost,HNoTaxCost,HOnceRightRate" + |
| | | ",HHeight_M,HInches_M,HAl1Long_M,HDensity_M,HTela_M,HUnderTela_M,HSizing_M,HQtyDec,HPriceDec,HMoneyDec,HTaxRate,HProfitRate" + |
| | | ",HLotcardQty" + |
| | | ",HProjectBillMainID,HDivisionID" + |
| | | ",HProjectBillMainID,HDivisionID,HCubicleQty" + |
| | | ") " + |
| | | " Values('" + oModel.HNumber + "','" + oModel.HName + "','" + oModel.HHelpCode + "','" + oModel.HShortNumber + "'," + oModel.HParentID.ToString() + |
| | | ", " + oModel.HLevel.ToString() + "," + Convert.ToString(oModel.HEndFlag ? 1 : 0) + "," + Convert.ToString(oModel.HStopflag ? 1 : 0) + ",'" + oModel.HRemark + "'" + |
| | |
| | | "," + oModel.HLotcardQty + |
| | | ",'" + oModel.HProjectBillMainID + |
| | | "','" + oModel.HDivisionID + |
| | | "','" + oModel.HCubicleQty + |
| | | "')", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //ä¿®æ¹ä¸çº§ä¸ºéæ«çº§ä»£ç |
| | | oCn.RunProc("Update " + MvarItemKey + " set HEndflag=0 where HItemID=" + oModel.HParentID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | |
| | | ",HProfitRate=" + oModel.HProfitRate.ToString() + |
| | | ",HProjectBillMainID='" + oModel.HProjectBillMainID + "'" + |
| | | ",HDivisionID='" + oModel.HDivisionID + "'" + |
| | | ",HLotcardQty='" + oModel.HLotcardQty + "'" + |
| | | ",HLotcardQty='" + oModel.HLotcardQty + "'" + |
| | | ",HCubicleQty='" + oModel.HCubicleQty + "'" + |
| | | " Where HItemID=" + sItemID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //ä¿®æ¹å项ç®ä»£ç |
| | | oCn.RunProc("exec h_p_Gy_UpdateNumber '" + MvarItemKey + "','" + oModel.HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo); |
| | |
| | | " (HNumber,HName,HHelpCode,HShortNumber,HParentID" + |
| | | ",HType,HRelationID,HCenterID,HEquipFileID_K3,HDeptID" + |
| | | ",HLevel,HEndFlag,HStopflag,HRemark,HProcID,HOverTimes " + |
| | | ",HWorkTimes,HMaxWorkTimes,HMinAdd,HClassCount,HGroupID,HGroupK3ID,HUSEORGID,HMacAddr,HEmpID)" + |
| | | ",HWorkTimes,HMaxWorkTimes,HMinAdd,HClassCount,HGroupID,HGroupK3ID,HUSEORGID,HMacAddr,HEmpID,HCubicleQty,HProdLinePeopleNum)" + |
| | | " Values('" + oModel.HNumber + "','" + oModel.HName + "','" + oModel.HHelpCode + "','" + oModel.HShortNumber + "'," + oModel.HParentID.ToString() + |
| | | ",'" + oModel.HType + "'," + oModel.HRelationID.ToString() + "," + oModel.HCenterID.ToString() + "," + oModel.HEquipFileID_K3.ToString() + "," + oModel.HDeptID.ToString() + |
| | | "," + oModel.HLevel.ToString() + "," + Convert.ToString(oModel.HEndFlag ? 1 : 0) + "," + Convert.ToString(oModel.HStopflag ? 1 : 0) + |
| | | ",'" + oModel.HRemark + "'," + oModel.HProcID + "," + oModel.HOverTimes + "," + oModel.HWorkTimes + "," + oModel.HMaxWorkTimes + |
| | | "," + oModel.HMinAdd + "," + oModel.HClassCount + "," + oModel.HGroupID.ToString() + "," + oModel.HGroupK3ID.ToString() + "," + oModel.HUSEORGID + ",'" + oModel.HMacAddr + "',"+oModel.HEmpID + ")", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | "," + oModel.HMinAdd + "," + oModel.HClassCount + "," + oModel.HGroupID.ToString() + "," + oModel.HGroupK3ID.ToString() + "," + oModel.HUSEORGID + ",'" + oModel.HMacAddr + "'," + oModel.HEmpID + "," + oModel.HCubicleQty + "," + oModel.HProdLinePeopleNum + ")", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //ä¿®æ¹ä¸çº§ä¸ºéæ«çº§ä»£ç |
| | | oCn.RunProc("Update " + MvarItemKey + " set HEndflag=0 where HItemID=" + oModel.HParentID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | oCn.Commit(); |
| | |
| | | ",HEndflag=" + Convert.ToString(oModel.HEndFlag ? 1 : 0) + |
| | | ",HStopflag=" + Convert.ToString(oModel.HStopflag ? 1 : 0) + |
| | | ",HMacAddr='" + oModel.HMacAddr.ToString() + "'" + |
| | | ",HCubicleQty=" + oModel.HCubicleQty + |
| | | ",HProdLinePeopleNum=" + oModel.HProdLinePeopleNum + |
| | | ",HRemark= '" + oModel.HRemark + "' Where HItemID=" + sItemID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //ä¿®æ¹å项ç®ä»£ç |
| | | oCn.RunProc("exec h_p_Gy_UpdateNumber '" + MvarItemKey + "','" + oModel.HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo); |
| | |
| | | |
| | | public double HLotcardQty; //å个æµè½¬å¡æ°é |
| | | public int HDivisionID; //äºä¸é¨ |
| | | |
| | | public int HCubicleQty; //工使°é |
| | | } |
| | | } |
| | |
| | | public int HQCSchemeID_Proc { get; set; } |
| | | public int HQCSchemeID_Patrol { get; set; } |
| | | public string HPayMentType { get; set; } |
| | | public decimal HStandardWages { get; set; } //æ å工价 |
| | | |
| | | } |
| | | } |