|
@@ -153,19 +153,24 @@ public class KwtWaybillOrderService {
|
|
|
|
|
|
|
|
/**数据配置**/
|
|
/**数据配置**/
|
|
|
List<Long> entIds = new ArrayList<>();
|
|
List<Long> entIds = new ArrayList<>();
|
|
|
|
|
+ List<String> dictKey = new ArrayList<>();
|
|
|
for (WaybillOrderDriverVo waybillOrder : waybillOrders) {
|
|
for (WaybillOrderDriverVo waybillOrder : waybillOrders) {
|
|
|
entIds.add(waybillOrder.getCarrierEntId());
|
|
entIds.add(waybillOrder.getCarrierEntId());
|
|
|
|
|
+ dictKey.add(DictTypeEnum.UNIT_TYPE.getType() + Global.POUND + waybillOrder.getUnit());
|
|
|
}
|
|
}
|
|
|
//企业数据集
|
|
//企业数据集
|
|
|
entIds = entIds.stream().distinct().collect(Collectors.toList());
|
|
entIds = entIds.stream().distinct().collect(Collectors.toList());
|
|
|
Map<Long, EntCacheResDto> ents = remoteSystemService.queryEntCacheMapByIds(entIds);
|
|
Map<Long, EntCacheResDto> ents = remoteSystemService.queryEntCacheMapByIds(entIds);
|
|
|
|
|
+ //数据字典
|
|
|
|
|
+ Map<String, SysDictResDto> dicts = this.dict(dictKey);
|
|
|
|
|
|
|
|
//数据组装
|
|
//数据组装
|
|
|
for (WaybillOrderDriverVo waybillOrder : waybillOrders) {
|
|
for (WaybillOrderDriverVo waybillOrder : waybillOrders) {
|
|
|
EntCacheResDto ent = ents == null ? null : ents.get(waybillOrder.getCarrierEntId());
|
|
EntCacheResDto ent = ents == null ? null : ents.get(waybillOrder.getCarrierEntId());
|
|
|
- String value = getDictValue(DictTypeEnum.UNIT_TYPE.getType(), waybillOrder.getUnit());
|
|
|
|
|
|
|
+ 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.setCarrierFirmName(ent != null ? ent.getFirmName() : null);
|
|
|
- waybillOrder.setUnit(value);
|
|
|
|
|
|
|
+ waybillOrder.setUnitName(unit != null ? unit.getLabel() : null);
|
|
|
}
|
|
}
|
|
|
return waybillOrders;
|
|
return waybillOrders;
|
|
|
}
|
|
}
|
|
@@ -235,6 +240,11 @@ public class KwtWaybillOrderService {
|
|
|
if (waybillOrder == null && circulate == null) {
|
|
if (waybillOrder == null && circulate == null) {
|
|
|
return HttpResult.error("车辆运单不存在!");
|
|
return HttpResult.error("车辆运单不存在!");
|
|
|
}
|
|
}
|
|
|
|
|
+ if (waybillOrder != null) {
|
|
|
|
|
+ if (!CarWaybillEnum.changeDriver(waybillOrder.getStatus())) {
|
|
|
|
|
+ return HttpResult.error("车辆运单当前状态不能变更司机!");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
/**循环派车**/
|
|
/**循环派车**/
|
|
|
if (params.getType() == Global.NUMERICAL_TWO) {
|
|
if (params.getType() == Global.NUMERICAL_TWO) {
|
|
@@ -249,7 +259,7 @@ public class KwtWaybillOrderService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (waybillOrder != null) {
|
|
if (waybillOrder != null) {
|
|
|
- if (!CarWaybillEnum.changeDriverAndTruck(waybillOrder.getStatus())) {
|
|
|
|
|
|
|
+ if (!CarWaybillEnum.changeDriver(waybillOrder.getStatus())) {
|
|
|
return HttpResult.error("车辆运单当前状态不能变更司机!");
|
|
return HttpResult.error("车辆运单当前状态不能变更司机!");
|
|
|
}
|
|
}
|
|
|
/**更新车辆运单**/
|
|
/**更新车辆运单**/
|
|
@@ -282,6 +292,11 @@ public class KwtWaybillOrderService {
|
|
|
if (waybillOrder == null && circulate == null) {
|
|
if (waybillOrder == null && circulate == null) {
|
|
|
return HttpResult.error("车辆运单不存在!");
|
|
return HttpResult.error("车辆运单不存在!");
|
|
|
}
|
|
}
|
|
|
|
|
+ if (waybillOrder != null) {
|
|
|
|
|
+ if (!CarWaybillEnum.changeTruck(waybillOrder.getStatus())) {
|
|
|
|
|
+ return HttpResult.error("车辆运单当前状态不能变更车辆!");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
/**循环派车**/
|
|
/**循环派车**/
|
|
|
if (params.getType() == Global.NUMERICAL_TWO) {
|
|
if (params.getType() == Global.NUMERICAL_TWO) {
|
|
@@ -296,9 +311,6 @@ public class KwtWaybillOrderService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (waybillOrder != null) {
|
|
if (waybillOrder != null) {
|
|
|
- if (!CarWaybillEnum.changeDriverAndTruck(waybillOrder.getStatus())) {
|
|
|
|
|
- return HttpResult.error("车辆运单当前状态不能变更车辆!");
|
|
|
|
|
- }
|
|
|
|
|
/**更新车辆运单**/
|
|
/**更新车辆运单**/
|
|
|
changeWaybillOrder(null, params);
|
|
changeWaybillOrder(null, params);
|
|
|
wOrder.set_id(params.getWOrderId());
|
|
wOrder.set_id(params.getWOrderId());
|
|
@@ -328,7 +340,6 @@ public class KwtWaybillOrderService {
|
|
|
//循环派车信息
|
|
//循环派车信息
|
|
|
KwtLogisticsOrderCirculate circulate = new KwtLogisticsOrderCirculate();
|
|
KwtLogisticsOrderCirculate circulate = new KwtLogisticsOrderCirculate();
|
|
|
if (driver != null) {
|
|
if (driver != null) {
|
|
|
- circulate.setId(circulateId);
|
|
|
|
|
circulate.setDriverId(driver.getDriverId());
|
|
circulate.setDriverId(driver.getDriverId());
|
|
|
circulate.setDriverPhone(driver.getDriverPhone());
|
|
circulate.setDriverPhone(driver.getDriverPhone());
|
|
|
circulate.setDriverName(driver.getDriverName());
|
|
circulate.setDriverName(driver.getDriverName());
|
|
@@ -338,6 +349,7 @@ public class KwtWaybillOrderService {
|
|
|
circulate.setTruckId(truck.getTruckId());
|
|
circulate.setTruckId(truck.getTruckId());
|
|
|
circulate.setTruckNo(truck.getTruckNo());
|
|
circulate.setTruckNo(truck.getTruckNo());
|
|
|
}
|
|
}
|
|
|
|
|
+ circulate.setId(circulateId);
|
|
|
logisticsOrderCirculateDao.updateById(circulate);
|
|
logisticsOrderCirculateDao.updateById(circulate);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -2691,4 +2703,18 @@ public class KwtWaybillOrderService {
|
|
|
SysDictResDto dict = dicts == null ? null : dicts.get(DictTypeEnum.APPROVED_DRIVING.getType() + Global.POUND + value);
|
|
SysDictResDto dict = dicts == null ? null : dicts.get(DictTypeEnum.APPROVED_DRIVING.getType() + Global.POUND + value);
|
|
|
return dict != null ? dict.getLabel() : null;
|
|
return dict != null ? dict.getLabel() : null;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @param dictKey 字典值
|
|
|
|
|
+ * @desc 获取数据字典
|
|
|
|
|
+ * @author zk
|
|
|
|
|
+ * @date 2023/9/11
|
|
|
|
|
+ **/
|
|
|
|
|
+ public Map<String, SysDictResDto> dict(List<String> dictKey) {
|
|
|
|
|
+ if (CollectionUtils.isEmpty(dictKey)) {
|
|
|
|
|
+ return Collections.emptyMap();
|
|
|
|
|
+ }
|
|
|
|
|
+ dictKey = dictKey.stream().distinct().collect(Collectors.toList());
|
|
|
|
|
+ return remoteSystemService.queryDictMapByTypeValues(String.join(Global.COMMA, dictKey));
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|