Browse Source

Merge remote-tracking branch 'remotes/origin/dev' into 市北测试

# Conflicts:
#	epmet-module/epmet-oss/epmet-oss-server/deploy/docker-compose-prod.yml
#	epmet-module/epmet-oss/epmet-oss-server/deploy/docker-compose-test.yml
release
jianjun 4 years ago
parent
commit
ea048fef93
  1. 6
      epmet-cloud-generator/src/main/resources/template/Controller.java.vm
  2. 4
      epmet-commons/epmet-commons-tools/pom.xml
  3. 42
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/CustomerGridFormDTO.java
  4. 29
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/CommonGovOrgFeignClient.java
  5. 24
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonGovOrgFeignClientFallBackFactory.java
  6. 26
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonGovOrgFeignClientFallback.java
  7. 25
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerOrgRedis.java
  8. 5
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/GridInfoCache.java
  9. 32
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/BarcodeUtils.java
  10. 5
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerGridDTO.java
  11. 2
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerGridDao.java
  12. 5
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/CustomerGridEntity.java
  13. 5
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerGridDao.xml
  14. 2
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java
  15. 5
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/result/CustomerGridDTO.java
  16. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectLogDailyDao.java
  17. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/org/CustomerGridEntity.java
  18. 7
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimGridEntity.java
  19. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollCommunityServiceImpl.java
  20. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollDistrictServiceImpl.java
  21. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollStreetServiceImpl.java
  22. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectLogDailyService.java
  23. 44
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java
  24. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java
  25. 1
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDimServiceImpl.java
  26. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimGridServiceImpl.java
  27. 53
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml
  28. 17
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.xml
  29. 3
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml
  30. BIN
      epmet-module/data-statistical/data-statistical-server/src/test/java/resources/指标可视化文案1201.docx
  31. BIN
      epmet-module/data-statistical/data-statistical-server/src/test/java/resources/治理能力计算公式.docx
  32. 6
      epmet-module/epmet-ext/epmet-ext-server/src/main/resources/bootstrap.yml
  33. 8
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java
  34. 11
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java
  35. 11
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiVolunteerController.java
  36. 7
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/VolunteerInfoDao.java
  37. 6
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/VolunteerInfoService.java
  38. 10
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java
  39. 6
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/bootstrap.yml
  40. 13
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/VolunteerInfoDao.xml
  41. 6
      epmet-module/epmet-message/epmet-message-server/src/main/resources/bootstrap.yml
  42. 1
      epmet-module/epmet-oss/epmet-oss-server/deploy/docker-compose-dev.yml
  43. 2
      epmet-module/epmet-oss/epmet-oss-server/deploy/docker-compose-test.yml
  44. 12
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/ComponentVerifyTicketServiceImpl.java
  45. 8
      epmet-module/epmet-third/epmet-third-server/src/main/resources/bootstrap.yml
  46. 8
      epmet-module/gov-access/gov-access-server/src/main/resources/bootstrap.yml
  47. 34
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/MemosToRemindFormDTO.java
  48. 42
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/MemosToRemindResultDTO.java
  49. 9
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java
  50. 5
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java
  51. 11
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueController.java
  52. 16
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueDao.java
  53. 8
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueService.java
  54. 21
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java
  55. 20
      epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml
  56. 4
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerGridDTO.java
  57. 7
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/ImportGeneralDTO.java
  58. 15
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AbandonGridFormDTO.java
  59. 4
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditAgencyFormDTO.java
  60. 5
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseFormDTO.java
  61. 20
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CommunityListResultDTO.java
  62. 23
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DelPartyServiceCenterResultDTO.java
  63. 19
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExistHouseInfoResultDTO.java
  64. 9
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java
  65. 5
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java
  66. 6
      epmet-module/gov-org/gov-org-server/pom.xml
  67. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/ImportErrorMsgConstants.java
  68. 30
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java
  69. 11
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffGridController.java
  70. 16
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/GridController.java
  71. 21
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java
  72. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPartyServiceCenterController.java
  73. 10
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java
  74. 14
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java
  75. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffAgencyDao.java
  76. 23
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffGridDao.java
  77. 3
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingDao.java
  78. 26
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java
  79. 27
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPartyServiceCenterDao.java
  80. 5
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerGridEntity.java
  81. 34
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java
  82. 25
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java
  83. 20
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportBuildingInfoListener.java
  84. 69
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportHouseInfoListener.java
  85. 20
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportNeighborHoodInfoListener.java
  86. 25
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java
  87. 13
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java
  88. 9
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffGridService.java
  89. 26
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcHouseService.java
  90. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffService.java
  91. 34
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java
  92. 8
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java
  93. 146
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java
  94. 11
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffGridServiceImpl.java
  95. 20
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java
  96. 32
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java
  97. 52
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java
  98. 6
      epmet-module/gov-org/gov-org-server/src/main/resources/bootstrap.yml
  99. 3
      epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.13__abandon_grid.sql
  100. 4
      epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.14__ic_house_remove_owner.sql

6
epmet-cloud-generator/src/main/resources/template/Controller.java.vm

@ -71,6 +71,12 @@ public class ${className}Controller {
return new Result();
}
@GetMapping("export")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<${className}DTO> list = ${classname}Service.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, ${className}Excel.class);
}
}

4
epmet-commons/epmet-commons-tools/pom.xml

@ -169,13 +169,13 @@
<dependency>
<groupId>com.google.zxing</groupId>
<artifactId>core</artifactId>
<version>3.3.2</version>
<version>3.4.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.zxing/javase -->
<dependency>
<groupId>com.google.zxing</groupId>
<artifactId>javase</artifactId>
<version>3.3.2</version>
<version>3.4.1</version>
</dependency>
</dependencies>

42
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/CustomerGridFormDTO.java

@ -0,0 +1,42 @@
/**
* 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.commons.tools.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* epmet-user端调用gov-org端的入参
* @author sun
*/
@Data
public class CustomerGridFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 网格Id
*/
@NotBlank(message = "网格ID不能为空", groups = {Grid.class})
private String gridId;
public interface Grid{}
}

29
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/CommonGovOrgFeignClient.java

@ -0,0 +1,29 @@
package com.epmet.commons.tools.feign;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.dto.form.CustomerGridFormDTO;
import com.epmet.commons.tools.feign.fallback.CommonGovOrgFeignClientFallBackFactory;
import com.epmet.commons.tools.redis.common.bean.GridInfoCache;
import com.epmet.commons.tools.utils.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
/**
* @Author zxc
* @DateTime 2022/3/17 1:42 下午
* @DESC
*/
@FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallbackFactory = CommonGovOrgFeignClientFallBackFactory.class)
public interface CommonGovOrgFeignClient {
/**
* @Description 查询网格信息
* @param customerGridFormDTO
* @author zxc
* @date 2021/11/5 2:54 下午
*/
@PostMapping("/gov/org/grid/getbaseinfo")
Result<GridInfoCache> getGridInfo(@RequestBody CustomerGridFormDTO customerGridFormDTO);
}

24
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonGovOrgFeignClientFallBackFactory.java

@ -0,0 +1,24 @@
package com.epmet.commons.tools.feign.fallback;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.feign.CommonGovOrgFeignClient;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
/**
* @Author zxc
* @DateTime 2022/3/17 1:46 下午
* @DESC
*/
@Slf4j
@Component
public class CommonGovOrgFeignClientFallBackFactory implements FallbackFactory<CommonGovOrgFeignClient> {
private CommonGovOrgFeignClientFallback fallback = new CommonGovOrgFeignClientFallback();
@Override
public CommonGovOrgFeignClient create(Throwable cause) {
log.error(String.format("FeignClient调用发生异常,异常信息:%s", ExceptionUtils.getThrowableErrorStackTrace(cause)));
return fallback;
}
}

26
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonGovOrgFeignClientFallback.java

@ -0,0 +1,26 @@
package com.epmet.commons.tools.feign.fallback;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.dto.form.CustomerGridFormDTO;
import com.epmet.commons.tools.feign.CommonGovOrgFeignClient;
import com.epmet.commons.tools.redis.common.bean.GridInfoCache;
import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
import org.springframework.stereotype.Component;
/**
* 调用政府端权限
* @Author wxz
* @Description
* @Date 2020/4/24 11:17
**/
@Component
public class CommonGovOrgFeignClientFallback implements CommonGovOrgFeignClient {
@Override
public Result<GridInfoCache> getGridInfo(CustomerGridFormDTO customerGridFormDTO) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getGridInfo", customerGridFormDTO);
}
}

25
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerOrgRedis.java

@ -1,8 +1,11 @@
package com.epmet.commons.tools.redis.common;
import cn.hutool.core.bean.BeanUtil;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.tools.dto.form.CustomerGridFormDTO;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.feign.CommonAggFeignClient;
import com.epmet.commons.tools.feign.CommonGovOrgFeignClient;
import com.epmet.commons.tools.redis.RedisKeys;
import com.epmet.commons.tools.redis.RedisUtils;
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
@ -31,14 +34,18 @@ public class CustomerOrgRedis {
@Autowired
private CommonAggFeignClient commonAggFeignClient;
@Autowired
private CommonGovOrgFeignClient govOrgFeignClient;
private static CustomerOrgRedis customerOrgRedis;
@PostConstruct
public void init() {
customerOrgRedis = this;
customerOrgRedis.redisUtils = this.redisUtils;
customerOrgRedis.commonAggFeignClient = this.commonAggFeignClient;
customerOrgRedis.govOrgFeignClient = this.govOrgFeignClient;
}
/**
@ -50,10 +57,13 @@ public class CustomerOrgRedis {
public static GridInfoCache getGridInfo(String gridId){
String key = RedisKeys.getGridInfoKey(gridId);
Map<String, Object> grid = customerOrgRedis.redisUtils.hGetAll(key);
log.info("grid is {}", JSON.toJSONString(grid));
if (!CollectionUtils.isEmpty(grid)) {
return ConvertUtils.mapToEntity(grid, GridInfoCache.class);
}
Result<GridInfoCache> gridInfoResult = customerOrgRedis.commonAggFeignClient.getGridInfo(gridId);
CustomerGridFormDTO formDTO = new CustomerGridFormDTO();
formDTO.setGridId(gridId);
Result<GridInfoCache> gridInfoResult = customerOrgRedis.govOrgFeignClient.getGridInfo(formDTO);
if (!gridInfoResult.success()){
throw new RenException("查询网格信息失败...");
}
@ -61,8 +71,10 @@ public class CustomerOrgRedis {
//throw new RenException("没有此网格信息...");
return null;
}
// feign 方法中已经放缓存
/*log.info("select grid info is {}", JSON.toJSONString(gridInfoResult.getData()));
Map<String, Object> map = BeanUtil.beanToMap(gridInfoResult.getData(), false, true);
customerOrgRedis.redisUtils.hMSet(key, map);
customerOrgRedis.redisUtils.hMSet(key, map);*/
return gridInfoResult.getData();
}
@ -90,4 +102,13 @@ public class CustomerOrgRedis {
return agencyInfoResult.getData();
}
/**
* desc:删除网格缓存
* @param gridId
*/
public static void delGridInfo(String gridId) {
String key = RedisKeys.getGridInfoKey(gridId);
customerOrgRedis.redisUtils.delete(key);
}
}

5
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/GridInfoCache.java

@ -113,4 +113,9 @@ public class GridInfoCache implements Serializable {
* 坐标区域
*/
private String coordinates;
/**
* 弃用标记
*/
private Integer abandonFlag;
}

32
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/BarcodeUtils.java

