|
@@ -407,7 +407,7 @@ public class BizProcessInspecionController extends BaseController {
|
|
|
|
|
|
private boolean checkOutsourceDayworkItem(Long outsourceOrderDetailId) {
|
|
|
// 检测外协序检后是否已经周转到下一工序。
|
|
|
- BizDayworkItem bizDayworkItem = bizDayworkItemService.query().eq("outsource_detail_id", outsourceOrderDetailId).orderByDesc("process_step_number").one();
|
|
|
+ BizDayworkItem bizDayworkItem = bizDayworkItemService.query().eq("outsource_detail_id", outsourceOrderDetailId).orderByDesc("process_step_number").last("limit 1").one();
|
|
|
BizDaywork bizDaywork = bizDayworkService.getById(bizDayworkItem.getDayworkId());
|
|
|
List<BizDayworkItem> items = bizDayworkItemService.query().eq("daywork_id", bizDayworkItem.getDayworkId()).list();
|
|
|
// 下序已经报工
|
|
@@ -436,6 +436,7 @@ public class BizProcessInspecionController extends BaseController {
|
|
|
processInspecion.setDayworkItemId(dayworkItem.getId());
|
|
|
processInspecion.setProductionPlanDetailId(daywork.getProductionPlanDetailId());
|
|
|
processInspecion.setProductionPlanDetailSubDetailId(daywork.getProductionPlanDetailSubDetailId());
|
|
|
+ processInspecion.setProductDescription(processInspecion.getLot().getProductDescription());
|
|
|
processInspecion.setLotId(processInspecion.getLot().getId());
|
|
|
processInspecion.setLotCode(processInspecion.getLot().getLotCode());
|
|
|
processInspecion.setDeptId(daywork.getDeptId());
|
|
@@ -608,6 +609,7 @@ public class BizProcessInspecionController extends BaseController {
|
|
|
}
|
|
|
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
+ dayworkCarrier.setIsChanged(0);
|
|
|
List<BizDayworkCarrier> list = bizDayworkCarrierService.getList(dayworkCarrier);
|
|
|
List<BizDaywork> dayworks = bizDayworkService.query().in("id", list.isEmpty() ? Collections.singletonList(0L) : list.stream().map(BizDayworkCarrier::getDayworkId).collect(Collectors.toList())).list();
|
|
|
if (carrier.getIsInspection().equals(1)) {
|
|
@@ -656,12 +658,15 @@ public class BizProcessInspecionController extends BaseController {
|
|
|
throw new RuntimeException("该批次不是外协回收批次");
|
|
|
}
|
|
|
|
|
|
- detailList = detailList.stream()
|
|
|
- .filter(detail -> processCodes.stream().anyMatch(l -> l.trim().equals(detail.getProcessCode())))
|
|
|
- .collect(Collectors.toList());
|
|
|
- if (detailList.size() == 0) {
|
|
|
+ if (detailList.stream().noneMatch(detail -> processCodes.stream().anyMatch(l -> l.trim().equals(detail.getProcessCode())))) {
|
|
|
throw new RuntimeException("该批次不需要外协检查");
|
|
|
}
|
|
|
+ if (detailList.stream().noneMatch(detail -> detail.getIsAudit().equals(1) && detail.getStatus().equals(1))) {
|
|
|
+ throw new RuntimeException("该批次需要审核通过后才能外协检查");
|
|
|
+ }
|
|
|
+ detailList = detailList.stream()
|
|
|
+ .filter(detail -> processCodes.stream().anyMatch(l -> l.trim().equals(detail.getProcessCode())) && detail.getIsAudit().equals(1) && detail.getStatus().equals(1))
|
|
|
+ .collect(Collectors.toList());
|
|
|
//如果有多道工序,则根据工序的排序找到最后一条
|
|
|
if (detailList.size() > 1) {
|
|
|
//按照工序排序
|