|
@@ -39,6 +39,7 @@ public class FlowQueryServiceImpl implements FlowQueryService {
|
|
|
|
|
|
@Autowired
|
|
|
private UserUtil userUtil;
|
|
|
+
|
|
|
/**
|
|
|
* 箱码查询
|
|
|
* TODO 测试使用,待流向查询接口完成后,根据实际情况调整结构
|
|
@@ -48,12 +49,12 @@ public class FlowQueryServiceImpl implements FlowQueryService {
|
|
|
Integer queryType = req.getQueryType();
|
|
|
GetBoxCodeRes res = null;
|
|
|
//箱码查询
|
|
|
- if(FlowQueryTypeEnum.BOX_CODE.is(queryType)){
|
|
|
+ if (FlowQueryTypeEnum.BOX_CODE.is(queryType)) {
|
|
|
String boxCode = req.getBoxCode();
|
|
|
- res= this.getFlowInfoByBoxCode(boxCode);
|
|
|
+ res = this.getFlowInfoByBoxCode(boxCode);
|
|
|
}
|
|
|
|
|
|
- AssertUtil.isNull(res,"为查询到流向信息!");
|
|
|
+ AssertUtil.isNull(res, "为查询到流向信息!");
|
|
|
//保存查询记录
|
|
|
this.saveQueryRecord(res, req);
|
|
|
return res;
|
|
@@ -62,11 +63,12 @@ public class FlowQueryServiceImpl implements FlowQueryService {
|
|
|
|
|
|
/**
|
|
|
* 查询流向信息
|
|
|
+ *
|
|
|
* @param boxCode 箱码
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
- public GetBoxCodeRes getFlowInfoByBoxCode(String boxCode){
|
|
|
+ public GetBoxCodeRes getFlowInfoByBoxCode(String boxCode) {
|
|
|
GetBoxCodeRes res = new GetBoxCodeRes();
|
|
|
|
|
|
GetBoxCodeRes.SkuBean sku = new GetBoxCodeRes.SkuBean()
|
|
@@ -147,8 +149,6 @@ public class FlowQueryServiceImpl implements FlowQueryService {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
/**
|
|
|
* 保存查询记录
|
|
|
*
|
|
@@ -165,7 +165,7 @@ public class FlowQueryServiceImpl implements FlowQueryService {
|
|
|
.collect(Collectors.toMap(GetBoxCodeRes.FlowBean::getAbnormalType, flowBean -> flowBean));
|
|
|
|
|
|
|
|
|
- FlowStatusEnum flowStatus = MapUtil.isEmpty(abnormalNodeMap) ? FlowStatusEnum.ABNORMAL : FlowStatusEnum.NORMAL;
|
|
|
+ FlowStatusEnum flowStatus = MapUtil.isEmpty(abnormalNodeMap) ? FlowStatusEnum.ABNORMAL : FlowStatusEnum.NORMAL;
|
|
|
|
|
|
//查询类型
|
|
|
Integer queryType = req.getQueryType();
|
|
@@ -180,7 +180,11 @@ public class FlowQueryServiceImpl implements FlowQueryService {
|
|
|
addReq.setBrandName(res.getSku().getBrandName());
|
|
|
|
|
|
//sku
|
|
|
- addReq.setSkuCode(res.getSku().getSkuId());
|
|
|
+ GetBoxCodeRes.SkuBean sku = res.getSku();
|
|
|
+ addReq.setSkuCode(sku.getSkuId());
|
|
|
+ addReq.setProductionBatch(sku.getProductionBatch());
|
|
|
+ addReq.setProductionTime(sku.getProductionTime());
|
|
|
+
|
|
|
|
|
|
//后台查询
|
|
|
addReq.setQueryPlatform(ReqChannelTypeEnum.BACKSTAGE.getCode());
|
|
@@ -190,7 +194,7 @@ public class FlowQueryServiceImpl implements FlowQueryService {
|
|
|
|
|
|
//abnormalNodeIn
|
|
|
GetBoxCodeRes.FlowBean abnormalNodeIn = abnormalNodeMap.get(1);
|
|
|
- if(Objects.nonNull(abnormalNodeIn)){
|
|
|
+ if (Objects.nonNull(abnormalNodeIn)) {
|
|
|
addReq.setAbnormalInNodeCode(abnormalNodeIn.getNodeId());
|
|
|
addReq.setAbnormalInNodeName(abnormalNodeIn.getNodeName());
|
|
|
}
|
|
@@ -198,14 +202,14 @@ public class FlowQueryServiceImpl implements FlowQueryService {
|
|
|
|
|
|
//abnormalNodeOut
|
|
|
GetBoxCodeRes.FlowBean abnormalNodeOut = abnormalNodeMap.get(2);
|
|
|
- if(Objects.nonNull(abnormalNodeOut)) {
|
|
|
+ if (Objects.nonNull(abnormalNodeOut)) {
|
|
|
addReq.setAbnormalOutNodeCode(abnormalNodeOut.getNodeId());
|
|
|
addReq.setAbnormalOutNodeName(abnormalNodeOut.getNodeName());
|
|
|
}
|
|
|
//箱垛信息
|
|
|
GetBoxCodeRes.BoxStackBean boxStack = res.getBoxStack();
|
|
|
AddFlowQueryRecordReq.BoxStackBean boxStackBean = new AddFlowQueryRecordReq.BoxStackBean();
|
|
|
- BeanUtil.copyProperties(boxStack,boxStackBean);
|
|
|
+ BeanUtil.copyProperties(boxStack, boxStackBean);
|
|
|
addReq.setBoxStackInfo(boxStackBean);
|
|
|
|
|
|
//流向信息列表
|
|
@@ -214,10 +218,10 @@ public class FlowQueryServiceImpl implements FlowQueryService {
|
|
|
addReq.setFlowList(flowBeans);
|
|
|
|
|
|
flowQueryRecordService.addFlowQueryRecord(addReq);
|
|
|
- }catch (Exception ex){
|
|
|
+ } catch (Exception ex) {
|
|
|
//获取当前登录的用户
|
|
|
UserInfo user = userUtil.getUser();
|
|
|
- log.error("查询流向信息记录报错失败!,查询人:【{}】,查询结果:【{}】,异常:{}",user.getUserName(),JSONUtil.toJsonStr(res),ex.getMessage());
|
|
|
+ log.error("查询流向信息记录报错失败!,查询人:【{}】,查询结果:【{}】,异常:{}", user.getUserName(), JSONUtil.toJsonStr(res), ex.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|