张昭 3 роки тому
батько
коміт
130d3dbc8a

+ 16 - 1
abi-cloud-qr-platform-server/src/main/java/com/abi/qms/platform/controller/console/InspectionCaseController.java

@@ -6,6 +6,7 @@ import java.util.Arrays;
 import cn.hutool.core.util.StrUtil;
 import com.abi.qms.platform.dto.req.*;
 import com.abi.qms.platform.dto.res.*;
+import com.abi.qms.platform.feign.SkuFeign;
 import com.abi.qms.platform.service.IInspectionCaseService;
 import com.abi.task.common.api.base.BaseResponse;
 import com.abi.task.common.excel.ExcelInputFactory;
@@ -39,6 +40,9 @@ public class InspectionCaseController {
     @Autowired
     private IInspectionCaseService inspectionCaseService;
 
+    @Autowired
+    private SkuFeign skuFeign;
+
 
     /**
      * 新增稽查案件
@@ -132,11 +136,22 @@ public class InspectionCaseController {
 
     @ResponseBody
     @ApiOperation(value = "导出")
-    @GetMapping("export")
+    @GetMapping("/export")
     public void export(@Validated ExportInspectionCaseReq req, HttpServletResponse response) {
         List<ExportInspectionCaseRes> resList = inspectionCaseService.export(req);
         ExcelInputFactory.downloadExcelData("稽查案件", response, resList, ExportInspectionCaseRes.class);
     }
 
 
+
+    @ResponseBody
+    @ApiOperation(value = "模拟SKU模糊搜索服务")
+    @GetMapping("/sku/{inquire}")
+    public BaseResponse<List> getSku(@PathVariable("inquire") String inquire) {
+        List<SkuFeign.Sku> skus = skuFeign.likeQuerySkuByCodeOrName(inquire);
+        return BaseResponse.create(skus);
+    }
+
+
+
 }

+ 47 - 0
abi-cloud-qr-platform-server/src/main/java/com/abi/qms/platform/feign/SkuFeign.java

@@ -4,6 +4,9 @@ import lombok.Data;
 import lombok.experimental.Accessors;
 import org.springframework.stereotype.Service;
 
+import java.util.Arrays;
+import java.util.List;
+
 /**
  * TODO 无法调用其他微服务,模拟SkuFeign
  * @author WeiganCai
@@ -22,6 +25,50 @@ public class SkuFeign {
 
 	}
 
+
+	public List<Sku> likeQuerySkuByCodeOrName(String skuInquire) {
+		return Arrays.asList(
+				new Sku()
+				.setSkuId(215L)
+				.setSkuCode("000000000000005957")
+				.setSkuName("贝克11.2度275ML 4X6 纸箱OW瓶")
+				.setBrandCode("01AAAC")
+				.setBrandName("贝克"),
+
+				new Sku()
+				.setSkuId(215L)
+				.setSkuCode("000000000000025000")
+				.setSkuName("哈尔滨特制超鲜10度610ML1X12纸箱OW瓶装")
+				.setBrandCode("01ABZY")
+				.setBrandName("哈尔滨"),
+
+				new Sku()
+					.setSkuId(215L)
+					.setSkuCode("000000000000025010")
+					.setSkuName("哈尔滨冰纯9.1度600ML1X12纸箱回瓶装")
+					.setBrandCode("01ABZY")
+					.setBrandName("哈尔滨"),
+
+				new Sku()
+					.setSkuId(215L)
+					.setSkuCode("000000000000025161")
+					.setSkuName("百威纯生8度330ML1X24纸箱OW瓶装")
+					.setBrandCode("01AAHF")
+					.setBrandName("百威")
+		);
+
+
+
+
+	}
+
+
+
+
+
+
+
+
 	@Data
 	@Accessors(chain = true)
 	public static class Sku {

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

@@ -38,6 +38,21 @@ 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);
+        }
+    }
+
+
+
     /**
      * 如果集合为空,则抛出异常
      *

+ 3 - 3
abi-cloud-qr-platform-server/src/main/java/com/abi/qms/platform/service/impl/FlowQueryServiceImpl.java

@@ -244,9 +244,9 @@ public class FlowQueryServiceImpl implements FlowQueryService {
 
             //查询类型
             Integer queryType = req.getQueryType();
-            AddFlowQueryRecordReq addReq = new AddFlowQueryRecordReq();
-            addReq.setFlowStatus(flowStatus.getCode());
-            addReq.setQueryType(queryType);
+            AddFlowQueryRecordReq addReq = new AddFlowQueryRecordReq(flowStatus.getCode(),queryType);
+            //addReq.setFlowStatus();
+            //addReq.setQueryType();
 
 
             //  箱码 查询类型为箱码时必传

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

@@ -553,8 +553,8 @@ public class InspectionCaseServiceImpl implements IInspectionCaseService {
             }
         }
 
-        AssertUtil.isEmpty(skuErrBoxCode, "案件新增失败!箱码:" + CollectionUtil.join(skuErrBoxCode, ";") + "失败原因:SKU信息不一致");
-        AssertUtil.isEmpty(flowErrBoxCode, "案件新增失败!箱码:" + CollectionUtil.join(flowErrBoxCode, ";") + "失败原因:流向信息不一致");
+        AssertUtil.isEmpty(skuErrBoxCode, "箱码:" + CollectionUtil.join(skuErrBoxCode, ";") + "<br/>失败原因:SKU信息不一致");
+        AssertUtil.isEmpty(flowErrBoxCode, "箱码:" + CollectionUtil.join(flowErrBoxCode, ";") + "<br/>失败原因:流向信息不一致");
     }