Commit 41a0b377 by “zcwang”

modify: 工单详情查询商品控制判断

parent b38a516a
...@@ -1015,7 +1015,8 @@ public class ChangeFlowBiz { ...@@ -1015,7 +1015,8 @@ public class ChangeFlowBiz {
itemBasicInfoVO.setQcCategory("/"); itemBasicInfoVO.setQcCategory("/");
} }
List<SimplePhyCateGoryResultCo> simplePhyCateGoryResultCos = categoryChain.get(itemId); List<SimplePhyCateGoryResultCo> simplePhyCateGoryResultCos = categoryChain.get(itemId);
log.debug("[detail] simplePhyCateGoryResultCos:{}", JSON.toJSONString(simplePhyCateGoryResultCos)); log.debug("[detail] itemId:{}, simplePhyCateGoryResultCos:{}", itemId,
JSON.toJSONString(simplePhyCateGoryResultCos));
if (CollectionUtils.isEmpty(simplePhyCateGoryResultCos)) { if (CollectionUtils.isEmpty(simplePhyCateGoryResultCos)) {
itemBasicInfoVO.setPhyCategory(null); itemBasicInfoVO.setPhyCategory(null);
} else { } else {
...@@ -1028,17 +1029,23 @@ public class ChangeFlowBiz { ...@@ -1028,17 +1029,23 @@ public class ChangeFlowBiz {
itemBasicInfoVO.setPhyCategory(categoryInfoVOS); itemBasicInfoVO.setPhyCategory(categoryInfoVOS);
} }
Optional<SpuTO> optionalSpuTO = spuTOS.stream().filter(spu -> spu.getId() == itemId).findAny(); Optional<SpuTO> optionalSpuTO = spuTOS.stream().filter(spu -> spu.getId() == itemId).findAny();
log.debug("[detail] itemId:{}, optionalSpuTO:{}", itemId, JSON.toJSONString(optionalSpuTO));
if (!optionalSpuTO.isPresent()) { if (!optionalSpuTO.isPresent()) {
throw ExceptionFactory.createBiz(ResponseCode.THIRD_ERR, "未查询到商品详情"); itemBasicInfoVO.setItemSetupType(null);
itemBasicInfoVO.setBusinessForm(null);
itemBasicInfoVO.setStatus(null);
} else {
SpuTO spuTO = optionalSpuTO.get();
Map<String, String> propertyMap = spuTO.getPropertyMap();
itemBasicInfoVO.setItemSetupType(Integer.valueOf(propertyMap.get("itemSetupType")));
String businessForm = propertyMap.get("businessForm");
int business = StringUtils.isBlank(businessForm) ? 0 : Integer.parseInt(businessForm);
itemBasicInfoVO.setBusinessForm(business);
itemBasicInfoVO.setStatus(spuTO.getStatus());
} }
SpuTO spuTO = optionalSpuTO.get();
Map<String, String> propertyMap = spuTO.getPropertyMap();
itemBasicInfoVO.setItemSetupType(Integer.valueOf(propertyMap.get("itemSetupType")));
String businessForm = propertyMap.get("businessForm");
int business = StringUtils.isBlank(businessForm) ? 0 : Integer.parseInt(businessForm);
itemBasicInfoVO.setBusinessForm(business);
itemBasicInfoVO.setStatus(spuTO.getStatus());
ChangeGoodsPrincipalPO changeGoodsPrincipalPO = longChangeGoodsPrincipalPOMap.get(itemId); ChangeGoodsPrincipalPO changeGoodsPrincipalPO = longChangeGoodsPrincipalPOMap.get(itemId);
log.debug("[detail] itemId:{}, changeGoodsPrincipalPO:{}", itemId,
JSON.toJSONString(changeGoodsPrincipalPO));
itemBasicInfoVO.setChangeGoodsPrincipal(changeGoodsPrincipalPO); itemBasicInfoVO.setChangeGoodsPrincipal(changeGoodsPrincipalPO);
return itemBasicInfoVO; return itemBasicInfoVO;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment