ezhizao_zx 2 주 전
부모
커밋
76399f0d2c
1개의 변경된 파일3개의 추가작업 그리고 6개의 파일을 삭제
  1. 3 6
      src/main/java/cn/ezhizao/project/business/controller/BizInboundOrderController.java

+ 3 - 6
src/main/java/cn/ezhizao/project/business/controller/BizInboundOrderController.java

@@ -16,10 +16,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
 import javax.annotation.Resource;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 import java.util.stream.Collectors;
 
 
@@ -50,8 +47,8 @@ public class BizInboundOrderController extends BaseController {
         if (list.isEmpty()) {
             return error("没有找到托盘码对应入库单");
         }
-        List<BizInboundOrderDetail> detailList = bizInboundOrderDetailService.query().in("inbound_order_id", list.stream().map(BizInboundOrder::getId).collect(Collectors.toList())).list();
-        List<BizCertificate> bizCertificateList = bizCertificateService.query().in("id", detailList.stream().map(BizInboundOrderDetail::getCertificateId).collect(Collectors.toList())).list();
+        List<BizInboundOrderDetail> detailList = bizInboundOrderDetailService.query().in("inbound_order_id", list.isEmpty() ? Collections.singletonList(0L) : list.stream().map(BizInboundOrder::getId).collect(Collectors.toList())).list();
+        List<BizCertificate> bizCertificateList = bizCertificateService.query().in("id",  detailList.isEmpty() ? Collections.singletonList(0L) : detailList.stream().map(BizInboundOrderDetail::getCertificateId).collect(Collectors.toList())).list();
 
         List<Map<String, Object>> inboundList = new ArrayList<>();
         list.forEach(l -> {