소스 검색

关联案件调整

张昭 3 년 전
부모
커밋
16cb22fec2

+ 1 - 1
abi-cloud-qr-platform-server/src/main/java/com/abi/qms/platform/dao/mapper/InspectionCaseFlowMapper.java

@@ -32,5 +32,5 @@ public interface InspectionCaseFlowMapper extends BaseMapper<InspectionCaseFlow>
      * @param id
      * @return
      */
-    List<InspectionCaseFlow> selectList(@Param("caseId") Long id);
+    List<InspectionCaseFlow> getList(@Param("caseId") Long id);
 }

+ 0 - 31
abi-cloud-qr-platform-server/src/main/java/com/abi/qms/platform/dto/req/AssociatedWithCaseReq.java

@@ -36,38 +36,7 @@ public class AssociatedWithCaseReq implements Serializable {
     private String boxCode;
 
 
-    @ApiModelProperty("skuCode")
-    @NotBlank
-    private String skuCode;
-
-    @ApiModelProperty("流向信息列表")
-    @NotEmpty
-    private List<FlowBean> flowList;
-
-    /**
-     * 流向信息
-     */
-    @Data
-    @NoArgsConstructor
-    @AllArgsConstructor
-    @ToString
-    public static class FlowBean implements Serializable {
-        @ApiModelProperty("节点标识")
-        @NotNull
-        private Long nodeId;
-
-        @ApiModelProperty("节点名称")
-        private String nodeName;
-
-
-        @ApiModelProperty("入库时间")
-        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-        private LocalDateTime inStorageTime;
 
-        @ApiModelProperty("出库时间")
-        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-        private LocalDateTime outStorageTime;
-    }
 
 
 }

+ 1 - 11
abi-cloud-qr-platform-server/src/main/java/com/abi/qms/platform/infrastructure/util/AssertUtil.java

@@ -39,17 +39,7 @@ public class AssertUtil {
     }
 
 
-    /**
-     * 如果集合不为空,则抛出异常
-     *
-     * @param coll
-     * @param msg
-     */
-    public  static <T> void isEmpty(Collection<?> coll, String msg,T t) {
-        if (CollectionUtil.isNotEmpty(coll)) {
-            throw new BusinessException(msg);
-        }
-    }
+
 
 
 

+ 11 - 6
abi-cloud-qr-platform-server/src/main/java/com/abi/qms/platform/service/impl/InspectionCaseServiceImpl.java

@@ -323,7 +323,7 @@ public class InspectionCaseServiceImpl implements IInspectionCaseService {
 
         //查询对应流向信息
 
-        List<InspectionCaseFlow> inspectionCaseFlowList = inspectionCaseFlowMapper.selectList(id);
+        List<InspectionCaseFlow> inspectionCaseFlowList = inspectionCaseFlowMapper.getList(id);
         //转换类型
         List<GetInspectionCaseInfoRes.FlowBean> flowBeanList = PojoConverterUtils.copyList(inspectionCaseFlowList, GetInspectionCaseInfoRes.FlowBean.class);
         getInspectionCaseInfoRes.setFlowList(flowBeanList);
@@ -372,14 +372,19 @@ public class InspectionCaseServiceImpl implements IInspectionCaseService {
 
         Long caseId = req.getCaseId();
         String boxCode = req.getBoxCode();
-        List<AssociatedWithCaseReq.FlowBean> reqFlowList = req.getFlowList();
+        //查询箱码信息
+        List<String> boxCodeList = Collections.singletonList(boxCode);
+        List<GetBoxCodeRes> flowInfoByBoxCodeList = this.getFlowInfoByBoxCodeList(boxCodeList);
+        GetBoxCodeRes getBoxCodeRes = flowInfoByBoxCodeList.get(0);
+
+        List<GetBoxCodeRes.FlowBean> reqFlowList = getBoxCodeRes.getFlowList();
         //验证指定案件是否存在
         InspectionCase inspectionCase = inspectionCaseMapper.selectById(caseId);
         AssertUtil.isNull(inspectionCase, "指定案件不存在或已被删除!");
 
         //验证SKU是否一致
         String skuCode = inspectionCase.getSkuCode();
-        AssertUtil.isMeets(req.getSkuCode(), s -> StrUtil.equals(s, skuCode), "当前箱码与指定案件SKU不一致!");
+        AssertUtil.isMeets(getBoxCodeRes.getSku().getSkuId(), s -> StrUtil.equals(s, skuCode), "当前箱码与指定案件SKU不一致!");
 
         //验证当前箱码是否已经存在
         QueryWrapper<InspectionCaseBoxCode> boxCodeQW = new QueryWrapper<>();
@@ -398,7 +403,7 @@ public class InspectionCaseServiceImpl implements IInspectionCaseService {
                 .collect(Collectors.toList());
         //请求流向节点
         List<Long> reqNodeIds = reqFlowList.stream()
-                .map(AssociatedWithCaseReq.FlowBean::getNodeId)
+                .map(GetBoxCodeRes.FlowBean::getNodeId)
                 .collect(Collectors.toList());
 
 
@@ -418,7 +423,7 @@ public class InspectionCaseServiceImpl implements IInspectionCaseService {
         //请求流向最小出库时间
         LocalDateTime resOutStorageTime = reqFlowList.stream()
                 .filter(s -> Objects.nonNull(s.getOutStorageTime()))
-                .min(Comparator.comparing(AssociatedWithCaseReq.FlowBean::getOutStorageTime))
+                .min(Comparator.comparing(GetBoxCodeRes.FlowBean::getOutStorageTime))
                 .get()
                 .getOutStorageTime();
 
@@ -493,7 +498,7 @@ public class InspectionCaseServiceImpl implements IInspectionCaseService {
         List<GetBoxCodeRes> getBoxCodeResList = new ArrayList<>();
         boxCodeList.forEach(s -> {
             GetBoxCodeRes res = flowQueryService.getFlowInfoByBoxCode(s);
-            AssertUtil.isNull(res, "案件新增失败!箱码:" + s + ",失败原因:未查询到此箱码信息!");
+            AssertUtil.isNull(res, "失败!箱码:" + s + ",失败原因:未查询到此箱码信息!");
             getBoxCodeResList.add(res);
         });
         return getBoxCodeResList;

+ 1 - 1
abi-cloud-qr-platform-server/src/main/resources/dao/mapper/InspectionCaseFlowMapper.xml

@@ -72,7 +72,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </update>
 
 
-    <select id="selectList" resultMap="InspectionCaseFlowResult">
+    <select id="getList" resultMap="InspectionCaseFlowResult">
         SELECT
             id,
             inspection_case_id,