|
@ -30,10 +30,7 @@ import com.epmet.commons.tools.utils.Result; |
|
|
import com.epmet.dao.IssueCategoryDao; |
|
|
import com.epmet.dao.IssueCategoryDao; |
|
|
import com.epmet.dao.IssueProjectCategoryDictDao; |
|
|
import com.epmet.dao.IssueProjectCategoryDictDao; |
|
|
import com.epmet.dao.IssueProjectRelationDao; |
|
|
import com.epmet.dao.IssueProjectRelationDao; |
|
|
import com.epmet.dto.IssueCategoryDTO; |
|
|
import com.epmet.dto.*; |
|
|
import com.epmet.dto.IssueDTO; |
|
|
|
|
|
import com.epmet.dto.IssueProjectCategoryDictDTO; |
|
|
|
|
|
import com.epmet.dto.ProjectCategoryDTO; |
|
|
|
|
|
import com.epmet.dto.form.*; |
|
|
import com.epmet.dto.form.*; |
|
|
import com.epmet.dto.result.CustomerCategoryListResultDTO; |
|
|
import com.epmet.dto.result.CustomerCategoryListResultDTO; |
|
|
import com.epmet.dto.result.ProjectCategoryDTOResultDTO; |
|
|
import com.epmet.dto.result.ProjectCategoryDTOResultDTO; |
|
@ -42,6 +39,7 @@ import com.epmet.dto.result.ProjectIssueDTOResultDTO; |
|
|
import com.epmet.entity.IssueProjectCategoryDictEntity; |
|
|
import com.epmet.entity.IssueProjectCategoryDictEntity; |
|
|
import com.epmet.entity.IssueProjectTagDictEntity; |
|
|
import com.epmet.entity.IssueProjectTagDictEntity; |
|
|
import com.epmet.feign.GovProjectOpenFeignClient; |
|
|
import com.epmet.feign.GovProjectOpenFeignClient; |
|
|
|
|
|
import com.epmet.feign.OperCrmOpenFeignClient; |
|
|
import com.epmet.project.dto.result.ProjectCategoryDictResultDTO; |
|
|
import com.epmet.project.dto.result.ProjectCategoryDictResultDTO; |
|
|
import com.epmet.redis.IssueProjectCategoryDictRedis; |
|
|
import com.epmet.redis.IssueProjectCategoryDictRedis; |
|
|
import com.epmet.service.IssueProjectCategoryDictService; |
|
|
import com.epmet.service.IssueProjectCategoryDictService; |
|
@ -76,11 +74,12 @@ public class IssueProjectCategoryDictServiceImpl extends BaseServiceImpl<IssuePr |
|
|
private IssueProjectRelationDao issueProjectRelationDao; |
|
|
private IssueProjectRelationDao issueProjectRelationDao; |
|
|
@Autowired |
|
|
@Autowired |
|
|
private IssueProjectTagDictService issueProjectTagDictService; |
|
|
private IssueProjectTagDictService issueProjectTagDictService; |
|
|
|
|
|
|
|
|
@Autowired |
|
|
@Autowired |
|
|
private IssueCategoryDao issueCategoryDao; |
|
|
private IssueCategoryDao issueCategoryDao; |
|
|
@Autowired |
|
|
@Autowired |
|
|
private GovProjectOpenFeignClient govProjectOpenFeignClient; |
|
|
private GovProjectOpenFeignClient govProjectOpenFeignClient; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private OperCrmOpenFeignClient operCrmOpenFeignClient; |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public PageData<IssueProjectCategoryDictDTO> page(Map<String, Object> params) { |
|
|
public PageData<IssueProjectCategoryDictDTO> page(Map<String, Object> params) { |
|
@ -199,21 +198,35 @@ public class IssueProjectCategoryDictServiceImpl extends BaseServiceImpl<IssuePr |
|
|
@Override |
|
|
@Override |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
public void init(CategoryTagInitFormDTO formDTO) { |
|
|
public void init(CategoryTagInitFormDTO formDTO) { |
|
|
List<IssueProjectCategoryDictEntity> list = baseDao.selectCategoryListByCustomer(formDTO.getCustomerId()); |
|
|
//2021.3.23 sun 不传客户Id时默认查询所有有效客户列表 循环添加
|
|
|
if (CollectionUtils.isEmpty(list)) { |
|
|
List<String> customerIdList = new ArrayList<>(); |
|
|
//分类初始化
|
|
|
if(StringUtils.isBlank(formDTO.getCustomerId())){ |
|
|
List<IssueProjectCategoryDictEntity> categoryList = baseDao.selectCategoryListByCustomer("default"); |
|
|
Result<List<CustomerDTO>> resultList = operCrmOpenFeignClient.getAllCustomerList(); |
|
|
categoryList.forEach(item -> { |
|
|
if(!resultList.success()){ |
|
|
item.setCustomerId(formDTO.getCustomerId()); |
|
|
throw new RuntimeException("crm库获取有效客户列表失败!"); |
|
|
}); |
|
|
} |
|
|
this.insertBatch(categoryList); |
|
|
customerIdList = resultList.getData().stream().map(cu->cu.getId()).collect(Collectors.toList()); |
|
|
//标签初始化
|
|
|
}else { |
|
|
List<IssueProjectTagDictEntity> tagList = issueProjectTagDictService.getTagListByCustomer("default"); |
|
|
customerIdList.add(formDTO.getCustomerId()); |
|
|
tagList.forEach(item -> { |
|
|
|
|
|
item.setCustomerId(formDTO.getCustomerId()); |
|
|
|
|
|
}); |
|
|
|
|
|
issueProjectTagDictService.insertBatch(tagList); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
//end sun
|
|
|
|
|
|
customerIdList.forEach(cu->{ |
|
|
|
|
|
List<IssueProjectCategoryDictEntity> list = baseDao.selectCategoryListByCustomer(formDTO.getCustomerId()); |
|
|
|
|
|
if (CollectionUtils.isEmpty(list)) { |
|
|
|
|
|
//分类初始化
|
|
|
|
|
|
List<IssueProjectCategoryDictEntity> categoryList = baseDao.selectCategoryListByCustomer("default"); |
|
|
|
|
|
categoryList.forEach(item -> { |
|
|
|
|
|
item.setCustomerId(formDTO.getCustomerId()); |
|
|
|
|
|
}); |
|
|
|
|
|
this.insertBatch(categoryList); |
|
|
|
|
|
//标签初始化
|
|
|
|
|
|
List<IssueProjectTagDictEntity> tagList = issueProjectTagDictService.getTagListByCustomer("default"); |
|
|
|
|
|
tagList.forEach(item -> { |
|
|
|
|
|
item.setCustomerId(formDTO.getCustomerId()); |
|
|
|
|
|
}); |
|
|
|
|
|
issueProjectTagDictService.insertBatch(tagList); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|