@ -1,13 +1,5 @@
package com.epmet.commons.tools.utils;
/**
* desc:
*
* @author: LiuJanJun
* @date: 2022/3/18 11:57 上午
* @version: 1.0
*/
import com.google.zxing.BarcodeFormat;
import com.google.zxing.EncodeHintType;
@ -28,7 +20,6 @@ import java.io.IOException;
import java.util.HashMap;
/**
* Author 程鹏
* Date 2021/08/27 16:01
* Description:二维码生成工具类
*/
@ -95,7 +86,7 @@ public class BarcodeUtils {
//x开始的位置:(图片宽度-字体大小*字的个数)/2
int startX = (WIDTH - (FONTSIZE * pressText.length())) / 2;
//y开始的位置:图片高度-(图片高度-图片宽度)/2
int startY = HEIGHT - (HEIGHT - WIDTH) / 2;
int startY = HEIGHT - (HEIGHT - WIDTH) / 2 + FONTSIZE;
int imageW = outImage.getWidth();
int imageH = outImage.getHeight();
@ -115,7 +106,7 @@ public class BarcodeUtils {
String s = outStringByByte(pressText, maxSize);
g.drawString(s, (WIDTH - (FONTSIZE * (WIDTH / FONTSIZE - 2))) / 2, startY);
pressText = pressText.substring(s.length(), pressText.length());
startY = startY + 30;
startY = startY + 35;
}
if (v != 0) {
g.drawString(pressText, (WIDTH - (FONTSIZE * v)) / 2, startY);
@ -169,9 +160,24 @@ public class BarcodeUtils {
} else {
return new String(btf, 0, len - 1, "GBK");
}
}
/*public static void main(String[] args) {
try {
BufferedImage image = BarcodeUtils.drawQRImage("小崽子社区中国国歌过过过过过所多对方水电费是的发生的", "https://epmet-cloud.elinkservice.cn/epmet-oper-gov/#/caiji/b058eb82d65d922fec9dc84f0348fc6a?name=%E5%B0%8F%E5%AF%A8%E5%AD%90%E7%A4%BE%E5%8C%BA&customerId=3fdd0380deff5b30f45376cdf995d1c1&type=community&userId=72d331139a5012b6bba18b40029a2755&123123123111");
//BufferedImage image = BarcodeUtils.drawQRImage("小崽子社区", "erId=72d331139a5012b6bba18b40029a2755&123123123111");
//BufferedImage image2 = BarcodeUtils.getQRCode("小崽子社区", "https://epmet-cloud.elinkservice.cn/epmet-oper-gov/#/caiji/b058eb82d65d922fec9dc84f0348fc6a?name=%E5%B0%8F%E5%AF%A8%E5%AD%90%E7%A4%BE%E5%8C%BA&customerId=3fdd0380deff5b30f45376cdf995d1c1&type=community&userId=72d331139a5012b6bba18b40029a2755&123123123111");
//BufferedImage 转 InputStream
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
ImageOutputStream imageOutput = ImageIO.createImageOutputStream(byteArrayOutputStream);
ImageIO.write(image, "png", imageOutput);
InputStream inputStream = new ByteArrayInputStream(byteArrayOutputStream.toByteArray());
String s = "/Users/liujianjun/Downloads/t.png";
File file= new File(s);
FileUtils.copyInputStreamToFile(inputStream, file);
} catch (Exception e) {
e.printStackTrace();
}
}*/
}

5
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerGridDTO.java

@ -153,4 +153,9 @@ public class CustomerGridDTO implements Serializable {
* 联系电话
*/
private String mobile;
/**
* 弃用标记
*/
private Integer abandonFlag;
}

2
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerGridDao.java

