Browse Source

Merge branch 'dev' of http://git.elinkit.com.cn:7070/r/epmet-cloud into dev_bugfix_ljj

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

2
epmet-cloud-generator/src/main/resources/application.yml

@ -9,7 +9,7 @@ spring:
type: com.alibaba.druid.pool.DruidDataSource
#MySQL配置
driverClassName: com.mysql.jdbc.Driver
url: jdbc:mysql://192.168.1.140:3306/epmet_data_statistical?useUnicode=true&characterEncoding=UTF-8&useSSL=false
url: jdbc:mysql://118.190.150.119:43306/epmet_user?useUnicode=true&characterEncoding=UTF-8&useSSL=false
username: root
password: root
#oracle配置

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);
}
}

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

@ -166,6 +166,17 @@
<artifactId>transmittable-thread-local</artifactId>
<version>2.12.4</version>
</dependency>
<dependency>
<groupId>com.google.zxing</groupId>
<artifactId>core</artifactId>
<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.4.1</version>
</dependency>
</dependencies>
<build>

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;
}

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

@ -0,0 +1,183 @@
package com.epmet.commons.tools.utils;
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.MatrixToImageConfig;
import com.google.zxing.client.j2se.MatrixToImageWriter;
import com.google.zxing.common.BitMatrix;
import com.google.zxing.common.CharacterSetECI;
import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
import javax.imageio.ImageIO;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.util.HashMap;
/**
* Date 2021/08/27 16:01
* Description:二维码生成工具类
*/
public class BarcodeUtils {
/**
* 二维码颜色 默认是黑色
*/
private static final Color QRCOLOR = Color.black;
/**
* 背景颜色
*/
private static final Color BGWHITE = Color.white;
public static final int WIDTH = 360;
public static final int HEIGHT = 512;
public static final int MARGIN = 2;
public static final int FONTSIZE = 20;
/**
* // 二维码生成
*
* @param contents 说明
* @return BufferedImage
* @throws Exception
*/
public static BufferedImage drawQRImage(String pressText, String contents) throws Exception {
BufferedImage qRImage = null;
if (contents == null || "".equals(contents)) {
throw new Exception("content说明不能为空");
}
// 二维码参数设置
HashMap<EncodeHintType, Object> hints = new HashMap<>();
hints.put(EncodeHintType.CHARACTER_SET, CharacterSetECI.UTF8); // 编码设置
hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.H); // 安全等级,最高h
hints.put(EncodeHintType.MARGIN, MARGIN); // 设置margin=0-10
// 二维码图片的生成
BarcodeFormat format = BarcodeFormat.QR_CODE;
// 创建矩阵容器
BitMatrix matrix = null;
try {
matrix = new MultiFormatWriter().encode(contents, format, WIDTH, HEIGHT, hints);
} catch (WriterException e) {
e.printStackTrace();
}
// 设置矩阵转为图片的参数
MatrixToImageConfig toImageConfig = new MatrixToImageConfig(QRCOLOR.getRGB(), BGWHITE.getRGB());
// 矩阵转换图像
qRImage = MatrixToImageWriter.toBufferedImage(matrix, toImageConfig);
return pressText(pressText, qRImage);
}
/**
* @param pressText 二维码下方插入文字
* @param image 需要添加文字的图片
* @为图片添加文字
*/
private static BufferedImage pressText(String pressText, BufferedImage image) throws Exception {
BufferedImage outImage = new BufferedImage(WIDTH, HEIGHT, BufferedImage.TYPE_INT_RGB);
//计算文字开始的位置
//x开始的位置:(图片宽度-字体大小*字的个数)/2
int startX = (WIDTH - (FONTSIZE * pressText.length())) / 2;
//y开始的位置:图片高度-(图片高度-图片宽度)/2
int startY = HEIGHT - (HEIGHT - WIDTH) / 2 + FONTSIZE;
int imageW = outImage.getWidth();
int imageH = outImage.getHeight();
Graphics2D g = outImage.createGraphics();
g.drawImage(image, 0, 0, imageW, imageH, null);
g.setColor(QRCOLOR);
g.setFont(new Font("Noto Sans SC Light", Font.BOLD, FONTSIZE));
g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
g.setBackground(Color.white);
// 获取文字数量 按照字节展示
int size = pressText.getBytes("GBK").length;
// 获取一行最多能容纳多少文字 按照文字字节展示
int maxSize = (WIDTH / FONTSIZE - 2) * 2;
if (size > maxSize) {
int v = size % maxSize;
for (int a = 0; a < (size / maxSize); a++) {
String s = outStringByByte(pressText, maxSize);
g.drawString(s, (WIDTH - (FONTSIZE * (WIDTH / FONTSIZE - 2))) / 2, startY);
pressText = pressText.substring(s.length(), pressText.length());
startY = startY + 35;
}
if (v != 0) {
g.drawString(pressText, (WIDTH - (FONTSIZE * v)) / 2, startY);
}
} else {
g.drawString(pressText, (WIDTH - ((pressText.getBytes("GBK").length) / 2) * FONTSIZE) / 2, startY);
}
g.dispose();
return outImage;
}
/**
* 保存二维码图片到本地
*
* @param contents
* @throws Exception
*/
public static void createImg(String pressText, String contents, String filename, String filePath) throws Exception {
BufferedImage qRImageWithLogo = drawQRImage(pressText, contents);
// 写入返回
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ImageIO.write(qRImageWithLogo, "jpg", baos);
//图片类型
String imageType = "jpg";
//生成二维码存放文件
File file = new File(filePath + filename + ".jpg");
if (!file.exists()) {
file.mkdirs();
}
ImageIO.write(qRImageWithLogo, imageType, file);
baos.close();
}
private static String outStringByByte(String str, int len) throws IOException {
byte[] btf = str.getBytes("GBK");
int count = 0;
for (int j = len - 1; j >= 0; j--) {
if (btf[j] < 0) {
count++;
} else {
break;
}
}
if (count % 2 == 0) {
return new String(btf, 0, len, "GBK");
} 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();
}
}*/
}

