Browse Source

Merge remote-tracking branch 'origin/dev_issue_category' into dev_issue_category

dev_shibei_match
wangchao 5 years ago
parent
commit
7b4aee8032
  1. 11
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/project/ProjectController.java
  2. 4
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/ProjectService.java
  3. 8
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/impl/ProjectServiceImpl.java
  4. 3
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectCategoryGridDailyServiceImpl.java
  5. 2
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectCategoryDailyDao.xml
  6. 6
      epmet-module/gov-issue/gov-issue-server/pom.xml
  7. 51
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProjectCategoryDictServiceImpl.java
  8. 4
      epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml
  9. 3
      epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectTagDictDao.xml
  10. 0
      epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.9__del_category_tag_field.sql

11
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/project/ProjectController.java

@ -16,10 +16,7 @@ import com.epmet.project.dto.form.DifficultyRankFormDTO;
import com.epmet.project.dto.form.ProjectIncrTrendFormDTO; import com.epmet.project.dto.form.ProjectIncrTrendFormDTO;
import com.epmet.project.dto.result.*; import com.epmet.project.dto.result.*;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List; import java.util.List;
@ -134,13 +131,13 @@ public class ProjectController {
* 002项目分类字典查询 * 002项目分类字典查询
* 查询当前客户的父客户下项目分类字典 * 查询当前客户的父客户下项目分类字典
* *
* @param tokenDto * @param customerId
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.project.dto.result.ProjectCategoryDictResultDTO>> * @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.project.dto.result.ProjectCategoryDictResultDTO>>
* @Author zhangyong * @Author zhangyong
* @Date 10:41 2021-03-22 * @Date 10:41 2021-03-22
**/ **/
@PostMapping("categorydict") @PostMapping("categorydict")
public Result<List<ProjectCategoryDictResultDTO>> categoryDict(@LoginUser TokenDto tokenDto) { public Result<List<ProjectCategoryDictResultDTO>> categoryDict(@RequestHeader("CustomerId") String customerId) {
return new Result<List<ProjectCategoryDictResultDTO>>().ok(projectService.getCategoryDict(tokenDto)); return new Result<List<ProjectCategoryDictResultDTO>>().ok(projectService.getCategoryDict(customerId));
} }
} }

4
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/ProjectService.java

@ -74,10 +74,10 @@ public interface ProjectService {
/** /**
* 002项目分类字典查询 * 002项目分类字典查询
* *
* @param tokenDto * @param customerId
* @return java.util.List<com.epmet.project.dto.result.ProjectCategoryDictResultDTO> * @return java.util.List<com.epmet.project.dto.result.ProjectCategoryDictResultDTO>
* @Author zhangyong * @Author zhangyong
* @Date 14:26 2021-03-22 * @Date 14:26 2021-03-22
**/ **/
List<ProjectCategoryDictResultDTO> getCategoryDict(TokenDto tokenDto); List<ProjectCategoryDictResultDTO> getCategoryDict(String customerId);
} }

8
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/impl/ProjectServiceImpl.java

