Browse Source

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

dev
yinzuomei 4 years ago
parent
commit
0371a78117
  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. 5
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/AddSocietyOrgFormDTO.java
  28. 3
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/EditSocietyOrgFormDTO.java
  29. 10
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/GetListSocietyOrgResultDTO.java
  30. 61
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/SocietyOrgListResultDTO.java
  31. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcSocietyOrgController.java
  32. 3
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcSocietyOrgDao.java
  33. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcSocietyOrgEntity.java
  34. 14
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcSocietyOrgServiceImpl.java
  35. 8
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcSocietyOrgDao.xml
  36. 2
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPlacePatrolRecordDTO.java
  37. 2
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPlacePatrolTeamDTO.java
  38. 4
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddPlacePatrolRecordFormDTO.java
  39. 3
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddPlacePatrolReviewRecordFormDTO.java
  40. 3
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddPlacePatrolTeamFormDTO.java
  41. 31
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AppointmentTimeFormDTO.java
  42. 2
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditPlacePatrolReviewRecordFormDTO.java
  43. 2
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditPlacePatrolTeamFormDTO.java
  44. 2
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetListPlaceOrgFormDTO.java
  45. 2
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetListPlacePatrolRecordFormDTO.java
  46. 2
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetListPlacePatrolTeamFormDTO.java
  47. 34
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AppointmentTimeResultDTO.java
  48. 13
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPartyServiceCenterController.java
  49. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlaceOrgController.java
  50. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlacePatrolRecordController.java
  51. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlacePatrolReviewRecordController.java
  52. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlacePatrolTeamController.java
  53. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPlaceOrgEntity.java
  54. 4
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPlacePatrolRecordEntity.java
  55. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPlacePatrolReviewRecordEntity.java
  56. 4
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPlacePatrolTeamEntity.java
  57. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPlacePatrolTeamStaffEntity.java
  58. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcPlacePatrolRecordExcel.java
  59. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcPlacePatrolTeamExcel.java
  60. 9
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPartyServiceCenterService.java
  61. 40
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java
  62. 5
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlaceOrgServiceImpl.java
  63. 3
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolReviewRecordServiceImpl.java
  64. 3
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolTeamServiceImpl.java
  65. 4
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/IcResiCategoryWarnConfigDTO.java
  66. 2
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java
  67. 4
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java
  68. 12
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/ResiCategoryStatsConfigController.java
  69. 15
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcResiCategoryStatsConfigDao.java
  70. 4
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcResiCategoryWarnConfigEntity.java
  71. 2
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/ResiCategoryStatsConfigService.java
  72. 165
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/ResiCategoryStatsConfigServiceImpl.java
  73. 49
      epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcResiCategoryStatsConfigDao.xml
  74. 1
      epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcResiCategoryWarnConfigDao.xml
  75. 4
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java
  76. 4
      epmet-user/epmet-user-server/pom.xml
  77. 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

5
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/AddSocietyOrgFormDTO.java

@ -17,6 +17,7 @@
package com.epmet.dto.form;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
@ -72,12 +73,12 @@ public class AddSocietyOrgFormDTO implements Serializable {
/**
* 起始服务时间
*/
@NotBlank(message = "起始服务时间不能为空", groups = { AddSocietyOrgFormDTO.Add.class })
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date serviceStartTime;
/**
* 终止服务时间
*/
@NotBlank(message = "终止服务时间不能为空", groups = { AddSocietyOrgFormDTO.Add.class })
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date serviceEndTime;
/**
* 绑定管理员[组织下录入的工作人员]

3
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/EditSocietyOrgFormDTO.java

@ -17,6 +17,7 @@
package com.epmet.dto.form;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
@ -62,10 +63,12 @@ public class EditSocietyOrgFormDTO implements Serializable {
/**
* 起始服务时间
*/
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date serviceStartTime;
/**
* 终止服务时间
*/
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date serviceEndTime;
/**
* 绑定管理员[组织下录入的工作人员]

10
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/GetListSocietyOrgResultDTO.java

@ -17,9 +17,11 @@
package com.epmet.dto.result;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
@ -34,7 +36,7 @@ public class GetListSocietyOrgResultDTO implements Serializable {
//集合总条数
private Integer total;
//社会组织信息
private List<SocietyOrgList> list;
private List<SocietyOrgListResultDTO> list;
@Data
public class SocietyOrgList{
@ -51,9 +53,11 @@ public class GetListSocietyOrgResultDTO implements Serializable {
//负责人电话
private String mobile;
//起始服务时间
private String serviceStartTime;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date serviceStartTime;
//终止服务时间
private String serviceEndTime;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date serviceEndTime;
//绑定管理员[组织下Id录入的工作人员]
private String adminStaffId;
//绑定管理员[组织下录入的工作人员]姓名

61
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/SocietyOrgListResultDTO.java

@ -0,0 +1,61 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author sun
* @Description 社会组织列表查询
**/
@Data
public class SocietyOrgListResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
//所属组织Id
private String agencyId;
//社会组织Id
private String societyId;
//社会组织名称
private String societyName;
//服务事项
private String serviceMatters;
//负责人姓名
private String personInCharge;
//负责人电话
private String mobile;
//起始服务时间
//@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
//private Date serviceStartTime;
private String serviceStartTime;
//终止服务时间
private String serviceEndTime;
//绑定管理员[组织下Id录入的工作人员]
private String adminStaffId;
//绑定管理员[组织下录入的工作人员]姓名
private String adminStaffName = "";
//地址
private String address;
//经度
private String longitude;
//维度
private String dimension;
}

