Browse Source

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

master
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.result.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@ -134,13 +131,13 @@ public class ProjectController {
* 002项目分类字典查询
* 查询当前客户的父客户下项目分类字典
*
* @param tokenDto
* @param customerId
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.project.dto.result.ProjectCategoryDictResultDTO>>
* @Author zhangyong
* @Date 10:41 2021-03-22
**/
@PostMapping("categorydict")
public Result<List<ProjectCategoryDictResultDTO>> categoryDict(@LoginUser TokenDto tokenDto) {
return new Result<List<ProjectCategoryDictResultDTO>>().ok(projectService.getCategoryDict(tokenDto));
public Result<List<ProjectCategoryDictResultDTO>> categoryDict(@RequestHeader("CustomerId") String customerId) {
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项目分类字典查询
*
* @param tokenDto
* @param customerId
* @return java.util.List<com.epmet.project.dto.result.ProjectCategoryDictResultDTO>
* @Author zhangyong
* @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
public List<ProjectCategoryDictResultDTO> getCategoryDict(TokenDto tokenDto) {
public List<ProjectCategoryDictResultDTO> getCategoryDict(String customerId) {
List<ProjectCategoryDictResultDTO> result = new ArrayList<>();
Result<String> parentCustomerId = operCrmOpenFeignClient.getExternalAndParentCustomerId(tokenDto.getCustomerId());
Result<String> parentCustomerId = operCrmOpenFeignClient.getExternalAndParentCustomerId(customerId);
if (!parentCustomerId.success() && null == parentCustomerId.getData()) {
logger.warn(String.format("调用%s服务查询外部客户的 父级客户ID 失败,入参%s", ServiceConstant.OPER_CRM_SERVER,
JSON.toJSONString(tokenDto.getCustomerId())));
JSON.toJSONString(customerId)));
return result;
}
CustomerCategoryDTO argDto = new CustomerCategoryDTO();
@ -373,7 +373,7 @@ public class ProjectServiceImpl implements ProjectService {
Result<List<ProjectCategoryDictResultDTO>> parentCategoryDict = govIssueOpenFeignClient.getCustomerCategoryDict(argDto);
if (!parentCategoryDict.success()) {
logger.warn(String.format("调用%s服务查询当前客户的父客户下,项目分类字典失败,入参%s", ServiceConstant.GOV_ISSUE_SERVER,
JSON.toJSONString(tokenDto.getCustomerId())));
JSON.toJSONString(customerId)));
} else {
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
public void extractProjectCategoryData(String customerId, String dateId) {
List<ScreenProjectCategoryGridDailyDTO> listDTO= factOriginProjectCategoryDailyService.selectListProjectCategoryGridDailyDTO(customerId);
listDTO.forEach(dto->{
dto.setDateId(dateId);
});
boolean insertRes=insertBatch(ConvertUtils.sourceToTarget(listDTO, ScreenProjectCategoryGridDailyEntity.class));
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
c.CUSTOMER_ID,
left(c.CATEGORY_CODE, 4) as CATEGORY_CODE,
c.`LEVEL`,
'1'as `LEVEL`,
p.GRID_ID,
p.AGENCY_ID AS PID,
P.PIDS,

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

@ -102,6 +102,12 @@
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>oper-crm-client</artifactId>
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
<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.IssueProjectCategoryDictDao;
import com.epmet.dao.IssueProjectRelationDao;
import com.epmet.dto.IssueCategoryDTO;
import com.epmet.dto.IssueDTO;
import com.epmet.dto.IssueProjectCategoryDictDTO;
import com.epmet.dto.ProjectCategoryDTO;
import com.epmet.dto.*;
import com.epmet.dto.form.*;
import com.epmet.dto.result.CustomerCategoryListResultDTO;
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.IssueProjectTagDictEntity;
import com.epmet.feign.GovProjectOpenFeignClient;
import com.epmet.feign.OperCrmOpenFeignClient;
import com.epmet.project.dto.result.ProjectCategoryDictResultDTO;
import com.epmet.redis.IssueProjectCategoryDictRedis;
import com.epmet.service.IssueProjectCategoryDictService;
@ -76,11 +74,12 @@ public class IssueProjectCategoryDictServiceImpl extends BaseServiceImpl<IssuePr
private IssueProjectRelationDao issueProjectRelationDao;
@Autowired
private IssueProjectTagDictService issueProjectTagDictService;
@Autowired
private IssueCategoryDao issueCategoryDao;
@Autowired
private GovProjectOpenFeignClient govProjectOpenFeignClient;
@Autowired
private OperCrmOpenFeignClient operCrmOpenFeignClient;
@Override
public PageData<IssueProjectCategoryDictDTO> page(Map<String, Object> params) {
@ -199,21 +198,35 @@ public class IssueProjectCategoryDictServiceImpl extends BaseServiceImpl<IssuePr
@Override
@Transactional(rollbackFor = Exception.class)
public void init(CategoryTagInitFormDTO formDTO) {
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);
//2021.3.23 sun 不传客户Id时默认查询所有有效客户列表 循环添加
List<String> customerIdList = new ArrayList<>();
if(StringUtils.isBlank(formDTO.getCustomerId())){
Result<List<CustomerDTO>> resultList = operCrmOpenFeignClient.getAllCustomerList();
if(!resultList.success()){
throw new RuntimeException("crm库获取有效客户列表失败!");
}
customerIdList = resultList.getData().stream().map(cu->cu.getId()).collect(Collectors.toList());
}else {
customerIdList.add(formDTO.getCustomerId());
}
//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,
PID,
PIDS,
PARENT_CATEGORY_CODE,
CATEGORY_CODE,
CATEGORY_NAME,
CATEGORY_TYPE,
SORT
SORT,
IS_DISABLE
FROM
issue_project_category_dict
WHERE

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

@ -77,7 +77,8 @@
CATEGORY_ID,
IS_DEFAULT,
ISSUE_USE_COUNT,
PROJECT_USE_COUNT
PROJECT_USE_COUNT,
IS_DISABLE
FROM
issue_project_tag_dict
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