Browse Source

大屏接口,摄像头对接,成研数据对接

523096025 1 month ago
parent
commit
3b7ab4389c
100 changed files with 4659 additions and 3 deletions
  1. 25 0
      app-admin/pom.xml
  2. 9 0
      app-admin/src/main/java/com/ruoyi/RuoYiJssApplication.java
  3. 58 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/AESUtil.java
  4. 162 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/ChenYanLoginController.java
  5. 118 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/ChengYanAesUtil.java
  6. 12 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/LoginVo.java
  7. 50 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/RSAUtil.java
  8. 24 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/Receiver.java
  9. 32 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/Sender.java
  10. 91 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/controller/GetHuiCunController.java
  11. 20 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/controller/HouseDigitalNumberController.java
  12. 20 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/controller/HousePictureController.java
  13. 20 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/controller/HouseTagController.java
  14. 20 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/controller/HouseVillagerRelationController.java
  15. 132 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/controller/NationUnityController.java
  16. 20 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/controller/SubsidyProjectsJianController.java
  17. 20 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/controller/TagsController.java
  18. 20 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/controller/TagsPersonController.java
  19. 28 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/dto/BasicDataDto.java
  20. 27 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/dto/CarePeopleData.java
  21. 23 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/dto/CivilizedDataDto.java
  22. 50 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/dto/House.java
  23. 22 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/dto/HouseData.java
  24. 19 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/dto/HouseDigitalNumberPlate.java
  25. 21 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/dto/HousePictures.java
  26. 18 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/dto/HouseTags.java
  27. 19 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/dto/HouseVillagerRelation.java
  28. 15 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/dto/PointRankDataDto.java
  29. 8 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/dto/ResponDto.java
  30. 23 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/dto/SnapshotReporListtDto.java
  31. 22 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/dto/SnapshotReportDto.java
  32. 17 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/dto/SyncVillagerDataDto.java
  33. 19 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/dto/TagsList.java
  34. 11 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/dto/UserDefinedFiled.java
  35. 28 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/dto/VillageNewsDataDto.java
  36. 43 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/dto/VillagerList.java
  37. 10 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/dto/VillagerTagList.java
  38. 16 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/dto/VillagerUserDefinedFieldList.java
  39. 10 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/dto/ZhwlDeviceDataDto.java
  40. 42 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/entity/HouseDigitalNumber.java
  41. 40 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/entity/HousePicture.java
  42. 40 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/entity/HouseTag.java
  43. 45 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/entity/HouseVillagerRelation.java
  44. 88 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/entity/NationUnity.java
  45. 47 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/entity/SubsidyProjectsJian.java
  46. 83 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/entity/Tags.java
  47. 35 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/entity/TagsPerson.java
  48. 274 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/haikang/ArtemisPostTest.java
  49. 14 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/haikang/CameraData.java
  50. 48 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/haikang/CameraInfo.java
  51. 12 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/haikang/CameraResponse.java
  52. 9 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/haikang/CameraStatusData.java
  53. 12 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/haikang/CameraStatusResponse.java
  54. 58 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/haikang/Tools.java
  55. 126 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/huicunutil/HuiCunJiaMi.java
  56. 169 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/huicunutil/MapUtils.java
  57. 239 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/huicunutil/SignUtils.java
  58. 16 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/mapper/HouseDigitalNumberMapper.java
  59. 16 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/mapper/HousePictureMapper.java
  60. 16 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/mapper/HouseTagMapper.java
  61. 16 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/mapper/HouseVillagerRelationMapper.java
  62. 16 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/mapper/NationUnityMapper.java
  63. 16 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/mapper/SubsidyProjectsJianMapper.java
  64. 16 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/mapper/TagsMapper.java
  65. 16 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/mapper/TagsPersonMapper.java
  66. 27 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/service/HuiCunService.java
  67. 16 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/service/IHouseDigitalNumberService.java
  68. 16 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/service/IHousePictureService.java
  69. 16 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/service/IHouseTagService.java
  70. 16 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/service/IHouseVillagerRelationService.java
  71. 33 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/service/INationUnityService.java
  72. 16 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/service/ISubsidyProjectsJianService.java
  73. 16 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/service/ITagsPersonService.java
  74. 16 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/service/ITagsService.java
  75. 13 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/service/impl/AlllowanceDto.java
  76. 25 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/service/impl/CardProject.java
  77. 33 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/service/impl/CardProjectAllowance.java
  78. 20 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/service/impl/HouseDigitalNumberServiceImpl.java
  79. 20 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/service/impl/HousePictureServiceImpl.java
  80. 20 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/service/impl/HouseTagServiceImpl.java
  81. 20 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/service/impl/HouseVillagerRelationServiceImpl.java
  82. 755 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/service/impl/HuiCunServiceImpl.java
  83. 170 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/service/impl/NationUnityServiceImpl.java
  84. 20 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/service/impl/SubsidyProjectsJianServiceImpl.java
  85. 20 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/service/impl/TagsPersonServiceImpl.java
  86. 20 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/service/impl/TagsServiceImpl.java
  87. 76 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/timer/GetCameraPreviewURL.java
  88. 90 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/timer/GetHuivCunTimer.java
  89. 93 0
      app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/timer/HaiKangTimer.java
  90. 191 0
      app-admin/src/main/java/com/ruoyi/web/controller/screen/ScreenController.java
  91. 9 0
      app-admin/src/main/java/com/ruoyi/web/controller/screen/dto/HeLiuQuXian.java
  92. 14 0
      app-admin/src/main/java/com/ruoyi/web/controller/screen/dto/VillageServiceDto.java
  93. 12 0
      app-admin/src/main/java/com/ruoyi/web/controller/screen/dto/YangZhiQuXian.java
  94. 9 0
      app-admin/src/main/java/com/ruoyi/web/controller/screen/dto/YangZhiQuXian2.java
  95. 13 0
      app-admin/src/main/java/com/ruoyi/web/controller/screen/dto/ZhongQuXianDto.java
  96. 8 0
      app-admin/src/main/java/com/ruoyi/web/controller/screen/vo/ZhongZhiQuXianVo.java
  97. 8 2
      app-admin/src/main/java/com/ruoyi/web/controller/system/EmergencyUserController.java
  98. 14 1
      app-admin/src/main/java/com/ruoyi/web/controller/system/HouseInfoController.java
  99. 3 0
      app-admin/src/main/java/com/ruoyi/web/controller/system/IndustryController.java
  100. 0 0
      app-admin/src/main/java/com/ruoyi/web/controller/system/LotPlatformDeviceController.java

+ 25 - 0
app-admin/pom.xml

@@ -24,6 +24,31 @@
             <optional>true</optional> <!-- 表示依赖不会传递 -->
         </dependency>
 
+        <dependency>
+            <groupId>commons-codec</groupId>
+            <artifactId>commons-codec</artifactId>
+            <version>1.15</version>
+        </dependency>
+        <dependency>
+            <groupId>com.hikvision.ga</groupId>
+            <artifactId>artemis-http-client</artifactId>
+            <version>1.1.15.RELEASE</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.httpcomponents</groupId>
+            <artifactId>httpclient</artifactId>
+            <version>4.5.13</version> <!-- 必须 ≥4.4 -->
+        </dependency>
+        <dependency>
+            <groupId>org.apache.httpcomponents</groupId>
+            <artifactId>httpcore</artifactId>
+            <version>4.4.15</version> <!-- 配套版本 -->
+        </dependency>
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>fastjson</artifactId>
+            <version>2.0.39</version> <!-- 建议检查最新版本 -->
+        </dependency>
         <!-- swagger3-->
         <dependency>
             <groupId>io.springfox</groupId>

+ 9 - 0
app-admin/src/main/java/com/ruoyi/RuoYiJssApplication.java

@@ -5,6 +5,9 @@ import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
 import org.springframework.context.ApplicationContext;
+import org.springframework.context.annotation.Bean;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.web.client.RestTemplate;
 
 /**
  * 启动程序
@@ -13,6 +16,7 @@ import org.springframework.context.ApplicationContext;
  */
 @SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
 @MapperScan("com.ruoyi.web.mapper")
+@EnableScheduling
 public class RuoYiJssApplication
 {
     public static void main(String[] args) throws Exception {
@@ -22,4 +26,9 @@ public class RuoYiJssApplication
         // EnvInputServer
         //applicationContext.getBean(EnvInputServer.class).run();
     }
+
+    @Bean
+    public RestTemplate get(){
+        return new RestTemplate();
+    }
 }

+ 58 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/AESUtil.java

@@ -0,0 +1,58 @@
+package com.ruoyi.web.controller.chenyanlogin;
+
+import javax.crypto.Cipher;
+import javax.crypto.KeyGenerator;
+import javax.crypto.SecretKey;
+import javax.crypto.spec.SecretKeySpec;
+import java.nio.charset.StandardCharsets;
+import java.util.Base64;
+
+public class AESUtil {
+    // 定义 AES 加密算法(也可用 "AES/CBC/PKCS5Padding" 等模式)
+    private static final String ALGORITHM = "AES";
+    private static final String TRANSFORMATION = "AES/ECB/PKCS5Padding";
+    private static final String  SECREKEY = "U5bRP8nwY30+6qS+sHLHBg==";
+
+    /**
+     * 生成 AES 密钥(128位)
+     */
+    public static String generateKey() throws Exception {
+        KeyGenerator keyGenerator = KeyGenerator.getInstance(ALGORITHM);
+        keyGenerator.init(128); // 128位密钥
+        SecretKey secretKey = keyGenerator.generateKey();
+        return Base64.getEncoder().encodeToString(secretKey.getEncoded());
+    }
+
+    /**
+     * AES 加密
+     * @param data 原始数据
+     * @param key Base64 编码的密钥
+     */
+    public static String encrypt(String data) throws Exception {
+        byte[] keyBytes = Base64.getDecoder().decode(SECREKEY);
+        SecretKeySpec secretKeySpec = new SecretKeySpec(keyBytes, ALGORITHM);
+
+        Cipher cipher = Cipher.getInstance(TRANSFORMATION);
+        cipher.init(Cipher.ENCRYPT_MODE, secretKeySpec);
+
+        byte[] encryptedBytes = cipher.doFinal(data.getBytes(StandardCharsets.UTF_8));
+        return Base64.getEncoder().encodeToString(encryptedBytes);
+    }
+
+    /**
+     * AES 解密
+     * @param encryptedData Base64 编码的密文
+     * @param key Base64 编码的密钥
+     */
+    public static String decrypt(String encryptedData) throws Exception {
+        byte[] keyBytes = Base64.getDecoder().decode(SECREKEY);
+        SecretKeySpec secretKeySpec = new SecretKeySpec(keyBytes, ALGORITHM);
+
+        Cipher cipher = Cipher.getInstance(TRANSFORMATION);
+        cipher.init(Cipher.DECRYPT_MODE, secretKeySpec);
+
+        byte[] encryptedBytes = Base64.getDecoder().decode(encryptedData);
+        byte[] decryptedBytes = cipher.doFinal(encryptedBytes);
+        return new String(decryptedBytes, StandardCharsets.UTF_8);
+    }
+}

+ 162 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/ChenYanLoginController.java