2
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcSocietyOrgController.java

@ -57,7 +57,7 @@ public class IcSocietyOrgController {
@PostMapping("add")
public Result add(@LoginUser TokenDto tokenDto, @RequestBody AddSocietyOrgFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, AddSocietyOrgFormDTO.Add.class);
formDTO.setCustomerId(tokenDto.getToken());
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setStaffId(tokenDto.getUserId());
societyOrgService.add(formDTO);
return new Result();

3
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcSocietyOrgDao.java

@ -20,6 +20,7 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.form.GetListSocietyOrgFormDTO;
import com.epmet.dto.result.GetListSocietyOrgResultDTO;
import com.epmet.dto.result.SocietyOrgListResultDTO;
import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.entity.IcSocietyOrgEntity;
import org.apache.ibatis.annotations.Mapper;
@ -40,7 +41,7 @@ public interface IcSocietyOrgDao extends BaseDao<IcSocietyOrgEntity> {
* @Author sun
* @Description 社会组织列表查询
**/
List<GetListSocietyOrgResultDTO.SocietyOrgList> getList(GetListSocietyOrgFormDTO formDTO);
List<SocietyOrgListResultDTO> getList(GetListSocietyOrgFormDTO formDTO);
/**
* 需求指派选择社会组织调用此接口

2
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcSocietyOrgEntity.java

@ -33,7 +33,7 @@ import java.util.Date;
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("society_org")
@TableName("ic_society_org")
public class IcSocietyOrgEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;

14
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcSocietyOrgServiceImpl.java

@ -32,6 +32,7 @@ import com.epmet.dto.form.GetListSocietyOrgFormDTO;
import com.epmet.dto.form.UserIdsFormDTO;
import com.epmet.dto.form.demand.ServiceQueryFormDTO;
import com.epmet.dto.result.GetListSocietyOrgResultDTO;
import com.epmet.dto.result.SocietyOrgListResultDTO;
import com.epmet.dto.result.StaffSinGridResultDTO;
import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.entity.IcSocietyOrgEntity;
@ -92,6 +93,7 @@ public class IcSocietyOrgServiceImpl extends BaseServiceImpl<IcSocietyOrgDao, Ic
throw new RenException(String.format("修改社会组织信息失败,社会组织信息不存在,组织Id->%s", formDTO.getSocietyId()));
}
entity = ConvertUtils.sourceToTarget(formDTO, IcSocietyOrgEntity.class);
entity.setId(formDTO.getSocietyId());
baseDao.updateById(entity);
}
@ -114,7 +116,7 @@ public class IcSocietyOrgServiceImpl extends BaseServiceImpl<IcSocietyOrgDao, Ic
public GetListSocietyOrgResultDTO getList(GetListSocietyOrgFormDTO formDTO) {
GetListSocietyOrgResultDTO resultDTO = new GetListSocietyOrgResultDTO();
//1.根据查询条件分页查询社会组织数据
PageInfo<GetListSocietyOrgResultDTO.SocietyOrgList> result =
PageInfo<SocietyOrgListResultDTO> result =
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.getList(formDTO));
if (CollectionUtils.isEmpty(result.getList())) {
return resultDTO;
@ -122,7 +124,7 @@ public class IcSocietyOrgServiceImpl extends BaseServiceImpl<IcSocietyOrgDao, Ic
resultDTO.setTotal((int) result.getTotal());
//2.查询被绑定管理员信息
UserIdsFormDTO dto = new UserIdsFormDTO();
List<String> staffIdList = result.getList().stream().map(GetListSocietyOrgResultDTO.SocietyOrgList::getAdminStaffId).collect(Collectors.toList());
List<String> staffIdList = result.getList().stream().map(SocietyOrgListResultDTO::getAdminStaffId).collect(Collectors.toList());
staffIdList = staffIdList.stream().distinct().collect(Collectors.toList());
dto.setUserIds(staffIdList);
Result<List<StaffSinGridResultDTO>> listResult = epmetUserOpenFeignClient.getStaffInfoList(dto);
@ -143,19 +145,19 @@ public class IcSocietyOrgServiceImpl extends BaseServiceImpl<IcSocietyOrgDao, Ic
*/
@Override
public List<OptionDTO> queryServiceList(ServiceQueryFormDTO formDTO) {
List<OptionDTO> resultList=new ArrayList<>();
List<OptionDTO> resultList = new ArrayList<>();
CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId());
if (null == staffInfoCacheResult || StringUtils.isBlank(staffInfoCacheResult.getAgencyId())) {
throw new RenException("工作人员所属组织信息查询异常");
}
List<String> agencyIds=new ArrayList<>();
List<String> agencyIds = new ArrayList<>();
if (StringUtils.isNotBlank(staffInfoCacheResult.getAgencyPIds()) && !NumConstant.ZERO_STR.equals(staffInfoCacheResult.getAgencyPIds())) {
if(staffInfoCacheResult.getAgencyPIds().contains(StrConstant.COLON)){
if (staffInfoCacheResult.getAgencyPIds().contains(StrConstant.COLON)) {
agencyIds.addAll(Arrays.asList(staffInfoCacheResult.getAgencyPIds().split(StrConstant.COLON)));
}
}
agencyIds.add(staffInfoCacheResult.getAgencyId());
resultList=baseDao.selectListByAgencyId(agencyIds,formDTO.getServiceName(),formDTO.getCustomerId(),formDTO.getQueryPurpose());
resultList = baseDao.selectListByAgencyId(agencyIds, formDTO.getServiceName(), formDTO.getCustomerId(), formDTO.getQueryPurpose());
return resultList;
}

8
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcSocietyOrgDao.xml

@ -3,7 +3,7 @@
<mapper namespace="com.epmet.dao.IcSocietyOrgDao">
<select id="getList" resultType="com.epmet.dto.result.GetListSocietyOrgResultDTO$SocietyOrgList">
<select id="getList" resultType="com.epmet.dto.result.SocietyOrgListResultDTO">
SELECT
agency_id agencyId,
id societyId,
@ -22,7 +22,7 @@
WHERE
del_flag = '0'
<if test="customerId != null and customerId.trim() != ''">
AND a.customer_id = #{customerId}
AND customer_id = #{customerId}
</if>
<if test="societyName != null and societyName.trim() != ''">
AND society_name LIKE CONCAT('%', #{societyName}, '%')
@ -34,10 +34,10 @@
AND mobile = #{mobile}
</if>
<if test="serviceStartTime != null and serviceStartTime != ''">
AND date_id <![CDATA[>=]]> #{serviceStartTime}
AND service_start_time <![CDATA[>=]]> #{serviceStartTime}
</if>
<if test="serviceEndTime != null and serviceEndTime != ''">
AND date_id <![CDATA[<=]]> #{serviceEndTime}
AND service_end_time <![CDATA[<=]]> #{serviceEndTime}
</if>
ORDER BY created_time DESC
</select>

2
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPlacePatrolRecordDTO.java

@ -61,7 +61,7 @@ public class IcPlacePatrolRecordDTO implements Serializable {
/**
* 场所类型admin库sys_dict_data表九小场所value值
*/
private String ninePlacsVal;
private String ninePlaceVal;
/**
* 场所下的组织Id

2
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPlacePatrolTeamDTO.java

@ -61,7 +61,7 @@ public class IcPlacePatrolTeamDTO implements Serializable {
/**
* 负责场所类型admin库sys_dict_data表九小场所value值 多个值逗号分隔
*/
private String ninePlacsVals;
private String ninePlaceVals;
/**
* 分队名称

4
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddPlacePatrolRecordFormDTO.java

@ -17,6 +17,7 @@
package com.epmet.dto.form;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import javax.validation.constraints.NotBlank;
@ -80,7 +81,7 @@ public class AddPlacePatrolRecordFormDTO implements Serializable {
/**
* 首次巡查时间
*/
@NotBlank(message = "首次巡查时间不能为空", groups = {Add.class})
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date firstTime;
/**
@ -99,6 +100,7 @@ public class AddPlacePatrolRecordFormDTO implements Serializable {
/**
* 拟复查时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date reviewTime;
/**

3
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddPlacePatrolReviewRecordFormDTO.java

@ -17,6 +17,7 @@
package com.epmet.dto.form;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import javax.validation.constraints.NotBlank;
@ -59,7 +60,7 @@ public class AddPlacePatrolReviewRecordFormDTO implements Serializable {
/**
* 复查时间
*/
@NotBlank(message = "复查时间不能为空", groups = {Add.class})
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date reviewTime;
/**

3
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddPlacePatrolTeamFormDTO.java

@ -17,6 +17,7 @@
package com.epmet.dto.form;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
@ -80,7 +81,7 @@ public class AddPlacePatrolTeamFormDTO implements Serializable {
/**
* 创建(建队)时间
*/
@NotBlank(message = "创建时间不能为空", groups = {Add.class})
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date time;
/**

31
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AppointmentTimeFormDTO.java

@ -0,0 +1,31 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2021/11/23 9:57 上午
* @DESC
*/
@Data
public class AppointmentTimeFormDTO implements Serializable {
private static final long serialVersionUID = -3645075481936669437L;
public interface AppointmentTimeForm{}
/**
* 事项ID
*/
@NotBlank(message = "matterId不能为空",groups = AppointmentTimeForm.class)
private String matterId;
/**
* 日期默认当天
*/
@NotBlank(message = "date不能为空",groups = AppointmentTimeForm.class)
private String date;
}

2
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditPlacePatrolReviewRecordFormDTO.java

@ -17,6 +17,7 @@
package com.epmet.dto.form;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
@ -53,6 +54,7 @@ public class EditPlacePatrolReviewRecordFormDTO implements Serializable {
/**
* 复查时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date reviewTime;
/**

2
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditPlacePatrolTeamFormDTO.java

@ -17,6 +17,7 @@
package com.epmet.dto.form;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
@ -64,6 +65,7 @@ public class EditPlacePatrolTeamFormDTO implements Serializable {
/**
* 创建(建队)时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date time;
/**

2
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetListPlaceOrgFormDTO.java

@ -40,7 +40,7 @@ public class GetListPlaceOrgFormDTO implements Serializable {
//场所区域【网格Id】
private String gridId;
//场所类型【九小场所Value值】
private String ninePlacsVal;
private String ninePlaceVal;
//是否分页(是:true 否:false) 有这个参数是给新增巡查记录时用的,默认是
private Boolean isPage = true;
//页码

2
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetListPlacePatrolRecordFormDTO.java

@ -38,7 +38,7 @@ public class GetListPlacePatrolRecordFormDTO implements Serializable {
//场所区域【网格Id】
private String gridId;
//场所类型【九小场所Value值】
private String ninePlacsVal;
private String ninePlaceVal;
//最终检查结果【0:合格 1:不合格】
private String finalResult;
//页码

2
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetListPlacePatrolTeamFormDTO.java

@ -38,7 +38,7 @@ public class GetListPlacePatrolTeamFormDTO implements Serializable {
//场所区域【网格Id】
private String gridId;
//场所类型【九小场所Value值】
private String ninePlacsVal;
private String ninePlaceVal;
//是否分页(是:true 否:false) 有这个参数是给新增巡查记录时用的,默认是
private Boolean isPage = true;
//页码

34
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AppointmentTimeResultDTO.java

@ -0,0 +1,34 @@
package com.epmet.dto.result;
import com.epmet.dto.TimeDTO;
import lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* @Author zxc
* @DateTime 2021/11/23 9:55 上午
* @DESC
*/
@Data
public class AppointmentTimeResultDTO implements Serializable {
private static final long serialVersionUID = 8724962797702659712L;
/**
* 预约类型每天everyDay工作日workDay周末weekend
*/
private String appointmentType;
/**
* 时间段
*/
private List<TimeDTO> timeDetail;
public AppointmentTimeResultDTO() {
this.appointmentType = "";
this.timeDetail = new ArrayList<>();
}
}

13
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPartyServiceCenterController.java

@ -29,6 +29,7 @@ import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.dto.IcPartyServiceCenterDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.AppointmentTimeResultDTO;
import com.epmet.dto.result.PartyServiceCenterListResultDTO;
import com.epmet.excel.IcPartyServiceCenterExcel;
import com.epmet.service.IcPartyServiceCenterService;
@ -161,4 +162,16 @@ public class IcPartyServiceCenterController {
return new Result<List<PartyServiceCenterListResultDTO>>().ok(icPartyServiceCenterService.partyServiceCenterList(formDTO,tokenDto));
}
/**
* @Description 党群服务中心点击预约按钮时查询可选时间
* @param formDTO
* @author zxc
* @date 2021/11/23 10:02 上午
*/
@PostMapping("appointmenttime")
public Result<AppointmentTimeResultDTO> appointmentTime(@RequestBody AppointmentTimeFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, AppointmentTimeFormDTO.AppointmentTimeForm.class);
return new Result<AppointmentTimeResultDTO>().ok(icPartyServiceCenterService.appointmentTime(formDTO));
}
}

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlaceOrgController.java

@ -54,7 +54,7 @@ public class IcPlaceOrgController {
@PostMapping("add")
public Result add(@LoginUser TokenDto tokenDto, @RequestBody AddPlaceOrgFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, AddPlaceOrgFormDTO.Add.class);
formDTO.setCustomerId(tokenDto.getToken());
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setStaffId(tokenDto.getUserId());
placeOrgService.add(formDTO);
return new Result();

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlacePatrolRecordController.java

@ -54,7 +54,7 @@ public class IcPlacePatrolRecordController {
@PostMapping("add")
public Result add(@LoginUser TokenDto tokenDto, @RequestBody AddPlacePatrolRecordFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, AddPlacePatrolRecordFormDTO.Add.class);
formDTO.setCustomerId(tokenDto.getToken());
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setStaffId(tokenDto.getUserId());
placePatrolRecordService.add(formDTO);
return new Result();

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlacePatrolReviewRecordController.java

@ -54,7 +54,7 @@ public class IcPlacePatrolReviewRecordController {
@PostMapping("add")
public Result add(@LoginUser TokenDto tokenDto, @RequestBody AddPlacePatrolReviewRecordFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, AddPlacePatrolReviewRecordFormDTO.Add.class);
formDTO.setCustomerId(tokenDto.getToken());
formDTO.setCustomerId(tokenDto.getCustomerId());
placePatrolReviewRecordService.add(formDTO);
return new Result();
}

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlacePatrolTeamController.java

@ -55,7 +55,7 @@ public class IcPlacePatrolTeamController {
@PostMapping("add")
public Result add(@LoginUser TokenDto tokenDto, @RequestBody AddPlacePatrolTeamFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, AddPlacePatrolTeamFormDTO.Add.class);
formDTO.setCustomerId(tokenDto.getToken());
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setStaffId(tokenDto.getUserId());
placePatrolTeamService.add(formDTO);
return new Result();

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPlaceOrgEntity.java

@ -33,7 +33,7 @@ import java.util.Date;
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("place_org")
@TableName("ic_place_org")
public class IcPlaceOrgEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;

4
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPlacePatrolRecordEntity.java

@ -33,7 +33,7 @@ import java.util.Date;
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("place_patrol_record")
@TableName("ic_place_patrol_record")
public class IcPlacePatrolRecordEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
@ -61,7 +61,7 @@ public class IcPlacePatrolRecordEntity extends BaseEpmetEntity {
/**
* 场所类型admin库sys_dict_data表九小场所value值
*/
private String ninePlacsVal;
private String ninePlaceVal;
/**
* 场所下的组织Id

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPlacePatrolReviewRecordEntity.java

@ -33,7 +33,7 @@ import java.util.Date;
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("place_patrol_review_record")
@TableName("ic_place_patrol_review_record")
public class IcPlacePatrolReviewRecordEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;

4
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPlacePatrolTeamEntity.java

@ -33,7 +33,7 @@ import java.util.Date;
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("place_patrol_team")
@TableName("ic_place_patrol_team")
public class IcPlacePatrolTeamEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
@ -61,7 +61,7 @@ public class IcPlacePatrolTeamEntity extends BaseEpmetEntity {
/**
* 负责场所类型admin库sys_dict_data表九小场所value值 多个值逗号分隔
*/
private String ninePlacsVals;
private String ninePlaceVals;
/**
* 分队名称

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPlacePatrolTeamStaffEntity.java

@ -33,7 +33,7 @@ import java.util.Date;
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("place_patrol_team_staff")
@TableName("ic_place_patrol_team_staff")
public class IcPlacePatrolTeamStaffEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcPlacePatrolRecordExcel.java

@ -47,7 +47,7 @@ public class IcPlacePatrolRecordExcel {
private String gridId;
@Excel(name = "场所类型【admin库sys_dict_data表九小场所value值】")
private String ninePlacsVal;
private String ninePlaceVal;
@Excel(name = "场所下的组织Id")
private String placeOrgId;

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcPlacePatrolTeamExcel.java

@ -47,7 +47,7 @@ public class IcPlacePatrolTeamExcel {
private String gridIds;
@Excel(name = "负责场所类型【admin库sys_dict_data表九小场所value值 多个值逗号分隔】")
private String ninePlacsVals;
private String ninePlaceVals;
@Excel(name = "分队名称")
private String teamName;

9
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPartyServiceCenterService.java

@ -22,6 +22,7 @@ import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.dto.IcPartyServiceCenterDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.AppointmentTimeResultDTO;
import com.epmet.dto.result.PartyServiceCenterListResultDTO;
import com.epmet.entity.IcPartyServiceCenterEntity;
@ -140,4 +141,12 @@ public interface IcPartyServiceCenterService extends BaseService<IcPartyServiceC
*/
List<PartyServiceCenterListResultDTO> partyServiceCenterList(PartyServiceCenterListFormDTO formDTO,TokenDto tokenDto);
/**
* @Description 党群服务中心点击预约按钮时查询可选时间
* @param formDTO
* @author zxc
* @date 2021/11/23 10:02 上午
*/
AppointmentTimeResultDTO appointmentTime(AppointmentTimeFormDTO formDTO);
}

40
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java

@ -40,6 +40,7 @@ import com.epmet.dao.IcPartyServiceCenterDao;
import com.epmet.dto.IcPartyServiceCenterDTO;
import com.epmet.dto.TimeDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.AppointmentTimeResultDTO;
import com.epmet.dto.result.PartyServiceCenterListResultDTO;
import com.epmet.entity.IcMatterAppointmentRecordEntity;
import com.epmet.entity.IcPartyServiceCenterEntity;
@ -279,6 +280,45 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl<IcPartyServ
return result;
}
/**
* @Description 党群服务中心点击预约按钮时查询可选时间
* @param formDTO
* @author zxc
* @date 2021/11/23 10:02 上午
*/
@Override
public AppointmentTimeResultDTO appointmentTime(AppointmentTimeFormDTO formDTO) {
AppointmentTimeResultDTO result = new AppointmentTimeResultDTO();
IcPartyServiceCenterMatterEntity matter = matterService.selectById(formDTO.getMatterId());
if (null == matter){
throw new RenException("事项不存在...");
}
result.setAppointmentType(matter.getAppointmentType());
LambdaQueryWrapper<IcMatterAppointmentRecordEntity> l = new LambdaQueryWrapper<>();
l.eq(IcMatterAppointmentRecordEntity::getMatterId,formDTO.getMatterId())
.eq(IcMatterAppointmentRecordEntity::getAppointmentDate,formDTO.getDate())
.eq(BaseEpmetEntity::getDelFlag,NumConstant.ZERO);
List<IcMatterAppointmentRecordEntity> records = matterAppointmentRecordDao.selectList(l);
List<TimeDTO> timeList = getTimeList(matter.getStartTime(), matter.getEndTime(), NumConstant.THIRTY);
if (CollectionUtils.isEmpty(records)){
result.setTimeDetail(timeList);
return result;
}
records.forEach(r -> {
String[] split = r.getTimeId().split(",");
for (String s : split) {
for (TimeDTO t : timeList) {
if (s.equals(t.getTimeId())){
t.setIsAppointment(false);
continue;
}
}
}
});
result.setTimeDetail(timeList);
return result;
}
public List<TimeDTO> getTimeList(String start,String end,Integer interval){
List<TimeDTO> result = new ArrayList<>();
List<String> intervalTimeList = getIntervalTimeList(start, end, interval);

5
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlaceOrgServiceImpl.java

@ -80,9 +80,10 @@ public class IcPlaceOrgServiceImpl extends BaseServiceImpl<IcPlaceOrgDao, IcPlac
public void edit(EditPlaceOrgFormDTO formDTO) {
IcPlaceOrgEntity entity = baseDao.selectById(formDTO.getPlaceOrgId());
if (null == entity) {
throw new RenException(String.format("修改九小场所下组织信息失败,场所信息不存在,场所Id->%s", formDTO.getPlaceOrgId()));
throw new RenException(String.format("修改九小场所下场所信息失败,场所不存在,场所Id->%s", formDTO.getPlaceOrgId()));
}
entity = ConvertUtils.sourceToTarget(formDTO, IcPlaceOrgEntity.class);
entity.setId(formDTO.getPlaceOrgId());
baseDao.updateById(entity);
}
@ -94,7 +95,7 @@ public class IcPlaceOrgServiceImpl extends BaseServiceImpl<IcPlaceOrgDao, IcPlac
@Transactional(rollbackFor = Exception.class)
public void del(String placeOrgId) {
if (baseDao.deleteById(placeOrgId) < NumConstant.ONE) {
throw new RenException(String.format("修改九小场所下组织信息删除失败,场所Id->%s", placeOrgId));
throw new RenException(String.format("删除九小场所下场所信息失败,场所Id->%s", placeOrgId));
}
}

3
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolReviewRecordServiceImpl.java

@ -98,9 +98,10 @@ public class IcPlacePatrolReviewRecordServiceImpl extends BaseServiceImpl<IcPlac
//1.修改复查记录表数据
IcPlacePatrolReviewRecordEntity entity = baseDao.selectById(formDTO.getPlacePatrolReviewRecordId());
if (null == entity) {
throw new RenException(String.format("修改巡查复查记录,复查记录不存在,复查记录Id->%s", formDTO.getPlacePatrolReviewRecordId()));
throw new RenException(String.format("修改巡查复查记录信息失败,复查记录不存在,复查记录Id->%s", formDTO.getPlacePatrolReviewRecordId()));
}
entity = ConvertUtils.sourceToTarget(formDTO, IcPlacePatrolReviewRecordEntity.class);
entity.setId(formDTO.getPlacePatrolReviewRecordId());
baseDao.updateById(entity);
//2.复查记录修改了复查时间或复查结果时对应修改巡查记录数据最新巡查时间和结果
if (StringUtils.isNotEmpty(formDTO.getReviewResult()) || StringUtils.isNotEmpty(formDTO.getReviewTime().toString())) {

3
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolTeamServiceImpl.java

@ -107,6 +107,7 @@ public class IcPlacePatrolTeamServiceImpl extends BaseServiceImpl<IcPlacePatrolT
throw new RenException(String.format("修改九小场所下巡查分队人员信息失败,分队信息不存在,分队Id->%s", formDTO.getTeamId()));
}
entity = ConvertUtils.sourceToTarget(formDTO, IcPlacePatrolTeamEntity.class);
entity.setId(formDTO.getTeamId());
baseDao.updateById(entity);
//2.全删全增分队成员字表数据
List<IcPlacePatrolTeamStaffEntity> entityList = new ArrayList<>();
@ -132,7 +133,7 @@ public class IcPlacePatrolTeamServiceImpl extends BaseServiceImpl<IcPlacePatrolT
public void del(String teamId) {
//1.删除分队主表数据
if (baseDao.deleteById(teamId) < NumConstant.ONE) {
throw new RenException(String.format("修改九小场所下组织信息删除失败,场所Id->%s", teamId));
throw new RenException(String.format("删除九小场所下分队信息失败,分队Id->%s", teamId));
}
//2.删除分队成员字表数据
placePatrolTeamStaffService.delByTeamId(teamId);

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-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java

@ -23,8 +23,8 @@ import java.util.Set;
* @author yinzuomei@elink-cn.com
* @date 2020/6/4 13:09
*/
@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallbackFactory = EpmetUserOpenFeignClientFallbackFactory.class, url = "localhost:8087")
//@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallbackFactory = EpmetUserOpenFeignClientFallbackFactory.class)
//@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallbackFactory = EpmetUserOpenFeignClientFallbackFactory.class, url = "localhost:8087")
@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallbackFactory = EpmetUserOpenFeignClientFallbackFactory.class)
public interface EpmetUserOpenFeignClient {
/**

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