|
@@ -95,11 +95,6 @@ public class InspectionController extends SuperController<InspectionService, Lon
|
|
|
//在当前零件加工工序之后
|
|
|
wrapper.le(BomProcedure::getSort, sort);
|
|
|
}
|
|
|
- Inspection inspection = baseService.getOne(new LbqWrapper<Inspection>().eq(Inspection::getWorkpieceId, workPiece.getId()));
|
|
|
- //排除已经提交抽检的工序
|
|
|
- if (null != inspection && null != inspection.getProcedureId()) {
|
|
|
- wrapper.ne(BomProcedure::getId, inspection.getProcedureId());
|
|
|
- }
|
|
|
|
|
|
List<Long> idList = bomProcedureService.list(wrapper).stream().filter(data -> {
|
|
|
//排除保障中心设备序
|
|
@@ -107,7 +102,15 @@ public class InspectionController extends SuperController<InspectionService, Lon
|
|
|
return zZoneService.getById(zone_id).getNo() != "safeguard";
|
|
|
}).map(BomProcedure::getId).collect(Collectors.toList());
|
|
|
//获取已存在的工序的任务节点
|
|
|
- List<TTask> dataList = taskService.list(new LbqWrapper<TTask>().eq(TTask::getCompleteBatchNo, workPiece.getCompleteBatchNo()).eq(TTask::getPlanId, map.get("planId").toString()).in(TTask::getProcedureId, idList.toArray()));
|
|
|
+ LbqWrapper<TTask> taskLbqWrapper = new LbqWrapper<TTask>();
|
|
|
+ taskLbqWrapper.eq(TTask::getCompleteBatchNo, workPiece.getCompleteBatchNo()).eq(TTask::getPlanId, map.get("planId").toString()).in(TTask::getProcedureId, idList.toArray());
|
|
|
+
|
|
|
+ Inspection inspection = baseService.getOne(new LbqWrapper<Inspection>().eq(Inspection::getWorkpieceId, workPiece.getId()));
|
|
|
+ //排除已经提交抽检的工序
|
|
|
+ if (null != inspection && null != inspection.getTaskId()) {
|
|
|
+ taskLbqWrapper.ne(TTask::getId, inspection.getTaskId());
|
|
|
+ }
|
|
|
+ List<TTask> dataList = taskService.list(taskLbqWrapper);
|
|
|
return success(dataList);
|
|
|
}
|
|
|
|
|
@@ -116,8 +119,8 @@ public class InspectionController extends SuperController<InspectionService, Lon
|
|
|
public R<Inspection> save(@RequestBody InspectionSaveDTO model) {
|
|
|
Inspection inspection = BeanUtil.toBean(model, Inspection.class);
|
|
|
if (baseService.check(model)) {
|
|
|
- //baseService.createTaskNode(model);
|
|
|
- return baseService.save(inspection) ? success(inspection) : fail("新增失败");
|
|
|
+ baseService.createTaskNode(model);
|
|
|
+ //return baseService.save(inspection) ? success(inspection) : fail("新增失败");
|
|
|
}
|
|
|
return fail("新增条件判断失败");
|
|
|
}
|