@ -53,7 +53,7 @@ public interface CustomerGridDao extends BaseDao<CustomerGridEntity> {
/**
* @Author sun
* @Description 根据组织Id查询当前组织下所有网格列表
* @Description 根据组织Id查询当前组织下所有网格列表(未弃用的网格)
**/
List<GridInfoResultDTO> selectGridListByAgencyId(@Param("agencyId") String agencyId);

5
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/CustomerGridEntity.java

@ -99,4 +99,9 @@ public class CustomerGridEntity extends BaseEpmetEntity {
* 联系电话
*/
private String mobile;
/**
* 弃用标记
*/
private Integer abandonFlag;
}

5
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerGridDao.xml

@ -53,6 +53,7 @@
WHERE
del_flag = '0'
AND pid = #{agencyId}
and ABANDON_FLAG='0'
</select>
<select id="gridListByStaffId" resultType="com.epmet.dataaggre.dto.govorg.CustomerGridDTO">
@ -174,8 +175,8 @@
cg.*
FROM customer_grid cg
LEFT JOIN customer_agency ca ON (ca.ID = cg.PID AND ca.DEL_FLAG = '0')
WHERE cg.DEL_FLAG = '0'
AND cg.ID = #{gridId}
WHERE cg.ID = #{gridId}
AND cg.DEL_FLAG = '0'
</select>
</mapper>

2
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java

@ -156,7 +156,7 @@ public class IndexController {
/**
* @param formDTO
* @Description 数字社区数据分析-动力网格
* @Description 数字社区数据分析-动力网格 数据由市北服务端自己添加的
* @author sun
*/
@PostMapping("advancedbranchrank-shibei")

5
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/result/CustomerGridDTO.java

@ -131,4 +131,9 @@ public class CustomerGridDTO implements Serializable {
* 所有上级组织名
*/
private String allParentName;
/**
* 弃用标记
*/
private Integer abandonFlag;
}

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

@ -171,7 +171,7 @@ public interface FactOriginProjectLogDailyDao extends BaseDao<FactOriginProjectL
* @author wangc
* @date 2020.10.15 17:29
*/
List<ProjectParticipatedAgencyResultDTO> selectProjectIdHandledByAgency(@Param("customerId") String customerId, @Param("dimId") String dimId);
List<OrgStatisticsResultDTO> selectProjectIdHandledByAgency(@Param("customerId") String customerId, @Param("level") String level, @Param("dimId") String dimId);
/**
* @param projectIds

5
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/org/CustomerGridEntity.java

@ -86,4 +86,9 @@ public class CustomerGridEntity extends BaseEpmetEntity {
*/
private String syncFlag;
/**
* 弃用标记
*/
private Integer abandonFlag;
}

7
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimGridEntity.java

@ -17,6 +17,7 @@
package com.epmet.entity.stats;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
@ -59,4 +60,10 @@ public class DimGridEntity extends BaseEpmetEntity {
private String code;
/**
* 弃用标记
*/
@TableField(exist = false)
private Integer abandonFlag;
}

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollCommunityServiceImpl.java

@ -141,7 +141,7 @@ public class IndexCollCommunityServiceImpl implements IndexCollCommunityService
//办结率
Map<String, BigDecimal> handlingRatioMap = factOriginProjectLogDailyService.getHandlingRatio(agencies, customerId, dimId.getMonthId());
//处理效率
Map<String, BigDecimal> efficiencyMap = factOriginProjectLogDailyService.getAgencyWorkPieceRatio(customerId, dimId.getMonthId());
Map<String, BigDecimal> efficiencyMap = factOriginProjectLogDailyService.getAgencyWorkPieceRatio(customerId, OrgTypeConstant.COMMUNITY, dimId.getMonthId());
list.forEach(entity -> {
//办结数
entity.setClosedProjectCount(Optional.ofNullable(agencyHandleCount.get(entity.getAgencyId())).orElse(NumConstant.ZERO));

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollDistrictServiceImpl.java

@ -134,7 +134,7 @@ public class IndexCollDistrictServiceImpl implements IndexCollDistrictService {
//办结率
Map<String, BigDecimal> handlingRatioMap = factOriginProjectLogDailyService.getHandlingRatio(agencies, customerId, dimId.getMonthId());
//处理效率
Map<String, BigDecimal> efficiencyMap = factOriginProjectLogDailyService.getAgencyWorkPieceRatio(customerId, dimId.getMonthId());
Map<String, BigDecimal> efficiencyMap = factOriginProjectLogDailyService.getAgencyWorkPieceRatio(customerId, OrgTypeConstant.DISTRICT, dimId.getMonthId());
list.forEach(entity -> {
//办结数
entity.setClosedProjectCount(agencyHandleCount.get(entity.getAgencyId()) == null ? NumConstant.ZERO : agencyHandleCount.get(entity.getAgencyId()));

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollStreetServiceImpl.java

@ -132,7 +132,7 @@ public class IndexCollStreetServiceImpl implements IndexCollStreetService {
//办结率
Map<String, BigDecimal> handlingRatioMap = factOriginProjectLogDailyService.getHandlingRatio(agencies, customerId, dimId.getMonthId());
//处理效率
Map<String, BigDecimal> efficiencyMap = factOriginProjectLogDailyService.getAgencyWorkPieceRatio(customerId, dimId.getMonthId());
Map<String, BigDecimal> efficiencyMap = factOriginProjectLogDailyService.getAgencyWorkPieceRatio(customerId, OrgTypeConstant.STREET, dimId.getMonthId());
list.forEach(entity -> {
//办结数
entity.setClosedProjectCount(agencyHandleCount.get(entity.getAgencyId()) == null ? NumConstant.ZERO : agencyHandleCount.get(entity.getAgencyId()));

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

@ -195,7 +195,7 @@ public interface FactOriginProjectLogDailyService extends BaseService<FactOrigin
* @author wangc
* @date 2020.09.21 02:16
**/
Map<String, BigDecimal> getAgencyWorkPieceRatio(String customerId, String dimId);
Map<String, BigDecimal> getAgencyWorkPieceRatio(String customerId, String level, String dimId);
/**
* 网格项目响应度

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

@ -230,50 +230,18 @@ public class FactOriginProjectLogDailyServiceImpl extends BaseServiceImpl<FactOr
* @date 2020.09.21 02:16
**/
@Override
public Map<String, BigDecimal> getAgencyWorkPieceRatio(String customerId, String dimId) {
public Map<String, BigDecimal> getAgencyWorkPieceRatio(String customerId, String level, String dimId) {
//计算方法 : 评价周期内办结项目的平均处理时长的倒数
//1.评价周期内结案了的项目
List<ProjectParticipatedAgencyResultDTO> projectsHandledByAgency = baseDao.selectProjectIdHandledByAgency(customerId, dimId);
//评价周期内每个机关结案了的项目耗时和项目数
List<OrgStatisticsResultDTO> projectsHandledByAgency = baseDao.selectProjectIdHandledByAgency(customerId, level, dimId);
Map<String, BigDecimal> efficiencyMap = new HashMap<>();
List<String> projects = new LinkedList<>();
if (!CollectionUtils.isEmpty(projectsHandledByAgency)) {
Map<String, List<String>> agencyProjectsMap = new HashMap<>();
projectsHandledByAgency.forEach(o -> {
String agencyId = o.getAgencyId();
String projectId = o.getProjectId();
if(CollectionUtils.isEmpty(agencyProjectsMap.get(agencyId))){
List<String> projectUnit = new LinkedList<>();
projectUnit.add(projectId);
agencyProjectsMap.put(agencyId,projectUnit);
}else{
agencyProjectsMap.get(agencyId).add(projectId);
}
projects.add(projectId);
});
//2.结案项目的总耗时
List<ProjectParticipatedAgencyResultDTO> costTimes = baseDao.selectProjectCostTime(projects);
Map<String,Integer> projectCostTime = costTimes.stream().collect(Collectors.toMap(ProjectParticipatedAgencyResultDTO::getProjectId,ProjectParticipatedAgencyResultDTO::getCount));
agencyProjectsMap.forEach((k,v) -> {
//k -> agencyId v -> projects
int total = NumConstant.ZERO;
if(!CollectionUtils.isEmpty(v)){
for(String p : v){
Integer cost = projectCostTime.get(p);
total = total + (null == cost ? NumConstant.ZERO : cost);
}
//每个机关的项目平均耗时
BigDecimal avgCost = new BigDecimal(total).divide(new BigDecimal(v.size()),4, BigDecimal.ROUND_HALF_UP);
//efficiencyMap.put(k,BigDecimal.ONE.divide(avgCost,4, BigDecimal.ROUND_HALF_UP));
efficiencyMap.put(k, null == avgCost ? BigDecimal.ZERO : avgCost.setScale(6, BigDecimal.ROUND_HALF_UP));
}else{
efficiencyMap.put(k,BigDecimal.ZERO);
}
//每个机关的项目平均耗时
BigDecimal avgCost = new BigDecimal(o.getSum()).divide(new BigDecimal(o.getCount()),6, RoundingMode.HALF_UP);
efficiencyMap.put(agencyId, avgCost);
});
}

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

@ -124,10 +124,15 @@ public class ScreenCustomerGridServiceImpl extends BaseServiceImpl<ScreenCustome
screenGrid.setCode(grid.getCode());
screenCustomerGridDao.updateById(screenGrid);
if ("1".equals(grid.getDelFlag())) {
if ("1".equals(grid.getDelFlag()) || grid.getAbandonFlag().compareTo(1) == 0) {
LambdaQueryWrapper<ScreenCustomerGridEntity> w = new LambdaQueryWrapper<>();
w.eq(ScreenCustomerGridEntity::getGridId, grid.getId());
screenCustomerGridDao.delete(w);
ScreenCustomerGridEntity e = new ScreenCustomerGridEntity();
e.setDelFlag(NumConstant.ONE_STR);
e.setUpdatedTime(new Date());
screenCustomerGridDao.update(e,w);
// 此delete不更新 updatedTime
// screenCustomerGridDao.delete(w);
}
}
}

1
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDimServiceImpl.java

@ -112,6 +112,7 @@ public class StatsDimServiceImpl implements StatsDimService {
dimGrid.setAreaCode(updatedGrid.getAreaCode());
dimGrid.setCustomerId(updatedGrid.getCustomerId());
dimGrid.setCode(updatedGrid.getCode());
dimGrid.setAbandonFlag(updatedGrid.getAbandonFlag());
dimGrids.add(dimGrid);
}
}

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimGridServiceImpl.java

@ -130,7 +130,7 @@ public class DimGridServiceImpl extends BaseServiceImpl<DimGridDao, DimGridEntit
for (DimGridEntity updatedGridDim : changedGrids) {
baseDao.updateById(updatedGridDim);
if ("1".equals(updatedGridDim.getDelFlag())) {
if ("1".equals(updatedGridDim.getDelFlag()) || updatedGridDim.getAbandonFlag().compareTo(1) == 0) {
// 如果已经被删除了,那么这里也做删除操作
baseDao.deleteById(updatedGridDim.getId());
}

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

@ -291,24 +291,45 @@
ORG_ID
</select>
<!-- 查询评价周期内各级别机关办结的项目Id -->
<select id="selectProjectIdHandledByAgency" resultType="com.epmet.dto.extract.result.ProjectParticipatedAgencyResultDTO">
<select id="selectProjectIdHandledByAgency" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT
ID AS projectId,
SUBSTRING_INDEX(FINISH_ORG_IDS,':',1) AS agencyId
FROM
fact_origin_project_main_daily
WHERE
DEL_FLAG = '0'
AND ID IN (
SELECT DISTINCT PROJECT_ID FROM fact_origin_project_log_daily
WHERE DEL_FLAG = '0' AND CUSTOMER_ID = #{customerId}
AND ACTION_CODE = 'close'
<if test='null != dimId and "" != dimId'>
agencyId,
COUNT(projectId) AS count,
SUM(total) AS sum
FROM
(
SELECT
a.ID AS projectId,
b.ID AS agencyId,
IF(
TIMESTAMPDIFF( DAY, DATE_FORMAT( a.DATE_ID, '%Y-%m-%d' ), DATE_FORMAT( c.DATE_ID, '%Y-%m-%d' ) ) = 0,
1,
TIMESTAMPDIFF( DAY, DATE_FORMAT( a.DATE_ID, '%Y-%m-%d' ), DATE_FORMAT( c.DATE_ID, '%Y-%m-%d' ) )
) * 8 * 60 AS total
FROM
fact_origin_project_main_daily a
INNER JOIN dim_agency b ON a.PIDS LIKE CONCAT( '%', b.ID, '%' )
AND b.AGENCY_DIM_TYPE = 'all'
AND b.DEL_FLAG = '0'
AND b.`LEVEL` = #{level}
INNER JOIN (
SELECT DISTINCT
DATE_ID,
PROJECT_ID
FROM fact_origin_project_log_daily
WHERE DEL_FLAG = '0'
AND ACTION_CODE = 'close'
AND IS_ACTIVE = '1'
AND CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{dimId}
</if>
)
ORDER BY agencyId
) c ON a.ID = c.PROJECT_ID
WHERE
a.DEL_FLAG = '0'
AND a.CUSTOMER_ID = #{customerId}
AND a.PROJECT_STATUS = 'closed'
) t
GROUP BY
agencyId
</select>
<!-- 计算每个办结项目的总耗时 -->
<select id="selectProjectCostTime" resultType="com.epmet.dto.extract.result.ProjectParticipatedAgencyResultDTO">

17
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.xml

@ -51,24 +51,33 @@
<select id="selectResponsiveness" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT
f.CUSTOMER_ID,
f.ORG_ID AS "agencyId",
<choose>
<when test='"dept" != orgType'>da.ID AS "agencyId",</when>
<otherwise>f.ORG_ID AS "agencyId",</otherwise>
</choose>
SUM( TIMESTAMPDIFF( MINUTE, ( DATE_FORMAT( f.INFORMED_DATE, '%Y-%m-%d %H:%i' )),
( DATE_FORMAT( f.PERIOD_TILL_REPLY_FIRSTLY, '%Y-%m-%d %H:%i' )) ) ) AS "sum",
COUNT(DISTINCT f.PROJECT_ID) AS "count"
FROM
fact_origin_project_org_period_daily f
INNER JOIN dim_agency da ON f.ORG_ID = da.ID
<if test='"dept" != orgType'>
INNER JOIN dim_agency da ON (f.PIDS LIKE CONCAT( '%', da.ID, '%' ) OR f.ORG_ID = da.ID)
AND da.`LEVEL` = #{level}
</if>
WHERE
f.ORG_TYPE = #{orgType}
f.DEL_FLAG = '0'
<if test='"dept" == orgType'>
AND f.ORG_TYPE = #{orgType}
</if>
AND DATE_FORMAT(INFORMED_DATE, '%Y%m') = #{monthId}
AND PERIOD_TILL_REPLY_FIRSTLY IS NOT NULL
AND f.CUSTOMER_ID = #{customerId}
GROUP BY
f.CUSTOMER_ID,
f.ORG_ID
<choose>
<when test='"dept" != orgType'>da.ID</when>
<otherwise>f.ORG_ID</otherwise>
</choose>
</select>
<!-- 批量插入 -->

3
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml

@ -68,7 +68,8 @@
manage_district,
total_user,
pid,
pids
pids,
ABANDON_FLAG
FROM customer_grid
WHERE SYNC_FLAG='1'
AND CREATED_TIME <![CDATA[<]]> #{startTime}

BIN
epmet-module/data-statistical/data-statistical-server/src/test/java/resources/指标可视化文案1201.docx

Binary file not shown.

BIN
epmet-module/data-statistical/data-statistical-server/src/test/java/resources/治理能力计算公式.docx

Binary file not shown.

6
epmet-module/epmet-ext/epmet-ext-server/src/main/resources/bootstrap.yml

@ -93,6 +93,12 @@ hystrix:
isolation:
thread:
timeoutInMilliseconds: 60000
threadpool:
default:
coreSize: 20
maximumSize: 50
maxQueueSize: 500
queueSizeRejectionThreshold: 800
ribbon:
ReadTimeout: 300000

8
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java

@ -84,4 +84,12 @@ public interface EpmetHeartOpenFeignClient {
*/
@PostMapping("/heart/resi/volunteer/count")
Result<Integer> getVolunteerCount(@RequestBody VolunteerCommonFormDTO input);
/**
* 修改志愿者的注册网格
* @param volunteerInfoDTO
* @return
*/
@PostMapping("/heart/resi/volunteer/modifyVolunteerGrid")
Result modifyVolunteerGrid(@RequestBody VolunteerInfoDTO volunteerInfoDTO);
}

11
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java

@ -77,4 +77,15 @@ public class EpmetHeartOpenFeignClientFallback implements EpmetHeartOpenFeignCli
public Result<Integer> getVolunteerCount(VolunteerCommonFormDTO input) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "getVolunteerCount", input);
}
/**
* 修改志愿者的注册网格
*
* @param volunteerInfoDTO
* @return
*/
@Override
public Result modifyVolunteerGrid(VolunteerInfoDTO volunteerInfoDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "modifyVolunteerGrid", volunteerInfoDTO);
}
}

11
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiVolunteerController.java

@ -159,4 +159,15 @@ public class ResiVolunteerController {
Integer volunteerCount = volunteerInfoService.getVolunteerCount(customerId, agencyId);
return new Result<Integer>().ok(volunteerCount);
}
/**
* 修改志愿者注册信息_的网格信息
* @param volunteerInfoDTO
* @return
*/
@PostMapping("modifyVolunteerGrid")
public Result modifyVolunteerGrid(@RequestBody VolunteerInfoDTO volunteerInfoDTO){
volunteerInfoService.modifyVolunteerGrid(volunteerInfoDTO);
return new Result();
}
}

7
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/VolunteerInfoDao.java

@ -74,4 +74,11 @@ public interface VolunteerInfoDao extends BaseDao<VolunteerInfoEntity> {
* @date 2020.08.13 10:06
**/
List<String> selectVolunteerIds(@Param("customerId")String customerId);
/**
* 修改志愿者注册信息_网格信息
* @param volunteerInfoDTO
* @return
*/
int updateVolunteerGrid(VolunteerInfoDTO volunteerInfoDTO);
}

6
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/VolunteerInfoService.java

@ -111,4 +111,10 @@ public interface VolunteerInfoService extends BaseService<VolunteerInfoEntity> {
* @return
*/
Integer getVolunteerCount(String customerId, String agencyId);
/**
* 修改志愿者注册信息_的网格信息
* @param volunteerInfoDTO
*/
void modifyVolunteerGrid(VolunteerInfoDTO volunteerInfoDTO);
}

10
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java

@ -414,4 +414,14 @@ public class VolunteerInfoServiceImpl extends BaseServiceImpl<VolunteerInfoDao,
return pidsAndAgencyIdPath;
}
/**
* 修改志愿者注册信息_的网格信息
*
* @param volunteerInfoDTO
*/
@Override
public void modifyVolunteerGrid(VolunteerInfoDTO volunteerInfoDTO) {
baseDao.updateVolunteerGrid(volunteerInfoDTO);
}
}

6
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/bootstrap.yml

@ -111,6 +111,12 @@ hystrix:
isolation:
thread:
timeoutInMilliseconds: 60000 #缺省为1000
threadpool:
default:
coreSize: 20
maximumSize: 50
maxQueueSize: 500
queueSizeRejectionThreshold: 800
ribbon:
ReadTimeout: 300000

13
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/VolunteerInfoDao.xml

@ -72,4 +72,17 @@
AND CUSTOMER_ID = #{customerId}
order by CREATED_TIME asc
</select>
<update id="updateVolunteerGrid" parameterType="com.epmet.dto.VolunteerInfoDTO">
UPDATE volunteer_info
SET GRID_ID = #{gridId},
GRID_NAME = #{gridName},
PID = #{pid},
PIDS = #{pids},
UPDATED_TIME = NOW()
WHERE
del_flag = '0'
AND customer_id = #{customerId}
AND user_id = #{userId}
</update>
</mapper>

6
epmet-module/epmet-message/epmet-message-server/src/main/resources/bootstrap.yml

@ -113,6 +113,12 @@ hystrix:
isolation:
thread:
timeoutInMilliseconds: 60000 #缺省为1000
threadpool:
default:
coreSize: 20
maximumSize: 50
maxQueueSize: 500
queueSizeRejectionThreshold: 800
ribbon:
ReadTimeout: 300000

1
epmet-module/epmet-oss/epmet-oss-server/deploy/docker-compose-dev.yml

@ -2,7 +2,6 @@ version: "3.7"
services:
epmet-oss-server:
container_name: epmet-oss-server-dev
# image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/epmet-oss-server:0.3.2
image: 192.168.1.140:5000/epmet-cloud-dev/epmet-oss-server:version_placeholder
ports:
- "8083:8083"

2
epmet-module/epmet-oss/epmet-oss-server/deploy/docker-compose-test.yml

@ -16,4 +16,4 @@ services:
resources:
limits:
cpus: '0.1'
memory: 250M
memory: 250M

12
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/ComponentVerifyTicketServiceImpl.java

@ -245,12 +245,12 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe
//存缓存
redisThird.setComponentAccessToken(componentAccessToken);
//推送到私有化平台们
try {
pushComponentAccessToken2PrivateEpmetPlatforms(formDTO);
} catch (Exception e) {
String detail = ExceptionUtils.getErrorStackTrace(e);
log.error(detail);
}
//try {
// pushComponentAccessToken2PrivateEpmetPlatforms(formDTO);
//} catch (Exception e) {
// String detail = ExceptionUtils.getErrorStackTrace(e);
// log.error(detail);
//}
} else {
throw new RenException(ThirdRunTimeInfoConstant.FAILURE_ACCESS_TOKEN);
}

8
epmet-module/epmet-third/epmet-third-server/src/main/resources/bootstrap.yml

@ -93,6 +93,12 @@ hystrix:
isolation:
thread:
timeoutInMilliseconds: 60000
threadpool:
default:
coreSize: 20
maximumSize: 50
maxQueueSize: 500
queueSizeRejectionThreshold: 800
ribbon:
ReadTimeout: 300000
@ -171,4 +177,4 @@ thread:
queueCapacity: @thread.threadPool.queue-capacity@
keepAliveSeconds: @thread.threadPool.keep-alive-seconds@
threadNamePrefix: @thread.threadPool.thread-name-prefix@
rejectedExecutionHandler: @thread.threadPool.rejected-execution-handler@
rejectedExecutionHandler: @thread.threadPool.rejected-execution-handler@

8
epmet-module/gov-access/gov-access-server/src/main/resources/bootstrap.yml

@ -112,6 +112,12 @@ hystrix:
isolation:
thread:
timeoutInMilliseconds: 60000 #缺省为1000
threadpool:
default:
coreSize: 20
maximumSize: 50
maxQueueSize: 500
queueSizeRejectionThreshold: 800
ribbon:
ReadTimeout: 300000
@ -141,4 +147,4 @@ thread:
queueCapacity: @thread.threadPool.queue-capacity@
keepAliveSeconds: @thread.threadPool.keep-alive-seconds@
threadNamePrefix: @thread.threadPool.thread-name-prefix@
rejectedExecutionHandler: @thread.threadPool.rejected-execution-handler@
rejectedExecutionHandler: @thread.threadPool.rejected-execution-handler@

34
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/MemosToRemindFormDTO.java

@ -0,0 +1,34 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;
/**
* @Author sun
* @Description 书记日志-待提醒弹框-提醒内容列表-接口入参
**/
@Data
public class MemosToRemindFormDTO implements Serializable {
private static final long serialVersionUID = 4859779755214502427L;
public interface MemoAttr extends CustomerClientShowGroup {}
/**
* 待提醒业务Id
*/
@NotBlank(message = "待提醒业务Id不能为空", groups = { MemoAttr.class })
private String memoId;
/**
* 到期提醒时间,不传值默认查询当前时间之前的数据yyyy-MM-dd
*/
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private String remindTime;
//token中用户Id
private String userId;
}

42
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/MemosToRemindResultDTO.java

@ -0,0 +1,42 @@
package com.epmet.dto.result;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* @Author sun
* @Description 书记日志-待提醒弹框-提醒内容列表-接口返参
**/
@Data
@AllArgsConstructor
public class MemosToRemindResultDTO implements Serializable {
private static final long serialVersionUID = 4769136806332933579L;
/**
* 对应业务数据Id
*/
private String memoId;
/**
* 业务类型 人员关怀concern难点堵点difficulty工作日志work_diary
*/
private String type;
/**
* 业务类型 人员关怀concern难点堵点difficulty工作日志work_diary
*/
private String typeName;
/**
* 提醒内容
*/
private String content;
/**
* 提醒时间日期类型
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
private String remindTime;
}

9
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java

@ -376,4 +376,13 @@ public interface GovIssueOpenFeignClient {
*/
@PostMapping("/gov/issue/issueprojectcategorydict/categoryMap/{customerId}")
Result<Map<String, String>> getCategoryMap(@PathVariable("customerId") String customerId);
/**
* Desc: 查询网格下是否存在审核中的表决中的议题 true存在false不存在
* @param gridId
* @author zxc
* @date 2022/3/15 4:40 下午
*/
@PostMapping("/gov/issue/issue/audit-reset")
Result<Boolean> issueAuditReset(@RequestParam("gridId")String gridId);
}

5
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java

@ -319,4 +319,9 @@ public class GovIssueOpenFeignClientFallBack implements GovIssueOpenFeignClient
public Result<Map<String, String>> getCategoryMap(String customerId) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "getCategoryMap", customerId);
}
@Override
public Result<Boolean> issueAuditReset(String gridId) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "issueAuditReset", gridId);
}
}

