Browse Source

Merge remote-tracking branch 'remotes/origin/dev_ic_platform' into dev_ic_v2

dev_shibei_match
jianjun 4 years ago
parent
commit
debfe535dc
  1. 2
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/distributedlock/DistributedLock.java
  2. 11
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ExcelUtils.java
  3. 6
      epmet-gateway/src/main/java/com/epmet/GatewayApplication.java
  4. 21
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java
  5. 16
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/form/CategoryProjectListFormDTO.java
  6. 3
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/form/ProjectCategoryFormDTO.java
  7. 25
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/CategoryProjectListResultDTO.java
  8. 20
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectCategoryResultDTO.java
  9. 4
      epmet-module/data-report/data-report-server/deploy/docker-compose-prod.yml
  10. 6
      epmet-module/data-report/data-report-server/pom.xml
  11. 96
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java
  12. 27
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java
  13. BIN
      epmet-module/data-report/data-report-server/src/main/resources/excel/project_category_temp.xlsx
  14. BIN
      epmet-module/data-report/data-report-server/src/main/resources/excel/project_temp.xlsx
  15. BIN
      epmet-module/data-report/data-report-server/src/main/resources/excel/project_temp_easy_excel.xlsx
  16. 3
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml
  17. 7
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectCategoryOrgDailyDao.xml
  18. 11
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml
  19. 24
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java
  20. 1
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectLogDailyDao.java
  21. 3
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectLogDailyService.java
  22. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java
  23. 46
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/OrgRankExtractServiceImpl.java
  24. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectOrgDailyServiceImpl.java
  25. 76
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml
  26. 2
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.xml
  27. 4
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/IcResiCategoryWarnConfigDTO.java
  28. 2
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java
  29. 4
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java
  30. 12
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/ResiCategoryStatsConfigController.java
  31. 15
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcResiCategoryStatsConfigDao.java
  32. 4
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcResiCategoryWarnConfigEntity.java
  33. 2
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/ResiCategoryStatsConfigService.java
  34. 165
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/ResiCategoryStatsConfigServiceImpl.java
  35. 49
      epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcResiCategoryStatsConfigDao.xml
  36. 1
      epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcResiCategoryWarnConfigDao.xml
  37. 4
      epmet-user/epmet-user-server/pom.xml
  38. 6
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsResiWarnServiceImpl.java

2
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/distributedlock/DistributedLock.java

