瀏覽代碼

Merge branch 'master' into feature-flow

# Conflicts:
#	bd-park/park-backend/park-core/src/main/java/com/huashe/park/core/service/impl/ConsUnitInfoServiceImpl.java
#	bd-park/park-backend/pom.xml
#	common-application/pom.xml
chen.cheng 2 月之前
父節點
當前提交
28aa10454d
共有 100 個文件被更改,包括 2748 次插入1571 次删除
  1. 15 6
      bd-park/park-backend/park-application/src/main/java/com/huashe/park/application/BDApplication.java
  2. 15 8
      bd-park/park-backend/park-application/src/main/java/com/huashe/park/application/web/controller/cons/ConsUnitInfoController.java
  3. 41 16
      bd-park/park-backend/park-application/src/main/java/com/huashe/park/application/web/controller/cons/PileMachineInfoController.java
  4. 3 3
      bd-park/park-backend/park-application/src/main/java/com/huashe/park/application/web/controller/cons/ProjectInfoController.java
  5. 3 0
      bd-park/park-backend/park-application/src/main/java/com/huashe/park/application/web/controller/system/SysCustConfigController.java
  6. 102 0
      bd-park/park-backend/park-application/src/main/java/com/huashe/park/application/web/controller/system/SysTenantController.java
  7. 49 59
      bd-park/park-backend/park-application/src/main/java/com/huashe/park/application/web/controller/system/SysUserController.java
  8. 1 1
      bd-park/park-backend/park-application/src/main/resources/application-hm.yml
  9. 4 0
      bd-park/park-backend/park-application/src/main/resources/application.yml
  10. 2 0
      bd-park/park-backend/park-application/src/main/resources/i18n/messages_en.properties
  11. 3 1
      bd-park/park-backend/park-application/src/main/resources/i18n/messages_zh.properties
  12. 66 40
      bd-park/park-backend/park-application/src/main/resources/logback.xml
  13. 1 1
      bd-park/park-backend/park-collect/src/main/java/com/huashe/park/collect/SpingMqttApplication.java
  14. 81 0
      bd-park/park-backend/park-collect/src/main/java/com/huashe/park/collect/config/TopicDataCfg.java
  15. 60 1
      bd-park/park-backend/park-collect/src/main/java/com/huashe/park/collect/controller/TopicController.java
  16. 1 8
      bd-park/park-backend/park-collect/src/main/java/com/huashe/park/collect/core/TopicMsgEngine.java
  17. 0 24
      bd-park/park-backend/park-collect/src/main/java/com/huashe/park/collect/event/EventPublisherService.java
  18. 148 44
      bd-park/park-backend/park-collect/src/main/java/com/huashe/park/collect/event/MachineRealtimeEventListener.java
  19. 0 22
      bd-park/park-backend/park-collect/src/main/java/com/huashe/park/collect/event/PileMachineConsRealtimeEvent.java
  20. 0 22
      bd-park/park-backend/park-collect/src/main/java/com/huashe/park/collect/event/PileMachineConsResultEvent.java
  21. 29 89
      bd-park/park-backend/park-collect/src/main/java/com/huashe/park/collect/handle/RootMsgHandler.java
  22. 0 59
      bd-park/park-backend/park-collect/src/main/java/com/huashe/park/collect/model/MqttRequest.java
  23. 16 0
      bd-park/park-backend/park-collect/src/main/java/com/huashe/park/collect/model/TopicVO.java
  24. 93 0
      bd-park/park-backend/park-collect/src/main/resources/application-local.yml
  25. 1 1
      bd-park/park-backend/park-collect/src/main/resources/application-pre.yml
  26. 1 1
      bd-park/park-backend/park-collect/src/main/resources/application.yml
  27. 25 2
      bd-park/park-backend/park-collect/src/main/resources/logback.xml
  28. 136 0
      bd-park/park-backend/park-collect/src/test/java/com/huashe/park/collect/controller/TopicControllerTest.java
  29. 31 0
      bd-park/park-backend/park-common/pom.xml
  30. 101 2
      bd-park/park-backend/park-common/src/main/java/com/huashe/park/common/ByteArrayUtil.java
  31. 14 0
      bd-park/park-backend/park-common/src/main/java/com/huashe/park/common/animations/FixedLength.java
  32. 5 0
      bd-park/park-backend/park-common/src/main/java/com/huashe/park/common/animations/mybatis/Converter.java
  33. 20 0
      bd-park/park-backend/park-common/src/main/java/com/huashe/park/common/animations/mybatis/ConverterCache.java
  34. 34 0
      bd-park/park-backend/park-common/src/main/java/com/huashe/park/common/animations/mybatis/FieldMetadataCache.java
  35. 39 0
      bd-park/park-backend/park-common/src/main/java/com/huashe/park/common/animations/mybatis/MethodMetadataCache.java
  36. 15 0
      bd-park/park-backend/park-common/src/main/java/com/huashe/park/common/animations/mybatis/emuns/FieldConvert.java
  37. 16 0
      bd-park/park-backend/park-common/src/main/java/com/huashe/park/common/animations/mybatis/service/JsonConverter.java
  38. 14 0
      bd-park/park-backend/park-common/src/main/java/com/huashe/park/common/consts/RedisKey.java
  39. 82 0
      bd-park/park-backend/park-common/src/main/java/com/huashe/park/common/consts/enums/ConsResult.java
  40. 18 0
      bd-park/park-backend/park-common/src/main/java/com/huashe/park/common/consts/enums/ConsStatus.java
  41. 163 0
      bd-park/park-backend/park-common/src/main/java/com/huashe/park/common/geo/CoordinateUtil.java
  42. 2 0
      bd-park/park-backend/park-core/src/main/java/com/huashe/park/core/mapper/ConsPileHoleInfoMapper.java
  43. 2 0
      bd-park/park-backend/park-core/src/main/java/com/huashe/park/core/mapper/ConsUnitInfoMapper.java
  44. 2 0
      bd-park/park-backend/park-core/src/main/java/com/huashe/park/core/mapper/ConsUnitMachineRelMapper.java
  45. 2 0
      bd-park/park-backend/park-core/src/main/java/com/huashe/park/core/mapper/MachineProcessResultMapper.java
  46. 3 0
      bd-park/park-backend/park-core/src/main/java/com/huashe/park/core/mapper/PileMachineInfoMapper.java
  47. 5 2
      bd-park/park-backend/park-core/src/main/java/com/huashe/park/core/mapper/SysCustConfigMapper.java
  48. 2 0
      bd-park/park-backend/park-core/src/main/java/com/huashe/park/core/mapper/SysCustDictDataMapper.java
  49. 39 0
      bd-park/park-backend/park-core/src/main/java/com/huashe/park/core/redis/RedisProxy.java
  50. 7 0
      bd-park/park-backend/park-core/src/main/java/com/huashe/park/core/service/IConsUnitInfoService.java
  51. 1 2
      bd-park/park-backend/park-core/src/main/java/com/huashe/park/core/service/IMachineProcessResultService.java
  52. 0 1
      bd-park/park-backend/park-core/src/main/java/com/huashe/park/core/service/ISysCustConfigService.java
  53. 4 1
      bd-park/park-backend/park-core/src/main/java/com/huashe/park/core/service/impl/ConsPileHoleInfoServiceImpl.java
  54. 85 22
      bd-park/park-backend/park-core/src/main/java/com/huashe/park/core/service/impl/ConsUnitInfoServiceImpl.java
  55. 41 5
      bd-park/park-backend/park-core/src/main/java/com/huashe/park/core/service/impl/MachineProcessResultServiceImpl.java
  56. 37 9
      bd-park/park-backend/park-core/src/main/java/com/huashe/park/core/service/impl/PileMachineInfoServiceImpl.java
  57. 30 4
      bd-park/park-backend/park-core/src/main/java/com/huashe/park/core/service/impl/ProjectInfoServiceImpl.java
  58. 13 23
      bd-park/park-backend/park-core/src/main/java/com/huashe/park/core/service/impl/SysCustConfigServiceImpl.java
  59. 3 4
      bd-park/park-backend/park-core/src/main/resources/mapper/cons/ConsMachineCmdHisMapper.xml
  60. 16 6
      bd-park/park-backend/park-core/src/main/resources/mapper/cons/ConsPileHoleInfoMapper.xml
  61. 11 4
      bd-park/park-backend/park-core/src/main/resources/mapper/cons/ConsUnitInfoMapper.xml
  62. 10 1
      bd-park/park-backend/park-core/src/main/resources/mapper/cons/MachineProcessMapper.xml
  63. 15 3
      bd-park/park-backend/park-core/src/main/resources/mapper/cons/MachineProcessResultMapper.xml
  64. 24 2
      bd-park/park-backend/park-core/src/main/resources/mapper/cons/PileHoleIndexRealtimeMapper.xml
  65. 8 1
      bd-park/park-backend/park-core/src/main/resources/mapper/cons/PileMachineInfoMapper.xml
  66. 66 36
      bd-park/park-backend/park-core/src/main/resources/mapper/cons/ProjectCoordinateInfoMapper.xml
  67. 24 17
      bd-park/park-backend/park-core/src/main/resources/mapper/cons/ProjectInfoMapper.xml
  68. 3 4
      bd-park/park-backend/park-core/src/main/resources/mapper/park/ParkAttendGroupMapper.xml
  69. 3 4
      bd-park/park-backend/park-core/src/main/resources/mapper/park/ParkInspectProjMapper.xml
  70. 9 3
      bd-park/park-backend/park-core/src/main/resources/mapper/sys/SysCustConfigMapper.xml
  71. 31 0
      bd-park/park-backend/park-domain/src/main/java/com/huashe/park/domain/dto/cons/ConsUnitResult.java
  72. 45 0
      bd-park/park-backend/park-domain/src/main/java/com/huashe/park/domain/dto/cons/MqttRequest.java
  73. 6 3
      bd-park/park-backend/park-domain/src/main/java/com/huashe/park/domain/dto/cons/PileRealtimeIndex.java
  74. 6 6
      bd-park/park-backend/park-domain/src/main/java/com/huashe/park/domain/dto/cons/ResultCADCsv.java
  75. 1 1
      bd-park/park-backend/park-domain/src/main/java/com/huashe/park/domain/entity/ConsPileHoleInfo.java
  76. 56 322
      bd-park/park-backend/park-domain/src/main/java/com/huashe/park/domain/entity/MachineProcess.java
  77. 58 359
      bd-park/park-backend/park-domain/src/main/java/com/huashe/park/domain/entity/MachineProcessResult.java
  78. 8 27
      bd-park/park-backend/park-domain/src/main/java/com/huashe/park/domain/entity/ParkAttendGroup.java
  79. 0 12
      bd-park/park-backend/park-domain/src/main/java/com/huashe/park/domain/entity/ParkAttendGroupUsr.java
  80. 0 13
      bd-park/park-backend/park-domain/src/main/java/com/huashe/park/domain/entity/ParkAttendUsrDetail.java
  81. 1 11
      bd-park/park-backend/park-domain/src/main/java/com/huashe/park/domain/entity/ParkInspectProj.java
  82. 0 12
      bd-park/park-backend/park-domain/src/main/java/com/huashe/park/domain/entity/ParkInspectTask.java
  83. 0 10
      bd-park/park-backend/park-domain/src/main/java/com/huashe/park/domain/entity/ParkInspectTaskUsrTrail.java
  84. 16 8
      bd-park/park-backend/park-domain/src/main/java/com/huashe/park/domain/entity/PileHoleIndexRealtime.java
  85. 4 0
      bd-park/park-backend/park-infrastructure/pom.xml
  86. 14 0
      bd-park/park-backend/park-infrastructure/src/main/java/com/huashe/park/infrastructure/cfg/forest/CollectMqttForestCfg.java
  87. 3 3
      bd-park/park-backend/park-infrastructure/src/main/java/com/huashe/park/infrastructure/cfg/forest/CustomForestCfg.java
  88. 68 0
      bd-park/park-backend/park-infrastructure/src/main/java/com/huashe/park/infrastructure/cfg/mybatis/BaseInterceptor.java
  89. 50 0
      bd-park/park-backend/park-infrastructure/src/main/java/com/huashe/park/infrastructure/cfg/mybatis/FieldConvertInterceptor.java
  90. 76 134
      bd-park/park-backend/park-infrastructure/src/main/java/com/huashe/park/infrastructure/cfg/mybatis/MybatisInterceptor.java
  91. 12 0
      bd-park/park-backend/park-infrastructure/src/main/java/com/huashe/park/infrastructure/cfg/mybatis/RegisterCustomerInterceptor.java
  92. 77 0
      bd-park/park-backend/park-infrastructure/src/main/java/com/huashe/park/infrastructure/cfg/mybatis/ResultTypeConvertInterceptor.java
  93. 81 0
      bd-park/park-backend/park-infrastructure/src/main/java/com/huashe/park/infrastructure/cfg/mybatis/TenantIdInterceptor.java
  94. 122 0
      bd-park/park-backend/park-infrastructure/src/main/java/com/huashe/park/infrastructure/cfg/mybatis/TenantSqlInterceptor.java
  95. 16 0
      bd-park/park-backend/park-infrastructure/src/main/java/com/huashe/park/infrastructure/mqtt/CADService.java
  96. 14 0
      bd-park/park-backend/park-infrastructure/src/main/java/com/huashe/park/infrastructure/mqtt/CollectMqttService.java
  97. 0 20
      bd-park/park-backend/park-infrastructure/src/main/java/com/huashe/park/infrastructure/uwb/CADService.java
  98. 31 12
      bd-park/park-backend/pom.xml
  99. 9 4
      common-application/pom.xml
  100. 28 50
      common-application/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java

+ 15 - 6
bd-park/park-backend/park-application/src/main/java/com/huashe/park/application/BDApplication.java

@@ -1,23 +1,32 @@
 package com.huashe.park.application;
 package com.huashe.park.application;
 
 
-import com.dtflys.forest.springboot.annotation.ForestScan;
-import com.huashe.park.infrastructure.socket.cfg.EnableSocketServer;
 import org.mybatis.spring.annotation.MapperScan;
 import org.mybatis.spring.annotation.MapperScan;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
 import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
 import org.springframework.context.annotation.ComponentScan;
 import org.springframework.context.annotation.ComponentScan;
 
 
+import com.dtflys.forest.springboot.annotation.ForestScan;
+import com.huashe.park.infrastructure.socket.cfg.EnableSocketServer;
+
 /**
 /**
  * 启动程序
  * 启动程序
  *
  *
  * @author ruoyi
  * @author ruoyi
  */
  */
-@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
-@ComponentScan(basePackages = {"com.ruoyi", "com.huashe.park"})
+@SpringBootApplication(exclude = {
+    DataSourceAutoConfiguration.class
+})
+@ComponentScan(basePackages = {
+    "com.ruoyi", "com.huashe.park"
+})
 @MapperScan("com.huashe.park.core.mapper")
 @MapperScan("com.huashe.park.core.mapper")
-@ForestScan(basePackages = {"com.huashe.park.infrastructure.uwb"})
-@EnableSocketServer(basePackages = {"com.huashe.park.infrastructure.socket.server"})
+@ForestScan(basePackages = {
+    "com.huashe.park.infrastructure.uwb", "com.huashe.park.infrastructure.mqtt"
+})
+@EnableSocketServer(basePackages = {
+    "com.huashe.park.infrastructure.socket.server"
+})
 public class BDApplication {
 public class BDApplication {
     public static void main(String[] args) {
     public static void main(String[] args) {
         // System.setProperty("spring.devtools.restart.enabled", "false");
         // System.setProperty("spring.devtools.restart.enabled", "false");

+ 15 - 8
bd-park/park-backend/park-application/src/main/java/com/huashe/park/application/web/controller/cons/ConsUnitInfoController.java

@@ -14,22 +14,25 @@ import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.PutMapping;
 import org.springframework.web.bind.annotation.PutMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
 
 
 import com.huashe.common.domain.AjaxResult;
 import com.huashe.common.domain.AjaxResult;
 import com.huashe.common.exception.ServiceException;
 import com.huashe.common.exception.ServiceException;
 import com.huashe.park.common.i18n.MessageUtils;
 import com.huashe.park.common.i18n.MessageUtils;
 import com.huashe.park.core.service.IConsUnitInfoService;
 import com.huashe.park.core.service.IConsUnitInfoService;
+import com.huashe.park.core.service.IPileHoleIndexRealtimeService;
 import com.huashe.park.domain.dto.cons.ConsUnitMachine;
 import com.huashe.park.domain.dto.cons.ConsUnitMachine;
 import com.huashe.park.domain.entity.ConsUnitInfo;
 import com.huashe.park.domain.entity.ConsUnitInfo;
-import com.huashe.park.infrastructure.cfg.forest.CADForestCfg;
+import com.huashe.park.domain.entity.PileHoleIndexRealtime;
+import com.ruoyi.common.annotation.Anonymous;
 import com.ruoyi.common.annotation.Log;
 import com.ruoyi.common.annotation.Log;
 import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.page.TableDataInfo;
 import com.ruoyi.common.core.page.TableDataInfo;
 import com.ruoyi.common.enums.BusinessType;
 import com.ruoyi.common.enums.BusinessType;
 import com.ruoyi.common.utils.StringMatchUtils;
 import com.ruoyi.common.utils.StringMatchUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.common.utils.poi.ExcelUtil;
-import com.ruoyi.system.service.ISysConfigService;
 
 
 /**
 /**
  * 施工单元Controller
  * 施工单元Controller
@@ -44,10 +47,7 @@ public class ConsUnitInfoController extends BaseController {
     private IConsUnitInfoService consUnitInfoService;
     private IConsUnitInfoService consUnitInfoService;
 
 
     @Autowired
     @Autowired
-    private ISysConfigService configService;
-
-    @Autowired
-    private CADForestCfg cadForestCfg;
+    private IPileHoleIndexRealtimeService pileHoleIndexRealtimeService;
 
 
     /**
     /**
      * 查询施工单元列表
      * 查询施工单元列表
@@ -75,7 +75,6 @@ public class ConsUnitInfoController extends BaseController {
         if (StringUtils.isEmpty(consUnitInfo.getFileId())) {
         if (StringUtils.isEmpty(consUnitInfo.getFileId())) {
             throw new ServiceException(MessageUtils.message("common.not.null", "file id"));
             throw new ServiceException(MessageUtils.message("common.not.null", "file id"));
         }
         }
-        String s = configService.selectConfigByKey(cadForestCfg.getCadBizParam());
         consUnitInfoService.importConsUnitHole(consUnitInfo);
         consUnitInfoService.importConsUnitHole(consUnitInfo);
     }
     }
 
 
@@ -85,7 +84,6 @@ public class ConsUnitInfoController extends BaseController {
         consUnitInfoService.exportConsUnitHole(consUnitInfo, response);
         consUnitInfoService.exportConsUnitHole(consUnitInfo, response);
     }
     }
 
 
-    @Log(title = "施工单元", businessType = BusinessType.EXPORT)
     @PostMapping("/export/csv")
     @PostMapping("/export/csv")
     public void exportCsv(HttpServletResponse response, ConsUnitInfo consUnitInfo) {
     public void exportCsv(HttpServletResponse response, ConsUnitInfo consUnitInfo) {
         consUnitInfoService.exportConsUnitRes(consUnitInfo, response);
         consUnitInfoService.exportConsUnitRes(consUnitInfo, response);
@@ -123,6 +121,14 @@ public class ConsUnitInfoController extends BaseController {
         return success();
         return success();
     }
     }
 
 
+    @Log(title = "施工单元分配施工机械", businessType = BusinessType.UPDATE)
+    @PostMapping("/upload")
+    @Anonymous
+    public AjaxResult upload(@RequestParam MultipartFile file) {
+        consUnitInfoService.upload(file);
+        return success();
+    }
+
     /**
     /**
      * 修改施工单元
      * 修改施工单元
      */
      */
@@ -140,4 +146,5 @@ public class ConsUnitInfoController extends BaseController {
     public AjaxResult remove(@PathVariable("id") Long id) {
     public AjaxResult remove(@PathVariable("id") Long id) {
         return toAjax(consUnitInfoService.deleteConsUnitInfoById(id));
         return toAjax(consUnitInfoService.deleteConsUnitInfoById(id));
     }
     }
+
 }
 }

+ 41 - 16
bd-park/park-backend/park-application/src/main/java/com/huashe/park/application/web/controller/cons/PileMachineInfoController.java

@@ -11,16 +11,19 @@ import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
 import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
 import org.springframework.security.core.context.SecurityContextHolder;
 import org.springframework.security.core.context.SecurityContextHolder;
 import org.springframework.util.CollectionUtils;
 import org.springframework.util.CollectionUtils;
+import org.springframework.web.bind.annotation.DeleteMapping;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.PutMapping;
 import org.springframework.web.bind.annotation.PutMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.bind.annotation.RestController;
 
 
 import com.huashe.common.domain.AjaxResult;
 import com.huashe.common.domain.AjaxResult;
 import com.huashe.park.common.i18n.MessageUtils;
 import com.huashe.park.common.i18n.MessageUtils;
+import com.huashe.park.core.redis.RedisProxy;
 import com.huashe.park.core.service.IPileHoleIndexRealtimeService;
 import com.huashe.park.core.service.IPileHoleIndexRealtimeService;
 import com.huashe.park.core.service.IPileMachineInfoService;
 import com.huashe.park.core.service.IPileMachineInfoService;
 import com.huashe.park.domain.dto.cons.MachineBiz;
 import com.huashe.park.domain.dto.cons.MachineBiz;
@@ -30,6 +33,7 @@ import com.huashe.park.domain.entity.PileMachineInfo;
 import com.ruoyi.common.annotation.Anonymous;
 import com.ruoyi.common.annotation.Anonymous;
 import com.ruoyi.common.annotation.Log;
 import com.ruoyi.common.annotation.Log;
 import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.entity.SysUser;
 import com.ruoyi.common.core.page.TableDataInfo;
 import com.ruoyi.common.core.page.TableDataInfo;
 import com.ruoyi.common.enums.BusinessType;
 import com.ruoyi.common.enums.BusinessType;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.common.utils.poi.ExcelUtil;
@@ -55,6 +59,9 @@ public class PileMachineInfoController extends BaseController {
     @Autowired
     @Autowired
     private TokenService tokenService;
     private TokenService tokenService;
 
 
+    @Autowired
+    private RedisProxy redisProxy;
+
     /**
     /**
      * 查询施工桩机信息列表
      * 查询施工桩机信息列表
      */
      */
@@ -114,21 +121,25 @@ public class PileMachineInfoController extends BaseController {
         return toAjax(pileMachineInfoService.updatePileMachineInfoWidthPwd(pileMachineInfo));
         return toAjax(pileMachineInfoService.updatePileMachineInfoWidthPwd(pileMachineInfo));
     }
     }
 
 
+    @PostMapping("/terminal/test")
+    @Anonymous
+    public void test() {
+        redisProxy.putMapToHash("test", BeanUtil.beanToMap(new MachineBiz()), 10000);
+        redisProxy.putHash("test", "designId", "123");
+    }
+
     @PostMapping("/terminal/login")
     @PostMapping("/terminal/login")
     @Anonymous
     @Anonymous
     public AjaxResult login(@RequestBody MachineLogin machineAuth) {
     public AjaxResult login(@RequestBody MachineLogin machineAuth) {
-        if (StringUtils.isEmpty(machineAuth.getSn()) || StringUtils.isEmpty(machineAuth.getNo())
-            || StringUtils.isEmpty(machineAuth.getPwd())) {
+        if (StringUtils.isEmpty(machineAuth.getSn()) || StringUtils.isEmpty(machineAuth.getPwd())) {
             return AjaxResult.error(MessageUtils.message("machine.auth.param.error"));
             return AjaxResult.error(MessageUtils.message("machine.auth.param.error"));
         }
         }
-
-        List<PileMachineInfo> pileMachineInfos = pileMachineInfoService
-            .selectPileMachineInfoList(new PileMachineInfo() {
-                {
-                    setSn(machineAuth.getSn());
-                    setNo(machineAuth.getNo());
-                }
-            });
+        PileMachineInfo param = new PileMachineInfo();
+        param.setSn(machineAuth.getSn());
+        if (StringUtils.isNotEmpty(machineAuth.getNo())) {
+            param.setNo(machineAuth.getNo());
+        }
+        List<PileMachineInfo> pileMachineInfos = pileMachineInfoService.selectPileMachineInfoList(param);
         if (CollectionUtils.isEmpty(pileMachineInfos)) {
         if (CollectionUtils.isEmpty(pileMachineInfos)) {
             return AjaxResult.error(MessageUtils.message("machine.auth.param.none"));
             return AjaxResult.error(MessageUtils.message("machine.auth.param.none"));
         }
         }
@@ -140,6 +151,9 @@ public class PileMachineInfoController extends BaseController {
             pileMachineInfo.getSn(), pileMachineInfo.getPwd());
             pileMachineInfo.getSn(), pileMachineInfo.getPwd());
         authenticationToken.setDetails(pileMachineInfo);
         authenticationToken.setDetails(pileMachineInfo);
         SecurityContextHolder.getContext().setAuthentication(authenticationToken);
         SecurityContextHolder.getContext().setAuthentication(authenticationToken);
+        SysUser sysUser = new SysUser();
+        sysUser.setTenantId(pileMachineInfo.getTenantId());
+        machineAuth.setUser(sysUser);
         String token = tokenService.createToken(machineAuth);
         String token = tokenService.createToken(machineAuth);
         pileMachineInfo.setToken(token);
         pileMachineInfo.setToken(token);
         PileMachineVO pileMachineInfoVo = new PileMachineVO();
         PileMachineVO pileMachineInfoVo = new PileMachineVO();
@@ -148,14 +162,19 @@ public class PileMachineInfoController extends BaseController {
         return AjaxResult.success(pileMachineInfoVo);
         return AjaxResult.success(pileMachineInfoVo);
     }
     }
 
 
-    @PostMapping("/terminal/workSection")
-    public AjaxResult machineWorkSection(@RequestBody MachineBiz machineBiz) {
-        return AjaxResult.success(pileMachineInfoService.qryMachineAssignedUnit(machineBiz.getMachineId()));
+    @GetMapping("/terminal/workSection")
+    public AjaxResult machineWorkSection(@RequestParam String machineId) {
+        return AjaxResult.success(pileMachineInfoService.qryMachineAssignedUnit(machineId));
     }
     }
 
 
-    @PostMapping("/terminal/constructionTargetObject")
-    public AjaxResult constructionTargetObject(@RequestBody MachineBiz machineBiz) {
-        return AjaxResult.success(pileMachineInfoService.machineUnitPileHole(machineBiz));
+    @GetMapping("/terminal/constructionTargetObject")
+    public AjaxResult constructionTargetObject(@RequestParam String machineId, @RequestParam String designId) {
+        return AjaxResult.success(pileMachineInfoService.machineUnitPileHole(new MachineBiz() {
+            {
+                setDesignId(designId);
+                setMachineId(machineId);
+            }
+        }));
     }
     }
 
 
     /**
     /**
@@ -186,4 +205,10 @@ public class PileMachineInfoController extends BaseController {
     public AjaxResult qryMachineLatestIndex(@Param("machineId") Long machineId) {
     public AjaxResult qryMachineLatestIndex(@Param("machineId") Long machineId) {
         return AjaxResult.success(pileHoleIndexRealtimeService.selectMachineLatestIndex(machineId));
         return AjaxResult.success(pileHoleIndexRealtimeService.selectMachineLatestIndex(machineId));
     }
     }
+
+    @Log(title = "施工桩机", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{id}")
+    public AjaxResult remove(@PathVariable("id") Long id) {
+        return toAjax(pileMachineInfoService.deletePileMachineInfoById(id));
+    }
 }
 }

+ 3 - 3
bd-park/park-backend/park-application/src/main/java/com/huashe/park/application/web/controller/cons/ProjectInfoController.java

@@ -98,8 +98,8 @@ public class ProjectInfoController extends BaseController {
      */
      */
 
 
     @Log(title = "工程信息", businessType = BusinessType.DELETE)
     @Log(title = "工程信息", businessType = BusinessType.DELETE)
-    @DeleteMapping("/{ids}")
-    public AjaxResult remove(@PathVariable Long[] ids) {
-        return toAjax(projectInfoService.deleteProjectInfoByIds(ids));
+    @DeleteMapping("/{id}")
+    public AjaxResult remove(@PathVariable Long id) {
+        return toAjax(projectInfoService.deleteProjectInfoById(id));
     }
     }
 }
 }

+ 3 - 0
bd-park/park-backend/park-application/src/main/java/com/huashe/park/application/web/controller/system/SysCustConfigController.java

@@ -1,10 +1,12 @@
 package com.huashe.park.application.web.controller.system;
 package com.huashe.park.application.web.controller.system;
 
 
+import com.ruoyi.system.domain.SysConfig;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.PutMapping;
 import org.springframework.web.bind.annotation.PutMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -52,4 +54,5 @@ public class SysCustConfigController extends BaseController {
         return toAjax(sysCustConfigService.updateConfig(config));
         return toAjax(sysCustConfigService.updateConfig(config));
     }
     }
 
 
+
 }
 }

+ 102 - 0
bd-park/park-backend/park-application/src/main/java/com/huashe/park/application/web/controller/system/SysTenantController.java

@@ -0,0 +1,102 @@
+package com.huashe.park.application.web.controller.system;
+
+import java.util.List;
+
+import javax.servlet.http.HttpServletResponse;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.huashe.common.domain.AjaxResult;
+import com.ruoyi.common.annotation.Anonymous;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.system.domain.SysTenant;
+import com.ruoyi.system.service.ISysTenantService;
+
+/**
+ * 租户Controller
+ * 
+ * @author ruoyi
+ * @date 2025-04-19
+ */
+@RestController
+@RequestMapping("/system/tenant")
+public class SysTenantController extends BaseController {
+    @Autowired
+    private ISysTenantService sysTenantService;
+
+    /**
+     * 查询租户列表
+     */
+
+    @GetMapping("/list")
+    @Anonymous
+    public TableDataInfo list(SysTenant sysTenant) {
+        startPage();
+        List<SysTenant> list = sysTenantService.selectTenantList(sysTenant);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出租户列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:tenant:export')")
+    @Log(title = "租户", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, SysTenant sysTenant) {
+        List<SysTenant> list = sysTenantService.selectTenantList(sysTenant);
+        ExcelUtil<SysTenant> util = new ExcelUtil<SysTenant>(SysTenant.class);
+        util.exportExcel(response, list, "租户数据");
+    }
+
+    /**
+     * 获取租户详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:tenant:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
+        return success(sysTenantService.selectTenantById(id));
+    }
+
+    /**
+     * 新增租户
+     */
+    @PreAuthorize("@ss.hasPermi('system:tenant:add')")
+    @Log(title = "租户", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody SysTenant sysTenant) {
+        return toAjax(sysTenantService.insertTenant(sysTenant));
+    }
+
+    /**
+     * 修改租户
+     */
+    @PreAuthorize("@ss.hasPermi('system:tenant:edit')")
+    @Log(title = "租户", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody SysTenant sysTenant) {
+        return toAjax(sysTenantService.updateTenant(sysTenant));
+    }
+
+    /**
+     * 删除租户
+     */
+    @PreAuthorize("@ss.hasPermi('system:tenant:remove')")
+    @Log(title = "租户", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
+        return toAjax(sysTenantService.deleteSysTenantByIds(ids));
+    }
+}

+ 49 - 59
bd-park/park-backend/park-application/src/main/java/com/huashe/park/application/web/controller/system/SysUserController.java

@@ -1,31 +1,39 @@
 package com.huashe.park.application.web.controller.system;
 package com.huashe.park.application.web.controller.system;
 
 
+import java.util.List;
+import java.util.stream.Collectors;
+
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.commons.lang3.ArrayUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
+
+import com.huashe.common.domain.AjaxResult;
 import com.huashe.common.utils.StringUtils;
 import com.huashe.common.utils.StringUtils;
 import com.ruoyi.common.annotation.Log;
 import com.ruoyi.common.annotation.Log;
 import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.controller.BaseController;
-import com.huashe.common.domain.AjaxResult;
 import com.ruoyi.common.core.domain.entity.SysDept;
 import com.ruoyi.common.core.domain.entity.SysDept;
 import com.ruoyi.common.core.domain.entity.SysRole;
 import com.ruoyi.common.core.domain.entity.SysRole;
 import com.ruoyi.common.core.domain.entity.SysUser;
 import com.ruoyi.common.core.domain.entity.SysUser;
 import com.ruoyi.common.core.page.TableDataInfo;
 import com.ruoyi.common.core.page.TableDataInfo;
 import com.ruoyi.common.enums.BusinessType;
 import com.ruoyi.common.enums.BusinessType;
 import com.ruoyi.common.utils.SecurityUtils;
 import com.ruoyi.common.utils.SecurityUtils;
-
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.system.service.ISysDeptService;
 import com.ruoyi.system.service.ISysDeptService;
 import com.ruoyi.system.service.ISysPostService;
 import com.ruoyi.system.service.ISysPostService;
 import com.ruoyi.system.service.ISysRoleService;
 import com.ruoyi.system.service.ISysRoleService;
 import com.ruoyi.system.service.ISysUserService;
 import com.ruoyi.system.service.ISysUserService;
-import org.apache.commons.lang3.ArrayUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.web.multipart.MultipartFile;
-
-import javax.servlet.http.HttpServletResponse;
-import java.util.List;
-import java.util.stream.Collectors;
 
 
 /**
 /**
  * 用户信息
  * 用户信息
@@ -34,8 +42,7 @@ import java.util.stream.Collectors;
  */
  */
 @RestController
 @RestController
 @RequestMapping("/system/user")
 @RequestMapping("/system/user")
-public class SysUserController extends BaseController
-{
+public class SysUserController extends BaseController {
     @Autowired
     @Autowired
     private ISysUserService userService;
     private ISysUserService userService;
 
 
@@ -53,8 +60,7 @@ public class SysUserController extends BaseController
      */
      */
     @PreAuthorize("@ss.hasPermi('system:user:list')")
     @PreAuthorize("@ss.hasPermi('system:user:list')")
     @GetMapping("/list")
     @GetMapping("/list")
-    public TableDataInfo list(SysUser user)
-    {
+    public TableDataInfo list(SysUser user) {
         startPage();
         startPage();
         List<SysUser> list = userService.selectUserList(user);
         List<SysUser> list = userService.selectUserList(user);
         return getDataTable(list);
         return getDataTable(list);
@@ -63,8 +69,7 @@ public class SysUserController extends BaseController
     @Log(title = "用户管理", businessType = BusinessType.EXPORT)
     @Log(title = "用户管理", businessType = BusinessType.EXPORT)
     @PreAuthorize("@ss.hasPermi('system:user:export')")
     @PreAuthorize("@ss.hasPermi('system:user:export')")
     @PostMapping("/export")
     @PostMapping("/export")
-    public void export(HttpServletResponse response, SysUser user)
-    {
+    public void export(HttpServletResponse response, SysUser user) {
         List<SysUser> list = userService.selectUserList(user);
         List<SysUser> list = userService.selectUserList(user);
         ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
         ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
         util.exportExcel(response, list, "用户数据");
         util.exportExcel(response, list, "用户数据");
@@ -73,8 +78,7 @@ public class SysUserController extends BaseController
     @Log(title = "用户管理", businessType = BusinessType.IMPORT)
     @Log(title = "用户管理", businessType = BusinessType.IMPORT)
     @PreAuthorize("@ss.hasPermi('system:user:import')")
     @PreAuthorize("@ss.hasPermi('system:user:import')")
     @PostMapping("/importData")
     @PostMapping("/importData")
-    public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
-    {
+    public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception {
         ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
         ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
         List<SysUser> userList = util.importExcel(file.getInputStream());
         List<SysUser> userList = util.importExcel(file.getInputStream());
         String operName = getUsername();
         String operName = getUsername();
@@ -83,8 +87,7 @@ public class SysUserController extends BaseController
     }
     }
 
 
     @PostMapping("/importTemplate")
     @PostMapping("/importTemplate")
-    public void importTemplate(HttpServletResponse response)
-    {
+    public void importTemplate(HttpServletResponse response) {
         ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
         ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
         util.importTemplateExcel(response, "用户数据");
         util.importTemplateExcel(response, "用户数据");
     }
     }
@@ -93,16 +96,17 @@ public class SysUserController extends BaseController
      * 根据用户编号获取详细信息
      * 根据用户编号获取详细信息
      */
      */
     @PreAuthorize("@ss.hasPermi('system:user:query')")
     @PreAuthorize("@ss.hasPermi('system:user:query')")
-    @GetMapping(value = { "/", "/{userId}" })
-    public AjaxResult getInfo(@PathVariable(value = "userId", required = false) Long userId)
-    {
+    @GetMapping(value = {
+        "/", "/{userId}"
+    })
+    public AjaxResult getInfo(@PathVariable(value = "userId", required = false) Long userId) {
         userService.checkUserDataScope(userId);
         userService.checkUserDataScope(userId);
         AjaxResult ajax = AjaxResult.success();
         AjaxResult ajax = AjaxResult.success();
         List<SysRole> roles = roleService.selectRoleAll();
         List<SysRole> roles = roleService.selectRoleAll();
-        ajax.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList()));
+        ajax.put("roles",
+            SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList()));
         ajax.put("posts", postService.selectPostAll());
         ajax.put("posts", postService.selectPostAll());
-        if (StringUtils.isNotNull(userId))
-        {
+        if (StringUtils.isNotNull(userId)) {
             SysUser sysUser = userService.selectUserById(userId);
             SysUser sysUser = userService.selectUserById(userId);
             ajax.put(AjaxResult.DATA_TAG, sysUser);
             ajax.put(AjaxResult.DATA_TAG, sysUser);
             ajax.put("postIds", postService.selectPostListByUserId(userId));
             ajax.put("postIds", postService.selectPostListByUserId(userId));
@@ -117,20 +121,16 @@ public class SysUserController extends BaseController
     @PreAuthorize("@ss.hasPermi('system:user:add')")
     @PreAuthorize("@ss.hasPermi('system:user:add')")
     @Log(title = "用户管理", businessType = BusinessType.INSERT)
     @Log(title = "用户管理", businessType = BusinessType.INSERT)
     @PostMapping
     @PostMapping
-    public AjaxResult add(@Validated @RequestBody SysUser user)
-    {
+    public AjaxResult add(@Validated @RequestBody SysUser user) {
         deptService.checkDeptDataScope(user.getDeptId());
         deptService.checkDeptDataScope(user.getDeptId());
         roleService.checkRoleDataScope(user.getRoleIds());
         roleService.checkRoleDataScope(user.getRoleIds());
-        if (!userService.checkUserNameUnique(user))
-        {
+        if (!userService.checkUserNameUnique(user)) {
             return error("新增用户'" + user.getUserName() + "'失败,登录账号已存在");
             return error("新增用户'" + user.getUserName() + "'失败,登录账号已存在");
         }
         }
-        else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user))
-        {
+        else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user)) {
             return error("新增用户'" + user.getUserName() + "'失败,手机号码已存在");
             return error("新增用户'" + user.getUserName() + "'失败,手机号码已存在");
         }
         }
-        else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user))
-        {
+        else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user)) {
             return error("新增用户'" + user.getUserName() + "'失败,邮箱账号已存在");
             return error("新增用户'" + user.getUserName() + "'失败,邮箱账号已存在");
         }
         }
         user.setCreateBy(getUsername());
         user.setCreateBy(getUsername());
@@ -144,22 +144,18 @@ public class SysUserController extends BaseController
     @PreAuthorize("@ss.hasPermi('system:user:edit')")
     @PreAuthorize("@ss.hasPermi('system:user:edit')")
     @Log(title = "用户管理", businessType = BusinessType.UPDATE)
     @Log(title = "用户管理", businessType = BusinessType.UPDATE)
     @PutMapping
     @PutMapping
-    public AjaxResult edit(@Validated @RequestBody SysUser user)
-    {
+    public AjaxResult edit(@Validated @RequestBody SysUser user) {
         userService.checkUserAllowed(user);
         userService.checkUserAllowed(user);
         userService.checkUserDataScope(user.getUserId());
         userService.checkUserDataScope(user.getUserId());
         deptService.checkDeptDataScope(user.getDeptId());
         deptService.checkDeptDataScope(user.getDeptId());
         roleService.checkRoleDataScope(user.getRoleIds());
         roleService.checkRoleDataScope(user.getRoleIds());
-        if (!userService.checkUserNameUnique(user))
-        {
+        if (!userService.checkUserNameUnique(user)) {
             return error("修改用户'" + user.getUserName() + "'失败,登录账号已存在");
             return error("修改用户'" + user.getUserName() + "'失败,登录账号已存在");
         }
         }
-        else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user))
-        {
+        else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user)) {
             return error("修改用户'" + user.getUserName() + "'失败,手机号码已存在");
             return error("修改用户'" + user.getUserName() + "'失败,手机号码已存在");
         }
         }
-        else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user))
-        {
+        else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user)) {
             return error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在");
             return error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在");
         }
         }
         user.setUpdateBy(getUsername());
         user.setUpdateBy(getUsername());
@@ -172,10 +168,8 @@ public class SysUserController extends BaseController
     @PreAuthorize("@ss.hasPermi('system:user:remove')")
     @PreAuthorize("@ss.hasPermi('system:user:remove')")
     @Log(title = "用户管理", businessType = BusinessType.DELETE)
     @Log(title = "用户管理", businessType = BusinessType.DELETE)
     @DeleteMapping("/{userIds}")
     @DeleteMapping("/{userIds}")
-    public AjaxResult remove(@PathVariable Long[] userIds)
-    {
-        if (ArrayUtils.contains(userIds, getUserId()))
-        {
+    public AjaxResult remove(@PathVariable Long[] userIds) {
+        if (ArrayUtils.contains(userIds, getUserId())) {
             return error("当前用户不能删除");
             return error("当前用户不能删除");
         }
         }
         return toAjax(userService.deleteUserByIds(userIds));
         return toAjax(userService.deleteUserByIds(userIds));
@@ -187,8 +181,7 @@ public class SysUserController extends BaseController
     @PreAuthorize("@ss.hasPermi('system:user:resetPwd')")
     @PreAuthorize("@ss.hasPermi('system:user:resetPwd')")
     @Log(title = "用户管理", businessType = BusinessType.UPDATE)
     @Log(title = "用户管理", businessType = BusinessType.UPDATE)
     @PutMapping("/resetPwd")
     @PutMapping("/resetPwd")
-    public AjaxResult resetPwd(@RequestBody SysUser user)
-    {
+    public AjaxResult resetPwd(@RequestBody SysUser user) {
         userService.checkUserAllowed(user);
         userService.checkUserAllowed(user);
         userService.checkUserDataScope(user.getUserId());
         userService.checkUserDataScope(user.getUserId());
         user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
         user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
@@ -202,8 +195,7 @@ public class SysUserController extends BaseController
     @PreAuthorize("@ss.hasPermi('system:user:edit')")
     @PreAuthorize("@ss.hasPermi('system:user:edit')")
     @Log(title = "用户管理", businessType = BusinessType.UPDATE)
     @Log(title = "用户管理", businessType = BusinessType.UPDATE)
     @PutMapping("/changeStatus")
     @PutMapping("/changeStatus")
-    public AjaxResult changeStatus(@RequestBody SysUser user)
-    {
+    public AjaxResult changeStatus(@RequestBody SysUser user) {
         userService.checkUserAllowed(user);
         userService.checkUserAllowed(user);
         userService.checkUserDataScope(user.getUserId());
         userService.checkUserDataScope(user.getUserId());
         user.setUpdateBy(getUsername());
         user.setUpdateBy(getUsername());
@@ -215,13 +207,13 @@ public class SysUserController extends BaseController
      */
      */
     @PreAuthorize("@ss.hasPermi('system:user:query')")
     @PreAuthorize("@ss.hasPermi('system:user:query')")
     @GetMapping("/authRole/{userId}")
     @GetMapping("/authRole/{userId}")
-    public AjaxResult authRole(@PathVariable("userId") Long userId)
-    {
+    public AjaxResult authRole(@PathVariable("userId") Long userId) {
         AjaxResult ajax = AjaxResult.success();
         AjaxResult ajax = AjaxResult.success();
         SysUser user = userService.selectUserById(userId);
         SysUser user = userService.selectUserById(userId);
         List<SysRole> roles = roleService.selectRolesByUserId(userId);
         List<SysRole> roles = roleService.selectRolesByUserId(userId);
         ajax.put("user", user);
         ajax.put("user", user);
-        ajax.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList()));
+        ajax.put("roles",
+            SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList()));
         return ajax;
         return ajax;
     }
     }
 
 
@@ -231,8 +223,7 @@ public class SysUserController extends BaseController
     @PreAuthorize("@ss.hasPermi('system:user:edit')")
     @PreAuthorize("@ss.hasPermi('system:user:edit')")
     @Log(title = "用户管理", businessType = BusinessType.GRANT)
     @Log(title = "用户管理", businessType = BusinessType.GRANT)
     @PutMapping("/authRole")
     @PutMapping("/authRole")
-    public AjaxResult insertAuthRole(Long userId, Long[] roleIds)
-    {
+    public AjaxResult insertAuthRole(Long userId, Long[] roleIds) {
         userService.checkUserDataScope(userId);
         userService.checkUserDataScope(userId);
         roleService.checkRoleDataScope(roleIds);
         roleService.checkRoleDataScope(roleIds);
         userService.insertUserAuth(userId, roleIds);
         userService.insertUserAuth(userId, roleIds);
@@ -244,8 +235,7 @@ public class SysUserController extends BaseController
      */
      */
     @PreAuthorize("@ss.hasPermi('system:user:list')")
     @PreAuthorize("@ss.hasPermi('system:user:list')")
     @GetMapping("/deptTree")
     @GetMapping("/deptTree")
-    public AjaxResult deptTree(SysDept dept)
-    {
+    public AjaxResult deptTree(SysDept dept) {
         return success(deptService.selectDeptTreeList(dept));
         return success(deptService.selectDeptTreeList(dept));
     }
     }
 }
 }

+ 1 - 1
bd-park/park-backend/park-application/src/main/resources/application-hm.yml

@@ -5,7 +5,7 @@ spring:
     # 地址
     # 地址
     host: 127.0.0.1
     host: 127.0.0.1
     # 端口,默认为6379
     # 端口,默认为6379
-    port: 6379
+    port: 16379
     # 数据库索引
     # 数据库索引
     database: 1
     database: 1
     # 密码
     # 密码

+ 4 - 0
bd-park/park-backend/park-application/src/main/resources/application.yml

@@ -12,6 +12,8 @@ ruoyi:
   addressEnabled: false
   addressEnabled: false
   # 验证码类型 math 数字计算 char 字符验证
   # 验证码类型 math 数字计算 char 字符验证
   captchaType: math
   captchaType: math
+  tenant:
+    enable: true
 
 
 # 开发环境配置
 # 开发环境配置
 server:
 server:
@@ -100,6 +102,8 @@ forest:
     cad:
     cad:
       cad-biz-param: cad.biz.param
       cad-biz-param: cad.biz.param
       cad-server: http://127.0.0.1:18080
       cad-server: http://127.0.0.1:18080
+    collect-mqtt:
+      url: http://127.0.0.1:9203/pkc-collect
 # token配置
 # token配置
 token:
 token:
   # 令牌自定义标识
   # 令牌自定义标识

+ 2 - 0
bd-park/park-backend/park-application/src/main/resources/i18n/messages_en.properties

@@ -38,3 +38,5 @@ cons.unit.delete.no.child=There are lower-level construction units and deletion
 cons.unit.has.no.hole=The construction unit has a designed pile hole, which cannot be deleted.
 cons.unit.has.no.hole=The construction unit has a designed pile hole, which cannot be deleted.
 machine.auth.param.error=SN, NO, and PWD cannot be empty.
 machine.auth.param.error=SN, NO, and PWD cannot be empty.
 machine.auth.param.none=Authentication failed, please check the parameters.
 machine.auth.param.none=Authentication failed, please check the parameters.
+machine.not.assign.task=The machine has not been assigned a task.
+cons.biz.param.null=Please configure the CAD parameters first.

+ 3 - 1
bd-park/park-backend/park-application/src/main/resources/i18n/messages_zh.properties

@@ -37,4 +37,6 @@ cons.unit.modify.not.self=修改施工{0}单元失败,上级施工单元不能
 cons.unit.delete.no.child=存在下级施工单元,不允许删除。
 cons.unit.delete.no.child=存在下级施工单元,不允许删除。
 cons.unit.has.no.hole=施工单元存在设计桩孔,不允许删除。
 cons.unit.has.no.hole=施工单元存在设计桩孔,不允许删除。
 machine.auth.param.error=SN、NO、PWD不允许为空。
 machine.auth.param.error=SN、NO、PWD不允许为空。
-machine.auth.param.none=认证失败,请检查参数。
+machine.auth.param.none=认证失败,请检查参数。
+machine.not.assign.task=抱歉,机械没有分配任务。
+cons.biz.param.null=请先配置CAD参数。

+ 66 - 40
bd-park/park-backend/park-application/src/main/resources/logback.xml

@@ -1,31 +1,32 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <configuration>
 <configuration>
     <!-- 日志存放路径 -->
     <!-- 日志存放路径 -->
-	<property name="log.path" value="/opt/project/ruoyi/ruoyi-backend/logs" />
+    <property name="log.path" value="/opt/project/ruoyi/ruoyi-backend/app-logs"/>
     <!-- 日志输出格式 -->
     <!-- 日志输出格式 -->
-	<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
+    <property name="log.pattern"
+              value="%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
 
 
-	<!-- 控制台输出 -->
-	<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
-		<encoder>
-			<pattern>${log.pattern}</pattern>
-		</encoder>
-	</appender>
+    <!-- 控制台输出 -->
+    <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
+        <encoder>
+            <pattern>${log.pattern}</pattern>
+        </encoder>
+    </appender>
 
 
-	<!-- 系统日志输出 -->
-	<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
-	    <file>${log.path}/sys-info.log</file>
+    <!-- 系统日志输出 -->
+    <appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <file>${log.path}/sys-info.log</file>
         <!-- 循环政策:基于时间创建日志文件 -->
         <!-- 循环政策:基于时间创建日志文件 -->
-		<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
             <!-- 日志文件名格式 -->
             <!-- 日志文件名格式 -->
-			<fileNamePattern>${log.path}/sys-info.%d{yyyy-MM-dd}.log</fileNamePattern>
-			<!-- 日志最大的历史 60天 -->
-			<maxHistory>60</maxHistory>
-		</rollingPolicy>
-		<encoder>
-			<pattern>${log.pattern}</pattern>
-		</encoder>
-		<filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <fileNamePattern>${log.path}/sys-info.%d{yyyy-MM-dd}.log</fileNamePattern>
+            <!-- 日志最大的历史 60天 -->
+            <maxHistory>60</maxHistory>
+        </rollingPolicy>
+        <encoder>
+            <pattern>${log.pattern}</pattern>
+        </encoder>
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
             <!-- 过滤的级别 -->
             <!-- 过滤的级别 -->
             <level>INFO</level>
             <level>INFO</level>
             <!-- 匹配时的操作:接收(记录) -->
             <!-- 匹配时的操作:接收(记录) -->
@@ -33,16 +34,38 @@
             <!-- 不匹配时的操作:拒绝(不记录) -->
             <!-- 不匹配时的操作:拒绝(不记录) -->
             <onMismatch>DENY</onMismatch>
             <onMismatch>DENY</onMismatch>
         </filter>
         </filter>
-	</appender>
+    </appender>
+
+    <appender name="file_debugger" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <file>${log.path}/sys-debugger.log</file>
+        <!-- 循环政策:基于时间创建日志文件 -->
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <!-- 日志文件名格式 -->
+            <fileNamePattern>${log.path}/sys-debugger.%d{yyyy-MM-dd}.log</fileNamePattern>
+            <!-- 日志最大的历史 60天 -->
+            <maxHistory>60</maxHistory>
+        </rollingPolicy>
+        <encoder>
+            <pattern>${log.pattern}</pattern>
+        </encoder>
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <!-- 过滤的级别 -->
+            <level>DEBUG</level>
+            <!-- 匹配时的操作:接收(记录) -->
+            <onMatch>ACCEPT</onMatch>
+            <!-- 不匹配时的操作:拒绝(不记录) -->
+            <onMismatch>DENY</onMismatch>
+        </filter>
+    </appender>
 
 
-	<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
-	    <file>${log.path}/sys-error.log</file>
+    <appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <file>${log.path}/sys-error.log</file>
         <!-- 循环政策:基于时间创建日志文件 -->
         <!-- 循环政策:基于时间创建日志文件 -->
         <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
         <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
             <!-- 日志文件名格式 -->
             <!-- 日志文件名格式 -->
             <fileNamePattern>${log.path}/sys-error.%d{yyyy-MM-dd}.log</fileNamePattern>
             <fileNamePattern>${log.path}/sys-error.%d{yyyy-MM-dd}.log</fileNamePattern>
-			<!-- 日志最大的历史 60天 -->
-			<maxHistory>60</maxHistory>
+            <!-- 日志最大的历史 60天 -->
+            <maxHistory>60</maxHistory>
         </rollingPolicy>
         </rollingPolicy>
         <encoder>
         <encoder>
             <pattern>${log.pattern}</pattern>
             <pattern>${log.pattern}</pattern>
@@ -50,16 +73,16 @@
         <filter class="ch.qos.logback.classic.filter.LevelFilter">
         <filter class="ch.qos.logback.classic.filter.LevelFilter">
             <!-- 过滤的级别 -->
             <!-- 过滤的级别 -->
             <level>ERROR</level>
             <level>ERROR</level>
-			<!-- 匹配时的操作:接收(记录) -->
+            <!-- 匹配时的操作:接收(记录) -->
             <onMatch>ACCEPT</onMatch>
             <onMatch>ACCEPT</onMatch>
-			<!-- 不匹配时的操作:拒绝(不记录) -->
+            <!-- 不匹配时的操作:拒绝(不记录) -->
             <onMismatch>DENY</onMismatch>
             <onMismatch>DENY</onMismatch>
         </filter>
         </filter>
     </appender>
     </appender>
 
 
-	<!-- 用户访问日志输出  -->
+    <!-- 用户访问日志输出  -->
     <appender name="sys-user" class="ch.qos.logback.core.rolling.RollingFileAppender">
     <appender name="sys-user" class="ch.qos.logback.core.rolling.RollingFileAppender">
-		<file>${log.path}/sys-user.log</file>
+        <file>${log.path}/sys-user.log</file>
         <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
         <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
             <!-- 按天回滚 daily -->
             <!-- 按天回滚 daily -->
             <fileNamePattern>${log.path}/sys-user.%d{yyyy-MM-dd}.log</fileNamePattern>
             <fileNamePattern>${log.path}/sys-user.%d{yyyy-MM-dd}.log</fileNamePattern>
@@ -71,22 +94,25 @@
         </encoder>
         </encoder>
     </appender>
     </appender>
 
 
-	<!-- 系统模块日志级别控制  -->
-	<logger name="com.ruoyi" level="info" />
-	<!-- Spring日志级别控制  -->
-	<logger name="org.springframework" level="warn" />
+    <!-- 系统模块日志级别控制  -->
+    <logger name="com.ruoyi" level="info"/>
+    <logger name="com.huashe" level="debug">
+        <appender-ref ref="file_debugger"/>
+    </logger>
+    <!-- Spring日志级别控制  -->
+    <logger name="org.springframework" level="warn"/>
 
 
-	<root level="info">
-		<appender-ref ref="console" />
-	</root>
+    <root level="info">
+        <appender-ref ref="console"/>
+    </root>
 
 
-	<!--系统操作日志-->
+    <!--系统操作日志-->
     <root level="info">
     <root level="info">
-        <appender-ref ref="file_info" />
-        <appender-ref ref="file_error" />
+        <appender-ref ref="file_info"/>
+        <appender-ref ref="file_error"/>
     </root>
     </root>
 
 
-	<!--系统用户操作日志-->
+    <!--系统用户操作日志-->
     <logger name="sys-user" level="info">
     <logger name="sys-user" level="info">
         <appender-ref ref="sys-user"/>
         <appender-ref ref="sys-user"/>
     </logger>
     </logger>

+ 1 - 1
bd-park/park-backend/park-collect/src/main/java/com/huashe/park/collect/SpingMqttApplication.java

@@ -34,7 +34,7 @@ import com.dtflys.forest.springboot.annotation.ForestScan;
 })
 })
 @MapperScan("com.huashe.park.core.mapper")
 @MapperScan("com.huashe.park.core.mapper")
 @ForestScan(basePackages = {
 @ForestScan(basePackages = {
-    "com.huashe.park.infrastructure.uwb"
+    "com.huashe.park.infrastructure.uwb", "com.huashe.park.infrastructure.mqtt"
 })
 })
 @EnableAsync
 @EnableAsync
 public class SpingMqttApplication {
 public class SpingMqttApplication {

+ 81 - 0
bd-park/park-backend/park-collect/src/main/java/com/huashe/park/collect/config/TopicDataCfg.java

@@ -3,6 +3,10 @@ package com.huashe.park.collect.config;
 import java.util.List;
 import java.util.List;
 import java.util.Map;
 import java.util.Map;
 
 
+import com.alibaba.fastjson2.JSONObject;
+import com.huashe.common.utils.StringUtils;
+import com.huashe.park.common.ByteArrayUtil;
+import org.apache.commons.lang3.ArrayUtils;
 import org.springframework.boot.context.properties.ConfigurationProperties;
 import org.springframework.boot.context.properties.ConfigurationProperties;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.context.annotation.Configuration;
 
 
@@ -50,4 +54,81 @@ public class TopicDataCfg {
 
 
         private String byteSort = "little";
         private String byteSort = "little";
     }
     }
+
+    public JSONObject byteFormat(byte[] payload, Map<String, TopicDataCfg.Protocol> protocolMap) {
+        JSONObject jsonObject = new JSONObject();
+        protocolMap.forEach((key, value) -> {
+            String camelCase = StringUtils.toCamelCase(key);
+            switch (value.getType()) {
+                case "short":
+                    if (value.getByteSort().equals("big")) {
+                        jsonObject.put(camelCase, ByteArrayUtil.byteArray2Short_Big_Endian(
+                                getByteArray(payload, value.getRange().get(0), value.getRange().get(1))));
+                        break;
+                    }
+                    jsonObject.put(camelCase, ByteArrayUtil.byteArray2Short_Little_Endian(
+                            getByteArray(payload, value.getRange().get(0), value.getRange().get(1))));
+                    break;
+                case "byte":
+                    jsonObject.put(camelCase, getByteArray(payload, value.getRange().get(0), value.getRange().get(1)));
+                    break;
+                case "long":
+                    if (value.getByteSort().equals("big")) {
+                        jsonObject.put(camelCase, ByteArrayUtil.byteArray2Long_Big_Endian(
+                                getByteArray(payload, value.getRange().get(0), value.getRange().get(1))));
+                        break;
+                    }
+                    jsonObject.put(camelCase, ByteArrayUtil.byteArray2Long_Little_Endian(
+                            getByteArray(payload, value.getRange().get(0), value.getRange().get(1))));
+                    break;
+                case "int":
+                    if (value.getByteSort().equals("big")) {
+                        jsonObject.put(camelCase, ByteArrayUtil.byteArray2Int_Big_Endian(
+                                getByteArray(payload, value.getRange().get(0), value.getRange().get(1))));
+                        break;
+                    }
+                    jsonObject.put(camelCase, ByteArrayUtil.byteArray2Int_Little_Endian(
+                            getByteArray(payload, value.getRange().get(0), value.getRange().get(1))));
+                    break;
+                case "double":
+                    if (value.getByteSort().equals("big")) {
+                        jsonObject.put(camelCase, ByteArrayUtil.byteArray2Double_Big_Endian(
+                                getByteArray(payload, value.getRange().get(0), value.getRange().get(1))));
+                        break;
+                    }
+                    jsonObject.put(camelCase, ByteArrayUtil.byteArray2Double_Little_Endian(
+                            getByteArray(payload, value.getRange().get(0), value.getRange().get(1))));
+                    break;
+                case "float":
+                    if (value.getByteSort().equals("big")) {
+                        jsonObject.put(camelCase, ByteArrayUtil.byteArray2Float_Big_Endian(
+                                getByteArray(payload, value.getRange().get(0), value.getRange().get(1))));
+                        break;
+                    }
+                    jsonObject.put(camelCase, ByteArrayUtil.byteArray2Float_Little_Endian(
+                            getByteArray(payload, value.getRange().get(0), value.getRange().get(1))));
+                    break;
+                case "string":
+                    if (value.getRange().isEmpty()) {
+                        break;
+                    }
+                    if (value.getRange().size() > 1) {
+                        jsonObject.put(camelCase,
+                                new String(getByteArray(payload, value.getRange().get(0), value.getRange().get(1))));
+                        break;
+                    }
+                    jsonObject.put(camelCase,
+                            new String(getByteArray(payload, value.getRange().get(0), payload.length - 1)));
+                    break;
+                default:
+                    break;
+            }
+        });
+        return jsonObject;
+    }
+
+    private byte[] getByteArray(byte[] payload, Integer startIncludeIndex, Integer endIncludeIndex) {
+        return ArrayUtils.subarray(payload, startIncludeIndex, endIncludeIndex + 1);
+    }
+
 }
 }

+ 60 - 1
bd-park/park-backend/park-collect/src/main/java/com/huashe/park/collect/controller/TopicController.java

@@ -1,13 +1,26 @@
 package com.huashe.park.collect.controller;
 package com.huashe.park.collect.controller;
 
 
+import java.util.List;
+import java.util.concurrent.CountDownLatch;
+
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.bind.annotation.RestController;
 
 
+import com.huashe.common.domain.AjaxResult;
+import com.huashe.park.collect.config.TopicDataCfg;
+import com.huashe.park.collect.core.MqttMessageHandler;
 import com.huashe.park.collect.core.MqttTemplate;
 import com.huashe.park.collect.core.MqttTemplate;
-import com.huashe.park.collect.model.MqttRequest;
+import com.huashe.park.collect.model.TopicVO;
+import com.huashe.park.common.ByteArrayUtil;
+import com.huashe.park.common.SpringBeanUtils;
+import com.huashe.park.core.service.IMachineProcessResultService;
+import com.huashe.park.core.service.IMachineProcessService;
+import com.huashe.park.domain.dto.cons.MqttRequest;
+import com.huashe.park.domain.entity.MachineProcess;
+import com.huashe.park.domain.entity.MachineProcessResult;
 import com.ruoyi.common.annotation.Anonymous;
 import com.ruoyi.common.annotation.Anonymous;
 import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.controller.BaseController;
 
 
@@ -26,6 +39,15 @@ public class TopicController extends BaseController {
     @Autowired
     @Autowired
     private MqttTemplate mqttTemplate;
     private MqttTemplate mqttTemplate;
 
 
+    @Autowired
+    private TopicDataCfg topicDataCfg;
+
+    @Autowired
+    private IMachineProcessResultService machineProcessResultService;
+
+    @Autowired
+    private IMachineProcessService machineProcessService;
+
     @PostMapping
     @PostMapping
     @Anonymous
     @Anonymous
     public void send(@RequestBody MqttRequest jsonObject) {
     public void send(@RequestBody MqttRequest jsonObject) {
@@ -48,4 +70,41 @@ public class TopicController extends BaseController {
         mqttTemplate.sendByte(jsonObject.getTopic(), jsonObject.getTopic() + "/machine/piling/result", bytes,
         mqttTemplate.sendByte(jsonObject.getTopic(), jsonObject.getTopic() + "/machine/piling/result", bytes,
             jsonObject.getQos(), jsonObject.isRetained());
             jsonObject.getQos(), jsonObject.isRetained());
     }
     }
+
+    @PostMapping("/obj/byte/result")
+    @Anonymous
+    public AjaxResult sendObjResultByte(@RequestBody TopicVO result) throws Exception {
+        byte[] bytes = ByteArrayUtil.serializeObject(result.getResult());
+        MqttRequest jsonObject = result.getTopic();
+        mqttTemplate.sendByte(jsonObject.getTopic(), jsonObject.getTopic() + "/machine/piling/result", bytes,
+            jsonObject.getQos(), jsonObject.isRetained());
+        return AjaxResult.success(topicDataCfg.byteFormat(bytes, topicDataCfg.getResultTopic().getProtocol()));
+    }
+
+    @PostMapping("/obj/byte/process")
+    @Anonymous
+    public AjaxResult sendObjByte(@RequestBody TopicVO process) throws Exception {
+        byte[] bytes = ByteArrayUtil.serializeObject(process.getProcess());
+        MqttRequest jsonObject = process.getTopic();
+        mqttTemplate.sendByte(jsonObject.getTopic(), jsonObject.getTopic() + "/machine/piling/process", bytes,
+            jsonObject.getQos(), jsonObject.isRetained());
+        return AjaxResult.success(topicDataCfg.byteFormat(bytes, topicDataCfg.getProcessTopic().getProtocol()));
+    }
+
+    @PostMapping("/decode/result")
+    @Anonymous
+    public AjaxResult decodeResult(@RequestBody String hex) throws Exception {
+        byte[] bytes = HexUtil.decodeHex(
+            "c800000000019624524dcb696c66313731666c313131786271696f38776d6167656d384c37896159834a41894160e5621923410b368d6a59834a41628db143621923410a368d6a59834a41698db14362192341e56fcc3f90ae7bb00000000000000000e878bd3c0000000000000196245059ca0000019624524dca00000000c2c2499a3f262d4000000000e56fcc3fe56fcc3f000000000000000000000000000020428fae7b3000000000c800000000000196245059ca000001962450d6ac000001962450d6ac0000019624524dd4313131786271696f5f313130445339383431323330303231325f333639");
+        return AjaxResult.success(topicDataCfg.byteFormat(bytes, topicDataCfg.getResultTopic().getProtocol()));
+    }
+
+    // fffd00001fffd24524dfffd696c66313731666c313131786271696f38776d6167656d384c37fffd6159fffd4a41fffd4160fffd62192341b36fffd6a59fffd4a4162fffdfffd4362192341a36fffd6a59fffd4a4169fffdfffd4362192341fffd6ffffd3ffffdfffd7bfffd00000000fffd78fffd3c0000001fffd245059fffd001fffd24524dfffd0000fffdfffd49fffd3f262d400000fffd6ffffd3ffffd6ffffd3f000000000000002042fffdfffd7b300000fffd000001fffd245059fffd001fffd24505ac001fffd24505ac001fffd24524dfffd313131786271696f5f313130445339383431323330303231325f333639
+    @PostMapping("/new/topic")
+    @Anonymous
+    public void newTopic(@RequestBody MqttRequest mqttRequest) {
+        MqttMessageHandler bean = SpringBeanUtils.getBean(mqttRequest.getHandleBean());
+        mqttTemplate.subscribe(mqttRequest.getClientKey(), mqttRequest.getClientKey(), mqttRequest.getClientSecret(),
+            mqttRequest.getTopic(), mqttRequest.getQos(), bean);
+    }
 }
 }

+ 1 - 8
bd-park/park-backend/park-collect/src/main/java/com/huashe/park/collect/core/TopicMsgEngine.java

@@ -56,15 +56,8 @@ public abstract class TopicMsgEngine implements ITopicListener, MqttMessageHandl
                         JSONObject msg = queue.get(finalI).take();
                         JSONObject msg = queue.get(finalI).take();
                         messageBizHandle(msg);
                         messageBizHandle(msg);
                     }
                     }
-                    catch (InterruptedException e) {
+                    catch (Exception e) {
                         logger.error("{} error", this.engineName, e);
                         logger.error("{} error", this.engineName, e);
-                        // 重置中断状态
-                        Thread.currentThread().interrupt();
-                        // 根据业务逻辑决定是否继续执行
-                        if (Thread.currentThread().isInterrupted()) {
-                            logger.error("任务已中断,不再继续执行");
-                            break;
-                        }
                     }
                     }
                 }
                 }
             });
             });

+ 0 - 24
bd-park/park-backend/park-collect/src/main/java/com/huashe/park/collect/event/EventPublisherService.java

@@ -1,24 +0,0 @@
-package com.huashe.park.collect.event;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.ApplicationEventPublisher;
-import org.springframework.stereotype.Service;
-
-import com.huashe.park.domain.entity.MachineProcess;
-import com.huashe.park.domain.entity.MachineProcessResult;
-
-@Service
-public class EventPublisherService {
-    @Autowired
-    private ApplicationEventPublisher applicationEventPublisher;
-
-    public void publishMachineProcessEvent(final MachineProcess message) {
-        PileMachineConsRealtimeEvent customEvent = new PileMachineConsRealtimeEvent(this, message);
-        applicationEventPublisher.publishEvent(customEvent);
-    }
-
-    public void publishMachineResultEvent(final MachineProcessResult message) {
-        PileMachineConsResultEvent customEvent = new PileMachineConsResultEvent(this, message);
-        applicationEventPublisher.publishEvent(customEvent);
-    }
-}

+ 148 - 44
bd-park/park-backend/park-collect/src/main/java/com/huashe/park/collect/event/MachineRealtimeEventListener.java

@@ -1,23 +1,33 @@
 package com.huashe.park.collect.event;
 package com.huashe.park.collect.event;
 
 
+import static com.huashe.park.common.consts.RedisKey.DEPTH_PRESS_TIPS;
+import static com.huashe.park.common.consts.RedisKey.PILE_MACHINE_MQTT;
+import static com.huashe.park.common.consts.enums.ConsStatus.CONS_STATUS_00;
 import static com.huashe.park.common.consts.enums.ConsStatus.CONS_STATUS_02;
 import static com.huashe.park.common.consts.enums.ConsStatus.CONS_STATUS_02;
 
 
+import java.util.HashMap;
+import java.util.Map;
+
 import org.apache.commons.lang3.ObjectUtils;
 import org.apache.commons.lang3.ObjectUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.event.EventListener;
-import org.springframework.scheduling.annotation.Async;
-import org.springframework.stereotype.Component;
+import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
 
 
+import com.alibaba.fastjson2.JSONObject;
 import com.huashe.park.common.DateTimeUtil;
 import com.huashe.park.common.DateTimeUtil;
+import com.huashe.park.common.consts.RedisKey;
 import com.huashe.park.common.consts.enums.MachineStatus;
 import com.huashe.park.common.consts.enums.MachineStatus;
+import com.huashe.park.core.redis.RedisProxy;
 import com.huashe.park.core.service.IConsPileHoleInfoService;
 import com.huashe.park.core.service.IConsPileHoleInfoService;
 import com.huashe.park.core.service.IPileHoleIndexRealtimeService;
 import com.huashe.park.core.service.IPileHoleIndexRealtimeService;
 import com.huashe.park.core.service.IPileMachineInfoService;
 import com.huashe.park.core.service.IPileMachineInfoService;
 import com.huashe.park.domain.entity.ConsPileHoleInfo;
 import com.huashe.park.domain.entity.ConsPileHoleInfo;
+import com.huashe.park.domain.entity.MachineProcess;
+import com.huashe.park.domain.entity.MachineProcessResult;
 import com.huashe.park.domain.entity.PileHoleIndexRealtime;
 import com.huashe.park.domain.entity.PileHoleIndexRealtime;
 import com.huashe.park.domain.entity.PileMachineInfo;
 import com.huashe.park.domain.entity.PileMachineInfo;
 
 
-@Component
+@Service
 public class MachineRealtimeEventListener {
 public class MachineRealtimeEventListener {
 
 
     @Autowired
     @Autowired
@@ -32,13 +42,12 @@ public class MachineRealtimeEventListener {
     @Autowired
     @Autowired
     private IPileMachineInfoService pileMachineInfoService;
     private IPileMachineInfoService pileMachineInfoService;
 
 
-    @EventListener
-    @Async
-    public void handleConsProcessEvent(PileMachineConsRealtimeEvent event) {
-        ConsPileHoleInfo consPileHoleInfo = consPileHoleInfoService
-            .selectConsPileHoleInfoByteId(event.getMessage().getPileId());
-        PileMachineInfo pileMachineInfo = machineInfoService
-            .selectPileMachineInfoByByteId(event.getMessage().getMachineId());
+    @Autowired
+    private RedisProxy redisProxy;
+
+    public void handleConsProcess(MachineProcess message) {
+        ConsPileHoleInfo consPileHoleInfo = consPileHoleInfoService.selectConsPileHoleInfoByteId(message.getPileId());
+        PileMachineInfo pileMachineInfo = machineInfoService.selectPileMachineInfoByByteId(message.getMachineId());
         if (ObjectUtils.isEmpty(consPileHoleInfo) || ObjectUtils.isEmpty(pileMachineInfo)) {
         if (ObjectUtils.isEmpty(consPileHoleInfo) || ObjectUtils.isEmpty(pileMachineInfo)) {
             return;
             return;
         }
         }
@@ -51,42 +60,53 @@ public class MachineRealtimeEventListener {
         pileHoleIndexRealtime.setConsUnitId(consPileHoleInfo.getConsUnitId());
         pileHoleIndexRealtime.setConsUnitId(consPileHoleInfo.getConsUnitId());
         pileHoleIndexRealtime.setHoleNum(consPileHoleInfo.getHoleNum());
         pileHoleIndexRealtime.setHoleNum(consPileHoleInfo.getHoleNum());
 
 
-        pileHoleIndexRealtime.setCurrent(event.getMessage().getCurrent());
-        pileHoleIndexRealtime.setDepth(event.getMessage().getPileLength());
-        pileHoleIndexRealtime.setSprayPressure(event.getMessage().getSprayPressure());
-        pileHoleIndexRealtime.setTiltAngle(event.getMessage().getTiltAngle());
-        pileHoleIndexRealtime.setForwardTiltAngle(event.getMessage().getForwardTiltAngle());
-        // 带量
-        pileHoleIndexRealtime.setSprayVolume(event.getMessage().getSprayVolume());
-        pileHoleIndexRealtime.setVerticalDeviation(event.getMessage().getVerticalAngle());
-        pileHoleIndexRealtime.setStatus(CONS_STATUS_02.getCode());
-        pileHoleIndexRealtime.setRealLat(event.getMessage().getLatitude());
-        pileHoleIndexRealtime.setRealLng(event.getMessage().getLongitude());
-        pileHoleIndexRealtime.setRealX(event.getMessage().getRealX());
-        pileHoleIndexRealtime.setRealY(event.getMessage().getRealY());
+        pileHoleIndexRealtime.setCurrent(message.getCurrent());
+        pileHoleIndexRealtime.setDepth(message.getPileLength());
+        pileHoleIndexRealtime.setSprayPressure(message.getSprayPressure());
+        pileHoleIndexRealtime.setTiltAngle(message.getTiltAngle());
+        pileHoleIndexRealtime.setForwardTiltAngle(message.getForwardTiltAngle());
+        // 带量
+        pileHoleIndexRealtime.setSendSprayVolume(message.getSprayVolume());
+        pileHoleIndexRealtime.setVerticalDeviation(message.getVerticalAngle());
+        pileHoleIndexRealtime.setRealLat(message.getLatitude());
+        pileHoleIndexRealtime.setRealLng(message.getLongitude());
+        pileHoleIndexRealtime.setRealX(message.getRealX());
+        pileHoleIndexRealtime.setRealY(message.getRealY());
+        pileHoleIndexRealtime.setTenantId(consPileHoleInfo.getTenantId());
         int cnt = pileHoleIndexRealtimeService.updatePileHoleIndexRealtimeByHoleIdAndMachineId(pileHoleIndexRealtime);
         int cnt = pileHoleIndexRealtimeService.updatePileHoleIndexRealtimeByHoleIdAndMachineId(pileHoleIndexRealtime);
-        if (!(cnt > 0)) {
-            String dateFromMills = DateTimeUtil.getDateFromMills(event.getMessage().getDataTime());
+        String pileRedisKey = String.format(RedisKey.PILE_MACHINE_MQTT.MQTT_TOPIC_PREFIX, message.getPileId());
+        if (!redisProxy.hasKey(pileRedisKey)) {
+            redisProxy.putMapToHash(String.format(RedisKey.PILE_MACHINE_MQTT.MQTT_TOPIC_PREFIX, message.getPileId()),
+                generateMapTemplate(), 60 * 30);
+        }
+        if (cnt < 1) {
+            pileHoleIndexRealtime.setStatus(CONS_STATUS_02.getCode());
+            String dateFromMills = DateTimeUtil.getDateFromMills(message.getDataTime());
             pileHoleIndexRealtime.setStartTime(DateTimeUtil.parseDate(dateFromMills));
             pileHoleIndexRealtime.setStartTime(DateTimeUtil.parseDate(dateFromMills));
             pileHoleIndexRealtimeService.insertPileHoleIndexRealtime(pileHoleIndexRealtime);
             pileHoleIndexRealtimeService.insertPileHoleIndexRealtime(pileHoleIndexRealtime);
+            consPileHoleInfoService.updateConsPileHoleInfo(new ConsPileHoleInfo() {
+                {
+                    setId(consPileHoleInfo.getId());
+                    setConsStatus(CONS_STATUS_02.getCode());
+                }
+            });
         }
         }
+
         pileMachineInfoService.updatePileMachineInfo(new PileMachineInfo() {
         pileMachineInfoService.updatePileMachineInfo(new PileMachineInfo() {
             {
             {
                 setId(pileMachineInfo.getId());
                 setId(pileMachineInfo.getId());
-                setLat(event.getMessage().getLatitude());
-                setLng(event.getMessage().getLongitude());
+                setLat(consPileHoleInfo.getLat());
+                setLng(consPileHoleInfo.getLng());
                 setStatus(MachineStatus.MACHINE_STATUS_00.getCode());
                 setStatus(MachineStatus.MACHINE_STATUS_00.getCode());
             }
             }
         });
         });
+        // 处置各种最大值
+        handleMaxProcess(message);
     }
     }
 
 
-    @EventListener
-    @Async
-    public void handleConsResultEvent(PileMachineConsResultEvent event) {
-        ConsPileHoleInfo consPileHoleInfo = consPileHoleInfoService
-            .selectConsPileHoleInfoByteId(event.getMessage().getPileId());
-        PileMachineInfo pileMachineInfo = machineInfoService
-            .selectPileMachineInfoByByteId(event.getMessage().getMachineId());
+    public void handleConsResult(MachineProcessResult message) {
+        ConsPileHoleInfo consPileHoleInfo = consPileHoleInfoService.selectConsPileHoleInfoByteId(message.getPileId());
+        PileMachineInfo pileMachineInfo = machineInfoService.selectPileMachineInfoByByteId(message.getMachineId());
         if (ObjectUtils.isEmpty(consPileHoleInfo) || ObjectUtils.isEmpty(pileMachineInfo)) {
         if (ObjectUtils.isEmpty(consPileHoleInfo) || ObjectUtils.isEmpty(pileMachineInfo)) {
             return;
             return;
         }
         }
@@ -95,23 +115,32 @@ public class MachineRealtimeEventListener {
         pileHoleIndexRealtime.setHoleByteKey(consPileHoleInfo.getByteId());
         pileHoleIndexRealtime.setHoleByteKey(consPileHoleInfo.getByteId());
         pileHoleIndexRealtime.setMachineByteKey(pileMachineInfo.getByteId());
         pileHoleIndexRealtime.setMachineByteKey(pileMachineInfo.getByteId());
         pileHoleIndexRealtime.setMachineId(pileMachineInfo.getId());
         pileHoleIndexRealtime.setMachineId(pileMachineInfo.getId());
-        pileHoleIndexRealtime.setDepth(event.getMessage().getPileLength());
+        pileHoleIndexRealtime.setDepth(message.getPileLength());
         pileHoleIndexRealtime.setConsUnitId(consPileHoleInfo.getConsUnitId());
         pileHoleIndexRealtime.setConsUnitId(consPileHoleInfo.getConsUnitId());
         pileHoleIndexRealtime.setHoleNum(consPileHoleInfo.getHoleNum());
         pileHoleIndexRealtime.setHoleNum(consPileHoleInfo.getHoleNum());
-        pileHoleIndexRealtime.setSprayVolume(event.getMessage().getSprayVolume());
-        pileHoleIndexRealtime.setVerticalDeviation(event.getMessage().getVerticalDeviation());
-
-        if (ObjectUtils.isNotEmpty(event.getMessage().getEndTime())) {
-            String dateFromMills = DateTimeUtil.getDateFromMills(event.getMessage().getEndTime());
+        pileHoleIndexRealtime.setSprayVolume(message.getSprayVolume());
+        pileHoleIndexRealtime.setVerticalDeviation(message.getVerticalDeviation());
+        pileHoleIndexRealtime.setStatus(CONS_STATUS_00.getCode());
+        pileHoleIndexRealtime.setTenantId(consPileHoleInfo.getTenantId());
+        if (ObjectUtils.isNotEmpty(message.getEndTime())) {
+            String dateFromMills = DateTimeUtil.getDateFromMills(message.getEndTime());
             pileHoleIndexRealtime.setEndTime(DateTimeUtil.parseDate(dateFromMills));
             pileHoleIndexRealtime.setEndTime(DateTimeUtil.parseDate(dateFromMills));
         }
         }
-
+        pileHoleIndexRealtime
+            .setEndPress(getValue(message.getPileId(), PILE_MACHINE_MQTT.MQTT_TOPIC_PROCESS_MAX_PRESS));
+        pileHoleIndexRealtime.setDepthPress(depthPressMap(message.getPileId()));
         int cnt = pileHoleIndexRealtimeService.updatePileHoleIndexRealtimeByHoleIdAndMachineId(pileHoleIndexRealtime);
         int cnt = pileHoleIndexRealtimeService.updatePileHoleIndexRealtimeByHoleIdAndMachineId(pileHoleIndexRealtime);
-        if (!(cnt > 0)) {
-            String dateFromMills = DateTimeUtil.getDateFromMills(event.getMessage().getStartTime());
+        if (cnt < 1) {
+            String dateFromMills = DateTimeUtil.getDateFromMills(message.getStartTime());
             pileHoleIndexRealtime.setStartTime(DateTimeUtil.parseDate(dateFromMills));
             pileHoleIndexRealtime.setStartTime(DateTimeUtil.parseDate(dateFromMills));
             pileHoleIndexRealtimeService.insertPileHoleIndexRealtime(pileHoleIndexRealtime);
             pileHoleIndexRealtimeService.insertPileHoleIndexRealtime(pileHoleIndexRealtime);
         }
         }
+        consPileHoleInfoService.updateConsPileHoleInfo(new ConsPileHoleInfo() {
+            {
+                setId(consPileHoleInfo.getId());
+                setConsStatus(CONS_STATUS_00.getCode());
+            }
+        });
         pileMachineInfoService.updatePileMachineInfo(new PileMachineInfo() {
         pileMachineInfoService.updatePileMachineInfo(new PileMachineInfo() {
             {
             {
                 setId(pileMachineInfo.getId());
                 setId(pileMachineInfo.getId());
@@ -120,4 +149,79 @@ public class MachineRealtimeEventListener {
         });
         });
     }
     }
 
 
+    private void handleMaxProcess(MachineProcess message) {
+        Float maxPress = redisProxy.getHash(String.format(PILE_MACHINE_MQTT.MQTT_TOPIC_PREFIX, message.getPileId()),
+            PILE_MACHINE_MQTT.MQTT_TOPIC_PROCESS_MAX_PRESS);
+        Float maxDepth = redisProxy.getHash(String.format(PILE_MACHINE_MQTT.MQTT_TOPIC_PREFIX, message.getPileId()),
+            PILE_MACHINE_MQTT.MQTT_TOPIC_PROCESS_MAX_DEPTH);
+        Float sprayPressure = message.getSprayPressure();
+        // 如果压力大于最大压力,则更新最大压力
+        if (sprayPressure > maxPress) {
+            redisProxy.putHash(String.format(PILE_MACHINE_MQTT.MQTT_TOPIC_PREFIX, message.getPileId()),
+                PILE_MACHINE_MQTT.MQTT_TOPIC_PROCESS_MAX_PRESS, sprayPressure);
+        }
+        // 如果深度大于最大深度,则更新最大深度
+        if (message.getPileLength() > maxDepth) {
+            redisProxy.putHash(String.format(PILE_MACHINE_MQTT.MQTT_TOPIC_PREFIX, message.getPileId()),
+                PILE_MACHINE_MQTT.MQTT_TOPIC_PROCESS_MAX_DEPTH, message.getPileLength());
+        }
+        {
+            // 获取当前深度对应的最大压力
+            int index = (int) Math.floor(message.getPileLength() / 0.25f);
+            Float maxDepthPress = redisProxy.getHash(
+                String.format(PILE_MACHINE_MQTT.MQTT_TOPIC_PREFIX, message.getPileId()), Integer.toString(index));
+            if (maxDepthPress < sprayPressure) {
+                redisProxy.putHash(String.format(PILE_MACHINE_MQTT.MQTT_TOPIC_PREFIX, message.getPileId()),
+                    Integer.toString(index), sprayPressure);
+            }
+        }
+    }
+
+    private <T> T getValue(String pileId, String key) {
+        return redisProxy.getHash(String.format(PILE_MACHINE_MQTT.MQTT_TOPIC_PREFIX, pileId), key);
+    }
+
+    private JSONObject depthPressMap(String pileId) {
+        Map<String, Float> allHash = redisProxy.getAllHash(String.format(PILE_MACHINE_MQTT.MQTT_TOPIC_PREFIX, pileId));
+        if (CollectionUtils.isEmpty(allHash)) {
+            return null;
+        }
+        JSONObject result = new JSONObject(DEPTH_PRESS_TIPS.PILE_LENGTH_TIPS);
+        Float press;
+        fillDepthZeroPressMap(allHash);
+        for (int i = 0; i <= DEPTH_PRESS_TIPS.PILE_LENGTH_TIPS; i += 1) {
+            press = allHash.get(Integer.toString(i));
+            result.put(String.format("%.2fm", i * 0.25), press);
+        }
+        return result;
+    }
+
+    private void fillDepthZeroPressMap(Map<String, Float> allHash) {
+        int prevNonZeroIndex = -1;
+        Float press;
+        Float currentValue;
+        for (int i = 0; i <= DEPTH_PRESS_TIPS.PILE_LENGTH_TIPS; i++) {
+            press = allHash.get(Integer.toString(i));
+            if (press > 0F) {
+                currentValue = press;
+                for (int j = prevNonZeroIndex + 1; j < i; j++) {
+                    allHash.put(Integer.toString(j), currentValue);
+                }
+                prevNonZeroIndex = i;
+            }
+        }
+    }
+
+    private Map<String, Object> generateMapTemplate() {
+        Map<String, Object> result = new HashMap<String, Object>() {
+            {
+                put(PILE_MACHINE_MQTT.MQTT_TOPIC_PROCESS_MAX_PRESS, 0F);
+                put(PILE_MACHINE_MQTT.MQTT_TOPIC_PROCESS_MAX_DEPTH, 0F);
+            }
+        };
+        for (int i = 0; i <= DEPTH_PRESS_TIPS.PILE_LENGTH_TIPS; i += 1) {
+            result.put(Integer.toString(i), 0F);
+        }
+        return result;
+    }
 }
 }

+ 0 - 22
bd-park/park-backend/park-collect/src/main/java/com/huashe/park/collect/event/PileMachineConsRealtimeEvent.java

@@ -1,22 +0,0 @@
-package com.huashe.park.collect.event;
-
-import org.springframework.context.ApplicationEvent;
-
-import com.huashe.park.domain.entity.MachineProcess;
-
-public class PileMachineConsRealtimeEvent extends ApplicationEvent {
-    private MachineProcess message;
-
-    public PileMachineConsRealtimeEvent(Object source, MachineProcess message) {
-        super(source);
-        this.message = message;
-    }
-
-    public MachineProcess getMessage() {
-        return message;
-    }
-
-    public void setMessage(MachineProcess message) {
-        this.message = message;
-    }
-}

+ 0 - 22
bd-park/park-backend/park-collect/src/main/java/com/huashe/park/collect/event/PileMachineConsResultEvent.java

@@ -1,22 +0,0 @@
-package com.huashe.park.collect.event;
-
-import org.springframework.context.ApplicationEvent;
-
-import com.huashe.park.domain.entity.MachineProcessResult;
-
-public class PileMachineConsResultEvent extends ApplicationEvent {
-    private MachineProcessResult message;
-
-    public PileMachineConsResultEvent(Object source, MachineProcessResult message) {
-        super(source);
-        this.message = message;
-    }
-
-    public MachineProcessResult getMessage() {
-        return message;
-    }
-
-    public void setMessage(MachineProcessResult message) {
-        this.message = message;
-    }
-}

+ 29 - 89
bd-park/park-backend/park-collect/src/main/java/com/huashe/park/collect/handle/RootMsgHandler.java

@@ -12,7 +12,6 @@ package com.huashe.park.collect.handle;
 
 
 import java.util.ArrayList;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.List;
-import java.util.Map;
 import java.util.concurrent.LinkedBlockingQueue;
 import java.util.concurrent.LinkedBlockingQueue;
 
 
 import javax.annotation.PostConstruct;
 import javax.annotation.PostConstruct;
@@ -25,12 +24,12 @@ import org.springframework.stereotype.Service;
 
 
 import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONObject;
 import com.alibaba.fastjson2.JSONObject;
-import com.huashe.common.utils.StringUtils;
 import com.huashe.park.collect.config.TopicDataCfg;
 import com.huashe.park.collect.config.TopicDataCfg;
 import com.huashe.park.collect.core.TopicMsgEngine;
 import com.huashe.park.collect.core.TopicMsgEngine;
-import com.huashe.park.collect.event.EventPublisherService;
+import com.huashe.park.collect.event.MachineRealtimeEventListener;
 import com.huashe.park.common.ByteArrayUtil;
 import com.huashe.park.common.ByteArrayUtil;
 import com.huashe.park.common.DateTimeUtil;
 import com.huashe.park.common.DateTimeUtil;
+import com.huashe.park.core.redis.RedisProxy;
 import com.huashe.park.core.service.IMachineProcessResultService;
 import com.huashe.park.core.service.IMachineProcessResultService;
 import com.huashe.park.core.service.IMachineProcessService;
 import com.huashe.park.core.service.IMachineProcessService;
 import com.huashe.park.domain.entity.MachineProcess;
 import com.huashe.park.domain.entity.MachineProcess;
@@ -44,7 +43,7 @@ import com.huashe.park.domain.entity.MachineProcessResult;
  * @see [相关类/方法]
  * @see [相关类/方法]
  * @since [产品/模块版本]
  * @since [产品/模块版本]
  */
  */
-@Service
+@Service("RootMsgHandler")
 public class RootMsgHandler extends TopicMsgEngine {
 public class RootMsgHandler extends TopicMsgEngine {
 
 
     @Autowired
     @Autowired
@@ -65,7 +64,10 @@ public class RootMsgHandler extends TopicMsgEngine {
     private IMachineProcessResultService machineProcessResultService;
     private IMachineProcessResultService machineProcessResultService;
 
 
     @Autowired
     @Autowired
-    private EventPublisherService eventPublisherService;
+    private MachineRealtimeEventListener machineRealtimeEventListener;
+
+    @Autowired
+    private RedisProxy redisProxy;
 
 
     @PostConstruct
     @PostConstruct
     public void init() {
     public void init() {
@@ -83,8 +85,17 @@ public class RootMsgHandler extends TopicMsgEngine {
     public void handle(String topic, byte[] payload) {
     public void handle(String topic, byte[] payload) {
         JSONObject jsonObject = new JSONObject();
         JSONObject jsonObject = new JSONObject();
         jsonObject.put(TOPIC_NAME, topic);
         jsonObject.put(TOPIC_NAME, topic);
-        jsonObject.put("key", topic);
-        jsonObject.put(TOPIC_PAYLOAD, payload);
+        if (topic.endsWith(topicDataCfg.getResultTopic().getName())) {
+            JSONObject data = topicDataCfg.byteFormat(payload, topicDataCfg.getResultTopic().getProtocol());
+            jsonObject.put("key", data.get("pileId"));
+            jsonObject.put(TOPIC_PAYLOAD, data);
+        }
+
+        if (topic.endsWith(topicDataCfg.getProcessTopic().getName())) {
+            JSONObject data = topicDataCfg.byteFormat(payload, topicDataCfg.getProcessTopic().getProtocol());
+            jsonObject.put("key", data.get("pileId"));
+            jsonObject.put(TOPIC_PAYLOAD, data);
+        }
         push(jsonObject);
         push(jsonObject);
     }
     }
 
 
@@ -93,103 +104,32 @@ public class RootMsgHandler extends TopicMsgEngine {
         String topic = json.getString(TOPIC_NAME);
         String topic = json.getString(TOPIC_NAME);
         // 结果数据处理
         // 结果数据处理
         if (topic.endsWith(topicDataCfg.getResultTopic().getName())) {
         if (topic.endsWith(topicDataCfg.getResultTopic().getName())) {
-            byte[] bytes = json.getBytes(TOPIC_PAYLOAD);
-            JSONObject jsonObject = byteFormat(bytes, topicDataCfg.getResultTopic().getProtocol());
+            JSONObject jsonObject = json.getJSONObject(TOPIC_PAYLOAD);
             MachineProcessResult machineProcess = JSON.parseObject(jsonObject.toString(), MachineProcessResult.class);
             MachineProcessResult machineProcess = JSON.parseObject(jsonObject.toString(), MachineProcessResult.class);
             machineProcess.setRecordTime(DateTimeUtil.getDateFromMills(machineProcess.getDataTime()));
             machineProcess.setRecordTime(DateTimeUtil.getDateFromMills(machineProcess.getDataTime()));
             machineProcess.setDt(
             machineProcess.setDt(
                 DateTimeUtil.getDateFromMills(machineProcess.getDataTime(), DateTimeUtil.DateFormatter.yyyyMMdd));
                 DateTimeUtil.getDateFromMills(machineProcess.getDataTime(), DateTimeUtil.DateFormatter.yyyyMMdd));
+            // 结合下行深度effectiveDown 以及 开始和结束时间 sendStartTime sendEndTime,计算平均下行速度
+            machineProcess.setAvgSpeed(machineProcess.getEffectiveDown()
+                / (machineProcess.getEndTime() - machineProcess.getStartTime()) * 1000);
+            // 结合下行深度effectiveDown 以及 开始和结束时间 pullingStartTime pullingEndTime, 计算平均拔管速度。并且保留两位小数
+            machineProcess.setAvgUpSpeed(machineProcess.getEffectiveDown()
+                / (machineProcess.getPullingEndTime() - machineProcess.getPullingStartTime()) * 1000);
             machineProcessResultService.insertMachineProcessResult(machineProcess);
             machineProcessResultService.insertMachineProcessResult(machineProcess);
-            eventPublisherService.publishMachineResultEvent(machineProcess);
+            machineRealtimeEventListener.handleConsResult(machineProcess);
+            return;
         }
         }
         if (topic.endsWith(topicDataCfg.getProcessTopic().getName())) {
         if (topic.endsWith(topicDataCfg.getProcessTopic().getName())) {
-            byte[] bytes = json.getBytes(TOPIC_PAYLOAD);
-            JSONObject jsonObject = byteFormat(bytes, topicDataCfg.getProcessTopic().getProtocol());
+            JSONObject jsonObject = json.getJSONObject(TOPIC_PAYLOAD);
             MachineProcess machineProcess = JSON.parseObject(jsonObject.toString(), MachineProcess.class);
             MachineProcess machineProcess = JSON.parseObject(jsonObject.toString(), MachineProcess.class);
             machineProcess.setRecordTime(DateTimeUtil.getDateFromMills(machineProcess.getDataTime()));
             machineProcess.setRecordTime(DateTimeUtil.getDateFromMills(machineProcess.getDataTime()));
             machineProcess.setDt(
             machineProcess.setDt(
                 DateTimeUtil.getDateFromMills(machineProcess.getDataTime(), DateTimeUtil.DateFormatter.yyyyMMdd));
                 DateTimeUtil.getDateFromMills(machineProcess.getDataTime(), DateTimeUtil.DateFormatter.yyyyMMdd));
             machineProcessService.insertMachineProcess(machineProcess);
             machineProcessService.insertMachineProcess(machineProcess);
-            eventPublisherService.publishMachineProcessEvent(machineProcess);
+            machineRealtimeEventListener.handleConsProcess(machineProcess);
         }
         }
     }
     }
 
 
-    private JSONObject byteFormat(byte[] payload, Map<String, TopicDataCfg.Protocol> protocolMap) {
-        JSONObject jsonObject = new JSONObject();
-        protocolMap.forEach((key, value) -> {
-            String camelCase = StringUtils.toCamelCase(key);
-            switch (value.getType()) {
-                case "short":
-                    if (value.getByteSort().equals("big")) {
-                        jsonObject.put(camelCase, ByteArrayUtil.byteArray2Short_Big_Endian(
-                            getByteArray(payload, value.getRange().get(0), value.getRange().get(1))));
-                        break;
-                    }
-                    jsonObject.put(camelCase, ByteArrayUtil.byteArray2Short_Little_Endian(
-                        getByteArray(payload, value.getRange().get(0), value.getRange().get(1))));
-                    break;
-                case "byte":
-                    jsonObject.put(camelCase, getByteArray(payload, value.getRange().get(0), value.getRange().get(1)));
-                    break;
-                case "long":
-                    if (value.getByteSort().equals("big")) {
-                        jsonObject.put(camelCase, ByteArrayUtil.byteArray2Long_Big_Endian(
-                            getByteArray(payload, value.getRange().get(0), value.getRange().get(1))));
-                        break;
-                    }
-                    jsonObject.put(camelCase, ByteArrayUtil.byteArray2Long_Little_Endian(
-                        getByteArray(payload, value.getRange().get(0), value.getRange().get(1))));
-                    break;
-                case "int":
-                    if (value.getByteSort().equals("big")) {
-                        jsonObject.put(camelCase, ByteArrayUtil.byteArray2Int_Big_Endian(
-                            getByteArray(payload, value.getRange().get(0), value.getRange().get(1))));
-                        break;
-                    }
-                    jsonObject.put(camelCase, ByteArrayUtil.byteArray2Int_Little_Endian(
-                        getByteArray(payload, value.getRange().get(0), value.getRange().get(1))));
-                    break;
-                case "double":
-                    if (value.getByteSort().equals("big")) {
-                        jsonObject.put(camelCase, ByteArrayUtil.byteArray2Double_Big_Endian(
-                            getByteArray(payload, value.getRange().get(0), value.getRange().get(1))));
-                        break;
-                    }
-                    jsonObject.put(camelCase, ByteArrayUtil.byteArray2Double_Little_Endian(
-                        getByteArray(payload, value.getRange().get(0), value.getRange().get(1))));
-                    break;
-                case "float":
-                    if (value.getByteSort().equals("big")) {
-                        jsonObject.put(camelCase, ByteArrayUtil.byteArray2Float_Big_Endian(
-                            getByteArray(payload, value.getRange().get(0), value.getRange().get(1))));
-                        break;
-                    }
-                    jsonObject.put(camelCase, ByteArrayUtil.byteArray2Float_Little_Endian(
-                        getByteArray(payload, value.getRange().get(0), value.getRange().get(1))));
-                    break;
-                case "string":
-                    if (value.getRange().isEmpty()) {
-                        break;
-                    }
-                    if (value.getRange().size() > 1) {
-                        jsonObject.put(camelCase,
-                            new String(getByteArray(payload, value.getRange().get(0), value.getRange().get(1))));
-                        break;
-                    }
-                    jsonObject.put(camelCase,
-                        new String(getByteArray(payload, value.getRange().get(0), payload.length - 1)));
-                    break;
-                default:
-                    break;
-            }
-        });
-        return jsonObject;
-    }
-
-    private byte[] getByteArray(byte[] payload, Integer startIncludeIndex, Integer endIncludeIndex) {
-        return ArrayUtils.subarray(payload, startIncludeIndex, endIncludeIndex + 1);
-    }
-
     public static void main(String[] args) {
     public static void main(String[] args) {
         byte[] bytes = ByteArrayUtil.hexString2ByteArray(
         byte[] bytes = ByteArrayUtil.hexString2ByteArray(
             "590200000001951C387150353061623664373875393537343066346D75656466653462FA7E6A04ACCE5041A8C64B37EA401C4163077186A3CE50410F490C00A6401C4163077186A3CE5041FE480C00A6401C41000000000000000000000000000000000000000000000000000001951C37D7CB000001951C38711A00000000643BDF4F8DD72C400000000000000000000000000000000000000000000000000000204100000000000000005902000000000000000000000000000075393537343066345F313130445339383339333230303030325F");
             "590200000001951C387150353061623664373875393537343066346D75656466653462FA7E6A04ACCE5041A8C64B37EA401C4163077186A3CE50410F490C00A6401C4163077186A3CE5041FE480C00A6401C41000000000000000000000000000000000000000000000000000001951C37D7CB000001951C38711A00000000643BDF4F8DD72C400000000000000000000000000000000000000000000000000000204100000000000000005902000000000000000000000000000075393537343066345F313130445339383339333230303030325F");

+ 0 - 59
bd-park/park-backend/park-collect/src/main/java/com/huashe/park/collect/model/MqttRequest.java

@@ -1,59 +0,0 @@
-/*
- * 文 件 名:  MqttRequest
- * 版    权:  浩鲸云计算科技股份有限公司
- * 描    述:  <描述>
- * 修 改 人:  lvwenbin
- * 修改时间:  2024/5/6
- * 跟踪单号:  <跟踪单号>
- * 修改单号:  <修改单号>
- * 修改内容:  <修改内容>
- */
-package com.huashe.park.collect.model;
-
-/**
- * 发送请求
- * <功能详细描述>
- *
- * @author lvwenbin
- * @version [版本号, 2024/5/6]
- * @see [相关类/方法]
- * @since [产品/模块版本]
- */
-public class MqttRequest {
-    private String topic;
-    private String payload;
-    private int qos;
-    private boolean retained;
-
-    public String getTopic() {
-        return topic;
-    }
-
-    public void setTopic(String topic) {
-        this.topic = topic;
-    }
-
-    public String getPayload() {
-        return payload;
-    }
-
-    public void setPayload(String payload) {
-        this.payload = payload;
-    }
-
-    public int getQos() {
-        return qos;
-    }
-
-    public void setQos(int qos) {
-        this.qos = qos;
-    }
-
-    public boolean isRetained() {
-        return retained;
-    }
-
-    public void setRetained(boolean retained) {
-        this.retained = retained;
-    }
-}

+ 16 - 0
bd-park/park-backend/park-collect/src/main/java/com/huashe/park/collect/model/TopicVO.java

@@ -0,0 +1,16 @@
+package com.huashe.park.collect.model;
+
+import com.huashe.park.domain.dto.cons.MqttRequest;
+import com.huashe.park.domain.entity.MachineProcess;
+import com.huashe.park.domain.entity.MachineProcessResult;
+
+import lombok.Data;
+
+@Data
+public class TopicVO {
+    MachineProcessResult result;
+
+    MachineProcess process;
+
+    MqttRequest topic;
+}

+ 93 - 0
bd-park/park-backend/park-collect/src/main/resources/application-local.yml

@@ -0,0 +1,93 @@
+## MQTT##
+aliyun:
+  mqtt:
+    uri: tcp://xt.wenhq.top:8581
+
+
+# 数据源配置
+spring:
+  # redis 配置
+  redis:
+    # 地址
+    host: 127.0.0.1
+    # 端口,默认为6379
+    port: 16379
+    # 数据库索引
+    database: 1
+    # 密码
+    password:
+    # 连接超时时间
+    timeout: 10s
+    lettuce:
+      pool:
+        # 连接池中的最小空闲连接
+        min-idle: 0
+        # 连接池中的最大空闲连接
+        max-idle: 8
+        # 连接池的最大数据库连接数
+        max-active: 8
+        # #连接池最大阻塞等待时间(使用负值表示没有限制)
+        max-wait: 3s
+  cache:
+    cache-names:
+      - pileHoleList
+      - pileMachineList
+  datasource:
+    type: com.alibaba.druid.pool.DruidDataSource
+    driverClassName: com.mysql.cj.jdbc.Driver
+    druid:
+      # 主库数据源
+      master:
+        url: jdbc:mysql://127.0.0.1:3306/hs_bds?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+        username: root
+        password: 123456
+      # 从库数据源
+      pkb:
+        # 从数据源开关/默认关闭
+        enabled: true
+        url: jdbc:mysql://127.0.0.1:3306/hs_bds?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+        username: root
+        password: 123456
+      # 初始连接数
+      initialSize: 5
+      # 最小连接池数量
+      minIdle: 10
+      # 最大连接池数量
+      maxActive: 20
+      # 配置获取连接等待超时的时间
+      maxWait: 60000
+      # 配置连接超时时间
+      connectTimeout: 30000
+      # 配置网络超时时间
+      socketTimeout: 60000
+      # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
+      timeBetweenEvictionRunsMillis: 60000
+      # 配置一个连接在池中最小生存的时间,单位是毫秒
+      minEvictableIdleTimeMillis: 300000
+      # 配置一个连接在池中最大生存的时间,单位是毫秒
+      maxEvictableIdleTimeMillis: 900000
+      # 配置检测连接是否有效
+      validationQuery: SELECT 1 FROM DUAL
+      testWhileIdle: true
+      testOnBorrow: false
+      testOnReturn: false
+      webStatFilter:
+        enabled: true
+      statViewServlet:
+        enabled: true
+        # 设置白名单,不填则允许所有访问
+        allow:
+        url-pattern: /druid/*
+        # 控制台管理用户名和密码
+        login-username: ruoyi
+        login-password: 123456
+      filter:
+        stat:
+          enabled: true
+          # 慢SQL记录
+          log-slow-sql: true
+          slow-sql-millis: 1000
+          merge-sql: true
+        wall:
+          config:
+            multi-statement-allow: true

+ 1 - 1
bd-park/park-backend/park-collect/src/main/resources/application-locale.yml → bd-park/park-backend/park-collect/src/main/resources/application-pre.yml

@@ -11,7 +11,7 @@ spring:
     # 地址
     # 地址
     host: 127.0.0.1
     host: 127.0.0.1
     # 端口,默认为6379
     # 端口,默认为6379
-    port: 6379
+    port: 16379
     # 数据库索引
     # 数据库索引
     database: 1
     database: 1
     # 密码
     # 密码

+ 1 - 1
bd-park/park-backend/park-collect/src/main/resources/application.yml

@@ -3,7 +3,7 @@ spring:
   application:
   application:
     name: ems-collect
     name: ems-collect
   profiles:
   profiles:
-    active: locale
+    active: local
     include:
     include:
       - topic
       - topic
       - schedule
       - schedule

+ 25 - 2
bd-park/park-backend/park-collect/src/main/resources/logback.xml

@@ -3,7 +3,7 @@
     <!-- 日志存放路径 -->
     <!-- 日志存放路径 -->
 	<property name="log.path" value="/opt/project/ruoyi/ruoyi-backend/collect-logs" />
 	<property name="log.path" value="/opt/project/ruoyi/ruoyi-backend/collect-logs" />
     <!-- 日志输出格式 -->
     <!-- 日志输出格式 -->
-	<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
+	<property name="log.pattern" value="%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
 
 
 	<!-- 控制台输出 -->
 	<!-- 控制台输出 -->
 	<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
 	<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
@@ -34,7 +34,27 @@
             <onMismatch>DENY</onMismatch>
             <onMismatch>DENY</onMismatch>
         </filter>
         </filter>
 	</appender>
 	</appender>
-	
+    <appender name="file_debugger" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <file>${log.path}/sys-debugger.log</file>
+        <!-- 循环政策:基于时间创建日志文件 -->
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <!-- 日志文件名格式 -->
+            <fileNamePattern>${log.path}/sys-debugger.%d{yyyy-MM-dd}.log</fileNamePattern>
+            <!-- 日志最大的历史 60天 -->
+            <maxHistory>60</maxHistory>
+        </rollingPolicy>
+        <encoder>
+            <pattern>${log.pattern}</pattern>
+        </encoder>
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <!-- 过滤的级别 -->
+            <level>DEBUG</level>
+            <!-- 匹配时的操作:接收(记录) -->
+            <onMatch>ACCEPT</onMatch>
+            <!-- 不匹配时的操作:拒绝(不记录) -->
+            <onMismatch>DENY</onMismatch>
+        </filter>
+    </appender>
 	<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
 	<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
 	    <file>${log.path}/sys-error.log</file>
 	    <file>${log.path}/sys-error.log</file>
         <!-- 循环政策:基于时间创建日志文件 -->
         <!-- 循环政策:基于时间创建日志文件 -->
@@ -73,6 +93,9 @@
 	
 	
 	<!-- 系统模块日志级别控制  -->
 	<!-- 系统模块日志级别控制  -->
 	<logger name="com.ruoyi" level="info" />
 	<logger name="com.ruoyi" level="info" />
+    <logger name="com.huashe" level="debug" >
+        <appender-ref ref="file_debugger" />
+    </logger>
 	<!-- Spring日志级别控制  -->
 	<!-- Spring日志级别控制  -->
 	<logger name="org.springframework" level="warn" />
 	<logger name="org.springframework" level="warn" />
 
 

+ 136 - 0
bd-park/park-backend/park-collect/src/test/java/com/huashe/park/collect/controller/TopicControllerTest.java

@@ -0,0 +1,136 @@
+package com.huashe.park.collect.controller;
+
+import java.util.List;
+import java.util.concurrent.CountDownLatch;
+
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit.jupiter.SpringExtension;
+
+import com.huashe.park.collect.SpingMqttApplication;
+import com.huashe.park.collect.core.MqttTemplate;
+import com.huashe.park.common.ByteArrayUtil;
+import com.huashe.park.core.service.IMachineProcessResultService;
+import com.huashe.park.core.service.IMachineProcessService;
+import com.huashe.park.domain.entity.MachineProcess;
+import com.huashe.park.domain.entity.MachineProcessResult;
+
+@SpringBootTest(classes = SpingMqttApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
+@ExtendWith(SpringExtension.class)
+class TopicControllerTest {
+
+    @Autowired
+    private MqttTemplate mqttTemplate;
+
+    @Autowired
+    private IMachineProcessResultService machineProcessResultService;
+
+    @Autowired
+    private IMachineProcessService machineProcessService;
+
+    @Test
+    void machineMessagePushTest() {
+        List<MachineProcessResult> machineProcessResults = machineProcessResultService
+            .selectMachineProcessResultList(new MachineProcessResult() {
+                {
+                    setPileId("ilf171fk");
+                }
+            });
+        List<MachineProcess> machineProcesses = machineProcessService.selectMachineProcessList(new MachineProcess() {
+            {
+                setPileId("ilf171fk");
+            }
+        });
+
+        CountDownLatch latch = new CountDownLatch(1);
+        long l = System.currentTimeMillis();
+        // 过程线程:处理数据并发送信号
+        Thread processThread = new Thread(() -> {
+            System.out.println("[过程线程] 开始处理数据...");
+            machineProcesses.forEach(machineProcess -> {
+                byte[] bytes;
+                try {
+                    Thread.sleep(1000);
+                    machineProcess.setId(null);
+                    machineProcess.setPileId("5jij1lvm");
+                    machineProcess.setMachineId("nzmcaigw");
+                    machineProcess.setDataTime(System.currentTimeMillis());
+                    machineProcess.setUuid(Long.toString(System.currentTimeMillis()));
+                    if (machineProcesses.indexOf(machineProcess) > machineProcesses.size() - 3) {
+                        latch.countDown(); // 发送信号(计数减1)
+                    }
+                    bytes = ByteArrayUtil.serializeObject(machineProcess);
+                    mqttTemplate.sendByte("110DS98412300212/TEST002", "110DS98412300212/TEST002/machine/piling/process",
+                        bytes, 0, false);
+
+                }
+                catch (Exception e) {
+                    throw new RuntimeException(e);
+                }
+            });
+            System.out.println("[过程线程] 数据处理完成,发送启动信号");
+
+        });
+
+        // 结果线程:等待信号后处理结果
+        Thread resultThread = new Thread(() -> {
+            try {
+                System.out.println("[结果线程] 等待启动信号...");
+                latch.await(); // 阻塞直到门闩计数归零
+                machineProcessResults.forEach(result -> {
+                    byte[] bytes;
+                    try {
+                        System.out.println(">>>>>>>>>>>>>>>>>" + result.getId());
+                        result.setId(null);
+                        result.setPileId("5jij1lvm");
+                        result.setMachineId("nzmcaigw");
+                        result.setDataTime(System.currentTimeMillis());
+                        result.setStartTime(l);
+                        result.setEndTime(System.currentTimeMillis());
+                        result.setUuid(Long.toString(System.currentTimeMillis()));
+                        bytes = ByteArrayUtil.serializeObject(result);
+                        mqttTemplate.sendByte("110DS98412300212/TEST002",
+                            "110DS98412300212/TEST002/machine/piling/result", bytes, 0, false);
+                    }
+                    catch (Exception e) {
+                        throw new RuntimeException(e);
+                    }
+                });
+                System.out.println("[结果线程] 收到信号,开始处理结果数据");
+                // 此处添加具体的结果处理逻辑
+            }
+            catch (Exception e) {
+                throw new RuntimeException(e);
+            }
+        });
+        // 启动线程
+        processThread.start();
+        resultThread.start();
+
+        // 等待线程执行完成
+        try {
+            processThread.join();
+            resultThread.join();
+
+        }
+        catch (InterruptedException e) {
+            e.printStackTrace();
+        }
+        // 模拟施工结束,再次施工之前推送回带量数据
+        machineProcessResults.forEach(result -> {
+            byte[] bytes;
+            try {
+                System.out.println(">>>>>>>>>>>>>>>>>" + result.getId());
+                result.setSprayVolume(0.37f);
+                bytes = ByteArrayUtil.serializeObject(result);
+                mqttTemplate.sendByte("110DS98412300212/TEST002", "110DS98412300212/TEST002/machine/piling/result",
+                    bytes, 0, false);
+            }
+            catch (Exception e) {
+                throw new RuntimeException(e);
+            }
+        });
+    }
+}

+ 31 - 0
bd-park/park-backend/park-common/pom.xml

@@ -144,6 +144,37 @@
             <groupId>cn.hutool</groupId>
             <groupId>cn.hutool</groupId>
             <artifactId>hutool-core</artifactId>
             <artifactId>hutool-core</artifactId>
         </dependency>
         </dependency>
+
+        <dependency>
+            <groupId>org.geotools</groupId>
+            <artifactId>gt-api</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>javax.media</groupId>
+                    <artifactId>jai_core</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>jgridshift</groupId>
+                    <artifactId>jgridshift</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>commons-pool</groupId>
+                    <artifactId>commons-pool</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>net.sf.geographiclib</groupId>
+                    <artifactId>GeographicLib-Java</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.geotools</groupId>
+            <artifactId>gt-epsg-hsql</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.huashe.common</groupId>
+            <artifactId>prod-commons</artifactId>
+        </dependency>
     </dependencies>
     </dependencies>
 
 
 </project>
 </project>

+ 101 - 2
bd-park/park-backend/park-common/src/main/java/com/huashe/park/common/ByteArrayUtil.java

@@ -1,5 +1,15 @@
 package com.huashe.park.common;
 package com.huashe.park.common;
 
 
+import java.lang.reflect.Field;
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+import java.nio.charset.StandardCharsets;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import com.huashe.park.common.animations.FixedLength;
+
 /**
 /**
  * @author : chencheng
  * @author : chencheng
  * @date : 2020-05-01
  * @date : 2020-05-01
@@ -393,9 +403,7 @@ public class ByteArrayUtil {
      */
      */
 
 
     public static byte[] hexString2ByteArray(String hexString) {
     public static byte[] hexString2ByteArray(String hexString) {
-
         // 两个十六进制字符一个 byte,单数则有误
         // 两个十六进制字符一个 byte,单数则有误
-
         if (hexString.length() % 2 != 0) {
         if (hexString.length() % 2 != 0) {
 
 
             return null;
             return null;
@@ -435,4 +443,95 @@ public class ByteArrayUtil {
 
 
     }
     }
 
 
+    public static byte[] serializeObject(Object obj) throws Exception {
+        List<byte[]> fieldBytesList = new ArrayList<>();
+        int totalLength = 0;
+
+        // 遍历所有字段
+        for (Field field : obj.getClass().getDeclaredFields()) {
+            field.setAccessible(true); // 允许访问私有字段
+
+            // 检查是否包含@FixedLength注解
+            if (!field.isAnnotationPresent(FixedLength.class)) {
+                continue;
+            }
+
+            // 获取注解中定义的字节长度
+            FixedLength annotation = field.getAnnotation(FixedLength.class);
+            int length = annotation.value();
+
+            // 根据字段类型转换字节数组
+            Object value = field.get(obj);
+            byte[] bytes = convertFieldToBytes(field.getType(), value, length, annotation.paddingByte());
+
+            fieldBytesList.add(bytes);
+            totalLength += bytes.length;
+        }
+
+        // 合并所有字节数组
+        ByteBuffer buffer = ByteBuffer.allocate(totalLength).order(ByteOrder.BIG_ENDIAN); // 默认大端序
+        for (byte[] bytes : fieldBytesList) {
+            buffer.put(bytes);
+        }
+        return buffer.array();
+    }
+
+    // 处理不同类型字段的字节转换
+    private static byte[] convertFieldToBytes(Class<?> type, Object value, int length, byte padByte) {
+        if (type == byte.class || type == Byte.class) {
+            validateLength(type, length, 1);
+            return new byte[] {
+                (byte) value
+            };
+        }
+        else if (type == int.class || type == Integer.class) {
+            // 整数处理:固定长度(需匹配类型自然长度)
+            validateLength(type, length, 4);
+            return ByteArrayUtil.int2ByteArray_Little_Endian((int) value);
+        }
+        else if (type == short.class || type == Short.class) {
+            validateLength(type, length, 2);
+            return ByteArrayUtil.short2ByteArray_Little_Endian((short) value);
+        }
+        else if (type == long.class || type == Long.class) {
+            validateLength(type, length, 8);
+            return ByteArrayUtil.long2ByteArray_Big_Endian((long) value);
+        }
+        else if (type == float.class || type == Float.class) {
+            validateLength(type, length, 4);
+            return ByteArrayUtil.float2ByteArray_Little_Endian((float) value);
+        }
+        else if (type == double.class || type == Double.class) {
+            validateLength(type, length, 8);
+            return ByteArrayUtil.double2ByteArray_Little_Endian((double) value);
+        }
+        else if (type == String.class) {
+            byte[] src = ((String) value).getBytes(StandardCharsets.UTF_8);
+            if (length < 0) {
+                return src;
+            }
+            return adjustLength(src, length, padByte);
+        }
+        else {
+            throw new UnsupportedOperationException("不支持的类型: " + type);
+        }
+    }
+
+    private static void validateLength(Class<?> type, int actual, int expected) {
+        if (actual != expected)
+            throw new IllegalArgumentException(type.getSimpleName() + "类型必须为" + expected + "字节");
+    }
+
+    private static byte[] adjustLength(byte[] src, int targetLen, byte padByte) {
+        byte[] dest = new byte[targetLen];
+        int copyLen = Math.min(src.length, targetLen);
+        System.arraycopy(src, 0, dest, 0, copyLen);
+        Arrays.fill(dest, copyLen, targetLen, padByte);
+        return dest;
+    }
+
+    public static void main(String[] args) {
+        System.out.println(Arrays.toString(long2ByteArray_Big_Endian(23040L)));
+    }
+
 }
 }

+ 14 - 0
bd-park/park-backend/park-common/src/main/java/com/huashe/park/common/animations/FixedLength.java

@@ -0,0 +1,14 @@
+package com.huashe.park.common.animations;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Retention(RetentionPolicy.RUNTIME) // 注解在运行时生效
+@Target(ElementType.FIELD) // 仅用于字段
+public @interface FixedLength {
+    int value(); // 指定字段的固定字节长度
+
+    byte paddingByte() default 0;
+}

+ 5 - 0
bd-park/park-backend/park-common/src/main/java/com/huashe/park/common/animations/mybatis/Converter.java

@@ -0,0 +1,5 @@
+package com.huashe.park.common.animations.mybatis;
+
+public interface Converter<S, T> {
+    T convert(S source);
+}

+ 20 - 0
bd-park/park-backend/park-common/src/main/java/com/huashe/park/common/animations/mybatis/ConverterCache.java

@@ -0,0 +1,20 @@
+package com.huashe.park.common.animations.mybatis;
+
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+public class ConverterCache {
+    private static final Map<Class<?>, Converter<?, ?>> cache = new ConcurrentHashMap<>();
+
+    @SuppressWarnings("unchecked")
+    public static <C extends Converter<?, ?>> C getConverter(Class<C> converterClass) {
+        return (C) cache.computeIfAbsent(converterClass, clz -> {
+            try {
+                return (Converter<?, ?>) clz.getDeclaredConstructor().newInstance();
+            }
+            catch (Exception e) {
+                throw new RuntimeException("Failed to create converter: " + clz.getName(), e);
+            }
+        });
+    }
+}

+ 34 - 0
bd-park/park-backend/park-common/src/main/java/com/huashe/park/common/animations/mybatis/FieldMetadataCache.java

@@ -0,0 +1,34 @@
+package com.huashe.park.common.animations.mybatis;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Field;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+public class FieldMetadataCache {
+    private static final Map<Class<?>, List<Field>> cache = new ConcurrentHashMap<>();
+
+    public static List<Field> getAnnotatedFields(Class<?> clazz, Class<? extends Annotation> annotation) {
+
+        return cache.computeIfAbsent(clazz, key -> {
+            List<Field> fields = new ArrayList<>();
+            Class<?> currentClass = clazz;
+            // 递归向上遍历所有父类
+            while (currentClass != null && currentClass != Object.class) {
+                Arrays.stream(currentClass.getDeclaredFields()).filter(f -> f.isAnnotationPresent(annotation))
+                    .forEach(filed -> {
+                        if (!filed.isAccessible()) {
+                            filed.setAccessible(true);
+                        }
+                        fields.add(filed);
+                    });
+                currentClass = currentClass.getSuperclass();
+            }
+            return Collections.unmodifiableList(fields);
+        });
+    }
+}

+ 39 - 0
bd-park/park-backend/park-common/src/main/java/com/huashe/park/common/animations/mybatis/MethodMetadataCache.java

@@ -0,0 +1,39 @@
+package com.huashe.park.common.animations.mybatis;
+
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+import org.apache.ibatis.mapping.MappedStatement;
+
+import com.huashe.common.annotation.mybatis.IgnoreTenant;
+
+public class MethodMetadataCache {
+    private static final Map<String, List<Method>> cache = new ConcurrentHashMap<>();
+
+    public static List<Method> getAnnotatedMethods(MappedStatement mappedStatement) {
+
+        return cache.computeIfAbsent(mappedStatement.getId(), key -> {
+            try {
+                String methodId = mappedStatement.getId();
+                int lastDotIndex = methodId.lastIndexOf(".");
+                String className = methodId.substring(0, lastDotIndex);
+                Class<?> mapperClass = Class.forName(className);
+                if (mapperClass.isAnnotationPresent(IgnoreTenant.class)) {
+                    return Collections.emptyList();
+                }
+                List<Method> methods = new ArrayList<>();
+                Arrays.stream(mapperClass.getMethods()).filter(f -> !f.isAnnotationPresent(IgnoreTenant.class))
+                    .forEach(methods::add);
+                return Collections.unmodifiableList(methods);
+            }
+            catch (ClassNotFoundException e) {
+                return null;
+            }
+        });
+    }
+}

+ 15 - 0
bd-park/park-backend/park-common/src/main/java/com/huashe/park/common/animations/mybatis/emuns/FieldConvert.java

@@ -0,0 +1,15 @@
+package com.huashe.park.common.animations.mybatis.emuns;
+
+
+import com.huashe.park.common.animations.mybatis.Converter;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.FIELD)
+public @interface FieldConvert {
+    Class<? extends Converter<?, ?>> converter();
+}

+ 16 - 0
bd-park/park-backend/park-common/src/main/java/com/huashe/park/common/animations/mybatis/service/JsonConverter.java

@@ -0,0 +1,16 @@
+package com.huashe.park.common.animations.mybatis.service;
+
+import org.apache.commons.lang3.StringUtils;
+
+import com.alibaba.fastjson2.JSONObject;
+import com.huashe.park.common.animations.mybatis.Converter;
+
+public class JsonConverter implements Converter<String, JSONObject> {
+    @Override
+    public JSONObject convert(String source) {
+        if (StringUtils.isEmpty(source)) {
+            return null;
+        }
+        return JSONObject.parseObject(source);
+    }
+}

+ 14 - 0
bd-park/park-backend/park-common/src/main/java/com/huashe/park/common/consts/RedisKey.java

@@ -0,0 +1,14 @@
+package com.huashe.park.common.consts;
+
+public class RedisKey {
+    public interface PILE_MACHINE_MQTT {
+        String MQTT_TOPIC_PREFIX = "mqtt:process:%s";
+
+        String MQTT_TOPIC_PROCESS_MAX_PRESS = "maxPress";
+
+        String MQTT_TOPIC_PROCESS_MAX_DEPTH = "maxDepth";
+    }
+    public interface DEPTH_PRESS_TIPS {
+        int PILE_LENGTH_TIPS = 240;
+    }
+}

+ 82 - 0
bd-park/park-backend/park-common/src/main/java/com/huashe/park/common/consts/enums/ConsResult.java

@@ -0,0 +1,82 @@
+package com.huashe.park.common.consts.enums;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * The enum Cons result.
+ */
+public enum ConsResult {
+    /**
+     * S cons result.
+     */
+    S(0, "S", "成功"),
+    /**
+     * X cons result.
+     */
+    X(1, "X", "失败"),
+    /**
+     * Sr cons result.
+     */
+    SR(2, "SR", "补桩成功");
+
+    private final Integer code;
+
+    private final String value;
+
+    private final String info;
+
+    private static final Map<Integer, ConsResult> dic = new HashMap<>();
+
+    static {
+        for (ConsResult status : values()) {
+            dic.put(status.code, status);
+        }
+    }
+
+    ConsResult(Integer code, String value, String info) {
+        this.code = code;
+        this.info = info;
+        this.value = value;
+    }
+
+    /**
+     * Gets code.
+     *
+     * @return the code
+     */
+    public Integer getCode() {
+        return code;
+    }
+
+    /**
+     * Gets value.
+     *
+     * @return the value
+     */
+    public String getValue() {
+        return value;
+    }
+
+    /**
+     * Gets info.
+     *
+     * @return the info
+     */
+    public String getInfo() {
+        return info;
+    }
+
+    /**
+     * Gets by code.
+     *
+     * @param code the code
+     * @return the by code
+     */
+    public static ConsResult getByCode(Integer code) {
+        if (!dic.containsKey(code)) {
+            return X;
+        }
+        return dic.get(code);
+    }
+}

+ 18 - 0
bd-park/park-backend/park-common/src/main/java/com/huashe/park/common/consts/enums/ConsStatus.java

@@ -1,5 +1,8 @@
 package com.huashe.park.common.consts.enums;
 package com.huashe.park.common.consts.enums;
 
 
+import java.util.HashMap;
+import java.util.Map;
+
 /**
 /**
  * The enum Cons status.
  * The enum Cons status.
  */
  */
@@ -21,6 +24,14 @@ public enum ConsStatus {
 
 
     private final String info;
     private final String info;
 
 
+    private static final Map<String, ConsStatus> dic = new HashMap<>();
+
+    static {
+        for (ConsStatus status : values()) {
+            dic.put(status.code, status);
+        }
+    }
+
     ConsStatus(String code, String info) {
     ConsStatus(String code, String info) {
         this.code = code;
         this.code = code;
         this.info = info;
         this.info = info;
@@ -43,4 +54,11 @@ public enum ConsStatus {
     public String getInfo() {
     public String getInfo() {
         return info;
         return info;
     }
     }
+
+    public static ConsStatus getByCode(String code) {
+        if (!dic.containsKey(code)){
+            return CONS_STATUS_01;
+        }
+        return dic.get(code);
+    }
 }
 }

+ 163 - 0
bd-park/park-backend/park-common/src/main/java/com/huashe/park/common/geo/CoordinateUtil.java

@@ -0,0 +1,163 @@
+package com.huashe.park.common.geo;
+
+import org.geotools.geometry.jts.JTS;
+import org.geotools.referencing.CRS;
+import org.locationtech.jts.geom.Coordinate;
+import org.opengis.referencing.FactoryException;
+import org.opengis.referencing.crs.CoordinateReferenceSystem;
+import org.opengis.referencing.operation.MathTransform;
+
+import java.math.BigDecimal;
+import java.text.DecimalFormat;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+public final class CoordinateUtil {
+    // 2000坐标转wgs84坐标
+    public static Double[] getCoordinate(Double x, Double y) {
+        Double[] res = new Double[2];
+        Coordinate tar = null;
+        try {
+            // 封装点,这个是通用的,也可以用POINT(y,x)
+            // private static WKTReader reader = new WKTReader( geometryFactory );
+            Coordinate sour = new Coordinate(y, x);
+            // 这里要选择转换的坐标系是可以随意更换的
+            CoordinateReferenceSystem source = CRS.decode("EPSG:4549");
+            CoordinateReferenceSystem target = CRS.decode("EPSG:4326");
+            // 建立转换,下面两个我屏掉的转换方式会报出需要3/7参数的异常
+            // MathTransform mathTransform = CRS.findMathTransform(source, target);
+            // MathTransform mathTransform1 = CRS.findMathTransform(source, target, false);
+            MathTransform transform = CRS.findMathTransform(source, target, true);
+            tar = new Coordinate();
+            // 转换
+            JTS.transform(sour, tar, transform);
+        }
+        catch (FactoryException | org.opengis.referencing.operation.TransformException e) {
+            e.printStackTrace();
+        }
+        String[] split = (tar.toString().substring(1, tar.toString().length() - 1)).split(",");
+        // 经纬度精度
+        DecimalFormat fm = new DecimalFormat("0.0000000");
+        res[0] = Double.valueOf(fm.format(Double.valueOf(split[0])));
+        res[1] = Double.valueOf(fm.format(Double.valueOf(split[1])));
+        return res;
+    }
+
+    /**
+     * wgs84坐标转2000坐标
+     * 
+     * @param B 纬度
+     * @param L 经度
+     * @param degree 角度,即所用的地图是几度的,列如CGCS2000_3_Degree_GK_CM_120E 表示该地 图是3度的
+     * @return
+     */
+    private Map<String, Double> GetXY(double B, double L, double degree) {
+        Map<String, Double> map = new HashMap<>();
+        double[] xy = new double[] {
+            0.0D, 0.0D
+        };
+        double a = 6378137.0D;
+        double b = 6356752.314245179D;
+        double e = 0.081819190842621D;
+        double eC = 0.0820944379496957D;
+        double L0 = 0.0D;
+        int n;
+        if (degree == 6.0D) {
+            n = (int) Math.round((L + degree / (double) 2) / degree);
+            L0 = degree * (double) n - degree / (double) 2;
+        }
+        else {
+            n = (int) Math.round(L / degree);
+            L0 = degree * (double) n;
+        }
+
+        double radB = B * 3.141592653589793D / (double) 180;
+        double radL = L * 3.141592653589793D / (double) 180;
+        double deltaL = (L - L0) * 3.141592653589793D / (double) 180;
+        double N = a * a / b / Math.sqrt((double) 1 + eC * eC * Math.cos(radB) * Math.cos(radB));
+        double C1 = 1.0D + 0.75D * e * e + 0.703125D * Math.pow(e, 4.0D) + 0.68359375D * Math.pow(e, 6.0D)
+            + 0.67291259765625D * Math.pow(e, 8.0D);
+        double C2 = 0.75D * e * e + 0.9375D * Math.pow(e, 4.0D) + 1.025390625D * Math.pow(e, 6.0D)
+            + 1.07666015625D * Math.pow(e, 8.0D);
+        double C3 = 0.234375D * Math.pow(e, 4.0D) + 0.41015625D * Math.pow(e, 6.0D)
+            + 0.538330078125D * Math.pow(e, 8.0D);
+        double C4 = 0.068359375D * Math.pow(e, 6.0D) + 0.15380859375D * Math.pow(e, 8.0D);
+        double C5 = 0.00240325927734375D * Math.pow(e, 8.0D);
+        double t = Math.tan(radB);
+        double eta = eC * Math.cos(radB);
+        double X = a * ((double) 1 - e * e)
+            * (C1 * radB - C2 * Math.sin((double) 2 * radB) / (double) 2 + C3 * Math.sin((double) 4 * radB) / (double) 4
+                - C4 * Math.sin((double) 6 * radB) / (double) 6 + C5 * Math.sin((double) 8 * radB));
+        xy[0] = X + N * Math.sin(radB) * Math.cos(radB) * Math.pow(deltaL, 2.0D)
+            * ((double) 1
+                + Math.pow(deltaL * Math.cos(radB), 2.0D)
+                    * ((double) 5 - t * t + (double) 9 * eta * eta + (double) 4 * Math.pow(eta, 4.0D)) / (double) 12
+                + Math.pow(deltaL * Math.cos(radB), 4.0D) * ((double) 61 - (double) 58 * t * t + Math.pow(t, 4.0D))
+                    / (double) 360)
+            / (double) 2;
+        xy[1] = N * deltaL * Math.cos(radB)
+            * ((double) 1 + Math.pow(deltaL * Math.cos(radB), 2.0D) * ((double) 1 - t * t + eta * eta) / (double) 6
+                + Math.pow(deltaL * Math.cos(radB), 4.0D) * ((double) 5 - (double) 18 * t * t + Math.pow(t, 4.0D)
+                    - (double) 14 * eta * eta - (double) 58 * eta * eta * t * t) / (double) 120)
+            + (double) 500000;
+        // return "纬度Y:"+xy[0]+"---经度X"+xy[1];
+        map.put("X", xy[1]);
+        map.put("Y", xy[0]);
+        return map;
+    }
+
+    // 度分秒地理位置转wgs84坐标
+    private String getPosition(String position) {
+        String[] degree = position.split("\\°");
+        if (degree.length == 1) {
+            return position;
+        }
+        String d = degree[0];
+        String[] one = degree[1].split("\\′");
+        String a = one[0];
+        if (!a.contains(".")) {
+            if (a.substring(0, 1).equals("0")) {
+                a = a.substring(1);
+            }
+        }
+        else if (a.contains(".") && a.split("\\.").length > 1) {
+            a = a.substring(1);
+        }
+        String[] two = one[1].split("\\″");
+        String b = two[0];
+        if (!b.contains(".")) {
+            if (b.substring(0, 1).equals("0")) {
+                b = b.substring(1);
+            }
+        }
+        else if (b.contains(".") && b.split("\\.").length > 1) {
+            if (b.substring(0, 1).equals("0")) {
+                b = b.substring(1);
+            }
+        }
+        BigDecimal fen = new BigDecimal(a);
+        BigDecimal miao = new BigDecimal(b);
+        BigDecimal du = new BigDecimal(d);
+        // float f = Float.valueOf(a)+ Float.valueOf(Float.valueOf(b)/60);
+        // float du = Float.valueOf(f/60)+Float.valueOf(d);
+        BigDecimal add = fen.add(miao.divide(new BigDecimal("60"), 6, BigDecimal.ROUND_HALF_UP))
+            .divide(new BigDecimal("60"), 6, BigDecimal.ROUND_HALF_UP).add(du);
+        return String.valueOf(add);
+    }
+
+    private boolean isDouble(String str1, String str2) {
+        try {
+            Double.parseDouble(str1);
+            Double.parseDouble(str2);
+            return true;
+        }
+        catch (NumberFormatException ex) {
+        }
+        return false;
+    }
+
+    public static void main(String[] args) {
+        System.out.println(Arrays.toString(getCoordinate(2833742.70380015070,582577.02485382770)));
+    }
+}

+ 2 - 0
bd-park/park-backend/park-core/src/main/java/com/huashe/park/core/mapper/ConsPileHoleInfoMapper.java

@@ -4,6 +4,7 @@ import java.util.List;
 
 
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Param;
 
 
+import com.huashe.common.annotation.mybatis.Tenant;
 import com.huashe.park.domain.dto.cons.PileRealtimeIndex;
 import com.huashe.park.domain.dto.cons.PileRealtimeIndex;
 import com.huashe.park.domain.entity.ConsPileHoleInfo;
 import com.huashe.park.domain.entity.ConsPileHoleInfo;
 
 
@@ -32,6 +33,7 @@ public interface ConsPileHoleInfoMapper {
      */
      */
     public List<ConsPileHoleInfo> selectConsPileHoleInfoList(ConsPileHoleInfo consPileHoleInfo);
     public List<ConsPileHoleInfo> selectConsPileHoleInfoList(ConsPileHoleInfo consPileHoleInfo);
 
 
+    @Tenant(tableAlias = "cphi")
     List<PileRealtimeIndex> selectConsPileHoleRealtimeIndex(ConsPileHoleInfo consPileHoleInfo);
     List<PileRealtimeIndex> selectConsPileHoleRealtimeIndex(ConsPileHoleInfo consPileHoleInfo);
 
 
     public List<ConsPileHoleInfo> selectNonConsPileHoleInfo(ConsPileHoleInfo consPileHoleInfo);
     public List<ConsPileHoleInfo> selectNonConsPileHoleInfo(ConsPileHoleInfo consPileHoleInfo);

+ 2 - 0
bd-park/park-backend/park-core/src/main/java/com/huashe/park/core/mapper/ConsUnitInfoMapper.java

@@ -4,6 +4,7 @@ import java.util.List;
 
 
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Param;
 
 
+import com.huashe.common.annotation.mybatis.Tenant;
 import com.huashe.park.domain.entity.ConsUnitInfo;
 import com.huashe.park.domain.entity.ConsUnitInfo;
 
 
 /**
 /**
@@ -69,6 +70,7 @@ public interface ConsUnitInfoMapper {
 
 
     int updateConstUnitChildren(@Param("consUnits") List<ConsUnitInfo> consUnits);
     int updateConstUnitChildren(@Param("consUnits") List<ConsUnitInfo> consUnits);
 
 
+    @Tenant(tableAlias = "unit")
     List<String> qryMachineAssignedUnitAncestors(Long machineId);
     List<String> qryMachineAssignedUnitAncestors(Long machineId);
 
 
     List<ConsUnitInfo> qryConsUnitInfoByIds(@Param("ids") List<String> ids);
     List<ConsUnitInfo> qryConsUnitInfoByIds(@Param("ids") List<String> ids);

+ 2 - 0
bd-park/park-backend/park-core/src/main/java/com/huashe/park/core/mapper/ConsUnitMachineRelMapper.java

@@ -2,6 +2,7 @@ package com.huashe.park.core.mapper;
 
 
 import java.util.List;
 import java.util.List;
 
 
+import com.huashe.common.annotation.mybatis.IgnoreTenant;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Param;
 
 
 import com.huashe.park.domain.entity.ConsUnitMachineRel;
 import com.huashe.park.domain.entity.ConsUnitMachineRel;
@@ -12,6 +13,7 @@ import com.huashe.park.domain.entity.ConsUnitMachineRel;
  * @author ruoyi
  * @author ruoyi
  * @date 2025-02-17
  * @date 2025-02-17
  */
  */
+@IgnoreTenant
 public interface ConsUnitMachineRelMapper {
 public interface ConsUnitMachineRelMapper {
     /**
     /**
      * 查询施工单元桩机关系
      * 查询施工单元桩机关系

+ 2 - 0
bd-park/park-backend/park-core/src/main/java/com/huashe/park/core/mapper/MachineProcessResultMapper.java

@@ -2,6 +2,7 @@ package com.huashe.park.core.mapper;
 
 
 import java.util.List;
 import java.util.List;
 
 
+import com.huashe.common.annotation.mybatis.Tenant;
 import com.huashe.park.domain.dto.cons.ConsUnitResult;
 import com.huashe.park.domain.dto.cons.ConsUnitResult;
 import com.huashe.park.domain.entity.MachineProcessResult;
 import com.huashe.park.domain.entity.MachineProcessResult;
 
 
@@ -62,6 +63,7 @@ public interface MachineProcessResultMapper {
      */
      */
     public int deleteMachineProcessResultByIds(Long[] ids);
     public int deleteMachineProcessResultByIds(Long[] ids);
 
 
+    @Tenant(tableAlias = "cphir")
     List<ConsUnitResult> qeyConsUnitResult(Long consUnitId);
     List<ConsUnitResult> qeyConsUnitResult(Long consUnitId);
 
 
 }
 }

+ 3 - 0
bd-park/park-backend/park-core/src/main/java/com/huashe/park/core/mapper/PileMachineInfoMapper.java

@@ -3,6 +3,7 @@ package com.huashe.park.core.mapper;
 import java.util.HashMap;
 import java.util.HashMap;
 import java.util.List;
 import java.util.List;
 
 
+import com.huashe.common.annotation.mybatis.Tenant;
 import com.huashe.park.domain.entity.PileMachineInfo;
 import com.huashe.park.domain.entity.PileMachineInfo;
 
 
 /**
 /**
@@ -64,7 +65,9 @@ public interface PileMachineInfoMapper {
 
 
     HashMap<String, Integer> cntMachineOnOffline();
     HashMap<String, Integer> cntMachineOnOffline();
 
 
+    @Tenant(tableAlias = "cpmi")
     List<PileMachineInfo> qryUnitMachine(Long consUnitId);
     List<PileMachineInfo> qryUnitMachine(Long consUnitId);
+    @Tenant(tableAlias = "cpmi")
     List<PileMachineInfo> selectMachineByConsUnitId(Long consUnitId);
     List<PileMachineInfo> selectMachineByConsUnitId(Long consUnitId);
 
 
 }
 }

+ 5 - 2
bd-park/park-backend/park-core/src/main/java/com/huashe/park/core/mapper/SysCustConfigMapper.java

@@ -1,6 +1,7 @@
 package com.huashe.park.core.mapper;
 package com.huashe.park.core.mapper;
 
 
 import com.huashe.common.annotation.DataSource;
 import com.huashe.common.annotation.DataSource;
+import com.huashe.common.annotation.mybatis.IgnoreTenant;
 import com.huashe.common.enums.DataSourceType;
 import com.huashe.common.enums.DataSourceType;
 import com.huashe.park.domain.entity.CustSysConfig;
 import com.huashe.park.domain.entity.CustSysConfig;
 
 
@@ -9,10 +10,12 @@ public interface SysCustConfigMapper {
 
 
     int updateConfig(CustSysConfig custSysConfig);
     int updateConfig(CustSysConfig custSysConfig);
 
 
+    @IgnoreTenant
     CustSysConfig selectConfigById(Long id);
     CustSysConfig selectConfigById(Long id);
 
 
-    CustSysConfig checkConfigKeyUnique(String configKey);
+    @IgnoreTenant
+    CustSysConfig checkConfigKeyUnique(CustSysConfig configKey);
 
 
-    CustSysConfig selectConfig(CustSysConfig param);
+    CustSysConfig selectTenantConfig(CustSysConfig param);
 
 
 }
 }

+ 2 - 0
bd-park/park-backend/park-core/src/main/java/com/huashe/park/core/mapper/SysCustDictDataMapper.java

@@ -3,6 +3,7 @@ package com.huashe.park.core.mapper;
 import java.util.List;
 import java.util.List;
 import java.util.Map;
 import java.util.Map;
 
 
+import com.huashe.common.annotation.mybatis.IgnoreTenant;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Param;
 
 
 import com.huashe.common.annotation.DataSource;
 import com.huashe.common.annotation.DataSource;
@@ -14,6 +15,7 @@ import com.huashe.common.enums.DataSourceType;
  * @author ruoyi
  * @author ruoyi
  */
  */
 @DataSource(DataSourceType.MASTER)
 @DataSource(DataSourceType.MASTER)
+@IgnoreTenant
 public interface SysCustDictDataMapper {
 public interface SysCustDictDataMapper {
     /**
     /**
      * 根据条件分页查询字典数据
      * 根据条件分页查询字典数据

+ 39 - 0
bd-park/park-backend/park-core/src/main/java/com/huashe/park/core/redis/RedisProxy.java

@@ -7,6 +7,7 @@ import java.util.Map;
 import java.util.Set;
 import java.util.Set;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeUnit;
 
 
+import org.apache.commons.lang3.ObjectUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.redis.core.BoundSetOperations;
 import org.springframework.data.redis.core.BoundSetOperations;
 import org.springframework.data.redis.core.HashOperations;
 import org.springframework.data.redis.core.HashOperations;
@@ -14,6 +15,8 @@ import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.data.redis.core.ValueOperations;
 import org.springframework.data.redis.core.ValueOperations;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
+import cn.hutool.core.bean.BeanUtil;
+
 @Service
 @Service
 public class RedisProxy {
 public class RedisProxy {
     @Autowired
     @Autowired
@@ -238,4 +241,40 @@ public class RedisProxy {
     public Collection<String> keys(final String pattern) {
     public Collection<String> keys(final String pattern) {
         return redisTemplate.keys(pattern);
         return redisTemplate.keys(pattern);
     }
     }
+
+    /**
+     * Put hash.
+     *
+     * @param <T> the type parameter
+     * @param key the key
+     * @param obj the obj
+     * @param expire the expire seconds
+     * @author chen.cheng
+     */
+    public <T> void putHash(String key, T obj, Integer expire) {
+        Map<String, Object> hash = BeanUtil.beanToMap(obj);
+        redisTemplate.opsForHash().putAll(key, hash);
+        if (ObjectUtils.isNotEmpty(expire)) {
+            redisTemplate.opsForHash().getOperations().expire(key, expire, TimeUnit.SECONDS);
+        }
+    }
+
+    public void putMapToHash(String key, Map<String, Object> obj, Integer expire) {
+        redisTemplate.opsForHash().putAll(key, obj);
+        if (ObjectUtils.isNotEmpty(expire)) {
+            redisTemplate.opsForHash().getOperations().expire(key, expire, TimeUnit.SECONDS);
+        }
+    }
+
+    public <T, R> void putHash(String key, String fieldName, R val) {
+        redisTemplate.opsForHash().put(key, fieldName, val);
+    }
+
+    public <R> R getHash(String key, String fieldName) {
+        return (R) redisTemplate.opsForHash().get(key, fieldName);
+    }
+
+    public Map getAllHash(String key) {
+        return redisTemplate.opsForHash().entries(key);
+    }
 }
 }

+ 7 - 0
bd-park/park-backend/park-core/src/main/java/com/huashe/park/core/service/IConsUnitInfoService.java

@@ -6,6 +6,7 @@ import javax.servlet.http.HttpServletResponse;
 
 
 import com.huashe.park.domain.dto.cons.ConsUnitMachine;
 import com.huashe.park.domain.dto.cons.ConsUnitMachine;
 import com.huashe.park.domain.entity.ConsUnitInfo;
 import com.huashe.park.domain.entity.ConsUnitInfo;
+import org.springframework.web.multipart.MultipartFile;
 
 
 /**
 /**
  * 施工单元Service接口
  * 施工单元Service接口
@@ -40,6 +41,8 @@ public interface IConsUnitInfoService {
      */
      */
     int insertConsUnitInfo(ConsUnitMachine consUnitInfo);
     int insertConsUnitInfo(ConsUnitMachine consUnitInfo);
 
 
+    int insertConsUnitInfo(ConsUnitInfo consUnitInfo);
+
     /**
     /**
      * 修改施工单元
      * 修改施工单元
      * 
      * 
@@ -68,12 +71,16 @@ public interface IConsUnitInfoService {
      */
      */
     int deleteConsUnitInfoById(Long id);
     int deleteConsUnitInfoById(Long id);
 
 
+    int deleteConsUnitInfoByProjectId(Long projId);
+
     void importConsUnitHole(ConsUnitInfo consUnitHole);
     void importConsUnitHole(ConsUnitInfo consUnitHole);
 
 
     void exportConsUnitHole(ConsUnitInfo consUnitHole, HttpServletResponse response);
     void exportConsUnitHole(ConsUnitInfo consUnitHole, HttpServletResponse response);
 
 
     void exportConsUnitRes(ConsUnitInfo consUnitHole, HttpServletResponse response);
     void exportConsUnitRes(ConsUnitInfo consUnitHole, HttpServletResponse response);
 
 
+    void upload(MultipartFile file);
+
     List<ConsUnitInfo> machineAssignedUnit(Long machineId);
     List<ConsUnitInfo> machineAssignedUnit(Long machineId);
 
 
 }
 }

+ 1 - 2
bd-park/park-backend/park-core/src/main/java/com/huashe/park/core/service/IMachineProcessResultService.java

@@ -1,6 +1,5 @@
 package com.huashe.park.core.service;
 package com.huashe.park.core.service;
 
 
-import com.huashe.park.domain.dto.cons.ResultCADCsv;
 import com.huashe.park.domain.entity.MachineProcessResult;
 import com.huashe.park.domain.entity.MachineProcessResult;
 
 
 import java.util.List;
 import java.util.List;
@@ -60,5 +59,5 @@ public interface IMachineProcessResultService {
      */
      */
     public int deleteMachineProcessResultById(Long id);
     public int deleteMachineProcessResultById(Long id);
 
 
-    List<ResultCADCsv> qeyConsUnitResult(Long consUnitId);
+    List<String[]> qeyConsUnitResult(Long consUnitId);
 }
 }

+ 0 - 1
bd-park/park-backend/park-core/src/main/java/com/huashe/park/core/service/ISysCustConfigService.java

@@ -11,7 +11,6 @@ public interface ISysCustConfigService {
 
 
     public int updateConfig(CustSysConfig config);
     public int updateConfig(CustSysConfig config);
 
 
-    String selectConfigByKey(String configKey);
 
 
     CustSysConfig selectConfigObjByKey(String configKey);
     CustSysConfig selectConfigObjByKey(String configKey);
 
 

+ 4 - 1
bd-park/park-backend/park-core/src/main/java/com/huashe/park/core/service/impl/ConsPileHoleInfoServiceImpl.java

@@ -2,6 +2,7 @@ package com.huashe.park.core.service.impl;
 
 
 import java.util.List;
 import java.util.List;
 
 
+import org.apache.commons.lang3.ObjectUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
@@ -49,7 +50,9 @@ public class ConsPileHoleInfoServiceImpl implements IConsPileHoleInfoService {
             return redisProxy.getCacheObject(redisKey);
             return redisProxy.getCacheObject(redisKey);
         }
         }
         ConsPileHoleInfo consPileHoleInfo = consPileHoleInfoMapper.selectConsPileHoleInfoByByteId(byteKey);
         ConsPileHoleInfo consPileHoleInfo = consPileHoleInfoMapper.selectConsPileHoleInfoByByteId(byteKey);
-        redisProxy.setCacheObject(redisKey, consPileHoleInfo);
+        if (ObjectUtils.isNotEmpty(consPileHoleInfo)) {
+            redisProxy.setCacheObject(redisKey, consPileHoleInfo);
+        }
         return consPileHoleInfo;
         return consPileHoleInfo;
     }
     }
 
 

+ 85 - 22
bd-park/park-backend/park-core/src/main/java/com/huashe/park/core/service/impl/ConsUnitInfoServiceImpl.java

@@ -19,10 +19,12 @@ import javax.servlet.http.HttpServletResponse;
 import org.apache.commons.lang3.ObjectUtils;
 import org.apache.commons.lang3.ObjectUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Lazy;
 import org.springframework.http.MediaType;
 import org.springframework.http.MediaType;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
 import org.springframework.util.CollectionUtils;
+import org.springframework.web.multipart.MultipartFile;
 
 
 import com.alibaba.fastjson2.JSONArray;
 import com.alibaba.fastjson2.JSONArray;
 import com.huashe.common.exception.ServiceException;
 import com.huashe.common.exception.ServiceException;
@@ -30,6 +32,7 @@ import com.huashe.common.utils.DateUtils;
 import com.huashe.common.utils.StringUtils;
 import com.huashe.common.utils.StringUtils;
 import com.huashe.common.utils.uuid.Seq;
 import com.huashe.common.utils.uuid.Seq;
 import com.huashe.park.common.EnhancedIDGenerator;
 import com.huashe.park.common.EnhancedIDGenerator;
+import com.huashe.park.common.consts.RedisKey;
 import com.huashe.park.common.consts.enums.ConsStatus;
 import com.huashe.park.common.consts.enums.ConsStatus;
 import com.huashe.park.common.excel.CsvAlias;
 import com.huashe.park.common.excel.CsvAlias;
 import com.huashe.park.common.i18n.MessageUtils;
 import com.huashe.park.common.i18n.MessageUtils;
@@ -52,10 +55,12 @@ import com.huashe.park.domain.entity.PileMachineInfo;
 import com.huashe.park.domain.entity.ProjectInfo;
 import com.huashe.park.domain.entity.ProjectInfo;
 import com.huashe.park.infrastructure.cfg.forest.CADForestCfg;
 import com.huashe.park.infrastructure.cfg.forest.CADForestCfg;
 import com.huashe.park.infrastructure.excel.ExcelHandle;
 import com.huashe.park.infrastructure.excel.ExcelHandle;
+import com.huashe.park.infrastructure.mqtt.CADService;
 import com.ruoyi.common.config.RuoYiConfig;
 import com.ruoyi.common.config.RuoYiConfig;
 import com.ruoyi.common.utils.file.FileUtils;
 import com.ruoyi.common.utils.file.FileUtils;
 
 
 import cn.hutool.core.collection.ListUtil;
 import cn.hutool.core.collection.ListUtil;
+import cn.hutool.core.convert.Convert;
 import cn.hutool.core.io.FileUtil;
 import cn.hutool.core.io.FileUtil;
 import cn.hutool.core.text.csv.CsvUtil;
 import cn.hutool.core.text.csv.CsvUtil;
 import cn.hutool.core.text.csv.CsvWriteConfig;
 import cn.hutool.core.text.csv.CsvWriteConfig;
@@ -90,6 +95,12 @@ public class ConsUnitInfoServiceImpl implements IConsUnitInfoService {
     @Autowired
     @Autowired
     private IConsPileHoleInfoService pileHoleInfoService;
     private IConsPileHoleInfoService pileHoleInfoService;
 
 
+    @Autowired
+    private ExcelHandle excelHandle;
+
+    @Autowired
+    private CADService cadService;
+
     private final static String PROFILE = "/profile";
     private final static String PROFILE = "/profile";
 
 
     @Autowired
     @Autowired
@@ -101,9 +112,13 @@ public class ConsUnitInfoServiceImpl implements IConsUnitInfoService {
     @Autowired
     @Autowired
     private CADForestCfg cadForestCfg;
     private CADForestCfg cadForestCfg;
 
 
-    @Autowired
     private IProjectInfoService projectInfoService;
     private IProjectInfoService projectInfoService;
 
 
+    @Autowired
+    public void setProjectInfoService(@Lazy IProjectInfoService projectInfoService) {
+        this.projectInfoService = projectInfoService;
+    }
+
     /**
     /**
      * 查询施工单元
      * 查询施工单元
      * 
      * 
@@ -143,19 +158,25 @@ public class ConsUnitInfoServiceImpl implements IConsUnitInfoService {
      * @param consUnitInfo 施工单元
      * @param consUnitInfo 施工单元
      * @return 结果
      * @return 结果
      */
      */
-    @Override
+
     @Transactional(rollbackFor = Exception.class)
     @Transactional(rollbackFor = Exception.class)
     public int insertConsUnitInfo(ConsUnitMachine consUnitInfo) {
     public int insertConsUnitInfo(ConsUnitMachine consUnitInfo) {
         // 处理施工单元信息
         // 处理施工单元信息
         ConsUnitInfo parentConsUnit = consUnitInfoMapper.selectConsUnitInfoById(consUnitInfo.getParentId());
         ConsUnitInfo parentConsUnit = consUnitInfoMapper.selectConsUnitInfoById(consUnitInfo.getParentId());
         consUnitInfo.setAncestors(parentConsUnit.getAncestors() + "," + parentConsUnit.getId());
         consUnitInfo.setAncestors(parentConsUnit.getAncestors() + "," + parentConsUnit.getId());
         consUnitInfo.setByteId(byte8Id.generate());
         consUnitInfo.setByteId(byte8Id.generate());
+        consUnitInfo.setProjectId(parentConsUnit.getProjectId());
         int cnt = consUnitInfoMapper.insertConsUnitInfo(consUnitInfo);
         int cnt = consUnitInfoMapper.insertConsUnitInfo(consUnitInfo);
         // 处理施工单元关联信息
         // 处理施工单元关联信息
         handleMachine(consUnitInfo);
         handleMachine(consUnitInfo);
         return cnt;
         return cnt;
     }
     }
 
 
+    @Override
+    public int insertConsUnitInfo(ConsUnitInfo consUnitInfo) {
+        return consUnitInfoMapper.insertConsUnitInfo(consUnitInfo);
+    }
+
     /**
     /**
      * 修改施工单元
      * 修改施工单元
      * 
      * 
@@ -175,7 +196,9 @@ public class ConsUnitInfoServiceImpl implements IConsUnitInfoService {
                 String newAncestors = newParentConsUnit.getAncestors() + "," + newParentConsUnit.getId();
                 String newAncestors = newParentConsUnit.getAncestors() + "," + newParentConsUnit.getId();
                 String oldAncestors = oldConsUnit.getAncestors();
                 String oldAncestors = oldConsUnit.getAncestors();
                 consUnitInfo.setAncestors(newAncestors);
                 consUnitInfo.setAncestors(newAncestors);
-                updateConsUnitChildren(consUnitInfo.getId(), newAncestors, oldAncestors);
+                consUnitInfo.setProjectId(newParentConsUnit.getProjectId());
+                updateConsUnitChildren(consUnitInfo.getId(), newParentConsUnit.getParentId(), newAncestors,
+                    oldAncestors);
             }
             }
         }
         }
         return consUnitInfoMapper.updateConsUnitInfo(consUnitInfo);
         return consUnitInfoMapper.updateConsUnitInfo(consUnitInfo);
@@ -209,6 +232,7 @@ public class ConsUnitInfoServiceImpl implements IConsUnitInfoService {
      * @return 结果
      * @return 结果
      */
      */
     @Override
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public int deleteConsUnitInfoById(Long id) {
     public int deleteConsUnitInfoById(Long id) {
         if (hasChildById(id)) {
         if (hasChildById(id)) {
             throw new ServiceException(MessageUtils.message("cons.unit.delete.no.child"));
             throw new ServiceException(MessageUtils.message("cons.unit.delete.no.child"));
@@ -219,6 +243,22 @@ public class ConsUnitInfoServiceImpl implements IConsUnitInfoService {
     }
     }
 
 
     @Override
     @Override
+    @Transactional(rollbackFor = Exception.class)
+    public int deleteConsUnitInfoByProjectId(Long projId) {
+        List<ConsUnitInfo> consUnitInfos = consUnitInfoMapper.selectConsUnitInfoList(new ConsUnitInfo() {
+            {
+                setProjectId(projId);
+                setParentId(0L);
+            }
+        });
+        if (CollectionUtils.isEmpty(consUnitInfos)) {
+            return 0;
+        }
+        ConsUnitInfo consUnitInfo = consUnitInfos.get(0);
+        return deleteConsUnitInfoById(consUnitInfo.getId());
+    }
+
+    @Override
     public void importConsUnitHole(ConsUnitInfo consUnitInfo) {
     public void importConsUnitHole(ConsUnitInfo consUnitInfo) {
         int lastIndex = RuoYiConfig.getUploadPath().lastIndexOf("/");
         int lastIndex = RuoYiConfig.getUploadPath().lastIndexOf("/");
         String filePath = consUnitInfo.getFileId().replaceFirst(PROFILE,
         String filePath = consUnitInfo.getFileId().replaceFirst(PROFILE,
@@ -229,27 +269,27 @@ public class ConsUnitInfoServiceImpl implements IConsUnitInfoService {
         File file = new File(filePath);
         File file = new File(filePath);
 
 
         CustSysConfig custSysConfig = sysCustConfigService.selectConfigObjByKey(cadForestCfg.getCadBizParam());
         CustSysConfig custSysConfig = sysCustConfigService.selectConfigObjByKey(cadForestCfg.getCadBizParam());
+        if (ObjectUtils.isEmpty(custSysConfig)) {
+            throw new ServiceException(MessageUtils.message("cons.biz.param.null"));
+        }
         HttpRequest form = HttpRequest.post(cadForestCfg.getCadServer() + "/upload").form("dwg_file", file)
         HttpRequest form = HttpRequest.post(cadForestCfg.getCadServer() + "/upload").form("dwg_file", file)
             .form("param", custSysConfig.getCfgJson());
             .form("param", custSysConfig.getCfgJson());
-        log.info(">>>>>>>>>>>>{}", form.toString());
         String json = form.execute().body();
         String json = form.execute().body();
         List<CADJson> cadJsons = JSONArray.parseArray(json, CADJson.class);
         List<CADJson> cadJsons = JSONArray.parseArray(json, CADJson.class);
         pileHoleInfoService.deleteConsPileHoleInfoByConsUnitId(consUnitInfo.getId());
         pileHoleInfoService.deleteConsPileHoleInfoByConsUnitId(consUnitInfo.getId());
         List<ConsPileHoleInfo> consPileHoleInfo = new ArrayList<>(cadJsons.size());
         List<ConsPileHoleInfo> consPileHoleInfo = new ArrayList<>(cadJsons.size());
-        cadJsons.stream().filter(Objects::nonNull).forEach(item -> {
-            consPileHoleInfo.add(new ConsPileHoleInfo() {
-                {
-                    setConsUnitId(consUnitInfo.getId());
-                    setDeltaX(item.getCoordX());
-                    setDeltaY(item.getCoordY());
-                    setLng(item.getEarthCoordX());
-                    setLat(item.getEarthCoordY());
-                    setHoleNum(item.getPileNumber());
-                    setConsStatus(ConsStatus.CONS_STATUS_01.getCode());
-                    setDesDept(40L);
-                }
-            });
-        });
+        cadJsons.stream().filter(Objects::nonNull).forEach(item -> consPileHoleInfo.add(new ConsPileHoleInfo() {
+            {
+                setConsUnitId(consUnitInfo.getId());
+                setDeltaX(item.getCoordX());
+                setDeltaY(item.getCoordY());
+                setLng(item.getEarthCoordX());
+                setLat(item.getEarthCoordY());
+                setHoleNum(item.getPileNumber());
+                setConsStatus(ConsStatus.CONS_STATUS_01.getCode());
+                setDesDept(40L);
+            }
+        }));
         // 将 cadJsons,分拆成 100个 List<ConsPileHoleInfo>,批量插入
         // 将 cadJsons,分拆成 100个 List<ConsPileHoleInfo>,批量插入
         List<List<ConsPileHoleInfo>> data = ListUtil.partition(consPileHoleInfo, 100);
         List<List<ConsPileHoleInfo>> data = ListUtil.partition(consPileHoleInfo, 100);
         for (List<ConsPileHoleInfo> datum : data) {
         for (List<ConsPileHoleInfo> datum : data) {
@@ -292,6 +332,15 @@ public class ConsUnitInfoServiceImpl implements IConsUnitInfoService {
         writeFileToResponse(csvFile, response);
         writeFileToResponse(csvFile, response);
     }
     }
 
 
+    @Override
+    public void upload(MultipartFile file) {
+        HttpRequest form = HttpRequest.post(cadForestCfg.getCadServer() + "/upload").form("dwg_file", file);
+        log.info(">>>>>>>>>>>>{}", form.toString());
+        String json = form.execute().body();
+        log.info(">>>>>>>>>>>>{}", json);
+        cadService.newTopic(file);
+    }
+
     private void writeFileToResponse(File file, HttpServletResponse response) {
     private void writeFileToResponse(File file, HttpServletResponse response) {
         // 读取文件内容并写入响应输出流
         // 读取文件内容并写入响应输出流
         try (FileInputStream fis = new FileInputStream(file); OutputStream os = response.getOutputStream()) {
         try (FileInputStream fis = new FileInputStream(file); OutputStream os = response.getOutputStream()) {
@@ -315,16 +364,20 @@ public class ConsUnitInfoServiceImpl implements IConsUnitInfoService {
         // 使用 Java Stream API 将 ancestors 字符串按逗号分割,并去除重复项
         // 使用 Java Stream API 将 ancestors 字符串按逗号分割,并去除重复项
         List<String> unitIds = ancestors.stream().flatMap(s -> Arrays.stream(s.split(","))).distinct()
         List<String> unitIds = ancestors.stream().flatMap(s -> Arrays.stream(s.split(","))).distinct()
             .collect(Collectors.toList());
             .collect(Collectors.toList());
+        if (CollectionUtils.isEmpty(unitIds)) {
+            throw new ServiceException(MessageUtils.message("machine.not.assign.task"));
+        }
         return consUnitInfoMapper.qryConsUnitInfoByIds(unitIds);
         return consUnitInfoMapper.qryConsUnitInfoByIds(unitIds);
     }
     }
 
 
-    private void updateConsUnitChildren(Long id, String newAncestors, String oldAncestors) {
+    private void updateConsUnitChildren(Long id, Long projectId, String newAncestors, String oldAncestors) {
         List<ConsUnitInfo> children = consUnitInfoMapper.selectChildrenById(id);
         List<ConsUnitInfo> children = consUnitInfoMapper.selectChildrenById(id);
         if (CollectionUtils.isEmpty(children)) {
         if (CollectionUtils.isEmpty(children)) {
             return;
             return;
         }
         }
         for (ConsUnitInfo child : children) {
         for (ConsUnitInfo child : children) {
             child.setAncestors(child.getAncestors().replaceFirst(oldAncestors, newAncestors));
             child.setAncestors(child.getAncestors().replaceFirst(oldAncestors, newAncestors));
+            child.setProjectId(projectId);
         }
         }
         consUnitInfoMapper.updateConstUnitChildren(children);
         consUnitInfoMapper.updateConstUnitChildren(children);
     }
     }
@@ -353,12 +406,16 @@ public class ConsUnitInfoServiceImpl implements IConsUnitInfoService {
         ProjectInfo projectInfo = projectInfos.get(0);
         ProjectInfo projectInfo = projectInfos.get(0);
         CsvWriteConfig csvWriteConfig = new CsvWriteConfig();
         CsvWriteConfig csvWriteConfig = new CsvWriteConfig();
         Field[] fields = ReflectUtil.getFields(ResultCADCsv.class);
         Field[] fields = ReflectUtil.getFields(ResultCADCsv.class);
+        List<String> columnNames = new ArrayList<>();
         for (Field field : fields) {
         for (Field field : fields) {
             CsvAlias annotation = field.getAnnotation(CsvAlias.class);
             CsvAlias annotation = field.getAnnotation(CsvAlias.class);
             if (annotation != null) {
             if (annotation != null) {
-                csvWriteConfig.addHeaderAlias(field.getName(), annotation.alias());
+                columnNames.add(annotation.alias());
             }
             }
         }
         }
+        for (int i = 0; i <= RedisKey.DEPTH_PRESS_TIPS.PILE_LENGTH_TIPS; i++) {
+            columnNames.add(String.format("%.2fm", i * 0.25));
+        }
         String filePath = StringUtils.format("{}/{}/{}_{}.{}", RuoYiConfig.getUploadPath(), DateUtils.datePath(),
         String filePath = StringUtils.format("{}/{}/{}_{}.{}", RuoYiConfig.getUploadPath(), DateUtils.datePath(),
             "cad-csv", Seq.getId("UPLOAD"), "csv");
             "cad-csv", Seq.getId("UPLOAD"), "csv");
         File csvFile = FileUtil.file(filePath);
         File csvFile = FileUtil.file(filePath);
@@ -398,9 +455,15 @@ public class ConsUnitInfoServiceImpl implements IConsUnitInfoService {
         header.add(new String[] {
         header.add(new String[] {
             "Operator Name :", ""
             "Operator Name :", ""
         });
         });
+
         writer.write(header);
         writer.write(header);
-        List<ResultCADCsv> resultCADCsvs = machineProcessResultService.qeyConsUnitResult(consUnitInfo.getId());
-        writer.writeBeans(resultCADCsvs);
+        writer.write(new ArrayList<String[]>() {
+            {
+                add(Convert.toStrArray(columnNames));
+            }
+        });
+        List<String[]> resultCADCsvs = machineProcessResultService.qeyConsUnitResult(consUnitInfo.getId());
+        writer.write(resultCADCsvs);
         writer.flush();
         writer.flush();
         writer.close();
         writer.close();
         return csvFile;
         return csvFile;

+ 41 - 5
bd-park/park-backend/park-core/src/main/java/com/huashe/park/core/service/impl/MachineProcessResultServiceImpl.java

@@ -2,11 +2,16 @@ package com.huashe.park.core.service.impl;
 
 
 import java.util.ArrayList;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.List;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
 
 
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
 
 
+import com.alibaba.fastjson2.JSONObject;
 import com.huashe.park.common.DateTimeUtil;
 import com.huashe.park.common.DateTimeUtil;
+import com.huashe.park.common.consts.enums.ConsResult;
 import com.huashe.park.core.mapper.MachineProcessResultMapper;
 import com.huashe.park.core.mapper.MachineProcessResultMapper;
 import com.huashe.park.core.service.IMachineProcessResultService;
 import com.huashe.park.core.service.IMachineProcessResultService;
 import com.huashe.park.domain.dto.cons.ConsUnitResult;
 import com.huashe.park.domain.dto.cons.ConsUnitResult;
@@ -14,6 +19,7 @@ import com.huashe.park.domain.dto.cons.ResultCADCsv;
 import com.huashe.park.domain.entity.MachineProcessResult;
 import com.huashe.park.domain.entity.MachineProcessResult;
 
 
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.convert.Convert;
 
 
 /**
 /**
  * 桩机施工结果数据(2025-02-26版协议)Service业务层处理
  * 桩机施工结果数据(2025-02-26版协议)Service业务层处理
@@ -23,6 +29,7 @@ import cn.hutool.core.bean.BeanUtil;
  */
  */
 @Service
 @Service
 public class MachineProcessResultServiceImpl implements IMachineProcessResultService {
 public class MachineProcessResultServiceImpl implements IMachineProcessResultService {
+
     @Autowired
     @Autowired
     private MachineProcessResultMapper machineProcessResultMapper;
     private MachineProcessResultMapper machineProcessResultMapper;
 
 
@@ -93,10 +100,14 @@ public class MachineProcessResultServiceImpl implements IMachineProcessResultSer
     }
     }
 
 
     @Override
     @Override
-    public List<ResultCADCsv> qeyConsUnitResult(Long consUnitId) {
+    public List<String[]> qeyConsUnitResult(Long consUnitId) {
         List<ConsUnitResult> consUnitResults = machineProcessResultMapper.qeyConsUnitResult(consUnitId);
         List<ConsUnitResult> consUnitResults = machineProcessResultMapper.qeyConsUnitResult(consUnitId);
-        List<ResultCADCsv> resultCADCsvs = new ArrayList<>(consUnitResults.size());
+        List<String[]> resultCADCsvs = new ArrayList<>(consUnitResults.size());
         ResultCADCsv resultCADCsv;
         ResultCADCsv resultCADCsv;
+        ConsResult consResult;
+        Map<String, Object> stringObjectMap;
+        JSONObject depthPress;
+        String[] strings;
         for (ConsUnitResult consUnitResult : consUnitResults) {
         for (ConsUnitResult consUnitResult : consUnitResults) {
             resultCADCsv = new ResultCADCsv();
             resultCADCsv = new ResultCADCsv();
             BeanUtil.copyProperties(consUnitResult, resultCADCsv);
             BeanUtil.copyProperties(consUnitResult, resultCADCsv);
@@ -106,10 +117,35 @@ public class MachineProcessResultServiceImpl implements IMachineProcessResultSer
                 DateTimeUtil.getDateFromMills(consUnitResult.getDataTime(), DateTimeUtil.DateFormatter.yyyy_MM_dd));
                 DateTimeUtil.getDateFromMills(consUnitResult.getDataTime(), DateTimeUtil.DateFormatter.yyyy_MM_dd));
             resultCADCsv.setStartingTime(
             resultCADCsv.setStartingTime(
                 DateTimeUtil.getDateFromMills(consUnitResult.getDataTime(), DateTimeUtil.DateFormatter.HHmmss));
                 DateTimeUtil.getDateFromMills(consUnitResult.getDataTime(), DateTimeUtil.DateFormatter.HHmmss));
-            resultCADCsv.setDuration(consUnitResult.getEndTime() - consUnitResult.getStartTime());
-            // TODO: 评价结果转换
-            resultCADCsvs.add(resultCADCsv);
+            resultCADCsv.setDuration(calcSecond(consUnitResult.getEndTime(), consUnitResult.getStartTime()));
+
+            // 评价结果转换
+            consResult = ConsResult.getByCode(consUnitResult.getResultEvaluation());
+            resultCADCsv.setEvaluation(consResult.getValue());
+            resultCADCsv.setPullValue(consUnitResult.getSprayVolume());
+            // 实际深度 = 桩长 - 回带量
+            resultCADCsv.setActualDepth(
+                (float) Math.round((consUnitResult.getPileLength() - consUnitResult.getSprayVolume()) * 100) / 100.0f);
+            resultCADCsv.setEndingPress(consUnitResult.getEndPress());
+            resultCADCsv.setAvgSprayPressure(consUnitResult.getEndPress());
+            resultCADCsv.setAvgSpeed(consUnitResult.getAvgSpeed());
+            resultCADCsv.setAvgUpSpeed(consUnitResult.getAvgUpSpeed());
+            stringObjectMap = BeanUtil.beanToMap(resultCADCsv);
+            depthPress = consUnitResult.getDepthPress();
+            if (!CollectionUtils.isEmpty(depthPress)) {
+                stringObjectMap.putAll(depthPress);
+            }
+            strings = Convert.toStrArray(stringObjectMap.values());
+
+            resultCADCsvs.add(strings);
         }
         }
         return resultCADCsvs;
         return resultCADCsvs;
     }
     }
+
+    private Long calcSecond(Long end, Long start) {
+        if (end == null || start == null) {
+            return 0L;
+        }
+        return TimeUnit.MILLISECONDS.toSeconds(end - start);
+    }
 }
 }

+ 37 - 9
bd-park/park-backend/park-core/src/main/java/com/huashe/park/core/service/impl/PileMachineInfoServiceImpl.java

@@ -6,6 +6,9 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.List;
 import java.util.stream.Collectors;
 import java.util.stream.Collectors;
 
 
+import javax.annotation.Resource;
+
+import org.apache.commons.lang3.ObjectUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
@@ -25,13 +28,16 @@ import com.huashe.park.core.service.IProjectCoordinateInfoService;
 import com.huashe.park.domain.dto.cons.ConsPileHoleInfoVO;
 import com.huashe.park.domain.dto.cons.ConsPileHoleInfoVO;
 import com.huashe.park.domain.dto.cons.ConstUnitNode;
 import com.huashe.park.domain.dto.cons.ConstUnitNode;
 import com.huashe.park.domain.dto.cons.MachineBiz;
 import com.huashe.park.domain.dto.cons.MachineBiz;
+import com.huashe.park.domain.dto.cons.MqttRequest;
 import com.huashe.park.domain.entity.ConsPileHoleInfo;
 import com.huashe.park.domain.entity.ConsPileHoleInfo;
 import com.huashe.park.domain.entity.ConsUnitInfo;
 import com.huashe.park.domain.entity.ConsUnitInfo;
 import com.huashe.park.domain.entity.ConsUnitMachineRel;
 import com.huashe.park.domain.entity.ConsUnitMachineRel;
 import com.huashe.park.domain.entity.PileMachineInfo;
 import com.huashe.park.domain.entity.PileMachineInfo;
 import com.huashe.park.domain.entity.ProjectCoordinateInfo;
 import com.huashe.park.domain.entity.ProjectCoordinateInfo;
+import com.huashe.park.infrastructure.mqtt.CollectMqttService;
 
 
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.thread.ThreadUtil;
 
 
 /**
 /**
  * 施工桩机信息Service业务层处理
  * 施工桩机信息Service业务层处理
@@ -62,6 +68,9 @@ public class PileMachineInfoServiceImpl implements IPileMachineInfoService {
     @Autowired
     @Autowired
     private RedisProxy redisProxy;
     private RedisProxy redisProxy;
 
 
+    @Resource
+    private CollectMqttService collectMqttService;
+
     private static final String CACHE_KEY = "consPileMachineInfo:byteId:%s";
     private static final String CACHE_KEY = "consPileMachineInfo:byteId:%s";
 
 
     /**
     /**
@@ -82,7 +91,9 @@ public class PileMachineInfoServiceImpl implements IPileMachineInfoService {
             return redisProxy.getCacheObject(redisKey);
             return redisProxy.getCacheObject(redisKey);
         }
         }
         PileMachineInfo pileMachineInfo = pileMachineInfoMapper.selectPileMachineInfoByByteId(byteId);
         PileMachineInfo pileMachineInfo = pileMachineInfoMapper.selectPileMachineInfoByByteId(byteId);
-        redisProxy.setCacheObject(redisKey, pileMachineInfo);
+        if (ObjectUtils.isNotEmpty(pileMachineInfo)) {
+            redisProxy.setCacheObject(redisKey, pileMachineInfo);
+        }
         return pileMachineInfo;
         return pileMachineInfo;
     }
     }
 
 
@@ -107,7 +118,19 @@ public class PileMachineInfoServiceImpl implements IPileMachineInfoService {
     public int insertPileMachineInfo(PileMachineInfo pileMachineInfo) {
     public int insertPileMachineInfo(PileMachineInfo pileMachineInfo) {
         pileMachineInfo.setPwd(pileMachineInfo.getSn() + "381.2371");
         pileMachineInfo.setPwd(pileMachineInfo.getSn() + "381.2371");
         pileMachineInfo.setByteId(byte8Id.generate());
         pileMachineInfo.setByteId(byte8Id.generate());
-        return pileMachineInfoMapper.insertPileMachineInfo(pileMachineInfo);
+        int i = pileMachineInfoMapper.insertPileMachineInfo(pileMachineInfo);
+        if (i > 0) {
+            ThreadUtil.execAsync(() -> {
+                collectMqttService.newTopic(new MqttRequest() {
+                    {
+                        setClientKey(pileMachineInfo.getProductKey());
+                        setClientSecret(pileMachineInfo.getDeviceSecret());
+                        setTopic(pileMachineInfo.getTopic());
+                    }
+                });
+            });
+        }
+        return i;
     }
     }
 
 
     /**
     /**
@@ -158,9 +181,7 @@ public class PileMachineInfoServiceImpl implements IPileMachineInfoService {
     public List<ConstUnitNode> qryMachineAssignedUnit(String machineId) {
     public List<ConstUnitNode> qryMachineAssignedUnit(String machineId) {
         PileMachineInfo pileMachineInfo = selectPileMachineInfoByByteId(machineId);
         PileMachineInfo pileMachineInfo = selectPileMachineInfoByByteId(machineId);
         List<ConsUnitInfo> consUnitInfos = consUnitInfoService.machineAssignedUnit(pileMachineInfo.getId());
         List<ConsUnitInfo> consUnitInfos = consUnitInfoService.machineAssignedUnit(pileMachineInfo.getId());
-        List<ProjectCoordinateInfo> projectCoordinateInfos = projectCoordinateInfoService
-            .selectProjectCoordinateInfoList(new ProjectCoordinateInfo());
-        ProjectCoordinateInfo projectCoordinateInfo = projectCoordinateInfos.get(0);
+
         // 将 consUnitInfos 使用BeanUtils将子类转换成ConstUnitNode
         // 将 consUnitInfos 使用BeanUtils将子类转换成ConstUnitNode
         List<ConstUnitNode> constUnitNodes = new ArrayList<>();
         List<ConstUnitNode> constUnitNodes = new ArrayList<>();
         consUnitInfos.forEach((item) -> {
         consUnitInfos.forEach((item) -> {
@@ -169,7 +190,16 @@ public class PileMachineInfoServiceImpl implements IPileMachineInfoService {
             constUnitNodes.add(constUnitNode);
             constUnitNodes.add(constUnitNode);
         });
         });
         List<ConstUnitNode> tree = buildConsUnitTree(constUnitNodes);
         List<ConstUnitNode> tree = buildConsUnitTree(constUnitNodes);
-        tree.forEach(item -> item.setCoordinateModel(projectCoordinateInfo));
+        tree.forEach(item -> {
+            List<ProjectCoordinateInfo> projectCoordinateInfos = projectCoordinateInfoService
+                .selectProjectCoordinateInfoList(new ProjectCoordinateInfo() {
+                    {
+                        setProjectId(item.getProjectId());
+                    }
+                });
+            ProjectCoordinateInfo projectCoordinateInfo = projectCoordinateInfos.get(0);
+            item.setCoordinateModel(projectCoordinateInfo);
+        });
         return tree;
         return tree;
     }
     }
 
 
@@ -246,9 +276,7 @@ public class PileMachineInfoServiceImpl implements IPileMachineInfoService {
 
 
     private List<ConstUnitNode> getChildList(List<ConstUnitNode> list, ConstUnitNode t) {
     private List<ConstUnitNode> getChildList(List<ConstUnitNode> list, ConstUnitNode t) {
         List<ConstUnitNode> tlist = new ArrayList<>();
         List<ConstUnitNode> tlist = new ArrayList<>();
-        Iterator<ConstUnitNode> it = list.iterator();
-        while (it.hasNext()) {
-            ConstUnitNode n = it.next();
+        for (ConstUnitNode n : list) {
             if (StringUtils.isNotNull(n.getParentId()) && n.getParentId().longValue() == t.getId().longValue()) {
             if (StringUtils.isNotNull(n.getParentId()) && n.getParentId().longValue() == t.getId().longValue()) {
                 tlist.add(n);
                 tlist.add(n);
             }
             }

+ 30 - 4
bd-park/park-backend/park-core/src/main/java/com/huashe/park/core/service/impl/ProjectInfoServiceImpl.java

@@ -2,11 +2,17 @@ package com.huashe.park.core.service.impl;
 
 
 import java.util.List;
 import java.util.List;
 
 
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Lazy;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import com.huashe.park.common.consts.enums.ConsUnitType;
 import com.huashe.park.core.mapper.ProjectInfoMapper;
 import com.huashe.park.core.mapper.ProjectInfoMapper;
+import com.huashe.park.core.service.IConsUnitInfoService;
 import com.huashe.park.core.service.IProjectInfoService;
 import com.huashe.park.core.service.IProjectInfoService;
+import com.huashe.park.domain.entity.ConsUnitInfo;
 import com.huashe.park.domain.entity.ProjectInfo;
 import com.huashe.park.domain.entity.ProjectInfo;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
 
 
 /**
 /**
  * 工程信息Service业务层处理
  * 工程信息Service业务层处理
@@ -19,6 +25,14 @@ public class ProjectInfoServiceImpl implements IProjectInfoService {
     @Autowired
     @Autowired
     private ProjectInfoMapper projectInfoMapper;
     private ProjectInfoMapper projectInfoMapper;
 
 
+    private IConsUnitInfoService consUnitInfoService;
+
+
+    @Autowired
+    public void setConsUnitInfoService(@Lazy IConsUnitInfoService consUnitInfoService) {
+        this.consUnitInfoService = consUnitInfoService;
+    }
+
     /**
     /**
      * 查询工程信息
      * 查询工程信息
      * 
      * 
@@ -48,8 +62,17 @@ public class ProjectInfoServiceImpl implements IProjectInfoService {
      * @return 结果
      * @return 结果
      */
      */
     @Override
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public int insertProjectInfo(ProjectInfo projectInfo) {
     public int insertProjectInfo(ProjectInfo projectInfo) {
-        return projectInfoMapper.insertProjectInfo(projectInfo);
+        int i = projectInfoMapper.insertProjectInfo(projectInfo);
+        ConsUnitInfo consUnitInfo = new ConsUnitInfo();
+        consUnitInfo.setProjectId(projectInfo.getId());
+        consUnitInfo.setName(projectInfo.getName());
+        consUnitInfo.setParentId(0L);
+        consUnitInfo.setType(ConsUnitType.DIRECTORY.getCode());
+        consUnitInfo.setAncestors("0");
+        consUnitInfoService.insertConsUnitInfo(consUnitInfo);
+        return i;
     }
     }
 
 
     /**
     /**
@@ -81,7 +104,10 @@ public class ProjectInfoServiceImpl implements IProjectInfoService {
      * @return 结果
      * @return 结果
      */
      */
     @Override
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public int deleteProjectInfoById(Long id) {
     public int deleteProjectInfoById(Long id) {
-        return projectInfoMapper.deleteProjectInfoById(id);
+        int i = projectInfoMapper.deleteProjectInfoById(id);
+        consUnitInfoService.deleteConsUnitInfoByProjectId(id);
+        return i;
     }
     }
 }
 }

+ 13 - 23
bd-park/park-backend/park-core/src/main/java/com/huashe/park/core/service/impl/SysCustConfigServiceImpl.java

@@ -1,10 +1,10 @@
 package com.huashe.park.core.service.impl;
 package com.huashe.park.core.service.impl;
 
 
+import org.apache.commons.lang3.ObjectUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
 import com.huashe.common.constant.CacheConstants;
 import com.huashe.common.constant.CacheConstants;
-import com.huashe.common.text.Convert;
 import com.huashe.common.utils.StringUtils;
 import com.huashe.common.utils.StringUtils;
 import com.huashe.park.core.mapper.SysCustConfigMapper;
 import com.huashe.park.core.mapper.SysCustConfigMapper;
 import com.huashe.park.core.redis.RedisProxy;
 import com.huashe.park.core.redis.RedisProxy;
@@ -28,38 +28,21 @@ public class SysCustConfigServiceImpl implements ISysCustConfigService {
     public int updateConfig(CustSysConfig config) {
     public int updateConfig(CustSysConfig config) {
         CustSysConfig temp = sysCustConfigMapper.selectConfigById(config.getConfigId());
         CustSysConfig temp = sysCustConfigMapper.selectConfigById(config.getConfigId());
         if (!StringUtils.equals(temp.getConfigKey(), config.getConfigKey())) {
         if (!StringUtils.equals(temp.getConfigKey(), config.getConfigKey())) {
-            redisProxy.deleteObject(getCacheKey(temp.getConfigKey()));
+            redisProxy.deleteObject(getCacheKey(temp));
         }
         }
 
 
         int row = sysCustConfigMapper.updateConfig(config);
         int row = sysCustConfigMapper.updateConfig(config);
         if (row > 0) {
         if (row > 0) {
-            redisProxy.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue());
+            redisProxy.setCacheObject(getCacheKey(config), config.getConfigValue());
         }
         }
         return row;
         return row;
     }
     }
 
 
     @Override
     @Override
-    public String selectConfigByKey(String configKey) {
-        String configValue = Convert.toStr(redisProxy.getCacheObject(getCacheKey(configKey)));
-        if (StringUtils.isNotEmpty(configValue)) {
-            return configValue;
-        }
-        CustSysConfig config = new CustSysConfig();
-        config.setConfigKey(configKey);
-        CustSysConfig retConfig = sysCustConfigMapper.selectConfig(config);
-        if (StringUtils.isNotNull(retConfig)) {
-            redisProxy.setCacheObject(getCacheKey(configKey), retConfig.getConfigValue());
-            return retConfig.getConfigValue();
-        }
-        return StringUtils.EMPTY;
-    }
-
-    @Override
     public CustSysConfig selectConfigObjByKey(String configKey) {
     public CustSysConfig selectConfigObjByKey(String configKey) {
-
         CustSysConfig config = new CustSysConfig();
         CustSysConfig config = new CustSysConfig();
         config.setConfigKey(configKey);
         config.setConfigKey(configKey);
-        return sysCustConfigMapper.selectConfig(config);
+        return sysCustConfigMapper.selectTenantConfig(config);
     }
     }
 
 
     @Override
     @Override
@@ -70,11 +53,18 @@ public class SysCustConfigServiceImpl implements ISysCustConfigService {
     @Override
     @Override
     public boolean checkConfigKeyUnique(CustSysConfig config) {
     public boolean checkConfigKeyUnique(CustSysConfig config) {
         Long configId = StringUtils.isNull(config.getConfigId()) ? -1L : config.getConfigId();
         Long configId = StringUtils.isNull(config.getConfigId()) ? -1L : config.getConfigId();
-        CustSysConfig info = sysCustConfigMapper.checkConfigKeyUnique(config.getConfigKey());
-        return !StringUtils.isNotNull(info) || info.getConfigId() == configId;
+        CustSysConfig info = sysCustConfigMapper.checkConfigKeyUnique(config);
+        return !StringUtils.isNotNull(info) || info.getConfigId().equals(configId);
     }
     }
 
 
     private String getCacheKey(String configKey) {
     private String getCacheKey(String configKey) {
         return CacheConstants.SYS_CONFIG_KEY + configKey;
         return CacheConstants.SYS_CONFIG_KEY + configKey;
     }
     }
+
+    private String getCacheKey(CustSysConfig configKey) {
+        if (!ObjectUtils.isEmpty(configKey.getTenantId())) {
+            return CacheConstants.SYS_CONFIG_KEY + configKey.getConfigKey() + ":" + configKey.getTenantId();
+        }
+        return CacheConstants.SYS_CONFIG_KEY + configKey.getConfigKey();
+    }
 }
 }

+ 3 - 4
bd-park/park-backend/park-core/src/main/resources/mapper/cons/ConsMachineCmdHisMapper.xml

@@ -7,8 +7,7 @@
     <resultMap type="ConsMachineCmdHis" id="ConsMachineCmdHisResult">
     <resultMap type="ConsMachineCmdHis" id="ConsMachineCmdHisResult">
         <result property="id" column="id"/>
         <result property="id" column="id"/>
         <result property="toMachineId" column="to_machine_id"/>
         <result property="toMachineId" column="to_machine_id"/>
-        <result property="cmdContent" column="cmd_content"
-                typeHandler="com.huashe.park.core.typehandle.MySqlJsonHandler"/>
+        <result property="cmdContent" column="cmd_content"/>
         <result property="cmdResult" column="cmd_result"/>
         <result property="cmdResult" column="cmd_result"/>
         <result property="updateTime" column="update_time"/>
         <result property="updateTime" column="update_time"/>
         <result property="createTime" column="create_time"/>
         <result property="createTime" column="create_time"/>
@@ -53,7 +52,7 @@
         </trim>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="toMachineId != null">#{toMachineId},</if>
             <if test="toMachineId != null">#{toMachineId},</if>
-            <if test="cmdContent != null">#{cmdContent,typeHandler=com.huashe.park.core.typehandle.MySqlJsonHandler},</if>
+            <if test="cmdContent != null">#{cmdContent},</if>
             <if test="cmdResult != null">#{cmdResult},</if>
             <if test="cmdResult != null">#{cmdResult},</if>
             <if test="updateTime != null">#{updateTime},</if>
             <if test="updateTime != null">#{updateTime},</if>
             <if test="createTime != null">#{createTime},</if>
             <if test="createTime != null">#{createTime},</if>
@@ -67,7 +66,7 @@
         <trim prefix="SET" suffixOverrides=",">
         <trim prefix="SET" suffixOverrides=",">
             <if test="toMachineId != null">to_machine_id = #{toMachineId},</if>
             <if test="toMachineId != null">to_machine_id = #{toMachineId},</if>
             <if test="cmdContent != null">cmd_content =
             <if test="cmdContent != null">cmd_content =
-                #{cmdContent,typeHandler=com.huashe.park.core.typehandle.MySqlJsonHandler},
+                #{cmdContent},
             </if>
             </if>
             <if test="cmdResult != null">cmd_result = #{cmdResult},</if>
             <if test="cmdResult != null">cmd_result = #{cmdResult},</if>
             <if test="updateTime != null">update_time = #{updateTime},</if>
             <if test="updateTime != null">update_time = #{updateTime},</if>

+ 16 - 6
bd-park/park-backend/park-core/src/main/resources/mapper/cons/ConsPileHoleInfoMapper.xml

@@ -23,6 +23,7 @@
         <result property="createTime" column="create_time"/>
         <result property="createTime" column="create_time"/>
         <result property="createBy" column="create_by"/>
         <result property="createBy" column="create_by"/>
         <result property="updateBy" column="update_by"/>
         <result property="updateBy" column="update_by"/>
+        <result property="tenantId" column="tenant_id"/>
     </resultMap>
     </resultMap>
 
 
     <sql id="selectConsPileHoleInfoVo">
     <sql id="selectConsPileHoleInfoVo">
@@ -43,7 +44,8 @@
                update_time,
                update_time,
                create_time,
                create_time,
                create_by,
                create_by,
-               update_by
+               update_by,
+               tenant_id
         from cons_pile_hole_info
         from cons_pile_hole_info
     </sql>
     </sql>
 
 
@@ -63,9 +65,10 @@
         cphir.current,
         cphir.current,
         cphir.vertical_deviation,
         cphir.vertical_deviation,
         cphir.spray_volume,
         cphir.spray_volume,
+        cphir.send_spray_volume,
         cphir.spray_pressure,
         cphir.spray_pressure,
-        cphir.start_time,
-        cphir.end_time,
+        cphir.start_time index_start_time,
+        cphir.end_time index_end_time,
         cphir.status,
         cphir.status,
         cphir.tilt_angle,
         cphir.tilt_angle,
         cphir.forward_tilt_angle,
         cphir.forward_tilt_angle,
@@ -124,6 +127,7 @@
             <if test="createTime != null">create_time,</if>
             <if test="createTime != null">create_time,</if>
             <if test="createBy != null">create_by,</if>
             <if test="createBy != null">create_by,</if>
             <if test="updateBy != null">update_by,</if>
             <if test="updateBy != null">update_by,</if>
+            <if test="tenantId != null">tenant_id,</if>
         </trim>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="byteId != null and byteId != ''">#{byteId},</if>
             <if test="byteId != null and byteId != ''">#{byteId},</if>
@@ -142,6 +146,7 @@
             <if test="createTime != null">#{createTime},</if>
             <if test="createTime != null">#{createTime},</if>
             <if test="createBy != null">#{createBy},</if>
             <if test="createBy != null">#{createBy},</if>
             <if test="updateBy != null">#{updateBy},</if>
             <if test="updateBy != null">#{updateBy},</if>
+            <if test="tenantId != null">#{tenantId},</if>
         </trim>
         </trim>
     </insert>
     </insert>
     <insert id="batchInsertConsPileHoleInfo" parameterType="List" useGeneratedKeys="true" keyProperty="id">
     <insert id="batchInsertConsPileHoleInfo" parameterType="List" useGeneratedKeys="true" keyProperty="id">
@@ -161,12 +166,14 @@
         diameter,
         diameter,
         cons_unit_id,
         cons_unit_id,
         update_time,
         update_time,
-        create_time
+        create_by,
+        create_time,
+        tenant_id
         )
         )
         values
         values
         <foreach collection="list" item="item" separator=",">
         <foreach collection="list" item="item" separator=",">
             (
             (
-             #{item.byteId},
+            #{item.byteId},
             #{item.holeKey},
             #{item.holeKey},
             #{item.holeNum},
             #{item.holeNum},
             #{item.deltaX},
             #{item.deltaX},
@@ -180,7 +187,9 @@
             #{item.diameter},
             #{item.diameter},
             #{item.consUnitId},
             #{item.consUnitId},
             now(),
             now(),
-            now())
+            #{item.createBy},
+            now(),
+            #{item.tenantId})
         </foreach>
         </foreach>
         on duplicate key update
         on duplicate key update
         hole_num= values(hole_num),
         hole_num= values(hole_num),
@@ -211,6 +220,7 @@
             <if test="createTime != null">create_time = #{createTime},</if>
             <if test="createTime != null">create_time = #{createTime},</if>
             <if test="createBy != null">create_by = #{createBy},</if>
             <if test="createBy != null">create_by = #{createBy},</if>
             <if test="updateBy != null">update_by = #{updateBy},</if>
             <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="tenantId != null">tenant_id = #{tenantId},</if>
         </trim>
         </trim>
         where id = #{id}
         where id = #{id}
     </update>
     </update>

+ 11 - 4
bd-park/park-backend/park-core/src/main/resources/mapper/cons/ConsUnitInfoMapper.xml

@@ -20,6 +20,7 @@
         <result property="createTime" column="create_time"/>
         <result property="createTime" column="create_time"/>
         <result property="createBy" column="create_by"/>
         <result property="createBy" column="create_by"/>
         <result property="updateBy" column="update_by"/>
         <result property="updateBy" column="update_by"/>
+        <result property="tenantId" column="tenant_id"/>
     </resultMap>
     </resultMap>
 
 
     <sql id="selectConsUnitInfoVo">
     <sql id="selectConsUnitInfoVo">
@@ -37,7 +38,8 @@
                update_time,
                update_time,
                create_time,
                create_time,
                create_by,
                create_by,
-               update_by
+               update_by,
+               tenant_id
         from cons_cons_unit_info
         from cons_cons_unit_info
     </sql>
     </sql>
 
 
@@ -45,6 +47,8 @@
         <include refid="selectConsUnitInfoVo"/>
         <include refid="selectConsUnitInfoVo"/>
         <where>
         <where>
             <if test="name != null  and name != ''">and name like concat('%', #{name}, '%')</if>
             <if test="name != null  and name != ''">and name like concat('%', #{name}, '%')</if>
+            <if test="parentId != null">and parent_id = #{parentId}</if>
+            <if test="projectId != null">and project_id = #{projectId}</if>
         </where>
         </where>
     </select>
     </select>
 
 
@@ -63,18 +67,19 @@
         <trim prefix="(" suffix=")" suffixOverrides=",">
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="byteId !=null ">byte_id,</if>
             <if test="byteId !=null ">byte_id,</if>
             <if test="penningType != null">penning_type,</if>
             <if test="penningType != null">penning_type,</if>
-            <if test="type != null">type,</if>
+            <if test="type != null">`type`,</if>
             <if test="parentId != null">parent_id,</if>
             <if test="parentId != null">parent_id,</if>
             <if test="createType != null">create_type,</if>
             <if test="createType != null">create_type,</if>
             <if test="classifyType != null">classify_type,</if>
             <if test="classifyType != null">classify_type,</if>
-            <if test="name != null and name != ''">name,</if>
+            <if test="name != null and name != ''">`name`,</if>
             <if test="ancestors != null and ancestors!=''">ancestors,</if>
             <if test="ancestors != null and ancestors!=''">ancestors,</if>
-            <if test="projectId != null">update_time,</if>
+            <if test="projectId != null">project_id,</if>
             <if test="fileId != null">file_id,</if>
             <if test="fileId != null">file_id,</if>
             <if test="updateTime != null">update_time,</if>
             <if test="updateTime != null">update_time,</if>
             <if test="createTime != null">create_time,</if>
             <if test="createTime != null">create_time,</if>
             <if test="createBy != null">create_by,</if>
             <if test="createBy != null">create_by,</if>
             <if test="updateBy != null">update_by,</if>
             <if test="updateBy != null">update_by,</if>
+            <if test="tenantId != null">tenant_id,</if>
         </trim>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="byteId !=null ">#{byteId},</if>
             <if test="byteId !=null ">#{byteId},</if>
@@ -91,6 +96,7 @@
             <if test="createTime != null">#{createTime},</if>
             <if test="createTime != null">#{createTime},</if>
             <if test="createBy != null">#{createBy},</if>
             <if test="createBy != null">#{createBy},</if>
             <if test="updateBy != null">#{updateBy},</if>
             <if test="updateBy != null">#{updateBy},</if>
+            <if test="tenantId != null">#{tenantId},</if>
         </trim>
         </trim>
     </insert>
     </insert>
     <update id="updateConsUnitInfo" parameterType="ConsUnitInfo">
     <update id="updateConsUnitInfo" parameterType="ConsUnitInfo">
@@ -110,6 +116,7 @@
             <if test="createTime != null">create_time = #{createTime},</if>
             <if test="createTime != null">create_time = #{createTime},</if>
             <if test="createBy != null">create_by = #{createBy},</if>
             <if test="createBy != null">create_by = #{createBy},</if>
             <if test="updateBy != null">update_by = #{updateBy},</if>
             <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="tenantId != null">tenant_id = #{tenantId},</if>
         </trim>
         </trim>
         where id = #{id}
         where id = #{id}
     </update>
     </update>

+ 10 - 1
bd-park/park-backend/park-core/src/main/resources/mapper/cons/MachineProcessMapper.xml

@@ -44,6 +44,7 @@
         <result property="id" column="id"/>
         <result property="id" column="id"/>
         <result property="createTime" column="create_time"/>
         <result property="createTime" column="create_time"/>
         <result property="recordTime" column="record_time"/>
         <result property="recordTime" column="record_time"/>
+        <result property="tenantId" column="tenant_id"/>
     </resultMap>
     </resultMap>
 
 
     <sql id="selectMachineProcessVo">
     <sql id="selectMachineProcessVo">
@@ -84,7 +85,9 @@
                dt,
                dt,
                id,
                id,
                create_time,
                create_time,
-               record_time, current
+               record_time,
+               `current`,
+               tenant_id
         from cons_machine_process
         from cons_machine_process
     </sql>
     </sql>
 
 
@@ -181,6 +184,7 @@
             <if test="dt != null">dt,</if>
             <if test="dt != null">dt,</if>
             <if test="recordTime != null">record_time,</if>
             <if test="recordTime != null">record_time,</if>
             <if test="createTime != null">create_time,</if>
             <if test="createTime != null">create_time,</if>
+            <if test="tenantId != null">tenant_id,</if>
         </trim>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="consType != null">#{consType},</if>
             <if test="consType != null">#{consType},</if>
@@ -221,6 +225,7 @@
             <if test="dt != null">#{dt},</if>
             <if test="dt != null">#{dt},</if>
             <if test="recordTime != null">#{recordTime},</if>
             <if test="recordTime != null">#{recordTime},</if>
             <if test="createTime != null">#{createTime},</if>
             <if test="createTime != null">#{createTime},</if>
+            <if test="tenantId != null">#{tenantId},</if>
         </trim>
         </trim>
     </insert>
     </insert>
 
 
@@ -265,6 +270,7 @@
             <if test="dt != null">dt,</if>
             <if test="dt != null">dt,</if>
             <if test="recordTime != null">record_time,</if>
             <if test="recordTime != null">record_time,</if>
             <if test="createTime != null">create_time,</if>
             <if test="createTime != null">create_time,</if>
+            <if test="tenantId != null">tenant_id,</if>
         </trim>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="consType != null">#{consType},</if>
             <if test="consType != null">#{consType},</if>
@@ -305,6 +311,7 @@
             <if test="dt != null">#{dt},</if>
             <if test="dt != null">#{dt},</if>
             <if test="recordTime != null">#{recordTime},</if>
             <if test="recordTime != null">#{recordTime},</if>
             <if test="createTime != null">now(),</if>
             <if test="createTime != null">now(),</if>
+            <if test="tenantId != null">#{tenantId},</if>
         </trim>
         </trim>
         on duplicate key update
         on duplicate key update
         <trim suffixOverrides=",">
         <trim suffixOverrides=",">
@@ -348,6 +355,7 @@
             <if test="dt != null">dt = VALUES(dt),</if>
             <if test="dt != null">dt = VALUES(dt),</if>
             <if test="recordTime != null">record_time = VALUES(record_time),</if>
             <if test="recordTime != null">record_time = VALUES(record_time),</if>
             <if test="createTime != null">create_time = NOW(),</if>
             <if test="createTime != null">create_time = NOW(),</if>
+            <if test="tenantId != null">tenant_id = VALUES(tenant_id),</if>
         </trim>
         </trim>
     </insert>
     </insert>
 
 
@@ -392,6 +400,7 @@
             <if test="dt != null">dt = #{dt},</if>
             <if test="dt != null">dt = #{dt},</if>
             <if test="recordTime != null">record_time = #{recordTime},</if>
             <if test="recordTime != null">record_time = #{recordTime},</if>
             <if test="createTime != null">create_time = NOW(),</if>
             <if test="createTime != null">create_time = NOW(),</if>
+            <if test="tenantId != null">tenant_id = #{tenantId},</if>
         </trim>
         </trim>
         where id = #{id}
         where id = #{id}
     </update>
     </update>

+ 15 - 3
bd-park/park-backend/park-core/src/main/resources/mapper/cons/MachineProcessResultMapper.xml

@@ -48,8 +48,8 @@
         <result property="sendEndTime" column="send_end_time"/>
         <result property="sendEndTime" column="send_end_time"/>
         <result property="pullingStartTime" column="pulling_start_time"/>
         <result property="pullingStartTime" column="pulling_start_time"/>
         <result property="pullingEndTime" column="pulling_end_time"/>
         <result property="pullingEndTime" column="pulling_end_time"/>
+        <result property="tenantId" column="tenant_id"/>
     </resultMap>
     </resultMap>
-
     <sql id="selectMachineProcessResultVo">
     <sql id="selectMachineProcessResultVo">
         select id,
         select id,
                cons_type,
                cons_type,
@@ -94,7 +94,8 @@
                uuid,
                uuid,
                dt,
                dt,
                create_time,
                create_time,
-               record_time
+               record_time,
+               tenant_id
         from cons_machine_process_result
         from cons_machine_process_result
     </sql>
     </sql>
 
 
@@ -138,6 +139,7 @@
             <if test="sendEndTime != null">and send_end_time = #{sendEndTime}</if>
             <if test="sendEndTime != null">and send_end_time = #{sendEndTime}</if>
             <if test="pullingStartTime != null">and pulling_start_time = #{pullingStartTime}</if>
             <if test="pullingStartTime != null">and pulling_start_time = #{pullingStartTime}</if>
             <if test="pullingEndTime != null">and pulling_end_time = #{pullingEndTime}</if>
             <if test="pullingEndTime != null">and pulling_end_time = #{pullingEndTime}</if>
+            <if test="pileId !=null">and pile_id = #{pileId}</if>
         </where>
         </where>
     </select>
     </select>
 
 
@@ -193,6 +195,7 @@
             <if test="sendEndTime != null">send_end_time,</if>
             <if test="sendEndTime != null">send_end_time,</if>
             <if test="pullingStartTime != null">pulling_start_time,</if>
             <if test="pullingStartTime != null">pulling_start_time,</if>
             <if test="pullingEndTime != null">pulling_end_time,</if>
             <if test="pullingEndTime != null">pulling_end_time,</if>
+            <if test="tenantId != null">tenant_id,</if>
         </trim>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="consType != null">#{consType},</if>
             <if test="consType != null">#{consType},</if>
@@ -238,6 +241,7 @@
             <if test="sendEndTime != null">#{sendEndTime},</if>
             <if test="sendEndTime != null">#{sendEndTime},</if>
             <if test="pullingStartTime != null">#{pullingStartTime},</if>
             <if test="pullingStartTime != null">#{pullingStartTime},</if>
             <if test="pullingEndTime != null">#{pullingEndTime},</if>
             <if test="pullingEndTime != null">#{pullingEndTime},</if>
+            <if test="tenantId != null">#{tenantId},</if>
         </trim>
         </trim>
     </insert>
     </insert>
     <insert id="insertMachineProcessResultOnUpdate" parameterType="MachineProcessResult" useGeneratedKeys="true"
     <insert id="insertMachineProcessResultOnUpdate" parameterType="MachineProcessResult" useGeneratedKeys="true"
@@ -287,6 +291,7 @@
             <if test="sendEndTime != null">send_end_time,</if>
             <if test="sendEndTime != null">send_end_time,</if>
             <if test="pullingStartTime != null">pulling_start_time,</if>
             <if test="pullingStartTime != null">pulling_start_time,</if>
             <if test="pullingEndTime != null">pulling_end_time,</if>
             <if test="pullingEndTime != null">pulling_end_time,</if>
+            <if test="tenantId != null">tenant_id,</if>
         </trim>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="consType != null">#{consType},</if>
             <if test="consType != null">#{consType},</if>
@@ -332,6 +337,7 @@
             <if test="sendEndTime != null">#{sendEndTime},</if>
             <if test="sendEndTime != null">#{sendEndTime},</if>
             <if test="pullingStartTime != null">#{pullingStartTime},</if>
             <if test="pullingStartTime != null">#{pullingStartTime},</if>
             <if test="pullingEndTime!= null">#{pullingEndTime},</if>
             <if test="pullingEndTime!= null">#{pullingEndTime},</if>
+            <if test="tenantId != null">#{tenantId},</if>
         </trim>
         </trim>
         ON DUPLICATE KEY UPDATE
         ON DUPLICATE KEY UPDATE
         <trim suffixOverrides=",">
         <trim suffixOverrides=",">
@@ -377,6 +383,7 @@
             <if test="sendEndTime != null">send_end_time = VALUES(send_end_time),</if>
             <if test="sendEndTime != null">send_end_time = VALUES(send_end_time),</if>
             <if test="pullingStartTime != null">pulling_start_time = VALUES(pulling_start_time),</if>
             <if test="pullingStartTime != null">pulling_start_time = VALUES(pulling_start_time),</if>
             <if test="pullingEndTime != null">pulling_end_time = VALUES(pulling_end_time),</if>
             <if test="pullingEndTime != null">pulling_end_time = VALUES(pulling_end_time),</if>
+            <if test="tenantId != null">tenant_id = VALUES(tenant_id),</if>
         </trim>
         </trim>
 
 
     </insert>
     </insert>
@@ -427,6 +434,7 @@
             <if test="sendEndTime != null">send_end_time = #{sendEndTime},</if>
             <if test="sendEndTime != null">send_end_time = #{sendEndTime},</if>
             <if test="pullingStartTime != null">pulling_start_time = #{pullingStartTime},</if>
             <if test="pullingStartTime != null">pulling_start_time = #{pullingStartTime},</if>
             <if test="pullingEndTime != null">pulling_end_time = #{pullingEndTime},</if>
             <if test="pullingEndTime != null">pulling_end_time = #{pullingEndTime},</if>
+            <if test="tenantId != null">tenant_id = #{tenantId},</if>
         </trim>
         </trim>
         where id = #{id}
         where id = #{id}
     </update>
     </update>
@@ -447,11 +455,15 @@
         select cmpr.*,
         select cmpr.*,
                cphir.forward_tilt_angle,
                cphir.forward_tilt_angle,
                cphir.tilt_angle,
                cphir.tilt_angle,
-               cphir.hole_num
+               cphir.hole_num,
+               cphir.spray_pressure pressure,
+               cphir.end_press,
+               cphir.depth_press    depth_press
         from cons_machine_process_result cmpr
         from cons_machine_process_result cmpr
                  inner join cons_pile_hole_index_realtime cphir on
                  inner join cons_pile_hole_index_realtime cphir on
             cmpr.pile_id = cphir.hole_byte_key
             cmpr.pile_id = cphir.hole_byte_key
         where cphir.cons_unit_id = #{consUnitId}
         where cphir.cons_unit_id = #{consUnitId}
+          and cphir.status = '00'
     </select>
     </select>
 
 
 </mapper>
 </mapper>

+ 24 - 2
bd-park/park-backend/park-core/src/main/resources/mapper/cons/PileHoleIndexRealtimeMapper.xml

@@ -14,6 +14,7 @@
         <result property="current" column="current"/>
         <result property="current" column="current"/>
         <result property="verticalDeviation" column="vertical_deviation"/>
         <result property="verticalDeviation" column="vertical_deviation"/>
         <result property="sprayVolume" column="spray_volume"/>
         <result property="sprayVolume" column="spray_volume"/>
+        <result property="sendSprayVolume" column="send_spray_volume"/>
         <result property="sprayPressure" column="spray_pressure"/>
         <result property="sprayPressure" column="spray_pressure"/>
         <result property="startTime" column="start_time"/>
         <result property="startTime" column="start_time"/>
         <result property="endTime" column="end_time"/>
         <result property="endTime" column="end_time"/>
@@ -30,6 +31,7 @@
         <result property="createTime" column="create_time"/>
         <result property="createTime" column="create_time"/>
         <result property="createBy" column="create_by"/>
         <result property="createBy" column="create_by"/>
         <result property="updateBy" column="update_by"/>
         <result property="updateBy" column="update_by"/>
+        <result property="tenantId" column="tenant_id"/>
     </resultMap>
     </resultMap>
 
 
     <sql id="selectPileHoleIndexRealtimeVo">
     <sql id="selectPileHoleIndexRealtimeVo">
@@ -43,6 +45,7 @@
                `current`,
                `current`,
                vertical_deviation,
                vertical_deviation,
                spray_volume,
                spray_volume,
+               send_spray_volume,
                spray_pressure,
                spray_pressure,
                start_time,
                start_time,
                end_time,
                end_time,
@@ -53,11 +56,14 @@
                real_y,
                real_y,
                real_lat,
                real_lat,
                real_lng,
                real_lng,
+               end_press,
+               depth_press,
                update_time,
                update_time,
                create_time,
                create_time,
                create_by,
                create_by,
                update_by,
                update_by,
-               cons_unit_id
+               cons_unit_id,
+               tenant_id
         from cons_pile_hole_index_realtime
         from cons_pile_hole_index_realtime
     </sql>
     </sql>
 
 
@@ -82,7 +88,7 @@
         </where>
         </where>
     </select>
     </select>
 
 
-    <select id="selectPileHoleIndexRealtimeById" parameterType="Long" resultMap="PileHoleIndexRealtimeResult">
+    <select id="selectPileHoleIndexRealtimeById" parameterType="Long" resultType="PileHoleIndexRealtime">
         <include refid="selectPileHoleIndexRealtimeVo"/>
         <include refid="selectPileHoleIndexRealtimeVo"/>
         where id = #{id}
         where id = #{id}
     </select>
     </select>
@@ -99,6 +105,7 @@
             <if test="current != null">current,</if>
             <if test="current != null">current,</if>
             <if test="verticalDeviation != null">vertical_deviation,</if>
             <if test="verticalDeviation != null">vertical_deviation,</if>
             <if test="sprayVolume != null">spray_volume,</if>
             <if test="sprayVolume != null">spray_volume,</if>
+            <if test="sendSprayVolume != null">send_spray_volume,</if>
             <if test="sprayPressure != null">spray_pressure,</if>
             <if test="sprayPressure != null">spray_pressure,</if>
             <if test="startTime != null">start_time,</if>
             <if test="startTime != null">start_time,</if>
             <if test="endTime != null">end_time,</if>
             <if test="endTime != null">end_time,</if>
@@ -111,10 +118,13 @@
             <if test="realLng != null">real_lng,</if>
             <if test="realLng != null">real_lng,</if>
             <if test="consUnitId != null">cons_unit_id,</if>
             <if test="consUnitId != null">cons_unit_id,</if>
             <if test="holeNum != null">hole_num,</if>
             <if test="holeNum != null">hole_num,</if>
+            <if test="endPress != null">end_press,</if>
+            <if test="depthPress != null">depth_press,</if>
             <if test="updateTime != null">update_time,</if>
             <if test="updateTime != null">update_time,</if>
             <if test="createTime != null">create_time,</if>
             <if test="createTime != null">create_time,</if>
             <if test="createBy != null">create_by,</if>
             <if test="createBy != null">create_by,</if>
             <if test="updateBy != null">update_by,</if>
             <if test="updateBy != null">update_by,</if>
+            <if test="tenantId != null">tenant_id,</if>
         </trim>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="holeId != null">#{holeId},</if>
             <if test="holeId != null">#{holeId},</if>
@@ -125,6 +135,7 @@
             <if test="current != null">#{current},</if>
             <if test="current != null">#{current},</if>
             <if test="verticalDeviation != null">#{verticalDeviation},</if>
             <if test="verticalDeviation != null">#{verticalDeviation},</if>
             <if test="sprayVolume != null">#{sprayVolume},</if>
             <if test="sprayVolume != null">#{sprayVolume},</if>
+            <if test="sendSprayVolume != null">#{sendSprayVolume},</if>
             <if test="sprayPressure != null">#{sprayPressure},</if>
             <if test="sprayPressure != null">#{sprayPressure},</if>
             <if test="startTime != null">#{startTime},</if>
             <if test="startTime != null">#{startTime},</if>
             <if test="endTime != null">#{endTime},</if>
             <if test="endTime != null">#{endTime},</if>
@@ -137,10 +148,13 @@
             <if test="realLng != null">#{realLng},</if>
             <if test="realLng != null">#{realLng},</if>
             <if test="consUnitId != null">#{consUnitId},</if>
             <if test="consUnitId != null">#{consUnitId},</if>
             <if test="holeNum != null">#{holeNum},</if>
             <if test="holeNum != null">#{holeNum},</if>
+            <if test="endPress != null">#{endPress},</if>
+            <if test="depthPress != null">#{depthPress},</if>
             <if test="updateTime != null">#{updateTime},</if>
             <if test="updateTime != null">#{updateTime},</if>
             <if test="createTime != null">#{createTime},</if>
             <if test="createTime != null">#{createTime},</if>
             <if test="createBy != null">#{createBy},</if>
             <if test="createBy != null">#{createBy},</if>
             <if test="updateBy != null">#{updateBy},</if>
             <if test="updateBy != null">#{updateBy},</if>
+            <if test="tenantId != null">#{tenantId},</if>
         </trim>
         </trim>
     </insert>
     </insert>
 
 
@@ -155,6 +169,7 @@
             <if test="current != null">current = #{current},</if>
             <if test="current != null">current = #{current},</if>
             <if test="verticalDeviation != null">vertical_deviation = #{verticalDeviation},</if>
             <if test="verticalDeviation != null">vertical_deviation = #{verticalDeviation},</if>
             <if test="sprayVolume != null">spray_volume = #{sprayVolume},</if>
             <if test="sprayVolume != null">spray_volume = #{sprayVolume},</if>
+            <if test="sendSprayVolume != null">send_spray_volume = #{sendSprayVolume},</if>
             <if test="sprayPressure != null">spray_pressure = #{sprayPressure},</if>
             <if test="sprayPressure != null">spray_pressure = #{sprayPressure},</if>
             <if test="startTime != null">start_time = #{startTime},</if>
             <if test="startTime != null">start_time = #{startTime},</if>
             <if test="endTime != null">end_time = #{endTime},</if>
             <if test="endTime != null">end_time = #{endTime},</if>
@@ -167,10 +182,13 @@
             <if test="realLng != null">real_lng = #{realLng},</if>
             <if test="realLng != null">real_lng = #{realLng},</if>
             <if test="consUnitId != null">cons_unit_id = #{consUnitId},</if>
             <if test="consUnitId != null">cons_unit_id = #{consUnitId},</if>
             <if test="holeNum != null">hole_num = #{holeNum},</if>
             <if test="holeNum != null">hole_num = #{holeNum},</if>
+            <if test="endPress != null">end_press = #{endPress},</if>
+            <if test="depthPress != null">depth_press = #{depthPress},</if>
             <if test="updateTime != null">update_time = #{updateTime},</if>
             <if test="updateTime != null">update_time = #{updateTime},</if>
             <if test="createTime != null">create_time = #{createTime},</if>
             <if test="createTime != null">create_time = #{createTime},</if>
             <if test="createBy != null">create_by = #{createBy},</if>
             <if test="createBy != null">create_by = #{createBy},</if>
             <if test="updateBy != null">update_by = #{updateBy},</if>
             <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="tenantId != null">tenant_id = #{tenantId},</if>
         </trim>
         </trim>
         where id = #{id}
         where id = #{id}
     </update>
     </update>
@@ -182,6 +200,7 @@
             <if test="current != null">current = #{current},</if>
             <if test="current != null">current = #{current},</if>
             <if test="verticalDeviation != null">vertical_deviation = #{verticalDeviation},</if>
             <if test="verticalDeviation != null">vertical_deviation = #{verticalDeviation},</if>
             <if test="sprayVolume != null">spray_volume = #{sprayVolume},</if>
             <if test="sprayVolume != null">spray_volume = #{sprayVolume},</if>
+            <if test="sendSprayVolume != null">send_spray_volume = #{sendSprayVolume},</if>
             <if test="sprayPressure != null">spray_pressure = #{sprayPressure},</if>
             <if test="sprayPressure != null">spray_pressure = #{sprayPressure},</if>
             <if test="startTime != null">start_time = #{startTime},</if>
             <if test="startTime != null">start_time = #{startTime},</if>
             <if test="endTime != null">end_time = #{endTime},</if>
             <if test="endTime != null">end_time = #{endTime},</if>
@@ -194,10 +213,13 @@
             <if test="realLng != null">real_lng = #{realLng},</if>
             <if test="realLng != null">real_lng = #{realLng},</if>
             <if test="consUnitId != null">cons_unit_id = #{consUnitId},</if>
             <if test="consUnitId != null">cons_unit_id = #{consUnitId},</if>
             <if test="holeNum != null">hole_num = #{holeNum},</if>
             <if test="holeNum != null">hole_num = #{holeNum},</if>
+            <if test="endPress != null">end_press = #{endPress},</if>
+            <if test="depthPress != null">depth_press = #{depthPress},</if>
             <if test="updateTime != null">update_time = #{updateTime},</if>
             <if test="updateTime != null">update_time = #{updateTime},</if>
             <if test="createTime != null">create_time = #{createTime},</if>
             <if test="createTime != null">create_time = #{createTime},</if>
             <if test="createBy != null">create_by = #{createBy},</if>
             <if test="createBy != null">create_by = #{createBy},</if>
             <if test="updateBy != null">update_by = #{updateBy},</if>
             <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="tenantId != null">tenant_id = #{tenantId},</if>
         </trim>
         </trim>
         where hole_id = #{holeId} and machine_id = #{machineId}
         where hole_id = #{holeId} and machine_id = #{machineId}
     </update>
     </update>

+ 8 - 1
bd-park/park-backend/park-core/src/main/resources/mapper/cons/PileMachineInfoMapper.xml

@@ -26,6 +26,7 @@
         <result property="createTime" column="create_time"/>
         <result property="createTime" column="create_time"/>
         <result property="createBy" column="create_by"/>
         <result property="createBy" column="create_by"/>
         <result property="updateBy" column="update_by"/>
         <result property="updateBy" column="update_by"/>
+        <result property="tenantId" column="tenant_id"/>
     </resultMap>
     </resultMap>
 
 
     <sql id="selectPileMachineInfoVo">
     <sql id="selectPileMachineInfoVo">
@@ -48,7 +49,9 @@
                update_time,
                update_time,
                create_time,
                create_time,
                create_by,
                create_by,
-               update_by, no
+               update_by,
+               `no`,
+               tenant_id
         from cons_pile_machine_info
         from cons_pile_machine_info
     </sql>
     </sql>
 
 
@@ -57,6 +60,7 @@
         <where>
         <where>
             <if test="machineNum != null  and machineNum != ''">and machine_num = #{machineNum}</if>
             <if test="machineNum != null  and machineNum != ''">and machine_num = #{machineNum}</if>
             <if test="equipment != null  and equipment != ''">and equipment = #{equipment}</if>
             <if test="equipment != null  and equipment != ''">and equipment = #{equipment}</if>
+            <if test="sn != null  and sn != ''">and sn = #{sn}</if>
             <if test="no != null  and no != ''">and no = #{no}</if>
             <if test="no != null  and no != ''">and no = #{no}</if>
             <if test="status != null  and status != ''">and status = #{status}</if>
             <if test="status != null  and status != ''">and status = #{status}</if>
         </where>
         </where>
@@ -95,6 +99,7 @@
             <if test="createTime != null">create_time,</if>
             <if test="createTime != null">create_time,</if>
             <if test="createBy != null">create_by,</if>
             <if test="createBy != null">create_by,</if>
             <if test="updateBy != null">update_by,</if>
             <if test="updateBy != null">update_by,</if>
+            <if test="tenantId != null">tenant_id,</if>
         </trim>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="byteId != null and byteId != ''">#{byteId},</if>
             <if test="byteId != null and byteId != ''">#{byteId},</if>
@@ -117,6 +122,7 @@
             <if test="createTime != null">#{createTime},</if>
             <if test="createTime != null">#{createTime},</if>
             <if test="createBy != null">#{createBy},</if>
             <if test="createBy != null">#{createBy},</if>
             <if test="updateBy != null">#{updateBy},</if>
             <if test="updateBy != null">#{updateBy},</if>
+            <if test="tenantId != null">#{tenantId},</if>
         </trim>
         </trim>
     </insert>
     </insert>
 
 
@@ -143,6 +149,7 @@
             <if test="createTime != null">create_time = #{createTime},</if>
             <if test="createTime != null">create_time = #{createTime},</if>
             <if test="createBy != null">create_by = #{createBy},</if>
             <if test="createBy != null">create_by = #{createBy},</if>
             <if test="updateBy != null">update_by = #{updateBy},</if>
             <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="tenantId != null">tenant_id = #{tenantId},</if>
         </trim>
         </trim>
         where id = #{id}
         where id = #{id}
     </update>
     </update>

+ 66 - 36
bd-park/park-backend/park-core/src/main/resources/mapper/cons/ProjectCoordinateInfoMapper.xml

@@ -1,46 +1,71 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE mapper
 <!DOCTYPE mapper
-PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
-"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.huashe.park.core.mapper.ProjectCoordinateInfoMapper">
 <mapper namespace="com.huashe.park.core.mapper.ProjectCoordinateInfoMapper">
-    
+
     <resultMap type="ProjectCoordinateInfo" id="ProjectCoordinateInfoResult">
     <resultMap type="ProjectCoordinateInfo" id="ProjectCoordinateInfoResult">
-        <result property="id"    column="id"    />
-        <result property="projectId"    column="project_id"    />
-        <result property="strName"    column="str_name"    />
-        <result property="da"    column="da"    />
-        <result property="df"    column="df"    />
-        <result property="dreferenceLatitude"    column="dreference_latitude"    />
-        <result property="dcentralMeridian"    column="dcentral_meridian"    />
-        <result property="dreferenceLongitude"    column="dreference_longitude"    />
-        <result property="dprojectionHeight"    column="dprojection_height"    />
-        <result property="projectionName"    column="projection_name"    />
-        <result property="heightFittingParameter"    column="height_fitting_parameter"    />
-        <result property="constructionP4"    column="construction_p4"    />
-        <result property="createType"    column="create_type"    />
-        <result property="projectionId"    column="projection_id"    />
-        <result property="constructionP7"    column="construction_p7"    />
-        <result property="projectType"    column="project_type"    />
-        <result property="dtx"    column="dtx"    />
-        <result property="dty"    column="dty"    />
-        <result property="ntype"    column="ntype"    />
-        <result property="dtk"    column="dtk"    />
-        <result property="updateTime"    column="update_time"    />
-        <result property="createTime"    column="create_time"    />
-        <result property="createBy"    column="create_by"    />
-        <result property="updateBy"    column="update_by"    />
+        <result property="id" column="id"/>
+        <result property="projectId" column="project_id"/>
+        <result property="strName" column="str_name"/>
+        <result property="da" column="da"/>
+        <result property="df" column="df"/>
+        <result property="dreferenceLatitude" column="dreference_latitude"/>
+        <result property="dcentralMeridian" column="dcentral_meridian"/>
+        <result property="dreferenceLongitude" column="dreference_longitude"/>
+        <result property="dprojectionHeight" column="dprojection_height"/>
+        <result property="projectionName" column="projection_name"/>
+        <result property="heightFittingParameter" column="height_fitting_parameter"/>
+        <result property="constructionP4" column="construction_p4"/>
+        <result property="createType" column="create_type"/>
+        <result property="projectionId" column="projection_id"/>
+        <result property="constructionP7" column="construction_p7"/>
+        <result property="projectType" column="project_type"/>
+        <result property="dtx" column="dtx"/>
+        <result property="dty" column="dty"/>
+        <result property="ntype" column="ntype"/>
+        <result property="dtk" column="dtk"/>
+        <result property="updateTime" column="update_time"/>
+        <result property="createTime" column="create_time"/>
+        <result property="createBy" column="create_by"/>
+        <result property="updateBy" column="update_by"/>
+        <result property="tenantId" column="tenant_id"/>
     </resultMap>
     </resultMap>
 
 
     <sql id="selectProjectCoordinateInfoVo">
     <sql id="selectProjectCoordinateInfoVo">
-        select id, project_id, str_name, da, df, dreference_latitude, dcentral_meridian, dreference_longitude, dprojection_height, projection_name, height_fitting_parameter, construction_p4, create_type, projection_id, construction_p7, project_type, dtx, dty, ntype, dtk, update_time, create_time, create_by, update_by from cons_project_coordinate_info
+        select id,
+               project_id,
+               str_name,
+               da,
+               df,
+               dreference_latitude,
+               dcentral_meridian,
+               dreference_longitude,
+               dprojection_height,
+               projection_name,
+               height_fitting_parameter,
+               construction_p4,
+               create_type,
+               projection_id,
+               construction_p7,
+               project_type,
+               dtx,
+               dty,
+               ntype,
+               dtk,
+               update_time,
+               create_time,
+               create_by,
+               update_by,
+               tenant_id
+        from cons_project_coordinate_info
     </sql>
     </sql>
 
 
-    <select id="selectProjectCoordinateInfoList" parameterType="ProjectCoordinateInfo" resultMap="ProjectCoordinateInfoResult">
+    <select id="selectProjectCoordinateInfoList" parameterType="ProjectCoordinateInfo"
+            resultMap="ProjectCoordinateInfoResult">
         <include refid="selectProjectCoordinateInfoVo"/>
         <include refid="selectProjectCoordinateInfoVo"/>
-        <where>  
-        </where>
     </select>
     </select>
-    
+
     <select id="selectProjectCoordinateInfoById" parameterType="Long" resultMap="ProjectCoordinateInfoResult">
     <select id="selectProjectCoordinateInfoById" parameterType="Long" resultMap="ProjectCoordinateInfoResult">
         <include refid="selectProjectCoordinateInfoVo"/>
         <include refid="selectProjectCoordinateInfoVo"/>
         where id = #{id}
         where id = #{id}
@@ -73,7 +98,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="createTime != null">create_time,</if>
             <if test="createTime != null">create_time,</if>
             <if test="createBy != null">create_by,</if>
             <if test="createBy != null">create_by,</if>
             <if test="updateBy != null">update_by,</if>
             <if test="updateBy != null">update_by,</if>
-         </trim>
+            <if test="tenantId != null">tenant_id,</if>
+        </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null">#{id},</if>
             <if test="id != null">#{id},</if>
             <if test="projectId != null">#{projectId},</if>
             <if test="projectId != null">#{projectId},</if>
@@ -99,7 +125,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="createTime != null">#{createTime},</if>
             <if test="createTime != null">#{createTime},</if>
             <if test="createBy != null">#{createBy},</if>
             <if test="createBy != null">#{createBy},</if>
             <if test="updateBy != null">#{updateBy},</if>
             <if test="updateBy != null">#{updateBy},</if>
-         </trim>
+            <if test="tenantId != null">#{tenantId},</if>
+        </trim>
     </insert>
     </insert>
 
 
     <update id="updateProjectCoordinateInfo" parameterType="ProjectCoordinateInfo">
     <update id="updateProjectCoordinateInfo" parameterType="ProjectCoordinateInfo">
@@ -128,16 +155,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="createTime != null">create_time = #{createTime},</if>
             <if test="createTime != null">create_time = #{createTime},</if>
             <if test="createBy != null">create_by = #{createBy},</if>
             <if test="createBy != null">create_by = #{createBy},</if>
             <if test="updateBy != null">update_by = #{updateBy},</if>
             <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="tenantId != null">tenant_id = #{tenantId},</if>
         </trim>
         </trim>
         where id = #{id}
         where id = #{id}
     </update>
     </update>
 
 
     <delete id="deleteProjectCoordinateInfoById" parameterType="Long">
     <delete id="deleteProjectCoordinateInfoById" parameterType="Long">
-        delete from cons_project_coordinate_info where id = #{id}
+        delete
+        from cons_project_coordinate_info
+        where id = #{id}
     </delete>
     </delete>
 
 
     <delete id="deleteProjectCoordinateInfoByIds" parameterType="String">
     <delete id="deleteProjectCoordinateInfoByIds" parameterType="String">
-        delete from cons_project_coordinate_info where id in 
+        delete from cons_project_coordinate_info where id in
         <foreach item="id" collection="array" open="(" separator="," close=")">
         <foreach item="id" collection="array" open="(" separator="," close=")">
             #{id}
             #{id}
         </foreach>
         </foreach>

+ 24 - 17
bd-park/park-backend/park-core/src/main/resources/mapper/cons/ProjectInfoMapper.xml

@@ -1,29 +1,31 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE mapper
 <!DOCTYPE mapper
-PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
-"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.huashe.park.core.mapper.ProjectInfoMapper">
 <mapper namespace="com.huashe.park.core.mapper.ProjectInfoMapper">
-    
+
     <resultMap type="ProjectInfo" id="ProjectInfoResult">
     <resultMap type="ProjectInfo" id="ProjectInfoResult">
-        <result property="id"    column="id"    />
-        <result property="name"    column="name"    />
-        <result property="updateTime"    column="update_time"    />
-        <result property="createTime"    column="create_time"    />
-        <result property="createBy"    column="create_by"    />
-        <result property="updateBy"    column="update_by"    />
+        <result property="id" column="id"/>
+        <result property="name" column="name"/>
+        <result property="updateTime" column="update_time"/>
+        <result property="createTime" column="create_time"/>
+        <result property="createBy" column="create_by"/>
+        <result property="updateBy" column="update_by"/>
+        <result property="tenantId" column="tenant_id"/>
     </resultMap>
     </resultMap>
 
 
     <sql id="selectProjectInfoVo">
     <sql id="selectProjectInfoVo">
-        select id, name, update_time, create_time, create_by, update_by from cons_project_info
+        select id, name, update_time, create_time, create_by, update_by, tenant_id
+        from cons_project_info
     </sql>
     </sql>
 
 
     <select id="selectProjectInfoList" parameterType="ProjectInfo" resultMap="ProjectInfoResult">
     <select id="selectProjectInfoList" parameterType="ProjectInfo" resultMap="ProjectInfoResult">
         <include refid="selectProjectInfoVo"/>
         <include refid="selectProjectInfoVo"/>
-        <where>  
-            <if test="name != null  and name != ''"> and name like concat('%', #{name}, '%')</if>
+        <where>
+            <if test="name != null  and name != ''">and name like concat('%', #{name}, '%')</if>
         </where>
         </where>
     </select>
     </select>
-    
+
     <select id="selectProjectInfoById" parameterType="Long" resultMap="ProjectInfoResult">
     <select id="selectProjectInfoById" parameterType="Long" resultMap="ProjectInfoResult">
         <include refid="selectProjectInfoVo"/>
         <include refid="selectProjectInfoVo"/>
         where id = #{id}
         where id = #{id}
@@ -37,14 +39,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="createTime != null">create_time,</if>
             <if test="createTime != null">create_time,</if>
             <if test="createBy != null">create_by,</if>
             <if test="createBy != null">create_by,</if>
             <if test="updateBy != null">update_by,</if>
             <if test="updateBy != null">update_by,</if>
-         </trim>
+            <if test="tenantId != null">tenant_id,</if>
+        </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="name != null">#{name},</if>
             <if test="name != null">#{name},</if>
             <if test="updateTime != null">#{updateTime},</if>
             <if test="updateTime != null">#{updateTime},</if>
             <if test="createTime != null">#{createTime},</if>
             <if test="createTime != null">#{createTime},</if>
             <if test="createBy != null">#{createBy},</if>
             <if test="createBy != null">#{createBy},</if>
             <if test="updateBy != null">#{updateBy},</if>
             <if test="updateBy != null">#{updateBy},</if>
-         </trim>
+            <if test="tenantId != null">#{tenantId},</if>
+        </trim>
     </insert>
     </insert>
 
 
     <update id="updateProjectInfo" parameterType="ProjectInfo">
     <update id="updateProjectInfo" parameterType="ProjectInfo">
@@ -55,16 +59,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="createTime != null">create_time = #{createTime},</if>
             <if test="createTime != null">create_time = #{createTime},</if>
             <if test="createBy != null">create_by = #{createBy},</if>
             <if test="createBy != null">create_by = #{createBy},</if>
             <if test="updateBy != null">update_by = #{updateBy},</if>
             <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="tenantId != null">tenant_id = #{tenantId},</if>
         </trim>
         </trim>
         where id = #{id}
         where id = #{id}
     </update>
     </update>
 
 
     <delete id="deleteProjectInfoById" parameterType="Long">
     <delete id="deleteProjectInfoById" parameterType="Long">
-        delete from cons_project_info where id = #{id}
+        delete
+        from cons_project_info
+        where id = #{id}
     </delete>
     </delete>
 
 
     <delete id="deleteProjectInfoByIds" parameterType="String">
     <delete id="deleteProjectInfoByIds" parameterType="String">
-        delete from cons_project_info where id in 
+        delete from cons_project_info where id in
         <foreach item="id" collection="array" open="(" separator="," close=")">
         <foreach item="id" collection="array" open="(" separator="," close=")">
             #{id}
             #{id}
         </foreach>
         </foreach>

+ 3 - 4
bd-park/park-backend/park-core/src/main/resources/mapper/park/ParkAttendGroupMapper.xml

@@ -9,8 +9,7 @@
         <result property="name" column="name"/>
         <result property="name" column="name"/>
         <result property="remark" column="remark"/>
         <result property="remark" column="remark"/>
         <result property="poly" column="poly"/>
         <result property="poly" column="poly"/>
-        <result property="timeRange" column="time_range"
-                typeHandler="com.huashe.park.core.typehandle.MySqlJsonHandler"/>
+        <result property="timeRange" column="time_range"/>
         <result property="updateTime" column="update_time"/>
         <result property="updateTime" column="update_time"/>
         <result property="createTime" column="create_time"/>
         <result property="createTime" column="create_time"/>
         <result property="createBy" column="create_by"/>
         <result property="createBy" column="create_by"/>
@@ -61,7 +60,7 @@
             <if test="name != null">#{name},</if>
             <if test="name != null">#{name},</if>
             <if test="remark != null">#{remark},</if>
             <if test="remark != null">#{remark},</if>
             <if test="poly != null">ST_GeomFromText(#{poly}),</if>
             <if test="poly != null">ST_GeomFromText(#{poly}),</if>
-            <if test="timeRange != null">#{timeRange,typeHandler=com.huashe.park.core.typehandle.MySqlJsonHandler},</if>
+            <if test="timeRange != null">#{timeRange},</if>
             <if test="updateTime != null">#{updateTime},</if>
             <if test="updateTime != null">#{updateTime},</if>
             <if test="createTime != null">#{createTime},</if>
             <if test="createTime != null">#{createTime},</if>
             <if test="createBy != null">#{createBy},</if>
             <if test="createBy != null">#{createBy},</if>
@@ -76,7 +75,7 @@
             <if test="name != null">name = #{name},</if>
             <if test="name != null">name = #{name},</if>
             <if test="remark != null">remark = #{remark},</if>
             <if test="remark != null">remark = #{remark},</if>
             <if test="poly != null">poly = ST_GeomFromText(#{poly}),</if>
             <if test="poly != null">poly = ST_GeomFromText(#{poly}),</if>
-            <if test="timeRange != null">time_range = #{timeRange,typeHandler=com.huashe.park.core.typehandle.MySqlJsonHandler},</if>
+            <if test="timeRange != null">time_range = #{timeRange},</if>
             <if test="updateTime != null">update_time = #{updateTime},</if>
             <if test="updateTime != null">update_time = #{updateTime},</if>
             <if test="createTime != null">create_time = #{createTime},</if>
             <if test="createTime != null">create_time = #{createTime},</if>
             <if test="createBy != null">create_by = #{createBy},</if>
             <if test="createBy != null">create_by = #{createBy},</if>

+ 3 - 4
bd-park/park-backend/park-core/src/main/resources/mapper/park/ParkInspectProjMapper.xml

@@ -6,8 +6,7 @@
 
 
     <resultMap type="ParkInspectProj" id="ParkInspectProjResult">
     <resultMap type="ParkInspectProj" id="ParkInspectProjResult">
         <result property="id" column="id"/>
         <result property="id" column="id"/>
-        <result property="projContent" column="proj_content"
-                typeHandler="com.huashe.park.core.typehandle.MySqlJsonHandler"/>
+        <result property="projContent" column="proj_content"/>
         <result property="lng" column="lng"/>
         <result property="lng" column="lng"/>
         <result property="lat" column="lat"/>
         <result property="lat" column="lat"/>
         <result property="radius" column="radius"/>
         <result property="radius" column="radius"/>
@@ -63,7 +62,7 @@
         </trim>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="projContent != null">
             <if test="projContent != null">
-                #{projContent,typeHandler=com.huashe.park.core.typehandle.MySqlJsonHandler},
+                #{projContent},
             </if>
             </if>
             <if test="lng != null">#{lng},</if>
             <if test="lng != null">#{lng},</if>
             <if test="lat != null">#{lat},</if>
             <if test="lat != null">#{lat},</if>
@@ -80,7 +79,7 @@
     <update id="updateParkInspectProj" parameterType="ParkInspectProj">
     <update id="updateParkInspectProj" parameterType="ParkInspectProj">
         update park_inspect_proj
         update park_inspect_proj
         <trim prefix="SET" suffixOverrides=",">
         <trim prefix="SET" suffixOverrides=",">
-            <if test="projContent != null">proj_content = #{projContent,typeHandler=com.huashe.park.core.typehandle.MySqlJsonHandler},</if>
+            <if test="projContent != null">proj_content = #{projContent},</if>
             <if test="lng != null">lng = #{lng},</if>
             <if test="lng != null">lng = #{lng},</if>
             <if test="lat != null">lat = #{lat},</if>
             <if test="lat != null">lat = #{lat},</if>
             <if test="radius != null">radius = #{radius},</if>
             <if test="radius != null">radius = #{radius},</if>

+ 9 - 3
bd-park/park-backend/park-core/src/main/resources/mapper/sys/SysCustConfigMapper.xml

@@ -12,10 +12,11 @@
             <if test="configKey !=null and configKey != ''">
             <if test="configKey !=null and configKey != ''">
                 and config_key = #{configKey}
                 and config_key = #{configKey}
             </if>
             </if>
+            <if test="configType == 'Y'.toString() and tenantId  != null">and tenant_id = #{tenantId}</if>
         </where>
         </where>
     </sql>
     </sql>
 
 
-    <select id="selectConfig" parameterType="CustSysConfig" resultType="CustSysConfig">
+    <select id="selectTenantConfig" parameterType="CustSysConfig" resultType="CustSysConfig">
         select *
         select *
         from sys_config
         from sys_config
         <include refid="sqlwhereSearch"/>
         <include refid="sqlwhereSearch"/>
@@ -30,6 +31,7 @@
             <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
             <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
             <if test="remark != null">remark = #{remark},</if>
             <if test="remark != null">remark = #{remark},</if>
             <if test="cfgJson != null">cfg_json = #{cfgJson},</if>
             <if test="cfgJson != null">cfg_json = #{cfgJson},</if>
+            <if test="configType == 'Y'.toString() and tenantId  != null">tenant_id = #{tenantId},</if>
             update_time = sysdate()
             update_time = sysdate()
         </set>
         </set>
         where config_id = #{configId}
         where config_id = #{configId}
@@ -40,8 +42,12 @@
         from sys_config where config_id = #{configId}
         from sys_config where config_id = #{configId}
     </select>
     </select>
 
 
-    <select id="checkConfigKeyUnique" parameterType="String" resultType="CustSysConfig">
+    <select id="checkConfigKeyUnique" parameterType="CustSysConfig" resultType="CustSysConfig">
         select * from sys_config
         select * from sys_config
-        where config_key = #{configKey} limit 1
+        where config_key = #{configKey}
+        <if test="configType != 'Y'.toString() and tenantId !=null">
+            and tenant_id = #{tenantId}
+        </if>
+        limit 1
     </select>
     </select>
 </mapper> 
 </mapper> 

+ 31 - 0
bd-park/park-backend/park-domain/src/main/java/com/huashe/park/domain/dto/cons/ConsUnitResult.java

@@ -1,5 +1,6 @@
 package com.huashe.park.domain.dto.cons;
 package com.huashe.park.domain.dto.cons;
 
 
+import com.alibaba.fastjson2.JSONObject;
 import com.huashe.park.domain.entity.MachineProcessResult;
 import com.huashe.park.domain.entity.MachineProcessResult;
 
 
 public class ConsUnitResult extends MachineProcessResult {
 public class ConsUnitResult extends MachineProcessResult {
@@ -9,6 +10,12 @@ public class ConsUnitResult extends MachineProcessResult {
 
 
     private String holeNum;
     private String holeNum;
 
 
+    private Double pressure;
+
+    private Double endPress;
+
+    private JSONObject depthPress;
+
     public Double getForwardTiltAngle() {
     public Double getForwardTiltAngle() {
         return forwardTiltAngle;
         return forwardTiltAngle;
     }
     }
@@ -32,4 +39,28 @@ public class ConsUnitResult extends MachineProcessResult {
     public void setHoleNum(String holeNum) {
     public void setHoleNum(String holeNum) {
         this.holeNum = holeNum;
         this.holeNum = holeNum;
     }
     }
+
+    public Double getPressure() {
+        return pressure;
+    }
+
+    public void setPressure(Double pressure) {
+        this.pressure = pressure;
+    }
+
+    public Double getEndPress() {
+        return endPress;
+    }
+
+    public void setEndPress(Double endPress) {
+        this.endPress = endPress;
+    }
+
+    public JSONObject getDepthPress() {
+        return depthPress;
+    }
+
+    public void setDepthPress(JSONObject depthPress) {
+        this.depthPress = depthPress;
+    }
 }
 }

+ 45 - 0
bd-park/park-backend/park-domain/src/main/java/com/huashe/park/domain/dto/cons/MqttRequest.java

@@ -0,0 +1,45 @@
+/*
+ * 文 件 名:  MqttRequest
+ * 版    权:  浩鲸云计算科技股份有限公司
+ * 描    述:  <描述>
+ * 修 改 人:  lvwenbin
+ * 修改时间:  2024/5/6
+ * 跟踪单号:  <跟踪单号>
+ * 修改单号:  <修改单号>
+ * 修改内容:  <修改内容>
+ */
+package com.huashe.park.domain.dto.cons;
+
+import java.io.Serializable;
+
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 发送请求 <功能详细描述>
+ *
+ * @author lvwenbin
+ * @version [版本号, 2024/5/6]
+ * @see [相关类/方法]
+ * @since [产品/模块版本]
+ */
+@Data
+@NoArgsConstructor
+public class MqttRequest implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    private String topic;
+
+    private String payload;
+
+    private int qos = 0;
+
+    private boolean retained = false;
+
+    private String clientKey;
+
+    private String clientSecret;
+
+    private String handleBean = "RootMsgHandler";
+
+}

+ 6 - 3
bd-park/park-backend/park-domain/src/main/java/com/huashe/park/domain/dto/cons/PileRealtimeIndex.java

@@ -34,9 +34,12 @@ public class PileRealtimeIndex extends ConsPileHoleInfo {
     private Double verticalDeviation;
     private Double verticalDeviation;
 
 
     /** 灌浆体积(m³)ups200送带量 */
     /** 灌浆体积(m³)ups200送带量 */
-    @Excel(name = "灌浆体积", readConverterExp = "m=³")
+    @Excel(name = "回带量", readConverterExp = "m=³")
     private Double sprayVolume;
     private Double sprayVolume;
 
 
+    @Excel(name = "送带量", readConverterExp = "m=³")
+    private Double sendSprayVolume;
+
     /** 喷浆压力 ups200 压力值 */
     /** 喷浆压力 ups200 压力值 */
     @Excel(name = "喷浆压力 ups200 压力值")
     @Excel(name = "喷浆压力 ups200 压力值")
     private Double sprayPressure;
     private Double sprayPressure;
@@ -44,12 +47,12 @@ public class PileRealtimeIndex extends ConsPileHoleInfo {
     /** 开始时间 */
     /** 开始时间 */
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd  HH:mm:ss")
     @Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd  HH:mm:ss")
-    private Date startTime;
+    private Date indexStartTime;
 
 
     /** 结束时间 */
     /** 结束时间 */
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd  HH:mm:ss")
     @Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd  HH:mm:ss")
-    private Date endTime;
+    private Date indexEndTime;
 
 
     /** 桩点状态 */
     /** 桩点状态 */
     @Excel(name = "桩点状态")
     @Excel(name = "桩点状态")

+ 6 - 6
bd-park/park-backend/park-domain/src/main/java/com/huashe/park/domain/dto/cons/ResultCADCsv.java

@@ -27,10 +27,10 @@ public class ResultCADCsv {
     private Long duration;
     private Long duration;
 
 
     @CsvAlias(alias = "X-coordinate")
     @CsvAlias(alias = "X-coordinate")
-    private Double designX;
+    private Double realX;
 
 
     @CsvAlias(alias = "Y-coordinate")
     @CsvAlias(alias = "Y-coordinate")
-    private Double designY;
+    private Double realY;
 
 
     @CsvAlias(alias = "Height")
     @CsvAlias(alias = "Height")
     private Double startHeight;
     private Double startHeight;
@@ -40,10 +40,10 @@ public class ResultCADCsv {
     private Double effectiveDown;
     private Double effectiveDown;
 
 
     @CsvAlias(alias = "Pull Value")
     @CsvAlias(alias = "Pull Value")
-    private Double pullValue;
+    private Float pullValue;
 
 
     @CsvAlias(alias = "Actual. Depth")
     @CsvAlias(alias = "Actual. Depth")
-    private Double actualDepth;
+    private Float actualDepth;
 
 
     @CsvAlias(alias = "Tilt X")
     @CsvAlias(alias = "Tilt X")
     private Double forwardTiltAngle;
     private Double forwardTiltAngle;
@@ -58,10 +58,10 @@ public class ResultCADCsv {
     private Double endingPress;
     private Double endingPress;
 
 
     @CsvAlias(alias = "Intrusion Vel.[m/s]")
     @CsvAlias(alias = "Intrusion Vel.[m/s]")
-    private Double avgSpeed;
+    private Float avgSpeed;
 
 
     @CsvAlias(alias = "Pullout Vel.[m/s]")
     @CsvAlias(alias = "Pullout Vel.[m/s]")
-    private Double avgUpSpeed;
+    private Float avgUpSpeed;
 
 
     @CsvAlias(alias = "Result")
     @CsvAlias(alias = "Result")
     private String evaluation;
     private String evaluation;

+ 1 - 1
bd-park/park-backend/park-domain/src/main/java/com/huashe/park/domain/entity/ConsPileHoleInfo.java

@@ -85,7 +85,7 @@ public class ConsPileHoleInfo extends BaseEntity {
 
 
     /** 桩径 */
     /** 桩径 */
     @Excel(name = "桩径")
     @Excel(name = "桩径")
-    private Long diameter;
+    private Long diameter = 0L;
 
 
     private Long consUnitId;
     private Long consUnitId;
 
 

+ 56 - 322
bd-park/park-backend/park-domain/src/main/java/com/huashe/park/domain/entity/MachineProcess.java

@@ -5,6 +5,10 @@ import org.apache.commons.lang3.builder.ToStringStyle;
 
 
 import com.huashe.common.annotation.Excel;
 import com.huashe.common.annotation.Excel;
 import com.huashe.common.domain.BaseEntity;
 import com.huashe.common.domain.BaseEntity;
+import com.huashe.park.common.animations.FixedLength;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
 
 
 /**
 /**
  * 桩机施工过程数据对象 cons_machine_process
  * 桩机施工过程数据对象 cons_machine_process
@@ -12,131 +16,164 @@ import com.huashe.common.domain.BaseEntity;
  * @author ruoyi
  * @author ruoyi
  * @date 2025-02-26
  * @date 2025-02-26
  */
  */
+@EqualsAndHashCode(callSuper = true)
+@Data
 public class MachineProcess extends BaseEntity {
 public class MachineProcess extends BaseEntity {
     private static final long serialVersionUID = 1L;
     private static final long serialVersionUID = 1L;
 
 
     /** 设备类型(0-1字节) */
     /** 设备类型(0-1字节) */
     @Excel(name = "设备类型", readConverterExp = "0=-1字节")
     @Excel(name = "设备类型", readConverterExp = "0=-1字节")
-    private Integer consType;
+    @FixedLength(value = 2)
+    private Short consType;
 
 
     /** 数据版本(2字节) */
     /** 数据版本(2字节) */
     @Excel(name = "数据版本", readConverterExp = "2=字节")
     @Excel(name = "数据版本", readConverterExp = "2=字节")
-    private Integer dataVersion;
+    @FixedLength(value = 1)
+    private Byte dataVersion;
 
 
     /** 数据时间(3-10字节,大端序) */
     /** 数据时间(3-10字节,大端序) */
     @Excel(name = "数据时间", readConverterExp = "3=-10字节,大端序")
     @Excel(name = "数据时间", readConverterExp = "3=-10字节,大端序")
+    @FixedLength(value = 8)
     private Long dataTime;
     private Long dataTime;
 
 
     /** 桩号(11-18字节) */
     /** 桩号(11-18字节) */
     @Excel(name = "桩号", readConverterExp = "1=1-18字节")
     @Excel(name = "桩号", readConverterExp = "1=1-18字节")
+    @FixedLength(value = 8)
     private String pileId;
     private String pileId;
 
 
     /** 设计编号(19-26字节) */
     /** 设计编号(19-26字节) */
     @Excel(name = "设计编号", readConverterExp = "1=9-26字节")
     @Excel(name = "设计编号", readConverterExp = "1=9-26字节")
+    @FixedLength(value = 8)
     private String designId;
     private String designId;
 
 
     /** 机器编号(27-34字节) */
     /** 机器编号(27-34字节) */
     @Excel(name = "机器编号", readConverterExp = "2=7-34字节")
     @Excel(name = "机器编号", readConverterExp = "2=7-34字节")
+    @FixedLength(value = 8)
     private String machineId;
     private String machineId;
 
 
     /** 实际X坐标(35-42字节) */
     /** 实际X坐标(35-42字节) */
     @Excel(name = "实际X坐标", readConverterExp = "3=5-42字节")
     @Excel(name = "实际X坐标", readConverterExp = "3=5-42字节")
+    @FixedLength(value = 8)
     private Double realX;
     private Double realX;
 
 
     /** 实际Y坐标(43-50字节) */
     /** 实际Y坐标(43-50字节) */
     @Excel(name = "实际Y坐标", readConverterExp = "4=3-50字节")
     @Excel(name = "实际Y坐标", readConverterExp = "4=3-50字节")
+    @FixedLength(value = 8)
     private Double realY;
     private Double realY;
 
 
     /** 高程(51-54字节) */
     /** 高程(51-54字节) */
     @Excel(name = "高程", readConverterExp = "5=1-54字节")
     @Excel(name = "高程", readConverterExp = "5=1-54字节")
-    private Double realZ;
+    @FixedLength(value = 4)
+    private Float realZ;
 
 
     /** 纬度(55-62字节) */
     /** 纬度(55-62字节) */
     @Excel(name = "纬度", readConverterExp = "5=5-62字节")
     @Excel(name = "纬度", readConverterExp = "5=5-62字节")
+    @FixedLength(value = 8)
     private Double latitude;
     private Double latitude;
 
 
     /** 经度(63-70字节) */
     /** 经度(63-70字节) */
     @Excel(name = "经度", readConverterExp = "6=3-70字节")
     @Excel(name = "经度", readConverterExp = "6=3-70字节")
+    @FixedLength(value = 8)
     private Double longitude;
     private Double longitude;
 
 
     /** 设计桩长(71-74字节) */
     /** 设计桩长(71-74字节) */
     @Excel(name = "设计桩长", readConverterExp = "7=1-74字节")
     @Excel(name = "设计桩长", readConverterExp = "7=1-74字节")
-    private Double pileLength;
+    @FixedLength(value = 4)
+    private Float pileLength;
 
 
     /** 实际桩长(75-78字节) */
     /** 实际桩长(75-78字节) */
     @Excel(name = "实际桩长", readConverterExp = "7=5-78字节")
     @Excel(name = "实际桩长", readConverterExp = "7=5-78字节")
-    private Double realPileLength;
+    @FixedLength(value = 4)
+    private Float realPileLength;
 
 
     /** 速度(79-82字节) */
     /** 速度(79-82字节) */
     @Excel(name = "速度", readConverterExp = "7=9-82字节")
     @Excel(name = "速度", readConverterExp = "7=9-82字节")
-    private Double speed;
+    @FixedLength(value = 4)
+    private Float speed;
 
 
     /** 电流(83-86字节) */
     /** 电流(83-86字节) */
     @Excel(name = "电流", readConverterExp = "8=3-86字节")
     @Excel(name = "电流", readConverterExp = "8=3-86字节")
-    private Double current;
+    @FixedLength(value = 4)
+    private Float current;
 
 
     /** 倾侧角(87-90字节) */
     /** 倾侧角(87-90字节) */
     @Excel(name = "倾侧角", readConverterExp = "8=7-90字节")
     @Excel(name = "倾侧角", readConverterExp = "8=7-90字节")
-    private Double tiltAngle;
+    @FixedLength(value = 4)
+    private Float tiltAngle;
 
 
     /** 前倾角(91-94字节) */
     /** 前倾角(91-94字节) */
     @Excel(name = "前倾角", readConverterExp = "9=1-94字节")
     @Excel(name = "前倾角", readConverterExp = "9=1-94字节")
-    private Double forwardTiltAngle;
+    @FixedLength(value = 4)
+    private Float forwardTiltAngle;
 
 
     /** 垂直度(95-98字节) */
     /** 垂直度(95-98字节) */
     @Excel(name = "垂直度", readConverterExp = "9=5-98字节")
     @Excel(name = "垂直度", readConverterExp = "9=5-98字节")
-    private Double verticalAngle;
+    @FixedLength(value = 4)
+    private Float verticalAngle;
 
 
     /** 自编号(99-102字节) */
     /** 自编号(99-102字节) */
     @Excel(name = "自编号", readConverterExp = "9=9-102字节")
     @Excel(name = "自编号", readConverterExp = "9=9-102字节")
+    @FixedLength(value = 4)
     private Integer selfNum;
     private Integer selfNum;
 
 
     /** 持力层电流(103-106字节) */
     /** 持力层电流(103-106字节) */
     @Excel(name = "持力层电流", readConverterExp = "1=03-106字节")
     @Excel(name = "持力层电流", readConverterExp = "1=03-106字节")
-    private Double holdCurrent;
+    @FixedLength(value = 4)
+    private Float holdCurrent;
 
 
     /** 灌浆体积(107-110字节) */
     /** 灌浆体积(107-110字节) */
     @Excel(name = "灌浆体积", readConverterExp = "1=07-110字节")
     @Excel(name = "灌浆体积", readConverterExp = "1=07-110字节")
-    private Double sprayVolume;
+    @FixedLength(value = 4)
+    private Float sprayVolume;
 
 
     /** 实时钻头高程(111-114字节) */
     /** 实时钻头高程(111-114字节) */
     @Excel(name = "实时钻头高程", readConverterExp = "1=11-114字节")
     @Excel(name = "实时钻头高程", readConverterExp = "1=11-114字节")
-    private Double realDrillHeight;
+    @FixedLength(value = 4)
+    private Float realDrillHeight;
 
 
     /** 振动电流(115-118字节) */
     /** 振动电流(115-118字节) */
     @Excel(name = "振动电流", readConverterExp = "1=15-118字节")
     @Excel(name = "振动电流", readConverterExp = "1=15-118字节")
-    private Double vibrationCurrent;
+    @FixedLength(value = 4)
+    private Float vibrationCurrent;
 
 
     /** 水泵电流(119-122字节) */
     /** 水泵电流(119-122字节) */
     @Excel(name = "水泵电流", readConverterExp = "1=19-122字节")
     @Excel(name = "水泵电流", readConverterExp = "1=19-122字节")
-    private Double pumpCurrent;
+    @FixedLength(value = 4)
+    private Float pumpCurrent;
 
 
     /** 喷浆压力(123-126字节) */
     /** 喷浆压力(123-126字节) */
     @Excel(name = "喷浆压力", readConverterExp = "1=23-126字节")
     @Excel(name = "喷浆压力", readConverterExp = "1=23-126字节")
-    private Double sprayPressure;
+    @FixedLength(value = 4)
+    private Float sprayPressure;
 
 
     /** 喷浆速度(127-130字节) */
     /** 喷浆速度(127-130字节) */
     @Excel(name = "喷浆速度", readConverterExp = "1=27-130字节")
     @Excel(name = "喷浆速度", readConverterExp = "1=27-130字节")
-    private Double spraySpeed;
+    @FixedLength(value = 4)
+    private Float spraySpeed;
 
 
     /** 设计桩长(131-134字节) */
     /** 设计桩长(131-134字节) */
     @Excel(name = "设计桩长", readConverterExp = "1=31-134字节")
     @Excel(name = "设计桩长", readConverterExp = "1=31-134字节")
-    private Double designLength;
+    @FixedLength(value = 4)
+    private Float designLength;
 
 
     /** 当前钻杆节数(135-138字节) */
     /** 当前钻杆节数(135-138字节) */
     @Excel(name = "当前钻杆节数", readConverterExp = "1=35-138字节")
     @Excel(name = "当前钻杆节数", readConverterExp = "1=35-138字节")
+    @FixedLength(value = 4)
     private Integer currentDrillNumber;
     private Integer currentDrillNumber;
 
 
     /** 每节开始时间(139-146字节,大端序) */
     /** 每节开始时间(139-146字节,大端序) */
     @Excel(name = "每节开始时间", readConverterExp = "1=39-146字节,大端序")
     @Excel(name = "每节开始时间", readConverterExp = "1=39-146字节,大端序")
+    @FixedLength(value = 8)
     private Long startTime;
     private Long startTime;
 
 
     /** 每节结束时间(147-154字节,大端序) */
     /** 每节结束时间(147-154字节,大端序) */
     @Excel(name = "每节结束时间", readConverterExp = "1=47-154字节,大端序")
     @Excel(name = "每节结束时间", readConverterExp = "1=47-154字节,大端序")
+    @FixedLength(value = 8)
     private Long endTime;
     private Long endTime;
 
 
     /** 当前机械类型(155-158字节) */
     /** 当前机械类型(155-158字节) */
     @Excel(name = "当前机械类型", readConverterExp = "1=55-158字节")
     @Excel(name = "当前机械类型", readConverterExp = "1=55-158字节")
+    @FixedLength(value = 4)
     private Integer currentMechanicalType;
     private Integer currentMechanicalType;
 
 
     /** 当前层(159-163字节) */
     /** 当前层(159-163字节) */
@@ -153,6 +190,7 @@ public class MachineProcess extends BaseEntity {
 
 
     /** UUID(172+字节) */
     /** UUID(172+字节) */
     @Excel(name = "UUID", readConverterExp = "1=72+字节")
     @Excel(name = "UUID", readConverterExp = "1=72+字节")
+    @FixedLength(value = -1)
     private String uuid;
     private String uuid;
 
 
     /** 时间分区,yyyyMMdd */
     /** 时间分区,yyyyMMdd */
@@ -164,310 +202,6 @@ public class MachineProcess extends BaseEntity {
 
 
     private String recordTime;
     private String recordTime;
 
 
-    public void setConsType(Integer consType) {
-        this.consType = consType;
-    }
-
-    public Integer getConsType() {
-        return consType;
-    }
-
-    public void setDataVersion(Integer dataVersion) {
-        this.dataVersion = dataVersion;
-    }
-
-    public Integer getDataVersion() {
-        return dataVersion;
-    }
-
-    public void setDataTime(Long dataTime) {
-        this.dataTime = dataTime;
-    }
-
-    public Long getDataTime() {
-        return dataTime;
-    }
-
-    public void setPileId(String pileId) {
-        this.pileId = pileId;
-    }
-
-    public String getPileId() {
-        return pileId;
-    }
-
-    public void setDesignId(String designId) {
-        this.designId = designId;
-    }
-
-    public String getDesignId() {
-        return designId;
-    }
-
-    public void setMachineId(String machineId) {
-        this.machineId = machineId;
-    }
-
-    public String getMachineId() {
-        return machineId;
-    }
-
-    public void setRealX(Double realX) {
-        this.realX = realX;
-    }
-
-    public Double getRealX() {
-        return realX;
-    }
-
-    public void setRealY(Double realY) {
-        this.realY = realY;
-    }
-
-    public Double getRealY() {
-        return realY;
-    }
-
-    public void setRealZ(Double realZ) {
-        this.realZ = realZ;
-    }
-
-    public Double getRealZ() {
-        return realZ;
-    }
-
-    public void setLatitude(Double latitude) {
-        this.latitude = latitude;
-    }
-
-    public Double getLatitude() {
-        return latitude;
-    }
-
-    public void setLongitude(Double longitude) {
-        this.longitude = longitude;
-    }
-
-    public Double getLongitude() {
-        return longitude;
-    }
-
-    public void setPileLength(Double pileLength) {
-        this.pileLength = pileLength;
-    }
-
-    public Double getPileLength() {
-        return pileLength;
-    }
-
-    public void setRealPileLength(Double realPileLength) {
-        this.realPileLength = realPileLength;
-    }
-
-    public Double getRealPileLength() {
-        return realPileLength;
-    }
-
-    public void setSpeed(Double speed) {
-        this.speed = speed;
-    }
-
-    public Double getSpeed() {
-        return speed;
-    }
-
-    public void setCurrent(Double current) {
-        this.current = current;
-    }
-
-    public Double getCurrent() {
-        return current;
-    }
-
-    public void setTiltAngle(Double tiltAngle) {
-        this.tiltAngle = tiltAngle;
-    }
-
-    public Double getTiltAngle() {
-        return tiltAngle;
-    }
-
-    public void setForwardTiltAngle(Double forwardTiltAngle) {
-        this.forwardTiltAngle = forwardTiltAngle;
-    }
-
-    public Double getForwardTiltAngle() {
-        return forwardTiltAngle;
-    }
-
-    public void setVerticalAngle(Double verticalAngle) {
-        this.verticalAngle = verticalAngle;
-    }
-
-    public Double getVerticalAngle() {
-        return verticalAngle;
-    }
-
-    public void setSelfNum(Integer selfNum) {
-        this.selfNum = selfNum;
-    }
-
-    public Integer getSelfNum() {
-        return selfNum;
-    }
-
-    public void setHoldCurrent(Double holdCurrent) {
-        this.holdCurrent = holdCurrent;
-    }
-
-    public Double getHoldCurrent() {
-        return holdCurrent;
-    }
-
-    public void setSprayVolume(Double sprayVolume) {
-        this.sprayVolume = sprayVolume;
-    }
-
-    public Double getSprayVolume() {
-        return sprayVolume;
-    }
-
-    public void setRealDrillHeight(Double realDrillHeight) {
-        this.realDrillHeight = realDrillHeight;
-    }
-
-    public Double getRealDrillHeight() {
-        return realDrillHeight;
-    }
-
-    public void setVibrationCurrent(Double vibrationCurrent) {
-        this.vibrationCurrent = vibrationCurrent;
-    }
-
-    public Double getVibrationCurrent() {
-        return vibrationCurrent;
-    }
-
-    public void setPumpCurrent(Double pumpCurrent) {
-        this.pumpCurrent = pumpCurrent;
-    }
-
-    public Double getPumpCurrent() {
-        return pumpCurrent;
-    }
-
-    public void setSprayPressure(Double sprayPressure) {
-        this.sprayPressure = sprayPressure;
-    }
-
-    public Double getSprayPressure() {
-        return sprayPressure;
-    }
-
-    public void setSpraySpeed(Double spraySpeed) {
-        this.spraySpeed = spraySpeed;
-    }
-
-    public Double getSpraySpeed() {
-        return spraySpeed;
-    }
-
-    public void setDesignLength(Double designLength) {
-        this.designLength = designLength;
-    }
-
-    public Double getDesignLength() {
-        return designLength;
-    }
-
-    public void setCurrentDrillNumber(Integer currentDrillNumber) {
-        this.currentDrillNumber = currentDrillNumber;
-    }
-
-    public Integer getCurrentDrillNumber() {
-        return currentDrillNumber;
-    }
-
-    public void setStartTime(Long startTime) {
-        this.startTime = startTime;
-    }
-
-    public Long getStartTime() {
-        return startTime;
-    }
-
-    public void setEndTime(Long endTime) {
-        this.endTime = endTime;
-    }
-
-    public Long getEndTime() {
-        return endTime;
-    }
-
-    public void setCurrentMechanicalType(Integer currentMechanicalType) {
-        this.currentMechanicalType = currentMechanicalType;
-    }
-
-    public Integer getCurrentMechanicalType() {
-        return currentMechanicalType;
-    }
-
-    public void setCurrentLayer(Integer currentLayer) {
-        this.currentLayer = currentLayer;
-    }
-
-    public Integer getCurrentLayer() {
-        return currentLayer;
-    }
-
-    public void setCurrentLayerSendTime(Double currentLayerSendTime) {
-        this.currentLayerSendTime = currentLayerSendTime;
-    }
-
-    public Double getCurrentLayerSendTime() {
-        return currentLayerSendTime;
-    }
-
-    public void setCurrentLayerHammerNumber(Integer currentLayerHammerNumber) {
-        this.currentLayerHammerNumber = currentLayerHammerNumber;
-    }
-
-    public Integer getCurrentLayerHammerNumber() {
-        return currentLayerHammerNumber;
-    }
-
-    public void setUuid(String uuid) {
-        this.uuid = uuid;
-    }
-
-    public String getUuid() {
-        return uuid;
-    }
-
-    public void setDt(String dt) {
-        this.dt = dt;
-    }
-
-    public String getDt() {
-        return dt;
-    }
-
-    public void setId(Long id) {
-        this.id = id;
-    }
-
-    public Long getId() {
-        return id;
-    }
-
-    public String getRecordTime() {
-        return recordTime;
-    }
-
-    public void setRecordTime(String recordTime) {
-        this.recordTime = recordTime;
-    }
-
     @Override
     @Override
     public String toString() {
     public String toString() {
         return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("consType", getConsType())
         return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("consType", getConsType())

+ 58 - 359
bd-park/park-backend/park-domain/src/main/java/com/huashe/park/domain/entity/MachineProcessResult.java

@@ -5,6 +5,10 @@ import org.apache.commons.lang3.builder.ToStringStyle;
 
 
 import com.huashe.common.annotation.Excel;
 import com.huashe.common.annotation.Excel;
 import com.huashe.common.domain.BaseEntity;
 import com.huashe.common.domain.BaseEntity;
+import com.huashe.park.common.animations.FixedLength;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
 
 
 /**
 /**
  * 桩机施工结果数据(2025-02-26版协议)对象 cons_machine_process_result
  * 桩机施工结果数据(2025-02-26版协议)对象 cons_machine_process_result
@@ -12,6 +16,8 @@ import com.huashe.common.domain.BaseEntity;
  * @author ruoyi
  * @author ruoyi
  * @date 2025-02-26
  * @date 2025-02-26
  */
  */
+@EqualsAndHashCode(callSuper = true)
+@Data
 public class MachineProcessResult extends BaseEntity {
 public class MachineProcessResult extends BaseEntity {
     private static final long serialVersionUID = 1L;
     private static final long serialVersionUID = 1L;
 
 
@@ -20,130 +26,162 @@ public class MachineProcessResult extends BaseEntity {
 
 
     /** 施工类型编码(0-1字节) */
     /** 施工类型编码(0-1字节) */
     @Excel(name = "施工类型编码", readConverterExp = "0=-1字节")
     @Excel(name = "施工类型编码", readConverterExp = "0=-1字节")
-    private Integer consType;
+    @FixedLength(value = 2)
+    private Short consType;
 
 
     /** 数据协议版本(2-2字节) */
     /** 数据协议版本(2-2字节) */
     @Excel(name = "数据协议版本", readConverterExp = "2=-2字节")
     @Excel(name = "数据协议版本", readConverterExp = "2=-2字节")
-    private Integer dataVersion;
+    @FixedLength(value = 1)
+    private Byte dataVersion;
 
 
     /** 数据采集时间戳(3-10字节) */
     /** 数据采集时间戳(3-10字节) */
     @Excel(name = "数据采集时间戳", readConverterExp = "3=-10字节")
     @Excel(name = "数据采集时间戳", readConverterExp = "3=-10字节")
+    @FixedLength(value = 8)
     private Long dataTime;
     private Long dataTime;
 
 
     /** 桩体编号(11-18字节) */
     /** 桩体编号(11-18字节) */
     @Excel(name = "桩体编号", readConverterExp = "1=1-18字节")
     @Excel(name = "桩体编号", readConverterExp = "1=1-18字节")
+    @FixedLength(value = 8)
     private String pileId;
     private String pileId;
 
 
     /** 设计图纸编号(19-26字节) */
     /** 设计图纸编号(19-26字节) */
     @Excel(name = "设计图纸编号", readConverterExp = "1=9-26字节")
     @Excel(name = "设计图纸编号", readConverterExp = "1=9-26字节")
+    @FixedLength(value = 8)
     private String designId;
     private String designId;
 
 
     /** 施工机械编号(27-34字节) */
     /** 施工机械编号(27-34字节) */
     @Excel(name = "施工机械编号", readConverterExp = "2=7-34字节")
     @Excel(name = "施工机械编号", readConverterExp = "2=7-34字节")
+    @FixedLength(value = 8)
     private String machineId;
     private String machineId;
 
 
     /** 设计X坐标(米) */
     /** 设计X坐标(米) */
     @Excel(name = "设计X坐标", readConverterExp = "米=")
     @Excel(name = "设计X坐标", readConverterExp = "米=")
+    @FixedLength(value = 8)
     private Double designX;
     private Double designX;
 
 
     /** 设计Y坐标(米) */
     /** 设计Y坐标(米) */
     @Excel(name = "设计Y坐标", readConverterExp = "米=")
     @Excel(name = "设计Y坐标", readConverterExp = "米=")
+    @FixedLength(value = 8)
     private Double designY;
     private Double designY;
 
 
     /** 实际X坐标(米) */
     /** 实际X坐标(米) */
     @Excel(name = "实际X坐标", readConverterExp = "米=")
     @Excel(name = "实际X坐标", readConverterExp = "米=")
+    @FixedLength(value = 8)
     private Double realX;
     private Double realX;
 
 
     /** 实际Y坐标(米) */
     /** 实际Y坐标(米) */
     @Excel(name = "实际Y坐标", readConverterExp = "米=")
     @Excel(name = "实际Y坐标", readConverterExp = "米=")
+    @FixedLength(value = 8)
     private Double realY;
     private Double realY;
 
 
     /** 纬度 */
     /** 纬度 */
     @Excel(name = "纬度")
     @Excel(name = "纬度")
+    @FixedLength(value = 8)
     private Double latitude;
     private Double latitude;
 
 
     /** 经度 */
     /** 经度 */
     @Excel(name = "经度")
     @Excel(name = "经度")
+    @FixedLength(value = 8)
     private Double longitude;
     private Double longitude;
 
 
     /** 成桩长度(米) */
     /** 成桩长度(米) */
     @Excel(name = "成桩长度", readConverterExp = "米=")
     @Excel(name = "成桩长度", readConverterExp = "米=")
-    private Double pileLength;
+    @FixedLength(value = 4)
+    private Float pileLength;
 
 
     /** 平均钻速(mm/min) */
     /** 平均钻速(mm/min) */
     @Excel(name = "平均钻速", readConverterExp = "m=m/min")
     @Excel(name = "平均钻速", readConverterExp = "m=m/min")
-    private Double avgSpeed;
+    @FixedLength(value = 4)
+    private Float avgSpeed;
 
 
     /** 平均电流(A) */
     /** 平均电流(A) */
     @Excel(name = "平均电流", readConverterExp = "A=")
     @Excel(name = "平均电流", readConverterExp = "A=")
-    private Double avgCurrent;
+    @FixedLength(value = 4)
+    private Float avgCurrent;
 
 
     /** 持力层电流阈值(A) */
     /** 持力层电流阈值(A) */
     @Excel(name = "持力层电流阈值", readConverterExp = "A=")
     @Excel(name = "持力层电流阈值", readConverterExp = "A=")
-    private Double holdCurrent;
+    @FixedLength(value = 4)
+    private Float holdCurrent;
 
 
     /** 垂直度偏差(%) */
     /** 垂直度偏差(%) */
     @Excel(name = "垂直度偏差", readConverterExp = "%=")
     @Excel(name = "垂直度偏差", readConverterExp = "%=")
-    private Double verticalDeviation;
+    @FixedLength(value = 4)
+    private Float verticalDeviation;
 
 
     /** 灌浆体积(m³) */
     /** 灌浆体积(m³) */
     @Excel(name = "灌浆体积", readConverterExp = "m=³")
     @Excel(name = "灌浆体积", readConverterExp = "m=³")
-    private Double sprayVolume;
+    @FixedLength(value = 4)
+    private Float sprayVolume;
 
 
     /** 施工开始时间 */
     /** 施工开始时间 */
     @Excel(name = "施工开始时间")
     @Excel(name = "施工开始时间")
+    @FixedLength(value = 8)
     private Long startTime;
     private Long startTime;
 
 
     /** 施工结束时间 */
     /** 施工结束时间 */
     @Excel(name = "施工结束时间")
     @Excel(name = "施工结束时间")
+    @FixedLength(value = 8)
     private Long endTime;
     private Long endTime;
 
 
     /** 结果评价(0:合格 1:异常) */
     /** 结果评价(0:合格 1:异常) */
     @Excel(name = "结果评价", readConverterExp = "0=:合格,1=:异常")
     @Excel(name = "结果评价", readConverterExp = "0=:合格,1=:异常")
+    @FixedLength(value = 4)
     private Integer resultEvaluation;
     private Integer resultEvaluation;
 
 
     /** 起桩高度(米) */
     /** 起桩高度(米) */
     @Excel(name = "起桩高度", readConverterExp = "米=")
     @Excel(name = "起桩高度", readConverterExp = "米=")
+    @FixedLength(value = 8)
     private Double startHeight;
     private Double startHeight;
 
 
     /** 入岩深度(米) */
     /** 入岩深度(米) */
     @Excel(name = "入岩深度", readConverterExp = "米=")
     @Excel(name = "入岩深度", readConverterExp = "米=")
-    private Double inDepth;
+    @FixedLength(value = 4)
+    private Float inDepth;
 
 
     /** 有效下行深度(米) */
     /** 有效下行深度(米) */
     @Excel(name = "有效下行深度", readConverterExp = "米=")
     @Excel(name = "有效下行深度", readConverterExp = "米=")
-    private Double effectiveDown;
+    @FixedLength(value = 4)
+    private Float effectiveDown;
 
 
     /** 有效桩长(米) */
     /** 有效桩长(米) */
     @Excel(name = "有效桩长", readConverterExp = "米=")
     @Excel(name = "有效桩长", readConverterExp = "米=")
-    private Double effectiveLength;
+    @FixedLength(value = 4)
+    private Float effectiveLength;
 
 
     /** 桩点编号 */
     /** 桩点编号 */
     @Excel(name = "桩点编号")
     @Excel(name = "桩点编号")
+    @FixedLength(value = 4)
     private Integer pileNumber;
     private Integer pileNumber;
 
 
     /** 平均喷浆压力(MPa) */
     /** 平均喷浆压力(MPa) */
     @Excel(name = "平均喷浆压力", readConverterExp = "M=Pa")
     @Excel(name = "平均喷浆压力", readConverterExp = "M=Pa")
-    private Double avgSprayPressure;
+    @FixedLength(value = 4)
+    private Float avgSprayPressure;
 
 
     /** 平均喷浆速度(L/min) */
     /** 平均喷浆速度(L/min) */
     @Excel(name = "平均喷浆速度", readConverterExp = "L=/min")
     @Excel(name = "平均喷浆速度", readConverterExp = "L=/min")
-    private Double avgSpraySpeed;
+    @FixedLength(value = 4)
+    private Float avgSpraySpeed;
 
 
     /** 设计桩长(米) */
     /** 设计桩长(米) */
     @Excel(name = "设计桩长", readConverterExp = "米=")
     @Excel(name = "设计桩长", readConverterExp = "米=")
-    private Double designLength;
+    @FixedLength(value = 4)
+    private Float designLength;
 
 
     /** 平均上行速度(mm/min) */
     /** 平均上行速度(mm/min) */
     @Excel(name = "平均上行速度", readConverterExp = "m=m/min")
     @Excel(name = "平均上行速度", readConverterExp = "m=m/min")
-    private Double avgUpSpeed;
+    @FixedLength(value = 4)
+    private Float avgUpSpeed;
 
 
     /** 钻杆总节数 */
     /** 钻杆总节数 */
     @Excel(name = "钻杆总节数")
     @Excel(name = "钻杆总节数")
+    @FixedLength(value = 4)
     private Integer drillTotalNumber;
     private Integer drillTotalNumber;
 
 
     /** 机械类型(1:旋挖 2:冲击) */
     /** 机械类型(1:旋挖 2:冲击) */
     @Excel(name = "机械类型", readConverterExp = "1=:旋挖,2=:冲击")
     @Excel(name = "机械类型", readConverterExp = "1=:旋挖,2=:冲击")
+    @FixedLength(value = 4)
     private Integer currentMechanicalType;
     private Integer currentMechanicalType;
 
 
     /** 送土次数 */
     /** 送土次数 */
@@ -158,14 +196,19 @@ public class MachineProcessResult extends BaseEntity {
     @Excel(name = "总夯击次数")
     @Excel(name = "总夯击次数")
     private Integer totalHammerNumber;
     private Integer totalHammerNumber;
 
 
+    @FixedLength(value = 8)
     private Long sendStartTime;
     private Long sendStartTime;
 
 
+    @FixedLength(value = 8)
     private Long sendEndTime;
     private Long sendEndTime;
 
 
+    @FixedLength(value = 8)
     private Long pullingStartTime;
     private Long pullingStartTime;
 
 
+    @FixedLength(value = 8)
     private Long pullingEndTime;
     private Long pullingEndTime;
 
 
+    @FixedLength(value = -1)
     /** 设备唯一标识(UUID) */
     /** 设备唯一标识(UUID) */
     @Excel(name = "设备唯一标识", readConverterExp = "U=UID")
     @Excel(name = "设备唯一标识", readConverterExp = "U=UID")
     private String uuid;
     private String uuid;
@@ -174,350 +217,6 @@ public class MachineProcessResult extends BaseEntity {
 
 
     private String recordTime;
     private String recordTime;
 
 
-    public void setId(Long id) {
-        this.id = id;
-    }
-
-    public Long getId() {
-        return id;
-    }
-
-    public void setConsType(Integer consType) {
-        this.consType = consType;
-    }
-
-    public Integer getConsType() {
-        return consType;
-    }
-
-    public void setDataVersion(Integer dataVersion) {
-        this.dataVersion = dataVersion;
-    }
-
-    public Integer getDataVersion() {
-        return dataVersion;
-    }
-
-    public void setDataTime(Long dataTime) {
-        this.dataTime = dataTime;
-    }
-
-    public Long getDataTime() {
-        return dataTime;
-    }
-
-    public void setPileId(String pileId) {
-        this.pileId = pileId;
-    }
-
-    public String getPileId() {
-        return pileId;
-    }
-
-    public void setDesignId(String designId) {
-        this.designId = designId;
-    }
-
-    public String getDesignId() {
-        return designId;
-    }
-
-    public void setMachineId(String machineId) {
-        this.machineId = machineId;
-    }
-
-    public String getMachineId() {
-        return machineId;
-    }
-
-    public void setDesignX(Double designX) {
-        this.designX = designX;
-    }
-
-    public Double getDesignX() {
-        return designX;
-    }
-
-    public void setDesignY(Double designY) {
-        this.designY = designY;
-    }
-
-    public Double getDesignY() {
-        return designY;
-    }
-
-    public void setRealX(Double realX) {
-        this.realX = realX;
-    }
-
-    public Double getRealX() {
-        return realX;
-    }
-
-    public void setRealY(Double realY) {
-        this.realY = realY;
-    }
-
-    public Double getRealY() {
-        return realY;
-    }
-
-    public void setLatitude(Double latitude) {
-        this.latitude = latitude;
-    }
-
-    public Double getLatitude() {
-        return latitude;
-    }
-
-    public void setLongitude(Double longitude) {
-        this.longitude = longitude;
-    }
-
-    public Double getLongitude() {
-        return longitude;
-    }
-
-    public void setPileLength(Double pileLength) {
-        this.pileLength = pileLength;
-    }
-
-    public Double getPileLength() {
-        return pileLength;
-    }
-
-    public void setAvgSpeed(Double avgSpeed) {
-        this.avgSpeed = avgSpeed;
-    }
-
-    public Double getAvgSpeed() {
-        return avgSpeed;
-    }
-
-    public void setAvgCurrent(Double avgCurrent) {
-        this.avgCurrent = avgCurrent;
-    }
-
-    public Double getAvgCurrent() {
-        return avgCurrent;
-    }
-
-    public void setHoldCurrent(Double holdCurrent) {
-        this.holdCurrent = holdCurrent;
-    }
-
-    public Double getHoldCurrent() {
-        return holdCurrent;
-    }
-
-    public void setVerticalDeviation(Double verticalDeviation) {
-        this.verticalDeviation = verticalDeviation;
-    }
-
-    public Double getVerticalDeviation() {
-        return verticalDeviation;
-    }
-
-    public void setSprayVolume(Double sprayVolume) {
-        this.sprayVolume = sprayVolume;
-    }
-
-    public Double getSprayVolume() {
-        return sprayVolume;
-    }
-
-    public void setStartTime(Long startTime) {
-        this.startTime = startTime;
-    }
-
-    public Long getStartTime() {
-        return startTime;
-    }
-
-    public void setEndTime(Long endTime) {
-        this.endTime = endTime;
-    }
-
-    public Long getEndTime() {
-        return endTime;
-    }
-
-    public void setResultEvaluation(Integer resultEvaluation) {
-        this.resultEvaluation = resultEvaluation;
-    }
-
-    public Integer getResultEvaluation() {
-        return resultEvaluation;
-    }
-
-    public void setStartHeight(Double startHeight) {
-        this.startHeight = startHeight;
-    }
-
-    public Double getStartHeight() {
-        return startHeight;
-    }
-
-    public void setInDepth(Double inDepth) {
-        this.inDepth = inDepth;
-    }
-
-    public Double getInDepth() {
-        return inDepth;
-    }
-
-    public void setEffectiveDown(Double effectiveDown) {
-        this.effectiveDown = effectiveDown;
-    }
-
-    public Double getEffectiveDown() {
-        return effectiveDown;
-    }
-
-    public void setEffectiveLength(Double effectiveLength) {
-        this.effectiveLength = effectiveLength;
-    }
-
-    public Double getEffectiveLength() {
-        return effectiveLength;
-    }
-
-    public void setPileNumber(Integer pileNumber) {
-        this.pileNumber = pileNumber;
-    }
-
-    public Integer getPileNumber() {
-        return pileNumber;
-    }
-
-    public void setAvgSprayPressure(Double avgSprayPressure) {
-        this.avgSprayPressure = avgSprayPressure;
-    }
-
-    public Double getAvgSprayPressure() {
-        return avgSprayPressure;
-    }
-
-    public void setAvgSpraySpeed(Double avgSpraySpeed) {
-        this.avgSpraySpeed = avgSpraySpeed;
-    }
-
-    public Double getAvgSpraySpeed() {
-        return avgSpraySpeed;
-    }
-
-    public void setDesignLength(Double designLength) {
-        this.designLength = designLength;
-    }
-
-    public Double getDesignLength() {
-        return designLength;
-    }
-
-    public void setAvgUpSpeed(Double avgUpSpeed) {
-        this.avgUpSpeed = avgUpSpeed;
-    }
-
-    public Double getAvgUpSpeed() {
-        return avgUpSpeed;
-    }
-
-    public void setDrillTotalNumber(Integer drillTotalNumber) {
-        this.drillTotalNumber = drillTotalNumber;
-    }
-
-    public Integer getDrillTotalNumber() {
-        return drillTotalNumber;
-    }
-
-    public void setCurrentMechanicalType(Integer currentMechanicalType) {
-        this.currentMechanicalType = currentMechanicalType;
-    }
-
-    public Integer getCurrentMechanicalType() {
-        return currentMechanicalType;
-    }
-
-    public void setSendTotalNumber(Integer sendTotalNumber) {
-        this.sendTotalNumber = sendTotalNumber;
-    }
-
-    public Integer getSendTotalNumber() {
-        return sendTotalNumber;
-    }
-
-    public void setSendTotalTime(Double sendTotalTime) {
-        this.sendTotalTime = sendTotalTime;
-    }
-
-    public Double getSendTotalTime() {
-        return sendTotalTime;
-    }
-
-    public void setTotalHammerNumber(Integer totalHammerNumber) {
-        this.totalHammerNumber = totalHammerNumber;
-    }
-
-    public Integer getTotalHammerNumber() {
-        return totalHammerNumber;
-    }
-
-    public void setUuid(String uuid) {
-        this.uuid = uuid;
-    }
-
-    public String getUuid() {
-        return uuid;
-    }
-
-    public String getDt() {
-        return dt;
-    }
-
-    public void setDt(String dt) {
-        this.dt = dt;
-    }
-
-    public String getRecordTime() {
-        return recordTime;
-    }
-
-    public void setRecordTime(String recordTime) {
-        this.recordTime = recordTime;
-    }
-
-    public Long getSendStartTime() {
-        return sendStartTime;
-    }
-
-    public void setSendStartTime(Long sendStartTime) {
-        this.sendStartTime = sendStartTime;
-    }
-
-    public Long getSendEndTime() {
-        return sendEndTime;
-    }
-
-    public void setSendEndTime(Long sendEndTime) {
-        this.sendEndTime = sendEndTime;
-    }
-
-    public Long getPullingStartTime() {
-        return pullingStartTime;
-    }
-
-    public void setPullingStartTime(Long pullingStartTime) {
-        this.pullingStartTime = pullingStartTime;
-    }
-
-    public Long getPullingEndTime() {
-        return pullingEndTime;
-    }
-
-    public void setPullingEndTime(Long pullingEndTime) {
-        this.pullingEndTime = pullingEndTime;
-    }
-
     @Override
     @Override
     public String toString() {
     public String toString() {
         return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("id", getId())
         return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("id", getId())

+ 8 - 27
bd-park/park-backend/park-domain/src/main/java/com/huashe/park/domain/entity/ParkAttendGroup.java

@@ -1,10 +1,11 @@
 package com.huashe.park.domain.entity;
 package com.huashe.park.domain.entity;
 
 
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
 import com.alibaba.fastjson2.JSONArray;
 import com.alibaba.fastjson2.JSONArray;
 import com.huashe.common.annotation.Excel;
 import com.huashe.common.annotation.Excel;
 import com.huashe.common.domain.BaseEntity;
 import com.huashe.common.domain.BaseEntity;
-import org.apache.commons.lang3.builder.ToStringBuilder;
-import org.apache.commons.lang3.builder.ToStringStyle;
 
 
 /**
 /**
  * 考勤组对象 park_attend_group
  * 考勤组对象 park_attend_group
@@ -38,11 +39,6 @@ public class ParkAttendGroup extends BaseEntity {
     @Excel(name = "考勤时间")
     @Excel(name = "考勤时间")
     private JSONArray timeRange;
     private JSONArray timeRange;
 
 
-    /**
-     * 租户id
-     */
-    private String tenantId;
-
     public void setId(Long id) {
     public void setId(Long id) {
         this.id = id;
         this.id = id;
     }
     }
@@ -75,27 +71,12 @@ public class ParkAttendGroup extends BaseEntity {
         this.timeRange = timeRange;
         this.timeRange = timeRange;
     }
     }
 
 
-    public void setTenantId(String tenantId) {
-        this.tenantId = tenantId;
-    }
-
-    public String getTenantId() {
-        return tenantId;
-    }
-
     @Override
     @Override
     public String toString() {
     public String toString() {
-        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
-                .append("id", getId())
-                .append("name", getName())
-                .append("remark", getRemark())
-                .append("poly", getPoly())
-                .append("timeRange", getTimeRange())
-                .append("updateTime", getUpdateTime())
-                .append("createTime", getCreateTime())
-                .append("createBy", getCreateBy())
-                .append("updateBy", getUpdateBy())
-                .append("tenantId", getTenantId())
-                .toString();
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("id", getId()).append("name", getName())
+            .append("remark", getRemark()).append("poly", getPoly()).append("timeRange", getTimeRange())
+            .append("updateTime", getUpdateTime()).append("createTime", getCreateTime())
+            .append("createBy", getCreateBy()).append("updateBy", getUpdateBy()).append("tenantId", getTenantId())
+            .toString();
     }
     }
 }
 }

+ 0 - 12
bd-park/park-backend/park-domain/src/main/java/com/huashe/park/domain/entity/ParkAttendGroupUsr.java

@@ -48,10 +48,6 @@ public class ParkAttendGroupUsr extends BaseEntity {
     @Excel(name = "部门名称")
     @Excel(name = "部门名称")
     private String usrDept;
     private String usrDept;
 
 
-    /**
-     * 租户id
-     */
-    private String tenantId;
 
 
     public String getGroupName() {
     public String getGroupName() {
         return groupName;
         return groupName;
@@ -109,14 +105,6 @@ public class ParkAttendGroupUsr extends BaseEntity {
         return usrDept;
         return usrDept;
     }
     }
 
 
-    public void setTenantId(String tenantId) {
-        this.tenantId = tenantId;
-    }
-
-    public String getTenantId() {
-        return tenantId;
-    }
-
     @Override
     @Override
     public String toString() {
     public String toString() {
         return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
         return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

+ 0 - 13
bd-park/park-backend/park-domain/src/main/java/com/huashe/park/domain/entity/ParkAttendUsrDetail.java

@@ -61,11 +61,6 @@ public class ParkAttendUsrDetail extends BaseEntity {
     @Excel(name = "考勤组主键")
     @Excel(name = "考勤组主键")
     private Long attendGroupId;
     private Long attendGroupId;
 
 
-    /**
-     * 租户id
-     */
-    @Excel(name = "租户id")
-    private String tenantId;
 
 
     public void setId(Long id) {
     public void setId(Long id) {
         this.id = id;
         this.id = id;
@@ -139,14 +134,6 @@ public class ParkAttendUsrDetail extends BaseEntity {
         return attendGroupId;
         return attendGroupId;
     }
     }
 
 
-    public void setTenantId(String tenantId) {
-        this.tenantId = tenantId;
-    }
-
-    public String getTenantId() {
-        return tenantId;
-    }
-
     @Override
     @Override
     public String toString() {
     public String toString() {
         return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
         return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

+ 1 - 11
bd-park/park-backend/park-domain/src/main/java/com/huashe/park/domain/entity/ParkInspectProj.java

@@ -50,10 +50,7 @@ public class ParkInspectProj extends BaseEntity {
     @Excel(name = "巡检项目类型")
     @Excel(name = "巡检项目类型")
     private String projType;
     private String projType;
 
 
-    /**
-     * 租户id
-     */
-    private String tenantId;
+
 
 
     public void setId(Long id) {
     public void setId(Long id) {
         this.id = id;
         this.id = id;
@@ -103,13 +100,6 @@ public class ParkInspectProj extends BaseEntity {
         this.projContent = projContent;
         this.projContent = projContent;
     }
     }
 
 
-    public void setTenantId(String tenantId) {
-        this.tenantId = tenantId;
-    }
-
-    public String getTenantId() {
-        return tenantId;
-    }
 
 
     @Override
     @Override
     public String toString() {
     public String toString() {

+ 0 - 12
bd-park/park-backend/park-domain/src/main/java/com/huashe/park/domain/entity/ParkInspectTask.java

@@ -26,9 +26,6 @@ public class ParkInspectTask extends BaseEntity
     @Excel(name = "巡检计划")
     @Excel(name = "巡检计划")
     private String schedule;
     private String schedule;
 
 
-    /** 租户id */
-    private String tenantId;
-
     public void setId(Long id) 
     public void setId(Long id) 
     {
     {
         this.id = id;
         this.id = id;
@@ -56,15 +53,6 @@ public class ParkInspectTask extends BaseEntity
     {
     {
         return schedule;
         return schedule;
     }
     }
-    public void setTenantId(String tenantId) 
-    {
-        this.tenantId = tenantId;
-    }
-
-    public String getTenantId() 
-    {
-        return tenantId;
-    }
 
 
     @Override
     @Override
     public String toString() {
     public String toString() {

+ 0 - 10
bd-park/park-backend/park-domain/src/main/java/com/huashe/park/domain/entity/ParkInspectTaskUsrTrail.java

@@ -35,8 +35,6 @@ public class ParkInspectTaskUsrTrail extends BaseEntity
     @Excel(name = "巡检轨迹")
     @Excel(name = "巡检轨迹")
     private String trail;
     private String trail;
 
 
-    /** 租户id */
-    private String tenantId;
 
 
     public void setId(Long id) 
     public void setId(Long id) 
     {
     {
@@ -92,15 +90,7 @@ public class ParkInspectTaskUsrTrail extends BaseEntity
     {
     {
         return trail;
         return trail;
     }
     }
-    public void setTenantId(String tenantId) 
-    {
-        this.tenantId = tenantId;
-    }
 
 
-    public String getTenantId() 
-    {
-        return tenantId;
-    }
 
 
     @Override
     @Override
     public String toString() {
     public String toString() {

+ 16 - 8
bd-park/park-backend/park-domain/src/main/java/com/huashe/park/domain/entity/PileHoleIndexRealtime.java

@@ -5,6 +5,7 @@ import java.util.Date;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 import org.apache.commons.lang3.builder.ToStringStyle;
 
 
+import com.alibaba.fastjson2.JSONObject;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.huashe.common.annotation.Excel;
 import com.huashe.common.annotation.Excel;
 import com.huashe.common.domain.BaseEntity;
 import com.huashe.common.domain.BaseEntity;
@@ -48,29 +49,32 @@ public class PileHoleIndexRealtime extends BaseEntity {
     @Excel(name = "桩机编号")
     @Excel(name = "桩机编号")
     private String machineByteKey;
     private String machineByteKey;
 
 
-    private Double tiltAngle;
+    private Float tiltAngle;
 
 
-    private Double forwardTiltAngle;
+    private Float forwardTiltAngle;
 
 
     /** 桩机实际深度 */
     /** 桩机实际深度 */
     @Excel(name = "桩机实际深度")
     @Excel(name = "桩机实际深度")
-    private Double depth;
+    private Float depth;
 
 
     /** 电机电流 */
     /** 电机电流 */
     @Excel(name = "电机电流")
     @Excel(name = "电机电流")
-    private Double current;
+    private Float current;
 
 
     /** 垂直偏差 */
     /** 垂直偏差 */
     @Excel(name = "垂直偏差")
     @Excel(name = "垂直偏差")
-    private Double verticalDeviation;
+    private Float verticalDeviation;
 
 
     /** 灌浆体积(m³)ups200送带量 */
     /** 灌浆体积(m³)ups200送带量 */
-    @Excel(name = "灌浆体积", readConverterExp = "m=³")
-    private Double sprayVolume;
+    @Excel(name = "回带量", readConverterExp = "m=³")
+    private Float sprayVolume;
+
+    @Excel(name = "送带量", readConverterExp = "m=³")
+    private Float sendSprayVolume;
 
 
     /** 喷浆压力 ups200 压力值 */
     /** 喷浆压力 ups200 压力值 */
     @Excel(name = "喷浆压力 ups200 压力值")
     @Excel(name = "喷浆压力 ups200 压力值")
-    private Double sprayPressure;
+    private Float sprayPressure;
 
 
     /** 开始时间 */
     /** 开始时间 */
     @JsonFormat(pattern = "yyyy-MM-dd")
     @JsonFormat(pattern = "yyyy-MM-dd")
@@ -94,6 +98,10 @@ public class PileHoleIndexRealtime extends BaseEntity {
 
 
     private Double realLng;
     private Double realLng;
 
 
+    private Float endPress;
+
+    private JSONObject depthPress;
+
     @Override
     @Override
     public String toString() {
     public String toString() {
         return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("id", getId())
         return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("id", getId())

+ 4 - 0
bd-park/park-backend/park-infrastructure/pom.xml

@@ -53,6 +53,10 @@
             <groupId>cn.idev.excel</groupId>
             <groupId>cn.idev.excel</groupId>
             <artifactId>fastexcel</artifactId>
             <artifactId>fastexcel</artifactId>
         </dependency>
         </dependency>
+        <dependency>
+            <groupId>com.github.jsqlparser</groupId>
+            <artifactId>jsqlparser</artifactId>
+        </dependency>
     </dependencies>
     </dependencies>
 
 
 </project>
 </project>

+ 14 - 0
bd-park/park-backend/park-infrastructure/src/main/java/com/huashe/park/infrastructure/cfg/forest/CollectMqttForestCfg.java

@@ -0,0 +1,14 @@
+package com.huashe.park.infrastructure.cfg.forest;
+
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Configuration;
+
+import lombok.Data;
+
+@Configuration
+@ConfigurationProperties(prefix = "forest.custom.collect-mqtt")
+@Data
+public class CollectMqttForestCfg {
+
+    private String url;
+}

+ 3 - 3
bd-park/park-backend/park-infrastructure/src/main/java/com/huashe/park/infrastructure/cfg/forest/CustomForestCfg.java

@@ -26,7 +26,7 @@ public class CustomForestCfg {
     private UWBForestCfg uwbForestCfg;
     private UWBForestCfg uwbForestCfg;
 
 
     @Autowired
     @Autowired
-    private CADForestCfg cadForestCfg;
+    private CollectMqttForestCfg collectMqttForestCfg;
 
 
     @BindingVar("uwbBaseUrl")
     @BindingVar("uwbBaseUrl")
     public String getBaseUrl(ForestMethod method) {
     public String getBaseUrl(ForestMethod method) {
@@ -38,9 +38,9 @@ public class CustomForestCfg {
         return holiday;
         return holiday;
     }
     }
 
 
-    @BindingVar("cadBaseUrl")
+    @BindingVar("collectMqtt")
     public String getCadBaseUrl(ForestMethod method) {
     public String getCadBaseUrl(ForestMethod method) {
-        return cadForestCfg.getCadServer();
+        return collectMqttForestCfg.getUrl();
     }
     }
 
 
 }
 }

+ 68 - 0
bd-park/park-backend/park-infrastructure/src/main/java/com/huashe/park/infrastructure/cfg/mybatis/BaseInterceptor.java

@@ -0,0 +1,68 @@
+package com.huashe.park.infrastructure.cfg.mybatis;
+
+import com.huashe.common.annotation.mybatis.TenantField;
+import com.huashe.common.exception.ServiceException;
+import com.ruoyi.common.core.domain.entity.SysUser;
+import com.ruoyi.common.core.domain.model.LoginUser;
+import com.ruoyi.common.utils.SecurityUtils;
+import lombok.extern.slf4j.Slf4j;
+
+import java.lang.reflect.Field;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+@Slf4j
+public class BaseInterceptor {
+    public void setTenantField(Object parameter, Field field) {
+        TenantField annotation = field.getAnnotation(TenantField.class);
+        if (annotation != null) {
+            field.setAccessible(true);
+            try {
+                field.set(parameter, getLoginUser().getUser().getTenantId());
+            }
+            catch (Exception e) {
+                log.error("------MybatisInterceptor field.name------{},error:", field.getName(), e);
+            }
+            field.setAccessible(false);
+        }
+    }
+
+    public LoginUser getLoginUser() {
+        LoginUser userNow = new LoginUser();
+        userNow.setUser(new SysUser() {
+            {
+                setNickName(Thread.currentThread().getName());
+            }
+        });
+        try {
+            // try catch避免线程任务出错
+            userNow = SecurityUtils.getLoginUser() != null ? SecurityUtils.getLoginUser() : null;
+        }
+        catch (ServiceException e) {
+            log.debug("------MybatisInterceptor getLoginUser------");
+        }
+        return userNow;
+    }
+
+    /**
+     * 获取类的所有属性,包括父类
+     *
+     * @param object
+     * @return
+     */
+    public Field[] getAllFields(Object object) {
+        Class<?> clazz = object.getClass();
+        if (clazz == null) {
+            return null;
+        }
+        List<Field> fieldList = new ArrayList<>();
+        while (clazz != null) {
+            fieldList.addAll(new ArrayList<>(Arrays.asList(clazz.getDeclaredFields())));
+            clazz = clazz.getSuperclass();
+        }
+        Field[] fields = new Field[fieldList.size()];
+        fieldList.toArray(fields);
+        return fields;
+    }
+}

+ 50 - 0
bd-park/park-backend/park-infrastructure/src/main/java/com/huashe/park/infrastructure/cfg/mybatis/FieldConvertInterceptor.java

@@ -0,0 +1,50 @@
+package com.huashe.park.infrastructure.cfg.mybatis;
+
+import org.apache.ibatis.executor.Executor;
+import org.apache.ibatis.mapping.MappedStatement;
+import org.apache.ibatis.plugin.Interceptor;
+import org.apache.ibatis.plugin.Intercepts;
+import org.apache.ibatis.plugin.Invocation;
+import org.apache.ibatis.plugin.Signature;
+import org.apache.ibatis.session.ResultHandler;
+import org.apache.ibatis.session.RowBounds;
+
+@Intercepts(@Signature(
+        type = Executor.class,
+        method = "query",
+        args = {MappedStatement.class, Object.class, RowBounds.class, ResultHandler.class}
+))
+public class FieldConvertInterceptor implements Interceptor {
+    @Override
+    public Object intercept(Invocation invocation) throws Throwable {
+        // 执行原始查询逻辑
+        Object result = invocation.proceed();
+
+        // 处理结果集中的JSON字段
+//        if (result instanceof List) {
+//            ((List<?>) result).forEach(this::processJsonFields);
+//        } else if (result != null) {
+//            processJsonFields(result);
+//        }
+        return result;
+    }
+//
+//    private void processJsonFields(Object obj) {
+//        // 反射遍历所有标记@JsonField的字段
+//        Arrays.stream(obj.getClass().getDeclaredFields())
+//                .filter(f -> f.isAnnotationPresent(FieldConvert.class))
+//                .forEach(f -> {
+//                    try {
+//                        f.setAccessible(true);
+//                        String jsonValue = (String) f.get(obj);
+//                        if (jsonValue != null) {
+//                            JsonData data = new ObjectMapper().readValue(jsonValue, JsonData.class);
+//                            f.set(obj, data);
+//                        }
+//                    } catch (Exception e) {
+//                        throw new RuntimeException("JSON字段处理失败", e);
+//                    }
+//                });
+//    }
+
+}

+ 76 - 134
bd-park/park-backend/park-infrastructure/src/main/java/com/huashe/park/infrastructure/cfg/mybatis/MybatisInterceptor.java

@@ -1,13 +1,9 @@
 package com.huashe.park.infrastructure.cfg.mybatis;
 package com.huashe.park.infrastructure.cfg.mybatis;
 
 
-import java.lang.reflect.Field;
-import java.util.ArrayList;
-import java.util.Arrays;
+import java.util.Collection;
 import java.util.Date;
 import java.util.Date;
-import java.util.List;
 
 
 import org.apache.ibatis.binding.MapperMethod;
 import org.apache.ibatis.binding.MapperMethod;
-import org.apache.ibatis.binding.MapperMethod.ParamMap;
 import org.apache.ibatis.executor.Executor;
 import org.apache.ibatis.executor.Executor;
 import org.apache.ibatis.mapping.MappedStatement;
 import org.apache.ibatis.mapping.MappedStatement;
 import org.apache.ibatis.mapping.SqlCommandType;
 import org.apache.ibatis.mapping.SqlCommandType;
@@ -19,10 +15,10 @@ import org.apache.ibatis.plugin.Signature;
 import org.slf4j.Logger;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.slf4j.LoggerFactory;
 import org.springframework.stereotype.Component;
 import org.springframework.stereotype.Component;
+import org.springframework.util.ReflectionUtils;
 
 
-import com.ruoyi.common.core.domain.entity.SysUser;
+import com.huashe.common.annotation.mybatis.TenantField;
 import com.ruoyi.common.core.domain.model.LoginUser;
 import com.ruoyi.common.core.domain.model.LoginUser;
-import com.ruoyi.common.utils.SecurityUtils;
 
 
 @Component
 @Component
 @Intercepts({
 @Intercepts({
@@ -30,7 +26,7 @@ import com.ruoyi.common.utils.SecurityUtils;
         MappedStatement.class, Object.class
         MappedStatement.class, Object.class
     })
     })
 })
 })
-public class MybatisInterceptor implements Interceptor {
+public class MybatisInterceptor extends BaseInterceptor implements Interceptor {
     private static final Logger log = LoggerFactory.getLogger(MybatisInterceptor.class);
     private static final Logger log = LoggerFactory.getLogger(MybatisInterceptor.class);
 
 
     @Override
     @Override
@@ -39,113 +35,97 @@ public class MybatisInterceptor implements Interceptor {
         String sqlId = mappedStatement.getId();
         String sqlId = mappedStatement.getId();
         log.debug("------sqlId------" + sqlId);
         log.debug("------sqlId------" + sqlId);
         SqlCommandType sqlCommandType = mappedStatement.getSqlCommandType();
         SqlCommandType sqlCommandType = mappedStatement.getSqlCommandType();
-        Object parameter = invocation.getArgs()[1];
+        Object parameterObject = invocation.getArgs()[1];
         log.debug("------sqlCommandType------" + sqlCommandType);
         log.debug("------sqlCommandType------" + sqlCommandType);
 
 
-        if (parameter == null) {
+        if (parameterObject == null) {
             return invocation.proceed();
             return invocation.proceed();
         }
         }
-        if (SqlCommandType.INSERT == sqlCommandType) {
-            LoginUser sysUser = getLoginUser();
-            Field[] fields = getAllFields(parameter);
-            assert fields != null;
-            for (Field field : fields) {
-                try {
-                    if ("createBy".equals(field.getName())) {
-                        field.setAccessible(true);
-                        Object local_createBy = field.get(parameter);
-                        field.setAccessible(false);
-                        if (local_createBy == null || local_createBy.equals("")) {
-                            if (sysUser != null) {
-                                // 登录人账号
-                                field.setAccessible(true);
-                                field.set(parameter, sysUser.getUser().getNickName());
-                                field.setAccessible(false);
-                            }
-                        }
-                    }
-                    if ("createName".equals(field.getName())) {
-                        field.setAccessible(true);
-                        Object local_createBy = field.get(parameter);
-                        field.setAccessible(false);
-                        if (local_createBy == null || local_createBy.equals("")) {
-                            if (sysUser != null) {
-                                // 登录人账号
-                                field.setAccessible(true);
-                                field.set(parameter, sysUser.getUser().getNickName());
-                                field.setAccessible(false);
-                            }
-                        }
-                    }
-                    // 注入创建时间
-                    if ("createTime".equals(field.getName())) {
-                        field.setAccessible(true);
-                        Object local_createDate = field.get(parameter);
-                        field.setAccessible(false);
-                        if (local_createDate == null || local_createDate.equals("")) {
-                            field.setAccessible(true);
-                            field.set(parameter, new Date());
-                            field.setAccessible(false);
-                        }
-                    }
-
+        if (parameterObject instanceof MapperMethod.ParamMap) {
+            MapperMethod.ParamMap paramMap = (MapperMethod.ParamMap) parameterObject;
+            for (Object value : paramMap.values()) {
+                if (!(value instanceof Collection)) {
+                    continue;
                 }
                 }
-                catch (Exception e) {
-                    log.error("------MybatisInterceptor field.name------{},error:", field.getName(), e);
+                for (Object item : (Collection<?>) value) {
+                    injectCreateModifyInfo(item, sqlCommandType);
                 }
                 }
             }
             }
+            return invocation.proceed();
         }
         }
-        if (SqlCommandType.UPDATE == sqlCommandType) {
-            LoginUser sysUser = this.getLoginUser();
-            Field[] fields = null;
-            if (parameter instanceof MapperMethod.ParamMap) {
-                MapperMethod.ParamMap<?> p = (ParamMap<?>) parameter;
-                // update-begin-author:scott date:20190729 for:批量更新报错issues/IZA3Q--
-                if (p.containsKey("et")) {
-                    parameter = p.get("arg0");
-                }
-                else if (p.containsKey("arg0")) {
-                    parameter = p.get("arg0");
-                }
-                else {
-                    parameter = p.get("param1");
-                }
-                // update-end-author:scott date:20190729 for:批量更新报错issues/IZA3Q-
-
-                // update-begin-author:scott date:20190729 for:更新指定字段时报错 issues/#516-
-                if (parameter == null) {
-                    return invocation.proceed();
-                }
-                // update-end-author:scott date:20190729 for:更新指定字段时报错 issues/#516-
-
-                fields = this.getAllFields(parameter);
+        // 处理集合类型参数(List/数组)
+        if (parameterObject instanceof Collection) {
+            for (Object item : (Collection<?>) parameterObject) {
+                injectCreateModifyInfo(item, sqlCommandType);
             }
             }
-            else {
-                fields = this.getAllFields(parameter);
+            return invocation.proceed();
+        }
+        if (parameterObject.getClass().isArray()) {
+            for (Object item : (Object[]) parameterObject) {
+                injectCreateModifyInfo(item, sqlCommandType);
             }
             }
+            return invocation.proceed();
+        }
+        injectCreateModifyInfo(parameterObject, sqlCommandType);
+        return invocation.proceed();
+    }
 
 
-            for (Field field : fields) {
+    private void injectCreateModifyInfo(Object target, SqlCommandType sqlCommandType) {
+        if (target == null) {
+            return;
+        }
+        LoginUser sysUser = getLoginUser();
+        if (SqlCommandType.INSERT == sqlCommandType) {
+            ReflectionUtils.doWithFields(target.getClass(), field -> {
                 field.setAccessible(true);
                 field.setAccessible(true);
-                try {
-                    if ("updateBy".equals(field.getName())) {
-                        // 获取登录用户信息
+                if (field.isAnnotationPresent(TenantField.class)) {
+                    field.set(target, sysUser.getUser().getTenantId());
+                }
+                if ("createBy".equals(field.getName())) {
+                    Object local_createBy = field.get(target);
+                    if (local_createBy == null || local_createBy.equals("")) {
                         if (sysUser != null) {
                         if (sysUser != null) {
-                            // 登录账号
-                            field.set(parameter, sysUser.getUser().getNickName());
-                            field.setAccessible(false);
+                            // 登录人账号
+                            field.set(target, sysUser.getUser().getNickName());
                         }
                         }
                     }
                     }
-                    if ("updateTime".equals(field.getName())) {
-                        field.set(parameter, new Date());
-                        field.setAccessible(false);
+                }
+                if ("createName".equals(field.getName())) {
+                    Object local_createBy = field.get(target);
+                    if (local_createBy == null || local_createBy.equals("")) {
+                        if (sysUser != null) {
+                            // 登录人账号
+                            field.set(target, sysUser.getUser().getNickName());
+                        }
                     }
                     }
                 }
                 }
-                catch (Exception e) {
-                    log.error("------ MybatisInterceptor field.name------{},error:", field.getName(), e);
+                // 注入创建时间
+                if ("createTime".equals(field.getName())) {
+                    Object local_createDate = field.get(target);
+                    if (local_createDate == null || local_createDate.equals("")) {
+                        field.set(target, new Date());
+                    }
                 }
                 }
-            }
+                field.setAccessible(false);
+            });
+            return;
+        }
+        if (SqlCommandType.UPDATE == sqlCommandType) {
+            ReflectionUtils.doWithFields(target.getClass(), field -> {
+                field.setAccessible(true);
+                if ("updateBy".equals(field.getName())) {
+                    // 获取登录用户信息
+                    if (sysUser != null) {
+                        // 登录账号
+                        field.set(target, sysUser.getUser().getNickName());
+                    }
+                }
+                if ("updateTime".equals(field.getName())) {
+                    field.set(target, new Date());
+                }
+                field.setAccessible(false);
+            });
         }
         }
-        return invocation.proceed();
     }
     }
 
 
     @Override
     @Override
@@ -153,42 +133,4 @@ public class MybatisInterceptor implements Interceptor {
         return Plugin.wrap(target, this);
         return Plugin.wrap(target, this);
     }
     }
 
 
-    private LoginUser getLoginUser() {
-        LoginUser userNow = new LoginUser();
-        userNow.setUser(new SysUser() {
-            {
-                setNickName(Thread.currentThread().getName());
-            }
-        });
-        try {
-            // try catch避免线程任务出错
-            userNow = SecurityUtils.getLoginUser() != null ? SecurityUtils.getLoginUser() : null;
-        }
-        catch (Exception e) {
-            log.debug("------MybatisInterceptor getLoginUser------,error:", e);
-        }
-        return userNow;
-    }
-
-    /**
-     * 获取类的所有属性,包括父类
-     *
-     * @param object
-     * @return
-     */
-    public Field[] getAllFields(Object object) {
-        Class<?> clazz = object.getClass();
-        if (clazz == null) {
-            return null;
-        }
-        List<Field> fieldList = new ArrayList<>();
-        while (clazz != null) {
-            fieldList.addAll(new ArrayList<>(Arrays.asList(clazz.getDeclaredFields())));
-            clazz = clazz.getSuperclass();
-        }
-        Field[] fields = new Field[fieldList.size()];
-        fieldList.toArray(fields);
-        return fields;
-    }
-
 }
 }

+ 12 - 0
bd-park/park-backend/park-infrastructure/src/main/java/com/huashe/park/infrastructure/cfg/mybatis/RegisterCustomerInterceptor.java

@@ -17,14 +17,26 @@ public class RegisterCustomerInterceptor implements ApplicationListener<ContextR
     private MybatisInterceptor mybatisInterceptor;
     private MybatisInterceptor mybatisInterceptor;
 
 
     @Autowired
     @Autowired
+    private TenantSqlInterceptor tenantSqlInterceptor;
+
+    @Autowired
+    private TenantIdInterceptor tenantIdInterceptor;
+
+    @Autowired
     private List<SqlSessionFactory> sqlSessionFactories;
     private List<SqlSessionFactory> sqlSessionFactories;
 
 
     @Override
     @Override
     public void onApplicationEvent(ContextRefreshedEvent contextRefreshedEvent) {
     public void onApplicationEvent(ContextRefreshedEvent contextRefreshedEvent) {
         for (SqlSessionFactory factory : sqlSessionFactories) {
         for (SqlSessionFactory factory : sqlSessionFactories) {
             factory.getConfiguration().setObjectWrapperFactory(new MapWrapperFactory());
             factory.getConfiguration().setObjectWrapperFactory(new MapWrapperFactory());
+            // 这里注册的类型处理不能在mybatis启动的时候注册,所以需要在framework的工程里面MybatisConfig中注册,才能在rs字段映射的时候起作用。
+            // 这里注册只能是已经是默认转换完了在进行转换,可以转换同类型的字段比如字段的加解密
+            // factory.getConfiguration().getTypeHandlerRegistry().register(new MySqlJsonHandler<>());
             // 由于mybatis拦截器使用责任链模式,有可能会导致自定义拦截器失效,因此下面方法可以将自定义拦截器重新注入到sql中
             // 由于mybatis拦截器使用责任链模式,有可能会导致自定义拦截器失效,因此下面方法可以将自定义拦截器重新注入到sql中
+            factory.getConfiguration().addInterceptor(tenantSqlInterceptor);
+            factory.getConfiguration().addInterceptor(tenantIdInterceptor);
             factory.getConfiguration().addInterceptor(mybatisInterceptor);
             factory.getConfiguration().addInterceptor(mybatisInterceptor);
+            // factory.getConfiguration().addInterceptor(new FieldConvertInterceptor());
         }
         }
     }
     }
 }
 }

+ 77 - 0
bd-park/park-backend/park-infrastructure/src/main/java/com/huashe/park/infrastructure/cfg/mybatis/ResultTypeConvertInterceptor.java

@@ -0,0 +1,77 @@
+package com.huashe.park.infrastructure.cfg.mybatis;
+
+import java.lang.reflect.Field;
+import java.sql.Statement;
+import java.util.List;
+import java.util.stream.Collectors;
+
+import org.apache.ibatis.executor.resultset.ResultSetHandler;
+import org.apache.ibatis.mapping.MappedStatement;
+import org.apache.ibatis.plugin.Interceptor;
+import org.apache.ibatis.plugin.Intercepts;
+import org.apache.ibatis.plugin.Invocation;
+import org.apache.ibatis.plugin.Signature;
+import org.apache.ibatis.reflection.MetaObject;
+import org.apache.ibatis.reflection.SystemMetaObject;
+import org.springframework.util.ReflectionUtils;
+
+import com.huashe.park.common.animations.mybatis.Converter;
+import com.huashe.park.common.animations.mybatis.ConverterCache;
+import com.huashe.park.common.animations.mybatis.emuns.FieldConvert;
+import com.huashe.park.common.animations.mybatis.FieldMetadataCache;
+
+@Intercepts(@Signature(type = ResultSetHandler.class, method = "handleResultSets", args = {
+    Statement.class
+}))
+public class ResultTypeConvertInterceptor implements Interceptor {
+    @Override
+    public Object intercept(Invocation invocation) throws Throwable {
+        Object result = invocation.proceed();
+
+        // 获取MappedStatement
+        ResultSetHandler handler = (ResultSetHandler) invocation.getTarget();
+        MetaObject metaObject = SystemMetaObject.forObject(handler);
+        MappedStatement mappedStatement = (MappedStatement) metaObject.getValue("mappedStatement");
+
+        // 判断是否为resultType映射
+        if (mappedStatement.getResultMaps().size() == 1
+            && mappedStatement.getResultMaps().get(0).getResultMappings().isEmpty()) {
+            return filterResultType(result); // 仅处理resultType
+        }
+        return result; // 不处理resultMap
+    }
+
+    private Object filterResultType(Object result) {
+        // 自定义过滤逻辑(如字段脱敏、数据转换等)
+        if (result instanceof List) {
+            return ((List<?>) result).stream().map(this::processBean).collect(Collectors.toList());
+        }
+        return processBean(result);
+    }
+
+    private Object processBean(Object bean) {
+        if (bean == null) {
+            return null;
+        }
+        Class<?> clazz = bean.getClass();
+        List<Field> annotatedFields = FieldMetadataCache.getAnnotatedFields(clazz, FieldConvert.class);
+        // 遍历类及父类的所有字段
+
+        annotatedFields.forEach(field -> {
+            FieldConvert annotation = field.getAnnotation(FieldConvert.class);
+            if (annotation != null) {
+                // 获取转换器实例(带缓存)
+                Converter converter = ConverterCache.getConverter(annotation.converter());
+                // 获取原始值
+                Object originalValue = ReflectionUtils.getField(field, bean);
+                // 执行类型转换
+                Object convertedValue = converter.convert(originalValue);
+                // 设置转换后的值
+                ReflectionUtils.setField(field, bean, convertedValue);
+            }
+        }); // 包含私有字段
+
+        return bean;
+    }
+
+}

+ 81 - 0
bd-park/park-backend/park-infrastructure/src/main/java/com/huashe/park/infrastructure/cfg/mybatis/TenantIdInterceptor.java

@@ -0,0 +1,81 @@
+package com.huashe.park.infrastructure.cfg.mybatis;
+
+import java.util.Collection;
+import java.util.Map;
+
+import org.apache.commons.lang3.ObjectUtils;
+import org.apache.ibatis.executor.Executor;
+import org.apache.ibatis.mapping.MappedStatement;
+import org.apache.ibatis.mapping.SqlCommandType;
+import org.apache.ibatis.plugin.Interceptor;
+import org.apache.ibatis.plugin.Intercepts;
+import org.apache.ibatis.plugin.Invocation;
+import org.apache.ibatis.plugin.Signature;
+import org.apache.ibatis.session.ResultHandler;
+import org.apache.ibatis.session.RowBounds;
+import org.springframework.stereotype.Component;
+import org.springframework.util.ReflectionUtils;
+
+import com.huashe.common.annotation.mybatis.TenantField;
+
+@Intercepts({
+    @Signature(type = Executor.class, method = "query", args = {
+        MappedStatement.class, Object.class, RowBounds.class, ResultHandler.class
+    })
+})
+@Component
+public class TenantIdInterceptor extends BaseInterceptor implements Interceptor {
+    @Override
+    public Object intercept(Invocation invocation) throws Throwable {
+        MappedStatement mappedStatement = (MappedStatement) invocation.getArgs()[0];
+        SqlCommandType sqlCommandType = mappedStatement.getSqlCommandType();
+        Object parameterObject = invocation.getArgs()[1];
+        Long tenantId = getLoginUser().getUser().getTenantId();
+        // 无租户 ID 或无参数对象直接跳过
+        if (sqlCommandType != SqlCommandType.SELECT || ObjectUtils.isEmpty(tenantId)
+            || ObjectUtils.isEmpty(parameterObject)) {
+            return invocation.proceed();
+        }
+
+        // 处理集合类型参数(List/数组)
+        if (parameterObject instanceof Collection) {
+            for (Object item : (Collection<?>) parameterObject) {
+                injectTenantId(item, tenantId);
+            }
+            return invocation.proceed();
+        }
+        if (parameterObject.getClass().isArray()) {
+            for (Object item : (Object[]) parameterObject) {
+                injectTenantId(item, tenantId);
+            }
+            return invocation.proceed();
+        }
+        injectTenantId(parameterObject, tenantId);
+
+        return invocation.proceed();
+    }
+
+    // 公共注入逻辑
+    private void injectTenantId(Object target, Long tenantId) {
+        if (target == null)
+            return;
+
+        // 处理 Map 类型
+        if (target instanceof Map) {
+            Map<?, ?> map = (Map<?, ?>) target;
+            if (!map.containsKey("tenantId")) {
+                ((Map<String, Object>) map).put("tenantId", tenantId);
+            }
+        }
+        // 处理实体对象
+        else {
+            ReflectionUtils.doWithFields(target.getClass(), field -> {
+                if (field.isAnnotationPresent(TenantField.class)) {
+                    field.setAccessible(true);
+                    field.set(target, getLoginUser().getUser().getTenantId());
+                    field.setAccessible(false);
+                }
+            });
+        }
+    }
+}

+ 122 - 0
bd-park/park-backend/park-infrastructure/src/main/java/com/huashe/park/infrastructure/cfg/mybatis/TenantSqlInterceptor.java

@@ -0,0 +1,122 @@
+package com.huashe.park.infrastructure.cfg.mybatis;
+
+import java.lang.reflect.Method;
+import java.sql.Connection;
+import java.util.List;
+import java.util.Properties;
+
+import org.apache.commons.lang3.ObjectUtils;
+import org.apache.ibatis.executor.statement.StatementHandler;
+import org.apache.ibatis.mapping.MappedStatement;
+import org.apache.ibatis.plugin.Interceptor;
+import org.apache.ibatis.plugin.Intercepts;
+import org.apache.ibatis.plugin.Invocation;
+import org.apache.ibatis.plugin.Plugin;
+import org.apache.ibatis.plugin.Signature;
+import org.apache.ibatis.reflection.MetaObject;
+import org.apache.ibatis.reflection.SystemMetaObject;
+import org.springframework.stereotype.Component;
+
+import com.huashe.common.annotation.mybatis.Tenant;
+import com.huashe.park.common.animations.mybatis.MethodMetadataCache;
+
+import net.sf.jsqlparser.expression.Expression;
+import net.sf.jsqlparser.expression.LongValue;
+import net.sf.jsqlparser.expression.operators.conditional.AndExpression;
+import net.sf.jsqlparser.expression.operators.relational.EqualsTo;
+import net.sf.jsqlparser.parser.CCJSqlParserUtil;
+import net.sf.jsqlparser.schema.Column;
+import net.sf.jsqlparser.statement.Statement;
+import net.sf.jsqlparser.statement.select.PlainSelect;
+import net.sf.jsqlparser.statement.select.Select;
+import net.sf.jsqlparser.statement.select.SelectBody;
+
+@Intercepts({
+    @Signature(type = StatementHandler.class, method = "prepare", args = {
+        Connection.class, Integer.class
+    })
+})
+@Component
+public class TenantSqlInterceptor extends BaseInterceptor implements Interceptor {
+
+    @Override
+    public Object intercept(Invocation invocation) throws Throwable {
+        StatementHandler handler = (StatementHandler) invocation.getTarget();
+        MetaObject metaObject = SystemMetaObject.forObject(handler);
+
+        // 获取原始 SQL 和 MappedStatement
+        String originalSql = (String) metaObject.getValue("delegate.boundSql.sql");
+        MappedStatement mappedStatement = (MappedStatement) metaObject.getValue("delegate.mappedStatement");
+        Method mapperMethod = getMapperMethod(mappedStatement);
+        // 判断是否需要添加租户条件
+        if (!ObjectUtils.allNotNull(mapperMethod, getLoginUser().getUser().getTenantId())) {
+            return invocation.proceed();
+        }
+        // 解析 SQL 语法树
+        Statement stmt = CCJSqlParserUtil.parse(originalSql);
+        if (!(stmt instanceof Select)) {
+            return invocation.proceed();
+        }
+        Select select = (Select) stmt;
+        SelectBody selectBody = select.getSelectBody();
+        if (!(selectBody instanceof PlainSelect)) {
+            return invocation.proceed();
+        }
+        PlainSelect plainSelect = (PlainSelect) selectBody;
+        // 构建租户条件表达式(tenant_id = ?)
+        EqualsTo tenantCondition = new EqualsTo();
+        tenantCondition.setLeftExpression(handleColumn(mapperMethod));
+        tenantCondition.setRightExpression(new LongValue(getLoginUser().getUser().getTenantId()));
+
+        // 修改 WHERE 条件
+        Expression where = plainSelect.getWhere();
+        if (where == null) {
+            // 没有 WHERE 子句时直接添加
+            plainSelect.setWhere(tenantCondition);
+        }
+        else {
+            // 已有 WHERE 子句时用 AND 连接
+            AndExpression and = new AndExpression(where, tenantCondition);
+            plainSelect.setWhere(and);
+        }
+
+        // 生成修改后的 SQL
+        String modifiedSql = plainSelect.toString();
+        metaObject.setValue("delegate.boundSql.sql", modifiedSql);
+
+        return invocation.proceed();
+    }
+
+    private Method getMapperMethod(MappedStatement mappedStatement) {
+        String methodId = mappedStatement.getId();
+        int lastDotIndex = methodId.lastIndexOf(".");
+        String methodName = methodId.substring(lastDotIndex + 1);
+        List<Method> annotatedMethods = MethodMetadataCache.getAnnotatedMethods(mappedStatement);
+        if (methodName.endsWith("_COUNT")) {
+            methodName = methodName.replaceFirst("_COUNT", "");
+        }
+        String finalMethodName = methodName;
+        return annotatedMethods.stream().filter(method -> method.getName().equals(finalMethodName)).findFirst()
+            .orElse(null);
+    }
+
+    private Column handleColumn(Method mapperMethod) {
+        Tenant annotation = mapperMethod.getAnnotation(Tenant.class);
+        if (!ObjectUtils.isNotEmpty(annotation)) {
+            return new Column("tenant_id");
+        }
+        if (ObjectUtils.isNotEmpty(annotation.tableAlias())) {
+            return new Column(String.format("%s.%s", annotation.tableAlias(), annotation.field()));
+        }
+        return new Column(annotation.field());
+    }
+
+    @Override
+    public Object plugin(Object target) {
+        return Plugin.wrap(target, this);
+    }
+
+    @Override
+    public void setProperties(Properties properties) {
+    }
+}

+ 16 - 0
bd-park/park-backend/park-infrastructure/src/main/java/com/huashe/park/infrastructure/mqtt/CADService.java

@@ -0,0 +1,16 @@
+package com.huashe.park.infrastructure.mqtt;
+
+import java.util.Map;
+
+import org.springframework.web.multipart.MultipartFile;
+
+import com.dtflys.forest.annotation.BaseRequest;
+import com.dtflys.forest.annotation.DataFile;
+import com.dtflys.forest.annotation.Post;
+import com.dtflys.forest.http.ForestResponse;
+
+@BaseRequest(baseURL = "http://127.0.0.1:18080")
+public interface CADService {
+    @Post(url = "/upload",headers = {"Accept: */*"})
+    ForestResponse<Map> newTopic(@DataFile(value = "dwg_file") MultipartFile file);
+}

+ 14 - 0
bd-park/park-backend/park-infrastructure/src/main/java/com/huashe/park/infrastructure/mqtt/CollectMqttService.java

@@ -0,0 +1,14 @@
+package com.huashe.park.infrastructure.mqtt;
+
+import java.util.Map;
+
+import com.dtflys.forest.annotation.BaseRequest;
+import com.dtflys.forest.annotation.JSONBody;
+import com.dtflys.forest.annotation.Post;
+import com.huashe.park.domain.dto.cons.MqttRequest;
+
+@BaseRequest(baseURL = "{collectMqtt}")
+public interface CollectMqttService {
+    @Post(url = "/topic/new/topic")
+    Map newTopic(@JSONBody MqttRequest request);
+}

+ 0 - 20
bd-park/park-backend/park-infrastructure/src/main/java/com/huashe/park/infrastructure/uwb/CADService.java

@@ -1,20 +0,0 @@
-package com.huashe.park.infrastructure.uwb;
-
-import java.io.File;
-import java.util.Map;
-
-import com.dtflys.forest.annotation.BaseRequest;
-import com.dtflys.forest.annotation.DataFile;
-import com.dtflys.forest.annotation.Post;
-import com.dtflys.forest.callback.OnProgress;
-import com.dtflys.forest.extensions.DownloadFile;
-
-@BaseRequest(baseURL = "{cadBaseUrl}")
-public interface CADService {
-    @Post(url = "/download")
-    @DownloadFile(dir = "${0}", filename = "${1}")
-    File downloadFile(String dir, String filename, @DataFile("file") File file, OnProgress onProgress);
-
-    @Post(url = "/upload")
-    Map analysisCad(@DataFile("dwg_file") File file);
-}

+ 31 - 12
bd-park/park-backend/pom.xml

@@ -58,7 +58,8 @@
         <fastexcel.version>1.1.0</fastexcel.version>
         <fastexcel.version>1.1.0</fastexcel.version>
         <paho.version>1.2.5</paho.version>
         <paho.version>1.2.5</paho.version>
         <common.collect>4.4</common.collect>
         <common.collect>4.4</common.collect>
-        <warm-flow>1.6.7</warm-flow>
+        <geotools.version>20.0</geotools.version>
+        <jsqlparser.version>4.6</jsqlparser.version>
     </properties>
     </properties>
 
 
     <!-- 依赖声明 -->
     <!-- 依赖声明 -->
@@ -221,11 +222,6 @@
                 <artifactId>ruoyi-common</artifactId>
                 <artifactId>ruoyi-common</artifactId>
                 <version>${ruoyi.version}</version>
                 <version>${ruoyi.version}</version>
             </dependency>
             </dependency>
-            <dependency>
-                <groupId>com.huashe.application</groupId>
-                <artifactId>ruoyi-flow</artifactId>
-                <version>${ruoyi.version}</version>
-            </dependency>
 
 
             <dependency>
             <dependency>
                 <groupId>com.dtflys.forest</groupId>
                 <groupId>com.dtflys.forest</groupId>
@@ -379,14 +375,37 @@
                 <version>${common.collect}</version>
                 <version>${common.collect}</version>
             </dependency>
             </dependency>
             <dependency>
             <dependency>
-                <groupId>org.dromara.warm</groupId>
-                <artifactId>warm-flow-mybatis-sb-starter</artifactId>
-                <version>${warm-flow}</version>
+                <groupId>com.github.jsqlparser</groupId>
+                <artifactId>jsqlparser</artifactId>
+                <version>${jsqlparser.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.geotools</groupId>
+                <artifactId>gt-api</artifactId>
+                <version>${geotools.version}</version>
+                <exclusions>
+                    <exclusion>
+                        <groupId>javax.media</groupId>
+                        <artifactId>jai_core</artifactId>
+                    </exclusion>
+                    <exclusion>
+                        <groupId>jgridshift</groupId>
+                        <artifactId>jgridshift</artifactId>
+                    </exclusion>
+                    <exclusion>
+                        <groupId>commons-pool</groupId>
+                        <artifactId>commons-pool</artifactId>
+                    </exclusion>
+                    <exclusion>
+                        <groupId>net.sf.geographiclib</groupId>
+                        <artifactId>GeographicLib-Java</artifactId>
+                    </exclusion>
+                </exclusions>
             </dependency>
             </dependency>
             <dependency>
             <dependency>
-                <groupId>org.dromara.warm</groupId>
-                <artifactId>warm-flow-plugin-ui-sb-web</artifactId>
-                <version>${warm-flow}</version>
+                <groupId>org.geotools</groupId>
+                <artifactId>gt-epsg-hsql</artifactId>
+                <version>${geotools.version}</version>
             </dependency>
             </dependency>
         </dependencies>
         </dependencies>
     </dependencyManagement>
     </dependencyManagement>

+ 9 - 4
common-application/pom.xml

@@ -2,8 +2,8 @@
 <project xmlns="http://maven.apache.org/POM/4.0.0"
 <project xmlns="http://maven.apache.org/POM/4.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-	<modelVersion>4.0.0</modelVersion>
-	
+    <modelVersion>4.0.0</modelVersion>
+
     <groupId>com.huashe.application</groupId>
     <groupId>com.huashe.application</groupId>
     <artifactId>common-application</artifactId>
     <artifactId>common-application</artifactId>
     <version>3.8.8</version>
     <version>3.8.8</version>
@@ -11,7 +11,7 @@
     <name>common-application</name>
     <name>common-application</name>
 
 
     <description>公共组件-单体应用版</description>
     <description>公共组件-单体应用版</description>
-    
+
     <properties>
     <properties>
         <ruoyi.version>3.8.8</ruoyi.version>
         <ruoyi.version>3.8.8</ruoyi.version>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -36,6 +36,7 @@
         <spring-security.version>5.7.12</spring-security.version>
         <spring-security.version>5.7.12</spring-security.version>
         <spring-framework.version>5.3.39</spring-framework.version>
         <spring-framework.version>5.3.39</spring-framework.version>
         <prod.commons.version>1.0-SNAPSHOT</prod.commons.version>
         <prod.commons.version>1.0-SNAPSHOT</prod.commons.version>
+        <jsqlparser.version>4.6</jsqlparser.version>
         <warm-flow>1.6.7</warm-flow>
         <warm-flow>1.6.7</warm-flow>
     </properties>
     </properties>
 
 
@@ -226,6 +227,11 @@
                 <version>${prod.commons.version}</version>
                 <version>${prod.commons.version}</version>
             </dependency>
             </dependency>
             <dependency>
             <dependency>
+                <groupId>com.github.jsqlparser</groupId>
+                <artifactId>jsqlparser</artifactId>
+                <version>${jsqlparser.version}</version>
+            </dependency>
+            <dependency>
                 <groupId>org.dromara.warm</groupId>
                 <groupId>org.dromara.warm</groupId>
                 <artifactId>warm-flow-mybatis-sb-starter</artifactId>
                 <artifactId>warm-flow-mybatis-sb-starter</artifactId>
                 <version>${warm-flow}</version>
                 <version>${warm-flow}</version>
@@ -245,7 +251,6 @@
         <module>ruoyi-quartz</module>
         <module>ruoyi-quartz</module>
         <module>ruoyi-generator</module>
         <module>ruoyi-generator</module>
         <module>ruoyi-common</module>
         <module>ruoyi-common</module>
-        <module>ruoyi-flow</module>
     </modules>
     </modules>
     <packaging>pom</packaging>
     <packaging>pom</packaging>
 
 

+ 28 - 50
common-application/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java

@@ -15,6 +15,7 @@ import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.system.service.ISysDeptService;
 import com.ruoyi.system.service.ISysDeptService;
 import com.ruoyi.system.service.ISysPostService;
 import com.ruoyi.system.service.ISysPostService;
 import com.ruoyi.system.service.ISysRoleService;
 import com.ruoyi.system.service.ISysRoleService;
+import com.ruoyi.system.service.ISysTenantService;
 import com.ruoyi.system.service.ISysUserService;
 import com.ruoyi.system.service.ISysUserService;
 import org.apache.commons.lang3.ArrayUtils;
 import org.apache.commons.lang3.ArrayUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -36,13 +37,12 @@ import java.util.stream.Collectors;
 
 
 /**
 /**
  * 用户信息
  * 用户信息
- * 
+ *
  * @author ruoyi
  * @author ruoyi
  */
  */
 @RestController
 @RestController
 @RequestMapping("/system/user")
 @RequestMapping("/system/user")
-public class SysUserController extends BaseController
-{
+public class SysUserController extends BaseController {
     @Autowired
     @Autowired
     private ISysUserService userService;
     private ISysUserService userService;
 
 
@@ -55,13 +55,15 @@ public class SysUserController extends BaseController
     @Autowired
     @Autowired
     private ISysPostService postService;
     private ISysPostService postService;
 
 
+    @Autowired
+    private ISysTenantService tenantService;
+
     /**
     /**
      * 获取用户列表
      * 获取用户列表
      */
      */
     @PreAuthorize("@ss.hasPermi('system:user:list')")
     @PreAuthorize("@ss.hasPermi('system:user:list')")
     @GetMapping("/list")
     @GetMapping("/list")
-    public TableDataInfo list(SysUser user)
-    {
+    public TableDataInfo list(SysUser user) {
         startPage();
         startPage();
         List<SysUser> list = userService.selectUserList(user);
         List<SysUser> list = userService.selectUserList(user);
         return getDataTable(list);
         return getDataTable(list);
@@ -70,8 +72,7 @@ public class SysUserController extends BaseController
     @Log(title = "用户管理", businessType = BusinessType.EXPORT)
     @Log(title = "用户管理", businessType = BusinessType.EXPORT)
     @PreAuthorize("@ss.hasPermi('system:user:export')")
     @PreAuthorize("@ss.hasPermi('system:user:export')")
     @PostMapping("/export")
     @PostMapping("/export")
-    public void export(HttpServletResponse response, SysUser user)
-    {
+    public void export(HttpServletResponse response, SysUser user) {
         List<SysUser> list = userService.selectUserList(user);
         List<SysUser> list = userService.selectUserList(user);
         ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
         ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
         util.exportExcel(response, list, "用户数据");
         util.exportExcel(response, list, "用户数据");
@@ -80,8 +81,7 @@ public class SysUserController extends BaseController
     @Log(title = "用户管理", businessType = BusinessType.IMPORT)
     @Log(title = "用户管理", businessType = BusinessType.IMPORT)
     @PreAuthorize("@ss.hasPermi('system:user:import')")
     @PreAuthorize("@ss.hasPermi('system:user:import')")
     @PostMapping("/importData")
     @PostMapping("/importData")
-    public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
-    {
+    public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception {
         ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
         ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
         List<SysUser> userList = util.importExcel(file.getInputStream());
         List<SysUser> userList = util.importExcel(file.getInputStream());
         String operName = getUsername();
         String operName = getUsername();
@@ -90,8 +90,7 @@ public class SysUserController extends BaseController
     }
     }
 
 
     @PostMapping("/importTemplate")
     @PostMapping("/importTemplate")
-    public void importTemplate(HttpServletResponse response)
-    {
+    public void importTemplate(HttpServletResponse response) {
         ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
         ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
         util.importTemplateExcel(response, "用户数据");
         util.importTemplateExcel(response, "用户数据");
     }
     }
@@ -100,12 +99,10 @@ public class SysUserController extends BaseController
      * 根据用户编号获取详细信息
      * 根据用户编号获取详细信息
      */
      */
     @PreAuthorize("@ss.hasPermi('system:user:query')")
     @PreAuthorize("@ss.hasPermi('system:user:query')")
-    @GetMapping(value = { "/", "/{userId}" })
-    public AjaxResult getInfo(@PathVariable(value = "userId", required = false) Long userId)
-    {
+    @GetMapping(value = {"/", "/{userId}"})
+    public AjaxResult getInfo(@PathVariable(value = "userId", required = false) Long userId) {
         AjaxResult ajax = AjaxResult.success();
         AjaxResult ajax = AjaxResult.success();
-        if (StringUtils.isNotNull(userId))
-        {
+        if (StringUtils.isNotNull(userId)) {
             userService.checkUserDataScope(userId);
             userService.checkUserDataScope(userId);
             SysUser sysUser = userService.selectUserById(userId);
             SysUser sysUser = userService.selectUserById(userId);
             ajax.put(AjaxResult.DATA_TAG, sysUser);
             ajax.put(AjaxResult.DATA_TAG, sysUser);
@@ -124,20 +121,14 @@ public class SysUserController extends BaseController
     @PreAuthorize("@ss.hasPermi('system:user:add')")
     @PreAuthorize("@ss.hasPermi('system:user:add')")
     @Log(title = "用户管理", businessType = BusinessType.INSERT)
     @Log(title = "用户管理", businessType = BusinessType.INSERT)
     @PostMapping
     @PostMapping
-    public AjaxResult add(@Validated @RequestBody SysUser user)
-    {
+    public AjaxResult add(@Validated @RequestBody SysUser user) {
         deptService.checkDeptDataScope(user.getDeptId());
         deptService.checkDeptDataScope(user.getDeptId());
         roleService.checkRoleDataScope(user.getRoleIds());
         roleService.checkRoleDataScope(user.getRoleIds());
-        if (!userService.checkUserNameUnique(user))
-        {
+        if (!userService.checkUserNameUnique(user)) {
             return error("新增用户'" + user.getUserName() + "'失败,登录账号已存在");
             return error("新增用户'" + user.getUserName() + "'失败,登录账号已存在");
-        }
-        else if (StringMatchUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user))
-        {
+        } else if (StringMatchUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user)) {
             return error("新增用户'" + user.getUserName() + "'失败,手机号码已存在");
             return error("新增用户'" + user.getUserName() + "'失败,手机号码已存在");
-        }
-        else if (StringMatchUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user))
-        {
+        } else if (StringMatchUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user)) {
             return error("新增用户'" + user.getUserName() + "'失败,邮箱账号已存在");
             return error("新增用户'" + user.getUserName() + "'失败,邮箱账号已存在");
         }
         }
         user.setCreateBy(getUsername());
         user.setCreateBy(getUsername());
@@ -151,22 +142,16 @@ public class SysUserController extends BaseController
     @PreAuthorize("@ss.hasPermi('system:user:edit')")
     @PreAuthorize("@ss.hasPermi('system:user:edit')")
     @Log(title = "用户管理", businessType = BusinessType.UPDATE)
     @Log(title = "用户管理", businessType = BusinessType.UPDATE)
     @PutMapping
     @PutMapping
-    public AjaxResult edit(@Validated @RequestBody SysUser user)
-    {
+    public AjaxResult edit(@Validated @RequestBody SysUser user) {
         userService.checkUserAllowed(user);
         userService.checkUserAllowed(user);
         userService.checkUserDataScope(user.getUserId());
         userService.checkUserDataScope(user.getUserId());
         deptService.checkDeptDataScope(user.getDeptId());
         deptService.checkDeptDataScope(user.getDeptId());
         roleService.checkRoleDataScope(user.getRoleIds());
         roleService.checkRoleDataScope(user.getRoleIds());
-        if (!userService.checkUserNameUnique(user))
-        {
+        if (!userService.checkUserNameUnique(user)) {
             return error("修改用户'" + user.getUserName() + "'失败,登录账号已存在");
             return error("修改用户'" + user.getUserName() + "'失败,登录账号已存在");
-        }
-        else if (StringMatchUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user))
-        {
+        } else if (StringMatchUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user)) {
             return error("修改用户'" + user.getUserName() + "'失败,手机号码已存在");
             return error("修改用户'" + user.getUserName() + "'失败,手机号码已存在");
-        }
-        else if (StringMatchUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user))
-        {
+        } else if (StringMatchUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user)) {
             return error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在");
             return error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在");
         }
         }
         user.setUpdateBy(getUsername());
         user.setUpdateBy(getUsername());
@@ -179,10 +164,8 @@ public class SysUserController extends BaseController
     @PreAuthorize("@ss.hasPermi('system:user:remove')")
     @PreAuthorize("@ss.hasPermi('system:user:remove')")
     @Log(title = "用户管理", businessType = BusinessType.DELETE)
     @Log(title = "用户管理", businessType = BusinessType.DELETE)
     @DeleteMapping("/{userIds}")
     @DeleteMapping("/{userIds}")
-    public AjaxResult remove(@PathVariable Long[] userIds)
-    {
-        if (ArrayUtils.contains(userIds, getUserId()))
-        {
+    public AjaxResult remove(@PathVariable Long[] userIds) {
+        if (ArrayUtils.contains(userIds, getUserId())) {
             return error("当前用户不能删除");
             return error("当前用户不能删除");
         }
         }
         return toAjax(userService.deleteUserByIds(userIds));
         return toAjax(userService.deleteUserByIds(userIds));
@@ -194,8 +177,7 @@ public class SysUserController extends BaseController
     @PreAuthorize("@ss.hasPermi('system:user:resetPwd')")
     @PreAuthorize("@ss.hasPermi('system:user:resetPwd')")
     @Log(title = "用户管理", businessType = BusinessType.UPDATE)
     @Log(title = "用户管理", businessType = BusinessType.UPDATE)
     @PutMapping("/resetPwd")
     @PutMapping("/resetPwd")
-    public AjaxResult resetPwd(@RequestBody SysUser user)
-    {
+    public AjaxResult resetPwd(@RequestBody SysUser user) {
         userService.checkUserAllowed(user);
         userService.checkUserAllowed(user);
         userService.checkUserDataScope(user.getUserId());
         userService.checkUserDataScope(user.getUserId());
         user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
         user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
@@ -209,8 +191,7 @@ public class SysUserController extends BaseController
     @PreAuthorize("@ss.hasPermi('system:user:edit')")
     @PreAuthorize("@ss.hasPermi('system:user:edit')")
     @Log(title = "用户管理", businessType = BusinessType.UPDATE)
     @Log(title = "用户管理", businessType = BusinessType.UPDATE)
     @PutMapping("/changeStatus")
     @PutMapping("/changeStatus")
-    public AjaxResult changeStatus(@RequestBody SysUser user)
-    {
+    public AjaxResult changeStatus(@RequestBody SysUser user) {
         userService.checkUserAllowed(user);
         userService.checkUserAllowed(user);
         userService.checkUserDataScope(user.getUserId());
         userService.checkUserDataScope(user.getUserId());
         user.setUpdateBy(getUsername());
         user.setUpdateBy(getUsername());
@@ -222,8 +203,7 @@ public class SysUserController extends BaseController
      */
      */
     @PreAuthorize("@ss.hasPermi('system:user:query')")
     @PreAuthorize("@ss.hasPermi('system:user:query')")
     @GetMapping("/authRole/{userId}")
     @GetMapping("/authRole/{userId}")
-    public AjaxResult authRole(@PathVariable("userId") Long userId)
-    {
+    public AjaxResult authRole(@PathVariable("userId") Long userId) {
         AjaxResult ajax = AjaxResult.success();
         AjaxResult ajax = AjaxResult.success();
         SysUser user = userService.selectUserById(userId);
         SysUser user = userService.selectUserById(userId);
         List<SysRole> roles = roleService.selectRolesByUserId(userId);
         List<SysRole> roles = roleService.selectRolesByUserId(userId);
@@ -238,8 +218,7 @@ public class SysUserController extends BaseController
     @PreAuthorize("@ss.hasPermi('system:user:edit')")
     @PreAuthorize("@ss.hasPermi('system:user:edit')")
     @Log(title = "用户管理", businessType = BusinessType.GRANT)
     @Log(title = "用户管理", businessType = BusinessType.GRANT)
     @PutMapping("/authRole")
     @PutMapping("/authRole")
-    public AjaxResult insertAuthRole(Long userId, Long[] roleIds)
-    {
+    public AjaxResult insertAuthRole(Long userId, Long[] roleIds) {
         userService.checkUserDataScope(userId);
         userService.checkUserDataScope(userId);
         roleService.checkRoleDataScope(roleIds);
         roleService.checkRoleDataScope(roleIds);
         userService.insertUserAuth(userId, roleIds);
         userService.insertUserAuth(userId, roleIds);
@@ -251,8 +230,7 @@ public class SysUserController extends BaseController
      */
      */
     @PreAuthorize("@ss.hasPermi('system:user:list')")
     @PreAuthorize("@ss.hasPermi('system:user:list')")
     @GetMapping("/deptTree")
     @GetMapping("/deptTree")
-    public AjaxResult deptTree(SysDept dept)
-    {
+    public AjaxResult deptTree(SysDept dept) {
         return success(deptService.selectDeptTreeList(dept));
         return success(deptService.selectDeptTreeList(dept));
     }
     }
 }
 }

部分文件因文件數量過多而無法顯示