@@ -0,0 +1,162 @@
+package com.ruoyi.web.controller.chenyanlogin;
+
+import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.json.JSONObject;
+import cn.hutool.json.JSONUtil;
+import com.ruoyi.common.constant.Constants;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.entity.SysUser;
+import com.ruoyi.common.utils.SecurityUtils;
+import com.ruoyi.framework.web.service.SysLoginService;
+import com.ruoyi.system.domain.SysUserRole;
+import com.ruoyi.system.mapper.SysUserRoleMapper;
+import com.ruoyi.system.service.ISysUserService;
+import io.swagger.annotations.Api;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.DigestUtils;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.text.ParseException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import static com.ruoyi.common.core.domain.AjaxResult.error;
+import static com.ruoyi.common.core.domain.AjaxResult.success;
+
+/**
+ * @Project : huimv.shiwan
+ * @Package : com.ruoyi.web.controller.chenyanlogin
+ * @Description : TODO
+ * @Author : yuxuexuan
+ * @Create : 2025-09-11 15:14
+ **/
+@Api(tags = "获取账号信息")
+@RestController
+@RequestMapping("/system")
+public class ChenYanLoginController {
+
+
+
+    @Autowired
+    private ISysUserService sysUserService;
+    @Autowired
+    private SysUserRoleMapper sysUserRoleMapper;
+    @Autowired
+    private SysLoginService loginService;
+
+    @GetMapping("/phoneToken")
+    public AjaxResult phoneToken( ) throws Exception {
+        Long userId = SecurityUtils.getUserId();
+        Map<String, Object> user = new HashMap<>();
+        user.put("phone", sysUserService.selectUserById(userId).getPhonenumber());
+        user.put("time", System.currentTimeMillis());
+
+        String s = JSONUtil.toJsonStr(user);
+
+        String encryptedData = AESUtil.encrypt(s);
+        System.out.println("加密后的数据: " + encryptedData);
+        return success("生成成功",encryptedData);
+
+    }
+
+    @PostMapping("/getToken")
+    public AjaxResult list(HttpServletRequest httpServletRequest, @RequestBody LoginVo loginVo) throws ParseException {
+//        try {
+            if (ObjectUtil.isEmpty(loginVo)) {
+                return error("数据格式不正确");
+            }
+            StringBuilder stringBuilder = new StringBuilder();
+            stringBuilder
+                    .append(loginVo.getTime())
+                    .append("be5312e95c43624b52399a24ac268876")
+                    .append(loginVo.getPhone());
+            String mac = loginVo.getMac();
+            String s = DigestUtils.md5DigestAsHex(stringBuilder.toString().getBytes()).toLowerCase();
+            System.out.println(s);
+            System.out.println(mac);
+            if (!s.equals(mac)) {
+                return error("序列校验不通过");
+            }
+            System.out.println(loginVo.toString());
+            if (!isValidPhoneNumber(loginVo.getPhone())){
+                return error("手机号格式不正确");
+            }
+            SysUser phonenumber = sysUserService.selectUserByPhone(loginVo.getPhone());
+            if (ObjectUtil.isEmpty(phonenumber)){
+                phonenumber  = new SysUser();
+                phonenumber.setUserName(loginVo.getPhone());
+                phonenumber.setPhonenumber(loginVo.getPhone());
+                phonenumber.setNickName("测试");
+                phonenumber.setSex("0");
+                phonenumber.setPassword("$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2");
+                sysUserService.registerUser(phonenumber);
+                SysUserRole sysUserRole = new SysUserRole();
+                sysUserRole.setRoleId(4L);
+                SysUser sysUser = sysUserService.selectUserByPhone(loginVo.getPhone());
+                sysUserRole.setUserId(sysUser.getUserId());
+                List list = new ArrayList();
+                list.add(sysUserRole);
+                sysUserRoleMapper.batchUserRole(list);
+
+                AjaxResult ajax = AjaxResult.success();
+                // 生成令牌
+                String token = loginService.loginNoCaptcha(sysUser.getUserName(), "admin123");
+                ajax.put(Constants.TOKEN, token);
+                return ajax;
+            }else{
+                AjaxResult ajax = AjaxResult.success();
+                String token = loginService.loginNoCaptcha(phonenumber.getUserName(),"admin123");
+                ajax.put(Constants.TOKEN, token);
+                return ajax;
+            }
+//        }catch (Exception e){
+//            System.out.println(e);
+//            return error("其它异常");
+//        }
+
+    }
+
+    public static boolean isValidPhoneNumber(String phoneNumber) {
+
+        // 处理空值或null情况
+        if (phoneNumber == null || phoneNumber.isEmpty()) {
+            return false;
+        }
+        // 使用正则表达式校验
+        return phoneNumber.matches( "^1[3-9]\\d{9}$");
+    }
+    public static void main(String[] args) {
+        try {
+//            String secretKey = AESUtil.generateKey();
+//            System.out.println("生成的密钥(保存好,解密时需用): " + secretKey);
+            String jiami = jiami();
+
+            jiemi(jiami);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+   public static String jiami() throws Exception {
+//        String originalData = "13140429955";
+       Map<String, Object> user = new HashMap<>();
+       user.put("phone", "13140429955");
+       user.put("time", System.currentTimeMillis());
+
+       String s = JSONUtil.toJsonStr(user);
+
+       String encryptedData = AESUtil.encrypt(s);
+        System.out.println("加密后的数据: " + encryptedData);
+        return encryptedData;
+
+    }
+    public static void  jiemi(String jiami) throws Exception {
+        String decryptedData = AESUtil.decrypt(jiami);
+            System.out.println("解密后的数据: " + decryptedData);
+
+    }
+
+}

+ 118 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/ChengYanAesUtil.java

@@ -0,0 +1,118 @@
+package com.ruoyi.web.controller.chenyanlogin;
+
+
+
+import javax.crypto.Cipher;
+import javax.crypto.spec.SecretKeySpec;
+import java.nio.charset.StandardCharsets;
+import java.util.Base64;
+
+
+import javax.crypto.Cipher;
+import javax.crypto.spec.SecretKeySpec;
+
+public class ChengYanAesUtil {
+
+
+    /**
+     * AES 加密(使用 Java 标准库 Base64)
+     * @param encodeRules 密钥(16/24/32字节)
+     * @param content     待加密内容
+     * @return 加密后的 Base64 字符串,失败返回 null
+     */
+    public static String aesEncode(String encodeRules, String content) {
+        try {
+            // 1. 初始化密钥
+            byte[] raw = encodeRules.getBytes(StandardCharsets.UTF_8);
+            SecretKeySpec skeySpec = new SecretKeySpec(raw, "AES");
+
+            // 2. 初始化 Cipher(AES/ECB/PKCS5Padding)
+            Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
+            cipher.init(Cipher.ENCRYPT_MODE, skeySpec);
+
+            // 3. 执行加密
+            byte[] encrypted = cipher.doFinal(content.getBytes(StandardCharsets.UTF_8));
+
+            // 4. 使用 Java 标准库 Base64 编码(自动处理换行符)
+            return Base64.getEncoder().encodeToString(encrypted);
+        } catch (Exception e) {
+            e.printStackTrace(); // 实际项目中建议用日志记录
+            return null;
+        }
+    }
+
+    /**
+     * AES 解密(使用 Java 标准库 Base64)
+     * @param encodeRules 密钥(需与加密一致)
+     * @param content     Base64 编码的加密内容
+     * @return 解密后的原始字符串,失败返回 null
+     */
+    public static String aesDecode(String encodeRules, String content) {
+        try {
+            // 1. 初始化密钥
+            byte[] raw = encodeRules.getBytes(StandardCharsets.UTF_8);
+            SecretKeySpec skeySpec = new SecretKeySpec(raw, "AES");
+
+            // 2. 初始化 Cipher
+            Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
+            cipher.init(Cipher.DECRYPT_MODE, skeySpec);
+
+            // 3. Base64 解码
+            byte[] encrypted = Base64.getDecoder().decode(content);
+
+            // 4. 执行解密
+            byte[] original = cipher.doFinal(encrypted);
+            return new String(original, StandardCharsets.UTF_8);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return null;
+        }
+    }
+//    /**
+//     * 加密
+//     *
+//     * @param encodeRules
+//     * @param content
+//     * @return
+//     */
+//    public static String AESEncode(String encodeRules, String content) {
+//        try {
+//            byte[] raw = encodeRules.getBytes("utf-8");
+//            SecretKeySpec skeySpec = new SecretKeySpec(raw, "AES");
+//            // "算法/模式/补码方式"
+//            Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
+//            cipher.init(Cipher.ENCRYPT_MODE, skeySpec);
+//            byte[] encrypted = cipher.doFinal(content.getBytes("utf-8"));
+//            // 此处使用BASE64做转码功能,同时能起到2次加密的作用。
+//            String encode = new Base64().encode(encrypted);
+//            encode = encode.replaceAll(System.getProperty("line.separator"), "");
+//            return encode;
+//        } catch (Exception e) {
+//        }
+//        return null;
+//    }
+//
+//    /**
+//     * 解密
+//     *
+//     * @param encodeRules
+//     * @param content
+//     * @return
+//     */
+//    public static String AESDecode(String encodeRules, String content) {
+//        try {
+//            byte[] raw = encodeRules.getBytes("utf-8");
+//            SecretKeySpec skeySpec = new SecretKeySpec(raw, "AES");
+//            Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
+//            cipher.init(Cipher.DECRYPT_MODE, skeySpec);
+//            byte[] encrypted = new BASE64Decoder().decodeBuffer(content);
+//            byte[] original = cipher.doFinal(encrypted);
+//            String originalString = new String(original, "utf-8");
+//            originalString = originalString.replaceAll(System.getProperty("line.separator"), "");
+//            return originalString;
+//        } catch (Exception e) {
+//
+//        }
+//        return null;
+//    }
+}

+ 12 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/LoginVo.java

@@ -0,0 +1,12 @@
+package com.ruoyi.web.controller.chenyanlogin;
+
+import lombok.Data;
+
+@Data
+public class LoginVo {
+//    private String userName;
+    private String phone;
+    private String time;
+    private String mac;
+//    private String token;
+}

+ 50 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/RSAUtil.java

@@ -0,0 +1,50 @@
+package com.ruoyi.web.controller.chenyanlogin;
+
+import java.nio.charset.StandardCharsets;
+import java.security.*;
+import java.security.spec.PKCS8EncodedKeySpec;
+import java.security.spec.X509EncodedKeySpec;
+import java.util.Base64;
+
+public class RSAUtil {
+    /**
+     * 用私钥签名(SHA256WithRSA)
+     */
+    public static String sign(String data, String privateKeyStr) throws Exception {
+        byte[] keyBytes = Base64.getDecoder().decode(privateKeyStr);
+        PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(keyBytes);
+        KeyFactory keyFactory = KeyFactory.getInstance("RSA");
+        PrivateKey privateKey = keyFactory.generatePrivate(keySpec);
+
+        Signature signature = Signature.getInstance("SHA256WithRSA");
+        signature.initSign(privateKey);
+        signature.update(data.getBytes(StandardCharsets.UTF_8));
+        byte[] signBytes = signature.sign();
+        return Base64.getEncoder().encodeToString(signBytes);
+    }
+
+    /**
+     * 用公钥验签
+     */
+    public static boolean verify(String data, String signStr, String publicKeyStr) throws Exception {
+        byte[] keyBytes = Base64.getDecoder().decode(publicKeyStr);
+        X509EncodedKeySpec keySpec = new X509EncodedKeySpec(keyBytes);
+        KeyFactory keyFactory = KeyFactory.getInstance("RSA");
+        PublicKey publicKey = keyFactory.generatePublic(keySpec);
+
+        Signature signature = Signature.getInstance("SHA256WithRSA");
+        signature.initVerify(publicKey);
+        signature.update(data.getBytes(StandardCharsets.UTF_8));
+        byte[] signBytes = Base64.getDecoder().decode(signStr);
+        return signature.verify(signBytes);
+    }
+
+    /**
+     * 生成 RSA 密钥对(Base64 编码)
+     */
+    public static KeyPair generateKeyPair() throws Exception {
+        KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA");
+        keyPairGenerator.initialize(2048); // 推荐 2048 位
+        return keyPairGenerator.generateKeyPair();
+    }
+}

+ 24 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/Receiver.java

@@ -0,0 +1,24 @@
+//package com.ruoyi.web.controller.chenyanlogin;
+//
+//public class Receiver {
+//    public static void main(String[] args) throws Exception {
+//        // 模拟接收到的数据(实际从网络/文件读取)
+//        String encryptedData = "U2FsdGVkX1+3n6J7z9X2J4kLmNpPqRsT1W5v8y/B?D="; // 示例密文
+//        String sign = "abc123..."; // 示例签名(实际需真实值)
+//        String publicKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA..."; // 发送方的公钥
+//
+//        // 1. 验签(确保数据未被篡改且来自可信方)
+//        String originalData = "这是敏感数据,需要加密并签名!"; // 实际需从解密后获取,此处仅为演示
+//        boolean isVerified = RSAUtil.verify(originalData, sign, publicKey);
+//        System.out.println("验签结果: " + (isVerified ? "成功" : "失败"));
+//
+//        // 2. AES 解密(需使用与发送方相同的密钥)
+//        String aesKey = "1234567890123456"; // 必须与发送方一致
+//        String decryptedData = AESUtil.decrypt(encryptedData, aesKey);
+//        System.out.println("\n解密后数据: " + decryptedData);
+//
+//        // 3. 重新验签(实际应先解密再验签,此处调整顺序仅为演示)
+//        isVerified = RSAUtil.verify(decryptedData, sign, publicKey);
+//        System.out.println("重新验签(正确流程): " + (isVerified ? "成功" : "失败"));
+//    }
+//}

+ 32 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/Sender.java

@@ -0,0 +1,32 @@
+//package com.ruoyi.web.controller.chenyanlogin;
+//
+//import java.security.KeyPair;
+//import java.util.Base64;
+//
+//public class Sender {
+//    public static void main(String[] args) throws Exception {
+//        // 1. 生成 RSA 密钥对(实际场景中,私钥需严格保密)
+//        KeyPair keyPair = RSAUtil.generateKeyPair();
+//        String privateKey = Base64.getEncoder().encodeToString(keyPair.getPrivate().getEncoded());
+//        String publicKey = Base64.getEncoder().encodeToString(keyPair.getPublic().getEncoded());
+//
+//        // 2. 原始数据
+//        String originalData = "这是敏感数据,需要加密并签名!";
+//        System.out.println("原始数据: " + originalData);
+//
+//        // 3. AES 加密(密钥需双方共享,实际可用 RSA 交换)
+//        String aesKey = "1234567890123456"; // 16 字节 AES 密钥
+//        String encryptedData = AESUtil.encrypt(originalData, aesKey);
+//        System.out.println("AES 加密后: " + encryptedData);
+//
+//        // 4. RSA 签名(用私钥对原始数据签名)
+//        String sign = RSAUtil.sign(originalData, privateKey);
+//        System.out.println("RSA 签名: " + sign);
+//
+//        // 5. 发送内容:加密数据 + 签名 + 公钥(实际公钥可提前共享)
+//        System.out.println("\n发送内容:");
+//        System.out.println("加密数据: " + encryptedData);
+//        System.out.println("签名: " + sign);
+//        System.out.println("公钥: " + publicKey); // 实际场景中公钥可能已预置
+//    }
+//}

+ 91 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/controller/GetHuiCunController.java

@@ -0,0 +1,91 @@
+package com.ruoyi.web.controller.chenyanlogin.controller;
+
+import com.ruoyi.common.core.domain.AjaxResult;
+
+import com.ruoyi.web.controller.chenyanlogin.service.HuiCunService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@Api(tags ="慧村接口 同步")
+@RestController
+@RequestMapping("/huicun/")
+public class GetHuiCunController {
+    @Autowired
+    private HuiCunService huiCunService;
+
+    //基础数据查询接口
+    @ApiOperation("基础数据查询接口")
+    @GetMapping("/getBasicData")
+    public AjaxResult getBasicData(){
+        return huiCunService.getBasicData();
+
+    }
+
+    //关爱人群数据查询接口
+    @ApiOperation("关爱人群数据查询接口")
+    @GetMapping("/getCarePeopleData")
+    public  AjaxResult getCarePeopleData(){
+        return huiCunService.getCarePeopleData();
+    }
+
+    //事件上报数据查询接口
+    @ApiOperation("事件上报数据查询接口")
+    @GetMapping("/getSnapshotReportData")
+    public  AjaxResult getSnapshotReportData(){
+        return huiCunService.getSnapshotReportData();
+    }
+
+    //一键呼叫数据查询接口
+    @ApiOperation("一键呼叫数据查询接口")
+    @GetMapping("/getZhwlDeviceData")
+    public  AjaxResult getZhwlDeviceData(){
+        return huiCunService.getZhwlDeviceData();
+    }
+
+    //积分排行数据查询接口
+    @ApiOperation("积分排行数据查询接口")
+    @GetMapping("/getPointRankData")
+    public  AjaxResult getPointRankData(){
+        return huiCunService.getPointRankData();
+    }
+
+    //文明红榜数据查询接口
+    @ApiOperation("文明红榜数据查询接口")
+    @GetMapping("/getCivilizedData")
+    public  AjaxResult getCivilizedData(){
+        return huiCunService.getCivilizedData();
+    }
+
+    //先进事迹资讯数据查询接口
+    @ApiOperation("先进事迹资讯数据查询接口")
+    @GetMapping("/getVillageNewsData")
+    public  AjaxResult getVillageNewsData(){
+        return huiCunService.getVillageNewsData();
+    }
+
+    //同步人口数据查询接口
+    @ApiOperation("同步人口数据查询接口")
+    @GetMapping("/syncVillagerData")
+    public  AjaxResult syncVillagerData(){
+        return huiCunService.syncVillagerData(0);
+    }
+
+    //同步房屋数据查询接口
+    @ApiOperation("同步房屋数据查询接口")
+    @GetMapping("/syncHouseData")
+    public  AjaxResult syncHouseData(){
+        return huiCunService.syncHouseData(0);
+    }
+
+    //同步补贴数据查询接口
+    @ApiOperation("同步补贴数据查询接口")
+    @GetMapping("/syncAllowanceData")
+    public  AjaxResult syncAllowanceData(){
+        return huiCunService.syncAllowanceData(0);
+    }
+}

+ 20 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/controller/HouseDigitalNumberController.java

@@ -0,0 +1,20 @@
+package com.ruoyi.web.controller.chenyanlogin.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author author
+ * @since 2025-09-20
+ */
+@RestController
+@RequestMapping("/house-digital-number")
+public class HouseDigitalNumberController {
+
+}

+ 20 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/controller/HousePictureController.java

@@ -0,0 +1,20 @@
+package com.ruoyi.web.controller.chenyanlogin.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author author
+ * @since 2025-09-20
+ */
+@RestController
+@RequestMapping("/house-picture")
+public class HousePictureController {
+
+}

+ 20 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/controller/HouseTagController.java

@@ -0,0 +1,20 @@
+package com.ruoyi.web.controller.chenyanlogin.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author author
+ * @since 2025-09-20
+ */
+@RestController
+@RequestMapping("/house-tag")
+public class HouseTagController {
+
+}

+ 20 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/controller/HouseVillagerRelationController.java

@@ -0,0 +1,20 @@
+package com.ruoyi.web.controller.chenyanlogin.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author author
+ * @since 2025-09-20
+ */
+@RestController
+@RequestMapping("/house-villager-relation")
+public class HouseVillagerRelationController {
+
+}

+ 132 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/controller/NationUnityController.java

@@ -0,0 +1,132 @@
+package com.ruoyi.web.controller.chenyanlogin.controller;
+
+
+import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.web.controller.chenyanlogin.entity.NationUnity;
+import com.ruoyi.web.controller.chenyanlogin.service.INationUnityService;
+import com.ruoyi.web.domain.dto.mediaPropaganda.MediaPropagandaEditRequest;
+import com.ruoyi.web.domain.dto.mediaPropaganda.MediaPropagandaQueryRequest;
+import com.ruoyi.web.domain.vo.MediaPropagandaVO;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Map;
+
+import static com.ruoyi.common.core.domain.AjaxResult.error;
+import static com.ruoyi.common.core.domain.AjaxResult.success;
+
+/**
+ * <p>
+ * 民族团结内容收集表 前端控制器
+ * </p>
+ *
+ * @author author
+ * @since 2025-09-23
+ */
+@RestController
+@RequestMapping("/nation-unity")
+@Api(tags ="民族团结")
+public class NationUnityController {
+    @Autowired
+    private INationUnityService nationUnityService;
+
+    /**
+     * 添加民族团结内容
+     *
+     * @param mediaPropagandaAddRequest 添加请求
+     * @return 结果
+     */
+    @ApiOperation("添加民族团结内容")
+    @PostMapping("/add")
+    public AjaxResult addMediaPropaganda(@RequestBody NationUnity mediaPropagandaAddRequest) {
+        if (mediaPropagandaAddRequest == null) {
+            return error("请求参数为空");
+        }
+        nationUnityService.save(mediaPropagandaAddRequest);
+//        Integer id = nationUnityService.addMediaPropaganda(mediaPropagandaAddRequest);
+        return success();
+    }
+
+
+
+    /**
+     * 删除民族团结内容
+     *
+     * @param paramsMap 参数,包含ids
+     * @return 结果
+     */
+    @ApiOperation("删除民族团结内容")
+    @PostMapping("/delete")
+    public AjaxResult deleteMediaPropaganda(@RequestBody Map<String, String> paramsMap) {
+        String ids = paramsMap.get("ids");
+        if (StrUtil.isBlank(ids)) {
+            return error("请求参数为空");
+        }
+        boolean result = nationUnityService.deleteMediaPropaganda(ids);
+        if (result) {
+            return success("删除成功");
+        }
+        return error("删除失败");
+    }
+
+    /**
+     * 编辑民族团结内容
+     *
+     * @param mediaPropagandaEditRequest 编辑请求
+     * @return 结果
+     */
+    @ApiOperation("编辑民族团结内容")
+    @PostMapping("/edit")
+    public AjaxResult editMediaPropaganda(@RequestBody NationUnity mediaPropagandaEditRequest) {
+        if (mediaPropagandaEditRequest == null) {
+            return error("请求参数为空");
+        }
+        nationUnityService.updateById(mediaPropagandaEditRequest);
+        return success();
+    }
+
+    /**
+     * 根据ID获取民族团结内容详情
+     *
+     * @param id 记录ID
+     * @return 民族团结内容详情
+     */
+    @ApiOperation("根据ID获取民族团结内容详情")
+    @GetMapping("/get")
+    public AjaxResult getMediaPropagandaById(@RequestParam int id) {
+        if (ObjectUtil.isEmpty(id)) {
+            return error("请求参数为空");
+        }
+
+        return success( nationUnityService.getById(id));
+    }
+
+    /**
+     * 分页获取民族团结内容列表
+     *
+     * @param mediaPropagandaQueryRequest 查询请求
+     * @return 分页结果
+     */
+    @ApiOperation("分页获取民族团结内容列表")
+    @PostMapping("/list/page")
+    public AjaxResult listMediaPropagandaByPage(@RequestBody MediaPropagandaQueryRequest mediaPropagandaQueryRequest) {
+        if (mediaPropagandaQueryRequest == null) {
+            return error("请求参数为空");
+        }
+        Page<MediaPropagandaVO> pageResult = nationUnityService.getListMediaPropagandaByPage(mediaPropagandaQueryRequest);
+        return success(pageResult);
+    }
+    @ApiOperation("获取民族团结内容列表")
+    @PostMapping("/list/list")
+    public AjaxResult listMediaPropagandaByPage() {
+
+        return success(nationUnityService.list(new QueryWrapper<NationUnity>().orderByDesc("id")));
+    }
+
+}

+ 20 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/controller/SubsidyProjectsJianController.java

@@ -0,0 +1,20 @@
+package com.ruoyi.web.controller.chenyanlogin.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author author
+ * @since 2025-09-20
+ */
+@RestController
+@RequestMapping("/subsidy-projects-jian")
+public class SubsidyProjectsJianController {
+
+}

+ 20 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/controller/TagsController.java

@@ -0,0 +1,20 @@
+package com.ruoyi.web.controller.chenyanlogin.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author author
+ * @since 2025-09-20
+ */
+@RestController
+@RequestMapping("/tags")
+public class TagsController {
+
+}

+ 20 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/controller/TagsPersonController.java

@@ -0,0 +1,20 @@
+package com.ruoyi.web.controller.chenyanlogin.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author author
+ * @since 2025-09-20
+ */
+@RestController
+@RequestMapping("/tags-person")
+public class TagsPersonController {
+
+}

+ 28 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/dto/BasicDataDto.java

@@ -0,0 +1,28 @@
+package com.ruoyi.web.controller.chenyanlogin.dto;
+
+import lombok.Data;
+
+/**
+ * @Project : huimv.shiwan
+ * @Package : com.ruoyi.web.controller.chenyanlogin.dto
+ * @Description : TODO
+ * @Author : yuxuexuan
+ * @Create : 2025-09-19 9:04
+ **/
+@Data
+public class BasicDataDto {
+
+    //耕地面积
+    private String landArea;
+    //山林面积
+    private String forestArea;
+    //房屋数
+    private int houseCount;
+    //人口数
+    private int villagerCount;
+    //干部数
+    private int managerCount;
+
+
+
+}

+ 27 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/dto/CarePeopleData.java

@@ -0,0 +1,27 @@
+package com.ruoyi.web.controller.chenyanlogin.dto;
+
+import lombok.Data;
+
+/**
+ * @Project : huimv.shiwan
+ * @Package : com.ruoyi.web.controller.chenyanlogin.dto
+ * @Description : TODO
+ * @Author : yuxuexuan
+ * @Create : 2025-09-19 9:08
+ **/
+@Data
+public class CarePeopleData {
+    //孤寡老人数量
+    private int  childlessCount;
+    //特困户数量
+    private int  destituteFamilyCount;
+    //残疾人数量
+    private int  disabledPeopleCount;
+    //空巢老人数量
+    private int  emptyNesterCount;
+    //留守儿童数量
+    private int  leftBehindCount;
+    //低保户数量
+    private int  poorFamilyCount;
+
+}

+ 23 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/dto/CivilizedDataDto.java

@@ -0,0 +1,23 @@
+package com.ruoyi.web.controller.chenyanlogin.dto;
+
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class CivilizedDataDto {
+
+    //产业发展能手
+    private List<String> cyfznsList;
+    //民族团结模范
+    private List<String> mztjmfList;
+
+    //人居环境标兵
+    private List<String> rjhjbbList;
+
+    //文明新风表率
+    private List<String> wmxfbsList;
+
+
+
+}

+ 50 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/dto/House.java

@@ -0,0 +1,50 @@
+package com.ruoyi.web.controller.chenyanlogin.dto;
+
+import lombok.Data;
+
+@Data
+public class House {
+    /** 主键ID */
+    private Long id;
+    /** 创建时间(datetime格式,必传) */
+    private Long createTime;
+    /** 门牌号(必传) */
+    private String houseNumber;
+    /** 所属区域ID(必传) */
+    private Long areaId;
+    /** 房主ID(非必传) */
+    private Long houseOwnerId;
+    /** 经度(非必传) */
+    private String longitude;
+    /** 纬度(非必传) */
+    private String latitude;
+    /** 地址(非必传) */
+    private String address;
+    /** 宅基地面积(非必传) */
+    private String homesteadArea;
+    /** 房屋性质(非必传,0-9枚举值) */
+    private Integer houseProperty;
+    /** 房屋所属网格ID(非必传) */
+    private Long gridId;
+    /** 更新时间(datetime格式,必传) */
+    private Long updateTime;
+    /** 创建人ID(必传) */
+    private Long creatorId;
+    /** 更新人ID(必传) */
+    private Long updaterId;
+    /** 房屋编号(必传) */
+    private String houseCode;
+    /** 获取总积分(必传) */
+    private String pointTotal;
+    /** 现有积分(必传) */
+    private String pointNow;
+    /** 已使用积分(必传) */
+    private String pointUsed;
+    /** 扣减积分数(必传) */
+    private String pointDeduct;
+    /** 创建者用户类型(1:平台端管理员;2:移动端村民;3:移动端办公人员,必传) */
+    private Integer creatorUserType;
+    /** 修改者用户类型(同上,必传) */
+    private Integer updaterUserType;
+
+}

+ 22 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/dto/HouseData.java

@@ -0,0 +1,22 @@
+package com.ruoyi.web.controller.chenyanlogin.dto;
+
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class HouseData {
+    //房屋
+    private List<House> houseList;
+    //房屋门牌图片数据
+    private List<HouseDigitalNumberPlate> houseDigitalNumberPlateList;
+    //房屋图片数据
+    private List<HousePictures> housePictureList;
+    //房屋标签关联数据
+    private List<HouseVillagerRelation> houseVillagerRelationList;
+    //房屋标签关联数据
+    private List<HouseTags> houseTagList;
+    //标签
+    private List<TagsList> tagsList;
+
+}

+ 19 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/dto/HouseDigitalNumberPlate.java

@@ -0,0 +1,19 @@
+package com.ruoyi.web.controller.chenyanlogin.dto;
+
+import lombok.Data;
+
+@Data
+public class HouseDigitalNumberPlate {
+    /** 主键ID */
+    private Long id;
+    /** 关联房屋ID(必传) */
+    private Long houseId;
+    /** 数字门牌链接地址(必传) */
+    private String numberPlateUrl;
+    /** 类型(0:原始二维码;1:样式1;以此类推,必传) */
+    private Integer type;
+    /** 创建时间(datetime格式,必传) */
+    private Long createTime;
+    /** 创建人ID(必传) */
+    private Long creatorId;
+}

+ 21 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/dto/HousePictures.java

@@ -0,0 +1,21 @@
+package com.ruoyi.web.controller.chenyanlogin.dto;
+
+
+import lombok.Data;
+
+/**
+ * 房屋图片实体
+ */
+@Data
+public class HousePictures {
+    /** 主键ID */
+    private Long id;
+    /** 关联房屋ID(必传) */
+    private Long houseId;
+    /** 图片URL(必传) */
+    private String picture;
+    /** 创建时间(datetime格式,必传) */
+    private Long createTime;
+    /** 创建人ID(必传) */
+    private Long creatorId;
+}

+ 18 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/dto/HouseTags.java

@@ -0,0 +1,18 @@
+package com.ruoyi.web.controller.chenyanlogin.dto;
+
+import lombok.Data;
+
+
+@Data
+public class HouseTags {
+    /** 主键ID */
+    private Long id;
+    /** 房屋ID(必传) */
+    private Long houseId;
+    /** 标签ID(必传) */
+    private Long tagId;
+    /** 创建时间(datetime格式,必传) */
+    private Long createTime;
+    /** 创建人ID(必传) */
+    private Long creatorId;
+}

+ 19 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/dto/HouseVillagerRelation.java

@@ -0,0 +1,19 @@
+package com.ruoyi.web.controller.chenyanlogin.dto;
+
+import lombok.Data;
+
+@Data
+public class HouseVillagerRelation {
+    /** 主键ID */
+    private Long id;
+    /** 房屋ID(必传) */
+    private Long houseId;
+    /** 人口ID(必传) */
+    private Long villagerId;
+    /** 房屋人口类型(0:普通住户 1:房主,必传) */
+    private Integer villagerType;
+    /** 创建时间(datetime格式,必传) */
+    private Long createTime;
+    /** 创建人ID(必传) */
+    private Long creatorId;
+}

+ 15 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/dto/PointRankDataDto.java

@@ -0,0 +1,15 @@
+package com.ruoyi.web.controller.chenyanlogin.dto;
+
+import lombok.Data;
+
+@Data
+public class PointRankDataDto {
+    //用户名
+    private String memberName;
+    //现有积分
+    private String pointNow;
+    //总积分
+    private String pointTotal;
+    //村庄名称
+    private String villageName;
+}

+ 8 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/dto/ResponDto.java

@@ -0,0 +1,8 @@
+package com.ruoyi.web.controller.chenyanlogin.dto;
+
+import lombok.Data;
+
+@Data
+public class ResponDto {
+    private String request;
+}

+ 23 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/dto/SnapshotReporListtDto.java

@@ -0,0 +1,23 @@
+package com.ruoyi.web.controller.chenyanlogin.dto;
+
+import lombok.Data;
+
+/**
+ * @Project : huimv.shiwan
+ * @Package : com.ruoyi.web.controller.chenyanlogin.dto
+ * @Description : TODO
+ * @Author : yuxuexuan
+ * @Create : 2025-09-19 9:16
+ **/
+@Data
+public class SnapshotReporListtDto {
+    //内容
+    private String content;
+    //状态
+    private int complestatustedCount;
+    private int status;
+    //状态名
+    private String statusName;
+    //类型名称
+    private String typeName;
+}

+ 22 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/dto/SnapshotReportDto.java

@@ -0,0 +1,22 @@
+package com.ruoyi.web.controller.chenyanlogin.dto;
+
+import lombok.Data;
+
+import java.util.List;
+
+
+@Data
+public class SnapshotReportDto {
+
+    //已办结数量
+    private int completedCount;
+    //办结率:
+    private String completedProb;
+    //已接纳数量
+    private int inProcessCount;
+    //待接纳数量
+    private int toBeAcceptedCount;
+    //事件列表
+    private List<SnapshotReporListtDto> list;
+
+}

+ 17 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/dto/SyncVillagerDataDto.java

@@ -0,0 +1,17 @@
+package com.ruoyi.web.controller.chenyanlogin.dto;
+
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class SyncVillagerDataDto {
+    //人口数据
+    private List<VillagerList> villagerList;
+    //人口自定义字段数据
+    private List<VillagerUserDefinedFieldList> villagerUserDefinedFieldList;
+    //人口表关联数据
+    private List<VillagerTagList> villagerTagList;
+    //标签数据
+    private List<TagsList> tagsList;
+}

+ 19 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/dto/TagsList.java

@@ -0,0 +1,19 @@
+package com.ruoyi.web.controller.chenyanlogin.dto;
+
+import lombok.Data;
+
+@Data
+public class TagsList {
+    private Long id;                     // 主键
+    private Long areaId;                 // 区域ID
+    private String color;                // 颜色
+    private Long createDate;           // 创建时间
+    private Long creatorId;              // 创建用户ID
+    private Boolean delFlag;             // 删除标志
+    private Long modifierId;             // 修改用户ID
+    private Long modifyDate;    // 修改时间
+    private String tagName;              // 标签名称
+    private Integer tagType;             // 标签类型:0-家庭标签 1-人口标签
+    private Integer useNum;              // 使用数
+
+}

+ 11 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/dto/UserDefinedFiled.java

@@ -0,0 +1,11 @@
+package com.ruoyi.web.controller.chenyanlogin.dto;
+
+import io.swagger.models.auth.In;
+import lombok.Data;
+
+
+@Data
+public class UserDefinedFiled {
+    private Integer id;
+    private String fieldValue;
+}

+ 28 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/dto/VillageNewsDataDto.java

@@ -0,0 +1,28 @@
+package com.ruoyi.web.controller.chenyanlogin.dto;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import lombok.Data;
+
+@Data
+public class VillageNewsDataDto {
+
+    //区域名
+    private String areaName;
+    //内容
+    private String content;
+    //封面图URL
+    private String cover;
+    //创建时间
+    private String createTime;
+    //标签名
+    private String dictEntryName;
+    //发布时间
+    private String publishTime;
+    //类型
+    private String title;
+    //type
+    private String type;
+    //视频URL
+    private String video;
+
+}

+ 43 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/dto/VillagerList.java

@@ -0,0 +1,43 @@
+package com.ruoyi.web.controller.chenyanlogin.dto;
+
+import lombok.Data;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @Project : huimv.shiwan
+ * @Package : com.ruoyi.web.controller.chenyanlogin.dto
+ * @Description : TODO
+ * @Author : yuxuexuan
+ * @Create : 2025-09-19 9:43
+ **/
+@Data
+public class VillagerList {
+    private int id;
+    private Long areaId;                     // 行政村ID
+    private String address;                  // 现居地
+    private String birthday;                 // 出生日期
+    private Long createTime;       // 创建时间
+    private Long creatorId;                 // 创建人ID
+    private Integer creatorUserType;         // 创建者类型(1:管理员,2:村民,3:办公人员)
+    private Boolean deleted;                 // 删除标志
+    private String idCard;                   // 身份证号
+    private Boolean gender;                  // 性别(0女,1男)
+    private String name;                     // 姓名
+    private String phone;                    // 手机号
+    private String photo;                    // 照片
+    private Integer type;                    // 人口类别(0本村户籍,1非本村户籍)
+    private Long updateTime;       // 修改时间
+    private Long updaterId;                 // 修改人ID
+    private Integer updaterUserType;         // 修改者类型
+    private Integer nation;         // 民族(0汉族、1壮族、2苗族、3回族、4满族)
+    private Integer profession;         // 职业(0务农,1务工
+    private Integer maritalStatus;         // 婚姻状况(0未婚,1已婚,2丧偶,3离婚
+    private Integer politicsStatus;         // 政治面貌(0群众,1共青团员,2中共党员,3预备党员,4其它
+    private Integer religion;         // 宗教信仰(0无,1佛教,2基督教,3伊斯兰教,4其他)
+    private List<UserDefinedFiled> userDefinedFiled; // 自定义字段
+
+    // 教育文化程度映射
+    private Integer educationLevel;          // 文化程度(0文盲半文盲,1小学,2初中,3高中,4中等职业教育,5专科教育,6大学本科,7硕士,8博士,9其他)
+}

+ 10 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/dto/VillagerTagList.java

@@ -0,0 +1,10 @@
+package com.ruoyi.web.controller.chenyanlogin.dto;
+
+import lombok.Data;
+
+@Data
+public class VillagerTagList {
+    private Long id;             // 主键ID
+    private Long tagId;         // 标签ID
+    private Long villagerId;    // 人口ID
+}

+ 16 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/dto/VillagerUserDefinedFieldList.java

@@ -0,0 +1,16 @@
+package com.ruoyi.web.controller.chenyanlogin.dto;
+
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+public class VillagerUserDefinedFieldList {
+    private Long id;                 // 主键ID
+    private Long areaId;            // 行政村ID
+    private Long createTime; // 创建时间
+    private Long creatorId;         // 创建人ID
+    private String fieldName;       // 自定义字段名
+    private Long updateTime; // 修改时间
+    private Long updaterId;         // 修改人ID
+}

+ 10 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/dto/ZhwlDeviceDataDto.java

@@ -0,0 +1,10 @@
+package com.ruoyi.web.controller.chenyanlogin.dto;
+
+import lombok.Data;
+
+@Data
+public class ZhwlDeviceDataDto {
+    private int deviceCount;
+    private int offlineCount;
+    private int onlineCount;
+}

+ 42 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/entity/HouseDigitalNumber.java

@@ -0,0 +1,42 @@
+package com.ruoyi.web.controller.chenyanlogin.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import java.time.LocalDate;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author author
+ * @since 2025-09-20
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("house_digital_number")
+public class HouseDigitalNumber implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id")
+    private Long id;
+
+    private Long houseId;
+
+    private String numberPlateUrl;
+
+    private Integer type;
+
+    private LocalDate createTime;
+
+    private Long creatorId;
+
+
+}

+ 40 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/entity/HousePicture.java

@@ -0,0 +1,40 @@
+package com.ruoyi.web.controller.chenyanlogin.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import java.time.LocalDate;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author author
+ * @since 2025-09-20
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("house_picture")
+public class HousePicture implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id")
+    private Long id;
+
+    private Long houseId;
+
+    private String picture;
+
+    private LocalDate createtTime;
+
+    private Long creatorId;
+
+
+}