11
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueController.java

@ -322,5 +322,16 @@ public class IssueController {
return new Result<List<ProjectDistributionAnalysisRightDTO>>().ok(issueService.getProjectCountByGrid(formDTO));
}
/**
* Desc: 查询网格下是否存在审核中的表决中的议题 true存在false不存在
* @param gridId
* @author zxc
* @date 2022/3/15 4:40 下午
*/
@PostMapping("audit-reset")
public Result<Boolean> issueAuditReset(@RequestParam("gridId")String gridId){
return new Result<Boolean>().ok(issueService.issueAuditReset(gridId));
}
}

16
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueDao.java

@ -292,4 +292,20 @@ public interface IssueDao extends BaseDao<IssueEntity> {
List<ResiBuzzIssueCategoryDTO> selectCategoryNameByIssueList(List<ResiBuzzLeftPieChartResultDTO> issueIds,@Param("customerId")String customerId);
/**
* Desc: 查询网格中表决中的议题个数
* @param gridId
* @author zxc
* @date 2022/3/15 4:44 下午
*/
Integer selectVotingIssue(@Param("gridId")String gridId);
/**
* Desc: 查询网格中审核中的议题个数
* @param gridId
* @author zxc
* @date 2022/3/15 4:44 下午
*/
Integer selectAuditIssue(@Param("gridId")String gridId);
}

8
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueService.java

@ -378,4 +378,12 @@ public interface IssueService extends BaseService<IssueEntity> {
*/
List<ProjectDistributionAnalysisRightDTO> getProjectCountByGrid(ProjectDistributionAnalysisFormDTO formDTO);
/**
* Desc: 查询网格下是否存在审核中的表决中的议题 true存在false不存在
* @param gridId
* @author zxc
* @date 2022/3/15 4:40 下午
*/
Boolean issueAuditReset(String gridId);
}

21
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java

@ -1744,5 +1744,26 @@ public class IssueServiceImpl extends BaseServiceImpl<IssueDao, IssueEntity> imp
return result;
}
/**
* Desc: 查询网格下是否存在审核中的表决中的议题 true存在false不存在
* @param gridId
* @author zxc
* @date 2022/3/15 4:40 下午
*/
@Override
public Boolean issueAuditReset(String gridId) {
// 表决中的议题个数
Integer votingCount = baseDao.selectVotingIssue(gridId);
if (votingCount.compareTo(NumConstant.ZERO) != NumConstant.ZERO){
return true;
}
// 审核中的议题个数
Integer auditCount = baseDao.selectAuditIssue(gridId);
if (auditCount.compareTo(NumConstant.ZERO) != NumConstant.ZERO){
return true;
}
return false;
}
}

20
epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml

