all
huanghongfa
2021-02-25 46e7cd9daeb5072eb562317520307a1d60b1446e
all
15个文件已添加
53个文件已修改
2267 ■■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/.idea/workspace.xml 140 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/LOG_HOME_IS_UNDEFINED/auth.log.2021-02-20.log 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/LOG_HOME_IS_UNDEFINED/service_community.log.2021-02-20.log 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/LOG_HOME_IS_UNDEFINED/service_partybuilding.log.2021-02-20.log 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/CommonApi.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/DiscussApi.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/IndexApi.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/LoginApi.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/PartyBuildingApi.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/UserApi.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/weixin/CheckService.java 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/applets/src/main/resources/logback-spring.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/applets_backstage/src/main/resources/logback-spring.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/auth/src/main/resources/logback-spring.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/exceptions/GlobalExceptionCapture.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/advertisement/ComOpsAdvJumpDTO.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/community/ExportUserDTO.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/user/EexcelUserDTO.java 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/LoginUserInfoVO.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/advertisement/ComOpsAdvJumpVO.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComMngStructAreaVO.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/user/CommunityUserInfoVO.java 95 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/user/UserService.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/FileUtil.java 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/IdCard.java 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/SFTPUtil.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/target/classes/com/panzhihua/common/exceptions/GlobalExceptionCapture.class 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/target/classes/com/panzhihua/common/model/dtos/advertisement/ComOpsAdvJumpDTO.class 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/target/classes/com/panzhihua/common/model/dtos/community/ExportUserDTO.class 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/target/classes/com/panzhihua/common/model/dtos/user/EexcelUserDTO.class 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/target/classes/com/panzhihua/common/model/vos/LoginUserInfoVO.class 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/target/classes/com/panzhihua/common/model/vos/advertisement/ComOpsAdvJumpVO.class 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/target/classes/com/panzhihua/common/model/vos/community/ComMngStructAreaVO.class 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/target/classes/com/panzhihua/common/model/vos/user/CommunityUserInfoVO.class 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/target/classes/com/panzhihua/common/service/community/CommunityService.class 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/target/classes/com/panzhihua/common/service/user/UserService.class 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/target/classes/com/panzhihua/common/utlis/FileUtil.class 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/target/classes/com/panzhihua/common/utlis/IdCard.class 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/target/classes/com/panzhihua/common/utlis/SFTPUtil.class 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/target/classes/com/panzhihua/common/utlis/蓝湖国际.xlsx 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/CommunityManagerApi.java 265 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/easyexcel/UploadEexcelUserDTOListener.java 122 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/excel/CustomSheetWriteHandler.java 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/resources/logback-spring.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/CommunityApi.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngStructAreaDAO.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngStructHouseUserDAO.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComOpsAdvJumpDO.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComActActivityService.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComMngStructAreaService.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActActivityServiceImpl.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngStructAreaServiceImpl.java 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngStructHouseServiceImpl.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/logback-spring.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/resources/logback-spring.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/api/UserApi.java 69 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/dao/SysUserInputDAO.java 57 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/dao/UserDao.java 154 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/model/dos/SysUserInputDO.java 162 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/SysUserInputService.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/UserService.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/SysUserInputServiceImpl.java 171 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java 132 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/logback-spring.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/zuul/src/main/java/com/panzhihua/zuul/filters/JWTAuthenticationTokenFilter.java 175 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/zuul/src/main/java/com/panzhihua/zuul/filters/SercuritFilter.java 96 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/zuul/src/main/resources/logback-spring.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/.idea/workspace.xml
@@ -23,9 +23,18 @@
  </component>
  <component name="ChangeListManager">
    <list default="true" id="8ba27629-3e5d-4f42-993e-d0c055bc9371" name="Default Changelist" comment="">
      <change afterPath="$PROJECT_DIR$/applets/src/main/java/com/panzhihua/applets/weixin/CheckService.java" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/common/target/classes/com/panzhihua/common/service/user/UserService.class" beforeDir="false" afterPath="$PROJECT_DIR$/common/target/classes/com/panzhihua/common/service/user/UserService.class" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/community_backstage/src/main/java/com/panzhihua/community_backstage/api/SystemManagementApi.java" beforeDir="false" afterPath="$PROJECT_DIR$/community_backstage/src/main/java/com/panzhihua/community_backstage/api/SystemManagementApi.java" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/applets/src/main/java/com/panzhihua/applets/api/CommonApi.java" beforeDir="false" afterPath="$PROJECT_DIR$/applets/src/main/java/com/panzhihua/applets/api/CommonApi.java" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/applets/src/main/java/com/panzhihua/applets/api/DiscussApi.java" beforeDir="false" afterPath="$PROJECT_DIR$/applets/src/main/java/com/panzhihua/applets/api/DiscussApi.java" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/applets/src/main/java/com/panzhihua/applets/api/IndexApi.java" beforeDir="false" afterPath="$PROJECT_DIR$/applets/src/main/java/com/panzhihua/applets/api/IndexApi.java" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/applets/src/main/java/com/panzhihua/applets/api/PartyBuildingApi.java" beforeDir="false" afterPath="$PROJECT_DIR$/applets/src/main/java/com/panzhihua/applets/api/PartyBuildingApi.java" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/applets/src/main/java/com/panzhihua/applets/api/UserApi.java" beforeDir="false" afterPath="$PROJECT_DIR$/applets/src/main/java/com/panzhihua/applets/api/UserApi.java" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/common/src/main/java/com/panzhihua/common/model/dtos/advertisement/ComOpsAdvJumpDTO.java" beforeDir="false" afterPath="$PROJECT_DIR$/common/src/main/java/com/panzhihua/common/model/dtos/advertisement/ComOpsAdvJumpDTO.java" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/common/src/main/java/com/panzhihua/common/model/vos/advertisement/ComOpsAdvJumpVO.java" beforeDir="false" afterPath="$PROJECT_DIR$/common/src/main/java/com/panzhihua/common/model/vos/advertisement/ComOpsAdvJumpVO.java" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/common/target/classes/com/panzhihua/common/model/dtos/advertisement/ComOpsAdvJumpDTO.class" beforeDir="false" afterPath="$PROJECT_DIR$/common/target/classes/com/panzhihua/common/model/dtos/advertisement/ComOpsAdvJumpDTO.class" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/common/target/classes/com/panzhihua/common/model/vos/advertisement/ComOpsAdvJumpVO.class" beforeDir="false" afterPath="$PROJECT_DIR$/common/target/classes/com/panzhihua/common/model/vos/advertisement/ComOpsAdvJumpVO.class" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComOpsAdvJumpDO.java" beforeDir="false" afterPath="$PROJECT_DIR$/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComOpsAdvJumpDO.java" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java" afterDir="false" />
    </list>
    <option name="SHOW_DIALOG" value="false" />
@@ -39,8 +48,8 @@
  <component name="FileTemplateManagerImpl">
    <option name="RECENT_TEMPLATES">
      <list>
        <option value="Interface" />
        <option value="Kotlin File" />
        <option value="Interface" />
        <option value="Class" />
      </list>
    </option>
@@ -93,11 +102,11 @@
  </component>
  <component name="RecentsManager">
    <key name="CopyClassDialog.RECENTS_KEY">
      <recent name="com.panzhihua.community_backstage.excel" />
      <recent name="com.panzhihua.common.utlis" />
      <recent name="com.panzhihua.applets.api" />
      <recent name="com.panzhihua.timejob.config" />
      <recent name="com.panzhihua.common.model.dtos.community" />
      <recent name="com.panzhihua.common.exceptions" />
      <recent name="com.panzhihua.common.model.vos" />
    </key>
    <key name="CopyFile.RECENT_KEYS">
      <recent name="F:\nahan\panzhihua_zhihuishequ\zhihuishequ\springcloud_k8s_panzhihuazhihuishequ\deploy-file" />
@@ -114,7 +123,7 @@
      </set>
    </option>
  </component>
  <component name="RunManager" selected="Application.UserServiceImpl">
  <component name="RunManager" selected="Application.IdCard">
    <configuration name="ComActActivityServiceImpl" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
      <option name="MAIN_CLASS_NAME" value="com.panzhihua.service_community.service.impl.ComActActivityServiceImpl" />
      <module name="service_community" />
@@ -128,12 +137,12 @@
        <option name="Make" enabled="true" />
      </method>
    </configuration>
    <configuration name="ComBpActivityServiceImpl" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
      <option name="MAIN_CLASS_NAME" value="com.panzhihua.service_dangjian.service.impl.ComBpActivityServiceImpl" />
      <module name="service_partybuilding" />
    <configuration name="IdCard" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
      <option name="MAIN_CLASS_NAME" value="com.panzhihua.common.utlis.IdCard" />
      <module name="common" />
      <extension name="coverage">
        <pattern>
          <option name="PATTERN" value="com.panzhihua.service_dangjian.service.impl.*" />
          <option name="PATTERN" value="com.panzhihua.common.utlis.*" />
          <option name="ENABLED" value="true" />
        </pattern>
      </extension>
@@ -270,10 +279,11 @@
    </configuration>
    <list>
      <item itemvalue="Application.UserServiceImpl" />
      <item itemvalue="Application.ComBpActivityServiceImpl" />
      <item itemvalue="Application.RichTextUtil" />
      <item itemvalue="Application.PartyBuildingApi" />
      <item itemvalue="Application.ComActActivityServiceImpl" />
      <item itemvalue="Application.IdCard" />
      <item itemvalue="Spring Boot.ServiceUserApplication" />
      <item itemvalue="Spring Boot.AppletsApplication" />
      <item itemvalue="Spring Boot.CommunityBackstageApplication" />
      <item itemvalue="Spring Boot.AppletsBackstageApplication" />
@@ -281,18 +291,17 @@
      <item itemvalue="Spring Boot.ConfigServerApplication" />
      <item itemvalue="Spring Boot.EurekaServerApplication" />
      <item itemvalue="Spring Boot.ServiceDangjianApplication" />
      <item itemvalue="Spring Boot.ServiceUserApplication" />
      <item itemvalue="Spring Boot.ZuulApplication" />
      <item itemvalue="Spring Boot.ServiceCommunityApplication" />
      <item itemvalue="Spring Boot.TimejobApplication" />
    </list>
    <recent_temporary>
      <list>
        <item itemvalue="Application.IdCard" />
        <item itemvalue="Application.UserServiceImpl" />
        <item itemvalue="Application.ComActActivityServiceImpl" />
        <item itemvalue="Application.PartyBuildingApi" />
        <item itemvalue="Application.RichTextUtil" />
        <item itemvalue="Application.ComBpActivityServiceImpl" />
      </list>
    </recent_temporary>
  </component>
@@ -418,7 +427,26 @@
      <workItem from="1612406442748" duration="9358000" />
      <workItem from="1612486797044" duration="146000" />
      <workItem from="1612487068003" duration="7000" />
      <workItem from="1612487277561" duration="4832000" />
      <workItem from="1612487277561" duration="7568000" />
      <workItem from="1612516875693" duration="48000" />
      <workItem from="1612517019106" duration="19698000" />
      <workItem from="1612785575000" duration="280000" />
      <workItem from="1612785946464" duration="5000" />
      <workItem from="1612786468574" duration="389000" />
      <workItem from="1612786889245" duration="295000" />
      <workItem from="1613220125395" duration="7000" />
      <workItem from="1613220321791" duration="98000" />
      <workItem from="1613365893297" duration="274000" />
      <workItem from="1613366175434" duration="612000" />
      <workItem from="1613609849178" duration="13230000" />
      <workItem from="1613633203630" duration="14394000" />
      <workItem from="1613714097966" duration="14584000" />
      <workItem from="1613782093187" duration="17613000" />
      <workItem from="1614041234746" duration="1257000" />
      <workItem from="1614047190511" duration="1228000" />
      <workItem from="1614146399536" duration="4002000" />
      <workItem from="1614213754832" duration="85000" />
      <workItem from="1614219125851" duration="3423000" />
    </task>
    <servers />
  </component>
@@ -438,18 +466,18 @@
    <option name="oldMeFiltersMigrated" value="true" />
  </component>
  <component name="WindowStateProjectService">
    <state x="249" y="0" key="#Project_Structure" timestamp="1608546608273">
    <state x="249" y="0" key="#Project_Structure" timestamp="1613697422556">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state x="249" y="0" key="#Project_Structure/0.0.1536.824@0.0.1536.824" timestamp="1608546608273" />
    <state x="249" y="0" key="#Project_Structure/0.0.1536.824@0.0.1536.824" timestamp="1613697422556" />
    <state x="464" y="213" key="#com.intellij.fileTypes.FileTypeChooser" timestamp="1612177264050">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state x="464" y="213" key="#com.intellij.fileTypes.FileTypeChooser/0.0.1536.824@0.0.1536.824" timestamp="1612177264050" />
    <state x="574" y="118" key="#com.intellij.ide.util.MemberChooser" timestamp="1612431598505">
    <state x="574" y="118" key="#com.intellij.ide.util.MemberChooser" timestamp="1613788451041">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state x="574" y="118" key="#com.intellij.ide.util.MemberChooser/0.0.1536.824@0.0.1536.824" timestamp="1612431598505" />
    <state x="574" y="118" key="#com.intellij.ide.util.MemberChooser/0.0.1536.824@0.0.1536.824" timestamp="1613788451041" />
    <state x="405" y="335" key="#com.intellij.refactoring.move.MoveHandler.SelectRefactoringDialog" timestamp="1606099594079">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
@@ -462,14 +490,14 @@
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state x="0" y="0" key="#com.intellij.refactoring.rename.AutomaticRenamingDialog/0.0.1536.824@0.0.1536.824" timestamp="1611214700095" />
    <state x="499" y="159" key="#com.intellij.refactoring.safeDelete.UnsafeUsagesDialog" timestamp="1612314058774">
    <state x="499" y="159" key="#com.intellij.refactoring.safeDelete.UnsafeUsagesDialog" timestamp="1613713199165">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state x="499" y="159" key="#com.intellij.refactoring.safeDelete.UnsafeUsagesDialog/0.0.1536.824@0.0.1536.824" timestamp="1612314058774" />
    <state width="562" height="466" key="DebuggerActiveHint" timestamp="1611891031616">
    <state x="499" y="159" key="#com.intellij.refactoring.safeDelete.UnsafeUsagesDialog/0.0.1536.824@0.0.1536.824" timestamp="1613713199165" />
    <state width="562" height="466" key="DebuggerActiveHint" timestamp="1614222823789">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state width="562" height="466" key="DebuggerActiveHint/0.0.1536.824@0.0.1536.824" timestamp="1611891031616" />
    <state width="562" height="466" key="DebuggerActiveHint/0.0.1536.824@0.0.1536.824" timestamp="1614222823789" />
    <state x="93" y="93" width="1350" height="638" key="DiffContextDialog" timestamp="1612321934878">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