+ 40 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/entity/HouseTag.java

@@ -0,0 +1,40 @@
+package com.ruoyi.web.controller.chenyanlogin.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import java.time.LocalDate;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author author
+ * @since 2025-09-20
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("house_tag")
+public class HouseTag implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id")
+    private Long id;
+
+    private Long houseId;
+
+    private Long tagId;
+
+    private LocalDate createTime;
+
+    private Long creatorId;
+
+
+}

+ 45 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/entity/HouseVillagerRelation.java

@@ -0,0 +1,45 @@
+package com.ruoyi.web.controller.chenyanlogin.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import java.time.LocalDate;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author author
+ * @since 2025-09-20
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("house_villager_relation")
+public class HouseVillagerRelation implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    private Long houseId;
+
+    private Long villagerId;
+
+    /**
+     * 房屋人口类型(0:普通住户 1:房主,必传)
+     */
+    private Integer villagerType;
+
+    private LocalDate createTime;
+
+    private Long creatorId;
+
+
+}

+ 88 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/entity/NationUnity.java

@@ -0,0 +1,88 @@
+package com.ruoyi.web.controller.chenyanlogin.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import java.time.LocalDate;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.time.LocalDateTime;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 媒体宣传内容收集表
+ * </p>
+ *
+ * @author author
+ * @since 2025-09-23
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("nation_unity")
+public class NationUnity implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * ID
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 标题
+     */
+    private String title;
+
+    /**
+     * 类型 0-图文,1-视频
+     */
+    private String type;
+
+    /**
+     * 内容
+     */
+    private String content;
+
+    /**
+     * 封面图URL
+     */
+    private String image;
+
+    /**
+     * 摘录日期(默认当天)
+     */
+    private LocalDate extractDate;
+
+    /**
+     * 发布日期
+     */
+    private LocalDate publishDate;
+
+    /**
+     * 来源
+     */
+    private String source;
+
+    /**
+     * 创建时间
+     */
+    private LocalDateTime createTime;
+
+    /**
+     * 修改时间
+     */
+    private LocalDateTime updateTime;
+
+    /**
+     * 删除标志
+     */
+    private String delFlag;
+
+    private Integer actType;
+
+
+}

+ 47 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/entity/SubsidyProjectsJian.java

@@ -0,0 +1,47 @@
+package com.ruoyi.web.controller.chenyanlogin.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import java.time.LocalDate;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.sql.Blob;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author author
+ * @since 2025-09-20
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("subsidy_projects_jian")
+public class SubsidyProjectsJian implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id")
+    private Long id;
+
+    private String projectName;
+
+    private Integer allowanceType;
+
+    private Long areaId;
+
+    private LocalDate defTime;
+
+    private Long defUser;
+
+    private LocalDate updateTime;
+
+    private Long updateUser;
+
+
+}

+ 83 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/entity/Tags.java

@@ -0,0 +1,83 @@
+package com.ruoyi.web.controller.chenyanlogin.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author author
+ * @since 2025-09-20
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("tags")
+public class Tags implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id")
+    private Long id;
+
+    /**
+     * 区域ID
+     */
+    private Long areaId;
+
+    /**
+     * 颜色
+     */
+    private String color;
+
+    /**
+     * 创建时间
+     */
+    private LocalDateTime createDate;
+
+    /**
+     * 创建用户ID
+     */
+    private Long creatorId;
+
+    /**
+     * 删除标志
+     */
+    private Boolean delFlag;
+
+    /**
+     * 修改用户ID
+     */
+    private Long modifierId;
+
+    /**
+     * 修改时间
+     */
+    private LocalDate modifyDate;
+
+    /**
+     * 标签名称
+     */
+    private String tagName;
+
+    /**
+     * 标签类型:0-家庭标签 1-人口标签
+     */
+    private Integer tagType;
+
+    /**
+     * 使用数
+     */
+    private Integer useNum;
+
+
+}

+ 35 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/entity/TagsPerson.java

@@ -0,0 +1,35 @@
+package com.ruoyi.web.controller.chenyanlogin.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author author
+ * @since 2025-09-20
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("tags_person")
+public class TagsPerson implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id")
+    private Long id;
+
+    private Long tagId;
+
+    private Long villagerId;
+
+
+}

+ 274 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/haikang/ArtemisPostTest.java

@@ -0,0 +1,274 @@
+//package com.ruoyi.web.controller.chenyanlogin.haikang;   //修改包路径
+//
+//import java.io.IOException;
+//import java.io.InputStream;
+//import java.util.HashMap;
+//import java.util.Map;
+//
+//import cn.hutool.core.date.DateUtil;
+//import com.alibaba.fastjson.JSON;
+//import com.alibaba.fastjson.JSONObject;
+//import com.hikvision.artemis.sdk.ArtemisHttpUtil;
+//import com.hikvision.artemis.sdk.Response;
+//import com.hikvision.artemis.sdk.config.ArtemisConfig;
+//import com.hikvision.artemis.sdk.constant.Constants;
+//import com.hikvision.artemis.sdk.constant.SystemHeader;
+//
+//
+//import static com.hikvision.artemis.sdk.util.HttpUtil.wrapClient;
+//
+//public class ArtemisPostTest {
+//	/**
+//	 * 请根据技术支持提供的实际的平台IP/端口和API网关中的合作方信息更换static静态块中的三个参数.
+//	 * [1 host]
+//	 * 		host格式为IP:Port,如10.0.0.1:443
+//	 * 		当使用https协议调用接口时,IP是平台(nginx)IP,Port是https协议的端口;
+//	 *     当使用http协议调用接口时,IP是artemis服务的IP,Port是artemis服务的端口(默认9016)。
+//	 * [2 appKey和appSecret]
+//	 * 		请按照技术支持提供的合作方Key和合作方Secret修改
+//	 * 	    appKey:合作方Key
+//	 * 	    appSecret:合作方Secret
+//	 * 调用前看清接口传入的是什么,是传入json就用doPostStringArtemis方法,是表单提交就用doPostFromArtemis方法
+//	 *
+//	 */
+//	/**
+//	 * API网关的后端服务上下文为:/artemis
+//	 */
+//	private static final String ARTEMIS_PATH = "/artemis";
+//	/**
+//	 * 根据需求调整超时时间
+//	 */
+//	static {
+//		//连接超时时间
+//		Constants.DEFAULT_TIMEOUT = 10000;
+//		//读取超时时间
+//		Constants.SOCKET_TIMEOUT = 60000;
+//	}
+//
+////	public static void callGetImg() throws Exception {
+////		ArtemisConfig config = new ArtemisConfig();
+////		config.setHost("127.0.0.1"); // 代理API网关nginx服务器ip端口
+////		config.setAppKey("20469790");  // 秘钥appkey
+////		config.setAppSecret("lofnD6DbnBllHmk5YOyx");// 秘钥appSecret
+////		final String getCamsApi = "/artemis/api/v1/vqd/download/vqdPic/test.jpg";
+////		Map<String, String> path = new HashMap<String, String>() {
+////			{
+////				put("https://", getCamsApi);
+////			}
+////		};
+////
+////		try(Response response = ArtemisHttpUtil.doGetResponse(config, path, null, null, null, null)) {
+////			// 1. 检查响应状态
+////			if (response.getStatusCode() != 200) {
+////				throw new IOException("下载失败: " + response.getErrorMessage());
+////			}
+////			Tools.savePicToDisk(response.getResponse().getEntity().getContent(), "E:\\", "test.jpg");
+////		}
+////	}
+//
+//	/**
+//	 * 调用POST请求类型接口,这里以获取组织列表为例
+//	 * 接口实际url:https://ip:port/artemis/api/resource/v1/org/orgList
+//	 * @return
+//	 */
+//	public static String callPostApiGetOrgList() throws Exception {
+//		/**
+//		 * https://ip:port/artemis/api/resource/v1/org/orgList
+//		 * 通过查阅AI Cloud开放平台文档或网关门户的文档可以看到获取组织列表的接口定义,该接口为POST请求的Rest接口, 入参为JSON字符串,接口协议为https。
+//		 * ArtemisHttpUtil工具类提供了doPostStringArtemis调用POST请求的方法,入参可传JSON字符串, 请阅读开发指南了解方法入参,没有的参数可传null
+//		 */
+//		ArtemisConfig config = new ArtemisConfig();
+//		config.setHost("218.203.180.136:10043"); // 平台nginx所在ip及https对应端口号
+//		config.setAppKey("29243872");  // 秘钥appkey
+//		config.setAppSecret("RyS0Aihgt7jP4EaK0bJ5");// 秘钥appSecret
+//		final String getCamsApi = ARTEMIS_PATH + "RyS0Aihgt7jP4EaK0bJ5";
+//		Map<String, String> paramMap = new HashMap<String, String>();// post请求Form表单参数
+//		paramMap.put("pageNo", "1");
+//		paramMap.put("pageSize", "100");
+//		paramMap.put("isCascade", "0");
+//		String body = JSON.toJSON(paramMap).toString();
+//		Map<String, String> path = new HashMap<String, String>(2) {
+//			{
+//				put("https://", getCamsApi);
+//			}
+//		};
+//		return ArtemisHttpUtil.doPostStringArtemis(config,path, body, null, null, "application/json");
+//	}
+//
+//
+//	/**
+//	 * 调用POST请求类型接口,这里以分页获取区域列表为例
+//	 * 接口实际url:https://ip:port/artemis/api/api/resource/v1/regions
+//	 * @return
+//	 */
+//	public static String callPostApiGetRegions() throws Exception {
+//		/**
+//		 * https://ip:port/artemis/api/resource/v1/regions
+//		 * 过查阅AI Cloud开放平台文档或网关门户的文档可以看到分页获取区域列表的定义,这是一个POST请求的Rest接口, 入参为JSON字符串,接口协议为https。
+//		 * ArtemisHttpUtil工具类提供了doPostStringArtemis调用POST请求的方法,入参可传JSON字符串, 请阅读开发指南了解方法入参,没有的参数可传null
+//		 */
+//		ArtemisConfig config = new ArtemisConfig();
+//		config.setHost("127.0.0.1"); // 代理API网关nginx服务器ip端口
+//		config.setAppKey("20469790");  // 秘钥appkey
+//		config.setAppSecret("lofnD6DbnBllHmk5YOyx");// 秘钥appSecret
+//		final String getCamsApi = ARTEMIS_PATH + "/api/resource/v1/regions";
+//		Map<String, String> paramMap = new HashMap<String, String>();// post请求Form表单参数
+//		paramMap.put("pageNo", "1");
+//		paramMap.put("pageSize", "2");
+//		paramMap.put("treeCode", "0");
+//		String body = JSON.toJSON(paramMap).toString();
+//		Map<String, String> path = new HashMap<String, String>(2) {
+//			{
+//				put("https://", getCamsApi);
+//			}
+//		};
+//		return ArtemisHttpUtil.doPostStringArtemis(config,path, body, null, null, "application/json");
+//	}
+//
+//	/**
+//	 * 调用POST接口,返回图片
+//	 * 接口实际url:https://ip:port/artemis/api/visitor/v1/record/pictures
+//	 * @return
+//	 */
+////	public static String callPostImgs() throws Exception {
+////		ArtemisConfig config = new ArtemisConfig();
+////		config.setHost("127.0.0.1"); // 代理API网关nginx服务器ip端口
+////		config.setAppKey("20469790");  // 秘钥appkey
+////		config.setAppSecret("lofnD6DbnBllHmk5YOyx");// 秘钥appSecret
+////		final String getSecurityApi = "/artemis" + "/api/visitor/v1/record/pictures"; // 接口路径
+////		Map<String, String> path = new HashMap<String, String>(2) {
+////			{
+////				put("https://", getSecurityApi);
+////			}
+////		};
+////		Map<String, String> head = new HashMap<String, String>(2) {  //get请求的head参数
+////			{
+////				put("headpost", "sky-test");
+////			}
+////		};
+////		Map<String, String> query = new HashMap<String, String>(2) {  //get请求的head参数
+////			{
+////				put("domainId", "0");
+////			}
+////		};
+////		JSONObject jsonBody = new JSONObject();
+////		jsonBody.put("svrIndexCode", "9ff58bc2-65a5-464b-b28c-daea67ba9569");
+////		jsonBody.put("picUri", "/pic?9dda12i40-e*5b84626c4105m5ep=t=i3p*i=d1s*i=d3b*i1d3b*855925cea-96008b--2718943z855s=5i76=");
+////		String body = jsonBody.toJSONString();
+////		//参数根据接口实际情况设置
+////		//参数根据接口实际情况设置
+////		//【注】:该方法从artemis-http-client v1.1.12版本后,返回值修改为Response,此前为HttpResponse;升级时注意兼容性问题
+////		Response result = ArtemisHttpUtil.doPostStringImgArtemis(config, path, body, null, null, "application/json", null);
+////
+////		try {
+////
+////			if (302==result.getStatusCode()) {
+////                /*
+////                获取图片数据保存到本地
+////                注:1.对于有时效的图片,必须尽快保存到本地
+////                   2.若无时效,则可以直接保存location,后续自行访问获取
+////                 */
+////				String location=  result.getHeader("Location");
+////				HttpGet httpget = new HttpGet(location);
+////				HttpClient httpClient = wrapClient(httpget.getURI().getScheme()+"://"+httpget.getURI().getHost());
+////				HttpResponse execute = httpClient.execute(httpget);
+////				HttpEntity entity = execute.getEntity();
+////				InputStream in = entity.getContent();
+////				Tools.savePicToDisk(in, "d:/", "test311.jpg");
+////				//TODO 可以返回保存后的路径
+////			}else{
+////				System.out.println("下载出错:"+result.getBody());
+////			}
+////
+////		} catch (Exception e) {
+////			e.printStackTrace();
+////		}
+////
+////		return getSecurityApi;
+////	}
+//
+//	/**
+//	 * 调用POST接口,下载文件
+//	 * 接口实际url:https://ip:port/artemis/api/fedof/v1/org/downloadCameraCSV
+//	 * @return
+//	 */
+////	public static void callPostDownloadFile() throws Exception {
+////		ArtemisConfig config = new ArtemisConfig();
+////		config.setHost("127.0.0.1"); // 代理API网关nginx服务器ip端口
+////		config.setAppKey("20469790");  // 秘钥appkey
+////		config.setAppSecret("lofnD6DbnBllHmk5YOyx");// 秘钥appSecret
+////		final String getSecurityApi = "/artemis" + "/api/fedof/v1/org/downloadCameraCSV"; // 接口路径
+////		Map<String, String> path = new HashMap<String, String>(2) {
+////			{
+////				put("https://", getSecurityApi);
+////			}
+////		};
+////		Map<String, String> head = new HashMap<String, String>(2) {  //get请求的head参数
+////			{
+////				put("headpost", "sky-test");
+////			}
+////		};
+////		Map<String, String> query = new HashMap<String, String>(2) {  //get请求的head参数
+////			{
+////				put("domainId", "0");
+////			}
+////		};
+////		JSONObject jsonBody = new JSONObject();
+////		jsonBody.put("svrIndexCode", "9ff58bc2-65a5-464b-b28c-daea67ba9569");
+////		jsonBody.put("picUri", "/pic?9dda12i40-e*5b84626c4105m5ep=t=i3p*i=d1s*i=d3b*i1d3b*855925cea-96008b--2718943z855s=5i76=");
+////		String body = jsonBody.toJSONString();
+////		//参数根据接口实际情况设置
+////		//【注】:该方法从artemis-http-client v1.1.12版本后,返回值修改为Response,此前为HttpResponse;升级时注意兼容性问题
+////		try(Response response = ArtemisHttpUtil.doPostDownloadFileArtemis(config, path, body, null, null, null, null);) {
+////			// 1. 检查响应状态
+////			if (response.getStatusCode() != 200) {
+////				throw new IOException("下载失败: " + response.getErrorMessage());
+////			}
+////			String filePath = "D:\\download\\";
+////			Tools.savePicToDisk(response.getResponse().getEntity().getContent(), filePath, "test.zip");
+////		}
+////	}
+//
+//	/**
+//	 * 调用POST请求类型接口,这里演示了外层代理服务对artemis对外接口封装的场景。例如:
+//	 * artemis上开放的接口实际url:https://ip:port/artemis/api/api/resource/v1/regions
+//	 * 外部代理服务上上开放的接口url:https://ip:port/proxy/api/api/resource/v1/regions
+//	 * 需保证安全认证库签名使用的path参数与artemis一致,可在请求头中设置x-ca-path参数,内容为:/artemis/api/api/resource/v1/regions
+//	 * @return
+//	 */
+//	public static String callPostApiGetRegionsByProxy() throws Exception {
+//		/**
+//		 * https://ip:port/proxy/api/api/resource/v1/regions
+//		 */
+//		ArtemisConfig config = new ArtemisConfig();
+//		config.setHost("127.0.0.1"); // 代理API网关nginx服务器ip端口
+//		config.setAppKey("20469790");  // 秘钥appkey
+//		config.setAppSecret("lofnD6DbnBllHmk5YOyx");// 秘钥appSecret
+//		final String getCamsApi = "/proxy/api/resource/v1/regions";
+//		Map<String, String> paramMap = new HashMap<String, String>();// post请求Form表单参数
+//		paramMap.put("pageNo", "1");
+//		paramMap.put("pageSize", "2");
+//		paramMap.put("treeCode", "0");
+//		String body = JSON.toJSON(paramMap).toString();
+//		Map<String, String> path = new HashMap<String, String>(2) {
+//			{
+//				put("https://", getCamsApi);
+//			}
+//		};
+//		Map<String, String> head = new HashMap<String, String>(2) {
+//			{
+//				put(SystemHeader.X_CA_PATH, "/artemis/api/api/resource/v1/regions");
+//			}
+//		};
+//		return ArtemisHttpUtil.doPostStringArtemis(config,path, body, null, null, "application/json", head);
+//	}
+//
+//	public static void main(String[] args) throws Exception {
+//
+//        String result = callPostApiGetOrgList();
+//		System.out.println(result);
+////		String VechicleDataResult = callPostApiGetRegions();
+////		System.out.println(VechicleDataResult);
+//	}
+//
+//}