@ -750,4 +750,24 @@
LEFT JOIN issue_project_category_dict cd ON (cd.CATEGORY_CODE = t1.categoryCode AND cd.DEL_FLAG = '0' AND cd.CUSTOMER_ID = #{customerId})
</foreach>
</select>
<!-- 查询网格中表决中的议题个数 -->
<select id="selectVotingIssue" resultType="java.lang.Integer">
SELECT
COUNT(id)
FROM issue
WHERE del_flag = 0
and ISSUE_STATUS = 'voting'
AND grid_id = #{gridId}
</select>
<!-- 查询网格中审核中的议题个数 -->
<select id="selectAuditIssue" resultType="java.lang.Integer">
SELECT
count( id )
FROM issue_application
WHERE DEL_FLAG = '0'
AND APPLY_STATUS = 'under_auditing'
AND GRID_ID = #{gridId}
</select>
</mapper>

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

@ -151,4 +151,8 @@ public class CustomerGridDTO implements Serializable {
* 联系电话
*/
private String mobile;
/**
* 弃用1正常使用0
*/
private Integer abandonFlag;
}

7
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/ImportGeneralDTO.java

@ -138,6 +138,13 @@ public class ImportGeneralDTO implements Serializable {
private Boolean existStatus = false;
private Boolean addStatus = false;
/**
* 错误信息添加状态
*/
private Boolean addStatus = false;
/**
* 楼栋重复状态
*/

15
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AbandonGridFormDTO.java

@ -0,0 +1,15 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.validator.group.AddGroup;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
@Data
public class AbandonGridFormDTO implements Serializable {
@NotBlank(message = "网格id不能为空",groups = AddGroup.class)
private String gridId;
private String userId;
}

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

@ -75,7 +75,7 @@ public class EditAgencyFormDTO implements Serializable {
/**
* open: 选择地区编码必填closed: 无需选择地区编码;0409新增返参
*/
@NotBlank(message = "areaCodeSwitch不能为空", groups = AddUserInternalGroup.class)
// @NotBlank(message = "areaCodeSwitch不能为空", groups = AddUserInternalGroup.class)
private String areaCodeSwitch;
/**
@ -108,4 +108,6 @@ public class EditAgencyFormDTO implements Serializable {
* 中心点位位置
*/
private String centerAddress;
private String customerId;
}

5
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseFormDTO.java

@ -87,19 +87,16 @@ public class IcHouseFormDTO implements Serializable {
/**
* 房主姓名
*/
@NotBlank(message = "房主姓名不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class})
private String ownerName;
/**
* 房主电话
*/
@NotBlank(message = "房主电话不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class})
private String ownerPhone;
/**
* 房主身份证号
*/
@NotBlank(message = "房主身份证号不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class})
private String ownerIdCard;
}
}

20
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CommunityListResultDTO.java

@ -0,0 +1,20 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2022/3/21 15:11
* @DESC
*/
@Data
public class CommunityListResultDTO implements Serializable {
private static final long serialVersionUID = 4336149113821131764L;
private String orgId;
private String orgName;
}

23
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DelPartyServiceCenterResultDTO.java

@ -0,0 +1,23 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2022/3/15 10:43 上午
* @DESC
*/
@Data
public class DelPartyServiceCenterResultDTO implements Serializable {
private static final long serialVersionUID = -2238226229442700788L;
private String date;
private String matterId;
private String timeId;
private String startTime;
private String endTime;
private String centerName;
}

19
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExistHouseInfoResultDTO.java

@ -0,0 +1,19 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2022/3/25 10:46
* @DESC
*/
@Data
public class ExistHouseInfoResultDTO implements Serializable {
private static final long serialVersionUID = -6350975846409029631L;
private String name;
private String houseId;
}

9
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java

@ -596,4 +596,13 @@ public interface GovOrgOpenFeignClient {
*/
@GetMapping("/gov/org/icbuildingunit/{id}")
Result<IcBuildingUnitDTO> getUnitById(@PathVariable("id") String id);
/**
* Desc: 查询网格下所有的工作人员
* @param gridId
* @author zxc
* @date 2022/3/21 16:02
*/
@PostMapping("/gov/org/customerstaffgrid/getallstaffbygridid")
Result<List<String>> getAllStaffByGridId(@RequestParam("gridId")String gridId);
}

5
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java

@ -388,4 +388,9 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient {
public Result<IcBuildingUnitDTO> getUnitById(String id) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getUnitById", id);
}
@Override
public Result<List<String>> getAllStaffByGridId(String gridId) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getAllStaffByGridId", gridId);
}
}

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

@ -136,6 +136,12 @@
<version>3.0.3</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>gov-issue-client</artifactId>
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/ImportErrorMsgConstants.java

@ -9,7 +9,7 @@ public interface ImportErrorMsgConstants {
String EXIST_ERROR = "数据已存在";
String HOUSE_ERROR = "所属组织、所属网格、所属小区、所属楼栋、单元号、房屋类型、房屋用途、出租、房主姓名、房主电话、房主身份证的值未填写,或者所填写信息在系统中未找到";
String HOUSE_ERROR = "所属组织、所属网格、所属小区、所属楼栋、单元号、房屋类型、房屋用途、出租的值未填写,或者所填写信息在系统中未找到";
String BUILDING_ERROR = "所属组织、所属网格、所属小区、楼栋类型、单元数的值未填写,或者所填写信息在系统中未找到";

30
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java

@ -17,7 +17,6 @@
package com.epmet.controller;
import com.alibaba.fastjson.JSONObject;
import com.epmet.commons.rocketmq.messages.OrgOrStaffMQMsg;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.annotation.RequirePermission;
@ -43,12 +42,7 @@ import com.epmet.send.SendMqMsgUtil;
import com.epmet.service.AgencyService;
import com.epmet.service.CustomerAgencyService;
import com.epmet.service.IcNeighborHoodService;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.EncodeHintType;
import com.google.zxing.MultiFormatWriter;
import com.google.zxing.WriterException;
import com.google.zxing.client.j2se.MatrixToImageWriter;
import com.google.zxing.common.BitMatrix;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -58,10 +52,11 @@ import javax.imageio.ImageIO;
import javax.imageio.stream.ImageOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.awt.image.BufferedImage;
import java.io.*;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URLEncoder;
import java.nio.file.FileSystems;
import java.nio.file.Path;
import java.time.LocalDateTime;
import java.time.ZoneOffset;
import java.util.HashMap;
@ -177,6 +172,7 @@ public class AgencyController {
@RequirePermission(requirePermission = RequirePermissionEnum.ORG_AGENCY_UPDATE)
public Result editAgency(@LoginUser TokenDto tokenDTO, @RequestBody EditAgencyFormDTO formDTO) {
formDTO.setUserId(tokenDTO.getUserId());
formDTO.setCustomerId(tokenDTO.getCustomerId());
ValidatorUtils.validateEntity(formDTO, EditAgencyFormDTO.DefaultUserShowGroup.class, EditAgencyFormDTO.AddUserInternalGroup.class);
Result result = agencyService.editAgency(formDTO);
@ -415,7 +411,9 @@ public class AgencyController {
}
//url组成:数字社区地址?小区id&用户id
//String url = "https://demo.tduckapp.com/s/7314b64b3a26455ab793fb8c640856b6?id="+id;
String url = EnvEnum.getCurrentEnv().getUrl().replace("api/", StrConstant.EPMETY_STR)
String url = EnvEnum.getCurrentEnv().getUrl()
.replace("cloud","open")
.replace("api/", StrConstant.EPMETY_STR)
.concat("epmet-oper-gov/#/caiji/")
.concat(id).concat("?")
.concat("name=").concat(URLEncoder.encode(name,StrConstant.UTF_8)).concat(StrConstant.AND_MARK)
@ -450,4 +448,14 @@ public class AgencyController {
}
}
/**
* Desc: 查询工作人员所属组织下的所有社区
* @param tokenDto
* @author zxc
* @date 2022/3/21 15:13
*/
@PostMapping("community-list")
public Result<List<CommunityListResultDTO>> getCommunityList(@LoginUser TokenDto tokenDto){
return new Result<List<CommunityListResultDTO>>().ok(agencyService.getCommunityList(tokenDto));
}
}

11
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffGridController.java

@ -145,4 +145,15 @@ public class CustomerStaffGridController {
public Result<List<EventTitleOrgResultDTO>> eventOrg(@LoginUser TokenDto tokenDto){
return new Result<List<EventTitleOrgResultDTO>>().ok(customerStaffGridService.eventOrg(tokenDto.getUserId()));
}
/**
* Desc: 查询网格下所有的工作人员
* @param gridId
* @author zxc
* @date 2022/3/21 16:02
*/
@PostMapping("getallstaffbygridid")
public Result<List<String>> getAllStaffByGridId(@RequestParam("gridId")String gridId){
return new Result<List<String>>().ok(customerStaffGridService.getAllStaffByGridId(gridId));
}
}

16
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/GridController.java

@ -7,6 +7,7 @@ import com.epmet.commons.tools.enums.RequirePermissionEnum;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.dto.CustomerGridDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
@ -226,4 +227,19 @@ public class GridController {
ValidatorUtils.validateEntity(formDTO);
return new Result<List<GridTreeResultDTO>>().ok(customerGridService.getGridTree(formDTO));
}
/**
* 弃用网格
* @param formDTO
* @return
*/
@RequirePermission(requirePermission = RequirePermissionEnum.ORG_GRID_DELETE)
@PostMapping("abandon")
public Result abandonGrid(@LoginUser TokenDto tokenDto,@RequestBody AbandonGridFormDTO formDTO){
formDTO.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO, AddGroup.class);
customerGridService.abandonGrid(formDTO);
return new Result();
}
}

21
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java

@ -19,9 +19,6 @@ package com.epmet.controller;
import cn.afterturn.easypoi.excel.entity.TemplateExportParams;
import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelReader;
import com.alibaba.excel.read.metadata.ReadSheet;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.constant.NumConstant;
@ -32,40 +29,32 @@ import com.epmet.commons.tools.feign.ResultDataResolver;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.constant.ImportErrorMsgConstants;
import com.epmet.constants.ImportTaskConstants;
import com.epmet.dao.IcBuildingDao;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.dto.result.HouseInfoDTO;
import com.epmet.dto.result.IcNeighborHoodResultDTO;
import com.epmet.dto.result.ImportTaskCommonResultDTO;
import com.epmet.dto.result.LoginUserDetailsResultDTO;
import com.epmet.excel.IcHouseExcel;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.model.HouseInfoModel;
import com.epmet.model.ImportHouseInfoListener;
import com.epmet.redis.IcHouseRedis;
import com.epmet.service.HouseService;
import com.epmet.service.IcHouseService;
import com.epmet.service.IcNeighborHoodService;
import com.epmet.util.ExcelPoiUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.tomcat.util.http.MimeHeaders;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.support.StandardMultipartHttpServletRequest;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Field;
import java.util.*;
import java.util.concurrent.CompletableFuture;
import java.util.stream.Collectors;
@ -283,7 +272,7 @@ public class HouseController implements ResultDataResolver {
input.setTaskId(importTask.getData().getTaskId());
input.setProcessStatus(ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL);
epmetCommonServiceOpenFeignClient.finishImportTask(input);
log.error("读取文件失败");
log.error("读取文件失败",e);
}
houseService.dispose(inputStream,formDTO,importTask);
return new Result<>();

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

@ -84,7 +84,7 @@ public class IcPartyServiceCenterController {
return new Result();
}
@DeleteMapping
@PostMapping("del")
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");

10
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java

@ -306,5 +306,15 @@ public interface CustomerAgencyDao extends BaseDao<CustomerAgencyEntity> {
OrgMobileResultDTO getAgencyMobile(@Param("gridId") String gridId);
int updateSubAgencyAreaCodeById(@Param("customerId")String customerId, @Param("agencyId")String agencyId, @Param("operateUserId") String operateUserId);
/**
* Desc: 查询组织下的社区
* @param customerId
* @param agencyId
* @author zxc
* @date 2022/3/21 15:23
*/
List<CommunityListResultDTO> getCommunityList(@Param("customerId")String customerId, @Param("agencyId")String agencyId);
}

14
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java

@ -172,7 +172,7 @@ public interface CustomerGridDao extends BaseDao<CustomerGridEntity> {
BelongGridNameResultDTO getGridNameByGridId(BelongGridNameFormDTO formDTO);
/**
* @Description 根据组织机关Id查询机关下网格列表
* @Description 根据组织机关Id查询机关下网格列表:未废弃的
* @author sun
*/
List<GridListResultDTO> selectGridList(@Param("agencyId") String agencyId);
@ -367,11 +367,19 @@ public interface CustomerGridDao extends BaseDao<CustomerGridEntity> {
List<CustomerStaffGridResultDTO> getStaffGridList(@Param("customerId") String customerId, @Param("orgId") String orgId, @Param("orgType") String orgType);
/**
* @Description 根据网格名字查询网格信息
* @param names
* @Description 根据网格名字查询网格信息
* @author zxc
* @date 2022/2/12 2:06 下午
*/
List<InfoByNamesResultDTO> selectGridInfoByNames(@Param("names")List<String> names,@Param("customerId")String customerId);
List<InfoByNamesResultDTO> selectGridInfoByNames(@Param("names") List<String> names, @Param("customerId") String customerId);
/**
* desc:修改网格工作人员数量
*
* @param gridId
* @param incrCount 增加人数 负数为 -
* @return
*/
int updateTotalUser(@Param("gridId") String gridId, @Param("incrCount") long incrCount);
}

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffAgencyDao.java

@ -88,7 +88,7 @@ public interface CustomerStaffAgencyDao extends BaseDao<CustomerStaffAgencyEntit
* @return com.epmet.dto.result.ActSponsorResultDTO
* @param staffId
* @author yinzuomei
* @description 根据staffId查询我所在的网格信息
* @description 根据staffId查询我所在的网格信息限制网格是未废弃的网格
* @Date 2020/7/23 21:04
**/
List<ActSponsorGridInfo> selectActSponsorGrid(String staffId);

23
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffGridDao.java

@ -19,8 +19,8 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.CustomerGridDTO;
import com.epmet.dto.CustomerStaffDepartmentDTO;
import com.epmet.dto.CustomerStaffGridDTO;
import com.epmet.dto.StaffOrgRelationDTO;
import com.epmet.dto.form.LatestGridFormDTO;
import com.epmet.dto.result.EventTitleOrgResultDTO;
import com.epmet.dto.result.GridStaffResultDTO;
@ -28,12 +28,11 @@ import com.epmet.entity.CustomerStaffGridEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
/**
* 网格人员关系表
* 网格人员关系表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-04-20
@ -115,4 +114,20 @@ public interface CustomerStaffGridDao extends BaseDao<CustomerStaffGridEntity> {
* @date 2021/8/5 5:36 下午
*/
List<EventTitleOrgResultDTO> eventOrg(@Param("userId") String userId);
}
/**
* desc:根据网格id 获取网格下的工作人员及其添加关系
* @param gridId
* @return
*/
List<StaffOrgRelationDTO> getGridStaffList(String gridId);
/**
* Desc: 查询网格下所有的工作人员
* @param gridId
* @author zxc
* @date 2022/3/21 16:02
*/
List<String> getAllStaffByGridId(String gridId);
}

3
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingDao.java

@ -22,6 +22,7 @@ import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.ImportGeneralDTO;
import com.epmet.dto.result.BaseInfoFamilyBuildingResultDTO;
import com.epmet.dto.result.BuildingResultDTO;
import com.epmet.dto.result.ExistHouseInfoResultDTO;
import com.epmet.dto.result.UpdateBuildingHouseNumResultDTO;
import com.epmet.entity.CustomerAgencyEntity;
import com.epmet.entity.IcBuildingEntity;
@ -161,7 +162,7 @@ public interface IcBuildingDao extends BaseDao<IcBuildingEntity> {
* @author zxc
* @date 2022/2/14 5:32 下午
*/
List<String> selectExistHouse(@Param("ids")List<String> ids);
List<ExistHouseInfoResultDTO> selectExistHouse(@Param("ids")List<String> ids);
/**
* Desc: 查询客户下户数为空的

26
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java

@ -1,24 +1,8 @@
/**
* 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.dao;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.ImportGeneralDTO;
import com.epmet.dto.result.HouseInfoDTO;
import com.epmet.dto.result.NeighborHoodManageDelResultDTO;
import com.epmet.entity.IcHouseEntity;
@ -100,4 +84,12 @@ public interface IcHouseDao extends BaseDao<IcHouseEntity> {
*/
List<String> selectHouseNames(@Param("ids")List<String> ids);
/**
* Desc: 批量更新房屋信息
* @param houses
* @author zxc
* @date 2022/3/25 10:22
*/
void houseUpdate(@Param("houses") List<ImportGeneralDTO> houses);
}

27
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPartyServiceCenterDao.java

@ -19,12 +19,14 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.result.AllMattersResultDTO;
import com.epmet.dto.result.DelPartyServiceCenterResultDTO;
import com.epmet.dto.result.PartyServiceCenterListResultDTO;
import com.epmet.entity.IcPartyServiceCenterEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* 党群服务中心
@ -61,4 +63,29 @@ public interface IcPartyServiceCenterDao extends BaseDao<IcPartyServiceCenterEnt
List<AllMattersResultDTO> getAllMattersByOrgId(@Param("matterIds")List<String> matterIds);
/**
* Desc: 根据党群服务中心查询可预约事项ID
* @param centerIds
* @author zxc
* @date 2022/3/15 9:33 上午
*/
List<String> selectMatterByIds(@Param("centerIds")List<String> centerIds);
/**
* Desc: 根据事项ID查询预约记录
* @param matterIds
* @author zxc
* @date 2022/3/15 9:46 上午
*/
List<DelPartyServiceCenterResultDTO> selectAppointmentList(@Param("matterIds")List<String> matterIds);
/**
* Desc: 删除可预约事项
* @param centerIds
* @author zxc
* @date 2022/3/15 1:37 下午
*/
void delMatters(@Param("centerIds")List<String> centerIds);
}

5
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerGridEntity.java

@ -109,4 +109,9 @@ public class CustomerGridEntity extends BaseEpmetEntity {
* 联系电话
*/
private String mobile;
/**
* 弃用1正常使用0
*/
private Integer abandonFlag;
}

34
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java

