Commit 7451eb16 authored by jiaorz's avatar jiaorz

修改租車訂單地址,修改车辆预定时添加订单号

parent 789cd524
...@@ -29,6 +29,14 @@ public class ResultCode { ...@@ -29,6 +29,14 @@ public class ResultCode {
// 只能取消预定两个月内的车辆 // 只能取消预定两个月内的车辆
public static int ONLY_UNBOOK_TWO_MONTH = Integer.valueOf(SystemProperty.getResultConfig("ONLY_UNBOOK_TWO_MONTH")); public static int ONLY_UNBOOK_TWO_MONTH = Integer.valueOf(SystemProperty.getResultConfig("ONLY_UNBOOK_TWO_MONTH"));
// 添加车辆太多
public static int ADD_VEHICLE_MORE = Integer.valueOf(SystemProperty.getResultConfig("ADD_VEHICLE_MORE"));
// 停靠公司不能为空
public static int RET_COMPANY_CAN_NOT_BE_NULL = Integer.valueOf(SystemProperty.getResultConfig("RET_COMPANY_CAN_NOT_BE_NULL"));
// 车牌不能为空
public static int NUMBER_PLAT_CAN_NOT_BE_NULL = Integer.valueOf(SystemProperty.getResultConfig("NUMBER_PLAT_CAN_NOT_BE_NULL"));
// 选择日期不可取消预定 // 选择日期不可取消预定
public static int VEHICLE_CAN_NOT_UNBOOK = Integer.valueOf(SystemProperty.getResultConfig("VEHICLE_CAN_NOT_UNBOOK")); public static int VEHICLE_CAN_NOT_UNBOOK = Integer.valueOf(SystemProperty.getResultConfig("VEHICLE_CAN_NOT_UNBOOK"));
......
...@@ -238,4 +238,13 @@ BOOKED_DATE_IS_EMPTY = 4015 ...@@ -238,4 +238,13 @@ BOOKED_DATE_IS_EMPTY = 4015
4015 = 预定日期为空 4015 = 预定日期为空
TODAY_CAN_NOT_BOOK = 4016 TODAY_CAN_NOT_BOOK = 4016
4016 = 当天不可预定 4016 = 当天不可预定
\ No newline at end of file
ADD_VEHICLE_MORE = 4017
4017 = 添加车辆过多,请分批添加
RET_COMPANY_CAN_NOT_BE_NULL = 4018
4018 = 停靠公司不能为空
NUMBER_PLAT_CAN_NOT_BE_NULL = 4019
4019 = 车牌不能为空
\ No newline at end of file
...@@ -16,6 +16,7 @@ import com.github.wxiaoqi.security.common.msg.ObjectRestResponse; ...@@ -16,6 +16,7 @@ import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.msg.TableResultResponse; import com.github.wxiaoqi.security.common.msg.TableResultResponse;
import com.github.wxiaoqi.security.common.rest.CommonBaseController; import com.github.wxiaoqi.security.common.rest.CommonBaseController;
import com.github.wxiaoqi.security.common.util.Query; import com.github.wxiaoqi.security.common.util.Query;
import com.xxfc.platform.vehicle.constant.ResCode.ResCode;
import lombok.Data; import lombok.Data;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
...@@ -78,13 +79,13 @@ public class UserController extends CommonBaseController { ...@@ -78,13 +79,13 @@ public class UserController extends CommonBaseController {
if (StringUtils.isNotBlank(username)) { if (StringUtils.isNotBlank(username)) {
List<User> list = userBiz.getCountByUsername(username); List<User> list = userBiz.getCountByUsername(username);
if (list.size() > 0) { if (list.size() > 0) {
throw new RuntimeException("用户名不能重复"); return ObjectRestResponse.createFailedResult(ResCode.USER_IS_EXIST.getCode(), ResCode.USER_IS_EXIST.getDesc());
} }
} }
userBiz.insertSelective(vo); userBiz.insertSelective(vo);
//添加权限关系 //添加权限关系
groupBiz.modifyUserGroups(vo.getId(), vo.getMembers()); groupBiz.modifyUserGroups(vo.getId(), vo.getMembers());
return new ObjectRestResponse(); return ObjectRestResponse.succ();
} }
private void handleDataLimit(@RequestBody UserVO dto) { private void handleDataLimit(@RequestBody UserVO dto) {
...@@ -166,12 +167,12 @@ public class UserController extends CommonBaseController { ...@@ -166,12 +167,12 @@ public class UserController extends CommonBaseController {
if (StringUtils.isNotBlank(username)) { if (StringUtils.isNotBlank(username)) {
List<User> list = userBiz.getCountByUsername(username); List<User> list = userBiz.getCountByUsername(username);
if (list.size() > 1) { if (list.size() > 1) {
throw new RuntimeException("用户名不能重复"); return ObjectRestResponse.createFailedResult(ResCode.USER_IS_EXIST.getCode(), ResCode.USER_IS_EXIST.getDesc());
} }
if (list.size() == 1) { if (list.size() == 1) {
User user = list.get(0); User user = list.get(0);
if (!user.getId().equals(vo.getId())) { if (!user.getId().equals(vo.getId())) {
throw new RuntimeException("用户名不能重复"); return ObjectRestResponse.createFailedResult(ResCode.USER_IS_EXIST.getCode(), ResCode.USER_IS_EXIST.getDesc());
} }
} }
} }
......
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