|
|
|
@ -88,14 +88,14 @@ public class BasicProductCategoryController {
|
|
|
|
|
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(StrUtil.isEmpty(basicProductTypeRequest.getName())){
|
|
|
|
|
if (StrUtil.isEmpty(basicProductTypeRequest.getName())) {
|
|
|
|
|
return ResultVOUtils.error(999, "名字不能为空!");
|
|
|
|
|
}
|
|
|
|
|
Boolean falg = basicProductCategoryService.checkName(basicProductTypeRequest, 1);
|
|
|
|
|
if(falg==false){
|
|
|
|
|
if (falg == false) {
|
|
|
|
|
return ResultVOUtils.error(999, "院内分类名字已存在!");
|
|
|
|
|
}
|
|
|
|
|
falg = basicProductCategoryService.saveBasicHospType(basicProductTypeRequest);
|
|
|
|
|
falg = basicProductCategoryService.saveBasicHospType(basicProductTypeRequest);
|
|
|
|
|
if (!falg) {
|
|
|
|
|
return ResultVOUtils.error(999, "插入失败!");
|
|
|
|
|
}
|
|
|
|
@ -110,16 +110,16 @@ public class BasicProductCategoryController {
|
|
|
|
|
if (bindingResult.hasErrors()) {
|
|
|
|
|
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
|
|
|
|
}
|
|
|
|
|
if(StrUtil.isEmpty(basicProductTypeRequest.getName())){
|
|
|
|
|
if (StrUtil.isEmpty(basicProductTypeRequest.getName())) {
|
|
|
|
|
return ResultVOUtils.error(999, "名字不能为空!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(basicProductTypeRequest.getCode().equals(basicProductTypeRequest.getParentCode())){
|
|
|
|
|
if (basicProductTypeRequest.getCode().equals(basicProductTypeRequest.getParentCode())) {
|
|
|
|
|
return ResultVOUtils.error(999, "上级菜单不能选择自己!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Boolean falg = basicProductCategoryService.checkName(basicProductTypeRequest, 2);
|
|
|
|
|
if(falg==false){
|
|
|
|
|
if (falg == false) {
|
|
|
|
|
return ResultVOUtils.error(999, "院内分类名字已存在!");
|
|
|
|
|
}
|
|
|
|
|
falg = basicProductCategoryService.updateBasicHospType(basicProductTypeRequest);
|
|
|
|
@ -139,16 +139,16 @@ public class BasicProductCategoryController {
|
|
|
|
|
}
|
|
|
|
|
//先判断是否有下级 无下级在判断是否有产品
|
|
|
|
|
boolean b = basicProductCategoryService.checkExist(basicProductTypeRequest.getCode());
|
|
|
|
|
if(b){
|
|
|
|
|
return ResultVOUtils.error(555,"此分类下还有子分类,不能删除!");
|
|
|
|
|
if (b) {
|
|
|
|
|
return ResultVOUtils.error(555, "此分类下还有子分类,不能删除!");
|
|
|
|
|
}
|
|
|
|
|
//判断此分类中是否有产品
|
|
|
|
|
boolean checkrel = basicProductCategoryService.checkrel(basicProductTypeRequest.getCode());
|
|
|
|
|
if(checkrel){
|
|
|
|
|
return ResultVOUtils.error(555,"此分类中绑定产品,不能删除!");
|
|
|
|
|
if (checkrel) {
|
|
|
|
|
return ResultVOUtils.error(555, "此分类中绑定产品,不能删除!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String msg = basicProductCategoryService.delectBasicHospType(basicProductTypeRequest);
|
|
|
|
|
String msg = basicProductCategoryService.delectBasicHospType(basicProductTypeRequest);
|
|
|
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(msg)) {
|
|
|
|
|
return ResultVOUtils.error(999, msg);
|
|
|
|
@ -201,7 +201,7 @@ public class BasicProductCategoryController {
|
|
|
|
|
filterUdiProductRequest.setDiType(1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<UdiRelevanceResponse> list= basicProductCategoryService.selectAll(filterUdiProductRequest);
|
|
|
|
|
List<UdiRelevanceResponse> list = basicProductCategoryService.selectAll(filterUdiProductRequest);
|
|
|
|
|
PageInfo<UdiRelevanceResponse> pageInfo = new PageInfo<>(list);
|
|
|
|
|
PageSimpleResponse<UdiRelevanceResponse> pageSimpleResponse = new PageSimpleResponse<>();
|
|
|
|
|
pageSimpleResponse.setTotal(pageInfo.getTotal());
|
|
|
|
@ -216,9 +216,9 @@ public class BasicProductCategoryController {
|
|
|
|
|
BasicProductCategory category = basicProductCategoryService.checkCode(filterUdiRelRequest.getParentCode());
|
|
|
|
|
//过滤已被选入的产品
|
|
|
|
|
FilterUdiProductRequest request = new FilterUdiProductRequest();
|
|
|
|
|
if("10000".equals(category.getParentCode())) {
|
|
|
|
|
if ("10000".equals(category.getParentCode())) {
|
|
|
|
|
request.setCode(filterUdiRelRequest.getParentCode());
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
request.setCode(category.getCode());
|
|
|
|
|
}
|
|
|
|
|
List<UdiRelevanceResponse> udiRelevanceResponses1 = basicProductCategoryService.selectAll(request);
|
|
|
|
@ -227,35 +227,35 @@ public class BasicProductCategoryController {
|
|
|
|
|
list.add(udiRelevanceResponse.getId());
|
|
|
|
|
}
|
|
|
|
|
filterUdiRelRequest.setExistid(list);
|
|
|
|
|
List<UdiRelevanceResponse> udiRelevanceResponses=null;
|
|
|
|
|
List<UdiRelevanceResponse> udiRelevanceResponses = null;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (StrUtil.isNotEmpty(filterUdiRelRequest.getUdiCode())) {
|
|
|
|
|
UdiEntity udiEntity = FilterUdiUtils.getUdi(filterUdiRelRequest.getUdiCode());
|
|
|
|
|
if (udiEntity != null) {
|
|
|
|
|
filterUdiRelRequest.setNameCode(udiEntity.getUdi());
|
|
|
|
|
filterUdiRelRequest.setUnionCode(udiEntity.getUdi());
|
|
|
|
|
}
|
|
|
|
|
if (StrUtil.isNotEmpty(filterUdiRelRequest.getUdiCode())) {
|
|
|
|
|
UdiEntity udiEntity = FilterUdiUtils.getUdi(filterUdiRelRequest.getUdiCode());
|
|
|
|
|
if (udiEntity != null) {
|
|
|
|
|
filterUdiRelRequest.setNameCode(udiEntity.getUdi());
|
|
|
|
|
filterUdiRelRequest.setUnionCode(udiEntity.getUdi());
|
|
|
|
|
}
|
|
|
|
|
//如果输入DI标识,精确找到不同层级对应的产品信息
|
|
|
|
|
if (StrUtil.isNotEmpty(filterUdiRelRequest.getUnionCode())) {
|
|
|
|
|
FilterUdiRelRequest filterUdiInfoRequest = new FilterUdiRelRequest();
|
|
|
|
|
filterUdiInfoRequest.setNameCode(filterUdiRelRequest.getUnionCode());
|
|
|
|
|
List<UdiRelevanceResponse> temps = basicHospTypeService.filterUdiGp(filterUdiInfoRequest);
|
|
|
|
|
if (temps != null && temps.size() > 0) {
|
|
|
|
|
filterUdiRelRequest.setOriginUuid(temps.get(0).getOriginUuid());
|
|
|
|
|
filterUdiRelRequest.setNameCode(filterUdiInfoRequest.getNameCode());
|
|
|
|
|
filterUdiRelRequest.setUnionCode(null);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
//只查找主标识产品信息
|
|
|
|
|
filterUdiRelRequest.setDiType(1);
|
|
|
|
|
}
|
|
|
|
|
//如果输入DI标识,精确找到不同层级对应的产品信息
|
|
|
|
|
if (StrUtil.isNotEmpty(filterUdiRelRequest.getUnionCode())) {
|
|
|
|
|
FilterUdiRelRequest filterUdiInfoRequest = new FilterUdiRelRequest();
|
|
|
|
|
filterUdiInfoRequest.setNameCode(filterUdiRelRequest.getUnionCode());
|
|
|
|
|
List<UdiRelevanceResponse> temps = basicHospTypeService.filterUdiGp(filterUdiInfoRequest);
|
|
|
|
|
if (temps != null && temps.size() > 0) {
|
|
|
|
|
filterUdiRelRequest.setOriginUuid(temps.get(0).getOriginUuid());
|
|
|
|
|
filterUdiRelRequest.setNameCode(filterUdiInfoRequest.getNameCode());
|
|
|
|
|
filterUdiRelRequest.setUnionCode(null);
|
|
|
|
|
}
|
|
|
|
|
if("10000".equals(category.getParentCode())) {
|
|
|
|
|
} else {
|
|
|
|
|
//只查找主标识产品信息
|
|
|
|
|
filterUdiRelRequest.setDiType(1);
|
|
|
|
|
}
|
|
|
|
|
if ("10000".equals(category.getParentCode())) {
|
|
|
|
|
//查全部
|
|
|
|
|
udiRelevanceResponses= basicHospTypeService.filterUdiGpexist(filterUdiRelRequest);
|
|
|
|
|
udiRelevanceResponses = basicHospTypeService.filterUdiGpexist(filterUdiRelRequest);
|
|
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
// 查上级
|
|
|
|
|
FilterUdiProductRequest filterUdiProductRequest = new FilterUdiProductRequest();
|
|
|
|
|
filterUdiProductRequest.setCode(category.getParentCode());
|
|
|
|
@ -266,7 +266,7 @@ public class BasicProductCategoryController {
|
|
|
|
|
filterUdiProductRequest.setThrPiId(filterUdiRelRequest.getThrPiId());
|
|
|
|
|
filterUdiProductRequest.setNameCode(filterUdiRelRequest.getNameCode());
|
|
|
|
|
filterUdiProductRequest.setExistid(list);
|
|
|
|
|
udiRelevanceResponses= basicProductCategoryService.selectAll(filterUdiProductRequest);
|
|
|
|
|
udiRelevanceResponses = basicProductCategoryService.selectAll(filterUdiProductRequest);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -278,40 +278,39 @@ public class BasicProductCategoryController {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/udiwms/basic/product/category/SelcetproductList")
|
|
|
|
|
public BaseResponse SelectproductList(FilterUdiRelRequest filterUdiRelRequest) {
|
|
|
|
|
|
|
|
|
|
List<UdiRelevanceResponse> udiRelevanceResponses=null;
|
|
|
|
|
List<UdiRelevanceResponse> udiRelevanceResponses = null;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (StrUtil.isNotEmpty(filterUdiRelRequest.getUdiCode())) {
|
|
|
|
|
UdiEntity udiEntity = FilterUdiUtils.getUdi(filterUdiRelRequest.getUdiCode());
|
|
|
|
|
if (udiEntity != null) {
|
|
|
|
|
filterUdiRelRequest.setNameCode(udiEntity.getUdi());
|
|
|
|
|
filterUdiRelRequest.setUnionCode(udiEntity.getUdi());
|
|
|
|
|
}
|
|
|
|
|
if (StrUtil.isNotEmpty(filterUdiRelRequest.getUdiCode())) {
|
|
|
|
|
UdiEntity udiEntity = FilterUdiUtils.getUdi(filterUdiRelRequest.getUdiCode());
|
|
|
|
|
if (udiEntity != null) {
|
|
|
|
|
filterUdiRelRequest.setNameCode(udiEntity.getUdi());
|
|
|
|
|
filterUdiRelRequest.setUnionCode(udiEntity.getUdi());
|
|
|
|
|
}
|
|
|
|
|
//如果输入DI标识,精确找到不同层级对应的产品信息
|
|
|
|
|
if (StrUtil.isNotEmpty(filterUdiRelRequest.getUnionCode())) {
|
|
|
|
|
FilterUdiRelRequest filterUdiInfoRequest = new FilterUdiRelRequest();
|
|
|
|
|
filterUdiInfoRequest.setNameCode(filterUdiRelRequest.getUnionCode());
|
|
|
|
|
List<UdiRelevanceResponse> temps = udiRelevanceService.filterUdiGp(filterUdiInfoRequest);
|
|
|
|
|
if (temps != null && temps.size() > 0) {
|
|
|
|
|
filterUdiRelRequest.setOriginUuid(temps.get(0).getOriginUuid());
|
|
|
|
|
filterUdiRelRequest.setNameCode(filterUdiInfoRequest.getNameCode());
|
|
|
|
|
filterUdiRelRequest.setUnionCode(null);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
//只查找主标识产品信息
|
|
|
|
|
filterUdiRelRequest.setDiType(1);
|
|
|
|
|
}
|
|
|
|
|
//如果输入DI标识,精确找到不同层级对应的产品信息
|
|
|
|
|
if (StrUtil.isNotEmpty(filterUdiRelRequest.getUnionCode())) {
|
|
|
|
|
FilterUdiRelRequest filterUdiInfoRequest = new FilterUdiRelRequest();
|
|
|
|
|
filterUdiInfoRequest.setNameCode(filterUdiRelRequest.getUnionCode());
|
|
|
|
|
List<UdiRelevanceResponse> temps = udiRelevanceService.filterUdiGp(filterUdiInfoRequest);
|
|
|
|
|
if (temps != null && temps.size() > 0) {
|
|
|
|
|
filterUdiRelRequest.setOriginUuid(temps.get(0).getOriginUuid());
|
|
|
|
|
filterUdiRelRequest.setNameCode(filterUdiInfoRequest.getNameCode());
|
|
|
|
|
filterUdiRelRequest.setUnionCode(null);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
//只查找主标识产品信息
|
|
|
|
|
filterUdiRelRequest.setDiType(1);
|
|
|
|
|
}
|
|
|
|
|
//是否是一级分类
|
|
|
|
|
BasicProductCategory category = basicProductCategoryService.checkCode(filterUdiRelRequest.getParentCode());
|
|
|
|
|
if("10000".equals(category.getParentCode())) {
|
|
|
|
|
if ("10000".equals(category.getParentCode())) {
|
|
|
|
|
//查全部
|
|
|
|
|
udiRelevanceResponses= basicHospTypeService.filterUdiGp(filterUdiRelRequest);
|
|
|
|
|
}else{
|
|
|
|
|
udiRelevanceResponses = basicHospTypeService.filterUdiGp(filterUdiRelRequest);
|
|
|
|
|
} else {
|
|
|
|
|
// 查上级
|
|
|
|
|
FilterUdiProductRequest filterUdiProductRequest = new FilterUdiProductRequest();
|
|
|
|
|
filterUdiProductRequest.setCode(category.getParentCode());
|
|
|
|
@ -322,7 +321,7 @@ public class BasicProductCategoryController {
|
|
|
|
|
filterUdiProductRequest.setThrPiId(filterUdiRelRequest.getThrPiId());
|
|
|
|
|
filterUdiProductRequest.setNameCode(filterUdiRelRequest.getNameCode());
|
|
|
|
|
|
|
|
|
|
udiRelevanceResponses= basicProductCategoryService.selectAll(filterUdiProductRequest);
|
|
|
|
|
udiRelevanceResponses = basicProductCategoryService.selectAll(filterUdiProductRequest);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
//循环插入
|
|
|
|
@ -331,10 +330,10 @@ public class BasicProductCategoryController {
|
|
|
|
|
List<String> list = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
for (UdiRelevanceResponse udiRelevanceRespons : udiRelevanceResponses) {
|
|
|
|
|
list.add(udiRelevanceRespons.getId()+"");
|
|
|
|
|
list.add(udiRelevanceRespons.getId() + "");
|
|
|
|
|
}
|
|
|
|
|
if(!(udiRelevanceResponses != null && udiRelevanceResponses.size()>0)){
|
|
|
|
|
return ResultVOUtils.error(456,"为查询到对应数据!");
|
|
|
|
|
if (!(udiRelevanceResponses != null && udiRelevanceResponses.size() > 0)) {
|
|
|
|
|
return ResultVOUtils.error(456, "为查询到对应数据!");
|
|
|
|
|
}
|
|
|
|
|
basicProductTypeRequest.setIds(list);
|
|
|
|
|
basicProductCategoryService.insertCateRel(basicProductTypeRequest);
|
|
|
|
@ -343,20 +342,13 @@ public class BasicProductCategoryController {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/udiwms/basic/product/category/deleterel")
|
|
|
|
|
public BaseResponse deleterel(Integer id){
|
|
|
|
|
basicProductCategoryService.deleterelByid(id);
|
|
|
|
|
return ResultVOUtils.success();
|
|
|
|
|
public BaseResponse deleterel(Integer id) {
|
|
|
|
|
basicProductCategoryService.deleterelByid(id);
|
|
|
|
|
return ResultVOUtils.success();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/udiwms/basic/product/category/unbindRel")
|
|
|
|
|
@Log(title = "单据管理", businessType = BusinessType.UPDATE)
|
|
|
|
|
public BaseResponse unbindRel(@RequestBody BasicHospTypeRequest basicHospTypeRequest, BindingResult bindingResult) {
|
|
|
|
|