@ -3,28 +3,14 @@ package com.epmet.feign;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.*;
import com.epmet.dto.CustomerStaffDTO;
import com.epmet.dto.CustomerStaffGridDTO;
import com.epmet.dto.StaffGridListDTO;
import com.epmet.dto.form.AddDepartmentStaffFormDTO;
import com.epmet.dto.form.DepartmentInStaffFormDTO;
import com.epmet.dto.form.StaffInfoFromDTO;
import com.epmet.dto.form.StaffSubmitFromDTO;
import com.epmet.dto.form.StaffsInAgencyFromDTO;
import com.epmet.dto.result.DepartInStaffListResultDTO;
import com.epmet.dto.result.StaffDetailResultDTO;
import com.epmet.dto.result.StaffInfoResultDTO;
import com.epmet.dto.result.StaffInitResultDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.dto.CustomerStaffDTO;
import com.epmet.dto.CustomerStaffGridDTO;
import com.epmet.dto.StaffGridListDTO;
import com.epmet.feign.fallback.EpmetUserFeignClientFallBack;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
@ -169,4 +155,22 @@ public interface EpmetUserFeignClient {
**/
@PostMapping(value = "/epmetuser/customerstaff/getcustomerstafflist", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
Result<CustomerStaffListResultDTO> getCustomerStaffList(List<String> staffIdList);
/**
* desc:删除审核中的徽章认证记录-弃用网格是调用
* @param customerId
* @param gridId
* @return
*/
@PostMapping("/epmetuser/badge/deleteBadgeCertificateAuditing")
Result<Integer> deleteBadgeCertificateAuditing(@RequestParam("customerId") String customerId, @RequestParam("gridId") String gridId);
/**
* desc:删除弃用网格的访问记录-弃用网格是调用
* @param customerId
* @param gridId
* @return
*/
@PostMapping("/epmetuser/gridlatest/deleteGridLatestData")
Result<Integer> deleteGridLatestData(@RequestParam("customerId") String customerId, @RequestParam("gridId") String gridId);
}

25
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java

@ -4,23 +4,8 @@ import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.*;
import com.epmet.dto.CustomerStaffDTO;
import com.epmet.dto.CustomerStaffGridDTO;
import com.epmet.dto.StaffGridListDTO;
import com.epmet.dto.form.AddDepartmentStaffFormDTO;
import com.epmet.dto.form.DepartmentInStaffFormDTO;
import com.epmet.dto.form.StaffInfoFromDTO;
import com.epmet.dto.form.StaffSubmitFromDTO;
import com.epmet.dto.form.StaffsInAgencyFromDTO;
import com.epmet.dto.result.DepartInStaffListResultDTO;
import com.epmet.dto.result.StaffDetailResultDTO;
import com.epmet.dto.result.StaffInfoResultDTO;
import com.epmet.dto.result.StaffInitResultDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.dto.CustomerStaffDTO;
import com.epmet.dto.CustomerStaffGridDTO;
import com.epmet.dto.StaffGridListDTO;
import com.epmet.feign.EpmetUserFeignClient;
import org.springframework.stereotype.Component;
@ -106,4 +91,14 @@ public class EpmetUserFeignClientFallBack implements EpmetUserFeignClient {
public Result<CustomerStaffListResultDTO> getCustomerStaffList(List<String> staffIdList) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getCustomerStaffList", staffIdList);
}
@Override
public Result<Integer> deleteBadgeCertificateAuditing(String customerId, String gridId) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "deleteBadgeCertificateAuditing", customerId, gridId);
}
@Override
public Result<Integer> deleteGridLatestData(String customerId, String gridId) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "deleteGridLatestData", customerId, gridId);
}
}

20
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportBuildingInfoListener.java

@ -142,10 +142,14 @@ public class ImportBuildingInfoListener extends AnalysisEventListener<BuildingIn
for (ImportGeneralDTO r : needDisposeList) {
if (k.equals(r.getAgencyName() + "_" + r.getGridName() + "_" +
r.getNeighborHoodName() + "_" + r.getBuildingName())){
// 集合里重复的
nums.add(r.getNum());
disposeErrorMsg(info,ImportErrorMsgConstants.EXIST_ERROR);
r.setExistStatus(true);
if (!r.getAddStatus()){
// 集合里重复的
nums.add(r.getNum());
BuildingInfoModel buildingInfoModel = ConvertUtils.sourceToTarget(r, BuildingInfoModel.class);
disposeErrorMsg(buildingInfoModel,ImportErrorMsgConstants.EXIST_ERROR);
r.setExistStatus(true);
r.setAddStatus(true);
}
}
}
}
@ -158,8 +162,12 @@ public class ImportBuildingInfoListener extends AnalysisEventListener<BuildingIn
List<ImportGeneralDTO> existList = groupByBuildingExistStatus.get(true);
if (!CollectionUtils.isEmpty(existList)){
existList.forEach(e -> {
nums.add(e.getNum());
disposeErrorMsg(info,ImportErrorMsgConstants.EXIST_ERROR);
if (!e.getAddStatus()){
nums.add(e.getNum());
BuildingInfoModel buildingInfoModel = ConvertUtils.sourceToTarget(e, BuildingInfoModel.class);
disposeErrorMsg(buildingInfoModel,ImportErrorMsgConstants.EXIST_ERROR);
e.setAddStatus(true);
}
});
}
}

69
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportHouseInfoListener.java

@ -15,6 +15,7 @@ import com.epmet.dao.IcBuildingDao;
import com.epmet.dto.ImportGeneralDTO;
import com.epmet.dto.form.ImportInfoFormDTO;
import com.epmet.dto.form.ImportTaskCommonFormDTO;
import com.epmet.dto.result.ExistHouseInfoResultDTO;
import com.epmet.dto.result.ImportResultDTO;
import com.epmet.dto.result.UpdateBuildingHouseNumResultDTO;
import com.epmet.entity.IcHouseEntity;
@ -48,6 +49,7 @@ public class ImportHouseInfoListener extends AnalysisEventListener<HouseInfoMode
List<ImportGeneralDTO> needDisposeList = new ArrayList<>();
List<ImportGeneralDTO> needInsertList = new ArrayList<>();
List<ImportGeneralDTO> needUpdateList = new ArrayList<>();
String gridName = null;
String agencyName = null;
@ -125,21 +127,6 @@ public class ImportHouseInfoListener extends AnalysisEventListener<HouseInfoMode
disposeErrorMsg(info, "是否出租的值未填写");
return;
}
if(StringUtils.isBlank(data.getOwnerIdCard())){
nums.add(num);
disposeErrorMsg(info, "房主身份证的值未填写");
return;
}
if(StringUtils.isBlank(data.getOwnerName())){
nums.add(num);
disposeErrorMsg(info, "房主姓名的值未填写");
return;
}
if(StringUtils.isBlank(data.getOwnerPhone())){
nums.add(num);
disposeErrorMsg(info, "房主电话的值未填写");
return;
}
if(StringUtils.isBlank(data.getDoorName())){
nums.add(num);
disposeErrorMsg(info, "门牌号的值未填写");
@ -208,29 +195,46 @@ public class ImportHouseInfoListener extends AnalysisEventListener<HouseInfoMode
if (CollectionUtils.isEmpty(needInsertList)){
return;
}
// 根据单元ID_doorName查询已存在的
List<String> ids = needInsertList.stream().filter(n -> StringUtils.isNotBlank(n.getBuildingUnitId())).map(m -> m.getBuildingUnitId() + "_" + m.getDoorName()).distinct().collect(Collectors.toList());
List<ExistHouseInfoResultDTO> existHouses = icBuildingDao.selectExistHouse(ids);
Map<String, Long> collect = needInsertList.stream().collect(Collectors.groupingBy(n -> n.getBuildingUnitId() + "_" + n.getDoorName(), Collectors.counting()));
collect.forEach((k,v) -> {
if (Integer.valueOf(v.toString()).compareTo(1) > 0){
if (Integer.valueOf(v.toString()).compareTo(1) != 0){
for (ImportGeneralDTO r : needInsertList) {
if (k.equals(r.getBuildingUnitId()+"_"+r.getDoorName())){
// 集合里重复的
nums.add(r.getNum());
/*nums.add(r.getNum());
disposeErrorMsg(info,ImportErrorMsgConstants.EXIST_ERROR);
r.setExistStatus(true);
r.setExistStatus(true);*/
if (!r.getAddStatus()){
for (ExistHouseInfoResultDTO existHouse : existHouses) {
if (existHouse.getName().equals(r.getBuildingUnitId()+"_"+r.getDoorName())){
r.setHouseId(existHouse.getHouseId());
break;
}
}
needUpdateList.add(r);
r.setAddStatus(true);
r.setExistStatus(true);
}
}
}
}
});
// 根据单元ID_doorName查询已存在的
List<String> ids = needInsertList.stream().filter(n -> StringUtils.isNotBlank(n.getBuildingUnitId())).map(m -> m.getBuildingUnitId() + "_" + m.getDoorName()).distinct().collect(Collectors.toList());
List<String> existHouses = icBuildingDao.selectExistHouse(ids);
existHouses.forEach(e -> {
for (ImportGeneralDTO n : needInsertList) {
if ((n.getBuildingUnitId()+"_"+n.getDoorName()).equals(e)){
if ((n.getBuildingUnitId()+"_"+n.getDoorName()).equals(e.getName())){
// 库里存在的
nums.add(n.getNum());
disposeErrorMsg(info,ImportErrorMsgConstants.EXIST_ERROR);
n.setExistStatus(true);
// nums.add(n.getNum());
// disposeErrorMsg(info,ImportErrorMsgConstants.EXIST_ERROR);
// n.setExistStatus(true);
if (!n.getAddStatus()){
n.setHouseId(e.getHouseId());
needUpdateList.add(n);
n.setAddStatus(true);
n.setExistStatus(true);
}
}
}
});
@ -238,6 +242,7 @@ public class ImportHouseInfoListener extends AnalysisEventListener<HouseInfoMode
Map<Boolean, List<ImportGeneralDTO>> groupByExistStatus = needInsertList.stream().collect(Collectors.groupingBy(ImportGeneralDTO::getExistStatus));
List<ImportGeneralDTO> importGeneralDTOS = groupByExistStatus.get(false);
houseInsert(importGeneralDTOS);
houseUpdate(needUpdateList);
// 清除
needDisposeList = new ArrayList<>();
needInsertList = new ArrayList<>();
@ -526,13 +531,16 @@ public class ImportHouseInfoListener extends AnalysisEventListener<HouseInfoMode
public void doAfterAllAnalysed(AnalysisContext context) {
finalDispose();
// 更新ic_building户数
List<String> list = icBuildingDao.selectHouseTotalIsNull(formDTO.getCustomerId());
/**
* 2022-03-25 又根据要求注释更新ic_building户数
*/
/*List<String> list = icBuildingDao.selectHouseTotalIsNull(formDTO.getCustomerId());
if (!CollectionUtils.isEmpty(list)){
List<UpdateBuildingHouseNumResultDTO> houseNum = icBuildingDao.selectHouseNum(list);
if (!CollectionUtils.isEmpty(houseNum)){
icBuildingDao.allUpdateHouseNum(houseNum);
}
}
}*/
// 删除缓存
icHouseRedis.delTemporaryCacheGrids(formDTO.getCustomerId(), formDTO.getUserId());
icHouseRedis.delTemporaryCacheNeighBorHood(formDTO.getCustomerId(), formDTO.getUserId());
@ -576,4 +584,11 @@ public class ImportHouseInfoListener extends AnalysisEventListener<HouseInfoMode
}
}
@Transactional(rollbackFor = Exception.class)
public void houseUpdate(List<ImportGeneralDTO> houses){
if (!CollectionUtils.isEmpty(houses)){
icHouseService.houseUpdate(houses);
}
}
}

20
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportNeighborHoodInfoListener.java

@ -136,10 +136,14 @@ public class ImportNeighborHoodInfoListener extends AnalysisEventListener<Neighb
if (Integer.valueOf(v.toString()).compareTo(1) > 0){
for (ImportGeneralDTO r : needDisposeList) {
if (k.equals(r.getAgencyName() + "_" + r.getGridName() + "_" + r.getNeighborHoodName())){
// 集合里重复的
nums.add(r.getNum());
disposeErrorMsg(info, ImportErrorMsgConstants.EXIST_ERROR);
r.setExistStatus(true);
if (!r.getAddStatus()){
// 集合里重复的
nums.add(r.getNum());
NeighborHoodInfoModel neighborHoodInfoModel = ConvertUtils.sourceToTarget(r, NeighborHoodInfoModel.class);
disposeErrorMsg(neighborHoodInfoModel, ImportErrorMsgConstants.EXIST_ERROR);
r.setExistStatus(true);
r.setAddStatus(true);
}
}
}
}
@ -152,8 +156,12 @@ public class ImportNeighborHoodInfoListener extends AnalysisEventListener<Neighb
List<ImportGeneralDTO> existList = groupByBuildingExistStatus.get(true);
if (!CollectionUtils.isEmpty(existList)){
existList.forEach(e -> {
nums.add(e.getNum());
disposeErrorMsg(info,ImportErrorMsgConstants.EXIST_ERROR);
if (!e.getAddStatus()){
nums.add(e.getNum());
NeighborHoodInfoModel neighborHoodInfoModel = ConvertUtils.sourceToTarget(e, NeighborHoodInfoModel.class);
disposeErrorMsg(neighborHoodInfoModel,ImportErrorMsgConstants.EXIST_ERROR);
e.setAddStatus(true);
}
});
}
List<ImportGeneralDTO> notExistList = groupByBuildingExistStatus.get(false);

25
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java

@ -1,20 +1,3 @@
/**
* 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.service;
import com.epmet.commons.tools.security.dto.TokenDto;
@ -156,4 +139,12 @@ public interface AgencyService {
*/
List<SonOrgResultDTO> getSonAgencyId(String orgId,String type);
/**
* Desc: 查询工作人员所属组织下的所有社区
* @param tokenDto
* @author zxc
* @date 2022/3/21 15:13
*/
List<CommunityListResultDTO> getCommunityList(TokenDto tokenDto);
}

