diff --git a/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/epdc/DeptTreeWithTypeKeyDTO.java b/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/epdc/DeptTreeWithTypeKeyDTO.java new file mode 100644 index 00000000..5671ac17 --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/epdc/DeptTreeWithTypeKeyDTO.java @@ -0,0 +1,25 @@ +package com.elink.esua.epdc.dto.epdc; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author: songyunpeng + * @Date: 2019/12/13 14:02 + * @Description: 部门表树结构 + */ +@Data +public class DeptTreeWithTypeKeyDTO implements Serializable { + private static final long serialVersionUID = 7058545106715835343L; + + private Long id; + + private Long pid; + + private String name; + + private String typeKey; + + +} diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/SysDeptController.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/SysDeptController.java index 2a0f03e9..1fee39a9 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/SysDeptController.java +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/SysDeptController.java @@ -209,6 +209,17 @@ public class SysDeptController { public Result getDeptTree() { return sysDeptService.getDeptTree(); } + /*** + * 获取所有部门树 - 带typekey + * @param + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author qushutong + * @date 2019/12/13 15:25 + */ + @GetMapping("party/getDeptTreeWithTypeKey") + public Result getDeptTreeWithTypeKey() { + return sysDeptService.getDeptTreeWithTypeKey(); + } /** * @param diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/SysDeptDao.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/SysDeptDao.java index ceacc36f..90688ad8 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/SysDeptDao.java +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/SysDeptDao.java @@ -13,6 +13,7 @@ import com.elink.esua.epdc.dto.CompleteDeptDTO; import com.elink.esua.epdc.dto.DeptTreeDTO; import com.elink.esua.epdc.dto.SysDeptDTO; import com.elink.esua.epdc.dto.SysSimpleDeptDTO; +import com.elink.esua.epdc.dto.epdc.DeptTreeWithTypeKeyDTO; import com.elink.esua.epdc.dto.epdc.GridForLeaderRegisterDTO; import com.elink.esua.epdc.dto.epdc.form.UserSysDeptInfoFormDTO; import com.elink.esua.epdc.dto.epdc.result.UserSysDeptInfoResultDTO; @@ -145,6 +146,12 @@ public interface SysDeptDao extends BaseDao { * @Description: 查询所有 */ List selectListDeptTree(); + /** + * @author: qushutong + * @Date: 2019/12/13 14:17 + * @Description: 查询所有带typekey + */ + List selectListDeptTreeWithTypeKey(); /** * @param params diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/SysDeptService.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/SysDeptService.java index a28be70f..ae5168f9 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/SysDeptService.java +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/SysDeptService.java @@ -182,6 +182,15 @@ public interface SysDeptService extends BaseService { */ void packgeAllDeptOption(); + /*** + * 组装所有部门带typekey + * @param + * @return void + * @author qushutong + * @date 2019/12/13 13:54 + */ + void packgeAllDeptOptionWithTypeKey(); + /*** * 获取所有部门树 * @param @@ -190,6 +199,14 @@ public interface SysDeptService extends BaseService { * @date 2019/12/13 14:48 */ Result getDeptTree(); + /*** + * 获取所有部门树 - 携带type-key + * @param + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author songyunpeng + * @date 2019/12/13 14:48 + */ + Result getDeptTreeWithTypeKey(); /** * @param diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysDeptServiceImpl.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysDeptServiceImpl.java index cabde539..2fd53574 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysDeptServiceImpl.java +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysDeptServiceImpl.java @@ -29,6 +29,7 @@ import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.commons.tools.utils.TreeUtils; import com.elink.esua.epdc.dao.SysDeptDao; import com.elink.esua.epdc.dto.*; +import com.elink.esua.epdc.dto.epdc.DeptTreeWithTypeKeyDTO; import com.elink.esua.epdc.dto.epdc.GridForLeaderRegisterDTO; import com.elink.esua.epdc.dto.epdc.form.UserSysDeptInfoFormDTO; import com.elink.esua.epdc.dto.epdc.result.UserSysDeptInfoResultDTO; @@ -606,6 +607,62 @@ public class SysDeptServiceImpl extends BaseServiceImpl deptList = baseDao.selectListDeptTreeWithTypeKey(); + JSONObject node; + JSONArray headNodes = new JSONArray(); + for (DeptTreeWithTypeKeyDTO deptItemDto : deptList) { + if (deptItemDto.getPid().longValue() == NumConstant.ZERO_L) { + node = new JSONObject(); + node.put("value", deptItemDto.getId()); + node.put("label", deptItemDto.getName()); + node.put("typeKey", deptItemDto.getTypeKey()); + headNodes.add(node); + } + } + // 用于存放所有父级节点 + JSONArray parent; + parent = headNodes; + // 用于存放所有子级节点 + JSONArray allChildren = new JSONArray(); + JSONArray children; + // 用于存放单个子级节点 + JSONObject childNode; + // 存放其余未处理的类别(节点) + List others = this.getOtherDeptWithTypeKey(deptList, parent); + + while (!others.isEmpty()) { + for (int i = 0; i < parent.size(); i++) { + node = parent.getJSONObject(i); + children = new JSONArray(); + for (DeptTreeWithTypeKeyDTO categoryTreeDto : others) { + if (categoryTreeDto.getPid().equals(node.get("value"))) { + childNode = new JSONObject(); + childNode.put("value", categoryTreeDto.getId()); + childNode.put("label", categoryTreeDto.getName()); + childNode.put("typeKey", categoryTreeDto.getTypeKey()); + children.add(childNode); + allChildren.add(childNode); + } + } + if (!children.isEmpty()) { + node.put("children", children); + } + } + parent = allChildren; + + others = this.getOtherDeptWithTypeKey(others, parent); + + } + //存放到redis中 + List cache = Lists.newArrayList(); + cache.add(headNodes); + DeptOption option = new DeptOption(); + option.setOptions(cache.get(0)); + redisUtils.set(RedisKeys.getAllDeptOptionKeyWithTypeKey(), option); + } + List getOtherDept(List deptList, JSONArray parent) { List already = Lists.newArrayList(); @@ -623,6 +680,22 @@ public class SysDeptServiceImpl extends BaseServiceImpl getOtherDeptWithTypeKey(List deptList, JSONArray parent) { + List already = Lists.newArrayList(); + for (int i = 0; i < parent.size(); i++) { + already.add((Long) parent.getJSONObject(i).get("value")); + } + + List others = Lists.newArrayList(); + + for (DeptTreeWithTypeKeyDTO categoryTreeDto : deptList) { + Long categoryTreeDtoId = categoryTreeDto.getId(); + if (!already.contains(categoryTreeDtoId)) { + others.add(categoryTreeDto); + } + } + return others; + } /*** @@ -643,6 +716,17 @@ public class SysDeptServiceImpl extends BaseServiceImpl().ok((DeptOption) obj); } + @Override + public Result getDeptTreeWithTypeKey() { + String deptKey = RedisKeys.getAllDeptOptionKeyWithTypeKey(); + Object obj = redisUtils.get(deptKey); + if (null == obj) { + this.packgeAllDeptOptionWithTypeKey(); + obj = redisUtils.get(deptKey); + } + return new Result().ok((DeptOption) obj); + } + /** * @param * @return com.elink.esua.epdc.commons.tools.utils.Result diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/SysDeptDao.xml b/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/SysDeptDao.xml index 8601118f..b1000f4b 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/SysDeptDao.xml +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/SysDeptDao.xml @@ -252,4 +252,15 @@ where sd.del_flag='0' and sd.type_key in ('district_party','street_party','street_dept') + diff --git a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/Constant.java b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/Constant.java index 8091e94f..8e432560 100644 --- a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/Constant.java +++ b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/Constant.java @@ -119,4 +119,14 @@ public interface Constant { * 动作记录时机 后 */ String BEHAVIOR_RECORDING_TIME_AFTER = "1"; + + /** + * AccessToken header + */ + String ACCESS_TOKEN = "AccessToken"; + + /** + * 时间戳 + */ + String TIMESTAMP = "Timestamp"; } diff --git a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/FieldConstant.java b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/FieldConstant.java index 8818dd2a..f2d39525 100644 --- a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/FieldConstant.java +++ b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/FieldConstant.java @@ -64,4 +64,10 @@ public interface FieldConstant { String TAG_ID = "TAG_ID"; String TAG_ID_HUMP = "tagId"; + String EVENT_ID = "EVENT_ID"; + String EVENT_ID_HUMP = "eventId"; + + String ISSUE_ID = "ISSUE_ID"; + String ISSUE_ID_HUMP = "issueId"; + } diff --git a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/exception/ErrorCode.java b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/exception/ErrorCode.java index 097b9eff..d9ec13d3 100644 --- a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/exception/ErrorCode.java +++ b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/exception/ErrorCode.java @@ -40,4 +40,8 @@ public interface ErrorCode { int JSON_FORMAT_ERROR = 10016; int PARSING_ERROR = 10017; int INVALID_ERROR = 10018; + int ACCESS_TOKEN_NOT_EMPTY = 10022; + int ACCESS_TOKEN_INVALID = 10023; + int TIMESTAMP_NOT_EMPTY = 10024; + } diff --git a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/properties/ScreenPopulationProperties.java b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/properties/ScreenPopulationProperties.java new file mode 100644 index 00000000..0ff89ec1 --- /dev/null +++ b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/properties/ScreenPopulationProperties.java @@ -0,0 +1,29 @@ +package com.elink.esua.epdc.commons.tools.properties; + +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.Configuration; + +/** + * 党群e事通接口配置 + * + * @Author:songyunpeng + * @Date:2020/8/20 13:22 + */ +@Configuration +@ConfigurationProperties(prefix = "js.screen.population") +public class ScreenPopulationProperties { + + + /** + * 锦水居民信息采集大屏接口appId + */ + private String screenAppId; + + public String getScreenAppId() { + return screenAppId; + } + + public void setScreenAppId(String screenAppId) { + this.screenAppId = screenAppId; + } +} diff --git a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/redis/RedisKeys.java b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/redis/RedisKeys.java index 5ba297fe..1246d62a 100644 --- a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/redis/RedisKeys.java +++ b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/redis/RedisKeys.java @@ -168,6 +168,16 @@ public class RedisKeys { public static String getAllDeptOptionKey() { return rootPrefix.concat("options:dept:all:"); } + /*** + * 部门所有层级关系 - 带type key + * @param + * @return java.lang.String + * @author songyunpeng + * @date 2019/12/13 15:03 + */ + public static String getAllDeptOptionKeyWithTypeKey() { + return rootPrefix.concat("options:dept:allWithTypeKey:"); + } /** * @param diff --git a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/utils/MD5Util.java b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/utils/MD5Util.java new file mode 100644 index 00000000..b4a5833f --- /dev/null +++ b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/utils/MD5Util.java @@ -0,0 +1,93 @@ +package com.elink.esua.epdc.commons.tools.utils; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; + +/** + * MD5加密生成摘要 + * + * @Author:liuchuang + * @Date:2020/8/25 17:27 + */ +public class MD5Util { + + /** + * 对一段String生成MD5加密信息 + * + * @param message 要加密的String + * @return java.lang.String + * @author Liuchuang + * @since 2020/8/26 9:56 + */ + public static String getMD5(String message) { + try { + MessageDigest md = MessageDigest.getInstance("MD5"); + byte[] b = md.digest(message.getBytes("utf-8")); + return byteToHexStringSingle(b); + } catch (NoSuchAlgorithmException e) { + e.printStackTrace(); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + return null; + } + + /** + * 对文件全文生成MD5摘要 + * + * @param file 要加密的文件 + * @return java.lang.String + * @author Liuchuang + * @since 2020/8/26 9:58 + */ + public static String getMD5(File file) { + FileInputStream fis = null; + try { + MessageDigest md = MessageDigest.getInstance("MD5"); + fis = new FileInputStream(file); + byte[] buffer = new byte[2048]; + int length = -1; + long s = System.currentTimeMillis(); + while ((length = fis.read(buffer)) != -1) { + md.update(buffer, 0, length); + } + byte[] b = md.digest(); + return byteToHexStringSingle(b); + } catch (Exception ex) { + ex.printStackTrace(); + return null; + } finally { + try { + fis.close(); + } catch (IOException ex) { + ex.printStackTrace(); + } + } + } + + /** + * 独立把byte[]数组转换成十六进制字符串表示形式 + * + * @param byteArray + * @return java.lang.String + * @author Liuchuang + * @since 2020/8/26 9:59 + */ + public static String byteToHexStringSingle(byte[] byteArray) { + StringBuffer md5StrBuff = new StringBuffer(); + for (int i = 0; i < byteArray.length; i++) { + if (Integer.toHexString(0xFF & byteArray[i]).length() == 1) { + md5StrBuff.append("0").append( + Integer.toHexString(0xFF & byteArray[i])); + } else { + md5StrBuff.append(Integer.toHexString(0xFF & byteArray[i])); + } + } + + return md5StrBuff.toString(); + } +} diff --git a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/resources/i18n/messages_common_en_US.properties b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/resources/i18n/messages_common_en_US.properties index 85737691..13e2388d 100644 --- a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/resources/i18n/messages_common_en_US.properties +++ b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/resources/i18n/messages_common_en_US.properties @@ -19,4 +19,7 @@ 10015=Please delete the user under the department first 10016=The parameter format is incorrect. Please use JSON format. 10017=Parsing {0} error -10018=Invalid {0} \ No newline at end of file +10018=Invalid {0} +10022=AccessToken cannot be empty +10024=Timestamp cannot be empty +10023=AccessToken is invalid diff --git a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/resources/i18n/messages_common_zh_CN.properties b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/resources/i18n/messages_common_zh_CN.properties index 59f765d9..4832fe39 100644 --- a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/resources/i18n/messages_common_zh_CN.properties +++ b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/resources/i18n/messages_common_zh_CN.properties @@ -19,4 +19,7 @@ 10015=\u8BF7\u5148\u5220\u9664\u90E8\u95E8\u4E0B\u7684\u7528\u6237 10016=\u53C2\u6570\u683C\u5F0F\u4E0D\u6B63\u786E\uFF0C\u8BF7\u4F7F\u7528JSON\u683C\u5F0F 10017=\u89E3\u6790{0}\u51FA\u9519 -10018=\u65E0\u6548\u7684{0} \ No newline at end of file +10018=\u65E0\u6548\u7684{0} +10022=AccessToken\u4E0D\u80FD\u4E3A\u7A7A +10024=Timestamp\u4E0D\u80FD\u4E3A\u7A7A +10023=AccessToken\u65E0\u6548 \ No newline at end of file diff --git a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/resources/i18n/messages_common_zh_TW.properties b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/resources/i18n/messages_common_zh_TW.properties index aedf1184..3083339a 100644 --- a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/resources/i18n/messages_common_zh_TW.properties +++ b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/resources/i18n/messages_common_zh_TW.properties @@ -19,4 +19,7 @@ 10015=\u8ACB\u5148\u522A\u9664\u90E8\u9580\u4E0B\u7684\u7528\u6236 10016=\u53C3\u6578\u683C\u5F0F\u4E0D\u6B63\u78BA\uFF0C\u8ACB\u4F7F\u7528JSON\u683C\u5F0F 10017=\u89E3\u6790{0}\u51FA\u932F -10018=\u7121\u6548\u7684{0} \ No newline at end of file +10018=\u7121\u6548\u7684{0} +10022=AccessToken\u4E0D\u80FD\u70BA\u7A7A +10024=Timestamp\u4E0D\u80FD\u70BA\u7A7A +10023=AccessToken\u65E0\u6548 \ No newline at end of file diff --git a/esua-epdc/epdc-gateway/pom.xml b/esua-epdc/epdc-gateway/pom.xml index 698173f7..d20ec81b 100644 --- a/esua-epdc/epdc-gateway/pom.xml +++ b/esua-epdc/epdc-gateway/pom.xml @@ -104,8 +104,8 @@ http://127.0.0.1:9092 lb://epdc-activiti-server - lb://epdc-api-server - + + http://127.0.0.1:9040 lb://epdc-app-server lb://epdc-heart-server diff --git a/esua-epdc/epdc-gateway/src/main/resources/application.yml b/esua-epdc/epdc-gateway/src/main/resources/application.yml index 91b876df..7cd48e8d 100644 --- a/esua-epdc/epdc-gateway/src/main/resources/application.yml +++ b/esua-epdc/epdc-gateway/src/main/resources/application.yml @@ -269,6 +269,8 @@ renren: - /api/work/user/scripLogin #工作端-用户凭证登录 - /api/work/*/swagger/** - /api/residentConfig/getResidentConfig #获取居民端配置 + - /api/screenPopulationInfo/** #获取居民端配置 + workUrls: - /api/work/** #工作端接口 - /api/analysis/** #数据端接口 @@ -297,3 +299,4 @@ epdc: - /api/analysis/** #数据端接口不拦截 - /cloudAnalysis/** #数据端接口 - /api/residentConfig/getResidentConfig #获取居民端配置 + - /api/screenPopulationInfo/** #获取居民端配置 diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/annotation/ReportData.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/annotation/ReportData.java new file mode 100644 index 00000000..5caa3cbf --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/annotation/ReportData.java @@ -0,0 +1,15 @@ +package com.elink.esua.epdc.annotation; + +import java.lang.annotation.*; + +/** + * 居民信息采集 - 接口验证 + * + * @author Liuchuang + * @since 2020/8/25 17:09 + */ +@Target(ElementType.METHOD) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface ReportData { +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/aspect/ScreenPopulationAop.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/aspect/ScreenPopulationAop.java new file mode 100644 index 00000000..5d94acd1 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/aspect/ScreenPopulationAop.java @@ -0,0 +1,97 @@ +package com.elink.esua.epdc.aspect; + +import com.elink.esua.epdc.commons.tools.constant.Constant; +import com.elink.esua.epdc.commons.tools.exception.ErrorCode; +import com.elink.esua.epdc.commons.tools.exception.RenException; +import com.elink.esua.epdc.commons.tools.properties.ScreenPopulationProperties; +import com.elink.esua.epdc.commons.tools.utils.MD5Util; +import org.apache.commons.lang3.StringUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.aspectj.lang.JoinPoint; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Before; +import org.aspectj.lang.annotation.Pointcut; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.servlet.http.HttpServletRequest; +import java.util.Objects; +import java.util.Optional; + +/** + * 居民信息大屏接口验证 + * + * @author songyunpeng + * @Date 20-04-28 + */ +@Aspect +@Component +public class ScreenPopulationAop { + + @Autowired + private ScreenPopulationProperties screenPopulationProperties; + + /** + * 使用org.slf4j.Logger,这是Spring实现日志的方法 + */ + private final Logger logger = LogManager.getLogger(getClass()); + + /** + * 定义AOP扫描路径 + * 第一个注解只扫描aopTest方法 + */ + @Pointcut("@annotation(com.elink.esua.epdc.annotation.ReportData)") + public void ScreenPopulation() { + } + + /** + * 前置 + */ + @Before("ScreenPopulation()") + public void deBefore(JoinPoint joinPoint) { + HttpServletRequest request = currentRequest(); + if (Objects.isNull(request)) { + logger.info("without request, skip"); + return; + } + // 从header中获取token + String headerAccessToken = request.getHeader(Constant.ACCESS_TOKEN); + // 如果header中不存在token,则从参数中获取token + if(StringUtils.isBlank(headerAccessToken)){ + headerAccessToken = request.getParameter(Constant.ACCESS_TOKEN); + if(StringUtils.isBlank(headerAccessToken)){ + throw new RenException(ErrorCode.ACCESS_TOKEN_NOT_EMPTY); + } + } + + // 从header中获取Timestamp + String ts = request.getHeader(Constant.TIMESTAMP); + if (StringUtils.isBlank(ts)) { + ts = request.getParameter(Constant.TIMESTAMP); + if(StringUtils.isBlank(ts)){ + throw new RenException(ErrorCode.TIMESTAMP_NOT_EMPTY); + } + } + + // 校验AccessToken + String accessToken = MD5Util.getMD5(screenPopulationProperties.getScreenAppId().concat(ts)); + if (!headerAccessToken.equals(accessToken)) { + throw new RenException(ErrorCode.ACCESS_TOKEN_INVALID); + } + return; + } + /** + * Return request current thread bound or null if none bound. + * + * @return Current request or null + */ + private HttpServletRequest currentRequest() { + // Use getRequestAttributes because of its return null if none bound + ServletRequestAttributes servletRequestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); + return Optional.ofNullable(servletRequestAttributes).map(ServletRequestAttributes::getRequest).orElse(null); + } + +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiScreenPopulationController.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiScreenPopulationController.java new file mode 100644 index 00000000..c5bcc162 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiScreenPopulationController.java @@ -0,0 +1,145 @@ +package com.elink.esua.epdc.controller; + +import com.elink.esua.epdc.annotation.ReportData; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.dto.DeptOption; +import com.elink.esua.epdc.dto.epdc.form.*; +import com.elink.esua.epdc.dto.epdc.result.*; +import com.elink.esua.epdc.service.AppUserService; +import com.elink.esua.epdc.service.CustomService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +/** + * 用户模块 + * + * @author yujintao + * @email yujintao@elink-cn.com + * @date 2019/9/6 19:30 + */ +@RestController +@RequestMapping("screenPopulationInfo") +public class ApiScreenPopulationController { + + @Autowired + private AppUserService appUserService; + + @Autowired + private CustomService customService; + + /** + * @Description 大屏找人接口 + * @Author songyunpeng + * @Date 2020/9/14 + * @Param [epdcScreenSelectPeopleFormDTO] + * @return com.elink.esua.epdc.commons.tools.utils.Result> + **/ + @ReportData + @PostMapping("selectPeople") + public Result> selectPeople(@RequestBody EpdcScreenSelectPeopleFormDTO dto){ + ValidatorUtils.validateEntity(dto); + return appUserService.selectPeople(dto); + } + + /** + * @Description 一人找房接口 + * @Author songyunpeng + * @Date 2020/9/19 + * @Param [dto] + * @return com.elink.esua.epdc.commons.tools.utils.Result> + **/ + @ReportData + @PostMapping("selectHouseByPeople") + public Result> selectHouseByPeople(@RequestBody EpdcScreenHouseInfoByPeopleFormDTO dto){ + ValidatorUtils.validateEntity(dto); + return appUserService.selectHouseByPeople(dto); + } + /** + * @Description 以房找人接口 + * @Author songyunpeng + * @Date 2020/9/19 + * @Param [dto] + * @return com.elink.esua.epdc.commons.tools.utils.Result> + **/ + @ReportData + @PostMapping("selectPeopleByHouse") + public Result> selectPeopleByHouse(@RequestBody EpdcScreenPopulationInfoByHouseFormDTO dto){ + ValidatorUtils.validateEntity(dto); + return appUserService.selectPeopleByHouse(dto); + } + + /** + * @Description 以人找人接口 + * @Author songyunpeng + * @Date 2020/9/19 + * @Param [dto] + * @return com.elink.esua.epdc.commons.tools.utils.Result> + **/ + @ReportData + @PostMapping("selectPeopleByCurrentAddress") + public Result> selectPeopleByCurrentAddress(@RequestBody EpdcScreenResidentInfoByCurrentAddressFormDTO dto){ + ValidatorUtils.validateEntity(dto); + return appUserService.selectPeopleByCurrentAddress(dto); + } + + /** + * @Description 大屏找人详情接口 + * @Author songyunpeng + * @Date 2020/9/14 + * @Param [dto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + @ReportData + @Deprecated + @PostMapping("selectPeopleDetail") + public Result selectPeopleDetail(@RequestBody EpdcScreenSelectPeopleDetailFormDTO dto){ + ValidatorUtils.validateEntity(dto); + return appUserService.selectPeopleDetail(dto); + } + + + /** + * @param + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Author yinzuomei + * @Description 获取所有组织机构信息 + * @Date 2020/1/28 11:50 + **/ + @ReportData + @Deprecated + @GetMapping("getDeptTreeWithTypeKey") + public Result getDeptTreeWithTypeKey() { + return appUserService.getDeptTreeWithTypeKey(); + } + + + /** + * @Description 房屋用途数据接口 + * @Author songyunpeng + * @Date 2020/9/15 + * @Param [] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + @ReportData + @Deprecated + @PostMapping("housingUse") + public Result housingUse(){ + return appUserService.housingUse(); + } + /** + * @Description 网格排名 + * @Author songyunpeng + * @Date 2020/9/15 + * @Param [dto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + @ReportData + @Deprecated + @PostMapping("gridRanking") + public Result> gridRanking(@RequestBody EpdcScreenGridRankingFormDTO dto){ + ValidatorUtils.validateEntity(dto); + return appUserService.gridRanking(dto); + } +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/AdminFeignClient.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/AdminFeignClient.java index cc8f7022..ee27fe40 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/AdminFeignClient.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/AdminFeignClient.java @@ -98,11 +98,20 @@ public interface AdminFeignClient { * @param * @return com.elink.esua.epdc.commons.tools.utils.Result * @Author yinzuomei - * @Description 获取所有组织机构信息 + * @Description 获取所有组织机构信息 - 二级只带街道 * @Date 2020/1/28 12:15 **/ @GetMapping("sys/dept/party/getDeptTreeForEpiDemic") Result getDeptTreeForEpiDemic(); + /** + * @Description 所有组织机构 + * @Author songyunpeng + * @Date 2020/9/15 + * @Param [] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + @GetMapping("sys/dept/party/getDeptTreeWithTypeKey") + Result getDeptTreeWithTypeKey(); /** * 根据数据字典类型获取简版数据字典列表,用于页面下拉菜单 diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/UserFeignClient.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/UserFeignClient.java index 74556cc6..d19b5dfb 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/UserFeignClient.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/UserFeignClient.java @@ -1,17 +1,19 @@ package com.elink.esua.epdc.feign; import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; +import com.elink.esua.epdc.commons.tools.page.PageData; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.*; import com.elink.esua.epdc.dto.epdc.form.*; import com.elink.esua.epdc.dto.epdc.form.v2.EpdcCompleteVolunteerInfoV2FormDTO; import com.elink.esua.epdc.dto.epdc.result.*; -import com.elink.esua.epdc.dto.epdc.result.EpdcWorkUserResultDTO; -import com.elink.esua.epdc.dto.epdc.form.EpdcAppUserRankingFormDTO; import com.elink.esua.epdc.feign.fallback.UserFeignClientFallback; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.http.MediaType; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; import java.util.List; @@ -481,5 +483,73 @@ public interface UserFeignClient { **/ @GetMapping(value = "app-user/usersign/addConsequentSignPoints", consumes = MediaType.APPLICATION_JSON_VALUE) Result addConsequentSignPoints(UserSignDTO userSignDTO); + + /** + * @Description 大屏找人接口 + * @Author songyunpeng + * @Date 2020/9/14 + * @Param [dto] + * @return com.elink.esua.epdc.commons.tools.utils.Result> + **/ + @PostMapping(value = "app-user/screenPopulationInfo/selectPeople", consumes = MediaType.APPLICATION_JSON_VALUE) + Result> selectPeople(EpdcScreenSelectPeopleFormDTO dto); + + /** + * @Description 房屋用途数据接口 + * @Author songyunpeng + * @Date 2020/9/16 + * @Param [] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + @PostMapping(value = "app-user/screenPopulationInfo/housingUse", consumes = MediaType.APPLICATION_JSON_VALUE) + Result housingUse(); + + /** + * @Description 网格排名 + * @Author songyunpeng + * @Date 2020/9/15 + * @Param [dto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + @PostMapping(value = "app-user/screenPopulationInfo/gridRanking", consumes = MediaType.APPLICATION_JSON_VALUE) + Result> gridRanking(@RequestBody EpdcScreenGridRankingFormDTO dto); + + + /** + * @Description 大屏找人详情接口 + * @Author songyunpeng + * @Date 2020/9/14 + * @Param [dto] + * @return com.elink.esua.epdc.commons.tools.utils.Result> + **/ + @PostMapping(value = "app-user/screenPopulationInfo/selectPeopleDetail", consumes = MediaType.APPLICATION_JSON_VALUE) + Result selectPeopleDetail(EpdcScreenSelectPeopleDetailFormDTO dto); + /** + * @Description 一人找房接口 + * @Author songyunpeng + * @Date 2020/9/19 + * @Param [dto] + * @return com.elink.esua.epdc.commons.tools.utils.Result> + **/ + @PostMapping(value = "app-user/screenPopulationInfo/selectHouseByPeople", consumes = MediaType.APPLICATION_JSON_VALUE) + Result> selectHouseByPeople(@RequestBody EpdcScreenHouseInfoByPeopleFormDTO dto); + /** + * @Description 以房找人接口 + * @Author songyunpeng + * @Date 2020/9/19 + * @Param [dto] + * @return com.elink.esua.epdc.commons.tools.utils.Result> + **/ + @PostMapping(value = "app-user/screenPopulationInfo/selectPeopleByHouse", consumes = MediaType.APPLICATION_JSON_VALUE) + Result> selectPeopleByHouse(@RequestBody EpdcScreenPopulationInfoByHouseFormDTO dto); + /** + * @Description 以人找人接口 + * @Author songyunpeng + * @Date 2020/9/19 + * @Param [dto] + * @return com.elink.esua.epdc.commons.tools.utils.Result> + **/ + @PostMapping(value = "app-user/screenPopulationInfo/selectPeopleByCurrentAddress", consumes = MediaType.APPLICATION_JSON_VALUE) + Result> selectPeopleByCurrentAddress(@RequestBody EpdcScreenResidentInfoByCurrentAddressFormDTO dto); } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/AdminFeignClientFallback.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/AdminFeignClientFallback.java index 004c8703..45e9f83d 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/AdminFeignClientFallback.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/AdminFeignClientFallback.java @@ -54,6 +54,11 @@ public class AdminFeignClientFallback implements AdminFeignClient { return ModuleUtils.feignConError(ServiceConstant.EPDC_ADMIN_SERVER, "getDeptTreeForEpiDemic"); } + @Override + public Result getDeptTreeWithTypeKey() { + return ModuleUtils.feignConError(ServiceConstant.EPDC_ADMIN_SERVER, "getDeptTreeWithTypeKey"); + } + @Override public Result> getListSimpleDictInfo(String dictType) { return ModuleUtils.feignConError(ServiceConstant.EPDC_ADMIN_SERVER, "getListSimpleDictInfo", dictType); diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/UserFeignClientFallback.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/UserFeignClientFallback.java index 925d171c..a00b5fa2 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/UserFeignClientFallback.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/UserFeignClientFallback.java @@ -1,13 +1,13 @@ package com.elink.esua.epdc.feign.fallback; import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; +import com.elink.esua.epdc.commons.tools.page.PageData; import com.elink.esua.epdc.commons.tools.utils.ModuleUtils; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.*; import com.elink.esua.epdc.dto.epdc.form.*; import com.elink.esua.epdc.dto.epdc.form.v2.EpdcCompleteVolunteerInfoV2FormDTO; import com.elink.esua.epdc.dto.epdc.result.*; -import com.elink.esua.epdc.dto.epdc.form.EpdcAppUserRankingFormDTO; import com.elink.esua.epdc.feign.UserFeignClient; import org.springframework.stereotype.Component; @@ -232,4 +232,39 @@ public class UserFeignClientFallback implements UserFeignClient { public Result addConsequentSignPoints(UserSignDTO userSignDTO) { return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "addConsequentSignPoints", userSignDTO); } + + @Override + public Result> selectPeople(EpdcScreenSelectPeopleFormDTO dto) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "selectPeople", dto); + } + + @Override + public Result selectPeopleDetail(EpdcScreenSelectPeopleDetailFormDTO dto) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "selectPeopleDetail", dto); + } + + @Override + public Result> selectHouseByPeople(EpdcScreenHouseInfoByPeopleFormDTO dto) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "selectHouseByPeople", dto); + } + + @Override + public Result> selectPeopleByHouse(EpdcScreenPopulationInfoByHouseFormDTO dto) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "selectPeopleByHouse", dto); + } + + @Override + public Result> selectPeopleByCurrentAddress(EpdcScreenResidentInfoByCurrentAddressFormDTO dto) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "selectPeopleByCurrentAddress", dto); + } + + @Override + public Result housingUse() { + return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "housingUse"); + } + + @Override + public Result> gridRanking(EpdcScreenGridRankingFormDTO dto) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "gridRanking", dto); + } } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/AppUserService.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/AppUserService.java index 9d46d8f5..0db9f9d1 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/AppUserService.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/AppUserService.java @@ -1,14 +1,16 @@ package com.elink.esua.epdc.service; import com.elink.esua.epdc.common.token.dto.TokenDto; +import com.elink.esua.epdc.commons.tools.page.PageData; import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.DeptOption; import com.elink.esua.epdc.dto.epdc.form.*; import com.elink.esua.epdc.dto.epdc.form.v2.EpdcCompleteVolunteerInfoV2FormDTO; import com.elink.esua.epdc.dto.epdc.result.*; import com.elink.esua.epdc.dto.form.*; import com.elink.esua.epdc.dto.form.v2.EpdcCompleteUserInfoFormV2DTO; -import com.elink.esua.epdc.dto.result.EpdcAppRegisterCallbackDTO; import com.elink.esua.epdc.dto.result.EpdcAppAuthorizationDTO; +import com.elink.esua.epdc.dto.result.EpdcAppRegisterCallbackDTO; import com.elink.esua.epdc.dto.result.EpdcCompleteUserInfoDTO; import java.util.List; @@ -318,4 +320,68 @@ public interface AppUserService { * @return com.elink.esua.epdc.commons.tools.utils.Result **/ Result userSign(TokenDto userDetail); + /** + * @Description 大屏找人接口 + * @Author songyunpeng + * @Date 2020/9/14 + * @Param [dto] + * @return com.elink.esua.epdc.commons.tools.utils.Result> + **/ + Result> selectPeople(EpdcScreenSelectPeopleFormDTO dto); + /** + * @Description 大屏找人详情接口 + * @Author songyunpeng + * @Date 2020/9/14 + * @Param [dto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + Result selectPeopleDetail(EpdcScreenSelectPeopleDetailFormDTO dto); + /** + * @Description 大屏找人组织机构获取 + * @Author songyunpeng + * @Date 2020/9/15 + * @Param [] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + Result getDeptTreeWithTypeKey(); + /** + * @Description 房屋用途数据接口 + * @Author songyunpeng + * @Date 2020/9/16 + * @Param [] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + Result housingUse(); + /** + * @Description 网格排名 + * @Author songyunpeng + * @Date 2020/9/16 + * @Param [dto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + Result> gridRanking(EpdcScreenGridRankingFormDTO dto); + /** + * @Description 以人找房 + * @Author songyunpeng + * @Date 2020/9/19 + * @Param [dto] + * @return com.elink.esua.epdc.commons.tools.utils.Result> + **/ + Result> selectHouseByPeople(EpdcScreenHouseInfoByPeopleFormDTO dto); + /** + * @Description 以房找人接口 + * @Author songyunpeng + * @Date 2020/9/19 + * @Param [dto] + * @return com.elink.esua.epdc.commons.tools.utils.Result> + **/ + Result> selectPeopleByHouse(EpdcScreenPopulationInfoByHouseFormDTO dto); + /** + * @Description 以人找人接口 + * @Author songyunpeng + * @Date 2020/9/19 + * @Param [dto] + * @return com.elink.esua.epdc.commons.tools.utils.Result> + **/ + Result> selectPeopleByCurrentAddress(EpdcScreenResidentInfoByCurrentAddressFormDTO dto); } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppUserServiceImpl.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppUserServiceImpl.java index b9a3d10a..8a75fda1 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppUserServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppUserServiceImpl.java @@ -15,6 +15,7 @@ import com.elink.esua.epdc.common.token.util.CpUserDetailRedis; import com.elink.esua.epdc.commons.tools.constant.NumConstant; import com.elink.esua.epdc.commons.tools.enums.*; import com.elink.esua.epdc.commons.tools.exception.RenException; +import com.elink.esua.epdc.commons.tools.page.PageData; import com.elink.esua.epdc.commons.tools.redis.RedisUtils; import com.elink.esua.epdc.commons.tools.utils.*; import com.elink.esua.epdc.dto.*; @@ -1586,4 +1587,44 @@ public class AppUserServiceImpl implements AppUserService { return new Result().ok("您已连续签到"+userSignDTO.getConsequentSignDays()+"天,继续努力吧"); } + @Override + public Result> selectPeople(EpdcScreenSelectPeopleFormDTO dto) { + return userFeignClient.selectPeople(dto); + } + + @Override + public Result selectPeopleDetail(EpdcScreenSelectPeopleDetailFormDTO dto) { + return userFeignClient.selectPeopleDetail(dto); + } + + @Override + public Result getDeptTreeWithTypeKey() { + return adminFeignClient.getDeptTreeWithTypeKey(); + } + + @Override + public Result housingUse() { + return userFeignClient.housingUse(); + } + + @Override + public Result> gridRanking(EpdcScreenGridRankingFormDTO dto) { + return userFeignClient.gridRanking(dto); + } + + @Override + public Result> selectHouseByPeople(EpdcScreenHouseInfoByPeopleFormDTO dto) { + return userFeignClient.selectHouseByPeople(dto); + } + + @Override + public Result> selectPeopleByHouse(EpdcScreenPopulationInfoByHouseFormDTO dto) { + return userFeignClient.selectPeopleByHouse(dto); + } + + @Override + public Result> selectPeopleByCurrentAddress(EpdcScreenResidentInfoByCurrentAddressFormDTO dto) { + return userFeignClient.selectPeopleByCurrentAddress(dto); + } + } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/resources/application.yml b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/resources/application.yml index e23ebcdc..dedff174 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/resources/application.yml +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/resources/application.yml @@ -145,4 +145,10 @@ rocketmq: group: @rocketmq.producer.group@ consumer: group: @rocketmq.consumer.group@ - points-group: @rocketmq.consumer.points.group@ \ No newline at end of file + points-group: @rocketmq.consumer.points.group@ + + +js: + screen: + population: + screenAppId: 9ce9fc63460401e7a3b3a6cab3b9c126 \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/service/impl/EpdcEventsServiceImpl.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/service/impl/EpdcEventsServiceImpl.java index 28c0969f..8df7d456 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/service/impl/EpdcEventsServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/service/impl/EpdcEventsServiceImpl.java @@ -23,6 +23,7 @@ import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; import com.elink.esua.epdc.commons.tools.constant.FieldConstant; import com.elink.esua.epdc.commons.tools.constant.NumConstant; import com.elink.esua.epdc.commons.tools.constant.OrganizationTypeConstant; +import com.elink.esua.epdc.commons.tools.exception.RenException; import com.elink.esua.epdc.commons.tools.page.PageData; import com.elink.esua.epdc.commons.tools.security.content.CheckDataUtils; import com.elink.esua.epdc.commons.tools.security.content.ModuleName; @@ -258,6 +259,9 @@ public class EpdcEventsServiceImpl extends BaseServiceImpl NumConstant.ZERO; + } else if (EventIssueItemState.EVENT_REVIEW_TO_ITEM == eventState) { + int itemCount = itemService.selectItemCountByEventId(eventId); + checkResult = itemCount > NumConstant.ZERO; + } else { + EpdcEventsEntity entity = baseDao.selectById(eventId); + checkResult = eventState == entity.getEventState(); + } + + if (checkResult) { + throw new RenException("该事件已审核,请勿重复操作"); + } + } + } diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/issue/service/IssueService.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/issue/service/IssueService.java index c16ba47f..63ff5996 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/issue/service/IssueService.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/issue/service/IssueService.java @@ -284,4 +284,14 @@ public interface IssueService extends BaseService { * @since 2020/3/7 12:50 */ void modifyPartyGroupName(List groups); + + /** + * 根据事件ID获取议题数量 + * + * @param eventId 事件ID + * @return int + * @author Liuchuang + * @since 2020/9/16 10:31 + */ + int selectIssueCountByEventId(String eventId); } diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/issue/service/impl/IssueServiceImpl.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/issue/service/impl/IssueServiceImpl.java index 5b2101c6..10ba9446 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/issue/service/impl/IssueServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/issue/service/impl/IssueServiceImpl.java @@ -189,6 +189,9 @@ public class IssueServiceImpl extends BaseServiceImpl imp @Override @Transactional(rollbackFor = Exception.class) public Result saveIssueHandleResult(IssueWaitHandleSubmitFormDTO dto) { + // 转项目校验 + checkChangeToItem(dto.getId(), dto.getState()); + IssueHandleEntity handleEntity = new IssueHandleEntity(); handleEntity.setAdvice(dto.getAdvice()); handleEntity.setState(dto.getState()); @@ -696,4 +699,31 @@ public class IssueServiceImpl extends BaseServiceImpl imp return new Result(); } + + @Override + public int selectIssueCountByEventId(String eventId) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(FieldConstant.EVENT_ID, eventId); + + return baseDao.selectCount(wrapper); + } + + /** + * 议题转项目校验 + * + * @param issueId 议题ID + * @param state 状态 + * @return void + * @author Liuchuang + * @since 2020/9/16 11:11 + */ + private void checkChangeToItem(String issueId, int state) { + if(EventIssueItemState.ISSUE_CHANGE_TO_ITEM_AND_CIRCULATION_ASSISTANCE == state + || EventIssueItemState.ISSUE_CHANGE_TO_ITEM == state) { + int itemCount = itemService.selectItemCountByIssueId(issueId); + if (itemCount > NumConstant.ZERO) { + throw new RenException("该议题已转为项目,请勿重复操作"); + } + } + } } diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/ItemService.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/ItemService.java index 8daf6737..c25af812 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/ItemService.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/ItemService.java @@ -387,4 +387,24 @@ public interface ItemService extends BaseService { * @return com.elink.esua.epdc.commons.tools.utils.Result */ Result rejectItemSatisfactionInfo(RejectRecordDTO dto); + + /** + * 根据事件ID获取项目数量 + * + * @param eventId 事件ID + * @return int + * @author Liuchuang + * @since 2020/9/16 10:37 + */ + int selectItemCountByEventId(String eventId); + + /** + * 根据议题ID获取项目数量 + * + * @param issueId 议题ID + * @return int + * @author Liuchuang + * @since 2020/9/16 10:37 + */ + int selectItemCountByIssueId(String issueId); } diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/impl/ItemServiceImpl.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/impl/ItemServiceImpl.java index ffb20f0a..9dd2752e 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/impl/ItemServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/impl/ItemServiceImpl.java @@ -74,6 +74,7 @@ import com.elink.esua.epdc.modules.feign.ContentSecurityFeignClient; import com.elink.esua.epdc.modules.feign.UserFeignClient; import com.elink.esua.epdc.modules.interfacelog.entity.InterfaceLogEntity; import com.elink.esua.epdc.modules.interfacelog.service.InterfaceLogService; +import com.elink.esua.epdc.modules.issue.entity.IssueEntity; import com.elink.esua.epdc.modules.issue.service.IssueService; import com.elink.esua.epdc.modules.item.dao.GridPlatformHandleLogDao; import com.elink.esua.epdc.modules.item.dao.ItemDao; @@ -1546,4 +1547,20 @@ public class ItemServiceImpl extends BaseServiceImpl implem baseDao.rejectItemSatisfactionInfo(dto.getRelationId()); return new Result(); } + + @Override + public int selectItemCountByEventId(String eventId) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(FieldConstant.EVENT_ID, eventId); + + return baseDao.selectCount(wrapper); + } + + @Override + public int selectItemCountByIssueId(String issueId) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(FieldConstant.ISSUE_ID, issueId); + + return baseDao.selectCount(wrapper); + } } diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActInfoServiceImpl.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActInfoServiceImpl.java index 1531758d..c408e3c9 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActInfoServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActInfoServiceImpl.java @@ -50,6 +50,7 @@ import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; import com.elink.esua.epdc.constant.*; import com.elink.esua.epdc.dto.ScheduleJobDTO; import com.elink.esua.epdc.dto.epdc.form.EpdcInformationFormDTO; +import com.elink.esua.epdc.dto.epdc.form.EpdcVolunteerKindnessTimeUpdateFormDTO; import com.elink.esua.epdc.modules.activity.dao.*; import com.elink.esua.epdc.modules.activity.entity.ActBannerEntity; import com.elink.esua.epdc.modules.activity.entity.ActInfoEntity; @@ -68,8 +69,10 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.math.BigDecimal; import java.time.LocalDateTime; import java.util.*; +import java.util.stream.Collectors; /** * 活动信息表 @@ -247,6 +250,8 @@ public class ActInfoServiceImpl extends BaseServiceImpl params = new HashMap<>(); + params.put("ACT_ID",dto.getId()); + params.put("STATUS","5"); + List actUserRelationEntities = actUserRelationDao.selectByMap(params); + if(actUserRelationEntities==null || actUserRelationEntities.size() == 0){ + return; + } + List userIds = actUserRelationEntities.stream().map(ActUserRelationEntity::getUserId).collect(Collectors.toList()); + + EpdcVolunteerKindnessTimeUpdateFormDTO epdcVolunteerKindnessTimeUpdateFormDTO = new EpdcVolunteerKindnessTimeUpdateFormDTO(); + //更改的值减去原先的值 若是正的,则代表加上时长差 若是负的 则代表减去时长差 + epdcVolunteerKindnessTimeUpdateFormDTO.setKindnessTime(new BigDecimal(dto.getKindnessTime()-oldActInfoEntity.getKindnessTime())); + epdcVolunteerKindnessTimeUpdateFormDTO.setUserIds(userIds); + userInfoFeignClient.updateKindnessTime(epdcVolunteerKindnessTimeUpdateFormDTO); + } /** * 活动列表-移动app端用 diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/UserInfoFeignClient.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/UserInfoFeignClient.java index d68636c3..893887f3 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/UserInfoFeignClient.java +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/UserInfoFeignClient.java @@ -6,6 +6,7 @@ import com.elink.esua.epdc.dto.UserDTO; import com.elink.esua.epdc.dto.VolunteerInfoDTO; import com.elink.esua.epdc.dto.epdc.form.EpdcUserPointsFormDTO; import com.elink.esua.epdc.dto.epdc.form.EpdcVolunteerKindnessTimeFormDTO; +import com.elink.esua.epdc.dto.epdc.form.EpdcVolunteerKindnessTimeUpdateFormDTO; import com.elink.esua.epdc.modules.feign.fallback.UserInfoFeignClientFallback; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.http.MediaType; @@ -79,4 +80,13 @@ public interface UserInfoFeignClient { */ @PostMapping(value = "app-user/volunteerinfo/addKindnessTime", consumes = MediaType.APPLICATION_JSON_VALUE) Result addKindnessTime(EpdcVolunteerKindnessTimeFormDTO formDto); + /** + * @Description 更新志愿者爱心活动时长 + * @Author songyunpeng + * @Date 2020/9/11 + * @Param [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + @PostMapping(value = "app-user/volunteerinfo/updateKindnessTime", consumes = MediaType.APPLICATION_JSON_VALUE) + Result updateKindnessTime(EpdcVolunteerKindnessTimeUpdateFormDTO formDto); } diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/fallback/UserInfoFeignClientFallback.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/fallback/UserInfoFeignClientFallback.java index 95f0d4b4..4a9310a3 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/fallback/UserInfoFeignClientFallback.java +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/fallback/UserInfoFeignClientFallback.java @@ -7,6 +7,7 @@ import com.elink.esua.epdc.dto.UserDTO; import com.elink.esua.epdc.dto.VolunteerInfoDTO; import com.elink.esua.epdc.dto.epdc.form.EpdcUserPointsFormDTO; import com.elink.esua.epdc.dto.epdc.form.EpdcVolunteerKindnessTimeFormDTO; +import com.elink.esua.epdc.dto.epdc.form.EpdcVolunteerKindnessTimeUpdateFormDTO; import com.elink.esua.epdc.modules.feign.UserInfoFeignClient; import org.springframework.stereotype.Component; @@ -45,4 +46,9 @@ public class UserInfoFeignClientFallback implements UserInfoFeignClient { return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "addKindnessTime", formDto); } + @Override + public Result updateKindnessTime(EpdcVolunteerKindnessTimeUpdateFormDTO formDto) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "updateKindnessTime", formDto); + } + } diff --git a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/form/PartyGroupTopicTopFormDTO.java b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/form/PartyGroupTopicTopFormDTO.java index 3cf2f696..bfe73068 100644 --- a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/form/PartyGroupTopicTopFormDTO.java +++ b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/form/PartyGroupTopicTopFormDTO.java @@ -31,4 +31,9 @@ public class PartyGroupTopicTopFormDTO implements Serializable { * 用户ID */ private String userId; + + /** + * 系统标识:0-居民端,1-pc端 + */ + private String systemFlag; } diff --git a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/result/PartyGroupOfficialsResultDTO.java b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/result/PartyGroupOfficialsResultDTO.java index 31056758..29771c60 100644 --- a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/result/PartyGroupOfficialsResultDTO.java +++ b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/result/PartyGroupOfficialsResultDTO.java @@ -64,6 +64,9 @@ public class PartyGroupOfficialsResultDTO implements Serializable { */ private String areaResponsibility; - + /** + * 职责 + */ + private String duty; } \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/controller/AppPartyTopicController.java b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/controller/AppPartyTopicController.java index ca161bf1..83988fb6 100644 --- a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/controller/AppPartyTopicController.java +++ b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/controller/AppPartyTopicController.java @@ -18,6 +18,7 @@ package com.elink.esua.epdc.controller; import com.elink.esua.epdc.common.token.dto.TokenDto; +import com.elink.esua.epdc.commons.tools.constant.NumConstant; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; import com.elink.esua.epdc.dto.form.*; @@ -126,6 +127,7 @@ public class AppPartyTopicController { */ @PostMapping("top") public Result topicTop(@RequestBody PartyGroupTopicTopFormDTO formDto) { + formDto.setSystemFlag(NumConstant.ZERO_STR); return partyTopicService.modifyTopicTopFlag(formDto); } diff --git a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/controller/PartyTopicController.java b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/controller/PartyTopicController.java index 1b492736..99fdb232 100644 --- a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/controller/PartyTopicController.java +++ b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/controller/PartyTopicController.java @@ -17,6 +17,7 @@ package com.elink.esua.epdc.controller; +import com.elink.esua.epdc.commons.tools.constant.NumConstant; import com.elink.esua.epdc.commons.tools.page.PageData; import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; import com.elink.esua.epdc.commons.tools.utils.Result; @@ -27,6 +28,7 @@ import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; import com.elink.esua.epdc.dto.GroupTopicCloseFormDTO; import com.elink.esua.epdc.dto.PartyTopicDTO; +import com.elink.esua.epdc.dto.form.PartyGroupTopicTopFormDTO; import com.elink.esua.epdc.excel.PartyTopicExcel; import com.elink.esua.epdc.service.PartyTopicService; import org.springframework.beans.factory.annotation.Autowired; @@ -98,4 +100,19 @@ public class PartyTopicController { return partyTopicService.modifyTopicState(formDto); } + /** + * 话题置顶或取消置顶 + * + * @param formDto 参数 + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author Liuchuang + * @since 2020/9/8 9:33 + */ + @PostMapping("top") + public Result topicTop(@RequestBody PartyGroupTopicTopFormDTO formDto) { + ValidatorUtils.validateEntity(formDto); + formDto.setSystemFlag(NumConstant.ONE_STR); + return partyTopicService.modifyTopicTopFlag(formDto); + } + } \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/impl/PartyTopicServiceImpl.java b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/impl/PartyTopicServiceImpl.java index ea840cc0..4fc4469c 100644 --- a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/impl/PartyTopicServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/impl/PartyTopicServiceImpl.java @@ -325,10 +325,12 @@ public class PartyTopicServiceImpl extends BaseServiceImpl + + @@ -64,7 +66,9 @@ t.CREATED_BY, t.CREATED_TIME, t.UPDATED_BY, - t.UPDATED_TIME + t.UPDATED_TIME, + t.TOP_FLAG, + t.TOP_TIME from epdc_party_topic t where t.DEL_FLAG ='0' @@ -79,7 +83,7 @@ #{endTime} - order by CREATED_TIME desc + order by t.TOP_TIME DESC, t.CREATED_TIME desc diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/constant/HouseHeadRelationConstant.java b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/constant/HouseHeadRelationConstant.java new file mode 100644 index 00000000..62fc8d56 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/constant/HouseHeadRelationConstant.java @@ -0,0 +1,17 @@ +package com.elink.esua.epdc.constant; + +/** + * @author: songyunpeng + * @Date: 2020/08/19 14:12 + * @Description: 房屋用处 + */ +public interface HouseHeadRelationConstant { + + String CHILDREN = "0"; + + String HUSBAND_AND_WIFE = "1"; + + String PARENT = "2"; + + String OTHER = "3"; +} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/constant/PopulationIdentify.java b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/constant/PopulationIdentify.java new file mode 100644 index 00000000..958a02a5 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/constant/PopulationIdentify.java @@ -0,0 +1,19 @@ +package com.elink.esua.epdc.constant; + +/** + * @author songyunpeng + * @Description 人口信息 人口身份标识 + * @create 2020-09-14 + */ + +public interface PopulationIdentify { + + + String PROPERTY_OWNER = "0"; + + String HOUSE_HEAD = "1"; + + String HOUSE_RESIDENT = "2"; + + +} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/HousingInformationDTO.java b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/HousingInformationDTO.java index 26d4507e..bc3a9007 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/HousingInformationDTO.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/HousingInformationDTO.java @@ -48,7 +48,7 @@ public class HousingInformationDTO implements Serializable { /** * 购房时间 */ - private Date buyingTime; + private String buyingTime; /** * 房屋面积 diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/PopulationInformationDTO.java b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/PopulationInformationDTO.java index 0200d7bb..a7160631 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/PopulationInformationDTO.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/PopulationInformationDTO.java @@ -73,7 +73,7 @@ public class PopulationInformationDTO implements Serializable { /** * 入党时间 */ - private Date joinTime; + private String joinTime; /** * 组织关系所在地 @@ -148,7 +148,7 @@ public class PopulationInformationDTO implements Serializable { /** * 失业登记时间 */ - private Date unemploymentRegisterTime; + private String unemploymentRegisterTime; /** * 家庭类别 (0:普通家庭 1:五好家庭 2:军烈家庭 3:优抚家庭 4:单亲家庭 5:空巢老人 6:困难家庭) diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcScreenGridRankingFormDTO.java b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcScreenGridRankingFormDTO.java new file mode 100644 index 00000000..8cd18932 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcScreenGridRankingFormDTO.java @@ -0,0 +1,34 @@ +package com.elink.esua.epdc.dto.epdc.form; + +import lombok.Data; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; + +/** + * @author songyunpeng + * @Description 大屏网格排名参数 + * @create 2020-09-14 + */ +@Data +public class EpdcScreenGridRankingFormDTO { + + /** + * 页码 + */ + @Min(value = 0, message = "页码必须大于0") + private Integer pageIndex; + + /** + * 页容量 + */ + @Min(value = 0, message = "页容量必须大于0") + private Integer pageSize; + + /** + * 排序依据 + */ + @NotBlank(message = "排序依据不能为空") + private String rankCategory; + +} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcScreenHouseInfoByPeopleFormDTO.java b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcScreenHouseInfoByPeopleFormDTO.java new file mode 100644 index 00000000..3bc3c38c --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcScreenHouseInfoByPeopleFormDTO.java @@ -0,0 +1,34 @@ +package com.elink.esua.epdc.dto.epdc.form; + +import lombok.Data; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; + +/** + * @author songyunpeng + * @Description 大屏以人找房参数 + * @create 2020-09-14 + */ +@Data +public class EpdcScreenHouseInfoByPeopleFormDTO { + + /** + * 页码 + */ + @Min(value = 0, message = "页码必须大于0") + private Integer pageIndex; + + /** + * 页容量 + */ + @Min(value = 0, message = "页容量必须大于0") + private Integer pageSize; + + /** + * 户主姓名 + */ + @NotBlank(message = "户主姓名不能为空") + private String houseHeadName; + +} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcScreenPopulationInfoByHouseFormDTO.java b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcScreenPopulationInfoByHouseFormDTO.java new file mode 100644 index 00000000..a7b1e212 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcScreenPopulationInfoByHouseFormDTO.java @@ -0,0 +1,34 @@ +package com.elink.esua.epdc.dto.epdc.form; + +import lombok.Data; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; + +/** + * @author songyunpeng + * @Description 大屏以房找人参数 + * @create 2020-09-14 + */ +@Data +public class EpdcScreenPopulationInfoByHouseFormDTO { + + /** + * 页码 + */ + @Min(value = 0, message = "页码必须大于0") + private Integer pageIndex; + + /** + * 页容量 + */ + @Min(value = 0, message = "页容量必须大于0") + private Integer pageSize; + + /** + * 房屋地址 + */ + @NotBlank(message = "房屋地址不能为空") + private String houseAddress; + +} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcScreenResidentInfoByCurrentAddressFormDTO.java b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcScreenResidentInfoByCurrentAddressFormDTO.java new file mode 100644 index 00000000..4e83e907 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcScreenResidentInfoByCurrentAddressFormDTO.java @@ -0,0 +1,34 @@ +package com.elink.esua.epdc.dto.epdc.form; + +import lombok.Data; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; + +/** + * @author songyunpeng + * @Description 大屏以人找人参数 + * @create 2020-09-14 + */ +@Data +public class EpdcScreenResidentInfoByCurrentAddressFormDTO { + + /** + * 页码 + */ + @Min(value = 0, message = "页码必须大于0") + private Integer pageIndex; + + /** + * 页容量 + */ + @Min(value = 0, message = "页容量必须大于0") + private Integer pageSize; + + /** + * 当前居住地址 + */ + @NotBlank(message = "居住地址不能为空") + private String currentAddress; + +} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcScreenSelectPeopleDetailFormDTO.java b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcScreenSelectPeopleDetailFormDTO.java new file mode 100644 index 00000000..1c1e5c4e --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcScreenSelectPeopleDetailFormDTO.java @@ -0,0 +1,24 @@ +package com.elink.esua.epdc.dto.epdc.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +/** + * @author songyunpeng + * @Description 大屏找人接口详情参数 + * @create 2020-09-14 + */ +@Data +public class EpdcScreenSelectPeopleDetailFormDTO { + + /** + * 人口ID + */ + private String populationId; + /** + * 身份标识 + */ + @NotBlank(message = "身份标识不能为空") + private String identifyFlag; +} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcScreenSelectPeopleFormDTO.java b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcScreenSelectPeopleFormDTO.java new file mode 100644 index 00000000..19ec994f --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcScreenSelectPeopleFormDTO.java @@ -0,0 +1,43 @@ +package com.elink.esua.epdc.dto.epdc.form; + +import lombok.Data; + +import javax.validation.constraints.Min; + +/** + * @author songyunpeng + * @Description 大屏找人接口参数 + * @create 2020-09-14 + */ +@Data +public class EpdcScreenSelectPeopleFormDTO { + + /** + * 页码 + */ + @Min(value = 1, message = "页码必须大于0") + private Integer pageIndex; + + /** + * 页容量 + */ + @Min(value = 1, message = "页容量必须大于0") + private Integer pageSize; + + /** + * 姓名 + */ + private String name; + /** + * 社区ID + */ + private String communityId; + /** + * 电话 + */ + private String phone; + /** + * 网格ID + */ + private String gridId; +} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcVolunteerKindnessTimeUpdateFormDTO.java b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcVolunteerKindnessTimeUpdateFormDTO.java new file mode 100644 index 00000000..1041f9fc --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcVolunteerKindnessTimeUpdateFormDTO.java @@ -0,0 +1,29 @@ +package com.elink.esua.epdc.dto.epdc.form; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.List; + +/** + * + * 增加志愿者爱心时长Form DTO + * + * @Author:liuchuang + * @Date:2020/2/7 18:29 + */ +@Data +public class EpdcVolunteerKindnessTimeUpdateFormDTO implements Serializable { + private static final long serialVersionUID = 6680590022205970530L; + + /** + * 爱心时长 + */ + private BigDecimal kindnessTime; + + /** + * 用户ID + */ + private List userIds; +} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/EpdcScreenGridRankingResultDTO.java b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/EpdcScreenGridRankingResultDTO.java new file mode 100644 index 00000000..b53f3e19 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/EpdcScreenGridRankingResultDTO.java @@ -0,0 +1,20 @@ +package com.elink.esua.epdc.dto.epdc.result; + +import lombok.Data; + +/** + * @author songyunpeng + * @Description 大屏房屋用途接口结果 + * @create 2020-09-14 + */ +@Data +public class EpdcScreenGridRankingResultDTO { + /** + * 网格名 + */ + private String gridName; + /** + * 数量 + */ + private Integer total; +} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/EpdcScreenHouseInfoByPeopleResultDTO.java b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/EpdcScreenHouseInfoByPeopleResultDTO.java new file mode 100644 index 00000000..e8f435d8 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/EpdcScreenHouseInfoByPeopleResultDTO.java @@ -0,0 +1,37 @@ +package com.elink.esua.epdc.dto.epdc.result; + +import lombok.Data; + +/** + * @author songyunpeng + * @Description 大屏以人找房结果 + * @create 2020-09-14 + */ +@Data +public class EpdcScreenHouseInfoByPeopleResultDTO { + /** + * ID + */ + private String populationId; + /** + * 身份标识 + */ + private String identityFlag; + /** + * 户主姓名 + */ + private String houseHeadName; + /** + * 网格名称 + */ + private String gridName; + /** + * 房屋地址 + */ + private String houseAddress; + /** + * 户主联系电话 + */ + private String houseHeadPhone; + +} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/EpdcScreenHouseUseResultDTO.java b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/EpdcScreenHouseUseResultDTO.java new file mode 100644 index 00000000..d46f15ec --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/EpdcScreenHouseUseResultDTO.java @@ -0,0 +1,58 @@ +package com.elink.esua.epdc.dto.epdc.result; + +import lombok.Data; + +/** + * @author songyunpeng + * @Description 大屏房屋用途接口结果 + * @create 2020-09-14 + */ +@Data +public class EpdcScreenHouseUseResultDTO { + /** + * 房屋数量 + */ + private Integer houseNum; + /** + * 人口数量 + */ + private Integer populationNum; + /** + * 机动车数量 + */ + private Integer motorVehicleNum; + /** + * 党员 + */ + private Integer partyMemberNum; + /** + * 企业数量 + */ + private Integer enterpriseNum; + /** + * 租赁数量 + */ + private Integer rentNumber; + /** + * 自住数量 + */ + private Integer sinceTheLivingNumber; + /** + * 经营数量 + */ + private Integer businessNumber; + /** + * 租赁百分比 + */ + private Integer rentPercent; + /** + * 自住百分比 + */ + private Integer sinceTheLivingNumberPercent; + /** + * 经营百分比 + */ + private Integer businessPercent; + + +} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/EpdcScreenPopulationInfoByHouseResultDTO.java b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/EpdcScreenPopulationInfoByHouseResultDTO.java new file mode 100644 index 00000000..a4ff1ed9 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/EpdcScreenPopulationInfoByHouseResultDTO.java @@ -0,0 +1,37 @@ +package com.elink.esua.epdc.dto.epdc.result; + +import lombok.Data; + +/** + * @author songyunpeng + * @Description 大屏以房找人结果 + * @create 2020-09-14 + */ +@Data +public class EpdcScreenPopulationInfoByHouseResultDTO { + /** + * ID + */ + private String populationId; + /** + * 身份标识 + */ + private String identityFlag; + /** + * 户主姓名 + */ + private String houseHeadName; + /** + * 网格名称 + */ + private String gridName; + /** + * 房屋地址 + */ + private String houseAddress; + /** + * 户主联系电话 + */ + private String houseHeadPhone; + +} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/EpdcScreenResidentInfoByCurrentAddressResultDTO.java b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/EpdcScreenResidentInfoByCurrentAddressResultDTO.java new file mode 100644 index 00000000..a90bf02a --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/EpdcScreenResidentInfoByCurrentAddressResultDTO.java @@ -0,0 +1,30 @@ +package com.elink.esua.epdc.dto.epdc.result; + +import lombok.Data; + +/** + * @author songyunpeng + * @Description 大屏以人找人结果 + * @create 2020-09-14 + */ +@Data +public class EpdcScreenResidentInfoByCurrentAddressResultDTO { + /** + * ID + */ + private String populationId; + /** + * 身份标识 + */ + private String identityFlag; + + /** + * 居住人姓名 + */ + private String residentName; + /** + * 当前居住地址 + */ + private String currentAddress; + +} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/EpdcScreenSelectPeopleDetailResultDTO.java b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/EpdcScreenSelectPeopleDetailResultDTO.java new file mode 100644 index 00000000..83db7f0f --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/EpdcScreenSelectPeopleDetailResultDTO.java @@ -0,0 +1,38 @@ +package com.elink.esua.epdc.dto.epdc.result; + +import lombok.Data; + +import java.util.List; + +/** + * @author songyunpeng + * @Description 大屏找人详情接口结果 + * @create 2020-09-14 + */ +@Data +public class EpdcScreenSelectPeopleDetailResultDTO { + /** + * 姓名 + */ + private String name; + /** + * 性别 + */ + private String sex; + /** + * 年龄 + */ + private String age; + /** + * 电话 + */ + private String phone; + /** + * 房屋信息 + */ + List housingInfo; + /** + * 家庭成员信息 + */ + List familyMember; +} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/EpdcScreenSelectPeopleResultDTO.java b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/EpdcScreenSelectPeopleResultDTO.java new file mode 100644 index 00000000..0d8dc170 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/EpdcScreenSelectPeopleResultDTO.java @@ -0,0 +1,32 @@ +package com.elink.esua.epdc.dto.epdc.result; + +import lombok.Data; + +/** + * @author songyunpeng + * @Description 大屏找人接口结果 + * @create 2020-09-14 + */ +@Data +public class EpdcScreenSelectPeopleResultDTO { + /** + * 姓名 + */ + private String name; + /** + * 网格名 + */ + private String gridName; + /** + * 身份 + */ + private String identityName; + /** + * 身份标识 + */ + private String identityFlag; + /** + * 居民ID + */ + private String populationId; +} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/FamilyMember.java b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/FamilyMember.java new file mode 100644 index 00000000..67d009fc --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/FamilyMember.java @@ -0,0 +1,25 @@ +package com.elink.esua.epdc.dto.epdc.result; + +import lombok.Data; + +/** + * @author songyunpeng + * @Description 大屏找人详情接口 家庭成员信息 + * @create 2020-09-14 + */ +@Data +public class FamilyMember { + /** + * 姓名 + */ + private String name; + /** + * 关系 + */ + private String relation; + /** + * 居住地 + */ + private String currentAddress; + +} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/HousingInfo.java b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/HousingInfo.java new file mode 100644 index 00000000..338392ae --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/HousingInfo.java @@ -0,0 +1,28 @@ +package com.elink.esua.epdc.dto.epdc.result; + +import lombok.Data; + +import java.math.BigDecimal; + +/** + * @author songyunpeng + * @Description 大屏详情接口 房屋信息 + * @create 2020-09-14 + */ +@Data +public class HousingInfo { + + /** + * 房屋地址 + */ + private String houseAddress; + /** + * 房屋面积 + */ + private BigDecimal houseArea; + /** + * 房屋用途 + */ + private String houseUse; + +} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/EpdcScreenPopulationInformationController.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/EpdcScreenPopulationInformationController.java new file mode 100644 index 00000000..50a3980d --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/EpdcScreenPopulationInformationController.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.elink.esua.epdc.controller; + +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.epdc.form.*; +import com.elink.esua.epdc.dto.epdc.result.*; +import com.elink.esua.epdc.service.PopulationInformationService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + + +/** + * 大屏接口 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@RestController +@RequestMapping("screenPopulationInfo") +public class EpdcScreenPopulationInformationController { + + @Autowired + private PopulationInformationService populationInformationService; + /** + * @Description 一人找房接口 + * @Author songyunpeng + * @Date 2020/9/19 + * @Param [dto] + * @return com.elink.esua.epdc.commons.tools.utils.Result> + **/ + @PostMapping("selectHouseByPeople") + public Result> selectHouseByPeople(@RequestBody EpdcScreenHouseInfoByPeopleFormDTO dto){ + return new Result>().ok(populationInformationService.selectHouseByPeople(dto)); + } + /** + * @Description 以房找人接口 + * @Author songyunpeng + * @Date 2020/9/19 + * @Param [dto] + * @return com.elink.esua.epdc.commons.tools.utils.Result> + **/ + @PostMapping("selectPeopleByHouse") + public Result> selectPeopleByHouse(@RequestBody EpdcScreenPopulationInfoByHouseFormDTO dto){ + return new Result>().ok(populationInformationService.selectPeopleByHouse(dto)); + } + + /** + * @Description 以人找人接口 + * @Author songyunpeng + * @Date 2020/9/19 + * @Param [dto] + * @return com.elink.esua.epdc.commons.tools.utils.Result> + **/ + @PostMapping("selectPeopleByCurrentAddress") + public Result> selectPeopleByCurrentAddress(@RequestBody EpdcScreenResidentInfoByCurrentAddressFormDTO dto){ + return new Result>().ok(populationInformationService.selectPeopleByCurrentAddress(dto)); + } + + + /** + * @Description 大屏找人详情接口 + * @Author songyunpeng + * @Date 2020/9/14 + * @Param [dto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + @PostMapping("selectPeopleDetail") + public Result selectPeopleDetail(@RequestBody EpdcScreenSelectPeopleDetailFormDTO dto){ + return populationInformationService.selectPeopleDetail(dto); + } + + /** + * @Description 大屏找人接口 + * @Author songyunpeng + * @Date 2020/9/14 + * @Param [epdcScreenSelectPeopleFormDTO] + * @return com.elink.esua.epdc.commons.tools.utils.Result> + **/ + @PostMapping("selectPeople") + @Deprecated + public Result> selectPeople(@RequestBody EpdcScreenSelectPeopleFormDTO dto){ + return new Result>().ok(populationInformationService.selectPeople(dto)); + } + /** + * @Description 房屋用途数据接口 + * @Author songyunpeng + * @Date 2020/9/15 + * @Param [] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + @PostMapping("housingUse") + @Deprecated + public Result housingUse(){ + return populationInformationService.housingUse(); + } + /** + * @Description 网格排名 + * @Author songyunpeng + * @Date 2020/9/15 + * @Param [dto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + @PostMapping("gridRanking") + @Deprecated + public Result> gridRanking(@RequestBody EpdcScreenGridRankingFormDTO dto){ + return new Result>().ok(populationInformationService.gridRanking(dto)); + } + + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/VolunteerInfoController.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/VolunteerInfoController.java index fd616f44..9527018c 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/VolunteerInfoController.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/VolunteerInfoController.java @@ -24,9 +24,9 @@ import com.elink.esua.epdc.commons.tools.validator.AssertUtils; import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; -import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; import com.elink.esua.epdc.dto.VolunteerInfoDTO; import com.elink.esua.epdc.dto.epdc.form.EpdcVolunteerKindnessTimeFormDTO; +import com.elink.esua.epdc.dto.epdc.form.EpdcVolunteerKindnessTimeUpdateFormDTO; import com.elink.esua.epdc.dto.epdc.result.EpdcAdjustVolunteerPointsDTO; import com.elink.esua.epdc.excel.VolunteerInfoExcel; import com.elink.esua.epdc.service.UserTagService; @@ -189,4 +189,16 @@ public class VolunteerInfoController { return volunteerInfoService.modifyVolunteerKindnessTime(formDto); } + /** + * @Description 更新志愿者爱心时长 + * @Author songyunpeng + * @Date 2020/9/11 + * @Param [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + @PostMapping("updateKindnessTime") + public Result updateKindnessTime(@RequestBody EpdcVolunteerKindnessTimeUpdateFormDTO formDto) { + return volunteerInfoService.updateKindnessTime(formDto); + } + } diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/HousingInformationDao.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/HousingInformationDao.java index b0a6557b..24b32ade 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/HousingInformationDao.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/HousingInformationDao.java @@ -69,4 +69,12 @@ public interface HousingInformationDao extends BaseDao * @return java.util.List **/ List selectBaseResidentInformationExcelList(@Param("houseHeadIds") Set houseHeadIds); + /** + * @Description 根据户主ID获取所有房子信息 + * @Author songyunpeng + * @Date 2020/9/14 + * @Param [houseHeadId] + * @return java.util.List + **/ + List getHouseInfoByHouseHeadID(String houseHeadId); } \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/PopulationInformationDao.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/PopulationInformationDao.java index 9f837e87..47aed26b 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/PopulationInformationDao.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/PopulationInformationDao.java @@ -20,6 +20,8 @@ package com.elink.esua.epdc.dao; import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; import com.elink.esua.epdc.dto.PopulationInfoOverviewDTO; import com.elink.esua.epdc.dto.PopulationInformationDTO; +import com.elink.esua.epdc.dto.epdc.form.*; +import com.elink.esua.epdc.dto.epdc.result.*; import com.elink.esua.epdc.entity.PopulationInformationEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -100,4 +102,91 @@ public interface PopulationInformationDao extends BaseDao + **/ + List selectListPeople(EpdcScreenSelectPeopleFormDTO dto);/** + * @Description 大屏找人接口 - count + * @Author songyunpeng + * @Date 2020/9/14 + * @Param [dto] + * @return java.util.List + **/ + Integer selectCountListPeople(EpdcScreenSelectPeopleFormDTO dto); + /** + * @Description 房屋用途数据接口 + * @Author songyunpeng + * @Date 2020/9/15 + * @Param [] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + EpdcScreenHouseUseResultDTO selectHouseUseDataForScreen(); + /** + * @Description 网格排名 + * @Author songyunpeng + * @Date 2020/9/15 + * @Param [dto] + * @return java.util.List + **/ + List selectListGridRanking(EpdcScreenGridRankingFormDTO dto); + /** + * @Description 网格排名 count + * @Author songyunpeng + * @Date 2020/9/15 + * @Param [dto] + * @return java.util.List + **/ + Integer selectCountListGridRanking(EpdcScreenGridRankingFormDTO dto); + /** + * @Description 一人找房接口 + * @Author songyunpeng + * @Date 2020/9/19 + * @Param [dto] + * @return java.util.List + **/ + List selectHouseByPeople(EpdcScreenHouseInfoByPeopleFormDTO dto); + /** + * @Description 一人找房接口 - count + * @Author songyunpeng + * @Date 2020/9/19 + * @Param [dto] + * @return java.util.List + **/ + Integer selectCountHouseByPeople(EpdcScreenHouseInfoByPeopleFormDTO dto); + /** + * @Description 以房找人 + * @Author songyunpeng + * @Date 2020/9/19 + * @Param [dto] + * @return java.util.List + **/ + List selectPeopleByHouse(EpdcScreenPopulationInfoByHouseFormDTO dto); + /** + * @Description 以房找人 - count + * @Author songyunpeng + * @Date 2020/9/19 + * @Param [dto] + * @return java.util.List + **/ + Integer selectCountPeopleByHouse(EpdcScreenPopulationInfoByHouseFormDTO dto); + /** + * @Description 以人找人 + * @Author songyunpeng + * @Date 2020/9/19 + * @Param [dto] + * @return java.util.List + **/ + List selectPeopleByCurrentAddress(EpdcScreenResidentInfoByCurrentAddressFormDTO dto); + /** + * @Description 以人找人 - count + * @Author songyunpeng + * @Date 2020/9/19 + * @Param [dto] + * @return java.lang.Integer + **/ + Integer selectCountPeopleByCurrentAddress(EpdcScreenResidentInfoByCurrentAddressFormDTO dto); } \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/VolunteerInfoDao.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/VolunteerInfoDao.java index 3d703d28..c6381d10 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/VolunteerInfoDao.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/VolunteerInfoDao.java @@ -22,6 +22,7 @@ import com.elink.esua.epdc.dto.UserTagDTO; import com.elink.esua.epdc.dto.VolunteerInfoDTO; import com.elink.esua.epdc.dto.epdc.form.EpdcAppVolunteerListFormDTO; import com.elink.esua.epdc.dto.epdc.form.EpdcVolunteerKindnessTimeFormDTO; +import com.elink.esua.epdc.dto.epdc.form.EpdcVolunteerKindnessTimeUpdateFormDTO; import com.elink.esua.epdc.dto.epdc.form.v2.EpdcCompleteVolunteerInfoV2FormDTO; import com.elink.esua.epdc.dto.epdc.result.EpdcAdjustVolunteerPointsDTO; import com.elink.esua.epdc.dto.epdc.result.EpdcAppVolunteerListResultDTO; @@ -159,4 +160,12 @@ public interface VolunteerInfoDao extends BaseDao { * @date 2020/7/20 10:53 */ Integer selectListVolunteerCount(); + /** + * @Description 更新公益时长 + * @Author songyunpeng + * @Date 2020/9/11 + * @Param [formDto] + * @return void + **/ + void updateKindnessTime(EpdcVolunteerKindnessTimeUpdateFormDTO formDto); } diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/HousingInformationEntity.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/HousingInformationEntity.java index 0443174d..d0f8fa7b 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/HousingInformationEntity.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/HousingInformationEntity.java @@ -18,13 +18,11 @@ package com.elink.esua.epdc.entity; import com.baomidou.mybatisplus.annotation.TableName; - import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; import lombok.Data; import lombok.EqualsAndHashCode; import java.math.BigDecimal; -import java.util.Date; /** * 房屋信息表 @@ -47,7 +45,7 @@ public class HousingInformationEntity extends BaseEpdcEntity { /** * 购房时间 */ - private Date buyingTime; + private String buyingTime; /** * 房屋面积 diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/PopulationInformationEntity.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/PopulationInformationEntity.java index 0449ce9d..23c8638c 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/PopulationInformationEntity.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/PopulationInformationEntity.java @@ -71,7 +71,7 @@ public class PopulationInformationEntity extends BaseEpdcEntity { /** * 入党时间 */ - private Date joinTime; + private String joinTime; /** * 组织关系所在地 @@ -146,7 +146,7 @@ public class PopulationInformationEntity extends BaseEpdcEntity { /** * 失业登记时间 */ - private Date unemploymentRegisterTime; + private String unemploymentRegisterTime; /** * 家庭类别 (0:普通家庭 1:五好家庭 2:军烈家庭 3:优抚家庭 4:单亲家庭 5:空巢老人 6:困难家庭) diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/excel/BasePopulationInformationExcel.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/excel/BasePopulationInformationExcel.java index 223d061d..1f88c463 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/excel/BasePopulationInformationExcel.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/excel/BasePopulationInformationExcel.java @@ -50,9 +50,6 @@ public class BasePopulationInformationExcel { @Excel(name = "产权人联系电话",width = 20) private String propertyOwnerMobile; - @Excel(name = "产权证") - private String propertyOwnerCard; - @Excel(name = "房屋用途",replace = {"自住_0","租赁_1","经营_2"}) private String houseUse; diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/HousingInformationService.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/HousingInformationService.java index e8fcdd9c..403d1fb0 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/HousingInformationService.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/HousingInformationService.java @@ -129,4 +129,12 @@ public interface HousingInformationService extends BaseService **/ List selectBaseResidentInformationExcelList(Set houseHeadIds); + /** + * @Description 根据户主ID获取所有房子信息 + * @Author songyunpeng + * @Date 2020/9/14 + * @Param [populationId] + * @return java.util.List + **/ + List getHouseInfoByHouseHeadID(String houseHeadId); } \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/PopulationInformationService.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/PopulationInformationService.java index 30247302..69624db3 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/PopulationInformationService.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/PopulationInformationService.java @@ -22,6 +22,8 @@ import com.elink.esua.epdc.commons.tools.page.PageData; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.PopulationInfoOverviewDTO; import com.elink.esua.epdc.dto.PopulationInformationDTO; +import com.elink.esua.epdc.dto.epdc.form.*; +import com.elink.esua.epdc.dto.epdc.result.*; import com.elink.esua.epdc.entity.PopulationInformationEntity; import java.util.List; @@ -159,4 +161,60 @@ public interface PopulationInformationService extends BaseService> + **/ + PageData selectPeople(EpdcScreenSelectPeopleFormDTO epdcScreenSelectPeopleFormDTO); + /** + * @Description 大屏找人详情接口 + * @Author songyunpeng + * @Date 2020/9/14 + * @Param [dto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + Result selectPeopleDetail(EpdcScreenSelectPeopleDetailFormDTO dto); + /** + * @Description 房屋用途数据接口 + * @Author songyunpeng + * @Date 2020/9/15 + * @Param [] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + Result housingUse(); + /** + * @Description 网格排名 + * @Author songyunpeng + * @Date 2020/9/15 + * @Param [dto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + PageData gridRanking(EpdcScreenGridRankingFormDTO dto); + /** + * @Description 一人找房接口 + * @Author songyunpeng + * @Date 2020/9/19 + * @Param [dto] + * @return com.elink.esua.epdc.commons.tools.page.PageData + **/ + PageData selectHouseByPeople(EpdcScreenHouseInfoByPeopleFormDTO dto); + /** + * @Description 以房找人接口 + * @Author songyunpeng + * @Date 2020/9/19 + * @Param [dto] + * @return com.elink.esua.epdc.commons.tools.page.PageData + **/ + PageData selectPeopleByHouse(EpdcScreenPopulationInfoByHouseFormDTO dto); + /** + * @Description 一人找人 + * @Author songyunpeng + * @Date 2020/9/19 + * @Param [dto] + * @return com.elink.esua.epdc.commons.tools.page.PageData + **/ + PageData selectPeopleByCurrentAddress(EpdcScreenResidentInfoByCurrentAddressFormDTO dto); } \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/VolunteerInfoService.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/VolunteerInfoService.java index f51f6ed5..17640a73 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/VolunteerInfoService.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/VolunteerInfoService.java @@ -25,6 +25,7 @@ import com.elink.esua.epdc.dto.VolunteerInfoDTO; import com.elink.esua.epdc.dto.epdc.form.EpdcAppVolunteerListFormDTO; import com.elink.esua.epdc.dto.epdc.form.EpdcCompleteVolunteerInfoFormDTO; import com.elink.esua.epdc.dto.epdc.form.EpdcVolunteerKindnessTimeFormDTO; +import com.elink.esua.epdc.dto.epdc.form.EpdcVolunteerKindnessTimeUpdateFormDTO; import com.elink.esua.epdc.dto.epdc.form.v2.EpdcCompleteVolunteerInfoV2FormDTO; import com.elink.esua.epdc.dto.epdc.result.EpdcAdjustVolunteerPointsDTO; import com.elink.esua.epdc.dto.epdc.result.EpdcAppVolunteerListCountResultDTO; @@ -237,5 +238,12 @@ public interface VolunteerInfoService extends BaseService { */ Result insertV2VolunteerInfo(EpdcCompleteVolunteerInfoV2FormDTO formDTO); - + /** + * @Description 更新公益时长 + * @Author songyunpeng + * @Date 2020/9/11 + * @Param [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + Result updateKindnessTime(EpdcVolunteerKindnessTimeUpdateFormDTO formDto); } diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/HousingInformationServiceImpl.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/HousingInformationServiceImpl.java index b66d8e12..0c237fee 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/HousingInformationServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/HousingInformationServiceImpl.java @@ -51,7 +51,7 @@ import org.springframework.web.multipart.MultipartFile; import java.io.File; import java.math.BigDecimal; import java.util.*; -import java.util.concurrent.ConcurrentHashMap; +import java.util.stream.Collectors; /** * 房屋信息表 @@ -132,22 +132,17 @@ public class HousingInformationServiceImpl extends BaseServiceImpl allHouseResidentEntities = houseResidentDao.selectByMap(residentParams); if (allHouseResidentEntities != null && allHouseResidentEntities.size() == 1) { - //此人只与此房屋关联 + //此户主只与此房屋关联 populationIds.add(houseResidentEntity.getResidentId()); } } - //删除人口信息 -- 只删与且仅与此房屋有关系的人口 + //删除人口信息 -- 删户主信息,居住人信息,户主房屋关联信息,居住人户主关联信息 if (populationIds.size() > 0) { + //(1)删户主信息 - 根据人口ID删 populationInformationService.deleteBatchIds(populationIds); - //且删除此户主对应的居民信息 - //根据此户主ID删除 + //(3)删居住人信息 - 根据人口ID删 Map residentParams = new HashMap<>(); residentParams.put("HOUSE_HEAD_ID", populationIds.get(0)); - houseResidentDao.deleteByMap(residentParams); + List houseResidentEntityList = houseResidentDao.selectByMap(residentParams); + if(houseResidentEntityList!=null && houseResidentEntityList.size()>0){ + List residentIds = houseResidentEntityList.stream().map(HouseResidentEntity::getResidentId).collect(Collectors.toList()); + populationInformationService.deleteBatchIds(residentIds); + //(4)删居住人关联信息 - 根据户主ID删 + houseResidentDao.deleteByMap(residentParams); + } } - //删除关联关系 -- 全删 + //删除户主关联信息 - 根据房屋ID删 houseResidentDao.deleteByMap(params); } //删除房屋信息 @@ -365,7 +362,7 @@ public class HousingInformationServiceImpl extends BaseServiceImpl0){ - populationIdNoAndIdMap = savePopulationList(basePopulationInformationExcels, parentAndAllDeptDTO); + populationIdNoAndIdMap = savePopulationListEnd(basePopulationInformationExcels, parentAndAllDeptDTO); } if(baseResidentInformationExcels!=null && baseResidentInformationExcels.size()>0){ saveResidentList(baseResidentInformationExcels,populationIdNoAndIdMap); @@ -386,6 +383,11 @@ public class HousingInformationServiceImpl extends BaseServiceImpl getHouseInfoByHouseHeadID(String houseHeadId) { + return baseDao.getHouseInfoByHouseHeadID(houseHeadId); + } + /** * @return void * @Description 校验完成后插入居民信息 @@ -420,142 +422,60 @@ public class HousingInformationServiceImpl extends BaseServiceImpl savePopulationList(List basePopulationInformationExcels, ParentAndAllDeptDTO parentAndAllDeptDTO) { - //插入房屋信息 - List housingInformationEntityList = new ArrayList<>(); - + private Map savePopulationListEnd(List basePopulationInformationExcels,ParentAndAllDeptDTO parentAndAllDeptDTO) { + Map populationIdNoAndIdMap = new HashMap<>(); for (BasePopulationInformationExcel basePopulationInformationExcel : basePopulationInformationExcels) { - HousingInformationEntity housingInformationEntity = ConvertUtils.sourceToTarget(basePopulationInformationExcel, HousingInformationEntity.class); + //插入房屋信息 + HousingInformationEntity housingInformationEntity = ConvertUtils.sourceToTarget(basePopulationInformationExcel,HousingInformationEntity.class); housingInformationEntity.setGridId(parentAndAllDeptDTO.getGridId()); - housingInformationEntity.setParentDeptIds(parentAndAllDeptDTO.getParentDeptIds()); - housingInformationEntity.setParentDeptNames(parentAndAllDeptDTO.getParentDeptNames()); - housingInformationEntity.setAllDeptIds(parentAndAllDeptDTO.getAllDeptIds()); housingInformationEntity.setAllDeptNames(parentAndAllDeptDTO.getAllDeptNames()); - housingInformationEntity.setBuyingTime(DateUtil.parse(basePopulationInformationExcel.getBuyingTime())); - housingInformationEntityList.add(housingInformationEntity); - } - insertBatch(housingInformationEntityList); - //组装租赁,经营,户主,房屋人员关系表信息 - List houseRentInfoEntities = new ArrayList<>(); - List houseBusinessInfoEntities = new ArrayList<>(); - //更新户主信息 - List updatePopulationInfo = new ArrayList<>(); - //插入户主信息 - List insertPopulationInfo = new ArrayList<>(); - //房屋户主信息 -- 户主更新 - List houseResidentEntityList = new ArrayList<>(); - //身份证校验 - List identifyNoValidation = new ArrayList<>(); - //存储 key:身份证 value 房子ID 身份证是可重复的 - List> HouseResidentInfos = new ArrayList<>(); - a: - for (HousingInformationEntity housingInformationEntity : housingInformationEntityList) { - for (BasePopulationInformationExcel basePopulationInformationExcel : basePopulationInformationExcels) { - //以产权证为唯一标识 - if (housingInformationEntity.getPropertyOwnerCard().equals(basePopulationInformationExcel.getPropertyOwnerCard())) { - if (HouseUseConstant.RENT.equals(housingInformationEntity.getHouseUse())) { - //房屋租赁信息 - HouseRentInfoEntity houseRentInfoEntity = ConvertUtils.sourceToTarget(basePopulationInformationExcel, HouseRentInfoEntity.class); - houseRentInfoEntity.setHouseId(housingInformationEntity.getId()); - houseRentInfoEntities.add(houseRentInfoEntity); - } else if (HouseUseConstant.BUSINESS.equals(housingInformationEntity.getHouseUse())) { - //房屋经营信息 - HouseBusinessInfoEntity houseBusinessInfoEntity = ConvertUtils.sourceToTarget(basePopulationInformationExcel, HouseBusinessInfoEntity.class); - houseBusinessInfoEntity.setHouseId(housingInformationEntity.getId()); - houseBusinessInfoEntities.add(houseBusinessInfoEntity); - } - //插入户主信息 - PopulationInformationEntity populationInformationEntity = ConvertUtils.sourceToTarget(basePopulationInformationExcel, PopulationInformationEntity.class); - PopulationInformationEntity oldPopulationInformationEntity = populationInformationService.getInfoByIdentityNo(populationInformationEntity.getResidentsIdentityNo()); - if (oldPopulationInformationEntity != null) { - //身份证在列表已存在,则更新户主信息 - populationInformationEntity.setId(oldPopulationInformationEntity.getId()); - //先检验下户主的一些信息 - validateHouseHeadInfo(populationInformationEntity, basePopulationInformationExcel); - updatePopulationInfo.add(populationInformationEntity); - //插入房屋人员关联关系表 - HouseResidentEntity houseResidentEntity = new HouseResidentEntity(); - houseResidentEntity.setHouseId(housingInformationEntity.getId()); - houseResidentEntity.setResidentId(oldPopulationInformationEntity.getId()); - houseResidentEntity.setIsHouseHead("1"); - houseResidentEntityList.add(houseResidentEntity); - } else { - //先检验下户主的一些信息 - validateHouseHeadInfo(populationInformationEntity, basePopulationInformationExcel); - - - //将新增的人员的身份证存到List,防止excel中重复的身份证增加不同的户主信息 - if (!identifyNoValidation.contains(populationInformationEntity.getResidentsIdentityNo())) { - //如果不包含,才新增进去。也就是说如果重复的身份证,只取第一条信息作为户主信息 - insertPopulationInfo.add(populationInformationEntity); - } - identifyNoValidation.add(populationInformationEntity.getResidentsIdentityNo()); - //方便下面新增房屋人员关系表,此时存储所有的户主身份证+房子ID - Map houseResidentInfo = new HashMap<>(); - houseResidentInfo.put(populationInformationEntity.getResidentsIdentityNo(), housingInformationEntity.getId()); - HouseResidentInfos.add(houseResidentInfo); - } - continue a; - } + housingInformationEntity.setAllDeptIds(parentAndAllDeptDTO.getAllDeptIds()); + housingInformationEntity.setParentDeptNames(parentAndAllDeptDTO.getParentDeptNames()); + housingInformationEntity.setParentDeptIds(parentAndAllDeptDTO.getParentDeptIds()); + baseDao.insert(housingInformationEntity); + if(HouseUseConstant.RENT.equals(housingInformationEntity.getHouseUse())){ + //房屋租赁信息 + HouseRentInfoEntity houseRentInfoEntity = ConvertUtils.sourceToTarget(basePopulationInformationExcel,HouseRentInfoEntity.class); + houseRentInfoEntity.setHouseId(housingInformationEntity.getId()); + houseRentInfoService.insert(houseRentInfoEntity); + }else if(HouseUseConstant.BUSINESS.equals(housingInformationEntity.getHouseUse())){ + //房屋经营信息 + HouseBusinessInfoEntity houseBusinessInfoEntity = ConvertUtils.sourceToTarget(basePopulationInformationExcel,HouseBusinessInfoEntity.class); + houseBusinessInfoEntity.setHouseId(housingInformationEntity.getId()); + houseBusinessInfoService.insert(houseBusinessInfoEntity); } - } - //插入租赁信息 - if (houseRentInfoEntities.size() > 0) { - houseRentInfoService.insertBatch(houseRentInfoEntities); - } - //插入经营信息 - if (houseBusinessInfoEntities.size() > 0) { - houseBusinessInfoService.insertBatch(houseBusinessInfoEntities); - } - //如果人口信息身份证已有,则更新人口信息 - if (updatePopulationInfo.size() > 0) { - populationInformationService.updateBatchById(updatePopulationInfo); - } - //插入人口信息 - if (insertPopulationInfo.size() > 0) { - populationInformationService.insertBatch(insertPopulationInfo); - //遍历存储的身份证+房子ID对应信息,组装房屋人员关系 - for (Map houseResidentInfo : HouseResidentInfos) { - Set> set = houseResidentInfo.entrySet(); - for (Map.Entry entry : set) { - String identifyNo = entry.getKey(); - String houseId = entry.getValue(); - //根据身份证取户主ID - for (PopulationInformationEntity populationInformationEntity : insertPopulationInfo) { - if (populationInformationEntity.getResidentsIdentityNo().equals(identifyNo)) { - HouseResidentEntity houseResidentEntity = new HouseResidentEntity(); - houseResidentEntity.setHouseId(houseId); - houseResidentEntity.setResidentId(populationInformationEntity.getId()); - houseResidentEntity.setIsHouseHead("1"); - houseResidentEntityList.add(houseResidentEntity); - break; - } - } - } - + //插入户主信息 + PopulationInformationEntity populationInformationEntity = ConvertUtils.sourceToTarget(basePopulationInformationExcel,PopulationInformationEntity.class); + PopulationInformationEntity oldPopulationInformationEntity= populationInformationService.getInfoByIdentityNo(populationInformationEntity.getResidentsIdentityNo()); + //校验户主信息 + validateHouseHeadInfo(populationInformationEntity,basePopulationInformationExcel); + if(oldPopulationInformationEntity!=null){ + //身份证在列表已存在,则更新户主信息 + populationInformationEntity.setId(oldPopulationInformationEntity.getId()); + populationInformationService.updateById(populationInformationEntity); + }else { + //校验户主信息 + populationInformationService.insert(populationInformationEntity); } + //插入房屋人员关联关系表 + HouseResidentEntity houseResidentEntity = new HouseResidentEntity(); + houseResidentEntity.setHouseId(housingInformationEntity.getId()); + houseResidentEntity.setResidentId(populationInformationEntity.getId()); + houseResidentEntity.setIsHouseHead("1"); + houseResidentDao.insert(houseResidentEntity); + populationIdNoAndIdMap.put(basePopulationInformationExcel.getResidentsIdentityNo(),populationInformationEntity.getId()); } - //插入房屋人员关系 - if (houseResidentEntityList.size() > 0) { - houseResidentService.insertBatch(houseResidentEntityList); - } - //组装人口身份证和ID信息 辅助添加居民信息 - insertPopulationInfo.addAll(updatePopulationInfo); - Map populationIdNoAndIdMap = new HashMap<>(); - insertPopulationInfo.forEach(i -> { - populationIdNoAndIdMap.put(i.getResidentsIdentityNo(),i.getId()); - }); return populationIdNoAndIdMap; } + /** * @return void * @Description 校验excel新增时户主的一些信息 @@ -564,14 +484,6 @@ public class HousingInformationServiceImpl extends BaseServiceImpl * @Description 校验居住人数据 @@ -732,11 +665,9 @@ public class HousingInformationServiceImpl extends BaseServiceImpl checkPopulationExcel(List basePopulationInformationExcels, List sysPopulationSimpleDictDTOS) { - List housingInformationDTOS = list(new HashMap<>()); // 不匹配信息 List errorLineInfoList = new ArrayList<>(); EpdcPopulationErrorResultDTO errorLineInfoDto; - Map isPropertyOwnerCard = new ConcurrentHashMap<>(); for (int i = 0; i < basePopulationInformationExcels.size(); i++) { BasePopulationInformationExcel basePopulationInformationExcel = basePopulationInformationExcels.get(i); String houseAddress = basePopulationInformationExcel.getHouseAddress()==null?null:basePopulationInformationExcel.getHouseAddress().trim(); @@ -745,7 +676,6 @@ public class HousingInformationServiceImpl extends BaseServiceImpl32){ errorLineInfoDto = new EpdcPopulationErrorResultDTO(); errorLineInfoDto.setErrorLine((i + 2) + ""); - errorLineInfoDto.setErrorInfo("日期格式应为yyyy-MM-dd HH:mm:ss"); + errorLineInfoDto.setErrorInfo("房屋地址字数不能大于32个字符"); errorLineInfoDto.setSheetName("房屋信息和户主信息"); errorLineInfoList.add(errorLineInfoDto); - } else { - if (DateUtil.parse(buyingTime).after(new Date())) { - errorLineInfoDto = new EpdcPopulationErrorResultDTO(); - errorLineInfoDto.setErrorLine((i + 2) + ""); - errorLineInfoDto.setErrorInfo("购房时间不能大于当前时间"); - errorLineInfoDto.setSheetName("房屋信息和户主信息"); - errorLineInfoList.add(errorLineInfoDto); - } } - basePopulationInformationExcel.setBuyingTime(buyingTime); - + basePopulationInformationExcel.setHouseAddress(houseAddress); } - if (houseArea == null) { - errorLineInfoDto = new EpdcPopulationErrorResultDTO(); - errorLineInfoDto.setErrorLine((i + 2) + ""); - errorLineInfoDto.setErrorInfo("房屋面积为空"); - errorLineInfoDto.setSheetName("房屋信息和户主信息"); - errorLineInfoList.add(errorLineInfoDto); + if (StringUtils.isNotBlank(buyingTime)) { + basePopulationInformationExcel.setBuyingTime(buyingTime); } if (StringUtils.isBlank(propertyOwner)) { errorLineInfoDto = new EpdcPopulationErrorResultDTO(); @@ -827,53 +735,35 @@ public class HousingInformationServiceImpl extends BaseServiceImpl32){ + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("产权人字数不能大于32个字符"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } basePopulationInformationExcel.setPropertyOwner(propertyOwner); } - if (StringUtils.isBlank(propertyOwnerIdentityNo)) { - errorLineInfoDto = new EpdcPopulationErrorResultDTO(); - errorLineInfoDto.setErrorLine((i + 2) + ""); - errorLineInfoDto.setErrorInfo("产权人身份证号为空"); - errorLineInfoDto.setSheetName("房屋信息和户主信息"); - errorLineInfoList.add(errorLineInfoDto); - }else if(StringUtils.isNotBlank((propertyOwnerIdentityNo))){ + if(StringUtils.isNotBlank((propertyOwnerIdentityNo))){ + if(propertyOwnerIdentityNo.length()>32){ + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("产权人身份证号不能大于32个字符"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } basePopulationInformationExcel.setPropertyOwnerIdentityNo(propertyOwnerIdentityNo); } - if (StringUtils.isBlank(propertyOwnerMobile)) { - errorLineInfoDto = new EpdcPopulationErrorResultDTO(); - errorLineInfoDto.setErrorLine((i + 2) + ""); - errorLineInfoDto.setErrorInfo("产权人电话为空"); - errorLineInfoDto.setSheetName("房屋信息和户主信息"); - errorLineInfoList.add(errorLineInfoDto); - }else if(StringUtils.isNotBlank((propertyOwnerMobile))){ - basePopulationInformationExcel.setPropertyOwnerMobile(propertyOwnerMobile); - } - if (StringUtils.isBlank(propertyOwnerCard)) { - errorLineInfoDto = new EpdcPopulationErrorResultDTO(); - errorLineInfoDto.setErrorLine((i + 2) + ""); - errorLineInfoDto.setErrorInfo("产权证为空"); - errorLineInfoDto.setSheetName("房屋信息和户主信息"); - errorLineInfoList.add(errorLineInfoDto); - } else if (StringUtils.isNotBlank(propertyOwnerCard)) { - for (HousingInformationDTO housingInformationDTO : housingInformationDTOS) { - if (housingInformationDTO.getPropertyOwnerCard().equals(propertyOwnerCard)) { - errorLineInfoDto = new EpdcPopulationErrorResultDTO(); - errorLineInfoDto.setErrorLine((i + 2) + ""); - errorLineInfoDto.setErrorInfo("产权证已存在"); - errorLineInfoDto.setSheetName("房屋信息和户主信息"); - errorLineInfoList.add(errorLineInfoDto); - } - } - if (isPropertyOwnerCard.containsKey(propertyOwnerCard)) { + if(StringUtils.isNotBlank((propertyOwnerMobile))){ + if(propertyOwnerMobile.length()>32){ errorLineInfoDto = new EpdcPopulationErrorResultDTO(); errorLineInfoDto.setErrorLine((i + 2) + ""); - errorLineInfoDto.setErrorInfo("产权证在EXCEL已存在"); + errorLineInfoDto.setErrorInfo("产权人电话不能大于32个字符"); errorLineInfoDto.setSheetName("房屋信息和户主信息"); errorLineInfoList.add(errorLineInfoDto); } - isPropertyOwnerCard.put(propertyOwnerCard, (i + 2) + ""); - basePopulationInformationExcel.setPropertyOwnerCard(propertyOwnerCard); + basePopulationInformationExcel.setPropertyOwnerMobile(propertyOwnerMobile); } - if (StringUtils.isBlank(houseUse)) { errorLineInfoDto = new EpdcPopulationErrorResultDTO(); errorLineInfoDto.setErrorLine((i + 2) + ""); @@ -898,6 +788,13 @@ public class HousingInformationServiceImpl extends BaseServiceImpl32){ + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("承租人不能大于32个字符"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } basePopulationInformationExcel.setTenantName(tenantName); } if (StringUtils.isBlank(tenantPhone)) { @@ -907,6 +804,13 @@ public class HousingInformationServiceImpl extends BaseServiceImpl32){ + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("承租人电话不能大于32个字符"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } basePopulationInformationExcel.setTenantPhone(tenantPhone); } if (StringUtils.isBlank(tenantIdentityNo)) { @@ -929,22 +833,24 @@ public class HousingInformationServiceImpl extends BaseServiceImpl128){ + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("企业名称不能大于128个字符"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } basePopulationInformationExcel.setEnterpriseName(enterpriseName); } - if (StringUtils.isBlank(legalRepresentative)) { - errorLineInfoDto = new EpdcPopulationErrorResultDTO(); - errorLineInfoDto.setErrorLine((i + 2) + ""); - errorLineInfoDto.setErrorInfo("法人为空"); - errorLineInfoDto.setSheetName("房屋信息和户主信息"); - errorLineInfoList.add(errorLineInfoDto); - }else if(StringUtils.isNotBlank((legalRepresentative))){ + if(StringUtils.isNotBlank((legalRepresentative))){ + if(legalRepresentative.length()>32){ + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("法人代表不能大于32个字符"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } basePopulationInformationExcel.setLegalRepresentative(legalRepresentative); } if (StringUtils.isBlank(enterprisePhone)) { @@ -954,15 +860,23 @@ public class HousingInformationServiceImpl extends BaseServiceImpl32){ + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("企业联系电话大于32个字符"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } basePopulationInformationExcel.setEnterprisePhone(enterprisePhone); } - if (StringUtils.isBlank(socialUniformCode)) { - errorLineInfoDto = new EpdcPopulationErrorResultDTO(); - errorLineInfoDto.setErrorLine((i + 2) + ""); - errorLineInfoDto.setErrorInfo("社会统一代码为空"); - errorLineInfoDto.setSheetName("房屋信息和户主信息"); - errorLineInfoList.add(errorLineInfoDto); - }else if(StringUtils.isNotBlank((socialUniformCode))){ + if(StringUtils.isNotBlank((socialUniformCode))){ + if(socialUniformCode.length()>128){ + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("社会统一代码不能大于128个字符"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } basePopulationInformationExcel.setSocialUniformCode(socialUniformCode); } } @@ -973,24 +887,25 @@ public class HousingInformationServiceImpl extends BaseServiceImpl32){ + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("户主姓名不能大于32个字符"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } basePopulationInformationExcel.setResidentsName(residentsName); } - if (StringUtils.isBlank(residentsNation)) { - errorLineInfoDto = new EpdcPopulationErrorResultDTO(); - errorLineInfoDto.setErrorLine((i + 2) + ""); - errorLineInfoDto.setErrorInfo("民族为空"); - errorLineInfoDto.setSheetName("房屋信息和户主信息"); - errorLineInfoList.add(errorLineInfoDto); - }else if(StringUtils.isNotBlank((residentsNation))){ + if(StringUtils.isNotBlank((residentsNation))){ + if(residentsNation.length()>32){ + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("民族不能大于32个字符"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } basePopulationInformationExcel.setResidentsNation(residentsNation); } - if (StringUtils.isBlank(educationLevel)) { - errorLineInfoDto = new EpdcPopulationErrorResultDTO(); - errorLineInfoDto.setErrorLine((i + 2) + ""); - errorLineInfoDto.setErrorInfo("文化程度为空"); - errorLineInfoDto.setSheetName("房屋信息和户主信息"); - errorLineInfoList.add(errorLineInfoDto); - } if (StringUtils.isNotBlank(educationLevel)) { boolean isMatch = false; for (SysPopulationSimpleDictDTO sysPopulationSimpleDictDTO : sysPopulationSimpleDictDTOS) { @@ -1012,13 +927,6 @@ public class HousingInformationServiceImpl extends BaseServiceImpl32){ + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("组织关系所在地不能大于32个字符"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } basePopulationInformationExcel.setOrganizationalRelationshipLocation(organizationalRelationshipLocation); } } @@ -1103,15 +991,15 @@ public class HousingInformationServiceImpl extends BaseServiceImpl32){ + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("户主联系电话不能大于32个字符"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } basePopulationInformationExcel.setResidentsPhone(residentsPhone); } - if (StringUtils.isBlank(bodyStatus)) { - errorLineInfoDto = new EpdcPopulationErrorResultDTO(); - errorLineInfoDto.setErrorLine((i + 2) + ""); - errorLineInfoDto.setErrorInfo("户主身体状况为空"); - errorLineInfoDto.setSheetName("房屋信息和户主信息"); - errorLineInfoList.add(errorLineInfoDto); - } if (StringUtils.isNotBlank(bodyStatus)) { boolean isMatch = false; for (SysPopulationSimpleDictDTO sysPopulationSimpleDictDTO : sysPopulationSimpleDictDTOS) { @@ -1133,13 +1021,6 @@ public class HousingInformationServiceImpl extends BaseServiceImpl32){ + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("户籍地不能大于32个字符"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } basePopulationInformationExcel.setHouseholdRegistrationPlace(householdRegistrationPlace); } - if (StringUtils.isBlank(employmentStatus)) { - errorLineInfoDto = new EpdcPopulationErrorResultDTO(); - errorLineInfoDto.setErrorLine((i + 2) + ""); - errorLineInfoDto.setErrorInfo("户主是否就业为空"); - errorLineInfoDto.setSheetName("房屋信息和户主信息"); - errorLineInfoList.add(errorLineInfoDto); - } else if (StringUtils.isNotBlank(employmentStatus)) { + if (StringUtils.isNotBlank(employmentStatus)) { boolean isMatch = false; for (SysPopulationSimpleDictDTO sysPopulationSimpleDictDTO : sysPopulationSimpleDictDTOS) { if (PopulationDictConstant.EMPLOYMENT_STATUS.equals(sysPopulationSimpleDictDTO.getDicType())) { @@ -1243,32 +1107,28 @@ public class HousingInformationServiceImpl extends BaseServiceImpl128){ + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("现工作单位不能大于128个字符"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } basePopulationInformationExcel.setCurrentEmployer(currentEmployer); } - if (StringUtils.isBlank(currentEmployerAddress)) { - errorLineInfoDto = new EpdcPopulationErrorResultDTO(); - errorLineInfoDto.setErrorLine((i + 2) + ""); - errorLineInfoDto.setErrorInfo("户主现单位地址为空"); - errorLineInfoDto.setSheetName("房屋信息和户主信息"); - errorLineInfoList.add(errorLineInfoDto); - }else if(StringUtils.isNotBlank((currentEmployerAddress))){ + if(StringUtils.isNotBlank((currentEmployerAddress))){ + if(currentEmployerAddress.length()>128){ + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("现单位地址不能大于128个字符"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } basePopulationInformationExcel.setCurrentEmployerAddress(currentEmployerAddress); } } else if ("失业".equals(employmentStatus)) { - if (StringUtils.isBlank(unemploymentReason)) { - errorLineInfoDto = new EpdcPopulationErrorResultDTO(); - errorLineInfoDto.setErrorLine((i + 2) + ""); - errorLineInfoDto.setErrorInfo("户主失业原因为空"); - errorLineInfoDto.setSheetName("房屋信息和户主信息"); - errorLineInfoList.add(errorLineInfoDto); - } else if (StringUtils.isNotBlank(unemploymentReason)) { + if (StringUtils.isNotBlank(unemploymentReason)) { boolean isMatch = false; for (SysPopulationSimpleDictDTO sysPopulationSimpleDictDTO : sysPopulationSimpleDictDTOS) { if (PopulationDictConstant.UNEMPLOYMENT_REASON.equals(sysPopulationSimpleDictDTO.getDicType())) { @@ -1289,13 +1149,7 @@ public class HousingInformationServiceImpl extends BaseServiceImpl 0 && StringUtils.isBlank(motorVehicleCategory)) { - errorLineInfoDto = new EpdcPopulationErrorResultDTO(); - errorLineInfoDto.setErrorLine((i + 2) + ""); - errorLineInfoDto.setErrorInfo("机动车类型为空"); - errorLineInfoDto.setSheetName("房屋信息和户主信息"); - errorLineInfoList.add(errorLineInfoDto); - } else if (StringUtils.isNotBlank(motorVehicleCategory)) { + if (StringUtils.isNotBlank(motorVehicleCategory)) { //处理多选类型 String[] motorVehicleCategoryStrings = motorVehicleCategory.split(","); Integer matchNum = 0; @@ -1440,16 +1242,11 @@ public class HousingInformationServiceImpl extends BaseServiceImpl page(Map params) { @@ -78,8 +88,8 @@ public class PopulationInformationServiceImpl extends BaseServiceImpl getWrapper(Map params){ - String id = (String)params.get(FieldConstant.ID_HUMP); + 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); @@ -98,19 +108,19 @@ public class PopulationInformationServiceImpl extends BaseServiceImpl params = new HashMap<>(); - params.put("RESIDENT_ID",infoByIdentityNo.getId()); + if (infoByIdentityNo != null) { + Map params = new HashMap<>(); + params.put("RESIDENT_ID", infoByIdentityNo.getId()); List houseResidentEntities = houseResidentDao.selectByMap(params); - if(houseResidentEntities.size()>0){ + if (houseResidentEntities.size() > 0) { //2.此人有房屋信息,且为第一次提交则此时提示前端 - if("0".equals(dto.getIsSubmit())){ + if ("0".equals(dto.getIsSubmit())) { StringBuffer sb = new StringBuffer(); for (HouseResidentEntity houseResidentEntity : houseResidentEntities) { HousingInformationEntity housingInformationEntity = housingInformationService.selectById(houseResidentEntity.getHouseId()); sb.append(",\"").append(housingInformationEntity.getHouseAddress()).append("\""); } - String result ="您在地址为"+sb.substring(1)+"下已有房产信息,点击确认则新增此房产且更新居民信息!"; + String result = "您在地址为" + sb.substring(1) + "下已有房产信息,点击确认则新增此房产且更新居民信息!"; return new Result().ok(result.substring(1)); } //2.第二次提交,则更新户主信息且新增关联信息 @@ -141,68 +151,81 @@ public class PopulationInformationServiceImpl extends BaseServiceImpl params = new HashMap<>(); - params.put("RESIDENT_ID",infoByIdentityNo.getId()); + Map params = new HashMap<>(); + params.put("RESIDENT_ID", infoByIdentityNo.getId()); List houseResidentEntities = houseResidentDao.selectByMap(params); - if(houseResidentEntities.size()>0){ + if (houseResidentEntities.size() > 0) { //2.此人有房屋信息,且为第一次提交则此时提示前端 - if("0".equals(dto.getIsSubmit())){ + if ("0".equals(dto.getIsSubmit())) { StringBuffer sb = new StringBuffer(); for (HouseResidentEntity houseResidentEntity : houseResidentEntities) { HousingInformationEntity housingInformationEntity = housingInformationService.selectById(houseResidentEntity.getHouseId()); sb.append(",\"").append(housingInformationEntity.getHouseAddress()).append("\""); } - String result ="您在地址为"+sb.substring(1)+"下已有房产信息,点击确认则新增此房产且更新居民信息!"; + String result = "您在地址为" + sb.substring(1) + "下已有房产信息,点击确认则新增此房产且更新居民信息!"; return new Result().ok(result.substring(1)); } //2.第二次提交,则更新户主信息 PopulationInformationEntity entity = ConvertUtils.sourceToTarget(dto, PopulationInformationEntity.class); entity.setId(infoByIdentityNo.getId()); //置空其他选择信息-防止导出时数据出错 - if("0".equals(dto.getPoliticsStatus())){ + if ("0".equals(dto.getPoliticsStatus())) { //如果表单选择的是群众,则清空入党时间和组织关系所在地 this.setJionTimeToNull(entity.getId()); entity.setJoinTime(null); entity.setOrganizationalRelationshipLocation(""); } - if("0".equals(dto.getEmploymentStatus())){ + if ("0".equals(dto.getEmploymentStatus())) { //如果表单选择的是在岗,则清空失业原因,再就业优惠政,失业登记和失业登记时间 entity.setUnemploymentReason(""); entity.setReemploymentPermit(""); @@ -210,11 +233,11 @@ public class PopulationInformationServiceImpl extends BaseServiceImpl selectPeople(EpdcScreenSelectPeopleFormDTO dto) { + int pageIndex = (dto.getPageIndex() - NumConstant.ONE) * dto.getPageSize(); + dto.setPageIndex(pageIndex); + List list = baseDao.selectListPeople(dto); + return new PageData<>(list, baseDao.selectCountListPeople(dto)); + } + + @Override + public Result selectPeopleDetail(EpdcScreenSelectPeopleDetailFormDTO dto) { + EpdcScreenSelectPeopleDetailResultDTO epdcScreenSelectPeopleDetailResultDTO = new EpdcScreenSelectPeopleDetailResultDTO(); + //根据身份标识寻找对应人员信息 + if (PopulationIdentify.HOUSE_HEAD.equals(dto.getIdentifyFlag())) { + if (StringUtils.isBlank(dto.getPopulationId())) { + return new Result().error("查询产权人信息失败:人口ID为空"); + } + //根据户主ID组装信息 + setHouseHeadInfo(dto.getPopulationId(),epdcScreenSelectPeopleDetailResultDTO); + return new Result().ok(epdcScreenSelectPeopleDetailResultDTO); + } else if (PopulationIdentify.HOUSE_RESIDENT.equals(dto.getIdentifyFlag())) { + if (StringUtils.isBlank(dto.getPopulationId())) { + return new Result().error("查询居住人信息失败:人口ID为空"); + } + //查找居住人对应的户主细腻 + Map params = new HashMap<>(); + params.put("RESIDENT_ID", dto.getPopulationId()); + List houseResidentEntityList = houseResidentDao.selectByMap(params); + if(houseResidentEntityList==null || houseResidentEntityList.size()==0){ + return new Result().error("根据居住人查询户主失败"); + } + HouseResidentEntity houseResidentEntity = houseResidentEntityList.get(0); + //根据户主ID组装信息 + setHouseHeadInfo(houseResidentEntity.getHouseHeadId(),epdcScreenSelectPeopleDetailResultDTO); + return new Result().ok(epdcScreenSelectPeopleDetailResultDTO); + } + return new Result().error("查询错误:身份标识参数无法匹配"); + } + + private void setHouseHeadInfo(String houseHeadId,EpdcScreenSelectPeopleDetailResultDTO epdcScreenSelectPeopleDetailResultDTO ){ + //如果是户主,人口信息从人口表拿 + PopulationInformationEntity populationInformationEntity = this.selectById(houseHeadId); + epdcScreenSelectPeopleDetailResultDTO.setName(populationInformationEntity.getResidentsName()); + epdcScreenSelectPeopleDetailResultDTO.setSex("0".equals(populationInformationEntity.getResidentsSex()) ? "女" : "男"); + if (IdentityNoUtils.IdentityNoVerification(populationInformationEntity.getResidentsIdentityNo()) == null) { + epdcScreenSelectPeopleDetailResultDTO.setAge(IdentityNoUtils.getAge(populationInformationEntity.getResidentsIdentityNo()) + ""); + } else { + epdcScreenSelectPeopleDetailResultDTO.setAge(""); + } + epdcScreenSelectPeopleDetailResultDTO.setPhone(populationInformationEntity.getResidentsPhone()); + //房屋信息 + List housingInformationDTOList = housingInformationService.getHouseInfoByHouseHeadID(houseHeadId); + List housingInfoList = ConvertUtils.sourceToTarget(housingInformationDTOList, HousingInfo.class); + housingInfoList.forEach(housingInfo -> { + setHouseUse(housingInfo.getHouseUse(), housingInfo); + }); + epdcScreenSelectPeopleDetailResultDTO.setHousingInfo(housingInfoList); + //居住人信息 + List familyMemberList = new ArrayList<>(); + Set houseHeadIds = new HashSet<>(1); + houseHeadIds.add(houseHeadId); + List baseResidentInformationExportDtos = housingInformationService.selectBaseResidentInformationExcelList(houseHeadIds); + baseResidentInformationExportDtos.forEach(a -> { + FamilyMember familyMember = new FamilyMember(); + familyMember.setName(a.getResidentsName()); + familyMember.setCurrentAddress(a.getCurrentAddress()); + switch (a.getHouseHeadRelation()) { + case HouseHeadRelationConstant.CHILDREN: + familyMember.setRelation("子女"); + break; + case HouseHeadRelationConstant.HUSBAND_AND_WIFE: + familyMember.setRelation("夫妻"); + break; + case HouseHeadRelationConstant.PARENT: + familyMember.setRelation("父母"); + break; + case HouseHeadRelationConstant.OTHER: + familyMember.setRelation("其他"); + break; + default: + familyMember.setRelation(""); + break; + } + familyMemberList.add(familyMember); + }); + epdcScreenSelectPeopleDetailResultDTO.setFamilyMember(familyMemberList); + } + + @Override + public Result housingUse() { + EpdcScreenHouseUseResultDTO epdcScreenHouseUseResultDTO = baseDao.selectHouseUseDataForScreen(); + PopulationInfoOverviewDTO populationInfoOverview = this.getPopulationInfoOverview(); + epdcScreenHouseUseResultDTO.setHouseNum(populationInfoOverview.getHouseNum()); + epdcScreenHouseUseResultDTO.setPopulationNum(populationInfoOverview.getPopulationNum()); + epdcScreenHouseUseResultDTO.setMotorVehicleNum(populationInfoOverview.getMotorVehicleNum()); + epdcScreenHouseUseResultDTO.setPopulationNum(populationInfoOverview.getPopulationNum()); + epdcScreenHouseUseResultDTO.setEnterpriseNum(populationInfoOverview.getBusiness()); + return new Result().ok(epdcScreenHouseUseResultDTO); + } + + @Override + public PageData gridRanking(EpdcScreenGridRankingFormDTO dto) { + int pageIndex = (dto.getPageIndex() - NumConstant.ONE) * dto.getPageSize(); + dto.setPageIndex(pageIndex); + List list = baseDao.selectListGridRanking(dto); + return new PageData<>(list, baseDao.selectCountListGridRanking(dto)); + } + + @Override + public PageData selectHouseByPeople(EpdcScreenHouseInfoByPeopleFormDTO dto) { + int pageIndex = (dto.getPageIndex() - NumConstant.ONE) * dto.getPageSize(); + dto.setPageIndex(pageIndex); + List list = baseDao.selectHouseByPeople(dto); + return new PageData<>(list, baseDao.selectCountHouseByPeople(dto)); } + + @Override + public PageData selectPeopleByHouse(EpdcScreenPopulationInfoByHouseFormDTO dto) { + int pageIndex = (dto.getPageIndex() - NumConstant.ONE) * dto.getPageSize(); + dto.setPageIndex(pageIndex); + List list = baseDao.selectPeopleByHouse(dto); + return new PageData<>(list, baseDao.selectCountPeopleByHouse(dto)); + } + + @Override + public PageData selectPeopleByCurrentAddress(EpdcScreenResidentInfoByCurrentAddressFormDTO dto) { + int pageIndex = (dto.getPageIndex() - NumConstant.ONE) * dto.getPageSize(); + dto.setPageIndex(pageIndex); + List list = baseDao.selectPeopleByCurrentAddress(dto); + return new PageData<>(list, baseDao.selectCountPeopleByCurrentAddress(dto)); + } + + private void setHouseUse(String houseUse, HousingInfo housingInfo) { + switch (houseUse) { + case HouseUseConstant.RENT: + housingInfo.setHouseUse("租赁"); + break; + case HouseUseConstant.SINCE_THE_LIVING: + housingInfo.setHouseUse("自住"); + break; + case HouseUseConstant.BUSINESS: + housingInfo.setHouseUse("经营"); + break; + default: + housingInfo.setHouseUse(""); + break; + } + } } \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/VolunteerInfoServiceImpl.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/VolunteerInfoServiceImpl.java index 78c4760b..478359f2 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/VolunteerInfoServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/VolunteerInfoServiceImpl.java @@ -28,7 +28,6 @@ import com.elink.esua.epdc.commons.tools.constant.FieldConstant; import com.elink.esua.epdc.commons.tools.constant.NumConstant; import com.elink.esua.epdc.commons.tools.enums.UserTagEnum; import com.elink.esua.epdc.commons.tools.page.PageData; -import com.elink.esua.epdc.commons.tools.security.user.SecurityUser; import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.constant.UserFieldConsant; @@ -37,10 +36,7 @@ import com.elink.esua.epdc.dao.VolunteerInfoDao; import com.elink.esua.epdc.dto.ParentAndAllDeptDTO; import com.elink.esua.epdc.dto.UserTagDTO; import com.elink.esua.epdc.dto.VolunteerInfoDTO; -import com.elink.esua.epdc.dto.epdc.form.EpdcAppVolunteerListFormDTO; -import com.elink.esua.epdc.dto.epdc.form.EpdcCompleteVolunteerInfoFormDTO; -import com.elink.esua.epdc.dto.epdc.form.EpdcInformationFormDTO; -import com.elink.esua.epdc.dto.epdc.form.EpdcVolunteerKindnessTimeFormDTO; +import com.elink.esua.epdc.dto.epdc.form.*; import com.elink.esua.epdc.dto.epdc.form.v2.EpdcCompleteVolunteerInfoV2FormDTO; import com.elink.esua.epdc.dto.epdc.result.EpdcAdjustVolunteerPointsDTO; import com.elink.esua.epdc.dto.epdc.result.EpdcAppVolunteerListCountResultDTO; @@ -445,4 +441,10 @@ public class VolunteerInfoServiceImpl extends BaseServiceImpl @@ -178,6 +177,13 @@ order by t.CREATED_TIME desc + \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/PopulationInformationDao.xml b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/PopulationInformationDao.xml index b3fc8da5..adaa37b9 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/PopulationInformationDao.xml +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/PopulationInformationDao.xml @@ -175,6 +175,311 @@ from epdc_population_information where DEL_FLAG = 0 and RESIDENTS_IDENTITY_NO is not null and RESIDENTS_IDENTITY_NO != '')a on 1=1 where t.DEL_FLAG ='0'; + + + + + + + + + + + \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/VolunteerInfoDao.xml b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/VolunteerInfoDao.xml index 08f097f2..6e38f270 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/VolunteerInfoDao.xml +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/VolunteerInfoDao.xml @@ -291,4 +291,14 @@ USER_ID = #{userId} AND DEL_FLAG = '0' + + UPDATE epdc_volunteer_info + SET KINDNESS_TIME = ( KINDNESS_TIME + #{kindnessTime} ) + WHERE + USER_ID in + + #{userId} + + AND DEL_FLAG = '0' +