@@ -478,58 +506,58 @@
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state x="549" y="167" key="FileChooserDialogImpl/0.0.1536.824@0.0.1536.824" timestamp="1612426172959" />
    <state width="1031" height="634" key="GridCell.Tab.0.bottom" timestamp="1612511424856">
    <state width="1031" height="265" key="GridCell.Tab.0.bottom" timestamp="1614223349915">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state width="1031" height="634" key="GridCell.Tab.0.bottom/0.0.1536.824@0.0.1536.824" timestamp="1612511424856" />
    <state width="1031" height="634" key="GridCell.Tab.0.center" timestamp="1612511424856">
    <state width="1031" height="265" key="GridCell.Tab.0.bottom/0.0.1536.824@0.0.1536.824" timestamp="1614223349915" />
    <state width="1031" height="265" key="GridCell.Tab.0.center" timestamp="1614223349914">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state width="1031" height="634" key="GridCell.Tab.0.center/0.0.1536.824@0.0.1536.824" timestamp="1612511424856" />
    <state width="1031" height="634" key="GridCell.Tab.0.left" timestamp="1612511424855">
    <state width="1031" height="265" key="GridCell.Tab.0.center/0.0.1536.824@0.0.1536.824" timestamp="1614223349914" />
    <state width="1031" height="265" key="GridCell.Tab.0.left" timestamp="1614223349914">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state width="1031" height="634" key="GridCell.Tab.0.left/0.0.1536.824@0.0.1536.824" timestamp="1612511424855" />
    <state width="1031" height="634" key="GridCell.Tab.0.right" timestamp="1612511424856">
    <state width="1031" height="265" key="GridCell.Tab.0.left/0.0.1536.824@0.0.1536.824" timestamp="1614223349914" />
    <state width="1031" height="265" key="GridCell.Tab.0.right" timestamp="1614223349914">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state width="1031" height="634" key="GridCell.Tab.0.right/0.0.1536.824@0.0.1536.824" timestamp="1612511424856" />
    <state width="1031" height="634" key="GridCell.Tab.1.bottom" timestamp="1612511424856">
    <state width="1031" height="265" key="GridCell.Tab.0.right/0.0.1536.824@0.0.1536.824" timestamp="1614223349914" />
    <state width="1031" height="265" key="GridCell.Tab.1.bottom" timestamp="1614223349915">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state width="1031" height="634" key="GridCell.Tab.1.bottom/0.0.1536.824@0.0.1536.824" timestamp="1612511424856" />
    <state width="1031" height="634" key="GridCell.Tab.1.center" timestamp="1612511424856">
    <state width="1031" height="265" key="GridCell.Tab.1.bottom/0.0.1536.824@0.0.1536.824" timestamp="1614223349915" />
    <state width="1031" height="265" key="GridCell.Tab.1.center" timestamp="1614223349915">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state width="1031" height="634" key="GridCell.Tab.1.center/0.0.1536.824@0.0.1536.824" timestamp="1612511424856" />
    <state width="1031" height="634" key="GridCell.Tab.1.left" timestamp="1612511424856">
    <state width="1031" height="265" key="GridCell.Tab.1.center/0.0.1536.824@0.0.1536.824" timestamp="1614223349915" />
    <state width="1031" height="265" key="GridCell.Tab.1.left" timestamp="1614223349915">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state width="1031" height="634" key="GridCell.Tab.1.left/0.0.1536.824@0.0.1536.824" timestamp="1612511424856" />
    <state width="1031" height="634" key="GridCell.Tab.1.right" timestamp="1612511424856">
    <state width="1031" height="265" key="GridCell.Tab.1.left/0.0.1536.824@0.0.1536.824" timestamp="1614223349915" />
    <state width="1031" height="265" key="GridCell.Tab.1.right" timestamp="1614223349915">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state width="1031" height="634" key="GridCell.Tab.1.right/0.0.1536.824@0.0.1536.824" timestamp="1612511424856" />
    <state width="1031" height="634" key="GridCell.Tab.2.bottom" timestamp="1612511424856">
    <state width="1031" height="265" key="GridCell.Tab.1.right/0.0.1536.824@0.0.1536.824" timestamp="1614223349915" />
    <state width="1031" height="265" key="GridCell.Tab.2.bottom" timestamp="1614223349915">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state width="1031" height="634" key="GridCell.Tab.2.bottom/0.0.1536.824@0.0.1536.824" timestamp="1612511424856" />
    <state width="1031" height="634" key="GridCell.Tab.2.center" timestamp="1612511424856">
    <state width="1031" height="265" key="GridCell.Tab.2.bottom/0.0.1536.824@0.0.1536.824" timestamp="1614223349915" />
    <state width="1031" height="265" key="GridCell.Tab.2.center" timestamp="1614223349915">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state width="1031" height="634" key="GridCell.Tab.2.center/0.0.1536.824@0.0.1536.824" timestamp="1612511424856" />
    <state width="1031" height="634" key="GridCell.Tab.2.left" timestamp="1612511424856">
    <state width="1031" height="265" key="GridCell.Tab.2.center/0.0.1536.824@0.0.1536.824" timestamp="1614223349915" />
    <state width="1031" height="265" key="GridCell.Tab.2.left" timestamp="1614223349915">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state width="1031" height="634" key="GridCell.Tab.2.left/0.0.1536.824@0.0.1536.824" timestamp="1612511424856" />
    <state width="1031" height="634" key="GridCell.Tab.2.right" timestamp="1612511424856">
    <state width="1031" height="265" key="GridCell.Tab.2.left/0.0.1536.824@0.0.1536.824" timestamp="1614223349915" />
    <state width="1031" height="265" key="GridCell.Tab.2.right" timestamp="1614223349915">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state width="1031" height="634" key="GridCell.Tab.2.right/0.0.1536.824@0.0.1536.824" timestamp="1612511424856" />
    <state x="299" y="67" key="Maven.ArtifactSearchDialog" timestamp="1610611848124">
    <state width="1031" height="265" key="GridCell.Tab.2.right/0.0.1536.824@0.0.1536.824" timestamp="1614223349915" />
    <state x="299" y="67" key="Maven.ArtifactSearchDialog" timestamp="1612603382513">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state x="299" y="67" key="Maven.ArtifactSearchDialog/0.0.1536.824@0.0.1536.824" timestamp="1610611848124" />
    <state x="299" y="67" key="Maven.ArtifactSearchDialog/0.0.1536.824@0.0.1536.824" timestamp="1612603382513" />
    <state x="349" y="252" key="MavenRunHelper.GoalEditor" timestamp="1611284568987">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
@@ -538,10 +566,10 @@
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state x="270" y="57" key="SettingsEditor/0.0.1536.824@0.0.1536.824" timestamp="1606120706449" />
    <state width="498" height="540" key="SwitcherDM" timestamp="1612431298209">
    <state width="498" height="540" key="SwitcherDM" timestamp="1612596268481">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state width="498" height="540" key="SwitcherDM/0.0.1536.824@0.0.1536.824" timestamp="1612431298209" />
    <state width="498" height="540" key="SwitcherDM/0.0.1536.824@0.0.1536.824" timestamp="1612596268481" />
    <state x="93" y="93" width="1350" height="638" key="com.intellij.history.integration.ui.views.DirectoryHistoryDialog" timestamp="1612321934878">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
@@ -554,10 +582,10 @@
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state x="93" y="93" width="1350" height="638" key="com.intellij.history.integration.ui.views.SelectionHistoryDialog/0.0.1536.824@0.0.1536.824" timestamp="1611623127978" />
    <state x="233" y="42" width="921" height="782" key="find.popup" timestamp="1612421414933">
    <state x="233" y="42" width="921" height="782" key="find.popup" timestamp="1614219881345">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state x="233" y="42" width="921" height="782" key="find.popup/0.0.1536.824@0.0.1536.824" timestamp="1612421414933" />
    <state x="233" y="42" width="921" height="782" key="find.popup/0.0.1536.824@0.0.1536.824" timestamp="1614219881345" />
    <state width="600" height="428" key="javadoc.popup" timestamp="1610005781618">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
@@ -566,18 +594,18 @@
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state x="131" y="82" key="new project wizard/0.0.1536.824@0.0.1536.824" timestamp="1610606891357" />
    <state x="545" y="169" key="refactoring.ChangeSignatureDialog" timestamp="1611462424079">
    <state x="545" y="169" key="refactoring.ChangeSignatureDialog" timestamp="1613788208222">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state x="545" y="169" key="refactoring.ChangeSignatureDialog/0.0.1536.824@0.0.1536.824" timestamp="1611462424079" />
    <state x="545" y="169" key="refactoring.ChangeSignatureDialog/0.0.1536.824@0.0.1536.824" timestamp="1613788208222" />
    <state x="425" y="187" key="run.anything.popup" timestamp="1611565231827">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state x="425" y="187" key="run.anything.popup/0.0.1536.824@0.0.1536.824" timestamp="1611565231827" />
    <state x="431" y="145" width="672" height="678" key="search.everywhere.popup" timestamp="1611221223000">
    <state x="431" y="145" width="672" height="678" key="search.everywhere.popup" timestamp="1613787820637">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state x="431" y="145" width="672" height="678" key="search.everywhere.popup/0.0.1536.824@0.0.1536.824" timestamp="1611221223000" />
    <state x="431" y="145" width="672" height="678" key="search.everywhere.popup/0.0.1536.824@0.0.1536.824" timestamp="1613787820637" />
  </component>
  <component name="XDebuggerManager">
    <pin-to-top-manager>