8
epmet-gateway/src/main/resources/bootstrap.yml

@ -499,7 +499,12 @@ epmet:
- /oper/customize/customerstartpage/homestartpage
- /epmet/point/mqCallback/**
- /tduck-api/**
#居民信息采集:查询楼栋,单元,房屋,提交信息
- /gov/org/icneighborhood/open/list
- /gov/org/icbuilding/buildingoption
- /gov/org/icbuildingunit/unitoption
- /gov/org/ichouse/houseoption
- /epmetuser/icresicollect/save
# 外部应用认证,使用AccessToken等头进行认证
externalOpenUrls:
- /data/report/**
@ -531,7 +536,6 @@ epmet:
# 对外开放接口认证白名单
externalAuthUrlsWhiteList:
- /epmet/ext/open-api/get-access-token
swaggerUrls:
jwt:

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;
}

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;
}

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());
}

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.

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);
}
}

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>

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"

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

@ -2,7 +2,6 @@ version: "3.7"
services:
epmet-oss-server:
container_name: epmet-oss-server-prod
# image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-test/epmet-oss-server:0.3.2
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-oss-server:0.3.40
ports:
- "8083:8083"

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

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

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);
}

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;
}

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;
}

29
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/CreateQrCodeFormDTO.java

@ -0,0 +1,29 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.validator.group.Group;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2022/3/18 15:43
* @DESC
*/
@Data
public class CreateQrCodeFormDTO implements Serializable {
private static final long serialVersionUID = -6801094057381407439L;
public interface CreateQrCodeForm{}
@NotBlank(message = "id不能为空",groups = CreateQrCodeForm.class)
private String id;
/**
* community:社区neighborHood小区
*/
@NotBlank(message = "type不能为空",groups = CreateQrCodeForm.class)
private String type;
}

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;
}
}

6
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcNeighborHoodFormDTO.java

@ -17,17 +17,17 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
@Data
public class IcNeighborHoodFormDTO implements Serializable {
public class IcNeighborHoodFormDTO extends PageFormDTO {
private static final long serialVersionUID = 1L;
@ -102,4 +102,4 @@ public class IcNeighborHoodFormDTO implements Serializable {
}
}

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);
}
}

1
epmet-module/gov-org/gov-org-server/Dockerfile

