| | |
| | | { |
| | | continue; |
| | | } |
| | | |
| | | // 插入生产状态临时表 |
| | | string SQL = $"exec h_p_Sc_ICMOBillStatus_Tmp_PGPL {hSourceInterID},{hSourceEntryID},{hSourceID},{hMoldID}"; |
| | | oCN.RunProc(SQL); |
| | | //插入工序流转卡派工单 |
| | | string SQL1 = $"exec h_p_Sc_ProcExchSendWorkBill_PG {hSourceInterID},{hSourceEntryID},{hSourceID},{hMoldID}"; |
| | | oCN.RunProc(SQL1); |
| | | string sReturn = ""; |
| | | if (oSystemParameter.ShowBill(ref sReturn) == true) |
| | | { |
| | |
| | | oCN.RunProc("exec h_p_OA_WorkLinkBill_Create " + hSourceInterID + "," + 3772); |
| | | } |
| | | } |
| | | |
| | | oCN.RunProc("update Sc_ProcessExchangeBillSub set HSourceID=" + hSourceID + " where HInterID=" + hSourceInterID + " and HEntryID=" + hSourceEntryID); |
| | | // 插入生产状态临时表 |
| | | string SQL = $"exec h_p_Sc_ICMOBillStatus_Tmp_PGPL {hSourceInterID},{hSourceEntryID},{hSourceID},{hMoldID}"; |
| | | oCN.RunProc(SQL); |
| | | //插入工序流转卡派工单 |
| | | string SQL1 = $"exec h_p_Sc_ProcExchSendWorkBill_PG {hSourceInterID},{hSourceEntryID},{hSourceID},{hMoldID}"; |
| | | oCN.RunProc(SQL1); |
| | | } |
| | | |
| | | // 7. 提交事务 |
| | |
| | | #region 取消派工功能(华舟) |
| | | [Route("LEMS/ProcessExchangeArrangementDel_PGHZ")] |
| | | [HttpGet] |
| | | public object ProcessExchangeArrangementDel_PGHZ(string HInterID_S, int HSourceID, int HMouldID, string user) |
| | | public object ProcessExchangeArrangementDel_PGHZ(string HInterID_S, string user) |
| | | { |
| | | DataSet ds; |
| | | DataSet ds1; |
| | |
| | | |
| | | long HInterID = long.Parse(HNum[j].Split('|')[0]); |
| | | long HEntryID = long.Parse(HNum[j].Split('|')[1]); |
| | | ds = oCN.RunProcReturn(@"select a.HMaterID,b.HProcID,a.HBillNo from Sc_ProcessExchangeBillMain a inner join Sc_ProcessExchangeBillSub b on a.HInterID=b.HInterID |
| | | where a.HInterID=" + HInterID + " and b.HEntryID=" + HEntryID, "Sc_ProcessExchangeBillMain"); |
| | | long HSourceID = long.Parse(HNum[j].Split('|')[2]); |
| | | ds = oCN.RunProcReturn(@"select a.HMaterID,b.HProcID,a.HBillNo from Sc_ProcessExchangeBillMain a inner join Sc_ProcessExchangeBillSub b on a.HInterID=b.HInterID where a.HInterID=" + HInterID + " and b.HEntryID=" + HEntryID, "Sc_ProcessExchangeBillMain"); |
| | | LogService.Write(1); |
| | | if (ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //根据主子ID+产线+模具查询是否派工 |
| | | ds = oCN.RunProcReturn("select * from Sc_ICMOBillStatus_Tmp where HSourceInterID=" + HInterID + " and HSourceEntryID=" + HEntryID + " and HSourceID=" + HSourceID + " and HMouldID=" + HMouldID, "Sc_ICMOBillStatus_Tmp"); |
| | | |
| | | //根据主子ID+产线查询是否派工 |
| | | ds = oCN.RunProcReturn("select * from Sc_ICMOBillStatus_Tmp where HSourceInterID=" + HInterID + " and HSourceEntryID=" + HEntryID + " and HSourceID=" + HSourceID , "Sc_ICMOBillStatus_Tmp"); |
| | | LogService.Write(2); |
| | | if (ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | LogService.Write(3); |
| | | oCN.RunProc("update Sc_ProcessExchangeBillSub set HSourceID=0 where HInterID=" + HInterID + " and HEntryID=" + HEntryID); |
| | | oCN.RunProc("delete from Sc_ICMOBillStatus_Tmp where HSourceInterID=" + HInterID + " and HSourceEntryID=" + HEntryID + " and HMouldID="+ HMouldID); |
| | | LogService.Write(4); |
| | | //更新掉已派工字段 |
| | | oCN.RunProc("update Sc_ProcessExchangeBillMain set HRemark3='' where HInterID=" + HInterID); |
| | | LogService.Write(5); |
| | | oCN.RunProc("delete from Sc_ICMOBillStatus_Tmp where HSourceInterID=" + HInterID + " and HSourceEntryID=" + HEntryID + " and HSourceID=" + HSourceID); |
| | | LogService.Write(6); |
| | | //查询是否有出站单这个工单这个产线 |
| | | ds = oCN.RunProcReturn("select * from Sc_StationOutBillMain where HProcExchInterID=" + HInterID + " and HProcExchEntryID=" + HEntryID + " and HSourceID=" + HSourceID + "", "Sc_StationOutBillMain"); |
| | | LogService.Write(7); |
| | | if (ds!=null && ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | //没有出站单的进行删除工序流转卡派工单 |
| | | oCN.RunProc("delete from Sc_ProcExchSendWorkBillMain where HInterID=(select HInterID from Sc_ProcExchSendWorkBillSub where HSourceInterID=" + HInterID + " and HSourceEntryID=" + HEntryID + " and HSourceID=" + HSourceID + " )"); |
| | | LogService.Write(8); |
| | | oCN.RunProc("delete from Sc_ProcExchSendWorkBillSub where HSourceInterID=" + HInterID + " and HSourceEntryID=" + HEntryID + " and HSourceID=" + HSourceID); |
| | | LogService.Write(9); |
| | | } |
| | | } |
| | | |
| | | oCN.Commit(); |