springcloud_k8s_panzhihuazhihuishequ/LOG_HOME_IS_UNDEFINED/auth.log.2021-02-20.log
@@ -1554,3 +1554,4 @@
2021-02-25 12:59:57.467 [AsyncResolver-bootstrap-executor-0] INFO  c.n.d.shared.resolver.aws.ConfigClusterResolver - Resolving eureka endpoints via configuration
2021-02-25 13:04:57.467 [AsyncResolver-bootstrap-executor-0] INFO  c.n.d.shared.resolver.aws.ConfigClusterResolver - Resolving eureka endpoints via configuration
2021-02-25 13:09:57.467 [AsyncResolver-bootstrap-executor-0] INFO  c.n.d.shared.resolver.aws.ConfigClusterResolver - Resolving eureka endpoints via configuration
2021-02-25 13:14:57.468 [AsyncResolver-bootstrap-executor-0] INFO  c.n.d.shared.resolver.aws.ConfigClusterResolver - Resolving eureka endpoints via configuration
springcloud_k8s_panzhihuazhihuishequ/LOG_HOME_IS_UNDEFINED/service_community.log.2021-02-20.log
@@ -28881,3 +28881,11 @@
2021-02-25 13:14:00.042 [http-nio-8291-exec-9] INFO  c.p.s.service.impl.ComActActivityServiceImpl - 定时任务--修改社区活动报名状态活动数量【0】
2021-02-25 13:14:00.042 [http-nio-8291-exec-9] INFO  c.p.s.service.impl.ComActActivityServiceImpl - 定时任务--修改社区活动进行状态活动数量【1】
2021-02-25 13:14:00.043 [http-nio-8291-exec-9] INFO  c.p.s.service.impl.ComActActivityServiceImpl - 定时任务--报名结束修改社区活动进行状态活动数量【0】
2021-02-25 13:14:58.996 [AsyncResolver-bootstrap-executor-0] INFO  c.n.d.shared.resolver.aws.ConfigClusterResolver - Resolving eureka endpoints via configuration
2021-02-25 13:15:00.017 [http-nio-8291-exec-6] INFO  c.p.s.service.impl.ComActDynServiceImpl - 定时任务--一共维护社区动态数量【0】
2021-02-25 13:15:00.024 [http-nio-8291-exec-7] WARN  com.alibaba.druid.pool.DruidAbstractDataSource - discard long time none received connection. , jdbcUrl : jdbc:mysql://118.121.197.120:3306/smart_life?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8, version : 1.2.3, lastPacketReceivedIdleMillis : 119990
2021-02-25 13:15:00.025 [http-nio-8291-exec-7] INFO  c.p.s.service.impl.ComActDynServiceImpl - 定时任务--一共刷新社区动态发布状态数量【0】
2021-02-25 13:15:00.065 [http-nio-8291-exec-2] INFO  c.p.s.service.impl.ComActActivityServiceImpl - 定时任务--修改社区活动发布状态活动数量【0】
2021-02-25 13:15:00.066 [http-nio-8291-exec-2] INFO  c.p.s.service.impl.ComActActivityServiceImpl - 定时任务--修改社区活动报名状态活动数量【0】
2021-02-25 13:15:00.067 [http-nio-8291-exec-2] INFO  c.p.s.service.impl.ComActActivityServiceImpl - 定时任务--修改社区活动进行状态活动数量【1】
2021-02-25 13:15:00.067 [http-nio-8291-exec-2] INFO  c.p.s.service.impl.ComActActivityServiceImpl - 定时任务--报名结束修改社区活动进行状态活动数量【0】
springcloud_k8s_panzhihuazhihuishequ/LOG_HOME_IS_UNDEFINED/service_partybuilding.log.2021-02-20.log
@@ -24403,3 +24403,9 @@
2021-02-25 13:14:00.028 [http-nio-8198-exec-7] INFO  c.p.s.service.impl.ComBpActivityServiceImpl - 定时任务修改党建活动--修改报名状态为报名中始数量【0】
2021-02-25 13:14:00.028 [http-nio-8198-exec-7] INFO  c.p.s.service.impl.ComBpActivityServiceImpl - 定时任务修改党建活动--修改进行状态为进行中 或者已结束数量【2】
2021-02-25 13:14:51.458 [AsyncResolver-bootstrap-executor-0] INFO  c.n.d.shared.resolver.aws.ConfigClusterResolver - Resolving eureka endpoints via configuration
2021-02-25 13:15:00.024 [http-nio-8198-exec-4] WARN  com.alibaba.druid.pool.DruidAbstractDataSource - discard long time none received connection. , jdbcUrl : jdbc:mysql://118.121.197.120:3306/smart_life?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8, version : 1.2.3, lastPacketReceivedIdleMillis : 60012
2021-02-25 13:15:00.025 [http-nio-8198-exec-1] INFO  c.p.s.service.impl.ComPbMemberServiceImpl - 定时任务更新党建动态发布状态数量【0】
2021-02-25 13:15:00.026 [http-nio-8198-exec-4] INFO  c.p.s.service.impl.ComPbMemberServiceImpl - 定时任务更新党建动态发布状态数量【0】
2021-02-25 13:15:00.041 [http-nio-8198-exec-9] INFO  c.p.s.service.impl.ComBpActivityServiceImpl - 定时任务修改党建活动--修改发布状态为未开始数量【0】
2021-02-25 13:15:00.041 [http-nio-8198-exec-9] INFO  c.p.s.service.impl.ComBpActivityServiceImpl - 定时任务修改党建活动--修改报名状态为报名中始数量【0】
2021-02-25 13:15:00.042 [http-nio-8198-exec-9] INFO  c.p.s.service.impl.ComBpActivityServiceImpl - 定时任务修改党建活动--修改进行状态为进行中 或者已结束数量【2】
springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/CommonApi.java
@@ -1,5 +1,7 @@
package com.panzhihua.applets.api;
import cn.binarywang.wx.miniapp.api.WxMaSecCheckService;
import com.panzhihua.applets.config.WxMaConfiguration;
import com.panzhihua.common.constants.FtpConstants;
import com.panzhihua.common.constants.UserConstants;
import com.panzhihua.common.model.vos.R;
@@ -8,6 +10,7 @@
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import me.chanjar.weixin.common.error.WxErrorException;
import org.apache.commons.lang3.RandomUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.StringRedisTemplate;
@@ -18,6 +21,8 @@
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.Base64;
import java.util.UUID;
@@ -51,15 +56,36 @@
    @Value("${ftp.url}")
    private String url;
    @Resource
    private WxMaConfiguration wxMaConfiguration;
    @ApiOperation(value = "上传照片")
    @PostMapping(value = "uploadimage",consumes = "multipart/*",headers = "content-type=multipart/form-date")
    public R uploadImage(@RequestParam MultipartFile file, HttpServletRequest request) {
    public R uploadImage(@RequestParam MultipartFile file, HttpServletRequest request) throws IOException {
//        微信图片内容校验
        WxMaSecCheckService wxMaSecCheckService=wxMaConfiguration.getMaService().getSecCheckService();
        String property = System.getProperty("user.dir");
        String fileName = property + File.separator + UUID.randomUUID().toString().replace("-", "")+".jpg";
        File file1=new File(fileName);
        String name = file.getOriginalFilename();
        name= UUID.randomUUID().toString().replaceAll("-","")+".jpg";
        try {
            SFTPUtil sftp = new SFTPUtil(userName,password,host,port);
            sftp.login();
            InputStream is = file.getInputStream();
            file.transferTo(file1);
        try {
            boolean b = wxMaSecCheckService.checkImage(file1);
            boolean delete = file1.delete();
            log.info("临时文件删除【{}】",delete);
            if (!b) {
                return R.fail("图片内容违规");
            }
        } catch (WxErrorException e) {
            log.error("微信审核图片出错【{}】",e.getMessage());
            e.printStackTrace();
        }
            sftp.uploadMore(FtpConstants.FTPFILEPATH_IDCARD, name, is);
            sftp.logout();
            return R.ok(url+"/idcard/" + name);
springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/DiscussApi.java
@@ -1,5 +1,7 @@
package com.panzhihua.applets.api;
import com.panzhihua.applets.config.WxMaConfiguration;
import com.panzhihua.applets.weixin.CheckService;
import com.panzhihua.common.controller.BaseController;
import com.panzhihua.common.model.dtos.community.*;
import com.panzhihua.common.model.vos.LoginUserInfoVO;
@@ -32,10 +34,18 @@
public class DiscussApi extends BaseController {
    @Resource
    private CommunityService communityService;
    @Resource
    private CheckService checkService;
    @ApiOperation(value = "一起议-新增")
    @PostMapping("discuss")
    public R addDiscuss(@RequestBody @Validated(AddGroup.class) ComActDiscussDTO comActDiscussDTO) {
//        微信内容审核
        String discussSubject = comActDiscussDTO.getDiscussSubject();
        if (!checkService.checkMessage(discussSubject)) {
            return R.fail("内容违规");
        }
        Integer type = comActDiscussDTO.getType();
        String voteTitle = comActDiscussDTO.getVoteTitle();
        List<String> discussOptions = comActDiscussDTO.getDiscussOptions();
springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/IndexApi.java
@@ -1,5 +1,6 @@
package com.panzhihua.applets.api;
import com.panzhihua.applets.weixin.CheckService;
import com.panzhihua.common.controller.BaseController;
import com.panzhihua.common.model.dtos.PageDTO;
import com.panzhihua.common.model.dtos.community.ComActEasyPhotoCommentDTO;
@@ -42,6 +43,8 @@
    private CommunityService communityService;
    @Resource
    private UserService userService;
    @Resource
    private CheckService checkService;
    @ApiOperation(value = "分页展示社区随手拍",response = ComActEasyPhotoVO.class)
    @PostMapping("pageeasyphoto")
@@ -59,6 +62,11 @@
    @ApiOperation("上传随手拍")
    @PostMapping("easyphoto")
    public R addEasyPhoto (@RequestBody @Validated(AddGroup.class) ComActEasyPhotoVO comActEasyPhotoVO){
        //        微信内容审核
        String msg = comActEasyPhotoVO.getDetail();
        if (!checkService.checkMessage(msg)) {
            return R.fail("内容违规");
        }
        LoginUserInfoVO loginUserInfo = this.getLoginUserInfo();
        Long communityId = loginUserInfo.getCommunityId();
        if (null==communityId||0==communityId) {
@@ -136,6 +144,11 @@
    @ApiOperation("发布微心愿")
    @PostMapping("microwish")
    public R addMicroWish (@RequestBody @Validated(AddGroup.class) ComActMicroWishVO comActMicroWishVO){
        //        微信内容审核
        String msg = comActMicroWishVO.getDetail();
        if (!checkService.checkMessage(msg)) {
            return R.fail("内容违规");
        }
        LoginUserInfoVO loginUserInfo = this.getLoginUserInfo();
        Long communityId = loginUserInfo.getCommunityId();
        if (null==communityId||0==communityId) {
springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/LoginApi.java
@@ -55,6 +55,7 @@
        if (ObjectUtils.isEmpty(code)) {
            return R.fail("缺少登录参数");
        }
        log.info(code);
        WxMaService maService = wxMaConfiguration.getMaService();
        WxMaJscode2SessionResult sessionInfo=null;
        try {
springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/PartyBuildingApi.java
@@ -1,6 +1,7 @@
package com.panzhihua.applets.api;
import com.alibaba.fastjson.JSONObject;
import com.panzhihua.applets.weixin.CheckService;
import com.panzhihua.common.controller.BaseController;
import com.panzhihua.common.model.dtos.partybuilding.ActivitySignUpDTO;
import com.panzhihua.common.model.dtos.partybuilding.ComPbActivityDTO;
@@ -37,6 +38,8 @@
    private PartyBuildingService partyBuildingService;
    @Resource
    private UserService userService;
    @Resource
    private CheckService checkService;
    @ApiOperation(value = "分页党建动态/政策文件",response =PartyBuildingComPbDynVO.class )
    @PostMapping("pagedynamic")
@@ -156,6 +159,11 @@
    @ApiOperation(value = "创建党员活动")
    @PostMapping("activityinfo")
    public R addActivityinfo(@RequestBody @Validated(AddGroup.class) ComPbActivityDTO comPbActivityDTO) {
        //        微信内容审核
        String msg = comPbActivityDTO.getRichText();
        if (!checkService.checkMessage(msg)) {
            return R.fail("内容违规");
        }
        LoginUserInfoVO loginUserInfo = this.getLoginUserInfo();
        Long userId = loginUserInfo.getUserId();
        Long communityId = loginUserInfo.getCommunityId();
springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/UserApi.java
@@ -2,6 +2,7 @@
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.panzhihua.applets.weixin.CheckService;
import com.panzhihua.common.model.dtos.user.SysUserFeedbackDTO;
import com.panzhihua.common.model.vos.community.*;
import com.panzhihua.common.model.vos.user.ComMngFamilyInfoVO;
@@ -47,6 +48,8 @@
    private CommunityService communityService;
    @Resource
    private PartyBuildingService partyBuildingService;
    @Resource
    private CheckService checkService;
    @ApiOperation(value = "当前登录用户信息", response = LoginUserInfoVO.class)
    @GetMapping("info")
@@ -278,6 +281,11 @@
    @ApiOperation(value = "意见反馈" )
    @PostMapping("feedback")
    public R addFeedback(@RequestBody @Validated(AddGroup.class) SysUserFeedbackDTO sysUserFeedbackDTO) {
        //        微信内容审核
        String msg = sysUserFeedbackDTO.getContent();
        if (!checkService.checkMessage(msg)) {
            return R.fail("内容违规");
        }
        LoginUserInfoVO loginUserInfo = this.getLoginUserInfo();
        Long userId = loginUserInfo.getUserId();
        Long communityId = loginUserInfo.getCommunityId();
springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/weixin/CheckService.java
New file
@@ -0,0 +1,34 @@
package com.panzhihua.applets.weixin;
import cn.binarywang.wx.miniapp.api.WxMaSecCheckService;
import com.panzhihua.applets.config.WxMaConfiguration;
import lombok.extern.slf4j.Slf4j;
import me.chanjar.weixin.common.error.WxErrorException;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
/**
 * @program: springcloud_k8s_panzhihuazhihuishequ
 * @description: 微信内容审查
 * @author: huang.hongfa weixin hhf9596 qq 959656820
 * @create: 2021-02-25 10:57
 **/
@Slf4j
@Service
public class CheckService {
    @Resource
    private WxMaConfiguration wxMaConfiguration;
    public boolean checkMessage(String msg){
        WxMaSecCheckService wxMaSecCheckService=wxMaConfiguration.getMaService().getSecCheckService();
        try {
            boolean b = wxMaSecCheckService.checkMessage(msg);
            return b;
        } catch (WxErrorException e) {
            log.error("微信审核文字内容出错【{}】",e.getMessage());
            e.printStackTrace();
        }
        return false;
    }
}
springcloud_k8s_panzhihuazhihuishequ/applets/src/main/resources/logback-spring.xml
@@ -7,6 +7,7 @@
    <springProfile name="test">
        <property name="LOG_HOME" value="/mnt/data/gocd/log" />
    </springProfile>
<property name="LOG_HOME" value="/mnt/data/gocd/log" />
    <!-- 控制台输出 -->
    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
        <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
springcloud_k8s_panzhihuazhihuishequ/applets_backstage/src/main/resources/logback-spring.xml
@@ -7,6 +7,7 @@
    <springProfile name="test">
        <property name="LOG_HOME" value="/mnt/data/gocd/log" />
    </springProfile>
<property name="LOG_HOME" value="/mnt/data/gocd/log" />
    <!-- 控制台输出 -->
    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
        <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
springcloud_k8s_panzhihuazhihuishequ/auth/src/main/resources/logback-spring.xml
@@ -7,6 +7,7 @@
    <springProfile name="test">
        <property name="LOG_HOME" value="/mnt/data/gocd/log" />
    </springProfile>
<property name="LOG_HOME" value="/mnt/data/gocd/log" />
    <!-- 控制台输出 -->
    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
        <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/exceptions/GlobalExceptionCapture.java
@@ -89,11 +89,11 @@
    /**
     *
     * @param ex 数据库异常
     * @param ex 服务层业务异常
     * @return
     */
    @ExceptionHandler(value = ServiceException.class)
    public R serviceException(Exception ex) {
    public R serviceException(ServiceException ex) {
        log.error("服务层业务异常【{}】",ex.getMessage());
        return R.fail(ex.getMessage());
    }
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/advertisement/ComOpsAdvJumpDTO.java
@@ -20,5 +20,8 @@
    @ApiModelProperty("跳转内容")
    private String jumpContent;
    @ApiModelProperty("是否默认 0 否 1 是")
    private Integer isDefault;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/community/ExportUserDTO.java
New file
@@ -0,0 +1,25 @@
package com.panzhihua.common.model.dtos.community;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
 * @program: springcloud_k8s_panzhihuazhihuishequ
 * @description: 居民excel导出查询参数
 * @author: huang.hongfa weixin hhf9596 qq 959656820
 * @create: 2021-02-20 10:27
 **/
@Data
@ApiModel("居民excel导出查询参数")
public class ExportUserDTO {
    @ApiModelProperty(value = "姓名")
    private String name;
    @ApiModelProperty(value = "手机号")
    private String phone;
    @ApiModelProperty(value = "小区名字")
    private String areaName;
    @ApiModelProperty(value = "社区id",hidden = true)
    private Long communityId;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/user/EexcelUserDTO.java
@@ -1,99 +1,137 @@
package com.panzhihua.common.model.dtos.user;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
/**
 * @program: springcloud_k8s_panzhihuazhihuishequ
 * @description: 居民信息excel导入
 * @author: huang.hongfa weixin hhf9596 qq 959656820
 * @create: 2021-02-04 16:06
 **/
@Data
public class EexcelUserDTO {
    /**
     * 序号
     */
    private Integer order;
    @ExcelProperty("序号")
    private String order;
    /**
     * 门牌号
     */
    @ExcelProperty("门牌号")
    private String doorNumber;
    /**
     * 是否租住
     */
    @ExcelProperty("是否租住")
    private String isRent;
    /**
     * 姓名
     */
    @ExcelProperty("姓名")
    private String name;
    /**
     * 民族
     */
    @ExcelProperty("民族")
    private String nation;
    /**
     * 政治面貌
     */
    @ExcelProperty("政治面貌")
    private String politicalOutlook;
    /**
     * 婚姻状态
     */
    @ExcelProperty("婚姻状态")
    private String maritalStatus;
    /**
     * 联系方式
     */
    @ExcelProperty("联系方式")
    private String phone;
    /**
     * 文化程度
     */
    @ExcelProperty("文化程度")
    private String education;
    /**
     * 身份证
     */
    @ExcelProperty("身份证")
    private String idCard;
    /**
     * 工作单位(学校)
     */
    @ExcelProperty("工作单位(学校)")
    private String company;
    /**
     * 户口所在地
     */
    @ExcelProperty("户口所在地")
    private String residence;
    /**
     * 目前是否在攀枝花
     */
    @ExcelProperty("目前是否在攀枝花")
    private String isPanZhiHua;
    /**
     * 近一个月离(返)攀情况
     */
    @ExcelProperty("近一个月离(返)攀情况")
    private String situation;
    /**
     * 是否有与疑似或确诊病例密切接触史
     */
    @ExcelProperty("是否有与疑似或确诊病例密切接触史")
    private String isContact;
    /**
     * 特殊情况(重大过往病史或者孕妇)
     */
    @ExcelProperty("特殊情况(重大过往病史或者孕妇")
    private String major;
    /**
     * 退役军人
     */
    @ExcelProperty("退役军人")
    private String soldier;
    /**
     * 残疾人
     */
    @ExcelProperty("残疾人")
    private String disability;
    /**
     * 低保户
     */
    @ExcelProperty("低保户")
    private String lowIncomeHouseholds;
    /**
     * 低收入人员
     */
    @ExcelProperty("低收入人员")
    private String lowIncomePeople;
    /**
     * 高龄老人
     */
    @ExcelProperty("高龄老人")
    private String oldPeople;
    /**
     *特服家庭
     */
    @ExcelProperty("特服家庭")
    private String specialServiceFamily;
    /**
     *重点人员
     */
    @ExcelProperty("重点人员")
    private String keyPersonnel;
    /**
     * 房屋编码
     */
    @ExcelIgnore
    private String houseCode;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/LoginUserInfoVO.java
@@ -9,6 +9,7 @@
import com.panzhihua.common.validated.PutGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.models.auth.In;
import lombok.Data;
import javax.validation.constraints.Min;
@@ -150,6 +151,17 @@
    private Integer volunteerStatus;
    @ApiModelProperty("是否注册 0 否 1 是")
    private Integer isRegister;
    @ApiModelProperty("年龄")
    private Integer age;
    @ApiModelProperty("政治面貌:1 - 党员;2 - 团员;3 - 群众")
    private Integer politicalOutlook;
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/advertisement/ComOpsAdvJumpVO.java
@@ -20,5 +20,8 @@
    @ApiModelProperty("跳转内容")
    private String jumpContent;
    @ApiModelProperty("是否默认  0 否 1 是")
    private Integer isDefault;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComMngStructAreaVO.java
@@ -56,4 +56,7 @@
    @ApiModelProperty("是否累加门牌号 0 否 1 是")
    private Integer isAccumulation;
    @ApiModelProperty("小区门牌号导入规则")
    private String doorNum;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/user/CommunityUserInfoVO.java
New file
@@ -0,0 +1,95 @@
package com.panzhihua.common.model.vos.user;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.panzhihua.common.model.vos.community.ComMngStructHouseVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
 * @program: springcloud_k8s_panzhihuazhihuishequ
 * @description: 社区人员详情
 * @author: huang.hongfa weixin hhf9596 qq 959656820
 * @create: 2021-02-18 09:43
 **/
@Data
@ApiModel("社区人员详情")
public class CommunityUserInfoVO {
    @ApiModelProperty("真实名字")
    private String name;
    @ApiModelProperty("性别 1 男 2 女")
    private Integer sex;
    @ApiModelProperty("民族")
    private String nation;
    @ApiModelProperty("手机号")
    private String phone;
    @ApiModelProperty("0 未婚 1 已婚")
    private Integer maritalStatus;
    @ApiModelProperty("身份证号")
    private String idCard;
    @ApiModelProperty("工作单位(学校)")
    private String company;
    @ApiModelProperty("user_id")
    private Long userId;
    @ApiModelProperty("年龄")
    private Integer age;
    @ApiModelProperty("生日")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date birthday;
    @ApiModelProperty("户口所在地")
    private String residence;
    @ApiModelProperty("政治面貌:1 - 党员;2 - 团员;3 - 群众")
    private Integer politicalOutlook;
    @ApiModelProperty("文化程度")
    private String education;
    @ApiModelProperty("专享政策")
    private String tags;
    @ApiModelProperty("创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createAt;
    @ApiModelProperty("是否志愿者 0否 1 是")
    private Integer isVolunteer;
    @ApiModelProperty("志愿者申请时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date volunteerCreateAt;
    @ApiModelProperty("家庭成员")
    private List<ComMngFamilyInfoVO> comMngFamilyInfoVOS;
    @ApiModelProperty("房屋信息")
    private List<ComMngStructHouseVO> comMngStructHouseVOS;
    @ApiModelProperty("目前是否在攀枝花 0 否 1 是")
    private Integer isPanzhiHua;
    @ApiModelProperty("是否有与疑似或确诊病例密切接触史 0 否 1 是")
    private Integer isContact;
    @ApiModelProperty("近一个月离(返)攀情况")
    private String situation;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java
@@ -848,4 +848,23 @@
     */
    @PostMapping("indexdatacommunitybackstageechart")
    R indexDataCommunityBackstageEchart(@RequestParam("communityId")Long communityId);
    /**
     * 选择导入的小区
     * @param param 小区名字 模糊查询
     * @param communityId 社区id
     * @return 小区集合 ComMngStructAreaVO
     */
    @PostMapping("listareas")
    R listAreas(@RequestParam("param")String param, @RequestParam("communityId")Long communityId);
    /**
     * 检查小区是否已经批量设置过房屋并且返回小区房屋门号规则
     * @param id 小区id
     * @return ComMngStructAreaVO
     */
    @PostMapping("checkAreaHouse")
    R checkAreaHouse(@RequestParam("id")Long id);
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/user/UserService.java
@@ -1,6 +1,7 @@
package com.panzhihua.common.service.user;
import com.panzhihua.common.model.dtos.PageDTO;
import com.panzhihua.common.model.dtos.community.ExportUserDTO;
import com.panzhihua.common.model.dtos.community.NoticeReadDTO;
import com.panzhihua.common.model.dtos.user.EexcelUserDTO;
import com.panzhihua.common.model.dtos.user.PageFeedBackDTO;
@@ -10,6 +11,7 @@
import com.panzhihua.common.model.vos.MenuVO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.SystemmanagementConfigVO;
import com.panzhihua.common.model.vos.community.ComMngStructAreaVO;
import com.panzhihua.common.model.vos.user.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
@@ -505,8 +507,33 @@
    /**
     * 批量导入居民用户
     * @param list 居民用户集合
     * @return
     * @param areaName 小区名字
     * @return 导入结果
     */
    @PostMapping("batchsaveuser")
    R batchSaveUser(@RequestBody List<EexcelUserDTO> list);
    R batchSaveUser(@RequestBody List<EexcelUserDTO> list, @RequestParam("areaName")StringBuffer areaName);
    /**
     * 校验小区是否存在
     * @param areaName 小区名字
     * @return 校验结果
     */
    @PostMapping("checkaereaname")
    R checkAereaName(@RequestParam("areaName")String areaName);
    /**
     * 社区人员详情包括导入人员
     * @param userId 人员id
     * @return CommunityUserInfoVO
     */
    @PostMapping("detailusercomunity")
    R detailUserComunity(@RequestParam("userId")Long userId);
    /**
     *  用户搜索了就下载搜索的用户否则下载所有用户
     * @param exportUserDTO 用户搜索内容
     * @return List<EexcelUserDTO> excel内容
     */
    @PostMapping("export")
    R export(@RequestBody ExportUserDTO exportUserDTO);
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/FileUtil.java
New file
@@ -0,0 +1,36 @@
package com.panzhihua.common.utlis;
import java.io.File;
import java.io.InputStream;
public class FileUtil {
    public static InputStream getResourcesFileInputStream(String fileName) {
        return Thread.currentThread().getContextClassLoader().getResourceAsStream("" + fileName);
    }
    public static String getPath() {
        return FileUtil.class.getResource("/").getPath();
    }
    public static File createNewFile(String pathName) {
        File file = new File(getPath() + pathName);
        if (file.exists()) {
            file.delete();
        } else {
            if (!file.getParentFile().exists()) {
                file.getParentFile().mkdirs();
            }
        }
        return file;
    }
    public static File readFile(String pathName) {
        return new File(getPath() + pathName);
    }
    public static File readUserHomeFile(String pathName) {
        return new File(System.getProperty("user.home") + File.separator + pathName);
    }
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/IdCard.java
New file
@@ -0,0 +1,64 @@
package com.panzhihua.common.utlis;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
/**
 * @program: springcloud_k8s_panzhihuazhihuishequ
 * @description: 年龄
 * @author: huang.hongfa weixin hhf9596 qq 959656820
 * @create: 2021-02-06 17:27
 **/
public class IdCard {
    public static int IdNOToAge(String IdNO){
        int leh = IdNO.length();
        String dates="";
        int age = 0;
        if (leh == 18) {
            dates = IdNO.substring(6, 10);
            SimpleDateFormat df = new SimpleDateFormat("yyyy");
            String year = df.format(new Date());
            age = Integer.parseInt(year)-Integer.parseInt(dates);
        }else {
            System.out.println("出错!身份证长度不是18位!");
        }
        return age;
    }
    public static Date birthDay(String Id){
        /*从身份证截取生日信息
         * author:huangjy 2016-07-15    Date转换成String,只需将parse方法换成format方法
         * */
        String year = Id.substring(6, 10);//调用substring方法返回相关字段,注意索引从0开始
        String month =Id.substring(10, 12);
        String day = Id.substring(12, 14);
        String birthday = year + "-" + month + "-" + day;
        DateFormat fmt = new SimpleDateFormat("yyyy-MM-dd");//定义一个时间转换格式“年-月-日”
        Date date = null;
        try {     //捕获类型转换(解析)异常
            date = fmt.parse(birthday);
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return  date;
    }
    public static Integer sex(String id ){
        Integer sex;
        if (Integer.parseInt(id.substring(16).substring(0, 1)) % 2 == 0) {// 判断性别
            sex = 2;
        } else {
            sex = 1;
        }
        return sex;
    }
    public static void main(String[] args) {
        System.out.println(birthDay("120000197802150561"));
        System.out.println(birthDay("32000019951110538X"));
    }
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/SFTPUtil.java
@@ -309,6 +309,27 @@
        return sftp.ls(directory);
    }
    /**
     * 判断文件或者目录是否存在
     * @param path 目录或者文件的路径
     * @return 存在结果
     */
    public boolean isExistDir(String path){
        boolean  isExist=false;
        try {
            SftpATTRS sftpATTRS = sftp.lstat(path);
            isExist = true;
            return sftpATTRS.isDir();
        } catch (Exception e) {
            if (e.getMessage().toLowerCase().equals("no such file")) {
                isExist = false;
            }
        }
        return isExist;
    }
    public static void main(String[] args) throws SftpException, IOException {
        SFTPUtil sftp = new SFTPUtil("root", "evanN7F2K5M6", "47.104.148.185", 22);
        sftp.login();
springcloud_k8s_panzhihuazhihuishequ/common/target/classes/com/panzhihua/common/exceptions/GlobalExceptionCapture.class
Binary files differ
springcloud_k8s_panzhihuazhihuishequ/common/target/classes/com/panzhihua/common/model/dtos/advertisement/ComOpsAdvJumpDTO.class
Binary files differ
springcloud_k8s_panzhihuazhihuishequ/common/target/classes/com/panzhihua/common/model/dtos/community/ExportUserDTO.class
Binary files differ
springcloud_k8s_panzhihuazhihuishequ/common/target/classes/com/panzhihua/common/model/dtos/user/EexcelUserDTO.class
Binary files differ
springcloud_k8s_panzhihuazhihuishequ/common/target/classes/com/panzhihua/common/model/vos/LoginUserInfoVO.class
Binary files differ
springcloud_k8s_panzhihuazhihuishequ/common/target/classes/com/panzhihua/common/model/vos/advertisement/ComOpsAdvJumpVO.class
Binary files differ
springcloud_k8s_panzhihuazhihuishequ/common/target/classes/com/panzhihua/common/model/vos/community/ComMngStructAreaVO.class
Binary files differ
springcloud_k8s_panzhihuazhihuishequ/common/target/classes/com/panzhihua/common/model/vos/user/CommunityUserInfoVO.class
Binary files differ
springcloud_k8s_panzhihuazhihuishequ/common/target/classes/com/panzhihua/common/service/community/CommunityService.class
Binary files differ
springcloud_k8s_panzhihuazhihuishequ/common/target/classes/com/panzhihua/common/service/user/UserService.class
Binary files differ
springcloud_k8s_panzhihuazhihuishequ/common/target/classes/com/panzhihua/common/utlis/FileUtil.class
Binary files differ
springcloud_k8s_panzhihuazhihuishequ/common/target/classes/com/panzhihua/common/utlis/IdCard.class
Binary files differ
springcloud_k8s_panzhihuazhihuishequ/common/target/classes/com/panzhihua/common/utlis/SFTPUtil.class
Binary files differ
springcloud_k8s_panzhihuazhihuishequ/common/target/classes/com/panzhihua/common/utlis/蓝湖国际.xlsx
Binary files differ
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/CommunityManagerApi.java
@@ -1,30 +1,48 @@
package com.panzhihua.community_backstage.api;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.enums.CellExtraTypeEnum;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.panzhihua.common.constants.FtpConstants;
import com.panzhihua.common.controller.BaseController;
import com.panzhihua.common.model.dtos.community.ExportUserDTO;
import com.panzhihua.common.model.dtos.user.EexcelUserDTO;
import com.panzhihua.common.model.vos.LoginUserInfoVO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.community.*;
import com.panzhihua.common.model.vos.user.CommunityUserInfoVO;
import com.panzhihua.common.model.vos.user.SysUserNoticeVO;
import com.panzhihua.common.service.community.CommunityService;
import com.panzhihua.common.service.user.UserService;
import com.panzhihua.common.utlis.FileUtil;
import com.panzhihua.common.utlis.SFTPUtil;
import com.panzhihua.common.validated.AddGroup;
import com.panzhihua.community_backstage.easyexcel.UploadEexcelUserDTOListener;
import com.panzhihua.community_backstage.excel.CustomSheetWriteHandler;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.ResponseEntity;
import org.springframework.util.ObjectUtils;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.math.BigDecimal;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.UUID;
/**
 * @program: springcloud_k8s_panzhihuazhihuishequ
@@ -41,6 +59,23 @@
    private UserService userService;
    @Resource
    private CommunityService communityService;
    @Value("${excel.userurl}")
    private String excelUrl;
    // FTP 登录用户名
    @Value("${ftp.username}")
    private String userName;
    // FTP 登录密码
    @Value("${ftp.password}")
    private String password;
    // FTP 服务器地址IP地址
    @Value("${ftp.host}")
    private String host;
    // FTP 端口
    @Value("${ftp.port}")
    private int port;
    @Value("${ftp.url}")
    private String url;
    @ApiOperation(value = "分页查询人脸采集",response = LoginUserInfoVO.class)
    @PutMapping("pageuserface")
@@ -95,28 +130,28 @@
        return userService.listTag();
    }
    @ApiOperation(value = "人员详情",response = LoginUserInfoVO.class)
    @GetMapping("detailuser")
    @ApiImplicitParam(name ="userId",value = "人员id",required = true)
    public R detailUser(@RequestParam("userId")Long userId){
        R r = userService.detailUser(userId);
        boolean ok = R.isOk(r);
        if (ok) {
            Object data = r.getData();
            if (!ObjectUtils.isEmpty(data)) {
                LoginUserInfoVO loginUserInfoVO= JSONObject.parseObject(JSONObject.toJSONString(data),LoginUserInfoVO.class);
                R r1=communityService.detailHouse(userId);
                if (R.isOk(r1)) {
                    Object data1 = r1.getData();
                    if (!ObjectUtils.isEmpty(data1)) {
                        loginUserInfoVO.setComMngStructHouseVOS((List<ComMngStructHouseVO>)data1);
                        r.setData(loginUserInfoVO);
                    }
                }
            }
        }
        return r;
    }
//    @ApiOperation(value = "人员详情",response = LoginUserInfoVO.class)
//    @GetMapping("detailuser")
//    @ApiImplicitParam(name ="userId",value = "人员id",required = true)
//    public R detailUser(@RequestParam("userId")Long userId){
//        R r = userService.detailUser(userId);
//        boolean ok = R.isOk(r);
//        if (ok) {
//            Object data = r.getData();
//            if (!ObjectUtils.isEmpty(data)) {
//                LoginUserInfoVO loginUserInfoVO= JSONObject.parseObject(JSONObject.toJSONString(data),LoginUserInfoVO.class);
//                R r1=communityService.detailHouse(userId);
//                if (R.isOk(r1)) {
//                    Object data1 = r1.getData();
//                    if (!ObjectUtils.isEmpty(data1)) {
//                        loginUserInfoVO.setComMngStructHouseVOS((List<ComMngStructHouseVO>)data1);
//                        r.setData(loginUserInfoVO);
//                    }
//                }
//            }
//        }
//        return r;
//    }
    @ApiOperation(value = "设置标签")
    @PutMapping("usertag")
@@ -408,9 +443,9 @@
    @ApiOperation(value = "导入居民")
    @DeleteMapping("importuser")
    @PostMapping("importuser")
    public R importUser(MultipartFile multipartFile)throws IOException {
        String name = multipartFile.getName();
        String name = multipartFile.getOriginalFilename();
        Float size = Float.parseFloat(String.valueOf(multipartFile.getSize())) / 1024;
        BigDecimal b = new BigDecimal(size);
        size = b.setScale(2, BigDecimal.ROUND_HALF_UP).floatValue();
@@ -420,11 +455,189 @@
        if (isXls) {
            return R.fail("请上传xls或者xlsx格式的文件");
        }
//        EasyExcel.read(multipartFile.getInputStream(), EexcelUserDTO.class, new UploadEexcelUserDTOListener(userService)).sheet().doRead();
        EasyExcel.read(multipartFile.getInputStream(), EexcelUserDTO.class, new UploadEexcelUserDTOListener(userService,name)) .extraRead(CellExtraTypeEnum.MERGE).headRowNumber(1).sheet().doRead();
        return R.ok();
    }
    @ApiOperation(value = "社区人员详情",response = CommunityUserInfoVO.class)
    @GetMapping("detailuser")
    @ApiImplicitParam(name ="userId",value = "人员id",required = true)
    public R detailUser(@RequestParam("userId")Long userId){
//        R r = userService.detailUser(userId);
        R r = userService.detailUserComunity(userId);
        boolean ok = R.isOk(r);
        if (ok) {
            Object data = r.getData();
            if (!ObjectUtils.isEmpty(data)) {
                CommunityUserInfoVO communityUserInfoVO= JSONObject.parseObject(JSONObject.toJSONString(data),CommunityUserInfoVO.class);
                R r1=communityService.detailHouse(userId);
                if (R.isOk(r1)) {
                    Object data1 = r1.getData();
                    if (!ObjectUtils.isEmpty(data1)) {
                        communityUserInfoVO.setComMngStructHouseVOS((List<ComMngStructHouseVO>)data1);
                        r.setData(communityUserInfoVO);
                    }
                }
            }
        }
        return r;
    }
    @ApiOperation(value = "下载模板")
    @GetMapping("exportuser")
    @ApiImplicitParam(name ="id",value = "小区id",required = true)
    public R exportUser(@RequestParam("id") Long id ){
//        检查小区是否已经批量设置过房屋并且返回小区房屋门号规则
        R r=communityService.checkAreaHouse(id);
        if (R.isOk(r)) {
//            生成动态模板excel通过ftp工具上传到主节点,然后返回模板下载地址
            ComMngStructAreaVO comMngStructAreaVO=JSONObject.parseObject(JSONObject.toJSONString(r.getData()),ComMngStructAreaVO.class);
            String areaName = comMngStructAreaVO.getAreaName();
            String roleFloor = comMngStructAreaVO.getRoleFloor();
            String roleConnector = comMngStructAreaVO.getRoleConnector();
            String roleDoor = comMngStructAreaVO.getRoleDoor();
            String doorNumber="1-1-1-"+roleFloor+roleConnector+roleDoor;
//            String url="http://www.psciio.com/web/excel/";
            String url=excelUrl;
            String ftpUrl="/mnt/data/web/excel/";
            String name=areaName + ".xlsx";
            try {
                SFTPUtil sftp = new SFTPUtil(userName,password,host,port);
                sftp.login();
                boolean existDir = sftp.isExistDir(ftpUrl+name);
                if (!existDir) {
                    String property = System.getProperty("user.dir");
                    String fileName = property + File.separator+name;
                    // 这里 需要指定写用哪个class去写
                    ExcelWriter excelWriter = null;
                    InputStream inputStream=null;
                    try {
                        excelWriter = EasyExcel.write(fileName, EexcelUserDTO.class).registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()).registerWriteHandler(new CustomSheetWriteHandler()).build();
                        WriteSheet writeSheet = EasyExcel.writerSheet("模板").build();
                        List<EexcelUserDTO>eexcelUserDTOS=new ArrayList<>();
                        EexcelUserDTO eexcelUserDTO=new EexcelUserDTO();
                        eexcelUserDTO.setOrder("例子(可不用删除)");
                        eexcelUserDTO.setDoorNumber(doorNumber);
                        eexcelUserDTO.setIsRent("是");
                        eexcelUserDTO.setName("张三");
                        eexcelUserDTO.setNation("汉");
                        eexcelUserDTO.setPoliticalOutlook("群众");
                        eexcelUserDTO.setMaritalStatus("已婚");
                        eexcelUserDTO.setPhone("13545789626");
                        eexcelUserDTO.setEducation("高中");
                        eexcelUserDTO.setIdCard("342589457896122557");
                        eexcelUserDTO.setCompany("恰恰食品厂");
                        eexcelUserDTO.setResidence("攀枝花");
                        eexcelUserDTO.setIsPanZhiHua("是");
                        eexcelUserDTO.setSituation("1月27日返攀");
                        eexcelUserDTO.setIsContact("否");
                        eexcelUserDTO.setMajor("否");
                        eexcelUserDTO.setSoldier("否");
                        eexcelUserDTO.setDisability("否");
                        eexcelUserDTO.setLowIncomePeople("否");
                        eexcelUserDTO.setLowIncomeHouseholds("否");
                        eexcelUserDTO.setOldPeople("否");
                        eexcelUserDTO.setSpecialServiceFamily("否");
                        eexcelUserDTO.setKeyPersonnel("否");
                        eexcelUserDTOS.add(eexcelUserDTO);
                        excelWriter.write(eexcelUserDTOS, writeSheet);
                        excelWriter.finish();
                        File file=new File(fileName);
                        inputStream=new FileInputStream(file);
                        sftp.uploadMore(ftpUrl, name, inputStream);
                        sftp.logout();
                        inputStream.close();
                        String absolutePath = file.getAbsolutePath();
                        boolean delete = file.delete();
                        log.info("删除excel【{}】结果【{}】",absolutePath,delete);
                    } finally {
                        // 千万别忘记finish 会帮忙关闭流
                        if (inputStream != null) {
                            inputStream.close();
                        }
                        if (excelWriter != null) {
                            excelWriter.finish();
                        }
                    }
                }
                return R.ok(url+areaName+".xlsx");
            } catch (Exception e) {
                e.printStackTrace();
                log.error("文件传输失败【{}】", e.getMessage());
                return R.fail();
            }
        }else{
            return r;
        }
    }
    @ApiOperation(value = "选择导入的小区",response =ComMngStructAreaVO.class )
    @GetMapping("listareas")
    public R listAreas(String param) {
        if (null==param) {
            param="";
        }
        Long communityId = this.getCommunityId();
        return communityService.listAreas(param,communityId);
    }
    @ApiOperation(value = "导出" )
    @PostMapping("export")
    public R export(@RequestBody ExportUserDTO exportUserDTO){
        Long communityId = this.getCommunityId();
        exportUserDTO.setCommunityId(communityId);
        String url=excelUrl;
        String uuid= UUID.randomUUID().toString().replace("-","");
        String name=uuid+".xlsx";
        String ftpUrl="/mnt/data/web/excel/";
//        用户搜索了就下载搜索的用户否则下载所有用户
        R r=userService.export(exportUserDTO);
        if (R.isOk(r)) {
            List<EexcelUserDTO>eexcelUserDTOS=JSONArray.parseArray(JSONArray.toJSONString(r.getData()),EexcelUserDTO.class);
            try {
                SFTPUtil sftp = new SFTPUtil(userName,password,host,port);
                sftp.login();
                boolean existDir = sftp.isExistDir(ftpUrl+name);
                if (!existDir) {
                    String property = System.getProperty("user.dir");
                    String fileName = property + File.separator+name;
                    // 这里 需要指定写用哪个class去写
                    ExcelWriter excelWriter = null;
                    InputStream inputStream=null;
                    try {
                        excelWriter = EasyExcel.write(fileName, EexcelUserDTO.class).registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()).registerWriteHandler(new CustomSheetWriteHandler()).build();
                        WriteSheet writeSheet = EasyExcel.writerSheet("模板").build();
                        excelWriter.write(eexcelUserDTOS, writeSheet);
                        excelWriter.finish();
                        File file=new File(fileName);
                        inputStream=new FileInputStream(file);
                        sftp.uploadMore(ftpUrl, name, inputStream);
                        sftp.logout();
                        inputStream.close();
                        String absolutePath = file.getAbsolutePath();
                        boolean delete = file.delete();
                        log.info("删除excel【{}】结果【{}】",absolutePath,delete);
                    } finally {
                        // 千万别忘记finish 会帮忙关闭流
                        if (inputStream != null) {
                            inputStream.close();
                        }
                        if (excelWriter != null) {
                            excelWriter.finish();
                        }
                    }
                }
                return R.ok(url+name);
            } catch (Exception e) {
                e.printStackTrace();
                log.error("文件传输失败【{}】", e.getMessage());
                return R.fail();
            }
        }
        return R.fail("未查询到用户");
    }
}
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/easyexcel/UploadEexcelUserDTOListener.java
@@ -2,13 +2,19 @@
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.alibaba.excel.exception.ExcelDataConvertException;
import com.alibaba.excel.metadata.CellExtra;
import com.alibaba.fastjson.JSON;
import com.panzhihua.common.exceptions.ServiceException;
import com.panzhihua.common.model.dtos.user.EexcelUserDTO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.service.user.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.util.ObjectUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
 * @program: springcloud_k8s_panzhihuazhihuishequ
@@ -24,24 +30,65 @@
     */
    private UserService userService;
    // 缓存上一次跨行数据的有效数据
    private EexcelUserDTO excel;
    private StringBuffer areaName;
    private String name;
    /**
     * 如果使用了spring,请使用这个构造方法。每次创建Listener的时候需要把spring管理的类传进来
     *
     * @param userService
     * @param name
     */
    public UploadEexcelUserDTOListener(UserService userService) {
    public UploadEexcelUserDTOListener(UserService userService, String name) {
        this.userService = userService;
        this.name=name;
    }
    /**
     * 每隔5条存储数据库,实际使用中可以3000条,然后清理list ,方便内存回收
     */
    private static final int BATCH_COUNT = 50;
    private static final int BATCH_COUNT = 3000;
    List<EexcelUserDTO> list = new ArrayList<EexcelUserDTO>();
    @Override
    public void invoke(EexcelUserDTO eexcelUserDTO, AnalysisContext analysisContext) {
        String order = eexcelUserDTO.getOrder();
        String isRent = eexcelUserDTO.getIsRent();
        String doorNumber = eexcelUserDTO.getDoorNumber();
        String name = eexcelUserDTO.getName();
        if (ObjectUtils.isEmpty(name)) {
            return;
        }else{
            if (name.equals("张三")) {
                return;
            }
        }
        if (ObjectUtils.isEmpty(order)) {
            order=excel.getOrder();
        }
        if (ObjectUtils.isEmpty(doorNumber)) {
            doorNumber=excel.getDoorNumber();
        }
        if (ObjectUtils.isEmpty(isRent)) {
            isRent=excel.getIsRent();
        }
        eexcelUserDTO.setOrder(order);
        eexcelUserDTO.setIsRent(isRent);
        eexcelUserDTO.setDoorNumber(doorNumber);
        log.info("解析到一条数据:{}", JSON.toJSONString(eexcelUserDTO));
        list.add(eexcelUserDTO);
        // 复用跨行数据的实现
        String order1 = eexcelUserDTO.getOrder();
        if (!ObjectUtils.isEmpty(order1) || excel == null) {
            excel = eexcelUserDTO;
        }
        // 达到BATCH_COUNT了,需要去存储一次数据库,防止数据几万条数据在内存,容易OOM
        if (list.size() >= BATCH_COUNT) {
            saveData();
@@ -62,7 +109,76 @@
     */
    private void saveData() {
        log.info("{}条数据,开始存储数据库!", list.size());
        userService.batchSaveUser(list);
        R r = userService.batchSaveUser(list, areaName);
        if (R.isOk(r)) {
        log.info("存储数据库成功!");
        } else {
            throw new ServiceException(r.getMsg());
        }
    }
    /**
     * 这里会一行行的返回头
     *
     * @param headMap
     * @param context
     */
    @Override
    public void invokeHeadMap(Map<Integer, String> headMap, AnalysisContext context) {
//        String s = JSON.toJSONString(headMap);
//        String key="所属小区:";
//        boolean contains = s.contains(key);
//        if (contains) {
//            log.info("解析到头数据:{}", s);
//            String substring = s.substring(s.indexOf("【")+1, s.indexOf("】"));
//            if (ObjectUtils.isEmpty(substring)) {
//                throw new ServiceException("小区名字不能为空");
//            }
//            R r=userService.checkAereaName(substring);
//            if (!R.isOk(r)) {
//                throw new ServiceException(r.getMsg());
//            }
//            areaName=new StringBuffer(substring);
//        }
        String substring = name.substring(0,name.indexOf("."));
        R r=userService.checkAereaName(substring);
        if (!R.isOk(r)) {
            throw new ServiceException(r.getMsg());
        }
        areaName=new StringBuffer(substring);
    }
    /**
     * 在转换异常 获取其他异常下会调用本接口。抛出异常则停止读取。如果这里不抛出异常则 继续读取下一行。
     *
     * @param exception
     * @param context
     * @throws Exception
     */
    @Override
    public void onException(Exception exception, AnalysisContext context) throws ServiceException {
        log.error("抛出异常:{}", exception.getMessage());
        if (exception instanceof ExcelDataConvertException) {
            ExcelDataConvertException excelDataConvertException = (ExcelDataConvertException)exception;
            log.error("第{}行,第{}列解析异常,数据为:{}", excelDataConvertException.getRowIndex(),
                    excelDataConvertException.getColumnIndex(), excelDataConvertException.getCellData());
        }else{
            throw new ServiceException(exception.getMessage());
        }
    }
    @Override
    public void extra(CellExtra extra, AnalysisContext context) {
//        log.info("读取到了一条额外信息:{}", JSON.toJSONString(extra));
//        switch (extra.getType()) {
//            case MERGE:
//                log.info(
//                        "合并信息,在firstRowIndex:{},firstColumnIndex;{},lastRowIndex:{},lastColumnIndex:{}",
//                        extra.getFirstRowIndex(), extra.getFirstColumnIndex(), extra.getLastRowIndex(),
//                        extra.getLastColumnIndex());
//                break;
//            default:
//        }
    }
}
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/excel/CustomSheetWriteHandler.java
New file
@@ -0,0 +1,51 @@
package com.panzhihua.community_backstage.excel;
import com.alibaba.excel.write.handler.SheetWriteHandler;
import com.alibaba.excel.write.metadata.holder.WriteSheetHolder;
import com.alibaba.excel.write.metadata.holder.WriteWorkbookHolder;
import org.apache.poi.ss.usermodel.DataValidation;
import org.apache.poi.ss.usermodel.DataValidationConstraint;
import org.apache.poi.ss.usermodel.DataValidationHelper;
import org.apache.poi.ss.util.CellRangeAddressList;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
 * 自定义拦截器.对第一列第一行和第二行的数据新增下拉框,显示 测试1 测试2
 *
 * @author Jiaju Zhuang
 */
public class CustomSheetWriteHandler implements SheetWriteHandler {
    private static final Logger LOGGER = LoggerFactory.getLogger(CustomSheetWriteHandler.class);
    @Override
    public void beforeSheetCreate(WriteWorkbookHolder writeWorkbookHolder, WriteSheetHolder writeSheetHolder) {
    }
    @Override
    public void afterSheetCreate(WriteWorkbookHolder writeWorkbookHolder, WriteSheetHolder writeSheetHolder) {
        LOGGER.info("第{}个Sheet写入成功。", writeSheetHolder.getSheetNo());
        // 区间设置 第一列第一行和第二行的数据。由于第一行是头,所以第一、二行的数据实际上是第二三行
        CellRangeAddressList cellRangeAddressList = new CellRangeAddressList(1, 2000, 2, 2);
        CellRangeAddressList cellRangeAddressList1 = new CellRangeAddressList(1, 2000, 5 ,5);
        CellRangeAddressList cellRangeAddressList2 = new CellRangeAddressList(1, 2000, 12 ,12);
        CellRangeAddressList cellRangeAddressList3 = new CellRangeAddressList(1, 2000, 14 ,22);
        DataValidationHelper helper = writeSheetHolder.getSheet().getDataValidationHelper();
        DataValidationConstraint constraint = helper.createExplicitListConstraint(new String[] {"是", "否"});
        DataValidationConstraint constraint1 = helper.createExplicitListConstraint(new String[] {"党员", "团员","群众"});
        DataValidation dataValidation = helper.createValidation(constraint, cellRangeAddressList);
        DataValidation dataValidation1 = helper.createValidation(constraint1, cellRangeAddressList1);
        DataValidation dataValidation2= helper.createValidation(constraint, cellRangeAddressList2);
        DataValidation dataValidation3= helper.createValidation(constraint, cellRangeAddressList3);
        writeSheetHolder.getSheet().addValidationData(dataValidation);
        writeSheetHolder.getSheet().addValidationData(dataValidation1);
        writeSheetHolder.getSheet().addValidationData(dataValidation2);
        writeSheetHolder.getSheet().addValidationData(dataValidation3);
    }
}
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/resources/logback-spring.xml
@@ -7,6 +7,7 @@
    <springProfile name="test">
        <property name="LOG_HOME" value="/mnt/data/gocd/log" />
    </springProfile>
<property name="LOG_HOME" value="/mnt/data/gocd/log" />
    <!-- 控制台输出 -->
    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
        <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/CommunityApi.java
@@ -1177,5 +1177,25 @@
        return comActActivityService.indexDataCommunityBackstageEchart(communityId);
    }
    /**
     * 选择导入的小区
     * @param param 小区名字 模糊查询
     * @param communityId 社区id
     * @return 小区集合 ComMngStructAreaVO
     */
    @PostMapping("listareas")
    public R listAreas(@RequestParam("param")String param, @RequestParam("communityId")Long communityId){
        return comMngStructAreaService.listAreas(param,communityId);
    }
    /**
     * 检查小区是否已经批量设置过房屋并且返回小区房屋门号规则
     * @param id 小区id
     * @return ComMngStructAreaVO
     */
    @PostMapping("checkAreaHouse")
    public R checkAreaHouse(@RequestParam("id")Long id){
        return comMngStructAreaService.checkAreaHouse(id);
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngStructAreaDAO.java
@@ -3,12 +3,15 @@
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.community.ComActDynVO;
import com.panzhihua.common.model.vos.community.ComMngStructAreaVO;
import com.panzhihua.service_community.model.dos.ComMngStructAreaDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
/**
 * @program: springcloud_k8s_panzhihuazhihuishequ
@@ -44,4 +47,19 @@
            " </if> " +
            "</script>")
    IPage<ComMngStructAreaVO> pageArea(Page page, @Param("comMngStructAreaVO") ComMngStructAreaVO comMngStructAreaVO);
    @Select("SELECT\n" +
            "\ta.id,\n" +
            "\ta.role_floor,\n" +
            "\ta.area_name,\n" +
            "\ta.role_connector,\n" +
            "\ta.role_door \n" +
            "FROM\n" +
            "\tcom_mng_struct_area a \n" +
            "WHERE\n" +
            "\ta.area_name LIKE CONCAT( '%', #{areaName}, '%' ) \n" +
            "\tAND a.community_id =#{communityId}")
    List<ComMngStructAreaVO> listAreas(@Param("areaName")String areaName, @Param("communityId")Long communityId);
    @Select("select count(id) from com_mng_struct_house where parent_code=#{areaCode}")
    Integer selectCountHouseByParentHouseCode(String areaCode);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngStructHouseUserDAO.java
@@ -7,6 +7,7 @@
import org.apache.ibatis.annotations.Select;
import java.util.List;
import java.util.Map;
/**
 * @program: springcloud_k8s_panzhihuazhihuishequ
@@ -18,4 +19,12 @@
public interface ComMngStructHouseUserDAO extends BaseMapper<ComMngStructHouseUserDO> {
    @Select("select u.name,u.phone from com_mng_struct_house_user h  join sys_user u on h.user_id=u.user_id and h.house_code=#{houseCode1}")
    List<LoginUserInfoVO> selectListHouseUser(String houseCode1);
    @Select("SELECT\n" +
            "\tp.house_code ,\n" +
            "\tp.is_rent\n" +
            "FROM\n" +
            "\tsys_user_input p \n" +
            "WHERE\n" +
            "\tp.id =#{userId}")
    Map<String, Object> selectHouseCode(Long userId);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComOpsAdvJumpDO.java
@@ -25,5 +25,10 @@
     * 跳转内容
     */
    private String jumpContent;
    /**
     * 是否默认 0 否 1是
     * 默认不能删除
     */
    private  Integer isDefault;
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComActActivityService.java
@@ -108,4 +108,5 @@
     * @return 图表数据 IndexDataVO
     */
    R indexDataCommunityBackstageEchart(Long communityId);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComMngStructAreaService.java
@@ -65,4 +65,17 @@
     * @return 小区信息
     */
    R detailArea(Long areaId);
    /**
     * 选择导入的小区
     * @param param 小区名字 模糊查询
     * @param communityId 社区id
     * @return 小区集合 ComMngStructAreaVO
     */
    R listAreas(String param, Long communityId);
    /**
     * 检查小区是否已经批量设置过房屋并且返回小区房屋门号规则
     * @param id 小区id
     * @return ComMngStructAreaVO
     */
    R checkAreaHouse(Long id);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActActivityServiceImpl.java
@@ -396,6 +396,8 @@
        return R.ok(indexDataVO);
    }
    /**
     * 获取最近七天的时间
     * @return
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngStructAreaServiceImpl.java
@@ -182,5 +182,57 @@
        return R.ok(comMngStructAreaVO);
    }
    /**
     * 选择导入的小区
     *
     * @param param       小区名字 模糊查询
     * @param communityId 社区id
     * @return 小区集合 ComMngStructAreaVO
     */
    @Override
    public R listAreas(String param, Long communityId) {
        List<ComMngStructAreaVO> comMngStructAreaVOS=new ArrayList<>();
        comMngStructAreaVOS =comMngStructAreaDAO.listAreas(param,communityId);
        if (!ObjectUtils.isEmpty(comMngStructAreaVOS)) {
            comMngStructAreaVOS.forEach(comMngStructAreaVO -> {
                String roleConnector = comMngStructAreaVO.getRoleConnector();
                String roleFloor = comMngStructAreaVO.getRoleFloor();
                String roleDoor = comMngStructAreaVO.getRoleDoor();
                String doorNum="1-1-1-"+roleFloor+roleConnector+roleDoor;
                if (!ObjectUtils.isEmpty(roleFloor)) {
                    comMngStructAreaVO.setDoorNum(doorNum);
                }
            });
        }
        return R.ok(comMngStructAreaVOS);
    }
    /**
     * 检查小区是否已经批量设置过房屋并且返回小区房屋门号规则
     *
     * @param id 小区id
     * @return ComMngStructAreaVO
     */
    @Override
    public R checkAreaHouse(Long id) {
        ComMngStructAreaDO comMngStructAreaDO = comMngStructAreaDAO.selectById(id);
        if (null==comMngStructAreaDO) {
            return R.fail("小区不存在");
        }
        String roleFloor = comMngStructAreaDO.getRoleFloor();
        String roleDoor = comMngStructAreaDO.getRoleDoor();
        String areaCode = comMngStructAreaDO.getAreaCode();
        if (ObjectUtils.isEmpty(roleDoor)||ObjectUtils.isEmpty(roleFloor)) {
            return R.fail("小区未批量设置房屋,请先去社区后台配置");
        }
        Integer num=comMngStructAreaDAO.selectCountHouseByParentHouseCode(areaCode);
        if (num.intValue()==0) {
            return R.fail("小区未批量设置房屋,请先去社区后台配置");
        }
        ComMngStructAreaVO comMngStructAreaVO=new ComMngStructAreaVO();
        BeanUtils.copyProperties(comMngStructAreaDO,comMngStructAreaVO);
        return R.ok(comMngStructAreaVO);
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngStructHouseServiceImpl.java
@@ -8,6 +8,7 @@
import com.panzhihua.common.model.vos.community.BatchhouseVO;
import com.panzhihua.common.model.vos.community.ComMngStructAreaVO;
import com.panzhihua.common.model.vos.community.ComMngStructHouseVO;
import com.panzhihua.common.model.vos.user.CommunityUserInfoVO;
import com.panzhihua.service_community.dao.ComMngStructHouseDAO;
import com.panzhihua.service_community.dao.ComMngStructHouseUserDAO;
import com.panzhihua.service_community.model.dos.ComMngStructAreaDO;
@@ -23,6 +24,7 @@
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
@@ -48,6 +50,7 @@
    @Override
    public R detailHouse(Long userId) {
        List<ComMngStructHouseVO> comMngStructHouseVOS = new ArrayList<>();
        if ( userId< 100000000l) {
        List<ComMngStructHouseUserDO> comMngStructHouseUserDOS = comMngStructHouseUserDAO.selectList(new QueryWrapper<ComMngStructHouseUserDO>().lambda().eq(ComMngStructHouseUserDO::getUserId, userId));
        if (!ObjectUtils.isEmpty(comMngStructHouseUserDOS)) {
            String areaCode = comMngStructHouseUserDOS.get(0).getAreaCode();
@@ -62,6 +65,22 @@
            });
            return R.ok(comMngStructHouseVOS);
        }
        }else{
            userId=userId-100000000l;
//            查导入人员的房屋
            Map<String,Object> map=comMngStructHouseUserDAO.selectHouseCode(userId);
            String houseCode = map.get("house_code").toString();
            String isRent = map.get("is_rent").toString();
            ComMngStructHouseDO comMngStructHouseDO = comMngStructHouseDAO.selectOne(new QueryWrapper<ComMngStructHouseDO>().lambda().eq(ComMngStructHouseDO::getHouseCode, houseCode));
            ComMngStructHouseVO comMngStructHouseVO = new ComMngStructHouseVO();
            BeanUtils.copyProperties(comMngStructHouseDO, comMngStructHouseVO);
            if (isRent.equals("1")) {
                comMngStructHouseVO.setIdentity(1);
            }else{
                comMngStructHouseVO.setIdentity(2);
            }
            comMngStructHouseVOS.add(comMngStructHouseVO);
        }
        return R.ok(comMngStructHouseVOS);
    }
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/logback-spring.xml
@@ -7,6 +7,7 @@
    <springProfile name="test">
        <property name="LOG_HOME" value="/mnt/data/gocd/log" />
    </springProfile>
<property name="LOG_HOME" value="/mnt/data/gocd/log" />
    <!-- 控制台输出 -->
    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
        <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/resources/logback-spring.xml
@@ -7,6 +7,7 @@
    <springProfile name="test">
        <property name="LOG_HOME" value="/mnt/data/gocd/log" />
    </springProfile>
<property name="LOG_HOME" value="/mnt/data/gocd/log" />
    <!-- 控制台输出 -->
    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
        <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/api/UserApi.java
@@ -1,7 +1,9 @@
package com.panzhihua.service_user.api;
import com.panzhihua.common.model.dtos.PageDTO;
import com.panzhihua.common.model.dtos.community.ExportUserDTO;
import com.panzhihua.common.model.dtos.community.NoticeReadDTO;
import com.panzhihua.common.model.dtos.user.EexcelUserDTO;
import com.panzhihua.common.model.dtos.user.PageFeedBackDTO;
import com.panzhihua.common.model.dtos.user.PageUserAppletsBackstageDTO;
import com.panzhihua.common.model.dtos.user.SysUserFeedbackDTO;
@@ -9,13 +11,16 @@
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.SystemmanagementConfigVO;
import com.panzhihua.common.model.vos.user.*;
import com.panzhihua.service_user.service.SysUserInputService;
import com.panzhihua.service_user.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
/**
 * @program: springcloud_k8s_panzhihuazhihuishequ
@@ -23,10 +28,13 @@
 * @author: huang.hongfa weixin hhf9596 qq 959656820
 * @create: 2020-11-24 09:00
 **/
@Slf4j
@RestController("/")
public class UserApi {
    @Resource
    private UserService userService;
    @Resource
    private SysUserInputService sysUserInputService;
    /**
     * 新增微信用户
@@ -526,4 +534,65 @@
        return userService.deleteFeedback(id);
    }
    /**
     * 校验小区是否存在
     * @param areaName 小区名字
     * @return 校验结果
     */
    @PostMapping("checkaereaname")
    public R checkAereaName(@RequestParam("areaName")String areaName){
        return userService.checkAereaName(areaName);
    }
    /**
     * 批量导入居民用户
     * @param list 居民用户集合
     * @param areaName 小区名字
     * @return 导入结果
     */
    @PostMapping("batchsaveuser")
    public R batchSaveUser(@RequestBody List<EexcelUserDTO> list,@RequestParam("areaName")StringBuffer areaName){
        R r = null;
        try {
            r = sysUserInputService.batchSaveUser(list, areaName);
        } catch (Exception e) {
            String message = e.getMessage();
            log.error(message);
            if (message.contains("unique_id_card")) {
                int i = message.indexOf("'");
                String idcard = message.substring(i + 1, message.indexOf("'", i + 1));
//                System.out.println(idcard);
                return R.fail("身份证存在重复"+idcard);
            }else {
                return R.fail(e.getMessage());
            }
        }
        return r;
    }
    /**
     * 社区人员详情包括导入人员
     * @param userId 人员id
     * @return CommunityUserInfoVO
     */
    @PostMapping("detailusercomunity")
    public R detailUserComunity(@RequestParam("userId")Long userId){
        CommunityUserInfoVO communityUserInfoVO=new CommunityUserInfoVO();
        if(userId<100000000l){
            communityUserInfoVO=userService.detailUserComunity(userId);
        }else{
            communityUserInfoVO=sysUserInputService.detailUserComunity(userId);
        }
        return R.ok(communityUserInfoVO);
    }
    /**
     *  用户搜索了就下载搜索的用户否则下载所有用户
     * @param exportUserDTO 用户搜索内容
     * @return List<EexcelUserDTO> excel内容
     */
    @PostMapping("export")
    public R export(@RequestBody ExportUserDTO exportUserDTO){
      return userService.export(exportUserDTO);
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/dao/SysUserInputDAO.java
New file
@@ -0,0 +1,57 @@
package com.panzhihua.service_user.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.panzhihua.common.model.vos.community.ComMngStructAreaVO;
import com.panzhihua.common.model.vos.community.ComMngStructHouseVO;
import com.panzhihua.common.model.vos.user.ComMngFamilyInfoVO;
import com.panzhihua.service_user.model.dos.SysUserInputDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
/**
 * @program: springcloud_k8s_panzhihuazhihuishequ
 * @description: 居民导入
 * @author: huang.hongfa weixin hhf9596 qq 959656820
 * @create: 2021-02-05 17:40
 **/
@Mapper
public interface SysUserInputDAO extends BaseMapper<SysUserInputDO> {
    //    @Select("<script> " +
//            " <where>" +
//            "<if test='nameCn != null and nameCn.trim() != &quot;&quot;'>" +
//            " </if> " +
//            "<if test='nameCn != null and nameCn.trim() != &quot;&quot;'>" +
//            " </if> " +
//            "<if test='nameCn != null and nameCn.trim() != &quot;&quot;'>" +
//            " </if> " +
//            " </where>" +
//            "</script>")
    @Select("select a.id,a.community_id from com_mng_struct_area a where a.area_name=#{areaName}")
    ComMngStructAreaVO selectByAreaName(String areaName);
    @Select("SELECT \n" +
            "REPLACE(REPLACE(REPLACE(REPLACE(h.house_name,a.address_detail,''),'栋','-'),'单元','-'),'层','-')houseName,\n" +
            "h.house_code\n" +
            "FROM\n" +
            "\tcom_mng_struct_area a \n" +
            "\tjoin com_mng_struct_house h on h.house_name like CONCAT(a.address_detail,'%') and h.type=5\n" +
            "WHERE\n" +
            "\ta.area_name = #{areaName}")
    List<ComMngStructHouseVO> selectHouserByareaName(String areaName);
    @Select("SELECT \n" +
            "p.name,\n" +
            "p.id,\n" +
            "if(p.is_rent=1,'合租','家人')relationship,\n" +
            "p.id_card,\n" +
            "p.phone,\n" +
            "year(curdate())-if(length(p.id_card)=18,substring(p.id_card,7,4),if(length(p.id_card)=15,concat('19',substring(p.id_card,7,2)),null)) as age,\n" +
            "p.create_at\n" +
            "FROM\n" +
            "\tsys_user_input p \n" +
            "WHERE\n" +
            "\tp.door_number = #{doorNumber} \n" +
            "\tAND p.id !=#{userId}")
    List<ComMngFamilyInfoVO> selectListFamily(@Param("doorNumber") String doorNumber, @Param("userId")Long userId);
}
springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/dao/UserDao.java
@@ -5,6 +5,8 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.panzhihua.common.model.dtos.PageDTO;
import com.panzhihua.common.model.dtos.community.ExportUserDTO;
import com.panzhihua.common.model.dtos.user.EexcelUserDTO;
import com.panzhihua.common.model.dtos.user.PageUserAppletsBackstageDTO;
import com.panzhihua.common.model.vos.IndexDataKanbanVO;
import com.panzhihua.common.model.vos.IndexDataVO;
@@ -75,8 +77,12 @@
            "SELECT\n" +
            "u.user_id,\n" +
            "u.`name`,\n" +
            "u.`sex`,\n" +
            "u.nick_name,\n" +
            "u.phone,\n" +
            "YEAR (now()) - YEAR (substring(u.id_card, 7, 8)) age,\n"+
            "1 isRegister,\n"+
            "v.political_face political_outlook,\n"+
            "u.id_card,\n" +
            "u.job,\n" +
            "c.area_name communityName,\n" +
@@ -84,10 +90,11 @@
            "u.create_at \n" +
            "FROM\n" +
            "sys_user u\n" +
            "<if test='loginUserInfoVO.name != null and loginUserInfoVO.name.trim() != &quot;&quot;'>" +
            "left join com_mng_volunteer_mng v on u.phone=v.phone \n"+
            "<if test='loginUserInfoVO.communityName != null and loginUserInfoVO.communityName.trim() != &quot;&quot;'>" +
            " JOIN com_mng_struct_area c ON u.area_id = c.id \n" +
            " </if> " +
            "<if test='loginUserInfoVO.name == null or loginUserInfoVO.name.trim() == &quot;&quot;'>" +
            "<if test='loginUserInfoVO.communityName == null or loginUserInfoVO.communityName.trim() == &quot;&quot;'>" +
            "LEFT JOIN com_mng_struct_area c ON u.area_id = c.id \n" +
            " </if> " +
            "<if test='loginUserInfoVO.communityName != null and loginUserInfoVO.communityName.trim() != &quot;&quot;'>" +
@@ -99,6 +106,45 @@
            " </if> " +
            "<if test='loginUserInfoVO.phone != null and loginUserInfoVO.phone.trim() != &quot;&quot;'>" +
            "AND u.phone like concat(#{loginUserInfoVO.phone},'%') " +
            " </if> " +
            "union all "+
            "SELECT \n" +
            "u.id+100000000 user_id,\n" +
            "u.`name`,\n" +
            "case if(length(u.id_card)=18, cast(substring(u.id_card,17,1) as UNSIGNED)%2, if(length(u.id_card)=15,cast(substring(u.id_card,15,1) as UNSIGNED)%2,3)) \n" +
            "when 1 then 1\n" +
            "when 0 then 2\n" +
            "else 0\n" +
            "end as sex,\n" +
            "'' nick_name,\n" +
            "u.phone,\n" +
            "YEAR (now()) - YEAR (substring(u.id_card, 7, 8)) age,\n" +
            "if(su.user_id is null ,0,1)isRegister,\n" +
            "u.political_outlook,\n" +
            "u.id_card,\n" +
            "'' job,\n" +
            "c.area_name communityName,\n" +
            "CONCAT(if(u.soldier=1,'军人,',''),if(u.lowIncome_households=1,'低保户,',''),if(u.lowIncome_people=1,'低收入,',''),if(u.old_people=1,'特服家庭,',''),if(u.key_personnel=1,'重点人员,',''))tags,\n" +
            "u.create_at\n" +
            "FROM\n" +
            "\tsys_user_input u\n" +
            "\tLEFT JOIN sys_user su on su.id_card=u.id_card"+
            "<if test='loginUserInfoVO.communityName != null and loginUserInfoVO.communityName.trim() != &quot;&quot;'>" +
            " JOIN com_mng_struct_area c ON u.area_id = c.id \n" +
            " </if> " +
            "<if test='loginUserInfoVO.communityName == null or loginUserInfoVO.communityName.trim() == &quot;&quot;'>" +
            "LEFT JOIN com_mng_struct_area c ON u.area_id = c.id \n" +
            " </if> " +
            "<if test='loginUserInfoVO.communityName != null and loginUserInfoVO.communityName.trim() != &quot;&quot;'>" +
            "AND c.`area_name` like concat(#{loginUserInfoVO.communityName},'%')  \n" +
            " </if> " +
            " where u.community_id=#{loginUserInfoVO.communityId} " +
            "<if test='loginUserInfoVO.phone != null and loginUserInfoVO.phone.trim() != &quot;&quot;'>" +
            "AND u.phone like concat(#{loginUserInfoVO.phone},'%') " +
            " </if> " +
            "<if test='loginUserInfoVO.name != null and loginUserInfoVO.name.trim() != &quot;&quot;'>" +
            " and u.`name` like concat(#{loginUserInfoVO.name},'%')  \n" +
            " </if> " +
            "</script>")
    IPage<LoginUserInfoVO> pageUser(Page page, @Param("loginUserInfoVO") LoginUserInfoVO loginUserInfoVO);
@@ -243,4 +289,108 @@
    int updateFaceState(Long userId);
    @Select("select name from com_act where community_id=#{communityId}")
    ComActVO selectCommunity(Long communityId);
    @Select("select COUNT(a.id) from com_mng_struct_area a where a.area_name=#{areaName}")
    Integer selectCountArea(String areaName);
    @Select("SELECT\n" +
            "\tCOUNT(h.id)\n" +
            "FROM\n" +
            "\tcom_mng_struct_area a \n" +
            "\tLEFT JOIN com_mng_struct_house h on  h.parent_code=a.area_code\n" +
            "WHERE\n" +
            "\ta.area_name = #{areaName}")
    Integer selectCountHouse(String areaName);
    @Select("<script> " +
            "SELECT\n" +
            "u.user_id 'order',\n" +
            "h.house_name doorNumber,\n" +
            "if(h.state=2,'租住','自主')isRent,\n" +
            "u.`name`,\n" +
            "'汉' nation,\n" +
            "if(u.is_partymember=1,'党员','群众')politicalOutlook,\n" +
            "'未知' maritalStatus,\n" +
            "u.phone,\n" +
            "'未知' education,\n" +
            "u.id_card,\n" +
            "'未知' company,\n" +
            "'未知' residence,\n" +
            "'未知' isPanZhiHua,\n" +
            "'未知' situation,\n" +
            "'未知' isContact,\n" +
            "'未知' major,\n" +
            "'未知' soldier,\n" +
            "'未知' disability,\n" +
            "'未知' lowIncomeHouseholds,\n" +
            "'未知' lowIncomePeople,\n" +
            "'未知' oldPeople,\n" +
            "'未知' specialServiceFamily,\n" +
            "'未知' keyPersonnel\n" +
            "FROM\n" +
            "sys_user u\n" +
            "left join com_mng_struct_house_user hu on hu.user_id=u.user_id\n"+
            "left join com_mng_struct_house h on hu.house_code=h.house_code\n"+
            "<if test='exportUserDTO.areaName != null and exportUserDTO.areaName.trim() != &quot;&quot;'>" +
            " JOIN com_mng_struct_area c ON u.area_id = c.id \n" +
            " </if> " +
            "<if test='exportUserDTO.areaName == null or exportUserDTO.areaName.trim() == &quot;&quot;'>" +
            "LEFT JOIN com_mng_struct_area c ON u.area_id = c.id \n" +
            " </if> " +
            "<if test='exportUserDTO.areaName != null and exportUserDTO.areaName.trim() != &quot;&quot;'>" +
            "AND c.`area_name` like concat(#{exportUserDTO.areaName},'%')  \n" +
            " </if> " +
            " where u.community_id=#{exportUserDTO.communityId} and u.type=1 " +
            "<if test='exportUserDTO.name != null and exportUserDTO.name.trim() != &quot;&quot;'>" +
            " and u.`name` like concat(#{exportUserDTO.name},'%')  \n" +
            " </if> " +
            "<if test='exportUserDTO.phone != null and exportUserDTO.phone.trim() != &quot;&quot;'>" +
            "AND u.phone like concat(#{exportUserDTO.phone},'%') " +
            " </if> " +
            " group by u.user_id  "+
            "union all "+
            "SELECT \n" +
            "u.id+100000000 'order',\n" +
            "u.door_number doorNumber,\n" +
            "if(u.is_rent=1,'租住','自主')isRent,\n" +
            "u.name,\n" +
            "u.nation,\n" +
            "case u.political_outlook when 1 then '党员'  when 2 then '团员' else '群众' end politicalOutlook,\n" +
            "if(u.marital_status=1,'已婚','未婚')maritalStatus,\n" +
            "u.phone,\n" +
            "u.education,\n" +
            "u.id_card,\n" +
            "u.company,\n" +
            "u.residence,\n" +
            "if(u.is_panzhiHua=1,'是','否') isPanZhiHua,\n" +
            "u.situation,\n" +
            "if(is_contact=1,'是','否') isContact,\n" +
            "if(u.major=1,'是','否') major,\n" +
            "if(u.soldier=1,'是','否') soldier,\n" +
            "if(u.disability=1,'是','否') disability,\n" +
            "if(u.lowIncome_households=1,'是','否') lowIncomeHouseholds,\n" +
            "if(u.lowIncome_people=1,'是','否') lowIncomePeople,\n" +
            "if(u.old_people=1,'是','否') oldPeople,\n" +
            "if(u.special_service_family=1,'是','否') specialServiceFamily,\n" +
            "if(u.key_personnel=1,'是','否') keyPersonnel\n" +
            "FROM\n" +
            "\tsys_user_input u\n" +
            "\tLEFT JOIN sys_user su on su.id_card=u.id_card"+
            "<if test='exportUserDTO.areaName != null and exportUserDTO.areaName.trim() != &quot;&quot;'>" +
            " JOIN com_mng_struct_area c ON u.area_id = c.id \n" +
            " </if> " +
            "<if test='exportUserDTO.areaName == null or exportUserDTO.areaName.trim() == &quot;&quot;'>" +
            "LEFT JOIN com_mng_struct_area c ON u.area_id = c.id \n" +
            " </if> " +
            "<if test='exportUserDTO.areaName != null and exportUserDTO.areaName.trim() != &quot;&quot;'>" +
            "AND c.`area_name` like concat(#{exportUserDTO.areaName},'%')  \n" +
            " </if> " +
            " where u.community_id=#{exportUserDTO.communityId} " +
            "<if test='exportUserDTO.phone != null and exportUserDTO.phone.trim() != &quot;&quot;'>" +
            "AND u.phone like concat(#{exportUserDTO.phone},'%') " +
            " </if> " +
            "<if test='exportUserDTO.name != null and exportUserDTO.name.trim() != &quot;&quot;'>" +
            " and u.`name` like concat(#{exportUserDTO.name},'%')  \n" +
            " </if> " +
            "</script>")
    List<EexcelUserDTO> selectExport(@Param("exportUserDTO") ExportUserDTO exportUserDTO);
}
springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/model/dos/SysUserInputDO.java
New file
@@ -0,0 +1,162 @@
package com.panzhihua.service_user.model.dos;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
 * @program: springcloud_k8s_panzhihuazhihuishequ
 * @description: 居民导入数据
 * @author: huang.hongfa weixin hhf9596 qq 959656820
 * @create: 2021-02-05 17:37
 **/
@Data
@TableName("sys_user_input")
public class SysUserInputDO implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * id
     */
    @TableId(type = IdType.AUTO)
    private Long id;
    /**
     * 门牌号
     */
    private String doorNumber;
    /**
     * 是否租住 0 不是 1 是
     */
    private Integer isRent;
    /**
     * 姓名
     */
    private String name;
    /**
     * 民族
     */
    private String nation;
    /**
     * 政治面貌:1 - 党员;2 - 团员;3 - 群众
     */
    private Integer politicalOutlook;
    /**
     * 0 未婚 1 已婚
     */
    private Integer maritalStatus;
    /**
     * 联系方式
     */
    private String phone;
    /**
     * 文化程度
     */
    private String education;
    /**
     * 身份证
     */
    private String idCard;
    /**
     * 工作单位(学校)
     */
    private String company;
    /**
     * 户口所在地
     */
    private String residence;
    /**
     * 目前是否在攀枝花 0 否 1 是
     */
    private Integer isPanzhihua;
    /**
     * 近一个月离(返)攀情况
     */
    private String situation;
    /**
     * 是否有与疑似或确诊病例密切接触史 0 否 1 是
     */
    private Integer isContact;
    /**
     * 是否特殊情况(重大过往病史或者孕妇) 0 否 1是
     */
    private Integer major;
    /**
     * 是否退伍军人 0 否 1是
     */
    private Integer soldier;
    /**
     * 是否低保户 0 否 1是
     */
    private Integer lowincomeHouseholds;
    /**
     * 是否低收入人员 0否 1是
     */
    private Integer lowincomePeople;
    /**
     * 是否高龄老人 0否 1是
     */
    private Integer oldPeople;
    /**
     * 是否特服家庭 0 否 1是
     */
    private Integer specialServiceFamily;
    /**
     * 是否重点人员 0 否 1是
     */
    private Integer keyPersonnel;
    /**
     * 社区id
     */
    private Long communityId;
    /**
     * 小区id
     */
    private Long areaId;
    /**
     * create_at
     */
    @TableField(fill = FieldFill.INSERT)
    private Date createAt;
    /**
     * update_at
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateAt;
    /**
     * 房屋编码
     */
    private String houseCode;
    /**
     * 残疾人
     */
    private Integer disability;
}
springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/SysUserInputService.java
New file
@@ -0,0 +1,31 @@
package com.panzhihua.service_user.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.panzhihua.common.model.dtos.user.EexcelUserDTO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.user.CommunityUserInfoVO;
import com.panzhihua.service_user.model.dos.SysUserInputDO;
import java.util.List;
/**
 * @program: springcloud_k8s_panzhihuazhihuishequ
 * @description: 居民导入
 * @author: huang.hongfa weixin hhf9596 qq 959656820
 * @create: 2021-02-05 17:42
 **/
public interface SysUserInputService extends IService<SysUserInputDO> {
    /**
     * 批量导入居民用户
     * @param list 居民用户集合
     * @param areaName 小区名字
     * @return 导入结果
     */
    R batchSaveUser(List<EexcelUserDTO> list, StringBuffer areaName);
    /**
     * 社区人员详情包括导入人员
     * @param userId 人员id
     * @return CommunityUserInfoVO
     */
    CommunityUserInfoVO detailUserComunity(Long userId);
}
springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/UserService.java
@@ -1,7 +1,9 @@
package com.panzhihua.service_user.service;
import com.panzhihua.common.model.dtos.PageDTO;
import com.panzhihua.common.model.dtos.community.ExportUserDTO;
import com.panzhihua.common.model.dtos.community.NoticeReadDTO;
import com.panzhihua.common.model.dtos.user.EexcelUserDTO;
import com.panzhihua.common.model.dtos.user.PageFeedBackDTO;
import com.panzhihua.common.model.dtos.user.PageUserAppletsBackstageDTO;
import com.panzhihua.common.model.dtos.user.SysUserFeedbackDTO;
@@ -9,6 +11,8 @@
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.SystemmanagementConfigVO;
import com.panzhihua.common.model.vos.user.*;
import java.util.List;
/**
 * @program: springcloud_k8s_panzhihuazhihuishequ
@@ -322,4 +326,22 @@
     * @return 删除结果
     */
    R deleteFeedback(Long id);
    /**
     * 校验小区是否存在
     * @param areaName 小区名字
     * @return 校验结果
     */
    R checkAereaName(String areaName);
    /**
     * 社区人员详情包括导入人员
     * @param userId 人员id
     * @return CommunityUserInfoVO
     */
    CommunityUserInfoVO detailUserComunity(Long userId);
    /**
     *  用户搜索了就下载搜索的用户否则下载所有用户
     * @param exportUserDTO 用户搜索内容
     * @return List<EexcelUserDTO> excel内容
     */
    R export(ExportUserDTO exportUserDTO);
}
springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/SysUserInputServiceImpl.java
New file
@@ -0,0 +1,171 @@
package com.panzhihua.service_user.service.impl;
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.panzhihua.common.exceptions.ServiceException;
import com.panzhihua.common.model.dtos.user.EexcelUserDTO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.community.ComMngStructAreaVO;
import com.panzhihua.common.model.vos.community.ComMngStructHouseVO;
import com.panzhihua.common.model.vos.community.ComMngVolunteerMngVO;
import com.panzhihua.common.model.vos.user.ComMngFamilyInfoVO;
import com.panzhihua.common.model.vos.user.CommunityUserInfoVO;
import com.panzhihua.common.utlis.IdCard;
import com.panzhihua.service_user.dao.SysUserInputDAO;
import com.panzhihua.service_user.model.dos.ComMngFamilyInfoDO;
import com.panzhihua.service_user.model.dos.SysUserDO;
import com.panzhihua.service_user.model.dos.SysUserInputDO;
import com.panzhihua.service_user.service.SysUserInputService;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
/**
 * @program: springcloud_k8s_panzhihuazhihuishequ
 * @description: 居民导入
 * @author: huang.hongfa weixin hhf9596 qq 959656820
 * @create: 2021-02-05 17:42
 **/
@Service
public class SysUserInputServiceImpl extends ServiceImpl<SysUserInputDAO, SysUserInputDO> implements SysUserInputService {
    @Resource
    private SysUserInputDAO sysUserInputDAO;
    @Resource
    private StringRedisTemplate stringRedisTemplate;
    /**
     * 批量导入居民用户
     * @param list 居民用户集合
     * @param areaName 小区名字
     * @return 导入结果
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public R batchSaveUser(List<EexcelUserDTO> list, StringBuffer areaName) {
        List<SysUserInputDO> sysUserInputDOS=new ArrayList<>();
        if (!ObjectUtils.isEmpty(list)) {
            ComMngStructAreaVO comMngStructAreaVO=sysUserInputDAO.selectByAreaName(areaName.toString());
//            查询该小区所有房屋信息用来进行匹配房屋编码
            String key="house_"+areaName;
            Boolean aBoolean = stringRedisTemplate.hasKey(key);
            ValueOperations<String, String> stringStringValueOperations = stringRedisTemplate.opsForValue();
            List<ComMngStructHouseVO> comMngStructHouseVOS=new ArrayList<>();
            if (aBoolean) {
                String value = stringStringValueOperations.get(key);
                 comMngStructHouseVOS= JSONArray.parseArray(value,ComMngStructHouseVO.class);
            }else{
                comMngStructHouseVOS=sysUserInputDAO.selectHouserByareaName(areaName.toString());
            }
            List<ComMngStructHouseVO> comMngStructHouseVOS1=comMngStructHouseVOS;
            list.forEach(eexcelUserDTO -> {
                SysUserInputDO sysUserInputDO=new SysUserInputDO();
                String doorNumber = eexcelUserDTO.getDoorNumber();
                List<ComMngStructHouseVO> collect = comMngStructHouseVOS1.stream().filter(comMngStructHouseVO -> comMngStructHouseVO.getHouseName().equals(doorNumber)).collect(Collectors.toList());
                if (ObjectUtils.isEmpty(collect)) {
                    throw new ServiceException("门牌号后台不存在或格式错误,错误门牌号为"+doorNumber);
                }else{
                    sysUserInputDO.setHouseCode(collect.get(0).getHouseCode());
                }
                sysUserInputDO.setAreaId(comMngStructAreaVO.getId());
                sysUserInputDO.setCommunityId(comMngStructAreaVO.getCommunityId());
                sysUserInputDO.setCompany(eexcelUserDTO.getCompany());
                sysUserInputDO.setDoorNumber(doorNumber);
                sysUserInputDO.setEducation(eexcelUserDTO.getEducation());
                sysUserInputDO.setIdCard(eexcelUserDTO.getIdCard());
                sysUserInputDO.setIsContact(eexcelUserDTO.getIsContact().equals("是")?1:0);
                sysUserInputDO.setIsPanzhihua(eexcelUserDTO.getIsPanZhiHua().equals("是")?1:0);
                sysUserInputDO.setIsRent(eexcelUserDTO.getIsRent().equals("是")?1:0);
                sysUserInputDO.setKeyPersonnel(eexcelUserDTO.getKeyPersonnel().equals("是")?1:0);
                sysUserInputDO.setLowincomeHouseholds(eexcelUserDTO.getLowIncomeHouseholds().equals("是")?1:0);
                sysUserInputDO.setLowincomePeople(eexcelUserDTO.getLowIncomePeople().equals("是")?1:0);
                sysUserInputDO.setMajor(eexcelUserDTO.getMajor().equals("是")?1:0);
                sysUserInputDO.setMaritalStatus(eexcelUserDTO.getMaritalStatus().equals("是")?1:0);
                sysUserInputDO.setName(eexcelUserDTO.getName());
                sysUserInputDO.setNation(eexcelUserDTO.getNation());
                sysUserInputDO.setOldPeople(eexcelUserDTO.getOldPeople().equals("是")?1:0);
                sysUserInputDO.setDisability(eexcelUserDTO.getDisability().equals("是")?1:0);
                sysUserInputDO.setPhone(eexcelUserDTO.getPhone());
                String politicalOutlook = eexcelUserDTO.getPoliticalOutlook();
                sysUserInputDO.setPoliticalOutlook(politicalOutlook.equals("党员")?1:politicalOutlook.equals("团员")?2:3);
                sysUserInputDO.setResidence(eexcelUserDTO.getResidence());
                sysUserInputDO.setSituation(eexcelUserDTO.getSituation());
                sysUserInputDO.setSoldier(eexcelUserDTO.getSoldier().equals("是")?1:0);
                sysUserInputDO.setSpecialServiceFamily(eexcelUserDTO.getSpecialServiceFamily().equals("是")?1:0);
                sysUserInputDOS.add(sysUserInputDO);
            });
            this.saveBatch(sysUserInputDOS);
        }
        return R.ok();
    }
    /**
     * 社区人员详情包括导入人员
     *
     * @param userId 人员id
     * @return CommunityUserInfoVO
     */
    @Override
    public CommunityUserInfoVO detailUserComunity(Long userId) {
        CommunityUserInfoVO communityUserInfoVO=new CommunityUserInfoVO();
        userId=userId-100000000l;
        SysUserInputDO sysUserInputDO = sysUserInputDAO.selectById(userId);
        if (!org.springframework.util.ObjectUtils.isEmpty(sysUserInputDO)) {
            BeanUtils.copyProperties(sysUserInputDO,communityUserInfoVO);
            String idCard = sysUserInputDO.getIdCard();
            if (!org.springframework.util.ObjectUtils.isEmpty(idCard)) {
                communityUserInfoVO.setAge(IdCard.IdNOToAge(idCard));
                communityUserInfoVO.setBirthday(IdCard.birthDay(idCard));
                communityUserInfoVO.setIdCard(idCard);
                communityUserInfoVO.setSex(IdCard.sex(idCard));
            }
            String phone = sysUserInputDO.getPhone();
            communityUserInfoVO.setPhone(phone);
            Integer keyPersonnel = sysUserInputDO.getKeyPersonnel();
            Integer specialServiceFamily = sysUserInputDO.getSpecialServiceFamily();
            Integer soldier = sysUserInputDO.getSoldier();
            Integer lowincomeHouseholds = sysUserInputDO.getLowincomeHouseholds();
            Integer lowincomePeople = sysUserInputDO.getLowincomePeople();
            Integer oldPeople = sysUserInputDO.getOldPeople();
            Integer disability = sysUserInputDO.getDisability();
            StringBuilder stringBuilder=new StringBuilder("");
            if (keyPersonnel.intValue()==1) {
                stringBuilder.append("重点人员,");
            }
            if (specialServiceFamily.intValue()==1) {
                stringBuilder.append("特服家庭,");
            }
            if (soldier.intValue()==1) {
                stringBuilder.append("军人,");
            }
            if (lowincomeHouseholds.intValue()==1) {
                stringBuilder.append("低保户,");
            }
            if (lowincomePeople.intValue()==1) {
                stringBuilder.append("低收入人员,");
            }
            if (oldPeople.intValue()==1) {
                stringBuilder.append("高龄老人,");
            }
            if (disability.intValue()==1) {
                stringBuilder.append("残疾人,");
            }
            communityUserInfoVO.setTags(stringBuilder.toString());
            communityUserInfoVO.setUserId(userId);
            communityUserInfoVO.setIsVolunteer(0);
            String doorNumber = sysUserInputDO.getDoorNumber();
            List<ComMngFamilyInfoVO> comMngFamilyInfoVOS = sysUserInputDAO.selectListFamily(doorNumber,userId);
            communityUserInfoVO.setComMngFamilyInfoVOS(comMngFamilyInfoVOS);
        }
        return communityUserInfoVO;
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java
@@ -8,7 +8,9 @@
import com.panzhihua.common.constants.UserConstants;
import com.panzhihua.common.exceptions.ServiceException;
import com.panzhihua.common.model.dtos.PageDTO;
import com.panzhihua.common.model.dtos.community.ExportUserDTO;
import com.panzhihua.common.model.dtos.community.NoticeReadDTO;
import com.panzhihua.common.model.dtos.user.EexcelUserDTO;
import com.panzhihua.common.model.dtos.user.PageFeedBackDTO;
import com.panzhihua.common.model.dtos.user.PageUserAppletsBackstageDTO;
import com.panzhihua.common.model.dtos.user.SysUserFeedbackDTO;
@@ -17,14 +19,16 @@
import com.panzhihua.common.model.vos.community.ComMngVolunteerMngVO;
import com.panzhihua.common.model.vos.partybuilding.ActivityManagerVO;
import com.panzhihua.common.model.vos.user.*;
import com.panzhihua.common.utlis.IdCard;
import com.panzhihua.common.utlis.RealNameUtil;
import com.panzhihua.service_user.dao.*;
import com.panzhihua.service_user.model.dos.*;
import com.panzhihua.service_user.model.dtos.DataKanbanDTO;
import com.panzhihua.service_user.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.apache.commons.lang3.time.DateUtils;
import org.apache.commons.lang.time.DateFormatUtils;
import org.apache.commons.lang.time.DateUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.data.redis.core.ValueOperations;
@@ -71,6 +75,8 @@
    private SysRoleMenuDAO sysRoleMenuDAO;
    @Resource
    private SysMenuDAO sysMenuDAO;
    @Resource
    private SysUserInputDAO sysUserInputDAO;
    /**
@@ -398,11 +404,12 @@
     */
    @Override
    public R detailUser(Long userId) {
        LoginUserInfoVO loginUserInfoVO=new LoginUserInfoVO();
        if(userId<100000000l){
        SysUserDO sysUserDO = userDao.selectById(userId);
        if (ObjectUtils.isEmpty(sysUserDO)) {
            return R.fail("人员不存在");
        }
        LoginUserInfoVO loginUserInfoVO=new LoginUserInfoVO();
        BeanUtils.copyProperties(sysUserDO,loginUserInfoVO);
        List<ComMngFamilyInfoDO> comMngFamilyInfoDOS = comMngFamilyInfoDAO.selectList(new QueryWrapper<ComMngFamilyInfoDO>().lambda().eq(ComMngFamilyInfoDO::getUserId, userId));
        if (!ObjectUtils.isEmpty(comMngFamilyInfoDOS)) {
@@ -413,6 +420,42 @@
                comMngFamilyInfoVOS.add(comMngFamilyInfoVO);
            });
            loginUserInfoVO.setComMngFamilyInfoVOS(comMngFamilyInfoVOS);
            }
        }else{
            //导入社区人员
            SysUserInputDO sysUserInputDO = sysUserInputDAO.selectById(userId - 100000000);
            if (ObjectUtils.isEmpty(sysUserInputDO)) {
                return R.fail("人员不存在");
            }
            String name1 = sysUserInputDO.getName();
            BeanUtils.copyProperties(sysUserInputDO,loginUserInfoVO);
            String doorNumber = sysUserInputDO.getDoorNumber();
            Long areaId = sysUserInputDO.getAreaId();
            List<SysUserInputDO> sysUserInputDOS = sysUserInputDAO.selectList(new QueryWrapper<SysUserInputDO>().lambda().eq(SysUserInputDO::getDoorNumber, doorNumber).eq(SysUserInputDO::getAreaId, areaId));
            if (!ObjectUtils.isEmpty(sysUserInputDOS)) {
                List<ComMngFamilyInfoVO>comMngFamilyInfoVOS=new ArrayList<>();
                sysUserInputDOS.forEach(sysUserInputDO1 -> {
                    String name = sysUserInputDO1.getName();
                    if (name1.equals(name)) {
                        return;
                    }
                    Integer isRent = sysUserInputDO1.getIsRent();
                    ComMngFamilyInfoVO comMngFamilyInfoVO=new ComMngFamilyInfoVO();
                    comMngFamilyInfoVO.setIdCard(sysUserInputDO1.getIdCard());
                    comMngFamilyInfoVO.setName(name);
                    comMngFamilyInfoVO.setPhone(sysUserInputDO1.getPhone());
                    if (isRent.intValue()==0) {
                        comMngFamilyInfoVO.setRelationship("家人");
                    }else{
                        comMngFamilyInfoVO.setRelationship("合租");
                    }
                    comMngFamilyInfoVO.setAge(IdCard.IdNOToAge(sysUserInputDO1.getIdCard()));
                    comMngFamilyInfoVOS.add(comMngFamilyInfoVO);
                });
                loginUserInfoVO.setComMngFamilyInfoVOS(comMngFamilyInfoVOS);
            }
        }
        ComActVO comActVO=userDao.selectCommunity(loginUserInfoVO.getCommunityId());
        if (!ObjectUtils.isEmpty(comActVO)) {
@@ -1083,6 +1126,7 @@
    public R addFeedback(SysUserFeedbackDTO sysUserFeedbackDTO) {
        SysUserFeedbackDO sysUserFeedbackDO=new SysUserFeedbackDO();
        BeanUtils.copyProperties(sysUserFeedbackDTO,sysUserFeedbackDO);
        sysUserFeedbackDO.setPhotoPath(sysUserFeedbackDTO.getPhotoPah());
        int insert = sysUserFeedbackDAO.insert(sysUserFeedbackDO);
        if (insert>0) {
            return R.ok();
@@ -1360,6 +1404,88 @@
        return R.fail();
    }
    /**
     * 校验小区是否存在
     *
     * @param areaName 小区名字
     * @return 校验结果
     */
    @Override
    public R checkAereaName(String areaName) {
        Integer num=userDao.selectCountArea(areaName);
        if (num>0) {
            Integer integer = userDao.selectCountHouse(areaName);
            if (integer>0) {
                return R.ok();
            }else{
                return R.fail("小区房屋信息未创建,请先在社区平台添加房屋信息");
            }
        }else{
            return R.fail("小区不存在,请先在社区平台添加小区");
        }
    }
    /**
     * 社区人员详情包括导入人员
     *
     * @param userId 人员id
     * @return CommunityUserInfoVO
     */
    @Override
    public CommunityUserInfoVO detailUserComunity(Long userId) {
        CommunityUserInfoVO communityUserInfoVO=new CommunityUserInfoVO();
        SysUserDO sysUserDO = userDao.selectById(userId);
        if (!ObjectUtils.isEmpty(sysUserDO)) {
            String idCard = sysUserDO.getIdCard();
            if (!ObjectUtils.isEmpty(idCard)) {
                communityUserInfoVO.setAge(IdCard.IdNOToAge(idCard));
                communityUserInfoVO.setBirthday(IdCard.birthDay(idCard));
                communityUserInfoVO.setIdCard(idCard);
            }
            communityUserInfoVO.setCreateAt(sysUserDO.getCreateAt());
            communityUserInfoVO.setName(sysUserDO.getName());
            String phone = sysUserDO.getPhone();
            communityUserInfoVO.setPhone(phone);
            communityUserInfoVO.setSex(sysUserDO.getSex());
            communityUserInfoVO.setTags(sysUserDO.getTags());
            communityUserInfoVO.setUserId(userId);
            ComMngVolunteerMngVO comMngVolunteerMngVO = userDao.selectVolunteerMngByPhone(phone);
            if (!ObjectUtils.isEmpty(comMngVolunteerMngVO)) {
                communityUserInfoVO.setVolunteerCreateAt(comMngVolunteerMngVO.getCreateAt());
            }
            Integer isPartymember = sysUserDO.getIsPartymember();
            if (isPartymember.intValue()==1) {
                communityUserInfoVO.setPoliticalOutlook(1);
            }else{
                communityUserInfoVO.setPoliticalOutlook(3);
            }
            communityUserInfoVO.setIsVolunteer(sysUserDO.getIsVolunteer());
            List<ComMngFamilyInfoDO> comMngFamilyInfoDOS = comMngFamilyInfoDAO.selectList(new QueryWrapper<ComMngFamilyInfoDO>().lambda().eq(ComMngFamilyInfoDO::getUserId, userId));
            if (!ObjectUtils.isEmpty(comMngFamilyInfoDOS)) {
                List<ComMngFamilyInfoVO>comMngFamilyInfoVOS=new ArrayList<>();
                comMngFamilyInfoDOS.forEach(comMngFamilyInfoDO -> {
                    ComMngFamilyInfoVO comMngFamilyInfoVO=new ComMngFamilyInfoVO();
                    BeanUtils.copyProperties(comMngFamilyInfoDO,comMngFamilyInfoVO);
                    comMngFamilyInfoVOS.add(comMngFamilyInfoVO);
                });
                communityUserInfoVO.setComMngFamilyInfoVOS(comMngFamilyInfoVOS);
            }
        }
        return communityUserInfoVO;
    }
    /**
     * 用户搜索了就下载搜索的用户否则下载所有用户
     *
     * @param exportUserDTO 用户搜索内容
     * @return List<EexcelUserDTO> excel内容
     */
    @Override
    public R export(ExportUserDTO exportUserDTO) {
        List<EexcelUserDTO> eexcelUserDTOS=userDao.selectExport(exportUserDTO);
        return R.ok(eexcelUserDTOS);
    }
    public static void main(String[] args) {
//        String encode = new BCryptPasswordEncoder().encode("lbsq123456");
springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/logback-spring.xml
@@ -7,6 +7,7 @@
    <springProfile name="test">
        <property name="LOG_HOME" value="/mnt/data/gocd/log" />
    </springProfile>
<property name="LOG_HOME" value="/mnt/data/gocd/log" />
    <!-- 控制台输出 -->
    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
        <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
springcloud_k8s_panzhihuazhihuishequ/zuul/src/main/java/com/panzhihua/zuul/filters/JWTAuthenticationTokenFilter.java
@@ -1,3 +1,4 @@
<<<<<<< HEAD
package com.panzhihua.zuul.filters;
import com.alibaba.fastjson.JSONArray;
@@ -170,3 +171,177 @@
    }
}
=======
package com.panzhihua.zuul.filters;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.panzhihua.common.constants.*;
import com.panzhihua.common.model.vos.LoginUserInfoVO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.service.user.UserService;
import com.panzhihua.common.utlis.AES;
import com.panzhihua.common.utlis.JWTTokenUtil;
import com.panzhihua.common.utlis.ResultUtil;
import io.jsonwebtoken.Claims;
import org.springframework.context.ApplicationContext;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils;
import org.springframework.web.context.support.WebApplicationContextUtils;
import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;
/**
 * @program: springcloud_k8s_panzhihuazhihuishequ
 * @description: token校验
 * @author: huang.hongfa weixin hhf9596 qq 959656820
 * @create: 2020-11-25 16:35
 **/
@Component
public class JWTAuthenticationTokenFilter implements Filter {
    private StringRedisTemplate stringRedisTemplate;
    private UserService userService;
    @Override
    public void init(FilterConfig filterConfig) throws ServletException {
    }
    /**
     * 用户是否登录校验
     *
     * @param servletRequest  请求
     * @param servletResponse 返回
     * @param filterChain     过滤器链条
     * @throws IOException      io
     * @throws ServletException servlet
     */
    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
        HttpServletRequest request = (HttpServletRequest) servletRequest;
        HttpServletResponse response = (HttpServletResponse) servletResponse;
        ServletContext context = request.getServletContext();
        ApplicationContext ctx = WebApplicationContextUtils.getWebApplicationContext(context);
        stringRedisTemplate=ctx.getBean(StringRedisTemplate.class);
        ValueOperations<String, String> valueOperations = stringRedisTemplate.opsForValue();
        userService=ctx.getBean(UserService.class);
        String requestURI = request.getRequestURI();
        boolean login = requestURI.contains("login");
        boolean doc = requestURI.contains("doc.html");
        boolean css = requestURI.contains(".css");
        boolean js = requestURI.contains(".js");
        boolean ui = requestURI.contains("/ui");
        boolean swagger = requestURI.contains("swagger");
        boolean ico = requestURI.contains(".ico");
        boolean docs = requestURI.contains("-docs");
        boolean error = requestURI.contains("error");
        boolean useragreement = requestURI.contains("useragreement");
        boolean refreshToken = requestURI.contains("refreshToken");
        boolean logout = requestURI.contains("logout");
        SafeboxRequestWrapper safeboxRequestWrapper = new SafeboxRequestWrapper(request);
        if (login||doc||css||js||ui||swagger||ico||docs||error||refreshToken||useragreement) {
            //什么也不做
        } else {
            // 获取请求头中JWT的Token
            String tokenHeader = request.getHeader(TokenConstant.TOKEN_HEADER);
            if (null != tokenHeader && tokenHeader.startsWith(TokenConstant.TOKEN_PRE)) {
                // token过期
                String token = tokenHeader.replace(TokenConstant.TOKEN_PRE, "");
                Boolean hasKey = stringRedisTemplate.hasKey(UserConstants.LOGOUT_TOKEN + token);
                if (hasKey) {
                    ResultUtil.responseJson(response, R.fail(HttpStatus.UNAUTHORIZED, "用户已经登出"));
                    return;
                }
                Boolean expired = JWTTokenUtil.isTokenExpired(token);
                if (expired) {
                    if (logout) {
                        ResultUtil.responseJson(response, R.fail(HttpStatus.UNAUTHORIZED, "登出成功"));
                    } else {
                        ResultUtil.responseJson(response, R.fail(HttpStatus.UNAUTHORIZED, "token过期"));
                    }
                    return;
                }
                // token解析
                Claims claims = JWTTokenUtil.getClaimsFromToken(token);
                if (ObjectUtils.isEmpty(claims)) {
                    ResultUtil.responseJson(response, R.fail(HttpStatus.UNAUTHORIZED, "token校验失败"));
                    return;
                }
                String username = claims.getSubject();
                int type = (Integer) claims.get("type");
                if (ObjectUtils.isEmpty(username)) {
                    ResultUtil.responseJson(response, R.fail(HttpStatus.UNAUTHORIZED, "token校验失败"));
                    return;
                }
                List<SimpleGrantedAuthority> authorities = new ArrayList<>();
                List<SimpleGrantedAuthority> authorities1 = new ArrayList<>();
                String key = SecurityConstants.ROLE_USER + username;
                Boolean aBoolean = stringRedisTemplate.hasKey(key);
                if (1 == type) {//小程序用户统一角色
                    authorities.add(new SimpleGrantedAuthority(SecurityConstants.ROLE_APPLETS));
                } else {
                    if (aBoolean) {
                        String roles = valueOperations.get(key);
                        authorities = JSONArray.parseArray(roles, SimpleGrantedAuthority.class);
                    } else {
                        R<List<String>> r = userService.getUserRoles(username);
                        List<String> data =(List<String>)r.getData();
                        if (!ObjectUtils.isEmpty(data)) {
                            data.forEach(s -> {
                                authorities1.add(new SimpleGrantedAuthority(s));
                            });
                            authorities = authorities1;
                            valueOperations.set(key, JSONArray.toJSONString(authorities), 24, TimeUnit.HOURS);
                        }
                    }
                }
                UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken(username, username, authorities);//主要使用权限 账户 密码 不重要
                SecurityContextHolder.getContext().setAuthentication(authentication);
                safeboxRequestWrapper.addHeader(TokenConstant.TOKEN_LOGOUT,tokenHeader);
                //登录用户的所有信息
                String userKey = UserConstants.LOGIN_USER_INFO + username;
                Boolean hasKeyLoginUserInfo = stringRedisTemplate.hasKey(userKey);
                if(hasKeyLoginUserInfo){
                    String userInfo = valueOperations.get(userKey);
                    byte[] encrypt = AES.encrypt(userInfo, Constants.AES_KEY);
                    String hexStr = AES.parseByte2HexStr(encrypt);
                    safeboxRequestWrapper.addHeader(TokenConstant.TOKEN_USERINFO, hexStr);
                }else{
                    R<LoginUserInfoVO> r = userService.getUserInfoByUserId(username);
                    if (!R.isOk(r)) {
                        ResultUtil.responseJson(response, R.fail(HttpStatus.ERROR, "登录用户信息查询失败"));
                        return;
                    }
                    LoginUserInfoVO data = r.getData();
                    String userInfo = JSONObject.toJSONString(data);
                    valueOperations.set(userKey,userInfo,24,TimeUnit.HOURS);
                    byte[] encrypt = AES.encrypt(userInfo, Constants.AES_KEY);
                    String hexStr = AES.parseByte2HexStr(encrypt);
                    safeboxRequestWrapper.addHeader(TokenConstant.TOKEN_USERINFO,hexStr );
                }
            } else {
                ResultUtil.responseJson(response, R.fail(HttpStatus.UNAUTHORIZED, "token校验失败"));
                return;
            }
        }
        filterChain.doFilter(safeboxRequestWrapper,response);
        }
    @Override
    public void destroy() {
    }
}
>>>>>>> afeb571ca27a185766615c2b68fcfa5b13a56dab
springcloud_k8s_panzhihuazhihuishequ/zuul/src/main/java/com/panzhihua/zuul/filters/SercuritFilter.java
@@ -1,3 +1,4 @@
<<<<<<< HEAD
package com.panzhihua.zuul.filters;
import com.alibaba.fastjson.JSONArray;
@@ -91,3 +92,98 @@
        return false;
    }
}
=======
package com.panzhihua.zuul.filters;
import com.alibaba.fastjson.JSONArray;
import com.panzhihua.common.constants.SecurityConstants;
import com.panzhihua.common.constants.UserConstants;
import com.panzhihua.common.model.vos.MenuVO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.service.user.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.security.access.ConfigAttribute;
import org.springframework.security.access.SecurityConfig;
import org.springframework.security.web.FilterInvocation;
import org.springframework.security.web.access.intercept.FilterInvocationSecurityMetadataSource;
import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
/**
 * @program: springcloud_k8s_panzhihuazhihuishequ
 * @description: 权限
 * @author: huang.hongfa weixin hhf9596 qq 959656820
 * @create: 2020-11-25 15:08
 **/
@Slf4j
@Component
public class SercuritFilter implements FilterInvocationSecurityMetadataSource {
    @Resource
    private StringRedisTemplate stringRedisTemplate;
    @Resource
    private UserService userService;
    /**
     * 获取当前url对应的角色
     * @param o 请求url
     * @return 权限列表
     * @throws IllegalArgumentException 异常
     */
    @Override
    public Collection<ConfigAttribute> getAttributes(Object o) throws IllegalArgumentException {
       List<ConfigAttribute> configAttributes=new ArrayList<>();
        String requestUrl = ((FilterInvocation) o).getRequestUrl();
        log.info("接口请求地址【{}】",requestUrl);
        Boolean aBoolean = stringRedisTemplate.hasKey(SecurityConstants.ROLE_ALL);
        ValueOperations<String, String> valueOperations = stringRedisTemplate.opsForValue();
        List<MenuVO> menuVOS=new ArrayList<>();
        if (aBoolean) {
            String roleAll = valueOperations.get(SecurityConstants.ROLE_ALL);
            menuVOS= JSONArray.parseArray(roleAll,MenuVO.class);
        }else{
            R<List<MenuVO>> r = userService.getAllMenu();
            List<MenuVO> data = (List<MenuVO>)r.getData();
            if (!ObjectUtils.isEmpty(data)) {
                menuVOS=data;
                valueOperations.set(SecurityConstants.ROLE_ALL,JSONArray.toJSONString(data),24, TimeUnit.HOURS);
            }
        }
        if (!ObjectUtils.isEmpty(menuVOS)) {
            List<MenuVO> collect = menuVOS.stream().filter(menuVO -> menuVO.getUrl().equals(requestUrl)).collect(Collectors.toList());
            if (!ObjectUtils.isEmpty(collect)) {
                collect.forEach(menuVO -> {
                    configAttributes.add(new SecurityConfig(menuVO.getRole()));
                });
            }
        }
        boolean contains = requestUrl.contains("/api/applets/");
        boolean docs = !requestUrl.contains("docs");
        boolean login = !requestUrl.contains("login");
        boolean refreshToken = !requestUrl.contains("refreshToken");
        boolean useragreement = !requestUrl.contains("useragreement");
        if (contains&&docs&&login&&refreshToken&&useragreement) {
            configAttributes.add(new SecurityConfig(SecurityConstants.ROLE_APPLETS));
        }
        return configAttributes;
    }
    @Override
    public Collection<ConfigAttribute> getAllConfigAttributes() {
        return null;
    }
    @Override
    public boolean supports(Class<?> aClass) {
        return false;
    }
}
>>>>>>> afeb571ca27a185766615c2b68fcfa5b13a56dab
springcloud_k8s_panzhihuazhihuishequ/zuul/src/main/resources/logback-spring.xml
@@ -7,6 +7,7 @@
    <springProfile name="test">
        <property name="LOG_HOME" value="/mnt/data/gocd/log" />
    </springProfile>
<property name="LOG_HOME" value="/mnt/data/gocd/log" />
    <!-- 控制台输出 -->
    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
        <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">