@ -5,6 +5,7 @@ RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN echo 'Asia/Shanghai' > /etc/timezone
COPY ./target/*.jar ./gov-org.jar
COPY ./fonts/NotoSansSC-Light.otf /usr/share/fonts
EXPOSE 8092

2
epmet-module/gov-org/gov-org-server/deploy/docker-compose-dev.yml

@ -15,4 +15,4 @@ services:
resources:
limits:
cpus: '0.1'
memory: 300M
memory: 300M

BIN
epmet-module/gov-org/gov-org-server/fonts/NotoSansSC-Light.otf

Binary file not shown.

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 = "所属组织、所属网格、所属小区、楼栋类型、单元数的值未填写,或者所填写信息在系统中未找到";

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

@ -20,13 +20,20 @@ package com.epmet.controller;
import com.epmet.commons.rocketmq.messages.OrgOrStaffMQMsg;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.annotation.RequirePermission;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.enums.EnvEnum;
import com.epmet.commons.tools.enums.RequirePermissionEnum;
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.security.dto.TokenDto;
import com.epmet.commons.tools.utils.BarcodeUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.constant.CustomerAgencyConstant;
import com.epmet.constant.OrgInfoConstant;
import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.dto.IcNeighborHoodDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.entity.CustomerAgencyEntity;
@ -34,11 +41,24 @@ import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.send.SendMqMsgUtil;
import com.epmet.service.AgencyService;
import com.epmet.service.CustomerAgencyService;
import com.epmet.service.IcNeighborHoodService;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.imageio.ImageIO;
import javax.imageio.stream.ImageOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.awt.image.BufferedImage;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URLEncoder;
import java.time.LocalDateTime;
import java.time.ZoneOffset;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -59,6 +79,8 @@ public class AgencyController {
private CustomerAgencyService customerAgencyService;
@Autowired
private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient;
@Autowired
private IcNeighborHoodService neighborHoodService;
/**
* @param formDTO
@ -361,4 +383,79 @@ public class AgencyController {
return new Result<List<SonOrgResultDTO>>().ok(agencyService.getSonAgencyId(orgId,type));
}
}
/**
* Desc: 生成某类型下的二维码
* @param formDTO
* @author zxc
* @date 2022/3/2 10:32 上午
*/
@PostMapping("create-qrcode")
public void createQrCode(@LoginUser TokenDto tokenDto, @RequestBody CreateQrCodeFormDTO formDTO, HttpServletResponse response){
ValidatorUtils.validateEntity(formDTO, CreateQrCodeFormDTO.CreateQrCodeForm.class);
String id = formDTO.getId();
String type = formDTO.getType();
String name = "";
try {
if (type.equals(OrgInfoConstant.COMMUNITY)){
CustomerAgencyDTO customerAgencyDTO = customerAgencyService.get(id);
if (customerAgencyDTO == null){
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"组织信息不存在");
}
name = customerAgencyDTO.getOrganizationName();
}else if (type.equals(OrgInfoConstant.NEIGHBOR_HOOD)){
IcNeighborHoodDTO icNeighborHoodDTO = neighborHoodService.get(id);
if (icNeighborHoodDTO == null){
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"小区信息不存在");
}
name = icNeighborHoodDTO.getNeighborHoodName();
}
//url组成:数字社区地址?小区id&用户id
//String url = "https://demo.tduckapp.com/s/7314b64b3a26455ab793fb8c640856b6?id="+id;
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)
.concat("customerId=").concat(tokenDto.getCustomerId()).concat(StrConstant.AND_MARK)
.concat("type=").concat(type).concat(StrConstant.AND_MARK)
.concat("userId=").concat(tokenDto.getUserId())
.concat(StrConstant.AND_MARK).concat(String.valueOf(LocalDateTime.now().toInstant(ZoneOffset.of("+8")).toEpochMilli()));
BufferedImage image = BarcodeUtils.drawQRImage(name, url);
//BufferedImage 转 InputStream
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
ImageOutputStream imageOutput = ImageIO.createImageOutputStream(byteArrayOutputStream);
ImageIO.write(image, "png", imageOutput);
InputStream inputStream = new ByteArrayInputStream(byteArrayOutputStream.toByteArray());
long length = imageOutput.length();
String fileName = name+".png";
response.setContentType("application/octet-stream");
response.setContentLength((int)length);
response.setHeader("Content-Disposition","attachment;filename="+ URLEncoder.encode(fileName, StrConstant.UTF_8));
//输出流
byte[] bytes = new byte[1024];
OutputStream outputStream = response.getOutputStream();
long count = 0;
while(count < length){
int len = inputStream.read(bytes, 0, 1024);
count +=len;
outputStream.write(bytes, 0, len);
}
outputStream.flush();
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 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();
}
}

66
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcNeighborHoodController.java