13
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java

@ -374,4 +374,17 @@ public interface CustomerGridService extends BaseService<CustomerGridEntity> {
* @date 2022/1/17 3:50 下午
*/
List<CustomerStaffGridResultDTO> getStaffGridList(String customerId, String orgId, String orgType);
/**
* 弃用网格前置条件查询
* @param formDTO
* @return
*/
void abandonGrid(AbandonGridFormDTO formDTO);
/**
* desc:移除网格内的工作人员关系 并迁移到组织
* @param formDTO
*/
void abandonGridForDealBizData(AbandonGridFormDTO formDTO);
}

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

@ -135,4 +135,13 @@ public interface CustomerStaffGridService extends BaseService<CustomerStaffGridE
* @date 2021/8/5 5:36 下午
*/
List<EventTitleOrgResultDTO> eventOrg(String userId);
/**
* Desc: 查询网格下所有的工作人员
* @param gridId
* @author zxc
* @date 2022/3/21 16:02
*/
List<String> getAllStaffByGridId(String gridId);
}

26
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcHouseService.java

@ -1,20 +1,3 @@
/**
* 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.service;
import com.epmet.commons.mybatis.service.BaseService;
@ -22,6 +5,7 @@ import com.epmet.commons.tools.dto.result.OptionResultDTO;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.dto.IcHouseDTO;
import com.epmet.dto.ImportGeneralDTO;
import com.epmet.dto.form.HouseFormDTO;
import com.epmet.dto.result.HouseListResultDTO;
import com.epmet.entity.IcHouseEntity;
@ -124,4 +108,12 @@ public interface IcHouseService extends BaseService<IcHouseEntity> {
*/
List<HouseListResultDTO> getHouseList(TokenDto tokenDto, HouseFormDTO formDTO);
/**
* Desc: 批量更新房屋信息
* @param houses
* @author zxc
* @date 2022/3/25 10:22
*/
void houseUpdate(List<ImportGeneralDTO> houses);
}

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffService.java

@ -89,7 +89,7 @@ public interface StaffService {
* @return com.epmet.dto.result.MineResultDTO
*/
MineResultDTO mine(StaffInfoFromDTO fromDTO);
/**
* 工作人员调动
* @author zhaoqifeng

34
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java

@ -26,7 +26,9 @@ import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.security.user.LoginUserUtil;
import com.epmet.commons.tools.utils.ConvertUtils;
@ -165,6 +167,8 @@ public class AgencyServiceImpl implements AgencyService {
originalEntity.setLongitude(formDTO.getLongitude());
}
originalEntity.setCenterAddress(formDTO.getCenterAddress());
//平阴的工作端小程序与产品入参有差距,为了接口兼容,这个参数不让前端传了...
formDTO.setAreaCodeSwitch(customerOrgParameterService.getAreaCodeSwitch(formDTO.getCustomerId()));
//当前客户开启了area_code_switch参数:open: 选择地区编码必填;closed: 无需选择地区编码
if (CustomerAgencyConstant.AREA_CODE_SWITCH_OPEN.equals(formDTO.getAreaCodeSwitch())) {
CustomerAgencyEntity parent = customerAgencyDao.selectById(originalEntity.getPid());
@ -182,7 +186,7 @@ public class AgencyServiceImpl implements AgencyService {
}
//什么时候要全部置为空呢?原来没有现在有 || 原来与现在不一致
if ((StringUtils.isBlank(originalAreaCode) && StringUtils.isNotBlank(formDTO.getAreaCode()))
|| (!formDTO.getAreaCode().equals(originalAreaCode))) {
|| (StringUtils.isNotBlank(formDTO.getAreaCode()) && !formDTO.getAreaCode().equals(originalAreaCode))) {
updateSubOrg(originalEntity.getCustomerId(), formDTO, originalAreaCode);
}
}
@ -317,12 +321,13 @@ public class AgencyServiceImpl implements AgencyService {
private void checkEditAgencyFormDTO(EditAgencyFormDTO formDTO,CustomerAgencyEntity originalEntity) {
//根组织不允许修改
if (StringUtils.isNotBlank(originalEntity.getPid()) && !NumConstant.ZERO_STR.equals(originalEntity.getPid())) {
if (StringUtils.isBlank(formDTO.getAreaCode())) {
//03.23:平阴线上版本与产品主线版本差距太大,平阴的修改组织只能修改组织名称。
/*if (StringUtils.isBlank(formDTO.getAreaCode())) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "area_code_switch is open areaCode不能为空", "组织区划不能为空");
}
if (StringUtils.isBlank(formDTO.getParentAreaCode())) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "area_code_switch is open parentAreaCode不能为空", "请先设置上级组织的组织区划");
}
}*/
//如果当前组织已经使用了自定义编码,不允许在选择其他。
if (StringUtils.isNotBlank(originalEntity.getAreaCode())
&& originalEntity.getAreaCode().contains("UD")
@ -798,6 +803,29 @@ public class AgencyServiceImpl implements AgencyService {
return new ArrayList<>();
}
/**
* Desc: 查询工作人员所属组织下的所有社区
* @param tokenDto
* @author zxc
* @date 2022/3/21 15:13
*/
@Override
public List<CommunityListResultDTO> getCommunityList(TokenDto tokenDto) {
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId());
if (null == staffInfo){
throw new EpmetException("未查询到工作人员信息"+staffInfo.getStaffId());
}
String agencyId = staffInfo.getAgencyId();
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(agencyId);
if (null == agencyInfo){
throw new EpmetException("查询组织信息失败"+agencyInfo);
}
if (agencyInfo.getLevel().equals(CustomerAgencyConstant.COMMUNITY_LEVEL)){
return new ArrayList<>();
}
return customerAgencyDao.getCommunityList(tokenDto.getCustomerId(), agencyId);
}
private CustomerAgencyEntity constructInsertEntity(AddAgencyV2FormDTO formDTO, CustomerAgencyDTO parent) {
CustomerAgencyEntity insertEntity = ConvertUtils.sourceToTarget(formDTO, CustomerAgencyEntity.class);
insertEntity.setOrganizationName(formDTO.getAgencyName());

8
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java

@ -250,6 +250,7 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao
}
//3:根据组织Id查询该组织下网格、人员列表
//3.1:查询组织下网格列表
// 未隐藏的网格
List<GridListResultDTO> gridList = customerGridDao.selectGridList(canTick.getAgencyId());
List<CustomerStaffGridDTO> gridStaffs = new ArrayList<>();
if (null != gridList && gridList.size() > NumConstant.ZERO) {
@ -438,7 +439,7 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao
});
}
//3:根据组织Id查询该组织下网格、人员列表
//3.1:查询组织下网格列表
//3.1:查询组织下网格列表:未废弃的
List<GridListResultDTO> gridList = customerGridDao.selectGridList(canTick.getAgencyId());
List<CustomerStaffGridDTO> gridStaffs = new ArrayList<>();
if (null != gridList && gridList.size() > NumConstant.ZERO) {
@ -728,6 +729,7 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao
if (party) {
//4.1:查询当前机关的网格列表以及所有下级机关的网格列表
//当前机关下网格列表
// 未隐藏的网格
List<AgencyGridListResultDTO> gridList = customerGridDao.selectAgencyGridList(agencyEntity.getId());
returnDTO.setGridList(gridList);
//递归查询当前组织的下级组织以及每个下级组织对应的网格列表
@ -762,6 +764,7 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao
List<ArticleGridResultDTO> subAgencyList = baseDao.selectAllSubAgency(subAgencyPids);
if (subAgencyList.size() > NumConstant.ZERO) {
for (ArticleGridResultDTO sub : subAgencyList) {
//未隐藏的网格
List<AgencyGridListResultDTO> gridList = customerGridDao.selectAgencyGridList(sub.getAgencyId());
sub.setGridList(gridList);
List<ArticleGridResultDTO> subAgency = getGridList(sub.getPids() + ":" + sub.getAgencyId());
@ -826,11 +829,13 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao
List<AgencyDeptList> agencyDeptList = customerDepartmentDao.selectAgencyDeptMsgList(agencyEntity.getId());
returnDTO.setAgencyDeptList(agencyDeptList);
//当前机关下网格列表
// 未隐藏的网格
List<AgencyGridList> agencyGridList = customerGridDao.selectAgencyGridMsgList(agencyEntity.getId());
returnDTO.setAgencyGridList(agencyGridList);
} else if (gridParty) {
//4.2:查询人员在当前机关下参与的网格列表
//查询当前组织下的网格列表
//未隐藏的网格
List<AgencyGridListResultDTO> gridList = customerGridDao.selectAgencyGridList(agencyEntity.getId());
//查询该工作人员在该客户下参与的网格列表
CustomerStaffGridDTO staffGridDTO = new CustomerStaffGridDTO();
@ -867,6 +872,7 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao
resultDTO.setAgencyId(customerAgency.getId());
resultDTO.setAgencyName(customerAgency.getOrganizationName());
}
//限制网格是未废弃的网格
List<ActSponsorGridInfo> list=customerStaffAgencyDao.selectActSponsorGrid(staffId);
resultDTO.setAgencyGridList(list);
return resultDTO;

146
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java

@ -18,8 +18,10 @@
package com.epmet.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
@ -27,26 +29,32 @@ import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.result.OptionResultDTO;
import com.epmet.commons.tools.enums.DictTypeEnum;
import com.epmet.commons.tools.enums.OrgTypeEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.RedisKeys;
import com.epmet.commons.tools.redis.RedisUtils;
import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.redis.common.bean.GridInfoCache;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.security.user.LoginUserUtil;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.CustomerGridConstant;
import com.epmet.dao.CustomerGridDao;
import com.epmet.dao.CustomerStaffGridDao;
import com.epmet.dao.StaffOrgRelationDao;
import com.epmet.dto.*;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.entity.CustomerGridEntity;
import com.epmet.feign.EpmetAdminOpenFeignClient;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.feign.EpmetUserFeignClient;
import com.epmet.feign.OperCrmOpenFeignClient;
import com.epmet.entity.CustomerStaffGridEntity;
import com.epmet.entity.StaffOrgRelationEntity;
import com.epmet.feign.*;
import com.epmet.resi.partymember.feign.ResiPartyMemberOpenFeignClient;
import com.epmet.service.CustomerAgencyService;
import com.epmet.service.CustomerGridService;
import com.epmet.util.ModuleConstant;
@ -86,11 +94,26 @@ public class CustomerGridServiceImpl extends BaseServiceImpl<CustomerGridDao, Cu
@Autowired
private CustomerGridDao customerGridDao;
@Autowired
private RedisUtils redisUtils;
private StaffOrgRelationDao staffOrgRelationDao;
@Autowired
private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient;
private RedisUtils redisUtils;
@Autowired
private EpmetAdminOpenFeignClient adminOpenFeignClient;
@Autowired
private LoginUserUtil loginUserUtil;
//迁移网格
@Autowired
private GovIssueOpenFeignClient govIssueOpenFeignClient;
@Autowired
private GovProjectOpenFeignClient govProjectOpenFeignClient;
@Autowired
private ResiPartyMemberOpenFeignClient resiPartyMemberOpenFeignClient;
@Autowired
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Override
public PageData<CustomerGridDTO> page(Map<String, Object> params) {
@ -802,14 +825,6 @@ public class CustomerGridServiceImpl extends BaseServiceImpl<CustomerGridDao, Cu
if (null != gridInfo) {
redisUtils.hMSet(redisKey, BeanUtil.beanToMap(gridInfo));
}
/*CustomerGridDTO gridInfo = ConvertUtils.sourceToTarget(baseDao.selectById(customerGridFormDTO.getGridId()), CustomerGridDTO.class);
if (null != gridInfo) {
CustomerAgencyEntity agency = customerAgencyService.selectById(gridInfo.getPid());
gridInfo.setAgencyName(null != agency ? agency.getOrganizationName() : "");
gridInfo.setGridNamePath(null != agency ? agency.getOrganizationName().concat("-").concat(gridInfo.getGridName()) : gridInfo.getGridName());
redisUtils.hMSet(redisKey, BeanUtil.beanToMap(gridInfo));
}*/
return gridInfo;
}
@ -945,4 +960,107 @@ public class CustomerGridServiceImpl extends BaseServiceImpl<CustomerGridDao, Cu
return baseDao.getStaffGridList(customerId,orgId,orgType);
}
/**
* 弃用网格
*
* @param formDTO
* @return
*/
@Override
public void abandonGrid(AbandonGridFormDTO formDTO) {
//未处理的事件
Result<ProjectAuditResetResultDTO> projectDb = govProjectOpenFeignClient.eventAuditReset(formDTO.getGridId());
//表决中的议题
Result<Boolean> issueAuditReset = govIssueOpenFeignClient.issueAuditReset(formDTO.getGridId());
if (!projectDb.success() || !issueAuditReset.success()) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "校验数据异常", "服务器开小差了...");
}
if (projectDb.getData().getResiEventStatus()) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "存在未处理的事件", "该网格存在未办结的群众直报事件,请先将事件办结后再操作");
}
if (projectDb.getData().getProjectStatus()) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "存在未办结的项目", "该网格工作人员名下存在未结案的项目,请先将项目结案或转其它科室部门后再操作");
}
if (issueAuditReset.getData()) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "存在未关闭的议题", "该网格存在未关闭的议题,请先将议题关闭后再操作");
}
//可以弃用、处理数据(网格工作人员所属关系(网格工作人员人数), 删除正在审核中的徽章认证)
this.abandonGridForDealBizData(formDTO);
CustomerOrgRedis.delGridInfo(formDTO.getGridId());
}
@Override
public void abandonGridForDealBizData(AbandonGridFormDTO formDTO) {
try {
//根据网格id 获取网格内工作人员及其添加关系
List<StaffOrgRelationDTO> staffList = customerStaffGridDao.getGridStaffList(formDTO.getGridId());
if (staffList == null){
staffList = new ArrayList<>();
}
logger.debug("abandonGridForDealBizData staffList:{}", JSON.toJSONString(staffList));
List<StaffOrgRelationEntity> updateList = new ArrayList<>();
staffList.forEach(staffOrg->{
//只有工作人员是网格添加的才处理
if(!OrgTypeEnum.GRID.getCode().equals(staffOrg.getOrgType())) {
return;
}
StaffOrgRelationEntity entity = new StaffOrgRelationEntity();
entity.setId(staffOrg.getId());
entity.setOrgType(OrgTypeEnum.AGENCY.getCode());
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(staffOrg.getOrgId());
if (gridInfo == null || StringUtils.isBlank(gridInfo.getPid())) {
assert gridInfo != null;
log.error("abandonGridForDealBizData grid:{} pid is not exist", JSON.toJSONString(gridInfo));
return;
}
entity.setOrgId(gridInfo.getPid());
updateList.add(entity);
});
String customerId = loginUserUtil.getLoginUserCustomerId();
//更新工作人员组织关系
dealBizDataForAbandon(customerId,formDTO.getGridId(),formDTO.getUserId(), staffList, updateList);
//清空工作人员缓存
staffList.forEach(staff->CustomerStaffRedis.delStaffInfoFormCache(customerId,staff.getStaffId()));
} catch (Exception e) {
log.error("abandonGridForDealBizData exception", e);
throw e;
}
}
@Transactional
public void dealBizDataForAbandon(String customerId, String gridId, String userId,List<StaffOrgRelationDTO> staffList, List<StaffOrgRelationEntity> updateList) {
//1.删除工作人员与网格的关系
LambdaQueryWrapper<CustomerStaffGridEntity> updateWrapper = new LambdaQueryWrapper<>();
updateWrapper.eq(CustomerStaffGridEntity::getGridId,gridId);
customerStaffGridDao.delete(updateWrapper);
//2.修改 网格内添加工作人员改为组织
updateList.forEach(e->{
staffOrgRelationDao.update(e,null);
});
//网格对应的人数减少
long reduceCount = NumConstant.ZERO - staffList.stream().map(StaffOrgRelationDTO::getStaffId).distinct().count();
log.debug("dealBizDataForAbandon gridId:{} reduceCount:{}",gridId, reduceCount);
customerGridDao.updateTotalUser(gridId, reduceCount);
//删除正在审核中的徽章认证
Result<Integer> badgeResult = epmetUserFeignClient.deleteBadgeCertificateAuditing(customerId,gridId);
if (badgeResult == null || !badgeResult.success()){
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"删除未审核徽章失败,请稍后重试");
}
//删除废弃网格的访问记录
Result<Integer> gridLatestResult = epmetUserFeignClient.deleteGridLatestData(customerId,gridId);
if (gridLatestResult == null || !gridLatestResult.success()){
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"删除网格访问记录失败,请稍后重试");
}
//处理成功,隐藏网格
LambdaUpdateWrapper<CustomerGridEntity> updateGrid=new LambdaUpdateWrapper<>();
updateGrid.set(CustomerGridEntity::getAbandonFlag,NumConstant.ONE);
updateGrid.set(CustomerGridEntity::getUpdatedBy,userId);
updateGrid.set(CustomerGridEntity::getUpdatedTime,new Date());
updateGrid.eq(CustomerGridEntity::getId,gridId);
baseDao.update(null,updateGrid);
}
}

