|
@@ -9,7 +9,11 @@ import com.abi.qms.platform.dao.enums.FlowStatusEnum;
|
|
|
import com.abi.qms.platform.dao.enums.ReqChannelTypeEnum;
|
|
|
import com.abi.qms.platform.dto.req.AddFlowQueryRecordReq;
|
|
|
import com.abi.qms.platform.dto.req.GetBoxCodeReq;
|
|
|
+import com.abi.qms.platform.dto.req.GetInvisibleCodeReq;
|
|
|
+import com.abi.qms.platform.dto.req.GetStackCodeReq;
|
|
|
import com.abi.qms.platform.dto.res.GetBoxCodeRes;
|
|
|
+import com.abi.qms.platform.dto.res.GetInvisibleCodeRes;
|
|
|
+import com.abi.qms.platform.dto.res.GetStackCodeRes;
|
|
|
import com.abi.qms.platform.infrastructure.util.AssertUtil;
|
|
|
import com.abi.qms.platform.infrastructure.util.UserUtil;
|
|
|
import com.abi.qms.platform.service.FlowQueryService;
|
|
@@ -48,19 +52,23 @@ public class FlowQueryServiceImpl implements FlowQueryService {
|
|
|
public GetBoxCodeRes boxCode(GetBoxCodeReq req) {
|
|
|
Integer queryType = req.getQueryType();
|
|
|
GetBoxCodeRes res = null;
|
|
|
- //箱码查询
|
|
|
+
|
|
|
if (FlowQueryTypeEnum.BOX_CODE.is(queryType)) {
|
|
|
+ // 箱码(明码)查询
|
|
|
+ String boxCode = req.getBoxCode();
|
|
|
+ res = this.getFlowInfoByBoxCode(boxCode);
|
|
|
+ } else if (FlowQueryTypeEnum.INVISIBLE_CODE.is(queryType)) {
|
|
|
+ // 箱码(隐形码)查询
|
|
|
String boxCode = req.getBoxCode();
|
|
|
res = this.getFlowInfoByBoxCode(boxCode);
|
|
|
}
|
|
|
|
|
|
- AssertUtil.isNull(res, "为查询到流向信息!");
|
|
|
+ AssertUtil.isNull(res, "未查询到流向信息!");
|
|
|
//保存查询记录
|
|
|
this.saveQueryRecord(res, req);
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 查询流向信息
|
|
|
*
|
|
@@ -149,6 +157,73 @@ public class FlowQueryServiceImpl implements FlowQueryService {
|
|
|
}
|
|
|
|
|
|
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 隐形码查询
|
|
|
+ * TODO 测试使用,待流向查询接口完成后,根据实际情况调整结构
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public GetInvisibleCodeRes invisibleCode(GetInvisibleCodeReq req) {
|
|
|
+ String invisibleCode = req.getInvisibleCode();
|
|
|
+ List<GetInvisibleCodeRes.InvisibleCodeBean> invisibleCodeList = new ArrayList<>();
|
|
|
+ GetInvisibleCodeRes.InvisibleCodeBean invisibleCodeBean;
|
|
|
+ // 模拟10条数据
|
|
|
+ for (int i = 0; i < 10; i++) {
|
|
|
+ invisibleCodeBean = new GetInvisibleCodeRes.InvisibleCodeBean()
|
|
|
+ .setBoxCode(invisibleCode.replace("_", String.valueOf(i)))
|
|
|
+ .setInvisibleCode(invisibleCode.replace("_", String.valueOf(i)))
|
|
|
+ .setStackTime(LocalDateTime.now());
|
|
|
+ invisibleCodeList.add(invisibleCodeBean);
|
|
|
+ }
|
|
|
+ return new GetInvisibleCodeRes().setInvisibleCodeList(invisibleCodeList);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 垛码查询
|
|
|
+ * TODO 测试使用,待流向查询接口完成后,根据实际情况调整结构
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public GetStackCodeRes stackCode(GetStackCodeReq req) {
|
|
|
+ GetStackCodeRes res = new GetStackCodeRes();
|
|
|
+
|
|
|
+ GetStackCodeRes.SkuBean sku = new GetStackCodeRes.SkuBean()
|
|
|
+ .setBrandCode("01AAHF")
|
|
|
+ .setBrandName("百威")
|
|
|
+ .setSkuId("000000000000025000")
|
|
|
+ .setSkuName("百威9.7度330ML4X6半托纸箱听装(机械改包)");
|
|
|
+
|
|
|
+ List flowList = new LinkedList();
|
|
|
+ GetStackCodeRes.FlowBean flow = new GetStackCodeRes.FlowBean()
|
|
|
+ .setNodeId(8903L)
|
|
|
+ .setNodeName("一级经销商")
|
|
|
+ .setInStorageTime(LocalDateTime.of(2020, 12, 24, 11, 12, 38))
|
|
|
+ .setOutStorageTime(LocalDateTime.of(2020, 12, 24, 15, 12, 33));
|
|
|
+ flowList.add(flow);
|
|
|
+
|
|
|
+ flow = new GetStackCodeRes.FlowBean()
|
|
|
+ .setNodeId(8902L)
|
|
|
+ .setNodeName("XXXX-上海吴泾DC")
|
|
|
+ .setInStorageTime(LocalDateTime.of(2020, 12, 20, 9, 31, 33))
|
|
|
+ .setOutStorageTime(LocalDateTime.of(2020, 12, 20, 9, 31, 33));
|
|
|
+
|
|
|
+ flowList.add(flow);
|
|
|
+ Collections.reverse(flowList);
|
|
|
+
|
|
|
+ GetStackCodeRes.StackBean stack = new GetStackCodeRes.StackBean()
|
|
|
+ .setStackCode(req.getStackCode())
|
|
|
+ .setStackTime(LocalDateTime.now());
|
|
|
+
|
|
|
+ res.setSku(sku);
|
|
|
+ res.setFlowList(flowList);
|
|
|
+ res.setStack(stack);
|
|
|
+
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 保存查询记录
|
|
|
*
|
|
@@ -169,7 +244,10 @@ public class FlowQueryServiceImpl implements FlowQueryService {
|
|
|
|
|
|
//查询类型
|
|
|
Integer queryType = req.getQueryType();
|
|
|
- AddFlowQueryRecordReq addReq = new AddFlowQueryRecordReq(flowStatus.getCode(), queryType);
|
|
|
+ AddFlowQueryRecordReq addReq = new AddFlowQueryRecordReq();
|
|
|
+ addReq.setFlowStatus(flowStatus.getCode());
|
|
|
+ addReq.setQueryType(queryType);
|
|
|
+
|
|
|
|
|
|
// 箱码 查询类型为箱码时必传
|
|
|
addReq.setBoxCode(req.getBoxCode());
|