@ -18,7 +18,7 @@ import java.util.concurrent.TimeUnit;
@Component
public class DistributedLock {
@Autowired
@Autowired(required = false)
private RedissonClient redissonClient;
/**

11
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ExcelUtils.java

@ -19,8 +19,8 @@ import org.springframework.util.CollectionUtils;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.OutputStream;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
@ -121,5 +121,14 @@ public class ExcelUtils {
out.flush();
out.close();
}
public static OutputStream getOutputStream(String fileName, HttpServletResponse response) throws Exception {
fileName = URLEncoder.encode(fileName, "UTF-8");
response.setContentType("application/vnd.ms-excel");
response.setCharacterEncoding("utf8");
response.setHeader("Content-Disposition", "attachment;filename=" + fileName);
response.addHeader("Access-Control-Expose-Headers", "Content-disposition");
return response.getOutputStream();
}
}

6
epmet-gateway/src/main/java/com/epmet/GatewayApplication.java

@ -9,9 +9,9 @@
package com.epmet;
import com.epmet.commons.tools.aspect.ServletExceptionHandler;
import com.epmet.commons.tools.config.RedissonConfig;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.ComponentScan;
@ -23,11 +23,11 @@ import org.springframework.context.annotation.FilterType;
* @author Mark sunlightcs@gmail.com
* @since 1.0.0
*/
@SpringBootApplication()
@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients
//@ServletComponentScan
@ComponentScan(basePackages = {"com.epmet.*"}, excludeFilters = @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, classes = {ServletExceptionHandler.class}))
@ComponentScan(basePackages = {"com.epmet.*"}, excludeFilters = @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, classes = {RedissonConfig.class, ServletExceptionHandler.class}))
public class GatewayApplication {
public static void main(String[] args) {

21
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java

@ -1231,35 +1231,28 @@ public class DataStatsServiceImpl implements DataStatsService {
}
//1.查询当前组织的直属下级组织信息【机关维度】
List<DimAgencyEntity> subAgencyList = dataStatsDao.getSubAgencyList(formDTO.getAgencyId());
List<ScreenCustomerAgencyDTO> subAgencyList = indexService.getSubAgencyList(formDTO.getAgencyId(), null);
if (subAgencyList.size() < NumConstant.ONE) {
return resultList;
}
List<String> agencyIds = subAgencyList.stream().map(DimAgencyEntity::getId).collect(Collectors.toList());
List<String> agencyIds = subAgencyList.stream().map(ScreenCustomerAgencyDTO::getAgencyId).collect(Collectors.toList());
ScreenCustomerAgencyDTO agencyDTO = indexService.getAgencyInfo(formDTO.getAgencyId());
if (CollectionUtils.isNotEmpty(customerRelation.haveSubCustomer(agencyDTO.getCustomerId()))) {
List<ScreenCustomerAgencyDTO> subAgencies = indexService.getSubAgencyList(formDTO.getAgencyId(), agencyDTO.getAreaCode());
agencyIds = subAgencies.stream().map(ScreenCustomerAgencyDTO::getAgencyId).collect(Collectors.toList());
subAgencyList = subAgencies.stream().map(item -> {
DimAgencyEntity entity = new DimAgencyEntity();
entity.setId(item.getAgencyId());
entity.setAgencyName(item.getAgencyName());
entity.setLevel(item.getLevel());
return entity;
}).collect(Collectors.toList());
subAgencyList = indexService.getSubAgencyList(formDTO.getAgencyId(), agencyDTO.getAreaCode());
agencyIds = subAgencyList.stream().map(ScreenCustomerAgencyDTO::getAgencyId).collect(Collectors.toList());
}
//2.按日期查询所有下级组织的事件治理指数
List<AgencyGovrnResultDTO> list = dataStatsDao.getAgencyGovern(agencyIds, formDTO.getDateId());
//3.封装数据
for (DimAgencyEntity sub : subAgencyList) {
for (ScreenCustomerAgencyDTO sub : subAgencyList) {
AgencyGovrnResultDTO dto = new AgencyGovrnResultDTO();
dto.setAgencyId(sub.getId());
dto.setAgencyId(sub.getAgencyId());
dto.setAgencyName(sub.getAgencyName());
dto.setLevel(sub.getLevel());
for (AgencyGovrnResultDTO re : list) {
if (sub.getId().equals(re.getAgencyId())) {
if (sub.getAgencyId().equals(re.getAgencyId())) {
dto.setProblemResolvedCount(re.getProblemResolvedCount());
dto.setGroupSelfGovernRatio(re.getGroupSelfGovernRatio());
dto.setGridSelfGovernRatio(re.getGridSelfGovernRatio());

16
epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/form/CategoryProjectListFormDTO.java

@ -11,12 +11,13 @@ import java.io.Serializable;
* @DESC
*/
@Data
public class CategoryProjectListFormDTO implements Serializable {
public class CategoryProjectListFormDTO extends ProjectCategoryFormDTO implements Serializable {
private static final long serialVersionUID = -5448734274886241594L;
public interface CategoryProjectListForm{}
@NotNull(message = "pageSize不能为空",groups = CategoryProjectListForm.class)
private Integer pageSize;
@ -26,22 +27,21 @@ public class CategoryProjectListFormDTO implements Serializable {
/**
* 项目状态closed已结案all全部
*/
@NotNull(message = "status不能为空",groups = CategoryProjectListForm.class)
@NotNull(message = "status不能为空",groups = {CategoryProjectListForm.class, CategoryProjectExportForm.class})
private String status;
@NotNull(message = "categoryCode不能为空",groups = CategoryProjectListForm.class)
@NotNull(message = "categoryCode不能为空",groups = {CategoryProjectListForm.class, CategoryProjectExportForm.class})
private String categoryCode;
@NotNull(message = "categoryName不能为空",groups = CategoryProjectExportForm.class)
private String categoryName;
private String parentCategoryName;
/**
* 组织ID
*/
private String orgId;
/**
* 组织类型agency组织grid网格
*/
private String orgType;
/**
* 是否分页默认truefalse的时候 给导出用
*/

3
epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/form/ProjectCategoryFormDTO.java

@ -16,6 +16,7 @@ public class ProjectCategoryFormDTO implements Serializable {
private static final long serialVersionUID = 5047143743629810527L;
public interface ProjectCategoryForm{}
public interface CategoryProjectExportForm {}
/**
* 组织ID
@ -27,7 +28,7 @@ public class ProjectCategoryFormDTO implements Serializable {
*/
private String orgType;
@NotBlank(message = "结束时间不能为空",groups = ProjectCategoryForm.class)
@NotBlank(message = "结束时间不能为空",groups = {ProjectCategoryForm.class,CategoryProjectExportForm.class})
private String endTime;
/**

25
epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/CategoryProjectListResultDTO.java

@ -25,6 +25,11 @@ public class CategoryProjectListResultDTO implements Serializable {
*/
private String projectStatus;
/**
* 项目状态:待处理 pending结案closed
*/
private String projectStatusDesc;
/**
* 项目标题
*/
@ -45,6 +50,21 @@ public class CategoryProjectListResultDTO implements Serializable {
*/
private String projectId;
/**
* 上报人
*/
private String linkName;
/**
* 上报人电话
*/
private String linkMobile;
/**
* 事件地址
*/
private String projectAddress;
@JsonIgnore
private String orgId;
@ -54,8 +74,13 @@ public class CategoryProjectListResultDTO implements Serializable {
public CategoryProjectListResultDTO() {
this.category = "";
this.projectStatus = "";
this.projectStatusDesc = "";
this.projectTitle = "";
this.gridName = "";
this.createTime = "";
}
public String getProjectStatusDesc() {
return "closed".equals(projectStatus)?"已结案":"处理中";
}
}

20
epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectCategoryResultDTO.java

@ -23,11 +23,21 @@ public class ProjectCategoryResultDTO implements Serializable {
*/
private String categoryCode;
/**
* 分类code父级
*/
private String parentCategoryCode;
/**
* 分类名字
*/
private String categoryName;
/**
* 分类名字父级
*/
private String parentCategoryName;
/**
* 项目总数
*/
@ -38,6 +48,11 @@ public class ProjectCategoryResultDTO implements Serializable {
*/
private Integer closedProjectTotal;
/**
* 所有项目总数
*/
private Integer allProjectTotal;
/**
* 总数占比
*/
@ -57,8 +72,9 @@ public class ProjectCategoryResultDTO implements Serializable {
this.categoryName = "";
this.projectTotal = NumConstant.ZERO;
this.closedProjectTotal = NumConstant.ZERO;
this.totalRatio = "";
this.closedRatio = "";
this.totalRatio = "0.00%";
this.closedRatio = "0.00%";
this.children = new ArrayList<>();
this.allProjectTotal = NumConstant.ZERO;
}
}

4
epmet-module/data-report/data-report-server/deploy/docker-compose-prod.yml

@ -9,10 +9,10 @@ services:
volumes:
- "/opt/epmet-cloud-logs/prod:/logs"
environment:
RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./data-report.jar"
RUN_INSTRUCT: "java -Xms256m -Xmx1024m -jar ./data-report.jar"
restart: "unless-stopped"
deploy:
resources:
limits:
cpus: '0.1'
memory: 600M
memory: 1600M

6
epmet-module/data-report/data-report-server/pom.xml

@ -100,6 +100,12 @@
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>easyexcel</artifactId>
<version>3.0.3</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>

96
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java

@ -2,12 +2,17 @@ package com.epmet.datareport.controller.screen;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.entity.TemplateExportParams;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectOrgDailyService;
@ -29,10 +34,12 @@ import com.epmet.project.dto.result.ProjectCategoryResultDTO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.Workbook;
import org.jetbrains.annotations.NotNull;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.HashMap;
@ -195,20 +202,13 @@ public class ScreenProjectController {
* @date 2021/11/4 3:38 下午
*/
@PostMapping("selectprojectcategory/export")
public void selectProjectCategoryExport(@RequestBody ProjectCategoryFormDTO formDTO, /*@LoginUser*/ TokenDto tokenDto, HttpServletResponse response) throws Exception {
tokenDto.setUserId("36bc0fb38565ecdebf8ab9b476b44548");
tokenDto.setCustomerId("45687aa479955f9d06204d415238f7cc");
ValidatorUtils.validateEntity(formDTO, ProjectCategoryFormDTO.ProjectCategoryForm.class);
public void selectProjectCategoryExport(@RequestBody ProjectCategoryFormDTO formDTO, @LoginUser TokenDto tokenDto, HttpServletResponse response) throws Exception {
//tokenDto.setUserId("36bc0fb38565ecdebf8ab9b476b44548");
//tokenDto.setCustomerId("45687aa479955f9d06204d415238f7cc");
ValidatorUtils.validateEntity(formDTO, ProjectCategoryFormDTO.CategoryProjectExportForm.class);
List<ProjectCategoryResultDTO> data = screenProjectService.selectProjectCategory(formDTO, tokenDto);
String templatePath = "excel/project_category_temp.xlsx";
StringBuilder dateBuilder = new StringBuilder();
if (StringUtils.isNotBlank(formDTO.getStartTime())){
dateBuilder.append(formDTO.getStartTime()).append(StrConstant.HYPHEN);
}
if (StringUtils.isNotBlank(formDTO.getEndTime())){
dateBuilder.append(formDTO.getEndTime());
}
List<ProjectCategoryResultDTO> resultDTOList = new ArrayList<>();
data.forEach(e->{
resultDTOList.add(e);
@ -219,7 +219,7 @@ public class ScreenProjectController {
Map<String,Object> mapData = new HashMap<>();
mapData.put("list",resultDTOList);
mapData.put("orgName",staffInfo.getAgencyName());
mapData.put("exportDate",dateBuilder.toString());
mapData.put("exportDate",getExportDateStr(formDTO.getStartTime(),formDTO.getEndTime()));
Workbook workbook = ExcelExportUtil.exportExcel(new TemplateExportParams(templatePath), mapData);
response.setHeader("content-Type", "application/vnd.ms-excel");
response.addHeader("Content-Disposition", "attachment;fileName=" + URLEncoder.encode("项目分类统计.xls", "UTF-8"));
@ -239,4 +239,76 @@ public class ScreenProjectController {
return new Result<PageCategoryProjectListResultDTO>().ok(screenProjectService.selectCategoryProjectList(formDTO,tokenDto));
}
/**
* @Description 项目分类查询项目分类
* @param formDTO
* @param tokenDto
* @author zxc
* @date 2021/11/4 3:38 下午
*/
@PostMapping("selectcategoryprojectlist/export")
public void selectProjectCategoryExport(@RequestBody CategoryProjectListFormDTO formDTO, @LoginUser TokenDto tokenDto, HttpServletResponse response) throws Exception {
ExcelWriter excelWriter = null;
try {
//tokenDto.setUserId("36bc0fb38565ecdebf8ab9b476b44548");
//tokenDto.setCustomerId("45687aa479955f9d06204d415238f7cc");
formDTO.setPageNo(NumConstant.ONE);
formDTO.setPageSize(NumConstant.ONE_THOUSAND);
formDTO.setIsPage(false);
ValidatorUtils.validateEntity(formDTO, ProjectCategoryFormDTO.CategoryProjectExportForm.class);
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId());
Map<String, Object> mapData = new HashMap<>();
mapData.put("orgName", staffInfo == null ? StrConstant.EPMETY_STR : staffInfo.getAgencyName());
mapData.put("exportDate", getExportDateStr(formDTO.getStartTime(), formDTO.getEndTime()));
mapData.put("categoryName", formDTO.getCategoryName());
if (StringUtils.isNotBlank(formDTO.getParentCategoryName())) {
mapData.put("categoryName", formDTO.getParentCategoryName().concat(StrConstant.HYPHEN).concat(formDTO.getCategoryName()));
}
String templatePath = "excel/project_temp_easy_excel.xlsx";
InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream(templatePath);
//String template = this.getClass().getResource(templatePath).getPath();
String fileName = "项目统计.xlsx";
excelWriter = EasyExcel.write(ExcelUtils.getOutputStream(fileName, response)).withTemplate(inputStream).build();
WriteSheet writeSheet = EasyExcel.writerSheet().build();
excelWriter.fill(mapData, writeSheet);
PageCategoryProjectListResultDTO data = null;
do {
data = screenProjectService.selectCategoryProjectList(formDTO, tokenDto);
if (data.getList().isEmpty()) {
break;
}
formDTO.setPageNo(formDTO.getPageNo() + 1);
excelWriter.fill(data.getList(), writeSheet);
} while (data.getList().size() == formDTO.getPageSize());
// String templatePath = "excel/project_temp.xlsx";
// Workbook workbook = ExcelExportUtil.exportExcel(new TemplateExportParams(templatePath), mapData);
// response.setHeader("content-Type", "application/vnd.ms-excel");
// response.addHeader("Content-Disposition", "attachment;fileName=" + URLEncoder.encode("项目统计.xls", "UTF-8"));
// workbook.write(response.getOutputStream());
} finally {
if (excelWriter != null) {
excelWriter.finish();
}
}
}
@NotNull
private String getExportDateStr(String startTime,String endTime) {
StringBuilder dateBuilder = new StringBuilder();
if (StringUtils.isNotBlank(startTime)) {
dateBuilder.append(startTime).append(StrConstant.HYPHEN);
}
if (StringUtils.isNotBlank(endTime)) {
dateBuilder.append(endTime);
}
return dateBuilder.toString();
}
}

27
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java

@ -172,7 +172,7 @@ public class ScreenProjectServiceImpl implements ScreenProjectService {
List<CategoryAnalysisResultDTO> resultList = new ArrayList<>();
if (!CollectionUtils.isEmpty(resultDTOList)) {
for (CategoryAnalysisResultDTO dto : resultDTOList) {
CustomerProjectCategoryDTO projectCategoryDTO = screenProjectCategoryOrgDailyDao.selectProjectCategory(dto.getCategoryCode(), dto.getCategoryOriginCustomerId());
CustomerProjectCategoryDTO projectCategoryDTO = screenProjectCategoryOrgDailyDao.selectProjectCategory(dto.getCategoryCode(), customerId);
if (null == projectCategoryDTO || StringUtils.isBlank(projectCategoryDTO.getCategoryName())) {
log.warn(String.format("查询分类名称失败,当前客户:%s, categoryCode:%s", dto.getCategoryCode(), customerId));
continue;
@ -232,7 +232,7 @@ public class ScreenProjectServiceImpl implements ScreenProjectService {
return new ArrayList<>();
}
for (CategoryTopAppealResultDTO r : result) {
CustomerProjectCategoryDTO projectCategoryDTO = screenProjectCategoryOrgDailyDao.selectProjectCategory(r.getCategoryId(), r.getCategoryOriginCustomerId());
CustomerProjectCategoryDTO projectCategoryDTO = screenProjectCategoryOrgDailyDao.selectProjectCategory(r.getCategoryId(), customerId);
if (null == projectCategoryDTO || StringUtils.isBlank(projectCategoryDTO.getCategoryName())) {
log.warn(String.format("查询分类名称失败,当前客户:%s, categoryCode:%s", r.getCategoryId(), r.getCategoryOriginCustomerId()));
continue;
@ -284,6 +284,7 @@ public class ScreenProjectServiceImpl implements ScreenProjectService {
endCategoryList.forEach(e -> {
e.setTotalRatio(ratio(e.getProjectTotal(), finalTotal));
e.setClosedRatio(ratio(e.getClosedProjectTotal(),e.getProjectTotal()));
e.setAllProjectTotal(finalTotal);
});
}else {
Integer endTotal = screenProjectOrgDailyDao.selectProjectTotalByAgency(customerId, endTime, orgId);
@ -302,15 +303,21 @@ public class ScreenProjectServiceImpl implements ScreenProjectService {
endCategoryList.forEach(e -> {
e.setTotalRatio(ratio(e.getProjectTotal(), finalTotal));
e.setClosedRatio(ratio(e.getClosedProjectTotal(),e.getProjectTotal()));
e.setAllProjectTotal(finalTotal);
});
}
List<ProjectCategoryResultDTO> finalEndCategoryList = endCategoryList;
result.forEach(r -> {
finalEndCategoryList.stream().filter(e -> r.getCategoryCode().equals(e.getCategoryCode())).forEach(e -> {
r.setTotalRatio(e.getTotalRatio());r.setClosedRatio(e.getClosedRatio());
r.setProjectTotal(e.getProjectTotal());
r.setClosedProjectTotal(e.getClosedProjectTotal());
r.setAllProjectTotal(e.getAllProjectTotal());
});
r.getChildren().forEach(son -> finalEndCategoryList.stream().filter(e -> son.getCategoryCode().equals(e.getCategoryCode())).forEach(e -> {
son.setTotalRatio(e.getTotalRatio());son.setClosedRatio(e.getClosedRatio());
son.setProjectTotal(e.getProjectTotal());son.setClosedProjectTotal(e.getClosedProjectTotal());
son.setAllProjectTotal(e.getAllProjectTotal());
}));
});
// 排序
@ -343,10 +350,10 @@ public class ScreenProjectServiceImpl implements ScreenProjectService {
if (denominator == NumConstant.ZERO){
return "0.00%";
}
BigDecimal bigDecimalMolecule = new BigDecimal(molecule);
BigDecimal bigDecimalMolecule = new BigDecimal(molecule * NumConstant.ONE_HUNDRED);
BigDecimal bigDecimalDenominator = new BigDecimal(denominator);
BigDecimal divide = bigDecimalMolecule.divide(bigDecimalDenominator, NumConstant.TWO, BigDecimal.ROUND_HALF_UP);
return divide.multiply(NumConstant.ONE_HUNDRED_DECIMAL)+"%";
return divide+"%";
}
/**
@ -368,13 +375,11 @@ public class ScreenProjectServiceImpl implements ScreenProjectService {
}
PageCategoryProjectListResultDTO result = new PageCategoryProjectListResultDTO();
List<CategoryProjectListResultDTO> list;
if (formDTO.getIsPage()){
PageInfo<CategoryProjectListResultDTO> objectPageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> screenProjectDataDao.selectCategoryProjectList(tokenDto.getCustomerId(), formDTO.getOrgId(), formDTO.getCategoryCode(), formDTO.getStatus()));
list = objectPageInfo.getList();
result.setTotal(Integer.valueOf(String.valueOf(objectPageInfo.getTotal())));
}else {
list = screenProjectDataDao.selectCategoryProjectList(tokenDto.getCustomerId(), formDTO.getOrgId(), formDTO.getCategoryCode(), formDTO.getStatus());
}
PageInfo<CategoryProjectListResultDTO> objectPageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage())
.doSelectPageInfo(() -> screenProjectDataDao.selectCategoryProjectList(tokenDto.getCustomerId(), formDTO.getOrgId(), formDTO.getCategoryCode(), formDTO.getStatus()));
list = objectPageInfo.getList();
result.setTotal(Integer.valueOf(String.valueOf(objectPageInfo.getTotal())));
if (!CollectionUtils.isEmpty(list)){
list.forEach(l -> {
if (l.getOrgType().equals(FactConstant.AGENCY)){

BIN
epmet-module/data-report/data-report-server/src/main/resources/excel/project_category_temp.xlsx

Binary file not shown.

BIN
epmet-module/data-report/data-report-server/src/main/resources/excel/project_temp.xlsx

Binary file not shown.

BIN
epmet-module/data-report/data-report-server/src/main/resources/excel/project_temp_easy_excel.xlsx

Binary file not shown.

3
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml

@ -388,6 +388,9 @@
ROUND((ROUND(sy.govern_ablity,1) * sy.GOVERN_ABLITY_WEIGHT),1) AS governAbility,
ROUND((ROUND(sy.party_dev_ablity,1) * sy.PARTY_DEV_WEIGHT),1) AS partyDevAbility,
ROUND((ROUND(sy.service_ablity,1) * sy.SERVICE_ABLITY_WEIGHT),1) AS serviceAbility,
ROUND(sy.govern_ablity,1) AS originGovernAbility,
ROUND(sy.party_dev_ablity,1) AS originPartyDevAbility,
ROUND(sy.service_ablity,1) AS originServiceAbility,
sy.ORG_ID as orgId,
scg.area_code as areaCode
FROM screen_customer_grid scg

7
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectCategoryOrgDailyDao.xml

@ -94,9 +94,12 @@
<resultMap id="selectCategoryByCustomerIdMap" type="com.epmet.project.dto.result.ProjectCategoryResultDTO">
<result column="c" property="categoryCode"/>
<result column="n" property="categoryName"/>
<result column="pc1" property="parentCategoryCode"/>
<collection property="children" ofType="com.epmet.project.dto.result.ProjectCategoryResultDTO">
<result column="c2" property="categoryCode"/>
<result column="n2" property="categoryName"/>
<result column="pc2" property="parentCategoryCode"/>
<result column="n" property="parentCategoryName"/>
</collection>
</resultMap>
<select id="selectCategoryByCustomerId" resultMap="selectCategoryByCustomerIdMap">
@ -104,7 +107,9 @@
p1.CATEGORY_CODE AS c,
p2.CATEGORY_CODE AS c2,
p1.CATEGORY_NAME AS n,
p2.CATEGORY_NAME AS n2
p2.CATEGORY_NAME AS n2,
p1.PARENT_CATEGORY_CODE AS pc1,
p2.PARENT_CATEGORY_CODE AS pc2
FROM customer_project_category_dict p1,customer_project_category_dict p2
WHERE p1.DEL_FLAG = '0'
AND p2.DEL_FLAG = '0'

11
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml

@ -135,7 +135,7 @@
AND pd.ORG_TYPE = 'agency'
AND pd.PROJECT_LEVEL != 0
AND sca.AREA_CODE LIKE CONCAT(#{areaCode},'%')
AND UNIX_TIMESTAMP(pd.CREATED_TIME) >= UNIX_TIMESTAMP(DATE_SUB(NOW(),INTERVAL #{monthCount} MONTH))
AND UNIX_TIMESTAMP(pd.PROJECT_CREATE_TIME) >= UNIX_TIMESTAMP(DATE_SUB(NOW(),INTERVAL #{monthCount} MONTH))
)
UNION ALL
(SELECT pd.PROJECT_LEVEL
@ -145,7 +145,7 @@
AND pd.ORG_TYPE = 'grid'
AND pd.PROJECT_LEVEL != 0
AND scg.AREA_CODE LIKE CONCAT(#{areaCode},'%')
AND UNIX_TIMESTAMP(pd.CREATED_TIME) >= UNIX_TIMESTAMP(DATE_SUB(NOW(),INTERVAL #{monthCount} MONTH))
AND UNIX_TIMESTAMP(pd.PROJECT_CREATE_TIME) >= UNIX_TIMESTAMP(DATE_SUB(NOW(),INTERVAL #{monthCount} MONTH))
)
UNION ALL
(SELECT pd.PROJECT_LEVEL
@ -155,7 +155,7 @@
AND pd.ORG_TYPE = 'department'
AND pd.PROJECT_LEVEL != 0
AND scd.AREA_CODE LIKE CONCAT(#{areaCode},'%')
AND UNIX_TIMESTAMP(pd.CREATED_TIME) >= UNIX_TIMESTAMP(DATE_SUB(NOW(),INTERVAL #{monthCount} MONTH))
AND UNIX_TIMESTAMP(pd.PROJECT_CREATE_TIME) >= UNIX_TIMESTAMP(DATE_SUB(NOW(),INTERVAL #{monthCount} MONTH))
)
</select>
@ -168,7 +168,10 @@
DATE_FORMAT(PROJECT_CREATE_TIME,'%Y-%m-%d %h:%i:%s') AS createTime,
ORG_ID,
ORG_TYPE,
PROJECT_ID
PROJECT_ID,
LINK_NAME,
LINK_MOBILE,
PROJECT_ADDRESS
FROM screen_project_data
WHERE DEL_FLAG = '0'
<if test=' status == "closed" '>

24
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java

@ -62,7 +62,6 @@ import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Date;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
@ -760,6 +759,7 @@ public class DemoController {
orgRankExtractService.extractGridData(formDTO.getCustomerId(), formDTO.getDateId());
orgRankExtractService.extractCommunityData(formDTO.getCustomerId(), formDTO.getDateId());
orgRankExtractService.extractStreetData(formDTO.getCustomerId(), formDTO.getDateId());
orgRankExtractService.extractDistrictData(formDTO.getCustomerId(), formDTO.getDateId());
return new Result();
}
@ -943,9 +943,25 @@ public class DemoController {
@Autowired
private ScreenProjectCategoryOrgDailyService screenProjectCategoryOrgDailyService;
@PostMapping("orgdaily")
public Result orgDaily(@RequestParam("customerId")String customerId,@RequestParam("dateId")String dateId){
screenProjectCategoryOrgDailyService.extractProjectCategoryOrgData(customerId,dateId);
@PostMapping("gridandorgdaily")
public Result orgDaily(@RequestParam("customerId")String customerId,@RequestParam("dateId")String dateId,
@RequestParam(name = "startDate",required = false)String startDate,
@RequestParam(name = "endDate",required = false)String endDate
){
long start = System.currentTimeMillis();
if (StringUtils.isNotBlank(startDate) && StringUtils.isNotBlank(endDate)){
List<String> daysBetween = DateUtils.getDaysBetween(startDate, endDate);
daysBetween.forEach(d -> {
projectCategoryGridDailyService.extractProjectCategoryData(customerId,d);
screenProjectCategoryOrgDailyService.extractProjectCategoryOrgData(customerId,d);
});
}else {
projectCategoryGridDailyService.extractProjectCategoryData(customerId,dateId);
screenProjectCategoryOrgDailyService.extractProjectCategoryOrgData(customerId,dateId);
}
long end = System.currentTimeMillis();
long l = (end - start) / 1000;
log.info("gridAndOrgDaily耗时" + l+ "s");
return new Result();
}

1
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectLogDailyDao.java

@ -288,6 +288,7 @@ public interface FactOriginProjectLogDailyDao extends BaseDao<FactOriginProjectL
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> selectGridClosed(@Param("customerId") String customerId, @Param("monthId") String monthId);
List<OrgStatisticsResultDTO> selectAgencyClosed(@Param("customerId") String customerId, @Param("monthId") String monthId);
/**
* 网格自治率统计--按天

3
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectLogDailyService.java

@ -21,7 +21,6 @@ import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.extract.FactOriginProjectLogDailyDTO;
import com.epmet.dto.extract.result.*;
import com.epmet.dto.screen.ScreenProjectDataDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectLogDailyEntity;
import java.math.BigDecimal;
@ -310,7 +309,7 @@ public interface FactOriginProjectLogDailyService extends BaseService<FactOrigin
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> getGridClosed(String customerId, String monthId);
List<OrgStatisticsResultDTO> getAgencyClosed(String customerId, String monthId);
/**
* 网格自制率统计-按天
* @author zhaoqifeng

5
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java

@ -401,6 +401,11 @@ public class FactOriginProjectLogDailyServiceImpl extends BaseServiceImpl<FactOr
return baseDao.selectGridClosed(customerId, monthId);
}
@Override
public List<OrgStatisticsResultDTO> getAgencyClosed(String customerId, String monthId) {
return baseDao.selectAgencyClosed(customerId, monthId);
}
/**
* 网格自制率统计-按天
*

46
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/OrgRankExtractServiceImpl.java

@ -6,8 +6,6 @@ import com.epmet.constant.OrgTypeConstant;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.dto.stats.user.FactRegUserAgencyMonthlyDTO;
import com.epmet.dto.stats.user.FactRegUserGridMonthlyDTO;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyEntity;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyEntity;
import com.epmet.entity.evaluationindex.screen.ScreenOrgRankDataEntity;
import com.epmet.service.evaluationindex.extract.todata.*;
import com.epmet.service.evaluationindex.extract.toscreen.OrgRankExtractService;
@ -17,9 +15,9 @@ import com.epmet.service.evaluationindex.screen.ScreenOrgRankDataService;
import com.epmet.service.stats.user.FactRegUserAgencyMonthlyService;
import com.epmet.service.stats.user.FactRegUserGridMonthlyService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.apache.commons.collections4.CollectionUtils;
import java.math.BigDecimal;
import java.math.RoundingMode;
@ -184,11 +182,15 @@ public class OrgRankExtractServiceImpl implements OrgRankExtractService {
));
}
//结案率 结案数/项目数
List<FactIndexGovrnAblityOrgMonthlyEntity> abilityList = factIndexGovrnAblityOrgMonthlyService.getOrgByCustomer(customerId, monthId, OrgTypeConstant.COMMUNITY);
if (CollectionUtils.isNotEmpty(abilityList)) {
list.forEach(entity -> abilityList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto ->
entity.setCloseProjectRatio(dto.getClosedProjectRatio())
));
List<OrgStatisticsResultDTO> closed = factOriginProjectLogDailyService.getAgencyClosed(customerId, monthId);
if (CollectionUtils.isNotEmpty(closed)) {
list.forEach(entity -> closed.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto -> {
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setCloseProjectRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}
}));
}
//满意率 满意和非常满意占比
List<OrgStatisticsResultDTO> satisfactionList = factOriginProjectLogDailyService.getOrgSatisfaction(customerId, monthId, OrgTypeConstant.COMMUNITY);
@ -252,11 +254,15 @@ public class OrgRankExtractServiceImpl implements OrgRankExtractService {
));
}
//结案率 结案数/项目数
List<FactIndexGovrnAblityOrgMonthlyEntity> abilityList = factIndexGovrnAblityOrgMonthlyService.getOrgByCustomer(customerId, monthId, OrgTypeConstant.STREET);
if (CollectionUtils.isNotEmpty(abilityList)) {
list.forEach(entity -> abilityList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto ->
entity.setCloseProjectRatio(dto.getClosedProjectRatio())
));
List<OrgStatisticsResultDTO> closed = factOriginProjectLogDailyService.getAgencyClosed(customerId, monthId);
if (CollectionUtils.isNotEmpty(closed)) {
list.forEach(entity -> closed.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto -> {
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setCloseProjectRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}
}));
}
//满意率 满意和非常满意占比
List<OrgStatisticsResultDTO> satisfactionList = factOriginProjectLogDailyService.getOrgSatisfaction(customerId, monthId, OrgTypeConstant.STREET);
@ -320,11 +326,15 @@ public class OrgRankExtractServiceImpl implements OrgRankExtractService {
));
}
//结案率 结案数/项目数
List<FactIndexGovrnAblityOrgMonthlyEntity> abilityList = factIndexGovrnAblityOrgMonthlyService.getOrgByCustomer(customerId, monthId, OrgTypeConstant.DISTRICT);
if (CollectionUtils.isNotEmpty(abilityList)) {
list.forEach(entity -> abilityList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto ->
entity.setCloseProjectRatio(dto.getClosedProjectRatio())
));
List<OrgStatisticsResultDTO> closed = factOriginProjectLogDailyService.getAgencyClosed(customerId, monthId);
if (CollectionUtils.isNotEmpty(closed)) {
list.forEach(entity -> closed.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto -> {
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setCloseProjectRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}
}));
}
//满意率 满意和非常满意占比
List<OrgStatisticsResultDTO> satisfactionList = factOriginProjectLogDailyService.getOrgSatisfaction(customerId, monthId, OrgTypeConstant.STREET);

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

@ -195,7 +195,7 @@ public class ScreenProjectOrgDailyServiceImpl extends BaseServiceImpl<ScreenProj
agencyInfos.forEach(a -> {
a.setDateId(dateId);
projectOrgDaily.forEach(p -> {
if (a.getAreaCode().equals(p.getAreaCode())){
if (a.getOrgId().equals(p.getOrgId())){
a.setBadTotal(p.getBadTotal() + a.getBadTotal());
a.setEvaluateTotal(p.getEvaluateTotal() + a.getEvaluateTotal());
a.setGoodTotal(p.getGoodTotal() + a.getGoodTotal());

76
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml

@ -488,30 +488,62 @@
</select>
<select id="selectGridClosed" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT
a.ORG_ID,
a.GRID_ID AS "orgId",
a.count AS "sum",
IFNULL(b.count,0)AS "count"
IFNULL( b.count, 0 ) AS "count"
FROM
(SELECT ORG_ID,
COUNT(DISTINCT PROJECT_ID) AS "count"
FROM fact_origin_project_log_daily
WHERE( ACTION_CODE = 'created' OR ACTION_CODE = 'transfer')
AND IS_ACTIVE = 0
AND ORG_TYPE = 'grid'
AND CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
GROUP BY ORG_ID) a
LEFT JOIN
(SELECT fl.ORG_ID,
COUNT(DISTINCT fl.PROJECT_ID) AS "count"
FROM fact_origin_project_log_daily fl
INNER JOIN fact_origin_project_main_daily fm ON fl.PROJECT_ID = fm.ID AND fm.PROJECT_STATUS = 'closed'
WHERE( fl.ACTION_CODE = 'created' OR fl.ACTION_CODE = 'transfer')
AND fl.IS_ACTIVE = 0
AND fl.ORG_TYPE = 'grid'
AND fl.CUSTOMER_ID = #{customerId}
AND fl.MONTH_ID = #{monthId}
GROUP BY fl.ORG_ID) b ON a.ORG_ID = b.ORG_ID
( SELECT
GRID_ID,
COUNT( ID ) AS "count"
FROM
fact_origin_project_main_daily
WHERE
CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
AND GRID_ID != ''
GROUP BY GRID_ID ) a
LEFT JOIN
( SELECT
GRID_ID,
COUNT( ID ) AS "count"
FROM fact_origin_project_main_daily
WHERE
PROJECT_STATUS = 'closed'
AND CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
AND GRID_ID != ''
GROUP BY GRID_ID ) b
ON a.GRID_ID = b.GRID_ID
</select>
<select id="selectAgencyClosed" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT
a.AGENCY_ID AS "orgId",
a.count AS "sum",
IFNULL( b.count, 0 ) AS "count"
FROM
( SELECT
AGENCY_ID,
COUNT( ID ) AS "count"
FROM
fact_origin_project_main_daily
WHERE
CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
AND AGENCY_ID != ''
GROUP BY AGENCY_ID ) a
LEFT JOIN
( SELECT
AGENCY_ID,
COUNT( ID ) AS "count"
FROM fact_origin_project_main_daily
WHERE
PROJECT_STATUS = 'closed'
AND CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
AND AGENCY_ID != ''
GROUP BY AGENCY_ID ) b
ON a.AGENCY_ID = b.AGENCY_ID
</select>
<select id="selectNotReturn" resultType="com.epmet.dto.extract.result.TransferRightRatioResultDTO">

2
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.xml

@ -208,7 +208,7 @@
AND (cd.EPMET_CATEGORY_CODE IS NULL OR cd.EPMET_CATEGORY_CODE = '')
</if>
AND cd.EPMET_CATEGORY_CODE != ''
AND pd.PROJECT_STATUS_CODE = 'closed'
AND pd.PROJECT_STATUS_CODE IN ('closed','closed_case')
AND pd.ALL_PARENT_IDS LIKE CONCAT('%',(SELECT AGENCY_ID FROM screen_customer_agency WHERE DEL_FLAG = 0 AND CUSTOMER_ID = #{customerId} AND PID = '0'),'%')
AND DATE_FORMAT(pd.project_create_time,'%Y%m%d') <![CDATA[ <= ]]> #{dateId}
GROUP BY categoryCode

4
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/IcResiCategoryWarnConfigDTO.java

@ -57,6 +57,10 @@ public class IcResiCategoryWarnConfigDTO implements Serializable {
* 列名
*/
private String columnName;
/**
* 是否预警 1 0
*/
private String warn;
/**
* 排序

2
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java

@ -106,7 +106,7 @@ public interface OperCustomizeOpenFeignClient {
Result<List<IcResiCategoryStatsConfigDTO>> resiCategoryStatsListShowd(@RequestBody IcResiCategoryStatsConfigFormDTO formDTO);
@PostMapping("/oper/customize/resicategorystatsconfig/resicategorywarnlist")
Result<List<IcResiCategoryWarnConfigDTO>> resiCategoryWarnList();
Result<List<IcResiCategoryWarnConfigDTO>> resiCategoryWarnList(@RequestParam String customerId);
@PostMapping("/oper/customize/resicategorystatsconfig/resicategorywarninfobyid")
Result<IcResiCategoryWarnConfigDTO> resiCategoryWarnInfoById(@RequestBody IcResiCategoryWarnConfigDTO dto);

4
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java

@ -90,8 +90,8 @@ public class OperCustomizeOpenFeignClientFallback implements OperCustomizeOpenFe
}
@Override
public Result<List<IcResiCategoryWarnConfigDTO>> resiCategoryWarnList() {
return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "resiCategoryWarnList");
public Result<List<IcResiCategoryWarnConfigDTO>> resiCategoryWarnList(String customerId) {
return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "resiCategoryWarnList",customerId);
}
@Override

12
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/ResiCategoryStatsConfigController.java

@ -41,10 +41,7 @@ import com.epmet.service.IcResiCategoryStatsConfigService;
import com.epmet.service.ResiCategoryStatsConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
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 javax.annotation.Resource;
import java.util.List;
@ -127,7 +124,7 @@ public class ResiCategoryStatsConfigController {
@PostMapping("info")
public Result<IcResiCategoryStatsConfigResultDTO> info(@LoginUser TokenDto tokenDTO,@RequestBody IcResiCategoryStatsConfigFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, IcResiCategoryStatsConfigFormDTO.SelectGroup.class);
return new Result<IcResiCategoryStatsConfigResultDTO>().ok(resiCategoryStatsConfigService.info(formDTO.getId()));
return new Result<IcResiCategoryStatsConfigResultDTO>().ok(resiCategoryStatsConfigService.info(formDTO.getId(),tokenDTO.getCustomerId()));
}
@PostMapping("resicategorystatslistshowd")
@ -148,11 +145,12 @@ public class ResiCategoryStatsConfigController {
}
@PostMapping("resicategorywarnlist")
public Result<List<IcResiCategoryWarnConfigDTO>> resiCategoryWarnList(@LoginUser TokenDto tokenDTO){
public Result<List<IcResiCategoryWarnConfigDTO>> resiCategoryWarnList(@RequestParam String customerId){
//获取预警配置列表
List<IcResiCategoryWarnConfigEntity> warnConfigEntityList = icResiCategoryWarnConfigDao.selectList(new QueryWrapper<IcResiCategoryWarnConfigEntity>()
.lambda()
.eq(IcResiCategoryWarnConfigEntity::getCustomerId,tokenDTO.getCustomerId())
.eq(IcResiCategoryWarnConfigEntity::getCustomerId,customerId)
.eq(IcResiCategoryWarnConfigEntity::getWarn,"1")
.orderByAsc(IcResiCategoryWarnConfigEntity::getSort));
return new Result<List<IcResiCategoryWarnConfigDTO>>().ok(ConvertUtils.sourceToTarget(warnConfigEntityList, IcResiCategoryWarnConfigDTO.class));

15
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcResiCategoryStatsConfigDao.java

@ -18,8 +18,12 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.result.IcResiCategoryStatsConfigResultDTO;
import com.epmet.entity.IcResiCategoryStatsConfigEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 居民类别配置表
@ -29,5 +33,14 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface IcResiCategoryStatsConfigDao extends BaseDao<IcResiCategoryStatsConfigEntity> {
/**
* 获取配置信息
* @param customerId
* @param isWarn
* @param level
*/
List<IcResiCategoryStatsConfigResultDTO> listInfo(@Param("customerId") String customerId, @Param("isWarn") Integer isWarn, @Param("level") Integer level);
IcResiCategoryStatsConfigResultDTO info(@Param("id") String id,@Param("customerId") String customerId);
}

4
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcResiCategoryWarnConfigEntity.java

@ -58,6 +58,10 @@ public class IcResiCategoryWarnConfigEntity extends BaseEpmetEntity {
* 列名
*/
private String columnName;
/**
* 是否预警 1 0
*/
private String warn;
/**
* 排序

2
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/ResiCategoryStatsConfigService.java

@ -39,7 +39,7 @@ public interface ResiCategoryStatsConfigService {
List<IcResiCategoryStatsConfigResultDTO> list(String customerId, ResiCategoryStatsConfigListFormDTO formDTO);
IcResiCategoryStatsConfigResultDTO info(String id);
IcResiCategoryStatsConfigResultDTO info(String id,String customerId);
void update(String customerId,IcResiCategoryStatsConfigFormDTO formDTO);

165
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/ResiCategoryStatsConfigServiceImpl.java

@ -1,6 +1,8 @@
package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.constant.IcResiCategoryStatsConfigConstant;
import com.epmet.dao.IcFormItemDao;
import com.epmet.dao.IcFormItemGroupDao;
@ -54,16 +56,18 @@ public class ResiCategoryStatsConfigServiceImpl implements ResiCategoryStatsConf
if(CollectionUtils.isEmpty(icFormItemEntityList)){
return new ArrayList<>();
}
Set<String> groupIds = icFormItemEntityList.stream().filter(item-> !"0".equals(item.getItemGroupId())).map(item->item.getItemGroupId()).collect(Collectors.toSet());
Set<String> groupIds = icFormItemEntityList.stream().filter(item-> !"0".equals(item.getItemGroupId())).map(IcFormItemEntity::getItemGroupId).collect(Collectors.toSet());
List<IcFormItemGroupEntity> icFormItemGroupEntityList = new ArrayList<>();
if(!CollectionUtils.isEmpty(groupIds)){
icFormItemGroupEntityList.addAll(icFormItemGroupDao.selectList(new QueryWrapper<IcFormItemGroupEntity>().lambda().eq(IcFormItemGroupEntity::getCustomerId,customerId).in(IcFormItemGroupEntity::getId, groupIds)));
}
//获取tableName和COLUMN_NAME
Map<String,IcFormItemEntity> tableColumnMap = new HashMap<>();
Map<String,String> idTableMap = new HashMap<>();
icFormItemEntityList.forEach(item->{
Map<String,String> map = new HashMap<>();
item.setColumnName(item.getColumnName().concat(NumConstant.ZERO == item.getColumnNum() ? StrConstant.EPMETY_STR : item.getColumnNum().toString()));
if("0".equals(item.getItemGroupId())){
tableColumnMap.put(IcResiCategoryStatsConfigConstant.IC_RESI_USER+"-"+item.getColumnName(),item);
idTableMap.put(item.getId(),IcResiCategoryStatsConfigConstant.IC_RESI_USER);
@ -81,16 +85,16 @@ public class ResiCategoryStatsConfigServiceImpl implements ResiCategoryStatsConf
//3.新增不存在的,删除不在tableColumnMap的
Map<String,IcResiCategoryStatsConfigEntity> statsTableColumnMap = new HashMap<>();
statsConfigEntityList.stream().forEach(item->{
statsConfigEntityList.forEach(item->{
statsTableColumnMap.put(item.getTableName()+"-"+item.getColumnName(),item);
});
Map<String,IcResiCategoryWarnConfigEntity> warnTableColumnMap = new HashMap<>();
warnConfigEntityList.stream().forEach(item->{
warnConfigEntityList.forEach(item->{
warnTableColumnMap.put(item.getTableName()+"-"+item.getColumnName(),item);
});
//差集
//新增
List<String> newStatsList = tableColumnMap.keySet().stream().filter(item -> !statsTableColumnMap.keySet().contains(item)).collect(Collectors.toList());
List<String> newStatsList = tableColumnMap.keySet().stream().filter(item -> !statsTableColumnMap.containsKey(item)).collect(Collectors.toList());
List<IcResiCategoryStatsConfigEntity> newStatsEntityList = new ArrayList<>();
newStatsList.forEach(item->{
@ -110,12 +114,27 @@ public class ResiCategoryStatsConfigServiceImpl implements ResiCategoryStatsConf
if(!CollectionUtils.isEmpty(newStatsEntityList)){
icResiCategoryStatsConfigService.insertBatch(newStatsEntityList);
}
List<String> newWarnList = tableColumnMap.keySet().stream().filter(item -> !warnTableColumnMap.containsKey(item)).collect(Collectors.toList());
List<IcResiCategoryWarnConfigEntity> newWarnEntityList = new ArrayList<>();
newWarnList.forEach(item->{
IcFormItemEntity icFormItemEntity = tableColumnMap.get(item);
IcResiCategoryWarnConfigEntity entity = new IcResiCategoryWarnConfigEntity();
entity.setCustomerId(customerId);
entity.setLabel(icFormItemEntity.getLabel());
entity.setTableName(idTableMap.get(icFormItemEntity.getId()));
entity.setColumnName(icFormItemEntity.getColumnName());
entity.setWarn("0");
entity.setSort(icFormItemEntity.getSort());
newWarnEntityList.add(entity);
});
if(!CollectionUtils.isEmpty(newWarnEntityList)){
icResiCategoryWarnConfigService.insertBatch(newWarnEntityList);
}
List<String> delStatsEntityIdList = new ArrayList<>();
List<String> delWarnEntityIdList = new ArrayList<>();
//需要删除的
List<String> delStatsList = statsTableColumnMap.keySet().stream().filter(item -> !tableColumnMap.keySet().contains(item)).collect(Collectors.toList());
List<String> delWarnList = warnTableColumnMap.keySet().stream().filter(item -> !tableColumnMap.keySet().contains(item)).collect(Collectors.toList());
List<String> delStatsList = statsTableColumnMap.keySet().stream().filter(item -> !tableColumnMap.containsKey(item)).collect(Collectors.toList());
List<String> delWarnList = warnTableColumnMap.keySet().stream().filter(item -> !tableColumnMap.containsKey(item)).collect(Collectors.toList());
delStatsList.forEach(item->{
delStatsEntityIdList.add(statsTableColumnMap.get(item).getId());
});
@ -130,90 +149,12 @@ public class ResiCategoryStatsConfigServiceImpl implements ResiCategoryStatsConf
}
//4.返回数据
List<IcResiCategoryStatsConfigEntity> statsConfigList = icResiCategoryStatsConfigDao.selectList(new QueryWrapper<IcResiCategoryStatsConfigEntity>().lambda()
.eq(IcResiCategoryStatsConfigEntity::getCustomerId,customerId)
.orderByAsc(IcResiCategoryStatsConfigEntity::getSort));
List<IcResiCategoryWarnConfigEntity> warnConfigList = icResiCategoryWarnConfigDao.selectList(new QueryWrapper<IcResiCategoryWarnConfigEntity>().lambda()
.eq(IcResiCategoryWarnConfigEntity::getCustomerId,customerId));
Map<String,IcResiCategoryWarnConfigEntity> warnMap =new HashMap<>();
warnConfigList.forEach(item->{
warnMap.put(item.getTableName()+"-"+item.getColumnName(),item);
});
List<IcResiCategoryStatsConfigResultDTO> result = new ArrayList<>();
statsConfigList.forEach(item->{
IcResiCategoryStatsConfigResultDTO icResiCategoryStatsConfigResultDTO = new IcResiCategoryStatsConfigResultDTO();
icResiCategoryStatsConfigResultDTO.setId(item.getId());
icResiCategoryStatsConfigResultDTO.setLabel(item.getLabel());
icResiCategoryStatsConfigResultDTO.setManagementIcon(item.getManagementIcon());
icResiCategoryStatsConfigResultDTO.setDataIcon(item.getDataIcon());
icResiCategoryStatsConfigResultDTO.setHouseShowIcon(item.getHouseShowIcon());
icResiCategoryStatsConfigResultDTO.setStatus(item.getStatus());
icResiCategoryStatsConfigResultDTO.setSort(item.getSort());
IcResiCategoryWarnConfigEntity warnConfigEntity = warnMap.get(item.getTableName() + "-" + item.getColumnName());
if(warnConfigEntity==null){
icResiCategoryStatsConfigResultDTO.setWarn(IcResiCategoryStatsConfigConstant.WARN_NO);
}else{
icResiCategoryStatsConfigResultDTO.setWarn(IcResiCategoryStatsConfigConstant.WARN_YES);
icResiCategoryStatsConfigResultDTO.setLevel1(warnConfigEntity.getLevel1());
icResiCategoryStatsConfigResultDTO.setLevel2(warnConfigEntity.getLevel2());
icResiCategoryStatsConfigResultDTO.setLevel3(warnConfigEntity.getLevel3());
}
result.add(icResiCategoryStatsConfigResultDTO);
});
if(null == formDTO){
return result;
}
List<IcResiCategoryStatsConfigResultDTO> collect = new ArrayList<>();
for (IcResiCategoryStatsConfigResultDTO item:result){
String isWarn = String.valueOf(formDTO.getIsWarn());
if(null !=formDTO.getIsWarn() && (!item.getWarn().equals(isWarn))){
continue;
}
if(null!=formDTO.getLevel()){
if(1==formDTO.getLevel()&&null==item.getLevel1()){
continue;
}
if(2==formDTO.getLevel()&&null==item.getLevel2()){
continue;
}
}
collect.add(item);
}
return collect;
return icResiCategoryStatsConfigDao.listInfo(customerId,formDTO.getIsWarn(),formDTO.getLevel());
}
@Override
@Transactional(rollbackFor = Exception.class)
public IcResiCategoryStatsConfigResultDTO info(String id) {
IcResiCategoryStatsConfigResultDTO result =new IcResiCategoryStatsConfigResultDTO();
IcResiCategoryStatsConfigDTO icResiCategoryStatsConfigDTO = icResiCategoryStatsConfigService.get(id);
if(null == icResiCategoryStatsConfigDTO){
return result;
}
IcResiCategoryWarnConfigEntity icResiCategoryWarnConfigEntity = icResiCategoryWarnConfigDao.selectOne(new QueryWrapper<IcResiCategoryWarnConfigEntity>().lambda()
.eq(IcResiCategoryWarnConfigEntity::getCustomerId, icResiCategoryStatsConfigDTO.getCustomerId())
.eq(IcResiCategoryWarnConfigEntity::getTableName, icResiCategoryStatsConfigDTO.getTableName())
.eq(IcResiCategoryWarnConfigEntity::getColumnName, icResiCategoryStatsConfigDTO.getColumnName()));
// IcResiCategoryWarnConfigEntity icResiCategoryWarnConfigEntity = Optional.ofNullable(entity).orElse(new IcResiCategoryWarnConfigEntity());
result.setId(icResiCategoryStatsConfigDTO.getId());
result.setLabel(icResiCategoryStatsConfigDTO.getLabel());
result.setManagementIcon(icResiCategoryStatsConfigDTO.getManagementIcon());
result.setDataIcon(icResiCategoryStatsConfigDTO.getDataIcon());
result.setHouseShowIcon(icResiCategoryStatsConfigDTO.getHouseShowIcon());
result.setStatus(icResiCategoryStatsConfigDTO.getStatus());
result.setSort(icResiCategoryStatsConfigDTO.getSort());
result.setWarn(null==icResiCategoryWarnConfigEntity?IcResiCategoryStatsConfigConstant.WARN_NO:IcResiCategoryStatsConfigConstant.WARN_YES);
if(null!=icResiCategoryWarnConfigEntity){
result.setLevel1(icResiCategoryWarnConfigEntity.getLevel1());
result.setLevel2(icResiCategoryWarnConfigEntity.getLevel2());
result.setLevel3(icResiCategoryWarnConfigEntity.getLevel3());
}
return result;
public IcResiCategoryStatsConfigResultDTO info(String id,String customerId) {
return icResiCategoryStatsConfigDao.info(id,customerId);
}
@Override
@ -231,42 +172,16 @@ public class ResiCategoryStatsConfigServiceImpl implements ResiCategoryStatsConf
icResiCategoryStatsConfigDao.updateById(icResiCategoryStatsConfigEntity);
//更新配置预警
if(IcResiCategoryStatsConfigConstant.WARN_YES.equals(formDTO.getWarn())){
//更新
IcResiCategoryWarnConfigEntity icResiCategoryWarnConfigEntity = icResiCategoryWarnConfigDao.selectOne(new QueryWrapper<IcResiCategoryWarnConfigEntity>().lambda()
.eq(IcResiCategoryWarnConfigEntity::getCustomerId,customerId)
.eq(IcResiCategoryWarnConfigEntity::getTableName, icResiCategoryStatsConfigDTO.getTableName())
.eq(IcResiCategoryWarnConfigEntity::getColumnName, icResiCategoryStatsConfigDTO.getColumnName()));
if(null == icResiCategoryWarnConfigEntity){
icResiCategoryWarnConfigEntity = new IcResiCategoryWarnConfigEntity();
icResiCategoryWarnConfigEntity.setCustomerId(customerId);
icResiCategoryWarnConfigEntity.setLabel(icResiCategoryStatsConfigDTO.getLabel());
icResiCategoryWarnConfigEntity.setTableName(icResiCategoryStatsConfigDTO.getTableName());
icResiCategoryWarnConfigEntity.setColumnName(icResiCategoryStatsConfigDTO.getColumnName());
icResiCategoryWarnConfigEntity.setLevel1(formDTO.getLevel1());
icResiCategoryWarnConfigEntity.setLevel2(formDTO.getLevel2());
icResiCategoryWarnConfigEntity.setLevel3(formDTO.getLevel3());
icResiCategoryWarnConfigEntity.setSort(icResiCategoryStatsConfigDTO.getSort());
icResiCategoryWarnConfigDao.insert(icResiCategoryWarnConfigEntity);
}else{
// icResiCategoryWarnConfigEntity.setCustomerId(customerId);
icResiCategoryWarnConfigEntity.setLabel(icResiCategoryStatsConfigDTO.getLabel());
icResiCategoryWarnConfigEntity.setTableName(icResiCategoryStatsConfigDTO.getTableName());
icResiCategoryWarnConfigEntity.setColumnName(icResiCategoryStatsConfigDTO.getColumnName());
icResiCategoryWarnConfigEntity.setLevel1(formDTO.getLevel1());
icResiCategoryWarnConfigEntity.setLevel2(formDTO.getLevel2());
icResiCategoryWarnConfigEntity.setLevel3(formDTO.getLevel3());
icResiCategoryWarnConfigEntity.setSort(icResiCategoryStatsConfigDTO.getSort());
icResiCategoryWarnConfigDao.updateById(icResiCategoryWarnConfigEntity);
}
}else if(IcResiCategoryStatsConfigConstant.WARN_NO.equals(formDTO.getWarn())){
//删除
icResiCategoryWarnConfigDao.delete(new QueryWrapper<IcResiCategoryWarnConfigEntity>().lambda()
.eq(IcResiCategoryWarnConfigEntity::getCustomerId,customerId)
.eq(IcResiCategoryWarnConfigEntity::getTableName,icResiCategoryStatsConfigDTO.getTableName())
.eq(IcResiCategoryWarnConfigEntity::getColumnName,icResiCategoryStatsConfigDTO.getColumnName()));
}
//更新
IcResiCategoryWarnConfigEntity icResiCategoryWarnConfigEntity = icResiCategoryWarnConfigDao.selectOne(new QueryWrapper<IcResiCategoryWarnConfigEntity>().lambda()
.eq(IcResiCategoryWarnConfigEntity::getCustomerId,customerId)
.eq(IcResiCategoryWarnConfigEntity::getTableName, icResiCategoryStatsConfigDTO.getTableName())
.eq(IcResiCategoryWarnConfigEntity::getColumnName, icResiCategoryStatsConfigDTO.getColumnName()));
icResiCategoryWarnConfigEntity.setWarn(formDTO.getWarn());
icResiCategoryWarnConfigEntity.setLevel1(formDTO.getLevel1());
icResiCategoryWarnConfigEntity.setLevel2(formDTO.getLevel2());
icResiCategoryWarnConfigEntity.setLevel3(formDTO.getLevel3());
icResiCategoryWarnConfigDao.updateById(icResiCategoryWarnConfigEntity);
}
@ -309,7 +224,5 @@ public class ResiCategoryStatsConfigServiceImpl implements ResiCategoryStatsConf
warnConfigEntity.setSort(collect.get(0).getSort());
}
icResiCategoryWarnConfigService.updateBatchById(warnConfigEntityList);
}
}

49
epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcResiCategoryStatsConfigDao.xml

@ -22,5 +22,54 @@
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<select id="listInfo" resultType="com.epmet.dto.result.IcResiCategoryStatsConfigResultDTO">
select
a.ID as id,
a.LABEL as label,
a.MANAGEMENT_ICON as managementIcon,
a.DATA_ICON as dataIcon,
a.HOUSE_SHOW_ICON as houseShowIcon,
a.`STATUS` as status,
a.SORT as sort ,
b.LEVEL_1 as level1,
b.LEVEL_2 as level2,
b.LEVEL_3 as level3,
b.WARN
from
ic_resi_category_stats_config a
left join ic_resi_category_warn_config b on a.TABLE_NAME = b.TABLE_NAME and a.COLUMN_NAME = b.COLUMN_NAME and b.DEL_FLAG =0 and b.CUSTOMER_ID = #{customerId}
where a.DEL_FLAG = 0 and a.CUSTOMER_ID = #{customerId}
<if test="isWarn != null">
AND b.WARN = CONCAT(#{isWarn},'')
</if>
<if test="level != null and level == 1 ">
AND b.LEVEL_1 IS NOT NULL
</if>
<if test="level != null and level == 2 ">
AND b.LEVEL_2 IS NOT NULL
</if>
ORDER BY a.SORT
</select>
<select id="info" resultType="com.epmet.dto.result.IcResiCategoryStatsConfigResultDTO">
select
a.ID as id,
a.LABEL as label,
a.MANAGEMENT_ICON as managementIcon,
a.DATA_ICON as dataIcon,
a.HOUSE_SHOW_ICON as houseShowIcon,
a.`STATUS` as status,
a.SORT as sort ,
b.LEVEL_1 as level1,
b.LEVEL_2 as level2,
b.LEVEL_3 as level3,
b.WARN
from
ic_resi_category_stats_config a
left join ic_resi_category_warn_config b on a.TABLE_NAME = b.TABLE_NAME and a.COLUMN_NAME = b.COLUMN_NAME and b.DEL_FLAG =0 and b.CUSTOMER_ID = #{customerId}
where a.DEL_FLAG = 0 and a.CUSTOMER_ID = #{customerId}
and a.id = #{id}
</select>
</mapper>

1
epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcResiCategoryWarnConfigDao.xml

@ -9,6 +9,7 @@
<result property="label" column="LABEL"/>
<result property="tableName" column="TABLE_NAME"/>
<result property="columnName" column="COLUMN_NAME"/>
<result property="warn" column="WARN"/>
<result property="sort" column="SORT"/>
<result property="level1" column="LEVEL_1"/>
<result property="level2" column="LEVEL_2"/>

4
epmet-user/epmet-user-server/pom.xml

@ -319,7 +319,7 @@
</dingTalk.robot.secret>
<!--rocketmq-->
<rocketmq.enable>true</rocketmq.enable>
<rocketmq.nameserver>192.168.1.140:9876;192.168.1.141:9876</rocketmq.nameserver>
<rocketmq.nameserver>192.168.10.161:9876</rocketmq.nameserver>
</properties>
</profile>
<profile>
@ -362,7 +362,7 @@
</dingTalk.robot.secret>
<!--rocketmq-->
<rocketmq.enable>true</rocketmq.enable>
<rocketmq.nameserver>192.168.1.140:9876;192.168.1.141:9876</rocketmq.nameserver>
<rocketmq.nameserver>192.168.11.187:9876;192.168.11.184:9876</rocketmq.nameserver>
</properties>
</profile>
</profiles>

6
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsResiWarnServiceImpl.java

@ -56,7 +56,7 @@ public class StatsResiWarnServiceImpl implements StatsResiWarnService {
}
List<IcResiCategoryStatsConfigDTO> icResiCategoryStatsConfigDTOList = statsResult.getData();
//feign获取当前需要预警的配置信息以及阈值
Result<List<IcResiCategoryWarnConfigDTO>> warnResult = operCustomizeOpenFeignClient.resiCategoryWarnList();
Result<List<IcResiCategoryWarnConfigDTO>> warnResult = operCustomizeOpenFeignClient.resiCategoryWarnList(customerId);
if (!warnResult.success() || null == warnResult.getData()) {
throw new RenException("预警配置查询失败:"+ warnResult.getMsg());
@ -200,7 +200,7 @@ public class StatsResiWarnServiceImpl implements StatsResiWarnService {
@Transactional(rollbackFor = Exception.class)
public void resiWarn(String customerId) {
// 获取预警配置项
Result<List<IcResiCategoryWarnConfigDTO>> warnResult = operCustomizeOpenFeignClient.resiCategoryWarnList();
Result<List<IcResiCategoryWarnConfigDTO>> warnResult = operCustomizeOpenFeignClient.resiCategoryWarnList(customerId);
if (!warnResult.success() || null == warnResult.getData()) {
throw new RenException("预警配置查询失败:"+ warnResult.getMsg());
}
@ -238,7 +238,7 @@ public class StatsResiWarnServiceImpl implements StatsResiWarnService {
@Override
public void resiWarnByOne(String customerId, String userId) {
// 获取预警配置项
Result<List<IcResiCategoryWarnConfigDTO>> warnResult = operCustomizeOpenFeignClient.resiCategoryWarnList();
Result<List<IcResiCategoryWarnConfigDTO>> warnResult = operCustomizeOpenFeignClient.resiCategoryWarnList(customerId);
if (!warnResult.success() || null == warnResult.getData()) {
throw new RenException("预警配置查询失败:"+ warnResult.getMsg());
}

Loading…
Cancel
Save