|
|
@ -30,6 +30,7 @@ import com.epmet.commons.tools.utils.Result; |
|
|
|
import com.epmet.dao.IssueCategoryDao; |
|
|
|
import com.epmet.dao.IssueProjectCategoryDictDao; |
|
|
|
import com.epmet.dao.IssueProjectRelationDao; |
|
|
|
import com.epmet.dao.IssueProjectTagDictDao; |
|
|
|
import com.epmet.dto.*; |
|
|
|
import com.epmet.dto.form.*; |
|
|
|
import com.epmet.dto.result.*; |
|
|
@ -77,6 +78,8 @@ public class IssueProjectCategoryDictServiceImpl extends BaseServiceImpl<IssuePr |
|
|
|
private GovProjectOpenFeignClient govProjectOpenFeignClient; |
|
|
|
@Autowired |
|
|
|
private OperCrmOpenFeignClient operCrmOpenFeignClient; |
|
|
|
@Autowired |
|
|
|
private IssueProjectTagDictDao issueProjectTagDictDao; |
|
|
|
|
|
|
|
@Override |
|
|
|
public PageData<IssueProjectCategoryDictDTO> page(Map<String, Object> params) { |
|
|
@ -243,25 +246,32 @@ public class IssueProjectCategoryDictServiceImpl extends BaseServiceImpl<IssuePr |
|
|
|
List<String> categoryList = new ArrayList<>(); |
|
|
|
//待修改的二级分类Id汇总
|
|
|
|
List<String> secondList = new ArrayList<>(); |
|
|
|
if("1".equals(dto.getCategoryType())){ |
|
|
|
if ("1".equals(dto.getCategoryType())) { |
|
|
|
//2-1.查询子类信息
|
|
|
|
List<ProjectCategoryDictResultDTO> subList = baseDao.selectSubCustomerCategoryDict(formDTO.getCustomerId(),formDTO.getCategoryId()); |
|
|
|
secondList = subList.stream().map(sub->sub.getId()).collect(Collectors.toList()); |
|
|
|
List<ProjectCategoryDictResultDTO> subList = baseDao.selectSubCustomerCategoryDict(formDTO.getCustomerId(), formDTO.getCategoryId()); |
|
|
|
secondList = subList.stream().map(sub -> sub.getId()).collect(Collectors.toList()); |
|
|
|
categoryList.add(formDTO.getCategoryId()); |
|
|
|
}else { |
|
|
|
} else { |
|
|
|
secondList.add(formDTO.getCategoryId()); |
|
|
|
} |
|
|
|
categoryList.addAll(secondList); |
|
|
|
formDTO.setCategoryList(categoryList); |
|
|
|
formDTO.setSecondCategorylist(secondList); |
|
|
|
|
|
|
|
//3.修改标签、分类表数据状态
|
|
|
|
if(baseDao.updateCustomerCategory(formDTO)<NumConstant.ONE){ |
|
|
|
//修改分类数据
|
|
|
|
if (baseDao.updateCustomerCategory(formDTO) < NumConstant.ONE) { |
|
|
|
logger.error(String.format("修改分类信息状态失败,客户Id->%s,分类Id->%s", formDTO.getCustomerId(), formDTO.getCategoryId())); |
|
|
|
throw new RuntimeException("分类信息修改失败!"); |
|
|
|
} |
|
|
|
//修改吧二级分类下默认的标签数据
|
|
|
|
if (issueProjectTagDictDao.updateCustomerTag(formDTO) < NumConstant.ONE) { |
|
|
|
logger.error(String.format("修改标签信息状态失败,客户Id->%s,分类Id->%s", formDTO.getCustomerId(), formDTO.getCategoryId())); |
|
|
|
throw new RuntimeException("分类、标签信息修改失败!"); |
|
|
|
} |
|
|
|
//4.修改缓存中标签状态 todo
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @Description 分类删除 |
|
|
@ -281,7 +291,7 @@ public class IssueProjectCategoryDictServiceImpl extends BaseServiceImpl<IssuePr |
|
|
|
//2-1.判断议题有无使用
|
|
|
|
List<IssueCategoryDTO> issueList = issueCategoryDao.selectIssueList(formDTO); |
|
|
|
//已使用,不允许删除
|
|
|
|
if (null != issueList || issueList.size() > NumConstant.ZERO) { |
|
|
|
if (null != issueList && issueList.size() > NumConstant.ZERO) { |
|
|
|
throw new RenException(EpmetErrorCode.CUSTOMER_CATEGORY.getCode(), EpmetErrorCode.CUSTOMER_CATEGORY.getMsg()); |
|
|
|
} |
|
|
|
//2-2.判断项目有无使用
|
|
|
@ -289,7 +299,7 @@ public class IssueProjectCategoryDictServiceImpl extends BaseServiceImpl<IssuePr |
|
|
|
if (!resultList.success()) { |
|
|
|
throw new RenException(resultList.getCode(), resultList.getMsg()); |
|
|
|
} |
|
|
|
if (null != resultList.getData() || resultList.getData().size() > NumConstant.ZERO) { |
|
|
|
if (null != resultList.getData() && resultList.getData().size() > NumConstant.ZERO) { |
|
|
|
throw new RenException(EpmetErrorCode.CUSTOMER_CATEGORY.getCode(), EpmetErrorCode.CUSTOMER_CATEGORY.getMsg()); |
|
|
|
} |
|
|
|
|
|
|
|