@ -358,12 +358,12 @@ public class ProjectServiceImpl implements ProjectService {
} }
@Override @Override
public List<ProjectCategoryDictResultDTO> getCategoryDict(TokenDto tokenDto) { public List<ProjectCategoryDictResultDTO> getCategoryDict(String customerId) {
List<ProjectCategoryDictResultDTO> result = new ArrayList<>(); List<ProjectCategoryDictResultDTO> result = new ArrayList<>();
Result<String> parentCustomerId = operCrmOpenFeignClient.getExternalAndParentCustomerId(tokenDto.getCustomerId()); Result<String> parentCustomerId = operCrmOpenFeignClient.getExternalAndParentCustomerId(customerId);
if (!parentCustomerId.success() && null == parentCustomerId.getData()) { if (!parentCustomerId.success() && null == parentCustomerId.getData()) {
logger.warn(String.format("调用%s服务查询外部客户的 父级客户ID 失败,入参%s", ServiceConstant.OPER_CRM_SERVER, logger.warn(String.format("调用%s服务查询外部客户的 父级客户ID 失败,入参%s", ServiceConstant.OPER_CRM_SERVER,
JSON.toJSONString(tokenDto.getCustomerId()))); JSON.toJSONString(customerId)));
return result; return result;
} }
CustomerCategoryDTO argDto = new CustomerCategoryDTO(); CustomerCategoryDTO argDto = new CustomerCategoryDTO();
@ -373,7 +373,7 @@ public class ProjectServiceImpl implements ProjectService {
Result<List<ProjectCategoryDictResultDTO>> parentCategoryDict = govIssueOpenFeignClient.getCustomerCategoryDict(argDto); Result<List<ProjectCategoryDictResultDTO>> parentCategoryDict = govIssueOpenFeignClient.getCustomerCategoryDict(argDto);
if (!parentCategoryDict.success()) { if (!parentCategoryDict.success()) {
logger.warn(String.format("调用%s服务查询当前客户的父客户下,项目分类字典失败,入参%s", ServiceConstant.GOV_ISSUE_SERVER, logger.warn(String.format("调用%s服务查询当前客户的父客户下,项目分类字典失败,入参%s", ServiceConstant.GOV_ISSUE_SERVER,
JSON.toJSONString(tokenDto.getCustomerId()))); JSON.toJSONString(customerId)));
} else { } else {
result = parentCategoryDict.getData(); result = parentCategoryDict.getData();
// 获取客户二级分类 // 获取客户二级分类

3
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectCategoryGridDailyServiceImpl.java

@ -144,6 +144,9 @@ public class ScreenProjectCategoryGridDailyServiceImpl extends BaseServiceImpl<S
@Override @Override
public void extractProjectCategoryData(String customerId, String dateId) { public void extractProjectCategoryData(String customerId, String dateId) {
List<ScreenProjectCategoryGridDailyDTO> listDTO= factOriginProjectCategoryDailyService.selectListProjectCategoryGridDailyDTO(customerId); List<ScreenProjectCategoryGridDailyDTO> listDTO= factOriginProjectCategoryDailyService.selectListProjectCategoryGridDailyDTO(customerId);
listDTO.forEach(dto->{
dto.setDateId(dateId);
});
boolean insertRes=insertBatch(ConvertUtils.sourceToTarget(listDTO, ScreenProjectCategoryGridDailyEntity.class)); boolean insertRes=insertBatch(ConvertUtils.sourceToTarget(listDTO, ScreenProjectCategoryGridDailyEntity.class));
log.info("insertRes is {}",insertRes); log.info("insertRes is {}",insertRes);
} }

2
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectCategoryDailyDao.xml

@ -43,7 +43,7 @@
SELECT SELECT
c.CUSTOMER_ID, c.CUSTOMER_ID,
left(c.CATEGORY_CODE, 4) as CATEGORY_CODE, left(c.CATEGORY_CODE, 4) as CATEGORY_CODE,
c.`LEVEL`, '1'as `LEVEL`,
p.GRID_ID, p.GRID_ID,
p.AGENCY_ID AS PID, p.AGENCY_ID AS PID,
P.PIDS, P.PIDS,

6
epmet-module/gov-issue/gov-issue-server/pom.xml

@ -102,6 +102,12 @@
<version>2.0.0</version> <version>2.0.0</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>oper-crm-client</artifactId>
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
</dependencies> </dependencies>
<build> <build>

51
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProjectCategoryDictServiceImpl.java

@ -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(cu);
if (CollectionUtils.isEmpty(list)) {
//分类初始化
List<IssueProjectCategoryDictEntity> categoryList = baseDao.selectCategoryListByCustomer("default");
categoryList.forEach(item -> {
item.setCustomerId(cu);
});
this.insertBatch(categoryList);
//标签初始化
List<IssueProjectTagDictEntity> tagList = issueProjectTagDictService.getTagListByCustomer("default");
tagList.forEach(item -> {
item.setCustomerId(cu);
});
issueProjectTagDictService.insertBatch(tagList);
}
});
} }
/** /**

4
epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml

@ -46,10 +46,12 @@
ID, ID,
PID, PID,
PIDS, PIDS,
PARENT_CATEGORY_CODE,
CATEGORY_CODE, CATEGORY_CODE,
CATEGORY_NAME, CATEGORY_NAME,
CATEGORY_TYPE, CATEGORY_TYPE,
SORT SORT,
IS_DISABLE
FROM FROM
issue_project_category_dict issue_project_category_dict
WHERE WHERE

3
epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectTagDictDao.xml

@ -77,7 +77,8 @@
CATEGORY_ID, CATEGORY_ID,
IS_DEFAULT, IS_DEFAULT,
ISSUE_USE_COUNT, ISSUE_USE_COUNT,
PROJECT_USE_COUNT PROJECT_USE_COUNT,
IS_DISABLE
FROM FROM
issue_project_tag_dict issue_project_tag_dict
WHERE WHERE

0
epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.8__del_category_tag_field.sql → epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.9__del_category_tag_field.sql

Loading…
Cancel
Save