|
@@ -231,7 +231,12 @@ public class FlowQueryServiceImpl implements FlowQueryService {
|
|
|
}
|
|
|
AssertUtil.isNull(res, "未查询到流向信息!");
|
|
|
//保存查询记录
|
|
|
- this.saveQueryRecord(res, req);
|
|
|
+ SaveFlowQueryRecordReq saveFlowQueryRecordReq = new SaveFlowQueryRecordReq()
|
|
|
+ .setQueryType(queryType)
|
|
|
+ .setQueryPlatform(ReqChannelTypeEnum.BACKSTAGE.getCode())
|
|
|
+ .setQueryAddress("");
|
|
|
+
|
|
|
+ this.saveQueryRecord(res, saveFlowQueryRecordReq);
|
|
|
return res;
|
|
|
}
|
|
|
|
|
@@ -381,8 +386,13 @@ public class FlowQueryServiceImpl implements FlowQueryService {
|
|
|
@Override
|
|
|
public WxGetBoxCodeRes wxBoxCode(WxGetBoxCodeReq req) {
|
|
|
// TODO 处理逻辑同console端,待流向查询接口完成后修改
|
|
|
- GetFlowInfoRes flowInfoByBoxCode = this.getFlowInfoByBoxCode(req.getBoxCode());
|
|
|
- return PojoConverterUtils.copy(flowInfoByBoxCode, WxGetBoxCodeRes.class);
|
|
|
+ GetFlowInfoRes res = this.getFlowInfoByBoxCode(req.getBoxCode());
|
|
|
+ SaveFlowQueryRecordReq saveFlowQueryRecordReq = new SaveFlowQueryRecordReq()
|
|
|
+ .setQueryType(req.getQueryType())
|
|
|
+ .setQueryPlatform(ReqChannelTypeEnum.WECHAT.getCode())
|
|
|
+ .setQueryAddress("");
|
|
|
+ this.saveQueryRecord(res, saveFlowQueryRecordReq);
|
|
|
+ return PojoConverterUtils.copy(res, WxGetBoxCodeRes.class);
|
|
|
}
|
|
|
|
|
|
|
|
@@ -390,10 +400,10 @@ public class FlowQueryServiceImpl implements FlowQueryService {
|
|
|
* 微信隐形码查询
|
|
|
*/
|
|
|
@Override
|
|
|
- public WxGetInvisibleCodeRes WxInvisibleCode(WxGetInvisibleCodeReq req) {
|
|
|
+ public WxGetInvisibleCodeRes wxInvisibleCode(WxGetInvisibleCodeReq req) {
|
|
|
// TODO 处理逻辑同console端,待流向查询接口完成后修改
|
|
|
- GetFlowInfoRes flowInfoByInvisibleCode = this.getFlowInfoByInvisibleCode(req.getInvisibleCode());
|
|
|
- return PojoConverterUtils.copy(flowInfoByInvisibleCode, WxGetInvisibleCodeRes.class);
|
|
|
+ GetFlowInfoRes res = this.getFlowInfoByInvisibleCode(req.getInvisibleCode());
|
|
|
+ return PojoConverterUtils.copy(res, WxGetInvisibleCodeRes.class);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -402,8 +412,13 @@ public class FlowQueryServiceImpl implements FlowQueryService {
|
|
|
@Override
|
|
|
public WxGetStackCodeRes wxStackCode(WxGetStackCodeReq req) {
|
|
|
// TODO 处理逻辑同console端,待流向查询接口完成后修改
|
|
|
- GetFlowInfoRes stackCodeRes = this.getFlowInfoByStackCode(req.getStackCode());
|
|
|
- return PojoConverterUtils.copy(stackCodeRes, WxGetStackCodeRes.class);
|
|
|
+ GetFlowInfoRes res = this.getFlowInfoByStackCode(req.getStackCode());
|
|
|
+ SaveFlowQueryRecordReq saveFlowQueryRecordReq = new SaveFlowQueryRecordReq()
|
|
|
+ .setQueryType(FlowQueryTypeEnum.TRAY_CODE.getCode())
|
|
|
+ .setQueryPlatform(ReqChannelTypeEnum.WECHAT.getCode())
|
|
|
+ .setQueryAddress("");
|
|
|
+ this.saveQueryRecord(res, saveFlowQueryRecordReq);
|
|
|
+ return PojoConverterUtils.copy(res, WxGetStackCodeRes.class);
|
|
|
}
|
|
|
|
|
|
|
|
@@ -413,13 +428,13 @@ public class FlowQueryServiceImpl implements FlowQueryService {
|
|
|
* @param res 查询结果
|
|
|
* @param req 查询请求
|
|
|
*/
|
|
|
- private void saveQueryRecord(GetFlowInfoRes res, GetBoxCodeReq req) {
|
|
|
+ private void saveQueryRecord(GetFlowInfoRes res, SaveFlowQueryRecordReq req) {
|
|
|
try {
|
|
|
//查询类型
|
|
|
Integer queryType = req.getQueryType();
|
|
|
//判断流向状态
|
|
|
Map<Integer, GetFlowInfoRes.FlowBean> abnormalNodeMap = new HashMap<>();
|
|
|
- if (!FlowQueryTypeEnum.TRAY_CODE.is(req.getQueryType())) {
|
|
|
+ if (!FlowQueryTypeEnum.TRAY_CODE.is(queryType)) {
|
|
|
abnormalNodeMap = res.getFlowList()
|
|
|
.stream()
|
|
|
.filter(s -> !(s.getNodeStatus().equals(1)))
|
|
@@ -434,7 +449,7 @@ public class FlowQueryServiceImpl implements FlowQueryService {
|
|
|
|
|
|
|
|
|
// 箱码 查询类型为箱码时必传
|
|
|
- if (FlowQueryTypeEnum.TRAY_CODE.is(req.getQueryType())) {
|
|
|
+ if (FlowQueryTypeEnum.TRAY_CODE.is(queryType)) {
|
|
|
addReq.setTrayCode(res.getStack().getStackCode());
|
|
|
} else {
|
|
|
addReq.setBoxCode(res.getBoxStack().getBoxCode());
|
|
@@ -452,11 +467,11 @@ public class FlowQueryServiceImpl implements FlowQueryService {
|
|
|
addReq.setProductionTime(sku.getProductionTime());
|
|
|
|
|
|
|
|
|
- //后台查询
|
|
|
- addReq.setQueryPlatform(ReqChannelTypeEnum.BACKSTAGE.getCode());
|
|
|
+ //设置查询平台
|
|
|
+ addReq.setQueryPlatform(req.getQueryPlatform());
|
|
|
|
|
|
- //后台查询没有地址
|
|
|
- addReq.setQueryAddress("");
|
|
|
+ //设置查询地址
|
|
|
+ addReq.setQueryAddress(req.getQueryAddress());
|
|
|
|
|
|
//abnormalNodeIn
|
|
|
GetFlowInfoRes.FlowBean abnormalNodeIn = abnormalNodeMap.get(1);
|