|
|
@@ -54,7 +54,7 @@ import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* @author zk
|
|
|
- * @desc TODO
|
|
|
+ * @desc 车辆运单
|
|
|
* @date 2023/7/19 0019
|
|
|
*/
|
|
|
@Slf4j
|
|
|
@@ -144,24 +144,21 @@ public class KwtWaybillOrderService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- /**数据组装**/
|
|
|
+ /**数据配置**/
|
|
|
List<Long> entIds = new ArrayList<>();
|
|
|
- List<String> dictKey = new ArrayList<>();
|
|
|
for (WaybillOrderDriverVo waybillOrder : waybillOrders) {
|
|
|
entIds.add(waybillOrder.getCarrierEntId());
|
|
|
- dictKey.add(DictTypeEnum.UNIT_TYPE.getType() + Global.POUND + waybillOrder.getUnit());
|
|
|
}
|
|
|
-
|
|
|
//企业数据集
|
|
|
entIds = entIds.stream().distinct().collect(Collectors.toList());
|
|
|
- dictKey = dictKey.stream().distinct().collect(Collectors.toList());
|
|
|
Map<Long, EntCacheResDto> ents = remoteSystemService.queryEntCacheMapByIds(entIds);
|
|
|
- Map<String, SysDictResDto> dicts = remoteSystemService.queryDictMapByTypeValues(String.join(Global.COMMA, dictKey));
|
|
|
+
|
|
|
+ //数据组装
|
|
|
for (WaybillOrderDriverVo waybillOrder : waybillOrders) {
|
|
|
EntCacheResDto ent = ents == null ? null : ents.get(waybillOrder.getCarrierEntId());
|
|
|
- SysDictResDto unit = dicts == null ? null : dicts.get(DictTypeEnum.UNIT_TYPE.getType() + Global.POUND + waybillOrder.getUnit());
|
|
|
+ String value = getDictValue(DictTypeEnum.UNIT_TYPE.getType(), waybillOrder.getUnit());
|
|
|
waybillOrder.setCarrierFirmName(ent != null ? ent.getFirmName() : null);
|
|
|
- waybillOrder.setUnit(unit != null ? unit.getLabel() : null);
|
|
|
+ waybillOrder.setUnit(value);
|
|
|
}
|
|
|
return waybillOrders;
|
|
|
}
|
|
|
@@ -2493,4 +2490,23 @@ public class KwtWaybillOrderService {
|
|
|
map.put("loop", loopMap);
|
|
|
return HttpResult.ok(map);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param type 字典类型
|
|
|
+ * @param value 字典值
|
|
|
+ * @desc 获取数据字典值
|
|
|
+ * @author zk
|
|
|
+ * @date 2023/8/30
|
|
|
+ **/
|
|
|
+ public String getDictValue(String type, String value) {
|
|
|
+ if (StringUtils.isBlank(type) || StringUtils.isBlank(value)) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ List<String> dictKey = new ArrayList<>(){{
|
|
|
+ add(type + Global.POUND + value);
|
|
|
+ }};
|
|
|
+ Map<String, SysDictResDto> dicts = remoteSystemService.queryDictMapByTypeValues(String.join(Global.COMMA, dictKey));
|
|
|
+ SysDictResDto dict = dicts == null ? null : dicts.get(DictTypeEnum.APPROVED_DRIVING.getType() + Global.POUND + value);
|
|
|
+ return dict != null ? dict.getLabel() : null;
|
|
|
+ }
|
|
|
}
|