+ 14 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/haikang/CameraData.java

@@ -0,0 +1,14 @@
+package com.ruoyi.web.controller.chenyanlogin.haikang;
+
+import lombok.Data;
+
+import java.util.List;
+@Data
+public class CameraData {
+    private int total;
+    private int pageNo;
+    private int pageSize;
+    private List<CameraInfo> list;
+ 
+    // getters and setters
+}

+ 48 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/haikang/CameraInfo.java

@@ -0,0 +1,48 @@
+package com.ruoyi.web.controller.chenyanlogin.haikang;
+
+import lombok.Data;
+
+import java.util.Date;
+@Data
+public class CameraInfo {
+    private String altitude;
+    private String cameraIndexCode;
+    private String cameraName;
+    private int cameraType;
+    private String cameraTypeName;
+    private String capabilitySet;
+    private String capabilitySetName;
+    private String intelligentSet;
+    private String intelligentSetName;
+    private String channelNo;
+    private String channelType;
+    private String channelTypeName;
+    private Date createTime;
+    private String encodeDevIndexCode;
+    private String encodeDevResourceType;
+    private String encodeDevResourceTypeName;
+    private String gbIndexCode;
+    private String installLocation;
+    private String keyBoardCode;
+    private String latitude;
+    private String longitude;
+    private String pixel;
+    private String ptz;
+    private String ptzName;
+    private String ptzController;
+    private String ptzControllerName;
+    private String recordLocation;
+    private String recordLocationName;
+    private String regionIndexCode;
+    private int status;
+    private String statusName;
+    private int transType;
+    private String transTypeName;
+    private String treatyType;
+    private String treatyTypeName;
+    private String viewshed;
+    private Date updateTime;
+ 
+    // getters and setters
+    // 可以添加toString()方法方便调试
+}

+ 12 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/haikang/CameraResponse.java

@@ -0,0 +1,12 @@
+package com.ruoyi.web.controller.chenyanlogin.haikang;
+
+import lombok.Data;
+
+@Data
+public class CameraResponse {
+    private String code;
+    private String msg;
+    private CameraData data;
+ 
+    // getters and setters
+}

+ 9 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/haikang/CameraStatusData.java

@@ -0,0 +1,9 @@
+package com.ruoyi.web.controller.chenyanlogin.haikang;
+
+import lombok.Data;
+
+@Data
+public class CameraStatusData {
+    private String status;
+    private String statusName;
+}

+ 12 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/haikang/CameraStatusResponse.java

@@ -0,0 +1,12 @@
+package com.ruoyi.web.controller.chenyanlogin.haikang;
+
+import lombok.Data;
+
+@Data
+public class CameraStatusResponse {
+    private String code;
+    private String msg;
+    private CameraStatusData data;
+ 
+    // getters and setters
+}

+ 58 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/haikang/Tools.java

