kongdeqiang
2023-03-27 172c5525cbdba1c3b32b47cb60bd35bed707101c
xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/AreaController.java
@@ -43,7 +43,8 @@
    @RequestMapping(value = "/getAll", method = RequestMethod.GET)
    @ApiOperation(value = "获取全部数据")
    public Result<List<Area>> getAll() {
        QueryWrapper<Area> wrapper = new QueryWrapper<>();
        wrapper.orderByAsc("name");
        List<Area> list = iAreaService.list();
        return new ResultUtil<List<Area>>().setData(list);
    }
@@ -62,11 +63,11 @@
    @ApiOperation(value = "编辑或更新数据")
    public Result<Area> saveOrUpdate(Area area) {
        QueryWrapper<Area> wrapper = new QueryWrapper<>();
        if (!area.getUserId().equals("0")){
            wrapper.eq("user_id",area.getUserId());
        if (StrUtil.isNotEmpty(area.getCarId())){
            wrapper.eq("car_id",area.getCarId());
            Area area1 = iAreaService.getOne(wrapper);
            if (area1 != null && !area.getId().equals(area1.getId())){
                return new ResultUtil<Area>().setErrorMsg("该配送员已被其他片区绑定,请先解绑");
                return new ResultUtil<Area>().setErrorMsg("该车辆已被其它片区绑定,请先解绑");
            }
        }