|
@@ -16,6 +16,7 @@ import cn.ezhizao.project.business.carrierReject.domain.BizCarrierReject;
|
|
|
import cn.ezhizao.project.business.carrierReject.service.IBizCarrierRejectService;
|
|
|
import cn.ezhizao.project.business.outsource.domain.BizOutsourcedOrderDetail;
|
|
|
import cn.ezhizao.project.business.outsource.domain.BizOutsourcedOrderDetailProcess;
|
|
|
+import cn.ezhizao.project.business.outsource.service.IBizOutsourcedOrderDetailProcessService;
|
|
|
import cn.ezhizao.project.business.outsource.service.IBizOutsourcedOrderDetailService;
|
|
|
import cn.ezhizao.project.business.product.domain.*;
|
|
|
import cn.ezhizao.project.business.product.service.*;
|
|
@@ -87,6 +88,8 @@ public class BizProcessInspecionController extends BaseController {
|
|
|
private IBizProcessInspectionDetailService processInspectionDetailService;
|
|
|
@Resource
|
|
|
private IBizOutsourcedOrderDetailService bizOutsourcedOrderDetailService;
|
|
|
+ @Resource
|
|
|
+ private IBizOutsourcedOrderDetailProcessService bizOutsourcedOrderDetailProcessService;
|
|
|
|
|
|
/**
|
|
|
* 查询序检主列表
|
|
@@ -408,7 +411,7 @@ public class BizProcessInspecionController extends BaseController {
|
|
|
|
|
|
private boolean checkOutsourceDayworkItem(Long outsourceOrderDetailId) {
|
|
|
// 检测外协序检后是否已经周转到下一工序。
|
|
|
- BizDayworkItem bizDayworkItem = bizDayworkItemService.query().eq("outsource_detail_id", outsourceOrderDetailId).orderByDesc("process_step_number").last("limit 1").one();
|
|
|
+ BizDayworkItem bizDayworkItem = bizDayworkItemService.query().eq("outsource_detail_id", outsourceOrderDetailId).orderByDesc("create_time").last("limit 1").one();
|
|
|
BizDaywork bizDaywork = bizDayworkService.getById(bizDayworkItem.getDayworkId());
|
|
|
List<BizDayworkItem> items = bizDayworkItemService.query().eq("daywork_id", bizDayworkItem.getDayworkId()).list();
|
|
|
// 下序已经报工
|
|
@@ -569,6 +572,7 @@ public class BizProcessInspecionController extends BaseController {
|
|
|
* 根据箱号查询是否为检查载具,或一箱多批
|
|
|
*/
|
|
|
// @PostMapping("/getCarrierInfo")
|
|
|
+ @PostMapping("/getCarrierInfoProcess")
|
|
|
public AjaxResult getCarrierInfo(@RequestBody BizDayworkCarrier dayworkCarrier) throws NoSuchFieldException, IllegalAccessException {
|
|
|
// List<BizDayworkCarrier> list = bizDayworkCarrierService.query().eq("carrier_code",dayworkCarrier.getCarrierCode()).eq("deleted",0).eq("is_changed",0).list();
|
|
|
dayworkCarrier.setIsChanged(0);
|
|
@@ -642,6 +646,7 @@ public class BizProcessInspecionController extends BaseController {
|
|
|
codes.add("27110");
|
|
|
codes.add("28030");
|
|
|
codes.add("28080");
|
|
|
+ codes.add("27070");
|
|
|
List<String> processCodes = dayworkCarrier.getProcessCode() == null ? codes : dayworkCarrier.getProcessCode();
|
|
|
System.out.println("查询工序编码:processCodes" + processCodes);
|
|
|
//根据箱号查询当前绑定信息
|
|
@@ -655,23 +660,27 @@ public class BizProcessInspecionController extends BaseController {
|
|
|
BizReturnReceiptDetail bizReturnReceiptDetail = new BizReturnReceiptDetail();
|
|
|
bizReturnReceiptDetail.setDayworkId(dayworkCarrier.getDayworkId());
|
|
|
List<BizReturnReceiptDetail> detailList = bizReturnReceiptDetailService.getList(bizReturnReceiptDetail);
|
|
|
+ List<BizOutsourcedOrderDetailProcess> processes = bizOutsourcedOrderDetailProcessService.query().in("detail_id", detailList.isEmpty() ? Collections.singletonList(0L) : detailList.stream().map(BizReturnReceiptDetail::getOutsourceDetailId).collect(Collectors.toList())).list();
|
|
|
System.out.println("查询是否有该批次:detailList" + detailList);
|
|
|
if (detailList.size() == 0) {
|
|
|
throw new RuntimeException("该批次不是外协回收批次");
|
|
|
}
|
|
|
|
|
|
- if (detailList.stream().noneMatch(detail -> processCodes.stream().anyMatch(l -> l.trim().equals(detail.getProcessCode())))) {
|
|
|
+ if (processes.stream().noneMatch(detail -> processCodes.stream().anyMatch(l -> l.trim().equals(detail.getProcessCode())))) {
|
|
|
throw new RuntimeException("该批次不需要外协检查");
|
|
|
}
|
|
|
// 现在先不考虑 审核通过后才能外协检查限制先放到下一迭代 20240625
|
|
|
-// if (detailList.stream().noneMatch(detail -> detail.getIsAudit().equals(1) && detail.getStatus().equals(1))) {
|
|
|
-// throw new RuntimeException("该批次需要审核通过后才能外协检查");
|
|
|
-// }
|
|
|
+// 20240703 加回去
|
|
|
+ if (detailList.stream().noneMatch(detail -> detail.getIsAudit().equals(1) && detail.getStatus().equals(1))) {
|
|
|
+ throw new RuntimeException("该批次需要审核通过后才能外协检查");
|
|
|
+ }
|
|
|
detailList = detailList.stream()
|
|
|
+ .filter(detail -> processes.stream().anyMatch(v -> v.getTechnologicalProcessDetailId().equals(detail.getTechnologicalProcessDetailId())))
|
|
|
.filter(detail -> processCodes.stream().anyMatch(l -> l.trim().equals(detail.getProcessCode())) &&
|
|
|
detail.getIsAudit().equals(1)
|
|
|
// 现在先不考虑 审核通过后才能外协检查限制先放到下一迭代 20240625
|
|
|
-// && detail.getStatus().equals(1)
|
|
|
+// 20240703加回去
|
|
|
+ && detail.getStatus().equals(1)
|
|
|
)
|
|
|
.collect(Collectors.toList());
|
|
|
//如果有多道工序,则根据工序的排序找到最后一条
|