|
|
|
|
@ -1591,6 +1591,53 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO |
|
|
|
|
|
|
|
|
|
// 开始本序
|
|
|
|
|
this.workPlanStart(workPlan, newDate, AuthUtil.getUserId(), workOrder); |
|
|
|
|
|
|
|
|
|
//上序存在绑定信息
|
|
|
|
|
if (frontWorkPlan != null && (WorkPlan.BIND_STATUS_BIND.equals(frontWorkPlan.getBindStatus()) || WorkPlan.BIND_STATUS_WORK.equals(frontWorkPlan.getBindStatus()))) { |
|
|
|
|
List<MacToolUse> mtuLst = macToolUseService.listMacToolUse(frontWorkPlan.getId(), true); |
|
|
|
|
//当前序是下挂的话,解除所有绑定
|
|
|
|
|
if (1045 == workPlan.getPpsId()) { |
|
|
|
|
if (mtuLst != null && !mtuLst.isEmpty()) { |
|
|
|
|
macToolUseService.unMacToolUseBind(mtuLst); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
//更改当前序绑定状态为加工中
|
|
|
|
|
workPlan.setBindStatus(WorkPlan.BIND_STATUS_WORK); |
|
|
|
|
//产生同槽号
|
|
|
|
|
String code = null; |
|
|
|
|
if (mtuLst != null && !mtuLst.isEmpty()) { |
|
|
|
|
MacToolUse oldMac = mtuLst.get(0); |
|
|
|
|
if (oldMac.getEquipmentCard() != null) { |
|
|
|
|
code = macToolUseService.nextCode(2); |
|
|
|
|
} else if (oldMac.getBsFeiBaSet() != null) { |
|
|
|
|
code = macToolUseService.nextCode(1); |
|
|
|
|
} else { |
|
|
|
|
code = macToolUseService.nextCode(0); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
//复制上序使用的设备,工装记录
|
|
|
|
|
for (MacToolUse mtu : mtuLst) { |
|
|
|
|
if (mtu != null && "2".equals(mtu.getMtuIndex())) { |
|
|
|
|
MacToolUse newMtu = new MacToolUse(); |
|
|
|
|
newMtu.setWpId(workPlan.getId()); |
|
|
|
|
newMtu.setMtnCode(code); |
|
|
|
|
newMtu.setBsRackSet(mtu.getBsRackSet()); |
|
|
|
|
newMtu.setBsFeiBaSet(mtu.getBsFeiBaSet()); |
|
|
|
|
newMtu.setEquipmentCard(mtu.getEquipmentCard()); |
|
|
|
|
newMtu.setCreateMan(mtu.getCreateMan()); |
|
|
|
|
newMtu.setCreateTime(mtu.getCreateTime()); |
|
|
|
|
newMtu.setFinished(mtu.getFinished()); |
|
|
|
|
macToolUseService.save(newMtu); |
|
|
|
|
//更改绑定记录为结束
|
|
|
|
|
mtu.setFinished(1); |
|
|
|
|
macToolUseService.updateById(mtu); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
//更改上序绑定状态为解绑
|
|
|
|
|
frontWorkPlan.setBindStatus(WorkPlan.BIND_STATUS_FREE); |
|
|
|
|
workPlanService.updateById(frontWorkPlan); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
|