|
@@ -290,13 +290,8 @@ public class WaybillOrderService {
|
|
|
.collect(Collectors.toMap(OrderDetailVo::getId, Function.identity(), (x, y) -> x));
|
|
.collect(Collectors.toMap(OrderDetailVo::getId, Function.identity(), (x, y) -> x));
|
|
|
|
|
|
|
|
//查询字典
|
|
//查询字典
|
|
|
- List<SysDictResDto> sysDictResDtos = remoteSystemService.queryDictByType(DictTypeEnum.PRODUCT_NAME_TYPE.getType());
|
|
|
|
|
- if (CollectionUtils.isEmpty(sysDictResDtos)){
|
|
|
|
|
- log.info("品名类型字典数据不存在,truckNo:{}", param.getTruckNo());
|
|
|
|
|
- throw new BusinessPlatfromException(ErrorCodeEnum.DATA_NOT_EXIST, "品名类型字典数据不存在");
|
|
|
|
|
- }
|
|
|
|
|
- Map<String, SysDictResDto> dictValueAndDictResDtoMap = sysDictResDtos.stream()
|
|
|
|
|
- .collect(Collectors.toMap(SysDictResDto::getValue, Function.identity(), (x, y) -> x));
|
|
|
|
|
|
|
+ Map<String, Map<String, String>> dictValueAndDictResDtoMap = remoteSystemService.queryDictByType(
|
|
|
|
|
+ Arrays.asList(DictTypeEnum.PRODUCT_NAME_TYPE.getType(), DictTypeEnum.GOODS_SPEC.getType()));
|
|
|
|
|
|
|
|
//组装数据
|
|
//组装数据
|
|
|
List<LogisticsOrderResp> ordderList = logOrderList.stream()
|
|
List<LogisticsOrderResp> ordderList = logOrderList.stream()
|
|
@@ -345,7 +340,7 @@ public class WaybillOrderService {
|
|
|
Map<Long, OrderDetailVo> tradeIdAndOrderDetailVoMap,
|
|
Map<Long, OrderDetailVo> tradeIdAndOrderDetailVoMap,
|
|
|
Map<Long, List<KwtLogisticsOrder>> tradeIdAndLogOrderList ,
|
|
Map<Long, List<KwtLogisticsOrder>> tradeIdAndLogOrderList ,
|
|
|
Map<Long, List<KwtWaybillOrderSubtask>> logisticsOrderIdAndSubtaskList,
|
|
Map<Long, List<KwtWaybillOrderSubtask>> logisticsOrderIdAndSubtaskList,
|
|
|
- Map<String, SysDictResDto> dictValueAndDictResDtoMap) {
|
|
|
|
|
|
|
+ Map<String, Map<String, String>> dictValueAndDictResDtoMap) {
|
|
|
LogisticsOrderResp orderResp = new LogisticsOrderResp();
|
|
LogisticsOrderResp orderResp = new LogisticsOrderResp();
|
|
|
orderResp.setLogisticsOrderId(Optional.ofNullable(order.getId()).map(String::valueOf).orElse(null));
|
|
orderResp.setLogisticsOrderId(Optional.ofNullable(order.getId()).map(String::valueOf).orElse(null));
|
|
|
orderResp.setLogisticsOrderNo(order.getLOrderNo());
|
|
orderResp.setLogisticsOrderNo(order.getLOrderNo());
|
|
@@ -353,9 +348,10 @@ public class WaybillOrderService {
|
|
|
KwtLogisticsOrderGoods orderGoods = logOrderIdAndGoodsMap.getOrDefault(order.getId(), new KwtLogisticsOrderGoods());
|
|
KwtLogisticsOrderGoods orderGoods = logOrderIdAndGoodsMap.getOrDefault(order.getId(), new KwtLogisticsOrderGoods());
|
|
|
KwpGoods goods = goodsIdAndGoodsMap.getOrDefault(orderGoods.getGoodsId(), new KwpGoods());
|
|
KwpGoods goods = goodsIdAndGoodsMap.getOrDefault(orderGoods.getGoodsId(), new KwpGoods());
|
|
|
if (Objects.nonNull(goods)){
|
|
if (Objects.nonNull(goods)){
|
|
|
- SysDictResDto sysDictResDto = dictValueAndDictResDtoMap.getOrDefault(goods.getGoodsType(), new SysDictResDto());
|
|
|
|
|
- orderResp.setGoodsId(String.valueOf(goods.getId()));
|
|
|
|
|
- orderResp.setGoodsName(goods.getName()+ "/" +sysDictResDto.getLabel()+"/"+ goods.getSpec());
|
|
|
|
|
|
|
+ orderResp.setGoodsId(Optional.ofNullable(goods.getId()).map(String::valueOf).orElse(null));
|
|
|
|
|
+ Map<String, String> goodsTypeMap= dictValueAndDictResDtoMap.getOrDefault(DictTypeEnum.PRODUCT_NAME_TYPE.getType(), new HashMap<>());
|
|
|
|
|
+ Map<String, String> goodsSpecMap= dictValueAndDictResDtoMap.getOrDefault(DictTypeEnum.GOODS_SPEC.getType(), new HashMap<>());
|
|
|
|
|
+ orderResp.setGoodsName(goods.getName()+"/"+goodsTypeMap.getOrDefault(goods.getGoodsType(),"")+"/"+goodsSpecMap.getOrDefault(goods.getSpec(), ""));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//托运企业
|
|
//托运企业
|
|
@@ -700,15 +696,9 @@ public class WaybillOrderService {
|
|
|
Collectors.toMap(ticket -> ticket.getWOrderId() + "-" + ticket.getType(),
|
|
Collectors.toMap(ticket -> ticket.getWOrderId() + "-" + ticket.getType(),
|
|
|
Function.identity(), (x, y) -> x));
|
|
Function.identity(), (x, y) -> x));
|
|
|
|
|
|
|
|
-
|
|
|
|
|
//查询字典
|
|
//查询字典
|
|
|
- List<SysDictResDto> sysDictResDtos = remoteSystemService.queryDictByType(DictTypeEnum.PRODUCT_NAME_TYPE.getType());
|
|
|
|
|
- if (CollectionUtils.isEmpty(sysDictResDtos)){
|
|
|
|
|
- log.info("品名类型字典数据不存在,truckNo:{}", param.getTruckNo());
|
|
|
|
|
- throw new BusinessPlatfromException(ErrorCodeEnum.DATA_NOT_EXIST, "品名类型字典数据不存在");
|
|
|
|
|
- }
|
|
|
|
|
- Map<String, SysDictResDto> dictValueAndDictResDtoMap = sysDictResDtos.stream()
|
|
|
|
|
- .collect(Collectors.toMap(SysDictResDto::getValue, Function.identity(), (x, y) -> x));
|
|
|
|
|
|
|
+ Map<String, Map<String, String>> dictValueAndDictResDtoMap = remoteSystemService.queryDictByType(
|
|
|
|
|
+ Arrays.asList(DictTypeEnum.PRODUCT_NAME_TYPE.getType(), DictTypeEnum.GOODS_SPEC.getType()));
|
|
|
|
|
|
|
|
List<WaybillOrderStatusResp> ordderList = records.stream().map(
|
|
List<WaybillOrderStatusResp> ordderList = records.stream().map(
|
|
|
billOrder -> {
|
|
billOrder -> {
|
|
@@ -738,7 +728,7 @@ public class WaybillOrderService {
|
|
|
Map<Long, OrderDetailVo> tradeIdAndOrderDetailVoMap,
|
|
Map<Long, OrderDetailVo> tradeIdAndOrderDetailVoMap,
|
|
|
Map<Long, List<KwtLogisticsOrder>> tradeIdAndLogOrderList ,
|
|
Map<Long, List<KwtLogisticsOrder>> tradeIdAndLogOrderList ,
|
|
|
Map<Long, List<KwtWaybillOrderSubtask>> logisticsOrderIdAndSubtaskList,
|
|
Map<Long, List<KwtWaybillOrderSubtask>> logisticsOrderIdAndSubtaskList,
|
|
|
- Map<String, SysDictResDto> dictValueAndDictResDtoMap,
|
|
|
|
|
|
|
+ Map<String, Map<String, String>> dictValueAndDictResDtoMap,
|
|
|
Map<Long, KwpGoods> goodsIdAndGoodsMap) {
|
|
Map<Long, KwpGoods> goodsIdAndGoodsMap) {
|
|
|
WaybillOrderStatusResp wbOrderResp = new WaybillOrderStatusResp();
|
|
WaybillOrderStatusResp wbOrderResp = new WaybillOrderStatusResp();
|
|
|
wbOrderResp.setId(wbOrder.getId());
|
|
wbOrderResp.setId(wbOrder.getId());
|
|
@@ -768,9 +758,10 @@ public class WaybillOrderService {
|
|
|
KwtLogisticsOrderGoods orderGoods = logOrderIdAndGoodsMap.getOrDefault(wbOrder.getLOrderId(), new KwtLogisticsOrderGoods());
|
|
KwtLogisticsOrderGoods orderGoods = logOrderIdAndGoodsMap.getOrDefault(wbOrder.getLOrderId(), new KwtLogisticsOrderGoods());
|
|
|
KwpGoods goods = goodsIdAndGoodsMap.getOrDefault(orderGoods.getGoodsId(), new KwpGoods());
|
|
KwpGoods goods = goodsIdAndGoodsMap.getOrDefault(orderGoods.getGoodsId(), new KwpGoods());
|
|
|
if (Objects.nonNull(goods)){
|
|
if (Objects.nonNull(goods)){
|
|
|
- SysDictResDto sysDictResDto = dictValueAndDictResDtoMap.getOrDefault(goods.getGoodsType(), new SysDictResDto());
|
|
|
|
|
- wbOrderResp.setGoodsId(Optional.ofNullable(orderGoods.getId()).map(String::valueOf).orElse(null));
|
|
|
|
|
- wbOrderResp.setGoodsName(goods.getName()+ "/" +sysDictResDto.getLabel()+"/"+ goods.getSpec());
|
|
|
|
|
|
|
+ wbOrderResp.setGoodsId(Optional.ofNullable(goods.getId()).map(String::valueOf).orElse(null));
|
|
|
|
|
+ Map<String, String> goodsTypeMap= dictValueAndDictResDtoMap.getOrDefault(DictTypeEnum.PRODUCT_NAME_TYPE.getType(), new HashMap<>());
|
|
|
|
|
+ Map<String, String> goodsSpecMap= dictValueAndDictResDtoMap.getOrDefault(DictTypeEnum.GOODS_SPEC.getType(), new HashMap<>());
|
|
|
|
|
+ wbOrderResp.setGoodsName(goods.getName()+"/"+goodsTypeMap.getOrDefault(goods.getGoodsType(),"")+"/"+goodsSpecMap.getOrDefault(goods.getSpec(), ""));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//装货地址
|
|
//装货地址
|