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..18e0437551 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysDictDataController.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysDictDataController.java @@ -8,18 +8,21 @@ package com.epmet.controller; -import com.epmet.dto.SysDictDataDTO; -import com.epmet.service.SysDictDataService; -import com.epmet.commons.tools.constant.Constant; +import com.epmet.commons.tools.dto.form.DictListFormDTO; +import com.epmet.commons.tools.dto.result.DictListResultDTO; +import com.epmet.commons.tools.dto.result.OptionResultDTO; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.AssertUtils; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.SysDictDataDTO; +import com.epmet.service.SysDictDataService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import java.util.List; import java.util.Map; /** @@ -78,4 +81,73 @@ public class SysDictDataController { return new Result(); } + /** + * @Description 九小场所 + * @Param + * @Return {@link Result>} + * @Author zhaoqifeng + * @Date 2021/10/26 17:27 + */ + @PostMapping("ninesmallplaces") + public Result> getNineSmallPlacesOption() { + return new Result>().ok(sysDictDataService.getNineSmallPlacesOption()); + } + + /** + * @Description 文化程度 + * @Param + * @Return {@link Result>} + * @Author zhaoqifeng + * @Date 2021/10/26 17:27 + */ + @PostMapping("education") + public Result> getEducationOption() { + return new Result>().ok(sysDictDataService.getEducationOption()); + } + + /** + * @Description 民族 + * @Param + * @Return {@link Result>} + * @Author zhaoqifeng + * @Date 2021/10/26 17:27 + */ + @PostMapping("nation") + public Result> getNationOption() { + return new Result>().ok(sysDictDataService.getNationOption()); + } + + /** + * @Description 人员关系 + * @Param + * @Return {@link Result>} + * @Author zhaoqifeng + * @Date 2021/10/26 17:27 + */ + @PostMapping("relationship") + public Result> getRelationshipOption() { + return new Result>().ok(sysDictDataService.getRelationshipOption()); + } + + /** + * @Description 住房性质 + * @Param + * @Return {@link Result>} + * @Author zhaoqifeng + * @Date 2021/10/26 17:27 + */ + @PostMapping("house") + public Result> getHouseOption() { + return new Result>().ok(sysDictDataService.getHouseOption()); + } + + /** + * @Description 字典数据查询通用接口 + * @Author sun + */ + @PostMapping("dictlist") + public Result> dictList(@RequestBody DictListFormDTO formDTO) { + return new Result>().ok(sysDictDataService.dictList(formDTO.getDictType())); + } + } diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/dao/SysDictDataDao.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/dao/SysDictDataDao.java index 50528f1326..59ee893a89 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/dao/SysDictDataDao.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/dao/SysDictDataDao.java @@ -9,6 +9,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.commons.tools.dto.result.DictListResultDTO; import com.epmet.entity.DictData; import com.epmet.entity.SysDictDataEntity; import org.apache.ibatis.annotations.Mapper; @@ -27,4 +28,6 @@ public interface SysDictDataDao extends BaseDao { * 字典数据列表 */ List getDictDataList(); + + List selectDictList(String dictType); } diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/bean/log/LogOperationHelper.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/bean/log/LogOperationHelper.java index b8c82f6640..ce6502583e 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/bean/log/LogOperationHelper.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/bean/log/LogOperationHelper.java @@ -57,7 +57,7 @@ public class LogOperationHelper implements ResultDataResolver { form.setUserId(userId); Result result = userOpenFeignClient.getCustomerStaffInfoByUserId(form); CustomerStaffDTO staffInfo = getResultDataOrThrowsException(result, ServiceConstant.EPMET_ADMIN_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), - "调用epmet-user服务获取staff信息发生异常"); + "调用epmet-user服务获取staff信息发生异常", null); return new OperatorInfo(staffInfo.getCustomerId(), staffInfo.getMobile(), staffInfo.getRealName()); } } diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/SysDictDataService.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/SysDictDataService.java index 2e01f49d91..0d64ee0d8c 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,15 @@ package com.epmet.service; -import com.epmet.dto.SysDictDataDTO; import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.dto.form.DictListFormDTO; +import com.epmet.commons.tools.dto.result.DictListResultDTO; +import com.epmet.commons.tools.dto.result.OptionResultDTO; import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.SysDictDataDTO; import com.epmet.entity.SysDictDataEntity; +import java.util.List; import java.util.Map; /** @@ -31,5 +35,54 @@ public interface SysDictDataService extends BaseService { void update(SysDictDataDTO dto); void delete(Long[] ids); + /** + * 九小场所 + * @Param + * @Return {@link List} + * @Author zhaoqifeng + * @Date 2021/10/26 17:11 + */ + List getNineSmallPlacesOption(); + + /** + * 文化程度 + * @Param + * @Return {@link List} + * @Author zhaoqifeng + * @Date 2021/10/26 17:12 + */ + List getEducationOption(); + + /** + * 民族 + * @Param + * @Return {@link List} + * @Author zhaoqifeng + * @Date 2021/10/26 17:12 + */ + List getNationOption(); + + /** + * 人员关系 + * @Param + * @Return {@link List} + * @Author zhaoqifeng + * @Date 2021/10/26 17:12 + */ + List getRelationshipOption(); + + /** + * 住房性质 + * @Param + * @Return {@link List} + * @Author zhaoqifeng + * @Date 2021/10/26 17:12 + */ + List getHouseOption(); + /** + * @Description 字典数据查询通用接口 + * @Author sun + */ + List dictList(String dictType); } diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/LogOperationServiceImpl.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/LogOperationServiceImpl.java index 09b9269063..4ccc4e868f 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/LogOperationServiceImpl.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/LogOperationServiceImpl.java @@ -82,7 +82,7 @@ public class LogOperationServiceImpl implements LogOperationService, ResultDataR CustomerStaffFormDTO form = new CustomerStaffFormDTO(); form.setUserIds(new ArrayList<>(userIds)); Result> result = userOpenFeignClient.list(form); - List staffs = getResultDataOrThrowsException(result, ServiceConstant.EPMET_USER_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "调用user服务发生异常"); + List staffs = getResultDataOrThrowsException(result, ServiceConstant.EPMET_USER_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "调用user服务发生异常", null); HashMap staffMap = new HashMap<>(); staffs.forEach(s -> { @@ -103,7 +103,7 @@ public class LogOperationServiceImpl implements LogOperationService, ResultDataR form.setCustomerId(customerId); form.setMobile(operatorMobile); Result> result = userOpenFeignClient.list(form); - List staffs = getResultDataOrThrowsException(result, ServiceConstant.EPMET_USER_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "调用user服务发生异常"); + List staffs = getResultDataOrThrowsException(result, ServiceConstant.EPMET_USER_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "调用user服务发生异常", null); if (staffs.size() == 0) { return null; @@ -134,7 +134,7 @@ public class LogOperationServiceImpl implements LogOperationService, ResultDataR CustomerStaffFormDTO form = new CustomerStaffFormDTO(); form.setRealName(operatorName); Result> result = userOpenFeignClient.list(form); - List staffs = getResultDataOrThrowsException(result, ServiceConstant.EPMET_USER_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "调用user服务查询工作人员信息发生异常"); + List staffs = getResultDataOrThrowsException(result, ServiceConstant.EPMET_USER_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "调用user服务查询工作人员信息发生异常", null); List userIds = new ArrayList<>(); HashMap staffMap = new HashMap(); diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/SysDictDataServiceImpl.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/SysDictDataServiceImpl.java index 8a13891ab9..468fb764c7 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,13 @@ 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.form.DictListFormDTO; +import com.epmet.commons.tools.dto.result.DictListResultDTO; +import com.epmet.commons.tools.dto.result.OptionResultDTO; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.dao.SysDictDataDao; @@ -22,7 +26,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 +91,125 @@ public class SysDictDataServiceImpl extends BaseServiceImpl} + * @Author zhaoqifeng + * @Date 2021/10/26 17:11 + */ + @Override + public List getNineSmallPlacesOption() { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(SysDictDataEntity::getDictTypeId, 1000000000000000001L); + wrapper.orderByAsc(SysDictDataEntity::getSort); + List list = baseDao.selectList(wrapper); + return list.stream().map(item -> { + OptionResultDTO dto = new OptionResultDTO(); + dto.setValue(item.getDictValue()); + dto.setLabel(item.getDictLabel()); + dto.setSysDictDataId(item.getId().toString()); + return dto; + }).collect(Collectors.toList()); + } + + /** + * 文化程度 + * + * @Param + * @Return {@link List} + * @Author zhaoqifeng + * @Date 2021/10/26 17:12 + */ + @Override + public List getEducationOption() { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(SysDictDataEntity::getDictTypeId, 1000000000000000002L); + wrapper.orderByAsc(SysDictDataEntity::getSort); + List list = baseDao.selectList(wrapper); + return list.stream().map(item -> { + OptionResultDTO dto = new OptionResultDTO(); + dto.setValue(item.getDictValue()); + dto.setLabel(item.getDictLabel()); + return dto; + }).collect(Collectors.toList()); + } + + /** + * 民族 + * + * @Param + * @Return {@link List} + * @Author zhaoqifeng + * @Date 2021/10/26 17:12 + */ + @Override + public List getNationOption() { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(SysDictDataEntity::getDictTypeId, 1000000000000000003L); + wrapper.orderByAsc(SysDictDataEntity::getSort); + List list = baseDao.selectList(wrapper); + return list.stream().map(item -> { + OptionResultDTO dto = new OptionResultDTO(); + dto.setValue(item.getDictValue()); + dto.setLabel(item.getDictLabel()); + return dto; + }).collect(Collectors.toList()); + } + + /** + * 人员关系 + * + * @Param + * @Return {@link List} + * @Author zhaoqifeng + * @Date 2021/10/26 17:12 + */ + @Override + public List getRelationshipOption() { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(SysDictDataEntity::getDictTypeId, 1000000000000000004L); + wrapper.orderByAsc(SysDictDataEntity::getSort); + List list = baseDao.selectList(wrapper); + return list.stream().map(item -> { + OptionResultDTO dto = new OptionResultDTO(); + dto.setValue(item.getDictValue()); + dto.setLabel(item.getDictLabel()); + return dto; + }).collect(Collectors.toList()); + } + + /** + * 住房性质 + * + * @Param + * @Return {@link List} + * @Author zhaoqifeng + * @Date 2021/10/26 17:12 + */ + @Override + public List getHouseOption() { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(SysDictDataEntity::getDictTypeId, 1000000000000000005L); + wrapper.orderByAsc(SysDictDataEntity::getSort); + List list = baseDao.selectList(wrapper); + return list.stream().map(item -> { + OptionResultDTO dto = new OptionResultDTO(); + dto.setValue(item.getDictValue()); + dto.setLabel(item.getDictLabel()); + return dto; + }).collect(Collectors.toList()); + } + + /** + * @Description 字典数据查询通用接口 + * @Author sun + */ + @Override + public List dictList(String dictType) { + List resultDTOList = baseDao.selectDictList(dictType); + return resultDTOList; + } + } diff --git a/epmet-admin/epmet-admin-server/src/main/resources/mapper/SysDictDataDao.xml b/epmet-admin/epmet-admin-server/src/main/resources/mapper/SysDictDataDao.xml index b6c79a46bf..3760e0895a 100644 --- a/epmet-admin/epmet-admin-server/src/main/resources/mapper/SysDictDataDao.xml +++ b/epmet-admin/epmet-admin-server/src/main/resources/mapper/SysDictDataDao.xml @@ -7,4 +7,17 @@ select dict_type_id, dict_label, dict_value from sys_dict_data order by dict_type_id, sort + + diff --git a/epmet-auth/src/main/java/com/epmet/controller/IcLoinController.java b/epmet-auth/src/main/java/com/epmet/controller/IcLoinController.java new file mode 100644 index 0000000000..659945bddb --- /dev/null +++ b/epmet-auth/src/main/java/com/epmet/controller/IcLoinController.java @@ -0,0 +1,162 @@ +package com.epmet.controller; + +import cn.hutool.core.bean.BeanUtil; +import com.epmet.commons.tools.constant.AppClientConstant; +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.feign.ResultDataResolver; +import com.epmet.commons.tools.redis.RedisKeys; +import com.epmet.commons.tools.redis.RedisUtils; +import com.epmet.commons.tools.security.password.PasswordUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.CustomerStaffDTO; +import com.epmet.dto.form.LoginByPassWordFormDTO; +import com.epmet.dto.form.RootOrgListByStaffIdFormDTO; +import com.epmet.dto.result.StaffOrgsResultDTO; +import com.epmet.dto.result.UserTokenResultDTO; +import com.epmet.feign.EpmetUserFeignClient; +import com.epmet.feign.GovOrgOpenFeignClient; +import com.epmet.redis.CaptchaRedis; +import com.epmet.redis.IcLoginTicketCacheBean; +import com.epmet.service.IcLoginService; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.*; + +@RestController +@RequestMapping("ic") +public class IcLoinController implements ResultDataResolver { + + public static final long IC_LOGIN_TICKET_EXPIRE_SECONDS = 2 * 60l; + + @Autowired + private EpmetUserFeignClient epmetUserFeignClient; + + @Autowired + private GovOrgOpenFeignClient govOrgOpenFeignClient; + + @Autowired + private CaptchaRedis captchaRedis; + + @Autowired + private IcLoginService icLoginService; + + @Autowired + private RedisUtils redisUtils; + + /** + * @description 基层治理赋能平台-根据手机号密码获取组织列表 + * + * @param input + * @return + * @author wxz + * @date 2021.10.25 09:56:33 + */ + @PostMapping("getmyorgsbypassword") + public Result> getMyOrgsByPassword(@RequestBody LoginByPassWordFormDTO input) { + ValidatorUtils.validateEntity(input, LoginByPassWordFormDTO.IcGetOrgsByPwdGroup.class); + String captcha = input.getCaptcha(); + String mobile = input.getMobile(); + String password = input.getPassword(); + String uuid = input.getUuid(); + + // 图片验证码 + String captchaInCache = captchaRedis.getIcLoginCaptcha(uuid); + if (StringUtils.isBlank(captchaInCache) || !captcha.equals(captchaInCache)) { + throw new RenException(EpmetErrorCode.ERR10019.getCode()); + } + + // 获取用户信息 + Result> staffResult = epmetUserFeignClient.checkCustomerStaff(mobile); + List staffList = getResultDataOrThrowsException(staffResult, ServiceConstant.EPMET_USER_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【基层治理平台登录】获取用户信息失败", null); + if (CollectionUtils.isEmpty(staffList)) { + throw new RenException(EpmetErrorCode.ERR10003.getCode()); + } + + CustomerStaffDTO staffInfo = staffList.get(0); + + if (!PasswordUtils.matches(password, staffInfo.getPassword())) { + throw new RenException(EpmetErrorCode.ERR10004.getCode()); + } + + String staffId = staffInfo.getUserId(); + + // 查询跟组织列表 + RootOrgListByStaffIdFormDTO orgListForm = new RootOrgListByStaffIdFormDTO(); + orgListForm.setStaffId(staffId); + Result> orgListResult = govOrgOpenFeignClient.getStaffOrgListByStaffId(orgListForm); + List orgs = getResultDataOrThrowsException(orgListResult, ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【基层治理平台登录】根据staffId查询所属客户跟组织列表失败", null); + + // 生成登录票据 + String ticket = UUID.randomUUID().toString().replace("-", ""); + IcLoginTicketCacheBean ticketCacheBean = new IcLoginTicketCacheBean(); + ticketCacheBean.setMobile(mobile); + ticketCacheBean.setStaffId(staffId); + cacheTicket(ticket, ticketCacheBean); + + HashMap resultMap = new HashMap<>(); + resultMap.put("staffId", staffId); + resultMap.put("ticket", ticket); + resultMap.put("orgs", orgs); + + return new Result>().ok(resultMap); + } + + /** + * @description IC登录 + * + * @param input + * @return + * @author wxz + * @date 2021.10.25 21:14:22 + */ + @PostMapping("login") + public Result login(@RequestBody LoginByPassWordFormDTO input) { + ValidatorUtils.validateEntity(input, LoginByPassWordFormDTO.IcLoginGroup.class); + String ticket = input.getTicket(); + String orgId = input.getRootAgencyId(); + String staffId = input.getStaffId(); + + // ticket校验 + IcLoginTicketCacheBean ticketCache = getTicketCache(ticket); + if (ticketCache == null || !ticketCache.getStaffId().equals(staffId)) { + // ticket&userId不对应 + throw new RenException(EpmetErrorCode.ERR10008.getCode()); + } + + UserTokenResultDTO tokenInfo = icLoginService.login(staffId, orgId); + return new Result().ok(tokenInfo); + } + + private void cacheTicket(String ticket, IcLoginTicketCacheBean cacheBean) { + Map stringObjectMap = BeanUtil.beanToMap(cacheBean, false, true); + redisUtils.hMSet(RedisKeys.loginTicket(AppClientConstant.APP_IC, ticket), stringObjectMap, IC_LOGIN_TICKET_EXPIRE_SECONDS); + } + + /** + * @description 从缓存中取出ticket,并删除 + * + * @param ticket + * @return + * @author wxz + * @date 2021.10.26 08:58:27 + */ + private IcLoginTicketCacheBean getTicketCache(String ticket) { + String key = RedisKeys.loginTicket(AppClientConstant.APP_IC, ticket); + Map map = redisUtils.hGetAll(key); + if (CollectionUtils.sizeIsEmpty(map)) { + return null; + } + redisUtils.expire(key, 0); + return BeanUtil.mapToBean(map, IcLoginTicketCacheBean.class, false); + } + +} diff --git a/epmet-auth/src/main/java/com/epmet/controller/LoginController.java b/epmet-auth/src/main/java/com/epmet/controller/LoginController.java index f70495eb51..03a3139df2 100644 --- a/epmet-auth/src/main/java/com/epmet/controller/LoginController.java +++ b/epmet-auth/src/main/java/com/epmet/controller/LoginController.java @@ -65,6 +65,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/GovWebServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java index 965869be12..0bc1a8f7a0 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java @@ -3,6 +3,7 @@ package com.epmet.service.impl; import com.epmet.common.token.constant.LoginConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.security.dto.GovTokenDto; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.password.PasswordUtils; import com.epmet.commons.tools.utils.CpUserDetailRedis; @@ -45,6 +46,8 @@ public class GovWebServiceImpl implements GovWebService { private CpUserDetailRedis cpUserDetailRedis; @Autowired private EpmetUserFeignClient epmetUserFeignClient; + @Autowired + private ThirdLoginServiceImpl thirdLoginService; /** * @param formDTO @@ -105,7 +108,11 @@ public class GovWebServiceImpl implements GovWebService { String token = jwtTokenUtils.createToken(map); logger.info("app:" + formDTO.getApp() + ";client:" + formDTO.getClient() + ";userId:" + userId + ";生成token[" + token + "]"); int expire = jwtTokenProperties.getExpire(); - TokenDto tokenDto = new TokenDto(); + + String orgIdPath = thirdLoginService.getOrgIdPath(userId); + String[] orgIdPathParts = orgIdPath.split(":"); + + GovTokenDto tokenDto = new GovTokenDto(); tokenDto.setCustomerId(formDTO.getCustomerId()); tokenDto.setApp(formDTO.getApp()); tokenDto.setClient(formDTO.getClient()); @@ -113,6 +120,13 @@ public class GovWebServiceImpl implements GovWebService { tokenDto.setToken(token); tokenDto.setUpdateTime(System.currentTimeMillis()); tokenDto.setExpireTime(jwtTokenUtils.getExpiration(token).getTime()); + tokenDto.setAgencyId(orgIdPathParts[orgIdPathParts.length - 1]); + tokenDto.setRootAgencyId(orgIdPathParts[0]); + tokenDto.setDeptIdList(thirdLoginService.getDeptartmentIdList(userId)); + tokenDto.setGridIdList(thirdLoginService.getGridIdList(userId)); + tokenDto.setRoleList(thirdLoginService.queryGovStaffRoles(userId, orgIdPathParts[orgIdPathParts.length - 1])); + tokenDto.setOrgIdPath(orgIdPath); + cpUserDetailRedis.set(tokenDto, expire); logger.info("截止时间:" + DateUtils.format(jwtTokenUtils.getExpiration(token), "yyyy-MM-dd HH:mm:ss")); return token; diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/IcLoginServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/IcLoginServiceImpl.java new file mode 100644 index 0000000000..1e1767070e --- /dev/null +++ b/epmet-auth/src/main/java/com/epmet/service/impl/IcLoginServiceImpl.java @@ -0,0 +1,177 @@ +package com.epmet.service.impl; + +import cn.hutool.core.bean.BeanUtil; +import com.epmet.auth.constants.AuthOperationConstants; +import com.epmet.commons.rocketmq.messages.LoginMQMsg; +import com.epmet.commons.tools.constant.AppClientConstant; +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.feign.ResultDataResolver; +import com.epmet.commons.tools.redis.RedisKeys; +import com.epmet.commons.tools.redis.RedisUtils; +import com.epmet.commons.tools.security.dto.IcTokenDto; +import com.epmet.commons.tools.utils.CpUserDetailRedis; +import com.epmet.commons.tools.utils.IpUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.CustomerAgencyDTO; +import com.epmet.dto.form.SystemMsgFormDTO; +import com.epmet.dto.result.UserTokenResultDTO; +import com.epmet.feign.EpmetMessageOpenFeignClient; +import com.epmet.feign.GovOrgOpenFeignClient; +import com.epmet.jwt.JwtTokenProperties; +import com.epmet.jwt.JwtTokenUtils; +import com.epmet.service.IcLoginService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.servlet.http.HttpServletRequest; +import java.util.*; + +@Service +@Slf4j +public class IcLoginServiceImpl implements IcLoginService, ResultDataResolver { + + @Autowired + private JwtTokenUtils jwtTokenUtils; + + @Autowired + private RedisUtils redisUtils; + + @Autowired + private CpUserDetailRedis cpUserDetailRedis; + + @Autowired + private JwtTokenProperties jwtTokenProperties; + + @Autowired + private EpmetMessageOpenFeignClient messageOpenFeignClient; + + @Autowired + private GovOrgOpenFeignClient govOrgOpenFeignClient; + + @Autowired + private ThirdLoginServiceImpl thirdLoginService; + + @Override + public UserTokenResultDTO login(String staffId, String orgId) { + String app = AppClientConstant.APP_IC; + String client = AppClientConstant.CLIENT_WEB; + + // 1.获取用户token + String token = this.generateIcToken(staffId, app, client); + + Result agencyResult = govOrgOpenFeignClient.getAgencyById(orgId); + CustomerAgencyDTO agencyInfo = getResultDataOrThrowsException(agencyResult, ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【IC平台登录】获取组织信息失败", null); + + // 2.缓存token + cacheToken(app, client, staffId, token, orgId, agencyInfo.getCustomerId()); + + UserTokenResultDTO userTokenResultDTO = new UserTokenResultDTO(); + userTokenResultDTO.setToken(token); + userTokenResultDTO.setCustomerId(agencyInfo.getCustomerId()); + + //7.发送登录事件 + try { + sendLoginEvent(staffId, app, client); + } catch (RenException e) { + log.error(e.getInternalMsg()); + } catch (Exception e) { + log.error("【工作端workLogin登录】发送登录事件失败,程序继续执行。"); + } + + return userTokenResultDTO; + } + + /** + * @param staffId + * @return + * @description 生成Ic平台的Token + * @author wxz + * @date 2021.10.26 13:42:36 + */ + private String generateIcToken(String staffId, String app, String client) { + Map map = new HashMap<>(); + map.put("app", app); + map.put("client", client); + map.put("userId", staffId); + String token = jwtTokenUtils.createToken(map); + return token; + } + + /** + * @param userId + * @param fromApp + * @param fromClient + * @return + * @description 发布登录时间 + * @author wxz + * @date 2021.10.26 13:45:59 + */ + private void sendLoginEvent(String userId, String fromApp, String fromClient) { + HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); + + LoginMQMsg loginMQMsg = new LoginMQMsg(); + loginMQMsg.setUserId(userId); + loginMQMsg.setLoginTime(new Date()); + loginMQMsg.setIp(IpUtils.getIpAddr(request)); + loginMQMsg.setFromApp(fromApp); + loginMQMsg.setFromClient(fromClient); + + SystemMsgFormDTO form = new SystemMsgFormDTO(); + form.setMessageType(AuthOperationConstants.LOGIN); + form.setContent(loginMQMsg); + messageOpenFeignClient.sendSystemMsgByMQ(form); + } + + /** + * @description 缓存token到redis + * + * @param app + * @param client + * @param userId + * @param token + * @param rootAgencyId + * @return + * @author wxz + * @date 2021.10.26 14:19:07 + */ + private void cacheToken(String app, + String client, + String userId, + String token, + String rootAgencyId, + String customerId) { + + IcTokenDto tokenDto = new IcTokenDto(); + int expire = jwtTokenProperties.getExpire(); + long expireTime = jwtTokenUtils.getExpiration(token).getTime(); + + tokenDto.setApp(app); + tokenDto.setClient(client); + tokenDto.setUserId(userId); + tokenDto.setToken(token); + tokenDto.setExpireTime(expireTime); + tokenDto.setRootAgencyId(rootAgencyId); + tokenDto.setCustomerId(customerId); + + //设置部门,网格,角色列表 + tokenDto.setDeptIdList(thirdLoginService.getDeptartmentIdList(userId)); + tokenDto.setGridIdList(thirdLoginService.getGridIdList(userId)); + CustomerAgencyDTO agency = thirdLoginService.getAgencyByStaffId(userId); + if (agency != null) { + tokenDto.setAgencyId(agency.getId()); + tokenDto.setRoleList(thirdLoginService.queryGovStaffRoles(userId, agency.getId())); + } + tokenDto.setOrgIdPath(thirdLoginService.getOrgIdPath(userId)); + + String key = RedisKeys.getCpUserKey(app, client, userId); + Map map = BeanUtil.beanToMap(tokenDto, false, true); + redisUtils.hMSet(key, map, expire); + } + + +} diff --git a/epmet-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 fb5ae07412..93894c0bdb 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 @@ -65,4 +65,9 @@ public interface ConsomerGroupConstants { */ String OPEN_DATA_PROJECT_CHANGE_EVENT_LISTENER_GROUP = "open_data_project_change_event_listener_group"; + /** + * 开放的人员信息变更预警统计 + */ + String IC_WARN_STATS_EVENT_LISTENER_GROUP = "ic_warn_stats_event_listener_group"; + } 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 3f0c3066ec..13217da550 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 @@ -48,4 +48,9 @@ public interface TopicConstants { * 项目 */ String PROJECT = "project"; + + /** + * 项目 + */ + String IC_RESI_USER = "ic_resi_user"; } diff --git a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/IcResiUserAddMQMsg.java b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/IcResiUserAddMQMsg.java new file mode 100644 index 0000000000..328e7419cf --- /dev/null +++ b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/IcResiUserAddMQMsg.java @@ -0,0 +1,20 @@ +package com.epmet.commons.rocketmq.messages; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 居民信息新增、修改推送MQ + * @author sun + */ +@Data +public class IcResiUserAddMQMsg implements Serializable { + + //客户Id + private String customerId; + //居民ID + private String icResiUser; + + +} diff --git a/epmet-commons/epmet-commons-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 fd4a97d11e..a18f34f72b 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/StrConstant.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/StrConstant.java @@ -74,6 +74,10 @@ public interface StrConstant { */ String STAR="*"; + String QUESTION_MARK="?"; + String QUESTION_MARK_TRANSFER="\\?"; + String AND_MARK="&"; + /** * 空字符串 */ diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/DictListFormDTO.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/DictListFormDTO.java new file mode 100644 index 0000000000..1880debe42 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/DictListFormDTO.java @@ -0,0 +1,20 @@ +package com.epmet.commons.tools.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +/** + * @Description 字典数据查询-接口入参 + * @Author sun + */ +@Data +public class DictListFormDTO { + + /** + * 字典类型 + */ + @NotBlank(message = "字典类型不能为空") + private String dictType; + +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/DictListResultDTO.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/DictListResultDTO.java new file mode 100644 index 0000000000..fe89cf0d24 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/DictListResultDTO.java @@ -0,0 +1,17 @@ +package com.epmet.commons.tools.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description 字典数据查询-接口返参 + * @Author sun + */ +@Data +public class DictListResultDTO implements Serializable { + private static final long serialVersionUID = 8618231166600518980L; + private String label; + private String value; +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/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..158b59fb55 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/OptionResultDTO.java @@ -0,0 +1,20 @@ +package com.epmet.commons.tools.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2021/10/26 13:53 + */ +@Data +public class OptionResultDTO implements Serializable { + private static final long serialVersionUID = 8618231166600518980L; + private String label; + private String value; + private String sysDictDataId; + private List children; +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/FormItemTypeEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/FormItemTypeEnum.java new file mode 100644 index 0000000000..753852bfff --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/FormItemTypeEnum.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.epmet.commons.tools.enums; + +/** + * form表单 配置item类型 枚举 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public enum FormItemTypeEnum { + //枚举类型 + INPUT("input", "输入框"), + RADIO("radio", "单选框"), + CHECKBOX("checkbox", "复选框"), + SELECT("select", "下拉框"), + TEXTAREA("textarea", "文本域"), + CASCADER("cascader", "及联"), + DATE_PICKER("datepicker", "组织"), + UN_KNOWN("un_known", "不支持的类型"); + + private String code; + private String desc; + + FormItemTypeEnum(String value,String name) { + this.code = value; + this.desc = name; + } + + public static FormItemTypeEnum getEnum(String code) { + FormItemTypeEnum[] values = FormItemTypeEnum.values(); + for (FormItemTypeEnum value : values) { + if (value.getCode().equals(code)) { + return value; + } + } + return UN_KNOWN; + } + + public String getCode() { + return code; + } + + public String getDesc() { + return desc; + } +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/GenderEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/GenderEnum.java new file mode 100644 index 0000000000..5604377ed5 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/GenderEnum.java @@ -0,0 +1,44 @@ +package com.epmet.commons.tools.enums; + +import com.epmet.commons.tools.exception.EpmetErrorCode; + +public enum GenderEnum { + MAN("1", "男"), + WOMAN("2", "女"), + UN_KNOWN("0", "未知"); + + private String code; + private String name; + + + GenderEnum(String code, String name) { + this.code = code; + this.name = name; + } + + public static String getName(String code) { + GenderEnum[] genderEnums = values(); + for (GenderEnum genderEnum : genderEnums) { + if (genderEnum.getCode() == code) { + return genderEnum.getName(); + } + } + return EpmetErrorCode.SERVER_ERROR.getMsg(); + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/HouseTypeEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/HouseTypeEnum.java new file mode 100644 index 0000000000..c86ff94d4e --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/HouseTypeEnum.java @@ -0,0 +1,45 @@ +package com.epmet.commons.tools.enums; + +import com.epmet.commons.tools.exception.EpmetErrorCode; + +public enum HouseTypeEnum { + //房屋类型,1楼房,2平房,3别墅 + LOUFANG("1", "楼房"), + PINGFANG("2", "平房"), + BIESHU("3", "别墅"); + + private String code; + private String name; + + + HouseTypeEnum(String code, String name) { + this.code = code; + this.name = name; + } + + public static String getName(String code) { + HouseTypeEnum[] houseTypeEnums = values(); + for (HouseTypeEnum houseTypeEnum : houseTypeEnums) { + if (houseTypeEnum.getCode() == code) { + return houseTypeEnum.getName(); + } + } + return EpmetErrorCode.SERVER_ERROR.getMsg(); + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RelationshipEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RelationshipEnum.java new file mode 100644 index 0000000000..39a0f81550 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RelationshipEnum.java @@ -0,0 +1,58 @@ +package com.epmet.commons.tools.enums; + +/** + * @author Administrator + */ + +public enum RelationshipEnum { + /** + * 环境变量枚举 + */ + UN_KNOWN("0", "暂不清楚", 0), + SELF("1", "本人", 1), + spouse("2", "配偶", 2), + CHILD("3", "子女", 3), + PARENT("4", "父母", 4), + PARENT_IN_LAW("5", "岳父母或公婆", 5), + GRANDPARENT_IN_LAW("6", "祖父母", 6), + CHILD_IN_LAW("7", "媳婿", 7), + GRANDCHILD("8", "孙子女", 8), + BROTHER_AND_SISTER("9", "兄弟姐妹", 9), + OTHER("10", "其他", 10), + ; + + private final String code; + private final String name; + private final Integer sort; + + + + RelationshipEnum(String code, String name, Integer sort) { + this.code = code; + this.name = name; + this.sort = sort; + } + + public static RelationshipEnum getEnum(String code) { + RelationshipEnum[] values = RelationshipEnum.values(); + for (RelationshipEnum value : values) { + if (value.getCode().equals(code)) { + return value; + } + } + return RelationshipEnum.UN_KNOWN; + } + + + public String getCode() { + return code; + } + + public String getName() { + return name; + } + + public Integer getSort(){ + return sort; + } +} \ No newline at end of file diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index ff06b69642..39b11650a8 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 @@ -22,6 +22,7 @@ public enum EpmetErrorCode { ERR10005(10005, "token不能为空"), ERR10006(10006, "登录超时,请重新登录"), ERR10007(10007, "当前帐号已在别处登录"), + ERR10008(10008, "Ticket错误"), ERR10019(10019, "验证码不正确"), SYSTEM_MQ_MSG_SEND_FAIL(10020, "MQ消息发送失败"), ERR401(401, "未授权"), @@ -79,6 +80,11 @@ public enum EpmetErrorCode { SET_PARENT_AREA_CODE(8210,"请先设置上级组织区划"), HAVE_GUIDE_CANNOT_DEL(8211,"当前分类已经存在办事指南,不允许删除"), GUIDE_CATEGORY_NAME_EXITS(8212,"分类已存在"), + CUSTOMER_FORM_NOT_EXITS(8213,"客户未配置表单"), + RESI_NOT_FOUND(8214,"居民信息找不到"), + BUILDING_NAME_EXITED(8215,"楼栋名称已存在"), + DOOR_NAME_EXITED(8216,"门牌号已存在"), + NEIGHBOOR_NAME_EXITED(8217,"小区名称已存在"), REQUIRE_PERMISSION(8301, "您没有足够的操作权限"), THIRD_PLAT_REQUEST_ERROR(8302, "请求第三方平台错误"), @@ -217,6 +223,10 @@ public enum EpmetErrorCode { UP_LIMIT_POINT(8917,"积分上限需为单位积分倍数,请重新调整保存"), BADGE_CHECK(8918,""), + ORG_ADD_FAILED(8919,"添加失败"), + ORG_EDIT_FAILED(8920,"编辑失败"), + ORG_DEL_FAILED(8921,"删除失败"), + //通用错误码 start //通用的 错误消息自己定义返回 diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/ResultDataResolver.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/ResultDataResolver.java index 5b56e64b1a..1bfa31e96b 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/ResultDataResolver.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/ResultDataResolver.java @@ -34,18 +34,19 @@ public interface ResultDataResolver { * @return * @param targetServiceName 目标service名称 * @param errorCode 错误码,可以为空,为空则使用上游服务抛出的错误码 - * @param errorInternalMsg 错误信息,可以为空,为空则使用上游服务抛出的异常信息 + * @param errorInternalMsg 内部错误信息,可以为空,为空则使用上游服务抛出的异常信息 + * @param showMsg 展示给前端程序的错误信息,可以为空。为空则根据errorCode给定错误msg信息 * @author wxz * @date 2021.06.07 22:45 */ - default R getResultDataOrThrowsException(Result result, String targetServiceName, Integer errorCode, String errorInternalMsg) { + default R getResultDataOrThrowsException(Result result, String targetServiceName, Integer errorCode, String errorInternalMsg, String showMsg) { if (result == null) { throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), "调用{}服务发生错误,返回Result为null", targetServiceName); } if (!result.success()) { Integer finalErrorCode = errorCode == null ? result.getCode() : errorCode; String finalErrorInternalMsg = StringUtils.isBlank(errorInternalMsg) ? result.getInternalMsg() : errorInternalMsg; - throw new RenException(finalErrorCode, finalErrorInternalMsg); + throw new RenException(finalErrorCode, finalErrorInternalMsg, showMsg, RenException.MessageMode.CODE_INTERNAL_EXTERNAL); } return result.getData(); } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java index 2ac7d19f96..fce9a8cf85 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 @@ -39,6 +39,13 @@ public class RedisKeys { return rootPrefix.concat("sys:captcha:").concat(uuid); } + /** + * 登录验证码Key + */ + public static String getIcLoginCaptchaKey(String uuid) { + return rootPrefix.concat("sys:captcha:iclogin:").concat(uuid); + } + /** * 登录用户Key */ @@ -561,6 +568,61 @@ public class RedisKeys { 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 getIcFormKeyForAdd(String formCode,String customerId) { + return rootPrefix.concat("icform:").concat(formCode).concat(":add:").concat(customerId); + } + + public static String getIcFormKeyForExport(String formCode,String customerId) { + return rootPrefix.concat("icform:").concat(formCode).concat(":export:").concat(customerId); + } + + /** + * icd form items key + * @param customerId + * @param formCode + * @return + */ + public static String getIcFormItemsKey(String customerId, String formCode) { + return rootPrefix.concat("icform:").concat(formCode).concat(":items:").concat(customerId); + } + + /** + * desc:导出居民信息时 临时存储居民信息 便于其他sheet复用信息 + * @param resiId + * @return + */ + public static String getExportResiBaseInfoKey(String resiId) { + return rootPrefix.concat("resi:").concat("export").concat(":temp:").concat(resiId); + } + + /** + * desc:获取客户的居民下载模版是否变更的key 1表示变更 0没有变更 + * @param customerId + * @return + */ + public static String getResiTempChangedKey(String customerId) { + return rootPrefix.concat("resi:").concat("export").concat(":template:changed").concat(customerId); + } + /** * desc:获取执行完毕的 业务 参数结果key * @param bizMethod diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/dto/IcTokenDto.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/dto/IcTokenDto.java new file mode 100644 index 0000000000..de61615504 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/dto/IcTokenDto.java @@ -0,0 +1,81 @@ +package com.epmet.commons.tools.security.dto; + +import com.alibaba.fastjson.JSON; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; +import java.util.Set; + +/** + * @Description ic平台token + * @author wxz + * @date 2021.10.26 13:58:03 +*/ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class IcTokenDto extends BaseTokenDto { + + /** + * 当前登录的组织id(顶级) + */ + private String rootAgencyId; + + /** + * 当前用户所属的机关单位id + */ + private String agencyId; + + /** + * 当前网格对应的组织结构id的全路径用:隔开 + */ + private String orgIdPath; + + /** + * 当前所在网格id + */ + private String gridId; + + /*** + * 所在网格列表 + */ + private Set gridIdList; + + /** + * 部门id列表 + */ + private Set deptIdList; + + /** + * 功能权限列表,实际上是gov_staff => staff_role => role_operation查询到的operationKey + */ + private Set permissions; + + /** + * 角色ID列表 + */ + private List roleList; + + /** + * 过期时间戳 + */ + private Long expireTime; + + @Data + public static class Role { + + private String id; + private String roleKey; + private String roleName; + + public Role() { + } + } + + @Override + public String toString() { + return JSON.toJSONString(this); + } +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/user/LoginUserUtil.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/user/LoginUserUtil.java index bb5e6f7b5d..70307f6551 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/user/LoginUserUtil.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/user/LoginUserUtil.java @@ -6,7 +6,6 @@ import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Component; import javax.servlet.http.HttpServletRequest; -import java.util.Enumeration; import java.util.List; /** @@ -35,18 +34,6 @@ public class LoginUserUtil { return userId; } - /** - * 查询登录用户的客户Id - * @return - */ - public String getCurrentCustomerId() { - HttpServletRequest request = HttpContextUtils.getHttpServletRequest(); - if (request == null) { - return null; - } - return request.getHeader(AppClientConstant.CUSTOMER_ID); - } - /** * 登录用户的App头信息 * @return diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/IpUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/IpUtils.java index d051717d8d..8aabf5f5d9 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/IpUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/IpUtils.java @@ -12,6 +12,7 @@ import com.epmet.commons.tools.constant.StrConstant; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.cloud.commons.util.InetUtils; import org.springframework.http.HttpHeaders; import org.springframework.http.server.reactive.ServerHttpRequest; @@ -127,12 +128,12 @@ public class IpUtils { * 遍历本地网卡的方式,在云平台虚拟机取不到真正的ip * @return */ - InetAddress localAddress = InetAddress.getLocalHost(); - if (isValidAddress(localAddress)) { - return localAddress.getHostAddress(); + InetUtils inetUtils = SpringContextUtils.getBean(InetUtils.class); + if (inetUtils == null || inetUtils.findFirstNonLoopbackHostInfo() == null) { + logger.warn("Could not get local host ip address"); + } else { + SERVER_IP = inetUtils.findFirstNonLoopbackHostInfo().getIpAddress(); } - logger.warn("Could not get local host ip address"); - return null; } catch (Exception e) { logger.error("IpUtils getServerIp exception ", e); } diff --git a/epmet-gateway/src/main/java/com/epmet/config/CorsConfig.java b/epmet-gateway/src/main/java/com/epmet/config/CorsConfig.java index bb95213c1f..72a2e0a31f 100644 --- a/epmet-gateway/src/main/java/com/epmet/config/CorsConfig.java +++ b/epmet-gateway/src/main/java/com/epmet/config/CorsConfig.java @@ -117,7 +117,7 @@ class EpmetWebFilter implements WebFilter, ResultDataResolver { adminOpenFeignClient.list(), ServiceConstant.EPMET_ADMIN_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), - "调用Admin服务查询Cors配置失败"); + "调用Admin服务查询Cors配置失败", null); } catch (Exception e) { logger.error("调用Admin服务查询Cors配置失败"); } diff --git a/epmet-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-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerAgencyDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerAgencyDao.java index bd29030255..3ecfd18a2d 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerAgencyDao.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerAgencyDao.java @@ -24,6 +24,7 @@ import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; +import java.util.Set; /** * 机关单位信息表 @@ -98,4 +99,5 @@ public interface CustomerAgencyDao extends BaseDao { * @Date 2021/9/23 10:16 */ List getOrgList(@Param("staffId") String staffId); + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/opercustomize/CustomerFootBarDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/opercustomize/CustomerFootBarDao.java index 7d5d11dda7..4d5ab737b5 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/opercustomize/CustomerFootBarDao.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/opercustomize/CustomerFootBarDao.java @@ -19,11 +19,13 @@ package com.epmet.dataaggre.dao.opercustomize; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dataaggre.dto.app.result.CustomerFootBarDTO; +import com.epmet.dataaggre.dto.epmetuser.IcFormResColumnDTO; import com.epmet.dataaggre.entity.opercustomize.CustomerFootBarEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; +import java.util.Set; /** * APP底部菜单栏信息 @@ -56,4 +58,5 @@ public interface CustomerFootBarDao extends BaseDao { * @date 2021/7/28 10:56 */ CustomerFootBarEntity selectDefaultIcon(@Param("customerId") String customerId, @Param("appType")String appType, @Param("barKey")String barKey); + } \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java index 77c8c33d0f..0509c9c129 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 @@ -172,4 +172,5 @@ public interface GovOrgService { * @date 2021/11/5 2:57 下午 */ CustomerGridDTO getGridInfo(String gridId); + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java index db39899f4f..79dafa6741 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java @@ -555,4 +555,5 @@ public class GovOrgServiceImpl implements GovOrgService { return customerGridDao.getGridInfo(gridId); } + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/QuestionnaireServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/QuestionnaireServiceImpl.java index 1c6aab452d..2d69ac0fb3 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/QuestionnaireServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/QuestionnaireServiceImpl.java @@ -73,7 +73,7 @@ public class QuestionnaireServiceImpl implements QuestionnaireService, ResultDat CustomerGridFormDTO form = new CustomerGridFormDTO(); form.setGridId(gridId); Result gridInfoResult = govOrgOpenFeignClient.getGridBaseInfoByGridId(form); - CustomerGridDTO gridInfo = getResultDataOrThrowsException(gridInfoResult, ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【调查问卷】校验访问权限,查询网格信息失败"); + CustomerGridDTO gridInfo = getResultDataOrThrowsException(gridInfoResult, ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【调查问卷】校验访问权限,查询网格信息失败", null); // 网格父级ID列表:网格ID(拼接起来,冒号分割) String gridIdPath = gridInfo.getPids().concat(":").concat(gridInfo.getId()); List publishRangeEntity = prPublishRangeService.getPublishRangeEntity(projectKey); diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercustomize/CustomerFootBarService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercustomize/CustomerFootBarService.java index b185b9746a..810122f74c 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercustomize/CustomerFootBarService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercustomize/CustomerFootBarService.java @@ -39,4 +39,5 @@ public interface CustomerFootBarService extends BaseService + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/pom.xml b/epmet-module/data-statistical/data-statistical-server/pom.xml index ee06a21330..ff00165afd 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 + 3.0.3 + + + poi + org.apache.poi + + + poi-ooxml + org.apache.poi + + + poi-ooxml-schemas + org.apache.poi + + io.github.wnjustdoit diff --git a/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/read/CustomStringStringConverter.java b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/read/CustomStringStringConverter.java index 584e563a77..8f17f53f13 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/read/CustomStringStringConverter.java +++ b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/read/CustomStringStringConverter.java @@ -2,8 +2,9 @@ package com.epmet.stats.test.read; import com.alibaba.excel.converters.Converter; import com.alibaba.excel.enums.CellDataTypeEnum; -import com.alibaba.excel.metadata.CellData; import com.alibaba.excel.metadata.GlobalConfiguration; +import com.alibaba.excel.metadata.data.ReadCellData; +import com.alibaba.excel.metadata.data.WriteCellData; import com.alibaba.excel.metadata.property.ExcelContentProperty; /** @@ -13,7 +14,7 @@ import com.alibaba.excel.metadata.property.ExcelContentProperty; */ public class CustomStringStringConverter implements Converter { @Override - public Class supportJavaTypeKey() { + public Class supportJavaTypeKey() { return String.class; } @@ -34,8 +35,8 @@ public class CustomStringStringConverter implements Converter { * @return */ @Override - public String convertToJavaData(CellData cellData, ExcelContentProperty contentProperty, - GlobalConfiguration globalConfiguration) { + public String convertToJavaData(ReadCellData cellData, ExcelContentProperty contentProperty, + GlobalConfiguration globalConfiguration) { return "自定义:" + cellData.getStringValue(); } @@ -51,9 +52,9 @@ public class CustomStringStringConverter implements Converter { * @return */ @Override - public CellData convertToExcelData(String value, ExcelContentProperty contentProperty, - GlobalConfiguration globalConfiguration) { - return new CellData(value); + public WriteCellData convertToExcelData(String value, ExcelContentProperty contentProperty, + GlobalConfiguration globalConfiguration) { + return new WriteCellData<>(value); } } diff --git a/epmet-module/epmet-demo/epmet-demo-server/pom.xml b/epmet-module/epmet-demo/epmet-demo-server/pom.xml index 00a03e4aab..2a2ee9e597 100644 --- a/epmet-module/epmet-demo/epmet-demo-server/pom.xml +++ b/epmet-module/epmet-demo/epmet-demo-server/pom.xml @@ -13,6 +13,25 @@ jar + + com.alibaba + easyexcel + 3.0.3 + + + poi + org.apache.poi + + + poi-ooxml + org.apache.poi + + + poi-ooxml-schemas + org.apache.poi + + + com.epmet epmet-commons-tools diff --git a/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/utils/ExcelPaseTest.java b/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/utils/ExcelPaseTest.java new file mode 100644 index 0000000000..6b277bd0d7 --- /dev/null +++ b/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/utils/ExcelPaseTest.java @@ -0,0 +1,58 @@ +package com.epmet.utils; + +import com.alibaba.excel.EasyExcelFactory; + +import java.io.File; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** + * @description excel解析 + * + * @return + * @author wxz + * @date 2021.10.28 13:36:26 + */ +public class ExcelPaseTest { + + public static void main(String[] args) { + new ExcelPaseTest().sqlizeGridNameAndCodeFromExcel(); + } + + /** + * @description 读取excel,生成根据网格name更新网格code的sql + * + * @param + * @return + * @author wxz + * @date 2021.10.28 13:34:31 + */ + public void sqlizeGridNameAndCodeFromExcel() { + TempDynamicEasyExcelListener readListener = new TempDynamicEasyExcelListener(); + EasyExcelFactory.read(new File("/Users/wangxianzhang/Documents/1027平阴县网格编码及人员统计表.xls"), IndexOrNameData.class, readListener).headRowNumber(4).sheet(0).doRead(); + List> headList = readListener.getHeadList(); + List dataList = readListener.getDataList(); + + List exceptList = new ArrayList<>(); + + for (IndexOrNameData data : dataList) { + String content = data.getColumn(); + + int startIndex = content.indexOf("370"); + if (startIndex == -1) { + exceptList.add(content); + } else { + String gridName = content.substring(0, startIndex).trim(); + String gridCode = content.substring(startIndex); + String sqlPattern = String.format("update customer_grid set CODE='%s' where GRID_NAME='%s';", gridCode, gridName); + System.out.println(sqlPattern); + } + } + + System.err.println("========异常行======="); + for (String s : exceptList) { + System.err.println(s); + } + } +} diff --git a/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/utils/IndexOrNameData.java b/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/utils/IndexOrNameData.java new file mode 100644 index 0000000000..920b9e66b5 --- /dev/null +++ b/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/utils/IndexOrNameData.java @@ -0,0 +1,20 @@ +package com.epmet.utils; + +import com.alibaba.excel.annotation.ExcelProperty; +import lombok.Data; + +@Data +public class IndexOrNameData { + /** + * 强制读取第三个 这里不建议 index 和 name 同时用,要么一个对象只用index,要么一个对象只用name去匹配 + */ + @ExcelProperty(index = 3) + private String column; + ///** + // * 用名字去匹配,这里需要注意,如果名字重复,会导致只有一个字段读取到数据 + // */ + //@ExcelProperty("字符串标题") + //private String string; + //@ExcelProperty("日期标题") + //private Date date; +} \ No newline at end of file diff --git a/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/utils/TempDynamicEasyExcelListener.java b/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/utils/TempDynamicEasyExcelListener.java new file mode 100644 index 0000000000..cc870c58cc --- /dev/null +++ b/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/utils/TempDynamicEasyExcelListener.java @@ -0,0 +1,82 @@ +package com.epmet.utils; + +import com.alibaba.excel.context.AnalysisContext; +import com.alibaba.excel.event.AnalysisEventListener; +import com.alibaba.fastjson.JSON; +import lombok.extern.slf4j.Slf4j; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** + * 创建一个监听器 + */ +@Slf4j +public class TempDynamicEasyExcelListener extends AnalysisEventListener { + + /** + * 表头数据(存储所有的表头数据) + */ + private List> headList = new ArrayList<>(); + + /** + * 数据体 + */ + private List dataList = new ArrayList<>(); + + /** + * 这里会一行行的返回头 + * + * @param headMap + * @param context + */ + //@Override + //public void invokeHeadMap(IcResiUserController.IndexOrNameData headMap, AnalysisContext context) { + // log.info("解析到一条头数据:{}", JSON.toJSONString(headMap)); + // //存储全部表头数据 + // headList.add(headMap); + //} + + + @Override + public void invokeHeadMap(Map headMap, AnalysisContext context) { + log.info("解析到一条头数据:{}", JSON.toJSONString(headMap)); + //存储全部表头数据 + headList.add(headMap); + } + + /** + * 这个每一条数据解析都会来调用 + * + * @param data + * one row value. Is is same as {@link AnalysisContext#readRowHolder()} + * @param context + */ + @Override + public void invoke(IndexOrNameData data, AnalysisContext context) { + //log.info("解析到一条数据:{}", JSON.toJSONString(data)); + if (data.getColumn() != null) { + dataList.add(data); + } + } + + /** + * 所有数据解析完成了 都会来调用 + * + * @param context + */ + @Override + public void doAfterAllAnalysed(AnalysisContext context) { + // 这里也要保存数据,确保最后遗留的数据也存储到数据库 + log.info("所有数据解析完成!"); + } + + public List> getHeadList() { + return headList; + } + + public List getDataList() { + return dataList; + } +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/UserDemandNameQueryFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/UserDemandNameQueryFormDTO.java new file mode 100644 index 0000000000..3247482054 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/UserDemandNameQueryFormDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto.form.demand; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotEmpty; +import java.io.Serializable; +import java.util.Set; + +@Data +public class UserDemandNameQueryFormDTO implements Serializable { + private static final long serialVersionUID = 1562457999313501989L; + + public interface AddUserInternalGroup {} + + @NotBlank(message = "客户idbu不能为空",groups =AddUserInternalGroup.class) + private String customerId; + + @NotEmpty(message = "分类编码不能为空",groups =AddUserInternalGroup.class) + private Set codeSet; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java index b9f4424ab3..7a4a6c8ad5 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java @@ -5,7 +5,7 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.dto.ActInfoDTO; import com.epmet.dto.VolunteerInfoDTO; import com.epmet.dto.form.CommonCustomerFormDTO; -import com.epmet.feign.fallback.EpmetHeartOpenFeignClientFallback; +import com.epmet.dto.form.demand.UserDemandNameQueryFormDTO; import com.epmet.feign.fallback.EpmetHeartOpenFeignClientFallbackFactory; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.PathVariable; @@ -53,4 +53,7 @@ public interface EpmetHeartOpenFeignClient { **/ @PostMapping("/heart/resi/volunteer/queryuservolunteerinfo/{userId}") Result queryUserVolunteerInfo(@PathVariable("userId") String userId); + + @PostMapping("/heart/icresidemanddict/demangnames") + Result queryDemandNames(@RequestBody UserDemandNameQueryFormDTO formDTO); } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java index 23759f82c0..e0e140b02e 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java @@ -6,8 +6,8 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.dto.ActInfoDTO; import com.epmet.dto.VolunteerInfoDTO; import com.epmet.dto.form.CommonCustomerFormDTO; +import com.epmet.dto.form.demand.UserDemandNameQueryFormDTO; import com.epmet.feign.EpmetHeartOpenFeignClient; -import org.springframework.stereotype.Component; import java.util.List; @@ -48,4 +48,9 @@ public class EpmetHeartOpenFeignClientFallback implements EpmetHeartOpenFeignCli public Result queryUserVolunteerInfo(String userId) { return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "queryUserVolunteerInfo", userId); } + + @Override + public Result queryDemandNames(UserDemandNameQueryFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "queryDemandNames", formDTO); + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcResiDemandDictController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcResiDemandDictController.java new file mode 100644 index 0000000000..13779cfe13 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcResiDemandDictController.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.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.dto.form.demand.UserDemandNameQueryFormDTO; +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())); + } + + + /** + * 居民信息列表需要展示分类名称,单独开出来这个接口,供user查询 + * @param formDTO + * @return + */ + @PostMapping("demangnames") + public Result queryDemandNames(@RequestBody UserDemandNameQueryFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO,UserDemandNameQueryFormDTO.AddUserInternalGroup.class); + return icResiDemandDictService.queryDemandNames(formDTO); + } +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcResiDemandDictDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcResiDemandDictDao.java new file mode 100644 index 0000000000..94fd335929 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcResiDemandDictDao.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.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; +import java.util.Set; + +/** + * 居民需求字典表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-27 + */ +@Mapper +public interface IcResiDemandDictDao extends BaseDao { + List selectDemandOptions(@Param("customerId") String customerId); + List selectChildDemands(@Param("customerId")String customerId, @Param("parentCode") String parentCode); + + String selectCategoryNames(@Param("customerId") String customerId,@Param("codeSet") Set codeSet); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcResiDemandDictEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcResiDemandDictEntity.java new file mode 100644 index 0000000000..5e01dd2b14 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-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-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcResiDemandDictService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcResiDemandDictService.java new file mode 100644 index 0000000000..d41c4303ba --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcResiDemandDictService.java @@ -0,0 +1,114 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.dto.result.OptionResultDTO; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.IcResiDemandDictDTO; +import com.epmet.dto.form.demand.UserDemandNameQueryFormDTO; +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); + + /** + * 居民信息列表需要展示分类名称,单独开出来这个接口,供user查询 + * @param formDTO + * @return + */ + Result queryDemandNames(UserDemandNameQueryFormDTO formDTO); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcResiDemandDictServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcResiDemandDictServiceImpl.java new file mode 100644 index 0000000000..fb23a85fe8 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcResiDemandDictServiceImpl.java @@ -0,0 +1,120 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.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.commons.tools.utils.Result; +import com.epmet.dao.IcResiDemandDictDao; +import com.epmet.dto.IcResiDemandDictDTO; +import com.epmet.dto.form.demand.UserDemandNameQueryFormDTO; +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); + } + + @Override + public Result queryDemandNames(UserDemandNameQueryFormDTO formDTO) { + return new Result().ok(baseDao.selectCategoryNames(formDTO.getCustomerId(),formDTO.getCodeSet())); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcResiDemandDictDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcResiDemandDictDao.xml new file mode 100644 index 0000000000..ae0c5a1e7f --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcResiDemandDictDao.xml @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file 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 84580a3b4a..5d6cd6190c 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 @@ -85,4 +85,19 @@ public interface SystemMessageType { */ String PROJECT_EDIT = "project_edit"; + /** + * 居民信息添加 + */ + String IC_RESI_USER_ADD = "ic_resi_user_add"; + + /** + * 居民信息修改 + */ + String IC_RESI_USER_EDIT = "ic_resi_user_edit"; + + /** + * 居民信息删除 + */ + String IC_RESI_USER_DEL = "ic_resi_user_del"; + } 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 61373708df..c57bd798f6 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 @@ -187,6 +187,11 @@ public class SystemMessageServiceImpl implements SystemMessageService { case SystemMessageType.PROJECT_EDIT: topic = TopicConstants.PROJECT; break; + case SystemMessageType.IC_RESI_USER_ADD: + case SystemMessageType.IC_RESI_USER_EDIT: + case SystemMessageType.IC_RESI_USER_DEL: + topic = TopicConstants.IC_RESI_USER; + break; } return topic; } diff --git a/epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/feign/OssFeignClient.java b/epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/feign/OssFeignClient.java index b5c31ef82f..db8cda16cf 100644 --- a/epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/feign/OssFeignClient.java +++ b/epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/feign/OssFeignClient.java @@ -11,13 +11,13 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.result.UploadImgResultDTO; -import com.epmet.feign.fallback.OssFeignClientFallback; import com.epmet.feign.fallback.OssFeignClientFallbackFactory; import feign.codec.Encoder; import feign.form.spring.SpringFormEncoder; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.context.annotation.Bean; import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestPart; @@ -55,6 +55,15 @@ public interface OssFeignClient { @PostMapping(value ="oss/file/uploadqrcodeV2", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) Result uploadQrCodeV2(@RequestPart(value = "file") MultipartFile file, @RequestParam("customerId") String customerId); + /** + * desc:通过文件路径获取文件地址 + * @param filePath 文件路径 eg:epmet + * @param privacy 内部 外部 + * @return + */ + @GetMapping(value = "oss/file/getOssFileUrl") + Result getOssFileUrl(@RequestParam String filePath, @RequestParam String privacy); + //@Configuration class MultipartSupportConfig { diff --git a/epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/feign/fallback/OssFeignClientFallback.java b/epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/feign/fallback/OssFeignClientFallback.java index b60e59cc19..e55182a73f 100644 --- a/epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/feign/fallback/OssFeignClientFallback.java +++ b/epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/feign/fallback/OssFeignClientFallback.java @@ -13,7 +13,6 @@ import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.result.UploadImgResultDTO; import com.epmet.feign.OssFeignClient; -import org.springframework.stereotype.Component; import org.springframework.web.multipart.MultipartFile; /** @@ -40,4 +39,9 @@ public class OssFeignClientFallback implements OssFeignClient { return ModuleUtils.feignConError(ServiceConstant.EPMET_OSS_SERVER, "uploadQrCodeV2", file, customerId); } + @Override + public Result getOssFileUrl(String filePath, String privacy) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_OSS_SERVER, "download", filePath,privacy); + } + } diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AbstractCloudStorageService.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AbstractCloudStorageService.java index 74a38551d0..99b79d233a 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AbstractCloudStorageService.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AbstractCloudStorageService.java @@ -25,17 +25,23 @@ import java.util.UUID; public abstract class AbstractCloudStorageService { /** 云存储配置信息 */ CloudStorageConfig config; + /** * desc: 获取oss域名 * * @param privacy * @return java.lang.String - * @author LiuJanJun - * @date 2021/3/30 10:05 上午 + * @author LiuJanJu * @date 2021/3/30 10:05 上午 + */ + public abstract String getOssDomain(String privacy); + /** + * desc: 获取oss前缀 + * + * @param privacy + * @return java.lang.String + * @author LiuJanJu * @date 2021/3/30 10:05 上午 */ - public String getOssDomain(String privacy){ - return null; - }; + public abstract String getOssPrefix(String privacy); /** * 文件路径 * @param prefix 前缀 diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java index c1865d8234..7c8cd5d668 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java @@ -90,6 +90,15 @@ public class AliyunCloudStorageService extends AbstractCloudStorageService { } } + @Override + public String getOssPrefix(String privacy) { + if (PrivacyType.INTERNAL.equalsIgnoreCase(privacy)) { + return config.getAliyun().getInternal().getAliyunPrefix(); + } else { + return config.getAliyun().getExternal().getAliyunPrefix(); + } + } + @Override public String upload(byte[] data, String path, String privacyType) { return upload(new ByteArrayInputStream(data), path, privacyType); diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/FastDFSCloudStorageService.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/FastDFSCloudStorageService.java index 08a591e86d..a2290ec7f1 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/FastDFSCloudStorageService.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/FastDFSCloudStorageService.java @@ -34,6 +34,30 @@ public class FastDFSCloudStorageService extends AbstractCloudStorageService { this.config = config; } + /** + * desc: 获取oss域名 + * + * @param privacy + * @return java.lang.String + * @author LiuJanJu * @date 2021/3/30 10:05 上午 + */ + @Override + public String getOssDomain(String privacy) { + return config.getFastdfsDomain(); + } + + /** + * desc: 获取oss前缀 + * + * @param privacy + * @return java.lang.String + * @author LiuJanJu * @date 2021/3/30 10:05 上午 + */ + @Override + public String getOssPrefix(String privacy) { + return null; + } + @Override public String upload(byte[] data, String path, String privacyType) { return upload(new ByteArrayInputStream(data), path, privacyType); diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/LocalCloudStorageService.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/LocalCloudStorageService.java index 7317bbd780..1659386ab9 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/LocalCloudStorageService.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/LocalCloudStorageService.java @@ -28,6 +28,30 @@ public class LocalCloudStorageService extends AbstractCloudStorageService { this.config = config; } + /** + * desc: 获取oss域名 + * + * @param privacy + * @return java.lang.String + * @author LiuJanJu * @date 2021/3/30 10:05 上午 + */ + @Override + public String getOssDomain(String privacy) { + return config.getLocalDomain(); + } + + /** + * desc: 获取oss前缀 + * + * @param privacy + * @return java.lang.String + * @author LiuJanJu * @date 2021/3/30 10:05 上午 + */ + @Override + public String getOssPrefix(String privacy) { + return config.getLocalPrefix(); + } + @Override public String upload(byte[] data, String path, String privacyType) { return upload(new ByteArrayInputStream(data), path, privacyType); diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/QcloudCloudStorageService.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/QcloudCloudStorageService.java index 5d657ba318..7c289e63ac 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/QcloudCloudStorageService.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/QcloudCloudStorageService.java @@ -47,6 +47,30 @@ public class QcloudCloudStorageService extends AbstractCloudStorageService { clientConfig = new ClientConfig(new Region(config.getQcloudRegion())); } + /** + * desc: 获取oss域名 + * + * @param privacy + * @return java.lang.String + * @author LiuJanJu * @date 2021/3/30 10:05 上午 + */ + @Override + public String getOssDomain(String privacy) { + return config.getQcloudDomain(); + } + + /** + * desc: 获取oss前缀 + * + * @param privacy + * @return java.lang.String + * @author LiuJanJu * @date 2021/3/30 10:05 上午 + */ + @Override + public String getOssPrefix(String privacy) { + return config.getQcloudPrefix(); + } + @Override public String upload(byte[] data, String path, String privacyType) { return upload(new ByteArrayInputStream(data), path, privacyType); diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/QiniuCloudStorageService.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/QiniuCloudStorageService.java index 2fe73cddeb..a4aa05ecda 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/QiniuCloudStorageService.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/QiniuCloudStorageService.java @@ -44,6 +44,30 @@ public class QiniuCloudStorageService extends AbstractCloudStorageService { } + /** + * desc: 获取oss域名 + * + * @param privacy + * @return java.lang.String + * @author LiuJanJu * @date 2021/3/30 10:05 上午 + */ + @Override + public String getOssDomain(String privacy) { + return config.getQiniuDomain(); + } + + /** + * desc: 获取oss前缀 + * + * @param privacy + * @return java.lang.String + * @author LiuJanJu * @date 2021/3/30 10:05 上午 + */ + @Override + public String getOssPrefix(String privacy) { + return config.getQiniuPrefix(); + } + @Override public String upload(byte[] data, String path, String privacyType) { try { diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java index 47be7d427a..2c65bcea65 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java @@ -423,4 +423,9 @@ public class OssController { return ossService.uploadImgV2(file, PrivacyType.EXTERNAL, customerId); } + @GetMapping("getOssFileUrl") + public Result download(@RequestParam(required = false) String filePath,@RequestParam(required = false) String privacy){ + return new Result().ok(ossService.getOssFileUrl(filePath,privacy)); + } + } diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/OssService.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/OssService.java index 04c15973fe..ae9625ee66 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/OssService.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/OssService.java @@ -53,4 +53,11 @@ public interface OssService extends BaseService { * @author sun */ Result uploadImgV2(MultipartFile file, String privacy, String customerId); + + /** + * desc:通过文件路径获取下载 全路径 不传文件路径则为服务域名 + * @param filePath + * @return + */ + String getOssFileUrl(String filePath,String privacy); } diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java index 0805fd43c9..fc209d3535 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java @@ -36,6 +36,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.web.multipart.MultipartFile; +import java.io.File; import java.io.IOException; import java.util.Map; @@ -242,5 +243,22 @@ public class OssServiceImpl extends BaseServiceImpl implement return new Result().ok(dto); } + @Override + public String getOssFileUrl(String filePath,String privacy) { + if (StringUtils.isBlank(filePath)){ + filePath = StrConstant.EPMETY_STR; + } + AbstractCloudStorageService storageService = OssFactory.build(); + String ossDomain = storageService.getOssDomain(privacy); + String ossPrefix = storageService.getOssPrefix(privacy); + if (StringUtils.isBlank(ossDomain)){ + throw new RenException("oss配置错误"); + } + if (StringUtils.isBlank(ossPrefix)){ + ossPrefix = StrConstant.EPMETY_STR; + } + return ossDomain.concat(File.separator).concat(ossPrefix).concat(File.separator).concat(filePath); + } + } diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/BizPointTotalDetailServiceImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/BizPointTotalDetailServiceImpl.java index 87b7b20a32..2fd521d1d9 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/BizPointTotalDetailServiceImpl.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/BizPointTotalDetailServiceImpl.java @@ -380,7 +380,7 @@ public class BizPointTotalDetailServiceImpl extends BaseServiceImpl> result = resiGroupOpenFeignClient.listGroupDetailsExcludeGroupIds(form); - List groups = getResultDataOrThrowsException(result, ServiceConstant.RESI_GROUP_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【小组排名】查询积分为0的小组列表失败"); + List groups = getResultDataOrThrowsException(result, ServiceConstant.RESI_GROUP_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【小组排名】查询积分为0的小组列表失败", null); if (CollectionUtils.isEmpty(groups)) { return new ArrayList<>(); } @@ -412,7 +412,7 @@ public class BizPointTotalDetailServiceImpl extends BaseServiceImpl> listResult = resiGroupOpenFeignClient.listGroupDetailsByGroupIds(groupIds); - List groupInfos = getResultDataOrThrowsException(listResult, ServiceConstant.RESI_GROUP_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【小组排行】批量查询小组信息出错"); + List groupInfos = getResultDataOrThrowsException(listResult, ServiceConstant.RESI_GROUP_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【小组排行】批量查询小组信息出错", null); // 将小组基本信息转化为map HashMap groupMap = new HashMap<>(); @@ -454,7 +454,7 @@ public class BizPointTotalDetailServiceImpl extends BaseServiceImpl result = govOrgOpenFeignClient.getGridBaseInfoByGridId(form); - return getResultDataOrThrowsException(result, ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【小组排名】查询网格信息失败"); + return getResultDataOrThrowsException(result, ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【小组排名】查询网格信息失败", null); } @Override @@ -464,7 +464,7 @@ public class BizPointTotalDetailServiceImpl extends BaseServiceImpl groupList = getResultDataOrThrowsException(resiGroupOpenFeignClient.listGroupsByMember(form), - ServiceConstant.RESI_GROUP_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【我所在的小组排名】查询组列表失败"); + ServiceConstant.RESI_GROUP_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【我所在的小组排名】查询组列表失败", null); if (CollectionUtils.isEmpty(groupList)) { return new ArrayList(); diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/apiservice/impl/PingyinPrivateEpmetApiService.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/apiservice/impl/PingyinPrivateEpmetApiService.java index da62386442..9878fe2a3c 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/apiservice/impl/PingyinPrivateEpmetApiService.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/apiservice/impl/PingyinPrivateEpmetApiService.java @@ -55,7 +55,7 @@ public class PingyinPrivateEpmetApiService extends ApiService implements String urlParams = super.convertQueryParams2String(constructCommonUrlParamsMap(platformKey, authType, uuid, currentTimeMillis, sign)); String requestUrl = baseUrl.concat(apiUrl).concat(urlParams); Result stringResult = HttpClientManager.getInstance().sendPostByHttps(requestUrl, "{}"); - String remoteResultString = getResultDataOrThrowsException(stringResult, "【调用平阴私有化平台获取AccessToken】", EpmetErrorCode.SERVER_ERROR.getCode(), null); + String remoteResultString = getResultDataOrThrowsException(stringResult, "【调用平阴私有化平台获取AccessToken】", EpmetErrorCode.SERVER_ERROR.getCode(), null, null); Result remoteResult = parsePlatformResponseResult(remoteResultString, GetAccessTokenResultDTO.class); log.info("【调用平阴私有化平台获取AccessToken】结果:{}", remoteResultString); accessTokenFromCache = remoteResult.getData().getAccessToken(); @@ -159,7 +159,7 @@ public class PingyinPrivateEpmetApiService extends ApiService implements String jsonString = JSON.toJSONString(form); Result result = super.sendPostRequest(platformId, ThirdPlatformActions.PUSH_COMPONENT_ACCESS_TOKEN, jsonString, null, urlParams); - getResultDataOrThrowsException(result, "【平阴私有化平台】推送ComponentAccessToken", EpmetErrorCode.SERVER_ERROR.getCode(), null); + getResultDataOrThrowsException(result, "【平阴私有化平台】推送ComponentAccessToken", EpmetErrorCode.SERVER_ERROR.getCode(), null, null); } @Override 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/GridOptionFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GridOptionFormDTO.java new file mode 100644 index 0000000000..e6fae52bc9 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GridOptionFormDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description /gov/org/customergrid/gridoption + * @Author yinzuomei + * @Date 2021/11/12 10:54 上午 + */ +@Data +public class GridOptionFormDTO implements Serializable { + /** + * 部门Id + */ + @NotBlank(message = "组织机构ID不能为空") + private String agencyId; + //等着杨林改完,我再限制必填吧 + //@NotBlank(message = "查询条件和查看居民详情:query;新增或修改居民信息:addorupdate") + private String purpose; +} + diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/HouseFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/HouseFormDTO.java new file mode 100644 index 0000000000..304bce36b9 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/HouseFormDTO.java @@ -0,0 +1,17 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2021/10/25 17:03 + */ +@Data +public class HouseFormDTO implements Serializable { + private static final long serialVersionUID = 2636608477324780974L; + private String buildingId; + private String unitId; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcBulidingFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcBulidingFormDTO.java new file mode 100644 index 0000000000..879fd011c9 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcBulidingFormDTO.java @@ -0,0 +1,129 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + + +@Data +public class IcBulidingFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + public interface DeleteGroup extends CustomerClientShowGroup { + } + + public interface AddShowGroup extends CustomerClientShowGroup { + } + + public interface UpdateShowGroup extends CustomerClientShowGroup { + } + @NotBlank(message = "楼栋ID不能为空", groups = { UpdateShowGroup.class,DeleteGroup.class}) + private String buildingId; + + /** + * 组织id + */ + @NotBlank(message = "组织id不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) + private String agencyId; + + + /** + * 网格id + */ + @NotBlank(message = "网格不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) + private String gridId; + + + /** + * 小区id + */ + @NotBlank(message = "小区id不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) + private String neighborHoodId; + + /** + * 楼栋名称 + */ + @NotBlank(message = "楼栋名称不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) + @Length(max=10,message = "楼栋名称不能超过10个字", groups = {AddShowGroup.class, UpdateShowGroup.class}) + private String buildingName; + + /** + * 楼栋类型 + */ + @NotBlank(message = "楼栋类型不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) + private String type=""; + + /** + * 客户id + */ + /* @NotBlank(message = "客户id不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) + private String customerId;*/ + + /** + * 排序 + */ + @NotNull(message = "排序不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) + private Integer sort = 0; + + /** + * 总单元数 + */ + @NotNull(message = "总单元数不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) + private Integer totalUnitNum=1; + + /** + * 总楼层总数 + */ + //@NotNull(message = "总楼层总数不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) + private Integer totalFloorNum; + + /** + * 总户数 + */ + //@NotNull(message = "总户数不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) + private Integer totalHouseNum; + /** + * 坐标位置 + */ + + private String location; + + + /** + * 中心点位:经度 + */ + + private String longitude; + + /** + * 中心点位:纬度 + */ + + private String latitude; + + + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcBulidingUnitFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcBulidingUnitFormDTO.java new file mode 100644 index 0000000000..74a38b8e2b --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcBulidingUnitFormDTO.java @@ -0,0 +1,42 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + + +@Data +public class IcBulidingUnitFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + @NotBlank(message = "楼栋ID不能为空") + private String buildingId; + + + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseFormDTO.java new file mode 100644 index 0000000000..58376e2032 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseFormDTO.java @@ -0,0 +1,105 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + + +@Data +public class IcHouseFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + public interface DeleteGroup extends CustomerClientShowGroup { + } + + public interface AddShowGroup extends CustomerClientShowGroup { + } + + public interface UpdateShowGroup extends CustomerClientShowGroup { + } + + @NotBlank(message = "房屋ID不能为空", groups = { UpdateShowGroup.class,DeleteGroup.class}) + private String houseId; + + + /** + * 小区id + */ + @NotBlank(message = "小区id不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) + private String neighborHoodId; + + @NotBlank(message = "所属楼栋ID不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) + private String buildingId; + + /** + * 所属单元id + */ + @NotBlank(message = "所属单元id不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) + private String buildingUnitId; + + + + /** + * 门牌号 + */ + @NotBlank(message = "门牌号不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) + private String doorName; + + /** + * 房屋类型,这里存储字典value就可以 + */ + @NotBlank(message = "房屋类型不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) + private String houseType; + + /** + * 存储字典value + */ + @NotBlank(message = "房屋用途不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) + private String purpose; + + /** + * 1出租;0未出租 + */ + @NotNull(message = "是否出租不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) + private Integer rentFlag; + + /** + * 房主姓名 + */ + @NotBlank(message = "房主姓名不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) + private String ownerName; + + /** + * 房主电话 + */ + @NotBlank(message = "房主电话不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) + private String ownerPhone; + + /** + * 房主身份证号 + */ + @NotBlank(message = "房主身份证号不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) + private String ownerIdCard; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcNeighborHoodFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcNeighborHoodFormDTO.java new file mode 100644 index 0000000000..fbeefeadf5 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcNeighborHoodFormDTO.java @@ -0,0 +1,105 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + + + +@Data +public class IcNeighborHoodFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + public interface DeleteGroup extends CustomerClientShowGroup { + } + + public interface AddShowGroup extends CustomerClientShowGroup { + } + public interface UpdateShowGroup extends CustomerClientShowGroup { + } + /** + * 小区id + */ + @NotBlank(message = "小区id不能为空", groups = {UpdateShowGroup.class,DeleteGroup.class}) + private String neighborHoodId; + + /** + * 小区名称 + */ + @NotBlank(message = "小区名称不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) + @Length(max=50,message = "小区名称不能超过50个字", groups = {AddShowGroup.class, UpdateShowGroup.class}) + private String neighborHoodName; + + /** + * 组织id + */ + @NotBlank(message = "组织id不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) + private String agencyId; + + + /** + * 网格id + */ + @NotBlank(message = "网格id不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) + private String gridId; + /** + * 关联物业id + */ + //@NotBlank(message = "关联物业ID不能为空", groups = {AddShowGroup.class,UpdateShowGroup.class}) + private String propertyId; + + /** + * 详细地址 + */ + @NotBlank(message = "详细地址不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) + private String address; + + /** + * 备注 + */ + @Length(max=500,message = "备注不能超过500个字", groups = {AddShowGroup.class, UpdateShowGroup.class}) + private String remark; + /** + * 坐标位置 + */ + private String location; + + + /** + * 中心点位:经度 + */ + + private String longitude; + + /** + * 中心点位:纬度 + */ + + private String latitude; + + + + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcPropertyManagementFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcPropertyManagementFormDTO.java new file mode 100644 index 0000000000..63ea329d22 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcPropertyManagementFormDTO.java @@ -0,0 +1,53 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + + +@Data +public class IcPropertyManagementFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + public interface DeleteGroup extends CustomerClientShowGroup { + } + + public interface AddShowGroup extends CustomerClientShowGroup { + } + + public interface UpdateShowGroup extends CustomerClientShowGroup { + } + + @NotBlank(message = "物业id不能为空", groups = {DeleteGroup.class, UpdateShowGroup.class}) + private String id; + + /** + * 物业名称 + */ + @NotBlank(message = "物业名称不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) + @Length(max = 50, message = "物业名称不能超过50个字", groups = {AddShowGroup.class}) + private String name; + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/ListIcNeighborHoodFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/ListIcNeighborHoodFormDTO.java new file mode 100644 index 0000000000..80b95263b6 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/ListIcNeighborHoodFormDTO.java @@ -0,0 +1,80 @@ +package com.epmet.dto.form;/** + * Created by 11 on 2020/3/19. + */ + +import lombok.Data; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.Pattern; +import java.io.Serializable; + +/** + * @Description 陌生人导览查询附近网格传参定义 + * @ClassName ListCustomerGridFormDTO + * @Author wangc + * @date 2020.03.19 15:00 + */ +@Data +public class ListIcNeighborHoodFormDTO implements Serializable{ + + private static final long serialVersionUID = -1L; + + + /** + * 当前页 + * */ + private Integer pageNo = 1; + + /** + * 每页显示数量 + * */ + private Integer pageSize = 20; + + /** + * 组织类别 + */ + private String level ; + + private String id; + + /** + * 组织ID + */ +// private String agencyId; + /** + * 网格ID + */ +// private String gridId; + /** + * 小区名字 + */ +// private String neighborHoodName; + /** + * 楼栋名字 + */ +// private String buildingName; + /** + * 房主姓名 + */ + private String ownerName; + /** + * 房主电话 + */ + private String ownerPhone; + /** + * 数据类型【小区:neighbourHood,楼栋:building,房屋:house】 + */ +// @Pattern(regexp = "^(neighbourHood|building|house)?$",message = "数据类型选择错误") +// private String dataType; + /** + * 楼栋ID + */ + private String buildingId; + /** + * 小区ID + */ + private String neighborHoodId; + + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/MapAddAreaFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/MapAddAreaFormDTO.java new file mode 100644 index 0000000000..8fcf455279 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/MapAddAreaFormDTO.java @@ -0,0 +1,31 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/10/25 9:54 上午 + * @DESC + */ +@Data +public class MapAddAreaFormDTO implements Serializable { + + private static final long serialVersionUID = 2334704900459757549L; + + public interface MapAddAreaForm{} + + /** + * 类型,组织:agency,网格:grid,小区:neighborHood + */ + @NotBlank(message = "level不能为空",groups = MapAddAreaForm.class) + private String level; + + @NotBlank(message = "orgId不能为空",groups = MapAddAreaForm.class) + private String orgId; + + @NotBlank(message = "coordinates不能为空",groups = MapAddAreaForm.class) + private String coordinates; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/MapDelAreaFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/MapDelAreaFormDTO.java new file mode 100644 index 0000000000..efeaf5b0e2 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/MapDelAreaFormDTO.java @@ -0,0 +1,28 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/10/25 9:23 上午 + * @DESC + */ +@Data +public class MapDelAreaFormDTO implements Serializable { + + private static final long serialVersionUID = -539570523818788293L; + + public interface MapDelAreaForm{} + + /** + * 类型,组织:agency,网格:grid,小区:neighborHood + */ + @NotBlank(message = "level不能为空", groups = MapDelAreaForm.class) + private String level; + + @NotBlank(message = "orgId不能为空", groups = MapDelAreaForm.class) + private String orgId; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/MapOrgFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/MapOrgFormDTO.java new file mode 100644 index 0000000000..04ac916daa --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/MapOrgFormDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/10/25 10:40 上午 + * @DESC + */ +@Data +public class MapOrgFormDTO implements Serializable { + + private static final long serialVersionUID = 2021388285115834510L; + + /** + * 类型,组织:agency,网格:grid,小区:neighborHood + */ + private String level; + + /** + * 组织ID,默认不填写 + */ + private String orgId; + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/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..b905c43166 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/BaseInfoFamilyBuildingResultDTO.java @@ -0,0 +1,31 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/11/2 9:15 上午 + * @DESC + */ +@Data +public class BaseInfoFamilyBuildingResultDTO implements Serializable { + + private static final long serialVersionUID = 6084090841200733630L; + + /** + * 楼栋ID + */ + private String buildingId; + + /** + * 楼栋名字 + */ + private String buildingName; + + public BaseInfoFamilyBuildingResultDTO() { + this.buildingId = ""; + this.buildingName = ""; + } +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/BuildingDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/BuildingDTO.java new file mode 100644 index 0000000000..a076376543 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/BuildingDTO.java @@ -0,0 +1,19 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2021/10/25 15:03 + */ +@Data +public class BuildingDTO implements Serializable { + private static final long serialVersionUID = -2129418426919785999L; + private String buildingId; + private String buildingName; + private List unitList; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/BuildingResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/BuildingResultDTO.java new file mode 100644 index 0000000000..4835cefba5 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/BuildingResultDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2021/10/25 15:03 + */ +@Data +public class BuildingResultDTO implements Serializable { + private static final long serialVersionUID = -2129418426919785999L; + private String buildingId; + + private String gridName; + + private String neighborhoodName; + + private String buildingName; + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/BuildingResultPagedDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/BuildingResultPagedDTO.java new file mode 100644 index 0000000000..eb0bc8e904 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/BuildingResultPagedDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2021/10/25 15:03 + */ +@Data +public class BuildingResultPagedDTO implements Serializable { + private static final long serialVersionUID = -2129418426919785999L; + /** + * + */ + private Integer total; + + /** + * 议题列表 + */ + private List list; + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridTreeResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridTreeResultDTO.java new file mode 100644 index 0000000000..608b9428e5 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridTreeResultDTO.java @@ -0,0 +1,19 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2021/10/25 15:08 + */ +@Data +public class GridTreeResultDTO implements Serializable { + private static final long serialVersionUID = -6506457371074529990L; + private String gridId; + private String gridName; + private List neighborHoodList; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseInfoDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseInfoDTO.java new file mode 100644 index 0000000000..5077e99a33 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseInfoDTO.java @@ -0,0 +1,62 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description TODO + * @Author yinzuomei + * @Date 2021/11/1 1:42 下午 + */ +@Data +public class HouseInfoDTO implements Serializable { + private static final long serialVersionUID = -419899682683323110L; + /** + * 所属家庭Id + */ + private String homeId; + + + /** + * 小区id + */ + private String neighborHoodId; + /** + * 小区名称 + */ + private String neighborHoodName; + + + /** + * 所属楼栋id + */ + private String buildingId; + /** + * 楼栋名称 + */ + private String buildingName; + + + /** + * 所属单元id + */ + private String buildingUnitId; + /** + * 单元名 + */ + private String unitName; + + + /** + * 门牌号 + */ + private String doorName; + + /** + * 房屋类型,1楼房,2平房,3别墅 + */ + private String houseType; + + private String houseName; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseListResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseListResultDTO.java new file mode 100644 index 0000000000..a63f415e94 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseListResultDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2021/11/5 15:59 + */ +@NoArgsConstructor +@Data +public class HouseListResultDTO implements Serializable { + + private static final long serialVersionUID = 2063032844842070847L; + private String houseId; + private String houseName; + private List categoryList; + + @NoArgsConstructor + @Data + public static class CategoryListBean { + private String name; + private String iconUrl; + private String isSpecial; + } +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseResultDTO.java new file mode 100644 index 0000000000..58a07c8bbc --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseResultDTO.java @@ -0,0 +1,17 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2021/10/25 16:58 + */ +@Data +public class HouseResultDTO implements Serializable { + private static final long serialVersionUID = 8054109017922254586L; + private String houseId; + private String houseName; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcNeighborHoodResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcNeighborHoodResultDTO.java new file mode 100644 index 0000000000..51b410eaa5 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcNeighborHoodResultDTO.java @@ -0,0 +1,36 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; +import java.util.Map; + +/** + * @Description 网格列表信息 + * @ClassName GridListInfoResultDTO + * @Author wangc + * @date 2020.04.23 14:21 + */ +@Data +public class IcNeighborHoodResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + /** + * 总条数 + * */ + + private Integer total; + +// /** +// * 数据类型【小区:neighbourHood,楼栋:building,房屋:house】 +// * */ +// private String dataType; + + /** + * 结果集 + */ + private List> list; + + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcPropertyManagementResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcPropertyManagementResultDTO.java new file mode 100644 index 0000000000..6f2e058206 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcPropertyManagementResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; +import java.util.Map; + +/** + * @Description 网格列表信息 + * @ClassName GridListInfoResultDTO + * @Author wangc + * @date 2020.04.23 14:21 + */ +@Data +public class IcPropertyManagementResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + private String propertyId; + + private String propertyName; + + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/MapOrgResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/MapOrgResultDTO.java new file mode 100644 index 0000000000..5ad5436d9a --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/MapOrgResultDTO.java @@ -0,0 +1,77 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2021/10/25 10:40 上午 + * @DESC + */ +@Data +public class MapOrgResultDTO implements Serializable { + + private static final long serialVersionUID = 7296300942981202725L; + + /** + * 经度 + */ + @JsonIgnore + private String longitudeOrigin; + + private BigDecimal longitude; + + /** + * 纬度 + */ + @JsonIgnore + private String latitudeOrigin; + + private BigDecimal latitude; + + /** + * 组织或网格ID + */ + private String id; + + /** + * 组织或网格名字 + */ + private String name; + + /** + * 类型,组织:agency,网格:grid,小区:neighborHood + */ + private String level; + + /** + * 坐标 + */ + private String coordinates; + + /** + * 组织级别 + */ + private String agencyLevel; + + /** + * 下级结果集 + */ + private List children; + + public MapOrgResultDTO() { + this.longitudeOrigin = ""; + this.latitudeOrigin = ""; + this.id = ""; + this.name = ""; + this.level = ""; + this.coordinates = ""; + this.children = new ArrayList<>(); + this.agencyLevel = ""; + } +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/MapSonOrgResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/MapSonOrgResultDTO.java new file mode 100644 index 0000000000..86b1a95c14 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/MapSonOrgResultDTO.java @@ -0,0 +1,70 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2021/10/25 10:40 上午 + * @DESC + */ +@Data +public class MapSonOrgResultDTO implements Serializable { + + private static final long serialVersionUID = 7296300942981202725L; + + /** + * 经度 + */ + @JsonIgnore + private String longitudeOrigin; + + private BigDecimal longitude; + + /** + * 纬度 + */ + @JsonIgnore + private String latitudeOrigin; + + private BigDecimal latitude; + + /** + * 组织或网格ID + */ + private String id; + + /** + * 组织或网格名字 + */ + private String name; + + /** + * 类型,组织:agency,网格:grid,小区:neighborHood + */ + private String level; + + /** + * 坐标 + */ + private String coordinates; + + /** + * 组织级别 + */ + private String agencyLevel; + + public MapSonOrgResultDTO() { + this.longitudeOrigin = ""; + this.latitudeOrigin = ""; + this.id = ""; + this.name = ""; + this.level = ""; + this.coordinates = ""; + this.agencyLevel = ""; + } +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/NeighborHoodDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/NeighborHoodDTO.java new file mode 100644 index 0000000000..6a561c6e8e --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/NeighborHoodDTO.java @@ -0,0 +1,19 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2021/10/25 15:06 + */ +@Data +public class NeighborHoodDTO implements Serializable { + private static final long serialVersionUID = 1644088283259175745L; + private String neighborHoodId; + private String neighborHoodName; + private List buildingList; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/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..aa044e74fe 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,83 @@ public interface GovOrgOpenFeignClient { */ @PostMapping("/gov/org/grid/getbaseinfo") Result getGridBaseInfoByGridId(CustomerGridFormDTO customerGridFormDTO); + + @PostMapping(value = "/gov/org/house/queryListHouseInfo",consumes = MediaType.APPLICATION_JSON_VALUE) + Result> queryListHouseInfo(@RequestBody Set houseIds); + + + + /** + * @Description 获取组织下网格选项 + * @Param formDTO + * @Return {@link Result>} + * @Author zhaoqifeng + * @Date 2021/10/26 14:02 + */ + @PostMapping("/gov/org/customergrid/gridoption") + Result> getGridOption(@RequestBody GridOptionFormDTO formDTO); + + /** + * 获取网格下支部小组 + * @Param formDTO + * @Return {@link Result>} + * @Author zhaoqifeng + * @Date 2021/10/27 9:58 + */ + @PostMapping("/gov/org/customerpartybranch/branchoption") + Result> getBranchOption(@RequestBody CustomerPartyBranchDTO formDTO); + + /** + * @Description 获取小区内的楼栋 + * @Param dto + * @Return {@link Result>} + * @Author zhaoqifeng + * @Date 2021/10/26 14:46 + */ + @PostMapping("/gov/org/icbuilding/buildingoption") + Result> getBuildingOptions(IcBuildingDTO dto); + + /** + * @Description 获取楼栋内单元 + * @Param dto + * @Return {@link Result>} + * @Author zhaoqifeng + * @Date 2021/10/26 14:46 + */ + @PostMapping("/gov/org/icbuildingunit/unitoption") + Result> getUnitOptions(IcBuildingUnitDTO dto); + + @PostMapping("/gov/org/ichouse/houseoption") + Result> getHouseOption(@RequestBody HouseFormDTO formDTO); + + /** + * @Description 获取网格下小区列表 + * @Param dto + * @Return {@link Result< List< OptionResultDTO>>} + * @Author zhaoqifeng + * @Date 2021/10/26 14:38 + */ + @PostMapping("/gov/org/icneighborhood/neighborhoodoption") + Result> getNeighborHoodOptions(IcNeighborHoodDTO dto); + + /** + * @Description 查询房屋信息 + * @param idCard + * @author zxc + * @date 2021/11/3 3:30 下午 + */ + @PostMapping("/gov/org/ichouse/selecthouseinfobyidcard") + Result> selectHouseInfoByIdCard(@RequestParam("idCard")String idCard); + + @GetMapping("/gov/org/ichouse/{id}") + Result get(@PathVariable("id") String id); + + @PostMapping("/gov/org/building/buildinglistbyids") + Result> buildingListByIds(@RequestBody List buildingIdList); + + @PostMapping("/gov/org/building/buildinglistbyidsPage/{pageNo}/{pageSize}") + Result buildinglistbyidsPage(@RequestBody List buildingIdList,@PathVariable("pageNo") Integer pageNo,@PathVariable("pageSize")Integer pageSize); + + @PostMapping("/gov/org/icneighborhood/getlistbyids") + Result> getListByIds(@RequestBody List ids); } 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..8649513937 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,68 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient { return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getGridBaseInfoByGridId", customerGridFormDTO); } + @Override + public Result> queryListHouseInfo(Set houseIds) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "queryListHouseInfo", houseIds); + } + + @Override + public Result> getGridOption(GridOptionFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getGridOption", formDTO); + } + + @Override + public Result> getBranchOption(CustomerPartyBranchDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getBranchOption", formDTO); + } + + @Override + public Result> getBuildingOptions(IcBuildingDTO dto) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getBuildingOptions", dto); + } + + @Override + public Result> getUnitOptions(IcBuildingUnitDTO dto) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getUnitOptions", dto); + } + + @Override + public Result> getHouseOption(HouseFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getHouseOption", formDTO); + } + + @Override + public Result> getNeighborHoodOptions(IcNeighborHoodDTO dto) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getNeighborHoodOptions", dto); + } + + @Override + public Result> selectHouseInfoByIdCard(String idCard) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "selectHouseInfoByIdCard", idCard); + } + + @Override + public Result get(String id) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "get", id); + } + + @Override + public Result> buildingListByIds(List buildingIdList) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "buildingListByIds", buildingIdList); + } + @Override + public Result buildinglistbyidsPage(List buildingIdList,Integer pageNo,Integer pageSize) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "buildinglistbyidsPage", buildingIdList,pageNo,pageSize); + } + + @Override + public Result> getListByIds(List ids) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getListByIds", ids); + } + @Override public Result 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 510ad6e7db..e813e41954 100644 --- a/epmet-module/gov-org/gov-org-server/pom.xml +++ b/epmet-module/gov-org/gov-org-server/pom.xml @@ -113,6 +113,12 @@ 2.0.0 compile + + com.epmet + oper-customize-client + 2.0.0 + compile + @@ -129,8 +135,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 9e69963062..c2c2273036 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 @@ -28,10 +28,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.feign.EpmetMessageOpenFeignClient; import com.epmet.send.SendMqMsgUtil; @@ -302,4 +299,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..98b5d1233e --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/BuildingController.java @@ -0,0 +1,247 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import cn.afterturn.easypoi.excel.entity.TemplateExportParams; +import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dao.IcBuildingUnitDao; +import com.epmet.dto.BuildingTreeLevelDTO; +import com.epmet.dto.form.IcBulidingFormDTO; +import com.epmet.dto.form.IcBulidingUnitFormDTO; +import com.epmet.dto.form.ListIcNeighborHoodFormDTO; +import com.epmet.dto.result.BuildingResultDTO; +import com.epmet.dto.result.BuildingResultPagedDTO; +import com.epmet.dto.result.IcNeighborHoodResultDTO; +import com.epmet.entity.IcBuildingUnitEntity; +import com.epmet.excel.IcBuildingExcel; +import com.epmet.service.BuildingService; +import com.epmet.service.IcBuildingService; +import com.epmet.service.NeighborHoodService; +import com.epmet.util.ExcelPoiUtils; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.CollectionUtils; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.*; +import java.util.stream.Collectors; + + +/** + * 楼栋信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +@Slf4j +@RestController +@RequestMapping("building") +public class BuildingController { + + + @Autowired + private NeighborHoodService neighborHoodService; + + @Autowired + private IcBuildingService icBuildingService; + @Autowired + private BuildingService buildingService; + @Autowired + private IcBuildingUnitDao icBuildingUnitDao; + + + + @PostMapping("buildinglist") + public Result houseList(@RequestBody ListIcNeighborHoodFormDTO formDTO){ + //效验数据 + ValidatorUtils.validateEntity(formDTO); + IcNeighborHoodResultDTO icNeighborHoodResultDTO = buildingService.listBuilding(formDTO); + return new Result().ok(icNeighborHoodResultDTO); + + } + + @NoRepeatSubmit + @PostMapping("buildingadd") + public Result buildingAdd(@LoginUser TokenDto tokenDTO, @RequestBody IcBulidingFormDTO formDTO){ + //效验数据 + ValidatorUtils.validateEntity(formDTO, IcBulidingFormDTO.AddShowGroup.class); + String customerId = tokenDTO.getCustomerId(); +// String customerId = "123123"; + + buildingService.AddBuilding(customerId,formDTO); + return new Result().ok("保存成功"); + } + + @NoRepeatSubmit + @PostMapping("buildingupdate") + public Result buildingUpdate(@LoginUser TokenDto tokenDTO, @RequestBody IcBulidingFormDTO formDTO){ + //效验数据 + ValidatorUtils.validateEntity(formDTO, IcBulidingFormDTO.UpdateShowGroup.class); + String customerId = tokenDTO.getCustomerId(); +// String customerId = "123123"; + buildingService.UpdateBuilding(customerId,formDTO); + return new Result().ok("修改成功"); + } + + @PostMapping("buildingdel") + public Result buildingDel(@LoginUser TokenDto tokenDTO, @RequestBody IcBulidingFormDTO formDTO){ + //效验数据 + ValidatorUtils.validateEntity(formDTO, IcBulidingFormDTO.DeleteGroup.class); + String buildingId = formDTO.getBuildingId(); + buildingService.DelBuilding(buildingId); + return new Result(); + } + + @PostMapping("treelist") + public Result treeList(@LoginUser TokenDto tokenDTO){ + List buildingTreeLevelDTOS =buildingService.treeList(tokenDTO.getUserId()); + return new Result().ok(buildingTreeLevelDTOS); + } + /** + * 导出模板 + * @param response + * @throws Exception + */ + @PostMapping("exporttemplate") + public void exportTemplate( HttpServletResponse response) throws Exception { + + TemplateExportParams templatePath = new TemplateExportParams("excel/building_template.xlsx"); + Map map = new HashMap<>(); + map.put("maplist",new ArrayList()); + ExcelPoiUtils.exportExcel(templatePath ,map,"楼宇信息录入表",response); + + } + /** + * 导出 + * @param formDTO + * @param response + * @throws Exception + */ + @RequestMapping("exportbuildinginfo") + public void exportbuildinginfo(@RequestBody ListIcNeighborHoodFormDTO formDTO, HttpServletResponse response) throws Exception { + ValidatorUtils.validateEntity(formDTO); + buildingService.exportBuildinginfo(formDTO,response); + + } + + /** + * 导出 + * @param formDTO + * @param response + * @throws Exception + */ + @GetMapping("export") + public void export(HttpServletResponse response) throws Exception { + ListIcNeighborHoodFormDTO formDTO = new ListIcNeighborHoodFormDTO(); + ValidatorUtils.validateEntity(formDTO); + buildingService.exportBuildinginfo(formDTO,response); + + } + + + /** + * 导入数据 + * @param file + * @return + * @throws IOException + */ + @PostMapping("import") + public Result importExcel(@LoginUser TokenDto tokenDTO, @RequestParam("file") MultipartFile file) throws IOException { + String customerId = tokenDTO.getCustomerId(); +// String customerId = "123123"; + + ExcelImportResult importResult = ExcelPoiUtils.importExcelMore(file, 0, 1, IcBuildingExcel.class); + + List failList = importResult.getFailList(); + + //存放错误数据行号 + List numList = new ArrayList<>(); + if(!CollectionUtils.isEmpty(failList)){ + for ( IcBuildingExcel entity : failList) { + log.error("第{}行,{}",entity.getRowNum(),entity.getErrorMsg());//打印失败的行 和失败的信息 + numList.add(entity.getRowNum()); + } + //return new Result().error(8001,failList.get(0).getErrorMsg()); + } + List result =importResult.getList(); + List resultList = buildingService.importExcel(customerId,result,tokenDTO.getUserId(),numList); + String str = String.format("共%s条,成功导入%s条。",numList.size()+result.size(),numList.size()+result.size()-resultList.size()); + if(resultList.size()> NumConstant.ZERO){ + Collections.sort(resultList); + String subList = resultList.stream().map(String::valueOf).collect(Collectors.joining("、")); + log.warn(str + "第" + subList + "行未成功!"); + return new Result().error(9999, str+"第"+subList+"行未成功!"); + } + return new Result().ok(str); + } + + /** + * 查看楼宇单元列表 + * @param tokenDTO + * @return + * @throws IOException + */ + @PostMapping("buildingunitlist") + public Result buildingunitlist(@LoginUser TokenDto tokenDTO,@RequestBody IcBulidingUnitFormDTO icBulidingUnitFormDTO ){ + ValidatorUtils.validateEntity(icBulidingUnitFormDTO); + List icBuildingUnitEntityList = icBuildingUnitDao.selectList(new QueryWrapper().lambda().eq(IcBuildingUnitEntity::getBuildingId, icBulidingUnitFormDTO.getBuildingId()).orderByAsc(IcBuildingUnitEntity::getUnitNum)); + List result = new ArrayList<>(); + icBuildingUnitEntityList.forEach(item->{ + JSONObject jsonObject = new JSONObject(); + jsonObject.put("id",item.getId()); + jsonObject.put("unitName",item.getUnitName()); + jsonObject.put("unitNum",item.getUnitNum()); + result.add(jsonObject); + }); + return new Result().ok(result); + } + + + @PostMapping("buildinglistbyids") + public Result> buildingListByIds(@RequestBody List buildingIdList){ + if(CollectionUtils.isEmpty(buildingIdList)){ + return new Result(); + } + List result = buildingService.buildingListByIds(buildingIdList); + return new Result>().ok(result); + + } + + @PostMapping("buildinglistbyidsPage/{pageNo}/{pageSize}") + public Result buildinglistbyidsPage(@RequestBody List buildingIdList, @PathVariable("pageNo") Integer pageNo, @PathVariable("pageSize") Integer pageSize){ + if(CollectionUtils.isEmpty(buildingIdList)){ + return new Result(); + } + return new Result().ok(buildingService.buildinglistbyidsPage(buildingIdList,pageNo,pageSize)); + + } + + + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java index 1b12beb474..a91016a5f9 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 @@ -351,4 +351,22 @@ public class CustomerAgencyController { return new Result().ok(customerAgencyService.getOrgTreeData(tokenDTO.getUserId())); } + /** + * @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..b46bd1aeab 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,19 @@ public class CustomerGridController { return new Result>().ok(customerGridService.selectOrgsByUserId(userId)); } + /** + * @Description 获取组织下网格选项 + * 居民信息:1)查询条件 :所属网格下拉框;2)查看详情:所属网格下拉框 + * label: 社区-网格 + * value: 网格id + * @Param formDTO + * @Return {@link Result>} + * @Author zhaoqifeng + * @Date 2021/10/26 14:02 + */ + @PostMapping("gridoption") + public Result> getGridOption(@RequestBody GridOptionFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO); + return new Result>().ok(customerGridService.getGridOption(formDTO.getAgencyId(),formDTO.getPurpose())); + } } 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 c0309c6610..2a5997aa34 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerPartyBranchController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerPartyBranchController.java @@ -18,6 +18,7 @@ package com.epmet.controller; import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.dto.result.OptionResultDTO; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; @@ -131,4 +132,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())); + } } 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 982882ac66..7f38a198cf 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/GridController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/GridController.java @@ -128,6 +128,13 @@ public class GridController { return customerGridService.getAllGridsByAgency(agencyFormDTO); } + @PostMapping("allgridsnopermission") + public Result> allGridsNoPermission(@LoginUser TokenDto tokenDto, @RequestBody CommonAgencyIdFormDTO agencyFormDTO){ + agencyFormDTO.setUserId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(agencyFormDTO); + return customerGridService.getAllGridsByAgency(agencyFormDTO); + } + /** * @Description 在给网格添加工作人员时,查询当前机关下没有加入到此网格下的工作人员,禁用的也不能选(不显示) * @Param CommonGridIdFormDTO @@ -209,4 +216,10 @@ public class GridController { CustomerGridDTO gridInfo = customerGridService.getBaseInfo(customerGridFormDTO); return new Result().ok(gridInfo); } + + @PostMapping("gridtree") + public Result> getGridTree(@RequestBody AgencyIdFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + return new Result>().ok(customerGridService.getGridTree(formDTO)); + } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java new file mode 100644 index 0000000000..ab0b6c646f --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java @@ -0,0 +1,176 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import cn.afterturn.easypoi.excel.entity.TemplateExportParams; +import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult; +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.form.IcHouseFormDTO; +import com.epmet.dto.form.IcNeighborHoodFormDTO; +import com.epmet.dto.form.ListIcNeighborHoodFormDTO; +import com.epmet.dto.result.HouseInfoDTO; +import com.epmet.dto.result.IcNeighborHoodResultDTO; +import com.epmet.excel.IcHouseExcel; +import com.epmet.service.HouseService; +import com.epmet.service.NeighborHoodService; +import com.epmet.util.ExcelPoiUtils; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.CollectionUtils; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.*; +import java.util.stream.Collectors; + + +/** + * 房屋表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +@Slf4j +@RestController +@RequestMapping("house") +public class HouseController { + + + @Autowired + private NeighborHoodService neighborHoodService; + + @Autowired + private HouseService houseService; + + + @PostMapping("houselist") + public Result houseList(@RequestBody ListIcNeighborHoodFormDTO formDTO){ + //效验数据 + ValidatorUtils.validateEntity(formDTO); + IcNeighborHoodResultDTO icNeighborHoodResultDTO = houseService.listNeighborhood(formDTO); + return new Result().ok(icNeighborHoodResultDTO); + + } + + @NoRepeatSubmit + @PostMapping("houseadd") + public Result houseAdd(@LoginUser TokenDto tokenDTO, @RequestBody IcHouseFormDTO formDTO){ + //效验数据 + ValidatorUtils.validateEntity(formDTO, IcHouseFormDTO.AddShowGroup.class); + String customerId = tokenDTO.getCustomerId(); +// String customerId = "123123"; + + houseService.addHouse(customerId,formDTO); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("houseupdate") + public Result houseUpdate(@LoginUser TokenDto tokenDTO, @RequestBody IcHouseFormDTO formDTO){ + //效验数据 + ValidatorUtils.validateEntity(formDTO, IcHouseFormDTO.UpdateShowGroup.class); + String customerId = tokenDTO.getCustomerId(); +// String customerId = "123123"; + houseService.updateHouse(customerId,formDTO); + return new Result(); + } + + @PostMapping("housedel") + public Result houseDel(@LoginUser TokenDto tokenDTO, @RequestBody IcHouseFormDTO formDTO){ + //效验数据 + ValidatorUtils.validateEntity(formDTO, IcNeighborHoodFormDTO.DeleteGroup.class); + houseService.delHouse(formDTO.getHouseId()); + return new Result(); + } + /** + * 导出模板 + * @param response + * @throws Exception + */ + @PostMapping("exporttemplate") + public void exportTemplate(HttpServletResponse response) throws Exception { +// ValidatorUtils.validateEntity(ListIcNeighborHoodFormDTO.class); + TemplateExportParams templatePath = new TemplateExportParams("excel/house_template.xlsx"); + Map map = new HashMap<>(); + map.put("maplist",new ArrayList()); + ExcelPoiUtils.exportExcel(templatePath ,map,"房屋信息录入表",response); + + } + /** + * 导出 + * @param formDTO + * @param response + * @throws Exception + */ + @RequestMapping("exporthouseinfo") + public void exporthouseinfo(@RequestBody ListIcNeighborHoodFormDTO formDTO, HttpServletResponse response) throws Exception { + ValidatorUtils.validateEntity(formDTO); + houseService.exportBuildinginfo(formDTO,response); + + } + + /** + * 导入数据 + * @param file + * @return + * @throws IOException + */ + @PostMapping("import") + public Result importExcel(@LoginUser TokenDto tokenDTO, @RequestParam("file") MultipartFile file) throws IOException { + + String customerId = tokenDTO.getCustomerId(); +// String customerId = "123123"; + + ExcelImportResult importResult = ExcelPoiUtils.importExcelMore(file, 0, 1, IcHouseExcel.class); + + List failList = importResult.getFailList(); + + //存放错误数据行号 + List numList = new ArrayList<>(); + if(!CollectionUtils.isEmpty(failList)){ + for ( IcHouseExcel entity : failList) { + log.error("第{}行,{}",entity.getRowNum(),entity.getErrorMsg());//打印失败的行 和失败的信息 + numList.add(entity.getRowNum()); + } + //return new Result().error(8001,failList.get(0).getErrorMsg()); + } + List result =importResult.getList(); + + List resultList = houseService.importExcel(customerId,result,tokenDTO.getUserId(),numList); + String str = String.format("共%s条,成功导入%s条。",numList.size()+result.size(),numList.size()+result.size()-resultList.size()); + if(resultList.size()> NumConstant.ZERO){ + Collections.sort(resultList); + String subList = resultList.stream().map(String::valueOf).collect(Collectors.joining("、")); + log.warn(str + "第" + subList + "行未成功!"); + return new Result().error(9999, str+"第"+subList+"行未成功!"); + } + return new Result().ok(str); + } + + @PostMapping( "queryListHouseInfo") + Result> queryListHouseInfo(@RequestBody Set houseIds){ + return new Result>().ok(houseService.queryListHouseInfo(houseIds)); + } +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcBuildingController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcBuildingController.java new file mode 100644 index 0000000000..15ba83ef46 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcBuildingController.java @@ -0,0 +1,97 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.dto.result.OptionResultDTO; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.IcBuildingDTO; +import com.epmet.service.IcBuildingService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.Map; + + +/** + * 楼栋信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +@RestController +@RequestMapping("icbuilding") +public class IcBuildingController { + + @Autowired + private IcBuildingService icBuildingService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = icBuildingService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + IcBuildingDTO data = icBuildingService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody IcBuildingDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icBuildingService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody IcBuildingDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icBuildingService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + icBuildingService.delete(ids); + return new Result(); + } + + /** + * @Description 获取小区内的楼栋 + * @Param dto + * @Return {@link Result>} + * @Author zhaoqifeng + * @Date 2021/10/26 14:46 + */ + @PostMapping("buildingoption") + public Result> getBuildingOptions(@RequestBody IcBuildingDTO dto) { + return new Result>().ok(icBuildingService.getBuildingOptions(dto.getNeighborHoodId())); + } +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcBuildingUnitController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcBuildingUnitController.java new file mode 100644 index 0000000000..7ee2138893 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcBuildingUnitController.java @@ -0,0 +1,96 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.dto.result.OptionResultDTO; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.IcBuildingUnitDTO; +import com.epmet.service.IcBuildingUnitService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.Map; + + +/** + * 楼栋单元信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +@RestController +@RequestMapping("icbuildingunit") +public class IcBuildingUnitController { + + @Autowired + private IcBuildingUnitService icBuildingUnitService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = icBuildingUnitService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + IcBuildingUnitDTO data = icBuildingUnitService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody IcBuildingUnitDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icBuildingUnitService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody IcBuildingUnitDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icBuildingUnitService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + icBuildingUnitService.delete(ids); + return new Result(); + } + /** + * @Description 获取楼栋内单元 + * @Param dto + * @Return {@link Result>} + * @Author zhaoqifeng + * @Date 2021/10/26 14:46 + */ + @PostMapping("unitoption") + public Result> getUnitOptions(@RequestBody IcBuildingUnitDTO dto) { + return new Result>().ok(icBuildingUnitService.getUnitOptions(dto.getBuildingId())); + } +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcHouseController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcHouseController.java new file mode 100644 index 0000000000..2409edaad0 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcHouseController.java @@ -0,0 +1,117 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.dto.result.OptionResultDTO; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.IcHouseDTO; +import com.epmet.dto.form.HouseFormDTO; +import com.epmet.dto.result.HouseListResultDTO; +import com.epmet.service.IcHouseService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.Map; + + +/** + * 房屋信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +@RestController +@RequestMapping("ichouse") +public class IcHouseController { + + @Autowired + private IcHouseService icHouseService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = icHouseService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + IcHouseDTO data = icHouseService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody IcHouseDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icHouseService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody IcHouseDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icHouseService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + icHouseService.delete(ids); + return new Result(); + } + @PostMapping("houseoption") + public Result> getHouseOption(@RequestBody HouseFormDTO formDTO){ + return new Result>().ok(icHouseService.getHouseOption(formDTO)); + } + + /** + * @Description 查询房屋信息 + * @param idCard + * @author zxc + * @date 2021/11/3 3:30 下午 + */ + @PostMapping("selecthouseinfobyidcard") + public Result> selectHouseInfoByIdCard(@RequestParam("idCard")String idCard){ + return new Result>().ok(icHouseService.selectHouseInfoByIdCard(idCard)); + } + + /** + * @Description 房屋查询 + * @Param formDTO + * @Return {@link Result< List< HouseListResultDTO>>} + * @Author zhaoqifeng + * @Date 2021/11/5 16:01 + */ + @PostMapping("houselist") + public Result> getHouseList(@LoginUser TokenDto tokenDto, @RequestBody HouseFormDTO formDTO){ + return new Result>().ok(icHouseService.getHouseList(tokenDto, formDTO)); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcNeighborHoodController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcNeighborHoodController.java new file mode 100644 index 0000000000..fcd64c4658 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcNeighborHoodController.java @@ -0,0 +1,112 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.dto.result.OptionResultDTO; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.IcNeighborHoodDTO; +import com.epmet.service.IcNeighborHoodService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.Map; + + +/** + * 小区表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +@RestController +@RequestMapping("icneighborhood") +public class IcNeighborHoodController { + + @Autowired + private IcNeighborHoodService icNeighborHoodService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = icNeighborHoodService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + IcNeighborHoodDTO data = icNeighborHoodService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody IcNeighborHoodDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icNeighborHoodService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody IcNeighborHoodDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icNeighborHoodService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + icNeighborHoodService.delete(ids); + return new Result(); + } + + /** + * @Description 获取网格下小区列表 + * @Param dto + * @Return {@link Result< List< OptionResultDTO>>} + * @Author zhaoqifeng + * @Date 2021/10/26 14:38 + */ + @PostMapping("neighborhoodoption") + public Result> getNeighborHoodOptions(@LoginUser TokenDto tokenDto, @RequestBody IcNeighborHoodDTO dto) { + return new Result>().ok(icNeighborHoodService.getNeighborHoodOptions(dto.getAgencyId(), dto.getGridId(),tokenDto.getUserId(),tokenDto.getCustomerId())); + } + + /** + * @Description 通过ID查询小区信息 + * @Param ids + * @Return {@link Result< List< IcNeighborHoodDTO>>} + * @Author zhaoqifeng + * @Date 2021/11/8 10:46 + */ + @PostMapping("getlistbyids") + public Result> getListByIds(@RequestBody List ids) { + return new Result>().ok(icNeighborHoodService.getListByIds(ids)); + } + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcNeighborHoodPartController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcNeighborHoodPartController.java new file mode 100644 index 0000000000..1059863233 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcNeighborHoodPartController.java @@ -0,0 +1,84 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.IcNeighborHoodPartDTO; +import com.epmet.service.IcNeighborHoodPartService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Map; + + +/** + * 小区-分区表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +@RestController +@RequestMapping("icneighborhoodpart") +public class IcNeighborHoodPartController { + + @Autowired + private IcNeighborHoodPartService icNeighborHoodPartService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = icNeighborHoodPartService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + IcNeighborHoodPartDTO data = icNeighborHoodPartService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody IcNeighborHoodPartDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icNeighborHoodPartService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody IcNeighborHoodPartDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icNeighborHoodPartService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + icNeighborHoodPartService.delete(ids); + return new Result(); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcNeighborHoodPropertyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcNeighborHoodPropertyController.java new file mode 100644 index 0000000000..e5d0e61093 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcNeighborHoodPropertyController.java @@ -0,0 +1,85 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.IcNeighborHoodPropertyDTO; +import com.epmet.service.IcNeighborHoodPropertyService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Map; + + +/** + * 小区物业关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +@RestController +@RequestMapping("icneighborhoodproperty") +public class IcNeighborHoodPropertyController { + + @Autowired + private IcNeighborHoodPropertyService icNeighborHoodPropertyService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = icNeighborHoodPropertyService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + IcNeighborHoodPropertyDTO data = icNeighborHoodPropertyService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody IcNeighborHoodPropertyDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icNeighborHoodPropertyService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody IcNeighborHoodPropertyDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icNeighborHoodPropertyService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + icNeighborHoodPropertyService.delete(ids); + return new Result(); + } + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPropertyManagementController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPropertyManagementController.java new file mode 100644 index 0000000000..baa7c40fc4 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPropertyManagementController.java @@ -0,0 +1,87 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.IcPropertyManagementDTO; +import com.epmet.service.IcPropertyManagementService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 物业表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +@RestController +@RequestMapping("icpropertymanagement") +public class IcPropertyManagementController { + + @Autowired + private IcPropertyManagementService icPropertyManagementService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = icPropertyManagementService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + IcPropertyManagementDTO data = icPropertyManagementService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody IcPropertyManagementDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icPropertyManagementService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody IcPropertyManagementDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icPropertyManagementService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + icPropertyManagementService.delete(ids); + return new Result(); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/NeighborHoodController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/NeighborHoodController.java new file mode 100644 index 0000000000..1f54db3e1c --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/NeighborHoodController.java @@ -0,0 +1,234 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import cn.afterturn.easypoi.excel.entity.TemplateExportParams; +import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dao.IcBuildingDao; +import com.epmet.dto.form.IcNeighborHoodFormDTO; +import com.epmet.dto.form.ListIcNeighborHoodFormDTO; +import com.epmet.dto.result.IcNeighborHoodResultDTO; +import com.epmet.entity.IcBuildingEntity; +import com.epmet.excel.IcNeighborHoodExcel; +import com.epmet.service.BuildingService; +import com.epmet.service.HouseService; +import com.epmet.service.IcNeighborHoodService; +import com.epmet.service.NeighborHoodService; +import com.epmet.util.ExcelPoiUtils; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.CollectionUtils; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.*; +import java.util.stream.Collectors; + + +/** + * 小区表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +@Slf4j +@RestController +@RequestMapping("neighborhood") +public class NeighborHoodController { + + @Autowired + private IcNeighborHoodService icNeighborHoodService; + @Autowired + private NeighborHoodService neighborHoodService; + @Autowired + private BuildingService buildingService; + @Autowired + private HouseService houseService; + @Resource + private IcBuildingDao icBuildingDao; + + + + + @PostMapping("neighborhoodlist") + public Result neighborhoodlist(@RequestBody ListIcNeighborHoodFormDTO formDTO){ + //效验数据 + ValidatorUtils.validateEntity(formDTO); + IcNeighborHoodResultDTO icNeighborHoodResultDTO = neighborHoodService.listNeighborhood(formDTO); + return new Result().ok(icNeighborHoodResultDTO); + + } + + @NoRepeatSubmit + @PostMapping("neighborhoodadd") + public Result neighborhoodadd(@LoginUser TokenDto tokenDTO, @RequestBody IcNeighborHoodFormDTO formDTO){ + //效验数据 + ValidatorUtils.validateEntity(formDTO, IcNeighborHoodFormDTO.AddShowGroup.class); + String customerId = tokenDTO.getCustomerId(); +// String customerId = "123123"; + + neighborHoodService.AddNeighborhood(customerId,formDTO); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("neighborhoodupdate") + public Result neighborhoodupdate(@LoginUser TokenDto tokenDTO, @RequestBody IcNeighborHoodFormDTO formDTO){ + //效验数据 + ValidatorUtils.validateEntity(formDTO, IcNeighborHoodFormDTO.UpdateShowGroup.class); + String customerId = tokenDTO.getCustomerId(); +// String customerId = "123123"; + neighborHoodService.UpdateNeighborhood(customerId,formDTO); + return new Result(); + } + + @PostMapping("neighborhooddel") + public Result neighborhooddel(@LoginUser TokenDto tokenDTO, @RequestBody IcNeighborHoodFormDTO formDTO){ + //效验数据 + ValidatorUtils.validateEntity(formDTO, IcNeighborHoodFormDTO.DeleteGroup.class); + String neighborHoodId = formDTO.getNeighborHoodId(); + //判断是否存在楼宇,如果存在不能删除 + List icBuildingEntities = icBuildingDao.selectList(new QueryWrapper().lambda().eq(IcBuildingEntity::getNeighborHoodId, neighborHoodId)); + if(!CollectionUtils.isEmpty(icBuildingEntities)){ + return new Result().error(8001,"小区下已存在楼宇,无法删除"); + } + neighborHoodService.DelNeighborhood(neighborHoodId); + return new Result().ok("删除成功"); + } + + + /** + * 导出 + * @param formDTO + * @param response + * @throws Exception + */ + @PostMapping("exportneighborhoodinfo") + public void exportneighborhoodinfo(@RequestBody ListIcNeighborHoodFormDTO formDTO, HttpServletResponse response) throws Exception { + ValidatorUtils.validateEntity(formDTO); + neighborHoodService.exportNeighborhoodinfo(formDTO,response); + + } + /** + * 导出模板 + * @param response + * @throws Exception + */ + @PostMapping("exporttemplate") + public void exportTemplate( HttpServletResponse response) throws Exception { +// ValidatorUtils.validateEntity(ListIcNeighborHoodFormDTO.class); + TemplateExportParams templatePath = new TemplateExportParams("excel/neighbor_template.xlsx"); + Map map = new HashMap<>(); + map.put("maplist",new ArrayList()); + ExcelPoiUtils.exportExcel(templatePath ,map,"小区信息录入表",response); + + } + + /** + * 导出模板 + + * @param response + * @throws Exception + */ + /*@GetMapping("export") + public void export( HttpServletResponse response) throws Exception { + ValidatorUtils.validateEntity(ListIcNeighborHoodFormDTO.class); + TemplateExportParams templatePath = new TemplateExportParams("excel/neighbor_template.xlsx"); + Map map = new HashMap<>(); + map.put("maplist",new ArrayList()); + ExcelPoiUtils.exportExcel(templatePath ,map,"小区信息录入表",response); + + }*/ + /** + * 导出 + * @param response + * @throws Exception + */ + /* @RequestMapping("exportinfo") + public void exportinfo(HttpServletResponse response) throws Exception { + ListIcNeighborHoodFormDTO formDTO = new ListIcNeighborHoodFormDTO(); + ValidatorUtils.validateEntity(ListIcNeighborHoodFormDTO.class); + neighborHoodService.exportNeighborhoodinfo(formDTO,response); + + }*/ + + +// /** +// * 导入 +// * @param params +// * @param response +// * @throws Exception +// */ +// @PostMapping("importneighborhoodinfo") +// public void importneighborhoodinfo(@RequestParam Map params, HttpServletResponse response) throws Exception { +// List list = icNeighborHoodService.list(params); +// ExcelUtils.exportExcelToTarget(response, "小区信息录入表", list, IcNeighborHoodExcel.class); +//// ExcelUtils.expor +// } + + /** + * 导入数据 + * @param file + * @return + * @throws IOException + */ + @PostMapping("import") + public Result importExcel(@LoginUser TokenDto tokenDTO, @RequestParam("file") MultipartFile file) throws IOException { + + String customerId = tokenDTO.getCustomerId(); +// String customerId = "123123"; + ExcelImportResult importResult = ExcelPoiUtils.importExcelMore(file, 0, 1, IcNeighborHoodExcel.class); +// List result = ExcelPoiUtils.importExcel(file, 0, 1, IcNeighborHoodExcel.class); + List failList = importResult.getFailList(); + + //存放错误数据行号 + List numList = new ArrayList<>(); + if(!CollectionUtils.isEmpty(failList)){ + for ( IcNeighborHoodExcel entity : failList) { + log.error("第{}行,{}",entity.getRowNum(),entity.getErrorMsg());//打印失败的行 和失败的信息 + numList.add(entity.getRowNum()); + } + //return new Result().error(8001,failList.get(0).getErrorMsg()); + } + List result =importResult.getList(); +// log.info(JSON.toJSONString(result)); + List resultList = neighborHoodService.importExcel(customerId,result,tokenDTO.getUserId(),numList); + String str = String.format("共%s条,成功导入%s条。",numList.size()+result.size(),numList.size()+result.size()-resultList.size()); + if (resultList.size() > NumConstant.ZERO) { + Collections.sort(resultList); + String subList = resultList.stream().map(String::valueOf).collect(Collectors.joining("、")); + log.warn(str + "第" + subList + "行未成功!"); + return new Result().error(9999, str + "第" + subList + "行未成功!"); + } + return new Result().ok(str); + } + + + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/PropertyManagementController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/PropertyManagementController.java new file mode 100644 index 0000000000..6a38dd3e39 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/PropertyManagementController.java @@ -0,0 +1,89 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.form.IcPropertyManagementFormDTO; +import com.epmet.dto.result.IcPropertyManagementResultDTO; +import com.epmet.service.IcPropertyManagementService; +import com.epmet.service.PropertyManagementService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + +/** + * 物业表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +@RestController +@RequestMapping("propertymanagement") +public class PropertyManagementController { + + @Autowired + private IcPropertyManagementService icPropertyManagementService; + + @Autowired + private PropertyManagementService propertyManagementService; + + + @PostMapping("list") + public Result> list(){ + return new Result>().ok(propertyManagementService.getList()); + } + + + @PostMapping("add") + public Result add(@LoginUser TokenDto tokenDTO, @RequestBody IcPropertyManagementFormDTO formDTO){ + //效验数据 + ValidatorUtils.validateEntity(formDTO, IcPropertyManagementFormDTO.AddShowGroup.class); + Map map=new HashMap<>(); + map.put("propertyId",propertyManagementService.add(formDTO)); + return new Result().ok(map); + } + + + + @PostMapping("update") + public Result update(@LoginUser TokenDto tokenDTO, @RequestBody IcPropertyManagementFormDTO formDTO){ + //效验数据 + ValidatorUtils.validateEntity(formDTO, IcPropertyManagementFormDTO.UpdateShowGroup.class); + propertyManagementService.update(formDTO); + return new Result(); + } + + @PostMapping("delete") + public Result delete(@LoginUser TokenDto tokenDTO, @RequestBody IcPropertyManagementFormDTO formDTO){ + //效验数据 + ValidatorUtils.validateEntity(formDTO, IcPropertyManagementFormDTO.DeleteGroup.class); + propertyManagementService.delete(formDTO); + return new Result(); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java index 8968d6e288..24a007311e 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); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java index fae6640a7d..eca348b6f2 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java @@ -18,6 +18,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.commons.tools.dto.result.OptionResultDTO; import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.UserIdAndPidDTO; import com.epmet.dto.UserIdDTO; @@ -300,4 +301,48 @@ public interface CustomerGridDao extends BaseDao { * @date 2021/8/5 10:08 上午 */ List selectOrgsByUserId(@Param("userId") String userId); + + /** + * @Description 查询组织下的网格及网格下的小区、单元、楼栋 + * @Param agencyId + * @Return {@link List< GridTreeResultDTO>} + * @Author zhaoqifeng + * @Date 2021/10/25 15:19 + */ + List selectGridTree(@Param("agencyId") String agencyId); + + /** + * @Description 网格下小区列表 + * @Param gridId + * @Return {@link List< NeighborHoodDTO>} + * @Author zhaoqifeng + * @Date 2021/10/25 16:04 + */ + List selectNeighborHoodList(@Param("gridId") String gridId); + + /** + * @Description 小区下楼栋列表 + * @Param neighborHoodId + * @Return {@link List< BuildingDTO>} + * @Author zhaoqifeng + * @Date 2021/10/25 16:04 + */ + List selectBuildingList(@Param("neighborHoodId") String neighborHoodId); + + /** + * @Description 楼栋下单元列表 + * @Param buildingId + * @Return {@link List< UnitDTO>} + * @Author zhaoqifeng + * @Date 2021/10/25 16:04 + */ + List selectUnitList(@Param("buildingId") String buildingId); + + /** + * @Author sun + * @Description 查询组织下直属网格列表 + **/ + List selectByPid(@Param("pid") String pid); + + List getGridOptionForQuery(String gridPids); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingDao.java new file mode 100644 index 0000000000..6d029cb291 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingDao.java @@ -0,0 +1,76 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.BaseInfoFamilyBuildingResultDTO; +import com.epmet.dto.result.BuildingResultDTO; +import com.epmet.entity.CustomerAgencyEntity; +import com.epmet.entity.IcBuildingEntity; +import com.epmet.entity.IcHouseEntity; +import com.epmet.excel.IcBuildingExcel; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** + * 楼栋信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +@Mapper +public interface IcBuildingDao extends BaseDao { + +// IPage> searchBuildingByPage(IPage page, +// @Param("neighbor") IcNeighborHoodEntity neighbor, +// @Param("building")IcBuildingEntity building); + IPage> searchBuildingByPage(IPage page, + @Param("building")IcBuildingEntity building, @Param("house") IcHouseEntity house); + +// List searchAllBuilding(@Param(Constants.WRAPPER) QueryWrapper neighborHoodEntityQueryWrapper, +// @Param("ew1") QueryWrapper buildingEntityQueryWrapper); +// List searchAllBuilding(@Param("neighbor") IcNeighborHoodEntity neighbor, +// @Param("building")IcBuildingEntity building); + List searchAllBuilding( + @Param("building")IcBuildingEntity building, @Param("house")IcHouseEntity house); + + List selectAgencyChildrenList(@Param("agencyId") String agencyId); + + List> selectListByName(@Param("customerId") String customerId, + @Param("neighborNameList")ArrayList strings, + @Param("buildingNameList") ArrayList strings1, + @Param("buildingUnitList") ArrayList integers); + + /** + * @Description 根据neighborHoodId查询楼 + * @param neighborHoodId + * @author zxc + * @date 2021/11/2 9:25 上午 + */ + List baseInfoFamilyBuilding(@Param("neighborHoodId")String neighborHoodId); + + Integer checkBuildName(@Param("neighborHoodId") String neighborHoodId,@Param("buildingName")String buildingName, @Param("buildingId")String buildingId); + List buildingListByIds(@Param("buildingIdList") List buildingIdList); + IPage buildingListByIds(IPage page,@Param("buildingIdList") List buildingIdList); + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingUnitDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingUnitDao.java new file mode 100644 index 0000000000..69465df911 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingUnitDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcBuildingUnitEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 楼栋单元信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +@Mapper +public interface IcBuildingUnitDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java new file mode 100644 index 0000000000..1553cccc9d --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java @@ -0,0 +1,69 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.HouseInfoDTO; +import com.epmet.entity.IcHouseEntity; +import com.epmet.excel.IcHouseExcel; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * 房屋信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +@Mapper +public interface IcHouseDao extends BaseDao { + +// IPage> searchHouseByPage(IPage page, +// @Param(Constants.WRAPPER) QueryWrapper neighborHoodEntityQueryWrapper, +// @Param("ew1") QueryWrapper buildingEntityQueryWrapper, +// @Param("ew2") QueryWrapper houseEntityQueryWrapper); +// IPage> searchHouseByPage(IPage page, +// @Param("neighbor") IcNeighborHoodEntity neighbor, +// @Param("building") IcBuildingEntity building, +// @Param("house") IcHouseEntity house); + IPage> searchHouseByPage(IPage page, + @Param("house") IcHouseEntity house); + + List searchAllHouse(@Param("house") IcHouseEntity house); + + List queryHouseInfo(@Param("houseIdList") Set houseIdList); + + /** + * @Description 查询房屋信息 + * @param idCard + * @author zxc + * @date 2021/11/3 3:30 下午 + */ + List selectHouseInfoByIdCard(@Param("idCard") String idCard); + + Integer checkDoorNameUq(@Param("neighborHoodId") String neighborHoodId, + @Param("buildingId")String buildingId, + @Param("buildingUnitId")String buildingUnitId, + @Param("doorName")String doorName, + @Param("houseId")String houseId); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodDao.java new file mode 100644 index 0000000000..6e5d0487eb --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodDao.java @@ -0,0 +1,54 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcHouseEntity; +import com.epmet.entity.IcNeighborHoodEntity; +import com.epmet.excel.IcNeighborHoodExcel; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +/** + * 小区表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +@Mapper +public interface IcNeighborHoodDao extends BaseDao { + +// IPage> searchNeighborhoodByPage(IPage page,@Param(Constants.WRAPPER) QueryWrapper neighborHoodEntityQueryWrapper); + IPage> searchNeighborhoodByPage(IPage page, @Param("neighbor") IcNeighborHoodEntity neighbor, @Param("house")IcHouseEntity house); + +// List searchAllNeighborhood(@Param(Constants.WRAPPER) QueryWrapper neighborHoodEntityQueryWrapper); + List searchAllNeighborhood(@Param("neighbor") IcNeighborHoodEntity neighbor, @Param("house")IcHouseEntity house); + + List selectListByName(@Param("customerId") String customerId, + @Param("neighborNameList")List neighborNameList, + @Param("agencyNameList") List agencyNameList, + @Param("gridNameList") List gridNameList); + + Integer checkNameUq(@Param("customerId") String customerId, + @Param("neighborHoodName")String neighborHoodName, + @Param("neighborId")String neighborId); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodPartDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodPartDao.java new file mode 100644 index 0000000000..6b0154f538 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodPartDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcNeighborHoodPartEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 小区-分区表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +@Mapper +public interface IcNeighborHoodPartDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodPropertyDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodPropertyDao.java new file mode 100644 index 0000000000..79a71a11b8 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodPropertyDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcNeighborHoodPropertyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 小区物业关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +@Mapper +public interface IcNeighborHoodPropertyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPropertyManagementDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPropertyManagementDao.java new file mode 100644 index 0000000000..b79a5cc3e6 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPropertyManagementDao.java @@ -0,0 +1,34 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcPropertyManagementEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 物业表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +@Mapper +public interface IcPropertyManagementDao extends BaseDao { + + IcPropertyManagementEntity selectByName(String name); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerAgencyEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerAgencyEntity.java index ee327e421e..ff51b54c01 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerAgencyEntity.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerAgencyEntity.java @@ -108,4 +108,19 @@ public class CustomerAgencyEntity extends BaseEpmetEntity { * 【社区】名称0409 */ private String community; + + /** + * 坐标 + */ + private String coordinates; + + /** + * 中心位置经度 + */ + private String longitude; + + /** + * 中心位置纬度 + */ + private String latitude; } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerGridEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerGridEntity.java index 26d0cd84af..75674491f7 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerGridEntity.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerGridEntity.java @@ -79,4 +79,9 @@ public class CustomerGridEntity extends BaseEpmetEntity { * 所有上级组织ID */ private String pids; + + /** + * 坐标 + */ + private String coordinates; } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcBuildingEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcBuildingEntity.java new file mode 100644 index 0000000000..b4d4811caa --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcBuildingEntity.java @@ -0,0 +1,98 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 楼栋信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_building") +public class IcBuildingEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 小区id + */ + private String neighborHoodId; + + /** + * 片区id,neighbor_hood_part.id,可为空。 + */ + private String partId; + + /** + * 楼栋名称 + */ + private String buildingName; + + /** + * 楼栋类型,这里存储字典编码就可以 + */ + private String type; + + /** + * 排序 + */ + private Integer sort; + + /** + * 总单元数 + */ + private Integer totalUnitNum; + + /** + * 总楼层总数 + */ + private Integer totalFloorNum; + + /** + * 总户数 + */ + private Integer totalHouseNum; + + /** + * 中心点位:经度 + */ + private String longitude; + + /** + * 中心点位:纬度 + */ + private String latitude; + + /** + * 坐标位置 + */ + private String coordinatePosition; + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcBuildingUnitEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcBuildingUnitEntity.java new file mode 100644 index 0000000000..d7212ff143 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcBuildingUnitEntity.java @@ -0,0 +1,61 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 楼栋单元信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_building_unit") +public class IcBuildingUnitEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 楼宇id + */ + private String buildingId; + + /** + * 单元号:1,2,3?? + */ + private String unitNum; + + /** + * 单元名 + */ + private String unitName; + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcHouseEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcHouseEntity.java new file mode 100644 index 0000000000..4861c69271 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcHouseEntity.java @@ -0,0 +1,106 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 房屋信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_house") +public class IcHouseEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 小区id + */ + private String neighborHoodId; + + /** + * 片区id,neighbor_hood_part.id,可为空。 + */ + private String partId; + + /** + * 所属楼栋id + */ + private String buildingId; + + /** + * 所属单元id + */ + private String buildingUnitId; + + /** + * 房屋名字后台插入时生成 + */ + private String houseName; + + /** + * 门牌号 + */ + private String doorName; + + /** + * 房屋类型,这里存储字典value就可以 + */ + private String houseType; + + /** + * 存储字典value + */ + private String purpose; + + /** + * 1出租;0未出租 + */ + private Integer rentFlag; + + /** + * 房主姓名 + */ + private String ownerName; + + /** + * 房主电话 + */ + private String ownerPhone; + + /** + * 房主身份证号 + */ + private String ownerIdCard; + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/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..ed1afb786a --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcBuildingExcel.java @@ -0,0 +1,127 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import com.epmet.util.ExcelVerifyInfo; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + * 楼栋信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-27 + */ +@Data +public class IcBuildingExcel extends ExcelVerifyInfo implements Serializable { + + /*@Excel(name = "楼栋主键") + private String id; + + @Excel(name = "客户id") + private String customerId; + + @Excel(name = "小区id") + private String neighborHoodId; + + @Excel(name = "片区id,neighbor_hood_part.id,可为空。") + private String partId; + + @Excel(name = "楼栋名称") + private String buildingName; + + @Excel(name = "楼栋类型,这里存储字典编码就可以") + private String type; + + @Excel(name = "排序") + private Integer sort; + + @Excel(name = "总单元数") + private Integer totalUnitNum; + + @Excel(name = "总楼层总数") + private Integer totalFloorNum; + + @Excel(name = "总户数") + private Integer totalHouseNum; + + @Excel(name = "中心点位:经度") + private String longitude; + + @Excel(name = "中心点位:纬度") + private String latitude; + + @Excel(name = "坐标位置") + private String coordinatePosition; + + @Excel(name = "删除标识 0未删除、1已删除") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime;*/ + + @Excel(name = "所属组织") + @NotBlank(message = "不能为空") + private String agencyName; + + @Excel(name = "所属网格") + @NotBlank(message = "不能为空") + private String gridName; + + @Excel(name = "小区名称") + @NotBlank(message = "不能为空") + @Length(max=50,message = "不能超过50个字") + private String neighborHoodName; + + @Excel(name = "楼栋名称") + @NotBlank(message = "不能为空") + private String buildingName; + + @Excel(name = "楼栋类型") + @NotBlank(message = "不能为空") + private String type; + + @Excel(name = "单元数") + @NotNull(message = "不能为空") + private Integer totalUnitNum; + + @Excel(name = "层数") + @NotNull(message = "不能为空") + private Integer totalFloorNum; + + @Excel(name = "户数") + @NotNull(message = "不能为空") + private Integer totalHouseNum; +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcHouseExcel.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcHouseExcel.java new file mode 100644 index 0000000000..be6ba11d2f --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcHouseExcel.java @@ -0,0 +1,147 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import com.epmet.util.ExcelVerifyInfo; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + * 房屋信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-27 + */ +@Data +public class IcHouseExcel extends ExcelVerifyInfo implements Serializable { + + /*@Excel(name = "房屋主键") + private String id; + + @Excel(name = "客户id") + private String customerId; + + @Excel(name = "小区id") + private String neighborHoodId; + + @Excel(name = "片区id,neighbor_hood_part.id,可为空。") + private String partId; + + @Excel(name = "所属楼栋id") + private String buildingId; + + @Excel(name = "所属单元id") + private String buildingUnitId; + + @Excel(name = "房屋名字后台插入时生成") + private String houseName; + + @Excel(name = "门牌号") + private String doorName; + + @Excel(name = "房屋类型,这里存储字典value就可以") + private String houseType; + + @Excel(name = "存储字典value") + private String purpose; + + @Excel(name = "1出租;0未出租") + private Integer rentFlag; + + @Excel(name = "房主姓名") + private String ownerName; + + @Excel(name = "房主电话") + private String ownerPhone; + + @Excel(name = "房主身份证号") + private String ownerIdCard; + + @Excel(name = "删除标识 0未删除、1已删除") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime;*/ + + @Excel(name = "所属组织") + @NotBlank(message = "不能为空") + private String agencyName; + + @Excel(name = "所属网格") + @NotBlank(message = "不能为空") + private String gridName; + + @Excel(name = "所属小区") + @NotBlank(message = "不能为空") + @Length(max=50,message = "不能超过50个字") + private String neighborHoodName; + + @Excel(name = "所属楼栋") + @NotBlank(message = "不能为空") + private String buildingName; + + @Excel(name = "单元号") + @NotNull(message = "不能为空") + private Integer buildingUnit; + + @Excel(name = "门牌号") + @NotBlank(message = "不能为空") + private String doorName; + + @Excel(name = "房屋类型") + @NotBlank(message = "不能为空") + private String houseType; + + @Excel(name = "房屋用途") + @NotBlank(message = "不能为空") + private String purpose; + + @Excel(name = "出租") + @NotBlank(message = "不能为空") + private String rentFlag; + + @Excel(name = "房主姓名") + @NotBlank(message = "不能为空") + private String ownerName; + + @Excel(name = "房主电话") + @NotBlank(message = "不能为空") + private String ownerPhone; + + @Excel(name = "房主身份证") + @NotBlank(message = "不能为空") + private String ownerIdCard; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcNeighborHoodExcel.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcNeighborHoodExcel.java new file mode 100644 index 0000000000..72c57047e0 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcNeighborHoodExcel.java @@ -0,0 +1,124 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.util.ExcelVerifyInfo; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.Date; + +/** + * 小区表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +@Data +public class IcNeighborHoodExcel extends ExcelVerifyInfo implements Serializable { + + /*@Excel(name = "小区主键") + private String id; + + @Excel(name = "客户id") + private String customerId; + + @Excel(name = "小区名称") + private String neighborHoodName; + + @Excel(name = "组织id") + private String agencyId; + + @Excel(name = "上级组织id") + private String parentAgencyId; + + @Excel(name = "组织的所有上级组织id") + private String agencyPids; + + @Excel(name = "网格id") + private String gridId; + + @Excel(name = "详细地址") + private String address; + + @Excel(name = "备注") + private String remark; + + @Excel(name = "中心点位:经度") + private String longitude; + + @Excel(name = "中心点位:纬度") + private String latitude; + + @Excel(name = "坐标区域") + private String coordinates; + + @Excel(name = "坐标位置") + private String location; + + @Excel(name = "删除标识 0未删除、1已删除") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime;*/ + + + + + @Excel(name = "所属组织") + @NotBlank(message = "不能为空") + private String agencyName; + + @Excel(name = "所属网格") + @NotBlank(message = "不能为空") + private String gridName; + + @Excel(name = "小区名称") + @NotBlank(message = "不能为空") + @Length(max=50,message = "不能超过50个字") + private String neighborHoodName; + + @Excel(name = "关联物业") + private String propertyName; + + @Excel(name = "详细地址") + @NotBlank(message = "不能为空") + private String address; + + @Excel(name = "备注") + @Length(max=500,message = "不能超过500个字") + private String remark; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/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 6a73e676d9..9a2fd83d82 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..3a78628602 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/BuildingService.java @@ -0,0 +1,65 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.dto.BuildingTreeLevelDTO; +import com.epmet.dto.form.IcBulidingFormDTO; +import com.epmet.dto.form.ListIcNeighborHoodFormDTO; +import com.epmet.dto.result.BuildingResultDTO; +import com.epmet.dto.result.BuildingResultPagedDTO; +import com.epmet.dto.result.IcNeighborHoodResultDTO; +import com.epmet.excel.IcBuildingExcel; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +/** + * 楼栋 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +public interface BuildingService { + + + + + + void UpdateBuilding(String customerId, IcBulidingFormDTO formDTO); + + /** + * 删除小区 + * @param buildingId + */ + void DelBuilding(String buildingId); + + + void AddBuilding(String customerId, IcBulidingFormDTO formDTO); + + List treeList(String customerId); + + List importExcel(String customerId, List list, String staffId, List numList); + + IcNeighborHoodResultDTO listBuilding(ListIcNeighborHoodFormDTO formDTO); + + void exportBuildinginfo(ListIcNeighborHoodFormDTO formDTO, HttpServletResponse response) throws Exception ; + + List buildingListByIds(List buildingIdList); + + BuildingResultPagedDTO buildinglistbyidsPage(List buildingIdList, Integer pageNo, Integer pageSize); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java index 96932318db..b9292396d8 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 @@ -261,4 +261,6 @@ public interface CustomerAgencyService extends BaseService * @return */ AgencyTreeResultDTO getOrgTreeData(String staffId); + + List getStaffOrgListByStaffId(String staffId); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java index 91525436ba..7538c7bb29 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,String purpose); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerPartyBranchService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerPartyBranchService.java index e373bcb0f1..9cd6efe4b9 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerPartyBranchService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerPartyBranchService.java @@ -18,6 +18,7 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.dto.result.OptionResultDTO; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.CustomerPartyBranchDTO; import com.epmet.dto.form.ListPartyBranchFormDTO; @@ -112,4 +113,13 @@ public interface CustomerPartyBranchService extends BaseService} + * @Author zhaoqifeng + * @Date 2021/10/27 9:57 + */ + List getBranchOption(String gridId); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java new file mode 100644 index 0000000000..48ab8c7d1b --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java @@ -0,0 +1,57 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.dto.form.IcHouseFormDTO; +import com.epmet.dto.form.ListIcNeighborHoodFormDTO; +import com.epmet.dto.result.HouseInfoDTO; +import com.epmet.dto.result.IcNeighborHoodResultDTO; +import com.epmet.excel.IcHouseExcel; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Set; + +/** + * 小区表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +public interface HouseService { + + void addHouse(String customerId, IcHouseFormDTO formDTO); + + + void updateHouse(String customerId, IcHouseFormDTO formDTO); + + /** + * 删除小区 + * @param houseId + */ + void delHouse(String houseId); + + + List importExcel(String customerId, List list, String staffId, List numList); + + IcNeighborHoodResultDTO listNeighborhood(ListIcNeighborHoodFormDTO formDTO); + + void exportBuildinginfo(ListIcNeighborHoodFormDTO formDTO, HttpServletResponse response) throws Exception; + + List queryListHouseInfo(Set houseIds); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcBuildingService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcBuildingService.java new file mode 100644 index 0000000000..5b5ff7d05d --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcBuildingService.java @@ -0,0 +1,105 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.dto.result.OptionResultDTO; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcBuildingDTO; +import com.epmet.entity.IcBuildingEntity; + +import java.util.List; +import java.util.Map; + +/** + * 楼栋信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +public interface IcBuildingService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-10-25 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-10-25 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcBuildingDTO + * @author generator + * @date 2021-10-25 + */ + IcBuildingDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-10-25 + */ + void save(IcBuildingDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-10-25 + */ + void update(IcBuildingDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-10-25 + */ + void delete(String[] ids); + + /** + * @Description 获取小区内的楼栋 + * @Param neighborHoodId + * @Return {@link List< OptionResultDTO>} + * @Author zhaoqifeng + * @Date 2021/10/26 14:43 + */ + List getBuildingOptions(String neighborHoodId); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcBuildingUnitService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcBuildingUnitService.java new file mode 100644 index 0000000000..40045f2b75 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcBuildingUnitService.java @@ -0,0 +1,105 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.dto.result.OptionResultDTO; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcBuildingUnitDTO; +import com.epmet.entity.IcBuildingUnitEntity; + +import java.util.List; +import java.util.Map; + +/** + * 楼栋单元信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +public interface IcBuildingUnitService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-10-25 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-10-25 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcBuildingUnitDTO + * @author generator + * @date 2021-10-25 + */ + IcBuildingUnitDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-10-25 + */ + void save(IcBuildingUnitDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-10-25 + */ + void update(IcBuildingUnitDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-10-25 + */ + void delete(String[] ids); + + /** + * @Description 获取楼栋内单元 + * @Param buildingId + * @Return {@link List} + * @Author zhaoqifeng + * @Date 2021/10/26 14:49 + */ + List getUnitOptions(String buildingId); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcHouseService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcHouseService.java new file mode 100644 index 0000000000..66f02d80fa --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcHouseService.java @@ -0,0 +1,127 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.dto.result.OptionResultDTO; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.dto.IcHouseDTO; +import com.epmet.dto.form.HouseFormDTO; +import com.epmet.dto.result.HouseListResultDTO; +import com.epmet.entity.IcHouseEntity; + +import java.util.List; +import java.util.Map; + +/** + * 房屋信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +public interface IcHouseService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-10-25 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-10-25 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcHouseDTO + * @author generator + * @date 2021-10-25 + */ + IcHouseDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-10-25 + */ + void save(IcHouseDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-10-25 + */ + void update(IcHouseDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-10-25 + */ + void delete(String[] ids); + + /** + * @Description 获取楼栋房屋列表 + * @Param formDTO + * @Return {@link List} + * @Author zhaoqifeng + * @Date 2021/10/25 17:04 + */ + List getHouseOption(HouseFormDTO formDTO); + + /** + * @Description 查询房屋信息 + * @param idCard + * @author zxc + * @date 2021/11/3 3:30 下午 + */ + List selectHouseInfoByIdCard(String idCard); + + /** + * @Description 楼栋下房屋列表 + * @Param tokenDto + * @Param formDTO + * @Return {@link List< HouseListResultDTO>} + * @Author zhaoqifeng + * @Date 2021/11/5 16:01 + */ + List getHouseList(TokenDto tokenDto, HouseFormDTO formDTO); + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcNeighborHoodPartService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcNeighborHoodPartService.java new file mode 100644 index 0000000000..787f8a534a --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcNeighborHoodPartService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcNeighborHoodPartDTO; +import com.epmet.entity.IcNeighborHoodPartEntity; + +import java.util.List; +import java.util.Map; + +/** + * 小区-分区表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +public interface IcNeighborHoodPartService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-10-25 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-10-25 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcNeighborHoodPartDTO + * @author generator + * @date 2021-10-25 + */ + IcNeighborHoodPartDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-10-25 + */ + void save(IcNeighborHoodPartDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-10-25 + */ + void update(IcNeighborHoodPartDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-10-25 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcNeighborHoodPropertyService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcNeighborHoodPropertyService.java new file mode 100644 index 0000000000..e9df133f87 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcNeighborHoodPropertyService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcNeighborHoodPropertyDTO; +import com.epmet.entity.IcNeighborHoodPropertyEntity; + +import java.util.List; +import java.util.Map; + +/** + * 小区物业关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +public interface IcNeighborHoodPropertyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-10-25 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-10-25 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcNeighborHoodPropertyDTO + * @author generator + * @date 2021-10-25 + */ + IcNeighborHoodPropertyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-10-25 + */ + void save(IcNeighborHoodPropertyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-10-25 + */ + void update(IcNeighborHoodPropertyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-10-25 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcNeighborHoodService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcNeighborHoodService.java new file mode 100644 index 0000000000..3592d82175 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcNeighborHoodService.java @@ -0,0 +1,115 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.dto.result.OptionResultDTO; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcNeighborHoodDTO; +import com.epmet.entity.IcNeighborHoodEntity; + +import java.util.List; +import java.util.Map; + +/** + * 小区表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +public interface IcNeighborHoodService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-10-25 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-10-25 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcNeighborHoodDTO + * @author generator + * @date 2021-10-25 + */ + IcNeighborHoodDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-10-25 + */ + void save(IcNeighborHoodDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-10-25 + */ + void update(IcNeighborHoodDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-10-25 + */ + void delete(String[] ids); + + /** + * @Description 获取网格下小区列表 + * @Param agencyId + * @Param gridId + * @Return {@link List} + * @Author zhaoqifeng + * @Date 2021/10/26 14:32 + */ + List getNeighborHoodOptions(String agencyId, String gridId,String staffId,String customerId); + + /** + * @Description 通过ID查询小区信息 + * @Param ids + * @Return {@link List< IcNeighborHoodDTO>} + * @Author zhaoqifeng + * @Date 2021/11/8 10:45 + */ + List getListByIds(List ids); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPropertyManagementService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPropertyManagementService.java new file mode 100644 index 0000000000..bc808af034 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPropertyManagementService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcPropertyManagementDTO; +import com.epmet.entity.IcPropertyManagementEntity; + +import java.util.List; +import java.util.Map; + +/** + * 物业表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +public interface IcPropertyManagementService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-10-25 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-10-25 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcPropertyManagementDTO + * @author generator + * @date 2021-10-25 + */ + IcPropertyManagementDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-10-25 + */ + void save(IcPropertyManagementDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-10-25 + */ + void update(IcPropertyManagementDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-10-25 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/NeighborHoodService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/NeighborHoodService.java new file mode 100644 index 0000000000..ff1a35f45a --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/NeighborHoodService.java @@ -0,0 +1,56 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.dto.form.IcNeighborHoodFormDTO; +import com.epmet.dto.form.ListIcNeighborHoodFormDTO; +import com.epmet.dto.result.IcNeighborHoodResultDTO; +import com.epmet.excel.IcNeighborHoodExcel; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +/** + * 小区表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +public interface NeighborHoodService{ + + void AddNeighborhood(String customerId, IcNeighborHoodFormDTO formDTO); + + IcNeighborHoodResultDTO listNeighborhood(ListIcNeighborHoodFormDTO formDTO); + + void UpdateNeighborhood(String customerId, IcNeighborHoodFormDTO formDTO); + + /** + * 删除小区 + * @param neighborHoodId + */ + void DelNeighborhood(String neighborHoodId); + + /** + * 导出数据 + * @param formDTO + * @param response + */ + void exportNeighborhoodinfo(ListIcNeighborHoodFormDTO formDTO, HttpServletResponse response) throws Exception ; + + List importExcel(String customerId, List list, String staffId, List numList); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/PropertyManagementService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/PropertyManagementService.java new file mode 100644 index 0000000000..7bbbad3616 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/PropertyManagementService.java @@ -0,0 +1,39 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.dto.form.IcPropertyManagementFormDTO; +import com.epmet.dto.result.IcPropertyManagementResultDTO; + +import java.util.List; + +/** + * 物业表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +public interface PropertyManagementService { + + List getList(); + + String add(IcPropertyManagementFormDTO formDTO); + + void update(IcPropertyManagementFormDTO formDTO); + void delete(IcPropertyManagementFormDTO formDTO); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java index c192390708..e9747050e3 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java @@ -18,23 +18,30 @@ 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; @@ -52,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; @@ -85,6 +93,8 @@ public class AgencyServiceImpl implements AgencyService { private EpmetCommonServiceOpenFeignClient epmetCommonServiceOpenFeignClient; @Autowired private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; + @Autowired + private IcBuildingDao icBuildingDao; /** @@ -489,6 +499,128 @@ public class AgencyServiceImpl implements AgencyService { 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..f1c5d28379 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java @@ -0,0 +1,500 @@ +package com.epmet.service.impl; + +import cn.afterturn.easypoi.excel.entity.TemplateExportParams; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.*; +import com.epmet.dto.BuildingTreeLevelDTO; +import com.epmet.dto.CustomerStaffAgencyDTO; +import com.epmet.dto.IcBuildingDTO; +import com.epmet.dto.form.IcBulidingFormDTO; +import com.epmet.dto.form.ListIcNeighborHoodFormDTO; +import com.epmet.dto.result.BuildingResultDTO; +import com.epmet.dto.result.BuildingResultPagedDTO; +import com.epmet.dto.result.IcNeighborHoodResultDTO; +import com.epmet.entity.*; +import com.epmet.enums.BuildingTypeEnums; +import com.epmet.excel.IcBuildingExcel; +import com.epmet.service.BuildingService; +import com.epmet.service.IcBuildingService; +import com.epmet.service.IcBuildingUnitService; +import com.epmet.service.IcHouseService; +import com.epmet.util.ExcelPoiUtils; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import java.util.*; +import java.util.function.Function; +import java.util.stream.Collectors; + +@Slf4j +@Service +public class BuildingServiceImpl implements BuildingService { + + + @Autowired + private IcBuildingService icBuildingService; + @Resource + private IcBuildingDao icBuildingDao; + + @Autowired + private IcBuildingUnitService icBuildingUnitService; + + @Resource + private IcHouseDao icHouseDao; + @Autowired + private IcHouseService icHouseService; + + @Resource + private CustomerAgencyDao customerAgencyDao; + @Resource + private CustomerGridDao customerGridDao; + @Resource + private IcNeighborHoodDao icNeighborHoodDao; + @Resource + private CustomerStaffAgencyDao customerStaffAgencyDao; + @Resource + private IcBuildingUnitDao icBuildingUnitDao; + + @Override + @Transactional(rollbackFor = Exception.class) + public void AddBuilding(String customerId, IcBulidingFormDTO formDTO) { + //同一小区下不能存在楼栋名字一样的 + Integer count = icBuildingDao.checkBuildName(formDTO.getNeighborHoodId(),formDTO.getBuildingName(),null); + if (null != count && count > 0) { + throw new RenException(EpmetErrorCode.BUILDING_NAME_EXITED.getCode(),EpmetErrorCode.BUILDING_NAME_EXITED.getMsg()); + } + IcBuildingDTO icBuildingDTO= ConvertUtils.sourceToTarget(formDTO, IcBuildingDTO.class); + icBuildingDTO.setCustomerId(customerId); + IcBuildingEntity entity = ConvertUtils.sourceToTarget(icBuildingDTO, IcBuildingEntity.class); + icBuildingDao.insert(entity); + + //设置楼宇单元 + Integer totalUnitNum = formDTO.getTotalUnitNum(); + List unitList = new ArrayList<>(); + for(int i =0 ;i treeList(String staffId) { + CustomerStaffAgencyDTO agency = customerStaffAgencyDao.selectLatestCustomerByStaff(staffId); + if(null == agency || StringUtils.isBlank(agency.getAgencyId())){ + log.error("com.epmet.service.impl.BuildingServiceImpl.treeList,没有找到工作人员所属的机关信息,用户Id:{}",staffId); + return new ArrayList<>(); + } + +// agency = new CustomerStaffAgencyDTO(); +// agency.setAgencyId("77f6bc7f07064bf4c09ef848139a344c"); + //1.获取所在组织及下级组织 + CustomerAgencyEntity customerAgency = customerAgencyDao.selectById(agency.getAgencyId()); + List customerAgencyList = icBuildingDao.selectAgencyChildrenList(agency.getAgencyId()); + customerAgencyList.add(customerAgency); + + if(CollectionUtils.isEmpty(customerAgencyList)){ + return new ArrayList<>(); + } + + List agencyList = customerAgencyList.stream().map(item -> { + BuildingTreeLevelDTO buildingTreeLevelDTO = new BuildingTreeLevelDTO(); + buildingTreeLevelDTO.setId(item.getId()); + buildingTreeLevelDTO.setPId(item.getPid()); + buildingTreeLevelDTO.setLabel(item.getOrganizationName()); + buildingTreeLevelDTO.setLevel(item.getLevel()); + buildingTreeLevelDTO.setLongitude(item.getLongitude()); + buildingTreeLevelDTO.setLatitude(item.getLatitude()); + buildingTreeLevelDTO.setChildren(new ArrayList<>()); + return buildingTreeLevelDTO; + }).collect(Collectors.toList()); + + + + //2.获取组织所在网格 + List agencyIdList = customerAgencyList.stream().map(a->a.getId()).collect(Collectors.toList()); +// agencyIdList.add(customerAgency.getId()); + List customerGridList = customerGridDao.selectList(new QueryWrapper().lambda().in(CustomerGridEntity::getPid, agencyIdList)); + + if(CollectionUtils.isEmpty(customerGridList)){ + return covertToTree(customerAgency,agencyList); + } + + List gridList = customerGridList.stream().map(item -> { + BuildingTreeLevelDTO buildingTreeLevelDTO = new BuildingTreeLevelDTO(); + buildingTreeLevelDTO.setId(item.getId()); + buildingTreeLevelDTO.setLabel(item.getGridName()); + buildingTreeLevelDTO.setLevel("grid"); + buildingTreeLevelDTO.setPId(item.getPid()); + buildingTreeLevelDTO.setLongitude(item.getLongitude()); + buildingTreeLevelDTO.setLatitude(item.getLatitude()); + buildingTreeLevelDTO.setChildren(new ArrayList<>()); + return buildingTreeLevelDTO; + }).collect(Collectors.toList()); + + + //3.获取网格下的所有小区 + List gridIdList = customerGridList.stream().map(a->a.getId()).collect(Collectors.toList()); + List icNeighborHoodList = icNeighborHoodDao.selectList(new QueryWrapper().lambda().in(IcNeighborHoodEntity::getGridId, gridIdList)); + if(CollectionUtils.isEmpty(icNeighborHoodList)){ + agencyList.addAll(gridList); + return covertToTree(customerAgency,agencyList); + } + List neighbourHoodList = icNeighborHoodList.stream().map(item -> { + BuildingTreeLevelDTO buildingTreeLevelDTO = new BuildingTreeLevelDTO(); + buildingTreeLevelDTO.setId(item.getId()); + buildingTreeLevelDTO.setPId(item.getGridId()); + buildingTreeLevelDTO.setLabel(item.getNeighborHoodName()); + buildingTreeLevelDTO.setLevel("neighbourHood"); + buildingTreeLevelDTO.setLongitude(item.getLongitude()); + buildingTreeLevelDTO.setLatitude(item.getLatitude()); + buildingTreeLevelDTO.setChildren(new ArrayList<>()); + return buildingTreeLevelDTO; + }).collect(Collectors.toList()); + + //3.获取小区下的所有楼宇 + List neighborHoodIdList = icNeighborHoodList.stream().map(a->a.getId()).collect(Collectors.toList()); + List icBuildingList = icBuildingDao.selectList(new QueryWrapper().lambda().in(IcBuildingEntity::getNeighborHoodId, neighborHoodIdList)); + + if(CollectionUtils.isEmpty(neighborHoodIdList)){ + agencyList.addAll(gridList); + agencyList.addAll(neighbourHoodList); + return covertToTree(customerAgency,agencyList); + } + //组合封装 + + List buildingList = icBuildingList.stream().map(item -> { + BuildingTreeLevelDTO buildingTreeLevelDTO = new BuildingTreeLevelDTO(); + buildingTreeLevelDTO.setId(item.getId()); + buildingTreeLevelDTO.setPId(item.getNeighborHoodId()); + buildingTreeLevelDTO.setLabel(item.getBuildingName()); + buildingTreeLevelDTO.setLevel("building"); + buildingTreeLevelDTO.setLongitude(item.getLongitude()); + buildingTreeLevelDTO.setLatitude(item.getLatitude()); + buildingTreeLevelDTO.setChildren(new ArrayList<>()); + return buildingTreeLevelDTO; + }).collect(Collectors.toList()); + + + + + //组织 +// gridList.stream() +// Map> gridMap = gridList.stream().collect(Collectors.groupingBy(e -> e.getPId())); +// List allList = agencyList.addAll(gridList) + + agencyList.addAll(gridList); + agencyList.addAll(neighbourHoodList); + agencyList.addAll(buildingList); + return covertToTree(customerAgency,agencyList); + + } + + @Override + @Transactional(rollbackFor = Exception.class) + public List importExcel(String customerId, List list, String staffId, List numList) { + //2021.11.9 需求变更 当前工作人员只能导致自己所属组织下数据,网格名对应不上的数据舍弃【注:需求就这样】 sun + CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(customerId, staffId); + //组织名称不一样的数据舍弃 + Iterator iterator = list.iterator(); + while (iterator.hasNext()) { + IcBuildingExcel obj = iterator.next(); + if (!obj.getAgencyName().trim().equals(staffInfoCache.getAgencyName())) { + numList.add(obj.getRowNum()); + iterator.remove(); + } + } + //用于存储匹配不上的数据给前端的提示 如南宁社区不存在 + //StringBuffer str = new StringBuffer(""); + //end sun + //导入 + if(CollectionUtils.isEmpty(list)){ + return numList; + } + //查询所有组织和网格根据名字 + + + + //获取所有小区 list 根据组织和网格 + Set neighborNameList = list.stream().map(item -> item.getNeighborHoodName()).collect(Collectors.toSet()); + Set agencyNameList = list.stream().map(item -> item.getAgencyName()).collect(Collectors.toSet()); + Set gridNameList = list.stream().map(item -> item.getGridName()).collect(Collectors.toSet()); + List neighborHoodList = icNeighborHoodDao.selectListByName(customerId, new ArrayList(neighborNameList),new ArrayList(agencyNameList),new ArrayList(gridNameList)); +// List neighborHoodList = icNeighborHoodDao.selectList(new QueryWrapper().lambda().in(IcNeighborHoodEntity::getNeighborHoodName, neighborNameList)); + Map neighborHoodMap = neighborHoodList.stream().collect(Collectors.toMap(IcNeighborHoodEntity::getNeighborHoodName, Function.identity(),(key1, key2)->key1)); + + + //2.获取小区数据 + //封装数据 + List buildingEntityList = new ArrayList<>(); + List icBuildingUnitEntityList = new ArrayList<>(); + Iterator iterator1 = list.iterator(); + while (iterator1.hasNext()) { + IcBuildingExcel icBuildingExcel = iterator1.next(); + IcBuildingEntity entity = new IcBuildingEntity(); + String uuid = UUID.randomUUID().toString().replace("-", ""); + entity.setId(uuid); + entity.setCustomerId(customerId); + entity.setNeighborHoodId(Optional.ofNullable(neighborHoodMap.get(icBuildingExcel.getNeighborHoodName())).map(u->u.getId()).orElse(""));//neighborHoodMap.get(icBuildingExcel.getNeighborHoodName()).getId() + if ("".equals(entity.getNeighborHoodId())) { + //str.append("".equals(str) ? icBuildingExcel.getNeighborHoodName() : str.append("、").append(icBuildingExcel.getNeighborHoodName())); + numList.add(icBuildingExcel.getRowNum()); + iterator1.remove(); + continue; + } + entity.setBuildingName(icBuildingExcel.getBuildingName()); + entity.setType(BuildingTypeEnums.getKeyByValue(icBuildingExcel.getType())); + entity.setSort(0); + entity.setTotalUnitNum(icBuildingExcel.getTotalUnitNum()); + entity.setTotalFloorNum(icBuildingExcel.getTotalFloorNum()); + entity.setTotalHouseNum(icBuildingExcel.getTotalHouseNum()); + buildingEntityList.add(entity); + + Integer totalUnitNum = icBuildingExcel.getTotalUnitNum(); + //设置楼宇单元 + List unitList = new ArrayList<>(); + for(int i =0 ;i 0) { + //throw new RenException(EpmetErrorCode.BUILDING_NAME_EXITED.getCode(),EpmetErrorCode.BUILDING_NAME_EXITED.getMsg()); + log.error(EpmetErrorCode.BUILDING_NAME_EXITED.getMsg()); + numList.add(icBuildingExcel.getRowNum()); + iterator1.remove(); + continue; + } + icBuildingUnitEntityList.addAll(unitList); + } + //3.保存 + //4.新增单元 + icBuildingService.insertBatch(buildingEntityList); + icBuildingUnitService.insertBatch(icBuildingUnitEntityList); + + /* if(!"".equals(str)){ + return new Result().error(9999, str.append("不存在").toString()); + }*/ + return numList; + } + + @Override + public IcNeighborHoodResultDTO listBuilding(ListIcNeighborHoodFormDTO formDTO) { + + IcNeighborHoodResultDTO result = new IcNeighborHoodResultDTO(); + IPage> resultMap = searchBuilding(formDTO); + result.setTotal(Long.valueOf(resultMap.getTotal()).intValue()); + result.setList(resultMap.getRecords()); + return result; + } + + @Override + public void exportBuildinginfo(ListIcNeighborHoodFormDTO formDTO, HttpServletResponse response) throws Exception { + //如果类型是building 查楼栋 + //导出楼栋 + List icBuildingExcels = searchAllBuilding(formDTO); + TemplateExportParams templatePath = new TemplateExportParams("excel/building_export.xlsx"); + Map map = new HashMap<>(); + map.put("maplist",icBuildingExcels); + ExcelPoiUtils.exportExcel(templatePath ,map,"楼宇信息录入表",response); + return ; + } + @Override + public List buildingListByIds(List buildingIdList) { + return icBuildingDao.buildingListByIds(buildingIdList); + } + @Override + public BuildingResultPagedDTO buildinglistbyidsPage(List buildingIdList,Integer pageNo, Integer pageSize) { + IPage page = new Page(pageNo,pageSize); + IPage buildingResultDTOIPage = icBuildingDao.buildingListByIds(page, buildingIdList); + BuildingResultPagedDTO result = new BuildingResultPagedDTO(); + result.setTotal(Long.valueOf(buildingResultDTOIPage.getTotal()).intValue()); + result.setList(buildingResultDTOIPage.getRecords()); + + return result; + } + + private List searchAllBuilding(ListIcNeighborHoodFormDTO formDTO) { + +// QueryWrapper neighborHoodEntityQueryWrapper = new QueryWrapper<>(); +// neighborHoodEntityQueryWrapper.lambda() +// .eq(!StringUtils.isEmpty(formDTO.getAgencyId()),IcNeighborHoodEntity::getAgencyId,formDTO.getAgencyId()) +// .eq(!StringUtils.isEmpty(formDTO.getGridId()),IcNeighborHoodEntity::getId,formDTO.getGridId()) +// .eq(!StringUtils.isEmpty(formDTO.getNeighborHoodId()),IcNeighborHoodEntity::getId,formDTO.getNeighborHoodId()) +// .like(!StringUtils.isEmpty(formDTO.getNeighborHoodName()),IcNeighborHoodEntity::getNeighborHoodName,formDTO.getNeighborHoodName()); +// IcNeighborHoodEntity neighbor = ConvertUtils.sourceToTarget(formDTO, IcNeighborHoodEntity.class); + +// QueryWrapper buildingEntityQueryWrapper = new QueryWrapper<>(); +// buildingEntityQueryWrapper.lambda() +// .eq(!StringUtils.isEmpty(formDTO.getBuildingId()),IcBuildingEntity::getId,formDTO.getBuildingId()) +// .like(!StringUtils.isEmpty(formDTO.getBuildingName()),IcBuildingEntity::getBuildingName,formDTO.getBuildingName()); +// buildingEntityQueryWrapper.eq("a.DEL_FLAG","0"); + IcBuildingEntity building = ConvertUtils.sourceToTarget(formDTO, IcBuildingEntity.class); + building.setDelFlag("0"); + IcHouseEntity house = ConvertUtils.sourceToTarget(formDTO, IcHouseEntity.class); + List icBuildingExcels = icBuildingDao.searchAllBuilding(building, house); + icBuildingExcels.forEach(item->{ + item.setType(BuildingTypeEnums.getTypeValue(item.getType())); + }); + return icBuildingExcels; + } + + private IPage> searchBuilding(ListIcNeighborHoodFormDTO formDTO) { + IPage page = new Page(formDTO.getPageNo(),formDTO.getPageSize()); + +// IcNeighborHoodEntity neighbor = new IcNeighborHoodEntity(); +// IcNeighborHoodEntity neighbor = ConvertUtils.sourceToTarget(formDTO, IcNeighborHoodEntity.class); + +// QueryWrapper neighborHoodEntityQueryWrapper = new QueryWrapper<>(); +// neighborHoodEntityQueryWrapper.lambda() +// .eq(!StringUtils.isEmpty(formDTO.getAgencyId()),IcNeighborHoodEntity::getAgencyId,formDTO.getAgencyId()) +// .eq(!StringUtils.isEmpty(formDTO.getGridId()),IcNeighborHoodEntity::getId,formDTO.getGridId()) +// .eq(!StringUtils.isEmpty(formDTO.getNeighborHoodId()),IcNeighborHoodEntity::getId,formDTO.getNeighborHoodId()) +// .like(!StringUtils.isEmpty(formDTO.getNeighborHoodName()),IcNeighborHoodEntity::getNeighborHoodName,formDTO.getNeighborHoodName()); + + + IcBuildingEntity building = ConvertUtils.sourceToTarget(formDTO, IcBuildingEntity.class); + building.setDelFlag("0"); +// QueryWrapper buildingEntityQueryWrapper = new QueryWrapper<>(); +// +// buildingEntityQueryWrapper.lambda() +// .eq(!StringUtils.isEmpty(formDTO.getBuildingId()),IcBuildingEntity::getId,formDTO.getBuildingId()) +// .like(!StringUtils.isEmpty(formDTO.getBuildingName()),IcBuildingEntity::getBuildingName,formDTO.getBuildingName()); +// buildingEntityQueryWrapper.eq("a.DEL_FLAG","0"); + IcHouseEntity house = ConvertUtils.sourceToTarget(formDTO, IcHouseEntity.class); + IPage> mapIPage = icBuildingDao.searchBuildingByPage(page, building, house); + List> records = mapIPage.getRecords(); + records.forEach(item->{ + item.put("buildingType", BuildingTypeEnums.getTypeValue(item.get("buildingTypeKey"))); + }); + return mapIPage; + } + + + private List covertToTree(CustomerAgencyEntity customerAgency,List agencyList) { + BuildingTreeLevelDTO buildingTreeLevelDTO = new BuildingTreeLevelDTO(); + buildingTreeLevelDTO.setId(customerAgency.getId()); + buildingTreeLevelDTO.setLabel(customerAgency.getOrganizationName()); + buildingTreeLevelDTO.setLevel(customerAgency.getLevel()); + buildingTreeLevelDTO.setLongitude(customerAgency.getLongitude()); + buildingTreeLevelDTO.setLatitude(customerAgency.getLatitude()); + buildingTreeLevelDTO.setChildren(new ArrayList<>()); + recursionCovertToTree(buildingTreeLevelDTO,agencyList); + List result = new ArrayList<>(); + result.add(buildingTreeLevelDTO); + return result; + } + + private void recursionCovertToTree(BuildingTreeLevelDTO parent, List customerAgencyList) { + //获取子节点 + List subList = customerAgencyList.stream().filter(item -> item.getPId().equals(parent.getId())).collect(Collectors.toList()); + + for(BuildingTreeLevelDTO agencyEntity :subList){ + recursionCovertToTree(agencyEntity,customerAgencyList); + } + parent.setChildren(subList); + + } + + + + /** + * 更新 + * @param customerId + * @param formDTO + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void UpdateBuilding(String customerId, IcBulidingFormDTO formDTO) { + //同一小区下不能存在楼栋名字一样的 + Integer count = icBuildingDao.checkBuildName(formDTO.getNeighborHoodId(),formDTO.getBuildingName(),formDTO.getBuildingId()); + if (null != count && count > 0) { + throw new RenException(EpmetErrorCode.BUILDING_NAME_EXITED.getCode(),EpmetErrorCode.BUILDING_NAME_EXITED.getMsg()); + } + + IcBuildingDTO icBuilding= icBuildingService.get(formDTO.getBuildingId()); + + if(!icBuilding.getNeighborHoodId().equals(formDTO.getNeighborHoodId())){ + //更新对应房屋小区id + List icHouseEntities = icHouseDao.selectList(new QueryWrapper().lambda().eq(IcHouseEntity::getBuildingId, formDTO.getBuildingId())); + if(!CollectionUtils.isEmpty(icHouseEntities)){ + // + throw new RenException(EpmetErrorCode.ORG_EDIT_FAILED.getCode(),"楼宇单元下存在房屋,无法更新"); +// icHouseEntities.forEach(item->{ +// item.setNeighborHoodId(formDTO.getNeighborHoodId()); +// }); +// icHouseService.updateBatchById(icHouseEntities); + } + } + IcBuildingDTO icBuildingDTO= ConvertUtils.sourceToTarget(formDTO, IcBuildingDTO.class); + icBuildingDTO.setId(formDTO.getBuildingId()); + icBuildingDTO.setCustomerId(customerId); + icBuildingService.update(icBuildingDTO); + //更新楼宇单元 + //如果楼宇单元大于之前的楼宇单元,新增单元 + Integer nowUnit= formDTO.getTotalUnitNum(); + Integer unit = icBuilding.getTotalUnitNum(); + if(nowUnit>=unit){ + //新增单元 + List unitList = new ArrayList<>(); + for(int i =unit ;i icHouseEntities = icHouseDao.selectList(new QueryWrapper().lambda().eq(IcHouseEntity::getBuildingId, buildingId)); + if(!CollectionUtils.isEmpty(icHouseEntities)){ + throw new RenException(EpmetErrorCode.ORG_DEL_FAILED.getCode(),"楼宇单元下存在房屋,无法删除"); + } + //删除楼宇 + icBuildingService.deleteById(buildingId); + //删除楼宇单元 + icBuildingUnitDao.delete(new QueryWrapper().lambda().eq(IcBuildingUnitEntity::getBuildingId,buildingId)); + + } + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java index 451a50deb9..de90539444 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 @@ -1180,4 +1180,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 ab3641d1ef..8dac4ed55f 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,6 +18,7 @@ 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; @@ -25,6 +26,7 @@ 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; @@ -50,6 +52,7 @@ 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; @@ -792,4 +795,56 @@ public class CustomerGridServiceImpl extends BaseServiceImpl selectOrgsByUserId(String userId) { return baseDao.selectOrgsByUserId(userId); } + + /** + * @param formDTO + * @Description 获取组织下网格树 + * @Param formDTO + * @Return {@link List} + * @Author zhaoqifeng + * @Date 2021/10/25 16:28 + */ + @Override + public List getGridTree(AgencyIdFormDTO formDTO) { + return baseDao.selectGridTree(formDTO.getAgencyId()); + } + + /** + * @param agencyId + * @Description 获取组织下网格选项 + * @Param agencyId + * @Return {@link List< OptionResultDTO >} + * @Author zhaoqifeng + * @Date 2021/10/26 14:01 + */ + @Override + public List getGridOption(String agencyId, String purpose) { + //查询条件和查看居民详情:query;新增或修改居民信息:addorupdate + if ("query".equals(purpose) || StringUtils.isEmpty(purpose)) { + CustomerAgencyDTO customerAgencyDTO = customerAgencyService.get(agencyId); + String gridPids = ""; + if (null != customerAgencyDTO) { + if (StringUtils.isEmpty(customerAgencyDTO.getPid()) || NumConstant.ZERO_STR.equals(customerAgencyDTO.getPid())) { + gridPids = agencyId; + } else { + gridPids = customerAgencyDTO.getPids().concat(StrConstant.COLON).concat(agencyId); + } + } + return baseDao.getGridOptionForQuery(gridPids); + } + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(CustomerGridEntity::getPid, agencyId); + wrapper.last("ORDER BY CONVERT ( GRID_NAME USING gbk ) ASC"); + List list = baseDao.selectList(wrapper); + if (CollectionUtils.isEmpty(list)) { + return Collections.emptyList(); + } + return list.stream().map(item -> { + OptionResultDTO dto = new OptionResultDTO(); + dto.setLabel(item.getGridName()); + dto.setValue(item.getId()); + return dto; + }).collect(Collectors.toList()); + } + } 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..4ff3bb2948 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java @@ -0,0 +1,297 @@ +package com.epmet.service.impl; + +import cn.afterturn.easypoi.excel.entity.TemplateExportParams; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.IcBuildingDao; +import com.epmet.dao.IcBuildingUnitDao; +import com.epmet.dao.IcHouseDao; +import com.epmet.dao.IcNeighborHoodDao; +import com.epmet.dto.IcBuildingDTO; +import com.epmet.dto.IcBuildingUnitDTO; +import com.epmet.dto.IcHouseDTO; +import com.epmet.dto.form.IcHouseFormDTO; +import com.epmet.dto.form.ListIcNeighborHoodFormDTO; +import com.epmet.dto.result.HouseInfoDTO; +import com.epmet.dto.result.IcNeighborHoodResultDTO; +import com.epmet.entity.IcHouseEntity; +import com.epmet.enums.HousePurposeEnums; +import com.epmet.enums.HouseRentFlagEnums; +import com.epmet.enums.HouseTypeEnums; +import com.epmet.excel.IcHouseExcel; +import com.epmet.service.HouseService; +import com.epmet.service.IcBuildingService; +import com.epmet.service.IcBuildingUnitService; +import com.epmet.service.IcHouseService; +import com.epmet.util.ExcelPoiUtils; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import java.util.*; +import java.util.stream.Collectors; + +@Slf4j +@Service +public class HouseServiceImpl implements HouseService { + + + + @Autowired + private IcHouseService icHouseService; + @Autowired + private IcBuildingService icBuildingService; + @Autowired + private IcBuildingUnitService icBuildingUnitService; + @Resource + private IcNeighborHoodDao icNeighborHoodDao; + @Resource + private IcBuildingDao icBuildingDao; + @Resource + private IcBuildingUnitDao icBuildingUnitDao; + @Resource + private IcHouseDao icHouseDao; + + @Override + @Transactional(rollbackFor = Exception.class) + public void addHouse(String customerId, IcHouseFormDTO formDTO) { + //同一楼栋,单元内,房屋名称唯一 + Integer count = icHouseDao.checkDoorNameUq(formDTO.getNeighborHoodId(), formDTO.getBuildingId(), formDTO.getBuildingUnitId(), formDTO.getDoorName(),null); + if (null != count && count > 0) { + throw new RenException(EpmetErrorCode.DOOR_NAME_EXITED.getCode(), EpmetErrorCode.DOOR_NAME_EXITED.getMsg()); + } + IcHouseDTO icHouseDTO= ConvertUtils.sourceToTarget(formDTO, IcHouseDTO.class); + icHouseDTO.setCustomerId(customerId); +// icHouseDTO.setRentFlag(formDTO.getRentFlag()); + + icHouseDTO.setHouseName(getHouseName(formDTO)); + icHouseService.save(icHouseDTO); + } + + private String getHouseName(IcHouseFormDTO formDTO){ + //设置房间名 楼栋-单元号-门牌号 + IcBuildingDTO icBuilding = icBuildingService.get(formDTO.getBuildingId()); + IcBuildingUnitDTO icBuildingUnit = icBuildingUnitService.get(formDTO.getBuildingUnitId()); + String doorName = formDTO.getDoorName(); + String buildingName = Optional.ofNullable(icBuilding).map(u->u.getBuildingName()).orElse(""); + String unitName = Optional.ofNullable(icBuildingUnit).map(u->u.getUnitNum()).orElse(""); + return new StringBuilder().append(buildingName).append("-").append(unitName).append("-").append(doorName).toString(); + } + + /** + * 更新 + * @param customerId + * @param formDTO + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void updateHouse(String customerId, IcHouseFormDTO formDTO) { + //同一楼栋,单元内,房屋名称唯一 + Integer count = icHouseDao.checkDoorNameUq(formDTO.getNeighborHoodId(), formDTO.getBuildingId(), formDTO.getBuildingUnitId(),formDTO.getDoorName(), formDTO.getHouseId()); + if (null != count && count > 0) { + throw new RenException(EpmetErrorCode.DOOR_NAME_EXITED.getCode(), EpmetErrorCode.DOOR_NAME_EXITED.getMsg()); + } + IcHouseDTO icHouseDTO = ConvertUtils.sourceToTarget(formDTO, IcHouseDTO.class); + icHouseDTO.setId(formDTO.getHouseId()); + icHouseDTO.setCustomerId(customerId); + icHouseDTO.setRentFlag(formDTO.getRentFlag()); + //设置 + icHouseDTO.setHouseName(getHouseName(formDTO)); + icHouseService.update(icHouseDTO); + } + + /** + * 删除 + * @param houseId + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void delHouse(String houseId) { + //删除小区 + icHouseService.deleteById(houseId); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public List importExcel(String customerId, List list, String staffId, List numList) { + //2021.11.10 需求变更 当前工作人员只能导致自己所属组织下数据,对应不上的数据舍弃【注:需求就这样】 sun + CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(customerId, staffId); + //组织名称不一样的数据舍弃 + Iterator iterator = list.iterator(); + while (iterator.hasNext()) { + IcHouseExcel obj = iterator.next(); + if (!obj.getAgencyName().trim().equals(staffInfoCache.getAgencyName())) { + numList.add(obj.getRowNum()); + iterator.remove(); + } + } + //用于存储匹配不上的数据给前端的提示 如南宁社区不存在 + //StringBuffer str = new StringBuffer(""); + //end sun + //导入 + if(CollectionUtils.isEmpty(list)){ + return numList; + } + //获取所有小区 list +// List neighborNameList = list.stream().map(item -> item.getNeighborHoodName()).collect(Collectors.toList()); +// List neighborHoodList = icNeighborHoodDao.selectList(new QueryWrapper().lambda().in(IcNeighborHoodEntity::getNeighborHoodName, neighborNameList)); +// Map neighborHoodMap = neighborHoodList.stream().collect(Collectors.toMap(IcNeighborHoodEntity::getNeighborHoodName, Function.identity(),(key1, key2)->key1)); + + //获取所有楼宇 list +// List buildingNameList = list.stream().map(item -> item.getBuildingName()).collect(Collectors.toList()); + +// icBuildingDao.selectList(new QueryWrapper().lambda().in(IcBuildingEntity::getBuildingName, buildingNameList).in(); + Set neighborNameList = list.stream().map(item -> item.getNeighborHoodName()).collect(Collectors.toSet()); + Set buildingNameList = list.stream().map(item -> item.getBuildingName()).collect(Collectors.toSet()); + Set buildingUnitList = list.stream().map(item -> item.getBuildingUnit()).collect(Collectors.toSet()); + List> buildMapList = icBuildingDao.selectListByName(customerId, new ArrayList(neighborNameList),new ArrayList(buildingNameList),new ArrayList(buildingUnitList)); + //转Map + Map> buildMap = new HashMap<>(); + buildMapList.forEach(item->{ + buildMap.put(item.get("neighborName")+","+item.get("buildingName")+","+item.get("unitNum"),item); + }); + //封装数据 + List houseEntityList = new ArrayList<>(); + Iterator iterator1 = list.iterator(); + while (iterator1.hasNext()) { + IcHouseExcel icHouseExcel = iterator1.next(); + IcHouseEntity entity = new IcHouseEntity(); + String uuid = UUID.randomUUID().toString().replace("-", ""); + entity.setId(uuid); + entity.setCustomerId(customerId); + Map item = buildMap.get(icHouseExcel.getNeighborHoodName()+","+icHouseExcel.getBuildingName()+","+icHouseExcel.getBuildingUnit()); + + entity.setNeighborHoodId(String.valueOf(Optional.ofNullable(item).map(u->u.get("neighborId")).orElse(""))); + entity.setBuildingId(String.valueOf(Optional.ofNullable(item).map(u->u.get("buildingId")).orElse(""))); + entity.setBuildingUnitId(String.valueOf(Optional.ofNullable(item).map(u->u.get("buildingUnitId")).orElse(""))); + entity.setHouseName(icHouseExcel.getBuildingName()+"-"+icHouseExcel.getBuildingUnit()+"-"+icHouseExcel.getDoorName()); + if ("".equals(entity.getNeighborHoodId()) || "".equals(entity.getBuildingId()) || "".equals(entity.getBuildingUnitId())) { + //str.append("".equals(str) ? icHouseExcel.getBuildingName() + icHouseExcel.getBuildingUnit() : str.append("、").append(icHouseExcel.getBuildingName() + icHouseExcel.getBuildingUnit())); + numList.add(icHouseExcel.getRowNum()); + iterator1.remove(); + continue; + } + entity.setDoorName(icHouseExcel.getDoorName()); + entity.setHouseType(HouseTypeEnums.getKeyByValue(icHouseExcel.getHouseType())); + entity.setPurpose(HousePurposeEnums.getKeyByValue(icHouseExcel.getPurpose())); + entity.setRentFlag(HouseRentFlagEnums.getCodeByName(icHouseExcel.getRentFlag())); + entity.setOwnerName(icHouseExcel.getOwnerName()); + entity.setOwnerPhone(icHouseExcel.getOwnerPhone()); + entity.setOwnerIdCard(icHouseExcel.getOwnerIdCard()); + //同一楼栋,单元内,房屋名称唯一 + Integer count = icHouseDao.checkDoorNameUq(entity.getNeighborHoodId(), entity.getBuildingId(), entity.getBuildingUnitId(), entity.getDoorName(),null); + if (null != count && count > 0) { + //throw new RenException(EpmetErrorCode.DOOR_NAME_EXITED.getCode(), EpmetErrorCode.DOOR_NAME_EXITED.getMsg()); + log.error(EpmetErrorCode.DOOR_NAME_EXITED.getMsg()); + numList.add(icHouseExcel.getRowNum()); + iterator1.remove(); + continue; + } + houseEntityList.add(entity); + } + //3.保存 + icHouseService.insertBatch(houseEntityList); + + /*if(!"".equals(str)){ + return new Result().error(9999, str.append("不存在").toString()); + }*/ + return numList; + + } + + @Override + public IcNeighborHoodResultDTO listNeighborhood(ListIcNeighborHoodFormDTO formDTO) { + IcNeighborHoodResultDTO result = new IcNeighborHoodResultDTO(); + //如果类型是house 查房屋 + IPage> resultMap = searchHouse(formDTO); + result.setTotal(Long.valueOf(resultMap.getTotal()).intValue()); + result.setList(resultMap.getRecords()); + return result; + } + + @Override + public void exportBuildinginfo(ListIcNeighborHoodFormDTO formDTO, HttpServletResponse response) throws Exception { + //如果类型是house 查房屋 + //导出房屋 + + List icHouseExcels = searchAllHouse(formDTO); + TemplateExportParams templatePath = new TemplateExportParams("excel/house_export.xlsx"); + Map map = new HashMap<>(); + map.put("maplist",icHouseExcels); + ExcelPoiUtils.exportExcel(templatePath ,map,"房屋信息录入表",response); + + return ; + } + private List searchAllHouse(ListIcNeighborHoodFormDTO formDTO) { + + //IcNeighborHoodEntity neighbor = ConvertUtils.sourceToTarget(formDTO, IcNeighborHoodEntity.class); + // + //IcBuildingEntity building = ConvertUtils.sourceToTarget(formDTO, IcBuildingEntity.class); + + + IcHouseEntity house = ConvertUtils.sourceToTarget(formDTO, IcHouseEntity.class); + house.setDelFlag("0"); + + List icHouseExcels = icHouseDao.searchAllHouse(house); + icHouseExcels.forEach(item->{ + item.setHouseType(HouseTypeEnums.getTypeValue(item.getHouseType())); + item.setPurpose(HousePurposeEnums.getTypeValue(item.getPurpose())); + }); + return icHouseExcels; + } + + private IPage> searchHouse(ListIcNeighborHoodFormDTO formDTO) { + IPage page = new Page(formDTO.getPageNo(),formDTO.getPageSize()); + +// QueryWrapper neighborHoodEntityQueryWrapper = new QueryWrapper<>(); +// neighborHoodEntityQueryWrapper.lambda() +// .eq(!StringUtils.isEmpty(formDTO.getAgencyId()),IcNeighborHoodEntity::getAgencyId,formDTO.getAgencyId()) +// .eq(!StringUtils.isEmpty(formDTO.getGridId()),IcNeighborHoodEntity::getId,formDTO.getGridId()) +// .eq(!StringUtils.isEmpty(formDTO.getNeighborHoodId()),IcNeighborHoodEntity::getId,formDTO.getNeighborHoodId()) +// .like(!StringUtils.isEmpty(formDTO.getNeighborHoodName()),IcNeighborHoodEntity::getNeighborHoodName,formDTO.getNeighborHoodName()); +// IcNeighborHoodEntity neighbor = ConvertUtils.sourceToTarget(formDTO, IcNeighborHoodEntity.class); + + +// QueryWrapper buildingEntityQueryWrapper = new QueryWrapper<>(); +// buildingEntityQueryWrapper.lambda() +// .eq(!StringUtils.isEmpty(formDTO.getBuildingId()),IcBuildingEntity::getId,formDTO.getBuildingId()) +// .like(!StringUtils.isEmpty(formDTO.getBuildingName()),IcBuildingEntity::getBuildingName,formDTO.getBuildingName()); +// IcBuildingEntity building = ConvertUtils.sourceToTarget(formDTO, IcBuildingEntity.class); + + +// QueryWrapper houseEntityQueryWrapper = new QueryWrapper<>(); +// houseEntityQueryWrapper.lambda() +// .eq(!StringUtils.isEmpty(formDTO.getOwnerName()),IcHouseEntity::getOwnerName,formDTO.getOwnerName()) +// .like(!StringUtils.isEmpty(formDTO.getOwnerPhone()),IcHouseEntity::getOwnerPhone,formDTO.getOwnerPhone()); +// houseEntityQueryWrapper.eq("a.DEL_FLAG","0"); + + IcHouseEntity house = ConvertUtils.sourceToTarget(formDTO, IcHouseEntity.class); + house.setDelFlag("0"); + + IPage> mapIPage = icHouseDao.searchHouseByPage(page, house); + List> records = mapIPage.getRecords(); + records.forEach(item->{ + item.put("houseType", HouseTypeEnums.getTypeValue(item.get("houseTypeKey"))); +// item.put("rentFlag", HouseRentFlagEnums.getTypeValue(item.get("rentFlagKey") )); + item.put("purpose", HousePurposeEnums.getTypeValue(item.get("purposeKey"))); + }); + return mapIPage; + } + + @Override + public List queryListHouseInfo(Set houseIdList) { + if(org.apache.commons.collections4.CollectionUtils.isEmpty(houseIdList)){ + return new ArrayList<>(); + } + return icHouseDao.queryHouseInfo(houseIdList); + } +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcBuildingServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcBuildingServiceImpl.java new file mode 100644 index 0000000000..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..914bc68a56 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java @@ -0,0 +1,238 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.dto.result.OptionResultDTO; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dao.IcHouseDao; +import com.epmet.dto.IcHouseDTO; +import com.epmet.dto.IcResiCategoryStatsConfigDTO; +import com.epmet.dto.IcResiUserDTO; +import com.epmet.dto.form.HouseFormDTO; +import com.epmet.dto.result.HouseListResultDTO; +import com.epmet.entity.IcHouseEntity; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.feign.OperCustomizeOpenFeignClient; +import com.epmet.service.IcHouseService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 房屋信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +@Slf4j +@Service +public class IcHouseServiceImpl extends BaseServiceImpl implements IcHouseService { + @Resource + private OperCustomizeOpenFeignClient operCustomizeOpenFeignClient; + @Resource + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcHouseDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcHouseDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcHouseDTO get(String id) { + IcHouseEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcHouseDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcHouseDTO dto) { + IcHouseEntity entity = ConvertUtils.sourceToTarget(dto, IcHouseEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcHouseDTO dto) { + IcHouseEntity entity = ConvertUtils.sourceToTarget(dto, IcHouseEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @param formDTO + * @Description 获取楼栋房屋列表 + * @Param formDTO + * @Return {@link List} + * @Author zhaoqifeng + * @Date 2021/10/25 17:04 + */ + @Override + public List getHouseOption(HouseFormDTO formDTO) { + if (StringUtils.isBlank(formDTO.getBuildingId()) && StringUtils.isBlank(formDTO.getUnitId())) { + log.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()); + } + + /** + * @Description 查询房屋信息 + * @param idCard + * @author zxc + * @date 2021/11/3 3:30 下午 + */ + @Override + public List selectHouseInfoByIdCard(String idCard) { + List result = baseDao.selectHouseInfoByIdCard(idCard); + if (CollectionUtils.isEmpty(result)){ + return new ArrayList<>(); + } + return result; + } + + /** + * @param formDTO + * @Description 楼栋下房屋列表 + * @Param tokenDto + * @Param formDTO + * @Return {@link List< HouseListResultDTO >} + * @Author zhaoqifeng + * @Date 2021/11/5 16:01 + */ + @Override + public List getHouseList(TokenDto tokenDto, HouseFormDTO formDTO) { + //查询楼栋下房屋列表 + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcHouseEntity::getBuildingId, formDTO.getBuildingId()); + wrapper.last("ORDER BY CONVERT ( HOUSE_NAME USING gbk ) ASC"); + List list = baseDao.selectList(wrapper); + if(CollectionUtils.isEmpty(list)) { + return Collections.emptyList(); + } + //获取居民分类列表 + IcResiCategoryStatsConfigDTO categoryDto = new IcResiCategoryStatsConfigDTO(); + categoryDto.setCustomerId(tokenDto.getCustomerId()); + Result> categoryResult = operCustomizeOpenFeignClient.getCategoryList(categoryDto); + if (!categoryResult.success()) { + throw new RenException(categoryResult.getCode(), categoryResult.getMsg()); + } + List categoryList = categoryResult.getData(); + //获取居民分类数量统计 + IcResiUserDTO userDTO = new IcResiUserDTO(); + userDTO.setBuildId(formDTO.getBuildingId()); + Result>> resultMap = epmetUserOpenFeignClient.getHomeUserCategoryCount(userDTO); + if (!resultMap.success()) { + throw new RenException(resultMap.getCode(), resultMap.getMsg()); + } + Map> map = resultMap.getData(); + + return list.stream().map(item -> { + Map countMap = map.get(item.getId()); + HouseListResultDTO dto = new HouseListResultDTO(); + dto.setHouseId(item.getId()); + dto.setHouseName(item.getHouseName()); + List categories = new ArrayList<>(); + if (null != countMap && CollectionUtils.isNotEmpty(categoryList)) { + for (IcResiCategoryStatsConfigDTO category : categoryList) { + if (null == countMap.get(category.getColumnName()) || NumConstant.ZERO_STR.equals(countMap.get(category.getColumnName()))) { + continue; + } + HouseListResultDTO.CategoryListBean bean = new HouseListResultDTO.CategoryListBean(); + bean.setName(category.getLabel()); + bean.setIconUrl(category.getHouseShowIcon()); + if ("党员".equals(category.getLabel())) { + bean.setIsSpecial(NumConstant.ONE_STR); + } else { + bean.setIsSpecial(NumConstant.ZERO_STR); + } + categories.add(bean); + } + } + //将党员放在最前面 + if(CollectionUtils.isNotEmpty(categories)) { + int a = 0; + for (int i = 0; i < categories.size(); i++) { + if ("党员".equals(categories.get(i).getName())) { + a = i; + break; + } + } + categories.add(NumConstant.ZERO, categories.remove(a)); + } + dto.setCategoryList(categories); + return dto; + }).collect(Collectors.toList()); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodPartServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodPartServiceImpl.java new file mode 100644 index 0000000000..b9b3fc4a24 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodPartServiceImpl.java @@ -0,0 +1,101 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.IcNeighborHoodPartDao; +import com.epmet.dto.IcNeighborHoodPartDTO; +import com.epmet.entity.IcNeighborHoodPartEntity; +import com.epmet.service.IcNeighborHoodPartService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 小区-分区表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +@Service +public class IcNeighborHoodPartServiceImpl extends BaseServiceImpl implements IcNeighborHoodPartService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcNeighborHoodPartDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcNeighborHoodPartDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcNeighborHoodPartDTO get(String id) { + IcNeighborHoodPartEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcNeighborHoodPartDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcNeighborHoodPartDTO dto) { + IcNeighborHoodPartEntity entity = ConvertUtils.sourceToTarget(dto, IcNeighborHoodPartEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcNeighborHoodPartDTO dto) { + IcNeighborHoodPartEntity entity = ConvertUtils.sourceToTarget(dto, IcNeighborHoodPartEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodPropertyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodPropertyServiceImpl.java new file mode 100644 index 0000000000..d4f877114a --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodPropertyServiceImpl.java @@ -0,0 +1,101 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.IcNeighborHoodPropertyDao; +import com.epmet.dto.IcNeighborHoodPropertyDTO; +import com.epmet.entity.IcNeighborHoodPropertyEntity; +import com.epmet.service.IcNeighborHoodPropertyService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 小区物业关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +@Service +public class IcNeighborHoodPropertyServiceImpl extends BaseServiceImpl implements IcNeighborHoodPropertyService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcNeighborHoodPropertyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcNeighborHoodPropertyDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcNeighborHoodPropertyDTO get(String id) { + IcNeighborHoodPropertyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcNeighborHoodPropertyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcNeighborHoodPropertyDTO dto) { + IcNeighborHoodPropertyEntity entity = ConvertUtils.sourceToTarget(dto, IcNeighborHoodPropertyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcNeighborHoodPropertyDTO dto) { + IcNeighborHoodPropertyEntity entity = ConvertUtils.sourceToTarget(dto, IcNeighborHoodPropertyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodServiceImpl.java new file mode 100644 index 0000000000..3d5b6fa96b --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodServiceImpl.java @@ -0,0 +1,163 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.dto.result.OptionResultDTO; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.IcNeighborHoodDao; +import com.epmet.dto.IcNeighborHoodDTO; +import com.epmet.entity.IcNeighborHoodEntity; +import com.epmet.service.IcNeighborHoodService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 小区表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +@Slf4j +@Service +public class IcNeighborHoodServiceImpl extends BaseServiceImpl implements IcNeighborHoodService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcNeighborHoodDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcNeighborHoodDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcNeighborHoodDTO get(String id) { + IcNeighborHoodEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcNeighborHoodDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcNeighborHoodDTO dto) { + IcNeighborHoodEntity entity = ConvertUtils.sourceToTarget(dto, IcNeighborHoodEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcNeighborHoodDTO dto) { + IcNeighborHoodEntity entity = ConvertUtils.sourceToTarget(dto, IcNeighborHoodEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @Description 获取网格下小区列表 + * @param agencyId + * @Param gridId + * @Return {@link List< OptionResultDTO >} + * @Author zhaoqifeng + * @Date 2021/10/26 14:32 + */ + @Override + public List getNeighborHoodOptions(String agencyId, String gridId,String staffId,String customerId) { + if (StringUtils.isBlank(agencyId)&&StringUtils.isEmpty(gridId)) { + log.info("agencyId与gridId都为空时,默认查询当前工作人员所属组织下的小区"); + CustomerStaffInfoCacheResult result= CustomerStaffRedis.getStaffInfo(customerId,staffId); + if (null == result || StringUtils.isBlank(result.getAgencyId())) { + log.error(String.format("staffId:%s,工作人员缓存信息查询异常")); + return Collections.emptyList(); + } + agencyId=result.getAgencyId(); + } + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(agencyId),IcNeighborHoodEntity::getAgencyId, agencyId); + wrapper.eq(StringUtils.isNotBlank(gridId), IcNeighborHoodEntity::getGridId, gridId); + wrapper.last("ORDER BY CONVERT ( NEIGHBOR_HOOD_NAME USING gbk ) ASC"); + List list = baseDao.selectList(wrapper); + if(CollectionUtils.isEmpty(list)) { + return Collections.emptyList(); + } + return list.stream().map(item -> { + OptionResultDTO dto = new OptionResultDTO(); + dto.setValue(item.getId()); + dto.setLabel(item.getNeighborHoodName()); + return dto; + }).collect(Collectors.toList()); + } + + /** + * @param ids + * @Description 通过ID查询小区信息 + * @Param ids + * @Return {@link List< IcNeighborHoodDTO>} + * @Author zhaoqifeng + * @Date 2021/11/8 10:45 + */ + @Override + public List getListByIds(List ids) { + if (CollectionUtils.isEmpty(ids)) { + return Collections.emptyList(); + } + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.in(IcNeighborHoodEntity::getId, ids); + List list = baseDao.selectList(wrapper); + return ConvertUtils.sourceToTarget(list, IcNeighborHoodDTO.class); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPropertyManagementServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPropertyManagementServiceImpl.java new file mode 100644 index 0000000000..4296911e8d --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPropertyManagementServiceImpl.java @@ -0,0 +1,100 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.IcPropertyManagementDao; +import com.epmet.dto.IcPropertyManagementDTO; +import com.epmet.entity.IcPropertyManagementEntity; +import com.epmet.service.IcPropertyManagementService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 物业表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +@Service +public class IcPropertyManagementServiceImpl extends BaseServiceImpl implements IcPropertyManagementService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcPropertyManagementDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcPropertyManagementDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcPropertyManagementDTO get(String id) { + IcPropertyManagementEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcPropertyManagementDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcPropertyManagementDTO dto) { + IcPropertyManagementEntity entity = ConvertUtils.sourceToTarget(dto, IcPropertyManagementEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcPropertyManagementDTO dto) { + IcPropertyManagementEntity entity = ConvertUtils.sourceToTarget(dto, IcPropertyManagementEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/NeighborHoodServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/NeighborHoodServiceImpl.java new file mode 100644 index 0000000000..dd5e742342 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/NeighborHoodServiceImpl.java @@ -0,0 +1,371 @@ +package com.epmet.service.impl; + +import cn.afterturn.easypoi.excel.entity.TemplateExportParams; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.enums.OrgTypeEnum; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.constant.NeighborhoodConstant; +import com.epmet.dao.*; +import com.epmet.dto.CustomerAgencyDTO; +import com.epmet.dto.IcNeighborHoodDTO; +import com.epmet.dto.IcNeighborHoodPropertyDTO; +import com.epmet.dto.form.IcNeighborHoodFormDTO; +import com.epmet.dto.form.ListIcNeighborHoodFormDTO; +import com.epmet.dto.result.IcNeighborHoodResultDTO; +import com.epmet.entity.*; +import com.epmet.excel.IcNeighborHoodExcel; +import com.epmet.feign.GovOrgOpenFeignClient; +import com.epmet.service.IcNeighborHoodPropertyService; +import com.epmet.service.IcNeighborHoodService; +import com.epmet.service.NeighborHoodService; +import com.epmet.util.ExcelPoiUtils; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; +import org.springframework.util.StringUtils; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import java.util.*; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.function.Function; +import java.util.stream.Collectors; + +@Slf4j +@Service +public class NeighborHoodServiceImpl implements NeighborHoodService { + + @Autowired + private GovOrgOpenFeignClient govOrgOpenFeignClient; + + + @Autowired + private IcNeighborHoodService icNeighborHoodService; + + @Autowired + private IcNeighborHoodPropertyService icNeighborHoodPropertyService; + + @Resource + private IcNeighborHoodPropertyDao icNeighborHoodPropertyDao; + + @Resource + private IcNeighborHoodDao icNeighborHoodDao; + @Resource + private IcBuildingDao icBuildingDao; + @Resource + private IcHouseDao icHouseDao; + @Resource + private CustomerAgencyDao customerAgencyDao; + @Resource + private CustomerGridDao customerGridDao; + @Resource + private IcPropertyManagementDao icPropertyManagementDao; + + @Override + @Transactional(rollbackFor = Exception.class) + public void AddNeighborhood(String customerId, IcNeighborHoodFormDTO formDTO) { + //同一客户下,小区名称唯一 + Integer count = icNeighborHoodDao.checkNameUq(customerId,formDTO.getNeighborHoodName(),null); + if (null != count && count > 0) { + throw new RenException(EpmetErrorCode.NEIGHBOOR_NAME_EXITED.getCode(), EpmetErrorCode.NEIGHBOOR_NAME_EXITED.getMsg()); + } + IcNeighborHoodDTO icNeighborHoodDTO = ConvertUtils.sourceToTarget(formDTO, IcNeighborHoodDTO.class); + icNeighborHoodDTO.setCustomerId(customerId); + Result customerAgencyResult = govOrgOpenFeignClient.getAgencyById(icNeighborHoodDTO.getAgencyId()); +// customerAgency.getData().get + if (!customerAgencyResult.success()) { + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } + CustomerAgencyDTO customerAgencyDTO = Optional.ofNullable(customerAgencyResult.getData()).orElse(new CustomerAgencyDTO()); + icNeighborHoodDTO.setParentAgencyId(customerAgencyDTO.getPid()); + icNeighborHoodDTO.setAgencyPids(customerAgencyDTO.getPids()); + IcNeighborHoodEntity entity = ConvertUtils.sourceToTarget(icNeighborHoodDTO, IcNeighborHoodEntity.class); +// icNeighborHoodService.save(icNeighborHoodDTO); + icNeighborHoodDao.insert(entity); + //设置物业关联 + String propertyId = formDTO.getPropertyId(); + if(!StringUtils.isEmpty(propertyId)){ + //保存物业关系表 + IcNeighborHoodPropertyDTO icNeighborHoodPropertyDTO = new IcNeighborHoodPropertyDTO(); + icNeighborHoodPropertyDTO.setNeighborHoodId(entity.getId()); + icNeighborHoodPropertyDTO.setPropertyId(propertyId); + icNeighborHoodPropertyService.save(icNeighborHoodPropertyDTO); + } + } + + /** + * 查询 + * @param formDTO + */ + @Override + public IcNeighborHoodResultDTO listNeighborhood(ListIcNeighborHoodFormDTO formDTO) { + String level = formDTO.getLevel(); + Integer pageNo = formDTO.getPageNo(); + Integer pageSize = formDTO.getPageSize(); + + + + IcNeighborHoodResultDTO result = new IcNeighborHoodResultDTO(); + + IPage> resultMap = searchNeighborhood(formDTO); + result.setTotal(Long.valueOf(resultMap.getTotal()).intValue()); + result.setList(resultMap.getRecords()); + + return result; + + } + + + + + + + private IPage> searchNeighborhood(ListIcNeighborHoodFormDTO formDTO) { + + IPage page = new Page(formDTO.getPageNo(),formDTO.getPageSize()); + +// QueryWrapper neighborHoodEntityQueryWrapper = new QueryWrapper<>(); +// neighborHoodEntityQueryWrapper.lambda() +// .eq(!StringUtils.isEmpty(formDTO.getAgencyId()),IcNeighborHoodEntity::getAgencyId,formDTO.getAgencyId()) +// .eq(!StringUtils.isEmpty(formDTO.getGridId()),IcNeighborHoodEntity::getId,formDTO.getGridId()) +// .eq(!StringUtils.isEmpty(formDTO.getNeighborHoodId()),IcNeighborHoodEntity::getId,formDTO.getNeighborHoodId()) +// .like(!StringUtils.isEmpty(formDTO.getNeighborHoodName()),IcNeighborHoodEntity::getNeighborHoodName,formDTO.getNeighborHoodName()); +// neighborHoodEntityQueryWrapper.eq("a.DEL_FLAG","0"); + + IcNeighborHoodEntity neighbor = ConvertUtils.sourceToTarget(formDTO, IcNeighborHoodEntity.class); + IcHouseEntity house = ConvertUtils.sourceToTarget(formDTO, IcHouseEntity.class); + neighbor.setDelFlag("0"); + if(NeighborhoodConstant.GRID.equals(formDTO.getLevel())){ + //根据网格过滤 + neighbor.setGridId(formDTO.getId()); + }else{ + //根据组织过滤 + neighbor.setAgencyId(formDTO.getId()); + } + return icNeighborHoodDao.searchNeighborhoodByPage(page, neighbor,house); + } + + /** + * 更新 + * @param customerId + * @param formDTO + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void UpdateNeighborhood(String customerId, IcNeighborHoodFormDTO formDTO) { + //同一客户下,小区名称唯一 + Integer count = icNeighborHoodDao.checkNameUq(customerId,formDTO.getNeighborHoodName(),formDTO.getNeighborHoodId()); + if (null != count && count > 0) { + throw new RenException(EpmetErrorCode.NEIGHBOOR_NAME_EXITED.getCode(), EpmetErrorCode.NEIGHBOOR_NAME_EXITED.getMsg()); + } + + IcNeighborHoodDTO icNeighborHoodDTO = ConvertUtils.sourceToTarget(formDTO, IcNeighborHoodDTO.class); + icNeighborHoodDTO.setId(formDTO.getNeighborHoodId()); + icNeighborHoodDTO.setCustomerId(customerId); + + Result customerAgencyResult = govOrgOpenFeignClient.getAgencyById(icNeighborHoodDTO.getAgencyId()); +// customerAgency.getData().get + if (!customerAgencyResult.success()) { + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } + CustomerAgencyDTO customerAgencyDTO = Optional.ofNullable(customerAgencyResult.getData()).orElse(new CustomerAgencyDTO()); + icNeighborHoodDTO.setParentAgencyId(customerAgencyDTO.getPid()); + icNeighborHoodDTO.setAgencyPids(customerAgencyDTO.getPids()); + icNeighborHoodService.update(icNeighborHoodDTO); + + //设置物业关联 + String propertyId = formDTO.getPropertyId(); + String neighborHoodId = icNeighborHoodDTO.getId(); + if(!StringUtils.isEmpty(propertyId)){ + //更新物业关系表 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(IcNeighborHoodPropertyEntity::getNeighborHoodId,neighborHoodId); + IcNeighborHoodPropertyEntity icNeighborHoodProperty = icNeighborHoodPropertyDao.selectOne(queryWrapper); + icNeighborHoodProperty = Optional.ofNullable(icNeighborHoodProperty).orElse(new IcNeighborHoodPropertyEntity()); + icNeighborHoodProperty.setNeighborHoodId(neighborHoodId); + icNeighborHoodProperty.setPropertyId(propertyId); + if(StringUtils.isEmpty(icNeighborHoodProperty.getId())){ + //插入 + icNeighborHoodPropertyService.insert(icNeighborHoodProperty); + }else{ + //更新 + icNeighborHoodPropertyService.updateById(icNeighborHoodProperty); + } + + + } + } + + /** + * 删除 + * @param neighborHoodId + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void DelNeighborhood(String neighborHoodId) { + //删除小区 + icNeighborHoodService.deleteById(neighborHoodId); + //删除小区物业关联 + Map columnMap = new HashMap<>(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(IcNeighborHoodPropertyEntity::getNeighborHoodId,neighborHoodId); + icNeighborHoodPropertyDao.delete(queryWrapper); + + } + + /** + * 导出数据 + * @param formDTO + * @param response + */ + @Override + public void exportNeighborhoodinfo(ListIcNeighborHoodFormDTO formDTO, HttpServletResponse response) throws Exception { + //导出小区 + List icNeighborHoodExcels = searchAllNeighborhood(formDTO); +// ExcelUtils.exportExcelToTarget(response, "小区信息录入表", icNeighborHoodExcels, IcNeighborHoodExcel.class); + + TemplateExportParams templatePath = new TemplateExportParams("excel/neighbor_export.xlsx"); + Map map = new HashMap<>(); + map.put("maplist",icNeighborHoodExcels); + ExcelPoiUtils.exportExcel(templatePath ,map,"小区信息录入表",response); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public List importExcel(String customerId,List list,String staffId, List numList) { + //2021.11.9 需求变更 当前工作人员只能导致自己所属组织下数据,网格名对应不上的数据舍弃【注:需求就这样】 sun + CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(customerId, staffId); + //查询当前组织下网格列表 + List customerGridList = customerGridDao.selectByPid(staffInfoCache.getAgencyId()); + //组织名称不一样的数据舍弃 + Iterator iterator = list.iterator(); + while (iterator.hasNext()) { + IcNeighborHoodExcel obj = iterator.next(); + if (!obj.getAgencyName().trim().equals(staffInfoCache.getAgencyName())) { + numList.add(obj.getRowNum()); + iterator.remove(); + continue; + } + //当前组织下网格名不存在的也不允许导入 + AtomicBoolean br = new AtomicBoolean(true); + customerGridList.forEach(g->{ + if(obj.getGridName().trim().equals(g.getGridName())){ + br.set(false); + } + }); + if(br.get()){ + numList.add(obj.getRowNum()); + iterator.remove(); + } + + } + //end sun + + //导入 + if(CollectionUtils.isEmpty(list)){ + return numList; + } + //获取所有组织 list + List agencyNameList = list.stream().map(item -> item.getAgencyName()).collect(Collectors.toList()); + agencyNameList = agencyNameList.stream().distinct().collect(Collectors.toList()); + //获取所有网格 list + //List gridNameList = list.stream().map(item->item.getGridName()).collect(Collectors.toList()); + //获取所有物业 list + List propertyNameList = list.stream().map(item->item.getPropertyName()).collect(Collectors.toList()); + propertyNameList = propertyNameList.stream().distinct().collect(Collectors.toList()); + //查询对应的id + List customerAgencyList = customerAgencyDao.selectList(new QueryWrapper().lambda().in(CustomerAgencyEntity::getOrganizationName, agencyNameList)); + //List customerGridList = customerGridDao.selectList(new QueryWrapper().lambda().in(CustomerGridEntity::getGridName, gridNameList)); + List icPropertyManagementList = icPropertyManagementDao.selectList(new QueryWrapper().lambda().in(IcPropertyManagementEntity::getName, propertyNameList)); + + Map agencyMap = customerAgencyList.stream().collect(Collectors.toMap(CustomerAgencyEntity::getOrganizationName, Function.identity(),(key1, key2)->key1)); + Map gridMap = customerGridList.stream().collect(Collectors.toMap(CustomerGridEntity::getGridName,Function.identity(),(key1,key2)->key1)); + Map propertyMap = icPropertyManagementList.stream().collect(Collectors.toMap(IcPropertyManagementEntity::getName,Function.identity(),(key1,key2)->key1)); + + //封装数据 + List neighborHoodEntityList = new ArrayList<>(); + List icNeighborHoodPropertyEntityList = new ArrayList<>(); + Iterator iterator1 = list.iterator(); + while (iterator1.hasNext()) { + IcNeighborHoodExcel icNeighborHoodExcel = iterator1.next(); + //同一客户下,小区名称唯一 + Integer count = icNeighborHoodDao.checkNameUq(customerId,icNeighborHoodExcel.getNeighborHoodName(),null); + if (null != count && count > 0) { + //throw new RenException(EpmetErrorCode.NEIGHBOOR_NAME_EXITED.getCode(), icNeighborHoodExcel.getNeighborHoodName()+EpmetErrorCode.NEIGHBOOR_NAME_EXITED.getMsg()); + log.error(icNeighborHoodExcel.getNeighborHoodName()+EpmetErrorCode.NEIGHBOOR_NAME_EXITED.getMsg()); + numList.add(icNeighborHoodExcel.getRowNum()); + iterator1.remove(); + continue; + } + + IcNeighborHoodEntity entity = new IcNeighborHoodEntity(); + String uuid =UUID.randomUUID().toString().replace("-", ""); + entity.setId(uuid); + entity.setCustomerId(customerId); + entity.setNeighborHoodName(icNeighborHoodExcel.getNeighborHoodName()); + + entity.setAgencyId(Optional.ofNullable(agencyMap.get(icNeighborHoodExcel.getAgencyName().trim())).map(u->u.getId()).orElse("")); // agencyMap.get(icNeighborHoodExcel.getAgencyName()).getId()); + entity.setParentAgencyId(Optional.ofNullable(agencyMap.get(icNeighborHoodExcel.getAgencyName().trim())).map(u->u.getPid()).orElse(""));//agencyMap.get(icNeighborHoodExcel.getAgencyName()).getPid() + entity.setAgencyPids(Optional.ofNullable(agencyMap.get(icNeighborHoodExcel.getAgencyName().trim())).map(u->u.getPids()).orElse(""));//agencyMap.get(icNeighborHoodExcel.getAgencyName()).getPids() + entity.setGridId(Optional.ofNullable(gridMap.get(icNeighborHoodExcel.getGridName().trim())).map(u->u.getId()).orElse(""));//gridMap.get(icNeighborHoodExcel.getGridName()).getId() + //网格名对应不上的数据舍弃 + if ("".equals(entity.getGridId())) { + numList.add(icNeighborHoodExcel.getRowNum()); + iterator1.remove(); + continue; + } + entity.setAddress(icNeighborHoodExcel.getAddress()); + entity.setRemark(icNeighborHoodExcel.getRemark()); + neighborHoodEntityList.add(entity); + + IcNeighborHoodPropertyEntity entity1 = new IcNeighborHoodPropertyEntity(); + + entity1.setPropertyId(Optional.ofNullable(propertyMap.get(icNeighborHoodExcel.getPropertyName())).map(u->u.getId()).orElse("")); + entity1.setNeighborHoodId(uuid); + icNeighborHoodPropertyEntityList.add(entity1); + } + +// icNeighborHoodDao. + //保存 + icNeighborHoodService.insertBatch(neighborHoodEntityList); + icNeighborHoodPropertyService.insertBatch(icNeighborHoodPropertyEntityList); + + return numList; + } + + + + private List searchAllNeighborhood(ListIcNeighborHoodFormDTO formDTO) { +// QueryWrapper neighborHoodEntityQueryWrapper = new QueryWrapper<>(); +// neighborHoodEntityQueryWrapper.lambda() +// .eq(!StringUtils.isEmpty(formDTO.getAgencyId()),IcNeighborHoodEntity::getAgencyId,formDTO.getAgencyId()) +// .eq(!StringUtils.isEmpty(formDTO.getGridId()),IcNeighborHoodEntity::getId,formDTO.getGridId()) +// .eq(!StringUtils.isEmpty(formDTO.getNeighborHoodId()),IcNeighborHoodEntity::getId,formDTO.getNeighborHoodId()) +// .like(!StringUtils.isEmpty(formDTO.getNeighborHoodName()),IcNeighborHoodEntity::getNeighborHoodName,formDTO.getNeighborHoodName()); +// neighborHoodEntityQueryWrapper.eq("a.DEL_FLAG","0"); + IcNeighborHoodEntity neighbor = ConvertUtils.sourceToTarget(formDTO, IcNeighborHoodEntity.class); + neighbor.setDelFlag("0"); + if(OrgTypeEnum.GRID.getCode().equals(formDTO.getLevel())){ + neighbor.setGridId(formDTO.getId()); + }else{ + neighbor.setAgencyId(formDTO.getId()); + } + IcHouseEntity house = ConvertUtils.sourceToTarget(formDTO, IcHouseEntity.class); + return icNeighborHoodDao.searchAllNeighborhood(neighbor,house); + } + + + + + + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/PropertyManagementServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/PropertyManagementServiceImpl.java new file mode 100644 index 0000000000..bfc46dd0b6 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/PropertyManagementServiceImpl.java @@ -0,0 +1,75 @@ +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.IcNeighborHoodPropertyDao; +import com.epmet.dao.IcPropertyManagementDao; +import com.epmet.dto.form.IcPropertyManagementFormDTO; +import com.epmet.dto.result.IcPropertyManagementResultDTO; +import com.epmet.entity.IcNeighborHoodPropertyEntity; +import com.epmet.entity.IcPropertyManagementEntity; +import com.epmet.service.PropertyManagementService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.List; + +@Slf4j +@Service +public class PropertyManagementServiceImpl implements PropertyManagementService { + + @Resource + private IcPropertyManagementDao icPropertyManagementDao; + @Resource + private IcNeighborHoodPropertyDao icNeighborHoodPropertyDao; + + @Override + public List getList() { + List propertyManagementEntityList = icPropertyManagementDao.selectList(null); + List list = new ArrayList<>(); + propertyManagementEntityList.forEach(item->{ + IcPropertyManagementResultDTO propertyManagementResultDTO = new IcPropertyManagementResultDTO(); + propertyManagementResultDTO.setPropertyId(item.getId()); + propertyManagementResultDTO.setPropertyName(item.getName()); + list.add(propertyManagementResultDTO); + }); + return list; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public String add(IcPropertyManagementFormDTO formDTO) { + //物业名字平台内唯一 + //如果输入的物业名字已经存在,直接返回物业id + formDTO.setName(formDTO.getName().trim()); + IcPropertyManagementEntity entity = icPropertyManagementDao.selectByName(formDTO.getName()); + if (null != entity) { + return entity.getId(); + } + IcPropertyManagementEntity icPropertyManagementEntity = ConvertUtils.sourceToTarget(formDTO, IcPropertyManagementEntity.class); + icPropertyManagementDao.insert(icPropertyManagementEntity); + return icPropertyManagementEntity.getId(); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcPropertyManagementFormDTO formDTO) { + IcPropertyManagementEntity icPropertyManagementEntity = ConvertUtils.sourceToTarget(formDTO, IcPropertyManagementEntity.class); + icPropertyManagementDao.updateById(icPropertyManagementEntity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(IcPropertyManagementFormDTO formDTO) { + List list = icNeighborHoodPropertyDao.selectList(new QueryWrapper().lambda().eq(IcNeighborHoodPropertyEntity::getPropertyId, formDTO.getId())); + if(!CollectionUtils.isEmpty(list)){ + throw new RenException("物业存在与小区关联,无法删除"); + } + icPropertyManagementDao.deleteById(formDTO.getId()); + } +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/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..cffd4abd69 Binary files /dev/null and b/epmet-module/gov-org/gov-org-server/src/main/resources/excel/building_template.xlsx differ diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/excel/house_export.xlsx b/epmet-module/gov-org/gov-org-server/src/main/resources/excel/house_export.xlsx new file mode 100644 index 0000000000..9460a651da Binary files /dev/null and b/epmet-module/gov-org/gov-org-server/src/main/resources/excel/house_export.xlsx differ diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/excel/house_template.xlsx b/epmet-module/gov-org/gov-org-server/src/main/resources/excel/house_template.xlsx new file mode 100644 index 0000000000..027f37bcad Binary files /dev/null and b/epmet-module/gov-org/gov-org-server/src/main/resources/excel/house_template.xlsx differ diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/excel/neighbor_export.xlsx b/epmet-module/gov-org/gov-org-server/src/main/resources/excel/neighbor_export.xlsx new file mode 100644 index 0000000000..2a1b3237d9 Binary files /dev/null and b/epmet-module/gov-org/gov-org-server/src/main/resources/excel/neighbor_export.xlsx differ diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/excel/neighbor_template.xlsx b/epmet-module/gov-org/gov-org-server/src/main/resources/excel/neighbor_template.xlsx new file mode 100644 index 0000000000..36297ea510 Binary files /dev/null and b/epmet-module/gov-org/gov-org-server/src/main/resources/excel/neighbor_template.xlsx differ diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/logback-spring.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/logback-spring.xml index 6c2d82a05b..24d44d88f9 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/logback-spring.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/logback-spring.xml @@ -128,14 +128,14 @@ 15 - + diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml index f49a8cf4e6..f0d6065116 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' + + + + + + + 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..94ca7a4587 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,90 @@ 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..a137f46b8b --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingDao.xml @@ -0,0 +1,336 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingUnitDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingUnitDao.xml new file mode 100644 index 0000000000..0ee38da368 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingUnitDao.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml new file mode 100644 index 0000000000..61aa971630 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml @@ -0,0 +1,281 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml new file mode 100644 index 0000000000..ea950eb90b --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml @@ -0,0 +1,216 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodPartDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodPartDao.xml new file mode 100644 index 0000000000..8dd1ab5097 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodPartDao.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodPropertyDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodPropertyDao.xml new file mode 100644 index 0000000000..749861cc9a --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodPropertyDao.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPropertyManagementDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPropertyManagementDao.xml new file mode 100644 index 0000000000..725fdf969f --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPropertyManagementDao.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/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/IcResiCategoryStatsConfigDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/IcResiCategoryStatsConfigDTO.java new file mode 100644 index 0000000000..1eb4516551 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/IcResiCategoryStatsConfigDTO.java @@ -0,0 +1,116 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 居民类别配置表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +@Data +public class IcResiCategoryStatsConfigDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * id + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 项标签 + */ + private String label; + + /** + * 表名 + */ + private String tableName; + + /** + * 列名 + */ + private String columnName; + + /** + * 管理平台分类图标 + */ + private String managementIcon; + + /** + * 数据平台分类图标 + */ + private String dataIcon; + + /** + * 房屋显示分类图标 + */ + private String houseShowIcon; + + /** + * 状态 显示:show;隐藏:hidden + */ + private String status; + + /** + * 排序 + */ + private Integer sort; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private String revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private String createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/IcResiCategoryWarnConfigDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/IcResiCategoryWarnConfigDTO.java new file mode 100644 index 0000000000..c7ef3d17f8 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/IcResiCategoryWarnConfigDTO.java @@ -0,0 +1,115 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 居民类别预警配置表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +@Data +public class IcResiCategoryWarnConfigDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * id + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 项标签 + */ + private String label; + + /** + * 表名 + */ + private String tableName; + + /** + * 列名 + */ + private String columnName; + /** + * 是否预警 1 是 0 否 + */ + private String warn; + + /** + * 排序 + */ + private Integer sort; + + /** + * 等级1阈值 + */ + private Integer level1; + + /** + * 等级2阈值 + */ + private Integer level2; + + /** + * 等级3阈值 + */ + private Integer level3; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private String revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private String createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/ItemTypeDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/ItemTypeDTO.java new file mode 100644 index 0000000000..9db82e8d48 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/ItemTypeDTO.java @@ -0,0 +1,81 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 控件类型 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +@Data +public class ItemTypeDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + private String id; + + /** + * 名称 + */ + private String name; + + /** + * CODE + */ + private String code; + + /** + * 0未删除,1已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CustomerFormQueryDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CustomerFormQueryDTO.java new file mode 100644 index 0000000000..8759909f38 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CustomerFormQueryDTO.java @@ -0,0 +1,31 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 居民信息,点击新增,获取当前客户下的表单 + * @Author yinzuomei + * @Date 2021/10/26 1:59 下午 + */ +@Data +public class CustomerFormQueryDTO implements Serializable { + public interface AddUserInternalGroup {} + // 获取表单相关信息 + public interface GetFormInfoGroup {} + + @NotBlank(message = "formCode不能为空,居民信息默认传:resi_base_info",groups = { AddUserInternalGroup.class, GetFormInfoGroup.class} ) + private String formCode; + + + @NotBlank(message = "tokenDto获取customerId不能为空",groups =AddUserInternalGroup.class ) + private String customerId; + + /** + * 是否动态 + */ + private Boolean dynamic; +} + diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/IcResiCategoryStatsConfigFormDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/IcResiCategoryStatsConfigFormDTO.java new file mode 100644 index 0000000000..cc036df66f --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/IcResiCategoryStatsConfigFormDTO.java @@ -0,0 +1,79 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.UpdateGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.Date; + + +/** + * 居民类别配置表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +@Data +public class IcResiCategoryStatsConfigFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + public interface UpdateStatusGroup {} + public interface SelectGroup {} + + /** + * id + */ + @NotBlank(message = "配置项id不能为空",groups = {UpdateGroup.class,UpdateStatusGroup.class,SelectGroup.class}) + private String id; + + /** + * 管理平台分类图标 + */ + @NotBlank(message = "管理平台分类图标不能为空",groups = {UpdateGroup.class}) + private String managementIcon; + + /** + * 数据平台分类图标 + */ + @NotBlank(message = "数据平台分类图标不能为空",groups = {UpdateGroup.class}) + private String dataIcon; + + /** + * 房屋显示分类图标 + */ + @NotBlank(message = "房屋显示分类图标不能为空",groups = {UpdateGroup.class}) + private String houseShowIcon; + + /** + * 状态 显示:show;隐藏:hidden + */ + @NotBlank(message = "状态不能为空",groups = {UpdateStatusGroup.class}) + private String status; + + @NotBlank(message = "是否预警",groups = {UpdateGroup.class}) + private String warn; + + private Integer level1; + private Integer level2; + + private Integer level3; + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/IcResiCategoryStatsConfigSortFormDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/IcResiCategoryStatsConfigSortFormDTO.java new file mode 100644 index 0000000000..9e843dd7da --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/IcResiCategoryStatsConfigSortFormDTO.java @@ -0,0 +1,52 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.UpdateGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + + +/** + * 居民类别配置表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +@Data +public class IcResiCategoryStatsConfigSortFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * id + */ + @NotBlank(message = "配置项id不能为空") + private String id; + + /** + * 排序 + */ + @NotNull(message = "排序不能为空") + private Integer sort; + + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/ResiCategoryStatsConfigListFormDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/ResiCategoryStatsConfigListFormDTO.java new file mode 100644 index 0000000000..96401a3029 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/ResiCategoryStatsConfigListFormDTO.java @@ -0,0 +1,48 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.UpdateGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + + +/** + * 居民类别配置表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +@Data +public class ResiCategoryStatsConfigListFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 是否预警 + */ + private Integer isWarn; + + /** + * 预警等级 + */ + private Integer level; + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/ColumnTableNameResultDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/ColumnTableNameResultDTO.java new file mode 100644 index 0000000000..3d1e20cc50 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/ColumnTableNameResultDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 查询必填字段-接口返参 + * @Author sun + */ +@Data +public class ColumnTableNameResultDTO implements Serializable { + private static final long serialVersionUID = -8441112171986914418L; + //表名 + private String tableName; + //字段中文名 + private String label; + //字段名 + private String columnName; +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/ConditionResultDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/ConditionResultDTO.java new file mode 100644 index 0000000000..07953ef95c --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/ConditionResultDTO.java @@ -0,0 +1,93 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description 查询条件 + * @Author yinzuomei + * @Date 2021/10/27 9:09 上午 + */ +@Data +public class ConditionResultDTO implements Serializable { + private static final long serialVersionUID = -2021200288758478252L; + /** + * 父项ID + */ + private String itemId; + + /** + * 默认:ic_resi_user + */ + private String tableName; + + /** + * 父项ID + */ + private String parentItemId; + + /** + * 项标签 + */ + private String label; + + /** + * 控件类型,EG:INPUT;从字典获取 + */ + private String itemType; + + /** + * 分组ID,'默认,NONE' + */ + private String itemGroupId; + + /** + * 是否必填,1必填。0不必填 + */ + private Integer required; + + /** + * 手机号:mobile; 身份证:id_card + */ + private String validType; + + /** + * 默认值 + */ + private String defaultValue; + + /** + * 选项来源,REMOTE;LOCAL;如果是动态加载的下拉框或者CHECKBOX等的情况下使用。URL:接口获取(LABEL,VALUE);JSON:直接从JSON中取 + */ + private String optionSourceType; + + /** + * 来源地址,REMOTE才有,固定格式;如果OPTIONS_SOURCE是URL,则此处填写要调用的接口的URL相对路径,例如:/API/GOV/ORG/XXXX。此处不应设置参数,若需要参数应当完全由后端,通过TOKEN信息来获取 + */ + private String optionSourceValue; + + /** + * 排序 + */ + private Integer sort; + + /** + * 占位提示语 + */ + private String placeholder; + + /** + * 列名 + */ + private String columnName; + + /** + * 查询类型: equal, like,daterange.... + */ + private String queryType; + + private List options; +} + diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CustomerFormResultDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CustomerFormResultDTO.java new file mode 100644 index 0000000000..45cd1dd0ea --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CustomerFormResultDTO.java @@ -0,0 +1,37 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description 居民信息,点击新增,返回当前客户下的表单 + * @Author yinzuomei + * @Date 2021/10/26 2:13 下午 + */ +@Data +public class CustomerFormResultDTO implements Serializable { + private static final long serialVersionUID = -6541805255520766366L; + + /** + * 表单id + */ + private String formId; + + /** + * 表单左上角的名字 + */ + private String formName; + + /** + * 表单项 + */ + private List itemList; + + /** + * 表单分组 + */ + private List groupList; +} + diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FormGroupDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FormGroupDTO.java new file mode 100644 index 0000000000..1b2a6c8964 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FormGroupDTO.java @@ -0,0 +1,47 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description 下面的的分组 + * @Author yinzuomei + * @Date 2021/10/26 2:16 下午 + */ +@Data +public class FormGroupDTO implements Serializable { + private static final long serialVersionUID = -6209767832999902538L; + /** + * 分组id + */ + private String groupId; + + /** + * 分组的名字,例如:教育信息、家庭信息 + */ + private String label; + + /** + * 排序 + */ + private Integer sort; + + + /** + * 是否支持添加一行,1支持,默认0不支持 + */ + private Boolean supportAdd; + + /** + * 目前这些分组,没有拆开子表,所以默认:ic_resi_user + */ + private String tableName; + + /** + * 分组里面的组件 + */ + private List itemList; +} + diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FormItemResult.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FormItemResult.java new file mode 100644 index 0000000000..dfe0b85ffa --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FormItemResult.java @@ -0,0 +1,134 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description 表单项 + * @Author yinzuomei + * @Date 2021/10/26 2:15 下午 + */ +@Data +public class FormItemResult implements Serializable { + private static final long serialVersionUID = 7443085469505238040L; + + /** + * 父项ID + */ + private String itemId; + + /** + * 默认:ic_resi_user + */ + private String tableName; + + /** + * 父项ID + */ + private String parentItemId; + + /** + * 项标签 + */ + private String label; + + /** + * 控件类型,EG:INPUT;从字典获取 + */ + private String itemType; + + /** + * 分组ID,'默认,NONE' + */ + private String itemGroupId; + + /** + * 是否必填,1必填。0不必填 + */ + private Integer required; + + /** + * 手机号:mobile; 身份证:id_card + */ + private String validType; + + /** + * 默认值 + */ + private String defaultValue; + + /** + * 选项来源,REMOTE;LOCAL;如果是动态加载的下拉框或者CHECKBOX等的情况下使用。URL:接口获取(LABEL,VALUE);JSON:直接从JSON中取 + */ + private String optionSourceType; + + /** + * 来源地址,REMOTE才有,固定格式;如果OPTIONS_SOURCE是URL,则此处填写要调用的接口的URL相对路径,例如:/API/GOV/ORG/XXXX。此处不应设置参数,若需要参数应当完全由后端,通过TOKEN信息来获取 + */ + private String optionSourceValue; + + /** + * 排序 + */ + private Integer sort; + + /** + * 占位提示语 + */ + private String placeholder; + + /** + * 是否查询显示,1展示。0不展示 + */ + @JsonIgnore + private Integer searchDisplay; + + /** + * 是否列表显示,1展示,0不展示 + */ + @JsonIgnore + private Integer listDisplay; + + /** + * 是否需要支持数据分析,1支持。0不支持 + */ + @JsonIgnore + private Integer dataAnalyse; + + /** + * 列名 + */ + private String columnName; + + /** + * 列名序号,根据表递增 + */ + private Integer columnNum; + + private List options; + + + /** + * 当前组件,要追加分组 + */ + private FormGroupDTO childGroup; + + /** + * 1可以多选,0单选,默认0 + */ + private Boolean multiSelect; + + /** + * @description 分组label + * + * @param null + * @return + * @author wxz + * @date 2021.10.28 22:57:15 + */ + private String groupLabel; +} + diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FormItemResult2.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FormItemResult2.java new file mode 100644 index 0000000000..3372b55a37 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FormItemResult2.java @@ -0,0 +1,117 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description 分组里面的组件 + * @Author yinzuomei + * @Date 2021/10/26 4:29 下午 + */ +@Data +public class FormItemResult2 implements Serializable { + private static final long serialVersionUID = -7571266621687396261L; + /** + * 父项ID + */ + private String itemId; + + /** + * 默认:ic_resi_user + */ + private String tableName; + + /** + * 父项ID + */ + private String parentItemId; + + /** + * 项标签 + */ + private String label; + + /** + * 控件类型,EG:INPUT;从字典获取 + */ + private String itemType; + + /** + * 分组ID,'默认,NONE' + */ + private String itemGroupId; + + /** + * 是否必填,1必填。0不必填 + */ + private Integer required; + + /** + * 手机号:mobile; 身份证:id_card + */ + private String validType; + + /** + * 默认值 + */ + private String defaultValue; + + /** + * 选项来源,REMOTE;LOCAL;如果是动态加载的下拉框或者CHECKBOX等的情况下使用。URL:接口获取(LABEL,VALUE);JSON:直接从JSON中取 + */ + private String optionSourceType; + + /** + * 来源地址,REMOTE才有,固定格式;如果OPTIONS_SOURCE是URL,则此处填写要调用的接口的URL相对路径,例如:/API/GOV/ORG/XXXX。此处不应设置参数,若需要参数应当完全由后端,通过TOKEN信息来获取 + */ + private String optionSourceValue; + + /** + * 排序 + */ + private Integer sort; + + /** + * 占位提示语 + */ + private String placeholder; + + /** + * 是否查询显示,1展示。0不展示 + */ + @JsonIgnore + private Integer searchDisplay; + + /** + * 是否列表显示,1展示,0不展示 + */ + @JsonIgnore + private Integer listDisplay; + + /** + * 是否需要支持数据分析,1支持。0不支持 + */ + @JsonIgnore + private Integer dataAnalyse; + + /** + * 列名 + */ + private String columnName; + + /** + * 列名序号,根据表递增 + */ + private Integer columnNum; + + private List options; + + /** + * 1可以多选,0单选,默认0 + */ + private Boolean multiSelect; +} + diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/IcFormResColumnDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/IcFormResColumnDTO.java new file mode 100644 index 0000000000..52a3374449 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/IcFormResColumnDTO.java @@ -0,0 +1,18 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 列表展示列返参结构 + * @Author yinzuomei + * @Date 2021/11/1 12:49 下午 + */ +@Data +public class IcFormResColumnDTO implements Serializable { + private String tableName; + private String columnName; + private String label; +} + diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/IcResiCategoryStatsConfigResultDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/IcResiCategoryStatsConfigResultDTO.java new file mode 100644 index 0000000000..d9199b99cc --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/IcResiCategoryStatsConfigResultDTO.java @@ -0,0 +1,88 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 居民类别配置表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +@Data +public class IcResiCategoryStatsConfigResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * id + */ + private String id; + + + /** + * 项标签 + */ + private String label; + + + + /** + * 管理平台分类图标 + */ + private String managementIcon; + + /** + * 数据平台分类图标 + */ + private String dataIcon; + + /** + * 房屋显示分类图标 + */ + private String houseShowIcon; + + /** + * 状态 显示:show;隐藏:hidden + */ + private String status; + + /** + * 排序 + */ + private Integer sort; + + private String warn; + /** + * 等级1阈值 + */ + private Integer level1; + /** + * 等级2阈值 + */ + private Integer level2; + /** + * 等级3阈值 + */ + private Integer level3; +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/OptionDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/OptionDTO.java new file mode 100644 index 0000000000..890b2c054b --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/OptionDTO.java @@ -0,0 +1,17 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 下拉框、单选框的值 + * @Author yinzuomei + * @Date 2021/10/26 2:32 下午 + */ +@Data +public class OptionDTO implements Serializable { + private String label; + private String value; +} + diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/TableHeaderResultDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/TableHeaderResultDTO.java new file mode 100644 index 0000000000..dd39f668e7 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/TableHeaderResultDTO.java @@ -0,0 +1,22 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description 表头返参DTO + * @Author yinzuomei + * @Date 2021/10/28 4:10 下午 + */ +@Data +public class TableHeaderResultDTO implements Serializable { + private static final long serialVersionUID = 8318224643897723433L; + private String itemId; + private String label; + private String columnName; + private String itemType; + private List options; +} + diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java index fd56957265..2882f9977f 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java @@ -3,23 +3,20 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerFootBarDTO; -import com.epmet.dto.form.CheckFloatFootBarFormDTO; -import com.epmet.dto.form.CustomerFootBarFormDTO; +import com.epmet.dto.IcResiCategoryStatsConfigDTO; +import com.epmet.dto.IcResiCategoryWarnConfigDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.result.*; import com.epmet.feign.fallback.OperCustomizeOpenFeignClientFallbackFactory; import org.springframework.cloud.openfeign.FeignClient; - -import com.epmet.commons.tools.constant.ServiceConstant; -import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.form.CustomerFunctionListFormDTO; -import com.epmet.dto.result.CheckFloatFootBarResultDTO; -import com.epmet.dto.result.DefaultFunctionListResultDTO; -import com.epmet.feign.fallback.OperCustomizeOpenFeignClientFallback; -import org.springframework.cloud.openfeign.FeignClient; import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestParam; import java.util.List; +import java.util.Set; /** * 本服务对外开放的API,其他服务通过引用此client调用该服务 @@ -27,6 +24,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 +45,79 @@ public interface OperCustomizeOpenFeignClient { */ @PostMapping(value = "/oper/customize/customerfootbar/checkfloatfootbar", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) Result checkFloatFootBar(@RequestBody CheckFloatFootBarFormDTO checkFloatFootBarFormDTO); + + /** + * desc: 获取表单填写项 【dynamic=null】查询全部;否则查询对应的item + * @param formDto + * @return + */ + @PostMapping(value = "/oper/customize/icform/getcustomerform", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + Result getCustomerForm(@RequestBody CustomerFormQueryDTO formDto); + + /** + * 返回用于列表展示的列 + * + * @param queryDTO + * @return com.epmet.commons.tools.utils.Result> + * @author yinzuomei + * @date 2021/11/1 12:53 下午 + */ + @PostMapping(value = "/oper/customize/icform/queryConditions", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + Result> queryConditions(@RequestBody CustomerFormQueryDTO queryDTO); + + /** + * 构造出所有的子表连接语句格式:left join table_name on (ic_resi_user.ID=table_name.IC_RESI_USER AND table_name.del_flag='0') + * + * @param queryDTO + * @return com.epmet.commons.tools.utils.Result> + * @author yinzuomei + * @date 2021/11/1 1:07 下午 + */ + @PostMapping(value = "/oper/customize/icform/querySubTables", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + Result> querySubTables(@RequestBody CustomerFormQueryDTO queryDTO); + + @PostMapping(value = "/oper/customize/icform/queryIcResiSubTables", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + Result> queryIcResiSubTables(@RequestBody CustomerFormQueryDTO queryDTO); + + /** + * @description item列表 + * + * @param formDto + * @return + * @author wxz + * @date 2021.10.28 15:19:59 + */ + @PostMapping("/oper/customize/icform/items") + Result> listItems(@RequestBody CustomerFormQueryDTO formDto); + + /** + * @Author sun + * @Description 居民信息新增查询各表必填字段 + **/ + @PostMapping("/oper/customize/icformitem/getmustcolumn/{customerId}") + Result> getMustColumn(@PathVariable("customerId") String customerId); + + @PostMapping("/oper/customize/icresicategorystatsconfig/categorylist") + Result> getCategoryList(@RequestBody IcResiCategoryStatsConfigDTO dto); + + + + @PostMapping("/oper/customize/resicategorystatsconfig/resicategorystatslistshowd") + Result> resiCategoryStatsListShowd(@RequestBody IcResiCategoryStatsConfigFormDTO formDTO); + + @PostMapping("/oper/customize/resicategorystatsconfig/resicategorywarnlist") + Result> resiCategoryWarnList(@RequestParam String customerId); + + @PostMapping("/oper/customize/resicategorystatsconfig/resicategorywarninfobyid") + Result resiCategoryWarnInfoById(@RequestBody IcResiCategoryWarnConfigDTO dto); + + /** + * @Description 查询志愿者类型 + * @param volunteers + * @author zxc + * @date 2021/11/8 10:02 上午 + */ + @PostMapping("/oper/customize/icformitemoptions/volunteerlabelbyvalues") + Result> volunteerLabelByValues(@RequestBody List volunteers,@RequestParam("customerId") String customerId); + } 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..a75999eb0e 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java @@ -4,15 +4,14 @@ import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerFootBarDTO; -import com.epmet.dto.form.CheckFloatFootBarFormDTO; -import com.epmet.dto.form.CustomerFootBarFormDTO; -import com.epmet.dto.form.CustomerFunctionListFormDTO; -import com.epmet.dto.result.CheckFloatFootBarResultDTO; -import com.epmet.dto.result.DefaultFunctionListResultDTO; +import com.epmet.dto.IcResiCategoryStatsConfigDTO; +import com.epmet.dto.IcResiCategoryWarnConfigDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.result.*; import com.epmet.feign.OperCustomizeOpenFeignClient; -import org.springframework.stereotype.Component; import java.util.List; +import java.util.Set; /** * 本服务对外开放的API,其他服务通过引用此client调用该服务 @@ -49,4 +48,59 @@ public class OperCustomizeOpenFeignClientFallback implements OperCustomizeOpenFe public Result checkFloatFootBar(CheckFloatFootBarFormDTO checkFloatFootBarFormDTO) { return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "checkFloatFootBar", checkFloatFootBarFormDTO); } + + @Override + public Result getCustomerForm(CustomerFormQueryDTO formDto) { + return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "getCustomerForm", formDto); + } + + @Override + public Result> queryConditions(CustomerFormQueryDTO formDto) { + return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "queryConditions", formDto); + } + + @Override + public Result> querySubTables(CustomerFormQueryDTO formDto) { + return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "querySubTables", formDto); + } + + @Override + public Result> queryIcResiSubTables(CustomerFormQueryDTO queryDTO) { + return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "queryIcResiSubTables", queryDTO); + } + + @Override + public Result> listItems(CustomerFormQueryDTO formDto) { + return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "listItems", formDto); + } + + @Override + public Result> getMustColumn(String customerId) { + return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "getMustColumn", customerId); + } + + @Override + public Result> getCategoryList(IcResiCategoryStatsConfigDTO dto) { + return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "getCategoryList", dto); + } + + @Override + public Result> resiCategoryStatsListShowd(IcResiCategoryStatsConfigFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "resiCategoryStatsListShowd",formDTO); + } + + @Override + public Result> resiCategoryWarnList(String customerId) { + return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "resiCategoryWarnList",customerId); + } + + @Override + public Result resiCategoryWarnInfoById(IcResiCategoryWarnConfigDTO dto) { + return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "resiCategoryWarnInfoById",dto); + } + + @Override + public Result> volunteerLabelByValues(List volunteers,String customerId) { + return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "volunteerLabelByValues",volunteers,customerId); + } } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/constant/IcResiCategoryStatsConfigConstant.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/constant/IcResiCategoryStatsConfigConstant.java new file mode 100644 index 0000000000..9919ca35f6 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/constant/IcResiCategoryStatsConfigConstant.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + *

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

+ * 版权所有,侵权必究! + */ + +package com.epmet.constant; + +/** + * 常量 + * @author sun + * @since 1.0.0 + */ +public interface IcResiCategoryStatsConfigConstant { + /** + * 是否需要预警 + */ + String WARN_YES = "1"; + String WARN_NO = "0"; + + String IC_RESI_USER = "ic_resi_user"; + + +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormController.java new file mode 100644 index 0000000000..dee3afb8ec --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormController.java @@ -0,0 +1,194 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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 formDto + * @return + * @author wxz + * @date 2021.10.28 15:19:59 + */ + @PostMapping("items") + public Result> listItems(@RequestBody CustomerFormQueryDTO formDto) { + ValidatorUtils.validateEntity(formDto, CustomerFormQueryDTO.GetFormInfoGroup.class); + List rst = icFormService.listItems(formDto.getCustomerId(), formDto.getFormCode()); + return new Result>().ok(rst); + } +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormItemController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormItemController.java new file mode 100644 index 0000000000..50f4d10ff9 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormItemController.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.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.dto.result.ColumnTableNameResultDTO; +import com.epmet.dto.result.CustomerStaffRoleResultDTO; +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); + } + + /** + * @Author sun + * @Description 居民信息新增查询各表必填字段 + **/ + @PostMapping("getmustcolumn/{customerId}") + public Result> getMustColumn(@PathVariable String customerId) { + return new Result>().ok(icFormItemService.getMustColumn(customerId)); + } + +} \ 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..262255826a --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormItemOptionsController.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.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); + } + + /** + * @Description 查询志愿者类型 + * @param volunteers + * @author zxc + * @date 2021/11/8 10:02 上午 + */ + @PostMapping("volunteerlabelbyvalues") + public Result> volunteerLabelByValues(@RequestBody List volunteers,@RequestParam("customerId") String customerId){ + return new Result>().ok(icFormItemOptionsService.volunteerLabelByValues(volunteers,customerId)); + } + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcResiCategoryStatsConfigController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcResiCategoryStatsConfigController.java new file mode 100644 index 0000000000..70880418dd --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcResiCategoryStatsConfigController.java @@ -0,0 +1,99 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.IcResiCategoryStatsConfigDTO; +import com.epmet.excel.IcResiCategoryStatsConfigExcel; +import com.epmet.service.IcResiCategoryStatsConfigService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 居民类别配置表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +@RestController +@RequestMapping("icresicategorystatsconfig") +public class IcResiCategoryStatsConfigController { + + @Autowired + private IcResiCategoryStatsConfigService icResiCategoryStatsConfigService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = icResiCategoryStatsConfigService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + IcResiCategoryStatsConfigDTO data = icResiCategoryStatsConfigService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody IcResiCategoryStatsConfigDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icResiCategoryStatsConfigService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody IcResiCategoryStatsConfigDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icResiCategoryStatsConfigService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + icResiCategoryStatsConfigService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = icResiCategoryStatsConfigService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, IcResiCategoryStatsConfigExcel.class); + } + + @PostMapping("categorylist") + public Result> getCategoryList(@RequestBody IcResiCategoryStatsConfigDTO dto) { + return new Result>().ok(icResiCategoryStatsConfigService.getCategoryList(dto)); + } + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcResiCategoryWarnConfigController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcResiCategoryWarnConfigController.java new file mode 100644 index 0000000000..5e1ac6667b --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcResiCategoryWarnConfigController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.IcResiCategoryWarnConfigDTO; +import com.epmet.excel.IcResiCategoryWarnConfigExcel; +import com.epmet.service.IcResiCategoryWarnConfigService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 居民类别预警配置表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +@RestController +@RequestMapping("icresicategorywarnconfig") +public class IcResiCategoryWarnConfigController { + + @Autowired + private IcResiCategoryWarnConfigService icResiCategoryWarnConfigService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = icResiCategoryWarnConfigService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + IcResiCategoryWarnConfigDTO data = icResiCategoryWarnConfigService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody IcResiCategoryWarnConfigDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icResiCategoryWarnConfigService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody IcResiCategoryWarnConfigDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icResiCategoryWarnConfigService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + icResiCategoryWarnConfigService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = icResiCategoryWarnConfigService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, IcResiCategoryWarnConfigExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/ItemTypeController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/ItemTypeController.java new file mode 100644 index 0000000000..d5f5142c74 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/ItemTypeController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.ItemTypeDTO; +import com.epmet.excel.ItemTypeExcel; +import com.epmet.service.ItemTypeService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 控件类型 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +@RestController +@RequestMapping("itemtype") +public class ItemTypeController { + + @Autowired + private ItemTypeService itemTypeService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = itemTypeService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + ItemTypeDTO data = itemTypeService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody ItemTypeDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + itemTypeService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody ItemTypeDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + itemTypeService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + itemTypeService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = itemTypeService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, ItemTypeExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/ResiCategoryStatsConfigController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/ResiCategoryStatsConfigController.java new file mode 100644 index 0000000000..99b6299afa --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/ResiCategoryStatsConfigController.java @@ -0,0 +1,168 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.constant.IcResiCategoryStatsConfigConstant; +import com.epmet.dao.IcResiCategoryStatsConfigDao; +import com.epmet.dao.IcResiCategoryWarnConfigDao; +import com.epmet.dto.IcResiCategoryStatsConfigDTO; +import com.epmet.dto.IcResiCategoryWarnConfigDTO; +import com.epmet.dto.form.IcResiCategoryStatsConfigFormDTO; +import com.epmet.dto.form.IcResiCategoryStatsConfigSortFormDTO; +import com.epmet.dto.form.ResiCategoryStatsConfigListFormDTO; +import com.epmet.dto.result.IcResiCategoryStatsConfigResultDTO; +import com.epmet.entity.IcResiCategoryStatsConfigEntity; +import com.epmet.entity.IcResiCategoryWarnConfigEntity; +import com.epmet.service.IcResiCategoryStatsConfigService; +import com.epmet.service.ResiCategoryStatsConfigService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.StringUtils; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + + +/** + * 居民类别配置表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +@RestController +@RequestMapping("resicategorystatsconfig") +public class ResiCategoryStatsConfigController { + + @Autowired + private IcResiCategoryStatsConfigService icResiCategoryStatsConfigService; + @Autowired + private ResiCategoryStatsConfigService resiCategoryStatsConfigService; + + @Resource + private IcResiCategoryWarnConfigDao icResiCategoryWarnConfigDao; + @Resource + private IcResiCategoryStatsConfigDao icResiCategoryStatsConfigDao; + + /** + * 居民类别配置列表 + * @return + */ + @PostMapping("list") + public Result> list(@LoginUser TokenDto tokenDTO,@RequestBody ResiCategoryStatsConfigListFormDTO formDTO){ + String customerId = tokenDTO.getCustomerId(); +// String customerId = "123123"; + return new Result>().ok(resiCategoryStatsConfigService.list(customerId,formDTO)); + } + + @PostMapping("update") + @NoRepeatSubmit + public Result update(@LoginUser TokenDto tokenDTO,@RequestBody IcResiCategoryStatsConfigFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, UpdateGroup.class); + String customerId = tokenDTO.getCustomerId(); +// String customerId = "123123"; + Integer level1 = formDTO.getLevel1(); + Integer level2 = formDTO.getLevel2(); + Integer level3 = formDTO.getLevel3(); + if(IcResiCategoryStatsConfigConstant.WARN_YES.equals(formDTO.getWarn())){ + //判断level1 和level2 的值 + if(null ==level1 || level1==0){ + return new Result().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"黄色预警阈值需大于0"); + } + if(null == level2 || level2==0){ + return new Result().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"红色预警阈值需大于0"); + } + if(level2<=level1){ + return new Result().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"黄色预警阈值需大于红色预警阈值"); + } + } + resiCategoryStatsConfigService.update(customerId,formDTO); + return new Result().ok("修改成功"); + } + @PostMapping("updatestatus") + public Result updateStatus(@LoginUser TokenDto tokenDTO,@RequestBody IcResiCategoryStatsConfigFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, IcResiCategoryStatsConfigFormDTO.UpdateStatusGroup.class); + String customerId = tokenDTO.getCustomerId(); +// String customerId = "123123"; + resiCategoryStatsConfigService.updateStatus(customerId,formDTO); + return new Result().ok("修改成功"); + } + @PostMapping("updatesort") + public Result updateSort(@LoginUser TokenDto tokenDTO,@RequestBody List formDTOs){ + for(IcResiCategoryStatsConfigSortFormDTO dto : formDTOs){ + ValidatorUtils.validateEntity(dto); + } + String customerId = tokenDTO.getCustomerId(); +// String customerId = "123123"; + resiCategoryStatsConfigService.updateSort(customerId,formDTOs); + return new Result(); + } + + @PostMapping("info") + public Result info(@LoginUser TokenDto tokenDTO,@RequestBody IcResiCategoryStatsConfigFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, IcResiCategoryStatsConfigFormDTO.SelectGroup.class); + return new Result().ok(resiCategoryStatsConfigService.info(formDTO.getId(),tokenDTO.getCustomerId())); + } + + @PostMapping("resicategorystatslistshowd") + public Result> resiCategoryStatsListShowd(@LoginUser TokenDto tokenDTO,@RequestBody IcResiCategoryStatsConfigFormDTO formDTO){ + //获取预警配置列表 + QueryWrapper queryWrapper = new QueryWrapper(); + queryWrapper.lambda() + .eq(IcResiCategoryStatsConfigEntity::getCustomerId,tokenDTO.getCustomerId()) + + .orderByAsc(IcResiCategoryStatsConfigEntity::getSort); + if(!StringUtils.isEmpty(formDTO.getStatus())){ + queryWrapper.lambda().eq(IcResiCategoryStatsConfigEntity::getStatus,formDTO.getStatus()); + } + + List statsConfigEntityList = icResiCategoryStatsConfigDao.selectList(queryWrapper); + + return new Result>().ok(ConvertUtils.sourceToTarget(statsConfigEntityList, IcResiCategoryStatsConfigDTO.class)); + } + + @PostMapping("resicategorywarnlist") + public Result> resiCategoryWarnList(@RequestParam String customerId){ + //获取预警配置列表 + List warnConfigEntityList = icResiCategoryWarnConfigDao.selectList(new QueryWrapper() + .lambda() + .eq(IcResiCategoryWarnConfigEntity::getCustomerId,customerId) + .eq(IcResiCategoryWarnConfigEntity::getWarn,"1") + .orderByAsc(IcResiCategoryWarnConfigEntity::getSort)); + + return new Result>().ok(ConvertUtils.sourceToTarget(warnConfigEntityList, IcResiCategoryWarnConfigDTO.class)); + } + @PostMapping("resicategorywarninfobyid") + public Result resiCategoryWarnInfoById(@RequestBody IcResiCategoryWarnConfigDTO dto){ + //获取预警配置列表 + if(StringUtils.isEmpty(dto.getId())){ + return new Result<>(); + } + return new Result().ok(ConvertUtils.sourceToTarget(icResiCategoryWarnConfigDao.selectById(dto.getId()),IcResiCategoryWarnConfigDTO.class)); + } + + +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcFormDao.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcFormDao.java new file mode 100644 index 0000000000..7cd489b2bb --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcFormDao.java @@ -0,0 +1,68 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.CustomerFormResultDTO; +import com.epmet.dto.result.FormGroupDTO; +import com.epmet.dto.result.FormItemResult; +import com.epmet.dto.result.OptionDTO; +import com.epmet.entity.IcFormEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 配置表单 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +@Mapper +public interface IcFormDao extends BaseDao { + /** + * 查询表单 + * + * @param customerId + * @param formCode + * @return com.epmet.dto.result.CustomerFormResultDTO + * @author yinzuomei + * @date 2021/10/26 2:48 下午 + */ + CustomerFormResultDTO selectByCode(@Param("customerId") String customerId, @Param("formCode") String formCode); + + List selectItemList(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..a0ad3ad839 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcFormItemDao.java @@ -0,0 +1,74 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.ColumnTableNameResultDTO; +import com.epmet.dto.result.ConditionResultDTO; +import com.epmet.dto.result.IcFormResColumnDTO; +import com.epmet.dto.result.TableHeaderResultDTO; +import com.epmet.entity.IcFormItemEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Set; + +/** + * 表单项 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +@Mapper +public interface IcFormItemDao extends BaseDao { + + List selectConditionList(@Param("customerId") String customerId, @Param("formCode") String formCode); + + List queryTableHeaderList(@Param("customerId") String customerId, @Param("formCode") String formCode); + + /** + * 返回用于列表展示的列有哪些:table.列名 + * + * @param customerId + * @param formCode + * @return java.util.List + * @author yinzuomei + * @date 2021/11/1 12:58 下午 + */ + List queryConditions(@Param("customerId") String customerId, @Param("formCode")String formCode); + + /** + * 构造出所有子表关联语句 + * + * @param customerId + * @param formCode + * @return java.util.List + * @author yinzuomei + * @date 2021/11/1 1:25 下午 + */ + List querySubTables(@Param("customerId") String customerId, @Param("formCode")String formCode); + + Set queryIcResiSubTables(@Param("customerId") String customerId, @Param("formCode")String formCode); + + /** + * @Author sun + * @Description 居民信息新增查询各表必填字段 + **/ + List getMustColumn(@Param("customerId")String customerId); +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcFormItemGroupDao.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcFormItemGroupDao.java new file mode 100644 index 0000000000..d3b2322060 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcFormItemGroupDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcFormItemGroupEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 表单项分组 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +@Mapper +public interface IcFormItemGroupDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcFormItemOptionsDao.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcFormItemOptionsDao.java new file mode 100644 index 0000000000..d731505e3d --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcFormItemOptionsDao.java @@ -0,0 +1,44 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcFormItemOptionsEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 表单项的选项 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +@Mapper +public interface IcFormItemOptionsDao extends BaseDao { + + /** + * @Description 查询志愿者类型 + * @param volunteers + * @author zxc + * @date 2021/11/8 10:02 上午 + */ + List volunteerLabelByValues(@Param("volunteers") List volunteers,@Param("customerId")String customerId); + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcResiCategoryStatsConfigDao.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcResiCategoryStatsConfigDao.java new file mode 100644 index 0000000000..95fd7c9222 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcResiCategoryStatsConfigDao.java @@ -0,0 +1,46 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.IcResiCategoryStatsConfigResultDTO; +import com.epmet.entity.IcResiCategoryStatsConfigEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 居民类别配置表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +@Mapper +public interface IcResiCategoryStatsConfigDao extends BaseDao { + + /** + * 获取配置信息 + * @param customerId + * @param isWarn + * @param level + */ + List listInfo(@Param("customerId") String customerId, @Param("isWarn") Integer isWarn, @Param("level") Integer level); + + IcResiCategoryStatsConfigResultDTO info(@Param("id") String id,@Param("customerId") String customerId); +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcResiCategoryWarnConfigDao.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcResiCategoryWarnConfigDao.java new file mode 100644 index 0000000000..d9a9e0a2b0 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcResiCategoryWarnConfigDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcResiCategoryWarnConfigEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 居民类别预警配置表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +@Mapper +public interface IcResiCategoryWarnConfigDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/ItemTypeDao.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/ItemTypeDao.java new file mode 100644 index 0000000000..ff4cb72d06 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/ItemTypeDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.ItemTypeEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 控件类型 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +@Mapper +public interface ItemTypeDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcFormEntity.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcFormEntity.java new file mode 100644 index 0000000000..4b53f0af6d --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcFormEntity.java @@ -0,0 +1,61 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 配置表单 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_form") +public class IcFormEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 表单CODE,从字典获取 + */ + private String formCode; + + /** + * 表单名称 + */ + private String formName; + + /** + * 地区码,有父级用父级 + */ + private String areaCode; + +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcFormItemEntity.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcFormItemEntity.java new file mode 100644 index 0000000000..c5c509ea25 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcFormItemEntity.java @@ -0,0 +1,138 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 表单项 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_form_item") +public class IcFormItemEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * + */ + private String areaCode; + + /** + * 表单ID + */ + private String formId; + + /** + * 表单CODE + */ + private String formCode; + + /** + * 父项ID + */ + private String parentItemId; + + /** + * 项标签 + */ + private String label; + + /** + * 控件类型,EG:INPUT;从字典获取 + */ + private String itemType; + + /** + * 分组ID,'默认,0' + */ + private String itemGroupId; + + /** + * 是否必填,1必填。0不必填 + */ + private Integer required; + + /** + * 手机号:mobile; 身份证:id_card + */ + private String validType; + + /** + * 默认值 + */ + private String defaultValue; + + /** + * 选项来源,REMOTE;LOCAL;如果是动态加载的下拉框或者CHECKBOX等的情况下使用。URL:接口获取(LABEL,VALUE);JSON:直接从JSON中取 + */ + private String optionSourceType; + + /** + * 来源地址,REMOTE才有,固定格式;如果OPTIONS_SOURCE是URL,则此处填写要调用的接口的URL相对路径,例如:/API/GOV/ORG/XXXX。此处不应设置参数,若需要参数应当完全由后端,通过TOKEN信息来获取 + */ + private String optionSourceValue; + + /** + * 排序 + */ + private Integer sort; + + /** + * 占位提示语 + */ + private String placeholder; + + /** + * 是否查询显示,1展示。0不展示 + */ + private Integer searchDisplay; + + /** + * 是否列表显示,1展示,0不展示 + */ + private Integer listDisplay; + + /** + * 是否需要支持数据分析,1支持。0不支持 + */ + private Integer dataAnalyse; + + /** + * 列名 + */ + private String columnName; + + /** + * 列名序号,根据表递增 + */ + private Integer columnNum; + +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcFormItemGroupEntity.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcFormItemGroupEntity.java new file mode 100644 index 0000000000..29e5cec078 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcFormItemGroupEntity.java @@ -0,0 +1,78 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 表单项分组 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_form_item_group") +public class IcFormItemGroupEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 表单ID + */ + private String formId; + + /** + * 表单编码 + */ + private String formCode; + + /** + * 对应的子表名称 + */ + private String tableName; + + /** + * 是否支持添加一行,1支持,默认0不支持 + */ + private Boolean supportAdd; + + /** + * 名称 + */ + private String label; + + /** + * 排序 + */ + private Integer sort; + + /** + * 1展示,0不展示,默认1 + */ + private Boolean display; + +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcFormItemOptionsEntity.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcFormItemOptionsEntity.java new file mode 100644 index 0000000000..1ef8d360db --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcFormItemOptionsEntity.java @@ -0,0 +1,76 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 表单项的选项 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_form_item_options") +public class IcFormItemOptionsEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 表单ID + */ + private String formId; + + /** + * 表单CODE + */ + private String formCode; + + /** + * 表单项ID + */ + private String itemId; + + /** + * 可选项标签名 + */ + private String optionLabel; + + /** + * 标签value值 + */ + private String optionValue; + + /** + * 排序 + */ + private Integer sort; + +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcResiCategoryStatsConfigEntity.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcResiCategoryStatsConfigEntity.java new file mode 100644 index 0000000000..d0201db93d --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcResiCategoryStatsConfigEntity.java @@ -0,0 +1,83 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 居民类别配置表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_resi_category_stats_config") +public class IcResiCategoryStatsConfigEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 项标签 + */ + private String label; + + /** + * 表名 + */ + private String tableName; + + /** + * 列名 + */ + private String columnName; + + /** + * 管理平台分类图标 + */ + private String managementIcon; + + /** + * 数据平台分类图标 + */ + private String dataIcon; + + /** + * 房屋显示分类图标 + */ + private String houseShowIcon; + + /** + * 状态 显示:show;隐藏:hidden + */ + private String status; + + /** + * 排序 + */ + private Integer sort; + +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcResiCategoryWarnConfigEntity.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcResiCategoryWarnConfigEntity.java new file mode 100644 index 0000000000..9175c282a6 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcResiCategoryWarnConfigEntity.java @@ -0,0 +1,89 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 居民类别预警配置表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_resi_category_warn_config") +public class IcResiCategoryWarnConfigEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 项标签 + */ + private String label; + + /** + * 表名 + */ + private String tableName; + + /** + * 列名 + */ + private String columnName; + /** + * 是否预警 1 是 0 否 + */ + private String warn; + + /** + * 排序 + */ + private Integer sort; + + /** + * 等级1阈值 + */ + @TableField(value = "LEVEL_1") + private Integer level1; + + /** + * 等级2阈值 + */ + @TableField(value = "LEVEL_2") + private Integer level2; + + /** + * 等级3阈值 + */ + @TableField(value = "LEVEL_3") + private Integer level3; + +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/ItemTypeEntity.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/ItemTypeEntity.java new file mode 100644 index 0000000000..8c552c2f75 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/ItemTypeEntity.java @@ -0,0 +1,51 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 控件类型 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("item_type") +public class ItemTypeEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 名称 + */ + private String name; + + /** + * CODE + */ + private String code; + +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/IcFormExcel.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/IcFormExcel.java new file mode 100644 index 0000000000..7f70adddfc --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/IcFormExcel.java @@ -0,0 +1,68 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 配置表单 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +@Data +public class IcFormExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "表单CODE,从字典获取") + private String formCode; + + @Excel(name = "表单名称") + private String formName; + + @Excel(name = "地区码,有父级用父级") + private String areaCode; + + @Excel(name = "0未删除,1已删除") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/IcFormItemExcel.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/IcFormItemExcel.java new file mode 100644 index 0000000000..8e11613a01 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/IcFormItemExcel.java @@ -0,0 +1,116 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 表单项 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +@Data +public class IcFormItemExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "") + private String areaCode; + + @Excel(name = "表单ID") + private String formId; + + @Excel(name = "表单CODE") + private String formCode; + + @Excel(name = "父项ID") + private String parentItemId; + + @Excel(name = "项标签") + private String label; + + @Excel(name = "控件类型,EG:INPUT;从字典获取") + private String itemType; + + @Excel(name = "分组ID,'默认,NONE'") + private String itemGroupId; + + @Excel(name = "是否必填,1必填。0不必填") + private Integer required; + + @Excel(name = "手机号:mobile; 身份证:id_card") + private String validType; + + @Excel(name = "默认值") + private String defaultValue; + + @Excel(name = "选项来源,REMOTE;LOCAL;如果是动态加载的下拉框或者CHECKBOX等的情况下使用。URL:接口获取(LABEL,VALUE);JSON:直接从JSON中取") + private String optionSourceType; + + @Excel(name = "来源地址,REMOTE才有,固定格式;如果OPTIONS_SOURCE是URL,则此处填写要调用的接口的URL相对路径,例如:/API/GOV/ORG/XXXX。此处不应设置参数,若需要参数应当完全由后端,通过TOKEN信息来获取") + private String optionSourceValue; + + @Excel(name = "排序") + private Integer sort; + + @Excel(name = "占位提示语") + private String placeholder; + + @Excel(name = "是否查询显示,1展示。0不展示") + private Integer searchDisplay; + + @Excel(name = "是否列表显示,1展示,0不展示") + private Integer listDisplay; + + @Excel(name = "是否需要支持数据分析,1支持。0不支持") + private Integer dataAnalyse; + + @Excel(name = "列名") + private String columnName; + + @Excel(name = "列名序号,根据表递增") + private Integer columnNum; + + @Excel(name = "0未删除,1已删除") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/IcFormItemGroupExcel.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/IcFormItemGroupExcel.java new file mode 100644 index 0000000000..0d9cb8c7b9 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/IcFormItemGroupExcel.java @@ -0,0 +1,80 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 表单项分组 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +@Data +public class IcFormItemGroupExcel { + + @Excel(name = "分组id") + private String id; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "表单ID") + private String formId; + + @Excel(name = "表单编码") + private String formCode; + + @Excel(name = "对应的子表名称") + private String tableName; + + @Excel(name = "是否支持添加一行,1支持,默认0不支持") + private Integer supportAdd; + + @Excel(name = "名称") + private String label; + + @Excel(name = "排序") + private Integer sort; + + @Excel(name = "1展示,0不展示,默认1") + private Integer display; + + @Excel(name = "0未删除,1已删除") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/IcFormItemOptionsExcel.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/IcFormItemOptionsExcel.java new file mode 100644 index 0000000000..3f039890dc --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/IcFormItemOptionsExcel.java @@ -0,0 +1,77 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 表单项的选项 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +@Data +public class IcFormItemOptionsExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "表单ID") + private String formId; + + @Excel(name = "表单CODE") + private String formCode; + + @Excel(name = "表单项ID") + private String itemId; + + @Excel(name = "可选项标签名") + private String optionLabel; + + @Excel(name = "标签value值") + private String optionValue; + + @Excel(name = "排序") + private Integer sort; + + @Excel(name = "0未删除,1已删除") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/IcResiCategoryStatsConfigExcel.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/IcResiCategoryStatsConfigExcel.java new file mode 100644 index 0000000000..1e8f335885 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/IcResiCategoryStatsConfigExcel.java @@ -0,0 +1,83 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 居民类别配置表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +@Data +public class IcResiCategoryStatsConfigExcel { + + @Excel(name = "id") + private String id; + + @Excel(name = "客户id") + private String customerId; + + @Excel(name = "项标签") + private String label; + + @Excel(name = "表名") + private String tableName; + + @Excel(name = "列名") + private String columnName; + + @Excel(name = "管理平台分类图标") + private String managementIcon; + + @Excel(name = "数据平台分类图标") + private String dataIcon; + + @Excel(name = "房屋显示分类图标") + private String houseShowIcon; + + @Excel(name = "状态 显示:show;隐藏:hidden") + private String status; + + @Excel(name = "排序") + private Integer sort; + + @Excel(name = "删除标识:0.未删除 1.已删除") + private String delFlag; + + @Excel(name = "乐观锁") + private String revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private String createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/IcResiCategoryWarnConfigExcel.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/IcResiCategoryWarnConfigExcel.java new file mode 100644 index 0000000000..d9d5edf543 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/IcResiCategoryWarnConfigExcel.java @@ -0,0 +1,80 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 居民类别预警配置表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +@Data +public class IcResiCategoryWarnConfigExcel { + + @Excel(name = "id") + private String id; + + @Excel(name = "客户id") + private String customerId; + + @Excel(name = "项标签") + private String label; + + @Excel(name = "表名") + private String tableName; + + @Excel(name = "列名") + private String columnName; + + @Excel(name = "排序") + private Integer sort; + + @Excel(name = "等级1阈值") + private Integer level1; + + @Excel(name = "等级2阈值") + private Integer level2; + + @Excel(name = "等级3阈值") + private Integer level3; + + @Excel(name = "删除标识:0.未删除 1.已删除") + private String delFlag; + + @Excel(name = "乐观锁") + private String revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private String createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/ItemTypeExcel.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/ItemTypeExcel.java new file mode 100644 index 0000000000..85db48a4c8 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/ItemTypeExcel.java @@ -0,0 +1,62 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 控件类型 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +@Data +public class ItemTypeExcel { + + @Excel(name = "ID") + private String id; + + @Excel(name = "名称") + private String name; + + @Excel(name = "CODE") + private String code; + + @Excel(name = "0未删除,1已删除") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/CustomerFootBarRedis.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/CustomerFootBarRedis.java index 1d120429d8..0c549999ed 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/CustomerFootBarRedis.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/CustomerFootBarRedis.java @@ -17,9 +17,15 @@ package com.epmet.redis; +import cn.hutool.core.bean.BeanUtil; +import com.epmet.commons.tools.redis.RedisKeys; import com.epmet.commons.tools.redis.RedisUtils; +import com.epmet.dto.result.CustomerFormResultDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; +import org.springframework.util.CollectionUtils; + +import java.util.Map; /** * APP底部菜单栏信息 @@ -44,4 +50,37 @@ public class CustomerFootBarRedis { return null; } + public void deleteIcForm(String formCode,String customerId) { + String key = RedisKeys.getIcFormKeyForAdd(formCode,customerId); + redisUtils.delete(key); + } + + public void setCustomerFormResultDTO(String formCode,String customerId, CustomerFormResultDTO value,Boolean dynamic){ + String key=""; + if (null != dynamic && dynamic) { + //新增表单 + key = RedisKeys.getIcFormKeyForAdd(formCode,customerId); + }else{ + //导出 + key = RedisKeys.getIcFormKeyForExport(formCode,customerId); + } + Map map = BeanUtil.beanToMap(value, false, true); + redisUtils.hMSet(key, map); + } + + public CustomerFormResultDTO getCustomerFormResultDTO(String formCode,String customerId,Boolean dynamic){ + String key=""; + if (null != dynamic && dynamic) { + //新增表单 + key = RedisKeys.getIcFormKeyForAdd(formCode,customerId); + }else{ + //导出 + key = RedisKeys.getIcFormKeyForExport(formCode,customerId); + } + Map resultMap = redisUtils.hGetAll(key); + if (CollectionUtils.isEmpty(resultMap)) { + return null; + } + return BeanUtil.mapToBean(resultMap, CustomerFormResultDTO.class, true); + } } \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/IcResiCategoryStatsConfigRedis.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/IcResiCategoryStatsConfigRedis.java new file mode 100644 index 0000000000..789965c0c9 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/IcResiCategoryStatsConfigRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 居民类别配置表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +@Component +public class IcResiCategoryStatsConfigRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/IcResiCategoryWarnConfigRedis.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/IcResiCategoryWarnConfigRedis.java new file mode 100644 index 0000000000..eee6ae7fc6 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/IcResiCategoryWarnConfigRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 居民类别预警配置表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +@Component +public class IcResiCategoryWarnConfigRedis { + @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/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..387cc05412 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcFormItemOptionsService.java @@ -0,0 +1,103 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcFormItemOptionsDTO; +import com.epmet.entity.IcFormItemOptionsEntity; + +import java.util.List; +import java.util.Map; + +/** + * 表单项的选项 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +public interface IcFormItemOptionsService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-10-26 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-10-26 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcFormItemOptionsDTO + * @author generator + * @date 2021-10-26 + */ + IcFormItemOptionsDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-10-26 + */ + void save(IcFormItemOptionsDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-10-26 + */ + void update(IcFormItemOptionsDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-10-26 + */ + void delete(String[] ids); + + /** + * @Description 查询志愿者类型 + * @param volunteers + * @author zxc + * @date 2021/11/8 10:02 上午 + */ + List volunteerLabelByValues(List volunteers, String customerId); +} \ 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..32480613c2 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcFormItemService.java @@ -0,0 +1,125 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.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.ColumnTableNameResultDTO; +import com.epmet.dto.result.ConditionResultDTO; +import com.epmet.dto.result.IcFormResColumnDTO; +import com.epmet.dto.result.TableHeaderResultDTO; +import com.epmet.entity.IcFormItemEntity; + +import java.util.List; +import java.util.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); + + /** + * @Author sun + * @Description 居民信息新增查询各表必填字段 + **/ + List getMustColumn(String customerId); +} \ 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..c90e6227dc --- /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.FormItemResult; +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); +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcResiCategoryStatsConfigService.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcResiCategoryStatsConfigService.java new file mode 100644 index 0000000000..aa99453387 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcResiCategoryStatsConfigService.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcResiCategoryStatsConfigDTO; +import com.epmet.entity.IcResiCategoryStatsConfigEntity; + +import java.util.List; +import java.util.Map; + +/** + * 居民类别配置表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +public interface IcResiCategoryStatsConfigService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-11-04 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-11-04 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcResiCategoryStatsConfigDTO + * @author generator + * @date 2021-11-04 + */ + IcResiCategoryStatsConfigDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-11-04 + */ + void save(IcResiCategoryStatsConfigDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-11-04 + */ + void update(IcResiCategoryStatsConfigDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-11-04 + */ + void delete(String[] ids); + + /** + * @Description 获取居民类别 + * @Param dto + * @Return {@link List< IcResiCategoryStatsConfigDTO>} + * @Author zhaoqifeng + * @Date 2021/11/5 15:43 + */ + List getCategoryList(IcResiCategoryStatsConfigDTO dto); +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcResiCategoryWarnConfigService.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcResiCategoryWarnConfigService.java new file mode 100644 index 0000000000..bef9c7360f --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcResiCategoryWarnConfigService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcResiCategoryWarnConfigDTO; +import com.epmet.entity.IcResiCategoryWarnConfigEntity; + +import java.util.List; +import java.util.Map; + +/** + * 居民类别预警配置表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +public interface IcResiCategoryWarnConfigService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-11-04 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-11-04 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcResiCategoryWarnConfigDTO + * @author generator + * @date 2021-11-04 + */ + IcResiCategoryWarnConfigDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-11-04 + */ + void save(IcResiCategoryWarnConfigDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-11-04 + */ + void update(IcResiCategoryWarnConfigDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-11-04 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/ItemTypeService.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/ItemTypeService.java new file mode 100644 index 0000000000..27f16dc45d --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/ItemTypeService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.ItemTypeDTO; +import com.epmet.entity.ItemTypeEntity; + +import java.util.List; +import java.util.Map; + +/** + * 控件类型 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +public interface ItemTypeService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-10-26 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-10-26 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ItemTypeDTO + * @author generator + * @date 2021-10-26 + */ + ItemTypeDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-10-26 + */ + void save(ItemTypeDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-10-26 + */ + void update(ItemTypeDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-10-26 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/ResiCategoryStatsConfigService.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/ResiCategoryStatsConfigService.java new file mode 100644 index 0000000000..c9a4ff28b7 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/ResiCategoryStatsConfigService.java @@ -0,0 +1,49 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcResiCategoryStatsConfigDTO; +import com.epmet.dto.form.IcResiCategoryStatsConfigFormDTO; +import com.epmet.dto.form.IcResiCategoryStatsConfigSortFormDTO; +import com.epmet.dto.form.ResiCategoryStatsConfigListFormDTO; +import com.epmet.dto.result.IcResiCategoryStatsConfigResultDTO; +import com.epmet.entity.IcResiCategoryStatsConfigEntity; + +import java.util.List; +import java.util.Map; + +/** + * 居民类别配置表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +public interface ResiCategoryStatsConfigService { + + List list(String customerId, ResiCategoryStatsConfigListFormDTO formDTO); + + IcResiCategoryStatsConfigResultDTO info(String id,String customerId); + + void update(String customerId,IcResiCategoryStatsConfigFormDTO formDTO); + + void updateStatus(String customerId,IcResiCategoryStatsConfigFormDTO formDTO); + + void updateSort(String customerId,List formDTOs); +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormItemGroupServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormItemGroupServiceImpl.java new file mode 100644 index 0000000000..2de0adc908 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormItemGroupServiceImpl.java @@ -0,0 +1,100 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.IcFormItemGroupDao; +import com.epmet.dto.IcFormItemGroupDTO; +import com.epmet.entity.IcFormItemGroupEntity; +import com.epmet.service.IcFormItemGroupService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 表单项分组 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +@Service +public class IcFormItemGroupServiceImpl extends BaseServiceImpl implements IcFormItemGroupService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcFormItemGroupDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcFormItemGroupDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcFormItemGroupDTO get(String id) { + IcFormItemGroupEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcFormItemGroupDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcFormItemGroupDTO dto) { + IcFormItemGroupEntity entity = ConvertUtils.sourceToTarget(dto, IcFormItemGroupEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcFormItemGroupDTO dto) { + IcFormItemGroupEntity entity = ConvertUtils.sourceToTarget(dto, IcFormItemGroupEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormItemOptionsServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormItemOptionsServiceImpl.java new file mode 100644 index 0000000000..144e56e568 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormItemOptionsServiceImpl.java @@ -0,0 +1,111 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.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)); + } + + /** + * @Description 查询志愿者类型 + * @param volunteers + * @author zxc + * @date 2021/11/8 10:02 上午 + */ + @Override + public List volunteerLabelByValues(List volunteers,String customerId) { + return baseDao.volunteerLabelByValues(volunteers,customerId); + } + +} \ 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..f614e64e0b --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormItemServiceImpl.java @@ -0,0 +1,174 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.IcFormItemDao; +import com.epmet.dto.IcFormItemDTO; +import com.epmet.dto.form.CustomerFormQueryDTO; +import com.epmet.dto.result.ColumnTableNameResultDTO; +import com.epmet.dto.result.ConditionResultDTO; +import com.epmet.dto.result.IcFormResColumnDTO; +import com.epmet.dto.result.TableHeaderResultDTO; +import com.epmet.entity.IcFormItemEntity; +import com.epmet.service.IcFormItemService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.*; + +/** + * 表单项 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +@Service +public class IcFormItemServiceImpl extends BaseServiceImpl implements IcFormItemService { + + + @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 categoryName=new TableHeaderResultDTO(); + categoryName.setItemType("input"); + categoryName.setItemId(StrConstant.EPMETY_STR); + categoryName.setColumnName("CATEGORY_NAME"); + categoryName.setLabel("居民需求"); + categoryName.setOptions(new ArrayList<>()); + list.add(categoryName); + + TableHeaderResultDTO houseType=new TableHeaderResultDTO(); + houseType.setItemType("input"); + houseType.setItemId(StrConstant.EPMETY_STR); + houseType.setColumnName("HOUSE_TYPE"); + houseType.setLabel("房屋类型"); + houseType.setOptions(new ArrayList<>()); + list.add(houseType); + return list; + } + + @Override + public List queryConditions(String customerId,String formCode) { + return baseDao.queryConditions(customerId,formCode); + } + + @Override + public List querySubTables(String customerId, String formCode) { + return baseDao.querySubTables(customerId,formCode); + } + + @Override + public Set queryIcResiSubTables(String customerId, String formCode) { + return baseDao.queryIcResiSubTables(customerId,formCode); + } + + /** + * @Author sun + * @Description 居民信息新增查询各表必填字段 + **/ + @Override + public List getMustColumn(String customerId) { + return baseDao.getMustColumn(customerId); + } + +} \ 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..7d50e6091b --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormServiceImpl.java @@ -0,0 +1,168 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.alibaba.fastjson.JSONArray; +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.redis.RedisKeys; +import com.epmet.commons.tools.redis.RedisUtils; +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.FormItemResult; +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; + + @Autowired + private RedisUtils redisUtils; + + @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(),formDto.getDynamic()); + if (null != customerFormResultDTO) { + return customerFormResultDTO; + } + CustomerFormResultDTO resultDTO=baseDao.selectByCode(formDto.getCustomerId(),formDto.getFormCode()); + if (null == resultDTO) { + throw new RenException(EpmetErrorCode.CUSTOMER_FORM_NOT_EXITS.getCode(),EpmetErrorCode.CUSTOMER_FORM_NOT_EXITS.getMsg()); + } + List itemList=baseDao.selectItemList(resultDTO.getFormId(),formDto.getDynamic()); + List groupList=baseDao.selectListGroup(resultDTO.getFormId()); + resultDTO.setItemList(itemList); + resultDTO.setGroupList(groupList); + customerFootBarRedis.setCustomerFormResultDTO(formDto.getFormCode(),formDto.getCustomerId(),resultDTO,formDto.getDynamic()); + return resultDTO; + } + + @Override + public List listItems(String customerId, String formCode) { + // 从redis取 + String icFormItemsKey = RedisKeys.getIcFormItemsKey(customerId, formCode); + + Object objValue = redisUtils.get(icFormItemsKey); + if (objValue != null) { + return ((JSONArray) objValue).toJavaList(FormItemResult.class); + //return JSON.parseObject((String) objValue, type); + } + + // 从db取 + CustomerFormResultDTO formResultDto=baseDao.selectByCode(customerId, formCode); + if (null == formResultDto) { + throw new RenException(EpmetErrorCode.CUSTOMER_FORM_NOT_EXITS.getCode(),EpmetErrorCode.CUSTOMER_FORM_NOT_EXITS.getMsg()); + } + + List formItemResults = baseDao.listItems(formResultDto.getFormId()); + formItemResults.forEach(i -> { + i.setOptions(baseDao.selectListOption(i.getItemId())); + }); + + // 缓存 + redisUtils.set(icFormItemsKey, formItemResults); + + return formItemResults; + } +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcResiCategoryStatsConfigServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcResiCategoryStatsConfigServiceImpl.java new file mode 100644 index 0000000000..d0183a03f9 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcResiCategoryStatsConfigServiceImpl.java @@ -0,0 +1,126 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.IcResiCategoryStatsConfigDao; +import com.epmet.dto.IcResiCategoryStatsConfigDTO; +import com.epmet.entity.IcResiCategoryStatsConfigEntity; +import com.epmet.redis.IcResiCategoryStatsConfigRedis; +import com.epmet.service.IcResiCategoryStatsConfigService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +/** + * 居民类别配置表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +@Service +public class IcResiCategoryStatsConfigServiceImpl extends BaseServiceImpl implements IcResiCategoryStatsConfigService { + + @Autowired + private IcResiCategoryStatsConfigRedis icResiCategoryStatsConfigRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcResiCategoryStatsConfigDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcResiCategoryStatsConfigDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcResiCategoryStatsConfigDTO get(String id) { + IcResiCategoryStatsConfigEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcResiCategoryStatsConfigDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcResiCategoryStatsConfigDTO dto) { + IcResiCategoryStatsConfigEntity entity = ConvertUtils.sourceToTarget(dto, IcResiCategoryStatsConfigEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcResiCategoryStatsConfigDTO dto) { + IcResiCategoryStatsConfigEntity entity = ConvertUtils.sourceToTarget(dto, IcResiCategoryStatsConfigEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @param dto + * @Description 获取居民类别 + * @Param dto + * @Return {@link List< IcResiCategoryStatsConfigDTO>} + * @Author zhaoqifeng + * @Date 2021/11/5 15:43 + */ + @Override + public List getCategoryList(IcResiCategoryStatsConfigDTO dto) { + if(StringUtils.isBlank(dto.getCustomerId())) { + return Collections.emptyList(); + } + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcResiCategoryStatsConfigEntity::getCustomerId, dto.getCustomerId()); + wrapper.orderByAsc(IcResiCategoryStatsConfigEntity::getSort); + List list = baseDao.selectList(wrapper); + return ConvertUtils.sourceToTarget(list, IcResiCategoryStatsConfigDTO.class); + } + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcResiCategoryWarnConfigServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcResiCategoryWarnConfigServiceImpl.java new file mode 100644 index 0000000000..3235b04f0d --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcResiCategoryWarnConfigServiceImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.IcResiCategoryWarnConfigDao; +import com.epmet.dto.IcResiCategoryWarnConfigDTO; +import com.epmet.entity.IcResiCategoryWarnConfigEntity; +import com.epmet.redis.IcResiCategoryWarnConfigRedis; +import com.epmet.service.IcResiCategoryWarnConfigService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 居民类别预警配置表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +@Service +public class IcResiCategoryWarnConfigServiceImpl extends BaseServiceImpl implements IcResiCategoryWarnConfigService { + + @Autowired + private IcResiCategoryWarnConfigRedis icResiCategoryWarnConfigRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcResiCategoryWarnConfigDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcResiCategoryWarnConfigDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcResiCategoryWarnConfigDTO get(String id) { + IcResiCategoryWarnConfigEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcResiCategoryWarnConfigDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcResiCategoryWarnConfigDTO dto) { + IcResiCategoryWarnConfigEntity entity = ConvertUtils.sourceToTarget(dto, IcResiCategoryWarnConfigEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcResiCategoryWarnConfigDTO dto) { + IcResiCategoryWarnConfigEntity entity = ConvertUtils.sourceToTarget(dto, IcResiCategoryWarnConfigEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/ItemTypeServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/ItemTypeServiceImpl.java new file mode 100644 index 0000000000..cb73a5b85c --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/ItemTypeServiceImpl.java @@ -0,0 +1,100 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.ItemTypeDao; +import com.epmet.dto.ItemTypeDTO; +import com.epmet.entity.ItemTypeEntity; +import com.epmet.service.ItemTypeService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 控件类型 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +@Service +public class ItemTypeServiceImpl extends BaseServiceImpl implements ItemTypeService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ItemTypeDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ItemTypeDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public ItemTypeDTO get(String id) { + ItemTypeEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ItemTypeDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ItemTypeDTO dto) { + ItemTypeEntity entity = ConvertUtils.sourceToTarget(dto, ItemTypeEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ItemTypeDTO dto) { + ItemTypeEntity entity = ConvertUtils.sourceToTarget(dto, ItemTypeEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/ResiCategoryStatsConfigServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/ResiCategoryStatsConfigServiceImpl.java new file mode 100644 index 0000000000..e95f209aba --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/ResiCategoryStatsConfigServiceImpl.java @@ -0,0 +1,228 @@ +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.constant.IcResiCategoryStatsConfigConstant; +import com.epmet.dao.IcFormItemDao; +import com.epmet.dao.IcFormItemGroupDao; +import com.epmet.dao.IcResiCategoryStatsConfigDao; +import com.epmet.dao.IcResiCategoryWarnConfigDao; +import com.epmet.dto.IcResiCategoryStatsConfigDTO; +import com.epmet.dto.form.IcResiCategoryStatsConfigFormDTO; +import com.epmet.dto.form.IcResiCategoryStatsConfigSortFormDTO; +import com.epmet.dto.form.ResiCategoryStatsConfigListFormDTO; +import com.epmet.dto.result.IcResiCategoryStatsConfigResultDTO; +import com.epmet.entity.IcFormItemEntity; +import com.epmet.entity.IcFormItemGroupEntity; +import com.epmet.entity.IcResiCategoryStatsConfigEntity; +import com.epmet.entity.IcResiCategoryWarnConfigEntity; +import com.epmet.service.IcResiCategoryStatsConfigService; +import com.epmet.service.IcResiCategoryWarnConfigService; +import com.epmet.service.ResiCategoryStatsConfigService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import javax.annotation.Resource; +import java.util.*; +import java.util.stream.Collectors; + +@Slf4j +@Service +public class ResiCategoryStatsConfigServiceImpl implements ResiCategoryStatsConfigService { + @Autowired + private IcResiCategoryStatsConfigService icResiCategoryStatsConfigService; + + @Resource + private IcFormItemDao icFormItemDao; + @Resource + private IcFormItemGroupDao icFormItemGroupDao; + @Resource + private IcResiCategoryStatsConfigDao icResiCategoryStatsConfigDao; + @Resource + private IcResiCategoryWarnConfigDao icResiCategoryWarnConfigDao; + @Autowired + private IcResiCategoryWarnConfigService icResiCategoryWarnConfigService; + + @Override + @Transactional(rollbackFor = Exception.class) + public List list(String customerId, ResiCategoryStatsConfigListFormDTO formDTO) { + //1.获取IC_FORM_ITEM 中 用于数据分析字段的 id 和label + List icFormItemEntityList = icFormItemDao.selectList(new QueryWrapper().lambda().eq(IcFormItemEntity::getCustomerId,customerId).eq(IcFormItemEntity::getDataAnalyse, 1)); + if(CollectionUtils.isEmpty(icFormItemEntityList)){ + return new ArrayList<>(); + } + Set groupIds = icFormItemEntityList.stream().filter(item-> !"0".equals(item.getItemGroupId())).map(IcFormItemEntity::getItemGroupId).collect(Collectors.toSet()); + List icFormItemGroupEntityList = new ArrayList<>(); + if(!CollectionUtils.isEmpty(groupIds)){ + icFormItemGroupEntityList.addAll(icFormItemGroupDao.selectList(new QueryWrapper().lambda().eq(IcFormItemGroupEntity::getCustomerId,customerId).in(IcFormItemGroupEntity::getId, groupIds))); + } + + //获取tableName和COLUMN_NAME + Map tableColumnMap = new HashMap<>(); + Map idTableMap = new HashMap<>(); + icFormItemEntityList.forEach(item->{ + Map map = new HashMap<>(); + item.setColumnName(item.getColumnName().concat(NumConstant.ZERO == item.getColumnNum() ? StrConstant.EPMETY_STR : item.getColumnNum().toString())); + if("0".equals(item.getItemGroupId())){ + tableColumnMap.put(IcResiCategoryStatsConfigConstant.IC_RESI_USER+"-"+item.getColumnName(),item); + idTableMap.put(item.getId(),IcResiCategoryStatsConfigConstant.IC_RESI_USER); + }else{ + List collect = icFormItemGroupEntityList.stream().filter(i -> item.getItemGroupId().equals(i.getId())).collect(Collectors.toList()); + tableColumnMap.put(CollectionUtils.isEmpty(collect)?IcResiCategoryStatsConfigConstant.IC_RESI_USER:collect.get(0).getTableName()+"-"+item.getColumnName(),item); + idTableMap.put(item.getId(),CollectionUtils.isEmpty(collect)?IcResiCategoryStatsConfigConstant.IC_RESI_USER:collect.get(0).getTableName()); + } + + }); + + //2.获取ic_resi_category_stats_config 和 ic_resi_category_warn_config 表中的数据 + List statsConfigEntityList = icResiCategoryStatsConfigDao.selectList(new QueryWrapper().lambda().eq(IcResiCategoryStatsConfigEntity::getCustomerId,customerId)); + List warnConfigEntityList = icResiCategoryWarnConfigDao.selectList(new QueryWrapper().lambda().eq(IcResiCategoryWarnConfigEntity::getCustomerId,customerId)); + //3.新增不存在的,删除不在tableColumnMap的 + + Map statsTableColumnMap = new HashMap<>(); + statsConfigEntityList.forEach(item->{ + statsTableColumnMap.put(item.getTableName()+"-"+item.getColumnName(),item); + }); + Map warnTableColumnMap = new HashMap<>(); + warnConfigEntityList.forEach(item->{ + warnTableColumnMap.put(item.getTableName()+"-"+item.getColumnName(),item); + }); + //差集 + //新增 + List newStatsList = tableColumnMap.keySet().stream().filter(item -> !statsTableColumnMap.containsKey(item)).collect(Collectors.toList()); + + List newStatsEntityList = new ArrayList<>(); + newStatsList.forEach(item->{ + IcFormItemEntity icFormItemEntity = tableColumnMap.get(item); + IcResiCategoryStatsConfigEntity entity = new IcResiCategoryStatsConfigEntity(); + entity.setCustomerId(customerId); + entity.setLabel(icFormItemEntity.getLabel()); + entity.setTableName(idTableMap.get(icFormItemEntity.getId())); + entity.setColumnName(icFormItemEntity.getColumnName()); + entity.setManagementIcon(""); + entity.setDataIcon(""); + entity.setHouseShowIcon(""); + entity.setStatus("show"); + entity.setSort(icFormItemEntity.getSort()); + newStatsEntityList.add(entity); + }); + if(!CollectionUtils.isEmpty(newStatsEntityList)){ + icResiCategoryStatsConfigService.insertBatch(newStatsEntityList); + } + List newWarnList = tableColumnMap.keySet().stream().filter(item -> !warnTableColumnMap.containsKey(item)).collect(Collectors.toList()); + List newWarnEntityList = new ArrayList<>(); + newWarnList.forEach(item->{ + IcFormItemEntity icFormItemEntity = tableColumnMap.get(item); + IcResiCategoryWarnConfigEntity entity = new IcResiCategoryWarnConfigEntity(); + entity.setCustomerId(customerId); + entity.setLabel(icFormItemEntity.getLabel()); + entity.setTableName(idTableMap.get(icFormItemEntity.getId())); + entity.setColumnName(icFormItemEntity.getColumnName()); + entity.setWarn("0"); + entity.setSort(icFormItemEntity.getSort()); + newWarnEntityList.add(entity); + }); + if(!CollectionUtils.isEmpty(newWarnEntityList)){ + icResiCategoryWarnConfigService.insertBatch(newWarnEntityList); + } + List delStatsEntityIdList = new ArrayList<>(); + List delWarnEntityIdList = new ArrayList<>(); + //需要删除的 + List delStatsList = statsTableColumnMap.keySet().stream().filter(item -> !tableColumnMap.containsKey(item)).collect(Collectors.toList()); + List delWarnList = warnTableColumnMap.keySet().stream().filter(item -> !tableColumnMap.containsKey(item)).collect(Collectors.toList()); + delStatsList.forEach(item->{ + delStatsEntityIdList.add(statsTableColumnMap.get(item).getId()); + }); + delWarnList.forEach(item->{ + delWarnEntityIdList.add(warnTableColumnMap.get(item).getId()); + }); + if(!CollectionUtils.isEmpty(delStatsEntityIdList)){ + icResiCategoryStatsConfigService.deleteBatchIds(delStatsEntityIdList); + } + if(!CollectionUtils.isEmpty(delWarnEntityIdList)){ + icResiCategoryWarnConfigService.deleteBatchIds(delWarnEntityIdList); + } + + //4.返回数据 + return icResiCategoryStatsConfigDao.listInfo(customerId,formDTO.getIsWarn(),formDTO.getLevel()); + } + + @Override + public IcResiCategoryStatsConfigResultDTO info(String id,String customerId) { + return icResiCategoryStatsConfigDao.info(id,customerId); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(String customerId,IcResiCategoryStatsConfigFormDTO formDTO) { + IcResiCategoryStatsConfigDTO icResiCategoryStatsConfigDTO = icResiCategoryStatsConfigService.get(formDTO.getId()); + if(null == icResiCategoryStatsConfigDTO || !customerId.equals(icResiCategoryStatsConfigDTO.getCustomerId())){ + return ; + } + + //更新配置类别 + IcResiCategoryStatsConfigEntity icResiCategoryStatsConfigEntity = new IcResiCategoryStatsConfigEntity(); + BeanUtils.copyProperties(formDTO,icResiCategoryStatsConfigEntity); +// icResiCategoryStatsConfigEntity.setCustomerId(customerId); + icResiCategoryStatsConfigDao.updateById(icResiCategoryStatsConfigEntity); + + //更新配置预警 + //更新 + IcResiCategoryWarnConfigEntity icResiCategoryWarnConfigEntity = icResiCategoryWarnConfigDao.selectOne(new QueryWrapper().lambda() + .eq(IcResiCategoryWarnConfigEntity::getCustomerId,customerId) + .eq(IcResiCategoryWarnConfigEntity::getTableName, icResiCategoryStatsConfigDTO.getTableName()) + .eq(IcResiCategoryWarnConfigEntity::getColumnName, icResiCategoryStatsConfigDTO.getColumnName())); + icResiCategoryWarnConfigEntity.setWarn(formDTO.getWarn()); + icResiCategoryWarnConfigEntity.setLevel1(formDTO.getLevel1()); + icResiCategoryWarnConfigEntity.setLevel2(formDTO.getLevel2()); + icResiCategoryWarnConfigEntity.setLevel3(formDTO.getLevel3()); + icResiCategoryWarnConfigDao.updateById(icResiCategoryWarnConfigEntity); + + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void updateStatus(String customerId,IcResiCategoryStatsConfigFormDTO formDTO) { + //更新配置类别 + IcResiCategoryStatsConfigEntity icResiCategoryStatsConfigEntity = new IcResiCategoryStatsConfigEntity(); + BeanUtils.copyProperties(formDTO,icResiCategoryStatsConfigEntity); +// icResiCategoryStatsConfigEntity.setCustomerId(customerId); + icResiCategoryStatsConfigDao.updateById(icResiCategoryStatsConfigEntity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void updateSort(String customerId,List formDTOs) { + List entityList = new ArrayList<>(); + for (IcResiCategoryStatsConfigSortFormDTO formDTO : formDTOs) { + IcResiCategoryStatsConfigEntity icResiCategoryStatsConfigEntity = new IcResiCategoryStatsConfigEntity(); + icResiCategoryStatsConfigEntity.setId(formDTO.getId()); +// icResiCategoryStatsConfigEntity.setCustomerId(customerId); + icResiCategoryStatsConfigEntity.setSort(formDTO.getSort()); + entityList.add(icResiCategoryStatsConfigEntity); + } + if(CollectionUtils.isEmpty(entityList)){ + return ; + } + icResiCategoryStatsConfigService.updateBatchById(entityList); + //排序更新预警的 + List statsConfigEntityList = icResiCategoryStatsConfigDao.selectList(new QueryWrapper().lambda().eq(IcResiCategoryStatsConfigEntity::getCustomerId,customerId)); + List warnConfigEntityList = icResiCategoryWarnConfigDao.selectList(new QueryWrapper().lambda().eq(IcResiCategoryWarnConfigEntity::getCustomerId,customerId)); + if(CollectionUtils.isEmpty(warnConfigEntityList)){ + return ; + } + for (IcResiCategoryWarnConfigEntity warnConfigEntity : warnConfigEntityList) { + List collect = statsConfigEntityList.stream().filter(i -> i.getTableName().equals(warnConfigEntity.getTableName()) && i.getColumnName().equals(warnConfigEntity.getColumnName())).collect(Collectors.toList()); + if(CollectionUtils.isEmpty(collect)){ + continue; + } + warnConfigEntity.setSort(collect.get(0).getSort()); + } + icResiCategoryWarnConfigService.updateBatchById(warnConfigEntityList); + } +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/logback-spring.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/logback-spring.xml index d02b4bffb3..9e56bd9fda 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/logback-spring.xml +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/logback-spring.xml @@ -139,7 +139,7 @@ - + diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormDao.xml new file mode 100644 index 0000000000..d93d611f7c --- /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..61a1c155c9 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormItemDao.xml @@ -0,0 +1,161 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ 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..36daa2158d --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormItemOptionsDao.xml @@ -0,0 +1,19 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcResiCategoryStatsConfigDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcResiCategoryStatsConfigDao.xml new file mode 100644 index 0000000000..f3afd11c49 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcResiCategoryStatsConfigDao.xml @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcResiCategoryWarnConfigDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcResiCategoryWarnConfigDao.xml new file mode 100644 index 0000000000..7fe3679b42 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcResiCategoryWarnConfigDao.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/ItemTypeDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/ItemTypeDao.xml new file mode 100644 index 0000000000..d488c4feab --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/ItemTypeDao.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java index ee2f844d04..0b6ecd84b0 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java @@ -380,7 +380,7 @@ public class ResiGroupServiceImpl extends BaseServiceImpl getGroupLeaderUserInfo(String groupId) { - String customerId = loginUserUtil.getCurrentCustomerId(); + String customerId = loginUserUtil.getLoginUserCustomerId(); //群主名称需要调用feign查询 // ResiGroupEntity resiGroupEntity = baseDao.selectById(groupId); // if (null == resiGroupEntity) { diff --git a/epmet-module/resi-home/resi-home-server/src/main/java/com/epmet/service/impl/ResiEventServiceImpl.java b/epmet-module/resi-home/resi-home-server/src/main/java/com/epmet/service/impl/ResiEventServiceImpl.java index 36a2a43684..fa19f94f14 100644 --- a/epmet-module/resi-home/resi-home-server/src/main/java/com/epmet/service/impl/ResiEventServiceImpl.java +++ b/epmet-module/resi-home/resi-home-server/src/main/java/com/epmet/service/impl/ResiEventServiceImpl.java @@ -50,7 +50,7 @@ public class ResiEventServiceImpl implements ResiEventService, ResultDataResolve //查询人大代表列表 ListUserByBadgeFormDTO npcForm = new ListUserByBadgeFormDTO(customerId, BadgeConstant.BADGE_KEY_NPC); Result> npcResult = epmetUserOpenFeignClient.listUsersByBadge(npcForm); - List npcData = getResultDataOrThrowsException(npcResult, ServiceConstant.EPMET_USER_SERVER, null, null); + List npcData = getResultDataOrThrowsException(npcResult, ServiceConstant.EPMET_USER_SERVER, null, null, null); if(CollectionUtils.isEmpty(npcData)) { // 没有人大代表,直接返回空列表即可 @@ -61,7 +61,7 @@ public class ResiEventServiceImpl implements ResiEventService, ResultDataResolve List npcGridIds = npcData.stream().map(d -> d.getGridId()).collect(Collectors.toList()); OrgInfoFormDTO form = new OrgInfoFormDTO(OrgInfoConstant.GRID, npcGridIds); Result> npcGridInfoResult = govOrgOpenFeignClient.selectOrgInfo(form); - List npcGridInfos = getResultDataOrThrowsException(npcGridInfoResult, ServiceConstant.GOV_ORG_SERVER, null, null); + List npcGridInfos = getResultDataOrThrowsException(npcGridInfoResult, ServiceConstant.GOV_ORG_SERVER, null, null, null); Map npcGridInfoMap = convertNpcGridInfos2Map(npcGridInfos); @@ -109,7 +109,7 @@ public class ResiEventServiceImpl implements ResiEventService, ResultDataResolve TreeSet targetLevels = new TreeSet<>(); Result gridInfoResult = govOrgOpenFeignClient.queryGridInfo(gridId); - GridInfoResultDTO gridInfoData = getResultDataOrThrowsException(gridInfoResult, ServiceConstant.GOV_ORG_SERVER, null, null); + GridInfoResultDTO gridInfoData = getResultDataOrThrowsException(gridInfoResult, ServiceConstant.GOV_ORG_SERVER, null, null, null); String pidsPath = gridInfoData.getPids(); List parentOrgIds = Arrays.asList(pidsPath.split(":")); // 翻转列表 @@ -118,7 +118,7 @@ public class ResiEventServiceImpl implements ResiEventService, ResultDataResolve // 一.网格信息(只有一条,但是为了适应接口,组装成了列表) List currentGridId = Arrays.asList(gridId); Result> currentGridInfoResult = govOrgOpenFeignClient.selectOrgInfo(new OrgInfoFormDTO(OrgInfoConstant.GRID, currentGridId)); - List currentGridInfos = getResultDataOrThrowsException(currentGridInfoResult, ServiceConstant.GOV_ORG_SERVER, null, null); + List currentGridInfos = getResultDataOrThrowsException(currentGridInfoResult, ServiceConstant.GOV_ORG_SERVER, null, null, null); OrgInfoResultDTO currentGridInfo = currentGridInfos.get(0); // 因为上游接口的值对应问题,这里只好做一个适配,拼接起来,希望上游代码不要再改了... @@ -128,7 +128,7 @@ public class ResiEventServiceImpl implements ResiEventService, ResultDataResolve // 二.父级组织信息 Result> parentOrgInfoResult = govOrgOpenFeignClient.selectOrgInfo(new OrgInfoFormDTO(OrgInfoConstant.AGENCY, parentOrgIds)); - List parentOrgInfos = getResultDataOrThrowsException(parentOrgInfoResult, ServiceConstant.GOV_ORG_SERVER, null, null); + List parentOrgInfos = getResultDataOrThrowsException(parentOrgInfoResult, ServiceConstant.GOV_ORG_SERVER, null, null, null); parentOrgInfos.forEach(porg -> { String levelName = OrgLevelEnums.getLevelName(porg.getLevel()); if (StringUtils.isBlank(levelName)) { diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/constant/IcResiUserConstant.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/constant/IcResiUserConstant.java new file mode 100644 index 0000000000..6b32f663fc --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/constant/IcResiUserConstant.java @@ -0,0 +1,11 @@ +package com.epmet.constant; + +/** + * @author zhaoqifeng + * @dscription + * @date 2021/6/8 15:28 + */ +public interface IcResiUserConstant { + + String IC_RESI_USER = "ic_resi_user"; +} 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..1f53e4206a --- /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 String 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..c5df27c097 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcPartyMemberDTO.java @@ -0,0 +1,147 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.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 IcPartyMemberDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户Id customer.id + */ + private String customerId; + + /** + * 主表Id + */ + private String icResiUser; + + /** + * 入党时间 + */ + private String rdsj; + + /** + * 转正时间 + */ + private String 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..62fa0e45cf --- /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 String dbsj; + + /** + * 所患慢性病 + */ + private String shmxb; + + /** + * 患慢性病时间 + */ + private String mxbsj; + + /** + * 是否参保 + */ + private String isCb; + + /** + * 自付金额 + */ + private String zfje; + + /** + * 救助金额 + */ + private String jzje; + + /** + * 救助时间[yyyy-MM-dd] + */ + private String jzsj; + + /** + * 享受救助明细序号 + */ + private String jzmxxh; + + /** + * 健康信息备注 + */ + private String healthRemakes; + + /** + * 工作单位 + */ + private String gzdw; + + /** + * 职业 + */ + private String zy; + + /** + * 离退休时间 + */ + private String ltxsj; + + /** + * 工作信息备注 + */ + private String workRemake; + + /** + * 退休金额 + */ + private String txje; + + /** + * 月收入 + */ + private String ysr; + + /** + * 是否经济低保 + */ + private String 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/IcStatsResiWarnDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcStatsResiWarnDTO.java new file mode 100644 index 0000000000..006cf7fb67 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcStatsResiWarnDTO.java @@ -0,0 +1,111 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 预警统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +@Data +public class IcStatsResiWarnDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * id + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 预警配置ID + */ + private String configId; + + /** + * 网格id + */ + private String gridId; + + /** + * 组织id + */ + private String agencyId; + + /** + * 组织的所有上级组织id + */ + private String agencyPids; + + /** + * 小区id + */ + private String neighborHoodId; + + /** + * 楼宇id + */ + private String buildingId; + + /** + * 该分类的居民数量 + */ + private Integer count; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private String revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private String createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-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..85a3e63feb --- /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 String 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..351b60a933 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcVeteransDTO.java @@ -0,0 +1,147 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.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 IcVeteransDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户Id customer.id + */ + private String customerId; + + /** + * 主表Id + */ + private String icResiUser; + + /** + * 入伍时间 + */ + private String rwsj; + + /** + * 退伍时间 + */ + private String twsj; + + /** + * 服役单位 + */ + private String fydw; + + /** + * 接收单位 + */ + private String jsdw; + + /** + * 待安置补助金 + */ + private String dazbzj; + + /** + * 培训状况 + */ + private String pxzk; + + /** + * 参战时间【年月日区间值yyyy-MM-dd~yyyy-MM-dd】 + */ + private String 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..bf75ed325f --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiUserPageFormDTO.java @@ -0,0 +1,41 @@ +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; + + @NotBlank(message = "当前用户id不能为空", groups = AddUserInternalGroup.class) + private String staffId; +} + 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/form/StatsResiListFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StatsResiListFormDTO.java new file mode 100644 index 0000000000..1bb20c647a --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StatsResiListFormDTO.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.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + + +/** + * 预警统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +@Data +public class StatsResiListFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 组织id + */ + @NotBlank(message = "id不能为空") + private String id; + + @NotBlank(message = "level不能为空") + private String level; + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StatsResiWarnCountFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StatsResiWarnCountFormDTO.java new file mode 100644 index 0000000000..7fba162e27 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StatsResiWarnCountFormDTO.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.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.List; + + +/** + * 预警统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +@Data +public class StatsResiWarnCountFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 组织id + */ + @NotBlank(message = "用户id不能为空") + private String userId; + + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StatsResiWarnFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StatsResiWarnFormDTO.java new file mode 100644 index 0000000000..1d41671fff --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StatsResiWarnFormDTO.java @@ -0,0 +1,65 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.Date; +import java.util.List; + + +/** + * 预警统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +@Data +public class StatsResiWarnFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + public interface ListSelectedBuilding {}; + public interface ListSelectedUser {}; + + + /** + * 当前页 + */ + private Integer pageNo = 1; + + /** + * 当前页数量 + */ + private Integer pageSize = 10; + /** + * 组织id + */ + @NotBlank(message = "组织id不能为空",groups = {ListSelectedBuilding.class}) + private String agencyId; + + @NotBlank(message = "配置id不能为空",groups = {ListSelectedUser.class}) + private String configId; + @NotNull(message = "楼宇不能为空",groups = {ListSelectedUser.class}) + private List buildingIdList; + + +} \ No newline at end of file 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/IcStatsResiResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcStatsResiResultDTO.java new file mode 100644 index 0000000000..4f670770f3 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcStatsResiResultDTO.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.dto.result; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 预警统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +@Data +public class IcStatsResiResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + + private String id; + private String label; + private Integer count; + private String managementIcon; + private String dataIcon; + private String houseShowIcon; + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcStatsResiWarnBuildingResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcStatsResiWarnBuildingResultDTO.java new file mode 100644 index 0000000000..3d4253f721 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcStatsResiWarnBuildingResultDTO.java @@ -0,0 +1,63 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + + +/** + * 预警统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +@Data +public class IcStatsResiWarnBuildingResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + + /** + * 预警配置ID + */ + private String configId; + + private String label; + + private Integer sort; + private Integer level1; + private Integer levelCount1; + private Integer level2; + private Integer levelCount2; + private Integer level3; + private Integer levelCount3; + + private String managementIcon; + private String dataIcon; + private String houseShowIcon; + private Integer count; + + private List buildingIdList1; + private List buildingIdList2; + private List buildingIdList3; + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcStatsResiWarnUserResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcStatsResiWarnUserResultDTO.java new file mode 100644 index 0000000000..4cd3332dca --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcStatsResiWarnUserResultDTO.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.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + + +/** + * 预警统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +@Data +public class IcStatsResiWarnUserResultDTO implements Serializable { + private static final long serialVersionUID = 1L; + + + /** + * 预警配置ID + */ + private String configId; + private String buildingId; + private String gridName; + private String neighborhoodName; + private String buildingName; + private String residentNames; + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/OwnerRelationResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/OwnerRelationResultDTO.java new file mode 100644 index 0000000000..9a3e0c23d7 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/OwnerRelationResultDTO.java @@ -0,0 +1,29 @@ +package com.epmet.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.List; + +/** + * @Author zhaoqifeng + * @DateTime 2020/11/18 下午1:47 + */ +@NoArgsConstructor +@Data +public class OwnerRelationResultDTO implements Serializable { + + private static final long serialVersionUID = 2876258704168954941L; + private String ownerName; + private List userList; + + @NoArgsConstructor + @Data + public static class UserListBean { + private String userId; + private String userName; + private String isSelf; + private String relation; + } +} 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..6a89bb2037 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PersonDataResultDTO.java @@ -0,0 +1,87 @@ +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 List personCategory; + + /** + * 网格名 + */ + private String gridName; + + /** + * 姓名 + */ + private String name; + + /** + * 经济状况:包括 月收入:monthlyIncome 和 退休金额:retirementAmount + */ + private FinancialSituationDTO financialSituation; + + /** + * 房屋信息 + */ + private List houseInfo; + + /** + * 志愿者类别 + */ + private List volunteerCategory; + + @JsonIgnore + private List volunteerCategoryEn; + + public PersonDataResultDTO() { + this.workUnit = ""; + this.personCategory = new ArrayList<>(); + this.gridName = ""; + this.name = ""; + this.financialSituation = new FinancialSituationDTO(); + this.houseInfo = new ArrayList<>(); + this.volunteerCategory = new ArrayList<>(); + } + + /** + * 身份证 + */ + @JsonIgnore + private String idCard; + + /** + * 是否是志愿者 1是,0否 + */ + @JsonIgnore + private String isVolunteer; + + @JsonIgnore + private String customerId; + + @JsonIgnore + private String gridId; +} 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 cbec879b5b..5637b6b765 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,10 @@ public interface EpmetUserOpenFeignClient { */ @GetMapping(value = "/epmetuser/user/queryUserClient/{userId}") Result queryUserClient(@PathVariable("userId") String userId); + + @PostMapping("/epmetuser/icresidemanddict/demandoption/demandoption") + Result> getDemandOptions(); + + @PostMapping("/epmetuser/icresiuser/categorycount") + Result>> getHomeUserCategoryCount(@RequestBody IcResiUserDTO formDTO); } 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 183196dad8..e339f2e83b 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,14 @@ 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); + } + + @Override + public Result>> getHomeUserCategoryCount(IcResiUserDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getHomeUserCategoryCount", formDTO); + } } diff --git a/epmet-user/epmet-user-server/pom.xml b/epmet-user/epmet-user-server/pom.xml index 24664b0e9c..3bc3afa499 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 + 3.0.3 + + + poi + org.apache.poi + + + poi-ooxml + org.apache.poi + + + poi-ooxml-schemas + org.apache.poi + + + com.epmet epmet-user-client @@ -118,6 +142,18 @@ epmet-commons-rocketmq 2.0.0 + + com.epmet + oper-customize-client + 2.0.0 + compile + + + com.epmet + epmet-oss-client + 2.0.0 + compile + @@ -134,6 +170,16 @@ true + + org.apache.maven.plugins + maven-resources-plugin + + + xls + xlsx + + + ${project.basedir}/src/main/java @@ -182,6 +228,9 @@ SECfcc020bdc83bb17a2c00f39977b1fbc409ef4188c7beaea11c5caa90eeaf87fd + + true + 192.168.1.140:9876;192.168.1.141:9876 @@ -224,6 +273,9 @@ SECfcc020bdc83bb17a2c00f39977b1fbc409ef4188c7beaea11c5caa90eeaf87fd https://epmet-dev.elinkservice.cn/api/epmetscan/api + + false + 192.168.1.140:9876;192.168.1.141:9876 @@ -265,6 +317,9 @@ SECfcc020bdc83bb17a2c00f39977b1fbc409ef4188c7beaea11c5caa90eeaf87fd + + true + 192.168.10.161:9876 @@ -305,6 +360,9 @@ SEC95f4f40b533ad379ea6a6d1af6dd37029383cfe1b7cd96dfac2678be2c1c3ed1 + + true + 192.168.11.187:9876;192.168.11.184:9876 diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/IcPlatformConstant.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/IcPlatformConstant.java new file mode 100644 index 0000000000..8bfac04bcc --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/IcPlatformConstant.java @@ -0,0 +1,16 @@ +package com.epmet.constant; + +/** + * @Author zxc + * @DateTime 2021/11/8 11:05 上午 + * @DESC + */ +public interface IcPlatformConstant { + + /** + * 人员类别显示 + */ + String PERSON_CATEGORY_SHOW = "show"; + String PERSON_CATEGORY_HIDDEN = "hidden"; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/LevelConstant.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/LevelConstant.java new file mode 100644 index 0000000000..5cd985c11a --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/LevelConstant.java @@ -0,0 +1,8 @@ +package com.epmet.constant; + +public interface LevelConstant { + String AGENCY = "agency"; + String GRID = "grid"; + String NEIGHBORHOOD = "neighborHood"; + String BUILDING = "building"; +} 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..b9b1c5c87d 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,14 @@ public interface UserConstant { * 先生/女士 */ String MAN_WOMAN = "先生/女士"; + + String GRID_ID="GRID_ID"; + String GRID_NAME="GRID_NAME"; + 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 0bcae218af..cfbe7e4575 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 @@ -422,7 +422,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/IcResiUserController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java new file mode 100644 index 0000000000..f703d7304b --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java @@ -0,0 +1,696 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.TemplateExportParams; +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.ExcelWriter; +import com.alibaba.excel.enums.WriteDirectionEnum; +import com.alibaba.excel.write.metadata.WriteSheet; +import com.alibaba.excel.write.metadata.fill.FillConfig; +import com.alibaba.excel.write.metadata.fill.FillWrapper; +import com.alibaba.fastjson.JSON; +import com.epmet.commons.rocketmq.messages.IcResiUserAddMQMsg; +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.StrConstant; +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; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.RedisKeys; +import com.epmet.commons.tools.redis.RedisUtils; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.HttpClientManager; +import com.epmet.commons.tools.utils.IpUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.constant.IcResiUserConstant; +import com.epmet.constant.SystemMessageType; +import com.epmet.dto.IcResiUserDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.result.*; +import com.epmet.enums.IcResiUserTableEnum; +import com.epmet.excel.support.ExportResiUserItemDTO; +import com.epmet.feign.EpmetMessageOpenFeignClient; +import com.epmet.feign.OperCustomizeOpenFeignClient; +import com.epmet.feign.OssFeignClient; +import com.epmet.service.IcResiUserImportService; +import com.epmet.service.IcResiUserService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.io.FileUtils; +import org.apache.commons.io.FilenameUtils; +import org.apache.commons.io.IOUtils; +import org.apache.commons.lang3.StringUtils; +import org.apache.poi.ss.usermodel.Workbook; +import org.jetbrains.annotations.NotNull; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletResponse; +import java.io.*; +import java.net.URLEncoder; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.*; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.stream.Collectors; + + +/** + * 用户基础信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +@Slf4j +@RestController +@RequestMapping("icresiuser") +public class IcResiUserController { + + //todo 枚举吧 + private static final String IC_RESI_FORM_CODE = "resi_base_info"; + + /** + * 居民上传临时目录 + */ + private Path IC_RESI_UPLOAD_DIR; + /** + * 居民下载模版临时目录 + */ + private String OSS_TEMP_RESI_TEMP_DIR = "file-template/resi-template/"; + /** + * 本地模版缓存目录 + */ + private Path IC_RESI_DOWNLOAD_DIR; + + @Autowired + private OssFeignClient ossFeignClient; + + @Autowired + private OperCustomizeOpenFeignClient operCustomizeOpenFeignClient; + @Autowired + private IcResiUserService icResiUserService; + @Autowired + private IcResiUserImportService icResiUserImportService; + @Autowired + private RedisUtils redisUtils; + @Autowired + private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; + + { + // 初始化上传目录 + String home = System.getProperty("user.home"); + Path importDir = Paths.get(home, "epmet_files", "ic_user_import"); + if (Files.notExists(importDir)) { + try { + Files.createDirectories(importDir); + } catch (IOException e) { + log.error("创建数字赋能平台上传目录失败"); + } + } + IC_RESI_UPLOAD_DIR = importDir; + + Path exportDir = Paths.get(home, "epmet_files", "ic_user_export"); + if (Files.notExists(exportDir)) { + try { + Files.createDirectories(exportDir); + } catch (IOException e) { + log.error("创建数字赋能平台下载目录失败"); + } + } + IC_RESI_DOWNLOAD_DIR = exportDir; + } + + @NoRepeatSubmit + @PostMapping("delete") + public Result delete(@LoginUser TokenDto tokenDto, @RequestBody DelIcResiUserFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + ValidatorUtils.validateEntity(formDTO, DelIcResiUserFormDTO.IdGroup.class); + icResiUserService.delete(formDTO); + //推送MQ事件 + IcResiUserAddMQMsg mqMsg = new IcResiUserAddMQMsg(); + mqMsg.setCustomerId(tokenDto.getCustomerId()); + mqMsg.setIcResiUser(formDTO.getIcResiUserId()); + SystemMsgFormDTO form = new SystemMsgFormDTO(); + form.setMessageType(SystemMessageType.IC_RESI_USER_DEL); + form.setContent(mqMsg); + epmetMessageOpenFeignClient.sendSystemMsgByMQ(form); + return new Result(); + } + + + /** + * @Author sun + * @Description 党建互联平台--保存居民信息 + **/ + @NoRepeatSubmit + @PostMapping("add") + public Result add(@LoginUser TokenDto tokenDto, @RequestBody List formDTO) { + String resiUserId = icResiUserService.add(tokenDto, formDTO); + //推送MQ事件 + IcResiUserAddMQMsg mqMsg = new IcResiUserAddMQMsg(); + mqMsg.setCustomerId(tokenDto.getCustomerId()); + mqMsg.setIcResiUser(resiUserId); + SystemMsgFormDTO form = new SystemMsgFormDTO(); + form.setMessageType(SystemMessageType.IC_RESI_USER_ADD); + form.setContent(mqMsg); + epmetMessageOpenFeignClient.sendSystemMsgByMQ(form); + return new Result(); + } + + /** + * @Author sun + * @Description 党建互联平台--修改居民信息 + **/ + @NoRepeatSubmit + @PostMapping("edit") + public Result edit(@LoginUser TokenDto tokenDto, @RequestBody List formDTO) { + String resiUserId = icResiUserService.edit(tokenDto, formDTO); + //推送MQ事件 + IcResiUserAddMQMsg mqMsg = new IcResiUserAddMQMsg(); + mqMsg.setCustomerId(tokenDto.getCustomerId()); + mqMsg.setIcResiUser(resiUserId); + SystemMsgFormDTO form = new SystemMsgFormDTO(); + form.setMessageType(SystemMessageType.IC_RESI_USER_EDIT); + form.setContent(mqMsg); + epmetMessageOpenFeignClient.sendSystemMsgByMQ(form); + return new Result(); + } + + /** + * @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()); + pageFormDTO.setStaffId(tokenDto.getUserId()); + 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)); + } + + /** + * desc :备用 easypoi + * + * @param customerId + * @param pageFormDTO + * @param response + * @throws Exception + */ + @RequestMapping(value = "/exportExcel2") + public void exportExcel(@RequestHeader String customerId, @LoginUser TokenDto tokenDto, @RequestBody IcResiUserPageFormDTO pageFormDTO, HttpServletResponse response) throws Exception { + //tokenDto.setUserId("9e37adcce6472152e6508a19d3683e02"); + CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(customerId, tokenDto.getUserId()); + String staffOrgPath = null; + if (StringUtils.isNotBlank(staffInfoCacheResult.getAgencyPIds()) && !NumConstant.ZERO_STR.equals(staffInfoCacheResult.getAgencyPIds())) { + staffOrgPath = staffInfoCacheResult.getAgencyPIds().concat(":").concat(staffInfoCacheResult.getAgencyId()); + } else { + staffOrgPath = staffInfoCacheResult.getAgencyId(); + } + pageFormDTO.setCustomerId(customerId); + pageFormDTO.setPageFlag(false); + CustomerFormResultDTO resiFormItems = getResiFormAddItems(pageFormDTO.getCustomerId()); + + Map> otherSheetItems = buildItemMap(resiFormItems); + + Map> resiMainList = null;//icResiUserService.getDataForExport(otherSheetItems.get(IcResiUserConstant.IC_RESI_USER), IcResiUserConstant.IC_RESI_USER, pageFormDTO, staffInfoCacheResult.getAgencyId(), staffOrgPath); + //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()); + System.out.println("===resiMainList===" + " " + JSON.toJSONString(resiMainList.values())); + sheetMap.put(0, mapData); + AtomicInteger n = new AtomicInteger(); + for (FormItemResult item : resiFormItems.getItemList()) { + //如果 childGroup是空 或者是主表 则跳过 继续下次循环 + if (item.getChildGroup() == null || IcResiUserConstant.IC_RESI_USER.equals(item.getChildGroup().getTableName())) { + continue; + } + String tableName = item.getChildGroup().getTableName(); + + Map itemMap1 = otherSheetItems.get(tableName); + Map> resiChildMap = null;//icResiUserService.getDataForExport(itemMap1, tableName, pageFormDTO, staffInfoCacheResult.getAgencyId(), staffOrgPath); + //resiChildMap.forEach((key, value) -> value.putAll(resiMainList.get(key))); + + Map mapData2 = new HashMap<>(); + mapData2.put("list", resiChildMap.values()); + System.out.println("===resiChildMap===" + tableName + " " + JSON.toJSONString(resiChildMap.values())); + sheetMap.put(n.incrementAndGet(), mapData2); + + + } + + Workbook workbook = ExcelExportUtil.exportExcel(sheetMap, params); + workbook.setActiveSheet(0); + workbook.write(getOutputStream("居民基本信息.xls", response)); + } + + @RequestMapping(value = "/exportExcel3") + public void exportExcelByEasyExcel3(@RequestHeader String customerId,@LoginUser TokenDto tokenDto, @RequestBody IcResiUserPageFormDTO pageFormDTO, HttpServletResponse response) throws Exception { + //tokenDto.setUserId("9e37adcce6472152e6508a19d3683e02"); + CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(customerId, tokenDto.getUserId()); + String staffOrgPath = null; + if (StringUtils.isNotBlank(staffInfoCacheResult.getAgencyPIds()) && !NumConstant.ZERO_STR.equals(staffInfoCacheResult.getAgencyPIds())) { + staffOrgPath = staffInfoCacheResult.getAgencyPIds().concat(":").concat(staffInfoCacheResult.getAgencyId()); + } else { + staffOrgPath = staffInfoCacheResult.getAgencyId(); + } + pageFormDTO.setCustomerId(customerId); + pageFormDTO.setPageFlag(false); + CustomerFormResultDTO resiFormItems = getResiFormAddItems(pageFormDTO.getCustomerId()); + Map> otherSheetItems = buildItemMap(resiFormItems); + + /*List resiFormAllItems = getResiFormAllItems(pageFormDTO.getCustomerId()); + resiFormAllItems.stream().collect(Collectors.groupingBy(e ->e.get));*/ + + //获取模版文件 + File file = getExportTemplateFile(customerId); + ExcelWriter excelWriter = EasyExcel.write(getOutputStream("居民基本信息.xlsx", response)).withTemplate(file).build(); + + FillConfig fillConfig = FillConfig.builder().direction(WriteDirectionEnum.VERTICAL).build(); + IcResiUserTableEnum tableEnums = IcResiUserTableEnum.getObjectByTableName(IcResiUserConstant.IC_RESI_USER); + WriteSheet fistSheet = EasyExcel.writerSheet(tableEnums.getSheetNo()).build(); + + pageFormDTO.setPageSize(NumConstant.FIVE_HUNDRED); + pageFormDTO.setPageNo(NumConstant.ONE); + //子表是否停止查询 + Set stopSearchSet = new HashSet<>(); + Map childTableWriteSheetMap = new HashMap<>(); + Map> resiMainTableMap = null; + do { + resiMainTableMap = null;//icResiUserService.getDataForExport(otherSheetItems.get(IcResiUserConstant.IC_RESI_USER), IcResiUserConstant.IC_RESI_USER, pageFormDTO, staffInfoCacheResult.getAgencyId(), staffOrgPath); + //如果 返回的条数小于每页显示的数 则退出查询 + if (resiMainTableMap.keySet().size() < pageFormDTO.getPageSize()) { + stopSearchSet.add(IcResiUserConstant.IC_RESI_USER); + } + //写入数据 + excelWriter.fill(new FillWrapper("t1", resiMainTableMap.values()), fillConfig, fistSheet); + pageFormDTO.setPageNo(pageFormDTO.getPageNo() + 1); + //重置数据 + resiMainTableMap.clear(); + } while (!stopSearchSet.contains(IcResiUserConstant.IC_RESI_USER)); + + //子表数据写入 + AtomicInteger n = new AtomicInteger(); + for (FormItemResult item : resiFormItems.getItemList()) { + + //如果 childGroup是空 或者是主表 则跳过 继续下次循环 + if (item.getChildGroup() == null || IcResiUserConstant.IC_RESI_USER.equals(item.getChildGroup().getTableName())) { + continue; + } + String tableName = item.getChildGroup().getTableName(); + pageFormDTO.setPageNo(NumConstant.ONE); + //循环一次 写入每个sheet + do { + //如果包含则说明子表的数据 已经查询完毕 无需再继续查询了 + boolean contains = stopSearchSet.contains(tableName); + if (contains) { + continue; + } + Map itemMap1 = otherSheetItems.get(tableName); + Map> resiChildMap = null;//icResiUserService.getDataForExport(itemMap1, tableName, pageFormDTO, staffInfoCacheResult.getAgencyId(), staffOrgPath); + //如果 返回的条数小于每页显示的数 则退出查询 + if (resiChildMap.keySet().size() < pageFormDTO.getPageSize()) { + stopSearchSet.add(tableName); + } + tableEnums = IcResiUserTableEnum.getObjectByTableName(tableName); + if (tableEnums == null) { + continue; + } + //构建新的sheet + WriteSheet childWriteSheet = childTableWriteSheetMap.get(tableName); + if (childWriteSheet == null) { + childWriteSheet = EasyExcel.writerSheet(tableEnums.getSheetNo()).build(); + } + childTableWriteSheetMap.put(tableName, childWriteSheet); + //写入数据 + excelWriter.fill(new FillWrapper("t" + (tableEnums.getSheetNo() + NumConstant.ONE), resiChildMap.values()), childWriteSheet); + pageFormDTO.setPageNo(pageFormDTO.getPageNo() + NumConstant.ONE); + //重置数据 + resiChildMap.clear(); + } while (!stopSearchSet.contains(tableName)); + } + + excelWriter.finish(); + } + + /** + * desc: 导出居民信息 + * + * @param customerId + * @param tokenDto + * @param pageFormDTO + * @param response + * @return void + * @author LiuJanJun + * @date 2021/11/19 4:24 下午 + * @remark:分页批量导出 + */ + @NoRepeatSubmit + @RequestMapping(value = "/exportExcel") + public void exportExcelByEasyExcel(@RequestHeader String customerId,@LoginUser TokenDto tokenDto, @RequestBody IcResiUserPageFormDTO pageFormDTO, HttpServletResponse response) throws Exception { + //tokenDto.setUserId("9e37adcce6472152e6508a19d3683e02"); + CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(customerId, tokenDto.getUserId()); + String staffOrgPath = null; + if (StringUtils.isNotBlank(staffInfoCacheResult.getAgencyPIds()) && !NumConstant.ZERO_STR.equals(staffInfoCacheResult.getAgencyPIds())) { + staffOrgPath = staffInfoCacheResult.getAgencyPIds().concat(StrConstant.COLON).concat(staffInfoCacheResult.getAgencyId()); + } else { + staffOrgPath = staffInfoCacheResult.getAgencyId(); + } + pageFormDTO.setCustomerId(customerId); + pageFormDTO.setPageFlag(false); + + //获取模版文件 + File file = getExportTemplateFile(customerId); + ExcelWriter excelWriter = null; + try { + excelWriter = EasyExcel.write(getOutputStream("居民基本信息.xlsx", response)).withTemplate(file).build(); + + //子表是否停止查询 + Set stopSearchSet = new HashSet<>(); + + //获取表单项 + List resiFormAllItems = icResiUserService.listFormItems(customerId, IC_RESI_FORM_CODE); + Map allItemMap = resiFormAllItems.stream().collect(Collectors.toMap(FormItemResult::getItemId, o -> o)); + Map map = new HashMap<>(); + allItemMap.values().forEach(item->{ + String tableName = item.getTableName(); + ExportResiUserItemDTO exportItem = map.getOrDefault(tableName, new ExportResiUserItemDTO()); + map.putIfAbsent(tableName,exportItem); + String columnName = item.getColumnName().concat(item.getColumnNum() == NumConstant.ZERO ? StrConstant.EPMETY_STR : item.getColumnNum().toString()); + exportItem.getItemMap().put(columnName,item); + if (item.getOptionSourceType().equals("remote")&&item.getOptionSourceValue().contains(StrConstant.QUESTION_MARK)){ + //多个参数 + String[] paramArr = item.getOptionSourceValue().split(StrConstant.QUESTION_MARK_TRANSFER)[NumConstant.ONE].split(StrConstant.AND_MARK); + Arrays.stream(paramArr).forEach(o->{ + FormItemResult value = allItemMap.get(o); + if (value == null){ + return; + } + Set conditionSet = exportItem.getRemoteItemConditionMap().getOrDefault(item.getItemId(),new HashSet<>()); + conditionSet.add(value); + exportItem.getRemoteItemConditionMap().putIfAbsent(item.getItemId(),conditionSet); + }); + } + }); + + //每个表对应的 item ;key:表名,value:<字段名:item对象> + Map childTableWriteSheetMap = new HashMap<>(); + //表数据写入 + //通过枚举获取相关表并按照sheetNo排序 + List resiTableList = Arrays.stream(IcResiUserTableEnum.values()) + .sorted(Comparator.comparing(IcResiUserTableEnum::getSheetNo)) + .collect(Collectors.toList()); + List> resiResultList = null; + + pageFormDTO.setPageSize(NumConstant.FIVE_HUNDRED); + for (IcResiUserTableEnum tableEnum : resiTableList) { + String tableName = tableEnum.getTableName(); + pageFormDTO.setPageNo(NumConstant.ONE); + //循环一次 写入一个sheet + do { + resiResultList = icResiUserService.getDataForExport(map.get(tableName), tableName, pageFormDTO, staffInfoCacheResult.getAgencyId(), staffOrgPath); + //如果 返回的条数小于每页显示的数 则退出查询 + if (resiResultList.size() < pageFormDTO.getPageSize()) { + stopSearchSet.add(tableName); + } + //如果没有 构建新的writeSheet + WriteSheet writeSheet = childTableWriteSheetMap.getOrDefault(tableName,EasyExcel.writerSheet(tableEnum.getSheetNo()).build()); + childTableWriteSheetMap.putIfAbsent(tableName, writeSheet); + //写入数据 + excelWriter.fill(new FillWrapper("t" + (tableEnum.getSheetNo() + NumConstant.ONE), resiResultList), writeSheet); + pageFormDTO.setPageNo(pageFormDTO.getPageNo() + NumConstant.ONE); + //重置数据 + resiResultList.clear(); + + //如果包含则说明子表的数据 已经查询完毕 无需再继续查询了 + } while (!stopSearchSet.contains(tableName)); + } + + } finally { + if (excelWriter != null){ + excelWriter.finish(); + } + } + } + + /** + * desc:根据客户id 下载模版文件 如果不存在则返回null + * + * @param customerId + * @return + */ + private File getExportTemplateFile(String customerId) throws Exception{ + String fileType = ".xlsx"; + String fileName = customerId + fileType; + File file = new File(IC_RESI_DOWNLOAD_DIR.resolve(fileName).toString()); + String serverIp = IpUtils.getServerIp(); + Object isChanged = redisUtils.hGet(RedisKeys.getResiTempChangedKey(customerId), serverIp); + //如果 redis 不存在这个机器的key 或者值为1 则重新下载 + if (!file.exists() || isChanged == null || NumConstant.ONE_STR.equals(isChanged.toString())) { + if (file.exists()) { + file.delete(); + } + String ossFilePath = OSS_TEMP_RESI_TEMP_DIR + fileName; + Result fileUrlResult = ossFeignClient.getOssFileUrl(ossFilePath, null); + Result result = HttpClientManager.getInstance().getDownloadFilebytes(fileUrlResult.getData(), null); + //获取模版失败 则把默认文件写入 + if (result == null || !result.success()) { + log.warn("获取居民导出模版失败,path:{},走默认模版", ossFilePath); + String defaultTemplatePath = "excel/ic_resi_info_cid_for_easy_excel.xlsx"; + InputStream resourceAsStream = this.getClass().getClassLoader().getResourceAsStream(defaultTemplatePath); + FileUtils.copyInputStreamToFile(resourceAsStream,file); + log.warn("getExportTemplateFile copy default file to template,customerId:{}",customerId); + } else { + log.warn("getExportTemplateFile reload file form oss default file to template,customerId:{}",customerId); + FileUtils.writeByteArrayToFile(file,result.getData()); + } + redisUtils.hSet(RedisKeys.getResiTempChangedKey(customerId), serverIp, NumConstant.ZERO_STR); + return file; + } + return file; + } + + @NotNull + private Map> buildItemMap(CustomerFormResultDTO resiFormItems) { + Map> otherSheetItems = new HashMap<>(); + + //主表的 + for (FormItemResult formItemResult : resiFormItems.getItemList()) { + if (StringUtils.isBlank(formItemResult.getColumnName())) { + continue; + } + + Map itemMap = otherSheetItems.getOrDefault(formItemResult.getTableName(), new HashMap<>()); + otherSheetItems.putIfAbsent(formItemResult.getTableName(), itemMap); + if (formItemResult.getItemType().equals("checkbox") || formItemResult.getItemType().equals("select") || formItemResult.getItemType().equals("radio")) { + itemMap.put(formItemResult.getColumnName().concat(formItemResult.getColumnNum() == 0 ? "" : formItemResult.getColumnNum().toString()), formItemResult); + } + if (formItemResult.getChildGroup() != null) { + itemMap = otherSheetItems.getOrDefault(formItemResult.getChildGroup().getTableName(), new HashMap<>()); + otherSheetItems.putIfAbsent(formItemResult.getChildGroup().getTableName(), itemMap); + for (FormItemResult2 item2 : formItemResult.getChildGroup().getItemList()) { + if (StringUtils.isBlank(item2.getColumnName())) { + continue; + } + + if ("checkbox".equals(item2.getItemType()) || "select".equals(item2.getItemType()) || "radio".equals(item2.getItemType())) { + itemMap.put(item2.getColumnName().concat(item2.getColumnNum() == 0 ? "" : item2.getColumnNum().toString()), ConvertUtils.sourceToTarget(item2, FormItemResult.class)); + } + } + + } + } + //其他sheet + + for (FormGroupDTO groupItem : resiFormItems.getGroupList()) { + if (groupItem.getItemList() == null) { + continue; + } + Map itemMap = otherSheetItems.getOrDefault(groupItem.getTableName(), new HashMap<>()); + otherSheetItems.putIfAbsent(groupItem.getTableName(), itemMap); + for (FormItemResult2 formItemResult2 : groupItem.getItemList()) { + if (StringUtils.isBlank(formItemResult2.getColumnName())) { + continue; + } + if ("checkbox".equals(formItemResult2.getItemType()) || "select".equals(formItemResult2.getItemType()) || "radio".equals(formItemResult2.getItemType())) { + itemMap.put(formItemResult2.getColumnName().concat(formItemResult2.getColumnNum() == 0 ? "" : formItemResult2.getColumnNum().toString()), ConvertUtils.sourceToTarget(formItemResult2, FormItemResult.class)); + } + } + } + return otherSheetItems; + } + + private static OutputStream getOutputStream(String fileName, HttpServletResponse response) throws Exception { + fileName = URLEncoder.encode(fileName, "UTF-8"); + response.setContentType("application/vnd.ms-excel"); + response.setCharacterEncoding("utf8"); + response.setHeader("Content-Disposition", "attachment;filename=" + fileName); + response.addHeader("Access-Control-Expose-Headers", "Content-disposition"); + + return response.getOutputStream(); + } + + /** + * excel导入居民基本信息 + * + * @return + */ + @NoRepeatSubmit + @PostMapping("importExcel") + public void importExcelByEasyExcel(@RequestHeader("customerId") String customerId,@RequestPart("file") MultipartFile file, HttpServletResponse response) { + if (file.isEmpty()) { + throw new RenException("请上传文件"); + } + + // 校验文件类型 + String extension = FilenameUtils.getExtension(file.getOriginalFilename()); + if (!"xls".equals(extension) && !"xlsx".equals(extension)) { + throw new RenException("文件类型不匹配"); + } + + Path savePath = null; + try { + String fileName = UUID.randomUUID().toString().concat(".").concat(extension); + savePath = IC_RESI_UPLOAD_DIR.resolve(fileName); + + IOUtils.copy(file.getInputStream(), new FileOutputStream(savePath.toString())); + List formItemList = icResiUserService.listFormItems(customerId,IC_RESI_FORM_CODE); + icResiUserImportService.importIcResiInfoFromExcel(formItemList, savePath.toString(), response); + } catch (IOException e) { + String errorMsg = ExceptionUtils.getErrorStackTrace(e); + log.error("【导入居民信息失败】导入失败:{}", errorMsg); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } finally { + try { + Files.delete(savePath); + } catch (IOException e) { + log.error("【导入居民信息失败】清理上传的文件失败:{}", ExceptionUtils.getErrorStackTrace(e)); + } + } + } + + @PostMapping("test") + public Result>> test(@LoginUser TokenDto tokenDto, @RequestBody DynamicQueryFormDTO formDTO) { + formDTO.setCustomerId("45687aa479955f9d06204d415238f7cc"); + //formDTO.setCustomerId(tokenDto.getCustomerId()); + return new Result>>().ok(icResiUserService.dynamicQuery(formDTO.getCustomerId(), + formDTO.getFormCode(), + formDTO.getResultTableName(), + formDTO.getConditions(), + tokenDto.getUserId(), null)); + } + + /** + * @param formDTO + * @Description 查询个人数据 + * @author zxc + * @date 2021/11/3 9:21 上午 + */ + @PostMapping("persondata") + public Result personData(@RequestBody PersonDataFormDTO formDTO) { + return new Result().ok(icResiUserService.personData(formDTO)); + } + + /** + * @param formDTO + * @param tokenDto + * @Description 根据名字搜索 + * @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)); + } + + @NotNull + private CustomerFormResultDTO getResiFormAddItems(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()); + } + return resultForm.getData(); + } + + /** + * @Description 个人信息-家庭关系 + * @Param formDTO + * @Return {@link Result< OwnerRelationResultDTO>} + * @Author zhaoqifeng + * @Date 2021/11/5 11:13 + */ + @PostMapping("ownerrelation") + public Result getOwnerRelation(@RequestBody PersonDataFormDTO formDTO) { + return new Result().ok(icResiUserService.getOwnerRelation(formDTO.getUserId())); + } + + /** + * @Description 获取一栋楼每个房间人员分类的数量 + * @Param formDTO + * @Return {@link Result< Map< String, Map< String, String>>>} + * @Author zhaoqifeng + * @Date 2021/11/5 15:10 + */ + @PostMapping("categorycount") + public Result>> getHomeUserCategoryCount(@RequestBody IcResiUserDTO formDTO) { + return new Result>>().ok(icResiUserService.getHomeUserCategoryCount(formDTO.getBuildId())); + } + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcStatsResiWarnController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcStatsResiWarnController.java new file mode 100644 index 0000000000..f0b9860e45 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcStatsResiWarnController.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.IcStatsResiWarnDTO; +import com.epmet.excel.IcStatsResiWarnExcel; +import com.epmet.service.IcStatsResiWarnService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 预警统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +@RestController +@RequestMapping("icstatsresiwarn") +public class IcStatsResiWarnController { + + @Autowired + private IcStatsResiWarnService icStatsResiWarnService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = icStatsResiWarnService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + IcStatsResiWarnDTO data = icStatsResiWarnService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody IcStatsResiWarnDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icStatsResiWarnService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody IcStatsResiWarnDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icStatsResiWarnService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + icStatsResiWarnService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = icStatsResiWarnService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, IcStatsResiWarnExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StatsResiWarnController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StatsResiWarnController.java new file mode 100644 index 0000000000..8e36190cf0 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StatsResiWarnController.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.controller; + +import com.epmet.common.token.annotation.Login; +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.form.StatsResiListFormDTO; +import com.epmet.dto.form.StatsResiWarnCountFormDTO; +import com.epmet.dto.form.StatsResiWarnFormDTO; +import com.epmet.dto.result.IcStatsResiResultDTO; +import com.epmet.dto.result.IcStatsResiWarnBuildingResultDTO; +import com.epmet.dto.result.IcStatsResiWarnUserResultDTO; +import com.epmet.service.IcStatsResiWarnService; +import com.epmet.service.StatsResiWarnService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.CollectionUtils; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import 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-11-04 + */ +@RestController +@RequestMapping("statsresiwarn") +public class StatsResiWarnController { + + @Autowired + private IcStatsResiWarnService icStatsResiWarnService; + + @Autowired + private StatsResiWarnService statsResiWarnService; + + @PostMapping("list") + public Result list(@LoginUser TokenDto tokenDto,@RequestBody StatsResiListFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO); + String customerId = tokenDto.getCustomerId(); + List icStatsResiResultDTOList = statsResiWarnService.list(customerId,formDTO.getId(),formDTO.getLevel()); + return new Result().ok(icStatsResiResultDTOList); + + } + + @PostMapping("buildingwarnlist") + public Result buildingWarnList(@LoginUser TokenDto tokenDto,@RequestBody StatsResiWarnFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, StatsResiWarnFormDTO.ListSelectedBuilding.class); + String customerId = tokenDto.getCustomerId(); + String agencyID = formDTO.getAgencyId(); + List icStatsResiWarnBuildingResultDTOS = statsResiWarnService.buildingwWarnList(customerId,agencyID); + return new Result().ok(icStatsResiWarnBuildingResultDTOS); + + } + @PostMapping("userwarnlist") + public Result userWarnList(@LoginUser TokenDto tokenDto,@RequestBody StatsResiWarnFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, StatsResiWarnFormDTO.ListSelectedUser.class); + String customerId = tokenDto.getCustomerId(); + List buildingIdList = formDTO.getBuildingIdList(); + if(CollectionUtils.isEmpty(buildingIdList)){ + Map map = new HashMap<>(); + map.put("total",0); + map.put("list",new ArrayList<>()); + return new Result().ok(map); + } + return new Result().ok(statsResiWarnService.userWarnList(customerId,formDTO.getConfigId(), formDTO.getBuildingIdList(),formDTO.getPageNo(),formDTO.getPageSize())); + } + + /** + * 统计所有 + * @return + */ + @PostMapping("resiwarn") + public Result resiWarn(@LoginUser TokenDto tokenDto){ + statsResiWarnService.resiWarn(tokenDto.getCustomerId()); + return new Result(); + } + @PostMapping("resiWarnByOne") + public Result resiWarnByOne(@LoginUser TokenDto tokenDto,@RequestBody StatsResiWarnCountFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO); + statsResiWarnService.resiWarnByOne(tokenDto.getCustomerId(),formDTO.getUserId()); + return new Result(); + } + +} \ 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..81cd7bf54e --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.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.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.IcResiUserDTO; +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.MapKey; +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-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("currentStaffAgencyId")String currentStaffAgencyId, + @Param("staffOrgPath") String staffOrgPath, + @Param("resultTableName")String resultTableName); + /** + * 查询主表 + * + * @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, + @Param("currentStaffAgencyId")String currentStaffAgencyId, + @Param("staffOrgPath")String staffOrgPath); + + /** + * @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); + + Set selectUserDemandCode(String icResiUserId); + String selectCategoryNames(@Param("customerId") String customerId,@Param("codeSet") Set codeSet); + + @MapKey("HOME_ID") + Map> getHomeUserCategoryCount(@Param("buildId") String buildId); + + /** + * @Description 根据userId查询志愿者 + * @param userId + * @author zxc + * @date 2021/11/5 5:44 下午 + */ + List selectVolunteerByUserId(@Param("userId")String userId); + + /** + * @Description 查询人员类别 + * @param columns + * @author zxc + * @date 2021/11/8 1:50 下午 + */ + Map selectPersonType(@Param("columns")List columns,@Param("customerId")String customerId, + @Param("tableName")String tableName,@Param("userId")String userId); + + /** + * @Author sun + * @Description 查询居民信息 + **/ + IcResiUserDTO getResiUser(IcResiUserDTO dto); +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcStatsResiWarnDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcStatsResiWarnDao.java new file mode 100644 index 0000000000..ef9fac802c --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcStatsResiWarnDao.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.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.IcResiCategoryStatsConfigDTO; +import com.epmet.entity.IcStatsResiWarnEntity; +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-11-04 + */ +@Mapper +public interface IcStatsResiWarnDao extends BaseDao { + + List selectResiWarnByAgencyId(@Param("customerId") String customerId,@Param("agencyId") String agencyId); + + List> userWarnList(@Param("customerId") String customerId, + @Param("buildingIdList") List buildingIdList, + @Param("tableName") String tableName, + @Param("columnName") String columnName); + + Integer countListByLevelAndCol( + @Param("customerId") String customerId, + @Param("tableName") String tableName, + @Param("columnName") String columnName, + @Param("id")String id, + @Param("level")String level); + + List resiWarn(@Param("customerId") String customerId, + @Param("tableName") String tableName, + @Param("columnName") String columnName); + + IcStatsResiWarnEntity resiWarnById(@Param("customerId") String customerId, + @Param("tableName") String tableName, + @Param("columnName") String columnName, + @Param("icStatsResiWarn") IcStatsResiWarnEntity icStatsResiWarn); + +} \ 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..be467bddb5 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcEnsureHouseEntity.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-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 String 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..10add799d0 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcPartyMemberEntity.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.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_party_member") +public class IcPartyMemberEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id customer.id + */ + private String customerId; + + /** + * 主表Id + */ + private String icResiUser; + + /** + * 入党时间 + */ + private String rdsj; + + /** + * 转正时间 + */ + private String 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/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..f647871525 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiUserEntity.java @@ -0,0 +1,493 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.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_resi_user") +public class IcResiUserEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id customer.id + */ + private String customerId; + + /** + * + */ + private String agencyId; + + /** + * + */ + private String pids; + + /** + * 网格ID + */ + private String gridId; + + /** + * 所属小区ID + */ + private String villageId; + + /** + * 所属楼宇Id + */ + private String buildId; + + /** + * 单元id + */ + private String unitId; + + /** + * 所属家庭Id + */ + private String homeId; + + /** + * 是否本地户籍 + */ + private String isBdhj; + + /** + * 姓名 + */ + private String name; + + /** + * 手机号 + */ + private String mobile; + + /** + * 性别 + */ + private String gender; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 出生日期 + */ + private String birthday; + + /** + * 备注 + */ + private String remarks; + + /** + * 联系人 + */ + private String contacts; + + /** + * 联系人电话 + */ + private String contactsMobile; + + /** + * 九小场所url + */ + private String ninePlace; + + /** + * 是否党员 + */ + private String isParty; + + /** + * 是否低保户 + */ + private String isDbh; + + /** + * 是否保障房 + */ + private String isEnsureHouse; + + /** + * 是否失业 + */ + private String isUnemployed; + + /** + * 是否育龄妇女 + */ + private String isYlfn; + + /** + * 是否退役军人 + */ + private String isVeterans; + + /** + * 是否统战人员 + */ + private String isUnitedFront; + + /** + * 是否信访人员 + */ + private String isXfry; + + /** + * 是否志愿者 + */ + private String isVolunteer; + + /** + * 是否老年人 + */ + private String isOldPeople; + + /** + * 是否空巢 + */ + private String isKc; + + /** + * 是否失独 + */ + private String isSd; + + /** + * 是否失能 + */ + private String isSn; + + /** + * 是否失智 + */ + private String isSz; + + /** + * 是否残疾 + */ + private String isCj; + + /** + * 是否大病 + */ + private String isDb; + + /** + * 是否慢病 + */ + private String isMb; + + /** + * 是否特殊人群 + */ + private String isSpecial; + + /** + * 文化程度【字典表】 + */ + private String culture; + + /** + * 文化程度备注 + */ + private String cultureRemakes; + + /** + * 特长【字典表】 + */ + private String specialSkill; + + /** + * 兴趣爱好 + */ + private String hobby; + + /** + * 兴趣爱好备注 + */ + private String hobbyRemakes; + + /** + * 宗教信仰 + */ + private String faith; + + /** + * 宗教信仰备注 + */ + private String faithRemakes; + + /** + * 残疾类别【字典表】 + */ + private String cjlb; + + /** + * 残疾登记(状况)【字典表】 + */ + private String cjzk; + + /** + * 残疾证号 + */ + private String cjzh; + + /** + * 残疾说明 + */ + private String cjsm; + + /** + * 有无监护人【yes no】 + */ + private String ynJdr; + + /** + * 有无技能特长【yes no】 + */ + private String ynJntc; + + /** + * 有无劳动能力 + */ + private String ynLdnl; + + /** + * 有无非义务教育阶段助学【yes no】 + */ + private String ynFywjyjdzx; + + /** + * 所患大病 + */ + private String shdb; + + /** + * 患大病时间 + */ + private String dbsj; + + /** + * 所患慢性病 + */ + private String shmxb; + + /** + * 患慢性病时间 + */ + private String mxbsj; + + /** + * 是否参保 + */ + private String isCb; + + /** + * 自付金额 + */ + private String zfje; + + /** + * 救助金额 + */ + private String jzje; + + /** + * 救助时间[yyyy-MM-dd] + */ + private String jzsj; + + /** + * 享受救助明细序号 + */ + private String jzmxxh; + + /** + * 健康信息备注 + */ + private String healthRemakes; + + /** + * 工作单位 + */ + private String gzdw; + + /** + * 职业 + */ + private String zy; + + /** + * 离退休时间 + */ + private String ltxsj; + + /** + * 工作信息备注 + */ + private String workRemake; + + /** + * 退休金额 + */ + private String txje; + + /** + * 月收入 + */ + private String ysr; + + /** + * 籍贯 + */ + private String jg; + + /** + * 户籍所在地 + */ + private String hjszd; + + /** + * 现居住地 + */ + private String xjzd; + + /** + * 人户情况 + */ + private String rhzk; + + /** + * 居住信息备注 + */ + private String jzxxRemakes; + + /** + * 民族【字典表】 + */ + private String mz; + + /** + * 与户主关系【字典表】 + */ + private String yhzgx; + + /** + * 居住情况【字典表】 + */ + private String jzqk; + + /** + * 婚姻状况【字典表】 + */ + private String hyzk; + + /** + * 配偶情况【字典表】 + */ + private String poqk; + + /** + * 有无赡养人 + */ + private String ynSyr; + + /** + * 与赡养人关系【字典表】 + */ + private String ysyrgx; + + /** + * 赡养人电话 + */ + private String syrMobile; + + /** + * 家庭信息备注 + */ + private String jtxxRemakes; + + /** + * 预留字段1 + */ + private String field1; + + /** + * 预留字段2 + */ + private String field2; + + /** + * 预留字段3 + */ + private String field3; + + /** + * 预留字段4 + */ + private String field4; + + /** + * 预留字段5 + */ + private String field5; + + /** + * 预留字段6 + */ + private String field6; + + /** + * 预留字段7 + */ + private String field7; + + /** + * 预留字段8 + */ + private String field8; + + /** + * 预留字段9 + */ + private String field9; + + /** + * 预留字段10 + */ + private String field10; + +} diff --git a/epmet-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/IcStatsResiWarnEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcStatsResiWarnEntity.java new file mode 100644 index 0000000000..fd636c095b --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcStatsResiWarnEntity.java @@ -0,0 +1,81 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 预警统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_stats_resi_warn") +public class IcStatsResiWarnEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 预警配置ID + */ + private String configId; + + /** + * 网格id + */ + private String gridId; + + /** + * 组织id + */ + private String agencyId; + + /** + * 组织的所有上级组织id + */ + private String agencyPids; + + /** + * 小区id + */ + private String neighborHoodId; + + /** + * 楼宇id + */ + private String buildingId; + + /** + * 该分类的居民数量 + */ + private Integer count; + +} 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..9e00e6527f --- /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 String 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..076d6f33fe --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcVeteransEntity.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.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_veterans") +public class IcVeteransEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id customer.id + */ + private String customerId; + + /** + * 主表Id + */ + private String icResiUser; + + /** + * 入伍时间 + */ + private String rwsj; + + /** + * 退伍时间 + */ + private String twsj; + + /** + * 服役单位 + */ + private String fydw; + + /** + * 接收单位 + */ + private String jsdw; + + /** + * 待安置补助金 + */ + private String dazbzj; + + /** + * 培训状况 + */ + private String pxzk; + + /** + * 参战时间【年月日区间值yyyy-MM-dd~yyyy-MM-dd】 + */ + private String 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/enums/IcResiUserTableEnum.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/enums/IcResiUserTableEnum.java new file mode 100644 index 0000000000..ffd0076429 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/enums/IcResiUserTableEnum.java @@ -0,0 +1,83 @@ +package com.epmet.enums; + +import lombok.AllArgsConstructor; + +/** + * @Description 描述 + * @Author wangxianzhang + * @Date 2021/11/5 10:37 上午 + * @Version 1.0 + */ +@AllArgsConstructor +public enum IcResiUserTableEnum { + /** + * 注释 + */ + IC_RESI_USER("ic_resi_user","社区居民基本信息录入表", 0, 3, null), + IC_PARTY_MEMBER("ic_party_member","党员信息录入表", 1, 2, "IS_PARTY"), + IC_ENSURE_HOUSE("ic_ensure_house","保障房人员信息录入表", 2, 2, "IS_ENSURE_HOUSE"), + IC_UNEMPLOYED("ic_unemployed","失业人员信息录入表", 3, 2, "IS_UNEMPLOYED"), + IC_VETERANS("ic_veterans","退役军人信息录入表", 4, 2, "IS_VETERANS"), + IC_UNITED_FRONT("ic_united_front","统战人员信息录入表", 5, 2, "IS_UNITED_FRONT"), + IC_VOLUNTEER("ic_volunteer","志愿者信息录入表", 6, 3, "IS_VOLUNTEER"), + IC_OLD_PEOPLE("ic_old_people","老年人信息录入表", 7, 2, "IS_OLD_PEOPLE"), + IC_SPECIAL("ic_special","特殊人群信息录入表", 8, 3, "IS_SPECIAL"); + + private String tableName; + private String tableComment; + private int sheetNo; + private int headRowNo; + private String mainTableFlagColumnName; + + public static IcResiUserTableEnum getObjectByTableName(String tableName) { + for (IcResiUserTableEnum i : IcResiUserTableEnum.values()) { + if (i.tableName.equals(tableName)) { + return i; + } + } + return null; + } + + + + + public String getTableName() { + return tableName; + } + + public void setTableName(String tableName) { + this.tableName = tableName; + } + + public String getTableComment() { + return tableComment; + } + + public void setTableComment(String tableComment) { + this.tableComment = tableComment; + } + + public int getSheetNo() { + return sheetNo; + } + + public void setSheetNo(int sheetNo) { + this.sheetNo = sheetNo; + } + + public int getHeadRowNo() { + return headRowNo; + } + + public void setHeadRowNo(int headRowNo) { + this.headRowNo = headRowNo; + } + + public String getMainTableFlagColumnName() { + return mainTableFlagColumnName; + } + + public void setMainTableFlagColumnName(String mainTableFlagColumnName) { + this.mainTableFlagColumnName = mainTableFlagColumnName; + } +} 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..dd7995d714 --- /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 String 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..5374d00284 --- /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 String rdsj; + + @Excel(name = "转正时间") + private String 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..217223a4bb --- /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 String dbsj; + + @Excel(name = "所患慢性病") + private String shmxb; + + @Excel(name = "患慢性病时间") + private String mxbsj; + + @Excel(name = "是否参保") + private String isCb; + + @Excel(name = "自付金额") + private String zfje; + + @Excel(name = "救助金额") + private String jzje; + + @Excel(name = "救助时间[yyyy-MM-dd]") + private String jzsj; + + @Excel(name = "享受救助明细序号") + private String jzmxxh; + + @Excel(name = "健康信息备注") + private String healthRemakes; + + @Excel(name = "工作单位") + private String gzdw; + + @Excel(name = "职业") + private String zy; + + @Excel(name = "离退休时间") + private String 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/IcStatsResiWarnExcel.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcStatsResiWarnExcel.java new file mode 100644 index 0000000000..59983add12 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcStatsResiWarnExcel.java @@ -0,0 +1,80 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 预警统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +@Data +public class IcStatsResiWarnExcel { + + @Excel(name = "id") + private String id; + + @Excel(name = "客户id") + private String customerId; + + @Excel(name = "预警配置ID") + private String configId; + + @Excel(name = "网格id") + private String gridId; + + @Excel(name = "组织id") + private String agencyId; + + @Excel(name = "组织的所有上级组织id") + private String agencyPids; + + @Excel(name = "小区id") + private String neighborHoodId; + + @Excel(name = "楼宇id") + private String buildingId; + + @Excel(name = "该分类的居民数量") + private Integer count; + + @Excel(name = "删除标识:0.未删除 1.已删除") + private String delFlag; + + @Excel(name = "乐观锁") + private String revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private String createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-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..91556105d9 --- /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 String 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..3109a7fa4d --- /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 String rwsj; + + @Excel(name = "退伍时间") + private String 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 String 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..4c12594a45 --- /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/excel/support/ExportResiUserItemDTO.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/support/ExportResiUserItemDTO.java new file mode 100644 index 0000000000..8f7cb6de14 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/support/ExportResiUserItemDTO.java @@ -0,0 +1,29 @@ +package com.epmet.excel.support; + +import com.epmet.dto.result.FormItemResult; +import lombok.Data; + +import java.io.Serializable; +import java.util.*; + +/** + * desc: + * + * @author: LiuJanJun + * @date: 2021/11/18 3:31 下午 + * @version: 1.0 + */ +@Data +public class ExportResiUserItemDTO implements Serializable { + + private static final long serialVersionUID = -6581208659638591761L; + + /** + * 该表对应的 字段名:item + */ + private Map itemMap = new HashMap<>(); + /** + * 该表对应的所有远程item的相关条件 key:remote的itemID value:条件中用到的所有的item + */ + private Map> remoteItemConditionMap = new HashMap<>(); +} 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/mq/RocketMQWarnStatsRegister.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/mq/RocketMQWarnStatsRegister.java new file mode 100644 index 0000000000..2e7068ae04 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/mq/RocketMQWarnStatsRegister.java @@ -0,0 +1,31 @@ +package com.epmet.mq; + +import com.epmet.commons.rocketmq.constants.ConsomerGroupConstants; +import com.epmet.commons.rocketmq.constants.TopicConstants; +import com.epmet.commons.rocketmq.register.MQAbstractRegister; +import com.epmet.commons.rocketmq.register.MQConsumerProperties; +import com.epmet.mq.listener.ICWarnStatsEventListener; +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 RocketMQWarnStatsRegister extends MQAbstractRegister { + + @Override + public void registerAllListeners(String env, MQConsumerProperties consumerProperties) { + // 客户初始化监听器注册 + register(consumerProperties, + ConsomerGroupConstants.IC_WARN_STATS_EVENT_LISTENER_GROUP, + MessageModel.CLUSTERING, + TopicConstants.IC_RESI_USER, + "*", + new ICWarnStatsEventListener()); + + // ...其他监听器类似 + } +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/mq/listener/ICWarnStatsEventListener.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/mq/listener/ICWarnStatsEventListener.java new file mode 100644 index 0000000000..d0ff2a10e9 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/mq/listener/ICWarnStatsEventListener.java @@ -0,0 +1,104 @@ +package com.epmet.mq.listener; + +import com.alibaba.fastjson.JSON; +import com.epmet.commons.rocketmq.constants.MQUserPropertys; +import com.epmet.commons.rocketmq.messages.IcResiUserAddMQMsg; +import com.epmet.commons.tools.distributedlock.DistributedLock; +import com.epmet.commons.tools.exception.ExceptionUtils; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.redis.RedisKeys; +import com.epmet.commons.tools.redis.RedisUtils; +import com.epmet.commons.tools.utils.SpringContextUtils; +import com.epmet.service.StatsResiWarnService; +import org.apache.commons.lang.StringUtils; +import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext; +import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus; +import org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently; +import org.apache.rocketmq.common.message.MessageExt; +import org.redisson.api.RLock; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.List; +import java.util.concurrent.TimeUnit; + +/** + * @Description 负能平台-客户居民信息变动监听器 + * @author wxz + * @date 2021.10.13 15:21:48 +*/ +public class ICWarnStatsEventListener 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); + IcResiUserAddMQMsg obj = JSON.parseObject(msg, IcResiUserAddMQMsg.class); + + DistributedLock distributedLock = null; + RLock lock = null; + try { + distributedLock = SpringContextUtils.getBean(DistributedLock.class); + lock = distributedLock.getLock(String.format("lock:ic_warn_stats:%s", obj.getCustomerId()), + 30L, 30L, TimeUnit.SECONDS); + //待执行方法 + SpringContextUtils.getBean(StatsResiWarnService.class).resiWarn(obj.getCustomerId()); + } catch (RenException e) { + // 如果是我们手动抛出的异常,说明在业务可控范围内。目前不需要MQ重试 + logger.error("【开放数据事件监听器】-客户居民信息变动MQ失败:".concat(ExceptionUtils.getErrorStackTrace(e))); + } catch (Exception e) { + // 不是我们自己抛出的异常,可以让MQ重试 + logger.error("【开放数据事件监听器】-客户居民信息变动MQ失败:".concat(ExceptionUtils.getErrorStackTrace(e))); + throw e; + } finally { + distributedLock.unLock(lock); + } + + if (StringUtils.isNotBlank(pendingMsgLabel)) { + try { + removePendingMqMsgCache(pendingMsgLabel); + } catch (Exception e) { + logger.error("【开放数据事件监听器】-删除mq阻塞消息缓存失败:{}", ExceptionUtils.getErrorStackTrace(e)); + } + } + } + + /** + * @description + * + * @param pendingMsgLabel + * @return + * @author wxz + * @date 2021.10.14 16:32:32 + */ + private void removePendingMqMsgCache(String pendingMsgLabel) { + String key = RedisKeys.blockedMqMsgKey(pendingMsgLabel); + redisUtils.delete(key); + //logger.info("【开放数据事件监听器】删除mq阻塞消息缓存成功,blockedMsgLabel:{}", pendingMsgLabel); + } +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/mq/listener/InitCustomerRolesListener.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/mq/listener/InitCustomerRolesListener.java deleted file mode 100644 index a50da7561e..0000000000 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/mq/listener/InitCustomerRolesListener.java +++ /dev/null @@ -1,39 +0,0 @@ -//package com.epmet.mq.listener; -// -//import com.alibaba.fastjson.JSON; -//import com.epmet.commons.rocketmq.constants.ConsomerGroupConstants; -//import com.epmet.commons.rocketmq.constants.TopicConstants; -//import com.epmet.commons.rocketmq.messages.InitCustomerMQMsg; -//import com.epmet.service.GovStaffRoleService; -//import org.apache.rocketmq.common.message.MessageExt; -//import org.apache.rocketmq.spring.annotation.MessageModel; -//import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; -//import org.apache.rocketmq.spring.core.RocketMQListener; -//import org.slf4j.Logger; -//import org.slf4j.LoggerFactory; -//import org.springframework.beans.factory.annotation.Autowired; -//import org.springframework.stereotype.Component; -// -///** -// * 监听初始化客户动作,为客户初始化角色列表 -// */ -//@RocketMQMessageListener(topic = TopicConstants.INIT_CUSTOMER, -// consumerGroup = ConsomerGroupConstants.INIT_CUSTOMER_ROLES_GROUP, -// messageModel = MessageModel.CLUSTERING, -// selectorExpression = "*") -//@Component -//public class InitCustomerRolesListener implements RocketMQListener { -// -// private Logger logger = LoggerFactory.getLogger(getClass()); -// -// @Autowired -// private GovStaffRoleService govStaffRoleService; -// -// @Override -// public void onMessage(MessageExt messageExt) { -// String msg = new String(messageExt.getBody()); -// logger.info("初始化客户-初始化角色列表-收到消息内容:{}", msg); -// InitCustomerMQMsg msgObj = JSON.parseObject(msg, InitCustomerMQMsg.class); -// govStaffRoleService.initGovStaffRolesForCustomer(msgObj.getCustomerId()); -// } -//} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/IcStatsResiWarnRedis.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/IcStatsResiWarnRedis.java new file mode 100644 index 0000000000..6f143a4264 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/IcStatsResiWarnRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 预警统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +@Component +public class IcStatsResiWarnRedis { + @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/IcResiUserImportService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserImportService.java new file mode 100644 index 0000000000..7f3d0bdca0 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserImportService.java @@ -0,0 +1,16 @@ +package com.epmet.service; + +import com.epmet.dto.result.FormItemResult; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +/** + *@Description 居民信息导入service + *@Author wangxianzhang + *@Date 2021/11/4 + */ +public interface IcResiUserImportService { + + void importIcResiInfoFromExcel(List formItemList, String excelPathName, HttpServletResponse response); +} 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..2d8a3592bd --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java @@ -0,0 +1,142 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.form.*; +import com.epmet.dto.result.*; +import com.epmet.entity.IcResiUserEntity; +import com.epmet.excel.support.ExportResiUserItemDTO; + +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 { + /** + * 单个删除 + * + * @return void + * @author generator + * @date 2021-10-26 + */ + void delete(DelIcResiUserFormDTO formDTO); + + /** + * @Author sun + * @Description 党建互联平台--保存居民信息 + **/ + String add(TokenDto tokenDto, List formDTO); + + /** + * @Author sun + * @Description 党建互联平台--修改居民信息 + **/ + String 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); + + + + List> dynamicQuery(String customerId, + String formCode, + String resultTableName, + List conditions, + String currentStaffAgencyId, + String staffOrgPath); + + /** + * @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 下午 + */ + PageData searchByName(SearchByNameFormDTO formDTO, TokenDto tokenDto); + + + /** + * desc:条件导出 + * + * @param exportResiUserItemDTO + * @param baseTableName + * @return Map> 用户Id:用户信息所有的字段名及值 + */ + List> getDataForExport(ExportResiUserItemDTO exportResiUserItemDTO, String baseTableName, IcResiUserPageFormDTO pageFormDTO, String currentStaffAgencyId, + String staffOrgPath); + + /** + * @Description 家庭关系 + * @Param userId + * @Return {@link OwnerRelationResultDTO} + * @Author zhaoqifeng + * @Date 2021/11/5 10:28 + */ + OwnerRelationResultDTO getOwnerRelation(String userId); + + /** + * @Description 获取一栋楼每个房间人员分类的数量 + * @Param buildId + * @Return {@link Map< String, Map< String, String>>} + * @Author zhaoqifeng + * @Date 2021/11/5 14:40 + */ + Map> getHomeUserCategoryCount(String buildId); + + /** + * desc:根据formCode 获取标单项 + * + * @param customerId + * @param formCode + * @return + */ + List listFormItems(String customerId, String formCode); +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcStatsResiWarnService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcStatsResiWarnService.java new file mode 100644 index 0000000000..6a0592adbe --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcStatsResiWarnService.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.IcStatsResiWarnDTO; +import com.epmet.entity.IcStatsResiWarnEntity; + +import java.util.List; +import java.util.Map; + +/** + * 预警统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +public interface IcStatsResiWarnService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-11-04 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-11-04 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcStatsResiWarnDTO + * @author generator + * @date 2021-11-04 + */ + IcStatsResiWarnDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-11-04 + */ + void save(IcStatsResiWarnDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-11-04 + */ + void update(IcStatsResiWarnDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-11-04 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StatsResiWarnService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StatsResiWarnService.java new file mode 100644 index 0000000000..37a85105bb --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StatsResiWarnService.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.dto.result.IcStatsResiResultDTO; +import com.epmet.dto.result.IcStatsResiWarnBuildingResultDTO; +import com.epmet.dto.result.IcStatsResiWarnUserResultDTO; + +import java.util.List; +import java.util.Map; + +/** + * 预警统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +public interface StatsResiWarnService{ + + List buildingwWarnList(String customerId,String agencyID); + + Map userWarnList(String customerId, String configId, List buildingIdList, Integer pageNo, Integer pageSize); + + List list(String customerId,String id, String level); + + void resiWarn(String customerId); + + void resiWarnByOne(String customerId,String userId); +} \ No newline at end of file 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 039edc5e32..545550dcd1 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 @@ -26,6 +26,7 @@ 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; @@ -81,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 @@ -406,7 +407,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/IcResiUserImportServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java new file mode 100644 index 0000000000..9b50c237dd --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java @@ -0,0 +1,940 @@ +package com.epmet.service.impl; + +import cn.afterturn.easypoi.excel.ExcelExportUtil; +import cn.afterturn.easypoi.excel.annotation.Excel; +import cn.afterturn.easypoi.excel.entity.ExportParams; +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.EasyExcelFactory; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.epmet.commons.tools.constant.ServiceConstant; +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.ExceptionUtils; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.feign.ResultDataResolver; +import com.epmet.commons.tools.security.user.LoginUserUtil; +import com.epmet.dao.IcResiUserDao; +import com.epmet.dto.*; +import com.epmet.dto.form.GridOptionFormDTO; +import com.epmet.dto.form.HouseFormDTO; +import com.epmet.dto.form.LoginUserDetailsFormDTO; +import com.epmet.dto.result.FormItemResult; +import com.epmet.dto.result.LoginUserDetailsResultDTO; +import com.epmet.dto.result.OptionDTO; +import com.epmet.entity.IcResiUserEntity; +import com.epmet.enums.IcResiUserTableEnum; +import com.epmet.excel.handler.DynamicEasyExcelListener; +import com.epmet.feign.EpmetAdminOpenFeignClient; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.feign.GovOrgOpenFeignClient; +import com.epmet.service.IcResiUserImportService; +import com.google.common.cache.Cache; +import com.google.common.cache.CacheBuilder; +import lombok.Data; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.apache.poi.ss.usermodel.Workbook; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import javax.servlet.http.HttpServletResponse; +import java.io.File; +import java.io.IOException; +import java.net.URLEncoder; +import java.util.*; +import java.util.stream.Collectors; + +/** + * @ClassName IcResiUserImportServiceImpl + * @Description TODO + * @Author wangxianzhang + * @Date 2021/11/4 8:53 下午 + * @Version 1.0 + */ +@Slf4j +@Service +public class IcResiUserImportServiceImpl implements IcResiUserImportService, ResultDataResolver { + + // 错误和跳过excel行暂存 + public static final ThreadLocal>> errorRows = new ThreadLocal<>(); + public static final ThreadLocal>> skipedRows = new ThreadLocal<>(); + + /** + * key: itemId + * value: + * key: option的中文 + * value: options的英文key,也可能是数据id + */ + Cache> itemIdAndOptionsCache = CacheBuilder.newBuilder().maximumSize(500).build(); + + + @Autowired + private LoginUserUtil loginUserUtil; + + @Autowired + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + + @Autowired + private EpmetAdminOpenFeignClient adminOpenFeignClient; + + @Autowired + private GovOrgOpenFeignClient govOrgOpenFeignClient; + + @Autowired + private IcResiUserDao icResiUserDao; + + /** + * @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 Integer required; + private List colIndex; + //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; + } + + /** + * 错误行信息 + */ + @Data + public static class ErrorRow { + + @Excel(name = "工作表", width = 30) + private String sheetName; + + private String tableName; + + @Excel(name = "身份证号", width = 40) + private String idCard; + + @Excel(name = "姓名", width = 25) + private String name; + + @Excel(name = "错误信息", width = 40) + private String errorInfo; + } + + @Data + public static class SkipedRow { + + @Excel(name = "工作表") + private String sheetName; + + private String tableName; + + @Excel(name = "身份证号") + private String idCard; + + @Excel(name = "姓名") + private String name; + + @Excel(name = "信息") + private String info; + } + + /** + * 导入居民信息 + * 导入主表和所有子表信息 + * @return + */ + @Override + public void importIcResiInfoFromExcel(List formItemList, String excelPathName, HttpServletResponse response) { + String loginUserId = loginUserUtil.getLoginUserId(); + String loginUserApp = loginUserUtil.getLoginUserApp(); + String loginUserClient = loginUserUtil.getLoginUserClient(); + + LoginUserDetailsFormDTO userForm = new LoginUserDetailsFormDTO(); + userForm.setApp(loginUserApp); + userForm.setClient(loginUserClient); + userForm.setUserId(loginUserId); + + LoginUserDetailsResultDTO loginUserDetails = getResultDataOrThrowsException(epmetUserOpenFeignClient.getLoginUserDetails(userForm), ServiceConstant.EPMET_USER_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null, null); + String currUserAgencyId = loginUserDetails.getAgencyId(); + + //String excelPathName = "/opt/test/基础信息表/resi_info.xls"; + CustomerAgencyDTO agencyInfo = getResultDataOrThrowsException(govOrgOpenFeignClient.getAgencyById(currUserAgencyId), ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null, null); + String customerId = agencyInfo.getCustomerId(); + + try { + initThreadLocalRowsStorage(); + + // 上传主表信息 + importIcResiBaseInfoFromExcel(formItemList,excelPathName, IcResiUserTableEnum.IC_RESI_USER.getSheetNo(), IcResiUserTableEnum.IC_RESI_USER.getHeadRowNo(), + currUserAgencyId, agencyInfo.getPids(), loginUserId, IcResiUserTableEnum.IC_RESI_USER.getTableName()); + + // 上传附表信息 + for (IcResiUserTableEnum sheet : IcResiUserTableEnum.values()) { + if (sheet == IcResiUserTableEnum.IC_RESI_USER) { + continue; + } + + try { + importIcResiExtraInfoFromExcel(formItemList, excelPathName, sheet.getSheetNo(), sheet.getHeadRowNo(), currUserAgencyId, loginUserId, sheet.getTableName(), customerId); + } catch (Exception e) { + String errorMsg = ExceptionUtils.getErrorStackTrace(e); + log.error("导入IC居民附加信息【{}】错误:{}", sheet.getTableComment(), errorMsg); + ErrorRow errorRow = new ErrorRow(); + errorRow.setName("*"); + errorRow.setIdCard("*"); + errorRows.get().get(sheet.getTableName()).add(errorRow); + } + } + + //String errors = JSON.toJSONString(errorRows.get()); + //String skipeds = JSON.toJSONString(skipedRows.get()); + + //log.error(errors); + //log.error(skipeds); + + try { + downLoadResults(response); + } catch (IOException e) { + log.error("【导入IC居民附加信息】下载导入结果信息失败:{}", ExceptionUtils.getErrorStackTrace(e)); + } + } finally { + skipedRows.remove(); + errorRows.remove(); + itemIdAndOptionsCache.invalidateAll(); + } + } + + /** + * 暂存rows信息初始化 + */ + private void initThreadLocalRowsStorage() { + Map> skipedRowsMap = new LinkedHashMap<>(); + for (IcResiUserTableEnum e : IcResiUserTableEnum.values()) { + skipedRowsMap.put(e.getTableName(), new LinkedList<>()); + } + skipedRows.set(skipedRowsMap); + + Map> errorRowsMap = new LinkedHashMap<>(); + for (IcResiUserTableEnum e : IcResiUserTableEnum.values()) { + errorRowsMap.put(e.getTableName(), new LinkedList<>()); + } + errorRows.set(errorRowsMap); + } + + /** + * excel导入居民基本信息 + * + * @param formItemList + * @param sheetNo + * @param headRowNumber + * @param currUserAgencyId + * @param currUserAgencyPids + * @param currentUserId + * @return + */ + private Object importIcResiBaseInfoFromExcel(List formItemList, String excelPathName, int sheetNo, int headRowNumber, String currUserAgencyId, String currUserAgencyPids, String currentUserId, + String tableName) { + DynamicEasyExcelListener readListener = new DynamicEasyExcelListener(); + //EasyExcelFactory.read(new File(excelPathName)).registerReadListener(readListener).headRowNumber(headRowNumber).sheet(sheetNo).doRead(); + EasyExcel.read(new File(excelPathName)).registerReadListener(readListener).headRowNumber(headRowNumber).sheet(sheetNo).doRead(); + + List> headList = readListener.getHeadList(); + List> dataList = readListener.getDataList(); + + Map> headers = mergeHead(headList); + + // 清洗表头数据 + Map abandonedHeaders = washHeaders(headers, formItemList); + + //合并多级表头 + HashMap> combinedHeaders = combineHeaders(headers); + + // 得到客户配置item数据 + Map formItemMap = formItemList.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 = convertExcelHeaders2DBColumnWrappers(formItemMap, combinedHeaders, dataList, abandonedHeaders); + + // 持久化 + persistIcResiBaseInfo(headerColumnWrapper, dataList, currUserAgencyId, abandonedHeaders, currUserAgencyPids, currentUserId, tableName); + + return headers; + } + + /** + * excel导入居民附加信息 + * + * @param formItemList + * @param excelPathName + * @param sheetNo + * @param headRowNumber + * @param currUserAgencyId + * @param currentUserId + * @param targetTableName 要插入哪一个表 + * @return + */ + private Object importIcResiExtraInfoFromExcel(List formItemList, String excelPathName, int sheetNo, int headRowNumber, String currUserAgencyId, String currentUserId, + String targetTableName, String customerId) { + DynamicEasyExcelListener readListener = new DynamicEasyExcelListener(); + EasyExcelFactory.read(new File(excelPathName)).registerReadListener(readListener).headRowNumber(headRowNumber).sheet(sheetNo).doRead(); + + List> headList = readListener.getHeadList(); + List> dataList = readListener.getDataList(); + + Map> headers = mergeHead(headList); + + // 清洗表头数据 + Map abandonedHeaders = washHeaders(headers, formItemList); + + //合并多级表头 + HashMap> combinedHeaders = combineHeaders(headers); + + // 得到客户配置item数据 + Map formItemMap = formItemList.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 = convertExcelHeaders2DBColumnWrappers(formItemMap, combinedHeaders, dataList, abandonedHeaders); + persistIcResiExtraInfo(headerColumnWrapper, dataList, currUserAgencyId, abandonedHeaders, currentUserId, targetTableName, customerId); + return headerColumnWrapper; + } + + /** + * 持久化IC居民基础信息 + * @param headerColumnWrapper 数据库列包装信息 + * @param dataRows 数据行集合 + * @param currUserAgencyId 当前用户的组织id + * @param checkBoxOptionColumnIdxAndLabel 复选框的列号&label中文 + */ + private void persistIcResiBaseInfo(Map headerColumnWrapper, List> dataRows, + String currUserAgencyId, Map checkBoxOptionColumnIdxAndLabel, + String currUserAgencyPids, String currentUserId, String tableName) { + + // 遍历每一行,将行内容转化为 + for (Map row : dataRows) { + + LinkedHashMap columnAndValues = new LinkedHashMap<>(); + try { + convertColumnWrappers2Map4Persist(headerColumnWrapper, row, currUserAgencyId, checkBoxOptionColumnIdxAndLabel, columnAndValues); + + 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.getLoginUserCustomerId()); + + columnAndValues.put("UPDATED_BY", currentUserId); + + // 验证居民信息是否存在 + String idCard = columnAndValues.get("ID_CARD"); + LambdaQueryWrapper idCardQuery = new LambdaQueryWrapper<>(); + idCardQuery.eq(IcResiUserEntity::getIdCard, idCard); + IcResiUserEntity resiBaseInfo = icResiUserDao.selectOne(idCardQuery); + + if (resiBaseInfo != null) { + icResiUserDao.upTable(tableName, resiBaseInfo.getId(), columnAndValues); + } else { + columnAndValues.put("CREATED_BY", currentUserId); + columnAndValues.put("ID", UUID.randomUUID().toString().replace("-", "")); + icResiUserDao.add(tableName, columnAndValues); + } + + //if (icResiUserDao.selectCount(idCardQuery) > 0) { + // //log.info("身份证号为【{}】的居民信息已存在,跳过导入", idCard); + // SkipedRow skipedRow = new SkipedRow(); + // skipedRow.setName(columnAndValues.get("NAME")); + // skipedRow.setIdCard(idCard); + // skipedRow.setInfo("身份证号已存在,跳过导入"); + // skipedRow.setTableName(tableName); + // skipedRows.get().get(IcResiUserTableEnums.IC_RESI_USER.getTableName()).add(skipedRow); + // continue; + //} + + } catch (Exception e) { + String errorMsg; + if (e instanceof RenException) { + errorMsg = e.getMessage(); + } else { + errorMsg = "未知系统错误"; + log.error(ExceptionUtils.getErrorStackTrace(e)); + } + + ErrorRow errorRow = new ErrorRow(); + errorRow.setIdCard(columnAndValues.get("ID_CARD")); + errorRow.setName(columnAndValues.get("NAME")); + errorRow.setErrorInfo(errorMsg); + errorRow.setTableName(tableName); + errorRows.get().get(IcResiUserTableEnum.IC_RESI_USER.getTableName()).add(errorRow); + } finally { + columnAndValues.clear(); + } + } + } + + /** + * 持久化IC居民附加信息 + * @param headerColumnWrapper 数据库列包装信息 + * @param dataRows 数据行集合 + * @param currUserAgencyId 当前用户的组织id + * @param checkBoxOptionColumnIdxAndLabel 复选框的列号&label中文 + * @param targetTableName 要插入到哪一个表 + */ + private void persistIcResiExtraInfo(Map headerColumnWrapper, List> dataRows, + String currUserAgencyId, Map checkBoxOptionColumnIdxAndLabel, + String currentUserId, String targetTableName, String customerId) { + + LinkedHashMap columnAndValues = new LinkedHashMap<>(); + + // 遍历每一行,将行内容转化为 + for (Map row : dataRows) { + + try { + convertColumnWrappers2Map4Persist(headerColumnWrapper, row, currUserAgencyId, checkBoxOptionColumnIdxAndLabel, columnAndValues); + + // 检验身份证号 + String idCard = columnAndValues.get("ID_CARD"); + if (StringUtils.isBlank(idCard)) { + throw new RenException(EpmetErrorCode.IDCARDNO_ERROR.getCode(), String.format("用户【%s】身份证号未填写或格式错误", columnAndValues.get("NAME"))); + } + + // 检查用户是否存在 + LambdaQueryWrapper idCardQuery = new LambdaQueryWrapper<>(); + idCardQuery.eq(IcResiUserEntity::getIdCard, idCard); + + IcResiUserEntity icResiUserBaseInfo = icResiUserDao.selectOne(idCardQuery); + if (icResiUserBaseInfo == null) { + throw new RenException(EpmetErrorCode.RESI_NOT_FOUND.getCode(), String.format("身份证号为【%s】的居民信息未找到,请确认该居民信息存在", idCard)); + } + + String icResiId = icResiUserBaseInfo.getId(); + + //if (CollectionUtils.isNotEmpty(icResiUserDao.selectSubTableRecords(customerId, icResiId, targetTableName))) { + // log.info("身份证号为【{}】的居民【{}】信息已存在,跳过导入", idCard, targetTableName); + // + // SkipedRow skipedRow = new SkipedRow(); + // skipedRow.setName(columnAndValues.get("NAME")); + // skipedRow.setIdCard(columnAndValues.get("ID_CARD")); + // skipedRow.setInfo("信息已存在,跳过导入"); + // skipedRow.setTableName(targetTableName); + // skipedRows.get().get(targetTableName).add(skipedRow); + // + // continue; + //} + + columnAndValues.put("IC_RESI_USER", icResiId); + columnAndValues.put("CUSTOMER_ID", loginUserUtil.getLoginUserCustomerId()); + columnAndValues.put("UPDATED_BY", currentUserId); + + // 移除excel中存在,但是数据库表中不存在的无效列,方式sql语法错误 + columnAndValues = removeNeedlessColumns(columnAndValues); + + // 更新主表的人员类型及更新时间 + updateMainTableResiTypeFlag(Objects.requireNonNull(IcResiUserTableEnum.getObjectByTableName(targetTableName)), icResiId); + + // 验证附加信息是否存在 + List> subInfos = icResiUserDao.selectSubTableRecords(customerId, icResiId, targetTableName); + if (CollectionUtils.isNotEmpty(subInfos)) { + Map subInfo = subInfos.get(0); + // 附加信息存在,更新附加表内容 + icResiUserDao.upTable(targetTableName, subInfo.get("ID").toString(), columnAndValues); + } else { + // 新增附加表信息 + columnAndValues.put("CREATED_BY", currentUserId); + columnAndValues.put("ID", UUID.randomUUID().toString().replace("-", "")); + icResiUserDao.add(targetTableName, columnAndValues); + } + + } catch (Exception e) { + String errorMsg; + if (e instanceof RenException) { + errorMsg = e.getMessage(); + } else { + errorMsg = "未知系统错误"; + log.error(ExceptionUtils.getErrorStackTrace(e)); + } + + ErrorRow errorRow = new ErrorRow(); + errorRow.setName(columnAndValues.get("NAME")); + errorRow.setIdCard(columnAndValues.get("ID_CARD")); + errorRow.setErrorInfo(errorMsg); + errorRow.setTableName(targetTableName); + errorRows.get().get(targetTableName).add(errorRow); + } finally { + columnAndValues.clear(); + } + } + } + + /** + * 去掉多余的列 + * @param originColumnAndValues + * @return + */ + private LinkedHashMap removeNeedlessColumns(LinkedHashMap originColumnAndValues) { + List needlessColumns = Arrays.asList("GRID_ID", "VILLAGE_ID", "BUILD_ID", "UNIT_ID", "HOME_ID", + "IS_BDHJ", "NAME", "MOBILE", "GENDER", "ID_CARD", + "BIRTHDAY", "CONTACTS", "CONTACTS_MOBILE"); + + LinkedHashMap newMap = new LinkedHashMap(); + + originColumnAndValues.entrySet().forEach(b -> { + if (!needlessColumns.contains(b.getKey())) { + newMap.put(b.getKey(), b.getValue()); + } + }); + + return newMap; + } + + /** + * 将当前行数据转化成LinkedHashMap,供后续插入 + * @param headerColumnWrapper 当前行的ColumnWrapper,每一个ColumnWrapper元素都是当前行中的一个列 + * @param row 当前行数据 + * @param currUserAgencyId 当前用户所属机构ID + * @param checkBoxOptionColumnIdxAndLabel 复选框options列表。key:列号,value:复选框中文 + * @param target 要将数据放到哪个对象中 + */ + private void convertColumnWrappers2Map4Persist(Map headerColumnWrapper, Map row, + String currUserAgencyId, Map checkBoxOptionColumnIdxAndLabel, + LinkedHashMap target) { + + boolean interupt = false; + + List errorColumnNames = new LinkedList<>(); + + for (Map.Entry columnWrapperEntry : headerColumnWrapper.entrySet()) { + + ColumnWrapper columnWrapper = columnWrapperEntry.getValue(); + if ("input".equals(columnWrapper.getItemType()) + || "textarea".equals(columnWrapper.getItemType()) + || "datepicker".equals(columnWrapper.getItemType()) + || "daterange".equals(columnWrapper.getItemType()) + ) { + + String cellContent = row.get(columnWrapper.getColIndex().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.getColIndex().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 optionsOfItem = itemIdAndOptionsCache.getIfPresent(columnWrapperEntry.getKey()); + if (optionsOfItem == null || optionsOfItem.size() == 0) { + optionsOfItem = listRemoteOptions(headerColumnWrapper, columnWrapper.getOptionSourceValue(), currUserAgencyId, "saveorupdate"); + itemIdAndOptionsCache.put(columnWrapperEntry.getKey(), optionsOfItem); + } + String colValue = optionsOfItem.get(cellContent); + columnWrapper.setColValue(colValue); + } + } else if ("checkbox".equals(columnWrapper.getItemType())) { + String checkBoxColValue = getCheckBoxColValue(columnWrapper, row, checkBoxOptionColumnIdxAndLabel); + columnWrapper.setColValue(checkBoxColValue); + } + + // requiredColumns中的值为必填项 + if (columnWrapper.getRequired() == 1 && StringUtils.isBlank(columnWrapper.colValue)) { + interupt = true; + errorColumnNames.add(columnWrapper.combinedLabel); + } + + target.put(columnWrapper.columnName, columnWrapper.colValue); + } + + if (interupt) { + throw new RenException(String.join(",", errorColumnNames) + "的值未填写,或者所填写信息在系统中未找到"); + } + } + + /** + * @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 数据整合,将excel表头汉字信息转化成ColumnWrapper列封装数据 + * * key:itemId + * * value:ColumnWrapper列包装信息 + * @param formItemMap item map + * key:itemId; + * value: 合并之后的head字符串,例如:健康信息:监护人 + * @param combinedHeaders 合并之后的head信息。 + * key:合并之后head字符串(例如:党员信息:入党时间); + * value:列号组成的列表(例如[1,2,3]) + * @param datas + * @param abandonedHeaders + * @return + */ + private Map convertExcelHeaders2DBColumnWrappers(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(); + + FormItemResult item = formItemMap.get(combinedHeader); + + if (item == null) { + // 如果数据库中没有该项,可能是用户自己定义的项,忽略 + continue; + } + + ColumnWrapper columnWrapper = new ColumnWrapper(); + + String columnName = item.getColumnName(); + Integer columnNum = item.getColumnNum(); + + // 填充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((columnNum == null || columnNum == 0) ? columnName : columnName + columnNum); + columnWrapper.setColIndex(entry.getValue()); + columnWrapper.setRequired(item.getRequired()); + + 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.getColIndex(); + + 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); + } + + /** + * @description 合并表头 + * Map> + * + * @param headList + * @return + * @author wxz + * @date 2021.10.27 16:17:34 + */ + private Map> mergeHead(List> headList) { + + Map lastNotNullHeads = new LinkedHashMap<>(); + + Map> mergedHead = new LinkedHashMap<>(); + + int levelCount = headList.size(); + + Map firstLevel = headList.get(0); + + // 遍历所有列 + for (Map.Entry column : firstLevel.entrySet()) { + Integer columIndex = column.getKey(); + + List labels = new ArrayList<>(); + + // 竖着遍历该列的所有行 + for (int currentLevel = 0; currentLevel < levelCount; currentLevel ++) { + String label = headList.get(currentLevel).get(columIndex); + + if (StringUtils.isNotBlank(label)) { + lastNotNullHeads.put(currentLevel, label); + } else { + if (currentLevel == 0 || StringUtils.isBlank(headList.get(currentLevel - 1).get(columIndex))) { + label = lastNotNullHeads.get(currentLevel); + } + } + + if (StringUtils.isNotBlank(label)) { + labels.add(label); + } + } + + mergedHead.put(columIndex, labels); + } + + return mergedHead; + } + + /** + * 远程获取options + * @param fullUri + * @return + */ + public Map listRemoteOptions(Map columnWrappers, String fullUri, String currUserAgencyId, String purpose) { + String pureUri = null; + String cascadeItemId = null; + ColumnWrapper cascadeItemColumnWrapper = null; + + if (fullUri.indexOf(StrConstant.QUESTION_MARK) != -1) { + String[] uriParts = fullUri.split(StrConstant.QUESTION_MARK_TRANSFER); + pureUri = uriParts[0]; + cascadeItemId = uriParts[1]; + + // 根据uri上的id,找到关联的itemid,从而找到关联的item的值 + if (columnWrappers != null){ + 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, null); + break; + case "/gov/org/customergrid/gridoption": + GridOptionFormDTO form = new GridOptionFormDTO(); + form.setAgencyId(currUserAgencyId); + form.setPurpose(purpose); + options = getResultDataOrThrowsException(govOrgOpenFeignClient.getGridOption(form), ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null, 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, 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, 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, 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, null); + break; + case "/gov/org/icneighborhood/neighborhoodoption": + IcNeighborHoodDTO nform = new IcNeighborHoodDTO(); + String gridId = cascadeItemColumnWrapper.getColValue(); + if (StringUtils.isBlank(gridId)){ + nform.setAgencyId(currUserAgencyId); + } + nform.setGridId(gridId); + options = getResultDataOrThrowsException(govOrgOpenFeignClient.getNeighborHoodOptions(nform), ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null, null); + break; + case "/sys/dict/data/education": + options = getResultDataOrThrowsException(adminOpenFeignClient.getEducationOption(), ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null, null); + break; + case "/sys/dict/data/house": + options = getResultDataOrThrowsException(adminOpenFeignClient.getHouseOption(), ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null, null); + break; + case "/sys/dict/data/nation": + options = getResultDataOrThrowsException(adminOpenFeignClient.getNationOption(), ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null, null); + break; + case "/sys/dict/data/ninesmallplaces": + options = getResultDataOrThrowsException(adminOpenFeignClient.getNineSmallPlacesOption(), ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null, null); + break; + case "/sys/dict/data/relationship": + options = getResultDataOrThrowsException(adminOpenFeignClient.getRelationshipOption(), ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null, null); + break; + default: + log.warn("listRemoteOptions url is not supported"); + + } + + 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()); + }*/ + + } + + /** + * 更新主表中人员类别标记 + * @param icResiUserTableEnum + * @param resiUserId + */ + private void updateMainTableResiTypeFlag(IcResiUserTableEnum icResiUserTableEnum, String resiUserId) { + HashMap map = new HashMap<>(); + map.put(icResiUserTableEnum.getMainTableFlagColumnName(), true); + icResiUserDao.upTable("ic_resi_user", resiUserId, map); + } + + /** + * 下载导入结果 + * @param response + * @throws IOException + */ + public void downLoadResults(HttpServletResponse response) throws IOException { + //public static final ThreadLocal>> errorRows = new ThreadLocal<>(); + + String fileName = "导入失败条目清单.xls"; + response.setHeader("Access-Control-Expose-Headers", "Content-Disposition"); + response.setHeader("content-Type", "application/vnd.ms-excel"); + response.setHeader("Content-Disposition", "attachment;fileName=" + URLEncoder.encode(fileName, "UTF-8")); + + LinkedList list = new LinkedList<>(); + for (Map.Entry> entry : errorRows.get().entrySet()) { + list.addAll(entry.getValue()); + } + + list.forEach(row -> {row.setSheetName(IcResiUserTableEnum.getObjectByTableName(row.tableName).getTableComment());}); + + Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams("导入失败的列表","导入失败列表(没有数据说明全部成功)"), + ErrorRow.class, list); + + workbook.write(response.getOutputStream()); + } +} 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..dfc0185caf --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java @@ -0,0 +1,850 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.rocketmq.messages.IcResiUserAddMQMsg; +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.enums.FormItemTypeEnum; +import com.epmet.commons.tools.enums.GenderEnum; +import com.epmet.commons.tools.enums.HouseTypeEnum; +import com.epmet.commons.tools.enums.RelationshipEnum; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.feign.ResultDataResolver; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.RedisKeys; +import com.epmet.commons.tools.redis.RedisUtils; +import com.epmet.commons.tools.redis.common.CustomerOrgRedis; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.redis.common.bean.GridInfoCache; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.constant.IcPlatformConstant; +import com.epmet.constant.IcResiUserConstant; +import com.epmet.constant.SystemMessageType; +import com.epmet.constant.UserConstant; +import com.epmet.dao.IcResiUserDao; +import com.epmet.dto.*; +import com.epmet.dto.form.*; +import com.epmet.dto.form.demand.UserDemandNameQueryFormDTO; +import com.epmet.dto.result.*; +import com.epmet.entity.IcResiUserEntity; +import com.epmet.excel.support.ExportResiUserItemDTO; +import com.epmet.feign.EpmetHeartOpenFeignClient; +import com.epmet.feign.EpmetMessageOpenFeignClient; +import com.epmet.feign.GovOrgOpenFeignClient; +import com.epmet.feign.OperCustomizeOpenFeignClient; +import com.epmet.service.IcResiUserService; +import com.github.pagehelper.Page; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.google.common.cache.Cache; +import com.google.common.cache.CacheBuilder; +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.sql.Date; +import java.sql.Timestamp; +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 { + @Autowired + private GovOrgOpenFeignClient govOrgOpenFeignClient; + @Autowired + private OperCustomizeOpenFeignClient operCustomizeOpenFeignClient; + @Autowired + private EpmetHeartOpenFeignClient heartOpenFeignClient; + @Autowired + private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; + + @Autowired + private IcResiUserImportServiceImpl icResiUserImportService; + @Autowired + private RedisUtils redisUtils; + + 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 + @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 String add(TokenDto tokenDto, List formDTO) { + //循环自动拼接sql语句,往多个表新增数据 + //0.校验必填字段是否为空 + Result> resultList = operCustomizeOpenFeignClient.getMustColumn(tokenDto.getCustomerId()); + if (resultList.success() && null != resultList.getData()) { + StringBuffer str = new StringBuffer(""); + formDTO.forEach(f -> { + resultList.getData().forEach(l -> { + if (f.getTableName().equals(l.getTableName())) { + f.getList().forEach(map -> { + if (!map.containsKey(l.getColumnName())) { + str.append(str.length() < NumConstant.ONE ? l.getLabel() : "、" + l.getLabel()); + } + }); + } + }); + }); + if (str.length() > NumConstant.ZERO ) { + throw new RenException(String.format("新增居民信息,必要字段值为空,%s值为空", str)); + } + } else { + throw new RenException(String.format("新增居民信息-根据客户Id查询必填信息失败,customerId->%s", tokenDto.getCustomerId())); + } + + //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为空"); + } + //2021.11.25 新增需求 客户下身份证号唯一 start + if (map.containsKey("ID_CARD")) { + IcResiUserDTO dto = new IcResiUserDTO(); + dto.setCustomerId(tokenDto.getCustomerId()); + dto.setIdCard(map.get("ID_CARD")); + IcResiUserDTO userDTO = baseDao.getResiUser(dto); + if (null != userDTO && null != userDTO.getIdCard()) { + String errorMsg = "新增居民信息失败,身份证号已存在!"; + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg); + } + } + //2021.11.25 end + //查询组织信息 + 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); + } + } + }); + + return resiUserId; + + } + + /** + * @Author sun + * @Description 党建互联平台--修改居民信息 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public String 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("居民信息修改-居民信息表主键值为空")); + } + //2021.11.25 新增需求 客户下身份证号唯一 start + if (map.containsKey("ID_CARD")) { + IcResiUserDTO dto = new IcResiUserDTO(); + dto.setCustomerId(tokenDto.getCustomerId()); + dto.setIdCard(map.get("ID_CARD")); + IcResiUserDTO userDTO = baseDao.getResiUser(dto); + if (null != userDTO && null != userDTO.getIdCard()) { + String errorMsg = "修改居民信息失败,身份证号已存在!"; + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg); + } + } + //2021.11.25 end + 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); + } + } + } + }); + + return resiUserId; + } + + /** + * @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) { + CustomerStaffInfoCacheResult staffInfoCacheResult=CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(),formDTO.getStaffId()); + String staffOrgPath=StrConstant.EPMETY_STR; + if(StringUtils.isNotBlank(staffInfoCacheResult.getAgencyPIds())&& !NumConstant.ZERO_STR.equals(staffInfoCacheResult.getAgencyPIds())){ + staffOrgPath=staffInfoCacheResult.getAgencyPIds().concat(":").concat(staffInfoCacheResult.getAgencyId()); + }else{ + staffOrgPath=staffInfoCacheResult.getAgencyId(); + } + + // 查询列表展示项,如果没有,直接返回 + 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()) { + //分页 + String finalStaffOrgPath = staffOrgPath; + pageInfo= PageHelper.startPage(formDTO.getPageNo(), + formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.selectListResiMap(formDTO.getCustomerId(), + formDTO.getFormCode(), + formDTO.getConditions(), + resultColumns, + subTables, + staffInfoCacheResult.getAgencyId(), finalStaffOrgPath,null + )); + }else{ + List> list=baseDao.selectListResiMap(formDTO.getCustomerId(), + formDTO.getFormCode(), + formDTO.getConditions(), + resultColumns, + subTables,staffInfoCacheResult.getAgencyId(), + staffOrgPath,null); + 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)); + + resultMap.put("CATEGORY_NAME",queryUserDemandName(formDTO.getCustomerId(),(String) resultMap.get("icResiUserId"))); + } + + 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()); + } + + private String queryUserDemandName(String customerId,String icResiUserId) { + Set demandCodePath=baseDao.selectUserDemandCode(icResiUserId); + if(CollectionUtils.isEmpty(demandCodePath)){ + return StrConstant.EPMETY_STR; + } + Set codeSet=new HashSet<>(); + for(String codePath:demandCodePath){ + if(codePath.contains(StrConstant.COMMA)){ + String[] codeAtt=codePath.split(StrConstant.COMMA); + codeSet.add(codeAtt[codeAtt.length-1]); + }else{ + codeSet.add(codePath); + } + } + String demandName=""; +// String demandName=baseDao.selectCategoryNames(customerId,codeSet); + UserDemandNameQueryFormDTO userDemandNameQueryFormDTO=new UserDemandNameQueryFormDTO(); + userDemandNameQueryFormDTO.setCustomerId(customerId); + userDemandNameQueryFormDTO.setCodeSet(codeSet); + Result demandNameRes=heartOpenFeignClient.queryDemandNames(userDemandNameQueryFormDTO); + if(demandNameRes.success()){ + demandName=demandNameRes.getData(); + } + return demandName; + } + + /** + * 编辑页面,显示居民信息详情 + * + * @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; + } + + /** + * desc:动态查询 某表的所有字段值 + * @param customerId + * @param formCode + * @param resultTableName + * @param conditions + * @return + */ + @Override + public List> dynamicQuery(String customerId, + String formCode, + String resultTableName, + List conditions, + String currentStaffAgencyId, + String staffOrgPath){ + 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,currentStaffAgencyId,staffOrgPath); + } + + /** + * @Description 查询个人数据 + * @param formDTO + * @author zxc + * @date 2021/11/3 9:21 上午 + */ + @Override + public PersonDataResultDTO personData(PersonDataFormDTO formDTO) { + PersonDataResultDTO personData = baseDao.personData(formDTO.getUserId()); + if (null == personData){ + return new PersonDataResultDTO(); + } + // 房屋信息查询 + Result> listResult = govOrgOpenFeignClient.selectHouseInfoByIdCard(personData.getIdCard()); + if (!listResult.success()){ + throw new RenException("查询房屋信息失败"); + } + personData.setHouseInfo(listResult.getData()); + + // 志愿者处理 + if (personData.getIsVolunteer().equals(NumConstant.ONE_STR)){ + List volunteerList = baseDao.selectVolunteerByUserId(formDTO.getUserId()); + if (!CollectionUtils.isEmpty(volunteerList)){ + List volunteers = new ArrayList<>(); + List finalVolunteers = volunteers; + volunteerList.forEach(v -> { + List collect = Arrays.stream(v.split(",")).collect(Collectors.toList()); + finalVolunteers.addAll(collect); + }); + volunteers = volunteers.stream().distinct().collect(Collectors.toList()); + // 去customize 查询志愿者类别 + Result> volunteerResult = operCustomizeOpenFeignClient.volunteerLabelByValues(volunteers, personData.getCustomerId()); + if (!volunteerResult.success()){ + throw new RenException("查询志愿者类别失败..."); + } + personData.setVolunteerCategory(volunteerResult.getData()); + } + } + // 网格名 + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(personData.getGridId()); + if (null != gridInfo){ + personData.setGridName(gridInfo.getGridNamePath()); + } + /** + * 人员类别 + * 先查询customize配置的 + * 再根据配置去查询字段 + */ + IcResiCategoryStatsConfigDTO dto = new IcResiCategoryStatsConfigDTO(); + dto.setCustomerId(personData.getCustomerId()); + Result> categoryListResult = operCustomizeOpenFeignClient.getCategoryList(dto); + if (!categoryListResult.success()){ + throw new RenException("查询客户下的人员类别失败..."); + } + List categoryData = categoryListResult.getData(); + if (!CollectionUtils.isEmpty(categoryData)){ + Map> groupByStatus = categoryData.stream().collect(Collectors.groupingBy(IcResiCategoryStatsConfigDTO::getStatus)); + List showList = groupByStatus.get(IcPlatformConstant.PERSON_CATEGORY_SHOW); + List personCategoryList = new ArrayList<>(); + if (!CollectionUtils.isEmpty(showList)){ + Map> groupByTableName = showList.stream().collect(Collectors.groupingBy(IcResiCategoryStatsConfigDTO::getTableName)); + groupByTableName.forEach((tableName,list) -> { + List columns = list.stream().map(IcResiCategoryStatsConfigDTO::getColumnName).collect(Collectors.toList()); + Map result = baseDao.selectPersonType(columns, personData.getCustomerId(), tableName,formDTO.getUserId()); + list.forEach(l -> { + result.forEach((k,v) -> { + if (l.getColumnName().equals(k) && v.equals(NumConstant.ONE_STR)){ + personCategoryList.add(l.getLabel()); + } + }); + }); + }); + personData.setPersonCategory(personCategoryList); + } + } + return personData; + } + + /** + * @Description 根据名字搜索 + * @param formDTO + * @param tokenDto + * @author zxc + * @date 2021/11/3 1:42 下午 + */ + @Override + public PageData 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(); + if (CollectionUtils.isEmpty(result)){ + return new PageData<>(new ArrayList<>(), pageInfo.getTotal()); + } + // 查询小区,楼号,网格 + Result> gridResult = govOrgOpenFeignClient.getGridListByGridIds(result.stream().map(SearchByNameResultDTO::getGridId).collect(Collectors.toList())); + if (!gridResult.success()) { + throw new RenException(gridResult.getCode(),gridResult.getMsg()); + } + Map gridMap = gridResult.getData().stream().collect(Collectors.toMap(AllGridsByUserIdResultDTO::getGridId, AllGridsByUserIdResultDTO::getGridName)); + Result> neighborHoodResult = govOrgOpenFeignClient.getListByIds(result.stream().map(SearchByNameResultDTO::getNeighborHoodId).collect(Collectors.toList())); + if (!neighborHoodResult.success()) { + throw new RenException(neighborHoodResult.getCode(),neighborHoodResult.getMsg()); + } + Map neighborHoodMap = neighborHoodResult.getData().stream().collect(Collectors.toMap(IcNeighborHoodDTO::getId, IcNeighborHoodDTO::getNeighborHoodName)); + Result> buildResult = govOrgOpenFeignClient.buildingListByIds(result.stream().map(SearchByNameResultDTO::getBuildId).collect(Collectors.toList())); + if (!buildResult.success()) { + throw new RenException(buildResult.getCode(),buildResult.getMsg()); + } + Map buildMap = buildResult.getData().stream().collect(Collectors.toMap(BuildingResultDTO::getBuildingId, BuildingResultDTO::getBuildingName)); + + result.forEach(item -> { + item.setGridName(gridMap.get(item.getGridId())); + item.setNeighborHoodName(neighborHoodMap.get(item.getNeighborHoodId())); + item.setBuildNum(buildMap.get(item.getBuildId())); + }); + + return new PageData<>(result, pageInfo.getTotal()); + } + + /** + * desc:条件导出 + * + * + * @param formItemMap key 表名 value formItem + * @param baseTableName + * @return + */ + @Override + public List> getDataForExport(ExportResiUserItemDTO formItemMap, String baseTableName, IcResiUserPageFormDTO pageFormDTO, + String currentStaffAgencyId, + String staffOrgPath) { + Page> mapListPage = PageHelper.startPage(pageFormDTO.getPageNo(), pageFormDTO.getPageSize(), pageFormDTO.getPageFlag()).doSelectPage(() -> { + this.dynamicQuery(pageFormDTO.getCustomerId(), pageFormDTO.getFormCode(), baseTableName, pageFormDTO.getConditions(), currentStaffAgencyId, staffOrgPath); + }); + mapListPage.getResult().stream().filter(Objects::nonNull).forEach(resiUser -> { + String resiId = null; + //获取用户Id + if (IcResiUserConstant.IC_RESI_USER.equals(baseTableName)) { + resiId = (String) resiUser.get("ID"); + }else { + resiId = (String) resiUser.get(UserConstant.IC_RESI_USER); + } + if (StringUtils.isBlank(resiId)){ + log.error("getDataForExport error,resiId is net exist:{}",resiUser); + return; + } + + //遍历所有字段 格式化时间字段 + resiUser.forEach((k,o) -> { + if (o instanceof java.sql.Date){ + o = DateUtils.format(((Date) o),DateUtils.DATE_PATTERN); + }else if (o instanceof java.sql.Timestamp){ + o = DateUtils.format(new Date(((Timestamp) o).getTime()),DateUtils.DATE_TIME_PATTERN); + } + resiUser.put(k,o); + }); + + //当前条数据原始的id值 resiUser + Map originalConditionMap = new HashMap<>(); + for (FormItemResult e : formItemMap.getItemMap().values()) { + String columnName = getColumnName(e); + Object temp = resiUser.get(columnName); + String vauleStr = temp == null ? StrConstant.EPMETY_STR : temp.toString(); + originalConditionMap.putIfAbsent(columnName,vauleStr); + if ("remote".equals(e.getOptionSourceType()) && StringUtils.isNotBlank(vauleStr)) { + putRemoteValue(formItemMap.getRemoteItemConditionMap().get(e.getItemId()), currentStaffAgencyId, resiUser,originalConditionMap, e, columnName, vauleStr); + } else { + putOptionValue(resiUser, e, columnName, vauleStr); + } + + } + if (!IcResiUserConstant.IC_RESI_USER.equals(baseTableName)) { + Map o = redisUtils.hGetAll(RedisKeys.getExportResiBaseInfoKey(resiId)); + if (o != null){ + resiUser.putAll(o); + } + return; + } + //把人放入redis缓存 便于后面的sheet使用基础信息 + redisUtils.hMSet(RedisKeys.getExportResiBaseInfoKey(resiId),resiUser,RedisUtils.MINUTE_THIRTY_EXPIRE); + }); + remoteOptionCacheMap.clear(); + return mapListPage.getResult(); + } + + /** + * key:itemId,value: key:columnName,中文 + */ + private static Map> remoteOptionCacheMap = new HashMap<>(); + private void putRemoteValue(Set conditionItemSet, String currentStaffAgencyId, Map map, Map originalConditionMap, FormItemResult e, String columnName, String vauleStr) { + try { + Map columnWrappers = new HashMap<>(); + if (e.getOptionSourceValue().contains(StrConstant.QUESTION_MARK)){ + for (FormItemResult o : conditionItemSet) { + String column = getColumnName(o); + Object conditionValue = originalConditionMap.getOrDefault(column, map.get(column)); + originalConditionMap.putIfAbsent(column,conditionValue.toString()); + IcResiUserImportServiceImpl.ColumnWrapper value = new IcResiUserImportServiceImpl.ColumnWrapper(); + value.setColValue(conditionValue.toString()); + columnWrappers.put(o.getItemId(), value); + } + } + /*if (e.getItemId().equals("1078")) { + IcResiUserImportServiceImpl.ColumnWrapper value = new IcResiUserImportServiceImpl.ColumnWrapper(); + value.setColValue(gridId.toString()); + columnWrappers.put("1001", value); + }else if (e.getOptionSourceValue().contains(StrConstant.QUESTION_MARK)){ + continue; + }*/ + Cache cache = remoteOptionCacheMap.getOrDefault(e.getItemId(), CacheBuilder.newBuilder().maximumSize(NumConstant.FIVE_HUNDRED).build()); + remoteOptionCacheMap.putIfAbsent(e.getItemId(),cache); + String cacheValue = cache.getIfPresent(vauleStr); + if (StringUtils.isNotBlank(cacheValue)){ + map.put(columnName,cacheValue); + } else { + Map remoteOptions = icResiUserImportService.listRemoteOptions(columnWrappers, e.getOptionSourceValue(), currentStaffAgencyId, "query"); + if (FormItemTypeEnum.CHECKBOX.getCode().equals(e.getItemType())) { + remoteOptions.forEach((label, value) -> map.put(value, vauleStr.contains(value) ? "是" : "否")); + } else if (FormItemTypeEnum.SELECT.getCode().equals(e.getItemType())) { + remoteOptions.forEach((label, value) -> { + if (vauleStr.equals(value)) { + map.put(columnName, label); + } + cache.put(value,label); + }); + } + } + } catch (Exception ex) { + log.warn("listRemoteOptions url:{}", e.getOptionSourceValue()); + } + } + + private void putOptionValue(Map map, FormItemResult e, String columnName, String vauleStr) { + FormItemTypeEnum itemTypeEnum = FormItemTypeEnum.getEnum(e.getItemType()); + switch (itemTypeEnum) { + case CHECKBOX: + e.getOptions().forEach(optionDTO -> { + map.put(optionDTO.getValue(), vauleStr.contains(optionDTO.getValue()) ? "是" : "否"); + }); + break; + case SELECT: + case RADIO: + e.getOptions().forEach(optionDTO -> { + if (optionDTO.getValue().equals(vauleStr)) { + map.put(columnName, optionDTO.getLabel()); + } + }); + break; + default: + } + } + + private String getColumnName(FormItemResult e) { + return e.getColumnNum() == NumConstant.ZERO? e.getColumnName():e.getColumnName().concat(e.getColumnNum().toString()); + } + + /** + * @param userId + * @Description 家庭关系 + * @Param userId + * @Return {@link OwnerRelationResultDTO} + * @Author zhaoqifeng + * @Date 2021/11/5 10:28 + */ + @Override + public OwnerRelationResultDTO getOwnerRelation(String userId) { + OwnerRelationResultDTO result = new OwnerRelationResultDTO(); + //获取用户信息 + IcResiUserEntity user = baseDao.selectById(userId); + + //获取用户所在家庭的户主 + Result houseResult = govOrgOpenFeignClient.get(user.getHomeId()); + if (!houseResult.success()) { + throw new RenException(houseResult.getCode(),houseResult.getMsg()); + } + result.setOwnerName(houseResult.getData().getOwnerName()); + + //获取用户所在家庭里所有人员信息 + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcResiUserEntity::getHomeId, user.getHomeId()); + wrapper.orderByAsc(IcResiUserEntity::getYhzgx); + List resiUserList = baseDao.selectList(wrapper); + List userList = resiUserList.stream().map(item -> { + OwnerRelationResultDTO.UserListBean bean = new OwnerRelationResultDTO.UserListBean(); + bean.setUserId(item.getId()); + bean.setUserName(item.getName()); + bean.setRelation(RelationshipEnum.getEnum(item.getYhzgx()).getName()); + if (userId.equals(item.getId())) { + bean.setIsSelf(NumConstant.ONE_STR); + } + return bean; + }).collect(Collectors.toList()); + result.setUserList(userList); + return result; + } + + /** + * @param buildId + * @Description 获取一栋楼每个房间人员分类的数量 + * @Param buildId + * @Return {@link Map>} + * @Author zhaoqifeng + * @Date 2021/11/5 14:40 + */ + @Override + public Map> getHomeUserCategoryCount(String buildId) { + return baseDao.getHomeUserCategoryCount(buildId); + } + + /** + * 根据formCode查询该form的item列表 + * + * @param customerId + * @param formCode + * @return + */ + @Override + public List listFormItems(String customerId, String formCode) { + CustomerFormQueryDTO form = new CustomerFormQueryDTO(); + form.setFormCode(formCode); + form.setCustomerId(customerId); + Result> result = operCustomizeOpenFeignClient.listItems(form); + return getResultDataOrThrowsException(result, ServiceConstant.OPER_CUSTOMIZE_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "查询表单相关信息失败", null); + } +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcStatsResiWarnServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcStatsResiWarnServiceImpl.java new file mode 100644 index 0000000000..6d17d804ca --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcStatsResiWarnServiceImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.IcStatsResiWarnDao; +import com.epmet.dto.IcStatsResiWarnDTO; +import com.epmet.entity.IcStatsResiWarnEntity; +import com.epmet.redis.IcStatsResiWarnRedis; +import com.epmet.service.IcStatsResiWarnService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 预警统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +@Service +public class IcStatsResiWarnServiceImpl extends BaseServiceImpl implements IcStatsResiWarnService { + + @Autowired + private IcStatsResiWarnRedis icStatsResiWarnRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcStatsResiWarnDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcStatsResiWarnDTO.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 IcStatsResiWarnDTO get(String id) { + IcStatsResiWarnEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcStatsResiWarnDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcStatsResiWarnDTO dto) { + IcStatsResiWarnEntity entity = ConvertUtils.sourceToTarget(dto, IcStatsResiWarnEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcStatsResiWarnDTO dto) { + IcStatsResiWarnEntity entity = ConvertUtils.sourceToTarget(dto, IcStatsResiWarnEntity.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-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsResiWarnServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsResiWarnServiceImpl.java new file mode 100644 index 0000000000..3b12bcd10d --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsResiWarnServiceImpl.java @@ -0,0 +1,304 @@ +package com.epmet.service.impl; + +import com.alibaba.fastjson.JSON; +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.commons.tools.utils.Result; +import com.epmet.dao.IcResiUserDao; +import com.epmet.dao.IcStatsResiWarnDao; +import com.epmet.dto.IcResiCategoryStatsConfigDTO; +import com.epmet.dto.IcResiCategoryWarnConfigDTO; +import com.epmet.dto.form.IcResiCategoryStatsConfigFormDTO; +import com.epmet.dto.result.*; +import com.epmet.entity.IcResiUserEntity; +import com.epmet.entity.IcStatsResiWarnEntity; +import com.epmet.feign.GovOrgOpenFeignClient; +import com.epmet.feign.OperCustomizeOpenFeignClient; +import com.epmet.service.IcStatsResiWarnService; +import com.epmet.service.StatsResiWarnService; +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 java.util.*; +import java.util.function.Function; +import java.util.stream.Collectors; + +@Slf4j +@Service +public class StatsResiWarnServiceImpl implements StatsResiWarnService { + @Resource + private IcStatsResiWarnDao icStatsResiWarnDao; + + @Autowired + private IcStatsResiWarnService icStatsResiWarnService; + + @Autowired + private GovOrgOpenFeignClient govOrgOpenFeignClient; + + @Autowired + private OperCustomizeOpenFeignClient operCustomizeOpenFeignClient; + + @Resource + private IcResiUserDao icResiUserDao; + + @Override + public List buildingwWarnList(String customerId,String agencyID) { + List result = new ArrayList<>(); + //feign 获取当前配置类别列表 + Result> statsResult = operCustomizeOpenFeignClient.resiCategoryStatsListShowd(new IcResiCategoryStatsConfigFormDTO()); + if (!statsResult.success() || null == statsResult.getData()) { + throw new RenException("配置类别查询失败:"+ statsResult.getMsg()); + } + List icResiCategoryStatsConfigDTOList = statsResult.getData(); + //feign获取当前需要预警的配置信息以及阈值 + Result> warnResult = operCustomizeOpenFeignClient.resiCategoryWarnList(customerId); + + if (!warnResult.success() || null == warnResult.getData()) { + throw new RenException("预警配置查询失败:"+ warnResult.getMsg()); + } + List icResiCategoryWarnConfigDTOList = warnResult.getData(); + + if(CollectionUtils.isEmpty(icResiCategoryWarnConfigDTOList )){ + return result; + } + result = icResiCategoryWarnConfigDTOList.stream().map(item -> { + IcStatsResiWarnBuildingResultDTO resiWarnBuildingResultDTO = new IcStatsResiWarnBuildingResultDTO(); + resiWarnBuildingResultDTO.setConfigId(item.getId()); + resiWarnBuildingResultDTO.setLabel(item.getLabel()); + resiWarnBuildingResultDTO.setLevel1(item.getLevel1()); + resiWarnBuildingResultDTO.setLevel2(item.getLevel2()); + resiWarnBuildingResultDTO.setLevel3(item.getLevel3()); + resiWarnBuildingResultDTO.setSort(item.getSort()); + resiWarnBuildingResultDTO.setLevelCount1(0); + resiWarnBuildingResultDTO.setLevelCount2(0); + resiWarnBuildingResultDTO.setLevelCount3(0); + resiWarnBuildingResultDTO.setCount(0); + resiWarnBuildingResultDTO.setBuildingIdList1(new ArrayList<>()); + resiWarnBuildingResultDTO.setBuildingIdList2(new ArrayList<>()); + resiWarnBuildingResultDTO.setBuildingIdList3(new ArrayList<>()); + + + //获取各类别数量 + List collect = icResiCategoryStatsConfigDTOList.stream().filter(i -> i.getTableName().equals(item.getTableName()) && i.getColumnName().equals(item.getColumnName())).collect(Collectors.toList()); + if(!CollectionUtils.isEmpty(collect)){ + resiWarnBuildingResultDTO.setManagementIcon(collect.get(0).getManagementIcon()); + resiWarnBuildingResultDTO.setDataIcon(collect.get(0).getDataIcon()); + resiWarnBuildingResultDTO.setHouseShowIcon(collect.get(0).getHouseShowIcon()); + } + + return resiWarnBuildingResultDTO; + }).collect(Collectors.toList()); + //统计数量 + List icStatsResiWarnEntityList = icStatsResiWarnDao.selectResiWarnByAgencyId(customerId,agencyID); + if(CollectionUtils.isEmpty(icStatsResiWarnEntityList )){ + return result; + } + Map warnResultMap = result.stream().collect(Collectors.toMap(IcStatsResiWarnBuildingResultDTO::getConfigId, Function.identity(),(k1, k2)->k1)); + for (IcStatsResiWarnEntity item : icStatsResiWarnEntityList) { + IcStatsResiWarnBuildingResultDTO resiWarnBuildingResultDTO = warnResultMap.get(item.getConfigId()); + + if(null == resiWarnBuildingResultDTO){ + continue; + } + //每栋楼的数量 + Integer count = Optional.ofNullable(item.getCount()).orElse(0); + + //判断数量 + Integer levle1= resiWarnBuildingResultDTO.getLevel1(); + Integer levle2= resiWarnBuildingResultDTO.getLevel2(); + Integer levle3= resiWarnBuildingResultDTO.getLevel3(); + resiWarnBuildingResultDTO.setCount(resiWarnBuildingResultDTO.getCount()+count); + if(0 == count){ + continue; + } + if(null!=levle2 && count>levle2){ + resiWarnBuildingResultDTO.setLevelCount2(resiWarnBuildingResultDTO.getLevelCount2()+1); + resiWarnBuildingResultDTO.getBuildingIdList2().add(item.getBuildingId()); + } + if(null!=levle1 && null!=levle2 && count<=levle2 && count>=levle1){ + resiWarnBuildingResultDTO.setLevelCount1(resiWarnBuildingResultDTO.getLevelCount1()+1); + resiWarnBuildingResultDTO.getBuildingIdList1().add(item.getBuildingId()); + } + + } + return result; + + } + + @Override + public Map userWarnList(String customerId,String configId, List buildingIdList,Integer pageNo,Integer pageSize) { + //feign根据buildingIdList 获取网格,小区,楼宇 信息 + Result buildingPageList = govOrgOpenFeignClient.buildinglistbyidsPage(buildingIdList,pageNo,pageSize); + if (!buildingPageList.success() || null == buildingPageList.getData()) { + throw new RenException("楼宇信息查询失败,buildingList="+ JSON.toJSONString(buildingIdList)); + } + BuildingResultPagedDTO pageData = buildingPageList.getData(); + List buildingResultDTOList = pageData.getList(); + List result = ConvertUtils.sourceToTarget(buildingResultDTOList,IcStatsResiWarnUserResultDTO.class); + Map mapResult = new HashMap<>(); + mapResult.put("total",pageData.getTotal()); + mapResult.put("list",result); + if(CollectionUtils.isEmpty(result)){ + return mapResult; + } + //获取configId预警配置信息 + IcResiCategoryWarnConfigDTO formDto = new IcResiCategoryWarnConfigDTO(); + formDto.setId(configId); + Result warnResult = operCustomizeOpenFeignClient.resiCategoryWarnInfoById(formDto); + if (!warnResult.success() || null == warnResult.getData()) { + throw new RenException("获取预警配置信息失败,configId="+ configId); + } + IcResiCategoryWarnConfigDTO icResiCategoryWarnConfigDTO = warnResult.getData(); + + //根据buildingID,tableName he columnName获取名字 + List> maps = icStatsResiWarnDao.userWarnList(customerId,buildingIdList, icResiCategoryWarnConfigDTO.getTableName(), icResiCategoryWarnConfigDTO.getColumnName()); + result.forEach(item->{ + item.setConfigId(configId); + List> buildingIds = maps.stream().filter(map -> item.getBuildingId().equals(map.get("buildingId"))).collect(Collectors.toList()); + item.setResidentNames(CollectionUtils.isEmpty(buildingIds)?"":buildingIds.get(0).get("residentNames")); + }); + + return mapResult; + } + + @Override + public List list(String customerId,String id, String level) { + //获取所有配置类项 getshow + IcResiCategoryStatsConfigFormDTO dto = new IcResiCategoryStatsConfigFormDTO(); + dto.setStatus("show"); + Result> statsResult = operCustomizeOpenFeignClient.resiCategoryStatsListShowd(dto); + if (!statsResult.success() || null == statsResult.getData()) { + throw new RenException("获取配置类项失败"); + } + List icResiCategoryStatsConfigDTOList = statsResult.getData(); + //获取tableName 和columnName + List result = new ArrayList<>(); + icResiCategoryStatsConfigDTOList.forEach(item->{ + IcStatsResiResultDTO resultDTO = new IcStatsResiResultDTO(); + resultDTO.setId(item.getId()); + resultDTO.setLabel(item.getLabel()); + resultDTO.setDataIcon(item.getDataIcon()); + resultDTO.setHouseShowIcon(item.getHouseShowIcon()); + resultDTO.setManagementIcon(item.getManagementIcon()); + //根据id ,level 获取count + Integer count = icStatsResiWarnDao.countListByLevelAndCol(customerId,item.getTableName(),item.getColumnName(),id,level); + resultDTO.setCount(count); + result.add(resultDTO); + }); + return result; + } + + /** + * 统计 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void resiWarn(String customerId) { + // 获取预警配置项 + Result> warnResult = operCustomizeOpenFeignClient.resiCategoryWarnList(customerId); + if (!warnResult.success() || null == warnResult.getData()) { + throw new RenException("预警配置查询失败:"+ warnResult.getMsg()); + } + List icResiCategoryWarnConfigDTOList = warnResult.getData(); + + //保存数据 + List icStatsResiWarnEntities = new ArrayList<>(); + for (IcResiCategoryWarnConfigDTO item : icResiCategoryWarnConfigDTOList) { + icStatsResiWarnDao.delete(new QueryWrapper().lambda().eq(IcStatsResiWarnEntity::getConfigId,item.getId()).eq(IcStatsResiWarnEntity::getCustomerId,customerId)); + + + List maps = icStatsResiWarnDao.resiWarn(customerId,item.getTableName(), item.getColumnName()); + if(CollectionUtils.isEmpty(maps)){ + continue; + } + + maps.forEach(map->{ + IcStatsResiWarnEntity icStatsResiWarnEntity = new IcStatsResiWarnEntity(); + icStatsResiWarnEntity.setAgencyId(map.getAgencyId()); + icStatsResiWarnEntity.setAgencyPids(map.getAgencyPids()); + icStatsResiWarnEntity.setBuildingId(map.getBuildingId()); + icStatsResiWarnEntity.setConfigId(item.getId()); + icStatsResiWarnEntity.setCount(map.getCount()); + icStatsResiWarnEntity.setCustomerId(customerId); + icStatsResiWarnEntity.setGridId(map.getGridId()); + icStatsResiWarnEntity.setNeighborHoodId(map.getNeighborHoodId()); + icStatsResiWarnEntities.add(icStatsResiWarnEntity); + }); + + } + icStatsResiWarnService.insertBatch(icStatsResiWarnEntities,500); + + } + + @Override + public void resiWarnByOne(String customerId, String userId) { + // 获取预警配置项 + Result> warnResult = operCustomizeOpenFeignClient.resiCategoryWarnList(customerId); + if (!warnResult.success() || null == warnResult.getData()) { + throw new RenException("预警配置查询失败:"+ warnResult.getMsg()); + } + List icResiCategoryWarnConfigDTOList = warnResult.getData(); + + IcResiUserEntity icResiUserEntity = icResiUserDao.selectById(userId); + if(null == icResiUserEntity){ + return ; + } + IcStatsResiWarnEntity query = new IcStatsResiWarnEntity(); + query.setAgencyId(icResiUserEntity.getAgencyId()); + query.setGridId(icResiUserEntity.getGridId()); + query.setNeighborHoodId(icResiUserEntity.getVillageId()); + query.setBuildingId(icResiUserEntity.getBuildId()); + + //保存数据 + for (IcResiCategoryWarnConfigDTO item : icResiCategoryWarnConfigDTOList) { + //查询这个用户信息 + + IcStatsResiWarnEntity icStatsResiWarn = icStatsResiWarnDao.selectOne(new QueryWrapper().lambda() + .eq(IcStatsResiWarnEntity::getConfigId,item.getId()) + .eq(IcStatsResiWarnEntity::getCustomerId,customerId) + .eq(IcStatsResiWarnEntity::getAgencyId, icResiUserEntity.getAgencyId()) + .eq(IcStatsResiWarnEntity::getGridId, icResiUserEntity.getGridId()) + .eq(IcStatsResiWarnEntity::getNeighborHoodId, icResiUserEntity.getVillageId()) + .eq(IcStatsResiWarnEntity::getBuildingId, icResiUserEntity.getBuildId())); + //统计数量 + IcStatsResiWarnEntity resiWarnEntity = icStatsResiWarnDao.resiWarnById(customerId,item.getTableName(), item.getColumnName(),query); + if(null == icStatsResiWarn){ + //如果不存在,新增统计数量 + icStatsResiWarn = new IcStatsResiWarnEntity(); + icStatsResiWarn.setAgencyId(icResiUserEntity.getAgencyId()); + icStatsResiWarn.setAgencyPids(icResiUserEntity.getPids()); + icStatsResiWarn.setGridId(icResiUserEntity.getGridId()); + icStatsResiWarn.setNeighborHoodId(icResiUserEntity.getVillageId()); + icStatsResiWarn.setBuildingId(icResiUserEntity.getBuildId()); + icStatsResiWarn.setConfigId(item.getId()); + icStatsResiWarn.setCustomerId(customerId); + + if(null == resiWarnEntity){ + icStatsResiWarn.setCount(0); + }else{ + icStatsResiWarn.setCount(resiWarnEntity.getCount()); + } + icStatsResiWarnDao.insert(icStatsResiWarn); + }else{ + //如果存在,更新统计数量 + if(null == resiWarnEntity){ + icStatsResiWarn.setCount(0); + }else{ + icStatsResiWarn.setCount(resiWarnEntity.getCount()); + } + icStatsResiWarn.setCustomerId(customerId); + icStatsResiWarnDao.updateById(icStatsResiWarn); + + } + + + } + } + + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsStaffPatrolRecordDailyServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsStaffPatrolRecordDailyServiceImpl.java index 4d2913cd43..03467b2c30 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsStaffPatrolRecordDailyServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsStaffPatrolRecordDailyServiceImpl.java @@ -47,6 +47,9 @@ public class StatsStaffPatrolRecordDailyServiceImpl extends BaseServiceImpl - + 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..5f23694620 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml @@ -0,0 +1,287 @@ + + + + + + + insert into ${tableName} + ( + + ${key} + + ,DEL_FLAG + ,REVISION + ,CREATED_TIME + ,UPDATED_TIME + ) values + ( + + #{value} + + ,'0' + ,'0' + ,NOW() + ,NOW() + ) + + + + UPDATE ${tableName} + SET + + ${key} = #{value} + + ,UPDATED_TIME = NOW() + WHERE id = #{id} + + + + + + + + + + ic_resi_user.DEL_FLAG = '0' + + + AND ${resultTableName}.ID IS NOT NULL + + and ic_resi_user.customer_id=#{customerId} + and (ic_resi_user.AGENCY_ID =#{currentStaffAgencyId} or ic_resi_user.pids like concat(#{staffOrgPath},'%')) + + + + + + + and ${subCondition.tableName}.${subCondition.columnName} = #{subCondition.columnValue[0]} + + + + + + and ${subCondition.tableName}.${subCondition.columnName} like concat('%',#{subCondition.columnValue[0]},'%') + + + + + and ${subCondition.tableName}.${subCondition.columnName} between #{subCondition.columnValue[0]} and #{subCondition.columnValue[1]} + + + + + + + + + ic_resi_user.DEL_FLAG = '0' + and ic_resi_user.customer_id=#{customerId} + + + + + + + and ${subCondition.tableName}.${subCondition.columnName} = #{subCondition.columnValue[0]} + + + + + + and ${subCondition.tableName}.${subCondition.columnName} like concat('%',#{subCondition.columnValue[0]},'%') + + + + + and ${subCondition.tableName}.${subCondition.columnName} between #{subCondition.columnValue[0]} and #{subCondition.columnValue[1]} + + + + + + + + + + + update ic_resi_user set del_flag='1' where id=#{icResiUserId} + + + + update ${subTalbeName} set del_flag='1' where IC_RESI_USER=#{icResiUserId} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcStatsResiWarnDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcStatsResiWarnDao.xml new file mode 100644 index 0000000000..4a4a2a6cc3 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcStatsResiWarnDao.xml @@ -0,0 +1,134 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/test/java/com/epmet/epmetuser/test/IcResiUserControllerTest.java b/epmet-user/epmet-user-server/src/test/java/com/epmet/epmetuser/test/IcResiUserControllerTest.java new file mode 100644 index 0000000000..4bf7b1c16c --- /dev/null +++ b/epmet-user/epmet-user-server/src/test/java/com/epmet/epmetuser/test/IcResiUserControllerTest.java @@ -0,0 +1,183 @@ +package com.epmet.epmetuser.test; + +import cn.afterturn.easypoi.excel.entity.ExportParams; +import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity; +import cn.afterturn.easypoi.excel.export.ExcelExportService; +import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.CustomerFormQueryDTO; +import com.epmet.dto.result.CustomerFormResultDTO; +import com.epmet.dto.result.FormGroupDTO; +import com.epmet.dto.result.FormItemResult; +import com.epmet.feign.OperCustomizeOpenFeignClient; +import org.apache.commons.lang3.StringUtils; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import org.jetbrains.annotations.NotNull; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.web.bind.annotation.RequestParam; + +import java.io.FileOutputStream; +import java.util.*; + +@SpringBootTest +@RunWith(SpringRunner.class) +public class IcResiUserControllerTest { + private static final String BASE_TABLE_NAME = "BASE_TABLE_NAME"; + @Autowired + private OperCustomizeOpenFeignClient operCustomizeOpenFeignClient; + + @Test + public void downloadTemplate(@RequestParam String customerId) throws Exception { + CustomerFormResultDTO resultForm = getResiFormItems(customerId); + + XSSFWorkbook workbook = new XSSFWorkbook(); + Map> sheetHeaderMap = buildHeaderByItem(resultForm); + //Workbook workbook = null; + for (Map.Entry> entry : sheetHeaderMap.entrySet()) { + String sheetName = entry.getKey(); + List headers = entry.getValue(); + System.out.println("headers:"+sheetName+JSON.toJSONString(headers)); + ExportParams exportParams = new ExportParams(null,sheetName); + //exportParams.setAutoSize(true); + List> dataSet = new ArrayList<>(); + HashMap map = new HashMap<>(); + map.put("1","2"); + dataSet.add(map); + new ExcelExportService().createSheetForMap(workbook, exportParams, headers, dataSet); + } + + FileOutputStream fos = new FileOutputStream("//Users/liujianjun/Downloads/基础信息表/Dow.tt.xls"); + workbook.write(fos); + fos.close(); + } + + @NotNull + private CustomerFormResultDTO getResiFormItems(String customerId) { + CustomerFormQueryDTO queryDTO = new CustomerFormQueryDTO(); + queryDTO.setFormCode("resi_base_info"); + queryDTO.setCustomerId(customerId); + Result resultForm = operCustomizeOpenFeignClient.getCustomerForm(queryDTO); + if (resultForm == null || !resultForm.success() ||resultForm.getData() == null){ + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } + System.out.println(JSON.toJSONString(resultForm.getData())); + return resultForm.getData(); + } + + @NotNull + private Map> buildHeaderByItem(CustomerFormResultDTO resultForm) { + //form中的itemlist 为一级表头 但是要排除每个item中含有childGroup的 + + List itemList = resultForm.getItemList(); + List groupList = resultForm.getGroupList(); + + Map> everySheetHeaderMap = new LinkedHashMap<>(); + + List firstSheetHeaderList = new ArrayList<>(); + //Map groupNameMap = groupList.stream().collect(Collectors.toMap(FormGroupDTO::getGroupId,FormGroupDTO::getLabel)); + itemList.forEach(item->{ + if (StringUtils.isBlank(item.getColumnName())){ + return; + } + + if (item.getChildGroup() == null){ + ExcelExportEntity header = new ExcelExportEntity(item.getLabel(),item.getColumnName().concat(String.valueOf(item.getColumnNum())),30); + header.setNeedMerge(true); + firstSheetHeaderList.add(header); + return; + } + everySheetHeaderMap.putIfAbsent(resultForm.getFormName(),firstSheetHeaderList); + + //这些是动态的 formGroup + if (item.getChildGroup() != null){ + //baseTableName单独的一个sheet + System.out.println("childGroup:"+item.getLabel()); + if (BASE_TABLE_NAME.equals(item.getTableName())){ + List otherSheetHeaderList = new ArrayList<>(); + //这里是设置除基础信息之外的sheet的表头 + item.getChildGroup().getItemList().forEach(item2->{ + if (!BASE_TABLE_NAME.equals(item2.getTableName())){ + everySheetHeaderMap.putIfAbsent(item.getLabel(),otherSheetHeaderList); + } + ExcelExportEntity secondHeader = new ExcelExportEntity(item2.getLabel(),item2.getColumnName().concat(String.valueOf(item2.getColumnNum()))); + + otherSheetHeaderList.add(secondHeader); + if (!"radio".equals(item2.getItemType()) && CollectionUtils.isNotEmpty(item2.getOptions())){ + secondHeader.setNeedMerge(true); + List thirdHeaderList = new ArrayList<>(); + item2.getOptions().forEach(child->{ + ExcelExportEntity thirdHeader = new ExcelExportEntity(child.getLabel()); + thirdHeaderList.add(thirdHeader); + }); + secondHeader.setList(thirdHeaderList); + } + + }); + } + } + }); + groupList.forEach(item->{ + /* if (!"兴趣爱好".equals(item.getLabel()) && !"宗教信仰".equals(item.getLabel())){ + return; + }*/ + if (!BASE_TABLE_NAME.equals(item.getTableName())){ + return; + } + ExcelExportEntity header = new ExcelExportEntity(item.getLabel(),item.getTableName()); + header.setNeedMerge(true); + List secondHeaderList = new ArrayList<>(); + item.getItemList().forEach(item2->{ + ExcelExportEntity secondHeader = new ExcelExportEntity(item2.getLabel(),item2.getColumnName().concat(String.valueOf(item2.getColumnNum()))); + secondHeader.setNeedMerge(true); + secondHeaderList.add(secondHeader); + if (com.baomidou.mybatisplus.core.toolkit.CollectionUtils.isNotEmpty(item2.getOptions())){ + List thirdHeaderList = new ArrayList<>(); + item2.getOptions().forEach(child->{ + ExcelExportEntity thirdHeader = new ExcelExportEntity(child.getLabel(),child.getValue()+ new Random(1).nextInt(2)); + thirdHeader.setNeedMerge(true); + thirdHeaderList.add(thirdHeader); + }); + secondHeader.setList(thirdHeaderList); + } + + }); + header.setList(secondHeaderList); + firstSheetHeaderList.add(header); + System.out.println(JSON.toJSONString(firstSheetHeaderList)); + }); + return everySheetHeaderMap; + } + + private void buildHeader(Map> everySheetHeaderMap, FormItemResult item, ExcelExportEntity header) { + List firstSheetHeaderList = new ArrayList<>(); + List secondHeaderList = new ArrayList<>(); + item.getChildGroup().getItemList().forEach(item2->{ + if (!BASE_TABLE_NAME.equals(item2.getTableName())){ + everySheetHeaderMap.putIfAbsent(item.getLabel(),firstSheetHeaderList); + } + ExcelExportEntity secondHeader = new ExcelExportEntity(item2.getLabel(),item2.getColumnName().concat(String.valueOf(item2.getColumnNum()))); + secondHeader.setNeedMerge(true); + secondHeaderList.add(secondHeader); + if (CollectionUtils.isNotEmpty(item2.getOptions())){ + List thirdHeaderList = new ArrayList<>(); + item2.getOptions().forEach(child->{ + ExcelExportEntity thirdHeader = new ExcelExportEntity(child.getLabel()); + thirdHeaderList.add(thirdHeader); + }); + secondHeader.setList(thirdHeaderList); + } + + }); + header.setList(secondHeaderList); + firstSheetHeaderList.add(header); + everySheetHeaderMap.putIfAbsent(item.getLabel(),firstSheetHeaderList); + } + +} diff --git a/pom.xml b/pom.xml index 8e34094ca6..2a30af4cf9 100644 --- a/pom.xml +++ b/pom.xml @@ -97,6 +97,11 @@ + public aliyun nexus