@ -19,20 +19,23 @@ package com.epmet.controller;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.result.OptionResultDTO;
import com.epmet.commons.tools.enums.EnvEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.BarcodeUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.AssertUtils;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.constant.ImportErrorMsgConstants;
import com.epmet.constants.ImportTaskConstants;
import com.epmet.dto.IcNeighborHoodDTO;
import com.epmet.dto.form.IcNeighborHoodFormDTO;
import com.epmet.dto.form.ImportInfoFormDTO;
import com.epmet.dto.form.ImportTaskCommonFormDTO;
import com.epmet.dto.result.ImportTaskCommonResultDTO;
@ -43,8 +46,12 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
import java.io.InputStream;
import javax.imageio.ImageIO;
import javax.imageio.stream.ImageOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.awt.image.BufferedImage;
import java.io.*;
import java.net.URLEncoder;
import java.util.List;
import java.util.Map;
@ -71,6 +78,12 @@ public class IcNeighborHoodController {
return new Result<PageData<IcNeighborHoodDTO>>().ok(page);
}
@PostMapping("open/list")
public Result<PageData<IcNeighborHoodDTO>> openList(@RequestBody IcNeighborHoodFormDTO params){
PageData<IcNeighborHoodDTO> page = icNeighborHoodService.openPage(params);
return new Result<PageData<IcNeighborHoodDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<IcNeighborHoodDTO> get(@PathVariable("id") String id){
IcNeighborHoodDTO data = icNeighborHoodService.get(id);
@ -165,4 +178,51 @@ public class IcNeighborHoodController {
return new Result();
}
/**
* Desc: 根据房屋IDs查询房屋下是否有存在居民的
* @param id
* @author zxc
* @date 2022/3/2 10:32 上午
*/
@PostMapping("createQrCode/{id}")
public void getExistUserByHouseIds(@LoginUser TokenDto tokenDto, @PathVariable("id") String id, HttpServletResponse response){
try {
IcNeighborHoodDTO icNeighborHoodDTO = icNeighborHoodService.get(id);
if (icNeighborHoodDTO == null){
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"小区信息不存在");
}
String neighborhoodName = icNeighborHoodDTO.getNeighborHoodName();
//url组成:数字社区地址?小区id&用户id
//String url = "https://demo.tduckapp.com/s/7314b64b3a26455ab793fb8c640856b6?id="+id;
String url = EnvEnum.getCurrentEnv().getUrl().replace("api/",StrConstant.EPMETY_STR)
.concat("epmet-oper-gov/#/caiji/")
.concat(id)
.concat(StrConstant.AND_MARK).concat("userId=").concat(tokenDto.getUserId());
BufferedImage image = BarcodeUtils.drawQRImage(neighborhoodName, url);
//BufferedImage 转 InputStream
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
ImageOutputStream imageOutput = ImageIO.createImageOutputStream(byteArrayOutputStream);
ImageIO.write(image, "png", imageOutput);
InputStream inputStream = new ByteArrayInputStream(byteArrayOutputStream.toByteArray());
long length = imageOutput.length();
String fileName = neighborhoodName+".png";
response.setContentType("application/octet-stream");
response.setContentLength((int)length);
response.setHeader("Content-Disposition","attachment;filename="+ URLEncoder.encode(fileName, StrConstant.UTF_8));
//输出流
byte[] bytes = new byte[1024];
OutputStream outputStream = response.getOutputStream();
long count = 0;
while(count < length){
int len = inputStream.read(bytes, 0, 1024);
count +=len;
outputStream.write(bytes, 0, len);
}
outputStream.flush();
} catch (Exception e) {
e.printStackTrace();
}
}
}

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);
}

8
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;
@ -33,6 +34,7 @@ import org.apache.ibatis.annotations.Param;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* 楼栋信息
@ -161,7 +163,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: 查询客户下户数为空的
@ -177,7 +179,7 @@ public interface IcBuildingDao extends BaseDao<IcBuildingEntity> {
* @author zxc
* @date 2022/3/3 5:26 下午
*/
List<UpdateBuildingHouseNumResultDTO> selectHouseNum(@Param("ids")List<String> ids);
List<UpdateBuildingHouseNumResultDTO> selectHouseNum(@Param("ids") Set<String> ids);
/**
* Desc: 批量更新楼栋户数
@ -187,4 +189,4 @@ public interface IcBuildingDao extends BaseDao<IcBuildingEntity> {
*/
void allUpdateHouseNum(@Param("nums") List<UpdateBuildingHouseNumResultDTO> nums);
}
}

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);
}
}

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

