Commit b9f8499b authored by jiaorz's avatar jiaorz

修改代码

parent 43e825be
...@@ -17,7 +17,7 @@ public enum ResCode { ...@@ -17,7 +17,7 @@ public enum ResCode {
VEHICLE_INFO_CODE_EXIST(102003,"车辆编码已存在"), VEHICLE_INFO_CODE_EXIST(102003,"车辆编码已存在"),
VEHICLE_INFO_SAME_NUM_PLATE_AND_CODE_EMPTY(102004,"车辆编码和车牌号为空"), VEHICLE_INFO_SAME_NUM_PLATE_AND_CODE_EMPTY(102004,"车辆编码和车牌号为空"),
VEHICLE_INFO_SAME_NUM_PLATE_AND_CODE_EXIST(102004,"车辆编码或车牌号已存在"), VEHICLE_INFO_SAME_NUM_PLATE_AND_CODE_EXIST(102004,"车辆编码或车牌号已存在"),
VEHICLE_INFO_IS_BOOKED(102004,"车辆已经被预定"),
//车辆信息相关返回码-预定申请信息 //车辆信息相关返回码-预定申请信息
VEHICLE_BOOKED_RECORD_ALREADY_CHANGED(103001,"车辆预定申请已被审批,请刷新后继续操作"), VEHICLE_BOOKED_RECORD_ALREADY_CHANGED(103001,"车辆预定申请已被审批,请刷新后继续操作"),
......
...@@ -5,9 +5,7 @@ import cn.hutool.core.bean.copier.CopyOptions; ...@@ -5,9 +5,7 @@ import cn.hutool.core.bean.copier.CopyOptions;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.github.wxiaoqi.security.admin.feign.UserFeign;
import com.github.wxiaoqi.security.admin.feign.dto.UserDTO; import com.github.wxiaoqi.security.admin.feign.dto.UserDTO;
import com.github.wxiaoqi.security.admin.feign.rest.UserRestInterface;
import com.github.wxiaoqi.security.common.biz.BaseBiz; import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.github.wxiaoqi.security.common.exception.BaseException; import com.github.wxiaoqi.security.common.exception.BaseException;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse; import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
...@@ -61,7 +59,7 @@ import static com.github.wxiaoqi.security.auth.common.constatns.CommonConstants. ...@@ -61,7 +59,7 @@ import static com.github.wxiaoqi.security.auth.common.constatns.CommonConstants.
@Service @Service
@Slf4j @Slf4j
public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserRestInterface { public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> {
public static final DateTimeFormatter DEFAULT_DATE_TIME_FORMATTER = DateTimeFormat.forPattern("yyyy-MM-dd"); public static final DateTimeFormatter DEFAULT_DATE_TIME_FORMATTER = DateTimeFormat.forPattern("yyyy-MM-dd");
public static final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss"); public static final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss");
...@@ -86,9 +84,7 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR ...@@ -86,9 +84,7 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
@Autowired @Autowired
private VehicleBookHourInfoBiz vehicleBookHourInfoBiz; private VehicleBookHourInfoBiz vehicleBookHourInfoBiz;
@Autowired @Autowired
UserFeign userFeign; AdminInfoFeign adminInfoFeign;
@Override
public UserFeign getUserFeign() {return userFeign;}
@Value("${vehicle.baseUploadPath}") @Value("${vehicle.baseUploadPath}")
private String baseUploadPath ; private String baseUploadPath ;
@Value("${vehicle.fristMileage}") @Value("${vehicle.fristMileage}")
...@@ -415,7 +411,7 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR ...@@ -415,7 +411,7 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
for(Map.Entry<String,List<String>> entry:yearMonthAndDate.entrySet()){ for(Map.Entry<String,List<String>> entry:yearMonthAndDate.entrySet()){
Boolean rsEach = applyVehicle4EmployeePerMonth(bookVehicleVo.getVehicleId(),entry.getValue(),entry.getKey()); Boolean rsEach = applyVehicle4EmployeePerMonth(bookVehicleVo.getVehicleId(),entry.getValue(),entry.getKey());
if(Boolean.FALSE.equals(rsEach)){ if(Boolean.FALSE.equals(rsEach)){
throw new BaseException("车辆已经被预定!"); throw new BaseException(ResCode.VEHICLE_INFO_IS_BOOKED.getDesc());
} }
} }
...@@ -1270,7 +1266,7 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR ...@@ -1270,7 +1266,7 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
Integer limit = vehiclePlanDto.getLimit() == null ? 10 : vehiclePlanDto.getLimit(); Integer limit = vehiclePlanDto.getLimit() == null ? 10 : vehiclePlanDto.getLimit();
vehiclePlanDto.setPage(page); vehiclePlanDto.setPage(page);
vehiclePlanDto.setLimit(limit); vehiclePlanDto.setLimit(limit);
UserDTO userDTO = getAdminUserInfo(); UserDTO userDTO = adminInfoFeign.getAdminUserInfo();
if(userDTO == null) { if(userDTO == null) {
return ObjectRestResponse.createFailedResult(235, "token失效"); return ObjectRestResponse.createFailedResult(235, "token失效");
} }
......
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