Browse Source

分类饼1

dev
yinzuomei 3 years ago
parent
commit
a8c6142dcb
  1. 2
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventCategoryAnalysisFormDTO.java
  2. 6
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/IcEventController.java
  3. 4
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java

2
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventCategoryAnalysisFormDTO.java

@ -53,7 +53,7 @@ public class IcEventCategoryAnalysisFormDTO {
* 一级分类 code长度
*/
private Integer categoryOneLength;
private String gridPids;
//以下参数从token中获取
/**
* 当前登录用户

6
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/IcEventController.java

@ -15,11 +15,6 @@ import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.dto.IcEventDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.dto.form.demand.ReportDemandFormDTO;
import com.epmet.dto.result.IcEventListResultDTO;
import com.epmet.dto.result.IcEventMonthlyIncrementResultDTO;
import com.epmet.dto.result.IcEventResultDTO;
import com.epmet.dto.result.ProcessStatusRatioResultDTO;
import com.epmet.service.IcEventService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -193,6 +188,7 @@ public class IcEventController {
public Result<List<IcEventCategoryAnalysisResDTO>> categoryAnalysisTotal(@LoginUser TokenDto tokenDto, @RequestBody IcEventCategoryAnalysisFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setStaffId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO,IcEventCategoryAnalysisFormDTO.TotalPie.class);
List<IcEventCategoryAnalysisResDTO> list = icEventService.categoryAnalysisTotal(formDTO);
return new Result<List<IcEventCategoryAnalysisResDTO>>().ok(list);
}

4
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java

@ -645,13 +645,15 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
*/
@Override
public List<IcEventCategoryAnalysisResDTO> categoryAnalysisTotal(IcEventCategoryAnalysisFormDTO formDTO) {
//1.查询客户下一级分类信息
Result<List<IssueProjectCategoryDictDTO>> res = govIssueOpenFeignClient.queryFirstCategory(formDTO.getCustomerId());
if (!res.success() || CollectionUtils.isEmpty(res.getData())) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "当前客户下未配置事件分类");
}
int length = res.getData().get(NumConstant.ZERO).getCategoryCode().length();
formDTO.setCategoryOneLength(length);
if ("agency".equals(formDTO.getOrgType())) {
formDTO.setGridPids(getEventGridPids(formDTO.getOrgId()));
}
List<IcEventCategoryAnalysisResDTO> resList = baseDao.selectFirstCategoryTotal(formDTO);
Map<String, IcEventCategoryAnalysisResDTO> resMap = resList.stream().collect(Collectors.toMap(IcEventCategoryAnalysisResDTO::getCategoryCode, Function.identity()));

Loading…
Cancel
Save