@ -1,9 +1,9 @@
package com.epmet.model;
import cn.hutool.core.collection.ConcurrentHashSet;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
import com.epmet.commons.tools.redis.common.bean.GridInfoCache;
@ -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;
@ -62,6 +64,10 @@ public class ImportHouseInfoListener extends AnalysisEventListener<HouseInfoMode
ImportGeneralDTO buildingGeneralDTO = null;
Map<String, Object> buildingUnitInfos = null;
List<ImportGeneralDTO> buildingUnitInfoDTOs = null;
/**
* 本次导入涉及到的楼宇id 用于更新住户数
*/
private Set<String> buildingIdSet = new ConcurrentHashSet<>();
private ImportInfoFormDTO formDTO;
private IcBuildingDao icBuildingDao;
@ -126,21 +132,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, "门牌号的值未填写");
@ -212,37 +203,45 @@ 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){
for (ImportGeneralDTO r : needInsertList) {
if (k.equals(r.getBuildingUnitId()+"_"+r.getDoorName())){
// 只添加没添加过的
// 集合里重复的
/*nums.add(r.getNum());
disposeErrorMsg(info,ImportErrorMsgConstants.EXIST_ERROR);
r.setExistStatus(true);*/
if (!r.getAddStatus()){
// 集合里重复的
nums.add(r.getNum());
HouseInfoModel houseInfoModel = ConvertUtils.sourceToTarget(r, HouseInfoModel.class);
disposeErrorMsg(houseInfoModel,ImportErrorMsgConstants.EXIST_ERROR);
r.setExistStatus(true);
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);
if (!n.getAddStatus()){
// 库里存在的
nums.add(n.getNum());
HouseInfoModel houseInfoModel = ConvertUtils.sourceToTarget(n, HouseInfoModel.class);
disposeErrorMsg(houseInfoModel,ImportErrorMsgConstants.EXIST_ERROR);
n.setExistStatus(true);
n.setHouseId(e.getHouseId());
needUpdateList.add(n);
n.setAddStatus(true);
n.setExistStatus(true);
}
}
}
@ -251,6 +250,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<>();
@ -539,12 +539,12 @@ public class ImportHouseInfoListener extends AnalysisEventListener<HouseInfoMode
public void doAfterAllAnalysed(AnalysisContext context) {
finalDispose();
// 更新ic_building户数
List<String> list = icBuildingDao.selectHouseTotalIsNull(formDTO.getCustomerId());
if (!CollectionUtils.isEmpty(list)){
List<UpdateBuildingHouseNumResultDTO> houseNum = icBuildingDao.selectHouseNum(list);
if (!CollectionUtils.isEmpty(buildingIdSet)){
List<UpdateBuildingHouseNumResultDTO> houseNum = icBuildingDao.selectHouseNum(buildingIdSet);
if (!CollectionUtils.isEmpty(houseNum)){
icBuildingDao.allUpdateHouseNum(houseNum);
}
buildingIdSet = null;
}
// 删除缓存
icHouseRedis.delTemporaryCacheGrids(formDTO.getCustomerId(), formDTO.getUserId());
@ -586,6 +586,15 @@ public class ImportHouseInfoListener extends AnalysisEventListener<HouseInfoMode
public void houseInsert(List<ImportGeneralDTO> houses){
if (!CollectionUtils.isEmpty(houses)){
icHouseService.insertBatch(ConvertUtils.sourceToTarget(houses, IcHouseEntity.class));
buildingIdSet.addAll(houses.stream().map(ImportGeneralDTO::getBuildingId).collect(Collectors.toSet()));
}
}
@Transactional(rollbackFor = Exception.class)
public void houseUpdate(List<ImportGeneralDTO> houses){
if (!CollectionUtils.isEmpty(houses)){
icHouseService.houseUpdate(houses);
buildingIdSet.addAll(houses.stream().map(ImportGeneralDTO::getBuildingId).collect(Collectors.toSet()));
}
}

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);
}

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

@ -23,12 +23,12 @@ import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.IcNeighborHoodDTO;
import com.epmet.dto.ImportGeneralDTO;
import com.epmet.dto.form.IcNeighborHoodFormDTO;
import com.epmet.dto.form.ImportInfoFormDTO;
import com.epmet.dto.result.ImportTaskCommonResultDTO;
import com.epmet.entity.IcNeighborHoodEntity;
import com.epmet.entity.IcNeighborHoodPropertyEntity;
import com.epmet.entity.IcPropertyManagementEntity;
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
import java.io.InputStream;
@ -148,4 +148,11 @@ public interface IcNeighborHoodService extends BaseService<IcNeighborHoodEntity>
void neighborHoodPropertyInsert(List<IcNeighborHoodPropertyEntity> entities);
<T> String orgGeneralImport(Collection<?> errorRows, Class<T> tClass) throws IOException;
}
/**
* desc:开发获取小区列表 分页或不分页
* @param params
* @return
*/
PageData<IcNeighborHoodDTO> openPage(IcNeighborHoodFormDTO params);
}

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

25
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;
@ -801,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);
}
}

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);
}
}

24
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodServiceImpl.java