11
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffGridServiceImpl.java

@ -191,4 +191,15 @@ public class CustomerStaffGridServiceImpl extends BaseServiceImpl<CustomerStaffG
public List<EventTitleOrgResultDTO> eventOrg(String userId) {
return baseDao.eventOrg(userId);
}
/**
* Desc: 查询网格下所有的工作人员
* @param gridId
* @author zxc
* @date 2022/3/21 16:02
*/
@Override
public List<String> getAllStaffByGridId(String gridId) {
return baseDao.getAllStaffByGridId(gridId);
}
}

20
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java

@ -1,14 +1,12 @@
package com.epmet.service.impl;
import cn.afterturn.easypoi.excel.entity.TemplateExportParams;
import cn.hutool.core.bean.BeanUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelReader;
import com.alibaba.excel.read.metadata.ReadSheet;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.EpmetErrorCode;
@ -18,9 +16,8 @@ import com.epmet.commons.tools.feign.ResultDataResolver;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constants.ImportTaskConstants;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.CustomerGridConstant;
import com.epmet.constants.ImportTaskConstants;
import com.epmet.dao.IcBuildingDao;
import com.epmet.dao.IcBuildingUnitDao;
import com.epmet.dao.IcHouseDao;
@ -29,11 +26,7 @@ import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.dto.IcBuildingDTO;
import com.epmet.dto.IcBuildingUnitDTO;
import com.epmet.dto.IcHouseDTO;
import com.epmet.dto.form.IcHouseFormDTO;
import com.epmet.dto.form.ImportInfoFormDTO;
import com.epmet.dto.form.ImportTaskCommonFormDTO;
import com.epmet.dto.form.ListIcNeighborHoodFormDTO;
import com.epmet.dto.form.NeighborHoodManageDelFormDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.HouseInfoDTO;
import com.epmet.dto.result.IcNeighborHoodResultDTO;
import com.epmet.dto.result.ImportTaskCommonResultDTO;
@ -49,25 +42,17 @@ import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.model.HouseInfoModel;
import com.epmet.model.ImportHouseInfoListener;
import com.epmet.redis.IcHouseRedis;
import com.epmet.service.HouseService;
import com.epmet.service.IcBuildingService;
import com.epmet.service.IcBuildingUnitService;
import com.epmet.service.IcHouseService;
import com.epmet.service.*;
import com.epmet.util.ExcelPoiUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.util.*;
import java.util.concurrent.ExecutorService;
@ -376,6 +361,7 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
.build();
excelReader.read(readSheet);
} catch (Exception e){
log.error("dispose exception",e);
ImportTaskCommonFormDTO input = new ImportTaskCommonFormDTO();
input.setOperatorId(formDTO.getUserId());
input.setTaskId(importTask.getData().getTaskId());

32
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java

@ -1,20 +1,3 @@
/**
* 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.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@ -33,6 +16,7 @@ import com.epmet.dao.IcHouseDao;
import com.epmet.dto.IcHouseDTO;
import com.epmet.dto.IcResiCategoryStatsConfigDTO;
import com.epmet.dto.IcResiUserDTO;
import com.epmet.dto.ImportGeneralDTO;
import com.epmet.dto.form.HouseFormDTO;
import com.epmet.dto.result.HouseListResultDTO;
import com.epmet.entity.IcHouseEntity;
@ -141,7 +125,7 @@ public class IcHouseServiceImpl extends BaseServiceImpl<IcHouseDao, IcHouseEntit
return list.stream().map(item -> {
OptionResultDTO dto = new OptionResultDTO();
dto.setValue(item.getId());
dto.setLabel(item.getHouseName());
dto.setLabel(item.getDoorName());
return dto;
}).collect(Collectors.toList());
}
@ -235,4 +219,16 @@ public class IcHouseServiceImpl extends BaseServiceImpl<IcHouseDao, IcHouseEntit
}).collect(Collectors.toList());
}
/**
* Desc: 批量更新房屋信息
* @param houses
* @author zxc
* @date 2022/3/25 10:22
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void houseUpdate(List<ImportGeneralDTO> houses) {
baseDao.houseUpdate(houses);
}
}

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

@ -41,7 +41,6 @@ import com.epmet.constant.PartyServiceCenterConstant;
import com.epmet.dao.IcMatterAppointmentRecordDao;
import com.epmet.dao.IcPartyServiceCenterDao;
import com.epmet.dto.IcPartyServiceCenterDTO;
import com.epmet.dto.RegisterRelationDTO;
import com.epmet.dto.TimeDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
@ -63,6 +62,7 @@ import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
@ -130,8 +130,54 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl<IcPartyServ
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
List<String> centerIds = Arrays.asList(ids);
List<String> matterIds = baseDao.selectMatterByIds(centerIds);
if (CollectionUtils.isEmpty(matterIds)){
baseDao.deleteBatchIds(centerIds);
}else {
List<DelPartyServiceCenterResultDTO> appointmentList = baseDao.selectAppointmentList(matterIds);
if (CollectionUtils.isEmpty(appointmentList)){
baseDao.deleteBatchIds(centerIds);
baseDao.delMatters(centerIds);
}else {
List<String> names = new ArrayList<>();
Map<String, List<DelPartyServiceCenterResultDTO>> groupByMatterId = appointmentList.stream().collect(Collectors.groupingBy(DelPartyServiceCenterResultDTO::getMatterId));
groupByMatterId.forEach((k,v) -> {
if (getMatterAppointmentList(v)){
names.add(v.get(0).getCenterName());
}
});
if (CollectionUtils.isNotEmpty(names)){
// throw new EpmetException(names.stream().collect(Collectors.joining("、")) + "存在未来时间的预约事项,不允许删除");
throw new EpmetException(EpmetErrorCode.MATTER_EXISTS_APPOINTMENT_ERROR.getCode());
}
baseDao.deleteBatchIds(centerIds);
baseDao.delMatters(centerIds);
}
}
}
public boolean getMatterAppointmentList(List<DelPartyServiceCenterResultDTO> list){
AtomicBoolean result = new AtomicBoolean(false);
if (CollectionUtils.isNotEmpty(list)){
list.forEach(l -> {
int[] timeIds = Arrays.asList(l.getTimeId().split(",")).stream().mapToInt(m -> Integer.parseInt(m)).toArray();
List<String> intervalTimeList = getIntervalTimeList(l.getStartTime(), l.getEndTime(), 30);
for (int timeId : timeIds) {
for (int i1 = 0; i1 < intervalTimeList.size(); i1++) {
if (timeId == i1 + 1){
String date = l.getDate() + " " + intervalTimeList.get(i1) + ":00";
if (DateUtils.parse(date,DateUtils.DATE_TIME_PATTERN).after(new Date())){
result.set(true);
return;
}
}
}
}
});
}
return result.get();
}
/**

6
epmet-module/gov-org/gov-org-server/src/main/resources/bootstrap.yml

@ -127,6 +127,12 @@ hystrix:
isolation:
thread:
timeoutInMilliseconds: 60000 #缺省为1000
threadpool:
default:
coreSize: 20
maximumSize: 50
maxQueueSize: 500
queueSizeRejectionThreshold: 800
ribbon:
ReadTimeout: 300000

3
epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.13__abandon_grid.sql

@ -0,0 +1,3 @@
alter table customer_grid
add column ABANDON_FLAG TINYINT(1) NOT NULL default '0'
comment '弃用:1;正常使用:0' after SYNC_FLAG;

4
epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.14__ic_house_remove_owner.sql

@ -0,0 +1,4 @@
ALTER TABLE `epmet_gov_org`.`ic_house`
MODIFY COLUMN `OWNER_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '房主姓名' AFTER `RENT_FLAG`,
MODIFY COLUMN `OWNER_PHONE` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '房主电话' AFTER `OWNER_NAME`,
MODIFY COLUMN `OWNER_ID_CARD` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '房主身份证号' AFTER `OWNER_PHONE`;

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save