|
|
@ -1,15 +1,18 @@
|
|
|
|
package com.glxp.api.controller.basic;
|
|
|
|
package com.glxp.api.controller.basic;
|
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
import com.glxp.api.common.res.BaseResponse;
|
|
|
|
import com.glxp.api.common.res.BaseResponse;
|
|
|
|
import com.glxp.api.common.util.ResultVOUtils;
|
|
|
|
import com.glxp.api.common.util.ResultVOUtils;
|
|
|
|
import com.glxp.api.controller.BaseController;
|
|
|
|
import com.glxp.api.controller.BaseController;
|
|
|
|
|
|
|
|
import com.glxp.api.entity.auth.SysWorkplace;
|
|
|
|
import com.glxp.api.entity.basic.BasicCollectPointCategory;
|
|
|
|
import com.glxp.api.entity.basic.BasicCollectPointCategory;
|
|
|
|
import com.glxp.api.req.basic.BasicCollectgoryRequest;
|
|
|
|
import com.glxp.api.req.basic.BasicCollectgoryRequest;
|
|
|
|
import com.glxp.api.req.basic.BasicProductTypeRequest;
|
|
|
|
import com.glxp.api.req.basic.BasicProductTypeRequest;
|
|
|
|
import com.glxp.api.res.basic.BasicCollectGoryResponse;
|
|
|
|
import com.glxp.api.res.basic.BasicCollectGoryResponse;
|
|
|
|
import com.glxp.api.res.basic.BasicProductCategoryTypeResponse;
|
|
|
|
import com.glxp.api.res.basic.BasicProductCategoryTypeResponse;
|
|
|
|
|
|
|
|
import com.glxp.api.service.auth.SysWorkplaceService;
|
|
|
|
import com.glxp.api.service.basic.BasicCollectPointCategoryService;
|
|
|
|
import com.glxp.api.service.basic.BasicCollectPointCategoryService;
|
|
|
|
import org.springframework.data.domain.Page;
|
|
|
|
import org.springframework.data.domain.Page;
|
|
|
|
import org.springframework.data.domain.PageRequest;
|
|
|
|
import org.springframework.data.domain.PageRequest;
|
|
|
@ -63,7 +66,6 @@ public class BasicCollectPointCategoryController extends BaseController {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("udiwms/basic/collectPoint/category/updateTree")
|
|
|
|
@PostMapping("udiwms/basic/collectPoint/category/updateTree")
|
|
|
|
public BaseResponse updateTree(@RequestBody BasicCollectgoryRequest request) {
|
|
|
|
public BaseResponse updateTree(@RequestBody BasicCollectgoryRequest request) {
|
|
|
|
|
|
|
|
|
|
|
@ -93,12 +95,22 @@ public class BasicCollectPointCategoryController extends BaseController {
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
SysWorkplaceService sysWorkplaceService;
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("udiwms/basic/collectPoint/category/deleteTree")
|
|
|
|
@PostMapping("udiwms/basic/collectPoint/category/deleteTree")
|
|
|
|
public BaseResponse addTree(@RequestBody BasicCollectPointCategory basicCollectPointCategory) {
|
|
|
|
public BaseResponse deleteTree(@RequestBody BasicCollectPointCategory basicCollectPointCategory) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SysWorkplace sysWorkplace = sysWorkplaceService.getOne(new LambdaQueryWrapper<SysWorkplace>().eq(SysWorkplace::getConstituencies, basicCollectPointCategory.getCode()).last("limit 1"));
|
|
|
|
|
|
|
|
if (sysWorkplace != null) {
|
|
|
|
|
|
|
|
return ResultVOUtils.error(500, "删除失败,请先移除该组别下的用户");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
QueryWrapper wrapper = new QueryWrapper();
|
|
|
|
QueryWrapper wrapper = new QueryWrapper();
|
|
|
|
wrapper.eq("code",basicCollectPointCategory.getCode());
|
|
|
|
wrapper.eq("code", basicCollectPointCategory.getCode());
|
|
|
|
boolean remove = basicCollectPointCategoryService.remove(wrapper);
|
|
|
|
boolean remove = basicCollectPointCategoryService.remove(wrapper);
|
|
|
|
if (!remove){
|
|
|
|
if (!remove) {
|
|
|
|
return ResultVOUtils.error("删除失败");
|
|
|
|
return ResultVOUtils.error("删除失败");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return ResultVOUtils.success();
|
|
|
|
return ResultVOUtils.success();
|
|
|
@ -106,7 +118,5 @@ public class BasicCollectPointCategoryController extends BaseController {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|