diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/CustomerGridFormDTO.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/CustomerGridFormDTO.java
new file mode 100644
index 0000000000..767f03bc07
--- /dev/null
+++ b/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
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+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{}
+
+}
\ No newline at end of file
diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/CommonGovOrgFeignClient.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/CommonGovOrgFeignClient.java
new file mode 100644
index 0000000000..bb6bfe423b
--- /dev/null
+++ b/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 getGridInfo(@RequestBody CustomerGridFormDTO customerGridFormDTO);
+
+}
diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonGovOrgFeignClientFallBackFactory.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonGovOrgFeignClientFallBackFactory.java
new file mode 100644
index 0000000000..8cde59e6e1
--- /dev/null
+++ b/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 {
+ private CommonGovOrgFeignClientFallback fallback = new CommonGovOrgFeignClientFallback();
+ @Override
+ public CommonGovOrgFeignClient create(Throwable cause) {
+ log.error(String.format("FeignClient调用发生异常,异常信息:%s", ExceptionUtils.getThrowableErrorStackTrace(cause)));
+ return fallback;
+ }
+
+}
diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonGovOrgFeignClientFallback.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonGovOrgFeignClientFallback.java
new file mode 100644
index 0000000000..c54567c350
--- /dev/null
+++ b/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 getGridInfo(CustomerGridFormDTO customerGridFormDTO) {
+ return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getGridInfo", customerGridFormDTO);
+ }
+
+
+}
diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerOrgRedis.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerOrgRedis.java
index f624c04bbc..7cb132b0f5 100644
--- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerOrgRedis.java
+++ b/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 grid = customerOrgRedis.redisUtils.hGetAll(key);
+ log.info("grid is {}", JSON.toJSONString(grid));
if (!CollectionUtils.isEmpty(grid)) {
return ConvertUtils.mapToEntity(grid, GridInfoCache.class);
}
- Result gridInfoResult = customerOrgRedis.commonAggFeignClient.getGridInfo(gridId);
+ CustomerGridFormDTO formDTO = new CustomerGridFormDTO();
+ formDTO.setGridId(gridId);
+ Result 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 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);
+ }
+
}
diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/GridInfoCache.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/GridInfoCache.java
index cf90afee5b..63114e5794 100644
--- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/GridInfoCache.java
+++ b/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;
}
diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerGridDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerGridDTO.java
index cacdf2e849..b9c12da858 100644
--- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerGridDTO.java
+++ b/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;
}
diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerGridDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerGridDao.java
index 4ee22247f2..2d2c95b424 100644
--- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerGridDao.java
+++ b/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 {
/**
* @Author sun
- * @Description 根据组织Id查询当前组织下所有网格列表
+ * @Description 根据组织Id查询当前组织下所有网格列表(未弃用的网格)
**/
List selectGridListByAgencyId(@Param("agencyId") String agencyId);
diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/CustomerGridEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/CustomerGridEntity.java
index c58ce50893..baac6f8c53 100644
--- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/CustomerGridEntity.java
+++ b/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;
}
diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerGridDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerGridDao.xml
index adc659eae6..c094cc33b8 100644
--- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerGridDao.xml
+++ b/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'
@@ -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'
diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/result/CustomerGridDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/result/CustomerGridDTO.java
index 752bb721cd..9c2d142132 100644
--- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/result/CustomerGridDTO.java
+++ b/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;
}
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/org/CustomerGridEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/org/CustomerGridEntity.java
index ba86713249..76dee40a36 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/org/CustomerGridEntity.java
+++ b/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;
+
}
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimGridEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimGridEntity.java
index 2d3fc94740..4db45eaef7 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimGridEntity.java
+++ b/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;
+
}
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java
index d184f762d1..308a9113c9 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java
+++ b/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 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);
}
}
}
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDimServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDimServiceImpl.java
index d9081c7c6f..b1a1511740 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDimServiceImpl.java
+++ b/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);
}
}
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimGridServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimGridServiceImpl.java
index 0a0fb86ecf..5de49ca847 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimGridServiceImpl.java
+++ b/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 #{startTime}
diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java
index 1a3f20439a..25cf270549 100644
--- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java
+++ b/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 getVolunteerCount(@RequestBody VolunteerCommonFormDTO input);
+
+ /**
+ * 修改志愿者的注册网格
+ * @param volunteerInfoDTO
+ * @return
+ */
+ @PostMapping("/heart/resi/volunteer/modifyVolunteerGrid")
+ Result modifyVolunteerGrid(@RequestBody VolunteerInfoDTO volunteerInfoDTO);
}
diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java
index aab5bdb70d..06bdc642c9 100644
--- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java
+++ b/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 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);
+ }
}
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiVolunteerController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiVolunteerController.java
index 39da0690af..410cbdf981 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiVolunteerController.java
+++ b/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().ok(volunteerCount);
}
+
+ /**
+ * 修改志愿者注册信息_的网格信息
+ * @param volunteerInfoDTO
+ * @return
+ */
+ @PostMapping("modifyVolunteerGrid")
+ public Result modifyVolunteerGrid(@RequestBody VolunteerInfoDTO volunteerInfoDTO){
+ volunteerInfoService.modifyVolunteerGrid(volunteerInfoDTO);
+ return new Result();
+ }
}
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/VolunteerInfoDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/VolunteerInfoDao.java
index ab0b65bf9c..2aa3afa166 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/VolunteerInfoDao.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/VolunteerInfoDao.java
@@ -74,4 +74,11 @@ public interface VolunteerInfoDao extends BaseDao {
* @date 2020.08.13 10:06
**/
List selectVolunteerIds(@Param("customerId")String customerId);
+
+ /**
+ * 修改志愿者注册信息_网格信息
+ * @param volunteerInfoDTO
+ * @return
+ */
+ int updateVolunteerGrid(VolunteerInfoDTO volunteerInfoDTO);
}
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/VolunteerInfoService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/VolunteerInfoService.java
index f9db916bbe..7cd4d30769 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/VolunteerInfoService.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/VolunteerInfoService.java
@@ -111,4 +111,10 @@ public interface VolunteerInfoService extends BaseService {
* @return
*/
Integer getVolunteerCount(String customerId, String agencyId);
+
+ /**
+ * 修改志愿者注册信息_的网格信息
+ * @param volunteerInfoDTO
+ */
+ void modifyVolunteerGrid(VolunteerInfoDTO volunteerInfoDTO);
}
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java
index 71417dbb2e..846e342657 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java
+++ b/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
+
+
+ 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}
+
diff --git a/epmet-module/epmet-oss/epmet-oss-server/deploy/docker-compose-dev.yml b/epmet-module/epmet-oss/epmet-oss-server/deploy/docker-compose-dev.yml
index 4f5d73ca1a..7e1ef5224e 100644
--- a/epmet-module/epmet-oss/epmet-oss-server/deploy/docker-compose-dev.yml
+++ b/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"
diff --git a/epmet-module/epmet-oss/epmet-oss-server/deploy/docker-compose-test.yml b/epmet-module/epmet-oss/epmet-oss-server/deploy/docker-compose-test.yml
index f4abefb2dd..3a849e0e50 100644
--- a/epmet-module/epmet-oss/epmet-oss-server/deploy/docker-compose-test.yml
+++ b/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"
diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java
index 5ebed6c49e..221a23af53 100644
--- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java
+++ b/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> 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 issueAuditReset(@RequestParam("gridId")String gridId);
}
diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java
index ae87c2cd6b..20b827a9ad 100644
--- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java
+++ b/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> getCategoryMap(String customerId) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "getCategoryMap", customerId);
}
+
+ @Override
+ public Result issueAuditReset(String gridId) {
+ return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "issueAuditReset", gridId);
+ }
}
diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueController.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueController.java
index 55f1348b44..ec49c3bb81 100644
--- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueController.java
+++ b/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>().ok(issueService.getProjectCountByGrid(formDTO));
}
+ /**
+ * Desc: 查询网格下是否存在审核中的,表决中的议题 true:存在,false:不存在
+ * @param gridId
+ * @author zxc
+ * @date 2022/3/15 4:40 下午
+ */
+ @PostMapping("audit-reset")
+ public Result issueAuditReset(@RequestParam("gridId")String gridId){
+ return new Result().ok(issueService.issueAuditReset(gridId));
+ }
+
}
diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueDao.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueDao.java
index 0a82cb5530..1c5ae213ee 100644
--- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueDao.java
+++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueDao.java
@@ -292,4 +292,20 @@ public interface IssueDao extends BaseDao {
List selectCategoryNameByIssueList(List 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);
+
}
\ No newline at end of file
diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueService.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueService.java
index 01e16471da..1c8bd6c376 100644
--- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueService.java
+++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueService.java
@@ -378,4 +378,12 @@ public interface IssueService extends BaseService {
*/
List getProjectCountByGrid(ProjectDistributionAnalysisFormDTO formDTO);
+ /**
+ * Desc: 查询网格下是否存在审核中的,表决中的议题 true:存在,false:不存在
+ * @param gridId
+ * @author zxc
+ * @date 2022/3/15 4:40 下午
+ */
+ Boolean issueAuditReset(String gridId);
+
}
diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java
index 70e8528491..fd4f54a866 100644
--- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java
+++ b/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 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;
+ }
+
}
diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml
index 3273fb243e..4dbcbb2e9a 100644
--- a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml
+++ b/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})
+
+
+
+ SELECT
+ COUNT(id)
+ FROM issue
+ WHERE del_flag = 0
+ and ISSUE_STATUS = 'voting'
+ AND grid_id = #{gridId}
+
+
+
+
+ SELECT
+ count( id )
+ FROM issue_application
+ WHERE DEL_FLAG = '0'
+ AND APPLY_STATUS = 'under_auditing'
+ AND GRID_ID = #{gridId}
+
\ No newline at end of file
diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerGridDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerGridDTO.java
index 7acfd64627..0acd914fa6 100644
--- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerGridDTO.java
+++ b/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;
}
diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/ImportGeneralDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/ImportGeneralDTO.java
index 9039cda6ef..1d4419e661 100644
--- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/ImportGeneralDTO.java
+++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/ImportGeneralDTO.java
@@ -138,6 +138,11 @@ public class ImportGeneralDTO implements Serializable {
private Boolean existStatus = false;
+ /**
+ * 错误信息添加状态
+ */
+ private Boolean addStatus = false;
+
/**
* 楼栋重复状态
*/
diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AbandonGridFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AbandonGridFormDTO.java
new file mode 100644
index 0000000000..85f8d7fd34
--- /dev/null
+++ b/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;
+}
diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java
index 1d82763373..edfc0bdcb7 100644
--- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java
+++ b/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 getUnitById(@PathVariable("id") String id);
+
+ /**
+ * Desc: 查询网格下所有的工作人员
+ * @param gridId
+ * @author zxc
+ * @date 2022/3/21 16:02
+ */
+ @PostMapping("/gov/org/customerstaffgrid/getallstaffbygridid")
+ Result> getAllStaffByGridId(@RequestParam("gridId")String gridId);
}
diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java
index 21067cb674..d66317aa2b 100644
--- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java
+++ b/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 getUnitById(String id) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getUnitById", id);
}
+
+ @Override
+ public Result> getAllStaffByGridId(String gridId) {
+ return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getAllStaffByGridId", gridId);
+ }
}
diff --git a/epmet-module/gov-org/gov-org-server/pom.xml b/epmet-module/gov-org/gov-org-server/pom.xml
index 4613a49084..58c87df115 100644
--- a/epmet-module/gov-org/gov-org-server/pom.xml
+++ b/epmet-module/gov-org/gov-org-server/pom.xml
@@ -136,6 +136,12 @@
3.0.3
compile
+
+ com.epmet
+ gov-issue-client
+ 2.0.0
+ compile
+
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffGridController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffGridController.java
index cba514d051..8858cac625 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffGridController.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffGridController.java
@@ -145,4 +145,15 @@ public class CustomerStaffGridController {
public Result> eventOrg(@LoginUser TokenDto tokenDto){
return new Result>().ok(customerStaffGridService.eventOrg(tokenDto.getUserId()));
}
+
+ /**
+ * Desc: 查询网格下所有的工作人员
+ * @param gridId
+ * @author zxc
+ * @date 2022/3/21 16:02
+ */
+ @PostMapping("getallstaffbygridid")
+ public Result> getAllStaffByGridId(@RequestParam("gridId")String gridId){
+ return new Result>().ok(customerStaffGridService.getAllStaffByGridId(gridId));
+ }
}
\ No newline at end of file
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/GridController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/GridController.java
index f7c4d8ec10..8f026e9f44 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/GridController.java
+++ b/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>().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();
+ }
+
}
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java
index 3dcedd5c73..3de988ec2c 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java
@@ -172,7 +172,7 @@ public interface CustomerGridDao extends BaseDao {
BelongGridNameResultDTO getGridNameByGridId(BelongGridNameFormDTO formDTO);
/**
- * @Description 根据组织机关Id查询机关下网格列表
+ * @Description 根据组织机关Id查询机关下网格列表:未废弃的
* @author sun
*/
List selectGridList(@Param("agencyId") String agencyId);
@@ -367,11 +367,19 @@ public interface CustomerGridDao extends BaseDao {
List 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 selectGridInfoByNames(@Param("names")List names,@Param("customerId")String customerId);
+ List selectGridInfoByNames(@Param("names") List names, @Param("customerId") String customerId);
+ /**
+ * desc:修改网格工作人员数量
+ *
+ * @param gridId
+ * @param incrCount 增加人数 负数为 -
+ * @return
+ */
+ int updateTotalUser(@Param("gridId") String gridId, @Param("incrCount") long incrCount);
}
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffAgencyDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffAgencyDao.java
index c1a7f52efa..dfe6f02296 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffAgencyDao.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffAgencyDao.java
@@ -88,7 +88,7 @@ public interface CustomerStaffAgencyDao extends BaseDao selectActSponsorGrid(String staffId);
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffGridDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffGridDao.java
index 426a0e6b3a..ed00369f86 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffGridDao.java
+++ b/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 {
* @date 2021/8/5 5:36 下午
*/
List eventOrg(@Param("userId") String userId);
-}
\ No newline at end of file
+
+ /**
+ * desc:根据网格id 获取网格下的工作人员及其添加关系
+ * @param gridId
+ * @return
+ */
+ List getGridStaffList(String gridId);
+
+ /**
+ * Desc: 查询网格下所有的工作人员
+ * @param gridId
+ * @author zxc
+ * @date 2022/3/21 16:02
+ */
+ List getAllStaffByGridId(String gridId);
+
+}
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerGridEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerGridEntity.java
index d6018c2a29..70f73c89da 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerGridEntity.java
+++ b/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;
}
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java
index 297df14501..8190c9418d 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java
+++ b/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 getCustomerStaffList(List staffIdList);
+
+ /**
+ * desc:删除审核中的徽章认证记录-弃用网格是调用
+ * @param customerId
+ * @param gridId
+ * @return
+ */
+ @PostMapping("/epmetuser/badge/deleteBadgeCertificateAuditing")
+ Result deleteBadgeCertificateAuditing(@RequestParam("customerId") String customerId, @RequestParam("gridId") String gridId);
+
+ /**
+ * desc:删除弃用网格的访问记录-弃用网格是调用
+ * @param customerId
+ * @param gridId
+ * @return
+ */
+ @PostMapping("/epmetuser/gridlatest/deleteGridLatestData")
+ Result deleteGridLatestData(@RequestParam("customerId") String customerId, @RequestParam("gridId") String gridId);
}
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java
index f6ac8153ce..4594d36a60 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java
+++ b/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 getCustomerStaffList(List staffIdList) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getCustomerStaffList", staffIdList);
}
+
+ @Override
+ public Result deleteBadgeCertificateAuditing(String customerId, String gridId) {
+ return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "deleteBadgeCertificateAuditing", customerId, gridId);
+ }
+
+ @Override
+ public Result deleteGridLatestData(String customerId, String gridId) {
+ return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "deleteGridLatestData", customerId, gridId);
+ }
}
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportBuildingInfoListener.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportBuildingInfoListener.java
index 6c1963888a..1de117ca35 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportBuildingInfoListener.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportBuildingInfoListener.java
@@ -142,10 +142,14 @@ public class ImportBuildingInfoListener extends AnalysisEventListener existList = groupByBuildingExistStatus.get(true);
if (!CollectionUtils.isEmpty(existList)){
existList.forEach(e -> {
- nums.add(e.getNum());
- disposeErrorMsg(info,ImportErrorMsgConstants.EXIST_ERROR);
+ if (!e.getAddStatus()){
+ nums.add(e.getNum());
+ BuildingInfoModel buildingInfoModel = ConvertUtils.sourceToTarget(e, BuildingInfoModel.class);
+ disposeErrorMsg(buildingInfoModel,ImportErrorMsgConstants.EXIST_ERROR);
+ e.setAddStatus(true);
+ }
});
}
}
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportHouseInfoListener.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportHouseInfoListener.java
index 60b609752c..ea8c98c040 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportHouseInfoListener.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportHouseInfoListener.java
@@ -210,13 +210,18 @@ public class ImportHouseInfoListener extends AnalysisEventListener collect = needInsertList.stream().collect(Collectors.groupingBy(n -> n.getBuildingUnitId() + "_" + n.getDoorName(), Collectors.counting()));
collect.forEach((k,v) -> {
- if (Integer.valueOf(v.toString()).compareTo(1) > 0){
+ if (Integer.valueOf(v.toString()).compareTo(1) != 0){
for (ImportGeneralDTO r : needInsertList) {
if (k.equals(r.getBuildingUnitId()+"_"+r.getDoorName())){
- // 集合里重复的
- nums.add(r.getNum());
- 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);
+ r.setAddStatus(true);
+ }
}
}
}
@@ -227,10 +232,14 @@ public class ImportHouseInfoListener extends AnalysisEventListener {
for (ImportGeneralDTO n : needInsertList) {
if ((n.getBuildingUnitId()+"_"+n.getDoorName()).equals(e)){
- // 库里存在的
- 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.setAddStatus(true);
+ }
}
}
});
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportNeighborHoodInfoListener.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportNeighborHoodInfoListener.java
index 2e326c20f0..d50de038dd 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportNeighborHoodInfoListener.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportNeighborHoodInfoListener.java
@@ -136,10 +136,14 @@ public class ImportNeighborHoodInfoListener extends AnalysisEventListener 0){
for (ImportGeneralDTO r : needDisposeList) {
if (k.equals(r.getAgencyName() + "_" + r.getGridName() + "_" + r.getNeighborHoodName())){
- // 集合里重复的
- nums.add(r.getNum());
- disposeErrorMsg(info, ImportErrorMsgConstants.EXIST_ERROR);
- r.setExistStatus(true);
+ if (!r.getAddStatus()){
+ // 集合里重复的
+ nums.add(r.getNum());
+ NeighborHoodInfoModel neighborHoodInfoModel = ConvertUtils.sourceToTarget(r, NeighborHoodInfoModel.class);
+ disposeErrorMsg(neighborHoodInfoModel, ImportErrorMsgConstants.EXIST_ERROR);
+ r.setExistStatus(true);
+ r.setAddStatus(true);
+ }
}
}
}
@@ -152,8 +156,12 @@ public class ImportNeighborHoodInfoListener extends AnalysisEventListener existList = groupByBuildingExistStatus.get(true);
if (!CollectionUtils.isEmpty(existList)){
existList.forEach(e -> {
- nums.add(e.getNum());
- disposeErrorMsg(info,ImportErrorMsgConstants.EXIST_ERROR);
+ if (!e.getAddStatus()){
+ nums.add(e.getNum());
+ NeighborHoodInfoModel neighborHoodInfoModel = ConvertUtils.sourceToTarget(e, NeighborHoodInfoModel.class);
+ disposeErrorMsg(neighborHoodInfoModel,ImportErrorMsgConstants.EXIST_ERROR);
+ e.setAddStatus(true);
+ }
});
}
List notExistList = groupByBuildingExistStatus.get(false);
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java
index cac10ea123..c3ba7c1286 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java
@@ -374,4 +374,17 @@ public interface CustomerGridService extends BaseService {
* @date 2022/1/17 3:50 下午
*/
List getStaffGridList(String customerId, String orgId, String orgType);
+
+ /**
+ * 弃用网格,前置条件查询
+ * @param formDTO
+ * @return
+ */
+ void abandonGrid(AbandonGridFormDTO formDTO);
+
+ /**
+ * desc:移除网格内的工作人员关系 并迁移到组织
+ * @param formDTO
+ */
+ void abandonGridForDealBizData(AbandonGridFormDTO formDTO);
}
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffGridService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffGridService.java
index 1e78f3725b..99076f48e9 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffGridService.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffGridService.java
@@ -135,4 +135,13 @@ public interface CustomerStaffGridService extends BaseService eventOrg(String userId);
+
+ /**
+ * Desc: 查询网格下所有的工作人员
+ * @param gridId
+ * @author zxc
+ * @date 2022/3/21 16:02
+ */
+ List getAllStaffByGridId(String gridId);
+
}
\ No newline at end of file
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffService.java
index ccd998c0fc..2c11cd6444 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffService.java
+++ b/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
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java
index db8174b51d..2cb746aab6 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java
+++ b/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 gridList = customerGridDao.selectGridList(canTick.getAgencyId());
List gridStaffs = new ArrayList<>();
if (null != gridList && gridList.size() > NumConstant.ZERO) {
@@ -438,7 +439,7 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl gridList = customerGridDao.selectGridList(canTick.getAgencyId());
List gridStaffs = new ArrayList<>();
if (null != gridList && gridList.size() > NumConstant.ZERO) {
@@ -728,6 +729,7 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl gridList = customerGridDao.selectAgencyGridList(agencyEntity.getId());
returnDTO.setGridList(gridList);
//递归查询当前组织的下级组织以及每个下级组织对应的网格列表
@@ -762,6 +764,7 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl subAgencyList = baseDao.selectAllSubAgency(subAgencyPids);
if (subAgencyList.size() > NumConstant.ZERO) {
for (ArticleGridResultDTO sub : subAgencyList) {
+ //未隐藏的网格
List gridList = customerGridDao.selectAgencyGridList(sub.getAgencyId());
sub.setGridList(gridList);
List subAgency = getGridList(sub.getPids() + ":" + sub.getAgencyId());
@@ -826,11 +829,13 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl agencyDeptList = customerDepartmentDao.selectAgencyDeptMsgList(agencyEntity.getId());
returnDTO.setAgencyDeptList(agencyDeptList);
//当前机关下网格列表
+ // 未隐藏的网格
List agencyGridList = customerGridDao.selectAgencyGridMsgList(agencyEntity.getId());
returnDTO.setAgencyGridList(agencyGridList);
} else if (gridParty) {
//4.2:查询人员在当前机关下参与的网格列表
//查询当前组织下的网格列表
+ //未隐藏的网格
List gridList = customerGridDao.selectAgencyGridList(agencyEntity.getId());
//查询该工作人员在该客户下参与的网格列表
CustomerStaffGridDTO staffGridDTO = new CustomerStaffGridDTO();
@@ -867,6 +872,7 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl list=customerStaffAgencyDao.selectActSponsorGrid(staffId);
resultDTO.setAgencyGridList(list);
return resultDTO;
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java
index cd0080f548..5e7aa468ff 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java
+++ b/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 page(Map params) {
@@ -802,14 +825,6 @@ public class CustomerGridServiceImpl extends BaseServiceImpl projectDb = govProjectOpenFeignClient.eventAuditReset(formDTO.getGridId());
+ //表决中的议题
+ Result 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 staffList = customerStaffGridDao.getGridStaffList(formDTO.getGridId());
+ if (staffList == null){
+ staffList = new ArrayList<>();
+ }
+ logger.debug("abandonGridForDealBizData staffList:{}", JSON.toJSONString(staffList));
+ List 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 staffList, List updateList) {
+ //1.删除工作人员与网格的关系
+ LambdaQueryWrapper 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 badgeResult = epmetUserFeignClient.deleteBadgeCertificateAuditing(customerId,gridId);
+ if (badgeResult == null || !badgeResult.success()){
+ throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"删除未审核徽章失败,请稍后重试");
+ }
+ //删除废弃网格的访问记录
+ Result gridLatestResult = epmetUserFeignClient.deleteGridLatestData(customerId,gridId);
+ if (gridLatestResult == null || !gridLatestResult.success()){
+ throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"删除网格访问记录失败,请稍后重试");
+ }
+ //处理成功,隐藏网格
+ LambdaUpdateWrapper 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);
+ }
+
}
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffGridServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffGridServiceImpl.java
index c744a1b0a2..4cc572edc8 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffGridServiceImpl.java
+++ b/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 eventOrg(String userId) {
return baseDao.eventOrg(userId);
}
+
+ /**
+ * Desc: 查询网格下所有的工作人员
+ * @param gridId
+ * @author zxc
+ * @date 2022/3/21 16:02
+ */
+ @Override
+ public List getAllStaffByGridId(String gridId) {
+ return baseDao.getAllStaffByGridId(gridId);
+ }
}
diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.13__abandon_grid.sql b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.13__abandon_grid.sql
new file mode 100644
index 0000000000..37fbf05faa
--- /dev/null
+++ b/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;
\ No newline at end of file
diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml
index 357c8cebdc..0f08fce996 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml
+++ b/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
@@ -288,6 +290,7 @@
CUSTOMER_GRID
WHERE
DEL_FLAG = '0'
+ and ABANDON_FLAG='0'
AND
PID = #{agencyId}
@@ -307,6 +310,7 @@
CUSTOMER_GRID
DEL_FLAG = '0'
+ AND ABANDON_FLAG='0'
AND PID = #{agencyId}
ORDER BY CREATED_TIME DESC
@@ -365,12 +369,14 @@
+
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
@@ -407,6 +413,7 @@
grid_name AS "gridName"
FROM customer_grid
WHERE del_flag = '0'
+ and ABANDON_FLAG='0'
AND pid = #{agencyId}
@@ -428,6 +435,7 @@
WHERE
cg.del_flag = '0'
AND ca.del_flag = '0'
+ and cg.ABANDON_FLAG='0'
AND cg.pid = #{agencyId}
@@ -457,6 +465,7 @@
WHERE
grid.del_flag = 0
and grid.SYNC_FLAG='1'
+ and grid.ABANDON_FLAG='0'
AND grid.area_code LIKE CONCAT(#{areaCode},'%')
@@ -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
@@ -756,10 +766,12 @@
cg.mobile,
IFNULL(cg.longitude,ca.longitude) longitude,
- IFNULL(cg.latitude,ca.latitude) latitude
+ IFNULL(cg.latitude,ca.latitude) latitude,
+ ca.ORGANIZATION_NAME agencyName,
+ cg.ABANDON_FLAG
FROM
customer_grid cg
- INNER JOIN customer_agency ca ON ca.pid = '0' AND ca.customer_id = cg.customer_id
+ INNER JOIN customer_agency ca ON (ca.ID = cg.PID AND ca.customer_id = cg.customer_id)
WHERE
cg.del_flag = '0'
AND ca.del_flag = '0'
@@ -834,5 +846,9 @@
)
+
+ UPDATE customer_grid SET total_user = total_user+#{incrCount}
+ where id = #{gridId} and del_flag = '0'
+
diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml
index 5f471060b6..698cdcacaf 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml
+++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml
@@ -125,7 +125,7 @@
-
+
diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffGridDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffGridDao.xml
index 1d11a957b2..db1fa9571b 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffGridDao.xml
+++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffGridDao.xml
@@ -173,4 +173,27 @@
AND
DEL_FLAG = 0
-
\ No newline at end of file
+
+ 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
+ USER_ID
+ FROM customer_staff_grid
+ WHERE DEL_FLAG = '0'
+ AND GRID_ID = #{gridId}
+
+
diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectAuditResetResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectAuditResetResultDTO.java
new file mode 100644
index 0000000000..7ff2a51a2c
--- /dev/null
+++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectAuditResetResultDTO.java
@@ -0,0 +1,25 @@
+package com.epmet.dto.result;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @Author zxc
+ * @DateTime 2022/3/21 15:48
+ * @DESC
+ */
+@Data
+public class ProjectAuditResetResultDTO implements Serializable {
+
+ private static final long serialVersionUID = -4523314881244005376L;
+
+ private Boolean projectStatus;
+
+ private Boolean resiEventStatus;
+
+ public ProjectAuditResetResultDTO() {
+ this.projectStatus = false;
+ this.resiEventStatus = false;
+ }
+}
diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java
index 9f58bbb306..70abf989e9 100644
--- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java
+++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java
@@ -9,10 +9,7 @@ import com.epmet.dto.result.*;
import com.epmet.feign.fallback.GovProjectOpenFeignClientFallbackFactory;
import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO;
import org.springframework.cloud.openfeign.FeignClient;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.*;
import java.util.List;
@@ -152,4 +149,13 @@ public interface GovProjectOpenFeignClient {
**/
@PostMapping("gov/project/resievent/autoAudit")
Result autoAudit();
+
+ /**
+ * Desc: 查询群众直报是否存在处理中的,true:存在,false:不存在
+ * @param gridId
+ * @author zxc
+ * @date 2022/3/15 5:05 下午
+ */
+ @PostMapping("gov/project/project/audit-reset")
+ Result eventAuditReset(@RequestParam("gridId")String gridId);
}
diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java
index 58da1494d8..8136ac1432 100644
--- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java
+++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java
@@ -154,4 +154,9 @@ public class GovProjectOpenFeignClientFallback implements GovProjectOpenFeignCli
public Result autoAudit() {
return ModuleUtils.feignConError(ServiceConstant.GOV_PROJECT_SERVER, "autoAudit");
}
+
+ @Override
+ public Result eventAuditReset(String gridId) {
+ return ModuleUtils.feignConError(ServiceConstant.GOV_PROJECT_SERVER, "eventAuditReset",gridId);
+ }
}
diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectController.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectController.java
index 077b06e22d..372ff5fb5c 100644
--- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectController.java
+++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectController.java
@@ -325,4 +325,15 @@ public class ProjectController {
projectService.projectWorkMinutesJob(dto);
return new Result();
}
+
+ /**
+ * Desc: 查询群众直报是否存在处理中的,true:存在,false:不存在
+ * @param gridId
+ * @author zxc
+ * @date 2022/3/15 5:05 下午
+ */
+ @PostMapping("audit-reset")
+ public Result eventAuditReset(@RequestParam("gridId")String gridId){
+ return new Result().ok(projectService.eventAuditReset(gridId));
+ }
}
\ No newline at end of file
diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java
index b5a3e5107e..3aaabdf485 100644
--- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java
+++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java
@@ -21,10 +21,7 @@ import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.EventProjectInfoDTO;
import com.epmet.dto.ProjectDTO;
import com.epmet.dto.ProjectStaffDTO;
-import com.epmet.dto.form.LatestListFormDTO;
-import com.epmet.dto.form.PatrolProjectFormDTO;
-import com.epmet.dto.form.ProjectListFromDTO;
-import com.epmet.dto.form.ShiftProjectsFromDTO;
+import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.entity.ProjectEntity;
import org.apache.ibatis.annotations.Mapper;
@@ -50,6 +47,14 @@ public interface ProjectDao extends BaseDao {
**/
List selectPendList(ProjectListFromDTO fromDTO);
+ /**
+ * Desc: 待处理项目列表
+ * @param userIds
+ * @author zxc
+ * @date 2022/3/21 14:12
+ */
+ List selectPendListByUserIds(@Param("userIds")List userIds);
+
/**
* 我发起的项目列表
*
@@ -283,4 +288,13 @@ public interface ProjectDao extends BaseDao {
* @Date 2022/1/12 17:05
*/
List getProjectListForWorkMinutes(@Param("customerId")String customerId, @Param("projectId")String projectId, @Param("status")String status);
+
+ /**
+ * Desc: 查询网格下群众直报处理中的个数
+ * @param gridId
+ * @author zxc
+ * @date 2022/3/15 5:09 下午
+ */
+ Integer selectEventStatus(@Param("gridId") String gridId);
+
}
\ No newline at end of file
diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectService.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectService.java
index 4757113bc7..d5f4ec3154 100644
--- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectService.java
+++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectService.java
@@ -376,4 +376,13 @@ public interface ProjectService extends BaseService {
* @Date 2022/1/4 16:27
*/
PageData approvaledList(ApprovaledListFromDTO formDTO);
+
+ /**
+ * Desc: 查询群众直报是否存在处理中的,true:存在,false:不存在
+ * @param gridId
+ * @author zxc
+ * @date 2022/3/15 5:05 下午
+ */
+ ProjectAuditResetResultDTO eventAuditReset(String gridId);
+
}
\ No newline at end of file
diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java
index 6a591d9e8d..12c88a2b3a 100644
--- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java
+++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java
@@ -234,14 +234,28 @@ public class ProjectServiceImpl extends BaseServiceImpl userIds) {
+ if (CollectionUtils.isNotEmpty(userIds)){
+ List projectList = baseDao.selectPendListByUserIds(userIds);
+ if (projectList.size() == 0){
+ return false;
+ }else {
+ return true;
+ }
+ }
+ return false;
+ }
+
@Override
public List getCreatedList(ProjectListFromDTO fromDTO) {
List list = new ArrayList<>();
- //查询条件
- int pageIndex = (fromDTO.getPageNo() - NumConstant.ONE) * fromDTO.getPageSize();
- fromDTO.setPageNo(pageIndex);
-
List projectList = baseDao.selectCreatedList(fromDTO);
//获取客户定制的可滞留天数
Integer finalDays = getDays(fromDTO);
@@ -3134,6 +3148,29 @@ public class ProjectServiceImpl extends BaseServiceImpl> allStaffByGridId = govOrgOpenFeignClient.getAllStaffByGridId(gridId);
+ if (!allStaffByGridId.success()){
+ throw new EpmetException("查询网格下的工作人员失败");
+ }
+ if (CollectionUtils.isNotEmpty(allStaffByGridId.getData())){
+ result.setProjectStatus(getPendProjectListByUserIds(allStaffByGridId.getData()));
+ }
+ return result;
+ }
+
+ /**
* @Description 区间项目分类数量处理
* 查询的是时间段内的分类项目数,查询的时间 是传入一个日期,拼上时间,在进行比较大小
* @param categories
diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml
index 3d6dc43b7f..bef089e81f 100644
--- a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml
+++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml
@@ -41,6 +41,8 @@
ORDER BY psp.created_time, p.created_time ASC
LIMIT #{pageNo}, #{pageSize}
+
+
SELECT distinct
p.ID,
@@ -528,4 +530,38 @@
AND a.`STATUS` = #{status}
+
+
+
+ SELECT
+ COUNT( ID )
+ FROM resi_event
+ WHERE DEL_FLAG = '0'
+ AND `STATUS` = 'processing'
+ AND audit_status = 'auto_passed'
+ AND GRID_ID = #{gridId}
+
+
+ SELECT distinct
+ p.ID,
+ p.TITLE,
+ p.CREATED_TIME,
+ psp.CREATED_TIME AS UPDATED_TIME
+ FROM project p
+ INNER JOIN (SELECT
+ ps.PROJECT_ID,
+ MAX(ps.CREATED_TIME) AS CREATED_TIME
+ FROM project_staff ps
+ WHERE ps.DEL_FLAG = '0'
+ AND ps.IS_HANDLE = 'unhandled'
+ AND ps.STAFF_ID IN (
+
+ #{userId}
+
+ )
+ GROUP BY ps.PROJECT_ID) psp ON p.ID = psp.PROJECT_ID
+ WHERE p.DEL_FLAG = '0'
+ AND p.status = 'pending'
+ ORDER BY psp.created_time, p.created_time ASC
+
\ No newline at end of file
diff --git a/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/controller/StrangerResiGuideController.java b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/controller/StrangerResiGuideController.java
index d2e021b4d0..1ffeff276d 100644
--- a/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/controller/StrangerResiGuideController.java
+++ b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/controller/StrangerResiGuideController.java
@@ -131,7 +131,7 @@ public class StrangerResiGuideController {
/**
* @param
* @Author sun
- * @Description 单客户-陌生访客根据自动定位获取附近网格数据
+ * @Description 单客户-陌生访客根据自动定位获取附近网格数据 陌生人选网格+去其他网格看看
**/
@PostMapping("publiclocationgridlist")
Result> publicLocationGridList(@RequestBody PublicCustomerGridListFormDTO formDTO){
diff --git a/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/controller/UserGuideController.java b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/controller/UserGuideController.java
index 42920ff788..94c19dfdfe 100644
--- a/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/controller/UserGuideController.java
+++ b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/controller/UserGuideController.java
@@ -2,6 +2,7 @@ package com.epmet.controller;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.tools.annotation.LoginUser;
+import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
@@ -29,6 +30,7 @@ public class UserGuideController {
@Autowired
private UserAccessService userAccessService;
+ @NoRepeatSubmit
@PostMapping("entergrid")
Result enterGrid(@LoginUser TokenDto token, @RequestBody UserEnterGridFormDTO userEnterGridFormDTO){
logger.info("进网格TokenDto:"+ JSON.toJSON(token));
diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/grid/service/impl/ResiMineGridServiceImpl.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/grid/service/impl/ResiMineGridServiceImpl.java
index de5e28a457..68ac4ef3c1 100644
--- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/grid/service/impl/ResiMineGridServiceImpl.java
+++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/grid/service/impl/ResiMineGridServiceImpl.java
@@ -4,7 +4,10 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.epmet.commons.tools.constant.AppClientConstant;
import com.epmet.commons.tools.constant.NumConstant;
+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.bean.GridInfoCache;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.HttpClientManager;
@@ -13,6 +16,7 @@ import com.epmet.dto.PaCustomerDTO;
import com.epmet.dto.form.LatestGridInfoFormDTO;
import com.epmet.dto.result.AllGridsByUserIdResultDTO;
import com.epmet.dto.result.LatestGridInfoResultDTO;
+import com.epmet.dto.result.UserBaseInfoResultDTO;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.modules.feign.EpmetUserFeignClient;
import com.epmet.modules.feign.GovOrgFeignClient;
@@ -25,6 +29,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.List;
import java.util.Map;
@@ -108,7 +113,24 @@ public class ResiMineGridServiceImpl implements ResiMineGridService {
@Override
public LatestGridInfoResultDTO latestGridInfo(LatestGridInfoFormDTO formDTO) {
logger.info(String.format("居民端获取用户最近访问网格入参%s", JSON.toJSONString(formDTO)));
- //1.调用third服务,根据appId获取客户Id
+
+ // 查询注册网格的弃用状态
+ LatestGridInfoResultDTO result = new LatestGridInfoResultDTO();
+ Result> userBaseInfo = epmetUserOpenFeignClient.queryUserBaseInfo(Arrays.asList(formDTO.getUserId()));
+ if (!userBaseInfo.success()){
+ throw new EpmetException("查询用户基本信息失败");
+ }
+ String registeredGridId = userBaseInfo.getData().get(NumConstant.ZERO).getRegisteredGridId();
+ if (StringUtils.isNotBlank(registeredGridId)){
+ GridInfoCache grid = CustomerOrgRedis.getGridInfo(registeredGridId);
+ if (grid != null) {
+ result.setRegisterGridStatus(grid.getAbandonFlag());
+ if (result.getRegisterGridStatus().compareTo(NumConstant.ONE) == NumConstant.ZERO){
+ return result;
+ }
+ }
+ }
+ //1.调用third服务,根据appId获取客户Id
JSONObject jsonObject = new JSONObject();
String customerMsgUrl = "https://epmet-cloud.elinkservice.cn/api/third/customermp/getcustomermsg/";
String data = HttpClientManager.getInstance().sendPostByJSON(customerMsgUrl + formDTO.getAppId(), JSON.toJSONString(jsonObject)).getData();
@@ -133,9 +155,14 @@ public class ResiMineGridServiceImpl implements ResiMineGridService {
Result userResult = epmetUserOpenFeignClient.latestGridInfo(formDTO);
if (!userResult.success()) {
logger.error(String.format("居民端获取用户最近访问网格失败,接口入参客户Id->%s,appId->%s,调用epmet-user-server服务返回->%s", formDTO.getCustomerId(), formDTO.getAppId(), JSON.toJSONString(userResult)));
+ return null;
}
-
- return userResult.getData();
+ if (null == userResult.getData()){
+ return result;
+ }
+ result.setGridId(StringUtils.isNotBlank(userResult.getData().getGridId()) ? userResult.getData().getGridId() : "");
+ result.setCustomerId(StringUtils.isNotBlank(userResult.getData().getCustomerId()) ? userResult.getData().getCustomerId() : "");
+ return result;
}
/**
diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/WarnAndPartyAuditResultDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/WarnAndPartyAuditResultDTO.java
new file mode 100644
index 0000000000..1b900df696
--- /dev/null
+++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/WarnAndPartyAuditResultDTO.java
@@ -0,0 +1,31 @@
+package com.epmet.resi.partymember.dto.partymember.result;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @Author zxc
+ * @DateTime 2022/3/15 8:00 下午
+ * @DESC
+ */
+@Data
+public class WarnAndPartyAuditResultDTO implements Serializable {
+
+ private static final long serialVersionUID = 6971169159679812283L;
+
+ /**
+ * 是否存在党员审核
+ */
+ private Boolean partyMemberStatus;
+
+ /**
+ * 是否存在热心居民审核
+ */
+ private Boolean warnStatus;
+
+ public WarnAndPartyAuditResultDTO() {
+ this.partyMemberStatus = false;
+ this.warnStatus = false;
+ }
+}
diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/ResiPartyMemberOpenFeignClient.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/ResiPartyMemberOpenFeignClient.java
index 0f320cf9be..debdc9afea 100644
--- a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/ResiPartyMemberOpenFeignClient.java
+++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/ResiPartyMemberOpenFeignClient.java
@@ -8,6 +8,7 @@ import com.epmet.resi.partymember.dto.partymember.form.DelPartyMemberBaseInfoFor
import com.epmet.resi.partymember.dto.partymember.form.PartyMemberBaseInfoAddFormDTO;
import com.epmet.resi.partymember.dto.partymember.result.PartyMemberBaseInfoDetailResultDTO;
import com.epmet.resi.partymember.dto.partymember.result.PartymemberBaseInfoResultDTO;
+import com.epmet.resi.partymember.dto.partymember.result.WarnAndPartyAuditResultDTO;
import com.epmet.resi.partymember.feign.fallback.ResiPartyMemberOpenFeignClientFallback;
import com.epmet.resi.partymember.feign.fallback.ResiPartyMemberOpenFeignClientFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
@@ -105,4 +106,13 @@ public interface ResiPartyMemberOpenFeignClient {
@PostMapping(value = "/resi/partymember/partymemberinfo/getpartymemberinfobycustomerid")
Result> getPartyMemberInfoByCustomerId(@RequestParam("customerId")String customerId);
+ /**
+ * Desc: 查询网格下是否存在党员审核 true:存在,false:不存在
+ * @param gridId
+ * @author zxc
+ * @date 2022/3/15 4:19 下午
+ */
+ @PostMapping("/resi/partymember/partymemberconfirmmanual/audit-reset")
+ Result partyMemberAuditReset(@RequestParam("gridId")String gridId);
+
}
diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/fallback/ResiPartyMemberOpenFeignClientFallback.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/fallback/ResiPartyMemberOpenFeignClientFallback.java
index 953d5ca326..f7fe137a60 100644
--- a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/fallback/ResiPartyMemberOpenFeignClientFallback.java
+++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/fallback/ResiPartyMemberOpenFeignClientFallback.java
@@ -9,6 +9,7 @@ import com.epmet.resi.partymember.dto.partymember.form.DelPartyMemberBaseInfoFor
import com.epmet.resi.partymember.dto.partymember.form.PartyMemberBaseInfoAddFormDTO;
import com.epmet.resi.partymember.dto.partymember.result.PartyMemberBaseInfoDetailResultDTO;
import com.epmet.resi.partymember.dto.partymember.result.PartymemberBaseInfoResultDTO;
+import com.epmet.resi.partymember.dto.partymember.result.WarnAndPartyAuditResultDTO;
import com.epmet.resi.partymember.feign.ResiPartyMemberOpenFeignClient;
import org.springframework.stereotype.Component;
@@ -69,4 +70,9 @@ public class ResiPartyMemberOpenFeignClientFallback implements ResiPartyMemberOp
public Result> getPartyMemberInfoByCustomerId(String customerId) {
return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "getPartyMemberInfoByCustomerId", customerId);
}
+
+ @Override
+ public Result partyMemberAuditReset(String gridId) {
+ return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "partyMemberAuditReset", gridId);
+ }
}
diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/PartymemberConfirmManualController.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/PartymemberConfirmManualController.java
index e776590957..ec0ae2d39c 100644
--- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/PartymemberConfirmManualController.java
+++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/PartymemberConfirmManualController.java
@@ -28,6 +28,7 @@ import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.modules.partymember.excel.PartymemberConfirmManualExcel;
import com.epmet.modules.partymember.service.PartymemberConfirmManualService;
import com.epmet.resi.partymember.dto.partymember.PartymemberConfirmManualDTO;
+import com.epmet.resi.partymember.dto.partymember.result.WarnAndPartyAuditResultDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -91,4 +92,15 @@ public class PartymemberConfirmManualController {
ExcelUtils.exportExcelToTarget(response, null, list, PartymemberConfirmManualExcel.class);
}
+ /**
+ * Desc: 查询网格下是否存在党员审核 true:存在,false:不存在
+ * @param gridId
+ * @author zxc
+ * @date 2022/3/15 4:19 下午
+ */
+ @PostMapping("audit-reset")
+ public Result partyMemberAuditReset(@RequestParam("gridId")String gridId){
+ return new Result().ok(partymemberConfirmManualService.partyMemberAuditReset(gridId));
+ }
+
}
\ No newline at end of file
diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/PartymemberConfirmManualDao.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/PartymemberConfirmManualDao.java
index 4834e28601..e3154645cf 100644
--- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/PartymemberConfirmManualDao.java
+++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/PartymemberConfirmManualDao.java
@@ -20,6 +20,7 @@ package com.epmet.modules.partymember.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.modules.partymember.entity.PartymemberConfirmManualEntity;
import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
/**
* 党员认证人工审核表 人工审核时要展示自动审核的结果,同事允许前台去修改党员认证信息表的数据
@@ -29,5 +30,21 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface PartymemberConfirmManualDao extends BaseDao {
-
+
+ /**
+ * Desc: 查询网格下存在党员审核个数
+ * @param gridId
+ * @author zxc
+ * @date 2022/3/15 4:24 下午
+ */
+ Integer partyMemberAuditReset(@Param("gridId")String gridId);
+
+ /**
+ * Desc: 查询网格下热心居民审核个数
+ * @param gridId
+ * @author zxc
+ * @date 2022/3/15 8:11 下午
+ */
+ Integer warnAuditReset(@Param("gridId")String gridId);
+
}
\ No newline at end of file
diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartymemberConfirmManualService.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartymemberConfirmManualService.java
index d3e02c1df2..6785ff7ce0 100644
--- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartymemberConfirmManualService.java
+++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartymemberConfirmManualService.java
@@ -21,6 +21,7 @@ import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.modules.partymember.entity.PartymemberConfirmManualEntity;
import com.epmet.resi.partymember.dto.partymember.PartymemberConfirmManualDTO;
+import com.epmet.resi.partymember.dto.partymember.result.WarnAndPartyAuditResultDTO;
import java.util.List;
import java.util.Map;
@@ -100,4 +101,12 @@ public interface PartymemberConfirmManualService extends BaseService
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+ SELECT
+ COUNT( ID )
+ FROM partymember_confirm_manual
+ WHERE DEL_FLAG = 0
+ AND AUDIT_STATUS = 'under_auditting'
+ AND GRID_ID = #{gridId}
+
+
+
+
+ SELECT
+ COUNT(ID)
+ FROM resi_warmhearted_apply
+ WHERE DEL_FLAG = '0'
+ AND AUDIT_STATUS = 'under_auditting'
+ AND GRID_ID = #{gridId}
+
\ No newline at end of file
diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ModifyRegGridFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ModifyRegGridFormDTO.java
new file mode 100644
index 0000000000..b54c57ca09
--- /dev/null
+++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ModifyRegGridFormDTO.java
@@ -0,0 +1,26 @@
+package com.epmet.dto.form;
+
+import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import java.io.Serializable;
+
+
+@Data
+public class ModifyRegGridFormDTO implements Serializable {
+ public interface AddUserInternalGroup {
+ }
+
+ public interface AddUserShowGroup extends CustomerClientShowGroup {
+ }
+
+ @NotBlank(message = "userId不能为空", groups = AddUserInternalGroup.class)
+ private String userId;
+ @NotBlank(message = "customerId不能为空", groups = AddUserInternalGroup.class)
+ private String customerId;
+
+ @NotBlank(message = "请选择您所在的网格", groups = AddUserShowGroup.class)
+ private String gridId;
+
+}
diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/LatestGridInfoResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/LatestGridInfoResultDTO.java
index ddf04a0fe7..1601ac09af 100644
--- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/LatestGridInfoResultDTO.java
+++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/LatestGridInfoResultDTO.java
@@ -23,4 +23,9 @@ public class LatestGridInfoResultDTO implements Serializable {
*/
private String gridId;
+ /**
+ * 居民注册网格弃用状态 1:弃用,0:正常使用
+ */
+ private Integer registerGridStatus = 0;
+
}
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/BadgeController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/BadgeController.java
index e25083f669..eace8b90b0 100644
--- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/BadgeController.java
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/BadgeController.java
@@ -1,7 +1,9 @@
package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
+import com.epmet.commons.tools.annotation.RequirePermission;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
+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;
@@ -12,7 +14,6 @@ import com.epmet.service.BadgeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
-import javax.validation.constraints.NotBlank;
import java.util.List;
import java.util.Map;
@@ -206,4 +207,28 @@ public class BadgeController {
List users = badgeService.listUsersByBadge(customerId, badgeKey);
return new Result>().ok(users);
}
+
+ /**
+ * Desc: 查询网格下是否存在未审核的徽章,true:是,false:否
+ * @param gridId
+ * @author zxc
+ * @date 2022/3/16 9:42 上午
+ */
+ @PostMapping("audit-reset")
+ public Result badgeAuditReset(@RequestParam("gridId")String gridId){
+ return new Result().ok(badgeService.badgeAuditReset(gridId));
+ }
+
+ /**
+ * desc:删除审核中的徽章认证记录-弃用网格是调用
+ * @param customerId
+ * @param gridId
+ * @return
+ */
+ @RequirePermission(requirePermission = RequirePermissionEnum.ORG_GRID_DELETE)
+ @PostMapping("deleteBadgeCertificateAuditing")
+ public Result deleteBadgeCertificateAuditing(@RequestParam("customerId") String customerId,@RequestParam("gridId")String gridId){
+ return new Result().ok(badgeService.deleteBadgeCertificateAuditing(customerId,gridId));
+ }
+
}
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/GridLatestController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/GridLatestController.java
index c470d793a9..b1b07c4e9e 100644
--- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/GridLatestController.java
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/GridLatestController.java
@@ -143,4 +143,15 @@ public class GridLatestController {
return new Result().ok(gridLatestService.latestGridInfo(formDTO));
}
+ /**
+ * desc:删除弃用网格的访问记录-弃用网格是调用
+ * @param customerId
+ * @param gridId
+ * @return
+ */
+ @PostMapping("deleteGridLatestData")
+ public Result deleteGridLatestData(@RequestParam("customerId") String customerId,@RequestParam("gridId")String gridId){
+ return new Result().ok(gridLatestService.deleteGridLatestData(customerId,gridId));
+ }
+
}
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserController.java
index 5d5870439e..3f8b17f323 100644
--- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserController.java
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserController.java
@@ -210,4 +210,20 @@ public class UserController {
ValidatorUtils.validateEntity(findIcUserFormDTO,FindIcUserFormDTO.AddUserInternalGroup.class);
return new Result().ok(userService.findIcUser(findIcUserFormDTO));
}
+
+ /**
+ * 居民端-修改注册网格
+ * @param tokenDto
+ * @param formDTO
+ * @return
+ */
+ @PostMapping(value = "modify-reg-grid")
+ public Result modifyRegGrid(@LoginUser TokenDto tokenDto,@RequestBody ModifyRegGridFormDTO formDTO){
+ formDTO.setUserId(tokenDto.getUserId());
+ formDTO.setCustomerId(tokenDto.getCustomerId());
+ ValidatorUtils.validateEntity(formDTO,ModifyRegGridFormDTO.AddUserShowGroup.class,
+ ModifyRegGridFormDTO.AddUserInternalGroup.class);
+ userService.modifyRegGrid(formDTO);
+ return new Result();
+ }
}
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/BadgeDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/BadgeDao.java
index d2a10f7026..113ed28dee 100644
--- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/BadgeDao.java
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/BadgeDao.java
@@ -204,4 +204,13 @@ public interface BadgeDao extends BaseDao {
* @date 2021.08.02 10:40
*/
List listUsersByBadge(@Param("customerId") String customerId, @Param("badgeKey") String badgeKey);
+
+ /**
+ * Desc: 查询网格下的徽章审核个数
+ * @param gridId
+ * @author zxc
+ * @date 2022/3/16 9:52 上午
+ */
+ Integer badgeAuditReset(@Param("gridId") String gridId);
+
}
\ No newline at end of file
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserRegGridChangeRecDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserRegGridChangeRecDao.java
new file mode 100644
index 0000000000..c14ace1ab7
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserRegGridChangeRecDao.java
@@ -0,0 +1,16 @@
+package com.epmet.dao;
+
+import com.epmet.commons.mybatis.dao.BaseDao;
+import com.epmet.entity.UserRegGridChangeRecEntity;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 用户注册网格变更记录表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-03-17
+ */
+@Mapper
+public interface UserRegGridChangeRecDao extends BaseDao {
+
+}
\ No newline at end of file
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserRegGridChangeRecEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserRegGridChangeRecEntity.java
new file mode 100644
index 0000000000..262c79e608
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserRegGridChangeRecEntity.java
@@ -0,0 +1,41 @@
+package com.epmet.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 用户注册网格变更记录表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-03-17
+ */
+@Data
+@EqualsAndHashCode(callSuper=false)
+@TableName("user_reg_grid_change_rec")
+public class UserRegGridChangeRecEntity extends BaseEpmetEntity {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 客户id
+ */
+ private String customerId;
+
+ /**
+ * 居民端用户id
+ */
+ private String userId;
+
+ /**
+ * 原始网格id
+ */
+ private String originGridId;
+
+ /**
+ * 当前所选择的注册网格
+ */
+ private String gridId;
+
+}
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/BadgeService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/BadgeService.java
index fc06714fd9..34defc0541 100644
--- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/BadgeService.java
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/BadgeService.java
@@ -200,4 +200,20 @@ public interface BadgeService extends BaseService {
* @date 2021.08.02 10:39
*/
List listUsersByBadge(String customerId, String badgeKey);
-}
\ No newline at end of file
+
+ /**
+ * Desc: 查询网格下是否存在未审核的徽章,true:是,false:否
+ * @param gridId
+ * @author zxc
+ * @date 2022/3/16 9:42 上午
+ */
+ Boolean badgeAuditReset(String gridId);
+
+ /**
+ * desc:根据网格id 修改审核状态
+ * @param customerId
+ * @param gridId
+ * @return
+ */
+ Integer deleteBadgeCertificateAuditing(String customerId, String gridId);
+}
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GridLatestService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GridLatestService.java
index e9ff239d1e..2ba30ae954 100644
--- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GridLatestService.java
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GridLatestService.java
@@ -140,4 +140,12 @@ public interface GridLatestService extends BaseService {
* @Date 2020/8/3
**/
LatestGridInfoResultDTO latestGridInfo(LatestGridInfoFormDTO formDTO);
+
+ /**
+ * desc:删除弃用网格的访问记录-弃用网格是调用
+ * @param customerId
+ * @param gridId
+ * @return
+ */
+ Integer deleteGridLatestData(String customerId, String gridId);
}
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBadgeCertificateRecordService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBadgeCertificateRecordService.java
index 154c8685db..64e38706b6 100644
--- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBadgeCertificateRecordService.java
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBadgeCertificateRecordService.java
@@ -92,4 +92,12 @@ public interface UserBadgeCertificateRecordService extends BaseService {
* @return
*/
EpmetUserFamilyDTO findIcUser(FindIcUserFormDTO findIcUserFormDTO);
+
+ /**
+ * 居民端-修改注册网格
+ * @param formDTO
+ */
+ void modifyRegGrid(ModifyRegGridFormDTO formDTO);
}
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java
index de2f864ff0..2a3809feb3 100644
--- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java
@@ -24,7 +24,6 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.Constant;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
-import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.exception.ValidateException;
@@ -495,4 +494,24 @@ public class BadgeServiceImpl extends BaseServiceImpl imp
public List listUsersByBadge(String customerId, String badgeKey) {
return baseDao.listUsersByBadge(customerId, badgeKey);
}
-}
\ No newline at end of file
+
+ /**
+ * Desc: 查询网格下是否存在未审核的徽章,true:是,false:否
+ * @param gridId
+ * @author zxc
+ * @date 2022/3/16 9:42 上午
+ */
+ @Override
+ public Boolean badgeAuditReset(String gridId) {
+ Integer badgeAuditCount = baseDao.badgeAuditReset(gridId);
+ if (badgeAuditCount.compareTo(NumConstant.ZERO) != NumConstant.ZERO){
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public Integer deleteBadgeCertificateAuditing(String customerId, String gridId) {
+ return userBadgeCertificateRecordService.deleteBadgeCertificateAuditing(customerId,gridId);
+ }
+}
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GridLatestServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GridLatestServiceImpl.java
index 58f9383078..fabf993292 100644
--- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GridLatestServiceImpl.java
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GridLatestServiceImpl.java
@@ -19,6 +19,7 @@ package com.epmet.service.impl;
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;
@@ -36,7 +37,6 @@ import com.epmet.dto.result.CustomerUser4PointResultDTO;
import com.epmet.dto.result.LatestGridInfoResultDTO;
import com.epmet.dto.result.UserBaseInfoResultDTO;
import com.epmet.entity.GridLatestEntity;
-import com.epmet.feign.EpmetHeartOpenFeignClient;
import com.epmet.redis.UserBaseInfoRedis;
import com.epmet.service.GridLatestService;
import com.epmet.util.ModuleConstant;
@@ -210,4 +210,13 @@ public class GridLatestServiceImpl extends BaseServiceImpl wrapper = new LambdaUpdateWrapper();
+ wrapper.eq(GridLatestEntity::getCustomerId,customerId)
+ .eq(GridLatestEntity::getGridId,gridId)
+ .set(GridLatestEntity::getUpdatedTime,System.currentTimeMillis());
+ return baseDao.delete(wrapper);
+ }
+
}
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeCertificateRecordServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeCertificateRecordServiceImpl.java
index 6f798abc79..a472ebcdae 100644
--- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeCertificateRecordServiceImpl.java
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeCertificateRecordServiceImpl.java
@@ -17,6 +17,7 @@
package com.epmet.service.impl;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
@@ -97,4 +98,13 @@ public class UserBadgeCertificateRecordServiceImpl extends BaseServiceImpl tWrapper = new LambdaQueryWrapper<>();
+ tWrapper.eq(UserBadgeCertificateRecordEntity::getCustomerId,customerId)
+ .eq(UserBadgeCertificateRecordEntity::getGridId,gridId)
+ .eq(UserBadgeCertificateRecordEntity::getAuditStatus,"auditing");
+ return baseDao.delete(tWrapper);
+ }
+
+}
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserServiceImpl.java
index af2a9e2513..12380e64c2 100644
--- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserServiceImpl.java
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserServiceImpl.java
@@ -1,26 +1,27 @@
package com.epmet.service.impl;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
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.bean.GridInfoCache;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.CpUserDetailRedis;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.UserConstant;
-import com.epmet.dao.UserDao;
-import com.epmet.dao.UserResiInfoDao;
-import com.epmet.dao.UserRoleDao;
-import com.epmet.dao.UserWechatDao;
+import com.epmet.dao.*;
import com.epmet.dto.*;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
-import com.epmet.entity.UserBaseInfoEntity;
-import com.epmet.entity.UserEntity;
-import com.epmet.entity.UserWechatEntity;
+import com.epmet.entity.*;
+import com.epmet.feign.EpmetHeartOpenFeignClient;
import com.epmet.feign.EpmetPointOpenFeignClient;
import com.epmet.feign.GovOrgFeignClient;
+import com.epmet.redis.UserBaseInfoRedis;
import com.epmet.service.IcResiUserService;
import com.epmet.service.UserBaseInfoService;
import com.epmet.service.UserService;
@@ -31,6 +32,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Arrays;
@@ -63,6 +65,19 @@ public class UserServiceImpl extends BaseServiceImpl implem
private UserResiInfoDao userResiInfoDao;
@Autowired
private IcResiUserService icResiUserService;
+ @Autowired
+ private RegisterRelationDao registerRelationDao;
+ @Autowired
+ private EpmetHeartOpenFeignClient epmetHeartOpenFeignClient;
+ @Autowired
+ private ResiUserBadgeDao resiUserBadgeDao;
+ @Autowired
+ private UserBadgeCertificateRecordDao userBadgeCertificateRecordDao;
+ @Autowired
+ private UserBaseInfoRedis userBaseInfoRedis;
+ @Autowired
+ private UserRegGridChangeRecDao UserRegGridChangeRecDao;
+
private static final Logger log = LoggerFactory.getLogger(UserServiceImpl.class);
@@ -417,4 +432,86 @@ public class UserServiceImpl extends BaseServiceImpl implem
return result;
}
+ /**
+ * 居民端-修改注册网格
+ *
+ * @param formDTO
+ */
+ @Transactional(rollbackFor = Exception.class)
+ @Override
+ public void modifyRegGrid(ModifyRegGridFormDTO formDTO) {
+ GridInfoCache newGridInfo= CustomerOrgRedis.getGridInfo(formDTO.getGridId());
+ RegisterRelationEntity originReg=registerRelationDao.selectRegisteredGridIdByUserIdAndCustomerId(formDTO.getUserId(),formDTO.getCustomerId());
+ if (null == newGridInfo || null == originReg) {
+ throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "居民端_修改注册网格:查询网格信息异常", "服务器开小差了...");
+ }
+ //修改register_relation表
+ LambdaQueryWrapper originWrapper=new LambdaQueryWrapper();
+ originWrapper.eq(RegisterRelationEntity::getCustomerId,formDTO.getCustomerId())
+ .eq(RegisterRelationEntity::getUserId,formDTO.getUserId())
+ .eq(RegisterRelationEntity::getFirstRegister, NumConstant.ONE_STR);
+ //1、删除废弃网格的(现在生产存在同一个用户相同的网格id多条记录,所以用delete方法)
+ registerRelationDao.delete(originWrapper);
+
+ //2、删除用户与当前选择的网格的关系,新插入一条注册关系,
+ LambdaQueryWrapper deleteWrapper=new LambdaQueryWrapper();
+ deleteWrapper.eq(RegisterRelationEntity::getCustomerId,formDTO.getCustomerId())
+ .eq(RegisterRelationEntity::getUserId,formDTO.getUserId())
+ .eq(RegisterRelationEntity::getGridId, formDTO.getGridId());
+ registerRelationDao.delete(deleteWrapper);
+
+ RegisterRelationEntity insert=new RegisterRelationEntity();
+ insert.setCustomerId(formDTO.getCustomerId());
+ insert.setGridId(formDTO.getGridId());
+ insert.setUserId(formDTO.getUserId());
+ insert.setFirstRegister(NumConstant.ONE_STR);
+ insert.setRegister(NumConstant.ONE_STR);
+ insert.setParticipation(NumConstant.ONE_STR);
+ registerRelationDao.insert(insert);
+
+ //2、修改历史徽章表
+ LambdaUpdateWrapper recUpdate=new LambdaUpdateWrapper<>();
+ recUpdate.set(UserBadgeCertificateRecordEntity::getGridId,newGridInfo.getId())
+ .set(UserBadgeCertificateRecordEntity::getUpdatedBy,formDTO.getUserId())
+ .set(UserBadgeCertificateRecordEntity::getUpdatedTime,new Date());
+ recUpdate.eq(UserBadgeCertificateRecordEntity::getCustomerId,formDTO.getCustomerId())
+ .eq(UserBadgeCertificateRecordEntity::getUserId,formDTO.getUserId());
+ userBadgeCertificateRecordDao.update(null,recUpdate);
+
+ LambdaUpdateWrapper badgeUpdate=new LambdaUpdateWrapper<>();
+ badgeUpdate.set(ResiUserBadgeEntity::getGridId,newGridInfo.getId())
+ .set(ResiUserBadgeEntity::getUpdatedBy,formDTO.getUserId())
+ .set(ResiUserBadgeEntity::getUpdatedTime,new Date());;
+ badgeUpdate.eq(ResiUserBadgeEntity::getCustomerId,formDTO.getCustomerId())
+ .eq(ResiUserBadgeEntity::getUserId,formDTO.getUserId());
+ resiUserBadgeDao.update(null,badgeUpdate);
+
+ //3、修改支援者信息表
+ modifyVolunteerGrid(formDTO,newGridInfo);
+
+ //4、删除用户缓存信息
+ userBaseInfoRedis.clearUserCache(Arrays.asList(formDTO.getUserId()));
+ //5、插入用户注册网格变更记录
+ UserRegGridChangeRecEntity log=new UserRegGridChangeRecEntity();
+ log.setCustomerId(formDTO.getCustomerId());
+ log.setUserId(formDTO.getUserId());
+ log.setOriginGridId(originReg.getGridId());
+ log.setGridId(formDTO.getGridId());
+ UserRegGridChangeRecDao.insert(log);
+ }
+
+ private void modifyVolunteerGrid(ModifyRegGridFormDTO formDTO, GridInfoCache newGridInfo) {
+ VolunteerInfoDTO volunteerInfoDTO=new VolunteerInfoDTO();
+ volunteerInfoDTO.setCustomerId(formDTO.getCustomerId());
+ volunteerInfoDTO.setUserId(formDTO.getUserId());
+ volunteerInfoDTO.setGridId(newGridInfo.getId());
+ volunteerInfoDTO.setPid(newGridInfo.getPid());
+ volunteerInfoDTO.setPids(newGridInfo.getPids());
+ volunteerInfoDTO.setGridName(newGridInfo.getGridName());
+ Result volunteerRes=epmetHeartOpenFeignClient.modifyVolunteerGrid(volunteerInfoDTO);
+ if (!volunteerRes.success()) {
+ throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "居民端_修改注册网格:修改用户志愿者信息异常", "服务器开小差了...");
+ }
+ }
+
}
diff --git a/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.25__create_user_reg_grid_rec.sql b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.25__create_user_reg_grid_rec.sql
new file mode 100644
index 0000000000..85a0db8e18
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.25__create_user_reg_grid_rec.sql
@@ -0,0 +1,14 @@
+CREATE TABLE `user_reg_grid_change_rec` (
+ `ID` varchar(64) NOT NULL COMMENT '主键',
+ `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id',
+ `USER_ID` varchar(64) NOT NULL COMMENT '居民端用户id',
+ `ORIGIN_GRID_ID` varchar(64) NOT NULL COMMENT '原始网格id',
+ `GRID_ID` varchar(64) NOT NULL COMMENT '当前所选择的注册网格',
+ `DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识 1删除;0未删除',
+ `REVISION` int(11) NOT NULL COMMENT '乐观锁',
+ `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人',
+ `CREATED_TIME` datetime NOT NULL COMMENT '创建时间',
+ `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人',
+ `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
+ PRIMARY KEY (`ID`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户注册网格变更记录表';
\ No newline at end of file
diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml
index 09c84bde81..275babd61f 100644
--- a/epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml
+++ b/epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml
@@ -330,4 +330,14 @@
and user_base_info.DEL_FLAG = 0)
+
+
+
+ SELECT
+ COUNT(ID)
+ FROM user_badge_certificate_record
+ WHERE DEL_FLAG = '0'
+ AND AUDIT_STATUS = 'auditing'
+ AND GRID_ID = #{gridId}
+
\ No newline at end of file
diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/RegisterRelationDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/RegisterRelationDao.xml
index 74c1691615..3ce51f018a 100644
--- a/epmet-user/epmet-user-server/src/main/resources/mapper/RegisterRelationDao.xml
+++ b/epmet-user/epmet-user-server/src/main/resources/mapper/RegisterRelationDao.xml
@@ -79,7 +79,7 @@
- SELECT GRID_ID FROM register_relation WHERE DEL_FLAG = 0 and USER_ID = #{userId}
+ SELECT GRID_ID FROM register_relation WHERE DEL_FLAG = 0 AND FIRST_REGISTER = 1 and USER_ID = #{userId}
diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserRegGridChangeRecDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserRegGridChangeRecDao.xml
new file mode 100644
index 0000000000..4fcd5c664e
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserRegGridChangeRecDao.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file