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..9faf6cabaf 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,6 +1,7 @@ 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.result.CorsConfigResultDTO; import com.epmet.feign.fallback.EpmetAdminOpenFeignClientFallbackFactory; @@ -21,4 +22,54 @@ 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(); } 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..6ba1f8bee7 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,6 +1,7 @@ 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.result.CorsConfigResultDTO; @@ -15,4 +16,29 @@ public class EpmetAdminOpenFeignClientFallback implements EpmetAdminOpenFeignCli public Result> list() { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "list", null); } + + @Override + public Result> getEducationOption() { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getEducationOption", null); + } + + @Override + public Result> getHouseOption() { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getHouseOption", null); + } + + @Override + public Result> getNationOption() { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getNationOption", null); + } + + @Override + public Result> getNineSmallPlacesOption() { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getNineSmallPlacesOption", null); + } + + @Override + public Result> getRelationshipOption() { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getRelationshipOption", null); + } } 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..af65d4fd90 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,19 @@ 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.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 +79,65 @@ 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()); + } + + } 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..bcc3bd3953 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,13 @@ package com.epmet.service; -import com.epmet.dto.SysDictDataDTO; 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.SysDictDataDTO; import com.epmet.entity.SysDictDataEntity; +import java.util.List; import java.util.Map; /** @@ -31,5 +33,48 @@ 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(); } 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..e1c5e266f3 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,11 @@ 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.OptionResultDTO; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.dao.SysDictDataDao; @@ -22,7 +24,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 +89,114 @@ 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()); + 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()); + } + } 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..cd3c5543e6 --- /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(), "【基层治理平台登录】获取用户信息失败"); + 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查询所属客户跟组织列表失败"); + + // 生成登录票据 + 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 05d95c9a97..bfc425b8e1 100644 --- a/epmet-auth/src/main/java/com/epmet/controller/LoginController.java +++ b/epmet-auth/src/main/java/com/epmet/controller/LoginController.java @@ -68,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 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/IcLoginServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/IcLoginServiceImpl.java new file mode 100644 index 0000000000..d14db75885 --- /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平台登录】获取组织信息失败"); + + // 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-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-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..fb5ae07412 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,24 @@ 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"; + } 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..3f0c3066ec 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,24 @@ public interface TopicConstants { * 积分系统话题 */ String POINT = "point"; + + /** + * 组织信息 + */ + String ORG = "org"; + + /** + * 工作人员 + */ + String STAFF = "staff"; + + /** + * 巡查记录 + */ + String PATROL = "patrol"; + + /** + * 项目 + */ + String PROJECT = "project"; } 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..30a1700054 --- /dev/null +++ b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/DisputeProcessMQMsg.java @@ -0,0 +1,22 @@ +package com.epmet.commons.rocketmq.messages; + +import lombok.AllArgsConstructor; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2021/10/18 16:24 + */ +@Data +@AllArgsConstructor +public class DisputeProcessMQMsg implements Serializable { + private String customerId; + private String projectId; + /** + * 操作类型【新增:add 修改删除:edit】 + */ + private String type; +} 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/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/StrConstant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/StrConstant.java index c601d2fd71..fd4a97d11e 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 = ";"; + /** * 中文顿号 */ 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/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..30c786a539 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/OptionResultDTO.java @@ -0,0 +1,19 @@ +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 List children; +} 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/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index f078bd4bb6..92c190c7ec 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 @@ -19,6 +19,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 +77,7 @@ public enum EpmetErrorCode { SET_PARENT_AREA_CODE(8210,"请先设置上级组织区划"), HAVE_GUIDE_CANNOT_DEL(8211,"当前分类已经存在办事指南,不允许删除"), GUIDE_CATEGORY_NAME_EXITS(8212,"分类已存在"), + CUSTOMER_FORM_NOT_EXITS(8213,"客户未配置表单"), REQUIRE_PERMISSION(8301, "您没有足够的操作权限"), THIRD_PLAT_REQUEST_ERROR(8302, "请求第三方平台错误"), @@ -212,8 +214,11 @@ 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,"删除失败"); private int code; private String msg; 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/redis/RedisKeys.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java index f8929b71a3..074cc2b102 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 @@ -38,6 +38,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 */ @@ -548,4 +555,39 @@ 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); + } + + /** + * @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 getIcFormKey(String formCode,String customerId) { + return rootPrefix.concat("icform:").concat(formCode).concat(":").concat(customerId); + } } 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-gateway/pom.xml b/epmet-gateway/pom.xml index e09410668d..d180c7cab9 100644 --- a/epmet-gateway/pom.xml +++ b/epmet-gateway/pom.xml @@ -223,6 +223,9 @@ lb://data-aggregator-server + + lb://open-data-worker-server + lb://epmet-openapi-adv-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 @@ -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/resources/bootstrap.yml b/epmet-gateway/src/main/resources/bootstrap.yml index a147811112..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@ 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/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/form/IcResiDetailFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/form/IcResiDetailFormDTO.java new file mode 100644 index 0000000000..e7952a1ef4 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/form/IcResiDetailFormDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dataaggre.dto.epmetuser.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 查看详情,回显表单 + * @Author yinzuomei + * @Date 2021/10/27 10:22 下午 + */ +@Data +public class IcResiDetailFormDTO implements Serializable { + public interface AddUserInternalGroup { + } + @NotBlank(message = "icResiUserId不能为空",groups = AddUserInternalGroup.class) + private String icResiUserId; + + @NotBlank(message = "formCode不能为空", groups = AddUserInternalGroup.class) + private String formCode; + + @NotBlank(message = "customerId不能为空", groups = AddUserInternalGroup.class) + private String customerId; +} + diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/form/IcResiUserPageFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/form/IcResiUserPageFormDTO.java new file mode 100644 index 0000000000..04dc8f0943 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/form/IcResiUserPageFormDTO.java @@ -0,0 +1,38 @@ +package com.epmet.dataaggre.dto.epmetuser.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.List; + +/** + * @Description 居民信息,分页查询入参 + * @Author yinzuomei + * @Date 2021/10/27 2:06 下午 + */ +@Data +public class IcResiUserPageFormDTO implements Serializable { + public interface AddUserInternalGroup { + } + + @NotNull(message = "pageNo不能为空", groups = AddUserInternalGroup.class) + private Integer pageNo; + + @NotNull(message = "pageSize不能为空", groups = AddUserInternalGroup.class) + private Integer pageSize; + + @NotBlank(message = "formCode不能为空", groups = AddUserInternalGroup.class) + private String formCode; + + @NotBlank(message = "customerId不能为空", groups = AddUserInternalGroup.class) + private String customerId; + + /** + * 表对应的字段及值 + */ + private List conditions; + private Boolean pageFlag; +} + diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/form/ResiUserQueryValueDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/form/ResiUserQueryValueDTO.java new file mode 100644 index 0000000000..7e11156ba3 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/form/ResiUserQueryValueDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dataaggre.dto.epmetuser.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description TODO + * @Author yinzuomei + * @Date 2021/10/27 6:02 下午 + */ +@Data +public class ResiUserQueryValueDTO implements Serializable { + private String queryType; + private List columnValue; + private String columnName; + private String tableName; +} + diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/IcResiUserPageResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/IcResiUserPageResultDTO.java new file mode 100644 index 0000000000..e737bcec54 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/IcResiUserPageResultDTO.java @@ -0,0 +1,173 @@ +package com.epmet.dataaggre.dto.epmetuser.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 居民信息分页查询表单返参 + * @Author yinzuomei + * @Date 2021/10/27 2:07 下午 + */ +@Data +public class IcResiUserPageResultDTO implements Serializable { + private String icResiUserId; + private String gridId; + private String gridName; + /** + * 所属小区ID + */ + private String villageId; + private String vallageName; + + + /** + * 所属楼宇Id + */ + private String buildId; + private String buildName; + + /** + * 单元id + */ + private String unitId; + private String unitName; + + /** + * 所属家庭Id + */ + private String homeId; + private String homeName; + + /** + * 姓名 + */ + private String name; + + /** + * 手机号 + */ + private String mobile; + + /** + * 性别 + */ + private String gender; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 出生日期 + */ + private String birthday; + + /** + * 备注 + */ + private String remarks; + + /** + * 是否党员 + */ + private Boolean isParty; + + /** + * 是否低保户 + */ + private Boolean isDbh; + + /** + * 是否保障房 + */ + private Boolean isEnsureHouse; + + /** + * 是否失业 + */ + private Boolean isUnemployed; + + /** + * 是否育龄妇女 + */ + private Boolean isYlfn; + + /** + * 是否退役军人 + */ + private Boolean isVeterans; + + /** + * 是否统战人员 + */ + private Boolean isUnitedFront; + + /** + * 是否信访人员 + */ + private Boolean isXfry; + + /** + * 是否志愿者 + */ + private Boolean isVolunteer; + + /** + * 是否老年人 + */ + private Boolean isOldPeople; + + /** + * 是否空巢 + */ + private Boolean isKc; + + /** + * 是否失独 + */ + private Boolean isSd; + + /** + * 是否失能 + */ + private Boolean isSn; + + /** + * 是否失智 + */ + private Boolean isSz; + + /** + * 是否残疾 + */ + private Boolean isCj; + + /** + * 是否大病 + */ + private Boolean isDb; + + /** + * 是否慢病 + */ + private Boolean isMb; + + /** + * 是否特殊人群 + */ + private Boolean isSpecial; + + + // 以下属性都需要单独处理,不是直接取数据库的字段 + private String demandCategoryIds; + + private String demandName; + + /** + * 房屋类型,1楼房,2平房,3别墅 + */ + private String houseType; +} + diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/HouseInfoDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/HouseInfoDTO.java new file mode 100644 index 0000000000..fc98843047 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/HouseInfoDTO.java @@ -0,0 +1,61 @@ +package com.epmet.dataaggre.dto.govorg.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description TODO + * @Author yinzuomei + * @Date 2021/10/28 2:05 下午 + */ +@Data +public class HouseInfoDTO implements Serializable { + private static final long serialVersionUID = -5204197079709062825L; + /** + * 所属家庭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; +} + diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/IcResiUserController.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/IcResiUserController.java new file mode 100644 index 0000000000..4058ff5293 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/IcResiUserController.java @@ -0,0 +1,72 @@ +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.epmetuser.form.IcResiDetailFormDTO; +import com.epmet.dataaggre.dto.epmetuser.form.IcResiUserPageFormDTO; +import com.epmet.dataaggre.dto.epmetuser.result.IcResiUserPageResultDTO; +import com.epmet.dataaggre.service.epmetuser.IcResiUserService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.Map; + +/** + * @Description TODO + * @Author yinzuomei + * @Date 2021/10/27 2:03 下午 + */ +@RestController +@RequestMapping("icresiuser") +public class IcResiUserController { + + @Autowired + private IcResiUserService icResiUserService; + + + /** + * 分页查询居民信息列表 + * + * @param tokenDto + * @param pageFormDTO + * @return com.epmet.commons.tools.utils.Result> + * @author yinzuomei + * @date 2021/10/28 10:29 上午 + */ + //@PostMapping("listresi1") + public Result> queryListResi(@LoginUser TokenDto tokenDto, @RequestBody IcResiUserPageFormDTO pageFormDTO){ + //pageFormDTO.setCustomerId("45687aa479955f9d06204d415238f7cc"); + pageFormDTO.setCustomerId(tokenDto.getCustomerId()); + ValidatorUtils.validateEntity(pageFormDTO,IcResiUserPageFormDTO.AddUserInternalGroup.class); + return new Result>().ok(icResiUserService.pageResi(pageFormDTO)); + } + + //@PostMapping("listresi") + public Result>> queryListResi1(@LoginUser TokenDto tokenDto, @RequestBody IcResiUserPageFormDTO pageFormDTO){ + //pageFormDTO.setCustomerId("45687aa479955f9d06204d415238f7cc"); + pageFormDTO.setCustomerId(tokenDto.getCustomerId()); + ValidatorUtils.validateEntity(pageFormDTO,IcResiUserPageFormDTO.AddUserInternalGroup.class); + return new Result>>().ok(icResiUserService.pageResiMap(pageFormDTO)); + } + /** + * 编辑页面,显示居民信息详情 + * + * @param pageFormDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @date 2021/10/28 10:29 上午 + */ + //@PostMapping("detail") + public Result queryIcResiDetail(@LoginUser TokenDto tokenDto,@RequestBody IcResiDetailFormDTO pageFormDTO){ + //pageFormDTO.setCustomerId("45687aa479955f9d06204d415238f7cc"); + pageFormDTO.setCustomerId(tokenDto.getCustomerId()); + ValidatorUtils.validateEntity(pageFormDTO,IcResiDetailFormDTO.AddUserInternalGroup.class); + return new Result().ok(icResiUserService.queryIcResiDetail(pageFormDTO)); + } +} + 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..fbfc9564d5 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/IcResiUserDao.java @@ -0,0 +1,45 @@ +package com.epmet.dataaggre.dao.epmetuser; + +import com.epmet.dataaggre.dto.epmetuser.IcFormResColumnDTO; +import com.epmet.dataaggre.dto.epmetuser.form.ResiUserQueryValueDTO; +import com.epmet.dataaggre.dto.epmetuser.result.IcResiUserPageResultDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +@Mapper +public interface IcResiUserDao { + List selectListResi(@Param("customerId") String customerId, + @Param("formCode") String formCode, + @Param("conditions") List conditions, + @Param("resultColumns") List resultColumns, + @Param("subTables") List subTables); + List> selectListResiMap(@Param("customerId") String customerId, + @Param("formCode") String formCode, + @Param("conditions") List conditions, + @Param("resultColumns") List resultColumns, + @Param("subTables") List subTables); + /** + * 查询主表 + * + * @param icResiUserId + * @return java.util.List> + * @author yinzuomei + * @date 2021/10/28 11:20 上午 + */ + List> selectById(String icResiUserId); + + /** + * 根据ic_resi_user.id去查询各个子表记录,动态传入表名 + * + * @param icResiUserId + * @param tableName + * @return java.util.List> + * @author yinzuomei + * @date 2021/10/28 11:19 上午 + */ + List> selectSubTableRecords(@Param("icResiUserId") String icResiUserId,@Param("tableName") String tableName); + +} 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..33f676721b 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,6 @@ public interface CustomerAgencyDao extends BaseDao { * @Date 2021/9/23 10:16 */ List getOrgList(@Param("staffId") String staffId); + + List queryHouseInfo(@Param("houseIdList") Set houseIdList); } 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..aaba329a6f 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,10 @@ 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); + + List queryConditions(@Param("customerId") String customerId, @Param("formCode")String formCode); + + List querySubTables(@Param("customerId") String customerId, @Param("formCode")String formCode); + + Set queryIcResiSubTables(@Param("customerId") String customerId, @Param("formCode")String formCode); } \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/IcResiUserService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/IcResiUserService.java new file mode 100644 index 0000000000..ab112bfa8a --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/IcResiUserService.java @@ -0,0 +1,32 @@ +package com.epmet.dataaggre.service.epmetuser; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.dataaggre.dto.epmetuser.form.IcResiDetailFormDTO; +import com.epmet.dataaggre.dto.epmetuser.form.IcResiUserPageFormDTO; +import com.epmet.dataaggre.dto.epmetuser.result.IcResiUserPageResultDTO; + +import java.util.Map; + +public interface IcResiUserService { + /** + * 分页查询居民信息列表 + * + * @param pageFormDTO + * @return com.epmet.commons.tools.page.PageData + * @author yinzuomei + * @date 2021/10/28 10:30 上午 + */ + @Deprecated + PageData pageResi(IcResiUserPageFormDTO pageFormDTO); + + PageData> pageResiMap(IcResiUserPageFormDTO formDTO); + /** + * 编辑页面,显示居民信息详情 + * + * @param pageFormDTO + * @return java.util.Map + * @author yinzuomei + * @date 2021/10/28 10:29 上午 + */ + Map queryIcResiDetail(IcResiDetailFormDTO pageFormDTO); +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/IcResiUserServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/IcResiUserServiceImpl.java new file mode 100644 index 0000000000..a3dbfc59b3 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/IcResiUserServiceImpl.java @@ -0,0 +1,255 @@ +package com.epmet.dataaggre.service.epmetuser.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.GenderEnum; +import com.epmet.commons.tools.enums.HouseTypeEnum; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dataaggre.constant.DataSourceConstant; +import com.epmet.dataaggre.constant.OrgConstant; +import com.epmet.dataaggre.dao.epmetuser.IcResiUserDao; +import com.epmet.dataaggre.dto.epmetuser.IcFormResColumnDTO; +import com.epmet.dataaggre.dto.epmetuser.form.IcResiDetailFormDTO; +import com.epmet.dataaggre.dto.epmetuser.form.IcResiUserPageFormDTO; +import com.epmet.dataaggre.dto.epmetuser.result.IcResiUserPageResultDTO; +import com.epmet.dataaggre.dto.govorg.result.GridsInfoListResultDTO; +import com.epmet.dataaggre.dto.govorg.result.HouseInfoDTO; +import com.epmet.dataaggre.service.epmetuser.IcResiUserService; +import com.epmet.dataaggre.service.govorg.GovOrgService; +import com.epmet.dataaggre.service.opercustomize.CustomerFootBarService; +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.util.*; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + * @Description TODO + * @Author yinzuomei + * @Date 2021/10/27 2:04 下午 + */ +@Service +@DataSource(DataSourceConstant.EPMET_USER) +@Slf4j +public class IcResiUserServiceImpl implements IcResiUserService { + @Autowired + private IcResiUserDao icResiUserDao; + @Autowired + private CustomerFootBarService customerFootBarService; + @Autowired + private GovOrgService govOrgService; + + + /** + * 分页查询居民信息列表 + * + * @param formDTO + * @return com.epmet.commons.tools.page.PageData + * @author yinzuomei + * @date 2021/10/28 10:30 上午 + */ + @Override + public PageData pageResi(IcResiUserPageFormDTO formDTO) { + // 查询列表展示项,如果没有,直接返回 + List resultColumns = customerFootBarService.queryConditions(formDTO.getCustomerId(), formDTO.getFormCode()); + if (CollectionUtils.isEmpty(resultColumns)) { + log.warn("没有配置列表展示列"); + return new PageData(new ArrayList(), NumConstant.ZERO); + } + log.warn("列表展示项:" + JSON.toJSONString(resultColumns)); + // 查询列表展示项需要用到哪些子表 + // 拼接好的left join table_name on (ic_resi_user.ID=table_name.IC_RESI_USER AND table_name.del_flag='0') + List subTables = customerFootBarService.querySubTables(formDTO.getCustomerId(), formDTO.getFormCode()); + log.warn("子表:" + JSON.toJSONString(subTables)); + /* Set subTableList=resultColumns.stream().filter(item->!item.getTableName().equals("ic_resi_user") + && StringUtils.isNotBlank(item.getLink())) + .map(IcFormResColumnDTO :: getTableName).collect(Collectors.toSet()); + List subTables=new ArrayList<>(); + subTableList.forEach(tableName->{ + //'left join ',temp.TABLE_NAME, ' on ( ic_resi_user.ID=',temp.TABLE_NAME,'.IC_RESI_USER and ',temp.TABLE_NAME,'.del_flag="0" )' + String joinSql=String.format("% join %s on ( ic_resi_user.ID=%s.IC_RESI_USER and %s.del_flag=\"0\" "); + subTables.add(joinSql); + });*/ + PageInfo pageInfo = PageHelper.startPage(formDTO.getPageNo(), + formDTO.getPageSize()).doSelectPageInfo(() -> icResiUserDao.selectListResi(formDTO.getCustomerId(), + formDTO.getFormCode(), + formDTO.getConditions(), + resultColumns, + subTables)); + List list = pageInfo.getList(); + //查询网格名称 + List gridIds = list.stream().map(IcResiUserPageResultDTO::getGridId).collect(Collectors.toList()); + log.warn("gridIds:" + JSON.toJSONString(gridIds)); + + List gridInfoList = govOrgService.gridListByIds(gridIds); + log.warn(JSON.toJSONString(gridInfoList)); + + Map gridInfoMap = gridInfoList.stream().collect(Collectors.toMap(GridsInfoListResultDTO::getGridId, Function.identity())); + + //查询房子名称 + Set houseIds = list.stream().map(IcResiUserPageResultDTO::getHomeId).collect(Collectors.toSet()); + List houseInfoDTOList = govOrgService.queryHouseInfo(houseIds); + Map houseInfoMap = houseInfoDTOList.stream().collect(Collectors.toMap(HouseInfoDTO::getHomeId, Function.identity())); + for (IcResiUserPageResultDTO resultDTO : list) { + if (null != gridInfoMap && gridInfoMap.containsKey(resultDTO.getGridId())) { + resultDTO.setGridName(gridInfoMap.get(resultDTO.getGridId()).getGridName()); + } + if (null != houseInfoMap && houseInfoMap.containsKey(resultDTO.getHomeId())) { + resultDTO.setBuildName(houseInfoMap.get(resultDTO.getHomeId()).getBuildingName()); + resultDTO.setVallageName(houseInfoMap.get(resultDTO.getHomeId()).getNeighborHoodName()); + resultDTO.setUnitName(houseInfoMap.get(resultDTO.getHomeId()).getUnitName()); + resultDTO.setHomeName(houseInfoMap.get(resultDTO.getHomeId()).getDoorName()); + resultDTO.setHouseType(houseInfoMap.get(resultDTO.getHomeId()).getHouseType()); + } + } + pageInfo.setList(list); + return new PageData<>(pageInfo.getList(), pageInfo.getTotal()); + } + + + public PageData> pageResiMap(IcResiUserPageFormDTO formDTO) { + // 查询列表展示项,如果没有,直接返回 + List resultColumns = customerFootBarService.queryConditions(formDTO.getCustomerId(), formDTO.getFormCode()); + if (CollectionUtils.isEmpty(resultColumns)) { + log.warn("没有配置列表展示列"); + return new PageData(new ArrayList(), NumConstant.ZERO); + } + // 查询列表展示项需要用到哪些子表 + // 拼接好的left join table_name on (ic_resi_user.ID=table_name.IC_RESI_USER AND table_name.del_flag='0') + List subTables = customerFootBarService.querySubTables(formDTO.getCustomerId(), formDTO.getFormCode()); + PageInfo> pageInfo=new PageInfo<>(); + if (null == formDTO.getPageFlag()||formDTO.getPageFlag()) { + //分页 + pageInfo= PageHelper.startPage(formDTO.getPageNo(), + formDTO.getPageSize()).doSelectPageInfo(() -> icResiUserDao.selectListResiMap(formDTO.getCustomerId(), + formDTO.getFormCode(), + formDTO.getConditions(), + resultColumns, + subTables)); + }else{ + List> list=icResiUserDao.selectListResiMap(formDTO.getCustomerId(), + formDTO.getFormCode(), + formDTO.getConditions(), + resultColumns, + subTables); + pageInfo.setTotal(CollectionUtils.isEmpty(list)?NumConstant.ZERO:list.size()); + pageInfo.setList(list); + } + + List> list = pageInfo.getList(); + //查询网格名称 + List gridIds = new ArrayList<>(); + Set houseIds = new HashSet<>(); + for (Map map : list) { + log.warn(JSON.toJSONString(map)); + if (map.containsKey(OrgConstant.GRID_ID) && null != map.get(OrgConstant.GRID_ID) && StringUtils.isNotBlank(map.get(OrgConstant.GRID_ID).toString())) { + gridIds.add(map.get(OrgConstant.GRID_ID).toString()); + } + if (map.containsKey("HOME_ID") && null != map.get("HOME_ID") && StringUtils.isNotBlank(map.get("HOME_ID").toString())) { + houseIds.add(map.get("HOME_ID").toString()); + } + } + + List gridInfoList = govOrgService.gridListByIds(gridIds); + + Map gridInfoMap = gridInfoList.stream().collect(Collectors.toMap(GridsInfoListResultDTO::getGridId, Function.identity())); + + //查询房子名称 + List houseInfoDTOList = govOrgService.queryHouseInfo(houseIds); + Map houseInfoMap = houseInfoDTOList.stream().collect(Collectors.toMap(HouseInfoDTO::getHomeId, Function.identity())); + for (Map resultMap : list) { + String gridIdValue = null != resultMap.get(OrgConstant.GRID_ID) ? resultMap.get(OrgConstant.GRID_ID).toString() : StrConstant.EPMETY_STR; + resultMap.put("GRID_ID_VALUE", gridIdValue); + if (null != gridInfoMap && gridInfoMap.containsKey(gridIdValue) && null != gridInfoMap.get(gridIdValue)) { + //GRID_NAME + resultMap.put(OrgConstant.GRID_ID, gridInfoMap.get(gridIdValue).getGridName()); + } + + String homeId = null != resultMap.get("HOME_ID") ? resultMap.get("HOME_ID").toString() : StrConstant.EPMETY_STR; + resultMap.put("HOME_ID_VALUE", homeId); + if (null != houseInfoMap && houseInfoMap.containsKey(homeId) && null != houseInfoMap.get(homeId)) { + HouseInfoDTO houseInfoDTO = houseInfoMap.get(homeId); + String buildName = StringUtils.isNotBlank(houseInfoDTO.getBuildingName()) ? houseInfoDTO.getBuildingName() : StrConstant.EPMETY_STR; + resultMap.put("BUILD_NAME", buildName); + + String neighBorName = StringUtils.isNotBlank(houseInfoDTO.getNeighborHoodName()) ? houseInfoDTO.getNeighborHoodName() : StrConstant.EPMETY_STR; + resultMap.put("VILLAGE_NAME", neighBorName); + + String unitName = StringUtils.isNotBlank(houseInfoDTO.getUnitName()) ? houseInfoDTO.getUnitName() : StrConstant.EPMETY_STR; + resultMap.put("UNIT_NAME", unitName); + + String doorName = StringUtils.isNotBlank(houseInfoDTO.getDoorName()) ? houseInfoDTO.getDoorName() : StrConstant.EPMETY_STR; + resultMap.put("DOOR_NAME", doorName); + + String houseType = StringUtils.isNotBlank(houseInfoDTO.getHouseType()) ? houseInfoDTO.getHouseType() : StrConstant.EPMETY_STR; + //房屋类型,1楼房,2平房,3别墅 + resultMap.put(OrgConstant.HOUSE_TYPE_KEY, ""); + if (HouseTypeEnum.LOUFANG.getCode().equals(houseType)) { + resultMap.put(OrgConstant.HOUSE_TYPE_KEY, HouseTypeEnum.LOUFANG.getName()); + } else if (HouseTypeEnum.PINGFANG.getCode().equals(houseType)) { + resultMap.put(OrgConstant.HOUSE_TYPE_KEY, HouseTypeEnum.PINGFANG.getName()); + } else if (HouseTypeEnum.BIESHU.getCode().equals(houseType)) { + resultMap.put(OrgConstant.HOUSE_TYPE_KEY, HouseTypeEnum.BIESHU.getName()); + } + + resultMap.put("HOME_ID", neighBorName.concat(buildName).concat(unitName).concat(doorName)); + } + + if (resultMap.containsKey(OrgConstant.GENDER)) { + String genderValue = null != resultMap.get(OrgConstant.GENDER) ? resultMap.get(OrgConstant.GENDER).toString() : StrConstant.EPMETY_STR; + if (GenderEnum.MAN.getCode().equals(genderValue)) { + resultMap.put(OrgConstant.GENDER, GenderEnum.MAN.getName()); + } else if (GenderEnum.WOMAN.getCode().equals(genderValue)) { + resultMap.put(OrgConstant.GENDER, GenderEnum.WOMAN.getName()); + } else if (GenderEnum.UN_KNOWN.getCode().equals(genderValue)) { + resultMap.put(OrgConstant.GENDER, GenderEnum.UN_KNOWN.getName()); + } + } + } + pageInfo.setList(list); + return new PageData<>(pageInfo.getList(), pageInfo.getTotal()); + } + + /** + * 编辑页面,显示居民信息详情 + * + * @param pageFormDTO + * @return java.util.Map + * @author yinzuomei + * @date 2021/10/28 10:29 上午 + */ + @Override + public Map queryIcResiDetail(IcResiDetailFormDTO pageFormDTO) { + Map resultMap = new HashMap(); + // 先查询主表,主表没有记录,直接返回空 + List> icResiUserMapList = icResiUserDao.selectById(pageFormDTO.getIcResiUserId()); + if (CollectionUtils.isEmpty(icResiUserMapList)) { + return new HashMap(); + } + resultMap.put("ic_resi_user", icResiUserMapList); + + //循环查询每个子表的记录 + Set subTableList = customerFootBarService.queryIcResiSubTables(pageFormDTO.getCustomerId(), pageFormDTO.getFormCode()); + for (String subTalbeName : subTableList) { + List> list = icResiUserDao.selectSubTableRecords(pageFormDTO.getIcResiUserId(), subTalbeName); + if (!CollectionUtils.isEmpty(list)) { + resultMap.put(subTalbeName, list); + } + //else{ + // resultMap.put(subTalbeName,new ArrayList<>()); + //} + } + return resultMap; + } + + +} + 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..f475d7d38f 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 @@ -12,6 +12,7 @@ import com.epmet.dataaggre.dto.govorg.result.*; import com.epmet.dataaggre.dto.resigroup.result.OrgInfoCommonDTO; import java.util.List; +import java.util.Set; /** * @Author zxc @@ -154,4 +155,6 @@ public interface GovOrgService { * @Date 2021/9/23 10:14 */ List getStaffOrgList(String staffId); + + List queryHouseInfo(Set houseIdList); } 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..bfa7f9f9d1 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 @@ -532,4 +532,12 @@ public class GovOrgServiceImpl implements GovOrgService { return customerAgencyDao.getOrgList(staffId); } + @Override + public List queryHouseInfo(Set houseIdList) { + if(CollectionUtils.isEmpty(houseIdList)){ + return new ArrayList<>(); + } + return customerAgencyDao.queryHouseInfo(houseIdList); + } + } 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..a79000d974 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 @@ -20,8 +20,12 @@ package com.epmet.dataaggre.service.opercustomize; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.dataaggre.dto.app.form.AppFootBarFormDTO; import com.epmet.dataaggre.dto.app.result.AppFootBarResultDTO; +import com.epmet.dataaggre.dto.epmetuser.IcFormResColumnDTO; import com.epmet.dataaggre.entity.opercustomize.CustomerFootBarEntity; +import java.util.List; +import java.util.Set; + /** * APP底部菜单栏信息 * @@ -39,4 +43,10 @@ public interface CustomerFootBarService extends BaseService queryConditions(String customerId, String formCode); + + List querySubTables(String customerId, String formCode); + + Set queryIcResiSubTables(String customerId, String formCode); } \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercustomize/impl/CustomerFootBarServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercustomize/impl/CustomerFootBarServiceImpl.java index 4e1546f5a5..0aefa94d84 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercustomize/impl/CustomerFootBarServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercustomize/impl/CustomerFootBarServiceImpl.java @@ -27,6 +27,7 @@ import com.epmet.dataaggre.dao.opercustomize.CustomerFootBarDao; import com.epmet.dataaggre.dto.app.form.AppFootBarFormDTO; import com.epmet.dataaggre.dto.app.result.AppFootBarResultDTO; import com.epmet.dataaggre.dto.app.result.CustomerFootBarDTO; +import com.epmet.dataaggre.dto.epmetuser.IcFormResColumnDTO; import com.epmet.dataaggre.entity.opercrm.CustomerParameterEntity; import com.epmet.dataaggre.entity.opercustomize.CustomerFootBarEntity; import com.epmet.dataaggre.service.opercrm.CustomerParameterService; @@ -38,6 +39,7 @@ import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; import java.util.List; +import java.util.Set; /** @@ -112,4 +114,19 @@ public class CustomerFootBarServiceImpl extends BaseServiceImpl 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); + } + } \ No newline at end of file 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..df1b389d0a --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/IcResiUserDao.xml @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerAgencyDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerAgencyDao.xml index 7a0760d0a3..f7466eb235 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerAgencyDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerAgencyDao.xml @@ -286,4 +286,26 @@ AND USER_ID = #{staffId} + 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..11a8d52f7c 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,55 @@ and c.BAR_KEY=#{barKey} AND C.DISPLAY='1' + + + + + + \ No newline at end of file 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..ee5830567a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/EventInfoFormDTO.java @@ -0,0 +1,22 @@ +package com.epmet.dto.basereport.form; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; + +import java.io.Serializable; + +/** + * @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 String 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..cce7f1bb65 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/result/EventInfoResultDTO.java @@ -0,0 +1,190 @@ +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 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; +} 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/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/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/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..2fde3c3566 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/result/GridUserInfoDTO.java @@ -0,0 +1,182 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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; + + /** + * 民族[字典表主键] + */ + private String nation; + + /** + * 政治面貌[字典表主键] + */ + private String paerty; + + /** + * 出生日期[YYYY-MM-DD] + */ + private Date birthday; + + /** + * 学历[字典表主键] + */ + private String education; + + /** + * 入职时间 + */ + private Date entryDate; + + /** + * 是否离职 + */ + private String isLeave; + + /** + * 离职时间 + */ + private Date leaveDate; + + /** + * 网格员年收入 + */ + private String income; + + /** + * 是否社区(村)两委委员[Y:是、N:否] + */ + private String isCommittee; + + /** + * 是否社区工作者[Y:是、N:否] + */ + private String isCommunityWorkers; + + /** + * 是否社会工作者[Y:是、N:否] + */ + private String isSocialWorker; + + /** + * 是否村(居)民小组长[Y:是、N:否 + */ + private String isVillageLeader; + + /** + * 是否警务助理[Y:是、N:否] + */ + private String isPoliceAssistant; + + /** + * 是否人民调解员[Y:是、N:否] + */ + private String isMediator; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Integer 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/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..73b56ef7a0 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,17 +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 java.util.List; + /** * desc: 数据统计 对外feign client * @@ -274,4 +288,57 @@ 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); } 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..43638c894e 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,59 @@ 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); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/pom.xml b/epmet-module/data-statistical/data-statistical-server/pom.xml index 714dfa2c01..687c01b462 100644 --- a/epmet-module/data-statistical/data-statistical-server/pom.xml +++ b/epmet-module/data-statistical/data-statistical-server/pom.xml @@ -97,7 +97,21 @@ com.alibaba easyexcel - 2.2.6 + 2.2.10 + + + poi + org.apache.poi + + + poi-ooxml + org.apache.poi + + + poi-ooxml-schemas + org.apache.poi + + io.github.wnjustdoit @@ -116,6 +130,18 @@ 2.0.0 compile + + com.epmet + open-data-worker-client + 2.0.0 + compile + + + com.epmet + epmet-message-client + 2.0.0 + compile + 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..6b9966b154 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,12 @@ public interface ProjectConstant { */ String PROJECT_ORIGIN_AGENCY="agency"; String PROJECT_ORIGIN_EVENT="resi_event"; + /** + * 自办 + */ + String PROJECT_SELF_CLOSED="01"; + /** + * 上报 + */ + String PROJECT_REPORT="02"; } 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/DemoController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java index c9a77812e1..c053346087 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 @@ -61,7 +61,6 @@ import java.math.BigDecimal; import java.time.LocalDate; import java.time.LocalDateTime; import java.util.ArrayList; -import java.util.ArrayList; import java.util.Date; import java.util.ArrayList; import java.util.List; 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..70ef71817f 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 @@ -55,16 +55,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 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..97c85d1bc0 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 @@ -66,4 +66,6 @@ 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("projectId") String projectId); } 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/user/UserDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java index 8e03a5abc2..2c8f46ea9b 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,15 @@ 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); } 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..4a0d8e53c8 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 @@ -92,6 +92,4 @@ public class ScreenCustomerGridEntity extends BaseEpmetEntity { * desc: 是否参与上级计算yes:参与;no:不参与 add 01.14 */ private String upToCal; - - private String code; } 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/mq/ProjectChangedCustomListener.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/mq/ProjectChangedCustomListener.java index f62cfe09f8..72e12ff5dc 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; @@ -27,7 +32,6 @@ 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 +47,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 +71,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 +101,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 +152,16 @@ public class ProjectChangedCustomListener implements MessageListenerConcurrently SpringContextUtils.getBean(ScreenExtractService.class).extractPartData(customerId,dateId); } logger.info("consumer projectChanged msg success,{}",aBoolean); + + //发送项目数据上报的mq消息 + String type; + if ("issue_shift_project".equals(msgObj.getOperation()) || "created".equals(msgObj.getOperation())) { + type = SystemMessageType.PROJECT_ADD; + } else { + type = SystemMessageType.PROJECT_EDIT; + } + DisputeProcessMQMsg msg = new DisputeProcessMQMsg(customerId, msgObj.getProjectId(), type); + SpringContextUtils.getBean(ScreenProjectDataService.class).sendProjectChangeMq(msg); } catch (RenException e) { // 如果是我们手动抛出的异常,说明在业务可控范围内。目前不需要MQ重试 logger.error("【RocketMQ】消费项目变动消息失败:",e); @@ -151,6 +183,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/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..fcb81fc243 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,21 @@ 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); } \ 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/ScreenProjectDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectDataService.java index 7b82707c91..a29640a75b 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,24 @@ 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, String projectId, Integer pageNo, Integer pageSize); + + /** + * 项目变更MQ + * @Param msg + * @Return + * @Author zhaoqifeng + * @Date 2021/10/18 15:55 + */ + void sendProjectChangeMq(DisputeProcessMQMsg msg); + } 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 2ee6a41c16..5e0be26034 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 @@ -19,6 +19,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.constant.NumConstant; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.DataSourceConstant; @@ -37,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; /** @@ -55,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; @@ -314,4 +316,30 @@ 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())); + } + } \ 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/ScreenCustomerGridServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java index d09f269e3e..ed5860169e 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 @@ -23,6 +23,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; @@ -35,15 +36,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; /** * 网格(党支部)信息 @@ -218,4 +219,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/ScreenProjectCategoryOrgDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectCategoryOrgDailyServiceImpl.java index edd13b8e7d..d7edb6dd9a 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 @@ -415,10 +415,10 @@ 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 categoryProjectNotExists = baseDao.selectOrgCategoryMoreCustomerInfo(customerIds, dateId, level, customerId, false); + List categoryProjectNotExists = baseDao.selectOrgCategoryMoreCustomerInfoNotExists(customerIds, dateId, level, customerId); log.info("父客户不存在的分类{}"+ JSON.toJSONString(categoryProjectNotExists)); if (!CollectionUtils.isEmpty(categoryProjectExists)){ sonCustomerList.addAll(categoryProjectExists); 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..f04234049e 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 @@ -21,18 +21,23 @@ 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.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; 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.form.ScreenProjectDataInfoFormDTO; import com.epmet.dto.screencoll.ScreenCollFormDTO; import com.epmet.entity.evaluationindex.screen.ScreenProjectDataEntity; import com.epmet.entity.evaluationindex.screen.ScreenProjectImgDataEntity; +import com.epmet.feign.EpmetMessageOpenFeignClient; +import com.epmet.send.SendMqMsgUtil; import com.epmet.service.evaluationindex.screen.ScreenProjectDataService; +import com.github.pagehelper.PageHelper; import org.apache.commons.collections4.ListUtils; import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.StringUtils; @@ -42,7 +47,6 @@ 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; @@ -61,6 +65,8 @@ public class ScreenProjectDataServiceImpl extends BaseServiceImpl page(Map params) { @@ -134,22 +140,18 @@ public class ScreenProjectDataServiceImpl extends BaseServiceImpl} + * @Author zhaoqifeng + * @Date 2021/10/15 14:22 + */ + @Override + public List getProjectList(String customerId, String 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); + } + } 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..5c386342e9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/DataReportingServiceImpl.java @@ -0,0 +1,281 @@ +package com.epmet.service.impl; + +import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.utils.DateUtils; +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.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; + +/** + * @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; + + /** + * @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()); + st.setNation("01"); + st.setPaerty("13"); + st.setBirthday(new Date()); + st.setEducation("20"); + st.setEntryDate(new Date()); + st.setIsLeave("N"); + //st.setLeaveDate(); + st.setIncome("05"); + st.setIsCommittee("Y"); + st.setIsCommunityWorkers("Y"); + st.setIsSocialWorker("Y"); + st.setIsVillageLeader("Y"); + st.setIsPoliceAssistant("N"); + st.setIsMediator("Y"); + st.setDelFlag(dto.getDelFlag()); + st.setCreatedBy(dto.getCreatedBy()); + st.setCreatedTime(dto.getCreatedTime()); + st.setUpdatedBy(dto.getUpdatedBy()); + st.setUpdatedTime(dto.getUpdatedTime()); + } + }); + + 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(); + } + //项目ID不为空时,因为只有一条,可以直接处理 + if (StringUtils.isNotEmpty(formDTO.getProjectId())) { + list = projectList.stream().map(project -> { + EventInfoResultDTO dto = getEventInfoResultDTO(project); + if (OrgTypeConstant.AGENCY.equals(project.getOrgType())) { + ScreenCustomerAgencyEntity agency = screenCustomerAgencyService.getAgencyById(project.getOrgId()); + dto.setOrgCode(agency.getCode()); + dto.setOrgName(agency.getAgencyName()); + } else { + ScreenCustomerGridDTO grid = screenCustomerGridService.getGridById(project.getOrgId()); + 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); + if (OrgTypeConstant.AGENCY.equals(project.getOrgType())) { + ScreenCustomerAgencyEntity agency = agencyMap.get(project.getOrgId()); + dto.setOrgCode(agency.getCode()); + dto.setOrgName(agency.getAgencyName()); + } else { + ScreenCustomerGridDTO grid = gridMap.get(project.getOrgId()); + dto.setOrgCode(grid.getCode()); + dto.setOrgName(grid.getGridName()); + } + return dto; + }).collect(Collectors.toList()); + } + return list.stream().filter(item -> StringUtils.isNotBlank(item.getEventCategory())).collect(Collectors.toList()); + } + + private EventInfoResultDTO getEventInfoResultDTO(ScreenProjectDataDTO project) { + 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]; + //如果是孔村、榆山、锦水的项目需要关联分类字典表 + if("2fe0065f70ca0e23ce4c26fca5f1d933".equals(project.getCustomerId()) || + "44876154d10d7cb7affd92000f84f833".equals(project.getCustomerId()) || + "46c55cb862d6d5e6d05d2ab61a1cc07e".equals(project.getCustomerId())) { + CustomerProjectCategoryDictEntity categoryEntity = customerProjectCategoryDictService.getByCategoryCode(project.getCustomerId(), categoryCode); + if (null != categoryEntity) { + categoryCode = categoryEntity.getEpmetCategoryCode(); + } else { + categoryCode = null; + } + } + dto.setEventCategory(categoryCode); + 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())) { + switch (project.getFinishOrgLevel()) { + case OrgTypeConstant.DISTRICT: + dto.setCompleteLevel("04"); + break; + case OrgTypeConstant.STREET: + case OrgTypeConstant.COMMUNITY: + dto.setCompleteLevel("06"); + 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]); + dto.setCompleteLevel(getCompleteLevel(agency.getLevel())); + } else { + //办结组织是网格时,办结层级为网格 + dto.setCompleteLevel("07"); + } + } + + 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 "01"; + case OrgTypeConstant.CITY: + return "02"; + case OrgTypeConstant.DISTRICT: + return "03"; + case OrgTypeConstant.STREET: + return "04"; + case OrgTypeConstant.COMMUNITY: + return "06"; + 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/org/CustomerAgencyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerAgencyService.java index cc51ba1346..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; @@ -59,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 be6cab8321..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; @@ -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 428d3338d4..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; @@ -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..cc8633b08f 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 @@ -55,4 +55,14 @@ 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); } 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..d7c81c93ad 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; @@ -116,4 +117,22 @@ public class CustomerProjectCategoryDictServiceImpl extends BaseServiceImpl wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(CustomerProjectCategoryDictEntity::getCategoryCode, categoryCode); + wrapper.eq(CustomerProjectCategoryDictEntity::getCustomerId, customerId); + return baseDao.selectOne(wrapper); + } } 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..ffa464d4fa 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,14 @@ public interface UserService { * @author sun */ void saveOrUpGmUploadEvent(List list); + + /** + * @Author sun + * @Description 批量查询客户网格员基础信息 + **/ + List getStaffBaseInfo(StaffBaseInfoFormDTO formDTO); + + List getPatrolRecordList(MidPatrolFormDTO formDTO); + + List getPatrolDetailList(MidPatrolFormDTO formDTO); } 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..a8bf95d7f0 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,23 @@ 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); + } + } 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/mapper/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.xml index cdce01974a..38aa359065 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 @@ -44,7 +44,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..5930ae87c9 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,82 @@ 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/org/CustomerGridDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml index 64fa329ab6..e906015ad2 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 @@ -127,4 +127,38 @@ AND customer_id = #{customerId} + + + + \ 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/user/UserDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml index f6ddac0fef..4715f23c2a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml @@ -991,4 +991,66 @@ updated_time = NOW() + + + + diff --git a/epmet-module/epmet-demo/epmet-demo-server/pom.xml b/epmet-module/epmet-demo/epmet-demo-server/pom.xml index 00a03e4aab..4f6c0b6021 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 + 2.2.10 + + + 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-job/epmet-job-server/pom.xml b/epmet-module/epmet-job/epmet-job-server/pom.xml index e29f5759e5..769cfab32a 100644 --- a/epmet-module/epmet-job/epmet-job-server/pom.xml +++ b/epmet-module/epmet-job/epmet-job-server/pom.xml @@ -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 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/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-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..84580a3b4a 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,64 @@ 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"; + } 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/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 b2296d03a5..3fa1256af1 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 { + 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(getTopicByMsgType(messageType), messageType, contentStr.getBytes(RemotingHelper.DEFAULT_CHARSET)); + 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); } /** @@ -79,7 +167,105 @@ 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; } 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/gov-issue/gov-issue-server/src/main/java/com/epmet/mq/listener/IssueProjectCategoryTagInitListener.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/mq/listener/IssueProjectCategoryTagInitListener.java index 19ca52066c..a9eb9c436f 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/mq/listener/IssueProjectCategoryTagInitListener.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/mq/listener/IssueProjectCategoryTagInitListener.java @@ -1,12 +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.form.CategoryTagInitFormDTO; import com.epmet.service.IssueProjectCategoryDictService; +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 +37,15 @@ public class IssueProjectCategoryTagInitListener implements MessageListenerConcu @Autowired private DistributedLock distributedLock; + 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 +57,7 @@ public class IssueProjectCategoryTagInitListener implements MessageListenerConcu public 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,5 +79,27 @@ public class IssueProjectCategoryTagInitListener implements MessageListenerConcu } 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阻塞消息缓存成功,penddingMsgLabel:{}", pendingMsgLabel); } } \ No newline at end of file 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/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/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/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/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/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/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..8ce4e063b9 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcBulidingFormDTO.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.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 IcBulidingFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + public interface DeleteGroup extends CustomerClientShowGroup { + } + + @NotBlank(message = "楼栋ID不能为空", groups = { UpdateGroup.class,DeleteGroup.class}) + private String buildingId; + + /** + * 组织id + */ + @NotBlank(message = "组织id不能为空", groups = {AddGroup.class, UpdateGroup.class}) + private String agencyId; + + + /** + * 网格id + */ + @NotBlank(message = "网格不能为空", groups = {AddGroup.class, UpdateGroup.class}) + private String gridId; + + + /** + * 小区id + */ + @NotBlank(message = "小区id不能为空", groups = {AddGroup.class, UpdateGroup.class}) + private String neighborHoodId; + + /** + * 楼栋名称 + */ + @NotBlank(message = "楼栋名称不能为空", groups = {AddGroup.class, UpdateGroup.class}) + @Length(max=10,message = "楼栋名称不能超过10个字", groups = {AddGroup.class, UpdateGroup.class}) + private String buildingName; + + /** + * 楼栋类型 + */ + @NotBlank(message = "楼栋类型不能为空", groups = {AddGroup.class, UpdateGroup.class}) + private String type=""; + + /** + * 客户id + */ + /* @NotBlank(message = "客户id不能为空", groups = {AddGroup.class, UpdateGroup.class}) + private String customerId;*/ + + /** + * 排序 + */ + @NotNull(message = "排序不能为空", groups = {AddGroup.class, UpdateGroup.class}) + private Integer sort = 0; + + /** + * 总单元数 + */ + @NotNull(message = "总单元数不能为空", groups = {AddGroup.class, UpdateGroup.class}) + private Integer totalUnitNum=1; + + /** + * 总楼层总数 + */ + @NotNull(message = "总楼层总数不能为空", groups = {AddGroup.class, UpdateGroup.class}) + private Integer totalFloorNum; + + /** + * 总户数 + */ + @NotNull(message = "总户数不能为空", groups = {AddGroup.class, UpdateGroup.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..cb557aa572 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseFormDTO.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.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 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 { + } + + @NotBlank(message = "房屋ID不能为空", groups = { UpdateGroup.class,DeleteGroup.class}) + private String houseId; + + + /** + * 小区id + */ + @NotBlank(message = "小区id不能为空", groups = {AddGroup.class, UpdateGroup.class}) + private String neighborHoodId; + + @NotBlank(message = "所属楼栋ID不能为空", groups = {AddGroup.class, UpdateGroup.class}) + private String buildingId; + + /** + * 所属单元id + */ + @NotBlank(message = "所属单元id不能为空", groups = {AddGroup.class, UpdateGroup.class}) + private String buildingUnitId; + + + + /** + * 门牌号 + */ + @NotBlank(message = "门牌号不能为空", groups = {AddGroup.class, UpdateGroup.class}) + private String doorName; + + /** + * 房屋类型,这里存储字典value就可以 + */ + @NotBlank(message = "房屋类型不能为空", groups = {AddGroup.class, UpdateGroup.class}) + private String houseType; + + /** + * 存储字典value + */ + @NotBlank(message = "房屋用途不能为空", groups = {AddGroup.class, UpdateGroup.class}) + private String purpose; + + /** + * 1出租;0未出租 + */ + @NotNull(message = "是否出租不能为空", groups = {AddGroup.class, UpdateGroup.class}) + private Integer rentFlag; + + /** + * 房主姓名 + */ + @NotBlank(message = "房主姓名不能为空", groups = {AddGroup.class, UpdateGroup.class}) + private String ownerName; + + /** + * 房主电话 + */ + @NotBlank(message = "房主电话不能为空", groups = {AddGroup.class, UpdateGroup.class}) + private String ownerPhone; + + /** + * 房主身份证号 + */ + @NotBlank(message = "房主身份证号不能为空", groups = {AddGroup.class, UpdateGroup.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..98a6ad0fde --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcNeighborHoodFormDTO.java @@ -0,0 +1,110 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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 java.io.Serializable; + + + +@Data +public class IcNeighborHoodFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + public interface DeleteGroup extends CustomerClientShowGroup { + } + /** + * 小区id + */ + @NotBlank(message = "小区id不能为空", groups = {UpdateGroup.class,DeleteGroup.class}) + private String neighborHoodId; + + /** + * 小区名称 + */ + @NotBlank(message = "小区名称不能为空", groups = {AddGroup.class, UpdateGroup.class}) + @Length(max=50,message = "小区名称不能超过50个字", groups = {AddGroup.class, UpdateGroup.class}) + private String neighborHoodName; + + /** + * 客户id + */ + /* @NotBlank(message = "客户id不能为空", groups = {AddGroup.class, UpdateGroup.class}) + private String customerId;*/ + + /** + * 组织id + */ + @NotBlank(message = "组织id不能为空", groups = {AddGroup.class, UpdateGroup.class}) + private String agencyId; + + + /** + * 网格id + */ + @NotBlank(message = "网格id不能为空", groups = {AddGroup.class, UpdateGroup.class}) + private String gridId; + /** + * 关联物业id + */ + @NotBlank(message = "关联物业ID不能为空", groups = {UpdateGroup.class}) + private String propertyId; + + /** + * 详细地址 + */ + @NotBlank(message = "详细地址不能为空", groups = {AddGroup.class, UpdateGroup.class}) + private String address; + + /** + * 备注 + */ + @NotBlank(message = "备注不能为空", groups = {UpdateGroup.class}) + @Length(max=500,message = "备注不能超过500个字", groups = {AddGroup.class, UpdateGroup.class}) + private String remark; + /** + * 坐标位置 + */ + //@NotBlank(message = "坐标位置不能为空", groups = {AddGroup.class, UpdateGroup.class}) + 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..ae5f2f9903 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcPropertyManagementFormDTO.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.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 java.io.Serializable; + + +@Data +public class IcPropertyManagementFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + public interface DeleteGroup extends CustomerClientShowGroup { + } + + @NotBlank(message = "物业id不能为空", groups = { UpdateGroup.class,DeleteGroup.class}) + private String id; + + + /** + * 物业名称 + */ + @NotBlank(message = "物业名称不能为空", groups = {AddGroup.class, UpdateGroup.class}) + @Length(max=10,message = "物业名称不能超过100个字", groups = {AddGroup.class, UpdateGroup.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/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/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..ea5b86e2e6 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/BaseInfoFamilyBuildingResultDTO.java @@ -0,0 +1,26 @@ +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; +} 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/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..3221ee3647 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseInfoDTO.java @@ -0,0 +1,60 @@ +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; +} \ No newline at end of file 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/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..d7621bd88b 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,62 @@ 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 AgencyIdFormDTO 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); } 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..7e53823382 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,44 @@ 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(AgencyIdFormDTO 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 selectPidsByGridId(String gridId) { return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "selectPidsByGridId", gridId); } + } diff --git a/epmet-module/gov-org/gov-org-server/pom.xml b/epmet-module/gov-org/gov-org-server/pom.xml index 2bc10abf21..ccbc334ede 100644 --- a/epmet-module/gov-org/gov-org-server/pom.xml +++ b/epmet-module/gov-org/gov-org-server/pom.xml @@ -107,6 +107,12 @@ 2.0.0 compile + + com.epmet + epmet-message-client + 2.0.0 + compile + @@ -123,8 +129,19 @@ true + + org.apache.maven.plugins + maven-resources-plugin + + + xls + xlsx + + + + ${project.basedir}/src/main/java 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..1cb9c525da 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 @@ -27,10 +27,7 @@ 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.service.AgencyService; import com.epmet.service.CustomerAgencyService; @@ -141,6 +138,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); } @@ -254,4 +252,54 @@ public class AgencyController { 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)); + } + } \ 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..e576abec7c --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/BuildingController.java @@ -0,0 +1,224 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.exception.ErrorCode; +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.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.constant.NeighborhoodConstant; +import com.epmet.dao.IcBuildingUnitDao; +import com.epmet.dto.BuildingTreeLevelDTO; +import com.epmet.dto.IcNeighborHoodDTO; +import com.epmet.dto.form.IcBulidingFormDTO; +import com.epmet.dto.form.IcBulidingUnitFormDTO; +import com.epmet.dto.form.IcNeighborHoodFormDTO; +import com.epmet.dto.form.ListIcNeighborHoodFormDTO; +import com.epmet.dto.result.IcNeighborHoodResultDTO; +import com.epmet.entity.IcBuildingUnitEntity; +import com.epmet.excel.IcBuildingExcel; +import com.epmet.excel.IcHouseExcel; +import com.epmet.excel.IcNeighborHoodExcel; +import com.epmet.service.BuildingService; +import com.epmet.service.IcBuildingService; +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.util.StringUtils; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.ArrayList; +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 + */ +@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); + + } + + @PostMapping("buildingadd") + public Result buildingAdd(@LoginUser TokenDto tokenDTO, @RequestBody IcBulidingFormDTO formDTO){ + //效验数据 + ValidatorUtils.validateEntity(formDTO, AddGroup.class); + String customerId = tokenDTO.getCustomerId(); +// String customerId = "123123"; + + buildingService.AddBuilding(customerId,formDTO); + return new Result().ok("保存成功"); + } + + @PostMapping("buildingupdate") + public Result buildingUpdate(@LoginUser TokenDto tokenDTO, @RequestBody IcBulidingFormDTO formDTO){ + //效验数据 + ValidatorUtils.validateEntity(formDTO, UpdateGroup.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(); + + if(!CollectionUtils.isEmpty(failList)){ + for ( IcBuildingExcel entity : failList) { + log.error("第{}行,{}",entity.getRowNum(),entity.getErrorMsg());//打印失败的行 和失败的信息 + } + return new Result().error(8001,failList.get(0).getErrorMsg()); + } + List result =importResult.getList(); + + buildingService.importExcel(customerId,result); + return new Result().ok("导入成功"); + } + + /** + * 查看楼宇单元列表 + * @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); + } + +} \ No newline at end of file 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..065c819c82 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 @@ -339,4 +339,22 @@ public class CustomerAgencyController { return new Result().ok(customerAgencyService.getAgencyList(formDTO)); } + /** + * @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); + } + } \ No newline at end of file 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..eccbc2860f 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; @@ -286,4 +287,17 @@ public class CustomerGridController { return new Result>().ok(customerGridService.selectOrgsByUserId(userId)); } + /** + * @Description 获取组织下网格选项 + * @Param formDTO + * @Return {@link Result>} + * @Author zhaoqifeng + * @Date 2021/10/26 14:02 + */ + @PostMapping("gridoption") + public Result> getGridOption(@RequestBody AgencyIdFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO); + return new Result>().ok(customerGridService.getGridOption(formDTO.getAgencyId())); + } + } 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..c950793f86 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,7 @@ package com.epmet.controller; +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; @@ -129,4 +130,16 @@ public class CustomerPartyBranchController { customerPartyBranchService.decrPartyBranchMember(partyBranchId); return new Result(); } + + /** + * 获取网格下支部小组 + * @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())); + } } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/GridController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/GridController.java index ce24000220..9b0db78308 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 @@ -58,6 +58,7 @@ public class GridController { @RequirePermission(requirePermission = RequirePermissionEnum.ORG_GRID_UPDATE) public Result editGrid(@LoginUser TokenDto tokenDto, @RequestBody EditGridFormDTO editGridFormDTO){ ValidatorUtils.validateEntity(editGridFormDTO, EditGridFormDTO.EditGrid.class); + editGridFormDTO.setCustomerId(tokenDto.getCustomerId()); return customerGridService.editGrid(tokenDto,editGridFormDTO); } @@ -68,6 +69,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 +103,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 +191,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..8bc4378e8f --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.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.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.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +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.*; + + +/** + * 房屋表 + * + * @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); + + } + + @PostMapping("houseadd") + public Result houseAdd(@LoginUser TokenDto tokenDTO, @RequestBody IcHouseFormDTO formDTO){ + //效验数据 + ValidatorUtils.validateEntity(formDTO, AddGroup.class); + String customerId = tokenDTO.getCustomerId(); +// String customerId = "123123"; + + houseService.addHouse(customerId,formDTO); + return new Result(); + } + + @PostMapping("houseupdate") + public Result houseUpdate(@LoginUser TokenDto tokenDTO, @RequestBody IcHouseFormDTO formDTO){ + //效验数据 + ValidatorUtils.validateEntity(formDTO, UpdateGroup.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(); + + if(!CollectionUtils.isEmpty(failList)){ + for ( IcHouseExcel entity : failList) { + log.error("第{}行,{}",entity.getRowNum(),entity.getErrorMsg());//打印失败的行 和失败的信息 + } + return new Result().error(8001,failList.get(0).getErrorMsg()); + } + List result =importResult.getList(); + + houseService.importExcel(customerId,result); + return new Result().ok("导入成功"); + } + + @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..982bf33835 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcHouseController.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.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.IcHouseDTO; +import com.epmet.dto.form.HouseFormDTO; +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)); + } + +} \ 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..8af8c48978 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcNeighborHoodController.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.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.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(@RequestBody IcNeighborHoodDTO dto) { + return new Result>().ok(icNeighborHoodService.getNeighborHoodOptions(dto.getAgencyId(), dto.getGridId())); + } + +} \ No newline at end of file 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/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..823363814a --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/NeighborHoodController.java @@ -0,0 +1,224 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +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.ArrayList; +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 + */ +@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); + + } + + @PostMapping("neighborhoodadd") + public Result neighborhoodadd(@LoginUser TokenDto tokenDTO, @RequestBody IcNeighborHoodFormDTO formDTO){ + //效验数据 + ValidatorUtils.validateEntity(formDTO, AddGroup.class); + String customerId = tokenDTO.getCustomerId(); +// String customerId = "123123"; + + neighborHoodService.AddNeighborhood(customerId,formDTO); + return new Result(); + } + + @PostMapping("neighborhoodupdate") + public Result neighborhoodupdate(@LoginUser TokenDto tokenDTO, @RequestBody IcNeighborHoodFormDTO formDTO){ + //效验数据 + ValidatorUtils.validateEntity(formDTO, UpdateGroup.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(); + + if(!CollectionUtils.isEmpty(failList)){ + for ( IcNeighborHoodExcel entity : failList) { + log.error("第{}行,{}",entity.getRowNum(),entity.getErrorMsg());//打印失败的行 和失败的信息 + } + return new Result().error(8001,failList.get(0).getErrorMsg()); + } + List result =importResult.getList(); +// log.info(JSON.toJSONString(result)); + neighborHoodService.importExcel(customerId,result); + 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/PropertyManagementController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/PropertyManagementController.java new file mode 100644 index 0000000000..6d35f9af68 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/PropertyManagementController.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.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.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +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.List; + + +/** + * 物业表 + * + * @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, AddGroup.class); + propertyManagementService.add(formDTO); + return new Result().ok("保存成功"); + } + + + + @PostMapping("update") + public Result update(@LoginUser TokenDto tokenDTO, @RequestBody IcPropertyManagementFormDTO formDTO){ + //效验数据 + ValidatorUtils.validateEntity(formDTO, UpdateGroup.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..187a964973 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,34 @@ public interface CustomerAgencyDao extends BaseDao { AgencyTreeResultDTO getAllAgency(@Param("customerId") String customerId); List getSubAgencyList(@Param("pid") String pid); + + 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); } \ No newline at end of file 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..34534391c3 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 @@ -300,4 +300,40 @@ 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); } 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..ddae0aca45 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingDao.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.dao; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.BaseInfoFamilyBuildingResultDTO; +import com.epmet.entity.CustomerAgencyEntity; +import com.epmet.entity.IcBuildingEntity; +import com.epmet.entity.IcHouseEntity; +import com.epmet.entity.IcNeighborHoodEntity; +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("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); +} \ 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..fd07309c02 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.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.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); +} \ 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..4da3423f9d --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodDao.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.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Constants; +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; +import java.util.Set; + +/** + * 小区表 + * + * @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("neighborNameList")List neighborNameList, + @Param("agencyNameList") List agencyNameList, + @Param("gridNameList") List gridNameList); +} \ 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/IcPropertyManagementDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPropertyManagementDao.java new file mode 100644 index 0000000000..545bb0c601 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPropertyManagementDao.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.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 { + +} \ 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/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/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..fbb0f28254 --- /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..c606388a25 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcHouseExcel.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.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 = "小区名称不能位空") + @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/IcNeighborHoodExcel.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcNeighborHoodExcel.java new file mode 100644 index 0000000000..71fcec8379 --- /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/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/IcBuildingRedis.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/IcBuildingRedis.java new file mode 100644 index 0000000000..976590a3ae --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/IcBuildingRedis.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-27 + */ +@Component +public class IcBuildingRedis { + @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/IcHouseRedis.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/IcHouseRedis.java new file mode 100644 index 0000000000..9159c6eb88 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/IcHouseRedis.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-27 + */ +@Component +public class IcHouseRedis { + @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/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/service/AgencyService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java index 381fb7256a..e9c092fed5 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; @@ -117,4 +115,37 @@ 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); + } \ 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..39df4d14df --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/BuildingService.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.service; + +import com.epmet.dto.BuildingTreeLevelDTO; +import com.epmet.dto.form.IcBulidingFormDTO; +import com.epmet.dto.form.ListIcNeighborHoodFormDTO; +import com.epmet.dto.result.IcNeighborHoodResultDTO; +import com.epmet.excel.IcBuildingExcel; +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 BuildingService { + + + + + + void UpdateBuilding(String customerId, IcBulidingFormDTO formDTO); + + /** + * 删除小区 + * @param buildingId + */ + void DelBuilding(String buildingId); + + + void AddBuilding(String customerId, IcBulidingFormDTO formDTO); + + List treeList(String customerId); + + void importExcel(String customerId, List list); + + IcNeighborHoodResultDTO listBuilding(ListIcNeighborHoodFormDTO formDTO); + + void exportBuildinginfo(ListIcNeighborHoodFormDTO formDTO, HttpServletResponse response) throws Exception ; +} \ 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..3eb6585c03 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 @@ -255,4 +255,6 @@ public interface CustomerAgencyService extends BaseService * @Date 2021/9/8 15:21 */ AgencyTreeResultDTO getAgencyList(GetAgencyListFormDTO formDTO); + + List getStaffOrgListByStaffId(String staffId); } \ No newline at end of file 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..453c81f256 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,22 @@ 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); } 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..5bd4a78b65 --- /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); + + + void importExcel(String customerId, List list); + + 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..471007a582 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcHouseService.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.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.IcHouseDTO; +import com.epmet.dto.form.HouseFormDTO; +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); +} \ 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..d069185056 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcNeighborHoodService.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.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); +} \ 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..f4c612a2b4 --- /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 ; + + void importExcel(String customerId,List list); +} \ 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..5fe43468e9 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/PropertyManagementService.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.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcPropertyManagementDTO; +import com.epmet.dto.form.IcPropertyManagementFormDTO; +import com.epmet.dto.result.IcPropertyManagementResultDTO; +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 PropertyManagementService { + + List getList(); + + void 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..f95f2486ea 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,25 +18,35 @@ package com.epmet.service.impl; import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.epmet.commons.rocketmq.messages.OrgOrStaffMQMsg; 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.send.SendMqMsgUtil; import com.epmet.service.AgencyService; import com.epmet.service.CustomerAgencyService; import com.epmet.service.CustomerOrgParameterService; @@ -49,6 +59,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 +91,10 @@ public class AgencyServiceImpl implements AgencyService { private CustomerOrgParameterService customerOrgParameterService; @Autowired private EpmetCommonServiceOpenFeignClient epmetCommonServiceOpenFeignClient; + @Autowired + private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; + @Autowired + private IcBuildingDao icBuildingDao; /** @@ -176,6 +191,16 @@ public class AgencyServiceImpl implements AgencyService { //5.redis缓存 customerAgencyRedis.delete(formDTO.getAgencyId()); + + //2021-10-18 推送mq,数据同步到中介库 start【中介库只放了组织的名称、级别,所以涉及批量修改pname的操作不涉及同步中间库】 + OrgOrStaffMQMsg mq = new OrgOrStaffMQMsg(); + mq.setCustomerId(originalEntity.getCustomerId()); + mq.setOrgId(formDTO.getAgencyId()); + mq.setOrgType("agency"); + mq.setType("agency_change"); + SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendOrgStaffMqMsg(mq); + //2021-10-18 end + return result; } @@ -215,6 +240,16 @@ public class AgencyServiceImpl implements AgencyService { log.error(CustomerAgencyConstant.DEL_EXCEPTION); throw new RenException(CustomerAgencyConstant.DEL_EXCEPTION); } + + //2021-10-18 推送mq,数据同步到中介库 start + OrgOrStaffMQMsg mq = new OrgOrStaffMQMsg(); + mq.setCustomerId(formDTO.getCustomerId()); + mq.setOrgId(formDTO.getAgencyId()); + mq.setOrgType("agency"); + mq.setType("agency_change"); + SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendOrgStaffMqMsg(mq); + //2021-10-18 end + return result; } @@ -370,6 +405,16 @@ public class AgencyServiceImpl implements AgencyService { entity.setTotalUser(0); entity.setCustomerId(form.getCustomerId()); customerAgencyDao.insert(entity); + + //2021-10-18 推送mq,数据同步到中介库 start + OrgOrStaffMQMsg mq = new OrgOrStaffMQMsg(); + mq.setCustomerId(form.getCustomerId()); + mq.setOrgId(entity.getId()); + mq.setOrgType("agency"); + mq.setType("agency_create"); + SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendOrgStaffMqMsg(mq); + //2021-10-18 end + return entity.getId(); } @@ -430,6 +475,15 @@ public class AgencyServiceImpl implements AgencyService { throw new RenException(EpmetErrorCode.OPER_ADD_CUSTOMER_MANAGER_ERROR.getCode(), staffResult.getMsg()); } + //2021-10-18 推送mq,数据同步到中介库 start + OrgOrStaffMQMsg mq = new OrgOrStaffMQMsg(); + mq.setCustomerId(agencyDTO.getCustomerId()); + mq.setOrgId(entity.getId()); + mq.setOrgType("agency"); + mq.setType("agency_create"); + SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendOrgStaffMqMsg(mq); + //2021-10-18 end + } /** @@ -474,9 +528,140 @@ public class AgencyServiceImpl implements AgencyService { //3:返回新组织Id resultDTO.setAgencyId(insertEntity.getId()); resultDTO.setAreaCode(insertEntity.getAreaCode()); + + //2021-10-18 推送mq,数据同步到中介库 start + OrgOrStaffMQMsg mq = new OrgOrStaffMQMsg(); + mq.setCustomerId(parent.getCustomerId()); + mq.setOrgId(insertEntity.getId()); + mq.setOrgType("agency"); + mq.setType("agency_create"); + SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendOrgStaffMqMsg(mq); + //2021-10-18 end 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 (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()); + result.setLatitude(StringUtils.isBlank(entity.getLatitude()) ? new BigDecimal(customerAgencyEntity.getLatitude()) : new BigDecimal(entity.getLatitude())); + result.setLongitude(StringUtils.isBlank(entity.getLongitude()) ? new BigDecimal(customerAgencyEntity.getLongitude()) : 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); + } + if (CollectionUtils.isNotEmpty(dtoList)){ + MapOrgResultDTO finalResult1 = result; + dtoList.forEach(d -> { + d.setLatitude(StringUtils.isBlank(d.getLatitudeOrigin()) ? finalResult1.getLatitude() : new BigDecimal(d.getLatitudeOrigin())); + d.setLongitude(StringUtils.isBlank(d.getLongitudeOrigin()) ? finalResult1.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); + result.setLatitude(StringUtils.isBlank(entity.getLatitude()) ? new BigDecimal(customerAgencyEntity.getLatitude()) : new BigDecimal(entity.getLatitude())); + result.setLongitude(StringUtils.isBlank(entity.getLongitude()) ? new BigDecimal(customerAgencyEntity.getLongitude()) : new BigDecimal(entity.getLongitude())); + List son = customerAgencyDao.selectSonOrg(formDTO.getOrgId(), OrgInfoConstant.NEIGHBOR_HOOD); + if (CollectionUtils.isNotEmpty(son)){ + MapOrgResultDTO finalResult2 = result; + son.forEach(s -> { + s.setLatitude(StringUtils.isBlank(s.getLatitudeOrigin()) ? finalResult2.getLatitude() : new BigDecimal(s.getLatitudeOrigin())); + s.setLongitude(StringUtils.isBlank(s.getLongitudeOrigin()) ? finalResult2.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; + } + private CustomerAgencyEntity constructInsertEntity(AddAgencyV2FormDTO formDTO, CustomerAgencyDTO parent) { CustomerAgencyEntity insertEntity = ConvertUtils.sourceToTarget(formDTO, CustomerAgencyEntity.class); insertEntity.setOrganizationName(formDTO.getAgencyName()); 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..10371e3369 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java @@ -0,0 +1,435 @@ +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.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +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.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) { + 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 void importExcel(String customerId, List list) { + //导入 + if(CollectionUtils.isEmpty(list)){ + return ; + } + //查询所有组织和网格根据名字 + + + + //获取所有小区 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(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<>(); + for (IcBuildingExcel icBuildingExcel : list) { + 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() + 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> 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 ; + } + 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) { + 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..836bbbb355 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 @@ -1124,4 +1124,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/CustomerGridServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java index 58faa734ac..43a73d3b46 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java @@ -18,12 +18,15 @@ 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.rocketmq.messages.OrgOrStaffMQMsg; 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; @@ -41,12 +44,15 @@ import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.entity.CustomerAgencyEntity; import com.epmet.entity.CustomerGridEntity; +import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.feign.EpmetUserFeignClient; import com.epmet.feign.OperCrmOpenFeignClient; +import com.epmet.send.SendMqMsgUtil; import com.epmet.service.CustomerAgencyService; import com.epmet.service.CustomerGridService; import com.epmet.util.ModuleConstant; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -79,9 +85,10 @@ public class CustomerGridServiceImpl extends BaseServiceImpl page(Map params) { @@ -270,6 +277,16 @@ public class CustomerGridServiceImpl extends BaseServiceImpl().ok(resultDTO); } @@ -291,6 +308,16 @@ 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) { + 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()); + } } 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..e542c017ad 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; @@ -34,14 +36,18 @@ 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,6 +55,7 @@ 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 { @@ -134,4 +141,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.error("网格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()); + } + } \ 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..b481f048e0 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java @@ -0,0 +1,250 @@ +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.enums.HouseTypeEnum; +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.IcBuildingEntity; +import com.epmet.entity.IcHouseEntity; +import com.epmet.entity.IcNeighborHoodEntity; +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) { + 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) { + 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 + public void importExcel(String customerId, List list) { + //导入 + if(CollectionUtils.isEmpty(list)){ + return ; + } + //获取所有小区 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(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<>(); + for (IcHouseExcel icHouseExcel : list) { + 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()); + + 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()); + houseEntityList.add(entity); + } + //3.保存 + icHouseService.insertBatch(houseEntityList); + + } + + @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..c1d5c440e3 --- /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.error("小区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..2a4a325856 --- /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.error("楼栋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..0a6f7f50c4 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.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.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.IcHouseDao; +import com.epmet.dto.IcHouseDTO; +import com.epmet.dto.form.HouseFormDTO; +import com.epmet.entity.IcHouseEntity; +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 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 IcHouseServiceImpl extends BaseServiceImpl implements IcHouseService { + + + @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.error("楼栋和单元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()); + } + +} \ 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..ceea51f13d --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodServiceImpl.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.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.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) { + if (StringUtils.isBlank(agencyId)) { + log.error("组织ID为空"); + return Collections.emptyList(); + } + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(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()); + } + +} \ 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..00d96f74f6 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/NeighborHoodServiceImpl.java @@ -0,0 +1,302 @@ +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.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +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.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) { + 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) { + 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 void importExcel(String customerId,List list) { + //导入 + if(CollectionUtils.isEmpty(list)){ + return ; + } + //获取所有组织 list + List agencyNameList = list.stream().map(item -> item.getAgencyName()).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()); + //查询对应的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<>(); + for (IcNeighborHoodExcel icNeighborHoodExcel : list) { + 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())).map(u->u.getId()).orElse("")); // agencyMap.get(icNeighborHoodExcel.getAgencyName()).getId()); + entity.setParentAgencyId(Optional.ofNullable(agencyMap.get(icNeighborHoodExcel.getAgencyName())).map(u->u.getPid()).orElse(""));//agencyMap.get(icNeighborHoodExcel.getAgencyName()).getPid() + entity.setAgencyPids(Optional.ofNullable(agencyMap.get(icNeighborHoodExcel.getAgencyName())).map(u->u.getPids()).orElse(""));//agencyMap.get(icNeighborHoodExcel.getAgencyName()).getPids() + entity.setGridId(Optional.ofNullable(gridMap.get(icNeighborHoodExcel.getGridName())).map(u->u.getId()).orElse(""));//gridMap.get(icNeighborHoodExcel.getGridName()).getId() + 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); + + } + + + + 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"); + 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..4068fb710d --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/PropertyManagementServiceImpl.java @@ -0,0 +1,67 @@ +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 void add(IcPropertyManagementFormDTO formDTO) { + IcPropertyManagementEntity icPropertyManagementEntity = ConvertUtils.sourceToTarget(formDTO, IcPropertyManagementEntity.class); + icPropertyManagementDao.insert(icPropertyManagementEntity); + } + + @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/util/ExcelPoiUtils.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/util/ExcelPoiUtils.java new file mode 100644 index 0000000000..38ea2c597c --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/util/ExcelPoiUtils.java @@ -0,0 +1,276 @@ +package com.epmet.util; + +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.lang.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-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..7950169c04 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..26ced342a1 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/mapper/CustomerAgencyDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml index 89a5df87f4..be6423e487 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' + + + + + + + \ 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..a3aba7122e 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 @@ -618,4 +618,67 @@ union ALL SELECT agency_id AS orgId FROM customer_staff_agency WHERE del_flag = '0' and USER_ID = #{userId} + + + + + + + + + + + + + + + + + + + + + + + + + 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..3d110df7bd --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingDao.xml @@ -0,0 +1,304 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ 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..3dc145833a --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml @@ -0,0 +1,255 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ 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..342b567ba7 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml @@ -0,0 +1,204 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ 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/IcPropertyManagementDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPropertyManagementDao.xml new file mode 100644 index 0000000000..b1b707f456 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPropertyManagementDao.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + \ 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..00c96a08f6 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/BaseConflictsResolveDTO.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.opendata.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 事件中间表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-22 + */ +@Data +public class BaseConflictsResolveDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 事件ID + */ + private String id; + + /** + * 事件信息 + */ + private String eventInfo; + + /** + * 事件所属网格ID + */ + private String gridId; + + /** + * + */ + private String delFlag; + + /** + * 创建人 + */ + 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/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/BaseGridInfoDTO.java b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/BaseGridInfoDTO.java new file mode 100644 index 0000000000..2b105cfe85 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/BaseGridInfoDTO.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.opendata.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 网格基础信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-15 + */ +@Data +public class BaseGridInfoDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 组织/网格Id + */ + private String orgId; + + /** + * 网格编码 + */ + private String code; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 网格层级[07:网格] + */ + private String gridLevel; + + /** + * 专属网格类型[01:党政机关; 02:医院; 03:学校; 04:企业; 05:园区; 06:商圈; 07:市场; 08:景区; + */ + private String gridType; + + /** + * 网格内人口规模[01:500人以下(含500人); 02:500-1000人(含1000人); 03:1000-1500人(含1500人); 04:1500人以上] + */ + private String populationSize; + + /** + * 是否成立网格党支部或网格党小组[Y:是、N:否] + */ + private String isPartyBranch; + + /** + * 网格党组织类型[01:网格党支部; 02:网格党小组] + */ + private String partyBranchType; + + /** + * 中心点(质心)经度 + */ + private String lng; + + /** + * 中心点(质心)纬度 + */ + private String lat; + + /** + * 网格颜色 + */ + private String gridColor; + + /** + * 空间范围 + */ + private String shape; + + /** + * 删除标识 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/BaseGridUserDTO.java b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/BaseGridUserDTO.java new file mode 100644 index 0000000000..fb5218cdf8 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/BaseGridUserDTO.java @@ -0,0 +1,191 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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 java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 网格员基础信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-15 + */ +@Data +public class BaseGridUserDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 网格Id + */ + private String gridId; + + /** + * 人员Id + */ + private String staffId; + + /** + * 网格编码 + */ + 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; + + /** + * 民族[字典表主键] + */ + private String nation; + + /** + * 政治面貌[字典表主键] + */ + private String paerty; + + /** + * 出生日期[YYYY-MM-DD] + */ + private Date birthday; + + /** + * 学历[字典表主键] + */ + private String education; + + /** + * 入职时间 + */ + private Date entryDate; + + /** + * 是否离职 + */ + private String isLeave; + + /** + * 离职时间 + */ + private Date leaveDate; + + /** + * 网格员年收入 + */ + private String income; + + /** + * 是否社区(村)两委委员[Y:是、N:否] + */ + private String isCommittee; + + /** + * 是否社区工作者[Y:是、N:否] + */ + private String isCommunityWorkers; + + /** + * 是否社会工作者[Y:是、N:否] + */ + private String isSocialWorker; + + /** + * 是否村(居)民小组长[Y:是、N:否 + */ + private String isVillageLeader; + + /** + * 是否警务助理[Y:是、N:否] + */ + private String isPoliceAssistant; + + /** + * 是否人民调解员[Y:是、N:否] + */ + private String isMediator; + + /** + * 删除标识 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..cd092d52ba --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/ExDeptDTO.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-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; + + /** + * (区县平台)部门id + */ + private String deptIdQx; + + /** + * (区县平台)部门/网格名称 + */ + private String deptNameQx; + +} \ 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..d0f61777ca --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/ExUserDTO.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.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 String userId; + + /** + * 市平台 用户名 + */ + private String userName; + + /** + * 市平台 用户身份证号 + */ + private String idCard; + + /** + * 市平台 用户手机号 + */ + private String mobile; + + /** + * 区县平台 用户ID + */ + private String userIdQx; + + /** + * 区县平台 用户名 + */ + private String userNameQx; + + /** + * 区县平台 用户账号 + */ + private String userAccount; + + /** + * 删除标识 + */ + private String delFlag; + +} \ 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/GridBaseInfoFormDTO.java b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/GridBaseInfoFormDTO.java new file mode 100644 index 0000000000..0b1910a2ea --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/GridBaseInfoFormDTO.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 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/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..d486c7f67a --- /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 = "事件标识不能为空", 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..feedbad307 --- /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.69 + ports: + - "8107:8107" + 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 \ No newline at end of file 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..6a40fad5b3 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/pom.xml @@ -0,0 +1,282 @@ + + + + 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/BaseGridInfoController.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/BaseGridInfoController.java new file mode 100644 index 0000000000..531ecc8cde --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/BaseGridInfoController.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.GridBaseInfoFormDTO; +import com.epmet.opendata.service.BaseGridInfoService; +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("basegridinfo") +public class BaseGridInfoController { + + @Autowired + private BaseGridInfoService baseGridInfoService; + + + /** + * @Author sun + * @Description 组织基础信息中介库同步 + **/ + @PostMapping("agencybaseinfo") + public Result getAgencyBaseInfo(@RequestBody(required = false) GridBaseInfoFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, GridBaseInfoFormDTO.Grid.class); + baseGridInfoService.getAgencyBaseInfo(formDTO); + return new Result(); + } + + /** + * @Author sun + * @Description 网格基础信息中介库同步 + **/ + @PostMapping("gridbaseinfo") + public Result getGridBaseInfo(@RequestBody(required = false) GridBaseInfoFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, GridBaseInfoFormDTO.Grid.class); + baseGridInfoService.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/BaseGridUserController.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/BaseGridUserController.java new file mode 100644 index 0000000000..dcf3146724 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/BaseGridUserController.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.opendata.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.user.result.GridUserInfoDTO; +import com.epmet.opendata.dto.form.StaffBaseInfoFormDTO; +import com.epmet.opendata.service.BaseGridUserService; +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-10-15 + */ +@RestController +@RequestMapping("basegriduser") +public class BaseGridUserController { + + @Autowired + private BaseGridUserService baseGridUserService; + + /** + * @Author sun + * @Description 网格员信息中间库同步 + **/ + @PostMapping("staffbaseinfo") + public Result getStaffBaseInfo(@RequestBody(required = false) StaffBaseInfoFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, StaffBaseInfoFormDTO.Staff.class); + baseGridUserService.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/BaseGridInfoDao.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/BaseGridInfoDao.java new file mode 100644 index 0000000000..40c5649d1b --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/BaseGridInfoDao.java @@ -0,0 +1,41 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.BaseGridInfoEntity; +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 BaseGridInfoDao 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/BaseGridUserDao.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/BaseGridUserDao.java new file mode 100644 index 0000000000..c53eb48e1f --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/BaseGridUserDao.java @@ -0,0 +1,41 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.BaseGridUserEntity; +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 BaseGridUserDao 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/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..fa088c958f --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/ExDeptDao.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.opendata.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.opendata.entity.BaseGridInfoEntity; +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..4a3c4ecc13 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/ExUserDao.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.ExUserEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 系统用户中间表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-22 + */ +@Mapper +public interface ExUserDao 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/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..fe9a50a92a --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/BaseConflictsResolveEntity.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.opendata.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-22 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("base_conflicts_resolve") +public class BaseConflictsResolveEntity { + + private static final long serialVersionUID = 1L; + + /** + * 事件信息 + */ + private String eventInfo; + + /** + * 事件所属网格ID + */ + private String gridId; + +} 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..3f458a026a --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/BaseDisputeProcessEntity.java @@ -0,0 +1,181 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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/BaseGridInfoEntity.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/BaseGridInfoEntity.java new file mode 100644 index 0000000000..f74e8b2205 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/BaseGridInfoEntity.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.opendata.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-15 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("base_grid_info") +public class BaseGridInfoEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 组织/网格Id + */ + private String orgId; + + /** + * 网格编码 + */ + private String code; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 网格层级[07:网格] + */ + private String gridLevel; + + /** + * 专属网格类型[01:党政机关; 02:医院; 03:学校; 04:企业; 05:园区; 06:商圈; 07:市场; 08:景区; + */ + private String gridType; + + /** + * 网格内人口规模[01:500人以下(含500人); 02:500-1000人(含1000人); 03:1000-1500人(含1500人); 04:1500人以上] + */ + private String populationSize; + + /** + * 是否成立网格党支部或网格党小组[Y:是、N:否] + */ + private String isPartyBranch; + + /** + * 网格党组织类型[01:网格党支部; 02:网格党小组] + */ + private String partyBranchType; + + /** + * 中心点(质心)经度 + */ + private String lng; + + /** + * 中心点(质心)纬度 + */ + private String lat; + + /** + * 网格颜色 + */ + private String gridColor; + + /** + * 空间范围 + */ + private String shape; + +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/BaseGridUserEntity.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/BaseGridUserEntity.java new file mode 100644 index 0000000000..5d0b2f1de6 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/BaseGridUserEntity.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.opendata.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-15 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("base_grid_user") +public class BaseGridUserEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 网格Id + */ + private String gridId; + + /** + * 人员Id + */ + private String staffId; + + /** + * 网格编码 + */ + 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; + + /** + * 民族[字典表主键] + */ + private String nation; + + /** + * 政治面貌[字典表主键] + */ + private String paerty; + + /** + * 出生日期[YYYY-MM-DD] + */ + private Date birthday; + + /** + * 学历[字典表主键] + */ + private String education; + + /** + * 入职时间 + */ + private Date entryDate; + + /** + * 是否离职 + */ + private String isLeave; + + /** + * 离职时间 + */ + private Date leaveDate; + + /** + * 网格员年收入 + */ + private String income; + + /** + * 是否社区(村)两委委员[Y:是、N:否] + */ + private String isCommittee; + + /** + * 是否社区工作者[Y:是、N:否] + */ + private String isCommunityWorkers; + + /** + * 是否社会工作者[Y:是、N:否] + */ + private String isSocialWorker; + + /** + * 是否村(居)民小组长[Y:是、N:否 + */ + private String isVillageLeader; + + /** + * 是否警务助理[Y:是、N:否] + */ + private String isPoliceAssistant; + + /** + * 是否人民调解员[Y:是、N:否] + */ + private String isMediator; + +} 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..7a2d2e3ff8 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/ExDeptEntity.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.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; + + /** + * (区县平台)部门id + */ + private String deptIdQx; + + /** + * (区县平台)部门/网格名称 + */ + private String deptNameQx; + +} 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..f178336ab1 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/ExUserEntity.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.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 String userId; + + /** + * 市平台 用户名 + */ + private String userName; + + /** + * 市平台 用户身份证号 + */ + private String idCard; + + /** + * 市平台 用户手机号 + */ + private String mobile; + + /** + * 区县平台 用户ID + */ + private String userIdQx; + + /** + * 区县平台 用户名 + */ + private String userNameQx; + + /** + * 区县平台 用户账号 + */ + private String userAccount; + +} 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..3fa339bc0b --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/RocketMQConsumerRegister.java @@ -0,0 +1,54 @@ +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.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.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.OPEN_DATA_ORG_CHANGE_EVENT_LISTENER_GROUP, + MessageModel.CLUSTERING, + TopicConstants.ORG, + "*", + new OpenDataOrgChangeEventListener()); + + register(consumerProperties, + ConsomerGroupConstants.OPEN_DATA_STAFF_CHANGE_EVENT_LISTENER_GROUP, + MessageModel.CLUSTERING, + TopicConstants.STAFF, + "*", + new OpenDataStaffChangeEventListener()); + + register(consumerProperties, + ConsomerGroupConstants.OPEN_DATA_PATROL_CHANGE_EVENT_LISTENER_GROUP, + MessageModel.CLUSTERING, + TopicConstants.PATROL, + "*", + new OpenDataPatrolChangeEventListener()); + register(consumerProperties, + ConsomerGroupConstants.OPEN_DATA_PROJECT_CHANGE_EVENT_LISTENER_GROUP, + MessageModel.CLUSTERING, + TopicConstants.PROJECT, + "*", + new OpenDataProjectChangeEventListener()); + + // ...其他监听器类似 + } +} 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..04e95a893b --- /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,115 @@ +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.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.GridBaseInfoFormDTO; +import com.epmet.opendata.service.BaseGridInfoService; +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; + + @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); + + DistributedLock distributedLock = null; + RLock lock = null; + try { + distributedLock = SpringContextUtils.getBean(DistributedLock.class); + lock = distributedLock.getLock(String.format("lock:open_data_org:%s", obj.getOrgId()), + 30L, 30L, TimeUnit.SECONDS); + + GridBaseInfoFormDTO dto = new GridBaseInfoFormDTO(); + dto.setCustomerId(obj.getCustomerId()); + dto.setType(obj.getType()); + List orgIdList = new ArrayList<>(); + orgIdList.add(obj.getOrgId()); + if ("agency".equals(obj.getOrgType())) { + SpringContextUtils.getBean(BaseGridInfoService.class).getAgencyBaseInfo(dto); + } else { + SpringContextUtils.getBean(BaseGridInfoService.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..6207c6fa74 --- /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,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.StaffPatrolMQMsg; +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; + + @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 (msgObj == null) { + log.warn("consumeMessage msg body is blank"); + return; + } + DistributedLock distributedLock = null; + RLock lock = null; + try { + distributedLock = SpringContextUtils.getBean(DistributedLock.class); + 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..c2af1cffe7 --- /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,111 @@ +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.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; + + @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); + EventInfoFormDTO formDTO = ConvertUtils.sourceToTarget(obj, EventInfoFormDTO.class); + + DistributedLock distributedLock = null; + RLock lock = null; + try { + distributedLock = SpringContextUtils.getBean(DistributedLock.class); + 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..48d0ece671 --- /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,116 @@ +package com.epmet.opendata.mq.listener; + +import com.epmet.commons.rocketmq.constants.MQUserPropertys; +import com.alibaba.fastjson.JSON; +import com.epmet.commons.rocketmq.messages.OrgOrStaffMQMsg; +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.BaseGridUserService; +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; + + @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); + + DistributedLock distributedLock = null; + RLock lock = null; + try { + distributedLock = SpringContextUtils.getBean(DistributedLock.class); + 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(BaseGridUserService.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/BaseGridInfoService.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/BaseGridInfoService.java new file mode 100644 index 0000000000..f0fe03c28a --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/BaseGridInfoService.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.opendata.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.opendata.dto.form.GridBaseInfoFormDTO; +import com.epmet.opendata.entity.BaseGridInfoEntity; + +/** + * 网格基础信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-15 + */ +public interface BaseGridInfoService extends BaseService { + + /** + * @Author sun + * @Description 组织基础信息中介库同步 + **/ + void getAgencyBaseInfo(GridBaseInfoFormDTO formDTO); + + /** + * @Author sun + * @Description 网格基础信息中介库同步 + **/ + void getGridBaseInfo(GridBaseInfoFormDTO 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/BaseGridUserService.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/BaseGridUserService.java new file mode 100644 index 0000000000..2cdda5d9c5 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/BaseGridUserService.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.opendata.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.opendata.dto.form.StaffBaseInfoFormDTO; +import com.epmet.opendata.entity.BaseGridUserEntity; + +/** + * 网格员基础信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-15 + */ +public interface BaseGridUserService extends BaseService { + + /** + * @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/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..644c06c673 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/ExDeptService.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.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.opendata.dto.ExDeptDTO; +import com.epmet.opendata.entity.ExDeptEntity; + +import java.util.List; +import java.util.Map; + +/** + * 部门(网格)中间表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-19 + */ +public interface ExDeptService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-10-19 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-10-19 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ExDeptDTO + * @author generator + * @date 2021-10-19 + */ + ExDeptDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-10-19 + */ + void save(ExDeptDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-10-19 + */ + void update(ExDeptDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-10-19 + */ + void delete(String[] ids); + + Map getDeptMap(); +} \ 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/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..9c76d86500 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/ExUserService.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.ExUserEntity; + +/** + * 系统用户中间表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-22 + */ +public interface ExUserService 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/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..2a9e99acbf --- /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,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.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.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.constant.SystemMessageType; +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.BaseDisputeProcessEntity; +import com.epmet.opendata.service.BaseDisputeProcessService; +import com.epmet.opendata.service.ExDeptService; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; +import java.util.Map; + +/** + * 事件信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-15 + */ +@Service +public class BaseDisputeProcessServiceImpl extends BaseServiceImpl implements BaseDisputeProcessService { + @Resource + private DataStatisticalOpenFeignClient dataStatisticalOpenFeignClient; + @Resource + private ExDeptService exDeptService; + + /** + * 获取上报事件 + * + * @param formDTO + * @Param formDTO + * @Return + * @Author zhaoqifeng + * @Date 2021/10/15 16:59 + */ + @Override + public void getEventinfo(EventInfoFormDTO formDTO) { + Result> result = dataStatisticalOpenFeignClient.getEventInfo(formDTO); + if (!result.success()) { + throw new RenException(result.getInternalMsg()); + } + Map deptMap = exDeptService.getDeptMap(); + List list = result.getData(); + if (CollectionUtils.isNotEmpty(list)) { + List entityList = ConvertUtils.sourceToTarget(list, BaseDisputeProcessEntity.class); + entityList.forEach(item -> { + item.setDetpId(deptMap.get(item.getOrgCode())); + }); + if(SystemMessageType.PROJECT_ADD.equals(formDTO.getType())){ + insertBatch(entityList); + }else { + updateBatchById(entityList); + } + } + //分批次循环 + while (CollectionUtils.isNotEmpty(list)) { + formDTO.setPageNo(formDTO.getPageNo() + NumConstant.ONE); + result = dataStatisticalOpenFeignClient.getEventInfo(formDTO); + list = result.getData(); + if (CollectionUtils.isNotEmpty(list)) { + List entityList = ConvertUtils.sourceToTarget(list, BaseDisputeProcessEntity.class); + entityList.forEach(item -> { + item.setDetpId(deptMap.get(item.getOrgCode())); + }); + if("add".equals(formDTO.getType())){ + insertBatch(entityList); + }else { + updateBatchById(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/BaseGridInfoServiceImpl.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/BaseGridInfoServiceImpl.java new file mode 100644 index 0000000000..8c7fd0d5c8 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/BaseGridInfoServiceImpl.java @@ -0,0 +1,154 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.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.BaseGridInfoDao; +import com.epmet.opendata.dao.ExDeptDao; +import com.epmet.opendata.dto.form.GridBaseInfoFormDTO; +import com.epmet.opendata.entity.BaseGridInfoEntity; +import com.epmet.opendata.entity.ExDeptEntity; +import com.epmet.opendata.service.BaseGridInfoService; +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; + +/** + * 网格基础信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-15 + */ +@Service +public class BaseGridInfoServiceImpl extends BaseServiceImpl implements BaseGridInfoService { + @Autowired + private DataStatisticalOpenFeignClient dataStatisticalOpenFeignClient; + @Autowired + private ExDeptDao exDeptDao; + + /** + * @Author sun + * @Description 组织基础信息中介库同步 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public void getAgencyBaseInfo(GridBaseInfoFormDTO 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 entityList = new ArrayList<>(); + result.getData().forEach(ag->{ + BaseGridInfoEntity entity = new BaseGridInfoEntity(); + entity.setCustomerId(ag.getCustomerId()); + entity.setOrgId(ag.getId()); + entity.setCode(""); + entity.setGridName(ag.getOrganizationName()); + String level = "06"; + if("province".equals(ag.getLevel())){ level = "01"; } + else if("city".equals(ag.getLevel())){ level = "02"; } + else if("district".equals(ag.getLevel())){ level = "03"; } + else if("street".equals(ag.getLevel())){ level = "04"; } + entity.setGridLevel(level); + entity.setGridType("01"); + entity.setDelFlag(ag.getDelFlag().toString()); + entity.setUpdatedBy(ag.getUpdatedBy()); + entity.setUpdatedTime(ag.getUpdatedTime()); + entityList.add(entity); + });*/ + List ExList = new ArrayList<>(); + result.getData().forEach(ag->{ + ExDeptEntity entity = new ExDeptEntity(); + entity.setDeptIdQx(ag.getId()); + entity.setDeptNameQx(ag.getOrganizationName()); + entity.setGridCode(ag.getCode()); + ExList.add(entity); + }); + if(null!=formDTO.getType()&& "all".equals(formDTO.getType())){ + exDeptDao.updateBatch(ExList); + }else { + exDeptDao.insertBatch(ExList); + } + + + } + + /** + * @Author sun + * @Description 网格基础信息中介库同步 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public void getGridBaseInfo(GridBaseInfoFormDTO 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 entityList = new ArrayList<>(); + result.getData().forEach(ag->{ + BaseGridInfoEntity entity = new BaseGridInfoEntity(); + entity.setCustomerId(ag.getCustomerId()); + entity.setOrgId(ag.getId()); + entity.setCode(""); + entity.setGridName(ag.getGridName()); + entity.setGridLevel("07"); + entity.setGridType("01"); + entity.setDelFlag(ag.getDelFlag().toString()); + entity.setUpdatedBy(ag.getUpdatedBy()); + entity.setUpdatedTime(ag.getUpdatedTime()); + entityList.add(entity); + });*/ + List ExList = new ArrayList<>(); + result.getData().forEach(ag -> { + ExDeptEntity entity = new ExDeptEntity(); + entity.setDeptIdQx(ag.getId()); + entity.setDeptNameQx(ag.getGridName()); + entity.setGridCode(ag.getCode()); + ExList.add(entity); + }); + if (null != formDTO.getType() && "all".equals(formDTO.getType())) { + exDeptDao.updateBatchGrid(ExList); + } else { + exDeptDao.insertBatch(ExList); + } + + } + +} \ 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/BaseGridUserServiceImpl.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/BaseGridUserServiceImpl.java new file mode 100644 index 0000000000..6a8902a38b --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/BaseGridUserServiceImpl.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.opendata.service.impl; + +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.org.result.CustomerAgencyDTO; +import com.epmet.dto.user.result.CustomerStaffDTO; +import com.epmet.dto.user.result.GridUserInfoDTO; +import com.epmet.feign.DataStatisticalOpenFeignClient; +import com.epmet.opendata.dao.BaseGridUserDao; +import com.epmet.opendata.dto.form.StaffBaseInfoFormDTO; +import com.epmet.opendata.entity.BaseGridInfoEntity; +import com.epmet.opendata.entity.BaseGridUserEntity; +import com.epmet.opendata.service.BaseGridUserService; +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; + +/** + * 网格员基础信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-15 + */ +@Service +public class BaseGridUserServiceImpl extends BaseServiceImpl implements BaseGridUserService { + @Autowired + private DataStatisticalOpenFeignClient dataStatisticalOpenFeignClient; + + /** + * @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 = ConvertUtils.sourceToTarget(result.getData(), BaseGridUserEntity.class); + if("add".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/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..44b519e95b --- /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,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.opendata.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.opendata.dao.ExDeptDao; +import com.epmet.opendata.dto.ExDeptDTO; +import com.epmet.opendata.entity.ExDeptEntity; +import com.epmet.opendata.service.ExDeptService; +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-19 + */ +@Service +public class ExDeptServiceImpl extends BaseServiceImpl implements ExDeptService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ExDeptDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ExDeptDTO.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 ExDeptDTO get(String id) { + ExDeptEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ExDeptDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ExDeptDTO dto) { + ExDeptEntity entity = ConvertUtils.sourceToTarget(dto, ExDeptEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ExDeptDTO dto) { + ExDeptEntity entity = ConvertUtils.sourceToTarget(dto, ExDeptEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public Map getDeptMap() { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.ne(ExDeptEntity::getGridCode, null); + List entityList = baseDao.selectList(wrapper); + if (CollectionUtils.isEmpty(entityList)) { + return Collections.emptyMap(); + } + return entityList.stream().collect(Collectors.toMap(ExDeptEntity::getGridCode, ExDeptEntity::getDeptId, (key1, key2) -> key2)); + } + +} \ 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/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..4badca6794 --- /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,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.opendata.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.opendata.dao.ExUserDao; +import com.epmet.opendata.dto.ExUserDTO; +import com.epmet.opendata.entity.ExUserEntity; +import com.epmet.opendata.service.ExUserService; +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-22 + */ +@Service +public class ExUserServiceImpl extends BaseServiceImpl implements ExUserService { + + +} \ 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..49db95eb6d --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/bootstrap.yml @@ -0,0 +1,138 @@ +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 + +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/init_db.sql b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/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/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/BaseGridInfoDao.xml b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/BaseGridInfoDao.xml new file mode 100644 index 0000000000..4d823eac28 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/BaseGridInfoDao.xml @@ -0,0 +1,50 @@ + + + + + + + UPDATE base_grid_info + + + + + + when org_id = #{item.orgId} then #{item.gridName} + + + + + + + + when org_id = #{item.orgId} then #{item.delFlag} + + + + + + + + when org_id = #{item.orgId} then #{item.updatedBy} + + + + + + + + when org_id = #{item.orgId} then #{item.updatedTime} + + + + + + WHERE + 1=1 + + org_id = #{item.orgId} + + + + \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/BaseGridUserDao.xml b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/BaseGridUserDao.xml new file mode 100644 index 0000000000..f5a47aea3a --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/BaseGridUserDao.xml @@ -0,0 +1,58 @@ + + + + + + + UPDATE base_grid_user + + + + + + when (grid_id = #{item.gridId} AND staff_id = #{item.staffId} ) then #{item.gridName} + + + + + + + + when (grid_id = #{item.gridId} AND staff_id = #{item.staffId} ) then #{item.nickName} + + + + + + + + when (grid_id = #{item.gridId} AND staff_id = #{item.staffId} ) then #{item.delFlag} + + + + + + + + when (grid_id = #{item.gridId} AND staff_id = #{item.staffId} ) then #{item.updatedBy} + + + + + + + + when (grid_id = #{item.gridId} AND staff_id = #{item.staffId} ) then #{item.updatedTime} + + + + + + WHERE + 1=1 + + (grid_id = #{item.gridId} AND staff_id = #{item.staffId} ) + + + + \ 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..ba20d99170 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/ExDeptDao.xml @@ -0,0 +1,95 @@ + + + + + + + + + + + + + + + + + + UPDATE ex_dept + + + + + + when grid_code = #{item.gridCode} then #{item.deptIdQx} + + + + + + + + when grid_code = #{item.gridCode} then #{item.deptNameQx} + + + + + + WHERE + 1=1 + + grid_code = #{item.gridCode} + + + + + INSERT INTO ex_dept + ( + dept_id_qx, + dept_name_qx, + grid_code + ) + VALUES + + ( + #{i.deptIdQx}, + #{i.deptNameQx}, + #{i.gridCode} + ) + + ON DUPLICATE KEY + UPDATE + dept_id_qx = values(dept_id_qx), + dept_name_qx = values(dept_name_qx) + + + + 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/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-customize/oper-customize-client/src/main/java/com/epmet/dto/IcFormDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/IcFormDTO.java new file mode 100644 index 0000000000..ee14093ab1 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/IcFormDTO.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-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/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/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..e5afdeddc2 --- /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..dbb3f60e70 --- /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/FormItem.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FormItem.java new file mode 100644 index 0000000000..7e3abbaa0e --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FormItem.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 FormItem 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/FormItem2.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FormItem2.java new file mode 100644 index 0000000000..99114fe830 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FormItem2.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 FormItem2 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/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 561d4d7ce0..58def540a4 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 @@ -5,14 +5,9 @@ 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.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.CustomerFormQueryDTO; import com.epmet.dto.form.CustomerFunctionListFormDTO; -import com.epmet.dto.result.CheckFloatFootBarResultDTO; -import com.epmet.dto.result.DefaultFunctionListResultDTO; +import com.epmet.dto.result.*; import com.epmet.feign.fallback.OperCustomizeOpenFeignClientFallbackFactory; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.http.MediaType; @@ -20,6 +15,7 @@ import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import java.util.List; +import java.util.Set; /** * 本服务对外开放的API,其他服务通过引用此client调用该服务 @@ -27,6 +23,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 +44,48 @@ 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); } 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..2420adb817 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 @@ -6,13 +6,13 @@ 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.CustomerFormQueryDTO; import com.epmet.dto.form.CustomerFunctionListFormDTO; -import com.epmet.dto.result.CheckFloatFootBarResultDTO; -import com.epmet.dto.result.DefaultFunctionListResultDTO; +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,29 @@ 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); + } } 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..8c506cfe74 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormController.java @@ -0,0 +1,195 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.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.IcFormDTO; +import com.epmet.dto.form.CustomerFormQueryDTO; +import com.epmet.dto.result.*; +import com.epmet.excel.IcFormExcel; +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 javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; +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; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = icFormService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + IcFormDTO data = icFormService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody IcFormDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icFormService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody IcFormDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icFormService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + icFormService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = icFormService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, IcFormExcel.class); + } + + + /** + * 获取居民信息表单 【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 tokenDto + * @param formDto + * @return + * @author wxz + * @date 2021.10.28 15:19:59 + */ + @PostMapping("items") + public Result> listItems(@LoginUser TokenDto tokenDto, @RequestBody CustomerFormQueryDTO formDto) { + ValidatorUtils.validateEntity(formDto, CustomerFormQueryDTO.GetFormInfoGroup.class); + List rst = icFormService.listItems(tokenDto.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..3c6bbf4004 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormItemController.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.IcFormItemDTO; +import com.epmet.excel.IcFormItemExcel; +import com.epmet.service.IcFormItemService; +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("icformitem") +public class IcFormItemController { + + @Autowired + private IcFormItemService icFormItemService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = icFormItemService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + IcFormItemDTO data = icFormItemService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody IcFormItemDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icFormItemService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody IcFormItemDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icFormItemService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + icFormItemService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = icFormItemService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, IcFormItemExcel.class); + } + +} \ No newline at end of file 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..5d70a901d7 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormItemOptionsController.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.IcFormItemOptionsDTO; +import com.epmet.excel.IcFormItemOptionsExcel; +import com.epmet.service.IcFormItemOptionsService; +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("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); + } + +} \ 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/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..6cd4fa7188 --- /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.FormItem; +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(String formId, 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..b07c41ef84 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcFormItemDao.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.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); +} \ 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..3609c41f9e --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcFormItemOptionsDao.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.IcFormItemOptionsEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 表单项的选项 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +@Mapper +public interface IcFormItemOptionsDao 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/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/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..8cded15b44 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,23 @@ public class CustomerFootBarRedis { return null; } + public void deleteIcForm(String formCode,String customerId) { + String key = RedisKeys.getIcFormKey(formCode,customerId); + redisUtils.delete(key); + } + + public void setCustomerFormResultDTO(String formCode,String customerId, CustomerFormResultDTO value){ + String key = RedisKeys.getIcFormKey(formCode,customerId); + Map map = BeanUtil.beanToMap(value, false, true); + redisUtils.hMSet(key, map); + } + + public CustomerFormResultDTO getCustomerFormResultDTO(String formCode,String customerId){ + String key = RedisKeys.getIcFormKey(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/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..0ffe8fa5ea --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcFormItemOptionsService.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.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); +} \ 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..15967aef43 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcFormItemService.java @@ -0,0 +1,118 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.IcFormItemDTO; +import com.epmet.dto.form.CustomerFormQueryDTO; +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.Map; +import java.util.Set; + +/** + * 表单项 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +public interface IcFormItemService 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 IcFormItemDTO + * @author generator + * @date 2021-10-26 + */ + IcFormItemDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-10-26 + */ + void save(IcFormItemDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-10-26 + */ + void update(IcFormItemDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-10-26 + */ + void delete(String[] ids); + + /** + * 获取居民信息的查询条件,组件列表 + * + * @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); +} \ No newline at end of file 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..b1d0dddaf1 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcFormService.java @@ -0,0 +1,119 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.IcFormDTO; +import com.epmet.dto.form.CustomerFormQueryDTO; +import com.epmet.dto.result.CustomerFormResultDTO; +import com.epmet.dto.result.FormItem; +import com.epmet.entity.IcFormEntity; + +import java.util.List; +import java.util.Map; + +/** + * 配置表单 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +public interface IcFormService 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 IcFormDTO + * @author generator + * @date 2021-10-26 + */ + IcFormDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-10-26 + */ + void save(IcFormDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-10-26 + */ + void update(IcFormDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-10-26 + */ + void delete(String[] ids); + + /** + * 获取居民信息表单 + * + * @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); +} \ 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/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..c7ed24cd3d --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormItemOptionsServiceImpl.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.IcFormItemOptionsDao; +import com.epmet.dto.IcFormItemOptionsDTO; +import com.epmet.entity.IcFormItemOptionsEntity; +import com.epmet.service.IcFormItemOptionsService; +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 IcFormItemOptionsServiceImpl extends BaseServiceImpl implements IcFormItemOptionsService { + + + @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)); + } + +} \ 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..c79d2e8fa0 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormItemServiceImpl.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.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.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 { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcFormItemDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcFormItemDTO.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 IcFormItemDTO get(String id) { + IcFormItemEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcFormItemDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcFormItemDTO dto) { + IcFormItemEntity entity = ConvertUtils.sourceToTarget(dto, IcFormItemEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcFormItemDTO dto) { + IcFormItemEntity entity = ConvertUtils.sourceToTarget(dto, IcFormItemEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * 获取居民信息的查询条件,组件列表 + * + * @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 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); + } + +} \ No newline at end of file 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..23088c3024 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormServiceImpl.java @@ -0,0 +1,149 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.IcFormDao; +import com.epmet.dto.IcFormDTO; +import com.epmet.dto.form.CustomerFormQueryDTO; +import com.epmet.dto.result.CustomerFormResultDTO; +import com.epmet.dto.result.FormGroupDTO; +import com.epmet.dto.result.FormItem; +import com.epmet.entity.IcFormEntity; +import com.epmet.redis.CustomerFootBarRedis; +import com.epmet.service.IcFormService; +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-26 + */ +@Service +public class IcFormServiceImpl extends BaseServiceImpl implements IcFormService { + @Autowired + private CustomerFootBarRedis customerFootBarRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcFormDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcFormDTO.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 IcFormDTO get(String id) { + IcFormEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcFormDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcFormDTO dto) { + IcFormEntity entity = ConvertUtils.sourceToTarget(dto, IcFormEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcFormDTO dto) { + IcFormEntity entity = ConvertUtils.sourceToTarget(dto, IcFormEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * 获取居民信息表单 + * + * @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()); + 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); + return resultDTO; + } + + @Override + public List listItems(String customerId, String formCode) { + 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 formItems = baseDao.listItems(formResultDto.getFormId()); + formItems.forEach(i -> { + i.setOptions(baseDao.selectListOption(i.getItemId())); + }); + + return formItems; + } +} 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/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..44d23cda3f --- /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..e8e67a4ba3 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormItemDao.xml @@ -0,0 +1,144 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file 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..910d1f833f --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormItemOptionsDao.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/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-server/src/main/java/com/epmet/mq/GroupAchievementCustomListener.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/mq/GroupAchievementCustomListener.java index 33c0ff7c63..6644a29dc3 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/mq/GroupAchievementCustomListener.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/mq/GroupAchievementCustomListener.java @@ -1,9 +1,13 @@ package com.epmet.mq; import com.alibaba.fastjson.JSON; +import com.epmet.commons.rocketmq.constants.MQUserPropertys; import com.epmet.commons.rocketmq.messages.GroupAchievementMQMsg; 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.modules.group.service.StatsAchievementService; import lombok.extern.slf4j.Slf4j; @@ -31,8 +35,15 @@ public class GroupAchievementCustomListener implements MessageListenerConcurren 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); + } + 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-user/epmet-user-client/src/main/java/com/epmet/dto/FinancialSituationDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/FinancialSituationDTO.java new file mode 100644 index 0000000000..4a1607748d --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/FinancialSituationDTO.java @@ -0,0 +1,31 @@ +package com.epmet.dto; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/11/3 10:24 上午 + * @DESC + */ +@Data +public class FinancialSituationDTO implements Serializable { + + private static final long serialVersionUID = -3984106138099267996L; + + /** + * 月收入 + */ + private String monthlyIncome; + + /** + * 退休金额 + */ + private String retirementAmount; + + public FinancialSituationDTO() { + this.monthlyIncome = ""; + this.retirementAmount = ""; + } +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcEnsureHouseDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcEnsureHouseDTO.java new file mode 100644 index 0000000000..0868f00f51 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcEnsureHouseDTO.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-26 + */ +@Data +public class IcEnsureHouseDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户Id customer.id + */ + private String customerId; + + /** + * 主表Id + */ + private String icResiUser; + + /** + * 住房性质【字典表】 + */ + private String zfxz; + + /** + * 保障类型 + */ + private String bzlx; + + /** + * 发证日期 + */ + private Date fzrq; + + /** + * 补贴编号 + */ + private String btbh; + + /** + * 补贴金额 + */ + private String btje; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 预留字段1 + */ + private String field1; + + /** + * 预留字段2 + */ + private String field2; + + /** + * 预留字段3 + */ + private String field3; + + /** + * 预留字段4 + */ + private String field4; + + /** + * 预留字段5 + */ + private String field5; + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcOldPeopleDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcOldPeopleDTO.java new file mode 100644 index 0000000000..789e5ff1da --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcOldPeopleDTO.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-10-26 + */ +@Data +public class IcOldPeopleDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户Id customer.id + */ + private String customerId; + + /** + * 主表Id + */ + private String icResiUser; + + /** + * 高龄补助 + */ + private String glbz; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 预留字段1 + */ + private String field1; + + /** + * 预留字段2 + */ + private String field2; + + /** + * 预留字段3 + */ + private String field3; + + /** + * 预留字段4 + */ + private String field4; + + /** + * 预留字段5 + */ + private String field5; + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcPartyMemberDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcPartyMemberDTO.java new file mode 100644 index 0000000000..7dd3198144 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcPartyMemberDTO.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-10-26 + */ +@Data +public class IcPartyMemberDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户Id customer.id + */ + private String customerId; + + /** + * 主表Id + */ + private String icResiUser; + + /** + * 入党时间 + */ + private Date rdsj; + + /** + * 转正时间 + */ + private Date zzsj; + + /** + * 所属支部 + */ + private String sszb; + + /** + * 是否流动党员 + */ + private String isLd; + + /** + * 流动党员活动证号 + */ + private String ldzh; + + /** + * 职务 + */ + private String partyZw; + + /** + * 是否退休 + */ + private String isTx; + + /** + * 是否党员中心户 + */ + private String isDyzxh; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 预留字段1 + */ + private String field1; + + /** + * 预留字段2 + */ + private String field2; + + /** + * 预留字段3 + */ + private String field3; + + /** + * 预留字段4 + */ + private String field4; + + /** + * 预留字段5 + */ + private String field5; + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcResiDemandDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcResiDemandDTO.java new file mode 100644 index 0000000000..a04efa1096 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcResiDemandDTO.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-10-26 + */ +@Data +public class IcResiDemandDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户Id customer.id + */ + private String customerId; + + /** + * 需求code【对应ic_resi_demand_dict】 + */ + private String categoryCode; + + /** + * 描述 + */ + private String remakes; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 预留字段1 + */ + private String field1; + + /** + * 预留字段2 + */ + private String field2; + + /** + * 预留字段3 + */ + private String field3; + + /** + * 预留字段4 + */ + private String field4; + + /** + * 预留字段5 + */ + private String field5; + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcResiDemandDictDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcResiDemandDictDTO.java new file mode 100644 index 0000000000..ccdb6f5752 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcResiDemandDictDTO.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.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 居民需求字典表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-27 + */ +@Data +public class IcResiDemandDictDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户Id customer.id + */ + private String customerId; + + /** + * 父级 + */ + private String parentCode; + + /** + * 字典值 + */ + private String categoryCode; + + /** + * 字典描述 + */ + private String categoryName; + + /** + * 级别 + */ + private String level; + + /** + * 备注 + */ + private String remark; + + /** + * 排序 + */ + 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-user/epmet-user-client/src/main/java/com/epmet/dto/IcResiUserDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcResiUserDTO.java new file mode 100644 index 0000000000..12990d491f --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcResiUserDTO.java @@ -0,0 +1,531 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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 IcResiUserDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户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 Date dbsj; + + /** + * 所患慢性病 + */ + private String shmxb; + + /** + * 患慢性病时间 + */ + private Date mxbsj; + + /** + * 是否参保 + */ + private String isCb; + + /** + * 自付金额 + */ + private String zfje; + + /** + * 救助金额 + */ + private String jzje; + + /** + * 救助时间[yyyy-MM-dd] + */ + private Date jzsj; + + /** + * 享受救助明细序号 + */ + private String jzmxxh; + + /** + * 健康信息备注 + */ + private String healthRemakes; + + /** + * 工作单位 + */ + private String gzdw; + + /** + * 职业 + */ + private String zy; + + /** + * 离退休时间 + */ + private Date ltxsj; + + /** + * 工作信息备注 + */ + private String workRemake; + + /** + * 退休金额 + */ + private String txje; + + /** + * 月收入 + */ + private String ysr; + + /** + * 是否经济低保 + */ + private String isJjdb; + + /** + * 籍贯 + */ + 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; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 预留字段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; + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcSpecialDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcSpecialDTO.java new file mode 100644 index 0000000000..bc9458b2d0 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcSpecialDTO.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-10-26 + */ +@Data +public class IcSpecialDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户Id customer.id + */ + private String customerId; + + /** + * 主表Id + */ + private String icResiUser; + + /** + * 人群类别【字典表】 + */ + private String specialRqlb; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 预留字段1 + */ + private String field1; + + /** + * 预留字段2 + */ + private String field2; + + /** + * 预留字段3 + */ + private String field3; + + /** + * 预留字段4 + */ + private String field4; + + /** + * 预留字段5 + */ + private String field5; + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcUnemployedDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcUnemployedDTO.java new file mode 100644 index 0000000000..930d40c706 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcUnemployedDTO.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.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 IcUnemployedDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户Id customer.id + */ + private String customerId; + + /** + * 主表Id + */ + private String icResiUser; + + /** + * 原工作单位 + */ + private String ygzdw; + + /** + * 失业人员类别【字典表】 + */ + private String syrylb; + + /** + * 失业时间 + */ + private Date sysj; + + /** + * 失业证号 + */ + private String syzh; + + /** + * 再就业优惠证号 + */ + private String zjyyhzh; + + /** + * 技术特长 + */ + private String jstc; + + /** + * 失业原因【字典表】 + */ + private String syyy; + + /** + * 是否就业困难对象 + */ + private String isJykndx; + + /** + * 劳动能力就业愿望 + */ + private String jyyw; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 预留字段1 + */ + private String field1; + + /** + * 预留字段2 + */ + private String field2; + + /** + * 预留字段3 + */ + private String field3; + + /** + * 预留字段4 + */ + private String field4; + + /** + * 预留字段5 + */ + private String field5; + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcUnitedFrontDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcUnitedFrontDTO.java new file mode 100644 index 0000000000..c6be71bc6c --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcUnitedFrontDTO.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-10-26 + */ +@Data +public class IcUnitedFrontDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户Id customer.id + */ + private String customerId; + + /** + * 主表Id + */ + private String icResiUser; + + /** + * 职务职业 + */ + private String zwzy; + + /** + * 探亲情况 + */ + private String tqqk; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 预留字段1 + */ + private String field1; + + /** + * 预留字段2 + */ + private String field2; + + /** + * 预留字段3 + */ + private String field3; + + /** + * 预留字段4 + */ + private String field4; + + /** + * 预留字段5 + */ + private String field5; + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcVeteransDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcVeteransDTO.java new file mode 100644 index 0000000000..9a0c6399aa --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcVeteransDTO.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-10-26 + */ +@Data +public class IcVeteransDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户Id customer.id + */ + private String customerId; + + /** + * 主表Id + */ + private String icResiUser; + + /** + * 入伍时间 + */ + private Date rwsj; + + /** + * 退伍时间 + */ + private Date twsj; + + /** + * 服役单位 + */ + private String fydw; + + /** + * 接收单位 + */ + private String jsdw; + + /** + * 待安置补助金 + */ + private String dazbzj; + + /** + * 培训状况 + */ + private String pxzk; + + /** + * 参战时间【年月日区间值yyyy-MM-dd~yyyy-MM-dd】 + */ + private Date czsj; + + /** + * 现就业情况 + */ + private String xjyqk; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 预留字段1 + */ + private String field1; + + /** + * 预留字段2 + */ + private String field2; + + /** + * 预留字段3 + */ + private String field3; + + /** + * 预留字段4 + */ + private String field4; + + /** + * 预留字段5 + */ + private String field5; + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcVolunteerDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcVolunteerDTO.java new file mode 100644 index 0000000000..4a49527d42 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcVolunteerDTO.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-10-26 + */ +@Data +public class IcVolunteerDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户Id customer.id + */ + private String customerId; + + /** + * 主表Id + */ + private String icResiUser; + + /** + * 类别【字典表】 + */ + private String volunteerCategory; + + /** + * 备注 + */ + private String volunteerRemark; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 预留字段1 + */ + private String field1; + + /** + * 预留字段2 + */ + private String field2; + + /** + * 预留字段3 + */ + private String field3; + + /** + * 预留字段4 + */ + private String field4; + + /** + * 预留字段5 + */ + private String field5; + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DelIcResiUserFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DelIcResiUserFormDTO.java new file mode 100644 index 0000000000..3b6ff7d195 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DelIcResiUserFormDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 删除居民 + * @Author yinzuomei + * @Date 2021/11/2 9:45 上午 + */ +@Data +public class DelIcResiUserFormDTO implements Serializable { + private static final long serialVersionUID = 2455694966457219261L; + + public interface IdGroup { + } + + @NotBlank(message = "icResiUserId不能为空", groups = IdGroup.class) + private String icResiUserId; + @NotBlank(message = "token获取的customerId不能为空", groups = IdGroup.class) + private String customerId; + private String formCode="resi_base_info"; +} + diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DynamicQueryFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DynamicQueryFormDTO.java new file mode 100644 index 0000000000..42e163838b --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DynamicQueryFormDTO.java @@ -0,0 +1,22 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * @Description test + * @Author yinzuomei + * @Date 2021/11/2 10:38 上午 + */ +@Data +public class DynamicQueryFormDTO implements Serializable { + private String customerId; + private String formCode="resi_base_info"; + @NotBlank(message = "resultTableName不能为空") + private String resultTableName; + private List conditions; +} + diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiDetailFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiDetailFormDTO.java new file mode 100644 index 0000000000..72518091bd --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiDetailFormDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 查看详情,回显表单 + * @Author yinzuomei + * @Date 2021/10/27 10:22 下午 + */ +@Data +public class IcResiDetailFormDTO implements Serializable { + public interface AddUserInternalGroup { + } + @NotBlank(message = "icResiUserId不能为空",groups = AddUserInternalGroup.class) + private String icResiUserId; + + @NotBlank(message = "formCode不能为空", groups = AddUserInternalGroup.class) + private String formCode; + + @NotBlank(message = "customerId不能为空", groups = AddUserInternalGroup.class) + private String customerId; +} + diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiUserEditFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiUserEditFormDTO.java new file mode 100644 index 0000000000..dad16bda6b --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiUserEditFormDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 党建互联平台--保存/修改居民信息 + * @Author sun + */ +@Data +public class IcResiUserEditFormDTO implements Serializable { + private static final long serialVersionUID = 9156247659994638103L; + + /** + * 字段对应表名 + */ + private String tableName; + /** + * 字段key值 + */ + private String columnName; + /** + * 字段值 + */ + private String columnValue; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiUserFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiUserFormDTO.java new file mode 100644 index 0000000000..b510b12c2a --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiUserFormDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.LinkedHashMap; +import java.util.List; + +/** + * @Description 党建互联平台--保存/修改居民信息 + * @Author sun + */ +@Data +public class IcResiUserFormDTO implements Serializable { + private static final long serialVersionUID = 9156247659994638103L; + + /** + * 字段对应表名 + */ + private String tableName; + /** + * 表对应的字段及值 + */ + private List> list; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiUserPageFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiUserPageFormDTO.java new file mode 100644 index 0000000000..44eb3bf105 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiUserPageFormDTO.java @@ -0,0 +1,38 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.List; + +/** + * @Description 居民信息,分页查询入参 + * @Author yinzuomei + * @Date 2021/10/27 2:06 下午 + */ +@Data +public class IcResiUserPageFormDTO implements Serializable { + public interface AddUserInternalGroup { + } + + @NotNull(message = "pageNo不能为空", groups = AddUserInternalGroup.class) + private Integer pageNo; + + @NotNull(message = "pageSize不能为空", groups = AddUserInternalGroup.class) + private Integer pageSize; + + @NotBlank(message = "formCode不能为空", groups = AddUserInternalGroup.class) + private String formCode; + + @NotBlank(message = "customerId不能为空", groups = AddUserInternalGroup.class) + private String customerId; + + /** + * 表对应的字段及值 + */ + private List conditions; + private Boolean pageFlag; +} + diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ListForExportFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ListForExportFormDTO.java new file mode 100644 index 0000000000..fb95fc9dd1 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ListForExportFormDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * @Description 不分页,导出查询 + * @Author yinzuomei + * @Date 2021/11/1 3:33 下午 + */ +@Data +public class ListForExportFormDTO implements Serializable { + @NotBlank(message = "formCode不能为空", groups = IcResiUserPageFormDTO.AddUserInternalGroup.class) + private String formCode; + + @NotBlank(message = "customerId不能为空", groups = IcResiUserPageFormDTO.AddUserInternalGroup.class) + private String customerId; + /** + * 表对应的字段及值 + */ + private List conditions; +} + diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PersonDataFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PersonDataFormDTO.java new file mode 100644 index 0000000000..52d96870a2 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PersonDataFormDTO.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 5:16 下午 + * @DESC + */ +@Data +public class PersonDataFormDTO implements Serializable { + + private static final long serialVersionUID = 3238490888792654922L; + + public interface PersonDataForm{} + + @NotBlank(message = "userId不能为空",groups = PersonDataForm.class) + private String userId; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ResiUserQueryValueDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ResiUserQueryValueDTO.java new file mode 100644 index 0000000000..cc654145c8 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ResiUserQueryValueDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description TODO + * @Author yinzuomei + * @Date 2021/10/27 6:02 下午 + */ +@Data +public class ResiUserQueryValueDTO implements Serializable { + private String queryType; + private List columnValue; + private String columnName; + private String tableName; +} + diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/SearchByNameFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/SearchByNameFormDTO.java new file mode 100644 index 0000000000..8f4abca17f --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/SearchByNameFormDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/11/3 1:34 下午 + * @DESC + */ +@Data +public class SearchByNameFormDTO implements Serializable { + + private static final long serialVersionUID = -5017695783909884799L; + + public interface SearchByNameForm{} + + @NotBlank(message = "name不能为空",groups = SearchByNameForm.class) + private String name; + + @NotNull(message = "pageSize不能为空",groups = SearchByNameForm.class) + private Integer pageSize; + + @NotNull(message = "pageNo不能为空",groups = SearchByNameForm.class) + private Integer pageNo; + +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StaffBasicInfoByMobileFromDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StaffBasicInfoByMobileFromDTO.java new file mode 100644 index 0000000000..116310f61b --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StaffBasicInfoByMobileFromDTO.java @@ -0,0 +1,23 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description + * @author wxz + * @date 2021.10.25 14:00:11 +*/ +@Data +public class StaffBasicInfoByMobileFromDTO implements Serializable { + private static final long serialVersionUID = 1L; + + @NotBlank(message = "缺少手机号码信息") + private String mobile; + + @NotBlank(message = "缺少密码") + private String password; + +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/HomeUserResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/HomeUserResultDTO.java new file mode 100644 index 0000000000..7eefb194b4 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/HomeUserResultDTO.java @@ -0,0 +1,17 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2021/11/1 10:47 + */ +@Data +public class HomeUserResultDTO implements Serializable { + private static final long serialVersionUID = -8441112171986914418L; + private String userId; + private String name; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcResiUserPageResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcResiUserPageResultDTO.java new file mode 100644 index 0000000000..0c5f5ab0bf --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcResiUserPageResultDTO.java @@ -0,0 +1,173 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description TODO + * @Author yinzuomei + * @Date 2021/11/1 10:34 上午 + */ +@Data +public class IcResiUserPageResultDTO implements Serializable { + private static final long serialVersionUID = 5621052927788129250L; + private String icResiUserId; + private String gridId; + private String gridName; + /** + * 所属小区ID + */ + private String villageId; + private String vallageName; + + + /** + * 所属楼宇Id + */ + private String buildId; + private String buildName; + + /** + * 单元id + */ + private String unitId; + private String unitName; + + /** + * 所属家庭Id + */ + private String homeId; + private String homeName; + + /** + * 姓名 + */ + private String name; + + /** + * 手机号 + */ + private String mobile; + + /** + * 性别 + */ + private String gender; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 出生日期 + */ + private String birthday; + + /** + * 备注 + */ + private String remarks; + + /** + * 是否党员 + */ + private Boolean isParty; + + /** + * 是否低保户 + */ + private Boolean isDbh; + + /** + * 是否保障房 + */ + private Boolean isEnsureHouse; + + /** + * 是否失业 + */ + private Boolean isUnemployed; + + /** + * 是否育龄妇女 + */ + private Boolean isYlfn; + + /** + * 是否退役军人 + */ + private Boolean isVeterans; + + /** + * 是否统战人员 + */ + private Boolean isUnitedFront; + + /** + * 是否信访人员 + */ + private Boolean isXfry; + + /** + * 是否志愿者 + */ + private Boolean isVolunteer; + + /** + * 是否老年人 + */ + private Boolean isOldPeople; + + /** + * 是否空巢 + */ + private Boolean isKc; + + /** + * 是否失独 + */ + private Boolean isSd; + + /** + * 是否失能 + */ + private Boolean isSn; + + /** + * 是否失智 + */ + private Boolean isSz; + + /** + * 是否残疾 + */ + private Boolean isCj; + + /** + * 是否大病 + */ + private Boolean isDb; + + /** + * 是否慢病 + */ + private Boolean isMb; + + /** + * 是否特殊人群 + */ + private Boolean isSpecial; + + + // 以下属性都需要单独处理,不是直接取数据库的字段 + private String demandCategoryIds; + + private String demandName; + + /** + * 房屋类型,1楼房,2平房,3别墅 + */ + private String houseType;} + diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PersonDataResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PersonDataResultDTO.java new file mode 100644 index 0000000000..22a6fc3c41 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PersonDataResultDTO.java @@ -0,0 +1,72 @@ +package com.epmet.dto.result; + +import com.epmet.dto.FinancialSituationDTO; +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** + * @Author zxc + * @DateTime 2021/11/2 5:34 下午 + * @DESC + */ +@Data +public class PersonDataResultDTO implements Serializable { + + private static final long serialVersionUID = 5210308218052783909L; + + /** + * 工作单位 + */ + private String workUnit; + + /** + * 人员类别 + */ + private String personCategory; + + /** + * 网格名 + */ + private String gridName; + + /** + * 姓名 + */ + private String name; + + /** + * 经济状况:包括 月收入:monthlyIncome 和 退休金额:retirementAmount + */ + private FinancialSituationDTO financialSituation; + + /** + * 房屋信息 + */ + private List houseInfo; + + /** + * 志愿者类别 + */ + private String volunteerCategory; + + public PersonDataResultDTO() { + this.workUnit = ""; + this.personCategory = ""; + this.gridName = ""; + this.name = ""; + this.financialSituation = new FinancialSituationDTO(); + this.houseInfo = new ArrayList<>(); + this.volunteerCategory = ""; + } + + /** + * 身份证 + */ + @JsonIgnore + private String idCard; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/SearchByNameResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/SearchByNameResultDTO.java new file mode 100644 index 0000000000..0451dafaf0 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/SearchByNameResultDTO.java @@ -0,0 +1,66 @@ +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/11/3 1:36 下午 + * @DESC + */ +@Data +public class SearchByNameResultDTO implements Serializable { + + private static final long serialVersionUID = 8783929181468322960L; + + /** + * 排序 + */ + private Integer sort; + + /** + * 姓名 + */ + private String name; + + /** + * 网格名 + */ + private String gridName; + + @JsonIgnore + private String gridId; + + /** + * 小区名 + */ + private String neighborHoodName; + + @JsonIgnore + private String neighborHoodId; + + /** + * 楼号 + */ + private String buildNum; + + @JsonIgnore + private String buildId; + + /** + * 用户ID + */ + private String userId; + + public SearchByNameResultDTO() { + this.sort = NumConstant.ZERO; + this.name = ""; + this.gridName = ""; + this.neighborHoodName = ""; + this.buildNum = ""; + this.userId = ""; + } +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffBasicInfoResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffBasicInfoResultDTO.java index 7de2636450..c861899ccb 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffBasicInfoResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffBasicInfoResultDTO.java @@ -67,4 +67,14 @@ public class StaffBasicInfoResultDTO implements Serializable { */ private List roleList; + /** + * 当前工作人员所属组织的agencyId + */ + private String agencyId; + + /** + * 当前工作人员所属组织的agencyName + */ + private String agencyName; + } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java index f6c5c8fe98..8a597860ae 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java @@ -2,6 +2,7 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.dto.result.OptionResultDTO; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.*; @@ -646,4 +647,7 @@ public interface EpmetUserOpenFeignClient { */ @GetMapping(value = "/epmetuser/user/queryUserClient/{userId}") Result queryUserClient(@PathVariable("userId") String userId); + + @PostMapping("/epmetuser/icresidemanddict/demandoption/demandoption") + Result> getDemandOptions(); } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java index 5e97f27668..a5d111a991 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java @@ -1,6 +1,7 @@ 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.security.dto.TokenDto; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; @@ -463,4 +464,9 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien public Result queryUserClient(String userId) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "queryUserClient", userId); } + + @Override + public Result> getDemandOptions() { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getDemandOptions", null); + } } diff --git a/epmet-user/epmet-user-server/pom.xml b/epmet-user/epmet-user-server/pom.xml index 79c3f816af..1b0eafe16d 100644 --- a/epmet-user/epmet-user-server/pom.xml +++ b/epmet-user/epmet-user-server/pom.xml @@ -13,6 +13,30 @@ jar + + com.epmet + epmet-admin-client + 2.0.0 + + + com.alibaba + easyexcel + 2.2.10 + + + poi + org.apache.poi + + + poi-ooxml + org.apache.poi + + + poi-ooxml-schemas + org.apache.poi + + + com.epmet epmet-user-client @@ -118,6 +142,12 @@ epmet-commons-rocketmq 2.0.0 + + com.epmet + oper-customize-client + 2.0.0 + compile + @@ -134,6 +164,16 @@ true + + org.apache.maven.plugins + maven-resources-plugin + + + xls + xlsx + + + ${project.basedir}/src/main/java diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/UserConstant.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/UserConstant.java index 1e91d3cb14..87278ba55f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/UserConstant.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/UserConstant.java @@ -97,4 +97,13 @@ public interface UserConstant { * 先生/女士 */ String MAN_WOMAN = "先生/女士"; + + String GRID_ID="GRID_ID"; + String GENDER="GENDER"; + String HOUSE_TYPE_KEY="HOUSE_TYPE"; + String HOME_ID = "HOME_ID"; + /** + * 居民信息 子表中的主表id + */ + String IC_RESI_USER = "IC_RESI_USER"; } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java index f467d60712..7aae42adea 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java @@ -396,7 +396,7 @@ public class CustomerStaffController { **/ @PostMapping(value = "staffbasicinfo") public Result staffBasicInfo(@LoginUser TokenDto tokenDTO){ - return customerStaffService.selectStaffBasicInfo(tokenDTO.getUserId()); + return customerStaffService.selectStaffBasicInfo(tokenDTO.getUserId(),tokenDTO.getCustomerId()); } /** diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiDemandDictController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiDemandDictController.java new file mode 100644 index 0000000000..c83b41aa4f --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiDemandDictController.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.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.IcResiDemandDictDTO; +import com.epmet.service.IcResiDemandDictService; +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-27 + */ +@RestController +@RequestMapping("icresidemanddict") +public class IcResiDemandDictController { + + @Autowired + private IcResiDemandDictService icResiDemandDictService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = icResiDemandDictService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + IcResiDemandDictDTO data = icResiDemandDictService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody IcResiDemandDictDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icResiDemandDictService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody IcResiDemandDictDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icResiDemandDictService.update(dto); + 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())); + } + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java new file mode 100644 index 0000000000..8310f0aa25 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java @@ -0,0 +1,465 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.ExcelExportUtil; +import cn.afterturn.easypoi.excel.entity.ExportParams; +import cn.afterturn.easypoi.excel.entity.TemplateExportParams; +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.annotation.LoginUser; +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.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.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.IcResiUserDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.result.*; +import com.epmet.excel.IcResiUserExcel; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.feign.OperCustomizeOpenFeignClient; +import com.epmet.service.IcResiUserService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.apache.poi.ss.usermodel.Workbook; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; +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.FileOutputStream; +import java.io.IOException; +import java.net.URLEncoder; +import java.util.*; +import java.util.concurrent.atomic.AtomicInteger; + + +/** + * 用户基础信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +@Slf4j +@RestController +@RequestMapping("icresiuser") +public class IcResiUserController { + private static final String BASE_TABLE_NAME = "ic_resi_user"; + + @Autowired + private OperCustomizeOpenFeignClient operCustomizeOpenFeignClient; + @Autowired + private IcResiUserService icResiUserService; + @Autowired + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = icResiUserService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + IcResiUserDTO data = icResiUserService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody IcResiUserDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icResiUserService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody IcResiUserDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icResiUserService.update(dto); + return new Result(); + } + + @PostMapping("delete") + public Result delete(@LoginUser TokenDto tokenDto,@RequestBody DelIcResiUserFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + ValidatorUtils.validateEntity(formDTO,DelIcResiUserFormDTO.IdGroup.class); + icResiUserService.delete(formDTO); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = icResiUserService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, IcResiUserExcel.class); + } + + /** + * @Author sun + * @Description 党建互联平台--保存居民信息 + **/ + @PostMapping("add") + public Result add(@LoginUser TokenDto tokenDto, @RequestBody List formDTO) { + icResiUserService.add(tokenDto, formDTO); + return new Result(); + } + + /** + * @Author sun + * @Description 党建互联平台--修改居民信息 + **/ + @PostMapping("edit") + public Result edit(@LoginUser TokenDto tokenDto, @RequestBody List formDTO) { + icResiUserService.edit(tokenDto, formDTO); + return new Result(); + } + + @GetMapping("download/template") + 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())){ + // header = new ExcelExportEntity(item.getChildGroup().getLabel(),item.getChildGroup().getTableName()); + //header.setNeedMerge(true); + 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); + } + + }); + //header.setList(secondHeaderList); + //otherSheetHeaderList.add(header); + } + } + }); + 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, FormItem 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); + } + + /** + * @Description 根据房间号查人 + * @Param formDTO + * @Return {@link Result>} + * @Author zhaoqifeng + * @Date 2021/11/1 11:04 + */ + @PostMapping("getpeoplebyroom") + public Result> getPeopleByRoom(@RequestBody IcResiUserDTO formDTO) { + return new Result>().ok(icResiUserService.getPeopleByRoom(formDTO.getHomeId())); + } + + @PostMapping("listresi") + public Result>> queryListResi1(@LoginUser TokenDto tokenDto, @RequestBody IcResiUserPageFormDTO pageFormDTO){ + //pageFormDTO.setCustomerId("45687aa479955f9d06204d415238f7cc"); + pageFormDTO.setCustomerId(tokenDto.getCustomerId()); + ValidatorUtils.validateEntity(pageFormDTO,IcResiUserPageFormDTO.AddUserInternalGroup.class); + return new Result>>().ok(icResiUserService.pageResiMap(pageFormDTO)); + } + /** + * 编辑页面,显示居民信息详情 + * + * @param pageFormDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @date 2021/10/28 10:29 上午 + */ + @PostMapping("detail") + public Result queryIcResiDetail(@LoginUser TokenDto tokenDto,@RequestBody IcResiDetailFormDTO pageFormDTO){ + //pageFormDTO.setCustomerId("45687aa479955f9d06204d415238f7cc"); + pageFormDTO.setCustomerId(tokenDto.getCustomerId()); + ValidatorUtils.validateEntity(pageFormDTO,IcResiDetailFormDTO.AddUserInternalGroup.class); + return new Result().ok(icResiUserService.queryIcResiDetail(pageFormDTO)); + } + + @RequestMapping(value = "/exportExcel") + public void exportExcel(/*@LoginUser TokenDto tokenDto,*/ @RequestBody IcResiUserPageFormDTO pageFormDTO, HttpServletResponse response) throws IOException { + + pageFormDTO.setCustomerId("45687aa479955f9d06204d415238f7cc"); + pageFormDTO.setPageFlag(false); + CustomerFormResultDTO resiFormItems = getResiFormItems(pageFormDTO.getCustomerId()); + + Map itemMap = new HashMap<>(); + for (FormItem formItem : resiFormItems.getItemList()) { + if (StringUtils.isNotBlank(formItem.getColumnName())){ + continue; + } + if (formItem.getItemType().equals("checkbox") || formItem.getItemType().equals("select")){ + itemMap.put(formItem.getColumnName().concat(formItem.getColumnNum() == 0 ? "" : formItem.getColumnNum().toString()), formItem); + } + if (formItem.getChildGroup() != null) { + for (FormItem2 item2 : formItem.getChildGroup().getItemList()) { + if (StringUtils.isNotBlank(item2.getColumnName())){ + continue; + } + if (item2.getItemType().equals("checkbox") || item2.getItemType().equals("select")){ + itemMap.put(item2.getColumnName().concat(item2.getColumnNum() == 0 ? "" : item2.getColumnNum().toString()), ConvertUtils.sourceToTarget(item2,FormItem.class)); + } + } + + } + } + for (FormGroupDTO groupItem : resiFormItems.getGroupList()) { + if (groupItem.getItemList() != null) { + for (FormItem2 item : groupItem.getItemList()) { + if (StringUtils.isNotBlank(item.getColumnName())){ + continue; + } + if (item.getItemType().equals("checkbox") || item.getItemType().equals("select")){ + itemMap.put(item.getColumnName().concat(item.getColumnNum() == 0 ? "" : item.getColumnNum().toString()), ConvertUtils.sourceToTarget(item, FormItem.class)); + } + } + } + } + System.out.println("checkbox:"+JSON.toJSONString(itemMap)); + Map> resiMainList = icResiUserService.getDataForExport(itemMap,pageFormDTO.getCustomerId(), pageFormDTO.getFormCode(), BASE_TABLE_NAME, pageFormDTO.getConditions()); + //resiMainList = (List>)JSON.parse("[{\"IS_BDHJ\":\"1\",\"IS_SPECIAL\":\"1\",\"IS_XFRY\":\"0\",\"REMARKS\":\"beizhu\",\"IS_PARTY\":\"1\",\"icResiUserId\":\"yzmtest2\",\"HOME_ID\":\"中海国际社区一里城1号楼1单元101\",\"HOUSE_TYPE\":\"平房\",\"UNIT_NAME\":\"1单元\",\"GRID_ID\":\"市北区-市北区第三网格3\",\"IS_DB\":\"0\",\"GENDER\":\"男\",\"BIRTHDAY\":\"2021-10-04\",\"IS_VETERANS\":\"0\",\"IS_MB\":\"0\",\"IS_UNEMPLOYED\":\"0\",\"DEMAND_NAME\":null,\"IS_KC\":\"0\",\"IS_ENSURE_HOUSE\":\"0\",\"IS_SD\":\"0\",\"NAME\":\"尹作梅\",\"RDSJ\":null,\"IS_VOLUNTEER\":\"1\",\"GRID_ID_VALUE\":\"e74829ffc43d5470eba6b5e060c11e63\",\"IS_SZ\":\"0\",\"IS_CJ\":\"0\",\"HOME_ID_VALUE\":\"200\",\"DEMAND_CATEGORY_IDS\":null,\"VILLAGE_NAME\":\"中海国际社区一里城\",\"IS_DBH\":\"0\",\"IS_SN\":\"0\",\"BUILD_NAME\":\"1号楼\",\"IS_YLFN\":\"0\",\"IS_UNITED_FRONT\":\"0\",\"ID_CARD\":\"371325199310260529\",\"MOBILE\":\"15764229697\",\"IS_OLD_PEOPLE\":\"0\",\"DOOR_NAME\":\"101\"},{\"IS_SPECIAL\":\"1\",\"IS_XFRY\":\"0\",\"REMARKS\":\"beizhu\",\"IS_PARTY\":\"1\",\"icResiUserId\":\"yzmtest\",\"HOME_ID\":\"中海国际社区一里城1号楼1单元101\",\"HOUSE_TYPE\":\"平房\",\"UNIT_NAME\":\"1单元\",\"GRID_ID\":\"市北区-市北区第三网格3\",\"IS_DB\":\"0\",\"GENDER\":\"男\",\"BIRTHDAY\":\"2021-10-04\",\"IS_VETERANS\":\"0\",\"IS_MB\":\"0\",\"IS_UNEMPLOYED\":\"0\",\"DEMAND_NAME\":\"心理咨询\",\"IS_KC\":\"0\",\"IS_ENSURE_HOUSE\":\"0\",\"IS_SD\":\"0\",\"NAME\":\"尹作梅\",\"RDSJ\":\"2021-10-28 00:00:00\",\"IS_VOLUNTEER\":\"1\",\"GRID_ID_VALUE\":\"e74829ffc43d5470eba6b5e060c11e63\",\"IS_SZ\":\"0\",\"IS_CJ\":\"0\",\"HOME_ID_VALUE\":\"200\",\"DEMAND_CATEGORY_IDS\":\"10180002\",\"VILLAGE_NAME\":\"中海国际社区一里城\",\"IS_DBH\":\"0\",\"IS_SN\":\"0\",\"BUILD_NAME\":\"1号楼\",\"IS_YLFN\":\"0\",\"IS_UNITED_FRONT\":\"0\",\"ID_CARD\":\"371325199310260529\",\"MOBILE\":\"15764229697\",\"IS_OLD_PEOPLE\":\"0\",\"DOOR_NAME\":\"101\"}]"); + log.info("resiMainList:{}", JSON.toJSONString(resiMainList)); + String templatePath = "excel/ic_resi_info_cid.xls"; + TemplateExportParams params = new TemplateExportParams(templatePath,true); + + Map> sheetMap = new HashMap<>(); + Map mapData = new HashMap<>(); + mapData.put("list", resiMainList.values()); + sheetMap.put(0,mapData); + AtomicInteger n = new AtomicInteger(); + for (FormItem item : resiFormItems.getItemList()) { + + + if (item.getChildGroup() != null) { + if (!item.getChildGroup().getTableName().equals(BASE_TABLE_NAME)) { + //itemMap = item.getChildGroup().getItemList().stream().filter(o -> o.getItemType().equals("checkbox")).collect(Collectors.toMap(o -> o.getColumnName().concat(o.getColumnNum() == 0 ? "" : o.getColumnNum().toString()), o -> ConvertUtils.sourceToTarget(o,FormItem.class))); + + + + Map> resiChildMap = icResiUserService.getDataForExport(itemMap, pageFormDTO.getCustomerId(), pageFormDTO.getFormCode(), item.getChildGroup().getTableName(), pageFormDTO.getConditions()); + resiChildMap.forEach((key,value)->{ + value.putAll(resiMainList.get(key)); + }); + + Map mapData2 = new HashMap<>(); + mapData2.put("list", resiChildMap.values()); + System.out.println("========="+item.getChildGroup().getTableName()+" data:"+resiChildMap.size()); + sheetMap.put(n.incrementAndGet(),mapData2); + } + } + } + + Workbook workbook = ExcelExportUtil.exportExcel(sheetMap, params); + workbook.setActiveSheet(0); + + //header + String fileName = "居民信息.xls"; + response.setHeader("content-Type", "application/vnd.ms-excel"); + response.addHeader("Content-Disposition", "attachment;fileName=" + URLEncoder.encode(fileName, "UTF-8")); + workbook.write(response.getOutputStream()); + } + + /** + * excel导入居民基本信息 + * @param loginUser + * @return + */ + @PostMapping("import/excel") + public Result importExcelByEasyExcel(@LoginUser TokenDto loginUser) { + + LoginUserDetailsFormDTO userForm = new LoginUserDetailsFormDTO(); + userForm.setApp(loginUser.getApp()); + userForm.setClient(loginUser.getClient()); + userForm.setUserId(loginUser.getUserId()); + + Result loginUserDetails = epmetUserOpenFeignClient.getLoginUserDetails(userForm); + + Object result = icResiUserService.importIcResiInfoFromExcel(loginUserDetails.getData().getAgencyId()); + return new Result().ok(result); + } + + @PostMapping("test") + public Result>> test(@RequestBody DynamicQueryFormDTO formDTO){ + formDTO.setCustomerId("45687aa479955f9d06204d415238f7cc"); + //formDTO.setCustomerId(tokenDto.getCustomerId()); + return new Result>>().ok(icResiUserService.dynamicQuery(formDTO.getCustomerId(), + formDTO.getFormCode(), + formDTO.getResultTableName(), + formDTO.getConditions())); + } + + /** + * @Description 查询个人数据 + * @param formDTO + * @author zxc + * @date 2021/11/3 9:21 上午 + */ + @PostMapping("persondata") + public Result personData(@RequestBody PersonDataFormDTO formDTO){ + return new Result().ok(icResiUserService.personData(formDTO)); + } + + /** + * @Description 根据名字搜索 + * @param formDTO + * @param tokenDto + * @author zxc + * @date 2021/11/3 1:42 下午 + */ + @PostMapping("searchbyname") + public Result> searchByName(@RequestBody SearchByNameFormDTO formDTO, @LoginUser TokenDto tokenDto){ + ValidatorUtils.validateEntity(formDTO, SearchByNameFormDTO.SearchByNameForm.class); + return new Result>().ok(icResiUserService.searchByName(formDTO,tokenDto)); + } + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiDemandDictDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiDemandDictDao.java new file mode 100644 index 0000000000..390e190f3c --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiDemandDictDao.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.commons.tools.dto.result.OptionResultDTO; +import com.epmet.entity.IcResiDemandDictEntity; +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-27 + */ +@Mapper +public interface IcResiDemandDictDao extends BaseDao { + List selectDemandOptions(@Param("customerId") String customerId); + List selectChildDemands(@Param("customerId")String customerId, @Param("parentCode") String parentCode); +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java new file mode 100644 index 0000000000..329447a24f --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java @@ -0,0 +1,118 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.ResiUserQueryValueDTO; +import com.epmet.dto.result.IcFormResColumnDTO; +import com.epmet.dto.result.PersonDataResultDTO; +import com.epmet.dto.result.SearchByNameResultDTO; +import com.epmet.entity.IcResiUserEntity; +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-26 + */ +@Mapper +public interface IcResiUserDao extends BaseDao { + + /** + * @Author sun + * @Description 居民信息各表新增数据 + **/ + void add(@Param("tableName") String tableName, @Param("map") Map map); + + /** + * @Author sun + * @Description 更新或新增居民信息各表数据 + **/ + void upTable(@Param("tableName") String tableName, @Param("id") String id, @Param("map") Map map); + + List> selectListResiMap(@Param("customerId") String customerId, + @Param("formCode") String formCode, + @Param("conditions") List conditions, + @Param("resultColumns") List resultColumns, + @Param("subTables") List subTables); + /** + * 查询主表 + * + * @param icResiUserId + * @return java.util.List> + * @author yinzuomei + * @date 2021/10/28 11:20 上午 + */ + List> selectListMapById(@Param("customerId") String customerId, + @Param("icResiUserId")String icResiUserId); + + /** + * 根据ic_resi_user.id去查询各个子表记录,动态传入表名 + * + * @param icResiUserId + * @param subTableName + * @return java.util.List> + * @author yinzuomei + * @date 2021/10/28 11:19 上午 + */ + List> selectSubTableRecords(@Param("customerId")String customerId, + @Param("icResiUserId") String icResiUserId, + @Param("subTableName") String subTableName); + + int updateToDel(String icResiUserId); + + int updateSubTableToDel(@Param("subTalbeName") String subTalbeName, @Param("icResiUserId")String icResiUserId); + + /** + * 接口名称 + * + * @param customerId 客户id + * @param resultTableName 获取哪个表的数据??? + * @param conditions 前端传入的查询入参 + * @return java.util.List> + * @author yinzuomei + * @date 2021/11/2 10:35 上午 + */ + List> dynamicQuery(@Param("customerId")String customerId, + @Param("resultTableName")String resultTableName, + @Param("conditions") List conditions, + @Param("subTables") List subTables); + + /** + * @Description 查询个人信息 + * @param userId + * @author zxc + * @date 2021/11/3 10:28 上午 + */ + PersonDataResultDTO personData(@Param("userId") String userId); + + /** + * @Description 根据名字,组织查询人 + * @param name + * @param agencyId + * @author zxc + * @date 2021/11/3 2:05 下午 + */ + List searchByName(@Param("name")String name, @Param("agencyId")String agencyId,@Param("pageNo")Integer pageNo); + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcEnsureHouseEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcEnsureHouseEntity.java new file mode 100644 index 0000000000..917382ceb9 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcEnsureHouseEntity.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-26 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_ensure_house") +public class IcEnsureHouseEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id customer.id + */ + private String customerId; + + /** + * 主表Id + */ + private String icResiUser; + + /** + * 住房性质【字典表】 + */ + private String zfxz; + + /** + * 保障类型 + */ + private String bzlx; + + /** + * 发证日期 + */ + private Date fzrq; + + /** + * 补贴编号 + */ + private String btbh; + + /** + * 补贴金额 + */ + private String btje; + + /** + * 预留字段1 + */ + private String field1; + + /** + * 预留字段2 + */ + private String field2; + + /** + * 预留字段3 + */ + private String field3; + + /** + * 预留字段4 + */ + private String field4; + + /** + * 预留字段5 + */ + private String field5; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcOldPeopleEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcOldPeopleEntity.java new file mode 100644 index 0000000000..ba5835c5da --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcOldPeopleEntity.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-10-26 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_old_people") +public class IcOldPeopleEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id customer.id + */ + private String customerId; + + /** + * 主表Id + */ + private String icResiUser; + + /** + * 高龄补助 + */ + private String glbz; + + /** + * 预留字段1 + */ + private String field1; + + /** + * 预留字段2 + */ + private String field2; + + /** + * 预留字段3 + */ + private String field3; + + /** + * 预留字段4 + */ + private String field4; + + /** + * 预留字段5 + */ + private String field5; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcPartyMemberEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcPartyMemberEntity.java new file mode 100644 index 0000000000..90b543dd6e --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcPartyMemberEntity.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-10-26 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_party_member") +public class IcPartyMemberEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id customer.id + */ + private String customerId; + + /** + * 主表Id + */ + private String icResiUser; + + /** + * 入党时间 + */ + private Date rdsj; + + /** + * 转正时间 + */ + private Date zzsj; + + /** + * 所属支部 + */ + private String sszb; + + /** + * 是否流动党员 + */ + private String isLd; + + /** + * 流动党员活动证号 + */ + private String ldzh; + + /** + * 职务 + */ + private String partyZw; + + /** + * 是否退休 + */ + private String isTx; + + /** + * 是否党员中心户 + */ + private String isDyzxh; + + /** + * 预留字段1 + */ + private String field1; + + /** + * 预留字段2 + */ + private String field2; + + /** + * 预留字段3 + */ + private String field3; + + /** + * 预留字段4 + */ + private String field4; + + /** + * 预留字段5 + */ + private String field5; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiDemandDictEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiDemandDictEntity.java new file mode 100644 index 0000000000..5e01dd2b14 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiDemandDictEntity.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.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 String level; + + /** + * 备注 + */ + private String remark; + + /** + * 排序 + */ + private Integer sort; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiDemandEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiDemandEntity.java new file mode 100644 index 0000000000..fa4da89b59 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiDemandEntity.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; + +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_resi_demand") +public class IcResiDemandEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id customer.id + */ + private String customerId; + + /** + * 主表Id + */ + private String icResiUser; + + /** + * 需求code【对应ic_resi_demand_dict】 + */ + private String categoryCode; + + /** + * 描述 + */ + private String remakes; + + /** + * 预留字段1 + */ + private String field1; + + /** + * 预留字段2 + */ + private String field2; + + /** + * 预留字段3 + */ + private String field3; + + /** + * 预留字段4 + */ + private String field4; + + /** + * 预留字段5 + */ + private String field5; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiUserEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiUserEntity.java new file mode 100644 index 0000000000..6f9f7d4068 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiUserEntity.java @@ -0,0 +1,496 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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_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 Date dbsj; + + /** + * 所患慢性病 + */ + private String shmxb; + + /** + * 患慢性病时间 + */ + private Date mxbsj; + + /** + * 是否参保 + */ + private String isCb; + + /** + * 自付金额 + */ + private String zfje; + + /** + * 救助金额 + */ + private String jzje; + + /** + * 救助时间[yyyy-MM-dd] + */ + private Date jzsj; + + /** + * 享受救助明细序号 + */ + private String jzmxxh; + + /** + * 健康信息备注 + */ + private String healthRemakes; + + /** + * 工作单位 + */ + private String gzdw; + + /** + * 职业 + */ + private String zy; + + /** + * 离退休时间 + */ + private Date 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-user/epmet-user-server/src/main/java/com/epmet/entity/IcSpecialEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcSpecialEntity.java new file mode 100644 index 0000000000..4a63f28cf5 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcSpecialEntity.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-10-26 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_special") +public class IcSpecialEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id customer.id + */ + private String customerId; + + /** + * 主表Id + */ + private String icResiUser; + + /** + * 人群类别【字典表】 + */ + private String specialRqlb; + + /** + * 预留字段1 + */ + private String field1; + + /** + * 预留字段2 + */ + private String field2; + + /** + * 预留字段3 + */ + private String field3; + + /** + * 预留字段4 + */ + private String field4; + + /** + * 预留字段5 + */ + private String field5; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcUnemployedEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcUnemployedEntity.java new file mode 100644 index 0000000000..c81f359e09 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcUnemployedEntity.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.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_unemployed") +public class IcUnemployedEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id customer.id + */ + private String customerId; + + /** + * 主表Id + */ + private String icResiUser; + + /** + * 原工作单位 + */ + private String ygzdw; + + /** + * 失业人员类别【字典表】 + */ + private String syrylb; + + /** + * 失业时间 + */ + private Date sysj; + + /** + * 失业证号 + */ + private String syzh; + + /** + * 再就业优惠证号 + */ + private String zjyyhzh; + + /** + * 技术特长 + */ + private String jstc; + + /** + * 失业原因【字典表】 + */ + private String syyy; + + /** + * 是否就业困难对象 + */ + private String isJykndx; + + /** + * 劳动能力就业愿望 + */ + private String jyyw; + + /** + * 预留字段1 + */ + private String field1; + + /** + * 预留字段2 + */ + private String field2; + + /** + * 预留字段3 + */ + private String field3; + + /** + * 预留字段4 + */ + private String field4; + + /** + * 预留字段5 + */ + private String field5; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcUnitedFrontEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcUnitedFrontEntity.java new file mode 100644 index 0000000000..71b0939e67 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcUnitedFrontEntity.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; + +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_united_front") +public class IcUnitedFrontEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id customer.id + */ + private String customerId; + + /** + * 主表Id + */ + private String icResiUser; + + /** + * 职务职业 + */ + private String zwzy; + + /** + * 探亲情况 + */ + private String tqqk; + + /** + * 预留字段1 + */ + private String field1; + + /** + * 预留字段2 + */ + private String field2; + + /** + * 预留字段3 + */ + private String field3; + + /** + * 预留字段4 + */ + private String field4; + + /** + * 预留字段5 + */ + private String field5; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcVeteransEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcVeteransEntity.java new file mode 100644 index 0000000000..68720a6be5 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcVeteransEntity.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-10-26 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_veterans") +public class IcVeteransEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id customer.id + */ + private String customerId; + + /** + * 主表Id + */ + private String icResiUser; + + /** + * 入伍时间 + */ + private Date rwsj; + + /** + * 退伍时间 + */ + private Date twsj; + + /** + * 服役单位 + */ + private String fydw; + + /** + * 接收单位 + */ + private String jsdw; + + /** + * 待安置补助金 + */ + private String dazbzj; + + /** + * 培训状况 + */ + private String pxzk; + + /** + * 参战时间【年月日区间值yyyy-MM-dd~yyyy-MM-dd】 + */ + private Date czsj; + + /** + * 现就业情况 + */ + private String xjyqk; + + /** + * 预留字段1 + */ + private String field1; + + /** + * 预留字段2 + */ + private String field2; + + /** + * 预留字段3 + */ + private String field3; + + /** + * 预留字段4 + */ + private String field4; + + /** + * 预留字段5 + */ + private String field5; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcVolunteerEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcVolunteerEntity.java new file mode 100644 index 0000000000..b5693d7e7f --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcVolunteerEntity.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; + +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_volunteer") +public class IcVolunteerEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id customer.id + */ + private String customerId; + + /** + * 主表Id + */ + private String icResiUser; + + /** + * 类别【字典表】 + */ + private String volunteerCategory; + + /** + * 备注 + */ + private String volunteerRemark; + + /** + * 预留字段1 + */ + private String field1; + + /** + * 预留字段2 + */ + private String field2; + + /** + * 预留字段3 + */ + private String field3; + + /** + * 预留字段4 + */ + private String field4; + + /** + * 预留字段5 + */ + private String field5; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcEnsureHouseExcel.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcEnsureHouseExcel.java new file mode 100644 index 0000000000..ea5f69f3d3 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcEnsureHouseExcel.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-10-26 + */ +@Data +public class IcEnsureHouseExcel { + + @Excel(name = "唯一标识") + private String id; + + @Excel(name = "客户Id customer.id") + private String customerId; + + @Excel(name = "主表Id") + private String icResiUser; + + @Excel(name = "住房性质【字典表】") + private String zfxz; + + @Excel(name = "保障类型") + private String bzlx; + + @Excel(name = "发证日期") + private Date fzrq; + + @Excel(name = "补贴编号") + private String btbh; + + @Excel(name = "补贴金额") + private String btje; + + @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; + + @Excel(name = "预留字段1") + private String field1; + + @Excel(name = "预留字段2") + private String field2; + + @Excel(name = "预留字段3") + private String field3; + + @Excel(name = "预留字段4") + private String field4; + + @Excel(name = "预留字段5") + private String field5; + + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcOldPeopleExcel.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcOldPeopleExcel.java new file mode 100644 index 0000000000..42294485ea --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcOldPeopleExcel.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 IcOldPeopleExcel { + + @Excel(name = "唯一标识") + private String id; + + @Excel(name = "客户Id customer.id") + private String customerId; + + @Excel(name = "主表Id") + private String icResiUser; + + @Excel(name = "高龄补助") + private String glbz; + + @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; + + @Excel(name = "预留字段1") + private String field1; + + @Excel(name = "预留字段2") + private String field2; + + @Excel(name = "预留字段3") + private String field3; + + @Excel(name = "预留字段4") + private String field4; + + @Excel(name = "预留字段5") + private String field5; + + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcPartyMemberExcel.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcPartyMemberExcel.java new file mode 100644 index 0000000000..71e3ed92a9 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcPartyMemberExcel.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-10-26 + */ +@Data +public class IcPartyMemberExcel { + + @Excel(name = "唯一标识") + private String id; + + @Excel(name = "客户Id customer.id") + private String customerId; + + @Excel(name = "主表Id") + private String icResiUser; + + @Excel(name = "入党时间") + private Date rdsj; + + @Excel(name = "转正时间") + private Date zzsj; + + @Excel(name = "所属支部") + private String sszb; + + @Excel(name = "是否流动党员") + private String isLd; + + @Excel(name = "流动党员活动证号") + private String ldzh; + + @Excel(name = "职务") + private String partyZw; + + @Excel(name = "是否退休") + private String isTx; + + @Excel(name = "是否党员中心户") + private String isDyzxh; + + @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; + + @Excel(name = "预留字段1") + private String field1; + + @Excel(name = "预留字段2") + private String field2; + + @Excel(name = "预留字段3") + private String field3; + + @Excel(name = "预留字段4") + private String field4; + + @Excel(name = "预留字段5") + private String field5; + + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcResiDemandExcel.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcResiDemandExcel.java new file mode 100644 index 0000000000..4cf0f37a71 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcResiDemandExcel.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-10-26 + */ +@Data +public class IcResiDemandExcel { + + @Excel(name = "唯一标识") + private String id; + + @Excel(name = "客户Id customer.id") + private String customerId; + + @Excel(name = "主表Id") + private String icResiUser; + + @Excel(name = "需求code") + private String categoryCode; + + @Excel(name = "描述") + private String remakes; + + @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; + + @Excel(name = "预留字段1") + private String field1; + + @Excel(name = "预留字段2") + private String field2; + + @Excel(name = "预留字段3") + private String field3; + + @Excel(name = "预留字段4") + private String field4; + + @Excel(name = "预留字段5") + private String field5; + + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcResiUserExcel.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcResiUserExcel.java new file mode 100644 index 0000000000..a3abac4d57 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcResiUserExcel.java @@ -0,0 +1,329 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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 IcResiUserExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "客户Id customer.id") + private String customerId; + + @Excel(name = "") + private String agencyId; + + @Excel(name = "") + private String pids; + + @Excel(name = "网格ID") + private String gridId; + + @Excel(name = "所属小区ID") + private String villageId; + + @Excel(name = "所属楼宇Id") + private String buildId; + + @Excel(name = "所属家庭Id") + private String homeId; + + @Excel(name = "是否本地户籍") + private String isBdhj; + + @Excel(name = "姓名") + private String name; + + @Excel(name = "手机号") + private String mobile; + + @Excel(name = "性别") + private String gender; + + @Excel(name = "身份证号") + private String idCard; + + @Excel(name = "出生日期") + private String birthday; + + @Excel(name = "备注") + private String remarks; + + @Excel(name = "联系人") + private String contacts; + + @Excel(name = "联系人电话") + private String contactsMobile; + + @Excel(name = "九小场所url") + private String ninePlace; + + @Excel(name = "是否党员") + private String isParty; + + @Excel(name = "是否低保户") + private String isDbh; + + @Excel(name = "是否保障房") + private String isEnsureHouse; + + @Excel(name = "是否失业") + private String isUnemployed; + + @Excel(name = "是否育龄妇女") + private String isYlfn; + + @Excel(name = "是否退役军人") + private String isVeterans; + + @Excel(name = "是否统战人员") + private String isUnitedFront; + + @Excel(name = "是否信访人员") + private String isXfry; + + @Excel(name = "是否志愿者") + private String isVolunteer; + + @Excel(name = "是否老年人") + private String isOldPeople; + + @Excel(name = "是否空巢") + private String isKc; + + @Excel(name = "是否失独") + private String isSd; + + @Excel(name = "是否失能") + private String isSn; + + @Excel(name = "是否失智") + private String isSz; + + @Excel(name = "是否残疾") + private String isCj; + + @Excel(name = "是否大病") + private String isDb; + + @Excel(name = "是否慢病") + private String isMb; + + @Excel(name = "是否特殊人群") + private String isSpecial; + + @Excel(name = "文化程度【字典表】") + private String culture; + + @Excel(name = "文化程度备注") + private String cultureRemakes; + + @Excel(name = "特长【字典表】") + private String specialSkill; + + @Excel(name = "兴趣爱好") + private String hobby; + + @Excel(name = "兴趣爱好备注") + private String hobbyRemakes; + + @Excel(name = "宗教信仰") + private String faith; + + @Excel(name = "宗教信仰备注") + private String faithRemakes; + + @Excel(name = "残疾类别【字典表】") + private String cjlb; + + @Excel(name = "残疾登记(状况)【字典表】") + private String cjzk; + + @Excel(name = "残疾证号") + private String cjzh; + + @Excel(name = "残疾说明") + private String cjsm; + + @Excel(name = "有无监护人【yes no】") + private String ynJdr; + + @Excel(name = "有无技能特长【yes no】") + private String ynJntc; + + @Excel(name = "有无劳动能力") + private String ynLdnl; + + @Excel(name = "有无非义务教育阶段助学【yes no】") + private String ynFywjyjdzx; + + @Excel(name = "所患大病") + private String shdb; + + @Excel(name = "患大病时间") + private Date dbsj; + + @Excel(name = "所患慢性病") + private String shmxb; + + @Excel(name = "患慢性病时间") + private Date mxbsj; + + @Excel(name = "是否参保") + private String isCb; + + @Excel(name = "自付金额") + private String zfje; + + @Excel(name = "救助金额") + private String jzje; + + @Excel(name = "救助时间[yyyy-MM-dd]") + private Date jzsj; + + @Excel(name = "享受救助明细序号") + private String jzmxxh; + + @Excel(name = "健康信息备注") + private String healthRemakes; + + @Excel(name = "工作单位") + private String gzdw; + + @Excel(name = "职业") + private String zy; + + @Excel(name = "离退休时间") + private Date ltxsj; + + @Excel(name = "工作信息备注") + private String workRemake; + + @Excel(name = "退休金额") + private String txje; + + @Excel(name = "月收入") + private String ysr; + + @Excel(name = "是否经济低保") + private String isJjdb; + + @Excel(name = "籍贯") + private String jg; + + @Excel(name = "户籍所在地") + private String hjszd; + + @Excel(name = "现居住地") + private String xjzd; + + @Excel(name = "人户情况") + private String rhzk; + + @Excel(name = "居住信息备注") + private String jzxxRemakes; + + @Excel(name = "民族【字典表】") + private String mz; + + @Excel(name = "与户主关系【字典表】") + private String yhzgx; + + @Excel(name = "居住情况【字典表】") + private String jzqk; + + @Excel(name = "婚姻状况【字典表】") + private String hyzk; + + @Excel(name = "配偶情况【字典表】") + private String poqk; + + @Excel(name = "有无赡养人") + private String ynSyr; + + @Excel(name = "与赡养人关系【字典表】") + private String ysyrgx; + + @Excel(name = "赡养人电话") + private String syrMobile; + + @Excel(name = "家庭信息备注") + private String jtxxRemakes; + + @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; + + @Excel(name = "预留字段1") + private String field1; + + @Excel(name = "预留字段2") + private String field2; + + @Excel(name = "预留字段3") + private String field3; + + @Excel(name = "预留字段4") + private String field4; + + @Excel(name = "预留字段5") + private String field5; + + @Excel(name = "预留字段6") + private String field6; + + @Excel(name = "预留字段7") + private String field7; + + @Excel(name = "预留字段8") + private String field8; + + @Excel(name = "预留字段9") + private String field9; + + @Excel(name = "预留字段10") + private String field10; + + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcSpecialExcel.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcSpecialExcel.java new file mode 100644 index 0000000000..fb62227dff --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcSpecialExcel.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 IcSpecialExcel { + + @Excel(name = "唯一标识") + private String id; + + @Excel(name = "客户Id customer.id") + private String customerId; + + @Excel(name = "主表Id") + private String icResiUser; + + @Excel(name = "人群类别【字典表】") + private String specialRqlb; + + @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; + + @Excel(name = "预留字段1") + private String field1; + + @Excel(name = "预留字段2") + private String field2; + + @Excel(name = "预留字段3") + private String field3; + + @Excel(name = "预留字段4") + private String field4; + + @Excel(name = "预留字段5") + private String field5; + + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcUnemployedExcel.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcUnemployedExcel.java new file mode 100644 index 0000000000..9c1b4d7e00 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcUnemployedExcel.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.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 IcUnemployedExcel { + + @Excel(name = "唯一标识") + private String id; + + @Excel(name = "客户Id customer.id") + private String customerId; + + @Excel(name = "主表Id") + private String icResiUser; + + @Excel(name = "原工作单位") + private String ygzdw; + + @Excel(name = "失业人员类别【字典表】") + private String syrylb; + + @Excel(name = "失业时间") + private Date sysj; + + @Excel(name = "失业证号") + private String syzh; + + @Excel(name = "再就业优惠证号") + private String zjyyhzh; + + @Excel(name = "技术特长") + private String jstc; + + @Excel(name = "失业原因【字典表】") + private String syyy; + + @Excel(name = "是否就业困难对象") + private String isJykndx; + + @Excel(name = "劳动能力就业愿望") + private String jyyw; + + @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; + + @Excel(name = "预留字段1") + private String field1; + + @Excel(name = "预留字段2") + private String field2; + + @Excel(name = "预留字段3") + private String field3; + + @Excel(name = "预留字段4") + private String field4; + + @Excel(name = "预留字段5") + private String field5; + + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcUnitedFrontExcel.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcUnitedFrontExcel.java new file mode 100644 index 0000000000..ee65b95670 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcUnitedFrontExcel.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-10-26 + */ +@Data +public class IcUnitedFrontExcel { + + @Excel(name = "唯一标识") + private String id; + + @Excel(name = "客户Id customer.id") + private String customerId; + + @Excel(name = "主表Id") + private String icResiUser; + + @Excel(name = "职务职业") + private String zwzy; + + @Excel(name = "探亲情况") + private String tqqk; + + @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; + + @Excel(name = "预留字段1") + private String field1; + + @Excel(name = "预留字段2") + private String field2; + + @Excel(name = "预留字段3") + private String field3; + + @Excel(name = "预留字段4") + private String field4; + + @Excel(name = "预留字段5") + private String field5; + + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcVeteransExcel.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcVeteransExcel.java new file mode 100644 index 0000000000..8a290d5b3e --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcVeteransExcel.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-10-26 + */ +@Data +public class IcVeteransExcel { + + @Excel(name = "唯一标识") + private String id; + + @Excel(name = "客户Id customer.id") + private String customerId; + + @Excel(name = "主表Id") + private String icResiUser; + + @Excel(name = "入伍时间") + private Date rwsj; + + @Excel(name = "退伍时间") + private Date twsj; + + @Excel(name = "服役单位") + private String fydw; + + @Excel(name = "接收单位") + private String jsdw; + + @Excel(name = "待安置补助金") + private String dazbzj; + + @Excel(name = "培训状况") + private String pxzk; + + @Excel(name = "参战时间【年月日区间值yyyy-MM-dd~yyyy-MM-dd】") + private Date czsj; + + @Excel(name = "现就业情况") + private String xjyqk; + + @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; + + @Excel(name = "预留字段1") + private String field1; + + @Excel(name = "预留字段2") + private String field2; + + @Excel(name = "预留字段3") + private String field3; + + @Excel(name = "预留字段4") + private String field4; + + @Excel(name = "预留字段5") + private String field5; + + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcVolunteerExcel.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcVolunteerExcel.java new file mode 100644 index 0000000000..98c3f56002 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcVolunteerExcel.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-10-26 + */ +@Data +public class IcVolunteerExcel { + + @Excel(name = "唯一标识") + private String id; + + @Excel(name = "客户Id customer.id") + private String customerId; + + @Excel(name = "主表Id") + private String icResiUser; + + @Excel(name = "类别【字典表】") + private String volunteerCategory; + + @Excel(name = "备注") + private String volunteerRemark; + + @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; + + @Excel(name = "预留字段1") + private String field1; + + @Excel(name = "预留字段2") + private String field2; + + @Excel(name = "预留字段3") + private String field3; + + @Excel(name = "预留字段4") + private String field4; + + @Excel(name = "预留字段5") + private String field5; + + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/DynamicEasyExcelListener.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/DynamicEasyExcelListener.java new file mode 100644 index 0000000000..0abf0f28d0 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/DynamicEasyExcelListener.java @@ -0,0 +1,73 @@ +package com.epmet.excel.handler; + +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 DynamicEasyExcelListener extends AnalysisEventListener> { + + /** + * 表头数据(存储所有的表头数据) + */ + private List> headList = new ArrayList<>(); + + /** + * 数据体 + */ + private List> dataList = new ArrayList<>(); +// Map dataList = new HashMap<>(); + + /** + * 这里会一行行的返回头 + * + * @param headMap + * @param context + */ + @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(Map data, AnalysisContext context) { + log.info("解析到一条数据:{}", JSON.toJSONString(data)); + 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-user/epmet-user-server/src/main/java/com/epmet/excel/handler/IcResiExcelImportHandler.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/IcResiExcelImportHandler.java new file mode 100644 index 0000000000..8ae901cd51 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/IcResiExcelImportHandler.java @@ -0,0 +1,12 @@ +package com.epmet.excel.handler; + +import cn.afterturn.easypoi.handler.impl.ExcelDataHandlerDefaultImpl; + +import java.util.Map; + +public class IcResiExcelImportHandler extends ExcelDataHandlerDefaultImpl> { + @Override + public Object importHandler(Map obj, String name, Object value) { + return super.importHandler(obj, name, value); + } +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/handler/ExcelDiceAddressListHandlerImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/handler/ExcelDiceAddressListHandlerImpl.java new file mode 100644 index 0000000000..b03634c761 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/handler/ExcelDiceAddressListHandlerImpl.java @@ -0,0 +1,64 @@ +package com.epmet.handler; + +import cn.afterturn.easypoi.handler.inter.IExcelDictHandler; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 模拟使用,生产请用真实字典 + * + * @author jueyue on 20-4-26. + */ +public class ExcelDiceAddressListHandlerImpl implements IExcelDictHandler { + + /** + * 返回字典所有值 + * key: dictKey + * + * @param dict 字典Key + * @return + */ + public List getList(String dict) { + List list = new ArrayList<>(); + Map dictMap = new HashMap<>(); + dictMap.put("dictKey", "1"); + dictMap.put("dictValue", "男"); + list.add(dictMap); + dictMap = new HashMap<>(); + dictMap.put("dictKey", "2"); + dictMap.put("dictValue", "女"); + list.add(dictMap); + return list; + } + + @Override + public String toName(String dict, Object obj, String name, Object value) { + if ("level".equals(dict)) { + int level = Integer.parseInt(value.toString()); + switch (level) { + case 1: + return "男"; + case 2: + return "女"; + } + } + return null; + } + + @Override + public String toValue(String dict, Object obj, String name, Object value) { + if ("level".equals(dict)) { + int level = Integer.parseInt(value.toString()); + switch (level) { + case 1: + return "男"; + case 2: + return "女"; + } + } + return null; + } +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/IcResiUserRedis.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/IcResiUserRedis.java new file mode 100644 index 0000000000..1986418b32 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/IcResiUserRedis.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 IcResiUserRedis { + @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-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java index 74c16285e0..bd4e8aae97 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java @@ -305,7 +305,7 @@ public interface CustomerStaffService extends BaseService { * @Author zhangyong * @Date 11:10 2020-08-25 **/ - Result selectStaffBasicInfo(String userId); + Result selectStaffBasicInfo(String userId,String customerId); /** * @param formDTO diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiDemandDictService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiDemandDictService.java new file mode 100644 index 0000000000..034d4fc166 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiDemandDictService.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.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.IcResiDemandDictDTO; +import com.epmet.entity.IcResiDemandDictEntity; + +import java.util.List; +import java.util.Map; + +/** + * 居民需求字典表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-27 + */ +public interface IcResiDemandDictService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-10-27 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-10-27 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcResiDemandDictDTO + * @author generator + * @date 2021-10-27 + */ + IcResiDemandDictDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-10-27 + */ + void save(IcResiDemandDictDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-10-27 + */ + void update(IcResiDemandDictDTO dto); + + /** + * 批量删除 + * + * @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); + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java new file mode 100644 index 0000000000..0363899e8a --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java @@ -0,0 +1,170 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.IcResiUserDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.result.FormItem; +import com.epmet.dto.result.HomeUserResultDTO; +import com.epmet.dto.result.PersonDataResultDTO; +import com.epmet.dto.result.SearchByNameResultDTO; +import com.epmet.entity.IcResiUserEntity; + +import java.util.List; +import java.util.Map; + +/** + * 用户基础信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +public interface IcResiUserService 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 IcResiUserDTO + * @author generator + * @date 2021-10-26 + */ + IcResiUserDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-10-26 + */ + void save(IcResiUserDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-10-26 + */ + void update(IcResiUserDTO dto); + + /** + * 单个删除 + * + * @return void + * @author generator + * @date 2021-10-26 + */ + void delete(DelIcResiUserFormDTO formDTO); + + /** + * @Author sun + * @Description 党建互联平台--保存居民信息 + **/ + void add(TokenDto tokenDto, List formDTO); + + /** + * @Author sun + * @Description 党建互联平台--修改居民信息 + **/ + void edit(TokenDto tokenDto, List formDTO); + + /** + * @Description 获取房间内人员 + * @Param homeId + * @Return {@link List< HomeUserResultDTO>} + * @Author zhaoqifeng + * @Date 2021/11/1 10:52 + */ + List getPeopleByRoom(String homeId); + + PageData> pageResiMap(IcResiUserPageFormDTO formDTO); + /** + * 编辑页面,显示居民信息详情 + * + * @param pageFormDTO + * @return java.util.Map + * @author yinzuomei + * @date 2021/10/28 10:29 上午 + */ + Map queryIcResiDetail(IcResiDetailFormDTO pageFormDTO); + + Object importIcResiInfoFromExcel(String currUserAgencyId); + + List> dynamicQuery(String customerId, + String formCode, + String resultTableName, + List conditions); + + /** + * @Description 查询个人数据 + * @param formDTO + * @author zxc + * @date 2021/11/3 9:21 上午 + */ + PersonDataResultDTO personData(PersonDataFormDTO formDTO); + + /** + * @Description 根据名字搜索 + * @param formDTO + * @param tokenDto + * @author zxc + * @date 2021/11/3 1:42 下午 + */ + List searchByName(SearchByNameFormDTO formDTO,TokenDto tokenDto); + + + /** + * desc:条件导出 + * + * @param itemList + * @param customerId + * @param formCode + * @param baseTableName + * @param conditions + * @return + */ + Map> getDataForExport(Map itemList, String customerId, String formCode, String baseTableName, List conditions); + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java index 989b86924d..8c880d86cd 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java @@ -22,9 +22,11 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.entity.DataScope; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.rocketmq.messages.OrgOrStaffMQMsg; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.exception.RenException; @@ -49,8 +51,10 @@ import com.epmet.entity.GovStaffRoleEntity; import com.epmet.entity.StaffRoleEntity; import com.epmet.entity.UserEntity; import com.epmet.feign.AuthFeignClient; +import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.feign.OperCrmOpenFeignClient; +import com.epmet.send.SendMqMsgUtil; import com.epmet.service.CustomerStaffService; import com.epmet.service.GovStaffRoleService; import com.epmet.service.StaffRoleService; @@ -78,7 +82,7 @@ import java.util.stream.Collectors; @Slf4j @Service public class CustomerStaffServiceImpl extends BaseServiceImpl implements CustomerStaffService { - private Logger logger = LogManager.getLogger(getClass()); + private final Logger logger = LogManager.getLogger(getClass()); @Autowired private GovStaffRoleService govStaffRoleService; @Autowired @@ -99,6 +103,8 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl page(Map params) { @@ -342,6 +348,16 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl().ok(ConvertUtils.sourceToTarget(staffEntity, CustomerStaffDTO.class)); } @@ -400,7 +416,7 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl selectStaffBasicInfo(String userId) { + public Result selectStaffBasicInfo(String userId,String customerId) { StaffBasicInfoResultDTO resultDTO = baseDao.selectStaffBasicInfo(userId); if(null!=resultDTO){ resultDTO.setRoleList(baseDao.selectStaffRoles(userId,resultDTO.getCustomerId())); + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(customerId, userId); + if (null != staffInfo){ + resultDTO.setAgencyId(staffInfo.getAgencyId()); + resultDTO.setAgencyName(staffInfo.getAgencyName()); + } } return new Result().ok(resultDTO); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiDemandDictServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiDemandDictServiceImpl.java new file mode 100644 index 0000000000..1910a360af --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiDemandDictServiceImpl.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.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.dto.result.OptionResultDTO; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.IcResiDemandDictDao; +import com.epmet.dto.IcResiDemandDictDTO; +import com.epmet.entity.IcResiDemandDictEntity; +import com.epmet.service.IcResiDemandDictService; +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-27 + */ +@Service +public class IcResiDemandDictServiceImpl extends BaseServiceImpl implements IcResiDemandDictService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcResiDemandDictDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcResiDemandDictDTO.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 IcResiDemandDictDTO get(String id) { + IcResiDemandDictEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcResiDemandDictDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcResiDemandDictDTO dto) { + IcResiDemandDictEntity entity = ConvertUtils.sourceToTarget(dto, IcResiDemandDictEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcResiDemandDictDTO dto) { + IcResiDemandDictEntity entity = ConvertUtils.sourceToTarget(dto, IcResiDemandDictEntity.class); + updateById(entity); + } + + @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); + } + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java new file mode 100644 index 0000000000..7bb1faee36 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java @@ -0,0 +1,1047 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.excel.EasyExcelFactory; +import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.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.ServiceConstant; +import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.dto.result.OptionResultDTO; +import com.epmet.commons.tools.enums.GenderEnum; +import com.epmet.commons.tools.enums.HouseTypeEnum; +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.page.PageData; +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.UserConstant; +import com.epmet.dao.IcResiUserDao; +import com.epmet.dto.*; +import com.epmet.dto.form.*; +import com.epmet.dto.result.*; +import com.epmet.entity.IcResiUserEntity; +import com.epmet.excel.handler.DynamicEasyExcelListener; +import com.epmet.feign.EpmetAdminOpenFeignClient; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.feign.GovOrgOpenFeignClient; +import com.epmet.feign.OperCustomizeOpenFeignClient; +import com.epmet.redis.IcResiUserRedis; +import com.epmet.service.IcResiUserService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import lombok.Data; +import lombok.extern.slf4j.Slf4j; +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; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.io.File; +import java.util.*; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + * 用户基础信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +@Slf4j +@Service +public class IcResiUserServiceImpl extends BaseServiceImpl implements IcResiUserService, ResultDataResolver { + private final Logger logger = LogManager.getLogger(IcResiUserServiceImpl.class); + @Autowired + private IcResiUserRedis icResiUserRedis; + @Autowired + private GovOrgOpenFeignClient govOrgOpenFeignClient; + @Autowired + private OperCustomizeOpenFeignClient operCustomizeOpenFeignClient; + + @Autowired + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + + @Autowired + private EpmetAdminOpenFeignClient adminOpenFeignClient; + + @Autowired + private LoginUserUtil loginUserUtil; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcResiUserDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcResiUserDTO.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 IcResiUserDTO get(String id) { + IcResiUserEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcResiUserDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcResiUserDTO dto) { + IcResiUserEntity entity = ConvertUtils.sourceToTarget(dto, IcResiUserEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcResiUserDTO dto) { + IcResiUserEntity entity = ConvertUtils.sourceToTarget(dto, IcResiUserEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(DelIcResiUserFormDTO formDTO) { + baseDao.updateToDel(formDTO.getIcResiUserId()); + CustomerFormQueryDTO queryDTO = ConvertUtils.sourceToTarget(formDTO, CustomerFormQueryDTO.class); + Result> subTableRes = operCustomizeOpenFeignClient.queryIcResiSubTables(queryDTO); + if (subTableRes.success() && !CollectionUtils.isEmpty(subTableRes.getData())) { + for (String subTalbeName : subTableRes.getData()) { + baseDao.updateSubTableToDel(subTalbeName, formDTO.getIcResiUserId()); + } + } + } + + /** + * @Author sun + * @Description 党建互联平台--保存居民信息 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public void add(TokenDto tokenDto, List formDTO) { + //循环自动拼接sql语句,往多个表新增数据 + //1.先往主表新增数据 + //主表Id + String resiUserId = UUID.randomUUID().toString().replaceAll("-", ""); + formDTO.forEach(d -> { + if ("ic_resi_user".equals(d.getTableName())) { + LinkedHashMap map = d.getList().get(0); + map.put("id", resiUserId); + map.put("customer_id", tokenDto.getCustomerId()); + map.put("created_by", tokenDto.getUserId()); + map.put("updated_by", tokenDto.getUserId()); + if(!map.containsKey("AGENCY_ID")){ + throw new RenException("新增居民信息--入参AGENCY_ID为空"); + } + //查询组织信息 + String agencyId = map.get("AGENCY_ID"); + Result result = govOrgOpenFeignClient.getAgencyById(agencyId); + if (result.success() && null != result.getData()) { + map.put("pids", result.getData().getPids()); + } else { + throw new RenException(String.format("新增居民信息-根据agencyId查询组织信息失败,agencyId->%s", agencyId)); + } + //新增主表数据 + baseDao.add(d.getTableName(), map); + } + }); + //2.循环字表新增数据 + formDTO.forEach(d -> { + if (!"ic_resi_user".equals(d.getTableName())) { + for (LinkedHashMap map : d.getList()) { + map.put("id", UUID.randomUUID().toString().replaceAll("-", "")); + map.put("ic_resi_user", resiUserId); + map.put("customer_id", tokenDto.getCustomerId()); + map.put("created_by", tokenDto.getUserId()); + map.put("updated_by", tokenDto.getUserId()); + //字表新增数据 + baseDao.add(d.getTableName(), map); + } + } + }); + + } + + /** + * @Author sun + * @Description 党建互联平台--修改居民信息 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public void edit(TokenDto tokenDto, List formDTO) { + //1.校验主表数据是否存在 + String resiUserId = ""; + LinkedHashMap map = new LinkedHashMap<>(); + for (IcResiUserFormDTO d : formDTO) { + if ("ic_resi_user".equals(d.getTableName())) { + map = d.getList().get(0); + if (!map.containsKey("ID")) { + throw new RenException(String.format("居民信息修改-居民信息表主键值为空")); + } + resiUserId = map.get("ID"); + } + } + if (null == map) { + throw new RenException(String.format("居民信息修改,参数错误,未传入基础信息Id")); + } + IcResiUserEntity entity = baseDao.selectById(resiUserId); + if (null == entity) { + throw new RenException(String.format("居民信息修改,获取基础信息失败,基础信息Id->", resiUserId)); + } + //2.更新主表数据 + if (map.size() > NumConstant.ONE) { + map.put("updated_by", tokenDto.getUserId()); + baseDao.upTable("ic_resi_user", resiUserId, map); + } + + //3.循环更新或新增字表数据 + String finalResiUserId = resiUserId; + formDTO.forEach(d -> { + if (!"ic_resi_user".equals(d.getTableName())) { + for (LinkedHashMap hash : d.getList()) { + hash.put("updated_by", tokenDto.getUserId()); + if (!hash.containsKey("ID")) { + hash.put("id", UUID.randomUUID().toString().replaceAll("-", "")); + hash.put("ic_resi_user", finalResiUserId); + hash.put("customer_id", tokenDto.getCustomerId()); + hash.put("created_by", tokenDto.getUserId()); + //字表新增数据 + baseDao.add(d.getTableName(), hash); + } else { + //字表更新数据 + baseDao.upTable(d.getTableName(), hash.get("ID"), hash); + } + } + } + }); + + } + + /** + * @param homeId + * @Description 获取房间内人员 + * @Param homeId + * @Return {@link List< HomeUserResultDTO >} + * @Author zhaoqifeng + * @Date 2021/11/1 10:52 + */ + @Override + public List getPeopleByRoom(String homeId) { + if(StringUtils.isBlank(homeId)) { + return Collections.emptyList(); + } + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcResiUserEntity::getHomeId, homeId); + wrapper.orderByAsc(IcResiUserEntity::getYhzgx); + List list = baseDao.selectList(wrapper); + + if (CollectionUtils.isEmpty(list)) { + return Collections.emptyList(); + } + return list.stream().map(item -> { + HomeUserResultDTO dto = new HomeUserResultDTO(); + dto.setUserId(item.getId()); + dto.setName(item.getName()); + return dto; + }).collect(Collectors.toList()); + } + + + + + @Override + public PageData> pageResiMap(IcResiUserPageFormDTO formDTO) { + // 查询列表展示项,如果没有,直接返回 + CustomerFormQueryDTO queryDTO1=new CustomerFormQueryDTO(); + queryDTO1.setCustomerId(formDTO.getCustomerId()); + queryDTO1.setFormCode(formDTO.getFormCode()); + Result> resultColumnRes=operCustomizeOpenFeignClient.queryConditions(queryDTO1); + if (!resultColumnRes.success() || CollectionUtils.isEmpty(resultColumnRes.getData())) { + log.warn("没有配置列表展示列"); + return new PageData(new ArrayList(), NumConstant.ZERO); + } + List resultColumns = resultColumnRes.getData(); + // 查询列表展示项需要用到哪些子表 + Result> subTablesRes=operCustomizeOpenFeignClient.querySubTables(queryDTO1); + List subTables =subTablesRes.getData(); + PageInfo> pageInfo=new PageInfo<>(); + if (null == formDTO.getPageFlag()||formDTO.getPageFlag()) { + //分页 + pageInfo= PageHelper.startPage(formDTO.getPageNo(), + formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.selectListResiMap(formDTO.getCustomerId(), + formDTO.getFormCode(), + formDTO.getConditions(), + resultColumns, + subTables)); + }else{ + List> list=baseDao.selectListResiMap(formDTO.getCustomerId(), + formDTO.getFormCode(), + formDTO.getConditions(), + resultColumns, + subTables); + pageInfo.setTotal(CollectionUtils.isEmpty(list)?NumConstant.ZERO:list.size()); + pageInfo.setList(list); + } + + List> list = pageInfo.getList(); + //查询网格名称 + List gridIds = new ArrayList<>(); + Set houseIds = new HashSet<>(); + for (Map map : list) { + log.warn(JSON.toJSONString(map)); + if (map.containsKey(UserConstant.GRID_ID) && null != map.get(UserConstant.GRID_ID) && StringUtils.isNotBlank(map.get(UserConstant.GRID_ID).toString())) { + gridIds.add(map.get(UserConstant.GRID_ID).toString()); + } + if (map.containsKey(UserConstant.HOME_ID) && null != map.get(UserConstant.HOME_ID) && StringUtils.isNotBlank(map.get(UserConstant.HOME_ID).toString())) { + houseIds.add(map.get(UserConstant.HOME_ID).toString()); + } + } + 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())); + + //查询房子名称 + Result> houseInfoRes=govOrgOpenFeignClient.queryListHouseInfo(houseIds); + List houseInfoDTOList = houseInfoRes.success() && !CollectionUtils.isEmpty(houseInfoRes.getData()) ? houseInfoRes.getData() : new ArrayList<>(); + Map houseInfoMap = houseInfoDTOList.stream().collect(Collectors.toMap(HouseInfoDTO::getHomeId, Function.identity())); + for (Map resultMap : list) { + String gridIdValue = null != resultMap.get(UserConstant.GRID_ID) ? resultMap.get(UserConstant.GRID_ID).toString() : StrConstant.EPMETY_STR; + resultMap.put("GRID_ID_VALUE", gridIdValue); + if (null != gridInfoMap && gridInfoMap.containsKey(gridIdValue) && null != gridInfoMap.get(gridIdValue)) { + //GRID_NAME + resultMap.put(UserConstant.GRID_ID, gridInfoMap.get(gridIdValue).getGridName()); + } + + String homeId = null != resultMap.get(UserConstant.HOME_ID) ? resultMap.get(UserConstant.HOME_ID).toString() : StrConstant.EPMETY_STR; + resultMap.put("HOME_ID_VALUE", homeId); + if (null != houseInfoMap && houseInfoMap.containsKey(homeId) && null != houseInfoMap.get(homeId)) { + HouseInfoDTO houseInfoDTO = houseInfoMap.get(homeId); + String buildName = StringUtils.isNotBlank(houseInfoDTO.getBuildingName()) ? houseInfoDTO.getBuildingName() : StrConstant.EPMETY_STR; + resultMap.put("BUILD_NAME", buildName); + + String neighBorName = StringUtils.isNotBlank(houseInfoDTO.getNeighborHoodName()) ? houseInfoDTO.getNeighborHoodName() : StrConstant.EPMETY_STR; + resultMap.put("VILLAGE_NAME", neighBorName); + + String unitName = StringUtils.isNotBlank(houseInfoDTO.getUnitName()) ? houseInfoDTO.getUnitName() : StrConstant.EPMETY_STR; + resultMap.put("UNIT_NAME", unitName); + + String doorName = StringUtils.isNotBlank(houseInfoDTO.getDoorName()) ? houseInfoDTO.getDoorName() : StrConstant.EPMETY_STR; + resultMap.put("DOOR_NAME", doorName); + + String houseType = StringUtils.isNotBlank(houseInfoDTO.getHouseType()) ? houseInfoDTO.getHouseType() : StrConstant.EPMETY_STR; + //房屋类型,1楼房,2平房,3别墅 + resultMap.put(UserConstant.HOUSE_TYPE_KEY, ""); + if (HouseTypeEnum.LOUFANG.getCode().equals(houseType)) { + resultMap.put(UserConstant.HOUSE_TYPE_KEY, HouseTypeEnum.LOUFANG.getName()); + } else if (HouseTypeEnum.PINGFANG.getCode().equals(houseType)) { + resultMap.put(UserConstant.HOUSE_TYPE_KEY, HouseTypeEnum.PINGFANG.getName()); + } else if (HouseTypeEnum.BIESHU.getCode().equals(houseType)) { + resultMap.put(UserConstant.HOUSE_TYPE_KEY, HouseTypeEnum.BIESHU.getName()); + } + + resultMap.put(UserConstant.HOME_ID, neighBorName.concat(buildName).concat(unitName).concat(doorName)); + } + + if (resultMap.containsKey(UserConstant.GENDER)) { + String genderValue = null != resultMap.get(UserConstant.GENDER) ? resultMap.get(UserConstant.GENDER).toString() : StrConstant.EPMETY_STR; + if (GenderEnum.MAN.getCode().equals(genderValue)) { + resultMap.put(UserConstant.GENDER, GenderEnum.MAN.getName()); + } else if (GenderEnum.WOMAN.getCode().equals(genderValue)) { + resultMap.put(UserConstant.GENDER, GenderEnum.WOMAN.getName()); + } else if (GenderEnum.UN_KNOWN.getCode().equals(genderValue)) { + resultMap.put(UserConstant.GENDER, GenderEnum.UN_KNOWN.getName()); + } + } + } + pageInfo.setList(list); + return new PageData<>(pageInfo.getList(), pageInfo.getTotal()); + } + + /** + * 编辑页面,显示居民信息详情 + * + * @param pageFormDTO + * @return java.util.Map + * @author yinzuomei + * @date 2021/10/28 10:29 上午 + */ + @Override + public Map queryIcResiDetail(IcResiDetailFormDTO pageFormDTO) { + Map resultMap = new HashMap(); + // 先查询主表,主表没有记录,直接返回空 + List> icResiUserMapList = baseDao.selectListMapById(pageFormDTO.getCustomerId(),pageFormDTO.getIcResiUserId()); + if (CollectionUtils.isEmpty(icResiUserMapList)) { + return new HashMap(); + } + resultMap.put("ic_resi_user", icResiUserMapList); + CustomerFormQueryDTO queryDTO=ConvertUtils.sourceToTarget(pageFormDTO,CustomerFormQueryDTO.class); + //循环查询每个子表的记录 + Result> subTableRes=operCustomizeOpenFeignClient.queryIcResiSubTables(queryDTO); + if(subTableRes.success()&&!CollectionUtils.isEmpty(subTableRes.getData())){ + for (String subTalbeName : subTableRes.getData()) { + List> list = baseDao.selectSubTableRecords(pageFormDTO.getCustomerId(),pageFormDTO.getIcResiUserId(), subTalbeName); + if (!CollectionUtils.isEmpty(list)) { + resultMap.put(subTalbeName, list); + } + //else{ + // resultMap.put(subTalbeName,new ArrayList<>()); + //} + } + } + return resultMap; + } + + @Override + public Object importIcResiInfoFromExcel(String currUserAgencyId) { + CustomerAgencyDTO agencyInfo = getResultDataOrThrowsException(govOrgOpenFeignClient.getAgencyById(currUserAgencyId), ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null); + String loginUserId = loginUserUtil.getLoginUserId(); + return importIcResiInfoFromExcel(0, 3, currUserAgencyId, agencyInfo.getPids(), loginUserId); +// imporExcel(1, 1); +// imporExcel(2, 1); +// imporExcel(3, 1); +// imporExcel(4, 1); +// imporExcel(5, 1); +// imporExcel(6, 2); +// imporExcel(7, 1); +// imporExcel(8, 1); + } + + private Object importIcResiInfoFromExcel(int sheetNo, int headRowNumber, String currUserAgencyId, String currUserAgencyPids, String currentUserId) { + DynamicEasyExcelListener readListener = new DynamicEasyExcelListener(); + EasyExcelFactory.read(new File("/opt/test/基础信息表/resi_info.xls")).registerReadListener(readListener).headRowNumber(3).sheet(sheetNo).doRead(); + + List> headList = readListener.getHeadList(); + List> dataList = readListener.getDataList(); + + Map> headers = mergeHead(headList); + + // 查询form相关信息 + CustomerFormQueryDTO form = new CustomerFormQueryDTO(); + form.setFormCode("resi_base_info"); + Result> result = operCustomizeOpenFeignClient.listItems(form); + List customerItems = getResultDataOrThrowsException(result, ServiceConstant.OPER_CUSTOMIZE_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【居民信息excel导入】查询表单相关信息失败"); + + // 清洗表头数据 + Map abandonedHeaders = washHeaders(headers, customerItems); + + //合并多级表头 + HashMap> combinedHeaders = combineHeaders(headers); + + // 得到客户配置item数据 + Map formItemMap = customerItems.stream().collect( + Collectors.toMap(formItem -> { + String groupLabel = formItem.getGroupLabel(); + String label = formItem.getLabel(); + if (StringUtils.isNotBlank(groupLabel)) { + return groupLabel.concat(":").concat(label); + } else { + return label; + } + }, formItem -> formItem) + ); + Map headerColumnWrapper = integrate(formItemMap, combinedHeaders, dataList, abandonedHeaders); + + // 持久化 + persist(headerColumnWrapper, dataList, currUserAgencyId, abandonedHeaders, customerItems.get(0).getTableName(), currUserAgencyPids, currentUserId); + + return headerColumnWrapper; + } + + /** + * 持久化 + * @param headerColumnWrapper 数据库列包装信息 + * @param dataRows 数据行集合 + * @param currUserAgencyId 当前用户的组织id + * @param checkBoxOptionColumnIdxAndLabel 复选框的列号&label中文 + */ + private void persist(Map headerColumnWrapper, List> dataRows, + String currUserAgencyId, Map checkBoxOptionColumnIdxAndLabel, String tableName, + String currUserAgencyPids, String currentUserId) { + for (Map row : dataRows) { + + // 当前行的列们 +// List columnsOfCurrRow = new ArrayList<>(); + + List columnNames = new ArrayList<>(); + List columnValues = new ArrayList<>(); + LinkedHashMap columnAndValues = new LinkedHashMap<>(); + + for (Map.Entry columnWrapperEntry : headerColumnWrapper.entrySet()) { + + ColumnWrapper columnWrapper = columnWrapperEntry.getValue(); + if ("input".equals(columnWrapper.getItemType()) + || "textarea".equals(columnWrapper.getItemType()) + || "datepicker".equals(columnWrapper.getItemType()) + || "timerange".equals(columnWrapper.getItemType()) + ) { + + String cellContent = row.get(columnWrapper.getColIndexs().get(0)); + columnWrapper.setCellContent(cellContent); + columnWrapper.setColValue(cellContent); + + } else if ("select".equals(columnWrapper.getItemType()) + || "radio".equals(columnWrapper.getItemType())){ + + String optionSourceType = columnWrapper.getOptionSourceType(); + // 取单元格的内容 + String cellContent = row.get(columnWrapper.getColIndexs().get(0)); + columnWrapper.setCellContent(cellContent); + + if ("local".equals(optionSourceType)) { + // 根据单元格内容,取到指定的option + Map options = columnWrapper.getOptions(); + String colValue = options.get(cellContent); + columnWrapper.setColValue(colValue); + } else { + // remote类型 + + Map options = listRemoteOptions(headerColumnWrapper, columnWrapper.getOptionSourceValue(), currUserAgencyId); + String colValue = options.get(cellContent); + columnWrapper.setColValue(colValue); + } + } else if ("checkbox".equals(columnWrapper.getItemType())) { + String checkBoxColValue = getCheckBoxColValue(columnWrapper, row, checkBoxOptionColumnIdxAndLabel); + columnWrapper.setColValue(checkBoxColValue); + } + columnAndValues.put(columnWrapper.columnName, columnWrapper.colValue); + } + + columnAndValues.put("IS_ENSURE_HOUSE", "0"); + columnAndValues.put("IS_OLD_PEOPLE", "0"); + columnAndValues.put("IS_PARTY", "0"); + columnAndValues.put("IS_SPECIAL", "0"); + columnAndValues.put("IS_UNEMPLOYED", "0"); + columnAndValues.put("IS_UNITED_FRONT", "0"); + columnAndValues.put("IS_VETERANS", "0"); + columnAndValues.put("IS_VOLUNTEER", "0"); + + columnAndValues.put("AGENCY_ID", currUserAgencyId); + columnAndValues.put("PIDS", currUserAgencyPids); + columnAndValues.put("CUSTOMER_ID", loginUserUtil.getCurrentCustomerId()); + columnAndValues.put("CREATED_BY", currentUserId); + columnAndValues.put("UPDATED_BY", currentUserId); + columnAndValues.put("ID", UUID.randomUUID().toString().replace("-", "")); + +// rowColumnWrappers.forEach(c -> { +// System.out.println(c.columnName + "\t" + c.getColValue()); +// }); + +// System.out.println("-------------------"); + + baseDao.add(tableName, columnAndValues); + } + } + + /** + * @description 合并头 + * + * @param headers + * @return + * @author wxz + * @date 2021.10.28 21:27:18 + */ + private HashMap> combineHeaders(Map> headers) { + HashMap> itemAndColIndexs = new LinkedHashMap<>(); + + headers.forEach((k, v) -> { + String tempKey = String.join(":", v); + List colIndexs = itemAndColIndexs.get(tempKey); + if (colIndexs == null) { + colIndexs = new ArrayList<>(); + itemAndColIndexs.put(tempKey, colIndexs); + } + colIndexs.add(k); + }); + + return itemAndColIndexs; + } + + /** + * @description 洗头 + * + * @param headers + * @param items + * @return + * @author wxz + * @date 2021.10.28 21:07:12 + */ + private Map washHeaders(Map> headers, List items) { + List itemLabels = items.stream().map(i -> i.getLabel()).collect(Collectors.toList()); + Map abandonedHeaders = new HashMap<>(); + for (Map.Entry> entry:headers.entrySet()) { + Integer colIdx = entry.getKey(); + List v = entry.getValue(); + int lastPartIndex = v.size() - 1; + String lastValuePart = v.get(lastPartIndex); + if (!itemLabels.contains(lastValuePart)) { + // 该部分为options,它的上一级是item,那么去掉options这一级 + v.remove(lastPartIndex); + abandonedHeaders.put(colIdx, lastValuePart); + } + } + + return abandonedHeaders; + } + + /** + * @description 数据整合 + * + * @return + * @author wxz + * @date 2021.10.28 17:08:51 + */ + private Map integrate(Map formItemMap, Map> combinedHeaders, + List> datas, Map abandonedHeaders) { + +// HashMap> tables = new HashMap<>(); + Map columns = new LinkedHashMap<>(combinedHeaders.size()); + + for (Map.Entry> entry : combinedHeaders.entrySet()) { + String combinedHeader = entry.getKey(); + + FormItem item = formItemMap.get(combinedHeader); + + if (item == null) { + // 如果数据库中没有该项,可能是用户自己定义的项,忽略 + continue; + } + + ColumnWrapper columnWrapper = new ColumnWrapper(); + + // 填充options + columnWrapper.setItemType(item.getItemType()); + columnWrapper.setItemId(item.getItemId()); + String groupLabel = item.getGroupLabel(); + String combinedLabel = StringUtils.isBlank(groupLabel) ? item.getLabel() : groupLabel.concat(":").concat(item.getLabel()); + columnWrapper.setCombinedLabel(combinedLabel); + columnWrapper.setColumnName(item.getColumnName()); + columnWrapper.setColIndexs(entry.getValue()); + + columnWrapper.setOptionSourceType(item.getOptionSourceType()); + columnWrapper.setOptionSourceValue(item.getOptionSourceValue()); + columnWrapper.setOptions(item.getOptions().stream().collect(Collectors.toMap(OptionDTO::getLabel, OptionDTO::getValue))); + + columns.put(item.getItemId(), columnWrapper); + } + return columns; + } + + /** + * 获取checkbox列值 + * @param columnWrapper 数据库列包装信息,每一列跳数据对应数据库的一个列 + * @param dataRow 数据行,每一条都是一行中的一个单元格 + * @param checkboxOptions 复选框的选项。k: 列号, value: checkboxlabel中文 + * @return + */ + private String getCheckBoxColValue(ColumnWrapper columnWrapper, Map dataRow, Map checkboxOptions) { + + Map options = columnWrapper.getOptions(); + List colIndexs = columnWrapper.getColIndexs(); + + List optionValues = colIndexs.stream().filter(i -> { + String cellContent = dataRow.get(i); + return StringUtils.isNotBlank(cellContent) && cellContent.equals("是"); + }).map(i -> { + String checkboxOptionLabel = checkboxOptions.get(i); + return options.get(checkboxOptionLabel); + }).collect(Collectors.toList()); + + return String.join(",", optionValues); + } + + /** + * 远程获取options + * @param fullUri + * @return + */ + private Map listRemoteOptions(Map columnWrappers, String fullUri, String currUserAgencyId) { + String pureUri = null; + String cascadeItemId = null; + ColumnWrapper cascadeItemColumnWrapper = null; + + if (fullUri.indexOf("?") != -1) { + String[] uriParts = fullUri.split("\\?"); + pureUri = uriParts[0]; + cascadeItemId = uriParts[1]; + + // 根据uri上的id,找到关联的itemid,从而找到关联的item的值 + cascadeItemColumnWrapper = columnWrappers.get(cascadeItemId); + } else { + pureUri = fullUri; + } + + List options = null; + + switch (pureUri) { + case "/epmetuser/icresidemanddict/demandoption": + options = getResultDataOrThrowsException(epmetUserOpenFeignClient.getDemandOptions(), ServiceConstant.EPMET_USER_SERVER, + EpmetErrorCode.SERVER_ERROR.getCode(), null); + break; + case "/gov/org/customergrid/gridoption": + AgencyIdFormDTO form = new AgencyIdFormDTO(); + form.setAgencyId(currUserAgencyId); + options = getResultDataOrThrowsException(govOrgOpenFeignClient.getGridOption(form), ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null); + break; + case "/gov/org/customerpartybranch/branchoption": + + CustomerPartyBranchDTO bform = new CustomerPartyBranchDTO(); + bform.setGridId(cascadeItemColumnWrapper.getColValue()); + options = getResultDataOrThrowsException(govOrgOpenFeignClient.getBranchOption(bform), ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null); + break; + case "/gov/org/icbuilding/buildingoption": + IcBuildingDTO buildingform = new IcBuildingDTO(); + buildingform.setNeighborHoodId(cascadeItemColumnWrapper.getColValue()); + options = getResultDataOrThrowsException(govOrgOpenFeignClient.getBuildingOptions(buildingform), ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null); + break; + case "/gov/org/icbuildingunit/unitoption": + IcBuildingUnitDTO buForm = new IcBuildingUnitDTO(); + buForm.setBuildingId(cascadeItemColumnWrapper.getColValue()); + options = getResultDataOrThrowsException(govOrgOpenFeignClient.getUnitOptions(buForm), ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null); + break; + case "/gov/org/ichouse/houseoption": + HouseFormDTO hform = new HouseFormDTO(); + hform.setUnitId(cascadeItemColumnWrapper.getColValue()); + options = getResultDataOrThrowsException(govOrgOpenFeignClient.getHouseOption(hform), ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null); + break; + case "/gov/org/icneighborhood/neighborhoodoption": + IcNeighborHoodDTO nform = new IcNeighborHoodDTO(); + nform.setAgencyId(currUserAgencyId); + nform.setGridId(cascadeItemColumnWrapper.getColValue()); + options = getResultDataOrThrowsException(govOrgOpenFeignClient.getNeighborHoodOptions(nform), ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null); + break; + case "/sys/dict/data/education": + options = getResultDataOrThrowsException(adminOpenFeignClient.getEducationOption(), ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null); + break; + case "/sys/dict/data/house": + options = getResultDataOrThrowsException(adminOpenFeignClient.getHouseOption(), ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null); + break; + case "/sys/dict/data/nation": + options = getResultDataOrThrowsException(adminOpenFeignClient.getNationOption(), ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null); + break; + case "/sys/dict/data/ninesmallplaces": + options = getResultDataOrThrowsException(adminOpenFeignClient.getNineSmallPlacesOption(), ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null); + break; + case "/sys/dict/data/relationship": + options = getResultDataOrThrowsException(adminOpenFeignClient.getRelationshipOption(), ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null); + break; + + } + + if (options == null) return null; + + return options.stream().collect(Collectors.toMap(OptionResultDTO::getLabel, OptionResultDTO::getValue)); + + // 通用api调用,无法实现 + /*if (!uri.startsWith("/api")) uri = "/api".concat(uri); + + NamingService namingService = discoveryProperties.namingServiceInstance(); + ResponseEntity>> response = null; + try { + // 调用gateway服务,查询相关接口 + Instance gatewayInstance = namingService.getAllInstances(ServiceConstant.EPMET_GATEWAY).get(0); + String ip = gatewayInstance.getIp(); + int port = gatewayInstance.getPort(); + + String url = String.format("http://%s:%s%s", ip, port, uri); + + ParameterizedTypeReference>> tr = new ParameterizedTypeReference>>() {}; + response = new RestTemplate().exchange(url, HttpMethod.POST, null, tr); + } catch (NacosException e) { + e.printStackTrace(); + } + + if (response != null && (response.getStatusCode() == HttpStatus.OK)) { + List options = response.getBody().getData(); + if (options == null) { + System.out.println(6); + } + return options.stream().collect(Collectors.toMap(OptionResultDTO::getLabel, OptionResultDTO::getValue)); + } else { + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + }*/ + + } + + /** + * @description 合并表头 + * + * @param headList + * @return + * @author wxz + * @date 2021.10.27 16:17:34 + */ + private Map> mergeHead(List> headList) { + Map l1 = headList.get(0); + Map l2 = headList.get(1); + Map l3 = headList.get(2); + + String l1LastHeadName = ""; + String l2LastHeadName = ""; + + //Map resultMap = new HashMap<>(); + HashMap> result = new HashMap<>(); + + for (Map.Entry entry : l1.entrySet()) { + + StringBuilder headerNameConcatStr = new StringBuilder(); + + Integer key = entry.getKey(); + String l1TempValue = entry.getValue(); + + String l2TempValue = l2.get(key); + String l3TempValue = l3.get(key); + + if (StringUtils.isNotBlank(l1TempValue)) { + l1LastHeadName = l1TempValue; + } + + if (StringUtils.isNotBlank(l2TempValue)) { + l2LastHeadName = l2TempValue; + } + + // 开始拼接 + if (StringUtils.isNotBlank(l3TempValue)) { + //headerNameConcatStr.append(l1LastHeadName).append(":").append(l2LastHeadName).append(":").append(l3TempValue); + //resultMap.put(key, headerNameConcatStr.toString()); + ArrayList parts = new ArrayList<>(); + parts.add(l1LastHeadName); + parts.add(l2LastHeadName); + parts.add(l3TempValue); + result.put(key, parts); + continue; + } + + if (StringUtils.isNotBlank(l2TempValue)) { + //headerNameConcatStr.append(l1LastHeadName).append(":").append(l2LastHeadName); + //resultMap.put(key, headerNameConcatStr.toString()); + ArrayList parts = new ArrayList<>(); + parts.add(l1LastHeadName); + parts.add(l2LastHeadName); + result.put(key, parts); + continue; + } + + if (StringUtils.isNotBlank(l1TempValue)) { + //headerNameConcatStr.append(l1LastHeadName); + //resultMap.put(key, headerNameConcatStr.toString()); + ArrayList parts = new ArrayList<>(); + parts.add(l1LastHeadName); + result.put(key, parts); + continue; + } + + } + return result; + } + + /** + * @description 列信息封装 + * + * @return + * @author wxz + * @date 2021.10.28 22:18:05 + */ + @Data + public static class ColumnWrapper { + private String combinedLabel; + private String columnName; + private String itemType; + private String itemId; + private List colIndexs; + //private List colContents; + // 单元格内容 + private String cellContent; + // 数据库中列的值 + private String colValue; + + // key:label,value:value + private Map options; + + /** + * 选项来源,REMOTE;LOCAL;如果是动态加载的下拉框或者CHECKBOX等的情况下使用。URL:接口获取(LABEL,VALUE);JSON:直接从JSON中取 + */ + private String optionSourceType; + + /** + * 来源地址,REMOTE才有,固定格式;如果OPTIONS_SOURCE是URL,则此处填写要调用的接口的URL相对路径,例如:/API/GOV/ORG/XXXX。此处不应设置参数,若需要参数应当完全由后端,通过TOKEN信息来获取 + */ + private String optionSourceValue; + } + + /** + * desc:动态查询 某表的所有字段值 + * @param customerId + * @param formCode + * @param resultTableName + * @param conditions + * @return + */ + @Override + public List> dynamicQuery(String customerId, + String formCode, + String resultTableName, + List conditions){ + CustomerFormQueryDTO queryDTO=new CustomerFormQueryDTO(); + queryDTO.setCustomerId(customerId); + queryDTO.setFormCode(formCode); + Result> subTablesRes=operCustomizeOpenFeignClient.querySubTables(queryDTO); + List subTables=new ArrayList<>(); + if(subTablesRes.success()&&CollectionUtils.isNotEmpty(subTablesRes.getData())){ + subTables =subTablesRes.getData(); + } + return baseDao.dynamicQuery(customerId,resultTableName,conditions,subTables); + } + + /** + * @Description 查询个人数据 + * @param formDTO + * @author zxc + * @date 2021/11/3 9:21 上午 + */ + @Override + public PersonDataResultDTO personData(PersonDataFormDTO formDTO) { + baseDao.personData(formDTO.getUserId()); + // TODO + return null; + } + + /** + * @Description 根据名字搜索 + * @param formDTO + * @param tokenDto + * @author zxc + * @date 2021/11/3 1:42 下午 + */ + @Override + public List searchByName(SearchByNameFormDTO formDTO, TokenDto tokenDto) { + // 查询工作人员所属组织 + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); + if (null == staffInfo){ + throw new RenException("未查询到当前工作人员所属组织"); + } + Integer no = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize(); + PageInfo pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.searchByName(formDTO.getName(), staffInfo.getAgencyId(), no)); + List result = pageInfo.getList(); + // 查询小区,楼号,网格 + // TODO + if (CollectionUtils.isEmpty(result)){ + return new ArrayList<>(); + } + return result; + } + + /** + * desc:条件导出 + * + * + * @param formItemMap + * @param customerId + * @param formCode + * @param baseTableName + * @param conditions + * @return + */ + @Override + public Map> getDataForExport(Map formItemMap, String customerId, String formCode, String baseTableName, List conditions) { + List> mapList = this.dynamicQuery(customerId, formCode, baseTableName, conditions); + + Map> result = new LinkedHashMap<>(); + mapList.stream().filter(Objects::nonNull).forEach(map -> { + String resiId = (String) map.getOrDefault(UserConstant.IC_RESI_USER, ""); + formItemMap.forEach((k, v)->{ + Object temp = map.get(k); + if (temp != null) { + if (v.getOptionSourceType().equals("remote")) { + //todo 获取 options + } + if (v.getItemType().equals("checkbox")) { + v.getOptions().forEach(optionDTO -> { + map.put(optionDTO.getValue(), temp.toString().contains(optionDTO.getValue()) ? "是" : "否"); + }); + } else if (v.getItemType().equals("select")) { + v.getOptions().forEach(optionDTO -> { + map.put(optionDTO.getValue(), temp.toString().equals(optionDTO.getValue()) ? optionDTO.getLabel() : ""); + }); + + } + } + }); + if ("ic_resi_user".equals(baseTableName)) { + resiId = (String) map.get("ID"); + } + if (StringUtils.isBlank(resiId)){ + log.error("getDataForExport error,resiId:{}",resiId); + return; + } + result.put(resiId, map); + if (!"ic_resi_user".equals(baseTableName)) { + return; + } + Object gridId = map.get(UserConstant.GRID_ID); + if (gridId != null) { + CustomerGridFormDTO formDTO = new CustomerGridFormDTO(); + formDTO.setGridId(gridId.toString()); + Result gridInfoRes = govOrgOpenFeignClient.getGridBaseInfoByGridId(formDTO); + if (gridInfoRes != null && gridInfoRes.success() && gridInfoRes.getData() != null) { + map.put(UserConstant.GRID_ID, gridInfoRes.getData().getGridName()); + } + } + Object homeId = map.get(UserConstant.HOME_ID); + if (homeId != null) { + HashSet houseIds = new HashSet<>(); + houseIds.add(homeId.toString()); + Result> houseInfoRes = govOrgOpenFeignClient.queryListHouseInfo(houseIds); + if (houseInfoRes != null && houseInfoRes.success() && CollectionUtils.isNotEmpty(houseInfoRes.getData())) { + HouseInfoDTO houseInfoDTO = houseInfoRes.getData().get(NumConstant.ZERO); + map.put("VILLAGE_NAME", houseInfoDTO.getNeighborHoodName()); + map.put("BUILD_NAME", houseInfoDTO.getBuildingName()); + map.put("HOME_ID", houseInfoDTO.getDoorName()); + } + } + + }); + return result; + } +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffPatrolRecordServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffPatrolRecordServiceImpl.java index 12255c1153..0fbde4b393 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffPatrolRecordServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffPatrolRecordServiceImpl.java @@ -3,15 +3,16 @@ package com.epmet.service.impl; 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.StaffPatrolMQMsg; 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.ErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.PatrolConstant; +import com.epmet.constant.SystemMessageType; import com.epmet.dao.CustomerStaffDao; import com.epmet.dao.StaffPatrolDetailDao; import com.epmet.dao.StaffPatrolRecordDao; @@ -23,9 +24,10 @@ import com.epmet.dto.result.*; import com.epmet.entity.StaffPatrolDetailEntity; import com.epmet.entity.StaffPatrolRecordEntity; import com.epmet.entity.StatsStaffPatrolRecordDailyEntity; -import com.epmet.feign.GovOrgFeignClient; +import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.feign.GovProjectOpenFeignClient; +import com.epmet.send.SendMqMsgUtil; import com.epmet.service.StaffPatrolDetailService; import com.epmet.service.StaffPatrolRecordService; import com.epmet.util.DimIdGenerator; @@ -40,7 +42,6 @@ import javax.annotation.Resource; import java.util.ArrayList; import java.util.Date; import java.util.List; -import java.util.Objects; import java.util.stream.Collectors; /** @@ -55,25 +56,20 @@ public class StaffPatrolRecordServiceImpl extends BaseServiceImplsendPatrolMsg(e, SystemMessageType.USER_PATROL_STOP)); + } /** diff --git a/epmet-user/epmet-user-server/src/main/resources/excel/ic_resi_info_cid.xls b/epmet-user/epmet-user-server/src/main/resources/excel/ic_resi_info_cid.xls new file mode 100644 index 0000000000..33a4346d5b Binary files /dev/null and b/epmet-user/epmet-user-server/src/main/resources/excel/ic_resi_info_cid.xls differ diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiDemandDictDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiDemandDictDao.xml new file mode 100644 index 0000000000..d33235f4bf --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiDemandDictDao.xml @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file 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..12b430d2f3 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml @@ -0,0 +1,163 @@ + + + + + + + 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 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} + + + + + + + + + + + + + + + + + + \ No newline at end of file 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