@ -48,6 +48,7 @@ import com.epmet.dao.IcBuildingDao;
import com.epmet.dao.IcNeighborHoodDao;
import com.epmet.dao.IcPropertyManagementDao;
import com.epmet.dto.*;
import com.epmet.dto.form.IcNeighborHoodFormDTO;
import com.epmet.dto.form.ImportInfoFormDTO;
import com.epmet.dto.form.ImportTaskCommonFormDTO;
import com.epmet.dto.result.ImportTaskCommonResultDTO;
@ -61,6 +62,8 @@ import com.epmet.model.ImportNeighborHoodInfoListener;
import com.epmet.model.NeighborHoodInfoModel;
import com.epmet.redis.IcHouseRedis;
import com.epmet.service.*;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.ListUtils;
@ -683,4 +686,25 @@ public class IcNeighborHoodServiceImpl extends BaseServiceImpl<IcNeighborHoodDao
return uploadResult.getData().getUrl();
}
@Override
public PageData<IcNeighborHoodDTO> openPage(IcNeighborHoodFormDTO params) {
LambdaQueryWrapper<IcNeighborHoodEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IcNeighborHoodEntity::getAgencyId,params.getAgencyId());
PageData<IcNeighborHoodDTO> result = null;
List<IcNeighborHoodDTO> list = null;
if (params.isPage()){
Page<IcNeighborHoodEntity> objects = PageHelper.startPage(params.getPageNo(), params.getPageSize()).doSelectPage(() -> {
baseDao.selectList(wrapper);
});
list = ConvertUtils.sourceToTarget(objects.getResult(),IcNeighborHoodDTO.class);
result = new PageData<>(list,objects.getTotal());
return result;
}
List<IcNeighborHoodEntity> listEntity = baseDao.selectList(wrapper);
list = ConvertUtils.sourceToTarget(listEntity,IcNeighborHoodDTO.class);
result = new PageData<>(list,list.size());
return result;
}
}

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();
}
/**

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`;

12
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml

@ -733,6 +733,18 @@
AND cg.id = #{gridId}
</select>
<!-- 查询组织下的社区 -->
<select id="getCommunityList" resultType="com.epmet.dto.result.CommunityListResultDTO">
SELECT
ID AS orgId,
ORGANIZATION_NAME AS orgName
FROM customer_agency
WHERE DEL_FLAG = '0'
AND `LEVEL` = 'community'
AND CUSTOMER_ID = #{customerId}
AND CONCAT(PIDS,':',ID) LIKE CONCAT('%',#{agencyId},'%')
</select>
<update id="updateSubAgencyAreaCodeById" parameterType="map">
UPDATE customer_agency
SET AREA_CODE = '',

17
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml

@ -174,7 +174,9 @@
INNER JOIN customer_staff_grid csg ON cg.id = csg.grid_id
WHERE
cg.del_flag = '0'
AND cg.ABANDON_FLAG='0'
AND csg.del_flag = '0'
AND cg.ABANDON_FLAG='0'
AND csg.user_id = #{userId}
ORDER BY cg.GRID_NAME ASC
</select>
@ -288,6 +290,7 @@
CUSTOMER_GRID
WHERE
DEL_FLAG = '0'
and ABANDON_FLAG='0'
AND
PID = #{agencyId}
</select>
@ -307,6 +310,7 @@
CUSTOMER_GRID
<where>
DEL_FLAG = '0'
AND ABANDON_FLAG='0'
AND PID = #{agencyId}
ORDER BY CREATED_TIME DESC
<if test="null != pageSize and pageSize > 0">
@ -365,12 +369,14 @@
<!-- AND cg.del_flag = 0 --><!-- 网格被删除时,首次在该网格注册的居民就找不到了所属网格,暂时关闭这个查询条件,避免缓存中user的showname和组成员member的usershowname出现空值 -->
</select>
<!-- 根据组织机关Id查询机关下网格列表:未废弃的 -->
<select id="selectGridList" resultType="com.epmet.dto.result.GridListResultDTO">
SELECT
id AS "gridId",
grid_name AS "gridName"
FROM customer_grid
WHERE del_flag = '0'
and ABANDON_FLAG='0'
AND pid = #{agencyId}
ORDER BY created_time DESC
</select>
@ -407,6 +413,7 @@
grid_name AS "gridName"
FROM customer_grid
WHERE del_flag = '0'
and ABANDON_FLAG='0'
AND pid = #{agencyId}
</select>
@ -428,6 +435,7 @@
WHERE
cg.del_flag = '0'
AND ca.del_flag = '0'
and cg.ABANDON_FLAG='0'
AND cg.pid = #{agencyId}
</select>
@ -457,6 +465,7 @@
WHERE
grid.del_flag = 0
and grid.SYNC_FLAG='1'
and grid.ABANDON_FLAG='0'
<if test='areaCode != "" and areaCode != null'>
AND grid.area_code LIKE CONCAT(#{areaCode},'%')
</if>
@ -497,6 +506,7 @@
WHERE
a.del_flag = 0
and a.SYNC_FLAG='1'
and a.ABANDON_FLAG='0'
AND a.customer_id = #{customerId}
) AS c
ORDER BY CONVERT ( gridName USING gbk ) ASC
@ -757,7 +767,8 @@
<!-- 网格没有经纬度时获取客户根组织下的 -->
IFNULL(cg.longitude,ca.longitude) longitude,
IFNULL(cg.latitude,ca.latitude) latitude,
ca.ORGANIZATION_NAME agencyName
ca.ORGANIZATION_NAME agencyName,
cg.ABANDON_FLAG
FROM
customer_grid cg
INNER JOIN customer_agency ca ON (ca.ID = cg.PID AND ca.customer_id = cg.customer_id)
@ -835,5 +846,9 @@
</foreach>
)
</select>
<update id="updateTotalUser">
UPDATE customer_grid SET total_user = total_user+#{incrCount}
where id = #{gridId} and del_flag = '0'
</update>
</mapper>

3
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml

@ -125,7 +125,7 @@
</if>
</select>
<!-- 根据staffId查询我所在的网格信息 -->
<!-- 根据staffId查询我所在的网格信息,限制网格是未废弃的网格 -->
<select id="selectActSponsorGrid" resultType="com.epmet.dto.result.ActSponsorGridInfo" parameterType="java.lang.String">
SELECT
csg.GRID_ID,
@ -136,6 +136,7 @@
LEFT JOIN customer_agency ca ON ( cg.PID = ca.ID AND ca.DEL_FLAG = '0' )
WHERE
csg.DEL_FLAG = '0'
and cg.ABANDON_FLAG='0'
AND csg.USER_ID =#{staffId}
</select>
<!-- 根据staffId,查询我所属的组织信息 -->

25
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffGridDao.xml

@ -173,4 +173,27 @@
AND
DEL_FLAG = 0
</update>
</mapper>
<select id="getGridStaffList" resultType="com.epmet.dto.StaffOrgRelationDTO">
SELECT
csg.customer_id,
csg.GRID_ID orgId,
csg.USER_ID staffId,
ifnull(sor.ORG_TYPE,'agency') orgType,
sor.id id
FROM
customer_staff_grid csg
LEFT JOIN staff_org_relation sor ON csg.USER_ID = sor.STAFF_ID AND csg.grid_id = sor.ORG_ID AND sor.del_flag = '0'
WHERE
csg.del_flag = '0'
AND csg.GRID_ID = #{gridId}
</select>
<!-- 查询网格下所有的工作人员 -->
<select id="getAllStaffByGridId" resultType="java.lang.String">
SELECT
USER_ID
FROM customer_staff_grid
WHERE DEL_FLAG = '0'
AND GRID_ID = #{gridId}
</select>
</mapper>

7
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingDao.xml

@ -335,8 +335,11 @@
</select>
<!-- 查询已存在的房屋 -->
<select id="selectExistHouse" resultType="java.lang.String">
SELECT CONCAT(BUILDING_UNIT_ID,'_',DOOR_NAME) FROM ic_house
<select id="selectExistHouse" resultType="com.epmet.dto.result.ExistHouseInfoResultDTO">
SELECT
CONCAT(BUILDING_UNIT_ID,'_',DOOR_NAME) AS name,
ID AS houseId
FROM ic_house
WHERE DEL_FLAG = '0'
AND CONCAT(BUILDING_UNIT_ID,'_',DOOR_NAME) IN
(

44
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml

@ -26,6 +26,50 @@
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<!-- 批量更新房屋信息 -->
<update id="houseUpdate">
UPDATE ic_house
<trim prefix="set" suffixOverrides=",">
<trim prefix="HOUSE_TYPE =(case" suffix="end),">
<foreach collection="houses" item="h">
when id = #{h.houseId} then #{h.houseType}
</foreach>
</trim>
<trim prefix="PURPOSE =(case" suffix="end),">
<foreach collection="houses" item="h">
when id = #{h.houseId} then #{h.purpose}
</foreach>
</trim>
<trim prefix="RENT_FLAG =(case" suffix="end),">
<foreach collection="houses" item="h">
when id = #{h.houseId} then #{h.rentFlag}
</foreach>
</trim>
<trim prefix="OWNER_NAME =(case" suffix="end),">
<foreach collection="houses" item="h">
when id = #{h.houseId} then #{h.ownerName}
</foreach>
</trim>
<trim prefix="OWNER_PHONE =(case" suffix="end),">
<foreach collection="houses" item="h">
when id = #{h.houseId} then #{h.ownerPhone}
</foreach>
</trim>
<trim prefix="OWNER_ID_CARD =(case" suffix="end),">
<foreach collection="houses" item="h">
when id = #{h.houseId} then #{h.ownerIdCard}
</foreach>
</trim>
UPDATED_TIME = NOW()
</trim>
WHERE DEL_FLAG = '0'
AND ID IN (
<foreach collection="houses" item="h" separator=",">
#{h.houseId}
</foreach>
)
</update>
<!--<select id="searchHouseByPage" resultType="map">
select
a.ID as houseId,

49
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPartyServiceCenterDao.xml

@ -118,4 +118,53 @@
</foreach>
)
</select>
<!-- 根据党群服务中心查询可预约事项ID -->
<select id="selectMatterByIds" resultType="java.lang.String">
SELECT
ID
FROM ic_party_service_center_matter
WHERE DEL_FLAG = 0
AND PARTY_SERVICE_CENTER_ID IN (
<foreach collection="centerIds" item="centerId" separator=",">
#{centerId}
</foreach>
)
</select>
<!-- 根据事项ID查询预约记录 -->
<select id="selectAppointmentList" resultType="com.epmet.dto.result.DelPartyServiceCenterResultDTO">
SELECT
r.APPOINTMENT_DATE AS date,
r.MATTER_ID AS matterId,
r.TIME_ID AS timeId,
m.START_TIME AS startTime,
m.END_TIME AS endTime,
c.CENTER_NAME
FROM ic_matter_appointment_record r
INNER JOIN ic_party_service_center_matter m ON (m.ID = r.MATTER_ID AND m.DEL_FLAG = 0)
INNER JOIN ic_party_service_center c ON (c.id = m.PARTY_SERVICE_CENTER_ID AND c.DEL_FLAG = 0)
WHERE r.DEL_FLAG = 0
AND r.`STATUS` = 'appointing'
AND STR_TO_DATE(r.APPOINTMENT_DATE,'%Y-%m-%d') >= DATE_FORMAT(NOW(),'%Y-%m-%d')
AND r.MATTER_ID IN (
<foreach collection="matterIds" item="matterId" separator=",">
#{matterId}
</foreach>
)
</select>
<!-- 删除可预约事项 -->
<update id="delMatters">
UPDATE ic_party_service_center_matter
SET del_flag = 1,
UPDATED_TIME = NOW()
WHERE DEL_FLAG = 0
AND PARTY_SERVICE_CENTER_ID IN (
<foreach collection="centerIds" item="centerId" separator=",">
#{centerId}
</foreach>
)
</update>
</mapper>

115
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/MemoAttachmentDTO.java

@ -0,0 +1,115 @@
package com.epmet.dto;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 备忘录-附件表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-03-15
*/
@Data
public class MemoAttachmentDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@JsonIgnore
private String id;
/**
* 客户ID
*/
@JsonIgnore
private String customerId;
/**
* REMIND_MSG.ID 业务(工作日志难点堵点人员关怀)表Id
*/
@JsonIgnore
private String remindMsgId;
/**
* 文件名
*/
private String fileName;
/**
* 附件名uuid随机生成
*/
private String attachmentName;
/**
* 文件大小单位b
*/
private Integer attachmentSize;
/**
* 文件格式JPGPNGPDFJPEGBMPMP4WMAM4AMP3DOCDOCXXLS
*/
private String attachmentFormat;
/**
* 附件类型图片 - image 视频 - video 语音 - voice 文档 - doc
*/
private String attachmentType;
/**
* 附件地址
*/
private String attachmentUrl;
/**
* 语音或视频时长,
*/
private Integer duration;
/**
* 排序字段
*/
@JsonIgnore
private Integer sort;
/**
* 删除标记 0未删除1已删除
*/
@JsonIgnore
private String delFlag;
/**
* 乐观锁
*/
@JsonIgnore
private Integer revision;
/**
* 创建人
*/
@JsonIgnore
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
@JsonIgnore
private String updatedBy;
/**
* 更新时间
*/
@JsonIgnore
private Date updatedTime;
}

80
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/MemoAttrDTO.java

@ -0,0 +1,80 @@
package com.epmet.dto;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 备忘录-属性表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-03-15
*/
@Data
public class MemoAttrDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 唯一标识
*/
private String id;
/**
* 客户ID
*/
private String customerId;
/**
* 提醒时间
*/
private Date remindTime;
/**
* 业务类型 人员关怀concern难点堵点difficulty工作日志work_diary
*/
private String type;
/**
* 阅读标记1 已读0未读
*/
private Integer readFlag;
/**
* 接收人ID
*/
private String receiver;
/**
* 删除标识0.未删除 1.已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

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

Loading…
Cancel
Save