@@ -0,0 +1,58 @@
+package com.ruoyi.web.controller.chenyanlogin.haikang;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+
+/**
+ * 工具类
+ *
+ * @author
+ * @create 2019-01-11 17:06
+ **/
+public class  Tools {
+
+    /**
+     * 将图片写到 硬盘指定目录下
+     *
+     * @param in
+     * @param dirPath
+     * @param filePath
+     */
+    public static void savePicToDisk(InputStream in, String dirPath,
+                                     String filePath) {
+
+        try {
+            File dir = new File(dirPath);
+            if (dir == null || !dir.exists()) {
+                dir.mkdirs();
+            }
+
+            //文件真实路径
+            String realPath = dirPath.concat(filePath);
+            File file = new File(realPath);
+            if (file == null || !file.exists()) {
+                file.createNewFile();
+            }
+
+            FileOutputStream fos = new FileOutputStream(file);
+            byte[] buf = new byte[1024];
+            int len = 0;
+            while ((len = in.read(buf)) != -1) {
+                fos.write(buf, 0, len);
+            }
+            fos.flush();
+            fos.close();
+
+        } catch (IOException e) {
+            e.printStackTrace();
+        } finally {
+            try {
+                in.close();
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+    }
+}

+ 126 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/huicunutil/HuiCunJiaMi.java

@@ -0,0 +1,126 @@
+package com.ruoyi.web.controller.chenyanlogin.huicunutil;
+
+import cn.hutool.core.util.StrUtil;
+import org.apache.http.util.Asserts;
+
+import javax.crypto.Cipher;
+import javax.crypto.spec.SecretKeySpec;
+import java.nio.charset.StandardCharsets;
+import java.util.Arrays;
+import java.util.Base64;
+import java.util.List;
+
+public class HuiCunJiaMi {
+    /**
+     * 加密算法
+     */
+    private final static String ALGORITHM_AES = "AES";
+
+    /**
+     * 算法/模式/补码方式
+     */
+    private final static String ALGORITHM_MODE_PADDING = "AES/ECB/PKCS5Padding";
+
+    /**
+     * 安全策略
+     */
+    private final static String SHA1_SECURITY_POLICY = "SHA1PRNG";
+
+    /**
+     * AES密钥长度
+     */
+    public static final int AES_KEY_LENGTH = 16;
+
+    /**
+     * AES密钥可能的长度
+     */
+    private static final List<Integer> AES_KEY_POSSIBLE_LENGTH = Arrays.asList(16, 24, 32);
+
+    /**
+     * 加密
+     *
+     * @param secretKey
+     * @param content
+     * @return
+     */
+    public static String AESEncode(String secretKey, String content) {
+        // 判断密钥是否为空
+        if (StrUtil.isEmpty(secretKey)) {
+            System.out.println("密钥为空");
+        }
+        // 判断Key是否为16位
+        if (secretKey.length() != AES_KEY_LENGTH) {
+             System.out.println("密钥长度不是16位");
+        }
+        try {
+            byte[] raw = secretKey.getBytes(StandardCharsets.UTF_8);
+            SecretKeySpec skeySpec = new SecretKeySpec(raw, ALGORITHM_AES);
+            // "算法/模式/补码方式"
+            Cipher cipher = Cipher.getInstance(ALGORITHM_MODE_PADDING);
+            cipher.init(Cipher.ENCRYPT_MODE, skeySpec);
+            byte[] encrypted = cipher.doFinal(content.getBytes(StandardCharsets.UTF_8));
+            // 此处使用BASE64做转码功能,同时能起到2次加密的作用。
+//            String encode = new BASE64Encoder().encode(encrypted);
+            String encode = Base64.getEncoder().encodeToString(encrypted);
+            encode = encode.replaceAll(System.getProperty("line.separator"), "");
+            return encode;
+        } catch (Exception e) {
+
+             System.out.println("AES加密异常");
+        }
+        return null;
+    }
+
+    /**
+     * 解密
+     *
+     * @param secretKey
+     * @param content
+     * @return
+     */
+    public static String AESDecode(String secretKey, String content) {
+        // 判断Key是否为空
+        if (StrUtil.isEmpty(secretKey)) {
+             System.out.println("密钥为空");
+        }
+        // 判断Key是否为16位
+        if (secretKey.length() != AES_KEY_LENGTH) {
+             System.out.println("密钥长度不是16位");
+        }
+        try {
+            byte[] raw = secretKey.getBytes(StandardCharsets.UTF_8);
+            SecretKeySpec skeySpec = new SecretKeySpec(raw, ALGORITHM_AES);
+            Cipher cipher = Cipher.getInstance(ALGORITHM_MODE_PADDING);
+            cipher.init(Cipher.DECRYPT_MODE, skeySpec);
+//            byte[] encrypted = new BASE64Decoder().decodeBuffer(content);
+            byte[] encrypted = Base64.getDecoder().decode(content);
+            byte[] original = cipher.doFinal(encrypted);
+            String originalString = new String(original, StandardCharsets.UTF_8);
+            originalString = originalString.replaceAll(System.getProperty("line.separator"), "");
+            return originalString;
+        } catch (Exception e) {
+
+             System.out.println("AES解密异常");
+        }
+        return null;
+    }
+
+
+    /**
+     * 生成签名,进行客户端签名校验
+     **/
+    private static String getSign(String token, Long timestamp, String appId, String appKey, String appSecret) {
+        String str = String.format("%s:%s:%s:%s:%s", token, String.valueOf(timestamp), appId, appKey, appSecret);
+        String encodestr = SignUtils.sha256ByText(str);
+        return encodestr;
+    }
+
+    /**
+     * 生成返回签名,用于客户端进行校验
+     **/
+    private static String getSignBakV2(String token, Long timestamp, String appId, String appKey, String appSecret, String phone, String areaCode) {
+        String str = String.format("%s:%s:%s:%s:%s:%s:%s", token, String.valueOf(timestamp), appId, appKey, appSecret, phone, areaCode);
+        String encodestr = SignUtils.sha256ByText(str);
+        return encodestr;
+    }
+}

+ 169 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/huicunutil/MapUtils.java

@@ -0,0 +1,169 @@
+package com.ruoyi.web.controller.chenyanlogin.huicunutil;
+
+import cn.hutool.core.util.StrUtil;
+import lombok.extern.slf4j.Slf4j;
+
+import java.beans.BeanInfo;
+import java.beans.Introspector;
+import java.beans.PropertyDescriptor;
+import java.io.UnsupportedEncodingException;
+import java.lang.reflect.Method;
+import java.net.URLEncoder;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.TreeMap;
+
+@Slf4j
+public class MapUtils {
+
+    public static TreeMap<String, Object> map2ObjectTreeMap(Map<String, String> map) {
+        TreeMap<String, Object> treeMap = new TreeMap<>();
+        for (Map.Entry<String, String> entry : map.entrySet()) {
+            String value = entry.getValue();
+            if (StrUtil.isEmpty(value)) {
+                continue;
+            }
+            treeMap.put(entry.getKey(), value);
+        }
+        return treeMap;
+    }
+
+    public static TreeMap<String, String> map2StringTreeMap(Map<String, Object> map) {
+        TreeMap<String, String> treeMap = new TreeMap<>();
+        for (Map.Entry<String, Object> entry : map.entrySet()) {
+            String value;
+            Object obj = entry.getValue();
+            if (null == obj) {
+                continue;
+            }
+//            if (obj instanceof Date) {
+//                value = String.valueOf(((Date)obj).getTime());
+//            } else {
+//                value = obj.toString();
+//            }
+            if (obj instanceof String) {
+                value = (String) obj;
+            } else {
+                value = obj.toString();
+            }
+            if (StrUtil.isEmpty(value)) {
+                continue;
+            }
+            treeMap.put(entry.getKey(), value);
+        }
+        return treeMap;
+    }
+
+    public static TreeMap<String, Object> toTreeMap(Object obj, boolean isFilterNull) {
+        return obj2Map(obj, isFilterNull, false);
+    }
+
+    private static TreeMap<String, Object> obj2Map(Object obj, boolean isFilterNull, boolean isJson) {
+        TreeMap<String, Object> map = new TreeMap<>();
+        if (obj == null) {
+            return map;
+        }
+        try {
+            Class clazz = obj.getClass();
+            BeanInfo e = Introspector.getBeanInfo(clazz);
+            PropertyDescriptor[] properties = e.getPropertyDescriptors();
+            for (int i = 0; i < properties.length; i++) {
+                PropertyDescriptor property = properties[i];
+                String key = property.getName();
+                if (key.equals("class")) {
+                    continue;
+                }
+                Method getter = property.getReadMethod();
+                Object value = getter.invoke(obj, new Object[0]);
+                if (isFilterNull && value == null) {
+                    continue;
+                }
+            /*    if (isJson) {
+                    key = BeanUtil.getJsonColumnName(clazz, key);
+                }*/
+                map.put(key, value);
+            }
+        } catch (Exception e) {
+            log.error("object to json map error", e);
+        }
+        return map;
+    }
+
+    /**
+     * 将TreeMap中所有参数按升序转换成字符串,格式:key1=value1&key2=value2
+     *
+     * @param map
+     * @return
+     */
+    public static String treeMap2ascString(Map<String, Object> map) {
+        return treeMap2ascString(map, null);
+    }
+
+    /**
+     * 将TreeMap中所有参数按升序转换成字符串,格式:key1=value1&key2=value2
+     *
+     * @param map
+     * @param charset 编码,为空则不编码
+     * @return
+     */
+    public static String treeMap2ascString(Map<String, Object> map, String charset) {
+        return treeMap2ascString(map, charset, '&');
+    }
+
+    /**
+     * 将TreeMap中所有参数按升序转换成字符串
+     *
+     * @param map
+     * @param charset 编码,为空则不编码
+     * @param link    连接符
+     * @return
+     */
+    public static String treeMap2ascString(Map<String, Object> map, String charset, Character link) {
+        StringBuilder sb = new StringBuilder();
+        boolean isEncode = StrUtil.isNotBlank(charset);//是否url编码value
+        boolean isLink = null != link;
+        try {
+            Iterator<Map.Entry<String, Object>> iter = map.entrySet().iterator();
+            while (iter.hasNext()) {
+                Map.Entry<String, Object> entry = iter.next();
+                String value;
+                Object obj = entry.getValue();
+                if (null == obj) {
+                    continue;
+                }
+//                if (obj instanceof Date) {
+//                    value = String.valueOf(((Date)obj).getTime());
+//                } else {
+                value = obj.toString();
+//                }
+                if (StrUtil.isEmpty(value)) {
+                    continue;
+                }
+                sb.append(entry.getKey()).append("=").append(isEncode ? URLEncoder.encode(value, charset) : value);
+                if (isLink) {
+                    sb.append(link);
+                }
+            }
+            int n = sb.length() - 1;
+            if (isLink && n >= 0 && sb.charAt(n) == link.charValue()) {
+                sb.deleteCharAt(n);
+            }
+        } catch (Exception e) {
+            log.error(e.getLocalizedMessage());
+        }
+        return sb.toString();
+    }
+
+    public static Map<String, String> encodeTreeMap(Map<String, String> map, String charset) {
+        Map<String, String> newMap = new TreeMap<String, String>();
+        for (Map.Entry<String, String> entry : map.entrySet()) {
+            try {
+                String value = URLEncoder.encode(entry.getValue(), charset);
+                newMap.put(entry.getKey(), value);
+            } catch (UnsupportedEncodingException e) {
+                e.printStackTrace();
+            }
+        }
+        return newMap;
+    }
+}

+ 239 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/huicunutil/SignUtils.java

@@ -0,0 +1,239 @@
+package com.ruoyi.web.controller.chenyanlogin.huicunutil;
+
+import cn.hutool.core.codec.Base64;
+import cn.hutool.crypto.SecureUtil;
+//import com.cmii.zhxc.common.exception.Asserts;
+import lombok.extern.slf4j.Slf4j;
+
+import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.util.TreeMap;
+
+@Slf4j
+public class SignUtils {
+    private static final String SIGN_SHA1 = "SHA1";
+    private static final String SIGN_SHA256 = "SHA-256";
+    private static final String SIGN_MD5 = "MD5";
+    private static final char hexDigits[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
+    private static final String KEY_STR = "&key=";//SHA1签名拼接的字符串
+
+    /**
+     * RSA签名
+     *
+     * @param text       待签名数据
+     * @param privateKey 商户私钥
+     * @param charset    编码格式
+     * @return 签名值
+     */
+    public static String rsa(String text, String privateKey, String charset) {
+        return rsa(text, Base64.decode(privateKey), charset);
+    }
+
+    /**
+     * RSA签名
+     *
+     * @param text       待签名数据
+     * @param privateKey 商户私钥
+     * @param charset    编码格式
+     * @return 签名值
+     */
+    public static String rsa(String text, byte[] privateKey, String charset) {
+        String result = null;
+        try {
+//            result = RSA.sign(text.getBytes(charset), privateKey);
+        } catch (Exception e) {
+            String errInfo = "计算RSA签名出错,请检查RSA秘钥配置是否正确";
+            log.error(errInfo + text, e);
+//            Asserts.fail(errInfo);
+        }
+        log.info("String: {} , RSA: {}", text, result);
+        return result;
+    }
+
+    /**
+     * RSA2签名
+     *
+     * @param text       待签名数据
+     * @param privateKey 商户私钥
+     * @param charset    编码格式
+     * @return 签名值
+     */
+    public static String rsa2(String text, String privateKey, String charset) {
+        return rsa2(text, Base64.decode(privateKey), charset);
+    }
+
+    /**
+     * RSA2签名
+     *
+     * @param text       待签名数据
+     * @param privateKey 商户私钥
+     * @param charset    编码格式
+     * @return 签名值
+     */
+    public static String rsa2(String text, byte[] privateKey, String charset) {
+        String result = null;
+        try {
+//            result = RSA.sign2(text.getBytes(charset), privateKey);
+        } catch (Exception e) {
+            String errInfo = "计算RSA256签名出错,请检查RSA秘钥配置是否正确";
+            log.error(errInfo + text, e);
+//            Asserts.fail(errInfo);
+        }
+        log.info("String: {} , RSA256: {}", text, result);
+        return result;
+    }
+
+
+    /**
+     * 生成sha1签名(大写)
+     *
+     * @param map
+     * @param key
+     * @return
+     */
+    public static String sha1ByMap(TreeMap<String, Object> map, String key) {
+        String text = MapUtils.treeMap2ascString(map);//生成待签名字符串
+        text = text + KEY_STR + key;//拼接key
+        return SignUtils.sha1ByText(text);
+    }
+
+    /**
+     * 生成sha1签名(大写)
+     *
+     * @param text
+     * @return
+     */
+    public static String sha1ByText(String text) {
+        String sign = null;
+        try {
+            sign = SignUtils.security(text, SIGN_SHA1, null);
+        } catch (Exception e) {
+            String errInfo = "计算SHA1签名出错";
+            log.error(errInfo + text, e);
+//            Asserts.fail(errInfo);
+        }
+        log.info("String: {} , SHA1: {}", text, sign);
+        return sign;
+    }
+
+    /**
+     * 生成sha256签名(大写)
+     *
+     * @param text
+     * @return
+     * @
+     */
+    public static String sha256ByText(String text) {
+        String sign = null;
+        try {
+            sign = SignUtils.security(text, SIGN_SHA256, null);
+        } catch (Exception e) {
+            String errInfo = "计算SHA256签名出错";
+            log.error(errInfo + text, e);
+//            Asserts.fail(errInfo);
+        }
+        log.info("String: {} , SHA256: {}", text, sign);
+        return sign;
+    }
+
+    /**
+     * 生成sha256签名(大写)
+     *
+     * @param bytes
+     * @return
+     * @
+     */
+    public static String sha256ByBinary(byte[] bytes) {
+        String sign = null;
+        try {
+            sign = SignUtils.security(bytes, SIGN_SHA256);
+        } catch (Exception e) {
+            String errInfo = "计算SHA256签名出错";
+            log.error(errInfo, e);
+//            Asserts.fail(errInfo);
+        }
+        log.info("Binary SHA256: {}", sign);
+        return sign;
+    }
+
+    /**
+     * 提供MessageDigest支持的各种hash算法(如SHA1、SHA256、MD5等)
+     *
+     * @param s
+     * @param algorithm
+     * @param charset
+     * @return
+     * @throws NoSuchAlgorithmException
+     */
+    public static String security(String s, String algorithm, Charset charset) throws Exception {
+        if (null == charset) {
+            charset = StandardCharsets.UTF_8;
+        }
+        byte[] bytes = s.getBytes(charset);
+
+        return SignUtils.security(bytes, algorithm);
+    }
+
+    /**
+     * 提供MessageDigest支持的各种hash算法(如SHA1、SHA256、MD5等)
+     *
+     * @param bytes
+     * @param algorithm
+     * @return
+     * @throws NoSuchAlgorithmException
+     */
+    public static String security(byte[] bytes, String algorithm) throws Exception {
+        // 获得摘要算法的 MessageDigest 对象
+        MessageDigest mdInst = MessageDigest.getInstance(algorithm);
+        // 使用指定的字节更新摘要
+        mdInst.update(bytes);
+        // 获得密文
+        byte[] md = mdInst.digest();
+        // 把密文转换成十六进制的字符串形式
+        int j = md.length;
+        char str[] = new char[j * 2];
+        int k = 0;
+        for (int i = 0; i < j; i++) {
+            byte byte0 = md[i];
+            str[k++] = hexDigits[byte0 >>> 4 & 0xf];
+            str[k++] = hexDigits[byte0 & 0xf];
+        }
+        return new String(str);
+    }
+
+    /**
+     * 取字符串的md5值(大写),使用默认的UTF-8编码
+     *
+     * @param text
+     * @return
+     */
+    public static String md5ByText(String text) {
+        return SignUtils.md5ByText(text, null);
+    }
+
+    /**
+     * 取字符串的md5值(大写),使用默认的UTF-8编码
+     *
+     * @param text
+     * @return
+     */
+    public static String md5ByText(String text, Charset charset) {
+        String rs = null;
+        try {
+            rs = security(text, SIGN_MD5, charset);
+        } catch (Exception e) {
+            String errInfo = "计算MD5签名出错";
+            log.error(errInfo + rs, e);
+//            Asserts.fail(errInfo);
+        }
+        log.info("String: {} , MD5: {}", text, rs);
+        return rs;
+    }
+
+
+    public static void main(String... args) {
+        SecureUtil.md5();
+    }
+}

+ 16 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/mapper/HouseDigitalNumberMapper.java

@@ -0,0 +1,16 @@
+package com.ruoyi.web.controller.chenyanlogin.mapper;
+
+import com.ruoyi.web.controller.chenyanlogin.entity.HouseDigitalNumber;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author author
+ * @since 2025-09-20
+ */
+public interface HouseDigitalNumberMapper extends BaseMapper<HouseDigitalNumber> {
+
+}

+ 16 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/mapper/HousePictureMapper.java

@@ -0,0 +1,16 @@
+package com.ruoyi.web.controller.chenyanlogin.mapper;
+
+import com.ruoyi.web.controller.chenyanlogin.entity.HousePicture;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author author
+ * @since 2025-09-20
+ */
+public interface HousePictureMapper extends BaseMapper<HousePicture> {
+
+}

+ 16 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/mapper/HouseTagMapper.java

@@ -0,0 +1,16 @@
+package com.ruoyi.web.controller.chenyanlogin.mapper;
+
+import com.ruoyi.web.controller.chenyanlogin.entity.HouseTag;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author author
+ * @since 2025-09-20
+ */
+public interface HouseTagMapper extends BaseMapper<HouseTag> {
+
+}

+ 16 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/mapper/HouseVillagerRelationMapper.java

@@ -0,0 +1,16 @@
+package com.ruoyi.web.controller.chenyanlogin.mapper;
+
+import com.ruoyi.web.controller.chenyanlogin.entity.HouseVillagerRelation;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author author
+ * @since 2025-09-20
+ */
+public interface HouseVillagerRelationMapper extends BaseMapper<HouseVillagerRelation> {
+
+}

+ 16 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/mapper/NationUnityMapper.java

@@ -0,0 +1,16 @@
+package com.ruoyi.web.controller.chenyanlogin.mapper;
+
+import com.ruoyi.web.controller.chenyanlogin.entity.NationUnity;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ * 媒体宣传内容收集表 Mapper 接口
+ * </p>
+ *
+ * @author author
+ * @since 2025-09-23
+ */
+public interface NationUnityMapper extends BaseMapper<NationUnity> {
+
+}

+ 16 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/mapper/SubsidyProjectsJianMapper.java

@@ -0,0 +1,16 @@
+package com.ruoyi.web.controller.chenyanlogin.mapper;
+
+import com.ruoyi.web.controller.chenyanlogin.entity.SubsidyProjectsJian;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author author
+ * @since 2025-09-20
+ */
+public interface SubsidyProjectsJianMapper extends BaseMapper<SubsidyProjectsJian> {
+
+}

+ 16 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/mapper/TagsMapper.java

@@ -0,0 +1,16 @@
+package com.ruoyi.web.controller.chenyanlogin.mapper;
+
+import com.ruoyi.web.controller.chenyanlogin.entity.Tags;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author author
+ * @since 2025-09-20
+ */
+public interface TagsMapper extends BaseMapper<Tags> {
+
+}

+ 16 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/mapper/TagsPersonMapper.java

@@ -0,0 +1,16 @@
+package com.ruoyi.web.controller.chenyanlogin.mapper;
+
+import com.ruoyi.web.controller.chenyanlogin.entity.TagsPerson;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author author
+ * @since 2025-09-20
+ */
+public interface TagsPersonMapper extends BaseMapper<TagsPerson> {
+
+}

+ 27 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/service/HuiCunService.java

@@ -0,0 +1,27 @@
+package com.ruoyi.web.controller.chenyanlogin.service;
+
+
+import com.ruoyi.common.core.domain.AjaxResult;
+
+public interface HuiCunService {
+    AjaxResult getBasicData();
+
+    AjaxResult getCarePeopleData();
+
+    AjaxResult getSnapshotReportData();
+
+
+    AjaxResult getZhwlDeviceData();
+
+    AjaxResult getPointRankData();
+
+    AjaxResult getCivilizedData();
+
+    AjaxResult getVillageNewsData();
+
+    AjaxResult syncVillagerData(int type);
+
+    AjaxResult syncHouseData(int type);
+
+    AjaxResult syncAllowanceData(int type);
+}

+ 16 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/service/IHouseDigitalNumberService.java

@@ -0,0 +1,16 @@
+package com.ruoyi.web.controller.chenyanlogin.service;
+
+import com.ruoyi.web.controller.chenyanlogin.entity.HouseDigitalNumber;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author author
+ * @since 2025-09-20
+ */
+public interface IHouseDigitalNumberService extends IService<HouseDigitalNumber> {
+
+}

+ 16 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/service/IHousePictureService.java

@@ -0,0 +1,16 @@
+package com.ruoyi.web.controller.chenyanlogin.service;
+
+import com.ruoyi.web.controller.chenyanlogin.entity.HousePicture;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author author
+ * @since 2025-09-20
+ */
+public interface IHousePictureService extends IService<HousePicture> {
+
+}

+ 16 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/service/IHouseTagService.java

@@ -0,0 +1,16 @@
+package com.ruoyi.web.controller.chenyanlogin.service;
+
+import com.ruoyi.web.controller.chenyanlogin.entity.HouseTag;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author author
+ * @since 2025-09-20
+ */
+public interface IHouseTagService extends IService<HouseTag> {
+
+}

+ 16 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/service/IHouseVillagerRelationService.java

@@ -0,0 +1,16 @@
+package com.ruoyi.web.controller.chenyanlogin.service;
+
+import com.ruoyi.web.controller.chenyanlogin.entity.HouseVillagerRelation;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author author
+ * @since 2025-09-20
+ */
+public interface IHouseVillagerRelationService extends IService<HouseVillagerRelation> {
+
+}

+ 33 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/service/INationUnityService.java

@@ -0,0 +1,33 @@
+package com.ruoyi.web.controller.chenyanlogin.service;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.web.controller.chenyanlogin.entity.NationUnity;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ruoyi.web.domain.dto.mediaPropaganda.MediaPropagandaAddRequest;
+import com.ruoyi.web.domain.dto.mediaPropaganda.MediaPropagandaEditRequest;
+import com.ruoyi.web.domain.dto.mediaPropaganda.MediaPropagandaQueryRequest;
+import com.ruoyi.web.domain.entity.MediaPropaganda;
+import com.ruoyi.web.domain.vo.MediaPropagandaVO;
+
+/**
+ * <p>
+ * 媒体宣传内容收集表 服务类
+ * </p>
+ *
+ * @author author
+ * @since 2025-09-23
+ */
+public interface INationUnityService extends IService<NationUnity> {
+
+    Integer addMediaPropaganda(MediaPropagandaAddRequest mediaPropagandaAddRequest);
+
+    boolean deleteMediaPropaganda(String ids);
+
+    void editMediaPropaganda(MediaPropagandaEditRequest mediaPropagandaEditRequest);
+
+    MediaPropagandaVO getMediaPropagandaById(int id);
+
+    Page<MediaPropagandaVO> getListMediaPropagandaByPage(MediaPropagandaQueryRequest mediaPropagandaQueryRequest);
+    MediaPropagandaVO getMediaPropagandaVO(NationUnity mediaPropaganda);
+
+}

+ 16 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/service/ISubsidyProjectsJianService.java

@@ -0,0 +1,16 @@
+package com.ruoyi.web.controller.chenyanlogin.service;
+
+import com.ruoyi.web.controller.chenyanlogin.entity.SubsidyProjectsJian;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author author
+ * @since 2025-09-20
+ */
+public interface ISubsidyProjectsJianService extends IService<SubsidyProjectsJian> {
+
+}

+ 16 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/service/ITagsPersonService.java

@@ -0,0 +1,16 @@
+package com.ruoyi.web.controller.chenyanlogin.service;
+
+import com.ruoyi.web.controller.chenyanlogin.entity.TagsPerson;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author author
+ * @since 2025-09-20
+ */
+public interface ITagsPersonService extends IService<TagsPerson> {
+
+}

+ 16 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/service/ITagsService.java

@@ -0,0 +1,16 @@
+package com.ruoyi.web.controller.chenyanlogin.service;
+
+import com.ruoyi.web.controller.chenyanlogin.entity.Tags;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author author
+ * @since 2025-09-20
+ */
+public interface ITagsService extends IService<Tags> {
+
+}

+ 13 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/service/impl/AlllowanceDto.java

@@ -0,0 +1,13 @@
+package com.ruoyi.web.controller.chenyanlogin.service.impl;
+
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class AlllowanceDto {
+    //补贴项目主实体
+    private List<CardProject> cardProjectList;
+    //补贴明细实体
+    private List<CardProjectAllowance> cardProjectAllowanceList;
+}

+ 25 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/service/impl/CardProject.java

@@ -0,0 +1,25 @@
+package com.ruoyi.web.controller.chenyanlogin.service.impl;
+
+import lombok.Data;
+
+@Data
+public class CardProject {
+    /** 项目ID(必传) */
+    private Long id;
+    /** 项目名称(必传) */
+    private String projectName;
+    /** 补贴类型(1:社会保障 2:扶贫开发 3:林业 4:农业,必传) */
+    private Integer allowanceType;
+    /** 行政村ID(必传) */
+    private Long areaId;
+    /** 创建时间(datetime格式,必传) */
+    private Long defTime;
+    /** 创建用户ID(必传) */
+    private Long defUser;
+    /** 是否已删除(true:是 false:否,必传) */
+    private Boolean deleted;
+    /** 更新时间(datetime格式,必传) */
+    private Long updateTime;
+    /** 更新用户ID(必传) */
+    private Long updateUser;
+}

+ 33 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/service/impl/CardProjectAllowance.java

@@ -0,0 +1,33 @@
+package com.ruoyi.web.controller.chenyanlogin.service.impl;
+
+import lombok.Data;
+
+@Data
+public class CardProjectAllowance {
+    /** 补贴明细ID(必传) */
+    private Long id;
+    /** 关联项目ID(必传) */
+    private Long projectId;
+    /** 用户ID(非必传) */
+    private Long villagerId;
+    /** 用户昵称(必传) */
+    private String nickName;
+    /** 身份证号(必传) */
+    private String idCard;
+    /** 实发金额(必传) */
+    private Double allowance;
+    /** 银行卡号(必传) */
+    private String bankAccount;
+    /** 兑现时间(datetime格式,必传) */
+    private Long offerTime;
+    /** 创建时间(datetime格式,必传) */
+    private Long defTime;
+    /** 创建用户ID(必传) */
+    private Long defUser;
+    /** 更新时间(datetime格式,必传) */
+    private Long updTime;
+    /** 更新用户ID(必传) */
+    private Long updUser;
+    /** 是否删除标记(必传) */
+    private Boolean deleted;
+}

+ 20 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/service/impl/HouseDigitalNumberServiceImpl.java

@@ -0,0 +1,20 @@
+package com.ruoyi.web.controller.chenyanlogin.service.impl;
+
+import com.ruoyi.web.controller.chenyanlogin.entity.HouseDigitalNumber;
+import com.ruoyi.web.controller.chenyanlogin.mapper.HouseDigitalNumberMapper;
+import com.ruoyi.web.controller.chenyanlogin.service.IHouseDigitalNumberService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author author
+ * @since 2025-09-20
+ */
+@Service
+public class HouseDigitalNumberServiceImpl extends ServiceImpl<HouseDigitalNumberMapper, HouseDigitalNumber> implements IHouseDigitalNumberService {
+
+}

+ 20 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/service/impl/HousePictureServiceImpl.java

@@ -0,0 +1,20 @@
+package com.ruoyi.web.controller.chenyanlogin.service.impl;
+
+import com.ruoyi.web.controller.chenyanlogin.entity.HousePicture;
+import com.ruoyi.web.controller.chenyanlogin.mapper.HousePictureMapper;
+import com.ruoyi.web.controller.chenyanlogin.service.IHousePictureService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author author
+ * @since 2025-09-20
+ */
+@Service
+public class HousePictureServiceImpl extends ServiceImpl<HousePictureMapper, HousePicture> implements IHousePictureService {
+
+}

+ 20 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/service/impl/HouseTagServiceImpl.java

@@ -0,0 +1,20 @@
+package com.ruoyi.web.controller.chenyanlogin.service.impl;
+
+import com.ruoyi.web.controller.chenyanlogin.entity.HouseTag;
+import com.ruoyi.web.controller.chenyanlogin.mapper.HouseTagMapper;
+import com.ruoyi.web.controller.chenyanlogin.service.IHouseTagService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author author
+ * @since 2025-09-20
+ */
+@Service
+public class HouseTagServiceImpl extends ServiceImpl<HouseTagMapper, HouseTag> implements IHouseTagService {
+
+}

+ 20 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/service/impl/HouseVillagerRelationServiceImpl.java

@@ -0,0 +1,20 @@
+package com.ruoyi.web.controller.chenyanlogin.service.impl;
+
+import com.ruoyi.web.controller.chenyanlogin.entity.HouseVillagerRelation;
+import com.ruoyi.web.controller.chenyanlogin.mapper.HouseVillagerRelationMapper;
+import com.ruoyi.web.controller.chenyanlogin.service.IHouseVillagerRelationService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author author
+ * @since 2025-09-20
+ */
+@Service
+public class HouseVillagerRelationServiceImpl extends ServiceImpl<HouseVillagerRelationMapper, HouseVillagerRelation> implements IHouseVillagerRelationService {
+
+}

+ 755 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/service/impl/HuiCunServiceImpl.java

@@ -0,0 +1,755 @@
+package com.ruoyi.web.controller.chenyanlogin.service.impl;
+
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.json.JSONArray;
+import cn.hutool.json.JSONObject;
+import cn.hutool.json.JSONUtil;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.web.controller.chenyanlogin.ChengYanAesUtil;
+import com.ruoyi.web.controller.chenyanlogin.dto.*;
+import com.ruoyi.web.controller.chenyanlogin.dto.HouseVillagerRelation;
+import com.ruoyi.web.controller.chenyanlogin.entity.*;
+import com.ruoyi.web.controller.chenyanlogin.mapper.*;
+import com.ruoyi.web.controller.chenyanlogin.service.HuiCunService;
+import com.ruoyi.web.domain.entity.HouseInfo;
+import com.ruoyi.web.domain.entity.PersonHouseRelation;
+import com.ruoyi.web.domain.entity.PersonInfo;
+import com.ruoyi.web.domain.entity.SubsidyProjects;
+import com.ruoyi.web.mapper.HouseInfoMapper;
+import com.ruoyi.web.mapper.PersonHouseRelationMapper;
+import com.ruoyi.web.mapper.PersonInfoMapper;
+import com.ruoyi.web.mapper.SubsidyProjectsMapper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.client.RestTemplate;
+
+import javax.sound.midi.Soundbank;
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.util.*;
+
+import static com.ruoyi.common.core.domain.AjaxResult.error;
+import static com.ruoyi.common.core.domain.AjaxResult.success;
+
+
+@Service
+public class HuiCunServiceImpl implements HuiCunService {
+    private    static  final  String encodeRules ="gansu5jduv83m7xy";
+
+    private    static  final  String BASE_URL ="https://huicuntest.cm-agri.com/liteapi";
+    //基础数据查询接口
+    private    static  final  String BASIC_DATA ="/zhxc-lite-web/web/huimu/getBasicData";
+    //关爱人群数据查询接口
+    private    static  final  String CARE_PEOPLE_DATA ="/zhxc-lite-web/web/huimu/getCarePeopleData";
+    //事件上报数据查询接口
+    private    static  final  String SNAPSHOT_REPORT_DATA ="/zhxc-lite-web/web/huimu/getSnapshotReportData";
+    //一键呼叫数据查询接口
+    private    static  final  String ZHWL_DEVICE_DATA ="/zhxc-lite-web/web/huimu/getZhwlDeviceData";
+    //积分排行数据查询接口
+    private    static  final  String POINT_RANK_DATA ="/zhxc-lite-web/web/huimu/getPointRankData";
+    //文明红榜数据查询接口
+    private    static  final  String CIVILIZED_DATA ="/zhxc-lite-web/web/huimu/getCivilizedData";
+    //先进事迹资讯数据查询接口
+    private    static  final  String VILLAGE_NEWS_DATA ="/zhxc-lite-web/web/huimu/getVillageNewsData";
+    //同步人口数据查询接口
+    private    static  final  String VILLAGER_DATA ="/zhxc-lite-web/web/huimu/syncVillagerData";
+    //同步房屋数据查询接口
+    private    static  final  String HOUSE_DATA ="/zhxc-lite-web/web/huimu/syncHouseData";
+    //同步补贴数据查询接口
+    private    static  final  String ALLOWANCE_DATA ="/zhxc-lite-web/web/huimu/syncAllowanceData";
+
+    @Autowired
+    private RestTemplate restTemplate;
+
+    //基础数据查询接口
+    @Override
+    public AjaxResult getBasicData() {
+        Map<String, Object> requestParam = new HashMap<>();
+        requestParam.put("areaCode", "510116999999");
+        requestParam.put("nonce", UUID.randomUUID().toString());
+        requestParam.put("timestamp", System.currentTimeMillis());
+        Map<String, Object> responseData = getMap(requestParam, BASIC_DATA);
+        if (responseData.get("code").equals(200)) {
+            JSONObject dataStr = (JSONObject) responseData.get("data");
+            BasicDataDto basicDataDto = JSONUtil.toBean(dataStr, BasicDataDto.class);
+            return success(basicDataDto);
+        } else {
+            return error("同步失败" + responseData.get("message"));
+        }
+    }
+
+    //关爱人群数据查询接口
+    @Override
+    public AjaxResult getCarePeopleData() {
+        Map<String, Object> requestParam = new HashMap<>();
+        requestParam.put("areaCode", "510116999999");
+        requestParam.put("nonce", UUID.randomUUID().toString());
+        requestParam.put("timestamp", System.currentTimeMillis());
+        Map<String, Object> responseData = getMap(requestParam, CARE_PEOPLE_DATA);
+        if (responseData.get("code").equals(200)) {
+            JSONObject dataStr = (JSONObject) responseData.get("data");
+            CarePeopleData carePeopleData = JSONUtil.toBean(dataStr, CarePeopleData.class);
+            return success(carePeopleData);
+        } else {
+            return error("同步失败" + responseData.get("message"));
+        }
+    }
+    // 事件上报数据查询接口
+    @Override
+    public AjaxResult getSnapshotReportData() {
+        Map<String, Object> requestParam = new HashMap<>();
+        requestParam.put("areaCode", "510116999999");
+        requestParam.put("nonce", UUID.randomUUID().toString());
+        requestParam.put("timestamp", System.currentTimeMillis());
+        Map<String, Object> responseData = getMap(requestParam, SNAPSHOT_REPORT_DATA);
+        if (responseData.get("code").equals(200)) {
+            JSONObject dataStr = (JSONObject) responseData.get("data");
+            SnapshotReportDto snapshotReportDto = JSONUtil.toBean(dataStr, SnapshotReportDto.class);
+            return success(snapshotReportDto);
+        } else {
+            return error("同步失败" + responseData.get("message"));
+        }
+
+    }
+    //一键呼叫数据查询接口
+    @Override
+    public AjaxResult getZhwlDeviceData() {
+        Map<String, Object> requestParam = new HashMap<>();
+        requestParam.put("areaCode", "510116999999");
+        requestParam.put("nonce", UUID.randomUUID().toString());
+        requestParam.put("timestamp", System.currentTimeMillis());
+        Map<String, Object> responseData = getMap(requestParam, ZHWL_DEVICE_DATA);
+        if (responseData.get("code").equals(200)) {
+            JSONObject dataStr = (JSONObject) responseData.get("data");
+            ZhwlDeviceDataDto snapshotReportDto = JSONUtil.toBean(dataStr, ZhwlDeviceDataDto.class);
+            return success(snapshotReportDto);
+        } else {
+            return error("同步失败" + responseData.get("message"));
+        }
+
+    }
+    //积分排行数据查询接口
+    @Override
+    public AjaxResult getPointRankData() {
+        Map<String, Object> requestParam = new HashMap<>();
+        requestParam.put("areaCode", "510116999999");
+        requestParam.put("nonce", UUID.randomUUID().toString());
+        requestParam.put("timestamp", System.currentTimeMillis());
+        Map<String, Object> responseData = getMap(requestParam, POINT_RANK_DATA);
+        if (responseData.get("code").equals(200)) {
+            List<JSONObject> dataStr = (List<JSONObject>) responseData.get("data");
+            return success(dataStr);
+        } else {
+            return error("同步失败" + responseData.get("message"));
+        }
+
+    }
+    //文明红榜数据查询接口
+    @Override
+    public AjaxResult getCivilizedData() {
+        Map<String, Object> requestParam = new HashMap<>();
+        requestParam.put("areaCode", "510116999999");
+        requestParam.put("nonce", UUID.randomUUID().toString());
+        requestParam.put("timestamp", System.currentTimeMillis());
+        Map<String, Object> responseData = getMap(requestParam, CIVILIZED_DATA);
+        if (responseData.get("code").equals(200)) {
+            JSONObject dataStr = (JSONObject) responseData.get("data");
+            CivilizedDataDto civilizedDataDto = JSONUtil.toBean(dataStr, CivilizedDataDto.class);
+            return success(civilizedDataDto);
+        } else {
+            return error("同步失败" + responseData.get("message"));
+        }
+    }
+    //先进事迹资讯数据查询接口
+    @Override
+    public AjaxResult getVillageNewsData() {
+        Map<String, Object> requestParam = new HashMap<>();
+        requestParam.put("areaCode", "510116999999");
+        requestParam.put("nonce", UUID.randomUUID().toString());
+        requestParam.put("timestamp", System.currentTimeMillis());
+        Map<String, Object> responseData = getMap(requestParam, VILLAGE_NEWS_DATA);
+        if (responseData.get("code").equals(200)) {
+            System.out.println(responseData);
+//            List<VillageNewsDataDto> dataStr = (List<VillageNewsDataDto>) responseData.get("data");
+            List<VillageNewsDataDto> dataStr =   JSONUtil.toList( (JSONArray) responseData.get("data"), VillageNewsDataDto.class
+                     );
+            return success(dataStr);
+        } else {
+            return error("同步失败" + responseData.get("message"));
+        }
+
+    }
+    //同步人口数据查询接口
+    @Override
+    public AjaxResult syncVillagerData(int type) {
+        Map<String, Object> requestParam = new HashMap<>();
+        requestParam.put("areaCode", "510116999999");
+        requestParam.put("nonce", UUID.randomUUID().toString());
+        requestParam.put("timestamp", System.currentTimeMillis());
+        if (type ==1){
+            Date date =new Date();
+            Date beforeDate = DateUtil.offsetHour(date, -1);
+            requestParam.put("startTime", beforeDate.getTime());
+            requestParam.put("endTime", date.getTime());
+        }
+        Map<String, Object> responseData = getMap(requestParam, VILLAGER_DATA);
+        if (responseData.get("code").equals(200)) {
+            JSONObject dataStr = (JSONObject) responseData.get("data");
+            SyncVillagerDataDto villageNewsDataDto = JSONUtil.toBean(dataStr, SyncVillagerDataDto.class);
+            saveVillager(villageNewsDataDto);
+            return success(villageNewsDataDto);
+        } else {
+            return error("同步失败" + responseData.get("message"));
+        }
+    }
+
+    @Autowired
+    private PersonInfoMapper personInfoMapper;
+    @Autowired
+    private TagsMapper tagsMapper;
+    @Autowired
+    private TagsPersonMapper tagsPersonMapper;
+
+    @Transactional
+    public void saveVillager(SyncVillagerDataDto villageNewsDataDto) {
+
+        //标签
+        savTags(villageNewsDataDto.getTagsList());
+
+        //关联人口标签
+        saveVillagerTag(villageNewsDataDto.getVillagerTagList());
+
+        //人口
+        List<VillagerList> villagerList = villageNewsDataDto.getVillagerList();
+        for (VillagerList list : villagerList) {
+            PersonInfo personInfo = personInfoMapper.selectById(list.getId());
+            if (ObjectUtil.isEmpty(personInfo)){
+                personInfo =  copyVillagerToPerson(personInfo,list);
+                personInfo.setId(list.getId());
+                personInfoMapper.insert(personInfo);
+            }else {
+                personInfo =  copyVillagerToPerson(personInfo,list);
+                personInfo.setId(list.getId());
+                personInfoMapper.updateById(personInfo);
+            }
+        }
+
+
+    }
+
+    private void saveVillagerTag(List<VillagerTagList> villagerTagList) {
+        if (ObjectUtil.isNotEmpty(villagerTagList)){
+            for (VillagerTagList list : villagerTagList) {
+                TagsPerson tags = new TagsPerson();
+                BeanUtil.copyProperties(list, tags);
+                TagsPerson tags1 = tagsPersonMapper.selectById(list.getId());
+                if(ObjectUtil.isEmpty(tags1)){
+                    tagsPersonMapper.insert(tags);
+                }else {
+                    tagsPersonMapper.updateById(tags);
+                }
+            }
+        }
+
+    }
+
+    private void savTags(List<TagsList> tagsList) {
+        if (ObjectUtil.isNotEmpty(tagsList)) {
+            for (TagsList list : tagsList) {
+                Tags tags = new Tags();
+                BeanUtil.copyProperties(list, tags);
+                Tags tags1 = tagsMapper.selectById(list.getId());
+
+                System.out.println(tags);
+                if (ObjectUtil.isEmpty(tags1)) {
+                    tagsMapper.insert(tags);
+                } else {
+                    tagsMapper.updateById(tags);
+                }
+
+            }
+        }
+    }
+
+    private PersonInfo copyVillagerToPerson(PersonInfo personInfo, VillagerList list) {
+        if (ObjectUtil.isEmpty(personInfo)){
+            personInfo  =new PersonInfo();
+        }
+        personInfo.setAge(DateUtil.ageOfNow(list.getBirthday()));
+        personInfo.setBirthDate(DateUtil.parse(list.getBirthday()));
+        personInfo.setEducationLevel(getEduction(list.getEducationLevel()));
+        personInfo.setEthnic(getNation(list.getNation()));
+        if (list.getGender()){
+            personInfo.setGender(2);
+        }else {
+            personInfo.setGender(1);
+        }
+
+//        personInfo.setGrid(list.getBirthday());
+//        personInfo.setHouseholdId(list.getBirthday());
+//        personInfo.setHouseholdRelation(list.getBirthday());
+        personInfo.setIdCard(list.getIdCard());
+        if (ObjectUtil.isNotEmpty(list.getMaritalStatus())){
+            personInfo.setMaritalStatus(list.getMaritalStatus()+1);
+        }
+
+        personInfo.setOccupation(getProfession(list.getProfession()));
+        personInfo.setPhone(list.getPhone());
+//        personInfo.setPhotoUrl(list.getBirthday());
+        personInfo.setPoliticalStatus(getPolitics(list.getPoliticsStatus()));
+        personInfo.setPopulationCategory(list.getType());
+        //TODO 标签
+        List<TagsPerson> villager_id = tagsPersonMapper.selectList(new QueryWrapper<TagsPerson>().eq("villager_id", list.getId()));
+        List tagsList  =new ArrayList();
+        for (TagsPerson tagsPerson : villager_id) {
+            Tags tags = tagsMapper.selectById(tagsPerson.getTagId());
+            tagsList.add(tags.getTagName());
+        }
+        personInfo.setPopulationTags(JSONUtil.toJsonStr(tagsList));
+        personInfo.setRealname(list.getName());
+        personInfo.setReligion(getReligion(list.getReligion()));
+//        personInfo.setSpecialIdentity(list.getBirthday());
+
+        return personInfo;
+    }
+
+    private String getProfession(Integer profession) {
+        if (ObjectUtil.isEmpty(profession)){
+            return null;
+        }
+        //@务农,1务工
+        switch (profession) {
+            case 0:
+                return "务农";
+            case 1:
+                return "务工";
+            default:
+                return "其他";
+        }
+    }
+
+    private String getReligion(Integer religion) {
+        if (ObjectUtil.isEmpty(religion)){
+            return null;
+        }
+        //(0无,1佛教,2基督教,3伊斯兰教,4其他)
+        switch (religion) {
+            case 0:
+                return "无";
+            case 1:
+                return "佛教";
+            case 2:
+                return "基督教";
+            case 3:
+                return "伊斯兰教";
+            case 4:
+                return "其他";
+            default:
+                return "其他";
+
+        }
+    }
+
+    private String getPolitics(Integer politicsStatus) {
+        if (ObjectUtil.isEmpty(politicsStatus)){
+            return null;
+        }
+        //群众,1共青团员,2中共党员,3预备党员,4其它
+        switch (politicsStatus) {
+            case 1:
+                return "共青团员";
+            case 2:
+                return "中共党员";
+            case 3:
+                return "预备党员";
+            case 4:
+                return "其他";
+            default:
+                return "其他";
+
+
+        }
+    }
+
+    private String getNation(Integer nation) {
+        if (ObjectUtil.isEmpty(nation)){
+            return null;
+        }
+        //(0汉族、1壮族、2苗族、3回族、4满族)
+        switch (nation) {
+            case 0:
+                return "汉族";
+            case 1:
+                return "壮族";
+            case 2:
+                return "苗族";
+            case 3:
+                return "回族";
+            case 4:
+                return "满族";
+            default:
+                return "其他";
+
+
+        }
+    }
+
+    private String getEduction(Integer educationLevel) {
+        if (ObjectUtil.isEmpty(educationLevel)){
+            return null;
+        }
+        switch (educationLevel){
+            case 0:
+                return "文盲半文盲";
+            case 1:
+                return "小学";
+            case 2:
+                return "初中";
+            case 3:
+                return "高中";
+            case 4:
+                return "中等职业教育";
+            case 5:
+                return "专科教育";
+            case 6:
+                return "大学本科";
+            case 7:
+                return "硕士";
+            case 8:
+                return "博士";
+            default:
+                return "其他";
+
+
+        }
+    }
+
+    @Autowired
+    private HouseInfoMapper houseInfoMapper;
+    @Autowired
+    private PersonHouseRelationMapper  personHouseRelationMapper;
+    @Autowired
+    private HouseDigitalNumberMapper houseDigitalNumberMapper;
+    @Autowired
+    private HousePictureMapper housePictureMapper;
+    @Autowired
+    private HouseTagMapper houseTagMapper;
+
+
+    //同步房屋数据查询接口
+    @Override
+    public AjaxResult syncHouseData(int type) {
+        Map<String, Object> requestParam = new HashMap<>();
+        requestParam.put("areaCode", "510116999999");
+        requestParam.put("nonce", UUID.randomUUID().toString());
+        requestParam.put("timestamp", System.currentTimeMillis());
+        if (type ==1){
+            Date date =new Date();
+            Date beforeDate = DateUtil.offsetHour(date, -1);
+            requestParam.put("startTime", beforeDate.getTime());
+            requestParam.put("endTime", date.getTime());
+        }
+        Map<String, Object> responseData = getMap(requestParam,HOUSE_DATA);
+        if (responseData.get("code").equals(200)) {
+            JSONObject dataStr = (JSONObject) responseData.get("data");
+            System.out.println(dataStr);
+            HouseData villageNewsDataDto = JSONUtil.toBean(dataStr, HouseData.class);
+            saveHous(villageNewsDataDto);
+            return success(villageNewsDataDto);
+        } else {
+            return error("同步失败" + responseData.get("message"));
+        }
+    }
+    @Transactional
+    public void saveHous(HouseData villageNewsDataDto) {
+        //房屋门牌图片数据
+        saveHouseDigitalNumberPlate(villageNewsDataDto.getHouseDigitalNumberPlateList());
+        saveHousePicture(villageNewsDataDto.getHousePictureList());
+        saveHouseTag(villageNewsDataDto.getHouseTagList());
+        saveHouseVillagerRelation(villageNewsDataDto.getHouseVillagerRelationList());
+
+        savTags(villageNewsDataDto.getTagsList());
+        saveHousInfo(villageNewsDataDto.getHouseList());
+    }
+
+    private void saveHouseVillagerRelation(List<HouseVillagerRelation> houseVillagerRelationList) {
+        for (HouseVillagerRelation list : houseVillagerRelationList) {
+            PersonHouseRelation tags1 = personHouseRelationMapper.selectById(list.getId());
+            if(ObjectUtil.isEmpty(tags1)){
+                tags1  = new PersonHouseRelation();
+                tags1.setId(list.getId());
+                tags1.setPersonId(list.getVillagerId());
+                tags1.setHouseId(list.getHouseId());
+                tags1.setVillagerType(list.getVillagerType());
+                tags1.setCreateTime(new Date(list.getCreateTime()));
+                personHouseRelationMapper.insert(tags1);
+            }else {
+                personHouseRelationMapper.updateById(tags1);
+            }
+
+        }
+
+    }
+
+    private void saveHouseTag(List<HouseTags> houseTagsList) {
+        if (ObjectUtil.isNotEmpty(houseTagsList)){
+            for (HouseTags list : houseTagsList) {
+                HouseTag tags = new HouseTag();
+                BeanUtil.copyProperties(list, tags);
+                HouseTag tags1 = houseTagMapper.selectById(list.getId());
+                if(ObjectUtil.isEmpty(tags1)){
+                    houseTagMapper.insert(tags);
+                }else {
+                    houseTagMapper.updateById(tags);
+                }
+
+            }
+        }
+
+
+    }
+
+    private void saveHousePicture(List<HousePictures> housePicturesList) {
+        if (ObjectUtil.isNotEmpty(housePicturesList)) {
+            if (ObjectUtil.isNotEmpty(housePicturesList)) {
+                for (HousePictures list : housePicturesList) {
+                    HousePicture tags = new HousePicture();
+                    BeanUtil.copyProperties(list, tags);
+                    HousePicture tags1 = housePictureMapper.selectById(list.getId());
+                    if (ObjectUtil.isEmpty(tags1)) {
+                        housePictureMapper.insert(tags);
+                    } else {
+                        housePictureMapper.updateById(tags);
+                    }
+
+                }
+            }
+        }
+    }
+
+
+    private void saveHouseDigitalNumberPlate(List<HouseDigitalNumberPlate> houseDigitalNumberPlateList) {
+        if (ObjectUtil.isNotEmpty(houseDigitalNumberPlateList)) {
+            for (HouseDigitalNumberPlate list : houseDigitalNumberPlateList) {
+                HouseDigitalNumber tags = new HouseDigitalNumber();
+                BeanUtil.copyProperties(list, tags);
+                HouseDigitalNumber tags1 = houseDigitalNumberMapper.selectById(list.getId());
+
+                if (ObjectUtil.isEmpty(tags1)) {
+                    houseDigitalNumberMapper.insert(tags);
+                } else {
+                    houseDigitalNumberMapper.updateById(tags);
+                }
+
+            }
+        }
+    }
+
+    private void saveHousInfo(List<House> houstList) {
+
+        if (ObjectUtil.isNotEmpty(houstList)) {
+            for (House list : houstList) {
+                HouseInfo houseInfo = houseInfoMapper.selectById(list.getId());
+
+                if (ObjectUtil.isEmpty(houseInfo)) {
+                    houseInfo = copylistToHoues(houseInfo, list);
+                    houseInfo.setId(list.getId());
+
+                    houseInfoMapper.insert(houseInfo);
+                } else {
+                    houseInfo = copylistToHoues(houseInfo, list);
+                    houseInfo.setId(list.getId());
+                    houseInfoMapper.updateById(houseInfo);
+                }
+            }
+        }
+    }
+
+    private HouseInfo copylistToHoues(HouseInfo houseInfo, House list) {
+        if (ObjectUtil.isEmpty(houseInfo)){
+            houseInfo = new HouseInfo();
+        }
+        houseInfo.setBuildingArea(list.getHomesteadArea());
+        houseInfo.setCreateTime(new Date(list.getCreateTime()));
+        houseInfo.setDoorplateNumber(list.getHouseNumber());
+        houseInfo.setGrid(list.getGridId()+"");
+        houseInfo.setHouseAddress(list.getAddress());
+//        houseInfo.setHouseCategory(list.getHomesteadArea());
+        houseInfo.setHouseCode(list.getHouseCode());
+        houseInfo.setHouseOwnerId(list.getHouseOwnerId());
+        //TODO 标签
+        List<HouseTag> houseTags = houseTagMapper.selectList(new QueryWrapper<HouseTag>().eq("house_id", list.getId()));
+        List tagsList  =new ArrayList();
+        for (HouseTag tagsPerson : houseTags) {
+            Tags tags = tagsMapper.selectById(tagsPerson.getTagId());
+            tagsList.add(tags.getTagName());
+        }
+        houseInfo.setHouseTags(JSONUtil.toJsonStr(tagsList));
+
+        houseInfo.setId(list.getId());
+
+        //TODO 图片
+        List<HousePicture> housePictures = housePictureMapper.selectList(new QueryWrapper<HousePicture>().eq("house_id", list.getId()));
+        StringBuilder photoUrl = new StringBuilder();
+        for (HousePicture picture : housePictures) {
+            photoUrl.append(picture.getPicture());
+        }
+        houseInfo.setPhotoUrl(photoUrl.toString());
+        System.out.println("1111111111111111"+list.toString());
+        houseInfo.setRemainingPoints( new BigDecimal(list.getPointNow()).setScale(2, RoundingMode.HALF_UP) );
+        houseInfo.setTotalPoints( new BigDecimal(list.getPointTotal()).setScale(2, RoundingMode.HALF_UP));
+        houseInfo.setUpdateTime(new Date(list.getUpdateTime()));
+
+        return houseInfo;
+    }
+
+
+
+
+    //同步补贴数据查询接口
+    @Override
+    public AjaxResult syncAllowanceData(int type) {
+        Map<String, Object> requestParam = new HashMap<>();
+        requestParam.put("areaCode", "510116999999");
+        requestParam.put("nonce", UUID.randomUUID().toString());
+        requestParam.put("timestamp", System.currentTimeMillis());
+        if (type ==1){
+            Date date =new Date();
+            Date beforeDate = DateUtil.offsetHour(date, -1);
+            requestParam.put("startTime", beforeDate.getTime());
+            requestParam.put("endTime", date.getTime());
+        }
+
+        Map<String, Object> responseData = getMap(requestParam,ALLOWANCE_DATA);
+        if (responseData.get("code").equals(200)) {
+            JSONObject dataStr = (JSONObject) responseData.get("data");
+            System.out.println(dataStr);
+            AlllowanceDto villageNewsDataDto = JSONUtil.toBean(dataStr, AlllowanceDto.class);
+            saveSubsidyProjects(villageNewsDataDto);
+            return success(villageNewsDataDto);
+        } else {
+            return error("同步失败" + responseData.get("message"));
+        }
+
+    }
+
+    @Autowired
+    private SubsidyProjectsJianMapper subsidyProjectsJianMapper;
+    @Autowired
+    private SubsidyProjectsMapper subsidyProjectsMapper;
+    private void saveSubsidyProjects(AlllowanceDto villageNewsDataDto) {
+
+        //项目
+        List<CardProject> cardProjectList = villageNewsDataDto.getCardProjectList();
+
+        if (ObjectUtil.isNotEmpty(cardProjectList)) {
+            for (CardProject list : cardProjectList) {
+                SubsidyProjectsJian houseInfo = subsidyProjectsJianMapper.selectById(list.getId());
+                SubsidyProjectsJian subsidyProjectsJian = new SubsidyProjectsJian();
+                BeanUtil.copyProperties(list, subsidyProjectsJian);
+                if (ObjectUtil.isEmpty(houseInfo)) {
+                    subsidyProjectsJianMapper.insert(subsidyProjectsJian);
+                } else {
+                    subsidyProjectsJianMapper.updateById(subsidyProjectsJian);
+                }
+            }
+        }
+        //详细
+        List<CardProjectAllowance> cardProjectAllowanceList = villageNewsDataDto.getCardProjectAllowanceList();
+        for (CardProjectAllowance cardProjectAllowance : cardProjectAllowanceList) {
+            SubsidyProjectsJian subsidyProjectsJian = subsidyProjectsJianMapper.selectById(cardProjectAllowance.getProjectId());
+            SubsidyProjects subsidyProjects = new SubsidyProjects();
+            subsidyProjects.setBankCard(cardProjectAllowance.getBankAccount());
+            subsidyProjects.setCategory(getSubsidyType(subsidyProjectsJian.getAllowanceType()));
+            subsidyProjects.setCreateTime(new Date(cardProjectAllowance.getDefTime()));
+            subsidyProjects.setDate(new Date(cardProjectAllowance.getOfferTime()));
+            subsidyProjects.setId(cardProjectAllowance.getId());
+            subsidyProjects.setIdCard(cardProjectAllowance.getIdCard());
+            subsidyProjects.setMoney(BigDecimal.valueOf(cardProjectAllowance.getAllowance()));
+            subsidyProjects.setName(cardProjectAllowance.getNickName());
+            subsidyProjects.setProjectName(subsidyProjectsJian.getProjectName());
+//            subsidyProjects.setStatus();
+            subsidyProjects.setUpdateTime((new Date(cardProjectAllowance.getUpdTime())));
+            SubsidyProjects subsidyProjects1 = subsidyProjectsMapper.selectById(cardProjectAllowance.getId());
+            if (ObjectUtil.isNotEmpty(subsidyProjects1)){
+                subsidyProjectsMapper.updateById(subsidyProjects);
+            }else {
+                subsidyProjectsMapper.insert(subsidyProjects);
+            }
+        }
+
+    }
+
+    private String getSubsidyType(Integer allowanceType) {
+        if (ObjectUtil.isEmpty(allowanceType)){
+            return null;
+        }
+        //(1:社会保障 2:扶贫开发 3:林业 4:农业,必传)
+        switch (allowanceType) {
+            case 1:
+                return "社会保障";
+            case 2:
+                return "扶贫开发";
+            case 3:
+                return "林业";
+            case 4:
+                return "农业";
+            default:
+                return "其他";
+        }
+    }
+
+
+    private  Map<String, Object> getMap(Map requestParam , String lastUrl  ){
+        try {
+            // AES加密请求参数
+            String encryptedRequest = ChengYanAesUtil.aesEncode(encodeRules, JSONUtil.toJsonStr(requestParam));
+            Map<String, String> httpRequest = new HashMap<>();
+            httpRequest.put("request", encryptedRequest);
+            String url = BASE_URL + lastUrl;
+
+            HttpHeaders headers = new HttpHeaders();
+            headers.setContentType(MediaType.APPLICATION_JSON);
+            headers.set("Client-Id", "web");
+            headers.set("Trace-Id", "trace_" + System.currentTimeMillis()); // 链路追踪ID
+
+            // 2. 创建请求实体(包含头和体)
+            HttpEntity<Object> entity = new HttpEntity<>(httpRequest, headers);
+            // 3. 发送请求
+            ResponseEntity<String> response = restTemplate.postForEntity(
+                    url,
+                    entity,
+                    String.class
+            );
+
+            // AES解密响应
+            Map<String, String> responseMap = JSONUtil.toBean(response.getBody(), Map.class);
+            String decryptedResponse = ChengYanAesUtil.aesDecode(encodeRules, responseMap.get("response"));
+
+            // 解析响应数据
+            Map<String, Object> responseData = JSONUtil.toBean(decryptedResponse, Map.class);
+            return responseData;
+
+        } catch (Exception e) {
+            System.err.println("同步基础数据异常: " + e.getMessage());
+            e.printStackTrace();
+            return null;
+        }
+
+    }
+
+//
+//    public static AjaxResult main(String[] args) {
+//
+//        getBasicData();
+//
+//    }
+}

+ 170 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/service/impl/NationUnityServiceImpl.java

@@ -0,0 +1,170 @@
+package com.ruoyi.web.controller.chenyanlogin.service.impl;
+
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.common.exception.ServiceException;
+import com.ruoyi.web.controller.chenyanlogin.entity.NationUnity;
+import com.ruoyi.web.controller.chenyanlogin.mapper.NationUnityMapper;
+import com.ruoyi.web.controller.chenyanlogin.service.INationUnityService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ruoyi.web.domain.dto.mediaPropaganda.MediaPropagandaAddRequest;
+import com.ruoyi.web.domain.dto.mediaPropaganda.MediaPropagandaEditRequest;
+import com.ruoyi.web.domain.dto.mediaPropaganda.MediaPropagandaQueryRequest;
+import com.ruoyi.web.domain.entity.MediaPropaganda;
+import com.ruoyi.web.domain.vo.MediaPropagandaVO;
+import org.bouncycastle.math.raw.Nat;
+import org.springframework.stereotype.Service;
+
+import java.util.Arrays;
+import java.util.Date;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * <p>
+ * 媒体宣传内容收集表 服务实现类
+ * </p>
+ *
+ * @author author
+ * @since 2025-09-23
+ */
+@Service
+public class NationUnityServiceImpl extends ServiceImpl<NationUnityMapper, NationUnity> implements INationUnityService {
+
+    @Override
+    public Integer addMediaPropaganda(MediaPropagandaAddRequest mediaPropagandaAddRequest) {
+        return null;
+    }
+
+    @Override
+    public boolean deleteMediaPropaganda(String ids) {
+        if (StrUtil.isBlank(ids)) {
+            throw new ServiceException("ID不能为空或ID异常");
+        }
+
+        try {
+            // 分割ID字符串为列表
+            List<Long> idList = Arrays.stream(ids.split(","))
+                    .map(String::trim)
+                    .filter(StrUtil::isNotBlank)
+                    .map(Long::parseLong)
+                    .collect(Collectors.toList());
+
+            if (idList.isEmpty()) {
+                throw new ServiceException("ID格式异常");
+            }
+
+            // 构建删除条件
+            QueryWrapper<NationUnity> queryWrapper = new QueryWrapper<>();
+            queryWrapper.in("id", idList);
+
+            // 执行删除(返回是否删除成功)
+            return remove(queryWrapper);
+        } catch (NumberFormatException e) {
+            log.error("删除媒体宣传内容失败,ID格式错误", e);
+            throw new ServiceException("ID格式错误");
+        } catch (Exception e) {
+            log.error("删除媒体宣传内容失败", e);
+            throw new ServiceException("删除媒体宣传内容失败: " + e.getMessage());
+        }
+    }
+
+    @Override
+    public void editMediaPropaganda(MediaPropagandaEditRequest mediaPropagandaEditRequest) {
+
+    }
+
+    @Override
+    public MediaPropagandaVO getMediaPropagandaById(int id) {
+        return null;
+    }
+
+    @Override
+    public Page<MediaPropagandaVO> getListMediaPropagandaByPage(MediaPropagandaQueryRequest mediaPropagandaQueryRequest) {
+        if (mediaPropagandaQueryRequest == null) {
+            throw new ServiceException("查询参数为空");
+        }
+
+        try {
+            // 1. 构建查询条件
+            QueryWrapper<NationUnity> queryWrapper = getQueryWrapper(mediaPropagandaQueryRequest);
+
+            // 2. 执行分页查询
+            Page<NationUnity> page = new Page<>(mediaPropagandaQueryRequest.getPageNum(), mediaPropagandaQueryRequest.getPageSize());
+            Page<NationUnity> mediaPropagandaPage = this.page(page, queryWrapper);
+
+            // 3. 转换为VO
+            Page<MediaPropagandaVO> voPage = new Page<>();
+            BeanUtil.copyProperties(mediaPropagandaPage, voPage);
+
+            List<MediaPropagandaVO> voList = mediaPropagandaPage.getRecords().stream()
+                    .map(this::getMediaPropagandaVO)
+                    .collect(Collectors.toList());
+            voPage.setRecords(voList);
+
+            return voPage;
+        } catch (Exception e) {
+            log.error("分页查询媒体宣传内容失败", e);
+            throw new ServiceException("分页查询媒体宣传内容失败: " + e.getMessage());
+        }
+    }
+    @Override
+    public MediaPropagandaVO getMediaPropagandaVO(NationUnity mediaPropaganda) {
+        if (mediaPropaganda == null) {
+            return null;
+        }
+
+        try {
+            MediaPropagandaVO mediaPropagandaVO = new MediaPropagandaVO();
+            BeanUtil.copyProperties(mediaPropaganda, mediaPropagandaVO);
+            return mediaPropagandaVO;
+        } catch (Exception e) {
+            log.error("转换媒体宣传内容VO失败", e);
+            throw new ServiceException("转换媒体宣传内容VO失败: " + e.getMessage());
+        }
+    }
+    public QueryWrapper<NationUnity> getQueryWrapper(MediaPropagandaQueryRequest mediaPropagandaQueryRequest) {
+        QueryWrapper<NationUnity> queryWrapper = new QueryWrapper<>();
+        Date extractStartTime = mediaPropagandaQueryRequest.getExtractStartTime();
+        Date extractEndTime = mediaPropagandaQueryRequest.getExtractEndTime();
+        Date publishStartTime = mediaPropagandaQueryRequest.getPublishStartTime();
+        Date publishEndTime = mediaPropagandaQueryRequest.getPublishEndTime();
+        String keyword = mediaPropagandaQueryRequest.getKeyword();
+        String sortField = mediaPropagandaQueryRequest.getSortField();
+        String sortOrder = mediaPropagandaQueryRequest.getSortOrder();
+
+        // 关键词搜索(标题或内容)
+        if (StrUtil.isNotBlank(mediaPropagandaQueryRequest.getKeyword())) {
+            queryWrapper.and(wrapper -> wrapper
+                    .like("title", keyword)
+                    .or()
+                    .like("content", keyword)
+            );
+        }
+
+        // 摘录日期范围查询
+        if (ObjectUtil.isNotNull(mediaPropagandaQueryRequest.getExtractStartTime())) {
+            queryWrapper.ge("extract_date", extractStartTime);
+        }
+        if (ObjectUtil.isNotNull(mediaPropagandaQueryRequest.getExtractEndTime())) {
+            queryWrapper.le("extract_date", extractEndTime);
+        }
+
+        // 发布日期范围查询
+        if (ObjectUtil.isNotNull(mediaPropagandaQueryRequest.getPublishStartTime())) {
+            queryWrapper.ge("publish_date", publishStartTime);
+        }
+        if (ObjectUtil.isNotNull(mediaPropagandaQueryRequest.getPublishEndTime())) {
+            queryWrapper.le("publish_date", publishEndTime);
+        }
+
+        // 排序
+        queryWrapper.orderBy(StrUtil.isNotEmpty(sortField), "ascend".equals(sortOrder), sortField);
+
+
+        return queryWrapper;
+    }
+}

+ 20 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/service/impl/SubsidyProjectsJianServiceImpl.java

@@ -0,0 +1,20 @@
+package com.ruoyi.web.controller.chenyanlogin.service.impl;
+
+import com.ruoyi.web.controller.chenyanlogin.entity.SubsidyProjectsJian;
+import com.ruoyi.web.controller.chenyanlogin.mapper.SubsidyProjectsJianMapper;
+import com.ruoyi.web.controller.chenyanlogin.service.ISubsidyProjectsJianService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author author
+ * @since 2025-09-20
+ */
+@Service
+public class SubsidyProjectsJianServiceImpl extends ServiceImpl<SubsidyProjectsJianMapper, SubsidyProjectsJian> implements ISubsidyProjectsJianService {
+
+}

+ 20 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/service/impl/TagsPersonServiceImpl.java

@@ -0,0 +1,20 @@
+package com.ruoyi.web.controller.chenyanlogin.service.impl;
+
+import com.ruoyi.web.controller.chenyanlogin.entity.TagsPerson;
+import com.ruoyi.web.controller.chenyanlogin.mapper.TagsPersonMapper;
+import com.ruoyi.web.controller.chenyanlogin.service.ITagsPersonService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author author
+ * @since 2025-09-20
+ */
+@Service
+public class TagsPersonServiceImpl extends ServiceImpl<TagsPersonMapper, TagsPerson> implements ITagsPersonService {
+
+}

+ 20 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/service/impl/TagsServiceImpl.java

@@ -0,0 +1,20 @@
+package com.ruoyi.web.controller.chenyanlogin.service.impl;
+
+import com.ruoyi.web.controller.chenyanlogin.entity.Tags;
+import com.ruoyi.web.controller.chenyanlogin.mapper.TagsMapper;
+import com.ruoyi.web.controller.chenyanlogin.service.ITagsService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author author
+ * @since 2025-09-20
+ */
+@Service
+public class TagsServiceImpl extends ServiceImpl<TagsMapper, Tags> implements ITagsService {
+
+}

+ 76 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/timer/GetCameraPreviewURL.java

@@ -0,0 +1,76 @@
+package com.ruoyi.web.controller.chenyanlogin.timer;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.hikvision.artemis.sdk.ArtemisHttpUtil;
+import com.hikvision.artemis.sdk.config.ArtemisConfig;
+
+import java.util.HashMap;
+import java.util.Map;
+
+
+public  class GetCameraPreviewURL {
+
+    public   static   String GetCameraPreviewURL(String url,String body) throws Exception {
+
+        /**
+        * STEP1:设置平台参数,根据实际情况,设置host appkey appsecret 三个参数.
+        */
+        ArtemisConfig artemisConfig = new ArtemisConfig("218.203.180.136:10043",
+                "29243872",
+                "RyS0Aihgt7jP4EaK0bJ5");
+
+
+            /**
+            * STEP2:设置OpenAPI接口的上下文
+            */
+            final String ARTEMIS_PATH = "/artemis";
+
+            /**
+            * STEP3:设置接口的URI地址
+            */
+             String previewURLsApi = ARTEMIS_PATH + url ;
+
+            Map <String, String> path = new HashMap <String, String>(2) {
+            {
+                put("https://", previewURLsApi);//根据现场环境部署确认是http还是https
+            }
+            };
+
+            /**
+            * STEP4:设置参数提交方式
+            */
+            String contentType = "application/json";
+
+            /**
+            * STEP5:组装请求参数
+            */
+
+
+            /**
+            * STEP6:调用接口
+            */
+
+            String result = ArtemisHttpUtil.doPostStringArtemis(artemisConfig,path, body, null, null,
+            contentType , null);// post请求application/json类型参数
+            return result;
+        }
+
+        public static   void main(String[] args) throws Exception {
+
+
+            JSONObject jsonBody = new JSONObject();
+            jsonBody.put("cameraIndexCode", "cameraIndexCode");
+            jsonBody.put("streamType", 0);
+            jsonBody.put("protocol", "hls");
+            jsonBody.put("transmode", 0);
+            jsonBody.put("streamform", "ps");
+
+            String body = jsonBody.toJSONString();
+
+            String getCameraPreviewURL = GetCameraPreviewURL.GetCameraPreviewURL("/api/video/v2/cameras/previewURLs", body);
+            Map<String,Object> cameraResponse = JSON.parseObject(getCameraPreviewURL, Map.class);
+
+
+        }
+}

+ 90 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/timer/GetHuivCunTimer.java

@@ -0,0 +1,90 @@
+package com.ruoyi.web.controller.chenyanlogin.timer;
+
+import cn.hutool.json.JSONUtil;
+import com.ruoyi.common.core.domain.R;
+import com.ruoyi.web.controller.chenyanlogin.service.HuiCunService;
+import org.apache.commons.collections4.Get;
+import org.checkerframework.checker.units.qual.A;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.web.client.RestTemplate;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
+
+@Configuration
+@EnableScheduling
+public class GetHuivCunTimer {
+
+    @Autowired
+    private HuiCunService huiCunService;
+
+    //基础数据查询接口
+    @Scheduled(cron = "0 0 * * * ? ")
+    public  void getBasicData(){
+        huiCunService.getBasicData();
+
+    }
+    //关爱人群数据查询接口
+    @Scheduled(cron = "0 0 * * * ? ")
+    public  void getCarePeopleData(){
+        huiCunService.getCarePeopleData();
+    }
+
+    //事件上报数据查询接口
+    @Scheduled(cron = "0 0 * * * ? ")
+    public  void getSnapshotReportData(){
+        huiCunService.getSnapshotReportData();
+    }
+
+    //一键呼叫数据查询接口
+    @Scheduled(cron = "0 0 * * * ? ")
+    public  void getZhwlDeviceData(){
+        huiCunService.getZhwlDeviceData();
+    }
+
+    //积分排行数据查询接口
+    @Scheduled(cron = "0 0 * * * ? ")
+    public  void getPointRankData(){
+        huiCunService.getPointRankData();
+    }
+
+    //文明红榜数据查询接口
+    @Scheduled(cron = "0 0 * * * ? ")
+    public  void getCivilizedData(){
+        huiCunService.getCivilizedData();
+    }
+
+    //先进事迹资讯数据查询接口
+    @Scheduled(cron = "0 0 * * * ? ")
+    public  void getVillageNewsData(){
+        huiCunService.getVillageNewsData();
+    }
+
+    //同步人口数据查询接口
+    @Scheduled(cron = "0 0 * * * ? ")
+    public  void syncVillagerData(){
+        huiCunService.syncVillagerData(1);
+    }
+
+    //同步房屋数据查询接口
+    @Scheduled(cron = "0 0 * * * ? ")
+    public  void syncHouseData(){
+        huiCunService.syncHouseData(1);
+    }
+
+    //同步补贴数据查询接口
+    @Scheduled(cron = "0 0 * * * ? ")
+    public  void syncAllowanceData(){
+        huiCunService.syncAllowanceData(1);
+    }
+
+
+}

+ 93 - 0
app-admin/src/main/java/com/ruoyi/web/controller/chenyanlogin/timer/HaiKangTimer.java

@@ -0,0 +1,93 @@
+package com.ruoyi.web.controller.chenyanlogin.timer;
+
+
+
+
+import cn.hutool.core.util.ObjectUtil;
+import com.alibaba.fastjson.JSONObject;
+import com.ruoyi.web.controller.chenyanlogin.haikang.CameraInfo;
+import com.ruoyi.web.controller.chenyanlogin.haikang.CameraResponse;
+import com.ruoyi.web.controller.chenyanlogin.haikang.CameraStatusData;
+import com.ruoyi.web.controller.chenyanlogin.haikang.CameraStatusResponse;
+import com.ruoyi.web.domain.entity.LotVideo;
+import com.ruoyi.web.service.LotVideoService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.scheduling.annotation.Scheduled;
+import com.alibaba.fastjson.JSON;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.CrossOrigin;
+
+import javax.xml.crypto.Data;
+import java.util.ArrayList;
+import java.util.List;
+
+@Configuration
+@EnableScheduling
+@CrossOrigin
+public class HaiKangTimer {
+
+    @Autowired
+    private LotVideoService lotVideoService;
+
+   private  String camerList =  "/api/resource/v1/camera/advance/cameraList";
+    private  String  cameras =  "/api/resource/v1/cameras/indexCode";
+//   private  String  =  "/api/resource/v1/camera/advance/cameraList";
+    //获取所有监控
+    @Transactional
+    @Scheduled(cron = "0 0 0 * * ? ")
+    public  void listCamerList() throws Exception {
+        JSONObject jsonBody = new JSONObject();
+        jsonBody.put("pageNo", 1);
+        jsonBody.put("pageSize", 100);
+        jsonBody.put("isCascade", 0);
+
+        String body = jsonBody.toJSONString();
+        String getCameraPreviewURL = GetCameraPreviewURL.GetCameraPreviewURL(camerList, body);
+        System.out.println(getCameraPreviewURL);
+        CameraResponse cameraResponse = JSON.parseObject(getCameraPreviewURL, CameraResponse.class);
+        if (ObjectUtil.isNotEmpty(cameraResponse) && "0".equals(cameraResponse.getCode())){
+            List<CameraInfo> list = cameraResponse.getData().getList();
+            lotVideoService.remove(null);
+            for (CameraInfo cameraInfo : list) {
+                LotVideo video = new LotVideo();
+                video.setCreateTime(cameraInfo.getCreateTime());
+                video.setName(cameraInfo.getCameraName());
+                video.setLocation(cameraInfo.getCameraName());
+                video.setUpdateTime(cameraInfo.getUpdateTime());
+                video.setRegionIndexCode(cameraInfo.getRegionIndexCode());
+                video.setCameraIndexCode(cameraInfo.getCameraIndexCode());
+                video.setCapabilitySetName(cameraInfo.getCapabilitySetName());
+                video.setEncodeDevIndexCode(cameraInfo.getEncodeDevIndexCode());
+                lotVideoService.save(video);
+            }
+        }
+
+    }
+
+    //获取状态
+    @Scheduled(cron = "0 0 0 * * ? ")
+//    @Scheduled(cron = "0 * * * * ? ")
+    public  void statusCamerList() throws Exception {
+        List<LotVideo> list1 = lotVideoService.list();
+        for (LotVideo video : list1) {
+            System.out.println("----->"+video.toString());
+            JSONObject jsonBody = new JSONObject();
+            jsonBody.put("cameraIndexCode",  video.getCameraIndexCode());
+            String body = jsonBody.toJSONString();
+            String getCameraPreviewURL = GetCameraPreviewURL.GetCameraPreviewURL(cameras, body);
+            CameraStatusResponse cameraResponse = JSON.parseObject(getCameraPreviewURL, CameraStatusResponse.class);
+            if (ObjectUtil.isNotEmpty(cameraResponse) && "0".equals(cameraResponse.getCode())){
+                CameraStatusData data = cameraResponse.getData();
+                if (!(video.getStatus() + "").equals(data.getStatus())){
+                    video.setStatus(Integer.parseInt(data.getStatus()));
+                    lotVideoService.updateById(video);
+                };
+            }
+        }
+    }
+
+
+
+}

+ 191 - 0
app-admin/src/main/java/com/ruoyi/web/controller/screen/ScreenController.java

@@ -0,0 +1,191 @@
+package com.ruoyi.web.controller.screen;
+
+import cn.hutool.core.date.DateField;
+import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.util.ObjectUtil;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.web.controller.chenyanlogin.dto.VillageNewsDataDto;
+import com.ruoyi.web.controller.screen.dto.VillageServiceDto;
+import com.ruoyi.web.controller.screen.vo.ZhongZhiQuXianVo;
+import com.ruoyi.web.domain.dto.Industry.IndustryDataQueryRequest;
+import com.ruoyi.web.domain.dto.warning.drowningWarning.DrowningWarningQueryRequest;
+import com.ruoyi.web.domain.entity.*;
+import com.ruoyi.web.domain.vo.DrowningWarningVO;
+import com.ruoyi.web.domain.vo.FacilityManagement.BaseFacilityVO;
+import com.ruoyi.web.domain.vo.TimeAndValueVo.TimeAndValueVo;
+import com.ruoyi.web.service.*;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import static com.ruoyi.common.core.domain.AjaxResult.error;
+import static com.ruoyi.common.core.domain.AjaxResult.success;
+
+
+@Api(tags ="大屏接口")
+@RestController
+@RequestMapping("/screen")
+public class ScreenController {
+    @Autowired
+    private IndustryDataService industryDataService;
+    @Autowired
+    private VillageServiceService villageServiceService;
+    @Autowired
+    private VillageTraditionService villageTraditionService;
+    @Autowired
+    private FacilityManagementService facilityManagementService;
+
+    /**
+
+     * @return
+     */
+    @ApiOperation("大屏主要产业数据年份分组列表")
+    @GetMapping("/listGroupByYear")
+    public AjaxResult listGroupByYear() {
+        List<TimeAndValueVo> listIndustryDataByPage = industryDataService.  listGroupByYear();
+        int year = DateUtil.year(new Date());
+        int lastYear = DateUtil.year(DateUtil.offset(new Date(), DateField.YEAR,-1));
+        TimeAndValueVo timeAndValueVo = industryDataService.listGroupByYearTwo(year);
+        TimeAndValueVo timeAndValueVo2 = industryDataService.listGroupByYearTwo(lastYear);
+        Map<String,Object> map = new HashMap<>();
+        map.put("industryList",listIndustryDataByPage);
+        map.put("now",timeAndValueVo.getYvalue());
+        String yvalue = ObjectUtil.isNotEmpty(timeAndValueVo2) ?timeAndValueVo2.getYvalue(): "0";
+        String yvalue1 = ObjectUtil.isNotEmpty(timeAndValueVo) ?timeAndValueVo.getYvalue(): "0";
+
+        Double aDouble = calculateGrowthRate(Double.parseDouble(yvalue), Double.parseDouble(yvalue1));
+        if (aDouble != null) {
+            map.put("rate",String.format("%.2f",aDouble));
+        }else {
+            map.put("rate","--");
+        }
+        return success(map);
+    }
+    public static Double calculateGrowthRate(Double oldValue, Double newValue) {
+        if (oldValue == null || newValue == null) {
+            return null;
+        }
+        if (oldValue == 0) {
+            return null; // 或者返回Double.POSITIVE_INFINITY/Double.NEGATIVE_INFINITY,取决于业务需求
+        }
+        return ((newValue - oldValue) / oldValue) * 100;
+    }
+    /**
+     * @return
+     */
+    @ApiOperation("产业服务与支持")
+    @GetMapping("/villageService")
+    public AjaxResult villageService() {
+        VillageServiceDto villageServiceDto = new VillageServiceDto();
+
+        villageServiceDto.setPeiXun(villageServiceService.list(new QueryWrapper<VillageService>().eq("tag", 1).orderByDesc("id")));
+        villageServiceDto.setFuChi(villageServiceService.list(new QueryWrapper<VillageService>().eq("tag", 2).orderByDesc("id")));
+        return success(villageServiceDto);
+    }
+    /**
+     * @return
+     */
+    @ApiOperation("种植产业品种")
+    @GetMapping("/zhongZhiPingZhong")
+    public AjaxResult zhongZhiPingZhong() {
+        return success( villageTraditionService.zhongZhiPingZhong());
+    }
+
+    /**
+     * @return
+     */
+    @ApiOperation("种植产业曲线")
+    @PostMapping("/zhongZhiQuXian")
+    public AjaxResult zhongZhiQuXian(@RequestBody ZhongZhiQuXianVo zhongZhiQuXianVo) {
+        return success( villageTraditionService.zhongZhiQuXian(zhongZhiQuXianVo));
+    }
+    /**
+     * @return
+     */
+    @ApiOperation("养殖产业曲线")
+    @PostMapping("/yagnZhiQuXian")
+    public AjaxResult yagnZhiQuXian() {
+        return success( villageTraditionService.yagnZhiQuXian());
+    }
+
+    /**
+     * @return
+     */
+    @ApiOperation("劳务产业曲线")
+    @PostMapping("/laoWuChanYe")
+    public AjaxResult laoWuChanYe() {
+        List<TimeAndValueVo> listIndustryDataByPage = industryDataService.listLaoWu();
+        return success(listIndustryDataByPage);
+    }
+
+
+    @ApiOperation("根据id获取设施")
+    @GetMapping("/getSheShi")
+    public AjaxResult getFacilityById(@RequestParam int id) {
+        if (ObjectUtil.isEmpty(id)) {
+            return error("请求参数为空");
+        }
+        BaseFacilityVO facilityVO = facilityManagementService.getFacilityById(id);
+        return success(facilityVO);
+    }
+    @Autowired
+    private EthnicActivitiesService ethnicActivitiesService;
+
+    @ApiOperation("民族活动")
+    @GetMapping("/minZhuHuoDong")
+    public AjaxResult minZhuHuoDong() {
+        return success(ethnicActivitiesService.list(new QueryWrapper<EthnicActivities>().eq("status",0)));
+    }
+
+    @Autowired
+    private MediaPropagandaService mediaPropagandaService;
+
+    @ApiOperation("民族宣传")
+    @GetMapping("/mingZhuXvuanChuan")
+    public AjaxResult mingZhuXvuanChuan() {
+        return success(mediaPropagandaService.list(new QueryWrapper<MediaPropaganda>().orderByDesc("id")));
+    }
+
+    @Autowired
+    private EarthquakeWarningService earthquakeWarningService;
+
+    @ApiOperation("地震灾害")
+    @GetMapping("/diZhenZhaiHai")
+    public AjaxResult diZhenZhaiHai() {
+        return success(earthquakeWarningService.list(new QueryWrapper<EarthquakeWarning>().orderByDesc("id").last("limit 1")));
+    }
+
+    @Autowired
+    private LotEnvironmentService lotEnvironmentService;
+    @ApiOperation("河流数据")
+    @GetMapping("/heLiuQuXian")
+    public AjaxResult heLiuQuXian() {
+        return success(lotEnvironmentService.heLiuQuXian());
+    }
+    //drowning_warning
+    @Autowired
+    private DrowningWarningService drowningWarningService;
+    /**
+     *
+     * @param drowningWarningQueryRequest
+     * @return
+     */
+    @ApiOperation("分页获取防溺水预警列表")
+    @PostMapping("/list/page")
+    public AjaxResult listDrowningWarningByPage(@RequestBody DrowningWarningQueryRequest drowningWarningQueryRequest) {
+        if (drowningWarningQueryRequest == null) {
+            return error("请求参数为空");
+        }
+        Page<DrowningWarningVO> listDrowningWarningVOByPage = drowningWarningService.getListDrowningWarningByPage(drowningWarningQueryRequest);
+        return success(listDrowningWarningVOByPage);
+    }
+
+}

+ 9 - 0
app-admin/src/main/java/com/ruoyi/web/controller/screen/dto/HeLiuQuXian.java

@@ -0,0 +1,9 @@
+package com.ruoyi.web.controller.screen.dto;
+
+import lombok.Data;
+
+@Data
+public class HeLiuQuXian {
+    private String  yyear;
+    private String  yvalue;
+}

+ 14 - 0
app-admin/src/main/java/com/ruoyi/web/controller/screen/dto/VillageServiceDto.java

@@ -0,0 +1,14 @@
+package com.ruoyi.web.controller.screen.dto;
+
+import com.ruoyi.web.domain.entity.VillageService;
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+@ApiModel
+public class VillageServiceDto {
+    private List<VillageService> peiXun;
+    private List<VillageService> fuChi;
+}

+ 12 - 0
app-admin/src/main/java/com/ruoyi/web/controller/screen/dto/YangZhiQuXian.java

@@ -0,0 +1,12 @@
+package com.ruoyi.web.controller.screen.dto;
+
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class YangZhiQuXian {
+    private String variety;
+    private List<YangZhiQuXian2> data;
+
+}

+ 9 - 0
app-admin/src/main/java/com/ruoyi/web/controller/screen/dto/YangZhiQuXian2.java

@@ -0,0 +1,9 @@
+package com.ruoyi.web.controller.screen.dto;
+
+import lombok.Data;
+
+@Data
+public class YangZhiQuXian2 {
+    private String  yyear;
+    private String  yvalue;
+}

+ 13 - 0
app-admin/src/main/java/com/ruoyi/web/controller/screen/dto/ZhongQuXianDto.java

@@ -0,0 +1,13 @@
+package com.ruoyi.web.controller.screen.dto;
+
+import lombok.Data;
+
+import java.util.Map;
+
+@Data
+public class ZhongQuXianDto {
+    private String yyear;
+    private String chanZhi;
+    private String mianJi;
+    private String variety;
+}

+ 8 - 0
app-admin/src/main/java/com/ruoyi/web/controller/screen/vo/ZhongZhiQuXianVo.java

@@ -0,0 +1,8 @@
+package com.ruoyi.web.controller.screen.vo;
+
+import lombok.Data;
+
+@Data
+public class ZhongZhiQuXianVo {
+    private String pingZhongName;
+}

+ 8 - 2
app-admin/src/main/java/com/ruoyi/web/controller/system/EmergencyUserController.java

@@ -6,6 +6,7 @@ import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.core.domain.entity.SysUser;
 import com.ruoyi.common.exception.ServiceException;
 import com.ruoyi.system.mapper.SysUserMapper;
+import com.ruoyi.system.service.ISysUserService;
 import com.ruoyi.web.domain.dto.emergencyUser.EmergencyUserAddRequest;
 import com.ruoyi.web.domain.entity.EmergencyUser;
 import com.ruoyi.web.domain.entity.PersonInfo;
@@ -36,6 +37,9 @@ public class EmergencyUserController {
     @Autowired
     private EmergencyUserService emergencyUserService;
 
+
+    @Autowired
+    private ISysUserService sysUserService;
     @Autowired
     private PersonInfoService personInfoService;
 
@@ -129,13 +133,13 @@ public class EmergencyUserController {
     @PostMapping("/list")
     public AjaxResult listEmergencyUserByPage() {
         List<EmergencyUser> list = emergencyUserService.list();
+
         // 收集所有用户ID
         List<Long> userIds = list.stream()
                 .map(emergencyUser -> Long.valueOf(emergencyUser.getUserId()))
                 .collect(Collectors.toList());
         // 批量查询用户信息
         List<SysUser> sysUsers = sysUserMapper.selectUsersByIds(userIds);
-
         // 创建用户ID->昵称的映射
         Map<Long, String> userNickNameMap = sysUsers.stream()
                 .collect(Collectors.toMap(SysUser::getUserId, SysUser::getNickName));
@@ -149,7 +153,9 @@ public class EmergencyUserController {
             emergencyUserVO.setId(emergencyUser.getId());
             return emergencyUserVO;
         }).collect(Collectors.toList());
-        return success(emergencyUserVOList);
+//        sysUserMapper.selectUserList();
+//        return success(emergencyUserVOList);
+        return success( sysUserService.selectUserList(new SysUser()));
 
 
 //        List<EmergencyUserVO> emergencyUserVOList = list.stream().map(emergencyUser -> {

+ 14 - 1
app-admin/src/main/java/com/ruoyi/web/controller/system/HouseInfoController.java

@@ -39,7 +39,7 @@ public class HouseInfoController {
         if (houseInfoAddRequest == null) {
             return error("请求参数为空");
         }
-        Integer id = houseInfoService.addHouseInfo(houseInfoAddRequest);
+        Long id = houseInfoService.addHouseInfo(houseInfoAddRequest);
         return success(id);
     }
 
@@ -111,4 +111,17 @@ public class HouseInfoController {
         Page<HouseInfoVO> listHouseInfoByPage = houseInfoService.getListHouseInfoByPage(houseInfoQueryRequest);
         return success(listHouseInfoByPage);
     }
+
+
+    @ApiOperation("获取房屋列表")
+    @GetMapping("/list/list")
+    public AjaxResult list() {
+        return success(houseInfoService.list());
+    }
+
+    @ApiOperation("获取房屋详情")
+    @PostMapping("/getHouseInfoBy")
+    public AjaxResult getHouseInfoBy(@RequestBody Map<String ,Integer> map ) {
+        return success(houseInfoService.getHouseInfoBy(map.get("id")));
+    }
 }

+ 3 - 0
app-admin/src/main/java/com/ruoyi/web/controller/system/IndustryController.java

@@ -8,12 +8,14 @@ import com.ruoyi.web.domain.dto.Industry.IndustryDataAddRequest;
 import com.ruoyi.web.domain.dto.Industry.IndustryDataEditRequest;
 import com.ruoyi.web.domain.dto.Industry.IndustryDataQueryRequest;
 import com.ruoyi.web.domain.entity.IndustryData;
+import com.ruoyi.web.domain.vo.TimeAndValueVo.TimeAndValueVo;
 import com.ruoyi.web.service.IndustryDataService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.List;
 import java.util.Map;
 
 import static com.ruoyi.common.core.domain.AjaxResult.error;
@@ -111,4 +113,5 @@ public class IndustryController {
         Page<IndustryData> listIndustryDataByPage = industryDataService.getListIndustryDataByPage(industryDataQueryRequest);
         return success(listIndustryDataByPage);
     }
+
 }

+ 0 - 0
app-admin/src/main/java/com/ruoyi/web/controller/system/LotPlatformDeviceController.java


Some files were not shown because too many files changed in this diff