|
|
@@ -617,7 +617,12 @@ public class RemoteSystemServiceImpl implements RemoteSystemService {
|
|
|
public UserResDto queryUserById(Long userId) {
|
|
|
KwsUser kwsUser = kwsUserService.selectByKey(userId);
|
|
|
if (Objects.nonNull(kwsUser)) {
|
|
|
- return BeanUtil.toBean(kwsUser, UserResDto.class);
|
|
|
+ UserResDto bean = BeanUtil.toBean(kwsUser, UserResDto.class);
|
|
|
+ KwsEntType one = kwsEntTypeRepository.lambdaQuery().eq(KwsEntType::getEntId, kwsUser.getEntId()).last("limit 1").one();
|
|
|
+ if (Objects.nonNull(one)) {
|
|
|
+ bean.setType(one.getType());
|
|
|
+ }
|
|
|
+ return bean;
|
|
|
}
|
|
|
return null;
|
|
|
}
|
|
|
@@ -986,6 +991,7 @@ public class RemoteSystemServiceImpl implements RemoteSystemService {
|
|
|
/**
|
|
|
* 计算平台配置的运单单趟总耗时
|
|
|
* 获取自动派单系数配置(单趟耗时 = 装货时间 + 卸货时间 + 运输时间 + 返回时间)
|
|
|
+ *
|
|
|
* @param dto
|
|
|
* @return
|
|
|
*/
|
|
|
@@ -1023,6 +1029,7 @@ public class RemoteSystemServiceImpl implements RemoteSystemService {
|
|
|
|
|
|
/**
|
|
|
* 计算平台配置贸易订单实际派车数
|
|
|
+ *
|
|
|
* @param dto
|
|
|
* @return
|
|
|
*/
|
|
|
@@ -1059,10 +1066,10 @@ public class RemoteSystemServiceImpl implements RemoteSystemService {
|
|
|
Integer maxRoundTripTimes = roundTripBig.setScale(0, RoundingMode.FLOOR).intValue();
|
|
|
|
|
|
//单车总运量 = 车辆平均载重 X 单车最大往返次数
|
|
|
- int totalVehicle = vehicleAvgLoad * maxRoundTripTimes;
|
|
|
+ int totalVehicle = vehicleAvgLoad * maxRoundTripTimes;
|
|
|
BigDecimal totalVehicleBig = new BigDecimal(totalVehicle);
|
|
|
//所需车辆数 = 订单总量/单车总运量
|
|
|
- BigDecimal vehiclesNum = dto.getAmount().multiply(totalVehicleBig);
|
|
|
+ BigDecimal vehiclesNum = dto.getAmount().multiply(totalVehicleBig);
|
|
|
|
|
|
//实际派车 = 所需车辆数 X 缓冲系数(向上取整)
|
|
|
BigDecimal actualVehicleBig = vehiclesNum.multiply(bufferCoefficient);
|
|
|
@@ -1071,7 +1078,8 @@ public class RemoteSystemServiceImpl implements RemoteSystemService {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 平台单趟耗时
|
|
|
+ * 平台单趟耗时
|
|
|
+ *
|
|
|
* @param dto
|
|
|
* @return
|
|
|
*/
|