diff --git a/epmet-admin/epmet-admin-client/src/main/java/com/epmet/feign/EpmetAdminOpenFeignClient.java b/epmet-admin/epmet-admin-client/src/main/java/com/epmet/feign/EpmetAdminOpenFeignClient.java index 65b73cdad3..6d7e1124dd 100644 --- a/epmet-admin/epmet-admin-client/src/main/java/com/epmet/feign/EpmetAdminOpenFeignClient.java +++ b/epmet-admin/epmet-admin-client/src/main/java/com/epmet/feign/EpmetAdminOpenFeignClient.java @@ -1,13 +1,19 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.dto.form.DictListFormDTO; +import com.epmet.commons.tools.dto.result.DictListResultDTO; +import com.epmet.commons.tools.dto.result.OptionResultDTO; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.result.CorsConfigResultDTO; import com.epmet.feign.fallback.EpmetAdminOpenFeignClientFallbackFactory; import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; import java.util.List; +import java.util.Map; @FeignClient(name = ServiceConstant.EPMET_ADMIN_SERVER, fallbackFactory = EpmetAdminOpenFeignClientFallbackFactory.class) //@FeignClient(name = ServiceConstant.EPMET_ADMIN_SERVER, fallbackFactory = EpmetAdminOpenFeignClientFallbackFactory.class, url = "localhost:8082") @@ -21,4 +27,67 @@ public interface EpmetAdminOpenFeignClient { */ @PostMapping("/sys/cors-config/list") Result> list(); + + /** + * @Description 文化程度 + * @Param + * @Return {@link Result>} + * @Author zhaoqifeng + * @Date 2021/10/26 17:27 + */ + @PostMapping("/sys/dict/data/education") + Result> getEducationOption(); + + /** + * @Description 住房性质 + * @Param + * @Return {@link Result>} + * @Author zhaoqifeng + * @Date 2021/10/26 17:27 + */ + @PostMapping("/sys/dict/data/house") + Result> getHouseOption(); + + /** + * @Description 民族 + * @Param + * @Return {@link Result>} + * @Author zhaoqifeng + * @Date 2021/10/26 17:27 + */ + @PostMapping("/sys/dict/data/nation") + Result> getNationOption(); + + /** + * @Description 九小场所 + * @Param + * @Return {@link Result>} + * @Author zhaoqifeng + * @Date 2021/10/26 17:27 + */ + @PostMapping("/sys/dict/data/ninesmallplaces") + Result> getNineSmallPlacesOption(); + + /** + * @Description 人员关系 + * @Param + * @Return {@link Result>} + * @Author zhaoqifeng + * @Date 2021/10/26 17:27 + */ + @PostMapping("/sys/dict/data/relationship") + Result> getRelationshipOption(); + + /** + * 字典数据查询通用接口 + * @Param dictType + * @Return {@link Result< Map < String, String>>} + * @Author zhaoqifeng + * @Date 2021/11/19 17:36 + */ + @PostMapping("/sys/dict/data/dictmap/{dictType}") + Result> dictMap(@PathVariable("dictType") String dictType); + + @PostMapping("/sys/dict/data/dictlist") + Result> dictList(@RequestBody DictListFormDTO formDTO); } diff --git a/epmet-admin/epmet-admin-client/src/main/java/com/epmet/feign/fallback/EpmetAdminOpenFeignClientFallback.java b/epmet-admin/epmet-admin-client/src/main/java/com/epmet/feign/fallback/EpmetAdminOpenFeignClientFallback.java index 69d8a45bbc..6c16e8f3ae 100644 --- a/epmet-admin/epmet-admin-client/src/main/java/com/epmet/feign/fallback/EpmetAdminOpenFeignClientFallback.java +++ b/epmet-admin/epmet-admin-client/src/main/java/com/epmet/feign/fallback/EpmetAdminOpenFeignClientFallback.java @@ -1,18 +1,56 @@ package com.epmet.feign.fallback; import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.dto.form.DictListFormDTO; +import com.epmet.commons.tools.dto.result.DictListResultDTO; +import com.epmet.commons.tools.dto.result.OptionResultDTO; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.result.CorsConfigResultDTO; import com.epmet.feign.EpmetAdminOpenFeignClient; -import org.springframework.stereotype.Component; import java.util.List; +import java.util.Map; //@Component public class EpmetAdminOpenFeignClientFallback implements EpmetAdminOpenFeignClient { @Override public Result> list() { - return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "list", null); + return ModuleUtils.feignConError(ServiceConstant.EPMET_ADMIN_SERVER, "list", null); + } + + @Override + public Result> getEducationOption() { + return ModuleUtils.feignConError(ServiceConstant.EPMET_ADMIN_SERVER, "getEducationOption", null); + } + + @Override + public Result> getHouseOption() { + return ModuleUtils.feignConError(ServiceConstant.EPMET_ADMIN_SERVER, "getHouseOption", null); + } + + @Override + public Result> getNationOption() { + return ModuleUtils.feignConError(ServiceConstant.EPMET_ADMIN_SERVER, "getNationOption", null); + } + + @Override + public Result> getNineSmallPlacesOption() { + return ModuleUtils.feignConError(ServiceConstant.EPMET_ADMIN_SERVER, "getNineSmallPlacesOption", null); + } + + @Override + public Result> getRelationshipOption() { + return ModuleUtils.feignConError(ServiceConstant.EPMET_ADMIN_SERVER, "getRelationshipOption", null); + } + + @Override + public Result> dictMap(String dictType) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_ADMIN_SERVER, "dictMap", dictType); + } + + @Override + public Result> dictList(DictListFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_ADMIN_SERVER, "dictList", formDTO); } } diff --git a/epmet-admin/epmet-admin-server/deploy/docker-compose-prod.yml b/epmet-admin/epmet-admin-server/deploy/docker-compose-prod.yml index e9d8d41470..0fb85349bf 100644 --- a/epmet-admin/epmet-admin-server/deploy/docker-compose-prod.yml +++ b/epmet-admin/epmet-admin-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-admin-server: container_name: epmet-admin-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-admin-server:0.3.15 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-admin-server:0.3.28 ports: - "8082:8082" network_mode: host # 使用现有网络 @@ -15,4 +15,4 @@ services: resources: limits: cpus: '0.1' - memory: 600M \ No newline at end of file + memory: 600M diff --git a/epmet-admin/epmet-admin-server/pom.xml b/epmet-admin/epmet-admin-server/pom.xml index cc3884aa4e..8c073dd8c3 100644 --- a/epmet-admin/epmet-admin-server/pom.xml +++ b/epmet-admin/epmet-admin-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.15 + 0.3.28 com.epmet epmet-admin @@ -246,7 +246,7 @@ - false + true true diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysDictDataController.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysDictDataController.java index 8b26c48efd..aff54e6e09 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysDictDataController.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysDictDataController.java @@ -8,18 +8,21 @@ package com.epmet.controller; -import com.epmet.dto.SysDictDataDTO; -import com.epmet.service.SysDictDataService; -import com.epmet.commons.tools.constant.Constant; +import com.epmet.commons.tools.dto.form.DictListFormDTO; +import com.epmet.commons.tools.dto.result.DictListResultDTO; +import com.epmet.commons.tools.dto.result.OptionResultDTO; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.AssertUtils; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.SysDictDataDTO; +import com.epmet.service.SysDictDataService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import java.util.List; import java.util.Map; /** @@ -78,4 +81,85 @@ public class SysDictDataController { return new Result(); } + /** + * @Description 九小场所 + * @Param + * @Return {@link Result>} + * @Author zhaoqifeng + * @Date 2021/10/26 17:27 + */ + @PostMapping("ninesmallplaces") + public Result> getNineSmallPlacesOption() { + return new Result>().ok(sysDictDataService.getNineSmallPlacesOption()); + } + + /** + * @Description 文化程度 + * @Param + * @Return {@link Result>} + * @Author zhaoqifeng + * @Date 2021/10/26 17:27 + */ + @PostMapping("education") + public Result> getEducationOption() { + return new Result>().ok(sysDictDataService.getEducationOption()); + } + + /** + * @Description 民族 + * @Param + * @Return {@link Result>} + * @Author zhaoqifeng + * @Date 2021/10/26 17:27 + */ + @PostMapping("nation") + public Result> getNationOption() { + return new Result>().ok(sysDictDataService.getNationOption()); + } + + /** + * @Description 人员关系 + * @Param + * @Return {@link Result>} + * @Author zhaoqifeng + * @Date 2021/10/26 17:27 + */ + @PostMapping("relationship") + public Result> getRelationshipOption() { + return new Result>().ok(sysDictDataService.getRelationshipOption()); + } + + /** + * @Description 住房性质 + * @Param + * @Return {@link Result>} + * @Author zhaoqifeng + * @Date 2021/10/26 17:27 + */ + @PostMapping("house") + public Result> getHouseOption() { + return new Result>().ok(sysDictDataService.getHouseOption()); + } + + /** + * @Description 字典数据查询通用接口 + * @Author sun + */ + @PostMapping("dictlist") + public Result> dictList(@RequestBody DictListFormDTO formDTO) { + return new Result>().ok(sysDictDataService.dictList(formDTO.getDictType())); + } + + /** + * 字典数据查询通用接口 + * @Param dictType + * @Return {@link Result< Map< String, String>>} + * @Author zhaoqifeng + * @Date 2021/11/19 17:36 + */ + @PostMapping("dictmap/{dictType}") + public Result> dictMap(@PathVariable("dictType") String dictType) { + return new Result>().ok(sysDictDataService.dictMap(dictType)); + } + } diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/dao/SysDictDataDao.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/dao/SysDictDataDao.java index 50528f1326..59ee893a89 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/dao/SysDictDataDao.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/dao/SysDictDataDao.java @@ -9,6 +9,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.commons.tools.dto.result.DictListResultDTO; import com.epmet.entity.DictData; import com.epmet.entity.SysDictDataEntity; import org.apache.ibatis.annotations.Mapper; @@ -27,4 +28,6 @@ public interface SysDictDataDao extends BaseDao { * 字典数据列表 */ List getDictDataList(); + + List selectDictList(String dictType); } diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/bean/log/LogOperationHelper.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/bean/log/LogOperationHelper.java index b8c82f6640..ce6502583e 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/bean/log/LogOperationHelper.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/bean/log/LogOperationHelper.java @@ -57,7 +57,7 @@ public class LogOperationHelper implements ResultDataResolver { form.setUserId(userId); Result result = userOpenFeignClient.getCustomerStaffInfoByUserId(form); CustomerStaffDTO staffInfo = getResultDataOrThrowsException(result, ServiceConstant.EPMET_ADMIN_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), - "调用epmet-user服务获取staff信息发生异常"); + "调用epmet-user服务获取staff信息发生异常", null); return new OperatorInfo(staffInfo.getCustomerId(), staffInfo.getMobile(), staffInfo.getRealName()); } } diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/AuthOperationLogListener.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/AuthOperationLogListener.java index 4f9e361fc5..6f8afd1418 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/AuthOperationLogListener.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/AuthOperationLogListener.java @@ -2,22 +2,19 @@ package com.epmet.mq.listener.listener; import com.alibaba.fastjson.JSON; import com.epmet.auth.constants.AuthOperationEnum; +import com.epmet.commons.rocketmq.constants.MQUserPropertys; import com.epmet.commons.rocketmq.messages.LoginMQMsg; -import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.distributedlock.DistributedLock; -import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.exception.RenException; -import com.epmet.commons.tools.feign.ResultDataResolver; -import com.epmet.commons.tools.utils.IpUtils; -import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.redis.RedisKeys; +import com.epmet.commons.tools.redis.RedisUtils; import com.epmet.commons.tools.utils.SpringContextUtils; -import com.epmet.dto.CustomerStaffDTO; import com.epmet.entity.LogOperationEntity; -import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.mq.listener.bean.log.LogOperationHelper; import com.epmet.mq.listener.bean.log.OperatorInfo; import com.epmet.service.LogOperationService; +import org.apache.commons.lang3.StringUtils; import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext; import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus; import org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently; @@ -40,8 +37,15 @@ public class AuthOperationLogListener implements MessageListenerConcurrently { private Logger logger = LoggerFactory.getLogger(getClass()); + private RedisUtils redisUtils; + @Override public ConsumeConcurrentlyStatus consumeMessage(List msgs, ConsumeConcurrentlyContext context) { + + if (redisUtils == null) { + redisUtils = SpringContextUtils.getBean(RedisUtils.class); + } + try { msgs.forEach(msg -> consumeMessage(msg)); } catch (Exception e) { @@ -54,6 +58,7 @@ public class AuthOperationLogListener implements MessageListenerConcurrently { private void consumeMessage(MessageExt messageExt) { String tags = messageExt.getTags(); String msg = new String(messageExt.getBody()); + String pendingMsgLabel = messageExt.getUserProperty(MQUserPropertys.BLOCKED_MSG_LABEL); logger.info("认证操作日志监听器-收到消息内容:{}", msg); LoginMQMsg msgObj = JSON.parseObject(msg, LoginMQMsg.class); @@ -91,5 +96,27 @@ public class AuthOperationLogListener implements MessageListenerConcurrently { } finally { distributedLock.unLock(lock); } + + if (StringUtils.isNotBlank(pendingMsgLabel)) { + try { + removePendingMqMsgCache(pendingMsgLabel); + } catch (Exception e) { + logger.error("【登录操作事件监听器】-删除mq阻塞消息缓存失败:{}", ExceptionUtils.getErrorStackTrace(e)); + } + } + } + + /** + * @description + * + * @param pendingMsgLabel + * @return + * @author wxz + * @date 2021.10.14 16:32:32 + */ + private void removePendingMqMsgCache(String pendingMsgLabel) { + String key = RedisKeys.blockedMqMsgKey(pendingMsgLabel); + redisUtils.delete(key); + //logger.info("【登录操作事件监听器】删除pendingMsgLabel成功:{}", pendingMsgLabel); } } diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/PointOperationLogListener.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/PointOperationLogListener.java index f953c35edc..aa4f50a768 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/PointOperationLogListener.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/PointOperationLogListener.java @@ -1,10 +1,13 @@ package com.epmet.mq.listener.listener; import com.alibaba.fastjson.JSON; +import com.epmet.commons.rocketmq.constants.MQUserPropertys; import com.epmet.commons.rocketmq.messages.PointRuleChangedMQMsg; import com.epmet.commons.tools.distributedlock.DistributedLock; import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.redis.RedisKeys; +import com.epmet.commons.tools.redis.RedisUtils; import com.epmet.commons.tools.utils.SpringContextUtils; import com.epmet.entity.LogOperationEntity; import com.epmet.enums.SystemMessageTypeEnum; @@ -34,8 +37,15 @@ public class PointOperationLogListener implements MessageListenerConcurrently { private Logger logger = LoggerFactory.getLogger(getClass()); + private RedisUtils redisUtils; + @Override public ConsumeConcurrentlyStatus consumeMessage(List msgs, ConsumeConcurrentlyContext context) { + + if (redisUtils == null) { + redisUtils = SpringContextUtils.getBean(RedisUtils.class); + } + try { msgs.forEach(msg -> consumeMessage(msg)); } catch (Exception e) { @@ -48,6 +58,7 @@ public class PointOperationLogListener implements MessageListenerConcurrently { private void consumeMessage(MessageExt messageExt) { String opeType = messageExt.getTags(); String msg = new String(messageExt.getBody()); + String pendingMsgLabel = messageExt.getUserProperty(MQUserPropertys.BLOCKED_MSG_LABEL); logger.info("积分操作日志监听器-收到消息内容:{}", msg); PointRuleChangedMQMsg msgObj = JSON.parseObject(msg, PointRuleChangedMQMsg.class); @@ -87,5 +98,27 @@ public class PointOperationLogListener implements MessageListenerConcurrently { } finally { distributedLock.unLock(lock); } + + if (StringUtils.isNotBlank(pendingMsgLabel)) { + try { + removePendingMqMsgCache(pendingMsgLabel); + } catch (Exception e) { + logger.error("【积分操作事件监听器】-删除mq阻塞消息缓存失败:{}", ExceptionUtils.getErrorStackTrace(e)); + } + } + } + + /** + * @description + * + * @param pendingMsgLabel + * @return + * @author wxz + * @date 2021.10.14 16:32:32 + */ + private void removePendingMqMsgCache(String pendingMsgLabel) { + String key = RedisKeys.blockedMqMsgKey(pendingMsgLabel); + redisUtils.delete(key); + //logger.info("【积分操作事件监听器】删除pendingMsgLabel成功{}", pendingMsgLabel); } } diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/ProjectOperationLogListener.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/ProjectOperationLogListener.java index 13384ea62e..a47d55c2de 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/ProjectOperationLogListener.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/ProjectOperationLogListener.java @@ -1,11 +1,14 @@ package com.epmet.mq.listener.listener; import com.alibaba.fastjson.JSON; +import com.epmet.commons.rocketmq.constants.MQUserPropertys; import com.epmet.commons.rocketmq.messages.LoginMQMsg; import com.epmet.commons.rocketmq.messages.ProjectChangedMQMsg; import com.epmet.commons.tools.distributedlock.DistributedLock; import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.redis.RedisKeys; +import com.epmet.commons.tools.redis.RedisUtils; import com.epmet.commons.tools.utils.SpringContextUtils; import com.epmet.entity.LogOperationEntity; import com.epmet.mq.listener.bean.log.LogOperationHelper; @@ -34,8 +37,15 @@ public class ProjectOperationLogListener implements MessageListenerConcurrently private Logger logger = LoggerFactory.getLogger(getClass()); + private RedisUtils redisUtils; + @Override public ConsumeConcurrentlyStatus consumeMessage(List msgs, ConsumeConcurrentlyContext context) { + + if (redisUtils == null) { + redisUtils = SpringContextUtils.getBean(RedisUtils.class); + } + try { msgs.forEach(msg -> consumeMessage(msg)); } catch (Exception e) { @@ -48,6 +58,7 @@ public class ProjectOperationLogListener implements MessageListenerConcurrently private void consumeMessage(MessageExt messageExt) { //String tags = messageExt.getTags(); String msg = new String(messageExt.getBody()); + String pendingMsgLabel = messageExt.getUserProperty(MQUserPropertys.BLOCKED_MSG_LABEL); logger.info("项目变动操作日志监听器-收到消息内容:{}", msg); ProjectChangedMQMsg msgObj = JSON.parseObject(msg, ProjectChangedMQMsg.class); @@ -87,6 +98,14 @@ public class ProjectOperationLogListener implements MessageListenerConcurrently } finally { distributedLock.unLock(lock); } + + if (StringUtils.isNotBlank(pendingMsgLabel)) { + try { + removePendingMqMsgCache(pendingMsgLabel); + } catch (Exception e) { + logger.error("【项目操作事件监听器】-删除mq阻塞消息缓存失败:{}", ExceptionUtils.getErrorStackTrace(e)); + } + } } private String getOperationTypeDisplay(String type) { @@ -107,4 +126,18 @@ public class ProjectOperationLogListener implements MessageListenerConcurrently return null; } } + + /** + * @description + * + * @param pendingMsgLabel + * @return + * @author wxz + * @date 2021.10.14 16:32:32 + */ + private void removePendingMqMsgCache(String pendingMsgLabel) { + String key = RedisKeys.blockedMqMsgKey(pendingMsgLabel); + redisUtils.delete(key); + //logger.info("【项目操作事件监听器】删除pendingMsgLabel成功{}", pendingMsgLabel); + } } diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/SysDictDataService.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/SysDictDataService.java index 2e01f49d91..9109cfdc86 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/SysDictDataService.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/SysDictDataService.java @@ -8,11 +8,14 @@ package com.epmet.service; -import com.epmet.dto.SysDictDataDTO; import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.dto.result.DictListResultDTO; +import com.epmet.commons.tools.dto.result.OptionResultDTO; import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.SysDictDataDTO; import com.epmet.entity.SysDictDataEntity; +import java.util.List; import java.util.Map; /** @@ -31,5 +34,57 @@ public interface SysDictDataService extends BaseService { void update(SysDictDataDTO dto); void delete(Long[] ids); + /** + * 九小场所 + * @Param + * @Return {@link List} + * @Author zhaoqifeng + * @Date 2021/10/26 17:11 + */ + List getNineSmallPlacesOption(); + + /** + * 文化程度 + * @Param + * @Return {@link List} + * @Author zhaoqifeng + * @Date 2021/10/26 17:12 + */ + List getEducationOption(); + + /** + * 民族 + * @Param + * @Return {@link List} + * @Author zhaoqifeng + * @Date 2021/10/26 17:12 + */ + List getNationOption(); + + /** + * 人员关系 + * @Param + * @Return {@link List} + * @Author zhaoqifeng + * @Date 2021/10/26 17:12 + */ + List getRelationshipOption(); + + /** + * 住房性质 + * @Param + * @Return {@link List} + * @Author zhaoqifeng + * @Date 2021/10/26 17:12 + */ + List getHouseOption(); + + /** + * @Description 字典数据查询通用接口 + * @Author sun + */ + List dictList(String dictType); + + Map dictMap(String dictType); } diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/LogOperationServiceImpl.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/LogOperationServiceImpl.java index 09b9269063..4ccc4e868f 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/LogOperationServiceImpl.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/LogOperationServiceImpl.java @@ -82,7 +82,7 @@ public class LogOperationServiceImpl implements LogOperationService, ResultDataR CustomerStaffFormDTO form = new CustomerStaffFormDTO(); form.setUserIds(new ArrayList<>(userIds)); Result> result = userOpenFeignClient.list(form); - List staffs = getResultDataOrThrowsException(result, ServiceConstant.EPMET_USER_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "调用user服务发生异常"); + List staffs = getResultDataOrThrowsException(result, ServiceConstant.EPMET_USER_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "调用user服务发生异常", null); HashMap staffMap = new HashMap<>(); staffs.forEach(s -> { @@ -103,7 +103,7 @@ public class LogOperationServiceImpl implements LogOperationService, ResultDataR form.setCustomerId(customerId); form.setMobile(operatorMobile); Result> result = userOpenFeignClient.list(form); - List staffs = getResultDataOrThrowsException(result, ServiceConstant.EPMET_USER_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "调用user服务发生异常"); + List staffs = getResultDataOrThrowsException(result, ServiceConstant.EPMET_USER_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "调用user服务发生异常", null); if (staffs.size() == 0) { return null; @@ -134,7 +134,7 @@ public class LogOperationServiceImpl implements LogOperationService, ResultDataR CustomerStaffFormDTO form = new CustomerStaffFormDTO(); form.setRealName(operatorName); Result> result = userOpenFeignClient.list(form); - List staffs = getResultDataOrThrowsException(result, ServiceConstant.EPMET_USER_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "调用user服务查询工作人员信息发生异常"); + List staffs = getResultDataOrThrowsException(result, ServiceConstant.EPMET_USER_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "调用user服务查询工作人员信息发生异常", null); List userIds = new ArrayList<>(); HashMap staffMap = new HashMap(); diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/SysDictDataServiceImpl.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/SysDictDataServiceImpl.java index 8a13891ab9..d3c61d6c16 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/SysDictDataServiceImpl.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/SysDictDataServiceImpl.java @@ -8,9 +8,12 @@ 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; +import com.epmet.commons.tools.dto.result.DictListResultDTO; +import com.epmet.commons.tools.dto.result.OptionResultDTO; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.dao.SysDictDataDao; @@ -22,7 +25,9 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.Arrays; +import java.util.List; import java.util.Map; +import java.util.stream.Collectors; /** * 字典类型 @@ -85,4 +90,131 @@ public class SysDictDataServiceImpl extends BaseServiceImpl} + * @Author zhaoqifeng + * @Date 2021/10/26 17:11 + */ + @Override + public List getNineSmallPlacesOption() { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(SysDictDataEntity::getDictTypeId, 1000000000000000001L); + wrapper.orderByAsc(SysDictDataEntity::getSort); + List list = baseDao.selectList(wrapper); + return list.stream().map(item -> { + OptionResultDTO dto = new OptionResultDTO(); + dto.setValue(item.getDictValue()); + dto.setLabel(item.getDictLabel()); + dto.setSysDictDataId(item.getId().toString()); + return dto; + }).collect(Collectors.toList()); + } + + /** + * 文化程度 + * + * @Param + * @Return {@link List} + * @Author zhaoqifeng + * @Date 2021/10/26 17:12 + */ + @Override + public List getEducationOption() { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(SysDictDataEntity::getDictTypeId, 1000000000000000002L); + wrapper.orderByAsc(SysDictDataEntity::getSort); + List list = baseDao.selectList(wrapper); + return list.stream().map(item -> { + OptionResultDTO dto = new OptionResultDTO(); + dto.setValue(item.getDictValue()); + dto.setLabel(item.getDictLabel()); + return dto; + }).collect(Collectors.toList()); + } + + /** + * 民族 + * + * @Param + * @Return {@link List} + * @Author zhaoqifeng + * @Date 2021/10/26 17:12 + */ + @Override + public List getNationOption() { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(SysDictDataEntity::getDictTypeId, 1000000000000000003L); + wrapper.orderByAsc(SysDictDataEntity::getSort); + List list = baseDao.selectList(wrapper); + return list.stream().map(item -> { + OptionResultDTO dto = new OptionResultDTO(); + dto.setValue(item.getDictValue()); + dto.setLabel(item.getDictLabel()); + return dto; + }).collect(Collectors.toList()); + } + + /** + * 人员关系 + * + * @Param + * @Return {@link List} + * @Author zhaoqifeng + * @Date 2021/10/26 17:12 + */ + @Override + public List getRelationshipOption() { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(SysDictDataEntity::getDictTypeId, 1000000000000000004L); + wrapper.orderByAsc(SysDictDataEntity::getSort); + List list = baseDao.selectList(wrapper); + return list.stream().map(item -> { + OptionResultDTO dto = new OptionResultDTO(); + dto.setValue(item.getDictValue()); + dto.setLabel(item.getDictLabel()); + return dto; + }).collect(Collectors.toList()); + } + + /** + * 住房性质 + * + * @Param + * @Return {@link List} + * @Author zhaoqifeng + * @Date 2021/10/26 17:12 + */ + @Override + public List getHouseOption() { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(SysDictDataEntity::getDictTypeId, 1000000000000000005L); + wrapper.orderByAsc(SysDictDataEntity::getSort); + List list = baseDao.selectList(wrapper); + return list.stream().map(item -> { + OptionResultDTO dto = new OptionResultDTO(); + dto.setValue(item.getDictValue()); + dto.setLabel(item.getDictLabel()); + return dto; + }).collect(Collectors.toList()); + } + + /** + * @Description 字典数据查询通用接口 + * @Author sun + */ + @Override + public List dictList(String dictType) { + List resultDTOList = baseDao.selectDictList(dictType); + return resultDTOList; + } + + @Override + public Map dictMap(String dictType) { + List resultDTOList = baseDao.selectDictList(dictType); + return resultDTOList.stream().collect(Collectors.toMap(DictListResultDTO::getValue, DictListResultDTO::getLabel)); + } + } diff --git a/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.6__add_dict_data.sql b/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.6__add_dict_data.sql new file mode 100644 index 0000000000..78f16f4d94 --- /dev/null +++ b/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.6__add_dict_data.sql @@ -0,0 +1,29 @@ +-- 1、增加字典类型 +INSERT INTO `epmet_admin`.`sys_dict_type` (`id`, `dict_type`, `dict_name`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (8, 'user_demand_status', '居民需求状态', '待处理:pending;已取消canceled;已派单:assigned;已接单:have_order;已完成:finished', 8, 1067246875800000001, '2021-11-18 16:29:58', 1067246875800000001, '2021-11-18 16:29:58'); +INSERT INTO `epmet_admin`.`sys_dict_type` (`id`, `dict_type`, `dict_name`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (9, 'user_demand_report_type', '居民需求上报类型', '社区帮办:community;楼长帮办:building_caption;党员帮办:party;自身上报:self_help', 9, 1067246875800000001, '2021-11-18 16:29:58', 1067246875800000001, '2021-11-18 16:29:58'); +INSERT INTO `epmet_admin`.`sys_dict_type` (`id`, `dict_type`, `dict_name`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (10, 'user_demand_service_type', '居民需求服务方类型', '服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit;', 10, 1067246875800000001, '2021-11-18 16:29:58', 1067246875800000001, '2021-11-18 16:29:58'); +INSERT INTO `epmet_admin`.`sys_dict_type` (`id`, `dict_type`, `dict_name`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1000000000000000006, 'scale', '人员规模', '', 6, 1067246875800000001, '2021-11-18 16:29:58', 1067246875800000001, '2021-11-18 16:29:58'); +INSERT INTO `epmet_admin`.`sys_dict_type` (`id`, `dict_type`, `dict_name`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1000000000000000007, 'party_unit_type', '联建单位分类', '', 7, 1067246875800000001, '2021-11-18 16:29:58', 1067246875800000001, '2021-11-18 16:29:58'); +-- 2、增加字典数据 +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1000000000000000200, 1000000000000000007, '楼宇党建', '0', '', 0, 1067246875800000001, '2020-03-08 16:29:58', 1067246875800000001, '2020-03-08 16:29:58'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1000000000000000201, 1000000000000000007, '两新组织', '1', '', 1, 1067246875800000001, '2020-03-08 16:29:58', 1067246875800000001, '2020-03-08 16:29:58'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1000000000000000202, 1000000000000000007, '区域单位党建', '2', '', 2, 1067246875800000001, '2020-03-08 16:29:58', 1067246875800000001, '2020-03-08 16:29:58'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1000000000000000203, 1000000000000000007, '机关直属部门', '3', '', 3, 1067246875800000001, '2020-03-08 16:29:58', 1067246875800000001, '2020-03-08 16:29:58'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1000000000000000204, 1000000000000000007, '其他', '4', '', 4, 1067246875800000001, '2020-03-08 16:29:58', 1067246875800000001, '2020-03-08 16:29:58'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1000000000000000205, 8, '待处理', 'pending', '', 1, 1, '2021-11-23 14:00:59', 1, '2021-11-23 14:00:59'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1000000000000000206, 8, '已取消', 'canceled', '', 2, 1, '2021-11-23 14:00:59', 1, '2021-11-23 14:00:59'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1000000000000000207, 8, '已派单', 'assigned', '', 3, 1, '2021-11-23 14:00:59', 1, '2021-11-23 14:00:59'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1000000000000000208, 8, '已接单', 'have_order', '', 4, 1, '2021-11-23 14:00:59', 1, '2021-11-23 14:00:59'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1000000000000000209, 8, '已完成', 'finished', '', 5, 1, '2021-11-23 14:00:59', 1, '2021-11-23 14:00:59'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1000000000000000210, 9, '社区帮办', 'community', '', 1, 1, '2021-11-23 14:03:22', 1, '2021-11-23 14:03:22'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1000000000000000211, 9, '楼长帮办', 'building_caption', '', 2, 1, '2021-11-23 14:03:22', 1, '2021-11-23 14:03:22'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1000000000000000212, 9, '党员帮办', 'party', '', 3, 1, '2021-11-23 14:03:22', 1, '2021-11-23 14:03:22'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1000000000000000213, 10, '志愿者', 'volunteer', '', 1, 1, '2021-11-23 14:04:42', 1, '2021-11-23 14:04:42'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1000000000000000214, 10, '社会组织', 'social_org', '', 2, 1, '2021-11-23 14:04:42', 1, '2021-11-23 14:04:42'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1000000000000000215, 10, '社区自组织', 'community_org', '', 3, 1, '2021-11-23 14:04:42', 1, '2021-11-23 14:04:42'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1000000000000000216, 10, '区域党建单位', 'party_unit', '', 4, 1, '2021-11-23 14:04:42', 1, '2021-11-23 14:04:42'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (2000000000000000000, 1000000000000000006, '10人以下', '0', '', 0, 1067246875800000001, '2021-11-18 16:29:58', 1067246875800000001, '2021-11-18 16:29:58'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (2000000000000000001, 1000000000000000006, '10-20人', '1', '', 1, 1067246875800000001, '2021-11-18 16:29:58', 1067246875800000001, '2021-11-18 16:29:58'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (2000000000000000002, 1000000000000000006, '21-40人', '2', '', 2, 1067246875800000001, '2021-11-18 16:29:58', 1067246875800000001, '2021-11-18 16:29:58'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (2000000000000000003, 1000000000000000006, '41-100人', '3', '', 3, 1067246875800000001, '2021-11-18 16:29:58', 1067246875800000001, '2021-11-18 16:29:58'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (2000000000000000004, 1000000000000000006, '100人以上', '4', '', 4, 1067246875800000001, '2021-11-18 16:29:58', 1067246875800000001, '2021-11-18 16:29:58'); \ No newline at end of file diff --git a/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.7__add_dict_data_V3.sql b/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.7__add_dict_data_V3.sql new file mode 100644 index 0000000000..792aec0c87 --- /dev/null +++ b/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.7__add_dict_data_V3.sql @@ -0,0 +1,9 @@ +-- 1、增加字典类型 +INSERT INTO `epmet_admin`.`sys_dict_type` (`id`, `dict_type`, `dict_name`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1000000000000000011, 'age_group', '年龄范围', '', 11, 1067246875800000001, '2021-11-18 16:29:58', 1067246875800000001, '2021-11-18 16:29:58'); + +-- 2、增加字典数据 +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1000000000000000230, 1000000000000000011, '50岁以下', '0', '', 0, 1, '2021-11-23 14:04:42', 1, '2021-11-23 14:04:42'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1000000000000000231, 1000000000000000011, '50-59岁', '1', '', 1, 1, '2021-11-23 14:04:42', 1, '2021-11-23 14:04:42'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1000000000000000232, 1000000000000000011, '60-69岁', '2', '', 2, 1, '2021-11-23 14:04:42', 1, '2021-11-23 14:04:42'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1000000000000000233, 1000000000000000011, '70-79岁', '3', '', 3, 1, '2021-11-23 14:04:42', 1, '2021-11-23 14:04:42'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES (1000000000000000234, 1000000000000000011, '80岁以上', '4', '', 4, 1, '2021-11-23 14:04:42', 1, '2021-11-23 14:04:42'); diff --git a/epmet-admin/epmet-admin-server/src/main/resources/mapper/SysDictDataDao.xml b/epmet-admin/epmet-admin-server/src/main/resources/mapper/SysDictDataDao.xml index b6c79a46bf..3760e0895a 100644 --- a/epmet-admin/epmet-admin-server/src/main/resources/mapper/SysDictDataDao.xml +++ b/epmet-admin/epmet-admin-server/src/main/resources/mapper/SysDictDataDao.xml @@ -7,4 +7,17 @@ select dict_type_id, dict_label, dict_value from sys_dict_data order by dict_type_id, sort + + diff --git a/epmet-auth/deploy/docker-compose-prod.yml b/epmet-auth/deploy/docker-compose-prod.yml index 1556650965..d327a24e3e 100644 --- a/epmet-auth/deploy/docker-compose-prod.yml +++ b/epmet-auth/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-auth-server: container_name: epmet-auth-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-auth:0.3.70 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-auth:0.3.96 ports: - "8081:8081" network_mode: host # 使用现有网络 @@ -15,4 +15,4 @@ services: resources: limits: cpus: '0.1' - memory: 600M \ No newline at end of file + memory: 600M diff --git a/epmet-auth/pom.xml b/epmet-auth/pom.xml index 496d5901fb..dbc60cf787 100644 --- a/epmet-auth/pom.xml +++ b/epmet-auth/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.70 + 0.3.96 com.epmet epmet-cloud @@ -352,7 +352,7 @@ - false + true wxcb6ce2ed0c5ae54c diff --git a/epmet-auth/src/main/java/com/epmet/controller/IcLoinController.java b/epmet-auth/src/main/java/com/epmet/controller/IcLoinController.java new file mode 100644 index 0000000000..659945bddb --- /dev/null +++ b/epmet-auth/src/main/java/com/epmet/controller/IcLoinController.java @@ -0,0 +1,162 @@ +package com.epmet.controller; + +import cn.hutool.core.bean.BeanUtil; +import com.epmet.commons.tools.constant.AppClientConstant; +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.feign.ResultDataResolver; +import com.epmet.commons.tools.redis.RedisKeys; +import com.epmet.commons.tools.redis.RedisUtils; +import com.epmet.commons.tools.security.password.PasswordUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.CustomerStaffDTO; +import com.epmet.dto.form.LoginByPassWordFormDTO; +import com.epmet.dto.form.RootOrgListByStaffIdFormDTO; +import com.epmet.dto.result.StaffOrgsResultDTO; +import com.epmet.dto.result.UserTokenResultDTO; +import com.epmet.feign.EpmetUserFeignClient; +import com.epmet.feign.GovOrgOpenFeignClient; +import com.epmet.redis.CaptchaRedis; +import com.epmet.redis.IcLoginTicketCacheBean; +import com.epmet.service.IcLoginService; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.*; + +@RestController +@RequestMapping("ic") +public class IcLoinController implements ResultDataResolver { + + public static final long IC_LOGIN_TICKET_EXPIRE_SECONDS = 2 * 60l; + + @Autowired + private EpmetUserFeignClient epmetUserFeignClient; + + @Autowired + private GovOrgOpenFeignClient govOrgOpenFeignClient; + + @Autowired + private CaptchaRedis captchaRedis; + + @Autowired + private IcLoginService icLoginService; + + @Autowired + private RedisUtils redisUtils; + + /** + * @description 基层治理赋能平台-根据手机号密码获取组织列表 + * + * @param input + * @return + * @author wxz + * @date 2021.10.25 09:56:33 + */ + @PostMapping("getmyorgsbypassword") + public Result> getMyOrgsByPassword(@RequestBody LoginByPassWordFormDTO input) { + ValidatorUtils.validateEntity(input, LoginByPassWordFormDTO.IcGetOrgsByPwdGroup.class); + String captcha = input.getCaptcha(); + String mobile = input.getMobile(); + String password = input.getPassword(); + String uuid = input.getUuid(); + + // 图片验证码 + String captchaInCache = captchaRedis.getIcLoginCaptcha(uuid); + if (StringUtils.isBlank(captchaInCache) || !captcha.equals(captchaInCache)) { + throw new RenException(EpmetErrorCode.ERR10019.getCode()); + } + + // 获取用户信息 + Result> staffResult = epmetUserFeignClient.checkCustomerStaff(mobile); + List staffList = getResultDataOrThrowsException(staffResult, ServiceConstant.EPMET_USER_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【基层治理平台登录】获取用户信息失败", null); + if (CollectionUtils.isEmpty(staffList)) { + throw new RenException(EpmetErrorCode.ERR10003.getCode()); + } + + CustomerStaffDTO staffInfo = staffList.get(0); + + if (!PasswordUtils.matches(password, staffInfo.getPassword())) { + throw new RenException(EpmetErrorCode.ERR10004.getCode()); + } + + String staffId = staffInfo.getUserId(); + + // 查询跟组织列表 + RootOrgListByStaffIdFormDTO orgListForm = new RootOrgListByStaffIdFormDTO(); + orgListForm.setStaffId(staffId); + Result> orgListResult = govOrgOpenFeignClient.getStaffOrgListByStaffId(orgListForm); + List orgs = getResultDataOrThrowsException(orgListResult, ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【基层治理平台登录】根据staffId查询所属客户跟组织列表失败", null); + + // 生成登录票据 + String ticket = UUID.randomUUID().toString().replace("-", ""); + IcLoginTicketCacheBean ticketCacheBean = new IcLoginTicketCacheBean(); + ticketCacheBean.setMobile(mobile); + ticketCacheBean.setStaffId(staffId); + cacheTicket(ticket, ticketCacheBean); + + HashMap resultMap = new HashMap<>(); + resultMap.put("staffId", staffId); + resultMap.put("ticket", ticket); + resultMap.put("orgs", orgs); + + return new Result>().ok(resultMap); + } + + /** + * @description IC登录 + * + * @param input + * @return + * @author wxz + * @date 2021.10.25 21:14:22 + */ + @PostMapping("login") + public Result login(@RequestBody LoginByPassWordFormDTO input) { + ValidatorUtils.validateEntity(input, LoginByPassWordFormDTO.IcLoginGroup.class); + String ticket = input.getTicket(); + String orgId = input.getRootAgencyId(); + String staffId = input.getStaffId(); + + // ticket校验 + IcLoginTicketCacheBean ticketCache = getTicketCache(ticket); + if (ticketCache == null || !ticketCache.getStaffId().equals(staffId)) { + // ticket&userId不对应 + throw new RenException(EpmetErrorCode.ERR10008.getCode()); + } + + UserTokenResultDTO tokenInfo = icLoginService.login(staffId, orgId); + return new Result().ok(tokenInfo); + } + + private void cacheTicket(String ticket, IcLoginTicketCacheBean cacheBean) { + Map stringObjectMap = BeanUtil.beanToMap(cacheBean, false, true); + redisUtils.hMSet(RedisKeys.loginTicket(AppClientConstant.APP_IC, ticket), stringObjectMap, IC_LOGIN_TICKET_EXPIRE_SECONDS); + } + + /** + * @description 从缓存中取出ticket,并删除 + * + * @param ticket + * @return + * @author wxz + * @date 2021.10.26 08:58:27 + */ + private IcLoginTicketCacheBean getTicketCache(String ticket) { + String key = RedisKeys.loginTicket(AppClientConstant.APP_IC, ticket); + Map map = redisUtils.hGetAll(key); + if (CollectionUtils.sizeIsEmpty(map)) { + return null; + } + redisUtils.expire(key, 0); + return BeanUtil.mapToBean(map, IcLoginTicketCacheBean.class, false); + } + +} diff --git a/epmet-auth/src/main/java/com/epmet/controller/LoginController.java b/epmet-auth/src/main/java/com/epmet/controller/LoginController.java index f70495eb51..bfc425b8e1 100644 --- a/epmet-auth/src/main/java/com/epmet/controller/LoginController.java +++ b/epmet-auth/src/main/java/com/epmet/controller/LoginController.java @@ -23,6 +23,9 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.awt.image.BufferedImage; import java.io.IOException; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.util.Arrays; /** * @Description 通用登录接口 @@ -65,6 +68,30 @@ public class LoginController { } } + /** + * @description 基层治理平台登录验证码 + * + * @param response + * @return + * @author wxz + * @date 2021.10.25 14:19:40 + */ + @GetMapping("ic-login-captcha") + public void icLoginCaptcha(HttpServletResponse response, String uuid) throws IOException { + try { + //生成图片验证码 + BufferedImage image = captchaService.createIcLoginCaptcha(uuid); + response.reset(); + response.setHeader("Cache-Control", "no-store, no-cache"); + response.setContentType("image/jpeg"); + ServletOutputStream out = response.getOutputStream(); + ImageIO.write(image, "jpg", out); + out.close(); + } catch (IOException e) { + log.error("获取登陆验证码异常", e); + } + } + /** * @param formDTO * @return com.epmet.commons.tools.utils.Result @@ -121,4 +148,86 @@ public class LoginController { } return new Result().ok(""); } + //================start test code========== + /** + * 校验签名 + */ + public static boolean checkSignature(String signature, String timestamp, String nonce) { + System.out.println("signature:" + signature + "timestamp:" + timestamp + "nonc:" + nonce); + String WECHAT_TOKEN = "1jkoyyih83nj8"; + String[] arr = new String[]{WECHAT_TOKEN, timestamp, nonce}; + // 将token、timestamp、nonce三个参数进行字典序排序 + Arrays.sort(arr); + StringBuilder content = new StringBuilder(); + for (int i = 0; i < arr.length; i++) { + content.append(arr[i]); + } + MessageDigest md = null; + String tmpStr = null; + + try { + md = MessageDigest.getInstance("SHA-1"); + // 将三个参数字符串拼接成一个字符串进行sha1加密 + byte[] digest = md.digest(content.toString().getBytes()); + tmpStr = byteToStr(digest); + } catch (NoSuchAlgorithmException e) { + e.printStackTrace(); + } + + content = null; + // 将sha1加密后的字符串可与signature对比,标识该请求来源于微信 + System.out.println(tmpStr.equals(signature.toUpperCase())); + return tmpStr != null ? tmpStr.equals(signature.toUpperCase()) : false; + } + + /** + * 将字节数组转换为十六进制字符串 + * + * @param byteArray + * @return + */ + private static String byteToStr(byte[] byteArray) { + String strDigest = ""; + for (int i = 0; i < byteArray.length; i++) { + strDigest += byteToHexStr(byteArray[i]); + } + return strDigest; + } + + /** + * 将字节转换为十六进制字符串 + * + * @param mByte + * @return + */ + private static String byteToHexStr(byte mByte) { + char[] Digit = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'}; + char[] tempArr = new char[2]; + tempArr[0] = Digit[(mByte >>> 4) & 0X0F]; + tempArr[1] = Digit[mByte & 0X0F]; + + String s = new String(tempArr); + return s; + } + + + /** + * 打开开发者模式签名认证 + * @param signature + * @param timestamp + * @param nonce + * @param echostr + * @return + */ + @ResponseBody + @RequestMapping(value = "/service", method = RequestMethod.GET) + public Object defaultView(String signature, String timestamp, String nonce, String echostr) { + if (echostr == null || echostr.isEmpty()) { + return nonce; + } + if (this.checkSignature(signature, timestamp, nonce)) { + return echostr; + } + return nonce; + } } diff --git a/epmet-auth/src/main/java/com/epmet/dto/form/LoginByPassWordFormDTO.java b/epmet-auth/src/main/java/com/epmet/dto/form/LoginByPassWordFormDTO.java index 0e05cb7787..8a603012ac 100644 --- a/epmet-auth/src/main/java/com/epmet/dto/form/LoginByPassWordFormDTO.java +++ b/epmet-auth/src/main/java/com/epmet/dto/form/LoginByPassWordFormDTO.java @@ -14,27 +14,53 @@ import java.io.Serializable; public class LoginByPassWordFormDTO extends LoginCommonFormDTO implements Serializable { private static final long serialVersionUID = -7507437651048051183L; + // 基层治理平台账号密码获取组织列表分组 + public interface IcGetOrgsByPwdGroup {} + // 基层治理平台登录分组 + public interface IcLoginGroup {} + /** * 手机号 */ @NotBlank(message = "手机号不能为空",groups = {AddUserShowGroup.class}) private String phone; + @NotBlank(message = "手机号不能为空",groups = {IcGetOrgsByPwdGroup.class}) + private String mobile; + /** * 密码 */ - @NotBlank(message = "密码不能为空",groups = {AddUserShowGroup.class}) + @NotBlank(message = "密码不能为空",groups = {AddUserShowGroup.class, IcGetOrgsByPwdGroup.class}) private String password; /** * 验证码 */ - @NotBlank(message="验证码不能为空",groups = {AddUserShowGroup.class}) + @NotBlank(message="验证码不能为空",groups = {AddUserShowGroup.class, IcGetOrgsByPwdGroup.class}) private String captcha; /** * 唯一标识 */ - @NotBlank(message="唯一标识不能为空",groups = {AddUserInternalGroup.class}) + @NotBlank(message="唯一标识不能为空",groups = {AddUserInternalGroup.class, IcGetOrgsByPwdGroup.class}) private String uuid; + + /** + * 登录票据,目前ic基层治理平台用到了 + */ + @NotBlank(message="登录票据ticket不能为空", groups = {IcLoginGroup.class}) + private String ticket; + + /** + * 所选的要登录的组织id + */ + @NotBlank(message = "要登录的orgId不能为空", groups = { IcLoginGroup.class }) + private String rootAgencyId; + + /** + * 工作人员id + */ + @NotBlank(message = "人员Id不能为空", groups = { IcLoginGroup.class }) + private String staffId; } diff --git a/epmet-auth/src/main/java/com/epmet/redis/CaptchaRedis.java b/epmet-auth/src/main/java/com/epmet/redis/CaptchaRedis.java index 50433bdaf0..1544c9d07f 100644 --- a/epmet-auth/src/main/java/com/epmet/redis/CaptchaRedis.java +++ b/epmet-auth/src/main/java/com/epmet/redis/CaptchaRedis.java @@ -45,6 +45,12 @@ public class CaptchaRedis { redisUtils.set(key, captcha, EXPIRE); } + public void setIcLoginCaptcha(String uuid, String captcha) { + String key = RedisKeys.getIcLoginCaptchaKey(uuid); + logger.info("保存验证码key=["+key+"]"); + redisUtils.set(key, captcha, EXPIRE); + } + public String get(String uuid){ String key = RedisKeys.getLoginCaptchaKey(uuid); String captcha = (String)redisUtils.get(key); @@ -57,6 +63,25 @@ public class CaptchaRedis { return captcha; } + /** + * @description 基层治理平台登录验证码查询 + * + * @param uuid + * @return + * @author wxz + * @date 2021.10.25 14:28:28 + */ + public String getIcLoginCaptcha(String uuid) { + String key = RedisKeys.getIcLoginCaptchaKey(uuid); + String captcha = (String)redisUtils.get(key); + //删除验证码 + if(captcha != null){ + redisUtils.delete(key); + } + + return captcha; + } + /** * @param sendSmsCodeFormDTO app、client、phone * @param smsCode 验证码 diff --git a/epmet-auth/src/main/java/com/epmet/redis/IcLoginTicketCacheBean.java b/epmet-auth/src/main/java/com/epmet/redis/IcLoginTicketCacheBean.java new file mode 100644 index 0000000000..4e483be294 --- /dev/null +++ b/epmet-auth/src/main/java/com/epmet/redis/IcLoginTicketCacheBean.java @@ -0,0 +1,9 @@ +package com.epmet.redis; + +import lombok.Data; + +@Data +public class IcLoginTicketCacheBean { + private String staffId; + private String mobile; +} diff --git a/epmet-auth/src/main/java/com/epmet/service/CaptchaService.java b/epmet-auth/src/main/java/com/epmet/service/CaptchaService.java index d6f8573e65..812a586dcb 100644 --- a/epmet-auth/src/main/java/com/epmet/service/CaptchaService.java +++ b/epmet-auth/src/main/java/com/epmet/service/CaptchaService.java @@ -23,6 +23,16 @@ public interface CaptchaService { */ BufferedImage create(String uuid); + /** + * @description 基层治理平台登录验证码 + * + * @param + * @return + * @author wxz + * @date 2021.10.25 14:15:30 + */ + BufferedImage createIcLoginCaptcha(String uuid); + /** * 验证码效验 * @param uuid uuid diff --git a/epmet-auth/src/main/java/com/epmet/service/IcLoginService.java b/epmet-auth/src/main/java/com/epmet/service/IcLoginService.java new file mode 100644 index 0000000000..d473f58a7f --- /dev/null +++ b/epmet-auth/src/main/java/com/epmet/service/IcLoginService.java @@ -0,0 +1,9 @@ +package com.epmet.service; + +import com.epmet.dto.result.UserTokenResultDTO; + +public interface IcLoginService { + + + UserTokenResultDTO login(String staffId, String orgId); +} diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/CaptchaServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/CaptchaServiceImpl.java index 835c9aab3a..cbb68142ee 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/CaptchaServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/CaptchaServiceImpl.java @@ -17,6 +17,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.awt.image.BufferedImage; +import java.util.UUID; /** * 验证码 @@ -43,6 +44,17 @@ public class CaptchaServiceImpl implements CaptchaService { return producer.createImage(captcha); } + @Override + public BufferedImage createIcLoginCaptcha(String uuid) { + //生成验证码 + String captchaText = producer.createText(); + //logger.info("uuid:"+uuid+",生成的验证码:"+captcha); + //保存验证码 + captchaRedis.setIcLoginCaptcha(uuid, captchaText); + + return producer.createImage(captchaText); + } + @Override public boolean validate(String uuid, String code) { String captcha = captchaRedis.get(uuid); diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java index 965869be12..9d455af694 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java @@ -3,7 +3,7 @@ package com.epmet.service.impl; import com.epmet.common.token.constant.LoginConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; -import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.security.dto.GovTokenDto; import com.epmet.commons.tools.security.password.PasswordUtils; import com.epmet.commons.tools.utils.CpUserDetailRedis; import com.epmet.commons.tools.utils.DateUtils; @@ -45,6 +45,8 @@ public class GovWebServiceImpl implements GovWebService { private CpUserDetailRedis cpUserDetailRedis; @Autowired private EpmetUserFeignClient epmetUserFeignClient; + @Autowired + private ThirdLoginServiceImpl thirdLoginService; /** * @param formDTO @@ -105,7 +107,11 @@ public class GovWebServiceImpl implements GovWebService { String token = jwtTokenUtils.createToken(map); logger.info("app:" + formDTO.getApp() + ";client:" + formDTO.getClient() + ";userId:" + userId + ";生成token[" + token + "]"); int expire = jwtTokenProperties.getExpire(); - TokenDto tokenDto = new TokenDto(); + + String orgIdPath = thirdLoginService.getOrgIdPath(userId); + String[] orgIdPathParts = orgIdPath.split(":"); + + GovTokenDto tokenDto = new GovTokenDto(); tokenDto.setCustomerId(formDTO.getCustomerId()); tokenDto.setApp(formDTO.getApp()); tokenDto.setClient(formDTO.getClient()); @@ -113,6 +119,13 @@ public class GovWebServiceImpl implements GovWebService { tokenDto.setToken(token); tokenDto.setUpdateTime(System.currentTimeMillis()); tokenDto.setExpireTime(jwtTokenUtils.getExpiration(token).getTime()); + tokenDto.setAgencyId(orgIdPathParts[orgIdPathParts.length - 1]); + tokenDto.setRootAgencyId(orgIdPathParts[0]); + tokenDto.setDeptIdList(thirdLoginService.getDeptartmentIdList(userId)); + tokenDto.setGridIdList(thirdLoginService.getGridIdList(userId)); + tokenDto.setRoleList(thirdLoginService.queryGovStaffRoles(userId, orgIdPathParts[orgIdPathParts.length - 1])); + tokenDto.setOrgIdPath(orgIdPath); + cpUserDetailRedis.set(tokenDto, expire); logger.info("截止时间:" + DateUtils.format(jwtTokenUtils.getExpiration(token), "yyyy-MM-dd HH:mm:ss")); return token; diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/IcLoginServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/IcLoginServiceImpl.java new file mode 100644 index 0000000000..1e1767070e --- /dev/null +++ b/epmet-auth/src/main/java/com/epmet/service/impl/IcLoginServiceImpl.java @@ -0,0 +1,177 @@ +package com.epmet.service.impl; + +import cn.hutool.core.bean.BeanUtil; +import com.epmet.auth.constants.AuthOperationConstants; +import com.epmet.commons.rocketmq.messages.LoginMQMsg; +import com.epmet.commons.tools.constant.AppClientConstant; +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.feign.ResultDataResolver; +import com.epmet.commons.tools.redis.RedisKeys; +import com.epmet.commons.tools.redis.RedisUtils; +import com.epmet.commons.tools.security.dto.IcTokenDto; +import com.epmet.commons.tools.utils.CpUserDetailRedis; +import com.epmet.commons.tools.utils.IpUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.CustomerAgencyDTO; +import com.epmet.dto.form.SystemMsgFormDTO; +import com.epmet.dto.result.UserTokenResultDTO; +import com.epmet.feign.EpmetMessageOpenFeignClient; +import com.epmet.feign.GovOrgOpenFeignClient; +import com.epmet.jwt.JwtTokenProperties; +import com.epmet.jwt.JwtTokenUtils; +import com.epmet.service.IcLoginService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.servlet.http.HttpServletRequest; +import java.util.*; + +@Service +@Slf4j +public class IcLoginServiceImpl implements IcLoginService, ResultDataResolver { + + @Autowired + private JwtTokenUtils jwtTokenUtils; + + @Autowired + private RedisUtils redisUtils; + + @Autowired + private CpUserDetailRedis cpUserDetailRedis; + + @Autowired + private JwtTokenProperties jwtTokenProperties; + + @Autowired + private EpmetMessageOpenFeignClient messageOpenFeignClient; + + @Autowired + private GovOrgOpenFeignClient govOrgOpenFeignClient; + + @Autowired + private ThirdLoginServiceImpl thirdLoginService; + + @Override + public UserTokenResultDTO login(String staffId, String orgId) { + String app = AppClientConstant.APP_IC; + String client = AppClientConstant.CLIENT_WEB; + + // 1.获取用户token + String token = this.generateIcToken(staffId, app, client); + + Result agencyResult = govOrgOpenFeignClient.getAgencyById(orgId); + CustomerAgencyDTO agencyInfo = getResultDataOrThrowsException(agencyResult, ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【IC平台登录】获取组织信息失败", null); + + // 2.缓存token + cacheToken(app, client, staffId, token, orgId, agencyInfo.getCustomerId()); + + UserTokenResultDTO userTokenResultDTO = new UserTokenResultDTO(); + userTokenResultDTO.setToken(token); + userTokenResultDTO.setCustomerId(agencyInfo.getCustomerId()); + + //7.发送登录事件 + try { + sendLoginEvent(staffId, app, client); + } catch (RenException e) { + log.error(e.getInternalMsg()); + } catch (Exception e) { + log.error("【工作端workLogin登录】发送登录事件失败,程序继续执行。"); + } + + return userTokenResultDTO; + } + + /** + * @param staffId + * @return + * @description 生成Ic平台的Token + * @author wxz + * @date 2021.10.26 13:42:36 + */ + private String generateIcToken(String staffId, String app, String client) { + Map map = new HashMap<>(); + map.put("app", app); + map.put("client", client); + map.put("userId", staffId); + String token = jwtTokenUtils.createToken(map); + return token; + } + + /** + * @param userId + * @param fromApp + * @param fromClient + * @return + * @description 发布登录时间 + * @author wxz + * @date 2021.10.26 13:45:59 + */ + private void sendLoginEvent(String userId, String fromApp, String fromClient) { + HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); + + LoginMQMsg loginMQMsg = new LoginMQMsg(); + loginMQMsg.setUserId(userId); + loginMQMsg.setLoginTime(new Date()); + loginMQMsg.setIp(IpUtils.getIpAddr(request)); + loginMQMsg.setFromApp(fromApp); + loginMQMsg.setFromClient(fromClient); + + SystemMsgFormDTO form = new SystemMsgFormDTO(); + form.setMessageType(AuthOperationConstants.LOGIN); + form.setContent(loginMQMsg); + messageOpenFeignClient.sendSystemMsgByMQ(form); + } + + /** + * @description 缓存token到redis + * + * @param app + * @param client + * @param userId + * @param token + * @param rootAgencyId + * @return + * @author wxz + * @date 2021.10.26 14:19:07 + */ + private void cacheToken(String app, + String client, + String userId, + String token, + String rootAgencyId, + String customerId) { + + IcTokenDto tokenDto = new IcTokenDto(); + int expire = jwtTokenProperties.getExpire(); + long expireTime = jwtTokenUtils.getExpiration(token).getTime(); + + tokenDto.setApp(app); + tokenDto.setClient(client); + tokenDto.setUserId(userId); + tokenDto.setToken(token); + tokenDto.setExpireTime(expireTime); + tokenDto.setRootAgencyId(rootAgencyId); + tokenDto.setCustomerId(customerId); + + //设置部门,网格,角色列表 + tokenDto.setDeptIdList(thirdLoginService.getDeptartmentIdList(userId)); + tokenDto.setGridIdList(thirdLoginService.getGridIdList(userId)); + CustomerAgencyDTO agency = thirdLoginService.getAgencyByStaffId(userId); + if (agency != null) { + tokenDto.setAgencyId(agency.getId()); + tokenDto.setRoleList(thirdLoginService.queryGovStaffRoles(userId, agency.getId())); + } + tokenDto.setOrgIdPath(thirdLoginService.getOrgIdPath(userId)); + + String key = RedisKeys.getCpUserKey(app, client, userId); + Map map = BeanUtil.beanToMap(tokenDto, false, true); + redisUtils.hMSet(key, map, expire); + } + + +} diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java index 27f7e71fe5..569ef87c85 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java @@ -295,7 +295,7 @@ public class LoginServiceImpl implements LoginService { if (!flag) { logger.warn(String.format("用户%s登录,验证码输入错误", formDTO.getPhone())); //2020-05-21去除验证码校验 - return new Result().error(EpmetErrorCode.ERR10019.getCode()); + //return new Result().error(EpmetErrorCode.ERR10019.getCode()); } //2、账号是否存在 //获取用户信息 diff --git a/epmet-auth/src/main/resources/bootstrap.yml b/epmet-auth/src/main/resources/bootstrap.yml index 42ec69d1ac..bf965caff7 100644 --- a/epmet-auth/src/main/resources/bootstrap.yml +++ b/epmet-auth/src/main/resources/bootstrap.yml @@ -32,6 +32,8 @@ spring: namespace: @nacos.discovery.namespace@ #不把自己注册到注册中心的地址 register-enabled: @nacos.register-enabled@ + serviceListChangedListening: + enable: @nacos.service-list-changed-listening.enable@ config: enabled: @nacos.config-enabled@ server-addr: @nacos.server-addr@ diff --git a/epmet-commons/epmet-commons-extapp-auth/pom.xml b/epmet-commons/epmet-commons-extapp-auth/pom.xml index b563afcb7d..d6683ae51d 100644 --- a/epmet-commons/epmet-commons-extapp-auth/pom.xml +++ b/epmet-commons/epmet-commons-extapp-auth/pom.xml @@ -18,7 +18,7 @@ 1.3.3 2.6 4.6.1 - 4.1.0 + 4.4.0 2.9.9 1.2.60 2.8.6 diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/service/BaseService.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/service/BaseService.java index c82dce8253..9f5a388ab2 100644 --- a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/service/BaseService.java +++ b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/service/BaseService.java @@ -123,5 +123,31 @@ public interface BaseService { */ boolean deleteBatchIds(Collection idList); + /** + *

+ * 存在更新记录,否插入一条记录 + *

+ * + * @param entity 实体对象 + */ + boolean saveOrUpdate(T entity); + + /** + *

+ * 批量修改插入 + *

+ * + * @param entityList 实体对象集合 + */ + boolean saveOrUpdateBatch(Collection entityList); + /** + *

+ * 批量修改插入 + *

+ * + * @param entityList 实体对象集合 + * @param batchSize 更新批次数量 + */ + boolean saveOrUpdateBatch(Collection entityList, int batchSize); } diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/service/impl/BaseServiceImpl.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/service/impl/BaseServiceImpl.java index fc89437e03..445f5a6e40 100644 --- a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/service/impl/BaseServiceImpl.java +++ b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/service/impl/BaseServiceImpl.java @@ -13,6 +13,8 @@ import com.baomidou.mybatisplus.core.enums.SqlMethod; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.OrderItem; +import com.baomidou.mybatisplus.core.metadata.TableInfo; +import com.baomidou.mybatisplus.core.metadata.TableInfoHelper; import com.baomidou.mybatisplus.core.toolkit.*; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.toolkit.SqlHelper; @@ -31,6 +33,7 @@ import java.io.Serializable; import java.util.Collection; import java.util.List; import java.util.Map; +import java.util.Objects; /** * 基础服务类,所有Service都要继承 @@ -298,4 +301,56 @@ public abstract class BaseServiceImpl, T> implements Bas public boolean deleteBatchIds(Collection idList) { return SqlHelper.delBool(baseDao.deleteBatchIds(idList)); } + + @Transactional(rollbackFor = Exception.class) + @Override + public boolean saveOrUpdate(T entity) { + if (null != entity) { + Class cls = entity.getClass(); + TableInfo tableInfo = TableInfoHelper.getTableInfo(cls); + Assert.notNull(tableInfo, "error: can not execute. because can not find cache of TableInfo for entity!"); + String keyProperty = tableInfo.getKeyProperty(); + Assert.notEmpty(keyProperty, "error: can not execute. because can not find column for id from entity!"); + Object idVal = ReflectionKit.getMethodValue(cls, entity, tableInfo.getKeyProperty()); + return StringUtils.checkValNull(idVal) || Objects.isNull(selectById((Serializable) idVal)) ? insert(entity) : updateById(entity); + } + return false; + } + + @Transactional(rollbackFor = Exception.class) + @Override + public boolean saveOrUpdateBatch(Collection entityList) { + return saveOrUpdateBatch(entityList, 100); + } + + @Transactional(rollbackFor = Exception.class) + @Override + public boolean saveOrUpdateBatch(Collection entityList, int batchSize) { + Assert.notEmpty(entityList, "error: entityList must not be empty"); + Class cls = currentModelClass(); + TableInfo tableInfo = TableInfoHelper.getTableInfo(cls); + Assert.notNull(tableInfo, "error: can not execute. because can not find cache of TableInfo for entity!"); + String keyProperty = tableInfo.getKeyProperty(); + Assert.notEmpty(keyProperty, "error: can not execute. because can not find column for id from entity!"); + try (SqlSession batchSqlSession = sqlSessionBatch()) { + int i = 0; + for (T entity : entityList) { + Object idVal = ReflectionKit.getMethodValue(cls, entity, keyProperty); + if (StringUtils.checkValNull(idVal) || Objects.isNull(selectById((Serializable) idVal))) { + batchSqlSession.insert(sqlStatement(SqlMethod.INSERT_ONE), entity); + } else { + MapperMethod.ParamMap param = new MapperMethod.ParamMap<>(); + param.put(Constants.ENTITY, entity); + batchSqlSession.update(sqlStatement(SqlMethod.UPDATE_BY_ID), param); + } + // 不知道以后会不会有人说更新失败了还要执行插入 😂😂😂 + if (i >= 1 && i % batchSize == 0) { + batchSqlSession.flushStatements(); + } + i++; + } + batchSqlSession.flushStatements(); + } + return true; + } } diff --git a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/ConsomerGroupConstants.java b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/ConsomerGroupConstants.java index 890d19acf1..400eca1d51 100644 --- a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/ConsomerGroupConstants.java +++ b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/ConsomerGroupConstants.java @@ -45,4 +45,33 @@ public interface ConsomerGroupConstants { */ String POINT_OPERATION_LOG_GROUP = "point_operation_log_group"; + /** + * 开放的对接数据(中间库) 组织变更事件监听器分组 + */ + String OPEN_DATA_ORG_CHANGE_EVENT_LISTENER_GROUP = "open_data_org_change_event_listener_group"; + + /** + * 开放的对接数据(中间库) 工作人员变更事件监听器分组 + */ + String OPEN_DATA_STAFF_CHANGE_EVENT_LISTENER_GROUP = "open_data_staff_change_event_listener_group"; + + /** + * 开放的对接数据(中间库) 巡查记录变更事件监听器分组 + */ + String OPEN_DATA_PATROL_CHANGE_EVENT_LISTENER_GROUP = "open_data_patrol_change_event_listener_group"; + + /** + * 开放的对接数据(中间库) 项目变更事件监听器分组 + */ + String OPEN_DATA_PROJECT_CHANGE_EVENT_LISTENER_GROUP = "open_data_project_change_event_listener_group"; + + /** + * 开放的人员信息变更预警统计 + */ + String IC_WARN_STATS_EVENT_LISTENER_GROUP = "ic_warn_stats_event_listener_group"; + + /** + * 需求完成,如果服务方是区域化党建单位,重新计算这个单位的满意度 + */ + String CAL_PARTY_UNIT_SATISFACTION = "cal_party_unit_satisfaction"; } diff --git a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/MQUserPropertys.java b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/MQUserPropertys.java new file mode 100644 index 0000000000..c1a53a29ba --- /dev/null +++ b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/MQUserPropertys.java @@ -0,0 +1,13 @@ +package com.epmet.commons.rocketmq.constants; + +/** + * @Description MQ用户自定义属性 + * @author wxz + * @date 2021.10.14 15:47:03 +*/ +public interface MQUserPropertys { + + //阻塞消息label + String BLOCKED_MSG_LABEL = "blockedMsgLabel"; + +} diff --git a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/TopicConstants.java b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/TopicConstants.java index 8fe36aa53a..e11400fef3 100644 --- a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/TopicConstants.java +++ b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/TopicConstants.java @@ -13,6 +13,7 @@ public interface TopicConstants { * 项目变动 */ String PROJECT_CHANGED = "project_changed"; + /** * 小组成就 */ @@ -27,4 +28,34 @@ public interface TopicConstants { * 积分系统话题 */ String POINT = "point"; + + /** + * 组织信息 + */ + String ORG = "org"; + + /** + * 工作人员 + */ + String STAFF = "staff"; + + /** + * 巡查记录 + */ + String PATROL = "patrol"; + + /** + * 项目 + */ + String PROJECT = "project"; + + /** + * 项目 + */ + String IC_RESI_USER = "ic_resi_user"; + + /** + * 需求完成,如果服务方是区域化党建单位,重新计算这个单位的满意度 + */ + String CAL_PARTY_UNIT_SATISFACTION = "cal_party_unit_satisfaction"; } diff --git a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/CalPartyUnitSatisfactionFormDTO.java b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/CalPartyUnitSatisfactionFormDTO.java new file mode 100644 index 0000000000..bfaf63703a --- /dev/null +++ b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/CalPartyUnitSatisfactionFormDTO.java @@ -0,0 +1,19 @@ +package com.epmet.commons.rocketmq.messages; + + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 需求完成,如果服务方是区域化党建单位,重新计算这个单位的满意度,或者直接计算整个客户 + */ +@Data +public class CalPartyUnitSatisfactionFormDTO implements Serializable { + public interface AddUserInternalGroup { + } + @NotBlank(message = "客户id不能为空",groups = AddUserInternalGroup.class) + private String customerId; + private String partyUnitId; +} diff --git a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/DisputeProcessMQMsg.java b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/DisputeProcessMQMsg.java new file mode 100644 index 0000000000..bed6aa4bf5 --- /dev/null +++ b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/DisputeProcessMQMsg.java @@ -0,0 +1,23 @@ +package com.epmet.commons.rocketmq.messages; + +import lombok.AllArgsConstructor; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2021/10/18 16:24 + */ +@Data +@AllArgsConstructor +public class DisputeProcessMQMsg implements Serializable { + private String customerId; + private List projectId; + /** + * 操作类型【新增:add 修改删除:edit】 + */ + private String type; +} diff --git a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/IcResiUserAddMQMsg.java b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/IcResiUserAddMQMsg.java new file mode 100644 index 0000000000..328e7419cf --- /dev/null +++ b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/IcResiUserAddMQMsg.java @@ -0,0 +1,20 @@ +package com.epmet.commons.rocketmq.messages; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 居民信息新增、修改推送MQ + * @author sun + */ +@Data +public class IcResiUserAddMQMsg implements Serializable { + + //客户Id + private String customerId; + //居民ID + private String icResiUser; + + +} diff --git a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/OrgOrStaffMQMsg.java b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/OrgOrStaffMQMsg.java new file mode 100644 index 0000000000..650b9e9f90 --- /dev/null +++ b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/OrgOrStaffMQMsg.java @@ -0,0 +1,27 @@ +package com.epmet.commons.rocketmq.messages; + +import lombok.AllArgsConstructor; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + * 组织、网格、人员中间库数据上报MQ + * @author sun + */ +@Data +public class OrgOrStaffMQMsg implements Serializable { + + //客户Id + private String customerId; + //组织、网格、人员Id + private String orgId; + //数据类型【组织:agency 网格:grid 人员:staff】 + private String orgType; + //操作类型【组织新增:agency_create 组织变更:agency_change 网格新增:grid_create 网格变更:grid_change 人员新增:staff_create 人员变更:staff_change】 + private String type; + + +} diff --git a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/StaffPatrolMQMsg.java b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/StaffPatrolMQMsg.java new file mode 100644 index 0000000000..d8d68cac56 --- /dev/null +++ b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/StaffPatrolMQMsg.java @@ -0,0 +1,21 @@ +package com.epmet.commons.rocketmq.messages; + +import lombok.Data; + +/** + * 用户巡查消息体 + * @author liujianjun + */ +@Data +public class StaffPatrolMQMsg { + /** + * 客户Id + */ + private String customerId; + + /** + * 巡查记录id + */ + private String patrolId; + +} diff --git a/epmet-commons/epmet-commons-tools/pom.xml b/epmet-commons/epmet-commons-tools/pom.xml index 5929139632..31e2276fc4 100644 --- a/epmet-commons/epmet-commons-tools/pom.xml +++ b/epmet-commons/epmet-commons-tools/pom.xml @@ -18,7 +18,7 @@ 1.3.3 2.6 4.6.1 - 4.1.3 + 4.4.0 2.9.9 1.2.60 2.8.6 @@ -89,6 +89,8 @@ cn.afterturn easypoi-base ${easypoi.version} + cn.afterturn diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/BaseRequestLogAspect.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/BaseRequestLogAspect.java index 38a70d6582..12720182f5 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/BaseRequestLogAspect.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/BaseRequestLogAspect.java @@ -1,5 +1,6 @@ package com.epmet.commons.tools.aspect; +import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.constant.AppClientConstant; import com.epmet.commons.tools.constant.ThreadLocalConstant; import com.epmet.commons.tools.exception.*; @@ -14,6 +15,9 @@ import javax.servlet.http.HttpServletRequest; import java.time.Duration; import java.time.LocalDateTime; import java.util.Arrays; +import java.util.Enumeration; +import java.util.HashMap; +import java.util.Map; /** * 日志切面 @@ -54,6 +58,8 @@ public abstract class BaseRequestLogAspect { // transactionSerial = UUID.randomUUID().toString(); //} + Map requestHeaders = getRequestHeaders(request); + // 将当前线程名称设置为事务流水号 if (!StringUtils.isEmpty(transactionSerial)) { Thread.currentThread().setName(transactionSerial); @@ -64,10 +70,19 @@ public abstract class BaseRequestLogAspect { try { Object[] args = point.getArgs(); ThreadLocalConstant.requestParam.set(Arrays.toString(point.getArgs())); - log.info(">>>>>>>>请求信息>>>>>>>>:事务流水号:{},url:{} ,method:{},请求参数:{}", transactionSerial, requestURI, method, objectsToString(args)); + log.info(">>>>>>>>请求信息>>>>>>>>:事务流水号:{},url:{} ,method:{},请求参数:{},请求头:{}", + transactionSerial, requestURI, method, objectsToString(args), requestHeaders); result = point.proceed(); resultInfoLog(transactionSerial, getExecPeriod(startTime), result); - } catch (RenException e) { + } catch (EpmetException e) { + result = handleRenException(e); + if (e.getCode() > 8000) { + resultWarnLog(transactionSerial, getExecPeriod(startTime), result, e.getInternalMsg(), ExceptionUtils.getErrorStackTrace(e)); + } else { + resultErrorLog(transactionSerial, getExecPeriod(startTime), result, e.getInternalMsg(), ExceptionUtils.getErrorStackTrace(e)); + } + return result; + } catch (RenException e) { result = handleRenException(e); if (e.getCode() > 8000) { resultWarnLog(transactionSerial, getExecPeriod(startTime), result, e.getInternalMsg(), ExceptionUtils.getErrorStackTrace(e)); @@ -91,6 +106,23 @@ public abstract class BaseRequestLogAspect { return result; } + /** + * @Description 获取请求头信息 + * @return + * @author wxz + * @date 2021.03.31 13:59 + */ + private Map getRequestHeaders(HttpServletRequest request) { + Enumeration headerNames = request.getHeaderNames(); + HashMap headerMap = new HashMap<>(); + while (headerNames.hasMoreElements()) { + String headerName = headerNames.nextElement(); + String headerValue = request.getHeader(headerName); + headerMap.put(headerName, headerValue); + } + return headerMap; + } + /** * info日志 * @param transactionSerial @@ -213,6 +245,31 @@ public abstract class BaseRequestLogAspect { return result; } + /** + * 处理EpmetException + * @param e + * @return + */ + private Result handleRenException(EpmetException e) { + if (e.getCode() > 8000) { + Result result; + if (StringUtils.isNotBlank(e.getMsg())) { + // 抛出异常的时候填写了自定义显示信息,把显示信息返回 + result = new Result().error(e.getCode(), e.getMsg()); + } else { + // 没有填写显示信息,则根据code找固定的显示信息 + result = new Result().error(e.getCode()); + } + result.setInternalMsg(e.getInternalMsg()); + return result; + } + // 转化成服务器开小差... + Result result=new Result().error(); + result.setInternalMsg(e.getInternalMsg()); + //result.setMsg(e.getMsg()); + return result; + } + /** * 将请求对象转换为String * @param args @@ -225,7 +282,13 @@ public abstract class BaseRequestLogAspect { StringBuilder builder = new StringBuilder("["); for (Object object : args) { if (object != null) { - builder.append(object.toString()); + try { + // 尝试作为json解析 + String objectString = JSON.toJSONString(object); + builder.append(objectString); + } catch (Exception e) { + builder.append(object.toString()); + } builder.append(","); } } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/AppClientConstant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/AppClientConstant.java index 7b08e851d5..0b42461f6e 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/AppClientConstant.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/AppClientConstant.java @@ -17,6 +17,12 @@ public interface AppClientConstant { * app类型-运营端 */ String APP_OPER = "oper"; + + /** + * 基层治理平台端 + */ + String APP_IC = "ic"; + /** * PC端:web */ diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java index 1281b269f4..9ba8e7a96a 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java @@ -64,6 +64,8 @@ public interface NumConstant { long THREE_L = 3L; long FOUR_L = 4L; long MINUS_ONE_L = -1L; + long TEN_L = 10L; + long SIX_HUNDRED_L = 600L; String ZERO_STR = "0"; String ONE_STR = "1"; diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/StrConstant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/StrConstant.java index c601d2fd71..a18f34f72b 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/StrConstant.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/StrConstant.java @@ -44,6 +44,11 @@ public interface StrConstant { */ String COLON = ":"; + /** + * 英文分号 + */ + String SEMICOLON = ";"; + /** * 中文顿号 */ @@ -69,6 +74,10 @@ public interface StrConstant { */ String STAR="*"; + String QUESTION_MARK="?"; + String QUESTION_MARK_TRANSFER="\\?"; + String AND_MARK="&"; + /** * 空字符串 */ diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/distributedlock/DistributedLock.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/distributedlock/DistributedLock.java index 60e17175f1..6cf45797d0 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/distributedlock/DistributedLock.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/distributedlock/DistributedLock.java @@ -18,7 +18,7 @@ import java.util.concurrent.TimeUnit; @Component public class DistributedLock { - @Autowired + @Autowired(required = false) private RedissonClient redissonClient; /** diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/distributedlock/LockConstants.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/distributedlock/LockConstants.java index 3174a43a8e..a823816952 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/distributedlock/LockConstants.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/distributedlock/LockConstants.java @@ -9,4 +9,6 @@ public interface LockConstants { String TEST_LOCK_NAME = "testLock"; String STATS_LOCK_NAME = "stats"; + + String SCREEN_DAILY = "screenDaily"; } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/DictListFormDTO.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/DictListFormDTO.java new file mode 100644 index 0000000000..1880debe42 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/DictListFormDTO.java @@ -0,0 +1,20 @@ +package com.epmet.commons.tools.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +/** + * @Description 字典数据查询-接口入参 + * @Author sun + */ +@Data +public class DictListFormDTO { + + /** + * 字典类型 + */ + @NotBlank(message = "字典类型不能为空") + private String dictType; + +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/PageFormDTO.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/PageFormDTO.java index 134124f512..4820f4d50b 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/PageFormDTO.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/PageFormDTO.java @@ -20,8 +20,17 @@ public class PageFormDTO { } @NotNull(message = "页码不能为空", groups = AddUserInternalGroup.class) - private Integer pageNo; + private Integer pageNo = 1; @NotNull(message = "每页数量不能为空", groups = AddUserInternalGroup.class) - private Integer pageSize; + private Integer pageSize = 20; + + /** + * 偏移量 从多少条开始 + */ + private Integer offset; + + public Integer getOffset() { + return (pageNo-1)*pageSize; + } } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/CustomerStaffInfoCacheResult.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/CustomerStaffInfoCacheResult.java index c5db9c6718..81c74a4c38 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/CustomerStaffInfoCacheResult.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/CustomerStaffInfoCacheResult.java @@ -93,4 +93,20 @@ public class CustomerStaffInfoCacheResult implements Serializable { */ private List deptList; + /** + * 组织级别 + */ + private String level; + + /** + * 中心位置经度 + */ + private String longitude; + + /** + * 中心位置纬度 + */ + private String latitude; + + } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/DictListResultDTO.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/DictListResultDTO.java new file mode 100644 index 0000000000..fe89cf0d24 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/DictListResultDTO.java @@ -0,0 +1,17 @@ +package com.epmet.commons.tools.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description 字典数据查询-接口返参 + * @Author sun + */ +@Data +public class DictListResultDTO implements Serializable { + private static final long serialVersionUID = 8618231166600518980L; + private String label; + private String value; +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/OptionDataResultDTO.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/OptionDataResultDTO.java new file mode 100644 index 0000000000..5f815c7f5c --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/OptionDataResultDTO.java @@ -0,0 +1,19 @@ +package com.epmet.commons.tools.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2021/12/8 14:50 + */ +@Data +public class OptionDataResultDTO implements Serializable { + private static final long serialVersionUID = 416877704759019210L; + private String label; + private String value; + private String code; + private String radio; +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/OptionResultDTO.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/OptionResultDTO.java new file mode 100644 index 0000000000..8c42570bc3 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/OptionResultDTO.java @@ -0,0 +1,22 @@ +package com.epmet.commons.tools.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2021/10/26 13:53 + */ +@Data +public class OptionResultDTO implements Serializable { + private static final long serialVersionUID = 8618231166600518980L; + private String label; + private String value; + private String pValue; + private String sysDictDataId; + private List children; + private Boolean usableFlag; +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/BizTypeEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/BizTypeEnum.java index 1dec273299..8edc31e7e2 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/BizTypeEnum.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/BizTypeEnum.java @@ -11,10 +11,24 @@ import lombok.Getter; @Getter @AllArgsConstructor public enum BizTypeEnum { - //枚举类型 + //枚举类型 user,group,topic,issue,project,article + USER("user", "用户"), GROUP("group", "小组"), - ACTIVITY("activity", "活动"), - AGENCY("agency", "组织"); + TOPIC("topic", "话题"), + ISSUE("issue", "议题"), + PROJECT("project", "项目"), + ARTICLE("article", "文章(党建声音)"), + ; + + public static BizTypeEnum getEnum(String code) { + BizTypeEnum[] values = BizTypeEnum.values(); + for (BizTypeEnum value : values) { + if (value.getType().equals(code)) { + return value; + } + } + return null; + } /** * 类型 @@ -23,6 +37,6 @@ public enum BizTypeEnum { /** * 描述 */ - private String typeDesc; + private String desc; } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DictTypeEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DictTypeEnum.java new file mode 100644 index 0000000000..e1fa6b1456 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DictTypeEnum.java @@ -0,0 +1,59 @@ +package com.epmet.commons.tools.enums; + +/** + * @author Administrator + */ +public enum DictTypeEnum { + /** + * 环境变量枚举 + */ + UN_KNOWN("un_know", "暂不清楚", 0), + NINE_SMALL_PLACES("nine_small_places", "九小场所", 1), + EDUCATION("education", "文化程度", 2), + NATION("nation", "民族", 3), + RELATIONSHIP("relationship", "与户主关系", 4), + HOUSE("house", "住房性质", 5), + SCALE("scale", "人员规模", 6), + PARTY_UNIT_TYPE("party_unit_type", "联建单位分类", 7), + GENDER("gender", "性别", 8), + USER_DEMAND_STATUS("user_demand_status", "居民需求状态",8), + USER_DEMAND_REPORT_TYPE("user_demand_report_type","居民需求上报类型",9), + USER_DEMAND_SERVICE_TYPE("user_demand_service_type","居民需求服务方类型",10), + AGE_GROUP("age_group", "年龄范围", 11), + ; + + private final String code; + private final String name; + private final Integer sort; + + + + DictTypeEnum(String code, String name, Integer sort) { + this.code = code; + this.name = name; + this.sort = sort; + } + + public static DictTypeEnum getEnum(String code) { + DictTypeEnum[] values = DictTypeEnum.values(); + for (DictTypeEnum value : values) { + if (value.getCode().equals(code)) { + return value; + } + } + return DictTypeEnum.UN_KNOWN; + } + + + public String getCode() { + return code; + } + + public String getName() { + return name; + } + + public Integer getSort(){ + return sort; + } +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/FormItemTypeEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/FormItemTypeEnum.java new file mode 100644 index 0000000000..753852bfff --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/FormItemTypeEnum.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.epmet.commons.tools.enums; + +/** + * form表单 配置item类型 枚举 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public enum FormItemTypeEnum { + //枚举类型 + INPUT("input", "输入框"), + RADIO("radio", "单选框"), + CHECKBOX("checkbox", "复选框"), + SELECT("select", "下拉框"), + TEXTAREA("textarea", "文本域"), + CASCADER("cascader", "及联"), + DATE_PICKER("datepicker", "组织"), + UN_KNOWN("un_known", "不支持的类型"); + + private String code; + private String desc; + + FormItemTypeEnum(String value,String name) { + this.code = value; + this.desc = name; + } + + public static FormItemTypeEnum getEnum(String code) { + FormItemTypeEnum[] values = FormItemTypeEnum.values(); + for (FormItemTypeEnum value : values) { + if (value.getCode().equals(code)) { + return value; + } + } + return UN_KNOWN; + } + + public String getCode() { + return code; + } + + public String getDesc() { + return desc; + } +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/GenderEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/GenderEnum.java new file mode 100644 index 0000000000..5604377ed5 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/GenderEnum.java @@ -0,0 +1,44 @@ +package com.epmet.commons.tools.enums; + +import com.epmet.commons.tools.exception.EpmetErrorCode; + +public enum GenderEnum { + MAN("1", "男"), + WOMAN("2", "女"), + UN_KNOWN("0", "未知"); + + private String code; + private String name; + + + GenderEnum(String code, String name) { + this.code = code; + this.name = name; + } + + public static String getName(String code) { + GenderEnum[] genderEnums = values(); + for (GenderEnum genderEnum : genderEnums) { + if (genderEnum.getCode() == code) { + return genderEnum.getName(); + } + } + return EpmetErrorCode.SERVER_ERROR.getMsg(); + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/HouseTypeEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/HouseTypeEnum.java new file mode 100644 index 0000000000..c86ff94d4e --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/HouseTypeEnum.java @@ -0,0 +1,45 @@ +package com.epmet.commons.tools.enums; + +import com.epmet.commons.tools.exception.EpmetErrorCode; + +public enum HouseTypeEnum { + //房屋类型,1楼房,2平房,3别墅 + LOUFANG("1", "楼房"), + PINGFANG("2", "平房"), + BIESHU("3", "别墅"); + + private String code; + private String name; + + + HouseTypeEnum(String code, String name) { + this.code = code; + this.name = name; + } + + public static String getName(String code) { + HouseTypeEnum[] houseTypeEnums = values(); + for (HouseTypeEnum houseTypeEnum : houseTypeEnums) { + if (houseTypeEnum.getCode() == code) { + return houseTypeEnum.getName(); + } + } + return EpmetErrorCode.SERVER_ERROR.getMsg(); + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/PartyUnitTypeEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/PartyUnitTypeEnum.java new file mode 100644 index 0000000000..6d7aee6009 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/PartyUnitTypeEnum.java @@ -0,0 +1,59 @@ +package com.epmet.commons.tools.enums; + +import com.epmet.commons.tools.exception.EpmetErrorCode; + +/** + * @author Administrator + */ +public enum PartyUnitTypeEnum { + //房屋类型,1楼房,2平房,3别墅 + LOUYU("0", "楼宇党建"), + ZUZHI("1", "两新组织"), + DANWEI("2", "区域单位党建"), + JIGUAN("3", "机关直属部门"), + QITA("4", "其他"); + private String code; + private String name; + + + PartyUnitTypeEnum(String code, String name) { + this.code = code; + this.name = name; + } + + public static String getName(String code) { + PartyUnitTypeEnum[] houseTypeEnums = values(); + for (PartyUnitTypeEnum houseTypeEnum : houseTypeEnums) { + if (houseTypeEnum.getCode() == code) { + return houseTypeEnum.getName(); + } + } + return EpmetErrorCode.SERVER_ERROR.getMsg(); + } + + public static String getCode(String name) { + PartyUnitTypeEnum[] houseTypeEnums = values(); + for (PartyUnitTypeEnum houseTypeEnum : houseTypeEnums) { + if (houseTypeEnum.getName().equals(name)) { + return houseTypeEnum.getCode(); + } + } + return null; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RelationshipEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RelationshipEnum.java new file mode 100644 index 0000000000..39a0f81550 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RelationshipEnum.java @@ -0,0 +1,58 @@ +package com.epmet.commons.tools.enums; + +/** + * @author Administrator + */ + +public enum RelationshipEnum { + /** + * 环境变量枚举 + */ + UN_KNOWN("0", "暂不清楚", 0), + SELF("1", "本人", 1), + spouse("2", "配偶", 2), + CHILD("3", "子女", 3), + PARENT("4", "父母", 4), + PARENT_IN_LAW("5", "岳父母或公婆", 5), + GRANDPARENT_IN_LAW("6", "祖父母", 6), + CHILD_IN_LAW("7", "媳婿", 7), + GRANDCHILD("8", "孙子女", 8), + BROTHER_AND_SISTER("9", "兄弟姐妹", 9), + OTHER("10", "其他", 10), + ; + + private final String code; + private final String name; + private final Integer sort; + + + + RelationshipEnum(String code, String name, Integer sort) { + this.code = code; + this.name = name; + this.sort = sort; + } + + public static RelationshipEnum getEnum(String code) { + RelationshipEnum[] values = RelationshipEnum.values(); + for (RelationshipEnum value : values) { + if (value.getCode().equals(code)) { + return value; + } + } + return RelationshipEnum.UN_KNOWN; + } + + + public String getCode() { + return code; + } + + public String getName() { + return name; + } + + public Integer getSort(){ + return sort; + } +} \ No newline at end of file diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index f078bd4bb6..0f70c9ecbd 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java @@ -7,6 +7,9 @@ package com.epmet.commons.tools.exception; */ public enum EpmetErrorCode { + /** + * 错误code及消息 + */ ERR10002( 10002,"数据库中已存在该记录"), /** * 账号或密码错误ACCOUNT_NOT_EXIST @@ -19,6 +22,7 @@ public enum EpmetErrorCode { ERR10005(10005, "token不能为空"), ERR10006(10006, "登录超时,请重新登录"), ERR10007(10007, "当前帐号已在别处登录"), + ERR10008(10008, "Ticket错误"), ERR10019(10019, "验证码不正确"), SYSTEM_MQ_MSG_SEND_FAIL(10020, "MQ消息发送失败"), ERR401(401, "未授权"), @@ -76,6 +80,19 @@ public enum EpmetErrorCode { SET_PARENT_AREA_CODE(8210,"请先设置上级组织区划"), HAVE_GUIDE_CANNOT_DEL(8211,"当前分类已经存在办事指南,不允许删除"), GUIDE_CATEGORY_NAME_EXITS(8212,"分类已存在"), + CUSTOMER_FORM_NOT_EXITS(8213,"客户未配置表单"), + RESI_NOT_FOUND(8214,"居民信息找不到"), + BUILDING_NAME_EXITED(8215,"楼栋名称已存在"), + DOOR_NAME_EXITED(8216,"门牌号已存在"), + NEIGHBOOR_NAME_EXITED(8217,"小区名称已存在"), + DEMAND_NAME_EXITED(8218, "分类名称已存在"), + DEMAND_CAN_NOT_CANCEL(8219, "需求已完成,不可取消"), + DEMAND_CAN_NOT_ASSIGN(8220, "当前状态,不可指派"), + DEMAND_CAN_NOT_FINISH(8221, "当前状态,不能评价"), + DEMAND_FINISHED(8222,"需求已完成"), + DEMAND_CAN_NOT_UPDATE(8223,"当前状态,不可更新需求"), + DEMAND_NOT_EXITS(8224,"需求不存在"), + DEMAND_SERVICE_NOT_EXITS(8225,"服务记录不存在"), REQUIRE_PERMISSION(8301, "您没有足够的操作权限"), THIRD_PLAT_REQUEST_ERROR(8302, "请求第三方平台错误"), @@ -128,6 +145,26 @@ public enum EpmetErrorCode { PATROL_REPEATED_SUBMIT_ERROR(8521, "巡查已结束,请勿重复提交"), PATROL_END_TIME_ERROR(8522, "巡查结束时间不能小于巡查开始时间"), TIME_FORMAT_ERROR(8523, "时间格式错误"), + //社区党建 + PARTY_UNIT_NAME_EXITED(8531, "单位名称已存在"), + // 社区自组织 + COMMUNITY_SELF_ORGANIZATION_REPART_ERROR(8524, "社区自组织名称已存在"), + + // 党群服务中心 + PARTY_SERVICE_CENTER_ERROR(8525, "党群服务中心名称已存在"), + // 删除可预约事项存在预约记录时提示 + MATTER_EXISTS_APPOINTMENT_ERROR(8526, "尚有未履行的预约存在,请确认后操作"), + + // 预约某事项在某时间段存在记录时 + APPOINTMENT_TIME_ERROR(8527, "该时间段已被预约,请选择其他时间段"), + + APPOINTMENT_ERROR(8528, "%s尚有未履行的预约存在,请确认后操作"), + + EXISTS_SAME_PHONE_ERROR(8529, "%s存在重复"), + + COMMUNITY_SELF_ORGANIZATION_LIST_REPART_ERROR(8530, "%s社区自组织名称已存在"), + MATTER_NAME_EXISTS_APPOINTMENT_ERROR(8532, "存在重复预约事项"), + // 该错误不会提示给前端,只是后端传输错误信息用。 ACCESS_SQL_FILTER_MISSION_ARGS(8701, "缺少生成权限过滤SQL所需参数"), OPER_ADD_CUSTOMER_ROOT_AGENCY_ERROR(8702, "添加客户根级组织失败"), @@ -212,8 +249,18 @@ public enum EpmetErrorCode { SAME_RULE_NAME(8916,"该积分事件已存在,请重新调整保存"), UP_LIMIT_POINT(8917,"积分上限需为单位积分倍数,请重新调整保存"), - BADGE_CHECK(8918,""); + BADGE_CHECK(8918,""), + + ORG_ADD_FAILED(8919,"添加失败"), + ORG_EDIT_FAILED(8920,"编辑失败"), + ORG_DEL_FAILED(8921,"删除失败"), + + //通用错误码 start + //通用的 错误消息自己定义返回 + EPMET_COMMON_OPERATION_FAIL(9999,"网络开小差..."), + //通用错误码 end + ; private int code; private String msg; diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetException.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetException.java new file mode 100644 index 0000000000..6ce29315ba --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetException.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + *

+ * https://www.renren.io + *

+ * 版权所有,侵权必究! + */ + +package com.epmet.commons.tools.exception; + + +import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.utils.MessageUtils; +import org.apache.commons.lang3.StringUtils; + +/** + * Epmet产品 自定义异常 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public class EpmetException extends RuntimeException { + + private static final long serialVersionUID = 1L; + /** + * desc:错误码 + */ + protected int code; + /** + * 显示给客户的消息 + */ + protected String msg; + /** + * 内部消息,用于服务之间传递错误信息,排错用 + */ + protected String internalMsg; + + /** + * desc:指定错误码异常 外部异常内容为错误码对应的异常 + * @param code + */ + public EpmetException(int code) { + this(code, StrConstant.EPMETY_STR); + } + + /** + * desc:指定内部错误消息的异常 外部异常内容为错误码对应的异常 + * @param code + * @param internalMsg + */ + public EpmetException(int code, String internalMsg) { + super(internalMsg); + this.code = code; + if (StringUtils.isBlank(internalMsg)) { + this.internalMsg = EpmetErrorCode.getMsg(code); + if (StringUtils.isBlank(this.internalMsg)) { + this.internalMsg = MessageUtils.getMessage(code, internalMsg); + } + } else { + this.internalMsg = internalMsg; + } + } + + /** + * desc:指定错误码 内外部错误消息异常 + * @param code + * @param internalMsg + * @param externalMsg + */ + public EpmetException(int code, String internalMsg, String externalMsg) { + this(code, internalMsg); + this.msg = externalMsg; + } + + /** + * desc:指定内部消息异常 外部错误码及消息为8000,服务器开小差 + * @param internalMsg + */ + public EpmetException(String internalMsg) { + super(internalMsg); + this.code = EpmetErrorCode.SERVER_ERROR.getCode(); + this.internalMsg = internalMsg; + } + + public int getCode() { + return code; + } + + public String getMsg() { + return msg; + } + + public String getInternalMsg() { + return internalMsg; + } +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/RenException.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/RenException.java index 73ae4bf6b5..ee1d4da142 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/RenException.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/RenException.java @@ -35,11 +35,12 @@ public class RenException extends RuntimeException { * 内部消息,用于服务之间传递错误信息,排错用 */ private String internalMsg; - + @Deprecated //已废弃 被EpmetException替代 public RenException(int code) { this(code, ""); } + @Deprecated //已废弃 被EpmetException替代 public RenException(int code, String internalMsg) { super(internalMsg); this.code = code; @@ -53,11 +54,13 @@ public class RenException extends RuntimeException { } } + @Deprecated //已废弃 被EpmetException替代 public RenException(int code, String internalMsg, String msg, MessageMode mode) { this(code, internalMsg); this.msg = msg; } + @Deprecated //已废弃 被EpmetException替代 public RenException(String internalMsg) { super(internalMsg); // this.code = ErrorCode.INTERNAL_SERVER_ERROR; @@ -65,15 +68,12 @@ public class RenException extends RuntimeException { this.internalMsg = internalMsg; } + @Deprecated //已废弃 被EpmetException替代 public RenException(String internalMsg, String msg) { this(internalMsg); this.msg = msg; } - - - - public RenException(int code, String... params) { this.code = code; this.internalMsg = EpmetErrorCode.getMsg(code); diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/CommonAggFeignClient.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/CommonAggFeignClient.java index 5bfb7b698f..5a03583011 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/CommonAggFeignClient.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/CommonAggFeignClient.java @@ -2,11 +2,14 @@ package com.epmet.commons.tools.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.feign.fallback.CommonAggFeignClientFallBackFactory; +import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; import com.epmet.commons.tools.redis.common.bean.CustomerStaffInfoCache; +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.PathVariable; import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestParam; /** @@ -24,4 +27,22 @@ public interface CommonAggFeignClient { */ @PostMapping("/data/aggregator/epmetuser/getStaffInfo/{staffId}") Result getStaffInfo(@PathVariable("staffId") String staffId); + + /** + * @Description 查询组织信息 + * @param agencyId + * @author zxc + * @date 2021/11/5 2:54 下午 + */ + @PostMapping("/data/aggregator/org/agency") + Result getAgencyInfo(@RequestParam("agencyId")String agencyId); + + /** + * @Description 查询网格信息 + * @param gridId + * @author zxc + * @date 2021/11/5 2:54 下午 + */ + @PostMapping("/data/aggregator/org/grid") + Result getGridInfo(@RequestParam("gridId")String gridId); } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/EpmetBaseRequestInterceptor.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/EpmetBaseRequestInterceptor.java new file mode 100644 index 0000000000..7fb9822290 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/EpmetBaseRequestInterceptor.java @@ -0,0 +1,35 @@ +package com.epmet.commons.tools.feign; + +import feign.RequestInterceptor; +import feign.RequestTemplate; +import org.springframework.web.context.request.RequestAttributes; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.servlet.http.HttpServletRequest; +import java.util.Enumeration; + + +public class EpmetBaseRequestInterceptor implements RequestInterceptor { + + @Override + public void apply(RequestTemplate template) { + RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes(); + if (requestAttributes == null) { + return; + } + + HttpServletRequest request = ((ServletRequestAttributes) requestAttributes).getRequest(); + Enumeration headerNames = request.getHeaderNames(); + if (headerNames != null) { + while (headerNames.hasMoreElements()) { + String name = headerNames.nextElement(); + Enumeration values = request.getHeaders(name); + while (values.hasMoreElements()) { + String value = values.nextElement(); + template.header(name, value); + } + } + } + } +} \ No newline at end of file diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/FeignConfig.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/FeignConfig.java index c68dbc2913..ec7806a620 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/FeignConfig.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/FeignConfig.java @@ -1,8 +1,8 @@ /** * Copyright (c) 2018 人人开源 All rights reserved. - * + *

* https://www.renren.io - * + *

* 版权所有,侵权必究! */ @@ -10,49 +10,32 @@ package com.epmet.commons.tools.feign; import feign.Logger; import feign.RequestInterceptor; -import feign.RequestTemplate; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import org.springframework.web.context.request.RequestAttributes; -import org.springframework.web.context.request.RequestContextHolder; -import org.springframework.web.context.request.ServletRequestAttributes; - -import javax.servlet.http.HttpServletRequest; -import java.util.Enumeration; /** * Feign调用,携带header + * 各服务可以自定义自己的RequestInterceptor,如果自定义了,此处不会再生效,会优先使用自定义的拦截器实例 * * @author Mark sunlightcs@gmail.com * @since 1.0.0 */ @Configuration -public class FeignConfig implements RequestInterceptor { - @Override - public void apply(RequestTemplate template) { - RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes(); - if (requestAttributes == null) { - return; - } - - HttpServletRequest request = ((ServletRequestAttributes) requestAttributes).getRequest(); - Enumeration headerNames = request.getHeaderNames(); - if (headerNames != null) { - while (headerNames.hasMoreElements()) { - String name = headerNames.nextElement(); - Enumeration values = request.getHeaders(name); - while (values.hasMoreElements()) { - String value = values.nextElement(); - template.header(name, value); - } - } - } +public class FeignConfig { + @Bean + @ConditionalOnMissingBean + RequestInterceptor requestInterceptor() { + return new EpmetBaseRequestInterceptor(); } @Bean + @ConditionalOnMissingBean Logger.Level feignLoggerLevel() { return Logger.Level.BASIC;//控制台会输出debug日志 } + + } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/ResultDataResolver.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/ResultDataResolver.java index 5b56e64b1a..1bfa31e96b 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/ResultDataResolver.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/ResultDataResolver.java @@ -34,18 +34,19 @@ public interface ResultDataResolver { * @return * @param targetServiceName 目标service名称 * @param errorCode 错误码,可以为空,为空则使用上游服务抛出的错误码 - * @param errorInternalMsg 错误信息,可以为空,为空则使用上游服务抛出的异常信息 + * @param errorInternalMsg 内部错误信息,可以为空,为空则使用上游服务抛出的异常信息 + * @param showMsg 展示给前端程序的错误信息,可以为空。为空则根据errorCode给定错误msg信息 * @author wxz * @date 2021.06.07 22:45 */ - default R getResultDataOrThrowsException(Result result, String targetServiceName, Integer errorCode, String errorInternalMsg) { + default R getResultDataOrThrowsException(Result result, String targetServiceName, Integer errorCode, String errorInternalMsg, String showMsg) { if (result == null) { throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), "调用{}服务发生错误,返回Result为null", targetServiceName); } if (!result.success()) { Integer finalErrorCode = errorCode == null ? result.getCode() : errorCode; String finalErrorInternalMsg = StringUtils.isBlank(errorInternalMsg) ? result.getInternalMsg() : errorInternalMsg; - throw new RenException(finalErrorCode, finalErrorInternalMsg); + throw new RenException(finalErrorCode, finalErrorInternalMsg, showMsg, RenException.MessageMode.CODE_INTERNAL_EXTERNAL); } return result.getData(); } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonAggFeignClientFallback.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonAggFeignClientFallback.java index 2495d6b588..02f209f4f2 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonAggFeignClientFallback.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonAggFeignClientFallback.java @@ -2,7 +2,9 @@ package com.epmet.commons.tools.feign.fallback; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.feign.CommonAggFeignClient; +import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; import com.epmet.commons.tools.redis.common.bean.CustomerStaffInfoCache; +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; @@ -20,4 +22,14 @@ public class CommonAggFeignClientFallback implements CommonAggFeignClient { public Result getStaffInfo(String staffId) { return ModuleUtils.feignConError(ServiceConstant.DATA_AGGREGATOR_SERVER, "getStaffInfo", staffId); } + + @Override + public Result getAgencyInfo(String agencyId) { + return ModuleUtils.feignConError(ServiceConstant.DATA_AGGREGATOR_SERVER, "getAgencyInfo", agencyId); + } + + @Override + public Result getGridInfo(String gridId) { + return ModuleUtils.feignConError(ServiceConstant.DATA_AGGREGATOR_SERVER, "getGridInfo", gridId); + } } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java index 6fe4130225..1003009805 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java @@ -12,6 +12,7 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.utils.DateUtils; import org.apache.commons.lang3.StringUtils; +import org.apache.poi.ss.formula.functions.T; /** * @author Mark sunlightcs@gmail.com @@ -38,6 +39,13 @@ public class RedisKeys { return rootPrefix.concat("sys:captcha:").concat(uuid); } + /** + * 登录验证码Key + */ + public static String getIcLoginCaptchaKey(String uuid) { + return rootPrefix.concat("sys:captcha:iclogin:").concat(uuid); + } + /** * 登录用户Key */ @@ -341,6 +349,13 @@ public class RedisKeys { return rootPrefix.concat("stats:calflag"); } + /** + * 插入大屏指标数据分布式锁 key + */ + public static String getScreenIndexDataLockKey() { + return rootPrefix.concat("stats:indexcal:lock"); + } + /** * footbar缓存key * @param customerId @@ -351,12 +366,6 @@ public class RedisKeys { return rootPrefix.concat("footbar").concat(":").concat(customerId).concat(":").concat(appType); } - /** - * 插入大屏指标数据分布式锁 key - */ - public static String getScreenIndexDataLockKey() { - return rootPrefix.concat("stats:indexcal:lock"); - } /** * @return @@ -547,4 +556,81 @@ public class RedisKeys { public static String getQuestionnaireAccessKey(String userId, String qKey) { return rootPrefix.concat("questionnaire:accesskey:").concat(userId).concat(":").concat(qKey); } + + /** + * @description 检查message MQ阻塞消息 + * + * @param blockedMsgLabel 滞留消息的label + * @return + * @author wxz + * @date 2021.10.14 14:33:53 + */ + public static String blockedMqMsgKey(String blockedMsgLabel) { + return rootPrefix.concat("message:mq:blocked:").concat(blockedMsgLabel); + } + + /** + * desc:获取执行完毕的 业务 参数结果key + * @param bizMethod + * @return + */ + public static String getBackDoorbizExcuteResult(String bizMethod) { + return rootPrefix.concat("backdoor:").concat(bizMethod); + } + + /** + * @description 登录票据。目前只有IC基层治理平台用到 + * + * @param app + * @param ticket + * @return + * @author wxz + * @date 2021.10.25 17:49:43 + */ + public static String loginTicket(String app, String ticket) { + return rootPrefix.concat("sys:security:ticket:").concat(app).concat(":").concat(ticket); + } + + /** + * 政府端机关单位缓存Key + * @param formCode + * @param customerId + * @return + */ + public static String getIcFormKeyForAdd(String formCode,String customerId) { + return rootPrefix.concat("icform:").concat(formCode).concat(":add:").concat(customerId); + } + + public static String getIcFormKeyForExport(String formCode,String customerId) { + return rootPrefix.concat("icform:").concat(formCode).concat(":export:").concat(customerId); + } + + /** + * icd form items key + * @param customerId + * @param formCode + * @return + */ + public static String getIcFormItemsKey(String customerId, String formCode) { + return rootPrefix.concat("icform:").concat(formCode).concat(":items:").concat(customerId); + } + + /** + * desc:导出居民信息时 临时存储居民信息 便于其他sheet复用信息 + * @param resiId + * @return + */ + public static String getExportResiBaseInfoKey(String resiId) { + return rootPrefix.concat("resi:").concat("export").concat(":temp:").concat(resiId); + } + + /** + * desc:获取客户的居民下载模版是否变更的key 1表示变更 0没有变更 + * @param customerId + * @return + */ + public static String getResiTempChangedKey(String customerId) { + return rootPrefix.concat("resi:").concat("export").concat(":template:changed").concat(customerId); + } + } 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 new file mode 100644 index 0000000000..9cf82c29d6 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerOrgRedis.java @@ -0,0 +1,93 @@ +package com.epmet.commons.tools.redis.common; + +import cn.hutool.core.bean.BeanUtil; +import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.feign.CommonAggFeignClient; +import com.epmet.commons.tools.redis.RedisKeys; +import com.epmet.commons.tools.redis.RedisUtils; +import com.epmet.commons.tools.redis.common.bean.*; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import org.springframework.util.CollectionUtils; + +import javax.annotation.PostConstruct; +import java.util.Map; + +/** + * @Author zxc + * @DateTime 2021/11/5 2:29 下午 + * @DESC + */ +@Slf4j +@Component +public class CustomerOrgRedis { + + @Autowired + private RedisUtils redisUtils; + + @Autowired + private CommonAggFeignClient commonAggFeignClient; + + private static CustomerOrgRedis customerOrgRedis; + private static final String ROLE_MAP_KEY = "roleMap"; + + @PostConstruct + public void init() { + customerOrgRedis = this; + customerOrgRedis.redisUtils = this.redisUtils; + customerOrgRedis.commonAggFeignClient = this.commonAggFeignClient; + } + + /** + * @Description 获取网格信息 + * @param gridId + * @author zxc + * @date 2021/11/5 3:12 下午 + */ + public static GridInfoCache getGridInfo(String gridId){ + String key = RedisKeys.getGridInfoKey(gridId); + Map grid = customerOrgRedis.redisUtils.hGetAll(key); + if (!CollectionUtils.isEmpty(grid)) { + return ConvertUtils.mapToEntity(grid, GridInfoCache.class); + } + Result gridInfoResult = customerOrgRedis.commonAggFeignClient.getGridInfo(gridId); + if (!gridInfoResult.success()){ + throw new RenException("查询网格信息失败..."); + } + if (null == gridInfoResult.getData()){ + throw new RenException("没有此网格信息..."); + } + Map map = BeanUtil.beanToMap(gridInfoResult.getData(), false, true); + customerOrgRedis.redisUtils.hMSet(key, map); + return gridInfoResult.getData(); + } + + /** + * @Description 获取组织信息 + * @param agencyId + * @author zxc + * @date 2021/11/5 3:12 下午 + */ + public static AgencyInfoCache getAgencyInfo(String agencyId){ + String key = RedisKeys.getAgencyByIdKey(agencyId); + Map agency = customerOrgRedis.redisUtils.hGetAll(key); + if (!CollectionUtils.isEmpty(agency)) { + return ConvertUtils.mapToEntity(agency, AgencyInfoCache.class); + } + Result agencyInfoResult = customerOrgRedis.commonAggFeignClient.getAgencyInfo(agencyId); + if (!agencyInfoResult.success()){ + throw new RenException("查询组织信息失败..."); + } + if (null == agencyInfoResult.getData()){ + throw new RenException("没有此组织信息..."); + } + Map map = BeanUtil.beanToMap(agencyInfoResult.getData(), false, true); + customerOrgRedis.redisUtils.hMSet(key, map); + return agencyInfoResult.getData(); + } + +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/AgencyInfoCache.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/AgencyInfoCache.java new file mode 100644 index 0000000000..684440db65 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/AgencyInfoCache.java @@ -0,0 +1,142 @@ +package com.epmet.commons.tools.redis.common.bean; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @Author zxc + * @DateTime 2021/11/5 2:45 下午 + * @DESC + */ +@Data +public class AgencyInfoCache implements Serializable { + + private static final long serialVersionUID = -1332373159954084159L; + + /** + * ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 上级组织机构ID + */ + private String pid; + + /** + * 所有上级组织机构ID(以英文:隔开) + */ + private String pids; + + /** + * 所有上级名称,以-连接 + */ + private String allParentName; + + /** + * 组织名称 + */ + private String organizationName; + + /** + * 机关级别(社区级:community, + 乡(镇、街道)级:street, + 区县级: district, + 市级: city + 省级:province) 机关级别(社区级:community,乡(镇、街道)级:street,区县级: district,市级: city省级:province) + */ + private String level; + + /** + * 地区编码 + */ + private String areaCode; + + /** + * 删除标识 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 总人数 + */ + private Integer totalUser; + + /** + * 省 + */ + private String province; + + /** + * 市 + */ + private String city; + + /** + * 区县 + */ + private String district; + + /** + * 当前组织的上级行政地区编码add0204;举例平阴县对应的是济南市3701 + */ + private String parentAreaCode; + + /** + * 街道 + */ + private String street; + + /** + * 社区 + */ + private String community; + + /** + * 坐标区域 + */ + private String coordinates; + + + /** + * 中心位置经度 + */ + private String longitude; + + /** + * 中心位置纬度 + */ + private String latitude; +} 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 new file mode 100644 index 0000000000..cf90afee5b --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/GridInfoCache.java @@ -0,0 +1,116 @@ +package com.epmet.commons.tools.redis.common.bean; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @Author zxc + * @DateTime 2021/11/5 2:24 下午 + * @DESC + */ +@Data +public class GridInfoCache implements Serializable { + + private static final long serialVersionUID = -6159429894486235267L; + + + /** + * ID 唯一标识 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 网格名称 + */ + private String gridName; + + /** 组织-网格 */ + private String gridNamePath; + + /** + * 中心位置经度 + */ + private String longitude; + + /** + * 中心位置纬度 + */ + private String latitude; + + /** + * 所属地区码(所属组织地区码) + */ + private String areaCode; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 管辖区域 + */ + private String manageDistrict; + + /** + * 当前网格总人数 + */ + private Integer totalUser; + + /** + * 所属组织机构ID(customer_organization.id) + */ + private String pid; + + /** + * 所有上级组织ID + */ + private String pids; + + /** + * 所属组织机构名 + */ + private String agencyName; + + /** + * 所有上级组织名 + */ + private String allParentName; + + /** + * 坐标区域 + */ + private String coordinates; +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/dto/IcTokenDto.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/dto/IcTokenDto.java new file mode 100644 index 0000000000..de61615504 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/dto/IcTokenDto.java @@ -0,0 +1,81 @@ +package com.epmet.commons.tools.security.dto; + +import com.alibaba.fastjson.JSON; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; +import java.util.Set; + +/** + * @Description ic平台token + * @author wxz + * @date 2021.10.26 13:58:03 +*/ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class IcTokenDto extends BaseTokenDto { + + /** + * 当前登录的组织id(顶级) + */ + private String rootAgencyId; + + /** + * 当前用户所属的机关单位id + */ + private String agencyId; + + /** + * 当前网格对应的组织结构id的全路径用:隔开 + */ + private String orgIdPath; + + /** + * 当前所在网格id + */ + private String gridId; + + /*** + * 所在网格列表 + */ + private Set gridIdList; + + /** + * 部门id列表 + */ + private Set deptIdList; + + /** + * 功能权限列表,实际上是gov_staff => staff_role => role_operation查询到的operationKey + */ + private Set permissions; + + /** + * 角色ID列表 + */ + private List roleList; + + /** + * 过期时间戳 + */ + private Long expireTime; + + @Data + public static class Role { + + private String id; + private String roleKey; + private String roleName; + + public Role() { + } + } + + @Override + public String toString() { + return JSON.toJSONString(this); + } +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/user/LoginUserUtil.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/user/LoginUserUtil.java index bb5e6f7b5d..70307f6551 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/user/LoginUserUtil.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/user/LoginUserUtil.java @@ -6,7 +6,6 @@ import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Component; import javax.servlet.http.HttpServletRequest; -import java.util.Enumeration; import java.util.List; /** @@ -35,18 +34,6 @@ public class LoginUserUtil { return userId; } - /** - * 查询登录用户的客户Id - * @return - */ - public String getCurrentCustomerId() { - HttpServletRequest request = HttpContextUtils.getHttpServletRequest(); - if (request == null) { - return null; - } - return request.getHeader(AppClientConstant.CUSTOMER_ID); - } - /** * 登录用户的App头信息 * @return diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java index 66313a3cb6..db6abec6aa 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java @@ -11,6 +11,7 @@ package com.epmet.commons.tools.utils; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.dto.form.TimeListResultDTO; +import com.google.common.collect.Maps; import org.apache.commons.lang3.StringUtils; import org.joda.time.DateTime; import org.joda.time.LocalDate; @@ -743,44 +744,6 @@ public class DateUtils { return minusMonthId; } - /** - * @Description 根据传入的时间维度判断格式,日、周、月、季、年 - * @param dimension - * @return - * @author wangc - * @date 2020.09.24 10:11 - **/ - public static String identifyTimeDimension(String dimension){ - //yyyyMMdd DATE_PATTERN_YYYYMMDD - //yyyyMM DATE_PATTERN_YYYYMM - //yyyy DATE_PATTERN_YYYY - //yyyyWcc - //yyyyQc - if(dimension.length() == NumConstant.EIGHT){ - - SimpleDateFormat df = new SimpleDateFormat(DATE_PATTERN_YYYYMMDD); - try{ df.parse(dimension); }catch (ParseException e){ return null; } - return "date"; - - }else if(dimension.length() == NumConstant.FOUR){ - SimpleDateFormat df = new SimpleDateFormat(DATE_PATTERN_YYYY); - try{df.parse(dimension);}catch (ParseException e){return null;} - return "year"; - }else if(dimension.length() == NumConstant.SEVEN){ - if(dimension.contains("W")){ - return "week"; - }else return null; - }else if(dimension.length() == NumConstant.SIX){ - if(dimension.contains("Q")){ - return "quarter"; - }else{ - SimpleDateFormat df = new SimpleDateFormat(DATE_PATTERN_YYYYMM); - try{df.parse(dimension);}catch (ParseException e){return null;} - return "month"; - } - }else return null; - } - /** * 指定月份的开始时间 * @param date @@ -928,4 +891,58 @@ public class DateUtils { format = DateUtils.format(DateUtils.getMonthEnd(dateIdDate), DateUtils.DATE_PATTERN_YYYYMMDD); System.out.println(format); } + + /** + * @Author sun + * @Description 获取dateId对应的num天的dateId活monthId + * dateId yyyymmdd + * type[date;month] + * num[1;-1] + * 20211201 date 1 -> 20211202 + * 20211201 month -1 -> 202111 + **/ + public static String dateOrmonthId(String dateId, String type, int num){ + Calendar cal=Calendar.getInstance(); + if (StringUtils.isNotBlank(dateId)){ + cal.setTime(DateUtils.parseDate(dateId,DateUtils.DATE_PATTERN_YYYYMMDD)); + } + if("date".equals(type)){ + cal.add(Calendar.DATE, num); + }else if("month".equals(type)){ + cal.add(Calendar.MONTH, num); + } + Date time=cal.getTime(); + if("month".equals(type)){ + return new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMM).format(time); + } + return new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD).format(time); + } + + /** + * @Author sun + * @Description 获取dateId对应上一个月过去12个月的monthId + * dateId yyyymmdd + * 20211201 -> 202012-202111的值 + **/ + public static LinkedHashMap getXproSub(String dateId){ + java.time.format.DateTimeFormatter fmt = java.time.format.DateTimeFormatter.ofPattern("yyyyMM"); + LinkedHashMap xAxis = new LinkedHashMap<>(); + Calendar cal=Calendar.getInstance(); + cal.setTime(DateUtils.parseDate(dateId, DateUtils.DATE_PATTERN_YYYYMMDD)); + TimeZone tz = cal.getTimeZone(); + ZoneId zid = tz == null ? ZoneId.systemDefault() : tz.toZoneId(); + java.time.LocalDate today = java.time.LocalDateTime.ofInstant(cal.toInstant(), zid).toLocalDate(); + //java.time.LocalDate today = java.time.LocalDate.now(); + + for(int i = NumConstant.TWELVE;i > NumConstant.ZERO; i--){ + java.time.LocalDate localDate = today.minusMonths(i); + String s = localDate.getMonth().getValue() + "月"; + xAxis.put(localDate.format(fmt),s); + } + LinkedHashMap result = Maps.newLinkedHashMap(); + xAxis.entrySet().stream().sorted(Map.Entry.comparingByKey()) + .forEachOrdered((e -> result.put(e.getKey(),e.getValue()))); + return result; + } + } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ExcelPoiUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ExcelPoiUtils.java new file mode 100644 index 0000000000..3ea8472867 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ExcelPoiUtils.java @@ -0,0 +1,276 @@ +package com.epmet.commons.tools.utils; + +import cn.afterturn.easypoi.excel.ExcelExportUtil; +import cn.afterturn.easypoi.excel.ExcelImportUtil; +import cn.afterturn.easypoi.excel.entity.ExportParams; +import cn.afterturn.easypoi.excel.entity.ImportParams; +import cn.afterturn.easypoi.excel.entity.TemplateExportParams; +import cn.afterturn.easypoi.excel.entity.enmus.ExcelType; +import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult; +import org.apache.commons.lang3.StringUtils; +import org.apache.poi.ss.usermodel.Workbook; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletResponse; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URLEncoder; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; + +public class ExcelPoiUtils { + /** + * excel 导出 + * + * @param list 数据列表 + * @param fileName 导出时的excel名称 + * @param response + */ + public static void exportExcel(List> list, String fileName, HttpServletResponse response) throws IOException { + defaultExport(list, fileName, response); + } + + /** + * 默认的 excel 导出 + * + * @param list 数据列表 + * @param fileName 导出时的excel名称 + * @param response + */ + private static void defaultExport(List> list, String fileName, HttpServletResponse response) throws IOException { + //把数据添加到excel表格中 + Workbook workbook = ExcelExportUtil.exportExcel(list, ExcelType.HSSF); + downLoadExcel(fileName, response, workbook); + } + + /** + * excel 导出 + * + * @param list 数据列表 + * @param pojoClass pojo类型 + * @param fileName 导出时的excel名称 + * @param response + * @param exportParams 导出参数(标题、sheet名称、是否创建表头,表格类型) + */ + private static void defaultExport(List list, Class pojoClass, String fileName, HttpServletResponse response, ExportParams exportParams) throws IOException { + //把数据添加到excel表格中 + Workbook workbook = ExcelExportUtil.exportExcel(exportParams, pojoClass, list); + downLoadExcel(fileName, response, workbook); + } + + /** + * excel 导出 + * + * @param list 数据列表 + * @param pojoClass pojo类型 + * @param fileName 导出时的excel名称 + * @param exportParams 导出参数(标题、sheet名称、是否创建表头,表格类型) + * @param response + */ + public static void exportExcel(List list, Class pojoClass, String fileName, ExportParams exportParams, HttpServletResponse response) throws IOException { + defaultExport(list, pojoClass, fileName, response, exportParams); + } + + /** + * excel 导出 + * + * @param list 数据列表 + * @param title 表格内数据标题 + * @param sheetName sheet名称 + * @param pojoClass pojo类型 + * @param fileName 导出时的excel名称 + * @param response + */ + public static void exportExcel(List list, String title, String sheetName, Class pojoClass, String fileName, HttpServletResponse response) throws IOException { + defaultExport(list, pojoClass, fileName, response, new ExportParams(title, sheetName, ExcelType.XSSF)); + } + + + + /** + * excel 导出 + * + * @param list 数据列表 + * @param title 表格内数据标题 + * @param sheetName sheet名称 + * @param pojoClass pojo类型 + * @param fileName 导出时的excel名称 + * @param isCreateHeader 是否创建表头 + * @param response + */ + public static void exportExcel(List list, String title, String sheetName, Class pojoClass, String fileName, boolean isCreateHeader, HttpServletResponse response) throws IOException { + ExportParams exportParams = new ExportParams(title, sheetName, ExcelType.XSSF); + exportParams.setCreateHeadRows(isCreateHeader); + defaultExport(list, pojoClass, fileName, response, exportParams); + } + /** + * 根据模板生成excel后导出 + * @param templatePath 模板路径 + * @param map 数据集合 + * @param fileName 文件名 + * @param response + * @throws IOException + */ + public static void exportExcel(TemplateExportParams templatePath, Map map, String fileName, HttpServletResponse response) throws IOException { + Workbook workbook = ExcelExportUtil.exportExcel(templatePath, map); + downLoadExcel(fileName, response, workbook); + } + + + /** + * excel下载 + * + * @param fileName 下载时的文件名称 + * @param response + * @param workbook excel数据 + */ + private static void downLoadExcel(String fileName, HttpServletResponse response, Workbook workbook) throws IOException { + try { + response.setCharacterEncoding("UTF-8"); + response.setHeader("content-Type", "application/vnd.ms-excel"); + response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName + ".xlsx", "UTF-8")); + workbook.write(response.getOutputStream()); + } catch (Exception e) { + throw new IOException(e.getMessage()); + } + } + + + + /** + * excel 导入 + * + * @param file excel文件 + * @param pojoClass pojo类型 + * @param + * @return + */ + public static List importExcel(MultipartFile file, Class pojoClass) throws IOException { + return importExcel(file, 1, 1, pojoClass); + } + + /** + * excel 导入 + * + * @param filePath excel文件路径 + * @param titleRows 表格内数据标题行 + * @param headerRows 表头行 + * @param pojoClass pojo类型 + * @param + * @return + */ + public static List importExcel(String filePath, Integer titleRows, Integer headerRows, Class pojoClass) throws IOException { + if (StringUtils.isBlank(filePath)) { + return null; + } + ImportParams params = new ImportParams(); + params.setTitleRows(titleRows); + params.setHeadRows(headerRows); + params.setNeedSave(true); + params.setSaveUrl("/tmp/excel/"); + try { + return ExcelImportUtil.importExcel(new File(filePath), pojoClass, params); + } catch (NoSuchElementException e) { + throw new IOException("模板不能为空"); + } catch (Exception e) { + throw new IOException(e.getMessage()); + } + } + + + /** + * excel 导入 + * + * @param file 上传的文件 + * @param titleRows 表格内数据标题行 + * @param headerRows 表头行 + * @param pojoClass pojo类型 + * @param + * @return + */ + public static List importExcel(MultipartFile file, Integer titleRows, Integer headerRows, Class pojoClass) throws IOException { + if (file == null) { + return null; + } + try { + return importExcel(file.getInputStream(), titleRows, headerRows, pojoClass); + } catch (Exception e) { + throw new IOException(e.getMessage()); + } + } + + /** + * excel 导入 + * + * @param inputStream 文件输入流 + * @param titleRows 表格内数据标题行 + * @param headerRows 表头行 + * @param pojoClass pojo类型 + * @param + * @return + */ + public static List importExcel(InputStream inputStream, Integer titleRows, Integer headerRows, Class pojoClass) throws IOException { + if (inputStream == null) { + return null; + } + ImportParams params = new ImportParams(); + params.setTitleRows(titleRows); + params.setHeadRows(headerRows); + params.setSaveUrl("/tmp/excel/"); + params.setNeedSave(true); + try { + return ExcelImportUtil.importExcel(inputStream, pojoClass, params); + } catch (NoSuchElementException e) { + throw new IOException("excel文件不能为空"); + } catch (Exception e) { + throw new IOException(e.getMessage()); + } + } + /** + * excel 导入,有错误信息 + * + * @param file 上传的文件 + * @param pojoClass pojo类型 + * @param + * @return + */ + public static ExcelImportResult importExcelMore(MultipartFile file,Integer titleRows, Integer headerRows, Class pojoClass) throws IOException { + if (file == null) { + return null; + } + try { + return importExcelMore(file.getInputStream(), titleRows, headerRows, pojoClass); + } catch (Exception e) { + throw new IOException(e.getMessage()); + } + } + + /** + * excel 导入 + * + * @param inputStream 文件输入流 + * @param pojoClass pojo类型 + * @param + * @return + */ + private static ExcelImportResult importExcelMore(InputStream inputStream,Integer titleRows, Integer headerRows, Class pojoClass) throws IOException { + if (inputStream == null) { + return null; + } + ImportParams params = new ImportParams(); + params.setTitleRows(titleRows);//表格内数据标题行 + params.setHeadRows(headerRows);//表头行 + params.setSaveUrl("/tmp/excel/"); + params.setNeedSave(true); + params.setNeedVerify(true); + try { + return ExcelImportUtil.importExcelMore(inputStream, pojoClass, params); + } catch (NoSuchElementException e) { + throw new IOException("excel文件不能为空"); + } catch (Exception e) { + throw new IOException(e.getMessage()); + } + } +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ExcelUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ExcelUtils.java index 773291dfcc..754cdf012d 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ExcelUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ExcelUtils.java @@ -19,8 +19,8 @@ import org.springframework.util.CollectionUtils; import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletResponse; import java.io.IOException; +import java.io.OutputStream; import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Collection; import java.util.Date; @@ -121,5 +121,14 @@ public class ExcelUtils { out.flush(); out.close(); } + public static OutputStream getOutputStreamForExcel(String fileName, HttpServletResponse response) throws Exception { + fileName = URLEncoder.encode(fileName, "UTF-8"); + response.setContentType("application/vnd.ms-excel"); + response.setCharacterEncoding("utf8"); + response.setHeader("Content-Disposition", "attachment;filename=" + fileName); + response.addHeader("Access-Control-Expose-Headers", "Content-disposition"); + + return response.getOutputStream(); + } } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ExcelVerifyInfo.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ExcelVerifyInfo.java new file mode 100644 index 0000000000..a00bb8bbf4 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ExcelVerifyInfo.java @@ -0,0 +1,31 @@ +package com.epmet.commons.tools.utils; + +import cn.afterturn.easypoi.handler.inter.IExcelDataModel; +import cn.afterturn.easypoi.handler.inter.IExcelModel; + +public class ExcelVerifyInfo implements IExcelModel, IExcelDataModel { + + private String errorMsg; + + private int rowNum; + + @Override + public Integer getRowNum() { + return rowNum; + } + + @Override + public void setRowNum(Integer rowNum) { + this.rowNum = rowNum; + } + + @Override + public String getErrorMsg() { + return errorMsg; + } + + @Override + public void setErrorMsg(String errorMsg) { + this.errorMsg = errorMsg; + } +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/IpUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/IpUtils.java index d051717d8d..8aabf5f5d9 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/IpUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/IpUtils.java @@ -12,6 +12,7 @@ import com.epmet.commons.tools.constant.StrConstant; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.cloud.commons.util.InetUtils; import org.springframework.http.HttpHeaders; import org.springframework.http.server.reactive.ServerHttpRequest; @@ -127,12 +128,12 @@ public class IpUtils { * 遍历本地网卡的方式,在云平台虚拟机取不到真正的ip * @return */ - InetAddress localAddress = InetAddress.getLocalHost(); - if (isValidAddress(localAddress)) { - return localAddress.getHostAddress(); + InetUtils inetUtils = SpringContextUtils.getBean(InetUtils.class); + if (inetUtils == null || inetUtils.findFirstNonLoopbackHostInfo() == null) { + logger.warn("Could not get local host ip address"); + } else { + SERVER_IP = inetUtils.findFirstNonLoopbackHostInfo().getIpAddress(); } - logger.warn("Could not get local host ip address"); - return null; } catch (Exception e) { logger.error("IpUtils getServerIp exception ", e); } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/Pinyin4jUtil.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/Pinyin4jUtil.java index 331febcfe9..68c0b8012e 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/Pinyin4jUtil.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/Pinyin4jUtil.java @@ -31,7 +31,6 @@ public class Pinyin4jUtil { duoyinMap.put('均',new String[]{"jun"}); duoyinMap.put('会', new String[]{"hui"}); duoyinMap.put('属', new String[]{"shu"}); - duoyinMap.put('调', new String[]{"diao"}); } /** @@ -43,6 +42,7 @@ public class Pinyin4jUtil { */ public static String getFirstSpellPinYin(String src, boolean isFullSpell) { String targetStr = Pinyin4jUtil.makeStringByStringSet(Pinyin4jUtil.getPinyin(src, isFullSpell, 1)); + System.out.println("targetStr="+targetStr); String[] split = targetStr.split(","); if (split.length > 1) { targetStr = split[0]; @@ -59,6 +59,7 @@ public class Pinyin4jUtil { */ public static String getSpellPinYin(String src, boolean isFullSpell,Integer preFont) { String targetStr = Pinyin4jUtil.makeStringByStringSet(Pinyin4jUtil.getPinyin(src, isFullSpell, preFont)); + System.out.println("targetStr="+targetStr); String[] split = targetStr.split(","); if (split.length > 1) { targetStr = split[0]; @@ -195,8 +196,9 @@ public class Pinyin4jUtil { } public static void main(String[] args) { - System.out.println(getFirstSpellPinYin("区直部门",false)); - System.out.println(getSpellPinYin("党员提出话题数",false,4)); - System.out.println(getSpellPinYin("社区超期项目数",false,4)); + //System.out.println(getSpellPinYin("社区超期项目数",true,0)); + System.out.println(getFirstSpellPinYin("区直部门",true)); + //System.out.println(getSpellPinYin("党员提出话题数",false,4)); + //System.out.println(getSpellPinYin("社区超期项目数",false,4)); } } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/validator/AssertUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/validator/AssertUtils.java index 2f5dcd311a..d060fc5e6a 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/validator/AssertUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/validator/AssertUtils.java @@ -11,6 +11,7 @@ package com.epmet.commons.tools.validator; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.map.MapUtil; import cn.hutool.core.util.ArrayUtil; +import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.ErrorCode; import com.epmet.commons.tools.exception.RenException; import org.apache.commons.lang3.StringUtils; @@ -32,7 +33,7 @@ public class AssertUtils { public static void isBlank(String str, Integer code, String... params) { if(code == null){ - throw new RenException(ErrorCode.NOT_NULL, "code"); + throw new EpmetException(ErrorCode.NOT_NULL, "code"); } if (StringUtils.isBlank(str)) { @@ -46,7 +47,7 @@ public class AssertUtils { public static void isNull(Object object, Integer code, String... params) { if(code == null){ - throw new RenException(ErrorCode.NOT_NULL, "code"); + throw new EpmetException(ErrorCode.NOT_NULL, "code"); } if (object == null) { @@ -60,7 +61,7 @@ public class AssertUtils { public static void isArrayEmpty(Object[] array, Integer code, String... params) { if(code == null){ - throw new RenException(ErrorCode.NOT_NULL, "code"); + throw new EpmetException(ErrorCode.NOT_NULL, "code"); } if(ArrayUtil.isEmpty(array)){ @@ -74,7 +75,7 @@ public class AssertUtils { public static void isListEmpty(List list, Integer code, String... params) { if(code == null){ - throw new RenException(ErrorCode.NOT_NULL, "code"); + throw new EpmetException(ErrorCode.NOT_NULL, "code"); } if(CollUtil.isEmpty(list)){ @@ -88,7 +89,7 @@ public class AssertUtils { public static void isMapEmpty(Map map, Integer code, String... params) { if(code == null){ - throw new RenException(ErrorCode.NOT_NULL, "code"); + throw new EpmetException(ErrorCode.NOT_NULL, "code"); } if(MapUtil.isEmpty(map)){ diff --git a/epmet-gateway/deploy/docker-compose-prod.yml b/epmet-gateway/deploy/docker-compose-prod.yml index ebcdc7eafc..789eaec898 100644 --- a/epmet-gateway/deploy/docker-compose-prod.yml +++ b/epmet-gateway/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-gateway-server: container_name: epmet-gateway-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-gateway:0.3.43 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-gateway:0.3.69 ports: - "8080:8080" network_mode: host # 使用现有网络 @@ -15,4 +15,4 @@ services: resources: limits: cpus: '0.1' - memory: 600M \ No newline at end of file + memory: 600M diff --git a/epmet-gateway/pom.xml b/epmet-gateway/pom.xml index e09410668d..1169c9ca84 100644 --- a/epmet-gateway/pom.xml +++ b/epmet-gateway/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.43 + 0.3.69 com.epmet epmet-cloud @@ -223,6 +223,9 @@ lb://data-aggregator-server + + lb://open-data-worker-server + lb://epmet-openapi-adv-server @@ -320,11 +323,11 @@ lb://gov-issue-server - + lb://gov-project-server - - http://localhost:8103 + lb://common-service-server + lb://resi-home-server @@ -344,8 +347,8 @@ lb://epmet-openapi-scan - lb://epmet-third-server - + + http://localhost:8110 lb://epmet-heart-server @@ -361,6 +364,10 @@ lb://data-aggregator-server + + lb://open-data-worker-server + + lb://epmet-openapi-adv-server @@ -469,6 +476,8 @@ lb://data-aggregator-server lb://tduck-api + + lb://open-data-worker-server lb://epmet-openapi-adv-server @@ -499,7 +508,7 @@ - false + true @@ -570,6 +579,8 @@ lb://epmet-ext-server lb://data-aggregator-server + + lb://open-data-worker-server lb://epmet-openapi-adv-server diff --git a/epmet-gateway/src/main/java/com/epmet/GatewayApplication.java b/epmet-gateway/src/main/java/com/epmet/GatewayApplication.java index 5a86194ea7..a1630c821e 100644 --- a/epmet-gateway/src/main/java/com/epmet/GatewayApplication.java +++ b/epmet-gateway/src/main/java/com/epmet/GatewayApplication.java @@ -9,9 +9,9 @@ package com.epmet; import com.epmet.commons.tools.aspect.ServletExceptionHandler; +import com.epmet.commons.tools.config.RedissonConfig; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.web.servlet.ServletComponentScan; import org.springframework.cloud.client.discovery.EnableDiscoveryClient; import org.springframework.cloud.openfeign.EnableFeignClients; import org.springframework.context.annotation.ComponentScan; @@ -23,11 +23,11 @@ import org.springframework.context.annotation.FilterType; * @author Mark sunlightcs@gmail.com * @since 1.0.0 */ -@SpringBootApplication() +@SpringBootApplication @EnableDiscoveryClient @EnableFeignClients //@ServletComponentScan -@ComponentScan(basePackages = {"com.epmet.*"}, excludeFilters = @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, classes = {ServletExceptionHandler.class})) +@ComponentScan(basePackages = {"com.epmet.*"}, excludeFilters = @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, classes = {RedissonConfig.class, ServletExceptionHandler.class})) public class GatewayApplication { public static void main(String[] args) { diff --git a/epmet-gateway/src/main/java/com/epmet/config/CorsConfig.java b/epmet-gateway/src/main/java/com/epmet/config/CorsConfig.java index bb95213c1f..72a2e0a31f 100644 --- a/epmet-gateway/src/main/java/com/epmet/config/CorsConfig.java +++ b/epmet-gateway/src/main/java/com/epmet/config/CorsConfig.java @@ -117,7 +117,7 @@ class EpmetWebFilter implements WebFilter, ResultDataResolver { adminOpenFeignClient.list(), ServiceConstant.EPMET_ADMIN_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), - "调用Admin服务查询Cors配置失败"); + "调用Admin服务查询Cors配置失败", null); } catch (Exception e) { logger.error("调用Admin服务查询Cors配置失败"); } diff --git a/epmet-gateway/src/main/resources/bootstrap.yml b/epmet-gateway/src/main/resources/bootstrap.yml index c0308758b9..632d3a0ac4 100644 --- a/epmet-gateway/src/main/resources/bootstrap.yml +++ b/epmet-gateway/src/main/resources/bootstrap.yml @@ -350,6 +350,16 @@ spring: filters: - StripPrefix=1 - CpAuth=true + #政府工作端议题管理 + - id: open-data-worker-server + uri: @gateway.routes.open-data-worker-server.url@ + order: 38 + predicates: + - Path=${server.servlet.context-path}/opendata/** + filters: + - StripPrefix=1 + - CpAuth=true + nacos: discovery: server-addr: @nacos.server-addr@ @@ -476,13 +486,16 @@ epmet: - /data/aggregator/** - /gov/voice/** - /resi/voice/** + - /epmet/point/** # 内部认证url白名单(在白名单中的,就不会再校验登录了) internalAuthUrlsWhiteList: - /epmetuser/customerstaff/customerlist + - /auth/wechat/** + - /**/druid/** - /gov/project/project/platformcallback - /oper/customize/customerstartpage/homestartpage - - /tduck-api/** + - /epmet/point/mqCallback/** # 外部应用认证,使用AccessToken等头进行认证 externalOpenUrls: diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/OrgConstant.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/OrgConstant.java index b3083d658e..5119475926 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/OrgConstant.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/OrgConstant.java @@ -11,4 +11,7 @@ public interface OrgConstant { String CITY = "city"; String DISTRICT = "district"; + String GRID_ID="GRID_ID"; + String GENDER="GENDER"; + String HOUSE_TYPE_KEY="HOUSE_TYPE"; } diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/FactAgencyProjectMonthResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/FactAgencyProjectMonthResultDTO.java new file mode 100644 index 0000000000..8138219216 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/FactAgencyProjectMonthResultDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dataaggre.dto.datastats.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 项目月数据-接口返参 + * @Auth sun + */ +@Data +public class FactAgencyProjectMonthResultDTO implements Serializable { + private static final long serialVersionUID = 466974582608407121L; + //组织Id + private String agencyId; + //月维度Id + private String monthId; + //当月项目总数 【当前组织及下级前一月新增项目数】 + private Integer projectIncr = 0; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/FactAgencyProjectResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/FactAgencyProjectResultDTO.java new file mode 100644 index 0000000000..13bc60fa06 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/FactAgencyProjectResultDTO.java @@ -0,0 +1,35 @@ +package com.epmet.dataaggre.dto.datastats.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Description 项目总数-接口返参 + * @Auth sun + */ +@Data +public class FactAgencyProjectResultDTO implements Serializable { + private static final long serialVersionUID = 466974582608407121L; + @JsonIgnore + BigDecimal bi = new BigDecimal(0); + //组织Id + private String agencyId; + //组织名称 + private String dateId; + //月维度Id + private String monthId; + //项目总数 + private Integer projectTotal = 0; + //处理中项目数 + private Integer pendingTotal = 0; + //处理中项目占比 + private String pendingRatio = "0%"; + //已结案中项目数 + private Integer closedTotal = 0; + //已结案中项目占比 + private String closedRatio = "0%"; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/IcFormResColumnDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/IcFormResColumnDTO.java new file mode 100644 index 0000000000..9ea3d41328 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/IcFormResColumnDTO.java @@ -0,0 +1,16 @@ +package com.epmet.dataaggre.dto.epmetuser; + +import lombok.Data; + +/** + * @Description TODO + * @Author yinzuomei + * @Date 2021/10/27 4:26 下午 + */ +@Data +public class IcFormResColumnDTO { + private String tableName; + private String columnName; + private String label; +} + diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/StaffPatrolDetailDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/StaffPatrolDetailDTO.java index def0db685a..000f394a66 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/StaffPatrolDetailDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/StaffPatrolDetailDTO.java @@ -17,9 +17,10 @@ package com.epmet.dataaggre.dto.epmetuser; +import lombok.Data; + import java.io.Serializable; import java.util.Date; -import lombok.Data; /** @@ -94,7 +95,7 @@ public class StaffPatrolDetailDTO implements Serializable { private String horizontalaccuracy; /** - * 地址;暂时不用 + * 地址 */ private String address; diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/StaffPatrolRecordDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/StaffPatrolRecordDTO.java index be8e0300f3..e9db8368de 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/StaffPatrolRecordDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/StaffPatrolRecordDTO.java @@ -88,6 +88,11 @@ public class StaffPatrolRecordDTO implements Serializable { */ private String status; + /** + * 是否手动结束 手动:1,定时任务传参:0 + */ + private Integer isHandEnd; + /** * 删除标识 0.未删除 1.已删除 */ diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/CustomerStaffResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/CustomerStaffResultDTO.java index a03406f0d0..3269ebcb26 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/CustomerStaffResultDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/CustomerStaffResultDTO.java @@ -93,4 +93,24 @@ public class CustomerStaffResultDTO implements Serializable { */ private String twoOrgName; + /** + * 【社区】名称0409 + */ + private String community; + + /** + * 组织级别 + */ + private String level; + + /** + * 中心位置经度 + */ + private String longitude; + + /** + * 中心位置纬度 + */ + private String latitude; + } diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/PatrolDailySumResult.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/PatrolDailySumResult.java index 5400a1247f..c7fbe6b7ef 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/PatrolDailySumResult.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/PatrolDailySumResult.java @@ -15,7 +15,7 @@ import java.io.Serializable; public class PatrolDailySumResult implements Serializable { private static final long serialVersionUID = 310405655189243944L; - private String fullAgencyId; + private String orgId; private Integer patrolTotal; private Integer totalTime; } diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/PatrolRecordDetailDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/PatrolRecordDetailDTO.java index 922f21867b..f7e9afeabb 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/PatrolRecordDetailDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/PatrolRecordDetailDTO.java @@ -34,4 +34,9 @@ public class PatrolRecordDetailDTO implements Serializable { * 后端返回:开始巡查;结束巡查;此列只有集合第一条,和最后一条有值 */ private String flag; + + /** + * 位置信息 + */ + private String address; } diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/PatrolRecordListResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/PatrolRecordListResultDTO.java index d59abe39de..f2c9d0c387 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/PatrolRecordListResultDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/PatrolRecordListResultDTO.java @@ -45,4 +45,9 @@ public class PatrolRecordListResultDTO implements Serializable { */ private List details; + /** + * 是否手动结束 手动:1,定时任务传参:0 + */ + private Integer isHandEnd; + } diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/IssueProjectCategoryDictDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/IssueProjectCategoryDictDTO.java new file mode 100644 index 0000000000..fc11fafe4f --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/IssueProjectCategoryDictDTO.java @@ -0,0 +1,93 @@ +/** + * 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.dataaggre.dto.govissue; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 议题项目分类字典 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-08 + */ +@Data +public class IssueProjectCategoryDictDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id, 产品默认default + */ + private String customerId; + + /** + * 上级分类ID 顶级此列存储0 + */ + private String pid; + + /** + * 所有上级分类ID,用逗号分开 + */ + private String pids; + + /** + * 上级分类编码 + */ + private String parentCategoryCode; + + /** + * 分类编码,分类编码+customer_id唯一 + */ + private String categoryCode; + + /** + * 分类名称 + */ + private String categoryName; + + /** + * 分类类别1,2,3,4.... + */ + private String categoryType; + + /** + * 排序 + */ + private Integer sort; + + /** + * 是否禁用(enable:启用 disable:禁用) + */ + private String isDisable; + + /** + * 颜色 + */ + private String color; + + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerAgencyDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerAgencyDTO.java index 496a2c87cc..7c343c5ccc 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerAgencyDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerAgencyDTO.java @@ -142,4 +142,19 @@ public class CustomerAgencyDTO implements Serializable { * 社区 */ private String community; + + /** + * 坐标 + */ + private String coordinates; + + /** + * 中心位置经度 + */ + private String longitude; + + /** + * 中心位置纬度 + */ + private String latitude; } \ No newline at end of file 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 10620c89d2..fcb6d13250 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 @@ -59,6 +59,11 @@ public class CustomerGridDTO implements Serializable { */ private String latitude; + /** + * 坐标区域 + */ + private String coordinates; + /** * 所属地区码(所属组织地区码) */ @@ -123,4 +128,9 @@ public class CustomerGridDTO implements Serializable { * 所有上级组织名 */ private String allParentName; + + /** + * 组织-网格 + */ + private String gridNamePath; } diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/GridsInfoListResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/GridsInfoListResultDTO.java index f25721539f..571195cd86 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/GridsInfoListResultDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/GridsInfoListResultDTO.java @@ -24,8 +24,12 @@ public class GridsInfoListResultDTO implements Serializable { private String gridId; /** - * 网格名称 + * 组织-网格名称 */ private String gridName; + /** + * 网格名称 + */ + private String name; } diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/ResiEventDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/ResiEventDTO.java new file mode 100644 index 0000000000..4f0e39c907 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/ResiEventDTO.java @@ -0,0 +1,45 @@ +/** + * 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.dataaggre.dto.govproject; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 居民报事表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-08-03 + */ +@Data +public class ResiEventDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + private String projectId; + + private String reportUserId; + + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/form/CategoryProjectFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/form/CategoryProjectFormDTO.java new file mode 100644 index 0000000000..07588e5e3c --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/form/CategoryProjectFormDTO.java @@ -0,0 +1,45 @@ +package com.epmet.dataaggre.dto.govproject.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * @Description 赋能平台【项目分类分析】-接口入参 + * @Auth sun + */ +@NoArgsConstructor +@Data +public class CategoryProjectFormDTO implements Serializable { + private static final long serialVersionUID = -8515172319313536407L; + //组织Id + @NotBlank(message = "组织ID不能为空", groups = {Category.class}) + private String agencyId; + //日期yyyymmdd + @NotBlank(message = "组织ID不能为空", groups = {Category.class}) + private String dateId; + //一级分类Id + @NotBlank(message = "分类Code不能为空", groups = {Category.class}) + private String categoryCode; + //页码 + @Min(1) + private Integer pageNo = 1; + //每页多少条 + private Integer pageSize = 20; + //是否分页(是:true 否:false) + private Boolean isPage = true; + //明天的dateId值 + private String toDateId; + private String customerId; + private List categoreCodeList; + + + public interface Category extends CustomerClientShowGroup { + } + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/form/ProjectAnalysisFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/form/ProjectAnalysisFormDTO.java new file mode 100644 index 0000000000..a620667571 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/form/ProjectAnalysisFormDTO.java @@ -0,0 +1,36 @@ +package com.epmet.dataaggre.dto.govproject.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.List; + +/** + * @Description 赋能平台【项目分类分析】-接口入参 + * @Auth sun + */ +@NoArgsConstructor +@Data +public class ProjectAnalysisFormDTO implements Serializable { + private static final long serialVersionUID = -8515172319313536407L; + //小程序话题或事件发起人Id + @NotBlank(message = "话题或事件发起人Id不能为空", groups = {Analysis.class}) + private String userId; + //一级分类Id集合 + @NotNull(message = "分类Code集合不能为空", groups = {Analysis.class}) + private List categoryCodeList; + //当前查看的项目Id + @NotBlank(message = "当前查看项目Id不能为空", groups = {Analysis.class}) + private String projectId; + + private String customerId; + + public interface Analysis extends CustomerClientShowGroup { + } + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/form/ProjectCategoryTotalFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/form/ProjectCategoryTotalFormDTO.java new file mode 100644 index 0000000000..66d4e983b8 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/form/ProjectCategoryTotalFormDTO.java @@ -0,0 +1,32 @@ +package com.epmet.dataaggre.dto.govproject.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * @Description 赋能平台【项目分类分析】-接口入参 + * @Auth sun + */ +@NoArgsConstructor +@Data +public class ProjectCategoryTotalFormDTO implements Serializable { + private static final long serialVersionUID = -8515172319313536407L; + //组织Id + @NotBlank(message = "组织ID不能为空", groups = {Project.class}) + private String agencyId; + //日期yyyymmdd + @NotBlank(message = "日维度ID不能为空", groups = {Project.class}) + private String dateId; + + private String customerId; + + public interface Project extends CustomerClientShowGroup { + } + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/form/ProjectTotalFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/form/ProjectTotalFormDTO.java new file mode 100644 index 0000000000..22c0e731b6 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/form/ProjectTotalFormDTO.java @@ -0,0 +1,46 @@ +package com.epmet.dataaggre.dto.govproject.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 赋能平台【项目处理分析】事件总数查询-接口入参 + * @Auth sun + */ +@NoArgsConstructor +@Data +public class ProjectTotalFormDTO implements Serializable { + private static final long serialVersionUID = -8515172319313536407L; + //组织Id + @NotBlank(message = "组织ID不能为空", groups = {Total.class, Monthincr.class, Statuslist.class}) + private String agencyId; + //日期yyyymmdd + @NotBlank(message = "日维度ID不能为空", groups = {Total.class, Monthincr.class, Statuslist.class}) + private String dateId; + //状态:待处理 pending,结案closed + @NotBlank(message = "项目状态不能为空", groups = {Statuslist.class}) + private String status; + + public interface Total extends CustomerClientShowGroup { + } + public interface Monthincr extends CustomerClientShowGroup { + } + public interface Statuslist extends CustomerClientShowGroup { + } + + //较昨日的dateId值 + private String yeDateId; + //较dateId上月的monthId值 + private String monthId; + //查询数据起始月份Id + private String startMonth; + //查询数据结束月份Id + private String endMonth; + //明天的dateId值 + private String toDateId; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/CategoryProjectResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/CategoryProjectResultDTO.java new file mode 100644 index 0000000000..0d5b2f2707 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/CategoryProjectResultDTO.java @@ -0,0 +1,57 @@ +package com.epmet.dataaggre.dto.govproject.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @Description 赋能平台【项目处理分析】分类下项目列表-接口返参 + * @Auth sun + */ +@Data +public class CategoryProjectResultDTO implements Serializable { + private static final long serialVersionUID = 6188316867855643263L; + + //总条数 + private Integer total = 0; + + private List list; + + @Data + public static class Project { + //项目所属组织Id + private String agencyId; + //项目Id + private String projectId; + //项目编码[目前没这个功能 默认为空] + private String projectCode = ""; + //一级分类Code集合 + private List categoryCodes = new ArrayList<>(); + //一级分类名称集合 + private List categoryNames = new ArrayList<>(); + //来源:议题issue 项目立项:agency 事件:resi_event【控制电机查看时里边三个按钮的显示】 + private String origin; + //网格Id[上报给组织的事件、直接立项的项目此值为空] + private String gridId = ""; + //网格名[上报给组织的事件、直接立项的项目此值为空] + private String gridName = ""; + //状态:待处理 pending,已结案closed + private String status; + //标题 + private String title; + //转项目时间 + private String time; + //小程序居民端话题或事件创建人【立项项目此值为空】 + private String userId = ""; + //分类对应的所有上级,英文逗号隔开【目前分类只有两级,所以这个字段值其实就是一类的id值】 + @JsonIgnore + private String categoryPids; + //二级分类code + @JsonIgnore + private String categoryCode; + } + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/IssueProjectCategory.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/IssueProjectCategory.java new file mode 100644 index 0000000000..1e50bd7c19 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/IssueProjectCategory.java @@ -0,0 +1,12 @@ +package com.epmet.dataaggre.dto.govproject.result; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class IssueProjectCategory implements Serializable { + private static final long serialVersionUID = -2226298165882293959L; + private String issueId; + private String projectId; +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/ProjectAnalysisResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/ProjectAnalysisResultDTO.java new file mode 100644 index 0000000000..2601c26a63 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/ProjectAnalysisResultDTO.java @@ -0,0 +1,63 @@ +package com.epmet.dataaggre.dto.govproject.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @Description 赋能平台【项目处理分析】研判分析-接口返参 + * @Auth sun + */ +@Data +public class ProjectAnalysisResultDTO implements Serializable { + private static final long serialVersionUID = 6188316867855643263L; + + //小程序居民Id + private String userId; + //负能平台居民Id + private String icUserId; + //负能平台居民名称 + private String icUserName; + //家庭里人员集合 + private List homeUserList = new ArrayList<>(); + //楼院小组下分类项目列表 + private List groupProjectList = new ArrayList<>(); + //事件上报下分类项目列表 + private List eventProjectList = new ArrayList<>(); + + @Data + public static class Home { + //家庭Id + private String homeId; + //居民Id + private String icUserId; + //居民姓名 + private String icUserName; + + } + + @Data + public static class Category { + //一级分类Id + private String categoryCode; + //一级分类名称 + private String categoryName; + //分类下项目列表【创建时间倒序】 + private List projectList = new ArrayList<>(); + + + } + + @Data + public static class Project { + //项目Id + private String projectId; + //项目标题 + private String title; + //状态:待处理 pending,结案closed + private String status; + } + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/ProjectCategoryResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/ProjectCategoryResultDTO.java new file mode 100644 index 0000000000..f7846c3354 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/ProjectCategoryResultDTO.java @@ -0,0 +1,33 @@ +package com.epmet.dataaggre.dto.govproject.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @author sun + * @dscription + */ +@NoArgsConstructor +@Data +public class ProjectCategoryResultDTO implements Serializable { + + private static final long serialVersionUID = 3217246702883400582L; + /** + * 项目ID + */ + private String projectId; + /** + * 项目标题 + */ + private String title; + /** + * 项目状态 + */ + private String status; + /** + * 二级分类Code + */ + private String categoryCode; +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/ProjectCategoryTotalResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/ProjectCategoryTotalResultDTO.java new file mode 100644 index 0000000000..5ae7d12cda --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/ProjectCategoryTotalResultDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dataaggre.dto.govproject.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 赋能平台【项目分类分析】各分类项目数图表-接口返参 + * @Auth sun + */ +@Data +public class ProjectCategoryTotalResultDTO implements Serializable { + private static final long serialVersionUID = 6188316867855643263L; + + //组织Id + private String agencyId; + //一级分类Code + private String categoryCode; + //一级分类名称 + private String categoryName; + //一级分类颜色 + private String color = ""; + //分类下项目总数 + private Integer total = 0; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/ProjectMonthIncrResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/ProjectMonthIncrResultDTO.java new file mode 100644 index 0000000000..037d54f845 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/ProjectMonthIncrResultDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dataaggre.dto.govproject.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 赋能平台【项目处理分析】进12月新增项目折线图-接口返参 + * @Auth sun + */ +@Data +public class ProjectMonthIncrResultDTO implements Serializable { + private static final long serialVersionUID = 6188316867855643263L; + + //横坐标值 + private Integer value = 0; + //横坐标 + private String type; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/ProjectStatusListResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/ProjectStatusListResultDTO.java new file mode 100644 index 0000000000..bf74adac49 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/ProjectStatusListResultDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dataaggre.dto.govproject.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 赋能平台【项目处理分析】事件总数查询-接口返参 + * @Auth sun + */ +@Data +public class ProjectStatusListResultDTO implements Serializable { + private static final long serialVersionUID = 6188316867855643263L; + + //组织Id + private String agencyId; + //项目Id + private String projectId; + //来源:议题issue 项目立项:agency 事件:resi_event + private String origin; + //状态:待处理 pending,结案closed + private String status; + //经度 + private String longitude; + //纬度 + private String latitude; + //项目标题 + private String title; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/ProjectTotalResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/ProjectTotalResultDTO.java new file mode 100644 index 0000000000..9afb3cb712 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/ProjectTotalResultDTO.java @@ -0,0 +1,34 @@ +package com.epmet.dataaggre.dto.govproject.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 赋能平台【项目处理分析】事件总数查询-接口返参 + * @Auth sun + */ +@Data +public class ProjectTotalResultDTO implements Serializable { + private static final long serialVersionUID = 6188316867855643263L; + + //组织Id + private String agencyId; + //日期yyyymmdd + private String dateId; + //项目总数 + private Integer projectTotal = 0; + //较昨日数 + private Integer dateIncr = 0; + //较上月数 + private Integer monthIncr = 0; + //未结案项目数 + private Integer pendingTotal = 0; + //为结案项目占比 xx% + private String pendingRatio = "0%"; + //已结案项目数 + private Integer closedTotal = 0; + //已结案项目占比 + private String closedRatio = "0%"; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/form/UserTopicPageFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/form/UserTopicPageFormDTO.java new file mode 100644 index 0000000000..cfedd6e6d9 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/form/UserTopicPageFormDTO.java @@ -0,0 +1,19 @@ +package com.epmet.dataaggre.dto.resigroup.form; + +import lombok.Data; + +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.List; + +@Data +public class UserTopicPageFormDTO implements Serializable { + public interface AddUserInternalGroup { + } + //@NotBlank(message = "epmetUserId不能为空" , groups = AddUserInternalGroup.class) + private List epmetUserIdList; + @NotNull(message = "pageNo不能为空",groups = AddUserInternalGroup.class) + private Integer pageNo; + @NotNull(message = "pageSize不能为空",groups = AddUserInternalGroup.class) + private Integer pageSize; +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/result/UserTopicResDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/result/UserTopicResDTO.java new file mode 100644 index 0000000000..4d5fd23ca2 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/result/UserTopicResDTO.java @@ -0,0 +1,22 @@ +package com.epmet.dataaggre.dto.resigroup.result; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 个人分析,发布话题分页列表 + */ +@Data +public class UserTopicResDTO implements Serializable { + private String topicId; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date releaseTime; + private String topicContent; + private Boolean shiftIssue; + private String issueId; + private Boolean shiftProject=false; + private String projectId=""; +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/deploy/docker-compose-prod.yml b/epmet-module/data-aggregator/data-aggregator-server/deploy/docker-compose-prod.yml index 2906b958ce..915df72317 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/deploy/docker-compose-prod.yml +++ b/epmet-module/data-aggregator/data-aggregator-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: data-aggregator-server: container_name: data-aggregator-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/data-aggregator-server:0.3.1 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/data-aggregator-server:0.3.78 ports: - "8114:8114" network_mode: host # 使用现有网络 diff --git a/epmet-module/data-aggregator/data-aggregator-server/pom.xml b/epmet-module/data-aggregator/data-aggregator-server/pom.xml index 64f67470f9..06f591c6c0 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/pom.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/pom.xml @@ -2,6 +2,7 @@ + 0.3.78 data-aggregator com.epmet @@ -571,7 +572,7 @@ - false + true true diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/EpmetUserController.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/EpmetUserController.java index ad2d3bebf4..9b9c7a0ef1 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/EpmetUserController.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/EpmetUserController.java @@ -207,6 +207,15 @@ public class EpmetUserController { return new Result().ok(epmetUserService.mentionMeEvent(tokenDto.getUserId())); } + @GetMapping("export/staffpatroll") + public void export(@LoginUser TokenDto tokenDto, @RequestBody StaffListFormDTO formDTO, HttpServletResponse response) throws Exception { + ValidatorUtils.validateEntity(formDTO, StaffListFormDTO.Staff.class); + formDTO.setUserId(tokenDto.getUserId()); + //formDTO.setUserId("73ae6280e46a6653a5605d51d5462725"); + List resultDTOS = epmetUserService.staffPatrolList(formDTO); + ExcelUtils.exportExcelToTarget(response, null, resultDTOS, StaffPatrollExcel.class); + } + /** * @Param formDTO * @Description 通讯录】姓名检索工作人员 @@ -261,14 +270,6 @@ public class EpmetUserController { return new Result().ok(epmetUserService.getStaffInfo(staffId)); } - @GetMapping("export/staffpatroll") - public void export(@LoginUser TokenDto tokenDto, @RequestBody StaffListFormDTO formDTO, HttpServletResponse response) throws Exception { - ValidatorUtils.validateEntity(formDTO, StaffListFormDTO.Staff.class); - formDTO.setUserId(tokenDto.getUserId()); - //formDTO.setUserId("73ae6280e46a6653a5605d51d5462725"); - List resultDTOS = epmetUserService.staffPatrolList(formDTO); - ExcelUtils.exportExcelToTarget(response, null, resultDTOS, StaffPatrollExcel.class); - } /** * @Param formDTO diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovOrgController.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovOrgController.java index 17f939b2c6..14500cc2ab 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovOrgController.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovOrgController.java @@ -9,18 +9,19 @@ import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dataaggre.dto.govorg.CustomerAgencyDTO; +import com.epmet.dataaggre.dto.govorg.CustomerGridDTO; import com.epmet.dataaggre.dto.govorg.form.*; import com.epmet.dataaggre.dto.govorg.result.*; +import com.epmet.dataaggre.entity.govorg.CustomerAgencyEntity; +import com.epmet.dataaggre.entity.govorg.CustomerGridEntity; import com.epmet.dataaggre.enums.GridMemberDataAnalysisEnums; import com.epmet.dataaggre.service.AggreGridService; import com.epmet.dataaggre.service.govorg.GovOrgService; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.CollectionUtils; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import java.util.ArrayList; import java.util.List; @@ -178,4 +179,26 @@ public class GovOrgController { return new Result>().ok(govOrgService.getAgencyTree(tokenDto, formDTO)); } + /** + * @Description 查询组织信息 + * @param agencyId + * @author zxc + * @date 2021/11/5 2:54 下午 + */ + @PostMapping("agency") + public Result getAgencyInfo(@RequestParam("agencyId")String agencyId){ + return new Result().ok(govOrgService.getAgencyInfo(agencyId)); + } + + /** + * @Description 查询网格信息 + * @param gridId + * @author zxc + * @date 2021/11/5 2:54 下午 + */ + @PostMapping("grid") + public Result getGridInfo(@RequestParam("gridId")String gridId){ + return new Result().ok(govOrgService.getGridInfo(gridId)); + } + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovProjectController.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovProjectController.java index 18aa5a924c..422aa74f4c 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovProjectController.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovProjectController.java @@ -6,14 +6,13 @@ 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.dataaggre.dto.govproject.form.AllProjectFormDTO; -import com.epmet.dataaggre.dto.govproject.form.ProjectDistributionFormDTO; -import com.epmet.dataaggre.dto.govproject.result.AllProjectResultDTO; -import com.epmet.dataaggre.dto.govproject.result.ProjectDistributionResultDTO; +import com.epmet.dataaggre.dto.govproject.form.*; +import com.epmet.dataaggre.dto.govproject.result.*; import com.epmet.dataaggre.service.govproject.GovProjectService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import java.util.LinkedList; import java.util.List; /** @@ -56,4 +55,68 @@ public class GovProjectController { ValidatorUtils.validateEntity(formDTO); return new Result>().ok(govProjectService.queryProjectDistribution(formDTO)); } + + /** + * @Description 赋能平台【项目处理分析】事件总数查询 + * @author sun + */ + @PostMapping("projecttotal") + public Result projectTotal(@RequestBody ProjectTotalFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, ProjectTotalFormDTO.Total.class); + return new Result().ok(govProjectService.projectTotal(formDTO)); + } + + /** + * @Description 赋能平台【项目处理分析】进12月新增项目折线图 + * @author sun + */ + @PostMapping("projectmonthincr") + public Result> projectMonthIncr(@RequestBody ProjectTotalFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, ProjectTotalFormDTO.Monthincr.class); + return new Result>().ok(govProjectService.projectMonthIncr(formDTO)); + } + + /** + * @Description 赋能平台【项目处理分析】按状态查询项目列表 + * @author sun + */ + @PostMapping("projectstatuslist") + public Result> projectStatusList(@RequestBody ProjectTotalFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, ProjectTotalFormDTO.Statuslist.class); + return new Result>().ok(govProjectService.projectStatusList(formDTO)); + } + + /** + * @Description 赋能平台【项目分类分析】各分类项目数图表 + * @author sun + */ + @PostMapping("projectcategorylist") + public Result> projectCategoryList(@LoginUser TokenDto tokenDto, @RequestBody ProjectCategoryTotalFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, ProjectCategoryTotalFormDTO.Project.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + return new Result>().ok(govProjectService.projectCategoryList(formDTO)); + } + + /** + * @Description 赋能平台【项目处理分析】分类下项目列表 + * @author sun + */ + @PostMapping("categoryprojectlist") + public Result categoryProjectList(@LoginUser TokenDto tokenDto, @RequestBody CategoryProjectFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, CategoryProjectFormDTO.Category.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + return new Result().ok(govProjectService.categoryProjectList(formDTO)); + } + + /** + * @Description 赋能平台【项目处理分析】研判分析 + * @author sun + */ + @PostMapping("projectanalysis") + public Result projectAnalysis(@LoginUser TokenDto tokenDto, @RequestBody ProjectAnalysisFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, ProjectAnalysisFormDTO.Analysis.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + return new Result().ok(govProjectService.projectAnalysis(formDTO)); + } + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/ResiGroupController.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/ResiGroupController.java index 259b22cff0..8dc1a34527 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/ResiGroupController.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/ResiGroupController.java @@ -1,12 +1,15 @@ package com.epmet.dataaggre.controller; import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.page.PageData; 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.dataaggre.dto.resigroup.form.CandidateListFormDTO; import com.epmet.dataaggre.dto.resigroup.result.CandidateListResultDTO; +import com.epmet.dataaggre.dto.resigroup.result.UserTopicResDTO; import com.epmet.dataaggre.service.resigroup.ResiGroupService; +import com.epmet.dto.form.PageUserReportEventFormDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -39,4 +42,13 @@ public class ResiGroupController { return new Result>().ok(resiGroupService.candidateList(formDTO)); } + /** + * 数字赋能平台-个人分析,发布话题分页列表 + * @return + */ + @PostMapping("pageusertopic") + public Result> pageUserTopic(@RequestBody PageUserReportEventFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, PageUserReportEventFormDTO.AddUserInternalGroup.class); + return new Result>().ok(resiGroupService.pageUserTopic(formDTO)); + } } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java index 8696fa47a3..237432f5c2 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java @@ -24,6 +24,8 @@ import com.epmet.dataaggre.dto.datastats.form.SubGridFormDTO; import com.epmet.dataaggre.dto.datastats.result.*; import com.epmet.dataaggre.dto.epmetuser.form.GridMemberPatrolListFormDTO; import com.epmet.dataaggre.dto.epmetuser.result.GridMemberPatrolListResultDTO; +import com.epmet.dataaggre.dto.govproject.form.ProjectTotalFormDTO; +import com.epmet.dataaggre.dto.govproject.result.ProjectMonthIncrResultDTO; import com.epmet.dataaggre.dto.resigroup.ActCategoryDictDTO; import com.epmet.dataaggre.dto.resigroup.result.GroupActRankDetailDTO; import com.epmet.dataaggre.entity.datastats.DimAgencyEntity; @@ -335,4 +337,16 @@ public interface DataStatsDao { * @author sun */ List projectList(CustomerDataManageFormDTO formDTO); + + /** + * @Description 分别查询组织下dateId、较昨日、较上月项目统计数据 + * @author sun + */ + List getProjectTotal(ProjectTotalFormDTO formDTO); + + /** + * @Description 查询dateId的上一月过去12个月份组织项目数据 + * @author sun + */ + List getProjectMonthIncr(ProjectTotalFormDTO formDTO); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/IcResiUserDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/IcResiUserDao.java new file mode 100644 index 0000000000..1e34921a43 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/IcResiUserDao.java @@ -0,0 +1,49 @@ +/** + * 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.dataaggre.dao.epmetuser; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.dto.govproject.result.ProjectAnalysisResultDTO; +import com.epmet.dataaggre.entity.epmetuser.IcResiUserEntity; +import com.epmet.dto.IcResiUserDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 用户基础信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +@Mapper +public interface IcResiUserDao extends BaseDao { + + /** + * @Description 根据身份证号查询负能平台用户信息 + * @author sun + */ + IcResiUserDTO getIcResiUser(@Param("idCard") String idCard, @Param("customerId") String customerId); + + /** + * @Description 查询人员的家庭成员数据 + * @author sun + */ + List getHomeUserList(@Param("homeId") String homeId, @Param("icUserId") String icUserId); +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/StatsStaffPatrolRecordDailyDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/StatsStaffPatrolRecordDailyDao.java index 11ed072080..8be4c4c34e 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/StatsStaffPatrolRecordDailyDao.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/StatsStaffPatrolRecordDailyDao.java @@ -39,12 +39,12 @@ public interface StatsStaffPatrolRecordDailyDao extends BaseDao getPatrolSumList(@Param("agencyFullIdList") List agencyFullIdList, @Param("startDateId") String startDateId, @Param("endDateId") String endDateId); + List getPatrolSumList(@Param("orgIdList") List orgIdList, @Param("startDateId") String startDateId, @Param("endDateId") String endDateId); /** * @Description 直属组织或网格下巡查数据 diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/UserBaseInfoDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/UserBaseInfoDao.java index 805657fc11..e79c563c0a 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/UserBaseInfoDao.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/UserBaseInfoDao.java @@ -20,6 +20,7 @@ package com.epmet.dataaggre.dao.epmetuser; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dataaggre.dto.epmetuser.result.UserInfosResultDTO; import com.epmet.dataaggre.entity.epmetuser.UserBaseInfoEntity; +import com.epmet.dto.UserBaseInfoDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -50,4 +51,9 @@ public interface UserBaseInfoDao extends BaseDao { */ List selectUserIdByCustomerId(@Param("userIds") List userIds); + /** + * @Description 查询userId的身份证号在小程序用户中存在的多个userId值 + * @author sun + */ + List getUserBaseList(@Param("userId") String userId, @Param("customerId") String customerId); } \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/evaluationindex/EvaluationIndexDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/evaluationindex/EvaluationIndexDao.java index 138ff3d449..5afe394900 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/evaluationindex/EvaluationIndexDao.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/evaluationindex/EvaluationIndexDao.java @@ -21,6 +21,8 @@ import com.epmet.dataaggre.dto.datastats.result.GovrnRatioResultDTO; import com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerAgencyDTO; import com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerGridDTO; import com.epmet.dataaggre.dto.evaluationindex.ScreenGovernRankDataDailyDTO; +import com.epmet.dataaggre.dto.govproject.form.ProjectCategoryTotalFormDTO; +import com.epmet.dataaggre.dto.govproject.result.ProjectCategoryTotalResultDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -103,4 +105,10 @@ public interface EvaluationIndexDao { */ String selectAgencyNameByAgencyId(@Param("agencyId")String agencyId); + /** + * @Description 按dateId查询组织下一级分类项目总数统计 + * @author sun + */ + List projectCategoryList(ProjectCategoryTotalFormDTO formDTO); + } \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govissue/IssueDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govissue/IssueDao.java index 1e85e06366..17d16fd72d 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govissue/IssueDao.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govissue/IssueDao.java @@ -18,6 +18,7 @@ package com.epmet.dataaggre.dao.govissue; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.dto.govissue.IssueProjectCategoryDictDTO; import com.epmet.dataaggre.dto.govissue.form.ClosedIssueListFormDTO; import com.epmet.dataaggre.dto.govissue.form.ShiftProjectIssueListFormDTO; import com.epmet.dataaggre.dto.govissue.form.VotingIssueListFormDTO; @@ -74,4 +75,10 @@ public interface IssueDao extends BaseDao { Integer selectIssueCount(@Param("gridIds") List gridIds,@Param("issueType")String issueType); List selectShiftProjectIssueList(@Param("customerId") String customerId, @Param("gridId") String gridId); + + /** + * @Description 查询客户下分类信息 + * @author sun + **/ + List getCategoryList(@Param("customerId") String customerId, @Param("level") String level, @Param("isDisable") String isDisable); } \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerAgencyDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerAgencyDao.java index bd29030255..3ecfd18a2d 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerAgencyDao.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerAgencyDao.java @@ -24,6 +24,7 @@ import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; +import java.util.Set; /** * 机关单位信息表 @@ -98,4 +99,5 @@ public interface CustomerAgencyDao extends BaseDao { * @Date 2021/9/23 10:16 */ List getOrgList(@Param("staffId") String staffId); + } 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 56d07daafb..4ee22247f2 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 @@ -76,4 +76,12 @@ public interface CustomerGridDao extends BaseDao { **/ List getGridListByAgencyId(@Param("agencyId") String agencyId); + /** + * @Description 查询网格信息 + * @param gridId + * @author zxc + * @date 2021/11/5 3:39 下午 + */ + CustomerGridDTO getGridInfo(@Param("gridId") String gridId); + } \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govproject/ProjectDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govproject/ProjectDao.java index 4697a0f267..ee44c3cee8 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govproject/ProjectDao.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govproject/ProjectDao.java @@ -20,10 +20,14 @@ package com.epmet.dataaggre.dao.govproject; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dataaggre.dto.govissue.result.IssueListResultDTO; import com.epmet.dataaggre.dto.govproject.ProjectDTO; +import com.epmet.dataaggre.dto.govproject.ProjectRelatedPersonnelDTO; +import com.epmet.dataaggre.dto.govproject.ResiEventDTO; import com.epmet.dataaggre.dto.govproject.form.AllProjectFormDTO; -import com.epmet.dataaggre.dto.govproject.result.ProjectDistributionResultDTO; -import com.epmet.dataaggre.dto.govproject.result.ProjectInfoDTO; +import com.epmet.dataaggre.dto.govproject.form.CategoryProjectFormDTO; +import com.epmet.dataaggre.dto.govproject.form.ProjectTotalFormDTO; +import com.epmet.dataaggre.dto.govproject.result.*; import com.epmet.dataaggre.entity.govproject.ProjectEntity; +import com.epmet.dto.ProjectCategoryDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -70,4 +74,45 @@ public interface ProjectDao extends BaseDao { List selectList(@Param("customerId") String customerId,@Param("list")List issueIds); int countRedDot(String userId); + + /** + * @Description 查询组织下截止到dateId的某个状态的项目列表 + * @author sun + */ + List getProjectStatusList(ProjectTotalFormDTO formDTO); + + List selectProjectIssueCategory(@Param("issueIds") List issueIds); + + /** + * @Description 查询组织截止某一天的某个分类下的项目列表 + * @author sun + */ + List categoryProjectList(CategoryProjectFormDTO formDTO); + + /** + * @Description 查询项目对应的所有分类信息 + * @author sun + */ + List getCategoryList(@Param("projectIds") List projectIds); + + /** + * @Description 查询来源事件的项目居民端创建人信息 + * @author sun + */ + List getEventList(@Param("projectIds") List projectIds); + /** + * @Description 查询来源话题的项目居民端创建人信息 + * @author sun + */ + List getTopicUser(@Param("projectIds") List projectIds); + + /** + * @Description 根据项目来源查询不同分类不同创建人下的分类项目 + * @author sun + */ + List getProjectCategoryList(@Param("customerId") String customerId, + @Param("secondCodeList") List secondCodeList, + @Param("userIds") List userIds, + @Param("origin") String origin); + } \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/opercustomize/CustomerFootBarDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/opercustomize/CustomerFootBarDao.java index 7d5d11dda7..4d5ab737b5 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/opercustomize/CustomerFootBarDao.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/opercustomize/CustomerFootBarDao.java @@ -19,11 +19,13 @@ package com.epmet.dataaggre.dao.opercustomize; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dataaggre.dto.app.result.CustomerFootBarDTO; +import com.epmet.dataaggre.dto.epmetuser.IcFormResColumnDTO; import com.epmet.dataaggre.entity.opercustomize.CustomerFootBarEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; +import java.util.Set; /** * APP底部菜单栏信息 @@ -56,4 +58,5 @@ public interface CustomerFootBarDao extends BaseDao { * @date 2021/7/28 10:56 */ CustomerFootBarEntity selectDefaultIcon(@Param("customerId") String customerId, @Param("appType")String appType, @Param("barKey")String barKey); + } \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/ResiTopicDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/ResiTopicDao.java index cd57936e2f..c41c85d0de 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/ResiTopicDao.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/ResiTopicDao.java @@ -19,7 +19,9 @@ package com.epmet.dataaggre.dao.resigroup; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dataaggre.dto.resigroup.ResiTopicDTO; +import com.epmet.dataaggre.dto.resigroup.result.UserTopicResDTO; import com.epmet.dataaggre.entity.resigroup.ResiTopicEntity; +import com.epmet.dto.form.PageUserReportEventFormDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -35,4 +37,12 @@ import java.util.List; public interface ResiTopicDao extends BaseDao { List selectTopicInfoByIds(@Param("list") List topicIds); + + /** + * 数据分析-个人档案-发布话题列表 + * + * @param formDTO + * @return + */ + List selectListTopic(PageUserReportEventFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/datastats/FactAgencyGovernDailyEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/datastats/FactAgencyGovernDailyEntity.java index d709731f77..77bcd7cc34 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/datastats/FactAgencyGovernDailyEntity.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/datastats/FactAgencyGovernDailyEntity.java @@ -151,6 +151,15 @@ public class FactAgencyGovernDailyEntity extends BaseEpmetEntity { */ private Integer inGroupTopicUnResolvedCount; + /** + * 11、当前组织内:来源于事件的项目:结案已解决数 + */ + private Integer eventResolvedCount; + /** + * 12、当前组织内:来源于事件的项目:结案无需解决数 + */ + private Integer eventUnResolvedCount; + /** * 未出当前网格的,结案项目数 */ @@ -171,4 +180,5 @@ public class FactAgencyGovernDailyEntity extends BaseEpmetEntity { */ private Integer districtDeptClosedCount; + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/IcResiUserEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/IcResiUserEntity.java new file mode 100644 index 0000000000..e40441101d --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/IcResiUserEntity.java @@ -0,0 +1,493 @@ +/** + * 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.dataaggre.entity.epmetuser; + +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 2021-10-26 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_resi_user") +public class IcResiUserEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id customer.id + */ + private String customerId; + + /** + * + */ + private String agencyId; + + /** + * + */ + private String pids; + + /** + * 网格ID + */ + private String gridId; + + /** + * 所属小区ID + */ + private String villageId; + + /** + * 所属楼宇Id + */ + private String buildId; + + /** + * 单元id + */ + private String unitId; + + /** + * 所属家庭Id + */ + private String homeId; + + /** + * 是否本地户籍 + */ + private String isBdhj; + + /** + * 姓名 + */ + private String name; + + /** + * 手机号 + */ + private String mobile; + + /** + * 性别 + */ + private String gender; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 出生日期 + */ + private String birthday; + + /** + * 备注 + */ + private String remarks; + + /** + * 联系人 + */ + private String contacts; + + /** + * 联系人电话 + */ + private String contactsMobile; + + /** + * 九小场所url + */ + private String ninePlace; + + /** + * 是否党员 + */ + private String isParty; + + /** + * 是否低保户 + */ + private String isDbh; + + /** + * 是否保障房 + */ + private String isEnsureHouse; + + /** + * 是否失业 + */ + private String isUnemployed; + + /** + * 是否育龄妇女 + */ + private String isYlfn; + + /** + * 是否退役军人 + */ + private String isVeterans; + + /** + * 是否统战人员 + */ + private String isUnitedFront; + + /** + * 是否信访人员 + */ + private String isXfry; + + /** + * 是否志愿者 + */ + private String isVolunteer; + + /** + * 是否老年人 + */ + private String isOldPeople; + + /** + * 是否空巢 + */ + private String isKc; + + /** + * 是否失独 + */ + private String isSd; + + /** + * 是否失能 + */ + private String isSn; + + /** + * 是否失智 + */ + private String isSz; + + /** + * 是否残疾 + */ + private String isCj; + + /** + * 是否大病 + */ + private String isDb; + + /** + * 是否慢病 + */ + private String isMb; + + /** + * 是否特殊人群 + */ + private String isSpecial; + + /** + * 文化程度【字典表】 + */ + private String culture; + + /** + * 文化程度备注 + */ + private String cultureRemakes; + + /** + * 特长【字典表】 + */ + private String specialSkill; + + /** + * 兴趣爱好 + */ + private String hobby; + + /** + * 兴趣爱好备注 + */ + private String hobbyRemakes; + + /** + * 宗教信仰 + */ + private String faith; + + /** + * 宗教信仰备注 + */ + private String faithRemakes; + + /** + * 残疾类别【字典表】 + */ + private String cjlb; + + /** + * 残疾登记(状况)【字典表】 + */ + private String cjzk; + + /** + * 残疾证号 + */ + private String cjzh; + + /** + * 残疾说明 + */ + private String cjsm; + + /** + * 有无监护人【yes no】 + */ + private String ynJdr; + + /** + * 有无技能特长【yes no】 + */ + private String ynJntc; + + /** + * 有无劳动能力 + */ + private String ynLdnl; + + /** + * 有无非义务教育阶段助学【yes no】 + */ + private String ynFywjyjdzx; + + /** + * 所患大病 + */ + private String shdb; + + /** + * 患大病时间 + */ + private String dbsj; + + /** + * 所患慢性病 + */ + private String shmxb; + + /** + * 患慢性病时间 + */ + private String mxbsj; + + /** + * 是否参保 + */ + private String isCb; + + /** + * 自付金额 + */ + private String zfje; + + /** + * 救助金额 + */ + private String jzje; + + /** + * 救助时间[yyyy-MM-dd] + */ + private String jzsj; + + /** + * 享受救助明细序号 + */ + private String jzmxxh; + + /** + * 健康信息备注 + */ + private String healthRemakes; + + /** + * 工作单位 + */ + private String gzdw; + + /** + * 职业 + */ + private String zy; + + /** + * 离退休时间 + */ + private String ltxsj; + + /** + * 工作信息备注 + */ + private String workRemake; + + /** + * 退休金额 + */ + private String txje; + + /** + * 月收入 + */ + private String ysr; + + /** + * 籍贯 + */ + private String jg; + + /** + * 户籍所在地 + */ + private String hjszd; + + /** + * 现居住地 + */ + private String xjzd; + + /** + * 人户情况 + */ + private String rhzk; + + /** + * 居住信息备注 + */ + private String jzxxRemakes; + + /** + * 民族【字典表】 + */ + private String mz; + + /** + * 与户主关系【字典表】 + */ + private String yhzgx; + + /** + * 居住情况【字典表】 + */ + private String jzqk; + + /** + * 婚姻状况【字典表】 + */ + private String hyzk; + + /** + * 配偶情况【字典表】 + */ + private String poqk; + + /** + * 有无赡养人 + */ + private String ynSyr; + + /** + * 与赡养人关系【字典表】 + */ + private String ysyrgx; + + /** + * 赡养人电话 + */ + private String syrMobile; + + /** + * 家庭信息备注 + */ + private String jtxxRemakes; + + /** + * 预留字段1 + */ + private String field1; + + /** + * 预留字段2 + */ + private String field2; + + /** + * 预留字段3 + */ + private String field3; + + /** + * 预留字段4 + */ + private String field4; + + /** + * 预留字段5 + */ + private String field5; + + /** + * 预留字段6 + */ + private String field6; + + /** + * 预留字段7 + */ + private String field7; + + /** + * 预留字段8 + */ + private String field8; + + /** + * 预留字段9 + */ + private String field9; + + /** + * 预留字段10 + */ + private String field10; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/StaffPatrolRecordEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/StaffPatrolRecordEntity.java index f15187a712..0ad2407f74 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/StaffPatrolRecordEntity.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/StaffPatrolRecordEntity.java @@ -88,4 +88,9 @@ public class StaffPatrolRecordEntity extends BaseEpmetEntity { */ private String status; + /** + * 是否手动结束 手动:1,定时任务传参:0 + */ + private Integer isHandEnd; + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java index 36fa24c7b2..de584839e2 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java @@ -6,6 +6,8 @@ import com.epmet.dataaggre.dto.datastats.result.*; import com.epmet.dataaggre.dto.epmetuser.form.GridMemberPatrolListFormDTO; import com.epmet.dataaggre.dto.epmetuser.result.GridMemberPatrolListResultDTO; import com.epmet.dataaggre.dto.govorg.result.GridMemberDataAnalysisResultDTO; +import com.epmet.dataaggre.dto.govproject.form.ProjectTotalFormDTO; +import com.epmet.dataaggre.dto.govproject.result.ProjectMonthIncrResultDTO; import com.epmet.dataaggre.dto.resigroup.ActCategoryDictDTO; import com.epmet.dataaggre.dto.resigroup.result.GroupActRankDetailDTO; @@ -247,4 +249,15 @@ public interface DataStatsService { */ CustomerDataManageResultDTO operateExport(CustomerDataManageFormDTO formDTO) throws ParseException; + /** + * @Description 分别查询组织下dateId、较昨日、较上月项目统计数据 + * @author sun + */ + List getProjectTotal(ProjectTotalFormDTO formDTO); + + /** + * @Description 查询dateId的上一月过去12个月份组织项目数据 + * @author sun + */ + List getProjectMonthIncr(ProjectTotalFormDTO formDTO); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java index b175478e6e..ac426b81d7 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java @@ -1,54 +1,56 @@ package com.epmet.dataaggre.service.datastats.impl; import com.alibaba.fastjson.JSON; - import com.epmet.commons.dynamic.datasource.annotation.DataSource; - import com.epmet.commons.tools.constant.NumConstant; - import com.epmet.commons.tools.constant.StrConstant; - import com.epmet.commons.tools.enums.OrgLevelEnum; - import com.epmet.commons.tools.exception.RenException; - import com.epmet.commons.tools.utils.DateUtils; - import com.epmet.commons.tools.utils.ExcelUtils; - import com.epmet.dataaggre.constant.DataSourceConstant; - import com.epmet.dataaggre.constant.OrgConstant; - import com.epmet.dataaggre.dao.datastats.DataStatsDao; - import com.epmet.dataaggre.dao.datastats.FactGridMemberStatisticsDailyDao; - import com.epmet.dataaggre.dto.datastats.FactGroupActDailyDTO; - import com.epmet.dataaggre.dto.datastats.form.*; - import com.epmet.dataaggre.dto.datastats.result.*; - import com.epmet.dataaggre.dto.epmetuser.form.GridMemberPatrolListFormDTO; - import com.epmet.dataaggre.dto.epmetuser.result.GridMemberPatrolListResultDTO; - import com.epmet.dataaggre.dto.epmetuser.result.PatrolDailySumResult; - import com.epmet.dataaggre.dto.evaluationindex.ScreenAgencyOrGridListDTO; - import com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerAgencyDTO; - import com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerGridDTO; - import com.epmet.dataaggre.dto.evaluationindex.ScreenGovernRankDataDailyDTO; - import com.epmet.dataaggre.dto.govorg.result.GridMemberDataAnalysisResultDTO; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.enums.OrgLevelEnum; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.dataaggre.constant.DataSourceConstant; +import com.epmet.dataaggre.constant.OrgConstant; +import com.epmet.dataaggre.dao.datastats.DataStatsDao; +import com.epmet.dataaggre.dao.datastats.FactGridMemberStatisticsDailyDao; +import com.epmet.dataaggre.dto.datastats.FactGroupActDailyDTO; +import com.epmet.dataaggre.dto.datastats.form.*; +import com.epmet.dataaggre.dto.datastats.result.*; +import com.epmet.dataaggre.dto.epmetuser.form.GridMemberPatrolListFormDTO; +import com.epmet.dataaggre.dto.epmetuser.result.GridMemberPatrolListResultDTO; +import com.epmet.dataaggre.dto.epmetuser.result.PatrolDailySumResult; +import com.epmet.dataaggre.dto.evaluationindex.ScreenAgencyOrGridListDTO; +import com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerAgencyDTO; +import com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerGridDTO; +import com.epmet.dataaggre.dto.evaluationindex.ScreenGovernRankDataDailyDTO; +import com.epmet.dataaggre.dto.govorg.result.GridMemberDataAnalysisResultDTO; + import com.epmet.dataaggre.dto.govproject.form.ProjectTotalFormDTO; + import com.epmet.dataaggre.dto.govproject.result.ProjectMonthIncrResultDTO; import com.epmet.dataaggre.dto.resigroup.ActCategoryDictDTO; - import com.epmet.dataaggre.dto.resigroup.result.GroupActRankDetailDTO; - import com.epmet.dataaggre.entity.datastats.DimAgencyEntity; - import com.epmet.dataaggre.entity.datastats.FactAgencyGovernDailyEntity; - import com.epmet.dataaggre.excel.CustomerDataManageExcel; - import com.epmet.dataaggre.service.datastats.DataStatsService; - import com.epmet.dataaggre.service.epmetuser.StatsStaffPatrolRecordDailyService; - import com.epmet.dataaggre.service.evaluationindex.EvaluationIndexService; - import com.epmet.dataaggre.service.opercrm.CustomerRelation; - import com.github.pagehelper.PageHelper; - import lombok.extern.slf4j.Slf4j; - import org.apache.commons.collections4.CollectionUtils; - import org.apache.commons.lang3.StringUtils; - import org.springframework.beans.factory.annotation.Autowired; - import org.springframework.stereotype.Service; - - import javax.servlet.http.HttpServletResponse; - import java.math.BigDecimal; - import java.math.RoundingMode; - import java.text.NumberFormat; - import java.text.ParseException; - import java.text.SimpleDateFormat; - import java.util.*; - import java.util.concurrent.atomic.AtomicInteger; - import java.util.concurrent.atomic.AtomicReference; - import java.util.stream.Collectors; +import com.epmet.dataaggre.dto.resigroup.result.GroupActRankDetailDTO; +import com.epmet.dataaggre.entity.datastats.DimAgencyEntity; +import com.epmet.dataaggre.entity.datastats.FactAgencyGovernDailyEntity; +import com.epmet.dataaggre.excel.CustomerDataManageExcel; +import com.epmet.dataaggre.service.datastats.DataStatsService; +import com.epmet.dataaggre.service.epmetuser.StatsStaffPatrolRecordDailyService; +import com.epmet.dataaggre.service.evaluationindex.EvaluationIndexService; +import com.epmet.dataaggre.service.opercrm.CustomerRelation; +import com.github.pagehelper.PageHelper; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import javax.servlet.http.HttpServletResponse; +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.text.NumberFormat; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.*; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicReference; +import java.util.stream.Collectors; /** * @Author sun @@ -1186,13 +1188,20 @@ public class DataStatsServiceImpl implements DataStatsService { Integer streetClosedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity::getStreetClosedCount).sum(); //由区直部门结案的项目总数 Integer districtDeptClosedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity::getDistrictDeptClosedCount).sum(); - - resultDTO.setProblemResolvedCount(problemResolvedCount); + Integer issueResolvedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity::getIssueProjectResolvedCount).sum(); + Integer issueUnResolvedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity::getIssueProjectUnResolvedCount).sum(); + Integer projectResolvedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity::getApprovalProjectResolvedCount).sum(); + Integer projectUnResolvedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity::getApprovalProjectUnResolvedCount).sum(); + Integer eventResolvedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity::getEventResolvedCount).sum(); + Integer eventUnResolvedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity::getEventUnResolvedCount).sum(); + Integer closedProjectTotal = issueResolvedCount + issueUnResolvedCount+projectResolvedCount + + projectUnResolvedCount + eventResolvedCount + eventUnResolvedCount; + resultDTO.setProblemResolvedCount(closedProjectTotal); resultDTO.setGroupSelfGovernRatio(getPercentage(inGroupTopicResolvedCount + inGroupTopicUnResolvedCount, problemResolvedCount)); - resultDTO.setGridSelfGovernRatio(getPercentage(gridSelfGovernProjectTotal, problemResolvedCount)); - resultDTO.setCommunityResolvedRatio(getPercentage(communityClosedCount, problemResolvedCount)); - resultDTO.setStreetResolvedRatio(getPercentage(streetClosedCount, problemResolvedCount)); - resultDTO.setDistrictDeptResolvedRatio(getPercentage(districtDeptClosedCount, problemResolvedCount)); + resultDTO.setGridSelfGovernRatio(getPercentage(gridSelfGovernProjectTotal, closedProjectTotal)); + resultDTO.setCommunityResolvedRatio(getPercentage(communityClosedCount, closedProjectTotal)); + resultDTO.setStreetResolvedRatio(getPercentage(streetClosedCount, closedProjectTotal)); + resultDTO.setDistrictDeptResolvedRatio(getPercentage(districtDeptClosedCount, closedProjectTotal)); return resultDTO; } @@ -1231,35 +1240,28 @@ public class DataStatsServiceImpl implements DataStatsService { } //1.查询当前组织的直属下级组织信息【机关维度】 - List subAgencyList = dataStatsDao.getSubAgencyList(formDTO.getAgencyId()); + List subAgencyList = indexService.getSubAgencyList(formDTO.getAgencyId(), null); if (subAgencyList.size() < NumConstant.ONE) { return resultList; } - List agencyIds = subAgencyList.stream().map(DimAgencyEntity::getId).collect(Collectors.toList()); + List agencyIds = subAgencyList.stream().map(ScreenCustomerAgencyDTO::getAgencyId).collect(Collectors.toList()); ScreenCustomerAgencyDTO agencyDTO = indexService.getAgencyInfo(formDTO.getAgencyId()); if (CollectionUtils.isNotEmpty(customerRelation.haveSubCustomer(agencyDTO.getCustomerId()))) { - List subAgencies = indexService.getSubAgencyList(formDTO.getAgencyId(), agencyDTO.getAreaCode()); - agencyIds = subAgencies.stream().map(ScreenCustomerAgencyDTO::getAgencyId).collect(Collectors.toList()); - subAgencyList = subAgencies.stream().map(item -> { - DimAgencyEntity entity = new DimAgencyEntity(); - entity.setId(item.getAgencyId()); - entity.setAgencyName(item.getAgencyName()); - entity.setLevel(item.getLevel()); - return entity; - }).collect(Collectors.toList()); + subAgencyList = indexService.getSubAgencyList(formDTO.getAgencyId(), agencyDTO.getAreaCode()); + agencyIds = subAgencyList.stream().map(ScreenCustomerAgencyDTO::getAgencyId).collect(Collectors.toList()); } //2.按日期查询所有下级组织的事件治理指数 List list = dataStatsDao.getAgencyGovern(agencyIds, formDTO.getDateId()); //3.封装数据 - for (DimAgencyEntity sub : subAgencyList) { + for (ScreenCustomerAgencyDTO sub : subAgencyList) { AgencyGovrnResultDTO dto = new AgencyGovrnResultDTO(); - dto.setAgencyId(sub.getId()); + dto.setAgencyId(sub.getAgencyId()); dto.setAgencyName(sub.getAgencyName()); dto.setLevel(sub.getLevel()); for (AgencyGovrnResultDTO re : list) { - if (sub.getId().equals(re.getAgencyId())) { + if (sub.getAgencyId().equals(re.getAgencyId())) { dto.setProblemResolvedCount(re.getProblemResolvedCount()); dto.setGroupSelfGovernRatio(re.getGroupSelfGovernRatio()); dto.setGridSelfGovernRatio(re.getGridSelfGovernRatio()); @@ -1545,24 +1547,24 @@ public class DataStatsServiceImpl implements DataStatsService { return null; } List gridIdList = subAgencyList.stream().map(ScreenCustomerGridDTO::getGridId).collect(Collectors.toList()); - //查询组织的话题转议题数据 + //查询网格议题数据 List toIssueStart = dataStatsDao.getSubGridTopicShiftIssue(gridIdList, breforeStartDate); List toIssueEnd = dataStatsDao.getSubGridTopicShiftIssue(gridIdList, formDTO.getEndDateId()); Map toIssueStartMap = toIssueStart.stream().collect(Collectors.toMap(SubGridFormDTO.Topic::getGridId, SubGridFormDTO.Topic::getShiftedIssueTotal, (o1, o2) -> o1)); Map toIssueEndMap = toIssueEnd.stream().collect(Collectors.toMap(SubGridFormDTO.Topic::getGridId, SubGridFormDTO.Topic::getShiftedIssueTotal, (o1, o2) -> o1)); - //查询组织的议题转项目数据 - List toProjectStart = dataStatsDao.getSubGridIssue(gridIdList, breforeStartDate); - List toProjectEnd = dataStatsDao.getSubGridIssue(gridIdList, formDTO.getEndDateId()); - Map toProjectStartMap = toProjectStart.stream().collect(Collectors.toMap(SubGridIssueResultDTO::getGridId, SubGridIssueResultDTO::getShiftProjectTotal, (o1, o2) -> o1)); - Map toProjectEndMap = toProjectEnd.stream().collect(Collectors.toMap(SubGridIssueResultDTO::getGridId, SubGridIssueResultDTO::getShiftProjectTotal, (o1, o2) -> o1)); + //查询网格项目数据 + List toProjectStart = dataStatsDao.getSubGridProject(gridIdList, breforeStartDate); + List toProjectEnd = dataStatsDao.getSubGridProject(gridIdList, formDTO.getEndDateId()); + Map toProjectStartMap = toProjectStart.stream().collect(Collectors.toMap(SubGridProjectResultDTO::getGridId, SubGridProjectResultDTO::getProjectTotal, (o1, o2) -> o1)); + Map toProjectEndMap = toProjectEnd.stream().collect(Collectors.toMap(SubGridProjectResultDTO::getGridId, SubGridProjectResultDTO::getProjectTotal, (o1, o2) -> o1)); //查询组织已关闭的项目数据 - List closeProjectStart = dataStatsDao.getSubGridProject(gridIdList, breforeStartDate); - List closeProjectEnd = dataStatsDao.getSubGridProject(gridIdList, formDTO.getEndDateId()); - Map closeProjectStartMap = closeProjectStart.stream().collect(Collectors.toMap(SubGridProjectResultDTO::getGridId, SubGridProjectResultDTO::getClosedProjectTotal, (o1, o2) -> o1)); - Map closeProjectEndMap = closeProjectEnd.stream().collect(Collectors.toMap(SubGridProjectResultDTO::getGridId, SubGridProjectResultDTO::getClosedProjectTotal, (o1, o2) -> o1)); + //List closeProjectStart = dataStatsDao.getSubGridProject(gridIdList, breforeStartDate); + //List closeProjectEnd = dataStatsDao.getSubGridProject(gridIdList, formDTO.getEndDateId()); + Map closeProjectStartMap = toProjectStart.stream().collect(Collectors.toMap(SubGridProjectResultDTO::getGridId, SubGridProjectResultDTO::getClosedProjectTotal, (o1, o2) -> o1)); + Map closeProjectEndMap = toProjectEnd.stream().collect(Collectors.toMap(SubGridProjectResultDTO::getGridId, SubGridProjectResultDTO::getClosedProjectTotal, (o1, o2) -> o1)); //巡查次数和时间 List patrolList = statsStaffPatrolRecordDailyService.getPatrolSumList(gridIdList,formDTO.getStartDateId(),formDTO.getEndDateId()); - Map patrolListMap = patrolList.stream().collect(Collectors.toMap(PatrolDailySumResult::getFullAgencyId, o -> o, (o1, o2) -> o1)); + Map patrolListMap = patrolList.stream().collect(Collectors.toMap(PatrolDailySumResult::getOrgId, o -> o, (o1, o2) -> o1)); subAgencyList.forEach(agency->{ String gridId = agency.getGridId(); @@ -1573,7 +1575,7 @@ public class DataStatsServiceImpl implements DataStatsService { resultDTO.setIssueToProjectTotal(getTotal(toProjectStartMap,toProjectEndMap,gridId)); resultDTO.setClosedProjectTotal(getTotal(closeProjectStartMap,closeProjectEndMap,gridId)); - PatrolDailySumResult patrolRecordDTO = patrolListMap.get(agency.getAllParentIds()); + PatrolDailySumResult patrolRecordDTO = patrolListMap.get(gridId); setPatrolAttr(resultDTO, patrolRecordDTO); result.add(resultDTO); }); @@ -1585,25 +1587,24 @@ public class DataStatsServiceImpl implements DataStatsService { } List agencyList = subAgencyList.stream().map(ScreenCustomerAgencyDTO::getAgencyId).collect(Collectors.toList()); - //查询组织的话题转议题数据 + //查询组织的议题数据 List toIssueStart = dataStatsDao.getSubAgencyTopicShiftIssue(agencyList, breforeStartDate); List toIssueEnd = dataStatsDao.getSubAgencyTopicShiftIssue(agencyList, formDTO.getEndDateId()); Map toIssueStartMap = toIssueStart.stream().collect(Collectors.toMap(SubAgencyFormDTO.Topic::getAgencyId, SubAgencyFormDTO.Topic::getShiftedIssueTotal, (o1, o2) -> o1)); Map toIssueEndMap = toIssueEnd.stream().collect(Collectors.toMap(SubAgencyFormDTO.Topic::getAgencyId, SubAgencyFormDTO.Topic::getShiftedIssueTotal, (o1, o2) -> o1)); - //查询组织的议题转项目数据 - List toProjectStart = dataStatsDao.getSubAgencyIssue(agencyList, breforeStartDate); - List toProjectEnd = dataStatsDao.getSubAgencyIssue(agencyList, formDTO.getEndDateId()); - Map toProjectStartMap = toProjectStart.stream().collect(Collectors.toMap(SubAgencyIssueResultDTO::getAgencyId, SubAgencyIssueResultDTO::getShiftProjectTotal, (o1, o2) -> o1)); - Map toProjectEndMap = toProjectEnd.stream().collect(Collectors.toMap(SubAgencyIssueResultDTO::getAgencyId, SubAgencyIssueResultDTO::getShiftProjectTotal, (o1, o2) -> o1)); + //查询组织的项目数据 + List toProjectStart = dataStatsDao.getSubAgencyProject(agencyList, breforeStartDate); + List toProjectEnd = dataStatsDao.getSubAgencyProject(agencyList, formDTO.getEndDateId()); + Map toProjectStartMap = toProjectStart.stream().collect(Collectors.toMap(SubAgencyProjectResultDTO::getAgencyId, SubAgencyProjectResultDTO::getProjectTotal, (o1, o2) -> o1)); + Map toProjectEndMap = toProjectEnd.stream().collect(Collectors.toMap(SubAgencyProjectResultDTO::getAgencyId, SubAgencyProjectResultDTO::getProjectTotal, (o1, o2) -> o1)); //查询组织已关闭的项目数据 - List closeProjectStart = dataStatsDao.getSubAgencyProject(agencyList, breforeStartDate); - List closeProjectEnd = dataStatsDao.getSubAgencyProject(agencyList, formDTO.getEndDateId()); - Map closeProjectStartMap = closeProjectStart.stream().collect(Collectors.toMap(SubAgencyProjectResultDTO::getAgencyId, SubAgencyProjectResultDTO::getClosedProjectTotal, (o1, o2) -> o1)); - Map closeProjectEndMap = closeProjectEnd.stream().collect(Collectors.toMap(SubAgencyProjectResultDTO::getAgencyId, SubAgencyProjectResultDTO::getClosedProjectTotal, (o1, o2) -> o1)); + //List closeProjectStart = dataStatsDao.getSubAgencyProject(agencyList, breforeStartDate); + //List closeProjectEnd = dataStatsDao.getSubAgencyProject(agencyList, formDTO.getEndDateId()); + Map closeProjectStartMap = toProjectStart.stream().collect(Collectors.toMap(SubAgencyProjectResultDTO::getAgencyId, SubAgencyProjectResultDTO::getClosedProjectTotal, (o1, o2) -> o1)); + Map closeProjectEndMap = toProjectEnd.stream().collect(Collectors.toMap(SubAgencyProjectResultDTO::getAgencyId, SubAgencyProjectResultDTO::getClosedProjectTotal, (o1, o2) -> o1)); //巡查次数和时间 - List agencyFullIds = subAgencyList.stream().map(o -> o.getPids().concat(StrConstant.COLON).concat(o.getAgencyId())).collect(Collectors.toList()); - List patrolList = statsStaffPatrolRecordDailyService.getPatrolSumList(agencyFullIds,breforeStartDate,formDTO.getEndDateId()); - Map patrolListMap = patrolList.stream().collect(Collectors.toMap(PatrolDailySumResult::getFullAgencyId, o -> o, (o1, o2) -> o1)); + List patrolList = statsStaffPatrolRecordDailyService.getPatrolSumList(agencyList,formDTO.getStartDateId(),formDTO.getEndDateId()); + Map patrolListMap = patrolList.stream().collect(Collectors.toMap(PatrolDailySumResult::getOrgId, o -> o, (o1, o2) -> o1)); subAgencyList.forEach(agency->{ String agencyId = agency.getAgencyId(); @@ -1613,8 +1614,7 @@ public class DataStatsServiceImpl implements DataStatsService { resultDTO.setTopicToIssueTotal(getTotal(toIssueStartMap,toIssueEndMap,agencyId)); resultDTO.setIssueToProjectTotal(getTotal(toProjectStartMap,toProjectEndMap,agencyId)); resultDTO.setClosedProjectTotal(getTotal(closeProjectStartMap,closeProjectEndMap,agencyId)); - String fullAgencyId = agency.getPids().concat(StrConstant.COLON).concat(agencyId); - PatrolDailySumResult patrolRecordDTO = patrolListMap.get(fullAgencyId); + PatrolDailySumResult patrolRecordDTO = patrolListMap.get(agencyId); setPatrolAttr(resultDTO,patrolRecordDTO); result.add(resultDTO); }); @@ -1951,13 +1951,14 @@ public class DataStatsServiceImpl implements DataStatsService { CustomerDataManageResultDTO resultDTO = new CustomerDataManageResultDTO(); List dataManageList = new ArrayList<>(); //1.必要参数校验及处理 - if ("Interval".equals(formDTO.getType()) && StringUtils.isEmpty(formDTO.getStartTime())) { + String startTimeForm = formDTO.getStartTime(); + if ("Interval".equals(formDTO.getType()) && StringUtils.isEmpty(startTimeForm)) { throw new RenException("请选择开始时间或查询累计值"); } //入参有开始时间的则需要减去一天 - if (StringUtils.isNotBlank(formDTO.getStartTime())) { + if (StringUtils.isNotBlank(startTimeForm)) { SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); - Date date = format.parse(formDTO.getStartTime()); + Date date = format.parse(startTimeForm); Date yesterday = DateUtils.addDateDays(date, -1); formDTO.setStartTime(format.format(yesterday)); } @@ -1990,8 +1991,10 @@ public class DataStatsServiceImpl implements DataStatsService { List projectEnd = dataStatsDao.projectList(formDTO); HashMap pEndMap = new HashMap<>(); projectEnd.stream().forEach(u->pEndMap.put(u.getOrgId(),u)); - //巡查数据不区分区间差值,只计算累计值,人员做去重处理且是有巡查记录的人员 - List patrolEnd = statsStaffPatrolRecordDailyService.patrolList(formDTO); + //巡查数据不区分区间差值,只计算累计值,人员做去重处理且是有巡查记录的人员 == + CustomerDataManageFormDTO patrolForm = ConvertUtils.sourceToTarget(formDTO,CustomerDataManageFormDTO.class); + patrolForm.setStartTime(startTimeForm); + List patrolEnd = statsStaffPatrolRecordDailyService.patrolList(patrolForm); //4.判断是否需要查询起始日期用户、群组、话题、议题、项目、巡查数据 HashMap uStartMap = new HashMap<>(); @@ -2120,5 +2123,23 @@ public class DataStatsServiceImpl implements DataStatsService { return resultDTO; } + /** + * @Description 分别查询组织下dateId、较昨日、较上月项目统计数据 + * @author sun + */ + @Override + public List getProjectTotal(ProjectTotalFormDTO formDTO) { + return dataStatsDao.getProjectTotal(formDTO); + } + + /** + * @Description 查询dateId的上一月过去12个月份组织项目数据 + * @author sun + */ + @Override + public List getProjectMonthIncr(ProjectTotalFormDTO formDTO) { + return dataStatsDao.getProjectMonthIncr(formDTO); + } + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java index 5f0a73ad1e..6979f5d8b4 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java @@ -1,12 +1,13 @@ package com.epmet.dataaggre.service.epmetuser; -import com.epmet.dataaggre.dto.epmetuser.CustomerStaffDTO; -import com.epmet.dataaggre.dto.epmetuser.form.*; import com.epmet.dataaggre.dto.epmetuser.form.*; import com.epmet.dataaggre.dto.epmetuser.result.*; import com.epmet.dataaggre.dto.govorg.form.OrgStaffListFormDTO; import com.epmet.dataaggre.dto.govorg.form.StaffDetailV2FormDTO; import com.epmet.dataaggre.dto.govorg.result.GridStaffResultDTO; +import com.epmet.dataaggre.dto.govproject.result.ProjectAnalysisResultDTO; +import com.epmet.dto.IcResiUserDTO; +import com.epmet.dto.UserBaseInfoDTO; import java.util.List; @@ -148,4 +149,22 @@ public interface EpmetUserService { * @author sun */ StaffDetailV2FormDTO selectByStaffId(String staffId); + + /** + * @Description 查询userId的身份证号在小程序用户中存在的多个userId值 + * @author sun + */ + List getUserBaseList(String userId, String customerId); + + /** + * @Description 根据身份证号查询负能平台用户信息 + * @author sun + */ + IcResiUserDTO getIcResiUser(String idNum, String customerId); + + /** + * @Description 查询人员的家庭成员数据 + * @author sun + */ + List getHomeUserList(String homeId, String icUserId); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/StatsStaffPatrolRecordDailyService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/StatsStaffPatrolRecordDailyService.java index ce49c18f73..70afc1e944 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/StatsStaffPatrolRecordDailyService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/StatsStaffPatrolRecordDailyService.java @@ -35,12 +35,12 @@ public interface StatsStaffPatrolRecordDailyService extends BaseService getPatrolSumList(List agencyList, String startDateId, String endDateId); + List getPatrolSumList(List orgIdList, String startDateId, String endDateId); /** * @Description 直属组织或网格下巡查数据 diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java index a131ca29dd..759d1f5d1c 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java @@ -26,6 +26,7 @@ import com.epmet.dataaggre.dto.govorg.form.StaffDetailV2FormDTO; import com.epmet.dataaggre.dto.govorg.result.GridStaffResultDTO; import com.epmet.dataaggre.dto.govorg.result.StaffOrgNameResultDTO; import com.epmet.dataaggre.dto.govorg.result.StaffOrgRelationResultDTO; +import com.epmet.dataaggre.dto.govproject.result.ProjectAnalysisResultDTO; import com.epmet.dataaggre.entity.epmetuser.CustomerStaffEntity; import com.epmet.dataaggre.entity.epmetuser.GovStaffRoleEntity; import com.epmet.dataaggre.entity.epmetuser.ResiUserBadgeEntity; @@ -36,6 +37,8 @@ import com.epmet.dataaggre.service.epmetuser.StaffPatrolDetailService; import com.epmet.dataaggre.service.epmetuser.StaffPatrolRecordService; import com.epmet.dataaggre.service.govorg.GovOrgService; import com.epmet.dataaggre.service.govproject.GovProjectService; +import com.epmet.dto.IcResiUserDTO; +import com.epmet.dto.UserBaseInfoDTO; import com.epmet.dto.result.StaffRoleResultDTO; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; @@ -79,6 +82,8 @@ public class EpmetUserServiceImpl implements EpmetUserService { private DataStatsService dataStatsService; @Resource private GovStaffRoleDao govStaffRoleDao; + @Resource + private IcResiUserDao icResiUserDao; /** * @Description 根据UserIds查询 @@ -209,6 +214,7 @@ public class EpmetUserServiceImpl implements EpmetUserService { dto.setStatus(record.getStatus()); dto.setPatrolStartTime(DateUtils.format(record.getPatrolStartTime(), DateUtils.DATE_TIME_PATTERN)); dto.setPatrolEndTime(DateUtils.format(record.getPatrolEndTime(), DateUtils.DATE_TIME_PATTERN)); + dto.setIsHandEnd(record.getIsHandEnd()); Integer minutes; if (("patrolling").equals(record.getStatus())) { minutes = DateUtils.calculateMin(record.getPatrolStartTime(), new Date()); @@ -220,8 +226,7 @@ public class EpmetUserServiceImpl implements EpmetUserService { String totalTimeDesc = minutes / 60 + "小时"+ minutes % 60 + "分"; dto.setTotalTimeDesc(totalTimeDesc); List detailList = details.get(record.getId()); - detailList = - detailList.stream().sorted(Comparator.comparing(StaffPatrolDetailDTO::getSerialNum).reversed()).collect(Collectors.toList()).stream() + detailList = detailList.stream().sorted(Comparator.comparing(StaffPatrolDetailDTO::getSerialNum).reversed()).collect(Collectors.toList()).stream() .filter(item -> null == record.getPatrolEndTime() || record.getPatrolEndTime().compareTo(item.getUploadTime()) > -1).collect(Collectors.toList()); List recordDetails = detailList.stream().map( detail -> { PatrolRecordDetailDTO detailDTO = new PatrolRecordDetailDTO(); @@ -229,6 +234,7 @@ public class EpmetUserServiceImpl implements EpmetUserService { detailDTO.setLongitude(detail.getLongitude()); detailDTO.setSpeed(detail.getSpeed()); detailDTO.setUploadTime(DateUtils.format(detail.getUploadTime(), DateUtils.DATE_TIME_PATTERN)); + detailDTO.setAddress(detail.getAddress()); return detailDTO; }).collect(Collectors.toList()); if (("end").equals(record.getStatus())) { @@ -598,9 +604,13 @@ public class EpmetUserServiceImpl implements EpmetUserService { log.error("getStaffInfo have any agency staffId:{}",staffId); return null; } + result.setStaffId(staffEntity.getUserId()); result.setAgencyId(agencyDTO.getId()); result.setAgencyName(agencyDTO.getOrganizationName()); result.setAgencyPIds(agencyDTO.getPids()); + result.setLevel(agencyDTO.getLevel()); + result.setLongitude(agencyDTO.getLongitude()); + result.setLatitude(agencyDTO.getLatitude()); StaffOrgRelationResultDTO fromOrgTypeDto = govOrgService.getStaffFromOrgType(staffId); String fromOrgType = OrgTypeEnum.AGENCY.getCode(); if (fromOrgTypeDto != null){ @@ -698,5 +708,32 @@ public class EpmetUserServiceImpl implements EpmetUserService { return result; } + /** + * @Description 查询userId的身份证号在小程序用户中存在的多个userId值 + * @author sun + */ + @Override + public List getUserBaseList(String userId, String customerId) { + return userBaseInfoDao.getUserBaseList(userId, customerId); + } + + /** + * @Description 根据身份证号查询负能平台用户信息 + * @author sun + */ + @Override + public IcResiUserDTO getIcResiUser(String idNum, String customerId) { + return icResiUserDao.getIcResiUser(idNum, customerId); + } + + /** + * @Description 查询人员的家庭成员数据 + * @author sun + */ + @Override + public List getHomeUserList(String homeId, String icUserId) { + return icResiUserDao.getHomeUserList(homeId, icUserId); + } + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/StatsStaffPatrolRecordDailyServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/StatsStaffPatrolRecordDailyServiceImpl.java index d24dcbe10c..ccfe71e399 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/StatsStaffPatrolRecordDailyServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/StatsStaffPatrolRecordDailyServiceImpl.java @@ -28,14 +28,14 @@ public class StatsStaffPatrolRecordDailyServiceImpl extends BaseServiceImpl getPatrolSumList(List agencyFullIdList, String startDateId, String endDateId) { - return baseDao.getPatrolSumList(agencyFullIdList,startDateId,endDateId); + public List getPatrolSumList(List orgIdList, String startDateId, String endDateId) { + return baseDao.getPatrolSumList(orgIdList,startDateId,endDateId); } /** diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/EvaluationIndexService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/EvaluationIndexService.java index 67468e32de..bd5cfd6886 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/EvaluationIndexService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/EvaluationIndexService.java @@ -6,6 +6,8 @@ import com.epmet.dataaggre.dto.evaluationindex.ScreenAgencyOrGridListDTO; import com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerAgencyDTO; import com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerGridDTO; import com.epmet.dataaggre.dto.evaluationindex.ScreenGovernRankDataDailyDTO; +import com.epmet.dataaggre.dto.govproject.form.ProjectCategoryTotalFormDTO; +import com.epmet.dataaggre.dto.govproject.result.ProjectCategoryTotalResultDTO; import java.util.List; @@ -86,4 +88,9 @@ public interface EvaluationIndexService { */ ScreenAgencyOrGridListDTO getSubAgencyOrGridList(String agencyId); + /** + * @Description 按dateId查询组织下一级分类项目总数统计 + * @author sun + */ + List projectCategoryList(ProjectCategoryTotalFormDTO formDTO); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/impl/EvaluationIndexServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/impl/EvaluationIndexServiceImpl.java index abb0f137f5..e3f1b246af 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/impl/EvaluationIndexServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/impl/EvaluationIndexServiceImpl.java @@ -11,6 +11,8 @@ import com.epmet.dataaggre.dto.evaluationindex.ScreenAgencyOrGridListDTO; import com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerAgencyDTO; import com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerGridDTO; import com.epmet.dataaggre.dto.evaluationindex.ScreenGovernRankDataDailyDTO; +import com.epmet.dataaggre.dto.govproject.form.ProjectCategoryTotalFormDTO; +import com.epmet.dataaggre.dto.govproject.result.ProjectCategoryTotalResultDTO; import com.epmet.dataaggre.service.evaluationindex.EvaluationIndexService; import com.epmet.dataaggre.service.opercrm.CustomerRelation; import lombok.extern.slf4j.Slf4j; @@ -206,4 +208,13 @@ public class EvaluationIndexServiceImpl implements EvaluationIndexService { return resultDTO; } + /** + * @Description 按dateId查询组织下一级分类项目总数统计 + * @author sun + */ + @Override + public List projectCategoryList(ProjectCategoryTotalFormDTO formDTO) { + return evaluationIndexDao.projectCategoryList(formDTO); + } + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govissue/GovIssueService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govissue/GovIssueService.java index 5159bda48f..3e87ea18d3 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govissue/GovIssueService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govissue/GovIssueService.java @@ -1,6 +1,7 @@ package com.epmet.dataaggre.service.govissue; import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.dataaggre.dto.govissue.IssueProjectCategoryDictDTO; import com.epmet.dataaggre.dto.govissue.form.AllIssueFormDTO; import com.epmet.dataaggre.dto.govissue.form.ClosedIssueListFormDTO; import com.epmet.dataaggre.dto.govissue.form.ShiftProjectIssueListFormDTO; @@ -45,4 +46,10 @@ public interface GovIssueService { List closedIssueList(ClosedIssueListFormDTO fromDTO); List selectShiftProjectIssueList(String customerId,String gridId,Integer pageNo,Integer pageSize); + + /** + * @Description 查询客户下分类信息 + * @author sun + **/ + List categoryList(String customerId, String level, String isDisable); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govissue/impl/GovIssueServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govissue/impl/GovIssueServiceImpl.java index 7b68d96332..5556d2d3f0 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govissue/impl/GovIssueServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govissue/impl/GovIssueServiceImpl.java @@ -8,6 +8,7 @@ import com.epmet.dataaggre.constant.DataSourceConstant; import com.epmet.dataaggre.constant.IssueConstant; import com.epmet.dataaggre.dao.govissue.IssueApplicationDao; import com.epmet.dataaggre.dao.govissue.IssueDao; +import com.epmet.dataaggre.dto.govissue.IssueProjectCategoryDictDTO; import com.epmet.dataaggre.dto.govissue.form.AllIssueFormDTO; import com.epmet.dataaggre.dto.govissue.form.ClosedIssueListFormDTO; import com.epmet.dataaggre.dto.govissue.form.ShiftProjectIssueListFormDTO; @@ -323,4 +324,13 @@ public class GovIssueServiceImpl implements GovIssueService { return issueDao.selectShiftProjectIssueList(customerId, gridId); } + /** + * @Description 查询客户下一级分类信息 + * @author sun + **/ + @Override + public List categoryList(String customerId, String level, String isDisable) { + return issueDao.getCategoryList(customerId, level, isDisable); + } + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java index 41b97b57ac..77c8c33d0f 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java @@ -10,6 +10,8 @@ import com.epmet.dataaggre.dto.govorg.form.StaffDetailV2FormDTO; import com.epmet.dataaggre.dto.govorg.form.SubOrgFormDTO; import com.epmet.dataaggre.dto.govorg.result.*; import com.epmet.dataaggre.dto.resigroup.result.OrgInfoCommonDTO; +import com.epmet.dataaggre.entity.govorg.CustomerAgencyEntity; +import com.epmet.dataaggre.entity.govorg.CustomerGridEntity; import java.util.List; @@ -154,4 +156,20 @@ public interface GovOrgService { * @Date 2021/9/23 10:14 */ List getStaffOrgList(String staffId); + + /** + * @Description 查询组织信息 + * @param agencyId + * @author zxc + * @date 2021/11/5 2:54 下午 + */ + CustomerAgencyEntity getAgencyInfo(String agencyId); + + /** + * @Description 查询网格信息 + * @param gridId + * @author zxc + * @date 2021/11/5 2:57 下午 + */ + CustomerGridDTO getGridInfo(String gridId); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java index d4e265cdec..79dafa6741 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java @@ -20,6 +20,7 @@ import com.epmet.dataaggre.dto.govorg.form.SubOrgFormDTO; import com.epmet.dataaggre.dto.govorg.result.*; import com.epmet.dataaggre.dto.resigroup.result.OrgInfoCommonDTO; import com.epmet.dataaggre.entity.govorg.CustomerAgencyEntity; +import com.epmet.dataaggre.entity.govorg.CustomerGridEntity; import com.epmet.dataaggre.service.commonservice.AreaCodeService; import com.epmet.dataaggre.service.epmetuser.EpmetUserService; import com.epmet.dataaggre.service.govorg.GovOrgService; @@ -532,4 +533,27 @@ public class GovOrgServiceImpl implements GovOrgService { return customerAgencyDao.getOrgList(staffId); } + /** + * @Description 查询组织信息 + * @param agencyId + * @author zxc + * @date 2021/11/5 2:54 下午 + */ + @Override + public CustomerAgencyEntity getAgencyInfo(String agencyId) { + return customerAgencyDao.selectById(agencyId); + } + + /** + * @Description 查询网格信息 + * @param gridId + * @author zxc + * @date 2021/11/5 2:57 下午 + */ + @Override + public CustomerGridDTO getGridInfo(String gridId) { + return customerGridDao.getGridInfo(gridId); + } + + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/GovProjectService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/GovProjectService.java index 35b0096790..d118a05746 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/GovProjectService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/GovProjectService.java @@ -1,13 +1,12 @@ package com.epmet.dataaggre.service.govproject; import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.dataaggre.dto.govproject.result.IssueProjectCategory; import com.epmet.dataaggre.dto.govissue.result.IssueListResultDTO; -import com.epmet.dataaggre.dto.govproject.form.AllProjectFormDTO; -import com.epmet.dataaggre.dto.govproject.form.ProjectDistributionFormDTO; -import com.epmet.dataaggre.dto.govproject.result.AllProjectResultDTO; -import com.epmet.dataaggre.dto.govproject.result.ProjectDistributionResultDTO; -import com.epmet.dataaggre.dto.govproject.result.ShiftProjectResultDTO; +import com.epmet.dataaggre.dto.govproject.form.*; +import com.epmet.dataaggre.dto.govproject.result.*; +import java.util.LinkedList; import java.util.List; /** @@ -51,4 +50,48 @@ public interface GovProjectService { * @date 2021/8/3 15:27 */ int countRedDot(String userId); + + /** + * @Description 赋能平台【项目处理分析】事件总数查询 + * @author sun + */ + ProjectTotalResultDTO projectTotal(ProjectTotalFormDTO formDTO); + + /** + * @Description 赋能平台【项目处理分析】进12月新增项目折线图 + * @author sun + */ + LinkedList projectMonthIncr(ProjectTotalFormDTO formDTO); + + /** + * @Description 赋能平台【项目处理分析】按状态查询项目列表 + * @author sun + */ + List projectStatusList(ProjectTotalFormDTO formDTO); + + /** + * @Description 赋能平台【项目分类分析】各分类项目数图表 + * @author sun + */ + List projectCategoryList(ProjectCategoryTotalFormDTO formDTO); + + /** + * @Description 赋能平台【项目处理分析】分类下项目列表 + * @author sun + */ + CategoryProjectResultDTO categoryProjectList(CategoryProjectFormDTO formDTO); + + /** + * @Description 赋能平台【项目处理分析】研判分析 + * @author sun + */ + ProjectAnalysisResultDTO projectAnalysis(ProjectAnalysisFormDTO formDTO); + + /** + * 找出这些议题中对应的项目id,以及项目对应的一级分类编码 + * + * @param issueIds + * @return + */ + List getIssueProjectFirstCategory(List issueIds); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/impl/GovProjectServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/impl/GovProjectServiceImpl.java index 2063b3f83d..200054ae6d 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/impl/GovProjectServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/impl/GovProjectServiceImpl.java @@ -5,27 +5,37 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dataaggre.constant.DataSourceConstant; import com.epmet.dataaggre.constant.ProjectConstant; import com.epmet.dataaggre.dao.govproject.ProjectDao; +import com.epmet.dataaggre.dto.datastats.result.FactAgencyProjectMonthResultDTO; +import com.epmet.dataaggre.dto.datastats.result.FactAgencyProjectResultDTO; +import com.epmet.dataaggre.dto.govissue.IssueProjectCategoryDictDTO; import com.epmet.dataaggre.dto.govissue.result.IssueInfoDTO; import com.epmet.dataaggre.dto.govissue.result.IssueListResultDTO; +import com.epmet.dataaggre.dto.govorg.result.GridsInfoListResultDTO; import com.epmet.dataaggre.dto.govproject.ProjectDTO; -import com.epmet.dataaggre.dto.govproject.form.AllProjectFormDTO; -import com.epmet.dataaggre.dto.govproject.form.ProjectDistributionFormDTO; -import com.epmet.dataaggre.dto.govproject.result.AllProjectResultDTO; -import com.epmet.dataaggre.dto.govproject.result.ProjectDistributionResultDTO; -import com.epmet.dataaggre.dto.govproject.result.ProjectInfoDTO; -import com.epmet.dataaggre.dto.govproject.result.ShiftProjectResultDTO; +import com.epmet.dataaggre.dto.govproject.ProjectRelatedPersonnelDTO; +import com.epmet.dataaggre.dto.govproject.ResiEventDTO; +import com.epmet.dataaggre.dto.govproject.form.*; +import com.epmet.dataaggre.dto.govproject.result.*; import com.epmet.dataaggre.dto.resigroup.ResiTopicDTO; +import com.epmet.dataaggre.service.datastats.DataStatsService; +import com.epmet.dataaggre.service.epmetuser.EpmetUserService; +import com.epmet.dataaggre.service.evaluationindex.EvaluationIndexService; import com.epmet.dataaggre.service.govissue.GovIssueService; import com.epmet.dataaggre.service.govorg.GovOrgService; import com.epmet.dataaggre.service.govproject.GovProjectService; import com.epmet.dataaggre.service.resigroup.ResiGroupService; +import com.epmet.dto.IcResiUserDTO; +import com.epmet.dto.UserBaseInfoDTO; import com.epmet.dto.form.TimestampIntervalFormDTO; import com.epmet.dto.form.WorkMinuteFormDTO; import com.epmet.feign.EpmetCommonServiceOpenFeignClient; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; @@ -54,6 +64,12 @@ public class GovProjectServiceImpl implements GovProjectService { private GovIssueService govIssueService; @Autowired private ResiGroupService resiGroupService; + @Autowired + private DataStatsService dataStatsService; + @Autowired + private EvaluationIndexService evaluationIndexService; + @Autowired + private EpmetUserService epmetUserService; /** * @Description 查询项目信息 @@ -247,4 +263,314 @@ public class GovProjectServiceImpl implements GovProjectService { return projectDao.countRedDot(userId); } + /** + * @Description 赋能平台【项目处理分析】事件总数查询 + * @author sun + */ + @Override + public ProjectTotalResultDTO projectTotal(ProjectTotalFormDTO formDTO) { + ProjectTotalResultDTO result = new ProjectTotalResultDTO(); + result.setAgencyId(formDTO.getAgencyId()); + result.setDateId(formDTO.getDateId()); + //较昨日dateId值 + formDTO.setYeDateId(DateUtils.dateOrmonthId(formDTO.getDateId(), "date", -1)); + //较上月monthId值 + formDTO.setMonthId(DateUtils.dateOrmonthId(formDTO.getDateId(), "month", -1)); + + //1.分别查询组织下dateId、较昨日、较上月项目统计数据 + List list = dataStatsService.getProjectTotal(formDTO); + if (CollectionUtils.isEmpty(list) || !formDTO.getDateId().equals(list.get(0).getDateId())) { + return result; + } + + //2.封装数据 + list.forEach(l -> { + if (formDTO.getDateId().equals(l.getDateId())) { + result.setProjectTotal(l.getProjectTotal()); + result.setPendingTotal(l.getPendingTotal()); + result.setPendingRatio(l.getPendingRatio()); + result.setClosedTotal(l.getClosedTotal()); + result.setClosedRatio(l.getClosedRatio()); + //默认较昨日较上个月增长值就是当前日期的数据 + result.setDateIncr(l.getProjectTotal()); + result.setMonthIncr(l.getProjectTotal()); + } + if (formDTO.getYeDateId().equals(l.getDateId())) { + result.setDateIncr(result.getProjectTotal() - l.getProjectTotal()); + } else if (formDTO.getMonthId().equals(l.getMonthId())) { + result.setMonthIncr(result.getProjectTotal() - l.getProjectTotal()); + } + }); + + return result; + } + + /** + * @Description 赋能平台【项目处理分析】进12月新增项目折线图 + * @author sun + */ + @Override + public LinkedList projectMonthIncr(ProjectTotalFormDTO formDTO) { + LinkedList resultList = new LinkedList<>(); + //1.获取起始终止月份值 + LinkedHashMap map = DateUtils.getXproSub(formDTO.getDateId()); + List monthIdList = map.keySet().stream().collect(Collectors.toList()); + formDTO.setStartMonth(monthIdList.get(NumConstant.ZERO)); + formDTO.setEndMonth(monthIdList.get(NumConstant.ELEVEN)); + + //2.查询dateId的上一月过去12个月份数据【2021-12-08 数据是202012到202111的数据】 + List list = dataStatsService.getProjectMonthIncr(formDTO); + + //3.封装数据并返回 + map.forEach((k, v) -> { + ProjectMonthIncrResultDTO dto = new ProjectMonthIncrResultDTO(); + dto.setType(v); + list.forEach(l -> { + if (k.equals(l.getMonthId())) { + dto.setValue(l.getProjectIncr()); + } + }); + resultList.add(dto); + }); + + return resultList; + } + + /** + * @Description 赋能平台【项目处理分析】按状态查询项目列表 + * @author sun + */ + @Override + public List projectStatusList(ProjectTotalFormDTO formDTO) { + //所选日期后一天的dateId值 + formDTO.setToDateId(DateUtils.dateOrmonthId(formDTO.getDateId(), "date", 1)); + //1.查询组织下截止到dateId的某个状态的项目列表 + List resultList = projectDao.getProjectStatusList(formDTO); + return resultList; + } + + /** + * @Description 赋能平台【项目分类分析】各分类项目数图表 +, * @author sun + */ + @Override + public List projectCategoryList(ProjectCategoryTotalFormDTO formDTO) { + List resultList = new ArrayList<>(); + //1.查询客户下一级分类信息 + List categoryList = govIssueService.categoryList(formDTO.getCustomerId(), "1", "enable"); + + //2.按dateId查询组织下一级分类项目总数 + List list = evaluationIndexService.projectCategoryList(formDTO); + + //3.封装数据并返回 + //有数据的排在前边,没数据的按分类顺序排在后边 + Map map = new HashMap<>(); + list.forEach(l -> { + ProjectCategoryTotalResultDTO dto = new ProjectCategoryTotalResultDTO(); + dto.setAgencyId(formDTO.getAgencyId()); + dto.setTotal(l.getTotal()); + categoryList.forEach(ca -> { + if (ca.getCategoryCode().equals(l.getCategoryCode())) { + dto.setCategoryCode(ca.getCategoryCode()); + dto.setCategoryName(ca.getCategoryName()); + dto.setColor(ca.getColor()); + } + }); + map.put(l.getCategoryCode(), l.getCategoryCode()); + resultList.add(dto); + }); + categoryList.forEach(ca -> { + if (!map.containsKey(ca.getCategoryCode())) { + ProjectCategoryTotalResultDTO dto = new ProjectCategoryTotalResultDTO(); + dto.setAgencyId(formDTO.getAgencyId()); + dto.setCategoryCode(ca.getCategoryCode()); + dto.setCategoryName(ca.getCategoryName()); + dto.setColor(ca.getColor()); + resultList.add(dto); + map.put(ca.getCategoryCode(), ca.getCategoryCode()); + } + }); + + return resultList; + } + + /** + * @Description 赋能平台【项目处理分析】分类下项目列表 + * @author sun + */ + @Override + public CategoryProjectResultDTO categoryProjectList(CategoryProjectFormDTO formDTO) { + CategoryProjectResultDTO resultDTO = new CategoryProjectResultDTO(); + //所选日期后一天的dateId值 + formDTO.setToDateId(DateUtils.dateOrmonthId(formDTO.getDateId(), "date", 1)); + //1.查询客户下分类信息 + List categoryList = govIssueService.categoryList(formDTO.getCustomerId(), null, null); + List categoreCodeList = categoryList.stream().filter(ca -> ca.getParentCategoryCode().equals(formDTO.getCategoryCode())).map(m -> m.getCategoryCode()).collect(Collectors.toList()); + formDTO.setCategoreCodeList(categoreCodeList); + + //2.查询组织及下级截止某一天的某个一级分类下的项目列表 + PageInfo result = + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()).doSelectPageInfo(() -> projectDao.categoryProjectList(formDTO)); + if (org.springframework.util.CollectionUtils.isEmpty(result.getList())) { + return resultDTO; + } + resultDTO.setTotal((int) result.getTotal()); + + //3.查询已有项目列表涉及的所有分类信息【一个项目存在多个一级分类下的二级分类】 + List projectIds = result.getList().stream().map(CategoryProjectResultDTO.Project::getProjectId).collect(Collectors.toList()); + List list = projectDao.getCategoryList(projectIds); + + //4.查询网格信息【楼院小组类项目、上报事件且上报给网格的项目才存在网格Id】 + List gridIds = result.getList().stream().map(CategoryProjectResultDTO.Project::getGridId).collect(Collectors.toList()); + gridIds = gridIds.stream().distinct().collect(Collectors.toList()); + List gridList = govOrgService.gridListByIds(gridIds); + + //5.查询来源议题、事件的项目居民端创建人userId + List eventUser = projectDao.getEventList(projectIds); + List topicUser = projectDao.getTopicUser(projectIds); + + //5.封装数据 + result.getList().forEach(re -> { + //项目涉及网格信息 + gridList.forEach(g -> { + if (StringUtils.isNotBlank(re.getGridId()) && re.getGridId().equals(g.getGridId())) { + re.setGridName(g.getName()); + } + }); + //项目涉及分类信息【一个项目涉及多个一级分类】 + //一级分类Id + List caId = new ArrayList<>(); + list.forEach(ca -> { + if (ca.getProjectId().equals(re.getProjectId())) { + caId.add(ca.getCategoryPids()); + } + }); + //一级分类名称、code集合 + List caName = new ArrayList<>(); + List caCode = new ArrayList<>(); + categoryList.forEach(ca -> caId.stream().filter(li -> ca.getId().equals(li)).forEach(s -> { + caName.add(ca.getCategoryName()); + caCode.add(ca.getCategoryCode()); + })); + re.setCategoryNames(caName); + re.setCategoryCodes(caCode); + //项目来源话题、事件的创建人信息 + eventUser.forEach(ev -> { + if (re.getProjectId().equals(ev.getProjectId())) { + re.setUserId(ev.getReportUserId()); + } + }); + topicUser.forEach(to -> { + if (re.getProjectId().equals(to.getProjectId())) { + re.setUserId(to.getUserId()); + } + }); + }); + + resultDTO.setList(result.getList()); + return resultDTO; + } + + /** + * @Description 赋能平台【项目处理分析】研判分析 + * @author sun + */ + @Override + public ProjectAnalysisResultDTO projectAnalysis(ProjectAnalysisFormDTO formDTO) { + ProjectAnalysisResultDTO resultDTO = new ProjectAnalysisResultDTO(); + resultDTO.setUserId(formDTO.getUserId()); + //1.查询userId的身份证号在小程序用户中存在的多个userId值 + List userList = epmetUserService.getUserBaseList(formDTO.getUserId(), formDTO.getCustomerId()); + List userIds = userList.stream().map(UserBaseInfoDTO::getUserId).collect(Collectors.toList()); + + //2.查询对应负能平台用户家庭信息 + if (!org.springframework.util.CollectionUtils.isEmpty(userList)) { + //2-1.根据身份证号查询负能平台用户信息 + IcResiUserDTO icResiUserDTO = epmetUserService.getIcResiUser(userList.get(0).getIdNum(), formDTO.getCustomerId()); + resultDTO.setIcUserId(icResiUserDTO.getId()); + resultDTO.setIcUserName(icResiUserDTO.getName()); + if (null != icResiUserDTO) { + //2-2.查询人员的家庭成员数据 + List homeList = epmetUserService.getHomeUserList(icResiUserDTO.getHomeId(), icResiUserDTO.getId()); + resultDTO.setHomeUserList(homeList); + } + } + if (org.springframework.util.CollectionUtils.isEmpty(userIds)) { + userIds = new ArrayList<>(); + userIds.add(formDTO.getUserId()); + } + + //3.查询一级分类数据 + List categoryList = govIssueService.categoryList(formDTO.getCustomerId(), null, null); + List secondCodeList = formDTO.getCategoryCodeList().stream().flatMap(code -> categoryList.stream().filter(ca -> code.equals(ca.getParentCategoryCode())).map(second -> { + return second.getCategoryCode(); + })).collect(Collectors.toList()); + + //4.根据userId集合和二级分类Code集合查询来源楼院小组的项目 + List groupList = projectDao.getProjectCategoryList(formDTO.getCustomerId(), secondCodeList, userIds, "issue"); + + //5.根据userId集合和二级分类Code集合查询来源事件上报的项目 + List eventList = projectDao.getProjectCategoryList(formDTO.getCustomerId(), secondCodeList, userIds, "resiEvent"); + + //6.封装数据 + //楼院小组下分类项目列表 + List groupProjectList = new ArrayList<>(); + //事件上报下分类项目列表 + List eventProjectList = new ArrayList<>(); + formDTO.getCategoryCodeList().forEach(code -> { + //一级分类code下的二级分类code集合 + Map secondCodeMap = new HashMap<>(); + //来源楼院小组的分类及项目列表 + ProjectAnalysisResultDTO.Category groupCa = new ProjectAnalysisResultDTO.Category(); + List groupPrList = new ArrayList<>(); + //来源事件上报的分类及项目列表 + ProjectAnalysisResultDTO.Category eventCa = new ProjectAnalysisResultDTO.Category(); + List eventPrList = new ArrayList<>(); + categoryList.forEach(ca -> { + groupCa.setCategoryCode(code); + eventCa.setCategoryCode(code); + if (code.equals(ca.getCategoryCode())) { + groupCa.setCategoryName(ca.getCategoryName()); + eventCa.setCategoryName(ca.getCategoryName()); + } + if (code.equals(ca.getParentCategoryCode())) { + secondCodeMap.put(ca.getCategoryCode(), ca.getCategoryCode()); + } + }); + //当前分类下来源楼院小组的项目 + groupList.forEach(gr -> { + if (secondCodeMap.containsKey(gr.getCategoryCode()) && !formDTO.getProjectId().equals(gr.getProjectId())) { + ProjectAnalysisResultDTO.Project project = ConvertUtils.sourceToTarget(gr, ProjectAnalysisResultDTO.Project.class); + groupPrList.add(project); + } + }); + groupCa.setProjectList(groupPrList); + groupProjectList.add(groupCa); + //当前分类下来源事件上报的项目 + eventList.forEach(gr -> { + if (secondCodeMap.containsKey(gr.getCategoryCode()) && !formDTO.getProjectId().equals(gr.getProjectId())) { + ProjectAnalysisResultDTO.Project project = ConvertUtils.sourceToTarget(gr, ProjectAnalysisResultDTO.Project.class); + eventPrList.add(project); + } + }); + eventCa.setProjectList(eventPrList); + eventProjectList.add(eventCa); + }); + + resultDTO.setGroupProjectList(groupProjectList); + resultDTO.setEventProjectList(eventProjectList); + return resultDTO; + } + + /** + * 找出这些议题中对应的项目id,以及项目对应的一级分类编码 + * + * @param issueIds + * @return + */ + @Override + public List getIssueProjectFirstCategory(List issueIds) { + return projectDao.selectProjectIssueCategory(issueIds); + } + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/QuestionnaireServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/QuestionnaireServiceImpl.java index 1c6aab452d..2d69ac0fb3 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/QuestionnaireServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/QuestionnaireServiceImpl.java @@ -73,7 +73,7 @@ public class QuestionnaireServiceImpl implements QuestionnaireService, ResultDat CustomerGridFormDTO form = new CustomerGridFormDTO(); form.setGridId(gridId); Result gridInfoResult = govOrgOpenFeignClient.getGridBaseInfoByGridId(form); - CustomerGridDTO gridInfo = getResultDataOrThrowsException(gridInfoResult, ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【调查问卷】校验访问权限,查询网格信息失败"); + CustomerGridDTO gridInfo = getResultDataOrThrowsException(gridInfoResult, ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【调查问卷】校验访问权限,查询网格信息失败", null); // 网格父级ID列表:网格ID(拼接起来,冒号分割) String gridIdPath = gridInfo.getPids().concat(":").concat(gridInfo.getId()); List publishRangeEntity = prPublishRangeService.getPublishRangeEntity(projectKey); diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercustomize/CustomerFootBarService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercustomize/CustomerFootBarService.java index b185b9746a..810122f74c 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercustomize/CustomerFootBarService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercustomize/CustomerFootBarService.java @@ -39,4 +39,5 @@ public interface CustomerFootBarService extends BaseService querySubRankList(GroupActRankFormDTO formDTO); + + /** + * 分页查询我发布的话题 + * @param formDTO + * @return + */ + PageData pageUserTopic(PageUserReportEventFormDTO formDTO); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/impl/ResiGroupServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/impl/ResiGroupServiceImpl.java index 374db9eedf..d0cd285b19 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/impl/ResiGroupServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/impl/ResiGroupServiceImpl.java @@ -3,12 +3,15 @@ package com.epmet.dataaggre.service.resigroup.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.Constant; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.dataaggre.constant.DataSourceConstant; import com.epmet.dataaggre.dao.resigroup.ResiGroupDao; import com.epmet.dataaggre.dao.resigroup.ResiTopicDao; import com.epmet.dataaggre.dto.datastats.FactGroupActDailyDTO; import com.epmet.dataaggre.dto.epmetuser.result.UserInfosResultDTO; +import com.epmet.dataaggre.dto.govproject.result.IssueProjectCategory; import com.epmet.dataaggre.dto.resigroup.ActCategoryDictDTO; import com.epmet.dataaggre.dto.resigroup.ResiTopicDTO; import com.epmet.dataaggre.dto.resigroup.form.*; @@ -18,7 +21,9 @@ import com.epmet.dataaggre.redis.ResiGroupRedis; import com.epmet.dataaggre.service.datastats.DataStatsService; import com.epmet.dataaggre.service.epmetuser.EpmetUserService; import com.epmet.dataaggre.service.govorg.GovOrgService; +import com.epmet.dataaggre.service.govproject.GovProjectService; import com.epmet.dataaggre.service.resigroup.ResiGroupService; +import com.epmet.dto.form.PageUserReportEventFormDTO; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import lombok.extern.slf4j.Slf4j; @@ -27,10 +32,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; -import java.util.ArrayList; -import java.util.Comparator; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.stream.Collectors; /** @@ -53,6 +55,8 @@ public class ResiGroupServiceImpl implements ResiGroupService { private DataStatsService dataStatsService; @Autowired private GovOrgService govOrgService; + @Autowired + private GovProjectService govProjectService; @Override public List selectTopicInfoByIds(List topicIds) { @@ -358,4 +362,39 @@ public class ResiGroupServiceImpl implements ResiGroupService { } return resultDTOList; } + + /** + * 数据分析-个人档案-发布话题列表 + * + * @param formDTO + * @return + */ + @Override + public PageData pageUserTopic(PageUserReportEventFormDTO formDTO) { + if (org.apache.commons.collections4.CollectionUtils.isEmpty(formDTO.getEpmetUserIdList())) { + return new PageData(new ArrayList<>(), NumConstant.ZERO); + } + PageInfo pageInfo = PageHelper.startPage(formDTO.getPageNo(), + formDTO.getPageSize()).doSelectPageInfo(() -> resiTopicDao.selectListTopic(formDTO)); + List list =pageInfo.getList(); + //根据议题id查询出每个议题对应的项目id,以及项目分类编码 + List issueIds=list.stream().filter(dto -> StringUtils.isNotBlank(dto.getIssueId())).map(UserTopicResDTO::getIssueId).collect(Collectors.toList()); + if(org.apache.commons.collections4.CollectionUtils.isNotEmpty(issueIds)){ + List categoryList= govProjectService.getIssueProjectFirstCategory(issueIds); + for(UserTopicResDTO topicResDTO :pageInfo.getList()){ + topicResDTO.setShiftProject(false); + topicResDTO.setProjectId(StrConstant.EPMETY_STR); + + for(IssueProjectCategory category:categoryList){ + if(topicResDTO.getIssueId().equals(category.getIssueId())&&StringUtils.isNotBlank(category.getProjectId())){ + topicResDTO.setShiftProject(true); + topicResDTO.setProjectId(category.getProjectId()); + break; + } + } + + } + } + return new PageData<>(pageInfo.getList(), pageInfo.getTotal()); + } } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml index 90029209ad..681c057922 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml @@ -221,7 +221,7 @@ agency_id AS agencyId, issue_total AS shiftedIssueTotal FROM - fact_topic_issue_agency_daily + fact_topic_issue_agency_daily WHERE del_flag = '0' AND date_id = #{dateId} @@ -624,7 +624,9 @@ SELECT agency_id AS agencyId, `level` AS level, - problem_resolved_count AS problemResolvedCount, + ISSUE_PROJECT_RESOLVED_COUNT+ISSUE_PROJECT_UN_RESOLVED_COUNT + +APPROVAL_PROJECT_RESOLVED_COUNT+APPROVAL_PROJECT_UN_RESOLVED_COUNT + +EVENT_RESOLVED_COUNT+EVENT_UN_RESOLVED_COUNT AS problemResolvedCount, concat(ROUND(group_self_govern_ratio*100, 1),'%') AS groupSelfGovernRatio, concat(ROUND(grid_self_govern_ratio*100, 1),'%') AS gridSelfGovernRatio, concat(ROUND(community_closed_ratio*100, 1),'%') AS communityResolvedRatio, @@ -638,13 +640,15 @@ agency_id = #{agencyId} - ORDER BY problem_resolved_count DESC + ORDER BY problemResolvedCount DESC SELECT - staff_id staffId, - staff_name staffName, - date_id dateId, + a.staff_id staffId, + a.staff_name staffName, + a.date_id dateId, IFNULL( SUM( - issue_to_project_count + closed_issue_count + project_response_count + project_transfer_count + project_closed_count - ) - , 0)eventCount + a.issue_to_project_count + a.closed_issue_count + a.project_response_count + a.project_transfer_count + a.project_closed_count + ), + 0 + ) eventCount FROM - fact_grid_member_statistics_daily - WHERE - del_flag = '0' - AND pids LIKE concat('%', #{agencyId}, '%') - AND date_id = ( - SELECT MAX(date_id) - FROM fact_grid_member_statistics_daily - WHERE - del_flag = '0' + fact_grid_member_statistics_daily a + INNER JOIN ( + SELECT + staff_id, + MAX(date_id) date_id + FROM + fact_grid_member_statistics_daily + WHERE del_flag = '0' + AND pids LIKE concat('%', #{agencyId}, '%') AND month_id = #{dimId} AND year_id = #{dimId} - ) - GROUP BY staff_id + GROUP BY STAFF_ID + ) b ON a.STAFF_ID = b.STAFF_ID AND a.date_id = b.date_id + + WHERE + a.del_flag = '0' + AND a.pids LIKE concat('%', #{agencyId}, '%') + GROUP BY a.staff_id + ORDER BY a.date_id DESC + + + + diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/IcResiUserDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/IcResiUserDao.xml new file mode 100644 index 0000000000..c28d81375c --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/IcResiUserDao.xml @@ -0,0 +1,39 @@ + + + + + + + + + + diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/StaffPatrolRecordDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/StaffPatrolRecordDao.xml index 9dc97b4c5a..a23656d221 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/StaffPatrolRecordDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/StaffPatrolRecordDao.xml @@ -124,7 +124,7 @@ - + SELECT - LEFT (GRID_PIDS,LENGTH( #{fullAgencyId} )) fullAgencyId, + #{orgId} orgId, sum(patrol_total) patrolTotal, sum(TOTAL_TIME) totalTime FROM stats_staff_patrol_record_daily WHERE del_flag = '0' - AND date_id BETWEEN #{startDateId} and #{endDateId} - AND GRID_PIDS like CONCAT( #{fullAgencyId},'%') - GROUP BY fullAgencyId + AND date_id =]]> #{startDateId} + AND date_id #{endDateId} + AND GRID_PIDS like CONCAT('%', #{orgId},'%') + GROUP BY orgId diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/UserBaseInfoDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/UserBaseInfoDao.xml index 1ce45a28d8..6c118e2ce0 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/UserBaseInfoDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/UserBaseInfoDao.xml @@ -38,4 +38,16 @@ ) + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/evaluationindex/EvaluationIndexDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/evaluationindex/EvaluationIndexDao.xml index afa7e56c2d..c3b45aba0d 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/evaluationindex/EvaluationIndexDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/evaluationindex/EvaluationIndexDao.xml @@ -182,4 +182,18 @@ AND DEL_FLAG = 0 + + diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueDao.xml index 185816c9bb..90ecda4b20 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueDao.xml @@ -124,4 +124,20 @@ order by i.SHIFTED_TIME desc + + + \ No newline at end of file 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 0fa266afc8..60350c7a1e 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 @@ -22,7 +22,8 @@ cg.grid_name, CONCAT(ca.organization_name,'-',cg.grid_name) ) AS 'gridName', - cg.customer_id AS 'customerId' + cg.customer_id AS 'customerId', + cg.grid_name AS 'name' FROM customer_grid cg INNER JOIN customer_agency ca ON cg.pid = ca.id @@ -163,4 +164,16 @@ AND cg.pid = #{agencyId} + + + diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffAgencyDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffAgencyDao.xml index 55c4d7789c..ee8caafc3e 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffAgencyDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffAgencyDao.xml @@ -26,7 +26,23 @@ ca.organization_name, ca.level, ca.area_code, - ca.parent_area_code + ca.parent_area_code, + ( CASE WHEN ca.longitude is null THEN + ( SELECT longitude FROM customer_agency + WHERE del_flag = '0' AND customer_id = (SELECT customer_id FROM customer_agency WHERE id = ca.id) + ORDER BY pid ASC LIMIT 1 + ) + ELSE ca.longitude + END + ) longitude, + ( CASE WHEN ca.latitude is null THEN + ( SELECT latitude FROM customer_agency + WHERE del_flag = '0' AND customer_id = (SELECT customer_id FROM customer_agency WHERE id = ca.id) + ORDER BY pid ASC LIMIT 1 + ) + ELSE ca.latitude + END + ) latitude FROM customer_staff_agency csa INNER JOIN customer_agency ca ON csa.agency_id = ca.id diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectDao.xml index 1e144e3420..0282677e40 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectDao.xml @@ -155,4 +155,142 @@ AND rem.RED_DOT = '1' AND rem.USER_ID = #{userId} + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/opercustomize/CustomerFootBarDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/opercustomize/CustomerFootBarDao.xml index b412fd552f..51340127fc 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/opercustomize/CustomerFootBarDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/opercustomize/CustomerFootBarDao.xml @@ -38,4 +38,5 @@ and c.BAR_KEY=#{barKey} AND C.DISPLAY='1' + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/ResiTopicDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/ResiTopicDao.xml index bd46639c94..c2e54e14ae 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/ResiTopicDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/ResiTopicDao.xml @@ -22,4 +22,23 @@ #{topicId} + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/heart/VolunteerDemandServiceStatsResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/heart/VolunteerDemandServiceStatsResultDTO.java new file mode 100644 index 0000000000..2dfcb5426a --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/heart/VolunteerDemandServiceStatsResultDTO.java @@ -0,0 +1,41 @@ +package com.epmet.dto.result.heart; + +import lombok.Data; + +/** + * @Description 描述 + * @Author wangxianzhang + * @Date 2021/12/10 4:24 下午 + * @Version 1.0 + */ +@Data +public class VolunteerDemandServiceStatsResultDTO { + + private String customerId; + private String dateId; + /** + * 客户下志愿者总数 + */ + private Integer volunteerTotal; + /** + * 客户下志愿者中,党员数量 + */ + private Integer partyTotal; + /** + * 客户下志愿者中,居民数量 + */ + private Integer resiTotal; + /** + * 客户下志愿者服务总次数 + */ + private Integer serviceTotal; + /** + * 客户下党员志愿者服务次数 + */ + private Integer partyServiceTotal; + /** + * 客户下居民志愿者服务次数 + */ + private Integer resiServiceTotal; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/CompartmentResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/CompartmentResultDTO.java index 9e941152e4..52b0f9fa36 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/CompartmentResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/CompartmentResultDTO.java @@ -16,6 +16,11 @@ public class CompartmentResultDTO implements Serializable { private static final long serialVersionUID = 7963177476365327829L; + /** + * 组织对应的客户Id + */ + private String customerId = ""; + /** * 当前所选组织 */ diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/FineExampleResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/FineExampleResultDTO.java index d8b33c9d12..5826f74e94 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/FineExampleResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/FineExampleResultDTO.java @@ -87,4 +87,6 @@ public class FineExampleResultDTO implements Serializable { * PLAT_JOIN PARTY_RATIO 平台参与议事的党员占比 */ private String platJoinPartyRatio = "0.00%"; + + private String dataEndTime; } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GovernCapacityRankResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GovernCapacityRankResultDTO.java index bf6ae28829..4056d1976f 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GovernCapacityRankResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GovernCapacityRankResultDTO.java @@ -44,4 +44,6 @@ public class GovernCapacityRankResultDTO implements Serializable { * 当前agencyName的上一级组织名称 */ private String parentAgencyName; + + private String monthId; } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GovernCapacityResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GovernCapacityResultDTO.java index e749c0e218..be8c7d4398 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GovernCapacityResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GovernCapacityResultDTO.java @@ -46,4 +46,6 @@ public class GovernCapacityResultDTO implements Serializable { private String parentAgencyName; private String orgId; + + private String monthId; } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GrassRootsGovernRankResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GrassRootsGovernRankResultDTO.java index ac2072d44c..624868df62 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GrassRootsGovernRankResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GrassRootsGovernRankResultDTO.java @@ -39,4 +39,9 @@ public class GrassRootsGovernRankResultDTO implements Serializable { * 组织名称 */ private String orgName; + + /** + * 数据所属月份 + */ + private String monthId; } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GrassRootsGovernResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GrassRootsGovernResultDTO.java index 05b2e6c382..27be4bb8ce 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GrassRootsGovernResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GrassRootsGovernResultDTO.java @@ -35,4 +35,9 @@ public class GrassRootsGovernResultDTO implements Serializable { * 办结率(当前界面是社区时显示) */ private String closedProjectRatio; + + /** + * 数据所属月份 + */ + private String monthId; } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GrassRootsOrgRankResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GrassRootsOrgRankResultDTO.java index 61b7ab9b74..e6c3ee3971 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GrassRootsOrgRankResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GrassRootsOrgRankResultDTO.java @@ -31,4 +31,6 @@ public class GrassRootsOrgRankResultDTO implements Serializable { * 组织名称 */ private String orgName; + + private String monthId; } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GrassRootsOrgResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GrassRootsOrgResultDTO.java index d01bf5837e..8c4f0df674 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GrassRootsOrgResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GrassRootsOrgResultDTO.java @@ -27,4 +27,9 @@ public class GrassRootsOrgResultDTO implements Serializable { * 项目数 */ private Integer projectTotal; + + /** + * 数据所属月份 + */ + private String monthId; } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/OrgRankDataResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/OrgRankDataResultDTO.java index fa37c1f731..3319d73fd1 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/OrgRankDataResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/OrgRankDataResultDTO.java @@ -57,4 +57,8 @@ public class OrgRankDataResultDTO implements Serializable { private String parentAgencyName; private String orgId; + /** + * 数据所属月份 + */ + private String monthId; } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PartyUserPointResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PartyUserPointResultDTO.java index 3450a623a6..6e63822e65 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PartyUserPointResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PartyUserPointResultDTO.java @@ -28,4 +28,6 @@ public class PartyUserPointResultDTO implements Serializable { * 用户积分 * */ private Integer point; + + private String dataEndTime; } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PmTotalResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PmTotalResultDTO.java index aa5dcb67b5..2024fcd9d8 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PmTotalResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PmTotalResultDTO.java @@ -31,4 +31,9 @@ public class PmTotalResultDTO implements Serializable { * 议题数 */ private Integer issueTotal; + + /** + * 数据所属月份 + */ + private String monthId; } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ProjectProfileResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ProjectProfileResultDTO.java index 9e6b2d509e..a5f3f8ce4f 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ProjectProfileResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ProjectProfileResultDTO.java @@ -27,4 +27,6 @@ public class ProjectProfileResultDTO implements Serializable { * 级别 */ private String level; + + private String dataEndTime; } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PublicPartiProfileResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PublicPartiProfileResultDTO.java index e95933e1c1..793306dcbc 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PublicPartiProfileResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PublicPartiProfileResultDTO.java @@ -49,4 +49,8 @@ public class PublicPartiProfileResultDTO implements Serializable { private String joinCompareLatestTrend = ""; + /** + * 数据所属月份 + */ + private String monthId; } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ScoreListResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ScoreListResultDTO.java index 64d2b02a95..40db66a38b 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ScoreListResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ScoreListResultDTO.java @@ -44,6 +44,12 @@ public class ScoreListResultDTO implements Serializable { private Double subAgencyWeight; + /** + * 下级指数=indexTotalOriginScore-selfOriginScore + */ private Double subOriginScore; - + /** + * 下级指数,四舍五入,前端不用此值 + */ + private Double subOriginScoreBak; } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/TopProfileResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/TopProfileResultDTO.java index 55c281db6c..5d95da3a5e 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/TopProfileResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/TopProfileResultDTO.java @@ -42,4 +42,6 @@ public class TopProfileResultDTO implements Serializable { * 项目总数 */ private Integer projectNum = 0; + + private String dataEndTime; } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/form/CategoryProjectListFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/form/CategoryProjectListFormDTO.java new file mode 100644 index 0000000000..3da140aa04 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/form/CategoryProjectListFormDTO.java @@ -0,0 +1,49 @@ +package com.epmet.project.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/11/4 3:23 下午 + * @DESC + */ +@Data +public class CategoryProjectListFormDTO extends ProjectCategoryFormDTO implements Serializable { + + private static final long serialVersionUID = -5448734274886241594L; + + public interface CategoryProjectListForm{} + + + @NotNull(message = "pageSize不能为空",groups = CategoryProjectListForm.class) + private Integer pageSize; + + @NotNull(message = "pageNo不能为空",groups = CategoryProjectListForm.class) + private Integer pageNo; + + /** + * 项目状态:closed:已结案,all:全部 + */ + @NotNull(message = "status不能为空",groups = {CategoryProjectListForm.class, CategoryProjectExportForm.class}) + private String status; + + @NotNull(message = "categoryCode不能为空",groups = {CategoryProjectListForm.class, CategoryProjectExportForm.class}) + private String categoryCode; + + @NotNull(message = "categoryName不能为空",groups = CategoryProjectExportForm.class) + private String categoryName; + private String parentCategoryName; + + /** + * 组织ID + */ + private String orgId; + + /** + * 是否分页,默认true,false的时候 给导出用 + */ + private Boolean isPage = true; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/form/ProjectCategoryFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/form/ProjectCategoryFormDTO.java new file mode 100644 index 0000000000..c7a585ec6c --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/form/ProjectCategoryFormDTO.java @@ -0,0 +1,44 @@ +package com.epmet.project.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/11/4 3:18 下午 + * @DESC + */ +@Data +public class ProjectCategoryFormDTO implements Serializable { + + private static final long serialVersionUID = 5047143743629810527L; + + public interface ProjectCategoryForm{} + public interface CategoryProjectExportForm {} + + /** + * 组织ID + */ + private String orgId; + + /** + * 组织类型 组织:agency,网格:grid + */ + private String orgType; + + @NotBlank(message = "结束时间不能为空",groups = {ProjectCategoryForm.class,CategoryProjectExportForm.class}) + private String endTime; + + /** + * 开始时间 + */ + private String startTime; + + /** + * 组织名称 + */ + @NotBlank(message = "组织名称不能为空",groups = CategoryProjectExportForm.class) + private String orgName; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/CategoryProjectListResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/CategoryProjectListResultDTO.java new file mode 100644 index 0000000000..ec8694fd1b --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/CategoryProjectListResultDTO.java @@ -0,0 +1,86 @@ +package com.epmet.project.dto.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/11/4 3:31 下午 + * @DESC + */ +@Data +public class CategoryProjectListResultDTO implements Serializable { + + private static final long serialVersionUID = 8820354423099062062L; + + /** + * 分类 + */ + private String category; + + /** + * 项目状态:待处理 pending,结案closed + */ + private String projectStatus; + + /** + * 项目状态:待处理 pending,结案closed + */ + private String projectStatusDesc; + + /** + * 项目标题 + */ + private String projectTitle; + + /** + * 网格 + */ + private String gridName; + + /** + * 项目创建时间 + */ + private String createTime; + + /** + * 项目ID + */ + private String projectId; + + /** + * 上报人 + */ + private String linkName; + + /** + * 上报人电话 + */ + private String linkMobile; + + /** + * 事件地址 + */ + private String projectAddress; + + @JsonIgnore + private String orgId; + + @JsonIgnore + private String orgType; + + public CategoryProjectListResultDTO() { + this.category = ""; + this.projectStatus = ""; + this.projectStatusDesc = ""; + this.projectTitle = ""; + this.gridName = ""; + this.createTime = ""; + } + + public String getProjectStatusDesc() { + return "closed".equals(projectStatus)?"已结案":"处理中"; + } +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/PageCategoryProjectListResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/PageCategoryProjectListResultDTO.java new file mode 100644 index 0000000000..c17f00bf77 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/PageCategoryProjectListResultDTO.java @@ -0,0 +1,28 @@ +package com.epmet.project.dto.result; + +import com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2021/11/5 1:51 下午 + * @DESC + */ +@Data +public class PageCategoryProjectListResultDTO implements Serializable { + + private static final long serialVersionUID = 8822993169364931502L; + + private Integer total; + + private List list; + + public PageCategoryProjectListResultDTO() { + this.total = NumConstant.ZERO; + this.list = new ArrayList<>(); + } +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectCategoryResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectCategoryResultDTO.java new file mode 100644 index 0000000000..d51825c27b --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectCategoryResultDTO.java @@ -0,0 +1,80 @@ +package com.epmet.project.dto.result; + +import com.epmet.commons.tools.constant.NumConstant; +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2021/11/4 3:13 下午 + * @DESC + */ +@Data +public class ProjectCategoryResultDTO implements Serializable { + + private static final long serialVersionUID = -2662970383306349424L; + + /** + * 分类CODE + */ + private String categoryCode; + + /** + * 分类code父级 + */ + private String parentCategoryCode; + + /** + * 分类名字 + */ + private String categoryName; + + /** + * 分类名字父级 + */ + private String parentCategoryName; + + /** + * 项目总数 + */ + private Integer projectTotal; + + /** + * 结案项目数 + */ + private Integer closedProjectTotal; + + /** + * 所有项目总数 + */ + private Integer allProjectTotal; + + /** + * 总数占比 + */ + private String totalRatio; + + /** + * 结案率 + */ + private String closedRatio; + + private List children; + @JsonIgnore + private int index; + + public ProjectCategoryResultDTO() { + this.categoryCode = ""; + this.categoryName = ""; + this.projectTotal = NumConstant.ZERO; + this.closedProjectTotal = NumConstant.ZERO; + this.totalRatio = "0.00%"; + this.closedRatio = "0.00%"; + this.children = new ArrayList<>(); + this.allProjectTotal = NumConstant.ZERO; + } +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectCategorySonResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectCategorySonResultDTO.java new file mode 100644 index 0000000000..22cbbbd0bb --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectCategorySonResultDTO.java @@ -0,0 +1,56 @@ +package com.epmet.project.dto.result; + +import com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/11/4 3:13 下午 + * @DESC + */ +@Data +public class ProjectCategorySonResultDTO implements Serializable { + + private static final long serialVersionUID = -2662970383306349424L; + + /** + * 分类CODE + */ + private String categoryCode; + + /** + * 分类名字 + */ + private String categoryName; + + /** + * 项目总数 + */ + private Integer projectTotal; + + /** + * 结案项目数 + */ + private Integer closedProjectTotal; + + /** + * 总数占比 + */ + private String totalRatio; + + /** + * 结案率 + */ + private String closedRatio; + + public ProjectCategorySonResultDTO() { + this.categoryCode = ""; + this.categoryName = ""; + this.projectTotal = NumConstant.ZERO; + this.closedProjectTotal = NumConstant.ZERO; + this.totalRatio = ""; + this.closedRatio = ""; + } +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectDifficultRankResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectDifficultRankResultDTO.java index f3d1967599..0d6412a35d 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectDifficultRankResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectDifficultRankResultDTO.java @@ -3,6 +3,7 @@ package com.epmet.project.dto.result; import lombok.Data; import java.io.Serializable; +import java.math.BigDecimal; import java.util.List; /** @@ -61,4 +62,10 @@ public class ProjectDifficultRankResultDTO implements Serializable { * */ private Integer handledCount; + /** + * 项目评价分数 + * 直接取整数位展示 + */ + private BigDecimal score; + } diff --git a/epmet-module/data-report/data-report-server/deploy/docker-compose-prod.yml b/epmet-module/data-report/data-report-server/deploy/docker-compose-prod.yml index fa6f9d7f73..0f4b2974ec 100644 --- a/epmet-module/data-report/data-report-server/deploy/docker-compose-prod.yml +++ b/epmet-module/data-report/data-report-server/deploy/docker-compose-prod.yml @@ -2,17 +2,17 @@ version: "3.7" services: data-report-server: container_name: data-report-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/data-report-server:0.3.59 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/data-report-server:0.3.195 ports: - "8108:8108" network_mode: host # 使用现有网络 volumes: - "/opt/epmet-cloud-logs/prod:/logs" environment: - RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./data-report.jar" + RUN_INSTRUCT: "java -Xms256m -Xmx1024m -jar ./data-report.jar" restart: "unless-stopped" deploy: resources: limits: cpus: '0.1' - memory: 600M + memory: 1600M diff --git a/epmet-module/data-report/data-report-server/pom.xml b/epmet-module/data-report/data-report-server/pom.xml index 43c7bffcae..84e5f4d96f 100644 --- a/epmet-module/data-report/data-report-server/pom.xml +++ b/epmet-module/data-report/data-report-server/pom.xml @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - 0.3.59 + 0.3.195 data-report-server @@ -100,6 +100,12 @@ 2.0.0 compile + + com.alibaba + easyexcel + 3.0.3 + compile + @@ -116,6 +122,16 @@ true + + org.apache.maven.plugins + maven-resources-plugin + + + xls + xlsx + + + ${project.basedir}/src/main/java @@ -330,7 +346,7 @@ - false + true true diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/heart/DataReportHeartDemandController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/heart/DataReportHeartDemandController.java new file mode 100644 index 0000000000..86eabe2b3c --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/heart/DataReportHeartDemandController.java @@ -0,0 +1,38 @@ +package com.epmet.datareport.controller.heart; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.datareport.service.heart.DemandService; +import com.epmet.dto.result.heart.VolunteerDemandServiceStatsResultDTO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @Description 描述 + * @Author wangxianzhang + * @Date 2021/12/10 3:55 下午 + * @Version 1.0 + */ +@RestController +@RequestMapping("heart/demand") +public class DataReportHeartDemandController { + + @Autowired + private DemandService demandService; + + /** + * 查询志愿者需求服务统计信息 + * @param loginUser + * @return + */ + @PostMapping("volunteer/service") + public Result getVolunteerServiceStats(@LoginUser TokenDto loginUser) { + String customerId = loginUser.getCustomerId(); + VolunteerDemandServiceStatsResultDTO r = demandService.getVolunteerServiceStats(customerId); + return new Result().ok(r); + } + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/project/ProjectController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/project/ProjectController.java index 6f485e507e..abd9b25e92 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/project/ProjectController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/project/ProjectController.java @@ -11,6 +11,14 @@ import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectQuantity import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectQuantityOrgMonthlyService; import com.epmet.datareport.service.project.ProjectService; import com.epmet.dto.form.ProcessListFormDTO; +import com.epmet.dto.form.screen.EfficiencyAnalysisFormDTO; +import com.epmet.dto.form.screen.QueryQuantityMonthlyFormDTO; +import com.epmet.dto.form.screen.ScreenCommonFormDTO; +import com.epmet.dto.result.screen.EfficiencyAnalysisResultDTO; +import com.epmet.dto.result.screen.ProjectQuantityResultDTO; +import com.epmet.dto.result.screen.QueryQuantityMonthlyResultDTO; +import com.epmet.datareport.service.project.ProjectService; +import com.epmet.dto.form.ProcessListFormDTO; import com.epmet.dto.form.project.MassesDiscontentFormV2DTO; import com.epmet.dto.result.project.MassesDiscontentResultV2DTO; import com.epmet.project.constant.ProjectConstant; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java index 94cd036277..5b9e5c314d 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java @@ -1,5 +1,16 @@ package com.epmet.datareport.controller.screen; +import cn.afterturn.easypoi.excel.ExcelExportUtil; +import cn.afterturn.easypoi.excel.entity.TemplateExportParams; +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.ExcelWriter; +import com.alibaba.excel.write.metadata.WriteSheet; +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectOrgDailyService; @@ -12,13 +23,26 @@ import com.epmet.evaluationindex.screen.dto.form.ScreenProjectDetailFormDTO; import com.epmet.evaluationindex.screen.dto.form.ScreenProjectDistributionFormDTO; import com.epmet.evaluationindex.screen.dto.result.ProjectDetailResultDTO; import com.epmet.evaluationindex.screen.dto.result.ScreenProjectDistributionResultDTO; +import com.epmet.project.dto.form.CategoryProjectListFormDTO; import com.epmet.project.dto.form.CategoryTopAppealFormDTO; +import com.epmet.project.dto.form.ProjectCategoryFormDTO; import com.epmet.project.dto.result.CategoryTopAppealResultDTO; +import com.epmet.project.dto.result.PageCategoryProjectListResultDTO; +import com.epmet.project.dto.result.ProjectCategoryResultDTO; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.apache.poi.ss.usermodel.Workbook; +import org.jetbrains.annotations.NotNull; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import javax.servlet.http.HttpServletResponse; +import java.io.InputStream; +import java.net.URLEncoder; +import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; /** * 项目 @@ -155,4 +179,133 @@ public class ScreenProjectController { return new Result>().ok(screenProjectService.categoryTopAppeal(formDTO)); } + + /** + * @Description 【项目分类】查询项目分类 + * @param formDTO + * @param tokenDto + * @author zxc + * @date 2021/11/4 3:38 下午 + */ + @PostMapping("selectprojectcategory") + public Result> selectProjectCategory(@RequestBody ProjectCategoryFormDTO formDTO, @LoginUser TokenDto tokenDto){ + ValidatorUtils.validateEntity(formDTO, ProjectCategoryFormDTO.ProjectCategoryForm.class); + return new Result>().ok(screenProjectService.selectProjectCategory(formDTO,tokenDto)); + } + /** + * @Description 【项目分类】查询项目分类 + * @param formDTO + * @param tokenDto + * @author zxc + * @date 2021/11/4 3:38 下午 + */ + @PostMapping("selectprojectcategory/export") + public void selectProjectCategoryExport(@RequestBody ProjectCategoryFormDTO formDTO, @LoginUser TokenDto tokenDto, HttpServletResponse response) throws Exception { + //tokenDto.setUserId("36bc0fb38565ecdebf8ab9b476b44548"); + //tokenDto.setCustomerId("45687aa479955f9d06204d415238f7cc"); + ValidatorUtils.validateEntity(formDTO, ProjectCategoryFormDTO.CategoryProjectExportForm.class); + List data = screenProjectService.selectProjectCategory(formDTO, tokenDto); + String templatePath = "excel/project_category_temp.xlsx"; + + List resultDTOList = new ArrayList<>(); + data.forEach(e->{ + resultDTOList.add(e); + e.setIndex(1); + resultDTOList.addAll(ConvertUtils.sourceToTarget(e.getChildren(),ProjectCategoryResultDTO.class)); + }); + Map mapData = new HashMap<>(); + mapData.put("list",resultDTOList); + mapData.put("orgName", formDTO.getOrgName()); + mapData.put("exportDate",getExportDateStr(formDTO.getStartTime(),formDTO.getEndTime())); + Workbook workbook = ExcelExportUtil.exportExcel(new TemplateExportParams(templatePath), mapData); + response.setHeader("content-Type", "application/vnd.ms-excel"); + response.addHeader("Content-Disposition", "attachment;fileName=" + URLEncoder.encode("项目分类统计.xls", "UTF-8")); + workbook.write(response.getOutputStream()); + } + + /** + * @Description 【项目分类】查询分类下的项目 + * @param formDTO + * @param tokenDto + * @author zxc + * @date 2021/11/4 3:39 下午 + */ + @PostMapping("selectcategoryprojectlist") + public Result selectCategoryProjectList(@RequestBody CategoryProjectListFormDTO formDTO, @LoginUser TokenDto tokenDto){ + ValidatorUtils.validateEntity(formDTO, CategoryProjectListFormDTO.CategoryProjectListForm.class); + return new Result().ok(screenProjectService.selectCategoryProjectList(formDTO,tokenDto)); + } + + /** + * @Description 【项目分类】查询项目分类 + * @param formDTO + * @param tokenDto + * @author zxc + * @date 2021/11/4 3:38 下午 + */ + @PostMapping("selectcategoryprojectlist/export") + public void selectProjectCategoryExport(@RequestBody CategoryProjectListFormDTO formDTO, @LoginUser TokenDto tokenDto, HttpServletResponse response) throws Exception { + ExcelWriter excelWriter = null; + try { + //tokenDto.setUserId("36bc0fb38565ecdebf8ab9b476b44548"); + //tokenDto.setCustomerId("45687aa479955f9d06204d415238f7cc"); + formDTO.setPageNo(NumConstant.ONE); + formDTO.setPageSize(NumConstant.ONE_THOUSAND); + formDTO.setIsPage(false); + ValidatorUtils.validateEntity(formDTO, ProjectCategoryFormDTO.CategoryProjectExportForm.class); + + Map mapData = new HashMap<>(); + mapData.put("orgName", formDTO.getOrgName()); + mapData.put("exportDate", getExportDateStr(formDTO.getStartTime(), formDTO.getEndTime())); + mapData.put("categoryName", formDTO.getCategoryName()); + if (StringUtils.isNotBlank(formDTO.getParentCategoryName())) { + mapData.put("categoryName", formDTO.getParentCategoryName().concat(StrConstant.HYPHEN).concat(formDTO.getCategoryName())); + } + + String templatePath = "excel/project_temp_easy_excel.xlsx"; + InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream(templatePath); + + + //String template = this.getClass().getResource(templatePath).getPath(); + String fileName = "项目统计.xlsx"; + excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response)).withTemplate(inputStream).build(); + WriteSheet writeSheet = EasyExcel.writerSheet().build(); + excelWriter.fill(mapData, writeSheet); + + PageCategoryProjectListResultDTO data = null; + do { + data = screenProjectService.selectCategoryProjectList(formDTO, tokenDto); + if (data.getList().isEmpty()) { + break; + } + formDTO.setPageNo(formDTO.getPageNo() + 1); + excelWriter.fill(data.getList(), writeSheet); + data.getList().clear(); + } while (data.getList().size() == formDTO.getPageSize()); + +// String templatePath = "excel/project_temp.xlsx"; +// Workbook workbook = ExcelExportUtil.exportExcel(new TemplateExportParams(templatePath), mapData); +// response.setHeader("content-Type", "application/vnd.ms-excel"); +// response.addHeader("Content-Disposition", "attachment;fileName=" + URLEncoder.encode("项目统计.xls", "UTF-8")); +// workbook.write(response.getOutputStream()); + + } finally { + if (excelWriter != null) { + excelWriter.finish(); + } + } + } + + @NotNull + private String getExportDateStr(String startTime,String endTime) { + StringBuilder dateBuilder = new StringBuilder(); + if (StringUtils.isNotBlank(startTime)) { + dateBuilder.append(startTime).append(StrConstant.HYPHEN); + } + if (StringUtils.isNotBlank(endTime)) { + dateBuilder.append(endTime); + } + return dateBuilder.toString(); + } + } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java index 051a6ec3e6..5883d352e7 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java @@ -20,6 +20,7 @@ package com.epmet.datareport.dao.evaluationindex.screen; import com.epmet.dto.ScreenCustomerAgencyCommonDTO; import com.epmet.dto.ScreenCustomerGridDTO; import com.epmet.dto.result.ParentListResultDTO; +import com.epmet.dto.ScreenCustomerAgencyCommonDTO; import com.epmet.dto.result.ScreenCustomerAgencyDTO; import com.epmet.dto.result.plugins.AgencyNodeDTO; import com.epmet.dto.result.plugins.DeptNodeDTO; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.java index e3cf3d074d..93b6564f87 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.java @@ -19,7 +19,9 @@ package com.epmet.datareport.dao.evaluationindex.screen; import com.epmet.dto.result.screen.CategoryAnalysisResultDTO; import com.epmet.project.CustomerProjectCategoryDTO; +import com.epmet.project.dto.form.ProjectCategoryFormDTO; import com.epmet.project.dto.result.CategoryTopAppealResultDTO; +import com.epmet.project.dto.result.ProjectCategoryResultDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -52,4 +54,33 @@ public interface ScreenProjectCategoryOrgDailyDao { * @date 2021/8/18 1:40 下午 */ List categoryTopAppeal(@Param("agencyId") String agencyId,@Param("customerId")String customerId,@Param("topCount")Integer topCount); + + /** + * @Description 组织查询分类 + * @param customerId + * @param time + * @param orgId + * @author zxc + * @date 2021/11/5 8:54 上午 + */ + List selectProjectCategoryByAgency(@Param("customerId")String customerId,@Param("time")String time,@Param("orgId")String orgId); + + /** + * @Description 网格查询分类 + * @param customerId + * @param time + * @param orgId + * @author zxc + * @date 2021/11/5 8:55 上午 + */ + List selectProjectCategoryByGrid(@Param("customerId")String customerId,@Param("time")String time,@Param("orgId")String orgId); + + /** + * @Description 查询客户下所有分类 + * @param customerId + * @author zxc + * @date 2021/11/4 5:45 下午 + */ + List selectCategoryByCustomerId(@Param("customerId")String customerId); + } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectDataDao.java index 49797b9cb2..d20a3f1183 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectDataDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectDataDao.java @@ -3,6 +3,7 @@ package com.epmet.datareport.dao.evaluationindex.screen; import com.epmet.dto.result.screen.ColorProjectTotalResultDTO; import com.epmet.evaluationindex.screen.dto.result.ScreenProjectDetailResultDTO; import com.epmet.evaluationindex.screen.dto.result.ScreenProjectDistributionResultDTO; +import com.epmet.project.dto.result.CategoryProjectListResultDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -45,4 +46,16 @@ public interface ScreenProjectDataDao { * @date 2021/6/1 3:48 下午 */ List selectColorProjectByAreaCode(@Param("areaCode") String areaCode,@Param("monthCount")Integer monthCount); + + /** + * @Description 查询分类下的项目列表 + * @param customerId + * @param orgId + * @author zxc + * @date 2021/11/5 1:40 下午 + */ + List selectCategoryProjectList(@Param("orgId") String orgId, + @Param("categoryCode")String categoryCode,@Param("status")String status, + @Param("startTime")String startTime,@Param("endTime")String endTime); + } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectOrgDailyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectOrgDailyDao.java index 2a26119d9c..aeb20bdb97 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectOrgDailyDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectOrgDailyDao.java @@ -19,6 +19,7 @@ package com.epmet.datareport.dao.evaluationindex.screen; import com.epmet.dto.result.screen.EfficiencyAnalysisResultDTO; import com.epmet.dto.result.screen.ProjectQuantityResultDTO; +import com.epmet.project.dto.form.ProjectCategoryFormDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -45,4 +46,9 @@ public interface ScreenProjectOrgDailyDao { * @description 下级组织的效率(解决率)列表 **/ List queryEfficiencyAnalysis(@Param("customerId")String customerId,@Param("areaCode") String areaCode); + + Integer selectProjectTotalByAgency(@Param("customerId")String customerId,@Param("time")String time,@Param("orgId")String orgId); + + Integer selectProjectTotalByGrid(@Param("customerId")String customerId,@Param("time")String time,@Param("orgId")String orgId); + } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactVolunteerServiceDailyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactVolunteerServiceDailyDao.java new file mode 100644 index 0000000000..fd4d28afb0 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactVolunteerServiceDailyDao.java @@ -0,0 +1,43 @@ +/** + * 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.datareport.dao.fact; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.datareport.entity.heart.FactVolunteerServiceDailyEntity; +import com.epmet.dto.result.heart.VolunteerDemandServiceStatsResultDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 志愿者服务情况统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-12-08 + */ +@Mapper +public interface FactVolunteerServiceDailyDao extends BaseDao { + + /** + * 查询最新一条"志愿者需求服务统计信息" + * @param customerId + * @return + */ + VolunteerDemandServiceStatsResultDTO getLatestVolunteerDemandServiceStats(@Param("customerId") String customerId); +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/heart/FactVolunteerServiceDailyEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/heart/FactVolunteerServiceDailyEntity.java new file mode 100644 index 0000000000..a668e52a63 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/heart/FactVolunteerServiceDailyEntity.java @@ -0,0 +1,83 @@ +/** + * 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.datareport.entity.heart; + +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 2021-12-08 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_volunteer_service_daily") +public class FactVolunteerServiceDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * yyyyMMdd + */ + private String dateId; + + /** + * yyyyMM + */ + private String monthId; + + /** + * 截止到当前dateId,当前客户下,共有多少个爱心互助的志愿者 + */ + private Integer volunteerTotal; + + /** + * 截止到当前dateId,当前客户下,XX个爱心互助志愿者中,党员有多少个 + */ + private Integer partyTotal; + + /** + * 截止到当前dateId,当前客户下,XX个爱心互助志愿者中,居民有多少个 + */ + private Integer resiTotal; + + /** + * 服务总次数 + */ + private Integer serviceTotal; + + /** + * 党员服务总次数 + */ + private Integer partyServiceTotal; + + /** + * 居民服务总次数 + */ + private Integer resiServiceTotal; + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenProjectService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenProjectService.java index e8d9110198..2f268cd35e 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenProjectService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenProjectService.java @@ -1,5 +1,6 @@ package com.epmet.datareport.service.evaluationindex.screen; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.screen.CategoryAnalysisFormDTO; import com.epmet.dto.form.screen.ColorProjectTotalFormDTO; @@ -10,8 +11,13 @@ import com.epmet.evaluationindex.screen.dto.form.ScreenProjectDetailFormDTO; import com.epmet.evaluationindex.screen.dto.form.ScreenProjectDistributionFormDTO; import com.epmet.evaluationindex.screen.dto.result.ProjectDetailResultDTO; import com.epmet.evaluationindex.screen.dto.result.ScreenProjectDistributionResultDTO; +import com.epmet.project.dto.form.CategoryProjectListFormDTO; import com.epmet.project.dto.form.CategoryTopAppealFormDTO; +import com.epmet.project.dto.form.ProjectCategoryFormDTO; +import com.epmet.project.dto.result.CategoryProjectListResultDTO; import com.epmet.project.dto.result.CategoryTopAppealResultDTO; +import com.epmet.project.dto.result.PageCategoryProjectListResultDTO; +import com.epmet.project.dto.result.ProjectCategoryResultDTO; import java.util.List; @@ -62,4 +68,24 @@ public interface ScreenProjectService { */ List categoryTopAppeal(CategoryTopAppealFormDTO formDTO); + + /** + * @Description 【项目分类】查询项目分类 + * @param formDTO + * @param tokenDto + * @author zxc + * @date 2021/11/4 3:38 下午 + */ + List selectProjectCategory(ProjectCategoryFormDTO formDTO, TokenDto tokenDto); + + /** + * @Description 【项目分类】查询分类下的项目 + * @param formDTO + * @param tokenDto + * @author zxc + * @date 2021/11/4 3:39 下午 + */ + PageCategoryProjectListResultDTO selectCategoryProjectList(CategoryProjectListFormDTO formDTO, TokenDto tokenDto); + + } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassRootsGovernServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassRootsGovernServiceImpl.java index 45eeb51736..18978f6e23 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassRootsGovernServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassRootsGovernServiceImpl.java @@ -190,6 +190,7 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService { result.setMonthIncr(convertPercentStr(latest.getMonthIncr(), NumConstant.ZERO)); result.setJoinCompareLatestMonth(convertPercentStr(latest.getJoinCompareLatestMonth().abs(), NumConstant.ZERO)); result.setIssueCompareLatestMonth(convertPercentStr(latest.getIssueCompareLatestMonth().abs(), NumConstant.ZERO)); + result.setMonthId(monthId); return result; } @@ -242,34 +243,41 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService { @Override public List governCapacityRank(AgencyAndNumFormDTO param) { List orderList = new ArrayList<>(); - if(null == param.getTopNum()) param.setTopNum(NumConstant.FIVE); - if(NumConstant.ZERO == param.getTopNum()) param.setTopNum(NumConstant.MAX); + if(null == param.getTopNum()) { + param.setTopNum(NumConstant.FIVE); + } + if(NumConstant.ZERO == param.getTopNum()) { + param.setTopNum(NumConstant.MAX); + } PageHelper.startPage(NumConstant.ONE,param.getTopNum()); - String monthId = dateUtils.getCurrentMonthId(); + String dateId = com.epmet.commons.tools.utils.DateUtils.getBeforeNDay(NumConstant.ONE); + if (StringUtils.isNotEmpty(param.getAreaCode())){ List nextAgencyIds = screenCustomerAgencyService.getNextAgencyIds(param.getAreaCode(), param.getAgencyId()); if (CollectionUtils.isEmpty(nextAgencyIds)){ return new ArrayList<>(); } - orderList = screenGovernRankDataDao.selectGovernCapacityRatioNew(monthId,nextAgencyIds); - int time = NumConstant.TWELVE; - while(CollectionUtils.isEmpty(orderList) && time > NumConstant.ONE){ - time--; - monthId = dateUtils.getPreviousMonthIdByDest(null ,monthId); + orderList = screenGovernRankDataDao.selectGovernCapacityRatioNew(dateId,nextAgencyIds); + int time = NumConstant.ONE; + while(CollectionUtils.isEmpty(orderList) && time < NumConstant.TEN){ + time++; + dateId = com.epmet.commons.tools.utils.DateUtils.getBeforeNDay(time); PageHelper.startPage(NumConstant.ONE,param.getTopNum()); - orderList = screenGovernRankDataDao.selectGovernCapacityRatioNew(monthId,nextAgencyIds); + orderList = screenGovernRankDataDao.selectGovernCapacityRatioNew(dateId,nextAgencyIds); } }else { - orderList = screenGovernRankDataDao.selectGovernCapacityRatio(monthId, param.getAgencyId()); - int time = NumConstant.TWELVE; - while (CollectionUtils.isEmpty(orderList) && time > NumConstant.ONE) { - time--; - monthId = dateUtils.getPreviousMonthIdByDest(null, monthId); + orderList = screenGovernRankDataDao.selectGovernCapacityRatio(dateId, param.getAgencyId()); + int time = NumConstant.ONE; + while (CollectionUtils.isEmpty(orderList) && time < NumConstant.TEN) { + time++; + dateId = com.epmet.commons.tools.utils.DateUtils.getBeforeNDay(time); PageHelper.startPage(NumConstant.ONE, param.getTopNum()); - orderList = screenGovernRankDataDao.selectGovernCapacityRatio(monthId, param.getAgencyId()); + orderList = screenGovernRankDataDao.selectGovernCapacityRatio(dateId, param.getAgencyId()); } } - if(null == orderList || orderList.isEmpty()) return new ArrayList<>(); + if(null == orderList || orderList.isEmpty()) { + return new ArrayList<>(); + } List result = new LinkedList<>(); orderList.forEach(o -> { GovernCapacityRankResultDTO rank = new GovernCapacityRankResultDTO(); @@ -279,6 +287,7 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService { rank.setResponseRatio(convertPercentStr(o.getResponseRatio(),NumConstant.ONE)); rank.setSatisfactionRatio(convertPercentStr(o.getSatisfactionRatio(),NumConstant.ONE)); rank.setParentAgencyName(o.getParentAgencyName()); + rank.setMonthId(o.getMonthId()); result.add(rank); }); return result; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java index aa6c86490c..209e776ee7 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java @@ -264,6 +264,7 @@ public class IndexServiceImpl implements IndexService { indexRank.setServiceAbility(getRound(indexRank.getServiceAbility())); indexRank.setTotalIndex(getRound(indexRank.getPartyDevAbility() + indexRank.getGovernAbility() + indexRank.getServiceAbility())); }); + subAgencyIndexRankResultDTOS.sort(Comparator.comparing(SubAgencyIndexRankResultDTO::getTotalIndex).reversed()); return subAgencyIndexRankResultDTOS; } @@ -297,6 +298,7 @@ public class IndexServiceImpl implements IndexService { rank.setTotalIndex(getRound(rank.getPartyDevAbility() + rank.getGovernAbility() + rank.getServiceAbility())); }); } + subAgencyIndexRankResultDTOS.sort(Comparator.comparing(AnNingSubAgencyIndexRankResultDTO::getTotalIndex).reversed()); return subAgencyIndexRankResultDTOS; } @@ -316,6 +318,7 @@ public class IndexServiceImpl implements IndexService { indexRank.setServiceAbility(getRound(indexRank.getServiceAbility())); indexRank.setTotalIndex(getRound(indexRank.getPartyDevAbility() + indexRank.getGovernAbility() + indexRank.getServiceAbility())); }); + subAgencyIndexRankResultDTOS.sort(Comparator.comparing(SubAgencyIndexRankResultDTO::getTotalIndex).reversed()); return subAgencyIndexRankResultDTOS; } @@ -437,6 +440,7 @@ public class IndexServiceImpl implements IndexService { indexRank.setOrgType("street"); indexRank.setTotalIndex(getRound(indexRank.getPartyDevAbility() + indexRank.getGovernAbility() + indexRank.getServiceAbility())); }); + streetList.sort(Comparator.comparing(SubAgencyIndexRankResultDTO::getTotalIndex).reversed()); return streetList; } // 网格会根据中央区选择具体某个街道,变化 @@ -446,6 +450,7 @@ public class IndexServiceImpl implements IndexService { indexRank.setOrgType("grid"); indexRank.setTotalIndex(getRound(indexRank.getPartyDevAbility() + indexRank.getGovernAbility() + indexRank.getServiceAbility())); }); + gridList.sort(Comparator.comparing(SubAgencyIndexRankResultDTO::getTotalIndex).reversed()); return gridList; } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java index a23152697e..a40da16683 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java @@ -3,14 +3,19 @@ package com.epmet.datareport.service.evaluationindex.screen.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.AppClientConstant; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.redis.common.CustomerOrgRedis; import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; +import com.epmet.commons.tools.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.DateUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.DataSourceConstant; -import com.epmet.datareport.dao.evaluationindex.screen.ScreenEventDataDao; -import com.epmet.datareport.dao.evaluationindex.screen.ScreenEventImgDataDao; -import com.epmet.datareport.dao.evaluationindex.screen.ScreenProjectCategoryOrgDailyDao; -import com.epmet.datareport.dao.evaluationindex.screen.ScreenProjectDataDao; +import com.epmet.datareport.constant.FactConstant; +import com.epmet.datareport.dao.evaluationindex.screen.*; import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectService; import com.epmet.dto.UserDTO; import com.epmet.dto.form.CustomerAgencyUserRoleFormDTO; @@ -26,15 +31,21 @@ import com.epmet.evaluationindex.screen.dto.result.ScreenProjectDetailResultDTO; import com.epmet.evaluationindex.screen.dto.result.ScreenProjectDistributionResultDTO; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.project.CustomerProjectCategoryDTO; +import com.epmet.project.dto.form.CategoryProjectListFormDTO; import com.epmet.project.dto.form.CategoryTopAppealFormDTO; -import com.epmet.project.dto.result.CategoryTopAppealResultDTO; +import com.epmet.project.dto.form.ProjectCategoryFormDTO; +import com.epmet.project.dto.result.*; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; +import java.math.BigDecimal; import java.util.ArrayList; +import java.util.Comparator; import java.util.List; import java.util.Map; import java.util.stream.Collectors; @@ -63,6 +74,9 @@ public class ScreenProjectServiceImpl implements ScreenProjectService { @Autowired private EpmetUserOpenFeignClient userOpenFeignClient; + @Autowired + private ScreenProjectOrgDailyDao screenProjectOrgDailyDao; + /** * @Description 3、项目详情 * @param projectDetailFormDTO @@ -159,7 +173,7 @@ public class ScreenProjectServiceImpl implements ScreenProjectService { List resultList = new ArrayList<>(); if (!CollectionUtils.isEmpty(resultDTOList)) { for (CategoryAnalysisResultDTO dto : resultDTOList) { - CustomerProjectCategoryDTO projectCategoryDTO = screenProjectCategoryOrgDailyDao.selectProjectCategory(dto.getCategoryCode(), dto.getCategoryOriginCustomerId()); + CustomerProjectCategoryDTO projectCategoryDTO = screenProjectCategoryOrgDailyDao.selectProjectCategory(dto.getCategoryCode(), customerId); if (null == projectCategoryDTO || StringUtils.isBlank(projectCategoryDTO.getCategoryName())) { log.warn(String.format("查询分类名称失败,当前客户:%s, categoryCode:%s", dto.getCategoryCode(), customerId)); continue; @@ -219,7 +233,7 @@ public class ScreenProjectServiceImpl implements ScreenProjectService { return new ArrayList<>(); } for (CategoryTopAppealResultDTO r : result) { - CustomerProjectCategoryDTO projectCategoryDTO = screenProjectCategoryOrgDailyDao.selectProjectCategory(r.getCategoryId(), r.getCategoryOriginCustomerId()); + CustomerProjectCategoryDTO projectCategoryDTO = screenProjectCategoryOrgDailyDao.selectProjectCategory(r.getCategoryId(), customerId); if (null == projectCategoryDTO || StringUtils.isBlank(projectCategoryDTO.getCategoryName())) { log.warn(String.format("查询分类名称失败,当前客户:%s, categoryCode:%s", r.getCategoryId(), r.getCategoryOriginCustomerId())); continue; @@ -228,4 +242,167 @@ public class ScreenProjectServiceImpl implements ScreenProjectService { } return result; } + + + /** + * @Description 【项目分类】查询项目分类 + * 二级分类总数占比改为 二级分类总数/一级分类总数 + * @param formDTO + * @param tokenDto + * @author zxc + * @date 2021/11/4 3:38 下午 + */ + @Override + public List selectProjectCategory(ProjectCategoryFormDTO formDTO, TokenDto tokenDto) { + if (StringUtils.isNotBlank(formDTO.getStartTime())){ + formDTO.setStartTime(DateUtils.getBeforeNDay(formDTO.getStartTime(),NumConstant.ONE)); + } + if (StringUtils.isBlank(formDTO.getOrgId())){ + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); + if (null == staffInfo){ + throw new RenException("未查询到此工作人员的所属组织信息..."); + } + formDTO.setOrgId(staffInfo.getAgencyId()); + formDTO.setOrgType(FactConstant.AGENCY); + } + String customerId = tokenDto.getCustomerId(); + String endTime = formDTO.getEndTime(); + String startTime = formDTO.getStartTime(); + String orgId = formDTO.getOrgId(); + // 查询客户下的所有分类 + List result = screenProjectCategoryOrgDailyDao.selectCategoryByCustomerId(tokenDto.getCustomerId()); + List endCategoryList = new ArrayList<>(); + if (formDTO.getOrgType().equals(FactConstant.GRID)){ + Integer endTotal = screenProjectOrgDailyDao.selectProjectTotalByGrid(customerId, endTime, orgId); + endTotal = null == endTotal ? NumConstant.ZERO : endTotal; + endCategoryList = screenProjectCategoryOrgDailyDao.selectProjectCategoryByGrid(customerId,endTime,orgId); + Integer total = endTotal; + if (StringUtils.isNotBlank(startTime)){ + Integer startTotal = screenProjectOrgDailyDao.selectProjectTotalByGrid(customerId, startTime, orgId); + startTotal = null == startTotal ? NumConstant.ZERO : startTotal; + total = endTotal - startTotal; + List startCategoryList = screenProjectCategoryOrgDailyDao.selectProjectCategoryByGrid(customerId,startTime,orgId); + endCategoryList.forEach(e -> startCategoryList.stream().filter(s -> e.getCategoryCode().equals(s.getCategoryCode())).forEach(s -> e.setProjectTotal(subtract(e.getProjectTotal(),s.getProjectTotal())))); + endCategoryList.forEach(e -> startCategoryList.stream().filter(s -> e.getCategoryCode().equals(s.getCategoryCode())).forEach(s -> e.setClosedProjectTotal(subtract(e.getClosedProjectTotal(),s.getClosedProjectTotal())))); + } + Integer finalTotal = total; + endCategoryList.forEach(e -> { + e.setTotalRatio(ratio(e.getProjectTotal(), finalTotal)); + e.setClosedRatio(ratio(e.getClosedProjectTotal(),e.getProjectTotal())); + e.setAllProjectTotal(finalTotal); + }); + }else { + Integer endTotal = screenProjectOrgDailyDao.selectProjectTotalByAgency(customerId, endTime, orgId); + endTotal = null == endTotal ? NumConstant.ZERO : endTotal; + endCategoryList = screenProjectCategoryOrgDailyDao.selectProjectCategoryByAgency(customerId,endTime,orgId); + Integer total = endTotal; + if (StringUtils.isNotBlank(startTime)){ + Integer startTotal = screenProjectOrgDailyDao.selectProjectTotalByAgency(customerId, startTime, orgId); + startTotal = null == startTotal ? NumConstant.ZERO : startTotal; + total = endTotal - startTotal; + List startCategoryList = screenProjectCategoryOrgDailyDao.selectProjectCategoryByAgency(customerId,startTime,orgId); + endCategoryList.forEach(e -> startCategoryList.stream().filter(s -> e.getCategoryCode().equals(s.getCategoryCode())).forEach(s -> e.setProjectTotal(subtract(e.getProjectTotal(),s.getProjectTotal())))); + endCategoryList.forEach(e -> startCategoryList.stream().filter(s -> e.getCategoryCode().equals(s.getCategoryCode())).forEach(s -> e.setClosedProjectTotal(subtract(e.getClosedProjectTotal(),s.getClosedProjectTotal())))); + } + Integer finalTotal = total; + endCategoryList.forEach(e -> { + e.setTotalRatio(ratio(e.getProjectTotal(), finalTotal)); + e.setClosedRatio(ratio(e.getClosedProjectTotal(),e.getProjectTotal())); + e.setAllProjectTotal(finalTotal); + }); + } + List finalEndCategoryList = endCategoryList; + result.forEach(r -> { + finalEndCategoryList.stream().filter(e -> r.getCategoryCode().equals(e.getCategoryCode())).forEach(e -> { + r.setTotalRatio(e.getTotalRatio());r.setClosedRatio(e.getClosedRatio()); + r.setProjectTotal(e.getProjectTotal()); + r.setClosedProjectTotal(e.getClosedProjectTotal()); + r.setAllProjectTotal(e.getAllProjectTotal()); + }); + r.getChildren().forEach(son -> finalEndCategoryList.stream().filter(e -> son.getCategoryCode().equals(e.getCategoryCode())).forEach(e -> { + son.setTotalRatio(e.getTotalRatio());son.setClosedRatio(e.getClosedRatio()); + son.setProjectTotal(e.getProjectTotal());son.setClosedProjectTotal(e.getClosedProjectTotal()); + son.setAllProjectTotal(e.getAllProjectTotal()); + })); + }); + // 排序 + List collect = result.stream().sorted(Comparator.comparing(ProjectCategoryResultDTO::getProjectTotal).reversed()).collect(Collectors.toList()); + collect.forEach(c -> { + c.setChildren(c.getChildren().stream().sorted(Comparator.comparing(ProjectCategoryResultDTO::getProjectTotal).reversed()).collect(Collectors.toList())); + }); + collect.forEach(p -> { + p.getChildren().forEach(c -> { + c.setTotalRatio(ratio(c.getProjectTotal(), p.getProjectTotal())); + }); + }); + return collect; + } + + /** + * @Description 俩数相减,小于0就赋值为0 + * @param end + * @param start + * @author zxc + * @date 2021/11/5 9:18 上午 + */ + public Integer subtract(Integer end,Integer start){ + return end - start < NumConstant.ZERO ? NumConstant.ZERO : end - start; + } + + /** + * @Description 返回占比,保留小数点2位 + * @param molecule 分子 + * @param denominator 分母 + * @author zxc + * @date 2021/11/5 9:26 上午 + */ + public String ratio(Integer molecule, Integer denominator){ + if (denominator == NumConstant.ZERO){ + return "0.00%"; + } + BigDecimal bigDecimalMolecule = new BigDecimal(molecule * NumConstant.ONE_HUNDRED); + BigDecimal bigDecimalDenominator = new BigDecimal(denominator); + BigDecimal divide = bigDecimalMolecule.divide(bigDecimalDenominator, NumConstant.TWO, BigDecimal.ROUND_HALF_UP); + return divide+"%"; + } + + /** + * @Description 【项目分类】查询分类下的项目 + * @param formDTO + * @param tokenDto + * @author zxc + * @date 2021/11/4 3:39 下午 + */ + @Override + public PageCategoryProjectListResultDTO selectCategoryProjectList(CategoryProjectListFormDTO formDTO, TokenDto tokenDto) { + if (StringUtils.isBlank(formDTO.getOrgId())){ + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); + if (null == staffInfo){ + throw new RenException("未查询到此工作人员的所属组织信息..."); + } + formDTO.setOrgId(staffInfo.getAgencyId()); + formDTO.setOrgType(FactConstant.AGENCY); + } + PageCategoryProjectListResultDTO result = new PageCategoryProjectListResultDTO(); + List list; + PageInfo objectPageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()) + .doSelectPageInfo(() -> screenProjectDataDao.selectCategoryProjectList(formDTO.getOrgId(), formDTO.getCategoryCode(), formDTO.getStatus(),formDTO.getStartTime(),formDTO.getEndTime())); + list = objectPageInfo.getList(); + result.setTotal(Integer.valueOf(String.valueOf(objectPageInfo.getTotal()))); + + if (!CollectionUtils.isEmpty(list)){ + list.forEach(l -> { + if (l.getOrgType().equals(FactConstant.AGENCY)){ + AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(l.getOrgId()); + l.setGridName(agencyInfo.getOrganizationName()); + }else { + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(l.getOrgId()); + l.setGridName(gridInfo.getGridNamePath()); + } + }); + } + result.setList(list); + return result; + } + } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/impl/FactIndexServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/impl/FactIndexServiceImpl.java index 80d2161ebb..a8dcf880d2 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/impl/FactIndexServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/impl/FactIndexServiceImpl.java @@ -305,7 +305,8 @@ public class FactIndexServiceImpl implements FactIndexService { //3.根据组织级别拼接查询条件,判断查询不同数据表 //区县级、乡镇街道级 if ("district".equals(agency.getAgencyLevel()) || "street".equals(agency.getAgencyLevel())) { - if ("district".equals(agency.getAgencyLevel())) { + //这里 给孔村镇街道降级为 街道 + if ("district".equals(agency.getAgencyLevel()) && !"2fe0065f70ca0e23ce4c26fca5f1d933".equals(agency.getCustomerId())) { formDTO.setAllParentIndexCode(FactConstant.QUAN_QU_XIANG_GUAN + ":" + formDTO.getIndexCode()); } else { formDTO.setAllParentIndexCode(FactConstant.JIE_DAO_XIANG_GUAN + ":" + formDTO.getIndexCode()); @@ -336,7 +337,7 @@ public class FactIndexServiceImpl implements FactIndexService { list.stream().filter(dto -> dto.getIndexCode().equals(result.getKey())).forEach(l -> { result.setShowType(l.getValueType()); //整数 - if (FactConstant.DECIMAL.equals(l.getValueType())) { + if (FactConstant.INTEGER.equals(l.getValueType())) { BigDecimal num = new BigDecimal(result.getValue()).setScale(0, BigDecimal.ROUND_HALF_UP); result.setValue(num.toString()); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/heart/DemandService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/heart/DemandService.java new file mode 100644 index 0000000000..ccbbb319a1 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/heart/DemandService.java @@ -0,0 +1,13 @@ +package com.epmet.datareport.service.heart; + +import com.epmet.dto.result.heart.VolunteerDemandServiceStatsResultDTO; + +/** + * @Description 需求服务 + * @Author wangxianzhang + * @Date 2021/12/10 4:18 下午 + * @Version 1.0 + */ +public interface DemandService { + VolunteerDemandServiceStatsResultDTO getVolunteerServiceStats(String customerId); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/heart/impl/DemandServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/heart/impl/DemandServiceImpl.java new file mode 100644 index 0000000000..79ba0274ea --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/heart/impl/DemandServiceImpl.java @@ -0,0 +1,29 @@ +package com.epmet.datareport.service.heart.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.constant.DataSourceConstant; +import com.epmet.datareport.dao.fact.FactVolunteerServiceDailyDao; +import com.epmet.datareport.entity.heart.FactVolunteerServiceDailyEntity; +import com.epmet.datareport.service.heart.DemandService; +import com.epmet.dto.result.heart.VolunteerDemandServiceStatsResultDTO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * @Description 需求服务 + * @Author wangxianzhang + * @Date 2021/12/10 4:20 下午 + * @Version 1.0 + */ +@Service +public class DemandServiceImpl implements DemandService { + + @Autowired + private FactVolunteerServiceDailyDao factVolunteerServiceDailyDao; + + @Override + public VolunteerDemandServiceStatsResultDTO getVolunteerServiceStats(String customerId) { + return factVolunteerServiceDailyDao.getLatestVolunteerDemandServiceStats(customerId); + } +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/impl/ProjectServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/impl/ProjectServiceImpl.java index 070fcca43a..55e0d3c7c0 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/impl/ProjectServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/impl/ProjectServiceImpl.java @@ -211,7 +211,7 @@ public class ProjectServiceImpl implements ProjectService { } /** - * @Description 项目详情 + * @Description 项目详情 * @Param processListFormDTO * @author zxc * @date 2020/10/23 10:33 上午 @@ -285,9 +285,9 @@ public class ProjectServiceImpl implements ProjectService { } /** + * @return * @Description 难点赌点-获取组织下拉框 * @NEI https://nei.netease.com/interface/detail/res/?pid=57068&id=321614 - * @return * @author jiangyy * @date 2020.10.19 16:38 **/ @@ -297,7 +297,7 @@ public class ProjectServiceImpl implements ProjectService { //1、根据token获取本级agencyId、获取userId String agencyId = getLoginUserDetails(tokenDto); - String userId=getLoginUserUserId(tokenDto); + String userId = getLoginUserUserId(tokenDto); //2、获取本级组织机构 Result customerAgencyDTO = govOrgOpenFeignClient.getAgencyById(agencyId); @@ -328,7 +328,7 @@ public class ProjectServiceImpl implements ProjectService { Result SubAgencyResultDTO = govOrgOpenFeignClient.subAgencyList(form); List subAgencyList = SubAgencyResultDTO.getData().getAgencyList(); - for(int i=0;i(); + if (null == resultList) return new ArrayList<>(); return resultList; } /** - * @Description 难点赌点-耗时最长|涉及部门最多|处理次数 - * @NEI https://nei.netease.com/interface/detail/res/?pid=57068&id=321614 * @param param * @return + * @Description 难点赌点-耗时最长|涉及部门最多|处理次数 + * @NEI https://nei.netease.com/interface/detail/res/?pid=57068&id=321614 * @author jiangyy * @date 2020.10.19 16:38 **/ - @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override public List getDifficultyRank(DifficultyRankFormDTO param) { PageHelper.startPage(null == param.getPageNo() ? NumConstant.ONE:param.getPageNo(),param.getTopNum()); List result = projectDao.difficultyRank(param); - for (int i = 0; i < result.size (); i ++){ - List imgUrlList ; - imgUrlList = projectDao.getDifficultyImgList(result.get(i).getProjectId()) ; + for (int i = 0; i < result.size(); i++) { + List imgUrlList; + imgUrlList = projectDao.getDifficultyImgList(result.get(i).getProjectId()); result.get(i).setImgUrlList(imgUrlList); } - if(null == result) return new ArrayList<>(); + if (null == result) return new ArrayList<>(); return result; } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/impl/UserAnalysisServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/impl/UserAnalysisServiceImpl.java index 7e7e2864dd..7b6e81d2e0 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/impl/UserAnalysisServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/impl/UserAnalysisServiceImpl.java @@ -200,13 +200,14 @@ public class UserAnalysisServiceImpl implements UserAnalysisService { logger.info("机关名:"+m.getName()+",总数="+m.getTotal()); } //2021.5.25 平音客户热心居民改网格员 sun start - if (StrConstant.PY_CUSTOMER.equals(tokenDto.getCustomerId())) { + //2021.121.17 应胡科家要求在改回去 + /*if (StrConstant.PY_CUSTOMER.equals(tokenDto.getCustomerId())) { dimList.forEach(d->{ if("热心居民".equals(d.getType())){ d.setType("网格员"); } }); - } + }*/ //2021.5.25 平音客户热心居民改网格员 sun end return dimList; } @@ -333,13 +334,14 @@ public class UserAnalysisServiceImpl implements UserAnalysisService { logger.info("网格名:"+m.getName()+",总数="+m.getTotal()); } //2021.5.25 平音客户热心居民改网格员 sun start - if (StrConstant.PY_CUSTOMER.equals(tokenDto.getCustomerId())) { + //2021.121.17 应胡科家要求在改回去 + /*if (StrConstant.PY_CUSTOMER.equals(tokenDto.getCustomerId())) { dimList.forEach(d->{ if("热心居民".equals(d.getType())){ d.setType("网格员"); } }); - } + }*/ //2021.5.25 平音客户热心居民改网格员 sun end return dimList; } @@ -507,13 +509,14 @@ public class UserAnalysisServiceImpl implements UserAnalysisService { resultList.add(party); } //2021.5.25 平音客户热心居民改网格员 sun start - if (StrConstant.PY_CUSTOMER.equals(tokenDto.getCustomerId())) { + //2021.121.17 应胡科家要求在改回去 + /*if (StrConstant.PY_CUSTOMER.equals(tokenDto.getCustomerId())) { resultList.forEach(d->{ if("热心居民".equals(d.getType())){ d.setType("网格员"); } }); - } + }*/ //2021.5.25 平音客户热心居民改网格员 sun end return resultList; } diff --git a/epmet-module/data-report/data-report-server/src/main/resources/excel/project_category_temp.xlsx b/epmet-module/data-report/data-report-server/src/main/resources/excel/project_category_temp.xlsx new file mode 100644 index 0000000000..6054a88289 Binary files /dev/null and b/epmet-module/data-report/data-report-server/src/main/resources/excel/project_category_temp.xlsx differ diff --git a/epmet-module/data-report/data-report-server/src/main/resources/excel/project_temp.xlsx b/epmet-module/data-report/data-report-server/src/main/resources/excel/project_temp.xlsx new file mode 100644 index 0000000000..743bd60ecc Binary files /dev/null and b/epmet-module/data-report/data-report-server/src/main/resources/excel/project_temp.xlsx differ diff --git a/epmet-module/data-report/data-report-server/src/main/resources/excel/project_temp_easy_excel.xlsx b/epmet-module/data-report/data-report-server/src/main/resources/excel/project_temp_easy_excel.xlsx new file mode 100644 index 0000000000..41f27c780c Binary files /dev/null and b/epmet-module/data-report/data-report-server/src/main/resources/excel/project_temp_easy_excel.xlsx differ diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencyScoreDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencyScoreDao.xml index 04fcae2efd..37438d4249 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencyScoreDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencyScoreDao.xml @@ -31,11 +31,14 @@ ROUND(self.self_score,1) AS selfOriginScore, self.SELF_WEIGHT AS agencyWeight, ROUND(self.sub_score*fact.WEIGHT, 1) AS "subAgencyScore", - ROUND(self.sub_score,1) AS subOriginScore, + ROUND(self.sub_score,1) AS subOriginScoreBak, + ROUND(fact.score,1)-ROUND(self.self_score,1) as subOriginScore, self.SUB_WEIGHT AS subAgencyWeight FROM fact_index_agency_score fact - INNER JOIN fact_index_agency_self_sub_score self ON fact.agency_id = self.agency_id + INNER JOIN fact_index_agency_self_sub_score self ON + fact.CUSTOMER_ID = self.CUSTOMER_ID + AND fact.agency_id = self.agency_id AND fact.month_id = self.month_id AND fact.index_code = self.parent_index_code WHERE @@ -60,7 +63,9 @@ self.SUB_WEIGHT AS "subWeight" FROM fact_index_agency_score fact - INNER JOIN fact_index_agency_self_sub_score self ON fact.agency_id = self.agency_id + INNER JOIN fact_index_agency_self_sub_score self ON + fact.CUSTOMER_ID = self.CUSTOMER_ID + AND fact.agency_id = self.agency_id AND fact.month_id = self.month_id AND fact.index_code = self.parent_index_code WHERE diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunityScoreDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunityScoreDao.xml index 5f77c4950d..bd42a2b2b8 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunityScoreDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunityScoreDao.xml @@ -31,11 +31,14 @@ ROUND(self.self_score, 1) AS selfOriginScore, self.SELF_WEIGHT AS agencyWeight, ROUND(ROUND(self.sub_score,1)*fact.WEIGHT, 1) AS "subAgencyScore", - ROUND(self.sub_score, 1) AS subOriginScore, + ROUND(self.sub_score, 1) AS subOriginScoreBak, + ROUND(fact.score,1)-ROUND(self.self_score, 1) as subOriginScore, self.SUB_WEIGHT AS subAgencyWeight FROM fact_index_community_score fact - INNER JOIN fact_index_community_self_sub_score self ON fact.agency_id = self.agency_id + INNER JOIN fact_index_community_self_sub_score self ON + fact.CUSTOMER_ID = self.CUSTOMER_ID + AND fact.agency_id = self.agency_id AND fact.month_id = self.month_id AND fact.index_code = self.parent_index_code WHERE @@ -60,7 +63,9 @@ self.SUB_WEIGHT AS "subWeight" FROM fact_index_community_score fact - INNER JOIN fact_index_community_self_sub_score self ON fact.agency_id = self.agency_id + INNER JOIN fact_index_community_self_sub_score self ON + fact.CUSTOMER_ID = self.CUSTOMER_ID + AND fact.agency_id = self.agency_id AND fact.month_id = self.month_id AND fact.index_code = self.parent_index_code WHERE diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridScoreDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridScoreDao.xml index c152cbd144..62a7984b85 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridScoreDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridScoreDao.xml @@ -31,11 +31,14 @@ ROUND(self.self_score, 1) AS selfOriginScore, self.SELF_WEIGHT AS agencyWeight, ROUND(ROUND(self.sub_score,1)*fact.WEIGHT, 1) AS "subAgencyScore", - ROUND(self.sub_score, 1) AS subOriginScore, + ROUND(self.sub_score, 1) AS subOriginScoreBak, + ROUND(fact.score,1)-ROUND(self.self_score, 1) as subOriginScore, self.SUB_WEIGHT AS subAgencyWeight FROM fact_index_grid_score fact - INNER JOIN fact_index_grid_self_sub_score self ON fact.grid_id = self.grid_id + INNER JOIN fact_index_grid_self_sub_score self ON + fact.CUSTOMER_ID = self.CUSTOMER_ID + AND fact.grid_id = self.grid_id AND fact.agency_id = self.agency_id AND fact.month_id = self.month_id AND fact.index_code = self.parent_index_code @@ -61,7 +64,9 @@ self.SUB_WEIGHT AS "subWeight" FROM fact_index_grid_score fact - INNER JOIN fact_index_grid_self_sub_score self ON fact.grid_id = self.grid_id + INNER JOIN fact_index_grid_self_sub_score self ON + fact.CUSTOMER_ID = self.CUSTOMER_ID + AND fact.grid_id = self.grid_id AND fact.agency_id = self.agency_id AND fact.month_id = self.month_id AND fact.index_code = self.parent_index_code diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactVolunteerServiceDailyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactVolunteerServiceDailyDao.xml new file mode 100644 index 0000000000..fbe645deb3 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactVolunteerServiceDailyDao.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml index fced0091a6..e0e3b9fdae 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml @@ -278,7 +278,9 @@ diff.EVENT_IMG_URL AS imgUrl, floor(diff.EVENT_COST_TIME/60) AS totalHours, diff.EVENT_RE_ORG AS reOrg, - diff.EVENT_HANDLED_COUNT AS handledCount + diff.EVENT_HANDLED_COUNT AS handledCount, + CASE WHEN diff.org_type = 'grid' AND diff.EVENT_STATUS_CODE = 'closed' THEN IFNULL(spd.SATISFACTION_SCORE,80) + ELSE spd.SATISFACTION_SCORE END AS score FROM ( select scg.AREA_CODE,sdd1.* from screen_difficulty_data sdd1 @@ -333,6 +335,7 @@ AND sdd2.EVENT_STATUS_CODE in('closed','10','5') ) diff + LEFT JOIN screen_project_data spd ON (spd.PROJECT_ID = diff.EVENT_ID AND spd.DEL_FLAG = '0' AND spd.CLOSE_CASE_TIME IS NOT NULL and spd.SATISFACTION_SCORE is not null) ORDER BY CASE #{type} WHEN 'timelongest' THEN diff.EVENT_COST_TIME WHEN 'mosthandled' THEN diff.EVENT_HANDLED_COUNT diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml index 16c1b42383..0b619b742a 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml @@ -192,6 +192,7 @@ @@ -35,12 +35,13 @@ IFNULL(rankData.RESOLVED_RATIO,0) AS RESOLVED_RATIO, IFNULL(rankData.GOVERN_RATIO,0) AS GOVERN_RATIO, IFNULL(rankData.SATISFACTION_RATIO,0) AS SATISFACTION_RATIO, - pa.AGENCY_NAME AS parentAgencyName + pa.AGENCY_NAME AS parentAgencyName, + rankData.MONTH_ID as monthId FROM screen_customer_agency agency left join screen_customer_agency pa on(agency.PARENT_AREA_CODE=pa.AREA_CODE and pa.DEL_FLAG='0') - left join screen_govern_rank_data rankData + left join screen_govern_rank_data_daily rankData ON (agency.AGENCY_ID =rankData.org_id AND rankData.DEL_FLAG = '0' and rankData.org_type='agency') @@ -50,7 +51,7 @@ #{orgId} - AND rankData.MONTH_ID =#{monthId} + AND rankData.DATE_ID =#{monthId} ) union ( @@ -61,11 +62,12 @@ IFNULL(rankData.RESOLVED_RATIO,0) AS RESOLVED_RATIO, IFNULL(rankData.GOVERN_RATIO,0) AS GOVERN_RATIO, IFNULL(rankData.SATISFACTION_RATIO,0) AS SATISFACTION_RATIO, - ca.agency_name AS parentAgencyName + ca.agency_name AS parentAgencyName, + rankData.MONTH_ID as monthId FROM screen_customer_grid grid left join screen_customer_agency ca on (ca.agency_id = grid.parent_agency_id) - left join screen_govern_rank_data rankData + left join screen_govern_rank_data_daily rankData ON (grid.grid_id=rankData.org_id AND grid.DEL_FLAG = 0 and rankData.org_type='grid') @@ -74,7 +76,7 @@ #{orgId} - AND rankData.MONTH_ID =#{monthId} + AND rankData.DATE_ID =#{monthId} ) ORDER BY RESPONSE_RATIO DESC diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml index 8b4eed6642..9da7db0673 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml @@ -307,12 +307,21 @@ WHERE - score.del_flag = '0' + score.del_flag = '0' + AND score.MONTH_ID = #{monthId,jdbcType=VARCHAR} AND score.CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} - AND score.PARENT_ID = #{agencyId,jdbcType=VARCHAR} - AND score.MONTH_ID = #{monthId,jdbcType=VARCHAR} + + + + AND org.PIDS like concat(#{agencyId},'%') + AND org.LEVEL = 'community' + + + AND score.PARENT_ID = #{agencyId,jdbcType=VARCHAR} + + AND score.ORG_TYPE = #{orgType,jdbcType=VARCHAR} @@ -388,6 +397,9 @@ ROUND((ROUND(sy.govern_ablity,1) * sy.GOVERN_ABLITY_WEIGHT),1) AS governAbility, ROUND((ROUND(sy.party_dev_ablity,1) * sy.PARTY_DEV_WEIGHT),1) AS partyDevAbility, ROUND((ROUND(sy.service_ablity,1) * sy.SERVICE_ABLITY_WEIGHT),1) AS serviceAbility, + ROUND(sy.govern_ablity,1) AS originGovernAbility, + ROUND(sy.party_dev_ablity,1) AS originPartyDevAbility, + ROUND(sy.service_ablity,1) AS originServiceAbility, sy.ORG_ID as orgId, scg.area_code as areaCode FROM screen_customer_grid scg diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml index 6908b80953..ac2ad698eb 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml @@ -14,7 +14,8 @@ rankData.CLOSE_PROJECT_RATIO AS closedProjectRatio, rankData.SATISFACTION_RATIO AS satisfactionRatio, agency.AGENCY_NAME AS parentAgencyName, - rankData.ORG_ID as orgId + rankData.ORG_ID as orgId, + rankData.MONTH_ID FROM screen_org_rank_data rankData LEFT JOIN screen_customer_agency agency @@ -39,7 +40,8 @@ rankData.CLOSE_PROJECT_RATIO AS closedProjectRatio, rankData.SATISFACTION_RATIO AS satisfactionRatio, agency.AGENCY_NAME AS parentAgencyName, - rankData.ORG_ID as orgId + rankData.ORG_ID as orgId, + rankData.MONTH_ID FROM screen_org_rank_data rankData left join screen_customer_grid scg on( diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml index fdde620908..4e84fe035c 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml @@ -103,7 +103,8 @@ SELECT m.USER_ID, concat( m.surname, CASE char_length( m.NAME ) WHEN 1 THEN '*' WHEN 2 THEN '**' ELSE '***' END ) AS name, - m.POINT_TOTAL AS point + m.POINT_TOTAL AS point, + m.DATA_END_TIME FROM screen_party_user_rank_data m left join screen_customer_grid scg diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPioneerDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPioneerDataDao.xml index b1f890b3a5..79e7c9574d 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPioneerDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPioneerDataDao.xml @@ -17,7 +17,8 @@ publish_issue_total AS publishIssueTotal, IFNULL(publish_issue_ratio,0) AS publishIssueRatioA, PLAT_ISSUE_TOTAL AS platIssueTotal, - IFNULL(PLAT_JOIN_PARTY_RATIO,0) AS platJoinPartyRatio + IFNULL(PLAT_JOIN_PARTY_RATIO,0) AS platJoinPartyRatio, + DATA_END_TIME as dataEndTime FROM screen_pioneer_data WHERE @@ -44,7 +45,8 @@ CEILING(sum(data.publish_issue_total)) AS publishIssueTotal, IFNULL(avg(data.publish_issue_ratio),0) AS publishIssueRatioA, CEILING(sum(data.PLAT_ISSUE_TOTAL)) AS platIssueTotal, - IFNULL(avg(data.PLAT_JOIN_PARTY_RATIO),0) AS platJoinPartyRatio + IFNULL(avg(data.PLAT_JOIN_PARTY_RATIO),0) AS platJoinPartyRatio, + data.DATA_END_TIME as dataEndTime FROM screen_pioneer_data data LEFT JOIN diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectCategoryOrgDailyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectCategoryOrgDailyDao.xml index 5731b27e2b..b9dfb3faaa 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectCategoryOrgDailyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectCategoryOrgDailyDao.xml @@ -63,4 +63,58 @@ AND DATE_ID = (select date_id from screen_project_category_org_daily where del_flag = '0' and ORG_ID = #{agencyId} and CUSTOMER_ID= #{customerId} order by date_id desc, created_time desc limit 1) ORDER BY PROJECT_TOTAL DESC LIMIT #{topCount} + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml index e890e36389..28b422ab4d 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml @@ -135,7 +135,7 @@ AND pd.ORG_TYPE = 'agency' AND pd.PROJECT_LEVEL != 0 AND sca.AREA_CODE LIKE CONCAT(#{areaCode},'%') - AND UNIX_TIMESTAMP(pd.CREATED_TIME) >= UNIX_TIMESTAMP(DATE_SUB(NOW(),INTERVAL #{monthCount} MONTH)) + AND UNIX_TIMESTAMP(pd.PROJECT_CREATE_TIME) >= UNIX_TIMESTAMP(DATE_SUB(NOW(),INTERVAL #{monthCount} MONTH)) ) UNION ALL (SELECT pd.PROJECT_LEVEL @@ -145,7 +145,7 @@ AND pd.ORG_TYPE = 'grid' AND pd.PROJECT_LEVEL != 0 AND scg.AREA_CODE LIKE CONCAT(#{areaCode},'%') - AND UNIX_TIMESTAMP(pd.CREATED_TIME) >= UNIX_TIMESTAMP(DATE_SUB(NOW(),INTERVAL #{monthCount} MONTH)) + AND UNIX_TIMESTAMP(pd.PROJECT_CREATE_TIME) >= UNIX_TIMESTAMP(DATE_SUB(NOW(),INTERVAL #{monthCount} MONTH)) ) UNION ALL (SELECT pd.PROJECT_LEVEL @@ -155,7 +155,35 @@ AND pd.ORG_TYPE = 'department' AND pd.PROJECT_LEVEL != 0 AND scd.AREA_CODE LIKE CONCAT(#{areaCode},'%') - AND UNIX_TIMESTAMP(pd.CREATED_TIME) >= UNIX_TIMESTAMP(DATE_SUB(NOW(),INTERVAL #{monthCount} MONTH)) + AND UNIX_TIMESTAMP(pd.PROJECT_CREATE_TIME) >= UNIX_TIMESTAMP(DATE_SUB(NOW(),INTERVAL #{monthCount} MONTH)) ) + + + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectOrgDailyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectOrgDailyDao.xml index 4189b03d16..0294005b7f 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectOrgDailyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectOrgDailyDao.xml @@ -54,4 +54,30 @@ )and m.CUSTOMER_ID=#{customerId} order by resolvedRatio+0 desc + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml index af7f1bfc34..31e5262c75 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml @@ -38,7 +38,8 @@ group_total AS groupNum, topic_total AS topicNum, issue_total AS issueNum, - project_total AS projectNum + project_total AS projectNum, + DATA_END_TIME as dataEndTime FROM screen_user_total_data WHERE diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenan/ScreenAnCommunityProjectProfileDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenan/ScreenAnCommunityProjectProfileDao.xml index 10679f3f96..8718bfa0f2 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenan/ScreenAnCommunityProjectProfileDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenan/ScreenAnCommunityProjectProfileDao.xml @@ -5,7 +5,8 @@ SELECT GROUP_TOTAL, ISSUE_TOTAL, - PROJECT_TOTAL + PROJECT_TOTAL, + MONTH_ID FROM screen_an_grass_roots_org_monthly WHERE DEL_FLAG = 0 AND ORG_ID = #{agencyId} @@ -47,7 +48,8 @@ SELECT ORG_NAME, GROUP_TOTAL, ISSUE_TOTAL, - PROJECT_TOTAL + PROJECT_TOTAL, + MONTH_ID FROM screen_an_grass_roots_org_monthly WHERE DEL_FLAG = 0 AND PID = #{agencyId} diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenan/ScreenAnGrassRootsPmTotalMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenan/ScreenAnGrassRootsPmTotalMonthlyDao.xml index 58b7001046..0cb482df47 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenan/ScreenAnGrassRootsPmTotalMonthlyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenan/ScreenAnGrassRootsPmTotalMonthlyDao.xml @@ -7,7 +7,8 @@ SELECT GROUP_MEMBER_TOTAL, TOPIC_TOTAL, TOPIC_PARTI_USER_TOTAL, - ISSUE_TOTAL + ISSUE_TOTAL, + MONTH_ID FROM screen_an_grass_roots_pm_total_monthly WHERE DEL_FLAG = '0' AND ORG_ID = #{agencyId} diff --git a/epmet-module/data-statistical/data-statistical-client/pom.xml b/epmet-module/data-statistical/data-statistical-client/pom.xml index 1e128a8adf..34fae622ba 100644 --- a/epmet-module/data-statistical/data-statistical-client/pom.xml +++ b/epmet-module/data-statistical/data-statistical-client/pom.xml @@ -17,6 +17,18 @@ epmet-commons-tools 2.0.0 + + com.epmet + open-data-worker-client + 2.0.0 + compile + + + com.epmet + open-data-worker-client + 2.0.0 + compile + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/EventInfoFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/EventInfoFormDTO.java new file mode 100644 index 0000000000..8e6c99d562 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/EventInfoFormDTO.java @@ -0,0 +1,23 @@ +package com.epmet.dto.basereport.form; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2021/10/15 10:55 + */ +@Data +public class EventInfoFormDTO extends PageFormDTO implements Serializable { + private static final long serialVersionUID = 8479649048108914555L; + private String customerId; + private List projectId; + /** + * 操作类型【新增:add 修改删除:edit】 + */ + private String type; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/result/EventInfoResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/result/EventInfoResultDTO.java new file mode 100644 index 0000000000..4b7aeea782 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/result/EventInfoResultDTO.java @@ -0,0 +1,192 @@ +package com.epmet.dto.basereport.result; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2021/10/15 10:57 + */ +@Data +public class EventInfoResultDTO implements Serializable { + private static final long serialVersionUID = -6483163020737762044L; + /** + * 主键 + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + private String orgId; + + private String reporterId; + + /** + * 网格编码 + */ + private String orgCode; + + /** + * 网格名称 + */ + private String orgName; + + /** + * 事件名称 + */ + private String eventName; + + /** + * 事件类别 + */ + private String eventCategory; + private String parentEventCategory; + /** + * 上报时间 YYYY-MM-DD HH:MM:SS + */ + private Date reportTime; + + /** + * 发生时间 格式为“YYYY-MM-DD” + */ + private Date happenDate; + + /** + * 发生地点 + */ + private String happenPlace; + + /** + * 事件简述 + */ + private String eventDescription; + + /** + * 办结方式 01自办;02上报 源于居民端的最终结案的项目为02;工作端立项的项目最终结案的01 + */ + private String waysOfResolving; + + /** + * 是否办结 Y:是、N:否 + */ + private String successfulOrNo; + + private String status; + + /** + * 办结层级 + 01省、自治区、直辖市 + 02地、市、州、盟 + 03县、市、区、旗 + 04乡镇、街道 + 05片区 + 06村、社区 + 07网格 + + */ + private String completeLevel; + + /** + * 基础信息主键 + */ + private String baseInfoId; + + /** + * 办结时间 + */ + private Date completeTime; + + /** + * 经度 + */ + private BigDecimal lng; + + /** + * 纬度 + */ + private BigDecimal lat; + + /** + * 主要当事人姓名 + */ + private String name; + + /** + * 涉及人数 + */ + private Integer numberInvolved; + + /** + * 涉及单位 + */ + private String relatedUnits; + + /** + * 重点场所类别 01九小场所, 02公共场所 + */ + private String keyAreaType; + + /** + * 宗教活动规模 01 0-50人,02 51-200人,03 201人以上 + + */ + private String religionScale; + + /** + * 宗教类别 01道教 02佛教 03基督教 04伊斯兰教 05其他 + + */ + private String religionType; + + /** + * 重点场所是否变动 Y:是、N:否 + */ + private String isKeyareaState; + + /** + * 重点人员是否在当地 Y:是、N:否 + */ + private String isKeypeopleLocate; + + /** + * 重点人员现状 + */ + private String keypeopleStatus; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Long delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactAgencyGovernDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactAgencyGovernDailyDTO.java index 3f9c614f8a..a550775779 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactAgencyGovernDailyDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactAgencyGovernDailyDTO.java @@ -129,6 +129,15 @@ public class FactAgencyGovernDailyDTO implements Serializable { */ private Integer inGroupTopicUnResolvedCount; + /** + * 11、当前组织内:来源于事件的项目:结案已解决数 + */ + private Integer eventResolvedCount; + /** + * 12、当前组织内:来源于事件的项目:结案无需解决数 + */ + private Integer eventUnResolvedCount; + /** * 未出当前网格的,结案项目数 */ diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactGridGovernDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactGridGovernDailyDTO.java index 778ffcb9a4..b8d585f00f 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactGridGovernDailyDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactGridGovernDailyDTO.java @@ -140,6 +140,15 @@ public class FactGridGovernDailyDTO implements Serializable { */ private Integer fromAgencyUnResolvedInGridCount; + /** + * 15、当前组织内:来源于事件的项目:结案已解决数 + */ + private Integer eventResolvedCount; + /** + * 16、当前组织内:来源于事件的项目:结案无需解决数 + */ + private Integer eventUnResolvedCount; + /** * 15、未出当前网格的,结案项目数=11+12+13+14 */ diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/AggregationExtractFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/AggregationExtractFormDTO.java index e307587313..1dd051f139 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/AggregationExtractFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/AggregationExtractFormDTO.java @@ -3,6 +3,7 @@ package com.epmet.dto.extract.form; import lombok.Data; import java.io.Serializable; +import java.util.Set; /** * desc: 从业务数据抽取到统计库Form DTO @@ -30,4 +31,10 @@ public class AggregationExtractFormDTO implements Serializable { * 抽取类型 monthly,daily */ private String type; + + /** + * 要抽取的具体业务类型 不传默认所有 + * @see com.epmet.commons.tools.enums.BizTypeEnum + */ + private Set bizType; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/GridIssueCountResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/GridIssueCountResultDTO.java index 207cd8e8df..981f8fb306 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/GridIssueCountResultDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/GridIssueCountResultDTO.java @@ -1,8 +1,10 @@ package com.epmet.dto.extract.form; +import com.epmet.commons.tools.constant.NumConstant; import lombok.Data; import java.io.Serializable; +import java.math.BigDecimal; /** * @Author zxc @@ -27,4 +29,9 @@ public class GridIssueCountResultDTO implements Serializable { * 网格ID */ private String gridId; + + /** + * 网格议题转项目率 + */ + private BigDecimal issueToProjectRatio = NumConstant.ZERO_DECIMAL; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/heart/result/DemandServiceCountResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/heart/result/DemandServiceCountResultDTO.java new file mode 100644 index 0000000000..16cbee4538 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/heart/result/DemandServiceCountResultDTO.java @@ -0,0 +1,19 @@ +package com.epmet.dto.heart.result; + +import lombok.Data; + +/** + * @Description 描述 + * @Author wangxianzhang + * @Date 2021/12/8 4:39 下午 + * @Version 1.0 + */ +@Data +public class DemandServiceCountResultDTO { + // 服务者ID + private String serverId; + // 服务类型 + private String serviceType; + // 服务次数 + private int serveTimes; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/issue/IssueProjectCategoryDictDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/issue/IssueProjectCategoryDictDTO.java index c07037ee92..872dbc96a2 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/issue/IssueProjectCategoryDictDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/issue/IssueProjectCategoryDictDTO.java @@ -113,4 +113,9 @@ public class IssueProjectCategoryDictDTO implements Serializable { */ private Date updatedTime; + /** + * 颜色 + */ + private String color; + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/form/GridBaseInfoFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/form/GridBaseInfoFormDTO.java new file mode 100644 index 0000000000..9d39ef6b81 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/form/GridBaseInfoFormDTO.java @@ -0,0 +1,34 @@ +package com.epmet.dto.org.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * @dscription 插叙客户网格基础信息--接口入参 + * @author sun + */ +@Data +public class GridBaseInfoFormDTO implements Serializable { + + private static final long serialVersionUID = -3634745091993094743L; + /** + * 客户Id + */ + @NotBlank(message = "事件标识不能为空", groups = {Grid.class}) + private String customerId = ""; + /** + * 网格Id + */ + private List orgIdList; + /** + * 操作类型【新增:add 修改删除:edit 初始化所有数据:all】 + */ + private String type; + + public interface Grid extends CustomerClientShowGroup {} + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/result/CustomerAgencyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/result/CustomerAgencyDTO.java new file mode 100644 index 0000000000..658a3e9c2d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/result/CustomerAgencyDTO.java @@ -0,0 +1,150 @@ +/** + * 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.dto.org.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 机关单位信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-20 + */ +@Data +public class CustomerAgencyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 上级组织机构ID + */ + private String pid; + + /** + * 所有上级组织机构ID(以英文:隔开) + */ + private String pids; + + /** + * 所有上级名称,以-连接 + */ + private String allParentName; + + /** + * 组织名称 + */ + private String organizationName; + + /** + * 机关级别(社区级:community, +乡(镇、街道)级:street, +区县级: district, +市级: city +省级:province) 机关级别(社区级:community,乡(镇、街道)级:street,区县级: district,市级: city省级:province) + */ + private String level; + + /** + * 地区编码 + */ + private String areaCode; + + /** + * 省组织编码 + */ + private String code; + + /** + * 删除标识 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 总人数 + */ + private Integer totalUser; + + /** + * 省 + */ + private String province; + + /** + * 市 + */ + private String city; + + /** + * 区县 + */ + private String district; + + /** + * 当前组织的上级行政地区编码add0204;举例平阴县对应的是济南市3701 + */ + private String parentAreaCode; + + /** + * 街道 + */ + private String street; + + /** + * 社区 + */ + private String community; +} \ No newline at end of file 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 new file mode 100644 index 0000000000..752bb721cd --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/result/CustomerGridDTO.java @@ -0,0 +1,134 @@ +/** + * 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.dto.org.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 客户网格表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Data +public class CustomerGridDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID 唯一标识 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 网格名称 + */ + private String gridName; + + /** 组织-网格 */ + private String gridNamePath; + + /** + * 中心位置经度 + */ + private String longitude; + + /** + * 中心位置纬度 + */ + private String latitude; + + /** + * 所属地区码(所属组织地区码) + */ + private String areaCode; + + /** + * 省网格编码 + */ + private String code; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 管辖区域 + */ + private String manageDistrict; + + /** + * 当前网格总人数 + */ + private Integer totalUser; + + /** + * 所属组织机构ID(customer_organization.id) + */ + private String pid; + + /** + * 所有上级组织ID + */ + private String pids; + + /** + * 所属组织机构名 + */ + private String agencyName; + + /** + * 所有上级组织名 + */ + private String allParentName; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/result/GridBaseInfoDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/result/GridBaseInfoDTO.java new file mode 100644 index 0000000000..5da47611a5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/result/GridBaseInfoDTO.java @@ -0,0 +1,103 @@ +/** + * 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.dto.org.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 网格员基础信息表 + */ +@Data +public class GridBaseInfoDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 网格Id + */ + private String gridId; + /** + * 工作人员Id + */ + private String staffId; + /** + * 客户Id + */ + private String customerId; + + /** + * 网格编码 + */ + private String code; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 网格员姓名 + */ + private String GRID_LEVEL; + + /** + * 专属网格类型[01:党政机关; 02:医院; 03:学校; 04:企业; 05:园区; 06:商圈; 07:市场; 08:景区; + */ + private String GRID_TYPE; + + /** + * 网格内人口规模[01:500人以下(含500人); 02:500-1000人(含1000人); 03:1000-1500人(含1500人); 04:1500人以上] + */ + private String POPULATION_SIZE; + + /** + * 是否成立网格党支部或网格党小组[Y:是、N:否] + */ + private String IS_PARTY_BRANCH; + + /** + * 网格党组织类型[01:网格党支部; 02:网格党小组] + */ + private String PARTY_BRANCH_TYPE; + + /** + * 中心点(质心)经度 + */ + private String LNG; + + /** + * 中心点(质心)纬度 + */ + private String LAT; + + /** + * 网格颜色 + */ + private Date GRID_COLOR; + + /** + * 空间范围 + */ + private String SHAPE; + + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/result/ClosedProjectTotalResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/result/ClosedProjectTotalResultDTO.java new file mode 100644 index 0000000000..bd2aea194f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/result/ClosedProjectTotalResultDTO.java @@ -0,0 +1,31 @@ +package com.epmet.dto.project.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/11/4 9:12 上午 + * @DESC + */ +@Data +public class ClosedProjectTotalResultDTO implements Serializable { + + private static final long serialVersionUID = -3683494871244065806L; + + /** + * 组织ID + */ + private String orgId; + + /** + * 分类code + */ + private String categoryCode; + + /** + * 结案的项目数 + */ + private Integer closedProjectTotal = 0; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenCustomerGridDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenCustomerGridDTO.java index 2a707f9540..2dcdc32028 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenCustomerGridDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenCustomerGridDTO.java @@ -43,7 +43,7 @@ public class ScreenCustomerGridDTO implements Serializable { * 客户id */ private String customerId; - + private String code; /** * 网格id */ diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectCategoryDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectCategoryDTO.java new file mode 100644 index 0000000000..f9fedd5560 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectCategoryDTO.java @@ -0,0 +1,102 @@ +/** + * 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.dto.screen; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 项目所属分类表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-10 + */ +@Data +public class ScreenProjectCategoryDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 项目id + */ + private String projectId; + + /** + * 分类编码 + */ + private String categoryCode; + + /** + * 所属父类分类编码 + */ + private String parentCategoryCode; + + /** + * 原始分类编码 + */ + private String originCategoryCode; + + /** + * 分类等级:1、2....;产品目前只有2级分类 + */ + private Integer level; + + /** + * 删除标识 0未删除;1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectCategoryGridDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectCategoryGridDailyDTO.java index cd31f554bb..e47c97f841 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectCategoryGridDailyDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectCategoryGridDailyDTO.java @@ -120,4 +120,6 @@ public class ScreenProjectCategoryGridDailyDTO implements Serializable { */ private Boolean status = false; + private Integer closedProjectTotal = 0; + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectDataDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectDataDTO.java index 9c6bb27cea..dfd88c7e96 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectDataDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectDataDTO.java @@ -132,6 +132,8 @@ public class ScreenProjectDataDTO implements Serializable { */ private BigDecimal latitude; + private String projectCreator; + /** * 删除标识 0未删除;1已删除 */ @@ -170,7 +172,7 @@ public class ScreenProjectDataDTO implements Serializable { /** * 结案日期 */ - private String closeCaseTime; + private Date closeCaseTime; /** * 数据更新至: yyyy|yyyMM|yyyyMMdd @@ -196,4 +198,12 @@ public class ScreenProjectDataDTO implements Serializable { * fact_origin_project_main_daily.grid_id对应的网格名称 */ private String tempGridName; + + private String finishOrg; + + private String finishOrgLevel; + + private String orgIdPath; + + private String finishOrgType; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/ScreenProjectDataInfoFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/ScreenProjectDataInfoFormDTO.java index 9202158945..d4a767f525 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/ScreenProjectDataInfoFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/ScreenProjectDataInfoFormDTO.java @@ -115,7 +115,8 @@ public class ScreenProjectDataInfoFormDTO implements Serializable { /** * 结案日期 */ - private String closeCaseTime; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8") + private Date closeCaseTime; /** * 所有上级ID,用英文逗号分开 @@ -131,4 +132,8 @@ public class ScreenProjectDataInfoFormDTO implements Serializable { * 满意度得分 */ private BigDecimal satisfactionScore; + /** + * 项目创建人 + */ + private String projectCreator; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/CategoryProjectResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/CategoryProjectResultDTO.java index 48af51b5ef..29cc0ea5db 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/CategoryProjectResultDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/CategoryProjectResultDTO.java @@ -42,6 +42,11 @@ public class CategoryProjectResultDTO implements Serializable { */ private Integer projectTotal; + /** + * 结案数 + */ + private Integer closedProjectTotal; + /** * 分类级别 */ diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/GridAndOrgCategoryCountResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/GridAndOrgCategoryCountResultDTO.java new file mode 100644 index 0000000000..7f3f9aa96d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/GridAndOrgCategoryCountResultDTO.java @@ -0,0 +1,76 @@ +package com.epmet.dto.screen.result; + +import com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/11/10 10:36 上午 + * @DESC + */ +@Data +public class GridAndOrgCategoryCountResultDTO implements Serializable { + + private static final long serialVersionUID = -5167964547464983118L; + + /** + * 组织ID + */ + private String orgId; + + /** + * 组织类型 + */ + private String orgType; + + /** + * 网格ID + */ + private String gridId; + + /** + * 上级组织ID + */ + private String pid; + + /** + * 所有上级组织ID + */ + private String pids; + + private String dateId; + + private String customerId; + + private String categoryOriginCustomerId; + + /** + * 分类CODE + */ + private String categoryCode; + + /** + * 分类CODE级别 + */ + private Integer level; + + /** + * 项目总数 + */ + private Integer projectTotal; + + /** + * 关闭【结案】项目总数 + */ + private Integer closedProjectTotal; + + public GridAndOrgCategoryCountResultDTO() { + this.orgId = ""; + this.categoryCode = ""; + this.level = NumConstant.ZERO; + this.projectTotal = NumConstant.ZERO; + this.closedProjectTotal = NumConstant.ZERO; + } +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/form/StaffBaseInfoFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/form/StaffBaseInfoFormDTO.java new file mode 100644 index 0000000000..b82ca423fe --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/form/StaffBaseInfoFormDTO.java @@ -0,0 +1,33 @@ +package com.epmet.dto.user.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * @dscription 插叙客户网格人员基础信息--接口入参 + * @author sun + */ +@Data +public class StaffBaseInfoFormDTO implements Serializable { + + private static final long serialVersionUID = -3634745091993094743L; + /** + * 客户Id + */ + @NotBlank(message = "事件标识不能为空", groups = {Staff.class}) + private String customerId = ""; + /** + * 人员Id + */ + private List staffIdList; + /** + * 操作类型【新增:add 修改删除:edit】 + */ + private String type; + public interface Staff extends CustomerClientShowGroup {} + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/param/MidPatrolFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/param/MidPatrolFormDTO.java new file mode 100644 index 0000000000..b0810e54cc --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/param/MidPatrolFormDTO.java @@ -0,0 +1,29 @@ +package com.epmet.dto.user.param; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * desc:查询巡查 参数 + * + * @author zhaoqifeng + * @dscription + * @date 2021/6/7 16:23 + */ +@NoArgsConstructor +@Data +public class MidPatrolFormDTO extends PageFormDTO implements Serializable { + private static final long serialVersionUID = 4411051728689886810L; + /** + * 客户Id + */ + private String customerId; + /** + * 巡查记录id 没有则查询全部 + */ + private String patrolId; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/result/GridUserInfoDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/result/GridUserInfoDTO.java new file mode 100644 index 0000000000..f5f8d84596 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/result/GridUserInfoDTO.java @@ -0,0 +1,84 @@ +/** + * 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.dto.user.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 网格员基础信息表 + */ +@Data +public class GridUserInfoDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 网格Id + */ + private String gridId; + /** + * 工作人员Id + */ + private String staffId; + /** + * 客户Id + */ + private String customerId; + + /** + * 网格编码 + */ + private String code; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 网格员姓名 + */ + private String nickName; + + /** + * 专属网格类型[01:党政机关; 02:医院; 03:学校; 04:企业; 05:园区; 06:商圈; 07:市场; 08:景区; + */ + private String cardNum; + + /** + * 网格员类型[01:专职网格员; 02:兼职网格员; 03:网格长; 04:综治机构人员; 05:职能部门人员] + */ + private String userType; + + /** + * 手机号码 + */ + private String phonenumber; + + /** + * 性别[1:男性; 2:女性; 9:未说明的性别] + */ + private String sex; + + + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/result/MidPatrolDetailResult.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/result/MidPatrolDetailResult.java new file mode 100644 index 0000000000..434d2c8740 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/result/MidPatrolDetailResult.java @@ -0,0 +1,56 @@ +/** + * 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.dto.user.result; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 工作人员巡查明细记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-06-07 + */ +@Data +public class MidPatrolDetailResult implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 维度 + */ + private String latitude; + + /** + * 经度 + */ + private String longitude; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/result/MidPatrolRecordResult.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/result/MidPatrolRecordResult.java new file mode 100644 index 0000000000..12c18962d1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/result/MidPatrolRecordResult.java @@ -0,0 +1,137 @@ +/** + * 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.dto.user.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 工作人员巡查主记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-06-07 + */ +@Data +public class MidPatrolRecordResult implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 网格id + */ + private String grid; + + /** + * 网格所有上级id + */ + private String gridPids; + + /** + * 工作人员用户id + */ + private String staffId; + + /** + * 工作人员所属组织id=网格所属的组织id + */ + private String agencyId; + + /** + * 巡查开始时间 + */ + private Date patrolStartTime; + + /** + * 巡查结束时间,前端传入 + */ + private Date patrolEndTime; + + /** + * 实际结束时间=操作结束巡查的时间 + */ + private Date actrualEndTime; + + /** + * 本次巡查总耗时,单位秒;结束巡查时写入 + */ + private Integer totalTime; + + /** + * 正在巡查中:patrolling;结束:end + */ + private String status; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 维度 + */ + private String latitude; + + /** + * 精度 + */ + private String longitude; + + /** + * 经纬度组合成的路线 经度,维度; + */ + private String route; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java index 93d81104d5..dab2edf301 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java @@ -3,16 +3,31 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.StatsFormDTO; -import com.epmet.dto.extract.form.*; +import com.epmet.dto.basereport.form.EventInfoFormDTO; +import com.epmet.dto.basereport.result.EventInfoResultDTO; +import com.epmet.dto.extract.form.BizDataFormDTO; +import com.epmet.dto.extract.form.ExtractIndexFormDTO; +import com.epmet.dto.extract.form.ExtractOriginFormDTO; +import com.epmet.dto.extract.form.ExtractScreenFormDTO; import com.epmet.dto.group.form.GroupStatsFormDTO; import com.epmet.dto.group.form.GroupTotalFormDTO; +import com.epmet.dto.org.form.GridBaseInfoFormDTO; +import com.epmet.dto.org.result.CustomerAgencyDTO; +import com.epmet.dto.org.result.CustomerGridDTO; import com.epmet.dto.screen.form.InitCustomerIndexForm; import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO; -import com.epmet.feign.impl.DataStatisticalOpenFeignClientFallBack; +import com.epmet.dto.user.form.StaffBaseInfoFormDTO; +import com.epmet.dto.user.param.MidPatrolFormDTO; +import com.epmet.dto.user.result.GridUserInfoDTO; +import com.epmet.dto.user.result.MidPatrolDetailResult; +import com.epmet.dto.user.result.MidPatrolRecordResult; import com.epmet.feign.impl.DataStatisticalOpenFeignClientFallBackFactory; import org.springframework.cloud.openfeign.FeignClient; 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; /** * desc: 数据统计 对外feign client @@ -274,4 +289,68 @@ public interface DataStatisticalOpenFeignClient { */ @PostMapping("/data/stats/statsgroup/groupandhottopic") Result groupAndHotTopicTask(@RequestBody GroupTotalFormDTO formDTO); + + /** + * @dscription 批量查询客户组织基础信息 + * @author sun + */ + @PostMapping("/data/stats/datareporting/agencybaseinfo") + Result> getAgencyBaseInfo(@RequestBody GridBaseInfoFormDTO formDTO); + + /** + * @dscription 批量查询客户网格基础信息 + * @author sun + */ + @PostMapping("/data/stats/datareporting/gridbaseinfo") + Result> getGridBaseInfo(@RequestBody GridBaseInfoFormDTO formDTO); + + /** + * @dscription 批量查询客户网格员基础信息 + * @author sun + */ + @PostMapping("/data/stats/datareporting/staffbaseinfo") + Result> getStaffBaseInfo(@RequestBody StaffBaseInfoFormDTO formDTO); + + /** + * 根据巡查记录id 获取巡查主记录信息 + * + * @param midPatrolFormDTO + * @return + * @author yinzuomei + * @date 2021/9/10 8:56 上午 + */ + @PostMapping(value = "/data/stats/datareporting/getPatrolRecordList") + Result> getPatrolRecordList(@RequestBody MidPatrolFormDTO midPatrolFormDTO); + + /** + * 根据巡查记录id 获取巡查轨迹(明细)信息 + * + * @param midPatrolFormDTO + * @return + * @author yinzuomei + * @date 2021/9/10 8:56 上午 + */ + @PostMapping(value = "/data/stats/datareporting/getPatrolDetailList") + Result> getPatrolDetailList(@RequestBody MidPatrolFormDTO midPatrolFormDTO); + + /** + * 事件上报 + * @Param formDTO + * @Return {@link Result>} + * @Author zhaoqifeng + * @Date 2021/10/15 16:50 + */ + @PostMapping("/data/stats/datareporting/eventinfo") + Result> getEventInfo(@RequestBody EventInfoFormDTO formDTO); + + /** + * wangxianzhang + * + * 计算客户下志愿者服务相关数据 + * + * @param customerId 客户ID,可以为空,为空则计算所有客户 + * @return + */ + @PostMapping("/data/stats/demand/volunteer/daily") + Result statsVolunteerDemandServicesDaily(@RequestParam(value = "customer-id", required = false) String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java index 7bf37b9ce7..56fea9c03f 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java @@ -4,13 +4,27 @@ 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.StatsFormDTO; -import com.epmet.dto.extract.form.*; +import com.epmet.dto.basereport.form.EventInfoFormDTO; +import com.epmet.dto.basereport.result.EventInfoResultDTO; +import com.epmet.dto.extract.form.BizDataFormDTO; +import com.epmet.dto.extract.form.ExtractIndexFormDTO; +import com.epmet.dto.extract.form.ExtractOriginFormDTO; +import com.epmet.dto.extract.form.ExtractScreenFormDTO; import com.epmet.dto.group.form.GroupStatsFormDTO; import com.epmet.dto.group.form.GroupTotalFormDTO; +import com.epmet.dto.org.form.GridBaseInfoFormDTO; +import com.epmet.dto.org.result.CustomerAgencyDTO; +import com.epmet.dto.org.result.CustomerGridDTO; import com.epmet.dto.screen.form.InitCustomerIndexForm; import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO; +import com.epmet.dto.user.form.StaffBaseInfoFormDTO; +import com.epmet.dto.user.param.MidPatrolFormDTO; +import com.epmet.dto.user.result.GridUserInfoDTO; +import com.epmet.dto.user.result.MidPatrolDetailResult; +import com.epmet.dto.user.result.MidPatrolRecordResult; import com.epmet.feign.DataStatisticalOpenFeignClient; -import org.springframework.stereotype.Component; + +import java.util.List; /** * desc: @@ -265,4 +279,64 @@ public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOp public Result groupAndHotTopicTask(GroupTotalFormDTO formDTO) { return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "groupAndHotTopic", formDTO); } + + @Override + public Result> getAgencyBaseInfo(GridBaseInfoFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "getAgencyBaseInfo", formDTO); + } + + @Override + public Result> getGridBaseInfo(GridBaseInfoFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "getGridBaseInfo", formDTO); + } + + @Override + public Result> getStaffBaseInfo(StaffBaseInfoFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "getStaffBaseInfo", formDTO); + } + + /** + * 根据巡查记录id 获取巡查主记录信息 + * + * @param midPatrolFormDTO + * @return + * @author yinzuomei + * @date 2021/9/10 8:56 上午 + */ + @Override + public Result> getPatrolRecordList(MidPatrolFormDTO midPatrolFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "getPatrolRecordList", midPatrolFormDTO); + } + + /** + * 根据巡查记录id 获取巡查轨迹(明细)信息 + * + * @param midPatrolFormDTO + * @return + * @author yinzuomei + * @date 2021/9/10 8:56 上午 + */ + @Override + public Result> getPatrolDetailList(MidPatrolFormDTO midPatrolFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "getPatrolDetailList", midPatrolFormDTO); + } + + /** + * 事件上报 + * + * @param formDTO + * @Param formDTO + * @Return {@link Result>} + * @Author zhaoqifeng + * @Date 2021/10/15 16:50 + */ + @Override + public Result> getEventInfo(EventInfoFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "getEventInfo", formDTO); + } + + @Override + public Result statsVolunteerDemandServicesDaily(String customerId) { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "statsVolunteerDemandServicesDaily", customerId); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-prod.yml b/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-prod.yml index 6e0f1082aa..3cd9ff7c01 100644 --- a/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-prod.yml +++ b/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: data-statistical-server: container_name: data-statistical-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/data-statistical-server:0.3.81 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/data-statistical-server:0.3.300 ports: - "8108:8108" network_mode: host # 使用现有网络 diff --git a/epmet-module/data-statistical/data-statistical-server/pom.xml b/epmet-module/data-statistical/data-statistical-server/pom.xml index 714dfa2c01..ded855e3fe 100644 --- a/epmet-module/data-statistical/data-statistical-server/pom.xml +++ b/epmet-module/data-statistical/data-statistical-server/pom.xml @@ -2,7 +2,7 @@ - 0.3.81 + 0.3.300 data-statistical com.epmet @@ -97,7 +97,21 @@ com.alibaba easyexcel - 2.2.6 + 3.0.3 + + + poi + org.apache.poi + + + poi-ooxml + org.apache.poi + + + poi-ooxml-schemas + org.apache.poi + + io.github.wnjustdoit @@ -116,6 +130,24 @@ 2.0.0 compile + + com.epmet + open-data-worker-client + 2.0.0 + compile + + + com.epmet + epmet-message-client + 2.0.0 + compile + + + com.epmet + oper-crm-client + 2.0.0 + compile + @@ -604,7 +636,7 @@ false - false + true false diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/DimObjectActionConstant.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/DimObjectActionConstant.java index 1b6697f1ec..6e8c7b153e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/DimObjectActionConstant.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/DimObjectActionConstant.java @@ -24,4 +24,6 @@ public interface DimObjectActionConstant { // perfect 非常满意 // created 立项 String PROJECT_RETURN="return"; + + String PROJECT_CLOSE="close"; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/OrgTypeConstant.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/OrgTypeConstant.java index 7c88be956c..3fa6ac0fdc 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/OrgTypeConstant.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/OrgTypeConstant.java @@ -46,4 +46,14 @@ public interface OrgTypeConstant { */ String COMMUNITY = "community"; + /** + * 省级 + */ + String PROVINCE = "province"; + + /** + * 市级 + */ + String CITY = "city"; + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java index e099b5f89d..ec417c1c60 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java @@ -82,4 +82,15 @@ public interface ProjectConstant { */ String PROJECT_ORIGIN_AGENCY="agency"; String PROJECT_ORIGIN_EVENT="resi_event"; + /** + * 自办 + */ + String PROJECT_SELF_CLOSED="01"; + /** + * 上报 + */ + String PROJECT_REPORT="02"; + + String PROJECT_STATUS_CLOSED = "closed"; + String PROJECT_STATUS_ALL = "all"; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DataReportingController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DataReportingController.java new file mode 100644 index 0000000000..85706430c4 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DataReportingController.java @@ -0,0 +1,106 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.basereport.form.EventInfoFormDTO; +import com.epmet.dto.basereport.result.EventInfoResultDTO; +import com.epmet.dto.org.form.GridBaseInfoFormDTO; +import com.epmet.dto.org.result.CustomerAgencyDTO; +import com.epmet.dto.org.result.CustomerGridDTO; +import com.epmet.dto.user.form.StaffBaseInfoFormDTO; +import com.epmet.dto.user.param.MidPatrolFormDTO; +import com.epmet.dto.user.result.GridUserInfoDTO; +import com.epmet.dto.user.result.MidPatrolDetailResult; +import com.epmet.dto.user.result.MidPatrolRecordResult; +import com.epmet.opendata.dto.BaseDisputeProcessDTO; +import com.epmet.service.DataReportingService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * @dscription 省网格化平台数据上报--数据查询 + * @author sun + */ +@RequestMapping("datareporting") +@RestController +public class DataReportingController { + @Autowired + private DataReportingService dataReportingService; + + /** + * @Author sun + * @Description 批量查询客户组织基础信息 + **/ + @PostMapping("agencybaseinfo") + public Result> getAgencyBaseInfo(@RequestBody(required = false) GridBaseInfoFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, GridBaseInfoFormDTO.Grid.class); + return new Result>().ok(dataReportingService.getAgencyBaseInfo(formDTO)); + } + + /** + * @Author sun + * @Description 批量查询客户网格基础信息 + **/ + @PostMapping("gridbaseinfo") + public Result> getGridBaseInfo(@RequestBody(required = false) GridBaseInfoFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, GridBaseInfoFormDTO.Grid.class); + return new Result>().ok(dataReportingService.getGridBaseInfo(formDTO)); + } + + /** + * @Author sun + * @Description 批量查询客户网格员基础信息 + **/ + @PostMapping("staffbaseinfo") + public Result> getStaffBaseInfo(@RequestBody(required = false) StaffBaseInfoFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, StaffBaseInfoFormDTO.Staff.class); + return new Result>().ok(dataReportingService.getStaffBaseInfo(formDTO)); + } + + + /** + * desc: 条件获取巡查主表信息 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result> + * @author LiuJanJun + * @date 2021/10/15 12:01 下午 + */ + @PostMapping("getPatrolRecordList") + public Result> getPatrolRecordList(@RequestBody(required = false) MidPatrolFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, StaffBaseInfoFormDTO.Staff.class); + return new Result>().ok(dataReportingService.getPatrolRecordList(formDTO)); + } + + /** + * desc: 条件获取巡查明细信息 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result> + * @author LiuJanJun + * @date 2021/10/15 12:01 下午 + */ + @PostMapping("getPatrolDetailList") + public Result> getPatrolDetailList(@RequestBody(required = false) MidPatrolFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, StaffBaseInfoFormDTO.Staff.class); + return new Result>().ok(dataReportingService.getPatrolDetailList(formDTO)); + } + + /** + * @Description 事件上报 + * @Param formDTO + * @Return {@link Result>} + * @Author zhaoqifeng + * @Date 2021/10/15 14:09 + */ + @PostMapping("eventinfo") + public Result> getEventInfo(@RequestBody(required = false) EventInfoFormDTO formDTO) { + return new Result>().ok(dataReportingService.getEventInfo(formDTO)); + } + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemandController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemandController.java new file mode 100644 index 0000000000..cd77d2b25a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemandController.java @@ -0,0 +1,38 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.service.DemandService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +/** + * @Description 描述 + * @Author wangxianzhang + * @Date 2021/12/8 10:44 上午 + * @Version 1.0 + */ +@RestController +@RequestMapping("demand") +public class DemandController { + + @Autowired + private DemandService demandStatsService; + + /** + * wangxianzhang + * + * 计算客户下志愿者服务相关数据 + * + * @param customerId 客户ID,可以为空,为空则计算所有客户 + * @return + */ + @PostMapping("volunteer/daily") + public Result statsVolunteerDemandServicesDaily(@RequestParam(value = "customer-id", required = false) String customerId) { + + demandStatsService.statsVolunteerDemandServicesDaily(customerId); + + return new Result(); + } + + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java index c053346087..ef567e92f1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java @@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.redis.RedisKeys; +import com.epmet.commons.tools.redis.RedisUtils; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; @@ -60,9 +62,9 @@ import org.springframework.web.bind.annotation.*; import java.math.BigDecimal; import java.time.LocalDate; import java.time.LocalDateTime; +import java.util.*; import java.util.ArrayList; import java.util.Date; -import java.util.ArrayList; import java.util.List; import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; @@ -74,7 +76,8 @@ import java.util.concurrent.Future; public class DemoController { @Autowired private StatsDemoService demoService; - + @Autowired + private RedisUtils redisUtils; @Autowired private ExecutorService executorService; @@ -136,6 +139,8 @@ public class DemoController { private FactGridMemberStatisticsDailyService factGridMemberStatisticsDailyService; @Autowired private DimCustomerService dimCustomerService; + @Autowired + private ScreenProjectDataService screenProjectDataService; @GetMapping("testAlarm") public void testAlarm() { @@ -153,7 +158,7 @@ public class DemoController { */ @GetMapping("testthreadpool") public void testThreadPool() { - System.out.println(LocalDateTime.now().getSecond());; + System.out.println(LocalDateTime.now().getSecond()); System.out.println("----------->>"); Future future1 = executorService.submit(() -> demoService.testThreadPool()); @@ -596,16 +601,15 @@ public class DemoController { private CalGridIndexService calGridIndexService; @PostMapping("gridparty") - public void gridParty(){ - String customerId = "45687aa479955f9d06204d415238f7cc"; -// String customerId = "epmettest"; - String monthId = "202009"; + public Result gridParty(@RequestParam("customerId")String customerId,@RequestParam("monthId")String monthId){ calGridIndexService.calGridIndexPartyAbility(customerId,monthId); + return new Result(); } @PostMapping("gridgovern") - public void gridGovern(@RequestParam("customerId")String customerId,@RequestParam("monthId")String monthId){ + public Result gridGovern(@RequestParam("customerId")String customerId,@RequestParam("monthId")String monthId){ calGridIndexService.calGridIndexGovernAbility(customerId,monthId); + return new Result(); } @PostMapping("gridservice") @@ -760,6 +764,7 @@ public class DemoController { orgRankExtractService.extractGridData(formDTO.getCustomerId(), formDTO.getDateId()); orgRankExtractService.extractCommunityData(formDTO.getCustomerId(), formDTO.getDateId()); orgRankExtractService.extractStreetData(formDTO.getCustomerId(), formDTO.getDateId()); + orgRankExtractService.extractDistrictData(formDTO.getCustomerId(), formDTO.getDateId()); return new Result(); } @@ -943,9 +948,25 @@ public class DemoController { @Autowired private ScreenProjectCategoryOrgDailyService screenProjectCategoryOrgDailyService; - @PostMapping("orgdaily") - public Result orgDaily(@RequestParam("customerId")String customerId,@RequestParam("dateId")String dateId){ - screenProjectCategoryOrgDailyService.extractProjectCategoryOrgData(customerId,dateId); + @PostMapping("gridandorgdaily") + public Result orgDaily(@RequestParam("customerId")String customerId,@RequestParam("dateId")String dateId, + @RequestParam(name = "startDate",required = false)String startDate, + @RequestParam(name = "endDate",required = false)String endDate + ){ + long start = System.currentTimeMillis(); + if (StringUtils.isNotBlank(startDate) && StringUtils.isNotBlank(endDate)){ + List daysBetween = DateUtils.getDaysBetween(startDate, endDate); + daysBetween.forEach(d -> { + projectCategoryGridDailyService.extractProjectCategoryData(customerId,d); + screenProjectCategoryOrgDailyService.extractProjectCategoryOrgData(customerId,d); + }); + }else { + projectCategoryGridDailyService.extractProjectCategoryData(customerId,dateId); + screenProjectCategoryOrgDailyService.extractProjectCategoryOrgData(customerId,dateId); + } + long end = System.currentTimeMillis(); + long l = (end - start) / 1000; + log.info("gridAndOrgDaily耗时" + l+ "s"); return new Result(); } @@ -1052,4 +1073,39 @@ public class DemoController { customerAgencyService.sysAgencyInfo(formDTO.getFromCustomerId(), formDTO.getToCustomerId()); return new Result(); } + + @PostMapping("extractCategory") + public Result extractCategory(@RequestBody StatsFormDTO formDTO) { + screenProjectDataService.extractCategory(formDTO.getCustomerId()); + return new Result(); + } + + @Autowired + private ScreenProjectCategoryGridAndOrgDailyService screenProjectCategoryGridAndOrgDailyService; + + @PostMapping("gridandorgdailynew") + public Result gridAndDaily(@RequestParam("customerId")String customerId,@RequestParam("dateId")String dateId, + @RequestParam(name = "startDate",required = false)String startDate, + @RequestParam(name = "endDate",required = false)String endDate + ){ + + long start = System.currentTimeMillis(); + Set result = new LinkedHashSet<>(); + if (StringUtils.isNotBlank(startDate) && StringUtils.isNotBlank(endDate)){ + List daysBetween = DateUtils.getDaysBetween(startDate, endDate); + daysBetween.forEach(d -> { + screenProjectCategoryGridAndOrgDailyService.extractCategoryProjectGridData(customerId,d); + screenProjectCategoryGridAndOrgDailyService.extractCategoryProjectOrgData(customerId,d); + result.add(d); + redisUtils.hSet(RedisKeys.getBackDoorbizExcuteResult("gridandorgdailynew"),customerId,result,3*24*60*60L); + }); + }else { + screenProjectCategoryGridAndOrgDailyService.extractCategoryProjectGridData(customerId,dateId); + screenProjectCategoryGridAndOrgDailyService.extractCategoryProjectOrgData(customerId,dateId); + redisUtils.hSet(RedisKeys.getBackDoorbizExcuteResult("gridandorgdailynew"),customerId,result,3*24*60*60L); + } + long end = System.currentTimeMillis(); + long l = (end - start) / 1000; + return new Result().ok("gridAndOrgDaily耗时" + l+ "s"); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactAggregationExtractController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactAggregationExtractController.java index c0618c9250..c05e3d4b7b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactAggregationExtractController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactAggregationExtractController.java @@ -1,6 +1,12 @@ package com.epmet.controller; +import cn.hutool.core.thread.ThreadUtil; +import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.enums.BizTypeEnum; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.StatsFormDTO; @@ -14,8 +20,10 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; -import java.util.Date; import java.util.List; +import java.util.Set; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; /** * @author liujianjun @@ -49,42 +57,101 @@ public class FactAggregationExtractController { * @date 2020/11/10 3:14 下午 */ @RequestMapping("extractDailyOrMonthly") - public Result extractDaily(@RequestBody AggregationExtractFormDTO formDTO) { + public Result extractDailyOrMonthly(@RequestBody AggregationExtractFormDTO formDTO) { if (StringUtils.isBlank(formDTO.getStartDate()) && StringUtils.isBlank(formDTO.getEndDate())) { log.error("抽取日期范围不能为空"); return new Result().error(); } - if (formDTO.getStartDate().indexOf(StrConstant.HYPHEN) < 0 || formDTO.getEndDate().indexOf(StrConstant.HYPHEN) < 0) { + if (!formDTO.getStartDate().contains(StrConstant.HYPHEN) || !formDTO.getEndDate().contains(StrConstant.HYPHEN)) { log.error("抽取日期范围格式不正确,yyyy-MM-dd"); return new Result().error(); } + + BizTypeEnum bizTypeEnum = null; + + Set bizType = formDTO.getBizType(); + for (String item : bizType) { + bizTypeEnum = BizTypeEnum.getEnum(item); + if (bizTypeEnum == null) { + log.error("抽取业务类型不正确,BizTypeEnum"); + throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode()); + } + } + + List daysBetween = DateUtils.getDaysBetween(formDTO.getStartDate(), formDTO.getEndDate(), DateUtils.DATE_PATTERN, DateUtils.DATE_PATTERN); - daysBetween.forEach(dateId -> { - Date date = DateUtils.parse(dateId, DateUtils.DATE_PATTERN); + for (String dateId : daysBetween) { StatsFormDTO param = new StatsFormDTO(); param.setCustomerId(formDTO.getCustomerId()); param.setDate(dateId); - switch (formDTO.getType()) { - case "monthly": + if ("monthly".equals(formDTO.getType())) { + if (bizType.isEmpty() || bizType.contains(BizTypeEnum.GROUP.getType())) { extractGroupDataMonthly(param); + } + if (bizType.isEmpty() || bizType.contains(BizTypeEnum.ARTICLE.getType())) { extractArticleDataMonthlyAndQuarterly(param); + } + } else { + //todo 如果要加方法 记得这个枚举里要加 + int threadCount = bizType.isEmpty() ? BizTypeEnum.values().length : bizType.size(); + System.out.println(threadCount); + CountDownLatch countDownLatch = ThreadUtil.newCountDownLatch(threadCount); + if (bizType.isEmpty() || bizType.contains(BizTypeEnum.USER.getType())) { + ThreadUtil.execute(() -> { + extractUserDataDaily(param); + countDownLatch.countDown(); + }); + } + if (bizType.isEmpty() || bizType.contains(BizTypeEnum.GROUP.getType())) { + ThreadUtil.execute(() -> { + extractGroupDataDaily(param); + countDownLatch.countDown(); + }); + } + if (bizType.isEmpty() || bizType.contains(BizTypeEnum.TOPIC.getType())) { + ThreadUtil.execute(() -> { + extractTopicDataDaily(param); + countDownLatch.countDown(); + }); + } + if (bizType.isEmpty() || bizType.contains(BizTypeEnum.ISSUE.getType())) { + ThreadUtil.execute(() -> { + extractIssueDataDaily(param); + countDownLatch.countDown(); + }); + } + if (bizType.isEmpty() || bizType.contains(BizTypeEnum.PROJECT.getType())) { + ThreadUtil.execute(() -> { + extractProjectDataDaily(param); + countDownLatch.countDown(); + }); + } + if (bizType.isEmpty() || bizType.contains(BizTypeEnum.ARTICLE.getType())) { + ThreadUtil.execute(() -> { + extractAtricleDataDaily(param); + countDownLatch.countDown(); + }); + } + try { + //如果半小时还没执行完 则中断 说明执行方法有问题 要优化 + countDownLatch.await(NumConstant.THIRTY, TimeUnit.MINUTES); + } catch (InterruptedException e) { + log.error("extractDailyOrMonthly dateId:{} 始终没有结束 中断操作 InterruptedException", dateId); break; - default: - extractUserDataDaily(param); - extractGroupDataDaily(param); - extractTopicDataDaily(param); - extractIssueDataDaily(param); - extractProjectDataDaily(param); - extractAtricleDataDaily(param); + } } - }); + + log.info("extractDailyOrMonthly dateId:{} run end", dateId); + } + return new Result(); } private void extractUserDataDaily(StatsFormDTO formDTO) { try { statsUserService.partition(formDTO); + log.info("extractUserDataDaily end param:{}", JSON.toJSONString(formDTO)); } catch (Exception e) { log.error("抽取【用户】数据失败", e); } @@ -93,6 +160,7 @@ public class FactAggregationExtractController { private void extractTopicDataDaily(StatsFormDTO formDTO) { try { statsTopicService.partition(formDTO); + log.info("extractTopicDataDaily end param:{}", JSON.toJSONString(formDTO)); } catch (Exception e) { log.error("抽取【话题】数据失败", e); } @@ -101,6 +169,7 @@ public class FactAggregationExtractController { private void extractIssueDataDaily(StatsFormDTO formDTO) { try { statsIssueService.agencyGridIssueStats(formDTO); + log.info("extractIssueDataDaily end param:{}", JSON.toJSONString(formDTO)); } catch (Exception e) { log.error("抽取【议题】数据失败", e); } @@ -110,6 +179,7 @@ public class FactAggregationExtractController { try { statsProjectService.gridProjectStats(formDTO); statsProjectService.agencyProjectStats(formDTO); + log.info("extractProjectDataDaily end param:{}", JSON.toJSONString(formDTO)); } catch (Exception e) { log.error("抽取【项目】数据失败", e); } @@ -120,6 +190,7 @@ public class FactAggregationExtractController { statsPublicityService.articleSummaryDailyStatsjob(formDTO); statsPublicityService.tagUsedDailyStatsjob(formDTO); statsPublicityService.tagViewedDailyStatsjob(formDTO); + log.info("extractAtricleDataDaily end param:{}", JSON.toJSONString(formDTO)); } catch (Exception e) { log.error("抽取【文章】数据失败", e); } @@ -133,6 +204,7 @@ public class FactAggregationExtractController { statsGroupService.groupGridDaily(groupStatsFormDTO); statsGroupService.groupAgencyDaily(groupStatsFormDTO); + log.info("extractGroupDataDaily end param:{}", JSON.toJSONString(formDTO)); } catch (Exception e) { log.error("抽取【小组】数据失败", e); } @@ -145,6 +217,7 @@ public class FactAggregationExtractController { groupStatsFormDTO.setCustomerId(formDTO.getCustomerId()); statsGroupService.groupAgencyMonthly(groupStatsFormDTO); + log.info("extractGroupDataMonthly end param:{}", JSON.toJSONString(formDTO)); } catch (Exception e) { log.error("抽取【小组】数据失败", e); } @@ -156,6 +229,7 @@ public class FactAggregationExtractController { statsPublicityService.tagUsedQuarterlyStatsjob(formDTO); statsPublicityService.tagViewedMonthlyStatsjob(formDTO); statsPublicityService.tagViewedQuarterlyStatsjob(formDTO); + log.info("extractArticleDataMonthlyAndQuarterly end param:{}", JSON.toJSONString(formDTO)); } catch (Exception e) { log.error("抽取【文章】数据失败", e); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginExtractController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginExtractController.java index 49d462eaa0..8d86caed9c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginExtractController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginExtractController.java @@ -95,12 +95,26 @@ public class FactOriginExtractController { @PostMapping("project") public Result projectData(@RequestBody ExtractOriginFormDTO extractOriginFormDTO) { - List customerIds = dimCustomerService.selectCustomerIdPage(1, 100); - customerIds.forEach(customerId -> { - ExtractOriginFormDTO dto = new ExtractOriginFormDTO(); - dto.setCustomerId(customerId); - projectExtractService.saveOriginProjectDaily(dto); - }); + if (StringUtils.isNotBlank(extractOriginFormDTO.getCustomerId())) { + List daysBetween; + if (StringUtils.isBlank(extractOriginFormDTO.getDateId())) { + daysBetween = DateUtils.getDaysBetween(extractOriginFormDTO.getStartDate(), extractOriginFormDTO.getEndDate()); + daysBetween.forEach(dateId -> { + extractOriginFormDTO.setDateId(dateId); + projectExtractService.saveOriginProjectDaily(extractOriginFormDTO); + }); + } else{ + projectExtractService.saveOriginProjectDaily(extractOriginFormDTO); + } + + } else { + List customerIds = dimCustomerService.selectCustomerIdPage(1, 100); + customerIds.forEach(customerId -> { + ExtractOriginFormDTO dto = new ExtractOriginFormDTO(); + dto.setCustomerId(customerId); + projectExtractService.saveOriginProjectDaily(dto); + }); + } return new Result(); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/external/ScreenProjectDataCollController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/external/ScreenProjectDataCollController.java index 7d4c7e9c71..85dad1166f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/external/ScreenProjectDataCollController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/external/ScreenProjectDataCollController.java @@ -1,7 +1,9 @@ package com.epmet.controller.external; +import com.epmet.commons.rocketmq.messages.DisputeProcessMQMsg; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.constant.SystemMessageType; import com.epmet.dto.screen.*; import com.epmet.dto.screen.form.CategoryDictFormDTO; import com.epmet.dto.screen.form.ScreenProjectDataInfoFormDTO; @@ -13,6 +15,9 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import java.util.ArrayList; +import java.util.List; + /** * @Description 事件/项目采集接口入口 * @ClassName ScreenProjectDataCollController @@ -135,6 +140,15 @@ public class ScreenProjectDataCollController { param.setCustomerId(customerId); ValidatorUtils.validateEntity(param, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DateIdShowGroup.class, ScreenCollFormDTO.DataListShowGroup.class); projectDataService.collect(param); + + //发送MQ消息,上报事件 + param.getDataList().forEach(item -> { + List projectList = new ArrayList<>(); + projectList.add(item.getProjectId()); + DisputeProcessMQMsg msg = new DisputeProcessMQMsg(param.getCustomerId(), projectList, SystemMessageType.PROJECT_ADD); + projectDataService.sendProjectChangeMq(msg); + }); + return new Result(); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java index 42e671c2b7..b993336497 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java @@ -67,13 +67,13 @@ public interface FactOriginIssueMainDailyDao extends BaseDao selectIssueTotal(@Param("customerId") String customerId,@Param("monthId") String monthId); /** - * @Description 查询俩月的网格议题总数 + * @Description 查询议题转项目总数 * @param customerId * @param monthId * @author zxc * @date 2020/9/18 10:20 上午 */ - List selectIssueTotalTwoMonthPlus(@Param("customerId")String customerId,@Param("monthId") String monthId,@Param("minusMonthId") String minusMonthId); + List selectIssueTotalShiftProject(@Param("customerId")String customerId, @Param("monthId") String monthId); /** * @Description 网格总项目数 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectCategoryDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectCategoryDailyDao.java index 58ba1f5bc9..e520998bda 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectCategoryDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectCategoryDailyDao.java @@ -42,7 +42,7 @@ public interface FactOriginProjectCategoryDailyDao extends BaseDao selectListProjectCategoryGridDailyDTO(@Param("customerId") String customerId,@Param("subCount")Integer subCount); + List selectListProjectCategoryGridDailyDTO(@Param("customerId") String customerId,@Param("subCount")Integer subCount,@Param("projectType")String projectType); /** * @Description 查询客户下,组织直接立项的,各项目分类下的项目数量【筛选组织创建的项目,fact_origin_project_main_daily表gridId为空】 @@ -50,7 +50,8 @@ public interface FactOriginProjectCategoryDailyDao extends BaseDao selectListProjectCategoryByOrg(@Param("orgIds")List orgIds,@Param("customerId") String customerId,@Param("subCount") Integer subCount); + List selectListProjectCategoryByOrg(@Param("orgIds")List orgIds,@Param("customerId") String customerId, + @Param("subCount") Integer subCount,@Param("projectType")String projectType); int deleteByProjectIds(@Param("list") List list); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectLogDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectLogDailyDao.java index 45f3ba2350..4fb104b4a1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectLogDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectLogDailyDao.java @@ -288,6 +288,7 @@ public interface FactOriginProjectLogDailyDao extends BaseDao */ List selectGridClosed(@Param("customerId") String customerId, @Param("monthId") String monthId); + List selectAgencyClosed(@Param("customerId") String customerId, @Param("monthId") String monthId); /** * 网格自治率统计--按天 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java index e6155e982e..40a330fc6f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java @@ -28,6 +28,7 @@ import com.epmet.dto.extract.result.OrgNameResultDTO; import com.epmet.dto.indexcal.AgencyAndParentResultDTO; import com.epmet.dto.indexcollect.form.CustomerBizOrgFormDTO; import com.epmet.dto.screen.ScreenProjectOrgDailyDTO; +import com.epmet.dto.screen.result.GridAndOrgCategoryCountResultDTO; import com.epmet.dto.screen.result.TreeResultDTO; import com.epmet.dto.screencoll.form.CustomerAgencyFormDTO; import com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity; @@ -206,7 +207,7 @@ public interface ScreenCustomerAgencyDao extends BaseDao selectAgencyByCustomer(@Param("customerId")String customerId); - List selectAgencyByAreaCode(String areaCode); + List selectAgencyByAreaCode(@Param("areaCode") String areaCode); /** * @Description 根据areaCode查询下级组织 @@ -244,4 +245,15 @@ public interface ScreenCustomerAgencyDao extends BaseDao selectByCustomerId(@Param("customerId") String customerId); + /** + * @Description 查询父子客户的组织【平阴】 + * @param customerIds 平阴,榆山,锦水的客户ID + * @param customerId 孔村的客户ID🤬 + * @author zxc + * @date 2021/11/10 2:52 下午 + */ + List selectParentSonAgency(@Param("customerIds") List customerIds ,@Param("customerId") String customerId); + + + String getParentAgencyId(@Param("agencyId") String agencyId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectCategoryDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectCategoryDao.java new file mode 100644 index 0000000000..08d28b6c86 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectCategoryDao.java @@ -0,0 +1,36 @@ +/** + * 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.dao.evaluationindex.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.evaluationindex.screen.ScreenProjectCategoryEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 项目所属分类表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-10 + */ +@Mapper +public interface ScreenProjectCategoryDao extends BaseDao { + void deleteByProjectIds(@Param("customerId") String customerId, @Param("projectIds") List projectIds); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.java index d5336c4a34..51cb145080 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.java @@ -18,6 +18,7 @@ package com.epmet.dao.evaluationindex.screen; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.project.result.ClosedProjectTotalResultDTO; import com.epmet.dto.screen.result.CategoryProjectResultDTO; import com.epmet.entity.evaluationindex.screen.ScreenProjectCategoryOrgDailyEntity; import com.sun.org.apache.xpath.internal.operations.Bool; @@ -55,16 +56,28 @@ public interface ScreenProjectCategoryOrgDailyDao extends BaseDao selectOrgCategoryInfo(@Param("customerId") String customerId, @Param("dateId") String dateId,@Param("level")String level); /** - * @Description 查询组织分类信息【多客户】 + * @Description 查询组织分类信息【多客户】父客户存在的分类 * @Param customerId * @Param dateId * @Param level - * @Param existsStatus 父客户是否存在 * @author zxc * @date 2021/3/24 下午2:48 */ List selectOrgCategoryMoreCustomerInfo(@Param("customerIds")List customerIds, @Param("dateId") String dateId, - @Param("level")String level, @Param("customerId")String customerId, @Param("existsStatus")Boolean existsStatus); + @Param("level")String level, @Param("customerId")String customerId); + + /** + * @Description 查询组织分类信息【多客户】父客户存在的分类 + * @param customerIds + * @param dateId + * @param level + * @param customerId + * @author zxc + * @date 2021/10/21 4:03 下午 + */ + List selectOrgCategoryMoreCustomerInfoNotExists(@Param("customerIds")List customerIds, @Param("dateId") String dateId, + @Param("level")String level, @Param("customerId")String customerId); + /** * @Description 查询组织分类信息【多客户】升级版 * @Param customerIds @@ -94,4 +107,15 @@ public interface ScreenProjectCategoryOrgDailyDao extends BaseDao selectSelfAgencyCategory(@Param("dateId") String dateId,@Param("orgIds")List orgIds); + + /** + * @Description 查询父客户 存在 分类的结案项目数 + * @param customerIds + * @param dateId + * @author zxc + * @date 2021/11/4 9:26 上午 + */ + List selectClosedProjectTotal(@Param("customerIds")List customerIds, @Param("dateId") String dateId, + @Param("status")Boolean status); + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectDataDao.java index 4083242997..701348e39a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectDataDao.java @@ -19,6 +19,7 @@ package com.epmet.dao.evaluationindex.screen; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.screen.ScreenProjectDataDTO; +import com.epmet.dto.screen.result.GridAndOrgCategoryCountResultDTO; import com.epmet.entity.evaluationindex.screen.ScreenProjectDataEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -66,4 +67,48 @@ public interface ScreenProjectDataDao extends BaseDao { void deleteByProjectIds(@Param("customerId") String customerId, @Param("list") List list); int updateProjectSatisfactionScore(@Param("projectId")String projectId, @Param("score")BigDecimal score); + + List selectProjectList(@Param("customerId") String customerId, @Param("projectIds") List projectIds); + + /** + * @Description 查询网格下的项目分类 + * @param customerIds 父子客户的customerId + * @param dateId 日期ID + * @param status 所有项目:all,已结案项目:closed + * @param customerId 父级客户ID + * @param subCount 分类截取位数 + * @author zxc + * @date 2021/11/10 3:12 下午 + */ + List selectGridCategoryProjectCount(@Param("dateId") String dateId,@Param("parentCustomerId") String parentCustomerId, + @Param("status")String status,@Param("customerId") String customerId, + @Param("subCount")Integer subCount); + + /** + * @Description 查询组织下的项目分类 + * @param dateId 日期ID + * @param status 所有项目:all,已结案项目:closed + * @param customerId 父级客户ID + * @param subCount 分类截取位数 + * @author zxc + * @date 2021/11/10 3:14 下午 + */ + List selectOrgCategoryProjectCount(@Param("dateId") String dateId, @Param("status")String status, + @Param("customerId") String customerId, @Param("subCount")Integer subCount, + @Param("allAgencies") List allAgencies); + + /** + * @Description 查询组织下的1级项目分类 + * @param dateId + * @param status + * @param customerId + * @param subCount + * @param allAgencies + * @author zxc + * @date 2021/11/11 11:14 上午 + */ + List selectOrgCategoryOneLevelProjectCount(@Param("dateId") String dateId, @Param("status")String status, + @Param("customerId") String customerId, @Param("subCount")Integer subCount, + @Param("allAgencies") List allAgencies); + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectQuantityOrgMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectQuantityOrgMonthlyDao.java index 3adec6357e..c93bb34b58 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectQuantityOrgMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectQuantityOrgMonthlyDao.java @@ -48,7 +48,9 @@ public interface ScreenProjectQuantityOrgMonthlyDao extends BaseDao selectQuantityOrgMonthly(@Param("agencyInfos") List agencyInfos, @Param("monthId") String monthId); + List selectQuantityOrgMonthly( + @Param("agencyInfos") List agencyInfos, + @Param("monthId") String monthId); List selectQuantityOrgMonthlyByAgency(@Param("agencyInfos") List agencyInfos, @Param("monthId") String monthId); /** @@ -58,7 +60,9 @@ public interface ScreenProjectQuantityOrgMonthlyDao extends BaseDao selectQuantityGrandOrgMonthly(@Param("agencyInfos") List agencyInfos, @Param("monthId") String monthId); + List selectQuantityGrandOrgMonthly( + @Param("agencyInfos") List agencyInfos, + @Param("monthId") String monthId); List selectQuantityGrandOrgMonthlyByAgency(@Param("agencyInfos") List agencyInfos, @Param("monthId") String monthId); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/heart/IcUserDemandServiceDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/heart/IcUserDemandServiceDao.java new file mode 100644 index 0000000000..165ae6b91c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/heart/IcUserDemandServiceDao.java @@ -0,0 +1,44 @@ +/** + * 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.dao.heart; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.heart.result.DemandServiceCountResultDTO; +import com.epmet.entity.heart.IcUserDemandServiceEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + +/** + * 居民需求服务记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-19 + */ +@Mapper +public interface IcUserDemandServiceDao extends BaseDao { + + /** + * 需求服务次数查询 + * @param customerId 客户id + * @param serviceType 服务者类型 + */ + List listDemandServeTimes(@Param("customerId") String customerId, @Param("endTime") Date endTime, @Param("serviceType") String serviceType); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/heart/VolunteerInfoDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/heart/VolunteerInfoDao.java new file mode 100644 index 0000000000..11b5aad534 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/heart/VolunteerInfoDao.java @@ -0,0 +1,33 @@ +/** + * 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.dao.heart; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.heart.VolunteerInfoEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 志愿者信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-12-08 + */ +@Mapper +public interface VolunteerInfoDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/StatsIssueDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/StatsIssueDao.java index ac3043d843..b57cbc0320 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/StatsIssueDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/StatsIssueDao.java @@ -3,7 +3,6 @@ package com.epmet.dao.issue; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.extract.result.IssueInfoResultDTO; import com.epmet.dto.extract.result.IssueProcessInfoResultDTO; -import com.epmet.dto.extract.result.IssueVoteStatisticalResultDTO; import com.epmet.dto.extract.result.SatisfactionInfoResultDTO; import com.epmet.dto.issue.*; import com.epmet.entity.issue.IssueEntity; @@ -173,22 +172,8 @@ public interface StatsIssueDao extends BaseDao { */ List selectIssueVoteInfo(@Param("customerId") String customerId, @Param("dateId") String dateId); - /** - * desc: 根据客户id 获取当前议题的情况 - * - * @param customerId - * @param dateId - * @return java.util.List - * @author LiuJanJun - * @date 2020/9/27 1:22 下午 - */ - List selectIssueVoteStatis(@Param("customerId") String customerId, @Param("dateId") String dateId); - List selectCategory(@Param("customerId") String customerId, @Param("ids") Set set); - - List getIssueTotalList(@Param("customerId") String customerId, @Param("date") String date); - /** * @Author sun * @Description 查询议题库已删除网格下可能存在的项目Id集合 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/CustomerGridDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/CustomerGridDao.java index a2123a127f..688807259e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/CustomerGridDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/CustomerGridDao.java @@ -23,6 +23,10 @@ import com.epmet.dto.group.result.AgencyGridTotalCountResultDTO; import com.epmet.dto.group.result.GridIdListByCustomerResultDTO; import com.epmet.dto.org.CustomerStaffGridDTO; import com.epmet.dto.org.GridInfoDTO; +import com.epmet.dto.org.form.GridBaseInfoFormDTO; +import com.epmet.dto.org.result.CustomerGridDTO; +import com.epmet.dto.user.form.StaffBaseInfoFormDTO; +import com.epmet.dto.user.result.GridUserInfoDTO; import com.epmet.entity.org.CustomerGridEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -95,4 +99,16 @@ public interface CustomerGridDao extends BaseDao { * @Description 查询客户已删除网格列表 **/ List selectDelGridList(@Param("customerId") String customerId); + + /** + * @Author sun + * @Description 批量查询客户网格基础信息 + **/ + List getGridBaseInfo(GridBaseInfoFormDTO formDTO); + + /** + * @Author sun + * @Description 查询工作人员所属网格信息 + **/ + List getStaffGrid(StaffBaseInfoFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/StatsCustomerAgencyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/StatsCustomerAgencyDao.java index 5745ff7cca..a16f40e204 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/StatsCustomerAgencyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/StatsCustomerAgencyDao.java @@ -2,6 +2,8 @@ package com.epmet.dao.org; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.AgencySubTreeDto; +import com.epmet.dto.org.form.GridBaseInfoFormDTO; +import com.epmet.dto.org.result.CustomerAgencyDTO; import com.epmet.dto.org.result.CustomerAreaCodeResultDTO; import com.epmet.dto.org.result.OrgStaffDTO; import com.epmet.entity.org.CustomerAgencyEntity; @@ -71,4 +73,10 @@ public interface StatsCustomerAgencyDao extends BaseDao { CustomerAgencyEntity selectByDeptId(String deptId); CustomerAgencyEntity selecByAreaCode(@Param("customerId")String customerId, @Param("areaCode")String areaCode); + + /** + * @Author sun + * @Description 批量查询客户组织基础信息 + **/ + List getAgencyBaseInfo(GridBaseInfoFormDTO formDTO); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactVolunteerServiceDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactVolunteerServiceDailyDao.java new file mode 100644 index 0000000000..605364c820 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactVolunteerServiceDailyDao.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.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactVolunteerServiceDailyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 志愿者服务情况统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-12-08 + */ +@Mapper +public interface FactVolunteerServiceDailyDao extends BaseDao { + + /** + * 删除指定客户,指定dateId的志愿者服务统计记录 + * @param customerIds + * @param dateDimId + */ + void clearVolunteerDemandServiceDailyStats(@Param("customerIds") List customerIds, @Param("dateDimId") String dateDimId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserGridMonthlyDao.java index 3eef3fda97..1361bdbf0a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserGridMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserGridMonthlyDao.java @@ -48,6 +48,16 @@ public interface FactRegUserGridMonthlyDao extends BaseDao selectGridUserCount(String customerId, String monthId); + /** + * 网格相关-党建能力:网格群众用户数、网格党员用户数 + * 从fact_reg_user_grid_daily这个表 sum增量,为了与运营端数据导出一致 + * + * @param customerId + * @param monthId + * @return + */ + List selectGridUserCountFromDaily(@Param("customerId") String customerId, @Param("monthId")String monthId); + /** * 查询网格下各用户数量 * @author zhaoqifeng diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java index 8e03a5abc2..584bfdf64c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java @@ -5,6 +5,8 @@ import com.epmet.dto.extract.form.StaffPatrolStatsFormDTO; import com.epmet.dto.extract.result.UserPartyResultDTO; import com.epmet.dto.screen.ScreenProjectDataDTO; import com.epmet.dto.stats.form.GmUploadEventFormDTO; +import com.epmet.dto.user.form.StaffBaseInfoFormDTO; +import com.epmet.dto.user.param.MidPatrolFormDTO; import com.epmet.dto.user.result.*; import com.epmet.entity.evaluationindex.screen.ScreenPartyUserRankDataEntity; import org.apache.ibatis.annotations.Mapper; @@ -252,5 +254,17 @@ public interface UserDao { * @author sun */ int saveOrUpGmUploadEvent(@Param("list") List list); + + /** + * @Author sun + * @Description 批量查询客户网格员基础信息 + **/ + List getStaffBaseInfo(StaffBaseInfoFormDTO formDTO); + + List getPatrolRecordList(MidPatrolFormDTO formDTO); + + List getPatrolDetailList(MidPatrolFormDTO formDTO); + + List filterUserIds(@Param("userIds") List userIds, @Param("roleKey") String roleKey); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactAgencyGovernDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactAgencyGovernDailyEntity.java index 2f37f9a113..95f48fdeee 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactAgencyGovernDailyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactAgencyGovernDailyEntity.java @@ -150,7 +150,14 @@ public class FactAgencyGovernDailyEntity extends BaseEpmetEntity { * 10、当前组织内,未出小组即未转议题的:话题关闭无需解决数 */ private Integer inGroupTopicUnResolvedCount; - + /** + * 11、当前组织内:来源于事件的项目:结案已解决数 + */ + private Integer eventResolvedCount; + /** + * 12、当前组织内:来源于事件的项目:结案无需解决数 + */ + private Integer eventUnResolvedCount; /** * 未出当前网格的,结案项目数 */ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactGridGovernDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactGridGovernDailyEntity.java index 22fa2b2b67..827a6fdf75 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactGridGovernDailyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactGridGovernDailyEntity.java @@ -169,6 +169,15 @@ public class FactGridGovernDailyEntity extends BaseEpmetEntity { */ private Integer gridSelfGovernProjectTotal; + /** + * 15、当前组织内:来源于事件的项目:结案已解决数 + */ + private Integer eventResolvedCount; + /** + * 16、当前组织内:来源于事件的项目:结案无需解决数 + */ + private Integer eventUnResolvedCount; + /** * 当前网格内出来的项目:由社区结案(已解决+未解决)的项目总数 @@ -208,6 +217,8 @@ public class FactGridGovernDailyEntity extends BaseEpmetEntity { this.issueProjectUnResolvedCount=NumConstant.ZERO; this.approvalProjectResolvedCount=NumConstant.ZERO; this.approvalProjectUnResolvedCount=NumConstant.ZERO; + this.eventResolvedCount=NumConstant.ZERO; + this.eventUnResolvedCount=NumConstant.ZERO; this.inGroupTopicResolvedCount=NumConstant.ZERO; this.inGroupTopicUnResolvedCount=NumConstant.ZERO; this.fromIssueResolvedInGridCount=NumConstant.ZERO; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/GovernGridClosedTotalCommonDTO.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/GovernGridClosedTotalCommonDTO.java index fcc4193885..d38e74cabb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/GovernGridClosedTotalCommonDTO.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/GovernGridClosedTotalCommonDTO.java @@ -51,6 +51,8 @@ public class GovernGridClosedTotalCommonDTO implements Serializable { */ private Integer districtDeptClosedCount; + private Integer gridSelfGovernProjectTotal; + public GovernGridClosedTotalCommonDTO(){ this.gridId = StrConstant.EPMETY_STR; this.fromIssueResolvedInGridCount=NumConstant.ZERO; @@ -60,5 +62,6 @@ public class GovernGridClosedTotalCommonDTO implements Serializable { this.communityClosedCount=NumConstant.ZERO; this.streetClosedCount=NumConstant.ZERO; this.districtDeptClosedCount=NumConstant.ZERO; + this.gridSelfGovernProjectTotal=NumConstant.ZERO; } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerAgencyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerAgencyEntity.java index cf7f550d7a..475e9907bd 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerAgencyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerAgencyEntity.java @@ -94,7 +94,6 @@ public class ScreenCustomerAgencyEntity extends BaseEpmetEntity { * 行政地区编码 */ private String areaCode; - private String sourceType; /** diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerGridEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerGridEntity.java index cbe1c62956..cf6c373dca 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerGridEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerGridEntity.java @@ -93,5 +93,8 @@ public class ScreenCustomerGridEntity extends BaseEpmetEntity { */ private String upToCal; + /** + * 地区码 + */ private String code; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectCategoryEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectCategoryEntity.java new file mode 100644 index 0000000000..4e1ea78bfe --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectCategoryEntity.java @@ -0,0 +1,68 @@ +/** + * 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.entity.evaluationindex.screen; + +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 2021-11-10 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_project_category") +public class ScreenProjectCategoryEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 项目id + */ + private String projectId; + + /** + * 分类编码 + */ + private String categoryCode; + + /** + * 所属父类分类编码 + */ + private String parentCategoryCode; + + /** + * 原始分类编码 + */ + private String originCategoryCode; + + /** + * 分类等级:1、2....;产品目前只有2级分类 + */ + private Integer level; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectCategoryGridDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectCategoryGridDailyEntity.java index 82b03555ac..2a5881cbf4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectCategoryGridDailyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectCategoryGridDailyEntity.java @@ -74,4 +74,9 @@ public class ScreenProjectCategoryGridDailyEntity extends BaseEpmetEntity { * 分类等级1、2.... */ private Integer level; + + /** + * 分类下所有结案的项目 + */ + private Integer closedProjectTotal; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectCategoryOrgDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectCategoryOrgDailyEntity.java index bdfba9bbc6..2d4dd0dde2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectCategoryOrgDailyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectCategoryOrgDailyEntity.java @@ -82,6 +82,11 @@ public class ScreenProjectCategoryOrgDailyEntity extends BaseEpmetEntity { */ private Integer projectTotal; + /** + * 分类下所有结案项目数 + */ + private Integer closedProjectTotal; + /** * 分类等级1、2.... */ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectDataEntity.java index ac4775c311..85b81560e2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectDataEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectDataEntity.java @@ -143,7 +143,7 @@ public class ScreenProjectDataEntity extends BaseEpmetEntity { /** * 结案日期 */ - private String closeCaseTime; + private Date closeCaseTime; /** * 数据更新至: yyyy|yyyMM|yyyyMMdd @@ -159,4 +159,7 @@ public class ScreenProjectDataEntity extends BaseEpmetEntity { * 满意度得分 */ private BigDecimal satisfactionScore; + + private String projectCreator; + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/heart/IcUserDemandServiceEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/heart/IcUserDemandServiceEntity.java new file mode 100644 index 0000000000..002b1db875 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/heart/IcUserDemandServiceEntity.java @@ -0,0 +1,75 @@ +/** + * 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.entity.heart; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 居民需求服务记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_user_demand_service") +public class IcUserDemandServiceEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 需求id + */ + private String demandRecId; + + /** + * 服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit; + */ + private String serviceType; + + /** + * 志愿者:居民端爱心互助的志愿者userId; + */ + private String serverId; + + /** + * 实际服务开始时间 + */ + private Date serviceStartTime; + + /** + * 实际服务结束时间 + */ + private Date serviceEndTime; + + /** + * 完成情况 + */ + private String finishDesc; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/heart/VolunteerInfoEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/heart/VolunteerInfoEntity.java new file mode 100644 index 0000000000..60f41bd0fa --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/heart/VolunteerInfoEntity.java @@ -0,0 +1,71 @@ +/** + * 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.entity.heart; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 志愿者信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-12-08 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("volunteer_info") +public class VolunteerInfoEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 用户id + */ + private String userId; + + /** + * 客户id + */ + private String customerId; + + /** + * 志愿者自我介绍 + */ + private String volunteerIntroduce; + + /** + * 志愿者签名 + */ + private String volunteerSignature; + + /** + * 网格id + */ + private String gridId; + + /** + * 网格名称 + */ + private String gridName; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/issue/IssueProjectCategoryDictEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/issue/IssueProjectCategoryDictEntity.java index 67c82fee00..1c1afbcc08 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/issue/IssueProjectCategoryDictEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/issue/IssueProjectCategoryDictEntity.java @@ -80,4 +80,9 @@ public class IssueProjectCategoryDictEntity extends BaseEpmetEntity { */ private String isDisable; + /** + * 颜色 + */ + private String color; + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactVolunteerServiceDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactVolunteerServiceDailyEntity.java new file mode 100644 index 0000000000..f2b473bfe9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactVolunteerServiceDailyEntity.java @@ -0,0 +1,86 @@ +/** + * 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.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 志愿者服务情况统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-12-08 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_volunteer_service_daily") +public class FactVolunteerServiceDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * yyyyMMdd + */ + private String dateId; + + /** + * yyyyMM + */ + private String monthId; + + /** + * 截止到当前dateId,当前客户下,共有多少个爱心互助的志愿者 + */ + private Integer volunteerTotal; + + /** + * 截止到当前dateId,当前客户下,XX个爱心互助志愿者中,党员有多少个 + */ + private Integer partyTotal; + + /** + * 截止到当前dateId,当前客户下,XX个爱心互助志愿者中,居民有多少个 + */ + private Integer resiTotal; + + /** + * 服务总次数 + */ + private Integer serviceTotal; + + /** + * 党员服务总次数 + */ + private Integer partyServiceTotal; + + /** + * 居民服务总次数 + */ + private Integer resiServiceTotal; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/user/StatsStaffPatrolRecordDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/user/StatsStaffPatrolRecordDailyEntity.java index d0d3445589..247d87f285 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/user/StatsStaffPatrolRecordDailyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/user/StatsStaffPatrolRecordDailyEntity.java @@ -123,4 +123,5 @@ public class StatsStaffPatrolRecordDailyEntity extends BaseEpmetEntity { */ private String latestPatrolStatus; + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java index 7ad372c8cc..2f9a0d6d7a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java @@ -1,12 +1,18 @@ package com.epmet.healthcheck; import com.epmet.commons.tools.utils.Result; +import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import java.net.Inet4Address; +import java.net.InetAddress; +import java.net.UnknownHostException; + @RestController @RequestMapping("healthcheck") +@Slf4j public class HealthCheckController { /** @@ -15,7 +21,14 @@ public class HealthCheckController { */ @PostMapping("http") public Result httpHealthCheck() { - return new Result(); + InetAddress serverIp = null; + try { + serverIp = Inet4Address.getLocalHost(); + } catch (UnknownHostException e) { + e.printStackTrace(); + } + log.info("健康检查:serverName:{}", serverIp); + return new Result().ok(serverIp); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexExcelDataListener.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexExcelDataListener.java index 690543f0d2..687e04e0a7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexExcelDataListener.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexExcelDataListener.java @@ -35,7 +35,6 @@ public class IndexExcelDataListener extends AnalysisEventListener { * 每隔5条存储数据库,实际使用中可以3000条,然后清理list ,方便内存回收 */ private static volatile boolean isGroup = false; - ; AtomicInteger total = new AtomicInteger(0); Map indexDicMap = new HashMap<>(); Map indexGroupMap = new HashMap<>(); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/mq/ProjectChangedCustomListener.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/mq/ProjectChangedCustomListener.java index f62cfe09f8..94a298d514 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/mq/ProjectChangedCustomListener.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/mq/ProjectChangedCustomListener.java @@ -1,15 +1,20 @@ package com.epmet.mq; import com.alibaba.fastjson.JSON; +import com.epmet.commons.rocketmq.constants.MQUserPropertys; +import com.epmet.commons.rocketmq.messages.DisputeProcessMQMsg; import com.epmet.commons.rocketmq.messages.ProjectChangedMQMsg; import com.epmet.commons.tools.distributedlock.DistributedLock; +import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.redis.RedisKeys; import com.epmet.commons.tools.redis.RedisUtils; import com.epmet.commons.tools.utils.SpringContextUtils; +import com.epmet.constant.SystemMessageType; import com.epmet.dto.extract.form.ExtractOriginFormDTO; import com.epmet.service.evaluationindex.extract.todata.FactOriginExtractService; import com.epmet.service.evaluationindex.extract.toscreen.ScreenExtractService; +import com.epmet.service.evaluationindex.screen.ScreenProjectDataService; import com.epmet.util.DimIdGenerator; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; @@ -22,12 +27,12 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import javax.annotation.PreDestroy; +import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.concurrent.ExecutionException; import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; -import java.util.stream.Collectors; /** * @Description 项目变动-监听器 @@ -43,14 +48,21 @@ public class ProjectChangedCustomListener implements MessageListenerConcurrently private RedisUtils redisUtils; + @Override public ConsumeConcurrentlyStatus consumeMessage(List msgs, ConsumeConcurrentlyContext context) { + long start = System.currentTimeMillis(); try { - List msgStrs = msgs.stream().map(messageExt -> new String(messageExt.getBody())).distinct().collect(Collectors.toList()); - for (String msgStr : msgStrs) { - consumeMessage(msgStr); + //List msgStrs = msgs.stream().map(messageExt -> new String(messageExt.getBody())).distinct().collect(Collectors.toList()); + //for (String msgStr : msgStrs) { + // consumeMessage(msgStr); + //} + + for (MessageExt msgExt : msgs) { + consumeMessage(msgExt); } + } catch (Exception e) { //失败不重发 logger.error("consumeMessage fail,msg:{}",e.getMessage()); @@ -60,7 +72,10 @@ public class ProjectChangedCustomListener implements MessageListenerConcurrently return ConsumeConcurrentlyStatus.CONSUME_SUCCESS; } - private void consumeMessage(String msg) { + private void consumeMessage(MessageExt msgExt) { + String msg = new String(msgExt.getBody()); + String pendingMsgLabel = msgExt.getUserProperty(MQUserPropertys.BLOCKED_MSG_LABEL); + logger.info("receive customerId:{}", JSON.toJSONString(msg)); ProjectChangedMQMsg msgObj = JSON.parseObject(msg, ProjectChangedMQMsg.class); if (msgObj == null){ @@ -87,6 +102,14 @@ public class ProjectChangedCustomListener implements MessageListenerConcurrently } else { log.info("该客户的项目变动消息刚刚消费,请等待30秒,customer id:{}", msgObj.getCustomerId()); } + + if (org.apache.commons.lang.StringUtils.isNotBlank(pendingMsgLabel)) { + try { + removePendingMqMsgCache(pendingMsgLabel); + } catch (Exception e) { + logger.error("【项目变动事件监听器】-删除mq滞留消息缓存失败:{}", ExceptionUtils.getErrorStackTrace(e)); + } + } } public void consumeMessage(ProjectChangedMQMsg msgObj) { @@ -130,6 +153,22 @@ public class ProjectChangedCustomListener implements MessageListenerConcurrently SpringContextUtils.getBean(ScreenExtractService.class).extractPartData(customerId,dateId); } logger.info("consumer projectChanged msg success,{}",aBoolean); + + //发送项目数据上报的mq消息 + if ("6f203e30de1a65aab7e69c058826cd80".equals(customerId)) { + if ("issue_shift_project".equals(msgObj.getOperation()) || "created".equals(msgObj.getOperation()) || "close".equals(msgObj.getOperation())) { + String type; + if ("issue_shift_project".equals(msgObj.getOperation()) || "created".equals(msgObj.getOperation())) { + type = SystemMessageType.PROJECT_ADD; + } else { + type = SystemMessageType.PROJECT_EDIT; + } + List projectList = new ArrayList<>(); + projectList.add(msgObj.getProjectId()); + DisputeProcessMQMsg msg = new DisputeProcessMQMsg(customerId, projectList, type); + SpringContextUtils.getBean(ScreenProjectDataService.class).sendProjectChangeMq(msg); + } + } } catch (RenException e) { // 如果是我们手动抛出的异常,说明在业务可控范围内。目前不需要MQ重试 logger.error("【RocketMQ】消费项目变动消息失败:",e); @@ -151,6 +190,20 @@ public class ProjectChangedCustomListener implements MessageListenerConcurrently } + /** + * @description + * + * @param pendingMsgLabel + * @return + * @author wxz + * @date 2021.10.14 16:32:32 + */ + private void removePendingMqMsgCache(String pendingMsgLabel) { + String key = RedisKeys.blockedMqMsgKey(pendingMsgLabel); + redisUtils.delete(key); + //logger.info("【项目变动事件监听器】删除mq阻塞消息缓存成功,penddingMsgLabel:{}", pendingMsgLabel); + } + /*@Override public ConsumerConfigProperties getConsumerProperty() { ConsumerConfigProperties configProperties = new ConsumerConfigProperties(); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/DataReportingService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/DataReportingService.java new file mode 100644 index 0000000000..921a2b3dde --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/DataReportingService.java @@ -0,0 +1,72 @@ +package com.epmet.service; + +import com.epmet.dto.basereport.form.EventInfoFormDTO; +import com.epmet.dto.basereport.result.EventInfoResultDTO; +import com.epmet.dto.org.form.GridBaseInfoFormDTO; +import com.epmet.dto.org.result.CustomerAgencyDTO; +import com.epmet.dto.org.result.CustomerGridDTO; +import com.epmet.dto.user.form.StaffBaseInfoFormDTO; +import com.epmet.dto.user.param.MidPatrolFormDTO; +import com.epmet.dto.user.result.GridUserInfoDTO; +import com.epmet.dto.user.result.MidPatrolDetailResult; +import com.epmet.dto.user.result.MidPatrolRecordResult; + +import java.util.List; + +/** + * @dscription 省网格化平台数据上报--数据查询 + * @author sun + */ +public interface DataReportingService { + /** + * @Author sun + * @Description 批量查询客户组织基础信息 + * + * @return*/ + List getAgencyBaseInfo(GridBaseInfoFormDTO formDTO); + + /** + * @Author sun + * @Description 批量查询客户网格基础信息 + * + * @return*/ + List getGridBaseInfo(GridBaseInfoFormDTO formDTO); + + /** + * @Author sun + * @Description 批量查询客户网格员基础信息 + * + * @return*/ + List getStaffBaseInfo(StaffBaseInfoFormDTO formDTO); + + /** + * desc: 获取巡查记录列表 + * + * @param formDTO + * @return java.util.List + * @author LiuJanJun + * @date 2021/10/15 1:21 下午 + */ + List getPatrolRecordList(MidPatrolFormDTO formDTO); + + /** + * desc: 获取巡查明细列表 + * + * @param formDTO + * @return java.util.List + * @author LiuJanJun + * @date 2021/10/15 1:22 下午 + */ + List getPatrolDetailList(MidPatrolFormDTO formDTO); + + + /** + * 事件上报 + * @Param formDTO + * @Return {@link List} + * @Author zhaoqifeng + * @Date 2021/10/15 14:10 + */ + List getEventInfo(EventInfoFormDTO formDTO); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/DemandService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/DemandService.java new file mode 100644 index 0000000000..a5baf1a613 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/DemandService.java @@ -0,0 +1,20 @@ +package com.epmet.service; + +/** + * @Description 需求service + * @Author wangxianzhang + * @Date 2021/12/8 12:14 下午 + * @Version 1.0 + */ +public interface DemandService { + + /** + * wangxianzhang + * + * 按日统计 + * + * @param customerId 客户ID,可为空,为空计算所有 + */ + void statsVolunteerDemandServicesDaily(String customerId); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java index 445894bd66..9c02795140 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java @@ -2,7 +2,6 @@ package com.epmet.service.Issue; import com.epmet.dto.extract.result.IssueInfoResultDTO; import com.epmet.dto.extract.result.IssueProcessInfoResultDTO; -import com.epmet.dto.extract.result.IssueVoteStatisticalResultDTO; import com.epmet.dto.extract.result.SatisfactionInfoResultDTO; import com.epmet.dto.issue.IssueAgencyDTO; import com.epmet.dto.issue.IssueDTO; @@ -163,18 +162,6 @@ public interface IssueService { */ List selectIssueVoteInfo(String customerId, String dateId); - /** - * desc: 【月】查询议题支持反对及应表决人数 - * 数据由两部分组成 1:本月内已经关闭的话题的支持和反对数据 来自issue,issue_vote_statistical - * - * @param customerId - * @param monthId - * @return java.util.List - * @author LiuJanJun - * @date 2020/9/27 11:20 上午 - */ - List selectIssueVoteStatis(String customerId, String monthId); - /** * @Description 查找项目的分类名称 以-相连,以,分隔, * @param param @@ -184,27 +171,6 @@ public interface IssueService { */ Map> getIntegratedProjectCategory(Map> param,String customerId); - /** - * 获取议题总数 - * @author zhaoqifeng - * @date 2021/7/20 16:20 - * @param customerId - * @param date - * @return java.util.List - */ - List getIssueTotalList(String customerId, String date); - - - /** - * 获取议题增量 - * @author zhaoqifeng - * @date 2021/7/20 16:20 - * @param customerId - * @param date - * @return java.util.List - */ - List getIssueIncrList(String customerId, String date); - /** * @Author sun * @Description 查询议题库已删除网格下可能存在的项目Id集合 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueServiceImpl.java index b86b6daa40..3122b0a1d2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueServiceImpl.java @@ -7,7 +7,6 @@ import com.epmet.constant.DataSourceConstant; import com.epmet.dao.issue.StatsIssueDao; import com.epmet.dto.extract.result.IssueInfoResultDTO; import com.epmet.dto.extract.result.IssueProcessInfoResultDTO; -import com.epmet.dto.extract.result.IssueVoteStatisticalResultDTO; import com.epmet.dto.extract.result.SatisfactionInfoResultDTO; import com.epmet.dto.issue.*; import com.epmet.entity.issue.IssueEntity; @@ -141,11 +140,6 @@ public class IssueServiceImpl implements IssueService { return statsIssueDao.selectIssueVoteInfo(customerId, dateId); } - @Override - public List selectIssueVoteStatis(String customerId, String dateId) { - return statsIssueDao.selectIssueVoteStatis(customerId, dateId); - } - /** * @Description 查找项目的分类名称 以-相连,以,分隔, * @param param @@ -177,34 +171,6 @@ public class IssueServiceImpl implements IssueService { return map; } - /** - * 获取议题总数 - * - * @param customerId - * @param date - * @return java.util.List - * @author zhaoqifeng - * @date 2021/7/20 16:20 - */ - @Override - public List getIssueTotalList(String customerId, String date) { - return null; - } - - /** - * 获取议题增量 - * - * @param customerId - * @param date - * @return java.util.List - * @author zhaoqifeng - * @date 2021/7/20 16:20 - */ - @Override - public List getIssueIncrList(String customerId, String date) { - return null; - } - /** * @Author sun * @Description 查询议题库已删除网格下可能存在的项目Id集合 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/crm/impl/CustomerRelationServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/crm/impl/CustomerRelationServiceImpl.java index 06d2b580fc..e199d2f46c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/crm/impl/CustomerRelationServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/crm/impl/CustomerRelationServiceImpl.java @@ -67,10 +67,7 @@ public class CustomerRelationServiceImpl extends BaseServiceImpl list = baseDao.selectListByPids(customerId); - if (null == list || list.isEmpty()) { - return false; - } - return true; + return null != list && !list.isEmpty(); } /** @@ -86,4 +83,4 @@ public class CustomerRelationServiceImpl extends BaseServiceImpl gridUserCountList = userGridMonthlyService.selectGridUserCount(customerId, monthId); + List gridUserCountList = userGridMonthlyService.selectGridUserCountFromDaily(customerId, monthId); // 网格党员人均提出话题数 List partyCreateTopicCountList = topicMainService.selectCreateTopicCount(customerId, monthId, NumConstant.ONE); // 网格群众人均提出话题数 @@ -112,9 +110,9 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { // 网格的发文数量 List publishCountList = articlePublishedGridDailyService.selectArticlePublishCount(customerId, monthId); // 网格议题转项目率 - List gridIssueTotalList = issueExtractService.selectIssueTotalTwoMonth(customerId, monthId, DateUtils.minusMonthId(monthId)); - List gridProjectTotalList = issueExtractService.selectGridProjectCount(customerId, monthId, ExtractConstant.SHIFT_PROJECT); - List gridIssueShiftProjectRatio = getGridIssueShiftProjectRatio(gridIssueTotalList, gridProjectTotalList); + List gridIssueTotalShiftProjectList = issueExtractService.selectIssueTotalShiftProject(customerId, monthId); + List gridIssueTotalList = issueExtractService.selectIssueTotal(customerId, monthId); + List gridIssueShiftProjectRatio = getGridIssueShiftProjectRatio(gridIssueTotalShiftProjectList, gridIssueTotalList); // 建群党员数 List partyCreateGroupCountList = groupExtractService.selectPartyCreateGroupCount(customerId, monthId); //结合目前产品,数据来源:话题评论、议题表决 @@ -310,9 +308,13 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { List gridIssueTotalList = issueExtractService.selectIssueTotal(customerId, monthId); //网格总项目数 从议题根据状态获取 List gridProjectTotalList = issueExtractService.selectGridProjectCount(customerId, monthId, ExtractConstant.SHIFT_PROJECT); + log.info("网格总项目数{}", JSON.toJSONString(gridProjectTotalList)); //网格议题转项目率 - List gridIssueCountList = issueExtractService.selectIssueTotalTwoMonth(customerId, monthId, DateUtils.minusMonthId(monthId)); - List gridIssueShiftProjectRatio = getGridIssueShiftProjectRatio(gridIssueCountList, gridProjectTotalList); + List gridIssueCountList = issueExtractService.selectIssueTotalShiftProject(customerId, monthId); + log.info("网格近两个月的议题{}", JSON.toJSONString(gridIssueCountList)); + + List gridIssueShiftProjectRatio = getGridIssueShiftProjectRatio(gridIssueCountList, gridIssueTotalList); + log.info("网格议题转项目率{}", JSON.toJSONString(gridIssueShiftProjectRatio)); //网格自治项目数 从议题创建到项目关闭,包括处理人,自始至终没有出过议题所属网格 List projectAutoNoMyList = projectLogService.selectProjectAutoNoMy(customerId, monthId); Map autoMap = new HashMap<>(16); @@ -323,8 +325,10 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { }); } //网格办结项目数 - List gridProjectClosedTotalList = projectMainService.selectGridClosedProject(result.stream().map(m -> m.getGridId()).collect(Collectors.toList()), monthId, ExtractConstant.CLOSED); + List allGridIds = result.stream().map(GovernAbilityGridMonthlyFormDTO::getGridId).collect(Collectors.toList()); + List gridProjectClosedTotalList = projectMainService.selectGridClosedProject(allGridIds, monthId, ExtractConstant.CLOSED); //网格吹哨部门准确率 【没被退回的项目数/项目总数 】 + //获取网格 存在的项目id及网格Id 没有项目的网格需要过滤出来 List transferRightRatioResultDTOS = projectMainService.selectTransferRightRatio(customerId, monthId); List transferRightRatioResultDTOS1 = projectLogService.selectNotReturn(customerId, monthId); if (!CollectionUtils.isEmpty(transferRightRatioResultDTOS1)){ @@ -334,16 +338,19 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { }else { transferRightRatioResultDTOS.forEach(r -> r.setStatus(false)); } + Set haveNotProjectSet = new HashSet<>(allGridIds); Map> groupByGridProject = transferRightRatioResultDTOS.stream().collect(Collectors.groupingBy(TransferRightRatioResultDTO::getGridId)); Map notReturnMap = new HashMap<>(16); groupByGridProject.forEach((grid,project) -> { - AtomicReference count = new AtomicReference<>(NumConstant.ZERO); + AtomicInteger count = new AtomicInteger(NumConstant.ZERO); project.forEach(p -> { if (p.getStatus().equals(false)){ - count.getAndSet(count.get() + NumConstant.ONE); + count.incrementAndGet(); } }); - notReturnMap.put(grid,getRound(new BigDecimal(count.get()/project.size()).multiply(NumConstant.ONE_HUNDRED_DECIMAL))); + notReturnMap.put(grid,getRound(new BigDecimal(count.get()).divide(new BigDecimal(project.size()),NumConstant.EIGHT,BigDecimal.ROUND_HALF_UP).multiply(NumConstant.ONE_HUNDRED_DECIMAL))); + //把有项目数的网格剔除 只剩下没有项目的网格 + haveNotProjectSet.remove(grid); }); //网格内解决的项目的满意度 //项目评价(分值定义下非常满意100,满意80,不满意(一般)60)的人数的平均分(每个项目的参加人数的分数和/评论人数=一个项目的平均分)+其他项目得分/已关闭项目总数 @@ -353,33 +360,23 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { // 根据网格分组 Map> groupByGrid = projectEvaluateList.stream().collect(Collectors.groupingBy(ProjectEvaluateResultDTO::getGridId)); groupByGrid.forEach((gridId,projectEvaluateInfoList) -> { - Map scoreMap = new HashMap<>(16); - // 根据项目分组 - Map> groupByProject = projectEvaluateInfoList.stream().collect(Collectors.groupingBy(ProjectEvaluateResultDTO::getProjectId)); - groupByProject.forEach((projectId,projectList) -> { - projectList.forEach(project -> { - switch (project.getActionCode()) { - case ExtractConstant.EVALUATE_BAD: - project.setScore(ProjectEvaluateConstant.BAD); - break; - case ExtractConstant.EVALUATE_GOOD: - project.setScore(ProjectEvaluateConstant.GOOD); - break; - case ExtractConstant.EVALUATE_PERFECT: - project.setScore(ProjectEvaluateConstant.PERFECT); - break; - default: - log.warn("calGridIndexGovernAbility other projectEvaluate,actionCode:{}", project.getActionCode()); - } - }); - Integer projectAllScore = projectList.stream().mapToInt(ProjectEvaluateResultDTO::getScore).sum(); - scoreMap.put(projectId,projectAllScore/projectList.size()); - }); - AtomicReference allScore = new AtomicReference<>(0); - scoreMap.forEach((k,v) -> { - allScore.set(++v); + projectEvaluateInfoList.forEach(p -> { + switch (p.getActionCode()) { + case ExtractConstant.EVALUATE_BAD: + p.setScore(ProjectEvaluateConstant.BAD); + break; + case ExtractConstant.EVALUATE_GOOD: + p.setScore(ProjectEvaluateConstant.GOOD); + break; + case ExtractConstant.EVALUATE_PERFECT: + p.setScore(ProjectEvaluateConstant.PERFECT); + break; + default: + log.warn("calGridIndexGovernAbility other projectEvaluate,actionCode:{}", p.getActionCode()); + } }); - resultSatisfactionScore.put(gridId,getRound(new BigDecimal(allScore.get()/scoreMap.size()))); + Integer projectAllScore = projectEvaluateInfoList.stream().collect(Collectors.summingInt(ProjectEvaluateResultDTO::getScore)); + resultSatisfactionScore.put(gridId,getRound(new BigDecimal(projectAllScore/projectEvaluateInfoList.size()))); }); } String quarterId = DateUtils.getQuarterId(monthId); @@ -397,15 +394,23 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { } }); } - // 2. 网格总项目数,网格议题转项目率 - if (!CollectionUtils.isEmpty(gridIssueTotalList)){ + // 2.网格议题转项目率 + if (!CollectionUtils.isEmpty(gridIssueShiftProjectRatio)){ gridIssueShiftProjectRatio.forEach(projectTotal -> { if (r.getGridId().equals(projectTotal.getGridId())){ - r.setProjectTotal(projectTotal.getProjectTotal()); r.setIssueToProjectRatio(projectTotal.getIssueToProjectRatio()); } }); } + // 网格总项目数 + if (!CollectionUtils.isEmpty(gridProjectTotalList)){ + gridProjectTotalList.forEach(projectTotal -> { + if (r.getGridId().equals(projectTotal.getGridId())) { + r.setProjectTotal(projectTotal.getProjectTotal()); + } + }); + } + // 3. 网格办结项目数 if (!CollectionUtils.isEmpty(gridProjectClosedTotalList)){ gridProjectClosedTotalList.forEach(closed -> { @@ -422,6 +427,10 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { } }); } + //如果项目数为0 则准确率设置为100 + if (haveNotProjectSet.contains(r.getGridId())){ + r.setTransferRightRatio(new BigDecimal(100)); + } // 5. 网格内解决的项目的满意度 if (!CollectionUtils.isEmpty(resultSatisfactionScore)){ resultSatisfactionScore.forEach((k, v) -> { @@ -545,22 +554,22 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { /** * @Description - * @param gridIssueTotalList - * @param gridProjectTotalList + * @param gridIssueTotalList 网格下已转项目的议题 + * @param gridIssueAllTotalList 网格下所有议题 * @author zxc * @date 2020/9/19 2:53 下午 */ - public List getGridIssueShiftProjectRatio(List gridIssueTotalList,List gridProjectTotalList){ - if (!CollectionUtils.isEmpty(gridIssueTotalList) && !CollectionUtils.isEmpty(gridProjectTotalList)) { - gridProjectTotalList.forEach(project -> { + public List getGridIssueShiftProjectRatio(List gridIssueTotalList,List gridIssueAllTotalList){ + if (!CollectionUtils.isEmpty(gridIssueTotalList) && !CollectionUtils.isEmpty(gridIssueAllTotalList)) { + gridIssueAllTotalList.forEach(allIssue -> { gridIssueTotalList.forEach(issue -> { - if (project.getGridId().equals(issue.getGridId())) { - project.setIssueToProjectRatio(getRound(new BigDecimal(project.getProjectTotal() / issue.getIssueTotal()).multiply(NumConstant.ONE_HUNDRED_DECIMAL))); + if (allIssue.getGridId().equals(issue.getGridId())) { + allIssue.setIssueToProjectRatio(getRound(new BigDecimal(issue.getIssueTotal()).divide(new BigDecimal(allIssue.getIssueTotal()),NumConstant.EIGHT,BigDecimal.ROUND_HALF_UP).multiply(NumConstant.ONE_HUNDRED_DECIMAL))); } }); }); } - return gridProjectTotalList; + return gridIssueAllTotalList; } /** diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollDistrictDepartmentServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollDistrictDepartmentServiceImpl.java index 328a7c694a..81d8a41aa4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollDistrictDepartmentServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollDistrictDepartmentServiceImpl.java @@ -42,9 +42,8 @@ public class IndexCollDistrictDepartmentServiceImpl implements IndexCollDistrict @Override public void saveDepartmentAbility(String customerId, String dateId) { - { //当前日期前一天 - Date date = DateUtils.getBeforeDay(DateUtils.stringToDate(dateId, DateUtils.DATE_PATTERN_YYYYMM)); + Date date = DateUtils.stringToDate(dateId, DateUtils.DATE_PATTERN_YYYYMM); //获取日期相关维度 DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date); //获取区直部门列表 @@ -118,10 +117,16 @@ public class IndexCollDistrictDepartmentServiceImpl implements IndexCollDistrict if (CollectionUtils.isNotEmpty(handle)) { list.forEach(entity -> handle.stream().filter(dto -> dto.getOrgId().equals(entity.getDeptId())).forEach(item -> { if (item.getCount() != NumConstant.ZERO) { - BigDecimal count = new BigDecimal(item.getCount()); + BigDecimal count = null != item.getCount() && NumConstant.ZERO != item.getCount() ? new BigDecimal(item.getCount()) : BigDecimal.ZERO; BigDecimal sum = new BigDecimal(item.getSum()); BigDecimal one = new BigDecimal(NumConstant.ONE); - entity.setClosedProjectRatio(one.divide(sum.divide(count), NumConstant.SIX, RoundingMode.HALF_UP)); + //entity.setClosedProjectRatio(one.divide(sum.divide(count), NumConstant.SIX, RoundingMode.HALF_UP)); + if (count.compareTo(BigDecimal.ZERO) == 1) { + //如果count>0 + entity.setClosedProjectRatio(sum.divide(count).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); + } else { + entity.setClosedProjectRatio(BigDecimal.ZERO); + } } })); } @@ -130,5 +135,4 @@ public class IndexCollDistrictDepartmentServiceImpl implements IndexCollDistrict factIndexGovrnAblityDeptMonthlyService.deleteByCustomer(customerId, dimId.getMonthId()); factIndexGovrnAblityDeptMonthlyService.saveList(list); } - } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexOriginExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexOriginExtractServiceImpl.java index b21eee911b..6bc96d1006 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexOriginExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexOriginExtractServiceImpl.java @@ -42,7 +42,8 @@ public class IndexOriginExtractServiceImpl implements IndexOriginExtractService private IndexCollCommunityService indexCollCommunityService; @Autowired private IndexCollDistrictService indexCollDistrictService; - + @Autowired + private IndexCollDistrictDepartmentService indexCollDistrictDepartmentService; /** * desc:从统计库对象抽取指标数据 * @@ -80,49 +81,88 @@ public class IndexOriginExtractServiceImpl implements IndexOriginExtractService private void submitJob(ExtractIndexFormDTO param) { + CountDownLatch countDownLatch = new CountDownLatch(2); + long start = System.currentTimeMillis(); final String customerId = param.getCustomerId(); final String monthId = param.getMonthId(); threadPool.submit(() -> { try { + long startCpc = System.currentTimeMillis(); calCpcIndexService.calCpcPartyAbility(customerId, monthId); + log.error("党员相关-党建能力执行完毕======总耗时:{}ms,customerId:{}",System.currentTimeMillis()-startCpc, param.getCustomerId()); } catch (Exception e) { log.error("抽取【党员相关数据】发生异常,参数:" + JSON.toJSONString(param), e); + }finally { + countDownLatch.countDown(); } }); threadPool.submit(() -> { try { + long startGridGovern = System.currentTimeMillis(); calGridIndexService.calGridIndexGovernAbility(customerId, monthId); + log.error("网格相关-治理能力执行完毕======总耗时:{}ms,customerId:{}",System.currentTimeMillis()-startGridGovern, param.getCustomerId()); } catch (Exception e) { log.error("抽取【网格治理能力数据】发生异常,参数:" + JSON.toJSONString(param), e); } try { + long startGridParty = System.currentTimeMillis(); calGridIndexService.calGridIndexPartyAbility(customerId, monthId); + log.error("网格相关-党建能力执行完毕======总耗时:{}ms,customerId:{}",System.currentTimeMillis()-startGridParty, param.getCustomerId()); } catch (Exception e) { log.error("抽取【网格党建能力数据】发生异常,参数:" + JSON.toJSONString(param), e); } try { + long startGridService = System.currentTimeMillis(); calGridIndexService.calGridIndexServiceAbility(customerId, monthId); + log.error("网格相关-服务能力执行完毕======总耗时:{}ms,customerId:{}",System.currentTimeMillis()-startGridService, param.getCustomerId()); } catch (Exception e) { log.error("抽取【网格服务能力数据】发生异常,参数:" + JSON.toJSONString(param), e); } + + try{ + //dimAgency + long startCommunity = System.currentTimeMillis(); + indexCollCommunityService.saveCommunityAbility(customerId, monthId); + log.error("社区相关-三大能力执行完毕======总耗时:{}ms,customerId:{}",System.currentTimeMillis()-startCommunity, param.getCustomerId()); + }catch (Exception e){ + log.error("抽取【社区治理能力-社区党建能力-服务能力】发生异常,参数:" + JSON.toJSONString(param), e); + } try{ //dimAgency + long startStreet = System.currentTimeMillis(); indexCollStreetService.saveStreetAbility(customerId, monthId); + log.error("街道相关-三大能力执行完毕======总耗时:{}ms,customerId:{}",System.currentTimeMillis()-startStreet, param.getCustomerId()); }catch (Exception e){ log.error("抽取【街道治理能力-街道党建能力-服务能力】发生异常,参数:" + JSON.toJSONString(param), e); } + + try{ //dimAgency - indexCollCommunityService.saveCommunityAbility(customerId, monthId); + long startDept = System.currentTimeMillis(); + indexCollDistrictDepartmentService.saveDepartmentAbility(customerId, monthId); + log.error("区直部门相关-治理能力执行完毕======总耗时:{}ms,customerId:{}",System.currentTimeMillis()-startDept, param.getCustomerId()); }catch (Exception e){ - log.error("抽取【社区治理能力-社区党建能力-服务能力】发生异常,参数:" + JSON.toJSONString(param), e); + log.error("抽取【区直部门治理能力】发生异常,参数:" + JSON.toJSONString(param), e); } + + try{ //dimAgency + long startDistrict = System.currentTimeMillis(); indexCollDistrictService.saveDistrictAbility(customerId, monthId); + log.error("全区相关-三大能力执行完毕======总耗时:{}ms,customerId:{}",System.currentTimeMillis()-startDistrict, param.getCustomerId()); }catch (Exception e){ log.error("抽取【全区治理能力-全区党建能力-服务能力】发生异常,参数:" + JSON.toJSONString(param), e); } + countDownLatch.countDown(); }); + + try { + countDownLatch.await(); + } catch (InterruptedException e) { + log.error("indexOriginExtractAll countDownLatch exception", e); + } + log.error("indexOriginExtractAll执行完毕======总耗时:{}ms,customerId:{}",System.currentTimeMillis()-start, param.getCustomerId()); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectCategoryDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectCategoryDailyService.java index 1252a4739c..3bd2029431 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectCategoryDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectCategoryDailyService.java @@ -54,5 +54,5 @@ public interface FactOriginProjectCategoryDailyService extends BaseService selectListProjectCategoryByOrg(List orgIds,String customerId,Integer subCount); + List selectListProjectCategoryByOrg(List orgIds,String customerId,Integer subCount,String projectType); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectLogDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectLogDailyService.java index 2d95509fca..b3b50560f6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectLogDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectLogDailyService.java @@ -21,7 +21,6 @@ import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.extract.FactOriginProjectLogDailyDTO; import com.epmet.dto.extract.result.*; -import com.epmet.dto.screen.ScreenProjectDataDTO; import com.epmet.entity.evaluationindex.extract.FactOriginProjectLogDailyEntity; import java.math.BigDecimal; @@ -310,7 +309,7 @@ public interface FactOriginProjectLogDailyService extends BaseService */ List getGridClosed(String customerId, String monthId); - + List getAgencyClosed(String customerId, String monthId); /** * 网格自制率统计-按天 * @author zhaoqifeng diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/IssueExtractService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/IssueExtractService.java index 2ee29acd93..85caea8cc5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/IssueExtractService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/IssueExtractService.java @@ -47,7 +47,7 @@ public interface IssueExtractService { * @author zxc * @date 2020/9/18 10:20 上午 */ - List selectIssueTotalTwoMonth(String customerId, String monthId, String minusMonthId); + List selectIssueTotalShiftProject(String customerId, String monthId); /** * @Description 网格总项目数 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java index f766873cea..52b6310caf 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java @@ -29,7 +29,6 @@ import com.epmet.dto.stats.DimAgencyDTO; import com.epmet.entity.evaluationindex.extract.FactAgencyGovernDailyEntity; import com.epmet.service.evaluationindex.extract.todata.*; import com.epmet.service.stats.DimAgencyService; -import com.epmet.util.DimIdGenerator; import org.apache.commons.collections4.CollectionUtils; import org.springframework.stereotype.Service; @@ -202,13 +201,11 @@ public class FactAgencyGovernDailyServiceImpl extends BaseServiceImpl projectResolvedTotal = factOriginProjectMainDailyService.getAgencyClosedProjectCount(customerId, dateId, ProjectConstant.RESOLVED, OrgTypeConstant.AGENCY); - Map eventProjectResolvedTotal = factOriginProjectMainDailyService.getAgencyClosedProjectCount(customerId, - dateId, ProjectConstant.RESOLVED, - ProjectConstant.PROJECT_ORIGIN_EVENT); + if (!projectResolvedTotal.isEmpty()) { agencyGovernDailyList.forEach(item -> { OrgStatisticsResultDTO dto = projectResolvedTotal.get(item.getAgencyId()); @@ -219,23 +216,12 @@ public class FactAgencyGovernDailyServiceImpl extends BaseServiceImpl { - OrgStatisticsResultDTO dto = eventProjectResolvedTotal.get(item.getAgencyId()); - int sum = item.getApprovalProjectResolvedCount(); - if (null != dto) { - sum = sum + dto.getSum(); - } - item.setApprovalProjectResolvedCount(sum); - }); - } - // 当前组织内:来源于议题的项目:结案无需解决数 + + // 当前组织内:项目立项:结案无需解决数 Map projectUnResolvedTotal = factOriginProjectMainDailyService.getAgencyClosedProjectCount(customerId, dateId, ProjectConstant.UNRESOLVED, OrgTypeConstant.AGENCY); - Map eventProjectUnResolvedTotal = factOriginProjectMainDailyService.getAgencyClosedProjectCount(customerId, - dateId, ProjectConstant.UNRESOLVED, - ProjectConstant.PROJECT_ORIGIN_EVENT); + if (!projectUnResolvedTotal.isEmpty()) { agencyGovernDailyList.forEach(item -> { OrgStatisticsResultDTO dto = projectUnResolvedTotal.get(item.getAgencyId()); @@ -246,17 +232,34 @@ public class FactAgencyGovernDailyServiceImpl extends BaseServiceImpl { - OrgStatisticsResultDTO dto = eventProjectUnResolvedTotal.get(item.getAgencyId()); - int sum = item.getApprovalProjectUnResolvedCount(); - if (null != dto) { - sum = sum + dto.getSum(); - } - item.setApprovalProjectUnResolvedCount(sum); - }); - } + + } + + //2021.12.15 当前组织内:来源于事件的项目:结案已解决数 + Map eventProjectResolvedTotal = factOriginProjectMainDailyService.getAgencyClosedProjectCount(customerId, + dateId, ProjectConstant.RESOLVED, + ProjectConstant.PROJECT_ORIGIN_EVENT); + if (!eventProjectResolvedTotal.isEmpty()) { + agencyGovernDailyList.forEach(item -> { + OrgStatisticsResultDTO dto = eventProjectResolvedTotal.get(item.getAgencyId()); + if (null != dto) { + item.setEventResolvedCount(dto.getSum()); + } + }); } + //2021.12.15 当前组织内:来源于事件的项目:结案无需解决数 + Map eventProjectUnResolvedTotal = factOriginProjectMainDailyService.getAgencyClosedProjectCount(customerId, + dateId, ProjectConstant.UNRESOLVED, + ProjectConstant.PROJECT_ORIGIN_EVENT); + if (!eventProjectUnResolvedTotal.isEmpty()) { + agencyGovernDailyList.forEach(item -> { + OrgStatisticsResultDTO dto = eventProjectUnResolvedTotal.get(item.getAgencyId()); + if (null != dto) { + item.setEventUnResolvedCount(dto.getSum()); + } + }); + } + // 2.党群自治占比:当前组织下,所有小组内关闭(已解决+无需解决)的话题数与问题解决总数之比(未出小组:未转议题的) agencyGovernDailyList.forEach(item -> { int count = item.getInGroupTopicResolvedCount() + item.getInGroupTopicUnResolvedCount(); @@ -267,14 +270,16 @@ public class FactAgencyGovernDailyServiceImpl extends BaseServiceImpl gridSelfCount = factOriginProjectLogDailyService.getAgencyGridSelfDaily(customerId, dateId); if (!gridSelfCount.isEmpty()) { agencyGovernDailyList.forEach(item -> { OrgStatisticsResultDTO dto = gridSelfCount.get(item.getAgencyId()); if (null != dto) { int count = dto.getCount(); - int sum = item.getProblemResolvedCount(); + //已结案项目数 = 来源议题的项目结案已解决数+来源议题的项目结案无需解决数+项目立项结案已解决数+项目立项结案无需解决数+来源事件的项目结案已解决数+来源事件的项目结案已解决数 + int sum = item.getIssueProjectResolvedCount() + item.getIssueProjectUnResolvedCount() + item.getApprovalProjectResolvedCount() + + item.getApprovalProjectUnResolvedCount() + item.getEventResolvedCount() + item.getEventUnResolvedCount(); if (sum != NumConstant.ZERO) { BigDecimal resolveCount = new BigDecimal(sum); BigDecimal selfCount = new BigDecimal(count); @@ -284,9 +289,9 @@ public class FactAgencyGovernDailyServiceImpl extends BaseServiceImpl> projectCount = factOriginProjectMainDailyService.getAgencyClosedProjectStatic(customerId, dateId); if (!gridSelfCount.isEmpty()) { agencyGovernDailyList.forEach(item -> { @@ -294,7 +299,9 @@ public class FactAgencyGovernDailyServiceImpl extends BaseServiceImpl map = list.stream().collect(Collectors.toMap(OrgStatisticsResultDTO::getLevel, Function.identity())); - int sum = item.getProblemResolvedCount(); + //已结案项目数 = 来源议题的项目结案已解决数+来源议题的项目结案无需解决数+项目立项结案已解决数+项目立项结案无需解决数+来源事件的项目结案已解决数+来源事件的项目结案已解决数 + int sum = item.getIssueProjectResolvedCount() + item.getIssueProjectUnResolvedCount() + item.getApprovalProjectResolvedCount() + + item.getApprovalProjectUnResolvedCount() + item.getEventResolvedCount() + item.getEventUnResolvedCount(); BigDecimal resolveCount = new BigDecimal(sum); if (sum != NumConstant.ZERO) { // 社区解决占比 @@ -316,7 +323,7 @@ public class FactAgencyGovernDailyServiceImpl extends BaseServiceImpl currentGridClosedProjectList = factOriginProjectMainDailyService.getGridClosedProjectList(customerId, gridId, ProjectConstant.CLOSED,null,null); @@ -339,6 +349,7 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl projectLogDTOList) { List handleLevelList=new ArrayList<>(); for (FactOriginProjectLogDailyDTO logDailyDTO : projectLogDTOList) { - if(logDailyDTO.getActionCode().equals(DimObjectActionConstant.PROJECT_RETURN)||NumConstant.ZERO==logDailyDTO.getIsActive()){ + if(!logDailyDTO.getActionCode().equals(DimObjectActionConstant.PROJECT_CLOSE)||NumConstant.ZERO==logDailyDTO.getIsActive()){ //当前操作如果是退回,不参与比较 continue; } @@ -395,32 +409,42 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl daysBetween = null; if (isRange) { @@ -101,139 +100,159 @@ public class FactOriginExtractServiceImpl implements FactOriginExtractService { } List finalDaysBetween = daysBetween; threadPool.submit(() -> { - CustomerIdAndDateIdFormDTO formDTO = new CustomerIdAndDateIdFormDTO(); - formDTO.setCustomerId(param.getCustomerId()); - if (!isRange) { - try { - formDTO.setDateId(param.getDateId()); - dimCustomerPartymemberService.statsPartyMember(formDTO); - } catch (Exception e) { - log.error("抽取【党员数据】发生异常,参数:" + JSON.toJSONString(formDTO), e); - } - } else { - try { - for (int i = 0; i < finalDaysBetween.size(); i++) { - String dateDimId = finalDaysBetween.get(i); - formDTO.setDateId(dateDimId); + try { + CustomerIdAndDateIdFormDTO formDTO = new CustomerIdAndDateIdFormDTO(); + formDTO.setCustomerId(param.getCustomerId()); + if (!isRange) { + try { + formDTO.setDateId(param.getDateId()); dimCustomerPartymemberService.statsPartyMember(formDTO); + } catch (Exception e) { + log.error("抽取【党员数据】发生异常,参数:" + JSON.toJSONString(formDTO), e); + } + } else { + try { + for (int i = 0; i < finalDaysBetween.size(); i++) { + String dateDimId = finalDaysBetween.get(i); + formDTO.setDateId(dateDimId); + dimCustomerPartymemberService.statsPartyMember(formDTO); + } + } catch (Exception e) { + log.error("抽取【党员数据】发生异常,参数:" + JSON.toJSONString(param), e); } - } catch (Exception e) { - log.error("抽取【党员数据】发生异常,参数:" + JSON.toJSONString(param), e); } + } finally { + countDownLatch.countDown(); } }); threadPool.submit(() -> { - ExtractOriginFormDTO paramNew = ConvertUtils.sourceToTarget(param, ExtractOriginFormDTO.class); - if (!isRange) { - try { - groupExtractService.extractGroupData(paramNew); - } catch (Exception e) { - log.error("抽取【小组数据】发生异常,参数:" + JSON.toJSONString(paramNew), e); - } - } else { - try { - for (int i = 0; i < finalDaysBetween.size(); i++) { - String dateDimId = finalDaysBetween.get(i); - paramNew.setDateId(dateDimId); + try { + ExtractOriginFormDTO paramNew = ConvertUtils.sourceToTarget(param, ExtractOriginFormDTO.class); + if (!isRange) { + try { groupExtractService.extractGroupData(paramNew); + } catch (Exception e) { + log.error("抽取【小组数据】发生异常,参数:" + JSON.toJSONString(paramNew), e); + } + } else { + try { + for (int i = 0; i < finalDaysBetween.size(); i++) { + String dateDimId = finalDaysBetween.get(i); + paramNew.setDateId(dateDimId); + groupExtractService.extractGroupData(paramNew); + } + } catch (Exception e) { + log.error("抽取【小组数据】发生异常,参数:" + JSON.toJSONString(paramNew), e); } - } catch (Exception e) { - log.error("抽取【小组数据】发生异常,参数:" + JSON.toJSONString(paramNew), e); } + } finally { + countDownLatch.countDown(); } }); threadPool.submit(() -> { - log.debug("extractAll start param:{}", JSON.toJSONString(param)); - ExtractOriginFormDTO paramNew = ConvertUtils.sourceToTarget(param, ExtractOriginFormDTO.class); - if (!isRange) { - try { - factOriginTopicMainDailyService.topicCleaning(paramNew); - } catch (Exception e) { - log.error("抽取【话题数据】发生异常,参数:" + JSON.toJSONString(paramNew), e); - } - } else { - try { - for (int i = 0; i < finalDaysBetween.size(); i++) { - String dateDimId = finalDaysBetween.get(i); - paramNew.setDateId(dateDimId); - log.info("extractAll cal param:{}", JSON.toJSONString(paramNew)); + try { + log.debug("extractAll start param:{}", JSON.toJSONString(param)); + ExtractOriginFormDTO paramNew = ConvertUtils.sourceToTarget(param, ExtractOriginFormDTO.class); + if (!isRange) { + try { factOriginTopicMainDailyService.topicCleaning(paramNew); + } catch (Exception e) { + log.error("抽取【话题数据】发生异常,参数:" + JSON.toJSONString(paramNew), e); + } + } else { + try { + for (int i = 0; i < finalDaysBetween.size(); i++) { + String dateDimId = finalDaysBetween.get(i); + paramNew.setDateId(dateDimId); + log.info("extractAll cal param:{}", JSON.toJSONString(paramNew)); + factOriginTopicMainDailyService.topicCleaning(paramNew); + } + } catch (Exception e) { + log.error("抽取【话题数据】发生异常,参数:" + JSON.toJSONString(paramNew), e); } - } catch (Exception e) { - log.error("抽取【话题数据】发生异常,参数:" + JSON.toJSONString(paramNew), e); } + log.debug("extractAll end param:{}", JSON.toJSONString(paramNew)); + } finally { + countDownLatch.countDown(); } - log.debug("extractAll end param:{}", JSON.toJSONString(paramNew)); }); threadPool.submit(() -> { - ExtractOriginFormDTO paramNew = ConvertUtils.sourceToTarget(param, ExtractOriginFormDTO.class); - if (!isRange) { - try { - issueExtractService.issueExtractMain(paramNew); - } catch (Exception e) { - log.error("抽取【议题数据主表】发生异常,参数:" + JSON.toJSONString(paramNew), e); - } - try { - issueExtractService.issueExtractLog(paramNew); - } catch (Exception e) { - log.error("抽取【议题数据附表】发生异常,参数:" + JSON.toJSONString(paramNew), e); - } - } else { - try { - for (int i = 0; i < finalDaysBetween.size(); i++) { - String dateDimId = finalDaysBetween.get(i); - paramNew.setDateId(dateDimId); + try { + ExtractOriginFormDTO paramNew = ConvertUtils.sourceToTarget(param, ExtractOriginFormDTO.class); + if (!isRange) { + try { issueExtractService.issueExtractMain(paramNew); + } catch (Exception e) { + log.error("抽取【议题数据主表】发生异常,参数:" + JSON.toJSONString(paramNew), e); } - } catch (Exception e) { - log.error("抽取【议题数据主表】发生异常,参数:" + JSON.toJSONString(paramNew), e); - } - try { - for (int i = 0; i < finalDaysBetween.size(); i++) { - String dateDimId = finalDaysBetween.get(i); - paramNew.setDateId(dateDimId); + try { issueExtractService.issueExtractLog(paramNew); + } catch (Exception e) { + log.error("抽取【议题数据附表】发生异常,参数:" + JSON.toJSONString(paramNew), e); + } + } else { + try { + for (int i = 0; i < finalDaysBetween.size(); i++) { + String dateDimId = finalDaysBetween.get(i); + paramNew.setDateId(dateDimId); + issueExtractService.issueExtractMain(paramNew); + } + } catch (Exception e) { + log.error("抽取【议题数据主表】发生异常,参数:" + JSON.toJSONString(paramNew), e); + } + try { + for (int i = 0; i < finalDaysBetween.size(); i++) { + String dateDimId = finalDaysBetween.get(i); + paramNew.setDateId(dateDimId); + issueExtractService.issueExtractLog(paramNew); + } + } catch (Exception e) { + log.error("抽取【议题数据附表】发生异常,参数:" + JSON.toJSONString(paramNew), e); } - } catch (Exception e) { - log.error("抽取【议题数据附表】发生异常,参数:" + JSON.toJSONString(paramNew), e); } + } finally { + countDownLatch.countDown(); } }); //小组活动 threadPool.submit(() -> { - ExtractOriginFormDTO extractOriginFormDTO = ConvertUtils.sourceToTarget(param, ExtractOriginFormDTO.class); - if (!isRange) { - //截止到当前dateId - try { - factGroupActDailyService.extractGridGroupActDaily(extractOriginFormDTO.getCustomerId(), extractOriginFormDTO.getDateId()); - } catch (Exception e) { - log.error("抽取【fact_group_act_daily】发生异常,参数:" + JSON.toJSONString(extractOriginFormDTO), e); - } - try { - factGroupActDailyService.extractAgencyGroupActDaily(extractOriginFormDTO.getCustomerId(), extractOriginFormDTO.getDateId()); - } catch (Exception e) { - log.error("抽取【fact_group_act_daily】发生异常,参数:" + JSON.toJSONString(extractOriginFormDTO), e); - } - } else { - //参数指定日期内,比如startDate=20210501,endDate=20210513;依次计算截止到20210501的数据.....截止到20210513的数据 - try { - for (int i = 0; i < finalDaysBetween.size(); i++) { - String dateDimId = finalDaysBetween.get(i); - extractOriginFormDTO.setDateId(dateDimId); + try { + ExtractOriginFormDTO extractOriginFormDTO = ConvertUtils.sourceToTarget(param, ExtractOriginFormDTO.class); + if (!isRange) { + //截止到当前dateId + try { factGroupActDailyService.extractGridGroupActDaily(extractOriginFormDTO.getCustomerId(), extractOriginFormDTO.getDateId()); + } catch (Exception e) { + log.error("抽取【fact_group_act_daily】发生异常,参数:" + JSON.toJSONString(extractOriginFormDTO), e); } - } catch (Exception e) { - log.error("抽取【fact_group_act_daily】发生异常,参数:" + JSON.toJSONString(extractOriginFormDTO), e); - } - try { - for (int i = 0; i < finalDaysBetween.size(); i++) { - String dateDimId = finalDaysBetween.get(i); - extractOriginFormDTO.setDateId(dateDimId); + try { factGroupActDailyService.extractAgencyGroupActDaily(extractOriginFormDTO.getCustomerId(), extractOriginFormDTO.getDateId()); + } catch (Exception e) { + log.error("抽取【fact_group_act_daily】发生异常,参数:" + JSON.toJSONString(extractOriginFormDTO), e); + } + } else { + //参数指定日期内,比如startDate=20210501,endDate=20210513;依次计算截止到20210501的数据.....截止到20210513的数据 + try { + for (int i = 0; i < finalDaysBetween.size(); i++) { + String dateDimId = finalDaysBetween.get(i); + extractOriginFormDTO.setDateId(dateDimId); + factGroupActDailyService.extractGridGroupActDaily(extractOriginFormDTO.getCustomerId(), extractOriginFormDTO.getDateId()); + } + } catch (Exception e) { + log.error("抽取【fact_group_act_daily】发生异常,参数:" + JSON.toJSONString(extractOriginFormDTO), e); + } + try { + for (int i = 0; i < finalDaysBetween.size(); i++) { + String dateDimId = finalDaysBetween.get(i); + extractOriginFormDTO.setDateId(dateDimId); + factGroupActDailyService.extractAgencyGroupActDaily(extractOriginFormDTO.getCustomerId(), extractOriginFormDTO.getDateId()); + } + } catch (Exception e) { + log.error("抽取【fact_group_act_daily】发生异常,参数:" + JSON.toJSONString(extractOriginFormDTO), e); } - } catch (Exception e) { - log.error("抽取【fact_group_act_daily】发生异常,参数:" + JSON.toJSONString(extractOriginFormDTO), e); } + } finally { + countDownLatch.countDown(); } }); @@ -297,7 +316,18 @@ public class FactOriginExtractServiceImpl implements FactOriginExtractService { } });*/ - submitProjectRelationData(param, finalDaysBetween); + Future future = submitProjectRelationData(param, finalDaysBetween); + try { + future.get(); + } catch (Exception e) { + log.error("submitProjectRelationData exception:{}",e); + } + try { + countDownLatch.await(); + log.info("extractAll submitJob execute end,param:{}",JSON.toJSONString(param)); + } catch (InterruptedException e) { + log.error("extractAll daily InterruptedException:{}", e); + } } @Override diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectCategoryDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectCategoryDailyServiceImpl.java index 083fe26a85..28a57a5b3c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectCategoryDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectCategoryDailyServiceImpl.java @@ -138,7 +138,11 @@ public class FactOriginProjectCategoryDailyServiceImpl extends BaseServiceImpl selectListProjectCategoryGridDailyDTO(String customerId) { - List list=baseDao.selectListProjectCategoryGridDailyDTO(customerId,getSubCount(customerId)); + List list=baseDao.selectListProjectCategoryGridDailyDTO(customerId,getSubCount(customerId),"all"); + List closedList = baseDao.selectListProjectCategoryGridDailyDTO(customerId,getSubCount(customerId),"closed"); + if (!CollectionUtils.isEmpty(closedList)){ + list.forEach(l -> closedList.stream().filter(c -> l.getGridId().equals(c.getGridId()) && l.getCategoryCode().equals(c.getCategoryCode())).forEach(c -> l.setClosedProjectTotal(c.getClosedProjectTotal()))); + } return list; } @@ -157,10 +161,10 @@ public class FactOriginProjectCategoryDailyServiceImpl extends BaseServiceImpl selectListProjectCategoryByOrg(List orgIds,String customerId,Integer subCount) { + public List selectListProjectCategoryByOrg(List orgIds,String customerId,Integer subCount,String projectType) { if (!CollectionUtils.isEmpty(orgIds)){ return new ArrayList<>(); } - return baseDao.selectListProjectCategoryByOrg(orgIds,customerId,subCount); + return baseDao.selectListProjectCategoryByOrg(orgIds,customerId,subCount,projectType); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java index 311da04715..9bb920fe54 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java @@ -269,8 +269,8 @@ public class FactOriginProjectLogDailyServiceImpl extends BaseServiceImpl getAgencyClosed(String customerId, String monthId) { + return baseDao.selectAgencyClosed(customerId, monthId); + } + /** * 网格自制率统计-按天 * diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginTopicMainDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginTopicMainDailyServiceImpl.java index c9e42a3a49..1ed3f51ba8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginTopicMainDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginTopicMainDailyServiceImpl.java @@ -20,7 +20,6 @@ package com.epmet.service.evaluationindex.extract.todata.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.NumConstant; -import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.DataSourceConstant; @@ -166,7 +165,7 @@ public class FactOriginTopicMainDailyServiceImpl extends BaseServiceImpl logDailyEntityList) { //批量插入 @@ -175,7 +174,7 @@ public class FactOriginTopicMainDailyServiceImpl extends BaseServiceImpl * @param topicOriginInfoList @@ -195,8 +194,8 @@ public class FactOriginTopicMainDailyServiceImpl extends BaseServiceImpl agencyIds = result.stream().map(r -> r.getAgencyId()).distinct().collect(Collectors.toList()); + List agencyIds = result.stream().map(IssueMainDailyFormDTO::getAgencyId).distinct().collect(Collectors.toList()); List agencyInfoList = dimAgencyDao.selectAgencyInfo(agencyIds); if (CollectionUtils.isEmpty(agencyInfoList)){ throw new RenException(ExtractConstant.PARENT_AGENCY_ID_LIST); @@ -138,7 +138,9 @@ public class IssueExtractServiceImpl implements IssueExtractService { } }); }); - delAndInsertMain(customerId,dateId,result); + //过滤掉pids为空的数据 + List collect = result.stream().filter(o -> StringUtils.isNotBlank(o.getPids())).collect(Collectors.toList()); + delAndInsertMain(customerId,dateId,collect); return true; } @@ -244,7 +246,9 @@ public class IssueExtractServiceImpl implements IssueExtractService { } }); }); - delAndInsertLog(customerId,dateId,result); + //去除pids 为空的数据 + List collect = result.stream().filter(o -> StringUtils.isNotBlank(o.getPids())).collect(Collectors.toList()); + delAndInsertLog(customerId,dateId,collect); return true; } @@ -268,8 +272,8 @@ public class IssueExtractServiceImpl implements IssueExtractService { * @date 2020/9/18 10:20 上午 */ @Override - public List selectIssueTotalTwoMonth(String customerId, String monthId, String minusMonthId) { - return issueMainDailyDao.selectIssueTotalTwoMonthPlus(customerId, monthId, minusMonthId); + public List selectIssueTotalShiftProject(String customerId, String monthId) { + return issueMainDailyDao.selectIssueTotalShiftProject(customerId, monthId); } /** diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java index f4f616a722..e1c74d8f30 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java @@ -319,21 +319,14 @@ public class ProjectExtractServiceImpl implements ProjectExtractService { entity.setOrgType(OrgTypeConstant.AGENCY); entity.setOrgId(process.getAgencyId()); if (!process.getPids().contains(StrConstant.COLON)) { - entity.setPids(""); entity.setPid(NumConstant.ZERO_STR); } else { String[] orgArray = process.getPids().split(StrConstant.COLON); if (orgArray.length > NumConstant.ONE) { entity.setPid(orgArray[orgArray.length - NumConstant.TWO]); - String path = process.getPids().replaceAll(process.getAgencyId(), ""); - if (path.endsWith(StrConstant.COLON)) { - path = path.substring(NumConstant.ZERO, path.length() - NumConstant.ONE); - } - entity.setPids(path); } else { log.warn("【data-statistical】业务数据抽取模块,ProjectExtractServiceImpl.saveOriginProjectDaily:查询出的项目节点发起人所属的orgIdPath不正确,agencyId->{},orgIdPath->{}", process.getAgencyId(), process.getPids()); entity.setPid(NumConstant.ZERO_STR); - entity.setPids(""); } } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/OrgRankStatisticsService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/OrgRankStatisticsService.java new file mode 100644 index 0000000000..6bd70ff16c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/OrgRankStatisticsService.java @@ -0,0 +1,189 @@ +package com.epmet.service.evaluationindex.extract.toscreen; + +import com.epmet.dto.extract.result.OrgStatisticsResultDTO; + +import java.util.Map; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2021/12/7 10:43 + */ +public interface OrgRankStatisticsService { + /** + * 网格被吹哨项目数 + * @Param customerId + * @Param monthId + * @Param dateId + * @Return {@link Map< String, OrgStatisticsResultDTO>} + * @Author zhaoqifeng + * @Date 2021/12/7 10:52 + */ + Map getGridProjectCount(String customerId, String monthId, String dateId); + + /** + * 部门被吹哨项目数 + * @Param customerId + * @Param monthId + * @Param dateId + * @Return {@link Map< String, OrgStatisticsResultDTO>} + * @Author zhaoqifeng + * @Date 2021/12/7 10:52 + */ + Map getDeptProjectCount(String customerId, String monthId, String dateId); + + /** + * 组织被吹哨项目数(含下级组织网格部门) + * @Param customerId + * @Param monthId + * @Param dateId + * @Return {@link Map< String, OrgStatisticsResultDTO>} + * @Author zhaoqifeng + * @Date 2021/12/7 10:52 + */ + Map getAgencyProjectCount(String customerId, String monthId, String dateId); + + + /** + * 网格被吹哨项目中已结案项目数 + * @Param customerId + * @Param monthId + * @Param dateId + * @Return {@link Map< String, OrgStatisticsResultDTO>} + * @Author zhaoqifeng + * @Date 2021/12/7 10:52 + */ + Map getGridProjectClosedCount(String customerId, String monthId, String dateId); + + /** + * 部门被吹哨项目中已结案项目数 + * @Param customerId + * @Param monthId + * @Param dateId + * @Return {@link Map< String, OrgStatisticsResultDTO>} + * @Author zhaoqifeng + * @Date 2021/12/7 10:52 + */ + Map getDeptProjectClosedCount(String customerId, String monthId, String dateId); + + /** + * 组织被吹哨项目中已结案项目数(含下级组织网格部门) + * @Param customerId + * @Param monthId + * @Param dateId + * @Return {@link Map< String, OrgStatisticsResultDTO>} + * @Author zhaoqifeng + * @Date 2021/12/7 10:52 + */ + Map getAgencyProjectClosedCount(String customerId, String monthId, String dateId); + + /** + * 网格被吹哨项目中自己办结项目数 + * @Param customerId + * @Param monthId + * @Param dateId + * @Return {@link Map< String, OrgStatisticsResultDTO>} + * @Author zhaoqifeng + * @Date 2021/12/7 10:52 + */ + Map getGridProjectResolvedCount(String customerId, String monthId, String dateId); + + /** + * 部门被吹哨项目中自己办结项目数 + * @Param customerId + * @Param monthId + * @Param dateId + * @Return {@link Map< String, OrgStatisticsResultDTO>} + * @Author zhaoqifeng + * @Date 2021/12/7 10:52 + */ + Map getDeptProjectResolvedCount(String customerId, String monthId, String dateId); + + /** + * 组织被吹哨项目中自己办结项目数(含下级组织网格部门) + * @Param customerId + * @Param monthId + * @Param dateId + * @Return {@link Map< String, OrgStatisticsResultDTO>} + * @Author zhaoqifeng + * @Date 2021/12/7 10:52 + */ + Map getAgencyProjectResolvedCount(String customerId, String monthId, String dateId); + + /** + * 网格自治项目数 + * @Param customerId + * @Param monthId + * @Param dateId + * @Return {@link Map< String, OrgStatisticsResultDTO>} + * @Author zhaoqifeng + * @Date 2021/12/7 10:52 + */ + Map getGridProjectSelfCount(String customerId, String monthId, String dateId); + + /** + * 部门自治项目数 + * @Param customerId + * @Param monthId + * @Param dateId + * @Return {@link Map< String, OrgStatisticsResultDTO>} + * @Author zhaoqifeng + * @Date 2021/12/7 10:52 + */ + Map getDeptProjectSelfCount(String customerId, String monthId, String dateId); + + /** + * 组织自治项目数(含下级组织网格部门) + * @Param customerId + * @Param monthId + * @Param dateId + * @Return {@link Map< String, OrgStatisticsResultDTO>} + * @Author zhaoqifeng + * @Date 2021/12/7 10:52 + */ + Map getAgencyProjectSelfCount(String customerId, String monthId, String dateId); + + /** + * 网格产生的项目数 + * @Param customerId + * @Param monthId + * @Param dateId + * @Return {@link Map< String, OrgStatisticsResultDTO>} + * @Author zhaoqifeng + * @Date 2021/12/7 10:52 + */ + Map getGridProjectTotal(String customerId, String monthId, String dateId); + + /** + * 组织产生的项目数(含下级组织网格部门) + * @Param customerId + * @Param monthId + * @Param dateId + * @Return {@link Map< String, OrgStatisticsResultDTO>} + * @Author zhaoqifeng + * @Date 2021/12/7 10:52 + */ + Map getAgencyProjectTotal(String customerId, String monthId, String dateId); + + /** + * 网格产生的项目数中结案的项目数 + * @Param customerId + * @Param monthId + * @Param dateId + * @Return {@link Map< String, OrgStatisticsResultDTO>} + * @Author zhaoqifeng + * @Date 2021/12/7 10:52 + */ + Map getGridProjectClosedTotal(String customerId, String monthId, String dateId); + + /** + * 组织产生的项目数中结案的项目数(含下级组织网格部门) + * @Param customerId + * @Param monthId + * @Param dateId + * @Return {@link Map< String, OrgStatisticsResultDTO>} + * @Author zhaoqifeng + * @Date 2021/12/7 10:52 + */ + Map getAgencyProjectClosedTotal(String customerId, String monthId, String dateId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/OrgRankExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/OrgRankExtractServiceImpl.java index 4e7ecc27aa..fde0f879bc 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/OrgRankExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/OrgRankExtractServiceImpl.java @@ -6,8 +6,6 @@ import com.epmet.constant.OrgTypeConstant; import com.epmet.dto.extract.result.OrgStatisticsResultDTO; import com.epmet.dto.stats.user.FactRegUserAgencyMonthlyDTO; import com.epmet.dto.stats.user.FactRegUserGridMonthlyDTO; -import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyEntity; -import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyEntity; import com.epmet.entity.evaluationindex.screen.ScreenOrgRankDataEntity; import com.epmet.service.evaluationindex.extract.todata.*; import com.epmet.service.evaluationindex.extract.toscreen.OrgRankExtractService; @@ -17,9 +15,9 @@ import com.epmet.service.evaluationindex.screen.ScreenOrgRankDataService; import com.epmet.service.stats.user.FactRegUserAgencyMonthlyService; import com.epmet.service.stats.user.FactRegUserGridMonthlyService; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import org.apache.commons.collections4.CollectionUtils; import java.math.BigDecimal; import java.math.RoundingMode; @@ -184,11 +182,15 @@ public class OrgRankExtractServiceImpl implements OrgRankExtractService { )); } //结案率 结案数/项目数 - List abilityList = factIndexGovrnAblityOrgMonthlyService.getOrgByCustomer(customerId, monthId, OrgTypeConstant.COMMUNITY); - if (CollectionUtils.isNotEmpty(abilityList)) { - list.forEach(entity -> abilityList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> - entity.setCloseProjectRatio(dto.getClosedProjectRatio()) - )); + List closed = factOriginProjectLogDailyService.getAgencyClosed(customerId, monthId); + if (CollectionUtils.isNotEmpty(closed)) { + list.forEach(entity -> closed.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setCloseProjectRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); } //满意率 满意和非常满意占比 List satisfactionList = factOriginProjectLogDailyService.getOrgSatisfaction(customerId, monthId, OrgTypeConstant.COMMUNITY); @@ -252,11 +254,15 @@ public class OrgRankExtractServiceImpl implements OrgRankExtractService { )); } //结案率 结案数/项目数 - List abilityList = factIndexGovrnAblityOrgMonthlyService.getOrgByCustomer(customerId, monthId, OrgTypeConstant.STREET); - if (CollectionUtils.isNotEmpty(abilityList)) { - list.forEach(entity -> abilityList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> - entity.setCloseProjectRatio(dto.getClosedProjectRatio()) - )); + List closed = factOriginProjectLogDailyService.getAgencyClosed(customerId, monthId); + if (CollectionUtils.isNotEmpty(closed)) { + list.forEach(entity -> closed.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setCloseProjectRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); } //满意率 满意和非常满意占比 List satisfactionList = factOriginProjectLogDailyService.getOrgSatisfaction(customerId, monthId, OrgTypeConstant.STREET); @@ -320,11 +326,15 @@ public class OrgRankExtractServiceImpl implements OrgRankExtractService { )); } //结案率 结案数/项目数 - List abilityList = factIndexGovrnAblityOrgMonthlyService.getOrgByCustomer(customerId, monthId, OrgTypeConstant.DISTRICT); - if (CollectionUtils.isNotEmpty(abilityList)) { - list.forEach(entity -> abilityList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> - entity.setCloseProjectRatio(dto.getClosedProjectRatio()) - )); + List closed = factOriginProjectLogDailyService.getAgencyClosed(customerId, monthId); + if (CollectionUtils.isNotEmpty(closed)) { + list.forEach(entity -> closed.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setCloseProjectRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); } //满意率 满意和非常满意占比 List satisfactionList = factOriginProjectLogDailyService.getOrgSatisfaction(customerId, monthId, OrgTypeConstant.STREET); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/OrgRankStatisticsServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/OrgRankStatisticsServiceImpl.java new file mode 100644 index 0000000000..730d3d9ab4 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/OrgRankStatisticsServiceImpl.java @@ -0,0 +1,306 @@ +package com.epmet.service.evaluationindex.extract.toscreen.impl; + +import com.epmet.dto.extract.result.OrgStatisticsResultDTO; +import com.epmet.service.evaluationindex.extract.toscreen.OrgRankStatisticsService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +import java.util.Map; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2021/12/7 10:43 + */ +@Service +@Slf4j +public class OrgRankStatisticsServiceImpl implements OrgRankStatisticsService { + + /** + * 网格被吹哨项目数 + * + * @param customerId + * @param monthId + * @param dateId + * @Param customerId + * @Param monthId + * @Param dateId + * @Return {@link Map < String, OrgStatisticsResultDTO >} + * @Author zhaoqifeng + * @Date 2021/12/7 10:52 + */ + @Override + public Map getGridProjectCount(String customerId, String monthId, String dateId) { + return null; + } + + /** + * 部门被吹哨项目数 + * + * @param customerId + * @param monthId + * @param dateId + * @Param customerId + * @Param monthId + * @Param dateId + * @Return {@link Map< String, OrgStatisticsResultDTO>} + * @Author zhaoqifeng + * @Date 2021/12/7 10:52 + */ + @Override + public Map getDeptProjectCount(String customerId, String monthId, String dateId) { + return null; + } + + /** + * 组织被吹哨项目数(含下级组织网格部门) + * + * @param customerId + * @param monthId + * @param dateId + * @Param customerId + * @Param monthId + * @Param dateId + * @Return {@link Map< String, OrgStatisticsResultDTO>} + * @Author zhaoqifeng + * @Date 2021/12/7 10:52 + */ + @Override + public Map getAgencyProjectCount(String customerId, String monthId, String dateId) { + return null; + } + + /** + * 网格被吹哨项目中已结案项目数 + * + * @param customerId + * @param monthId + * @param dateId + * @Param customerId + * @Param monthId + * @Param dateId + * @Return {@link Map< String, OrgStatisticsResultDTO>} + * @Author zhaoqifeng + * @Date 2021/12/7 10:52 + */ + @Override + public Map getGridProjectClosedCount(String customerId, String monthId, String dateId) { + return null; + } + + /** + * 部门被吹哨项目中已结案项目数 + * + * @param customerId + * @param monthId + * @param dateId + * @Param customerId + * @Param monthId + * @Param dateId + * @Return {@link Map< String, OrgStatisticsResultDTO>} + * @Author zhaoqifeng + * @Date 2021/12/7 10:52 + */ + @Override + public Map getDeptProjectClosedCount(String customerId, String monthId, String dateId) { + return null; + } + + /** + * 组织被吹哨项目中已结案项目数(含下级组织网格部门) + * + * @param customerId + * @param monthId + * @param dateId + * @Param customerId + * @Param monthId + * @Param dateId + * @Return {@link Map< String, OrgStatisticsResultDTO>} + * @Author zhaoqifeng + * @Date 2021/12/7 10:52 + */ + @Override + public Map getAgencyProjectClosedCount(String customerId, String monthId, String dateId) { + return null; + } + + /** + * 网格被吹哨项目中自己办结项目数 + * + * @param customerId + * @param monthId + * @param dateId + * @Param customerId + * @Param monthId + * @Param dateId + * @Return {@link Map< String, OrgStatisticsResultDTO>} + * @Author zhaoqifeng + * @Date 2021/12/7 10:52 + */ + @Override + public Map getGridProjectResolvedCount(String customerId, String monthId, String dateId) { + return null; + } + + /** + * 部门被吹哨项目中自己办结项目数 + * + * @param customerId + * @param monthId + * @param dateId + * @Param customerId + * @Param monthId + * @Param dateId + * @Return {@link Map< String, OrgStatisticsResultDTO>} + * @Author zhaoqifeng + * @Date 2021/12/7 10:52 + */ + @Override + public Map getDeptProjectResolvedCount(String customerId, String monthId, String dateId) { + return null; + } + + /** + * 组织被吹哨项目中自己办结项目数(含下级组织网格部门) + * + * @param customerId + * @param monthId + * @param dateId + * @Param customerId + * @Param monthId + * @Param dateId + * @Return {@link Map< String, OrgStatisticsResultDTO>} + * @Author zhaoqifeng + * @Date 2021/12/7 10:52 + */ + @Override + public Map getAgencyProjectResolvedCount(String customerId, String monthId, String dateId) { + return null; + } + + /** + * 网格自治项目数 + * + * @param customerId + * @param monthId + * @param dateId + * @Param customerId + * @Param monthId + * @Param dateId + * @Return {@link Map< String, OrgStatisticsResultDTO>} + * @Author zhaoqifeng + * @Date 2021/12/7 10:52 + */ + @Override + public Map getGridProjectSelfCount(String customerId, String monthId, String dateId) { + return null; + } + + /** + * 部门自治项目数 + * + * @param customerId + * @param monthId + * @param dateId + * @Param customerId + * @Param monthId + * @Param dateId + * @Return {@link Map< String, OrgStatisticsResultDTO>} + * @Author zhaoqifeng + * @Date 2021/12/7 10:52 + */ + @Override + public Map getDeptProjectSelfCount(String customerId, String monthId, String dateId) { + return null; + } + + /** + * 组织自治项目数(含下级组织网格部门) + * + * @param customerId + * @param monthId + * @param dateId + * @Param customerId + * @Param monthId + * @Param dateId + * @Return {@link Map< String, OrgStatisticsResultDTO>} + * @Author zhaoqifeng + * @Date 2021/12/7 10:52 + */ + @Override + public Map getAgencyProjectSelfCount(String customerId, String monthId, String dateId) { + return null; + } + + /** + * 网格产生的项目数 + * + * @param customerId + * @param monthId + * @param dateId + * @Param customerId + * @Param monthId + * @Param dateId + * @Return {@link Map< String, OrgStatisticsResultDTO>} + * @Author zhaoqifeng + * @Date 2021/12/7 10:52 + */ + @Override + public Map getGridProjectTotal(String customerId, String monthId, String dateId) { + return null; + } + + /** + * 组织产生的项目数(含下级组织网格部门) + * + * @param customerId + * @param monthId + * @param dateId + * @Param customerId + * @Param monthId + * @Param dateId + * @Return {@link Map< String, OrgStatisticsResultDTO>} + * @Author zhaoqifeng + * @Date 2021/12/7 10:52 + */ + @Override + public Map getAgencyProjectTotal(String customerId, String monthId, String dateId) { + return null; + } + + /** + * 网格产生的项目数中结案的项目数 + * + * @param customerId + * @param monthId + * @param dateId + * @Param customerId + * @Param monthId + * @Param dateId + * @Return {@link Map< String, OrgStatisticsResultDTO>} + * @Author zhaoqifeng + * @Date 2021/12/7 10:52 + */ + @Override + public Map getGridProjectClosedTotal(String customerId, String monthId, String dateId) { + return null; + } + + /** + * 组织产生的项目数中结案的项目数(含下级组织网格部门) + * + * @param customerId + * @param monthId + * @param dateId + * @Param customerId + * @Param monthId + * @Param dateId + * @Return {@link Map< String, OrgStatisticsResultDTO>} + * @Author zhaoqifeng + * @Date 2021/12/7 10:52 + */ + @Override + public Map getAgencyProjectClosedTotal(String customerId, String monthId, String dateId) { + return null; + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java index 600786782c..d84301a75b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java @@ -2,6 +2,9 @@ package com.epmet.service.evaluationindex.extract.toscreen.impl; import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.distributedlock.DistributedLock; +import com.epmet.commons.tools.distributedlock.LockConstants; import com.epmet.commons.tools.enums.EnvEnum; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.HttpClientManager; @@ -20,6 +23,7 @@ import com.epmet.service.stats.DimCustomerService; import com.google.common.util.concurrent.ThreadFactoryBuilder; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; +import org.redisson.api.RLock; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; @@ -84,6 +88,10 @@ public class ScreenExtractServiceImpl implements ScreenExtractService { private FactAgencyGovernDailyService factAgencyGovernDailyService; @Autowired private FactGridMemberStatisticsDailyService factGridMemberStatisticsDailyService; + @Autowired + private ScreenProjectCategoryGridAndOrgDailyService screenProjectCategoryGridAndOrgDailyService; + @Autowired + private DistributedLock distributedLock; /** * @param extractOriginFormDTO @@ -161,155 +169,188 @@ public class ScreenExtractServiceImpl implements ScreenExtractService { * @date 2020/9/24 10:16 上午 */ public void extractDaily(String customerId, String dateId, boolean isLast) { - //等待3个线程执行完毕后再 继续执行下一个客户的 避免死锁 - final CountDownLatch latch = new CountDownLatch(NumConstant.FOUR); - threadPool.submit(() -> { - //党员基本情况screen_cpc_base_data - try { - partyBaseInfoService.statsPartyMemberBaseInfoToScreen(customerId, dateId); - } catch (Exception e) { - log.error("党员基本情况抽取到大屏失败,customerId为:" + customerId + "dateId为:" + dateId, e); - } - //先锋模范screen_pioneer_data - if (isLast) { - try { - pioneerDataExtractService.extractGridPioneerData(customerId, dateId); - } catch (Exception e) { - log.error("先锋模范【网格】抽取到大屏失败,customerId为:" + customerId + "dateId为:" + dateId, e); - } - try { - pioneerDataExtractService.extractCommunityPioneerData(customerId, dateId); - } catch (Exception e) { - log.error("先锋模范【社区】抽取到大屏失败,customerId为:" + customerId + "dateId为:" + dateId, e); - } + RLock lock = null; + try { + // 锁持有10分钟,等待10s + lock = distributedLock.getLock(LockConstants.SCREEN_DAILY, NumConstant.SIX_HUNDRED_L, NumConstant.TEN_L, TimeUnit.SECONDS); + //等待3个线程执行完毕后再 继续执行下一个客户的 避免死锁 + final CountDownLatch latch = new CountDownLatch(NumConstant.FOUR); + threadPool.submit(() -> { + //党员基本情况screen_cpc_base_data try { - pioneerDataExtractService.extractExceptCommunityPioneerData(customerId, dateId); - } catch (Exception e) { - log.error("先锋模范【extractExceptCommunityPioneerData】抽取到大屏失败,customerId为:" + customerId + "dateId为:" + dateId, e); + try { + partyBaseInfoService.statsPartyMemberBaseInfoToScreen(customerId, dateId); + } catch (Exception e) { + log.error("党员基本情况抽取到大屏失败,customerId为:" + customerId + "dateId为:" + dateId, e); + } + //先锋模范screen_pioneer_data + if (isLast) { + try { + pioneerDataExtractService.extractGridPioneerData(customerId, dateId); + } catch (Exception e) { + log.error("先锋模范【网格】抽取到大屏失败,customerId为:" + customerId + "dateId为:" + dateId, e); + } + try { + pioneerDataExtractService.extractCommunityPioneerData(customerId, dateId); + } catch (Exception e) { + log.error("先锋模范【社区】抽取到大屏失败,customerId为:" + customerId + "dateId为:" + dateId, e); + } + try { + pioneerDataExtractService.extractExceptCommunityPioneerData(customerId, dateId); + } catch (Exception e) { + log.error("先锋模范【extractExceptCommunityPioneerData】抽取到大屏失败,customerId为:" + customerId + "dateId为:" + dateId, e); + } + } + } finally { + latch.countDown(); + log.info("extractDaily 1 thread run end ========= dateId:{},customerId:{}", dateId, customerId); } - } - latch.countDown(); - log.info("extractDaily 1 thread run end ========= dateId:{},customerId:{}", dateId, customerId); - }); - threadPool.submit(() -> { - //公众参与排行(注册人数、参与人数、话题数、议题数、项目数)screen_public_party_total_data - try { - publicPartiTotalDataExtractService.extractPublicPartiTotalData(customerId, dateId); - } catch (Exception e) { - log.error("公众参与排行抽取到大屏失败,customerId为:" + customerId + "dateId为:" + dateId, e); - } - if (isLast) { - //基层治理- 难点赌点 screen_difficulty_data | screen_difficulty_img_data + }); + threadPool.submit(() -> { + //公众参与排行(注册人数、参与人数、话题数、议题数、项目数)screen_public_party_total_data try { - ScreenCentralZoneDataFormDTO param2 = new ScreenCentralZoneDataFormDTO(); - param2.setCustomerId(customerId); - param2.setDateId(null); - log.info("【难点赌点数据上报开始------】 当前客户Id{}", param2.getCustomerId()); - //screenGrassrootsGovernDataAbsorptionService.difficultyDataHub(param); - screenGrassrootsGovernDataAbsorptionService.difficultyDataExtract(param2); - log.info("【难点赌点数据上报结束------】 当前客户Id{}", param2.getCustomerId()); - } catch (Exception e) { - log.error("基层治理-难点赌点抽取到大屏失败,customerId为:" + customerId + "dateId为:" + dateId, e); + ScreenCentralZoneDataFormDTO screenCentralZone = new ScreenCentralZoneDataFormDTO(); + screenCentralZone.setCustomerId(customerId); + screenCentralZone.setDateId(dateId); + //中央区 screen_user_total_data + try { + screenCentralZoneDataAbsorptionService.centralZoneDataHub(screenCentralZone); + } catch (Exception e) { + log.error("中央区抽取到大屏失败,customerId为:" + customerId + "dateId为:" + dateId, e); + } + + try { + publicPartiTotalDataExtractService.extractPublicPartiTotalData(customerId, dateId); + } catch (Exception e) { + log.error("公众参与排行抽取到大屏失败,customerId为:" + customerId + "dateId为:" + dateId, e); + } + if (isLast) { + //基层治理- 难点赌点 screen_difficulty_data | screen_difficulty_img_data + try { + ScreenCentralZoneDataFormDTO param2 = new ScreenCentralZoneDataFormDTO(); + param2.setCustomerId(customerId); + param2.setDateId(null); + log.info("【难点赌点数据上报开始------】 当前客户Id{}", param2.getCustomerId()); + //screenGrassrootsGovernDataAbsorptionService.difficultyDataHub(param); + + screenGrassrootsGovernDataAbsorptionService.difficultyDataExtract(param2); + log.info("【难点赌点数据上报结束------】 当前客户Id{}", param2.getCustomerId()); + } catch (Exception e) { + log.error("基层治理-难点赌点抽取到大屏失败,customerId为:" + customerId + "dateId为:" + dateId, e); + } + } + try { + //基层治理 - 热心市民 screen_party_user_rank_data + ScreenCentralZoneDataFormDTO param = new ScreenCentralZoneDataFormDTO(); + param.setCustomerId(customerId); + param.setDateId(dateId); + screenGrassrootsGovernDataAbsorptionService.userScoreDataHub(param); + } catch (Exception e) { + log.error("大屏热心市民/党员得分数据写入失败,参数为:{}" + customerId+ StrConstant.HYPHEN +dateId, e); + } + } finally { + latch.countDown(); + log.info("extractDaily 2 thread run end ========= dateId:{},customerId:{}", dateId, customerId); } - } - latch.countDown(); - log.info("extractDaily 2 thread run end ========= dateId:{},customerId:{}", dateId, customerId); - }); - threadPool.submit(() -> { - ScreenCentralZoneDataFormDTO param = new ScreenCentralZoneDataFormDTO(); - param.setCustomerId(customerId); - param.setDateId(dateId); - //中央区 screen_user_total_data - try { - screenCentralZoneDataAbsorptionService.centralZoneDataHub(param); - } catch (Exception e) { - log.error("中央区抽取到大屏失败,customerId为:" + customerId + "dateId为:" + dateId, e); - } + }); + threadPool.submit(() -> { + try { - try { - // 项目(事件)分析按网格_按天统计 - screenProjectGridDailyService.extractionProjectGridDaily(customerId, dateId); - } catch (Exception e) { - log.error("项目(事件)分析按网格_按天统计失败,customerId为:" + customerId + "dateId为:" + dateId, e); - } - try { - // 项目(事件)分析按组织_按天统计 - screenProjectOrgDailyService.extractionProjectOrgDaily(customerId, dateId); - } catch (Exception e) { - log.error("项目(事件)分析按组织_按天统计失败,customerId为:" + customerId + "dateId为:" + dateId, e); - } + try { + // 项目(事件)分析按网格_按天统计 + screenProjectGridDailyService.extractionProjectGridDaily(customerId, dateId); + } catch (Exception e) { + log.error("项目(事件)分析按网格_按天统计失败,customerId为:" + customerId + "dateId为:" + dateId, e); + } + try { + // 项目(事件)分析按组织_按天统计 + screenProjectOrgDailyService.extractionProjectOrgDaily(customerId, dateId); + } catch (Exception e) { + log.error("项目(事件)分析按组织_按天统计失败,customerId为:" + customerId + "dateId为:" + dateId, e); + } - //按天统计:网格内各个分类下的项目总数 - try { - projectCategoryGridDailyService.extractProjectCategoryData(customerId, dateId); - } catch (Exception e) { - log.error("按天统计:网格内各个分类下的项目总数,customerId为:" + customerId + "dateId为:" + dateId, e); - } + //按天统计:网格内各个分类下的项目总数 + try { + screenProjectCategoryGridAndOrgDailyService.extractCategoryProjectGridData(customerId, dateId); + } catch (Exception e) { + log.error("按天统计:网格内各个分类下的项目总数,customerId为:" + customerId + "dateId为:" + dateId, e); + } - // 按天统计:组织内各个分类下的项目总数 - try { - projectCategoryOrgDailyService.extractProjectCategoryOrgData(customerId, dateId); - } catch (Exception e) { - log.error("按天统计:组织内各个分类下的项目总数,customerId为:" + customerId + "dateId为:" + dateId, e); - } - latch.countDown(); - log.info("extractDaily 3 thread run end ========= dateId:{},customerId:{}", dateId, customerId); - }); - threadPool.submit(() -> { - //治理能力排行screen_govern_rank_data - try { - governRankDataExtractService.extractGridDataDaily(customerId, dateId); - } catch (Exception e) { - log.error("治理能力排行【网格】抽取到大屏失败,customerId为:" + customerId + "dateId为:" + dateId, e); - } - try { - governRankDataExtractService.extractCommunityDataDaily(customerId, dateId); - } catch (Exception e) { - log.error("治理能力排行【社区】抽取到大屏失败,customerId为:" + customerId + "dateId为:" + dateId, e); - } - try { - governRankDataExtractService.extractStreetDataDaily(customerId, dateId); - } catch (Exception e) { - log.error("治理能力排行【街道】抽取到大屏失败,customerId为:" + customerId + "dateId为:" + dateId, e); - } - try { - governRankDataExtractService.extractDistrictDataDaily(customerId, dateId); - } catch (Exception e) { - log.error("治理能力排行【全区】抽取到大屏失败,customerId为:" + customerId + "dateId为:" + dateId, e); - } + // 按天统计:组织内各个分类下的项目总数 + try { + screenProjectCategoryGridAndOrgDailyService.extractCategoryProjectOrgData(customerId, dateId); + } catch (Exception e) { + log.error("按天统计:组织内各个分类下的项目总数,customerId为:" + customerId + "dateId为:" + dateId, e); + } + } finally { + latch.countDown(); + log.info("extractDaily 3 thread run end ========= dateId:{},customerId:{}", dateId, customerId); + } + }); + threadPool.submit(() -> { + //治理能力排行screen_govern_rank_data + try { + try { + governRankDataExtractService.extractGridDataDaily(customerId, dateId); + } catch (Exception e) { + log.error("治理能力排行【网格】抽取到大屏失败,customerId为:" + customerId + "dateId为:" + dateId, e); + } + try { + governRankDataExtractService.extractCommunityDataDaily(customerId, dateId); + } catch (Exception e) { + log.error("治理能力排行【社区】抽取到大屏失败,customerId为:" + customerId + "dateId为:" + dateId, e); + } + try { + governRankDataExtractService.extractStreetDataDaily(customerId, dateId); + } catch (Exception e) { + log.error("治理能力排行【街道】抽取到大屏失败,customerId为:" + customerId + "dateId为:" + dateId, e); + } + try { + governRankDataExtractService.extractDistrictDataDaily(customerId, dateId); + } catch (Exception e) { + log.error("治理能力排行【全区】抽取到大屏失败,customerId为:" + customerId + "dateId为:" + dateId, e); + } - try { - ExtractFactGridGovernDailyFromDTO extractFactGridGovernDailyFromDTO = new ExtractFactGridGovernDailyFromDTO(); - extractFactGridGovernDailyFromDTO.setCustomerId(customerId); - extractFactGridGovernDailyFromDTO.setDateId(dateId); - factGridGovernDailyService.extractFactGridGovernDaily(extractFactGridGovernDailyFromDTO); - } catch (Exception e) { - log.error("治理指数-网格fact_grid_govern_daily抽取失败,customerId为:" + customerId + "dateId为:" + dateId, e); - } + try { + ExtractFactGridGovernDailyFromDTO extractFactGridGovernDailyFromDTO = new ExtractFactGridGovernDailyFromDTO(); + extractFactGridGovernDailyFromDTO.setCustomerId(customerId); + extractFactGridGovernDailyFromDTO.setDateId(dateId); + factGridGovernDailyService.extractFactGridGovernDaily(extractFactGridGovernDailyFromDTO); + } catch (Exception e) { + log.error("治理指数-网格fact_grid_govern_daily抽取失败,customerId为:" + customerId + "dateId为:" + dateId, e); + } - try { - factAgencyGovernDailyService.extractFactAgencyGovernDaily(customerId, dateId); - } catch (Exception e) { - log.error("治理指数-组织fact_agency_govern_daily抽取失败,customerId为:" + customerId + "dateId为:" + dateId, e); - } + try { + factAgencyGovernDailyService.extractFactAgencyGovernDaily(customerId, dateId); + } catch (Exception e) { + log.error("治理指数-组织fact_agency_govern_daily抽取失败,customerId为:" + customerId + "dateId为:" + dateId, e); + } + try { + factGridMemberStatisticsDailyService.extractGridMemberStatisticsDaily(customerId, dateId); + } catch (Exception e) { + log.error("网格员数据统计fact_grid_member_statistics_daily抽取失败,customerId为:" + customerId + "dateId为:" + dateId, e); + } + extractPartData(customerId, dateId); + } finally { + latch.countDown(); + log.info("extractDaily 4 thread run end ========= dateId:{},customerId:{}", dateId, customerId); + } + }); try { - factGridMemberStatisticsDailyService.extractGridMemberStatisticsDaily(customerId, dateId); - } catch (Exception e) { - log.error("网格员数据统计fact_grid_member_statistics_daily抽取失败,customerId为:" + customerId + "dateId为:" + dateId, e); + latch.await(); + } catch (InterruptedException e) { + log.error("extractDaily run exception", e); } - extractPartData(customerId, dateId); - latch.countDown(); - log.info("extractDaily 4 thread run end ========= dateId:{},customerId:{}", dateId, customerId); - }); - try { - latch.await(); - } catch (InterruptedException e) { - log.error("extractDaily run exception", e); + log.info("===== extractDaily method end customerId:{}======",customerId); + } catch (Exception e) { + log.error("extractDaily exception msg:{}", e); + } finally { + distributedLock.unLock(lock); } - log.info("===== extractDaily method end customerId:{}======",customerId); + } @Override @@ -329,7 +370,7 @@ public class ScreenExtractServiceImpl implements ScreenExtractService { //dateId不为空,只计算当天存在评价记录的项目,更新项目对应的得分。 screenProjectSettleService.updateProjectSatisfactionScore(customerId,dateId,null); }catch(Exception e){ - log.error("群众不满得分更新失败"); + log.error("群众不满得分更新失败,msg:{}", e); } } @@ -397,7 +438,8 @@ public class ScreenExtractServiceImpl implements ScreenExtractService { } catch (Exception e) { log.error("党建引领抽取到大屏失败,参数为:" + JSON.toJSONString(formDTO), e); } - try { + //已经挪到天抽取的抽取里了 + /* try { //基层治理 - 热心市民 screen_party_user_rank_data ScreenCentralZoneDataFormDTO param = new ScreenCentralZoneDataFormDTO(); param.setCustomerId(customerId); @@ -405,7 +447,7 @@ public class ScreenExtractServiceImpl implements ScreenExtractService { screenGrassrootsGovernDataAbsorptionService.userScoreDataHub(param); } catch (Exception e) { log.error("大屏热心市民/党员得分数据写入失败,参数为:{}" + JSON.toJSONString(formDTO), e); - } + }*/ try { // 项目(事件)数量分析按网格_按月统计 screenProjectQuantityGridMonthlyService.extractionProjectGridMonthly(customerId, monthId); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java index fd6801d1a5..230238b288 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java @@ -11,6 +11,7 @@ import com.epmet.dto.org.GridInfoDTO; import com.epmet.dto.project.result.ProjectLatestOperationResultDTO; import com.epmet.dto.screen.form.ProjectSourceMapFormDTO; import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO; +import com.epmet.dto.topic.TopicAttachmentDTO; import com.epmet.dto.topic.result.ResiTopicAndImgResultDTO; import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity; import com.epmet.entity.evaluationindex.extract.FactOriginProjectOrgPeriodDailyEntity; @@ -88,6 +89,10 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr **/ @Override public void userScoreDataHub(ScreenCentralZoneDataFormDTO param) { + if (StringUtils.isNotBlank(param.getDateId()) && param.getDateId().length()!= NumConstant.EIGHT){ + log.error("userScoreDataHub param dateId must be dateId(eg:20211212)"); + return; + } //1.查询出客户下的网格注册用户 List registeredUsers = userService.getRegisteredUserList(param.getCustomerId()); @@ -100,19 +105,15 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr Map pointMap = userPointService.getUserPointMap(param.getCustomerId()); //4.查询出客户下党员的分值 String dateId = param.getDateId(); - if (StringUtils.isEmpty(dateId)) { - //如果没有传月份,则使用当前时间的上一个月 + final String finalDateId = dateId; + String currentMonthId = DateUtils.getBeforeNMonth(0); + if (StringUtils.isEmpty(dateId) || dateId.contains(currentMonthId)) { + //如果没有传月份 或者传的为日期为当前月则,则使用当前时间的上一个月 dateId = DateUtils.getBeforeNMonth(NumConstant.ONE); } else { - String dateType = DateUtils.identifyTimeDimension(dateId); - if (StringUtils.isEmpty(dateType) || !StringUtils.equalsAny(dateType, "date", "month")) { - dateId = DateUtils.getBeforeNMonth(NumConstant.ONE); - } else if (StringUtils.equals(dateType, "date")) { - dateId = dateId.substring(NumConstant.ZERO, dateId.length() - NumConstant.TWO); - } + dateId = dateId.substring(NumConstant.ZERO, dateId.length() - NumConstant.TWO); } - final String finalDateId = dateId; - // 查询党员积分 + // 查询党员指标得分 按月查 Map scoreMap = cpcIndexCalculateService.getCpcScore(param.getCustomerId(), dateId); //剔除垃圾数据 @@ -209,6 +210,10 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr imgMap.values().forEach(imgList::addAll); //立案后会有 一个process 如果没有则说明是垃圾数据 如果有其他方式立项的项目则需要考虑下兼容 + difficulties.removeIf(diff -> StringUtils.isBlank(diff.getLatestOperateDesc())); + + screenDifficultyDataService.dataClean(param.getCustomerId(), difficulties, imgList); + log.info("【大屏数据抽取-难点赌点执行完毕】 客户Id{} 难点赌点数据{}", param.getCustomerId(), JSON.toJSONString(difficulties)); difficulties.removeIf( diff -> StringUtils.isBlank(diff.getLatestOperateDesc())); imgList.forEach(item -> { item.setCustomerId(param.getCustomerId()); @@ -289,16 +294,20 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr //获取图片及话题内容 ResiTopicAndImgResultDTO topicInfo = topicService.getTopicAndImgs(project.getTopicId(), "image"); if (topicInfo != null) { - diffEntity.setEventImgUrl(topicInfo.getTopicImgList().get(NumConstant.ZERO).getAttachmentUrl()); + List topicImgList = topicInfo.getTopicImgList(); + if (!CollectionUtils.isEmpty(topicImgList)){ + diffEntity.setEventImgUrl(topicImgList.get(NumConstant.ZERO).getAttachmentUrl()); + topicImgList.forEach(img -> { + ScreenDifficultyImgDataEntity imgData = new ScreenDifficultyImgDataEntity(); + imgData.setEventId(project.getId()); + imgData.setEventImgUrl(img.getAttachmentUrl()); + imgData.setSort(img.getSort()); + imgDataEntities.add(imgData); + imgData.setCustomerId(param.getCustomerId()); + }); + } diffEntity.setEventContent(topicInfo.getTopicContent()); - topicInfo.getTopicImgList().forEach(img -> { - ScreenDifficultyImgDataEntity imgData = new ScreenDifficultyImgDataEntity(); - imgData.setEventId(project.getId()); - imgData.setEventImgUrl(img.getAttachmentUrl()); - imgData.setSort(img.getSort()); - imgDataEntities.add(imgData); - imgData.setCustomerId(param.getCustomerId()); - }); + log.info("projectId:{} imgs:{}", project.getId(), imgDataEntities.stream().filter(o -> o.getEventId().equals(project.getId())).count()); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java index ffff48bc3f..6ad38758e4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java @@ -85,6 +85,7 @@ public class ScreenProjectSettleServiceImpl implements ScreenProjectSettleServic meta.setProjectCreateTime(projectInfo.getCreatedTime()); meta.setProjectTitle(projectInfo.getTitle()); meta.setOrigin(projectInfo.getOrigin()); + meta.setProjectCreator(projectInfo.getCreatedBy()); if (ProjectConstant.PROJECT_ORIGIN_ISSUE.equals(projectInfo.getOrigin())) { //来源于议题的,上面的initNewScreenProjectData,已经赋值orgType=grid, orgId:gridId diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerAgencyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerAgencyService.java index 5ded177ae0..9a46990c1d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerAgencyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerAgencyService.java @@ -17,6 +17,7 @@ package com.epmet.service.evaluationindex.screen; +import com.epmet.commons.mybatis.service.BaseService; import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.extract.form.PartyBaseInfoFormDTO; import com.epmet.dto.extract.form.ScreenPartyBranchDataFormDTO; @@ -35,7 +36,7 @@ import java.util.Map; * @author generator generator@elink-cn.com * @since v1.0.0 2020-09-22 */ -public interface ScreenCustomerAgencyService{ +public interface ScreenCustomerAgencyService extends BaseService { /** * @Description 根据agencyId,查询所有子级agencyId,【当机关的级别为 community时,所有子级为gridId】 @@ -137,5 +138,30 @@ public interface ScreenCustomerAgencyService{ * @author sun */ List getByCustomerId(String customerId); + /** + * @Description 根据ID获取组织 + * @Param agencyId + * @Return {@link ScreenCustomerAgencyEntity} + * @Author zhaoqifeng + * @Date 2021/10/15 15:44 + */ + ScreenCustomerAgencyEntity getAgencyById(String agencyId); + /** + * @Description 获取组织列表 + * @Param customerId + * @Return {@link Map< String, ScreenCustomerAgencyEntity>} + * @Author zhaoqifeng + * @Date 2021/10/15 15:44 + */ + Map getAgencyList(String customerId); + + /** + * @Description 获取父级组织ID(外部客户) + * @Param agencyId + * @Return {@link String} + * @Author zhaoqifeng + * @Date 2021/11/10 17:00 + */ + String getParentAgencyId(String agencyId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerGridService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerGridService.java index 1fb59aa3b5..bf701b81d3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerGridService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerGridService.java @@ -28,6 +28,7 @@ import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity; import com.epmet.entity.org.CustomerGridEntity; import java.util.List; +import java.util.Map; /** * 网格(党支部)信息 @@ -111,4 +112,21 @@ public interface ScreenCustomerGridService extends BaseService selectGridInfoList(String customerId, String pids); List selectEntityByAgencyId(String customerId, String parentAgencyId); + + /** + * @Description 根据ID获取网格 + * @Param gridId + * @Return {@link ScreenCustomerGridDTO} + * @Author zhaoqifeng + * @Date 2021/10/15 15:50 + */ + ScreenCustomerGridDTO getGridById(String gridId); + /** + * @Description 获取网格列表 + * @Param customerId + * @Return {@link Map} + * @Author zhaoqifeng + * @Date 2021/10/15 15:50 + */ + Map getGridList(String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectCategoryGridAndOrgDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectCategoryGridAndOrgDailyService.java new file mode 100644 index 0000000000..9cdc9f3522 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectCategoryGridAndOrgDailyService.java @@ -0,0 +1,34 @@ +package com.epmet.service.evaluationindex.screen; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.screen.ScreenProjectCategoryOrgDailyDTO; +import com.epmet.dto.screencoll.ScreenCollFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenProjectCategoryOrgDailyEntity; + +import java.util.List; +import java.util.Map; + +/** + * 项目(事件)分类按 网格——组织——按天统计 + */ +public interface ScreenProjectCategoryGridAndOrgDailyService { + + /** + * @Description 分类下的项目数【grid】 + * @param customerId + * @param dateId + * @author zxc + * @date 2021/11/10 10:23 上午 + */ + void extractCategoryProjectGridData(String customerId, String dateId); + + /** + * @Description 分类下的项目数【org】 + * @param customerId + * @param dateId + * @author zxc + * @date 2021/11/10 10:23 上午 + */ + void extractCategoryProjectOrgData(String customerId, String dateId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectCategoryService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectCategoryService.java new file mode 100644 index 0000000000..7cea3ea62c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectCategoryService.java @@ -0,0 +1,105 @@ +/** + * 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.service.evaluationindex.screen; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.screen.ScreenProjectCategoryDTO; +import com.epmet.entity.evaluationindex.screen.ScreenProjectCategoryEntity; + +import java.util.List; +import java.util.Map; + +/** + * 项目所属分类表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-10 + */ +public interface ScreenProjectCategoryService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-11-10 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-11-10 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ScreenProjectCategoryDTO + * @author generator + * @date 2021-11-10 + */ + ScreenProjectCategoryDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-11-10 + */ + void save(ScreenProjectCategoryDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-11-10 + */ + void update(ScreenProjectCategoryDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-11-10 + */ + void delete(String[] ids); + + /** + * 删除项目分类 + * @Param customerId + * @Param projectIds + * @Return + * @Author zhaoqifeng + * @Date 2021/11/10 11:06 + */ + void deleteByProjectId(String customerId, List projectIds); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectDataService.java index 7b82707c91..cf5279027a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectDataService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectDataService.java @@ -18,6 +18,7 @@ package com.epmet.service.evaluationindex.screen; import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.rocketmq.messages.DisputeProcessMQMsg; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.screen.ScreenProjectDataDTO; import com.epmet.dto.screen.form.ScreenProjectDataInfoFormDTO; @@ -127,4 +128,33 @@ public interface ScreenProjectDataService extends BaseService meta,List orient); int updateProjectSatisfactionScore(String projectId, BigDecimal calProjectSatisfactionScore); + + /** + * 获取项目 + * @Param customerId + * @Param projectId + * @Return {@link List} + * @Author zhaoqifeng + * @Date 2021/10/15 14:22 + */ + List getProjectList(String customerId, List projectId, Integer pageNo, Integer pageSize); + + /** + * 项目变更MQ + * @Param msg + * @Return + * @Author zhaoqifeng + * @Date 2021/10/18 15:55 + */ + void sendProjectChangeMq(DisputeProcessMQMsg msg); + + /** + * @Description 提取项目分类 + * @Param customerId + * @Return + * @Author zhaoqifeng + * @Date 2021/11/10 10:24 + */ + void extractCategory(String customerId); + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerAgencyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerAgencyServiceImpl.java index 20d242bb29..7a0b1a5415 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerAgencyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerAgencyServiceImpl.java @@ -17,7 +17,9 @@ package com.epmet.service.evaluationindex.screen.impl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.DataSourceConstant; @@ -36,13 +38,14 @@ import com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity; import com.epmet.entity.org.CustomerAgencyEntity; import com.epmet.service.evaluationindex.screen.ScreenCustomerAgencyService; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; -import org.springframework.util.StringUtils; import java.util.*; +import java.util.function.Function; import java.util.stream.Collectors; /** @@ -54,7 +57,7 @@ import java.util.stream.Collectors; @Service @Slf4j @DataSource(DataSourceConstant.EVALUATION_INDEX) -public class ScreenCustomerAgencyServiceImpl implements ScreenCustomerAgencyService { +public class ScreenCustomerAgencyServiceImpl extends BaseServiceImpl implements ScreenCustomerAgencyService { @Autowired private ScreenCustomerAgencyDao screenCustomerAgencyDao; @@ -143,6 +146,13 @@ public class ScreenCustomerAgencyServiceImpl implements ScreenCustomerAgencyServ exists.setParentAreaCode(e.getParentAreaCode()); exists.setCode(e.getCode()); updateAgency(exists); + + // 已删除数据的处理 + if ("1".equals(e.getDelFlag())) { + LambdaQueryWrapper w = new LambdaQueryWrapper<>(); + w.eq(ScreenCustomerAgencyEntity::getAgencyId, e.getId()); + screenCustomerAgencyDao.delete(w); + } } } } @@ -306,4 +316,43 @@ public class ScreenCustomerAgencyServiceImpl implements ScreenCustomerAgencyServ return screenCustomerAgencyDao.selectByCustomerId(customerId); } + @Override + public ScreenCustomerAgencyEntity getAgencyById(String agencyId) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(ScreenCustomerAgencyEntity::getAgencyId, agencyId); + return baseDao.selectOne(wrapper); + } + + /** + * @param customerId + * @Description 获取组织列表 + * @Param customerId + * @Return {@link Map< String, ScreenCustomerAgencyEntity>} + * @Author zhaoqifeng + * @Date 2021/10/15 15:44 + */ + @Override + public Map getAgencyList(String customerId) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(customerId), ScreenCustomerAgencyEntity::getCustomerId, customerId); + List list = baseDao.selectList(wrapper); + if (CollectionUtils.isEmpty(list)) { + return Collections.emptyMap(); + } + return list.stream().collect(Collectors.toMap(ScreenCustomerAgencyEntity::getAgencyId, Function.identity())); + } + + /** + * @param agencyId + * @Description 获取父级组织ID(外部客户) + * @Param agencyId + * @Return {@link String} + * @Author zhaoqifeng + * @Date 2021/11/10 17:00 + */ + @Override + public String getParentAgencyId(String agencyId) { + return baseDao.getParentAgencyId(agencyId); + } + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerDeptServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerDeptServiceImpl.java index 2e12d83d45..e7409e2c9d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerDeptServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerDeptServiceImpl.java @@ -17,6 +17,7 @@ package com.epmet.service.evaluationindex.screen.impl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.utils.DateUtils; @@ -90,6 +91,13 @@ public class ScreenCustomerDeptServiceImpl extends BaseServiceImpl w = new LambdaQueryWrapper<>(); + w.eq(ScreenCustomerDeptEntity::getDeptId, dept.getId()); + screenCustomerDeptDao.delete(w); + } } } } 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 f4bba9b2a7..33fffebc37 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 @@ -22,6 +22,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.constant.OrgSourceTypeConstant; @@ -34,15 +35,15 @@ import com.epmet.dto.screen.ScreenProjectGridDailyDTO; import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity; import com.epmet.entity.org.CustomerGridEntity; import com.epmet.service.evaluationindex.screen.ScreenCustomerGridService; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Date; -import java.util.List; +import java.util.*; +import java.util.function.Function; +import java.util.stream.Collectors; /** * 网格(党支部)信息 @@ -217,4 +218,36 @@ public class ScreenCustomerGridServiceImpl extends BaseServiceImpl selectEntityByAgencyId(String customerId, String parentAgencyId) { return baseDao.selectEntityByAgencyId(customerId,parentAgencyId); } + + /** + * @param gridId + * @Description 根据ID获取网格 + * @Param gridId + * @Return {@link ScreenCustomerGridDTO} + * @Author zhaoqifeng + * @Date 2021/10/15 15:50 + */ + @Override + public ScreenCustomerGridDTO getGridById(String gridId) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(ScreenCustomerGridEntity::getGridId, gridId); + ScreenCustomerGridEntity entity = baseDao.selectOne(wrapper); + return ConvertUtils.sourceToTarget(entity, ScreenCustomerGridDTO.class); + } + + /** + * @param customerId + * @Description 获取网格列表 + * @Param customerId + * @Return {@link Map } + * @Author zhaoqifeng + * @Date 2021/10/15 15:50 + */ + @Override + public Map getGridList(String customerId) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(customerId), ScreenCustomerGridEntity::getCustomerId, customerId); + List list = baseDao.selectList(wrapper); + return ConvertUtils.sourceToTarget(list, ScreenCustomerGridDTO.class).stream().collect(Collectors.toMap(ScreenCustomerGridDTO::getGridId, Function.identity())); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectCategoryGridAndOrgDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectCategoryGridAndOrgDailyServiceImpl.java new file mode 100644 index 0000000000..62ebe841fb --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectCategoryGridAndOrgDailyServiceImpl.java @@ -0,0 +1,228 @@ +package com.epmet.service.evaluationindex.screen.impl; + +import com.alibaba.fastjson.JSON; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.constant.DataSourceConstant; +import com.epmet.constant.PingYinConstant; +import com.epmet.constant.ProjectConstant; +import com.epmet.dao.evaluationindex.screen.ScreenCustomerAgencyDao; +import com.epmet.dao.evaluationindex.screen.ScreenProjectCategoryGridDailyDao; +import com.epmet.dao.evaluationindex.screen.ScreenProjectCategoryOrgDailyDao; +import com.epmet.dao.evaluationindex.screen.ScreenProjectDataDao; +import com.epmet.dto.screen.ScreenProjectOrgDailyDTO; +import com.epmet.dto.screen.result.GridAndOrgCategoryCountResultDTO; +import com.epmet.entity.crm.CustomerRelationEntity; +import com.epmet.entity.evaluationindex.screen.ScreenProjectCategoryGridDailyEntity; +import com.epmet.entity.evaluationindex.screen.ScreenProjectCategoryOrgDailyEntity; +import com.epmet.service.crm.CustomerRelationService; +import com.epmet.service.evaluationindex.screen.ScreenProjectCategoryGridAndOrgDailyService; +import com.epmet.service.evaluationindex.screen.ScreenProjectCategoryGridDailyService; +import com.epmet.service.evaluationindex.screen.ScreenProjectCategoryOrgDailyService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.ListUtils; +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.List; +import java.util.stream.Collectors; + +/** + * @Author zxc + * @DateTime 2021/11/10 10:25 上午 + * @DESC + */ +@Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) +@Slf4j +public class ScreenProjectCategoryGridAndOrgDailyServiceImpl implements ScreenProjectCategoryGridAndOrgDailyService{ + + @Autowired + private ScreenProjectDataDao screenProjectDataDao; + @Autowired + private CustomerRelationService relationService; + @Autowired + private ScreenProjectCategoryGridDailyDao gridDailyDao; + @Autowired + private ScreenProjectCategoryGridDailyService gridDailyService; + @Autowired + private ScreenProjectCategoryOrgDailyService orgDailyService; + @Autowired + private ScreenProjectCategoryOrgDailyDao orgDailyDao; + @Autowired + private ScreenCustomerAgencyDao screenCustomerAgencyDao; + + /** + * @Description 分类下的项目数【grid】 + * @param customerId + * @param dateId + * @author zxc + * @date 2021/11/10 10:23 上午 + */ + @Override + public void extractCategoryProjectGridData(String customerId, String dateId) { + log.info("开始执行网格项目分类统计"); + long start = System.currentTimeMillis(); + List relationInfo = relationService.selectSubCustomer(customerId); + List customerIds = new ArrayList<>(); + customerIds.add(customerId); + List allList = new ArrayList<>(); + List closedList = new ArrayList<>(); + if (CollectionUtils.isEmpty(relationInfo)){ + // 单客户 + allList = screenProjectDataDao.selectGridCategoryProjectCount(dateId, customerId, ProjectConstant.PROJECT_STATUS_ALL,customerId, NumConstant.FOUR); + closedList = screenProjectDataDao.selectGridCategoryProjectCount(dateId, customerId, ProjectConstant.PROJECT_STATUS_CLOSED,customerId, NumConstant.FOUR); + }else { + // 多客户 + List subCustomerIds = relationInfo.stream().map(CustomerRelationEntity::getCustomerId).collect(Collectors.toList()); + customerIds.addAll(subCustomerIds); + List finalAllList = allList; + List finalClosedList1 = closedList; + customerIds.forEach(c -> { + List all = screenProjectDataDao.selectGridCategoryProjectCount(dateId, customerId, ProjectConstant.PROJECT_STATUS_ALL, c, NumConstant.TWO); + finalAllList.addAll(all); + List closed = screenProjectDataDao.selectGridCategoryProjectCount(dateId, customerId, ProjectConstant.PROJECT_STATUS_CLOSED, c, NumConstant.TWO); + finalClosedList1.addAll(closed); + }); + } + List finalClosedList = closedList; + allList.forEach(a -> finalClosedList.stream().filter(c -> c.getGridId().equals(a.getGridId()) && c.getCategoryCode().equals(a.getCategoryCode())).forEach(c -> a.setClosedProjectTotal(c.getClosedProjectTotal()))); + gridDel(customerId,dateId); + log.info("网格-所有项目分类即将插入的集合{}",JSON.toJSONString(allList)); + gridInsert(allList); + long end = System.currentTimeMillis(); + log.info("网格项目分类统计结束,耗时:"+ (end-start)/1000 + "s"); + } + + /** + * @Description 项目分类网格删除 + * @param customerId + * @param dateId + * @author zxc + * @date 2021/11/10 1:55 下午 + */ + @Transactional(rollbackFor = Exception.class) + public void gridDel(String customerId,String dateId){ + Integer num = NumConstant.ZERO; + do { + num = gridDailyDao.deleteByDateIdAndCustomerId(customerId, dateId); + }while (num > NumConstant.ZERO && num == NumConstant.ONE_THOUSAND); + } + + /** + * @Description 项目分类网格添加 + * @param needInsert + * @author zxc + * @date 2021/11/10 1:55 下午 + */ + @Transactional(rollbackFor = Exception.class) + public void gridInsert(List needInsert){ + List> partition = ListUtils.partition(needInsert, NumConstant.ONE_HUNDRED); + partition.forEach(p -> { + gridDailyService.insertBatch(ConvertUtils.sourceToTarget(p,ScreenProjectCategoryGridDailyEntity.class)); + log.info("插入的网格项目分类为" + JSON.toJSONString(p)); + }); + } + + /** + * @Description 分类下的项目数【org】 + * 项目分类来源 + * 本级【直接立项】 + 下级 + 直属网格 + * @param customerId + * @param dateId + * @author zxc + * @date 2021/11/10 10:23 上午 + */ + @Override + public void extractCategoryProjectOrgData(String customerId, String dateId) { + log.info("开始执行组织项目分类统计"); + long start = System.currentTimeMillis(); + List relationInfo = relationService.selectSubCustomer(customerId); + List result = new ArrayList<>(); + if (CollectionUtils.isEmpty(relationInfo)){ + // one customer + List agencies = screenCustomerAgencyDao.selectAgencyByCustomer(customerId); + if (CollectionUtils.isEmpty(agencies)){ + return; + } + List allAgencies = ConvertUtils.sourceToTarget(agencies, GridAndOrgCategoryCountResultDTO.class); + + result = screenProjectDataDao.selectOrgCategoryProjectCount(dateId, ProjectConstant.PROJECT_STATUS_ALL, customerId, NumConstant.FOUR, allAgencies); + List closedList = screenProjectDataDao.selectOrgCategoryProjectCount(dateId, ProjectConstant.PROJECT_STATUS_CLOSED, customerId, NumConstant.FOUR, allAgencies); + result.forEach(r -> closedList.stream().filter(c -> r.getOrgId().equals(c.getOrgId()) && r.getCategoryCode().equals(c.getCategoryCode())).forEach(c -> r.setClosedProjectTotal(c.getClosedProjectTotal()))); + + + List oneLevelList = screenProjectDataDao.selectOrgCategoryOneLevelProjectCount(dateId, ProjectConstant.PROJECT_STATUS_ALL, customerId, NumConstant.FOUR, allAgencies); + List oneLevelClosedList = screenProjectDataDao.selectOrgCategoryOneLevelProjectCount(dateId, ProjectConstant.PROJECT_STATUS_CLOSED, customerId, NumConstant.FOUR, allAgencies); + oneLevelList.forEach(a -> oneLevelClosedList.stream().filter(c -> a.getOrgId().equals(c.getOrgId()) && a.getCategoryCode().equals(c.getCategoryCode())).forEach(c -> a.setClosedProjectTotal(c.getClosedProjectTotal()))); + + result.addAll(oneLevelList); + }else { + // more customers + // 去除孔村的客户ID,孔村镇的单独查😡 + List subCustomerIds = relationInfo.stream().map(CustomerRelationEntity::getCustomerId).collect(Collectors.toList()); + for (int i = NumConstant.ZERO; i < subCustomerIds.size(); i++) { + if (subCustomerIds.get(i).equals(PingYinConstant.KONG_CUN_CUSTOMER_ID)){ + subCustomerIds.remove(i); + continue; + } + } + subCustomerIds.add(customerId); + List allAgencies = screenCustomerAgencyDao.selectParentSonAgency(subCustomerIds, PingYinConstant.KONG_CUN_CUSTOMER_ID); + log.info("父子客户所有的组织{}",JSON.toJSONString(allAgencies)); + List> partition = ListUtils.partition(allAgencies, NumConstant.FIFTY); + List allOrgCategoryList = result; + partition.forEach(p -> { + List allOrgList = screenProjectDataDao.selectOrgCategoryProjectCount(dateId, ProjectConstant.PROJECT_STATUS_ALL, customerId, NumConstant.TWO, p); + List closedOrgList = screenProjectDataDao.selectOrgCategoryProjectCount(dateId, ProjectConstant.PROJECT_STATUS_CLOSED, customerId, NumConstant.TWO, p); + allOrgList.forEach(a -> closedOrgList.stream().filter(c -> a.getOrgId().equals(c.getOrgId()) && a.getCategoryCode().equals(c.getCategoryCode())).forEach(c -> a.setClosedProjectTotal(c.getClosedProjectTotal()))); + + List oneLevelList = screenProjectDataDao.selectOrgCategoryOneLevelProjectCount(dateId, ProjectConstant.PROJECT_STATUS_ALL, customerId, NumConstant.TWO, p); + List oneLevelClosedList = screenProjectDataDao.selectOrgCategoryOneLevelProjectCount(dateId, ProjectConstant.PROJECT_STATUS_CLOSED, customerId, NumConstant.TWO, p); + oneLevelList.forEach(a -> oneLevelClosedList.stream().filter(c -> a.getOrgId().equals(c.getOrgId()) && a.getCategoryCode().equals(c.getCategoryCode())).forEach(c -> a.setClosedProjectTotal(c.getClosedProjectTotal()))); + + allOrgList.addAll(oneLevelList); + allOrgCategoryList.addAll(allOrgList); + }); + } + orgDel(customerId,dateId); + log.info("组织-即将插入的项目分类{}",JSON.toJSONString(result)); + orgInsert(result); + long end = System.currentTimeMillis(); + log.info("组织项目分类统计结束,耗时:"+ (end-start)/1000 + "s"); + } + + /** + * @Description 项目分类组织删除 + * @param customerId + * @param dateId + * @author zxc + * @date 2021/11/10 4:58 下午 + */ + @Transactional(rollbackFor = Exception.class) + public void orgDel(String customerId,String dateId){ + Integer num = NumConstant.ZERO; + do { + num = orgDailyDao.deleteByDateIdAndCustomerId(customerId, dateId); + }while (num > NumConstant.ZERO && num == NumConstant.ONE_THOUSAND); + } + + /** + * @Description 项目分类组织插入 + * @param needInsert + * @author zxc + * @date 2021/11/10 5:03 下午 + */ + @Transactional(rollbackFor = Exception.class) + public void orgInsert(List needInsert){ + List> partition = ListUtils.partition(needInsert, NumConstant.ONE_HUNDRED); + partition.forEach(p -> { + orgDailyService.insertBatch(ConvertUtils.sourceToTarget(p, ScreenProjectCategoryOrgDailyEntity.class)); + log.info("插入的组织项目分类为" + JSON.toJSONString(p)); + }); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectCategoryOrgDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectCategoryOrgDailyServiceImpl.java index edd13b8e7d..1cd79eabd8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectCategoryOrgDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectCategoryOrgDailyServiceImpl.java @@ -32,6 +32,7 @@ import com.epmet.constant.ScreenConstant; import com.epmet.dao.evaluationindex.screen.ScreenProjectCategoryGridDailyDao; import com.epmet.dao.evaluationindex.screen.ScreenProjectCategoryOrgDailyDao; import com.epmet.dto.extract.result.CustomerAgencyInfoResultDTO; +import com.epmet.dto.project.result.ClosedProjectTotalResultDTO; import com.epmet.dto.screen.ScreenCustomerGridDTO; import com.epmet.dto.screen.ScreenProjectCategoryGridDailyDTO; import com.epmet.dto.screen.ScreenProjectCategoryOrgDailyDTO; @@ -264,6 +265,7 @@ public class ScreenProjectCategoryOrgDailyServiceImpl extends BaseServiceImpl { if (agency.getOrgId().equals(grid.getOrgId()) && agency.getCategoryCode().equals(grid.getCategoryCode())){ agency.setProjectTotal(agency.getProjectTotal() + grid.getProjectTotal()); + agency.setClosedProjectTotal(agency.getClosedProjectTotal() + grid.getClosedProjectTotal()); grid.setStatus(true); } }); @@ -280,7 +282,11 @@ public class ScreenProjectCategoryOrgDailyServiceImpl extends BaseServiceImpl levelAgencyInfo = groupByLevel.get(level); if (!CollectionUtils.isEmpty(levelAgencyInfo)){ - List screenProjectCategory = factOriginProjectCategoryDailyService.selectListProjectCategoryByOrg(orgIds,customerId,NumConstant.FOUR); + List screenProjectCategory = factOriginProjectCategoryDailyService.selectListProjectCategoryByOrg(orgIds,customerId,NumConstant.FOUR,"all"); + List closedScreenProjectCategory = factOriginProjectCategoryDailyService.selectListProjectCategoryByOrg(orgIds,customerId,NumConstant.FOUR,"closed"); + if (!CollectionUtils.isEmpty(closedScreenProjectCategory)){ + screenProjectCategory.forEach(l -> closedScreenProjectCategory.stream().filter(c -> l.getGridId().equals(c.getGridId()) && l.getCategoryCode().equals(c.getCategoryCode())).forEach(c -> l.setClosedProjectTotal(c.getClosedProjectTotal()))); + } if (!CollectionUtils.isEmpty(result)){ if (!CollectionUtils.isEmpty(screenProjectCategory)){ result.forEach(r -> { @@ -288,6 +294,7 @@ public class ScreenProjectCategoryOrgDailyServiceImpl extends BaseServiceImpl sonCustomerList = new ArrayList<>(); // 父客户存在的分类 - List categoryProjectExists = baseDao.selectOrgCategoryMoreCustomerInfo(customerIds, dateId, level, customerId, true); + List categoryProjectExists = baseDao.selectOrgCategoryMoreCustomerInfo(customerIds, dateId, level, customerId); log.info("父客户存在的分类{}"+ JSON.toJSONString(categoryProjectExists)); + // 父客户存在的分类 已结案的项目数 + List closedProjectTotalExist = baseDao.selectClosedProjectTotal(customerIds, dateId, true); // 父客户不存在的分类 - List categoryProjectNotExists = baseDao.selectOrgCategoryMoreCustomerInfo(customerIds, dateId, level, customerId, false); + List categoryProjectNotExists = baseDao.selectOrgCategoryMoreCustomerInfoNotExists(customerIds, dateId, level, customerId); log.info("父客户不存在的分类{}"+ JSON.toJSONString(categoryProjectNotExists)); + // 父客户 不存在 的分类 已结案的项目数 + List closedProjectTotalNotExist = baseDao.selectClosedProjectTotal(customerIds, dateId, false); if (!CollectionUtils.isEmpty(categoryProjectExists)){ + if (!CollectionUtils.isEmpty(closedProjectTotalExist)){ + categoryProjectExists.forEach(l -> closedProjectTotalExist.stream().filter(c -> l.getOrgId().equals(c.getOrgId()) && l.getCategoryCode().equals(c.getCategoryCode())).forEach(c -> l.setClosedProjectTotal(c.getClosedProjectTotal()))); + } sonCustomerList.addAll(categoryProjectExists); } if (!CollectionUtils.isEmpty(categoryProjectNotExists)){ + if (!CollectionUtils.isEmpty(closedProjectTotalNotExist)){ + categoryProjectNotExists.forEach(l -> closedProjectTotalNotExist.stream().filter(c -> l.getOrgId().equals(c.getOrgId()) && l.getCategoryCode().equals(c.getCategoryCode())).forEach(c -> l.setClosedProjectTotal(c.getClosedProjectTotal()))); + } sonCustomerList.addAll(categoryProjectNotExists); } if (!CollectionUtils.isEmpty(sonCustomerList)){ @@ -443,6 +461,7 @@ public class ScreenProjectCategoryOrgDailyServiceImpl extends BaseServiceImpl { if (f.getCategoryCode().equals(c.getCategoryCode())){ f.setProjectTotal(f.getProjectTotal() + c.getProjectTotal()); + f.setClosedProjectTotal(f.getClosedProjectTotal() + c.getClosedProjectTotal()); c.setStatus(true); } }); @@ -481,6 +500,7 @@ public class ScreenProjectCategoryOrgDailyServiceImpl extends BaseServiceImpl levelAgencyInfo = groupByLevel.get(level); if (!CollectionUtils.isEmpty(levelAgencyInfo)) { // 查询客户下,组织直接立项的,各项目分类下的项目数量【筛选组织创建的项目,fact_origin_project_main_daily表gridId为空】 - List screenProjectCategory = factOriginProjectCategoryDailyService.selectListProjectCategoryByOrg(orgIds, customerId,NumConstant.TWO); + List screenProjectCategory = factOriginProjectCategoryDailyService.selectListProjectCategoryByOrg(orgIds, customerId,NumConstant.TWO,"all"); + List closedScreenProjectCategory = factOriginProjectCategoryDailyService.selectListProjectCategoryByOrg(orgIds, customerId,NumConstant.TWO,"closed"); + if (!CollectionUtils.isEmpty(closedScreenProjectCategory)){ + screenProjectCategory.forEach(l -> closedScreenProjectCategory.stream().filter(c -> l.getGridId().equals(c.getGridId()) && l.getCategoryCode().equals(c.getCategoryCode())).forEach(c -> l.setClosedProjectTotal(c.getClosedProjectTotal()))); + } log.info("直接立项的统计:"+screenProjectCategory); if (!CollectionUtils.isEmpty(result)) { if (!CollectionUtils.isEmpty(screenProjectCategory)) { @@ -505,6 +529,7 @@ public class ScreenProjectCategoryOrgDailyServiceImpl extends BaseServiceImpl + * 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.service.evaluationindex.screen.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.evaluationindex.screen.ScreenProjectCategoryDao; +import com.epmet.dto.screen.ScreenProjectCategoryDTO; +import com.epmet.entity.evaluationindex.screen.ScreenProjectCategoryEntity; +import com.epmet.service.evaluationindex.screen.ScreenProjectCategoryService; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 项目所属分类表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-10 + */ +@Service +public class ScreenProjectCategoryServiceImpl extends BaseServiceImpl implements ScreenProjectCategoryService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ScreenProjectCategoryDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ScreenProjectCategoryDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public ScreenProjectCategoryDTO get(String id) { + ScreenProjectCategoryEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ScreenProjectCategoryDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ScreenProjectCategoryDTO dto) { + ScreenProjectCategoryEntity entity = ConvertUtils.sourceToTarget(dto, ScreenProjectCategoryEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ScreenProjectCategoryDTO dto) { + ScreenProjectCategoryEntity entity = ConvertUtils.sourceToTarget(dto, ScreenProjectCategoryEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * 删除项目分类 + * + * @param customerId + * @param projectIds + * @Param customerId + * @Param projectIds + * @Return + * @Author zhaoqifeng + * @Date 2021/11/10 11:06 + */ + @Override + public void deleteByProjectId(String customerId, List projectIds) { + if (CollectionUtils.isEmpty(projectIds)) { + return; + } + baseDao.deleteByProjectIds(customerId, projectIds); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectDataServiceImpl.java index 5e14db736e..df52b23ee8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectDataServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectDataServiceImpl.java @@ -17,37 +17,48 @@ package com.epmet.service.evaluationindex.screen.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.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.rocketmq.messages.DisputeProcessMQMsg; 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.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; import com.epmet.constant.DataSourceConstant; -import com.epmet.dao.evaluationindex.screen.*; +import com.epmet.dao.evaluationindex.screen.ScreenProjectDataDao; +import com.epmet.dao.evaluationindex.screen.ScreenProjectImgDataDao; import com.epmet.dto.screen.ScreenProjectDataDTO; +import com.epmet.dto.screen.ScreenProjectImgDataDTO; import com.epmet.dto.screen.form.ScreenProjectDataInfoFormDTO; import com.epmet.dto.screencoll.ScreenCollFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenProjectCategoryEntity; import com.epmet.entity.evaluationindex.screen.ScreenProjectDataEntity; -import com.epmet.entity.evaluationindex.screen.ScreenProjectImgDataEntity; +import com.epmet.entity.stats.CustomerProjectCategoryDictEntity; +import com.epmet.feign.EpmetMessageOpenFeignClient; +import com.epmet.feign.OperCrmOpenFeignClient; +import com.epmet.send.SendMqMsgUtil; +import com.epmet.service.evaluationindex.screen.ScreenCustomerAgencyService; +import com.epmet.service.evaluationindex.screen.ScreenProjectCategoryService; import com.epmet.service.evaluationindex.screen.ScreenProjectDataService; +import com.epmet.service.stats.CustomerProjectCategoryDictService; +import com.github.pagehelper.PageHelper; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.ListUtils; import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import org.springframework.util.CollectionUtils; import javax.annotation.Resource; import java.math.BigDecimal; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Arrays; -import java.util.Date; -import java.util.List; -import java.util.Map; +import java.util.*; +import java.util.stream.Collectors; /** * 中央区-项目数据 @@ -55,12 +66,23 @@ import java.util.Map; * @author qu qu@elink-cn.com * @since v1.0.0 2021-02-23 */ +@Slf4j @Service @DataSource(value = DataSourceConstant.EVALUATION_INDEX) public class ScreenProjectDataServiceImpl extends BaseServiceImpl implements ScreenProjectDataService { @Resource private ScreenProjectImgDataDao screenProjectImgDataDao; + @Resource + private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; + @Resource + private ScreenProjectCategoryService screenProjectCategoryService; + @Resource + private CustomerProjectCategoryDictService customerProjectCategoryDictService; + @Resource + private OperCrmOpenFeignClient operCrmOpenFeignClient; + @Resource + private ScreenCustomerAgencyService screenCustomerAgencyService; @Override public PageData page(Map params) { @@ -115,99 +137,84 @@ public class ScreenProjectDataServiceImpl extends BaseServiceImpl param) { - /*if (param.getIsFirst()) { - int affectedRows = baseDao.deleteByDateIdAndCustomerId(param.getCustomerId(), param.getDateId()); - while (affectedRows > 0) { - affectedRows = baseDao.deleteByDateIdAndCustomerId(param.getCustomerId(), param.getDateId()); - } - }*/ - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - Date today = new Date(); param.getDataList().forEach(item -> { String projectStatusCode = item.getProjectStatusCode(); //2021.3.8 epmet中,调用方传level,这边不再计算 - if(item.getProjectLevel() == null){ - //todo 动态获取超时时间 - //如果结案 结案时间立项时间; - if ("closed_case".equals(projectStatusCode)) { - try { - Date createTime = item.getProjectCreateTime(); - Date closeCaseTime = sdf.parse(item.getCloseCaseTime()); - - if (closeCaseTime.getTime() - createTime.getTime() <= 1000 * 60 * 60 * 24 * 4) { - //如果结案时间-立项时间小于等于4天 未超期 level3 - item.setProjectLevel(3); - } else if (closeCaseTime.getTime() - createTime.getTime() <= 1000 * 60 * 60 * 24 * 5) { - //如果结案时间-立项时间大于4天小于5天 即将超期 level2 - item.setProjectLevel(2); - } else { - //大于5天 已超期 level1 - item.setProjectLevel(1); - } - } catch (ParseException e) { - e.printStackTrace(); - } - } else if ("pending".equals(projectStatusCode)) { - //如果处理中 当前时间-立项时间; - Date createTime = item.getProjectCreateTime(); - - if (today.getTime() - createTime.getTime() <= 1000 * 60 * 60 * 24 * 4) { - //如果当前时间-立项时间小于等于4天 未超期 level3 - item.setProjectLevel(3); - } else if (today.getTime() - createTime.getTime() <= 1000 * 60 * 60 * 24 * 5) { - //如果当前时间-立项时间大于4天小于5天 即将超期 level2 - item.setProjectLevel(2); - } else { - //大于5天 已超期 level1 - item.setProjectLevel(1); - } - } - } - //先删除该projectId对应的旧数据 - baseDao.deleteByProjectId(param.getCustomerId(), item.getProjectId()); - screenProjectImgDataDao.deleteByProjectId(param.getCustomerId(), item.getProjectId()); - - //如果orgType未知,获取一下 -// if ("unknown".equals(item.getOrgType())){ -// ScreenCustomerAgencyEntity screenCustomerAgencyEntity = agencyDao.selectById(item.getOrgId()); -// if (screenCustomerAgencyEntity != null){ -// item.setOrgType("agency"); -// }else { -// ScreenCustomerDeptEntity screenCustomerDeptEntity = deptDao.selectById(item.getOrgId()); -// if (screenCustomerDeptEntity!=null){ -// item.setOrgType("department"); -// }else { -// ScreenCustomerGridEntity screenCustomerGridEntity = gridDao.selectById(item.getOrgId()); -// if (screenCustomerGridEntity != null){ -// item.setOrgType("grid"); -// } -// } -// } -// } + setLevelByCreateTime(item, projectStatusCode); //插入项目表 ScreenProjectDataEntity screenProjectDataEntity = ConvertUtils.sourceToTarget(item, ScreenProjectDataEntity.class); screenProjectDataEntity.setCustomerId(param.getCustomerId()); screenProjectDataEntity.setDataEndTime(param.getDateId()); - baseDao.insert(screenProjectDataEntity); - //插入图片表 - String[] projectImgUrl = item.getProjectImgUrl(); - if (ArrayUtils.isNotEmpty(projectImgUrl)) { - for (int i = 0; i < projectImgUrl.length; i++) { - ScreenProjectImgDataEntity screenProjectImgDataEntity = new ScreenProjectImgDataEntity(); - screenProjectImgDataEntity.setCustomerId(param.getCustomerId()); - screenProjectImgDataEntity.setProjectId(item.getProjectId()); - screenProjectImgDataEntity.setProjectImgUrl(projectImgUrl[i]); - screenProjectImgDataEntity.setSort(i); - screenProjectImgDataDao.insert(screenProjectImgDataEntity); - } + String agencyId = screenCustomerAgencyService.getParentAgencyId(screenProjectDataEntity.getAllParentIds().split(StrConstant.COMMA)[0]); + if(StringUtils.isNotBlank(agencyId)) { + screenProjectDataEntity.setAllParentIds(agencyId.concat(StrConstant.COMMA).concat(screenProjectDataEntity.getAllParentIds())); } + //删除 并插入新的项目数据 + delAndInsertProjectData(param, item, screenProjectDataEntity); }); } + @Transactional(rollbackFor = Exception.class) + public void delAndInsertProjectData(ScreenCollFormDTO param, ScreenProjectDataInfoFormDTO item, ScreenProjectDataEntity screenProjectDataEntity) { + //先删除该projectId对应的旧数据 + baseDao.deleteByProjectId(param.getCustomerId(), item.getProjectId()); + screenProjectImgDataDao.deleteByProjectId(param.getCustomerId(), item.getProjectId()); + baseDao.insert(screenProjectDataEntity); + saveCategory(param.getCustomerId(), Collections.singletonList(screenProjectDataEntity)); + //插入该项目图片表 + String[] projectImgUrl = item.getProjectImgUrl(); + if (ArrayUtils.isNotEmpty(projectImgUrl)) { + List imgList = new ArrayList<>(); + for (int i = 0; i < projectImgUrl.length; i++) { + ScreenProjectImgDataDTO screenProjectImgDataEntity = new ScreenProjectImgDataDTO(); + screenProjectImgDataEntity.setCustomerId(param.getCustomerId()); + screenProjectImgDataEntity.setProjectId(item.getProjectId()); + screenProjectImgDataEntity.setProjectImgUrl(projectImgUrl[i]); + screenProjectImgDataEntity.setSort(i); + imgList.add(screenProjectImgDataEntity); + } + screenProjectImgDataDao.insertBatch(imgList); + } + } + + private void setLevelByCreateTime(ScreenProjectDataInfoFormDTO item, String projectStatusCode) { + if(item.getProjectLevel() == null){ + //todo 动态获取超时时间 + //如果结案 结案时间立项时间; + if ("closed_case".equals(projectStatusCode)) { + Date createTime = item.getProjectCreateTime(); + Date closeCaseTime = item.getCloseCaseTime(); + + if (closeCaseTime.getTime() - createTime.getTime() <= 1000 * 60 * 60 * 24 * 4L) { + //如果结案时间-立项时间小于等于4天 未超期 level3 + item.setProjectLevel(3); + } else if (closeCaseTime.getTime() - createTime.getTime() <= 1000 * 60 * 60 * 24 * 5L) { + //如果结案时间-立项时间大于4天小于5天 即将超期 level2 + item.setProjectLevel(2); + } else { + //大于5天 已超期 level1 + item.setProjectLevel(1); + } + } else if ("pending".equals(projectStatusCode)) { + //如果处理中 当前时间-立项时间; + Date createTime = item.getProjectCreateTime(); + Date today = new Date(); + if (today.getTime() - createTime.getTime() <= 1000 * 60 * 60 * 24 * 4L) { + //如果当前时间-立项时间小于等于4天 未超期 level3 + item.setProjectLevel(3); + } else if (today.getTime() - createTime.getTime() <= 1000 * 60 * 60 * 24 * 5L) { + //如果当前时间-立项时间大于4天小于5天 即将超期 level2 + item.setProjectLevel(2); + } else { + //大于5天 已超期 level1 + item.setProjectLevel(1); + } + } + } + } /** @@ -253,20 +260,30 @@ public class ScreenProjectDataServiceImpl extends BaseServiceImpl 0) { + while (affectedRows > NumConstant.ZERO) { affectedRows = baseDao.deleteByProjectTimeAndCustomerId(customerId, dateId); } List> partition = ListUtils.partition(meta, NumConstant.ONE_HUNDRED); partition.forEach(part -> { List list = ConvertUtils.sourceToTarget(part, ScreenProjectDataEntity.class); + // 把来源网格的,已结案的项目,满意度分默认设置80 + list.forEach(l -> { + if (l.getOrgType().equals("grid") && l.getProjectStatusCode().equals("closed_case")){ + l.setSatisfactionScore(new BigDecimal(NumConstant.EIGHTY)); + } + }); insertBatch(list); + saveCategory(customerId, list); }); } if(!CollectionUtils.isEmpty(orient)){ List> partition = ListUtils.partition(orient, NumConstant.ONE_HUNDRED); - partition.forEach(part -> baseDao.updateBatch(part,dateId)); + partition.forEach(part -> { + baseDao.updateBatch(part,dateId); + saveCategory(customerId, ConvertUtils.sourceToTarget(part, ScreenProjectDataEntity.class)); + }); } } @@ -275,4 +292,102 @@ public class ScreenProjectDataServiceImpl extends BaseServiceImpl} + * @Author zhaoqifeng + * @Date 2021/10/15 14:22 + */ + @Override + public List getProjectList(String customerId, List projectId, Integer pageNo, Integer pageSize) { + PageHelper.startPage(pageNo, pageSize); + return baseDao.selectProjectList(customerId, projectId); + } + + /** + * @Description 项目变更MQ + * @Param msg + * @Return + * @Author zhaoqifeng + * @Date 2021/10/18 14:00 + */ + @Override + public void sendProjectChangeMq(DisputeProcessMQMsg msg) { + SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendProjectMqMsg(msg); + } + + /** + * @param customerId + * @Description 提取项目分类 + * @Param customerId + * @Return + * @Author zhaoqifeng + * @Date 2021/11/10 10:24 + */ + @Override + public void extractCategory(String customerId) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(customerId), ScreenProjectDataEntity::getCustomerId, customerId); + List projectList = baseDao.selectList(wrapper); + saveCategory(customerId, projectList); + } + + private void saveCategory(String customerId, List projectList) { + + Result parentCustomer = operCrmOpenFeignClient.getExternalAndParentCustomerId(customerId); + //删除旧分类 + List projectIds = projectList.stream().map(ScreenProjectDataEntity::getProjectId).collect(Collectors.toList()); + screenProjectCategoryService.deleteByProjectId(customerId, projectIds); + //提取分类信息 + List projectCategoryList = new ArrayList<>(); + projectList.forEach(project -> { + //分类为空不作处理 + if (StringUtils.isBlank(project.getCategoryCode())) { + return; + } + + List categoryList = Arrays.asList(project.getCategoryCode().split(StrConstant.COMMA)); + categoryList.forEach(category -> { + ScreenProjectCategoryEntity entity = new ScreenProjectCategoryEntity(); + entity.setCustomerId(customerId); + entity.setProjectId(project.getProjectId()); + entity.setOriginCategoryCode(category); + CustomerProjectCategoryDictEntity categoryEntity = customerProjectCategoryDictService.getByCategoryCode(customerId, category); + if (null == categoryEntity) { + log.error("customerId:{} categoryCode:{} is not exist in ProjectCategoryDict", customerId, category); + return; + } + if ("external".equals(categoryEntity.getCustomerType())) { + entity.setCategoryCode(categoryEntity.getEpmetCategoryCode()); + CustomerProjectCategoryDictEntity parent = customerProjectCategoryDictService.getByCategoryCode(parentCustomer.getData(), categoryEntity.getEpmetCategoryCode()); + if (null != parent) { + entity.setParentCategoryCode(parent.getParentCategoryCode()); + entity.setLevel(parent.getLevel()); + } else { + log.error("未找到对应分类"); + } + } else { + entity.setCategoryCode(categoryEntity.getCategoryCode()); + entity.setParentCategoryCode(categoryEntity.getParentCategoryCode()); + entity.setLevel(categoryEntity.getLevel()); + } + projectCategoryList.add(entity); + //如果分类数据已经超过100了 就插入一批 + if (projectCategoryList.size() > NumConstant.ONE_HUNDRED){ + screenProjectCategoryService.insertBatch(projectCategoryList); + projectCategoryList.clear(); + } + }); + }); + //如果不为空 则插入剩余的那一部分 + if (projectCategoryList.size() > NumConstant.ZERO){ + screenProjectCategoryService.insertBatch(projectCategoryList); + } + } + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectOrgDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectOrgDailyServiceImpl.java index 9fbca67078..ec0377ab83 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectOrgDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectOrgDailyServiceImpl.java @@ -195,7 +195,7 @@ public class ScreenProjectOrgDailyServiceImpl extends BaseServiceImpl { a.setDateId(dateId); projectOrgDaily.forEach(p -> { - if (a.getAreaCode().equals(p.getAreaCode())){ + if (a.getOrgId().equals(p.getOrgId())){ a.setBadTotal(p.getBadTotal() + a.getBadTotal()); a.setEvaluateTotal(p.getEvaluateTotal() + a.getEvaluateTotal()); a.setGoodTotal(p.getGoodTotal() + a.getGoodTotal()); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ShiBeiScreenCollServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ShiBeiScreenCollServiceImpl.java index 4f0cbb1896..02e4df412b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ShiBeiScreenCollServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ShiBeiScreenCollServiceImpl.java @@ -462,7 +462,6 @@ public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService { int month = calendar.get(Calendar.MONTH) + NumConstant.ONE; date[NumConstant.ZERO] = String.valueOf(year); date[NumConstant.ONE] = String.valueOf(month); - ; if (NumConstant.TEN >= month) { date[NumConstant.ONE] = NumConstant.ZERO_STR + month; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/HeartDemandService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/HeartDemandService.java new file mode 100644 index 0000000000..baaa29c97b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/HeartDemandService.java @@ -0,0 +1,15 @@ +package com.epmet.service.heart; + +import com.epmet.dto.heart.result.DemandServiceCountResultDTO; + +import java.util.Date; +import java.util.List; + +/** + *@Description 爱心互助,需求service + *@Author wangxianzhang + *@Date 2021/12/8 + */ +public interface HeartDemandService { + List listDemandServeTimesPage(String customerId, Date endTime, int serviceCountPageNo, int serviceCountPageSize); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/HeartVolunteerService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/HeartVolunteerService.java new file mode 100644 index 0000000000..b8e4414f60 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/HeartVolunteerService.java @@ -0,0 +1,15 @@ +package com.epmet.service.heart; + +import com.epmet.entity.heart.VolunteerInfoEntity; + +import java.util.Date; +import java.util.List; + +/** + *@Description heart 志愿者service + *@Author wangxianzhang + *@Date 2021/12/8 + */ +public interface HeartVolunteerService { + List listVolunteers(String customerId, Date endCreateTime); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/HeartDemandServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/HeartDemandServiceImpl.java new file mode 100644 index 0000000000..c33f426ad5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/HeartDemandServiceImpl.java @@ -0,0 +1,40 @@ +package com.epmet.service.heart.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.heart.IcUserDemandServiceDao; +import com.epmet.dto.heart.result.DemandServiceCountResultDTO; +import com.epmet.service.heart.HeartDemandService; +import com.github.pagehelper.ISelect; +import com.github.pagehelper.Page; +import com.github.pagehelper.PageHelper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.List; + +/** + * @Description 爱心互助,需求service + * @Author wangxianzhang + * @Date 2021/12/8 12:33 下午 + * @Version 1.0 + */ +@Service +@DataSource(DataSourceConstant.EPMET_HEART) +public class HeartDemandServiceImpl implements HeartDemandService { + + @Autowired + private IcUserDemandServiceDao demandServiceDao; + + @Override + public List listDemandServeTimesPage(String customerId, Date endTime, int serviceCountPageNo, int serviceCountPageSize) { + return PageHelper.startPage(serviceCountPageNo, serviceCountPageSize).doSelectPage(new ISelect() { + @Override + public void doSelect() { + demandServiceDao.listDemandServeTimes(customerId, endTime, "volunteer"); + } + }); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/HeartVolunteerServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/HeartVolunteerServiceImpl.java new file mode 100644 index 0000000000..902a6a8713 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/HeartVolunteerServiceImpl.java @@ -0,0 +1,38 @@ +package com.epmet.service.heart.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.heart.VolunteerInfoDao; +import com.epmet.entity.heart.VolunteerInfoEntity; +import com.epmet.service.heart.HeartVolunteerService; +import com.github.pagehelper.ISelect; +import com.github.pagehelper.Page; +import com.github.pagehelper.PageHelper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.List; + +/** + * @Description 描述 + * @Author wangxianzhang + * @Date 2021/12/8 1:35 下午 + * @Version 1.0 + */ +@Service +@DataSource(DataSourceConstant.EPMET_HEART) +public class HeartVolunteerServiceImpl implements HeartVolunteerService { + + @Autowired + private VolunteerInfoDao volunteerInfoDao; + + @Override + public List listVolunteers(String customerId, Date endCreateTime) { + LambdaQueryWrapper query = new LambdaQueryWrapper<>(); + query.eq(VolunteerInfoEntity::getCustomerId, customerId); + query.lt(VolunteerInfoEntity::getCreatedTime, endCreateTime); + return volunteerInfoDao.selectList(query); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/BaseReportServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/BaseReportServiceImpl.java index b00c8cace6..1f8fdf806c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/BaseReportServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/BaseReportServiceImpl.java @@ -1,7 +1,6 @@ package com.epmet.service.impl; import com.epmet.commons.tools.constant.NumConstant; -import com.epmet.constant.BaseReportConstant; import com.epmet.dao.stats.BaseReportDao; import com.epmet.dto.basereport.form.*; import com.epmet.service.BaseReportService; @@ -60,7 +59,8 @@ public class BaseReportServiceImpl implements BaseReportService { } while (deleteNum > NumConstant.ZERO); } if (!CollectionUtils.isEmpty(formDTO.getDataList())) { - baseReportDao.insertBatchAgencyRegUser(formDTO.getDataList()); + ListUtils.partition(formDTO.getDataList(),NumConstant.ONE_HUNDRED) + .forEach(part->baseReportDao.insertBatchAgencyRegUser(part)); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/DataReportingServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/DataReportingServiceImpl.java new file mode 100644 index 0000000000..82d1a4a0e0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/DataReportingServiceImpl.java @@ -0,0 +1,330 @@ +package com.epmet.service.impl; + +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.constant.OrgTypeConstant; +import com.epmet.constant.ProjectConstant; +import com.epmet.dto.basereport.form.EventInfoFormDTO; +import com.epmet.dto.basereport.result.EventInfoResultDTO; +import com.epmet.dto.org.form.GridBaseInfoFormDTO; +import com.epmet.dto.org.result.CustomerAgencyDTO; +import com.epmet.dto.org.result.CustomerGridDTO; +import com.epmet.dto.screen.ScreenCustomerGridDTO; +import com.epmet.dto.screen.ScreenProjectDataDTO; +import com.epmet.dto.user.form.StaffBaseInfoFormDTO; +import com.epmet.dto.user.param.MidPatrolFormDTO; +import com.epmet.dto.user.result.CustomerStaffDTO; +import com.epmet.dto.user.result.GridUserInfoDTO; +import com.epmet.dto.user.result.MidPatrolDetailResult; +import com.epmet.dto.user.result.MidPatrolRecordResult; +import com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity; +import com.epmet.entity.stats.CustomerProjectCategoryDictEntity; +import com.epmet.feign.OperCrmOpenFeignClient; +import com.epmet.service.DataReportingService; +import com.epmet.service.evaluationindex.screen.ScreenCustomerAgencyService; +import com.epmet.service.evaluationindex.screen.ScreenCustomerGridService; +import com.epmet.service.evaluationindex.screen.ScreenProjectDataService; +import com.epmet.service.org.CustomerAgencyService; +import com.epmet.service.org.CustomerGridService; +import com.epmet.service.stats.CustomerProjectCategoryDictService; +import com.epmet.service.user.StatsStaffPatrolService; +import com.epmet.service.user.UserService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.*; +import java.util.stream.Collectors; + +import static java.util.stream.Collectors.collectingAndThen; +import static java.util.stream.Collectors.toCollection; + +/** + * @dscription 省网格化平台数据上报--数据查询 + * @author sun + */ +@Slf4j +@Service +public class DataReportingServiceImpl implements DataReportingService { + @Autowired + private CustomerAgencyService customerAgencyService; + @Autowired + private CustomerGridService customerGridService; + @Autowired + private UserService userService; + @Resource + private ScreenProjectDataService screenProjectDataService; + @Resource + private ScreenCustomerAgencyService screenCustomerAgencyService; + @Resource + private ScreenCustomerGridService screenCustomerGridService; + @Autowired + private StatsStaffPatrolService statsStaffPatrolService; + @Resource + private CustomerProjectCategoryDictService customerProjectCategoryDictService; + @Resource + private OperCrmOpenFeignClient operCrmOpenFeignClient; + + /** + * @Author sun + * @Description 批量查询客户组织基础信息 + **/ + @Override + public List getAgencyBaseInfo(GridBaseInfoFormDTO formDTO) { + //批量查询客户组织信息 + List resultList = customerAgencyService.getAgencyBaseInfo(formDTO); + return resultList; + } + + /** + * @Author sun + * @Description 批量查询客户网格基础信息 + **/ + @Override + public List getGridBaseInfo(GridBaseInfoFormDTO formDTO) { + //批量查询客户网格信息 + List resultList = customerGridService.getGridBaseInfo(formDTO); + return resultList; + } + + /** + * @Author sun + * @Description 批量查询客户网格员基础信息 + **/ + @Override + public List getStaffBaseInfo(StaffBaseInfoFormDTO formDTO) { + //1.查询工作人员所属网格信息 + List resultList = customerGridService.getStaffGrid(formDTO); + + //2.查询工作人员基础信息 + List staffDTOList = userService.getStaffBaseInfo(formDTO); + if (CollectionUtils.isEmpty(staffDTOList)) { + return new ArrayList<>(); + } + Map staffMap = new HashMap<>(); + staffDTOList.forEach(staff -> staffMap.put(staff.getUserId(), staff)); + + //3.封装数据 + resultList.forEach(st -> { + if (staffMap.containsKey(st.getStaffId())) { + CustomerStaffDTO dto = staffMap.get(st.getStaffId()); + st.setNickName(dto.getRealName()); + st.setCardNum("01"); + st.setUserType(dto.getWorkType().equals("fulltime") ? "01" : "02"); + st.setPhonenumber(dto.getMobile()); + st.setSex(0 == dto.getGender() ? "9" : dto.getGender().toString()); + } + }); + + return resultList; + } + + /** + * 事件上报 + * + * @param formDTO + * @Param formDTO + * @Return {@link List} + * @Author zhaoqifeng + * @Date 2021/10/15 14:10 + */ + @Override + public List getEventInfo(EventInfoFormDTO formDTO) { + List list; + //根据入参,获取项目 + List projectList = screenProjectDataService.getProjectList(formDTO.getCustomerId(), formDTO.getProjectId(), formDTO.getPageNo(), formDTO.getPageSize()); + //项目列表为空,返回空数组 + if(CollectionUtils.isEmpty(projectList)) { + return Collections.emptyList(); + } + Map epmetCodeMap = new HashMap<>(); + Result parentCustomer = operCrmOpenFeignClient.getExternalAndParentCustomerId(formDTO.getCustomerId()); + if (StringUtils.isNotBlank(parentCustomer.getData())) { + epmetCodeMap = customerProjectCategoryDictService.getByCategoryCodeMap(parentCustomer.getData()); + } + Map codeMap = customerProjectCategoryDictService.getByCategoryCodeMap(formDTO.getCustomerId()); + //项目ID不为空时,因为只有一条,可以直接处理 + Map finalEpmetCodeMap = epmetCodeMap; + if (CollectionUtils.isNotEmpty(formDTO.getProjectId())) { + list = projectList.stream().map(project -> { + EventInfoResultDTO dto = getEventInfoResultDTO(project, finalEpmetCodeMap, codeMap); + if (OrgTypeConstant.AGENCY.equals(project.getOrgType())) { + ScreenCustomerAgencyEntity agency = screenCustomerAgencyService.getAgencyById(project.getOrgId()); + dto.setOrgId(project.getOrgId()); + if (null != agency) { + dto.setOrgCode(agency.getCode()); + dto.setOrgName(agency.getAgencyName()); + } + } else { + ScreenCustomerGridDTO grid = screenCustomerGridService.getGridById(project.getOrgId()); + dto.setOrgId(project.getOrgId()); + if (null != grid) { + dto.setOrgCode(grid.getCode()); + dto.setOrgName(grid.getGridName()); + } + } + return dto; + }).collect(Collectors.toList()); + } else { + //项目ID不为空时,提前取出客户下的组织和网格 + Map agencyMap = screenCustomerAgencyService.getAgencyList(formDTO.getCustomerId()); + Map gridMap = screenCustomerGridService.getGridList(formDTO.getCustomerId()); + list = projectList.stream().map(project -> { + EventInfoResultDTO dto = getEventInfoResultDTO(project, finalEpmetCodeMap, codeMap); + if (OrgTypeConstant.AGENCY.equals(project.getOrgType())) { + ScreenCustomerAgencyEntity agency = agencyMap.get(project.getOrgId()); + dto.setOrgId(project.getOrgId()); + if (null != agency) { + dto.setOrgCode(agency.getCode()); + dto.setOrgName(agency.getAgencyName()); + } + } else { + ScreenCustomerGridDTO grid = gridMap.get(project.getOrgId()); + dto.setOrgId(project.getOrgId()); + if (null != grid) { + dto.setOrgCode(grid.getCode()); + dto.setOrgName(grid.getGridName()); + } + } + return dto; + }).collect(Collectors.toList()); + } + return list.stream().collect(collectingAndThen(toCollection(() -> new TreeSet<>(Comparator.comparing(EventInfoResultDTO::getId))), ArrayList::new)); + } + + private EventInfoResultDTO getEventInfoResultDTO(ScreenProjectDataDTO project, Map epmetCodeMap, Map codeMap) { + EventInfoResultDTO dto = new EventInfoResultDTO(); + dto.setId(project.getProjectId()); + dto.setCustomerId(project.getCustomerId()); + dto.setEventName(project.getProjectTitle()); + dto.setReporterId(project.getProjectCreator()); + String categoryCode = project.getCategoryCode().split(StrConstant.COMMA)[0]; + String parentCode = null == codeMap.get(categoryCode)?null:codeMap.get(categoryCode).getParentCategoryCode(); + //如果是孔村、榆山、锦水的项目需要关联分类字典表 + if("2fe0065f70ca0e23ce4c26fca5f1d933".equals(project.getCustomerId()) || + "44876154d10d7cb7affd92000f84f833".equals(project.getCustomerId()) || + "46c55cb862d6d5e6d05d2ab61a1cc07e".equals(project.getCustomerId())) { + CustomerProjectCategoryDictEntity categoryEntity = codeMap.get(categoryCode); + if (null != categoryEntity) { + String code = categoryEntity.getEpmetCategoryCode(); + if (StringUtils.isBlank(code)) { + //没有对应平阴的分类code,那么一级分类和二级分类都为空 + categoryCode = null; + parentCode = null; + } else { + //如果是对应一级分类,则二级分类为空。如果对应平阴二级分类,则取对应的一级分类 + CustomerProjectCategoryDictEntity epmetCode = epmetCodeMap.get(code); + if (NumConstant.ONE == epmetCode.getLevel()) { + parentCode = code; + //如果项目为一级分类 则二级分类默认给第一个 + epmetCode = epmetCodeMap.get(code.concat("01")); + if (epmetCode == null){ + log.warn(" 分类下没有子分类,无法拼接2级分类 code:{}",code); + } else { + categoryCode = epmetCode.getCategoryCode(); + } + } else { + categoryCode = code; + parentCode = epmetCode.getParentCategoryCode(); + } + } + } else { + categoryCode = null; + parentCode = null; + } + } + dto.setEventCategory(categoryCode); + dto.setParentEventCategory(parentCode); + dto.setReportTime(project.getProjectCreateTime()); + dto.setHappenDate(DateUtils.parseDate(DateUtils.format(project.getProjectCreateTime()), DateUtils.DATE_PATTERN)); + dto.setHappenPlace(project.getProjectAddress()); + dto.setEventDescription(project.getProjectContent()); + dto.setSuccessfulOrNo(ProjectConstant.CLOSED_CASE.equals(project.getProjectStatusCode())?"Y":"N"); + if (ProjectConstant.CLOSED_CASE.equals(project.getProjectStatusCode())) { + dto.setWaysOfResolving(project.getOrgId().equals(project.getFinishOrg())?ProjectConstant.PROJECT_SELF_CLOSED:ProjectConstant.PROJECT_REPORT); + //办结组织是机关时,办结层级为机关的层级 + if (OrgTypeConstant.AGENCY.equals(project.getFinishOrgType())) { + //如果是孔村的项目办结层级需要降一级 + if("2fe0065f70ca0e23ce4c26fca5f1d933".equals(project.getCustomerId())) { + if (StringUtils.isNotBlank(project.getFinishOrgLevel())) { + switch (project.getFinishOrgLevel()) { + case OrgTypeConstant.DISTRICT: + dto.setCompleteLevel("3"); + break; + case OrgTypeConstant.STREET: + case OrgTypeConstant.COMMUNITY: + dto.setCompleteLevel("4"); + break; + default: + break; + } + } + } else { + dto.setCompleteLevel(getCompleteLevel(project.getFinishOrgLevel())); + } + } else if (OrgTypeConstant.DEPARTMENT.equals(project.getFinishOrgType())) { + //办结组织是部门时,办结层级为部门所在组织的曾经 + String[] orgIds = project.getOrgIdPath().split(StrConstant.COLON); + int size = orgIds.length; + ScreenCustomerAgencyEntity agency = screenCustomerAgencyService.getAgencyById(orgIds[size - 1]); + if (null != agency) { + dto.setCompleteLevel(getCompleteLevel(agency.getLevel())); + } + } else { + //办结组织是网格时,办结层级为网格 + dto.setCompleteLevel("5"); + } + } + dto.setStatus(getProjectStatus(project.getProjectStatusCode())); + dto.setCompleteTime(project.getCloseCaseTime()); + dto.setLat(project.getLatitude()); + dto.setLng(project.getLongitude()); + return dto; + } + + private String getCompleteLevel(String level) { + switch (level) { + case OrgTypeConstant.PROVINCE: + return "0"; + case OrgTypeConstant.CITY: + return "1"; + case OrgTypeConstant.DISTRICT: + return "2"; + case OrgTypeConstant.STREET: + return "3"; + case OrgTypeConstant.COMMUNITY: + return "4"; + default: + return null; + } + } + + private String getProjectStatus(String status) { + switch (status) { + case ProjectConstant.PENDING: + return "01"; + case ProjectConstant.CLOSED: + return "02"; + case ProjectConstant.CLOSED_CASE: + return "03"; + default: + return null; + } + } + + @Override + public List getPatrolRecordList(MidPatrolFormDTO formDTO) { + return userService.getPatrolRecordList(formDTO); + } + + @Override + public List getPatrolDetailList(MidPatrolFormDTO formDTO) { + return userService.getPatrolDetailList(formDTO); + } + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/DemandServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/DemandServiceImpl.java new file mode 100644 index 0000000000..66cbf1058d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/DemandServiceImpl.java @@ -0,0 +1,176 @@ +package com.epmet.service.impl; + +import com.epmet.commons.tools.constant.EpmetRoleKeyConstant; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.dto.heart.result.DemandServiceCountResultDTO; +import com.epmet.entity.crm.CustomerEntity; +import com.epmet.entity.heart.VolunteerInfoEntity; +import com.epmet.entity.stats.FactVolunteerServiceDailyEntity; +import com.epmet.service.DemandService; +import com.epmet.service.crm.CustomerService; +import com.epmet.service.heart.HeartDemandService; +import com.epmet.service.heart.HeartVolunteerService; +import com.epmet.service.stats.DemandStatsService; +import com.epmet.service.user.UserService; +import com.epmet.util.DimIdGenerator; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * @Description 需求service + * @Author wangxianzhang + * @Date 2021/12/8 12:14 下午 + * @Version 1.0 + */ +@Service +public class DemandServiceImpl implements DemandService { + + @Autowired + private HeartDemandService heartDemandService; + + @Autowired + private HeartVolunteerService heartVolunteerService; + + @Autowired + private UserService userService; + + @Autowired + private DemandStatsService demandStatsService; + + @Autowired + private CustomerService customerService; + + @Override + public void statsVolunteerDemandServicesDaily(String customerId) { + + Date now = new Date(); + Date today = DateUtils.integrate(now, "yyyy-MM-dd"); + Date yestoday = DateUtils.addDateDays(today, -1); + + if (StringUtils.isNotBlank(customerId)) { + // 只计算单个客户 + clearOldDatas(Arrays.asList(customerId), yestoday); + statsVolunteerDemandServicesDaily4Customer(customerId, today, yestoday); + } else { + // 查询所有客户ID + List customerIds = customerService.listValidCustomersByCreateTime(null, null).stream().map(c -> c.getId()).collect(Collectors.toList()); + clearOldDatas(customerIds, yestoday); + customerIds.stream().forEach(cId -> { + statsVolunteerDemandServicesDaily4Customer(cId, today, yestoday); + }); + } + } + + /** + * 清理旧数据 + * @param targetDate 要清理哪天的数据 + * @param customerIds 要清理哪些客户的 + */ + private void clearOldDatas(List customerIds, Date targetDate) { + + String dateDimId = DimIdGenerator.getDateDimId(targetDate); + + demandStatsService.clearVolunteerDemandServiceDailyStats(customerIds, dateDimId); + + } + + /** + * 统计单个客户的志愿者服务情况 + * @param customerId 客户ID + * @param endTime 统计截止时间( partymemberVolunteerUserIds = new ArrayList<>(16); + + List volunteers = heartVolunteerService.listVolunteers(customerId, endTime); + + volunteerTotalCount = volunteers.size(); + + // 分片开始下标 + int shardingStartIndex = 0; + // 分片大小(条数) + int shardingSize = 100; + + // 分片去确定党员身份,防止in条件过大 + while (true) { + int realShardingSize = Math.min(shardingSize, volunteerTotalCount - shardingStartIndex); + + if (realShardingSize <= 0) { + break; + } + + int shardingEndIndex = shardingStartIndex + realShardingSize; + List volunteerUserIds = volunteers.subList(shardingStartIndex, shardingEndIndex) + .stream() + .map((volunteerInfoEntity) -> volunteerInfoEntity.getUserId()) + .collect(Collectors.toList()); + + List tempPartymemberUserIds = userService.filterUserIds(volunteerUserIds, EpmetRoleKeyConstant.PARTYMEMBER); + + partymemberVolunteerUserIds.addAll(tempPartymemberUserIds); + + shardingStartIndex = shardingEndIndex; + } + + partymemberVolunteerCount = partymemberVolunteerUserIds.size(); + resiVolunteerCount = volunteerTotalCount - partymemberVolunteerCount; + + //2. 查询志愿者服务次数 + + // 总服务次数 + int totalDemandServeTimes = 0; + // 党员服务次数 + int partymemberDemandServeTimes = 0; + // 居民服务次数 + int resiDemandServeTimes = 0; + + int serviceCountPageNo = 0; + int serviceCountPageSize = 1000; + while (true) { + + // 取出每一个服务者的服务次数 + List damendServeTimes = heartDemandService.listDemandServeTimesPage(customerId, endTime, serviceCountPageNo, serviceCountPageSize); + + for (DemandServiceCountResultDTO damendServiceTimes : damendServeTimes) { + String serverId = damendServiceTimes.getServerId(); + if (partymemberVolunteerUserIds.contains(serverId)) { + partymemberDemandServeTimes += damendServiceTimes.getServeTimes(); + } else { + resiDemandServeTimes += damendServiceTimes.getServeTimes(); + } + } + + if (damendServeTimes.size() <= serviceCountPageSize) { + break; + } + } + + totalDemandServeTimes = partymemberDemandServeTimes + resiDemandServeTimes; + + // 3.持久化 + FactVolunteerServiceDailyEntity insert = new FactVolunteerServiceDailyEntity(); + insert.setDateId(DimIdGenerator.getDateDimId(belongTime)); + insert.setCustomerId(customerId); + insert.setMonthId(DimIdGenerator.getMonthDimId(belongTime)); + insert.setPartyServiceTotal(partymemberDemandServeTimes); + insert.setServiceTotal(totalDemandServeTimes); + insert.setPartyTotal(partymemberVolunteerCount); + insert.setResiServiceTotal(resiDemandServeTimes); + insert.setResiTotal(resiVolunteerCount); + insert.setVolunteerTotal(volunteerTotalCount); + + demandStatsService.addVolunteerServiceDaily(insert); + } +} 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 2002b545a8..d81f5afb89 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 @@ -106,6 +106,10 @@ public class StatsDimServiceImpl implements StatsDimService { dimGrid.setGridName(updatedGrid.getGridName()); dimGrid.setUpdatedTime(now); dimGrid.setUpdatedBy(RobotConstant.DIMENSION_ROBOT); + dimGrid.setDelFlag(updatedGrid.getDelFlag()); + dimGrid.setAgencyId(updatedGrid.getPid()); + dimGrid.setAreaCode(updatedGrid.getAreaCode()); + dimGrid.setCustomerId(updatedGrid.getCustomerId()); dimGrid.setCode(updatedGrid.getCode()); dimGrids.add(dimGrid); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java index 4c587f9694..47d5045c01 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java @@ -103,14 +103,14 @@ public class StatsIssueServiceImpl implements StatsIssueService { */ private void customerStats(String customerId, Date date) { Date lastDate = DateUtils.getLastDayOfMonth(date); - //机关议题日统计 - saveIssueAgencyDaily(customerId, date); - //机关议题月统计 - saveIssueAgencyMonthly(customerId, lastDate); //网格议题日统计 saveIssueGridDaily(customerId, date); //网格议题月统计 saveIssueGridMonthly(customerId, lastDate); + //机关议题日统计 + saveIssueAgencyDaily(customerId, date); + //机关议题月统计 + saveIssueAgencyMonthly(customerId, lastDate); } @Override diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java index ca28b9fd3e..3b1d1c45c8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java @@ -77,7 +77,6 @@ public class StatsProjectServiceImpl implements StatsProjectService { } //入参有客户Id的则按客户Id执行,没有的则全部客户都执行 if (null != formDTO && StringUtils.isNotBlank(formDTO.getCustomerId())) { - log.info("单独统计客户机关-项目-日月数据,当前统计的客户Id:" + formDTO.getCustomerId()); customerAgencyStats(formDTO.getCustomerId(), date); } else { int pageNo = 1; @@ -88,7 +87,6 @@ public class StatsProjectServiceImpl implements StatsProjectService { if (!CollectionUtils.isEmpty(customerIdList)) { for (String customerId : customerIdList) { try { - log.info("for循环统计机关-项目-日月数据,当前统计的客户Id:" + customerId); //遍历统计每一个客户数据 customerAgencyStats(customerId, date); } catch (Exception e) { @@ -110,13 +108,11 @@ public class StatsProjectServiceImpl implements StatsProjectService { DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date); //2:根据客户Id查询机关维度表数据 - log.info("StatsProjectServiceImpl.customerAgencyStats-根据客户Id查询机关维度数据,对应客户Id:" + customerId); DimAgencyDTO dimAgencyDTO = new DimAgencyDTO(); dimAgencyDTO.setCustomerId(customerId); List dimAgencyList = dimAgencyService.getDimAgencyList(dimAgencyDTO); //3:根据客户Id查询项目业务表已结案数据(查询传入日期及之前的数据) - log.info("StatsProjectServiceImpl.customerAgencyStats-根据客户Id查询项目业务表已结案数据,对应客户Id:" + customerId); ProjectEntity projectEntity = new ProjectEntity(); projectEntity.setCustomerId(customerId); projectEntity.setCreatedTime(date); @@ -124,7 +120,6 @@ public class StatsProjectServiceImpl implements StatsProjectService { List projectList = projectService.getProjectList(projectEntity); //4:查询项目处理进展表中有效数据(创建日期截取yyyy-mm-dd格式字段值)(查询传入日期及之前的数据) - log.info("StatsProjectServiceImpl.customerAgencyStats-根据客户Id查询项目进展表业务数据,对应客户Id:" + customerId); List processList = projectProcessService.getProcessList(projectEntity); //20210721 sun 业务逻辑调整,网格删除,组织没有删除情况,相应的组织层级数据统计应舍弃以删除网格数据 start @@ -134,21 +129,9 @@ public class StatsProjectServiceImpl implements StatsProjectService { if (list.size() > NumConstant.ZERO) { Map map = list.stream().collect(Collectors.toMap(String::toString, v -> v, (c1, c2) -> c1)); //4-2.遍历删除项目主表查询的无效数据 - Iterator proiter = projectList.iterator(); - while (proiter.hasNext()) { - ProjectEntity next = proiter.next(); - if (map.containsKey(next.getId())) { - proiter.remove(); - } - } + projectList.removeIf(next -> map.containsKey(next.getId())); //4-3.遍历删除项目节点表查询的无效数据 - Iterator iterator = processList.iterator(); - while (iterator.hasNext()) { - ProjectProcessEntity next = iterator.next(); - if (map.containsKey(next.getProjectId())) { - iterator.remove(); - } - } + processList.removeIf(next -> map.containsKey(next.getProjectId())); } //20210721 sun end @@ -156,21 +139,17 @@ public class StatsProjectServiceImpl implements StatsProjectService { if (null != dimAgencyList && dimAgencyList.size() > NumConstant.ZERO) { //5.1:执行机关日数据统计 try { - log.info("StatsProjectServiceImpl.customerAgencyStats-开始执行机关日统计方法,方法名:agencyDateProjectStats,客户Id:" + customerId); agencyDateProjectStats(customerId, dimId, date, dimAgencyList, projectList, processList); } catch (Exception e) { log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "agencyDateProjectStats", customerId, dimId.getDateId()), e); } //5.2:执行机关月数据统计 - //if (Calendar.getInstance().get(Calendar.DATE) == 1) { try { - log.info("StatsProjectServiceImpl.customerAgencyStats-开始执行机关月统计方法,方法名:agencyMonthProjectStats,客户Id:" + customerId); agencyMonthProjectStats(customerId, dimId, dimAgencyList); } catch (Exception e) { log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "agencyMonthProjectStats", customerId, dimId.getMonthId()), e); } - //} } } @@ -404,7 +383,6 @@ public class StatsProjectServiceImpl implements StatsProjectService { } //入参有客户Id的则按客户Id执行,没有的则全部客户都执行 if (null != formDTO && StringUtils.isNotBlank(formDTO.getCustomerId())) { - log.info("单独统计客户网格-项目-日月数据,当前统计的客户Id:" + formDTO.getCustomerId()); customerGridStats(formDTO.getCustomerId(), date); } else { int pageNo = 1; @@ -415,11 +393,9 @@ public class StatsProjectServiceImpl implements StatsProjectService { if (!CollectionUtils.isEmpty(customerIdList)) { for (String customerId : customerIdList) { try { - log.info("for循环统计网格-项目-日月数据,当前统计的客户Id:" + customerId); //遍历统计每一个客户数据 customerGridStats(customerId, date); } catch (Exception e) { - log.error("项目-网格-数据统计程序错误,对应客户Id:" + customerId, e); log.error("Error creating model JSON", e); } } @@ -437,11 +413,9 @@ public class StatsProjectServiceImpl implements StatsProjectService { DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date); //2:根据客户Id查询网格维度表数据 - log.info("StatsProjectServiceImpl.customerGridStats-根据客户Id查询网格维度数据,对应客户Id:" + customerId); List dimGridList = dimGridService.getGridListByCustomerId(customerId); //3:根据客户Id查询项目业务表已结案数据(查询传入日期及之前的数据) - log.info("StatsProjectServiceImpl.customerGridStats-根据客户Id查询项目业务表已结案数据,对应客户Id:" + customerId); ProjectEntity projectEntity = new ProjectEntity(); projectEntity.setCustomerId(customerId); projectEntity.setCreatedTime(date); @@ -449,14 +423,12 @@ public class StatsProjectServiceImpl implements StatsProjectService { List projectList = projectService.getProjectList(projectEntity); //4:查询项目处理进展表中有效数据(创建日期截取yyyy-mm-dd格式字段值)(查询传入日期及之前的数据) - log.info("StatsProjectServiceImpl.customerGridStats-根据客户Id查询项目进展表业务数据,对应客户Id:" + customerId); List processList = projectProcessService.getProcessList(projectEntity); //5:网格层级日月统计 if (null != dimGridList && dimGridList.size() > NumConstant.ZERO) { //5.1:执行网格日数据统计 try { - log.info("StatsProjectServiceImpl.customerGridStats-开始执行机关日统计方法,方法名:gridDateProjectStats,客户Id:" + customerId); gridDateProjectStats(customerId, dimId, date, dimGridList, projectList, processList); } catch (Exception e) { log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "gridDateProjectStats", customerId, dimId.getDateId()), e); @@ -464,7 +436,6 @@ public class StatsProjectServiceImpl implements StatsProjectService { //5.2:执行网格月数据统计 try { - log.info("StatsProjectServiceImpl.customerGridStats-开始执行机关月统计方法,方法名:gridMonthProjectStats,客户Id:" + customerId); gridMonthProjectStats(customerId, dimId, dimGridList); } catch (Exception e) { log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "gridMonthProjectStats", customerId, dimId.getMonthId()), e); @@ -711,4 +682,4 @@ public class StatsProjectServiceImpl implements StatsProjectService { return date; } -} \ No newline at end of file +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java index 397fcefa7a..2d77962df5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java @@ -404,7 +404,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { for (ArticleGridPublishedSummaryDTO summaryDTO : publishedArticleCount) { FactArticlePublishedDepartmentDailyEntity gridDailyEntities = departmentDailyEntityMap.get(summaryDTO.getPublisherId()); if (gridDailyEntities == null) { - log.error("publicitySummary bizData departmentId:{} not exist in dimDepartment", summaryDTO.getGridId()); + log.warn("publicitySummary bizData departmentId:{} not exist in dimDepartment", summaryDTO.getGridId()); continue; } gridDailyEntities.setArticleTotalCount(summaryDTO.getArticleTotalCount()); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsUserServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsUserServiceImpl.java index bdc1999ff7..a3ccd6c5a1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsUserServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsUserServiceImpl.java @@ -178,7 +178,7 @@ public class StatsUserServiceImpl implements StatsUserService { while (iterator.hasNext()) { GmUploadEventFormDTO.DataList m = iterator.next(); AtomicReference bl = new AtomicReference<>(false); - StringBuffer gridPids = new StringBuffer(""); + StringBuffer gridPids = new StringBuffer(); agencyList.forEach(ag -> { if (m.getAgencyId().equals(ag.getId())) { bl.set(true); @@ -239,8 +239,8 @@ public class StatsUserServiceImpl implements StatsUserService { while (iterator.hasNext()) { GmUploadDataFormDTO.DataList m = iterator.next(); AtomicReference bl = new AtomicReference<>(false); - StringBuffer pid = new StringBuffer(""); - StringBuffer pids = new StringBuffer(""); + StringBuffer pid = new StringBuffer(); + StringBuffer pids = new StringBuffer(); agencyList.forEach(ag -> { if (m.getAgencyId().equals(ag.getId())) { bl.set(true); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerAgencyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerAgencyService.java index 60991b69bf..156b7294a9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerAgencyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerAgencyService.java @@ -1,5 +1,7 @@ package com.epmet.service.org; +import com.epmet.dto.org.form.GridBaseInfoFormDTO; +import com.epmet.dto.org.result.CustomerAgencyDTO; import com.epmet.dto.org.result.CustomerAreaCodeResultDTO; import com.epmet.dto.org.result.OrgStaffDTO; import com.epmet.entity.org.CustomerAgencyEntity; @@ -49,6 +51,7 @@ public interface CustomerAgencyService { */ CustomerAgencyEntity getAgencyByDeptId(String deptId); + /** * 将孔村、榆山、锦水3个街道的组织插入到gov-org库的customer_agency * @@ -58,4 +61,9 @@ public interface CustomerAgencyService { */ void sysAgencyInfo(String fromCustomerId, String toCustomerId); + /** + * @Author sun + * @Description 批量查询客户组织基础信息 + **/ + List getAgencyBaseInfo(GridBaseInfoFormDTO formDTO); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerGridService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerGridService.java index 2da4de7518..f6131f2906 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerGridService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerGridService.java @@ -6,6 +6,10 @@ import com.epmet.dto.group.result.AgencyGridTotalCountResultDTO; import com.epmet.dto.group.result.GridIdListByCustomerResultDTO; import com.epmet.dto.org.CustomerStaffGridDTO; import com.epmet.dto.org.GridInfoDTO; +import com.epmet.dto.org.form.GridBaseInfoFormDTO; +import com.epmet.dto.org.result.CustomerGridDTO; +import com.epmet.dto.user.form.StaffBaseInfoFormDTO; +import com.epmet.dto.user.result.GridUserInfoDTO; import com.epmet.entity.org.CustomerGridEntity; import java.util.Date; @@ -77,4 +81,15 @@ public interface CustomerGridService extends BaseService { **/ List getdelGridProjectIdList(String customerId); + /** + * @Author sun + * @Description 批量查询客户网格基础信息 + **/ + List getGridBaseInfo(GridBaseInfoFormDTO formDTO); + + /** + * @Author sun + * @Description 查询工作人员所属网格信息 + **/ + List getStaffGrid(StaffBaseInfoFormDTO formDTO); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerAgencyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerAgencyServiceImpl.java index 66ea3b4b37..3e06682b15 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerAgencyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerAgencyServiceImpl.java @@ -5,6 +5,8 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.constant.DataSourceConstant; import com.epmet.dao.org.StatsCustomerAgencyDao; +import com.epmet.dto.org.form.GridBaseInfoFormDTO; +import com.epmet.dto.org.result.CustomerAgencyDTO; import com.epmet.dto.org.result.CustomerAreaCodeResultDTO; import com.epmet.dto.org.result.OrgStaffDTO; import com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity; @@ -67,31 +69,6 @@ public class CustomerAgencyServiceImpl implements CustomerAgencyService { return customerAgencyDao.getRootAgencyInfo(customerId); } - /** - * 获取每个组织、每个网格下工作人员userId集合 - * - * @param customerId - * @return com.epmet.dto.org.result.OrgStaffResultDTO - */ - @Override - public List queryOrgStaffIds(String customerId) { - List resultList=new ArrayList<>(); - List list=customerAgencyDao.selectListByCustomerId(customerId); - for(CustomerAgencyEntity agencyEntity:list){ - List agencyStaffIds=customerAgencyDao.selectAgencyStaffIds(customerId,agencyEntity.getId()); - if(!CollectionUtils.isEmpty(agencyStaffIds)){ - OrgStaffDTO agencyStaffDTO=new OrgStaffDTO(); - agencyStaffDTO.setOrgId(agencyEntity.getId()); - agencyStaffDTO.setOrgType("agency"); - agencyStaffDTO.setStaffIds(agencyStaffIds); - resultList.add(agencyStaffDTO); - } - } - List gridStaffIds=customerAgencyDao.selectGridStaffIds(customerId); - resultList.addAll(gridStaffIds); - return resultList; - } - @Override public List queryAgencyListByCustomerId(String customerId) { return customerAgencyDao.queryAgencyListByCustomerId(customerId); @@ -119,6 +96,31 @@ public class CustomerAgencyServiceImpl implements CustomerAgencyService { return customerAgencyDao.selectByDeptId(deptId); } + /** + * 获取每个组织、每个网格下工作人员userId集合 + * + * @param customerId + * @return com.epmet.dto.org.result.OrgStaffResultDTO + */ + @Override + public List queryOrgStaffIds(String customerId) { + List resultList=new ArrayList<>(); + List list=customerAgencyDao.selectListByCustomerId(customerId); + for(CustomerAgencyEntity agencyEntity:list){ + List agencyStaffIds=customerAgencyDao.selectAgencyStaffIds(customerId,agencyEntity.getId()); + if(!CollectionUtils.isEmpty(agencyStaffIds)){ + OrgStaffDTO agencyStaffDTO=new OrgStaffDTO(); + agencyStaffDTO.setOrgId(agencyEntity.getId()); + agencyStaffDTO.setOrgType("agency"); + agencyStaffDTO.setStaffIds(agencyStaffIds); + resultList.add(agencyStaffDTO); + } + } + List gridStaffIds=customerAgencyDao.selectGridStaffIds(customerId); + resultList.addAll(gridStaffIds); + return resultList; + } + /** * 将孔村、榆山、锦水3个街道的组织插入到gov-org库的customer_agency * @@ -243,7 +245,7 @@ public class CustomerAgencyServiceImpl implements CustomerAgencyService { * @param parentCustomerEntity 在平阴客户里,网格所属组织信息 * @author yinzuomei * @description 将3个街道的网格,插入到gov-org.customer_grid库 - * @Date 2021/7/7 9:54 + * @Date 2021/7/7 9:54 **/ private void insertCustomerGrid(String customerId, String agencyId, CustomerAgencyEntity parentCustomerEntity) { List gridEntityList = screenCustomerGridService.selectEntityByAgencyId(customerId, agencyId); @@ -271,4 +273,14 @@ public class CustomerAgencyServiceImpl implements CustomerAgencyService { } } } + + /** + * @Author sun + * @Description 批量查询客户组织基础信息 + **/ + @Override + public List getAgencyBaseInfo(GridBaseInfoFormDTO formDTO) { + return customerAgencyDao.getAgencyBaseInfo(formDTO); + } + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerGridServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerGridServiceImpl.java index 4d4ab8bee0..76376efd82 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerGridServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerGridServiceImpl.java @@ -10,6 +10,10 @@ import com.epmet.dto.group.result.AgencyGridTotalCountResultDTO; import com.epmet.dto.group.result.GridIdListByCustomerResultDTO; import com.epmet.dto.org.CustomerStaffGridDTO; import com.epmet.dto.org.GridInfoDTO; +import com.epmet.dto.org.form.GridBaseInfoFormDTO; +import com.epmet.dto.org.result.CustomerGridDTO; +import com.epmet.dto.user.form.StaffBaseInfoFormDTO; +import com.epmet.dto.user.result.GridUserInfoDTO; import com.epmet.entity.org.CustomerGridEntity; import com.epmet.service.Issue.IssueService; import com.epmet.service.org.CustomerGridService; @@ -82,7 +86,7 @@ public class CustomerGridServiceImpl extends BaseServiceImpl getCustomerStaffGridList(String customerId) { - return customerGridDao.getCustomerStaffGridList(customerId); + return baseDao.getCustomerStaffGridList(customerId); } /** @@ -115,4 +119,22 @@ public class CustomerGridServiceImpl extends BaseServiceImpl getGridBaseInfo(GridBaseInfoFormDTO formDTO) { + return customerGridDao.getGridBaseInfo(formDTO); + } + + /** + * @Author sun + * @Description 查询工作人员所属网格信息 + **/ + @Override + public List getStaffGrid(StaffBaseInfoFormDTO formDTO) { + return customerGridDao.getStaffGrid(formDTO); + } + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java index d16db0530e..a71c61bfbd 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java @@ -20,7 +20,6 @@ package com.epmet.service.project.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.NumConstant; -import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.dao.project.ProjectProcessDao; import com.epmet.dto.ProjectProcessDTO; @@ -40,7 +39,9 @@ import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; -import java.util.*; +import java.util.Collections; +import java.util.List; +import java.util.Map; import java.util.stream.Collectors; /** @@ -144,7 +145,7 @@ public class ProjectProcessServiceImpl extends BaseServiceImpl closedInfo.stream().filter(closedCase -> StringUtils.equals(closedCase.getProjectId(),target.getProjectId())).map( merge -> { target.setProjectStatusCode("closed_case"); - target.setCloseCaseTime(DateUtils.format(merge.getCreatedTime(),DateUtils.DATE_TIME_PATTERN)); + target.setCloseCaseTime(merge.getCreatedTime()); return target; } )).collect(Collectors.toList()); @@ -166,7 +167,7 @@ public class ProjectProcessServiceImpl extends BaseServiceImpl closedInfo.stream().filter(closedCase -> StringUtils.equals(closedCase.getProjectId(),target.getProjectId())).map( merge -> { //target.setProjectStatusCode("closed_case"); - target.setCloseCaseTime(DateUtils.format(merge.getCreatedTime(),DateUtils.DATE_TIME_PATTERN)); + target.setCloseCaseTime(merge.getCreatedTime()); return target; } )).collect(Collectors.toList()); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/CustomerProjectCategoryDictService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/CustomerProjectCategoryDictService.java index ef8440c594..02a859423a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/CustomerProjectCategoryDictService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/CustomerProjectCategoryDictService.java @@ -24,6 +24,7 @@ import com.epmet.entity.issue.IssueProjectCategoryDictEntity; import com.epmet.entity.stats.CustomerProjectCategoryDictEntity; import java.util.List; +import java.util.Map; /** * 客户项目分类字典表 @@ -55,4 +56,16 @@ public interface CustomerProjectCategoryDictService extends BaseService formDTO); + + /** + * @Description 获取分类信息 + * @Param customerId + * @Param categoryCode + * @Return {@link CustomerProjectCategoryDictEntity} + * @Author zhaoqifeng + * @Date 2021/10/15 16:33 + */ + CustomerProjectCategoryDictEntity getByCategoryCode(String customerId, String categoryCode); + + Map getByCategoryCodeMap(String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DemandStatsService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DemandStatsService.java new file mode 100644 index 0000000000..dec4ed26ef --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DemandStatsService.java @@ -0,0 +1,18 @@ +package com.epmet.service.stats; + +import com.epmet.entity.stats.FactVolunteerServiceDailyEntity; + +import java.util.List; + +/** + *@Description 统计客户下的志愿者需求服务数据 + *@Author wangxianzhang + *@Date 2021/12/8 + */ +public interface DemandStatsService { + + + void addVolunteerServiceDaily(FactVolunteerServiceDailyEntity entity); + + void clearVolunteerDemandServiceDailyStats(List customerIds, String dateDimId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/CustomerProjectCategoryDictServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/CustomerProjectCategoryDictServiceImpl.java index 97a8a560f5..592e2a33b6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/CustomerProjectCategoryDictServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/CustomerProjectCategoryDictServiceImpl.java @@ -17,6 +17,7 @@ package com.epmet.service.stats.impl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.NumConstant; @@ -33,7 +34,11 @@ import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.util.Collections; import java.util.List; +import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; /** * 客户项目分类字典表 @@ -116,4 +121,33 @@ public class CustomerProjectCategoryDictServiceImpl extends BaseServiceImpl wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(CustomerProjectCategoryDictEntity::getCategoryCode, categoryCode); + wrapper.eq(CustomerProjectCategoryDictEntity::getCustomerId, customerId); + return baseDao.selectOne(wrapper); + } + + @Override + public Map getByCategoryCodeMap(String customerId) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(CustomerProjectCategoryDictEntity::getCustomerId, customerId); + List list = baseDao.selectList(wrapper); + if (CollectionUtils.isEmpty(list)) { + return Collections.emptyMap(); + } + return list.stream().collect(Collectors.toMap(CustomerProjectCategoryDictEntity::getCategoryCode, Function.identity())); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DemandStatsServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DemandStatsServiceImpl.java new file mode 100644 index 0000000000..54a8525877 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DemandStatsServiceImpl.java @@ -0,0 +1,36 @@ +package com.epmet.service.stats.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.stats.FactVolunteerServiceDailyDao; +import com.epmet.entity.stats.FactVolunteerServiceDailyEntity; +import com.epmet.service.stats.DemandStatsService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @Description 描述 + * @Author wangxianzhang + * @Date 2021/12/8 10:54 上午 + * @Version 1.0 + */ +@Service +@DataSource(DataSourceConstant.STATS) +public class DemandStatsServiceImpl implements DemandStatsService { + + @Autowired + private FactVolunteerServiceDailyDao factVolunteerServiceDailyDao; + + @Override + public void addVolunteerServiceDaily(FactVolunteerServiceDailyEntity entity) { + factVolunteerServiceDailyDao.insert(entity); + } + + @Override + public void clearVolunteerDemandServiceDailyStats(List customerIds, String dateDimId) { + factVolunteerServiceDailyDao.clearVolunteerDemandServiceDailyStats(customerIds, dateDimId); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java index c1ab8fb3d0..99e6ba794c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java @@ -139,10 +139,19 @@ public class DimAgencyServiceImpl extends BaseServiceImpl StringUtils.isNotBlank(item.getAgencyId())).collect(Collectors.toList()); delAndInsertParty(partyMemberList,customerId,dateId); }); }); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerServiceImpl.java index feae456fb3..ffc7a465fc 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerServiceImpl.java @@ -146,6 +146,10 @@ public class DimCustomerServiceImpl extends BaseServiceImpl selectGridUserCount(String customerId,String monthId); + /** + * 网格相关-党建能力:网格群众用户数、网格党员用户数 + * 从fact_reg_user_grid_daily这个表 sum增量,为了与运营端数据导出一致 + * + * @param customerId + * @param monthId + * @return + */ + List selectGridUserCountFromDaily(String customerId,String monthId); + /** * 查询网格下各用户数量 * diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactRegUserGridMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactRegUserGridMonthlyServiceImpl.java index b859133325..381258981d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactRegUserGridMonthlyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactRegUserGridMonthlyServiceImpl.java @@ -20,16 +20,15 @@ package com.epmet.service.stats.user.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.dao.stats.user.FactRegUserGridMonthlyDao; import com.epmet.dto.extract.result.GridUserCountResultDTO; import com.epmet.dto.stats.user.FactRegUserGridMonthlyDTO; import com.epmet.entity.stats.user.FactRegUserGridMonthlyEntity; import com.epmet.service.stats.user.FactRegUserGridMonthlyService; import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -112,6 +111,20 @@ public class FactRegUserGridMonthlyServiceImpl extends BaseServiceImpl selectGridUserCountFromDaily(String customerId, String monthId) { + return baseDao.selectGridUserCountFromDaily(customerId, monthId); + } + + @Override public List getGridUserCountByCustomer(String customerId, String monthId) { return baseDao.selectGridUserCountByCustomer(customerId, monthId); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java index a47baa85bd..4aa8d924a6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java @@ -3,6 +3,7 @@ package com.epmet.service.topic.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.dao.topic.TopicDao; import com.epmet.dto.AgencySubTreeDto; @@ -75,8 +76,12 @@ public class TopicServiceImpl implements TopicService { agencies.forEach(agency -> { initAgencyGridMap(agency.getAgencyId(),agency,subGridOfAgency); }); - //计算网格-组-话题映射关系 - List topics = topicDao.selectGroupOrderByGrid(targetDate,customerId); + //计算网格-组-话题映射关系 如果时间为空则 默认取维度里的时间(也是默认t-1天) + Date breforeDate = targetDate; + if (targetDate == null){ + breforeDate = DateUtils.parse(timeDimension.getDateId(),DateUtils.DATE_PATTERN_YYYYMMDD); + } + List topics = topicDao.selectGroupOrderByGrid(breforeDate,customerId); topics.forEach(groupTopic -> { if(null != groupTopic.getTopics() && groupTopic.getTopics().size() == NumConstant.ONE && StringUtils.isBlank(groupTopic.getTopics().get(NumConstant.ZERO).getTopicId())){ groupTopic.setTopics(new ArrayList<>()); @@ -287,7 +292,8 @@ public class TopicServiceImpl implements TopicService { * @author wangc * @date 2020.06.22 13:13 **/ - TopicStatisticalData calculateAndSummarizeTopicStatisticalData(Map> subGridOfAgency, List agencies, Map> gridGroupMap, Date targetDate,List statusDimension ,DimIdGenerator.DimIdBean timeDimension ,String customerId){ + TopicStatisticalData calculateAndSummarizeTopicStatisticalData(Map> subGridOfAgency, List agencies, Map> gridGroupMap, + Date targetDate,List statusDimension ,DimIdGenerator.DimIdBean timeDimension ,String customerId){ if(null == subGridOfAgency || subGridOfAgency.size() <= NumConstant.ZERO){ return null; } @@ -306,8 +312,7 @@ public class TopicServiceImpl implements TopicService { //参数:gridGroupMap 所有网格的组以及组内话题 //[所有]话题当日的操作记录 - List operations = - topicDao.selectTopicOperationRecord(targetDate); + List operations = topicDao.selectTopicOperationRecord(targetDate); //key:话题Id value:这个话题在当日的操作记录 //操作类型有: ①discussing(发布) ②hidden(屏蔽) ③hidden_cancelled(取消屏蔽) ④closed(关闭) ⑤shift_issue(转议题) //注意不要把【发布】和【取消屏蔽】混淆!!! diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java index f45809be94..1d0a500b0a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java @@ -7,10 +7,9 @@ import com.epmet.dto.org.result.OrgStaffDTO; import com.epmet.dto.screen.ScreenProjectDataDTO; import com.epmet.dto.stats.form.GmUploadEventFormDTO; import com.epmet.dto.stats.user.result.UserStatisticalData; -import com.epmet.dto.user.result.StaffRoleInfoDTO; -import com.epmet.dto.user.result.CustomerStaffDTO; -import com.epmet.dto.user.result.StaffPatrolRecordResult; -import com.epmet.dto.user.result.StatsStaffPatrolRecordDailyDTO; +import com.epmet.dto.user.form.StaffBaseInfoFormDTO; +import com.epmet.dto.user.param.MidPatrolFormDTO; +import com.epmet.dto.user.result.*; import com.epmet.entity.evaluationindex.screen.ScreenPartyUserRankDataEntity; import com.epmet.util.DimIdGenerator; @@ -137,4 +136,16 @@ public interface UserService { * @author sun */ void saveOrUpGmUploadEvent(List list); + + /** + * @Author sun + * @Description 批量查询客户网格员基础信息 + **/ + List getStaffBaseInfo(StaffBaseInfoFormDTO formDTO); + + List getPatrolRecordList(MidPatrolFormDTO formDTO); + + List getPatrolDetailList(MidPatrolFormDTO formDTO); + + List filterUserIds(List userIds, String roleKey); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java index 95c7c333ff..a2d56125a6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java @@ -17,6 +17,8 @@ import com.epmet.dto.screen.ScreenProjectDataDTO; import com.epmet.dto.stats.form.GmUploadEventFormDTO; import com.epmet.dto.stats.user.*; import com.epmet.dto.stats.user.result.UserStatisticalData; +import com.epmet.dto.user.form.StaffBaseInfoFormDTO; +import com.epmet.dto.user.param.MidPatrolFormDTO; import com.epmet.dto.user.result.*; import com.epmet.entity.evaluationindex.screen.ScreenPartyUserRankDataEntity; import com.epmet.service.user.UserService; @@ -1088,4 +1090,27 @@ public class UserServiceImpl implements UserService { userDao.saveOrUpGmUploadEvent(list); } + /** + * @Author sun + * @Description 批量查询客户网格员基础信息 + **/ + @Override + public List getStaffBaseInfo(StaffBaseInfoFormDTO formDTO) { + return userDao.getStaffBaseInfo(formDTO); + } + + @Override + public List getPatrolRecordList(MidPatrolFormDTO formDTO) { + return userDao.getPatrolRecordList(formDTO); + } + + @Override + public List getPatrolDetailList(MidPatrolFormDTO formDTO) { + return userDao.getPatrolDetailList(formDTO); + } + + @Override + public List filterUserIds(List userIds, String roleKey) { + return userDao.filterUserIds(userIds, roleKey); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreCalculator.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreCalculator.java index 07407d5032..01906d5bae 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreCalculator.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreCalculator.java @@ -76,16 +76,14 @@ public abstract class ScoreCalculator { throw new RuntimeException("入参数组错误:请设置sourceValue"); } + BigDecimal x = coefficient.multiply(convertValue2BigDecimal(sourceValue).subtract(minValue)); if (correlation == Correlation.POSITIVE) { // 正相关 - BigDecimal x = coefficient.multiply(convertValue2BigDecimal(sourceValue).subtract(minValue)); BigDecimal score = minScore.add(x); return score; } else if (correlation == Correlation.NEGATIVE) { // 负相关 - BigDecimal x = coefficient.multiply(convertValue2BigDecimal(sourceValue).subtract(minValue)); - BigDecimal score = minScore.add(x); - return maxScore.subtract(score, MathContext.DECIMAL32); + return maxScore.subtract(x, MathContext.DECIMAL32); } else { throw new RuntimeException("错误的相关性"); } @@ -161,10 +159,7 @@ public abstract class ScoreCalculator { * @return */ protected boolean validSourceArray(T[] sourceArray) { - if (sourceArray == null || sourceArray.length == 0) { - return false; - } - return true; + return sourceArray != null && sourceArray.length != 0; } /** diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/BatchScoreCalculator.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/BatchScoreCalculator.java index 754e2cf7bc..988d83aab4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/BatchScoreCalculator.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/BatchScoreCalculator.java @@ -76,19 +76,24 @@ public class BatchScoreCalculator { if (idx.getScoreCalculator().getMaxValue().compareTo(idx.getScoreCalculator().getMinValue()) == 0) { //*((max-min)/ (Math.PI/2))+min //Math.atan(new Double(vo.getSampleValue().toString()))* - normalizeValue = new BigDecimal(Math.atan(new Double(getFinalSampleValue(vo.getSampleValue(), threshold).toString()))) - .multiply( - (maxScoreValue.subtract(minScoreValue).divide(new BigDecimal(Math.PI / 2), 10, RoundingMode.HALF_UP))) - .add(minScoreValue).setScale(6, RoundingMode.HALF_UP); - - + if (Correlation.POSITIVE.getCode().equals(scoreCalculator.getCorrelation().getCode())) { + normalizeValue = new BigDecimal(Math.atan(new Double(getFinalSampleValue(vo.getSampleValue(), threshold).toString()))) + .multiply( + (maxScoreValue.subtract(minScoreValue).divide(new BigDecimal(Math.PI / 2), 10, RoundingMode.HALF_UP))) + .add(minScoreValue).setScale(6, RoundingMode.HALF_UP); + }else{ + normalizeValue = new BigDecimal(Math.atan(new Double(getFinalSampleValue(vo.getSampleValue(), threshold).toString()))) + .multiply( + (maxScoreValue.subtract(minScoreValue).divide(new BigDecimal(Math.PI / 2), 10, RoundingMode.HALF_UP)).multiply(new BigDecimal(-1))) + .add(maxScoreValue).setScale(6, RoundingMode.HALF_UP); + } } else { normalizeValue = scoreCalculator.normalize(getFinalSampleValue(vo.getSampleValue(), threshold)); } - //如果是负相关 则用100-归一后的值为最大值减 + /* //如果是负相关 则用100-归一后的值为最大值减 if (Correlation.NEGATIVE.getCode().equals(scoreCalculator.getCorrelation().getCode())) { normalizeValue = maxScoreValue.subtract(normalizeValue); - } + }*/ } //如果归一后的值小于0 则置为0 if (normalizeValue.compareTo(NumConstant.ZERO_DECIMAL)<=-1){ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.14__cpc_subscore_add_samplecount.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.14__cpc_subscore_add_samplecount.sql index b5e87ed6f5..9414daa14d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.14__cpc_subscore_add_samplecount.sql +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.14__cpc_subscore_add_samplecount.sql @@ -1,5 +1,5 @@ -alter table fact_index_grid_sub_score add column SAMPLE_COUNT int(10) comment '参与统计的样本个数' after ORIGIN_VALUE; -alter table fact_index_community_sub_score - add column SAMPLE_COUNT int(10) comment '参与统计的样本个数' after ORIGIN_VALUE; -alter table fact_index_agency_sub_score - add column SAMPLE_COUNT int(10) comment '参与统计的样本个数' after ORIGIN_VALUE; \ No newline at end of file +# alter table fact_index_grid_sub_score add column SAMPLE_COUNT int(10) comment '参与统计的样本个数' after ORIGIN_VALUE; +# alter table fact_index_community_sub_score +# add column SAMPLE_COUNT int(10) comment '参与统计的样本个数' after ORIGIN_VALUE; +# alter table fact_index_agency_sub_score +# add column SAMPLE_COUNT int(10) comment '参与统计的样本个数' after ORIGIN_VALUE; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.14__groupact_analysis.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.14__groupact_analysis.sql index a450ab5eec..60b70ed908 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.14__groupact_analysis.sql +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.14__groupact_analysis.sql @@ -1,47 +1,47 @@ --- epmet_data_statistical 库执行以下脚本 -CREATE TABLE `fact_group_act_daily` ( - `ID` varchar(64) NOT NULL COMMENT '主键', - `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', - `DATE_ID` varchar(8) NOT NULL COMMENT '数据更新至日期Id:yyyyMMdd', - `ORG_ID` varchar(64) NOT NULL COMMENT '网格id', - `ORG_TYPE` varchar(10) NOT NULL COMMENT '网格:grid;组织:agency', - `PID` varchar(255) DEFAULT NULL COMMENT '1)orgType=grid: pid=网格所属组织id;\r\n2)orgType=agency: pid=当前组织的上级组织', - `PIDS` varchar(255) DEFAULT NULL COMMENT '1)orgType=grid: pids=网格所有上级组织,包括pid;\r\n2)orgType=agency: pids=当前组织的所有上级组织,包括pid.', - `CATEGORY_CODE` varchar(255) NOT NULL COMMENT '活动分类编码', - `PARENT_CODE` varchar(255) NOT NULL COMMENT '上级分类编码', - `LEVEL` int(11) NOT NULL COMMENT '分类等级', - `ORGANIZE_TOTAL` int(11) NOT NULL COMMENT '截止到dateId: 组织次数;包含dateId这一天的数据', - `PARTICIPATE_USER_TOTAL` int(11) NOT NULL COMMENT '截止到dateId: 参加人数;包含dateId这一天的数据', - `AVG_PARTICIPATE_USER_TOTAL` int(11) NOT NULL COMMENT '截止到dateId: 平均参加人数;包含dateId这一天的数据', - `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除', - `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', - `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', - `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', - `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', - `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', - PRIMARY KEY (`ID`) USING BTREE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='组织活动(参加人数、组织次数、平均参加人数)按天累计值分析'; - - -CREATE TABLE `fact_group_act_monthly` ( - `ID` varchar(64) NOT NULL COMMENT '主键', - `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', - `MONTH_ID` varchar(8) NOT NULL COMMENT '数据维度:yyyyMM', - `ORG_ID` varchar(64) NOT NULL COMMENT '网格id', - `ORG_TYPE` varchar(10) NOT NULL COMMENT '网格:grid;组织:agency', - `PID` varchar(255) DEFAULT NULL COMMENT '1)orgType=grid: pid=网格所属组织id;\r\n2)orgType=agency: pid=当前组织的上级组织', - `PIDS` varchar(255) DEFAULT NULL COMMENT '1)orgType=grid: pids=网格所有上级组织,包括pid;\r\n2)orgType=agency: pids=当前组织的所有上级组织,包括pid.', - `CATEGORY_CODE` varchar(255) NOT NULL COMMENT '活动分类编码', - `PARENT_CODE` varchar(255) NOT NULL COMMENT '上级分类编码', - `LEVEL` int(11) NOT NULL COMMENT '分类等级', - `ORGANIZE_INCR` int(11) NOT NULL COMMENT '本月内:活动组织次数', - `PARTICIPATE_USER__INCR` int(11) NOT NULL COMMENT '本月内:活动签到人数参加人数', - `AVG_PARTICIPATE_USER_INCR` int(11) NOT NULL COMMENT '本月内:平均参加人数', - `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除', - `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', - `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', - `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', - `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', - `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', - PRIMARY KEY (`ID`) USING BTREE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='专项组活动(参加人数、组织次数、平均参加人数)按月增量分析'; \ No newline at end of file +# -- epmet_data_statistical 库执行以下脚本 +# CREATE TABLE `fact_group_act_daily` ( +# `ID` varchar(64) NOT NULL COMMENT '主键', +# `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', +# `DATE_ID` varchar(8) NOT NULL COMMENT '数据更新至日期Id:yyyyMMdd', +# `ORG_ID` varchar(64) NOT NULL COMMENT '网格id', +# `ORG_TYPE` varchar(10) NOT NULL COMMENT '网格:grid;组织:agency', +# `PID` varchar(255) DEFAULT NULL COMMENT '1)orgType=grid: pid=网格所属组织id;\r\n2)orgType=agency: pid=当前组织的上级组织', +# `PIDS` varchar(255) DEFAULT NULL COMMENT '1)orgType=grid: pids=网格所有上级组织,包括pid;\r\n2)orgType=agency: pids=当前组织的所有上级组织,包括pid.', +# `CATEGORY_CODE` varchar(255) NOT NULL COMMENT '活动分类编码', +# `PARENT_CODE` varchar(255) NOT NULL COMMENT '上级分类编码', +# `LEVEL` int(11) NOT NULL COMMENT '分类等级', +# `ORGANIZE_TOTAL` int(11) NOT NULL COMMENT '截止到dateId: 组织次数;包含dateId这一天的数据', +# `PARTICIPATE_USER_TOTAL` int(11) NOT NULL COMMENT '截止到dateId: 参加人数;包含dateId这一天的数据', +# `AVG_PARTICIPATE_USER_TOTAL` int(11) NOT NULL COMMENT '截止到dateId: 平均参加人数;包含dateId这一天的数据', +# `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除', +# `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', +# `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', +# `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', +# `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', +# `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', +# PRIMARY KEY (`ID`) USING BTREE +# ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='组织活动(参加人数、组织次数、平均参加人数)按天累计值分析'; +# +# +# CREATE TABLE `fact_group_act_monthly` ( +# `ID` varchar(64) NOT NULL COMMENT '主键', +# `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', +# `MONTH_ID` varchar(8) NOT NULL COMMENT '数据维度:yyyyMM', +# `ORG_ID` varchar(64) NOT NULL COMMENT '网格id', +# `ORG_TYPE` varchar(10) NOT NULL COMMENT '网格:grid;组织:agency', +# `PID` varchar(255) DEFAULT NULL COMMENT '1)orgType=grid: pid=网格所属组织id;\r\n2)orgType=agency: pid=当前组织的上级组织', +# `PIDS` varchar(255) DEFAULT NULL COMMENT '1)orgType=grid: pids=网格所有上级组织,包括pid;\r\n2)orgType=agency: pids=当前组织的所有上级组织,包括pid.', +# `CATEGORY_CODE` varchar(255) NOT NULL COMMENT '活动分类编码', +# `PARENT_CODE` varchar(255) NOT NULL COMMENT '上级分类编码', +# `LEVEL` int(11) NOT NULL COMMENT '分类等级', +# `ORGANIZE_INCR` int(11) NOT NULL COMMENT '本月内:活动组织次数', +# `PARTICIPATE_USER__INCR` int(11) NOT NULL COMMENT '本月内:活动签到人数参加人数', +# `AVG_PARTICIPATE_USER_INCR` int(11) NOT NULL COMMENT '本月内:平均参加人数', +# `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除', +# `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', +# `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', +# `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', +# `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', +# `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', +# PRIMARY KEY (`ID`) USING BTREE +# ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='专项组活动(参加人数、组织次数、平均参加人数)按月增量分析'; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.15__govern.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.15__govern.sql index e83d7f5313..481a0eb97f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.15__govern.sql +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.15__govern.sql @@ -1,110 +1,110 @@ --- epmet_data_statistical新增两张表,治理指数网格按天统计,治理指数按组织按天统计 - -CREATE TABLE `fact_agency_govern_daily` ( - `ID` varchar(64) NOT NULL COMMENT '主键,customer_id+AGENCY_ID+date_id只有一条记录', - `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', - `DATE_ID` varchar(8) NOT NULL COMMENT '数据更新至:yyyyMMdd; ', - `AGENCY_ID` varchar(64) NOT NULL COMMENT '组织id', - `LEVEL` varchar(30) NOT NULL COMMENT 'agency_id所属的机关级别(社区级:community,\r\n乡(镇、街道)级:street,\r\n区县级: district,\r\n市级: city\r\n省级:province)', - `PID` varchar(64) NOT NULL COMMENT '组织i所属的组织id', - `PIDS` varchar(255) NOT NULL COMMENT '组织i所有上级id', - `PROBLEM_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '界面展示:问题解决总数=1+2+3+4+5+6+7+8', - `GROUP_SELF_GOVERN_RATIO` decimal(10,6) NOT NULL COMMENT '界面展示:党群自治占比=(9+10)/PROBLEM_RESOLVED_COUNT; 此列存储的是小数', - `GRID_SELF_GOVERN_RATIO` decimal(10,6) NOT NULL COMMENT '界面展示:网格自治占比=GRID_SELF_GOVERN_PROJECT_TOTAL/PROBLEM_RESOLVED_COUNT;此列存储的是小数', - `COMMUNITY_CLOSED_RATIO` decimal(10,6) NOT NULL COMMENT '界面展示:社区解决占比=COMMUNITY_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数', - `STREET_CLOSED_RATIO` decimal(10,6) NOT NULL COMMENT '界面展示:街道解决占比=STREET_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数', - `DISTRICT_DEPT_CLOSED_RATIO` decimal(10,6) NOT NULL COMMENT '界面展示:区直部门解决占比=DISTRICT_DEPT_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数', - `TOPIC_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '1、当前组织内,话题关闭已解决数', - `TOPIC_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '2、当前组织内,话题关闭无需解决数', - `ISSUE_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '3、当前组织内,议题关闭已解决数', - `ISSUE_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '4、当前组织内,议题关闭无需解决数', - `ISSUE_PROJECT_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '5、当前组织内:来源于议题的项目:结案已解决数', - `ISSUE_PROJECT_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '6、当前组织内:来源于议题的项目:结案无需解决数', - `APPROVAL_PROJECT_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '7、当前组织内:项目立项,结案已解决数;默认为0,', - `APPROVAL_PROJECT_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '8、当前组织内:项目立项,结案无需解决数;默认为0,', - `IN_GROUP_TOPIC_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '9、当前组织内,未出小组即未转议题的:话题关闭已解决数', - `IN_GROUP_TOPIC_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '10、当前组织内,未出小组即未转议题的:话题关闭无需解决数', - `GRID_SELF_GOVERN_PROJECT_TOTAL` int(11) NOT NULL DEFAULT '0' COMMENT '11、未出当前网格的,结案项目数', - `COMMUNITY_CLOSED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '当前组织内结案的项目中:由社区结案的项目总数', - `STREET_CLOSED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '当前组织内结案的项目中:由街道结案的项目总数', - `DISTRICT_DEPT_CLOSED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '当前组织内结案的项目中:由区直部门结案的项目总数', - `DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除、1已删除', - `REVISION` int(11) NOT NULL DEFAULT '0' 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`) USING BTREE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='组织的治理指数,按天统计'; - -CREATE TABLE `fact_grid_govern_daily` ( - `ID` varchar(64) NOT NULL COMMENT '主键,customer_id+grid_id+date_id只有一条记录', - `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', - `DATE_ID` varchar(8) NOT NULL COMMENT '数据更新至:yyyyMMdd; ', - `GRID_ID` varchar(64) NOT NULL COMMENT '网格id', - `PID` varchar(64) NOT NULL COMMENT '网格所属的组织id', - `PIDS` varchar(255) NOT NULL COMMENT '网格所有上级id', - `PROBLEM_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '界面展示:问题解决总数=1+2+3+4+5+6+7+8', - `GROUP_SELF_GOVERN_RATIO` decimal(10,6) NOT NULL COMMENT '界面展示:党群自治占比=(9+10)/PROBLEM_RESOLVED_COUNT; 此列存储的是小数', - `GRID_SELF_GOVERN_RATIO` decimal(10,6) NOT NULL COMMENT '界面展示:网格自治占比=GRID_SELF_GOVERN_PROJECT_TOTAL/PROBLEM_RESOLVED_COUNT;此列存储的是小数', - `COMMUNITY_CLOSED_RATIO` decimal(10,6) NOT NULL COMMENT '界面展示:社区解决占比=COMMUNITY_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数', - `STREET_CLOSED_RATIO` decimal(10,6) NOT NULL COMMENT '界面展示:街道解决占比=STREET_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数', - `DISTRICT_DEPT_CLOSED_RATIO` decimal(10,6) NOT NULL COMMENT '界面展示:区直部门解决占比=DISTRICT_DEPT_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数', - `TOPIC_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '1、当前网格内,话题关闭已解决数', - `TOPIC_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '2、当前网格内,话题关闭无需解决数', - `ISSUE_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '3、当前网格内,议题关闭已解决数', - `ISSUE_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '4、当前网格内,议题关闭无需解决数', - `ISSUE_PROJECT_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '5、当前网格内:来源于议题的项目:结案已解决数', - `ISSUE_PROJECT_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '6、当前网格内:来源于议题的项目:结案无需解决数', - `APPROVAL_PROJECT_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '7、当前网格内:项目立项,结案已解决数;默认为0,', - `APPROVAL_PROJECT_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '8、当前网格内:项目立项,结案无需解决数;默认为0,', - `IN_GROUP_TOPIC_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '9、当前网格内,未出小组即未转议题的:话题关闭已解决数', - `IN_GROUP_TOPIC_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '10、当前网格内,未出小组即未转议题的:话题关闭无需解决数', - `FROM_ISSUE_RESOLVED_IN_GRID_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '11、来源于议题的项目,未出网格结案并且已解决的项目数', - `FROM_ISSUE_UN_RESOLVED_IN_GRID_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '12、来源于议题的项目,未出网格结案并且无需解决的项目数', - `FROM_AGENCY_RESOLVED_IN_GRID_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '13、来源于项目立项的项目,未出网格结案,并且已解决的项目数;因现在网格不能立项,所以此列默认为0', - `FROM_AGENCY_UN_RESOLVED_IN_GRID_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '14、来源于项目立项的项目,未出网格结案,并且无需解决的项目数;因现在网格不能立项,所以此列默认为0', - `GRID_SELF_GOVERN_PROJECT_TOTAL` int(11) NOT NULL COMMENT '15、未出当前网格的,结案项目数=11+12+13+14', - `COMMUNITY_CLOSED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '当前网格内出来的项目:由社区结案(已解决+未解决)的项目总数', - `STREET_CLOSED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '当前网格内出来的项目:由街道结案(已解决+未解决)的项目总数', - `DISTRICT_DEPT_CLOSED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '当前网格内出来的项目:由区直部门(已解决+未解决)结案的项目总数', - `DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除、1已删除', - `REVISION` int(11) NOT NULL DEFAULT '0' 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`) USING BTREE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='网格的治理指数,按天统计'; - -# 小组成员添加是否是党员 -ALTER TABLE `epmet_data_statistical`.`fact_origin_group_member_daily` - ADD COLUMN `IS_PARTY` tinyint(1) NULL DEFAULT 0 COMMENT '是否是党员' AFTER `ACTION_CODE`; - -# 项目主表添加结案项目是否满意 -ALTER TABLE `epmet_data_statistical`.`fact_origin_project_main_daily` - ADD COLUMN `IS_SATISFIED` tinyint(1) NULL COMMENT '是否满意 1:是' AFTER `IS_OVERDUE`; - -# 添加治理能力按日统计表 -CREATE TABLE `epmet_evaluation_index`.`screen_govern_rank_data_daily` ( - `ID` varchar(64) NOT NULL COMMENT 'ID 主键', - `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', - `YEAR_ID` varchar(32) NOT NULL COMMENT '年Id', - `MONTH_ID` varchar(32) NOT NULL COMMENT '月份Id', - `DATE_ID` varchar(8) NOT NULL COMMENT '数据更新至:yyyyMMdd', - `ORG_TYPE` varchar(32) NOT NULL DEFAULT 'agency' COMMENT '组织类别 agency:组织;部门:department;网格:grid', - `ORG_ID` varchar(64) NOT NULL COMMENT '组织Id 可以为网格,机关id', - `PARENT_ID` varchar(64) NOT NULL COMMENT '上级组织Id', - `ORG_NAME` varchar(32) NOT NULL COMMENT '组织名称', - `RESPONSE_RATIO` decimal(10,6) DEFAULT NULL COMMENT '响应率', - `RESOLVED_RATIO` decimal(10,6) DEFAULT NULL COMMENT '解决率', - `GOVERN_RATIO` decimal(10,6) DEFAULT NULL COMMENT '自治率', - `SATISFACTION_RATIO` decimal(10,6) DEFAULT NULL COMMENT '满意率', - `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除', - `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 +# -- epmet_data_statistical新增两张表,治理指数网格按天统计,治理指数按组织按天统计 +# +# CREATE TABLE `fact_agency_govern_daily` ( +# `ID` varchar(64) NOT NULL COMMENT '主键,customer_id+AGENCY_ID+date_id只有一条记录', +# `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', +# `DATE_ID` varchar(8) NOT NULL COMMENT '数据更新至:yyyyMMdd; ', +# `AGENCY_ID` varchar(64) NOT NULL COMMENT '组织id', +# `LEVEL` varchar(30) NOT NULL COMMENT 'agency_id所属的机关级别(社区级:community,\r\n乡(镇、街道)级:street,\r\n区县级: district,\r\n市级: city\r\n省级:province)', +# `PID` varchar(64) NOT NULL COMMENT '组织i所属的组织id', +# `PIDS` varchar(255) NOT NULL COMMENT '组织i所有上级id', +# `PROBLEM_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '界面展示:问题解决总数=1+2+3+4+5+6+7+8', +# `GROUP_SELF_GOVERN_RATIO` decimal(10,6) NOT NULL COMMENT '界面展示:党群自治占比=(9+10)/PROBLEM_RESOLVED_COUNT; 此列存储的是小数', +# `GRID_SELF_GOVERN_RATIO` decimal(10,6) NOT NULL COMMENT '界面展示:网格自治占比=GRID_SELF_GOVERN_PROJECT_TOTAL/PROBLEM_RESOLVED_COUNT;此列存储的是小数', +# `COMMUNITY_CLOSED_RATIO` decimal(10,6) NOT NULL COMMENT '界面展示:社区解决占比=COMMUNITY_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数', +# `STREET_CLOSED_RATIO` decimal(10,6) NOT NULL COMMENT '界面展示:街道解决占比=STREET_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数', +# `DISTRICT_DEPT_CLOSED_RATIO` decimal(10,6) NOT NULL COMMENT '界面展示:区直部门解决占比=DISTRICT_DEPT_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数', +# `TOPIC_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '1、当前组织内,话题关闭已解决数', +# `TOPIC_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '2、当前组织内,话题关闭无需解决数', +# `ISSUE_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '3、当前组织内,议题关闭已解决数', +# `ISSUE_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '4、当前组织内,议题关闭无需解决数', +# `ISSUE_PROJECT_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '5、当前组织内:来源于议题的项目:结案已解决数', +# `ISSUE_PROJECT_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '6、当前组织内:来源于议题的项目:结案无需解决数', +# `APPROVAL_PROJECT_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '7、当前组织内:项目立项,结案已解决数;默认为0,', +# `APPROVAL_PROJECT_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '8、当前组织内:项目立项,结案无需解决数;默认为0,', +# `IN_GROUP_TOPIC_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '9、当前组织内,未出小组即未转议题的:话题关闭已解决数', +# `IN_GROUP_TOPIC_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '10、当前组织内,未出小组即未转议题的:话题关闭无需解决数', +# `GRID_SELF_GOVERN_PROJECT_TOTAL` int(11) NOT NULL DEFAULT '0' COMMENT '11、未出当前网格的,结案项目数', +# `COMMUNITY_CLOSED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '当前组织内结案的项目中:由社区结案的项目总数', +# `STREET_CLOSED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '当前组织内结案的项目中:由街道结案的项目总数', +# `DISTRICT_DEPT_CLOSED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '当前组织内结案的项目中:由区直部门结案的项目总数', +# `DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除、1已删除', +# `REVISION` int(11) NOT NULL DEFAULT '0' 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`) USING BTREE +# ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='组织的治理指数,按天统计'; +# +# CREATE TABLE `fact_grid_govern_daily` ( +# `ID` varchar(64) NOT NULL COMMENT '主键,customer_id+grid_id+date_id只有一条记录', +# `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', +# `DATE_ID` varchar(8) NOT NULL COMMENT '数据更新至:yyyyMMdd; ', +# `GRID_ID` varchar(64) NOT NULL COMMENT '网格id', +# `PID` varchar(64) NOT NULL COMMENT '网格所属的组织id', +# `PIDS` varchar(255) NOT NULL COMMENT '网格所有上级id', +# `PROBLEM_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '界面展示:问题解决总数=1+2+3+4+5+6+7+8', +# `GROUP_SELF_GOVERN_RATIO` decimal(10,6) NOT NULL COMMENT '界面展示:党群自治占比=(9+10)/PROBLEM_RESOLVED_COUNT; 此列存储的是小数', +# `GRID_SELF_GOVERN_RATIO` decimal(10,6) NOT NULL COMMENT '界面展示:网格自治占比=GRID_SELF_GOVERN_PROJECT_TOTAL/PROBLEM_RESOLVED_COUNT;此列存储的是小数', +# `COMMUNITY_CLOSED_RATIO` decimal(10,6) NOT NULL COMMENT '界面展示:社区解决占比=COMMUNITY_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数', +# `STREET_CLOSED_RATIO` decimal(10,6) NOT NULL COMMENT '界面展示:街道解决占比=STREET_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数', +# `DISTRICT_DEPT_CLOSED_RATIO` decimal(10,6) NOT NULL COMMENT '界面展示:区直部门解决占比=DISTRICT_DEPT_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数', +# `TOPIC_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '1、当前网格内,话题关闭已解决数', +# `TOPIC_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '2、当前网格内,话题关闭无需解决数', +# `ISSUE_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '3、当前网格内,议题关闭已解决数', +# `ISSUE_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '4、当前网格内,议题关闭无需解决数', +# `ISSUE_PROJECT_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '5、当前网格内:来源于议题的项目:结案已解决数', +# `ISSUE_PROJECT_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '6、当前网格内:来源于议题的项目:结案无需解决数', +# `APPROVAL_PROJECT_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '7、当前网格内:项目立项,结案已解决数;默认为0,', +# `APPROVAL_PROJECT_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '8、当前网格内:项目立项,结案无需解决数;默认为0,', +# `IN_GROUP_TOPIC_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '9、当前网格内,未出小组即未转议题的:话题关闭已解决数', +# `IN_GROUP_TOPIC_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '10、当前网格内,未出小组即未转议题的:话题关闭无需解决数', +# `FROM_ISSUE_RESOLVED_IN_GRID_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '11、来源于议题的项目,未出网格结案并且已解决的项目数', +# `FROM_ISSUE_UN_RESOLVED_IN_GRID_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '12、来源于议题的项目,未出网格结案并且无需解决的项目数', +# `FROM_AGENCY_RESOLVED_IN_GRID_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '13、来源于项目立项的项目,未出网格结案,并且已解决的项目数;因现在网格不能立项,所以此列默认为0', +# `FROM_AGENCY_UN_RESOLVED_IN_GRID_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '14、来源于项目立项的项目,未出网格结案,并且无需解决的项目数;因现在网格不能立项,所以此列默认为0', +# `GRID_SELF_GOVERN_PROJECT_TOTAL` int(11) NOT NULL COMMENT '15、未出当前网格的,结案项目数=11+12+13+14', +# `COMMUNITY_CLOSED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '当前网格内出来的项目:由社区结案(已解决+未解决)的项目总数', +# `STREET_CLOSED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '当前网格内出来的项目:由街道结案(已解决+未解决)的项目总数', +# `DISTRICT_DEPT_CLOSED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '当前网格内出来的项目:由区直部门(已解决+未解决)结案的项目总数', +# `DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除、1已删除', +# `REVISION` int(11) NOT NULL DEFAULT '0' 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`) USING BTREE +# ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='网格的治理指数,按天统计'; +# +# # 小组成员添加是否是党员 +# ALTER TABLE `epmet_data_statistical`.`fact_origin_group_member_daily` +# ADD COLUMN `IS_PARTY` tinyint(1) NULL DEFAULT 0 COMMENT '是否是党员' AFTER `ACTION_CODE`; +# +# # 项目主表添加结案项目是否满意 +# ALTER TABLE `epmet_data_statistical`.`fact_origin_project_main_daily` +# ADD COLUMN `IS_SATISFIED` tinyint(1) NULL COMMENT '是否满意 1:是' AFTER `IS_OVERDUE`; +# +# # 添加治理能力按日统计表 +# CREATE TABLE `epmet_evaluation_index`.`screen_govern_rank_data_daily` ( +# `ID` varchar(64) NOT NULL COMMENT 'ID 主键', +# `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', +# `YEAR_ID` varchar(32) NOT NULL COMMENT '年Id', +# `MONTH_ID` varchar(32) NOT NULL COMMENT '月份Id', +# `DATE_ID` varchar(8) NOT NULL COMMENT '数据更新至:yyyyMMdd', +# `ORG_TYPE` varchar(32) NOT NULL DEFAULT 'agency' COMMENT '组织类别 agency:组织;部门:department;网格:grid', +# `ORG_ID` varchar(64) NOT NULL COMMENT '组织Id 可以为网格,机关id', +# `PARENT_ID` varchar(64) NOT NULL COMMENT '上级组织Id', +# `ORG_NAME` varchar(32) NOT NULL COMMENT '组织名称', +# `RESPONSE_RATIO` decimal(10,6) DEFAULT NULL COMMENT '响应率', +# `RESOLVED_RATIO` decimal(10,6) DEFAULT NULL COMMENT '解决率', +# `GOVERN_RATIO` decimal(10,6) DEFAULT NULL COMMENT '自治率', +# `SATISFACTION_RATIO` decimal(10,6) DEFAULT NULL COMMENT '满意率', +# `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除', +# `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='基层治理-治理能力排行数据(按日统计)'; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.16__add_shiftIssue.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.16__add_shiftIssue.sql index 367af0a9b7..36b0235e8a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.16__add_shiftIssue.sql +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.16__add_shiftIssue.sql @@ -1 +1 @@ -ALTER TABLE `fact_origin_topic_main_daily` ADD `SHIFT_ISSUE` tinyint(1) NOT NULL default '0' COMMENT '是否转为议题,0:false,1:true' AFTER `CREATE_TOPIC_USER_IS_PARTY`; \ No newline at end of file +# ALTER TABLE `fact_origin_topic_main_daily` ADD `SHIFT_ISSUE` tinyint(1) NOT NULL default '0' COMMENT '是否转为议题,0:false,1:true' AFTER `CREATE_TOPIC_USER_IS_PARTY`; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.17__inxdex_explain.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.17__inxdex_explain.sql index 15cca09546..fcd6893485 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.17__inxdex_explain.sql +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.17__inxdex_explain.sql @@ -1,113 +1,113 @@ -CREATE TABLE `index_explain` ( - `ID` varchar(64) NOT NULL COMMENT '主键', - `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', - `TITLE` varchar(32) NOT NULL COMMENT '名称', - `INDEX_CODE` varchar(256) NOT NULL COMMENT '指标code', - `MEANING` varchar(256) NOT NULL COMMENT '含义', - `ORG_LEVEL` varchar(16) NOT NULL COMMENT '组织级别(网格级:grid;社区级:community;乡(镇、街道)级:street;区县级: district;市级: city;省级:province)', - `PID` varchar(16) NOT NULL COMMENT '父ID', - `SORT` int(11) NOT NULL COMMENT '排序', - `IS_SEARCH` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否需要查询;1有;0:无;', - `TYPE` varchar(16) NOT NULL DEFAULT 'none' COMMENT '数据类型:none;本级:self;下级:sub', - `DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标记 0:未删除,1:已删除', - `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', - `CREATED_BY` varchar(32) NOT NULL DEFAULT 'app_user' COMMENT '创建人', - `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', - `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', - `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', - PRIMARY KEY (`ID`) USING BTREE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='指标说明文案'; - -#插入指标结束 -BEGIN; -INSERT INTO `index_explain` VALUES ('1', 'default', '党建指数', '', '自然月周期内,党建指数得分=本级党建指数得分+下级党建指数得分', 'grid', '0', 1, 0, 'none', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); -INSERT INTO `index_explain` VALUES ('10', 'default', '1/2下级党建指数得分', 'shequxiangguan:dangjiannengli', '下级党建指数得分=下级所有网格党建指数的平均值*相关权重', 'community', '8', 2, 1, 'xiaji', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); -INSERT INTO `index_explain` VALUES ('11', 'default', '治理指数', '', '含义:自然月周期内,治理指数得分=本级治理指数得分+下级治理指数得分', 'community', '0', 4, 0, 'none', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); -INSERT INTO `index_explain` VALUES ('12', 'default', '2/1本级治理指数得分', 'shequxiangguan:zhilinengli', '本级治理指数得分=网格各项治理指数指标数据得分*相关权重之和', 'community', '11', 1, 1, 'zishen', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); -INSERT INTO `index_explain` VALUES ('13', 'default', '2/2下级治理指数得分', 'shequxiangguan:zhilinengli', '下级治理指数得分=组织内党员的参与议事指数考评分(平均值)*相关权重', 'community', '11', 2, 1, 'xiaji', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); -INSERT INTO `index_explain` VALUES ('14', 'default', '服务指数', '', '含义:自然月周期内,服务指数得分=本级服务指数得分+下级服务指数得分', 'community', '0', 3, 0, 'none', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); -INSERT INTO `index_explain` VALUES ('15', 'default', '3/1本级服务指数得分', 'shequxiangguan:fuwunengli', '本级服务指数得分=社区活动组织次数得分*相关权重', 'community', '14', 1, 1, 'zishen', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); -INSERT INTO `index_explain` VALUES ('16', 'default', '3/2下级服务指数得分', 'shequxiangguan:fuwunengli', '下级服务指数得分=社区下级所有网格服务指数得分(平均值)*相关权重', 'community', '14', 2, 1, 'xiaji', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); -INSERT INTO `index_explain` VALUES ('17', 'default', '党建指数', '', '自然月周期内,党建指数得分=本级党建指数得分+下级党建指数得分', 'street', '0', 5, 0, 'none', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); -INSERT INTO `index_explain` VALUES ('18', 'default', '1/1本级党建指数得分', 'jiedaoxiangguan:dangjiannengli', '本级党建指数得分=社区名义发文数量得分*相关权重', 'street', '17', 1, 1, 'zishen', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); -INSERT INTO `index_explain` VALUES ('19', 'default', '1/2下级党建指数得分', 'jiedaoxiangguan:dangjiannengli', '下级党建指数得分=下级所有网格党建指数的平均值*相关权重', 'street', '17', 2, 1, 'xiaji', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); -INSERT INTO `index_explain` VALUES ('2', 'default', '1/1本级党建指数得分', 'wanggexiangguan:dangjiannengli', '本级党建指数得分=网格各项党建指数指标数据得分*相关权重之和', 'grid', '1', 1, 1, 'zishen', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); -INSERT INTO `index_explain` VALUES ('20', 'default', '治理指数', '', '含义:自然月周期内,治理指数得分=本级治理指数得分+下级治理指数得分', 'street', '0', 6, 0, 'none', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); -INSERT INTO `index_explain` VALUES ('21', 'default', '2/1本级治理指数得分', 'jiedaoxiangguan:zhilinengli', '本级治理指数得分=网格各项治理指数指标数据得分*相关权重之和', 'street', '20', 1, 1, 'zishen', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); -INSERT INTO `index_explain` VALUES ('22', 'default', '2/2下级治理指数得分', 'jiedaoxiangguan:zhilinengli', '下级治理指数得分=组织内党员的参与议事指数考评分(平均值)*相关权重', 'street', '20', 2, 1, 'xiaji', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); -INSERT INTO `index_explain` VALUES ('23', 'default', '服务指数', '', '含义:自然月周期内,服务指数得分=本级服务指数得分+下级服务指数得分', 'street', '0', 7, 0, 'none', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); -INSERT INTO `index_explain` VALUES ('24', 'default', '3/1本级服务指数得分', 'jiedaoxiangguan:fuwunengli', '本级服务指数得分=社区活动组织次数得分*相关权重', 'street', '23', 1, 1, 'zishen', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); -INSERT INTO `index_explain` VALUES ('25', 'default', '3/2下级服务指数得分', 'jiedaoxiangguan:fuwunengli', '下级服务指数得分=社区下级所有网格服务指数得分(平均值)*相关权重', 'street', '23', 2, 1, 'xiaji', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); -INSERT INTO `index_explain` VALUES ('26', 'default', '党建指数', '', '含义:自然月周期内,党建指数得分=本级党建指数得分+下级党建指数得分', 'district', '0', 1, 0, 'none', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); -INSERT INTO `index_explain` VALUES ('27', 'default', '1/1本级党建指数得分', 'quanquxiangguan:dangjiannengli', '本级党建指数得分=区名义发文数量得分*相关权重', 'district', '26', 1, 1, 'zishen', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); -INSERT INTO `index_explain` VALUES ('28', 'default', '1/2下级党建指数得分', 'quanquxiangguan:dangjiannengli', '下级党建指数得分=区下级街道党建指数汇总(平均值)*相关权重', 'district', '26', 2, 1, 'xiaji', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); -INSERT INTO `index_explain` VALUES ('29', 'default', '治理指数', '', '含义:自然月周期内,治理指数得分=所有街道治理指数(平均值)*相关权重(d%)+所有直属部门治理指数(平均值)*相关权重(d%)', 'district', '0', 2, 0, 'none', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); -INSERT INTO `index_explain` VALUES ('3', 'default', '1/2下级党建指数得分', 'dangyuanxiangguan:lianxiqunzhong', '下级党建指数得分=组织内党员的联系群众指数考评分(平均值)*相关权重', 'grid', '1', 2, 1, 'xiaji', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); -INSERT INTO `index_explain` VALUES ('30', 'default', '2/1所有街道治理指数(平均值)', 'quanquxiangguan:zhilinengli', '所有街道治理指数(平均值)得分=区下级所有街道治理指数得分总和/街道总数', 'district', '29', 1, 1, 'xiaji', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); -INSERT INTO `index_explain` VALUES ('31', 'default', '2/2所有直属部门治理指数(平均值)', 'quzhibumen:zhilinengli', '所有指数部门治理指数(平均值)得分=区直部门各项治理指数指标数据平均分*相关权重之和', 'district', '29', 2, 1, 'xiaji', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); -INSERT INTO `index_explain` VALUES ('32', 'default', '服务指数', 'quanquxiangguan:fuwunengli', '含义:自然月周期内,服务指数得分=区下属街道服务指数汇总(平均值)=区下属所有街道服务指数得分之和/街道总数', 'district', '0', 3, 1, 'xiaji', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); -INSERT INTO `index_explain` VALUES ('4', 'default', '治理指数', '', '含义:自然月周期内,治理指数得分=本级治理指数得分+下级治理指数得分', 'grid', '0', 2, 0, 'none', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); -INSERT INTO `index_explain` VALUES ('5', 'default', '2/1本级治理指数得分', 'wanggexiangguan:zhilinengli', '本级治理指数得分=网格各项治理指数指标数据得分*相关权重之和', 'grid', '4', 1, 1, 'zishen', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); -INSERT INTO `index_explain` VALUES ('6', 'default', '2/2下级治理指数得分', 'dangyuanxiangguan:canyuyishi', '下级治理指数得分=组织内党员的参与议事指数考评分(平均值)*相关权重', 'grid', '4', 2, 1, 'xiaji', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); -INSERT INTO `index_explain` VALUES ('7', 'default', '服务指数', 'wanggexiangguan:fuwunengli', '含义:自然月周期内,服务指数得分=活动组织次数得分*相关权重+志愿者占比得分*相关权重+党员志愿者率得分*相关权重', 'grid', '0', 3, 1, 'zishen', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); -INSERT INTO `index_explain` VALUES ('8', 'default', '党建指数', '', '自然月周期内,党建指数得分=本级党建指数得分+下级党建指数得分', 'community', '0', 1, 0, 'none', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); -INSERT INTO `index_explain` VALUES ('9', 'default', '1/1本级党建指数得分', 'shequxiangguan:dangjiannengli', '本级党建指数得分=社区名义发文数量得分*相关权重', 'community', '8', 1, 1, 'zishen', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); -COMMIT; - -#更新含义 -update index_dict SET INDEX_DESC='自然月周期内,网格内注册群众用户数。' WHERE INDEX_CODE = 'wanggequnzhongyhs'; -update index_dict SET INDEX_DESC='自然月周期内,网格内注册党员用户数。' WHERE INDEX_CODE = 'wanggedangyuanyhs'; -update index_dict SET INDEX_DESC='自然月周期内,参与话题、事件评论、点赞、点踩总次数大于给定阈值的群众用户。' WHERE INDEX_CODE = 'wanggehuoyueqzyhs'; -update index_dict SET INDEX_DESC='自然月周期内,参与话题、事件评论、点赞、点踩总次数大于给定阈值的党员用户。' WHERE INDEX_CODE = 'wanggehuoyuedyyhs'; -update index_dict SET INDEX_DESC='自然月周期内,网格内党员提出的总话题数与党员人数之比。' WHERE INDEX_CODE = 'wanggedangyuanrjtchts'; -update index_dict SET INDEX_DESC='自然月周期内,网格内群众提出的总话题数与群众人数之比。' WHERE INDEX_CODE = 'wanggequnzhongrjtchts'; -update index_dict SET INDEX_DESC='自然月周期内,网格内所有党员提出的议题转为项目的数目与党员人数之比。' WHERE INDEX_CODE = 'wanggedangyuanrjtcdytzxms'; -update index_dict SET INDEX_DESC='自然月周期内,网格内所有群众提出的议题转为项目的数目与群众人数之比。' WHERE INDEX_CODE = 'wanggequnzhongrjtcdytzxms'; -update index_dict SET INDEX_DESC='自然月周期内,党员自建群(群主)数量。' WHERE INDEX_CODE = 'jianqundangyuans'; -update index_dict SET INDEX_DESC='自然月周期内,党员自建群群众人数乘相关权重、党员自建群活跃群众人数乘相关权重、党员自建群活跃度-话题数乘相关权重与自建群活跃度-议题转项目率乘相关权重之和' WHERE INDEX_CODE = 'zuzhineidangydlxqznlkpfpjz'; -update index_dict SET INDEX_DESC='自然月周期内,网格内所有发文数量' WHERE INDEX_CODE = 'wanggedifawsl'; -update index_dict SET INDEX_DESC='自然月周期内,已转项目议题数与近两个自然月内议题总数之比' WHERE INDEX_CODE = 'wanggeyitizxml'; -update index_dict SET INDEX_DESC='自然月周期内,本网格内注册党员活动签到次数。' WHERE INDEX_CODE = 'dangyuancanjiashykrc'; -update index_dict SET INDEX_DESC='自然月周期内,社区下所有网格党建指数得分之和与网格总数之比' WHERE INDEX_CODE = 'xiashusuoyouwgddjnlpjz'; -update index_dict SET INDEX_DESC='自然月周期内,街道下所有社区党建指数得分之和与网格总数之比' WHERE INDEX_CODE = 'jiedaoxiashusysqdjnlhzpjz'; -update index_dict SET INDEX_DESC='自然月周期内,街道内所有发文数量' WHERE INDEX_CODE = 'jiedaomingyifwsl'; -update index_dict SET INDEX_DESC='自然月周期内,区下级所有街道党建指数得分之和与街道总数之比' WHERE INDEX_CODE = 'quxiajijieddjnlhzpjz'; -update index_dict SET INDEX_DESC='自然月周期内,区内所有发文数量' WHERE INDEX_CODE = 'qumingyifawsl'; -update index_dict SET INDEX_DESC='自然月周期内,党员提出话题数乘相关权重、党员参与话题数乘相关权重、党员提出的话题转议题数乘相关权重与党员提出的议题转项目数乘相关权重之和' WHERE INDEX_CODE = 'zuzhineidangydcyysnlkpfpjz'; -update index_dict SET INDEX_DESC='自然月周期内,网格内成员提出议题的总数量' WHERE INDEX_CODE = 'wanggezongyitsm'; -update index_dict SET INDEX_DESC='自然月周期内,新增议题数与发布议题人数去重之比' WHERE INDEX_CODE = 'wanggerenjunytsm'; -update index_dict SET INDEX_DESC='自然月周期内,议题转化的项目数' WHERE INDEX_CODE = 'wanggezongxiangms'; -update index_dict SET INDEX_DESC='自然月周期内,从议题创建到项目关闭,包括处理人,没有出过议题所属网格的项目数。' WHERE INDEX_CODE = 'wanggezizhixms'; -update index_dict SET INDEX_DESC='自然月周期内,办结的项目数' WHERE INDEX_CODE = 'wanggebanjiexms'; -update index_dict SET INDEX_DESC='自然月周期内,未被退回的项目数与项目总数之比' WHERE INDEX_CODE = 'wanggechuishaobmzql'; -update index_dict SET INDEX_DESC='自然月周期内,网格内自治办结项目的满意度评价的平均分(非常满意100,满意80,一般60)' WHERE INDEX_CODE = 'wanggeneijiejdxmdmyd'; -update index_dict SET INDEX_DESC='自然月周期内,社区下所有网格治理指数得分之和与网格总数之比' WHERE INDEX_CODE = 'shequxiashusywgzlnlhzpjz'; -update index_dict SET INDEX_DESC='自然月周期内,社区被吹哨的次数' WHERE INDEX_CODE = 'shequbeichuiscs'; -update index_dict SET INDEX_DESC='自然月周期内,社区办结项目数目' WHERE INDEX_CODE = 'shequbanjiexms'; -update index_dict SET INDEX_DESC='自然月周期内,项目受理时长(分钟)与项目数之比' WHERE INDEX_CODE = 'shequxiangmuxyd'; -update index_dict SET INDEX_DESC='自然月周期内,超期项目数与结案项目数之比' WHERE INDEX_CODE = 'shequchaoqixml'; -update index_dict SET INDEX_DESC='自然月周期内,社区办结项目数目' WHERE INDEX_CODE = 'shequbanjiexml'; -update index_dict SET INDEX_DESC='自然月周期内,社区级办结项目的满意度评价的平均分(非常满意100,满意80,一般60)' WHERE INDEX_CODE = 'shequbanjiexmmyd'; -update index_dict SET INDEX_DESC='自然月周期内,街道下所有社区治理指数得分之和与社区总数之比' WHERE INDEX_CODE = 'jiedaoxiashusysqzlnlhz'; -update index_dict SET INDEX_DESC='自然月周期内,街道被吹哨的次数' WHERE INDEX_CODE = 'jiedaobeichuiscs'; -update index_dict SET INDEX_DESC='自然月周期内,街道办结项目数目' WHERE INDEX_CODE = 'jiedaobanjiexms'; -update index_dict SET INDEX_DESC='自然月周期内,项目受理时长(分钟)与项目数之比' WHERE INDEX_CODE = 'jiedaoxiangmuxyd'; -update index_dict SET INDEX_DESC='自然月周期内,办结项目的平均处理时长的倒数' WHERE INDEX_CODE = 'jiedaobanjiexmdclxl'; -update index_dict SET INDEX_DESC='自然月周期内,街道级办结项目数目与街道级尚未办结的项目数的比例' WHERE INDEX_CODE = 'jiedaoxiangmubjl'; -update index_dict SET INDEX_DESC='自然月周期内,街道级办结项目的满意度评价的平均分(非常满意100,满意80,一般60)' WHERE INDEX_CODE = 'jiedaojixiangmmyd'; -update index_dict SET INDEX_DESC='自然月周期内,区直部门被吹哨的次数' WHERE INDEX_CODE = 'quzhibumenbcscs'; -update index_dict SET INDEX_DESC='自然月周期内,区直部门办结项目数目' WHERE INDEX_CODE = 'quzhibumenbjxms'; -update index_dict SET INDEX_DESC='自然月周期内,项目受理时长(分钟)与项目数之比' WHERE INDEX_CODE = 'quzhibumenxmxyd'; -update index_dict SET INDEX_DESC='自然月周期内,办结项目的平均处理时长的倒数' WHERE INDEX_CODE = 'quzhibumenbjxmdclxl'; -update index_dict SET INDEX_DESC='自然月周期内,区直部门办结项目数目与区直部门尚未办结的项目数的比例' WHERE INDEX_CODE = 'quzhibumenxmbjl'; -update index_dict SET INDEX_DESC='自然月周期内,区直部门办结项目的满意度评价的平均分(非常满意100,满意80,一般60)' WHERE INDEX_CODE = 'quzhibumenxmmyd'; -update index_dict SET INDEX_DESC='所有指数部门治理指数(平均值)得分=区直部门各项治理指数指标数据平均分*相关权重之和' WHERE INDEX_CODE = 'suoyouzhishubmzlnlpjz'; -update index_dict SET INDEX_DESC='自然月周期内,网格内爱心活动组织次数。' WHERE INDEX_CODE = 'wanggehuodongzzcs'; -update index_dict SET INDEX_DESC='自然月周期内,志愿者内党员数与志愿者总数之比' WHERE INDEX_CODE = 'wanggezhiyuanzzb'; -update index_dict SET INDEX_DESC='自然月周期内,网格内党员志愿者总数与网格党员总人数之比。' WHERE INDEX_CODE = 'wanggedangyuanzyzl'; -update index_dict SET INDEX_DESC='自然月周期内,社区下所有网格服务指数得分之和与网格总数之比' WHERE INDEX_CODE = 'shequxiajisywgfwnldfpjz'; -update index_dict SET INDEX_DESC='自然月周期内,社区内爱心活动组织次数。' WHERE INDEX_CODE = 'shequhuodongzzcs'; -update index_dict SET INDEX_DESC='自然月周期内,街道下所有社区服务指数得分之和与社区总数之比' WHERE INDEX_CODE = 'jiedaoxiashusqfwnldfpjz'; -update index_dict SET INDEX_DESC='自然月周期内,街道内爱心活动组织次数。' WHERE INDEX_CODE = 'jiedaohuodongzzcs'; -update index_dict SET INDEX_DESC='自然月周期内,区下级所有街道服务指数得分之和与街道总数之比' WHERE INDEX_CODE = 'quxiashujiedfwnlhzpjz'; - +# CREATE TABLE `index_explain` ( +# `ID` varchar(64) NOT NULL COMMENT '主键', +# `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', +# `TITLE` varchar(32) NOT NULL COMMENT '名称', +# `INDEX_CODE` varchar(256) NOT NULL COMMENT '指标code', +# `MEANING` varchar(256) NOT NULL COMMENT '含义', +# `ORG_LEVEL` varchar(16) NOT NULL COMMENT '组织级别(网格级:grid;社区级:community;乡(镇、街道)级:street;区县级: district;市级: city;省级:province)', +# `PID` varchar(16) NOT NULL COMMENT '父ID', +# `SORT` int(11) NOT NULL COMMENT '排序', +# `IS_SEARCH` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否需要查询;1有;0:无;', +# `TYPE` varchar(16) NOT NULL DEFAULT 'none' COMMENT '数据类型:none;本级:self;下级:sub', +# `DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标记 0:未删除,1:已删除', +# `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', +# `CREATED_BY` varchar(32) NOT NULL DEFAULT 'app_user' COMMENT '创建人', +# `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', +# `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', +# `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', +# PRIMARY KEY (`ID`) USING BTREE +# ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='指标说明文案'; +# +# #插入指标结束 +# BEGIN; +# INSERT INTO `index_explain` VALUES ('1', 'default', '党建指数', '', '自然月周期内,党建指数得分=本级党建指数得分+下级党建指数得分', 'grid', '0', 1, 0, 'none', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +# INSERT INTO `index_explain` VALUES ('10', 'default', '1/2下级党建指数得分', 'shequxiangguan:dangjiannengli', '下级党建指数得分=下级所有网格党建指数的平均值*相关权重', 'community', '8', 2, 1, 'xiaji', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +# INSERT INTO `index_explain` VALUES ('11', 'default', '治理指数', '', '含义:自然月周期内,治理指数得分=本级治理指数得分+下级治理指数得分', 'community', '0', 4, 0, 'none', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +# INSERT INTO `index_explain` VALUES ('12', 'default', '2/1本级治理指数得分', 'shequxiangguan:zhilinengli', '本级治理指数得分=网格各项治理指数指标数据得分*相关权重之和', 'community', '11', 1, 1, 'zishen', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +# INSERT INTO `index_explain` VALUES ('13', 'default', '2/2下级治理指数得分', 'shequxiangguan:zhilinengli', '下级治理指数得分=组织内党员的参与议事指数考评分(平均值)*相关权重', 'community', '11', 2, 1, 'xiaji', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +# INSERT INTO `index_explain` VALUES ('14', 'default', '服务指数', '', '含义:自然月周期内,服务指数得分=本级服务指数得分+下级服务指数得分', 'community', '0', 3, 0, 'none', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +# INSERT INTO `index_explain` VALUES ('15', 'default', '3/1本级服务指数得分', 'shequxiangguan:fuwunengli', '本级服务指数得分=社区活动组织次数得分*相关权重', 'community', '14', 1, 1, 'zishen', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +# INSERT INTO `index_explain` VALUES ('16', 'default', '3/2下级服务指数得分', 'shequxiangguan:fuwunengli', '下级服务指数得分=社区下级所有网格服务指数得分(平均值)*相关权重', 'community', '14', 2, 1, 'xiaji', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +# INSERT INTO `index_explain` VALUES ('17', 'default', '党建指数', '', '自然月周期内,党建指数得分=本级党建指数得分+下级党建指数得分', 'street', '0', 5, 0, 'none', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +# INSERT INTO `index_explain` VALUES ('18', 'default', '1/1本级党建指数得分', 'jiedaoxiangguan:dangjiannengli', '本级党建指数得分=社区名义发文数量得分*相关权重', 'street', '17', 1, 1, 'zishen', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +# INSERT INTO `index_explain` VALUES ('19', 'default', '1/2下级党建指数得分', 'jiedaoxiangguan:dangjiannengli', '下级党建指数得分=下级所有网格党建指数的平均值*相关权重', 'street', '17', 2, 1, 'xiaji', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +# INSERT INTO `index_explain` VALUES ('2', 'default', '1/1本级党建指数得分', 'wanggexiangguan:dangjiannengli', '本级党建指数得分=网格各项党建指数指标数据得分*相关权重之和', 'grid', '1', 1, 1, 'zishen', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +# INSERT INTO `index_explain` VALUES ('20', 'default', '治理指数', '', '含义:自然月周期内,治理指数得分=本级治理指数得分+下级治理指数得分', 'street', '0', 6, 0, 'none', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +# INSERT INTO `index_explain` VALUES ('21', 'default', '2/1本级治理指数得分', 'jiedaoxiangguan:zhilinengli', '本级治理指数得分=网格各项治理指数指标数据得分*相关权重之和', 'street', '20', 1, 1, 'zishen', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +# INSERT INTO `index_explain` VALUES ('22', 'default', '2/2下级治理指数得分', 'jiedaoxiangguan:zhilinengli', '下级治理指数得分=组织内党员的参与议事指数考评分(平均值)*相关权重', 'street', '20', 2, 1, 'xiaji', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +# INSERT INTO `index_explain` VALUES ('23', 'default', '服务指数', '', '含义:自然月周期内,服务指数得分=本级服务指数得分+下级服务指数得分', 'street', '0', 7, 0, 'none', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +# INSERT INTO `index_explain` VALUES ('24', 'default', '3/1本级服务指数得分', 'jiedaoxiangguan:fuwunengli', '本级服务指数得分=社区活动组织次数得分*相关权重', 'street', '23', 1, 1, 'zishen', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +# INSERT INTO `index_explain` VALUES ('25', 'default', '3/2下级服务指数得分', 'jiedaoxiangguan:fuwunengli', '下级服务指数得分=社区下级所有网格服务指数得分(平均值)*相关权重', 'street', '23', 2, 1, 'xiaji', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +# INSERT INTO `index_explain` VALUES ('26', 'default', '党建指数', '', '含义:自然月周期内,党建指数得分=本级党建指数得分+下级党建指数得分', 'district', '0', 1, 0, 'none', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +# INSERT INTO `index_explain` VALUES ('27', 'default', '1/1本级党建指数得分', 'quanquxiangguan:dangjiannengli', '本级党建指数得分=区名义发文数量得分*相关权重', 'district', '26', 1, 1, 'zishen', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +# INSERT INTO `index_explain` VALUES ('28', 'default', '1/2下级党建指数得分', 'quanquxiangguan:dangjiannengli', '下级党建指数得分=区下级街道党建指数汇总(平均值)*相关权重', 'district', '26', 2, 1, 'xiaji', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +# INSERT INTO `index_explain` VALUES ('29', 'default', '治理指数', '', '含义:自然月周期内,治理指数得分=所有街道治理指数(平均值)*相关权重(d%)+所有直属部门治理指数(平均值)*相关权重(d%)', 'district', '0', 2, 0, 'none', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +# INSERT INTO `index_explain` VALUES ('3', 'default', '1/2下级党建指数得分', 'dangyuanxiangguan:lianxiqunzhong', '下级党建指数得分=组织内党员的联系群众指数考评分(平均值)*相关权重', 'grid', '1', 2, 1, 'xiaji', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +# INSERT INTO `index_explain` VALUES ('30', 'default', '2/1所有街道治理指数(平均值)', 'quanquxiangguan:zhilinengli', '所有街道治理指数(平均值)得分=区下级所有街道治理指数得分总和/街道总数', 'district', '29', 1, 1, 'xiaji', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +# INSERT INTO `index_explain` VALUES ('31', 'default', '2/2所有直属部门治理指数(平均值)', 'quzhibumen:zhilinengli', '所有指数部门治理指数(平均值)得分=区直部门各项治理指数指标数据平均分*相关权重之和', 'district', '29', 2, 1, 'xiaji', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +# INSERT INTO `index_explain` VALUES ('32', 'default', '服务指数', 'quanquxiangguan:fuwunengli', '含义:自然月周期内,服务指数得分=区下属街道服务指数汇总(平均值)=区下属所有街道服务指数得分之和/街道总数', 'district', '0', 3, 1, 'xiaji', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +# INSERT INTO `index_explain` VALUES ('4', 'default', '治理指数', '', '含义:自然月周期内,治理指数得分=本级治理指数得分+下级治理指数得分', 'grid', '0', 2, 0, 'none', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +# INSERT INTO `index_explain` VALUES ('5', 'default', '2/1本级治理指数得分', 'wanggexiangguan:zhilinengli', '本级治理指数得分=网格各项治理指数指标数据得分*相关权重之和', 'grid', '4', 1, 1, 'zishen', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +# INSERT INTO `index_explain` VALUES ('6', 'default', '2/2下级治理指数得分', 'dangyuanxiangguan:canyuyishi', '下级治理指数得分=组织内党员的参与议事指数考评分(平均值)*相关权重', 'grid', '4', 2, 1, 'xiaji', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +# INSERT INTO `index_explain` VALUES ('7', 'default', '服务指数', 'wanggexiangguan:fuwunengli', '含义:自然月周期内,服务指数得分=活动组织次数得分*相关权重+志愿者占比得分*相关权重+党员志愿者率得分*相关权重', 'grid', '0', 3, 1, 'zishen', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +# INSERT INTO `index_explain` VALUES ('8', 'default', '党建指数', '', '自然月周期内,党建指数得分=本级党建指数得分+下级党建指数得分', 'community', '0', 1, 0, 'none', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +# INSERT INTO `index_explain` VALUES ('9', 'default', '1/1本级党建指数得分', 'shequxiangguan:dangjiannengli', '本级党建指数得分=社区名义发文数量得分*相关权重', 'community', '8', 1, 1, 'zishen', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +# COMMIT; +# +# #更新含义 +# update index_dict SET INDEX_DESC='自然月周期内,网格内注册群众用户数。' WHERE INDEX_CODE = 'wanggequnzhongyhs'; +# update index_dict SET INDEX_DESC='自然月周期内,网格内注册党员用户数。' WHERE INDEX_CODE = 'wanggedangyuanyhs'; +# update index_dict SET INDEX_DESC='自然月周期内,参与话题、事件评论、点赞、点踩总次数大于给定阈值的群众用户。' WHERE INDEX_CODE = 'wanggehuoyueqzyhs'; +# update index_dict SET INDEX_DESC='自然月周期内,参与话题、事件评论、点赞、点踩总次数大于给定阈值的党员用户。' WHERE INDEX_CODE = 'wanggehuoyuedyyhs'; +# update index_dict SET INDEX_DESC='自然月周期内,网格内党员提出的总话题数与党员人数之比。' WHERE INDEX_CODE = 'wanggedangyuanrjtchts'; +# update index_dict SET INDEX_DESC='自然月周期内,网格内群众提出的总话题数与群众人数之比。' WHERE INDEX_CODE = 'wanggequnzhongrjtchts'; +# update index_dict SET INDEX_DESC='自然月周期内,网格内所有党员提出的议题转为项目的数目与党员人数之比。' WHERE INDEX_CODE = 'wanggedangyuanrjtcdytzxms'; +# update index_dict SET INDEX_DESC='自然月周期内,网格内所有群众提出的议题转为项目的数目与群众人数之比。' WHERE INDEX_CODE = 'wanggequnzhongrjtcdytzxms'; +# update index_dict SET INDEX_DESC='自然月周期内,党员自建群(群主)数量。' WHERE INDEX_CODE = 'jianqundangyuans'; +# update index_dict SET INDEX_DESC='自然月周期内,党员自建群群众人数乘相关权重、党员自建群活跃群众人数乘相关权重、党员自建群活跃度-话题数乘相关权重与自建群活跃度-议题转项目率乘相关权重之和' WHERE INDEX_CODE = 'zuzhineidangydlxqznlkpfpjz'; +# update index_dict SET INDEX_DESC='自然月周期内,网格内所有发文数量' WHERE INDEX_CODE = 'wanggedifawsl'; +# update index_dict SET INDEX_DESC='自然月周期内,已转项目议题数与近两个自然月内议题总数之比' WHERE INDEX_CODE = 'wanggeyitizxml'; +# update index_dict SET INDEX_DESC='自然月周期内,本网格内注册党员活动签到次数。' WHERE INDEX_CODE = 'dangyuancanjiashykrc'; +# update index_dict SET INDEX_DESC='自然月周期内,社区下所有网格党建指数得分之和与网格总数之比' WHERE INDEX_CODE = 'xiashusuoyouwgddjnlpjz'; +# update index_dict SET INDEX_DESC='自然月周期内,街道下所有社区党建指数得分之和与网格总数之比' WHERE INDEX_CODE = 'jiedaoxiashusysqdjnlhzpjz'; +# update index_dict SET INDEX_DESC='自然月周期内,街道内所有发文数量' WHERE INDEX_CODE = 'jiedaomingyifwsl'; +# update index_dict SET INDEX_DESC='自然月周期内,区下级所有街道党建指数得分之和与街道总数之比' WHERE INDEX_CODE = 'quxiajijieddjnlhzpjz'; +# update index_dict SET INDEX_DESC='自然月周期内,区内所有发文数量' WHERE INDEX_CODE = 'qumingyifawsl'; +# update index_dict SET INDEX_DESC='自然月周期内,党员提出话题数乘相关权重、党员参与话题数乘相关权重、党员提出的话题转议题数乘相关权重与党员提出的议题转项目数乘相关权重之和' WHERE INDEX_CODE = 'zuzhineidangydcyysnlkpfpjz'; +# update index_dict SET INDEX_DESC='自然月周期内,网格内成员提出议题的总数量' WHERE INDEX_CODE = 'wanggezongyitsm'; +# update index_dict SET INDEX_DESC='自然月周期内,新增议题数与发布议题人数去重之比' WHERE INDEX_CODE = 'wanggerenjunytsm'; +# update index_dict SET INDEX_DESC='自然月周期内,议题转化的项目数' WHERE INDEX_CODE = 'wanggezongxiangms'; +# update index_dict SET INDEX_DESC='自然月周期内,从议题创建到项目关闭,包括处理人,没有出过议题所属网格的项目数。' WHERE INDEX_CODE = 'wanggezizhixms'; +# update index_dict SET INDEX_DESC='自然月周期内,办结的项目数' WHERE INDEX_CODE = 'wanggebanjiexms'; +# update index_dict SET INDEX_DESC='自然月周期内,未被退回的项目数与项目总数之比' WHERE INDEX_CODE = 'wanggechuishaobmzql'; +# update index_dict SET INDEX_DESC='自然月周期内,网格内自治办结项目的满意度评价的平均分(非常满意100,满意80,一般60)' WHERE INDEX_CODE = 'wanggeneijiejdxmdmyd'; +# update index_dict SET INDEX_DESC='自然月周期内,社区下所有网格治理指数得分之和与网格总数之比' WHERE INDEX_CODE = 'shequxiashusywgzlnlhzpjz'; +# update index_dict SET INDEX_DESC='自然月周期内,社区被吹哨的次数' WHERE INDEX_CODE = 'shequbeichuiscs'; +# update index_dict SET INDEX_DESC='自然月周期内,社区办结项目数目' WHERE INDEX_CODE = 'shequbanjiexms'; +# update index_dict SET INDEX_DESC='自然月周期内,项目受理时长(分钟)与项目数之比' WHERE INDEX_CODE = 'shequxiangmuxyd'; +# update index_dict SET INDEX_DESC='自然月周期内,超期项目数与结案项目数之比' WHERE INDEX_CODE = 'shequchaoqixml'; +# update index_dict SET INDEX_DESC='自然月周期内,社区办结项目数目' WHERE INDEX_CODE = 'shequbanjiexml'; +# update index_dict SET INDEX_DESC='自然月周期内,社区级办结项目的满意度评价的平均分(非常满意100,满意80,一般60)' WHERE INDEX_CODE = 'shequbanjiexmmyd'; +# update index_dict SET INDEX_DESC='自然月周期内,街道下所有社区治理指数得分之和与社区总数之比' WHERE INDEX_CODE = 'jiedaoxiashusysqzlnlhz'; +# update index_dict SET INDEX_DESC='自然月周期内,街道被吹哨的次数' WHERE INDEX_CODE = 'jiedaobeichuiscs'; +# update index_dict SET INDEX_DESC='自然月周期内,街道办结项目数目' WHERE INDEX_CODE = 'jiedaobanjiexms'; +# update index_dict SET INDEX_DESC='自然月周期内,项目受理时长(分钟)与项目数之比' WHERE INDEX_CODE = 'jiedaoxiangmuxyd'; +# update index_dict SET INDEX_DESC='自然月周期内,办结项目的平均处理时长的倒数' WHERE INDEX_CODE = 'jiedaobanjiexmdclxl'; +# update index_dict SET INDEX_DESC='自然月周期内,街道级办结项目数目与街道级尚未办结的项目数的比例' WHERE INDEX_CODE = 'jiedaoxiangmubjl'; +# update index_dict SET INDEX_DESC='自然月周期内,街道级办结项目的满意度评价的平均分(非常满意100,满意80,一般60)' WHERE INDEX_CODE = 'jiedaojixiangmmyd'; +# update index_dict SET INDEX_DESC='自然月周期内,区直部门被吹哨的次数' WHERE INDEX_CODE = 'quzhibumenbcscs'; +# update index_dict SET INDEX_DESC='自然月周期内,区直部门办结项目数目' WHERE INDEX_CODE = 'quzhibumenbjxms'; +# update index_dict SET INDEX_DESC='自然月周期内,项目受理时长(分钟)与项目数之比' WHERE INDEX_CODE = 'quzhibumenxmxyd'; +# update index_dict SET INDEX_DESC='自然月周期内,办结项目的平均处理时长的倒数' WHERE INDEX_CODE = 'quzhibumenbjxmdclxl'; +# update index_dict SET INDEX_DESC='自然月周期内,区直部门办结项目数目与区直部门尚未办结的项目数的比例' WHERE INDEX_CODE = 'quzhibumenxmbjl'; +# update index_dict SET INDEX_DESC='自然月周期内,区直部门办结项目的满意度评价的平均分(非常满意100,满意80,一般60)' WHERE INDEX_CODE = 'quzhibumenxmmyd'; +# update index_dict SET INDEX_DESC='所有指数部门治理指数(平均值)得分=区直部门各项治理指数指标数据平均分*相关权重之和' WHERE INDEX_CODE = 'suoyouzhishubmzlnlpjz'; +# update index_dict SET INDEX_DESC='自然月周期内,网格内爱心活动组织次数。' WHERE INDEX_CODE = 'wanggehuodongzzcs'; +# update index_dict SET INDEX_DESC='自然月周期内,志愿者内党员数与志愿者总数之比' WHERE INDEX_CODE = 'wanggezhiyuanzzb'; +# update index_dict SET INDEX_DESC='自然月周期内,网格内党员志愿者总数与网格党员总人数之比。' WHERE INDEX_CODE = 'wanggedangyuanzyzl'; +# update index_dict SET INDEX_DESC='自然月周期内,社区下所有网格服务指数得分之和与网格总数之比' WHERE INDEX_CODE = 'shequxiajisywgfwnldfpjz'; +# update index_dict SET INDEX_DESC='自然月周期内,社区内爱心活动组织次数。' WHERE INDEX_CODE = 'shequhuodongzzcs'; +# update index_dict SET INDEX_DESC='自然月周期内,街道下所有社区服务指数得分之和与社区总数之比' WHERE INDEX_CODE = 'jiedaoxiashusqfwnldfpjz'; +# update index_dict SET INDEX_DESC='自然月周期内,街道内爱心活动组织次数。' WHERE INDEX_CODE = 'jiedaohuodongzzcs'; +# update index_dict SET INDEX_DESC='自然月周期内,区下级所有街道服务指数得分之和与街道总数之比' WHERE INDEX_CODE = 'quxiashujiedfwnlhzpjz'; +# diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.18__modify_index_weight_for_3.0.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.18__modify_index_weight_for_3.0.sql index 1bbb8b6e4c..deb2572649 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.18__modify_index_weight_for_3.0.sql +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.18__modify_index_weight_for_3.0.sql @@ -1,22 +1,22 @@ -#修改党员相关 三会一课权重 -UPDATE index_group_detail_template SET WEIGHT = 0.1 WHERE INDEX_CODE = 'dangwuhuodong'; -UPDATE index_group_detail_template SET WEIGHT = 0.45 WHERE INDEX_CODE = 'canyuyishi'; -UPDATE index_group_detail_template SET WEIGHT = 0.45 WHERE INDEX_CODE = 'lianxiqunzhong'; -UPDATE index_group_detail_template SET WEIGHT = 1 WHERE INDEX_CODE = 'canjiasanhykcs'; - -UPDATE index_group_detail_template SET WEIGHT = 0.26 WHERE INDEX_CODE = 'zuzhineidangydlxqznlkpfpjz'; -UPDATE index_group_detail_template SET WEIGHT = 0.26 WHERE INDEX_CODE = 'wanggedifawsl'; -UPDATE index_group_detail_template SET WEIGHT = 0.04 WHERE INDEX_CODE = 'zuzhisanhykcs'; -UPDATE index_group_detail_template SET WEIGHT = 0.04 WHERE INDEX_CODE = 'dangyuancanjiashykrc'; - -#开发和测试的 对应的客户已经修改执行完了 -#修改生产的 先给党群e事通和亿联员工互助会设置一下权重。再加上我们自己的 微笑崂山 -UPDATE index_group_detail SET WEIGHT = 0.1 WHERE CUSTOMER_ID IN ('7ae84f0ceb36397f5078187d72de3403','04c0d396e298f13e57aa5904a657eaa6','3fdd0380deff5b30f45376cdf995d1c1') AND INDEX_CODE = 'dangwuhuodong'; -UPDATE index_group_detail SET WEIGHT = 0.45 WHERE CUSTOMER_ID IN ('7ae84f0ceb36397f5078187d72de3403','04c0d396e298f13e57aa5904a657eaa6','3fdd0380deff5b30f45376cdf995d1c1') AND INDEX_CODE = 'canyuyishi'; -UPDATE index_group_detail SET WEIGHT = 0.45 WHERE CUSTOMER_ID IN ('7ae84f0ceb36397f5078187d72de3403','04c0d396e298f13e57aa5904a657eaa6','3fdd0380deff5b30f45376cdf995d1c1') AND INDEX_CODE = 'lianxiqunzhong'; -UPDATE index_group_detail SET WEIGHT = 1 WHERE CUSTOMER_ID IN ('7ae84f0ceb36397f5078187d72de3403','04c0d396e298f13e57aa5904a657eaa6','3fdd0380deff5b30f45376cdf995d1c1') AND INDEX_CODE = 'canjiasanhykcs'; - -UPDATE index_group_detail SET WEIGHT = 0.26 WHERE CUSTOMER_ID IN ('7ae84f0ceb36397f5078187d72de3403','04c0d396e298f13e57aa5904a657eaa6','3fdd0380deff5b30f45376cdf995d1c1') AND INDEX_CODE = 'zuzhineidangydlxqznlkpfpjz'; -UPDATE index_group_detail SET WEIGHT = 0.26 WHERE CUSTOMER_ID IN ('7ae84f0ceb36397f5078187d72de3403','04c0d396e298f13e57aa5904a657eaa6','3fdd0380deff5b30f45376cdf995d1c1') AND INDEX_CODE = 'wanggedifawsl'; -UPDATE index_group_detail SET WEIGHT = 0.04 WHERE CUSTOMER_ID IN ('7ae84f0ceb36397f5078187d72de3403','04c0d396e298f13e57aa5904a657eaa6','3fdd0380deff5b30f45376cdf995d1c1') AND INDEX_CODE = 'zuzhisanhykcs'; -UPDATE index_group_detail SET WEIGHT = 0.04 WHERE CUSTOMER_ID IN ('7ae84f0ceb36397f5078187d72de3403','04c0d396e298f13e57aa5904a657eaa6','3fdd0380deff5b30f45376cdf995d1c1') AND INDEX_CODE = 'dangyuancanjiashykrc'; +# #修改党员相关 三会一课权重 +# UPDATE index_group_detail_template SET WEIGHT = 0.1 WHERE INDEX_CODE = 'dangwuhuodong'; +# UPDATE index_group_detail_template SET WEIGHT = 0.45 WHERE INDEX_CODE = 'canyuyishi'; +# UPDATE index_group_detail_template SET WEIGHT = 0.45 WHERE INDEX_CODE = 'lianxiqunzhong'; +# UPDATE index_group_detail_template SET WEIGHT = 1 WHERE INDEX_CODE = 'canjiasanhykcs'; +# +# UPDATE index_group_detail_template SET WEIGHT = 0.26 WHERE INDEX_CODE = 'zuzhineidangydlxqznlkpfpjz'; +# UPDATE index_group_detail_template SET WEIGHT = 0.26 WHERE INDEX_CODE = 'wanggedifawsl'; +# UPDATE index_group_detail_template SET WEIGHT = 0.04 WHERE INDEX_CODE = 'zuzhisanhykcs'; +# UPDATE index_group_detail_template SET WEIGHT = 0.04 WHERE INDEX_CODE = 'dangyuancanjiashykrc'; +# +# #开发和测试的 对应的客户已经修改执行完了 +# #修改生产的 先给党群e事通和亿联员工互助会设置一下权重。再加上我们自己的 微笑崂山 +# UPDATE index_group_detail SET WEIGHT = 0.1 WHERE CUSTOMER_ID IN ('7ae84f0ceb36397f5078187d72de3403','04c0d396e298f13e57aa5904a657eaa6','3fdd0380deff5b30f45376cdf995d1c1') AND INDEX_CODE = 'dangwuhuodong'; +# UPDATE index_group_detail SET WEIGHT = 0.45 WHERE CUSTOMER_ID IN ('7ae84f0ceb36397f5078187d72de3403','04c0d396e298f13e57aa5904a657eaa6','3fdd0380deff5b30f45376cdf995d1c1') AND INDEX_CODE = 'canyuyishi'; +# UPDATE index_group_detail SET WEIGHT = 0.45 WHERE CUSTOMER_ID IN ('7ae84f0ceb36397f5078187d72de3403','04c0d396e298f13e57aa5904a657eaa6','3fdd0380deff5b30f45376cdf995d1c1') AND INDEX_CODE = 'lianxiqunzhong'; +# UPDATE index_group_detail SET WEIGHT = 1 WHERE CUSTOMER_ID IN ('7ae84f0ceb36397f5078187d72de3403','04c0d396e298f13e57aa5904a657eaa6','3fdd0380deff5b30f45376cdf995d1c1') AND INDEX_CODE = 'canjiasanhykcs'; +# +# UPDATE index_group_detail SET WEIGHT = 0.26 WHERE CUSTOMER_ID IN ('7ae84f0ceb36397f5078187d72de3403','04c0d396e298f13e57aa5904a657eaa6','3fdd0380deff5b30f45376cdf995d1c1') AND INDEX_CODE = 'zuzhineidangydlxqznlkpfpjz'; +# UPDATE index_group_detail SET WEIGHT = 0.26 WHERE CUSTOMER_ID IN ('7ae84f0ceb36397f5078187d72de3403','04c0d396e298f13e57aa5904a657eaa6','3fdd0380deff5b30f45376cdf995d1c1') AND INDEX_CODE = 'wanggedifawsl'; +# UPDATE index_group_detail SET WEIGHT = 0.04 WHERE CUSTOMER_ID IN ('7ae84f0ceb36397f5078187d72de3403','04c0d396e298f13e57aa5904a657eaa6','3fdd0380deff5b30f45376cdf995d1c1') AND INDEX_CODE = 'zuzhisanhykcs'; +# UPDATE index_group_detail SET WEIGHT = 0.04 WHERE CUSTOMER_ID IN ('7ae84f0ceb36397f5078187d72de3403','04c0d396e298f13e57aa5904a657eaa6','3fdd0380deff5b30f45376cdf995d1c1') AND INDEX_CODE = 'dangyuancanjiashykrc'; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.19__add_gridMemberToalColumn.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.19__add_gridMemberToalColumn.sql index 5d470eaec9..fecb05a6c4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.19__add_gridMemberToalColumn.sql +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.19__add_gridMemberToalColumn.sql @@ -1,4 +1,4 @@ --- 为了平阴大屏,显示网格员数,screen_user_total_data 新增GRID_MEMBER_TOTAL - --- epmet_evaluation_index 、 epmet_data_statistical_display 库执行以下: -ALTER TABLE screen_user_total_data ADD COLUMN `GRID_MEMBER_TOTAL` INT ( 11 ) NOT NULL DEFAULT '0' COMMENT '06.01新增:orgType=agency或者grid的时候,此列赋值:当前组织或者当前网格内的网格员人数' AFTER PROJECT_TOTAL; \ No newline at end of file +# -- 为了平阴大屏,显示网格员数,screen_user_total_data 新增GRID_MEMBER_TOTAL +# +# -- epmet_evaluation_index 、 epmet_data_statistical_display 库执行以下: +# ALTER TABLE screen_user_total_data ADD COLUMN `GRID_MEMBER_TOTAL` INT ( 11 ) NOT NULL DEFAULT '0' COMMENT '06.01新增:orgType=agency或者grid的时候,此列赋值:当前组织或者当前网格内的网格员人数' AFTER PROJECT_TOTAL; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.24__add_categoryOriginCustomerId.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.24__add_categoryOriginCustomerId.sql index 0997b46828..b4ca6c2318 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.24__add_categoryOriginCustomerId.sql +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.24__add_categoryOriginCustomerId.sql @@ -1 +1,3 @@ alter table `epmet_evaluation_index`.screen_project_category_org_daily add COLUMN `CATEGORY_ORIGIN_CUSTOMER_ID` VARCHAR(64) NOT NULL DEFAULT '' COMMENT '分类来源客户ID' AFTER CUSTOMER_ID; +ALTER TABLE `epmet_evaluation_index`.`screen_project_data` + ADD COLUMN `PROJECT_CREATOR` varchar(64) NULL COMMENT '项目创建人' AFTER `SATISFACTION_SCORE`; \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.25__add_closedProjectTotal.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.25__add_closedProjectTotal.sql new file mode 100644 index 0000000000..70f26d026d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.25__add_closedProjectTotal.sql @@ -0,0 +1,2 @@ +alter table screen_project_category_grid_daily add COLUMN CLOSED_PROJECT_TOTAL int(11) NOT NULL DEFAULT 0 comment '该分类下所有结案的项目数' AFTER PROJECT_TOTAL; +alter table screen_project_category_org_daily add COLUMN CLOSED_PROJECT_TOTAL int(11) NOT NULL DEFAULT 0 comment '该分类下所有结案的项目数' AFTER PROJECT_TOTAL; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.26__create_volunteer_service_daily.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.26__create_volunteer_service_daily.sql new file mode 100644 index 0000000000..7eade2a679 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.26__create_volunteer_service_daily.sql @@ -0,0 +1,21 @@ +CREATE TABLE epmet_data_statistical.`fact_volunteer_service_daily` +( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', + `DATE_ID` varchar(8) NOT NULL COMMENT 'yyyyMMdd', + `MONTH_ID` varchar(6) NOT NULL COMMENT 'yyyyMM', + `VOLUNTEER_TOTAL` int(11) NOT NULL COMMENT '截止到当前dateId,当前客户下,共有多少个爱心互助的志愿者', + `PARTY_TOTAL` int(11) NOT NULL COMMENT '截止到当前dateId,当前客户下,XX个爱心互助志愿者中,党员有多少个', + `RESI_TOTAL` int(11) NOT NULL COMMENT '截止到当前dateId,当前客户下,XX个爱心互助志愿者中,居民有多少个', + `SERVICE_TOTAL` int(11) NOT NULL COMMENT '服务总次数', + `PARTY_SERVICE_TOTAL` int(11) NOT NULL COMMENT '党员服务总次数', + `RESI_SERVICE_TOTAL` int(11) NOT NULL COMMENT '居民服务总次数', + `DEL_FLAG` int(11) NOT NULL COMMENT '删除标识:0.未删除 1.已删除', + `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`), + UNIQUE KEY `uni_vsd` (`CUSTOMER_ID`,`DATE_ID`,`DEL_FLAG`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='志愿者服务情况统计' \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.2__dim_ag_add_col_type.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.2__dim_ag_add_col_type.sql index 541d0d7307..701305aa6d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.2__dim_ag_add_col_type.sql +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.2__dim_ag_add_col_type.sql @@ -1,2 +1,2 @@ -/*ALTER TABLE dim_agency ADD COLUMN AGENCY_DIM_TYPE VARCHAR(10) NOT NULL COMMENT '机关维度类型。self:机关本身自己,all:机关自己+下级+网格+部门等';*/ +#ALTER TABLE dim_agency ADD COLUMN AGENCY_DIM_TYPE VARCHAR(10) NOT NULL COMMENT '机关维度类型。self:机关本身自己,all:机关自己+下级+网格+部门等'; select 1; \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml index 21df7f9a68..c8c672e57f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml @@ -3,17 +3,19 @@ - + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml index 9c42712164..638f7ec8df 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml @@ -164,18 +164,19 @@ )t - - SELECT - COUNT( ID ) AS issueTotal, - GRID_ID + m.GRID_ID, + COUNT(m.ID) AS issueTotal FROM - fact_origin_issue_main_daily - WHERE - DEL_FLAG = 0 - AND CUSTOMER_ID = #{customerId} - AND (MONTH_ID = #{monthId} OR MONTH_ID = #{minusMonthId}) - GROUP BY GRID_ID + fact_origin_issue_main_daily m INNER JOIN + fact_origin_issue_log_daily l ON m.ID = l.ISSUE_ID + WHERE m.DEL_FLAG = '0' + AND m.MONTH_ID = #{monthId} + AND m.CUSTOMER_ID = #{customerId} + AND l.ACTION_CODE = 'shift_project' + GROUP BY GRID_ID @@ -377,4 +378,4 @@ GROUP BY a.ID - \ No newline at end of file + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectCategoryDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectCategoryDailyDao.xml index cd1ced9860..e0cfcc7fe7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectCategoryDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectCategoryDailyDao.xml @@ -36,13 +36,21 @@ p.GRID_ID, p.AGENCY_ID AS PID, P.PIDS, - count(1)as projectTotal + + count(1) AS closedProjectTotal + + + count(1)as projectTotal + FROM fact_origin_project_category_daily c LEFT JOIN fact_origin_project_main_daily p ON ( c.PROJECT_Id = p.id and p.del_flag='0' AND p.GRID_ID != '') WHERE c.DEL_FLAG = '0' AND c.CUSTOMER_ID = #{customerId} + + AND p.PROJECT_STATUS = 'closed' + AND c.`LEVEL` = '2' AND p.GRID_ID != '' GROUP BY @@ -60,13 +68,21 @@ p.GRID_ID, p.AGENCY_ID AS PID, P.PIDS, - count(distinct c.project_id)as projectTotal + + count(distinct c.project_id) AS closedProjectTotal + + + count(distinct c.project_id)as projectTotal + FROM fact_origin_project_category_daily c LEFT JOIN fact_origin_project_main_daily p ON ( c.PROJECT_Id = p.id and p.del_flag='0' AND p.GRID_ID != '') WHERE c.DEL_FLAG = '0' AND p.GRID_ID != '' + + AND p.PROJECT_STATUS = 'closed' + AND c.CUSTOMER_ID = #{customerId} GROUP BY c.CUSTOMER_ID, @@ -87,7 +103,12 @@ p.AGENCY_ID AS orgId, p.PID AS PID, P.PIDS, - COUNT(DISTINCT p.ID) AS projectTotal + + COUNT(DISTINCT p.ID) AS projectTotal + + + COUNT(DISTINCT p.ID) AS closedProjectTotal + FROM fact_origin_project_main_daily p LEFT JOIN fact_origin_project_category_daily c ON ( c.PROJECT_Id = p.id AND p.del_flag='0' AND p.GRID_ID = '') WHERE c.DEL_FLAG = '0' @@ -99,6 +120,9 @@ ) AND c.`LEVEL` = '2' AND p.GRID_ID = '' + + AND p.PROJECT_STATUS = 'closed' + GROUP BY c.CUSTOMER_ID, c.CATEGORY_CODE, c.`LEVEL`, p.AGENCY_ID, p.PID, P.PIDS UNION ALL SELECT @@ -109,7 +133,12 @@ p.AGENCY_ID AS orgId, p.PID AS PID, P.PIDS, - COUNT(distinct p.ID) AS projectTotal + + COUNT(DISTINCT p.ID) AS projectTotal + + + COUNT(DISTINCT p.ID) AS closedProjectTotal + FROM fact_origin_project_main_daily p LEFT JOIN fact_origin_project_category_daily c ON ( c.PROJECT_Id = p.id AND p.del_flag='0' AND p.GRID_ID = '') WHERE c.DEL_FLAG = '0' @@ -120,6 +149,9 @@ ) AND p.GRID_ID = '' + + AND p.PROJECT_STATUS = 'closed' + GROUP BY c.CUSTOMER_ID, left(c.CATEGORY_CODE, #{subCount}), c.`LEVEL`, p.PID, p.AGENCY_ID, P.PIDS diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml index 92dd3ee38a..4e28cbb74b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml @@ -47,7 +47,7 @@ - + SELECT + IFNULL(en.actionCode,'good') AS actionCode, + cl.projectId, + cl.gridId + FROM + (SELECT + ld.PROJECT_ID AS projectId, + ld.ORG_ID AS gridId + FROM fact_origin_project_log_daily ld + WHERE ld.DEL_FLAG = 0 + AND ld.CUSTOMER_ID = #{customerId} + AND ld.ACTION_CODE IN('close') + AND ld.ORG_TYPE = 'grid' + AND ld.MONTH_ID = #{monthId} + ) cl + LEFT JOIN + (SELECT + IFNULL(ld.ACTION_CODE,'good') AS actionCode, + ld.ORG_ID AS gridId, + ld.PROJECT_ID AS projectId + FROM fact_origin_project_log_daily ld + WHERE ld.DEL_FLAG = 0 + AND ld.ACTION_CODE IN( 'bad','good', 'perfect') + AND ld.MONTH_ID = #{monthId} + AND ld.CUSTOMER_ID = #{customerId} + ) en ON (en.projectId = cl.projectId) @@ -92,29 +120,46 @@ COUNT( ID ) AS "count", SUM( IFNULL( b.score, 80 ) ) AS "ratio" FROM - ( SELECT f.ID, f.AGENCY_ID FROM fact_origin_project_main_daily f - INNER JOIN dim_agency da ON f.FINISH_ORG_IDS LIKE concat('%', da.ID, '%') - AND da.AGENCY_DIM_TYPE = 'all' - AND da.`LEVEL` = #{level} - AND da.CUSTOMER_ID = #{customerId} - WHERE 1=1 - AND f.MONTH_ID = #{monthId}) a - LEFT JOIN ( - SELECT - PROJECT_ID, - AVG( CASE ACTION_CODE WHEN 'bad' THEN 60 WHEN 'perfect' THEN 100 ELSE 80 END ) AS score - FROM - fact_origin_project_log_daily - WHERE - (ACTION_CODE = 'bad' - OR ACTION_CODE = 'good' - OR ACTION_CODE = 'perfect') - AND CUSTOMER_ID = #{customerId} - AND MONTH_ID = #{monthId} - GROUP BY - PROJECT_ID + ( + SELECT + f.ID, + log.AGENCY_ID + FROM + fact_origin_project_main_daily f + INNER JOIN fact_origin_project_log_daily log ON f.ID = log.PROJECT_ID + AND log.ACTION_CODE = 'close' + AND log.DEL_FLAG = '0' + AND log.CUSTOMER_ID = #{customerId} + AND log.MONTH_ID = #{monthId} + INNER JOIN dim_agency da ON log.PIDS LIKE concat( '%', da.ID, '%' ) + AND da.AGENCY_DIM_TYPE = 'all' + AND da.`LEVEL` = #{level} + AND da.CUSTOMER_ID = #{customerId} + + WHERE + 1 = 1 + AND f.ORIGIN = 'issue' + AND f.PROJECT_STATUS = 'closed' + AND f.CUSTOMER_ID = #{customerId} + ) a + LEFT JOIN ( + SELECT + l1.PROJECT_ID, + AVG( CASE l1.ACTION_CODE WHEN 'bad' THEN 60 WHEN 'perfect' THEN 100 ELSE 80 END ) AS score + FROM + fact_origin_project_log_daily l1 + INNER JOIN fact_origin_project_log_daily l2 ON l1.PROJECT_ID = l2.PROJECT_ID + AND l2.ACTION_CODE = 'close' + AND l2.MONTH_ID = #{monthId} + AND l2.CUSTOMER_ID = #{customerId} + WHERE + ( l1.ACTION_CODE = 'bad' OR l1.ACTION_CODE = 'good' OR l1.ACTION_CODE = 'perfect' ) + AND l1.CUSTOMER_ID = #{customerId} + GROUP BY + PROJECT_ID ) b ON a.ID = b.PROJECT_ID - GROUP BY AGENCY_ID + GROUP BY + AGENCY_ID + + @@ -738,54 +843,35 @@ AND m.PROJECT_ID = #{projectId} @@ -979,35 +1068,35 @@ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.xml index 0790001c64..063ec1acc8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.xml @@ -53,7 +53,7 @@ f.ORG_ID AS "agencyId", SUM( TIMESTAMPDIFF( MINUTE, ( DATE_FORMAT( f.INFORMED_DATE, '%Y-%m-%d %H:%i' )), ( DATE_FORMAT( f.PERIOD_TILL_REPLY_FIRSTLY, '%Y-%m-%d %H:%i' )) ) ) AS "sum", - COUNT( f.ID ) AS "count" + COUNT(DISTINCT f.PROJECT_ID) AS "count" FROM fact_origin_project_org_period_daily f INNER JOIN dim_agency da ON f.ORG_ID = da.ID @@ -128,7 +128,7 @@ fp.ORG_ID, SUM( TIMESTAMPDIFF( MINUTE, ( DATE_FORMAT( fp.INFORMED_DATE, '%Y-%m-%d %H:%i' )), ( DATE_FORMAT( fp.PERIOD_TILL_REPLY_FIRSTLY, '%Y-%m-%d %H:%i' )) ) ) AS "sum", - COUNT( fp.ID ) AS "count" + COUNT( DISTINCT fp.PROJECT_ID ) AS "count" FROM fact_origin_project_org_period_daily fp INNER JOIN fact_origin_project_main_daily fm ON fp.PROJECT_ID = fm.ID diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml index 76ab745264..97374f84e2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml @@ -249,10 +249,9 @@ AND gm.del_flag = '0' AND gm.month_id = #{monthId} AND gm.DATA_TYPE = #{level} - AND gm.PARENT_ID = '0' ) WHERE sca.DEL_FLAG = '0' - AND sca.AREA_CODE LIKE CONCAT('370124','%') + AND sca.AREA_CODE LIKE CONCAT(#{areaCode},'%') AND sca.`LEVEL` = #{level} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml index 12ccf09ab0..f97f5b4946 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml @@ -429,32 +429,33 @@ (SELECT DEPT_ID AS orgId FROM screen_customer_dept WHERE DEL_FLAG = 0 AND CUSTOMER_ID = #{customerId}) - - SELECT AGENCY_ID, - PID, - PIDS + PID FROM screen_customer_agency WHERE - DEL_FLAG = '0' - AND PID = '0' + DEL_FLAG = 0 AND CUSTOMER_ID = #{customerId} - - SELECT AGENCY_ID, - PID + PID, + PIDS FROM screen_customer_agency WHERE - DEL_FLAG = 0 + DEL_FLAG = '0' + AND PID = '0' AND CUSTOMER_ID = #{customerId} + + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryDao.xml new file mode 100644 index 0000000000..afe80a6416 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryDao.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + delete from screen_project_category + where CUSTOMER_ID = #{customerId} + + PROJECT_ID = #{projectId} + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryGridDailyDao.xml index 8ec1fcc4bd..763d1c0d49 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryGridDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryGridDailyDao.xml @@ -20,6 +20,7 @@ sg.CUSTOMER_ID AS categoryOriginCustomerId, sg.CATEGORY_CODE, SUM(sg.PROJECT_TOTAL) AS projectTotal, + SUM(sg.CLOSED_PROJECT_TOTAL) AS closedProjectTotal, sg.level, sg.DATE_ID, sca.`LEVEL` AS orgType diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.xml index cdce01974a..c2f3323cd7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.xml @@ -32,6 +32,7 @@ sa.CATEGORY_ORIGIN_CUSTOMER_ID, sa.CATEGORY_CODE, SUM(sa.PROJECT_TOTAL) AS projectTotal, + SUM(sa.CLOSED_PROJECT_TOTAL) AS closedProjectTotal, sa.level, sa.DATE_ID, sca.`LEVEL` AS orgType @@ -44,7 +45,7 @@ GROUP BY sa.CATEGORY_CODE,sca.AGENCY_ID - + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectDataDao.xml index db38763cb5..86980fbab1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectDataDao.xml @@ -191,4 +191,203 @@ update screen_project_data set SATISFACTION_SCORE=#{score} where PROJECT_ID=#{projectId} + + + + + + + + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/IcUserDemandServiceDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/IcUserDemandServiceDao.xml new file mode 100644 index 0000000000..ddebabef66 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/IcUserDemandServiceDao.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/VolunteerInfoDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/VolunteerInfoDao.xml new file mode 100644 index 0000000000..a426712a22 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/VolunteerInfoDao.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/StatsIssueDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/StatsIssueDao.xml index 514f743353..bedcb3e353 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/StatsIssueDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/StatsIssueDao.xml @@ -12,7 +12,7 @@ WHERE DEL_FLAG = '0' AND CUSTOMER_ID = #{customerId} - AND DATE(UPDATED_TIME) #{date} + AND DATE(CREATED_TIME) #{date} AND GRID_ID != #{gridId} @@ -322,20 +322,6 @@ order by a.category_type,a.sort - - \ No newline at end of file + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml index 64fa329ab6..5b39b9e9a1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml @@ -88,6 +88,7 @@ WHERE CG.CUSTOMER_ID =#{customerId} and cg.del_flag='0' + AND cg.SYNC_FLAG = '1' + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/StatsCustomerAgencyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/StatsCustomerAgencyDao.xml index a79160f731..b43eea7bb1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/StatsCustomerAgencyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/StatsCustomerAgencyDao.xml @@ -204,4 +204,19 @@ AND ca.CUSTOMER_ID = #{customerId} AND ca.AREA_CODE = #{areaCode} + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml index 85e8316cd3..9a2ec5b096 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml @@ -200,7 +200,7 @@ + s.PERFECT_COUNT * 100 )/s.SHOULD_EVALUATE_COUNT , - 0 + 80 ) AS score FROM project_satisfaction_statistics s diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactVolunteerServiceDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactVolunteerServiceDailyDao.xml new file mode 100644 index 0000000000..59dfd96c12 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactVolunteerServiceDailyDao.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + delete + from fact_volunteer_service_daily + where DATE_ID=#{dateDimId} + and CUSTOMER_ID in + + #{customerId} + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserGridMonthlyDao.xml index ae1950cdd4..1d04f913fb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserGridMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserGridMonthlyDao.xml @@ -110,8 +110,8 @@ + + + + + SELECT + cs.* + FROM + customer_staff cs + WHERE 1=1 + AND cs.customer_id = #{customerId} + + + #{staffId} + + + + + + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/normalizing/MathUtilTest.java b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/normalizing/MathUtilTest.java index 9d0178385a..06e77f88ef 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/normalizing/MathUtilTest.java +++ b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/normalizing/MathUtilTest.java @@ -20,10 +20,20 @@ public class MathUtilTest { BigDecimal maxValue = new BigDecimal(100); BigDecimal minValue = new BigDecimal(60); - BigDecimal normalizeValue = new BigDecimal(Math.atan(new Double("0"))) - .multiply( - (maxValue.subtract(minValue).divide(new BigDecimal(Math.PI / 2), 10, RoundingMode.HALF_UP))).add(minValue).setScale(6, RoundingMode.HALF_UP); + + //((max-min)/ (Math.PI/2))+min + BigDecimal sampleValue = new BigDecimal(Math.atan(new Double("0"))); + BigDecimal normalizeValue = sampleValue + .multiply(maxValue.subtract(minValue).divide(new BigDecimal(Math.PI / 2), 10, RoundingMode.HALF_UP)) + .add(minValue).setScale(6, RoundingMode.HALF_UP); + BigDecimal normalizeValue2 = sampleValue + .multiply(maxValue.subtract(minValue).divide(new BigDecimal(Math.PI / 2), 10, RoundingMode.HALF_UP).multiply(new BigDecimal(-1))) + .add(maxValue).setScale(6, RoundingMode.HALF_UP); + + + System.out.println(normalizeValue); + System.out.println(normalizeValue2); //new BigDecimal(Math.atan(new Double(vo.getSampleValue().toString())) / Math.PI * 100).setScale(6, RoundingMode.HALF_UP); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/read/CustomStringStringConverter.java b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/read/CustomStringStringConverter.java index 584e563a77..8f17f53f13 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/read/CustomStringStringConverter.java +++ b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/read/CustomStringStringConverter.java @@ -2,8 +2,9 @@ package com.epmet.stats.test.read; import com.alibaba.excel.converters.Converter; import com.alibaba.excel.enums.CellDataTypeEnum; -import com.alibaba.excel.metadata.CellData; import com.alibaba.excel.metadata.GlobalConfiguration; +import com.alibaba.excel.metadata.data.ReadCellData; +import com.alibaba.excel.metadata.data.WriteCellData; import com.alibaba.excel.metadata.property.ExcelContentProperty; /** @@ -13,7 +14,7 @@ import com.alibaba.excel.metadata.property.ExcelContentProperty; */ public class CustomStringStringConverter implements Converter { @Override - public Class supportJavaTypeKey() { + public Class supportJavaTypeKey() { return String.class; } @@ -34,8 +35,8 @@ public class CustomStringStringConverter implements Converter { * @return */ @Override - public String convertToJavaData(CellData cellData, ExcelContentProperty contentProperty, - GlobalConfiguration globalConfiguration) { + public String convertToJavaData(ReadCellData cellData, ExcelContentProperty contentProperty, + GlobalConfiguration globalConfiguration) { return "自定义:" + cellData.getStringValue(); } @@ -51,9 +52,9 @@ public class CustomStringStringConverter implements Converter { * @return */ @Override - public CellData convertToExcelData(String value, ExcelContentProperty contentProperty, - GlobalConfiguration globalConfiguration) { - return new CellData(value); + public WriteCellData convertToExcelData(String value, ExcelContentProperty contentProperty, + GlobalConfiguration globalConfiguration) { + return new WriteCellData<>(value); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/test/java/resources/疑难杂症之-数据名词解释及算法.docx b/epmet-module/data-statistical/data-statistical-server/src/test/java/resources/疑难杂症之-数据名词解释及算法.docx new file mode 100644 index 0000000000..03055cf214 Binary files /dev/null and b/epmet-module/data-statistical/data-statistical-server/src/test/java/resources/疑难杂症之-数据名词解释及算法.docx differ diff --git a/epmet-module/data-statistical/data-statistical-server/src/test/java/resources/评价指标体系算法需求-备注.xlsx b/epmet-module/data-statistical/data-statistical-server/src/test/java/resources/评价指标体系算法需求-备注.xlsx index 9c90c24c9e..77fdf0ab3e 100644 Binary files a/epmet-module/data-statistical/data-statistical-server/src/test/java/resources/评价指标体系算法需求-备注.xlsx and b/epmet-module/data-statistical/data-statistical-server/src/test/java/resources/评价指标体系算法需求-备注.xlsx differ diff --git a/epmet-module/data-statistical/data-statistical-server/src/test/java/resources/评价指标体系算法需求-备注3.0版新权重.xlsx b/epmet-module/data-statistical/data-statistical-server/src/test/java/resources/评价指标体系算法需求-备注3.0版新权重.xlsx index cb442ccfe9..1b8299fbab 100644 Binary files a/epmet-module/data-statistical/data-statistical-server/src/test/java/resources/评价指标体系算法需求-备注3.0版新权重.xlsx and b/epmet-module/data-statistical/data-statistical-server/src/test/java/resources/评价指标体系算法需求-备注3.0版新权重.xlsx differ diff --git a/epmet-module/data-statistical/data-statistical-server/src/test/java/resources/评价指标体系算法需求-备注3.0版新权重(新客户适用)-党群e事通和亿联互助平台在用.xlsx b/epmet-module/data-statistical/data-statistical-server/src/test/java/resources/评价指标体系算法需求-备注3.0版新权重(新客户适用)-党群e事通和亿联互助平台在用.xlsx new file mode 100644 index 0000000000..0d1b465dad Binary files /dev/null and b/epmet-module/data-statistical/data-statistical-server/src/test/java/resources/评价指标体系算法需求-备注3.0版新权重(新客户适用)-党群e事通和亿联互助平台在用.xlsx differ diff --git a/epmet-module/epmet-activiti/epmet-activiti-server/deploy/docker-compose-prod.yml b/epmet-module/epmet-activiti/epmet-activiti-server/deploy/docker-compose-prod.yml index 088bfeb2dd..c6d7c0d65c 100644 --- a/epmet-module/epmet-activiti/epmet-activiti-server/deploy/docker-compose-prod.yml +++ b/epmet-module/epmet-activiti/epmet-activiti-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-activiti-server: container_name: epmet-activiti-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-activiti-server:0.3.0 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-activiti-server:0.3.1 ports: - "8086:8086" network_mode: host # 使用现有网络 diff --git a/epmet-module/epmet-activiti/epmet-activiti-server/pom.xml b/epmet-module/epmet-activiti/epmet-activiti-server/pom.xml index 39153b082b..fa8fd80209 100644 --- a/epmet-module/epmet-activiti/epmet-activiti-server/pom.xml +++ b/epmet-module/epmet-activiti/epmet-activiti-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.0 + 0.3.1 com.epmet epmet-activiti @@ -278,7 +278,7 @@ false - false + true true diff --git a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/fallback/EpmetCommonServiceOpenFeignClientFallback.java b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/fallback/EpmetCommonServiceOpenFeignClientFallback.java index 0483a1d3dc..4afee3fa08 100644 --- a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/fallback/EpmetCommonServiceOpenFeignClientFallback.java +++ b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/fallback/EpmetCommonServiceOpenFeignClientFallback.java @@ -3,6 +3,16 @@ package com.epmet.feign.fallback; 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.form.CostDayFormDTO; +import com.epmet.dto.form.ExternalAppAuthFormDTO; +import com.epmet.dto.form.GetJwtAccessTokenFormDTO; +import com.epmet.dto.form.WorkDayFormDTO; +import com.epmet.dto.result.AppIdInfoResultDTO; +import com.epmet.dto.form.WorkMinuteFormDTO; +import com.epmet.dto.result.CostDayResultDTO; +import com.epmet.dto.result.AppIdInfoResultDTO; +import com.epmet.dto.result.ExternalAppAuthResultDTO; +import com.epmet.dto.result.WorkDayResultDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.feign.EpmetCommonServiceOpenFeignClient; diff --git a/epmet-module/epmet-common-service/common-service-server/deploy/docker-compose-prod.yml b/epmet-module/epmet-common-service/common-service-server/deploy/docker-compose-prod.yml index bbf8441c97..bdbb5be1ee 100644 --- a/epmet-module/epmet-common-service/common-service-server/deploy/docker-compose-prod.yml +++ b/epmet-module/epmet-common-service/common-service-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: common-service-server: container_name: common-service-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/common-service-server:0.3.26 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/common-service-server:0.3.41 ports: - "8103:8103" network_mode: host # 使用现有网络 @@ -15,4 +15,4 @@ services: resources: limits: cpus: '0.1' - memory: 600M \ No newline at end of file + memory: 600M diff --git a/epmet-module/epmet-common-service/common-service-server/pom.xml b/epmet-module/epmet-common-service/common-service-server/pom.xml index 4e27c15d03..f3de138c12 100644 --- a/epmet-module/epmet-common-service/common-service-server/pom.xml +++ b/epmet-module/epmet-common-service/common-service-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.26 + 0.3.41 com.epmet epmet-common-service @@ -261,7 +261,7 @@ false - false + true true diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/ExternalCustomerController.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/ExternalCustomerController.java index becc72c341..149249599b 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/ExternalCustomerController.java +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/ExternalCustomerController.java @@ -1,5 +1,6 @@ package com.epmet.controller; +import com.epmet.commons.tools.aop.NoRepeatSubmit; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; @@ -44,6 +45,7 @@ public class ExternalCustomerController { * @param formDTO * @return */ + @NoRepeatSubmit @PostMapping("add") public Result add(@RequestBody ExternalCustomerFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, ExternalCustomerFormDTO.AddExternalCustomerGroup.class); @@ -57,6 +59,7 @@ public class ExternalCustomerController { * @param formDTO * @return */ + @NoRepeatSubmit @PostMapping("update") public Result update(@RequestBody ExternalCustomerFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, ExternalCustomerFormDTO.UpdateExternalCustomerGroup.class); diff --git a/epmet-module/epmet-demo/epmet-demo-server/pom.xml b/epmet-module/epmet-demo/epmet-demo-server/pom.xml index 00a03e4aab..2a2ee9e597 100644 --- a/epmet-module/epmet-demo/epmet-demo-server/pom.xml +++ b/epmet-module/epmet-demo/epmet-demo-server/pom.xml @@ -13,6 +13,25 @@ jar + + com.alibaba + easyexcel + 3.0.3 + + + poi + org.apache.poi + + + poi-ooxml + org.apache.poi + + + poi-ooxml-schemas + org.apache.poi + + + com.epmet epmet-commons-tools diff --git a/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/utils/ExcelPaseTest.java b/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/utils/ExcelPaseTest.java new file mode 100644 index 0000000000..6b277bd0d7 --- /dev/null +++ b/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/utils/ExcelPaseTest.java @@ -0,0 +1,58 @@ +package com.epmet.utils; + +import com.alibaba.excel.EasyExcelFactory; + +import java.io.File; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** + * @description excel解析 + * + * @return + * @author wxz + * @date 2021.10.28 13:36:26 + */ +public class ExcelPaseTest { + + public static void main(String[] args) { + new ExcelPaseTest().sqlizeGridNameAndCodeFromExcel(); + } + + /** + * @description 读取excel,生成根据网格name更新网格code的sql + * + * @param + * @return + * @author wxz + * @date 2021.10.28 13:34:31 + */ + public void sqlizeGridNameAndCodeFromExcel() { + TempDynamicEasyExcelListener readListener = new TempDynamicEasyExcelListener(); + EasyExcelFactory.read(new File("/Users/wangxianzhang/Documents/1027平阴县网格编码及人员统计表.xls"), IndexOrNameData.class, readListener).headRowNumber(4).sheet(0).doRead(); + List> headList = readListener.getHeadList(); + List dataList = readListener.getDataList(); + + List exceptList = new ArrayList<>(); + + for (IndexOrNameData data : dataList) { + String content = data.getColumn(); + + int startIndex = content.indexOf("370"); + if (startIndex == -1) { + exceptList.add(content); + } else { + String gridName = content.substring(0, startIndex).trim(); + String gridCode = content.substring(startIndex); + String sqlPattern = String.format("update customer_grid set CODE='%s' where GRID_NAME='%s';", gridCode, gridName); + System.out.println(sqlPattern); + } + } + + System.err.println("========异常行======="); + for (String s : exceptList) { + System.err.println(s); + } + } +} diff --git a/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/utils/IndexOrNameData.java b/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/utils/IndexOrNameData.java new file mode 100644 index 0000000000..920b9e66b5 --- /dev/null +++ b/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/utils/IndexOrNameData.java @@ -0,0 +1,20 @@ +package com.epmet.utils; + +import com.alibaba.excel.annotation.ExcelProperty; +import lombok.Data; + +@Data +public class IndexOrNameData { + /** + * 强制读取第三个 这里不建议 index 和 name 同时用,要么一个对象只用index,要么一个对象只用name去匹配 + */ + @ExcelProperty(index = 3) + private String column; + ///** + // * 用名字去匹配,这里需要注意,如果名字重复,会导致只有一个字段读取到数据 + // */ + //@ExcelProperty("字符串标题") + //private String string; + //@ExcelProperty("日期标题") + //private Date date; +} \ No newline at end of file diff --git a/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/utils/TempDynamicEasyExcelListener.java b/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/utils/TempDynamicEasyExcelListener.java new file mode 100644 index 0000000000..cc870c58cc --- /dev/null +++ b/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/utils/TempDynamicEasyExcelListener.java @@ -0,0 +1,82 @@ +package com.epmet.utils; + +import com.alibaba.excel.context.AnalysisContext; +import com.alibaba.excel.event.AnalysisEventListener; +import com.alibaba.fastjson.JSON; +import lombok.extern.slf4j.Slf4j; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** + * 创建一个监听器 + */ +@Slf4j +public class TempDynamicEasyExcelListener extends AnalysisEventListener { + + /** + * 表头数据(存储所有的表头数据) + */ + private List> headList = new ArrayList<>(); + + /** + * 数据体 + */ + private List dataList = new ArrayList<>(); + + /** + * 这里会一行行的返回头 + * + * @param headMap + * @param context + */ + //@Override + //public void invokeHeadMap(IcResiUserController.IndexOrNameData headMap, AnalysisContext context) { + // log.info("解析到一条头数据:{}", JSON.toJSONString(headMap)); + // //存储全部表头数据 + // headList.add(headMap); + //} + + + @Override + public void invokeHeadMap(Map headMap, AnalysisContext context) { + log.info("解析到一条头数据:{}", JSON.toJSONString(headMap)); + //存储全部表头数据 + headList.add(headMap); + } + + /** + * 这个每一条数据解析都会来调用 + * + * @param data + * one row value. Is is same as {@link AnalysisContext#readRowHolder()} + * @param context + */ + @Override + public void invoke(IndexOrNameData data, AnalysisContext context) { + //log.info("解析到一条数据:{}", JSON.toJSONString(data)); + if (data.getColumn() != null) { + dataList.add(data); + } + } + + /** + * 所有数据解析完成了 都会来调用 + * + * @param context + */ + @Override + public void doAfterAllAnalysed(AnalysisContext context) { + // 这里也要保存数据,确保最后遗留的数据也存储到数据库 + log.info("所有数据解析完成!"); + } + + public List> getHeadList() { + return headList; + } + + public List getDataList() { + return dataList; + } +} \ No newline at end of file diff --git a/epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-prod.yml b/epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-prod.yml index 7ba47e2fc3..caa3059dad 100644 --- a/epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-prod.yml +++ b/epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-ext-server: container_name: epmet-ext-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-ext-server:0.0.13 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-ext-server:0.0.20 ports: - "8113:8113" network_mode: host # 使用现有网络 diff --git a/epmet-module/epmet-ext/epmet-ext-server/pom.xml b/epmet-module/epmet-ext/epmet-ext-server/pom.xml index bebc41ab98..e0d4e979b0 100644 --- a/epmet-module/epmet-ext/epmet-ext-server/pom.xml +++ b/epmet-module/epmet-ext/epmet-ext-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.0.13 + 0.0.20 com.epmet @@ -340,7 +340,7 @@ false - false + true true diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcCommunitySelfOrganizationDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcCommunitySelfOrganizationDTO.java new file mode 100644 index 0000000000..6be34cb9b8 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcCommunitySelfOrganizationDTO.java @@ -0,0 +1,136 @@ +/** + * 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.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 社区自组织表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Data +public class IcCommunitySelfOrganizationDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 组织ID + */ + private String orgId; + + /** + * 组织类型,agency:组织,grid:网格 + */ + private String orgType; + + /** + * 组织ID的父级 + */ + private String pid; + + /** + * org_id的所有上级 + */ + private String pids; + + /** + * 组织名称 + */ + private String organizationName; + + /** + * 组织人数 + */ + private Integer organizationPersonCount; + + /** + * 负责人姓名 + */ + private String principalName; + + /** + * 负责人电话 + */ + private String principalPhone; + + /** + * 服务事项 + */ + private String serviceItem; + + /** + * 社区自组织创建时间 + */ + private Date organizationCreatedTime; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + + /** + * + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private String revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcCommunitySelfOrganizationPersonnelDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcCommunitySelfOrganizationPersonnelDTO.java new file mode 100644 index 0000000000..53c7196083 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcCommunitySelfOrganizationPersonnelDTO.java @@ -0,0 +1,91 @@ +/** + * 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.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 社区自组织人员表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Data +public class IcCommunitySelfOrganizationPersonnelDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 社区自组织ID + */ + private String orgId; + + /** + * 人员姓名 + */ + private String personName; + + /** + * 人员电话 + */ + private String personPhone; + + /** + * + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private String revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyActivityDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyActivityDTO.java new file mode 100644 index 0000000000..a8c770f8e9 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyActivityDTO.java @@ -0,0 +1,156 @@ +/** + * 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.dto; + +import com.epmet.commons.tools.validator.group.AddGroup; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.Date; + + +/** + * 联建活动 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-19 + */ +@Data +public class IcPartyActivityDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 组织ID + */ + private String agencyId; + + /** + * 组织的所有上级 + */ + private String pids; + + /** + * 单位ID + */ + @NotBlank(message = "单位不能为空",groups = AddGroup.class) + private String unitId; + private String unitName; + /** + * 服务事项 + */ + @NotBlank(message = "服务事项不能为空",groups = AddGroup.class) + private String serviceMatter; + private String serviceMatterName; + /** + * 活动标题 + */ + @NotBlank(message = "活动标题不能为空",groups = AddGroup.class) + private String title; + + /** + * 活动目标 + */ + @NotBlank(message = "活动目标不能为空",groups = AddGroup.class) + private String target; + + /** + * 活动内容 + */ + @NotBlank(message = "活动内容不能为空",groups = AddGroup.class) + private String content; + + /** + * 服务人数 + */ + private Integer peopleCount; + + /** + * 活动时间 + */ + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern="yyyy-MM-dd HH:mm") + private Date activityTime; + + /** + * 活动地址 + */ + @NotBlank(message = "活动地址不能为空",groups = AddGroup.class) + private String address; + + /** + * 活动地址经度 + */ + @NotBlank(message = "活动地址不能为空",groups = AddGroup.class) + private String longitude; + + /** + * 活动地址纬度 + */ + @NotBlank(message = "活动地址不能为空",groups = AddGroup.class) + private String latitude; + + /** + * 活动结果 + */ + private String result; + + /** + * 删除标识 0未删除、1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyUnitDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyUnitDTO.java new file mode 100644 index 0000000000..1782ddf316 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyUnitDTO.java @@ -0,0 +1,153 @@ +/** + * 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.dto; + +import com.epmet.commons.tools.validator.group.AddGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.Date; +import java.util.List; + + +/** + * 联建单位 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-19 + */ +@Data +public class IcPartyUnitDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 组织ID + */ + private String agencyId; + + /** + * + */ + private String pids; + + /** + * 单位名称 + */ + @NotBlank(message = "单位名称不能为空",groups = AddGroup.class) + private String unitName; + + /** + * 分类 楼宇党建 两新组织 区域单位党建 机关直属部门 其他 + */ + @NotBlank(message = "分类不能为空",groups = AddGroup.class) + private String type; + + /** + * 服务事项 多选逗号隔开 + */ + private String serviceMatter; + + private List serviceMatterList; + + /** + * 联系人 + */ + @NotBlank(message = "联系人不能为空",groups = AddGroup.class) + private String contact; + + /** + * 联系电话 + */ + @NotBlank(message = "联系电话不能为空",groups = AddGroup.class) + private String contactMobile; + + /** + * 在职党员数 + */ + private Integer memberCount; + + /** + * 地址 + */ + private String address; + + /** + * 中心位置经度 + */ + @NotBlank(message = "经度不能为空",groups = AddGroup.class) + private String longitude; + + /** + * 中心位置纬度 + */ + @NotBlank(message = "纬度不能为空",groups = AddGroup.class) + private String latitude; + + /** + * 群众满意度 + */ + private String satisfaction; + + /** + * 备注 + */ + private String remark; + + /** + * 删除标识 0未删除、1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcSocietyOrgDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcSocietyOrgDTO.java new file mode 100644 index 0000000000..898b01df9d --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcSocietyOrgDTO.java @@ -0,0 +1,141 @@ +/** + * 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.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 社会组织管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Data +public class IcSocietyOrgDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 组织Id + */ + private String agencyId; + + /** + * agency_id的所有上级 + */ + private String pids; + + /** + * 社会组织名称 + */ + private String societyName; + + /** + * 服务事项 + */ + private String serviceMatters; + + /** + * 负责人 + */ + private String personInCharge; + + /** + * 负责人电话 + */ + private String mobile; + + /** + * 起始服务时间 + */ + private Date serviceStartTime; + + /** + * 终止服务时间 + */ + private Date serviceEndTime; + + /** + * 绑定管理员[组织下录入的工作人员] + */ + private String adminStaffId; + + /** + * 地址 + */ + private String address; + + /** + * 经度 + */ + private String longitude; + + /** + * 维度 + */ + private String latitude; + + /** + * 备注 + */ + private String remarks; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcUserDemandOperateLogDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcUserDemandOperateLogDTO.java new file mode 100644 index 0000000000..3acb6a0510 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcUserDemandOperateLogDTO.java @@ -0,0 +1,103 @@ +/** + * 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.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 居民需求操作日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-19 + */ +@Data +public class IcUserDemandOperateLogDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 需求id + */ + private String demandRecId; + + /** + * 当前操作用户属于哪个端?工作端:staff;居民端:resi + */ + private String userType; + + /** + * 当前操作用户id + */ + private String userId; + + /** + * 创建需求:create;撤销需求:cancel;指派:assign;接单:take_order;完成:finish; + */ + private String actionCode; + + /** + * 操作时间 + */ + private Date operateTime; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcUserDemandRecDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcUserDemandRecDTO.java new file mode 100644 index 0000000000..b070d80073 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcUserDemandRecDTO.java @@ -0,0 +1,178 @@ +/** + * 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.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 居民需求记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-19 + */ +@Data +public class IcUserDemandRecDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 网格id + */ + private String gridId; + + /** + * 组织id + */ + private String agencyId; + + /** + * 网格的所有上级id + */ + private String gridPids; + + /** + * 二级需求分类编码 + */ + private String categoryCode; + + /** + * 父级需求分类编码 + */ + private String parentCode; + + /** + * 需求内容1000字 + */ + private String content; + + /** + * 社区帮办:community;楼长帮办:building_caption;党员帮办:party;自身上报:self_help + */ + private String reportType; + + /** + * 上报人姓名 + */ + private String reportUserName; + + /** + * 上报人联系方式。自身上报时存储注册居民的手机号 + */ + private String reportUserMobile; + + /** + * 自身上报时存储居民端用户id + */ + private String reportUserId; + + /** + * 上报时间 + */ + private Date reportTime; + + /** + * 希望服务时间 + */ + private Date wantServiceTime; + + /** + * 小程序用户自己上报:mini_resi;居民信息录入的居民:ic_resi_user + */ + private String demandUserType; + + /** + * 需求人:user.id或者ic_resi_user.id + */ + private String demandUserId; + + /** + * 需求人姓名 + */ + private String demandUserName; + + /** + * 需求人联系电话 + */ + private String demandUserMobile; + + /** + * 待处理:pending;已取消canceled;已派单:assigned;已接单:have_order;已完成:finished + */ + private String status; + + /** + * 完成结果:已解决 resolved,未解决 unresolved + + */ + private String finishResult; + + /** + * 取消时间 + */ + private Date cancelTime; + + /** + * 1:已评价;0:未评价;评价后ic_user_satisfaction表有记录 + */ + private Boolean evaluateFlag; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcUserDemandSatisfactionDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcUserDemandSatisfactionDTO.java new file mode 100644 index 0000000000..c28b702723 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcUserDemandSatisfactionDTO.java @@ -0,0 +1,102 @@ +/** + * 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.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 居民需求评价记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-19 + */ +@Data +public class IcUserDemandSatisfactionDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键,居民需求评价表 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 需求id + */ + private String demandRecId; + + /** + * 当前操作用户属于哪个端?工作端:staff;居民端:resi + */ + private String userType; + + /** + * 当前评价用户id,可以是小程序里用户id,也可以是工作端帮忙录入需求的人 + */ + private String userId; + + /** + * 评价时间 + */ + private Date evaluateTime; + + /** + * 得分可为半星 + */ + private BigDecimal score; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcUserDemandServiceDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcUserDemandServiceDTO.java new file mode 100644 index 0000000000..e3196e2b02 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcUserDemandServiceDTO.java @@ -0,0 +1,106 @@ +/** + * 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.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 居民需求服务记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-19 + */ +@Data +public class IcUserDemandServiceDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 需求id + */ + private String demandRecId; + + /** + * 服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit; + */ + private String serviceType; + + /** + * 志愿者:居民端爱心互助的志愿者userId; + */ + private String serverId; + + /** + * 实际服务开始时间 + */ + private Date serviceStartTime; + + /** + * 实际服务结束时间 + */ + private Date serviceEndTime; + + /** + * 完成情况 + */ + private String finishDesc; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/AddCommunitySelfOrganizationFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/AddCommunitySelfOrganizationFormDTO.java new file mode 100644 index 0000000000..302f3d08a4 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/AddCommunitySelfOrganizationFormDTO.java @@ -0,0 +1,73 @@ +package com.epmet.dto.form; + +import com.epmet.dto.IcCommunitySelfOrganizationPersonnelDTO; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2021/11/18 5:32 下午 + * @DESC + */ +@Data +public class AddCommunitySelfOrganizationFormDTO implements Serializable { + + private static final long serialVersionUID = -4996925380900678065L; + + public interface AddCommunitySelfOrganizationForm{} + + /** + * 组织名称 + */ + @NotBlank(message = "organizationName不能为空",groups = AddCommunitySelfOrganizationForm.class) + private String organizationName; + + /** + * 组织人数 + */ + @NotNull(message = "organizationPersonCount不能为空",groups = AddCommunitySelfOrganizationForm.class) + private Integer organizationPersonCount; + + /** + * 负责人姓名 + */ + @NotBlank(message = "principalName不能为空",groups = AddCommunitySelfOrganizationForm.class) + private String principalName; + + /** + * 负责人电话 + */ + @NotBlank(message = "principalPhone不能为空",groups = AddCommunitySelfOrganizationForm.class) + private String principalPhone; + + /** + * 服务事项 + */ + @NotBlank(message = "serviceItem不能为空",groups = AddCommunitySelfOrganizationForm.class) + private String serviceItem; + + /** + * 社区自组织创建时间 + */ + private String organizationCreatedTime; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + + /** + * 社区自组织人员 + */ + private List organizationPersonnel; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/AddSocietyOrgFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/AddSocietyOrgFormDTO.java new file mode 100644 index 0000000000..a1a12c71e6 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/AddSocietyOrgFormDTO.java @@ -0,0 +1,105 @@ +/** + * 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.dto.form; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.Date; + + +/** + * @Author sun + * @Description 新增社会组织 + **/ +@Data +public class AddSocietyOrgFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + /** + * 客户Id + */ + private String customerId; + /** + * 组织Id + */ + private String agencyId; + /** + * agency_id的所有上级 + */ + private String pids; + /** + * 社会组织名称 + */ + @NotBlank(message = "社会组织名称不能为空", groups = { AddSocietyOrgFormDTO.Add.class }) + @Length(max = 50, message = "社会组织名称不能超过50个字符",groups = {Add.class}) + private String societyName; + /** + * 服务事项 + */ + @NotBlank(message = "服务事项不能为空", groups = { AddSocietyOrgFormDTO.Add.class }) + @Length(max = 1000, message = "服务事项不能超过1000个字符",groups = {Add.class}) + private String serviceMatters; + /** + * 负责人 + */ + @NotBlank(message = "负责人名称不能为空", groups = { AddSocietyOrgFormDTO.Add.class }) + @Length(max = 20, message = "负责人名称不能超过20个字符",groups = {Add.class}) + private String personInCharge; + /** + * 负责人电话 + */ + @NotBlank(message = "负责人电话不能为空", groups = { AddSocietyOrgFormDTO.Add.class }) + @Length(max = 11, message = "负责人电话不能超过11个字符",groups = {Add.class}) + private String mobile; + /** + * 起始服务时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date serviceStartTime; + /** + * 终止服务时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date serviceEndTime; + /** + * 绑定管理员[组织下录入的工作人员] + */ + @NotBlank(message = "绑定管理员名称不能为空", groups = { AddSocietyOrgFormDTO.Add.class }) + private String adminStaffId; + /** + * 地址 + */ + private String address; + /** + * 经度 + */ + private String longitude; + /** + * 维度 + */ + private String latitude; + //token中userId + private String staffId; + + public interface Add {} + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/CommunitySelfOrganizationListFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/CommunitySelfOrganizationListFormDTO.java new file mode 100644 index 0000000000..c70e2a7055 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/CommunitySelfOrganizationListFormDTO.java @@ -0,0 +1,49 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/11/19 1:47 下午 + * @DESC + */ +@Data +public class CommunitySelfOrganizationListFormDTO implements Serializable { + + private static final long serialVersionUID = 4202083250504143469L; + + public interface CommunitySelfOrganizationListForm{} + + /** + * 社区自组织名 + */ + private String organizationName; + + /** + * 开始时间 + */ + private String startTime; + + /** + * 结束时间 + */ + private String endTime; + + @NotNull(message = "pageNo不能为空",groups = CommunitySelfOrganizationListForm.class) + private Integer pageNo; + + @NotNull(message = "pageSize不能为空",groups = CommunitySelfOrganizationListForm.class) + private Integer pageSize; + + /** + * 是否分页,默认true分页 + */ + private Boolean isPage = true; + + private String customerId; + private String agencyId; + private Integer ranking; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/DelCommunitySelfOrganizationFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/DelCommunitySelfOrganizationFormDTO.java new file mode 100644 index 0000000000..67ee078676 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/DelCommunitySelfOrganizationFormDTO.java @@ -0,0 +1,22 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/11/19 4:19 下午 + * @DESC + */ +@Data +public class DelCommunitySelfOrganizationFormDTO implements Serializable { + + private static final long serialVersionUID = 789228513283561471L; + + public interface DelCommunitySelfOrganizationForm{} + + @NotBlank(message = "orgId不能为空",groups = DelCommunitySelfOrganizationForm.class) + private String orgId; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/EditCommunitySelfOrganizationFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/EditCommunitySelfOrganizationFormDTO.java new file mode 100644 index 0000000000..cade96113f --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/EditCommunitySelfOrganizationFormDTO.java @@ -0,0 +1,81 @@ +package com.epmet.dto.form; + +import com.epmet.dto.IcCommunitySelfOrganizationPersonnelDTO; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2021/11/18 5:32 下午 + * @DESC + */ +@Data +public class EditCommunitySelfOrganizationFormDTO implements Serializable { + + private static final long serialVersionUID = -4990925380900678065L; + + public interface EditCommunitySelfOrganizationForm{} + + /** + * 组织名称 + */ + @NotBlank(message = "organizationName不能为空",groups = EditCommunitySelfOrganizationForm.class) + private String organizationName; + + /** + * 组织人数 + */ + @NotNull(message = "organizationPersonCount不能为空",groups = EditCommunitySelfOrganizationForm.class) + private Integer organizationPersonCount; + + /** + * 负责人姓名 + */ + @NotBlank(message = "principalName不能为空",groups = EditCommunitySelfOrganizationForm.class) + private String principalName; + + /** + * 负责人电话 + */ + @NotBlank(message = "principalPhone不能为空",groups = EditCommunitySelfOrganizationForm.class) + private String principalPhone; + + /** + * 服务事项 + */ + @NotBlank(message = "serviceItem不能为空",groups = EditCommunitySelfOrganizationForm.class) + private String serviceItem; + + /** + * 社区自组织创建时间 + */ + @NotNull(message = "organizationCreatedTime不能为空",groups = EditCommunitySelfOrganizationForm.class) + private String organizationCreatedTime; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + + /** + * 社区自组织ID + */ + @NotBlank(message = "orgId不能为空",groups = EditCommunitySelfOrganizationForm.class) + private String orgId; + + /** + * 社区自组织人员 + */ + private List organizationPersonnel; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/EditSocietyOrgFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/EditSocietyOrgFormDTO.java new file mode 100644 index 0000000000..2acad633c0 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/EditSocietyOrgFormDTO.java @@ -0,0 +1,95 @@ +/** + * 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.dto.form; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.Date; + + +/** + * @Author sun + * @Description 修改、删除社会组织 + **/ +@Data +public class EditSocietyOrgFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 社会组织Id + */ + @NotBlank(message = "社会组织Id不能为空", groups = { Edit.class, Del.class }) + private String societyId; + /** + * 社会组织名称 + */ + @Length(max = 50, message = "社会组织名称不能超过50个字符",groups = {Edit.class}) + private String societyName; + /** + * 服务事项 + */ + @Length(max = 1000, message = "服务事项不能超过1000个字符",groups = {Edit.class}) + private String serviceMatters; + /** + * 负责人 + */ + @Length(max = 20, message = "负责人名称不能超过20个字符",groups = {Edit.class}) + private String personInCharge; + /** + * 负责人电话 + */ + @Length(max = 11, message = "负责人电话不能超过11个字符",groups = {Edit.class}) + private String mobile; + /** + * 起始服务时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date serviceStartTime; + /** + * 终止服务时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date serviceEndTime; + /** + * 绑定管理员[组织下录入的工作人员] + */ + private String adminStaffId; + /** + * 地址 + */ + private String address; + /** + * 经度 + */ + private String longitude; + /** + * 维度 + */ + private String latitude; + //token中userId + private String staffId; + + public interface Edit {} + public interface Del {} + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/GetListSocietyOrgFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/GetListSocietyOrgFormDTO.java new file mode 100644 index 0000000000..c04a76dc77 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/GetListSocietyOrgFormDTO.java @@ -0,0 +1,58 @@ +/** + * 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.dto.form; + +import lombok.Data; + +import javax.validation.constraints.Min; +import java.io.Serializable; + + +/** + * @Author sun + * @Description 社会组织列表查询 + **/ +@Data +public class GetListSocietyOrgFormDTO implements Serializable { + private static final long serialVersionUID = 1L; + + //社会组织名称 + private String societyName; + //负责人 + private String personInCharge; + //负责人电话 + private String mobile; + //起始服务时间 + private String serviceStartTime; + //终止服务时间 + private String serviceEndTime; + //页码 + @Min(1) + private Integer pageNo = 1; + //每页多少条 + private Integer pageSize = 20; + //是否分页(是:true 否:false) + private Boolean isPage = true; + //token中客户Id + private String customerId; + //token中userId + private String staffId; + //token中userId所属组织的pid + private String pids; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyActivityFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyActivityFormDTO.java new file mode 100644 index 0000000000..1f108568e1 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyActivityFormDTO.java @@ -0,0 +1,31 @@ +package com.epmet.dto.form; + +import lombok.Data; +import lombok.NoArgsConstructor; +import org.springframework.format.annotation.DateTimeFormat; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.Date; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2021/11/22 14:42 + */ +@NoArgsConstructor +@Data +public class PartyActivityFormDTO implements Serializable { + private static final long serialVersionUID = -2510068555703677L; + @NotBlank(message = "组织Id不能为空" ) + private String agencyId; + private String unitId; + private String title; + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + private Date startTime; + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + private Date endTime; + private String serviceMatter; + private Integer pageNo; + private Integer pageSize; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyUnitFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyUnitFormDTO.java new file mode 100644 index 0000000000..cf7841d93e --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyUnitFormDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.form; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2021/11/19 16:19 + */ +@NoArgsConstructor +@Data +public class PartyUnitFormDTO implements Serializable { + + private static final long serialVersionUID = 1256798619648265622L; + private String customerId; + private String agencyId; + private String unitName; + private String serviceMatter; + private String type; + private String contact; + private String contactMobile; + private Integer pageNo; + private Integer pageSize; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/AddCategoryFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/AddCategoryFormDTO.java new file mode 100644 index 0000000000..866a20bc6d --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/AddCategoryFormDTO.java @@ -0,0 +1,31 @@ +package com.epmet.dto.form.demand; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +@Data +public class AddCategoryFormDTO implements Serializable { + public interface AddUserInternalGroup { + } + + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + + @NotBlank(message = "客户id不能为空", groups = AddUserInternalGroup.class) + private String customerId; + + @NotBlank(message = "分类名称不能为空", groups = AddUserShowGroup.class) + @Length(max = 100, message = "分类名称最多输入100字", groups = AddUserShowGroup.class) + private String categoryName; + + @NotBlank(message = "请先选择一级分类", groups = AddUserShowGroup.class) + private String parentCategoryCode; + + @NotNull(message = "奖励积分不能为空", groups = AddUserShowGroup.class) + private Integer awardPoint; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/AddFirstCategoryFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/AddFirstCategoryFormDTO.java new file mode 100644 index 0000000000..b0a610d278 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/AddFirstCategoryFormDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.form.demand; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +@Data +public class AddFirstCategoryFormDTO implements Serializable { + private static final long serialVersionUID = -9011014064624688518L; + + public interface AddUserInternalGroup { + } + + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + + @NotBlank(message = "客户id不能为空", groups = AddUserInternalGroup.class) + private String customerId; + + @NotBlank(message = "分类名称不能为空", groups = AddUserShowGroup.class) + @Length(max = 20, message = "一级分类名称最多输入20字", groups = AddUserShowGroup.class) + private String categoryName; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/AssignFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/AssignFormDTO.java new file mode 100644 index 0000000000..b24a505a5f --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/AssignFormDTO.java @@ -0,0 +1,31 @@ +package com.epmet.dto.form.demand; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +@Data +public class AssignFormDTO implements Serializable { + private static final long serialVersionUID = -8844710824469349121L; + + public interface AddUserInternalGroup { + } + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + @NotBlank(message = "需求id不能为空", groups = AddUserInternalGroup.class) + private String demandRecId; + @NotBlank(message = "服务方类型不能为空", groups = AddUserShowGroup.class) + private String serviceType; + @NotBlank(message = "服务方不能为空", groups = AddUserShowGroup.class) + private String serverId; + + + + @NotBlank(message = "userId不能为空", groups = AddUserInternalGroup.class) + private String userId; + @NotBlank(message = "customerId不能为空", groups = AddUserInternalGroup.class) + private String customerId; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/CategoryAnalysisFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/CategoryAnalysisFormDTO.java new file mode 100644 index 0000000000..2e564db7cc --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/CategoryAnalysisFormDTO.java @@ -0,0 +1,41 @@ +package com.epmet.dto.form.demand; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + + + +/** + * 服务措施分析-柱状图入参 + */ +@Data +public class CategoryAnalysisFormDTO implements Serializable { + + public interface AddUserInternalGroup { + } + + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + + @NotBlank(message = "先选择组织或网格", groups = AddUserShowGroup.class) + private String orgId; + + @NotBlank(message = "组织:agency,网格:grid", groups = AddUserShowGroup.class) + private String orgType; + @NotBlank(message = "起止日期不能为空,格式yyyy-MM-dd", groups = AddUserShowGroup.class) + private String startDateId; + @NotBlank(message = "截止日期不能为空,格式yyyy-MM-dd", groups = AddUserShowGroup.class) + private String endDateId; + + @NotBlank(message = "先选择组织或网格", groups = AddUserInternalGroup.class) + private String cusotmerId; + + + /** + * orgType=agency时pid拼接上orgId + */ + private String gridPids; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandAddFromDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandAddFromDTO.java new file mode 100644 index 0000000000..f3a1c9ae0c --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandAddFromDTO.java @@ -0,0 +1,120 @@ +package com.epmet.dto.form.demand; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; +import org.hibernate.validator.constraints.Length; +import org.springframework.format.annotation.DateTimeFormat; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.Date; + +@Data +public class DemandAddFromDTO implements Serializable { + + private static final long serialVersionUID = 1589287946950749226L; + + public interface AddUserInternalGroup { + } + + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + public interface UpdateInternalGroup { + } + + @NotBlank(message = "需求id不能为空",groups = UpdateInternalGroup.class) + private String demandRecId; + + private String customerId; + private String currentUserId; + + + /** + * 网格id + */ + @NotBlank(message = "所属网格不能为空",groups = AddUserShowGroup.class) + private String gridId; + + /** + * 组织id + */ + private String agencyId; + + /** + * 网格的所有上级id + */ + private String gridPids; + + + + + /** + * 二级需求分类编码 + */ + @NotBlank(message = "需求类别不能为空",groups = AddUserShowGroup.class) + private String categoryCode; + + /** + * 父级需求分类编码 + */ + @NotBlank(message = "需求类别不能为空",groups = AddUserShowGroup.class) + private String parentCode; + + /** + * 需求内容1000字 + */ + @NotBlank(message = "需求内容不能为空",groups = AddUserShowGroup.class) + @Length(max = 1000,message = "需求内容至多输入1000字",groups = AddUserShowGroup.class) + private String content; + + /** + * 社区帮办:community;楼长帮办:building_caption;党员帮办:party;自身上报:self_help + */ + @NotBlank(message = "上报类型不能为空",groups = AddUserShowGroup.class) + private String reportType; + + /** + * 上报人姓名 + */ + @NotBlank(message = "上报人不能为空",groups = AddUserShowGroup.class) + private String reportUserName; + + /** + * 上报人联系方式。自身上报时存储注册居民的手机号 + */ + @NotBlank(message = "上报人联系方式不能为空",groups = AddUserShowGroup.class) + private String reportUserMobile; + + /** + * 上报时间 + */ + @NotNull(message = "上报时间不能为空",groups = AddUserShowGroup.class) + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date reportTime; + + /** + * 需求人:user.id或者ic_resi_user.id + */ + @NotNull(message = "需求人不能为空",groups = AddUserShowGroup.class) + private String demandUserId; + + /** + * 需求人姓名 + */ + @NotNull(message = "需求人不能为空",groups = AddUserShowGroup.class) + private String demandUserName; + + /** + * 需求人联系电话 + */ + @NotNull(message = "需求人不能为空",groups = AddUserShowGroup.class) + private String demandUserMobile; + + /** + * 希望服务时间 + */ + @NotNull(message = "服务时间不能为空",groups = AddUserShowGroup.class) + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date wantServiceTime; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandDetailFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandDetailFormDTO.java new file mode 100644 index 0000000000..25ec764f3f --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandDetailFormDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.form.demand; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +@Data +public class DemandDetailFormDTO implements Serializable { + private static final long serialVersionUID = 514538389753713095L; + public interface AddUserInternalGroup { + } + + @NotBlank(message = "demandRecId不能为空", groups = AddUserInternalGroup.class) + private String demandRecId; + + + @NotBlank(message = "tokenDto获取客户id不能为空", groups = IcResiUserDemandFromDTO.AddUserInternalGroup.class) + private String customerId; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandDictPageFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandDictPageFormDTO.java new file mode 100644 index 0000000000..3ff7d63c0b --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandDictPageFormDTO.java @@ -0,0 +1,17 @@ +package com.epmet.dto.form.demand; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +@Data +public class DemandDictPageFormDTO extends PageFormDTO implements Serializable { + public interface AddUserInternalGroup {} + + @NotBlank(message = "客户id不能为空",groups = AddUserInternalGroup.class) + private String customerId; + + private String firstCategoryCode; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandOptionFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandOptionFormDTO.java new file mode 100644 index 0000000000..64d77d5788 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandOptionFormDTO.java @@ -0,0 +1,19 @@ +package com.epmet.dto.form.demand; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +@Data +public class DemandOptionFormDTO implements Serializable { + private static final long serialVersionUID = -5335277881919236426L; + + public interface AddUserInternalGroup { + } + + @NotBlank(message = "token获取客户id不能为空", groups = AddUserInternalGroup.class) + private String customerId; + @NotBlank(message = "查询条件和查看居民详情:query;新增或修改居民信息:addorupdate", groups = AddUserInternalGroup.class) + private String purpose; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandRecId.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandRecId.java new file mode 100644 index 0000000000..7fdf7a29c5 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandRecId.java @@ -0,0 +1,10 @@ +package com.epmet.dto.form.demand; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class DemandRecId implements Serializable { + private String demandRecId; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandResearchAnalysisFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandResearchAnalysisFormDTO.java new file mode 100644 index 0000000000..893a383708 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandResearchAnalysisFormDTO.java @@ -0,0 +1,46 @@ +package com.epmet.dto.form.demand; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + + +/** + * 需求研判分析 入参DTO + */ +@Data +public class DemandResearchAnalysisFormDTO implements Serializable { + private static final long serialVersionUID = 3528172570410679765L; + public interface AddUserInternalGroup { + } + + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + + @NotBlank(message = "firstCategoryCode不能为空",groups = AddUserInternalGroup.class) + private String firstCategoryCode; + + //@NotBlank(message = "isResiUserId不能为空",groups = AddUserInternalGroup.class) + private String icResiUserId; + + private List epmetUserIdList; + + + @NotBlank(message = "tokenDto中的customerId不能为空",groups = AddUserInternalGroup.class) + private String customerId; + + /** + * 个人档案:personal-data + * 服务措施分析:demand-analysis + */ + @NotBlank(message = "queryOrigin不能为空:个人档案:personal-data;服务措施分析:demand-analysis",groups = AddUserInternalGroup.class) + private String queryOrigin; + + /** + * 当前查看的需求详情的需求id + */ + private String demandRecId; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/FinishStaffFromDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/FinishStaffFromDTO.java new file mode 100644 index 0000000000..06ca8a93fc --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/FinishStaffFromDTO.java @@ -0,0 +1,48 @@ +package com.epmet.dto.form.demand; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +@Data +public class FinishStaffFromDTO implements Serializable { + private static final long serialVersionUID = 591380873862126679L; + + public interface AddUserInternalGroup { + } + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + @NotBlank(message = "需求id不能为空", groups = AddUserInternalGroup.class) + private String demandRecId; + + @NotBlank(message = "服务id不能为空", groups = AddUserShowGroup.class) + private String serviceId; + + @NotNull(message = "实际服务开始不能为空", groups = AddUserShowGroup.class) + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date serviceStartTime; + + @NotNull(message = "实际服务结束不能为空", groups = AddUserShowGroup.class) + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date serviceEndTime; + + @NotBlank(message = "完成结果不能为空", groups = AddUserShowGroup.class) + private String finishResult; + private String finishDesc; + + @NotNull(message = "得分不能为空", groups = AddUserShowGroup.class) + private BigDecimal score; + + + + @NotBlank(message = "userId不能为空", groups = AddUserInternalGroup.class) + private String userId; + @NotBlank(message = "customerId不能为空", groups = AddUserInternalGroup.class) + private String customerId; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/IcResiUserDemandFromDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/IcResiUserDemandFromDTO.java new file mode 100644 index 0000000000..ea0f862854 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/IcResiUserDemandFromDTO.java @@ -0,0 +1,50 @@ +package com.epmet.dto.form.demand; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.List; + +@Data +public class IcResiUserDemandFromDTO implements Serializable { + public interface AddUserInternalGroup { + } + + + /** + * 居民信息录入的居民的id + */ + @NotBlank(message = "icResiUserId不能为空", groups = AddUserInternalGroup.class) + private String icResiUserId; + + /** + * icresiuser/persondata接口返参中有此值 + */ + private List epmetUserIdList; + + @NotNull(message = "pageNo不能为空", groups = AddUserInternalGroup.class) + private Integer pageNo; + @NotNull(message = "pageSize不能为空", groups = AddUserInternalGroup.class) + private Integer pageSize; + + /** + * 研判分析界面,查看同类型的需求可以用此接口,只需传入分类编码 + */ + private String firstCategoryCode; + + @NotBlank(message = "tokenDto获取客户id不能为空", groups = AddUserInternalGroup.class) + private String customerId; + + /** + * epmetUserIdList+userId + */ + private List userIds; + + + /** + * 当前查看的需求详情的需求id 可空 + */ + private String demandRecId; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/PageListAnalysisFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/PageListAnalysisFormDTO.java new file mode 100644 index 0000000000..464d1062a8 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/PageListAnalysisFormDTO.java @@ -0,0 +1,52 @@ +package com.epmet.dto.form.demand; + + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + * 数据分析-服务措施分析-分页查询接口入参 + */ +@Data +public class PageListAnalysisFormDTO implements Serializable { + private static final long serialVersionUID = 4993949289966075260L; + + public interface AddUserInternalGroup { + } + + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + + @NotNull(message = "页码不能为空", groups = AddUserInternalGroup.class) + private Integer pageNo; + + @NotNull(message = "每页数量不能为空", groups = AddUserInternalGroup.class) + private Integer pageSize; + + @NotBlank(message = "先选择组织或网格不能为空", groups = AddUserShowGroup.class) + private String orgId; + + @NotBlank(message = "orgType=grid或者agency,不能为空", groups = AddUserInternalGroup.class) + private String orgType; + + @NotBlank(message = "分类编码不能为空", groups = AddUserInternalGroup.class) + private String categoryCode; + @NotBlank(message = "上报时间起始日期不能为空,格式yyyy-MM-dd", groups = AddUserInternalGroup.class) + private String startDateId; + @NotBlank(message = "上报时间截止日期不能为空,格式yyyy-MM-dd", groups = AddUserInternalGroup.class) + private String endDateId; + + @NotBlank(message = "tokenDto中的customerId不能为空",groups = AddUserInternalGroup.class) + private String customerId; + /** + * orgType=agency时pid拼接上orgId + */ + private String gridPids; + + private Boolean pageFlag; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/ServiceQueryFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/ServiceQueryFormDTO.java new file mode 100644 index 0000000000..74d3ca3c7f --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/ServiceQueryFormDTO.java @@ -0,0 +1,42 @@ +package com.epmet.dto.form.demand; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +@Data +public class ServiceQueryFormDTO implements Serializable { + private static final long serialVersionUID = -2738313255838176318L; + + public interface AddUserInternalGroup { + } + + public interface SocietyOrgInternalGroup { + } + + /** + * 服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit; + */ + @NotBlank(message = "服务方类型不能为空", groups = AddUserInternalGroup.class) + private String serviceType; + + /** + * 名称检索 + */ + private String serviceName; + + /** + * 列表查询条件:query_demand 需求指派:add_demand + */ + @NotBlank(message = "新增需求:add_demand;列表查询:query_demand", groups = SocietyOrgInternalGroup.class) + private String queryPurpose; + + // -------------------------------------------------------- + // 以下参数从token中获取 + @NotBlank(message = "userId不能为空", groups = AddUserInternalGroup.class) + private String staffId; + @NotBlank(message = "customerId不能为空", groups = AddUserInternalGroup.class) + private String customerId; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/StaffCancelFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/StaffCancelFormDTO.java new file mode 100644 index 0000000000..09d920f55c --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/StaffCancelFormDTO.java @@ -0,0 +1,17 @@ +package com.epmet.dto.form.demand; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +@Data +public class StaffCancelFormDTO { + public interface AddUserInternalGroup {} + @NotBlank(message = "需求id不能为空",groups = AddUserInternalGroup.class) + private String demandRecId; + + @NotBlank(message = "userId不能为空", groups =AddUserInternalGroup.class) + private String userId; + @NotBlank(message = "customerId不能为空", groups = AddUserInternalGroup.class) + private String customerId; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/StatusFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/StatusFormDTO.java new file mode 100644 index 0000000000..879d632cc7 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/StatusFormDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.form.demand; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +@Data +public class StatusFormDTO implements Serializable { + + public interface AddUserInternalGroup { + } + + @NotBlank(message = "categoryId不能为空", groups = AddUserInternalGroup.class) + private String categoryId; + + @NotNull(message = "usableFlag不能为空", groups = AddUserInternalGroup.class) + private Boolean usableFlag; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/SubCodeFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/SubCodeFormDTO.java new file mode 100644 index 0000000000..d7952fd53a --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/SubCodeFormDTO.java @@ -0,0 +1,17 @@ +package com.epmet.dto.form.demand; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +@Data +public class SubCodeFormDTO implements Serializable { + public interface AddUserInternalGroup {} + @NotBlank(message = "客户id不能为空",groups = AddUserInternalGroup.class) + private String customerId; + @NotBlank(message = "parentCategoryCode不能为空",groups = AddUserInternalGroup.class) + private String parentCategoryCode; + + private String categoryName; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/UpdateFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/UpdateFormDTO.java new file mode 100644 index 0000000000..4929228f29 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/UpdateFormDTO.java @@ -0,0 +1,42 @@ +package com.epmet.dto.form.demand; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +@Data +public class UpdateFormDTO implements Serializable { + + public interface AddUserInternalGroup { + } + + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + + public interface First extends CustomerClientShowGroup { + } + + public interface Two extends CustomerClientShowGroup { + } + @NotBlank(message = "客户id不能为空", groups = AddUserInternalGroup.class) + private String customerId; + + @NotBlank(message = "categoryId不能为空", groups = AddUserInternalGroup.class) + private String categoryId; + + @NotNull(message = "等级不能为空", groups = AddUserInternalGroup.class) + private Integer level; + + + @NotBlank(message = "分类名称不能为空", groups = AddUserShowGroup.class) + @Length(max = 100, message = "分类名称最多输入100字", groups = First.class) + @Length(max = 20, message = "分类名称最多输入20字", groups = Two.class) + private String categoryName; + + @NotNull(message = "奖励积分不能为空", groups = Two.class) + private Integer awardPoint; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/UserDemandNameQueryFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/UserDemandNameQueryFormDTO.java new file mode 100644 index 0000000000..2a0141713f --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/UserDemandNameQueryFormDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto.form.demand; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotEmpty; +import java.io.Serializable; +import java.util.Set; + +@Data +public class UserDemandNameQueryFormDTO implements Serializable { + private static final long serialVersionUID = 1562457999313501989L; + + public interface AddUserInternalGroup {} + + @NotBlank(message = "客户id不能为空",groups =AddUserInternalGroup.class) + private String customerId; + + @NotEmpty(message = "分类编码不能为空",groups =AddUserInternalGroup.class) + private Set codeSet; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/UserDemandPageFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/UserDemandPageFormDTO.java new file mode 100644 index 0000000000..a574bb3100 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/UserDemandPageFormDTO.java @@ -0,0 +1,77 @@ +package com.epmet.dto.form.demand; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; + +import java.io.Serializable; + +@Data +public class UserDemandPageFormDTO extends PageFormDTO implements Serializable { + + private String customerId; + private String currentStaffId; + private String gridPids; + + + /** + * 网格id + */ + private String gridId; + + + + /** + * 分类的编码 + */ + private String categoryCode; + + /** + * 分类的级别 + */ + private Integer level; + + + + /** + * 需求人姓名 + */ + private String demandUserName; + + /** + * 上报时间开始 + */ + private String reportStartTime; + + /** + * 上报时间截止 + */ + private String reportEndTime; + + /** + * 待处理:pending;已取消canceled;已派单:assigned;已接单:have_order;已完成:finished + */ + private String status; + + + + + /** + * 服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit; + */ + private String serviceType; + + /** + * 服务方id + */ + private String serverId; + + /** + * 希望服务时间开始 + */ + private String wantServiceStartTime; + + /** + * 希望截止 + */ + private String wantServiceEndTime; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/VolunteerCommonFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/VolunteerCommonFormDTO.java new file mode 100644 index 0000000000..c8893697a8 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/VolunteerCommonFormDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.form.resi; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; + +/** + * @Description + * @Author wangxianzhang + * @Date 2021/12/10 6:10 下午 + * @Version 1.0 + */ +@Data +public class VolunteerCommonFormDTO { + + public interface VolunteerPage { + } + + @NotBlank(message = "客户ID不能为空", groups = {VolunteerPage.class}) + private String customerId; + + private Integer pageNo = 0; + + private Integer pageSize = 20; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/ActivityStatisticsDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/ActivityStatisticsDTO.java new file mode 100644 index 0000000000..a941c3eb8f --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/ActivityStatisticsDTO.java @@ -0,0 +1,16 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2021/12/9 16:05 + */ +@Data +public class ActivityStatisticsDTO implements Serializable { + private String unitCount; + private String activityCount; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/CommunitySelfOrganizationListDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/CommunitySelfOrganizationListDTO.java new file mode 100644 index 0000000000..47b2c02df8 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/CommunitySelfOrganizationListDTO.java @@ -0,0 +1,89 @@ +package com.epmet.dto.result; + +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.dto.IcCommunitySelfOrganizationPersonnelDTO; +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2021/11/19 1:47 下午 + * @DESC + */ +@Data +public class CommunitySelfOrganizationListDTO implements Serializable { + + private static final long serialVersionUID = 3208034033470533749L; + + /** + * 排序 + */ + private Integer sort; + + /** + * 社区自组织人数 + */ + private Integer organizationPersonCount; + + /** + * 社区自组织名字 + */ + private String organizationName; + + /** + * 服务事项 + */ + private String serviceItem; + + /** + * 负责人 + */ + private String principalName; + + /** + * 负责人电话 + */ + private String principalPhone; + + /** + * 自组织创办时间 + */ + private String organizationCreatedTime; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + + /** + * 社区自组织ID + */ + private String orgId; + + /** + * 社区自组织人员 + */ + private List organizationPersonnel; + + public CommunitySelfOrganizationListDTO() { + this.sort = NumConstant.ZERO; + this.organizationPersonCount = NumConstant.ZERO; + this.organizationName = ""; + this.serviceItem = ""; + this.principalName = ""; + this.principalPhone = ""; + this.organizationCreatedTime = ""; + this.longitude = ""; + this.latitude = ""; + this.orgId = ""; + this.organizationPersonnel = new ArrayList<>(); + } +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/CommunitySelfOrganizationListResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/CommunitySelfOrganizationListResultDTO.java new file mode 100644 index 0000000000..c8cb3375fd --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/CommunitySelfOrganizationListResultDTO.java @@ -0,0 +1,28 @@ +package com.epmet.dto.result; + +import com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2021/11/19 1:47 下午 + * @DESC + */ +@Data +public class CommunitySelfOrganizationListResultDTO implements Serializable { + + private static final long serialVersionUID = 3208034033470533749L; + + private Integer total; + + private List list; + + public CommunitySelfOrganizationListResultDTO() { + this.total = NumConstant.ZERO; + this.list = new ArrayList<>(); + } +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/GetListSocietyOrgResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/GetListSocietyOrgResultDTO.java new file mode 100644 index 0000000000..376078ab10 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/GetListSocietyOrgResultDTO.java @@ -0,0 +1,73 @@ +/** + * 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.dto.result; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + * @Author sun + * @Description 社会组织列表查询 + **/ +@Data +public class GetListSocietyOrgResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + //集合总条数 + private Integer total; + //社会组织信息 + private List list; + + @Data + public class SocietyOrgList{ + //所属组织Id + private String agencyId; + //社会组织Id + private String societyId; + //社会组织名称 + private String societyName; + //服务事项 + private String serviceMatters; + //负责人姓名 + private String personInCharge; + //负责人电话 + private String mobile; + //起始服务时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date serviceStartTime; + //终止服务时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date serviceEndTime; + //绑定管理员[组织下Id录入的工作人员] + private String adminStaffId; + //绑定管理员[组织下录入的工作人员]姓名 + private String adminStaffName; + //地址 + private String address; + //经度 + private String longitude; + //维度 + private String latitude; + } + +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PartyUnitDistributionResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PartyUnitDistributionResultDTO.java new file mode 100644 index 0000000000..e8ef54c842 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PartyUnitDistributionResultDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2021/12/9 10:05 + */ +@Data +public class PartyUnitDistributionResultDTO implements Serializable { + private static final long serialVersionUID = -4066938451623510159L; + private String id; + private String name; + private String type; + private String longitude; + private String latitude; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/SocietyOrgListResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/SocietyOrgListResultDTO.java new file mode 100644 index 0000000000..1650882b84 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/SocietyOrgListResultDTO.java @@ -0,0 +1,63 @@ +/** + * 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.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author sun + * @Description 社会组织列表查询 + **/ +@Data +public class SocietyOrgListResultDTO implements Serializable { + private static final long serialVersionUID = 1L; + + //所属组织Id + private String agencyId; + //所属组织名称 + private String agencyName; + //社会组织Id + private String societyId; + //社会组织名称 + private String societyName; + //服务事项 + private String serviceMatters; + //负责人姓名 + private String personInCharge; + //负责人电话 + private String mobile; + //起始服务时间 + //@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + //private Date serviceStartTime; + private String serviceStartTime; + //终止服务时间 + private String serviceEndTime; + //绑定管理员[组织下Id录入的工作人员] + private String adminStaffId; + //绑定管理员[组织下录入的工作人员]姓名 + private String adminStaffName = ""; + //地址 + private String address; + //经度 + private String longitude; + //维度 + private String latitude; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/CategoryAnalysisDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/CategoryAnalysisDTO.java new file mode 100644 index 0000000000..fc7a8eaad8 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/CategoryAnalysisDTO.java @@ -0,0 +1,19 @@ +package com.epmet.dto.result.demand; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.List; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class CategoryAnalysisDTO implements Serializable { + private static final long serialVersionUID = 3007202497989446585L; + private String categoryCode; + private String categoryName; + private Integer total; + private List detail; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/CategoryAnalysisDetail.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/CategoryAnalysisDetail.java new file mode 100644 index 0000000000..c082d11074 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/CategoryAnalysisDetail.java @@ -0,0 +1,32 @@ +package com.epmet.dto.result.demand; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class CategoryAnalysisDetail implements Serializable { + private static final long serialVersionUID = -4606305611297470078L; + /** + * 区域党建单位:party_unit; + * 社会组织:social_org; + * 社区自组织:community_org; + * 志愿者:volunteer; + * 未完成:unfinished + */ + private String legendCode; + + /** + * 服务方类型名称 + */ + private String legendName; + + /** + * 服务方的个数 + */ + private Integer totalService; + /** + * 需求个数 + */ + private Integer serviceDemandTotal; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/CategoryAnalysisResDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/CategoryAnalysisResDTO.java new file mode 100644 index 0000000000..1b39a2befd --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/CategoryAnalysisResDTO.java @@ -0,0 +1,17 @@ +package com.epmet.dto.result.demand; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.List; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class CategoryAnalysisResDTO implements Serializable { + private static final long serialVersionUID = -3112952115061180189L; + private List legend; + private List categoryList; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/CategoryDetailDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/CategoryDetailDTO.java new file mode 100644 index 0000000000..9e2802362a --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/CategoryDetailDTO.java @@ -0,0 +1,11 @@ +package com.epmet.dto.result.demand; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class CategoryDetailDTO extends CategoryAnalysisDetail implements Serializable { + private static final long serialVersionUID = 4459219163308113201L; + private String categoryCode; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandDataDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandDataDTO.java new file mode 100644 index 0000000000..f5ca265feb --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandDataDTO.java @@ -0,0 +1,13 @@ +package com.epmet.dto.result.demand; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +@Data +public class DemandDataDTO implements Serializable { + private String firstCategoryCode; + private String firstCategoryName; + private List demandList; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandPageResDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandPageResDTO.java new file mode 100644 index 0000000000..5b2a12c529 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandPageResDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto.result.demand; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.List; + +@Data +public class DemandPageResDTO implements Serializable { + private String customerId; + private String categoryId; + private String categoryCode; + private String parentCategoryCode; + private String categoryName; + private Integer level; + private Integer sort; + private BigDecimal awardPoint; + private Boolean usableFlag; + private List children; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandRecExcelResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandRecExcelResultDTO.java new file mode 100644 index 0000000000..15f02110b4 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandRecExcelResultDTO.java @@ -0,0 +1,52 @@ +package com.epmet.dto.result.demand; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +@Data +public class DemandRecExcelResultDTO implements Serializable { + + private static final long serialVersionUID = -1110606022410166621L; + + @Excel(name = "状态", width = 15) + private String statusName; + + @Excel(name = "所属网格", width = 40) + private String gridName; + + @Excel(name = "需求类型", width = 40) + private String categoryName; + + @Excel(name = "需求内容", width = 40) + private String content; + + @Excel(name = "上报类型", width = 40) + private String reportTypeName; + + @Excel(name = "上报人", width = 20) + private String reportUserName; + + @Excel(name = "上报时间", width = 25,format ="yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date reportTime; + + @Excel(name = "需求人", width = 20) + private String demandUserName; + + /** + * 尹作梅(志愿者) + * XXX(社会组织) + * XXX(社区自组织) + * XXX(区域化党建单位) + */ + @Excel(name = "服务方", width = 15) + private String serviceShowName; + + @Excel(name = "服务时间", width = 25,format ="yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date wantServiceTime; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandRecResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandRecResultDTO.java new file mode 100644 index 0000000000..e7b673d22f --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandRecResultDTO.java @@ -0,0 +1,124 @@ +package com.epmet.dto.result.demand; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + + +@Data +public class DemandRecResultDTO implements Serializable { + private static final long serialVersionUID = 1140730681599839420L; + + private String demandRecId; + //@JsonIgnore + private String gridId; + private String gridName; + private String agencyId; + + //@JsonIgnore + private String categoryCode; + private String parentCode; + private String categoryName; + private String firstCategoryCode; + private String firstCategoryName; + + + //社区帮办:community;楼长帮办:building_caption;党员帮办:party;自身上报:self_help + private String reportType; + private String reportTypeName; + + private String content; + private String reportUserName; + private String reportUserMobile; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date reportTime; + private String demandUserId; + private String demandUser; + private String demandUserName; + private String demandUserMobile; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date wantServiceTime; + + /** + * 待处理:pending;已取消canceled;已派单:assigned;已接单:have_order;已完成:finished + */ + private String status; + private String statusName; + + /** + * 完成结果:已解决 resolved,未解决 unresolved + + */ + private String finishResult; + + /** + * 取消时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date cancelTime; + + /** + * 1:已评价;0:未评价;评价后ic_user_satisfaction表有记录 + */ + private Boolean evaluateFlag; + /** + * 得分可为半星 + */ + private BigDecimal score; + + /** 服务情况********************************************************************/ + /** 服务情况********************************************************************/ + /** 服务情况********************************************************************/ + private String serviceId; + /** + * 志愿者的姓名 + * 社会组织名 + * 社区自组织的名字 + * 区域党建单位名称 + */ + private String serviceName; + /** + * 尹作梅(志愿者) + * XXX(社会组织) + * XXX(社区自组织) + * XXX(区域化党建单位) + */ + private String serviceShowName; + /** + * 只要有服务方就显示 + */ + private Boolean serviceShowFlag; + /** + * 服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit; + */ + private String serviceType; + + /** + * 志愿者:居民端爱心互助的志愿者userId; + */ + private String serverId; + + /** + * 实际服务开始时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date serviceStartTime; + + /** + * 实际服务结束时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date serviceEndTime; + + /** + * 完成情况 + */ + private String finishDesc; + + private String icResiUserId; + private String epmetUserId; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandResearchAnalysisResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandResearchAnalysisResultDTO.java new file mode 100644 index 0000000000..4828385812 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandResearchAnalysisResultDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.result.demand; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 数据分析-个人档案-需求详情,研判分析 + */ +@Data +public class DemandResearchAnalysisResultDTO extends HouseMemResDTO implements Serializable { + private static final long serialVersionUID = -1024304149893118204L; + + private List demandData; + /** + * 入参中给的,再返回去 + */ + private List epmetUserIdList; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/FinishResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/FinishResultDTO.java new file mode 100644 index 0000000000..96d03b9c2d --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/FinishResultDTO.java @@ -0,0 +1,15 @@ +package com.epmet.dto.result.demand; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 完成需求时,是否需要计算 区域化党建单位的满意度 + * + */ +@Data +public class FinishResultDTO implements Serializable { + private Boolean sendCalStatisfaction; + private String partyUnitId; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/HouseMemResDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/HouseMemResDTO.java new file mode 100644 index 0000000000..f8126473b5 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/HouseMemResDTO.java @@ -0,0 +1,22 @@ +package com.epmet.dto.result.demand; + +import com.epmet.dto.result.HouseUserDTO; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 数据分析-个人档案-需求详情,研判分析 + * 案件居民、家属 + */ +@Data +public class HouseMemResDTO implements Serializable { + /** + * 居民信息及家属列表 + */ + private String icResiUserId; + private String icUserName; + private String houseId; + private List houseUserList; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/IcResiUserReportDemandRes.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/IcResiUserReportDemandRes.java new file mode 100644 index 0000000000..19757a671c --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/IcResiUserReportDemandRes.java @@ -0,0 +1,36 @@ +package com.epmet.dto.result.demand; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +@Data +public class IcResiUserReportDemandRes implements Serializable { + private static final long serialVersionUID = 7043350476644105434L; + + private String demandRecId; + + @JsonIgnore + private String categoryCode; + + @JsonIgnore + private String parentCode; + + private String categoryName; + + private String content; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date wantServiceTime; + + //@JsonIgnore + private String status; + + private String statusName; + + private String firstCategoryCode; + private String firstCategoryName; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/LegendDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/LegendDTO.java new file mode 100644 index 0000000000..e1f6c9b282 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/LegendDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.result.demand; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * 服务措施分析-柱状图 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class LegendDTO implements Serializable { + private static final long serialVersionUID = 7205666632591639499L; + /** + * 区域党建单位:party_unit; + * 社会组织:social_org; + * 社区自组织:community_org; + * 志愿者:volunteer; + * 未完成:unfinished + */ + private String legendCode; + private String legendName; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/OptionDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/OptionDTO.java new file mode 100644 index 0000000000..c0cfd3b48d --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/OptionDTO.java @@ -0,0 +1,12 @@ +package com.epmet.dto.result.demand; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class OptionDTO implements Serializable { + private static final long serialVersionUID = -6722370308097497466L; + private String label; + private String value; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/ServiceStatDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/ServiceStatDTO.java new file mode 100644 index 0000000000..2393e942d6 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/ServiceStatDTO.java @@ -0,0 +1,23 @@ +package com.epmet.dto.result.demand; + + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +@Data +public class ServiceStatDTO implements Serializable { + /** + * 服务方id + */ + private String serverId; + /** + * 总分 + */ + private BigDecimal totalScore; + /** + * 服务的需求个数 + */ + private Integer demandCount; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/PageVolunteerInfoResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/PageVolunteerInfoResultDTO.java new file mode 100644 index 0000000000..d23f2023da --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/PageVolunteerInfoResultDTO.java @@ -0,0 +1,14 @@ +package com.epmet.dto.result.resi; + +import lombok.Data; + +/** + * @Description 志愿者信息分页查询结果 + * @Author wangxianzhang + * @Date 2021/12/10 6:17 下午 + * @Version 1.0 + */ +@Data +public class PageVolunteerInfoResultDTO { + private String userId; +} 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 b9f4424ab3..4bad8f25d7 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 @@ -5,7 +5,9 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.dto.ActInfoDTO; import com.epmet.dto.VolunteerInfoDTO; import com.epmet.dto.form.CommonCustomerFormDTO; -import com.epmet.feign.fallback.EpmetHeartOpenFeignClientFallback; +import com.epmet.dto.form.demand.UserDemandNameQueryFormDTO; +import com.epmet.dto.form.resi.VolunteerCommonFormDTO; +import com.epmet.dto.result.resi.PageVolunteerInfoResultDTO; import com.epmet.feign.fallback.EpmetHeartOpenFeignClientFallbackFactory; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.PathVariable; @@ -53,4 +55,15 @@ public interface EpmetHeartOpenFeignClient { **/ @PostMapping("/heart/resi/volunteer/queryuservolunteerinfo/{userId}") Result queryUserVolunteerInfo(@PathVariable("userId") String userId); + + @PostMapping("/heart/icresidemanddict/demangnames") + Result queryDemandNames(@RequestBody UserDemandNameQueryFormDTO formDTO); + + /** + * 分页查询志愿者列表 + * @param input + * @return + */ + @PostMapping("/heart/resi/volunteer/page") + Result> queryVolunteerPage(@RequestBody VolunteerCommonFormDTO input); } 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 23759f82c0..27c2c9bdc8 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 @@ -6,8 +6,10 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.dto.ActInfoDTO; import com.epmet.dto.VolunteerInfoDTO; import com.epmet.dto.form.CommonCustomerFormDTO; +import com.epmet.dto.form.demand.UserDemandNameQueryFormDTO; +import com.epmet.dto.form.resi.VolunteerCommonFormDTO; +import com.epmet.dto.result.resi.PageVolunteerInfoResultDTO; import com.epmet.feign.EpmetHeartOpenFeignClient; -import org.springframework.stereotype.Component; import java.util.List; @@ -48,4 +50,14 @@ public class EpmetHeartOpenFeignClientFallback implements EpmetHeartOpenFeignCli public Result queryUserVolunteerInfo(String userId) { return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "queryUserVolunteerInfo", userId); } + + @Override + public Result queryDemandNames(UserDemandNameQueryFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "queryDemandNames", formDTO); + } + + @Override + public Result> queryVolunteerPage(VolunteerCommonFormDTO input) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "queryVolunteerPage", input); + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/deploy/docker-compose-prod.yml b/epmet-module/epmet-heart/epmet-heart-server/deploy/docker-compose-prod.yml index c31a8c85a3..e2cec97f9c 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/deploy/docker-compose-prod.yml +++ b/epmet-module/epmet-heart/epmet-heart-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-heart-server: container_name: epmet-heart-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-heart-server:0.0.57 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-heart-server:0.0.64 ports: - "8111:8111" network_mode: host # 使用现有网络 @@ -15,4 +15,4 @@ services: resources: limits: cpus: '0.1' - memory: 600M \ No newline at end of file + memory: 600M diff --git a/epmet-module/epmet-heart/epmet-heart-server/pom.xml b/epmet-module/epmet-heart/epmet-heart-server/pom.xml index b5b36b0ee1..034780d7d5 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/pom.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.0.57 + 0.0.64 com.epmet epmet-heart @@ -82,6 +82,18 @@ 2.0.0 compile + + com.epmet + epmet-admin-client + 2.0.0 + compile + + + + com.epmet + epmet-commons-rocketmq + 2.0.0 + @@ -146,6 +158,10 @@ https://oapi.dingtalk.com/robot/send?access_token=e894e5690f9d6a527722974c71548ff6c0fe29bd956589a09e21b16442a35ed4 SECfcc020bdc83bb17a2c00f39977b1fbc409ef4188c7beaea11c5caa90eeaf87fd + + + true + 192.168.1.140:9876;192.168.1.141:9876 @@ -189,6 +205,10 @@ https://oapi.dingtalk.com/robot/send?access_token=e894e5690f9d6a527722974c71548ff6c0fe29bd956589a09e21b16442a35ed4 SECfcc020bdc83bb17a2c00f39977b1fbc409ef4188c7beaea11c5caa90eeaf87fd + + + false + 192.168.1.140:9876;192.168.1.141:9876 @@ -232,6 +252,10 @@ https://oapi.dingtalk.com/robot/send?access_token=e894e5690f9d6a527722974c71548ff6c0fe29bd956589a09e21b16442a35ed4 SECfcc020bdc83bb17a2c00f39977b1fbc409ef4188c7beaea11c5caa90eeaf87fd + + + true + 192.168.10.161:9876 @@ -263,7 +287,7 @@ false - false + true true https://epmet-open.elinkservice.cn/api/epmetscan/api @@ -275,6 +299,10 @@ https://oapi.dingtalk.com/robot/send?access_token=a5f66c3374b1642fe2142dbf56d5997e280172d4e8f2b546c9423a68c82ece6c SEC95f4f40b533ad379ea6a6d1af6dd37029383cfe1b7cd96dfac2678be2c1c3ed1 + + + true + 192.168.11.187:9876;192.168.11.184:9876 diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/IcCommunitySelfOrganizationConstant.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/IcCommunitySelfOrganizationConstant.java new file mode 100644 index 0000000000..ffd87124bf --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/IcCommunitySelfOrganizationConstant.java @@ -0,0 +1,11 @@ +package com.epmet.constant; + +/** + * @Author zxc + * @DateTime 2021/11/19 8:39 上午 + * @DESC + */ +public interface IcCommunitySelfOrganizationConstant { + + String ORG_TYPE_AGENCY = "agency"; +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/UserDemandConstant.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/UserDemandConstant.java new file mode 100644 index 0000000000..85168b8a32 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/UserDemandConstant.java @@ -0,0 +1,61 @@ +package com.epmet.constant; + +public interface UserDemandConstant { + + + /** + * 小程序用户自己上报:mini_resi;居民信息录入的居民:ic_resi_user + */ + String MINI_RESI = "mini_resi"; + String IC_RESI_USER = "ic_resi_user"; + + /** + * 上报类型:社区帮办:community;楼长帮办:building_caption;党员帮办:party;自身上报:self_help + */ + String COMMUNITY_REPORT="community"; + String BUILDING_CAPTION_REPORT="building_caption"; + String PARTY_REPORT="party"; + String SELF_HELP_REPORT="self_help"; + /** + * 待处理:pending;已取消canceled;已派单:assigned;已接单:have_order;已完成:finished + */ + String PENDING = "pending"; + String CANCELED = "canceled"; + String ASSIGNED = "assigned"; + String HAVE_ORDER = "have_order"; + String FINISHED = "finished"; + + + + /** + * 当前操作用户属于哪个端?工作端:staff;居民端:resi + */ + String STAFF="staff"; + String RESI="resi"; + + + /** + * 创建需求:create;撤销需求:cancel;指派:assign;接单:take_order;完成:finish;; + * 更新需求:update + */ + String CREATE="create"; + String UPDATE="update"; + String CANCEL="cancel"; + String ASSIGN="assign"; + String TAKE_ORDER="take_order"; + String FINISH="finish"; + +// 服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit; + String VOLUNTEER="volunteer"; + String SOCIAL_ORG="social_org"; + String COMMUNITY_ORG="community_org"; + String PARTY_UNIT="party_unit"; + + + /** + * 个人档案:personal-data + * 服务措施分析:demand-analysis + */ + String PERSONAL_DATA="personal-data"; + String DEMAND_ANALYSIS="demand-analysis"; +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ActCustomizedController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ActCustomizedController.java index 268e936521..e4aa2f1660 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ActCustomizedController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ActCustomizedController.java @@ -18,6 +18,7 @@ package com.epmet.controller; 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.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; @@ -42,7 +43,7 @@ import org.springframework.web.bind.annotation.RestController; @RestController @RequestMapping("actcustomized") public class ActCustomizedController { - + @Autowired private ActCustomizedService actCustomizedService; @@ -68,6 +69,7 @@ public class ActCustomizedController { * @description 保存自定义配置 * @Date 2020/7/20 17:25 **/ + @NoRepeatSubmit @RequirePermission(requirePermission = RequirePermissionEnum.MORE_HEART_CUSTOMIZED_SAVE) @PostMapping("save") public Result saveConfigs(@RequestBody SaveActCustomizedFormDTO formDTO){ @@ -89,4 +91,4 @@ public class ActCustomizedController { CustomerHeartConfigsResultDTO resultDTO = actCustomizedService.getCustomerHeartConfigs(formDTO); return new Result().ok(resultDTO); } -} \ No newline at end of file +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcCommunitySelfOrganizationController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcCommunitySelfOrganizationController.java new file mode 100644 index 0000000000..d9019b6c5b --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcCommunitySelfOrganizationController.java @@ -0,0 +1,213 @@ +/** + * 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.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.IcCommunitySelfOrganizationDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.form.demand.ServiceQueryFormDTO; +import com.epmet.dto.result.CommunitySelfOrganizationListResultDTO; +import com.epmet.dto.result.demand.OptionDTO; +import com.epmet.excel.ExportCommunitySelfOrganizationExcel; +import com.epmet.excel.IcCommunitySelfOrganizationExcel; +import com.epmet.service.IcCommunitySelfOrganizationService; +import org.apache.commons.io.FilenameUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 社区自组织表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@RestController +@RequestMapping("iccommunityselforganization") +public class IcCommunitySelfOrganizationController { + + @Autowired + private IcCommunitySelfOrganizationService icCommunitySelfOrganizationService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = icCommunitySelfOrganizationService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + IcCommunitySelfOrganizationDTO data = icCommunitySelfOrganizationService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody IcCommunitySelfOrganizationDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icCommunitySelfOrganizationService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody IcCommunitySelfOrganizationDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icCommunitySelfOrganizationService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + icCommunitySelfOrganizationService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = icCommunitySelfOrganizationService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, IcCommunitySelfOrganizationExcel.class); + } + + /** + * @Description 导出 社区自组织查询列表 + * @param response + * @param tokenDto + * @param formDTO + * @author zxc + * @date 2021/11/24 10:59 上午 + */ + @PostMapping("exportcommunityselforganization") + public void exportCommunitySelfOrganization(HttpServletResponse response,@LoginUser TokenDto tokenDto,@RequestBody CommunitySelfOrganizationListFormDTO formDTO) throws Exception { + CommunitySelfOrganizationListResultDTO resultDTO = icCommunitySelfOrganizationService.communitySelfOrganizationList(tokenDto, formDTO); + ExcelUtils.exportExcelToTarget(response, null, resultDTO.getList(), ExportCommunitySelfOrganizationExcel.class); + } + + /** + * @Description 导入 + * @param tokenDto + * @param response + * @param file + * @author zxc + * @date 2021/11/25 9:03 上午 + */ + @PostMapping("importcommunityselforganization") + public Result importCommunitySelfOrganization(@LoginUser TokenDto tokenDto, HttpServletResponse response, @RequestPart("file") MultipartFile file) throws Exception { + if (file.isEmpty()) { + throw new RenException("请上传文件"); + } + + // 校验文件类型 + String extension = FilenameUtils.getExtension(file.getOriginalFilename()); + if (!"xls".equals(extension) && !"xlsx".equals(extension)) { + throw new RenException("文件类型不匹配"); + } + icCommunitySelfOrganizationService.importCommunitySelfOrganization(tokenDto, response, file); + return new Result(); + } + + /** + * @Description 添加社区自组织 + * @param tokenDto + * @param formDTO + * @author zxc + * @date 2021/11/19 8:33 上午 + */ + @NoRepeatSubmit + @PostMapping("addcommunityselforganization") + public Result addCommunitySelfOrganization(@LoginUser TokenDto tokenDto, @RequestBody AddCommunitySelfOrganizationFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, AddCommunitySelfOrganizationFormDTO.AddCommunitySelfOrganizationForm.class); + icCommunitySelfOrganizationService.addCommunitySelfOrganization(tokenDto, formDTO); + return new Result(); + } + + /** + * @Description 修改社区自组织 + * @param tokenDto + * @param formDTO + * @author zxc + * @date 2021/11/19 10:12 上午 + */ + @NoRepeatSubmit + @PostMapping("editcommunityselforganization") + public Result editCommunitySelfOrganization(@LoginUser TokenDto tokenDto, @RequestBody EditCommunitySelfOrganizationFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, EditCommunitySelfOrganizationFormDTO.EditCommunitySelfOrganizationForm.class); + icCommunitySelfOrganizationService.editCommunitySelfOrganization(tokenDto, formDTO); + return new Result(); + } + + /** + * @Description 查询社区自组织列表 + * @param tokenDto + * @param formDTO + * @author zxc + * @date 2021/11/19 1:59 下午 + */ + @PostMapping("communityselforganizationlist") + public Result communitySelfOrganizationList(@LoginUser TokenDto tokenDto,@RequestBody CommunitySelfOrganizationListFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, CommunitySelfOrganizationListFormDTO.CommunitySelfOrganizationListForm.class); + return new Result().ok(icCommunitySelfOrganizationService.communitySelfOrganizationList(tokenDto, formDTO)); + } + + /** + * @Description 社区自组织删除 + * @param formDTO + * @author zxc + * @date 2021/11/19 4:22 下午 + */ + @PostMapping("delcommunityselforganization") + public Result delCommunitySelfOrganization(@RequestBody DelCommunitySelfOrganizationFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, DelCommunitySelfOrganizationFormDTO.DelCommunitySelfOrganizationForm.class); + icCommunitySelfOrganizationService.delCommunitySelfOrganization(formDTO); + return new Result(); + } + + /** + * 需求指派,选择社区自组织,调用此接口 + * 返回需求所属社区下的 组织 + * + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping("servicelist") + public Result> queryServiceList(@LoginUser TokenDto tokenDto, @RequestBody ServiceQueryFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(formDTO,ServiceQueryFormDTO.AddUserInternalGroup.class); + return new Result>().ok(icCommunitySelfOrganizationService.queryServiceList(formDTO)); + } +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcCommunitySelfOrganizationPersonnelController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcCommunitySelfOrganizationPersonnelController.java new file mode 100644 index 0000000000..76a64ce4f0 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcCommunitySelfOrganizationPersonnelController.java @@ -0,0 +1,94 @@ +/** + * 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.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.IcCommunitySelfOrganizationPersonnelDTO; +import com.epmet.excel.IcCommunitySelfOrganizationPersonnelExcel; +import com.epmet.service.IcCommunitySelfOrganizationPersonnelService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 社区自组织人员表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@RestController +@RequestMapping("iccommunityselforganizationpersonnel") +public class IcCommunitySelfOrganizationPersonnelController { + + @Autowired + private IcCommunitySelfOrganizationPersonnelService icCommunitySelfOrganizationPersonnelService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = icCommunitySelfOrganizationPersonnelService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + IcCommunitySelfOrganizationPersonnelDTO data = icCommunitySelfOrganizationPersonnelService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody IcCommunitySelfOrganizationPersonnelDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icCommunitySelfOrganizationPersonnelService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody IcCommunitySelfOrganizationPersonnelDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icCommunitySelfOrganizationPersonnelService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + icCommunitySelfOrganizationPersonnelService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = icCommunitySelfOrganizationPersonnelService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, IcCommunitySelfOrganizationPersonnelExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyActivityController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyActivityController.java new file mode 100644 index 0000000000..5071fd8710 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyActivityController.java @@ -0,0 +1,141 @@ +/** + * 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.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.commons.tools.utils.ExcelUtils; +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.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.IcPartyActivityDTO; +import com.epmet.dto.form.PartyActivityFormDTO; +import com.epmet.dto.result.demand.OptionDTO; +import com.epmet.excel.IcPartyActivityExcel; +import com.epmet.service.IcPartyActivityService; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.stream.Collectors; + + +/** + * 联建活动 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-19 + */ +@RestController +@RequestMapping("icpartyactivity") +public class IcPartyActivityController { + + @Autowired + private IcPartyActivityService icPartyActivityService; + + @PostMapping("search") + public Result> page(@RequestBody PartyActivityFormDTO formDTO){ + PageData page = icPartyActivityService.search(formDTO); + return new Result>().ok(page); + } + + @PostMapping("detail") + public Result get(@RequestBody IcPartyActivityDTO dto){ + IcPartyActivityDTO data = icPartyActivityService.get(dto.getId()); + return new Result().ok(data); + } + + @PostMapping("save") + @NoRepeatSubmit + public Result save(@LoginUser TokenDto tokenDto, @RequestBody IcPartyActivityDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icPartyActivityService.save(tokenDto, dto); + return new Result(); + } + + @PostMapping("delete") + public Result delete(@RequestBody IcPartyActivityDTO dto){ + icPartyActivityService.delete(dto.getId()); + return new Result(); + } + + @PostMapping("export") + public void export(@RequestBody PartyActivityFormDTO formDTO, HttpServletResponse response) throws Exception { + List list = icPartyActivityService.list(formDTO); + List excelList = new ArrayList<>(); + AtomicInteger i = new AtomicInteger(1); + if (CollectionUtils.isNotEmpty(list)) { + excelList = list.stream().map(item -> { + IcPartyActivityExcel excel = new IcPartyActivityExcel(); + excel.setIndex(i.getAndIncrement()); + excel.setUnitName(item.getUnitName()); + excel.setTitle(item.getTitle()); + excel.setAddress(item.getAddress()); + excel.setPeopleCount(item.getPeopleCount()); + excel.setActivityTime(DateUtils.format(item.getActivityTime(), DateUtils.DATE_TIME_PATTERN)); + return excel; + }).collect(Collectors.toList()); + } + ExcelUtils.exportExcelToTarget(response, null, excelList, IcPartyActivityExcel.class); + } + + /** + * 数据导入 + * @Param tokenDto + * @Param response + * @Param file + * @Return {@link Result} + * @Author zhaoqifeng + * @Date 2021/11/30 14:42 + */ + @PostMapping("import") + public Result importData(@LoginUser TokenDto tokenDto, HttpServletResponse response, @RequestPart("file") MultipartFile file) throws IOException { + return icPartyActivityService.importData(tokenDto, response, file); + } + + /** + * @Description 联建活动分类统计 + * @Param formDTO + * @Return {@link Result< List< OptionDTO>>} + * @Author zhaoqifeng + * @Date 2021/12/9 16:20 + */ + @PostMapping("statistics") + public Result> statistics(@RequestBody PartyActivityFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + return new Result>().ok(icPartyActivityService.statistics(formDTO)); + } + + @PostMapping("activitylist") + public Result> activityList(@LoginUser TokenDto tokenDto, @RequestBody PartyActivityFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO); + PageData page = icPartyActivityService.getActivityList(tokenDto, formDTO); + return new Result>().ok(page); + } +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java new file mode 100644 index 0000000000..27f193b978 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java @@ -0,0 +1,197 @@ +/** + * 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.controller; + +import com.epmet.commons.rocketmq.messages.CalPartyUnitSatisfactionFormDTO; +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.dto.result.OptionDataResultDTO; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.IcPartyUnitDTO; +import com.epmet.dto.form.PartyActivityFormDTO; +import com.epmet.dto.form.PartyUnitFormDTO; +import com.epmet.dto.form.demand.ServiceQueryFormDTO; +import com.epmet.dto.result.PartyUnitDistributionResultDTO; +import com.epmet.dto.result.demand.OptionDTO; +import com.epmet.excel.IcPartyUnitExcel; +import com.epmet.service.IcPartyUnitService; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.stream.Collectors; + + +/** + * 联建单位 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-19 + */ +@RestController +@RequestMapping("icpartyunit") +public class IcPartyUnitController { + + @Autowired + private IcPartyUnitService icPartyUnitService; + + @PostMapping("list") + public Result> search(@LoginUser TokenDto tokenDto, @RequestBody PartyUnitFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + PageData page = icPartyUnitService.search(formDTO); + return new Result>().ok(page); + } + + @PostMapping("detail") + public Result get(@RequestBody IcPartyUnitDTO formDTO){ + AssertUtils.isBlank(formDTO.getId(), "id"); + IcPartyUnitDTO data = icPartyUnitService.get(formDTO.getId()); + return new Result().ok(data); + } + + @PostMapping("save") + @NoRepeatSubmit + public Result save(@LoginUser TokenDto tokenDto, @RequestBody IcPartyUnitDTO dto){ + //效验数据 + dto.setCustomerId(tokenDto.getCustomerId()); + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icPartyUnitService.save(tokenDto, dto); + return new Result(); + } + + @PostMapping("delete") + public Result delete(@RequestBody IcPartyUnitDTO dto){ + //效验数据 + AssertUtils.isBlank(dto.getId(), "id"); + icPartyUnitService.delete(dto.getId()); + return new Result(); + } + + @PostMapping("export") + public void export(@LoginUser TokenDto tokenDto, @RequestBody PartyUnitFormDTO formDTO, HttpServletResponse response) throws Exception { + formDTO.setCustomerId(tokenDto.getCustomerId()); + List list = icPartyUnitService.list(formDTO); + List excelList = new ArrayList<>(); + AtomicInteger i = new AtomicInteger(1); + if (CollectionUtils.isNotEmpty(list)) { + excelList = list.stream().map(item -> { + IcPartyUnitExcel excel = new IcPartyUnitExcel(); + excel.setIndex(i.getAndIncrement()); + excel.setUnitName(item.getUnitName()); + excel.setContact(item.getContact()); + excel.setContactMobile(item.getContactMobile()); + excel.setType(item.getType()); + excel.setMemberCount(item.getMemberCount()); + excel.setRemark(item.getRemark()); + excel.setSatisfaction(item.getSatisfaction()); + excel.setServiceMatter(String.join(String.valueOf((char) 10), item.getServiceMatterList())); + return excel; + }).collect(Collectors.toList()); + } + ExcelUtils.exportExcelToTarget(response, null, excelList, IcPartyUnitExcel.class); + } + + /** + * 需求指派,选择区域化党建单位,调用此接口 + * 返回需求所属组织线上的数据 + * + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping("servicelist") + public Result> queryServiceList(@LoginUser TokenDto tokenDto, @RequestBody ServiceQueryFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(formDTO,ServiceQueryFormDTO.AddUserInternalGroup.class); + return new Result>().ok(icPartyUnitService.queryServiceList(formDTO)); + } + + @PostMapping("option") + public Result> option(@RequestBody IcPartyUnitDTO dto){ + AssertUtils.isBlank(dto.getAgencyId(), "agencyId"); + return new Result>().ok(icPartyUnitService.option(dto)); + } + + /** + * 数据导入 + * @Param tokenDto + * @Param response + * @Param file + * @Return {@link Result} + * @Author zhaoqifeng + * @Date 2021/11/30 14:42 + */ + @PostMapping("import") + public Result importData(@LoginUser TokenDto tokenDto, HttpServletResponse response, @RequestPart("file") MultipartFile file) throws IOException { + return icPartyUnitService.importData(tokenDto, response, file); + } + + /** + * @Description 按类型统计单位数量 + * @Param dto + * @Return {@link Result< List< OptionDataResultDTO>>} + * @Author zhaoqifeng + * @Date 2021/12/8 14:52 + */ + @PostMapping("typestatistics") + public Result> typeStatistics(@RequestBody PartyActivityFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO); + return new Result>().ok(icPartyUnitService.typeStatistics(formDTO)); + } + + /** + * @Description 联建单位分布 + * @Param formDTO + * @Return {@link Result< List< PartyUnitDistributionResultDTO>>} + * @Author zhaoqifeng + * @Date 2021/12/9 10:11 + */ + @PostMapping("distribution") + public Result> distribution(@RequestBody PartyActivityFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO); + return new Result>().ok(icPartyUnitService.distribution(formDTO)); + } + + + /** + * 计算区域化党建单位的群众满意度 + * + * @param formDTO + * @return + */ + @PostMapping("cal-partyunit-satisfation") + public Result calPartyUnitSatisfation(@RequestBody CalPartyUnitSatisfactionFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO,CalPartyUnitSatisfactionFormDTO.AddUserInternalGroup.class); + icPartyUnitService.calPartyUnitSatisfation(formDTO); + return new Result(); + } +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcResiDemandDictController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcResiDemandDictController.java new file mode 100644 index 0000000000..565a7a8423 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcResiDemandDictController.java @@ -0,0 +1,193 @@ +/** + * 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.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.dto.form.PageFormDTO; +import com.epmet.commons.tools.dto.result.OptionResultDTO; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.form.demand.*; +import com.epmet.dto.result.demand.DemandPageResDTO; +import com.epmet.dto.result.demand.OptionDTO; +import com.epmet.service.IcResiDemandDictService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + + +/** + * 居民需求字典表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-27 + */ +@RestController +@RequestMapping("icresidemanddict") +public class IcResiDemandDictController { + + @Autowired + private IcResiDemandDictService icResiDemandDictService; + + /** + * 分页列表查询 + * + * @param formDTO + * @return + */ + @PostMapping("pagelist") + public Result> page(@RequestBody DemandDictPageFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO,DemandDictPageFormDTO.AddUserInternalGroup.class, PageFormDTO.AddUserInternalGroup.class); + PageData page = icResiDemandDictService.page(formDTO); + return new Result>().ok(page); + } + + /** + * 添加一级分类 + * @param formDTO + * @return + */ + @PostMapping("addfirst") + public Result addFirstCategory(@RequestBody AddFirstCategoryFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO,AddFirstCategoryFormDTO.AddUserShowGroup.class,AddFirstCategoryFormDTO.AddUserInternalGroup.class); + icResiDemandDictService.addFirstCategory(formDTO); + return new Result(); + } + + /** + * 新增二级分类 + * @param formDTO + * @return + */ + @PostMapping("addchild") + public Result addChild(@RequestBody AddCategoryFormDTO formDTO ){ + ValidatorUtils.validateEntity(formDTO,AddCategoryFormDTO.AddUserShowGroup.class,AddCategoryFormDTO.AddUserInternalGroup.class); + icResiDemandDictService.addChild(formDTO); + return new Result(); + } + + /** + * 修改分类 + * + * + * @param formDTO + * @return + */ + @PostMapping("update") + public Result update(@RequestBody UpdateFormDTO formDTO) { + //效验数据 + ValidatorUtils.validateEntity(formDTO, UpdateFormDTO.AddUserInternalGroup.class, UpdateFormDTO.AddUserShowGroup.class); + if (NumConstant.ONE == formDTO.getLevel()) { + ValidatorUtils.validateEntity(formDTO, UpdateFormDTO.First.class); + } else if (NumConstant.TWO == formDTO.getLevel()) { + ValidatorUtils.validateEntity(formDTO, UpdateFormDTO.Two.class); + } + icResiDemandDictService.update(formDTO); + return new Result(); + } + + /** + * 启用或禁用 + * + * @param formDTO + * @return + */ + @PostMapping("updatestatus") + public Result updateStatus(@RequestBody StatusFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO,StatusFormDTO.AddUserInternalGroup.class); + icResiDemandDictService.updateStatus(formDTO); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + icResiDemandDictService.delete(ids); + return new Result(); + } + + @PostMapping("demandoption") + public Result> getDemandOptions(@LoginUser TokenDto tokenDto) { + return new Result>().ok(icResiDemandDictService.getDemandOptions(tokenDto.getCustomerId())); + } + + /** + * 服务措施管理界面, + * + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping("option-service") + public Result> getDemandOptionsV2(@LoginUser TokenDto tokenDto,@RequestBody DemandOptionFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + ValidatorUtils.validateEntity(formDTO,DemandOptionFormDTO.AddUserInternalGroup.class); + return new Result>().ok(icResiDemandDictService.getDemandOptionsV2(formDTO)); + } + + /** + * 居民信息列表需要展示分类名称,单独开出来这个接口,供user查询 + * @param formDTO + * @return + */ + @PostMapping("demangnames") + public Result queryDemandNames(@RequestBody UserDemandNameQueryFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO,UserDemandNameQueryFormDTO.AddUserInternalGroup.class); + return icResiDemandDictService.queryDemandNames(formDTO); + } + + /** + * 居民需求查询条件:一级分类列表 0 + * 区域化党建单位:服务事项下拉框 1010 + * + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping("subcodelist") + public Result> querySubCodeList(@LoginUser TokenDto tokenDto, @RequestBody SubCodeFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + ValidatorUtils.validateEntity(formDTO,SubCodeFormDTO.AddUserInternalGroup.class); + return new Result>().ok(icResiDemandDictService.querySubCodeList(formDTO)); + } + + + + + + + + + + + + + + + + + + + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcSocietyOrgController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcSocietyOrgController.java new file mode 100644 index 0000000000..786fc77928 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcSocietyOrgController.java @@ -0,0 +1,172 @@ +/** + * 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.controller; + +import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult; +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ExcelPoiUtils; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.form.AddSocietyOrgFormDTO; +import com.epmet.dto.form.EditSocietyOrgFormDTO; +import com.epmet.dto.form.GetListPlaceOrgFormDTO; +import com.epmet.dto.form.GetListSocietyOrgFormDTO; +import com.epmet.dto.form.demand.ServiceQueryFormDTO; +import com.epmet.dto.result.GetListPlaceOrgResultDTO; +import com.epmet.dto.result.GetListSocietyOrgResultDTO; +import com.epmet.dto.result.demand.OptionDTO; +import com.epmet.excel.IcSocietyOrgExcel; +import com.epmet.service.IcSocietyOrgService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.CollectionUtils; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.text.ParseException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + + +/** + * 社会组织管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Slf4j +@RestController +@RequestMapping("societyorg") +public class IcSocietyOrgController { + + @Autowired + private IcSocietyOrgService societyOrgService; + + /** + * @Author sun + * @Description 新增社会组织 + **/ + @PostMapping("add") + public Result add(@LoginUser TokenDto tokenDto, @RequestBody AddSocietyOrgFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, AddSocietyOrgFormDTO.Add.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + societyOrgService.add(formDTO); + return new Result(); + } + + /** + * @Author sun + * @Description 修改社会组织 + **/ + @PostMapping("edit") + public Result edit(@LoginUser TokenDto tokenDto, @RequestBody EditSocietyOrgFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, EditSocietyOrgFormDTO.Edit.class); + societyOrgService.edit(formDTO); + return new Result(); + } + + /** + * @Author sun + * @Description 删除社会组织 + **/ + @PostMapping("del") + public Result del(@LoginUser TokenDto tokenDto, @RequestBody EditSocietyOrgFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, EditSocietyOrgFormDTO.Del.class); + societyOrgService.del(formDTO.getSocietyId()); + return new Result(); + } + + /** + * @Author sun + * @Description 社会组织列表查询 + **/ + @PostMapping("getlist") + public Result getList(@LoginUser TokenDto tokenDto, @RequestBody GetListSocietyOrgFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + return new Result().ok(societyOrgService.getList(formDTO)); + } + + /** + * 需求指派,选择社会组织,调用此接口 + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping("servicelist") + public Result> queryServiceList(@LoginUser TokenDto tokenDto,@RequestBody ServiceQueryFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(formDTO,ServiceQueryFormDTO.AddUserInternalGroup.class,ServiceQueryFormDTO.SocietyOrgInternalGroup.class); + return new Result>().ok(societyOrgService.queryServiceList(formDTO)); + } + + /** + * @Author sun + * @Description 九小场所下组织列表导出 + **/ + @PostMapping("export") + public void export(@LoginUser TokenDto tokenDto, @RequestBody GetListSocietyOrgFormDTO formDTO, HttpServletResponse response) throws Exception { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + formDTO.setIsPage(false); + GetListSocietyOrgResultDTO list = societyOrgService.getList(formDTO); + ExcelUtils.exportExcelToTarget(response, null, list.getList(), IcSocietyOrgExcel.class); + } + + /** + * @Author sun + * @Description 九小场所下组织列表导入 + **/ + @PostMapping("import") + public Result importExcel(@LoginUser TokenDto tokenDTO, @RequestParam("file") MultipartFile file) throws IOException, ParseException { + + ExcelImportResult importResult = ExcelPoiUtils.importExcelMore(file, 0, 1, IcSocietyOrgExcel.class); + List failList = importResult.getFailList(); + + //存放错误数据行号 + List numList = new ArrayList<>(); + if (!CollectionUtils.isEmpty(failList)) { + for (IcSocietyOrgExcel entity : failList) { + log.warn("第{}行,{}", entity.getRowNum(), entity.getErrorMsg());//打印失败的行 和失败的信息 + numList.add(entity.getRowNum()); + } + //return new Result().error(8001,failList.get(0).getErrorMsg()); + } + List result = importResult.getList(); + + List resultList = societyOrgService.importExcel(tokenDTO.getCustomerId(), result, tokenDTO.getUserId(), numList); + String str = String.format("共%s条,成功导入%s条。", numList.size() + result.size(), numList.size() + result.size() - resultList.size()); + if (resultList.size() > NumConstant.ZERO) { + Collections.sort(resultList); + String subList = resultList.stream().map(String::valueOf).collect(Collectors.joining("、")); + log.warn(str + "第" + subList + "行未成功!"); + return new Result().error(9999, str + "第" + subList + "行未成功!"); + } + return new Result().ok(str); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java new file mode 100644 index 0000000000..06c991b31c --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java @@ -0,0 +1,292 @@ +/** + * 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.controller; + +import com.epmet.commons.rocketmq.messages.CalPartyUnitSatisfactionFormDTO; +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.constant.SystemMessageType; +import com.epmet.constant.UserDemandConstant; +import com.epmet.dto.form.SystemMsgFormDTO; +import com.epmet.dto.form.demand.*; +import com.epmet.dto.result.demand.*; +import com.epmet.dto.result.demand.DemandRecResultDTO; +import com.epmet.dto.result.demand.FinishResultDTO; +import com.epmet.dto.result.demand.IcResiUserReportDemandRes; +import com.epmet.dto.result.demand.OptionDTO; +import com.epmet.feign.EpmetMessageOpenFeignClient; +import com.epmet.service.*; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.CollectionUtils; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; + + +/** + * 居民需求记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-19 + */ +@Slf4j +@RestController +@RequestMapping("userdemand") +public class IcUserDemandRecController { + + @Autowired + private IcUserDemandRecService icUserDemandRecService; + @Autowired + private VolunteerInfoService volunteerInfoService; + @Autowired + private IcSocietyOrgService societyOrgService; + @Autowired + private IcCommunitySelfOrganizationService icCommunitySelfOrganizationService; + @Autowired + private IcPartyUnitService icPartyUnitService; + @Autowired + private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; + + /** + * 根据服务方类型查询 下拉框 + * 服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit; + * + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping("servicelist") + public Result> queryServiceList(@LoginUser TokenDto tokenDto, @RequestBody ServiceQueryFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(formDTO, ServiceQueryFormDTO.AddUserInternalGroup.class); + if (UserDemandConstant.VOLUNTEER.equals(formDTO.getServiceType())) { + return new Result>().ok(volunteerInfoService.queryListVolunteer(tokenDto.getCustomerId(), formDTO.getServiceName())); + } else if (UserDemandConstant.SOCIAL_ORG.equals(formDTO.getServiceType())) { + ValidatorUtils.validateEntity(formDTO, ServiceQueryFormDTO.AddUserInternalGroup.class, ServiceQueryFormDTO.SocietyOrgInternalGroup.class); + return new Result>().ok(societyOrgService.queryServiceList(formDTO)); + } else if (UserDemandConstant.COMMUNITY_ORG.equals(formDTO.getServiceType())) { + return new Result>().ok(icCommunitySelfOrganizationService.queryServiceList(formDTO)); + } else if (UserDemandConstant.PARTY_UNIT.equals(formDTO.getServiceType())) { + return new Result>().ok(icPartyUnitService.queryServiceList(formDTO)); + } + return new Result<>(); + } + + /** + * 新增需求 + * + * @param tokenDto + * @param fromDTO + * @return + */ + @PostMapping("add") + public Result add(@LoginUser TokenDto tokenDto, @RequestBody DemandAddFromDTO fromDTO){ + fromDTO.setCustomerId(tokenDto.getCustomerId()); + fromDTO.setCurrentUserId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(fromDTO,DemandAddFromDTO.AddUserShowGroup.class); + return new Result().ok(icUserDemandRecService.add(fromDTO)); + } + + /** + * 更新需求 + * 只有待处理的才可以编辑 + * + * @param tokenDto + * @param fromDTO + * @return + */ + @PostMapping("update") + public Result update(@LoginUser TokenDto tokenDto, @RequestBody DemandAddFromDTO fromDTO){ + fromDTO.setCustomerId(tokenDto.getCustomerId()); + fromDTO.setCurrentUserId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(fromDTO,DemandAddFromDTO.UpdateInternalGroup.class,DemandAddFromDTO.AddUserShowGroup.class); + return new Result().ok(icUserDemandRecService.update(fromDTO)); + } + + /** + * 列表查询 分页 + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping("pagelist") + public Result> pageList(@LoginUser TokenDto tokenDto, @RequestBody UserDemandPageFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setCurrentStaffId(tokenDto.getUserId()); + return new Result>().ok(icUserDemandRecService.pageList(formDTO)); + } + + + /** + * 取消,未完成之前都可以取消 + * + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping("cancel") + public Result cancel(@LoginUser TokenDto tokenDto,@RequestBody StaffCancelFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(formDTO,StaffCancelFormDTO.AddUserInternalGroup.class); + icUserDemandRecService.cancel(formDTO); + return new Result(); + } + + + /** + * 指派 + * 待处理:pending;已取消canceled;已派单:assigned;已接单:have_order;已完成:finished + * 待处理+已派单才可以指派 + * + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping("assign") + public Result assign(@LoginUser TokenDto tokenDto,@RequestBody AssignFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(formDTO,AssignFormDTO.AddUserShowGroup.class,AssignFormDTO.AddUserInternalGroup.class); + icUserDemandRecService.assign(formDTO); + return new Result(); + } + + /** + * 完成并评价 + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping("finish") + public Result finish(@LoginUser TokenDto tokenDto,@RequestBody FinishStaffFromDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(formDTO,FinishStaffFromDTO.AddUserShowGroup.class,FinishStaffFromDTO.AddUserInternalGroup.class); + FinishResultDTO finishResultDTO=icUserDemandRecService.finish(formDTO); + if(finishResultDTO.getSendCalStatisfaction()){ + CalPartyUnitSatisfactionFormDTO mqMsg = new CalPartyUnitSatisfactionFormDTO(); + mqMsg.setCustomerId(formDTO.getCustomerId()); + mqMsg.setPartyUnitId(finishResultDTO.getPartyUnitId()); + SystemMsgFormDTO form = new SystemMsgFormDTO(); + form.setMessageType(SystemMessageType.CAL_PARTY_UNIT_SATISFACTION); + form.setContent(mqMsg); + epmetMessageOpenFeignClient.sendSystemMsgByMQ(form); + } + return new Result(); + } + + + /** + * 数据分析-个人档案,居民需求列表table + * + * @param formDTO + * @return + */ + @PostMapping("mydemand") + public Result> queryMyDemand(@LoginUser TokenDto tokenDto,@RequestBody IcResiUserDemandFromDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + ValidatorUtils.validateEntity(formDTO,IcResiUserDemandFromDTO.AddUserInternalGroup.class); + return new Result>().ok(icUserDemandRecService.queryMyDemand(formDTO)); + } + + /** + * 数据分析-个人档案、居民需求列表-查看需求详情 + * + * @param formDTO + * @return + */ + @PostMapping("demandDetail") + public Result queryDemandDetail(@LoginUser TokenDto tokenDto, @RequestBody DemandDetailFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + ValidatorUtils.validateEntity(formDTO,DemandDetailFormDTO.AddUserInternalGroup.class); + return new Result().ok(icUserDemandRecService.queryDemandDetail(formDTO)); + } + + + /** + * 数据分析-个人档案-需求详情,研判分析 + * + * @param formDTO + * @return + */ + @PostMapping("demand-research-analysis") + public Result queryDemandResearchAnalysis(@LoginUser TokenDto tokenDto,@RequestBody DemandResearchAnalysisFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + ValidatorUtils.validateEntity(formDTO, DemandResearchAnalysisFormDTO.AddUserInternalGroup.class); + return new Result().ok(icUserDemandRecService.queryDemandResearchAnalysis(formDTO)); + } + + /** + * 数分析-服务措施分析-分页查询 + * + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping("pagelist-analysis") + public Result> pageListAnalysis(@LoginUser TokenDto tokenDto,@RequestBody PageListAnalysisFormDTO formDTO){ + formDTO.setPageFlag(true); + formDTO.setCustomerId(tokenDto.getCustomerId()); + ValidatorUtils.validateEntity(formDTO,PageListAnalysisFormDTO.AddUserShowGroup.class,PageListAnalysisFormDTO.AddUserInternalGroup.class); + return new Result>().ok(icUserDemandRecService.pageListAnalysis(formDTO)); + } + + /** + * 数据分析-服务措施分析-导出 + * @param response + * @param tokenDto + * @param formDTO + * @throws Exception + */ + @PostMapping("analysis-export") + public Result analysisExport(HttpServletResponse response,@LoginUser TokenDto tokenDto, @RequestBody PageListAnalysisFormDTO formDTO)throws Exception { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setPageFlag(false); + PageData res=icUserDemandRecService.pageListAnalysis(formDTO); + if (!CollectionUtils.isEmpty(res.getList())) { + ExcelUtils.exportExcelToTarget(response, null, res.getList(), DemandRecExcelResultDTO.class); + return new Result(); + } + return new Result(); + } + + /** + * 数据分析-服务措施分析-柱状图 + * + * @return + */ + @PostMapping("category-analysis") + public Result categoryAnalysis(@LoginUser TokenDto tokenDto,@RequestBody CategoryAnalysisFormDTO formDTO){ + formDTO.setCusotmerId(tokenDto.getCustomerId()); + ValidatorUtils.validateEntity(formDTO,CategoryAnalysisFormDTO.AddUserShowGroup.class,CategoryAnalysisFormDTO.AddUserInternalGroup.class); + return new Result().ok(icUserDemandRecService.categoryAnalysis(formDTO)); + } + + +} \ No newline at end of file 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 00a07440ca..e1d18e5536 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 @@ -23,8 +23,12 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.VolunteerInfoDTO; import com.epmet.dto.form.CommonCustomerFormDTO; +import com.epmet.dto.form.demand.ServiceQueryFormDTO; import com.epmet.dto.form.resi.ResiSendSmsCodeFormDTO; import com.epmet.dto.form.resi.ResiVolunteerAuthenticateFormDTO; +import com.epmet.dto.form.resi.VolunteerCommonFormDTO; +import com.epmet.dto.result.demand.OptionDTO; +import com.epmet.dto.result.resi.PageVolunteerInfoResultDTO; import com.epmet.dto.result.resi.ResiVolunteerInfoResultDTO; import com.epmet.service.VolunteerInfoService; import org.springframework.beans.factory.annotation.Autowired; @@ -112,4 +116,32 @@ public class ResiVolunteerController { public Result queryUserVolunteerInfo(@PathVariable("userId")String userId){ return new Result().ok(volunteerInfoService.queryUserVolunteerInfo(userId)); } + + /** + * 需求指派时,服务对象选择志愿者,调用此接口查询当前客户下所有的志愿者信息:姓名(手机号) + * + * @param tokenDto + * @return + */ + @PostMapping("listprofile") + public Result> queryListVolunteer(@LoginUser TokenDto tokenDto,@RequestBody ServiceQueryFormDTO formDTO){ + return new Result>().ok(volunteerInfoService.queryListVolunteer(tokenDto.getCustomerId(),formDTO.getServiceName())); + } + + /** + * 分页查询志愿者列表 + * @param input + * @return + */ + @PostMapping("page") + public Result> queryVolunteerPage(@RequestBody VolunteerCommonFormDTO input) { + + ValidatorUtils.validateEntity(input, VolunteerCommonFormDTO.VolunteerPage.class); + + Integer pageNo = input.getPageNo(); + Integer pageSize = input.getPageSize(); + String customerId = input.getCustomerId(); + List l = volunteerInfoService.queryVolunteerPage(customerId, pageNo, pageSize); + return new Result>().ok(l); + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcCommunitySelfOrganizationDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcCommunitySelfOrganizationDao.java new file mode 100644 index 0000000000..efc9881b2a --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcCommunitySelfOrganizationDao.java @@ -0,0 +1,67 @@ +/** + * 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.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.form.CommunitySelfOrganizationListFormDTO; +import com.epmet.dto.result.CommunitySelfOrganizationListDTO; +import com.epmet.dto.result.demand.OptionDTO; +import com.epmet.entity.IcCommunitySelfOrganizationEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 社区自组织表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Mapper +public interface IcCommunitySelfOrganizationDao extends BaseDao { + + /** + * @Description 自组织修改 + * @param formDTO + * @author zxc + * @date 2021/11/19 2:04 下午 + */ + void updateCommunitySelfOrganization(IcCommunitySelfOrganizationEntity formDTO); + + /** + * @Description 查询社区自组织列表 + * @param formDTO + * @author zxc + * @date 2021/11/19 2:05 下午 + */ + List selectCommunitySelfOrganizationList(CommunitySelfOrganizationListFormDTO formDTO); + + List selectListByAgencyId(@Param("customerId") String customerId, + @Param("agencyIds") List agencyIds, + @Param("orgName") String orgName); + + /** + * @Description 根据名字查询存在的自组织 + * @param names + * @author zxc + * @date 2021/11/25 9:07 上午 + */ + List selectOrgByOrgName(@Param("names")List names, @Param("customerId") String customerId); + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcCommunitySelfOrganizationPersonnelDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcCommunitySelfOrganizationPersonnelDao.java new file mode 100644 index 0000000000..4bd2fde9f4 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcCommunitySelfOrganizationPersonnelDao.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.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcCommunitySelfOrganizationPersonnelEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 社区自组织人员表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Mapper +public interface IcCommunitySelfOrganizationPersonnelDao extends BaseDao { + + /** + * @Description 根据社区自组织ID删除 + * @param orgId + * @author zxc + * @date 2021/11/19 11:19 上午 + */ + void deleteByOrgId(@Param("orgId")String orgId); + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyActivityDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyActivityDao.java new file mode 100644 index 0000000000..bb7e41c2ed --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyActivityDao.java @@ -0,0 +1,44 @@ +/** + * 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.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.form.PartyActivityFormDTO; +import com.epmet.dto.result.ActivityStatisticsDTO; +import com.epmet.entity.IcPartyActivityEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 联建活动 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-19 + */ +@Mapper +public interface IcPartyActivityDao extends BaseDao { + + /** + * @Description 联建活动统计 + * @Param formDTO + * @Return {@link ActivityStatisticsDTO} + * @Author zhaoqifeng + * @Date 2021/12/9 16:06 + */ + ActivityStatisticsDTO getStatistics(PartyActivityFormDTO formDTO); + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyUnitDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyUnitDao.java new file mode 100644 index 0000000000..faddda7644 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyUnitDao.java @@ -0,0 +1,69 @@ +/** + * 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.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.commons.tools.dto.result.OptionDataResultDTO; +import com.epmet.dto.result.PartyUnitDistributionResultDTO; +import com.epmet.dto.result.demand.OptionDTO; +import com.epmet.entity.IcPartyUnitEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.math.BigDecimal; +import java.util.List; + +/** + * 联建单位 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-19 + */ +@Mapper +public interface IcPartyUnitDao extends BaseDao { + + /** + * 需求指派,选择区域化党建单位,调用此接口 + * @param agencyIds + * @param unitName + * @return + */ + List selectListByAgencyId(@Param("agencyIds") List agencyIds, + @Param("unitName") String unitName, + @Param("customerId")String customerId); + + /** + * 单位分类统计 + * @Param agencyId + * @Return {@link java.util.List} + * @Author zhaoqifeng + * @Date 2021/12/8 15:25 + */ + List getTypeStatistics(@Param("agencyId")String agencyId); + + /** + * @Description 联建单位分布 + * @Param agencyId + * @Return {@link List< PartyUnitDistributionResultDTO>} + * @Author zhaoqifeng + * @Date 2021/12/9 14:24 + */ + List getDistribution(@Param("agencyId")String agencyId); + + int updateSatisfaction(@Param("partyUnitId") String serverId, @Param("satisfaction") BigDecimal satisfaction); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcResiDemandDictDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcResiDemandDictDao.java new file mode 100644 index 0000000000..211ab20e8d --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcResiDemandDictDao.java @@ -0,0 +1,69 @@ +/** + * 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.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.commons.tools.dto.result.OptionResultDTO; +import com.epmet.dto.result.demand.DemandPageResDTO; +import com.epmet.dto.result.demand.OptionDTO; +import com.epmet.entity.IcResiDemandDictEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Set; + +/** + * 居民需求字典表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-27 + */ +@Mapper +public interface IcResiDemandDictDao extends BaseDao { + List selectDemandOptions(@Param("customerId") String customerId,@Param("usableFlagFormValue") String usableFlagFormValue); + List selectChildDemands(@Param("customerId")String customerId, @Param("parentCode") String parentCode,@Param("usableFlagFormValue") String usableFlagFormValue); + + String selectCategoryNames(@Param("customerId") String customerId,@Param("codeSet") Set codeSet); + + List selectByPCode(@Param("pcode") String pcode, + @Param("customerId") String customerId, + @Param("categoryName")String categoryName); + + List pageSelect(@Param("customerId") String customerId, @Param("firstCategoryCode")String firstCategoryCode); + + List selectChild(@Param("customerId") String customerId, @Param("parentCode")String parentCode); + + int selectCountName(@Param("customerId") String customerId, + @Param("categoryName")String categoryName, + @Param("level")int level, + @Param("parentCode")String parentCode, + @Param("id")String id); + + Integer selectMaxCategoryCode(@Param("customerId") String customerId, + @Param("level") Integer level, + @Param("parentCode") String parentCode); + + Integer selectMaxSort(@Param("customerId") String customerId, + @Param("level") int level, + @Param("parentCode") String parentCode); + + List selectSecondCodes(@Param("customerId") String customerId, @Param("cateogryCodes") List categoryCodes); + + String selectNameByCode(@Param("customerId")String customerId, @Param("categoryCode") String categoryCode); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcSocietyOrgDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcSocietyOrgDao.java new file mode 100644 index 0000000000..60f62e3a8d --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcSocietyOrgDao.java @@ -0,0 +1,63 @@ +/** + * 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.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.IcSocietyOrgDTO; +import com.epmet.dto.form.GetListSocietyOrgFormDTO; +import com.epmet.dto.result.GetListSocietyOrgResultDTO; +import com.epmet.dto.result.SocietyOrgListResultDTO; +import com.epmet.dto.result.demand.OptionDTO; +import com.epmet.entity.IcSocietyOrgEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 社会组织管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Mapper +public interface IcSocietyOrgDao extends BaseDao { + + /** + * @Author sun + * @Description 社会组织列表查询 + **/ + List getList(GetListSocietyOrgFormDTO formDTO); + + /** + * 需求指派,选择社会组织,调用此接口 + * + * @param agencyIds + * @return + */ + List selectListByAgencyId(@Param("agencyIds")List agencyIds, + @Param("societyName")String societyName, + @Param("customerId")String customerId, + @Param("queryPurpose")String queryPurpose); + + /** + * @Author sun + * @Description 查询当前组织下的社会组织数据 + **/ + List getByAgencyId(@Param("agencyId") String agencyId); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandOperateLogDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandOperateLogDao.java new file mode 100644 index 0000000000..178e0482b9 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandOperateLogDao.java @@ -0,0 +1,33 @@ +/** + * 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.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcUserDemandOperateLogEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 居民需求操作日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-19 + */ +@Mapper +public interface IcUserDemandOperateLogDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java new file mode 100644 index 0000000000..6c36e11618 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java @@ -0,0 +1,89 @@ +/** + * 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.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.form.demand.IcResiUserDemandFromDTO; +import com.epmet.dto.form.demand.PageListAnalysisFormDTO; +import com.epmet.dto.form.demand.UserDemandPageFormDTO; +import com.epmet.dto.result.demand.*; +import com.epmet.dto.result.demand.DemandRecResultDTO; +import com.epmet.dto.result.demand.IcResiUserReportDemandRes; +import com.epmet.dto.result.demand.ServiceStatDTO; +import com.epmet.entity.IcUserDemandRecEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 居民需求记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-19 + */ +@Mapper +public interface IcUserDemandRecDao extends BaseDao { + + + List pageSelect(UserDemandPageFormDTO formDTO); + + /** + * 数据分析-个人档案,居民需求列表table + * + * @param formDTO + * @return + */ + List selectUserDemand(IcResiUserDemandFromDTO formDTO); + + /** + * 数据分析-个人档案,居民需求详情 + * + * @param customerId + * @param demandRecId + * @return + */ + DemandRecResultDTO selectDemandRecDetail(@Param("customerId") String customerId, @Param("demandRecId") String demandRecId); + + /** + * 数分析-服务措施分析-分页查询 + * + * @param formDTO + * @return + */ + List pageListAnalysis(PageListAnalysisFormDTO formDTO); + + + List selectDetail(@Param("categoryCode") String categoryCode, + @Param("orgType") String orgType, + @Param("orgId") String orgId, + @Param("gridPids") String gridPids, + @Param("customerId") String customerId, + @Param("startDateId") String startDateId, + @Param("endDateId") String endDateId); + + List selectListCategoryAnalysisDTO(@Param("firstCategoryList") List firstCategoryList, + @Param("customerId") String customerId, + @Param("orgId") String orgId, + @Param("orgType") String orgType, + @Param("gridPids") String gridPids, + @Param("startDateId") String startDateId, + @Param("endDateId") String endDateId); + + List selectGroupByPartyUnit(@Param("customerId") String customerId, @Param("partyUnitId") String partyUnitId); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandSatisfactionDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandSatisfactionDao.java new file mode 100644 index 0000000000..4c32bc9045 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandSatisfactionDao.java @@ -0,0 +1,33 @@ +/** + * 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.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcUserDemandSatisfactionEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 居民需求评价记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-19 + */ +@Mapper +public interface IcUserDemandSatisfactionDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandServiceDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandServiceDao.java new file mode 100644 index 0000000000..5f9adffb87 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandServiceDao.java @@ -0,0 +1,34 @@ +/** + * 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.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcUserDemandServiceEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 居民需求服务记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-19 + */ +@Mapper +public interface IcUserDemandServiceDao extends BaseDao { + + IcUserDemandServiceEntity selectByRecId(String demandRecId); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcCommunitySelfOrganizationEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcCommunitySelfOrganizationEntity.java new file mode 100644 index 0000000000..b66e6a0773 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcCommunitySelfOrganizationEntity.java @@ -0,0 +1,109 @@ +/** + * 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.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 社区自组织表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_community_self_organization") +public class IcCommunitySelfOrganizationEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 组织ID + */ + private String orgId; + + /** + * 组织类型,agency:组织,grid:网格 + */ + private String orgType; + + /** + * 组织ID的父级 + */ + private String pid; + + /** + * org_id的所有上级 + */ + private String pids; + + /** + * 组织名称 + */ + private String organizationName; + + /** + * 组织人数 + */ + private Integer organizationPersonCount; + + /** + * 负责人姓名 + */ + private String principalName; + + /** + * 负责人电话 + */ + private String principalPhone; + + /** + * 服务事项 + */ + private String serviceItem; + + /** + * 社区自组织创建时间 + */ + private Date organizationCreatedTime; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcCommunitySelfOrganizationPersonnelEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcCommunitySelfOrganizationPersonnelEntity.java new file mode 100644 index 0000000000..66e4309b16 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcCommunitySelfOrganizationPersonnelEntity.java @@ -0,0 +1,61 @@ +/** + * 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.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 社区自组织人员表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_community_self_organization_personnel") +public class IcCommunitySelfOrganizationPersonnelEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 社区自组织ID + */ + private String orgId; + + /** + * 人员姓名 + */ + private String personName; + + /** + * 人员电话 + */ + private String personPhone; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPartyActivityEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPartyActivityEntity.java new file mode 100644 index 0000000000..529bb4f34a --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPartyActivityEntity.java @@ -0,0 +1,111 @@ +/** + * 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.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 联建活动 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_party_activity") +public class IcPartyActivityEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 组织ID + */ + private String agencyId; + + /** + * 组织的所有上级 + */ + private String pids; + + /** + * 单位ID + */ + private String unitId; + + /** + * 服务事项 + */ + private String serviceMatter; + + /** + * 活动标题 + */ + private String title; + + /** + * 活动目标 + */ + private String target; + + /** + * 活动内容 + */ + private String content; + + /** + * 服务人数 + */ + private Integer peopleCount; + + /** + * 活动时间 + */ + private Date activityTime; + + /** + * 活动地址 + */ + private String address; + + /** + * 活动地址经度 + */ + private String longitude; + + /** + * 活动地址纬度 + */ + private String latitude; + + /** + * 活动结果 + */ + private String result; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPartyUnitEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPartyUnitEntity.java new file mode 100644 index 0000000000..f789736b80 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPartyUnitEntity.java @@ -0,0 +1,111 @@ +/** + * 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.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 联建单位 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_party_unit") +public class IcPartyUnitEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 组织ID + */ + private String agencyId; + + /** + * + */ + private String pids; + + /** + * 单位名称 + */ + private String unitName; + + /** + * 分类 楼宇党建 两新组织 区域单位党建 机关直属部门 其他 + */ + private String type; + + /** + * 服务事项 多选逗号隔开 + */ + private String serviceMatter; + + /** + * 联系人 + */ + private String contact; + + /** + * 联系电话 + */ + private String contactMobile; + + /** + * 在职党员数 + */ + private Integer memberCount; + + /** + * 地址 + */ + private String address; + + /** + * 中心位置经度 + */ + private String longitude; + + /** + * 中心位置纬度 + */ + private String latitude; + + /** + * 群众满意度 + */ + private String satisfaction; + + /** + * 备注 + */ + private String remark; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcResiDemandDictEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcResiDemandDictEntity.java new file mode 100644 index 0000000000..1b9a30b755 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcResiDemandDictEntity.java @@ -0,0 +1,82 @@ +/** + * 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.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 2021-10-27 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_resi_demand_dict") +public class IcResiDemandDictEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id customer.id + */ + private String customerId; + + /** + * 父级 + */ + private String parentCode; + + /** + * 字典值 + */ + private String categoryCode; + + /** + * 字典描述 + */ + private String categoryName; + + /** + * 级别 + */ + private Integer level; + + /** + * 备注 + */ + private String remark; + + /** + * 排序 + */ + private Integer sort; + + /** + * 奖励积分:只有二级分类才会配置,一级默认为0。11.17 + */ + private Integer awardPoint; + + /** + * 1可用,0不可用,11.17 + */ + private Boolean usableFlag; +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcSocietyOrgEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcSocietyOrgEntity.java new file mode 100644 index 0000000000..569156783f --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcSocietyOrgEntity.java @@ -0,0 +1,111 @@ +/** + * 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.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 社会组织管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_society_org") +public class IcSocietyOrgEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 组织Id + */ + private String agencyId; + + /** + * agency_id的所有上级 + */ + private String pids; + + /** + * 社会组织名称 + */ + private String societyName; + + /** + * 服务事项 + */ + private String serviceMatters; + + /** + * 负责人 + */ + private String personInCharge; + + /** + * 负责人电话 + */ + private String mobile; + + /** + * 起始服务时间 + */ + private Date serviceStartTime; + + /** + * 终止服务时间 + */ + private Date serviceEndTime; + + /** + * 绑定管理员[组织下录入的工作人员] + */ + private String adminStaffId; + + /** + * 地址 + */ + private String address; + + /** + * 经度 + */ + private String longitude; + + /** + * 维度 + */ + private String latitude; + + /** + * 备注 + */ + private String remarks; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcUserDemandOperateLogEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcUserDemandOperateLogEntity.java new file mode 100644 index 0000000000..9b6afa0aea --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcUserDemandOperateLogEntity.java @@ -0,0 +1,71 @@ +/** + * 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.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 居民需求操作日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_user_demand_operate_log") +public class IcUserDemandOperateLogEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 需求id + */ + private String demandRecId; + + /** + * 当前操作用户属于哪个端?工作端:staff;居民端:resi + */ + private String userType; + + /** + * 当前操作用户id + */ + private String userId; + + /** + * 创建需求:create;撤销需求:cancel;指派:assign;接单:take_order;完成:finish; + */ + private String actionCode; + + /** + * 操作时间 + */ + private Date operateTime; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcUserDemandRecEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcUserDemandRecEntity.java new file mode 100644 index 0000000000..5979d780ed --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcUserDemandRecEntity.java @@ -0,0 +1,146 @@ +/** + * 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.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 居民需求记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_user_demand_rec") +public class IcUserDemandRecEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 网格id + */ + private String gridId; + + /** + * 组织id + */ + private String agencyId; + + /** + * 网格的所有上级id + */ + private String gridPids; + + /** + * 二级需求分类编码 + */ + private String categoryCode; + + /** + * 父级需求分类编码 + */ + private String parentCode; + + /** + * 需求内容1000字 + */ + private String content; + + /** + * 社区帮办:community;楼长帮办:building_caption;党员帮办:party;自身上报:self_help + */ + private String reportType; + + /** + * 上报人姓名 + */ + private String reportUserName; + + /** + * 上报人联系方式。自身上报时存储注册居民的手机号 + */ + private String reportUserMobile; + + /** + * 自身上报时存储居民端用户id + */ + private String reportUserId; + + /** + * 上报时间 + */ + private Date reportTime; + + /** + * 希望服务时间 + */ + private Date wantServiceTime; + + /** + * 小程序用户自己上报:mini_resi;居民信息录入的居民:ic_resi_user + */ + private String demandUserType; + + /** + * 需求人:user.id或者ic_resi_user.id + */ + private String demandUserId; + + /** + * 需求人姓名 + */ + private String demandUserName; + + /** + * 需求人联系电话 + */ + private String demandUserMobile; + + /** + * 待处理:pending;已取消canceled;已派单:assigned;已接单:have_order;已完成:finished + */ + private String status; + + /** + * 完成结果:已解决 resolved,未解决 unresolved + + */ + private String finishResult; + + /** + * 取消时间 + */ + private Date cancelTime; + + /** + * 1:已评价;0:未评价;评价后ic_user_satisfaction表有记录 + */ + private Boolean evaluateFlag; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcUserDemandSatisfactionEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcUserDemandSatisfactionEntity.java new file mode 100644 index 0000000000..bae8aaaff0 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcUserDemandSatisfactionEntity.java @@ -0,0 +1,72 @@ +/** + * 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.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 居民需求评价记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_user_demand_satisfaction") +public class IcUserDemandSatisfactionEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 需求id + */ + private String demandRecId; + + /** + * 当前操作用户属于哪个端?工作端:staff;居民端:resi + */ + private String userType; + + /** + * 当前评价用户id,可以是小程序里用户id,也可以是工作端帮忙录入需求的人 + */ + private String userId; + + /** + * 评价时间 + */ + private Date evaluateTime; + + /** + * 得分可为半星 + */ + private BigDecimal score; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcUserDemandServiceEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcUserDemandServiceEntity.java new file mode 100644 index 0000000000..b2b95ec5d4 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcUserDemandServiceEntity.java @@ -0,0 +1,76 @@ +/** + * 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.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 居民需求服务记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_user_demand_service") +public class IcUserDemandServiceEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 需求id + */ + private String demandRecId; + + /** + * 服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit; + */ + private String serviceType; + + /** + * 志愿者:居民端爱心互助的志愿者userId; + */ + private String serverId; + + /** + * 实际服务开始时间 + */ + private Date serviceStartTime; + + /** + * 实际服务结束时间 + */ + private Date serviceEndTime; + + /** + * 完成情况 + */ + private String finishDesc; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ExportCommunitySelfOrganizationExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ExportCommunitySelfOrganizationExcel.java new file mode 100644 index 0000000000..d8020a3345 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ExportCommunitySelfOrganizationExcel.java @@ -0,0 +1,31 @@ +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.CellStyler; +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +@Data +public class ExportCommunitySelfOrganizationExcel { + + @Excel(name = "排序") + private Integer sort; + + @Excel(name = "组织名称", width = 40) + private String organizationName; + + @Excel(name = "组织人数", width = 20) + private Integer organizationPersonCount; + + @Excel(name = "负责人姓名", width = 20) + private String principalName; + + @Excel(name = "负责人电话", width = 20) + private String principalPhone; + + @Excel(name = "服务事项", width = 60) + private String serviceItem; + + @Excel(name = "社区自组织创建时间", width = 20) + private String organizationCreatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcCommunitySelfOrganizationExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcCommunitySelfOrganizationExcel.java new file mode 100644 index 0000000000..7310a47279 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcCommunitySelfOrganizationExcel.java @@ -0,0 +1,95 @@ +/** + * 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.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 社区自组织表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Data +public class IcCommunitySelfOrganizationExcel { + + @Excel(name = "") + private String id; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "组织ID") + private String orgId; + + @Excel(name = "组织类型,agency:组织,grid:网格") + private String orgType; + + @Excel(name = "组织ID的父级") + private String pid; + + @Excel(name = "org_id的所有上级") + private String pids; + + @Excel(name = "组织名称") + private String organizationName; + + @Excel(name = "组织人数") + private Integer organizationPersonCount; + + @Excel(name = "负责人姓名") + private String principalName; + + @Excel(name = "负责人电话") + private String principalPhone; + + @Excel(name = "服务事项") + private String serviceItem; + + @Excel(name = "社区自组织创建时间") + private Date organizationCreatedTime; + + @Excel(name = "经度") + private String longitude; + + @Excel(name = "纬度") + private String latitude; + + @Excel(name = "") + private Integer delFlag; + + @Excel(name = "乐观锁") + private String revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcCommunitySelfOrganizationPersonnelExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcCommunitySelfOrganizationPersonnelExcel.java new file mode 100644 index 0000000000..da9480bb66 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcCommunitySelfOrganizationPersonnelExcel.java @@ -0,0 +1,68 @@ +/** + * 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.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 社区自组织人员表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Data +public class IcCommunitySelfOrganizationPersonnelExcel { + + @Excel(name = "") + private String id; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "社区自组织ID") + private String orgId; + + @Excel(name = "人员姓名") + private String personName; + + @Excel(name = "人员电话") + private String personIphone; + + @Excel(name = "") + private Integer delFlag; + + @Excel(name = "乐观锁") + private String revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyActivityExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyActivityExcel.java new file mode 100644 index 0000000000..c39b3f9147 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyActivityExcel.java @@ -0,0 +1,53 @@ +/** + * 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.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.util.Date; + +/** + * 联建活动 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-19 + */ +@Data +public class IcPartyActivityExcel { + + @Excel(name = "序号") + private Integer index; + + @Excel(name = "单位名称") + private String unitName; + + @Excel(name = "活动标题") + private String title; + + @Excel(name = "活动地址") + private String address; + + @Excel(name = "服务人数") + private Integer peopleCount; + + @Excel(name = "活动时间") + private String activityTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyActivityImportExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyActivityImportExcel.java new file mode 100644 index 0000000000..6a2d4116ef --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyActivityImportExcel.java @@ -0,0 +1,66 @@ +/** + * 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.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import com.epmet.commons.tools.utils.ExcelVerifyInfo; +import lombok.Data; + +/** + * 联建活动 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-19 + */ +@Data +public class IcPartyActivityImportExcel extends ExcelVerifyInfo { + + @Excel(name = "单位名称") + private String unitName; + + @Excel(name = "服务事项") + private String serviceMatter; + + @Excel(name = "活动标题") + private String title; + + @Excel(name = "活动目标") + private String target; + + @Excel(name = "活动内容") + private String content; + + @Excel(name = "活动地址") + private String address; + + @Excel(name = "活动地址经度") + private String longitude; + + @Excel(name = "活动地址纬度") + private String latitude; + + @Excel(name = "服务人数") + private Integer peopleCount; + + @Excel(name = "活动时间") + private String activityTime; + + @Excel(name = "活动结果") + private String result; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyUnitExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyUnitExcel.java new file mode 100644 index 0000000000..652542ef62 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyUnitExcel.java @@ -0,0 +1,58 @@ +/** + * 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.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +/** + * 联建单位 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-19 + */ +@Data +public class IcPartyUnitExcel { + + @Excel(name = "序号") + private Integer index; + + @Excel(name = "单位名称") + private String unitName; + + @Excel(name = "分类") + private String type; + + @Excel(name = "服务事项") + private String serviceMatter; + + @Excel(name = "联系人") + private String contact; + + @Excel(name = "联系电话") + private String contactMobile; + + @Excel(name = "在职党员") + private Integer memberCount; + + @Excel(name = "群众满意度") + private String satisfaction; + + @Excel(name = "备注") + private String remark; +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyUnitImportExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyUnitImportExcel.java new file mode 100644 index 0000000000..13e8f27c6a --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyUnitImportExcel.java @@ -0,0 +1,62 @@ +/** + * 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.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import com.epmet.commons.tools.utils.ExcelVerifyInfo; +import lombok.Data; + +/** + * 联建单位 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-19 + */ +@Data +public class IcPartyUnitImportExcel extends ExcelVerifyInfo { + + @Excel(name = "单位名称") + private String unitName; + + @Excel(name = "分类") + private String type; + + @Excel(name = "服务事项") + private String serviceMatter; + + @Excel(name = "联系人") + private String contact; + + @Excel(name = "联系电话") + private String contactMobile; + + @Excel(name = "在职党员") + private Integer memberCount; + + @Excel(name = "地址") + private String address; + + @Excel(name = "中心位置经度") + private String longitude; + + @Excel(name = "中心位置纬度") + private String latitude; + + @Excel(name = "备注") + private String remark; +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcSocietyOrgExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcSocietyOrgExcel.java new file mode 100644 index 0000000000..35fff240d9 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcSocietyOrgExcel.java @@ -0,0 +1,83 @@ +/** + * 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.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import com.epmet.commons.tools.utils.ExcelVerifyInfo; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.Date; + +/** + * 社会组织管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Data +public class IcSocietyOrgExcel extends ExcelVerifyInfo implements Serializable { + + @Excel(name = "组织名称") + @NotBlank(message = "不能为空") + private String agencyName; + + @Excel(name = "社会组织名称") + @NotBlank(message = "不能为空") + @Length(max=50,message = "不能超过50个字") + private String societyName; + + @Excel(name = "服务事项") + @NotBlank(message = "不能为空") + @Length(max=1000,message = "不能超过1000个字") + private String serviceMatters; + + @Excel(name = "负责人") + @NotBlank(message = "不能为空") + @Length(max=20,message = "不能超过20个字") + private String personInCharge; + + @Excel(name = "负责人电话") + @NotBlank(message = "不能为空") + @Length(max=11,message = "不能超过11个字") + private String mobile; + + @Excel(name = "起始服务时间") + @NotBlank(message = "不能为空") + private String serviceStartTime; + + @Excel(name = "终止服务时间") + @NotBlank(message = "不能为空") + private String serviceEndTime; + + @Excel(name = "管理员姓名") + private String adminStaffName; + + @Excel(name = "地址") + private String address; + + @Excel(name = "经度") + private String longitude; + + @Excel(name = "维度") + private String latitude; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ImportCommunitySelfOrganization.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ImportCommunitySelfOrganization.java new file mode 100644 index 0000000000..2a9995be2a --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ImportCommunitySelfOrganization.java @@ -0,0 +1,40 @@ +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import cn.afterturn.easypoi.excel.annotation.ExcelCollection; +import com.epmet.commons.tools.utils.ExcelVerifyInfo; +import lombok.Data; + +import java.util.Date; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2021/11/24 4:34 下午 + * @DESC + */ +@Data +public class ImportCommunitySelfOrganization extends ExcelVerifyInfo { + + @Excel(name = "组织名称", needMerge = true) + private String organizationName; + + @Excel(name = "组织人数", needMerge = true) + private Integer organizationPersonCount; + + @Excel(name = "服务事项", needMerge = true) + private String serviceItem; + + @Excel(name = "负责人", needMerge = true) + private String principalName; + + @Excel(name = "联系电话", needMerge = true) + private String principalPhone; + + @Excel(name = "创建时间", needMerge = true) + private Date organizationCreatedTime; + + @ExcelCollection(name = "组织成员") + private List persons; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ImportCommunitySelfOrganizationSon.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ImportCommunitySelfOrganizationSon.java new file mode 100644 index 0000000000..7fb44af70e --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ImportCommunitySelfOrganizationSon.java @@ -0,0 +1,20 @@ +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +/** + * @Author zxc + * @DateTime 2021/11/24 4:46 下午 + * @DESC + */ +@Data +public class ImportCommunitySelfOrganizationSon { + + @Excel(name = "姓名") + private String personName; + + @Excel(name = "电话") + private String personPhone; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/mq/RocketMQConsumerRegister.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/mq/RocketMQConsumerRegister.java new file mode 100644 index 0000000000..3f599eefc0 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/mq/RocketMQConsumerRegister.java @@ -0,0 +1,31 @@ +package com.epmet.mq; + +import com.epmet.commons.rocketmq.constants.ConsomerGroupConstants; +import com.epmet.commons.rocketmq.constants.TopicConstants; +import com.epmet.commons.rocketmq.register.MQAbstractRegister; +import com.epmet.commons.rocketmq.register.MQConsumerProperties; +import com.epmet.mq.listener.PartyUnitSatisfactionCalEventListener; +import org.apache.rocketmq.common.protocol.heartbeat.MessageModel; +import org.springframework.stereotype.Component; + +/** + * @Description 如果rocketmq.enable=true,这里必须实现,且 实例化 + * @author wxz + * @date 2021.07.14 17:13:41 +*/ +@Component +public class RocketMQConsumerRegister extends MQAbstractRegister { + + @Override + public void registerAllListeners(String env, MQConsumerProperties consumerProperties) { + // 客户初始化监听器注册 + register(consumerProperties, + ConsomerGroupConstants.CAL_PARTY_UNIT_SATISFACTION, + MessageModel.CLUSTERING, + TopicConstants.CAL_PARTY_UNIT_SATISFACTION, + "*", + new PartyUnitSatisfactionCalEventListener()); + + // ...其他监听器类似 + } +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/mq/listener/PartyUnitSatisfactionCalEventListener.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/mq/listener/PartyUnitSatisfactionCalEventListener.java new file mode 100644 index 0000000000..b7c3abc938 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/mq/listener/PartyUnitSatisfactionCalEventListener.java @@ -0,0 +1,104 @@ +package com.epmet.mq.listener; + +import com.alibaba.fastjson.JSON; +import com.epmet.commons.rocketmq.constants.MQUserPropertys; +import com.epmet.commons.rocketmq.messages.CalPartyUnitSatisfactionFormDTO; +import com.epmet.commons.tools.distributedlock.DistributedLock; +import com.epmet.commons.tools.exception.ExceptionUtils; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.redis.RedisKeys; +import com.epmet.commons.tools.redis.RedisUtils; +import com.epmet.commons.tools.utils.SpringContextUtils; +import com.epmet.service.IcPartyUnitService; +import org.apache.commons.lang.StringUtils; +import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext; +import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus; +import org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently; +import org.apache.rocketmq.common.message.MessageExt; +import org.redisson.api.RLock; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.List; +import java.util.concurrent.TimeUnit; + +/** + * @Description 计算区域化党建单位,群众满意度=分数相加➗ 需求的总个数。 + * @author wxz + * @date 2021.10.13 15:21:48 +*/ +public class PartyUnitSatisfactionCalEventListener implements MessageListenerConcurrently { + + private Logger logger = LoggerFactory.getLogger(getClass()); + + private RedisUtils redisUtils; + + @Override + public ConsumeConcurrentlyStatus consumeMessage(List msgs, ConsumeConcurrentlyContext context) { + + if (redisUtils == null) { + redisUtils = SpringContextUtils.getBean(RedisUtils.class); + } + + try { + msgs.forEach(msg -> consumeMessage(msg)); + } catch (Exception e) { + logger.error(ExceptionUtils.getErrorStackTrace(e)); + return ConsumeConcurrentlyStatus.RECONSUME_LATER; + } + return ConsumeConcurrentlyStatus.CONSUME_SUCCESS; + } + + private void consumeMessage(MessageExt messageExt) { + // msg即为消息体 + // tags为SystemMessageType.java中的项,为具体的操作,此处拿到tags,判断是创建还是变更,来做响应的后续操作即可 + String msg = new String(messageExt.getBody()); + String topic = messageExt.getTopic(); + String tags = messageExt.getTags(); + String pendingMsgLabel = messageExt.getUserProperty(MQUserPropertys.BLOCKED_MSG_LABEL); + + logger.info("【计算区域化党建单位群众满意度事件监听器】-需求完成-收到消息内容:{},操作:{}", msg, tags); + CalPartyUnitSatisfactionFormDTO obj = JSON.parseObject(msg, CalPartyUnitSatisfactionFormDTO.class); + + DistributedLock distributedLock = null; + RLock lock = null; + try { + distributedLock = SpringContextUtils.getBean(DistributedLock.class); + lock = distributedLock.getLock(String.format("lock:ic_warn_stats:%s", obj.getCustomerId()), + 30L, 30L, TimeUnit.SECONDS); + //待执行方法 + SpringContextUtils.getBean(IcPartyUnitService.class).calPartyUnitSatisfation(obj); + } catch (RenException e) { + // 如果是我们手动抛出的异常,说明在业务可控范围内。目前不需要MQ重试 + logger.error("【计算区域化党建单位群众满意度事件监听器】-MQ失败:".concat(ExceptionUtils.getErrorStackTrace(e))); + } catch (Exception e) { + // 不是我们自己抛出的异常,可以让MQ重试 + logger.error("【计算区域化党建单位群众满意度监听器】-MQ失败:".concat(ExceptionUtils.getErrorStackTrace(e))); + throw e; + } finally { + distributedLock.unLock(lock); + } + + if (StringUtils.isNotBlank(pendingMsgLabel)) { + try { + removePendingMqMsgCache(pendingMsgLabel); + } catch (Exception e) { + logger.error("【计算区域化党建单位群众满意度监听器】-删除mq阻塞消息缓存失败:{}", ExceptionUtils.getErrorStackTrace(e)); + } + } + } + + /** + * @description + * + * @param pendingMsgLabel + * @return + * @author wxz + * @date 2021.10.14 16:32:32 + */ + private void removePendingMqMsgCache(String pendingMsgLabel) { + String key = RedisKeys.blockedMqMsgKey(pendingMsgLabel); + redisUtils.delete(key); + //logger.info("【开放数据事件监听器】删除mq阻塞消息缓存成功,blockedMsgLabel:{}", pendingMsgLabel); + } +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerGridRedis.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/IcPartyActivityRedis.java similarity index 93% rename from epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerGridRedis.java rename to epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/IcPartyActivityRedis.java index 3d69fe3ca8..c2ead1498b 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerGridRedis.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/IcPartyActivityRedis.java @@ -22,13 +22,13 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; /** - * 客户网格表 + * 联建活动 * * @author generator generator@elink-cn.com - * @since v1.0.0 2020-03-16 + * @since v1.0.0 2021-11-19 */ @Component -public class CustomerGridRedis { +public class IcPartyActivityRedis { @Autowired private RedisUtils redisUtils; diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerDepartmentRedis.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/IcPartyUnitRedis.java similarity index 92% rename from epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerDepartmentRedis.java rename to epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/IcPartyUnitRedis.java index 3a99915463..83113e7903 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerDepartmentRedis.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/IcPartyUnitRedis.java @@ -22,13 +22,13 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; /** - * 客户部门表 + * 联建单位 * * @author generator generator@elink-cn.com - * @since v1.0.0 2020-04-20 + * @since v1.0.0 2021-11-19 */ @Component -public class CustomerDepartmentRedis { +public class IcPartyUnitRedis { @Autowired private RedisUtils redisUtils; diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcCommunitySelfOrganizationPersonnelService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcCommunitySelfOrganizationPersonnelService.java new file mode 100644 index 0000000000..32d04687af --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcCommunitySelfOrganizationPersonnelService.java @@ -0,0 +1,103 @@ +/** + * 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.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcCommunitySelfOrganizationPersonnelDTO; +import com.epmet.entity.IcCommunitySelfOrganizationPersonnelEntity; + +import java.util.List; +import java.util.Map; + +/** + * 社区自组织人员表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +public interface IcCommunitySelfOrganizationPersonnelService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-11-18 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-11-18 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcCommunitySelfOrganizationPersonnelDTO + * @author generator + * @date 2021-11-18 + */ + IcCommunitySelfOrganizationPersonnelDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-11-18 + */ + void save(IcCommunitySelfOrganizationPersonnelDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-11-18 + */ + void update(IcCommunitySelfOrganizationPersonnelDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-11-18 + */ + void delete(String[] ids); + + /** + * @Description 根据社区自组织ID删除 + * @param orgId + * @author zxc + * @date 2021/11/19 11:18 上午 + */ + void deleteByOrgId(String orgId); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcCommunitySelfOrganizationService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcCommunitySelfOrganizationService.java new file mode 100644 index 0000000000..4445d2f82b --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcCommunitySelfOrganizationService.java @@ -0,0 +1,161 @@ +/** + * 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.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.dto.IcCommunitySelfOrganizationDTO; +import com.epmet.dto.form.AddCommunitySelfOrganizationFormDTO; +import com.epmet.dto.form.CommunitySelfOrganizationListFormDTO; +import com.epmet.dto.form.DelCommunitySelfOrganizationFormDTO; +import com.epmet.dto.form.EditCommunitySelfOrganizationFormDTO; +import com.epmet.dto.form.demand.ServiceQueryFormDTO; +import com.epmet.dto.result.CommunitySelfOrganizationListResultDTO; +import com.epmet.dto.result.demand.OptionDTO; +import com.epmet.entity.IcCommunitySelfOrganizationEntity; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * 社区自组织表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +public interface IcCommunitySelfOrganizationService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-11-18 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-11-18 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcCommunitySelfOrganizationDTO + * @author generator + * @date 2021-11-18 + */ + IcCommunitySelfOrganizationDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-11-18 + */ + void save(IcCommunitySelfOrganizationDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-11-18 + */ + void update(IcCommunitySelfOrganizationDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-11-18 + */ + void delete(String[] ids); + + /** + * @Description 添加社区自组织 + * @param tokenDto + * @param formDTO + * @author zxc + * @date 2021/11/19 8:33 上午 + */ + void addCommunitySelfOrganization(TokenDto tokenDto, AddCommunitySelfOrganizationFormDTO formDTO); + + /** + * @Description 修改社区自组织 + * @param tokenDto + * @param formDTO + * @author zxc + * @date 2021/11/19 10:12 上午 + */ + void editCommunitySelfOrganization(TokenDto tokenDto, EditCommunitySelfOrganizationFormDTO formDTO); + + /** + * @Description 查询社区自组织列表 + * @param tokenDto + * @param formDTO + * @author zxc + * @date 2021/11/19 1:59 下午 + */ + CommunitySelfOrganizationListResultDTO communitySelfOrganizationList(TokenDto tokenDto, CommunitySelfOrganizationListFormDTO formDTO); + + /** + * @Description 社区自组织删除 + * @param formDTO + * @author zxc + * @date 2021/11/19 4:22 下午 + */ + void delCommunitySelfOrganization(DelCommunitySelfOrganizationFormDTO formDTO); + + + /** + * 需求指派,选择社区自组织,调用此接口 + * 返回需求所属社区下的 组织 + * + * @param formDTO + * @return + */ + List queryServiceList(ServiceQueryFormDTO formDTO); + + /** + * @Description 导入 + * @param tokenDto + * @param response + * @param file + * @author zxc + * @date 2021/11/25 9:03 上午 + */ + void importCommunitySelfOrganization(TokenDto tokenDto, HttpServletResponse response, MultipartFile file) throws IOException; +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyActivityService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyActivityService.java new file mode 100644 index 0000000000..c3931bbd0b --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyActivityService.java @@ -0,0 +1,120 @@ +/** + * 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.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.IcPartyActivityDTO; +import com.epmet.dto.form.PartyActivityFormDTO; +import com.epmet.dto.result.demand.OptionDTO; +import com.epmet.entity.IcPartyActivityEntity; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.List; + +/** + * 联建活动 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-19 + */ +public interface IcPartyActivityService extends BaseService { + + /** + * 默认分页 + * + * @param formDTO + * @return PageData + * @author generator + * @date 2021-11-19 + */ + PageData search(PartyActivityFormDTO formDTO); + + /** + * 默认查询 + * + * @param formDTO + * @return java.util.List + * @author generator + * @date 2021-11-19 + */ + List list(PartyActivityFormDTO formDTO); + + /** + * 单条查询 + * + * @param id + * @return IcPartyActivityDTO + * @author generator + * @date 2021-11-19 + */ + IcPartyActivityDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-11-19 + */ + void save(TokenDto tokenDto, IcPartyActivityDTO dto); + + /** + * 批量删除 + * + * @param id + * @return void + * @author generator + * @date 2021-11-19 + */ + void delete(String id); + + /** + * 导入数据 + * @Param tokenDto + * @Param response + * @Param file + * @Return + * @Author zhaoqifeng + * @Date 2021/11/29 11:01 + */ + Result importData(TokenDto tokenDto, HttpServletResponse response, MultipartFile file) throws IOException; + + /** + * 联建活动统计 + * @Param formDTO + * @Return {@link List< OptionDTO>} + * @Author zhaoqifeng + * @Date 2021/12/9 14:55 + */ + List statistics(PartyActivityFormDTO formDTO); + + /** + * 联建活动统计列表 + * @Param formDTO + * @Return {@link PageData< IcPartyActivityDTO>} + * @Author zhaoqifeng + * @Date 2021/12/9 16:24 + */ + PageData getActivityList(TokenDto tokenDto, PartyActivityFormDTO formDTO); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitService.java new file mode 100644 index 0000000000..490e19bee6 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitService.java @@ -0,0 +1,151 @@ +/** + * 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.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.dto.result.OptionDataResultDTO; +import com.epmet.commons.rocketmq.messages.CalPartyUnitSatisfactionFormDTO; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.IcPartyUnitDTO; +import com.epmet.dto.form.PartyActivityFormDTO; +import com.epmet.dto.form.PartyUnitFormDTO; +import com.epmet.dto.form.demand.ServiceQueryFormDTO; +import com.epmet.dto.result.PartyUnitDistributionResultDTO; +import com.epmet.dto.result.demand.OptionDTO; +import com.epmet.entity.IcPartyUnitEntity; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.List; + +/** + * 联建单位 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-19 + */ +public interface IcPartyUnitService extends BaseService { + + /** + * 默认分页 + * + * @param formDTO + * @return PageData + * @author generator + * @date 2021-11-19 + */ + PageData search(PartyUnitFormDTO formDTO); + + /** + * 默认查询 + * + * @param formDTO + * @return java.util.List + * @author generator + * @date 2021-11-19 + */ + List list(PartyUnitFormDTO formDTO); + + /** + * 单条查询 + * + * @param id + * @return IcPartyUnitDTO + * @author generator + * @date 2021-11-19 + */ + IcPartyUnitDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-11-19 + */ + void save(TokenDto tokenDto, IcPartyUnitDTO dto); + + + /** + * 批量删除 + * + * @param id + * @return void + * @author generator + * @date 2021-11-19 + */ + void delete(String id); + + /** + * 需求指派,选择区域化党建单位,调用此接口 + * 返回需求所属组织线上的数据 + * + * @param formDTO + * @param formDTO + * @return + */ + List queryServiceList(ServiceQueryFormDTO formDTO); + + /** + * @Description 获取组织下单位列表 + * @Param dto + * @Return {@link List< OptionDTO>} + * @Author zhaoqifeng + * @Date 2021/11/22 14:35 + */ + List option(IcPartyUnitDTO dto); + + /** + * 导入数据 + * @Param tokenDto + * @Param response + * @Param file + * @Return + * @Author zhaoqifeng + * @Date 2021/11/29 11:01 + */ + Result importData(TokenDto tokenDto, HttpServletResponse response, MultipartFile file) throws IOException; + + /** + * @Description 按类型统计单位数量 + * @Param formDTO + * @Return {@link List< OptionDataResultDTO>} + * @Author zhaoqifeng + * @Date 2021/12/8 14:56 + */ + List typeStatistics(PartyActivityFormDTO formDTO); + + /** + * 联建单位分布 + * @Param formDTO + * @Return {@link List< PartyUnitDistributionResultDTO>} + * @Author zhaoqifeng + * @Date 2021/12/9 10:10 + */ + List distribution(PartyActivityFormDTO formDTO); + + /** + * 计算区域化党建单位的群众满意度 + * @param formDTO + */ + void calPartyUnitSatisfation(CalPartyUnitSatisfactionFormDTO formDTO); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcResiDemandDictService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcResiDemandDictService.java new file mode 100644 index 0000000000..12cbaf7dad --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcResiDemandDictService.java @@ -0,0 +1,122 @@ +/** + * 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.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.dto.result.OptionResultDTO; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.demand.*; +import com.epmet.dto.result.demand.DemandPageResDTO; +import com.epmet.dto.result.demand.OptionDTO; +import com.epmet.entity.IcResiDemandDictEntity; + +import java.util.List; + +/** + * 居民需求字典表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-27 + */ +public interface IcResiDemandDictService extends BaseService { + + /** + * 默认分页 + * + * @param formDTO + * @author generator + * @date 2021-10-27 + */ + PageData page(DemandDictPageFormDTO formDTO); + + /** + * 新增一级分类 + * @param formDTO + */ + void addFirstCategory(AddFirstCategoryFormDTO formDTO); + + /** + * 新增二级分类 + * @param formDTO + */ + void addChild(AddCategoryFormDTO formDTO); + + /** + * 默认更新 + * + * @param formDTO + * @return void + * @author generator + * @date 2021-10-27 + */ + void update(UpdateFormDTO formDTO); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-10-27 + */ + void delete(String[] ids); + + /** + * @Description 获取居民需求 + * @Param customerId + * @Return {@link List< OptionResultDTO>} + * @Author zhaoqifeng + * @Date 2021/10/27 17:57 + */ + List getDemandOptions(String customerId); + + List getDemandOptionsV2(DemandOptionFormDTO formDTO); + /** + * 居民信息列表需要展示分类名称,单独开出来这个接口,供user查询 + * @param formDTO + * @return + */ + Result queryDemandNames(UserDemandNameQueryFormDTO formDTO); + + List querySubCodeList(SubCodeFormDTO formDTO); + + /** + * 启用或禁用 + * + * @param formDTO + */ + void updateStatus(StatusFormDTO formDTO); + + /** + * 供服务措施管理,列表查询,显示需求类型名称用 + * @param customerId + * @param categoryCodes + * @return + */ + List listByCodes(String customerId, List categoryCodes); + + /** + * 查询当前分类的名称 + * + * @param customerId + * @param categoryCode + * @return + */ + String getCategoryName(String customerId, String categoryCode); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcSocietyOrgService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcSocietyOrgService.java new file mode 100644 index 0000000000..f2646de029 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcSocietyOrgService.java @@ -0,0 +1,78 @@ +/** + * 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.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.form.AddSocietyOrgFormDTO; +import com.epmet.dto.form.EditSocietyOrgFormDTO; +import com.epmet.dto.form.GetListSocietyOrgFormDTO; +import com.epmet.dto.form.demand.ServiceQueryFormDTO; +import com.epmet.dto.result.GetListSocietyOrgResultDTO; +import com.epmet.dto.result.demand.OptionDTO; +import com.epmet.entity.IcSocietyOrgEntity; +import com.epmet.excel.IcSocietyOrgExcel; + +import java.text.ParseException; +import java.util.List; + +/** + * 社会组织管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +public interface IcSocietyOrgService extends BaseService { + + /** + * @Author sun + * @Description 新增社会组织 + **/ + void add(AddSocietyOrgFormDTO dto); + + /** + * @Author sun + * @Description 修改社会组织 + **/ + void edit(EditSocietyOrgFormDTO formDTO); + + /** + * @Author sun + * @Description 删除社会组织 + **/ + void del(String societyId); + + /** + * @Author sun + * @Description 社会组织列表查询 + **/ + GetListSocietyOrgResultDTO getList(GetListSocietyOrgFormDTO formDTO); + + /** + * 需求指派,选择社会组织,调用此接口 + * @param formDTO + * @return + */ + List queryServiceList(ServiceQueryFormDTO formDTO); + + /** + * @Author sun + * @Description 九小场所下组织列表导入 + **/ + List importExcel(String customerId, List list, String staffId, List numList) throws ParseException; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java new file mode 100644 index 0000000000..d17b6b3bfc --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java @@ -0,0 +1,183 @@ +/** + * 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.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcUserDemandRecDTO; +import com.epmet.dto.form.demand.*; +import com.epmet.dto.result.demand.CategoryAnalysisResDTO; +import com.epmet.dto.result.demand.DemandRecResultDTO; +import com.epmet.dto.result.demand.DemandResearchAnalysisResultDTO; +import com.epmet.dto.result.demand.FinishResultDTO; +import com.epmet.dto.result.demand.IcResiUserReportDemandRes; +import com.epmet.dto.result.demand.ServiceStatDTO; +import com.epmet.entity.IcUserDemandRecEntity; + +import java.util.List; +import java.util.Map; + +/** + * 居民需求记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-19 + */ +public interface IcUserDemandRecService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-11-19 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-11-19 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcUserDemandRecDTO + * @author generator + * @date 2021-11-19 + */ + IcUserDemandRecDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-11-19 + */ + void save(IcUserDemandRecDTO dto); + + /** + * 更新需求 + * + * @param dto + * @return void + * @author generator + * @date 2021-11-19 + */ + DemandRecId update(DemandAddFromDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-11-19 + */ + void delete(String[] ids); + + /** + * 新增需求 + * + * @param fromDTO + * @return + */ + DemandRecId add(DemandAddFromDTO fromDTO); + + PageData pageList(UserDemandPageFormDTO formDTO); + + /** + * 未完成之前都可以取消 + * + * @param formDTO + */ + void cancel(StaffCancelFormDTO formDTO); + + /** + * 指派 + * 待处理:pending;已取消canceled;已派单:assigned;已接单:have_order;已完成:finished + * 待处理+已派单才可以指派 + * + * @param formDTO + * @return + */ + void assign(AssignFormDTO formDTO); + + /** + * 完成并评价 + * @param formDTO + */ + FinishResultDTO finish(FinishStaffFromDTO formDTO); + + /** + * 数据分析-个人档案,居民需求列表table + * + * @param formDTO + * @return + */ + PageData queryMyDemand(IcResiUserDemandFromDTO formDTO); + + /** + * 数据分析-个人档案、居民需求列表-查看需求详情 + * + * @param formDTO + * @return + */ + DemandRecResultDTO queryDemandDetail(DemandDetailFormDTO formDTO); + + /** + * 数据分析-个人档案-需求详情,研判分析 + * + * @param formDTO + * @return + */ + DemandResearchAnalysisResultDTO queryDemandResearchAnalysis(DemandResearchAnalysisFormDTO formDTO); + + /** + * 数分析-服务措施分析-分页查询 + * + * @param formDTO + * @return + */ + PageData pageListAnalysis(PageListAnalysisFormDTO formDTO); + + /** + * 数据分析-服务措施分析-柱状图 + * + * @return + */ + CategoryAnalysisResDTO categoryAnalysis(CategoryAnalysisFormDTO formDTO); + + /** + * 计算出服务方,评价总分,服务的需求个数 + * + * @param customerId + * @param partyUnitId + * @return + */ + List groupByPartyUnit(String customerId, String partyUnitId); +} \ No newline at end of file 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 53ac849cb8..6a84fb67a1 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 @@ -24,6 +24,8 @@ import com.epmet.dto.VolunteerInfoDTO; import com.epmet.dto.form.CommonCustomerFormDTO; import com.epmet.dto.form.resi.ResiSendSmsCodeFormDTO; import com.epmet.dto.form.resi.ResiVolunteerAuthenticateFormDTO; +import com.epmet.dto.result.demand.OptionDTO; +import com.epmet.dto.result.resi.PageVolunteerInfoResultDTO; import com.epmet.dto.result.resi.ResiVolunteerInfoResultDTO; import com.epmet.entity.VolunteerInfoEntity; @@ -84,4 +86,15 @@ public interface VolunteerInfoService extends BaseService { * @return com.epmet.dto.VolunteerInfoDTO */ VolunteerInfoDTO queryUserVolunteerInfo(String userId); + + /** + * label: 张三(15764229697) + * value:userId + * + * @param customerId + * @return + */ + List queryListVolunteer(String customerId,String userRealName); + + List queryVolunteerPage(String customerId, Integer pageNo, Integer pageSize); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcCommunitySelfOrganizationPersonnelServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcCommunitySelfOrganizationPersonnelServiceImpl.java new file mode 100644 index 0000000000..15b759def7 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcCommunitySelfOrganizationPersonnelServiceImpl.java @@ -0,0 +1,112 @@ +/** + * 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.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.IcCommunitySelfOrganizationPersonnelDao; +import com.epmet.dto.IcCommunitySelfOrganizationPersonnelDTO; +import com.epmet.entity.IcCommunitySelfOrganizationPersonnelEntity; +import com.epmet.service.IcCommunitySelfOrganizationPersonnelService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 社区自组织人员表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Service +public class IcCommunitySelfOrganizationPersonnelServiceImpl extends BaseServiceImpl implements IcCommunitySelfOrganizationPersonnelService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcCommunitySelfOrganizationPersonnelDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcCommunitySelfOrganizationPersonnelDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcCommunitySelfOrganizationPersonnelDTO get(String id) { + IcCommunitySelfOrganizationPersonnelEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcCommunitySelfOrganizationPersonnelDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcCommunitySelfOrganizationPersonnelDTO dto) { + IcCommunitySelfOrganizationPersonnelEntity entity = ConvertUtils.sourceToTarget(dto, IcCommunitySelfOrganizationPersonnelEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcCommunitySelfOrganizationPersonnelDTO dto) { + IcCommunitySelfOrganizationPersonnelEntity entity = ConvertUtils.sourceToTarget(dto, IcCommunitySelfOrganizationPersonnelEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @Description 根据社区自组织ID删除 + * @param orgId + * @author zxc + * @date 2021/11/19 11:19 上午 + */ + @Transactional(rollbackFor = Exception.class) + @Override + public void deleteByOrgId(String orgId) { + baseDao.deleteByOrgId(orgId); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcCommunitySelfOrganizationServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcCommunitySelfOrganizationServiceImpl.java new file mode 100644 index 0000000000..cde9814019 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcCommunitySelfOrganizationServiceImpl.java @@ -0,0 +1,402 @@ +package com.epmet.service.impl; + +import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult; +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.entity.BaseEpmetEntity; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +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.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerOrgRedis; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.commons.tools.utils.ExcelPoiUtils; +import com.epmet.constant.IcCommunitySelfOrganizationConstant; +import com.epmet.dao.IcCommunitySelfOrganizationDao; +import com.epmet.dto.IcCommunitySelfOrganizationDTO; +import com.epmet.dto.form.AddCommunitySelfOrganizationFormDTO; +import com.epmet.dto.form.CommunitySelfOrganizationListFormDTO; +import com.epmet.dto.form.DelCommunitySelfOrganizationFormDTO; +import com.epmet.dto.form.EditCommunitySelfOrganizationFormDTO; +import com.epmet.dto.form.demand.ServiceQueryFormDTO; +import com.epmet.dto.result.CommunitySelfOrganizationListDTO; +import com.epmet.dto.result.CommunitySelfOrganizationListResultDTO; +import com.epmet.dto.result.demand.OptionDTO; +import com.epmet.entity.IcCommunitySelfOrganizationEntity; +import com.epmet.entity.IcCommunitySelfOrganizationPersonnelEntity; +import com.epmet.excel.ImportCommunitySelfOrganization; +import com.epmet.service.IcCommunitySelfOrganizationPersonnelService; +import com.epmet.service.IcCommunitySelfOrganizationService; +import com.epmet.service.IcUserDemandRecService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.*; +import java.util.concurrent.atomic.AtomicReference; +import java.util.stream.Collectors; + +import static com.epmet.commons.tools.utils.DateUtils.DATE_PATTERN; + +/** + * 社区自组织表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Service +public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl implements IcCommunitySelfOrganizationService { + + @Autowired + private IcCommunitySelfOrganizationPersonnelService personnelService; + @Autowired + private IcUserDemandRecService icUserDemandRecService; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcCommunitySelfOrganizationDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcCommunitySelfOrganizationDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcCommunitySelfOrganizationDTO get(String id) { + IcCommunitySelfOrganizationEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcCommunitySelfOrganizationDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcCommunitySelfOrganizationDTO dto) { + IcCommunitySelfOrganizationEntity entity = ConvertUtils.sourceToTarget(dto, IcCommunitySelfOrganizationEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcCommunitySelfOrganizationDTO dto) { + IcCommunitySelfOrganizationEntity entity = ConvertUtils.sourceToTarget(dto, IcCommunitySelfOrganizationEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @Description 添加社区自组织 + * @param tokenDto + * @param formDTO + * @author zxc + * @date 2021/11/19 8:33 上午 + */ + @Transactional(rollbackFor = Exception.class) + @Override + public void addCommunitySelfOrganization(TokenDto tokenDto, AddCommunitySelfOrganizationFormDTO formDTO) { + String customerId = tokenDto.getCustomerId(); + LambdaQueryWrapper l = new LambdaQueryWrapper<>(); + l.eq(IcCommunitySelfOrganizationEntity::getOrganizationName,formDTO.getOrganizationName()) + .eq(IcCommunitySelfOrganizationEntity::getCustomerId,customerId) + .eq(BaseEpmetEntity::getDelFlag, NumConstant.ZERO); + IcCommunitySelfOrganizationEntity record = baseDao.selectOne(l); + if (null != record){ + throw new RenException(EpmetErrorCode.COMMUNITY_SELF_ORGANIZATION_REPART_ERROR.getCode()); + } + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(customerId, tokenDto.getUserId()); + if (null == staffInfo){ + throw new RenException(String.format("查询人员{%s}信息失败",tokenDto.getUserId())); + } + IcCommunitySelfOrganizationEntity orgEntity = ConvertUtils.sourceToTarget(formDTO, IcCommunitySelfOrganizationEntity.class); + orgEntity.setCustomerId(customerId); + orgEntity.setOrgId(staffInfo.getAgencyId()); + orgEntity.setOrgType(IcCommunitySelfOrganizationConstant.ORG_TYPE_AGENCY); + orgEntity.setOrganizationCreatedTime(DateUtils.parse(formDTO.getOrganizationCreatedTime(), DATE_PATTERN)); + AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(staffInfo.getAgencyId()); + if (null == agencyInfo){ + throw new RenException(String.format("查询组织信息失败%s",staffInfo.getAgencyId())); + } + orgEntity.setPid(agencyInfo.getPid()); + orgEntity.setPids(agencyInfo.getPids()); + // 保持时间统一 + if (null == formDTO.getOrganizationCreatedTime()){ + Date date = new Date(); + orgEntity.setOrganizationCreatedTime(date); + orgEntity.setCreatedTime(date); + orgEntity.setUpdatedTime(date); + } + baseDao.insert(orgEntity); + if(CollectionUtils.isNotEmpty(formDTO.getOrganizationPersonnel())){ + List persons = ConvertUtils.sourceToTarget(formDTO.getOrganizationPersonnel(), IcCommunitySelfOrganizationPersonnelEntity.class); + Map> groupPhone = persons.stream().collect(Collectors.groupingBy(IcCommunitySelfOrganizationPersonnelEntity::getPersonPhone)); + List phones = new ArrayList<>(); + groupPhone.forEach((k,v) -> { + if (v.size() > NumConstant.ONE){ + phones.add(k); + } + }); + if (CollectionUtils.isNotEmpty(phones)){ + StringBuffer sb = new StringBuffer(); + phones.forEach(p -> { + sb.append(p).append(","); + }); + String copywriter = sb.toString().substring(NumConstant.ZERO, sb.length() - NumConstant.ONE); + EpmetErrorCode.EXISTS_SAME_PHONE_ERROR.setMsg(String.format(EpmetErrorCode.EXISTS_SAME_PHONE_ERROR.getMsg(),copywriter)); + throw new RenException(EpmetErrorCode.EXISTS_SAME_PHONE_ERROR.getCode()); + } + persons.forEach(p -> { + p.setCustomerId(customerId); + p.setOrgId(orgEntity.getId()); + }); + personnelService.insertBatch(persons); + } + } + + /** + * @Description 修改社区自组织 + * 社区自组织人员为全删全增 + * @param tokenDto + * @param formDTO + * @author zxc + * @date 2021/11/19 10:12 上午 + */ + @Transactional(rollbackFor = Exception.class) + @Override + public void editCommunitySelfOrganization(TokenDto tokenDto, EditCommunitySelfOrganizationFormDTO formDTO) { + LambdaQueryWrapper l = new LambdaQueryWrapper<>(); + l.eq(IcCommunitySelfOrganizationEntity::getOrganizationName,formDTO.getOrganizationName()) + .eq(IcCommunitySelfOrganizationEntity::getCustomerId,tokenDto.getCustomerId()) + .eq(BaseEpmetEntity::getDelFlag, NumConstant.ZERO) + .ne(BaseEpmetEntity::getId,formDTO.getOrgId()); + IcCommunitySelfOrganizationEntity record = baseDao.selectOne(l); + if (null != record){ + throw new RenException(EpmetErrorCode.COMMUNITY_SELF_ORGANIZATION_REPART_ERROR.getCode()); + } + IcCommunitySelfOrganizationEntity e = ConvertUtils.sourceToTarget(formDTO, IcCommunitySelfOrganizationEntity.class); + e.setOrganizationCreatedTime(DateUtils.stringToDate(formDTO.getOrganizationCreatedTime(),DATE_PATTERN)); + e.setUpdatedBy(tokenDto.getUserId()); + baseDao.updateCommunitySelfOrganization(e); + personnelService.deleteByOrgId(formDTO.getOrgId()); + if (CollectionUtils.isNotEmpty(formDTO.getOrganizationPersonnel())){ + List persons = ConvertUtils.sourceToTarget(formDTO.getOrganizationPersonnel(), IcCommunitySelfOrganizationPersonnelEntity.class); + Map> groupPhone = persons.stream().collect(Collectors.groupingBy(IcCommunitySelfOrganizationPersonnelEntity::getPersonPhone)); + List phones = new ArrayList<>(); + groupPhone.forEach((k,v) -> { + if (v.size() > NumConstant.ONE){ + phones.add(k); + } + }); + if (CollectionUtils.isNotEmpty(phones)){ + StringBuffer sb = new StringBuffer(); + phones.forEach(p -> { + sb.append(p).append(","); + }); + String copywriter = sb.toString().substring(NumConstant.ZERO, sb.length() - NumConstant.ONE); + EpmetErrorCode.EXISTS_SAME_PHONE_ERROR.setMsg(String.format(EpmetErrorCode.EXISTS_SAME_PHONE_ERROR.getMsg(),copywriter)); + throw new RenException(EpmetErrorCode.EXISTS_SAME_PHONE_ERROR.getCode()); + } + persons.forEach(p -> { + p.setOrgId(formDTO.getOrgId()); + p.setCustomerId(tokenDto.getCustomerId()); + }); + personnelService.insertBatch(persons); + } + } + + /** + * @Description 查询社区自组织列表 + * @param tokenDto + * @param formDTO + * @author zxc + * @date 2021/11/19 1:59 下午 + */ + @Override + public CommunitySelfOrganizationListResultDTO communitySelfOrganizationList(TokenDto tokenDto, CommunitySelfOrganizationListFormDTO formDTO) { + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); + if (null == staffInfo){ + throw new RenException(String.format("查询人员{%s}信息失败",tokenDto.getUserId())); + } + formDTO.setAgencyId(staffInfo.getAgencyId()); + formDTO.setCustomerId(tokenDto.getCustomerId()); + final int[] i = {(formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize() + NumConstant.ONE}; + CommunitySelfOrganizationListResultDTO result = new CommunitySelfOrganizationListResultDTO(); + if (formDTO.getIsPage()){ + PageInfo objectPageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.selectCommunitySelfOrganizationList(formDTO)); + result.setTotal(Integer.valueOf(String.valueOf(objectPageInfo.getTotal()))); + if (CollectionUtils.isNotEmpty(objectPageInfo.getList())){ + objectPageInfo.getList().forEach(l -> { + l.setSort(i[NumConstant.ZERO]); + i[NumConstant.ZERO]++; + }); + result.setList(objectPageInfo.getList()); + } + return result; + } + List resultDTOs = baseDao.selectCommunitySelfOrganizationList(formDTO); + if (CollectionUtils.isNotEmpty(resultDTOs)){ + result.setTotal(resultDTOs.size()); + AtomicReference sort = new AtomicReference<>(NumConstant.ONE); + resultDTOs.forEach(r -> { + r.setSort(sort.getAndSet(sort.get() + NumConstant.ONE)); + }); + result.setList(resultDTOs); + } + return result; + } + + /** + * @Description 社区自组织删除 + * 社区自组织表逻辑删,社区自组织人员表物理删 + * @param formDTO + * @author zxc + * @date 2021/11/19 4:22 下午 + */ + @Transactional(rollbackFor = Exception.class) + @Override + public void delCommunitySelfOrganization(DelCommunitySelfOrganizationFormDTO formDTO) { + baseDao.deleteById(formDTO.getOrgId()); + personnelService.deleteByOrgId(formDTO.getOrgId()); + } + + /** + * 需求指派,选择社区自组织,调用此接口 + * 返回需求所属社区下的 组织 + * + * @param formDTO + * @return + */ + @Override + public List queryServiceList(ServiceQueryFormDTO formDTO) { + List resultList=new ArrayList<>(); + CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); + if (null == staffInfoCacheResult || StringUtils.isBlank(staffInfoCacheResult.getAgencyId())) { + throw new RenException("工作人员所属组织信息查询异常"); + } + List agencyIds=new ArrayList<>(); + if (StringUtils.isNotBlank(staffInfoCacheResult.getAgencyPIds()) && !NumConstant.ZERO_STR.equals(staffInfoCacheResult.getAgencyPIds())) { + if(staffInfoCacheResult.getAgencyPIds().contains(StrConstant.COLON)){ + agencyIds.addAll(Arrays.asList(staffInfoCacheResult.getAgencyPIds().split(StrConstant.COLON))); + }else{ + //当前用户属于第二级组织的人,不会有: + agencyIds.add(staffInfoCacheResult.getAgencyPIds()); + } + } + agencyIds.add(staffInfoCacheResult.getAgencyId()); + resultList=baseDao.selectListByAgencyId(formDTO.getCustomerId(),agencyIds,formDTO.getServiceName()); + return resultList; + } + + /** + * @Description 导入 + * @param tokenDto + * @param response + * @param file + * @author zxc + * @date 2021/11/25 9:03 上午 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void importCommunitySelfOrganization(TokenDto tokenDto, HttpServletResponse response, MultipartFile file) throws IOException { + ExcelImportResult testExcelImportResult = ExcelPoiUtils.importExcelMore(file, 0, 2, ImportCommunitySelfOrganization.class); + List list = testExcelImportResult.getList(); + if (CollectionUtils.isNotEmpty(list)){ + String customerId = tokenDto.getCustomerId(); + List existsNames = baseDao.selectOrgByOrgName(list.stream().map(ImportCommunitySelfOrganization::getOrganizationName).collect(Collectors.toList()), customerId); + Map> groupByName = list.stream().collect(Collectors.groupingBy(ImportCommunitySelfOrganization::getOrganizationName)); + groupByName.forEach((k,v) -> { + if (v.size() > NumConstant.ONE){ + existsNames.add(k); + } + }); + List repeatName = existsNames.stream().distinct().collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(repeatName)){ + StringBuffer sb = new StringBuffer(); + repeatName.forEach(p -> { + sb.append(p).append(","); + }); + String copywriter = sb.toString().substring(NumConstant.ZERO, sb.length() - NumConstant.ONE); + EpmetErrorCode.COMMUNITY_SELF_ORGANIZATION_LIST_REPART_ERROR.setMsg(String.format(EpmetErrorCode.COMMUNITY_SELF_ORGANIZATION_LIST_REPART_ERROR.getMsg(),copywriter)); + throw new RenException(EpmetErrorCode.COMMUNITY_SELF_ORGANIZATION_LIST_REPART_ERROR.getCode()); + } + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(customerId, tokenDto.getUserId()); + if (null == staffInfo){ + throw new RenException(String.format("查询人员{%s}信息失败",tokenDto.getUserId())); + } + AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(staffInfo.getAgencyId()); + if (null == agencyInfo){ + throw new RenException(String.format("查询组织信息失败%s",staffInfo.getAgencyId())); + } + list.forEach(l -> { + IcCommunitySelfOrganizationEntity e = ConvertUtils.sourceToTarget(l, IcCommunitySelfOrganizationEntity.class); + e.setCustomerId(customerId); + e.setOrgId(staffInfo.getAgencyId()); + e.setOrgType(IcCommunitySelfOrganizationConstant.ORG_TYPE_AGENCY); + e.setPid(agencyInfo.getPid()); + e.setPids(agencyInfo.getPids()); + e.setOrganizationCreatedTime(l.getOrganizationCreatedTime()); + baseDao.insert(e); + if (CollectionUtils.isNotEmpty(l.getPersons())){ + List persons = ConvertUtils.sourceToTarget(l.getPersons(), IcCommunitySelfOrganizationPersonnelEntity.class); + Map> groupByPhone = persons.stream().collect(Collectors.groupingBy(IcCommunitySelfOrganizationPersonnelEntity::getPersonPhone)); + List phones = new ArrayList<>(); + groupByPhone.forEach((k,v) -> { + if (v.size() > NumConstant.ONE){ + phones.add(k); + } + }); + if (CollectionUtils.isNotEmpty(phones)){ + StringBuffer sb = new StringBuffer(); + phones.forEach(p -> { + sb.append(p).append(","); + }); + String copywriter = sb.toString().substring(NumConstant.ZERO, sb.length() - NumConstant.ONE); + EpmetErrorCode.EXISTS_SAME_PHONE_ERROR.setMsg(String.format(EpmetErrorCode.EXISTS_SAME_PHONE_ERROR.getMsg(),copywriter)); + throw new RenException(EpmetErrorCode.EXISTS_SAME_PHONE_ERROR.getCode()); + } + persons.forEach(p -> { + p.setCustomerId(customerId); + p.setOrgId(e.getId()); + }); + personnelService.insertBatch(persons); + } + }); + } + } + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java new file mode 100644 index 0000000000..4057d1ba41 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java @@ -0,0 +1,399 @@ +/** + * 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.service.impl; + +import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.commons.tools.utils.ExcelPoiUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dao.IcPartyActivityDao; +import com.epmet.dto.IcPartyActivityDTO; +import com.epmet.dto.IcPartyUnitDTO; +import com.epmet.dto.form.PartyActivityFormDTO; +import com.epmet.dto.form.demand.SubCodeFormDTO; +import com.epmet.dto.result.ActivityStatisticsDTO; +import com.epmet.dto.result.demand.OptionDTO; +import com.epmet.entity.IcPartyActivityEntity; +import com.epmet.excel.IcPartyActivityImportExcel; +import com.epmet.service.IcPartyActivityService; +import com.epmet.service.IcPartyUnitService; +import com.epmet.service.IcResiDemandDictService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.multipart.MultipartFile; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 联建活动 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-19 + */ +@Slf4j +@Service +public class IcPartyActivityServiceImpl extends BaseServiceImpl implements IcPartyActivityService { + + @Resource + private IcPartyUnitService icPartyUnitService; + @Resource + private IcResiDemandDictService icResiDemandDictService; + /** + * 服务事项code + */ + private static final String SERVICE_MATTER_CODE = "1010"; + + @Override + public PageData search(PartyActivityFormDTO formDTO) { + if (null == formDTO.getStartTime()) { + Date startDate = DateUtils.parse("1900-01-01 00:00:00", DateUtils.DATE_TIME_PATTERN); + formDTO.setStartTime(startDate); + } + if (null == formDTO.getEndTime()) { + Date endDate = DateUtils.parse("2099-12-31 00:00:00", DateUtils.DATE_TIME_PATTERN); + formDTO.setEndTime(endDate); + } + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcPartyActivityEntity::getAgencyId, formDTO.getAgencyId()); + wrapper.eq(StringUtils.isNotBlank(formDTO.getUnitId()), IcPartyActivityEntity::getUnitId, formDTO.getUnitId()); + wrapper.eq(StringUtils.isNotBlank(formDTO.getServiceMatter()), IcPartyActivityEntity::getServiceMatter, formDTO.getServiceMatter()); + wrapper.like(StringUtils.isNotBlank(formDTO.getTitle()), IcPartyActivityEntity::getTitle, formDTO.getTitle()); + wrapper.between(IcPartyActivityEntity::getActivityTime, formDTO.getStartTime(), formDTO.getEndTime()); + wrapper.orderByDesc(IcPartyActivityEntity::getUpdatedTime); + List list = baseDao.selectList(wrapper); + List dtoList = ConvertUtils.sourceToTarget(list, IcPartyActivityDTO.class); + + IcPartyUnitDTO unitDTO = new IcPartyUnitDTO(); + unitDTO.setAgencyId(formDTO.getAgencyId()); + if (CollectionUtils.isNotEmpty(dtoList)) { + Map option = icPartyUnitService.option(unitDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); + dtoList.forEach(dto -> { + dto.setUnitName(option.get(dto.getUnitId())); + }); + } + PageInfo pageInfo = new PageInfo<>(dtoList); + return new PageData<>(dtoList, pageInfo.getTotal()); + } + + @Override + public List list(PartyActivityFormDTO formDTO) { + if (null == formDTO.getStartTime()) { + Date startDate = DateUtils.parse("1900-01-01 00:00:00", DateUtils.DATE_TIME_PATTERN); + formDTO.setStartTime(startDate); + } + if (null == formDTO.getEndTime()) { + Date endDate = DateUtils.parse("2099-12-31 00:00:00", DateUtils.DATE_TIME_PATTERN); + formDTO.setEndTime(endDate); + } + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcPartyActivityEntity::getAgencyId, formDTO.getAgencyId()); + wrapper.eq(StringUtils.isNotBlank(formDTO.getUnitId()), IcPartyActivityEntity::getUnitId, formDTO.getUnitId()); + wrapper.eq(StringUtils.isNotBlank(formDTO.getServiceMatter()), IcPartyActivityEntity::getServiceMatter, formDTO.getServiceMatter()); + wrapper.like(StringUtils.isNotBlank(formDTO.getTitle()), IcPartyActivityEntity::getTitle, formDTO.getTitle()); + wrapper.between(IcPartyActivityEntity::getActivityTime, formDTO.getStartTime(), formDTO.getEndTime()); + wrapper.orderByDesc(IcPartyActivityEntity::getUpdatedTime); + List list = baseDao.selectList(wrapper); + List dtoList = ConvertUtils.sourceToTarget(list, IcPartyActivityDTO.class); + + IcPartyUnitDTO unitDTO = new IcPartyUnitDTO(); + unitDTO.setAgencyId(formDTO.getAgencyId()); + if (CollectionUtils.isNotEmpty(dtoList)) { + Map option = icPartyUnitService.option(unitDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); + dtoList.forEach(dto -> { + dto.setUnitName(option.get(dto.getUnitId())); + }); + } + + return dtoList; + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcPartyActivityDTO get(String id) { + IcPartyActivityEntity entity = baseDao.selectById(id); + if (null == entity) { + return null; + } + //获取服务事项名称 + SubCodeFormDTO codeFormDTO = new SubCodeFormDTO(); + codeFormDTO.setCustomerId(entity.getCustomerId()); + codeFormDTO.setParentCategoryCode(SERVICE_MATTER_CODE); + Map categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); + IcPartyActivityDTO dto = ConvertUtils.sourceToTarget(entity, IcPartyActivityDTO.class); + dto.setServiceMatterName(categoryMap.get(dto.getServiceMatter())); + //获取单位名称 + IcPartyUnitDTO unitDTO = icPartyUnitService.get(dto.getUnitId()); + if (null != unitDTO) { + dto.setUnitName(unitDTO.getUnitName()); + } + return dto; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(TokenDto tokenDto, IcPartyActivityDTO dto) { + IcPartyActivityEntity entity = ConvertUtils.sourceToTarget(dto, IcPartyActivityEntity.class); + CustomerStaffInfoCacheResult staff = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); + entity.setCustomerId(tokenDto.getCustomerId()); + entity.setAgencyId(staff.getAgencyId()); + entity.setPids(staff.getAgencyPIds()); + if(StringUtils.isBlank(entity.getId())) { + insert(entity); + } else { + updateById(entity); + } + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String id) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteById(id); + } + + /** + * 导入数据 + * + * @param tokenDto + * @param response + * @param file + * @Param tokenDto + * @Param response + * @Param file + * @Return + * @Author zhaoqifeng + * @Date 2021/11/29 11:01 + */ + @Override + public Result importData(TokenDto tokenDto, HttpServletResponse response, MultipartFile file) throws IOException { + ExcelImportResult importResult = ExcelPoiUtils.importExcelMore(file, 0, 1, IcPartyActivityImportExcel.class); + List failList = importResult.getFailList(); + //存放错误数据行号 + List numList = new ArrayList<>(); + if (!org.springframework.util.CollectionUtils.isEmpty(failList)) { + for (IcPartyActivityImportExcel entity : failList) { + //打印失败的行 和失败的信息 + log.warn("第{}行,{}", entity.getRowNum(), entity.getErrorMsg()); + numList.add(entity.getRowNum()); + } + } + List result = importResult.getList(); + + CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); + //获取服务事项 + SubCodeFormDTO codeFormDTO = new SubCodeFormDTO(); + codeFormDTO.setCustomerId(tokenDto.getCustomerId()); + codeFormDTO.setParentCategoryCode(SERVICE_MATTER_CODE); + Map categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getLabel, OptionDTO::getValue)); + //获取联建单位 + IcPartyUnitDTO unitDTO = new IcPartyUnitDTO(); + unitDTO.setAgencyId(staffInfoCache.getAgencyId()); + Map option = icPartyUnitService.option(unitDTO).stream().collect(Collectors.toMap(OptionDTO::getLabel, OptionDTO::getValue)); + + //1.数据校验 + Iterator iterator = result.iterator(); + while (iterator.hasNext()) { + IcPartyActivityImportExcel obj = iterator.next(); + //单位名称校验 + if (StringUtils.isBlank(obj.getUnitName())) { + numList.add(obj.getRowNum()); + log.warn(String.format("单位名称为空,行号->%s", obj.getRowNum())); + iterator.remove(); + } else if (null == option.get(obj.getUnitName())){ + numList.add(obj.getRowNum()); + log.warn(String.format("单位名称不存在,行号->%s", obj.getRowNum())); + iterator.remove(); + } + //服务事项校验 + if (StringUtils.isBlank(obj.getServiceMatter())) { + numList.add(obj.getRowNum()); + log.warn(String.format("服务事项为空,行号->%s", obj.getRowNum())); + iterator.remove(); + } else if (null == categoryMap.get(obj.getServiceMatter())){ + numList.add(obj.getRowNum()); + log.warn(String.format("服务事项不存在,行号->%s", obj.getRowNum())); + iterator.remove(); + } + //活动标题 活动目标 活动内容 活动时间 活动地址 活动地址经度 活动地址纬度 活动结果 + if(StringUtils.isBlank(obj.getTitle()) || StringUtils.isBlank(obj.getTarget()) || + StringUtils.isBlank(obj.getContent()) || + StringUtils.isBlank(obj.getActivityTime()) || + StringUtils.isBlank(obj.getAddress()) || + StringUtils.isBlank(obj.getLatitude()) || + StringUtils.isBlank(obj.getLongitude()) || + StringUtils.isBlank(obj.getResult())) { + numList.add(obj.getRowNum()); + log.warn(String.format("活动标题、活动目标、活动内容、活动时间、活动地址、活动地址经度、活动地址纬度、活动结果为空,行号->%s", obj.getRowNum())); + iterator.remove(); + } + } + if (CollectionUtils.isEmpty(result)) { + Collections.sort(numList); + String subList = numList.stream().map(String::valueOf).collect(Collectors.joining("、")); + return new Result().error(9999, "第" + subList + "行未成功!"); + } + + List list = result.stream().map(item -> { + IcPartyActivityEntity entity = new IcPartyActivityEntity(); + entity.setCustomerId(tokenDto.getCustomerId()); + entity.setAgencyId(staffInfoCache.getAgencyId()); + entity.setPids(staffInfoCache.getAgencyPIds()); + entity.setTitle(item.getTitle()); + entity.setTarget(item.getTarget()); + entity.setContent(item.getContent()); + entity.setUnitId(option.get(item.getUnitName())); + entity.setServiceMatter(categoryMap.get(item.getServiceMatter())); + entity.setPeopleCount(item.getPeopleCount()); + entity.setActivityTime(DateUtils.parse(item.getActivityTime(), DateUtils.DATE_TIME_PATTERN)); + entity.setAddress(item.getAddress()); + entity.setLatitude(item.getLatitude()); + entity.setLongitude(item.getLongitude()); + entity.setResult(item.getResult()); + return entity; + }).collect(Collectors.toList()); + + insertBatch(list); + + String str = String.format("共%s条,成功导入%s条。", numList.size() + result.size(), numList.size() + result.size() - numList.size()); + if (numList.size() > NumConstant.ZERO) { + Collections.sort(numList); + String subList = numList.stream().map(String::valueOf).collect(Collectors.joining("、")); + log.warn(str + "第" + subList + "行未成功!"); + return new Result().error(9999, str + "第" + subList + "行未成功!"); + } + return new Result().ok(str); + } + + /** + * 联建活动统计 + * + * @param formDTO + * @Param formDTO + * @Return {@link List< OptionDTO>} + * @Author zhaoqifeng + * @Date 2021/12/9 14:55 + */ + @Override + public List statistics(PartyActivityFormDTO formDTO) { + List list = new ArrayList<>(); + if (null == formDTO.getStartTime() && null == formDTO.getEndTime()) { + setDate(formDTO); + } + ActivityStatisticsDTO dto = baseDao.getStatistics(formDTO); + + OptionDTO unit = new OptionDTO(); + unit.setLabel("组织单位"); + unit.setValue(dto.getUnitCount()); + list.add(unit); + OptionDTO activity = new OptionDTO(); + activity.setLabel("组织活动"); + activity.setValue(dto.getActivityCount()); + list.add(activity); + + return list; + } + + /** + * 联建活动统计列表 + * + * @param formDTO + * @Param formDTO + * @Return {@link PageData< IcPartyActivityDTO>} + * @Author zhaoqifeng + * @Date 2021/12/9 16:24 + */ + @Override + public PageData getActivityList(TokenDto tokenDto, PartyActivityFormDTO formDTO) { + if (null == formDTO.getStartTime() && null == formDTO.getEndTime()) { + setDate(formDTO); + } + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); + //获取活动列表 + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.and(wp -> wp.eq(IcPartyActivityEntity::getAgencyId, formDTO.getAgencyId()).or(). + like(IcPartyActivityEntity::getPids, formDTO.getAgencyId())); + wrapper.eq(StringUtils.isNotBlank(formDTO.getServiceMatter()), IcPartyActivityEntity::getServiceMatter, formDTO.getServiceMatter()); + wrapper.ge(null != formDTO.getStartTime(),IcPartyActivityEntity::getActivityTime, formDTO.getStartTime()); + wrapper.le(null != formDTO.getEndTime(), IcPartyActivityEntity::getActivityTime, formDTO.getEndTime()); + wrapper.orderByDesc(IcPartyActivityEntity::getActivityTime); + List list = baseDao.selectList(wrapper); + List dtoList = ConvertUtils.sourceToTarget(list, IcPartyActivityDTO.class); + + IcPartyUnitDTO unitDTO = new IcPartyUnitDTO(); + unitDTO.setAgencyId(formDTO.getAgencyId()); + if (CollectionUtils.isNotEmpty(dtoList)) { + //获取联建单位 + Map option = icPartyUnitService.option(unitDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); + //获取服务事项字典 + SubCodeFormDTO codeFormDTO = new SubCodeFormDTO(); + codeFormDTO.setCustomerId(tokenDto.getCustomerId()); + codeFormDTO.setParentCategoryCode(SERVICE_MATTER_CODE); + Map categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); + //数据组装 + dtoList.forEach(dto -> { + dto.setServiceMatterName(categoryMap.get(dto.getServiceMatter())); + dto.setUnitName(option.get(dto.getUnitId())); + }); + } + PageInfo pageInfo = new PageInfo<>(dtoList); + return new PageData<>(dtoList, pageInfo.getTotal()); + } + + /** + * 近30天开始时间和结束时间 (精确到秒) + * @Param formDTO + * @Return + * @Author zhaoqifeng + * @Date 2021/12/13 17:40 + */ + private void setDate(PartyActivityFormDTO formDTO) { + String start = DateUtils.getBeforeNDay(30); + formDTO.setStartTime(DateUtils.parse(start.concat("000000"), DateUtils.DATE_TIME_NO_SPLIT)); + String end = DateUtils.format(new Date(), DateUtils.DATE_PATTERN); + formDTO.setEndTime(DateUtils.parse(end.concat(" 23:59:59"), DateUtils.DATE_TIME_PATTERN)); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java new file mode 100644 index 0000000000..ab96c7c68b --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java @@ -0,0 +1,461 @@ +/** + * 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.service.impl; + +import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult; +import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.rocketmq.messages.CalPartyUnitSatisfactionFormDTO; +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.dto.form.DictListFormDTO; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.dto.result.DictListResultDTO; +import com.epmet.commons.tools.dto.result.OptionDataResultDTO; +import com.epmet.commons.tools.enums.DictTypeEnum; +import com.epmet.commons.tools.enums.PartyUnitTypeEnum; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.ExcelPoiUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dao.IcPartyUnitDao; +import com.epmet.dto.IcPartyUnitDTO; +import com.epmet.dto.form.PartyActivityFormDTO; +import com.epmet.dto.form.PartyUnitFormDTO; +import com.epmet.dto.form.demand.ServiceQueryFormDTO; +import com.epmet.dto.form.demand.SubCodeFormDTO; +import com.epmet.dto.result.PartyUnitDistributionResultDTO; +import com.epmet.dto.result.demand.OptionDTO; +import com.epmet.dto.result.demand.ServiceStatDTO; +import com.epmet.entity.IcPartyUnitEntity; +import com.epmet.excel.IcPartyUnitImportExcel; +import com.epmet.feign.EpmetAdminOpenFeignClient; +import com.epmet.service.IcPartyUnitService; +import com.epmet.service.IcResiDemandDictService; +import com.epmet.service.IcUserDemandRecService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.multipart.MultipartFile; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 联建单位 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-19 + */ +@Slf4j +@Service +public class IcPartyUnitServiceImpl extends BaseServiceImpl implements IcPartyUnitService { + + @Resource + private EpmetAdminOpenFeignClient epmetAdminOpenFeignClient; + @Resource + private IcUserDemandRecService icUserDemandRecService; + @Resource + private IcResiDemandDictService icResiDemandDictService; + + + @Override + public PageData search(PartyUnitFormDTO formDTO) { + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcPartyUnitEntity::getAgencyId, formDTO.getAgencyId()); + wrapper.like(StringUtils.isNotBlank(formDTO.getUnitName()), IcPartyUnitEntity::getUnitName, formDTO.getUnitName()); + wrapper.like(StringUtils.isNotBlank(formDTO.getServiceMatter()), IcPartyUnitEntity::getServiceMatter, formDTO.getServiceMatter()); + wrapper.eq(StringUtils.isNotBlank(formDTO.getType()), IcPartyUnitEntity::getType, formDTO.getType()); + wrapper.like(StringUtils.isNotBlank(formDTO.getContact()), IcPartyUnitEntity::getContact, formDTO.getContact()); + wrapper.like(StringUtils.isNotBlank(formDTO.getContactMobile()), IcPartyUnitEntity::getContactMobile, formDTO.getContactMobile()); + wrapper.orderByDesc(IcPartyUnitEntity::getUpdatedTime); + List list = baseDao.selectList(wrapper); + List dtoList = ConvertUtils.sourceToTarget(list, IcPartyUnitDTO.class); + Result> unitTypeMap = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.PARTY_UNIT_TYPE.getCode()); + SubCodeFormDTO codeFormDTO = new SubCodeFormDTO(); + codeFormDTO.setCustomerId(formDTO.getCustomerId()); + codeFormDTO.setParentCategoryCode("1010"); + Map categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); + dtoList.forEach(item -> { + item.setType(unitTypeMap.getData().get(item.getType())); + if (StringUtils.isNotBlank(item.getServiceMatter())) { + List matters = Arrays.asList(item.getServiceMatter().split(StrConstant.COMMA)); + item.setServiceMatterList(matters.stream().map(categoryMap::get).collect(Collectors.toList())); + } else { + item.setServiceMatterList(new ArrayList<>()); + } + if(StringUtils.isBlank(item.getSatisfaction())){ + item.setSatisfaction(StrConstant.HYPHEN); + }else{ + item.setSatisfaction(new BigDecimal(item.getSatisfaction()).setScale(2,BigDecimal.ROUND_HALF_UP).toString()); + } + }); + PageInfo pageInfo = new PageInfo<>(dtoList); + return new PageData<>(dtoList, pageInfo.getTotal()); + } + + @Override + public List list(PartyUnitFormDTO formDTO) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcPartyUnitEntity::getAgencyId, formDTO.getAgencyId()); + wrapper.like(StringUtils.isNotBlank(formDTO.getUnitName()), IcPartyUnitEntity::getUnitName, formDTO.getUnitName()); + wrapper.like(StringUtils.isNotBlank(formDTO.getServiceMatter()), IcPartyUnitEntity::getServiceMatter, formDTO.getServiceMatter()); + wrapper.eq(StringUtils.isNotBlank(formDTO.getType()), IcPartyUnitEntity::getType, formDTO.getType()); + wrapper.like(StringUtils.isNotBlank(formDTO.getContact()), IcPartyUnitEntity::getContact, formDTO.getContact()); + wrapper.like(StringUtils.isNotBlank(formDTO.getContactMobile()), IcPartyUnitEntity::getContactMobile, formDTO.getContactMobile()); + wrapper.orderByDesc(IcPartyUnitEntity::getUpdatedTime); + List list = baseDao.selectList(wrapper); + List dtoList = ConvertUtils.sourceToTarget(list, IcPartyUnitDTO.class); + Result> unitTypeMap = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.PARTY_UNIT_TYPE.getCode()); + SubCodeFormDTO codeFormDTO = new SubCodeFormDTO(); + codeFormDTO.setCustomerId(formDTO.getCustomerId()); + codeFormDTO.setParentCategoryCode("1010"); + Map categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); + dtoList.forEach(item -> { + item.setType(unitTypeMap.getData().get(item.getType())); + if (StringUtils.isNotBlank(item.getServiceMatter())) { + List matters = Arrays.asList(item.getServiceMatter().split(StrConstant.COMMA)); + item.setServiceMatterList(matters.stream().map(categoryMap::get).collect(Collectors.toList())); + } else { + item.setServiceMatterList(new ArrayList<>()); + } + }); + return dtoList; + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcPartyUnitDTO get(String id) { + IcPartyUnitEntity entity = baseDao.selectById(id); + IcPartyUnitDTO dto = ConvertUtils.sourceToTarget(entity, IcPartyUnitDTO.class); + if (StringUtils.isNotBlank(dto.getServiceMatter())) { + dto.setServiceMatterList(Arrays.asList(dto.getServiceMatter().split(StrConstant.COMMA))); + } + return dto; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(TokenDto tokenDto, IcPartyUnitDTO dto) { + IcPartyUnitEntity entity = ConvertUtils.sourceToTarget(dto, IcPartyUnitEntity.class); + CustomerStaffInfoCacheResult staff = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); + entity.setAgencyId(staff.getAgencyId()); + entity.setPids(staff.getAgencyPIds()); + if (CollectionUtils.isNotEmpty(dto.getServiceMatterList())) { + entity.setServiceMatter(StringUtils.join(dto.getServiceMatterList(), StrConstant.COMMA)); + } + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcPartyUnitEntity::getAgencyId, entity.getAgencyId()); + wrapper.eq(IcPartyUnitEntity::getUnitName, entity.getUnitName()); + List list = baseDao.selectList(wrapper); + if(StringUtils.isBlank(entity.getId())) { + if (CollectionUtils.isNotEmpty(list)) { + throw new EpmetException(EpmetErrorCode.PARTY_UNIT_NAME_EXITED.getCode(), EpmetErrorCode.PARTY_UNIT_NAME_EXITED.getMsg(), EpmetErrorCode.PARTY_UNIT_NAME_EXITED.getMsg()); + } + insert(entity); + } else { + if (CollectionUtils.isNotEmpty(list) && list.get(0).getId().equals(entity.getId())) { + throw new EpmetException(EpmetErrorCode.PARTY_UNIT_NAME_EXITED.getCode(), EpmetErrorCode.PARTY_UNIT_NAME_EXITED.getMsg(), EpmetErrorCode.PARTY_UNIT_NAME_EXITED.getMsg()); + } + updateById(entity); + } + } + + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String id) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteById(id); + } + + /** + * 需求指派,选择区域化党建单位,调用此接口 + * 返回需求所属组织线上的数据 + * + * @param formDTO + * @return + */ + @Override + public List queryServiceList(ServiceQueryFormDTO formDTO) { + List resultList = new ArrayList<>(); + CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); + if (null == staffInfoCacheResult || StringUtils.isBlank(staffInfoCacheResult.getAgencyId())) { + throw new EpmetException("工作人员所属组织信息查询异常"); + } + List agencyIds = new ArrayList<>(); + if (StringUtils.isNotBlank(staffInfoCacheResult.getAgencyPIds()) && !NumConstant.ZERO_STR.equals(staffInfoCacheResult.getAgencyPIds())) { + if (staffInfoCacheResult.getAgencyPIds().contains(StrConstant.COLON)) { + agencyIds.addAll(Arrays.asList(staffInfoCacheResult.getAgencyPIds().split(StrConstant.COLON))); + }else{ + //当前用户属于第二级组织的人,不会有: + agencyIds.add(staffInfoCacheResult.getAgencyPIds()); + } + } + agencyIds.add(staffInfoCacheResult.getAgencyId()); + resultList=baseDao.selectListByAgencyId(agencyIds,formDTO.getServiceName(),formDTO.getCustomerId()); + return resultList; + } + + /** + * @Description 获取组织下单位列表 + * @param dto + * @Return {@link List< OptionDTO>} + * @Author zhaoqifeng + * @Date 2021/11/22 14:35 + */ + @Override + public List option(IcPartyUnitDTO dto) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcPartyUnitEntity::getAgencyId, dto.getAgencyId()); + wrapper.orderByDesc(IcPartyUnitEntity::getUpdatedTime); + wrapper.eq(StringUtils.isNotBlank(dto.getServiceMatter()), IcPartyUnitEntity::getServiceMatter, dto.getServiceMatter()); + List list = baseDao.selectList(wrapper); + if (CollectionUtils.isEmpty(list)) { + return Collections.emptyList(); + } + return list.stream().map(item -> { + OptionDTO option = new OptionDTO(); + option.setValue(item.getId()); + option.setLabel(item.getUnitName()); + return option; + }).collect(Collectors.toList()); + } + + /** + * 导入数据 + * + * @param tokenDto + * @param response + * @param file + * @Param tokenDto + * @Param response + * @Param file + * @Return + * @Author zhaoqifeng + * @Date 2021/11/29 11:01 + */ + @Override + public Result importData(TokenDto tokenDto, HttpServletResponse response, MultipartFile file) throws IOException { + ExcelImportResult importResult = ExcelPoiUtils.importExcelMore(file, 0, 1, IcPartyUnitImportExcel.class); + List failList = importResult.getFailList(); + //存放错误数据行号 + List numList = new ArrayList<>(); + if (!org.springframework.util.CollectionUtils.isEmpty(failList)) { + for (IcPartyUnitImportExcel entity : failList) { + //打印失败的行 和失败的信息 + log.warn("第{}行,{}", entity.getRowNum(), entity.getErrorMsg()); + numList.add(entity.getRowNum()); + } + } + List result = importResult.getList(); + + CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); + if (null == staffInfoCache) { + throw new EpmetException(8000, "获取用户缓存失败"); + } + SubCodeFormDTO codeFormDTO = new SubCodeFormDTO(); + codeFormDTO.setCustomerId(tokenDto.getCustomerId()); + codeFormDTO.setParentCategoryCode("1010"); + Map categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getLabel, OptionDTO::getValue)); + //1.数据校验 + Iterator iterator = result.iterator(); + while (iterator.hasNext()) { + IcPartyUnitImportExcel obj = iterator.next(); + //单位名称不能为空,不可重复 + if (StringUtils.isBlank(obj.getUnitName())) { + numList.add(obj.getRowNum()); + log.warn(String.format("单位名称为空,行号->%s", obj.getRowNum())); + iterator.remove(); + } else { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcPartyUnitEntity::getAgencyId, staffInfoCache.getAgencyId()); + wrapper.eq(IcPartyUnitEntity::getUnitName, obj.getUnitName()); + List list = baseDao.selectList(wrapper); + if (CollectionUtils.isNotEmpty(list)) { + numList.add(obj.getRowNum()); + log.warn(String.format("单位名称已存在,行号->%s", obj.getRowNum())); + iterator.remove(); + } + } + //分类校验 + if (StringUtils.isBlank(obj.getType()) || null == PartyUnitTypeEnum.getCode(obj.getType())) { + numList.add(obj.getRowNum()); + log.warn(String.format("分类名不存在,行号->%s", obj.getRowNum())); + iterator.remove(); + } + //服务事项校验 + if (StringUtils.isNotBlank(obj.getServiceMatter())) { + List matters = Arrays.asList(obj.getServiceMatter().split(StrConstant.COLON)); + matters.forEach(item -> { + if (null == categoryMap.get(item)) { + numList.add(obj.getRowNum()); + log.warn(String.format("服务事项不存在,行号->%s", obj.getRowNum())); + iterator.remove(); + } + }); + } + //联系人 联系电话 在职党员 地址 中心位置经度 中心位置纬度 校验 + if (StringUtils.isBlank(obj.getContact()) || StringUtils.isBlank(obj.getContactMobile()) || + StringUtils.isBlank(obj.getContact()) || + null == obj.getMemberCount() || + StringUtils.isBlank(obj.getLatitude()) || + StringUtils.isBlank(obj.getLongitude())) { + numList.add(obj.getRowNum()); + log.warn(String.format("联系人、联系电话、在职党员、地址、中心位置经度、中心位置纬度为空,行号->%s", obj.getRowNum())); + iterator.remove(); + } + + } + if (CollectionUtils.isEmpty(result)) { + Collections.sort(numList); + String subList = numList.stream().map(String::valueOf).collect(Collectors.joining("、")); + return new Result().error(9999, "第" + subList + "行未成功!"); + } + + List list = result.stream().map(item -> { + IcPartyUnitEntity entity = new IcPartyUnitEntity(); + entity.setCustomerId(tokenDto.getCustomerId()); + entity.setAgencyId(staffInfoCache.getAgencyId()); + entity.setPids(staffInfoCache.getAgencyPIds()); + entity.setUnitName(item.getUnitName()); + entity.setType(PartyUnitTypeEnum.getCode(item.getType())); + if (StringUtils.isNotBlank(item.getServiceMatter())) { + entity.setServiceMatter(getServiceMatter(categoryMap, item.getServiceMatter())); + } + entity.setContact(item.getContact()); + entity.setContactMobile(item.getContactMobile()); + entity.setAddress(item.getAddress()); + entity.setLatitude(item.getLatitude()); + entity.setLongitude(item.getLongitude()); + entity.setMemberCount(item.getMemberCount()); + entity.setRemark(item.getRemark()); + return entity; + }).collect(Collectors.toList()); + + insertBatch(list); + + String str = String.format("共%s条,成功导入%s条。", numList.size() + result.size(), numList.size() + result.size() - numList.size()); + if (numList.size() > NumConstant.ZERO) { + Collections.sort(numList); + String subList = numList.stream().map(String::valueOf).collect(Collectors.joining("、")); + log.warn(str + "第" + subList + "行未成功!"); + return new Result().error(9999, str + "第" + subList + "行未成功!"); + } + return new Result().ok(str); + } + + /** + * @param formDTO + * @Description 按类型统计单位数量 + * @Param formDTO + * @Return {@link List} + * @Author zhaoqifeng + * @Date 2021/12/8 14:56 + */ + @Override + public List typeStatistics(PartyActivityFormDTO formDTO) { + DictListFormDTO dictFromDTO = new DictListFormDTO(); + dictFromDTO.setDictType(DictTypeEnum.PARTY_UNIT_TYPE.getCode()); + Result> dictResult = epmetAdminOpenFeignClient.dictList(dictFromDTO); + if (!dictResult.success()) { + throw new EpmetException(dictResult.getCode()); + } + + List list = baseDao.getTypeStatistics(formDTO.getAgencyId()); + Map map = list.stream().collect(Collectors.toMap(OptionDataResultDTO::getCode, OptionDataResultDTO::getValue)); + + return dictResult.getData().stream().map(item -> { + OptionDataResultDTO dto = new OptionDataResultDTO(); + dto.setLabel(item.getLabel()); + dto.setCode(item.getValue()); + dto.setValue(null == map.get(item.getValue())?NumConstant.ZERO_STR:map.get(item.getValue())); + return dto; + }).collect(Collectors.toList()); + } + + /** + * 联建单位分布 + * + * @param formDTO + * @Param formDTO + * @Return {@link List} + * @Author zhaoqifeng + * @Date 2021/12/9 10:10 + */ + @Override + public List distribution(PartyActivityFormDTO formDTO) { + Result> unitTypeMap = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.PARTY_UNIT_TYPE.getCode()); + List list = baseDao.getDistribution(formDTO.getAgencyId()); + if (CollectionUtils.isEmpty(list)) { + return Collections.emptyList(); + } + list.forEach(item -> { + item.setType(unitTypeMap.getData().get(item.getType())); + }); + return list; + } + + /** + * 计算区域化党建单位的群众满意度 + * 总分➗需求个数 + * @param formDTO + */ + @Override + public void calPartyUnitSatisfation(CalPartyUnitSatisfactionFormDTO formDTO) { + log.info("收到消息内容啦...." + JSON.toJSONString(formDTO)); + List list = icUserDemandRecService.groupByPartyUnit(formDTO.getCustomerId(), formDTO.getPartyUnitId()); + for (ServiceStatDTO serviceStatDTO : list) { + if (0 != serviceStatDTO.getDemandCount()) { + BigDecimal result = serviceStatDTO.getTotalScore().divide(new BigDecimal(serviceStatDTO.getDemandCount()), 4, BigDecimal.ROUND_HALF_UP); + baseDao.updateSatisfaction(serviceStatDTO.getServerId(),result); + } + } + } + + private String getServiceMatter(Map map, String matter) { + List matters = Arrays.asList(matter.split(StrConstant.COLON)); + List list = matters.stream().map(map::get).collect(Collectors.toList()); + return StringUtils.join(list, StrConstant.COMMA); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcResiDemandDictServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcResiDemandDictServiceImpl.java new file mode 100644 index 0000000000..8dfd1599cf --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcResiDemandDictServiceImpl.java @@ -0,0 +1,262 @@ +/** + * 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.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +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.dto.result.OptionResultDTO; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dao.IcResiDemandDictDao; +import com.epmet.dto.form.demand.*; +import com.epmet.dto.result.demand.DemandPageResDTO; +import com.epmet.dto.result.demand.OptionDTO; +import com.epmet.entity.IcResiDemandDictEntity; +import com.epmet.service.IcResiDemandDictService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +/** + * 居民需求字典表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-27 + */ +@Slf4j +@Service +public class IcResiDemandDictServiceImpl extends BaseServiceImpl implements IcResiDemandDictService { + + /** + * 分页查询 + * + * @param formDTO + * @return + */ + @Override + public PageData page(DemandDictPageFormDTO formDTO) { + PageInfo pageInfo= PageHelper.startPage(formDTO.getPageNo(), + formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.pageSelect(formDTO.getCustomerId(),formDTO.getFirstCategoryCode())); + return new PageData<>(pageInfo.getList(), pageInfo.getTotal()); + } + + /** + * 新增一级分类 + * @param formDTO + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void addFirstCategory(AddFirstCategoryFormDTO formDTO) { + if (checkCategoryName(formDTO.getCustomerId(), formDTO.getCategoryName(), NumConstant.ONE, NumConstant.ZERO_STR,null) > NumConstant.ZERO) { + // 名称唯一 + throw new RenException(EpmetErrorCode.DEMAND_NAME_EXITED.getCode(), EpmetErrorCode.DEMAND_NAME_EXITED.getMsg()); + } + + IcResiDemandDictEntity entity = new IcResiDemandDictEntity(); + entity.setCustomerId(formDTO.getCustomerId()); + entity.setCategoryName(formDTO.getCategoryName()); + entity.setLevel(NumConstant.ONE); + entity.setParentCode(NumConstant.ZERO_STR); + entity.setAwardPoint(NumConstant.ZERO); + entity.setUsableFlag(true); + // 获取当前最大的排序号 + Integer maxSort = baseDao.selectMaxSort(formDTO.getCustomerId(), NumConstant.ONE,NumConstant.ZERO_STR); + entity.setSort(null == maxSort ? NumConstant.ZERO : maxSort + 1); + // 一级分类,直接获取最大的,然后+1 + Integer maxFirstCategoryCode = baseDao.selectMaxCategoryCode(formDTO.getCustomerId(),NumConstant.ONE,NumConstant.ZERO_STR); + entity.setCategoryCode(null == maxFirstCategoryCode ? "1001" : String.valueOf(maxFirstCategoryCode + 1)); + baseDao.insert(entity); + } + + @Transactional(rollbackFor = Exception.class) + @Override + public void addChild(AddCategoryFormDTO formDTO) { + if(NumConstant.ZERO_STR.equals(formDTO.getParentCategoryCode())){ + throw new RenException("添加一级分类,调用接口/heart/icresidemanddict/addfirst"); + } + if (checkCategoryName(formDTO.getCustomerId(), formDTO.getCategoryName(), NumConstant.TWO, formDTO.getParentCategoryCode(),null) > NumConstant.ZERO) { + // 名称唯一 + throw new RenException(EpmetErrorCode.DEMAND_NAME_EXITED.getCode(), EpmetErrorCode.DEMAND_NAME_EXITED.getMsg()); + } + + IcResiDemandDictEntity entity = new IcResiDemandDictEntity(); + entity.setCustomerId(formDTO.getCustomerId()); + entity.setCategoryName(formDTO.getCategoryName()); + entity.setLevel(NumConstant.TWO); + entity.setParentCode(formDTO.getParentCategoryCode()); + entity.setAwardPoint(formDTO.getAwardPoint()); + entity.setUsableFlag(true); + // 获取当前最大的排序号 + Integer maxSort = baseDao.selectMaxSort(formDTO.getCustomerId(), NumConstant.TWO,formDTO.getParentCategoryCode()); + entity.setSort(null == maxSort ? NumConstant.ZERO : maxSort + 1); + // 二级分类,直接获取最大的,然后+1 + Integer maxCategoryCode = baseDao.selectMaxCategoryCode(formDTO.getCustomerId(),NumConstant.TWO,formDTO.getParentCategoryCode()); + entity.setCategoryCode(null == maxCategoryCode ? formDTO.getParentCategoryCode().concat("0001") : String.valueOf(maxCategoryCode + 1)); + baseDao.insert(entity); + } + + /** + * 校验名字是否存在 + * @param customerId + * @param categoryName + * @param level + * @param id + * @return + */ + public int checkCategoryName(String customerId,String categoryName,int level,String parentCategoryCode,String id){ + return baseDao.selectCountName(customerId,categoryName,level,parentCategoryCode,id); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + + /** + * 修改分类 + * + * + * @param formDTO + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void update(UpdateFormDTO formDTO) { + IcResiDemandDictEntity origin = baseDao.selectById(formDTO.getCategoryId()); + if (checkCategoryName(formDTO.getCustomerId(), formDTO.getCategoryName(), NumConstant.TWO, origin.getParentCode(), formDTO.getCategoryId()) > NumConstant.ZERO) { + // 名称唯一 + throw new RenException(EpmetErrorCode.DEMAND_NAME_EXITED.getCode(), EpmetErrorCode.DEMAND_NAME_EXITED.getMsg()); + } + origin.setCategoryName(formDTO.getCategoryName()); + if (NumConstant.TWO == origin.getLevel()) { + origin.setAwardPoint(formDTO.getAwardPoint()); + } + updateById(origin); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @param customerId + * @Description 获取居民需求 + * @Param customerId + * @Return {@link List< OptionResultDTO >} + * @Author zhaoqifeng + * @Date 2021/10/27 17:57 + */ + @Override + public List getDemandOptions(String customerId) { + return baseDao.selectDemandOptions(customerId,null); + } + + + @Override + public List getDemandOptionsV2(DemandOptionFormDTO formDTO) { + if ("addorupdate".equals(formDTO.getPurpose())) { + //只查询可用的 + return baseDao.selectDemandOptions(formDTO.getCustomerId(), "1"); + } + //查询全部 + return baseDao.selectDemandOptions(formDTO.getCustomerId(), null); + } + + @Override + public Result queryDemandNames(UserDemandNameQueryFormDTO formDTO) { + return new Result().ok(baseDao.selectCategoryNames(formDTO.getCustomerId(),formDTO.getCodeSet())); + } + + @Override + public List querySubCodeList(SubCodeFormDTO formDTO) { + List list = baseDao.selectByPCode(formDTO.getParentCategoryCode(),formDTO.getCustomerId(),formDTO.getCategoryName()); + if (CollectionUtils.isEmpty(list)) { + return Collections.emptyList(); + } + return list; + } + + @Override + public void updateStatus(StatusFormDTO formDTO) { + IcResiDemandDictEntity origin = baseDao.selectById(formDTO.getCategoryId()); + if (null == origin) { + log.error("category_id=" + formDTO.getCategoryId() + " 没有找到记录"); + return; + } + origin.setUsableFlag(formDTO.getUsableFlag()); + updateById(origin); + // 如果修改的是一级分类, 同步到二级 + if (NumConstant.ONE == origin.getLevel()) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(origin.getCategoryCode()), "PARENT_CODE", origin.getCategoryCode()); + List entityList = baseDao.selectList(wrapper); + for (IcResiDemandDictEntity sub : entityList) { + sub.setUsableFlag(formDTO.getUsableFlag()); + updateById(sub); + } + } + } + + /** + * 供服务措施管理,列表查询,显示需求类型名称用 + * + * @param customerId + * @param categoryCodes + * @return + */ + @Override + public List listByCodes(String customerId, List categoryCodes) { + return baseDao.selectSecondCodes(customerId,categoryCodes); + } + + /** + * 查询当前分类的名称 + * + * @param customerId + * @param categoryCode + * @return + */ + @Override + public String getCategoryName(String customerId, String categoryCode) { + String categoryName=baseDao.selectNameByCode(customerId,categoryCode); + return StringUtils.isNotBlank(categoryName)?categoryName: StrConstant.EPMETY_STR; + } + + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcSocietyOrgServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcSocietyOrgServiceImpl.java new file mode 100644 index 0000000000..e9fc54a6f1 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcSocietyOrgServiceImpl.java @@ -0,0 +1,271 @@ +/** + * 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.service.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dao.IcSocietyOrgDao; +import com.epmet.dto.CustomerStaffDTO; +import com.epmet.dto.IcSocietyOrgDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.form.demand.ServiceQueryFormDTO; +import com.epmet.dto.result.*; +import com.epmet.dto.result.demand.OptionDTO; +import com.epmet.entity.IcSocietyOrgEntity; +import com.epmet.excel.IcSocietyOrgExcel; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.feign.GovOrgOpenFeignClient; +import com.epmet.service.IcSocietyOrgService; +import com.epmet.service.IcUserDemandRecService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import org.apache.commons.lang3.StringUtils; +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 org.springframework.util.CollectionUtils; + +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 社会组织管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Service +public class IcSocietyOrgServiceImpl extends BaseServiceImpl implements IcSocietyOrgService { + private static final Logger log = LoggerFactory.getLogger(IcSocietyOrgServiceImpl.class); + @Autowired + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + @Autowired + private IcUserDemandRecService icUserDemandRecService; + @Autowired + private GovOrgOpenFeignClient govOrgOpenFeignClient; + + /** + * @Author sun + * @Description 新增社会组织 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public void add(AddSocietyOrgFormDTO dto) { + IcSocietyOrgEntity entity = ConvertUtils.sourceToTarget(dto, IcSocietyOrgEntity.class); + CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(dto.getCustomerId(), dto.getStaffId()); + entity.setAgencyId(staffInfoCache.getAgencyId()); + entity.setPids(staffInfoCache.getAgencyPIds()); + insert(entity); + } + + /** + * @Author sun + * @Description 修改社会组织 + **/ + @Override + public void edit(EditSocietyOrgFormDTO formDTO) { + IcSocietyOrgEntity entity = baseDao.selectById(formDTO.getSocietyId()); + if (null == entity) { + throw new RenException(String.format("修改社会组织信息失败,社会组织信息不存在,组织Id->%s", formDTO.getSocietyId())); + } + entity = ConvertUtils.sourceToTarget(formDTO, IcSocietyOrgEntity.class); + entity.setId(formDTO.getSocietyId()); + baseDao.updateById(entity); + } + + /** + * @Author sun + * @Description 删除社会组织 + **/ + @Override + public void del(String societyId) { + if (baseDao.deleteById(societyId) < NumConstant.ONE) { + throw new RenException(String.format("修改社会组织信息删除失败,社会组织Id->%s", societyId)); + } + } + + /** + * @Author sun + * @Description 社会组织列表查询 + **/ + @Override + public GetListSocietyOrgResultDTO getList(GetListSocietyOrgFormDTO formDTO) { + GetListSocietyOrgResultDTO resultDTO = new GetListSocietyOrgResultDTO(); + CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); + formDTO.setPids(staffInfoCache.getAgencyPIds()); + //1.根据查询条件分页查询社会组织数据 + PageInfo result = + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()).doSelectPageInfo(() -> baseDao.getList(formDTO)); + if (CollectionUtils.isEmpty(result.getList())) { + return resultDTO; + } + resultDTO.setTotal((int) result.getTotal()); + + //2.查询被绑定管理员信息 + UserIdsFormDTO dto = new UserIdsFormDTO(); + List staffIdList = result.getList().stream().map(SocietyOrgListResultDTO::getAdminStaffId).collect(Collectors.toList()); + staffIdList = staffIdList.stream().distinct().collect(Collectors.toList()); + dto.setUserIds(staffIdList); + Result> listResult = epmetUserOpenFeignClient.getStaffInfoList(dto); + if (!listResult.success()) { + throw new RenException("获取工作人员基本信息失败......"); + } + result.getList().forEach(r -> listResult.getData().stream().filter(u -> r.getAdminStaffId().equals(u.getStaffId())).forEach(u -> r.setAdminStaffName(u.getStaffName()))); + + //3.查询被绑定管理员信息 + OrgInfoFormDTO org = new OrgInfoFormDTO(); + List orgIds = result.getList().stream().map(SocietyOrgListResultDTO::getAgencyId).collect(Collectors.toList()); + orgIds = orgIds.stream().distinct().collect(Collectors.toList()); + org.setOrgIds(orgIds); + org.setOrgType("agency"); + Result> orgResult = govOrgOpenFeignClient.selectOrgInfo(org); + if (!orgResult.success()) { + throw new RenException("获取组织基础信息失败......"); + } + result.getList().forEach(r -> orgResult.getData().stream().filter(u -> r.getAgencyId().equals(u.getOrgId())).forEach(u -> r.setAgencyName(u.getOrgName()))); + + resultDTO.setList(result.getList()); + return resultDTO; + } + + /** + * 需求指派,选择社会组织,调用此接口 + * + * @param formDTO + * @return + */ + @Override + public List queryServiceList(ServiceQueryFormDTO formDTO) { + List resultList = new ArrayList<>(); + CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); + if (null == staffInfoCacheResult || StringUtils.isBlank(staffInfoCacheResult.getAgencyId())) { + throw new RenException("工作人员所属组织信息查询异常"); + } + List agencyIds = new ArrayList<>(); + if (StringUtils.isNotBlank(staffInfoCacheResult.getAgencyPIds()) && !NumConstant.ZERO_STR.equals(staffInfoCacheResult.getAgencyPIds())) { + if (staffInfoCacheResult.getAgencyPIds().contains(StrConstant.COLON)) { + agencyIds.addAll(Arrays.asList(staffInfoCacheResult.getAgencyPIds().split(StrConstant.COLON))); + }else{ + //当前用户属于第二级组织的人,不会有: + agencyIds.add(staffInfoCacheResult.getAgencyPIds()); + } + } + agencyIds.add(staffInfoCacheResult.getAgencyId()); + resultList = baseDao.selectListByAgencyId(agencyIds, formDTO.getServiceName(), formDTO.getCustomerId(), formDTO.getQueryPurpose()); + return resultList; + } + + /** + * @Author sun + * @Description 九小场所下组织列表导入 + **/ + @Override + public List importExcel(String customerId, List list, String staffId, List numList) throws ParseException { + CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(customerId, staffId); + //查询当前组织下的社会组织数据 + List societyOrgList = baseDao.getByAgencyId(staffInfoCache.getAgencyId()); + //1.数据校验 只允许导入当前组织下社会组织且是当前组织下不存在的社会组织 + //组织名称不一样的数据舍弃 + Iterator iterator = list.iterator(); + while (iterator.hasNext()) { + IcSocietyOrgExcel obj = iterator.next(); + if (!obj.getAgencyName().trim().equals(staffInfoCache.getAgencyName())) { + numList.add(obj.getRowNum()); + log.warn(String.format("不是当前组织下可导入的数据,组织名称->%s,行号->%s", obj.getAgencyName(), obj.getRowNum())); + iterator.remove(); + continue; + } + societyOrgList.forEach(org -> { + if (obj.getSocietyName().equals(org.getSocietyName())) { + numList.add(obj.getRowNum()); + log.warn(String.format("当前组织下的社会组织已存在,社会组织名称->%s,行号->%s", obj.getSocietyName(), obj.getRowNum())); + iterator.remove(); + } + }); + + } + if (CollectionUtils.isEmpty(list)) { + return numList; + } + + //2.查询绑定的管理员信息 + Set staffNames = list.stream().map(item -> item.getAdminStaffName().trim()).collect(Collectors.toSet()); + GetByRealNamesFormDTO dto = new GetByRealNamesFormDTO(); + dto.setCustomerId(customerId); + dto.setRealNames(staffNames); + Result> staffResult = epmetUserOpenFeignClient.getByRealNames(dto); + if (!staffResult.success()) { + throw new RenException("获取工作人员基础信息失败......"); + } + if (null == staffResult.getData()) { + Iterator iter = list.iterator(); + while (iter.hasNext()) { + IcSocietyOrgExcel obj = iter.next(); + numList.add(obj.getRowNum()); + iterator.remove(); + } + return numList; + } + Map map = staffResult.getData().stream().collect(Collectors.toMap(CustomerStaffDTO::getRealName, CustomerStaffDTO::getUserId)); + + //3.遍历封装有效数据 + List houseEntityList = new ArrayList<>(); + Iterator iterator1 = list.iterator(); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + while (iterator1.hasNext()) { + IcSocietyOrgExcel icHouseExcel = iterator1.next(); + IcSocietyOrgEntity entity = new IcSocietyOrgEntity(); + entity.setCustomerId(customerId); + entity.setAgencyId(staffInfoCache.getAgencyId()); + entity.setPids(staffInfoCache.getAgencyPIds()); + entity.setSocietyName(icHouseExcel.getSocietyName()); + entity.setServiceMatters(icHouseExcel.getServiceMatters()); + entity.setPersonInCharge(icHouseExcel.getPersonInCharge()); + entity.setMobile(icHouseExcel.getMobile()); + entity.setServiceStartTime(sdf.parse(icHouseExcel.getServiceStartTime())); + entity.setServiceEndTime(sdf.parse(icHouseExcel.getServiceEndTime())); + entity.setAdminStaffId(map.containsKey(icHouseExcel.getAdminStaffName().trim()) ? map.get(icHouseExcel.getAdminStaffName().trim()) : ""); + if ("".equals(entity.getAdminStaffId())) { + numList.add(icHouseExcel.getRowNum()); + log.warn(String.format("绑定的管理员不存在,管理员名称->%s,行号->%s", icHouseExcel.getAdminStaffName(), icHouseExcel.getRowNum())); + iterator1.remove(); + continue; + } + entity.setAddress(icHouseExcel.getAddress()); + entity.setLongitude(icHouseExcel.getLongitude()); + entity.setLatitude(icHouseExcel.getLatitude()); + houseEntityList.add(entity); + } + + //3.批量保存数据 + insertBatch(houseEntityList); + + return numList; + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java new file mode 100644 index 0000000000..e66cb7cdc9 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java @@ -0,0 +1,915 @@ +/** + * 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.service.impl; + +import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +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.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.enums.DictTypeEnum; +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.common.CustomerStaffRedis; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.constant.UserDemandConstant; +import com.epmet.dao.IcUserDemandOperateLogDao; +import com.epmet.dao.IcUserDemandRecDao; +import com.epmet.dao.IcUserDemandSatisfactionDao; +import com.epmet.dao.IcUserDemandServiceDao; +import com.epmet.dto.CustomerAgencyDTO; +import com.epmet.dto.CustomerGridDTO; +import com.epmet.dto.IcUserDemandRecDTO; +import com.epmet.dto.form.CustomerGridFormDTO; +import com.epmet.dto.form.FindIcUserFormDTO; +import com.epmet.dto.form.ResiUserFormDTO; +import com.epmet.dto.form.demand.*; +import com.epmet.dto.result.*; +import com.epmet.dto.result.demand.*; +import com.epmet.entity.*; +import com.epmet.feign.EpmetAdminOpenFeignClient; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.feign.GovOrgOpenFeignClient; +import com.epmet.service.IcResiDemandDictService; +import com.epmet.service.IcUserDemandRecService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.MapUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + * 居民需求记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-19 + */ +@Slf4j +@Service +public class IcUserDemandRecServiceImpl extends BaseServiceImpl implements IcUserDemandRecService { + @Autowired + private IcUserDemandOperateLogDao operateLogDao; + @Autowired + private IcUserDemandServiceDao demandServiceDao; + @Autowired + private IcUserDemandSatisfactionDao demandSatisfactionDao; + @Autowired + private GovOrgOpenFeignClient govOrgOpenFeignClient; + @Autowired + private IcResiDemandDictService demandDictService; + @Autowired + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + @Autowired + private EpmetAdminOpenFeignClient adminOpenFeignClient; + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcUserDemandRecDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcUserDemandRecDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcUserDemandRecDTO get(String id) { + IcUserDemandRecEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcUserDemandRecDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcUserDemandRecDTO dto) { + IcUserDemandRecEntity entity = ConvertUtils.sourceToTarget(dto, IcUserDemandRecEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public DemandRecId update(DemandAddFromDTO dto) { + IcUserDemandRecEntity origin = baseDao.selectById(dto.getDemandRecId()); + if (null == origin) { + throw new RenException(EpmetErrorCode.DEMAND_NOT_EXITS.getCode(), EpmetErrorCode.DEMAND_NOT_EXITS.getMsg()); + } + if(!UserDemandConstant.PENDING.equals(origin.getStatus())){ + //待处理的才可以修改需求 + throw new RenException(EpmetErrorCode.DEMAND_CAN_NOT_UPDATE.getCode(),EpmetErrorCode.DEMAND_CAN_NOT_UPDATE.getMsg()); + } + CustomerGridFormDTO customerGridFormDTO=new CustomerGridFormDTO(); + customerGridFormDTO.setGridId(dto.getGridId()); + Result gridInfoRes=govOrgOpenFeignClient.getGridBaseInfoByGridId(customerGridFormDTO); + if(!gridInfoRes.success()||null==gridInfoRes.getData()){ + throw new RenException("查询网格信息失败"); + } + IcUserDemandRecEntity updateEntity=ConvertUtils.sourceToTarget(dto,IcUserDemandRecEntity.class); + updateEntity.setAgencyId(gridInfoRes.getData().getPid()); + updateEntity.setGridPids(gridInfoRes.getData().getPids()); + updateEntity.setDemandUserType(UserDemandConstant.IC_RESI_USER); + updateEntity.setStatus(UserDemandConstant.PENDING); + updateEntity.setEvaluateFlag(false); + updateEntity.setId(dto.getDemandRecId()); + baseDao.updateById(updateEntity); + + IcUserDemandOperateLogEntity logEntity=new IcUserDemandOperateLogEntity(); + logEntity.setCustomerId(dto.getCustomerId()); + logEntity.setDemandRecId(dto.getDemandRecId()); + logEntity.setUserType(UserDemandConstant.STAFF); + logEntity.setUserId(dto.getCurrentUserId()); + logEntity.setActionCode(UserDemandConstant.UPDATE); + logEntity.setOperateTime(new Date()); + operateLogDao.insert(logEntity); + DemandRecId resultDto=new DemandRecId(); + resultDto.setDemandRecId(updateEntity.getId()); + return resultDto; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * 新增需求 + * + * @param fromDTO + * @return + */ + @Override + @Transactional(rollbackFor = Exception.class) + public DemandRecId add(DemandAddFromDTO fromDTO) { + CustomerGridFormDTO customerGridFormDTO=new CustomerGridFormDTO(); + customerGridFormDTO.setGridId(fromDTO.getGridId()); + Result gridInfoRes=govOrgOpenFeignClient.getGridBaseInfoByGridId(customerGridFormDTO); + if(!gridInfoRes.success()||null==gridInfoRes.getData()){ + throw new RenException("查询网格信息失败"); + } + IcUserDemandRecEntity insertEntity=ConvertUtils.sourceToTarget(fromDTO,IcUserDemandRecEntity.class); + insertEntity.setAgencyId(gridInfoRes.getData().getPid()); + insertEntity.setGridPids(gridInfoRes.getData().getPids()); + insertEntity.setDemandUserType(UserDemandConstant.IC_RESI_USER); + insertEntity.setStatus(UserDemandConstant.PENDING); + insertEntity.setEvaluateFlag(false); + baseDao.insert(insertEntity); + IcUserDemandOperateLogEntity logEntity=new IcUserDemandOperateLogEntity(); + logEntity.setCustomerId(fromDTO.getCustomerId()); + logEntity.setDemandRecId(insertEntity.getId()); + logEntity.setUserType(UserDemandConstant.STAFF); + logEntity.setUserId(fromDTO.getCurrentUserId()); + logEntity.setActionCode(UserDemandConstant.CREATE); + logEntity.setOperateTime(new Date()); + operateLogDao.insert(logEntity); + DemandRecId resultDto=new DemandRecId(); + resultDto.setDemandRecId(insertEntity.getId()); + return resultDto; + } + + @Override + public PageData pageList(UserDemandPageFormDTO formDTO) { + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getCurrentStaffId()); + if (null == staffInfo) { + throw new RenException("工作人员所属组织信息查询异常"); + } + if (StringUtils.isBlank(staffInfo.getAgencyPIds())|| NumConstant.ZERO_STR.equals(staffInfo.getAgencyPIds())) { + //当前用户属于根组织下的人 + formDTO.setGridPids(staffInfo.getAgencyId()); + } else { + formDTO.setGridPids(staffInfo.getAgencyPIds().concat(StrConstant.COLON).concat(staffInfo.getAgencyId())); + } + PageInfo pageInfo= PageHelper.startPage(formDTO.getPageNo(), + formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.pageSelect(formDTO)); + List list=pageInfo.getList(); + if(CollectionUtils.isNotEmpty(list)){ + //1、查询网格信息 + List gridIds=list.stream().map(DemandRecResultDTO::getGridId).collect(Collectors.toList()); + Result> gridInfoRes=govOrgOpenFeignClient.getGridListByGridIds(gridIds); + List gridInfoList = gridInfoRes.success() && !CollectionUtils.isEmpty(gridInfoRes.getData()) ? gridInfoRes.getData() : new ArrayList<>(); + Map gridInfoMap = gridInfoList.stream().collect(Collectors.toMap(AllGridsByUserIdResultDTO::getGridId, Function.identity())); + + //2、查询分类名称 + List categoryCodes=list.stream().map(DemandRecResultDTO::getCategoryCode).collect(Collectors.toList()); + List dictList=demandDictService.listByCodes(formDTO.getCustomerId(),categoryCodes); + Map dictMap = dictList.stream().collect(Collectors.toMap(IcResiDemandDictEntity::getCategoryCode, IcResiDemandDictEntity::getCategoryName)); + + //3、查询志愿者 + // 服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit; + Map userInfoMap=new HashMap<>(); + Set userIdList=list.stream().filter(item->item.getServiceType().equals(UserDemandConstant.VOLUNTEER)).map(DemandRecResultDTO::getServerId).collect(Collectors.toSet()); + if(CollectionUtils.isNotEmpty(userIdList)){ + Result> userInfoRes = epmetUserOpenFeignClient.queryUserBaseInfo(new ArrayList<>(userIdList)); + if(!userInfoRes.success()||CollectionUtils.isEmpty(userInfoRes.getData())){ + throw new RenException("查询志愿者信息异常"); + } + userInfoMap=userInfoRes.getData().stream().collect(Collectors.toMap(UserBaseInfoResultDTO::getUserId, UserBaseInfoResultDTO::getRealName)); + } + + //查询字典表 + Result> reportTypeRes=adminOpenFeignClient.dictMap(DictTypeEnum.USER_DEMAND_REPORT_TYPE.getCode()); + Map reportTypeMap=reportTypeRes.success()&& MapUtils.isNotEmpty(reportTypeRes.getData())?reportTypeRes.getData():new HashMap<>(); + + Result> statusRes=adminOpenFeignClient.dictMap(DictTypeEnum.USER_DEMAND_STATUS.getCode()); + Map statusMap=statusRes.success()&& MapUtils.isNotEmpty(statusRes.getData())?statusRes.getData():new HashMap<>(); + + Result> serviceTypeRes=adminOpenFeignClient.dictMap(DictTypeEnum.USER_DEMAND_SERVICE_TYPE.getCode()); + Map serviceTypeMap=serviceTypeRes.success()&& MapUtils.isNotEmpty(serviceTypeRes.getData())?serviceTypeRes.getData():new HashMap<>(); + + for(DemandRecResultDTO res:list){ + if (null != gridInfoMap && gridInfoMap.containsKey(res.getGridId())) { + res.setGridName(gridInfoMap.get(res.getGridId()).getGridName()); + } + + if (null != dictMap && dictMap.containsKey(res.getCategoryCode())) { + res.setCategoryName(dictMap.get(res.getCategoryCode())); + } + res.setFirstCategoryName(demandDictService.getCategoryName(formDTO.getCustomerId(), res.getFirstCategoryCode())); + if (null != userInfoMap && userInfoMap.containsKey(res.getServerId())) { + res.setServiceName(userInfoMap.get(res.getServerId())); + } + //社区帮办:community;楼长帮办:building_caption;党员帮办:party;自身上报:self_help + res.setReportTypeName(reportTypeMap.containsKey(res.getReportType())?reportTypeMap.get(res.getReportType()):StrConstant.EPMETY_STR); + /*switch(res.getReportType()){ + case UserDemandConstant.COMMUNITY_REPORT : + res.setReportTypeName("社区帮办"); + break; + case UserDemandConstant.BUILDING_CAPTION_REPORT : + res.setReportTypeName("楼长帮办"); + break; + case UserDemandConstant.PARTY_REPORT : + res.setReportTypeName("党员帮办"); + break; + case UserDemandConstant.SELF_HELP_REPORT : + res.setReportTypeName("自身上报"); + break; + }*/ + //待处理:pending;已取消canceled;已派单:assigned;已接单:have_order;已完成:finished + res.setStatusName(statusMap.containsKey(res.getStatus())?statusMap.get(res.getStatus()):StrConstant.EPMETY_STR); + /*switch(res.getStatus()){ + case UserDemandConstant.PENDING : + res.setStatusName("待处理"); + break; + case UserDemandConstant.CANCELED : + res.setStatusName("已取消"); + break; + case UserDemandConstant.ASSIGNED : + res.setStatusName("已指派"); + break; + case UserDemandConstant.HAVE_ORDER : + res.setStatusName("已接单"); + break; + case UserDemandConstant.FINISHED : + res.setStatusName("已完成"); + break; + }*/ + //服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit; + res.setServiceShowName(serviceTypeMap.containsKey(res.getServiceType())?res.getServiceName().concat("(").concat(serviceTypeMap.get(res.getServiceType())).concat(")"):StrConstant.EPMETY_STR); + /*switch(res.getServiceType()){ + case UserDemandConstant.VOLUNTEER : + res.setServiceShowName(res.getServiceName().concat("(志愿者)")); + break; + case UserDemandConstant.SOCIAL_ORG : + res.setServiceShowName(res.getServiceName().concat("(社会组织)")); + break; + case UserDemandConstant.COMMUNITY_ORG : + res.setServiceShowName(res.getServiceName().concat("(社区自组织")); + break; + case UserDemandConstant.PARTY_UNIT : + res.setServiceShowName(res.getServiceName().concat("(区域化党建单位)")); + break; + }*/ + res.setServiceShowFlag(StringUtils.isNotBlank(res.getServerId()) ? true : false); + } + } + return new PageData<>(list, pageInfo.getTotal()); + } + + /** + * 未完成之前都可以取消 + * + * @param formDTO + */ + @Transactional(rollbackFor = Exception.class) + @Override + public void cancel(StaffCancelFormDTO formDTO) { + IcUserDemandRecEntity entity = baseDao.selectById(formDTO.getDemandRecId()); + if (null == entity) { + throw new RenException(EpmetErrorCode.DEMAND_NOT_EXITS.getCode(), EpmetErrorCode.DEMAND_NOT_EXITS.getMsg()); + } + if (UserDemandConstant.FINISH.equals(entity.getStatus())) { + //需求已完成,不可取消 + throw new RenException(EpmetErrorCode.DEMAND_CAN_NOT_CANCEL.getCode(),EpmetErrorCode.DEMAND_CAN_NOT_CANCEL.getMsg()); + } + //1、修改主表 + //置为取消状态、设置取消时间 + entity.setStatus(UserDemandConstant.CANCELED); + entity.setCancelTime(new Date()); + baseDao.updateById(entity); + //2、插入操作日志 + IcUserDemandOperateLogEntity logEntity = new IcUserDemandOperateLogEntity(); + logEntity.setCustomerId(formDTO.getCustomerId()); + logEntity.setDemandRecId(formDTO.getDemandRecId()); + logEntity.setUserType(UserDemandConstant.STAFF); + logEntity.setUserId(formDTO.getUserId()); + logEntity.setActionCode(UserDemandConstant.CANCEL); + logEntity.setOperateTime(entity.getCancelTime()); + operateLogDao.insert(logEntity); + } + + /** + * 指派 + * 待处理:pending;已取消canceled;已派单:assigned;已接单:have_order;已完成:finished + * 待处理+已派单才可以指派 + * + * @param formDTO + * @return + */ + @Transactional(rollbackFor = Exception.class) + @Override + public void assign(AssignFormDTO formDTO) { + IcUserDemandRecEntity entity = baseDao.selectById(formDTO.getDemandRecId()); + if (null == entity) { + throw new RenException(EpmetErrorCode.DEMAND_NOT_EXITS.getCode(), EpmetErrorCode.DEMAND_NOT_EXITS.getMsg()); + } + if (!UserDemandConstant.PENDING.equals(entity.getStatus()) && !UserDemandConstant.ASSIGNED.equals(entity.getStatus())) { + //待处理+已派单才可以指派 + throw new RenException(EpmetErrorCode.DEMAND_CAN_NOT_ASSIGN.getCode(), EpmetErrorCode.DEMAND_CAN_NOT_ASSIGN.getMsg()); + } + //1、修改主表 + //置为已派单 + entity.setStatus(UserDemandConstant.ASSIGNED); + baseDao.updateById(entity); + //2、插入操作日志 + IcUserDemandOperateLogEntity logEntity = new IcUserDemandOperateLogEntity(); + logEntity.setCustomerId(formDTO.getCustomerId()); + logEntity.setDemandRecId(formDTO.getDemandRecId()); + logEntity.setUserType(UserDemandConstant.STAFF); + logEntity.setUserId(formDTO.getUserId()); + logEntity.setActionCode(UserDemandConstant.ASSIGN); + logEntity.setOperateTime(new Date()); + operateLogDao.insert(logEntity); + //3、插入或更新服务记录 + IcUserDemandServiceEntity serviceEntity=ConvertUtils.sourceToTarget(formDTO,IcUserDemandServiceEntity.class); + IcUserDemandServiceEntity origin=demandServiceDao.selectByRecId(formDTO.getDemandRecId()); + if (null == origin) { + demandServiceDao.insert(serviceEntity); + }else{ + serviceEntity.setId(origin.getId()); + serviceEntity.setUpdatedBy(formDTO.getUserId()); + demandServiceDao.updateById(serviceEntity); + } + + } + + /** + * 完成并评价 + * + * @param formDTO + */ + @Transactional(rollbackFor = Exception.class) + @Override + public FinishResultDTO finish(FinishStaffFromDTO formDTO) { + IcUserDemandRecEntity entity = baseDao.selectById(formDTO.getDemandRecId()); + if (null == entity) { + throw new RenException(EpmetErrorCode.DEMAND_NOT_EXITS.getCode(), EpmetErrorCode.DEMAND_NOT_EXITS.getMsg()); + } + if (UserDemandConstant.PENDING.equals(entity.getStatus()) ||UserDemandConstant.CANCELED.equals(entity.getStatus())) { + //待处理或者已取消的不能评价 + throw new RenException(EpmetErrorCode.DEMAND_CAN_NOT_FINISH.getCode(), EpmetErrorCode.DEMAND_CAN_NOT_FINISH.getMsg()); + } + if(UserDemandConstant.FINISHED.equals(entity.getStatus()) ){ + //已经完成 + throw new RenException(EpmetErrorCode.DEMAND_FINISHED.getCode(), EpmetErrorCode.DEMAND_FINISHED.getMsg()); + } + //1、修改主表 + entity.setStatus(UserDemandConstant.FINISHED); + entity.setFinishResult(formDTO.getFinishResult()); + entity.setEvaluateFlag(true); + baseDao.updateById(entity); + + //2、插入操作日志 + IcUserDemandOperateLogEntity logEntity = new IcUserDemandOperateLogEntity(); + logEntity.setCustomerId(formDTO.getCustomerId()); + logEntity.setDemandRecId(formDTO.getDemandRecId()); + logEntity.setUserType(UserDemandConstant.STAFF); + logEntity.setUserId(formDTO.getUserId()); + logEntity.setActionCode(UserDemandConstant.FINISH); + logEntity.setOperateTime(new Date()); + operateLogDao.insert(logEntity); + + //3、更新服务记录 + IcUserDemandServiceEntity serviceEntity=demandServiceDao.selectById(formDTO.getServiceId()); + if(null==serviceEntity){ + throw new RenException(EpmetErrorCode.DEMAND_SERVICE_NOT_EXITS.getCode(), EpmetErrorCode.DEMAND_SERVICE_NOT_EXITS.getMsg()); + } + serviceEntity.setServiceStartTime(formDTO.getServiceStartTime()); + serviceEntity.setServiceEndTime(formDTO.getServiceEndTime()); + serviceEntity.setFinishDesc(formDTO.getFinishDesc()); + demandServiceDao.updateById(serviceEntity); + + //4、插入评价 + IcUserDemandSatisfactionEntity satisfactionEntity=new IcUserDemandSatisfactionEntity(); + satisfactionEntity.setCustomerId(formDTO.getCustomerId()); + satisfactionEntity.setDemandRecId(formDTO.getDemandRecId()); + satisfactionEntity.setUserType(UserDemandConstant.STAFF); + satisfactionEntity.setUserId(formDTO.getUserId()); + satisfactionEntity.setEvaluateTime(logEntity.getOperateTime()); + satisfactionEntity.setScore(formDTO.getScore()); + demandSatisfactionDao.insert(satisfactionEntity); + FinishResultDTO finishResultDTO=new FinishResultDTO(); + finishResultDTO.setPartyUnitId(serviceEntity.getServerId()); + finishResultDTO.setSendCalStatisfaction(false); + //5、如果服务方区域化党建单位,需求重新计算当前这个单位的满意度。 + //如果服务方是区域化党建单位,需要实时去计算他的群众满意度=服务过的需求的评价分数相加➗ 需求的总个数。 + if(UserDemandConstant.PARTY_UNIT.equals(serviceEntity.getServiceType())){ + finishResultDTO.setSendCalStatisfaction(true); + } + return finishResultDTO; + } + + /** + * 数据分析-个人档案,居民需求列表table + * + * @param formDTO + * @return + */ + @Override + public PageData queryMyDemand(IcResiUserDemandFromDTO formDTO) { + /*//1、查询当前居民在小程序里是否有用户id + ResiUserFormDTO resiUserFormDTO=new ResiUserFormDTO(); + resiUserFormDTO.setCustomerId(formDTO.getCustomerId()); + resiUserFormDTO.setIcResiUserId(formDTO.getUserId()); + Result userRes=epmetUserOpenFeignClient.findUser(resiUserFormDTO); + if(!userRes.success()){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"/epmetuser/user/finduser接口异常","查找居民端小程序用户信息异常"); + } + formDTO.setEpmetUserId(userRes.getData().getEpmetUserId());*/ + //icresiuser/persondata接口已经返回去epmetUserId,这里就不需要再查询了。直接让前端传过来 + List userIds=new ArrayList<>(); + userIds.add(formDTO.getIcResiUserId()); + if(CollectionUtils.isNotEmpty(formDTO.getEpmetUserIdList())){ + userIds.addAll(formDTO.getEpmetUserIdList()); + } + formDTO.setUserIds(userIds); + //2、小程序内自己上报+赋能平台待录入的 + PageInfo pageInfo = PageHelper.startPage(formDTO.getPageNo(), + formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.selectUserDemand(formDTO)); + List list = pageInfo.getList(); + if (CollectionUtils.isNotEmpty(list)) { + // 1、状态字典 + Result> statusRes = adminOpenFeignClient.dictMap(DictTypeEnum.USER_DEMAND_STATUS.getCode()); + Map statusMap = statusRes.success() && MapUtils.isNotEmpty(statusRes.getData()) ? statusRes.getData() : new HashMap<>(); + //2、查询分类名称 + List categoryCodes = list.stream().map(IcResiUserReportDemandRes::getCategoryCode).collect(Collectors.toList()); + List dictList = demandDictService.listByCodes(formDTO.getCustomerId(), categoryCodes); + Map dictMap = dictList.stream().collect(Collectors.toMap(IcResiDemandDictEntity::getCategoryCode, IcResiDemandDictEntity::getCategoryName)); + + for (IcResiUserReportDemandRes resDto : list) { + resDto.setStatusName(statusMap.containsKey(resDto.getStatus()) ? statusMap.get(resDto.getStatus()) : StrConstant.EPMETY_STR); + if (null != dictMap && dictMap.containsKey(resDto.getCategoryCode())) { + resDto.setCategoryName(dictMap.get(resDto.getCategoryCode())); + } + resDto.setFirstCategoryName(demandDictService.getCategoryName(formDTO.getCustomerId(),resDto.getFirstCategoryCode())); + } + } + return new PageData<>(list, pageInfo.getTotal()); + } + + /** + * 数据分析-个人档案、居民需求列表-查看需求详情 + * + * @param formDTO + * @return + */ + @Override + public DemandRecResultDTO queryDemandDetail(DemandDetailFormDTO formDTO) { + DemandRecResultDTO res = baseDao.selectDemandRecDetail(formDTO.getCustomerId(), formDTO.getDemandRecId()); + if (null != res) { + CustomerGridFormDTO customerGridFormDTO = new CustomerGridFormDTO(); + customerGridFormDTO.setGridId(res.getGridId()); + Result gridInfoRes = govOrgOpenFeignClient.getGridBaseInfoByGridId(customerGridFormDTO); + res.setGridName(gridInfoRes.success() && null != gridInfoRes.getData() ? gridInfoRes.getData().getGridNamePath() : StrConstant.EPMETY_STR); + + res.setCategoryName(demandDictService.getCategoryName(formDTO.getCustomerId(), res.getCategoryCode())); + res.setFirstCategoryName(demandDictService.getCategoryName(formDTO.getCustomerId(),res.getFirstCategoryCode())); + if (UserDemandConstant.VOLUNTEER.equals(res.getServiceType())) { + // 如果服务方是志愿者,需要查询小程序端的志愿者姓名 + List userIdList = Arrays.asList(res.getServerId()); + Result> userInfoRes = epmetUserOpenFeignClient.queryUserBaseInfo(userIdList); + if (!userInfoRes.success() || CollectionUtils.isEmpty(userInfoRes.getData())) { + throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "查询志愿者信息异常"); + } + res.setServiceName(userInfoRes.getData().get(NumConstant.ZERO).getRealName()); + } + //查询字典表 + Result> reportTypeRes = adminOpenFeignClient.dictMap(DictTypeEnum.USER_DEMAND_REPORT_TYPE.getCode()); + Map reportTypeMap = reportTypeRes.success() && MapUtils.isNotEmpty(reportTypeRes.getData()) ? reportTypeRes.getData() : new HashMap<>(); + + Result> statusRes = adminOpenFeignClient.dictMap(DictTypeEnum.USER_DEMAND_STATUS.getCode()); + Map statusMap = statusRes.success() && MapUtils.isNotEmpty(statusRes.getData()) ? statusRes.getData() : new HashMap<>(); + + Result> serviceTypeRes = adminOpenFeignClient.dictMap(DictTypeEnum.USER_DEMAND_SERVICE_TYPE.getCode()); + Map serviceTypeMap = serviceTypeRes.success() && MapUtils.isNotEmpty(serviceTypeRes.getData()) ? serviceTypeRes.getData() : new HashMap<>(); + + //社区帮办:community;楼长帮办:building_caption;党员帮办:party;自身上报:self_help + res.setReportTypeName(reportTypeMap.containsKey(res.getReportType()) ? reportTypeMap.get(res.getReportType()) : StrConstant.EPMETY_STR); + + //待处理:pending;已取消canceled;已派单:assigned;已接单:have_order;已完成:finished + res.setStatusName(statusMap.containsKey(res.getStatus()) ? statusMap.get(res.getStatus()) : StrConstant.EPMETY_STR); + + //服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit; + res.setServiceShowName(serviceTypeMap.containsKey(res.getServiceType()) ? res.getServiceName().concat("(").concat(serviceTypeMap.get(res.getServiceType())).concat(")") : StrConstant.EPMETY_STR); + res.setServiceShowFlag(StringUtils.isNotBlank(res.getServerId())?true:false); + } + return res; + } + + + /** + * 数据分析-个人档案-需求详情,研判分析 + * + * @param formDTO + * @return + */ + @Override + public DemandResearchAnalysisResultDTO queryDemandResearchAnalysis(DemandResearchAnalysisFormDTO formDTO) { + //获取案件居民和及家属列表 + HouseMemResDTO houseMemResDTO=queryDemandUserFamily(formDTO); + DemandResearchAnalysisResultDTO resultDTO = ConvertUtils.sourceToTarget(houseMemResDTO, DemandResearchAnalysisResultDTO.class); + //log.info(JSON.toJSONString(formDTO)); + + //返参格式套一层类别和类别名称 + List demandData=new ArrayList<>(); + DemandDataDTO demandDataDTO=new DemandDataDTO(); + demandDataDTO.setFirstCategoryCode(formDTO.getFirstCategoryCode()); + demandDataDTO.setFirstCategoryName(demandDictService.getCategoryName(formDTO.getCustomerId(),formDTO.getFirstCategoryCode())); + demandDataDTO.setDemandList(new ArrayList<>()); + demandData.add(demandDataDTO); + + //如果是服务措施分析来的,并且是pc录入的需求,需要先去找epmetUserIdList + if (UserDemandConstant.DEMAND_ANALYSIS.equals(formDTO.getQueryOrigin()) + && StringUtils.isNotBlank(formDTO.getIcResiUserId()) + && CollectionUtils.isEmpty(formDTO.getEpmetUserIdList())) { + ResiUserFormDTO resiUserFormDTO = new ResiUserFormDTO(); + resiUserFormDTO.setCustomerId(formDTO.getCustomerId()); + resiUserFormDTO.setIcResiUserId(formDTO.getIcResiUserId()); + Result resiRes = epmetUserOpenFeignClient.findEpmetUser(resiUserFormDTO); + if (!resiRes.success()) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "查询小程序用户异常"); + } + if (null != resiRes.getData() && CollectionUtils.isNotEmpty(resiRes.getData().getEpmetUserIdList())) { + formDTO.setEpmetUserIdList(resiRes.getData().getEpmetUserIdList()); + } + } + //获取当前需求人,相同分类的需求列表。不分页,直接返回所有 + List userIds=new ArrayList<>(); + if(StringUtils.isNotBlank(formDTO.getIcResiUserId())){ + userIds.add(formDTO.getIcResiUserId()); + } + if(CollectionUtils.isNotEmpty(formDTO.getEpmetUserIdList())){ + userIds.addAll(formDTO.getEpmetUserIdList()); + } + if(StringUtils.isBlank(formDTO.getIcResiUserId())&&CollectionUtils.isEmpty(formDTO.getEpmetUserIdList())){ + //需求人不能为空 + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "需求人不能为空,icResiUserId与epmetUserIdList不能同时为空"); + } + + + IcResiUserDemandFromDTO icResiUserDemandFromDTO=new IcResiUserDemandFromDTO(); + icResiUserDemandFromDTO.setUserIds(userIds); + icResiUserDemandFromDTO.setFirstCategoryCode(formDTO.getFirstCategoryCode()); + icResiUserDemandFromDTO.setDemandRecId(formDTO.getDemandRecId()); + List demandList = baseDao.selectUserDemand(icResiUserDemandFromDTO); + + if(CollectionUtils.isNotEmpty(demandList)){ + // 1、状态字典 + Result> statusRes = adminOpenFeignClient.dictMap(DictTypeEnum.USER_DEMAND_STATUS.getCode()); + Map statusMap = statusRes.success() && MapUtils.isNotEmpty(statusRes.getData()) ? statusRes.getData() : new HashMap<>(); + //2、查询分类名称 + List categoryCodes = demandList.stream().map(IcResiUserReportDemandRes::getCategoryCode).collect(Collectors.toList()); + List dictList = demandDictService.listByCodes(formDTO.getCustomerId(), categoryCodes); + Map dictMap = dictList.stream().collect(Collectors.toMap(IcResiDemandDictEntity::getCategoryCode, IcResiDemandDictEntity::getCategoryName)); + + for (IcResiUserReportDemandRes resDto : demandList) { + //状态赋值 + resDto.setStatusName(statusMap.containsKey(resDto.getStatus()) ? statusMap.get(resDto.getStatus()) : StrConstant.EPMETY_STR); + if (null != dictMap && dictMap.containsKey(resDto.getCategoryCode())) { + //分类名称XXX-XX 或者XXX + resDto.setCategoryName(dictMap.get(resDto.getCategoryCode())); + } + //一级分类名称 + resDto.setFirstCategoryName(demandDictService.getCategoryName(formDTO.getCustomerId(),resDto.getFirstCategoryCode())); + } + demandData.get(NumConstant.ZERO).setDemandList(CollectionUtils.isNotEmpty(demandList) ? demandList : Collections.emptyList()); + } + + resultDTO.setEpmetUserIdList(CollectionUtils.isNotEmpty(formDTO.getEpmetUserIdList()) ? formDTO.getEpmetUserIdList() : Collections.emptyList()); + resultDTO.setDemandData(demandData); + return resultDTO; + } + + /** + * 数据分析-个人档案-需求详情,研判分析 + * 获取案件居民和及家属列表 + * + * + * @param formDTO + * @return + */ + private HouseMemResDTO queryDemandUserFamily(DemandResearchAnalysisFormDTO formDTO) { + HouseMemResDTO houseMemResDTO=new HouseMemResDTO(); + if(StringUtils.isBlank(formDTO.getIcResiUserId())&&CollectionUtils.isEmpty(formDTO.getEpmetUserIdList())){ + //需求人不能为空 + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "需求人不能为空,icResiUserId与epmetUserIdList不能同时为空"); + } + //服务措施分析点击了PC录入的需求,或者个人档案进来的(这两种情况肯定会有icResiUserId) + if(StringUtils.isNotBlank(formDTO.getIcResiUserId())){ + Result userRes = epmetUserOpenFeignClient.findFamilyMem(formDTO.getIcResiUserId()); + if (!userRes.success() || null == userRes.getData()) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取居民信息接口异常"); + } + houseMemResDTO=ConvertUtils.sourceToTarget(userRes.getData(),HouseMemResDTO.class); + } + //服务措施点击了,小程序用户上报的需求 + if (StringUtils.isBlank(formDTO.getIcResiUserId())&&CollectionUtils.isNotEmpty(formDTO.getEpmetUserIdList())) { + //需要找到当前这个epmetUserIdList相同身份证号的人, + //以及这个身份证号所对应的居民的家属 + FindIcUserFormDTO findIcUserFormDTO=new FindIcUserFormDTO(); + findIcUserFormDTO.setCustomerId(formDTO.getCustomerId()); + findIcUserFormDTO.setEpmetUserId(formDTO.getEpmetUserIdList().get(NumConstant.ZERO)); + Result epmetUserFamilyDTOResult=epmetUserOpenFeignClient.findIcUser(findIcUserFormDTO); + if (!epmetUserFamilyDTOResult.success() || null == epmetUserFamilyDTOResult.getData()) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "根据小程序用户id,获取ic居民信息接口异常"); + } + houseMemResDTO=ConvertUtils.sourceToTarget(epmetUserFamilyDTOResult.getData(),HouseMemResDTO.class); + formDTO.setEpmetUserIdList(epmetUserFamilyDTOResult.getData().getEpmetUserIdList()); + } + return houseMemResDTO; + } + + /** + * 数分析-服务措施分析-分页查询 + * + * @param formDTO + * @return + */ + @Override + public PageData pageListAnalysis(PageListAnalysisFormDTO formDTO) { + if("agency".equals(formDTO.getOrgType())){ + //找到当前组织的所有上级,再拼接上自己 + Result customerAgencyDTOResult=govOrgOpenFeignClient.getAgencyById(formDTO.getOrgId()); + if(!customerAgencyDTOResult.success()||null==customerAgencyDTOResult.getData()){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取组织信息异常govOrgOpenFeignClient.getAgencyById"); + } + if(NumConstant.ZERO_STR.equals(customerAgencyDTOResult.getData().getPid())){ + //当前传入的组织id=客户的根组织 + formDTO.setGridPids(formDTO.getOrgId()); + }else{ + formDTO.setGridPids(customerAgencyDTOResult.getData().getPids().concat(StrConstant.COLON).concat(formDTO.getOrgId())); + } + } + long total=NumConstant.ZERO; + List list=new ArrayList<>(); + if(formDTO.getPageFlag()){ + PageInfo pageInfo= PageHelper.startPage(formDTO.getPageNo(), + formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.pageListAnalysis(formDTO)); + list=pageInfo.getList(); + total=pageInfo.getTotal(); + }else{ + list=baseDao.pageListAnalysis(formDTO); + } + if(CollectionUtils.isNotEmpty(list)){ + //1、查询网格信息 + List gridIds=list.stream().map(DemandRecResultDTO::getGridId).collect(Collectors.toList()); + Result> gridInfoRes=govOrgOpenFeignClient.getGridListByGridIds(gridIds); + List gridInfoList = gridInfoRes.success() && !CollectionUtils.isEmpty(gridInfoRes.getData()) ? gridInfoRes.getData() : new ArrayList<>(); + Map gridInfoMap = gridInfoList.stream().collect(Collectors.toMap(AllGridsByUserIdResultDTO::getGridId, Function.identity())); + + //2、查询分类名称 + List categoryCodes=list.stream().map(DemandRecResultDTO::getCategoryCode).collect(Collectors.toList()); + List dictList=demandDictService.listByCodes(formDTO.getCustomerId(),categoryCodes); + Map dictMap = dictList.stream().collect(Collectors.toMap(IcResiDemandDictEntity::getCategoryCode, IcResiDemandDictEntity::getCategoryName)); + + //3、查询志愿者 + // 服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit; + Map userInfoMap=new HashMap<>(); + Set userIdList=list.stream().filter(item->item.getServiceType().equals(UserDemandConstant.VOLUNTEER)).map(DemandRecResultDTO::getServerId).collect(Collectors.toSet()); + if(CollectionUtils.isNotEmpty(userIdList)){ + Result> userInfoRes = epmetUserOpenFeignClient.queryUserBaseInfo(new ArrayList<>(userIdList)); + if(!userInfoRes.success()||CollectionUtils.isEmpty(userInfoRes.getData())){ + throw new RenException("查询志愿者信息异常"); + } + userInfoMap=userInfoRes.getData().stream().collect(Collectors.toMap(UserBaseInfoResultDTO::getUserId, UserBaseInfoResultDTO::getRealName)); + } + + //查询字典表 + Result> reportTypeRes=adminOpenFeignClient.dictMap(DictTypeEnum.USER_DEMAND_REPORT_TYPE.getCode()); + Map reportTypeMap=reportTypeRes.success()&& MapUtils.isNotEmpty(reportTypeRes.getData())?reportTypeRes.getData():new HashMap<>(); + + Result> statusRes=adminOpenFeignClient.dictMap(DictTypeEnum.USER_DEMAND_STATUS.getCode()); + Map statusMap=statusRes.success()&& MapUtils.isNotEmpty(statusRes.getData())?statusRes.getData():new HashMap<>(); + + Result> serviceTypeRes=adminOpenFeignClient.dictMap(DictTypeEnum.USER_DEMAND_SERVICE_TYPE.getCode()); + Map serviceTypeMap=serviceTypeRes.success()&& MapUtils.isNotEmpty(serviceTypeRes.getData())?serviceTypeRes.getData():new HashMap<>(); + + for(DemandRecResultDTO res:list){ + if (null != gridInfoMap && gridInfoMap.containsKey(res.getGridId())) { + res.setGridName(gridInfoMap.get(res.getGridId()).getGridName()); + } + + if (null != dictMap && dictMap.containsKey(res.getCategoryCode())) { + res.setCategoryName(dictMap.get(res.getCategoryCode())); + } + res.setFirstCategoryName(demandDictService.getCategoryName(formDTO.getCustomerId(), res.getFirstCategoryCode())); + if (null != userInfoMap && userInfoMap.containsKey(res.getServerId())) { + res.setServiceName(userInfoMap.get(res.getServerId())); + } + //社区帮办:community;楼长帮办:building_caption;党员帮办:party;自身上报:self_help + res.setReportTypeName(reportTypeMap.containsKey(res.getReportType())?reportTypeMap.get(res.getReportType()):StrConstant.EPMETY_STR); + //待处理:pending;已取消canceled;已派单:assigned;已接单:have_order;已完成:finished + res.setStatusName(statusMap.containsKey(res.getStatus())?statusMap.get(res.getStatus()):StrConstant.EPMETY_STR); + //服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit; + res.setServiceShowName(serviceTypeMap.containsKey(res.getServiceType())?res.getServiceName().concat("(").concat(serviceTypeMap.get(res.getServiceType())).concat(")"):StrConstant.EPMETY_STR); + res.setServiceShowFlag(StringUtils.isNotBlank(res.getServerId())?true:false); + } + } + return new PageData<>(list, total); + } + + /** + * 数据分析-服务措施分析-柱状图 + * + * @param formDTO + * @return + */ + @Override + public CategoryAnalysisResDTO categoryAnalysis(CategoryAnalysisFormDTO formDTO) { + //1、一级分类字典,没有分类直接退出 + SubCodeFormDTO subCodeFormDTO=new SubCodeFormDTO(); + subCodeFormDTO.setCustomerId(formDTO.getCusotmerId()); + subCodeFormDTO.setParentCategoryCode(NumConstant.ZERO_STR); + List firstCategoryList=demandDictService.querySubCodeList(subCodeFormDTO); + if(CollectionUtils.isEmpty(firstCategoryList)){ + return new CategoryAnalysisResDTO(Collections.EMPTY_LIST,Collections.EMPTY_LIST); + } + //2、没有服务类型直接退出 + Result> serviceTypeRes=adminOpenFeignClient.dictMap(DictTypeEnum.USER_DEMAND_SERVICE_TYPE.getCode()); + if(!serviceTypeRes.success()||MapUtils.isEmpty(serviceTypeRes.getData())){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"查询服务方类型异常,请检查是否已经配置字典信息"); + } + List legend=new ArrayList<>(); + serviceTypeRes.getData().forEach((code,name)->{ + LegendDTO legendDTO=new LegendDTO(code,name); + legend.add(legendDTO); + }); + LegendDTO unfinishLegend = new LegendDTO("unfinished", "未完成"); + legend.add(unfinishLegend); + + log.info("阶段性胜利1:"+ JSON.toJSONString(legend)); + // 3、传进来的是组织id的话,查询出全路径 + if("agency".equals(formDTO.getOrgType())){ + //找到当前组织的所有上级,再拼接上自己 + Result customerAgencyDTOResult=govOrgOpenFeignClient.getAgencyById(formDTO.getOrgId()); + if(!customerAgencyDTOResult.success()||null==customerAgencyDTOResult.getData()){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取组织信息异常govOrgOpenFeignClient.getAgencyById"); + } + if(NumConstant.ZERO_STR.equals(customerAgencyDTOResult.getData().getPid())){ + //当前传入的组织id=客户的根组织 + formDTO.setGridPids(formDTO.getOrgId()); + }else{ + formDTO.setGridPids(customerAgencyDTOResult.getData().getPids().concat(StrConstant.COLON).concat(formDTO.getOrgId())); + } + } + + //4、构造最后的反参 + List list=new ArrayList<>(); + // firstCategoryList是所有的一级分类字典 + firstCategoryList.forEach(firstCategory->{ + CategoryAnalysisDTO categoryAnalysisDTO=new CategoryAnalysisDTO(firstCategory.getValue(),firstCategory.getLabel(),NumConstant.ZERO,Collections.EMPTY_LIST); + categoryAnalysisDTO.setDetail(constructDefaultDetail(legend)); + list.add(categoryAnalysisDTO); + }); + + log.info("阶段性胜利2:"+ JSON.toJSONString(list)); + + // 5、查询出有数据的一级分类,sql计算出detail + List haveDemandList=baseDao.selectListCategoryAnalysisDTO(firstCategoryList, + formDTO.getCusotmerId(), + formDTO.getOrgId(), + formDTO.getOrgType(), + formDTO.getGridPids(), + formDTO.getStartDateId(), + formDTO.getEndDateId()); + if(!CollectionUtils.isEmpty(haveDemandList)){ + log.info("阶段性胜利3:"+ JSON.toJSONString(haveDemandList)); + Map map = haveDemandList.stream().filter(temp -> CollectionUtils.isNotEmpty(temp.getDetail())).collect(Collectors.toMap(CategoryAnalysisDTO::getCategoryCode, dto -> dto)); + if(MapUtils.isNotEmpty(map)){ + log.info("阶段性胜利4:"+ JSON.toJSONString(map)); + for(CategoryAnalysisDTO result:list){ + if (map.containsKey(result.getCategoryCode()) && null != map.get(result.getCategoryCode())) { + //如果当前分类下有上报的需求,将原来的0改为实际的需求数量 + CategoryAnalysisDTO tempDto=map.get(result.getCategoryCode()); + result.setTotal(tempDto.getTotal()); + + //当前分类有居民的明细:未完成多少个,xxx个志愿者完成xxx个需求 + if(CollectionUtils.isNotEmpty(tempDto.getDetail())){ + List resDetailList=tempDto.getDetail(); + Map detailMap = resDetailList.stream().collect(Collectors.toMap(CategoryAnalysisDetail::getLegendCode, dto -> dto)); + + //遍历之前构造好的图例 + for(CategoryAnalysisDetail resultDetail:result.getDetail()){ + if(detailMap.containsKey(resultDetail.getLegendCode())&&null!=detailMap.get(resultDetail.getLegendCode())){ + resultDetail.setTotalService(detailMap.get(resultDetail.getLegendCode()).getTotalService()); + resultDetail.setServiceDemandTotal(detailMap.get(resultDetail.getLegendCode()).getServiceDemandTotal()); + } + } + + } + + } + + } + + } + + } + + //返回结果,也不知道对不对 + CategoryAnalysisResDTO result=new CategoryAnalysisResDTO(); + result.setLegend(legend); + result.setCategoryList(list); + return result; + } + + private List constructDefaultDetail(List legend) { + List l = new ArrayList<>(); + legend.forEach(legendDTO -> { + CategoryAnalysisDetail d = ConvertUtils.sourceToTarget(legendDTO, CategoryAnalysisDetail.class); + d.setServiceDemandTotal(NumConstant.ZERO); + d.setTotalService(NumConstant.ZERO); + l.add(d); + }); + return l; + } + /** + * 计算出服务方,评价总分,服务的需求个数 + * + * @param customerId + * @param partyUnitId + * @return + */ + @Override + public List groupByPartyUnit(String customerId, String partyUnitId) { + if(StringUtils.isBlank(customerId)&&StringUtils.isBlank(partyUnitId)){ + return new ArrayList<>(); + } + return baseDao.selectGroupByPartyUnit(customerId,partyUnitId); + } + + +} \ No newline at end of file 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 71b318ba0a..ac87cc6b4c 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 @@ -18,6 +18,7 @@ package com.epmet.service.impl; import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.MqConstant; import com.epmet.commons.tools.constant.NumConstant; @@ -42,12 +43,18 @@ import com.epmet.dto.form.resi.ResiSendSmsCodeFormDTO; import com.epmet.dto.form.resi.ResiVolunteerAuthenticateFormDTO; import com.epmet.dto.result.ResiUserBaseInfoResultDTO; import com.epmet.dto.result.SendVerificationCodeResultDTO; +import com.epmet.dto.result.UserBaseInfoResultDTO; +import com.epmet.dto.result.demand.OptionDTO; +import com.epmet.dto.result.resi.PageVolunteerInfoResultDTO; import com.epmet.dto.result.resi.ResiVolunteerInfoResultDTO; import com.epmet.entity.VolunteerInfoEntity; import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.service.HeartUserInfoService; import com.epmet.service.VolunteerInfoService; +import com.github.pagehelper.PageHelper; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; @@ -56,6 +63,9 @@ import org.springframework.transaction.annotation.Transactional; import java.util.ArrayList; import java.util.List; +import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; /** * 志愿者信息 @@ -220,4 +230,52 @@ public class VolunteerInfoServiceImpl extends BaseServiceImpl queryListVolunteer(String customerId, String userRealName) { + List resultList = new ArrayList<>(); + List userIds = baseDao.selectVolunteerIds(customerId); + if (CollectionUtils.isEmpty(userIds)) { + return resultList; + } + Result> userInfoRes = epmetUserOpenFeignClient.queryUserBaseInfo(userIds); + if (userInfoRes.success() && CollectionUtils.isNotEmpty(userInfoRes.getData())) { + Map userMap = userInfoRes.getData().stream().collect(Collectors.toMap(UserBaseInfoResultDTO::getUserId, Function.identity())); + for (String userId : userIds) { + if (userMap.containsKey(userId)) { + if (StringUtils.isNoneBlank(userRealName)) { + if (userMap.get(userId).getRealName().contains(userRealName)) { + OptionDTO optionDTO = new OptionDTO(); + optionDTO.setLabel(userMap.get(userId).getRealName().concat("(").concat(userMap.get(userId).getMobile().concat(")"))); + optionDTO.setValue(userId); + resultList.add(optionDTO); + } + } else { + OptionDTO optionDTO = new OptionDTO(); + optionDTO.setLabel(userMap.get(userId).getRealName().concat("(").concat(userMap.get(userId).getMobile().concat(")"))); + optionDTO.setValue(userId); + resultList.add(optionDTO); + } + } + } + } + return resultList; + } + + @Override + public List queryVolunteerPage(String customerId, Integer pageNo, Integer pageSize) { + LambdaQueryWrapper query = new LambdaQueryWrapper<>(); + query.eq(VolunteerInfoEntity::getCustomerId, customerId); + + PageHelper.startPage(pageNo, pageSize); + List volunteerInfoEntities = baseDao.selectList(query); + + List list = volunteerInfoEntities.stream().map(vi -> { + PageVolunteerInfoResultDTO p = new PageVolunteerInfoResultDTO(); + p.setUserId(vi.getUserId()); + return p; + }).collect(Collectors.toList()); + + return list; + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/bootstrap.yml index fe4ff2e5fa..11e6aea570 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/bootstrap.yml @@ -141,7 +141,10 @@ dingTalk: robot: webHook: @dingTalk.robot.webHook@ secret: @dingTalk.robot.secret@ - +rocketmq: + # 是否开启mq + enable: @rocketmq.enable@ + name-server: @rocketmq.nameserver@ # 停机选项 shutdown: graceful: diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/epmet_heart.sql b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/epmet_heart.sql index dcfead8989..cb638c9c74 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/epmet_heart.sql +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/epmet_heart.sql @@ -1,7 +1,7 @@ /* Navicat Premium Data Transfer - Source Server : 外网192.168.1.130 + Source Server : 外网192.168.1.140 Source Server Type : MySQL Source Server Version : 50728 Source Host : 118.190.150.119:47306 diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/logback-spring.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/logback-spring.xml index aacc15fdab..df57dd24a6 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/logback-spring.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/logback-spring.xml @@ -138,10 +138,9 @@ - + - diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcCommunitySelfOrganizationDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcCommunitySelfOrganizationDao.xml new file mode 100644 index 0000000000..aff4bf4c67 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcCommunitySelfOrganizationDao.xml @@ -0,0 +1,100 @@ + + + + + + + + UPDATE ic_community_self_organization + SET ORGANIZATION_NAME = #{organizationName}, + ORGANIZATION_PERSON_COUNT = #{organizationPersonCount}, + PRINCIPAL_NAME = #{principalName}, + PRINCIPAL_PHONE = #{principalPhone}, + SERVICE_ITEM = #{serviceItem}, + LONGITUDE = #{longitude}, + LATITUDE = #{latitude}, + ORGANIZATION_CREATED_TIME = #{organizationCreatedTime}, + UPDATED_TIME = NOW(), + UPDATED_BY = #{updatedBy} + WHERE DEL_FLAG = 0 + AND ID = #{orgId} + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcCommunitySelfOrganizationPersonnelDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcCommunitySelfOrganizationPersonnelDao.xml new file mode 100644 index 0000000000..f3b365f739 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcCommunitySelfOrganizationPersonnelDao.xml @@ -0,0 +1,10 @@ + + + + + + + + DELETE FROM ic_community_self_organization_personnel WHERE ORG_ID = #{orgId} + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyActivityDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyActivityDao.xml new file mode 100644 index 0000000000..ede5b4c0e1 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyActivityDao.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitDao.xml new file mode 100644 index 0000000000..d7f02b7109 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitDao.xml @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + update ic_party_unit + set SATISFACTION=#{satisfaction},UPDATED_TIME=NOW() + where del_flag='0' + and id=#{partyUnitId} + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcResiDemandDictDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcResiDemandDictDao.xml new file mode 100644 index 0000000000..d9d79ecaec --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcResiDemandDictDao.xml @@ -0,0 +1,250 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcSocietyOrgDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcSocietyOrgDao.xml new file mode 100644 index 0000000000..56daf5dc2b --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcSocietyOrgDao.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandOperateLogDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandOperateLogDao.xml new file mode 100644 index 0000000000..0d1b2c9f14 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandOperateLogDao.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml new file mode 100644 index 0000000000..11d3190a6c --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml @@ -0,0 +1,414 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandSatisfactionDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandSatisfactionDao.xml new file mode 100644 index 0000000000..08d7883eb1 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandSatisfactionDao.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandServiceDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandServiceDao.xml new file mode 100644 index 0000000000..219f457444 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandServiceDao.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/VolunteerInfoDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/VolunteerInfoDao.xml index d4bd179a9d..4dc80881f2 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/VolunteerInfoDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/VolunteerInfoDao.xml @@ -69,9 +69,10 @@ diff --git a/epmet-module/epmet-job/epmet-job-server/deploy/docker-compose-prod.yml b/epmet-module/epmet-job/epmet-job-server/deploy/docker-compose-prod.yml index eb51914b5a..13962e8e3a 100644 --- a/epmet-module/epmet-job/epmet-job-server/deploy/docker-compose-prod.yml +++ b/epmet-module/epmet-job/epmet-job-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-job-server: container_name: epmet-job-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-job-server:0.3.29 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-job-server:0.3.43 ports: - "8084:8084" network_mode: host # 使用现有网络 @@ -15,4 +15,4 @@ services: resources: limits: cpus: '0.1' - memory: 600M \ No newline at end of file + memory: 600M diff --git a/epmet-module/epmet-job/epmet-job-server/pom.xml b/epmet-module/epmet-job/epmet-job-server/pom.xml index e29f5759e5..4ebf4f1fd3 100644 --- a/epmet-module/epmet-job/epmet-job-server/pom.xml +++ b/epmet-module/epmet-job/epmet-job-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.29 + 0.3.43 com.epmet epmet-job @@ -38,6 +38,11 @@ epmet-third-client 2.0.0 + + com.epmet + epmet-message-client + 2.0.0 + org.springframework.boot spring-boot-starter-web @@ -246,7 +251,7 @@ - false + true true diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/config/JobFeignConfig.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/config/JobFeignConfig.java new file mode 100644 index 0000000000..d053f347cf --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/config/JobFeignConfig.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.epmet.config; + +import com.epmet.commons.tools.constant.AppClientConstant; +import com.epmet.commons.tools.feign.EpmetBaseRequestInterceptor; +import feign.RequestInterceptor; +import feign.RequestTemplate; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * Feign调用,携带header + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Configuration +public class JobFeignConfig { + + @Bean + RequestInterceptor requestInterceptor() { + return new JobRequestInterceptor(); + } + + class JobRequestInterceptor extends EpmetBaseRequestInterceptor { + @Override + public void apply(RequestTemplate template) { + super.apply(template); + + // job服务自己生成流水号 + template.header(AppClientConstant.TRANSACTION_SERIAL_KEY, generateTransactionSerial()); + } + + /** + * 获取事务流水号 + * + * @return + */ + public String generateTransactionSerial() { + String[] letterPool = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n" + , "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"}; + + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < 2; i++) { + sb.append(letterPool[(int) (Math.random() * 25)]); + } + + sb.append(System.currentTimeMillis()); + return sb.toString(); + } + } +} \ No newline at end of file diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/config/ScheduleConfig.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/config/ScheduleConfig.java index 199da6b24d..a20624fa18 100644 --- a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/config/ScheduleConfig.java +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/config/ScheduleConfig.java @@ -46,6 +46,7 @@ public class ScheduleConfig { prop.put("org.quartz.jobStore.misfireThreshold", "12000"); prop.put("org.quartz.jobStore.tablePrefix", "QRTZ_"); prop.put("org.quartz.jobStore.selectWithLockSQL", "SELECT * FROM {0}LOCKS UPDLOCK WHERE LOCK_NAME = ?"); + prop.put("org.quartz.jobStore.acquireTriggersWithinLock", "true"); //PostgreSQL数据库,需要打开此注释 //prop.put("org.quartz.jobStore.driverDelegateClass", "org.quartz.impl.jdbcjobstore.PostgreSQLDelegate"); diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/SystemMessageScannerService.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/SystemMessageScannerService.java new file mode 100644 index 0000000000..3316aef52a --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/SystemMessageScannerService.java @@ -0,0 +1,23 @@ +package com.epmet.service; + +public interface SystemMessageScannerService { + /** + * @description 扫描未成功发送到MQ的消息 + * + * @param + * @return + * @author wxz + * @date 2021.10.16 23:24:05 + */ + void scanPenddingSystemMQMessage(); + + /** + * @description 扫描发送成功但是未正常处理的MQ的消息 + * + * @param + * @return + * @author wxz + * @date 2021.10.16 23:24:27 + */ + void scanBlockedSystemMQMessage(); +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/SystemMessageScannerServiceImpl.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/SystemMessageScannerServiceImpl.java new file mode 100644 index 0000000000..f47ba3ec39 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/SystemMessageScannerServiceImpl.java @@ -0,0 +1,22 @@ +package com.epmet.service; + +import com.epmet.feign.EpmetMessageOpenFeignClient; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +@Service +public class SystemMessageScannerServiceImpl implements SystemMessageScannerService { + + @Autowired + private EpmetMessageOpenFeignClient messageOpenFeignClient; + + @Override + public void scanPenddingSystemMQMessage() { + messageOpenFeignClient.penddingMqMsgScan(); + } + + @Override + public void scanBlockedSystemMQMessage() { + messageOpenFeignClient.blockedMqMsgScan(); + } +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/BlockedMQSystemMessageScanner.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/BlockedMQSystemMessageScanner.java new file mode 100644 index 0000000000..6840b15eaa --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/BlockedMQSystemMessageScanner.java @@ -0,0 +1,25 @@ +package com.epmet.task; + +import com.epmet.service.SystemMessageScannerService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +@Component("blockedMQSystemMessageScanner") +@Slf4j +public class BlockedMQSystemMessageScanner implements ITask { + + @Autowired + private SystemMessageScannerService systemMessageScannerService; + + @Override + public void run(String params) { + try { + //log.info("【blockedMQSystemMessageScanner】开始执行scanBlockedSystemMQMessage任务"); + systemMessageScannerService.scanBlockedSystemMQMessage(); + log.info("【blockedMQSystemMessageScanner】执行scanBlockedSystemMQMessage任务完成"); + } catch (Exception e) { + log.error("【blockedMQSystemMessageScanner】执行scanBlockedSystemMQMessage任务失败"); + } + } +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/PenddingMQSystemMessageScanner.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/PenddingMQSystemMessageScanner.java new file mode 100644 index 0000000000..f4b24f2cb6 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/PenddingMQSystemMessageScanner.java @@ -0,0 +1,25 @@ +package com.epmet.task; + +import com.epmet.service.SystemMessageScannerService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +@Component("penddingMQSystemMessageScanner") +@Slf4j +public class PenddingMQSystemMessageScanner implements ITask { + + @Autowired + private SystemMessageScannerService systemMessageScannerService; + + @Override + public void run(String params) { + try { + //log.info("【blockedMQSystemMessageScanner】开始执行scanBlockedSystemMQMessage任务"); + systemMessageScannerService.scanPenddingSystemMQMessage(); + log.info("【blockedMQSystemMessageScanner】执行scanPenddingSystemMQMessage任务完成"); + } catch (Exception e) { + log.error("【blockedMQSystemMessageScanner】执行scanPenddingSystemMQMessage任务失败"); + } + } +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsDemandTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsDemandTask.java new file mode 100644 index 0000000000..81c0be1c3b --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsDemandTask.java @@ -0,0 +1,23 @@ +package com.epmet.task; + +import com.epmet.feign.DataStatisticalOpenFeignClient; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * @Description + * @Author wangxianzhang + * @Date 2021/12/13 9:40 上午 + * @Version 1.0 + */ +@Component("statsDemandTask") +public class StatsDemandTask implements ITask { + + @Autowired + private DataStatisticalOpenFeignClient dataStatisticalOpenFeignClient; + + @Override + public void run(String params) { + dataStatisticalOpenFeignClient.statsVolunteerDemandServicesDaily(null); + } +} diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SystemMessageType.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SystemMessageType.java index 626b081436..284be1cb95 100644 --- a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SystemMessageType.java +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SystemMessageType.java @@ -25,4 +25,83 @@ public interface SystemMessageType { */ String POINT_RULE_CHANGED = "point_rule_changed"; + /** + * 网格新增 + */ + String GRID_CREATE = "grid_create"; + + /** + * 网格信息变更 + */ + String GRID_CHANGE = "grid_change"; + + /** + * agency机构新增 + */ + String AGENCY_CREATE = "agency_create"; + + /** + * agency机构信息变更 + */ + String AGENCY_CHANGE = "agency_change"; + + /** + * 部门新增 + */ + String DEPARTMENT_CREATE = "department_create"; + + /** + * 部门信息变更 + */ + String DEPARTMENT_CHANGE = "department_change"; + + /** + * 工作人员新增 + */ + String STAFF_CREATE = "staff_create"; + + /** + * 工作人员变更 + */ + String STAFF_CHANGE = "staff_change"; + + /** + * 用户开始巡查 + */ + String USER_PATROL_START = "user_patrol_start"; + + /** + * 用户结束巡查 + */ + String USER_PATROL_STOP = "user_patrol_stop"; + + /** + * 项目变动 + */ + String PROJECT_ADD = "project_add"; + + /** + * 项目变动 + */ + String PROJECT_EDIT = "project_edit"; + + /** + * 居民信息添加 + */ + String IC_RESI_USER_ADD = "ic_resi_user_add"; + + /** + * 居民信息修改 + */ + String IC_RESI_USER_EDIT = "ic_resi_user_edit"; + + /** + * 居民信息删除 + */ + String IC_RESI_USER_DEL = "ic_resi_user_del"; + + /** + * 需求完成,如果服务方是区域化党建单位,重新计算这个单位的满意度 + */ + String CAL_PARTY_UNIT_SATISFACTION = "cal_party_unit_satisfaction"; } diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/SystemMsgFormDTO.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/SystemMsgFormDTO.java index c0fc9308b8..c0fb1400e9 100644 --- a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/SystemMsgFormDTO.java +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/SystemMsgFormDTO.java @@ -7,9 +7,18 @@ import javax.validation.constraints.NotNull; @Data public class SystemMsgFormDTO { - @NotNull(message = "消息类型不能为空") + // 发送mq消息分组 + public interface SendMsgByMQ {} + + // 应答mq消息 + public interface AckMsgByMQ {} + + @NotNull(message = "消息类型不能为空", groups = { SendMsgByMQ.class }) private String messageType; - @NotNull(message = "消息内容不能为空") + @NotNull(message = "消息内容不能为空", groups = { SendMsgByMQ.class }) private Object content; + + @NotNull(message = "pendingMsgLabel不能为空", groups = { AckMsgByMQ.class }) + private String pendingMsgLabel; } diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/EpmetMessageOpenFeignClient.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/EpmetMessageOpenFeignClient.java index f375d75aaf..b3681a0b33 100644 --- a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/EpmetMessageOpenFeignClient.java +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/EpmetMessageOpenFeignClient.java @@ -27,7 +27,7 @@ import java.util.List; * @author yinzuomei@elink-cn.com * @date 2020/6/4 13:47 */ -//@FeignClient(name = ServiceConstant.EPMET_MESSAGE_SERVER, fallback = EpmetMessageOpenFeignClientFallback.class,url = "http://127.0.0.1:8085") +//@FeignClient(name = ServiceConstant.EPMET_MESSAGE_SERVER, fallbackFactory = EpmetMessageOpenFeignClientFallbackFactory.class, url = "http://127.0.0.1:8085") @FeignClient(name = ServiceConstant.EPMET_MESSAGE_SERVER, fallbackFactory = EpmetMessageOpenFeignClientFallbackFactory.class) public interface EpmetMessageOpenFeignClient { /** @@ -107,4 +107,26 @@ public interface EpmetMessageOpenFeignClient { */ @PostMapping("/message/system/send-by-mq") Result sendSystemMsgByMQ(@RequestBody SystemMsgFormDTO form); + + /** + * @description 检查MQ阻塞消息(MQ收到消息,但是往监听者发送消息或者监听者处理逻辑问题导致无法消费消息) + * + * @param + * @return + * @author wxz + * @date 2021.10.16 22:07:38 + */ + @PostMapping("/message/system/blocked-mq-msg-scan") + Result blockedMqMsgScan(); + + /** + * @description 检查MQ滞留消息(往MQ发送消息失败,MQ未收到消息) + * + * @param + * @return + * @author wxz + * @date 2021.10.16 22:08:32 + */ + @PostMapping("/message/system/pendding-mq-msg-scan") + Result penddingMqMsgScan(); } diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/fallback/EpmetMessageOpenFeignClientFallback.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/fallback/EpmetMessageOpenFeignClientFallback.java index 069d76c795..d9a044d73d 100644 --- a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/fallback/EpmetMessageOpenFeignClientFallback.java +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/fallback/EpmetMessageOpenFeignClientFallback.java @@ -69,4 +69,14 @@ public class EpmetMessageOpenFeignClientFallback implements EpmetMessageOpenFeig public Result sendSystemMsgByMQ(SystemMsgFormDTO form) { return ModuleUtils.feignConError(ServiceConstant.EPMET_MESSAGE_SERVER, "sendSystemMsgByMQ", form); } + + @Override + public Result blockedMqMsgScan() { + return ModuleUtils.feignConError(ServiceConstant.EPMET_MESSAGE_SERVER, "blockedMqMsgScan"); + } + + @Override + public Result penddingMqMsgScan() { + return ModuleUtils.feignConError(ServiceConstant.EPMET_MESSAGE_SERVER, "penddingMqMsgScan"); + } } diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/send/SendMqMsgUtil.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/send/SendMqMsgUtil.java index 4c7241decd..e232f5f635 100644 --- a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/send/SendMqMsgUtil.java +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/send/SendMqMsgUtil.java @@ -1,9 +1,7 @@ package com.epmet.send; import com.alibaba.fastjson.JSON; -import com.epmet.commons.rocketmq.messages.PointRuleChangedMQMsg; -import com.epmet.commons.rocketmq.messages.ProjectChangedMQMsg; -import com.epmet.commons.rocketmq.messages.GroupAchievementMQMsg; +import com.epmet.commons.rocketmq.messages.*; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.SystemMessageType; @@ -128,4 +126,91 @@ public class SendMqMsgUtil { } + /** + * @Description 发送巡查相关消息 + * @return + * @author wxz + * @date 2021.06.21 12:46 + */ + public boolean sendPatrolMqMsg(StaffPatrolMQMsg msg,String messageType) { + try { + SystemMsgFormDTO msgForm = new SystemMsgFormDTO(); + msgForm.setMessageType(messageType); + msgForm.setContent(msg); + Result sendMsgResult = null; + log.info("sendPatrolMqMsg param:{}",msgForm); + int retryTime = 0; + do { + sendMsgResult = epmetMessageOpenFeignClient.sendSystemMsgByMQ(msgForm); + } while ((sendMsgResult == null || !sendMsgResult.success()) && retryTime++ < NumConstant.TWO); + + if (sendMsgResult != null && sendMsgResult.success()) { + return true; + } + log.error("发送(巡查相关)系统消息到message服务失败:{},msg:{}", JSON.toJSONString(sendMsgResult), JSON.toJSONString(msgForm)); + } catch (Exception e) { + log.error("sendMqMsg exception", e); + } + return false; + + } + + /** + * @Description 组织、网格、人员中间库信息同步Mq + * @author sun + */ + public boolean sendOrgStaffMqMsg(OrgOrStaffMQMsg msg) { + try { + SystemMsgFormDTO msgForm = new SystemMsgFormDTO(); + msgForm.setMessageType(msg.getType()); + msgForm.setContent(msg); + Result sendMsgResult; + log.info("sendOrgStaffMqMsg param:{}",msgForm); + int retryTime = 0; + do { + sendMsgResult = epmetMessageOpenFeignClient.sendSystemMsgByMQ(msgForm); + } while ((sendMsgResult == null || !sendMsgResult.success()) && retryTime++ < NumConstant.TWO); + + if (sendMsgResult != null && sendMsgResult.success()) { + return true; + } + log.error("发送(组织、网格、人员同步中间库)系统消息到message服务失败:{},msg:{}", JSON.toJSONString(sendMsgResult), JSON.toJSONString(msgForm)); + } catch (Exception e) { + log.error("sendOrgStaffMqMsg exception", e); + } + return false; + + } + + /** + * desc: 发送项目变动事件消息 + * + * @param msgContent + * @return boolean + * @author LiuJanJun + * @date 2021/4/23 3:01 下午 + * @remark 失败重试1次,调用端自行判断如果失败是否要继续执行 + */ + public boolean sendProjectMqMsg(DisputeProcessMQMsg msgContent) { + try { + SystemMsgFormDTO systemMsgFormDTO = new SystemMsgFormDTO(); + systemMsgFormDTO.setMessageType(msgContent.getType()); + systemMsgFormDTO.setContent(msgContent); + Result sendMsgResult; + log.info("sendProjectMqMsg param:{}",msgContent); + int retryTime = 0; + do { + sendMsgResult = epmetMessageOpenFeignClient.sendSystemMsgByMQ(systemMsgFormDTO); + } while ((sendMsgResult == null || !sendMsgResult.success()) && retryTime++ < NumConstant.TWO); + + if (sendMsgResult != null && sendMsgResult.success()) { + return true; + } + log.error("发送(项目变动)系统消息到message服务失败:{},msg:{}", JSON.toJSONString(sendMsgResult), JSON.toJSONString(systemMsgFormDTO)); + } catch (Exception e) { + log.error("sendMqMsg exception", e); + } + return false; + } + } diff --git a/epmet-module/epmet-message/epmet-message-server/deploy/docker-compose-prod.yml b/epmet-module/epmet-message/epmet-message-server/deploy/docker-compose-prod.yml index 23750b4168..b2d13dc34c 100644 --- a/epmet-module/epmet-message/epmet-message-server/deploy/docker-compose-prod.yml +++ b/epmet-module/epmet-message/epmet-message-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-message-server: container_name: epmet-message-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-message-server:0.3.33 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-message-server:0.3.53 ports: - "8085:8085" network_mode: host # 使用现有网络 @@ -15,4 +15,4 @@ services: resources: limits: cpus: '0.1' - memory: 600M \ No newline at end of file + memory: 600M diff --git a/epmet-module/epmet-message/epmet-message-server/pom.xml b/epmet-module/epmet-message/epmet-message-server/pom.xml index 87d40ea5fb..622c443eb5 100644 --- a/epmet-module/epmet-message/epmet-message-server/pom.xml +++ b/epmet-module/epmet-message/epmet-message-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.33 + 0.3.53 com.epmet epmet-message @@ -332,7 +332,7 @@ - false + true true diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/SystemMessageController.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/SystemMessageController.java index 7a31e91785..8c1ea726cd 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/SystemMessageController.java +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/SystemMessageController.java @@ -17,10 +17,46 @@ public class SystemMessageController { @Autowired private SystemMessageService systemMessageService; + /** + * @description 发送mq消息 + * + * @param form + * @return + * @author wxz + * @date 2021.10.14 16:07:07 + */ @PostMapping("send-by-mq") public Result sendSystemMsgByMQ(@RequestBody SystemMsgFormDTO form) { - ValidatorUtils.validateEntity(form); - systemMessageService.sendMQMessage(form.getMessageType(), form.getContent()); + ValidatorUtils.validateEntity(form, SystemMsgFormDTO.SendMsgByMQ.class); + systemMessageService.persistAndSendMQMessage(form.getMessageType(), form.getContent()); + return new Result(); + } + + /** + * @description 检查MQ阻塞消息(MQ收到消息,但是往监听者发送消息或者监听者处理逻辑问题导致无法消费消息) + * + * @param + * @return + * @author wxz + * @date 2021.10.16 22:07:38 + */ + @PostMapping("blocked-mq-msg-scan") + public Result blockedMqMsgScan() { + systemMessageService.blockedMqMsgScan(); + return new Result(); + } + + /** + * @description 检查MQ滞留消息(往MQ发送消息失败,MQ未收到消息) + * + * @param + * @return + * @author wxz + * @date 2021.10.16 22:08:32 + */ + @PostMapping("pendding-mq-msg-scan") + public Result penddingMqMsgScan() { + systemMessageService.penddingMqMsgScan(); return new Result(); } diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/SystemMessagePenddingDao.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/SystemMessagePenddingDao.java new file mode 100644 index 0000000000..57ba0d3afb --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/SystemMessagePenddingDao.java @@ -0,0 +1,35 @@ +/** + * 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.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.SystemMessagePenddingEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 系统消息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-16 + */ +@Mapper +public interface SystemMessagePenddingDao extends BaseDao { + + void physicalDeleteById(@Param("penddingId") String penddingId); +} \ No newline at end of file diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/entity/SystemMessagePenddingEntity.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/entity/SystemMessagePenddingEntity.java new file mode 100644 index 0000000000..87a7956504 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/entity/SystemMessagePenddingEntity.java @@ -0,0 +1,61 @@ +/** + * 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.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 系统消息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("system_message_pendding") +public class SystemMessagePenddingEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 消息类型。init_customer:客户初始化,login登录,logout退出 + */ + private String msgType; + + /** + * 消息主表id + */ + private String msgId; + + /** + * 消息发送途径 + */ + private String sendApproach; + + /** + * 消息内容 + */ + private String content; + +} diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/SystemMessageService.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/SystemMessageService.java index 2985b550c9..64e34527d1 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/SystemMessageService.java +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/SystemMessageService.java @@ -2,6 +2,34 @@ package com.epmet.service; public interface SystemMessageService { - void sendMQMessage(String messageType, Object content); + /** + * @description 持久化和发送mq消息 + * + * @param messageType + * @param content + * @return + * @author wxz + * @date 2021.10.14 15:07:02 + */ + void persistAndSendMQMessage(String messageType, Object content); + /** + * @description 扫描阻塞的消息 + * + * @param + * @return + * @author wxz + * @date 2021.10.15 10:13:37 + */ + void blockedMqMsgScan(); + + /** + * @description 扫描待办的消息(因为发送到MQ失败而堆积) + * + * @param + * @return + * @author wxz + * @date 2021.10.16 12:11:39 + */ + void penddingMqMsgScan(); } diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SystemMessageServiceImpl.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SystemMessageServiceImpl.java index 9c56520419..92703db76e 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SystemMessageServiceImpl.java +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SystemMessageServiceImpl.java @@ -2,16 +2,23 @@ package com.epmet.service.impl; import com.alibaba.fastjson.JSON; import com.epmet.auth.constants.AuthOperationConstants; -import com.epmet.auth.constants.AuthOperationEnum; +import com.epmet.commons.rocketmq.constants.MQUserPropertys; import com.epmet.commons.rocketmq.constants.TopicConstants; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.redis.RedisKeys; +import com.epmet.commons.tools.redis.RedisUtils; import com.epmet.constant.SystemMessageSendApproach; import com.epmet.constant.SystemMessageType; import com.epmet.dao.SystemMessageDao; +import com.epmet.dao.SystemMessagePenddingDao; import com.epmet.entity.SystemMessageEntity; +import com.epmet.entity.SystemMessagePenddingEntity; import com.epmet.service.SystemMessageService; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; import org.apache.rocketmq.common.message.Message; import org.apache.rocketmq.remoting.common.RemotingHelper; import org.apache.rocketmq.spring.core.RocketMQTemplate; @@ -21,37 +28,118 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.time.LocalDateTime; +import java.util.List; +import java.util.Set; +import java.util.UUID; + @Service public class SystemMessageServiceImpl implements SystemMessageService { private Logger logger = LoggerFactory.getLogger(getClass()); + // 消息堆积时间阈值,单位s + private static final long PENDDING_MQ_MSG_EXEC_THRESHOLD_DELTA_L1 = 1 * 60; + private static final long PENDDING_MQ_MSG_EXEC_THRESHOLD_DELTA_L2 = 2 * 60; + private static final long PENDDING_MQ_MSG_EXEC_THRESHOLD_DELTA_L3 = 5 * 60; + private static final long PENDDING_MQ_MSG_EXEC_THRESHOLD_DELTA_L4 = 10 * 60; + private static final long PENDDING_MQ_MSG_EXEC_THRESHOLD_DELTA_L5 = 30 * 60; + private static final long PENDDING_MQ_MSG_EXEC_THRESHOLD_DELTA_L6 = 60 * 60; + + // 堆积消息告警间隔时长,单位s + public static final long PENDDING_MQ_MSG_ALERT_SECONDS_DELTA = 60 * 60; + + // 各个级别上次告警时间 + private LocalDateTime l1LastAlertTime; + private LocalDateTime l6LastAlertTime; + @Autowired private SystemMessageDao systemMessageDao; + @Autowired + private SystemMessagePenddingDao systemMessagePenddingDao; + @Autowired private RocketMQTemplate rocketMQTemplate; - @Transactional(rollbackFor = Exception.class) + @Autowired + private RedisUtils redisUtils; + @Override - public void sendMQMessage(String messageType, Object content) { + public void persistAndSendMQMessage(String messageType, Object content) { String contentStr = JSON.toJSONString(content); - //存储消息到表 - SystemMessageEntity systemMessageEntity = new SystemMessageEntity(); - systemMessageEntity.setMsgType(messageType); - systemMessageEntity.setSendApproach(SystemMessageSendApproach.MQ); - systemMessageEntity.setContent(contentStr); - systemMessageDao.insert(systemMessageEntity); - - //发送mq消息 + logger.info("【发送MQ系统消息】-落盘并发送-messageType:{}, contentStr:{}", messageType, contentStr); + // 1.消息落盘 + String penddingMsgId = persistMessage(messageType, contentStr); + + // 2.发送消息 + sendMQMessage(messageType, contentStr, penddingMsgId); + } + + /** + * @description 消息落盘,有事务 + * + * @param messageType + * @param contentStr + * @return + * @author wxz + * @date 2021.10.16 11:04:53 + */ + @Transactional(rollbackFor = Exception.class) + public String persistMessage(String messageType, String contentStr) { + + SystemMessageEntity message = new SystemMessageEntity(); + message.setMsgType(messageType); + message.setSendApproach(SystemMessageSendApproach.MQ); + message.setContent(contentStr); + systemMessageDao.insert(message); + + SystemMessagePenddingEntity pendding = new SystemMessagePenddingEntity(); + pendding.setMsgType(messageType); + pendding.setSendApproach(SystemMessageSendApproach.MQ); + pendding.setContent(contentStr); + pendding.setMsgId(message.getId()); + systemMessagePenddingDao.insert(pendding); + + logger.info("【发送MQ系统消息】-落盘完成"); + + return pendding.getId(); + } + + private void sendMQMessage(String messageType, String contentStr, String penddingId) { + String topic = getTopicByMsgType(messageType); + + // 缓存下来,供滞留消息扫描。TTL -1,永不过期 + String pendingMsgLabel = null; + String pendingMsgKey = null; try { - Message meMessage = new Message(getTopicByMsgType(messageType), messageType, contentStr.getBytes(RemotingHelper.DEFAULT_CHARSET)); + MessageCacheBean mcb = new MessageCacheBean(LocalDateTime.now(), messageType, topic, contentStr); + pendingMsgLabel = UUID.randomUUID().toString().replace("-", ""); + pendingMsgKey = RedisKeys.blockedMqMsgKey(pendingMsgLabel); + redisUtils.set(pendingMsgKey, mcb, -1); + //logger.info("【发送MQ系统消息】-存入redis堆积列表成功-{}-{}-{}", topic, messageType, pendingMsgLabel); + } catch (Exception e) { + logger.error("【发送MQ系统消息】将系统MQ消息存储到Redis堆积列表失败,业务继续执行,{}", ExceptionUtils.getThrowableErrorStackTrace(e)); + } + + // 3.发送mq消息 + try { + Message meMessage = new Message(topic, messageType, contentStr.getBytes(RemotingHelper.DEFAULT_CHARSET)); + meMessage.putUserProperty(MQUserPropertys.BLOCKED_MSG_LABEL, pendingMsgLabel); rocketMQTemplate.getProducer().send(meMessage); + logger.info("【发送MQ系统消息】-发送到MQ成功"); } catch (Exception e) { String errorStackTrace = ExceptionUtils.getErrorStackTrace(e); - logger.error("发送系统消息失败,堆栈信息:{}", errorStackTrace); + logger.error("【发送MQ系统消息】发送系统MQ消息失败,堆栈信息:{}", errorStackTrace); + + // 清理阻塞中的消息缓存 + redisUtils.delete(pendingMsgKey); + throw new RenException(EpmetErrorCode.SYSTEM_MQ_MSG_SEND_FAIL.getCode()); } + + // 删除消息堆积 + systemMessagePenddingDao.physicalDeleteById(penddingId); } /** @@ -65,7 +153,7 @@ public class SystemMessageServiceImpl implements SystemMessageService { switch (msgType) { case SystemMessageType.INIT_CUSTOMER: topic = TopicConstants.INIT_CUSTOMER; - break; + break; case SystemMessageType.PROJECT_CHANGED: topic = TopicConstants.PROJECT_CHANGED; break; @@ -79,7 +167,113 @@ public class SystemMessageServiceImpl implements SystemMessageService { case SystemMessageType.POINT_RULE_CHANGED: topic = TopicConstants.POINT; break; + case SystemMessageType.GRID_CREATE: + case SystemMessageType.GRID_CHANGE: + case SystemMessageType.AGENCY_CREATE: + case SystemMessageType.AGENCY_CHANGE: + case SystemMessageType.DEPARTMENT_CREATE: + case SystemMessageType.DEPARTMENT_CHANGE: + topic = TopicConstants.ORG; + break; + case SystemMessageType.STAFF_CREATE: + case SystemMessageType.STAFF_CHANGE: + topic = TopicConstants.STAFF; + break; + case SystemMessageType.USER_PATROL_START: + case SystemMessageType.USER_PATROL_STOP: + topic = TopicConstants.PATROL; + break; + case SystemMessageType.PROJECT_ADD: + case SystemMessageType.PROJECT_EDIT: + topic = TopicConstants.PROJECT; + break; + case SystemMessageType.IC_RESI_USER_ADD: + case SystemMessageType.IC_RESI_USER_EDIT: + case SystemMessageType.IC_RESI_USER_DEL: + topic = TopicConstants.IC_RESI_USER; + break; + case SystemMessageType.CAL_PARTY_UNIT_SATISFACTION: + topic=TopicConstants.CAL_PARTY_UNIT_SATISFACTION; + break; } return topic; } + + @Override + public void blockedMqMsgScan() { + String scanKey = RedisKeys.blockedMqMsgKey("*"); + Set keys = redisUtils.keys(scanKey); + //System.out.println(keys); + for (String key : keys) { + MessageCacheBean mcb = (MessageCacheBean) redisUtils.get(key); + + LocalDateTime createTime = mcb.getCreateTime(); + LocalDateTime now = LocalDateTime.now(); + //long deltaSeconds = ChronoUnit.SECONDS.between(createTime, now); + + // 此处暂时使用粗粒度的Topic判断,耕细粒度的应该使用SystemMessageType + switch (mcb.getTopic()) { + case TopicConstants.AUTH: + case TopicConstants.GROUP_ACHIEVEMENT: + case TopicConstants.INIT_CUSTOMER: + case TopicConstants.ORG: + case TopicConstants.PATROL: + case TopicConstants.POINT: + case TopicConstants.STAFF: + case TopicConstants.PROJECT: + + // 耗时较短。一个小时最多发送一次告警 + if (l1LastAlertTime == null || ( + createTime.plusSeconds(PENDDING_MQ_MSG_EXEC_THRESHOLD_DELTA_L1).isBefore(now) + && l1LastAlertTime.plusSeconds(PENDDING_MQ_MSG_ALERT_SECONDS_DELTA).isBefore(now)) + ) { + + logger.error("【MQ阻塞消息扫描】Topic:{},messageType:{},redisKey:{},等{}个消息发生阻塞", mcb.topic, mcb.messageType, key, keys.size()); + l1LastAlertTime = now; + + } + break; + + case TopicConstants.PROJECT_CHANGED: + // 耗时较长,一个小时最多发送一次告警 + if (l1LastAlertTime == null || ( + createTime.plusSeconds(PENDDING_MQ_MSG_EXEC_THRESHOLD_DELTA_L6).isBefore(now) + && l6LastAlertTime.plusSeconds(PENDDING_MQ_MSG_ALERT_SECONDS_DELTA).isBefore(now)) + ) { + logger.error("【MQ阻塞消息扫描】Topic:{},messageType:{},redisKey:{},等{}个消息发生阻塞", mcb.topic, mcb.messageType, key, keys.size()); + l1LastAlertTime = now; + } + break; + } + } + } + + @Override + public void penddingMqMsgScan() { + Integer count = systemMessagePenddingDao.selectCount(null); + if (count == 0) { + return; + } + + // 扫描并且重新投递 + List penddingMsgs = systemMessagePenddingDao.selectList(null); + for (SystemMessagePenddingEntity penddingMsg : penddingMsgs) { + try { + sendMQMessage(penddingMsg.getMsgType(), penddingMsg.getContent(), penddingMsg.getId()); + } catch (Exception e) { + // 投递失败不应影响后续消息的投递 + logger.error("【重新投递MQ消息】失败, msgType:{}, penddingMsgId:{}, 错误:{}", penddingMsg.getMsgType(), penddingMsg.getId() , ExceptionUtils.getErrorStackTrace(e)); + } + } + } + + @Data + @NoArgsConstructor + @AllArgsConstructor + static class MessageCacheBean { + private LocalDateTime createTime; + private String messageType; + private String topic; + private Object content; + } } diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/resources/db/migration/V0.3.18__create_sys_msg_pendding.sql b/epmet-module/epmet-message/epmet-message-server/src/main/resources/db/migration/V0.3.18__create_sys_msg_pendding.sql new file mode 100644 index 0000000000..78a45a9865 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/resources/db/migration/V0.3.18__create_sys_msg_pendding.sql @@ -0,0 +1,14 @@ +CREATE TABLE `system_message_pendding` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `MSG_ID` varchar(64) NOT NULL COMMENT '消息主表id', + `MSG_TYPE` varchar(32) NOT NULL COMMENT '消息类型。init_customer:客户初始化,login登录,logout退出', + `SEND_APPROACH` varchar(32) NOT NULL COMMENT '消息发送途径', + `CONTENT` varchar(1024) NOT NULL COMMENT '消息内容', + `REVISION` int(11) DEFAULT 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 '更新时间', + `DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标记 0:未删除,1:已删除', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='系统消息滞留表' \ No newline at end of file diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/resources/mapper/SystemMessagePenddingDao.xml b/epmet-module/epmet-message/epmet-message-server/src/main/resources/mapper/SystemMessagePenddingDao.xml new file mode 100644 index 0000000000..4a5ab00608 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/resources/mapper/SystemMessagePenddingDao.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + delete from system_message_pendding where ID = #{penddingId} + + + + \ No newline at end of file diff --git a/epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/feign/OssFeignClient.java b/epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/feign/OssFeignClient.java index b5c31ef82f..60697791d7 100644 --- a/epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/feign/OssFeignClient.java +++ b/epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/feign/OssFeignClient.java @@ -11,13 +11,13 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.result.UploadImgResultDTO; -import com.epmet.feign.fallback.OssFeignClientFallback; import com.epmet.feign.fallback.OssFeignClientFallbackFactory; import feign.codec.Encoder; import feign.form.spring.SpringFormEncoder; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.context.annotation.Bean; import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestPart; @@ -32,7 +32,7 @@ import org.springframework.web.multipart.MultipartFile; @FeignClient(name = ServiceConstant.EPMET_OSS_SERVER, configuration = OssFeignClient.MultipartSupportConfig.class, fallbackFactory = OssFeignClientFallbackFactory.class) //@FeignClient(name = ServiceConstant.EPMET_OSS_SERVER, configuration = OssFeignClient.MultipartSupportConfig.class, fallbackFactory = -// OssFeignClientFallbackFactory.class) +// OssFeignClientFallbackFactory.class, url = "localhost:8083") public interface OssFeignClient { /** * 文件上传 @@ -55,6 +55,15 @@ public interface OssFeignClient { @PostMapping(value ="oss/file/uploadqrcodeV2", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) Result uploadQrCodeV2(@RequestPart(value = "file") MultipartFile file, @RequestParam("customerId") String customerId); + /** + * desc:通过文件路径获取文件地址 + * @param filePath 文件路径 eg:epmet + * @param privacy 内部 外部 + * @return + */ + @GetMapping(value = "oss/file/getOssFileUrl") + Result getOssFileUrl(@RequestParam String filePath, @RequestParam String privacy); + //@Configuration class MultipartSupportConfig { @@ -64,4 +73,13 @@ public interface OssFeignClient { } } + /** + * @Description ribbon测试 + * @return + * @author wxz + * @date 2021.08.05 16:28 + */ + @PostMapping("/oss/test/test-ribbon-rcv/{sleep}") + Result testRibbonRcv(@RequestParam("sleep") Long sleep); + } diff --git a/epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/feign/fallback/OssFeignClientFallback.java b/epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/feign/fallback/OssFeignClientFallback.java index b60e59cc19..dc43ed7467 100644 --- a/epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/feign/fallback/OssFeignClientFallback.java +++ b/epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/feign/fallback/OssFeignClientFallback.java @@ -13,7 +13,7 @@ import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.result.UploadImgResultDTO; import com.epmet.feign.OssFeignClient; -import org.springframework.stereotype.Component; +import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.multipart.MultipartFile; /** @@ -40,4 +40,14 @@ public class OssFeignClientFallback implements OssFeignClient { return ModuleUtils.feignConError(ServiceConstant.EPMET_OSS_SERVER, "uploadQrCodeV2", file, customerId); } + @Override + public Result testRibbonRcv(@PathVariable Long sleep) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_OSS_SERVER, "testRibbonRcv", sleep); + } + + @Override + public Result getOssFileUrl(String filePath, String privacy) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_OSS_SERVER, "download", filePath,privacy); + } + } diff --git a/epmet-module/epmet-oss/epmet-oss-server/deploy/docker-compose-prod.yml b/epmet-module/epmet-oss/epmet-oss-server/deploy/docker-compose-prod.yml index c58715456a..88849c5796 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/deploy/docker-compose-prod.yml +++ b/epmet-module/epmet-oss/epmet-oss-server/deploy/docker-compose-prod.yml @@ -3,7 +3,7 @@ services: epmet-oss-server: container_name: epmet-oss-server-prod # image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-test/epmet-oss-server:0.3.2 - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-oss-server:0.3.28 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-oss-server:0.3.38 ports: - "8083:8083" network_mode: host # 使用现有网络 diff --git a/epmet-module/epmet-oss/epmet-oss-server/pom.xml b/epmet-module/epmet-oss/epmet-oss-server/pom.xml index e8b08e97cc..5883128ed8 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/pom.xml +++ b/epmet-module/epmet-oss/epmet-oss-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.28 + 0.3.38 com.epmet epmet-oss @@ -260,7 +260,7 @@ false - false + true true diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AbstractCloudStorageService.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AbstractCloudStorageService.java index 74a38551d0..99b79d233a 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AbstractCloudStorageService.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AbstractCloudStorageService.java @@ -25,17 +25,23 @@ import java.util.UUID; public abstract class AbstractCloudStorageService { /** 云存储配置信息 */ CloudStorageConfig config; + /** * desc: 获取oss域名 * * @param privacy * @return java.lang.String - * @author LiuJanJun - * @date 2021/3/30 10:05 上午 + * @author LiuJanJu * @date 2021/3/30 10:05 上午 + */ + public abstract String getOssDomain(String privacy); + /** + * desc: 获取oss前缀 + * + * @param privacy + * @return java.lang.String + * @author LiuJanJu * @date 2021/3/30 10:05 上午 */ - public String getOssDomain(String privacy){ - return null; - }; + public abstract String getOssPrefix(String privacy); /** * 文件路径 * @param prefix 前缀 diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java index c1865d8234..7c8cd5d668 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java @@ -90,6 +90,15 @@ public class AliyunCloudStorageService extends AbstractCloudStorageService { } } + @Override + public String getOssPrefix(String privacy) { + if (PrivacyType.INTERNAL.equalsIgnoreCase(privacy)) { + return config.getAliyun().getInternal().getAliyunPrefix(); + } else { + return config.getAliyun().getExternal().getAliyunPrefix(); + } + } + @Override public String upload(byte[] data, String path, String privacyType) { return upload(new ByteArrayInputStream(data), path, privacyType); diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/FastDFSCloudStorageService.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/FastDFSCloudStorageService.java index 08a591e86d..a2290ec7f1 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/FastDFSCloudStorageService.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/FastDFSCloudStorageService.java @@ -34,6 +34,30 @@ public class FastDFSCloudStorageService extends AbstractCloudStorageService { this.config = config; } + /** + * desc: 获取oss域名 + * + * @param privacy + * @return java.lang.String + * @author LiuJanJu * @date 2021/3/30 10:05 上午 + */ + @Override + public String getOssDomain(String privacy) { + return config.getFastdfsDomain(); + } + + /** + * desc: 获取oss前缀 + * + * @param privacy + * @return java.lang.String + * @author LiuJanJu * @date 2021/3/30 10:05 上午 + */ + @Override + public String getOssPrefix(String privacy) { + return null; + } + @Override public String upload(byte[] data, String path, String privacyType) { return upload(new ByteArrayInputStream(data), path, privacyType); diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/LocalCloudStorageService.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/LocalCloudStorageService.java index 7317bbd780..1659386ab9 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/LocalCloudStorageService.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/LocalCloudStorageService.java @@ -28,6 +28,30 @@ public class LocalCloudStorageService extends AbstractCloudStorageService { this.config = config; } + /** + * desc: 获取oss域名 + * + * @param privacy + * @return java.lang.String + * @author LiuJanJu * @date 2021/3/30 10:05 上午 + */ + @Override + public String getOssDomain(String privacy) { + return config.getLocalDomain(); + } + + /** + * desc: 获取oss前缀 + * + * @param privacy + * @return java.lang.String + * @author LiuJanJu * @date 2021/3/30 10:05 上午 + */ + @Override + public String getOssPrefix(String privacy) { + return config.getLocalPrefix(); + } + @Override public String upload(byte[] data, String path, String privacyType) { return upload(new ByteArrayInputStream(data), path, privacyType); diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/QcloudCloudStorageService.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/QcloudCloudStorageService.java index 5d657ba318..7c289e63ac 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/QcloudCloudStorageService.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/QcloudCloudStorageService.java @@ -47,6 +47,30 @@ public class QcloudCloudStorageService extends AbstractCloudStorageService { clientConfig = new ClientConfig(new Region(config.getQcloudRegion())); } + /** + * desc: 获取oss域名 + * + * @param privacy + * @return java.lang.String + * @author LiuJanJu * @date 2021/3/30 10:05 上午 + */ + @Override + public String getOssDomain(String privacy) { + return config.getQcloudDomain(); + } + + /** + * desc: 获取oss前缀 + * + * @param privacy + * @return java.lang.String + * @author LiuJanJu * @date 2021/3/30 10:05 上午 + */ + @Override + public String getOssPrefix(String privacy) { + return config.getQcloudPrefix(); + } + @Override public String upload(byte[] data, String path, String privacyType) { return upload(new ByteArrayInputStream(data), path, privacyType); diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/QiniuCloudStorageService.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/QiniuCloudStorageService.java index 2fe73cddeb..a4aa05ecda 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/QiniuCloudStorageService.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/QiniuCloudStorageService.java @@ -44,6 +44,30 @@ public class QiniuCloudStorageService extends AbstractCloudStorageService { } + /** + * desc: 获取oss域名 + * + * @param privacy + * @return java.lang.String + * @author LiuJanJu * @date 2021/3/30 10:05 上午 + */ + @Override + public String getOssDomain(String privacy) { + return config.getQiniuDomain(); + } + + /** + * desc: 获取oss前缀 + * + * @param privacy + * @return java.lang.String + * @author LiuJanJu * @date 2021/3/30 10:05 上午 + */ + @Override + public String getOssPrefix(String privacy) { + return config.getQiniuPrefix(); + } + @Override public String upload(byte[] data, String path, String privacyType) { try { diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java index 47be7d427a..ac84d4d820 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java @@ -219,7 +219,9 @@ public class OssController { if (!MediaType.IMAGE_PNG_VALUE.equals(file.getContentType()) && !MediaType.IMAGE_JPEG_VALUE.equals(file.getContentType()) && !ModuleConstant.FILE_CONTENT_TYPE_JPG.equals(file.getContentType()) - && !ModuleConstant.FILE_CONTENT_TYPE_PDF.equals(file.getContentType())) { + && !ModuleConstant.FILE_CONTENT_TYPE_PDF.equals(file.getContentType()) + && !file.getContentType().startsWith(ModuleConstant.FILE_CONTENT_TYPE_VEDIO_PREFIX) + ) { log.error("uploadArticleImg file type:{} is not support 2 upload", file.getContentType()); throw new RenException(EpmetErrorCode.OPER_UPLOAD_FILE_TYPE_ERROR.getCode() , EpmetErrorCode.OPER_UPLOAD_FILE_TYPE_ERROR.getMsg()); @@ -232,6 +234,13 @@ public class OssController { throw new RenException(EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getCode() , EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getMsg()); } + } else if (file.getContentType().startsWith(ModuleConstant.FILE_CONTENT_TYPE_VEDIO_PREFIX)) { + // 校验文件大小,不超过5m + long maxSize = 25 * 1024 * 1024; + if (size > maxSize) { + throw new RenException(EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getCode() + , EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getMsg()); + } } else { // 校验文件大小,不超过2m long maxSize = 2 * 1024 * 1024; @@ -423,4 +432,9 @@ public class OssController { return ossService.uploadImgV2(file, PrivacyType.EXTERNAL, customerId); } + @GetMapping("getOssFileUrl") + public Result download(@RequestParam(required = false) String filePath,@RequestParam(required = false) String privacy){ + return new Result().ok(ossService.getOssFileUrl(filePath,privacy)); + } + } diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/TestController.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/TestController.java new file mode 100644 index 0000000000..ab580e8bf0 --- /dev/null +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/TestController.java @@ -0,0 +1,68 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.service.OssService; +import org.apache.commons.io.FileUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.mock.web.MockMultipartFile; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import java.io.*; +import java.net.Inet4Address; +import java.net.InetAddress; +import java.net.UnknownHostException; + +@RestController +@RequestMapping("test") +public class TestController { + + @Autowired + private OssService ossService; + + @PostMapping("local-upload") + public Result localUpload(@RequestPart("file") MultipartFile file, @RequestParam("fileName") String fileName) { + + final File tempFile = new File("/opt/upload_files/" + fileName); + + try(InputStream inputStream = file.getInputStream()) { + FileUtils.copyInputStreamToFile(inputStream, tempFile); + } catch (IOException e) { + e.printStackTrace(); + } + return new Result(); + } + + @PostMapping("upload2aliyun") + public Result upload2aliyun(@RequestParam("fileName") String fileName) { + try (final FileInputStream fis = new FileInputStream("/opt/upload_files/" + fileName)) { + final MockMultipartFile mockMultipartFile = new MockMultipartFile(fileName, fis); + return ossService.uploadImg(mockMultipartFile, null); + } catch (FileNotFoundException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } + return new Result(); + } + + /** + * @Description ribbon测试 + * @return + * @author wxz + * @date 2021.08.05 16:28 + */ + @PostMapping("test-ribbon-rcv/{sleep}") + public Result testRibbonRcv(@PathVariable("sleep") Long sleep) { + InetAddress localHost = null; + try { + Thread.sleep(sleep); + localHost = Inet4Address.getLocalHost(); + } catch (UnknownHostException e) { + e.printStackTrace(); + } catch (InterruptedException e) { + e.printStackTrace(); + } + return new Result().ok(localHost); + } +} diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/OssService.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/OssService.java index 04c15973fe..ae9625ee66 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/OssService.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/OssService.java @@ -53,4 +53,11 @@ public interface OssService extends BaseService { * @author sun */ Result uploadImgV2(MultipartFile file, String privacy, String customerId); + + /** + * desc:通过文件路径获取下载 全路径 不传文件路径则为服务域名 + * @param filePath + * @return + */ + String getOssFileUrl(String filePath,String privacy); } diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java index 0805fd43c9..fc209d3535 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java @@ -36,6 +36,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.web.multipart.MultipartFile; +import java.io.File; import java.io.IOException; import java.util.Map; @@ -242,5 +243,22 @@ public class OssServiceImpl extends BaseServiceImpl implement return new Result().ok(dto); } + @Override + public String getOssFileUrl(String filePath,String privacy) { + if (StringUtils.isBlank(filePath)){ + filePath = StrConstant.EPMETY_STR; + } + AbstractCloudStorageService storageService = OssFactory.build(); + String ossDomain = storageService.getOssDomain(privacy); + String ossPrefix = storageService.getOssPrefix(privacy); + if (StringUtils.isBlank(ossDomain)){ + throw new RenException("oss配置错误"); + } + if (StringUtils.isBlank(ossPrefix)){ + ossPrefix = StrConstant.EPMETY_STR; + } + return ossDomain.concat(File.separator).concat(ossPrefix).concat(File.separator).concat(filePath); + } + } diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/utils/ModuleConstant.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/utils/ModuleConstant.java index 71d5f177e2..d713004471 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/utils/ModuleConstant.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/utils/ModuleConstant.java @@ -30,6 +30,10 @@ public interface ModuleConstant extends Constant { * pdf文件类型 */ String FILE_CONTENT_TYPE_PDF = "application/pdf"; + /** + * vedio文件类型前缀 不具体什么视频格式了 + */ + String FILE_CONTENT_TYPE_VEDIO_PREFIX = "video/"; /** * 项目附件-允许上传的文件类型 diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/GroupPointFormDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/GroupPointFormDTO.java index ccf55babfa..b62546ef20 100644 --- a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/GroupPointFormDTO.java +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/GroupPointFormDTO.java @@ -18,13 +18,13 @@ public class GroupPointFormDTO implements Serializable { public interface GroupPoint extends CustomerClientShowGroup {} public interface GridRank extends CustomerClientShowGroup {} - public interface PointRank extends CustomerClientShowGroup {} public interface GridScopeRank {} public interface CustomerScopeRank {} public interface MyGroupRank {} + public interface PointRank extends CustomerClientShowGroup {} @NotBlank(message = "小组Id不能为空", groups = {GroupPoint.class, GridRank.class}) private String groupId; - @NotBlank(message = "网格Id不能为空", groups = {GridRank.class, PointRank.class, GridScopeRank.class, MyGroupRank.class}) + @NotBlank(message = "网格Id不能为空", groups = {GridRank.class, GridScopeRank.class, MyGroupRank.class, PointRank.class}) private String gridId; @NotBlank(message = "客户Id不能为空", groups = {CustomerScopeRank.class}) private String customerId; diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/IcResiPointPageFormDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/IcResiPointPageFormDTO.java new file mode 100644 index 0000000000..727bf1f558 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/IcResiPointPageFormDTO.java @@ -0,0 +1,19 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.List; + +@Data +public class IcResiPointPageFormDTO implements Serializable { + public interface AddUserInternalGroup { + } + private List epmetUserIdList; + @NotNull(message = "pageNo不能为空",groups = AddUserInternalGroup.class) + private Integer pageNo; + @NotNull(message = "pageSize不能为空",groups = AddUserInternalGroup.class) + private Integer pageSize; + +} diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/ResiPointPageResDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/ResiPointPageResDTO.java new file mode 100644 index 0000000000..68b73f61ae --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/ResiPointPageResDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +@Data +public class ResiPointPageResDTO implements Serializable { + private String title; + private String id; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date dateTime; + + /** + * +100 -25 + * */ + private String point; +} diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/ResiPointRankListResultDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/ResiPointRankListResultDTO.java index b293ae4478..408c96a5c6 100644 --- a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/ResiPointRankListResultDTO.java +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/ResiPointRankListResultDTO.java @@ -3,7 +3,6 @@ package com.epmet.dto.result; import lombok.Data; import java.io.Serializable; -import java.util.List; /** * @Description 居民端积分总排行、周排行、月排行接口返参DTO @@ -15,6 +14,10 @@ import java.util.List; public class ResiPointRankListResultDTO implements Serializable { private static final long serialVersionUID = 685408245193506541L; + /** + * 用户Id + */ + private String userId; /** * 当前用户昵称 * */ diff --git a/epmet-module/epmet-point/epmet-point-server/deploy/docker-compose-prod.yml b/epmet-module/epmet-point/epmet-point-server/deploy/docker-compose-prod.yml index fb22688a83..7203606525 100644 --- a/epmet-module/epmet-point/epmet-point-server/deploy/docker-compose-prod.yml +++ b/epmet-module/epmet-point/epmet-point-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-point-server: container_name: epmet-point-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-point-server:0.0.42 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-point-server:0.0.60 ports: - "8112:8112" network_mode: host # 使用现有网络 @@ -15,4 +15,4 @@ services: resources: limits: cpus: '0.1' - memory: 600M \ No newline at end of file + memory: 600M diff --git a/epmet-module/epmet-point/epmet-point-server/pom.xml b/epmet-module/epmet-point/epmet-point-server/pom.xml index 40d0d1d9e7..89c84eb878 100644 --- a/epmet-module/epmet-point/epmet-point-server/pom.xml +++ b/epmet-module/epmet-point/epmet-point-server/pom.xml @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - 0.0.42 + 0.0.60 epmet-point com.epmet @@ -284,7 +284,7 @@ false - false + true true diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ResiPointController.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ResiPointController.java index 795f557449..0b19244e0a 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ResiPointController.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ResiPointController.java @@ -1,6 +1,7 @@ package com.epmet.controller; import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; @@ -115,6 +116,18 @@ public class ResiPointController { return new Result>().ok(pointActionLogService.getMyPointRecord(pageUserParam)); } + /** + * 数字赋能平台数据分析-个人档案-分页查询居民的积分记录 + * + * @param formDTO + * @return + */ + @PostMapping("pageuserpoint") + public Result> pageUserPoint(@RequestBody IcResiPointPageFormDTO formDTO ){ + ValidatorUtils.validateEntity(formDTO,IcResiPointPageFormDTO.AddUserInternalGroup.class); + return new Result>().ok(pointActionLogService.pageUserPoint(formDTO)); + } + /** * @Description 查找指定用户的积分兑换记录 * @param dto diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/TestController.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/TestController.java index 59437dcff3..c69673d314 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/TestController.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/TestController.java @@ -6,7 +6,6 @@ import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.Result; import com.epmet.entity.PointVerificationStatisticalDailyEntity; import com.epmet.entity.UserPointStatisticalDailyEntity; -import com.epmet.entity.UserPointTotalEntity; import com.epmet.service.PointVerificationStatisticalDailyService; import com.epmet.service.UserPointStatisticalDailyService; import com.epmet.service.UserPointTotalService; @@ -62,10 +61,5 @@ public class TestController { pointVerificationStatisticalDailyService.testUnixKey(entity); return new Result(); } - @PostMapping("testtotal") - public Result testTotal(@RequestBody UserPointTotalEntity entity){ - userPointTotalService.testInsertOrUpdate(entity); - return new Result(); - } } diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointActionLogDao.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointActionLogDao.java index 1db465d453..ae9cb21307 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointActionLogDao.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointActionLogDao.java @@ -18,8 +18,10 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.form.IcResiPointPageFormDTO; import com.epmet.dto.result.MyPointTaskResultDTO; import com.epmet.dto.result.ResiPointLogPeriodResultDTO; +import com.epmet.dto.result.ResiPointPageResDTO; import com.epmet.entity.UserPointActionLogEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -69,4 +71,6 @@ public interface UserPointActionLogDao extends BaseDao @Param("userId")String userId, @Param("type")String type, @Param("dateId")String dateId); + + List selectPageResiPoin(IcResiPointPageFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointActionLogService.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointActionLogService.java index 314b9b46db..b156816c80 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointActionLogService.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointActionLogService.java @@ -22,9 +22,11 @@ import com.epmet.commons.tools.dto.form.mq.eventmsg.BasePointEventMsg; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.UserPointActionLogDTO; import com.epmet.dto.form.CommonPageUserFormDTO; +import com.epmet.dto.form.IcResiPointPageFormDTO; import com.epmet.dto.form.MyPointTaskFormDTO; import com.epmet.dto.result.MyPointTaskResultDTO; import com.epmet.dto.result.ResiPointLogListResultDTO; +import com.epmet.dto.result.ResiPointPageResDTO; import com.epmet.entity.UserPointActionLogEntity; import dto.form.SendPointFormDTO; @@ -143,4 +145,12 @@ public interface UserPointActionLogService extends BaseService */ List queryMyPointTaskList(MyPointTaskFormDTO formDTO); + + /** + * 数字赋能平台数据分析-个人档案-分页查询居民的积分记录 + * + * @param formDTO + * @return + */ + PageData pageUserPoint(IcResiPointPageFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointTotalService.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointTotalService.java index e0faee76d1..8c9977dce8 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointTotalService.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointTotalService.java @@ -18,17 +18,13 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; -import com.epmet.commons.tools.page.PageData; -import com.epmet.dto.UserPointTotalDTO; import com.epmet.dto.form.CommonUserFormDTO; -import com.epmet.dto.form.ResiCommonUserIdFormDTO; import com.epmet.dto.form.ResiPointRankFormDTO; import com.epmet.dto.result.ResiPointDetailResultDTO; import com.epmet.dto.result.ResiPointRankListResultDTO; import com.epmet.entity.UserPointTotalEntity; import java.util.List; -import java.util.Map; /** * 用户积分总计 @@ -38,66 +34,6 @@ import java.util.Map; */ public interface UserPointTotalService extends BaseService { - /** - * 默认分页 - * - * @param params - * @return PageData - * @author generator - * @date 2020-07-20 - */ - PageData page(Map params); - - /** - * 默认查询 - * - * @param params - * @return java.util.List - * @author generator - * @date 2020-07-20 - */ - List list(Map params); - - /** - * 单条查询 - * - * @param id - * @return UserPointTotalDTO - * @author generator - * @date 2020-07-20 - */ - UserPointTotalDTO get(String id); - - /** - * 默认保存 - * - * @param dto - * @return void - * @author generator - * @date 2020-07-20 - */ - void save(UserPointTotalDTO dto); - - /** - * 默认更新 - * - * @param dto - * @return void - * @author generator - * @date 2020-07-20 - */ - void update(UserPointTotalDTO dto); - - /** - * 批量删除 - * - * @param ids - * @return void - * @author generator - * @date 2020-07-20 - */ - void delete(String[] ids); - /** * @Description 获取指定居民的积分信息 * @param param @@ -125,8 +61,6 @@ public interface UserPointTotalService extends BaseService **/ void insertOrUpdate(UserPointTotalEntity entity); - void testInsertOrUpdate(UserPointTotalEntity entity); - /** * @Description 获取指定居民的积分信息 - 使用客户Id匹配,兼容多客户情况 * @param customerUserParam @@ -135,4 +69,4 @@ public interface UserPointTotalService extends BaseService * @date 2020.07.22 15:58 **/ ResiPointDetailResultDTO getMyPointGroupByCustomer(CommonUserFormDTO customerUserParam); -} \ No newline at end of file +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/BizPointTotalDetailServiceImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/BizPointTotalDetailServiceImpl.java index 87b7b20a32..2fd521d1d9 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/BizPointTotalDetailServiceImpl.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/BizPointTotalDetailServiceImpl.java @@ -380,7 +380,7 @@ public class BizPointTotalDetailServiceImpl extends BaseServiceImpl> result = resiGroupOpenFeignClient.listGroupDetailsExcludeGroupIds(form); - List groups = getResultDataOrThrowsException(result, ServiceConstant.RESI_GROUP_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【小组排名】查询积分为0的小组列表失败"); + List groups = getResultDataOrThrowsException(result, ServiceConstant.RESI_GROUP_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【小组排名】查询积分为0的小组列表失败", null); if (CollectionUtils.isEmpty(groups)) { return new ArrayList<>(); } @@ -412,7 +412,7 @@ public class BizPointTotalDetailServiceImpl extends BaseServiceImpl> listResult = resiGroupOpenFeignClient.listGroupDetailsByGroupIds(groupIds); - List groupInfos = getResultDataOrThrowsException(listResult, ServiceConstant.RESI_GROUP_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【小组排行】批量查询小组信息出错"); + List groupInfos = getResultDataOrThrowsException(listResult, ServiceConstant.RESI_GROUP_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【小组排行】批量查询小组信息出错", null); // 将小组基本信息转化为map HashMap groupMap = new HashMap<>(); @@ -454,7 +454,7 @@ public class BizPointTotalDetailServiceImpl extends BaseServiceImpl result = govOrgOpenFeignClient.getGridBaseInfoByGridId(form); - return getResultDataOrThrowsException(result, ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【小组排名】查询网格信息失败"); + return getResultDataOrThrowsException(result, ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【小组排名】查询网格信息失败", null); } @Override @@ -464,7 +464,7 @@ public class BizPointTotalDetailServiceImpl extends BaseServiceImpl groupList = getResultDataOrThrowsException(resiGroupOpenFeignClient.listGroupsByMember(form), - ServiceConstant.RESI_GROUP_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【我所在的小组排名】查询组列表失败"); + ServiceConstant.RESI_GROUP_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【我所在的小组排名】查询组列表失败", null); if (CollectionUtils.isEmpty(groupList)) { return new ArrayList(); diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/BizPointUserTotalDetailServiceImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/BizPointUserTotalDetailServiceImpl.java index d2a37797fa..9c0942d574 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/BizPointUserTotalDetailServiceImpl.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/BizPointUserTotalDetailServiceImpl.java @@ -23,7 +23,6 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; 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.enums.BizTypeEnum; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; @@ -160,10 +159,6 @@ public class BizPointUserTotalDetailServiceImpl extends BaseServiceImpl pageUserPoint(IcResiPointPageFormDTO formDTO) { + if(org.apache.commons.collections4.CollectionUtils.isEmpty(formDTO.getEpmetUserIdList())){ + return new PageData(new ArrayList<>(),NumConstant.ZERO); + } + PageInfo pageInfo = PageHelper.startPage(formDTO.getPageNo(), + formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.selectPageResiPoin(formDTO)); + return new PageData<>(pageInfo.getList(), pageInfo.getTotal()); + } } \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointStatisticalDailyServiceImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointStatisticalDailyServiceImpl.java index e7b476d99d..16400b1eaa 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointStatisticalDailyServiceImpl.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointStatisticalDailyServiceImpl.java @@ -55,6 +55,7 @@ import org.springframework.transaction.annotation.Transactional; import java.util.*; import java.util.concurrent.atomic.AtomicInteger; +import java.util.function.Function; import java.util.stream.Collectors; /** @@ -148,7 +149,7 @@ public class UserPointStatisticalDailyServiceImpl extends BaseServiceImpl userIds = rankList.stream().map(ResiPointRankResultDTO::getUserId).collect(Collectors.toList()); //查询用户昵称 - Result> userInfo = - epmetUserOpenFeignClient.queryUserBaseInfo(userIds); - boolean userRequestCallback = userInfo.success() && null != userInfo.getData() && !userInfo.getData().isEmpty(); - - for (int i = NumConstant.ZERO; i < rankList.size(); i++) { - ResiPointRankListResultDTO resultObj = ConvertUtils.sourceToTarget(o,ResiPointRankListResultDTO.class); + Result> userInfo = epmetUserOpenFeignClient.queryUserBaseInfo(userIds); + Map userInfoMap = new HashMap<>(); + if (userInfo.success() && CollectionUtils.isNotEmpty(userInfo.getData())){ + userInfoMap = userInfo.getData().stream().collect(Collectors.toMap(UserBaseInfoResultDTO::getUserId, Function.identity(),(o1,o2)->o1)); + } + for (ResiPointRankResultDTO resiPointRankResultDTO : rankList) { + ResiPointRankListResultDTO resultObj = ConvertUtils.sourceToTarget(o, ResiPointRankListResultDTO.class); ResiPointRankingResultDTO target = new ResiPointRankingResultDTO(); - target.setRanking(rankList.get(i).getRank()); - target.setPoint(rankList.get(i).getTotalPoint()); - if(userRequestCallback) { - target.setNickname(null == userInfo.getData().get(i) ? "" : userInfo.getData().get(i).getNickname()); - target.setHeadImgUrl(null == userInfo.getData().get(i) ? "" : userInfo.getData().get(i).getHeadImgUrl()); + target.setRanking(resiPointRankResultDTO.getRank()); + target.setPoint(resiPointRankResultDTO.getTotalPoint()); + target.setNickname(StrConstant.EPMETY_STR); + target.setHeadImgUrl(StrConstant.EPMETY_STR); + UserBaseInfoResultDTO infoResultDTO = userInfoMap.get(resiPointRankResultDTO.getUserId()); + if (infoResultDTO != null) { + target.setNickname(infoResultDTO.getNickname()); + target.setHeadImgUrl(infoResultDTO.getHeadImgUrl()); } resultObj.setRankList(target); result.add(resultObj); diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointTotalServiceImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointTotalServiceImpl.java index 07243fd0ab..7ba7c79b4e 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointTotalServiceImpl.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointTotalServiceImpl.java @@ -17,34 +17,27 @@ package com.epmet.service.impl; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.NumConstant; -import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.dao.UserPointTotalDao; -import com.epmet.dto.UserPointTotalDTO; import com.epmet.dto.form.CommonUserFormDTO; -import com.epmet.dto.form.ResiCommonUserIdFormDTO; import com.epmet.dto.form.ResiPointRankFormDTO; import com.epmet.dto.result.*; import com.epmet.entity.UserPointTotalEntity; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.service.UserPointTotalService; -import com.epmet.utils.DimIdGenerator; -import com.epmet.utils.ModuleConstant; import com.github.pagehelper.PageHelper; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; -import org.apache.ibatis.annotations.Param; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; import java.util.*; +import java.util.function.Function; import java.util.stream.Collectors; /** @@ -57,62 +50,9 @@ import java.util.stream.Collectors; @Slf4j public class UserPointTotalServiceImpl extends BaseServiceImpl implements UserPointTotalService { - @Autowired EpmetUserOpenFeignClient epmetUserOpenFeignClient; - @Override - public PageData page(Map params) { - IPage page = baseDao.selectPage( - getPage(params, FieldConstant.CREATED_TIME, false), - getWrapper(params) - ); - return getPageData(page, UserPointTotalDTO.class); - } - - @Override - public List list(Map params) { - List entityList = baseDao.selectList(getWrapper(params)); - - return ConvertUtils.sourceToTarget(entityList, UserPointTotalDTO.class); - } - - private QueryWrapper getWrapper(Map params){ - String id = (String)params.get(FieldConstant.ID_HUMP); - - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); - - return wrapper; - } - - @Override - public UserPointTotalDTO get(String id) { - UserPointTotalEntity entity = baseDao.selectById(id); - return ConvertUtils.sourceToTarget(entity, UserPointTotalDTO.class); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void save(UserPointTotalDTO dto) { - UserPointTotalEntity entity = ConvertUtils.sourceToTarget(dto, UserPointTotalEntity.class); - insert(entity); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void update(UserPointTotalDTO dto) { - UserPointTotalEntity entity = ConvertUtils.sourceToTarget(dto, UserPointTotalEntity.class); - updateById(entity); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void delete(String[] ids) { - // 逻辑删除(@TableLogic 注解) - baseDao.deleteBatchIds(Arrays.asList(ids)); - } - /** * @Description 获取指定居民的积分信息 * @param param @@ -145,8 +85,7 @@ public class UserPointTotalServiceImpl extends BaseServiceImpl userIdParam = new LinkedList<>(); userIdParam.add(pointRankFormDTO.getUserId()); - Result> myResiInfoResult = - epmetUserOpenFeignClient.queryUserBaseInfo(userIdParam); + Result> myResiInfoResult = epmetUserOpenFeignClient.queryUserBaseInfo(userIdParam); if(myResiInfoResult.success() && null != myResiInfoResult.getData() && !myResiInfoResult.getData().isEmpty()){ if(StringUtils.isBlank(pointRankFormDTO.getCustomerId())) { //缓存中的customerId是不准确的,前端一定会传customerId,所以不会执行此代码 @@ -204,19 +143,23 @@ public class UserPointTotalServiceImpl extends BaseServiceImpl userIds = rankList.stream().map(ResiPointRankResultDTO::getUserId).collect(Collectors.toList()); //查询用户昵称 - Result> userInfo = - epmetUserOpenFeignClient.queryUserBaseInfo(userIds); - boolean userRequestCallback = userInfo.success() && null != userInfo.getData() && !userInfo.getData().isEmpty(); - - for (int i = NumConstant.ZERO; i < rankList.size(); i++) { - ResiPointRankListResultDTO resultObj = ConvertUtils.sourceToTarget(o,ResiPointRankListResultDTO.class); + Result> userInfo = epmetUserOpenFeignClient.queryUserBaseInfo(userIds); + Map userInfoMap = new HashMap<>(); + if (userInfo.success() && CollectionUtils.isNotEmpty(userInfo.getData())){ + userInfoMap = userInfo.getData().stream().collect(Collectors.toMap(UserBaseInfoResultDTO::getUserId, Function.identity(),(o1, o2)->o1)); + } + for (ResiPointRankResultDTO resiPointRankResultDTO : rankList) { + ResiPointRankListResultDTO resultObj = ConvertUtils.sourceToTarget(o, ResiPointRankListResultDTO.class); ResiPointRankingResultDTO target = new ResiPointRankingResultDTO(); - target.setRanking(rankList.get(i).getRank()); - target.setPoint(rankList.get(i).getTotalPoint()); - if(userRequestCallback) { - target.setNickname(null == userInfo.getData().get(i) ? "" : userInfo.getData().get(i).getNickname()); - target.setHeadImgUrl(null == userInfo.getData().get(i) ? "" : userInfo.getData().get(i).getHeadImgUrl()); + target.setRanking(resiPointRankResultDTO.getRank()); + target.setPoint(resiPointRankResultDTO.getTotalPoint()); + target.setNickname(StrConstant.EPMETY_STR); + target.setHeadImgUrl(StrConstant.EPMETY_STR); + UserBaseInfoResultDTO infoResultDTO = userInfoMap.get(resiPointRankResultDTO.getUserId()); + if (infoResultDTO != null) { + target.setNickname(infoResultDTO.getNickname()); + target.setHeadImgUrl(infoResultDTO.getHeadImgUrl()); } resultObj.setRankList(target); result.add(resultObj); @@ -234,21 +177,6 @@ public class UserPointTotalServiceImpl extends BaseServiceImpl + + SELECT + i.ID AS issueId, + i.ISSUE_TITLE AS issueTitle, + i.SUGGESTION AS suggestion, + i.CREATED_BY AS createdBy, + (CASE WHEN i.ISSUE_STATUS = 'shift_project' THEN '已转项目' + WHEN i.ISSUE_STATUS = 'voting' THEN '表决中' + WHEN i.ISSUE_STATUS = 'closed' THEN '已关闭' + ELSE '表决中' END ) AS `status`, + i.CREATED_TIME AS createdTime, + s.SUPPORT_COUNT AS supportCount, + s.OPPOSITION_COUNT AS oppositionCount, + CONCAT(s.SUPPORT_COUNT + s.OPPOSITION_COUNT,'/',s.VOTABLE_COUNT) AS voteAccount, + cd.CATEGORY_NAME as cn + FROM issue i + LEFT JOIN issue_vote_statistical s ON (s.ISSUE_ID = i.ID AND s.DEL_FLAG = '0') + LEFT JOIN issue_category ic ON (ic.ISSUE_ID = i.ID AND ic.DEL_FLAG = '0' AND ic.CUSTOMER_ID = i.CUSTOMER_ID) + LEFT JOIN issue_project_category_dict cd ON (cd.CATEGORY_CODE = LEFT(ic.CATEGORY_CODE,#{length}) AND cd.DEL_FLAG = '0' AND cd.CUSTOMER_ID = ic.CUSTOMER_ID) + WHERE i.DEL_FLAG = '0' + + AND i.ISSUE_STATUS = #{status} + + + AND i.GRID_ID = #{orgId} + + + AND i.ORG_ID_PATH LIKE CONCAT('%',#{orgId},'%') + + ORDER BY (s.SUPPORT_COUNT + s.OPPOSITION_COUNT) DESC,i.created_time DESC LIMIT 50 + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml index dca01a63f5..06c1fc0000 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml @@ -245,6 +245,21 @@ + + + UPDATE issue_project_category_dict SET diff --git a/epmet-module/gov-mine/gov-mine-server/deploy/docker-compose-prod.yml b/epmet-module/gov-mine/gov-mine-server/deploy/docker-compose-prod.yml index 2bb561026b..9e3c87d67b 100644 --- a/epmet-module/gov-mine/gov-mine-server/deploy/docker-compose-prod.yml +++ b/epmet-module/gov-mine/gov-mine-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-mine-server: container_name: gov-mine-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/gov-mine-server:0.3.36 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/gov-mine-server:0.3.47 ports: - "8098:8098" network_mode: host # 使用现有网络 @@ -15,4 +15,4 @@ services: resources: limits: cpus: '0.1' - memory: 600M \ No newline at end of file + memory: 600M diff --git a/epmet-module/gov-mine/gov-mine-server/pom.xml b/epmet-module/gov-mine/gov-mine-server/pom.xml index b8206f3b95..c643659b07 100644 --- a/epmet-module/gov-mine/gov-mine-server/pom.xml +++ b/epmet-module/gov-mine/gov-mine-server/pom.xml @@ -2,7 +2,7 @@ - 0.3.36 + 0.3.47 com.epmet gov-mine @@ -233,7 +233,7 @@ false - false + true diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/constant/NeighborhoodConstant.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/constant/NeighborhoodConstant.java new file mode 100644 index 0000000000..49a21f262e --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/constant/NeighborhoodConstant.java @@ -0,0 +1,15 @@ +package com.epmet.constant; + +/** + * @Author zxc + * @DateTime 2020/11/10 5:18 下午 + */ +public interface NeighborhoodConstant { + + String GRID = "grid"; + + String NEIGHBOR_HOOD= "neighbourHood"; + String BUILDING = "building"; + String HOUSE = "house"; + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/constant/OrgInfoConstant.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/constant/OrgInfoConstant.java index c20cb98c6d..d8c8567800 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/constant/OrgInfoConstant.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/constant/OrgInfoConstant.java @@ -12,4 +12,8 @@ public interface OrgInfoConstant { String DEPT = "dept"; + String NEIGHBOR_HOOD = "neighborHood"; + + String COMMUNITY = "community"; + } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/BuildingTreeLevelDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/BuildingTreeLevelDTO.java new file mode 100644 index 0000000000..4ffa533faf --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/BuildingTreeLevelDTO.java @@ -0,0 +1,55 @@ +/** + * 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.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + + +/** + * 楼栋信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +@Data +public class BuildingTreeLevelDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + + private String id; + + private String pId; + + private String label; + + + private String level; + + private List children; + + private String longitude; + private String latitude; + + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerAgencyDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerAgencyDTO.java index 12f5488ac4..e7072c3cdb 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerAgencyDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerAgencyDTO.java @@ -142,4 +142,19 @@ public class CustomerAgencyDTO implements Serializable { * 社区 */ private String community; + + /** + * 坐标 + */ + private String coordinates; + + /** + * 中心位置经度 + */ + private String longitude; + + /** + * 中心位置纬度 + */ + private String latitude; } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcBuildingDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcBuildingDTO.java new file mode 100644 index 0000000000..4d9aa11d17 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcBuildingDTO.java @@ -0,0 +1,133 @@ +/** + * 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.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 楼栋信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +@Data +public class IcBuildingDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 楼栋主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 小区id + */ + private String neighborHoodId; + + /** + * 片区id,neighbor_hood_part.id,可为空。 + */ + private String partId; + + /** + * 楼栋名称 + */ + private String buildingName; + + + /** + * 楼栋类型,这里存储字典编码就可以 + */ + private String type; + + /** + * 排序 + */ + private Integer sort; + + /** + * 总单元数 + */ + private Integer totalUnitNum; + + /** + * 总楼层总数 + */ + private Integer totalFloorNum; + + /** + * 总户数 + */ + private Integer totalHouseNum; + + /** + * 中心点位:经度 + */ + private String longitude; + + /** + * 中心点位:纬度 + */ + private String latitude; + + /** + * 坐标位置 + */ + private String coordinatePosition; + + /** + * 删除标识 0未删除、1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcBuildingUnitDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcBuildingUnitDTO.java new file mode 100644 index 0000000000..3ec964009d --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcBuildingUnitDTO.java @@ -0,0 +1,91 @@ +/** + * 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.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 楼栋单元信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +@Data +public class IcBuildingUnitDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 单元主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 楼宇id + */ + private String buildingId; + + /** + * 单元号:1,2,3?? + */ + private String unitNum; + + /** + * 单元名 + */ + private String unitName; + + /** + * 删除标识 0未删除、1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcHouseDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcHouseDTO.java new file mode 100644 index 0000000000..2bec463b9b --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcHouseDTO.java @@ -0,0 +1,136 @@ +/** + * 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.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 房屋信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +@Data +public class IcHouseDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 房屋主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 小区id + */ + private String neighborHoodId; + + /** + * 片区id,neighbor_hood_part.id,可为空。 + */ + private String partId; + + /** + * 所属楼栋id + */ + private String buildingId; + + /** + * 所属单元id + */ + private String buildingUnitId; + + /** + * 房屋名字后台插入时生成 + */ + private String houseName; + + /** + * 门牌号 + */ + private String doorName; + + /** + * 房屋类型,这里存储字典value就可以 + */ + private String houseType; + + /** + * 存储字典value + */ + private String purpose; + + /** + * 1出租;0未出租 + */ + private Integer rentFlag; + + /** + * 房主姓名 + */ + private String ownerName; + + /** + * 房主电话 + */ + private String ownerPhone; + + /** + * 房主身份证号 + */ + private String ownerIdCard; + + /** + * 删除标识 0未删除、1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcMatterAppointmentRecordDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcMatterAppointmentRecordDTO.java new file mode 100644 index 0000000000..27ee8af29b --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcMatterAppointmentRecordDTO.java @@ -0,0 +1,131 @@ +/** + * 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.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 事项预约记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Data +public class IcMatterAppointmentRecordDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * + */ + private String id; + + /** + * + */ + private String customerId; + + /** + * 组织ID + */ + private String orgId; + + /** + * 组织类型,agency:组织,grid:网格 + */ + private String orgType; + + /** + * + */ + private String pid; + + /** + * + */ + private String pids; + + /** + * 事项ID + */ + private String matterId; + + /** + * 预约日期 + */ + private String appointmentDate; + + /** + * 预约人 + */ + private String appointmentName; + + /** + * 预约电话 + */ + private String appointmentPhone; + + /** + * 备注 + */ + private String remark; + + /** + * 预约状态【cancel:取消,appointing:预约中】 + */ + private String status; + + /** + * + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private String revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 1,2,5 + */ + private String timeId; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcNeighborHoodDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcNeighborHoodDTO.java new file mode 100644 index 0000000000..004c2312b4 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcNeighborHoodDTO.java @@ -0,0 +1,131 @@ +/** + * 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.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 小区表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +@Data +public class IcNeighborHoodDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 小区主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 小区名称 + */ + private String neighborHoodName; + + /** + * 组织id + */ + private String agencyId; + + /** + * 上级组织id + */ + private String parentAgencyId; + + /** + * 组织的所有上级组织id + */ + private String agencyPids; + + /** + * 网格id + */ + private String gridId; + + /** + * 详细地址 + */ + private String address; + + /** + * 备注 + */ + private String remark; + + /** + * 中心点位:经度 + */ + private String longitude; + + /** + * 中心点位:纬度 + */ + private String latitude; + + /** + * 坐标区域 + */ + private String coordinates; + + /** + * 坐标位置 + */ + private String location; + + /** + * 删除标识 0未删除、1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcNeighborHoodPartDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcNeighborHoodPartDTO.java new file mode 100644 index 0000000000..6d5ca4a3bc --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcNeighborHoodPartDTO.java @@ -0,0 +1,86 @@ +/** + * 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.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 小区-分区表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +@Data +public class IcNeighborHoodPartDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键,片区id + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 小区id + */ + private String neighborHoodId; + + /** + * 名称,比如北区,南区 + */ + private String name; + + /** + * 删除标识 0未删除、1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcNeighborHoodPropertyDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcNeighborHoodPropertyDTO.java new file mode 100644 index 0000000000..e889a21468 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcNeighborHoodPropertyDTO.java @@ -0,0 +1,81 @@ +/** + * 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.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 小区物业关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +@Data +public class IcNeighborHoodPropertyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 小区物业关系表 + */ + private String id; + + /** + * 物业id + */ + private String propertyId; + + /** + * 小区id + */ + private String neighborHoodId; + + /** + * 删除标识 0未删除、1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPartyServiceCenterDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPartyServiceCenterDTO.java new file mode 100644 index 0000000000..50430c31b5 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPartyServiceCenterDTO.java @@ -0,0 +1,141 @@ +/** + * 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.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 党群服务中心 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Data +public class IcPartyServiceCenterDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 组织ID + */ + private String orgId; + + /** + * 组织类型,agency:组织,grid:网格 + */ + private String orgType; + + /** + * + */ + private String pid; + + /** + * + */ + private String pids; + + /** + * 中心名称 + */ + private String centerName; + + /** + * 办公电话 + */ + private String workPhone; + + /** + * 上午开始办公时间 + */ + private String amStartTime; + + /** + * 上午结束办公时间 + */ + private String amEndTime; + + /** + * 下午开始办公时间 + */ + private String pmStartTime; + + /** + * 下午结束办公时间 + */ + private String pmEndTime; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + + /** + * 地址 + */ + private String address; + + /** + * + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private String revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPartyServiceCenterMatterDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPartyServiceCenterMatterDTO.java new file mode 100644 index 0000000000..42b028df98 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPartyServiceCenterMatterDTO.java @@ -0,0 +1,101 @@ +/** + * 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.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 党群服务中心可预约事项表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Data +public class IcPartyServiceCenterMatterDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * + */ + private String id; + + /** + * 党群服务中心ID + */ + private String partyServiceCenterId; + + /** + * 事项名字 + */ + private String matterName; + + /** + * 预约类型,每天:everyDay,工作日:workDay,周末:weekend + */ + private String appointmentType; + + /** + * 可预约开始时间 + */ + private String startTime; + + /** + * 可预约结束时间 + */ + private String endTime; + + /** + * + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private String revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 客户ID + */ + private String customerId; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPlaceOrgDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPlaceOrgDTO.java new file mode 100644 index 0000000000..f836ce406f --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPlaceOrgDTO.java @@ -0,0 +1,131 @@ +/** + * 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.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 九小场所下组织管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Data +public class IcPlaceOrgDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 组织Id + */ + private String agencyId; + + /** + * agency_id的所有上级 + */ + private String pids; + + /** + * 网格Id【场所区域】 + */ + private String gridId; + + /** + * 场所类型【admin库sys_dict_data表九小场所value值】 + */ + private String ninePlaceVal; + + /** + * 场所名称 + */ + private String placeOrgName; + + /** + * 场所地址 + */ + private String address; + + /** + * 字典value,场所规模【 +0:10人以下 +1:10-20人 +2:21-40人 +3:41-100人 +4:100人以上】 + */ + private String scale; + + /** + * 场所负责人 + */ + private String personInCharge; + + /** + * 负责人电话 + */ + private String mobile; + + /** + * 备注 + */ + private String remarks; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPlacePatrolRecordDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPlacePatrolRecordDTO.java new file mode 100644 index 0000000000..519ec4f1a4 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPlacePatrolRecordDTO.java @@ -0,0 +1,146 @@ +/** + * 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.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 场所巡查记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Data +public class IcPlacePatrolRecordDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 组织Id + */ + private String agencyId; + + /** + * agency_id的所有上级 + */ + private String pids; + + /** + * 网格Id【场所区域】 + */ + private String gridId; + + /** + * 场所类型【admin库sys_dict_data表九小场所value值】 + */ + private String ninePlaceVal; + + /** + * 场所下的组织Id + */ + private String placeOrgId; + + /** + * 场所下分队(place_patrolteam)表Id + */ + private String placePatrolTeamId; + + /** + * 分队下检查人员Id,分号分隔 + */ + private String inspectors; + + /** + * 首次巡查时间 + */ + private Date firstTime; + + /** + * 隐患明细 + */ + private String detailed; + + /** + * 首次检查结果【0:合格 1:不合格】 + */ + private String firstResult; + + /** + * 拟复查时间 + */ + private Date reviewTime; + + /** + * 最终检查结果【0:合格 1:不合格】初始数据默认和首次检查结果相同 + */ + private String finalResult; + + /** + * 最新复查时间【初始数据默认和首次巡查时间相同】 + */ + private Date finalTime; + + /** + * 备注 + */ + private String remarks; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPlacePatrolReviewRecordDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPlacePatrolReviewRecordDTO.java new file mode 100644 index 0000000000..d93e3928c7 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPlacePatrolReviewRecordDTO.java @@ -0,0 +1,111 @@ +/** + * 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.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 场所巡查复查记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Data +public class IcPlacePatrolReviewRecordDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 巡查记录主(place_patrol_record)表Id + */ + private String placePatrolRecordId; + + /** + * 场所下分队(place_patrol_team)表Id + */ + private String placePatrolTeamId; + + /** + * 检查人员Id,逗号分隔 + */ + private String inspectors; + + /** + * 复查时间 + */ + private Date reviewTime; + + /** + * 复查隐患明细 + */ + private String detailed; + + /** + * 复查检查结果【0:合格 1:不合格】 + */ + private String reviewResult; + + /** + * 备注 + */ + private String remarks; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPlacePatrolTeamDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPlacePatrolTeamDTO.java new file mode 100644 index 0000000000..7e4531f0a4 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPlacePatrolTeamDTO.java @@ -0,0 +1,126 @@ +/** + * 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.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 场所分队管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Data +public class IcPlacePatrolTeamDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 组织Id + */ + private String agencyId; + + /** + * agency_id的所有上级 + */ + private String pids; + + /** + * 负责区域【网格Id 多个值逗号分隔】 + */ + private String gridIds; + + /** + * 负责场所类型【admin库sys_dict_data表九小场所value值 多个值逗号分隔】 + */ + private String ninePlaceVals; + + /** + * 分队名称 + */ + private String teamName; + + /** + * 巡查计划 + */ + private String plan; + + /** + * 创建(建队)时间 + */ + private Date time; + + /** + * 场所负责人 + */ + private String personInCharge; + + /** + * 负责人电话 + */ + private String mobile; + + /** + * 备注 + */ + private String remarks; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPlacePatrolTeamStaffDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPlacePatrolTeamStaffDTO.java new file mode 100644 index 0000000000..36eb03ac3a --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPlacePatrolTeamStaffDTO.java @@ -0,0 +1,96 @@ +/** + * 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.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 场所分队下人员管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Data +public class IcPlacePatrolTeamStaffDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 巡查分队(place_patrol_team)表Id + */ + private String placePatrolTeamId; + + /** + * 成员姓名 + */ + private String name; + + /** + * 成员电话 + */ + private String mobile; + + /** + * 备注 + */ + private String remarks; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPropertyManagementDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPropertyManagementDTO.java new file mode 100644 index 0000000000..732ff0d5ce --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPropertyManagementDTO.java @@ -0,0 +1,76 @@ +/** + * 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.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 物业表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +@Data +public class IcPropertyManagementDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 物业id + */ + private String id; + + /** + * 物业名称 + */ + private String name; + + /** + * 删除标识 0未删除、1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/MatterListDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/MatterListDTO.java new file mode 100644 index 0000000000..95c545f656 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/MatterListDTO.java @@ -0,0 +1,47 @@ +package com.epmet.dto; + +import com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/11/22 2:41 下午 + * @DESC + */ +@Data +public class MatterListDTO implements Serializable { + + private static final long serialVersionUID = 493404409015559029L; + + private Integer sort; + + /** + * 事项名 + */ + private String matterName; + + /** + * 事项ID + */ + private String matterId; + + /** + * 可预约时间 + */ + private String allowTime; + + private String startTime; + + private String endTime; + + private String appointmentType; + + public MatterListDTO() { + this.sort = NumConstant.ZERO; + this.matterName = ""; + this.matterId = ""; + this.allowTime = ""; + } +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/TimeDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/TimeDTO.java new file mode 100644 index 0000000000..00b01c30fe --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/TimeDTO.java @@ -0,0 +1,22 @@ +package com.epmet.dto; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/11/22 3:56 下午 + * @DESC + */ +@Data +public class TimeDTO implements Serializable { + + private static final long serialVersionUID = -3290964095027429971L; + + private String timeId; + + private Boolean isAppointment = true; + + private String time; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddPartyServiceCenterFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddPartyServiceCenterFormDTO.java new file mode 100644 index 0000000000..2c122705c7 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddPartyServiceCenterFormDTO.java @@ -0,0 +1,80 @@ +package com.epmet.dto.form; + +import com.epmet.dto.IcPartyServiceCenterMatterDTO; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2021/11/22 9:05 上午 + * @DESC + */ +@Data +public class AddPartyServiceCenterFormDTO implements Serializable { + + private static final long serialVersionUID = -230856877756036529L; + + public interface AddPartyServiceCenterForm{} + + /** + * 中心名称 + */ + @NotBlank(message = "centerName不能为空",groups = AddPartyServiceCenterForm.class) + private String centerName; + + /** + * 社区地址 + */ + @NotBlank(message = "address不能为空",groups = AddPartyServiceCenterForm.class) + private String address; + + /** + * 办公电话 + */ + @NotBlank(message = "workPhone不能为空",groups = AddPartyServiceCenterForm.class) + private String workPhone; + + /** + * 上午开始时间 + */ + @NotBlank(message = "amStartTime不能为空",groups = AddPartyServiceCenterForm.class) + private String amStartTime; + + /** + * 上午结束时间 + */ + @NotBlank(message = "amEndTime不能为空",groups = AddPartyServiceCenterForm.class) + private String amEndTime; + + /** + * 下午开始时间 + */ + @NotBlank(message = "pmStartTime不能为空",groups = AddPartyServiceCenterForm.class) + private String pmStartTime; + + /** + * 下午结束时间 + */ + @NotBlank(message = "pmEndTime不能为空",groups = AddPartyServiceCenterForm.class) + private String pmEndTime; + + /** + * 经度 + */ + @NotBlank(message = "longitude不能为空",groups = AddPartyServiceCenterForm.class) + private String longitude; + + /** + * 纬度 + */ + @NotBlank(message = "latitude不能为空",groups = AddPartyServiceCenterForm.class) + private String latitude; + + /** + * 可预约事项 + */ + private List matterList; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddPlaceOrgFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddPlaceOrgFormDTO.java new file mode 100644 index 0000000000..a3d56416c0 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddPlaceOrgFormDTO.java @@ -0,0 +1,95 @@ +/** + * 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.dto.form; + +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + + +/** + * @Author sun + * @Description 新增九小场所下组织 + **/ +@Data +public class AddPlaceOrgFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + /** + * 客户Id + */ + private String customerId; + /** + * 组织Id + */ + private String agencyId; + /** + * agency_id的所有上级 + */ + private String pids; + /** + * 网格Id【场所区域】 + */ + @NotBlank(message = "场所区域不能为空", groups = {Add.class}) + private String gridId; + /** + * 场所类型【admin库sys_dict_data表九小场所value值】 + */ + @NotBlank(message = "场所类型不能为空", groups = {Add.class}) + private String ninePlaceVal; + /** + * 场所名称 + */ + @NotBlank(message = "场所名称不能为空", groups = {Add.class}) + @Length(max = 20, message = "场所名称不能超过20个字符", groups = {Add.class}) + private String placeOrgName; + /** + * 场所地址 + */ + @NotBlank(message = "场所地址不能为空", groups = {Add.class}) + @Length(max = 100, message = "场所地址不能超过100个字符", groups = {Add.class}) + private String address; + /** + * 字典value,场所规模【0:10人以下 1:10-20人 2:21-40人 3:41-100人 4:100人以上】 + */ + @NotBlank(message = "场所规模不能为空", groups = {Add.class}) + private String scale; + /** + * 场所负责人 + */ + @NotBlank(message = "负责人名称不能为空", groups = {Add.class}) + @Length(max = 20, message = "负责人名称不能超过20个字符", groups = {Add.class}) + private String personInCharge; + /** + * 负责人电话 + */ + @NotBlank(message = "负责人电话不能为空", groups = {Add.class}) + @Length(max = 11, message = "负责人电话不能超过11个字符", groups = {Add.class}) + private String mobile; + /** + * 备注 + */ + private String remarks; + //token中userId + private String staffId; + + public interface Add { } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddPlacePatrolRecordFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddPlacePatrolRecordFormDTO.java new file mode 100644 index 0000000000..cb8b6b2724 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddPlacePatrolRecordFormDTO.java @@ -0,0 +1,127 @@ +/** + * 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.dto.form; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.Date; + + +/** + * @Author sun + * @Description 新增场所巡查记录 + **/ +@Data +public class AddPlacePatrolRecordFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 组织Id + */ + private String agencyId; + + /** + * agency_id的所有上级 + */ + private String pids; + + /** + * 网格Id【场所区域】 + */ + @NotBlank(message = "场所区域不能为空", groups = {Add.class}) + private String gridId; + /** + * 场所类型【admin库sys_dict_data表九小场所value值】 + */ + @NotBlank(message = "场所类型不能为空", groups = {Add.class}) + private String ninePlaceVal; + + /** + * 场所下的组织Id + */ + @NotBlank(message = "场所名称不能为空", groups = {Add.class}) + private String placeOrgId; + + /** + * 场所下分队(place_patrolteam)表Id + */ + @NotBlank(message = "分队名称不能为空", groups = {Add.class}) + private String placePatrolTeamId; + + /** + * 分队下检查人员Id,分号分隔 + */ + @NotBlank(message = "检察人员不能为空", groups = {Add.class}) + private String inspectors; + + /** + * 首次巡查时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date firstTime; + + /** + * 隐患明细 + */ + @NotBlank(message = "隐患明细不能为空", groups = {Add.class}) + //@Length(max = 200, message = "隐患明细不能超过200个字符", groups = {Add.class}) + private String detailed; + + /** + * 首次检查结果【0:合格 1:不合格】 + */ + @NotBlank(message = "首次检查结果不能为空", groups = {Add.class}) + private String firstResult; + + /** + * 拟复查时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date reviewTime; + + /** + * 最终检查结果【0:合格 1:不合格】初始数据默认和首次检查结果相同 + */ + private String finalResult; + + /** + * 最新复查时间【初始数据默认和首次巡查时间相同】 + */ + private Date finalTime; + + /** + * 备注 + */ + private String remarks; + + + //token中userId + private String staffId; + + public interface Add {} + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddPlacePatrolReviewRecordFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddPlacePatrolReviewRecordFormDTO.java new file mode 100644 index 0000000000..fefc67e2ea --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddPlacePatrolReviewRecordFormDTO.java @@ -0,0 +1,84 @@ +/** + * 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.dto.form; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.Date; + + +/** + * @Author sun + * @Description 新增巡查复查记录 + **/ +@Data +public class AddPlacePatrolReviewRecordFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 巡查记录主(place_patrol_record)表Id + */ + @NotBlank(message = "巡查记录Id不能为空", groups = {Add.class}) + private String placePatrolRecordId; + + /** + * 场所下分队(place_patrol_team)表Id + */ + @NotBlank(message = "分队名称不能为空", groups = {Add.class}) + private String placePatrolTeamId; + + /** + * 检查人员Id,逗号分隔 + */ + @NotBlank(message = "检查人员不能为空", groups = {Add.class}) + private String inspectors; + + /** + * 复查时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date reviewTime; + + /** + * 复查隐患明细 + */ + private String detailed; + + /** + * 复查检查结果【0:合格 1:不合格】 + */ + @NotBlank(message = "复查检查结果不能为空", groups = {Add.class}) + private String reviewResult; + + /** + * 备注 + */ + private String remarks; + + public interface Add { } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddPlacePatrolTeamFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddPlacePatrolTeamFormDTO.java new file mode 100644 index 0000000000..a0ece62eb1 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddPlacePatrolTeamFormDTO.java @@ -0,0 +1,125 @@ +/** + * 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.dto.form; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.Valid; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotEmpty; +import java.io.Serializable; +import java.util.Date; +import java.util.List; + + +/** + * @Author sun + * @Description 新增九小场所巡查分队人员管理 + **/ +@Data +public class AddPlacePatrolTeamFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 组织Id + */ + private String agencyId; + + /** + * agency_id的所有上级 + */ + private String pids; + + /** + * 网格Id【场所区域】 + */ + @NotBlank(message = "场所区域不能为空", groups = {Add.class}) + private String gridIds; + /** + * 场所类型【admin库sys_dict_data表九小场所value值】 + */ + @NotBlank(message = "场所类型不能为空", groups = {Add.class}) + private String ninePlaceVals; + + /** + * 分队名称 + */ + @NotBlank(message = "分队名称不能为空", groups = {Add.class}) + @Length(max = 20, message = "分队名称不能超过20个字符", groups = {Add.class}) + private String teamName; + + /** + * 巡查计划 + */ + @NotBlank(message = "巡查计划不能为空", groups = {Add.class}) + @Length(max = 200, message = "巡查计划不能超过200个字符", groups = {Add.class}) + private String plan; + + /** + * 创建(建队)时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date time; + + /** + * 场所负责人 + */ + @NotBlank(message = "负责人名称不能为空", groups = {Add.class}) + @Length(max = 20, message = "负责人名称不能超过20个字符", groups = {Add.class}) + private String personInCharge; + /** + * 负责人电话 + */ + @NotBlank(message = "负责人电话不能为空", groups = {Add.class}) + @Length(max = 11, message = "负责人电话不能超过11个字符", groups = {Add.class}) + private String mobile; + + /** + * 备注 + */ + private String remarks; + + /** + * 分队成员信息 + */ + @Valid + @NotEmpty(message = "成员列表不能为空", groups = {Add.class}) + private List memberList; + + //token中userId + private String staffId; + + public interface Add { } + + @Data + public static class Member { + //姓名 + private String name; + //联系电话 + private String mobile; + } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AgencyIdFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AgencyIdFormDTO.java index 44777f5886..cd0b55bbc8 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AgencyIdFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AgencyIdFormDTO.java @@ -2,6 +2,7 @@ package com.epmet.dto.form; import lombok.Data; +import javax.validation.constraints.NotBlank; import java.io.Serializable; /** @@ -16,5 +17,6 @@ public class AgencyIdFormDTO implements Serializable { /** * 部门Id */ + @NotBlank(message = "组织机构ID不能为空") private String agencyId; } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AppointmentFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AppointmentFormDTO.java new file mode 100644 index 0000000000..a1caadfd14 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AppointmentFormDTO.java @@ -0,0 +1,54 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/11/22 2:00 下午 + * @DESC + */ +@Data +public class AppointmentFormDTO implements Serializable { + + private static final long serialVersionUID = -7113952715343314153L; + + public interface AppointmentForm{} + + /** + * 事项ID + */ + @NotBlank(message = "matterId不能为空",groups = AppointmentForm.class) + private String matterId; + + /** + * 预约日期 + */ + @NotBlank(message = "appointmentDate不能为空",groups = AppointmentForm.class) + private String appointmentDate; + + /** + * 预约编号 + */ + @NotBlank(message = "timeId不能为空",groups = AppointmentForm.class) + private String timeId; + + /** + * 预约人 + */ + @NotBlank(message = "appointmentName不能为空",groups = AppointmentForm.class) + private String appointmentName; + + /** + * 预约电话 + */ + @NotBlank(message = "appointmentPhone不能为空",groups = AppointmentForm.class) + private String appointmentPhone; + + /** + * 备注 + */ + private String remark; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AppointmentRecordFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AppointmentRecordFormDTO.java new file mode 100644 index 0000000000..ef3783f1fa --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AppointmentRecordFormDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.time.LocalDate; + +/** + * @Author zxc + * @DateTime 2021/11/23 10:42 上午 + * @DESC + */ +@Data +public class AppointmentRecordFormDTO implements Serializable { + + private static final long serialVersionUID = 2021698309505676292L; + + public interface AppointmentRecordForm{} + + @NotBlank(message = "matterId不能为空",groups = AppointmentRecordForm.class) + private String matterId; + + @NotBlank(message = "date不能为空",groups = AppointmentRecordForm.class) + private String date; + + public AppointmentRecordFormDTO() { + this.date = LocalDate.now().toString(); + } +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AppointmentTimeFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AppointmentTimeFormDTO.java new file mode 100644 index 0000000000..241aba3802 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AppointmentTimeFormDTO.java @@ -0,0 +1,31 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/11/23 9:57 上午 + * @DESC + */ +@Data +public class AppointmentTimeFormDTO implements Serializable { + + private static final long serialVersionUID = -3645075481936669437L; + + public interface AppointmentTimeForm{} + + /** + * 事项ID + */ + @NotBlank(message = "matterId不能为空",groups = AppointmentTimeForm.class) + private String matterId; + + /** + * 日期,默认当天 + */ + @NotBlank(message = "date不能为空",groups = AppointmentTimeForm.class) + private String date; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/BaseInfoFamilyBuildingFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/BaseInfoFamilyBuildingFormDTO.java new file mode 100644 index 0000000000..94bc0a05ab --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/BaseInfoFamilyBuildingFormDTO.java @@ -0,0 +1,22 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/11/2 9:13 上午 + * @DESC + */ +@Data +public class BaseInfoFamilyBuildingFormDTO implements Serializable { + + private static final long serialVersionUID = 2009866136409462441L; + + public interface BaseInfoFamilyBuildingForm{} + + @NotBlank(message = "neighborHoodId不能为空",groups = BaseInfoFamilyBuildingForm.class) + private String neighborHoodId; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/CancelAppointmentFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/CancelAppointmentFormDTO.java new file mode 100644 index 0000000000..51faf2aa6d --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/CancelAppointmentFormDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/11/26 5:19 下午 + * @DESC + */ +@Data +public class CancelAppointmentFormDTO implements Serializable { + + private static final long serialVersionUID = 8646430374802086292L; + + public interface CancelAppointmentForm{} + + @NotBlank(message = "recordId不能为空",groups = CancelAppointmentForm.class) + private String recordId; + + private String userId; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/CustomerGridFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/CustomerGridFormDTO.java index c34d3c5870..1949f6d8a8 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/CustomerGridFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/CustomerGridFormDTO.java @@ -31,11 +31,12 @@ import java.io.Serializable; public class CustomerGridFormDTO implements Serializable { private static final long serialVersionUID = 1L; - /** * 网格Id */ - @NotBlank(message = "网格ID不能为空") + @NotBlank(message = "网格ID不能为空", groups = {Grid.class}) private String gridId; + public interface Grid{} + } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/DelMatterFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/DelMatterFormDTO.java new file mode 100644 index 0000000000..2c45e104b5 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/DelMatterFormDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/11/22 11:11 上午 + * @DESC + */ +@Data +public class DelMatterFormDTO implements Serializable { + + private static final long serialVersionUID = -5351894549285626126L; + + public interface DelMatterForm{} + + /** + * 事项ID + */ + @NotBlank(message = "matterId不能为空",groups = DelMatterForm.class) + private String matterId; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/DeleteGridFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/DeleteGridFormDTO.java index ed266210ba..5bd8641413 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/DeleteGridFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/DeleteGridFormDTO.java @@ -27,4 +27,9 @@ public class DeleteGridFormDTO implements Serializable { * userId */ private String userId; + + /** + * 客户Id + */ + private String customerId; } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditGridFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditGridFormDTO.java index 0ad04c404d..ff48cd1972 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditGridFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditGridFormDTO.java @@ -40,4 +40,7 @@ public class EditGridFormDTO implements Serializable { */ private String manageDistrict; + //客户Id + private String customerId; + } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditPartyServiceCenterFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditPartyServiceCenterFormDTO.java new file mode 100644 index 0000000000..d292fa6ae2 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditPartyServiceCenterFormDTO.java @@ -0,0 +1,91 @@ +package com.epmet.dto.form; + +import com.epmet.dto.IcPartyServiceCenterMatterDTO; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2021/11/22 9:05 上午 + * @DESC + */ +@Data +public class EditPartyServiceCenterFormDTO implements Serializable { + + private static final long serialVersionUID = -231856877756036529L; + + public interface EditPartyServiceCenterForm{} + + /** + * 中心名称 + */ + @NotBlank(message = "centerName不能为空",groups = EditPartyServiceCenterForm.class) + private String centerName; + + /** + * 社区地址 + */ + @NotBlank(message = "address不能为空",groups = EditPartyServiceCenterForm.class) + private String address; + + /** + * 办公电话 + */ + @NotBlank(message = "workPhone不能为空",groups = EditPartyServiceCenterForm.class) + private String workPhone; + + /** + * 上午开始时间 + */ + @NotBlank(message = "amStartTime不能为空",groups = EditPartyServiceCenterForm.class) + private String amStartTime; + + /** + * 上午结束时间 + */ + @NotBlank(message = "amEndTime不能为空",groups = EditPartyServiceCenterForm.class) + private String amEndTime; + + /** + * 下午开始时间 + */ + @NotBlank(message = "pmStartTime不能为空",groups = EditPartyServiceCenterForm.class) + private String pmStartTime; + + /** + * 下午结束时间 + */ + @NotBlank(message = "pmEndTime不能为空",groups = EditPartyServiceCenterForm.class) + private String pmEndTime; + + /** + * 经度 + */ + @NotBlank(message = "longitude不能为空",groups = EditPartyServiceCenterForm.class) + private String longitude; + + /** + * 纬度 + */ + @NotBlank(message = "latitude不能为空",groups = EditPartyServiceCenterForm.class) + private String latitude; + + /** + * 党群服务中心ID + */ + @NotBlank(message = "partyServiceCenterId不能为空",groups = EditPartyServiceCenterForm.class) + private String partyServiceCenterId; + + /** + * 新增的可预约事项 + */ + private List matterList; + + /** + * 要删除的事项 + */ + private List delMatterList; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditPlaceOrgFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditPlaceOrgFormDTO.java new file mode 100644 index 0000000000..d4863f9cb9 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditPlaceOrgFormDTO.java @@ -0,0 +1,84 @@ +/** + * 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.dto.form; + +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + + +/** + * @Author sun + * @Description 修改、删除九小场所下组织 + **/ +@Data +public class EditPlaceOrgFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + /** + * 场所Id + */ + @NotBlank(message = "场所Id不能为空", groups = {Edit.class, Del.class, Detail.class}) + private String placeOrgId; + /** + * 网格Id【场所区域】 + */ + private String gridId; + /** + * 场所类型【admin库sys_dict_data表九小场所value值】 + */ + private String ninePlaceVal; + /** + * 场所名称 + */ + @Length(max = 20, message = "场所名称不能超过20个字符", groups = {Edit.class}) + private String placeOrgName; + /** + * 场所地址 + */ + @Length(max = 100, message = "场所地址不能超过100个字符", groups = {Edit.class}) + private String address; + /** + * 字典value,场所规模【0:10人以下 1:10-20人 2:21-40人 3:41-100人 4:100人以上】 + */ + private String scale; + /** + * 场所负责人 + */ + @Length(max = 20, message = "负责人名称不能超过20个字符", groups = {Edit.class}) + private String personInCharge; + /** + * 负责人电话 + */ + @Length(max = 11, message = "负责人电话不能超过11个字符", groups = {Edit.class}) + private String mobile; + /** + * 备注 + */ + private String remarks; + + public interface Edit { } + + public interface Del { } + + public interface Detail { } + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerPartyBranchRedis.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditPlacePatrolRecordFormDTO.java similarity index 57% rename from epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerPartyBranchRedis.java rename to epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditPlacePatrolRecordFormDTO.java index e5d8d70e5e..ea24f0613b 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerPartyBranchRedis.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditPlacePatrolRecordFormDTO.java @@ -15,33 +15,30 @@ * along with this program. If not, see . */ -package com.epmet.redis; +package com.epmet.dto.form; -import com.epmet.commons.tools.redis.RedisUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; +import lombok.Data; -/** - * 党支部信息 - * - * @author yinzuomei yinzuomei@elink-cn.com - * @since v1.0.0 2020-06-17 - */ -@Component -public class CustomerPartyBranchRedis { - @Autowired - private RedisUtils redisUtils; - - public void delete(Object[] ids) { +import javax.validation.constraints.NotBlank; +import java.io.Serializable; - } - public void set(){ - - } - - public String get(String id){ - return null; - } +/** + * @Author sun + * @Description 删除、详情场所巡查记录 + **/ +@Data +public class EditPlacePatrolRecordFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + /** + * 巡查记录Id + */ + @NotBlank(message = "巡查记录Id不能为空", groups = {Del.class, Detail.class}) + private String placePatrolRecordId; + + + public interface Del { } + public interface Detail { } } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditPlacePatrolReviewRecordFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditPlacePatrolReviewRecordFormDTO.java new file mode 100644 index 0000000000..0ceff8ebab --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditPlacePatrolReviewRecordFormDTO.java @@ -0,0 +1,79 @@ +/** + * 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.dto.form; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.Date; +import java.util.List; + + +/** + * @Author sun + * @Description 修改、删除、详情巡查复查记录 + **/ +@Data +public class EditPlacePatrolReviewRecordFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + /** + * 复查记录Id + */ + @NotBlank(message = "复查记录Id不能为空", groups = {Edit.class, Del.class, Detail.class}) + private String placePatrolReviewRecordId; + + /** + * 场所下分队(place_patrol_team)表Id + */ + private String placePatrolTeamId; + + /** + * 检查人员Id,逗号分隔 + */ + private String inspectors; + + /** + * 复查时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date reviewTime; + + /** + * 复查隐患明细 + */ + private String detailed; + + /** + * 复查检查结果【0:合格 1:不合格】 + */ + private String reviewResult; + + /** + * 备注 + */ + private String remarks; + + public interface Edit { } + public interface Del { } + public interface Detail { } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditPlacePatrolTeamFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditPlacePatrolTeamFormDTO.java new file mode 100644 index 0000000000..4509c6f443 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditPlacePatrolTeamFormDTO.java @@ -0,0 +1,114 @@ +/** + * 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.dto.form; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.Date; +import java.util.List; + + +/** + * @Author sun + * @Description 修改、删除九小场所巡查分队人员管理 + **/ +@Data +public class EditPlacePatrolTeamFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + /** + * 分队Id + */ + @NotBlank(message = "分队Id不能为空", groups = {Edit.class, Del.class, Detail.class}) + private String teamId; + + /** + * 网格Id【场所区域】 + */ + private String gridIds; + /** + * 场所类型【admin库sys_dict_data表九小场所value值】 + */ + private String ninePlaceVals; + + /** + * 分队名称 + */ + @Length(max = 20, message = "分队名称不能超过20个字符", groups = {AddPlacePatrolTeamFormDTO.Add.class}) + private String teamName; + + /** + * 巡查计划 + */ + @Length(max = 200, message = "巡查计划不能超过200个字符", groups = {AddPlacePatrolTeamFormDTO.Add.class}) + private String plan; + + /** + * 创建(建队)时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date time; + + /** + * 场所负责人 + */ + @Length(max = 20, message = "负责人名称不能超过20个字符", groups = {AddPlacePatrolTeamFormDTO.Add.class}) + private String personInCharge; + /** + * 负责人电话 + */ + @Length(max = 11, message = "负责人电话不能超过11个字符", groups = {AddPlacePatrolTeamFormDTO.Add.class}) + private String mobile; + + /** + * 备注 + */ + private String remarks; + + /** + * 分队成员信息 + */ + private List memberList; + + public interface Edit { + } + + public interface Del { + } + + public interface Detail { + } + + @Data + public static class Member { + //姓名 + private String name; + //联系电话 + private String mobile; + } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetListPlaceOrgFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetListPlaceOrgFormDTO.java new file mode 100644 index 0000000000..4725a8b32d --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetListPlaceOrgFormDTO.java @@ -0,0 +1,60 @@ +/** + * 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.dto.form; + +import lombok.Data; + +import javax.validation.constraints.Min; +import java.io.Serializable; + + +/** + * @Author sun + * @Description 九小场所下组织列表查询 + **/ +@Data +public class GetListPlaceOrgFormDTO implements Serializable { + private static final long serialVersionUID = 1L; + + //场所名称 + private String placeOrgName; + //联系电话 + private String mobile; + //场所规模【 0:10人以下 1:10-20人 2:21-40人 3:41-100人 4:100人以上】 + private String scale; + //场所区域【网格Id】 + private String gridId; + //场所类型【九小场所Value值】 + private String ninePlaceVal; + //是否分页(是:true 否:false) 有这个参数是给新增巡查记录时用的,默认是 + private Boolean isPage = true; + //页码 + @Min(1) + private Integer pageNo = 1; + //每页多少条 + private Integer pageSize = 20; + //token中客户Id + private String customerId; + //场所Id + private String placeOrgId; + //token中userId + private String staffId; + //token中userId所属组织的pid + private String pids; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetListPlacePatrolRecordFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetListPlacePatrolRecordFormDTO.java new file mode 100644 index 0000000000..f176bca7ba --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetListPlacePatrolRecordFormDTO.java @@ -0,0 +1,58 @@ +/** + * 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.dto.form; + +import lombok.Data; + +import javax.validation.constraints.Min; +import java.io.Serializable; + + +/** + * @Author sun + * @Description 场所巡查记录列表查询 + **/ +@Data +public class GetListPlacePatrolRecordFormDTO implements Serializable { + private static final long serialVersionUID = 1L; + + //场所名称 + private String placeOrgName; + //首次检查结果【0:合格 1:不合格】 + private String firstResult; + //场所区域【网格Id】 + private String gridId; + //场所类型【九小场所Value值】 + private String ninePlaceVal; + //最终检查结果【0:合格 1:不合格】 + private String finalResult; + //页码 + @Min(1) + private Integer pageNo = 1; + //每页多少条 + private Integer pageSize = 20; + //token中客户Id + private String customerId; + //巡查记录Id + private String placePatrolRecordId; + //token中userId + private String staffId; + //token中userId所属组织的pid + private String pids; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetListPlacePatrolReviewRecordFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetListPlacePatrolReviewRecordFormDTO.java new file mode 100644 index 0000000000..a4f0eeae0a --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetListPlacePatrolReviewRecordFormDTO.java @@ -0,0 +1,48 @@ +/** + * 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.dto.form; + +import lombok.Data; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + + +/** + * @Author sun + * @Description 巡查复查记录列表查询 + **/ +@Data +public class GetListPlacePatrolReviewRecordFormDTO implements Serializable { + private static final long serialVersionUID = 1L; + //巡查记录Id + @NotBlank(message = "巡查记录Id不能为空", groups = {GetData.class}) + private String placePatrolRecordId; + //复查记录Id + private String placePatrolReviewRecordId; + //页码 + @Min(1) + private Integer pageNo = 1; + //每页多少条 + private Integer pageSize = 20; + //token中客户Id + private String customerId; + public interface GetData { } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetListPlacePatrolTeamFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetListPlacePatrolTeamFormDTO.java new file mode 100644 index 0000000000..381a085107 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetListPlacePatrolTeamFormDTO.java @@ -0,0 +1,58 @@ +/** + * 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.dto.form; + +import lombok.Data; + +import javax.validation.constraints.Min; +import java.io.Serializable; + + +/** + * @Author sun + * @Description 九小场所巡查分队人员管理列表查询 + **/ +@Data +public class GetListPlacePatrolTeamFormDTO implements Serializable { + private static final long serialVersionUID = 1L; + + //负责人 + private String personInCharge; + //联系电话 + private String mobile; + //场所区域【网格Id】 + private String gridId; + //场所类型【九小场所Value值】 + private String ninePlaceVal; + //是否分页(是:true 否:false) 有这个参数是给新增巡查记录时用的,默认是 + private Boolean isPage = true; + //页码 + @Min(1) + private Integer pageNo = 1; + //每页多少条 + private Integer pageSize = 20; + //token中客户Id + private String customerId; + //场所Id + private String teamId; + //token中userId + private String staffId; + //token中userId所属组织的pid + private String pids; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GridOptionFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GridOptionFormDTO.java new file mode 100644 index 0000000000..e6fae52bc9 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GridOptionFormDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description /gov/org/customergrid/gridoption + * @Author yinzuomei + * @Date 2021/11/12 10:54 上午 + */ +@Data +public class GridOptionFormDTO implements Serializable { + /** + * 部门Id + */ + @NotBlank(message = "组织机构ID不能为空") + private String agencyId; + //等着杨林改完,我再限制必填吧 + //@NotBlank(message = "查询条件和查看居民详情:query;新增或修改居民信息:addorupdate") + private String purpose; +} + diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/HouseFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/HouseFormDTO.java new file mode 100644 index 0000000000..304bce36b9 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/HouseFormDTO.java @@ -0,0 +1,17 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2021/10/25 17:03 + */ +@Data +public class HouseFormDTO implements Serializable { + private static final long serialVersionUID = 2636608477324780974L; + private String buildingId; + private String unitId; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcBulidingFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcBulidingFormDTO.java new file mode 100644 index 0000000000..879fd011c9 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcBulidingFormDTO.java @@ -0,0 +1,129 @@ +/** + * 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.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + + +@Data +public class IcBulidingFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + public interface DeleteGroup extends CustomerClientShowGroup { + } + + public interface AddShowGroup extends CustomerClientShowGroup { + } + + public interface UpdateShowGroup extends CustomerClientShowGroup { + } + @NotBlank(message = "楼栋ID不能为空", groups = { UpdateShowGroup.class,DeleteGroup.class}) + private String buildingId; + + /** + * 组织id + */ + @NotBlank(message = "组织id不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) + private String agencyId; + + + /** + * 网格id + */ + @NotBlank(message = "网格不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) + private String gridId; + + + /** + * 小区id + */ + @NotBlank(message = "小区id不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) + private String neighborHoodId; + + /** + * 楼栋名称 + */ + @NotBlank(message = "楼栋名称不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) + @Length(max=10,message = "楼栋名称不能超过10个字", groups = {AddShowGroup.class, UpdateShowGroup.class}) + private String buildingName; + + /** + * 楼栋类型 + */ + @NotBlank(message = "楼栋类型不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) + private String type=""; + + /** + * 客户id + */ + /* @NotBlank(message = "客户id不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) + private String customerId;*/ + + /** + * 排序 + */ + @NotNull(message = "排序不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) + private Integer sort = 0; + + /** + * 总单元数 + */ + @NotNull(message = "总单元数不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) + private Integer totalUnitNum=1; + + /** + * 总楼层总数 + */ + //@NotNull(message = "总楼层总数不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) + private Integer totalFloorNum; + + /** + * 总户数 + */ + //@NotNull(message = "总户数不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) + private Integer totalHouseNum; + /** + * 坐标位置 + */ + + private String location; + + + /** + * 中心点位:经度 + */ + + private String longitude; + + /** + * 中心点位:纬度 + */ + + private String latitude; + + + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcBulidingUnitFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcBulidingUnitFormDTO.java new file mode 100644 index 0000000000..74a38b8e2b --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcBulidingUnitFormDTO.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.dto.form; + +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + + +@Data +public class IcBulidingUnitFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + @NotBlank(message = "楼栋ID不能为空") + private String buildingId; + + + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseFormDTO.java new file mode 100644 index 0000000000..58376e2032 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseFormDTO.java @@ -0,0 +1,105 @@ +/** + * 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.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + + +@Data +public class IcHouseFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + public interface DeleteGroup extends CustomerClientShowGroup { + } + + public interface AddShowGroup extends CustomerClientShowGroup { + } + + public interface UpdateShowGroup extends CustomerClientShowGroup { + } + + @NotBlank(message = "房屋ID不能为空", groups = { UpdateShowGroup.class,DeleteGroup.class}) + private String houseId; + + + /** + * 小区id + */ + @NotBlank(message = "小区id不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) + private String neighborHoodId; + + @NotBlank(message = "所属楼栋ID不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) + private String buildingId; + + /** + * 所属单元id + */ + @NotBlank(message = "所属单元id不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) + private String buildingUnitId; + + + + /** + * 门牌号 + */ + @NotBlank(message = "门牌号不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) + private String doorName; + + /** + * 房屋类型,这里存储字典value就可以 + */ + @NotBlank(message = "房屋类型不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) + private String houseType; + + /** + * 存储字典value + */ + @NotBlank(message = "房屋用途不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) + private String purpose; + + /** + * 1出租;0未出租 + */ + @NotNull(message = "是否出租不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) + private Integer rentFlag; + + /** + * 房主姓名 + */ + @NotBlank(message = "房主姓名不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) + private String ownerName; + + /** + * 房主电话 + */ + @NotBlank(message = "房主电话不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) + private String ownerPhone; + + /** + * 房主身份证号 + */ + @NotBlank(message = "房主身份证号不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) + private String ownerIdCard; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcNeighborHoodFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcNeighborHoodFormDTO.java new file mode 100644 index 0000000000..fbeefeadf5 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcNeighborHoodFormDTO.java @@ -0,0 +1,105 @@ +/** + * 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.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + + + +@Data +public class IcNeighborHoodFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + public interface DeleteGroup extends CustomerClientShowGroup { + } + + public interface AddShowGroup extends CustomerClientShowGroup { + } + public interface UpdateShowGroup extends CustomerClientShowGroup { + } + /** + * 小区id + */ + @NotBlank(message = "小区id不能为空", groups = {UpdateShowGroup.class,DeleteGroup.class}) + private String neighborHoodId; + + /** + * 小区名称 + */ + @NotBlank(message = "小区名称不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) + @Length(max=50,message = "小区名称不能超过50个字", groups = {AddShowGroup.class, UpdateShowGroup.class}) + private String neighborHoodName; + + /** + * 组织id + */ + @NotBlank(message = "组织id不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) + private String agencyId; + + + /** + * 网格id + */ + @NotBlank(message = "网格id不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) + private String gridId; + /** + * 关联物业id + */ + //@NotBlank(message = "关联物业ID不能为空", groups = {AddShowGroup.class,UpdateShowGroup.class}) + private String propertyId; + + /** + * 详细地址 + */ + @NotBlank(message = "详细地址不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) + private String address; + + /** + * 备注 + */ + @Length(max=500,message = "备注不能超过500个字", groups = {AddShowGroup.class, UpdateShowGroup.class}) + private String remark; + /** + * 坐标位置 + */ + private String location; + + + /** + * 中心点位:经度 + */ + + private String longitude; + + /** + * 中心点位:纬度 + */ + + private String latitude; + + + + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcPropertyManagementFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcPropertyManagementFormDTO.java new file mode 100644 index 0000000000..63ea329d22 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcPropertyManagementFormDTO.java @@ -0,0 +1,53 @@ +/** + * 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.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + + +@Data +public class IcPropertyManagementFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + public interface DeleteGroup extends CustomerClientShowGroup { + } + + public interface AddShowGroup extends CustomerClientShowGroup { + } + + public interface UpdateShowGroup extends CustomerClientShowGroup { + } + + @NotBlank(message = "物业id不能为空", groups = {DeleteGroup.class, UpdateShowGroup.class}) + private String id; + + /** + * 物业名称 + */ + @NotBlank(message = "物业名称不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) + @Length(max = 50, message = "物业名称不能超过50个字", groups = {AddShowGroup.class}) + private String name; + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/ListIcNeighborHoodFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/ListIcNeighborHoodFormDTO.java new file mode 100644 index 0000000000..80b95263b6 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/ListIcNeighborHoodFormDTO.java @@ -0,0 +1,80 @@ +package com.epmet.dto.form;/** + * Created by 11 on 2020/3/19. + */ + +import lombok.Data; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.Pattern; +import java.io.Serializable; + +/** + * @Description 陌生人导览查询附近网格传参定义 + * @ClassName ListCustomerGridFormDTO + * @Author wangc + * @date 2020.03.19 15:00 + */ +@Data +public class ListIcNeighborHoodFormDTO implements Serializable{ + + private static final long serialVersionUID = -1L; + + + /** + * 当前页 + * */ + private Integer pageNo = 1; + + /** + * 每页显示数量 + * */ + private Integer pageSize = 20; + + /** + * 组织类别 + */ + private String level ; + + private String id; + + /** + * 组织ID + */ +// private String agencyId; + /** + * 网格ID + */ +// private String gridId; + /** + * 小区名字 + */ +// private String neighborHoodName; + /** + * 楼栋名字 + */ +// private String buildingName; + /** + * 房主姓名 + */ + private String ownerName; + /** + * 房主电话 + */ + private String ownerPhone; + /** + * 数据类型【小区:neighbourHood,楼栋:building,房屋:house】 + */ +// @Pattern(regexp = "^(neighbourHood|building|house)?$",message = "数据类型选择错误") +// private String dataType; + /** + * 楼栋ID + */ + private String buildingId; + /** + * 小区ID + */ + private String neighborHoodId; + + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/MapAddAreaFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/MapAddAreaFormDTO.java new file mode 100644 index 0000000000..8fcf455279 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/MapAddAreaFormDTO.java @@ -0,0 +1,31 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/10/25 9:54 上午 + * @DESC + */ +@Data +public class MapAddAreaFormDTO implements Serializable { + + private static final long serialVersionUID = 2334704900459757549L; + + public interface MapAddAreaForm{} + + /** + * 类型,组织:agency,网格:grid,小区:neighborHood + */ + @NotBlank(message = "level不能为空",groups = MapAddAreaForm.class) + private String level; + + @NotBlank(message = "orgId不能为空",groups = MapAddAreaForm.class) + private String orgId; + + @NotBlank(message = "coordinates不能为空",groups = MapAddAreaForm.class) + private String coordinates; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/MapDelAreaFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/MapDelAreaFormDTO.java new file mode 100644 index 0000000000..efeaf5b0e2 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/MapDelAreaFormDTO.java @@ -0,0 +1,28 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/10/25 9:23 上午 + * @DESC + */ +@Data +public class MapDelAreaFormDTO implements Serializable { + + private static final long serialVersionUID = -539570523818788293L; + + public interface MapDelAreaForm{} + + /** + * 类型,组织:agency,网格:grid,小区:neighborHood + */ + @NotBlank(message = "level不能为空", groups = MapDelAreaForm.class) + private String level; + + @NotBlank(message = "orgId不能为空", groups = MapDelAreaForm.class) + private String orgId; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/MapOrgFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/MapOrgFormDTO.java new file mode 100644 index 0000000000..04ac916daa --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/MapOrgFormDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/10/25 10:40 上午 + * @DESC + */ +@Data +public class MapOrgFormDTO implements Serializable { + + private static final long serialVersionUID = 2021388285115834510L; + + /** + * 类型,组织:agency,网格:grid,小区:neighborHood + */ + private String level; + + /** + * 组织ID,默认不填写 + */ + private String orgId; + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/PartyServiceCenterListFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/PartyServiceCenterListFormDTO.java new file mode 100644 index 0000000000..1014b844cc --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/PartyServiceCenterListFormDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/11/22 2:37 下午 + * @DESC + */ +@Data +public class PartyServiceCenterListFormDTO implements Serializable { + + private static final long serialVersionUID = -6620725991593811931L; + + private String orgId; + + private String orgType; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/RemoveAgencyFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/RemoveAgencyFormDTO.java index 5caaec7ea5..27bee4e64d 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/RemoveAgencyFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/RemoveAgencyFormDTO.java @@ -38,5 +38,9 @@ public class RemoveAgencyFormDTO implements Serializable { */ @NotBlank(message = "机关组织ID不能为空") private String agencyId; + /** + * 客户Id + */ + private String customerId; } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/RootOrgListByStaffIdFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/RootOrgListByStaffIdFormDTO.java new file mode 100644 index 0000000000..ca4e3153f3 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/RootOrgListByStaffIdFormDTO.java @@ -0,0 +1,19 @@ +package com.epmet.dto.form; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @Description 客户id查询跟组织列表 + * @author wxz + * @date 2021.10.25 14:53:09 +*/ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class RootOrgListByStaffIdFormDTO { + + private String staffId; + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyGridList.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyGridList.java index ad2c907fd5..ce787e045d 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyGridList.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyGridList.java @@ -40,5 +40,17 @@ public class AgencyGridList implements Serializable { * 机关-网格名称 */ private String agencyGridName = ""; + /** + * 网格名称 + */ + private String gridName = ""; + /** + * 网格经度【网格没有经纬度时获取客户根组织下的】 + */ + private String longitude = ""; + /** + * 网格维度【网格没有经纬度时获取客户根组织下的】 + */ + private String latitude = ""; } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyResultDTO.java index e4592c5b0b..a7aec4fa28 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyResultDTO.java @@ -30,20 +30,22 @@ import java.io.Serializable; */ @Data public class AgencyResultDTO implements Serializable { - private static final long serialVersionUID = 1L; - /** - * 机关组织Id - */ + //机关组织Id private String agencyId = ""; - /** - * 机关组织名称 - */ + //机关组织名称 private String agencyName = ""; - /** - * 所有上级组织机构ID(以英文:隔开) - */ + //上级组织id + private String pid; + //组织级别 + private String level; + //所有上级组织机构ID(以英文:隔开) @JsonIgnore private String pids = ""; -} \ No newline at end of file + //经度【没值则取跟客户的值】 + private String longitude; + //维度【没值则取跟客户的值】 + private String latitude; + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencySubResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencySubResultDTO.java index 117976dee8..08bd0683b1 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencySubResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencySubResultDTO.java @@ -49,4 +49,16 @@ public class AgencySubResultDTO implements Serializable { * 当前组织的所有上级组织Id */ private String pids = ""; + /** + * 组织级别 + */ + private String level = ""; + /** + * 组织经度【没值取根组织的值】 + */ + private String longitude = ""; + /** + * 组织维度【没值取根组织的值】 + */ + private String latitude = ""; } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyTreeResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyTreeResultDTO.java index 896ebfb57c..4d48b54960 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyTreeResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyTreeResultDTO.java @@ -24,6 +24,17 @@ public class AgencyTreeResultDTO implements Serializable { private String agencyName; private String pid; + + private String level; + //经度【没值则取跟客户的值】 + private String longitude; + //维度【没值则取跟客户的值】 + private String latitude; + + /** + * orgId-orgLevel + */ + private String orgLevel; /** * 下级机关组织 */ diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AppointmentExistRecordResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AppointmentExistRecordResultDTO.java new file mode 100644 index 0000000000..ffb4d74c20 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AppointmentExistRecordResultDTO.java @@ -0,0 +1,28 @@ +package com.epmet.dto.result; + +import com.epmet.commons.tools.constant.NumConstant; +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2021/11/23 10:45 上午 + * @DESC + */ +@Data +public class AppointmentExistRecordResultDTO implements Serializable { + + private static final long serialVersionUID = 6651436509788141940L; + + /** + * 事项名 + */ + private String matterName; + + private String matterId; + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AppointmentRecordResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AppointmentRecordResultDTO.java new file mode 100644 index 0000000000..84813a4f47 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AppointmentRecordResultDTO.java @@ -0,0 +1,62 @@ +package com.epmet.dto.result; + +import com.epmet.commons.tools.constant.NumConstant; +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2021/11/23 10:45 上午 + * @DESC + */ +@Data +public class AppointmentRecordResultDTO implements Serializable { + + private static final long serialVersionUID = 6066514365788141940L; + + private Integer sort; + + /** + * 事项名 + */ + private String matterName; + + /** + * 预约人 + */ + private String appointmentName; + + /** + * 预约电话 + */ + private String appointmentPhone; + + /** + * 备注 + */ + private String remark; + + private String recordId; + + /** + * 预约时间 + */ + private List appointmentTime; + + @JsonIgnore + private String timeId; + + public AppointmentRecordResultDTO() { + this.sort = NumConstant.ZERO; + this.matterName = ""; + this.appointmentName = ""; + this.appointmentPhone = ""; + this.remark = ""; + this.appointmentTime = new ArrayList<>(); + this.recordId = ""; + } +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AppointmentTimeResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AppointmentTimeResultDTO.java new file mode 100644 index 0000000000..b37e4e913a --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AppointmentTimeResultDTO.java @@ -0,0 +1,34 @@ +package com.epmet.dto.result; + +import com.epmet.dto.TimeDTO; +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2021/11/23 9:55 上午 + * @DESC + */ +@Data +public class AppointmentTimeResultDTO implements Serializable { + + private static final long serialVersionUID = 8724962797702659712L; + + /** + * 预约类型【每天:everyDay,工作日:workDay,周末:weekend】 + */ + private String appointmentType; + + /** + * 时间段 + */ + private List timeDetail; + + public AppointmentTimeResultDTO() { + this.appointmentType = ""; + this.timeDetail = new ArrayList<>(); + } +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/BaseInfoFamilyBuildingResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/BaseInfoFamilyBuildingResultDTO.java new file mode 100644 index 0000000000..b905c43166 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/BaseInfoFamilyBuildingResultDTO.java @@ -0,0 +1,31 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/11/2 9:15 上午 + * @DESC + */ +@Data +public class BaseInfoFamilyBuildingResultDTO implements Serializable { + + private static final long serialVersionUID = 6084090841200733630L; + + /** + * 楼栋ID + */ + private String buildingId; + + /** + * 楼栋名字 + */ + private String buildingName; + + public BaseInfoFamilyBuildingResultDTO() { + this.buildingId = ""; + this.buildingName = ""; + } +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/BuildingDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/BuildingDTO.java new file mode 100644 index 0000000000..a076376543 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/BuildingDTO.java @@ -0,0 +1,19 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2021/10/25 15:03 + */ +@Data +public class BuildingDTO implements Serializable { + private static final long serialVersionUID = -2129418426919785999L; + private String buildingId; + private String buildingName; + private List unitList; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/BuildingResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/BuildingResultDTO.java new file mode 100644 index 0000000000..4835cefba5 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/BuildingResultDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2021/10/25 15:03 + */ +@Data +public class BuildingResultDTO implements Serializable { + private static final long serialVersionUID = -2129418426919785999L; + private String buildingId; + + private String gridName; + + private String neighborhoodName; + + private String buildingName; + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/BuildingResultPagedDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/BuildingResultPagedDTO.java new file mode 100644 index 0000000000..eb0bc8e904 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/BuildingResultPagedDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2021/10/25 15:03 + */ +@Data +public class BuildingResultPagedDTO implements Serializable { + private static final long serialVersionUID = -2129418426919785999L; + /** + * + */ + private Integer total; + + /** + * 议题列表 + */ + private List list; + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtGridResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtGridResultDTO.java index 90641f29d4..5040a89fde 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtGridResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtGridResultDTO.java @@ -28,4 +28,8 @@ public class ExtGridResultDTO implements Serializable { * 当前gridId所属的客户id add02.03 * */ private String customerId; + //经度【没值则取跟客户的值】 + private String longitude; + //维度【没值则取跟客户的值】 + private String latitude; } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtStaffPermissionResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtStaffPermissionResultDTO.java index fbaf784c25..1621261359 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtStaffPermissionResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtStaffPermissionResultDTO.java @@ -50,4 +50,8 @@ public class ExtStaffPermissionResultDTO implements Serializable { * 当前agencyId所属的客户id add02.03 * */ private String customerId; + //经度【没值则取跟客户的值】 + private String longitude; + //维度【没值则取跟客户的值】 + private String latitude; } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GetListPlaceOrgResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GetListPlaceOrgResultDTO.java new file mode 100644 index 0000000000..ffa2b18b74 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GetListPlaceOrgResultDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @Author sun + * @Description 九小场所下组织列表查询 + **/ +@Data +public class GetListPlaceOrgResultDTO implements Serializable { + //集合总条数 + private Integer total = 0; + //社会组织信息 + private List list = new ArrayList<>(); + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GetListPlacePatrolRecordResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GetListPlacePatrolRecordResultDTO.java new file mode 100644 index 0000000000..1531ab2901 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GetListPlacePatrolRecordResultDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @Author sun + * @Description 场所巡查记录列表查询 + **/ +@Data +public class GetListPlacePatrolRecordResultDTO implements Serializable { + //集合总条数 + private Integer total = 0; + //社会组织信息 + private List list = new ArrayList<>(); + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GetListPlacePatrolReviewRecordResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GetListPlacePatrolReviewRecordResultDTO.java new file mode 100644 index 0000000000..08b9fe2461 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GetListPlacePatrolReviewRecordResultDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @Author sun + * @Description 巡查复查记录列表查询 + **/ +@Data +public class GetListPlacePatrolReviewRecordResultDTO implements Serializable { + //集合总条数 + private Integer total = 0; + //社会组织信息 + private List list = new ArrayList<>(); + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GetListPlacePatrolTeamResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GetListPlacePatrolTeamResultDTO.java new file mode 100644 index 0000000000..e7dac5b53d --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GetListPlacePatrolTeamResultDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @Author sun + * @Description 九小场所巡查分队人员管理列表查询 + **/ +@Data +public class GetListPlacePatrolTeamResultDTO implements Serializable { + //集合总条数 + private Integer total = 0; + //社会组织信息 + private List list = new ArrayList<>(); + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridTreeResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridTreeResultDTO.java new file mode 100644 index 0000000000..608b9428e5 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridTreeResultDTO.java @@ -0,0 +1,19 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2021/10/25 15:08 + */ +@Data +public class GridTreeResultDTO implements Serializable { + private static final long serialVersionUID = -6506457371074529990L; + private String gridId; + private String gridName; + private List neighborHoodList; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseInfoDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseInfoDTO.java new file mode 100644 index 0000000000..5077e99a33 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseInfoDTO.java @@ -0,0 +1,62 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description TODO + * @Author yinzuomei + * @Date 2021/11/1 1:42 下午 + */ +@Data +public class HouseInfoDTO implements Serializable { + private static final long serialVersionUID = -419899682683323110L; + /** + * 所属家庭Id + */ + private String homeId; + + + /** + * 小区id + */ + private String neighborHoodId; + /** + * 小区名称 + */ + private String neighborHoodName; + + + /** + * 所属楼栋id + */ + private String buildingId; + /** + * 楼栋名称 + */ + private String buildingName; + + + /** + * 所属单元id + */ + private String buildingUnitId; + /** + * 单元名 + */ + private String unitName; + + + /** + * 门牌号 + */ + private String doorName; + + /** + * 房屋类型,1楼房,2平房,3别墅 + */ + private String houseType; + + private String houseName; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseListResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseListResultDTO.java new file mode 100644 index 0000000000..a63f415e94 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseListResultDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2021/11/5 15:59 + */ +@NoArgsConstructor +@Data +public class HouseListResultDTO implements Serializable { + + private static final long serialVersionUID = 2063032844842070847L; + private String houseId; + private String houseName; + private List categoryList; + + @NoArgsConstructor + @Data + public static class CategoryListBean { + private String name; + private String iconUrl; + private String isSpecial; + } +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseResultDTO.java new file mode 100644 index 0000000000..58a07c8bbc --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseResultDTO.java @@ -0,0 +1,17 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2021/10/25 16:58 + */ +@Data +public class HouseResultDTO implements Serializable { + private static final long serialVersionUID = 8054109017922254586L; + private String houseId; + private String houseName; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcNeighborHoodResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcNeighborHoodResultDTO.java new file mode 100644 index 0000000000..51b410eaa5 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcNeighborHoodResultDTO.java @@ -0,0 +1,36 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; +import java.util.Map; + +/** + * @Description 网格列表信息 + * @ClassName GridListInfoResultDTO + * @Author wangc + * @date 2020.04.23 14:21 + */ +@Data +public class IcNeighborHoodResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + /** + * 总条数 + * */ + + private Integer total; + +// /** +// * 数据类型【小区:neighbourHood,楼栋:building,房屋:house】 +// * */ +// private String dataType; + + /** + * 结果集 + */ + private List> list; + + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcPropertyManagementResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcPropertyManagementResultDTO.java new file mode 100644 index 0000000000..6f2e058206 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcPropertyManagementResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; +import java.util.Map; + +/** + * @Description 网格列表信息 + * @ClassName GridListInfoResultDTO + * @Author wangc + * @date 2020.04.23 14:21 + */ +@Data +public class IcPropertyManagementResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + private String propertyId; + + private String propertyName; + + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/MapOrgResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/MapOrgResultDTO.java new file mode 100644 index 0000000000..5ad5436d9a --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/MapOrgResultDTO.java @@ -0,0 +1,77 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2021/10/25 10:40 上午 + * @DESC + */ +@Data +public class MapOrgResultDTO implements Serializable { + + private static final long serialVersionUID = 7296300942981202725L; + + /** + * 经度 + */ + @JsonIgnore + private String longitudeOrigin; + + private BigDecimal longitude; + + /** + * 纬度 + */ + @JsonIgnore + private String latitudeOrigin; + + private BigDecimal latitude; + + /** + * 组织或网格ID + */ + private String id; + + /** + * 组织或网格名字 + */ + private String name; + + /** + * 类型,组织:agency,网格:grid,小区:neighborHood + */ + private String level; + + /** + * 坐标 + */ + private String coordinates; + + /** + * 组织级别 + */ + private String agencyLevel; + + /** + * 下级结果集 + */ + private List children; + + public MapOrgResultDTO() { + this.longitudeOrigin = ""; + this.latitudeOrigin = ""; + this.id = ""; + this.name = ""; + this.level = ""; + this.coordinates = ""; + this.children = new ArrayList<>(); + this.agencyLevel = ""; + } +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/MapSonOrgResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/MapSonOrgResultDTO.java new file mode 100644 index 0000000000..86b1a95c14 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/MapSonOrgResultDTO.java @@ -0,0 +1,70 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2021/10/25 10:40 上午 + * @DESC + */ +@Data +public class MapSonOrgResultDTO implements Serializable { + + private static final long serialVersionUID = 7296300942981202725L; + + /** + * 经度 + */ + @JsonIgnore + private String longitudeOrigin; + + private BigDecimal longitude; + + /** + * 纬度 + */ + @JsonIgnore + private String latitudeOrigin; + + private BigDecimal latitude; + + /** + * 组织或网格ID + */ + private String id; + + /** + * 组织或网格名字 + */ + private String name; + + /** + * 类型,组织:agency,网格:grid,小区:neighborHood + */ + private String level; + + /** + * 坐标 + */ + private String coordinates; + + /** + * 组织级别 + */ + private String agencyLevel; + + public MapSonOrgResultDTO() { + this.longitudeOrigin = ""; + this.latitudeOrigin = ""; + this.id = ""; + this.name = ""; + this.level = ""; + this.coordinates = ""; + this.agencyLevel = ""; + } +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/NeighborHoodDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/NeighborHoodDTO.java new file mode 100644 index 0000000000..6a561c6e8e --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/NeighborHoodDTO.java @@ -0,0 +1,19 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2021/10/25 15:06 + */ +@Data +public class NeighborHoodDTO implements Serializable { + private static final long serialVersionUID = 1644088283259175745L; + private String neighborHoodId; + private String neighborHoodName; + private List buildingList; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/PartyServiceCenterListResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/PartyServiceCenterListResultDTO.java new file mode 100644 index 0000000000..17ca6f112c --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/PartyServiceCenterListResultDTO.java @@ -0,0 +1,77 @@ +package com.epmet.dto.result; + +import com.epmet.dto.MatterListDTO; +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2021/11/22 2:38 下午 + * @DESC + */ +@Data +public class PartyServiceCenterListResultDTO implements Serializable { + + private static final long serialVersionUID = -5977663317819468536L; + + /** + * 中心名称 + */ + private String centerName; + + /** + * 党群服务中心ID + */ + private String partyServiceCenterId; + + /** + * 社区地址 + */ + private String address; + + /** + * 办公电话 + */ + private String workPhone; + + /** + * 上午工作时间 + */ + private String amWorkTime; + + /** + * 下午工作时间 + */ + private String pmWorkTime; + private String amStartTime; + private String amEndTime; + private String pmStartTime; + private String pmEndTime; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + + private List matterList; + + public PartyServiceCenterListResultDTO() { + this.centerName = ""; + this.partyServiceCenterId = ""; + this.address = ""; + this.workPhone = ""; + this.amWorkTime = ""; + this.pmWorkTime = ""; + this.longitude = ""; + this.latitude = ""; + this.matterList = new ArrayList<>(); + } +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/PlaceOrgDetailResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/PlaceOrgDetailResultDTO.java new file mode 100644 index 0000000000..866f1cc981 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/PlaceOrgDetailResultDTO.java @@ -0,0 +1,37 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Author sun + * @Description 九小场所下组织列表查询 + **/ +@Data +public class PlaceOrgDetailResultDTO implements Serializable { + //场所Id + private String placeOrgId; + //场所名称 + private String placeOrgName; + //场所区域Id + private String gridId; + //场所区域名称 + private String gridName; + //场所地址 + private String address; + //场所类型名称[九小场所Value值] + private String ninePlaceVal; + //场所类型名称[九小场所名称] + private String ninePlaceName; + //场所规模【 0:10人以下 1:10-20人 2:21-40人 3:41-100人 4:100人以上】 + private String scale; + //场所规模名称【 0:10人以下 1:10-20人 2:21-40人 3:41-100人 4:100人以上】 + private String scaleName; + //负责人 + private String personInCharge; + //联系电话 + private String mobile; + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/PlacePatrolRecordDetailResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/PlacePatrolRecordDetailResultDTO.java new file mode 100644 index 0000000000..93450c6cfa --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/PlacePatrolRecordDetailResultDTO.java @@ -0,0 +1,50 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author sun + * @Description 场所巡查记录详情 + **/ +@Data +public class PlacePatrolRecordDetailResultDTO implements Serializable { + //所属组织Id + private String agencyId; + //巡查Id + private String placePatrolRecordId; + //网格Id【场所区域】 + private String gridId; + //网格名称【场所区域】 + private String gridName; + //场所下的组织Id + private String placeOrgId; + //场所下的组织名称 + private String placeOrgName; + //场所类型【admin库sys_dict_data表九小场所value值】 + private String ninePlaceVal; + //场所类型名称 + private String ninePlaceName; + //场所下分队(place_patrolteam)表Id + private String placePatrolTeamId; + //场所下分队名称 + private String placePatrolTeamName; + //分队下检查人员Id,分号分隔 + private String inspectors; + //分队下检查人员名称 + private String inspectorsNames; + //首次巡查时间 + private String firstTime; + //隐患明细 + private String detailed; + //首次检查结果【0:合格 1:不合格】 + private String firstResult; + //拟复查时间 + private String reviewTime; + //最新结果【0:合格 1:不合格】 + private String finalResult; + //最新检查时间 + private String finalTime; + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/PlacePatrolReviewRecordDetailResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/PlacePatrolReviewRecordDetailResultDTO.java new file mode 100644 index 0000000000..47da9065f7 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/PlacePatrolReviewRecordDetailResultDTO.java @@ -0,0 +1,32 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author sun + * @Description 巡查复查记录详情 + **/ +@Data +public class PlacePatrolReviewRecordDetailResultDTO implements Serializable { + //复查记录Id + private String placePatrolReviewRecordId; + //巡查记录Id + private String placePatrolRecordId; + //分队id + private String placePatrolTeamId; + //分队名称 + private String placePatrolTeamName; + //检查人员Id,分号分隔 + private String inspectors; + //检查人员姓名,分号分隔 + private String inspectorsNames; + //复查时间 + private String reviewTime; + //复查隐患明细 + private String detailed; + //复查检查结果【0:合格 1:不合格】 + private String reviewResult; + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/PlacePatrolTeamDetailResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/PlacePatrolTeamDetailResultDTO.java new file mode 100644 index 0000000000..57ef081c5e --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/PlacePatrolTeamDetailResultDTO.java @@ -0,0 +1,39 @@ +package com.epmet.dto.result; + +import com.epmet.dto.IcPlacePatrolTeamStaffDTO; +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @Author sun + * @Description 九小场所巡查分队人员管理详情 + **/ +@Data +public class PlacePatrolTeamDetailResultDTO implements Serializable { + //分队Id + private String teamId; + //场所名称 + private String teamName; + //场所区域Id + private String gridIds; + //场所区域名称 + private String gridNames; + //场所类型名称[九小场所Value值] + private String ninePlaceVals; + //场所类型名称[九小场所名称] + private String ninePlaceNames; + //负责人 + private String personInCharge; + //联系电话 + private String mobile; + //监查计划 + private String plan; + //创建时间 + private String time; + //分队成员信息 + private List memberList = new ArrayList<>(); + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/UnitDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/UnitDTO.java new file mode 100644 index 0000000000..77b51dfca0 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/UnitDTO.java @@ -0,0 +1,18 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2021/10/25 15:04 + */ +@Data +public class UnitDTO implements Serializable { + private static final long serialVersionUID = -919268879670510057L; + private String unitId; + private String unitName; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/enums/BuildingTypeEnums.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/enums/BuildingTypeEnums.java new file mode 100644 index 0000000000..f1d636a571 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/enums/BuildingTypeEnums.java @@ -0,0 +1,57 @@ +package com.epmet.enums; + +import org.springframework.util.StringUtils; + +public enum BuildingTypeEnums { + SPF("1","商品房"), + ZJF("2","自建房"), + BS("3","别墅"); + + private String key; + private String value; + + BuildingTypeEnums(String key, String value) { + this.key = key; + this.value=value; + } + + + public static String getTypeValue(Object key){ + if(null == key){ + return null; + } + BuildingTypeEnums buildingTypeEnums = getBuildType(String.valueOf(key)); + return buildingTypeEnums == null ? null : buildingTypeEnums.getValue(); + } + + + public static String getKeyByValue(String value){ + if(StringUtils.isEmpty(value)){ + return ""; + } + for (BuildingTypeEnums e : BuildingTypeEnums.values()) { + if (e.getValue().equals(value)) { + return e.getKey(); + } + } + return ""; + } + + + private static BuildingTypeEnums getBuildType(String key) { + for (BuildingTypeEnums b :BuildingTypeEnums.values()) { + if (b.getKey().equals(key)) { + return b; + } + } + return null; + } + + public String getValue() { + return value; + } + + public String getKey() { + return key; + } +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/enums/HousePurposeEnums.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/enums/HousePurposeEnums.java new file mode 100644 index 0000000000..e1a2a14869 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/enums/HousePurposeEnums.java @@ -0,0 +1,59 @@ +package com.epmet.enums; + +import org.springframework.util.StringUtils; + +public enum HousePurposeEnums { + ZZ("1","住宅"), + SY("2","商业"), + BG("3","办公"), + GY("4","工业"), + CC("5","仓储"), + SZHY("6","商住混用"), + QT("7","其他"); + + + private String key; + private String value; + + HousePurposeEnums(String key, String value) { + this.key = key; + this.value=value; + } + + public static String getKeyByValue(String value){ + if(StringUtils.isEmpty(value)){ + return ""; + } + for (HousePurposeEnums e : HousePurposeEnums.values()) { + if (e.getValue().equals(value)) { + return e.getKey(); + } + } + return ""; + } + + public static String getTypeValue(Object key){ + if(null == key){ + return null; + } + HousePurposeEnums buildingTypeEnums = getValueByKey(String.valueOf(key)); + return buildingTypeEnums == null ? null : buildingTypeEnums.getValue(); + } + + private static HousePurposeEnums getValueByKey(String key) { + for (HousePurposeEnums b : HousePurposeEnums.values()) { + if (b.getKey().equals(key)) { + return b; + } + } + return null; + } + + public String getValue() { + return value; + } + + public String getKey() { + return key; + } +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/enums/HouseRentFlagEnums.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/enums/HouseRentFlagEnums.java new file mode 100644 index 0000000000..618be0ea9a --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/enums/HouseRentFlagEnums.java @@ -0,0 +1,58 @@ +package com.epmet.enums; + +import org.springframework.util.StringUtils; + +public enum HouseRentFlagEnums { + YES(1,"是"), + NO(0,"否"); + + + + private Integer code; + private String name; + + + HouseRentFlagEnums(Integer code, String name) { + this.code = code; + this.name=name; + } + + + public static String getTypeValue(Object code){ + if(code == null){ + return null; + } + HouseRentFlagEnums houseRentFlagEnums = getByKey(Integer.parseInt(code.toString())); + return houseRentFlagEnums == null ? null : houseRentFlagEnums.getName(); + } + + private static HouseRentFlagEnums getByKey(Integer code) { + for (HouseRentFlagEnums e : HouseRentFlagEnums.values()) { + if (e.getCode().equals(code)) { + return e; + } + } + return null; + } + + public static Integer getCodeByName(String name){ + if(StringUtils.isEmpty(name)){ + return 0; + } + for (HouseRentFlagEnums e : HouseRentFlagEnums.values()) { + if (e.getName().equals(name)) { + return e.getCode(); + } + } + return 0; + } + + + public Integer getCode() { + return code; + } + + public String getName() { + return name; + } +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/enums/HouseTypeEnums.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/enums/HouseTypeEnums.java new file mode 100644 index 0000000000..821f3ccca7 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/enums/HouseTypeEnums.java @@ -0,0 +1,54 @@ +package com.epmet.enums; + +import org.springframework.util.StringUtils; + +public enum HouseTypeEnums { + SPF("1","楼房"), + ZJF("2","平房"), + BS("3","别墅"); + + private String key; + private String value; + + HouseTypeEnums(String key, String value) { + this.key = key; + this.value=value; + } + + public static String getKeyByValue(String value){ + if(StringUtils.isEmpty(value)){ + return ""; + } + for (HouseTypeEnums e : HouseTypeEnums.values()) { + if (e.getValue().equals(value)) { + return e.getKey(); + } + } + return ""; + } + + public static String getTypeValue(Object key){ + if(null == key){ + return null; + } + HouseTypeEnums buildingTypeEnums = getByKey(String.valueOf(key)); + return buildingTypeEnums == null ? null : buildingTypeEnums.getValue(); + } + + private static HouseTypeEnums getByKey(String key) { + for (HouseTypeEnums b : HouseTypeEnums.values()) { + if (b.getKey().equals(key)) { + return b; + } + } + return null; + } + + public String getValue() { + return value; + } + + public String getKey() { + return key; + } +} 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 39d15fb9a5..f09e1f6ccf 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 @@ -1,10 +1,9 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.dto.result.OptionResultDTO; import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.CustomerAgencyDTO; -import com.epmet.dto.CustomerGridDTO; -import com.epmet.dto.CustomerPartyBranchDTO; +import com.epmet.dto.*; import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.feign.fallback.GovOrgOpenFeignClientFallbackFactory; @@ -187,6 +186,17 @@ public interface GovOrgOpenFeignClient { @PostMapping(value = "/gov/org/customeragency/getStaffOrgList",consumes = MediaType.APPLICATION_JSON_VALUE) Result> getStaffOrgList(StaffOrgFormDTO staffOrgFormDTO); + /** + * @description 通过staffId查询跟组织列表 + * + * @param input + * @return + * @author wxz + * @date 2021.10.25 14:53:53 + */ + @PostMapping("/gov/org/customeragency/root-orglist-by-staffid") + Result> getStaffOrgListByStaffId(@RequestBody RootOrgListByStaffIdFormDTO input); + /** * @Description 查询一个网格下的所有工作人员 * @param gridIdFormDTO @@ -439,4 +449,113 @@ public interface GovOrgOpenFeignClient { */ @PostMapping("/gov/org/grid/getbaseinfo") Result getGridBaseInfoByGridId(CustomerGridFormDTO customerGridFormDTO); + + @PostMapping(value = "/gov/org/house/queryListHouseInfo",consumes = MediaType.APPLICATION_JSON_VALUE) + Result> queryListHouseInfo(@RequestBody Set houseIds); + + + + /** + * @Description 获取组织下网格选项 + * @Param formDTO + * @Return {@link Result>} + * @Author zhaoqifeng + * @Date 2021/10/26 14:02 + */ + @PostMapping("/gov/org/customergrid/gridoption") + Result> getGridOption(@RequestBody GridOptionFormDTO formDTO); + + /** + * 获取网格下支部小组 + * @Param formDTO + * @Return {@link Result>} + * @Author zhaoqifeng + * @Date 2021/10/27 9:58 + */ + @PostMapping("/gov/org/customerpartybranch/branchoption") + Result> getBranchOption(@RequestBody CustomerPartyBranchDTO formDTO); + + /** + * @Description 获取小区内的楼栋 + * @Param dto + * @Return {@link Result>} + * @Author zhaoqifeng + * @Date 2021/10/26 14:46 + */ + @PostMapping("/gov/org/icbuilding/buildingoption") + Result> getBuildingOptions(IcBuildingDTO dto); + + /** + * @Description 获取楼栋内单元 + * @Param dto + * @Return {@link Result>} + * @Author zhaoqifeng + * @Date 2021/10/26 14:46 + */ + @PostMapping("/gov/org/icbuildingunit/unitoption") + Result> getUnitOptions(IcBuildingUnitDTO dto); + + @PostMapping("/gov/org/ichouse/houseoption") + Result> getHouseOption(@RequestBody HouseFormDTO formDTO); + + /** + * @Description 获取网格下小区列表 + * @Param dto + * @Return {@link Result< List< OptionResultDTO>>} + * @Author zhaoqifeng + * @Date 2021/10/26 14:38 + */ + @PostMapping("/gov/org/icneighborhood/neighborhoodoption") + Result> getNeighborHoodOptions(IcNeighborHoodDTO dto); + + /** + * @Description 查询房屋信息 + * @param idCard + * @author zxc + * @date 2021/11/3 3:30 下午 + */ + @PostMapping("/gov/org/ichouse/selecthouseinfobyidcard") + Result> selectHouseInfoByIdCard(@RequestParam("idCard")String idCard); + + @GetMapping("/gov/org/ichouse/{id}") + Result get(@PathVariable("id") String id); + + @PostMapping("/gov/org/building/buildinglistbyids") + Result> buildingListByIds(@RequestBody List buildingIdList); + + @PostMapping("/gov/org/building/buildinglistbyidsPage/{pageNo}/{pageSize}") + Result buildinglistbyidsPage(@RequestBody List buildingIdList,@PathVariable("pageNo") Integer pageNo,@PathVariable("pageSize")Integer pageSize); + + @PostMapping("/gov/org/icneighborhood/getlistbyids") + Result> getListByIds(@RequestBody List ids); + + @GetMapping("/gov/org/customergrid/getGridIListByAgency/{agencyId}") + Result> getGridIListByAgency(@PathVariable("agencyId") String agencyId); + + /** + * @Description 查询下级agencyId + * @param orgId + * @author zxc + * @date 2021/12/9 4:42 下午 + */ + @PostMapping("/gov/org/agency/getsonagencyid") + Result> getSonAgencyId(@RequestParam("orgId")String orgId); + +// /icbuilding/{id}?id=demoData + + /** + * 根据ID查询楼栋信息 + * @param id + * @return + */ + @GetMapping("/gov/org/icbuilding/{id}") + Result getBuildingById(@PathVariable("id") String id); + + /** + * 通过ID查询小区信息 + * @param id + * @return + */ + @GetMapping("/gov/org/icneighborhood/{id}") + Result getIcNeighbordhoodById(@PathVariable("id") String id); } 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 306ea49022..f85e3471e6 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 @@ -1,11 +1,10 @@ package com.epmet.feign.fallback; import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.dto.result.OptionResultDTO; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.CustomerAgencyDTO; -import com.epmet.dto.CustomerGridDTO; -import com.epmet.dto.CustomerPartyBranchDTO; +import com.epmet.dto.*; import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.feign.GovOrgOpenFeignClient; @@ -113,6 +112,11 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient { return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getStaffOrgList", staffOrgFormDTO); } + @Override + public Result> getStaffOrgListByStaffId(RootOrgListByStaffIdFormDTO input) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getStaffOrgListByStaffId", input); + } + @Override public Result> getGridStaffs(CommonGridIdFormDTO gridIdFormDTO) { return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getGridStaffs", gridIdFormDTO); @@ -266,8 +270,87 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient { return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getGridBaseInfoByGridId", customerGridFormDTO); } + @Override + public Result> queryListHouseInfo(Set houseIds) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "queryListHouseInfo", houseIds); + } + + @Override + public Result> getGridOption(GridOptionFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getGridOption", formDTO); + } + + @Override + public Result> getBranchOption(CustomerPartyBranchDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getBranchOption", formDTO); + } + + @Override + public Result> getBuildingOptions(IcBuildingDTO dto) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getBuildingOptions", dto); + } + + @Override + public Result> getUnitOptions(IcBuildingUnitDTO dto) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getUnitOptions", dto); + } + + @Override + public Result> getHouseOption(HouseFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getHouseOption", formDTO); + } + + @Override + public Result> getNeighborHoodOptions(IcNeighborHoodDTO dto) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getNeighborHoodOptions", dto); + } + + @Override + public Result> selectHouseInfoByIdCard(String idCard) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "selectHouseInfoByIdCard", idCard); + } + + @Override + public Result get(String id) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "get", id); + } + + @Override + public Result> buildingListByIds(List buildingIdList) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "buildingListByIds", buildingIdList); + } + @Override + public Result buildinglistbyidsPage(List buildingIdList,Integer pageNo,Integer pageSize) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "buildinglistbyidsPage", buildingIdList,pageNo,pageSize); + } + + @Override + public Result> getListByIds(List ids) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getListByIds", ids); + } + + @Override + public Result> getGridIListByAgency(String agencyId) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getGridIListByAgency", agencyId); + } + + @Override + public Result> getSonAgencyId(String orgId) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getSonAgencyId", orgId); + } + @Override public Result selectPidsByGridId(String gridId) { return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "selectPidsByGridId", gridId); } + + @Override + public Result getBuildingById(String id) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getBuildingById", id); + } + + @Override + public Result getIcNeighbordhoodById(String id) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getIcNeighbordhoodById", id); + } } diff --git a/epmet-module/gov-org/gov-org-server/deploy/docker-compose-prod.yml b/epmet-module/gov-org/gov-org-server/deploy/docker-compose-prod.yml index a42028726b..256ac7b0e6 100644 --- a/epmet-module/gov-org/gov-org-server/deploy/docker-compose-prod.yml +++ b/epmet-module/gov-org/gov-org-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-org-server: container_name: gov-org-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/gov-org-server:0.3.97 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/gov-org-server:0.3.132 ports: - "8092:8092" network_mode: host # 使用现有网络 @@ -15,4 +15,4 @@ services: resources: limits: cpus: '0.1' - memory: 600M \ No newline at end of file + memory: 600M diff --git a/epmet-module/gov-org/gov-org-server/pom.xml b/epmet-module/gov-org/gov-org-server/pom.xml index 2bc10abf21..0177e4b4cd 100644 --- a/epmet-module/gov-org/gov-org-server/pom.xml +++ b/epmet-module/gov-org/gov-org-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.97 + 0.3.132 com.epmet gov-org @@ -107,6 +107,24 @@ 2.0.0 compile + + com.epmet + epmet-message-client + 2.0.0 + compile + + + com.epmet + oper-customize-client + 2.0.0 + compile + + + com.epmet + epmet-admin-client + 2.0.0 + compile + @@ -123,8 +141,19 @@ true + + org.apache.maven.plugins + maven-resources-plugin + + + xls + xlsx + + + + ${project.basedir}/src/main/java @@ -294,7 +323,7 @@ false - false + true true diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/PartyServiceCenterConstant.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/PartyServiceCenterConstant.java new file mode 100644 index 0000000000..ced0df2da5 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/PartyServiceCenterConstant.java @@ -0,0 +1,15 @@ +package com.epmet.constant; + +/** + * @Author zxc + * @DateTime 2021/11/22 9:29 上午 + * @DESC + */ +public interface PartyServiceCenterConstant { + + String ORG_TYPE_AGENCY = "agency"; + + String APPOINTMENT_STATUS_APPOINTING = "appointing"; + String APPOINTMENT_STATUS_CANCEL = "cancel"; + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java index a3695f6362..5651110c57 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java @@ -17,6 +17,7 @@ package com.epmet.controller; +import com.epmet.commons.rocketmq.messages.OrgOrStaffMQMsg; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.annotation.RequirePermission; import com.epmet.commons.tools.enums.RequirePermissionEnum; @@ -27,11 +28,10 @@ import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.constant.CustomerAgencyConstant; import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.form.*; -import com.epmet.dto.result.AddAgencyResultDTO; -import com.epmet.dto.result.AgencyListResultDTO; -import com.epmet.dto.result.AgencysResultDTO; -import com.epmet.dto.result.SubAgencyResultDTO; +import com.epmet.dto.result.*; import com.epmet.entity.CustomerAgencyEntity; +import com.epmet.feign.EpmetMessageOpenFeignClient; +import com.epmet.send.SendMqMsgUtil; import com.epmet.service.AgencyService; import com.epmet.service.CustomerAgencyService; import org.apache.commons.lang3.StringUtils; @@ -57,6 +57,8 @@ public class AgencyController { private AgencyService agencyService; @Autowired private CustomerAgencyService customerAgencyService; + @Autowired + private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; /** * @param formDTO @@ -100,7 +102,18 @@ public class AgencyController { } //当前客户下,同级组织中,组织名称不允许重复 customerAgencyService.checkAgencyName(formDTO.getAgencyName(),tokenDTO.getCustomerId(),null,formDTO.getParentAgencyId()); - return new Result().ok(agencyService.addAgencyV2(formDTO)); + AddAgencyResultDTO resultDTO = agencyService.addAgencyV2(formDTO); + + //2021-11-30 推送mq,数据同步到中介库 start + OrgOrStaffMQMsg mq = new OrgOrStaffMQMsg(); + mq.setCustomerId(tokenDTO.getCustomerId()); + mq.setOrgId(resultDTO.getAgencyId()); + mq.setOrgType("agency"); + mq.setType("agency_create"); + SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendOrgStaffMqMsg(mq); + //2021-11-30 end + + return new Result().ok(resultDTO); } /** @@ -114,6 +127,16 @@ public class AgencyController { String agencyId = agencyService.addRootAgency(form); HashMap resultMap = new HashMap<>(); resultMap.put("agencyId", agencyId); + + //2021-10-18 推送mq,数据同步到中介库 start + OrgOrStaffMQMsg mq = new OrgOrStaffMQMsg(); + mq.setCustomerId(form.getCustomerId()); + mq.setOrgId(agencyId); + mq.setOrgType("agency"); + mq.setType("agency_create"); + SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendOrgStaffMqMsg(mq); + //2021-10-18 end + return new Result>().ok(resultMap); } @@ -128,7 +151,18 @@ public class AgencyController { public Result editAgency(@LoginUser TokenDto tokenDTO, @RequestBody EditAgencyFormDTO formDTO) { formDTO.setUserId(tokenDTO.getUserId()); ValidatorUtils.validateEntity(formDTO, EditAgencyFormDTO.DefaultUserShowGroup.class, EditAgencyFormDTO.AddUserInternalGroup.class); - return agencyService.editAgency(formDTO); + Result result = agencyService.editAgency(formDTO); + + //2021-10-18 推送mq,数据同步到中介库 start【中介库只放了组织的名称、级别,所以涉及批量修改pname的操作不涉及同步中间库】 + OrgOrStaffMQMsg mq = new OrgOrStaffMQMsg(); + mq.setCustomerId(tokenDTO.getCustomerId()); + mq.setOrgId(formDTO.getAgencyId()); + mq.setOrgType("agency"); + mq.setType("agency_change"); + SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendOrgStaffMqMsg(mq); + //2021-10-18 end + + return result; } /** @@ -141,6 +175,7 @@ public class AgencyController { @RequirePermission(requirePermission = RequirePermissionEnum.ORG_SUBAGENCY_DELETE) public Result removeAgency(@LoginUser TokenDto tokenDTO, @RequestBody RemoveAgencyFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO); + formDTO.setCustomerId(tokenDTO.getCustomerId()); return agencyService.removeAgency(formDTO); } @@ -250,8 +285,79 @@ public class AgencyController { **/ @PostMapping("saverootagency") public Result saveRootAgency(@RequestBody AddAgencyAndStaffFormDTO agencyAndStaff) { - agencyService.saveRootAgency(agencyAndStaff); + String agencyId = agencyService.saveRootAgency(agencyAndStaff); + + //2021-10-18 推送mq,数据同步到中介库 start + OrgOrStaffMQMsg mq = new OrgOrStaffMQMsg(); + mq.setCustomerId(agencyAndStaff.getAgencyDTO().getCustomerId()); + mq.setOrgId(agencyId); + mq.setOrgType("agency"); + mq.setType("agency_create"); + SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendOrgStaffMqMsg(mq); + //2021-10-18 end + return new Result(); } + /** + * @Description 【地图配置】删除 + * @param formDTO + * @author zxc + * @date 2021/10/25 9:30 上午 + */ + @PostMapping("mapdelarea") + public Result mapDelArea(@RequestBody MapDelAreaFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, MapDelAreaFormDTO.MapDelAreaForm.class); + agencyService.mapDelArea(formDTO); + return new Result(); + } + + /** + * @Description 【地图配置】新增 + * @param formDTO + * @author zxc + * @date 2021/10/25 9:58 上午 + */ + @PostMapping("mapaddarea") + public Result mapAddArea(@RequestBody MapAddAreaFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, MapAddAreaFormDTO.MapAddAreaForm.class); + agencyService.mapAddArea(formDTO); + return new Result(); + } + + /** + * @Description 【地图配置】组织查询 + * @param formDTO + * @param tokenDto + * @author zxc + * @date 2021/10/25 10:50 上午 + */ + @PostMapping("maporg") + public Result mapOrg(@RequestBody MapOrgFormDTO formDTO, @LoginUser TokenDto tokenDto){ + return new Result().ok(agencyService.mapOrg(formDTO,tokenDto)); + } + + /** + * @Description 查询楼栋信息 + * @param formDTO + * @author zxc + * @date 2021/11/2 9:18 上午 + */ + @PostMapping("baseinfofamilybuilding") + public Result> baseInfoFamilyBuilding(@RequestBody BaseInfoFamilyBuildingFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, BaseInfoFamilyBuildingFormDTO.BaseInfoFamilyBuildingForm.class); + return new Result>().ok(agencyService.baseInfoFamilyBuilding(formDTO)); + } + + /** + * @Description 查询下级agencyId + * @param orgId + * @author zxc + * @date 2021/12/9 4:42 下午 + */ + @PostMapping("getsonagencyid") + public Result> getSonAgencyId(@RequestParam("orgId")String orgId){ + return new Result>().ok(agencyService.getSonAgencyId(orgId)); + } + } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/BuildingController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/BuildingController.java new file mode 100644 index 0000000000..98b5d1233e --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/BuildingController.java @@ -0,0 +1,247 @@ +/** + * 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.controller; + +import cn.afterturn.easypoi.excel.entity.TemplateExportParams; +import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.constant.NumConstant; +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.dao.IcBuildingUnitDao; +import com.epmet.dto.BuildingTreeLevelDTO; +import com.epmet.dto.form.IcBulidingFormDTO; +import com.epmet.dto.form.IcBulidingUnitFormDTO; +import com.epmet.dto.form.ListIcNeighborHoodFormDTO; +import com.epmet.dto.result.BuildingResultDTO; +import com.epmet.dto.result.BuildingResultPagedDTO; +import com.epmet.dto.result.IcNeighborHoodResultDTO; +import com.epmet.entity.IcBuildingUnitEntity; +import com.epmet.excel.IcBuildingExcel; +import com.epmet.service.BuildingService; +import com.epmet.service.IcBuildingService; +import com.epmet.service.NeighborHoodService; +import com.epmet.util.ExcelPoiUtils; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.CollectionUtils; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.*; +import java.util.stream.Collectors; + + +/** + * 楼栋信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +@Slf4j +@RestController +@RequestMapping("building") +public class BuildingController { + + + @Autowired + private NeighborHoodService neighborHoodService; + + @Autowired + private IcBuildingService icBuildingService; + @Autowired + private BuildingService buildingService; + @Autowired + private IcBuildingUnitDao icBuildingUnitDao; + + + + @PostMapping("buildinglist") + public Result houseList(@RequestBody ListIcNeighborHoodFormDTO formDTO){ + //效验数据 + ValidatorUtils.validateEntity(formDTO); + IcNeighborHoodResultDTO icNeighborHoodResultDTO = buildingService.listBuilding(formDTO); + return new Result().ok(icNeighborHoodResultDTO); + + } + + @NoRepeatSubmit + @PostMapping("buildingadd") + public Result buildingAdd(@LoginUser TokenDto tokenDTO, @RequestBody IcBulidingFormDTO formDTO){ + //效验数据 + ValidatorUtils.validateEntity(formDTO, IcBulidingFormDTO.AddShowGroup.class); + String customerId = tokenDTO.getCustomerId(); +// String customerId = "123123"; + + buildingService.AddBuilding(customerId,formDTO); + return new Result().ok("保存成功"); + } + + @NoRepeatSubmit + @PostMapping("buildingupdate") + public Result buildingUpdate(@LoginUser TokenDto tokenDTO, @RequestBody IcBulidingFormDTO formDTO){ + //效验数据 + ValidatorUtils.validateEntity(formDTO, IcBulidingFormDTO.UpdateShowGroup.class); + String customerId = tokenDTO.getCustomerId(); +// String customerId = "123123"; + buildingService.UpdateBuilding(customerId,formDTO); + return new Result().ok("修改成功"); + } + + @PostMapping("buildingdel") + public Result buildingDel(@LoginUser TokenDto tokenDTO, @RequestBody IcBulidingFormDTO formDTO){ + //效验数据 + ValidatorUtils.validateEntity(formDTO, IcBulidingFormDTO.DeleteGroup.class); + String buildingId = formDTO.getBuildingId(); + buildingService.DelBuilding(buildingId); + return new Result(); + } + + @PostMapping("treelist") + public Result treeList(@LoginUser TokenDto tokenDTO){ + List buildingTreeLevelDTOS =buildingService.treeList(tokenDTO.getUserId()); + return new Result().ok(buildingTreeLevelDTOS); + } + /** + * 导出模板 + * @param response + * @throws Exception + */ + @PostMapping("exporttemplate") + public void exportTemplate( HttpServletResponse response) throws Exception { + + TemplateExportParams templatePath = new TemplateExportParams("excel/building_template.xlsx"); + Map map = new HashMap<>(); + map.put("maplist",new ArrayList()); + ExcelPoiUtils.exportExcel(templatePath ,map,"楼宇信息录入表",response); + + } + /** + * 导出 + * @param formDTO + * @param response + * @throws Exception + */ + @RequestMapping("exportbuildinginfo") + public void exportbuildinginfo(@RequestBody ListIcNeighborHoodFormDTO formDTO, HttpServletResponse response) throws Exception { + ValidatorUtils.validateEntity(formDTO); + buildingService.exportBuildinginfo(formDTO,response); + + } + + /** + * 导出 + * @param formDTO + * @param response + * @throws Exception + */ + @GetMapping("export") + public void export(HttpServletResponse response) throws Exception { + ListIcNeighborHoodFormDTO formDTO = new ListIcNeighborHoodFormDTO(); + ValidatorUtils.validateEntity(formDTO); + buildingService.exportBuildinginfo(formDTO,response); + + } + + + /** + * 导入数据 + * @param file + * @return + * @throws IOException + */ + @PostMapping("import") + public Result importExcel(@LoginUser TokenDto tokenDTO, @RequestParam("file") MultipartFile file) throws IOException { + String customerId = tokenDTO.getCustomerId(); +// String customerId = "123123"; + + ExcelImportResult importResult = ExcelPoiUtils.importExcelMore(file, 0, 1, IcBuildingExcel.class); + + List failList = importResult.getFailList(); + + //存放错误数据行号 + List numList = new ArrayList<>(); + if(!CollectionUtils.isEmpty(failList)){ + for ( IcBuildingExcel entity : failList) { + log.error("第{}行,{}",entity.getRowNum(),entity.getErrorMsg());//打印失败的行 和失败的信息 + numList.add(entity.getRowNum()); + } + //return new Result().error(8001,failList.get(0).getErrorMsg()); + } + List result =importResult.getList(); + List resultList = buildingService.importExcel(customerId,result,tokenDTO.getUserId(),numList); + String str = String.format("共%s条,成功导入%s条。",numList.size()+result.size(),numList.size()+result.size()-resultList.size()); + if(resultList.size()> NumConstant.ZERO){ + Collections.sort(resultList); + String subList = resultList.stream().map(String::valueOf).collect(Collectors.joining("、")); + log.warn(str + "第" + subList + "行未成功!"); + return new Result().error(9999, str+"第"+subList+"行未成功!"); + } + return new Result().ok(str); + } + + /** + * 查看楼宇单元列表 + * @param tokenDTO + * @return + * @throws IOException + */ + @PostMapping("buildingunitlist") + public Result buildingunitlist(@LoginUser TokenDto tokenDTO,@RequestBody IcBulidingUnitFormDTO icBulidingUnitFormDTO ){ + ValidatorUtils.validateEntity(icBulidingUnitFormDTO); + List icBuildingUnitEntityList = icBuildingUnitDao.selectList(new QueryWrapper().lambda().eq(IcBuildingUnitEntity::getBuildingId, icBulidingUnitFormDTO.getBuildingId()).orderByAsc(IcBuildingUnitEntity::getUnitNum)); + List result = new ArrayList<>(); + icBuildingUnitEntityList.forEach(item->{ + JSONObject jsonObject = new JSONObject(); + jsonObject.put("id",item.getId()); + jsonObject.put("unitName",item.getUnitName()); + jsonObject.put("unitNum",item.getUnitNum()); + result.add(jsonObject); + }); + return new Result().ok(result); + } + + + @PostMapping("buildinglistbyids") + public Result> buildingListByIds(@RequestBody List buildingIdList){ + if(CollectionUtils.isEmpty(buildingIdList)){ + return new Result(); + } + List result = buildingService.buildingListByIds(buildingIdList); + return new Result>().ok(result); + + } + + @PostMapping("buildinglistbyidsPage/{pageNo}/{pageSize}") + public Result buildinglistbyidsPage(@RequestBody List buildingIdList, @PathVariable("pageNo") Integer pageNo, @PathVariable("pageSize") Integer pageSize){ + if(CollectionUtils.isEmpty(buildingIdList)){ + return new Result(); + } + return new Result().ok(buildingService.buildinglistbyidsPage(buildingIdList,pageNo,pageSize)); + + } + + + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java index c3937127ba..183b6f81f5 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java @@ -325,7 +325,7 @@ public class CustomerAgencyController { } /** - * @Description 获取客户下组织树 + * @Description 获取客户下组织树不含网格和部门 * @Param tokenDTO * @Return {@link Result< AgencyTreeResultDTO >} * @Author zhaoqifeng @@ -339,4 +339,34 @@ public class CustomerAgencyController { return new Result().ok(customerAgencyService.getAgencyList(formDTO)); } -} \ No newline at end of file + /** + * @description 通过staffId查询跟组织列表 + * + * @param input + * @return + * @author wxz + * @date 2021.10.25 14:53:53 + */ + @PostMapping("root-orglist-by-staffid") + public Result> getStaffOrgListByStaffId(@RequestBody RootOrgListByStaffIdFormDTO input) { + + ValidatorUtils.validateEntity(input); + String staffId = input.getStaffId(); + + List orgList = customerAgencyService.getStaffOrgListByStaffId(staffId); + return new Result>().ok(orgList); + } + + /** + * @Description 获取当前登陆人的 所属组织及下级组织/网格(含直属网格)树 + * @Param tokenDTO + * @Return {@link Result< AgencyTreeResultDTO >} + * @Author zhaoqifeng + * @Date 2021/9/8 15:20 + */ + @PostMapping("agencygridtree") + public Result getOrgTreeData(@LoginUser TokenDto tokenDTO) { + return new Result().ok(customerAgencyService.getOrgTreeData(tokenDTO.getUserId())); + } + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java index c765a58962..8422de2c41 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java @@ -17,6 +17,7 @@ package com.epmet.controller; +import com.epmet.commons.tools.dto.result.OptionResultDTO; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.Result; @@ -102,6 +103,7 @@ public class CustomerGridController { */ @PostMapping("getcustomergridbygridid") public Result getCustomerGridByGridId(@RequestBody CustomerGridFormDTO customerGridFormDTO) { + ValidatorUtils.validateEntity(customerGridFormDTO, CustomerGridFormDTO.Grid.class); return customerGridService.getCustomerGridByGridId(customerGridFormDTO); } @@ -286,4 +288,35 @@ public class CustomerGridController { return new Result>().ok(customerGridService.selectOrgsByUserId(userId)); } + /** + * @Description 获取组织下网格选项 + * 居民信息:1)查询条件 :所属网格下拉框;2)查看详情:所属网格下拉框 + * label: 社区-网格 + * value: 网格id + * @Param formDTO + * @Return {@link Result>} + * @Author zhaoqifeng + * @Date 2021/10/26 14:02 + */ + @PostMapping("gridoption") + public Result> getGridOption(@RequestBody GridOptionFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO); + return new Result>().ok(customerGridService.getGridOption(formDTO.getAgencyId(),formDTO.getPurpose())); + } + + @GetMapping("getGridIListByAgency/{agencyId}") + public Result> getGridIListByAgency(@PathVariable("agencyId") String agencyId) { + List resultDTOS = customerGridService.getGridIListByAgency(agencyId); + return new Result>().ok(resultDTOS); + } + + /** + * @Author sun + * @Description 查询组织直属网格列表 + **/ + @PostMapping("getgridilistbyagency/{agencyId}") + public Result> gridListByAgencyId(@PathVariable("agencyId") String agencyId) { + return new Result>().ok(customerGridService.gridListByAgencyId(agencyId)); + } + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerPartyBranchController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerPartyBranchController.java index 04ebd8e0a0..2a5997aa34 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerPartyBranchController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerPartyBranchController.java @@ -17,6 +17,8 @@ package com.epmet.controller; +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.dto.result.OptionResultDTO; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; @@ -49,7 +51,7 @@ import java.util.Map; @RestController @RequestMapping("customerpartybranch") public class CustomerPartyBranchController { - + @Autowired private CustomerPartyBranchService customerPartyBranchService; @@ -65,6 +67,7 @@ public class CustomerPartyBranchController { return new Result().ok(data); } + @NoRepeatSubmit @PostMapping("save") public Result save(@RequestBody CustomerPartyBranchDTO dto){ //效验数据 @@ -129,4 +132,16 @@ public class CustomerPartyBranchController { customerPartyBranchService.decrPartyBranchMember(partyBranchId); return new Result(); } -} \ No newline at end of file + + /** + * 获取网格下支部小组 + * @Param formDTO + * @Return {@link Result>} + * @Author zhaoqifeng + * @Date 2021/10/27 9:58 + */ + @PostMapping("branchoption") + public Result> getBranchOption(@RequestBody CustomerPartyBranchDTO formDTO){ + return new Result>().ok(customerPartyBranchService.getBranchOption(formDTO.getGridId())); + } +} 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 ce24000220..7f38a198cf 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 @@ -1,5 +1,6 @@ package com.epmet.controller; +import com.epmet.commons.rocketmq.messages.OrgOrStaffMQMsg; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.annotation.RequirePermission; import com.epmet.commons.tools.enums.RequirePermissionEnum; @@ -9,6 +10,8 @@ import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.*; +import com.epmet.feign.EpmetMessageOpenFeignClient; +import com.epmet.send.SendMqMsgUtil; import com.epmet.service.CustomerGridService; import com.epmet.service.CustomerStaffAgencyService; import org.springframework.beans.factory.annotation.Autowired; @@ -28,6 +31,8 @@ public class GridController { private CustomerGridService customerGridService; @Autowired private CustomerStaffAgencyService customerStaffAgencyService; + @Autowired + private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; /** * 获取网格详情 @@ -47,8 +52,18 @@ public class GridController { @RequirePermission(requirePermission = RequirePermissionEnum.ORG_GRID_CREATE) public Result addGrid(@LoginUser TokenDto tokenDto, @RequestBody AddGridFormDTO addGridFormDTO){ ValidatorUtils.validateEntity(addGridFormDTO, AddGridFormDTO.AddGrid.class); - return customerGridService.addGrid(tokenDto,addGridFormDTO); - + Result resultDTOResult = customerGridService.addGrid(tokenDto,addGridFormDTO); + + //2021-10-18 推送mq,数据同步到中介库 start + OrgOrStaffMQMsg mq = new OrgOrStaffMQMsg(); + mq.setCustomerId(tokenDto.getCustomerId()); + mq.setOrgId(resultDTOResult.getData().getGridId()); + mq.setOrgType("grid"); + mq.setType("grid_create"); + SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendOrgStaffMqMsg(mq); + //2021-10-18 end + + return resultDTOResult; } /** @@ -58,8 +73,19 @@ public class GridController { @RequirePermission(requirePermission = RequirePermissionEnum.ORG_GRID_UPDATE) public Result editGrid(@LoginUser TokenDto tokenDto, @RequestBody EditGridFormDTO editGridFormDTO){ ValidatorUtils.validateEntity(editGridFormDTO, EditGridFormDTO.EditGrid.class); - return customerGridService.editGrid(tokenDto,editGridFormDTO); - + editGridFormDTO.setCustomerId(tokenDto.getCustomerId()); + Result result = customerGridService.editGrid(tokenDto,editGridFormDTO); + + //2021-10-18 推送mq,数据同步到中介库 start + OrgOrStaffMQMsg mq = new OrgOrStaffMQMsg(); + mq.setCustomerId(tokenDto.getCustomerId()); + mq.setOrgId(editGridFormDTO.getGridId()); + mq.setOrgType("grid"); + mq.setType("grid_change"); + SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendOrgStaffMqMsg(mq); + //2021-10-18 end + + return result; } /** @@ -68,6 +94,7 @@ public class GridController { @PostMapping("deletegrid") @RequirePermission(requirePermission = RequirePermissionEnum.ORG_GRID_DELETE) public Result deleteGrid(@LoginUser TokenDto tokenDto, @RequestBody DeleteGridFormDTO deleteGridFormDTO){ + deleteGridFormDTO.setCustomerId(tokenDto.getCustomerId()); return customerGridService.deleteGrid(tokenDto,deleteGridFormDTO); } @@ -101,6 +128,13 @@ public class GridController { return customerGridService.getAllGridsByAgency(agencyFormDTO); } + @PostMapping("allgridsnopermission") + public Result> allGridsNoPermission(@LoginUser TokenDto tokenDto, @RequestBody CommonAgencyIdFormDTO agencyFormDTO){ + agencyFormDTO.setUserId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(agencyFormDTO); + return customerGridService.getAllGridsByAgency(agencyFormDTO); + } + /** * @Description 在给网格添加工作人员时,查询当前机关下没有加入到此网格下的工作人员,禁用的也不能选(不显示) * @Param CommonGridIdFormDTO @@ -182,4 +216,10 @@ public class GridController { CustomerGridDTO gridInfo = customerGridService.getBaseInfo(customerGridFormDTO); return new Result().ok(gridInfo); } + + @PostMapping("gridtree") + public Result> getGridTree(@RequestBody AgencyIdFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + return new Result>().ok(customerGridService.getGridTree(formDTO)); + } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java new file mode 100644 index 0000000000..ab0b6c646f --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java @@ -0,0 +1,176 @@ +/** + * 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.controller; + +import cn.afterturn.easypoi.excel.entity.TemplateExportParams; +import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult; +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.constant.NumConstant; +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.dto.form.IcHouseFormDTO; +import com.epmet.dto.form.IcNeighborHoodFormDTO; +import com.epmet.dto.form.ListIcNeighborHoodFormDTO; +import com.epmet.dto.result.HouseInfoDTO; +import com.epmet.dto.result.IcNeighborHoodResultDTO; +import com.epmet.excel.IcHouseExcel; +import com.epmet.service.HouseService; +import com.epmet.service.NeighborHoodService; +import com.epmet.util.ExcelPoiUtils; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.CollectionUtils; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.*; +import java.util.stream.Collectors; + + +/** + * 房屋表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +@Slf4j +@RestController +@RequestMapping("house") +public class HouseController { + + + @Autowired + private NeighborHoodService neighborHoodService; + + @Autowired + private HouseService houseService; + + + @PostMapping("houselist") + public Result houseList(@RequestBody ListIcNeighborHoodFormDTO formDTO){ + //效验数据 + ValidatorUtils.validateEntity(formDTO); + IcNeighborHoodResultDTO icNeighborHoodResultDTO = houseService.listNeighborhood(formDTO); + return new Result().ok(icNeighborHoodResultDTO); + + } + + @NoRepeatSubmit + @PostMapping("houseadd") + public Result houseAdd(@LoginUser TokenDto tokenDTO, @RequestBody IcHouseFormDTO formDTO){ + //效验数据 + ValidatorUtils.validateEntity(formDTO, IcHouseFormDTO.AddShowGroup.class); + String customerId = tokenDTO.getCustomerId(); +// String customerId = "123123"; + + houseService.addHouse(customerId,formDTO); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("houseupdate") + public Result houseUpdate(@LoginUser TokenDto tokenDTO, @RequestBody IcHouseFormDTO formDTO){ + //效验数据 + ValidatorUtils.validateEntity(formDTO, IcHouseFormDTO.UpdateShowGroup.class); + String customerId = tokenDTO.getCustomerId(); +// String customerId = "123123"; + houseService.updateHouse(customerId,formDTO); + return new Result(); + } + + @PostMapping("housedel") + public Result houseDel(@LoginUser TokenDto tokenDTO, @RequestBody IcHouseFormDTO formDTO){ + //效验数据 + ValidatorUtils.validateEntity(formDTO, IcNeighborHoodFormDTO.DeleteGroup.class); + houseService.delHouse(formDTO.getHouseId()); + return new Result(); + } + /** + * 导出模板 + * @param response + * @throws Exception + */ + @PostMapping("exporttemplate") + public void exportTemplate(HttpServletResponse response) throws Exception { +// ValidatorUtils.validateEntity(ListIcNeighborHoodFormDTO.class); + TemplateExportParams templatePath = new TemplateExportParams("excel/house_template.xlsx"); + Map map = new HashMap<>(); + map.put("maplist",new ArrayList()); + ExcelPoiUtils.exportExcel(templatePath ,map,"房屋信息录入表",response); + + } + /** + * 导出 + * @param formDTO + * @param response + * @throws Exception + */ + @RequestMapping("exporthouseinfo") + public void exporthouseinfo(@RequestBody ListIcNeighborHoodFormDTO formDTO, HttpServletResponse response) throws Exception { + ValidatorUtils.validateEntity(formDTO); + houseService.exportBuildinginfo(formDTO,response); + + } + + /** + * 导入数据 + * @param file + * @return + * @throws IOException + */ + @PostMapping("import") + public Result importExcel(@LoginUser TokenDto tokenDTO, @RequestParam("file") MultipartFile file) throws IOException { + + String customerId = tokenDTO.getCustomerId(); +// String customerId = "123123"; + + ExcelImportResult importResult = ExcelPoiUtils.importExcelMore(file, 0, 1, IcHouseExcel.class); + + List failList = importResult.getFailList(); + + //存放错误数据行号 + List numList = new ArrayList<>(); + if(!CollectionUtils.isEmpty(failList)){ + for ( IcHouseExcel entity : failList) { + log.error("第{}行,{}",entity.getRowNum(),entity.getErrorMsg());//打印失败的行 和失败的信息 + numList.add(entity.getRowNum()); + } + //return new Result().error(8001,failList.get(0).getErrorMsg()); + } + List result =importResult.getList(); + + List resultList = houseService.importExcel(customerId,result,tokenDTO.getUserId(),numList); + String str = String.format("共%s条,成功导入%s条。",numList.size()+result.size(),numList.size()+result.size()-resultList.size()); + if(resultList.size()> NumConstant.ZERO){ + Collections.sort(resultList); + String subList = resultList.stream().map(String::valueOf).collect(Collectors.joining("、")); + log.warn(str + "第" + subList + "行未成功!"); + return new Result().error(9999, str+"第"+subList+"行未成功!"); + } + return new Result().ok(str); + } + + @PostMapping( "queryListHouseInfo") + Result> queryListHouseInfo(@RequestBody Set houseIds){ + return new Result>().ok(houseService.queryListHouseInfo(houseIds)); + } +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcBuildingController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcBuildingController.java new file mode 100644 index 0000000000..15ba83ef46 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcBuildingController.java @@ -0,0 +1,97 @@ +/** + * 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.controller; + +import com.epmet.commons.tools.dto.result.OptionResultDTO; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.IcBuildingDTO; +import com.epmet.service.IcBuildingService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.Map; + + +/** + * 楼栋信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +@RestController +@RequestMapping("icbuilding") +public class IcBuildingController { + + @Autowired + private IcBuildingService icBuildingService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = icBuildingService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + IcBuildingDTO data = icBuildingService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody IcBuildingDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icBuildingService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody IcBuildingDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icBuildingService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + icBuildingService.delete(ids); + return new Result(); + } + + /** + * @Description 获取小区内的楼栋 + * @Param dto + * @Return {@link Result>} + * @Author zhaoqifeng + * @Date 2021/10/26 14:46 + */ + @PostMapping("buildingoption") + public Result> getBuildingOptions(@RequestBody IcBuildingDTO dto) { + return new Result>().ok(icBuildingService.getBuildingOptions(dto.getNeighborHoodId())); + } +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcBuildingUnitController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcBuildingUnitController.java new file mode 100644 index 0000000000..7ee2138893 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcBuildingUnitController.java @@ -0,0 +1,96 @@ +/** + * 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.controller; + +import com.epmet.commons.tools.dto.result.OptionResultDTO; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.IcBuildingUnitDTO; +import com.epmet.service.IcBuildingUnitService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.Map; + + +/** + * 楼栋单元信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +@RestController +@RequestMapping("icbuildingunit") +public class IcBuildingUnitController { + + @Autowired + private IcBuildingUnitService icBuildingUnitService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = icBuildingUnitService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + IcBuildingUnitDTO data = icBuildingUnitService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody IcBuildingUnitDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icBuildingUnitService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody IcBuildingUnitDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icBuildingUnitService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + icBuildingUnitService.delete(ids); + return new Result(); + } + /** + * @Description 获取楼栋内单元 + * @Param dto + * @Return {@link Result>} + * @Author zhaoqifeng + * @Date 2021/10/26 14:46 + */ + @PostMapping("unitoption") + public Result> getUnitOptions(@RequestBody IcBuildingUnitDTO dto) { + return new Result>().ok(icBuildingUnitService.getUnitOptions(dto.getBuildingId())); + } +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcHouseController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcHouseController.java new file mode 100644 index 0000000000..2409edaad0 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcHouseController.java @@ -0,0 +1,117 @@ +/** + * 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.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.dto.result.OptionResultDTO; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.IcHouseDTO; +import com.epmet.dto.form.HouseFormDTO; +import com.epmet.dto.result.HouseListResultDTO; +import com.epmet.service.IcHouseService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.Map; + + +/** + * 房屋信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +@RestController +@RequestMapping("ichouse") +public class IcHouseController { + + @Autowired + private IcHouseService icHouseService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = icHouseService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + IcHouseDTO data = icHouseService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody IcHouseDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icHouseService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody IcHouseDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icHouseService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + icHouseService.delete(ids); + return new Result(); + } + @PostMapping("houseoption") + public Result> getHouseOption(@RequestBody HouseFormDTO formDTO){ + return new Result>().ok(icHouseService.getHouseOption(formDTO)); + } + + /** + * @Description 查询房屋信息 + * @param idCard + * @author zxc + * @date 2021/11/3 3:30 下午 + */ + @PostMapping("selecthouseinfobyidcard") + public Result> selectHouseInfoByIdCard(@RequestParam("idCard")String idCard){ + return new Result>().ok(icHouseService.selectHouseInfoByIdCard(idCard)); + } + + /** + * @Description 房屋查询 + * @Param formDTO + * @Return {@link Result< List< HouseListResultDTO>>} + * @Author zhaoqifeng + * @Date 2021/11/5 16:01 + */ + @PostMapping("houselist") + public Result> getHouseList(@LoginUser TokenDto tokenDto, @RequestBody HouseFormDTO formDTO){ + return new Result>().ok(icHouseService.getHouseList(tokenDto, formDTO)); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcMatterAppointmentRecordController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcMatterAppointmentRecordController.java new file mode 100644 index 0000000000..848ab27ceb --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcMatterAppointmentRecordController.java @@ -0,0 +1,94 @@ +/** + * 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.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.IcMatterAppointmentRecordDTO; +import com.epmet.excel.IcMatterAppointmentRecordExcel; +import com.epmet.service.IcMatterAppointmentRecordService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 事项预约记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@RestController +@RequestMapping("icmatterappointmentrecord") +public class IcMatterAppointmentRecordController { + + @Autowired + private IcMatterAppointmentRecordService icMatterAppointmentRecordService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = icMatterAppointmentRecordService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + IcMatterAppointmentRecordDTO data = icMatterAppointmentRecordService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody IcMatterAppointmentRecordDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icMatterAppointmentRecordService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody IcMatterAppointmentRecordDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icMatterAppointmentRecordService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + icMatterAppointmentRecordService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = icMatterAppointmentRecordService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, IcMatterAppointmentRecordExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcNeighborHoodController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcNeighborHoodController.java new file mode 100644 index 0000000000..fcd64c4658 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcNeighborHoodController.java @@ -0,0 +1,112 @@ +/** + * 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.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.dto.result.OptionResultDTO; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.IcNeighborHoodDTO; +import com.epmet.service.IcNeighborHoodService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.Map; + + +/** + * 小区表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +@RestController +@RequestMapping("icneighborhood") +public class IcNeighborHoodController { + + @Autowired + private IcNeighborHoodService icNeighborHoodService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = icNeighborHoodService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + IcNeighborHoodDTO data = icNeighborHoodService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody IcNeighborHoodDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icNeighborHoodService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody IcNeighborHoodDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icNeighborHoodService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + icNeighborHoodService.delete(ids); + return new Result(); + } + + /** + * @Description 获取网格下小区列表 + * @Param dto + * @Return {@link Result< List< OptionResultDTO>>} + * @Author zhaoqifeng + * @Date 2021/10/26 14:38 + */ + @PostMapping("neighborhoodoption") + public Result> getNeighborHoodOptions(@LoginUser TokenDto tokenDto, @RequestBody IcNeighborHoodDTO dto) { + return new Result>().ok(icNeighborHoodService.getNeighborHoodOptions(dto.getAgencyId(), dto.getGridId(),tokenDto.getUserId(),tokenDto.getCustomerId())); + } + + /** + * @Description 通过ID查询小区信息 + * @Param ids + * @Return {@link Result< List< IcNeighborHoodDTO>>} + * @Author zhaoqifeng + * @Date 2021/11/8 10:46 + */ + @PostMapping("getlistbyids") + public Result> getListByIds(@RequestBody List ids) { + return new Result>().ok(icNeighborHoodService.getListByIds(ids)); + } + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcNeighborHoodPartController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcNeighborHoodPartController.java new file mode 100644 index 0000000000..1059863233 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcNeighborHoodPartController.java @@ -0,0 +1,84 @@ +/** + * 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.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.IcNeighborHoodPartDTO; +import com.epmet.service.IcNeighborHoodPartService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Map; + + +/** + * 小区-分区表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +@RestController +@RequestMapping("icneighborhoodpart") +public class IcNeighborHoodPartController { + + @Autowired + private IcNeighborHoodPartService icNeighborHoodPartService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = icNeighborHoodPartService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + IcNeighborHoodPartDTO data = icNeighborHoodPartService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody IcNeighborHoodPartDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icNeighborHoodPartService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody IcNeighborHoodPartDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icNeighborHoodPartService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + icNeighborHoodPartService.delete(ids); + return new Result(); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcNeighborHoodPropertyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcNeighborHoodPropertyController.java new file mode 100644 index 0000000000..e5d0e61093 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcNeighborHoodPropertyController.java @@ -0,0 +1,85 @@ +/** + * 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.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.IcNeighborHoodPropertyDTO; +import com.epmet.service.IcNeighborHoodPropertyService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Map; + + +/** + * 小区物业关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +@RestController +@RequestMapping("icneighborhoodproperty") +public class IcNeighborHoodPropertyController { + + @Autowired + private IcNeighborHoodPropertyService icNeighborHoodPropertyService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = icNeighborHoodPropertyService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + IcNeighborHoodPropertyDTO data = icNeighborHoodPropertyService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody IcNeighborHoodPropertyDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icNeighborHoodPropertyService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody IcNeighborHoodPropertyDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icNeighborHoodPropertyService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + icNeighborHoodPropertyService.delete(ids); + return new Result(); + } + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPartyServiceCenterController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPartyServiceCenterController.java new file mode 100644 index 0000000000..a948681219 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPartyServiceCenterController.java @@ -0,0 +1,207 @@ +/** + * 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.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.IcPartyServiceCenterDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.result.AppointmentRecordResultDTO; +import com.epmet.dto.result.AppointmentTimeResultDTO; +import com.epmet.dto.result.PartyServiceCenterListResultDTO; +import com.epmet.excel.IcPartyServiceCenterExcel; +import com.epmet.service.IcPartyServiceCenterService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.*; + + +/** + * 党群服务中心 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@RestController +@RequestMapping("icpartyservicecenter") +public class IcPartyServiceCenterController { + + @Autowired + private IcPartyServiceCenterService icPartyServiceCenterService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = icPartyServiceCenterService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + IcPartyServiceCenterDTO data = icPartyServiceCenterService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody IcPartyServiceCenterDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icPartyServiceCenterService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody IcPartyServiceCenterDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icPartyServiceCenterService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + icPartyServiceCenterService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = icPartyServiceCenterService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, IcPartyServiceCenterExcel.class); + } + + /** + * @Description 新增党群服务中心 + * @param formDTO + * @param tokenDto + * @author zxc + * @date 2021/11/22 9:13 上午 + */ + @NoRepeatSubmit + @PostMapping("addpartyservicecenter") + public Result addPartyServiceCenter(@RequestBody AddPartyServiceCenterFormDTO formDTO, @LoginUser TokenDto tokenDto){ + ValidatorUtils.validateEntity(formDTO, AddPartyServiceCenterFormDTO.AddPartyServiceCenterForm.class); + icPartyServiceCenterService.addPartyServiceCenter(formDTO,tokenDto); + return new Result(); + } + + /** + * @Description 修改党群服务中心 + * @param formDTO + * @param tokenDto + * @author zxc + * @date 2021/11/22 10:21 上午 + */ + @NoRepeatSubmit + @PostMapping("editpartyservicecenter") + public Result editPartyServiceCenter(@RequestBody EditPartyServiceCenterFormDTO formDTO,@LoginUser TokenDto tokenDto){ + ValidatorUtils.validateEntity(formDTO, EditPartyServiceCenterFormDTO.EditPartyServiceCenterForm.class); + icPartyServiceCenterService.editPartyServiceCenter(formDTO,tokenDto); + return new Result(); + } + + /** + * @Description 事项删除 + * @param formDTO + * @author zxc + * @date 2021/11/22 1:25 下午 + */ + @PostMapping("delmatter") + public Result delMatter(@RequestBody DelMatterFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, DelMatterFormDTO.DelMatterForm.class); + icPartyServiceCenterService.delMatter(formDTO); + return new Result(); + } + + /** + * @Description 预约 + * @param formDTO + * @param tokenDto + * @author zxc + * @date 2021/11/22 2:06 下午 + */ + @PostMapping("appointment") + public Result appointment(@RequestBody AppointmentFormDTO formDTO, @LoginUser TokenDto tokenDto){ + ValidatorUtils.validateEntity(formDTO, AppointmentFormDTO.AppointmentForm.class); + icPartyServiceCenterService.appointment(formDTO,tokenDto); + return new Result(); + } + + /** + * @Description 党群服务中心列表 + * @param formDTO + * @param tokenDto + * @author zxc + * @date 2021/11/22 2:47 下午 + */ + @PostMapping("partyservicecenterlist") + public Result> partyServiceCenterList(@RequestBody PartyServiceCenterListFormDTO formDTO, @LoginUser TokenDto tokenDto){ + return new Result>().ok(icPartyServiceCenterService.partyServiceCenterList(formDTO,tokenDto)); + } + + /** + * @Description 【党群服务中心】点击预约按钮时,查询可选时间 + * @param formDTO + * @author zxc + * @date 2021/11/23 10:02 上午 + */ + @PostMapping("appointmenttime") + public Result appointmentTime(@RequestBody AppointmentTimeFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, AppointmentTimeFormDTO.AppointmentTimeForm.class); + return new Result().ok(icPartyServiceCenterService.appointmentTime(formDTO)); + } + + /** + * @Description 【党群服务中心】预约记录 + * @param formDTO + * @author zxc + * @date 2021/11/23 10:50 上午 + */ + @PostMapping("appointmentrecord") + public Result> appointmentRecord(@RequestBody AppointmentRecordFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, AppointmentRecordFormDTO.AppointmentRecordForm.class); + return new Result>().ok(icPartyServiceCenterService.appointmentRecord(formDTO)); + } + + /** + * @Description 取消预约 + * @param formDTO + * @author zxc + * @date 2021/11/26 5:21 下午 + */ + @PostMapping("cancelappointment") + public Result cancelAppointment(@RequestBody CancelAppointmentFormDTO formDTO,@LoginUser TokenDto tokenDto){ + ValidatorUtils.validateEntity(formDTO,CancelAppointmentFormDTO.CancelAppointmentForm.class); + formDTO.setUserId(tokenDto.getUserId()); + icPartyServiceCenterService.cancelAppointment(formDTO); + return new Result(); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPartyServiceCenterMatterController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPartyServiceCenterMatterController.java new file mode 100644 index 0000000000..affe64381a --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPartyServiceCenterMatterController.java @@ -0,0 +1,94 @@ +/** + * 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.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.IcPartyServiceCenterMatterDTO; +import com.epmet.excel.IcPartyServiceCenterMatterExcel; +import com.epmet.service.IcPartyServiceCenterMatterService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 党群服务中心可预约事项表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@RestController +@RequestMapping("icpartyservicecentermatter") +public class IcPartyServiceCenterMatterController { + + @Autowired + private IcPartyServiceCenterMatterService icPartyServiceCenterMatterService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = icPartyServiceCenterMatterService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + IcPartyServiceCenterMatterDTO data = icPartyServiceCenterMatterService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody IcPartyServiceCenterMatterDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icPartyServiceCenterMatterService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody IcPartyServiceCenterMatterDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icPartyServiceCenterMatterService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + icPartyServiceCenterMatterService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = icPartyServiceCenterMatterService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, IcPartyServiceCenterMatterExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlaceOrgController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlaceOrgController.java new file mode 100644 index 0000000000..2d152c21c6 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlaceOrgController.java @@ -0,0 +1,107 @@ +/** + * 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.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +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.dto.form.AddPlaceOrgFormDTO; +import com.epmet.dto.form.EditPlaceOrgFormDTO; +import com.epmet.dto.form.GetListPlaceOrgFormDTO; +import com.epmet.dto.result.GetListPlaceOrgResultDTO; +import com.epmet.dto.result.PlaceOrgDetailResultDTO; +import com.epmet.service.IcPlaceOrgService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + + +/** + * 九小场所下组织管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@RestController +@RequestMapping("placeorg") +public class IcPlaceOrgController { + + @Autowired + private IcPlaceOrgService placeOrgService; + + /** + * @Author sun + * @Description 新增九小场所下组织 + **/ + @PostMapping("add") + public Result add(@LoginUser TokenDto tokenDto, @RequestBody AddPlaceOrgFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, AddPlaceOrgFormDTO.Add.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + placeOrgService.add(formDTO); + return new Result(); + } + + /** + * @Author sun + * @Description 修改九小场所下组织 + **/ + @PostMapping("edit") + public Result edit(@LoginUser TokenDto tokenDto, @RequestBody EditPlaceOrgFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, EditPlaceOrgFormDTO.Edit.class); + placeOrgService.edit(formDTO); + return new Result(); + } + + /** + * @Author sun + * @Description 删除九小场所下组织 + **/ + @PostMapping("del") + public Result del(@LoginUser TokenDto tokenDto, @RequestBody EditPlaceOrgFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, EditPlaceOrgFormDTO.Del.class); + placeOrgService.del(formDTO.getPlaceOrgId()); + return new Result(); + } + + /** + * @Author sun + * @Description 九小场所下组织详情 + **/ + @PostMapping("detail") + public Result detail(@LoginUser TokenDto tokenDto, @RequestBody EditPlaceOrgFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, EditPlaceOrgFormDTO.Detail.class); + return new Result().ok(placeOrgService.detail(formDTO.getPlaceOrgId())); + } + + /** + * @Author sun + * @Description 九小场所下组织列表查询 + **/ + @PostMapping("getlist") + public Result getList(@LoginUser TokenDto tokenDto, @RequestBody GetListPlaceOrgFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + return new Result().ok(placeOrgService.getList(formDTO)); + } + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlacePatrolRecordController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlacePatrolRecordController.java new file mode 100644 index 0000000000..0d2c02a3d6 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlacePatrolRecordController.java @@ -0,0 +1,96 @@ +/** + * 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.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +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.dto.form.AddPlacePatrolRecordFormDTO; +import com.epmet.dto.form.EditPlacePatrolRecordFormDTO; +import com.epmet.dto.form.GetListPlacePatrolRecordFormDTO; +import com.epmet.dto.result.GetListPlacePatrolRecordResultDTO; +import com.epmet.dto.result.PlacePatrolRecordDetailResultDTO; +import com.epmet.service.IcPlacePatrolRecordService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + + +/** + * 场所巡查记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@RestController +@RequestMapping("placepatrolrecord") +public class IcPlacePatrolRecordController { + + @Autowired + private IcPlacePatrolRecordService placePatrolRecordService; + + /** + * @Author sun + * @Description 新增场所巡查记录 + **/ + @PostMapping("add") + public Result add(@LoginUser TokenDto tokenDto, @RequestBody AddPlacePatrolRecordFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, AddPlacePatrolRecordFormDTO.Add.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + placePatrolRecordService.add(formDTO); + return new Result(); + } + + /** + * @Author sun + * @Description 删除场所巡查记录 + **/ + @PostMapping("del") + public Result del(@LoginUser TokenDto tokenDto, @RequestBody EditPlacePatrolRecordFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, EditPlacePatrolRecordFormDTO.Del.class); + placePatrolRecordService.del(tokenDto.getUserId(), formDTO.getPlacePatrolRecordId()); + return new Result(); + } + + /** + * @Author sun + * @Description 场所巡查记录详情 + **/ + @PostMapping("detail") + public Result detail(@LoginUser TokenDto tokenDto, @RequestBody EditPlacePatrolRecordFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, EditPlacePatrolRecordFormDTO.Detail.class); + return new Result().ok(placePatrolRecordService.detail(formDTO.getPlacePatrolRecordId())); + } + + /** + * @Author sun + * @Description 场所巡查记录列表查询 + **/ + @PostMapping("getlist") + public Result getList(@LoginUser TokenDto tokenDto, @RequestBody GetListPlacePatrolRecordFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + return new Result().ok(placePatrolRecordService.getList(formDTO)); + } + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlacePatrolReviewRecordController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlacePatrolReviewRecordController.java new file mode 100644 index 0000000000..04666c0230 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlacePatrolReviewRecordController.java @@ -0,0 +1,104 @@ +/** + * 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.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +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.dto.form.AddPlacePatrolReviewRecordFormDTO; +import com.epmet.dto.form.EditPlacePatrolReviewRecordFormDTO; +import com.epmet.dto.form.GetListPlacePatrolReviewRecordFormDTO; +import com.epmet.dto.result.GetListPlacePatrolReviewRecordResultDTO; +import com.epmet.dto.result.PlacePatrolReviewRecordDetailResultDTO; +import com.epmet.service.IcPlacePatrolReviewRecordService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + + +/** + * 场所巡查复查记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@RestController +@RequestMapping("placepatrolreviewrecord") +public class IcPlacePatrolReviewRecordController { + + @Autowired + private IcPlacePatrolReviewRecordService placePatrolReviewRecordService; + + /** + * @Author sun + * @Description 新增巡查复查记录 + **/ + @PostMapping("add") + public Result add(@LoginUser TokenDto tokenDto, @RequestBody AddPlacePatrolReviewRecordFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, AddPlacePatrolReviewRecordFormDTO.Add.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + return new Result().ok(placePatrolReviewRecordService.add(formDTO)); + } + + /** + * @Author sun + * @Description 修改巡查复查记录 + **/ + @PostMapping("edit") + public Result edit(@LoginUser TokenDto tokenDto, @RequestBody EditPlacePatrolReviewRecordFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, EditPlacePatrolReviewRecordFormDTO.Edit.class); + return new Result().ok(placePatrolReviewRecordService.edit(formDTO)); + } + + /** + * @Author sun + * @Description 删除巡查复查记录 + **/ + @PostMapping("del") + public Result del(@LoginUser TokenDto tokenDto, @RequestBody EditPlacePatrolReviewRecordFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, EditPlacePatrolReviewRecordFormDTO.Del.class); + placePatrolReviewRecordService.del(formDTO.getPlacePatrolReviewRecordId()); + return new Result(); + } + + /** + * @Author sun + * @Description 巡查复查记录详情 + **/ + @PostMapping("detail") + public Result detail(@LoginUser TokenDto tokenDto, @RequestBody EditPlacePatrolReviewRecordFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, EditPlacePatrolReviewRecordFormDTO.Detail.class); + return new Result().ok(placePatrolReviewRecordService.detail(formDTO.getPlacePatrolReviewRecordId())); + } + + /** + * @Author sun + * @Description 巡查复查记录列表查询 + **/ + @PostMapping("getlist") + public Result getList(@LoginUser TokenDto tokenDto, @RequestBody GetListPlacePatrolReviewRecordFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, GetListPlacePatrolReviewRecordFormDTO.GetData.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + return new Result().ok(placePatrolReviewRecordService.getList(formDTO)); + } + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlacePatrolTeamController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlacePatrolTeamController.java new file mode 100644 index 0000000000..23013c9f02 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlacePatrolTeamController.java @@ -0,0 +1,108 @@ +/** + * 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.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +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.dto.form.AddPlacePatrolTeamFormDTO; +import com.epmet.dto.form.EditPlacePatrolTeamFormDTO; +import com.epmet.dto.form.GetListPlacePatrolTeamFormDTO; +import com.epmet.dto.result.GetListPlacePatrolTeamResultDTO; +import com.epmet.dto.result.PlacePatrolTeamDetailResultDTO; +import com.epmet.service.IcPlacePatrolTeamService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + + +/** + * 场所分队管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@RestController +@RequestMapping("placepatrolteam") +public class IcPlacePatrolTeamController { + + @Autowired + private IcPlacePatrolTeamService placePatrolTeamService; + + + /** + * @Author sun + * @Description 新增九小场所巡查分队人员管理 + **/ + @PostMapping("add") + public Result add(@LoginUser TokenDto tokenDto, @RequestBody AddPlacePatrolTeamFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, AddPlacePatrolTeamFormDTO.Add.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + placePatrolTeamService.add(formDTO); + return new Result(); + } + + /** + * @Author sun + * @Description 修改九小场所巡查分队人员管理 + **/ + @PostMapping("edit") + public Result edit(@LoginUser TokenDto tokenDto, @RequestBody EditPlacePatrolTeamFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, EditPlacePatrolTeamFormDTO.Edit.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + placePatrolTeamService.edit(formDTO); + return new Result(); + } + + /** + * @Author sun + * @Description 删除九小场所巡查分队人员管理 + **/ + @PostMapping("del") + public Result del(@LoginUser TokenDto tokenDto, @RequestBody EditPlacePatrolTeamFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, EditPlacePatrolTeamFormDTO.Del.class); + placePatrolTeamService.del(tokenDto.getUserId(), formDTO.getTeamId()); + return new Result(); + } + + /** + * @Author sun + * @Description 九小场所巡查分队人员管理详情 + **/ + @PostMapping("detail") + public Result detail(@LoginUser TokenDto tokenDto, @RequestBody EditPlacePatrolTeamFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, EditPlacePatrolTeamFormDTO.Detail.class); + return new Result().ok(placePatrolTeamService.detail(formDTO.getTeamId())); + } + + /** + * @Author sun + * @Description 九小场所巡查分队人员管理列表查询 + **/ + @PostMapping("getlist") + public Result getList(@LoginUser TokenDto tokenDto, @RequestBody GetListPlacePatrolTeamFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + return new Result().ok(placePatrolTeamService.getList(formDTO)); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlacePatrolTeamStaffController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlacePatrolTeamStaffController.java new file mode 100644 index 0000000000..9d3750d7b8 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlacePatrolTeamStaffController.java @@ -0,0 +1,59 @@ +/** + * 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.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.IcPlacePatrolTeamStaffDTO; +import com.epmet.dto.form.GetListPlacePatrolTeamFormDTO; +import com.epmet.dto.result.GetListPlacePatrolTeamResultDTO; +import com.epmet.service.IcPlacePatrolTeamStaffService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + + +/** + * 场所分队下人员管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@RestController +@RequestMapping("placepatrolteamstaff") +public class IcPlacePatrolTeamStaffController { + + @Autowired + private IcPlacePatrolTeamStaffService placePatrolTeamStaffService; + + + /** + * @Author sun + * @Description 查询分队下人员列表数据 + **/ + @PostMapping("getlist") + public Result> getList(@LoginUser TokenDto tokenDto, @RequestBody GetListPlacePatrolTeamFormDTO formDTO) { + return new Result>().ok(placePatrolTeamStaffService.getList(formDTO.getTeamId())); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPropertyManagementController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPropertyManagementController.java new file mode 100644 index 0000000000..baa7c40fc4 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPropertyManagementController.java @@ -0,0 +1,87 @@ +/** + * 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.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.IcPropertyManagementDTO; +import com.epmet.service.IcPropertyManagementService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 物业表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +@RestController +@RequestMapping("icpropertymanagement") +public class IcPropertyManagementController { + + @Autowired + private IcPropertyManagementService icPropertyManagementService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = icPropertyManagementService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + IcPropertyManagementDTO data = icPropertyManagementService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody IcPropertyManagementDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icPropertyManagementService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody IcPropertyManagementDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icPropertyManagementService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + icPropertyManagementService.delete(ids); + return new Result(); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/NeighborHoodController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/NeighborHoodController.java new file mode 100644 index 0000000000..1f54db3e1c --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/NeighborHoodController.java @@ -0,0 +1,234 @@ +/** + * 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.controller; + +import cn.afterturn.easypoi.excel.entity.TemplateExportParams; +import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.constant.NumConstant; +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.dao.IcBuildingDao; +import com.epmet.dto.form.IcNeighborHoodFormDTO; +import com.epmet.dto.form.ListIcNeighborHoodFormDTO; +import com.epmet.dto.result.IcNeighborHoodResultDTO; +import com.epmet.entity.IcBuildingEntity; +import com.epmet.excel.IcNeighborHoodExcel; +import com.epmet.service.BuildingService; +import com.epmet.service.HouseService; +import com.epmet.service.IcNeighborHoodService; +import com.epmet.service.NeighborHoodService; +import com.epmet.util.ExcelPoiUtils; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.CollectionUtils; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.*; +import java.util.stream.Collectors; + + +/** + * 小区表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +@Slf4j +@RestController +@RequestMapping("neighborhood") +public class NeighborHoodController { + + @Autowired + private IcNeighborHoodService icNeighborHoodService; + @Autowired + private NeighborHoodService neighborHoodService; + @Autowired + private BuildingService buildingService; + @Autowired + private HouseService houseService; + @Resource + private IcBuildingDao icBuildingDao; + + + + + @PostMapping("neighborhoodlist") + public Result neighborhoodlist(@RequestBody ListIcNeighborHoodFormDTO formDTO){ + //效验数据 + ValidatorUtils.validateEntity(formDTO); + IcNeighborHoodResultDTO icNeighborHoodResultDTO = neighborHoodService.listNeighborhood(formDTO); + return new Result().ok(icNeighborHoodResultDTO); + + } + + @NoRepeatSubmit + @PostMapping("neighborhoodadd") + public Result neighborhoodadd(@LoginUser TokenDto tokenDTO, @RequestBody IcNeighborHoodFormDTO formDTO){ + //效验数据 + ValidatorUtils.validateEntity(formDTO, IcNeighborHoodFormDTO.AddShowGroup.class); + String customerId = tokenDTO.getCustomerId(); +// String customerId = "123123"; + + neighborHoodService.AddNeighborhood(customerId,formDTO); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("neighborhoodupdate") + public Result neighborhoodupdate(@LoginUser TokenDto tokenDTO, @RequestBody IcNeighborHoodFormDTO formDTO){ + //效验数据 + ValidatorUtils.validateEntity(formDTO, IcNeighborHoodFormDTO.UpdateShowGroup.class); + String customerId = tokenDTO.getCustomerId(); +// String customerId = "123123"; + neighborHoodService.UpdateNeighborhood(customerId,formDTO); + return new Result(); + } + + @PostMapping("neighborhooddel") + public Result neighborhooddel(@LoginUser TokenDto tokenDTO, @RequestBody IcNeighborHoodFormDTO formDTO){ + //效验数据 + ValidatorUtils.validateEntity(formDTO, IcNeighborHoodFormDTO.DeleteGroup.class); + String neighborHoodId = formDTO.getNeighborHoodId(); + //判断是否存在楼宇,如果存在不能删除 + List icBuildingEntities = icBuildingDao.selectList(new QueryWrapper().lambda().eq(IcBuildingEntity::getNeighborHoodId, neighborHoodId)); + if(!CollectionUtils.isEmpty(icBuildingEntities)){ + return new Result().error(8001,"小区下已存在楼宇,无法删除"); + } + neighborHoodService.DelNeighborhood(neighborHoodId); + return new Result().ok("删除成功"); + } + + + /** + * 导出 + * @param formDTO + * @param response + * @throws Exception + */ + @PostMapping("exportneighborhoodinfo") + public void exportneighborhoodinfo(@RequestBody ListIcNeighborHoodFormDTO formDTO, HttpServletResponse response) throws Exception { + ValidatorUtils.validateEntity(formDTO); + neighborHoodService.exportNeighborhoodinfo(formDTO,response); + + } + /** + * 导出模板 + * @param response + * @throws Exception + */ + @PostMapping("exporttemplate") + public void exportTemplate( HttpServletResponse response) throws Exception { +// ValidatorUtils.validateEntity(ListIcNeighborHoodFormDTO.class); + TemplateExportParams templatePath = new TemplateExportParams("excel/neighbor_template.xlsx"); + Map map = new HashMap<>(); + map.put("maplist",new ArrayList()); + ExcelPoiUtils.exportExcel(templatePath ,map,"小区信息录入表",response); + + } + + /** + * 导出模板 + + * @param response + * @throws Exception + */ + /*@GetMapping("export") + public void export( HttpServletResponse response) throws Exception { + ValidatorUtils.validateEntity(ListIcNeighborHoodFormDTO.class); + TemplateExportParams templatePath = new TemplateExportParams("excel/neighbor_template.xlsx"); + Map map = new HashMap<>(); + map.put("maplist",new ArrayList()); + ExcelPoiUtils.exportExcel(templatePath ,map,"小区信息录入表",response); + + }*/ + /** + * 导出 + * @param response + * @throws Exception + */ + /* @RequestMapping("exportinfo") + public void exportinfo(HttpServletResponse response) throws Exception { + ListIcNeighborHoodFormDTO formDTO = new ListIcNeighborHoodFormDTO(); + ValidatorUtils.validateEntity(ListIcNeighborHoodFormDTO.class); + neighborHoodService.exportNeighborhoodinfo(formDTO,response); + + }*/ + + +// /** +// * 导入 +// * @param params +// * @param response +// * @throws Exception +// */ +// @PostMapping("importneighborhoodinfo") +// public void importneighborhoodinfo(@RequestParam Map params, HttpServletResponse response) throws Exception { +// List list = icNeighborHoodService.list(params); +// ExcelUtils.exportExcelToTarget(response, "小区信息录入表", list, IcNeighborHoodExcel.class); +//// ExcelUtils.expor +// } + + /** + * 导入数据 + * @param file + * @return + * @throws IOException + */ + @PostMapping("import") + public Result importExcel(@LoginUser TokenDto tokenDTO, @RequestParam("file") MultipartFile file) throws IOException { + + String customerId = tokenDTO.getCustomerId(); +// String customerId = "123123"; + ExcelImportResult importResult = ExcelPoiUtils.importExcelMore(file, 0, 1, IcNeighborHoodExcel.class); +// List result = ExcelPoiUtils.importExcel(file, 0, 1, IcNeighborHoodExcel.class); + List failList = importResult.getFailList(); + + //存放错误数据行号 + List numList = new ArrayList<>(); + if(!CollectionUtils.isEmpty(failList)){ + for ( IcNeighborHoodExcel entity : failList) { + log.error("第{}行,{}",entity.getRowNum(),entity.getErrorMsg());//打印失败的行 和失败的信息 + numList.add(entity.getRowNum()); + } + //return new Result().error(8001,failList.get(0).getErrorMsg()); + } + List result =importResult.getList(); +// log.info(JSON.toJSONString(result)); + List resultList = neighborHoodService.importExcel(customerId,result,tokenDTO.getUserId(),numList); + String str = String.format("共%s条,成功导入%s条。",numList.size()+result.size(),numList.size()+result.size()-resultList.size()); + if (resultList.size() > NumConstant.ZERO) { + Collections.sort(resultList); + String subList = resultList.stream().map(String::valueOf).collect(Collectors.joining("、")); + log.warn(str + "第" + subList + "行未成功!"); + return new Result().error(9999, str + "第" + subList + "行未成功!"); + } + return new Result().ok(str); + } + + + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/PropertyManagementController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/PropertyManagementController.java new file mode 100644 index 0000000000..6a38dd3e39 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/PropertyManagementController.java @@ -0,0 +1,89 @@ +/** + * 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.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +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.dto.form.IcPropertyManagementFormDTO; +import com.epmet.dto.result.IcPropertyManagementResultDTO; +import com.epmet.service.IcPropertyManagementService; +import com.epmet.service.PropertyManagementService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + +/** + * 物业表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +@RestController +@RequestMapping("propertymanagement") +public class PropertyManagementController { + + @Autowired + private IcPropertyManagementService icPropertyManagementService; + + @Autowired + private PropertyManagementService propertyManagementService; + + + @PostMapping("list") + public Result> list(){ + return new Result>().ok(propertyManagementService.getList()); + } + + + @PostMapping("add") + public Result add(@LoginUser TokenDto tokenDTO, @RequestBody IcPropertyManagementFormDTO formDTO){ + //效验数据 + ValidatorUtils.validateEntity(formDTO, IcPropertyManagementFormDTO.AddShowGroup.class); + Map map=new HashMap<>(); + map.put("propertyId",propertyManagementService.add(formDTO)); + return new Result().ok(map); + } + + + + @PostMapping("update") + public Result update(@LoginUser TokenDto tokenDTO, @RequestBody IcPropertyManagementFormDTO formDTO){ + //效验数据 + ValidatorUtils.validateEntity(formDTO, IcPropertyManagementFormDTO.UpdateShowGroup.class); + propertyManagementService.update(formDTO); + return new Result(); + } + + @PostMapping("delete") + public Result delete(@LoginUser TokenDto tokenDTO, @RequestBody IcPropertyManagementFormDTO formDTO){ + //效验数据 + ValidatorUtils.validateEntity(formDTO, IcPropertyManagementFormDTO.DeleteGroup.class); + propertyManagementService.delete(formDTO); + return new Result(); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java index 145178f50f..d1a49f7ba3 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java @@ -243,4 +243,44 @@ public interface CustomerAgencyDao extends BaseDao { AgencyTreeResultDTO getAllAgency(@Param("customerId") String customerId); List getSubAgencyList(@Param("pid") String pid); -} \ No newline at end of file + + List getStaffOrgListByStaffId(@Param("staffId") String staffId); + + /** + * @Description 【地图配置】删除 + * @param orgId + * @param level + * @author zxc + * @date 2021/10/25 9:39 上午 + */ + void delMapArea(@Param("orgId") String orgId, @Param("level") String level); + + /** + * @Description 【地图配置】新增 + * @param orgId + * @param level + * @param coordinates + * @author zxc + * @date 2021/10/25 9:59 上午 + */ + void addMapArea(@Param("orgId") String orgId, @Param("level") String level,@Param("coordinates")String coordinates); + + /** + * @Description 地图查询下级组织 + * @param pid + * @param type + * @author zxc + * @date 2021/10/25 2:30 下午 + */ + List selectSonOrg(@Param("pid")String pid,@Param("type")String type); + + /** + * @Description 查询下级agencyId + * @param orgId + * @author zxc + * @date 2021/12/9 4:42 下午 + */ + List getSonAgencyId(@Param("orgId") String orgId); + +} + 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 fae6640a7d..eca348b6f2 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 @@ -18,6 +18,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.commons.tools.dto.result.OptionResultDTO; import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.UserIdAndPidDTO; import com.epmet.dto.UserIdDTO; @@ -300,4 +301,48 @@ public interface CustomerGridDao extends BaseDao { * @date 2021/8/5 10:08 上午 */ List selectOrgsByUserId(@Param("userId") String userId); + + /** + * @Description 查询组织下的网格及网格下的小区、单元、楼栋 + * @Param agencyId + * @Return {@link List< GridTreeResultDTO>} + * @Author zhaoqifeng + * @Date 2021/10/25 15:19 + */ + List selectGridTree(@Param("agencyId") String agencyId); + + /** + * @Description 网格下小区列表 + * @Param gridId + * @Return {@link List< NeighborHoodDTO>} + * @Author zhaoqifeng + * @Date 2021/10/25 16:04 + */ + List selectNeighborHoodList(@Param("gridId") String gridId); + + /** + * @Description 小区下楼栋列表 + * @Param neighborHoodId + * @Return {@link List< BuildingDTO>} + * @Author zhaoqifeng + * @Date 2021/10/25 16:04 + */ + List selectBuildingList(@Param("neighborHoodId") String neighborHoodId); + + /** + * @Description 楼栋下单元列表 + * @Param buildingId + * @Return {@link List< UnitDTO>} + * @Author zhaoqifeng + * @Date 2021/10/25 16:04 + */ + List selectUnitList(@Param("buildingId") String buildingId); + + /** + * @Author sun + * @Description 查询组织下直属网格列表 + **/ + List selectByPid(@Param("pid") String pid); + + List getGridOptionForQuery(String gridPids); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingDao.java new file mode 100644 index 0000000000..6d029cb291 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingDao.java @@ -0,0 +1,76 @@ +/** + * 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.dao; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.BaseInfoFamilyBuildingResultDTO; +import com.epmet.dto.result.BuildingResultDTO; +import com.epmet.entity.CustomerAgencyEntity; +import com.epmet.entity.IcBuildingEntity; +import com.epmet.entity.IcHouseEntity; +import com.epmet.excel.IcBuildingExcel; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** + * 楼栋信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +@Mapper +public interface IcBuildingDao extends BaseDao { + +// IPage> searchBuildingByPage(IPage page, +// @Param("neighbor") IcNeighborHoodEntity neighbor, +// @Param("building")IcBuildingEntity building); + IPage> searchBuildingByPage(IPage page, + @Param("building")IcBuildingEntity building, @Param("house") IcHouseEntity house); + +// List searchAllBuilding(@Param(Constants.WRAPPER) QueryWrapper neighborHoodEntityQueryWrapper, +// @Param("ew1") QueryWrapper buildingEntityQueryWrapper); +// List searchAllBuilding(@Param("neighbor") IcNeighborHoodEntity neighbor, +// @Param("building")IcBuildingEntity building); + List searchAllBuilding( + @Param("building")IcBuildingEntity building, @Param("house")IcHouseEntity house); + + List selectAgencyChildrenList(@Param("agencyId") String agencyId); + + List> selectListByName(@Param("customerId") String customerId, + @Param("neighborNameList")ArrayList strings, + @Param("buildingNameList") ArrayList strings1, + @Param("buildingUnitList") ArrayList integers); + + /** + * @Description 根据neighborHoodId查询楼 + * @param neighborHoodId + * @author zxc + * @date 2021/11/2 9:25 上午 + */ + List baseInfoFamilyBuilding(@Param("neighborHoodId")String neighborHoodId); + + Integer checkBuildName(@Param("neighborHoodId") String neighborHoodId,@Param("buildingName")String buildingName, @Param("buildingId")String buildingId); + List buildingListByIds(@Param("buildingIdList") List buildingIdList); + IPage buildingListByIds(IPage page,@Param("buildingIdList") List buildingIdList); + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingUnitDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingUnitDao.java new file mode 100644 index 0000000000..69465df911 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingUnitDao.java @@ -0,0 +1,33 @@ +/** + * 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.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcBuildingUnitEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 楼栋单元信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +@Mapper +public interface IcBuildingUnitDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java new file mode 100644 index 0000000000..1553cccc9d --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java @@ -0,0 +1,69 @@ +/** + * 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.dao; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.HouseInfoDTO; +import com.epmet.entity.IcHouseEntity; +import com.epmet.excel.IcHouseExcel; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * 房屋信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +@Mapper +public interface IcHouseDao extends BaseDao { + +// IPage> searchHouseByPage(IPage page, +// @Param(Constants.WRAPPER) QueryWrapper neighborHoodEntityQueryWrapper, +// @Param("ew1") QueryWrapper buildingEntityQueryWrapper, +// @Param("ew2") QueryWrapper houseEntityQueryWrapper); +// IPage> searchHouseByPage(IPage page, +// @Param("neighbor") IcNeighborHoodEntity neighbor, +// @Param("building") IcBuildingEntity building, +// @Param("house") IcHouseEntity house); + IPage> searchHouseByPage(IPage page, + @Param("house") IcHouseEntity house); + + List searchAllHouse(@Param("house") IcHouseEntity house); + + List queryHouseInfo(@Param("houseIdList") Set houseIdList); + + /** + * @Description 查询房屋信息 + * @param idCard + * @author zxc + * @date 2021/11/3 3:30 下午 + */ + List selectHouseInfoByIdCard(@Param("idCard") String idCard); + + Integer checkDoorNameUq(@Param("neighborHoodId") String neighborHoodId, + @Param("buildingId")String buildingId, + @Param("buildingUnitId")String buildingUnitId, + @Param("doorName")String doorName, + @Param("houseId")String houseId); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcMatterAppointmentRecordDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcMatterAppointmentRecordDao.java new file mode 100644 index 0000000000..0b118216bb --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcMatterAppointmentRecordDao.java @@ -0,0 +1,64 @@ +/** + * 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.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.AppointmentExistRecordResultDTO; +import com.epmet.dto.result.AppointmentRecordResultDTO; +import com.epmet.entity.IcMatterAppointmentRecordEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 事项预约记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Mapper +public interface IcMatterAppointmentRecordDao extends BaseDao { + + /** + * @Description 查询预约列表 + * @param matterId + * @param date + * @author zxc + * @date 2021/11/23 1:55 下午 + */ + List appointmentRecord(@Param("matterId")String matterId,@Param("date")String date); + + /** + * @Description 查询事项是不是存在预约记录 + * @param matterIds + * @author zxc + * @date 2021/11/23 3:48 下午 + */ + List appointmentExistRecord(@Param("matterIds")List matterIds); + + /** + * @Description 取消预约 + * @param recordId + * @param userId + * @author zxc + * @date 2021/11/29 3:34 下午 + */ + void cancelAppointment(@Param("recordId")String recordId,@Param("userId")String userId); + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodDao.java new file mode 100644 index 0000000000..6e5d0487eb --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodDao.java @@ -0,0 +1,54 @@ +/** + * 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.dao; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcHouseEntity; +import com.epmet.entity.IcNeighborHoodEntity; +import com.epmet.excel.IcNeighborHoodExcel; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +/** + * 小区表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +@Mapper +public interface IcNeighborHoodDao extends BaseDao { + +// IPage> searchNeighborhoodByPage(IPage page,@Param(Constants.WRAPPER) QueryWrapper neighborHoodEntityQueryWrapper); + IPage> searchNeighborhoodByPage(IPage page, @Param("neighbor") IcNeighborHoodEntity neighbor, @Param("house")IcHouseEntity house); + +// List searchAllNeighborhood(@Param(Constants.WRAPPER) QueryWrapper neighborHoodEntityQueryWrapper); + List searchAllNeighborhood(@Param("neighbor") IcNeighborHoodEntity neighbor, @Param("house")IcHouseEntity house); + + List selectListByName(@Param("customerId") String customerId, + @Param("neighborNameList")List neighborNameList, + @Param("agencyNameList") List agencyNameList, + @Param("gridNameList") List gridNameList); + + Integer checkNameUq(@Param("customerId") String customerId, + @Param("neighborHoodName")String neighborHoodName, + @Param("neighborId")String neighborId); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodPartDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodPartDao.java new file mode 100644 index 0000000000..6b0154f538 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodPartDao.java @@ -0,0 +1,33 @@ +/** + * 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.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcNeighborHoodPartEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 小区-分区表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +@Mapper +public interface IcNeighborHoodPartDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodPropertyDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodPropertyDao.java new file mode 100644 index 0000000000..79a71a11b8 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodPropertyDao.java @@ -0,0 +1,33 @@ +/** + * 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.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcNeighborHoodPropertyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 小区物业关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +@Mapper +public interface IcNeighborHoodPropertyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPartyServiceCenterDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPartyServiceCenterDao.java new file mode 100644 index 0000000000..b85d2086f0 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPartyServiceCenterDao.java @@ -0,0 +1,45 @@ +/** + * 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.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.PartyServiceCenterListResultDTO; +import com.epmet.entity.IcPartyServiceCenterEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 党群服务中心 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Mapper +public interface IcPartyServiceCenterDao extends BaseDao { + + /** + * @Description 查询党群服务中心列表 + * @param orgId + * @author zxc + * @date 2021/11/22 2:51 下午 + */ + List partyServiceCenterList(@Param("orgId")String orgId); + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPartyServiceCenterMatterDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPartyServiceCenterMatterDao.java new file mode 100644 index 0000000000..18bf0f63f0 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPartyServiceCenterMatterDao.java @@ -0,0 +1,52 @@ +/** + * 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.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcPartyServiceCenterMatterEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 党群服务中心可预约事项表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Mapper +public interface IcPartyServiceCenterMatterDao extends BaseDao { + + /** + * @Description 根据党群服务中心删除事项 + * @param partyServiceCenterId + * @author zxc + * @date 2021/11/22 10:29 上午 + */ + void deleteMattersByPartyServiceCenterId(@Param("partyServiceCenterId") String partyServiceCenterId); + + /** + * @Description 根据党群服务中心ID查询事件名字 + * @param centerId + * @author zxc + * @date 2021/12/10 8:56 上午 + */ + List selectMatterNameByCenterId(@Param("centerId") String centerId); + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPlaceOrgDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPlaceOrgDao.java new file mode 100644 index 0000000000..a3c5c667bd --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPlaceOrgDao.java @@ -0,0 +1,43 @@ +/** + * 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.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.form.GetListPlaceOrgFormDTO; +import com.epmet.dto.result.PlaceOrgDetailResultDTO; +import com.epmet.entity.IcPlaceOrgEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 九小场所下组织管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Mapper +public interface IcPlaceOrgDao extends BaseDao { + + /** + * @Author sun + * @Description 九小场所下组织列表查询 + **/ + List getList(GetListPlaceOrgFormDTO formDTO); + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPlacePatrolRecordDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPlacePatrolRecordDao.java new file mode 100644 index 0000000000..be3bd364f2 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPlacePatrolRecordDao.java @@ -0,0 +1,38 @@ +/** + * 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.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.form.GetListPlacePatrolRecordFormDTO; +import com.epmet.dto.result.PlacePatrolRecordDetailResultDTO; +import com.epmet.entity.IcPlacePatrolRecordEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 场所巡查记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Mapper +public interface IcPlacePatrolRecordDao extends BaseDao { + + List getList(GetListPlacePatrolRecordFormDTO dto); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPlacePatrolReviewRecordDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPlacePatrolReviewRecordDao.java new file mode 100644 index 0000000000..0b6c476228 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPlacePatrolReviewRecordDao.java @@ -0,0 +1,49 @@ +/** + * 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.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.form.GetListPlacePatrolReviewRecordFormDTO; +import com.epmet.dto.result.PlacePatrolReviewRecordDetailResultDTO; +import com.epmet.entity.IcPlacePatrolReviewRecordEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 场所巡查复查记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Mapper +public interface IcPlacePatrolReviewRecordDao extends BaseDao { + + /** + * @Author sun + * @Description 删除巡查记录对应的复查记录 + **/ + int delByPatrolRecordId(@Param("staffId") String staffId, @Param("placePatrolRecordId") String placePatrolRecordId); + + /** + * @Author sun + * @Description 查询巡查记录对应的复查记录数据 + **/ + List getList(GetListPlacePatrolReviewRecordFormDTO formDTO); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPlacePatrolTeamDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPlacePatrolTeamDao.java new file mode 100644 index 0000000000..d53d0f24e8 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPlacePatrolTeamDao.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.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.form.GetListPlacePatrolTeamFormDTO; +import com.epmet.dto.result.PlacePatrolTeamDetailResultDTO; +import com.epmet.entity.IcPlacePatrolTeamEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 场所分队管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Mapper +public interface IcPlacePatrolTeamDao extends BaseDao { + + /** + * @Author sun + * @Description 九小场所巡查分队人员管理列表查询 + **/ + List getList(GetListPlacePatrolTeamFormDTO formDTO); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPlacePatrolTeamStaffDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPlacePatrolTeamStaffDao.java new file mode 100644 index 0000000000..8f8df8c9dd --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPlacePatrolTeamStaffDao.java @@ -0,0 +1,60 @@ +/** + * 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.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.IcPlacePatrolTeamStaffDTO; +import com.epmet.entity.IcPlacePatrolTeamStaffEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 场所分队下人员管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Mapper +public interface IcPlacePatrolTeamStaffDao extends BaseDao { + + /** + * @Author sun + * @Description 删除分队下成员信息 + **/ + int delByTeamId(@Param("teamId") String teamId); + + /** + * @Author sun + * @Description 查询分队下成员信息 + **/ + List getByTeamId(@Param("teamId") String teamId); + + /** + * @Author sun + * @Description 批量查询分队下人员信息 + **/ + List selectByTeamIds(@Param("teamIds") List teamIds); + + /** + * @Author sun + * @Description 逻辑删除分队成员子表数据 + **/ + int upByTeamId(@Param("staffId") String staffId, @Param("teamId") String teamId); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPropertyManagementDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPropertyManagementDao.java new file mode 100644 index 0000000000..b79a5cc3e6 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPropertyManagementDao.java @@ -0,0 +1,34 @@ +/** + * 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.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcPropertyManagementEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 物业表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +@Mapper +public interface IcPropertyManagementDao extends BaseDao { + + IcPropertyManagementEntity selectByName(String name); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerAgencyEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerAgencyEntity.java index ee327e421e..ff51b54c01 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerAgencyEntity.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerAgencyEntity.java @@ -108,4 +108,19 @@ public class CustomerAgencyEntity extends BaseEpmetEntity { * 【社区】名称0409 */ private String community; + + /** + * 坐标 + */ + private String coordinates; + + /** + * 中心位置经度 + */ + private String longitude; + + /** + * 中心位置纬度 + */ + private String latitude; } 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 26d0cd84af..75674491f7 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 @@ -79,4 +79,9 @@ public class CustomerGridEntity extends BaseEpmetEntity { * 所有上级组织ID */ private String pids; + + /** + * 坐标 + */ + private String coordinates; } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcBuildingEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcBuildingEntity.java new file mode 100644 index 0000000000..b4d4811caa --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcBuildingEntity.java @@ -0,0 +1,98 @@ +/** + * 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.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 2021-10-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_building") +public class IcBuildingEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 小区id + */ + private String neighborHoodId; + + /** + * 片区id,neighbor_hood_part.id,可为空。 + */ + private String partId; + + /** + * 楼栋名称 + */ + private String buildingName; + + /** + * 楼栋类型,这里存储字典编码就可以 + */ + private String type; + + /** + * 排序 + */ + private Integer sort; + + /** + * 总单元数 + */ + private Integer totalUnitNum; + + /** + * 总楼层总数 + */ + private Integer totalFloorNum; + + /** + * 总户数 + */ + private Integer totalHouseNum; + + /** + * 中心点位:经度 + */ + private String longitude; + + /** + * 中心点位:纬度 + */ + private String latitude; + + /** + * 坐标位置 + */ + private String coordinatePosition; + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcBuildingUnitEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcBuildingUnitEntity.java new file mode 100644 index 0000000000..d7212ff143 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcBuildingUnitEntity.java @@ -0,0 +1,61 @@ +/** + * 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.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 楼栋单元信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_building_unit") +public class IcBuildingUnitEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 楼宇id + */ + private String buildingId; + + /** + * 单元号:1,2,3?? + */ + private String unitNum; + + /** + * 单元名 + */ + private String unitName; + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcHouseEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcHouseEntity.java new file mode 100644 index 0000000000..4861c69271 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcHouseEntity.java @@ -0,0 +1,106 @@ +/** + * 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.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 房屋信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_house") +public class IcHouseEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 小区id + */ + private String neighborHoodId; + + /** + * 片区id,neighbor_hood_part.id,可为空。 + */ + private String partId; + + /** + * 所属楼栋id + */ + private String buildingId; + + /** + * 所属单元id + */ + private String buildingUnitId; + + /** + * 房屋名字后台插入时生成 + */ + private String houseName; + + /** + * 门牌号 + */ + private String doorName; + + /** + * 房屋类型,这里存储字典value就可以 + */ + private String houseType; + + /** + * 存储字典value + */ + private String purpose; + + /** + * 1出租;0未出租 + */ + private Integer rentFlag; + + /** + * 房主姓名 + */ + private String ownerName; + + /** + * 房主电话 + */ + private String ownerPhone; + + /** + * 房主身份证号 + */ + private String ownerIdCard; + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcMatterAppointmentRecordEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcMatterAppointmentRecordEntity.java new file mode 100644 index 0000000000..c7df20f0f7 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcMatterAppointmentRecordEntity.java @@ -0,0 +1,101 @@ +/** + * 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.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 事项预约记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_matter_appointment_record") +public class IcMatterAppointmentRecordEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * + */ + private String customerId; + + /** + * 组织ID + */ + private String orgId; + + /** + * 组织类型,agency:组织,grid:网格 + */ + private String orgType; + + /** + * + */ + private String pid; + + /** + * + */ + private String pids; + + /** + * 事项ID + */ + private String matterId; + + /** + * 预约日期 + */ + private String appointmentDate; + + /** + * 预约人 + */ + private String appointmentName; + + /** + * 预约电话 + */ + private String appointmentPhone; + + /** + * 备注 + */ + private String remark; + + /** + * 预约状态【cancel:取消,appointing:预约中】 + */ + private String status; + + /** + * 1,2,5 + */ + private String timeId; + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcNeighborHoodEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcNeighborHoodEntity.java new file mode 100644 index 0000000000..62489898d2 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcNeighborHoodEntity.java @@ -0,0 +1,101 @@ +/** + * 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.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 小区表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_neighbor_hood") +public class IcNeighborHoodEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 小区名称 + */ + private String neighborHoodName; + + /** + * 组织id + */ + private String agencyId; + + /** + * 上级组织id + */ + private String parentAgencyId; + + /** + * 组织的所有上级组织id + */ + private String agencyPids; + + /** + * 网格id + */ + private String gridId; + + /** + * 详细地址 + */ + private String address; + + /** + * 备注 + */ + private String remark; + + /** + * 中心点位:经度 + */ + private String longitude; + + /** + * 中心点位:纬度 + */ + private String latitude; + + /** + * 坐标区域 + */ + private String coordinates; + + /** + * 坐标位置 + */ + private String location; + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcNeighborHoodPartEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcNeighborHoodPartEntity.java new file mode 100644 index 0000000000..5f9929c5f4 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcNeighborHoodPartEntity.java @@ -0,0 +1,56 @@ +/** + * 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.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 小区-分区表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_neighbor_hood_part") +public class IcNeighborHoodPartEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 小区id + */ + private String neighborHoodId; + + /** + * 名称,比如北区,南区 + */ + private String name; + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcNeighborHoodPropertyEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcNeighborHoodPropertyEntity.java new file mode 100644 index 0000000000..19827d15bf --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcNeighborHoodPropertyEntity.java @@ -0,0 +1,51 @@ +/** + * 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.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 小区物业关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_neighbor_hood_property") +public class IcNeighborHoodPropertyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 物业id + */ + private String propertyId; + + /** + * 小区id + */ + private String neighborHoodId; + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPartyServiceCenterEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPartyServiceCenterEntity.java new file mode 100644 index 0000000000..b2b422ff9e --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPartyServiceCenterEntity.java @@ -0,0 +1,111 @@ +/** + * 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.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 党群服务中心 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_party_service_center") +public class IcPartyServiceCenterEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 组织ID + */ + private String orgId; + + /** + * 组织类型,agency:组织,grid:网格 + */ + private String orgType; + + /** + * + */ + private String pid; + + /** + * + */ + private String pids; + + /** + * 中心名称 + */ + private String centerName; + + /** + * 办公电话 + */ + private String workPhone; + + /** + * 上午开始办公时间 + */ + private String amStartTime; + + /** + * 上午结束办公时间 + */ + private String amEndTime; + + /** + * 下午开始办公时间 + */ + private String pmStartTime; + + /** + * 下午结束办公时间 + */ + private String pmEndTime; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + + /** + * 地址 + */ + private String address; + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPartyServiceCenterMatterEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPartyServiceCenterMatterEntity.java new file mode 100644 index 0000000000..fd9f55fe13 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPartyServiceCenterMatterEntity.java @@ -0,0 +1,71 @@ +/** + * 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.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 党群服务中心可预约事项表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_party_service_center_matter") +public class IcPartyServiceCenterMatterEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 党群服务中心ID + */ + private String partyServiceCenterId; + + /** + * 事项名字 + */ + private String matterName; + + /** + * 预约类型,每天:everyDay,工作日:workDay,周末:weekend + */ + private String appointmentType; + + /** + * 可预约开始时间 + */ + private String startTime; + + /** + * 可预约结束时间 + */ + private String endTime; + + /** + * 客户ID + */ + private String customerId; + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPlaceOrgEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPlaceOrgEntity.java new file mode 100644 index 0000000000..65540a28b1 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPlaceOrgEntity.java @@ -0,0 +1,101 @@ +/** + * 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.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 九小场所下组织管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_place_org") +public class IcPlaceOrgEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 组织Id + */ + private String agencyId; + + /** + * agency_id的所有上级 + */ + private String pids; + + /** + * 网格Id【场所区域】 + */ + private String gridId; + + /** + * 场所类型【admin库sys_dict_data表九小场所value值】 + */ + private String ninePlaceVal; + + /** + * 场所名称 + */ + private String placeOrgName; + + /** + * 场所地址 + */ + private String address; + + /** + * 字典value,场所规模【 +0:10人以下 +1:10-20人 +2:21-40人 +3:41-100人 +4:100人以上】 + */ + private String scale; + + /** + * 场所负责人 + */ + private String personInCharge; + + /** + * 负责人电话 + */ + private String mobile; + + /** + * 备注 + */ + private String remarks; + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPlacePatrolRecordEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPlacePatrolRecordEntity.java new file mode 100644 index 0000000000..3b6995b09c --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPlacePatrolRecordEntity.java @@ -0,0 +1,116 @@ +/** + * 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.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 场所巡查记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_place_patrol_record") +public class IcPlacePatrolRecordEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 组织Id + */ + private String agencyId; + + /** + * agency_id的所有上级 + */ + private String pids; + + /** + * 网格Id【场所区域】 + */ + private String gridId; + + /** + * 场所类型【admin库sys_dict_data表九小场所value值】 + */ + private String ninePlaceVal; + + /** + * 场所下的组织Id + */ + private String placeOrgId; + + /** + * 场所下分队(place_patrolteam)表Id + */ + private String placePatrolTeamId; + + /** + * 分队下检查人员Id,分号分隔 + */ + private String inspectors; + + /** + * 首次巡查时间 + */ + private Date firstTime; + + /** + * 隐患明细 + */ + private String detailed; + + /** + * 首次检查结果【0:合格 1:不合格】 + */ + private String firstResult; + + /** + * 拟复查时间 + */ + private Date reviewTime; + + /** + * 最终检查结果【0:合格 1:不合格】初始数据默认和首次检查结果相同 + */ + private String finalResult; + + /** + * 最新复查时间【初始数据默认和首次巡查时间相同】 + */ + private Date finalTime; + + /** + * 备注 + */ + private String remarks; + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPlacePatrolReviewRecordEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPlacePatrolReviewRecordEntity.java new file mode 100644 index 0000000000..dd492d7dfa --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPlacePatrolReviewRecordEntity.java @@ -0,0 +1,81 @@ +/** + * 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.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 场所巡查复查记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_place_patrol_review_record") +public class IcPlacePatrolReviewRecordEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 巡查记录主(place_patrol_record)表Id + */ + private String placePatrolRecordId; + + /** + * 场所下分队(place_patrol_team)表Id + */ + private String placePatrolTeamId; + + /** + * 检查人员Id,逗号分隔 + */ + private String inspectors; + + /** + * 复查时间 + */ + private Date reviewTime; + + /** + * 复查隐患明细 + */ + private String detailed; + + /** + * 复查检查结果【0:合格 1:不合格】 + */ + private String reviewResult; + + /** + * 备注 + */ + private String remarks; + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPlacePatrolTeamEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPlacePatrolTeamEntity.java new file mode 100644 index 0000000000..85b37ddd64 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPlacePatrolTeamEntity.java @@ -0,0 +1,96 @@ +/** + * 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.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 场所分队管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_place_patrol_team") +public class IcPlacePatrolTeamEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 组织Id + */ + private String agencyId; + + /** + * agency_id的所有上级 + */ + private String pids; + + /** + * 负责区域【网格Id 多个值逗号分隔】 + */ + private String gridIds; + + /** + * 负责场所类型【admin库sys_dict_data表九小场所value值 多个值逗号分隔】 + */ + private String ninePlaceVals; + + /** + * 分队名称 + */ + private String teamName; + + /** + * 巡查计划 + */ + private String plan; + + /** + * 创建(建队)时间 + */ + private Date time; + + /** + * 场所负责人 + */ + private String personInCharge; + + /** + * 负责人电话 + */ + private String mobile; + + /** + * 备注 + */ + private String remarks; + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPlacePatrolTeamStaffEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPlacePatrolTeamStaffEntity.java new file mode 100644 index 0000000000..fc16a6dc42 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPlacePatrolTeamStaffEntity.java @@ -0,0 +1,66 @@ +/** + * 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.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 场所分队下人员管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_place_patrol_team_staff") +public class IcPlacePatrolTeamStaffEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 巡查分队(place_patrol_team)表Id + */ + private String placePatrolTeamId; + + /** + * 成员姓名 + */ + private String name; + + /** + * 成员电话 + */ + private String mobile; + + /** + * 备注 + */ + private String remarks; + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPropertyManagementEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPropertyManagementEntity.java new file mode 100644 index 0000000000..68dd3a349e --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPropertyManagementEntity.java @@ -0,0 +1,46 @@ +/** + * 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.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 物业表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_property_management") +public class IcPropertyManagementEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 物业名称 + */ + private String name; + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcBuildingExcel.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcBuildingExcel.java new file mode 100644 index 0000000000..ed1afb786a --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcBuildingExcel.java @@ -0,0 +1,127 @@ +/** + * 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.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import com.epmet.util.ExcelVerifyInfo; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + * 楼栋信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-27 + */ +@Data +public class IcBuildingExcel extends ExcelVerifyInfo implements Serializable { + + /*@Excel(name = "楼栋主键") + private String id; + + @Excel(name = "客户id") + private String customerId; + + @Excel(name = "小区id") + private String neighborHoodId; + + @Excel(name = "片区id,neighbor_hood_part.id,可为空。") + private String partId; + + @Excel(name = "楼栋名称") + private String buildingName; + + @Excel(name = "楼栋类型,这里存储字典编码就可以") + private String type; + + @Excel(name = "排序") + private Integer sort; + + @Excel(name = "总单元数") + private Integer totalUnitNum; + + @Excel(name = "总楼层总数") + private Integer totalFloorNum; + + @Excel(name = "总户数") + private Integer totalHouseNum; + + @Excel(name = "中心点位:经度") + private String longitude; + + @Excel(name = "中心点位:纬度") + private String latitude; + + @Excel(name = "坐标位置") + private String coordinatePosition; + + @Excel(name = "删除标识 0未删除、1已删除") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime;*/ + + @Excel(name = "所属组织") + @NotBlank(message = "不能为空") + private String agencyName; + + @Excel(name = "所属网格") + @NotBlank(message = "不能为空") + private String gridName; + + @Excel(name = "小区名称") + @NotBlank(message = "不能为空") + @Length(max=50,message = "不能超过50个字") + private String neighborHoodName; + + @Excel(name = "楼栋名称") + @NotBlank(message = "不能为空") + private String buildingName; + + @Excel(name = "楼栋类型") + @NotBlank(message = "不能为空") + private String type; + + @Excel(name = "单元数") + @NotNull(message = "不能为空") + private Integer totalUnitNum; + + @Excel(name = "层数") + @NotNull(message = "不能为空") + private Integer totalFloorNum; + + @Excel(name = "户数") + @NotNull(message = "不能为空") + private Integer totalHouseNum; +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcHouseExcel.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcHouseExcel.java new file mode 100644 index 0000000000..be6ba11d2f --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcHouseExcel.java @@ -0,0 +1,147 @@ +/** + * 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.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import com.epmet.util.ExcelVerifyInfo; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + * 房屋信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-27 + */ +@Data +public class IcHouseExcel extends ExcelVerifyInfo implements Serializable { + + /*@Excel(name = "房屋主键") + private String id; + + @Excel(name = "客户id") + private String customerId; + + @Excel(name = "小区id") + private String neighborHoodId; + + @Excel(name = "片区id,neighbor_hood_part.id,可为空。") + private String partId; + + @Excel(name = "所属楼栋id") + private String buildingId; + + @Excel(name = "所属单元id") + private String buildingUnitId; + + @Excel(name = "房屋名字后台插入时生成") + private String houseName; + + @Excel(name = "门牌号") + private String doorName; + + @Excel(name = "房屋类型,这里存储字典value就可以") + private String houseType; + + @Excel(name = "存储字典value") + private String purpose; + + @Excel(name = "1出租;0未出租") + private Integer rentFlag; + + @Excel(name = "房主姓名") + private String ownerName; + + @Excel(name = "房主电话") + private String ownerPhone; + + @Excel(name = "房主身份证号") + private String ownerIdCard; + + @Excel(name = "删除标识 0未删除、1已删除") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime;*/ + + @Excel(name = "所属组织") + @NotBlank(message = "不能为空") + private String agencyName; + + @Excel(name = "所属网格") + @NotBlank(message = "不能为空") + private String gridName; + + @Excel(name = "所属小区") + @NotBlank(message = "不能为空") + @Length(max=50,message = "不能超过50个字") + private String neighborHoodName; + + @Excel(name = "所属楼栋") + @NotBlank(message = "不能为空") + private String buildingName; + + @Excel(name = "单元号") + @NotNull(message = "不能为空") + private Integer buildingUnit; + + @Excel(name = "门牌号") + @NotBlank(message = "不能为空") + private String doorName; + + @Excel(name = "房屋类型") + @NotBlank(message = "不能为空") + private String houseType; + + @Excel(name = "房屋用途") + @NotBlank(message = "不能为空") + private String purpose; + + @Excel(name = "出租") + @NotBlank(message = "不能为空") + private String rentFlag; + + @Excel(name = "房主姓名") + @NotBlank(message = "不能为空") + private String ownerName; + + @Excel(name = "房主电话") + @NotBlank(message = "不能为空") + private String ownerPhone; + + @Excel(name = "房主身份证") + @NotBlank(message = "不能为空") + private String ownerIdCard; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcMatterAppointmentRecordExcel.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcMatterAppointmentRecordExcel.java new file mode 100644 index 0000000000..ecbb00ee36 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcMatterAppointmentRecordExcel.java @@ -0,0 +1,92 @@ +/** + * 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.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 事项预约记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Data +public class IcMatterAppointmentRecordExcel { + + @Excel(name = "") + private String id; + + @Excel(name = "") + private String customerId; + + @Excel(name = "组织ID") + private String orgId; + + @Excel(name = "组织类型,agency:组织,grid:网格") + private String orgType; + + @Excel(name = "") + private String pid; + + @Excel(name = "") + private String pids; + + @Excel(name = "事项ID") + private String matterId; + + @Excel(name = "预约日期") + private String appointmentDate; + + @Excel(name = "预约人") + private String appointmentName; + + @Excel(name = "预约电话") + private String appointmentPhone; + + @Excel(name = "备注") + private String remark; + + @Excel(name = "预约状态【cancel:取消,appointing:预约中】") + private String status; + + @Excel(name = "") + private Integer delFlag; + + @Excel(name = "乐观锁") + private String revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + @Excel(name = "1,2,5") + private String timeId; + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcNeighborHoodExcel.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcNeighborHoodExcel.java new file mode 100644 index 0000000000..72c57047e0 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcNeighborHoodExcel.java @@ -0,0 +1,124 @@ +/** + * 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.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.util.ExcelVerifyInfo; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.Date; + +/** + * 小区表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +@Data +public class IcNeighborHoodExcel extends ExcelVerifyInfo implements Serializable { + + /*@Excel(name = "小区主键") + private String id; + + @Excel(name = "客户id") + private String customerId; + + @Excel(name = "小区名称") + private String neighborHoodName; + + @Excel(name = "组织id") + private String agencyId; + + @Excel(name = "上级组织id") + private String parentAgencyId; + + @Excel(name = "组织的所有上级组织id") + private String agencyPids; + + @Excel(name = "网格id") + private String gridId; + + @Excel(name = "详细地址") + private String address; + + @Excel(name = "备注") + private String remark; + + @Excel(name = "中心点位:经度") + private String longitude; + + @Excel(name = "中心点位:纬度") + private String latitude; + + @Excel(name = "坐标区域") + private String coordinates; + + @Excel(name = "坐标位置") + private String location; + + @Excel(name = "删除标识 0未删除、1已删除") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime;*/ + + + + + @Excel(name = "所属组织") + @NotBlank(message = "不能为空") + private String agencyName; + + @Excel(name = "所属网格") + @NotBlank(message = "不能为空") + private String gridName; + + @Excel(name = "小区名称") + @NotBlank(message = "不能为空") + @Length(max=50,message = "不能超过50个字") + private String neighborHoodName; + + @Excel(name = "关联物业") + private String propertyName; + + @Excel(name = "详细地址") + @NotBlank(message = "不能为空") + private String address; + + @Excel(name = "备注") + @Length(max=500,message = "不能超过500个字") + private String remark; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcPartyServiceCenterExcel.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcPartyServiceCenterExcel.java new file mode 100644 index 0000000000..b1779eca45 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcPartyServiceCenterExcel.java @@ -0,0 +1,98 @@ +/** + * 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.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 党群服务中心 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Data +public class IcPartyServiceCenterExcel { + + @Excel(name = "") + private String id; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "组织ID") + private String orgId; + + @Excel(name = "组织类型,agency:组织,grid:网格") + private String orgType; + + @Excel(name = "") + private String pid; + + @Excel(name = "") + private String pids; + + @Excel(name = "中心名称") + private String centerName; + + @Excel(name = "办公电话") + private String workPhone; + + @Excel(name = "上午开始办公时间") + private String amStartTime; + + @Excel(name = "上午结束办公时间") + private String amEndTime; + + @Excel(name = "下午开始办公时间") + private String pmStartTime; + + @Excel(name = "下午结束办公时间") + private String pmEndTime; + + @Excel(name = "经度") + private String longitude; + + @Excel(name = "纬度") + private String latitude; + + @Excel(name = "地址") + private String address; + + @Excel(name = "") + private Integer delFlag; + + @Excel(name = "乐观锁") + private String revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcPartyServiceCenterMatterExcel.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcPartyServiceCenterMatterExcel.java new file mode 100644 index 0000000000..465f2f7493 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcPartyServiceCenterMatterExcel.java @@ -0,0 +1,74 @@ +/** + * 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.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 党群服务中心可预约事项表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Data +public class IcPartyServiceCenterMatterExcel { + + @Excel(name = "") + private String id; + + @Excel(name = "党群服务中心ID") + private String partyServiceCenterId; + + @Excel(name = "事项名字") + private String matterName; + + @Excel(name = "预约类型,每天:everyDay,工作日:workDay,周末:weekend") + private String appointmentType; + + @Excel(name = "可预约开始时间") + private String startTime; + + @Excel(name = "可预约结束时间") + private String endTime; + + @Excel(name = "") + private Integer delFlag; + + @Excel(name = "乐观锁") + private String revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + @Excel(name = "客户ID") + private String customerId; + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcPlaceOrgExcel.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcPlaceOrgExcel.java new file mode 100644 index 0000000000..4647a3e9b9 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcPlaceOrgExcel.java @@ -0,0 +1,89 @@ +/** + * 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.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 九小场所下组织管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Data +public class IcPlaceOrgExcel { + + @Excel(name = "唯一标识") + private String id; + + @Excel(name = "客户Id") + private String customerId; + + @Excel(name = "组织Id") + private String agencyId; + + @Excel(name = "agency_id的所有上级") + private String pids; + + @Excel(name = "网格Id【场所区域】") + private String gridId; + + @Excel(name = "场所类型") + private String ninePlaceVal; + + @Excel(name = "场所名称") + private String placeOrgName; + + @Excel(name = "场所地址") + private String address; + + @Excel(name = "场所规模") + private String scale; + + @Excel(name = "场所负责人") + private String personInCharge; + + @Excel(name = "负责人电话") + private String mobile; + + @Excel(name = "备注") + private String remarks; + + @Excel(name = "删除标识:0.未删除 1.已删除") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcPlacePatrolRecordExcel.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcPlacePatrolRecordExcel.java new file mode 100644 index 0000000000..423f7b845e --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcPlacePatrolRecordExcel.java @@ -0,0 +1,101 @@ +/** + * 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.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 场所巡查记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Data +public class IcPlacePatrolRecordExcel { + + @Excel(name = "唯一标识") + private String id; + + @Excel(name = "客户Id") + private String customerId; + + @Excel(name = "组织Id") + private String agencyId; + + @Excel(name = "agency_id的所有上级") + private String pids; + + @Excel(name = "网格Id【场所区域】") + private String gridId; + + @Excel(name = "场所类型【admin库sys_dict_data表九小场所value值】") + private String ninePlaceVal; + + @Excel(name = "场所下的组织Id") + private String placeOrgId; + + @Excel(name = "场所下分队(place_patrolteam)表Id") + private String placePatrolTeamId; + + @Excel(name = "分队下检查人员Id,分号分隔") + private String inspectors; + + @Excel(name = "首次巡查时间") + private Date firstTime; + + @Excel(name = "隐患明细") + private String detailed; + + @Excel(name = "首次检查结果【0:合格 1:不合格】") + private String firstResult; + + @Excel(name = "拟复查时间") + private Date reviewTime; + + @Excel(name = "最终检查结果【0:合格 1:不合格】初始数据默认和首次检查结果相同") + private String finalResult; + + @Excel(name = "最新复查时间【初始数据默认和首次巡查时间相同】") + private Date finalTime; + + @Excel(name = "备注") + private String remarks; + + @Excel(name = "删除标识:0.未删除 1.已删除") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcPlacePatrolReviewRecordExcel.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcPlacePatrolReviewRecordExcel.java new file mode 100644 index 0000000000..3a997045a3 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcPlacePatrolReviewRecordExcel.java @@ -0,0 +1,80 @@ +/** + * 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.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 场所巡查复查记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Data +public class IcPlacePatrolReviewRecordExcel { + + @Excel(name = "唯一标识") + private String id; + + @Excel(name = "客户Id") + private String customerId; + + @Excel(name = "巡查记录主(place_patrol_record)表Id") + private String placePatrolRecordId; + + @Excel(name = "场所下分队(place_patrol_team)表Id") + private String placePatrolTeamId; + + @Excel(name = "检查人员Id,逗号分隔") + private String inspectors; + + @Excel(name = "复查时间") + private Date reviewTime; + + @Excel(name = "复查隐患明细") + private String detailed; + + @Excel(name = "复查检查结果【0:合格 1:不合格】") + private String reviewResult; + + @Excel(name = "备注") + private String remarks; + + @Excel(name = "删除标识:0.未删除 1.已删除") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcPlacePatrolTeamExcel.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcPlacePatrolTeamExcel.java new file mode 100644 index 0000000000..1e5da44cfa --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcPlacePatrolTeamExcel.java @@ -0,0 +1,89 @@ +/** + * 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.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 场所分队管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Data +public class IcPlacePatrolTeamExcel { + + @Excel(name = "唯一标识") + private String id; + + @Excel(name = "客户Id") + private String customerId; + + @Excel(name = "组织Id") + private String agencyId; + + @Excel(name = "agency_id的所有上级") + private String pids; + + @Excel(name = "负责区域【网格Id 多个值逗号分隔】") + private String gridIds; + + @Excel(name = "负责场所类型【admin库sys_dict_data表九小场所value值 多个值逗号分隔】") + private String ninePlaceVals; + + @Excel(name = "分队名称") + private String teamName; + + @Excel(name = "巡查计划") + private String plan; + + @Excel(name = "创建(建队)时间") + private Date time; + + @Excel(name = "场所负责人") + private String personInCharge; + + @Excel(name = "负责人电话") + private String mobile; + + @Excel(name = "备注") + private String remarks; + + @Excel(name = "删除标识:0.未删除 1.已删除") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcPlacePatrolTeamStaffExcel.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcPlacePatrolTeamStaffExcel.java new file mode 100644 index 0000000000..99e1641231 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcPlacePatrolTeamStaffExcel.java @@ -0,0 +1,71 @@ +/** + * 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.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 场所分队下人员管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Data +public class IcPlacePatrolTeamStaffExcel { + + @Excel(name = "唯一标识") + private String id; + + @Excel(name = "客户Id") + private String customerId; + + @Excel(name = "巡查分队(place_patrol_team)表Id") + private String placePatrolTeamId; + + @Excel(name = "成员姓名") + private String name; + + @Excel(name = "成员电话") + private String mobile; + + @Excel(name = "备注") + private String remarks; + + @Excel(name = "删除标识:0.未删除 1.已删除") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/mq/listener/InitCustomerOrgRolesListener.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/mq/listener/InitCustomerOrgRolesListener.java index 7224ea757a..11bcc80e38 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/mq/listener/InitCustomerOrgRolesListener.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/mq/listener/InitCustomerOrgRolesListener.java @@ -1,16 +1,20 @@ package com.epmet.mq.listener; import com.alibaba.fastjson.JSON; +import com.epmet.commons.rocketmq.constants.MQUserPropertys; import com.epmet.commons.rocketmq.messages.InitCustomerMQMsg; import com.epmet.commons.tools.distributedlock.DistributedLock; import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.redis.RedisKeys; +import com.epmet.commons.tools.redis.RedisUtils; import com.epmet.commons.tools.utils.SpringContextUtils; import com.epmet.constant.UserWorkType; import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.form.AddAgencyAndStaffFormDTO; import com.epmet.dto.form.AdminStaffFromDTO; import com.epmet.service.AgencyService; +import org.apache.commons.lang3.StringUtils; import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext; import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus; import org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently; @@ -32,8 +36,15 @@ public class InitCustomerOrgRolesListener implements MessageListenerConcurrently private Logger logger = LoggerFactory.getLogger(getClass()); + private RedisUtils redisUtils; + @Override public ConsumeConcurrentlyStatus consumeMessage(List msgs, ConsumeConcurrentlyContext context) { + + if (redisUtils == null) { + redisUtils = SpringContextUtils.getBean(RedisUtils.class); + } + try { msgs.forEach(msg -> consumeMessage(msg)); } catch (Exception e) { @@ -45,6 +56,7 @@ public class InitCustomerOrgRolesListener implements MessageListenerConcurrently private void consumeMessage(MessageExt messageExt) { String msg = new String(messageExt.getBody()); + String pendingMsgLabel = messageExt.getUserProperty(MQUserPropertys.BLOCKED_MSG_LABEL); logger.info("初始化客户-初始化组织信息-收到消息内容:{}", msg); InitCustomerMQMsg msgObj = JSON.parseObject(msg, InitCustomerMQMsg.class); @@ -65,6 +77,14 @@ public class InitCustomerOrgRolesListener implements MessageListenerConcurrently } finally { distributedLock.unLock(lock); } + + if (StringUtils.isNotBlank(pendingMsgLabel)) { + try { + removePendingMqMsgCache(pendingMsgLabel); + } catch (Exception e) { + logger.error("【客户初始化事件监听器】-orgRole-删除mq阻塞消息缓存失败:{}", ExceptionUtils.getErrorStackTrace(e)); + } + } } /** @@ -100,6 +120,20 @@ public class InitCustomerOrgRolesListener implements MessageListenerConcurrently return agencyAndStaff; } + /** + * @description + * + * @param pendingMsgLabel + * @return + * @author wxz + * @date 2021.10.14 16:32:32 + */ + private void removePendingMqMsgCache(String pendingMsgLabel) { + String key = RedisKeys.blockedMqMsgKey(pendingMsgLabel); + redisUtils.delete(key); + //logger.info("【客户初始化事件监听器】删除mq阻塞消息缓存成功,penddingMsgLabel:{}", pendingMsgLabel); + } + /* @Override public ConsumerConfigProperties getConsumerProperty() { ConsumerConfigProperties configProperties = new ConsumerConfigProperties(); diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerAgencyRedis.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerAgencyRedis.java index 80cc342c73..fb65a508d5 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerAgencyRedis.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerAgencyRedis.java @@ -38,9 +38,6 @@ public class CustomerAgencyRedis { @Autowired private RedisUtils redisUtils; - public void delete(Object[] ids) { - - } public void delete(String agencyId) { String key = RedisKeys.getAgencyByIdKey(agencyId); @@ -62,4 +59,4 @@ public class CustomerAgencyRedis { return BeanUtil.mapToBean(resultMap, CustomerAgencyDTO.class, true); } -} \ No newline at end of file +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerStaffGridRedis.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/IcBuildingRedis.java similarity index 92% rename from epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerStaffGridRedis.java rename to epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/IcBuildingRedis.java index 23b0eab20a..976590a3ae 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerStaffGridRedis.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/IcBuildingRedis.java @@ -22,13 +22,13 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; /** - * 网格人员关系表 + * 楼栋信息 * * @author generator generator@elink-cn.com - * @since v1.0.0 2020-04-20 + * @since v1.0.0 2021-10-27 */ @Component -public class CustomerStaffGridRedis { +public class IcBuildingRedis { @Autowired private RedisUtils redisUtils; diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerStaffDepartmentRedis.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/IcHouseRedis.java similarity index 92% rename from epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerStaffDepartmentRedis.java rename to epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/IcHouseRedis.java index 3c8bfdb608..9159c6eb88 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerStaffDepartmentRedis.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/IcHouseRedis.java @@ -22,13 +22,13 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; /** - * 部门人员关系表 + * 房屋信息 * * @author generator generator@elink-cn.com - * @since v1.0.0 2020-04-20 + * @since v1.0.0 2021-10-27 */ @Component -public class CustomerStaffDepartmentRedis { +public class IcHouseRedis { @Autowired private RedisUtils redisUtils; diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/IcNeighborHoodRedis.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/IcNeighborHoodRedis.java new file mode 100644 index 0000000000..9de1516e7f --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/IcNeighborHoodRedis.java @@ -0,0 +1,47 @@ +/** + * 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.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 小区表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +@Component +public class IcNeighborHoodRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/StaffTransferRecordRedis.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/StaffTransferRecordRedis.java deleted file mode 100644 index deb0f9f76a..0000000000 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/StaffTransferRecordRedis.java +++ /dev/null @@ -1,47 +0,0 @@ -/** - * 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.redis; - -import com.epmet.commons.tools.redis.RedisUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -/** - * 工作人员调动记录表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-08-27 - */ -@Component -public class StaffTransferRecordRedis { - @Autowired - private RedisUtils redisUtils; - - public void delete(Object[] ids) { - - } - - public void set(){ - - } - - public String get(String id){ - return null; - } - -} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java index 381fb7256a..d85f2d8b68 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java @@ -17,13 +17,11 @@ package com.epmet.service; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.form.*; -import com.epmet.dto.result.AddAgencyResultDTO; -import com.epmet.dto.result.AgencyListResultDTO; -import com.epmet.dto.result.AgencysResultDTO; -import com.epmet.dto.result.SubAgencyResultDTO; +import com.epmet.dto.result.*; import com.epmet.entity.CustomerAgencyEntity; import java.util.List; @@ -107,7 +105,7 @@ public interface AgencyService { * @Description 单客户-添加根组织及客户管理员信息 * @Date 2020/7/16 17:13 **/ - void saveRootAgency(AddAgencyAndStaffFormDTO agencyAndStaff); + String saveRootAgency(AddAgencyAndStaffFormDTO agencyAndStaff); /** * 添加组织V2 @@ -117,4 +115,45 @@ public interface AgencyService { */ AddAgencyResultDTO addAgencyV2(AddAgencyV2FormDTO formDTO); + /** + * @Description 【地图配置】删除 + * @param formDTO + * @author zxc + * @date 2021/10/25 9:30 上午 + */ + void mapDelArea(MapDelAreaFormDTO formDTO); + + /** + * @Description 【地图配置】新增 + * @param formDTO + * @author zxc + * @date 2021/10/25 9:58 上午 + */ + void mapAddArea(MapAddAreaFormDTO formDTO); + + /** + * @Description 【地图配置】组织查询 + * @param formDTO + * @param tokenDto + * @author zxc + * @date 2021/10/25 10:50 上午 + */ + MapOrgResultDTO mapOrg(MapOrgFormDTO formDTO, TokenDto tokenDto); + + /** + * @Description 查询楼栋信息 + * @param formDTO + * @author zxc + * @date 2021/11/2 9:18 上午 + */ + List baseInfoFamilyBuilding(BaseInfoFamilyBuildingFormDTO formDTO); + + /** + * @Description 查询下级agencyId + * @param orgId + * @author zxc + * @date 2021/12/9 4:42 下午 + */ + List getSonAgencyId(String orgId); + } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/BuildingService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/BuildingService.java new file mode 100644 index 0000000000..3a78628602 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/BuildingService.java @@ -0,0 +1,65 @@ +/** + * 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.service; + +import com.epmet.dto.BuildingTreeLevelDTO; +import com.epmet.dto.form.IcBulidingFormDTO; +import com.epmet.dto.form.ListIcNeighborHoodFormDTO; +import com.epmet.dto.result.BuildingResultDTO; +import com.epmet.dto.result.BuildingResultPagedDTO; +import com.epmet.dto.result.IcNeighborHoodResultDTO; +import com.epmet.excel.IcBuildingExcel; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +/** + * 楼栋 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +public interface BuildingService { + + + + + + void UpdateBuilding(String customerId, IcBulidingFormDTO formDTO); + + /** + * 删除小区 + * @param buildingId + */ + void DelBuilding(String buildingId); + + + void AddBuilding(String customerId, IcBulidingFormDTO formDTO); + + List treeList(String customerId); + + List importExcel(String customerId, List list, String staffId, List numList); + + IcNeighborHoodResultDTO listBuilding(ListIcNeighborHoodFormDTO formDTO); + + void exportBuildinginfo(ListIcNeighborHoodFormDTO formDTO, HttpServletResponse response) throws Exception ; + + List buildingListByIds(List buildingIdList); + + BuildingResultPagedDTO buildinglistbyidsPage(List buildingIdList, Integer pageNo, Integer pageSize); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java index b13bae23e7..4cacf505ef 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java @@ -19,7 +19,6 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; -import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.form.*; @@ -255,4 +254,13 @@ public interface CustomerAgencyService extends BaseService * @Date 2021/9/8 15:21 */ AgencyTreeResultDTO getAgencyList(GetAgencyListFormDTO formDTO); -} \ No newline at end of file + + List getStaffOrgListByStaffId(String staffId); + + /** + * desc:获取用户所属组织的组织及网格树 + * @param staffId + * @return + */ + AgencyTreeResultDTO getOrgTreeData(String staffId); +} 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 91525436ba..2b2624ac54 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 @@ -18,6 +18,7 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.dto.result.OptionResultDTO; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; @@ -319,4 +320,38 @@ public interface CustomerGridService extends BaseService { * @date 2021/8/5 10:08 上午 */ List selectOrgsByUserId(String userId); + + /** + * @Description 获取组织下网格树 + * @Param formDTO + * @Return {@link List} + * @Author zhaoqifeng + * @Date 2021/10/25 16:28 + */ + List getGridTree(AgencyIdFormDTO formDTO); + + /** + * @Description 获取组织下网格选项 + * @Param agencyId + * @Return {@link List< OptionResultDTO>} + * @Author zhaoqifeng + * @Date 2021/10/26 14:01 + */ + List getGridOption(String agencyId,String purpose); + + + /** + * @Description 获取组织下网格 + * @Param agencyId + * @Return {@link List< CustomerGridDTO>} + * @Author zhaoqifeng + * @Date 2021/11/29 17:00 + */ + List getGridIListByAgency(String agencyId); + + /** + * @Author sun + * @Description 查询组织直属网格列表 + **/ + List gridListByAgencyId(String agencyId); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerPartyBranchService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerPartyBranchService.java index e373bcb0f1..9cd6efe4b9 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerPartyBranchService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerPartyBranchService.java @@ -18,6 +18,7 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.dto.result.OptionResultDTO; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.CustomerPartyBranchDTO; import com.epmet.dto.form.ListPartyBranchFormDTO; @@ -112,4 +113,13 @@ public interface CustomerPartyBranchService extends BaseService} + * @Author zhaoqifeng + * @Date 2021/10/27 9:57 + */ + List getBranchOption(String gridId); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java new file mode 100644 index 0000000000..48ab8c7d1b --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java @@ -0,0 +1,57 @@ +/** + * 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.service; + +import com.epmet.dto.form.IcHouseFormDTO; +import com.epmet.dto.form.ListIcNeighborHoodFormDTO; +import com.epmet.dto.result.HouseInfoDTO; +import com.epmet.dto.result.IcNeighborHoodResultDTO; +import com.epmet.excel.IcHouseExcel; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Set; + +/** + * 小区表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +public interface HouseService { + + void addHouse(String customerId, IcHouseFormDTO formDTO); + + + void updateHouse(String customerId, IcHouseFormDTO formDTO); + + /** + * 删除小区 + * @param houseId + */ + void delHouse(String houseId); + + + List importExcel(String customerId, List list, String staffId, List numList); + + IcNeighborHoodResultDTO listNeighborhood(ListIcNeighborHoodFormDTO formDTO); + + void exportBuildinginfo(ListIcNeighborHoodFormDTO formDTO, HttpServletResponse response) throws Exception; + + List queryListHouseInfo(Set houseIds); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcBuildingService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcBuildingService.java new file mode 100644 index 0000000000..5b5ff7d05d --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcBuildingService.java @@ -0,0 +1,105 @@ +/** + * 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.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.dto.result.OptionResultDTO; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcBuildingDTO; +import com.epmet.entity.IcBuildingEntity; + +import java.util.List; +import java.util.Map; + +/** + * 楼栋信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +public interface IcBuildingService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-10-25 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-10-25 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcBuildingDTO + * @author generator + * @date 2021-10-25 + */ + IcBuildingDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-10-25 + */ + void save(IcBuildingDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-10-25 + */ + void update(IcBuildingDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-10-25 + */ + void delete(String[] ids); + + /** + * @Description 获取小区内的楼栋 + * @Param neighborHoodId + * @Return {@link List< OptionResultDTO>} + * @Author zhaoqifeng + * @Date 2021/10/26 14:43 + */ + List getBuildingOptions(String neighborHoodId); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcBuildingUnitService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcBuildingUnitService.java new file mode 100644 index 0000000000..40045f2b75 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcBuildingUnitService.java @@ -0,0 +1,105 @@ +/** + * 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.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.dto.result.OptionResultDTO; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcBuildingUnitDTO; +import com.epmet.entity.IcBuildingUnitEntity; + +import java.util.List; +import java.util.Map; + +/** + * 楼栋单元信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +public interface IcBuildingUnitService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-10-25 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-10-25 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcBuildingUnitDTO + * @author generator + * @date 2021-10-25 + */ + IcBuildingUnitDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-10-25 + */ + void save(IcBuildingUnitDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-10-25 + */ + void update(IcBuildingUnitDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-10-25 + */ + void delete(String[] ids); + + /** + * @Description 获取楼栋内单元 + * @Param buildingId + * @Return {@link List} + * @Author zhaoqifeng + * @Date 2021/10/26 14:49 + */ + List getUnitOptions(String buildingId); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcHouseService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcHouseService.java new file mode 100644 index 0000000000..66f02d80fa --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcHouseService.java @@ -0,0 +1,127 @@ +/** + * 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.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.dto.result.OptionResultDTO; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.dto.IcHouseDTO; +import com.epmet.dto.form.HouseFormDTO; +import com.epmet.dto.result.HouseListResultDTO; +import com.epmet.entity.IcHouseEntity; + +import java.util.List; +import java.util.Map; + +/** + * 房屋信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +public interface IcHouseService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-10-25 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-10-25 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcHouseDTO + * @author generator + * @date 2021-10-25 + */ + IcHouseDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-10-25 + */ + void save(IcHouseDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-10-25 + */ + void update(IcHouseDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-10-25 + */ + void delete(String[] ids); + + /** + * @Description 获取楼栋房屋列表 + * @Param formDTO + * @Return {@link List} + * @Author zhaoqifeng + * @Date 2021/10/25 17:04 + */ + List getHouseOption(HouseFormDTO formDTO); + + /** + * @Description 查询房屋信息 + * @param idCard + * @author zxc + * @date 2021/11/3 3:30 下午 + */ + List selectHouseInfoByIdCard(String idCard); + + /** + * @Description 楼栋下房屋列表 + * @Param tokenDto + * @Param formDTO + * @Return {@link List< HouseListResultDTO>} + * @Author zhaoqifeng + * @Date 2021/11/5 16:01 + */ + List getHouseList(TokenDto tokenDto, HouseFormDTO formDTO); + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcMatterAppointmentRecordService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcMatterAppointmentRecordService.java new file mode 100644 index 0000000000..4f330654a9 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcMatterAppointmentRecordService.java @@ -0,0 +1,95 @@ +/** + * 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.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcMatterAppointmentRecordDTO; +import com.epmet.entity.IcMatterAppointmentRecordEntity; + +import java.util.List; +import java.util.Map; + +/** + * 事项预约记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +public interface IcMatterAppointmentRecordService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-11-18 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-11-18 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcMatterAppointmentRecordDTO + * @author generator + * @date 2021-11-18 + */ + IcMatterAppointmentRecordDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-11-18 + */ + void save(IcMatterAppointmentRecordDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-11-18 + */ + void update(IcMatterAppointmentRecordDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-11-18 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcNeighborHoodPartService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcNeighborHoodPartService.java new file mode 100644 index 0000000000..787f8a534a --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcNeighborHoodPartService.java @@ -0,0 +1,95 @@ +/** + * 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.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcNeighborHoodPartDTO; +import com.epmet.entity.IcNeighborHoodPartEntity; + +import java.util.List; +import java.util.Map; + +/** + * 小区-分区表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +public interface IcNeighborHoodPartService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-10-25 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-10-25 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcNeighborHoodPartDTO + * @author generator + * @date 2021-10-25 + */ + IcNeighborHoodPartDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-10-25 + */ + void save(IcNeighborHoodPartDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-10-25 + */ + void update(IcNeighborHoodPartDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-10-25 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcNeighborHoodPropertyService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcNeighborHoodPropertyService.java new file mode 100644 index 0000000000..e9df133f87 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcNeighborHoodPropertyService.java @@ -0,0 +1,95 @@ +/** + * 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.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcNeighborHoodPropertyDTO; +import com.epmet.entity.IcNeighborHoodPropertyEntity; + +import java.util.List; +import java.util.Map; + +/** + * 小区物业关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +public interface IcNeighborHoodPropertyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-10-25 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-10-25 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcNeighborHoodPropertyDTO + * @author generator + * @date 2021-10-25 + */ + IcNeighborHoodPropertyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-10-25 + */ + void save(IcNeighborHoodPropertyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-10-25 + */ + void update(IcNeighborHoodPropertyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-10-25 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcNeighborHoodService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcNeighborHoodService.java new file mode 100644 index 0000000000..3592d82175 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcNeighborHoodService.java @@ -0,0 +1,115 @@ +/** + * 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.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.dto.result.OptionResultDTO; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcNeighborHoodDTO; +import com.epmet.entity.IcNeighborHoodEntity; + +import java.util.List; +import java.util.Map; + +/** + * 小区表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +public interface IcNeighborHoodService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-10-25 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-10-25 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcNeighborHoodDTO + * @author generator + * @date 2021-10-25 + */ + IcNeighborHoodDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-10-25 + */ + void save(IcNeighborHoodDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-10-25 + */ + void update(IcNeighborHoodDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-10-25 + */ + void delete(String[] ids); + + /** + * @Description 获取网格下小区列表 + * @Param agencyId + * @Param gridId + * @Return {@link List} + * @Author zhaoqifeng + * @Date 2021/10/26 14:32 + */ + List getNeighborHoodOptions(String agencyId, String gridId,String staffId,String customerId); + + /** + * @Description 通过ID查询小区信息 + * @Param ids + * @Return {@link List< IcNeighborHoodDTO>} + * @Author zhaoqifeng + * @Date 2021/11/8 10:45 + */ + List getListByIds(List ids); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPartyServiceCenterMatterService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPartyServiceCenterMatterService.java new file mode 100644 index 0000000000..23ac454d97 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPartyServiceCenterMatterService.java @@ -0,0 +1,111 @@ +/** + * 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.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcPartyServiceCenterMatterDTO; +import com.epmet.entity.IcPartyServiceCenterMatterEntity; + +import java.util.List; +import java.util.Map; + +/** + * 党群服务中心可预约事项表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +public interface IcPartyServiceCenterMatterService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-11-18 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-11-18 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcPartyServiceCenterMatterDTO + * @author generator + * @date 2021-11-18 + */ + IcPartyServiceCenterMatterDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-11-18 + */ + void save(IcPartyServiceCenterMatterDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-11-18 + */ + void update(IcPartyServiceCenterMatterDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-11-18 + */ + void delete(String[] ids); + + /** + * @Description 根据党群服务中心删除事项 + * @param partyServiceCenterId + * @author zxc + * @date 2021/11/22 10:29 上午 + */ + void deleteMattersByPartyServiceCenterId(String partyServiceCenterId); + + /** + * @Description 根据党群服务中心ID查询事件名字 + * @param centerId + * @author zxc + * @date 2021/12/10 8:56 上午 + */ + List selectMatterNameByCenterId(String centerId); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPartyServiceCenterService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPartyServiceCenterService.java new file mode 100644 index 0000000000..9bbfcaf44e --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPartyServiceCenterService.java @@ -0,0 +1,169 @@ +/** + * 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.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.dto.IcPartyServiceCenterDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.result.AppointmentRecordResultDTO; +import com.epmet.dto.result.AppointmentTimeResultDTO; +import com.epmet.dto.result.PartyServiceCenterListResultDTO; +import com.epmet.entity.IcPartyServiceCenterEntity; + +import java.util.List; +import java.util.Map; + +/** + * 党群服务中心 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +public interface IcPartyServiceCenterService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-11-18 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-11-18 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcPartyServiceCenterDTO + * @author generator + * @date 2021-11-18 + */ + IcPartyServiceCenterDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-11-18 + */ + void save(IcPartyServiceCenterDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-11-18 + */ + void update(IcPartyServiceCenterDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-11-18 + */ + void delete(String[] ids); + + /** + * @Description 新增党群服务中心 + * @param formDTO + * @param tokenDto + * @author zxc + * @date 2021/11/22 9:13 上午 + */ + void addPartyServiceCenter(AddPartyServiceCenterFormDTO formDTO, TokenDto tokenDto); + + /** + * @Description 修改党群服务中心 + * @param formDTO + * @param tokenDto + * @author zxc + * @date 2021/11/22 10:21 上午 + */ + void editPartyServiceCenter(EditPartyServiceCenterFormDTO formDTO,TokenDto tokenDto); + + /** + * @Description 事项删除 + * @param formDTO + * @author zxc + * @date 2021/11/22 1:25 下午 + */ + void delMatter(DelMatterFormDTO formDTO); + + /** + * @Description 预约 + * @param formDTO + * @param tokenDto + * @author zxc + * @date 2021/11/22 2:06 下午 + */ + void appointment(AppointmentFormDTO formDTO,TokenDto tokenDto); + + /** + * @Description 党群服务中心列表 + * @param formDTO + * @param tokenDto + * @author zxc + * @date 2021/11/22 2:47 下午 + */ + List partyServiceCenterList(PartyServiceCenterListFormDTO formDTO,TokenDto tokenDto); + + /** + * @Description 【党群服务中心】点击预约按钮时,查询可选时间 + * @param formDTO + * @author zxc + * @date 2021/11/23 10:02 上午 + */ + AppointmentTimeResultDTO appointmentTime(AppointmentTimeFormDTO formDTO); + + /** + * @Description 【党群服务中心】预约记录 + * @param formDTO + * @author zxc + * @date 2021/11/23 10:50 上午 + */ + List appointmentRecord(AppointmentRecordFormDTO formDTO); + + /** + * @Description 取消预约 + * @param formDTO + * @author zxc + * @date 2021/11/26 5:21 下午 + */ + void cancelAppointment(CancelAppointmentFormDTO formDTO); + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPlaceOrgService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPlaceOrgService.java new file mode 100644 index 0000000000..e8fed58f7a --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPlaceOrgService.java @@ -0,0 +1,65 @@ +/** + * 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.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.form.AddPlaceOrgFormDTO; +import com.epmet.dto.form.EditPlaceOrgFormDTO; +import com.epmet.dto.form.GetListPlaceOrgFormDTO; +import com.epmet.dto.result.GetListPlaceOrgResultDTO; +import com.epmet.dto.result.PlaceOrgDetailResultDTO; +import com.epmet.entity.IcPlaceOrgEntity; + +/** + * 九小场所下组织管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +public interface IcPlaceOrgService extends BaseService { + + /** + * @Author sun + * @Description 新增九小场所下组织 + **/ + void add(AddPlaceOrgFormDTO formDTO); + + /** + * @Author sun + * @Description 修改九小场所下组织 + **/ + void edit(EditPlaceOrgFormDTO formDTO); + + /** + * @Author sun + * @Description 删除九小场所下组织 + **/ + void del(String placeOrgId); + + /** + * @Author sun + * @Description 九小场所下组织详情 + **/ + PlaceOrgDetailResultDTO detail(String placeOrgId); + + /** + * @Author sun + * @Description 九小场所下组织列表查询 + **/ + GetListPlaceOrgResultDTO getList(GetListPlaceOrgFormDTO formDTO); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPlacePatrolRecordService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPlacePatrolRecordService.java new file mode 100644 index 0000000000..3b0c2c6e12 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPlacePatrolRecordService.java @@ -0,0 +1,58 @@ +/** + * 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.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.form.AddPlacePatrolRecordFormDTO; +import com.epmet.dto.form.GetListPlacePatrolRecordFormDTO; +import com.epmet.dto.result.GetListPlacePatrolRecordResultDTO; +import com.epmet.dto.result.PlacePatrolRecordDetailResultDTO; +import com.epmet.entity.IcPlacePatrolRecordEntity; + +/** + * 场所巡查记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +public interface IcPlacePatrolRecordService extends BaseService { + + /** + * @Author sun + * @Description 新增场所巡查记录 + **/ + void add(AddPlacePatrolRecordFormDTO formDTO); + + /** + * @Author sun + * @Description 删除场所巡查记录 + **/ + void del(String staffId, String placePatrolRecordId); + + /** + * @Author sun + * @Description 场所巡查记录详情 + **/ + PlacePatrolRecordDetailResultDTO detail(String placePatrolRecordId); + + /** + * @Author sun + * @Description 场所巡查记录列表查询 + **/ + GetListPlacePatrolRecordResultDTO getList(GetListPlacePatrolRecordFormDTO formDTO); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPlacePatrolReviewRecordService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPlacePatrolReviewRecordService.java new file mode 100644 index 0000000000..1bc4b86fe5 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPlacePatrolReviewRecordService.java @@ -0,0 +1,71 @@ +/** + * 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.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.form.AddPlacePatrolReviewRecordFormDTO; +import com.epmet.dto.form.EditPlacePatrolReviewRecordFormDTO; +import com.epmet.dto.form.GetListPlacePatrolReviewRecordFormDTO; +import com.epmet.dto.result.GetListPlacePatrolReviewRecordResultDTO; +import com.epmet.dto.result.PlacePatrolReviewRecordDetailResultDTO; +import com.epmet.entity.IcPlacePatrolReviewRecordEntity; + +/** + * 场所巡查复查记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +public interface IcPlacePatrolReviewRecordService extends BaseService { + + /** + * @Author sun + * @Description 新增巡查复查记录 + **/ + PlacePatrolReviewRecordDetailResultDTO add(AddPlacePatrolReviewRecordFormDTO formDTO); + + /** + * @Author sun + * @Description 修改巡查复查记录 + **/ + PlacePatrolReviewRecordDetailResultDTO edit(EditPlacePatrolReviewRecordFormDTO formDTO); + + /** + * @Author sun + * @Description 删除巡查复查记录 + **/ + void del(String placePatrolReviewRecordId); + + /** + * @Author sun + * @Description 巡查复查记录详情 + **/ + PlacePatrolReviewRecordDetailResultDTO detail(String placePatrolReviewRecordId); + + /** + * @Author sun + * @Description 巡查复查记录列表查询 + **/ + GetListPlacePatrolReviewRecordResultDTO getList(GetListPlacePatrolReviewRecordFormDTO formDTO); + + /** + * @Author sun + * @Description 删除巡查记录对应的复查记录 + **/ + int delByPatrolRecordId(String staffId, String placePatrolRecordId); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPlacePatrolTeamService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPlacePatrolTeamService.java new file mode 100644 index 0000000000..6ec9cf1a96 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPlacePatrolTeamService.java @@ -0,0 +1,65 @@ +/** + * 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.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.form.AddPlacePatrolTeamFormDTO; +import com.epmet.dto.form.EditPlacePatrolTeamFormDTO; +import com.epmet.dto.form.GetListPlacePatrolTeamFormDTO; +import com.epmet.dto.result.GetListPlacePatrolTeamResultDTO; +import com.epmet.dto.result.PlacePatrolTeamDetailResultDTO; +import com.epmet.entity.IcPlacePatrolTeamEntity; + +/** + * 场所分队管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +public interface IcPlacePatrolTeamService extends BaseService { + + /** + * @Author sun + * @Description 新增九小场所巡查分队人员管理 + **/ + void add(AddPlacePatrolTeamFormDTO formDTO); + + /** + * @Author sun + * @Description 修改九小场所巡查分队人员管理 + **/ + void edit(EditPlacePatrolTeamFormDTO formDTO); + + /** + * @Author sun + * @Description 删除九小场所巡查分队人员管理 + **/ + void del(String staffId, String teamId); + + /** + * @Author sun + * @Description 九小场所巡查分队人员管理详情 + **/ + PlacePatrolTeamDetailResultDTO detail(String teamId); + + /** + * @Author sun + * @Description 九小场所巡查分队人员管理列表查询 + **/ + GetListPlacePatrolTeamResultDTO getList(GetListPlacePatrolTeamFormDTO formDTO); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPlacePatrolTeamStaffService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPlacePatrolTeamStaffService.java new file mode 100644 index 0000000000..a622e03811 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPlacePatrolTeamStaffService.java @@ -0,0 +1,52 @@ +/** + * 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.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.IcPlacePatrolTeamStaffDTO; +import com.epmet.dto.form.GetListPlacePatrolTeamFormDTO; +import com.epmet.entity.IcPlacePatrolTeamStaffEntity; + +import java.util.List; + +/** + * 场所分队下人员管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +public interface IcPlacePatrolTeamStaffService extends BaseService { + + /** + * @Author sun + * @Description 删除分队下成员信息 + **/ + int delByTeamId(String teamId); + + /** + * @Author sun + * @Description 查询分队下人员列表数据 + **/ + List getList(String teamId); + + /** + * @Author sun + * @Description 逻辑删除分队成员子表数据 + **/ + void upByTeamId(String staffId, String teamId); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPropertyManagementService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPropertyManagementService.java new file mode 100644 index 0000000000..bc808af034 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPropertyManagementService.java @@ -0,0 +1,95 @@ +/** + * 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.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcPropertyManagementDTO; +import com.epmet.entity.IcPropertyManagementEntity; + +import java.util.List; +import java.util.Map; + +/** + * 物业表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +public interface IcPropertyManagementService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-10-25 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-10-25 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcPropertyManagementDTO + * @author generator + * @date 2021-10-25 + */ + IcPropertyManagementDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-10-25 + */ + void save(IcPropertyManagementDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-10-25 + */ + void update(IcPropertyManagementDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-10-25 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/NeighborHoodService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/NeighborHoodService.java new file mode 100644 index 0000000000..ff1a35f45a --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/NeighborHoodService.java @@ -0,0 +1,56 @@ +/** + * 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.service; + +import com.epmet.dto.form.IcNeighborHoodFormDTO; +import com.epmet.dto.form.ListIcNeighborHoodFormDTO; +import com.epmet.dto.result.IcNeighborHoodResultDTO; +import com.epmet.excel.IcNeighborHoodExcel; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +/** + * 小区表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +public interface NeighborHoodService{ + + void AddNeighborhood(String customerId, IcNeighborHoodFormDTO formDTO); + + IcNeighborHoodResultDTO listNeighborhood(ListIcNeighborHoodFormDTO formDTO); + + void UpdateNeighborhood(String customerId, IcNeighborHoodFormDTO formDTO); + + /** + * 删除小区 + * @param neighborHoodId + */ + void DelNeighborhood(String neighborHoodId); + + /** + * 导出数据 + * @param formDTO + * @param response + */ + void exportNeighborhoodinfo(ListIcNeighborHoodFormDTO formDTO, HttpServletResponse response) throws Exception ; + + List importExcel(String customerId, List list, String staffId, List numList); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/PropertyManagementService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/PropertyManagementService.java new file mode 100644 index 0000000000..7bbbad3616 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/PropertyManagementService.java @@ -0,0 +1,39 @@ +/** + * 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.service; + +import com.epmet.dto.form.IcPropertyManagementFormDTO; +import com.epmet.dto.result.IcPropertyManagementResultDTO; + +import java.util.List; + +/** + * 物业表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +public interface PropertyManagementService { + + List getList(); + + String add(IcPropertyManagementFormDTO formDTO); + + void update(IcPropertyManagementFormDTO formDTO); + void delete(IcPropertyManagementFormDTO formDTO); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java index b60e0ff31c..4bfc4487d3 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java @@ -18,23 +18,31 @@ package com.epmet.service.impl; import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +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.CustomerAgencyConstant; +import com.epmet.constant.OrgInfoConstant; import com.epmet.constant.RoleKeyConstants; import com.epmet.dao.CustomerAgencyDao; import com.epmet.dao.CustomerGridDao; +import com.epmet.dao.IcBuildingDao; import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.GovStaffRoleDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.entity.CustomerAgencyEntity; +import com.epmet.entity.CustomerGridEntity; import com.epmet.feign.EpmetCommonServiceOpenFeignClient; +import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.redis.CustomerAgencyRedis; import com.epmet.service.AgencyService; @@ -49,6 +57,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.math.BigDecimal; import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -80,6 +89,10 @@ public class AgencyServiceImpl implements AgencyService { private CustomerOrgParameterService customerOrgParameterService; @Autowired private EpmetCommonServiceOpenFeignClient epmetCommonServiceOpenFeignClient; + @Autowired + private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; + @Autowired + private IcBuildingDao icBuildingDao; /** @@ -176,6 +189,7 @@ public class AgencyServiceImpl implements AgencyService { //5.redis缓存 customerAgencyRedis.delete(formDTO.getAgencyId()); + return result; } @@ -215,6 +229,7 @@ public class AgencyServiceImpl implements AgencyService { log.error(CustomerAgencyConstant.DEL_EXCEPTION); throw new RenException(CustomerAgencyConstant.DEL_EXCEPTION); } + return result; } @@ -370,6 +385,7 @@ public class AgencyServiceImpl implements AgencyService { entity.setTotalUser(0); entity.setCustomerId(form.getCustomerId()); customerAgencyDao.insert(entity); + return entity.getId(); } @@ -382,7 +398,8 @@ public class AgencyServiceImpl implements AgencyService { **/ @Override @Transactional(rollbackFor = Exception.class) - public void saveRootAgency(AddAgencyAndStaffFormDTO agencyAndStaff) { + public String saveRootAgency(AddAgencyAndStaffFormDTO agencyAndStaff) { + String agencyId = ""; CustomerAgencyDTO agencyDTO = agencyAndStaff.getAgencyDTO(); AdminStaffFromDTO staffDTO = agencyAndStaff.getStaffDTO(); @@ -430,6 +447,8 @@ public class AgencyServiceImpl implements AgencyService { throw new RenException(EpmetErrorCode.OPER_ADD_CUSTOMER_MANAGER_ERROR.getCode(), staffResult.getMsg()); } + agencyId = entity.getId(); + return agencyId; } /** @@ -474,9 +493,159 @@ public class AgencyServiceImpl implements AgencyService { //3:返回新组织Id resultDTO.setAgencyId(insertEntity.getId()); resultDTO.setAreaCode(insertEntity.getAreaCode()); + return resultDTO; } + /** + * @Description 【地图配置】删除 + * @param formDTO + * @author zxc + * @date 2021/10/25 9:30 上午 + */ + @Override + public void mapDelArea(MapDelAreaFormDTO formDTO) { + customerAgencyDao.delMapArea(formDTO.getOrgId(),formDTO.getLevel()); + } + + /** + * @Description 【地图配置】新增 + * @param formDTO + * @author zxc + * @date 2021/10/25 9:58 上午 + */ + @Override + public void mapAddArea(MapAddAreaFormDTO formDTO) { + customerAgencyDao.addMapArea(formDTO.getOrgId(), formDTO.getLevel(), formDTO.getCoordinates()); + } + + /** + * @Description 【地图配置】组织查询 + * 根据level查询去查询不同的表,类型,组织:agency,网格:grid,小区:neighborHood + * 组织类型去查 customer_agency,看本级是不是 community,是,下级组织就是网格,查询customer_grid,不是,继续查customer_agency + * 网格类型去查 查询customer_grid,下级去查 ic_neighbor_hood, + * 当前组织没有经纬度的话,直接赋值根组织的经纬度, + * 下级组织经纬度为空的话,直接赋值上级的经纬度 + * @param formDTO + * @param tokenDto + * @author zxc + * @date 2021/10/25 10:50 上午 + */ + @Override + public MapOrgResultDTO mapOrg(MapOrgFormDTO formDTO, TokenDto tokenDto) { + MapOrgResultDTO result = new MapOrgResultDTO(); + LambdaQueryWrapper qw = new LambdaQueryWrapper(); + qw.eq(CustomerAgencyEntity::getPid, NumConstant.ZERO_STR).eq(CustomerAgencyEntity::getDelFlag, NumConstant.ZERO_STR).eq(CustomerAgencyEntity::getCustomerId,tokenDto.getCustomerId()); + CustomerAgencyEntity customerAgencyEntity = customerAgencyDao.selectOne(qw); + if (StringUtils.isBlank(formDTO.getOrgId())){ + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); + if (null == staffInfo){ + return result; + } + formDTO.setOrgId(staffInfo.getAgencyId()); + formDTO.setLevel(OrgInfoConstant.AGENCY); + } + if (StringUtils.isNotBlank(customerAgencyEntity.getLatitude())){ + result.setLatitude(new BigDecimal(customerAgencyEntity.getLatitude())); + } + if (StringUtils.isNotBlank(customerAgencyEntity.getLongitude())){ + result.setLongitude(new BigDecimal(customerAgencyEntity.getLongitude())); + } + if (formDTO.getLevel().equals(OrgInfoConstant.AGENCY)){ + CustomerAgencyEntity entity = customerAgencyDao.selectById(formDTO.getOrgId()); + result = ConvertUtils.sourceToTarget(entity,MapOrgResultDTO.class); + result.setName(entity.getOrganizationName()); + result.setLevel(formDTO.getLevel()); + result.setAgencyLevel(entity.getLevel()); + //经纬度 如果本级没有则取根级组织的 根级没有就空着 + if (StringUtils.isNotBlank(entity.getLatitude())){ + result.setLatitude(new BigDecimal(entity.getLatitude())); + } + if (StringUtils.isNotBlank(entity.getLongitude())){ + result.setLongitude(new BigDecimal(entity.getLongitude())); + } + if (entity.getLevel().equals(OrgInfoConstant.COMMUNITY)){ + List son = customerAgencyDao.selectSonOrg(formDTO.getOrgId(), OrgInfoConstant.GRID); + if (CollectionUtils.isNotEmpty(son)){ + MapOrgResultDTO finalResult = result; + son.forEach(s -> { + s.setLatitude(StringUtils.isBlank(s.getLatitudeOrigin()) ? finalResult.getLatitude() : new BigDecimal(s.getLatitudeOrigin())); + s.setLongitude(StringUtils.isBlank(s.getLongitudeOrigin()) ? finalResult.getLongitude() : new BigDecimal(s.getLongitudeOrigin())); + }); + } + result.setChildren(CollectionUtils.isEmpty(son) ? new ArrayList<>() : son); + }else { + List dtoList = new ArrayList<>(); + List son = customerAgencyDao.selectSonOrg(formDTO.getOrgId(), OrgInfoConstant.AGENCY); + if (CollectionUtils.isNotEmpty(son)){ + dtoList.addAll(son); + } + // 直属网格 + List directlySub = customerAgencyDao.selectSonOrg(formDTO.getOrgId(), OrgInfoConstant.GRID); + if (CollectionUtils.isNotEmpty(directlySub)){ + dtoList.addAll(directlySub); + } + for (MapSonOrgResultDTO d : dtoList) { + d.setLatitude(StringUtils.isBlank(d.getLatitudeOrigin()) ? result.getLatitude() : new BigDecimal(d.getLatitudeOrigin())); + d.setLongitude(StringUtils.isBlank(d.getLongitudeOrigin()) ? result.getLongitude() : new BigDecimal(d.getLongitudeOrigin())); + } + result.setChildren(dtoList); + } + }else if (formDTO.getLevel().equals(OrgInfoConstant.GRID)){ + CustomerGridEntity entity = customerGridDao.selectById(formDTO.getOrgId()); + result = ConvertUtils.sourceToTarget(entity,MapOrgResultDTO.class); + result.setName(entity.getGridName()); + result.setLevel(formDTO.getLevel()); + result.setAgencyLevel(OrgInfoConstant.GRID); + //经纬度 如果本级没有则取根级组织的 根级没有就空着 + if (StringUtils.isNotBlank(entity.getLatitude())){ + result.setLatitude(new BigDecimal(entity.getLatitude())); + } + if (StringUtils.isNotBlank(entity.getLongitude())){ + result.setLongitude(new BigDecimal(entity.getLongitude())); + } + List son = customerAgencyDao.selectSonOrg(formDTO.getOrgId(), OrgInfoConstant.NEIGHBOR_HOOD); + if (CollectionUtils.isNotEmpty(son)){ + for (MapSonOrgResultDTO s : son) { + s.setLatitude(StringUtils.isBlank(s.getLatitudeOrigin()) ? result.getLatitude() : new BigDecimal(s.getLatitudeOrigin())); + s.setLongitude(StringUtils.isBlank(s.getLongitudeOrigin()) ? result.getLongitude() : new BigDecimal(s.getLongitudeOrigin())); + } + } + result.setChildren(CollectionUtils.isEmpty(son) ? new ArrayList<>() : son); + } + return result; + } + + /** + * @Description 查询楼栋信息 + * @param formDTO + * @author zxc + * @date 2021/11/2 9:18 上午 + */ + @Override + public List baseInfoFamilyBuilding(BaseInfoFamilyBuildingFormDTO formDTO) { + List result = icBuildingDao.baseInfoFamilyBuilding(formDTO.getNeighborHoodId()); + if (CollectionUtils.isEmpty(result)){ + return new ArrayList<>(); + } + return result; + } + + /** + * @Description 查询下级agencyId + * @param orgId + * @author zxc + * @date 2021/12/9 4:42 下午 + */ + @Override + public List getSonAgencyId(String orgId) { + List result = customerAgencyDao.getSonAgencyId(orgId); + if (CollectionUtils.isNotEmpty(result)){ + return result; + } + return new ArrayList<>(); + } + private CustomerAgencyEntity constructInsertEntity(AddAgencyV2FormDTO formDTO, CustomerAgencyDTO parent) { CustomerAgencyEntity insertEntity = ConvertUtils.sourceToTarget(formDTO, CustomerAgencyEntity.class); insertEntity.setOrganizationName(formDTO.getAgencyName()); @@ -527,4 +696,4 @@ public class AgencyServiceImpl implements AgencyService { return insertEntity; } -} \ No newline at end of file +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java new file mode 100644 index 0000000000..24fe5e520a --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java @@ -0,0 +1,500 @@ +package com.epmet.service.impl; + +import cn.afterturn.easypoi.excel.entity.TemplateExportParams; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.*; +import com.epmet.dto.BuildingTreeLevelDTO; +import com.epmet.dto.CustomerStaffAgencyDTO; +import com.epmet.dto.IcBuildingDTO; +import com.epmet.dto.form.IcBulidingFormDTO; +import com.epmet.dto.form.ListIcNeighborHoodFormDTO; +import com.epmet.dto.result.BuildingResultDTO; +import com.epmet.dto.result.BuildingResultPagedDTO; +import com.epmet.dto.result.IcNeighborHoodResultDTO; +import com.epmet.entity.*; +import com.epmet.enums.BuildingTypeEnums; +import com.epmet.excel.IcBuildingExcel; +import com.epmet.service.BuildingService; +import com.epmet.service.IcBuildingService; +import com.epmet.service.IcBuildingUnitService; +import com.epmet.service.IcHouseService; +import com.epmet.util.ExcelPoiUtils; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import java.util.*; +import java.util.function.Function; +import java.util.stream.Collectors; + +@Slf4j +@Service +public class BuildingServiceImpl implements BuildingService { + + + @Autowired + private IcBuildingService icBuildingService; + @Resource + private IcBuildingDao icBuildingDao; + + @Autowired + private IcBuildingUnitService icBuildingUnitService; + + @Resource + private IcHouseDao icHouseDao; + @Autowired + private IcHouseService icHouseService; + + @Resource + private CustomerAgencyDao customerAgencyDao; + @Resource + private CustomerGridDao customerGridDao; + @Resource + private IcNeighborHoodDao icNeighborHoodDao; + @Resource + private CustomerStaffAgencyDao customerStaffAgencyDao; + @Resource + private IcBuildingUnitDao icBuildingUnitDao; + + @Override + @Transactional(rollbackFor = Exception.class) + public void AddBuilding(String customerId, IcBulidingFormDTO formDTO) { + //同一小区下不能存在楼栋名字一样的 + Integer count = icBuildingDao.checkBuildName(formDTO.getNeighborHoodId(),formDTO.getBuildingName(),null); + if (null != count && count > 0) { + throw new RenException(EpmetErrorCode.BUILDING_NAME_EXITED.getCode(),EpmetErrorCode.BUILDING_NAME_EXITED.getMsg()); + } + IcBuildingDTO icBuildingDTO= ConvertUtils.sourceToTarget(formDTO, IcBuildingDTO.class); + icBuildingDTO.setCustomerId(customerId); + IcBuildingEntity entity = ConvertUtils.sourceToTarget(icBuildingDTO, IcBuildingEntity.class); + icBuildingDao.insert(entity); + + //设置楼宇单元 + Integer totalUnitNum = formDTO.getTotalUnitNum(); + List unitList = new ArrayList<>(); + for(int i =0 ;i treeList(String staffId) { + CustomerStaffAgencyDTO agency = customerStaffAgencyDao.selectLatestCustomerByStaff(staffId); + if(null == agency || StringUtils.isBlank(agency.getAgencyId())){ + log.error("com.epmet.service.impl.BuildingServiceImpl.treeList,没有找到工作人员所属的机关信息,用户Id:{}",staffId); + return new ArrayList<>(); + } + +// agency = new CustomerStaffAgencyDTO(); +// agency.setAgencyId("77f6bc7f07064bf4c09ef848139a344c"); + //1.获取所在组织及下级组织 + CustomerAgencyEntity customerAgency = customerAgencyDao.selectById(agency.getAgencyId()); + List customerAgencyList = icBuildingDao.selectAgencyChildrenList(agency.getAgencyId()); + customerAgencyList.add(customerAgency); + + if(CollectionUtils.isEmpty(customerAgencyList)){ + return new ArrayList<>(); + } + + List agencyList = customerAgencyList.stream().map(item -> { + BuildingTreeLevelDTO buildingTreeLevelDTO = new BuildingTreeLevelDTO(); + buildingTreeLevelDTO.setId(item.getId()); + buildingTreeLevelDTO.setPId(item.getPid()); + buildingTreeLevelDTO.setLabel(item.getOrganizationName()); + buildingTreeLevelDTO.setLevel(item.getLevel()); + buildingTreeLevelDTO.setLongitude(item.getLongitude()); + buildingTreeLevelDTO.setLatitude(item.getLatitude()); + buildingTreeLevelDTO.setChildren(new ArrayList<>()); + return buildingTreeLevelDTO; + }).collect(Collectors.toList()); + + + + //2.获取组织所在网格 + List agencyIdList = customerAgencyList.stream().map(a->a.getId()).collect(Collectors.toList()); +// agencyIdList.add(customerAgency.getId()); + List customerGridList = customerGridDao.selectList(new QueryWrapper().lambda().in(CustomerGridEntity::getPid, agencyIdList)); + + if(CollectionUtils.isEmpty(customerGridList)){ + return covertToTree(customerAgency,agencyList); + } + + List gridList = customerGridList.stream().map(item -> { + BuildingTreeLevelDTO buildingTreeLevelDTO = new BuildingTreeLevelDTO(); + buildingTreeLevelDTO.setId(item.getId()); + buildingTreeLevelDTO.setLabel(item.getGridName()); + buildingTreeLevelDTO.setLevel("grid"); + buildingTreeLevelDTO.setPId(item.getPid()); + buildingTreeLevelDTO.setLongitude(item.getLongitude()); + buildingTreeLevelDTO.setLatitude(item.getLatitude()); + buildingTreeLevelDTO.setChildren(new ArrayList<>()); + return buildingTreeLevelDTO; + }).collect(Collectors.toList()); + + + //3.获取网格下的所有小区 + List gridIdList = customerGridList.stream().map(a->a.getId()).collect(Collectors.toList()); + List icNeighborHoodList = icNeighborHoodDao.selectList(new QueryWrapper().lambda().in(IcNeighborHoodEntity::getGridId, gridIdList)); + if(CollectionUtils.isEmpty(icNeighborHoodList)){ + agencyList.addAll(gridList); + return covertToTree(customerAgency,agencyList); + } + List neighbourHoodList = icNeighborHoodList.stream().map(item -> { + BuildingTreeLevelDTO buildingTreeLevelDTO = new BuildingTreeLevelDTO(); + buildingTreeLevelDTO.setId(item.getId()); + buildingTreeLevelDTO.setPId(item.getGridId()); + buildingTreeLevelDTO.setLabel(item.getNeighborHoodName()); + buildingTreeLevelDTO.setLevel("neighbourHood"); + buildingTreeLevelDTO.setLongitude(item.getLongitude()); + buildingTreeLevelDTO.setLatitude(item.getLatitude()); + buildingTreeLevelDTO.setChildren(new ArrayList<>()); + return buildingTreeLevelDTO; + }).collect(Collectors.toList()); + + //3.获取小区下的所有楼宇 + List neighborHoodIdList = icNeighborHoodList.stream().map(a->a.getId()).collect(Collectors.toList()); + List icBuildingList = icBuildingDao.selectList(new QueryWrapper().lambda().in(IcBuildingEntity::getNeighborHoodId, neighborHoodIdList)); + + if(CollectionUtils.isEmpty(neighborHoodIdList)){ + agencyList.addAll(gridList); + agencyList.addAll(neighbourHoodList); + return covertToTree(customerAgency,agencyList); + } + //组合封装 + + List buildingList = icBuildingList.stream().map(item -> { + BuildingTreeLevelDTO buildingTreeLevelDTO = new BuildingTreeLevelDTO(); + buildingTreeLevelDTO.setId(item.getId()); + buildingTreeLevelDTO.setPId(item.getNeighborHoodId()); + buildingTreeLevelDTO.setLabel(item.getBuildingName()); + buildingTreeLevelDTO.setLevel("building"); + buildingTreeLevelDTO.setLongitude(item.getLongitude()); + buildingTreeLevelDTO.setLatitude(item.getLatitude()); + buildingTreeLevelDTO.setChildren(new ArrayList<>()); + return buildingTreeLevelDTO; + }).collect(Collectors.toList()); + + + + + //组织 +// gridList.stream() +// Map> gridMap = gridList.stream().collect(Collectors.groupingBy(e -> e.getPId())); +// List allList = agencyList.addAll(gridList) + + agencyList.addAll(gridList); + agencyList.addAll(neighbourHoodList); + agencyList.addAll(buildingList); + return covertToTree(customerAgency,agencyList); + + } + + @Override + @Transactional(rollbackFor = Exception.class) + public List importExcel(String customerId, List list, String staffId, List numList) { + //2021.11.9 需求变更 当前工作人员只能导致自己所属组织下数据,网格名对应不上的数据舍弃【注:需求就这样】 sun + CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(customerId, staffId); + //组织名称不一样的数据舍弃 + Iterator iterator = list.iterator(); + while (iterator.hasNext()) { + IcBuildingExcel obj = iterator.next(); + if (!obj.getAgencyName().trim().equals(staffInfoCache.getAgencyName())) { + numList.add(obj.getRowNum()); + iterator.remove(); + } + } + //用于存储匹配不上的数据给前端的提示 如南宁社区不存在 + //StringBuffer str = new StringBuffer(""); + //end sun + //导入 + if(CollectionUtils.isEmpty(list)){ + return numList; + } + //查询所有组织和网格根据名字 + + + + //获取所有小区 list 根据组织和网格 + Set neighborNameList = list.stream().map(item -> item.getNeighborHoodName()).collect(Collectors.toSet()); + Set agencyNameList = list.stream().map(item -> item.getAgencyName()).collect(Collectors.toSet()); + Set gridNameList = list.stream().map(item -> item.getGridName()).collect(Collectors.toSet()); + List neighborHoodList = icNeighborHoodDao.selectListByName(customerId, new ArrayList(neighborNameList),new ArrayList(agencyNameList),new ArrayList(gridNameList)); +// List neighborHoodList = icNeighborHoodDao.selectList(new QueryWrapper().lambda().in(IcNeighborHoodEntity::getNeighborHoodName, neighborNameList)); + Map neighborHoodMap = neighborHoodList.stream().collect(Collectors.toMap(IcNeighborHoodEntity::getNeighborHoodName, Function.identity(),(key1, key2)->key1)); + + + //2.获取小区数据 + //封装数据 + List buildingEntityList = new ArrayList<>(); + List icBuildingUnitEntityList = new ArrayList<>(); + Iterator iterator1 = list.iterator(); + while (iterator1.hasNext()) { + IcBuildingExcel icBuildingExcel = iterator1.next(); + IcBuildingEntity entity = new IcBuildingEntity(); + String uuid = UUID.randomUUID().toString().replace("-", ""); + entity.setId(uuid); + entity.setCustomerId(customerId); + entity.setNeighborHoodId(Optional.ofNullable(neighborHoodMap.get(icBuildingExcel.getNeighborHoodName())).map(u->u.getId()).orElse(""));//neighborHoodMap.get(icBuildingExcel.getNeighborHoodName()).getId() + if ("".equals(entity.getNeighborHoodId())) { + //str.append("".equals(str) ? icBuildingExcel.getNeighborHoodName() : str.append("、").append(icBuildingExcel.getNeighborHoodName())); + numList.add(icBuildingExcel.getRowNum()); + iterator1.remove(); + continue; + } + entity.setBuildingName(icBuildingExcel.getBuildingName()); + entity.setType(BuildingTypeEnums.getKeyByValue(icBuildingExcel.getType())); + entity.setSort(0); + entity.setTotalUnitNum(icBuildingExcel.getTotalUnitNum()); + entity.setTotalFloorNum(icBuildingExcel.getTotalFloorNum()); + entity.setTotalHouseNum(icBuildingExcel.getTotalHouseNum()); + buildingEntityList.add(entity); + + Integer totalUnitNum = icBuildingExcel.getTotalUnitNum(); + //设置楼宇单元 + List unitList = new ArrayList<>(); + for(int i =0 ;i 0) { + //throw new RenException(EpmetErrorCode.BUILDING_NAME_EXITED.getCode(),EpmetErrorCode.BUILDING_NAME_EXITED.getMsg()); + log.error(EpmetErrorCode.BUILDING_NAME_EXITED.getMsg()); + numList.add(icBuildingExcel.getRowNum()); + iterator1.remove(); + continue; + } + icBuildingUnitEntityList.addAll(unitList); + } + //3.保存 + //4.新增单元 + icBuildingService.insertBatch(buildingEntityList); + icBuildingUnitService.insertBatch(icBuildingUnitEntityList); + + /* if(!"".equals(str)){ + return new Result().error(9999, str.append("不存在").toString()); + }*/ + return numList; + } + + @Override + public IcNeighborHoodResultDTO listBuilding(ListIcNeighborHoodFormDTO formDTO) { + + IcNeighborHoodResultDTO result = new IcNeighborHoodResultDTO(); + IPage> resultMap = searchBuilding(formDTO); + result.setTotal(Long.valueOf(resultMap.getTotal()).intValue()); + result.setList(resultMap.getRecords()); + return result; + } + + @Override + public void exportBuildinginfo(ListIcNeighborHoodFormDTO formDTO, HttpServletResponse response) throws Exception { + //如果类型是building 查楼栋 + //导出楼栋 + List icBuildingExcels = searchAllBuilding(formDTO); + TemplateExportParams templatePath = new TemplateExportParams("excel/building_export.xlsx"); + Map map = new HashMap<>(); + map.put("maplist",icBuildingExcels); + ExcelPoiUtils.exportExcel(templatePath ,map,"楼宇信息录入表",response); + return ; + } + @Override + public List buildingListByIds(List buildingIdList) { + return icBuildingDao.buildingListByIds(buildingIdList); + } + @Override + public BuildingResultPagedDTO buildinglistbyidsPage(List buildingIdList,Integer pageNo, Integer pageSize) { + IPage page = new Page(pageNo,pageSize); + IPage buildingResultDTOIPage = icBuildingDao.buildingListByIds(page, buildingIdList); + BuildingResultPagedDTO result = new BuildingResultPagedDTO(); + result.setTotal(Long.valueOf(buildingResultDTOIPage.getTotal()).intValue()); + result.setList(buildingResultDTOIPage.getRecords()); + + return result; + } + + private List searchAllBuilding(ListIcNeighborHoodFormDTO formDTO) { + +// QueryWrapper neighborHoodEntityQueryWrapper = new QueryWrapper<>(); +// neighborHoodEntityQueryWrapper.lambda() +// .eq(!StringUtils.isEmpty(formDTO.getAgencyId()),IcNeighborHoodEntity::getAgencyId,formDTO.getAgencyId()) +// .eq(!StringUtils.isEmpty(formDTO.getGridId()),IcNeighborHoodEntity::getId,formDTO.getGridId()) +// .eq(!StringUtils.isEmpty(formDTO.getNeighborHoodId()),IcNeighborHoodEntity::getId,formDTO.getNeighborHoodId()) +// .like(!StringUtils.isEmpty(formDTO.getNeighborHoodName()),IcNeighborHoodEntity::getNeighborHoodName,formDTO.getNeighborHoodName()); +// IcNeighborHoodEntity neighbor = ConvertUtils.sourceToTarget(formDTO, IcNeighborHoodEntity.class); + +// QueryWrapper buildingEntityQueryWrapper = new QueryWrapper<>(); +// buildingEntityQueryWrapper.lambda() +// .eq(!StringUtils.isEmpty(formDTO.getBuildingId()),IcBuildingEntity::getId,formDTO.getBuildingId()) +// .like(!StringUtils.isEmpty(formDTO.getBuildingName()),IcBuildingEntity::getBuildingName,formDTO.getBuildingName()); +// buildingEntityQueryWrapper.eq("a.DEL_FLAG","0"); + IcBuildingEntity building = ConvertUtils.sourceToTarget(formDTO, IcBuildingEntity.class); + building.setDelFlag("0"); + IcHouseEntity house = ConvertUtils.sourceToTarget(formDTO, IcHouseEntity.class); + List icBuildingExcels = icBuildingDao.searchAllBuilding(building, house); + icBuildingExcels.forEach(item->{ + item.setType(BuildingTypeEnums.getTypeValue(item.getType())); + }); + return icBuildingExcels; + } + + private IPage> searchBuilding(ListIcNeighborHoodFormDTO formDTO) { + IPage page = new Page(formDTO.getPageNo(),formDTO.getPageSize()); + +// IcNeighborHoodEntity neighbor = new IcNeighborHoodEntity(); +// IcNeighborHoodEntity neighbor = ConvertUtils.sourceToTarget(formDTO, IcNeighborHoodEntity.class); + +// QueryWrapper neighborHoodEntityQueryWrapper = new QueryWrapper<>(); +// neighborHoodEntityQueryWrapper.lambda() +// .eq(!StringUtils.isEmpty(formDTO.getAgencyId()),IcNeighborHoodEntity::getAgencyId,formDTO.getAgencyId()) +// .eq(!StringUtils.isEmpty(formDTO.getGridId()),IcNeighborHoodEntity::getId,formDTO.getGridId()) +// .eq(!StringUtils.isEmpty(formDTO.getNeighborHoodId()),IcNeighborHoodEntity::getId,formDTO.getNeighborHoodId()) +// .like(!StringUtils.isEmpty(formDTO.getNeighborHoodName()),IcNeighborHoodEntity::getNeighborHoodName,formDTO.getNeighborHoodName()); + + + IcBuildingEntity building = ConvertUtils.sourceToTarget(formDTO, IcBuildingEntity.class); + building.setDelFlag("0"); +// QueryWrapper buildingEntityQueryWrapper = new QueryWrapper<>(); +// +// buildingEntityQueryWrapper.lambda() +// .eq(!StringUtils.isEmpty(formDTO.getBuildingId()),IcBuildingEntity::getId,formDTO.getBuildingId()) +// .like(!StringUtils.isEmpty(formDTO.getBuildingName()),IcBuildingEntity::getBuildingName,formDTO.getBuildingName()); +// buildingEntityQueryWrapper.eq("a.DEL_FLAG","0"); + IcHouseEntity house = ConvertUtils.sourceToTarget(formDTO, IcHouseEntity.class); + IPage> mapIPage = icBuildingDao.searchBuildingByPage(page, building, house); + List> records = mapIPage.getRecords(); + records.forEach(item->{ + item.put("buildingType", BuildingTypeEnums.getTypeValue(item.get("buildingTypeKey"))); + }); + return mapIPage; + } + + + private List covertToTree(CustomerAgencyEntity customerAgency,List agencyList) { + BuildingTreeLevelDTO buildingTreeLevelDTO = new BuildingTreeLevelDTO(); + buildingTreeLevelDTO.setId(customerAgency.getId()); + buildingTreeLevelDTO.setLabel(customerAgency.getOrganizationName()); + buildingTreeLevelDTO.setLevel(customerAgency.getLevel()); + buildingTreeLevelDTO.setLongitude(customerAgency.getLongitude()); + buildingTreeLevelDTO.setLatitude(customerAgency.getLatitude()); + buildingTreeLevelDTO.setChildren(new ArrayList<>()); + recursionCovertToTree(buildingTreeLevelDTO,agencyList); + List result = new ArrayList<>(); + result.add(buildingTreeLevelDTO); + return result; + } + + private void recursionCovertToTree(BuildingTreeLevelDTO parent, List customerAgencyList) { + //获取子节点 + List subList = customerAgencyList.stream().filter(item -> item.getPId().equals(parent.getId())).collect(Collectors.toList()); + + for(BuildingTreeLevelDTO agencyEntity :subList){ + recursionCovertToTree(agencyEntity,customerAgencyList); + } + parent.setChildren(subList); + + } + + + + /** + * 更新 + * @param customerId + * @param formDTO + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void UpdateBuilding(String customerId, IcBulidingFormDTO formDTO) { + //同一小区下不能存在楼栋名字一样的 + Integer count = icBuildingDao.checkBuildName(formDTO.getNeighborHoodId(),formDTO.getBuildingName(),formDTO.getBuildingId()); + if (null != count && count > 0) { + throw new RenException(EpmetErrorCode.BUILDING_NAME_EXITED.getCode(),EpmetErrorCode.BUILDING_NAME_EXITED.getMsg()); + } + + IcBuildingDTO icBuilding= icBuildingService.get(formDTO.getBuildingId()); + + if(!icBuilding.getNeighborHoodId().equals(formDTO.getNeighborHoodId())){ + //更新对应房屋小区id + List icHouseEntities = icHouseDao.selectList(new QueryWrapper().lambda().eq(IcHouseEntity::getBuildingId, formDTO.getBuildingId())); + if(!CollectionUtils.isEmpty(icHouseEntities)){ + // + throw new RenException(EpmetErrorCode.ORG_EDIT_FAILED.getCode(),"楼宇单元下存在房屋,无法更新"); +// icHouseEntities.forEach(item->{ +// item.setNeighborHoodId(formDTO.getNeighborHoodId()); +// }); +// icHouseService.updateBatchById(icHouseEntities); + } + } + IcBuildingDTO icBuildingDTO= ConvertUtils.sourceToTarget(formDTO, IcBuildingDTO.class); + icBuildingDTO.setId(formDTO.getBuildingId()); + icBuildingDTO.setCustomerId(customerId); + icBuildingService.update(icBuildingDTO); + //更新楼宇单元 + //如果楼宇单元大于之前的楼宇单元,新增单元 + Integer nowUnit= formDTO.getTotalUnitNum(); + Integer unit = icBuilding.getTotalUnitNum(); + if(nowUnit>=unit){ + //新增单元 + List unitList = new ArrayList<>(); + for(int i =unit ;i icHouseEntities = icHouseDao.selectList(new QueryWrapper().lambda().eq(IcHouseEntity::getBuildingId, buildingId)); + if(!CollectionUtils.isEmpty(icHouseEntities)){ + throw new RenException(EpmetErrorCode.ORG_DEL_FAILED.getCode(),"楼宇单元下存在房屋,无法删除"); + } + //删除楼宇 + icBuildingService.deleteById(buildingId); + //删除楼宇单元 + icBuildingUnitDao.delete(new QueryWrapper().lambda().eq(IcBuildingUnitEntity::getBuildingId,buildingId)); + + } + +} 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 fc9f181a20..f70fdd035a 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 @@ -16,7 +16,6 @@ */ package com.epmet.service.impl; - import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; @@ -1107,6 +1106,72 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl%s", staffId)); + throw new RenException(CustomerAgencyConstant.SELECT_STAFF_AGENCY_EXCEPTION); + } + result.setPid(rootAgency.getPid()); + result.setAgencyName(rootAgency.getAgencyName()); + result.setAgencyId(rootAgency.getAgencyId()); + result.setLevel(rootAgency.getLevel()); + result.setOrgLevel(rootAgency.getAgencyId().concat("-").concat(rootAgency.getLevel())); + result.setLongitude(rootAgency.getLongitude()); + result.setLatitude(rootAgency.getLatitude()); + ExtStaffPermissionResultDTO res = baseDao.selectAgencyById(rootAgency.getAgencyId()); + convert2AgencyTreeResult(result,res.getSubAgencyList(),res.getGridList()); + return result; + } + /** + * 递归查询子节点 + * @param root 根节点 + * @param all 所有节点 + * @return 根节点信息 + */ + private void convert2AgencyTreeResult(AgencyTreeResultDTO root, List agencyList, List gridList) { + try { + for (ExtStaffPermissionResultDTO agency : agencyList) { + AgencyTreeResultDTO resultDTO = new AgencyTreeResultDTO(); + resultDTO.setAgencyId(agency.getAgencyId()); + resultDTO.setAgencyName(agency.getAgencyName()); + resultDTO.setPid(root.getAgencyId()); + resultDTO.setLevel(agency.getLevel()); + resultDTO.setLongitude(agency.getLongitude()); + resultDTO.setLatitude(agency.getLatitude()); + resultDTO.setOrgLevel(agency.getAgencyId().concat("-").concat(agency.getLevel())); + + if (root.getSubAgencyList() == null) { + root.setSubAgencyList(new ArrayList<>()); + } + root.getSubAgencyList().add(resultDTO); + if (CollectionUtils.isNotEmpty(agency.getSubAgencyList()) || CollectionUtils.isNotEmpty(agency.getGridList())) { + convert2AgencyTreeResult(resultDTO, agency.getSubAgencyList(), agency.getGridList()); + } + } + for (ExtGridResultDTO o : gridList) { + AgencyTreeResultDTO grid = new AgencyTreeResultDTO(); + grid.setAgencyId(o.getGridId()); + grid.setAgencyName(o.getGridName()); + grid.setPid(root.getAgencyId()); + grid.setLevel("grid"); + grid.setOrgLevel(o.getGridId().concat("-").concat("grid")); + grid.setSubAgencyList(null); + grid.setLongitude(o.getLongitude()); + grid.setLatitude(o.getLatitude()); + if (root.getSubAgencyList() == null) { + root.setSubAgencyList(new ArrayList<>()); + } + root.getSubAgencyList().add(grid); + } + } catch (Exception e) { + e.printStackTrace(); + } + } + /** * @Description 组织树最后一级没有数据的话设null * @Param agencyList @@ -1124,4 +1189,8 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl getStaffOrgListByStaffId(String staffId) { + return baseDao.getStaffOrgListByStaffId(staffId); + } } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerDepartmentServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerDepartmentServiceImpl.java index a236f77464..63acec3171 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerDepartmentServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerDepartmentServiceImpl.java @@ -20,18 +20,16 @@ package com.epmet.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.dao.CustomerDepartmentDao; import com.epmet.dto.CustomerDepartmentDTO; import com.epmet.dto.result.DepartmentListResultDTO; import com.epmet.entity.CustomerDepartmentEntity; -import com.epmet.redis.CustomerDepartmentRedis; import com.epmet.service.CustomerDepartmentService; import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -41,7 +39,7 @@ import java.util.List; import java.util.Map; /** - * 客户部门表 + * 客户部门表 * * @author generator generator@elink-cn.com * @since v1.0.0 2020-04-20 @@ -49,9 +47,6 @@ import java.util.Map; @Service public class CustomerDepartmentServiceImpl extends BaseServiceImpl implements CustomerDepartmentService { - @Autowired - private CustomerDepartmentRedis customerDepartmentRedis; - @Override public PageData page(Map params) { IPage page = baseDao.selectPage( @@ -125,4 +120,4 @@ public class CustomerDepartmentServiceImpl extends BaseServiceImpl page(Map params) { @@ -270,6 +275,7 @@ public class CustomerGridServiceImpl extends BaseServiceImpl().ok(resultDTO); } @@ -291,6 +297,7 @@ public class CustomerGridServiceImpl extends BaseServiceImpl> getGridListByGridIds(List gridIdList) { Result> result = new Result>(); - if (gridIdList.size() < NumConstant.ONE) { - logger.error("根据网格Id集合获取网格列表信息-传入的网格Id集合为空数组!"); + if (CollectionUtils.isEmpty(gridIdList)) { + logger.warn("根据网格Id集合获取网格列表信息-传入的网格Id集合为空数组!"); return result; } List list = baseDao.selectGridByIds(gridIdList); @@ -786,4 +793,85 @@ public class CustomerGridServiceImpl extends BaseServiceImpl selectOrgsByUserId(String userId) { return baseDao.selectOrgsByUserId(userId); } + + /** + * @param formDTO + * @Description 获取组织下网格树 + * @Param formDTO + * @Return {@link List} + * @Author zhaoqifeng + * @Date 2021/10/25 16:28 + */ + @Override + public List getGridTree(AgencyIdFormDTO formDTO) { + return baseDao.selectGridTree(formDTO.getAgencyId()); + } + + /** + * @param agencyId + * @Description 获取组织下网格选项 + * @Param agencyId + * @Return {@link List< OptionResultDTO >} + * @Author zhaoqifeng + * @Date 2021/10/26 14:01 + */ + @Override + public List getGridOption(String agencyId, String purpose) { + //查询条件和查看居民详情:query;新增或修改居民信息:addorupdate + if ("query".equals(purpose) || StringUtils.isEmpty(purpose)) { + CustomerAgencyDTO customerAgencyDTO = customerAgencyService.get(agencyId); + String gridPids = ""; + if (null != customerAgencyDTO) { + if (StringUtils.isEmpty(customerAgencyDTO.getPid()) || NumConstant.ZERO_STR.equals(customerAgencyDTO.getPid())) { + gridPids = agencyId; + } else { + gridPids = customerAgencyDTO.getPids().concat(StrConstant.COLON).concat(agencyId); + } + } + return baseDao.getGridOptionForQuery(gridPids); + } + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(CustomerGridEntity::getPid, agencyId); + wrapper.last("ORDER BY CONVERT ( GRID_NAME USING gbk ) ASC"); + List list = baseDao.selectList(wrapper); + if (CollectionUtils.isEmpty(list)) { + return Collections.emptyList(); + } + return list.stream().map(item -> { + OptionResultDTO dto = new OptionResultDTO(); + dto.setLabel(item.getGridName()); + dto.setValue(item.getId()); + return dto; + }).collect(Collectors.toList()); + } + + /** + * @param agencyId + * @Description 获取组织下网格 + * @Param agencyId + * @Return {@link List< CustomerGridDTO>} + * @Author zhaoqifeng + * @Date 2021/11/29 17:00 + */ + @Override + public List getGridIListByAgency(String agencyId) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(CustomerGridEntity::getPid, agencyId); + List list = baseDao.selectList(wrapper); + if (CollectionUtils.isEmpty(list)) { + return Collections.emptyList(); + } + return ConvertUtils.sourceToTarget(list, CustomerGridDTO.class); + } + + /** + * @Author sun + * @Description 查询组织直属网格列表 + **/ + @Override + public List gridListByAgencyId(String agencyId) { + List result = baseDao.selectAgencyGridMsgList(agencyId); + return result; + } + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerPartyBranchServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerPartyBranchServiceImpl.java index 5ec7c27668..57a1277cb0 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerPartyBranchServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerPartyBranchServiceImpl.java @@ -17,10 +17,12 @@ 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; import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.dto.result.OptionResultDTO; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.dao.CustomerPartyBranchDao; @@ -30,18 +32,21 @@ import com.epmet.dto.CustomerPartyBranchDTO; import com.epmet.dto.form.ListPartyBranchFormDTO; import com.epmet.dto.result.ListPartyBranchResultDTO; import com.epmet.entity.CustomerPartyBranchEntity; -import com.epmet.redis.CustomerPartyBranchRedis; import com.epmet.service.CustomerAgencyService; import com.epmet.service.CustomerGridService; import com.epmet.service.CustomerPartyBranchService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.Arrays; +import java.util.Collections; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; /** * 党支部信息 @@ -49,11 +54,10 @@ import java.util.Map; * @author yinzuomei yinzuomei@elink-cn.com * @since v1.0.0 2020-06-17 */ +@Slf4j @Service public class CustomerPartyBranchServiceImpl extends BaseServiceImpl implements CustomerPartyBranchService { - @Autowired - private CustomerPartyBranchRedis customerPartyBranchRedis; @Autowired private CustomerGridService customerGridService; @Autowired @@ -134,4 +138,34 @@ public class CustomerPartyBranchServiceImpl extends BaseServiceImpl} + * @Author zhaoqifeng + * @Date 2021/10/27 9:57 + */ + @Override + public List getBranchOption(String gridId) { + if (StringUtils.isBlank(gridId)) { + log.warn("网格ID为空"); + return Collections.emptyList(); + } + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(CustomerPartyBranchEntity::getGridId, gridId); + wrapper.last("ORDER BY CONVERT ( PARTY_BRANCH_NAME USING gbk ) ASC"); + List list = baseDao.selectList(wrapper); + if(CollectionUtils.isEmpty(list)) { + return Collections.emptyList(); + } + return list.stream().map(item -> { + OptionResultDTO dto = new OptionResultDTO(); + dto.setValue(item.getId()); + dto.setLabel(item.getPartyBranchName()); + return dto; + }).collect(Collectors.toList()); + } + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffAgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffAgencyServiceImpl.java index b79418b280..7ddbadf0f9 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffAgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffAgencyServiceImpl.java @@ -33,7 +33,6 @@ import com.epmet.dto.result.LatestCustomerResultDTO; import com.epmet.entity.CustomerStaffAgencyEntity; import com.epmet.feign.EpmetUserFeignClient; import com.epmet.feign.OperCrmFeignClient; -import com.epmet.redis.CustomerStaffAgencyRedis; import com.epmet.service.CustomerAgencyService; import com.epmet.service.CustomerDepartmentService; import com.epmet.service.CustomerGridService; @@ -57,8 +56,6 @@ import java.util.*; @Service public class CustomerStaffAgencyServiceImpl extends BaseServiceImpl implements CustomerStaffAgencyService { - @Autowired - private CustomerStaffAgencyRedis customerStaffAgencyRedis; @Autowired private EpmetUserFeignClient epmetUserFeignClient; @Autowired @@ -251,4 +248,4 @@ public class CustomerStaffAgencyServiceImpl extends BaseServiceImpl implements CustomerStaffGridService { - @Autowired - private CustomerStaffGridRedis customerStaffGridRedis; - @Autowired private EpmetUserOpenFeignClient epmetUserOpenFeignClient; @@ -193,4 +189,4 @@ public class CustomerStaffGridServiceImpl extends BaseServiceImpl eventOrg(String userId) { return baseDao.eventOrg(userId); } -} \ No newline at end of file +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java new file mode 100644 index 0000000000..4ff3bb2948 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java @@ -0,0 +1,297 @@ +package com.epmet.service.impl; + +import cn.afterturn.easypoi.excel.entity.TemplateExportParams; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.IcBuildingDao; +import com.epmet.dao.IcBuildingUnitDao; +import com.epmet.dao.IcHouseDao; +import com.epmet.dao.IcNeighborHoodDao; +import com.epmet.dto.IcBuildingDTO; +import com.epmet.dto.IcBuildingUnitDTO; +import com.epmet.dto.IcHouseDTO; +import com.epmet.dto.form.IcHouseFormDTO; +import com.epmet.dto.form.ListIcNeighborHoodFormDTO; +import com.epmet.dto.result.HouseInfoDTO; +import com.epmet.dto.result.IcNeighborHoodResultDTO; +import com.epmet.entity.IcHouseEntity; +import com.epmet.enums.HousePurposeEnums; +import com.epmet.enums.HouseRentFlagEnums; +import com.epmet.enums.HouseTypeEnums; +import com.epmet.excel.IcHouseExcel; +import com.epmet.service.HouseService; +import com.epmet.service.IcBuildingService; +import com.epmet.service.IcBuildingUnitService; +import com.epmet.service.IcHouseService; +import com.epmet.util.ExcelPoiUtils; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import java.util.*; +import java.util.stream.Collectors; + +@Slf4j +@Service +public class HouseServiceImpl implements HouseService { + + + + @Autowired + private IcHouseService icHouseService; + @Autowired + private IcBuildingService icBuildingService; + @Autowired + private IcBuildingUnitService icBuildingUnitService; + @Resource + private IcNeighborHoodDao icNeighborHoodDao; + @Resource + private IcBuildingDao icBuildingDao; + @Resource + private IcBuildingUnitDao icBuildingUnitDao; + @Resource + private IcHouseDao icHouseDao; + + @Override + @Transactional(rollbackFor = Exception.class) + public void addHouse(String customerId, IcHouseFormDTO formDTO) { + //同一楼栋,单元内,房屋名称唯一 + Integer count = icHouseDao.checkDoorNameUq(formDTO.getNeighborHoodId(), formDTO.getBuildingId(), formDTO.getBuildingUnitId(), formDTO.getDoorName(),null); + if (null != count && count > 0) { + throw new RenException(EpmetErrorCode.DOOR_NAME_EXITED.getCode(), EpmetErrorCode.DOOR_NAME_EXITED.getMsg()); + } + IcHouseDTO icHouseDTO= ConvertUtils.sourceToTarget(formDTO, IcHouseDTO.class); + icHouseDTO.setCustomerId(customerId); +// icHouseDTO.setRentFlag(formDTO.getRentFlag()); + + icHouseDTO.setHouseName(getHouseName(formDTO)); + icHouseService.save(icHouseDTO); + } + + private String getHouseName(IcHouseFormDTO formDTO){ + //设置房间名 楼栋-单元号-门牌号 + IcBuildingDTO icBuilding = icBuildingService.get(formDTO.getBuildingId()); + IcBuildingUnitDTO icBuildingUnit = icBuildingUnitService.get(formDTO.getBuildingUnitId()); + String doorName = formDTO.getDoorName(); + String buildingName = Optional.ofNullable(icBuilding).map(u->u.getBuildingName()).orElse(""); + String unitName = Optional.ofNullable(icBuildingUnit).map(u->u.getUnitNum()).orElse(""); + return new StringBuilder().append(buildingName).append("-").append(unitName).append("-").append(doorName).toString(); + } + + /** + * 更新 + * @param customerId + * @param formDTO + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void updateHouse(String customerId, IcHouseFormDTO formDTO) { + //同一楼栋,单元内,房屋名称唯一 + Integer count = icHouseDao.checkDoorNameUq(formDTO.getNeighborHoodId(), formDTO.getBuildingId(), formDTO.getBuildingUnitId(),formDTO.getDoorName(), formDTO.getHouseId()); + if (null != count && count > 0) { + throw new RenException(EpmetErrorCode.DOOR_NAME_EXITED.getCode(), EpmetErrorCode.DOOR_NAME_EXITED.getMsg()); + } + IcHouseDTO icHouseDTO = ConvertUtils.sourceToTarget(formDTO, IcHouseDTO.class); + icHouseDTO.setId(formDTO.getHouseId()); + icHouseDTO.setCustomerId(customerId); + icHouseDTO.setRentFlag(formDTO.getRentFlag()); + //设置 + icHouseDTO.setHouseName(getHouseName(formDTO)); + icHouseService.update(icHouseDTO); + } + + /** + * 删除 + * @param houseId + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void delHouse(String houseId) { + //删除小区 + icHouseService.deleteById(houseId); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public List importExcel(String customerId, List list, String staffId, List numList) { + //2021.11.10 需求变更 当前工作人员只能导致自己所属组织下数据,对应不上的数据舍弃【注:需求就这样】 sun + CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(customerId, staffId); + //组织名称不一样的数据舍弃 + Iterator iterator = list.iterator(); + while (iterator.hasNext()) { + IcHouseExcel obj = iterator.next(); + if (!obj.getAgencyName().trim().equals(staffInfoCache.getAgencyName())) { + numList.add(obj.getRowNum()); + iterator.remove(); + } + } + //用于存储匹配不上的数据给前端的提示 如南宁社区不存在 + //StringBuffer str = new StringBuffer(""); + //end sun + //导入 + if(CollectionUtils.isEmpty(list)){ + return numList; + } + //获取所有小区 list +// List neighborNameList = list.stream().map(item -> item.getNeighborHoodName()).collect(Collectors.toList()); +// List neighborHoodList = icNeighborHoodDao.selectList(new QueryWrapper().lambda().in(IcNeighborHoodEntity::getNeighborHoodName, neighborNameList)); +// Map neighborHoodMap = neighborHoodList.stream().collect(Collectors.toMap(IcNeighborHoodEntity::getNeighborHoodName, Function.identity(),(key1, key2)->key1)); + + //获取所有楼宇 list +// List buildingNameList = list.stream().map(item -> item.getBuildingName()).collect(Collectors.toList()); + +// icBuildingDao.selectList(new QueryWrapper().lambda().in(IcBuildingEntity::getBuildingName, buildingNameList).in(); + Set neighborNameList = list.stream().map(item -> item.getNeighborHoodName()).collect(Collectors.toSet()); + Set buildingNameList = list.stream().map(item -> item.getBuildingName()).collect(Collectors.toSet()); + Set buildingUnitList = list.stream().map(item -> item.getBuildingUnit()).collect(Collectors.toSet()); + List> buildMapList = icBuildingDao.selectListByName(customerId, new ArrayList(neighborNameList),new ArrayList(buildingNameList),new ArrayList(buildingUnitList)); + //转Map + Map> buildMap = new HashMap<>(); + buildMapList.forEach(item->{ + buildMap.put(item.get("neighborName")+","+item.get("buildingName")+","+item.get("unitNum"),item); + }); + //封装数据 + List houseEntityList = new ArrayList<>(); + Iterator iterator1 = list.iterator(); + while (iterator1.hasNext()) { + IcHouseExcel icHouseExcel = iterator1.next(); + IcHouseEntity entity = new IcHouseEntity(); + String uuid = UUID.randomUUID().toString().replace("-", ""); + entity.setId(uuid); + entity.setCustomerId(customerId); + Map item = buildMap.get(icHouseExcel.getNeighborHoodName()+","+icHouseExcel.getBuildingName()+","+icHouseExcel.getBuildingUnit()); + + entity.setNeighborHoodId(String.valueOf(Optional.ofNullable(item).map(u->u.get("neighborId")).orElse(""))); + entity.setBuildingId(String.valueOf(Optional.ofNullable(item).map(u->u.get("buildingId")).orElse(""))); + entity.setBuildingUnitId(String.valueOf(Optional.ofNullable(item).map(u->u.get("buildingUnitId")).orElse(""))); + entity.setHouseName(icHouseExcel.getBuildingName()+"-"+icHouseExcel.getBuildingUnit()+"-"+icHouseExcel.getDoorName()); + if ("".equals(entity.getNeighborHoodId()) || "".equals(entity.getBuildingId()) || "".equals(entity.getBuildingUnitId())) { + //str.append("".equals(str) ? icHouseExcel.getBuildingName() + icHouseExcel.getBuildingUnit() : str.append("、").append(icHouseExcel.getBuildingName() + icHouseExcel.getBuildingUnit())); + numList.add(icHouseExcel.getRowNum()); + iterator1.remove(); + continue; + } + entity.setDoorName(icHouseExcel.getDoorName()); + entity.setHouseType(HouseTypeEnums.getKeyByValue(icHouseExcel.getHouseType())); + entity.setPurpose(HousePurposeEnums.getKeyByValue(icHouseExcel.getPurpose())); + entity.setRentFlag(HouseRentFlagEnums.getCodeByName(icHouseExcel.getRentFlag())); + entity.setOwnerName(icHouseExcel.getOwnerName()); + entity.setOwnerPhone(icHouseExcel.getOwnerPhone()); + entity.setOwnerIdCard(icHouseExcel.getOwnerIdCard()); + //同一楼栋,单元内,房屋名称唯一 + Integer count = icHouseDao.checkDoorNameUq(entity.getNeighborHoodId(), entity.getBuildingId(), entity.getBuildingUnitId(), entity.getDoorName(),null); + if (null != count && count > 0) { + //throw new RenException(EpmetErrorCode.DOOR_NAME_EXITED.getCode(), EpmetErrorCode.DOOR_NAME_EXITED.getMsg()); + log.error(EpmetErrorCode.DOOR_NAME_EXITED.getMsg()); + numList.add(icHouseExcel.getRowNum()); + iterator1.remove(); + continue; + } + houseEntityList.add(entity); + } + //3.保存 + icHouseService.insertBatch(houseEntityList); + + /*if(!"".equals(str)){ + return new Result().error(9999, str.append("不存在").toString()); + }*/ + return numList; + + } + + @Override + public IcNeighborHoodResultDTO listNeighborhood(ListIcNeighborHoodFormDTO formDTO) { + IcNeighborHoodResultDTO result = new IcNeighborHoodResultDTO(); + //如果类型是house 查房屋 + IPage> resultMap = searchHouse(formDTO); + result.setTotal(Long.valueOf(resultMap.getTotal()).intValue()); + result.setList(resultMap.getRecords()); + return result; + } + + @Override + public void exportBuildinginfo(ListIcNeighborHoodFormDTO formDTO, HttpServletResponse response) throws Exception { + //如果类型是house 查房屋 + //导出房屋 + + List icHouseExcels = searchAllHouse(formDTO); + TemplateExportParams templatePath = new TemplateExportParams("excel/house_export.xlsx"); + Map map = new HashMap<>(); + map.put("maplist",icHouseExcels); + ExcelPoiUtils.exportExcel(templatePath ,map,"房屋信息录入表",response); + + return ; + } + private List searchAllHouse(ListIcNeighborHoodFormDTO formDTO) { + + //IcNeighborHoodEntity neighbor = ConvertUtils.sourceToTarget(formDTO, IcNeighborHoodEntity.class); + // + //IcBuildingEntity building = ConvertUtils.sourceToTarget(formDTO, IcBuildingEntity.class); + + + IcHouseEntity house = ConvertUtils.sourceToTarget(formDTO, IcHouseEntity.class); + house.setDelFlag("0"); + + List icHouseExcels = icHouseDao.searchAllHouse(house); + icHouseExcels.forEach(item->{ + item.setHouseType(HouseTypeEnums.getTypeValue(item.getHouseType())); + item.setPurpose(HousePurposeEnums.getTypeValue(item.getPurpose())); + }); + return icHouseExcels; + } + + private IPage> searchHouse(ListIcNeighborHoodFormDTO formDTO) { + IPage page = new Page(formDTO.getPageNo(),formDTO.getPageSize()); + +// QueryWrapper neighborHoodEntityQueryWrapper = new QueryWrapper<>(); +// neighborHoodEntityQueryWrapper.lambda() +// .eq(!StringUtils.isEmpty(formDTO.getAgencyId()),IcNeighborHoodEntity::getAgencyId,formDTO.getAgencyId()) +// .eq(!StringUtils.isEmpty(formDTO.getGridId()),IcNeighborHoodEntity::getId,formDTO.getGridId()) +// .eq(!StringUtils.isEmpty(formDTO.getNeighborHoodId()),IcNeighborHoodEntity::getId,formDTO.getNeighborHoodId()) +// .like(!StringUtils.isEmpty(formDTO.getNeighborHoodName()),IcNeighborHoodEntity::getNeighborHoodName,formDTO.getNeighborHoodName()); +// IcNeighborHoodEntity neighbor = ConvertUtils.sourceToTarget(formDTO, IcNeighborHoodEntity.class); + + +// QueryWrapper buildingEntityQueryWrapper = new QueryWrapper<>(); +// buildingEntityQueryWrapper.lambda() +// .eq(!StringUtils.isEmpty(formDTO.getBuildingId()),IcBuildingEntity::getId,formDTO.getBuildingId()) +// .like(!StringUtils.isEmpty(formDTO.getBuildingName()),IcBuildingEntity::getBuildingName,formDTO.getBuildingName()); +// IcBuildingEntity building = ConvertUtils.sourceToTarget(formDTO, IcBuildingEntity.class); + + +// QueryWrapper houseEntityQueryWrapper = new QueryWrapper<>(); +// houseEntityQueryWrapper.lambda() +// .eq(!StringUtils.isEmpty(formDTO.getOwnerName()),IcHouseEntity::getOwnerName,formDTO.getOwnerName()) +// .like(!StringUtils.isEmpty(formDTO.getOwnerPhone()),IcHouseEntity::getOwnerPhone,formDTO.getOwnerPhone()); +// houseEntityQueryWrapper.eq("a.DEL_FLAG","0"); + + IcHouseEntity house = ConvertUtils.sourceToTarget(formDTO, IcHouseEntity.class); + house.setDelFlag("0"); + + IPage> mapIPage = icHouseDao.searchHouseByPage(page, house); + List> records = mapIPage.getRecords(); + records.forEach(item->{ + item.put("houseType", HouseTypeEnums.getTypeValue(item.get("houseTypeKey"))); +// item.put("rentFlag", HouseRentFlagEnums.getTypeValue(item.get("rentFlagKey") )); + item.put("purpose", HousePurposeEnums.getTypeValue(item.get("purposeKey"))); + }); + return mapIPage; + } + + @Override + public List queryListHouseInfo(Set houseIdList) { + if(org.apache.commons.collections4.CollectionUtils.isEmpty(houseIdList)){ + return new ArrayList<>(); + } + return icHouseDao.queryHouseInfo(houseIdList); + } +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcBuildingServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcBuildingServiceImpl.java new file mode 100644 index 0000000000..ea85e2ce33 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcBuildingServiceImpl.java @@ -0,0 +1,136 @@ +/** + * 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.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; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.dto.result.OptionResultDTO; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.IcBuildingDao; +import com.epmet.dto.IcBuildingDTO; +import com.epmet.entity.IcBuildingEntity; +import com.epmet.service.IcBuildingService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 楼栋信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +@Slf4j +@Service +public class IcBuildingServiceImpl extends BaseServiceImpl implements IcBuildingService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcBuildingDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcBuildingDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcBuildingDTO get(String id) { + IcBuildingEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcBuildingDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcBuildingDTO dto) { + IcBuildingEntity entity = ConvertUtils.sourceToTarget(dto, IcBuildingEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcBuildingDTO dto) { + IcBuildingEntity entity = ConvertUtils.sourceToTarget(dto, IcBuildingEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @param neighborHoodId + * @Description 获取小区内的楼栋 + * @Param neighborHoodId + * @Return {@link List< OptionResultDTO >} + * @Author zhaoqifeng + * @Date 2021/10/26 14:43 + */ + @Override + public List getBuildingOptions(String neighborHoodId) { + if (StringUtils.isBlank(neighborHoodId)) { + log.warn("小区ID为空"); + return Collections.emptyList(); + } + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcBuildingEntity::getNeighborHoodId, neighborHoodId); + wrapper.last("ORDER BY CONVERT ( BUILDING_NAME USING gbk ) ASC"); + List list = baseDao.selectList(wrapper); + if(CollectionUtils.isEmpty(list)) { + return Collections.emptyList(); + } + return list.stream().map(item -> { + OptionResultDTO dto = new OptionResultDTO(); + dto.setValue(item.getId()); + dto.setLabel(item.getBuildingName()); + return dto; + }).collect(Collectors.toList()); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcBuildingUnitServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcBuildingUnitServiceImpl.java new file mode 100644 index 0000000000..4b8cb1f094 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcBuildingUnitServiceImpl.java @@ -0,0 +1,136 @@ +/** + * 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.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; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.dto.result.OptionResultDTO; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.IcBuildingUnitDao; +import com.epmet.dto.IcBuildingUnitDTO; +import com.epmet.entity.IcBuildingUnitEntity; +import com.epmet.service.IcBuildingUnitService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 楼栋单元信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +@Slf4j +@Service +public class IcBuildingUnitServiceImpl extends BaseServiceImpl implements IcBuildingUnitService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcBuildingUnitDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcBuildingUnitDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcBuildingUnitDTO get(String id) { + IcBuildingUnitEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcBuildingUnitDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcBuildingUnitDTO dto) { + IcBuildingUnitEntity entity = ConvertUtils.sourceToTarget(dto, IcBuildingUnitEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcBuildingUnitDTO dto) { + IcBuildingUnitEntity entity = ConvertUtils.sourceToTarget(dto, IcBuildingUnitEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @param buildingId + * @Description 获取楼栋内单元 + * @Param buildingId + * @Return {@link List} + * @Author zhaoqifeng + * @Date 2021/10/26 14:49 + */ + @Override + public List getUnitOptions(String buildingId) { + if (StringUtils.isBlank(buildingId)) { + log.warn("楼栋ID为空"); + return Collections.emptyList(); + } + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcBuildingUnitEntity::getBuildingId, buildingId); + wrapper.last("ORDER BY CONVERT ( UNIT_NAME USING gbk ) ASC"); + List list = baseDao.selectList(wrapper); + if(CollectionUtils.isEmpty(list)) { + return Collections.emptyList(); + } + return list.stream().map(item -> { + OptionResultDTO dto = new OptionResultDTO(); + dto.setValue(item.getId()); + dto.setLabel(item.getUnitName()); + return dto; + }).collect(Collectors.toList()); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java new file mode 100644 index 0000000000..b6d0585694 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java @@ -0,0 +1,238 @@ +/** + * 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.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; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.dto.result.OptionResultDTO; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dao.IcHouseDao; +import com.epmet.dto.IcHouseDTO; +import com.epmet.dto.IcResiCategoryStatsConfigDTO; +import com.epmet.dto.IcResiUserDTO; +import com.epmet.dto.form.HouseFormDTO; +import com.epmet.dto.result.HouseListResultDTO; +import com.epmet.entity.IcHouseEntity; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.feign.OperCustomizeOpenFeignClient; +import com.epmet.service.IcHouseService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 房屋信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +@Slf4j +@Service +public class IcHouseServiceImpl extends BaseServiceImpl implements IcHouseService { + @Resource + private OperCustomizeOpenFeignClient operCustomizeOpenFeignClient; + @Resource + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcHouseDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcHouseDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcHouseDTO get(String id) { + IcHouseEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcHouseDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcHouseDTO dto) { + IcHouseEntity entity = ConvertUtils.sourceToTarget(dto, IcHouseEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcHouseDTO dto) { + IcHouseEntity entity = ConvertUtils.sourceToTarget(dto, IcHouseEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @param formDTO + * @Description 获取楼栋房屋列表 + * @Param formDTO + * @Return {@link List} + * @Author zhaoqifeng + * @Date 2021/10/25 17:04 + */ + @Override + public List getHouseOption(HouseFormDTO formDTO) { + if (StringUtils.isBlank(formDTO.getBuildingId()) && StringUtils.isBlank(formDTO.getUnitId())) { + log.warn("楼栋和单元ID为空"); + return Collections.emptyList(); + } + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(formDTO.getBuildingId()), IcHouseEntity::getBuildingId, formDTO.getBuildingId()); + wrapper.eq(StringUtils.isNotBlank(formDTO.getUnitId()), IcHouseEntity::getBuildingUnitId, formDTO.getUnitId()); + wrapper.last("ORDER BY CONVERT ( HOUSE_NAME USING gbk ) ASC"); + List list = baseDao.selectList(wrapper); + if(CollectionUtils.isEmpty(list)) { + return Collections.emptyList(); + } + return list.stream().map(item -> { + OptionResultDTO dto = new OptionResultDTO(); + dto.setValue(item.getId()); + dto.setLabel(item.getHouseName()); + return dto; + }).collect(Collectors.toList()); + } + + /** + * @Description 查询房屋信息 + * @param idCard + * @author zxc + * @date 2021/11/3 3:30 下午 + */ + @Override + public List selectHouseInfoByIdCard(String idCard) { + List result = baseDao.selectHouseInfoByIdCard(idCard); + if (CollectionUtils.isEmpty(result)){ + return new ArrayList<>(); + } + return result; + } + + /** + * @param formDTO + * @Description 楼栋下房屋列表 + * @Param tokenDto + * @Param formDTO + * @Return {@link List< HouseListResultDTO >} + * @Author zhaoqifeng + * @Date 2021/11/5 16:01 + */ + @Override + public List getHouseList(TokenDto tokenDto, HouseFormDTO formDTO) { + //查询楼栋下房屋列表 + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcHouseEntity::getBuildingId, formDTO.getBuildingId()); + wrapper.last("ORDER BY CONVERT ( HOUSE_NAME USING gbk ) ASC"); + List list = baseDao.selectList(wrapper); + if(CollectionUtils.isEmpty(list)) { + return Collections.emptyList(); + } + //获取居民分类列表 + IcResiCategoryStatsConfigDTO categoryDto = new IcResiCategoryStatsConfigDTO(); + categoryDto.setCustomerId(tokenDto.getCustomerId()); + Result> categoryResult = operCustomizeOpenFeignClient.getCategoryList(categoryDto); + if (!categoryResult.success()) { + throw new RenException(categoryResult.getCode(), categoryResult.getMsg()); + } + List categoryList = categoryResult.getData(); + //获取居民分类数量统计 + IcResiUserDTO userDTO = new IcResiUserDTO(); + userDTO.setBuildId(formDTO.getBuildingId()); + Result>> resultMap = epmetUserOpenFeignClient.getHomeUserCategoryCount(userDTO); + if (!resultMap.success()) { + throw new RenException(resultMap.getCode(), resultMap.getMsg()); + } + Map> map = resultMap.getData(); + + return list.stream().map(item -> { + Map countMap = map.get(item.getId()); + HouseListResultDTO dto = new HouseListResultDTO(); + dto.setHouseId(item.getId()); + dto.setHouseName(item.getHouseName()); + List categories = new ArrayList<>(); + if (null != countMap && CollectionUtils.isNotEmpty(categoryList)) { + for (IcResiCategoryStatsConfigDTO category : categoryList) { + if (null == countMap.get(category.getColumnName()) || NumConstant.ZERO_STR.equals(countMap.get(category.getColumnName()))) { + continue; + } + HouseListResultDTO.CategoryListBean bean = new HouseListResultDTO.CategoryListBean(); + bean.setName(category.getLabel()); + bean.setIconUrl(category.getHouseShowIcon()); + if ("党员".equals(category.getLabel())) { + bean.setIsSpecial(NumConstant.ONE_STR); + } else { + bean.setIsSpecial(NumConstant.ZERO_STR); + } + categories.add(bean); + } + } + //将党员放在最前面 + if(CollectionUtils.isNotEmpty(categories)) { + int a = 0; + for (int i = 0; i < categories.size(); i++) { + if ("党员".equals(categories.get(i).getName())) { + a = i; + break; + } + } + categories.add(NumConstant.ZERO, categories.remove(a)); + } + dto.setCategoryList(categories); + return dto; + }).collect(Collectors.toList()); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcMatterAppointmentRecordServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcMatterAppointmentRecordServiceImpl.java new file mode 100644 index 0000000000..6878b736c3 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcMatterAppointmentRecordServiceImpl.java @@ -0,0 +1,100 @@ +/** + * 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.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.IcMatterAppointmentRecordDao; +import com.epmet.dto.IcMatterAppointmentRecordDTO; +import com.epmet.entity.IcMatterAppointmentRecordEntity; +import com.epmet.service.IcMatterAppointmentRecordService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 事项预约记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Service +public class IcMatterAppointmentRecordServiceImpl extends BaseServiceImpl implements IcMatterAppointmentRecordService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcMatterAppointmentRecordDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcMatterAppointmentRecordDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcMatterAppointmentRecordDTO get(String id) { + IcMatterAppointmentRecordEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcMatterAppointmentRecordDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcMatterAppointmentRecordDTO dto) { + IcMatterAppointmentRecordEntity entity = ConvertUtils.sourceToTarget(dto, IcMatterAppointmentRecordEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcMatterAppointmentRecordDTO dto) { + IcMatterAppointmentRecordEntity entity = ConvertUtils.sourceToTarget(dto, IcMatterAppointmentRecordEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodPartServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodPartServiceImpl.java new file mode 100644 index 0000000000..b9b3fc4a24 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodPartServiceImpl.java @@ -0,0 +1,101 @@ +/** + * 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.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.IcNeighborHoodPartDao; +import com.epmet.dto.IcNeighborHoodPartDTO; +import com.epmet.entity.IcNeighborHoodPartEntity; +import com.epmet.service.IcNeighborHoodPartService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 小区-分区表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +@Service +public class IcNeighborHoodPartServiceImpl extends BaseServiceImpl implements IcNeighborHoodPartService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcNeighborHoodPartDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcNeighborHoodPartDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcNeighborHoodPartDTO get(String id) { + IcNeighborHoodPartEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcNeighborHoodPartDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcNeighborHoodPartDTO dto) { + IcNeighborHoodPartEntity entity = ConvertUtils.sourceToTarget(dto, IcNeighborHoodPartEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcNeighborHoodPartDTO dto) { + IcNeighborHoodPartEntity entity = ConvertUtils.sourceToTarget(dto, IcNeighborHoodPartEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodPropertyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodPropertyServiceImpl.java new file mode 100644 index 0000000000..d4f877114a --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodPropertyServiceImpl.java @@ -0,0 +1,101 @@ +/** + * 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.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.IcNeighborHoodPropertyDao; +import com.epmet.dto.IcNeighborHoodPropertyDTO; +import com.epmet.entity.IcNeighborHoodPropertyEntity; +import com.epmet.service.IcNeighborHoodPropertyService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 小区物业关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +@Service +public class IcNeighborHoodPropertyServiceImpl extends BaseServiceImpl implements IcNeighborHoodPropertyService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcNeighborHoodPropertyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcNeighborHoodPropertyDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcNeighborHoodPropertyDTO get(String id) { + IcNeighborHoodPropertyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcNeighborHoodPropertyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcNeighborHoodPropertyDTO dto) { + IcNeighborHoodPropertyEntity entity = ConvertUtils.sourceToTarget(dto, IcNeighborHoodPropertyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcNeighborHoodPropertyDTO dto) { + IcNeighborHoodPropertyEntity entity = ConvertUtils.sourceToTarget(dto, IcNeighborHoodPropertyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodServiceImpl.java new file mode 100644 index 0000000000..3d5b6fa96b --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodServiceImpl.java @@ -0,0 +1,163 @@ +/** + * 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.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; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.dto.result.OptionResultDTO; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.IcNeighborHoodDao; +import com.epmet.dto.IcNeighborHoodDTO; +import com.epmet.entity.IcNeighborHoodEntity; +import com.epmet.service.IcNeighborHoodService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 小区表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +@Slf4j +@Service +public class IcNeighborHoodServiceImpl extends BaseServiceImpl implements IcNeighborHoodService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcNeighborHoodDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcNeighborHoodDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcNeighborHoodDTO get(String id) { + IcNeighborHoodEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcNeighborHoodDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcNeighborHoodDTO dto) { + IcNeighborHoodEntity entity = ConvertUtils.sourceToTarget(dto, IcNeighborHoodEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcNeighborHoodDTO dto) { + IcNeighborHoodEntity entity = ConvertUtils.sourceToTarget(dto, IcNeighborHoodEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @Description 获取网格下小区列表 + * @param agencyId + * @Param gridId + * @Return {@link List< OptionResultDTO >} + * @Author zhaoqifeng + * @Date 2021/10/26 14:32 + */ + @Override + public List getNeighborHoodOptions(String agencyId, String gridId,String staffId,String customerId) { + if (StringUtils.isBlank(agencyId)&&StringUtils.isEmpty(gridId)) { + log.info("agencyId与gridId都为空时,默认查询当前工作人员所属组织下的小区"); + CustomerStaffInfoCacheResult result= CustomerStaffRedis.getStaffInfo(customerId,staffId); + if (null == result || StringUtils.isBlank(result.getAgencyId())) { + log.error(String.format("staffId:%s,工作人员缓存信息查询异常")); + return Collections.emptyList(); + } + agencyId=result.getAgencyId(); + } + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(agencyId),IcNeighborHoodEntity::getAgencyId, agencyId); + wrapper.eq(StringUtils.isNotBlank(gridId), IcNeighborHoodEntity::getGridId, gridId); + wrapper.last("ORDER BY CONVERT ( NEIGHBOR_HOOD_NAME USING gbk ) ASC"); + List list = baseDao.selectList(wrapper); + if(CollectionUtils.isEmpty(list)) { + return Collections.emptyList(); + } + return list.stream().map(item -> { + OptionResultDTO dto = new OptionResultDTO(); + dto.setValue(item.getId()); + dto.setLabel(item.getNeighborHoodName()); + return dto; + }).collect(Collectors.toList()); + } + + /** + * @param ids + * @Description 通过ID查询小区信息 + * @Param ids + * @Return {@link List< IcNeighborHoodDTO>} + * @Author zhaoqifeng + * @Date 2021/11/8 10:45 + */ + @Override + public List getListByIds(List ids) { + if (CollectionUtils.isEmpty(ids)) { + return Collections.emptyList(); + } + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.in(IcNeighborHoodEntity::getId, ids); + List list = baseDao.selectList(wrapper); + return ConvertUtils.sourceToTarget(list, IcNeighborHoodDTO.class); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterMatterServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterMatterServiceImpl.java new file mode 100644 index 0000000000..e6e85dc9ff --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterMatterServiceImpl.java @@ -0,0 +1,123 @@ +/** + * 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.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.IcPartyServiceCenterMatterDao; +import com.epmet.dto.IcPartyServiceCenterMatterDTO; +import com.epmet.entity.IcPartyServiceCenterMatterEntity; +import com.epmet.service.IcPartyServiceCenterMatterService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 党群服务中心可预约事项表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Service +public class IcPartyServiceCenterMatterServiceImpl extends BaseServiceImpl implements IcPartyServiceCenterMatterService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcPartyServiceCenterMatterDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcPartyServiceCenterMatterDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcPartyServiceCenterMatterDTO get(String id) { + IcPartyServiceCenterMatterEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcPartyServiceCenterMatterDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcPartyServiceCenterMatterDTO dto) { + IcPartyServiceCenterMatterEntity entity = ConvertUtils.sourceToTarget(dto, IcPartyServiceCenterMatterEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcPartyServiceCenterMatterDTO dto) { + IcPartyServiceCenterMatterEntity entity = ConvertUtils.sourceToTarget(dto, IcPartyServiceCenterMatterEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @Description 根据党群服务中心删除事项 + * @param partyServiceCenterId + * @author zxc + * @date 2021/11/22 10:29 上午 + */ + @Transactional(rollbackFor = Exception.class) + @Override + public void deleteMattersByPartyServiceCenterId(String partyServiceCenterId) { + baseDao.deleteMattersByPartyServiceCenterId(partyServiceCenterId); + } + + /** + * @Description 根据党群服务中心ID查询事件名字 + * @param centerId + * @author zxc + * @date 2021/12/10 8:56 上午 + */ + @Override + public List selectMatterNameByCenterId(String centerId) { + return baseDao.selectMatterNameByCenterId(centerId); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java new file mode 100644 index 0000000000..f15494c546 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java @@ -0,0 +1,501 @@ +/** + * 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.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.entity.BaseEpmetEntity; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerOrgRedis; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.constant.PartyServiceCenterConstant; +import com.epmet.dao.IcMatterAppointmentRecordDao; +import com.epmet.dao.IcPartyServiceCenterDao; +import com.epmet.dto.IcPartyServiceCenterDTO; +import com.epmet.dto.TimeDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.result.AppointmentExistRecordResultDTO; +import com.epmet.dto.result.AppointmentRecordResultDTO; +import com.epmet.dto.result.AppointmentTimeResultDTO; +import com.epmet.dto.result.PartyServiceCenterListResultDTO; +import com.epmet.entity.IcMatterAppointmentRecordEntity; +import com.epmet.entity.IcPartyServiceCenterEntity; +import com.epmet.entity.IcPartyServiceCenterMatterEntity; +import com.epmet.service.IcPartyServiceCenterMatterService; +import com.epmet.service.IcPartyServiceCenterService; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.concurrent.atomic.AtomicReference; +import java.util.stream.Collectors; + +/** + * 党群服务中心 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Service +public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl implements IcPartyServiceCenterService { + + @Autowired + private IcPartyServiceCenterMatterService matterService; + @Autowired + private IcMatterAppointmentRecordDao matterAppointmentRecordDao; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcPartyServiceCenterDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcPartyServiceCenterDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcPartyServiceCenterDTO get(String id) { + IcPartyServiceCenterEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcPartyServiceCenterDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcPartyServiceCenterDTO dto) { + IcPartyServiceCenterEntity entity = ConvertUtils.sourceToTarget(dto, IcPartyServiceCenterEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcPartyServiceCenterDTO dto) { + IcPartyServiceCenterEntity entity = ConvertUtils.sourceToTarget(dto, IcPartyServiceCenterEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @Description 新增党群服务中心 + * @param formDTO + * @param tokenDto + * @author zxc + * @date 2021/11/22 9:13 上午 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void addPartyServiceCenter(AddPartyServiceCenterFormDTO formDTO, TokenDto tokenDto) { + String customerId = tokenDto.getCustomerId(); + LambdaQueryWrapper l = new LambdaQueryWrapper<>(); + l.eq(IcPartyServiceCenterEntity::getCenterName,formDTO.getCenterName()) + .eq(IcPartyServiceCenterEntity::getCustomerId,customerId) + .eq(BaseEpmetEntity::getDelFlag, NumConstant.ZERO); + IcPartyServiceCenterEntity record = baseDao.selectOne(l); + if (null != record){ + throw new RenException(EpmetErrorCode.PARTY_SERVICE_CENTER_ERROR.getCode()); + } + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(customerId, tokenDto.getUserId()); + if (null == staffInfo){ + throw new RenException(String.format("查询人员{%s}信息失败",tokenDto.getUserId())); + } + IcPartyServiceCenterEntity centerEntity = ConvertUtils.sourceToTarget(formDTO, IcPartyServiceCenterEntity.class); + centerEntity.setCustomerId(customerId); + centerEntity.setOrgId(staffInfo.getAgencyId()); + centerEntity.setOrgType(PartyServiceCenterConstant.ORG_TYPE_AGENCY); + AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(staffInfo.getAgencyId()); + if (null == agencyInfo){ + throw new RenException(String.format("查询组织信息失败%s",staffInfo.getAgencyId())); + } + centerEntity.setPid(agencyInfo.getPid()); + centerEntity.setPids(agencyInfo.getPids()); + baseDao.insert(centerEntity); + if (CollectionUtils.isNotEmpty(formDTO.getMatterList())){ + List matters = ConvertUtils.sourceToTarget(formDTO.getMatterList(), IcPartyServiceCenterMatterEntity.class); + List paramMatterNames = matters.stream().map(m -> m.getMatterName()).collect(Collectors.toList()); + Integer allSize = paramMatterNames.size(); + Integer distinctSize = paramMatterNames.stream().distinct().collect(Collectors.toList()).size(); + if (distinctSize < allSize){ + throw new EpmetException(EpmetErrorCode.MATTER_NAME_EXISTS_APPOINTMENT_ERROR.getCode()); + } + matters.forEach(m -> { + m.setCustomerId(customerId); + m.setPartyServiceCenterId(centerEntity.getId()); + }); + matterService.insertBatch(matters); + } + } + + /** + * @Description 修改党群服务中心 + * 事项只准删除,不准修改 + * @param formDTO + * @param tokenDto + * @author zxc + * @date 2021/11/22 10:21 上午 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void editPartyServiceCenter(EditPartyServiceCenterFormDTO formDTO, TokenDto tokenDto) { + LambdaQueryWrapper l = new LambdaQueryWrapper<>(); + l.eq(IcPartyServiceCenterEntity::getCenterName,formDTO.getCenterName()) + .eq(IcPartyServiceCenterEntity::getCustomerId,tokenDto.getCustomerId()) + .eq(BaseEpmetEntity::getDelFlag, NumConstant.ZERO) + .ne(BaseEpmetEntity::getId,formDTO.getPartyServiceCenterId()); + IcPartyServiceCenterEntity record = baseDao.selectOne(l); + if (null != record){ + throw new RenException(EpmetErrorCode.PARTY_SERVICE_CENTER_ERROR.getCode()); + } + IcPartyServiceCenterEntity centerEntity = ConvertUtils.sourceToTarget(formDTO, IcPartyServiceCenterEntity.class); + centerEntity.setId(formDTO.getPartyServiceCenterId()); + baseDao.updateById(centerEntity); + + // del matter + if (CollectionUtils.isNotEmpty(formDTO.getDelMatterList())){ + List delMatterList = formDTO.getDelMatterList(); + List existRecord = matterAppointmentRecordDao.appointmentExistRecord(delMatterList); + if (CollectionUtils.isNotEmpty(existRecord)){ + StringBuffer sb = new StringBuffer(); + existRecord.forEach(e -> { + sb.append(e.getMatterName()).append(","); + }); + String copywriter = sb.toString().substring(NumConstant.ZERO, sb.length() - NumConstant.ONE); + EpmetErrorCode.APPOINTMENT_ERROR.setMsg(String.format(EpmetErrorCode.APPOINTMENT_ERROR.getMsg(),copywriter)); + throw new RenException(EpmetErrorCode.APPOINTMENT_ERROR.getCode()); + }else { + matterService.deleteBatchIds(delMatterList); + } + } + + if (CollectionUtils.isNotEmpty(formDTO.getMatterList())){ + List existsMatterNames = matterService.selectMatterNameByCenterId(formDTO.getPartyServiceCenterId()); + List matters = ConvertUtils.sourceToTarget(formDTO.getMatterList(), IcPartyServiceCenterMatterEntity.class); + List paramMatterNames = matters.stream().map(m -> m.getMatterName()).collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(existsMatterNames)){ + paramMatterNames.addAll(existsMatterNames); + } + Integer allSize = paramMatterNames.size(); + Integer distinctSize = paramMatterNames.stream().distinct().collect(Collectors.toList()).size(); + if (distinctSize < allSize){ + throw new EpmetException(EpmetErrorCode.MATTER_NAME_EXISTS_APPOINTMENT_ERROR.getCode()); + } + matters.forEach(m -> { + m.setCustomerId(tokenDto.getCustomerId()); + m.setPartyServiceCenterId(formDTO.getPartyServiceCenterId()); + }); + matterService.insertBatch(matters); + } + } + + /** + * @Description 事项删除 + * @param formDTO + * @author zxc + * @date 2021/11/22 1:25 下午 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void delMatter(DelMatterFormDTO formDTO) { + LambdaQueryWrapper re = new LambdaQueryWrapper<>(); + re.eq(BaseEpmetEntity::getDelFlag,NumConstant.ZERO). + eq(IcMatterAppointmentRecordEntity::getMatterId,formDTO.getMatterId()). + ge(IcMatterAppointmentRecordEntity::getAppointmentDate, LocalDate.now()); + List appointmentRecords = matterAppointmentRecordDao.selectList(re); + if (CollectionUtils.isNotEmpty(appointmentRecords)){ + throw new RenException(EpmetErrorCode.MATTER_EXISTS_APPOINTMENT_ERROR.getCode()); + } + matterService.deleteById(formDTO.getMatterId()); + } + + /** + * @Description 预约 + * @param formDTO + * @param tokenDto + * @author zxc + * @date 2021/11/22 2:06 下午 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void appointment(AppointmentFormDTO formDTO, TokenDto tokenDto) { + String customerId = tokenDto.getCustomerId(); + LambdaQueryWrapper l = new LambdaQueryWrapper<>(); + l.eq(IcMatterAppointmentRecordEntity::getMatterId,formDTO.getMatterId()) + .eq(IcMatterAppointmentRecordEntity::getAppointmentDate,formDTO.getAppointmentDate()) + .eq(IcMatterAppointmentRecordEntity::getStatus,PartyServiceCenterConstant.APPOINTMENT_STATUS_APPOINTING) + .eq(BaseEpmetEntity::getDelFlag,NumConstant.ZERO); + List records = matterAppointmentRecordDao.selectList(l); + if (CollectionUtils.isNotEmpty(records)){ + List timeIds = new ArrayList<>(); + records.forEach(r -> { + timeIds.addAll(Arrays.asList(r.getTimeId().split(","))); + }); + List formTimeId = Arrays.asList(formDTO.getTimeId().split(",")); + int before = timeIds.size() + formTimeId.size(); + List endTimeId = new ArrayList<>(); + endTimeId.addAll(timeIds);endTimeId.addAll(formTimeId); + List collect = endTimeId.stream().distinct().collect(Collectors.toList()); + if (collect.size() < before){ + throw new RenException(EpmetErrorCode.APPOINTMENT_TIME_ERROR.getCode()); + } + } + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(customerId, tokenDto.getUserId()); + if (null == staffInfo){ + throw new RenException(String.format("查询人员{%s}信息失败",tokenDto.getUserId())); + } + AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(staffInfo.getAgencyId()); + if (null == agencyInfo){ + throw new RenException(String.format("查询组织信息失败%s",staffInfo.getAgencyId())); + } + IcMatterAppointmentRecordEntity e = ConvertUtils.sourceToTarget(formDTO, IcMatterAppointmentRecordEntity.class); + e.setCustomerId(customerId); + e.setOrgId(staffInfo.getAgencyId()); + e.setOrgType(PartyServiceCenterConstant.ORG_TYPE_AGENCY); + e.setPid(agencyInfo.getPid()); + e.setPids(agencyInfo.getPids()); + e.setStatus(PartyServiceCenterConstant.APPOINTMENT_STATUS_APPOINTING); + matterAppointmentRecordDao.insert(e); + } + + /** + * @Description 党群服务中心列表 + * @param formDTO + * @param tokenDto + * @author zxc + * @date 2021/11/22 2:47 下午 + */ + @Override + public List partyServiceCenterList(PartyServiceCenterListFormDTO formDTO, TokenDto tokenDto) { + if (StringUtils.isBlank(formDTO.getOrgId())){ + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); + if (null == staffInfo){ + throw new RenException(String.format("查询人员{%s}信息失败",tokenDto.getUserId())); + } + formDTO.setOrgId(staffInfo.getAgencyId()); + } + List result = baseDao.partyServiceCenterList(formDTO.getOrgId()); + if (CollectionUtils.isNotEmpty(result)){ + result.forEach(r -> { + if (CollectionUtils.isNotEmpty(r.getMatterList())){ + final Integer[] sort = {NumConstant.ONE}; + r.getMatterList().forEach(m -> { + m.setSort(sort[NumConstant.ZERO]++); + }); + } + }); + } + return result; + } + + /** + * @Description 【党群服务中心】点击预约按钮时,查询可选时间 + * @param formDTO + * @author zxc + * @date 2021/11/23 10:02 上午 + */ + @Override + public AppointmentTimeResultDTO appointmentTime(AppointmentTimeFormDTO formDTO) { + AppointmentTimeResultDTO result = new AppointmentTimeResultDTO(); + IcPartyServiceCenterMatterEntity matter = matterService.selectById(formDTO.getMatterId()); + if (null == matter){ + throw new RenException("事项不存在..."); + } + result.setAppointmentType(matter.getAppointmentType()); + LambdaQueryWrapper l = new LambdaQueryWrapper<>(); + l.eq(IcMatterAppointmentRecordEntity::getMatterId,formDTO.getMatterId()) + .eq(IcMatterAppointmentRecordEntity::getAppointmentDate,formDTO.getDate()) + .eq(IcMatterAppointmentRecordEntity::getStatus,PartyServiceCenterConstant.APPOINTMENT_STATUS_APPOINTING) + .eq(BaseEpmetEntity::getDelFlag,NumConstant.ZERO); + List records = matterAppointmentRecordDao.selectList(l); + List timeList = getTimeList(matter.getStartTime(), matter.getEndTime(), NumConstant.THIRTY); + if (formDTO.getDate().equals(LocalDate.now().toString())){ + LocalDateTime now = LocalDateTime.now(); + DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); + for (TimeDTO t : timeList) { + List list = Arrays.asList(t.getTime().split("-")); + String concat = formDTO.getDate().concat(" ").concat(list.get(NumConstant.ONE)).concat(":00"); + LocalDateTime parse = LocalDateTime.parse(concat, df); + t.setIsAppointment(parse.isAfter(now)); + } + } + if (LocalDate.now().isAfter(LocalDate.parse(formDTO.getDate()))){ + timeList.forEach(t -> { + t.setIsAppointment(false); + }); + result.setTimeDetail(timeList); + return result; + } + if (CollectionUtils.isNotEmpty(records)){ + records.forEach(r -> { + String[] split = r.getTimeId().split(","); + for (String s : split) { + for (TimeDTO t : timeList) { + if (s.equals(t.getTimeId())){ + t.setIsAppointment(false); + break; + } + } + } + }); + } + result.setTimeDetail(timeList); + return result; + } + + /** + * @Description 【党群服务中心】预约记录 + * @param formDTO + * @author zxc + * @date 2021/11/23 10:50 上午 + */ + @Override + public List appointmentRecord(AppointmentRecordFormDTO formDTO) { + List result = matterAppointmentRecordDao.appointmentRecord(formDTO.getMatterId(), formDTO.getDate()); + if (CollectionUtils.isEmpty(result)){ + return new ArrayList<>(); + } + IcPartyServiceCenterMatterEntity matter = matterService.selectById(formDTO.getMatterId()); + if (null == matter){ + throw new RenException("事项不存在..."); + } + List timeList = getTimeList(matter.getStartTime(), matter.getEndTime(), NumConstant.THIRTY); + AtomicReference sort = new AtomicReference<>(NumConstant.ONE); + result.forEach(r -> { + r.setSort(sort.getAndSet(sort.get() + NumConstant.ONE)); + List time = new ArrayList<>(); + List list = Arrays.asList(r.getTimeId().split(",")); + list.forEach(l -> timeList.stream().filter( t -> l.equals(t.getTimeId())).forEach(t -> time.add(t.getTime()))); + r.setAppointmentTime(time); + }); + return result; + } + + /** + * @Description 取消预约 + * @param formDTO + * @author zxc + * @date 2021/11/26 5:21 下午 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void cancelAppointment(CancelAppointmentFormDTO formDTO) { + matterAppointmentRecordDao.cancelAppointment(formDTO.getRecordId(), formDTO.getUserId()); + } + + public List getTimeList(String start,String end,Integer interval){ + List result = new ArrayList<>(); + List intervalTimeList = getIntervalTimeList(start, end, interval); + Integer sort = NumConstant.ONE; + for (int i = NumConstant.ZERO; i < intervalTimeList.size(); i++) { + if (i + NumConstant.ONE >= intervalTimeList.size()){ + return result; + } + TimeDTO timeDTO = new TimeDTO(); + timeDTO.setTime(intervalTimeList.get(i) + "-" + intervalTimeList.get(i + NumConstant.ONE)); + timeDTO.setTimeId(String.valueOf(sort++)); + result.add(timeDTO); + } + return result; + } + + /** + * @Description 获取固定时间段之间固定时间的集合 + * @param start 开始时间 + * @param end 结束时间 + * @param interval 间隔时间 + * @author zxc + * @date 2021/11/22 3:48 下午 + */ + public List getIntervalTimeList(String start,String end,Integer interval) { + Date startDate = convertStringToDate("HH:mm", start); + Date endDate = convertStringToDate("HH:mm", end); + List list = new ArrayList<>(); + while (startDate.getTime() <= endDate.getTime()) { + list.add(convertDateToString("HH:mm", startDate)); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(startDate); + calendar.add(Calendar.MINUTE, interval); + if (calendar.getTime().getTime() > endDate.getTime()) { + if (!startDate.equals(endDate)) { + list.add(convertDateToString("HH:mm", endDate)); + } + startDate = calendar.getTime(); + } else { + startDate = calendar.getTime(); + } + + } + return list; + } + + + public Date convertStringToDate(String format, String dateStr) { + SimpleDateFormat simpleDateFormat = new SimpleDateFormat(format); + try { + Date date = simpleDateFormat.parse(dateStr); + return date; + } catch (ParseException e) { + e.printStackTrace(); + } + return null; + } + + public String convertDateToString(String format, Date date) { + SimpleDateFormat simpleDateFormat = new SimpleDateFormat(format); + return simpleDateFormat.format(date); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlaceOrgServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlaceOrgServiceImpl.java new file mode 100644 index 0000000000..1a0e071404 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlaceOrgServiceImpl.java @@ -0,0 +1,171 @@ +/** + * 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.service.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.dto.result.OptionResultDTO; +import com.epmet.commons.tools.enums.DictTypeEnum; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dao.IcPlaceOrgDao; +import com.epmet.dto.form.AddPlaceOrgFormDTO; +import com.epmet.dto.form.EditPlaceOrgFormDTO; +import com.epmet.dto.form.GetListPlaceOrgFormDTO; +import com.epmet.dto.result.GetListPlaceOrgResultDTO; +import com.epmet.dto.result.PlaceOrgDetailResultDTO; +import com.epmet.entity.IcPlaceOrgEntity; +import com.epmet.feign.EpmetAdminOpenFeignClient; +import com.epmet.service.IcPlaceOrgService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +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 org.springframework.util.CollectionUtils; + +import java.util.List; +import java.util.Map; + +/** + * 九小场所下组织管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Service +public class IcPlaceOrgServiceImpl extends BaseServiceImpl implements IcPlaceOrgService { + private static final Logger log = LoggerFactory.getLogger(IcPlaceOrgServiceImpl.class); + @Autowired + private EpmetAdminOpenFeignClient epmetAdminOpenFeignClient; + + /** + * @Author sun + * @Description 新增九小场所下组织 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public void add(AddPlaceOrgFormDTO formDTO) { + IcPlaceOrgEntity entity = ConvertUtils.sourceToTarget(formDTO, IcPlaceOrgEntity.class); + CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); + entity.setAgencyId(staffInfoCache.getAgencyId()); + entity.setPids(staffInfoCache.getAgencyPIds()); + insert(entity); + } + + /** + * @Author sun + * @Description 修改九小场所下组织 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public void edit(EditPlaceOrgFormDTO formDTO) { + IcPlaceOrgEntity entity = baseDao.selectById(formDTO.getPlaceOrgId()); + if (null == entity) { + throw new RenException(String.format("修改九小场所下场所信息失败,场所不存在,场所Id->%s", formDTO.getPlaceOrgId())); + } + entity = ConvertUtils.sourceToTarget(formDTO, IcPlaceOrgEntity.class); + entity.setId(formDTO.getPlaceOrgId()); + baseDao.updateById(entity); + } + + /** + * @Author sun + * @Description 删除九小场所下组织 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public void del(String placeOrgId) { + if (baseDao.deleteById(placeOrgId) < NumConstant.ONE) { + throw new RenException(String.format("删除九小场所下场所信息失败,场所Id->%s", placeOrgId)); + } + } + + /** + * @Author sun + * @Description 九小场所下组织详情 + **/ + @Override + public PlaceOrgDetailResultDTO detail(String placeOrgId) { + PlaceOrgDetailResultDTO resultDTO = new PlaceOrgDetailResultDTO(); + //1.查询场所基础信息 + GetListPlaceOrgFormDTO dto = new GetListPlaceOrgFormDTO(); + dto.setPlaceOrgId(placeOrgId); + List result = baseDao.getList(dto); + if (CollectionUtils.isEmpty(result)) { + return resultDTO; + } + resultDTO = result.get(0); + + //2.查询九小场所信息 + Result> result1 = epmetAdminOpenFeignClient.getNineSmallPlacesOption(); + if (!result1.success()) { + throw new RenException("获取九小场所基本信息失败......"); + } + for (OptionResultDTO d : result1.getData()) { + if (d.getValue().equals(resultDTO.getNinePlaceVal())) { + resultDTO.setNinePlaceName(d.getLabel()); + } + } + + //3.查询人员规模字典表信息 + Result> unitTypeMap = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.SCALE.getCode()); + resultDTO.setScaleName(unitTypeMap.getData().get(resultDTO.getScale())); + + return resultDTO; + } + + /** + * @Author sun + * @Description 九小场所下组织列表查询 + **/ + @Override + public GetListPlaceOrgResultDTO getList(GetListPlaceOrgFormDTO formDTO) { + GetListPlaceOrgResultDTO resultDTO = new GetListPlaceOrgResultDTO(); + CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); + formDTO.setPids(staffInfoCache.getAgencyPIds()); + //1.根据查询条件分页查询场所数据 + PageInfo result = + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()).doSelectPageInfo(() -> baseDao.getList(formDTO)); + if (CollectionUtils.isEmpty(result.getList())) { + return resultDTO; + } + resultDTO.setTotal((int) result.getTotal()); + + //2.查询九小场所信息 + Result> result1 = epmetAdminOpenFeignClient.getNineSmallPlacesOption(); + if (!result1.success()) { + throw new RenException("获取九小场所基本信息失败......"); + } + result.getList().forEach(r -> result1.getData().stream().filter(u -> r.getNinePlaceVal().equals(u.getValue())).forEach(u -> r.setNinePlaceName(u.getLabel()))); + + //3.人员规模字典表赋值 + Result> unitTypeMap = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.SCALE.getCode()); + result.getList().forEach(item -> { + item.setScaleName(unitTypeMap.getData().get(item.getScale())); + }); + + resultDTO.setList(result.getList()); + return resultDTO; + } +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolRecordServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolRecordServiceImpl.java new file mode 100644 index 0000000000..5535988941 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolRecordServiceImpl.java @@ -0,0 +1,205 @@ +/** + * 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.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.dto.result.OptionResultDTO; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dao.IcPlacePatrolRecordDao; +import com.epmet.dao.IcPlacePatrolTeamStaffDao; +import com.epmet.dto.CustomerGridDTO; +import com.epmet.dto.IcPlacePatrolTeamStaffDTO; +import com.epmet.dto.form.AddPlacePatrolRecordFormDTO; +import com.epmet.dto.form.GetListPlacePatrolRecordFormDTO; +import com.epmet.dto.form.GetListPlacePatrolTeamFormDTO; +import com.epmet.dto.result.*; +import com.epmet.entity.IcHouseEntity; +import com.epmet.entity.IcPlacePatrolRecordEntity; +import com.epmet.entity.IcPlacePatrolTeamEntity; +import com.epmet.entity.IcPlacePatrolTeamStaffEntity; +import com.epmet.feign.EpmetAdminOpenFeignClient; +import com.epmet.service.IcPlacePatrolRecordService; +import com.epmet.service.IcPlacePatrolReviewRecordService; +import com.epmet.service.IcPlacePatrolTeamService; +import com.epmet.service.IcPlacePatrolTeamStaffService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import org.apache.commons.lang3.StringUtils; +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 org.springframework.util.CollectionUtils; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 场所巡查记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Service +public class IcPlacePatrolRecordServiceImpl extends BaseServiceImpl implements IcPlacePatrolRecordService { + private static final Logger log = LoggerFactory.getLogger(IcPlaceOrgServiceImpl.class); + @Autowired + private IcPlacePatrolReviewRecordService icPlacePatrolReviewRecordService; + @Autowired + private EpmetAdminOpenFeignClient epmetAdminOpenFeignClient; + @Autowired + private IcPlacePatrolTeamStaffDao icPlacePatrolTeamStaffDao; + + + /** + * @Author sun + * @Description 新增场所巡查记录 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public void add(AddPlacePatrolRecordFormDTO formDTO) { + IcPlacePatrolRecordEntity entity = ConvertUtils.sourceToTarget(formDTO, IcPlacePatrolRecordEntity.class); + CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); + entity.setAgencyId(staffInfoCache.getAgencyId()); + entity.setPids(staffInfoCache.getAgencyPIds()); + entity.setFinalResult(entity.getFirstResult()); + entity.setFinalTime(entity.getFirstTime()); + insert(entity); + } + + /** + * @Author sun + * @Description 删除场所巡查记录 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public void del(String staffId, String placePatrolRecordId) { + //1.删除巡查记录主表数据 + if (baseDao.deleteById(placePatrolRecordId) < NumConstant.ONE) { + throw new RenException(String.format("删除场所巡查记录信息失败,巡查Id->%s", placePatrolRecordId)); + } + //2.删除复查记录附表数据 + icPlacePatrolReviewRecordService.delByPatrolRecordId(staffId, placePatrolRecordId); + } + + /** + * @Author sun + * @Description 场所巡查记录详情 + **/ + @Override + public PlacePatrolRecordDetailResultDTO detail(String placePatrolRecordId) { + PlacePatrolRecordDetailResultDTO resultDTO = new PlacePatrolRecordDetailResultDTO(); + //1.查询巡查记录信息 + GetListPlacePatrolRecordFormDTO dto = new GetListPlacePatrolRecordFormDTO(); + dto.setPlacePatrolRecordId(placePatrolRecordId); + List result = baseDao.getList(dto); + if (CollectionUtils.isEmpty(result)) { + return resultDTO; + } + resultDTO = result.get(0); + + //2.查询九小场所信息 + Result> nineList = epmetAdminOpenFeignClient.getNineSmallPlacesOption(); + if (!nineList.success()) { + throw new RenException("获取九小场所基本信息失败......"); + } + + //3.查询所有分队下人员名单 + List teamIds = new ArrayList<>(); + teamIds.add(resultDTO.getPlacePatrolTeamId()); + List teamDTOList = icPlacePatrolTeamStaffDao.selectByTeamIds(teamIds); + + //4.封装九小场所、分队成员数据 + for (OptionResultDTO n : nineList.getData()){ + if(resultDTO.getNinePlaceVal().equals(n.getValue())){ + resultDTO.setNinePlaceName(n.getLabel()); + } + } + //分队成员 + StringBuffer inspectorsNames = new StringBuffer(); + for (String str : resultDTO.getInspectors().split(",")) { + teamDTOList.forEach(r -> { + if (str.equals(r.getId())) { + inspectorsNames.append("".equals(inspectorsNames.toString().trim()) ? r.getName() : "," + r.getName()); + } + }); + } + resultDTO.setInspectorsNames(inspectorsNames.toString()); + + return resultDTO; + } + + /** + * @Author sun + * @Description 场所巡查记录列表查询 + **/ + @Override + public GetListPlacePatrolRecordResultDTO getList(GetListPlacePatrolRecordFormDTO formDTO) { + GetListPlacePatrolRecordResultDTO resultDTO = new GetListPlacePatrolRecordResultDTO(); + CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); + formDTO.setPids(staffInfoCache.getAgencyPIds()); + //1.根据条件查询巡查记录数据 + PageInfo result = + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.getList(formDTO)); + if (CollectionUtils.isEmpty(result.getList())) { + return resultDTO; + } + resultDTO.setTotal((int) result.getTotal()); + + //2.查询九小场所信息 + Result> nineList = epmetAdminOpenFeignClient.getNineSmallPlacesOption(); + if (!nineList.success()) { + throw new RenException("获取九小场所基本信息失败......"); + } + + //3.查询所有分队下人员名单 + List teamIds = result.getList().stream().map(PlacePatrolRecordDetailResultDTO::getPlacePatrolTeamId).collect(Collectors.toList()); + teamIds = teamIds.stream().distinct().collect(Collectors.toList()); + List teamDTOList = icPlacePatrolTeamStaffDao.selectByTeamIds(teamIds); + //4.封装九小场所、分队人员数据 + for (PlacePatrolRecordDetailResultDTO dto : result.getList()){ + //九小场所 + nineList.getData().forEach(n->{ + if(dto.getNinePlaceVal().equals(n.getValue())){ + dto.setNinePlaceName(n.getLabel()); + } + }); + //分队成员 + StringBuffer inspectorsNames = new StringBuffer(); + for (String str : dto.getInspectors().split(",")) { + teamDTOList.forEach(r -> { + if (str.equals(r.getId())) { + inspectorsNames.append("".equals(inspectorsNames.toString().trim()) ? r.getName() : "," + r.getName()); + } + }); + } + dto.setInspectorsNames(inspectorsNames.toString()); + } + + resultDTO.setList(result.getList()); + return resultDTO; + } +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolReviewRecordServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolReviewRecordServiceImpl.java new file mode 100644 index 0000000000..8019f867c7 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolReviewRecordServiceImpl.java @@ -0,0 +1,221 @@ +/** + * 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.service.impl; + +import com.baomidou.mybatisplus.core.toolkit.StringUtils; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.dto.result.OptionResultDTO; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dao.IcPlacePatrolReviewRecordDao; +import com.epmet.dao.IcPlacePatrolTeamStaffDao; +import com.epmet.dto.IcPlacePatrolTeamStaffDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.result.GetListPlacePatrolRecordResultDTO; +import com.epmet.dto.result.GetListPlacePatrolReviewRecordResultDTO; +import com.epmet.dto.result.PlacePatrolRecordDetailResultDTO; +import com.epmet.dto.result.PlacePatrolReviewRecordDetailResultDTO; +import com.epmet.entity.IcPlacePatrolRecordEntity; +import com.epmet.entity.IcPlacePatrolReviewRecordEntity; +import com.epmet.entity.IcPlacePatrolTeamEntity; +import com.epmet.entity.IcPlacePatrolTeamStaffEntity; +import com.epmet.feign.EpmetAdminOpenFeignClient; +import com.epmet.service.IcPlacePatrolRecordService; +import com.epmet.service.IcPlacePatrolReviewRecordService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +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 org.springframework.util.CollectionUtils; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 场所巡查复查记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Service +public class IcPlacePatrolReviewRecordServiceImpl extends BaseServiceImpl implements IcPlacePatrolReviewRecordService { + private static final Logger log = LoggerFactory.getLogger(IcPlaceOrgServiceImpl.class); + @Autowired + private IcPlacePatrolRecordService icPlacePatrolRecordService; + @Autowired + private IcPlacePatrolTeamStaffDao icPlacePatrolTeamStaffDao; + + + /** + * @Author sun + * @Description 新增巡查复查记录 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public PlacePatrolReviewRecordDetailResultDTO add(AddPlacePatrolReviewRecordFormDTO formDTO) { + PlacePatrolReviewRecordDetailResultDTO resultDTO = new PlacePatrolReviewRecordDetailResultDTO(); + //1.复查记录表新增数据 + IcPlacePatrolReviewRecordEntity entity = ConvertUtils.sourceToTarget(formDTO, IcPlacePatrolReviewRecordEntity.class); + insert(entity); + + //2.修改巡查记录数据最新巡查时间和结果 + IcPlacePatrolRecordEntity recordEntity = new IcPlacePatrolRecordEntity(); + recordEntity.setId(entity.getPlacePatrolRecordId()); + recordEntity.setFinalResult(entity.getReviewResult()); + recordEntity.setFinalTime(entity.getReviewTime()); + icPlacePatrolRecordService.updateById(recordEntity); + + //3.返回详情数据 + resultDTO = detail(entity.getId()); + return resultDTO; + } + + /** + * @Author sun + * @Description 修改巡查复查记录 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public PlacePatrolReviewRecordDetailResultDTO edit(EditPlacePatrolReviewRecordFormDTO formDTO) { + PlacePatrolReviewRecordDetailResultDTO resultDTO = new PlacePatrolReviewRecordDetailResultDTO(); + //1.修改复查记录表数据 + IcPlacePatrolReviewRecordEntity entity = baseDao.selectById(formDTO.getPlacePatrolReviewRecordId()); + if (null == entity) { + throw new RenException(String.format("修改巡查复查记录信息失败,复查记录不存在,复查记录Id->%s", formDTO.getPlacePatrolReviewRecordId())); + } + entity = ConvertUtils.sourceToTarget(formDTO, IcPlacePatrolReviewRecordEntity.class); + entity.setId(formDTO.getPlacePatrolReviewRecordId()); + baseDao.updateById(entity); + + //2.复查记录修改了复查时间或复查结果时对应修改巡查记录数据最新巡查时间和结果 + if (StringUtils.isNotEmpty(formDTO.getReviewResult()) || StringUtils.isNotEmpty(formDTO.getReviewTime().toString())) { + IcPlacePatrolRecordEntity recordEntity = new IcPlacePatrolRecordEntity(); + recordEntity.setId(entity.getPlacePatrolRecordId()); + if (StringUtils.isNotEmpty(formDTO.getReviewResult()) || StringUtils.isNotEmpty(formDTO.getReviewTime().toString())) { + recordEntity.setFinalResult(entity.getReviewResult()); + } + if (StringUtils.isNotEmpty(formDTO.getReviewTime().toString())) { + recordEntity.setFinalTime(entity.getReviewTime()); + } + icPlacePatrolRecordService.updateById(recordEntity); + } + + //3.返回复查记录修改后的详情数据 + resultDTO = detail(formDTO.getPlacePatrolReviewRecordId()); + return resultDTO; + } + + /** + * @Author sun + * @Description 删除巡查复查记录 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public void del(String placePatrolReviewRecordId) { + if (baseDao.deleteById(placePatrolReviewRecordId) < NumConstant.ONE) { + throw new RenException(String.format("删除巡查复查记录信息失败,复查记录Id->%s", placePatrolReviewRecordId)); + } + } + + /** + * @Author sun + * @Description 巡查复查记录详情 + **/ + @Override + public PlacePatrolReviewRecordDetailResultDTO detail(String placePatrolReviewRecordId) { + PlacePatrolReviewRecordDetailResultDTO resultDTO = new PlacePatrolReviewRecordDetailResultDTO(); + //1.查询场所基础信息 + GetListPlacePatrolReviewRecordFormDTO dto = new GetListPlacePatrolReviewRecordFormDTO(); + dto.setPlacePatrolReviewRecordId(placePatrolReviewRecordId); + List result = baseDao.getList(dto); + if (CollectionUtils.isEmpty(result)) { + return resultDTO; + } + resultDTO = result.get(0); + + //2.查询所有分队下人员名单 + List teamDTOList = icPlacePatrolTeamStaffDao.getByTeamId(resultDTO.getPlacePatrolTeamId()); + //3.封装九小场所数据 + StringBuffer inspectorsNames = new StringBuffer(); + for (String str : resultDTO.getInspectors().split(",")) { + teamDTOList.forEach(r -> { + if (str.equals(r.getId())) { + inspectorsNames.append("".equals(inspectorsNames.toString().trim()) ? r.getName() : "," + r.getName()); + } + }); + } + resultDTO.setInspectorsNames(inspectorsNames.toString()); + + return resultDTO; + } + + /** + * @Author sun + * @Description 巡查复查记录列表查询 + **/ + @Override + public GetListPlacePatrolReviewRecordResultDTO getList(GetListPlacePatrolReviewRecordFormDTO formDTO) { + GetListPlacePatrolReviewRecordResultDTO resultDTO = new GetListPlacePatrolReviewRecordResultDTO(); + //1.查询巡查记录对应的复查记录数据 + PageInfo result = + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.getList(formDTO)); + if (CollectionUtils.isEmpty(result.getList())) { + return resultDTO; + } + resultDTO.setTotal((int) result.getTotal()); + + //2.查询所有分队下人员名单 + List teamIds = result.getList().stream().map(PlacePatrolReviewRecordDetailResultDTO::getPlacePatrolTeamId).collect(Collectors.toList()); + teamIds = teamIds.stream().distinct().collect(Collectors.toList()); + List teamDTOList = icPlacePatrolTeamStaffDao.selectByTeamIds(teamIds); + + //3.封装各分队人员数据 + for (PlacePatrolReviewRecordDetailResultDTO dto : result.getList()) { + //分队成员 + StringBuffer inspectorsNames = new StringBuffer(); + for (String str : dto.getInspectors().split(",")) { + teamDTOList.forEach(r -> { + if (str.equals(r.getId())) { + inspectorsNames.append("".equals(inspectorsNames.toString().trim()) ? r.getName() : "," + r.getName()); + } + }); + } + dto.setInspectorsNames(inspectorsNames.toString()); + } + + resultDTO.setList(result.getList()); + return resultDTO; + } + + /** + * @Author sun + * @Description 删除巡查记录对应的复查记录 + **/ + @Override + public int delByPatrolRecordId(String staffId, String placePatrolRecordId) { + return baseDao.delByPatrolRecordId(staffId, placePatrolRecordId); + } +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolTeamServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolTeamServiceImpl.java new file mode 100644 index 0000000000..afc354b9b2 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolTeamServiceImpl.java @@ -0,0 +1,275 @@ +/** + * 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.service.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.dto.result.OptionResultDTO; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dao.CustomerGridDao; +import com.epmet.dao.IcPlacePatrolTeamDao; +import com.epmet.dto.CustomerGridDTO; +import com.epmet.dto.form.AddPlacePatrolTeamFormDTO; +import com.epmet.dto.form.EditPlacePatrolTeamFormDTO; +import com.epmet.dto.form.GetListPlacePatrolTeamFormDTO; +import com.epmet.dto.result.GetListPlacePatrolTeamResultDTO; +import com.epmet.dto.result.PlacePatrolTeamDetailResultDTO; +import com.epmet.entity.IcPlacePatrolTeamEntity; +import com.epmet.entity.IcPlacePatrolTeamStaffEntity; +import com.epmet.feign.EpmetAdminOpenFeignClient; +import com.epmet.service.IcPlacePatrolTeamService; +import com.epmet.service.IcPlacePatrolTeamStaffService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +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 org.springframework.util.CollectionUtils; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 场所分队管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Service +public class IcPlacePatrolTeamServiceImpl extends BaseServiceImpl implements IcPlacePatrolTeamService { + private static final Logger log = LoggerFactory.getLogger(IcPlacePatrolTeamServiceImpl.class); + @Autowired + private EpmetAdminOpenFeignClient epmetAdminOpenFeignClient; + @Autowired + private IcPlacePatrolTeamStaffService placePatrolTeamStaffService; + @Autowired + private CustomerGridDao customerGridDao; + + /** + * @Author sun + * @Description 新增九小场所巡查分队人员管理 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public void add(AddPlacePatrolTeamFormDTO formDTO) { + //检验分队下添加的人员手机号唯一 + Map map = new HashMap<>(); + formDTO.getMemberList().forEach(m -> { + if(map.containsKey(m.getMobile())){ + throw new RenException(String.format("新增巡查人员管理失败,分队下人员手机号重复,重复手机号->%s", m.getMobile())); + } + map.put(m.getMobile(),m.getName()); + }); + //1.分队主表新增数据 + IcPlacePatrolTeamEntity entity = ConvertUtils.sourceToTarget(formDTO, IcPlacePatrolTeamEntity.class); + CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); + entity.setAgencyId(staffInfoCache.getAgencyId()); + entity.setPids(staffInfoCache.getAgencyPIds()); + insert(entity); + //2.分队成员表新增数据 + List entityList = new ArrayList<>(); + formDTO.getMemberList().forEach(m -> { + IcPlacePatrolTeamStaffEntity entity1 = new IcPlacePatrolTeamStaffEntity(); + entity1.setCustomerId(formDTO.getCustomerId()); + entity1.setPlacePatrolTeamId(entity.getId()); + entity1.setName(m.getName()); + entity1.setMobile(m.getMobile()); + entityList.add(entity1); + }); + placePatrolTeamStaffService.insertBatch(entityList); + + } + + /** + * @Author sun + * @Description 修改九小场所巡查分队人员管理数据 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public void edit(EditPlacePatrolTeamFormDTO formDTO) { + //检验分队下添加的人员手机号唯一 + Map map = new HashMap<>(); + formDTO.getMemberList().forEach(m -> { + if(map.containsKey(m.getMobile())){ + throw new RenException(String.format("修改巡查人员管理失败,分队下人员手机号重复,重复手机号->%s", m.getMobile())); + } + map.put(m.getMobile(),m.getName()); + }); + //1.修改分队主表信息 + IcPlacePatrolTeamEntity entity = baseDao.selectById(formDTO.getTeamId()); + if (null == entity) { + throw new RenException(String.format("修改九小场所下巡查分队人员信息失败,分队信息不存在,分队Id->%s", formDTO.getTeamId())); + } + entity = ConvertUtils.sourceToTarget(formDTO, IcPlacePatrolTeamEntity.class); + entity.setId(formDTO.getTeamId()); + baseDao.updateById(entity); + //2.全删全增分队成员字表数据 + List entityList = new ArrayList<>(); + for (EditPlacePatrolTeamFormDTO.Member m : formDTO.getMemberList()) { + IcPlacePatrolTeamStaffEntity entity1 = new IcPlacePatrolTeamStaffEntity(); + entity1.setCustomerId(entity.getCustomerId()); + entity1.setPlacePatrolTeamId(entity.getId()); + entity1.setName(m.getName()); + entity1.setMobile(m.getMobile()); + entityList.add(entity1); + } + //物理删除 + placePatrolTeamStaffService.delByTeamId(formDTO.getTeamId()); + placePatrolTeamStaffService.insertBatch(entityList); + + } + + /** + * @Author sun + * @Description 删除九小场所巡查分队人员管理数据 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public void del(String staffId, String teamId) { + //1.删除分队主表数据 + if (baseDao.deleteById(teamId) < NumConstant.ONE) { + throw new RenException(String.format("删除九小场所下分队信息失败,分队Id->%s", teamId)); + } + //2.逻辑删除分队成员字表数据 + placePatrolTeamStaffService.upByTeamId(staffId, teamId); + } + + /** + * @Author sun + * @Description 九小场所巡查分队人员管理详情 + **/ + @Override + public PlacePatrolTeamDetailResultDTO detail(String teamId) { + PlacePatrolTeamDetailResultDTO resultDTO = new PlacePatrolTeamDetailResultDTO(); + //1.查询场所基础信息 + GetListPlacePatrolTeamFormDTO dto = new GetListPlacePatrolTeamFormDTO(); + dto.setTeamId(teamId); + List result = baseDao.getList(dto); + if (CollectionUtils.isEmpty(result)) { + return resultDTO; + } + resultDTO = result.get(0); + + //2.查询网格信息 + List gridIds = new ArrayList<>(); + for (String str : resultDTO.getGridIds().split(",")) { + gridIds.add(str); + } + gridIds = gridIds.stream().distinct().collect(Collectors.toList()); + List gridList = customerGridDao.selectGridListByIds(gridIds); + + //3.查询九小场所信息 + Result> nineList = epmetAdminOpenFeignClient.getNineSmallPlacesOption(); + if (!nineList.success()) { + throw new RenException("获取九小场所基本信息失败......"); + } + + //4.分别封装网格。九小场所数据 + //网格 + StringBuffer gridNames = new StringBuffer(); + for (String str : resultDTO.getGridIds().split(",")) { + gridList.forEach(r -> { + if (str.equals(r.getId())) { + gridNames.append("".equals(gridNames.toString().trim()) ? r.getGridName() : "," + r.getGridName()); + } + }); + } + resultDTO.setGridNames(gridNames.toString()); + //九小场所 + StringBuffer ninePlaceNames = new StringBuffer(); + for (String str : resultDTO.getNinePlaceVals().split(",")) { + nineList.getData().forEach(r -> { + if (str.equals(r.getValue())) { + ninePlaceNames.append("".equals(ninePlaceNames.toString().trim()) ? r.getLabel() : "," + r.getLabel()); + } + }); + } + resultDTO.setNinePlaceNames(ninePlaceNames.toString()); + + return resultDTO; + } + + /** + * @Author sun + * @Description 九小场所巡查分队人员管理列表查询 + **/ + @Override + public GetListPlacePatrolTeamResultDTO getList(GetListPlacePatrolTeamFormDTO formDTO) { + GetListPlacePatrolTeamResultDTO resultDTO = new GetListPlacePatrolTeamResultDTO(); + CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); + formDTO.setPids(staffInfoCache.getAgencyPIds()); + //1.根据条件查询分队及成员数据 + PageInfo result = + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()).doSelectPageInfo(() -> baseDao.getList(formDTO)); + if (CollectionUtils.isEmpty(result.getList())) { + return resultDTO; + } + resultDTO.setTotal((int) result.getTotal()); + + //2.查询网格信息 + List gridIds = new ArrayList<>(); + for (PlacePatrolTeamDetailResultDTO dto : result.getList()) { + for (String str : dto.getGridIds().split(",")) { + gridIds.add(str); + } + } + gridIds = gridIds.stream().distinct().collect(Collectors.toList()); + List gridList = customerGridDao.selectGridListByIds(gridIds); + + //3.查询九小场所信息 + Result> nineList = epmetAdminOpenFeignClient.getNineSmallPlacesOption(); + if (!nineList.success()) { + throw new RenException("获取九小场所基本信息失败......"); + } + + //4.封装网格、九小场所数据 + for (PlacePatrolTeamDetailResultDTO dto : result.getList()) { + StringBuffer gridNames = new StringBuffer(); + for (String str : dto.getGridIds().split(",")) { + gridList.forEach(r -> { + if (str.equals(r.getId())) { + gridNames.append("".equals(gridNames.toString().trim()) ? r.getGridName() : "," + r.getGridName()); + } + }); + } + dto.setGridNames(gridNames.toString()); + StringBuffer ninePlaceNames = new StringBuffer(); + for (String str : dto.getNinePlaceVals().split(",")) { + nineList.getData().forEach(r -> { + if (str.equals(r.getValue())) { + ninePlaceNames.append("".equals(ninePlaceNames.toString().trim()) ? r.getLabel() : "," + r.getLabel()); + } + }); + } + dto.setNinePlaceNames(ninePlaceNames.toString()); + } + + resultDTO.setList(result.getList()); + return resultDTO; + } + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolTeamStaffServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolTeamStaffServiceImpl.java new file mode 100644 index 0000000000..8f26db929e --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolTeamStaffServiceImpl.java @@ -0,0 +1,69 @@ +/** + * 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.service.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.dao.IcPlacePatrolTeamStaffDao; +import com.epmet.dto.IcPlacePatrolTeamStaffDTO; +import com.epmet.dto.form.GetListPlacePatrolTeamFormDTO; +import com.epmet.dto.result.GetListPlacePatrolTeamResultDTO; +import com.epmet.entity.IcPlacePatrolTeamStaffEntity; +import com.epmet.service.IcPlacePatrolTeamStaffService; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 场所分队下人员管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-18 + */ +@Service +public class IcPlacePatrolTeamStaffServiceImpl extends BaseServiceImpl implements IcPlacePatrolTeamStaffService { + + + + /** + * @Author sun + * @Description 删除分队下成员信息 + **/ + @Override + public int delByTeamId(String teamId) { + return baseDao.delByTeamId(teamId); + } + + /** + * @Author sun + * @Description 查询分队下人员列表数据 + **/ + @Override + public List getList(String teamId) { + return baseDao.getByTeamId(teamId); + } + + /** + * @Author sun + * @Description 逻辑删除分队成员子表数据 + **/ + @Override + public void upByTeamId(String staffId, String teamId) { + baseDao.upByTeamId(staffId, teamId); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPropertyManagementServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPropertyManagementServiceImpl.java new file mode 100644 index 0000000000..4296911e8d --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPropertyManagementServiceImpl.java @@ -0,0 +1,100 @@ +/** + * 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.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.IcPropertyManagementDao; +import com.epmet.dto.IcPropertyManagementDTO; +import com.epmet.entity.IcPropertyManagementEntity; +import com.epmet.service.IcPropertyManagementService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 物业表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +@Service +public class IcPropertyManagementServiceImpl extends BaseServiceImpl implements IcPropertyManagementService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcPropertyManagementDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcPropertyManagementDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcPropertyManagementDTO get(String id) { + IcPropertyManagementEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcPropertyManagementDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcPropertyManagementDTO dto) { + IcPropertyManagementEntity entity = ConvertUtils.sourceToTarget(dto, IcPropertyManagementEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcPropertyManagementDTO dto) { + IcPropertyManagementEntity entity = ConvertUtils.sourceToTarget(dto, IcPropertyManagementEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/NeighborHoodServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/NeighborHoodServiceImpl.java new file mode 100644 index 0000000000..dd5e742342 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/NeighborHoodServiceImpl.java @@ -0,0 +1,371 @@ +package com.epmet.service.impl; + +import cn.afterturn.easypoi.excel.entity.TemplateExportParams; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.enums.OrgTypeEnum; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.constant.NeighborhoodConstant; +import com.epmet.dao.*; +import com.epmet.dto.CustomerAgencyDTO; +import com.epmet.dto.IcNeighborHoodDTO; +import com.epmet.dto.IcNeighborHoodPropertyDTO; +import com.epmet.dto.form.IcNeighborHoodFormDTO; +import com.epmet.dto.form.ListIcNeighborHoodFormDTO; +import com.epmet.dto.result.IcNeighborHoodResultDTO; +import com.epmet.entity.*; +import com.epmet.excel.IcNeighborHoodExcel; +import com.epmet.feign.GovOrgOpenFeignClient; +import com.epmet.service.IcNeighborHoodPropertyService; +import com.epmet.service.IcNeighborHoodService; +import com.epmet.service.NeighborHoodService; +import com.epmet.util.ExcelPoiUtils; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; +import org.springframework.util.StringUtils; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import java.util.*; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.function.Function; +import java.util.stream.Collectors; + +@Slf4j +@Service +public class NeighborHoodServiceImpl implements NeighborHoodService { + + @Autowired + private GovOrgOpenFeignClient govOrgOpenFeignClient; + + + @Autowired + private IcNeighborHoodService icNeighborHoodService; + + @Autowired + private IcNeighborHoodPropertyService icNeighborHoodPropertyService; + + @Resource + private IcNeighborHoodPropertyDao icNeighborHoodPropertyDao; + + @Resource + private IcNeighborHoodDao icNeighborHoodDao; + @Resource + private IcBuildingDao icBuildingDao; + @Resource + private IcHouseDao icHouseDao; + @Resource + private CustomerAgencyDao customerAgencyDao; + @Resource + private CustomerGridDao customerGridDao; + @Resource + private IcPropertyManagementDao icPropertyManagementDao; + + @Override + @Transactional(rollbackFor = Exception.class) + public void AddNeighborhood(String customerId, IcNeighborHoodFormDTO formDTO) { + //同一客户下,小区名称唯一 + Integer count = icNeighborHoodDao.checkNameUq(customerId,formDTO.getNeighborHoodName(),null); + if (null != count && count > 0) { + throw new RenException(EpmetErrorCode.NEIGHBOOR_NAME_EXITED.getCode(), EpmetErrorCode.NEIGHBOOR_NAME_EXITED.getMsg()); + } + IcNeighborHoodDTO icNeighborHoodDTO = ConvertUtils.sourceToTarget(formDTO, IcNeighborHoodDTO.class); + icNeighborHoodDTO.setCustomerId(customerId); + Result customerAgencyResult = govOrgOpenFeignClient.getAgencyById(icNeighborHoodDTO.getAgencyId()); +// customerAgency.getData().get + if (!customerAgencyResult.success()) { + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } + CustomerAgencyDTO customerAgencyDTO = Optional.ofNullable(customerAgencyResult.getData()).orElse(new CustomerAgencyDTO()); + icNeighborHoodDTO.setParentAgencyId(customerAgencyDTO.getPid()); + icNeighborHoodDTO.setAgencyPids(customerAgencyDTO.getPids()); + IcNeighborHoodEntity entity = ConvertUtils.sourceToTarget(icNeighborHoodDTO, IcNeighborHoodEntity.class); +// icNeighborHoodService.save(icNeighborHoodDTO); + icNeighborHoodDao.insert(entity); + //设置物业关联 + String propertyId = formDTO.getPropertyId(); + if(!StringUtils.isEmpty(propertyId)){ + //保存物业关系表 + IcNeighborHoodPropertyDTO icNeighborHoodPropertyDTO = new IcNeighborHoodPropertyDTO(); + icNeighborHoodPropertyDTO.setNeighborHoodId(entity.getId()); + icNeighborHoodPropertyDTO.setPropertyId(propertyId); + icNeighborHoodPropertyService.save(icNeighborHoodPropertyDTO); + } + } + + /** + * 查询 + * @param formDTO + */ + @Override + public IcNeighborHoodResultDTO listNeighborhood(ListIcNeighborHoodFormDTO formDTO) { + String level = formDTO.getLevel(); + Integer pageNo = formDTO.getPageNo(); + Integer pageSize = formDTO.getPageSize(); + + + + IcNeighborHoodResultDTO result = new IcNeighborHoodResultDTO(); + + IPage> resultMap = searchNeighborhood(formDTO); + result.setTotal(Long.valueOf(resultMap.getTotal()).intValue()); + result.setList(resultMap.getRecords()); + + return result; + + } + + + + + + + private IPage> searchNeighborhood(ListIcNeighborHoodFormDTO formDTO) { + + IPage page = new Page(formDTO.getPageNo(),formDTO.getPageSize()); + +// QueryWrapper neighborHoodEntityQueryWrapper = new QueryWrapper<>(); +// neighborHoodEntityQueryWrapper.lambda() +// .eq(!StringUtils.isEmpty(formDTO.getAgencyId()),IcNeighborHoodEntity::getAgencyId,formDTO.getAgencyId()) +// .eq(!StringUtils.isEmpty(formDTO.getGridId()),IcNeighborHoodEntity::getId,formDTO.getGridId()) +// .eq(!StringUtils.isEmpty(formDTO.getNeighborHoodId()),IcNeighborHoodEntity::getId,formDTO.getNeighborHoodId()) +// .like(!StringUtils.isEmpty(formDTO.getNeighborHoodName()),IcNeighborHoodEntity::getNeighborHoodName,formDTO.getNeighborHoodName()); +// neighborHoodEntityQueryWrapper.eq("a.DEL_FLAG","0"); + + IcNeighborHoodEntity neighbor = ConvertUtils.sourceToTarget(formDTO, IcNeighborHoodEntity.class); + IcHouseEntity house = ConvertUtils.sourceToTarget(formDTO, IcHouseEntity.class); + neighbor.setDelFlag("0"); + if(NeighborhoodConstant.GRID.equals(formDTO.getLevel())){ + //根据网格过滤 + neighbor.setGridId(formDTO.getId()); + }else{ + //根据组织过滤 + neighbor.setAgencyId(formDTO.getId()); + } + return icNeighborHoodDao.searchNeighborhoodByPage(page, neighbor,house); + } + + /** + * 更新 + * @param customerId + * @param formDTO + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void UpdateNeighborhood(String customerId, IcNeighborHoodFormDTO formDTO) { + //同一客户下,小区名称唯一 + Integer count = icNeighborHoodDao.checkNameUq(customerId,formDTO.getNeighborHoodName(),formDTO.getNeighborHoodId()); + if (null != count && count > 0) { + throw new RenException(EpmetErrorCode.NEIGHBOOR_NAME_EXITED.getCode(), EpmetErrorCode.NEIGHBOOR_NAME_EXITED.getMsg()); + } + + IcNeighborHoodDTO icNeighborHoodDTO = ConvertUtils.sourceToTarget(formDTO, IcNeighborHoodDTO.class); + icNeighborHoodDTO.setId(formDTO.getNeighborHoodId()); + icNeighborHoodDTO.setCustomerId(customerId); + + Result customerAgencyResult = govOrgOpenFeignClient.getAgencyById(icNeighborHoodDTO.getAgencyId()); +// customerAgency.getData().get + if (!customerAgencyResult.success()) { + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } + CustomerAgencyDTO customerAgencyDTO = Optional.ofNullable(customerAgencyResult.getData()).orElse(new CustomerAgencyDTO()); + icNeighborHoodDTO.setParentAgencyId(customerAgencyDTO.getPid()); + icNeighborHoodDTO.setAgencyPids(customerAgencyDTO.getPids()); + icNeighborHoodService.update(icNeighborHoodDTO); + + //设置物业关联 + String propertyId = formDTO.getPropertyId(); + String neighborHoodId = icNeighborHoodDTO.getId(); + if(!StringUtils.isEmpty(propertyId)){ + //更新物业关系表 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(IcNeighborHoodPropertyEntity::getNeighborHoodId,neighborHoodId); + IcNeighborHoodPropertyEntity icNeighborHoodProperty = icNeighborHoodPropertyDao.selectOne(queryWrapper); + icNeighborHoodProperty = Optional.ofNullable(icNeighborHoodProperty).orElse(new IcNeighborHoodPropertyEntity()); + icNeighborHoodProperty.setNeighborHoodId(neighborHoodId); + icNeighborHoodProperty.setPropertyId(propertyId); + if(StringUtils.isEmpty(icNeighborHoodProperty.getId())){ + //插入 + icNeighborHoodPropertyService.insert(icNeighborHoodProperty); + }else{ + //更新 + icNeighborHoodPropertyService.updateById(icNeighborHoodProperty); + } + + + } + } + + /** + * 删除 + * @param neighborHoodId + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void DelNeighborhood(String neighborHoodId) { + //删除小区 + icNeighborHoodService.deleteById(neighborHoodId); + //删除小区物业关联 + Map columnMap = new HashMap<>(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(IcNeighborHoodPropertyEntity::getNeighborHoodId,neighborHoodId); + icNeighborHoodPropertyDao.delete(queryWrapper); + + } + + /** + * 导出数据 + * @param formDTO + * @param response + */ + @Override + public void exportNeighborhoodinfo(ListIcNeighborHoodFormDTO formDTO, HttpServletResponse response) throws Exception { + //导出小区 + List icNeighborHoodExcels = searchAllNeighborhood(formDTO); +// ExcelUtils.exportExcelToTarget(response, "小区信息录入表", icNeighborHoodExcels, IcNeighborHoodExcel.class); + + TemplateExportParams templatePath = new TemplateExportParams("excel/neighbor_export.xlsx"); + Map map = new HashMap<>(); + map.put("maplist",icNeighborHoodExcels); + ExcelPoiUtils.exportExcel(templatePath ,map,"小区信息录入表",response); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public List importExcel(String customerId,List list,String staffId, List numList) { + //2021.11.9 需求变更 当前工作人员只能导致自己所属组织下数据,网格名对应不上的数据舍弃【注:需求就这样】 sun + CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(customerId, staffId); + //查询当前组织下网格列表 + List customerGridList = customerGridDao.selectByPid(staffInfoCache.getAgencyId()); + //组织名称不一样的数据舍弃 + Iterator iterator = list.iterator(); + while (iterator.hasNext()) { + IcNeighborHoodExcel obj = iterator.next(); + if (!obj.getAgencyName().trim().equals(staffInfoCache.getAgencyName())) { + numList.add(obj.getRowNum()); + iterator.remove(); + continue; + } + //当前组织下网格名不存在的也不允许导入 + AtomicBoolean br = new AtomicBoolean(true); + customerGridList.forEach(g->{ + if(obj.getGridName().trim().equals(g.getGridName())){ + br.set(false); + } + }); + if(br.get()){ + numList.add(obj.getRowNum()); + iterator.remove(); + } + + } + //end sun + + //导入 + if(CollectionUtils.isEmpty(list)){ + return numList; + } + //获取所有组织 list + List agencyNameList = list.stream().map(item -> item.getAgencyName()).collect(Collectors.toList()); + agencyNameList = agencyNameList.stream().distinct().collect(Collectors.toList()); + //获取所有网格 list + //List gridNameList = list.stream().map(item->item.getGridName()).collect(Collectors.toList()); + //获取所有物业 list + List propertyNameList = list.stream().map(item->item.getPropertyName()).collect(Collectors.toList()); + propertyNameList = propertyNameList.stream().distinct().collect(Collectors.toList()); + //查询对应的id + List customerAgencyList = customerAgencyDao.selectList(new QueryWrapper().lambda().in(CustomerAgencyEntity::getOrganizationName, agencyNameList)); + //List customerGridList = customerGridDao.selectList(new QueryWrapper().lambda().in(CustomerGridEntity::getGridName, gridNameList)); + List icPropertyManagementList = icPropertyManagementDao.selectList(new QueryWrapper().lambda().in(IcPropertyManagementEntity::getName, propertyNameList)); + + Map agencyMap = customerAgencyList.stream().collect(Collectors.toMap(CustomerAgencyEntity::getOrganizationName, Function.identity(),(key1, key2)->key1)); + Map gridMap = customerGridList.stream().collect(Collectors.toMap(CustomerGridEntity::getGridName,Function.identity(),(key1,key2)->key1)); + Map propertyMap = icPropertyManagementList.stream().collect(Collectors.toMap(IcPropertyManagementEntity::getName,Function.identity(),(key1,key2)->key1)); + + //封装数据 + List neighborHoodEntityList = new ArrayList<>(); + List icNeighborHoodPropertyEntityList = new ArrayList<>(); + Iterator iterator1 = list.iterator(); + while (iterator1.hasNext()) { + IcNeighborHoodExcel icNeighborHoodExcel = iterator1.next(); + //同一客户下,小区名称唯一 + Integer count = icNeighborHoodDao.checkNameUq(customerId,icNeighborHoodExcel.getNeighborHoodName(),null); + if (null != count && count > 0) { + //throw new RenException(EpmetErrorCode.NEIGHBOOR_NAME_EXITED.getCode(), icNeighborHoodExcel.getNeighborHoodName()+EpmetErrorCode.NEIGHBOOR_NAME_EXITED.getMsg()); + log.error(icNeighborHoodExcel.getNeighborHoodName()+EpmetErrorCode.NEIGHBOOR_NAME_EXITED.getMsg()); + numList.add(icNeighborHoodExcel.getRowNum()); + iterator1.remove(); + continue; + } + + IcNeighborHoodEntity entity = new IcNeighborHoodEntity(); + String uuid =UUID.randomUUID().toString().replace("-", ""); + entity.setId(uuid); + entity.setCustomerId(customerId); + entity.setNeighborHoodName(icNeighborHoodExcel.getNeighborHoodName()); + + entity.setAgencyId(Optional.ofNullable(agencyMap.get(icNeighborHoodExcel.getAgencyName().trim())).map(u->u.getId()).orElse("")); // agencyMap.get(icNeighborHoodExcel.getAgencyName()).getId()); + entity.setParentAgencyId(Optional.ofNullable(agencyMap.get(icNeighborHoodExcel.getAgencyName().trim())).map(u->u.getPid()).orElse(""));//agencyMap.get(icNeighborHoodExcel.getAgencyName()).getPid() + entity.setAgencyPids(Optional.ofNullable(agencyMap.get(icNeighborHoodExcel.getAgencyName().trim())).map(u->u.getPids()).orElse(""));//agencyMap.get(icNeighborHoodExcel.getAgencyName()).getPids() + entity.setGridId(Optional.ofNullable(gridMap.get(icNeighborHoodExcel.getGridName().trim())).map(u->u.getId()).orElse(""));//gridMap.get(icNeighborHoodExcel.getGridName()).getId() + //网格名对应不上的数据舍弃 + if ("".equals(entity.getGridId())) { + numList.add(icNeighborHoodExcel.getRowNum()); + iterator1.remove(); + continue; + } + entity.setAddress(icNeighborHoodExcel.getAddress()); + entity.setRemark(icNeighborHoodExcel.getRemark()); + neighborHoodEntityList.add(entity); + + IcNeighborHoodPropertyEntity entity1 = new IcNeighborHoodPropertyEntity(); + + entity1.setPropertyId(Optional.ofNullable(propertyMap.get(icNeighborHoodExcel.getPropertyName())).map(u->u.getId()).orElse("")); + entity1.setNeighborHoodId(uuid); + icNeighborHoodPropertyEntityList.add(entity1); + } + +// icNeighborHoodDao. + //保存 + icNeighborHoodService.insertBatch(neighborHoodEntityList); + icNeighborHoodPropertyService.insertBatch(icNeighborHoodPropertyEntityList); + + return numList; + } + + + + private List searchAllNeighborhood(ListIcNeighborHoodFormDTO formDTO) { +// QueryWrapper neighborHoodEntityQueryWrapper = new QueryWrapper<>(); +// neighborHoodEntityQueryWrapper.lambda() +// .eq(!StringUtils.isEmpty(formDTO.getAgencyId()),IcNeighborHoodEntity::getAgencyId,formDTO.getAgencyId()) +// .eq(!StringUtils.isEmpty(formDTO.getGridId()),IcNeighborHoodEntity::getId,formDTO.getGridId()) +// .eq(!StringUtils.isEmpty(formDTO.getNeighborHoodId()),IcNeighborHoodEntity::getId,formDTO.getNeighborHoodId()) +// .like(!StringUtils.isEmpty(formDTO.getNeighborHoodName()),IcNeighborHoodEntity::getNeighborHoodName,formDTO.getNeighborHoodName()); +// neighborHoodEntityQueryWrapper.eq("a.DEL_FLAG","0"); + IcNeighborHoodEntity neighbor = ConvertUtils.sourceToTarget(formDTO, IcNeighborHoodEntity.class); + neighbor.setDelFlag("0"); + if(OrgTypeEnum.GRID.getCode().equals(formDTO.getLevel())){ + neighbor.setGridId(formDTO.getId()); + }else{ + neighbor.setAgencyId(formDTO.getId()); + } + IcHouseEntity house = ConvertUtils.sourceToTarget(formDTO, IcHouseEntity.class); + return icNeighborHoodDao.searchAllNeighborhood(neighbor,house); + } + + + + + + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/PropertyManagementServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/PropertyManagementServiceImpl.java new file mode 100644 index 0000000000..bfc46dd0b6 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/PropertyManagementServiceImpl.java @@ -0,0 +1,75 @@ +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.IcNeighborHoodPropertyDao; +import com.epmet.dao.IcPropertyManagementDao; +import com.epmet.dto.form.IcPropertyManagementFormDTO; +import com.epmet.dto.result.IcPropertyManagementResultDTO; +import com.epmet.entity.IcNeighborHoodPropertyEntity; +import com.epmet.entity.IcPropertyManagementEntity; +import com.epmet.service.PropertyManagementService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.List; + +@Slf4j +@Service +public class PropertyManagementServiceImpl implements PropertyManagementService { + + @Resource + private IcPropertyManagementDao icPropertyManagementDao; + @Resource + private IcNeighborHoodPropertyDao icNeighborHoodPropertyDao; + + @Override + public List getList() { + List propertyManagementEntityList = icPropertyManagementDao.selectList(null); + List list = new ArrayList<>(); + propertyManagementEntityList.forEach(item->{ + IcPropertyManagementResultDTO propertyManagementResultDTO = new IcPropertyManagementResultDTO(); + propertyManagementResultDTO.setPropertyId(item.getId()); + propertyManagementResultDTO.setPropertyName(item.getName()); + list.add(propertyManagementResultDTO); + }); + return list; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public String add(IcPropertyManagementFormDTO formDTO) { + //物业名字平台内唯一 + //如果输入的物业名字已经存在,直接返回物业id + formDTO.setName(formDTO.getName().trim()); + IcPropertyManagementEntity entity = icPropertyManagementDao.selectByName(formDTO.getName()); + if (null != entity) { + return entity.getId(); + } + IcPropertyManagementEntity icPropertyManagementEntity = ConvertUtils.sourceToTarget(formDTO, IcPropertyManagementEntity.class); + icPropertyManagementDao.insert(icPropertyManagementEntity); + return icPropertyManagementEntity.getId(); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcPropertyManagementFormDTO formDTO) { + IcPropertyManagementEntity icPropertyManagementEntity = ConvertUtils.sourceToTarget(formDTO, IcPropertyManagementEntity.class); + icPropertyManagementDao.updateById(icPropertyManagementEntity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(IcPropertyManagementFormDTO formDTO) { + List list = icNeighborHoodPropertyDao.selectList(new QueryWrapper().lambda().eq(IcNeighborHoodPropertyEntity::getPropertyId, formDTO.getId())); + if(!CollectionUtils.isEmpty(list)){ + throw new RenException("物业存在与小区关联,无法删除"); + } + icPropertyManagementDao.deleteById(formDTO.getId()); + } +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffTransferRecordServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffTransferRecordServiceImpl.java index 6ef500a018..62401ef4cc 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffTransferRecordServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffTransferRecordServiceImpl.java @@ -20,16 +20,14 @@ package com.epmet.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.dao.StaffTransferRecordDao; import com.epmet.dto.StaffTransferRecordDTO; import com.epmet.entity.StaffTransferRecordEntity; -import com.epmet.redis.StaffTransferRecordRedis; import com.epmet.service.StaffTransferRecordService; import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -46,9 +44,6 @@ import java.util.Map; @Service public class StaffTransferRecordServiceImpl extends BaseServiceImpl implements StaffTransferRecordService { - @Autowired - private StaffTransferRecordRedis staffTransferRecordRedis; - @Override public PageData page(Map params) { IPage page = baseDao.selectPage( @@ -101,4 +96,4 @@ public class StaffTransferRecordServiceImpl extends BaseServiceImpl> list, String fileName, HttpServletResponse response) throws IOException { + defaultExport(list, fileName, response); + } + + /** + * 默认的 excel 导出 + * + * @param list 数据列表 + * @param fileName 导出时的excel名称 + * @param response + */ + private static void defaultExport(List> list, String fileName, HttpServletResponse response) throws IOException { + //把数据添加到excel表格中 + Workbook workbook = ExcelExportUtil.exportExcel(list, ExcelType.HSSF); + downLoadExcel(fileName, response, workbook); + } + + /** + * excel 导出 + * + * @param list 数据列表 + * @param pojoClass pojo类型 + * @param fileName 导出时的excel名称 + * @param response + * @param exportParams 导出参数(标题、sheet名称、是否创建表头,表格类型) + */ + private static void defaultExport(List list, Class pojoClass, String fileName, HttpServletResponse response, ExportParams exportParams) throws IOException { + //把数据添加到excel表格中 + Workbook workbook = ExcelExportUtil.exportExcel(exportParams, pojoClass, list); + downLoadExcel(fileName, response, workbook); + } + + /** + * excel 导出 + * + * @param list 数据列表 + * @param pojoClass pojo类型 + * @param fileName 导出时的excel名称 + * @param exportParams 导出参数(标题、sheet名称、是否创建表头,表格类型) + * @param response + */ + public static void exportExcel(List list, Class pojoClass, String fileName, ExportParams exportParams, HttpServletResponse response) throws IOException { + defaultExport(list, pojoClass, fileName, response, exportParams); + } + + /** + * excel 导出 + * + * @param list 数据列表 + * @param title 表格内数据标题 + * @param sheetName sheet名称 + * @param pojoClass pojo类型 + * @param fileName 导出时的excel名称 + * @param response + */ + public static void exportExcel(List list, String title, String sheetName, Class pojoClass, String fileName, HttpServletResponse response) throws IOException { + defaultExport(list, pojoClass, fileName, response, new ExportParams(title, sheetName, ExcelType.XSSF)); + } + + + + /** + * excel 导出 + * + * @param list 数据列表 + * @param title 表格内数据标题 + * @param sheetName sheet名称 + * @param pojoClass pojo类型 + * @param fileName 导出时的excel名称 + * @param isCreateHeader 是否创建表头 + * @param response + */ + public static void exportExcel(List list, String title, String sheetName, Class pojoClass, String fileName, boolean isCreateHeader, HttpServletResponse response) throws IOException { + ExportParams exportParams = new ExportParams(title, sheetName, ExcelType.XSSF); + exportParams.setCreateHeadRows(isCreateHeader); + defaultExport(list, pojoClass, fileName, response, exportParams); + } + /** + * 根据模板生成excel后导出 + * @param templatePath 模板路径 + * @param map 数据集合 + * @param fileName 文件名 + * @param response + * @throws IOException + */ + public static void exportExcel(TemplateExportParams templatePath, Map map, String fileName, HttpServletResponse response) throws IOException { + Workbook workbook = ExcelExportUtil.exportExcel(templatePath, map); + downLoadExcel(fileName, response, workbook); + } + + + /** + * excel下载 + * + * @param fileName 下载时的文件名称 + * @param response + * @param workbook excel数据 + */ + private static void downLoadExcel(String fileName, HttpServletResponse response, Workbook workbook) throws IOException { + try { + response.setCharacterEncoding("UTF-8"); + response.setHeader("content-Type", "application/vnd.ms-excel"); + response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName + ".xlsx", "UTF-8")); + workbook.write(response.getOutputStream()); + } catch (Exception e) { + throw new IOException(e.getMessage()); + } + } + + + + /** + * excel 导入 + * + * @param file excel文件 + * @param pojoClass pojo类型 + * @param + * @return + */ + public static List importExcel(MultipartFile file, Class pojoClass) throws IOException { + return importExcel(file, 1, 1, pojoClass); + } + + /** + * excel 导入 + * + * @param filePath excel文件路径 + * @param titleRows 表格内数据标题行 + * @param headerRows 表头行 + * @param pojoClass pojo类型 + * @param + * @return + */ + public static List importExcel(String filePath, Integer titleRows, Integer headerRows, Class pojoClass) throws IOException { + if (StringUtils.isBlank(filePath)) { + return null; + } + ImportParams params = new ImportParams(); + params.setTitleRows(titleRows); + params.setHeadRows(headerRows); + params.setNeedSave(true); + params.setSaveUrl("/tmp/excel/"); + try { + return ExcelImportUtil.importExcel(new File(filePath), pojoClass, params); + } catch (NoSuchElementException e) { + throw new IOException("模板不能为空"); + } catch (Exception e) { + throw new IOException(e.getMessage()); + } + } + + + /** + * excel 导入 + * + * @param file 上传的文件 + * @param titleRows 表格内数据标题行 + * @param headerRows 表头行 + * @param pojoClass pojo类型 + * @param + * @return + */ + public static List importExcel(MultipartFile file, Integer titleRows, Integer headerRows, Class pojoClass) throws IOException { + if (file == null) { + return null; + } + try { + return importExcel(file.getInputStream(), titleRows, headerRows, pojoClass); + } catch (Exception e) { + throw new IOException(e.getMessage()); + } + } + + /** + * excel 导入 + * + * @param inputStream 文件输入流 + * @param titleRows 表格内数据标题行 + * @param headerRows 表头行 + * @param pojoClass pojo类型 + * @param + * @return + */ + public static List importExcel(InputStream inputStream, Integer titleRows, Integer headerRows, Class pojoClass) throws IOException { + if (inputStream == null) { + return null; + } + ImportParams params = new ImportParams(); + params.setTitleRows(titleRows); + params.setHeadRows(headerRows); + params.setSaveUrl("/tmp/excel/"); + params.setNeedSave(true); + try { + return ExcelImportUtil.importExcel(inputStream, pojoClass, params); + } catch (NoSuchElementException e) { + throw new IOException("excel文件不能为空"); + } catch (Exception e) { + throw new IOException(e.getMessage()); + } + } + /** + * excel 导入,有错误信息 + * + * @param file 上传的文件 + * @param pojoClass pojo类型 + * @param + * @return + */ + public static ExcelImportResult importExcelMore(MultipartFile file,Integer titleRows, Integer headerRows, Class pojoClass) throws IOException { + if (file == null) { + return null; + } + try { + return importExcelMore(file.getInputStream(), titleRows, headerRows, pojoClass); + } catch (Exception e) { + throw new IOException(e.getMessage()); + } + } + + /** + * excel 导入 + * + * @param inputStream 文件输入流 + * @param pojoClass pojo类型 + * @param + * @return + */ + private static ExcelImportResult importExcelMore(InputStream inputStream,Integer titleRows, Integer headerRows, Class pojoClass) throws IOException { + if (inputStream == null) { + return null; + } + ImportParams params = new ImportParams(); + params.setTitleRows(titleRows);//表格内数据标题行 + params.setHeadRows(headerRows);//表头行 + params.setSaveUrl("/tmp/excel/"); + params.setNeedSave(true); + params.setNeedVerify(true); + try { + return ExcelImportUtil.importExcelMore(inputStream, pojoClass, params); + } catch (NoSuchElementException e) { + throw new IOException("excel文件不能为空"); + } catch (Exception e) { + throw new IOException(e.getMessage()); + } + } +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/util/ExcelVerifyInfo.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/util/ExcelVerifyInfo.java new file mode 100644 index 0000000000..42be514c98 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/util/ExcelVerifyInfo.java @@ -0,0 +1,31 @@ +package com.epmet.util; + +import cn.afterturn.easypoi.handler.inter.IExcelDataModel; +import cn.afterturn.easypoi.handler.inter.IExcelModel; + +public class ExcelVerifyInfo implements IExcelModel, IExcelDataModel { + + private String errorMsg; + + private int rowNum; + + @Override + public Integer getRowNum() { + return rowNum; + } + + @Override + public void setRowNum(Integer rowNum) { + this.rowNum = rowNum; + } + + @Override + public String getErrorMsg() { + return errorMsg; + } + + @Override + public void setErrorMsg(String errorMsg) { + this.errorMsg = errorMsg; + } +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/bootstrap.yml b/epmet-module/gov-org/gov-org-server/src/main/resources/bootstrap.yml index dc1c51b285..ddd78b7407 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/bootstrap.yml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/bootstrap.yml @@ -109,6 +109,7 @@ mybatis-plus: call-setters-on-nulls: true jdbc-type-for-null: 'null' + feign: hystrix: enabled: true diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.8__add_coordinates.sql b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.8__add_coordinates.sql new file mode 100644 index 0000000000..51e687031c --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.8__add_coordinates.sql @@ -0,0 +1,4 @@ +alter table customer_agency add COLUMN LONGITUDE varchar(255) comment '经度' AFTER SYNC_FLAG; +alter table customer_agency add COLUMN LATITUDE varchar(255) comment '纬度' AFTER LONGITUDE; +alter table customer_agency add COLUMN COORDINATES text(0) comment '坐标区域' AFTER LATITUDE; +alter table customer_grid add COLUMN COORDINATES text(0) comment '坐标区域' AFTER LATITUDE; \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/excel/building_export.xlsx b/epmet-module/gov-org/gov-org-server/src/main/resources/excel/building_export.xlsx new file mode 100644 index 0000000000..226101af0a Binary files /dev/null and b/epmet-module/gov-org/gov-org-server/src/main/resources/excel/building_export.xlsx differ diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/excel/building_template.xlsx b/epmet-module/gov-org/gov-org-server/src/main/resources/excel/building_template.xlsx new file mode 100644 index 0000000000..cffd4abd69 Binary files /dev/null and b/epmet-module/gov-org/gov-org-server/src/main/resources/excel/building_template.xlsx differ diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/excel/house_export.xlsx b/epmet-module/gov-org/gov-org-server/src/main/resources/excel/house_export.xlsx new file mode 100644 index 0000000000..9460a651da Binary files /dev/null and b/epmet-module/gov-org/gov-org-server/src/main/resources/excel/house_export.xlsx differ diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/excel/house_template.xlsx b/epmet-module/gov-org/gov-org-server/src/main/resources/excel/house_template.xlsx new file mode 100644 index 0000000000..027f37bcad Binary files /dev/null and b/epmet-module/gov-org/gov-org-server/src/main/resources/excel/house_template.xlsx differ diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/excel/neighbor_export.xlsx b/epmet-module/gov-org/gov-org-server/src/main/resources/excel/neighbor_export.xlsx new file mode 100644 index 0000000000..2a1b3237d9 Binary files /dev/null and b/epmet-module/gov-org/gov-org-server/src/main/resources/excel/neighbor_export.xlsx differ diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/excel/neighbor_template.xlsx b/epmet-module/gov-org/gov-org-server/src/main/resources/excel/neighbor_template.xlsx new file mode 100644 index 0000000000..36297ea510 Binary files /dev/null and b/epmet-module/gov-org/gov-org-server/src/main/resources/excel/neighbor_template.xlsx differ diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/logback-spring.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/logback-spring.xml index 6c2d82a05b..24d44d88f9 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/logback-spring.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/logback-spring.xml @@ -128,14 +128,14 @@ 15 - + diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml index 89a5df87f4..eeca702112 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml @@ -24,6 +24,44 @@ ca.updated_time AS "updatedtime" + + + UPDATE + + customer_agency + + + customer_grid + + + ic_neighbor_hood + + SET + COORDINATES = #{coordinates}, + UPDATED_TIME = NOW() + WHERE ID = #{orgId} + AND DEL_FLAG = '0' + + + + + UPDATE + + customer_agency + + + customer_grid + + + ic_neighbor_hood + + SET + COORDINATES = NULL, + UPDATED_TIME = NOW() + WHERE ID = #{orgId} + AND DEL_FLAG = '0' + + SELECT - id AS "agencyId", - organization_name AS "agencyName", - pids AS "pids" - FROM customer_agency - WHERE del_flag = '0' - AND pids = #{subAgencyPids} - ORDER BY created_time DESC + ca.id AS "agencyId", + ca.organization_name AS "agencyName", + ca.pids AS "pids", + ca.level level, + ( CASE WHEN ca.longitude is null THEN + ( SELECT longitude FROM customer_agency + WHERE del_flag = '0' AND customer_id = (SELECT customer_id FROM customer_agency WHERE id = ca.id) + ORDER BY pid ASC LIMIT 1 + ) + ELSE ca.longitude + END + ) longitude, + ( CASE WHEN ca.latitude is null THEN + ( SELECT latitude FROM customer_agency + WHERE del_flag = '0' AND customer_id = (SELECT customer_id FROM customer_agency WHERE id = ca.id) + ORDER BY pid ASC LIMIT 1 + ) + ELSE ca.latitude + END + ) latitude + FROM customer_agency ca + WHERE ca.del_flag = '0' + AND ca.pids = #{subAgencyPids} + ORDER BY ca.created_time DESC SELECT - ca.id AS "agencyId", - ca.organization_name AS "agencyName", - ca.pids AS "pids" + ca.id agencyId, + ca.organization_name agencyName, + ca.pids pids, + ca.pid pid, + ca.level level, + ( CASE WHEN ca.longitude is null THEN + ( SELECT longitude FROM customer_agency + WHERE del_flag = '0' AND customer_id = (SELECT customer_id FROM customer_agency WHERE id = ca.id) + ORDER BY pid ASC LIMIT 1 + ) + ELSE ca.longitude + END + ) longitude, + ( CASE WHEN ca.latitude is null THEN + ( SELECT latitude FROM customer_agency + WHERE del_flag = '0' AND customer_id = (SELECT customer_id FROM customer_agency WHERE id = ca.id) + ORDER BY pid ASC LIMIT 1 + ) + ELSE ca.latitude + END + ) latitude FROM customer_agency ca INNER JOIN customer_staff_agency csa ON ca.id = csa.agency_id @@ -507,6 +633,7 @@ + @@ -519,7 +646,8 @@ select ID AS agencyId, ORGANIZATION_NAME AS agencyName, - PID + PID, + LEVEL from customer_agency where DEL_FLAG = 0 @@ -530,7 +658,8 @@ select ID AS agencyId, ORGANIZATION_NAME AS agencyName, - PID + PID, + LEVEL from customer_agency where @@ -539,4 +668,70 @@ AND CUSTOMER_ID = #{customerId} - \ No newline at end of file + + + + + + + + + diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml.rej b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml.rej new file mode 100644 index 0000000000..d0d35462b7 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml.rej @@ -0,0 +1,18 @@ +diff a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml (rejected hunks) +@@ -539,4 +539,15 @@ + AND CUSTOMER_ID = #{customerId} + + ++ ++ + +\ 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 0667d009c4..0ddf90f008 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 @@ -389,12 +389,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingDao.xml new file mode 100644 index 0000000000..a137f46b8b --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingDao.xml @@ -0,0 +1,336 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingUnitDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingUnitDao.xml new file mode 100644 index 0000000000..0ee38da368 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingUnitDao.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml new file mode 100644 index 0000000000..61aa971630 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml @@ -0,0 +1,281 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcMatterAppointmentRecordDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcMatterAppointmentRecordDao.xml new file mode 100644 index 0000000000..3b5f960894 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcMatterAppointmentRecordDao.xml @@ -0,0 +1,48 @@ + + + + + + + + UPDATE ic_matter_appointment_record + SET `STATUS` = 'cancel', + DEL_FLAG = 1, + UPDATED_BY = #{userId}, + UPDATED_TIME = NOW() + WHERE ID = #{recordId} + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml new file mode 100644 index 0000000000..ea950eb90b --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml @@ -0,0 +1,216 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodPartDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodPartDao.xml new file mode 100644 index 0000000000..8dd1ab5097 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodPartDao.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodPropertyDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodPropertyDao.xml new file mode 100644 index 0000000000..749861cc9a --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodPropertyDao.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPartyServiceCenterDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPartyServiceCenterDao.xml new file mode 100644 index 0000000000..b241afaf64 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPartyServiceCenterDao.xml @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPartyServiceCenterMatterDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPartyServiceCenterMatterDao.xml new file mode 100644 index 0000000000..d8bbd1ba95 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPartyServiceCenterMatterDao.xml @@ -0,0 +1,22 @@ + + + + + + + + DELETE FROM ic_party_service_center_matter + WHERE DEL_FLAG = 0 + AND PARTY_SERVICE_CENTER_ID = #{partyServiceCenterId} + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlaceOrgDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlaceOrgDao.xml new file mode 100644 index 0000000000..600a80ee7f --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlaceOrgDao.xml @@ -0,0 +1,49 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolRecordDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolRecordDao.xml new file mode 100644 index 0000000000..58fab01358 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolRecordDao.xml @@ -0,0 +1,59 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolReviewRecordDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolReviewRecordDao.xml new file mode 100644 index 0000000000..8b54d868e9 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolReviewRecordDao.xml @@ -0,0 +1,45 @@ + + + + + + + UPDATE + ic_place_patrol_review_record + SET + del_flag = '1', + updated_by = #{staffId}, + updated_time = NOW() + WHERE + place_patrol_record_id = #{placePatrolRecordId} + + + + + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolTeamDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolTeamDao.xml new file mode 100644 index 0000000000..3475fce30b --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolTeamDao.xml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolTeamStaffDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolTeamStaffDao.xml new file mode 100644 index 0000000000..06d8285f21 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolTeamStaffDao.xml @@ -0,0 +1,50 @@ + + + + + + + DELETE + FROM + ic_place_patrol_team_staff + WHERE + place_patrol_team_id = #{teamId} + + + + + + + + UPDATE + ic_place_patrol_team_staff + SET + del_flag = '1', + updated_by = #{staffId}, + updated_time = NOW() + WHERE + place_patrol_team_id = #{teamId} + + + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPropertyManagementDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPropertyManagementDao.xml new file mode 100644 index 0000000000..725fdf969f --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPropertyManagementDao.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/PageUserReportEventFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/PageUserReportEventFormDTO.java new file mode 100644 index 0000000000..0a7b966a62 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/PageUserReportEventFormDTO.java @@ -0,0 +1,23 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.List; + +/** + * 数据分析-个人档案-上报事件列表入参 + */ +@Data +public class PageUserReportEventFormDTO implements Serializable { + public interface AddUserInternalGroup { + } + //@NotBlank(message = "epmetUserId不能为空" , groups = AddUserInternalGroup.class) + private List epmetUserIdList; + @NotNull(message = "pageNo不能为空",groups = AddUserInternalGroup.class) + private Integer pageNo; + @NotNull(message = "pageSize不能为空",groups = AddUserInternalGroup.class) + private Integer pageSize; + +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectDistributionAnalysisFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectDistributionAnalysisFormDTO.java new file mode 100644 index 0000000000..d4413eb75f --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectDistributionAnalysisFormDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/12/7 9:55 上午 + * @DESC + */ +@Data +public class ProjectDistributionAnalysisFormDTO implements Serializable { + + private static final long serialVersionUID = 4911448213428751186L; + + public interface ProjectDistributionAnalysisForm{} + + @NotBlank(message = "startDate不能为空",groups = ProjectDistributionAnalysisForm.class) + private String startDate; + + @NotBlank(message = "endDate不能为空",groups = ProjectDistributionAnalysisForm.class) + private String endDate; + + private String orgId; + + private String orgType; + +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ResiEventDetailFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ResiEventDetailFormDTO.java new file mode 100644 index 0000000000..37049a3ef8 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ResiEventDetailFormDTO.java @@ -0,0 +1,18 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 数字赋能平台-个人档案-上报事件-事件详情 + */ +@Data +public class ResiEventDetailFormDTO implements Serializable { + private static final long serialVersionUID = 4449275163195979994L; + public interface AddUserInternalGroup { + } + @NotBlank(message = "resiEventId不能为空",groups =AddUserInternalGroup.class ) + private String resiEventId; +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ResiEventResearchAnalysisFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ResiEventResearchAnalysisFormDTO.java new file mode 100644 index 0000000000..26950059b5 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ResiEventResearchAnalysisFormDTO.java @@ -0,0 +1,50 @@ +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; +import java.util.List; + +/** + * 数据分析-个人档案-上报事件详情-研判分析,查看项目通分类+来源于当前上报人上报的所有事件 + * + */ +@Data +public class ResiEventResearchAnalysisFormDTO implements Serializable { + public interface AddUserInternalGroup { + } + + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + + /** + * 当前选中的事件id + */ + @NotBlank(message = "resiEventId不能为空",groups = AddUserInternalGroup.class) + private String resiEventId; + + /** + * 当前选中的事件转为的项目id + */ + @NotBlank(message = "projectId不能为空",groups = AddUserInternalGroup.class) + private String projectId; + + /** + * 个人档案的这个人 + */ + @NotBlank(message = "icResiUserId不能为空",groups = AddUserInternalGroup.class) + private String icResiUserId; + + /** + * 个人档案的这个人,对应小程序的人的用户id + */ + private List epmetUserIdList; + + + + + @NotBlank(message = "tokenDto中的customerId不能为空",groups = AddUserInternalGroup.class) + private String customerId; +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/TopicResearchAnalysisFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/TopicResearchAnalysisFormDTO.java new file mode 100644 index 0000000000..b3c2ffe827 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/TopicResearchAnalysisFormDTO.java @@ -0,0 +1,44 @@ +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; +import java.util.List; + + +/** + * 话题详情-研判分析 + */ +@Data +public class TopicResearchAnalysisFormDTO implements Serializable { + public interface AddUserInternalGroup { + } + + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + + /** + * 当前选中的事件转为的项目id + */ + @NotBlank(message = "projectId不能为空",groups = AddUserInternalGroup.class) + private String projectId; + + /** + * 个人档案的这个人 + */ + @NotBlank(message = "icResiUserId不能为空",groups = AddUserInternalGroup.class) + private String icResiUserId; + + /** + * 个人档案的这个人,对应小程序的人的用户id + */ + private List epmetUserIdList; + + + + + @NotBlank(message = "tokenDto中的customerId不能为空",groups = AddUserInternalGroup.class) + private String customerId; +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/CategoryListDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/CategoryListDTO.java new file mode 100644 index 0000000000..8003cdfd0b --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/CategoryListDTO.java @@ -0,0 +1,40 @@ +package com.epmet.dto.result; + +import com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/12/7 9:40 上午 + * @DESC + */ +@Data +public class CategoryListDTO implements Serializable { + + private static final long serialVersionUID = 2782140672250580404L; + + /** + * 分类编码 + */ + private String categoryCode; + + /** + * 分类名字 + */ + private String categoryName; + + private String color; + + /** + * 个数 + */ + private Integer count; + + public CategoryListDTO() { + this.categoryCode = ""; + this.categoryName = ""; + this.count = NumConstant.ZERO; + } +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/EventDetailResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/EventDetailResultDTO.java index 18295391c5..0b6bb8ccb2 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/EventDetailResultDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/EventDetailResultDTO.java @@ -11,7 +11,7 @@ import java.util.List; /** * @Author zxc * @DateTime 2021/8/3 1:30 下午 - * @DESC + * @DESC 两端通用时间详情接口+个人档案-数据分析-事件详情 */ @Data public class EventDetailResultDTO implements Serializable { @@ -87,10 +87,10 @@ public class EventDetailResultDTO implements Serializable { @JsonIgnore private List orgNameList; - @JsonIgnore + //@JsonIgnore private String projectId; - @JsonIgnore + //@JsonIgnore private Boolean isProject; public EventDetailResultDTO() { diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/HouseUserDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/HouseUserDTO.java new file mode 100644 index 0000000000..4ade8603df --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/HouseUserDTO.java @@ -0,0 +1,11 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class HouseUserDTO implements Serializable { + private String icResiUserId; + private String icUserName; +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/PageUserReportEventResDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/PageUserReportEventResDTO.java new file mode 100644 index 0000000000..d562132e12 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/PageUserReportEventResDTO.java @@ -0,0 +1,35 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 数据分析-个人档案-上报事件列表入参 + */ +@Data +public class PageUserReportEventResDTO implements Serializable { + private String resiEventId; + /** + * 事件内容 + */ + private String eventContent; + + /** + * 事件上报事件 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date reportTime; + + /** + * true 已转项目;false:未转项目 + */ + private Boolean shiftProject; + + /** + * 项目id + */ + private String projectId; +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectCategoryByDateDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectCategoryByDateDTO.java new file mode 100644 index 0000000000..b31ca841b5 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectCategoryByDateDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @Author zxc + * @DateTime 2021/12/7 11:18 上午 + * @DESC + */ +@Data +public class ProjectCategoryByDateDTO implements Serializable { + + private static final long serialVersionUID = -6620068264792270703L; + + /** + * 项目创建时间 + */ + private Date createdTime; + + /** + * 分类编码 + */ + private String categoryCode; +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectDataDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectDataDTO.java new file mode 100644 index 0000000000..0f4721dbec --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectDataDTO.java @@ -0,0 +1,16 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 数据分析-个人档案-上报事件详情-研判分析,查看项目通分类+来源于当前上报人上报的所有事件 + */ +@Data +public class ProjectDataDTO implements Serializable { + private String firstCategoryCode; + private String firstCategoryName; + private List projectList; +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectDistributionAnalysisLeftResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectDistributionAnalysisLeftResultDTO.java new file mode 100644 index 0000000000..0e991a98e0 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectDistributionAnalysisLeftResultDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2021/12/7 9:38 上午 + * @DESC + */ +@Data +public class ProjectDistributionAnalysisLeftResultDTO implements Serializable { + + private static final long serialVersionUID = -5694808164804517466L; + + /** + * 时间段 + */ + private String time; + + /** + * 分类集合 + */ + private List categoryList; +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectDistributionAnalysisRightDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectDistributionAnalysisRightDTO.java new file mode 100644 index 0000000000..d48a225007 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectDistributionAnalysisRightDTO.java @@ -0,0 +1,40 @@ +package com.epmet.dto.result; + +import com.epmet.commons.tools.constant.NumConstant; +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/12/8 10:14 上午 + * @DESC + */ +@Data +public class ProjectDistributionAnalysisRightDTO implements Serializable { + + private static final long serialVersionUID = 7233782006110358477L; + + /** + * 组织ID + */ + private String orgId; + + /** + * 组织类型,组织:agency,网格:grid + */ + @JsonIgnore + private String orgType; + + /** + * 热力值 + */ + private Integer count; + + public ProjectDistributionAnalysisRightDTO() { + this.orgId = ""; + this.orgType = ""; + this.count = NumConstant.ZERO; + } +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectDistributionAnalysisRightResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectDistributionAnalysisRightResultDTO.java new file mode 100644 index 0000000000..fb56a9f178 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectDistributionAnalysisRightResultDTO.java @@ -0,0 +1,36 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2021/12/8 10:11 上午 + * @DESC + */ +@Data +public class ProjectDistributionAnalysisRightResultDTO implements Serializable { + + private static final long serialVersionUID = 8359144215262197796L; + + /** + * ..以上 + */ + private Integer under; + + /** + * ..以下 + */ + private Integer above; + + private List list; + + public ProjectDistributionAnalysisRightResultDTO() { + this.under = null; + this.above = null; + this.list = new ArrayList<>(); + } +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectInfoIcData.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectInfoIcData.java new file mode 100644 index 0000000000..3129e6fccc --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectInfoIcData.java @@ -0,0 +1,23 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 数据分析-个人档案-上报事件详情-研判分析,查看项目通分类+来源于当前上报人上报的所有事件 + */ +@Data +public class ProjectInfoIcData implements Serializable { + private static final long serialVersionUID = -1937915930811634827L; + private String projectId; + private String projectTitle; + private String resiEventId; + private String projectStatus; + + /** + * 以下这两个参数是给话题详情-研判分析用的 + */ + private String issueId; + private String topicId; +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ResiEventResearchAnalysisResDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ResiEventResearchAnalysisResDTO.java new file mode 100644 index 0000000000..e432179589 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ResiEventResearchAnalysisResDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 数据分析-个人档案-上报事件详情-研判分析,查看项目通分类+来源于当前上报人上报的所有事件 + * + */ +@Data +public class ResiEventResearchAnalysisResDTO implements Serializable { + + /** + * 居民信息及家属列表 + */ + private String icResiUserId; + private String icUserName; + private String houseId; + private List houseUserList; + + + /** + * 入参中给的,再返回去 + */ + private List epmetUserIdList; + private List projectData; + +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/TopicResearchAnalysisResDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/TopicResearchAnalysisResDTO.java new file mode 100644 index 0000000000..37648617ed --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/TopicResearchAnalysisResDTO.java @@ -0,0 +1,23 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.util.List; + +@Data +public class TopicResearchAnalysisResDTO { + /** + * 居民信息及家属列表 + */ + private String icResiUserId; + private String icUserName; + private String houseId; + private List houseUserList; + + + /** + * 入参中给的,再返回去 + */ + private List epmetUserIdList; + private List projectData; +} diff --git a/epmet-module/gov-project/gov-project-server/deploy/docker-compose-prod.yml b/epmet-module/gov-project/gov-project-server/deploy/docker-compose-prod.yml index d472c2ac26..e7d2bcac22 100644 --- a/epmet-module/gov-project/gov-project-server/deploy/docker-compose-prod.yml +++ b/epmet-module/gov-project/gov-project-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-project-server: container_name: gov-project-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/gov-project-server:0.3.48 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/gov-project-server:0.3.83 ports: - "8102:8102" network_mode: host # 使用现有网络 @@ -15,4 +15,4 @@ services: resources: limits: cpus: '0.1' - memory: 600M \ No newline at end of file + memory: 600M diff --git a/epmet-module/gov-project/gov-project-server/pom.xml b/epmet-module/gov-project/gov-project-server/pom.xml index f49d89d16a..c04583b7d5 100644 --- a/epmet-module/gov-project/gov-project-server/pom.xml +++ b/epmet-module/gov-project/gov-project-server/pom.xml @@ -2,7 +2,7 @@ - 0.3.48 + 0.3.83 gov-project com.epmet @@ -287,7 +287,7 @@ false - false + true true https://epmet-open.elinkservice.cn/api/epmetscan/api diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/ProjectConstant.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/ProjectConstant.java index b5acf5b2e7..612debd512 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/ProjectConstant.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/ProjectConstant.java @@ -195,4 +195,8 @@ public interface ProjectConstant { String SORT_ASC = "asc"; String SORT_DESC = "desc"; + String ORG_TYPE_GRID = "grid"; + + String ORG_LEVEL_COMMUNITY = "community"; + } diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/CustomerProjectParameterController.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/CustomerProjectParameterController.java index de479f7344..5ff9b4428c 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/CustomerProjectParameterController.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/CustomerProjectParameterController.java @@ -37,7 +37,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; -import javax.validation.constraints.NotBlank; import java.util.List; import java.util.Map; @@ -154,6 +153,12 @@ public class CustomerProjectParameterController { return new Result(); } + /** + * @Description 保存项目第三方平台的配置 + * @return + * @author wxz + * @date 2021.03.19 17:10 + */ @PostMapping("save-thirdplatform-config") public Result saveThirdplatformConfig(@RequestBody ThirdPlatformConfigFormDTO input) { ValidatorUtils.validateEntity(input, ThirdPlatformConfigFormDTO.SaveThirdplatformConfig.class); diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectCategoryController.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectCategoryController.java index ff9417e6ca..9d86baccde 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectCategoryController.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectCategoryController.java @@ -18,8 +18,7 @@ package com.epmet.controller; import com.epmet.commons.tools.annotation.LoginUser; -import com.epmet.commons.tools.constant.NumConstant; -import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.aop.NoRepeatSubmit; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ExcelUtils; @@ -53,7 +52,7 @@ import java.util.Map; @RestController @RequestMapping("projectcategory") public class ProjectCategoryController { - + @Autowired private ProjectCategoryService projectCategoryService; @@ -118,6 +117,7 @@ public class ProjectCategoryController { * @Description 项目:保存/修改分类 * @Author sun **/ + @NoRepeatSubmit @PostMapping("save") public Result saveCategory(@LoginUser TokenDto tokenDto, @RequestBody ProjectSaveCategoryFormDTO formDTO) { formDTO.setCustomerId(tokenDto.getCustomerId()); @@ -136,4 +136,4 @@ public class ProjectCategoryController { return new Result>().ok(projectCategoryService.getProjectCategoryList(formDTO)); } -} \ No newline at end of file +} 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 46de571a19..070fc8bba0 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 @@ -17,7 +17,9 @@ package com.epmet.controller; +import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.AssertUtils; @@ -271,4 +273,43 @@ public class ProjectController { return new Result>().ok(projectService.getUnResolvedListByGrid(formDTO)); } + /** + * @Description 【社区治理】项目分布分析-左边 + * @param formDTO + * @param tokenDto + * @author zxc + * @date 2021/12/7 10:02 上午 + */ + @PostMapping("projectdistributionanalysisleft") + public Result> projectDistributionAnalysisLeft(@RequestBody ProjectDistributionAnalysisFormDTO formDTO, @LoginUser TokenDto tokenDto){ + ValidatorUtils.validateEntity(formDTO, ProjectDistributionAnalysisFormDTO.ProjectDistributionAnalysisForm.class); + return new Result>().ok(projectService.projectDistributionAnalysisLeft(formDTO,tokenDto)); + } + + /** + * @Description 【社区治理】项目分布分析-右边 + * @param formDTO + * @param tokenDto + * @author zxc + * @date 2021/12/8 10:21 上午 + */ + @PostMapping("projectdistributionanalysisright") + public Result projectDistributionAnalysisRight(@RequestBody ProjectDistributionAnalysisFormDTO formDTO, @LoginUser TokenDto tokenDto){ + ValidatorUtils.validateEntity(formDTO, ProjectDistributionAnalysisFormDTO.ProjectDistributionAnalysisForm.class); + return new Result().ok(projectService.projectDistributionAnalysisRight(formDTO,tokenDto)); + } + + /** + * 个人档案-话题详情-研判分析 + * 只看来源于议题的项目 + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping("topic-research-analysis") + public Result topicResearchAnalysis(@LoginUser TokenDto tokenDto,@RequestBody TopicResearchAnalysisFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + ValidatorUtils.validateEntity(formDTO,TopicResearchAnalysisFormDTO.AddUserInternalGroup.class); + return new Result().ok(projectService.topicResearchAnalysis(formDTO)); + } } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectTagsController.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectTagsController.java index 80fad9fab5..fc8efe3337 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectTagsController.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectTagsController.java @@ -18,15 +18,15 @@ package com.epmet.controller; import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.aop.NoRepeatSubmit; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.AssertUtils; import com.epmet.commons.tools.validator.ValidatorUtils; -import com.epmet.commons.tools.validator.group.AddGroup; -import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.ProjectTagsDTO; import com.epmet.dto.form.ProjectTagHookFormDTO; import com.epmet.excel.ProjectTagsExcel; @@ -48,7 +48,7 @@ import java.util.Map; @RestController @RequestMapping("projecttags") public class ProjectTagsController { - + @Autowired private ProjectTagsService projectTagsService; @@ -64,6 +64,15 @@ public class ProjectTagsController { return new Result().ok(data); } + /** + * @Description 保存项目与标签的关联并更新标签热度 + * @param dto + * @param token + * @return com.epmet.commons.tools.utils.Result + * @author wangc + * @date 2021.03.20 02:34 + */ + @NoRepeatSubmit @PostMapping("save") public Result save(@RequestBody ProjectTagHookFormDTO dto, @LoginUser TokenDto token){ dto.setCustomerId(token.getCustomerId()); @@ -96,4 +105,4 @@ public class ProjectTagsController { ExcelUtils.exportExcelToTarget(response, null, list, ProjectTagsExcel.class); } -} \ No newline at end of file +} diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ResiEventController.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ResiEventController.java index 1b69e0b039..ca48b13304 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ResiEventController.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ResiEventController.java @@ -18,6 +18,7 @@ package com.epmet.controller; import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; @@ -56,6 +57,18 @@ public class ResiEventController { return new Result().ok(resiEventService.eventDetail(formDTO, tokenDto)); } + /** + * 数字赋能平台-个人档案-事件详情 + * + * @param formDTO + * @return + */ + @PostMapping("eventdetail-icdata") + public Result eventDetailForIcData(@RequestBody ResiEventDetailFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO,ResiEventDetailFormDTO.AddUserInternalGroup.class); + return new Result().ok(resiEventService.eventDetailForIcData(formDTO)); + } + /** * 我要报事-提交(尹) * @@ -213,4 +226,32 @@ public class ResiEventController { Result queryResiEventManageRedDot(@PathVariable("agencyId") String agencyId) { return new Result().ok(resiEventService.queryResiEventManageRedDot(agencyId)); } + + /** + * 数据分析-个人档案-上报事件列表 + * 根据epmetUserIdList查询 + * @param formDTO + * @return com.epmet.commons.tools.utils.Result> + * @author yinzuomei + * @date 2021/8/3 14:27 + */ + @PostMapping("pageuserreported") + public Result> pageUserReported(@RequestBody PageUserReportEventFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, PageUserReportEventFormDTO.AddUserInternalGroup.class); + return new Result>().ok(resiEventService.pageUserReported(formDTO)); + } + + /** + * 数据分析-个人档案-上报事件列表-事件详情研判分析 + * 只看来源于需求上报的项目 + * + * @param formDTO + * @return + */ + @PostMapping("research-analysis") + public Result queryResiEventResearchAnalysis(@LoginUser TokenDto tokenDto,@RequestBody ResiEventResearchAnalysisFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + ValidatorUtils.validateEntity(formDTO,ResiEventResearchAnalysisFormDTO.AddUserInternalGroup.class); + return new Result().ok(resiEventService.queryResiEventResearchAnalysis(formDTO)); + } } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectCategoryDao.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectCategoryDao.java index cc2d336344..1127a7a099 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectCategoryDao.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectCategoryDao.java @@ -61,4 +61,11 @@ public interface ProjectCategoryDao extends BaseDao { * @date 2021/5/17 10:47 上午 */ List selectCategoryByIds(@Param("projectIds")List projectIds); + + /** + * + * @param projectId + * @return + */ + List selectListByProjectId(String projectId); } \ 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 0040584f81..d0d71cab98 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 @@ -217,4 +217,54 @@ public interface ProjectDao extends BaseDao { EventProjectInfoDTO selectEventProjectInfo(@Param("projectId")String projectId); List selectByOriginId(String originId); + + /** + * @Description 根据日期查询项目分类 + * @param startDate + * @param endDate + * @param codeLength 1级分类编码长度 + * @param orgId + * @author zxc + * @date 2021/12/8 1:37 下午 + */ + List selectProjectCategoryByDate(@Param("startDate")String startDate,@Param("endDate")String endDate, + @Param("orgId")String orgId,@Param("codeLength")Integer codeLength); + + /** + * 数据分析-个人档案-事件详情页面的研判分析项目列表 + * @param customerId + * @param categoryCode + * @param excludeProjectId + * @param epmetUserIds + * @return + */ + List selectCommonCategoryEventProject(@Param("customerId")String customerId, + @Param("categoryCode")String categoryCode, + @Param("excludeProjectId") String excludeProjectId, + @Param("epmetUserIds")List epmetUserIds); + + /** + * 数据分析-个人档案-话题详情页面的研判分析项目列表 + * + * @param customerId + * @param categoryCode + * @param excludeProjectId + * @param epmetUserIds + * @return + */ + List selectCommonCategoryIssueProject(@Param("customerId")String customerId, + @Param("categoryCode")String categoryCode, + @Param("excludeProjectId") String excludeProjectId, + @Param("epmetUserIds")List epmetUserIds); + + /** + * @Description 查询组织下的项目数 + * @param orgIds + * @param startDate + * @param endDate + * @author zxc + * @date 2021/12/10 10:31 上午 + */ + List selectProjectCountByOrg(@Param("orgIds")List orgIds,@Param("startDate")String startDate,@Param("endDate")String endDate); + } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ResiEventDao.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ResiEventDao.java index 6275a0d821..a39c72aa76 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ResiEventDao.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ResiEventDao.java @@ -18,10 +18,8 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.dto.result.EventDetailResultDTO; -import com.epmet.dto.result.EventListResultDTO; -import com.epmet.dto.result.MyReportedResultDTO; -import com.epmet.dto.result.NewEventsResultDTO; +import com.epmet.dto.form.PageUserReportEventFormDTO; +import com.epmet.dto.result.*; import com.epmet.entity.ResiEventEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -88,4 +86,13 @@ public interface ResiEventDao extends BaseDao { * @date 2021/8/5 10:42 上午 */ List newEvents(@Param("orgIds")List orgIds); + + /** + * 数据分析-个人档案-上报事件列表 + * 根据epmetUserIdList查询 + * + * @param formDTO + * @return + */ + List selectUserReported(PageUserReportEventFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/BlockChainUploadService.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/BlockChainUploadService.java new file mode 100644 index 0000000000..233f4d5feb --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/BlockChainUploadService.java @@ -0,0 +1,20 @@ +package com.epmet.service; + +import com.epmet.entity.ProjectEntity; +import com.epmet.entity.ProjectProcessEntity; +import com.epmet.entity.ProjectStaffEntity; + +import java.util.List; + +/** + * 上链service接口 + */ +public interface BlockChainUploadService { + + /** + * 数据上链 + * @param processEntity 处理进展entity + * @param assignedStaffEntities 指派给的工作人员entity + */ + void send2BlockChain(ProjectEntity projectEntity, ProjectProcessEntity processEntity, List assignedStaffEntities, String projectStaffId); +} diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectCategoryService.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectCategoryService.java index 37fb5fa984..4d66d39dd0 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectCategoryService.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectCategoryService.java @@ -119,4 +119,11 @@ public interface ProjectCategoryService extends BaseService getProjectCategoryList(DelCategoryFormDTO formDTO); + + /** + * 根据项目id,查询所有分类 + * @param projectId + * @return + */ + List getProjectCategoryService(String projectId); } \ 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 1f0fd17a0d..dff8e9d30e 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 @@ -19,6 +19,7 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.dto.ProjectDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.*; @@ -331,4 +332,29 @@ public interface ProjectService extends BaseService { List getUnResolvedListByGrid(ShiftProjectListFromDTO fromDTO); List getByOriginId(String eventId); + + /** + * @Description 【社区治理】项目分布分析-左边 + * @param formDTO + * @param tokenDto + * @author zxc + * @date 2021/12/7 10:02 上午 + */ + List projectDistributionAnalysisLeft(ProjectDistributionAnalysisFormDTO formDTO, TokenDto tokenDto); + + /** + * @Description 【社区治理】项目分布分析-右边 + * @param formDTO + * @param tokenDto + * @author zxc + * @date 2021/12/8 10:21 上午 + */ + ProjectDistributionAnalysisRightResultDTO projectDistributionAnalysisRight(ProjectDistributionAnalysisFormDTO formDTO, TokenDto tokenDto); + + /** + * 个人档案-话题详情-研判分析 + * @param formDTO + * @return + */ + TopicResearchAnalysisResDTO topicResearchAnalysis(TopicResearchAnalysisFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ResiEventService.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ResiEventService.java index 38d4916acc..c6e52d4cc3 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ResiEventService.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ResiEventService.java @@ -1,6 +1,7 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.dto.form.*; import com.epmet.dto.result.*; @@ -40,6 +41,14 @@ public interface ResiEventService extends BaseService { */ EventDetailResultDTO eventDetail(EventDetailFormDTO formDTO, TokenDto tokenDto); + /** + * 数字赋能平台-个人档案-事件详情 + * + * @param formDTO + * @return + */ + EventDetailResultDTO eventDetailForIcData(ResiEventDetailFormDTO formDTO); + /** * 我要报事-提交(尹) * @@ -129,4 +138,21 @@ public interface ResiEventService extends BaseService { * @date 2021/8/6 13:57 */ ResiEventManageRedDotRes queryResiEventManageRedDot(String agencyId); + + /** + * 数据分析-个人档案-上报事件列表 + * 根据epmetUserIdList查询 + * + * @param formDTO + * @return + */ + PageData pageUserReported(PageUserReportEventFormDTO formDTO); + + /** + * 数据分析-个人档案-上报事件列表-事件详情研判分析 + * + * @param formDTO + * @return + */ + ResiEventResearchAnalysisResDTO queryResiEventResearchAnalysis(ResiEventResearchAnalysisFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/BlockChainUploadServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/BlockChainUploadServiceImpl.java new file mode 100644 index 0000000000..9a8837f120 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/BlockChainUploadServiceImpl.java @@ -0,0 +1,151 @@ +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.epmet.dao.ProjectStaffDao; +import com.epmet.dto.form.*; +import com.epmet.entity.ProjectEntity; +import com.epmet.entity.ProjectProcessEntity; +import com.epmet.entity.ProjectStaffEntity; +import com.epmet.feign.EpmetThirdOpenFeignClient; +import com.epmet.service.BlockChainUploadService; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 区块链上链service实现 + */ +@Service +public class BlockChainUploadServiceImpl implements BlockChainUploadService { + + @Autowired + private EpmetThirdOpenFeignClient thirdOpenFeignClient; + + @Autowired + private ProjectStaffDao projectStaffDao; + + /** + * 数据上链 + * @param processEntity 处理进展entity + * @param assignedStaffEntities 指派给的工作人员entity + */ + public void send2BlockChain(ProjectEntity projectEntity, ProjectProcessEntity processEntity, List assignedStaffEntities, String projectStaffId) { + + if (true) { + return; + } + + // 1.项目主信息 + BlockChainProjectFormDTO project = null; + + if (projectEntity != null) { + project = new BlockChainProjectFormDTO(); + project.setAgencyId(projectEntity.getAgencyId()); + project.setProjectId(projectEntity.getId()); + project.setCustomerId(projectEntity.getCustomerId()); + project.setCreatedBy(projectEntity.getCreatedBy()); + project.setCreatedTime(projectEntity.getCreatedTime()); + project.setCloseStatus(projectEntity.getClosedStatus()); + project.setLocateAddress(projectEntity.getLocateAddress()); + project.setLocateDimension(projectEntity.getLocateDimension()); + project.setLocateLongitude(projectEntity.getLocateLongitude()); + project.setOrgIdPath(projectEntity.getOrgIdPath()); + project.setOrigin(projectEntity.getOrigin()); + project.setOriginId(projectEntity.getOriginId()); + project.setStatus(projectEntity.getStatus()); + project.setTitle(projectEntity.getTitle()); + } + + // 2.项目处理进展 + BlockChainProjectProcessFormDTO process = new BlockChainProjectProcessFormDTO(); + process.setProcessId(processEntity.getId()); + process.setCreatedBy(processEntity.getCreatedBy()); + process.setCreatedTime(processEntity.getCreatedTime()); + process.setCostWorkDays(processEntity.getCostWorkdays()); + process.setAgencyId(processEntity.getAgencyId()); + process.setCustomerId(processEntity.getCustomerId()); + process.setDepartmentId(processEntity.getDepartmentId()); + process.setDepartmentName(processEntity.getDepartmentName()); + process.setEndTime(processEntity.getEndTime()); + process.setGridId(processEntity.getGridId()); + process.setInternalRemark(processEntity.getInternalRemark()); + process.setIsSend(processEntity.getIsSend()); + process.setOperation(processEntity.getOperation()); + process.setOperationName(processEntity.getOperationName()); + process.setOrgIdPath(processEntity.getOrgIdPath()); + process.setProjectId(processEntity.getProjectId()); + process.setPublicReply(processEntity.getPublicReply()); + process.setStaffId(processEntity.getStaffId()); + + if (assignedStaffEntities == null) { + LambdaQueryWrapper query = new LambdaQueryWrapper<>(); + query.eq(ProjectStaffEntity::getProcessId, process.getProjectId()); + assignedStaffEntities = projectStaffDao.selectList(query); + } + + if (CollectionUtils.isEmpty(assignedStaffEntities)) { + assignedStaffEntities = new ArrayList<>(); + } + + // 3.指派人员列表 + List assignedStaffs = assignedStaffEntities.stream().map(e -> { + BlockChainProjectProcessAssignedStaffFormDTO assignedStaff = new BlockChainProjectProcessAssignedStaffFormDTO(); + assignedStaff.setStaffId(e.getStaffId()); + assignedStaff.setCreatedBy(e.getCreatedBy()); + assignedStaff.setCustomerId(e.getCustomerId()); + assignedStaff.setCreatedTime(e.getCreatedTime()); + assignedStaff.setProcessId(e.getProcessId()); + assignedStaff.setDepartmentId(e.getDepartmentId()); + assignedStaff.setDepartmentName(e.getDepartmentName()); + assignedStaff.setGridId(e.getGridId()); + assignedStaff.setId(e.getId()); + assignedStaff.setIsHandle(e.getIsHandle()); + assignedStaff.setOrgId(e.getOrgId()); + assignedStaff.setOrgIdPath(e.getOrgIdPath()); + assignedStaff.setProjectId(e.getProjectId()); + return assignedStaff; + }).collect(Collectors.toList()); + + // 4.当前处理人 + BlockChainProjectProcessAssignedStaffFormDTO handledStaff = null; + if (StringUtils.isNotBlank(projectStaffId)) { + ProjectStaffEntity handledStaffEntity = projectStaffDao.selectById(projectStaffId); + + handledStaff = new BlockChainProjectProcessAssignedStaffFormDTO(); + handledStaff.setStaffId(handledStaffEntity.getStaffId()); + handledStaff.setCreatedBy(handledStaffEntity.getCreatedBy()); + handledStaff.setCustomerId(handledStaffEntity.getCustomerId()); + handledStaff.setCreatedTime(handledStaffEntity.getCreatedTime()); + handledStaff.setProcessId(handledStaffEntity.getProcessId()); + handledStaff.setDepartmentId(handledStaffEntity.getDepartmentId()); + handledStaff.setDepartmentName(handledStaffEntity.getDepartmentName()); + handledStaff.setGridId(handledStaffEntity.getGridId()); + handledStaff.setId(handledStaffEntity.getId()); + handledStaff.setIsHandle(handledStaffEntity.getIsHandle()); + handledStaff.setOrgId(handledStaffEntity.getOrgId()); + handledStaff.setOrgIdPath(handledStaffEntity.getOrgIdPath()); + handledStaff.setProjectId(handledStaffEntity.getProjectId()); + } + + if (project == null) { + // 处理 + BlockChainProcessProjectFormDTO processForm = new BlockChainProcessProjectFormDTO(); + processForm.setProcess(process); + processForm.setAssignedStaffs(assignedStaffs); + processForm.setHandledStaff(handledStaff); + thirdOpenFeignClient.blockChainProcessProject(processForm); + } else { + // 立项 + BlockChainCreateProjectFormDTO createForm = new BlockChainCreateProjectFormDTO(); + createForm.setProject(project); + createForm.setProcess(process); + createForm.setAssignedStaffs(assignedStaffs); + thirdOpenFeignClient.blockChainCreateProject(createForm); + } + } +} diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectCategoryServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectCategoryServiceImpl.java index 85a2d6cc7e..ac0a279fb9 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectCategoryServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectCategoryServiceImpl.java @@ -214,4 +214,15 @@ public class ProjectCategoryServiceImpl extends BaseServiceImpl getProjectCategoryService(String projectId) { + return baseDao.selectListByProjectId(projectId); + } + } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessServiceImpl.java index de0a8347f4..e7932e3303 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessServiceImpl.java @@ -26,6 +26,7 @@ import com.epmet.commons.tools.constant.AppClientConstant; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.scan.param.TextScanParamDTO; @@ -37,8 +38,12 @@ import com.epmet.commons.tools.utils.IpUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.ScanContentUtils; import com.epmet.constant.*; -import com.epmet.dao.ProjectOrgRelationDao; +import com.epmet.constant.ProjectConstant; +import com.epmet.constant.ReadFlagConstant; +import com.epmet.constant.SmsTemplateConstant; +import com.epmet.constant.UserMessageConstant; import com.epmet.dao.ProjectDao; +import com.epmet.dao.ProjectOrgRelationDao; import com.epmet.dao.ProjectProcessDao; import com.epmet.dao.ProjectStaffDao; import com.epmet.dto.CustomerStaffDTO; @@ -51,6 +56,7 @@ import com.epmet.entity.ProjectEntity; import com.epmet.entity.ProjectOrgRelationEntity; import com.epmet.entity.ProjectProcessEntity; import com.epmet.entity.ProjectStaffEntity; +import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.feign.EpmetCommonServiceOpenFeignClient; import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.feign.EpmetUserFeignClient; @@ -58,6 +64,7 @@ import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.feign.GovOrgFeignClient; import com.epmet.redis.ProjectProcessRedis; import com.epmet.send.SendMqMsgUtil; +import com.epmet.service.BlockChainUploadService; import com.epmet.service.ProjectProcessService; import com.epmet.service.ProjectService; import com.epmet.service.ProjectStaffService; @@ -120,6 +127,8 @@ public class ProjectProcessServiceImpl extends BaseServiceImpl page(Map params) { @@ -407,6 +416,13 @@ public class ProjectProcessServiceImpl extends BaseServiceImpl(), null); + } catch (Exception e) { + String errorMsg = ExceptionUtils.getThrowableErrorStackTrace(e); + log.error("【项目流转】上链失败,错误信息:{}", errorMsg); + } } /** @@ -2140,6 +2188,14 @@ public class ProjectServiceImpl extends BaseServiceImpl(), null); + } catch (Exception e) { + String errorMsg = ExceptionUtils.getThrowableErrorStackTrace(e); + log.error("【项目流转】上链失败,错误信息:{}", errorMsg); + } } /** @@ -2789,4 +2852,301 @@ public class ProjectServiceImpl extends BaseServiceImpl projectDistributionAnalysisLeft(ProjectDistributionAnalysisFormDTO formDTO, TokenDto tokenDto) { + if (StringUtils.isBlank(formDTO.getOrgId())){ + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); + if (null == staffInfo){ + throw new EpmetException("未查询到此工作人员的所属组织信息..."); + } + formDTO.setOrgId(staffInfo.getAgencyId()); + } + Result> listResult = govIssueOpenFeignClient.selectCategoryOneLevelListByCustomerId(tokenDto); + if (!listResult.success()){ + throw new EpmetException("查询1级分类列表失败..."); + } + List projectCategoryByDateDTOS = baseDao.selectProjectCategoryByDate(formDTO.getStartDate(),formDTO.getEndDate(), formDTO.getOrgId(), listResult.getData().get(NumConstant.ZERO).getCodeLength()); + if (CollectionUtils.isEmpty(projectCategoryByDateDTOS)){ + return new ArrayList<>(); + } + return disposeTimeInterval(projectCategoryByDateDTOS, formDTO.getStartDate(), listResult.getData()); + } + + /** + * @Description 【社区治理】项目分布分析-右边 + * 因项目数是随时间和组织变化,很难设定一个固定的数值段,因此根据分段规则将数据分成三段 + * 分段规则 + * 组织内所有网格项目数,网格内最低项目数向下十位取整数,网格内最高项目数向上取整数,获得取值范围, + * + * 根据: 采用这个公式 + * 最小取值+(最大取值-最小取值)/3 + * 最小取值+(最大取值-最小取值)*2/3 + * 获得两个数值,用两个数值确定三个取值范围, + * + * 代码公式: + * 左区间=(最少项目个数/10)*10 + * 右区间=(最多项目个数/10+1)*10 + * 比如:阜新路街道内共10个网格,最低项目数的是124个项目(十位向下取整数),最高项目数的是241个项目(十位向上取整数),那就取值120~250区间,120到250分成3段,数值一:120+(250-120)/3≈163.3 , 数值二:120+(250-120)*2/3≈206.6 , + * 所以热力图三个数值应该是160以下(十位向下取整数),160-210(十位向上取整数),210以上 + * @param formDTO + * @param tokenDto + * @author zxc + * @date 2021/12/8 10:21 上午 + */ + @Override + public ProjectDistributionAnalysisRightResultDTO projectDistributionAnalysisRight(ProjectDistributionAnalysisFormDTO formDTO, TokenDto tokenDto) { + if (StringUtils.isBlank(formDTO.getOrgId())){ + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); + if (null == staffInfo){ + throw new EpmetException("未查询到此工作人员的所属组织信息..."); + } + formDTO.setOrgId(staffInfo.getAgencyId()); + } + AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(formDTO.getOrgId()); + if (null == agencyInfo){ + throw new EpmetException(String.format("未查询到此组织信息{%s}",formDTO.getOrgId())); + } + ProjectDistributionAnalysisRightResultDTO result = new ProjectDistributionAnalysisRightResultDTO(); + List orgList = new ArrayList<>(); + if (!agencyInfo.getLevel().equals(ProjectConstant.ORG_LEVEL_COMMUNITY)){ + Result> sonAgencyIdResult = govOrgOpenFeignClient.getSonAgencyId(formDTO.getOrgId()); + if (!sonAgencyIdResult.success()){ + throw new EpmetException(String.format("查询组织{%s}的下级组织失败...",formDTO.getOrgId())); + } + List agencyIds = sonAgencyIdResult.getData(); + if (CollectionUtils.isNotEmpty(agencyIds)){ + orgList = baseDao.selectProjectCountByOrg(agencyIds,formDTO.getStartDate(),formDTO.getEndDate()); + } + }else { + Result> projectCountByGrid = govIssueOpenFeignClient.getProjectCountByGrid(formDTO); + if (!projectCountByGrid.success()){ + throw new EpmetException("查询网格项目数失败..."); + } + if (CollectionUtils.isNotEmpty(projectCountByGrid.getData())){ + orgList = projectCountByGrid.getData(); + } + } + if (CollectionUtils.isEmpty(orgList)){ + return result; + } + result.setList(orgList); + List allCount = orgList.stream().map(m -> m.getCount()).collect(Collectors.toList()); + Integer max = Collections.max(allCount); + Integer min = Collections.min(allCount); + if (orgList.size() == NumConstant.ONE || max.compareTo(min) == NumConstant.ZERO){ + result.setUnder(orgList.get(NumConstant.ZERO).getCount()); + return result; + } + result.setUnder(min + ((max - min) / NumConstant.THREE)); + result.setAbove(min + ((max - min) * NumConstant.TWO / NumConstant.THREE)); + return result; + } + + /** + * 个人档案-话题详情-研判分析 + * + * @param formDTO + * @return + */ + @Override + public TopicResearchAnalysisResDTO topicResearchAnalysis(TopicResearchAnalysisFormDTO formDTO) { + //获取案件居民和及家属列表 + //因为是从个人档案来,所以icResiUserId不会为空 + Result userRes = epmetUserOpenFeignClient.findFamilyMem(formDTO.getIcResiUserId()); + if (!userRes.success() || null == userRes.getData()) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取居民信息接口异常"); + } + IcResiUserBriefDTO icResiUserDTO = userRes.getData(); + TopicResearchAnalysisResDTO resultDTO = ConvertUtils.sourceToTarget(icResiUserDTO, TopicResearchAnalysisResDTO.class); + resultDTO.setProjectData(new ArrayList<>()); + if(org.springframework.util.CollectionUtils.isEmpty(formDTO.getEpmetUserIdList())){ + //灭有找到小程序里的用户id, 所以不用查询接下来的项目了..... + return resultDTO; + } + resultDTO.setEpmetUserIdList(formDTO.getEpmetUserIdList()); + + // 先判断这个项目是否有分类没有直接返回 + List projectCategoryDTOList=projectCategoryService.getProjectCategoryService(formDTO.getProjectId()); + if(org.springframework.util.CollectionUtils.isEmpty(projectCategoryDTOList)){ + return resultDTO; + } + //筛选出所有的一级分类 + Set firstCategoryIds=new HashSet<>(); + for(ProjectCategoryDTO categoryDTO:projectCategoryDTOList){ + if(StringUtils.isNotBlank(categoryDTO.getCategoryPids())){ + if(NumConstant.ZERO_STR.equals(categoryDTO.getCategoryPids())){ + //当前分类就是一级分类 + firstCategoryIds.add(categoryDTO.getCategoryId()); + continue; + } + //当前分类为二级分类 + if(!categoryDTO.getCategoryPids().contains(StrConstant.COMMA)&&!categoryDTO.getCategoryPids().contains(StrConstant.COLON)){ + firstCategoryIds.add(categoryDTO.getCategoryPids()); + continue; + } + //英文逗号 + if(categoryDTO.getCategoryPids().contains(StrConstant.COMMA)){ + String[] categoryAtt=categoryDTO.getCategoryPids().split(StrConstant.COMMA); + firstCategoryIds.add(categoryAtt[NumConstant.ZERO]); + continue; + } + //可能也是英文冒号吧。。不知道是啥,所以都判断下吧 + if(categoryDTO.getCategoryPids().contains(StrConstant.COLON)){ + String[] categoryAtt=categoryDTO.getCategoryPids().split(StrConstant.COLON); + firstCategoryIds.add(categoryAtt[NumConstant.ZERO]); + continue; + } + } + } + //没有一级分类直接退出 + if(org.springframework.util.CollectionUtils.isEmpty(firstCategoryIds)){ + return resultDTO; + } + log.info(String.format("当前项目id:%s,所有一级分类id:%s",formDTO.getProjectId(), JSON.toJSONString(firstCategoryIds))); + //查询这些分类的名称 + //查询出当前人,在居民端小程序里上报的需求且转了项目的,并且还得排除当前的这个项目 + IssueProjectCategoryDictListFormDTO dictFormDto=new IssueProjectCategoryDictListFormDTO(); + dictFormDto.setCustomerId(projectCategoryDTOList.get(NumConstant.ZERO).getCustomerId()); + dictFormDto.setCstegoryIdList(new ArrayList(firstCategoryIds)); + Result> categoryRes=govIssueOpenFeignClient.getCategoryList(dictFormDto); + if(!categoryRes.success()|| org.springframework.util.CollectionUtils.isEmpty(categoryRes.getData())){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取项目分类名称异常"); + } + List projectData=new ArrayList<>(); + for(IssueProjectCategoryDictDTO categoryDictDTO:categoryRes.getData()){ + //当前项目分类一致,排除当前项目,相同分类编码 + List projectList=baseDao.selectCommonCategoryIssueProject(projectCategoryDTOList.get(NumConstant.ZERO).getCustomerId(), + categoryDictDTO.getCategoryCode(),formDTO.getProjectId(),formDTO.getEpmetUserIdList()); + if(!org.springframework.util.CollectionUtils.isEmpty(projectList)){ + ProjectDataDTO projectDataDTO=new ProjectDataDTO(); + projectDataDTO.setFirstCategoryCode(categoryDictDTO.getCategoryCode()); + projectDataDTO.setFirstCategoryName(categoryDictDTO.getCategoryName()); + projectDataDTO.setProjectList(projectList); + projectData.add(projectDataDTO); + } + } + resultDTO.setProjectData(projectData); + return resultDTO; + } + + /** + * @Description 区间项目分类数量处理 + * 查询的是时间段内的分类项目数,查询的时间 是传入一个日期,拼上时间,在进行比较大小 + * @param categories + * @param date + * @param listResult + * @author zxc + * @date 2021/12/8 9:45 上午 + */ + public List disposeTimeInterval(List categories, String date,List listResult){ + // 把一天分成6段 + List intervalTimeList = getIntervalTimeList("00:00", "24:00", 240); + List result = new ArrayList<>(); + Map> groupByCode = categories.stream().collect(Collectors.groupingBy(ProjectCategoryByDateDTO::getCategoryCode)); + for (int i = 0; i < intervalTimeList.size(); i++) { + ProjectDistributionAnalysisLeftResultDTO dto = new ProjectDistributionAnalysisLeftResultDTO(); + dto.setTime(intervalTimeList.get(i)); + dto.setCategoryList(ConvertUtils.sourceToTarget(listResult,CategoryListDTO.class)); + if (i == NumConstant.ZERO){ + String concat = date.concat(" ").concat(intervalTimeList.get(i)).concat(":00"); + long end = DateUtils.stringToDate(concat,DateUtils.DATE_TIME_PATTERN).getTime(); + dto.getCategoryList().forEach(cate -> { + AtomicReference count = new AtomicReference<>(cate.getCount()); + groupByCode.forEach((k,v) -> { + if (cate.getCategoryCode().equals(k)){ + v.forEach(l -> { + if (l.getCreatedTime().getTime() < end){ + cate.setCount(count.getAndSet(count.get() + NumConstant.ONE)); + } + }); + } + }); + }); + }else { + String concat = date.concat(" ").concat(intervalTimeList.get(i)).concat(":00"); + long end = NumConstant.ZERO_L; + if (intervalTimeList.get(i).equals("00:00")){ + Calendar c = new GregorianCalendar(); + Date endDate = DateUtils.stringToDate(concat,DateUtils.DATE_TIME_PATTERN); + c.setTime(endDate); + c.add(Calendar.DATE,NumConstant.ONE); + end = c.getTime().getTime(); + }else { + end = DateUtils.stringToDate(concat,DateUtils.DATE_TIME_PATTERN).getTime(); + } + String startStr = date.concat(" ").concat(intervalTimeList.get(i - NumConstant.ONE)).concat(":00"); + long start = DateUtils.stringToDate(startStr,DateUtils.DATE_TIME_PATTERN).getTime(); + long finalEnd = end; + dto.getCategoryList().forEach(cate -> { + AtomicReference count = new AtomicReference<>(cate.getCount()); + groupByCode.forEach((k,v) -> { + if (cate.getCategoryCode().equals(k)){ + v.forEach(l -> { + if (l.getCreatedTime().getTime() < finalEnd && l.getCreatedTime().getTime() >= start){ + cate.setCount(count.getAndSet(count.get() + NumConstant.ONE)); + } + }); + } + }); + }); + } + result.add(dto); + } + return result; + } + + /** + * @Description 获取固定时间段之间固定时间的集合 + * @param start 开始时间 + * @param end 结束时间 + * @param interval 间隔时间 + * @author zxc + * @date 2021/11/22 3:48 下午 + */ + public List getIntervalTimeList(String start,String end,Integer interval) { + Date startDate = convertStringToDate("HH:mm", start); + Date endDate = convertStringToDate("HH:mm", end); + List list = new ArrayList<>(); + while (startDate.getTime() <= endDate.getTime()) { + list.add(convertDateToString("HH:mm", startDate)); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(startDate); + calendar.add(Calendar.MINUTE, interval); + if (calendar.getTime().getTime() > endDate.getTime()) { + if (!startDate.equals(endDate)) { + list.add(convertDateToString("HH:mm", endDate)); + } + startDate = calendar.getTime(); + } else { + startDate = calendar.getTime(); + } + + } + list.remove(NumConstant.ZERO); + return list; + } + + + public Date convertStringToDate(String format, String dateStr) { + SimpleDateFormat simpleDateFormat = new SimpleDateFormat(format); + try { + Date date = simpleDateFormat.parse(dateStr); + return date; + } catch (ParseException e) { + e.printStackTrace(); + } + return null; + } + + public String convertDateToString(String format, Date date) { + SimpleDateFormat simpleDateFormat = new SimpleDateFormat(format); + return simpleDateFormat.format(date); + } +} diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectTraceServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectTraceServiceImpl.java index e8e79882f7..1150ecc9f5 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectTraceServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectTraceServiceImpl.java @@ -1,10 +1,13 @@ package com.epmet.service.impl; import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.epmet.commons.rocketmq.messages.ProjectChangedMQMsg; import com.epmet.commons.tools.constant.AppClientConstant; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.enums.OrgTypeEnum; import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.scan.param.TextScanParamDTO; import com.epmet.commons.tools.scan.param.TextTaskDTO; @@ -19,6 +22,7 @@ import com.epmet.constant.*; import com.epmet.dao.ProjectOrgRelationDao; import com.epmet.dao.ProjectProcessAttachmentDao; import com.epmet.dao.ProjectProcessDao; +import com.epmet.dao.ResiEventReportOrgDao; import com.epmet.dto.IssueProjectCategoryDictDTO; import com.epmet.dto.IssueProjectTagDictDTO; import com.epmet.dto.ProjectStaffDTO; @@ -91,6 +95,10 @@ public class ProjectTraceServiceImpl implements ProjectTraceS private LoginUserUtil loginUserUtil; @Autowired private ResiEventService resiEventService; + @Autowired + private ResiEventReportOrgDao resiEventReportOrgDao; + @Autowired + private BlockChainUploadService blockChainUploadService; @Override public List getPendProjectList(TokenDto tokenDto, ProjectListFromDTO fromDTO) { @@ -529,6 +537,13 @@ public class ProjectTraceServiceImpl implements ProjectTraceS log.error("项目实时统计消息发送失败"); } + // 数据上链 + try { + blockChainUploadService.send2BlockChain(projectEntity, processEntity, entityList, null); + } catch (Exception e) { + String errorMsg = ExceptionUtils.getThrowableErrorStackTrace(e); + log.error("【项目流转】上链失败,错误信息:{}", errorMsg); + } } /** @@ -637,6 +652,12 @@ public class ProjectTraceServiceImpl implements ProjectTraceS if (!CollectionUtils.isEmpty(projectEntityList)) { throw new RenException(EpmetErrorCode.RESI_EVENT_SHIFT_PROJECT.getCode(), EpmetErrorCode.RESI_EVENT_SHIFT_PROJECT.getMsg()); } + LambdaQueryWrapper tWrapper = new LambdaQueryWrapper<>(); + tWrapper.eq(ResiEventReportOrgEntity::getResiEventId,formDTO.getEventId()); + ResiEventReportOrgEntity reportOrgEntity = resiEventReportOrgDao.selectOne(tWrapper); + if (reportOrgEntity == null){ + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } List staffList = formDTO.getStaffList(); //1.文字内容安全校验 List list = new ArrayList<>(); @@ -748,6 +769,10 @@ public class ProjectTraceServiceImpl implements ProjectTraceS entity.setCategoryId(item.getId()); entity.setCategoryPids(ca.getPids()); entity.setCategoryCode(ca.getCategoryCode()); + //如果事件上报给 网格 则这个项目是属于网格 设置网格ID˚ + if (OrgTypeEnum.GRID.getCode().equals(reportOrgEntity.getOrgType())){ + entity.setGridId(reportOrgEntity.getOrgId()); + } categoryEntityList.add(entity); } }); @@ -845,6 +870,15 @@ public class ProjectTraceServiceImpl implements ProjectTraceS resiEventService.shiftProject(eventShiftProjectDTO); EventToProjectResultDTO resultDTO=new EventToProjectResultDTO(); resultDTO.setProjectId(projectEntity.getId()); + + // 数据上链 + try { + blockChainUploadService.send2BlockChain(projectEntity, processEntity, entityList, null); + } catch (Exception e) { + String errorMsg = ExceptionUtils.getThrowableErrorStackTrace(e); + log.error("【项目流转】上链失败,错误信息:{}", errorMsg); + } + return resultDTO; } diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventServiceImpl.java index 3adca24761..ab54bfd340 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventServiceImpl.java @@ -23,7 +23,9 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.dto.form.FileCommonDTO; 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.scan.param.ImgScanParamDTO; import com.epmet.commons.tools.scan.param.ImgTaskDTO; import com.epmet.commons.tools.scan.param.TextScanParamDTO; @@ -37,11 +39,15 @@ import com.epmet.constant.EventConstant; import com.epmet.constant.ResiEventAction; import com.epmet.dao.*; import com.epmet.dto.EventProjectInfoDTO; +import com.epmet.dto.IssueProjectCategoryDictDTO; +import com.epmet.dto.ProjectCategoryDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.entity.*; import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.feign.GovIssueOpenFeignClient; import com.epmet.feign.GovOrgOpenFeignClient; +import com.epmet.service.ProjectCategoryService; import com.epmet.service.ResiEventService; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; @@ -53,10 +59,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; -import java.util.UUID; +import java.util.*; /** * 居民报事表 @@ -89,6 +92,11 @@ public class ResiEventServiceImpl extends BaseServiceImpl data = orgResult.getData(); dto.setEventOrg(data); - // 更改已读状态 报事人的红点:resi_event,艾特人的:resi_event_mention,所代表的组织的:resi_event_report_org - if (tokenDto.getApp().equals(EventConstant.TYPE_RESI)){ - baseDao.updateResiEvent(tokenDto.getUserId(),formDTO.getEventId()); - baseDao.updateEventMention(tokenDto.getUserId(),formDTO.getEventId()); - }else if (tokenDto.getApp().equals(EventConstant.TYPE_GOV)){ - resiEventReportOrgDao.updateEventOrg(formDTO.getEventId(), formDTO.getOrgId()); - } return dto; } + /** + * 数字赋能平台-个人档案-事件详情 + * + * @param formDTO + * @return + */ + public EventDetailResultDTO eventDetailForIcData(ResiEventDetailFormDTO formDTO){ + return getEventDetailResultDTO(formDTO.getResiEventId()); + } /** * 我要报事-提交(尹) @@ -639,5 +662,109 @@ public class ResiEventServiceImpl extends BaseServiceImpl pageUserReported(PageUserReportEventFormDTO formDTO) { + if (org.apache.commons.collections4.CollectionUtils.isEmpty(formDTO.getEpmetUserIdList())) { + return new PageData(new ArrayList<>(), NumConstant.ZERO); + } + PageInfo pageInfo = PageHelper.startPage(formDTO.getPageNo(), + formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.selectUserReported(formDTO)); + return new PageData<>(pageInfo.getList(), pageInfo.getTotal()); + } + + /** + * 数据分析-个人档案-上报事件列表-事件详情研判分析 + * + * @param formDTO + * @return + */ + @Override + public ResiEventResearchAnalysisResDTO queryResiEventResearchAnalysis(ResiEventResearchAnalysisFormDTO formDTO) { + //获取案件居民和及家属列表 + //因为是从个人档案来,所以icResiUserId不会为空 + Result userRes = epmetUserOpenFeignClient.findFamilyMem(formDTO.getIcResiUserId()); + if (!userRes.success() || null == userRes.getData()) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取居民信息接口异常"); + } + IcResiUserBriefDTO icResiUserDTO = userRes.getData(); + ResiEventResearchAnalysisResDTO resultDTO = ConvertUtils.sourceToTarget(icResiUserDTO, ResiEventResearchAnalysisResDTO.class); + resultDTO.setProjectData(new ArrayList<>()); + if(CollectionUtils.isEmpty(formDTO.getEpmetUserIdList())){ + //灭有找到小程序里的用户id, 所以不用查询接下来的项目了..... + return resultDTO; + } + resultDTO.setEpmetUserIdList(formDTO.getEpmetUserIdList()); + + // 先判断这个项目是否有分类没有直接返回 + List projectCategoryDTOList=projectCategoryService.getProjectCategoryService(formDTO.getProjectId()); + if(CollectionUtils.isEmpty(projectCategoryDTOList)){ + return resultDTO; + } + //筛选出所有的一级分类 + Set firstCategoryIds=new HashSet<>(); + for(ProjectCategoryDTO categoryDTO:projectCategoryDTOList){ + if(StringUtils.isNotBlank(categoryDTO.getCategoryPids())){ + if(NumConstant.ZERO_STR.equals(categoryDTO.getCategoryPids())){ + //当前分类就是一级分类 + firstCategoryIds.add(categoryDTO.getCategoryId()); + continue; + } + //当前分类为二级分类 + if(!categoryDTO.getCategoryPids().contains(StrConstant.COMMA)&&!categoryDTO.getCategoryPids().contains(StrConstant.COLON)){ + firstCategoryIds.add(categoryDTO.getCategoryPids()); + continue; + } + //英文逗号 + if(categoryDTO.getCategoryPids().contains(StrConstant.COMMA)){ + String[] categoryAtt=categoryDTO.getCategoryPids().split(StrConstant.COMMA); + firstCategoryIds.add(categoryAtt[NumConstant.ZERO]); + continue; + } + //可能也是英文冒号吧。。不知道是啥,所以都判断下吧 + if(categoryDTO.getCategoryPids().contains(StrConstant.COLON)){ + String[] categoryAtt=categoryDTO.getCategoryPids().split(StrConstant.COLON); + firstCategoryIds.add(categoryAtt[NumConstant.ZERO]); + continue; + } + } + } + //没有一级分类直接退出 + if(CollectionUtils.isEmpty(firstCategoryIds)){ + return resultDTO; + } + log.info(String.format("当前项目id:%s,所有一级分类id:%s",formDTO.getProjectId(), JSON.toJSONString(firstCategoryIds))); + //查询这些分类的名称 + //查询出当前人,在居民端小程序里上报的需求且转了项目的,并且还得排除当前的这个项目 + IssueProjectCategoryDictListFormDTO dictFormDto=new IssueProjectCategoryDictListFormDTO(); + dictFormDto.setCustomerId(projectCategoryDTOList.get(NumConstant.ZERO).getCustomerId()); + dictFormDto.setCstegoryIdList(new ArrayList(firstCategoryIds)); + Result> categoryRes=govIssueOpenFeignClient.getCategoryList(dictFormDto); + if(!categoryRes.success()||CollectionUtils.isEmpty(categoryRes.getData())){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取项目分类名称异常"); + } + List projectData=new ArrayList<>(); + for(IssueProjectCategoryDictDTO categoryDictDTO:categoryRes.getData()){ + //当前项目分类一致,排除当前项目,相同分类编码 + List projectList=projectDao.selectCommonCategoryEventProject(projectCategoryDTOList.get(NumConstant.ZERO).getCustomerId(), + categoryDictDTO.getCategoryCode(),formDTO.getProjectId(),formDTO.getEpmetUserIdList()); + if(!CollectionUtils.isEmpty(projectList)){ + ProjectDataDTO projectDataDTO=new ProjectDataDTO(); + projectDataDTO.setFirstCategoryCode(categoryDictDTO.getCategoryCode()); + projectDataDTO.setFirstCategoryName(categoryDictDTO.getCategoryName()); + projectDataDTO.setProjectList(projectList); + projectData.add(projectDataDTO); + } + } + resultDTO.setProjectData(projectData); + return resultDTO; + } + } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/bootstrap.yml b/epmet-module/gov-project/gov-project-server/src/main/resources/bootstrap.yml index 0e8f0ca47c..2800f5ad1c 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/resources/bootstrap.yml +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/bootstrap.yml @@ -28,6 +28,15 @@ spring: url: @spring.datasource.druid.url@ username: @spring.datasource.druid.username@ password: @spring.datasource.druid.password@ + #监控页面 + stat-view-servlet: + enabled: true + #loginUsername: admin + #loginPassword: admin + allow: + web-stat-filter: + enabled: true + filters: stat,wall,log4j2 # 数据迁移工具flyway flyway: enabled: @spring.flyway.enabled@ diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectCategoryDao.xml b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectCategoryDao.xml index 49942cdca3..24acbb220f 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectCategoryDao.xml +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectCategoryDao.xml @@ -50,4 +50,11 @@ ) + \ No newline at end of file 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 ab6c65c8a7..2e5d52b4ca 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 @@ -397,4 +397,90 @@ where p.DEL_FLAG = '0' AND p.ORIGIN_ID = #{originId} + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventDao.xml b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventDao.xml index 3284be99e6..d88575dbab 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventDao.xml +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventDao.xml @@ -201,4 +201,20 @@ ) ORDER BY ro.CREATED_TIME DESC + + \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/deploy/docker-compose-prod.yml b/epmet-module/gov-voice/gov-voice-server/deploy/docker-compose-prod.yml index 3dff43db41..d5a6908cd6 100644 --- a/epmet-module/gov-voice/gov-voice-server/deploy/docker-compose-prod.yml +++ b/epmet-module/gov-voice/gov-voice-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-voice-server: container_name: gov-voice-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/gov-voice-server:0.3.69 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/gov-voice-server:0.3.78 ports: - "8105:8105" network_mode: host # 使用现有网络 @@ -15,4 +15,4 @@ services: resources: limits: cpus: '0.1' - memory: 600M \ No newline at end of file + memory: 600M diff --git a/epmet-module/gov-voice/gov-voice-server/pom.xml b/epmet-module/gov-voice/gov-voice-server/pom.xml index 0403af0463..305075f3a6 100644 --- a/epmet-module/gov-voice/gov-voice-server/pom.xml +++ b/epmet-module/gov-voice/gov-voice-server/pom.xml @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - 0.3.69 + 0.3.78 gov-voice com.epmet @@ -250,7 +250,7 @@ false - false + true true https://epmet-open.elinkservice.cn/api/epmetscan/api diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/GovVoiceApplication.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/GovVoiceApplication.java index b5d7919388..630690be40 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/GovVoiceApplication.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/GovVoiceApplication.java @@ -8,7 +8,6 @@ import org.springframework.cloud.openfeign.EnableFeignClients; import org.springframework.scheduling.annotation.EnableAsync; /** - * * @author Mark sunlightcs@gmail.com * @since 1.0.0 */ @@ -18,7 +17,7 @@ import org.springframework.scheduling.annotation.EnableAsync; @EnableAsync @ServletComponentScan public class GovVoiceApplication { - public static void main(String[] args) { - SpringApplication.run(GovVoiceApplication.class, args); - } + public static void main(String[] args) { + SpringApplication.run(GovVoiceApplication.class, args); + } } diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideCategoryController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideCategoryController.java index b1e8824223..7d5a92fc9b 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideCategoryController.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideCategoryController.java @@ -18,6 +18,7 @@ package com.epmet.controller; import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.aop.NoRepeatSubmit; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; @@ -47,7 +48,7 @@ import java.util.List; @RestController @RequestMapping("guidecategory") public class GuideCategoryController { - + @Autowired private GuideCategoryService guideCategoryService; @@ -68,10 +69,10 @@ public class GuideCategoryController { /** * 办事指南】可用分类列表 新增、编辑指南时的下拉框:展示未禁用的分类; 查询指南列表:如果禁用的分类下存在指南列表,则展示,不存在直接不展示 - * - * @param tokenDto - * @return com.epmet.commons.tools.utils.Result> - * @author yinzuomei + * + * @param tokenDto + * @return com.epmet.commons.tools.utils.Result> + * @author yinzuomei * @date 2021/9/8 2:47 下午 */ @PostMapping("getcategory") @@ -143,6 +144,7 @@ public class GuideCategoryController { * @author yinzuomei * @date 2021/9/8 5:11 下午 */ + @NoRepeatSubmit @PostMapping("save") public Result save(@LoginUser TokenDto tokenDto,@RequestBody EditGuideCategoryFormDTO formDTO){ formDTO.setStaffId(tokenDto.getUserId()); @@ -160,6 +162,7 @@ public class GuideCategoryController { * @author yinzuomei * @date 2021/9/8 5:37 下午 */ + @NoRepeatSubmit @PostMapping("update") public Result update(@LoginUser TokenDto tokenDto,@RequestBody EditGuideCategoryFormDTO formDTO){ formDTO.setStaffId(tokenDto.getUserId()); @@ -168,4 +171,4 @@ public class GuideCategoryController { } -} \ No newline at end of file +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideController.java index 88d8115216..8fe57c6f76 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideController.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideController.java @@ -18,6 +18,7 @@ package com.epmet.controller; import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.aop.NoRepeatSubmit; import com.epmet.commons.tools.dto.form.PageFormDTO; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; @@ -113,6 +114,7 @@ public class GuideController { * @Author zhaoqifeng * @Date 2021/9/7 14:13 */ + @NoRepeatSubmit @PostMapping("add") public Result guideAdd(@LoginUser TokenDto tokenDto, @RequestBody GuideAddFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO); @@ -177,4 +179,4 @@ public class GuideController { } -} \ No newline at end of file +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/LbController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/LbController.java new file mode 100644 index 0000000000..718d10929e --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/LbController.java @@ -0,0 +1,23 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.utils.Result; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.cloud.commons.util.InetUtils; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("lb") +public class LbController { + + @Autowired + private InetUtils inetUtils; + + @PostMapping("get-host") + public Result getHost() { + String ipAddress = inetUtils.findFirstNonLoopbackHostInfo().getIpAddress(); + return new Result().ok(ipAddress); + } + +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/SpecialSubjectController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/SpecialSubjectController.java index 017338b433..a24b0c5b9e 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/SpecialSubjectController.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/SpecialSubjectController.java @@ -19,6 +19,7 @@ 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; @@ -58,6 +59,7 @@ public class SpecialSubjectController { * @description 添加专题 * @Date 2021/7/15 15:31 **/ + @NoRepeatSubmit @RequirePermission(requirePermission = RequirePermissionEnum.WORK_SPECIAL_PROJECT_ADD) @PostMapping("add") public Result addSpecialSubject(@LoginUser TokenDto tokenDto, @RequestBody AddSpecialSubjectFormDTO formDTO) { @@ -125,4 +127,4 @@ public class SpecialSubjectController { public Result> preview(@RequestBody PreviewFormDTO formDTO) { return new Result>().ok(specialSubjectService.preview(formDTO)); } -} \ No newline at end of file +} diff --git a/epmet-module/open-data-worker/open-data-worker-client/pom.xml b/epmet-module/open-data-worker/open-data-worker-client/pom.xml new file mode 100644 index 0000000000..ca20343976 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-client/pom.xml @@ -0,0 +1,21 @@ + + + + open-data-worker + com.epmet + 2.0.0 + + 4.0.0 + + open-data-worker-client + + + + com.epmet + epmet-commons-tools + 2.0.0 + + + diff --git a/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/BaseConflictsResolveDTO.java b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/BaseConflictsResolveDTO.java new file mode 100644 index 0000000000..3787374f7f --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/BaseConflictsResolveDTO.java @@ -0,0 +1,212 @@ +/** + * 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.opendata.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 事件中间表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-25 + */ +@Data +public class BaseConflictsResolveDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 事件ID + */ + private String id; + + /** + * 事件所属网格ID + */ + private Integer gridId; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 事件名称 + */ + private String eventName; + + /** + * 发生日期 + */ + private Date happenDate; + + /** + * 发生地点 + */ + private String happenPlace; + + /** + * 事件规模 + */ + private String eventScale; + + /** + * 涉及人数 + */ + private Integer numberInvolved; + + /** + * 事件简述 + */ + private String eventDescription; + + /** + * 涉及单位 + */ + private String relatedUnits; + + /** + * 主要当事人证件代码 + */ + private String identificationCode; + + /** + * 主要当事人证件号码 + */ + private String idCard; + + /** + * 主要当事人姓名 + */ + private String name; + + /** + * 主要当事人性别 + */ + private String sex; + + /** + * 主要当事人民族 + */ + private String nation; + + /** + * 主要当事人学历 + */ + private String education; + + /** + * 主要当事人人员类别(二级) + */ + private String personnelCategory; + + /** + * 主要当事人居住详址 + */ + private String detailAddress; + + /** + * 是否解决或化解(Y已解决N未解决) + */ + private String successfulOrNot; + + /** + * 经度 + */ + private String lng; + + /** + * 纬度 + */ + private String lat; + + /** + * 创建人 + */ + private String createBy; + + /** + * 创建时间 + */ + private Date createDate; + + /** + * 修改人 + */ + private String updateBy; + + /** + * 修改时间 + */ + private Date updateDate; + + /** + * 事件所属网格ID状态(01:待办理,02:待核实,03:办结) + */ + private String status; + + /** + * 事件编号(自定义编号,可以加前缀如:py) + */ + private String eventNo; + + /** + * 采集来源(01:App,02:Web) + */ + private String source; + + /** + * 事件类别(一级) + */ + private String firstEventCategory; + + /** + * 事件类别(二级) + */ + private String secondEventCategory; + + /** + * 主要当事人人员类别(一级) + */ + private String firstPersonnelCategory; + + /** + * 办结方式(状态是办结的时候,才填) + */ + private String resolveWay; + + /** + * 办结层级(状态是办结的时候,才填) + */ + private String resolveGridLevel; + + /** + * 办结时间(状态是办结的时候,才填) + */ + private Date resolveTime; + + /** + * 同步状态 0 未同步, 1 已同步 + */ + private String flag; + +} \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/BaseDisputeProcessDTO.java b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/BaseDisputeProcessDTO.java new file mode 100644 index 0000000000..2f377e9ac9 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/BaseDisputeProcessDTO.java @@ -0,0 +1,211 @@ +/** + * 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.opendata.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * 事件信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-15 + */ +@Data +public class BaseDisputeProcessDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + private Integer detpId; + + private String reporterId; + + /** + * 网格编码 + */ + private String orgCode; + + /** + * 网格名称 + */ + private String orgName; + + /** + * 事件名称 + */ + private String eventName; + + /** + * 事件类别 + */ + private String eventCategory; + + /** + * 上报时间 YYYY-MM-DD HH:MM:SS + */ + private Date reportTime; + + /** + * 发生时间 格式为“YYYY-MM-DD” + */ + private Date happenDate; + + /** + * 发生地点 + */ + private String happenPlace; + + /** + * 事件简述 + */ + private String eventDescription; + + /** + * 办结方式 01自办;02上报 源于居民端的最终结案的项目为02;工作端立项的项目最终结案的01 + */ + private String waysOfResolving; + + /** + * 是否办结 Y:是、N:否 + */ + private String successfulOrNo; + + /** + * 办结层级 +01省、自治区、直辖市 +02地、市、州、盟 +03县、市、区、旗 +04乡镇、街道 +05片区 +06村、社区 +07网格 + + */ + private String completeLevel; + + /** + * 基础信息主键 + */ + private String baseInfoId; + + /** + * 办结时间 + */ + private Date completeTime; + + /** + * 经度 + */ + private BigDecimal lng; + + /** + * 纬度 + */ + private BigDecimal lat; + + /** + * 主要当事人姓名 + */ + private String name; + + /** + * 涉及人数 + */ + private Integer numberInvolved; + + /** + * 涉及单位 + */ + private String relatedUnits; + + /** + * 重点场所类别 01九小场所, 02公共场所 + */ + private String keyAreaType; + + /** + * 宗教活动规模 01 0-50人,02 51-200人,03 201人以上 + + */ + private String religionScale; + + /** + * 宗教类别 01道教 02佛教 03基督教 04伊斯兰教 05其他 + + */ + private String religionType; + + /** + * 重点场所是否变动 Y:是、N:否 + */ + private String isKeyareaState; + + /** + * 重点人员是否在当地 Y:是、N:否 + */ + private String isKeypeopleLocate; + + /** + * 重点人员现状 + */ + private String keypeopleStatus; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Long delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/ExDeptDTO.java b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/ExDeptDTO.java new file mode 100644 index 0000000000..1a24eef647 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/ExDeptDTO.java @@ -0,0 +1,96 @@ +/** + * 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.opendata.dto; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 部门(网格)中间表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-19 + */ +@Data +public class ExDeptDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * (市平台)部门id + */ + private Integer deptId; + + /** + * (市平台)父部门id + */ + private Integer parentId; + + /** + * 祖级列表 + */ + private String ancestors; + + /** + * (市平台)部门/网格名称 + */ + private String fullName; + + /** + * (市平台)部门/网格简称 + */ + private String deptName; + + /** + * (市平台)部门/网格编码 + */ + private String deptCode; + + /** + * (省标准)区划编码/网格编码 + */ + private String gridCode; + + /** + * 组织类型 + */ + private String isCgorg; + + /** + * (区县平台)部门id + */ + private String qxDeptId; + + /** + * (区县平台)部门/网格名称 + */ + private String qxDeptCode; + + /** + * (区县平台)部门/网格名称 + */ + private String qxDeptName; + + /** + * (区县平台)客户Id + */ + private String qxCustomerId; + +} \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/ExUserDTO.java b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/ExUserDTO.java new file mode 100644 index 0000000000..d91adcd51e --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/ExUserDTO.java @@ -0,0 +1,81 @@ +/** + * 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.opendata.dto; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 系统用户中间表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-22 + */ +@Data +public class ExUserDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 市平台 用户ID + */ + private Integer userId; + + /** + * 市平台 用户名 + */ + private String userName; + + /** + * 市平台 登录账号 + */ + private String loginName; + + /** + * (市平台)所属区县、街道、村居或网格id + */ + private String gridId; + + /** + * (市平台)所属部门id + */ + private String deptId; + + /** + * (区县平台)用户id + */ + private String qxUserId; + + /** + * (区县平台)姓名/用户名称 + */ + private String qxUserName; + + /** + * (区县平台)手机号码 + */ + private String qxMobile; + + /** + * (区县平台)客户Id + */ + private String qxCustomerId; + +} \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/ExDeptFormDTO.java b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/ExDeptFormDTO.java new file mode 100644 index 0000000000..b605727fec --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/ExDeptFormDTO.java @@ -0,0 +1,34 @@ +package com.epmet.opendata.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * @dscription 插叙客户网格基础信息--接口入参 + * @author sun + */ +@Data +public class ExDeptFormDTO implements Serializable { + + private static final long serialVersionUID = -3634745091993094743L; + /** + * 客户Id + */ + @NotBlank(message = "客户Id不能为空", groups = {Grid.class}) + private String customerId = ""; + /** + * 网格Id + */ + private List orgIdList; + /** + * 操作类型【新增:add 修改删除:edit 初始化所有数据:all】 + */ + private String type; + + public interface Grid extends CustomerClientShowGroup {} + +} diff --git a/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/StaffBaseInfoFormDTO.java b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/StaffBaseInfoFormDTO.java new file mode 100644 index 0000000000..417ee92ad6 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/StaffBaseInfoFormDTO.java @@ -0,0 +1,33 @@ +package com.epmet.opendata.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * @dscription 插叙客户网格人员基础信息--接口入参 + * @author sun + */ +@Data +public class StaffBaseInfoFormDTO implements Serializable { + + private static final long serialVersionUID = -3634745091993094743L; + /** + * 客户Id + */ + @NotBlank(message = "客户Id不能为空", groups = {Staff.class}) + private String customerId = ""; + /** + * 人员Id + */ + private List staffIdList; + /** + * 操作类型【新增:add 修改删除:edit】 + */ + private String type; + public interface Staff extends CustomerClientShowGroup {} + +} diff --git a/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/UpsertPatrolRecordForm.java b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/UpsertPatrolRecordForm.java new file mode 100644 index 0000000000..d80157031e --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/UpsertPatrolRecordForm.java @@ -0,0 +1,33 @@ +package com.epmet.opendata.dto.form; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; + +import javax.validation.constraints.NotEmpty; + +/** + * 插入或更新巡查记录主表 + * @author liujianjun + */ +@Data +public class UpsertPatrolRecordForm extends PageFormDTO { + /** + * 客户Id + */ + @NotEmpty(message = "customerId不能为空") + private String customerId; + + /** + * 巡查记录id + */ + private String patrolId; + + /** + * 操作类型 + * SystemMessageType.USER_PATROL_START + * SystemMessageTypSTOP + */ + @NotEmpty(message = "actionType不能为空") + private String actionType; + +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/Dockerfile b/epmet-module/open-data-worker/open-data-worker-server/Dockerfile new file mode 100644 index 0000000000..bdbf6243c4 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/Dockerfile @@ -0,0 +1,11 @@ +FROM java:8 + +RUN export LANG="zh_CN.UTF-8" +RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime +RUN echo 'Asia/Shanghai' > /etc/timezone + +COPY ./target/*.jar ./open-data-worker.jar + +EXPOSE 8107 + +ENTRYPOINT ["sh", "-c", "exec $RUN_INSTRUCT"] \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/deploy/docker-compose-dev.yml b/epmet-module/open-data-worker/open-data-worker-server/deploy/docker-compose-dev.yml new file mode 100644 index 0000000000..5df8669717 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/deploy/docker-compose-dev.yml @@ -0,0 +1,18 @@ +version: "3.7" +services: + gov-voice-server: + container_name: open-data-worker-server-dev + image: 192.168.1.140:5000/epmet-cloud-dev/open-data-worker-server:version_placeholder + ports: + - "8107:8107" + network_mode: host # 使用现有网络 + volumes: + - "/opt/epmet-cloud-logs/dev:/logs" + environment: + RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./open-data-worker.jar" + restart: "unless-stopped" + deploy: + resources: + limits: + cpus: '0.1' + memory: 250M \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/deploy/docker-compose-prod.yml b/epmet-module/open-data-worker/open-data-worker-server/deploy/docker-compose-prod.yml new file mode 100644 index 0000000000..75981232fc --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/deploy/docker-compose-prod.yml @@ -0,0 +1,18 @@ +version: "3.7" +services: + gov-voice-server: + container_name: open-data-worker-server-prod + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/open-data-worker-server:0.3.13 + ports: + - "8117:8117" + network_mode: host # 使用现有网络 + volumes: + - "/opt/epmet-cloud-logs/prod:/logs" + environment: + RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./open-data-worker.jar" + restart: "unless-stopped" + deploy: + resources: + limits: + cpus: '0.1' + memory: 600M diff --git a/epmet-module/open-data-worker/open-data-worker-server/deploy/docker-compose-test.yml b/epmet-module/open-data-worker/open-data-worker-server/deploy/docker-compose-test.yml new file mode 100644 index 0000000000..faa41dfeed --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/deploy/docker-compose-test.yml @@ -0,0 +1,18 @@ +version: "3.7" +services: + gov-voice-server: + container_name: open-data-worker-server-test + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/open-data-worker-server:version_placeholder + ports: + - "8107:8107" + network_mode: host # 使用现有网络 + volumes: + - "/opt/epmet-cloud-logs/test:/logs" + environment: + RUN_INSTRUCT: "java -Xms32m -Xmx300m -jar ./open-data-worker.jar" + restart: "unless-stopped" + deploy: + resources: + limits: + cpus: '0.1' + memory: 350M \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/pom.xml b/epmet-module/open-data-worker/open-data-worker-server/pom.xml new file mode 100644 index 0000000000..79a89eac66 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/pom.xml @@ -0,0 +1,283 @@ + + + 0.3.13 + + open-data-worker + com.epmet + 2.0.0 + + 4.0.0 + + open-data-worker-server + + + + com.epmet + epmet-commons-tools + 2.0.0 + + + com.epmet + epmet-commons-mybatis + 2.0.0 + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework + spring-context-support + + + org.springframework.boot + spring-boot-starter-actuator + + + de.codecentric + spring-boot-admin-starter-client + ${spring.boot.admin.version} + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + + + + io.github.openfeign + feign-httpclient + 10.3.0 + + + + + com.epmet + epmet-commons-rocketmq + 2.0.0 + + + + com.epmet + epmet-message-client + 2.0.0 + + + com.epmet + open-data-worker-client + 2.0.0 + compile + + + com.epmet + epmet-user-client + 2.0.0 + compile + + + com.epmet + data-statistical-client + 2.0.0 + compile + + + + + ${project.artifactId} + + + org.springframework.boot + spring-boot-maven-plugin + + + org.apache.maven.plugins + maven-surefire-plugin + + true + + + + ${project.basedir}/src/main/java + + + true + ${basedir}/src/main/resources + + + + + + + dev + + 8117 + dev + + + + + + epmet_open_data_user + EpmEt-db-UsEr + + 0 + 192.168.1.140 + 6379 + 123456 + + true + 192.168.1.140:8848 + 1fecc730-5e6e-464c-aae9-7567944e7936 + + + false + + + true + + + false + + + https://oapi.dingtalk.com/robot/send?access_token=e894e5690f9d6a527722974c71548ff6c0fe29bd956589a09e21b16442a35ed4 + SECfcc020bdc83bb17a2c00f39977b1fbc409ef4188c7beaea11c5caa90eeaf87fd + + + true + 192.168.1.140:9876;192.168.1.141:9876 + + + + local + + true + + + 8117 + local + + + + + + epmet_open_data_user + EpmEt-db-UsEr + + 0 + 192.168.1.140 + 6379 + 123456 + + false + 192.168.1.140:8848 + 1fecc730-5e6e-464c-aae9-7567944e7936 + + + false + + + false + + + false + + + https://oapi.dingtalk.com/robot/send?access_token=e894e5690f9d6a527722974c71548ff6c0fe29bd956589a09e21b16442a35ed4 + SECfcc020bdc83bb17a2c00f39977b1fbc409ef4188c7beaea11c5caa90eeaf87fd + + + false + 192.168.1.140:9876;192.168.1.141:9876 + + + + test + + + 8117 + test + + + + + + epmet + elink@833066 + + 0 + r-m5eoz5b6tkx09y6bpz.redis.rds.aliyuncs.com + 6379 + EpmEtrEdIs!q@w + + true + 192.168.10.150:8848 + 67e3c350-533e-4d7c-9f8f-faf1b4aa82ae + + + false + + + true + + + true + + + https://oapi.dingtalk.com/robot/send?access_token=e894e5690f9d6a527722974c71548ff6c0fe29bd956589a09e21b16442a35ed4 + SECfcc020bdc83bb17a2c00f39977b1fbc409ef4188c7beaea11c5caa90eeaf87fd + + + true + 192.168.10.161:9876 + + + + prod + + 8117 + prod + + + + + + epmet_open_data_user + EpmEt-db-UsEr + + 0 + r-m5ez3n1j0qc3ykq2ut.redis.rds.aliyuncs.com + 6379 + EpmEtclOUdrEdIs!Q2w + + true + 192.168.11.180:8848 + bd205d23-e696-47be-b995-916313f86e99 + + + false + + + true + + + true + + + https://oapi.dingtalk.com/robot/send?access_token=a5f66c3374b1642fe2142dbf56d5997e280172d4e8f2b546c9423a68c82ece6c + SEC95f4f40b533ad379ea6a6d1af6dd37029383cfe1b7cd96dfac2678be2c1c3ed1 + + + true + 192.168.11.187:9876;192.168.11.184:9876 + + + + + diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/OpenDataApplication.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/OpenDataApplication.java new file mode 100644 index 0000000000..532877cf4b --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/OpenDataApplication.java @@ -0,0 +1,26 @@ +package com.epmet; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.web.servlet.ServletComponentScan; +import org.springframework.cloud.client.discovery.EnableDiscoveryClient; +import org.springframework.cloud.openfeign.EnableFeignClients; +import org.springframework.context.annotation.ComponentScan; + +/** + * @Description OpenData服务启动类 + * 注意:此处要使用@ComponentScan的原因是,启动类处于包com.epmet.opendata下,想用com.epmet.commons包下的一些Spring对象,需要 + * 手动指定扫描包,否则无法扫描 + * @author wxz + * @date 2021.10.13 15:16:05 +*/ +@SpringBootApplication +@EnableDiscoveryClient +@EnableFeignClients +@ServletComponentScan +//@ComponentScan(value = { "com.epmet" }) +public class OpenDataApplication { + public static void main(String[] args) { + SpringApplication.run(OpenDataApplication.class, args); + } +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/aspect/RequestLogAspect.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/aspect/RequestLogAspect.java new file mode 100644 index 0000000000..506c00da2d --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/aspect/RequestLogAspect.java @@ -0,0 +1,40 @@ +package com.epmet.opendata.aspect; + +import com.epmet.commons.tools.aspect.BaseRequestLogAspect; +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; +import org.springframework.core.annotation.Order; +import org.springframework.stereotype.Component; +import org.springframework.web.context.request.RequestAttributes; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.servlet.http.HttpServletRequest; + +/** + * 日志/异常处理切面实现,调用父类方法完成日志记录和异常处理。 + */ +@Aspect +@Component +@Order(0) +public class RequestLogAspect extends BaseRequestLogAspect { + + @Override + @Around(value = "execution(* com.epmet.opendata.controller.*Controller*.*(..)) ") + public Object proceed(ProceedingJoinPoint point) throws Throwable { + return super.proceed(point, getRequest()); + } + + /** + * 获取Request对象 + * + * @return + */ + private HttpServletRequest getRequest() { + RequestAttributes ra = RequestContextHolder.getRequestAttributes(); + ServletRequestAttributes sra = (ServletRequestAttributes) ra; + return sra.getRequest(); + } + +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/config/ModuleConfigImpl.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/config/ModuleConfigImpl.java new file mode 100644 index 0000000000..802c020918 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/config/ModuleConfigImpl.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.epmet.opendata.config; + +import com.epmet.commons.tools.config.ModuleConfig; +import org.springframework.stereotype.Service; + +/** + * 模块配置信息 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Service +public class ModuleConfigImpl implements ModuleConfig { + @Override + public String getName() { + return "govvoice"; + } +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/config/NacosServiceListListenerRegisterer.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/config/NacosServiceListListenerRegisterer.java new file mode 100644 index 0000000000..a25220cbfb --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/config/NacosServiceListListenerRegisterer.java @@ -0,0 +1,161 @@ +package com.epmet.opendata.config; + +import com.alibaba.cloud.nacos.NacosDiscoveryProperties; +import com.alibaba.nacos.api.exception.NacosException; +import com.alibaba.nacos.api.naming.NamingService; +import com.alibaba.nacos.api.naming.listener.Event; +import com.alibaba.nacos.api.naming.listener.EventListener; +import com.alibaba.nacos.api.naming.listener.NamingEvent; +import com.alibaba.nacos.api.naming.pojo.ListView; +import com.epmet.commons.tools.exception.ExceptionUtils; +import com.netflix.loadbalancer.DynamicServerListLoadBalancer; +import com.netflix.loadbalancer.ILoadBalancer; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.cloud.netflix.ribbon.SpringClientFactory; +import org.springframework.context.annotation.Configuration; + +import javax.annotation.PostConstruct; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.*; + +/** + * @author wxz + * @Description Nacos服务列表刷新监听注册器 + * @date 2021.09.22 14:33:11 + */ +@Slf4j +@Configuration +@ConditionalOnProperty(prefix = "spring.cloud.nacos.discovery.serviceListChangedListening", name = "enable", havingValue = "true", matchIfMissing = false) +public class NacosServiceListListenerRegisterer { + + public static final String REFRESH_SERVER_LIST_METHOD_NAME = "restOfInit"; + // 服务列表拉取间隔:10s + public static final long SERVICE_LIST_PULLING_DELAY_SECONDS = 10; + + private NamingService namingService; + + private ScheduledExecutorService executor; + + @Autowired + private NacosDiscoveryProperties discoveryProperties; + + @Autowired + private SpringClientFactory springClientFactory; + + // 监听中的服务列表 + private List observingServers = new ArrayList<>(33); + + @PostConstruct + public void init() { + namingService = discoveryProperties.namingServiceInstance(); + // 启动监听 + executor = new ScheduledThreadPoolExecutor(2, new ThreadFactory() { + @Override + public Thread newThread(Runnable r) { + Thread thread = new Thread(r); + thread.setDaemon(true); + thread.setName("NacosServiceListWatchingRegisterer"); + return thread; + } + }); + + // 立即启动,并15s刷新一次服务列表,用于新服务列表的发现 + ScheduledFuture future = executor.scheduleAtFixedRate(new EpmetNacosServiceListListener(), 0, SERVICE_LIST_PULLING_DELAY_SECONDS, TimeUnit.SECONDS); + } + + public class EpmetNacosServiceListListener implements Runnable { + + @Override + public void run() { + doRefreshServerList(); + } + + /** + * @param + * @return + * @description 执行刷新 + * @author wxz + * @date 2021.09.22 16:04:49 + */ + private synchronized void doRefreshServerList() { + ListView serviceListView = null; + try { + serviceListView = namingService.getServicesOfServer(1, 100); + //启动监听 + if (serviceListView == null || serviceListView.getCount() == 0) { + log.info("【Nacos服务列表定时刷新】当前无任何可添加监听的服务"); + return; + } + List serviceList = serviceListView.getData(); + log.info("【Nacos服务列表定时刷新】Nacos服务端服务列表: {}", serviceList); + + for (String service : serviceList) { + try { + + // 如果该服务已经在监听列表中存在了,则不再注册监听。注:不能取消空服务的监听,因为空服务随时可能恢复运行,需要实时监听。 + if (observingServers.contains(service)) { + continue; + } + + namingService.subscribe(service, new EventListener() { + @Override + public void onEvent(Event event) { + if (event instanceof NamingEvent) { + NamingEvent namingEvent = (NamingEvent) event; + log.info("【Nacos服务列表刷新监听】收到事件:{}:[{}]", namingEvent.getServiceName(), namingEvent.getInstances()); + doRefreshServerList(service); + } + } + }); + + // 将该服务加入到监听列表中 + observingServers.add(service); + } catch (NacosException e) { + String errorStackTrace = ExceptionUtils.getErrorStackTrace(e); + log.error("【Nacos服务列表定时刷新】订阅ApplicationContext的刷新事件失败,错误信息:{}", errorStackTrace); + } + } + + } catch (NacosException e) { + String errorStackTrace = ExceptionUtils.getErrorStackTrace(e); + log.error("【Nacos服务列表定时刷新】链接Nacos服务端失败,错误信息:{}", errorStackTrace); + } + } + + /** + * @param serviceName + * @return + * @description 刷新ServerList + * @author wxz + * @date 2021.09.22 09:29:16 + */ + private void doRefreshServerList(String serviceName) { + // 刷新方式1:反射调用DynamicServerListLoadBalancer中的restOfInit()方法。该方法原来只执行一次,此处不推荐用 + //ILoadBalancer loadBalancer = springClientFactory.getLoadBalancer(serviceName); + //if (loadBalancer instanceof ZoneAwareLoadBalancer) { + // ZoneAwareLoadBalancer zaLoadBalancer = (ZoneAwareLoadBalancer) loadBalancer; + // IClientConfig clientConfig = springClientFactory.getClientConfig(serviceName); + // try { + // Method restOfInitMethod = zaLoadBalancer.getClass().getSuperclass().getDeclaredMethod(REFRESH_SERVER_LIST_METHOD_NAME, IClientConfig.class); + // restOfInitMethod.setAccessible(true); + // restOfInitMethod.invoke(zaLoadBalancer, clientConfig); + // } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) { + // String errorStackTrace = ExceptionUtils.getErrorStackTrace(e); + // log.error("【LoadBalancer刷新服务列表】失败:{}", errorStackTrace); + // } + //} + + // 刷新方式2:DynamicServerListLoadBalancer#updateListOfServers()该方法为ribbon定时刷新服务列表的时候真正调用的方法,但是加了@VisibleForTesting + // 暂且 1 try + ILoadBalancer loadBalancer = springClientFactory.getLoadBalancer(serviceName); + if (loadBalancer instanceof DynamicServerListLoadBalancer) { + DynamicServerListLoadBalancer dslb = (DynamicServerListLoadBalancer) loadBalancer; + dslb.updateListOfServers(); + } + } + } + +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/BaseDisputeProcessController.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/BaseDisputeProcessController.java new file mode 100644 index 0000000000..038756ea9c --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/BaseDisputeProcessController.java @@ -0,0 +1,56 @@ +/** + * 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.opendata.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.basereport.form.EventInfoFormDTO; +import com.epmet.opendata.service.BaseDisputeProcessService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + + +/** + * 事件信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-15 + */ +@RestController +@RequestMapping("basedisputeprocess") +public class BaseDisputeProcessController { + + @Autowired + private BaseDisputeProcessService baseDisputeProcessService; + + /** + * 获取上报事件 + * @Param formDTO + * @Return {@link Result} + * @Author zhaoqifeng + * @Date 2021/10/15 16:59 + */ + @PostMapping("eventinfo") + public Result getEventinfo(@RequestBody(required = false) EventInfoFormDTO formDTO) { + baseDisputeProcessService.getEventinfo(formDTO); + return new Result(); + } + +} \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/ExDeptController.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/ExDeptController.java new file mode 100644 index 0000000000..46104d1c30 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/ExDeptController.java @@ -0,0 +1,67 @@ +/** + * 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.opendata.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.opendata.dto.form.ExDeptFormDTO; +import com.epmet.opendata.service.ExDeptService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + + +/** + * 网格基础信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-15 + */ +@RestController +@RequestMapping("exdept") +public class ExDeptController { + + @Autowired + private ExDeptService exDeptService; + + + /** + * @Author sun + * @Description 组织基础信息中间库同步 + **/ + @PostMapping("agencybaseinfo") + public Result getAgencyBaseInfo(@RequestBody(required = false) ExDeptFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, ExDeptFormDTO.Grid.class); + exDeptService.getAgencyBaseInfo(formDTO); + return new Result(); + } + + /** + * @Author sun + * @Description 网格基础信息中间库同步 + **/ + @PostMapping("gridbaseinfo") + public Result getGridBaseInfo(@RequestBody(required = false) ExDeptFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, ExDeptFormDTO.Grid.class); + exDeptService.getGridBaseInfo(formDTO); + return new Result(); + } + +} \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/ExUserController.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/ExUserController.java new file mode 100644 index 0000000000..08618448ab --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/ExUserController.java @@ -0,0 +1,56 @@ +/** + * 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.opendata.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.opendata.dto.form.StaffBaseInfoFormDTO; +import com.epmet.opendata.service.ExUserService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + + +/** + * 网格员基础信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-15 + */ +@RestController +@RequestMapping("exuser") +public class ExUserController { + + @Autowired + private ExUserService exUserService; + + /** + * @Author sun + * @Description 网格员信息中间库同步 + **/ + @PostMapping("staffbaseinfo") + public Result getStaffBaseInfo(@RequestBody(required = false) StaffBaseInfoFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, StaffBaseInfoFormDTO.Staff.class); + exUserService.getStaffBaseInfo(formDTO); + return new Result(); + } + + +} \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/InitDataController.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/InitDataController.java new file mode 100644 index 0000000000..38fe35fd15 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/InitDataController.java @@ -0,0 +1,52 @@ +/** + * 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.opendata.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.constant.SystemMessageType; +import com.epmet.opendata.dto.form.UpsertPatrolRecordForm; +import com.epmet.opendata.service.UserPatrolRecordService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + + +/** + * 中间库数据初始化controller + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-14 + */ +@RestController +@RequestMapping("init") +public class InitDataController { + + @Autowired + private UserPatrolRecordService userPatrolRecordService; + + /** + * @Author sun + * @Description 网格员信息中间库同步 + **/ + @PostMapping("patrol/{customerId}") + public Result reloadPatrolData(@PathVariable String customerId) { + return new Result().ok(userPatrolRecordService.reloadPatrolData(customerId)); + } +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/UserPatrolRecordController.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/UserPatrolRecordController.java new file mode 100644 index 0000000000..fb2334e8df --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/UserPatrolRecordController.java @@ -0,0 +1,54 @@ +/** + * 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.opendata.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.opendata.dto.form.UpsertPatrolRecordForm; +import com.epmet.opendata.service.UserPatrolRecordService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + + +/** + * 用户巡查主记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-14 + */ +@RestController +@RequestMapping("userpatrolrecord") +public class UserPatrolRecordController { + + @Autowired + private UserPatrolRecordService userPatrolRecordService; + + /** + * @Author sun + * @Description 网格员信息中间库同步 + **/ + @PostMapping("patrol") + public Result getStaffBaseInfo(@RequestBody(required = false) UpsertPatrolRecordForm formDTO) { + ValidatorUtils.validateEntity(formDTO); + userPatrolRecordService.insertPatrolRecord(formDTO); + return new Result(); + } +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/BaseConflictsResolveDao.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/BaseConflictsResolveDao.java new file mode 100644 index 0000000000..29be2a6c23 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/BaseConflictsResolveDao.java @@ -0,0 +1,33 @@ +/** + * 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.opendata.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.opendata.entity.BaseConflictsResolveEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 事件中间表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-22 + */ +@Mapper +public interface BaseConflictsResolveDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/BaseDisputeProcessDao.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/BaseDisputeProcessDao.java new file mode 100644 index 0000000000..c7b8df45d9 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/BaseDisputeProcessDao.java @@ -0,0 +1,33 @@ +/** + * 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.opendata.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.opendata.entity.BaseDisputeProcessEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 事件信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-15 + */ +@Mapper +public interface BaseDisputeProcessDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/ExDeptDao.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/ExDeptDao.java new file mode 100644 index 0000000000..50bf35b537 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/ExDeptDao.java @@ -0,0 +1,54 @@ +/** + * 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.opendata.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.opendata.entity.ExDeptEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 网格基础信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-15 + */ +@Mapper +public interface ExDeptDao extends BaseDao { + + /** + * @Author sun + * @Description 网格基础信息批量更新部分字段 + **/ + int updateBatch(@Param("list") List entityList); + + /** + * @Author sun + * @Description 网格基础信息批量更新部分字段 + **/ + int insertBatch(@Param("list") List entityList); + + /** + * @Author sun + * @Description 网格基础信息批量更新部分字段 + **/ + int updateBatchGrid(@Param("list") List entityList); + +} \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/ExUserDao.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/ExUserDao.java new file mode 100644 index 0000000000..ad1c407eaf --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/ExUserDao.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.opendata.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.opendata.entity.ExUserEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 系统用户中间表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-22 + */ +@Mapper +public interface ExUserDao extends BaseDao { + + /** + * @Author sun + * @Description 网格员基础信息批量更新部分字段 + **/ + void updateBatch(@Param("list") List entityList); + +} \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/UserPatrolDetailDao.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/UserPatrolDetailDao.java new file mode 100644 index 0000000000..57fb4edc6d --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/UserPatrolDetailDao.java @@ -0,0 +1,33 @@ +/** + * 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.opendata.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.opendata.entity.UserPatrolDetailEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 工作人员巡查记录明细 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-14 + */ +@Mapper +public interface UserPatrolDetailDao extends BaseDao { + +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/UserPatrolRecordDao.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/UserPatrolRecordDao.java new file mode 100644 index 0000000000..7c40b093a3 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/UserPatrolRecordDao.java @@ -0,0 +1,33 @@ +/** + * 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.opendata.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.opendata.entity.UserPatrolRecordEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 用户巡查主记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-14 + */ +@Mapper +public interface UserPatrolRecordDao extends BaseDao { + +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/BaseConflictsResolveEntity.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/BaseConflictsResolveEntity.java new file mode 100644 index 0000000000..d40e74bb70 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/BaseConflictsResolveEntity.java @@ -0,0 +1,213 @@ +/** + * 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.opendata.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 事件中间表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("base_conflicts_resolve") +public class BaseConflictsResolveEntity{ + + private static final long serialVersionUID = 1L; + + /** + * 事件ID + */ + private String id; + private String customerId; + /** + * 事件所属网格ID + */ + private Integer gridId; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 事件名称 + */ + private String eventName; + + /** + * 发生日期 + */ + private Date happenDate; + + /** + * 发生地点 + */ + private String happenPlace; + + /** + * 事件规模 + */ + private String eventScale; + + /** + * 涉及人数 + */ + private Integer numberInvolved; + + /** + * 事件简述 + */ + private String eventDescription; + + /** + * 涉及单位 + */ + private String relatedUnits; + + /** + * 主要当事人证件代码 + */ + private String identificationCode; + + /** + * 主要当事人证件号码 + */ + private String idCard; + + /** + * 主要当事人姓名 + */ + private String name; + + /** + * 主要当事人性别 + */ + private String sex; + + /** + * 主要当事人民族 + */ + private String nation; + + /** + * 主要当事人学历 + */ + private String education; + + /** + * 主要当事人人员类别(二级) + */ + private String personnelCategory; + + /** + * 主要当事人居住详址 + */ + private String detailAddress; + + /** + * 是否解决或化解(Y已解决N未解决) + */ + private String successfulOrNot; + + /** + * 经度 + */ + private String lng; + + /** + * 纬度 + */ + private String lat; + + /** + * 创建人 + */ + private String createBy; + + /** + * 创建时间 + */ + private Date createDate; + + /** + * 修改人 + */ + private String updateBy; + + /** + * 修改时间 + */ + private Date updateDate; + + /** + * 事件所属网格ID状态(01:待办理,02:待核实,03:办结) + */ + private String status; + + /** + * 事件编号(自定义编号,可以加前缀如:py) + */ + private String eventNo; + + /** + * 采集来源(01:App,02:Web) + */ + private String source; + + /** + * 事件类别(一级) + */ + private String firstEventCategory; + + /** + * 事件类别(二级) + */ + private String secondEventCategory; + + /** + * 主要当事人人员类别(一级) + */ + private String firstPersonnelCategory; + + /** + * 办结方式(状态是办结的时候,才填) + */ + private String resolveWay; + + /** + * 办结层级(状态是办结的时候,才填) + */ + private String resolveGridLevel; + + /** + * 办结时间(状态是办结的时候,才填) + */ + private Date resolveTime; + + /** + * 同步状态 0 未同步, 1 已同步 + */ + private String flag; +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/BaseDisputeProcessEntity.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/BaseDisputeProcessEntity.java new file mode 100644 index 0000000000..979919af85 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/BaseDisputeProcessEntity.java @@ -0,0 +1,180 @@ +/** + * 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.opendata.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 事件信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-15 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("base_dispute_process") +public class BaseDisputeProcessEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + private Integer detpId; + + private String reporterId; + + /** + * 网格编码 + */ + private String orgCode; + + /** + * 网格名称 + */ + private String orgName; + + /** + * 事件名称 + */ + private String eventName; + + /** + * 事件类别 + */ + private String eventCategory; + + /** + * 上报时间 YYYY-MM-DD HH:MM:SS + */ + private Date reportTime; + + /** + * 发生时间 格式为“YYYY-MM-DD” + */ + private Date happenDate; + + /** + * 发生地点 + */ + private String happenPlace; + + /** + * 事件简述 + */ + private String eventDescription; + + /** + * 办结方式 01自办;02上报 源于居民端的最终结案的项目为02;工作端立项的项目最终结案的01 + */ + private String waysOfResolving; + + /** + * 是否办结 Y:是、N:否 + */ + private String successfulOrNo; + /** + * 办结层级 +01省、自治区、直辖市 +02地、市、州、盟 +03县、市、区、旗 +04乡镇、街道 +05片区 +06村、社区 +07网格 + + */ + private String completeLevel; + + /** + * 基础信息主键 + */ + private String baseInfoId; + + /** + * 办结时间 + */ + private Date completeTime; + + /** + * 经度 + */ + private BigDecimal lng; + + /** + * 纬度 + */ + private BigDecimal lat; + + /** + * 主要当事人姓名 + */ + private String name; + + /** + * 涉及人数 + */ + private Integer numberInvolved; + + /** + * 涉及单位 + */ + private String relatedUnits; + + /** + * 重点场所类别 01九小场所, 02公共场所 + */ + private String keyAreaType; + + /** + * 宗教活动规模 01 0-50人,02 51-200人,03 201人以上 + + */ + private String religionScale; + + /** + * 宗教类别 01道教 02佛教 03基督教 04伊斯兰教 05其他 + + */ + private String religionType; + + /** + * 重点场所是否变动 Y:是、N:否 + */ + private String isKeyareaState; + + /** + * 重点人员是否在当地 Y:是、N:否 + */ + private String isKeypeopleLocate; + + /** + * 重点人员现状 + */ + private String keypeopleStatus; + +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/ExDeptEntity.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/ExDeptEntity.java new file mode 100644 index 0000000000..d13b6d62fe --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/ExDeptEntity.java @@ -0,0 +1,97 @@ +/** + * 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.opendata.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 部门(网格)中间表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ex_dept") +public class ExDeptEntity { + + private static final long serialVersionUID = 1L; + + /** + * (市平台)部门id + */ + private Integer deptId; + + /** + * (市平台)父部门id + */ + private Integer parentId; + + /** + * 祖级列表 + */ + private String ancestors; + + /** + * (市平台)部门/网格名称 + */ + private String fullName; + + /** + * (市平台)部门/网格简称 + */ + private String deptName; + + /** + * (市平台)部门/网格编码 + */ + private String deptCode; + + /** + * (省标准)区划编码/网格编码 + */ + private String gridCode; + + /** + * 组织类型 + */ + private String isCgorg; + + /** + * (区县平台)部门id + */ + private String qxDeptId; + + /** + * (区县平台)部门/网格名称 + */ + private String qxDeptCode; + + /** + * (区县平台)部门/网格名称 + */ + private String qxDeptName; + + /** + * (区县平台)客户Id + */ + private String qxCustomerId; + +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/ExUserEntity.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/ExUserEntity.java new file mode 100644 index 0000000000..d5f2c3f968 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/ExUserEntity.java @@ -0,0 +1,83 @@ +/** + * 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.opendata.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 系统用户中间表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-22 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ex_user") +public class ExUserEntity { + + private static final long serialVersionUID = 1L; + + /** + * 市平台 用户ID + */ + private Integer userId; + + /** + * 市平台 用户名 + */ + private String userName; + + /** + * 市平台 登录账号 + */ + private String loginName; + + /** + * (市平台)所属区县、街道、村居或网格id + */ + private String gridId; + + /** + * (市平台)所属部门id + */ + private String deptId; + + /** + * (区县平台)用户id + */ + private String qxUserId; + + /** + * (区县平台)姓名/用户名称 + */ + private String qxUserName; + + /** + * (区县平台)手机号码 + */ + private String qxMobile; + + /** + * (区县平台)客户Id + */ + private String qxCustomerId; + + +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/UserPatrolDetailEntity.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/UserPatrolDetailEntity.java new file mode 100644 index 0000000000..470c316e53 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/UserPatrolDetailEntity.java @@ -0,0 +1,61 @@ +/** + * 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.opendata.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +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 2021-10-14 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("user_patrol_detail") +public class UserPatrolDetailEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * staff_patrol_record.ID + */ + private String staffPatrolRecId; + + /** + * 路线 + */ + private String route; + + /** + * 是否已删除(0-未删除,1-已删除) + */ + @TableField(fill = FieldFill.INSERT) + private String delFlag; + +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/UserPatrolRecordEntity.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/UserPatrolRecordEntity.java new file mode 100644 index 0000000000..e068a9d80a --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/UserPatrolRecordEntity.java @@ -0,0 +1,113 @@ +/** + * 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.opendata.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 用户巡查主记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-14 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("user_patrol_record") +public class UserPatrolRecordEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 网格id + */ + private String grid; + + /** + * 网格所有上级id + */ + private String gridPids; + + /** + * 用户id + */ + private String staffId; + + /** + * 工作人员所属组织id=网格所属的组织id + */ + private String agencyId; + + /** + * 巡查开始时间 + */ + private Date patrolStartTime; + + /** + * 巡查结束时间 + */ + private Date patrolEndTime; + + /** + * 实际结束时间 + */ + private Date actrualEndTime; + + /** + * 巡查开始地点 + */ + private String startLocation; + + /** + * 巡查结束地点 + */ + private String endLocation; + + /** + * 本次巡查总耗时,单位秒 + */ + private Integer totalTime; + + /** + * 巡查距离,单位米 + */ + private Integer distance; + + /** + * 正在巡查中:patrolling;结束:end + */ + private String status; + + /** + * 是否已删除(0-未删除,1-已删除) + */ + @TableField(fill = FieldFill.INSERT) + private String delFlag; + +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/healthcheck/HealthCheckController.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/healthcheck/HealthCheckController.java new file mode 100644 index 0000000000..0a6b1d6264 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/healthcheck/HealthCheckController.java @@ -0,0 +1,21 @@ +package com.epmet.opendata.healthcheck; + +import com.epmet.commons.tools.utils.Result; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("healthcheck") +public class HealthCheckController { + + /** + * http健康检查 + * @return + */ + @PostMapping("http") + public Result httpHealthCheck() { + return new Result(); + } + +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/RocketMQConsumerRegister.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/RocketMQConsumerRegister.java new file mode 100644 index 0000000000..dc02f0498a --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/RocketMQConsumerRegister.java @@ -0,0 +1,60 @@ +package com.epmet.opendata.mq; + +import com.epmet.commons.rocketmq.constants.ConsomerGroupConstants; +import com.epmet.commons.rocketmq.constants.TopicConstants; +import com.epmet.commons.rocketmq.register.MQAbstractRegister; +import com.epmet.commons.rocketmq.register.MQConsumerProperties; +import com.epmet.commons.tools.distributedlock.DistributedLock; +import com.epmet.opendata.mq.listener.OpenDataOrgChangeEventListener; +import com.epmet.opendata.mq.listener.OpenDataPatrolChangeEventListener; +import com.epmet.opendata.mq.listener.OpenDataProjectChangeEventListener; +import com.epmet.opendata.mq.listener.OpenDataStaffChangeEventListener; +import org.apache.rocketmq.common.protocol.heartbeat.MessageModel; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * @Description 如果rocketmq.enable=true,这里必须实现,且 实例化 + * @author wxz + * @date 2021.07.14 17:13:41 +*/ +@Component +public class RocketMQConsumerRegister extends MQAbstractRegister { + + @Autowired + private DistributedLock distributedLock; + + @Override + public void registerAllListeners(String env, MQConsumerProperties consumerProperties) { + + // 客户初始化监听器注册 + register(consumerProperties, + ConsomerGroupConstants.OPEN_DATA_ORG_CHANGE_EVENT_LISTENER_GROUP, + MessageModel.CLUSTERING, + TopicConstants.ORG, + "*", + new OpenDataOrgChangeEventListener(distributedLock)); + + register(consumerProperties, + ConsomerGroupConstants.OPEN_DATA_STAFF_CHANGE_EVENT_LISTENER_GROUP, + MessageModel.CLUSTERING, + TopicConstants.STAFF, + "*", + new OpenDataStaffChangeEventListener(distributedLock)); + + register(consumerProperties, + ConsomerGroupConstants.OPEN_DATA_PATROL_CHANGE_EVENT_LISTENER_GROUP, + MessageModel.CLUSTERING, + TopicConstants.PATROL, + "*", + new OpenDataPatrolChangeEventListener(distributedLock)); + register(consumerProperties, + ConsomerGroupConstants.OPEN_DATA_PROJECT_CHANGE_EVENT_LISTENER_GROUP, + MessageModel.CLUSTERING, + TopicConstants.PROJECT, + "*", + new OpenDataProjectChangeEventListener(distributedLock)); + + // ...其他监听器类似 + } +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataOrgChangeEventListener.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataOrgChangeEventListener.java new file mode 100644 index 0000000000..7c0989aa64 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataOrgChangeEventListener.java @@ -0,0 +1,124 @@ +package com.epmet.opendata.mq.listener; + +import com.alibaba.fastjson.JSON; +import com.epmet.commons.rocketmq.constants.MQUserPropertys; +import com.epmet.commons.rocketmq.messages.OrgOrStaffMQMsg; +import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.distributedlock.DistributedLock; +import com.epmet.commons.tools.exception.ExceptionUtils; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.redis.RedisKeys; +import com.epmet.commons.tools.redis.RedisUtils; +import com.epmet.commons.tools.utils.SpringContextUtils; +import com.epmet.opendata.dto.form.ExDeptFormDTO; +import com.epmet.opendata.service.ExDeptService; +import org.apache.commons.lang.StringUtils; +import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext; +import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus; +import org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently; +import org.apache.rocketmq.common.message.MessageExt; +import org.redisson.api.RLock; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.TimeUnit; + +/** + * @Description 系统对接中间库,组织信息变更监听器 + * @author wxz + * @date 2021.10.13 15:21:48 +*/ +public class OpenDataOrgChangeEventListener implements MessageListenerConcurrently { + + private Logger logger = LoggerFactory.getLogger(getClass()); + + private RedisUtils redisUtils; + + private DistributedLock distributedLock; + + public OpenDataOrgChangeEventListener(DistributedLock distributedLock) { + this.distributedLock = distributedLock; + } + + + @Override + public ConsumeConcurrentlyStatus consumeMessage(List msgs, ConsumeConcurrentlyContext context) { + + if (redisUtils == null) { + redisUtils = SpringContextUtils.getBean(RedisUtils.class); + } + + try { + msgs.forEach(msg -> consumeMessage(msg)); + } catch (Exception e) { + logger.error(ExceptionUtils.getErrorStackTrace(e)); + return ConsumeConcurrentlyStatus.RECONSUME_LATER; + } + return ConsumeConcurrentlyStatus.CONSUME_SUCCESS; + } + + private void consumeMessage(MessageExt messageExt) { + // msg即为消息体 + // tags为SystemMessageType.java中的项,为具体的操作,此处拿到tags,判断是创建还是变更,来做响应的后续操作即可 + String msg = new String(messageExt.getBody()); + String topic = messageExt.getTopic(); + String tags = messageExt.getTags(); + String pendingMsgLabel = messageExt.getUserProperty(MQUserPropertys.BLOCKED_MSG_LABEL); + + logger.info("【开放数据事件监听器】-组织信息变更-收到消息内容:{},操作:{}", msg, tags); + OrgOrStaffMQMsg obj = JSON.parseObject(msg, OrgOrStaffMQMsg.class); + //只推送平阴数据 + if (!StrConstant.PY_CUSTOMER.equals(obj.getCustomerId())) { + return; + } + RLock lock = null; + try { + lock = distributedLock.getLock(String.format("lock:open_data_org:%s", obj.getOrgId()), + 30L, 30L, TimeUnit.SECONDS); + + ExDeptFormDTO dto = new ExDeptFormDTO(); + dto.setCustomerId(obj.getCustomerId()); + dto.setType(obj.getType()); + List orgIdList = new ArrayList<>(); + orgIdList.add(obj.getOrgId()); + if ("agency".equals(obj.getOrgType())) { + SpringContextUtils.getBean(ExDeptService.class).getAgencyBaseInfo(dto); + } else { + SpringContextUtils.getBean(ExDeptService.class).getGridBaseInfo(dto); + } + } catch (RenException e) { + // 如果是我们手动抛出的异常,说明在业务可控范围内。目前不需要MQ重试 + logger.error("【开放数据事件监听器】-组织信息变更-同步信息到中间库失败:".concat(ExceptionUtils.getErrorStackTrace(e))); + } catch (Exception e) { + // 不是我们自己抛出的异常,可以让MQ重试 + logger.error("【开放数据事件监听器】-组织信息变更-同步信息到中间库失败:".concat(ExceptionUtils.getErrorStackTrace(e))); + throw e; + } finally { + distributedLock.unLock(lock); + } + + if (StringUtils.isNotBlank(pendingMsgLabel)) { + try { + removePendingMqMsgCache(pendingMsgLabel); + } catch (Exception e) { + logger.error("【开放数据事件监听器】-删除mq阻塞消息缓存失败:{}", ExceptionUtils.getErrorStackTrace(e)); + } + } + } + + /** + * @description + * + * @param pendingMsgLabel + * @return + * @author wxz + * @date 2021.10.14 16:32:32 + */ + private void removePendingMqMsgCache(String pendingMsgLabel) { + String key = RedisKeys.blockedMqMsgKey(pendingMsgLabel); + redisUtils.delete(key); + //logger.info("【开放数据事件监听器】删除mq阻塞消息缓存成功,blockedMsgLabel:{}", pendingMsgLabel); + } +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataPatrolChangeEventListener.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataPatrolChangeEventListener.java new file mode 100644 index 0000000000..e7cd329b89 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataPatrolChangeEventListener.java @@ -0,0 +1,134 @@ +package com.epmet.opendata.mq.listener; + +import com.alibaba.fastjson.JSON; +import com.epmet.commons.rocketmq.constants.MQUserPropertys; +import com.epmet.commons.rocketmq.messages.StaffPatrolMQMsg; +import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.distributedlock.DistributedLock; +import com.epmet.commons.tools.exception.ExceptionUtils; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.redis.RedisKeys; +import com.epmet.commons.tools.redis.RedisUtils; +import com.epmet.commons.tools.utils.SpringContextUtils; +import com.epmet.constant.SystemMessageType; +import com.epmet.opendata.dto.form.UpsertPatrolRecordForm; +import com.epmet.opendata.service.UserPatrolRecordService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext; +import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus; +import org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently; +import org.apache.rocketmq.common.message.MessageExt; +import org.redisson.api.RLock; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.List; +import java.util.concurrent.TimeUnit; + +/** + * @author wxz + * @Description 系统对接中间库,巡查信息变更监听器 + * @date 2021.10.13 15:21:48 + */ +@Slf4j +public class OpenDataPatrolChangeEventListener implements MessageListenerConcurrently { + + private Logger logger = LoggerFactory.getLogger(getClass()); + + private RedisUtils redisUtils; + + private DistributedLock distributedLock; + + public OpenDataPatrolChangeEventListener(DistributedLock distributedLock) { + this.distributedLock = distributedLock; + } + + @Override + public ConsumeConcurrentlyStatus consumeMessage(List msgs, ConsumeConcurrentlyContext context) { + + if (redisUtils == null) { + redisUtils = SpringContextUtils.getBean(RedisUtils.class); + } + + try { + msgs.forEach(msg -> consumeMessage(msg)); + } catch (Exception e) { + logger.error(ExceptionUtils.getErrorStackTrace(e)); + return ConsumeConcurrentlyStatus.RECONSUME_LATER; + } + return ConsumeConcurrentlyStatus.CONSUME_SUCCESS; + } + + private void consumeMessage(MessageExt messageExt) { + // msg即为消息体 + // tags为SystemMessageType.java中的项,为具体的操作,此处拿到tags,判断是创建还是变更,来做响应的后续操作即可 + String msg = new String(messageExt.getBody()); + String topic = messageExt.getTopic(); + String tags = messageExt.getTags(); + String pendingMsgLabel = messageExt.getUserProperty(MQUserPropertys.BLOCKED_MSG_LABEL); + + logger.info("【开放数据事件监听器】-巡查记录信息变更-收到消息内容:{}, 操作:{}", msg, tags); + StaffPatrolMQMsg msgObj = JSON.parseObject(msg, StaffPatrolMQMsg.class); + //只推送平阴数据 + if (!StrConstant.PY_CUSTOMER.equals(msgObj.getCustomerId())) { + return; + } + if (msgObj == null) { + log.warn("consumeMessage msg body is blank"); + return; + } + RLock lock = null; + try { + lock = distributedLock.getLock(String.format("lock:open_data_patrol:%s", msgObj.getPatrolId()), + 30L, 30L, TimeUnit.SECONDS); + UpsertPatrolRecordForm patrolRecordForm = new UpsertPatrolRecordForm(); + patrolRecordForm.setCustomerId(msgObj.getCustomerId()); + patrolRecordForm.setPatrolId(msgObj.getPatrolId()); + patrolRecordForm.setActionType(tags); + Boolean aBoolean = false; + switch (tags) { + case SystemMessageType.USER_PATROL_START: + aBoolean = SpringContextUtils.getBean(UserPatrolRecordService.class).insertPatrolRecord(patrolRecordForm); + break; + case SystemMessageType.USER_PATROL_STOP: + aBoolean = SpringContextUtils.getBean(UserPatrolRecordService.class).updatePatrolRecord(patrolRecordForm); + break; + default: + log.error("错误的消息类型:{}", tags); + + } + + } catch (RenException e) { + // 如果是我们手动抛出的异常,说明在业务可控范围内。目前不需要MQ重试 + logger.error("【开放数据事件监听器】-巡查记录信息变更-失败:".concat(ExceptionUtils.getErrorStackTrace(e))); + } catch (Exception e) { + // 不是我们自己抛出的异常,可以让MQ重试 + logger.error("【开放数据事件监听器】-巡查记录信息变更-失败:".concat(ExceptionUtils.getErrorStackTrace(e))); + throw e; + } finally { + distributedLock.unLock(lock); + } + + if (StringUtils.isNotBlank(pendingMsgLabel)) { + try { + removePendingMqMsgCache(pendingMsgLabel); + } catch (Exception e) { + logger.error("【开放数据事件监听器】-巡查-删除mq阻塞消息缓存失败:{}", ExceptionUtils.getErrorStackTrace(e)); + } + } + } + + /** + * @param pendingMsgLabel + * @return + * @description + * @author wxz + * @date 2021.10.14 16:32:32 + */ + private void removePendingMqMsgCache(String pendingMsgLabel) { + String key = RedisKeys.blockedMqMsgKey(pendingMsgLabel); + redisUtils.delete(key); + //logger.info("【开放数据事件监听器】删除mq阻塞消息缓存成功,blockedMsgLabel:{}", pendingMsgLabel); + } +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataProjectChangeEventListener.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataProjectChangeEventListener.java new file mode 100644 index 0000000000..d3b65b6942 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataProjectChangeEventListener.java @@ -0,0 +1,120 @@ +package com.epmet.opendata.mq.listener; + +import com.alibaba.fastjson.JSON; +import com.epmet.commons.rocketmq.constants.MQUserPropertys; +import com.epmet.commons.rocketmq.messages.DisputeProcessMQMsg; +import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.distributedlock.DistributedLock; +import com.epmet.commons.tools.exception.ExceptionUtils; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.redis.RedisKeys; +import com.epmet.commons.tools.redis.RedisUtils; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.SpringContextUtils; +import com.epmet.dto.basereport.form.EventInfoFormDTO; +import com.epmet.feign.EpmetMessageOpenFeignClient; +import com.epmet.opendata.service.BaseDisputeProcessService; +import org.apache.commons.lang3.StringUtils; +import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext; +import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus; +import org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently; +import org.apache.rocketmq.common.message.MessageExt; +import org.redisson.api.RLock; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.List; +import java.util.concurrent.TimeUnit; + +/** + * @author wxz + * @Description 系统对接中间库,项目信息变更监听器 + * @date 2021.10.13 15:21:48 + */ +public class OpenDataProjectChangeEventListener implements MessageListenerConcurrently { + + private Logger logger = LoggerFactory.getLogger(getClass()); + + private EpmetMessageOpenFeignClient messageOpenFeignClient; + + private RedisUtils redisUtils; + + private DistributedLock distributedLock; + + public OpenDataProjectChangeEventListener(DistributedLock distributedLock) { + this.distributedLock = distributedLock; + } + + @Override + public ConsumeConcurrentlyStatus consumeMessage(List msgs, ConsumeConcurrentlyContext context) { + + if (redisUtils == null) { + redisUtils = SpringContextUtils.getBean(RedisUtils.class); + } + + try { + msgs.forEach(msg -> consumeMessage(msg)); + } catch (Exception e) { + logger.error(ExceptionUtils.getErrorStackTrace(e)); + return ConsumeConcurrentlyStatus.RECONSUME_LATER; + } + return ConsumeConcurrentlyStatus.CONSUME_SUCCESS; + } + + private void consumeMessage(MessageExt messageExt) { + // msg即为消息体 + // tags为SystemMessageType.java中的项,为具体的操作,此处拿到tags,判断是创建还是变更,来做响应的后续操作即可 + String msg = new String(messageExt.getBody()); + String topic = messageExt.getTopic(); + String tags = messageExt.getTags(); + String pendingMsgLabel = messageExt.getUserProperty(MQUserPropertys.BLOCKED_MSG_LABEL); + + //messageExt.propert + + logger.info("【开放数据事件监听器】-项目信息变更-收到消息内容:{}, 操作:{}, pendingMsgLabel:{}", msg, tags, pendingMsgLabel); + DisputeProcessMQMsg obj = JSON.parseObject(msg, DisputeProcessMQMsg.class); + //只推送平阴数据 + if (!StrConstant.PY_CUSTOMER.equals(obj.getCustomerId())) { + return; + } + EventInfoFormDTO formDTO = ConvertUtils.sourceToTarget(obj, EventInfoFormDTO.class); + + RLock lock = null; + try { + lock = distributedLock.getLock(String.format("lock:open_data_project:%s", obj.getProjectId()), + 30L, 30L, TimeUnit.SECONDS); + SpringContextUtils.getBean(BaseDisputeProcessService.class).getEventinfo(formDTO); + } catch (RenException e) { + // 如果是我们手动抛出的异常,说明在业务可控范围内。目前不需要MQ重试 + logger.error("【开放数据事件监听器】-项目信息变更-上报项目信息失败:".concat(ExceptionUtils.getErrorStackTrace(e))); + } catch (Exception e) { + // 不是我们自己抛出的异常,可以让MQ重试 + logger.error("【开放数据事件监听器】-项目信息变更-上报项目信息失败:".concat(ExceptionUtils.getErrorStackTrace(e))); + throw e; + } finally { + distributedLock.unLock(lock); + } + + if (StringUtils.isNotBlank(pendingMsgLabel)) { + try { + removePendingMqMsgCache(pendingMsgLabel); + } catch (Exception e) { + logger.error("【开放数据事件监听器】-project-删除mq滞留消息缓存失败:{}", ExceptionUtils.getErrorStackTrace(e)); + } + } + } + + /** + * @description + * + * @param pendingMsgLabel + * @return + * @description 应答mq消息 + * @author wxz + * @date 2021.10.14 16:32:32 + */ + private void removePendingMqMsgCache(String pendingMsgLabel) { + String key = RedisKeys.blockedMqMsgKey(pendingMsgLabel); + redisUtils.delete(key); + } +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataStaffChangeEventListener.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataStaffChangeEventListener.java new file mode 100644 index 0000000000..a5ab105ada --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataStaffChangeEventListener.java @@ -0,0 +1,125 @@ +package com.epmet.opendata.mq.listener; + +import com.alibaba.fastjson.JSON; +import com.epmet.commons.rocketmq.constants.MQUserPropertys; +import com.epmet.commons.rocketmq.messages.OrgOrStaffMQMsg; +import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.distributedlock.DistributedLock; +import com.epmet.commons.tools.exception.ExceptionUtils; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.redis.RedisKeys; +import com.epmet.commons.tools.redis.RedisUtils; +import com.epmet.commons.tools.utils.SpringContextUtils; +import com.epmet.feign.EpmetMessageOpenFeignClient; +import com.epmet.opendata.dto.form.StaffBaseInfoFormDTO; +import com.epmet.opendata.service.ExUserService; +import org.apache.commons.lang3.StringUtils; +import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext; +import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus; +import org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently; +import org.apache.rocketmq.common.message.MessageExt; +import org.redisson.api.RLock; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.TimeUnit; + +/** + * @author wxz + * @Description 系统对接中间库,工作人员信息变更监听器 + * @date 2021.10.13 15:21:48 + */ +public class OpenDataStaffChangeEventListener implements MessageListenerConcurrently { + + private Logger logger = LoggerFactory.getLogger(getClass()); + + private EpmetMessageOpenFeignClient messageOpenFeignClient; + + private RedisUtils redisUtils; + + private DistributedLock distributedLock; + + public OpenDataStaffChangeEventListener(DistributedLock distributedLock) { + this.distributedLock = distributedLock; + } + + @Override + public ConsumeConcurrentlyStatus consumeMessage(List msgs, ConsumeConcurrentlyContext context) { + + if (redisUtils == null) { + redisUtils = SpringContextUtils.getBean(RedisUtils.class); + } + + try { + msgs.forEach(msg -> consumeMessage(msg)); + } catch (Exception e) { + logger.error(ExceptionUtils.getErrorStackTrace(e)); + return ConsumeConcurrentlyStatus.RECONSUME_LATER; + } + return ConsumeConcurrentlyStatus.CONSUME_SUCCESS; + } + + private void consumeMessage(MessageExt messageExt) { + // msg即为消息体 + // tags为SystemMessageType.java中的项,为具体的操作,此处拿到tags,判断是创建还是变更,来做响应的后续操作即可 + String msg = new String(messageExt.getBody()); + String topic = messageExt.getTopic(); + String tags = messageExt.getTags(); + String pendingMsgLabel = messageExt.getUserProperty(MQUserPropertys.BLOCKED_MSG_LABEL); + + //messageExt.propert + + logger.info("【开放数据事件监听器】-工作人员信息变更-收到消息内容:{}, 操作:{}, blockedMsgLabel:{}", msg, tags, pendingMsgLabel); + OrgOrStaffMQMsg obj = JSON.parseObject(msg, OrgOrStaffMQMsg.class); + //只推送平阴数据 + if (!StrConstant.PY_CUSTOMER.equals(obj.getCustomerId())) { + return; + } + + RLock lock = null; + try { + lock = distributedLock.getLock(String.format("lock:open_data_staff:%s", obj.getOrgId()), + 30L, 30L, TimeUnit.SECONDS); + + StaffBaseInfoFormDTO dto = new StaffBaseInfoFormDTO(); + dto.setCustomerId(obj.getCustomerId()); + dto.setType(obj.getType()); + List staffIdList = new ArrayList<>(); + staffIdList.add(obj.getOrgId()); + SpringContextUtils.getBean(ExUserService.class).getStaffBaseInfo(dto); + } catch (RenException e) { + // 如果是我们手动抛出的异常,说明在业务可控范围内。目前不需要MQ重试 + logger.error("【开放数据事件监听器】-工作人员信息变更-初始化客户组织失败:".concat(ExceptionUtils.getErrorStackTrace(e))); + } catch (Exception e) { + // 不是我们自己抛出的异常,可以让MQ重试 + logger.error("【开放数据事件监听器】-工作人员信息变更-初始化客户组织失败:".concat(ExceptionUtils.getErrorStackTrace(e))); + throw e; + } finally { + distributedLock.unLock(lock); + } + + if (StringUtils.isNotBlank(pendingMsgLabel)) { + try { + removePendingMqMsgCache(pendingMsgLabel); + } catch (Exception e) { + logger.error("【开放数据事件监听器】-staff-删除mq阻塞消息缓存失败:{}", ExceptionUtils.getErrorStackTrace(e)); + } + } + } + + /** + * @description + * + * @param pendingMsgLabel + * @return + * @description 应答mq消息 + * @author wxz + * @date 2021.10.14 16:32:32 + */ + private void removePendingMqMsgCache(String pendingMsgLabel) { + String key = RedisKeys.blockedMqMsgKey(pendingMsgLabel); + redisUtils.delete(key); + } +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/BaseConflictsResolveService.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/BaseConflictsResolveService.java new file mode 100644 index 0000000000..85cb47c7b9 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/BaseConflictsResolveService.java @@ -0,0 +1,31 @@ +/** + * 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.opendata.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.opendata.entity.BaseConflictsResolveEntity; + +/** + * 事件中间表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-22 + */ +public interface BaseConflictsResolveService extends BaseService { + +} \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/BaseDisputeProcessService.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/BaseDisputeProcessService.java new file mode 100644 index 0000000000..20d2516dab --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/BaseDisputeProcessService.java @@ -0,0 +1,40 @@ +/** + * 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.opendata.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.basereport.form.EventInfoFormDTO; +import com.epmet.opendata.entity.BaseDisputeProcessEntity; + +/** + * 事件信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-15 + */ +public interface BaseDisputeProcessService extends BaseService { + + /** + * 获取上报事件 + * @Param formDTO + * @Return + * @Author zhaoqifeng + * @Date 2021/10/15 16:59 + */ + void getEventinfo(EventInfoFormDTO formDTO); +} \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/ExDeptService.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/ExDeptService.java new file mode 100644 index 0000000000..2fa094af92 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/ExDeptService.java @@ -0,0 +1,49 @@ +/** + * 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.opendata.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.opendata.dto.form.ExDeptFormDTO; +import com.epmet.opendata.entity.ExDeptEntity; + +import java.util.Map; + +/** + * 部门(网格)中间表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-19 + */ +public interface ExDeptService extends BaseService { + + + Map getDeptMap(); + + /** + * @Author sun + * @Description 组织基础信息中介库同步 + **/ + void getAgencyBaseInfo(ExDeptFormDTO formDTO); + + /** + * @Author sun + * @Description 网格基础信息中介库同步 + **/ + void getGridBaseInfo(ExDeptFormDTO formDTO); + +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/ExUserService.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/ExUserService.java new file mode 100644 index 0000000000..cdbe5cbaad --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/ExUserService.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.opendata.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.opendata.dto.form.StaffBaseInfoFormDTO; +import com.epmet.opendata.entity.ExUserEntity; + +import java.util.Map; + +/** + * 系统用户中间表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-22 + */ +public interface ExUserService extends BaseService { + + Map getUserMap(String customerId); + + /** + * @Author sun + * @Description 网格员信息中间库同步 + **/ + void getStaffBaseInfo(StaffBaseInfoFormDTO formDTO); + +} \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/UserPatrolDetailService.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/UserPatrolDetailService.java new file mode 100644 index 0000000000..13cde46235 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/UserPatrolDetailService.java @@ -0,0 +1,35 @@ +/** + * 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.opendata.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.opendata.entity.UserPatrolDetailEntity; + +/** + * 工作人员巡查记录明细 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-14 + */ +public interface UserPatrolDetailService extends BaseService { + + + int deleteByPatrolId(String patrolId); + + int deleteByCustomerId(String customerId); +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/UserPatrolRecordService.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/UserPatrolRecordService.java new file mode 100644 index 0000000000..e6896f32b8 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/UserPatrolRecordService.java @@ -0,0 +1,53 @@ +/** + * 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.opendata.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.opendata.dto.form.UpsertPatrolRecordForm; +import com.epmet.opendata.entity.UserPatrolRecordEntity; + +/** + * 用户巡查主记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-14 + */ +public interface UserPatrolRecordService extends BaseService { + + /** + * desc:根据条件插入巡查记录 + * @param patrolRecordForm + * @return + */ + Boolean insertPatrolRecord(UpsertPatrolRecordForm patrolRecordForm); + + /** + * desc:根据条件更新巡查记录及轨迹 + * @param patrolRecordForm + * @return + */ + Boolean updatePatrolRecord(UpsertPatrolRecordForm patrolRecordForm); + + /** + * desc:重新加载数据 + * @param customerId + * @return + */ + Boolean reloadPatrolData(String customerId); + +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/BaseConflictsResolveServiceImpl.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/BaseConflictsResolveServiceImpl.java new file mode 100644 index 0000000000..270cbb365f --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/BaseConflictsResolveServiceImpl.java @@ -0,0 +1,36 @@ +/** + * 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.opendata.service.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.opendata.dao.BaseConflictsResolveDao; +import com.epmet.opendata.entity.BaseConflictsResolveEntity; +import com.epmet.opendata.service.BaseConflictsResolveService; +import org.springframework.stereotype.Service; + +/** + * 事件中间表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-22 + */ +@Service +public class BaseConflictsResolveServiceImpl extends BaseServiceImpl implements BaseConflictsResolveService { + + +} \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/BaseDisputeProcessServiceImpl.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/BaseDisputeProcessServiceImpl.java new file mode 100644 index 0000000000..e51258fade --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/BaseDisputeProcessServiceImpl.java @@ -0,0 +1,141 @@ +/** + * 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.opendata.service.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.basereport.form.EventInfoFormDTO; +import com.epmet.dto.basereport.result.EventInfoResultDTO; +import com.epmet.feign.DataStatisticalOpenFeignClient; +import com.epmet.opendata.dao.BaseDisputeProcessDao; +import com.epmet.opendata.entity.BaseConflictsResolveEntity; +import com.epmet.opendata.entity.BaseDisputeProcessEntity; +import com.epmet.opendata.service.BaseConflictsResolveService; +import com.epmet.opendata.service.BaseDisputeProcessService; +import com.epmet.opendata.service.ExDeptService; +import com.epmet.opendata.service.ExUserService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 事件信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-15 + */ +@Slf4j +@Service +public class BaseDisputeProcessServiceImpl extends BaseServiceImpl implements BaseDisputeProcessService { + @Resource + private DataStatisticalOpenFeignClient dataStatisticalOpenFeignClient; + @Resource + private ExDeptService exDeptService; + @Resource + private BaseConflictsResolveService baseConflictsResolveService; + @Resource + private ExUserService exUserService; + + /** + * 获取上报事件 + * + * @param formDTO + * @Param formDTO + * @Return + * @Author zhaoqifeng + * @Date 2021/10/15 16:59 + */ + @Override + public void getEventinfo(EventInfoFormDTO formDTO) { + formDTO.setPageSize(1000); + Result> result = dataStatisticalOpenFeignClient.getEventInfo(formDTO); + if (!result.success()) { + throw new RenException(result.getInternalMsg()); + } + Map deptMap = exDeptService.getDeptMap(); + Map userMap = exUserService.getUserMap(formDTO.getCustomerId()); + List list = result.getData(); + saveEvent(formDTO, deptMap, userMap, list); + //分批次循环 + while (CollectionUtils.isNotEmpty(list)) { + formDTO.setPageNo(formDTO.getPageNo() + NumConstant.ONE); + result = dataStatisticalOpenFeignClient.getEventInfo(formDTO); + list = result.getData(); + saveEvent(formDTO, deptMap, userMap, list); + } + + + } + + private void saveEvent(EventInfoFormDTO formDTO, Map deptMap, Map userMap, List list) { + if (CollectionUtils.isEmpty(list)) { + log.warn("no event data to save table base_conflicts_resolve"); + return; + } + + List resolveList = list.stream().map(item -> { + BaseConflictsResolveEntity entity = new BaseConflictsResolveEntity(); + entity.setId(item.getId().concat("_PY")); + entity.setCustomerId(item.getCustomerId()); + entity.setGridId(deptMap.get(item.getOrgId())); + entity.setGridName(item.getOrgName()); + entity.setEventName(item.getEventName()); + entity.setHappenDate(item.getHappenDate()); + entity.setHappenPlace(item.getHappenPlace()); + String eventDescription = item.getEventDescription(); + //如果不为空 长度控制1000以内 + if (StringUtils.isNotBlank(eventDescription) && eventDescription.length() > NumConstant.ONE_THOUSAND) { + eventDescription = eventDescription.substring(NumConstant.ZERO, NumConstant.ONE_THOUSAND); + } + entity.setEventDescription(eventDescription); + entity.setLng(null == item.getLng() ? null : item.getLng().toPlainString()); + entity.setLat(null == item.getLat() ? null : item.getLat().toPlainString()); + entity.setCreateBy(null == userMap.get(item.getReporterId()) ? null : String.valueOf(userMap.get(item.getReporterId()))); + entity.setCreateDate(item.getReportTime()); + entity.setUpdateDate(new Date()); + entity.setStatus(item.getStatus()); + //业务不确定 + if (("03").equals(item.getStatus())) { + entity.setSuccessfulOrNot("Y"); + } + //业务不包含 一级分类里 如果是03 矛盾纠纷 则涉及人数写2(目前业务不支持 所以应产品需求 填2) + if ("03".equals(item.getParentEventCategory())) { + entity.setNumberInvolved(NumConstant.TWO); + } + entity.setEventNo(("py_").concat(item.getId())); + entity.setFirstEventCategory(item.getParentEventCategory()); + entity.setSource("01"); + entity.setSecondEventCategory(item.getEventCategory()); + entity.setResolveWay(item.getWaysOfResolving()); + entity.setResolveGridLevel(item.getCompleteLevel()); + entity.setResolveTime(item.getCompleteTime()); + return entity; + }).collect(Collectors.toList()); + + baseConflictsResolveService.saveOrUpdateBatch(resolveList, formDTO.getPageSize()); + } +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/ExDeptServiceImpl.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/ExDeptServiceImpl.java new file mode 100644 index 0000000000..4c95ca47b5 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/ExDeptServiceImpl.java @@ -0,0 +1,138 @@ +/** + * 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.opendata.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.org.result.CustomerAgencyDTO; +import com.epmet.dto.org.result.CustomerGridDTO; +import com.epmet.feign.DataStatisticalOpenFeignClient; +import com.epmet.opendata.dao.ExDeptDao; +import com.epmet.opendata.dto.form.ExDeptFormDTO; +import com.epmet.opendata.entity.ExDeptEntity; +import com.epmet.opendata.service.ExDeptService; +import org.apache.commons.collections4.CollectionUtils; +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.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 部门(网格)中间表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-19 + */ +@Service +public class ExDeptServiceImpl extends BaseServiceImpl implements ExDeptService { + @Autowired + private DataStatisticalOpenFeignClient dataStatisticalOpenFeignClient; + + + @Override + public Map getDeptMap() { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + List entityList = baseDao.selectList(wrapper); + if (CollectionUtils.isEmpty(entityList)) { + return Collections.emptyMap(); + } + return entityList.stream().collect(Collectors.toMap(ExDeptEntity::getQxDeptId, ExDeptEntity::getDeptId, (key1, key2) -> key2)); + } + + /** + * @Author sun + * @Description 组织基础信息中介库同步 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public void getAgencyBaseInfo(ExDeptFormDTO formDTO) { + //1.查询组织基础信息 + com.epmet.dto.org.form.GridBaseInfoFormDTO formDTO1 = ConvertUtils.sourceToTarget(formDTO, com.epmet.dto.org.form.GridBaseInfoFormDTO.class); + Result> result = dataStatisticalOpenFeignClient.getAgencyBaseInfo(formDTO1); + if (!result.success()) { + throw new RenException(result.getInternalMsg()); + } + if (null == result.getData() || result.getData().size() < NumConstant.ONE) { + return; + } + //2.封装数据 + List ExList = new ArrayList<>(); + result.getData().forEach(ag -> { + ExDeptEntity entity = new ExDeptEntity(); + entity.setQxDeptId(ag.getId()); + entity.setQxDeptName(ag.getOrganizationName()); + entity.setQxDeptCode(ag.getCode()); + entity.setQxCustomerId(formDTO.getCustomerId()); + ExList.add(entity); + }); + //3.全量数据则按组织名称更新数据,新增修改则是按组织Id(qx_dept_id)新增或修改 + if (null != formDTO.getType() && "all".equals(formDTO.getType())) { + baseDao.updateBatch(ExList); + } else { + baseDao.insertBatch(ExList); + } + + + } + + /** + * @Author sun + * @Description 网格基础信息中介库同步 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public void getGridBaseInfo(ExDeptFormDTO formDTO) { + //1.查询网格基础信息 + com.epmet.dto.org.form.GridBaseInfoFormDTO formDTO1 = ConvertUtils.sourceToTarget(formDTO, com.epmet.dto.org.form.GridBaseInfoFormDTO.class); + Result> result = dataStatisticalOpenFeignClient.getGridBaseInfo(formDTO1); + if (!result.success()) { + throw new RenException(result.getInternalMsg()); + } + if (null == result.getData() || result.getData().size() < NumConstant.ONE) { + return; + } + //2.封装数据 + List ExList = new ArrayList<>(); + result.getData().forEach(ag -> { + ExDeptEntity entity = new ExDeptEntity(); + entity.setQxDeptId(ag.getId()); + entity.setQxDeptName(ag.getGridName()); + entity.setQxDeptCode(ag.getCode()); + entity.setQxCustomerId(formDTO.getCustomerId()); + ExList.add(entity); + }); + //3.全量数据则按组织名称更新数据,新增修改则是按组织Id(qx_dept_id)新增或修改 + if (null != formDTO.getType() && "all".equals(formDTO.getType())) { + baseDao.updateBatch(ExList); + //exDeptDao.updateBatchGrid(ExList); + } else { + baseDao.insertBatch(ExList); + } + + } + +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/ExUserServiceImpl.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/ExUserServiceImpl.java new file mode 100644 index 0000000000..a9eca96dac --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/ExUserServiceImpl.java @@ -0,0 +1,101 @@ +/** + * 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.opendata.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.user.result.GridUserInfoDTO; +import com.epmet.feign.DataStatisticalOpenFeignClient; +import com.epmet.opendata.dao.ExUserDao; +import com.epmet.opendata.dto.form.StaffBaseInfoFormDTO; +import com.epmet.opendata.entity.ExUserEntity; +import com.epmet.opendata.service.ExUserService; +import org.apache.commons.collections4.CollectionUtils; +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.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 系统用户中间表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-22 + */ +@Service +public class ExUserServiceImpl extends BaseServiceImpl implements ExUserService { + @Autowired + private DataStatisticalOpenFeignClient dataStatisticalOpenFeignClient; + + @Override + public Map getUserMap(String customerId) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(ExUserEntity::getQxCustomerId, customerId); + List list = baseDao.selectList(wrapper); + if (CollectionUtils.isEmpty(list)) { + return Collections.emptyMap(); + } + return list.stream().collect(Collectors.toMap(ExUserEntity::getQxUserId, ExUserEntity::getUserId, (key1, key2) -> key2)); + } + + /** + * @Author sun + * @Description 网格员信息中间库同步 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public void getStaffBaseInfo(StaffBaseInfoFormDTO formDTO) { + //1.查询网格基础信息 + com.epmet.dto.user.form.StaffBaseInfoFormDTO formDTO1 = ConvertUtils.sourceToTarget(formDTO, com.epmet.dto.user.form.StaffBaseInfoFormDTO.class); + Result> result = dataStatisticalOpenFeignClient.getStaffBaseInfo(formDTO1); + if (!result.success()) { + throw new RenException(result.getInternalMsg()); + } + + //2.中间库新增/修改数据 + List entityList = new ArrayList<>(); + result.getData().forEach(r -> { + ExUserEntity entity = new ExUserEntity(); + entity.setQxUserId(r.getStaffId()); + entity.setQxUserName(r.getNickName()); + entity.setQxMobile(r.getPhonenumber()); + entity.setQxCustomerId(formDTO.getCustomerId()); + entityList.add(entity); + }); + + //3.更新数据,不能新增,市平台信息表中必填的 + if (!"staff_create".equals(formDTO.getType())) { + baseDao.updateBatch(entityList); + } + /*if ("staff_create".equals(formDTO.getType())) { + insertBatch(entityList); + } else { + baseDao.updateBatch(entityList); + }*/ + + } + +} \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/UserPatrolDetailServiceImpl.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/UserPatrolDetailServiceImpl.java new file mode 100644 index 0000000000..a8e9b220bc --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/UserPatrolDetailServiceImpl.java @@ -0,0 +1,50 @@ +/** + * 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.opendata.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.opendata.dao.UserPatrolDetailDao; +import com.epmet.opendata.entity.UserPatrolDetailEntity; +import com.epmet.opendata.service.UserPatrolDetailService; +import org.springframework.stereotype.Service; + +/** + * 工作人员巡查记录明细 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-14 + */ +@Service +public class UserPatrolDetailServiceImpl extends BaseServiceImpl implements UserPatrolDetailService { + + + @Override + public int deleteByPatrolId(String patrolId) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(UserPatrolDetailEntity::getStaffPatrolRecId, patrolId); + return baseDao.delete(wrapper); + } + + @Override + public int deleteByCustomerId(String customerId) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(UserPatrolDetailEntity::getCustomerId, customerId); + return baseDao.delete(wrapper); + } +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/UserPatrolRecordServiceImpl.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/UserPatrolRecordServiceImpl.java new file mode 100644 index 0000000000..0a5312e602 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/UserPatrolRecordServiceImpl.java @@ -0,0 +1,235 @@ +/** + * 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.opendata.service.impl; + +import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.user.param.MidPatrolFormDTO; +import com.epmet.dto.user.result.MidPatrolRecordResult; +import com.epmet.feign.DataStatisticalOpenFeignClient; +import com.epmet.opendata.dao.UserPatrolRecordDao; +import com.epmet.opendata.dto.form.UpsertPatrolRecordForm; +import com.epmet.opendata.entity.UserPatrolDetailEntity; +import com.epmet.opendata.entity.UserPatrolRecordEntity; +import com.epmet.opendata.service.UserPatrolDetailService; +import com.epmet.opendata.service.UserPatrolRecordService; +import lombok.extern.slf4j.Slf4j; +import org.jetbrains.annotations.NotNull; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.ArrayList; +import java.util.List; + + +/** + * 用户巡查主记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-14 + */ +@Slf4j +@Service +public class UserPatrolRecordServiceImpl extends BaseServiceImpl implements UserPatrolRecordService { + + @Autowired + private DataStatisticalOpenFeignClient dataStatisticalOpenFeignClient; + @Autowired + private UserPatrolDetailService userPatrolDetailService; + + @Override + public Boolean insertPatrolRecord(UpsertPatrolRecordForm patrolRecordForm) { + log.info("upsertPatrolRecord param:{}", JSON.toJSONString(patrolRecordForm)); + ValidatorUtils.validateEntity(patrolRecordForm); + MidPatrolFormDTO midPatrolFormDTO = buildParam(patrolRecordForm); + Result> record = dataStatisticalOpenFeignClient.getPatrolRecordList(midPatrolFormDTO); + if (record == null || !record.success()) { + log.error("获取巡查记录失败,param:{}", JSON.toJSONString(midPatrolFormDTO)); + return false; + } + List data = record.getData(); + if (CollectionUtils.isEmpty(data)) { + //数据已被删除了 + //暂时设置error 用于排错 + log.error("获取巡查记录返回为空,param:{}", JSON.toJSONString(midPatrolFormDTO)); + int effectRow = baseDao.deleteById(patrolRecordForm.getPatrolId()); + log.warn("del effectRow:{}", effectRow); + return true; + } + List insertList = new ArrayList<>(); + data.forEach(o-> insertList.add(buildEntity(o))); + //insert + if (CollectionUtils.isEmpty(insertList)){ + log.error("构建要插入的数据为空,param:{}", JSON.toJSONString(midPatrolFormDTO)); + return false; + } + this.insertBatch(insertList, NumConstant.ONE_HUNDRED); + return true; + } + + @Override + public Boolean updatePatrolRecord(UpsertPatrolRecordForm patrolRecordForm) { + log.info("updatePatrolRecord param:{}", JSON.toJSONString(patrolRecordForm)); + ValidatorUtils.validateEntity(patrolRecordForm); + MidPatrolFormDTO midPatrolFormDTO = buildParam(patrolRecordForm); + Result> record = dataStatisticalOpenFeignClient.getPatrolRecordList(midPatrolFormDTO); + if (record == null || !record.success()) { + log.error("获取巡查记录失败,param:{}", JSON.toJSONString(midPatrolFormDTO)); + return false; + } + List data = record.getData(); + if (CollectionUtils.isEmpty(data)) { + //数据已被删除了 + //暂时设置error 用于排错 + log.error("获取巡查记录返回为空,param:{}", JSON.toJSONString(midPatrolFormDTO)); + int effectRow = baseDao.deleteById(patrolRecordForm.getPatrolId()); + log.warn("del effectRow:{}", effectRow); + return true; + } + data.forEach(o->{ + UserPatrolRecordEntity recordEntity = buildEntity(o); + //update + int effectRow = baseDao.updateById(recordEntity); + if (effectRow == NumConstant.ZERO) { + baseDao.insert(recordEntity); + } + UserPatrolDetailEntity detailEntity = buildDetailEntity(o); + //先删除再新增 + userPatrolDetailService.deleteByPatrolId(recordEntity.getId()); + boolean insert = userPatrolDetailService.insert(detailEntity); + }); + + return true; + } + + @Override + public Boolean reloadPatrolData(String customerId) { + int pageNo = 1; + int pageSize = 1000; + List resultList = null; + do { + MidPatrolFormDTO param = new MidPatrolFormDTO(); + param.setCustomerId(customerId); + param.setPageNo(pageNo++); + param.setPageSize(pageSize); + Result> record = dataStatisticalOpenFeignClient.getPatrolRecordList(param); + if (record == null || !record.success()) { + log.error("获取巡查记录失败,param:{}", JSON.toJSONString(param)); + return false; + } + resultList = record.getData(); + if (CollectionUtils.isEmpty(resultList)){ + log.warn("不存在巡查记录,param:{}", JSON.toJSONString(param)); + return false; + } + insertRecordBatch(resultList,true); + + + + }while (!CollectionUtils.isEmpty(resultList) && resultList.size()> pageSize ); + + return null; + } + private Boolean insertRecordBatch(List list,boolean isReload){ + List insertList = new ArrayList<>(); + list.forEach(o-> insertList.add(buildEntity(o))); + //insert + if (CollectionUtils.isEmpty(insertList)){ + log.error("构建要插入的数据为空,param:{}", JSON.toJSONString(list)); + return false; + } + if (isReload){ + int i = userPatrolDetailService.deleteByCustomerId(list.get(0).getCustomerId()); + log.info("insertRecordBatch del patrol effectRow:{}",i); + } + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(UserPatrolRecordEntity::getCustomerId, list.get(0).getCustomerId()); + int delete = baseDao.delete(wrapper); + log.info("insertRecordBatch del patrol effectRow:{}",delete); + this.insertBatch(insertList, NumConstant.ONE_HUNDRED); + List insertDetailList = new ArrayList<>(); + list.forEach(o-> { + insertDetailList.add(buildDetailEntity(o)); + if (!isReload){ + //先删除再新增 + userPatrolDetailService.deleteByPatrolId(o.getId()); + } + }); + if (CollectionUtils.isEmpty(insertList)){ + log.warn("构建要插入的数据为空,param:{}", JSON.toJSONString(list)); + } + userPatrolDetailService.insertBatch(insertDetailList, NumConstant.ONE_HUNDRED); + return true; + } + + @NotNull + private UserPatrolDetailEntity buildDetailEntity(MidPatrolRecordResult recordResult) { + UserPatrolDetailEntity detailEntity = new UserPatrolDetailEntity(); + detailEntity.setCustomerId(recordResult.getCustomerId()); + detailEntity.setStaffPatrolRecId(recordResult.getId()); + detailEntity.setRoute(recordResult.getRoute()); + detailEntity.setId(recordResult.getId()); + detailEntity.setRevision(recordResult.getRevision()); + detailEntity.setCreatedBy(recordResult.getCreatedBy()); + detailEntity.setCreatedTime(recordResult.getCreatedTime()); + detailEntity.setUpdatedBy(recordResult.getUpdatedBy()); + detailEntity.setUpdatedTime(recordResult.getUpdatedTime()); + detailEntity.setDelFlag(String.valueOf(recordResult.getDelFlag())); + return detailEntity; + } + + private UserPatrolRecordEntity buildEntity(MidPatrolRecordResult recordResult) { + UserPatrolRecordEntity entity = new UserPatrolRecordEntity(); + entity.setCustomerId(recordResult.getCustomerId()); + entity.setGrid(recordResult.getGrid()); + entity.setGridPids(recordResult.getGridPids()); + entity.setStaffId(recordResult.getStaffId()); + entity.setAgencyId(recordResult.getAgencyId()); + entity.setPatrolStartTime(recordResult.getPatrolStartTime()); + entity.setPatrolEndTime(recordResult.getPatrolEndTime()); + entity.setActrualEndTime(recordResult.getActrualEndTime()); + entity.setStartLocation(""); + entity.setEndLocation(""); + entity.setTotalTime(recordResult.getTotalTime()); + entity.setDistance(0); + entity.setStatus(recordResult.getStatus()); + entity.setId(recordResult.getId()); + entity.setRevision(recordResult.getRevision()); + entity.setCreatedBy(recordResult.getCreatedBy()); + entity.setCreatedTime(recordResult.getCreatedTime()); + entity.setUpdatedBy(recordResult.getUpdatedBy()); + entity.setUpdatedTime(recordResult.getUpdatedTime()); + entity.setDelFlag(String.valueOf(recordResult.getDelFlag())); + return entity; + } + + @NotNull + private MidPatrolFormDTO buildParam(UpsertPatrolRecordForm patrolRecordForm) { + MidPatrolFormDTO midPatrolFormDTO = new MidPatrolFormDTO(); + midPatrolFormDTO.setCustomerId(patrolRecordForm.getCustomerId()); + midPatrolFormDTO.setPatrolId(patrolRecordForm.getPatrolId()); + midPatrolFormDTO.setPageNo(patrolRecordForm.getPageNo()); + midPatrolFormDTO.setPageSize(patrolRecordForm.getPageSize()); + return midPatrolFormDTO; + } +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/bootstrap.yml b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/bootstrap.yml new file mode 100644 index 0000000000..b158975c86 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/bootstrap.yml @@ -0,0 +1,143 @@ +server: + port: @server.port@ + version: @version@ + servlet: + context-path: /opendata + +spring: + main: + allow-bean-definition-overriding: true + application: + name: open-data-worker-server + #环境 dev|test|prod + profiles: + active: @spring.profiles.active@ + jackson: + time-zone: GMT+8 + date-format: yyyy-MM-dd HH:mm:ss + redis: + database: @spring.redis.index@ + host: @spring.redis.host@ + port: @spring.redis.port@ + password: @spring.redis.password@ + timeout: 30s + datasource: + druid: + #MySQL + driver-class-name: com.mysql.cj.jdbc.Driver + url: @spring.datasource.druid.url@ + username: @spring.datasource.druid.username@ + password: @spring.datasource.druid.password@ + cloud: + nacos: + discovery: + server-addr: @nacos.server-addr@ + #nacos的命名空间ID,默认是public + namespace: @nacos.discovery.namespace@ + #不把自己注册到注册中心的地址 + register-enabled: @nacos.register-enabled@ + ip: @nacos.ip@ + serviceListChangedListening: + enable: @nacos.service-list-changed-listening.enable@ + config: + enabled: @nacos.config-enabled@ + server-addr: @nacos.server-addr@ + namespace: @nacos.config.namespace@ + group: @nacos.config.group@ + file-extension: yaml + #指定共享配置,且支持动态刷新 +# ext-config: +# - data-id: datasource.yaml +# group: ${spring.cloud.nacos.config.group} +# refresh: true +# - data-id: common.yaml +# group: ${spring.cloud.nacos.config.group} +# refresh: true + + # 数据迁移工具flyway + flyway: + enabled: @spring.flyway.enabled@ + locations: classpath:db/migration + url: @spring.datasource.druid.url@ + user: @spring.datasource.druid.username@ + password: @spring.datasource.druid.password@ + baseline-on-migrate: true + baseline-version: 0 + + +management: + endpoints: + web: + exposure: + include: "*" + endpoint: + health: + show-details: ALWAYS + +mybatis-plus: + mapper-locations: classpath:/mapper/**/*.xml + #实体扫描,多个package用逗号或者分号分隔 + typeAliasesPackage: com.epmet.entity + global-config: + #数据库相关配置 + db-config: + #主键类型 AUTO:"数据库ID自增", INPUT:"用户输入ID", ID_WORKER:"全局唯一ID (数字类型唯一ID)", UUID:"全局唯一ID UUID"; + id-type: ID_WORKER + #字段策略 IGNORED:"忽略判断",NOT_NULL:"非 NULL 判断"),NOT_EMPTY:"非空判断" + field-strategy: NOT_NULL + #驼峰下划线转换 + column-underline: true + banner: false + #原生配置 + configuration: + map-underscore-to-camel-case: true + cache-enabled: false + call-setters-on-nulls: true + jdbc-type-for-null: 'null' + +feign: + hystrix: + enabled: true + client: + config: + default: + loggerLevel: BASIC + okhttp: + enabled: true + +hystrix: + command: + default: + execution: + isolation: + thread: + timeoutInMilliseconds: 60000 #缺省为1000 + threadpool: + default: + coreSize: 10 + maxQueueSize: 500 + queueSizeRejectionThreshold: 500 + +ribbon: + ReadTimeout: 300000 + ConnectTimeout: 300000 + +#pageHelper分页插件 +pagehelper: + helper-dialect: mysql + reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1 + +#feign 日志需要该配置 +logging: + level: + com.epmet: debug + +dingTalk: + robot: + webHook: @dingTalk.robot.webHook@ + secret: @dingTalk.robot.secret@ + +rocketmq: + # 是否开启mq + enable: @rocketmq.enable@ + name-server: @rocketmq.nameserver@ \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/db/migration/init_db.sql b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/db/migration/init_db.sql new file mode 100644 index 0000000000..ac7d9c109c --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/db/migration/init_db.sql @@ -0,0 +1,14 @@ +create database epmet_open_data default character set utf8mb4 collate utf8mb4_general_ci; + +-- 开发环境的脚本 +CREATE USER epmet_open_data_user@'%' IDENTIFIED BY 'EpmEt-db-UsEr'; +GRANT ALL ON `epmet_open_data`.* TO 'epmet_open_data_user'@'%'; +flush privileges; + + + +-- 测试环境的脚本 + + + +-- 生产环境的数据 \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/logback-spring.xml b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/logback-spring.xml new file mode 100644 index 0000000000..bcbff37445 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/logback-spring.xml @@ -0,0 +1,176 @@ + + + + + + + + + + + + + ${appname} + + + + + + + + + debug + + + ${CONSOLE_LOG_PATTERN} + + UTF-8 + + + + + + + + ${log.path}/debug.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + + ${log.path}/debug-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + debug + ACCEPT + DENY + + + + + + + ${log.path}/info.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + + ${log.path}/info-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + info + ACCEPT + DENY + + + + + + + ${log.path}/warn.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + ${log.path}/warn-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + warn + ACCEPT + DENY + + + + + + + ${log.path}/error.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + ${log.path}/error-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + ERROR + ACCEPT + DENY + ${webHook} + ${secret} + ${appname} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/BaseDisputeProcessDao.xml b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/BaseDisputeProcessDao.xml new file mode 100644 index 0000000000..6fbc4d42a5 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/BaseDisputeProcessDao.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/ExDeptDao.xml b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/ExDeptDao.xml new file mode 100644 index 0000000000..0d7af2fa2b --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/ExDeptDao.xml @@ -0,0 +1,103 @@ + + + + + + + UPDATE ex_dept + + + + + + when qx_dept_name = #{item.qxDeptName} then #{item.qxDeptId} + + + + + + + + when qx_dept_name = #{item.qxDeptName} then #{item.qxDeptId} + + + + + + + + when qx_dept_name = #{item.qxDeptName} then #{item.qxDeptCode} + + + + + + + + when qx_dept_name = #{item.qxDeptName} then #{item.qxCustomerId} + + + + + + WHERE + 1=1 + + qx_dept_name = #{item.qxDeptName} + + + + + INSERT INTO ex_dept + ( + qx_dept_id, + qx_dept_name, + qx_dept_code, + qx_customer_id + ) + VALUES + + ( + #{i.qxDeptId}, + #{i.qxDeptName}, + #{i.qxDeptCode}, + #{i.qxCustomerId} + ) + + ON DUPLICATE KEY + UPDATE + qx_dept_name = values(qx_dept_name), + qx_dept_code = values(qx_dept_code), + qx_customer_id = values(qx_customer_id) + + + + UPDATE ex_dept + + + + + + when dept_name LIKE CONCAT(left(#{item.deptNameQx},2),'%',right(#{item.deptNameQx},2),if(LOCATE('第二', #{item.deptNameQx})>0,'%2','%1')) then #{item.deptIdQx} + + + + + + + + when dept_name LIKE CONCAT(left(#{item.deptNameQx},2),'%',right(#{item.deptNameQx},2),if(LOCATE('第二', #{item.deptNameQx})>0,'%2','%1')) then #{item.deptNameQx} + + + + + + WHERE + 1=1 + + dept_name LIKE CONCAT(left(#{item.deptNameQx},2),'%',right(#{item.deptNameQx},2),if(LOCATE('第二', #{item.deptNameQx})>0,'%2','%1')) + + + + + \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/ExUserDao.xml b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/ExUserDao.xml new file mode 100644 index 0000000000..3d904577fd --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/ExUserDao.xml @@ -0,0 +1,41 @@ + + + + + + + UPDATE ex_user + + + + + + when (qx_user_id = #{item.qxUserId} ) then #{item.qxUserName} + + + + + + + + when (qx_user_id = #{item.qxUserId} ) then #{item.qxMobile} + + + + + + + + when (qx_user_id = #{item.qxUserId} ) then #{item.qxCustomerId} + + + + + + WHERE 1=1 + + (qx_user_id = #{item.qxUserId} ) + + + + diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/UserPatrolDetailDao.xml b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/UserPatrolDetailDao.xml new file mode 100644 index 0000000000..bd61a74027 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/UserPatrolDetailDao.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/UserPatrolRecordDao.xml b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/UserPatrolRecordDao.xml new file mode 100644 index 0000000000..750e9f177b --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/UserPatrolRecordDao.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/epmet-module/open-data-worker/pom.xml b/epmet-module/open-data-worker/pom.xml new file mode 100644 index 0000000000..97fe762b08 --- /dev/null +++ b/epmet-module/open-data-worker/pom.xml @@ -0,0 +1,18 @@ + + + + epmet-module + com.epmet + 2.0.0 + + 4.0.0 + + open-data-worker + pom + + open-data-worker-client + open-data-worker-server + + \ No newline at end of file diff --git a/epmet-module/oper-access/oper-access-server/deploy/docker-compose-prod.yml b/epmet-module/oper-access/oper-access-server/deploy/docker-compose-prod.yml index 94231275a1..2d0c1631c4 100644 --- a/epmet-module/oper-access/oper-access-server/deploy/docker-compose-prod.yml +++ b/epmet-module/oper-access/oper-access-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: oper-access-server: container_name: oper-access-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/oper-access-server:0.3.18 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/oper-access-server:0.3.24 ports: - "8093:8093" network_mode: host # 使用现有网络 @@ -15,4 +15,4 @@ services: resources: limits: cpus: '0.1' - memory: 600M \ No newline at end of file + memory: 600M diff --git a/epmet-module/oper-access/oper-access-server/pom.xml b/epmet-module/oper-access/oper-access-server/pom.xml index 5b097299ec..8d3c8706e8 100644 --- a/epmet-module/oper-access/oper-access-server/pom.xml +++ b/epmet-module/oper-access/oper-access-server/pom.xml @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - 0.3.18 + 0.3.24 oper-access com.epmet @@ -235,7 +235,7 @@ false - false + true true diff --git a/epmet-module/oper-crm/oper-crm-server/deploy/docker-compose-prod.yml b/epmet-module/oper-crm/oper-crm-server/deploy/docker-compose-prod.yml index 3282657fca..9cc48783a1 100644 --- a/epmet-module/oper-crm/oper-crm-server/deploy/docker-compose-prod.yml +++ b/epmet-module/oper-crm/oper-crm-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: oper-crm-server: container_name: oper-crm-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/oper-crm-server:0.3.72 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/oper-crm-server:0.3.87 ports: - "8090:8090" network_mode: host # 使用现有网络 @@ -15,4 +15,4 @@ services: resources: limits: cpus: '0.1' - memory: 600M \ No newline at end of file + memory: 600M diff --git a/epmet-module/oper-crm/oper-crm-server/pom.xml b/epmet-module/oper-crm/oper-crm-server/pom.xml index c058e133cb..f972dcffbf 100644 --- a/epmet-module/oper-crm/oper-crm-server/pom.xml +++ b/epmet-module/oper-crm/oper-crm-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.72 + 0.3.87 com.epmet oper-crm @@ -261,7 +261,7 @@ --> 8090 - test + prod @@ -283,7 +283,7 @@ false - false + true true diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java index 032fab629a..ab4987388f 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java @@ -18,6 +18,7 @@ package com.epmet.controller; import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.aop.NoRepeatSubmit; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; @@ -87,6 +88,7 @@ public class CustomerController { return new Result().ok(data); } + @NoRepeatSubmit @PostMapping("save") public Result save(@RequestBody CustomerDTO dto) { //效验数据 @@ -95,6 +97,7 @@ public class CustomerController { return new Result(); } + @NoRepeatSubmit @PutMapping("update") public Result update(@RequestBody CustomerDTO dto) { //效验数据 @@ -183,6 +186,7 @@ public class CustomerController { * @param form * @return */ + @NoRepeatSubmit @PostMapping("add") public Result> addCustomer(@RequestBody CustomerFormDTO form) { ValidatorUtils.validateEntity(form, CustomerFormDTO.AddCustomerGroup.class); diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java index 3b31e4feac..a864a031c1 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java @@ -508,48 +508,48 @@ public class CustomerServiceImpl extends BaseServiceImpl + * 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.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 配置表单 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +@Data +public class IcFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 表单CODE,从字典获取 + */ + private String formCode; + + /** + * 表单名称 + */ + private String formName; + + /** + * 地区码,有父级用父级 + */ + private String areaCode; + + /** + * 0未删除,1已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/IcFormItemDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/IcFormItemDTO.java new file mode 100644 index 0000000000..35133d48b6 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/IcFormItemDTO.java @@ -0,0 +1,172 @@ +/** + * 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.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 表单项 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +@Data +public class IcFormItemDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * + */ + private String areaCode; + + /** + * 表单ID + */ + private String formId; + + /** + * 表单CODE + */ + private String formCode; + + /** + * 父项ID + */ + private String parentItemId; + + /** + * 项标签 + */ + private String label; + + /** + * 控件类型,EG:INPUT;从字典获取 + */ + private String itemType; + + /** + * 分组ID,'默认,0' + */ + private String itemGroupId; + + /** + * 是否必填,1必填。0不必填 + */ + private Integer required; + + /** + * 手机号:mobile; 身份证:id_card + */ + private String validType; + + /** + * 默认值 + */ + private String defaultValue; + + /** + * 选项来源,REMOTE;LOCAL;如果是动态加载的下拉框或者CHECKBOX等的情况下使用。URL:接口获取(LABEL,VALUE);JSON:直接从JSON中取 + */ + private String optionSourceType; + + /** + * 来源地址,REMOTE才有,固定格式;如果OPTIONS_SOURCE是URL,则此处填写要调用的接口的URL相对路径,例如:/API/GOV/ORG/XXXX。此处不应设置参数,若需要参数应当完全由后端,通过TOKEN信息来获取 + */ + private String optionSourceValue; + + /** + * 排序 + */ + private Integer sort; + + /** + * 占位提示语 + */ + private String placeholder; + + /** + * 是否查询显示,1展示。0不展示 + */ + private Integer searchDisplay; + + /** + * 是否列表显示,1展示,0不展示 + */ + private Integer listDisplay; + + /** + * 是否需要支持数据分析,1支持。0不支持 + */ + private Integer dataAnalyse; + + /** + * 列名 + */ + private String columnName; + + /** + * 列名序号,根据表递增 + */ + private Integer columnNum; + + /** + * 0未删除,1已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/IcFormItemGroupDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/IcFormItemGroupDTO.java new file mode 100644 index 0000000000..5fe8d5de36 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/IcFormItemGroupDTO.java @@ -0,0 +1,112 @@ +/** + * 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.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 表单项分组 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +@Data +public class IcFormItemGroupDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 分组id + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 表单ID + */ + private String formId; + + /** + * 表单编码 + */ + private String formCode; + + /** + * 对应的子表名称 + */ + private String tableName; + + /** + * 是否支持添加一行,1支持,默认0不支持 + */ + private Boolean supportAdd; + + /** + * 名称 + */ + private String label; + + /** + * 排序 + */ + private Integer sort; + + /** + * 1展示,0不展示,默认1 + */ + private Boolean display; + + /** + * 0未删除,1已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/IcFormItemOptionsDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/IcFormItemOptionsDTO.java new file mode 100644 index 0000000000..5505ef21dd --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/IcFormItemOptionsDTO.java @@ -0,0 +1,106 @@ +/** + * 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.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 表单项的选项 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +@Data +public class IcFormItemOptionsDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 表单ID + */ + private String formId; + + /** + * 表单CODE + */ + private String formCode; + + /** + * 表单项ID + */ + private String itemId; + + /** + * 可选项标签名 + */ + private String optionLabel; + + /** + * 标签value值 + */ + private String optionValue; + + /** + * 排序 + */ + private Integer sort; + + /** + * 0未删除,1已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/IcResiCategoryStatsConfigDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/IcResiCategoryStatsConfigDTO.java new file mode 100644 index 0000000000..1eb4516551 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/IcResiCategoryStatsConfigDTO.java @@ -0,0 +1,116 @@ +/** + * 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.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 居民类别配置表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +@Data +public class IcResiCategoryStatsConfigDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * id + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 项标签 + */ + private String label; + + /** + * 表名 + */ + private String tableName; + + /** + * 列名 + */ + private String columnName; + + /** + * 管理平台分类图标 + */ + private String managementIcon; + + /** + * 数据平台分类图标 + */ + private String dataIcon; + + /** + * 房屋显示分类图标 + */ + private String houseShowIcon; + + /** + * 状态 显示:show;隐藏:hidden + */ + private String status; + + /** + * 排序 + */ + private Integer sort; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private String revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private String createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/IcResiCategoryWarnConfigDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/IcResiCategoryWarnConfigDTO.java new file mode 100644 index 0000000000..c7ef3d17f8 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/IcResiCategoryWarnConfigDTO.java @@ -0,0 +1,115 @@ +/** + * 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.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 居民类别预警配置表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +@Data +public class IcResiCategoryWarnConfigDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * id + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 项标签 + */ + private String label; + + /** + * 表名 + */ + private String tableName; + + /** + * 列名 + */ + private String columnName; + /** + * 是否预警 1 是 0 否 + */ + private String warn; + + /** + * 排序 + */ + private Integer sort; + + /** + * 等级1阈值 + */ + private Integer level1; + + /** + * 等级2阈值 + */ + private Integer level2; + + /** + * 等级3阈值 + */ + private Integer level3; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private String revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private String createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/ItemTypeDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/ItemTypeDTO.java new file mode 100644 index 0000000000..9db82e8d48 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/ItemTypeDTO.java @@ -0,0 +1,81 @@ +/** + * 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.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 控件类型 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +@Data +public class ItemTypeDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + private String id; + + /** + * 名称 + */ + private String name; + + /** + * CODE + */ + private String code; + + /** + * 0未删除,1已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CustomerFormQueryDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CustomerFormQueryDTO.java new file mode 100644 index 0000000000..8759909f38 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CustomerFormQueryDTO.java @@ -0,0 +1,31 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 居民信息,点击新增,获取当前客户下的表单 + * @Author yinzuomei + * @Date 2021/10/26 1:59 下午 + */ +@Data +public class CustomerFormQueryDTO implements Serializable { + public interface AddUserInternalGroup {} + // 获取表单相关信息 + public interface GetFormInfoGroup {} + + @NotBlank(message = "formCode不能为空,居民信息默认传:resi_base_info",groups = { AddUserInternalGroup.class, GetFormInfoGroup.class} ) + private String formCode; + + + @NotBlank(message = "tokenDto获取customerId不能为空",groups =AddUserInternalGroup.class ) + private String customerId; + + /** + * 是否动态 + */ + private Boolean dynamic; +} + diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/IcFormOptionsQueryFormDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/IcFormOptionsQueryFormDTO.java new file mode 100644 index 0000000000..f7fa5bb1da --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/IcFormOptionsQueryFormDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +/** + * @Description ic 表单options查询通用dto + * @Author wangxianzhang + * @Date 2021/12/12 1:07 下午 + * @Version 1.0 + */ +@Data +public class IcFormOptionsQueryFormDTO { + + public interface QueryByLabelAndCustomerIdForForm {} + + @NotBlank(message = "客户ID必填", groups = { QueryByLabelAndCustomerIdForForm.class }) + private String customerId; + + @NotBlank(message = "FormCode必填", groups = { QueryByLabelAndCustomerIdForForm.class }) + private String formCode; + + @NotBlank(message = "OptionsLabel必填", groups = { QueryByLabelAndCustomerIdForForm.class }) + private String label; + +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/IcResiCategoryStatsConfigFormDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/IcResiCategoryStatsConfigFormDTO.java new file mode 100644 index 0000000000..cc036df66f --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/IcResiCategoryStatsConfigFormDTO.java @@ -0,0 +1,79 @@ +/** + * 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.dto.form; + +import com.epmet.commons.tools.validator.group.UpdateGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.Date; + + +/** + * 居民类别配置表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +@Data +public class IcResiCategoryStatsConfigFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + public interface UpdateStatusGroup {} + public interface SelectGroup {} + + /** + * id + */ + @NotBlank(message = "配置项id不能为空",groups = {UpdateGroup.class,UpdateStatusGroup.class,SelectGroup.class}) + private String id; + + /** + * 管理平台分类图标 + */ + @NotBlank(message = "管理平台分类图标不能为空",groups = {UpdateGroup.class}) + private String managementIcon; + + /** + * 数据平台分类图标 + */ + @NotBlank(message = "数据平台分类图标不能为空",groups = {UpdateGroup.class}) + private String dataIcon; + + /** + * 房屋显示分类图标 + */ + @NotBlank(message = "房屋显示分类图标不能为空",groups = {UpdateGroup.class}) + private String houseShowIcon; + + /** + * 状态 显示:show;隐藏:hidden + */ + @NotBlank(message = "状态不能为空",groups = {UpdateStatusGroup.class}) + private String status; + + @NotBlank(message = "是否预警",groups = {UpdateGroup.class}) + private String warn; + + private Integer level1; + private Integer level2; + + private Integer level3; + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/IcResiCategoryStatsConfigSortFormDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/IcResiCategoryStatsConfigSortFormDTO.java new file mode 100644 index 0000000000..9e843dd7da --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/IcResiCategoryStatsConfigSortFormDTO.java @@ -0,0 +1,52 @@ +/** + * 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.dto.form; + +import com.epmet.commons.tools.validator.group.UpdateGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + + +/** + * 居民类别配置表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +@Data +public class IcResiCategoryStatsConfigSortFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * id + */ + @NotBlank(message = "配置项id不能为空") + private String id; + + /** + * 排序 + */ + @NotNull(message = "排序不能为空") + private Integer sort; + + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/ResiCategoryStatsConfigListFormDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/ResiCategoryStatsConfigListFormDTO.java new file mode 100644 index 0000000000..96401a3029 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/ResiCategoryStatsConfigListFormDTO.java @@ -0,0 +1,48 @@ +/** + * 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.dto.form; + +import com.epmet.commons.tools.validator.group.UpdateGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + + +/** + * 居民类别配置表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +@Data +public class ResiCategoryStatsConfigListFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 是否预警 + */ + private Integer isWarn; + + /** + * 预警等级 + */ + private Integer level; + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/ColumnTableNameResultDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/ColumnTableNameResultDTO.java new file mode 100644 index 0000000000..3d1e20cc50 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/ColumnTableNameResultDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 查询必填字段-接口返参 + * @Author sun + */ +@Data +public class ColumnTableNameResultDTO implements Serializable { + private static final long serialVersionUID = -8441112171986914418L; + //表名 + private String tableName; + //字段中文名 + private String label; + //字段名 + private String columnName; +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/ConditionResultDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/ConditionResultDTO.java new file mode 100644 index 0000000000..07953ef95c --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/ConditionResultDTO.java @@ -0,0 +1,93 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description 查询条件 + * @Author yinzuomei + * @Date 2021/10/27 9:09 上午 + */ +@Data +public class ConditionResultDTO implements Serializable { + private static final long serialVersionUID = -2021200288758478252L; + /** + * 父项ID + */ + private String itemId; + + /** + * 默认:ic_resi_user + */ + private String tableName; + + /** + * 父项ID + */ + private String parentItemId; + + /** + * 项标签 + */ + private String label; + + /** + * 控件类型,EG:INPUT;从字典获取 + */ + private String itemType; + + /** + * 分组ID,'默认,NONE' + */ + private String itemGroupId; + + /** + * 是否必填,1必填。0不必填 + */ + private Integer required; + + /** + * 手机号:mobile; 身份证:id_card + */ + private String validType; + + /** + * 默认值 + */ + private String defaultValue; + + /** + * 选项来源,REMOTE;LOCAL;如果是动态加载的下拉框或者CHECKBOX等的情况下使用。URL:接口获取(LABEL,VALUE);JSON:直接从JSON中取 + */ + private String optionSourceType; + + /** + * 来源地址,REMOTE才有,固定格式;如果OPTIONS_SOURCE是URL,则此处填写要调用的接口的URL相对路径,例如:/API/GOV/ORG/XXXX。此处不应设置参数,若需要参数应当完全由后端,通过TOKEN信息来获取 + */ + private String optionSourceValue; + + /** + * 排序 + */ + private Integer sort; + + /** + * 占位提示语 + */ + private String placeholder; + + /** + * 列名 + */ + private String columnName; + + /** + * 查询类型: equal, like,daterange.... + */ + private String queryType; + + private List options; +} + diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CustomerFormResultDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CustomerFormResultDTO.java new file mode 100644 index 0000000000..45cd1dd0ea --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CustomerFormResultDTO.java @@ -0,0 +1,37 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description 居民信息,点击新增,返回当前客户下的表单 + * @Author yinzuomei + * @Date 2021/10/26 2:13 下午 + */ +@Data +public class CustomerFormResultDTO implements Serializable { + private static final long serialVersionUID = -6541805255520766366L; + + /** + * 表单id + */ + private String formId; + + /** + * 表单左上角的名字 + */ + private String formName; + + /** + * 表单项 + */ + private List itemList; + + /** + * 表单分组 + */ + private List groupList; +} + diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FormGroupDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FormGroupDTO.java new file mode 100644 index 0000000000..1b2a6c8964 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FormGroupDTO.java @@ -0,0 +1,47 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description 下面的的分组 + * @Author yinzuomei + * @Date 2021/10/26 2:16 下午 + */ +@Data +public class FormGroupDTO implements Serializable { + private static final long serialVersionUID = -6209767832999902538L; + /** + * 分组id + */ + private String groupId; + + /** + * 分组的名字,例如:教育信息、家庭信息 + */ + private String label; + + /** + * 排序 + */ + private Integer sort; + + + /** + * 是否支持添加一行,1支持,默认0不支持 + */ + private Boolean supportAdd; + + /** + * 目前这些分组,没有拆开子表,所以默认:ic_resi_user + */ + private String tableName; + + /** + * 分组里面的组件 + */ + private List itemList; +} + diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FormItemResult.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FormItemResult.java new file mode 100644 index 0000000000..dfe0b85ffa --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FormItemResult.java @@ -0,0 +1,134 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description 表单项 + * @Author yinzuomei + * @Date 2021/10/26 2:15 下午 + */ +@Data +public class FormItemResult implements Serializable { + private static final long serialVersionUID = 7443085469505238040L; + + /** + * 父项ID + */ + private String itemId; + + /** + * 默认:ic_resi_user + */ + private String tableName; + + /** + * 父项ID + */ + private String parentItemId; + + /** + * 项标签 + */ + private String label; + + /** + * 控件类型,EG:INPUT;从字典获取 + */ + private String itemType; + + /** + * 分组ID,'默认,NONE' + */ + private String itemGroupId; + + /** + * 是否必填,1必填。0不必填 + */ + private Integer required; + + /** + * 手机号:mobile; 身份证:id_card + */ + private String validType; + + /** + * 默认值 + */ + private String defaultValue; + + /** + * 选项来源,REMOTE;LOCAL;如果是动态加载的下拉框或者CHECKBOX等的情况下使用。URL:接口获取(LABEL,VALUE);JSON:直接从JSON中取 + */ + private String optionSourceType; + + /** + * 来源地址,REMOTE才有,固定格式;如果OPTIONS_SOURCE是URL,则此处填写要调用的接口的URL相对路径,例如:/API/GOV/ORG/XXXX。此处不应设置参数,若需要参数应当完全由后端,通过TOKEN信息来获取 + */ + private String optionSourceValue; + + /** + * 排序 + */ + private Integer sort; + + /** + * 占位提示语 + */ + private String placeholder; + + /** + * 是否查询显示,1展示。0不展示 + */ + @JsonIgnore + private Integer searchDisplay; + + /** + * 是否列表显示,1展示,0不展示 + */ + @JsonIgnore + private Integer listDisplay; + + /** + * 是否需要支持数据分析,1支持。0不支持 + */ + @JsonIgnore + private Integer dataAnalyse; + + /** + * 列名 + */ + private String columnName; + + /** + * 列名序号,根据表递增 + */ + private Integer columnNum; + + private List options; + + + /** + * 当前组件,要追加分组 + */ + private FormGroupDTO childGroup; + + /** + * 1可以多选,0单选,默认0 + */ + private Boolean multiSelect; + + /** + * @description 分组label + * + * @param null + * @return + * @author wxz + * @date 2021.10.28 22:57:15 + */ + private String groupLabel; +} + diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FormItemResult2.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FormItemResult2.java new file mode 100644 index 0000000000..3372b55a37 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FormItemResult2.java @@ -0,0 +1,117 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description 分组里面的组件 + * @Author yinzuomei + * @Date 2021/10/26 4:29 下午 + */ +@Data +public class FormItemResult2 implements Serializable { + private static final long serialVersionUID = -7571266621687396261L; + /** + * 父项ID + */ + private String itemId; + + /** + * 默认:ic_resi_user + */ + private String tableName; + + /** + * 父项ID + */ + private String parentItemId; + + /** + * 项标签 + */ + private String label; + + /** + * 控件类型,EG:INPUT;从字典获取 + */ + private String itemType; + + /** + * 分组ID,'默认,NONE' + */ + private String itemGroupId; + + /** + * 是否必填,1必填。0不必填 + */ + private Integer required; + + /** + * 手机号:mobile; 身份证:id_card + */ + private String validType; + + /** + * 默认值 + */ + private String defaultValue; + + /** + * 选项来源,REMOTE;LOCAL;如果是动态加载的下拉框或者CHECKBOX等的情况下使用。URL:接口获取(LABEL,VALUE);JSON:直接从JSON中取 + */ + private String optionSourceType; + + /** + * 来源地址,REMOTE才有,固定格式;如果OPTIONS_SOURCE是URL,则此处填写要调用的接口的URL相对路径,例如:/API/GOV/ORG/XXXX。此处不应设置参数,若需要参数应当完全由后端,通过TOKEN信息来获取 + */ + private String optionSourceValue; + + /** + * 排序 + */ + private Integer sort; + + /** + * 占位提示语 + */ + private String placeholder; + + /** + * 是否查询显示,1展示。0不展示 + */ + @JsonIgnore + private Integer searchDisplay; + + /** + * 是否列表显示,1展示,0不展示 + */ + @JsonIgnore + private Integer listDisplay; + + /** + * 是否需要支持数据分析,1支持。0不支持 + */ + @JsonIgnore + private Integer dataAnalyse; + + /** + * 列名 + */ + private String columnName; + + /** + * 列名序号,根据表递增 + */ + private Integer columnNum; + + private List options; + + /** + * 1可以多选,0单选,默认0 + */ + private Boolean multiSelect; +} + diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/IcFormResColumnDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/IcFormResColumnDTO.java new file mode 100644 index 0000000000..52a3374449 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/IcFormResColumnDTO.java @@ -0,0 +1,18 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 列表展示列返参结构 + * @Author yinzuomei + * @Date 2021/11/1 12:49 下午 + */ +@Data +public class IcFormResColumnDTO implements Serializable { + private String tableName; + private String columnName; + private String label; +} + diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/IcResiCategoryStatsConfigResultDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/IcResiCategoryStatsConfigResultDTO.java new file mode 100644 index 0000000000..d9199b99cc --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/IcResiCategoryStatsConfigResultDTO.java @@ -0,0 +1,88 @@ +/** + * 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.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 居民类别配置表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +@Data +public class IcResiCategoryStatsConfigResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * id + */ + private String id; + + + /** + * 项标签 + */ + private String label; + + + + /** + * 管理平台分类图标 + */ + private String managementIcon; + + /** + * 数据平台分类图标 + */ + private String dataIcon; + + /** + * 房屋显示分类图标 + */ + private String houseShowIcon; + + /** + * 状态 显示:show;隐藏:hidden + */ + private String status; + + /** + * 排序 + */ + private Integer sort; + + private String warn; + /** + * 等级1阈值 + */ + private Integer level1; + /** + * 等级2阈值 + */ + private Integer level2; + /** + * 等级3阈值 + */ + private Integer level3; +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/OptionDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/OptionDTO.java new file mode 100644 index 0000000000..890b2c054b --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/OptionDTO.java @@ -0,0 +1,17 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 下拉框、单选框的值 + * @Author yinzuomei + * @Date 2021/10/26 2:32 下午 + */ +@Data +public class OptionDTO implements Serializable { + private String label; + private String value; +} + diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/TableHeaderResultDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/TableHeaderResultDTO.java new file mode 100644 index 0000000000..dd39f668e7 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/TableHeaderResultDTO.java @@ -0,0 +1,22 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description 表头返参DTO + * @Author yinzuomei + * @Date 2021/10/28 4:10 下午 + */ +@Data +public class TableHeaderResultDTO implements Serializable { + private static final long serialVersionUID = 8318224643897723433L; + private String itemId; + private String label; + private String columnName; + private String itemType; + private List options; +} + diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java index fd56957265..9cda858533 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java @@ -3,23 +3,21 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerFootBarDTO; -import com.epmet.dto.form.CheckFloatFootBarFormDTO; -import com.epmet.dto.form.CustomerFootBarFormDTO; +import com.epmet.dto.IcFormItemOptionsDTO; +import com.epmet.dto.IcResiCategoryStatsConfigDTO; +import com.epmet.dto.IcResiCategoryWarnConfigDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.result.*; import com.epmet.feign.fallback.OperCustomizeOpenFeignClientFallbackFactory; import org.springframework.cloud.openfeign.FeignClient; - -import com.epmet.commons.tools.constant.ServiceConstant; -import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.form.CustomerFunctionListFormDTO; -import com.epmet.dto.result.CheckFloatFootBarResultDTO; -import com.epmet.dto.result.DefaultFunctionListResultDTO; -import com.epmet.feign.fallback.OperCustomizeOpenFeignClientFallback; -import org.springframework.cloud.openfeign.FeignClient; import org.springframework.http.MediaType; +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.RequestParam; import java.util.List; +import java.util.Set; /** * 本服务对外开放的API,其他服务通过引用此client调用该服务 @@ -27,6 +25,7 @@ import java.util.List; * @author yinzuomei@elink-cn.com * @date 2020/6/4 13:16 */ +//@FeignClient(name = ServiceConstant.OPER_CUSTOMIZE_SERVER, fallbackFactory = OperCustomizeOpenFeignClientFallbackFactory.class,url = "http://localhost:8089") @FeignClient(name = ServiceConstant.OPER_CUSTOMIZE_SERVER, fallbackFactory = OperCustomizeOpenFeignClientFallbackFactory.class) public interface OperCustomizeOpenFeignClient { @@ -47,4 +46,87 @@ public interface OperCustomizeOpenFeignClient { */ @PostMapping(value = "/oper/customize/customerfootbar/checkfloatfootbar", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) Result checkFloatFootBar(@RequestBody CheckFloatFootBarFormDTO checkFloatFootBarFormDTO); + + /** + * desc: 获取表单填写项 【dynamic=null】查询全部;否则查询对应的item + * @param formDto + * @return + */ + @PostMapping(value = "/oper/customize/icform/getcustomerform", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + Result getCustomerForm(@RequestBody CustomerFormQueryDTO formDto); + + /** + * 返回用于列表展示的列 + * + * @param queryDTO + * @return com.epmet.commons.tools.utils.Result> + * @author yinzuomei + * @date 2021/11/1 12:53 下午 + */ + @PostMapping(value = "/oper/customize/icform/queryConditions", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + Result> queryConditions(@RequestBody CustomerFormQueryDTO queryDTO); + + /** + * 构造出所有的子表连接语句格式:left join table_name on (ic_resi_user.ID=table_name.IC_RESI_USER AND table_name.del_flag='0') + * + * @param queryDTO + * @return com.epmet.commons.tools.utils.Result> + * @author yinzuomei + * @date 2021/11/1 1:07 下午 + */ + @PostMapping(value = "/oper/customize/icform/querySubTables", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + Result> querySubTables(@RequestBody CustomerFormQueryDTO queryDTO); + + @PostMapping(value = "/oper/customize/icform/queryIcResiSubTables", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + Result> queryIcResiSubTables(@RequestBody CustomerFormQueryDTO queryDTO); + + /** + * @description item列表 + * + * @param formDto + * @return + * @author wxz + * @date 2021.10.28 15:19:59 + */ + @PostMapping("/oper/customize/icform/items") + Result> listItems(@RequestBody CustomerFormQueryDTO formDto); + + /** + * @Author sun + * @Description 居民信息新增查询各表必填字段 + **/ + @PostMapping("/oper/customize/icformitem/getmustcolumn/{customerId}") + Result> getMustColumn(@PathVariable("customerId") String customerId); + + @PostMapping("/oper/customize/icresicategorystatsconfig/categorylist") + Result> getCategoryList(@RequestBody IcResiCategoryStatsConfigDTO dto); + + + + @PostMapping("/oper/customize/resicategorystatsconfig/resicategorystatslistshowd") + Result> resiCategoryStatsListShowd(@RequestBody IcResiCategoryStatsConfigFormDTO formDTO); + + @PostMapping("/oper/customize/resicategorystatsconfig/resicategorywarnlist") + Result> resiCategoryWarnList(@RequestParam String customerId); + + @PostMapping("/oper/customize/resicategorystatsconfig/resicategorywarninfobyid") + Result resiCategoryWarnInfoById(@RequestBody IcResiCategoryWarnConfigDTO dto); + + /** + * @Description 查询志愿者类型 + * @param volunteers + * @author zxc + * @date 2021/11/8 10:02 上午 + */ + @PostMapping("/oper/customize/icformitemoptions/volunteerlabelbyvalues") + Result> volunteerLabelByValues(@RequestBody List volunteers,@RequestParam("customerId") String customerId); + + /** + * 使用item相关条件查询关联的options + * @param input + * @return + */ + @PostMapping("/oper/customize/icformitemoptions/list-by-item-conditions") + Result> listOptionsByItemConditions(@RequestBody IcFormOptionsQueryFormDTO input); + } diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java index 2fe50e5c9f..da282124bb 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java @@ -4,15 +4,15 @@ 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.CustomerFootBarDTO; -import com.epmet.dto.form.CheckFloatFootBarFormDTO; -import com.epmet.dto.form.CustomerFootBarFormDTO; -import com.epmet.dto.form.CustomerFunctionListFormDTO; -import com.epmet.dto.result.CheckFloatFootBarResultDTO; -import com.epmet.dto.result.DefaultFunctionListResultDTO; +import com.epmet.dto.IcFormItemOptionsDTO; +import com.epmet.dto.IcResiCategoryStatsConfigDTO; +import com.epmet.dto.IcResiCategoryWarnConfigDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.result.*; import com.epmet.feign.OperCustomizeOpenFeignClient; -import org.springframework.stereotype.Component; import java.util.List; +import java.util.Set; /** * 本服务对外开放的API,其他服务通过引用此client调用该服务 @@ -49,4 +49,64 @@ public class OperCustomizeOpenFeignClientFallback implements OperCustomizeOpenFe public Result checkFloatFootBar(CheckFloatFootBarFormDTO checkFloatFootBarFormDTO) { return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "checkFloatFootBar", checkFloatFootBarFormDTO); } + + @Override + public Result getCustomerForm(CustomerFormQueryDTO formDto) { + return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "getCustomerForm", formDto); + } + + @Override + public Result> queryConditions(CustomerFormQueryDTO formDto) { + return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "queryConditions", formDto); + } + + @Override + public Result> querySubTables(CustomerFormQueryDTO formDto) { + return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "querySubTables", formDto); + } + + @Override + public Result> queryIcResiSubTables(CustomerFormQueryDTO queryDTO) { + return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "queryIcResiSubTables", queryDTO); + } + + @Override + public Result> listItems(CustomerFormQueryDTO formDto) { + return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "listItems", formDto); + } + + @Override + public Result> getMustColumn(String customerId) { + return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "getMustColumn", customerId); + } + + @Override + public Result> getCategoryList(IcResiCategoryStatsConfigDTO dto) { + return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "getCategoryList", dto); + } + + @Override + public Result> resiCategoryStatsListShowd(IcResiCategoryStatsConfigFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "resiCategoryStatsListShowd",formDTO); + } + + @Override + public Result> resiCategoryWarnList(String customerId) { + return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "resiCategoryWarnList",customerId); + } + + @Override + public Result resiCategoryWarnInfoById(IcResiCategoryWarnConfigDTO dto) { + return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "resiCategoryWarnInfoById",dto); + } + + @Override + public Result> volunteerLabelByValues(List volunteers,String customerId) { + return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "volunteerLabelByValues",volunteers,customerId); + } + + @Override + public Result> listOptionsByItemConditions(IcFormOptionsQueryFormDTO input) { + return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "listOptionsByItemConditions", input); + } } diff --git a/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-prod.yml b/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-prod.yml index e95a43a4cd..5ccd050436 100644 --- a/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-prod.yml +++ b/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: oper-customize-server: container_name: oper-customize-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/oper-customize-server:0.3.49 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/oper-customize-server:0.3.64 ports: - "8089:8089" network_mode: host # 使用现有网络 @@ -15,4 +15,4 @@ services: resources: limits: cpus: '0.1' - memory: 600M \ No newline at end of file + memory: 600M diff --git a/epmet-module/oper-customize/oper-customize-server/pom.xml b/epmet-module/oper-customize/oper-customize-server/pom.xml index 2d04e9a1dd..295631391f 100644 --- a/epmet-module/oper-customize/oper-customize-server/pom.xml +++ b/epmet-module/oper-customize/oper-customize-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.49 + 0.3.70 com.epmet oper-customize @@ -267,7 +267,7 @@ false - false + true true diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/constant/IcResiCategoryStatsConfigConstant.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/constant/IcResiCategoryStatsConfigConstant.java new file mode 100644 index 0000000000..9919ca35f6 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/constant/IcResiCategoryStatsConfigConstant.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + *

+ * https://www.renren.io + *

+ * 版权所有,侵权必究! + */ + +package com.epmet.constant; + +/** + * 常量 + * @author sun + * @since 1.0.0 + */ +public interface IcResiCategoryStatsConfigConstant { + /** + * 是否需要预警 + */ + String WARN_YES = "1"; + String WARN_NO = "0"; + + String IC_RESI_USER = "ic_resi_user"; + + +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormController.java new file mode 100644 index 0000000000..8466ceb6a6 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormController.java @@ -0,0 +1,161 @@ +/** + * 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.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; +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.dto.form.CustomerFormQueryDTO; +import com.epmet.dto.result.*; +import com.epmet.service.IcFormItemService; +import com.epmet.service.IcFormService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.Set; + + +/** + * 配置表单 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +@RestController +@RequestMapping("icform") +public class IcFormController { + + @Autowired + private IcFormService icFormService; + @Autowired + private IcFormItemService icFormItemService; + + /** + * desc: 初始化 客户表单配置 + * + * @param customerId + * @param formCode + * @return com.epmet.commons.tools.utils.Result + * @author LiuJanJun + * @date 2021/12/8 4:28 下午 + */ + @GetMapping("initCustomerForm/{formCode}") + public Result initCustomerFormByCode(@RequestParam String customerId,@RequestParam String areaCode, + @PathVariable(value = "formCode") String formCode){ + if (StringUtils.isBlank(customerId)){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"参数错误"); + } + return new Result().ok(icFormService.initCustomerFormByCode(customerId, areaCode, formCode)); + } + + /** + * 获取居民信息表单 【dynamic=null】查询全部;否则查询对应的item + * + * @param formDto + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @date 2021/10/26 2:40 下午 + */ + @PostMapping("getcustomerform") + public Result getCustomerForm(@RequestHeader(required = false) String customerId, @RequestBody CustomerFormQueryDTO formDto){ + if (StringUtils.isBlank(formDto.getCustomerId())){ + formDto.setCustomerId(customerId); + } + ValidatorUtils.validateEntity(formDto,CustomerFormQueryDTO.AddUserInternalGroup.class); + return new Result().ok(icFormService.getCustomerForm(formDto)); + } + + + /** + * 获取居民信息的查询条件,组件列表 【dynamic=null】查询全部;否则查询对应的item + * + * @param tokenDto + * @param formDto + * @return com.epmet.commons.tools.utils.Result> + * @author yinzuomei + * @date 2021/10/27 9:18 上午 + */ + @PostMapping("conditionlist") + public Result> queryConditionList(@LoginUser TokenDto tokenDto, @RequestBody CustomerFormQueryDTO formDto){ + formDto.setCustomerId(tokenDto.getCustomerId()); + ValidatorUtils.validateEntity(formDto,CustomerFormQueryDTO.AddUserInternalGroup.class); + return new Result>().ok(icFormItemService.queryConditionList(formDto)); + } + + @PostMapping("tableheaders") + public Result> queryTableHeaderList(@LoginUser TokenDto tokenDto, @RequestBody CustomerFormQueryDTO formDto){ + formDto.setCustomerId(tokenDto.getCustomerId()); + ValidatorUtils.validateEntity(formDto,CustomerFormQueryDTO.AddUserInternalGroup.class); + return new Result>().ok(icFormItemService.queryTableHeaderList(formDto)); + } + + + /** + * feigin:返回用于列表展示的列 + * + * @param formQueryDTO + * @return com.epmet.commons.tools.utils.Result> + * @author yinzuomei + * @date 2021/11/1 12:54 下午 + */ + @PostMapping(value = "queryConditions") + Result> queryConditions(@RequestBody CustomerFormQueryDTO formQueryDTO) { + ValidatorUtils.validateEntity(formQueryDTO,CustomerFormQueryDTO.AddUserInternalGroup.class); + return new Result>().ok(icFormItemService.queryConditions(formQueryDTO.getCustomerId(),formQueryDTO.getFormCode())); + } + + /** + * 构造出所有子表关联语句 + * + * @param formQueryDTO + * @return com.epmet.commons.tools.utils.Result> + * @author yinzuomei + * @date 2021/11/1 1:25 下午 + */ + @PostMapping(value = "querySubTables") + Result> querySubTables(@RequestBody CustomerFormQueryDTO formQueryDTO){ + ValidatorUtils.validateEntity(formQueryDTO,CustomerFormQueryDTO.AddUserInternalGroup.class); + return new Result>().ok(icFormItemService.querySubTables(formQueryDTO.getCustomerId(),formQueryDTO.getFormCode())); + } + + @PostMapping(value = "queryIcResiSubTables") + Result> queryIcResiSubTables(@RequestBody CustomerFormQueryDTO queryDTO){ + ValidatorUtils.validateEntity(queryDTO,CustomerFormQueryDTO.AddUserInternalGroup.class); + return new Result>().ok(icFormItemService.queryIcResiSubTables(queryDTO.getCustomerId(),queryDTO.getFormCode())); + } + + /** + * @description item列表 + * + * @param formDto + * @return + * @author wxz + * @date 2021.10.28 15:19:59 + */ + @PostMapping("items") + public Result> listItems(@RequestBody CustomerFormQueryDTO formDto) { + ValidatorUtils.validateEntity(formDto, CustomerFormQueryDTO.GetFormInfoGroup.class); + List rst = icFormService.listItems(formDto.getCustomerId(), formDto.getFormCode()); + return new Result>().ok(rst); + } +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormItemController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormItemController.java new file mode 100644 index 0000000000..1cfe0d4276 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormItemController.java @@ -0,0 +1,54 @@ +/** + * 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.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.result.ColumnTableNameResultDTO; +import com.epmet.service.IcFormItemService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + + +/** + * 表单项 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +@RestController +@RequestMapping("icformitem") +public class IcFormItemController { + + @Autowired + private IcFormItemService icFormItemService; + + /** + * @Author sun + * @Description 居民信息新增查询各表必填字段 + **/ + @PostMapping("getmustcolumn/{customerId}") + public Result> getMustColumn(@PathVariable String customerId) { + return new Result>().ok(icFormItemService.getMustColumn(customerId)); + } + +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormItemGroupController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormItemGroupController.java new file mode 100644 index 0000000000..b4d0079637 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormItemGroupController.java @@ -0,0 +1,94 @@ +/** + * 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.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.IcFormItemGroupDTO; +import com.epmet.excel.IcFormItemGroupExcel; +import com.epmet.service.IcFormItemGroupService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 表单项分组 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +@RestController +@RequestMapping("icformitemgroup") +public class IcFormItemGroupController { + + @Autowired + private IcFormItemGroupService icFormItemGroupService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = icFormItemGroupService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + IcFormItemGroupDTO data = icFormItemGroupService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody IcFormItemGroupDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icFormItemGroupService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody IcFormItemGroupDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icFormItemGroupService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + icFormItemGroupService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = icFormItemGroupService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, IcFormItemGroupExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormItemOptionsController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormItemOptionsController.java new file mode 100644 index 0000000000..ed22604272 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormItemOptionsController.java @@ -0,0 +1,125 @@ +/** + * 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.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.IcFormItemOptionsDTO; +import com.epmet.dto.form.IcFormOptionsQueryFormDTO; +import com.epmet.excel.IcFormItemOptionsExcel; +import com.epmet.service.IcFormItemOptionsService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.servlet.tags.form.InputTag; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; +import java.util.function.IntUnaryOperator; + + +/** + * 表单项的选项 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +@RestController +@RequestMapping("icformitemoptions") +public class IcFormItemOptionsController { + + @Autowired + private IcFormItemOptionsService icFormItemOptionsService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = icFormItemOptionsService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + IcFormItemOptionsDTO data = icFormItemOptionsService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody IcFormItemOptionsDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icFormItemOptionsService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody IcFormItemOptionsDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icFormItemOptionsService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + icFormItemOptionsService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = icFormItemOptionsService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, IcFormItemOptionsExcel.class); + } + + /** + * @Description 查询志愿者类型 + * @param volunteers + * @author zxc + * @date 2021/11/8 10:02 上午 + */ + @PostMapping("volunteerlabelbyvalues") + public Result> volunteerLabelByValues(@RequestBody List volunteers,@RequestParam("customerId") String customerId){ + return new Result>().ok(icFormItemOptionsService.volunteerLabelByValues(volunteers,customerId)); + } + + /** + * 使用item相关条件查询关联的options + * @param input + * @return + */ + @PostMapping("list-by-item-conditions") + public Result> listOptionsByItemConditions(@RequestBody IcFormOptionsQueryFormDTO input) { + ValidatorUtils.validateEntity(input, IcFormOptionsQueryFormDTO.QueryByLabelAndCustomerIdForForm.class); + String customerId = input.getCustomerId(); + String formCode = input.getFormCode(); + String label = input.getLabel(); + + List r = icFormItemOptionsService.getOptionsByItemConditions(customerId, formCode, label); + return new Result>().ok(r); + } + + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcResiCategoryStatsConfigController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcResiCategoryStatsConfigController.java new file mode 100644 index 0000000000..70880418dd --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcResiCategoryStatsConfigController.java @@ -0,0 +1,99 @@ +/** + * 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.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.IcResiCategoryStatsConfigDTO; +import com.epmet.excel.IcResiCategoryStatsConfigExcel; +import com.epmet.service.IcResiCategoryStatsConfigService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 居民类别配置表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +@RestController +@RequestMapping("icresicategorystatsconfig") +public class IcResiCategoryStatsConfigController { + + @Autowired + private IcResiCategoryStatsConfigService icResiCategoryStatsConfigService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = icResiCategoryStatsConfigService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + IcResiCategoryStatsConfigDTO data = icResiCategoryStatsConfigService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody IcResiCategoryStatsConfigDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icResiCategoryStatsConfigService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody IcResiCategoryStatsConfigDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icResiCategoryStatsConfigService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + icResiCategoryStatsConfigService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = icResiCategoryStatsConfigService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, IcResiCategoryStatsConfigExcel.class); + } + + @PostMapping("categorylist") + public Result> getCategoryList(@RequestBody IcResiCategoryStatsConfigDTO dto) { + return new Result>().ok(icResiCategoryStatsConfigService.getCategoryList(dto)); + } + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcResiCategoryWarnConfigController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcResiCategoryWarnConfigController.java new file mode 100644 index 0000000000..5e1ac6667b --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcResiCategoryWarnConfigController.java @@ -0,0 +1,94 @@ +/** + * 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.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.IcResiCategoryWarnConfigDTO; +import com.epmet.excel.IcResiCategoryWarnConfigExcel; +import com.epmet.service.IcResiCategoryWarnConfigService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 居民类别预警配置表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +@RestController +@RequestMapping("icresicategorywarnconfig") +public class IcResiCategoryWarnConfigController { + + @Autowired + private IcResiCategoryWarnConfigService icResiCategoryWarnConfigService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = icResiCategoryWarnConfigService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + IcResiCategoryWarnConfigDTO data = icResiCategoryWarnConfigService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody IcResiCategoryWarnConfigDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icResiCategoryWarnConfigService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody IcResiCategoryWarnConfigDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icResiCategoryWarnConfigService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + icResiCategoryWarnConfigService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = icResiCategoryWarnConfigService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, IcResiCategoryWarnConfigExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/ItemTypeController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/ItemTypeController.java new file mode 100644 index 0000000000..d5f5142c74 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/ItemTypeController.java @@ -0,0 +1,94 @@ +/** + * 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.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.ItemTypeDTO; +import com.epmet.excel.ItemTypeExcel; +import com.epmet.service.ItemTypeService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 控件类型 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +@RestController +@RequestMapping("itemtype") +public class ItemTypeController { + + @Autowired + private ItemTypeService itemTypeService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = itemTypeService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + ItemTypeDTO data = itemTypeService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody ItemTypeDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + itemTypeService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody ItemTypeDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + itemTypeService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + itemTypeService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = itemTypeService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, ItemTypeExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/ResiCategoryStatsConfigController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/ResiCategoryStatsConfigController.java new file mode 100644 index 0000000000..99b6299afa --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/ResiCategoryStatsConfigController.java @@ -0,0 +1,168 @@ +/** + * 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.controller; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.constant.IcResiCategoryStatsConfigConstant; +import com.epmet.dao.IcResiCategoryStatsConfigDao; +import com.epmet.dao.IcResiCategoryWarnConfigDao; +import com.epmet.dto.IcResiCategoryStatsConfigDTO; +import com.epmet.dto.IcResiCategoryWarnConfigDTO; +import com.epmet.dto.form.IcResiCategoryStatsConfigFormDTO; +import com.epmet.dto.form.IcResiCategoryStatsConfigSortFormDTO; +import com.epmet.dto.form.ResiCategoryStatsConfigListFormDTO; +import com.epmet.dto.result.IcResiCategoryStatsConfigResultDTO; +import com.epmet.entity.IcResiCategoryStatsConfigEntity; +import com.epmet.entity.IcResiCategoryWarnConfigEntity; +import com.epmet.service.IcResiCategoryStatsConfigService; +import com.epmet.service.ResiCategoryStatsConfigService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.StringUtils; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + + +/** + * 居民类别配置表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +@RestController +@RequestMapping("resicategorystatsconfig") +public class ResiCategoryStatsConfigController { + + @Autowired + private IcResiCategoryStatsConfigService icResiCategoryStatsConfigService; + @Autowired + private ResiCategoryStatsConfigService resiCategoryStatsConfigService; + + @Resource + private IcResiCategoryWarnConfigDao icResiCategoryWarnConfigDao; + @Resource + private IcResiCategoryStatsConfigDao icResiCategoryStatsConfigDao; + + /** + * 居民类别配置列表 + * @return + */ + @PostMapping("list") + public Result> list(@LoginUser TokenDto tokenDTO,@RequestBody ResiCategoryStatsConfigListFormDTO formDTO){ + String customerId = tokenDTO.getCustomerId(); +// String customerId = "123123"; + return new Result>().ok(resiCategoryStatsConfigService.list(customerId,formDTO)); + } + + @PostMapping("update") + @NoRepeatSubmit + public Result update(@LoginUser TokenDto tokenDTO,@RequestBody IcResiCategoryStatsConfigFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, UpdateGroup.class); + String customerId = tokenDTO.getCustomerId(); +// String customerId = "123123"; + Integer level1 = formDTO.getLevel1(); + Integer level2 = formDTO.getLevel2(); + Integer level3 = formDTO.getLevel3(); + if(IcResiCategoryStatsConfigConstant.WARN_YES.equals(formDTO.getWarn())){ + //判断level1 和level2 的值 + if(null ==level1 || level1==0){ + return new Result().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"黄色预警阈值需大于0"); + } + if(null == level2 || level2==0){ + return new Result().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"红色预警阈值需大于0"); + } + if(level2<=level1){ + return new Result().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"黄色预警阈值需大于红色预警阈值"); + } + } + resiCategoryStatsConfigService.update(customerId,formDTO); + return new Result().ok("修改成功"); + } + @PostMapping("updatestatus") + public Result updateStatus(@LoginUser TokenDto tokenDTO,@RequestBody IcResiCategoryStatsConfigFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, IcResiCategoryStatsConfigFormDTO.UpdateStatusGroup.class); + String customerId = tokenDTO.getCustomerId(); +// String customerId = "123123"; + resiCategoryStatsConfigService.updateStatus(customerId,formDTO); + return new Result().ok("修改成功"); + } + @PostMapping("updatesort") + public Result updateSort(@LoginUser TokenDto tokenDTO,@RequestBody List formDTOs){ + for(IcResiCategoryStatsConfigSortFormDTO dto : formDTOs){ + ValidatorUtils.validateEntity(dto); + } + String customerId = tokenDTO.getCustomerId(); +// String customerId = "123123"; + resiCategoryStatsConfigService.updateSort(customerId,formDTOs); + return new Result(); + } + + @PostMapping("info") + public Result info(@LoginUser TokenDto tokenDTO,@RequestBody IcResiCategoryStatsConfigFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, IcResiCategoryStatsConfigFormDTO.SelectGroup.class); + return new Result().ok(resiCategoryStatsConfigService.info(formDTO.getId(),tokenDTO.getCustomerId())); + } + + @PostMapping("resicategorystatslistshowd") + public Result> resiCategoryStatsListShowd(@LoginUser TokenDto tokenDTO,@RequestBody IcResiCategoryStatsConfigFormDTO formDTO){ + //获取预警配置列表 + QueryWrapper queryWrapper = new QueryWrapper(); + queryWrapper.lambda() + .eq(IcResiCategoryStatsConfigEntity::getCustomerId,tokenDTO.getCustomerId()) + + .orderByAsc(IcResiCategoryStatsConfigEntity::getSort); + if(!StringUtils.isEmpty(formDTO.getStatus())){ + queryWrapper.lambda().eq(IcResiCategoryStatsConfigEntity::getStatus,formDTO.getStatus()); + } + + List statsConfigEntityList = icResiCategoryStatsConfigDao.selectList(queryWrapper); + + return new Result>().ok(ConvertUtils.sourceToTarget(statsConfigEntityList, IcResiCategoryStatsConfigDTO.class)); + } + + @PostMapping("resicategorywarnlist") + public Result> resiCategoryWarnList(@RequestParam String customerId){ + //获取预警配置列表 + List warnConfigEntityList = icResiCategoryWarnConfigDao.selectList(new QueryWrapper() + .lambda() + .eq(IcResiCategoryWarnConfigEntity::getCustomerId,customerId) + .eq(IcResiCategoryWarnConfigEntity::getWarn,"1") + .orderByAsc(IcResiCategoryWarnConfigEntity::getSort)); + + return new Result>().ok(ConvertUtils.sourceToTarget(warnConfigEntityList, IcResiCategoryWarnConfigDTO.class)); + } + @PostMapping("resicategorywarninfobyid") + public Result resiCategoryWarnInfoById(@RequestBody IcResiCategoryWarnConfigDTO dto){ + //获取预警配置列表 + if(StringUtils.isEmpty(dto.getId())){ + return new Result<>(); + } + return new Result().ok(ConvertUtils.sourceToTarget(icResiCategoryWarnConfigDao.selectById(dto.getId()),IcResiCategoryWarnConfigDTO.class)); + } + + +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcFormDao.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcFormDao.java new file mode 100644 index 0000000000..41928a94ce --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcFormDao.java @@ -0,0 +1,68 @@ +/** + * 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.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.CustomerFormResultDTO; +import com.epmet.dto.result.FormGroupDTO; +import com.epmet.dto.result.FormItemResult; +import com.epmet.dto.result.OptionDTO; +import com.epmet.entity.IcFormEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 配置表单 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +@Mapper +public interface IcFormDao extends BaseDao { + /** + * 查询表单 + * + * @param customerId + * @param formCode + * @return com.epmet.dto.result.CustomerFormResultDTO + * @author yinzuomei + * @date 2021/10/26 2:48 下午 + */ + CustomerFormResultDTO selectByCode(@Param("customerId") String customerId, @Param("formCode") String formCode); + + List selectItemList(@Param("formId") String formId, @Param("dynamic") Boolean dynamic); + + List selectItemListByGroupId(String groupId); + List selectListOption(String itemId); + + List selectListGroup(String formId); + + FormGroupDTO selectChildGroup(String itemId); + + /** + * @description 通用查询item列表,无固定条件 + * + * @param formId + * @return + * @author wxz + * @date 2021.10.28 16:43:00 + */ + List listItems(@Param("formId") String formId); +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcFormItemDao.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcFormItemDao.java new file mode 100644 index 0000000000..a0ad3ad839 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcFormItemDao.java @@ -0,0 +1,74 @@ +/** + * 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.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.ColumnTableNameResultDTO; +import com.epmet.dto.result.ConditionResultDTO; +import com.epmet.dto.result.IcFormResColumnDTO; +import com.epmet.dto.result.TableHeaderResultDTO; +import com.epmet.entity.IcFormItemEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Set; + +/** + * 表单项 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +@Mapper +public interface IcFormItemDao extends BaseDao { + + List selectConditionList(@Param("customerId") String customerId, @Param("formCode") String formCode); + + List queryTableHeaderList(@Param("customerId") String customerId, @Param("formCode") String formCode); + + /** + * 返回用于列表展示的列有哪些:table.列名 + * + * @param customerId + * @param formCode + * @return java.util.List + * @author yinzuomei + * @date 2021/11/1 12:58 下午 + */ + List queryConditions(@Param("customerId") String customerId, @Param("formCode")String formCode); + + /** + * 构造出所有子表关联语句 + * + * @param customerId + * @param formCode + * @return java.util.List + * @author yinzuomei + * @date 2021/11/1 1:25 下午 + */ + List querySubTables(@Param("customerId") String customerId, @Param("formCode")String formCode); + + Set queryIcResiSubTables(@Param("customerId") String customerId, @Param("formCode")String formCode); + + /** + * @Author sun + * @Description 居民信息新增查询各表必填字段 + **/ + List getMustColumn(@Param("customerId")String customerId); +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcFormItemGroupDao.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcFormItemGroupDao.java new file mode 100644 index 0000000000..d3b2322060 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcFormItemGroupDao.java @@ -0,0 +1,33 @@ +/** + * 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.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcFormItemGroupEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 表单项分组 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +@Mapper +public interface IcFormItemGroupDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcFormItemOptionsDao.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcFormItemOptionsDao.java new file mode 100644 index 0000000000..d731505e3d --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcFormItemOptionsDao.java @@ -0,0 +1,44 @@ +/** + * 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.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcFormItemOptionsEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 表单项的选项 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +@Mapper +public interface IcFormItemOptionsDao extends BaseDao { + + /** + * @Description 查询志愿者类型 + * @param volunteers + * @author zxc + * @date 2021/11/8 10:02 上午 + */ + List volunteerLabelByValues(@Param("volunteers") List volunteers,@Param("customerId")String customerId); + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcFormQueryBuilderDao.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcFormQueryBuilderDao.java new file mode 100644 index 0000000000..a142d8d637 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcFormQueryBuilderDao.java @@ -0,0 +1,33 @@ +/** + * 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.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcFormQueryBuilderEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 表单查询项 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-12-08 + */ +@Mapper +public interface IcFormQueryBuilderDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcResiCategoryStatsConfigDao.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcResiCategoryStatsConfigDao.java new file mode 100644 index 0000000000..95fd7c9222 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcResiCategoryStatsConfigDao.java @@ -0,0 +1,46 @@ +/** + * 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.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.IcResiCategoryStatsConfigResultDTO; +import com.epmet.entity.IcResiCategoryStatsConfigEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 居民类别配置表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +@Mapper +public interface IcResiCategoryStatsConfigDao extends BaseDao { + + /** + * 获取配置信息 + * @param customerId + * @param isWarn + * @param level + */ + List listInfo(@Param("customerId") String customerId, @Param("isWarn") Integer isWarn, @Param("level") Integer level); + + IcResiCategoryStatsConfigResultDTO info(@Param("id") String id,@Param("customerId") String customerId); +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcResiCategoryWarnConfigDao.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcResiCategoryWarnConfigDao.java new file mode 100644 index 0000000000..d9a9e0a2b0 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcResiCategoryWarnConfigDao.java @@ -0,0 +1,33 @@ +/** + * 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.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcResiCategoryWarnConfigEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 居民类别预警配置表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +@Mapper +public interface IcResiCategoryWarnConfigDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/ItemTypeDao.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/ItemTypeDao.java new file mode 100644 index 0000000000..ff4cb72d06 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/ItemTypeDao.java @@ -0,0 +1,33 @@ +/** + * 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.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.ItemTypeEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 控件类型 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +@Mapper +public interface ItemTypeDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcFormEntity.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcFormEntity.java new file mode 100644 index 0000000000..4b53f0af6d --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcFormEntity.java @@ -0,0 +1,61 @@ +/** + * 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.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 配置表单 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_form") +public class IcFormEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 表单CODE,从字典获取 + */ + private String formCode; + + /** + * 表单名称 + */ + private String formName; + + /** + * 地区码,有父级用父级 + */ + private String areaCode; + +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcFormItemEntity.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcFormItemEntity.java new file mode 100644 index 0000000000..c5c509ea25 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcFormItemEntity.java @@ -0,0 +1,138 @@ +/** + * 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.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 2021-10-26 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_form_item") +public class IcFormItemEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * + */ + private String areaCode; + + /** + * 表单ID + */ + private String formId; + + /** + * 表单CODE + */ + private String formCode; + + /** + * 父项ID + */ + private String parentItemId; + + /** + * 项标签 + */ + private String label; + + /** + * 控件类型,EG:INPUT;从字典获取 + */ + private String itemType; + + /** + * 分组ID,'默认,0' + */ + private String itemGroupId; + + /** + * 是否必填,1必填。0不必填 + */ + private Integer required; + + /** + * 手机号:mobile; 身份证:id_card + */ + private String validType; + + /** + * 默认值 + */ + private String defaultValue; + + /** + * 选项来源,REMOTE;LOCAL;如果是动态加载的下拉框或者CHECKBOX等的情况下使用。URL:接口获取(LABEL,VALUE);JSON:直接从JSON中取 + */ + private String optionSourceType; + + /** + * 来源地址,REMOTE才有,固定格式;如果OPTIONS_SOURCE是URL,则此处填写要调用的接口的URL相对路径,例如:/API/GOV/ORG/XXXX。此处不应设置参数,若需要参数应当完全由后端,通过TOKEN信息来获取 + */ + private String optionSourceValue; + + /** + * 排序 + */ + private Integer sort; + + /** + * 占位提示语 + */ + private String placeholder; + + /** + * 是否查询显示,1展示。0不展示 + */ + private Integer searchDisplay; + + /** + * 是否列表显示,1展示,0不展示 + */ + private Integer listDisplay; + + /** + * 是否需要支持数据分析,1支持。0不支持 + */ + private Integer dataAnalyse; + + /** + * 列名 + */ + private String columnName; + + /** + * 列名序号,根据表递增 + */ + private Integer columnNum; + +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcFormItemGroupEntity.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcFormItemGroupEntity.java new file mode 100644 index 0000000000..29e5cec078 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcFormItemGroupEntity.java @@ -0,0 +1,78 @@ +/** + * 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.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 2021-10-26 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_form_item_group") +public class IcFormItemGroupEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 表单ID + */ + private String formId; + + /** + * 表单编码 + */ + private String formCode; + + /** + * 对应的子表名称 + */ + private String tableName; + + /** + * 是否支持添加一行,1支持,默认0不支持 + */ + private Boolean supportAdd; + + /** + * 名称 + */ + private String label; + + /** + * 排序 + */ + private Integer sort; + + /** + * 1展示,0不展示,默认1 + */ + private Boolean display; + +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcFormItemOptionsEntity.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcFormItemOptionsEntity.java new file mode 100644 index 0000000000..1ef8d360db --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcFormItemOptionsEntity.java @@ -0,0 +1,76 @@ +/** + * 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.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 表单项的选项 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_form_item_options") +public class IcFormItemOptionsEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 表单ID + */ + private String formId; + + /** + * 表单CODE + */ + private String formCode; + + /** + * 表单项ID + */ + private String itemId; + + /** + * 可选项标签名 + */ + private String optionLabel; + + /** + * 标签value值 + */ + private String optionValue; + + /** + * 排序 + */ + private Integer sort; + +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcFormQueryBuilderEntity.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcFormQueryBuilderEntity.java new file mode 100644 index 0000000000..f8255baa01 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcFormQueryBuilderEntity.java @@ -0,0 +1,63 @@ +/** + * 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.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 2021-12-08 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_form_query_builder") +public class IcFormQueryBuilderEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * ic_form_item.id + */ + private String formItemId; + + /** + * ic_form.form_code,举例:resi_base_info + */ + private String formCode; + + /** + * 查询类型: equal, like,daterange.... + */ + private String queryType; + + /** + * 排序 + */ + private Integer sort; + +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcResiCategoryStatsConfigEntity.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcResiCategoryStatsConfigEntity.java new file mode 100644 index 0000000000..d0201db93d --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcResiCategoryStatsConfigEntity.java @@ -0,0 +1,83 @@ +/** + * 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.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 2021-11-04 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_resi_category_stats_config") +public class IcResiCategoryStatsConfigEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 项标签 + */ + private String label; + + /** + * 表名 + */ + private String tableName; + + /** + * 列名 + */ + private String columnName; + + /** + * 管理平台分类图标 + */ + private String managementIcon; + + /** + * 数据平台分类图标 + */ + private String dataIcon; + + /** + * 房屋显示分类图标 + */ + private String houseShowIcon; + + /** + * 状态 显示:show;隐藏:hidden + */ + private String status; + + /** + * 排序 + */ + private Integer sort; + +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcResiCategoryWarnConfigEntity.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcResiCategoryWarnConfigEntity.java new file mode 100644 index 0000000000..9175c282a6 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcResiCategoryWarnConfigEntity.java @@ -0,0 +1,89 @@ +/** + * 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.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 居民类别预警配置表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_resi_category_warn_config") +public class IcResiCategoryWarnConfigEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 项标签 + */ + private String label; + + /** + * 表名 + */ + private String tableName; + + /** + * 列名 + */ + private String columnName; + /** + * 是否预警 1 是 0 否 + */ + private String warn; + + /** + * 排序 + */ + private Integer sort; + + /** + * 等级1阈值 + */ + @TableField(value = "LEVEL_1") + private Integer level1; + + /** + * 等级2阈值 + */ + @TableField(value = "LEVEL_2") + private Integer level2; + + /** + * 等级3阈值 + */ + @TableField(value = "LEVEL_3") + private Integer level3; + +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/ItemTypeEntity.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/ItemTypeEntity.java new file mode 100644 index 0000000000..8c552c2f75 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/ItemTypeEntity.java @@ -0,0 +1,51 @@ +/** + * 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.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 控件类型 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("item_type") +public class ItemTypeEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 名称 + */ + private String name; + + /** + * CODE + */ + private String code; + +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/IcFormExcel.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/IcFormExcel.java new file mode 100644 index 0000000000..7f70adddfc --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/IcFormExcel.java @@ -0,0 +1,68 @@ +/** + * 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.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 配置表单 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +@Data +public class IcFormExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "表单CODE,从字典获取") + private String formCode; + + @Excel(name = "表单名称") + private String formName; + + @Excel(name = "地区码,有父级用父级") + private String areaCode; + + @Excel(name = "0未删除,1已删除") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/IcFormItemExcel.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/IcFormItemExcel.java new file mode 100644 index 0000000000..8e11613a01 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/IcFormItemExcel.java @@ -0,0 +1,116 @@ +/** + * 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.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 表单项 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +@Data +public class IcFormItemExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "") + private String areaCode; + + @Excel(name = "表单ID") + private String formId; + + @Excel(name = "表单CODE") + private String formCode; + + @Excel(name = "父项ID") + private String parentItemId; + + @Excel(name = "项标签") + private String label; + + @Excel(name = "控件类型,EG:INPUT;从字典获取") + private String itemType; + + @Excel(name = "分组ID,'默认,NONE'") + private String itemGroupId; + + @Excel(name = "是否必填,1必填。0不必填") + private Integer required; + + @Excel(name = "手机号:mobile; 身份证:id_card") + private String validType; + + @Excel(name = "默认值") + private String defaultValue; + + @Excel(name = "选项来源,REMOTE;LOCAL;如果是动态加载的下拉框或者CHECKBOX等的情况下使用。URL:接口获取(LABEL,VALUE);JSON:直接从JSON中取") + private String optionSourceType; + + @Excel(name = "来源地址,REMOTE才有,固定格式;如果OPTIONS_SOURCE是URL,则此处填写要调用的接口的URL相对路径,例如:/API/GOV/ORG/XXXX。此处不应设置参数,若需要参数应当完全由后端,通过TOKEN信息来获取") + private String optionSourceValue; + + @Excel(name = "排序") + private Integer sort; + + @Excel(name = "占位提示语") + private String placeholder; + + @Excel(name = "是否查询显示,1展示。0不展示") + private Integer searchDisplay; + + @Excel(name = "是否列表显示,1展示,0不展示") + private Integer listDisplay; + + @Excel(name = "是否需要支持数据分析,1支持。0不支持") + private Integer dataAnalyse; + + @Excel(name = "列名") + private String columnName; + + @Excel(name = "列名序号,根据表递增") + private Integer columnNum; + + @Excel(name = "0未删除,1已删除") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/IcFormItemGroupExcel.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/IcFormItemGroupExcel.java new file mode 100644 index 0000000000..0d9cb8c7b9 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/IcFormItemGroupExcel.java @@ -0,0 +1,80 @@ +/** + * 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.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 表单项分组 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +@Data +public class IcFormItemGroupExcel { + + @Excel(name = "分组id") + private String id; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "表单ID") + private String formId; + + @Excel(name = "表单编码") + private String formCode; + + @Excel(name = "对应的子表名称") + private String tableName; + + @Excel(name = "是否支持添加一行,1支持,默认0不支持") + private Integer supportAdd; + + @Excel(name = "名称") + private String label; + + @Excel(name = "排序") + private Integer sort; + + @Excel(name = "1展示,0不展示,默认1") + private Integer display; + + @Excel(name = "0未删除,1已删除") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/IcFormItemOptionsExcel.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/IcFormItemOptionsExcel.java new file mode 100644 index 0000000000..3f039890dc --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/IcFormItemOptionsExcel.java @@ -0,0 +1,77 @@ +/** + * 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.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 表单项的选项 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +@Data +public class IcFormItemOptionsExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "表单ID") + private String formId; + + @Excel(name = "表单CODE") + private String formCode; + + @Excel(name = "表单项ID") + private String itemId; + + @Excel(name = "可选项标签名") + private String optionLabel; + + @Excel(name = "标签value值") + private String optionValue; + + @Excel(name = "排序") + private Integer sort; + + @Excel(name = "0未删除,1已删除") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/IcResiCategoryStatsConfigExcel.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/IcResiCategoryStatsConfigExcel.java new file mode 100644 index 0000000000..1e8f335885 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/IcResiCategoryStatsConfigExcel.java @@ -0,0 +1,83 @@ +/** + * 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.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 居民类别配置表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +@Data +public class IcResiCategoryStatsConfigExcel { + + @Excel(name = "id") + private String id; + + @Excel(name = "客户id") + private String customerId; + + @Excel(name = "项标签") + private String label; + + @Excel(name = "表名") + private String tableName; + + @Excel(name = "列名") + private String columnName; + + @Excel(name = "管理平台分类图标") + private String managementIcon; + + @Excel(name = "数据平台分类图标") + private String dataIcon; + + @Excel(name = "房屋显示分类图标") + private String houseShowIcon; + + @Excel(name = "状态 显示:show;隐藏:hidden") + private String status; + + @Excel(name = "排序") + private Integer sort; + + @Excel(name = "删除标识:0.未删除 1.已删除") + private String delFlag; + + @Excel(name = "乐观锁") + private String revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private String createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/IcResiCategoryWarnConfigExcel.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/IcResiCategoryWarnConfigExcel.java new file mode 100644 index 0000000000..d9d5edf543 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/IcResiCategoryWarnConfigExcel.java @@ -0,0 +1,80 @@ +/** + * 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.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 居民类别预警配置表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +@Data +public class IcResiCategoryWarnConfigExcel { + + @Excel(name = "id") + private String id; + + @Excel(name = "客户id") + private String customerId; + + @Excel(name = "项标签") + private String label; + + @Excel(name = "表名") + private String tableName; + + @Excel(name = "列名") + private String columnName; + + @Excel(name = "排序") + private Integer sort; + + @Excel(name = "等级1阈值") + private Integer level1; + + @Excel(name = "等级2阈值") + private Integer level2; + + @Excel(name = "等级3阈值") + private Integer level3; + + @Excel(name = "删除标识:0.未删除 1.已删除") + private String delFlag; + + @Excel(name = "乐观锁") + private String revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private String createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/ItemTypeExcel.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/ItemTypeExcel.java new file mode 100644 index 0000000000..85db48a4c8 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/ItemTypeExcel.java @@ -0,0 +1,62 @@ +/** + * 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.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 控件类型 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +@Data +public class ItemTypeExcel { + + @Excel(name = "ID") + private String id; + + @Excel(name = "名称") + private String name; + + @Excel(name = "CODE") + private String code; + + @Excel(name = "0未删除,1已删除") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/mq/listener/InitCustomerComponentsListener.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/mq/listener/InitCustomerComponentsListener.java index d21ea39357..5980ad0a2a 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/mq/listener/InitCustomerComponentsListener.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/mq/listener/InitCustomerComponentsListener.java @@ -1,13 +1,17 @@ package com.epmet.mq.listener; import com.alibaba.fastjson.JSON; +import com.epmet.commons.rocketmq.constants.MQUserPropertys; import com.epmet.commons.rocketmq.messages.InitCustomerMQMsg; import com.epmet.commons.tools.distributedlock.DistributedLock; import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.redis.RedisKeys; +import com.epmet.commons.tools.redis.RedisUtils; import com.epmet.commons.tools.utils.SpringContextUtils; import com.epmet.dto.CustomerHomeDTO; import com.epmet.service.CustomerHomeService; +import org.apache.commons.lang3.StringUtils; import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext; import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus; import org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently; @@ -15,7 +19,6 @@ import org.apache.rocketmq.common.message.MessageExt; import org.redisson.api.RLock; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Component; import java.util.List; import java.util.concurrent.TimeUnit; @@ -28,8 +31,15 @@ public class InitCustomerComponentsListener implements MessageListenerConcurrent private Logger logger = LoggerFactory.getLogger(getClass()); + private RedisUtils redisUtils; + @Override public ConsumeConcurrentlyStatus consumeMessage(List msgs, ConsumeConcurrentlyContext context) { + + if (redisUtils == null) { + redisUtils = SpringContextUtils.getBean(RedisUtils.class); + } + try { msgs.forEach(msg -> consumeMessage(msg)); } catch (Exception e) { @@ -41,6 +51,7 @@ public class InitCustomerComponentsListener implements MessageListenerConcurrent private void consumeMessage(MessageExt messageExt) { String msg = new String(messageExt.getBody()); + String pendingMsgLabel = messageExt.getUserProperty(MQUserPropertys.BLOCKED_MSG_LABEL); logger.info("初始化客户-初始化客户自定义信息-收到消息内容:{}", msg); InitCustomerMQMsg msgObj = JSON.parseObject(msg, InitCustomerMQMsg.class); @@ -66,6 +77,28 @@ public class InitCustomerComponentsListener implements MessageListenerConcurrent } finally { distributedLock.unLock(lock); } + + if (StringUtils.isNotBlank(pendingMsgLabel)) { + try { + removePendingMqMsgCache(pendingMsgLabel); + } catch (Exception e) { + logger.error("【开放数据事件监听器】-删除mq阻塞消息缓存失败:{}", ExceptionUtils.getErrorStackTrace(e)); + } + } + } + + /** + * @description + * + * @param pendingMsgLabel + * @return + * @author wxz + * @date 2021.10.14 16:32:32 + */ + private void removePendingMqMsgCache(String pendingMsgLabel) { + String key = RedisKeys.blockedMqMsgKey(pendingMsgLabel); + redisUtils.delete(key); + //logger.info("【开放数据事件监听器】删除mq滞留消息缓存成功,blockedMsgLabel:{}", pendingMsgLabel); } /* @Override diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/CustomerFootBarRedis.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/CustomerFootBarRedis.java index 1d120429d8..0c549999ed 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/CustomerFootBarRedis.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/CustomerFootBarRedis.java @@ -17,9 +17,15 @@ package com.epmet.redis; +import cn.hutool.core.bean.BeanUtil; +import com.epmet.commons.tools.redis.RedisKeys; import com.epmet.commons.tools.redis.RedisUtils; +import com.epmet.dto.result.CustomerFormResultDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; +import org.springframework.util.CollectionUtils; + +import java.util.Map; /** * APP底部菜单栏信息 @@ -44,4 +50,37 @@ public class CustomerFootBarRedis { return null; } + public void deleteIcForm(String formCode,String customerId) { + String key = RedisKeys.getIcFormKeyForAdd(formCode,customerId); + redisUtils.delete(key); + } + + public void setCustomerFormResultDTO(String formCode,String customerId, CustomerFormResultDTO value,Boolean dynamic){ + String key=""; + if (null != dynamic && dynamic) { + //新增表单 + key = RedisKeys.getIcFormKeyForAdd(formCode,customerId); + }else{ + //导出 + key = RedisKeys.getIcFormKeyForExport(formCode,customerId); + } + Map map = BeanUtil.beanToMap(value, false, true); + redisUtils.hMSet(key, map); + } + + public CustomerFormResultDTO getCustomerFormResultDTO(String formCode,String customerId,Boolean dynamic){ + String key=""; + if (null != dynamic && dynamic) { + //新增表单 + key = RedisKeys.getIcFormKeyForAdd(formCode,customerId); + }else{ + //导出 + key = RedisKeys.getIcFormKeyForExport(formCode,customerId); + } + Map resultMap = redisUtils.hGetAll(key); + if (CollectionUtils.isEmpty(resultMap)) { + return null; + } + return BeanUtil.mapToBean(resultMap, CustomerFormResultDTO.class, true); + } } \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/IcResiCategoryStatsConfigRedis.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/IcResiCategoryStatsConfigRedis.java new file mode 100644 index 0000000000..789965c0c9 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/IcResiCategoryStatsConfigRedis.java @@ -0,0 +1,47 @@ +/** + * 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.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 居民类别配置表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +@Component +public class IcResiCategoryStatsConfigRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerStaffAgencyRedis.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/IcResiCategoryWarnConfigRedis.java similarity index 91% rename from epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerStaffAgencyRedis.java rename to epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/IcResiCategoryWarnConfigRedis.java index fa3f4c59f5..eee6ae7fc6 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerStaffAgencyRedis.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/IcResiCategoryWarnConfigRedis.java @@ -22,13 +22,13 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; /** - * 人员-机关单位关系表 + * 居民类别预警配置表 * * @author generator generator@elink-cn.com - * @since v1.0.0 2020-04-20 + * @since v1.0.0 2021-11-04 */ @Component -public class CustomerStaffAgencyRedis { +public class IcResiCategoryWarnConfigRedis { @Autowired private RedisUtils redisUtils; diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcFormItemGroupService.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcFormItemGroupService.java new file mode 100644 index 0000000000..79402d6273 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcFormItemGroupService.java @@ -0,0 +1,95 @@ +/** + * 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.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcFormItemGroupDTO; +import com.epmet.entity.IcFormItemGroupEntity; + +import java.util.List; +import java.util.Map; + +/** + * 表单项分组 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +public interface IcFormItemGroupService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-10-26 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-10-26 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcFormItemGroupDTO + * @author generator + * @date 2021-10-26 + */ + IcFormItemGroupDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-10-26 + */ + void save(IcFormItemGroupDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-10-26 + */ + void update(IcFormItemGroupDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-10-26 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcFormItemOptionsService.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcFormItemOptionsService.java new file mode 100644 index 0000000000..7423f85289 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcFormItemOptionsService.java @@ -0,0 +1,112 @@ +/** + * 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.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcFormItemOptionsDTO; +import com.epmet.entity.IcFormItemOptionsEntity; + +import java.util.List; +import java.util.Map; + +/** + * 表单项的选项 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +public interface IcFormItemOptionsService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-10-26 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-10-26 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcFormItemOptionsDTO + * @author generator + * @date 2021-10-26 + */ + IcFormItemOptionsDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-10-26 + */ + void save(IcFormItemOptionsDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-10-26 + */ + void update(IcFormItemOptionsDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-10-26 + */ + void delete(String[] ids); + + /** + * @Description 查询志愿者类型 + * @param volunteers + * @author zxc + * @date 2021/11/8 10:02 上午 + */ + List volunteerLabelByValues(List volunteers, String customerId); + + /** + * 使用item相关条件查询options + * @param customerId + * @param formCode + * @param label + * @return + */ + List getOptionsByItemConditions(String customerId, String formCode, String label); +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcFormItemService.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcFormItemService.java new file mode 100644 index 0000000000..575e31d6b1 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcFormItemService.java @@ -0,0 +1,61 @@ +/** + * 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.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.form.CustomerFormQueryDTO; +import com.epmet.dto.result.ColumnTableNameResultDTO; +import com.epmet.dto.result.ConditionResultDTO; +import com.epmet.dto.result.IcFormResColumnDTO; +import com.epmet.dto.result.TableHeaderResultDTO; +import com.epmet.entity.IcFormItemEntity; + +import java.util.List; +import java.util.Set; + +/** + * 表单项 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +public interface IcFormItemService extends BaseService { + /** + * 获取居民信息的查询条件,组件列表 + * + * @param formDto + * @return java.util.List + * @author yinzuomei + * @date 2021/10/27 9:19 上午 + */ + List queryConditionList(CustomerFormQueryDTO formDto); + + List queryTableHeaderList(CustomerFormQueryDTO formDto); + + List queryConditions(String customerId,String formCode); + + List querySubTables(String customerId, String formCode); + + Set queryIcResiSubTables(String customerId, String formCode); + + /** + * @Author sun + * @Description 居民信息新增查询各表必填字段 + **/ + List getMustColumn(String customerId); +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcFormService.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcFormService.java new file mode 100644 index 0000000000..7bbc7ca275 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcFormService.java @@ -0,0 +1,57 @@ +/** + * 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.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.form.CustomerFormQueryDTO; +import com.epmet.dto.result.CustomerFormResultDTO; +import com.epmet.dto.result.FormItemResult; +import com.epmet.entity.IcFormEntity; + +import java.util.List; + +/** + * 配置表单 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +public interface IcFormService extends BaseService { + /** + * 获取居民信息表单 + * + * @param formDto + * @return com.epmet.dto.result.CustomerFormResultDTO + * @author yinzuomei + * @date 2021/10/26 2:41 下午 + */ + CustomerFormResultDTO getCustomerForm(CustomerFormQueryDTO formDto); + + /** + * @description 查询item列表 + * + * @param customerId + * @param formCode + * @return + * @author wxz + * @date 2021.10.27 17:41:59 + */ + List listItems(String customerId, String formCode); + + String initCustomerFormByCode(String customerId, String areaCode, String formCode); +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcResiCategoryStatsConfigService.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcResiCategoryStatsConfigService.java new file mode 100644 index 0000000000..aa99453387 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcResiCategoryStatsConfigService.java @@ -0,0 +1,104 @@ +/** + * 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.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcResiCategoryStatsConfigDTO; +import com.epmet.entity.IcResiCategoryStatsConfigEntity; + +import java.util.List; +import java.util.Map; + +/** + * 居民类别配置表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +public interface IcResiCategoryStatsConfigService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-11-04 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-11-04 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcResiCategoryStatsConfigDTO + * @author generator + * @date 2021-11-04 + */ + IcResiCategoryStatsConfigDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-11-04 + */ + void save(IcResiCategoryStatsConfigDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-11-04 + */ + void update(IcResiCategoryStatsConfigDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-11-04 + */ + void delete(String[] ids); + + /** + * @Description 获取居民类别 + * @Param dto + * @Return {@link List< IcResiCategoryStatsConfigDTO>} + * @Author zhaoqifeng + * @Date 2021/11/5 15:43 + */ + List getCategoryList(IcResiCategoryStatsConfigDTO dto); +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcResiCategoryWarnConfigService.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcResiCategoryWarnConfigService.java new file mode 100644 index 0000000000..bef9c7360f --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcResiCategoryWarnConfigService.java @@ -0,0 +1,95 @@ +/** + * 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.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcResiCategoryWarnConfigDTO; +import com.epmet.entity.IcResiCategoryWarnConfigEntity; + +import java.util.List; +import java.util.Map; + +/** + * 居民类别预警配置表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +public interface IcResiCategoryWarnConfigService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-11-04 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-11-04 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcResiCategoryWarnConfigDTO + * @author generator + * @date 2021-11-04 + */ + IcResiCategoryWarnConfigDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-11-04 + */ + void save(IcResiCategoryWarnConfigDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-11-04 + */ + void update(IcResiCategoryWarnConfigDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-11-04 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/ItemTypeService.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/ItemTypeService.java new file mode 100644 index 0000000000..27f16dc45d --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/ItemTypeService.java @@ -0,0 +1,95 @@ +/** + * 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.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.ItemTypeDTO; +import com.epmet.entity.ItemTypeEntity; + +import java.util.List; +import java.util.Map; + +/** + * 控件类型 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +public interface ItemTypeService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-10-26 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-10-26 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ItemTypeDTO + * @author generator + * @date 2021-10-26 + */ + ItemTypeDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-10-26 + */ + void save(ItemTypeDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-10-26 + */ + void update(ItemTypeDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-10-26 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/ResiCategoryStatsConfigService.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/ResiCategoryStatsConfigService.java new file mode 100644 index 0000000000..c9a4ff28b7 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/ResiCategoryStatsConfigService.java @@ -0,0 +1,49 @@ +/** + * 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.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcResiCategoryStatsConfigDTO; +import com.epmet.dto.form.IcResiCategoryStatsConfigFormDTO; +import com.epmet.dto.form.IcResiCategoryStatsConfigSortFormDTO; +import com.epmet.dto.form.ResiCategoryStatsConfigListFormDTO; +import com.epmet.dto.result.IcResiCategoryStatsConfigResultDTO; +import com.epmet.entity.IcResiCategoryStatsConfigEntity; + +import java.util.List; +import java.util.Map; + +/** + * 居民类别配置表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +public interface ResiCategoryStatsConfigService { + + List list(String customerId, ResiCategoryStatsConfigListFormDTO formDTO); + + IcResiCategoryStatsConfigResultDTO info(String id,String customerId); + + void update(String customerId,IcResiCategoryStatsConfigFormDTO formDTO); + + void updateStatus(String customerId,IcResiCategoryStatsConfigFormDTO formDTO); + + void updateSort(String customerId,List formDTOs); +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormItemGroupServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormItemGroupServiceImpl.java new file mode 100644 index 0000000000..2de0adc908 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormItemGroupServiceImpl.java @@ -0,0 +1,100 @@ +/** + * 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.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.IcFormItemGroupDao; +import com.epmet.dto.IcFormItemGroupDTO; +import com.epmet.entity.IcFormItemGroupEntity; +import com.epmet.service.IcFormItemGroupService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 表单项分组 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +@Service +public class IcFormItemGroupServiceImpl extends BaseServiceImpl implements IcFormItemGroupService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcFormItemGroupDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcFormItemGroupDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcFormItemGroupDTO get(String id) { + IcFormItemGroupEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcFormItemGroupDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcFormItemGroupDTO dto) { + IcFormItemGroupEntity entity = ConvertUtils.sourceToTarget(dto, IcFormItemGroupEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcFormItemGroupDTO dto) { + IcFormItemGroupEntity entity = ConvertUtils.sourceToTarget(dto, IcFormItemGroupEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormItemOptionsServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormItemOptionsServiceImpl.java new file mode 100644 index 0000000000..970845cbee --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormItemOptionsServiceImpl.java @@ -0,0 +1,146 @@ +/** + * 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.service.impl; + +import cn.hutool.core.bean.BeanUtil; +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; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.IcFormItemDao; +import com.epmet.dao.IcFormItemOptionsDao; +import com.epmet.dto.IcFormItemOptionsDTO; +import com.epmet.entity.IcFormItemEntity; +import com.epmet.entity.IcFormItemOptionsEntity; +import com.epmet.service.IcFormItemOptionsService; +import org.apache.commons.lang3.StringUtils; +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; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 表单项的选项 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +@Service +public class IcFormItemOptionsServiceImpl extends BaseServiceImpl implements IcFormItemOptionsService { + + @Autowired + private IcFormItemDao icFormItemDao; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcFormItemOptionsDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcFormItemOptionsDTO.class); + } + + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcFormItemOptionsDTO get(String id) { + IcFormItemOptionsEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcFormItemOptionsDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcFormItemOptionsDTO dto) { + IcFormItemOptionsEntity entity = ConvertUtils.sourceToTarget(dto, IcFormItemOptionsEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcFormItemOptionsDTO dto) { + IcFormItemOptionsEntity entity = ConvertUtils.sourceToTarget(dto, IcFormItemOptionsEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @param volunteers + * @Description 查询志愿者类型 + * @author zxc + * @date 2021/11/8 10:02 上午 + */ + @Override + public List volunteerLabelByValues(List volunteers, String customerId) { + return baseDao.volunteerLabelByValues(volunteers, customerId); + } + + @Override + public List getOptionsByItemConditions(String customerId, String formCode, String label) { + + // 查询item + LambdaQueryWrapper formItemQuery = new LambdaQueryWrapper<>(); + formItemQuery.eq(IcFormItemEntity::getCustomerId, customerId); + formItemQuery.eq(IcFormItemEntity::getFormCode, formCode); + formItemQuery.eq(IcFormItemEntity::getLabel, label); + IcFormItemEntity item = icFormItemDao.selectOne(formItemQuery); + + if (item == null) { + return new ArrayList<>(); + } + + // 通过item查询options + LambdaQueryWrapper query = new LambdaQueryWrapper<>(); + query.eq(IcFormItemOptionsEntity::getItemId, item.getId()); + query.orderByAsc(IcFormItemOptionsEntity::getSort); + + // 属性拷贝 + return baseDao.selectList(query).stream().map(o -> { + IcFormItemOptionsDTO oDTO = new IcFormItemOptionsDTO(); + BeanUtil.copyProperties(o, oDTO); + return oDTO; + }).collect(Collectors.toList()); + } +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormItemServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormItemServiceImpl.java new file mode 100644 index 0000000000..00c79db52c --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormItemServiceImpl.java @@ -0,0 +1,121 @@ +/** + * 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.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.IcFormItemDao; +import com.epmet.dto.IcFormItemDTO; +import com.epmet.dto.form.CustomerFormQueryDTO; +import com.epmet.dto.result.ColumnTableNameResultDTO; +import com.epmet.dto.result.ConditionResultDTO; +import com.epmet.dto.result.IcFormResColumnDTO; +import com.epmet.dto.result.TableHeaderResultDTO; +import com.epmet.entity.IcFormItemEntity; +import com.epmet.service.IcFormItemService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.*; + +/** + * 表单项 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +@Service +public class IcFormItemServiceImpl extends BaseServiceImpl implements IcFormItemService { + + /** + * 获取居民信息的查询条件,组件列表 + * + * @param formDto + * @return java.util.List + * @author yinzuomei + * @date 2021/10/27 9:19 上午 + */ + @Override + public List queryConditionList(CustomerFormQueryDTO formDto) { + List list=baseDao.selectConditionList(formDto.getCustomerId(),formDto.getFormCode()); + return list; + } + + @Override + public List queryTableHeaderList(CustomerFormQueryDTO formDto) { + List list=new ArrayList<>(); + //list.add(new TableHeaderResultDTO("所在网格","GRID_NAME","input")); + //list.add(new TableHeaderResultDTO("小区","VILLAGE_NAME","input")); + //list.add(new TableHeaderResultDTO("楼栋","BUILD_NAME","input")); + //list.add(new TableHeaderResultDTO("单元","UNIT_NAME","input")); + //list.add(new TableHeaderResultDTO("所在家庭","HOME_NAME","input")); + List result=baseDao.queryTableHeaderList(formDto.getCustomerId(),formDto.getFormCode()); + if(!CollectionUtils.isEmpty(result)){ + list.addAll(result); + } + //list.add(new TableHeaderResultDTO("需求分类","DEMAND_NAME","input")); + TableHeaderResultDTO categoryName=new TableHeaderResultDTO(); + categoryName.setItemType("input"); + categoryName.setItemId(StrConstant.EPMETY_STR); + categoryName.setColumnName("CATEGORY_NAME"); + categoryName.setLabel("居民需求"); + categoryName.setOptions(new ArrayList<>()); + list.add(categoryName); + + TableHeaderResultDTO houseType=new TableHeaderResultDTO(); + houseType.setItemType("input"); + houseType.setItemId(StrConstant.EPMETY_STR); + houseType.setColumnName("HOUSE_TYPE"); + houseType.setLabel("房屋类型"); + houseType.setOptions(new ArrayList<>()); + list.add(houseType); + return list; + } + + @Override + public List queryConditions(String customerId,String formCode) { + return baseDao.queryConditions(customerId,formCode); + } + + @Override + public List querySubTables(String customerId, String formCode) { + return baseDao.querySubTables(customerId,formCode); + } + + @Override + public Set queryIcResiSubTables(String customerId, String formCode) { + return baseDao.queryIcResiSubTables(customerId,formCode); + } + + /** + * @Author sun + * @Description 居民信息新增查询各表必填字段 + **/ + @Override + public List getMustColumn(String customerId) { + return baseDao.getMustColumn(customerId); + } + +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormServiceImpl.java new file mode 100644 index 0000000000..3d453ea38c --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormServiceImpl.java @@ -0,0 +1,274 @@ +/** + * 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.service.impl; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +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.redis.RedisKeys; +import com.epmet.commons.tools.redis.RedisUtils; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.dao.*; +import com.epmet.dto.form.CustomerFormQueryDTO; +import com.epmet.dto.result.CustomerFormResultDTO; +import com.epmet.dto.result.FormGroupDTO; +import com.epmet.dto.result.FormItemResult; +import com.epmet.entity.*; +import com.epmet.redis.CustomerFootBarRedis; +import com.epmet.service.IcFormService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.Date; +import java.util.List; + +/** + * 配置表单 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +@Slf4j +@Service +public class IcFormServiceImpl extends BaseServiceImpl implements IcFormService { + @Autowired + private CustomerFootBarRedis customerFootBarRedis; + + @Autowired + private RedisUtils redisUtils; + @Autowired + private IcFormItemDao icFormItemDao; + @Autowired + private IcFormItemOptionsDao icFormItemOptionsDao; + @Autowired + private IcFormItemGroupDao icFormItemGroupDao; + @Autowired + private IcFormQueryBuilderDao icFormQueryBuilderDao; + @Autowired + private IcResiCategoryStatsConfigDao icResiCategoryStatsConfigDao; + @Autowired + private IcResiCategoryWarnConfigDao icResiCategoryWarnConfigDao; + + /** + * 获取居民信息表单 + * + * @param formDto + * @return com.epmet.dto.result.CustomerFormResultDTO + * @author yinzuomei + * @date 2021/10/26 2:41 下午 + */ + @Override + public CustomerFormResultDTO getCustomerForm(CustomerFormQueryDTO formDto) { + CustomerFormResultDTO customerFormResultDTO = customerFootBarRedis.getCustomerFormResultDTO(formDto.getFormCode(), formDto.getCustomerId(), formDto.getDynamic()); + if (null != customerFormResultDTO) { + return customerFormResultDTO; + } + CustomerFormResultDTO resultDTO = baseDao.selectByCode(formDto.getCustomerId(), formDto.getFormCode()); + if (null == resultDTO) { + throw new RenException(EpmetErrorCode.CUSTOMER_FORM_NOT_EXITS.getCode(), EpmetErrorCode.CUSTOMER_FORM_NOT_EXITS.getMsg()); + } + List itemList = baseDao.selectItemList(resultDTO.getFormId(), formDto.getDynamic()); + List groupList = baseDao.selectListGroup(resultDTO.getFormId()); + resultDTO.setItemList(itemList); + resultDTO.setGroupList(groupList); + customerFootBarRedis.setCustomerFormResultDTO(formDto.getFormCode(), formDto.getCustomerId(), resultDTO, formDto.getDynamic()); + return resultDTO; + } + + @Override + public List listItems(String customerId, String formCode) { + // 从redis取 + String icFormItemsKey = RedisKeys.getIcFormItemsKey(customerId, formCode); + + Object objValue = redisUtils.get(icFormItemsKey); + if (objValue != null) { + return ((JSONArray) objValue).toJavaList(FormItemResult.class); + //return JSON.parseObject((String) objValue, type); + } + + // 从db取 + CustomerFormResultDTO formResultDto = baseDao.selectByCode(customerId, formCode); + if (null == formResultDto) { + throw new RenException(EpmetErrorCode.CUSTOMER_FORM_NOT_EXITS.getCode(), EpmetErrorCode.CUSTOMER_FORM_NOT_EXITS.getMsg()); + } + + List formItemResults = baseDao.listItems(formResultDto.getFormId()); + formItemResults.forEach(i -> { + i.setOptions(baseDao.selectListOption(i.getItemId())); + }); + + // 缓存 + redisUtils.set(icFormItemsKey, formItemResults); + + return formItemResults; + } + + @Transactional(rollbackFor = Exception.class) + @Override + public String initCustomerFormByCode(String customerId, String areaCode, String formCode) { + CustomerFormResultDTO formResultDTO = baseDao.selectByCode(customerId, formCode); + if (formResultDTO != null) { + return "该客户已经存在了表单的数据"; + } + String defaultCustomerId = "default"; + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcFormEntity::getCustomerId, defaultCustomerId); + wrapper.eq(IcFormEntity::getFormCode, formCode); + IcFormEntity defaultIcForm = baseDao.selectOne(wrapper); + if (defaultIcForm == null) { + return "默认配置错误"; + } + + //统一前缀 + String newPrefixed = DateUtils.format(new Date(), DateUtils.DATE_TIME_NO_SPLIT) + StrConstant.UNDER_LINE; + String newFormId = newPrefixed + defaultIcForm.getId(); + defaultIcForm.setId(newFormId); + defaultIcForm.setCustomerId(customerId); + defaultIcForm.setAreaCode(areaCode); + defaultIcForm.setCreatedBy("init_user"); + defaultIcForm.setCreatedTime(new Date()); + defaultIcForm.setUpdatedBy("init_user"); + defaultIcForm.setUpdatedTime(new Date()); + + int insert = baseDao.insert(defaultIcForm); + log.info("insert icForm:" + insert); + + LambdaQueryWrapper wrapperItem = new LambdaQueryWrapper<>(); + wrapperItem.eq(IcFormItemEntity::getCustomerId, defaultCustomerId); + wrapperItem.eq(IcFormItemEntity::getFormCode, formCode); + List itemList = icFormItemDao.selectList(wrapperItem); + if (CollectionUtils.isEmpty(itemList)) { + return "默认配置错误"; + } + //设置item + itemList.forEach(item -> { + item.setId(newPrefixed + item.getId()); + item.setCustomerId(customerId); + item.setFormId(newFormId); + item.setAreaCode(areaCode); + item.setParentItemId(newPrefixed + item.getParentItemId()); + //分组Id 为0 说明不村子分组 则直接不设置 仍然为0 + if (!NumConstant.ZERO_STR.equals(item.getItemGroupId())){ + item.setItemGroupId(newPrefixed + item.getItemGroupId()); + } + String optionSourceValue = item.getOptionSourceValue(); + if (StringUtils.isNotBlank(optionSourceValue) && optionSourceValue.contains(StrConstant.QUESTION_MARK)){ + //多个参数 + String[] paramArr = optionSourceValue.split(StrConstant.QUESTION_MARK_TRANSFER)[NumConstant.ONE].split(StrConstant.AND_MARK); + for (String o : paramArr) { + optionSourceValue = optionSourceValue.replace(o, newPrefixed + o); + } + item.setOptionSourceValue(optionSourceValue); + } + item.setCreatedBy("init_user"); + item.setCreatedTime(new Date()); + item.setUpdatedBy("init_user"); + item.setUpdatedTime(new Date()); + log.debug("item:"+ JSON.toJSONString(item)); + icFormItemDao.insert(item); + }); + + LambdaQueryWrapper wrapperOptions = new LambdaQueryWrapper<>(); + wrapperOptions.eq(IcFormItemOptionsEntity::getCustomerId, defaultCustomerId); + wrapperOptions.eq(IcFormItemOptionsEntity::getFormCode, formCode); + List optionsList = icFormItemOptionsDao.selectList(wrapperOptions); + optionsList.forEach(item -> { + item.setId(newPrefixed + item.getId()); + item.setCustomerId(customerId); + item.setFormId(newFormId); + item.setItemId(newPrefixed + item.getItemId()); + item.setCreatedBy("init_user"); + item.setCreatedTime(new Date()); + item.setUpdatedBy("init_user"); + item.setUpdatedTime(new Date()); + log.debug("option:"+ JSON.toJSONString(item)); + icFormItemOptionsDao.insert(item); + }); + + LambdaQueryWrapper wrapperGroup = new LambdaQueryWrapper<>(); + wrapperGroup.eq(IcFormItemGroupEntity::getCustomerId, defaultCustomerId); + wrapperGroup.eq(IcFormItemGroupEntity::getFormCode, formCode); + List groupList = icFormItemGroupDao.selectList(wrapperGroup); + groupList.forEach(item -> { + item.setId(newPrefixed + item.getId()); + item.setCustomerId(customerId); + item.setFormId(newFormId); + item.setCreatedBy("init_user"); + item.setCreatedTime(new Date()); + item.setUpdatedBy("init_user"); + item.setUpdatedTime(new Date()); + log.debug("group:"+ JSON.toJSONString(item)); + icFormItemGroupDao.insert(item); + }); + + LambdaQueryWrapper wrapperQuery = new LambdaQueryWrapper<>(); + wrapperQuery.eq(IcFormQueryBuilderEntity::getCustomerId, defaultCustomerId); + wrapperQuery.eq(IcFormQueryBuilderEntity::getFormCode, formCode); + List queryList = icFormQueryBuilderDao.selectList(wrapperQuery); + queryList.forEach(item -> { + item.setId(newPrefixed + item.getId()); + item.setCustomerId(customerId); + item.setFormItemId(newPrefixed + item.getFormItemId()); + item.setCreatedBy("init_user"); + item.setCreatedTime(new Date()); + item.setUpdatedBy("init_user"); + item.setUpdatedTime(new Date()); + log.debug("query:"+ JSON.toJSONString(item)); + icFormQueryBuilderDao.insert(item); + }); + + LambdaQueryWrapper wrapperStats = new LambdaQueryWrapper<>(); + wrapperStats.eq(IcResiCategoryStatsConfigEntity::getCustomerId, defaultCustomerId); + List statsConfigList = icResiCategoryStatsConfigDao.selectList(wrapperStats); + statsConfigList.forEach(item -> { + item.setId(newPrefixed + item.getId()); + item.setCustomerId(customerId); + item.setCreatedBy("init_user"); + item.setCreatedTime(new Date()); + item.setUpdatedBy("init_user"); + item.setUpdatedTime(new Date()); + log.debug("stats:"+ JSON.toJSONString(item)); + icResiCategoryStatsConfigDao.insert(item); + }); + + LambdaQueryWrapper wrapperWarn = new LambdaQueryWrapper<>(); + wrapperWarn.eq(IcResiCategoryWarnConfigEntity::getCustomerId, defaultCustomerId); + List warnConfigList = icResiCategoryWarnConfigDao.selectList(wrapperWarn); + warnConfigList.forEach(item -> { + item.setId(newPrefixed + item.getId()); + item.setCustomerId(customerId); + item.setCreatedBy("init_user"); + item.setCreatedTime(new Date()); + item.setUpdatedBy("init_user"); + item.setUpdatedTime(new Date()); + log.debug("stats:"+ JSON.toJSONString(item)); + icResiCategoryWarnConfigDao.insert(item); + }); + + return "初始化成功!客户ID:" + customerId + " formCode:" + formCode; + } +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcResiCategoryStatsConfigServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcResiCategoryStatsConfigServiceImpl.java new file mode 100644 index 0000000000..d0183a03f9 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcResiCategoryStatsConfigServiceImpl.java @@ -0,0 +1,126 @@ +/** + * 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.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; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.IcResiCategoryStatsConfigDao; +import com.epmet.dto.IcResiCategoryStatsConfigDTO; +import com.epmet.entity.IcResiCategoryStatsConfigEntity; +import com.epmet.redis.IcResiCategoryStatsConfigRedis; +import com.epmet.service.IcResiCategoryStatsConfigService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +/** + * 居民类别配置表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +@Service +public class IcResiCategoryStatsConfigServiceImpl extends BaseServiceImpl implements IcResiCategoryStatsConfigService { + + @Autowired + private IcResiCategoryStatsConfigRedis icResiCategoryStatsConfigRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcResiCategoryStatsConfigDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcResiCategoryStatsConfigDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcResiCategoryStatsConfigDTO get(String id) { + IcResiCategoryStatsConfigEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcResiCategoryStatsConfigDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcResiCategoryStatsConfigDTO dto) { + IcResiCategoryStatsConfigEntity entity = ConvertUtils.sourceToTarget(dto, IcResiCategoryStatsConfigEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcResiCategoryStatsConfigDTO dto) { + IcResiCategoryStatsConfigEntity entity = ConvertUtils.sourceToTarget(dto, IcResiCategoryStatsConfigEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @param dto + * @Description 获取居民类别 + * @Param dto + * @Return {@link List< IcResiCategoryStatsConfigDTO>} + * @Author zhaoqifeng + * @Date 2021/11/5 15:43 + */ + @Override + public List getCategoryList(IcResiCategoryStatsConfigDTO dto) { + if(StringUtils.isBlank(dto.getCustomerId())) { + return Collections.emptyList(); + } + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcResiCategoryStatsConfigEntity::getCustomerId, dto.getCustomerId()); + wrapper.orderByAsc(IcResiCategoryStatsConfigEntity::getSort); + List list = baseDao.selectList(wrapper); + return ConvertUtils.sourceToTarget(list, IcResiCategoryStatsConfigDTO.class); + } + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcResiCategoryWarnConfigServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcResiCategoryWarnConfigServiceImpl.java new file mode 100644 index 0000000000..3235b04f0d --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcResiCategoryWarnConfigServiceImpl.java @@ -0,0 +1,104 @@ +/** + * 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.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.IcResiCategoryWarnConfigDao; +import com.epmet.dto.IcResiCategoryWarnConfigDTO; +import com.epmet.entity.IcResiCategoryWarnConfigEntity; +import com.epmet.redis.IcResiCategoryWarnConfigRedis; +import com.epmet.service.IcResiCategoryWarnConfigService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 居民类别预警配置表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +@Service +public class IcResiCategoryWarnConfigServiceImpl extends BaseServiceImpl implements IcResiCategoryWarnConfigService { + + @Autowired + private IcResiCategoryWarnConfigRedis icResiCategoryWarnConfigRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcResiCategoryWarnConfigDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcResiCategoryWarnConfigDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcResiCategoryWarnConfigDTO get(String id) { + IcResiCategoryWarnConfigEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcResiCategoryWarnConfigDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcResiCategoryWarnConfigDTO dto) { + IcResiCategoryWarnConfigEntity entity = ConvertUtils.sourceToTarget(dto, IcResiCategoryWarnConfigEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcResiCategoryWarnConfigDTO dto) { + IcResiCategoryWarnConfigEntity entity = ConvertUtils.sourceToTarget(dto, IcResiCategoryWarnConfigEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/ItemTypeServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/ItemTypeServiceImpl.java new file mode 100644 index 0000000000..cb73a5b85c --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/ItemTypeServiceImpl.java @@ -0,0 +1,100 @@ +/** + * 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.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.ItemTypeDao; +import com.epmet.dto.ItemTypeDTO; +import com.epmet.entity.ItemTypeEntity; +import com.epmet.service.ItemTypeService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 控件类型 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +@Service +public class ItemTypeServiceImpl extends BaseServiceImpl implements ItemTypeService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ItemTypeDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ItemTypeDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public ItemTypeDTO get(String id) { + ItemTypeEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ItemTypeDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ItemTypeDTO dto) { + ItemTypeEntity entity = ConvertUtils.sourceToTarget(dto, ItemTypeEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ItemTypeDTO dto) { + ItemTypeEntity entity = ConvertUtils.sourceToTarget(dto, ItemTypeEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/ResiCategoryStatsConfigServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/ResiCategoryStatsConfigServiceImpl.java new file mode 100644 index 0000000000..e95f209aba --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/ResiCategoryStatsConfigServiceImpl.java @@ -0,0 +1,228 @@ +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.constant.IcResiCategoryStatsConfigConstant; +import com.epmet.dao.IcFormItemDao; +import com.epmet.dao.IcFormItemGroupDao; +import com.epmet.dao.IcResiCategoryStatsConfigDao; +import com.epmet.dao.IcResiCategoryWarnConfigDao; +import com.epmet.dto.IcResiCategoryStatsConfigDTO; +import com.epmet.dto.form.IcResiCategoryStatsConfigFormDTO; +import com.epmet.dto.form.IcResiCategoryStatsConfigSortFormDTO; +import com.epmet.dto.form.ResiCategoryStatsConfigListFormDTO; +import com.epmet.dto.result.IcResiCategoryStatsConfigResultDTO; +import com.epmet.entity.IcFormItemEntity; +import com.epmet.entity.IcFormItemGroupEntity; +import com.epmet.entity.IcResiCategoryStatsConfigEntity; +import com.epmet.entity.IcResiCategoryWarnConfigEntity; +import com.epmet.service.IcResiCategoryStatsConfigService; +import com.epmet.service.IcResiCategoryWarnConfigService; +import com.epmet.service.ResiCategoryStatsConfigService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import javax.annotation.Resource; +import java.util.*; +import java.util.stream.Collectors; + +@Slf4j +@Service +public class ResiCategoryStatsConfigServiceImpl implements ResiCategoryStatsConfigService { + @Autowired + private IcResiCategoryStatsConfigService icResiCategoryStatsConfigService; + + @Resource + private IcFormItemDao icFormItemDao; + @Resource + private IcFormItemGroupDao icFormItemGroupDao; + @Resource + private IcResiCategoryStatsConfigDao icResiCategoryStatsConfigDao; + @Resource + private IcResiCategoryWarnConfigDao icResiCategoryWarnConfigDao; + @Autowired + private IcResiCategoryWarnConfigService icResiCategoryWarnConfigService; + + @Override + @Transactional(rollbackFor = Exception.class) + public List list(String customerId, ResiCategoryStatsConfigListFormDTO formDTO) { + //1.获取IC_FORM_ITEM 中 用于数据分析字段的 id 和label + List icFormItemEntityList = icFormItemDao.selectList(new QueryWrapper().lambda().eq(IcFormItemEntity::getCustomerId,customerId).eq(IcFormItemEntity::getDataAnalyse, 1)); + if(CollectionUtils.isEmpty(icFormItemEntityList)){ + return new ArrayList<>(); + } + Set groupIds = icFormItemEntityList.stream().filter(item-> !"0".equals(item.getItemGroupId())).map(IcFormItemEntity::getItemGroupId).collect(Collectors.toSet()); + List icFormItemGroupEntityList = new ArrayList<>(); + if(!CollectionUtils.isEmpty(groupIds)){ + icFormItemGroupEntityList.addAll(icFormItemGroupDao.selectList(new QueryWrapper().lambda().eq(IcFormItemGroupEntity::getCustomerId,customerId).in(IcFormItemGroupEntity::getId, groupIds))); + } + + //获取tableName和COLUMN_NAME + Map tableColumnMap = new HashMap<>(); + Map idTableMap = new HashMap<>(); + icFormItemEntityList.forEach(item->{ + Map map = new HashMap<>(); + item.setColumnName(item.getColumnName().concat(NumConstant.ZERO == item.getColumnNum() ? StrConstant.EPMETY_STR : item.getColumnNum().toString())); + if("0".equals(item.getItemGroupId())){ + tableColumnMap.put(IcResiCategoryStatsConfigConstant.IC_RESI_USER+"-"+item.getColumnName(),item); + idTableMap.put(item.getId(),IcResiCategoryStatsConfigConstant.IC_RESI_USER); + }else{ + List collect = icFormItemGroupEntityList.stream().filter(i -> item.getItemGroupId().equals(i.getId())).collect(Collectors.toList()); + tableColumnMap.put(CollectionUtils.isEmpty(collect)?IcResiCategoryStatsConfigConstant.IC_RESI_USER:collect.get(0).getTableName()+"-"+item.getColumnName(),item); + idTableMap.put(item.getId(),CollectionUtils.isEmpty(collect)?IcResiCategoryStatsConfigConstant.IC_RESI_USER:collect.get(0).getTableName()); + } + + }); + + //2.获取ic_resi_category_stats_config 和 ic_resi_category_warn_config 表中的数据 + List statsConfigEntityList = icResiCategoryStatsConfigDao.selectList(new QueryWrapper().lambda().eq(IcResiCategoryStatsConfigEntity::getCustomerId,customerId)); + List warnConfigEntityList = icResiCategoryWarnConfigDao.selectList(new QueryWrapper().lambda().eq(IcResiCategoryWarnConfigEntity::getCustomerId,customerId)); + //3.新增不存在的,删除不在tableColumnMap的 + + Map statsTableColumnMap = new HashMap<>(); + statsConfigEntityList.forEach(item->{ + statsTableColumnMap.put(item.getTableName()+"-"+item.getColumnName(),item); + }); + Map warnTableColumnMap = new HashMap<>(); + warnConfigEntityList.forEach(item->{ + warnTableColumnMap.put(item.getTableName()+"-"+item.getColumnName(),item); + }); + //差集 + //新增 + List newStatsList = tableColumnMap.keySet().stream().filter(item -> !statsTableColumnMap.containsKey(item)).collect(Collectors.toList()); + + List newStatsEntityList = new ArrayList<>(); + newStatsList.forEach(item->{ + IcFormItemEntity icFormItemEntity = tableColumnMap.get(item); + IcResiCategoryStatsConfigEntity entity = new IcResiCategoryStatsConfigEntity(); + entity.setCustomerId(customerId); + entity.setLabel(icFormItemEntity.getLabel()); + entity.setTableName(idTableMap.get(icFormItemEntity.getId())); + entity.setColumnName(icFormItemEntity.getColumnName()); + entity.setManagementIcon(""); + entity.setDataIcon(""); + entity.setHouseShowIcon(""); + entity.setStatus("show"); + entity.setSort(icFormItemEntity.getSort()); + newStatsEntityList.add(entity); + }); + if(!CollectionUtils.isEmpty(newStatsEntityList)){ + icResiCategoryStatsConfigService.insertBatch(newStatsEntityList); + } + List newWarnList = tableColumnMap.keySet().stream().filter(item -> !warnTableColumnMap.containsKey(item)).collect(Collectors.toList()); + List newWarnEntityList = new ArrayList<>(); + newWarnList.forEach(item->{ + IcFormItemEntity icFormItemEntity = tableColumnMap.get(item); + IcResiCategoryWarnConfigEntity entity = new IcResiCategoryWarnConfigEntity(); + entity.setCustomerId(customerId); + entity.setLabel(icFormItemEntity.getLabel()); + entity.setTableName(idTableMap.get(icFormItemEntity.getId())); + entity.setColumnName(icFormItemEntity.getColumnName()); + entity.setWarn("0"); + entity.setSort(icFormItemEntity.getSort()); + newWarnEntityList.add(entity); + }); + if(!CollectionUtils.isEmpty(newWarnEntityList)){ + icResiCategoryWarnConfigService.insertBatch(newWarnEntityList); + } + List delStatsEntityIdList = new ArrayList<>(); + List delWarnEntityIdList = new ArrayList<>(); + //需要删除的 + List delStatsList = statsTableColumnMap.keySet().stream().filter(item -> !tableColumnMap.containsKey(item)).collect(Collectors.toList()); + List delWarnList = warnTableColumnMap.keySet().stream().filter(item -> !tableColumnMap.containsKey(item)).collect(Collectors.toList()); + delStatsList.forEach(item->{ + delStatsEntityIdList.add(statsTableColumnMap.get(item).getId()); + }); + delWarnList.forEach(item->{ + delWarnEntityIdList.add(warnTableColumnMap.get(item).getId()); + }); + if(!CollectionUtils.isEmpty(delStatsEntityIdList)){ + icResiCategoryStatsConfigService.deleteBatchIds(delStatsEntityIdList); + } + if(!CollectionUtils.isEmpty(delWarnEntityIdList)){ + icResiCategoryWarnConfigService.deleteBatchIds(delWarnEntityIdList); + } + + //4.返回数据 + return icResiCategoryStatsConfigDao.listInfo(customerId,formDTO.getIsWarn(),formDTO.getLevel()); + } + + @Override + public IcResiCategoryStatsConfigResultDTO info(String id,String customerId) { + return icResiCategoryStatsConfigDao.info(id,customerId); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(String customerId,IcResiCategoryStatsConfigFormDTO formDTO) { + IcResiCategoryStatsConfigDTO icResiCategoryStatsConfigDTO = icResiCategoryStatsConfigService.get(formDTO.getId()); + if(null == icResiCategoryStatsConfigDTO || !customerId.equals(icResiCategoryStatsConfigDTO.getCustomerId())){ + return ; + } + + //更新配置类别 + IcResiCategoryStatsConfigEntity icResiCategoryStatsConfigEntity = new IcResiCategoryStatsConfigEntity(); + BeanUtils.copyProperties(formDTO,icResiCategoryStatsConfigEntity); +// icResiCategoryStatsConfigEntity.setCustomerId(customerId); + icResiCategoryStatsConfigDao.updateById(icResiCategoryStatsConfigEntity); + + //更新配置预警 + //更新 + IcResiCategoryWarnConfigEntity icResiCategoryWarnConfigEntity = icResiCategoryWarnConfigDao.selectOne(new QueryWrapper().lambda() + .eq(IcResiCategoryWarnConfigEntity::getCustomerId,customerId) + .eq(IcResiCategoryWarnConfigEntity::getTableName, icResiCategoryStatsConfigDTO.getTableName()) + .eq(IcResiCategoryWarnConfigEntity::getColumnName, icResiCategoryStatsConfigDTO.getColumnName())); + icResiCategoryWarnConfigEntity.setWarn(formDTO.getWarn()); + icResiCategoryWarnConfigEntity.setLevel1(formDTO.getLevel1()); + icResiCategoryWarnConfigEntity.setLevel2(formDTO.getLevel2()); + icResiCategoryWarnConfigEntity.setLevel3(formDTO.getLevel3()); + icResiCategoryWarnConfigDao.updateById(icResiCategoryWarnConfigEntity); + + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void updateStatus(String customerId,IcResiCategoryStatsConfigFormDTO formDTO) { + //更新配置类别 + IcResiCategoryStatsConfigEntity icResiCategoryStatsConfigEntity = new IcResiCategoryStatsConfigEntity(); + BeanUtils.copyProperties(formDTO,icResiCategoryStatsConfigEntity); +// icResiCategoryStatsConfigEntity.setCustomerId(customerId); + icResiCategoryStatsConfigDao.updateById(icResiCategoryStatsConfigEntity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void updateSort(String customerId,List formDTOs) { + List entityList = new ArrayList<>(); + for (IcResiCategoryStatsConfigSortFormDTO formDTO : formDTOs) { + IcResiCategoryStatsConfigEntity icResiCategoryStatsConfigEntity = new IcResiCategoryStatsConfigEntity(); + icResiCategoryStatsConfigEntity.setId(formDTO.getId()); +// icResiCategoryStatsConfigEntity.setCustomerId(customerId); + icResiCategoryStatsConfigEntity.setSort(formDTO.getSort()); + entityList.add(icResiCategoryStatsConfigEntity); + } + if(CollectionUtils.isEmpty(entityList)){ + return ; + } + icResiCategoryStatsConfigService.updateBatchById(entityList); + //排序更新预警的 + List statsConfigEntityList = icResiCategoryStatsConfigDao.selectList(new QueryWrapper().lambda().eq(IcResiCategoryStatsConfigEntity::getCustomerId,customerId)); + List warnConfigEntityList = icResiCategoryWarnConfigDao.selectList(new QueryWrapper().lambda().eq(IcResiCategoryWarnConfigEntity::getCustomerId,customerId)); + if(CollectionUtils.isEmpty(warnConfigEntityList)){ + return ; + } + for (IcResiCategoryWarnConfigEntity warnConfigEntity : warnConfigEntityList) { + List collect = statsConfigEntityList.stream().filter(i -> i.getTableName().equals(warnConfigEntity.getTableName()) && i.getColumnName().equals(warnConfigEntity.getColumnName())).collect(Collectors.toList()); + if(CollectionUtils.isEmpty(collect)){ + continue; + } + warnConfigEntity.setSort(collect.get(0).getSort()); + } + icResiCategoryWarnConfigService.updateBatchById(warnConfigEntityList); + } +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/logback-spring.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/logback-spring.xml index d02b4bffb3..9e56bd9fda 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/logback-spring.xml +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/logback-spring.xml @@ -139,7 +139,7 @@ - + diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormDao.xml new file mode 100644 index 0000000000..d3c2c0261e --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormDao.xml @@ -0,0 +1,242 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormItemDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormItemDao.xml new file mode 100644 index 0000000000..c9b16fd11c --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormItemDao.xml @@ -0,0 +1,162 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormItemGroupDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormItemGroupDao.xml new file mode 100644 index 0000000000..ea697d8682 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormItemGroupDao.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormItemOptionsDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormItemOptionsDao.xml new file mode 100644 index 0000000000..36daa2158d --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormItemOptionsDao.xml @@ -0,0 +1,19 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormQueryBuilderDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormQueryBuilderDao.xml new file mode 100644 index 0000000000..62281279fa --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormQueryBuilderDao.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcResiCategoryStatsConfigDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcResiCategoryStatsConfigDao.xml new file mode 100644 index 0000000000..f3afd11c49 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcResiCategoryStatsConfigDao.xml @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcResiCategoryWarnConfigDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcResiCategoryWarnConfigDao.xml new file mode 100644 index 0000000000..7fe3679b42 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcResiCategoryWarnConfigDao.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/ItemTypeDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/ItemTypeDao.xml new file mode 100644 index 0000000000..d488c4feab --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/ItemTypeDao.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/pom.xml b/epmet-module/pom.xml index 56b1452eec..8b9efdfdb8 100644 --- a/epmet-module/pom.xml +++ b/epmet-module/pom.xml @@ -44,6 +44,7 @@ epmet-point epmet-ext data-aggregator - + open-data-worker + diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/ResiGroupDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/ResiGroupDTO.java index 9ed8c34510..7994bf7d8d 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/ResiGroupDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/ResiGroupDTO.java @@ -126,7 +126,7 @@ Ps: 如果一个小组被拒绝,当前小组的状态将永久停留在“审 * 更新时间 */ private Date updatedTime; - + private List memberList; } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ResiTopicIncludeIssueDetailResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ResiTopicIncludeIssueDetailResultDTO.java index 2bce88383f..9af69706cd 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ResiTopicIncludeIssueDetailResultDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ResiTopicIncludeIssueDetailResultDTO.java @@ -1,5 +1,6 @@ package com.epmet.resi.group.dto.topic.result; +import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; import java.io.Serializable; @@ -90,4 +91,6 @@ public class ResiTopicIncludeIssueDetailResultDTO implements Serializable { * 话题被屏蔽详情 */ private TopicHiddenDetailDTO hiddenDetail; + + private String gridName; } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java index 1762b35d97..c95abb1044 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java @@ -271,15 +271,6 @@ public interface ResiGroupOpenFeignClient { @PostMapping("/resi/group/topic/topiccreateduserbatch") Result> topicCreatedUserBatch(@RequestParam("topicIds")List topicIds); - /** - * @Description 通过话题id批量查询话题详情列表 - * @return - * @author wxz - * @date 2021.05.18 16:24 - */ - @PostMapping("/resi/group/topic/get-topicdetail-byid/batch") - Result> listTopicDetailsByIds(TopicDetailBatchFormDTO input); - /** * @Description 查询话题信息 * @Param issueIds @@ -289,6 +280,15 @@ public interface ResiGroupOpenFeignClient { @PostMapping("resi/group/topic/gettopicinfos") Result> getTopicInfos(@RequestBody List issueIds); + + /** + * @Description 通过话题id批量查询话题详情列表 + * @return + * @author wxz + * @date 2021.05.18 16:24 + */ + @PostMapping("/resi/group/topic/get-topicdetail-byid/batch") + Result> listTopicDetailsByIds(TopicDetailBatchFormDTO input); /** * @description 根据组id列表批量查询组信息列表 * diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java index 8c2f5303ee..11d0514d5e 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java @@ -3,13 +3,24 @@ package com.epmet.resi.group.feign.fallback; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; -import com.epmet.resi.group.dto.group.ResiGroupDTO; import com.epmet.resi.group.dto.group.form.*; +import com.epmet.resi.group.dto.group.result.ApplicationDetailCopyResultDTO; +import com.epmet.resi.group.dto.group.ResiGroupDTO; +import com.epmet.resi.group.dto.group.result.ApplyingGroupResultDTO; +import com.epmet.resi.group.dto.group.result.GroupEditionDetailResultDTO; +import com.epmet.resi.group.dto.group.form.ApplicationDetailFormDTO; +import com.epmet.resi.group.dto.group.form.GroupInfoFormDTO; +import com.epmet.resi.group.dto.group.result.GroupInfoResultDTO; import com.epmet.resi.group.dto.group.result.*; import com.epmet.resi.group.dto.topic.MyCreateTopicsFormDTO; import com.epmet.resi.group.dto.topic.ResiTopicDTO; import com.epmet.resi.group.dto.topic.form.*; import com.epmet.resi.group.dto.topic.result.*; +import com.epmet.resi.group.dto.topic.result.IssueGridResultDTO; +import com.epmet.resi.group.dto.topic.result.MyPartIssueResultDTO; +import com.epmet.resi.group.dto.topic.result.ParticipatedTopicUnitResultDTO; +import com.epmet.resi.group.dto.group.form.CreateGroupCodeFormDTO; +import com.epmet.resi.group.dto.topic.result.TopicBelongGroupResultDTO; import com.epmet.resi.group.dto.topic.result.TopicInfoResultDTO; import com.epmet.resi.group.feign.ResiGroupOpenFeignClient; import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO; @@ -131,6 +142,7 @@ public class ResiGroupOpenFeignClientFallback implements ResiGroupOpenFeignClien return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "sendEvent",param); } + @Override public Result queryTopicInfoByIssueId(String issueId) { return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "queryTopicInfoByIssueId", issueId); @@ -157,11 +169,6 @@ public class ResiGroupOpenFeignClientFallback implements ResiGroupOpenFeignClien return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "topicAttachmentList", formDTO); } - @Override - public Result> allMessages(AllMessagesFormDTO formDTO) { - return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "allMessages", formDTO); - } - /** * 获取小组详情 * @@ -201,6 +208,11 @@ public class ResiGroupOpenFeignClientFallback implements ResiGroupOpenFeignClien return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "groupPointDetail", formDTO); } + @Override + public Result> allMessages(AllMessagesFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "allMessages", formDTO); + } + @Override public Result topicCreatedUser(String topicId) { return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "topicCreatedUser", topicId); diff --git a/epmet-module/resi-group/resi-group-server/deploy/docker-compose-prod.yml b/epmet-module/resi-group/resi-group-server/deploy/docker-compose-prod.yml index 8b618d43e3..90296e3d83 100644 --- a/epmet-module/resi-group/resi-group-server/deploy/docker-compose-prod.yml +++ b/epmet-module/resi-group/resi-group-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: resi-group-server: container_name: resi-group-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/resi-group-server:0.3.82 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/resi-group-server:0.3.127 ports: - "8095:8095" network_mode: host # 使用现有网络 @@ -15,4 +15,4 @@ services: resources: limits: cpus: '0.1' - memory: 600M \ No newline at end of file + memory: 600M diff --git a/epmet-module/resi-group/resi-group-server/pom.xml b/epmet-module/resi-group/resi-group-server/pom.xml index 117e26696c..c12490d510 100644 --- a/epmet-module/resi-group/resi-group-server/pom.xml +++ b/epmet-module/resi-group/resi-group-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.82 + 0.3.127 com.epmet resi-group @@ -354,7 +354,7 @@ - false + true true diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java index e90adf8c14..6195fbf2e9 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java @@ -455,7 +455,6 @@ public class ResiGroupController { return new Result(); } - /** * @param formDTO * @author yinzuomei diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java index ee2f844d04..194c927f37 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java @@ -47,6 +47,7 @@ import com.epmet.dto.result.UserInfoResultDTO; import com.epmet.dto.result.UserResiInfoResultDTO; import com.epmet.dto.result.UserRoleResultDTO; import com.epmet.feign.EpmetMessageOpenFeignClient; +import com.epmet.group.constant.GroupConstant; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.modules.constant.UserMessageConstant; import com.epmet.modules.feign.EpmetMessageFeignClient; @@ -380,7 +381,7 @@ public class ResiGroupServiceImpl extends BaseServiceImpl getGroupLeaderUserInfo(String groupId) { - String customerId = loginUserUtil.getCurrentCustomerId(); + String customerId = loginUserUtil.getLoginUserCustomerId(); //群主名称需要调用feign查询 // ResiGroupEntity resiGroupEntity = baseDao.selectById(groupId); // if (null == resiGroupEntity) { diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/dao/ResiGroupMemberDao.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/dao/ResiGroupMemberDao.java index 08b62c9d1c..daf4e23248 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/dao/ResiGroupMemberDao.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/dao/ResiGroupMemberDao.java @@ -169,16 +169,16 @@ public interface ResiGroupMemberDao extends BaseDao { */ String selectUserRole(@Param("groupId")String groupId, @Param("userId")String userId); - int exitGroupById(@Param("id") String id, @Param("updatedBy") String updatedBy); - - /** - * desc: 仅统计除组长之外的成员数 - * - * @param customerId - * @param groupId - * @return int - * @author LiuJanJun - * @date 2021/4/23 3:14 下午 - */ + /** + * desc: 仅统计除组长之外的成员数 + * + * @param customerId + * @param groupId + * @return int + * @author LiuJanJun + * @date 2021/4/23 3:14 下午 + */ int countAllMembers(@Param("customerId") String customerId, @Param("groupId") String groupId); + + int exitGroupById(@Param("id") String id, @Param("updatedBy") String updatedBy); } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/test/TestController.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/test/TestController.java index c86286bfc5..d57eba9d90 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/test/TestController.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/test/TestController.java @@ -2,6 +2,8 @@ package com.epmet.modules.test; import com.epmet.commons.tools.utils.HttpContextUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.feign.OssFeignClient; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -12,6 +14,9 @@ import javax.servlet.http.HttpServletRequest; @RequestMapping("test") public class TestController { + @Autowired + private OssFeignClient ossFeignClient; + @PostMapping("get-req-info") public Result testDomain(HttpServletRequest request) { String requestServerNameAndPort = HttpContextUtils.getRequestServerNameAndPort(); @@ -27,4 +32,5 @@ public class TestController { return new Result(); } + } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java index c19e33d5ae..1695aaba09 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java @@ -3,6 +3,7 @@ package com.epmet.modules.topic.controller; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; 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; @@ -255,6 +256,7 @@ public class ResiTopicController { * @author wangc * @date 2020.05.13 19:08 **/ + @NoRepeatSubmit @PostMapping("turnintoissuev2") public Result turnIntoIssueV2(@LoginUser TokenDto tokenDto, @RequestBody ResiTopicTurnIssueFromDTO topicTurnIssueFromDTO){ topicTurnIssueFromDTO.setUserId(tokenDto.getUserId()); @@ -508,6 +510,17 @@ public class ResiTopicController { return new Result>().ok(topicService.topicCreatedUserBatch(topicIds)); } + + /** + * @Description 查询话题信息 + * @Param issueIds + * @author zxc + * @date 2021/5/17 4:19 下午 + */ + @PostMapping("gettopicinfos") + public Result> getTopicInfos(@RequestBody List issueIds){ + return new Result>().ok(topicService.getTopicInfos(issueIds)); + } /** * @Description 根据话题id,批量查询话题详情 * @return @@ -521,16 +534,4 @@ public class ResiTopicController { return new Result>().ok(topicDetails); } - - - /** - * @Description 查询话题信息 - * @Param issueIds - * @author zxc - * @date 2021/5/17 4:19 下午 - */ - @PostMapping("gettopicinfos") - public Result> getTopicInfos(@RequestBody List issueIds){ - return new Result>().ok(topicService.getTopicInfos(issueIds)); - } } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicService.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicService.java index 9a552f2baa..9960add54e 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicService.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicService.java @@ -332,6 +332,16 @@ public interface ResiTopicService extends BaseService { * @Description 获取话题附件信息 **/ TopicAttachmentResultDTO topicAttachmentList(TopicAttachmentFormDTO formDTO); + + /** + * @Description 根据事件枚举发送积分事件 + * @param param + * @return void + * @author wangc + * @date 2021.01.04 16:41 + */ + void sendTopicPointEventByEventType(TopicEventFormDTO param); + /** /** * @Description 向关注话题的人发送微信订阅 * @param tokenDto @@ -343,14 +353,6 @@ public interface ResiTopicService extends BaseService { */ void sendWxmpUpdateSubscribe(TokenDto tokenDto, String id, String type); - /** - * @Description 根据事件枚举发送积分事件 - * @param param - * @return void - * @author wangc - * @date 2021.01.04 16:41 - */ - void sendTopicPointEventByEventType(TopicEventFormDTO param); ResiTopicDTO queryTopicInfoByIssueId(String issueId); @@ -406,14 +408,6 @@ public interface ResiTopicService extends BaseService { */ List topicCreatedUserBatch(List topicIds); - /** - * @Description 根据话题id批量查询话题详情 - * @return - * @author wxz - * @date 2021.05.18 15:42 - */ - List listTopicDetailsByIds(List topicIdList); - /** * @Description 查询话题信息 * @Param issueIds @@ -421,4 +415,12 @@ public interface ResiTopicService extends BaseService { * @date 2021/5/17 4:19 下午 */ List getTopicInfos(List issueIds); + + /** + * @Description 根据话题id批量查询话题详情 + * @return + * @author wxz + * @date 2021.05.18 15:42 + */ + List listTopicDetailsByIds(List topicIdList); } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicCommentServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicCommentServiceImpl.java index 523f81dc49..018e491409 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicCommentServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicCommentServiceImpl.java @@ -310,7 +310,7 @@ public class ResiTopicCommentServiceImpl extends BaseServiceImpl content.length() ? "\"" : "…\"")) + - "已被解决"); + "已被解决"); pointEventMsgList.add(pointEventMsg); mqBaseMsgDTO.setMsg(JSON.toJSONString(pointEventMsgList)); - if(!SendMqMsgUtils.sendMsg(mqBaseMsgDTO).success()){ - log.error("组长解决话题事件发送失败,参数:{}",JSON.toJSONString(closeFormDTO)); + if (!SendMqMsgUtils.sendMsg(mqBaseMsgDTO).success()) { + log.error("组长解决话题事件发送失败,参数:{}", JSON.toJSONString(closeFormDTO)); } } + //2021.4.22 start sun 因业务调整,新增组内消息记录表,话题状态变化时相应的修改数据状态 + GroupMessageEntity groupMessage = groupMessageDao.selectByMessageId(closeFormDTO.getTopicId()); + if (null != groupMessage) { + groupMessage.setStatus(TopicConstant.CLOSED); + groupMessageDao.updateById(groupMessage); + } + //2021.4.22 end sun //发送小组成就消息 boolean flag = SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient) .sendGroupAchievementMqMsg(new GroupAchievementMQMsg(topic.getCustomerId(), topic.getGroupId(), AchievementTypeEnum.RESOVLE_TOPIC.getCode())); @@ -886,6 +885,15 @@ public class ResiTopicServiceImpl extends BaseServiceImpl gridInfoRes=govOrgOpenFeignClient.getGridBaseInfoByGridId(customerGridFormDTO); + if(gridInfoRes.success()&&null!=gridInfoRes.getData()){ + resultDTO.setGridName(gridInfoRes.getData().getGridNamePath()); + } + } //2.查询话题附件 QueryWrapper wrapper = new QueryWrapper<>(); wrapper.eq(FieldConstant.DEL_FLAG,NumConstant.ZERO_STR); @@ -1011,7 +1019,7 @@ public class ResiTopicServiceImpl extends BaseServiceImpl().ok(resultDTO); diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/TopicDraftServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/TopicDraftServiceImpl.java index 022a9cfcae..9a60f060b2 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/TopicDraftServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/TopicDraftServiceImpl.java @@ -43,11 +43,13 @@ import com.epmet.dto.result.AllGridsByUserIdResultDTO; import com.epmet.dto.result.UserInfoResultDTO; import com.epmet.dto.result.CommonDataFilterResultDTO; import com.epmet.feign.EpmetMessageOpenFeignClient; +import com.epmet.dto.result.UserInfoResultDTO; import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.commons.tools.enums.AchievementTypeEnum; import com.epmet.modules.feign.EpmetUserFeignClient; import com.epmet.modules.group.dao.GroupMessageDao; import com.epmet.modules.feign.GovOrgFeignClient; +import com.epmet.modules.group.dao.GroupMessageDao; import com.epmet.modules.group.dao.ResiGroupDao; import com.epmet.modules.group.dao.ResiGroupStatisticalDao; import com.epmet.modules.group.entity.GroupMessageEntity; @@ -811,6 +813,16 @@ public class TopicDraftServiceImpl extends BaseServiceImpl dataFilterResult = govOrgFeignClient.gridDataFilter(dataFilterParam); + if (!dataFilterResult.success() || null == dataFilterResult.getData()) { + throw new RenException(dataFilterResult.getMsg()); + } + + sendMqMsg(draft.getCreatedBy(), draft.getCustomerId(), draft.getCreatedTime(),resiGroupRedis.get(draft.getGroupId()).getGroupName(), + breviary.toString(), dataFilterResult.getData().getAgencyId(), draft.getGridId(), draft.getGroupId(), resiTopic.getId()); //2021.4.22 start sun 因业务调整,新增组内消息记录表,新增话题时相应的初始数据 GroupMessageEntity messageEntity = new GroupMessageEntity(); @@ -824,16 +836,7 @@ public class TopicDraftServiceImpl extends BaseServiceImpl dataFilterResult = govOrgFeignClient.gridDataFilter(dataFilterParam); - if (!dataFilterResult.success() || null == dataFilterResult.getData()) { - throw new RenException(dataFilterResult.getMsg()); - } - sendMqMsg(draft.getCreatedBy(), draft.getCustomerId(), draft.getCreatedTime(),resiGroupRedis.get(draft.getGroupId()).getGroupName(), - breviary.toString(), dataFilterResult.getData().getAgencyId(), draft.getGridId(), draft.getGroupId(), resiTopic.getId()); } //记录操作记录 entity = baseDao.selectById(formDTO.getTopicDraftId()); @@ -962,6 +965,15 @@ public class TopicDraftServiceImpl extends BaseServiceImpl dataFilterResult = govOrgFeignClient.gridDataFilter(dataFilterParam); + if (!dataFilterResult.success() || null == dataFilterResult.getData()) { + throw new RenException(dataFilterResult.getMsg()); + } + sendMqMsg(tokenDto.getUserId(), formDTO.getCustomerId(), draft.getCreatedTime(), resiGroupRedis.get(draft.getGroupId()).getGroupName(), + breviary.toString(), dataFilterResult.getData().getAgencyId(), formDTO.getGridId(), formDTO.getGroupId(), topic.getId()); //2021.4.22 start sun 因业务调整,新增组内消息记录表,新增话题时相应的初始数据 GroupMessageEntity messageEntity = new GroupMessageEntity(); @@ -976,17 +988,6 @@ public class TopicDraftServiceImpl extends BaseServiceImpl dataFilterResult = govOrgFeignClient.gridDataFilter(dataFilterParam); - if (!dataFilterResult.success() || null == dataFilterResult.getData()) { - throw new RenException(dataFilterResult.getMsg()); - } - sendMqMsg(tokenDto.getUserId(), formDTO.getCustomerId(), draft.getCreatedTime(), resiGroupRedis.get(draft.getGroupId()).getGroupName(), - breviary.toString(), dataFilterResult.getData().getAgencyId(), formDTO.getGridId(), formDTO.getGroupId(), topic.getId()); - - } /** diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/TopicShareLinkRecordServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/TopicShareLinkRecordServiceImpl.java index d686cfc825..41164d925f 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/TopicShareLinkRecordServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/TopicShareLinkRecordServiceImpl.java @@ -234,7 +234,7 @@ public class TopicShareLinkRecordServiceImpl extends BaseServiceImpl msgs, ConsumeConcurrentlyContext context) { + + if (redisUtils == null) { + redisUtils = SpringContextUtils.getBean(RedisUtils.class); + } + long start = System.currentTimeMillis(); try { msgs.forEach(this::consumeMessage); @@ -48,6 +59,7 @@ public class GroupAchievementCustomListener implements MessageListenerConcurren private void consumeMessage(MessageExt messageExt) { logger.info("receive msg:{}", JSON.toJSONString(messageExt)); String msg = new String(messageExt.getBody()); + String pendingMsgLabel = messageExt.getUserProperty(MQUserPropertys.BLOCKED_MSG_LABEL); GroupAchievementMQMsg msgObj = JSON.parseObject(msg, GroupAchievementMQMsg.class); if (msgObj == null){ @@ -87,9 +99,29 @@ public class GroupAchievementCustomListener implements MessageListenerConcurren distributedLock.unLock(lock); } } - } + if (StringUtils.isNotBlank(pendingMsgLabel)) { + try { + removePendingMqMsgCache(pendingMsgLabel); + } catch (Exception e) { + logger.error("【小组成就事件监听器】-删除mq滞留消息缓存失败:{}", ExceptionUtils.getErrorStackTrace(e)); + } + } + } + /** + * @description + * + * @param pendingMsgLabel + * @return + * @author wxz + * @date 2021.10.14 16:32:32 + */ + private void removePendingMqMsgCache(String pendingMsgLabel) { + String key = RedisKeys.blockedMqMsgKey(pendingMsgLabel); + redisUtils.delete(key); + logger.info("【小组成就事件监听器】删除mq滞留消息缓存成功,penddingMsgLabel:{}", pendingMsgLabel); + } /*@Override public ConsumerConfigProperties getConsumerProperty() { diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/bootstrap.yml b/epmet-module/resi-group/resi-group-server/src/main/resources/bootstrap.yml index d5bdbb2300..3e553a5364 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/resources/bootstrap.yml +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/bootstrap.yml @@ -31,6 +31,15 @@ spring: url: @spring.datasource.druid.url@ username: @spring.datasource.druid.username@ password: @spring.datasource.druid.password@ + #监控页面 + stat-view-servlet: + enabled: true + #loginUsername: admin + #loginPassword: admin + allow: + web-stat-filter: + enabled: true + filters: stat,wall,log4j2 # 数据迁移工具flyway flyway: enabled: @spring.flyway.enabled@ diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml index 97f45b4369..a9a11ac36f 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml @@ -610,23 +610,6 @@ GROUP BY temp.gridId - + - + + + diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml new file mode 100644 index 0000000000..b10e6e259f --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml @@ -0,0 +1,492 @@ + + + + + + + insert into ${tableName} + ( + + ${key} + + ,DEL_FLAG + ,REVISION + ,CREATED_TIME + ,UPDATED_TIME + ) values + ( + + #{value} + + ,'0' + ,'0' + ,NOW() + ,NOW() + ) + + + + UPDATE ${tableName} + SET + + ${key} = #{value} + + ,UPDATED_TIME = NOW() + WHERE id = #{id} + + + + + + + + + + ic_resi_user.DEL_FLAG = '0' + + + AND ${resultTableName}.ID IS NOT NULL + + and ic_resi_user.customer_id=#{customerId} + and (ic_resi_user.AGENCY_ID =#{currentStaffAgencyId} or ic_resi_user.pids like concat(#{staffOrgPath},'%')) + + + + + + + and ${subCondition.tableName}.${subCondition.columnName} = #{subCondition.columnValue[0]} + + + + + + and ${subCondition.tableName}.${subCondition.columnName} like concat('%',#{subCondition.columnValue[0]},'%') + + + + + and ${subCondition.tableName}.${subCondition.columnName} between #{subCondition.columnValue[0]} and #{subCondition.columnValue[1]} + + + + + + + + + ic_resi_user.DEL_FLAG = '0' + and ic_resi_user.customer_id=#{customerId} + + + + + + + and ${subCondition.tableName}.${subCondition.columnName} = #{subCondition.columnValue[0]} + + + + + + and ${subCondition.tableName}.${subCondition.columnName} like concat('%',#{subCondition.columnValue[0]},'%') + + + + + and ${subCondition.tableName}.${subCondition.columnName} between #{subCondition.columnValue[0]} and #{subCondition.columnValue[1]} + + + + + + + + + + + update ic_resi_user set del_flag='1' where id=#{icResiUserId} + + + + update ${subTalbeName} set del_flag='1' where IC_RESI_USER=#{icResiUserId} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcStatsResiWarnDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcStatsResiWarnDao.xml new file mode 100644 index 0000000000..4a4a2a6cc3 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcStatsResiWarnDao.xml @@ -0,0 +1,134 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserBaseInfoDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserBaseInfoDao.xml index 8c664e678e..ae0fbc5486 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserBaseInfoDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserBaseInfoDao.xml @@ -120,4 +120,27 @@ WHERE DEL_FLAG = '0' AND USER_ID = #{userId} + + + + diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserDao.xml index bbdaf024ba..605350bde2 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserDao.xml @@ -34,7 +34,8 @@ IFNULL(wechat.NICKNAME,"") AS nickName, IFNULL(resi.ID,"") AS resiId, IFNULL(CONCAT(resi.SURNAME,resi.NAME),"") AS userRealName, - IFNULL(relation.GRID_ID,"") AS gridId + IFNULL(relation.GRID_ID,"") AS gridId, + IFNULL(resi.id_num,'')AS idNum FROM USER user LEFT JOIN @@ -81,4 +82,26 @@ u.DEL_FLAG = '0' AND u.id = #{userId} + + + + diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserResiInfoDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserResiInfoDao.xml index fb360d3a39..93cb1fc7a4 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserResiInfoDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserResiInfoDao.xml @@ -43,7 +43,8 @@ NAME = #{name}, STREET = #{street}, DISTRICT = #{district}, - BUILDING_ADDRESS = #{buildingAddress} + BUILDING_ADDRESS = #{buildingAddress}, + ID_NUM = #{idNum} where USER_ID = #{userId} and DEL_FLAG = '0' @@ -175,4 +176,29 @@ uri.DEL_FLAG = '0' AND uri.USER_ID = #{userId} + + + + diff --git a/epmet-user/epmet-user-server/src/test/java/com/epmet/epmetuser/test/IcResiUserControllerTest.java b/epmet-user/epmet-user-server/src/test/java/com/epmet/epmetuser/test/IcResiUserControllerTest.java new file mode 100644 index 0000000000..4bf7b1c16c --- /dev/null +++ b/epmet-user/epmet-user-server/src/test/java/com/epmet/epmetuser/test/IcResiUserControllerTest.java @@ -0,0 +1,183 @@ +package com.epmet.epmetuser.test; + +import cn.afterturn.easypoi.excel.entity.ExportParams; +import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity; +import cn.afterturn.easypoi.excel.export.ExcelExportService; +import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.CustomerFormQueryDTO; +import com.epmet.dto.result.CustomerFormResultDTO; +import com.epmet.dto.result.FormGroupDTO; +import com.epmet.dto.result.FormItemResult; +import com.epmet.feign.OperCustomizeOpenFeignClient; +import org.apache.commons.lang3.StringUtils; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import org.jetbrains.annotations.NotNull; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.web.bind.annotation.RequestParam; + +import java.io.FileOutputStream; +import java.util.*; + +@SpringBootTest +@RunWith(SpringRunner.class) +public class IcResiUserControllerTest { + private static final String BASE_TABLE_NAME = "BASE_TABLE_NAME"; + @Autowired + private OperCustomizeOpenFeignClient operCustomizeOpenFeignClient; + + @Test + public void downloadTemplate(@RequestParam String customerId) throws Exception { + CustomerFormResultDTO resultForm = getResiFormItems(customerId); + + XSSFWorkbook workbook = new XSSFWorkbook(); + Map> sheetHeaderMap = buildHeaderByItem(resultForm); + //Workbook workbook = null; + for (Map.Entry> entry : sheetHeaderMap.entrySet()) { + String sheetName = entry.getKey(); + List headers = entry.getValue(); + System.out.println("headers:"+sheetName+JSON.toJSONString(headers)); + ExportParams exportParams = new ExportParams(null,sheetName); + //exportParams.setAutoSize(true); + List> dataSet = new ArrayList<>(); + HashMap map = new HashMap<>(); + map.put("1","2"); + dataSet.add(map); + new ExcelExportService().createSheetForMap(workbook, exportParams, headers, dataSet); + } + + FileOutputStream fos = new FileOutputStream("//Users/liujianjun/Downloads/基础信息表/Dow.tt.xls"); + workbook.write(fos); + fos.close(); + } + + @NotNull + private CustomerFormResultDTO getResiFormItems(String customerId) { + CustomerFormQueryDTO queryDTO = new CustomerFormQueryDTO(); + queryDTO.setFormCode("resi_base_info"); + queryDTO.setCustomerId(customerId); + Result resultForm = operCustomizeOpenFeignClient.getCustomerForm(queryDTO); + if (resultForm == null || !resultForm.success() ||resultForm.getData() == null){ + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } + System.out.println(JSON.toJSONString(resultForm.getData())); + return resultForm.getData(); + } + + @NotNull + private Map> buildHeaderByItem(CustomerFormResultDTO resultForm) { + //form中的itemlist 为一级表头 但是要排除每个item中含有childGroup的 + + List itemList = resultForm.getItemList(); + List groupList = resultForm.getGroupList(); + + Map> everySheetHeaderMap = new LinkedHashMap<>(); + + List firstSheetHeaderList = new ArrayList<>(); + //Map groupNameMap = groupList.stream().collect(Collectors.toMap(FormGroupDTO::getGroupId,FormGroupDTO::getLabel)); + itemList.forEach(item->{ + if (StringUtils.isBlank(item.getColumnName())){ + return; + } + + if (item.getChildGroup() == null){ + ExcelExportEntity header = new ExcelExportEntity(item.getLabel(),item.getColumnName().concat(String.valueOf(item.getColumnNum())),30); + header.setNeedMerge(true); + firstSheetHeaderList.add(header); + return; + } + everySheetHeaderMap.putIfAbsent(resultForm.getFormName(),firstSheetHeaderList); + + //这些是动态的 formGroup + if (item.getChildGroup() != null){ + //baseTableName单独的一个sheet + System.out.println("childGroup:"+item.getLabel()); + if (BASE_TABLE_NAME.equals(item.getTableName())){ + List otherSheetHeaderList = new ArrayList<>(); + //这里是设置除基础信息之外的sheet的表头 + item.getChildGroup().getItemList().forEach(item2->{ + if (!BASE_TABLE_NAME.equals(item2.getTableName())){ + everySheetHeaderMap.putIfAbsent(item.getLabel(),otherSheetHeaderList); + } + ExcelExportEntity secondHeader = new ExcelExportEntity(item2.getLabel(),item2.getColumnName().concat(String.valueOf(item2.getColumnNum()))); + + otherSheetHeaderList.add(secondHeader); + if (!"radio".equals(item2.getItemType()) && CollectionUtils.isNotEmpty(item2.getOptions())){ + secondHeader.setNeedMerge(true); + List thirdHeaderList = new ArrayList<>(); + item2.getOptions().forEach(child->{ + ExcelExportEntity thirdHeader = new ExcelExportEntity(child.getLabel()); + thirdHeaderList.add(thirdHeader); + }); + secondHeader.setList(thirdHeaderList); + } + + }); + } + } + }); + groupList.forEach(item->{ + /* if (!"兴趣爱好".equals(item.getLabel()) && !"宗教信仰".equals(item.getLabel())){ + return; + }*/ + if (!BASE_TABLE_NAME.equals(item.getTableName())){ + return; + } + ExcelExportEntity header = new ExcelExportEntity(item.getLabel(),item.getTableName()); + header.setNeedMerge(true); + List secondHeaderList = new ArrayList<>(); + item.getItemList().forEach(item2->{ + ExcelExportEntity secondHeader = new ExcelExportEntity(item2.getLabel(),item2.getColumnName().concat(String.valueOf(item2.getColumnNum()))); + secondHeader.setNeedMerge(true); + secondHeaderList.add(secondHeader); + if (com.baomidou.mybatisplus.core.toolkit.CollectionUtils.isNotEmpty(item2.getOptions())){ + List thirdHeaderList = new ArrayList<>(); + item2.getOptions().forEach(child->{ + ExcelExportEntity thirdHeader = new ExcelExportEntity(child.getLabel(),child.getValue()+ new Random(1).nextInt(2)); + thirdHeader.setNeedMerge(true); + thirdHeaderList.add(thirdHeader); + }); + secondHeader.setList(thirdHeaderList); + } + + }); + header.setList(secondHeaderList); + firstSheetHeaderList.add(header); + System.out.println(JSON.toJSONString(firstSheetHeaderList)); + }); + return everySheetHeaderMap; + } + + private void buildHeader(Map> everySheetHeaderMap, FormItemResult item, ExcelExportEntity header) { + List firstSheetHeaderList = new ArrayList<>(); + List secondHeaderList = new ArrayList<>(); + item.getChildGroup().getItemList().forEach(item2->{ + if (!BASE_TABLE_NAME.equals(item2.getTableName())){ + everySheetHeaderMap.putIfAbsent(item.getLabel(),firstSheetHeaderList); + } + ExcelExportEntity secondHeader = new ExcelExportEntity(item2.getLabel(),item2.getColumnName().concat(String.valueOf(item2.getColumnNum()))); + secondHeader.setNeedMerge(true); + secondHeaderList.add(secondHeader); + if (CollectionUtils.isNotEmpty(item2.getOptions())){ + List thirdHeaderList = new ArrayList<>(); + item2.getOptions().forEach(child->{ + ExcelExportEntity thirdHeader = new ExcelExportEntity(child.getLabel()); + thirdHeaderList.add(thirdHeader); + }); + secondHeader.setList(thirdHeaderList); + } + + }); + header.setList(secondHeaderList); + firstSheetHeaderList.add(header); + everySheetHeaderMap.putIfAbsent(item.getLabel(),firstSheetHeaderList); + } + +} diff --git a/pom.xml b/pom.xml index 8e34094ca6..2a30af4cf9 100644 --- a/pom.xml +++ b/pom.xml @@ -97,6 +97,11 @@ + public aliyun nexus