|
|
|
|
@ -1543,16 +1543,22 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO |
|
|
|
|
if ("1".equals(frontWorkPlan.getOem()) && "1".equals(workPlan.getOem())) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
List<PlateAround> pa = plateAroundMapper.selectList(Wrappers.lambdaQuery(PlateAround.class).eq(PlateAround::getPaType, PlateAround.BEFORE_PLAN_OUT).eq(PlateAround::getWpId, workPlan.getId())); |
|
|
|
|
if (CollectionUtils.isEmpty(pa)) { |
|
|
|
|
if ("1".equals(frontWorkPlan.getOem())) { |
|
|
|
|
//上序外协,本序如果可以接收,验证镀前出库记录
|
|
|
|
|
throw new ServiceException("工序加工单位不同,未找到镀前出库记录,无法接收!"); |
|
|
|
|
} else if (!frontWorkPlan.getMakeTeam().equals(workPlan.getMakeTeam())) { |
|
|
|
|
//加工班组不同,验证镀前出库记录
|
|
|
|
|
throw new ServiceException("工序加工单位不同,未找到镀前出库记录,无法接收!"); |
|
|
|
|
List<PlateAround> pa = plateAroundMapper.selectList(Wrappers.lambdaQuery(PlateAround.class).eq(PlateAround::getPaType, PlateAround.BEFORE_PLAT_IN).eq(PlateAround::getWpId, frontWorkPlan.getId())); |
|
|
|
|
if (CollectionUtils.isNotEmpty(pa)) { |
|
|
|
|
List<PlateAround> pa2 = plateAroundMapper.selectList(Wrappers.lambdaQuery(PlateAround.class).eq(PlateAround::getPaType, PlateAround.BEFORE_PLAN_OUT).eq(PlateAround::getWpId, frontWorkPlan.getId())); |
|
|
|
|
if (CollectionUtils.isEmpty(pa2)) { |
|
|
|
|
throw new ServiceException("上序未查询到镀前出库记录,无法接收!"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// if (CollectionUtils.isEmpty(pa)) {
|
|
|
|
|
// if ("1".equals(frontWorkPlan.getOem())) {
|
|
|
|
|
// //上序外协,本序如果可以接收,验证镀前出库记录
|
|
|
|
|
// throw new ServiceException("工序加工单位不同,未找到镀前出库记录,无法接收!");
|
|
|
|
|
// } else if (!frontWorkPlan.getMakeTeam().equals(workPlan.getMakeTeam())) {
|
|
|
|
|
// //加工班组不同,验证镀前出库记录
|
|
|
|
|
// throw new ServiceException("工序加工单位不同,未找到镀前出库记录,无法接收!");
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void workPlanStart(WorkPlan workPlan, Date startDate, Long userId, WorkOrder workOrder) { |
|
|
|
|
|