Browse Source

处理流程任务

wukai 2 weeks ago
parent
commit
0fb32c2b7f
22 changed files with 1276 additions and 53 deletions
  1. 3 4
      jjt-admin/pom.xml
  2. 113 0
      jjt-admin/src/main/java/com/jjt/biz/controller/FlowsConfigController.java
  3. 113 0
      jjt-admin/src/main/java/com/jjt/biz/controller/FlowsRecordController.java
  4. 29 33
      jjt-admin/src/main/java/com/jjt/biz/controller/HouseConfigController.java
  5. 49 0
      jjt-admin/src/main/java/com/jjt/biz/domain/FlowsConfig.java
  6. 122 0
      jjt-admin/src/main/java/com/jjt/biz/domain/FlowsRecord.java
  7. 62 0
      jjt-admin/src/main/java/com/jjt/biz/mapper/FlowsConfigMapper.java
  8. 62 0
      jjt-admin/src/main/java/com/jjt/biz/mapper/FlowsRecordMapper.java
  9. 5 5
      jjt-admin/src/main/java/com/jjt/biz/mqtt/MqttSubscriber.java
  10. 60 0
      jjt-admin/src/main/java/com/jjt/biz/service/IFlowsConfigService.java
  11. 66 0
      jjt-admin/src/main/java/com/jjt/biz/service/IFlowsRecordService.java
  12. 88 0
      jjt-admin/src/main/java/com/jjt/biz/service/impl/FlowsConfigServiceImpl.java
  13. 166 0
      jjt-admin/src/main/java/com/jjt/biz/service/impl/FlowsRecordServiceImpl.java
  14. 22 0
      jjt-admin/src/main/java/com/jjt/biz/task/FlowTask.java
  15. 74 8
      jjt-admin/src/main/java/com/jjt/biz/utils/FlowsUtils.java
  16. 2 2
      jjt-admin/src/main/resources/application-prod.yml
  17. 89 0
      jjt-admin/src/main/resources/mapper/biz/FlowsConfigMapper.xml
  18. 98 0
      jjt-admin/src/main/resources/mapper/biz/FlowsRecordMapper.xml
  19. 29 0
      jjt-admin/src/test/java/com/test/FRTest.java
  20. 1 1
      jjt-common/src/main/java/com/jjt/common/constant/Constants.java
  21. 8 0
      jjt-system/src/main/java/com/jjt/system/service/ISysDeptService.java
  22. 15 0
      jjt-system/src/main/java/com/jjt/system/service/impl/SysDeptServiceImpl.java

+ 3 - 4
jjt-admin/pom.xml

@@ -89,11 +89,10 @@
             <version>1.7.36</version>
         </dependency>
         <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-simple</artifactId>
-            <version>1.7.36</version>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
         </dependency>
-
         <!-- Eclipse Paho MQTT Client -->
         <dependency>
             <groupId>org.eclipse.paho</groupId>

+ 113 - 0
jjt-admin/src/main/java/com/jjt/biz/controller/FlowsConfigController.java

@@ -0,0 +1,113 @@
+package com.jjt.biz.controller;
+
+import java.util.List;
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.jjt.common.annotation.Log;
+import com.jjt.common.core.controller.BaseController;
+import com.jjt.common.core.domain.AjaxResult;
+import com.jjt.common.enums.BusinessType;
+import com.jjt.biz.domain.FlowsConfig;
+import com.jjt.biz.service.IFlowsConfigService;
+import com.jjt.common.utils.poi.ExcelUtil;
+import com.jjt.common.core.page.TableDataInfo;
+
+/**
+ * 流程管理Controller
+ *
+ * @author wukai
+ * @date 2025-10-14
+ */
+@Api(tags="流程管理")
+@RestController
+@RequestMapping("/biz/fc")
+public class FlowsConfigController extends BaseController{
+    @Resource
+    private IFlowsConfigService flowsConfigService;
+
+    /**
+     * 查询流程管理列表
+     */
+    @ApiOperation("查询流程管理列表")
+    //@PreAuthorize("@ss.hasPermi('biz:fc:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FlowsConfig flowsConfig)
+    {
+        startPage();
+        List<FlowsConfig> list = flowsConfigService.selectFlowsConfigList(flowsConfig);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出流程管理列表
+     */
+    @ApiOperation("导出流程管理列表")
+    //@PreAuthorize("@ss.hasPermi('biz:fc:export')")
+    @Log(title = "流程管理", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, FlowsConfig flowsConfig)
+    {
+        List<FlowsConfig> list = flowsConfigService.selectFlowsConfigList(flowsConfig);
+        ExcelUtil<FlowsConfig> util = new ExcelUtil<FlowsConfig>(FlowsConfig.class);
+        util.exportExcel(response, list, "流程管理数据");
+    }
+
+    /**
+     * 获取流程管理详细信息
+     */
+    @ApiOperation("获取流程管理详细信息")
+    //@PreAuthorize("@ss.hasPermi('biz:fc:query')")
+    @GetMapping(value = "/{flowsId}")
+    public AjaxResult getInfo(@PathVariable("flowsId") Long flowsId)
+    {
+        return success(flowsConfigService.selectFlowsConfigByFlowsId(flowsId));
+    }
+
+    /**
+     * 新增流程管理
+     */
+    @ApiOperation("新增流程管理")
+    //@PreAuthorize("@ss.hasPermi('biz:fc:add')")
+    @Log(title = "流程管理", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FlowsConfig flowsConfig)
+    {
+        return toAjax(flowsConfigService.insertFlowsConfig(flowsConfig));
+    }
+
+    /**
+     * 修改流程管理
+     */
+    @ApiOperation("修改流程管理")
+    //@PreAuthorize("@ss.hasPermi('biz:fc:edit')")
+    @Log(title = "流程管理", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FlowsConfig flowsConfig)
+    {
+        return toAjax(flowsConfigService.updateFlowsConfig(flowsConfig));
+    }
+
+    /**
+     * 删除流程管理
+     */
+    @ApiOperation("删除流程管理")
+    //@PreAuthorize("@ss.hasPermi('biz:fc:remove')")
+    @Log(title = "流程管理", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{flowsIds}")
+    public AjaxResult remove(@PathVariable Long[] flowsIds)
+    {
+        return toAjax(flowsConfigService.deleteFlowsConfigByFlowsIds(flowsIds));
+    }
+}

+ 113 - 0
jjt-admin/src/main/java/com/jjt/biz/controller/FlowsRecordController.java

@@ -0,0 +1,113 @@
+package com.jjt.biz.controller;
+
+import java.util.List;
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.jjt.common.annotation.Log;
+import com.jjt.common.core.controller.BaseController;
+import com.jjt.common.core.domain.AjaxResult;
+import com.jjt.common.enums.BusinessType;
+import com.jjt.biz.domain.FlowsRecord;
+import com.jjt.biz.service.IFlowsRecordService;
+import com.jjt.common.utils.poi.ExcelUtil;
+import com.jjt.common.core.page.TableDataInfo;
+
+/**
+ * 流程记录Controller
+ *
+ * @author wukai
+ * @date 2025-10-14
+ */
+@Api(tags="流程记录")
+@RestController
+@RequestMapping("/biz/fr")
+public class FlowsRecordController extends BaseController{
+    @Resource
+    private IFlowsRecordService flowsRecordService;
+
+    /**
+     * 查询流程记录列表
+     */
+    @ApiOperation("查询流程记录列表")
+    //@PreAuthorize("@ss.hasPermi('biz:fr:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FlowsRecord flowsRecord)
+    {
+        startPage();
+        List<FlowsRecord> list = flowsRecordService.selectFlowsRecordList(flowsRecord);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出流程记录列表
+     */
+    @ApiOperation("导出流程记录列表")
+    //@PreAuthorize("@ss.hasPermi('biz:fr:export')")
+    @Log(title = "流程记录", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, FlowsRecord flowsRecord)
+    {
+        List<FlowsRecord> list = flowsRecordService.selectFlowsRecordList(flowsRecord);
+        ExcelUtil<FlowsRecord> util = new ExcelUtil<FlowsRecord>(FlowsRecord.class);
+        util.exportExcel(response, list, "流程记录数据");
+    }
+
+    /**
+     * 获取流程记录详细信息
+     */
+    @ApiOperation("获取流程记录详细信息")
+    //@PreAuthorize("@ss.hasPermi('biz:fr:query')")
+    @GetMapping(value = "/{recordId}")
+    public AjaxResult getInfo(@PathVariable("recordId") Long recordId)
+    {
+        return success(flowsRecordService.selectFlowsRecordByRecordId(recordId));
+    }
+
+    /**
+     * 新增流程记录
+     */
+    @ApiOperation("新增流程记录")
+    //@PreAuthorize("@ss.hasPermi('biz:fr:add')")
+    @Log(title = "流程记录", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FlowsRecord flowsRecord)
+    {
+        return toAjax(flowsRecordService.insertFlowsRecord(flowsRecord));
+    }
+
+    /**
+     * 修改流程记录
+     */
+    @ApiOperation("修改流程记录")
+    //@PreAuthorize("@ss.hasPermi('biz:fr:edit')")
+    @Log(title = "流程记录", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FlowsRecord flowsRecord)
+    {
+        return toAjax(flowsRecordService.updateFlowsRecord(flowsRecord));
+    }
+
+    /**
+     * 删除流程记录
+     */
+    @ApiOperation("删除流程记录")
+    //@PreAuthorize("@ss.hasPermi('biz:fr:remove')")
+    @Log(title = "流程记录", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{recordIds}")
+    public AjaxResult remove(@PathVariable Long[] recordIds)
+    {
+        return toAjax(flowsRecordService.deleteFlowsRecordByRecordIds(recordIds));
+    }
+}

+ 29 - 33
jjt-admin/src/main/java/com/jjt/biz/controller/HouseConfigController.java

@@ -1,28 +1,22 @@
 package com.jjt.biz.controller;
 
-import java.util.List;
-import javax.annotation.Resource;
-import javax.servlet.http.HttpServletResponse;
-
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import com.jjt.biz.domain.HouseConfig;
+import com.jjt.biz.service.IHouseConfigService;
 import com.jjt.common.annotation.Log;
 import com.jjt.common.core.controller.BaseController;
 import com.jjt.common.core.domain.AjaxResult;
+import com.jjt.common.core.page.TableDataInfo;
 import com.jjt.common.enums.BusinessType;
-import com.jjt.biz.domain.HouseConfig;
-import com.jjt.biz.service.IHouseConfigService;
+import com.jjt.common.utils.SecurityUtils;
 import com.jjt.common.utils.poi.ExcelUtil;
-import com.jjt.common.core.page.TableDataInfo;
+import com.jjt.system.service.ISysDeptService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
 
 /**
  * 仓库配置Controller
@@ -30,12 +24,14 @@ import com.jjt.common.core.page.TableDataInfo;
  * @author wukai
  * @date 2025-10-11
  */
-@Api(tags="仓库配置")
+@Api(tags = "仓库配置")
 @RestController
 @RequestMapping("/biz/houseConfig")
-public class HouseConfigController extends BaseController{
+public class HouseConfigController extends BaseController {
     @Resource
     private IHouseConfigService houseConfigService;
+    @Resource
+    private ISysDeptService deptService;
 
     /**
      * 查询仓库配置列表
@@ -43,8 +39,7 @@ public class HouseConfigController extends BaseController{
     @ApiOperation("查询仓库配置列表")
     //@PreAuthorize("@ss.hasPermi('biz:houseConfig:list')")
     @GetMapping("/list")
-    public TableDataInfo list(HouseConfig houseConfig)
-    {
+    public TableDataInfo list(HouseConfig houseConfig) {
         startPage();
         List<HouseConfig> list = houseConfigService.selectHouseConfigList(houseConfig);
         return getDataTable(list);
@@ -57,8 +52,7 @@ public class HouseConfigController extends BaseController{
     //@PreAuthorize("@ss.hasPermi('biz:houseConfig:export')")
     @Log(title = "仓库配置", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
-    public void export(HttpServletResponse response, HouseConfig houseConfig)
-    {
+    public void export(HttpServletResponse response, HouseConfig houseConfig) {
         List<HouseConfig> list = houseConfigService.selectHouseConfigList(houseConfig);
         ExcelUtil<HouseConfig> util = new ExcelUtil<HouseConfig>(HouseConfig.class);
         util.exportExcel(response, list, "仓库配置数据");
@@ -70,8 +64,7 @@ public class HouseConfigController extends BaseController{
     @ApiOperation("获取仓库配置详细信息")
     //@PreAuthorize("@ss.hasPermi('biz:houseConfig:query')")
     @GetMapping(value = "/{houseId}")
-    public AjaxResult getInfo(@PathVariable("houseId") Long houseId)
-    {
+    public AjaxResult getInfo(@PathVariable("houseId") Long houseId) {
         return success(houseConfigService.selectHouseConfigByHouseId(houseId));
     }
 
@@ -82,8 +75,7 @@ public class HouseConfigController extends BaseController{
     //@PreAuthorize("@ss.hasPermi('biz:houseConfig:add')")
     @Log(title = "仓库配置", businessType = BusinessType.INSERT)
     @PostMapping
-    public AjaxResult add(@RequestBody HouseConfig houseConfig)
-    {
+    public AjaxResult add(@RequestBody HouseConfig houseConfig) {
         return toAjax(houseConfigService.insertHouseConfig(houseConfig));
     }
 
@@ -94,8 +86,7 @@ public class HouseConfigController extends BaseController{
     //@PreAuthorize("@ss.hasPermi('biz:houseConfig:edit')")
     @Log(title = "仓库配置", businessType = BusinessType.UPDATE)
     @PutMapping
-    public AjaxResult edit(@RequestBody HouseConfig houseConfig)
-    {
+    public AjaxResult edit(@RequestBody HouseConfig houseConfig) {
         return toAjax(houseConfigService.updateHouseConfig(houseConfig));
     }
 
@@ -105,9 +96,14 @@ public class HouseConfigController extends BaseController{
     @ApiOperation("删除仓库配置")
     //@PreAuthorize("@ss.hasPermi('biz:houseConfig:remove')")
     @Log(title = "仓库配置", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{houseIds}")
-    public AjaxResult remove(@PathVariable Long[] houseIds)
-    {
+    @DeleteMapping("/{houseIds}")
+    public AjaxResult remove(@PathVariable Long[] houseIds) {
         return toAjax(houseConfigService.deleteHouseConfigByHouseIds(houseIds));
     }
+
+    @GetMapping("/deptTree")
+    public AjaxResult deptTree() {
+        Long deptId = SecurityUtils.getLoginUser().getDeptId();
+        return success(deptService.selectDeptTreeList(deptId));
+    }
 }

+ 49 - 0
jjt-admin/src/main/java/com/jjt/biz/domain/FlowsConfig.java

@@ -0,0 +1,49 @@
+package com.jjt.biz.domain;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.jjt.common.annotation.Excel;
+import com.jjt.common.core.domain.BaseEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * 流程管理对象 flows_config
+ *
+ * @author wukai
+ * @date 2025-10-14
+ */
+@ApiModel(value = "FlowsConfig", description = "流程管理")
+@Data
+public class FlowsConfig extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 流程ID
+     */
+    @ApiModelProperty("流程ID")
+    @Excel(name = "流程ID")
+    @TableId
+    private Long flowsId;
+
+    /**
+     * 流程名称
+     */
+    @ApiModelProperty("流程名称")
+    @Excel(name = "流程名称")
+    private String flowsName;
+
+    /**
+     * 仓库名称标识
+     */
+    @ApiModelProperty("仓库名称标识")
+    @Excel(name = "仓库名称标识")
+    private String houseId;
+
+    /**
+     * 区域/位置标识
+     */
+    @ApiModelProperty("区域/位置标识")
+    @Excel(name = "区域/位置标识")
+    private String areaId;
+}

+ 122 - 0
jjt-admin/src/main/java/com/jjt/biz/domain/FlowsRecord.java

@@ -0,0 +1,122 @@
+package com.jjt.biz.domain;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.jjt.common.annotation.Excel;
+import com.jjt.common.core.domain.BaseEntity;
+
+/**
+ * 流程记录对象 flows_record
+ *
+ * @author wukai
+ * @date 2025-10-14
+ */
+@ApiModel(value = "FlowsRecord", description = "流程记录")
+public class FlowsRecord extends BaseEntity{
+    private static final long serialVersionUID = 1L;
+
+    /** 记录ID */
+    @ApiModelProperty("记录ID")
+    @TableId
+    private Long recordId;
+
+    /** 流程名称 */
+    @ApiModelProperty("流程名称")
+    @Excel(name = "流程名称")
+    private String flowsName;
+
+    /** 仓库名称 */
+    @ApiModelProperty("仓库名称")
+    @Excel(name = "仓库名称")
+    private String house;
+
+    /** 区域位置 */
+    @ApiModelProperty("区域位置")
+    @Excel(name = "区域位置")
+    private String area;
+
+    /** 状态 */
+    @ApiModelProperty("状态")
+    @Excel(name = "状态")
+    private String status;
+
+    /** 跳转链接 */
+    @ApiModelProperty("跳转链接")
+    @Excel(name = "跳转链接")
+    private String journeyUrl;
+
+    public void setRecordId(Long recordId)
+    {
+        this.recordId = recordId;
+    }
+
+    public Long getRecordId()
+    {
+        return recordId;
+    }
+    public void setFlowsName(String flowsName)
+    {
+        this.flowsName = flowsName;
+    }
+
+    public String getFlowsName()
+    {
+        return flowsName;
+    }
+    public void setHouse(String house)
+    {
+        this.house = house;
+    }
+
+    public String getHouse()
+    {
+        return house;
+    }
+    public void setArea(String area)
+    {
+        this.area = area;
+    }
+
+    public String getArea()
+    {
+        return area;
+    }
+    public void setStatus(String status)
+    {
+        this.status = status;
+    }
+
+    public String getStatus()
+    {
+        return status;
+    }
+    public void setJourneyUrl(String journeyUrl)
+    {
+        this.journeyUrl = journeyUrl;
+    }
+
+    public String getJourneyUrl()
+    {
+        return journeyUrl;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("recordId", getRecordId())
+            .append("flowsName", getFlowsName())
+            .append("house", getHouse())
+            .append("area", getArea())
+            .append("status", getStatus())
+            .append("journeyUrl", getJourneyUrl())
+            .append("createBy", getCreateBy())
+            .append("createTime", getCreateTime())
+            .append("updateBy", getUpdateBy())
+            .append("updateTime", getUpdateTime())
+            .append("remark", getRemark())
+            .toString();
+    }
+}

+ 62 - 0
jjt-admin/src/main/java/com/jjt/biz/mapper/FlowsConfigMapper.java

@@ -0,0 +1,62 @@
+package com.jjt.biz.mapper;
+
+import java.util.List;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.jjt.biz.domain.FlowsConfig;
+
+/**
+ * 流程管理Mapper接口
+ * 
+ * @author wukai
+ * @date 2025-10-14
+ */
+public interface FlowsConfigMapper extends BaseMapper<FlowsConfig>
+{
+    /**
+     * 查询流程管理
+     * 
+     * @param flowsId 流程管理主键
+     * @return 流程管理
+     */
+    public FlowsConfig selectFlowsConfigByFlowsId(Long flowsId);
+
+    /**
+     * 查询流程管理列表
+     * 
+     * @param flowsConfig 流程管理
+     * @return 流程管理集合
+     */
+    public List<FlowsConfig> selectFlowsConfigList(FlowsConfig flowsConfig);
+
+    /**
+     * 新增流程管理
+     * 
+     * @param flowsConfig 流程管理
+     * @return 结果
+     */
+    public int insertFlowsConfig(FlowsConfig flowsConfig);
+
+    /**
+     * 修改流程管理
+     * 
+     * @param flowsConfig 流程管理
+     * @return 结果
+     */
+    public int updateFlowsConfig(FlowsConfig flowsConfig);
+
+    /**
+     * 删除流程管理
+     * 
+     * @param flowsId 流程管理主键
+     * @return 结果
+     */
+    public int deleteFlowsConfigByFlowsId(Long flowsId);
+
+    /**
+     * 批量删除流程管理
+     * 
+     * @param flowsIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteFlowsConfigByFlowsIds(Long[] flowsIds);
+}

+ 62 - 0
jjt-admin/src/main/java/com/jjt/biz/mapper/FlowsRecordMapper.java

@@ -0,0 +1,62 @@
+package com.jjt.biz.mapper;
+
+import java.util.List;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.jjt.biz.domain.FlowsRecord;
+
+/**
+ * 流程记录Mapper接口
+ * 
+ * @author wukai
+ * @date 2025-10-14
+ */
+public interface FlowsRecordMapper extends BaseMapper<FlowsRecord>
+{
+    /**
+     * 查询流程记录
+     * 
+     * @param recordId 流程记录主键
+     * @return 流程记录
+     */
+    public FlowsRecord selectFlowsRecordByRecordId(Long recordId);
+
+    /**
+     * 查询流程记录列表
+     * 
+     * @param flowsRecord 流程记录
+     * @return 流程记录集合
+     */
+    public List<FlowsRecord> selectFlowsRecordList(FlowsRecord flowsRecord);
+
+    /**
+     * 新增流程记录
+     * 
+     * @param flowsRecord 流程记录
+     * @return 结果
+     */
+    public int insertFlowsRecord(FlowsRecord flowsRecord);
+
+    /**
+     * 修改流程记录
+     * 
+     * @param flowsRecord 流程记录
+     * @return 结果
+     */
+    public int updateFlowsRecord(FlowsRecord flowsRecord);
+
+    /**
+     * 删除流程记录
+     * 
+     * @param recordId 流程记录主键
+     * @return 结果
+     */
+    public int deleteFlowsRecordByRecordId(Long recordId);
+
+    /**
+     * 批量删除流程记录
+     * 
+     * @param recordIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteFlowsRecordByRecordIds(Long[] recordIds);
+}

+ 5 - 5
jjt-admin/src/main/java/com/jjt/biz/mqtt/MqttSubscriber.java

@@ -52,7 +52,7 @@ public class MqttSubscriber {
     private static final String BROKER = "tcp://47.109.90.136:1883";
     private static final String TOPIC = "/wh/house/#";
     private static final String CLIENT_ID = "JJT_MQTT_SENSOR_CLIENT";
-    
+
     // 添加重连标志
     private final AtomicBoolean reconnecting = new AtomicBoolean(false);
 
@@ -63,7 +63,7 @@ public class MqttSubscriber {
             connectWithRetry();
         });
     }
-    
+
     /**
      * 带重试机制的连接方法
      */
@@ -82,7 +82,7 @@ public class MqttSubscriber {
                         // 忽略关闭异常
                     }
                 }
-                
+
                 client = new MqttClient(BROKER, CLIENT_ID, new MemoryPersistence());
                 MqttConnectOptions options = new MqttConnectOptions();
                 options.setCleanSession(true);
@@ -144,7 +144,7 @@ public class MqttSubscriber {
             }
         }
     }
-    
+
     /**
      * 处理重连
      */
@@ -231,4 +231,4 @@ public class MqttSubscriber {
     public boolean isConnected() {
         return client != null && client.isConnected();
     }
-}
+}

+ 60 - 0
jjt-admin/src/main/java/com/jjt/biz/service/IFlowsConfigService.java

@@ -0,0 +1,60 @@
+package com.jjt.biz.service;
+
+import java.util.List;
+import com.jjt.biz.domain.FlowsConfig;
+
+/**
+ * 流程管理Service接口
+ *
+ * @author wukai
+ * @date 2025-10-14
+ */
+public interface IFlowsConfigService {
+    /**
+     * 查询流程管理
+     *
+     * @param flowsId 流程管理主键
+     * @return 流程管理
+     */
+    public FlowsConfig selectFlowsConfigByFlowsId(Long flowsId);
+
+    /**
+     * 查询流程管理列表
+     *
+     * @param flowsConfig 流程管理
+     * @return 流程管理集合
+     */
+    public List<FlowsConfig> selectFlowsConfigList(FlowsConfig flowsConfig);
+
+    /**
+     * 新增流程管理
+     *
+     * @param flowsConfig 流程管理
+     * @return 结果
+     */
+    public int insertFlowsConfig(FlowsConfig flowsConfig);
+
+    /**
+     * 修改流程管理
+     *
+     * @param flowsConfig 流程管理
+     * @return 结果
+     */
+    public int updateFlowsConfig(FlowsConfig flowsConfig);
+
+    /**
+     * 批量删除流程管理
+     *
+     * @param flowsIds 需要删除的流程管理主键集合
+     * @return 结果
+     */
+    public int deleteFlowsConfigByFlowsIds(Long[] flowsIds);
+
+    /**
+     * 删除流程管理信息
+     *
+     * @param flowsId 流程管理主键
+     * @return 结果
+     */
+    public int deleteFlowsConfigByFlowsId(Long flowsId);
+}

+ 66 - 0
jjt-admin/src/main/java/com/jjt/biz/service/IFlowsRecordService.java

@@ -0,0 +1,66 @@
+package com.jjt.biz.service;
+
+import com.jjt.biz.domain.FlowsRecord;
+
+import java.util.List;
+
+/**
+ * 流程记录Service接口
+ *
+ * @author wukai
+ * @date 2025-10-14
+ */
+public interface IFlowsRecordService {
+    /**
+     * 查询流程记录
+     *
+     * @param recordId 流程记录主键
+     * @return 流程记录
+     */
+    public FlowsRecord selectFlowsRecordByRecordId(Long recordId);
+
+    /**
+     * 查询流程记录列表
+     *
+     * @param flowsRecord 流程记录
+     * @return 流程记录集合
+     */
+    public List<FlowsRecord> selectFlowsRecordList(FlowsRecord flowsRecord);
+
+    /**
+     * 新增流程记录
+     *
+     * @param flowsRecord 流程记录
+     * @return 结果
+     */
+    public int insertFlowsRecord(FlowsRecord flowsRecord);
+
+    /**
+     * 修改流程记录
+     *
+     * @param flowsRecord 流程记录
+     * @return 结果
+     */
+    public int updateFlowsRecord(FlowsRecord flowsRecord);
+
+    /**
+     * 批量删除流程记录
+     *
+     * @param recordIds 需要删除的流程记录主键集合
+     * @return 结果
+     */
+    public int deleteFlowsRecordByRecordIds(Long[] recordIds);
+
+    /**
+     * 删除流程记录信息
+     *
+     * @param recordId 流程记录主键
+     * @return 结果
+     */
+    public int deleteFlowsRecordByRecordId(Long recordId);
+
+    /**
+     * 同步流程记录
+     */
+     void syncFlowsRecord();
+}

+ 88 - 0
jjt-admin/src/main/java/com/jjt/biz/service/impl/FlowsConfigServiceImpl.java

@@ -0,0 +1,88 @@
+package com.jjt.biz.service.impl;
+
+import java.util.List;
+        import com.jjt.common.utils.DateUtils;
+import org.springframework.stereotype.Service;
+import com.jjt.biz.mapper.FlowsConfigMapper;
+import com.jjt.biz.domain.FlowsConfig;
+import com.jjt.biz.service.IFlowsConfigService;
+import javax.annotation.Resource;
+
+/**
+ * 流程管理Service业务层处理
+ *
+ * @author wukai
+ * @date 2025-10-14
+ */
+@Service
+public class FlowsConfigServiceImpl implements IFlowsConfigService {
+    @Resource
+    private FlowsConfigMapper flowsConfigMapper;
+
+    /**
+     * 查询流程管理
+     *
+     * @param flowsId 流程管理主键
+     * @return 流程管理
+     */
+    @Override
+    public FlowsConfig selectFlowsConfigByFlowsId(Long flowsId) {
+        return flowsConfigMapper.selectFlowsConfigByFlowsId(flowsId);
+    }
+
+    /**
+     * 查询流程管理列表
+     *
+     * @param flowsConfig 流程管理
+     * @return 流程管理
+     */
+    @Override
+    public List<FlowsConfig> selectFlowsConfigList(FlowsConfig flowsConfig) {
+        return flowsConfigMapper.selectFlowsConfigList(flowsConfig);
+    }
+
+    /**
+     * 新增流程管理
+     *
+     * @param flowsConfig 流程管理
+     * @return 结果
+     */
+    @Override
+    public int insertFlowsConfig(FlowsConfig flowsConfig) {
+                flowsConfig.setCreateTime(DateUtils.getNowDate());
+            return flowsConfigMapper.insertFlowsConfig(flowsConfig);
+    }
+
+    /**
+     * 修改流程管理
+     *
+     * @param flowsConfig 流程管理
+     * @return 结果
+     */
+    @Override
+    public int updateFlowsConfig(FlowsConfig flowsConfig) {
+        return flowsConfigMapper.updateFlowsConfig(flowsConfig);
+    }
+
+    /**
+     * 批量删除流程管理
+     *
+     * @param flowsIds 需要删除的流程管理主键
+     * @return 结果
+     */
+    @Override
+    public int deleteFlowsConfigByFlowsIds(Long[] flowsIds) {
+        return flowsConfigMapper.deleteFlowsConfigByFlowsIds(flowsIds);
+    }
+
+    /**
+     * 删除流程管理信息
+     *
+     * @param flowsId 流程管理主键
+     * @return 结果
+     */
+    @Override
+    public int deleteFlowsConfigByFlowsId(Long flowsId) {
+        return flowsConfigMapper.deleteFlowsConfigByFlowsId(flowsId);
+    }
+}

+ 166 - 0
jjt-admin/src/main/java/com/jjt/biz/service/impl/FlowsRecordServiceImpl.java

@@ -0,0 +1,166 @@
+package com.jjt.biz.service.impl;
+
+import cn.hutool.json.JSONArray;
+import cn.hutool.json.JSONObject;
+import com.jjt.biz.domain.FlowsConfig;
+import com.jjt.biz.domain.FlowsRecord;
+import com.jjt.biz.mapper.FlowsRecordMapper;
+import com.jjt.biz.service.IFlowsConfigService;
+import com.jjt.biz.service.IFlowsRecordService;
+import com.jjt.biz.utils.FlowsUtils;
+import com.jjt.common.utils.DateUtils;
+import org.apache.ibatis.session.ExecutorType;
+import org.apache.ibatis.session.SqlSession;
+import org.apache.ibatis.session.SqlSessionFactory;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.time.OffsetDateTime;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Objects;
+
+/**
+ * 流程记录Service业务层处理
+ *
+ * @author wukai
+ * @date 2025-10-14
+ */
+@Service
+public class FlowsRecordServiceImpl implements IFlowsRecordService {
+    @Resource
+    private FlowsRecordMapper flowsRecordMapper;
+    @Resource
+    private IFlowsConfigService flowsConfigService;
+    @Resource
+    private SqlSessionFactory factory;
+
+    /**
+     * 查询流程记录
+     *
+     * @param recordId 流程记录主键
+     * @return 流程记录
+     */
+    @Override
+    public FlowsRecord selectFlowsRecordByRecordId(Long recordId) {
+        return flowsRecordMapper.selectFlowsRecordByRecordId(recordId);
+    }
+
+    /**
+     * 查询流程记录列表
+     *
+     * @param flowsRecord 流程记录
+     * @return 流程记录
+     */
+    @Override
+    public List<FlowsRecord> selectFlowsRecordList(FlowsRecord flowsRecord) {
+        return flowsRecordMapper.selectFlowsRecordList(flowsRecord);
+    }
+
+    /**
+     * 新增流程记录
+     *
+     * @param flowsRecord 流程记录
+     * @return 结果
+     */
+    @Override
+    public int insertFlowsRecord(FlowsRecord flowsRecord) {
+        flowsRecord.setCreateTime(DateUtils.getNowDate());
+        return flowsRecordMapper.insertFlowsRecord(flowsRecord);
+    }
+
+    /**
+     * 修改流程记录
+     *
+     * @param flowsRecord 流程记录
+     * @return 结果
+     */
+    @Override
+    public int updateFlowsRecord(FlowsRecord flowsRecord) {
+        flowsRecord.setUpdateTime(DateUtils.getNowDate());
+        return flowsRecordMapper.updateFlowsRecord(flowsRecord);
+    }
+
+    /**
+     * 批量删除流程记录
+     *
+     * @param recordIds 需要删除的流程记录主键
+     * @return 结果
+     */
+    @Override
+    public int deleteFlowsRecordByRecordIds(Long[] recordIds) {
+        return flowsRecordMapper.deleteFlowsRecordByRecordIds(recordIds);
+    }
+
+    /**
+     * 删除流程记录信息
+     *
+     * @param recordId 流程记录主键
+     * @return 结果
+     */
+    @Override
+    public int deleteFlowsRecordByRecordId(Long recordId) {
+        return flowsRecordMapper.deleteFlowsRecordByRecordId(recordId);
+    }
+
+    /**
+     * 同步流程记录
+     */
+    @Override
+    public void syncFlowsRecord() {
+        Date end = new Date();
+        List<FlowsConfig> flowsConfigList = flowsConfigService.selectFlowsConfigList(new FlowsConfig());
+        for (FlowsConfig flowsConfig : flowsConfigList) {
+            JSONArray array = FlowsUtils.query(flowsConfig.getFlowsId(), flowsConfig.getUpdateTime(), end, "");
+            List<FlowsRecord> insertList = new ArrayList<>();
+            for (int i = 0; i < Objects.requireNonNull(array).size(); i++) {
+                JSONObject object = array.getJSONObject(i);
+                long id = object.getLong("id");
+                String status = object.getStr("status");
+                String time = object.getStr("created_at");
+                String journeyUrl = object.getStr("journey_url");
+                cn.hutool.json.JSONObject cache = object.getJSONObject("response").getJSONObject("cached_values");
+
+                String house = "";
+                String area = "";
+                if (cache.containsKey(flowsConfig.getHouseId()) && cache.getJSONObject(flowsConfig.getHouseId()) != null
+                        && cache.getJSONObject(flowsConfig.getHouseId()).containsKey("value") && cache.getJSONObject(flowsConfig.getHouseId()).getJSONArray("value") != null
+                        && cache.getJSONObject(flowsConfig.getHouseId()).getJSONArray("value").size() > 0) {
+                    house = cache.getJSONObject(flowsConfig.getHouseId()).getJSONArray("value").getStr(0);
+                }
+                if (cache.containsKey(flowsConfig.getAreaId()) && cache.getJSONObject(flowsConfig.getAreaId()) != null
+                        && cache.getJSONObject(flowsConfig.getAreaId()).containsKey("value") && cache.getJSONObject(flowsConfig.getAreaId()).getJSONArray("value") != null
+                        && cache.getJSONObject(flowsConfig.getAreaId()).getJSONArray("value").size() > 0) {
+                    area = cache.getJSONObject(flowsConfig.getAreaId()).getJSONArray("value").getStr(0);
+                }
+                String name = object.getJSONObject("user").getStr("name");
+                FlowsRecord flowsRecord = new FlowsRecord();
+                flowsRecord.setRecordId(id);
+                flowsRecord.setStatus(status);
+                java.time.OffsetDateTime offsetDateTime = OffsetDateTime.parse(time);
+                Date date = Date.from(offsetDateTime.toInstant());
+                flowsRecord.setCreateTime(date);
+                flowsRecord.setHouse(house);
+                flowsRecord.setArea(area);
+                flowsRecord.setJourneyUrl(journeyUrl);
+                flowsRecord.setCreateBy(name);
+                flowsRecord.setUpdateBy(flowsConfig.getFlowsId() + "");
+                insertList.add(flowsRecord);
+            }
+            batchInsert(insertList);
+            flowsConfig.setUpdateTime(end);
+            flowsConfigService.updateFlowsConfig(flowsConfig);
+        }
+    }
+
+    private void batchInsert(List<FlowsRecord> list) {
+        try (SqlSession sqlSession = factory.openSession(ExecutorType.BATCH, false)) {
+            if (list.size() > 0) {
+                FlowsRecordMapper mapper = sqlSession.getMapper(FlowsRecordMapper.class);
+                list.forEach(mapper::insertFlowsRecord);
+                sqlSession.commit();
+            }
+        }
+    }
+}

+ 22 - 0
jjt-admin/src/main/java/com/jjt/biz/task/FlowTask.java

@@ -0,0 +1,22 @@
+package com.jjt.biz.task;
+
+import com.jjt.biz.service.IFlowsRecordService;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.Resource;
+
+/**
+ * 统计定时任务
+ *
+ * @author wukai
+ * @date 2025-1-17 23:27:26
+ */
+@Component("flow")
+public class FlowTask {
+    @Resource
+    private IFlowsRecordService service;
+
+    public void sync() {
+        service.syncFlowsRecord();
+    }
+}

+ 74 - 8
jjt-admin/src/main/java/com/jjt/biz/utils/FlowsUtils.java

@@ -8,6 +8,8 @@ import com.alibaba.fastjson2.JSONObject;
 import com.jjt.common.utils.DateUtils;
 
 import java.nio.charset.StandardCharsets;
+import java.time.OffsetDateTime;
+import java.util.Date;
 
 /**
  * FlowsUtils$
@@ -20,13 +22,74 @@ public class FlowsUtils {
     private static final String FLOWS_TOKEN = "dce1648c820982b7903a5e8efc315020a5a43aca06e43859b0bad0ee2fd58bac:eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJuYW1lc3BhY2VfaWQiOjN9.AJaMbpfZxoJ1hoLKR1hE6juBmUQT8N7HP6ROgcHKTcg";
 
     public static void main(String[] args) {
+        // 将 ISO 8601 格式字符串转换为 Date 对象
+        String isoDateString = "2025-09-17T18:50:56.722+08:00";
+//        / 使用 OffsetDateTime 解析
+        java.time.OffsetDateTime offsetDateTime = OffsetDateTime.parse(isoDateString);
+        Date date = Date.from(offsetDateTime.toInstant());
+        System.out.println("转换后的日期: " + DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, date));
+
+        Date start = DateUtils.parseDate("2025-01-01 10:00:00");
+        cn.hutool.json.JSONArray array = query(189L, start, new Date(), "");
+        for (int i = 0; i < array.size(); i++) {
+            cn.hutool.json.JSONObject object = array.getJSONObject(i);
+            int id = object.getInt("id");
+            String status = object.getStr("status");
+            String time = object.getStr("created_at");
+            String journeyUrl = object.getStr("journey_url");
+            cn.hutool.json.JSONObject cache = object.getJSONObject("response").getJSONObject("cached_values");
+            String house = cache.getJSONObject("636").getJSONArray("value").getStr(0);
+            String area = cache.getJSONObject("638").getJSONArray("value").getStr(0);
+            System.err.println("ID: " + id + ", Status: " + status + ", Time: " + time + ", Journey URL: " + journeyUrl + ", House: " + house + ", Area: " + area);
+        }
+    }
 
+    public static cn.hutool.json.JSONArray query(Long flowId, Date start, Date end, String query) {
+//        ,"641": "成都支撑中心"
+        String uri = FLOWS_URL + "/api/v4/yaw/flows/" + flowId + "/journeys/search";
+        String body = "{" +
+                "    \"query\": {" +
+                "         \"-12\": {" +
+                "             \"lft\": \"%s\"," +
+                "             \"rgt\": \"%s\"" +
+                "         }" +
+                "         %s" +
+                "    }," +
+                "    \"page\": 1," +
+                "    \"per_page\": 100" +
+                "}";
+        body = String.format(body, DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, start), DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, end), query);
+        HttpRequest request = HttpRequest.get(uri);
+        request.header("Authorization", FLOWS_TOKEN);
+        request.body(body);
+        try (HttpResponse res = request.execute()) {
+            System.err.println("响应状态码: " + res.getStatus());
+            if (!res.isOk()) {
+                String errorMsg = new String(res.bodyBytes(), StandardCharsets.UTF_8);
+                System.err.println("错误响应内容: " + errorMsg);
+                throw new RuntimeException("请求失败,状态码: " + res.getStatus() + ",错误信息: " + errorMsg);
+            }
+            String result = new String(res.bodyBytes(), StandardCharsets.UTF_8);
+            cn.hutool.json.JSONArray jsonArray = JSONUtil.parseArray(result, true);
+            return jsonArray;
+        } catch (Exception e) {
+            System.err.println("请求发生异常: " + e.getMessage());
+            e.printStackTrace();
+            return null;
+        }
     }
 
+    /**
+     * 创建流程任务
+     *
+     * @param house 仓库
+     * @param value
+     */
+
     public static void create(String house, String value) {
         String uri = FLOWS_URL + "/api/v4/yaw/flows/191/journeys";
         HttpRequest request = HttpRequest.post(uri);
-        request.header("Authorization", "dce1648c820982b7903a5e8efc315020a5a43aca06e43859b0bad0ee2fd58bac:eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJuYW1lc3BhY2VfaWQiOjN9.AJaMbpfZxoJ1hoLKR1hE6juBmUQT8N7HP6ROgcHKTcg");
+        request.header("Authorization", FLOWS_TOKEN);
         String success = "SUCCESS";
         // 设置请求体 - 使用更明确的方式
         request.body(body(house, value));
@@ -47,16 +110,19 @@ public class FlowsUtils {
         }
     }
 
+    /**
+     * 发布任务
+     */
     public static void publish() {
         String uri = FLOWS_URL + "/api/v4/yaw/flows/191/journeys";
         HttpRequest request = HttpRequest.post(uri);
-        request.header("Authorization", "dce1648c820982b7903a5e8efc315020a5a43aca06e43859b0bad0ee2fd58bac:eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJuYW1lc3BhY2VfaWQiOjN9.AJaMbpfZxoJ1hoLKR1hE6juBmUQT8N7HP6ROgcHKTcg");
-        request.body("{\n" +
-                "  \"assignment\": {\n" +
-                "    \"operation\": \"propose\",\n" +
-                "    \"next_vertex_id\": 954   \n" +
-                "  },\n" +
-                "  \"user_id\": 66\n" +
+        request.header("Authorization", FLOWS_TOKEN);
+        request.body("{" +
+                "  \"assignment\": {" +
+                "    \"operation\": \"propose\"," +
+                "    \"next_vertex_id\": 954   " +
+                "  }," +
+                "  \"user_id\": 66" +
                 "}");
         try (HttpResponse res = request.execute()) {
             System.err.println("响应状态码: " + res.getStatus());

+ 2 - 2
jjt-admin/src/main/resources/application-prod.yml

@@ -41,7 +41,7 @@ spring:
   # redis 配置
   redis:
     # 地址
-    host: 47.109.90.136
+    host: 127.0.0.1
     # 端口,默认为6379
     port: 6379
     # 数据库索引
@@ -66,7 +66,7 @@ spring:
     druid:
       # 主库数据源
       master:
-        url: jdbc:mysql://47.109.90.136:3306/warehouse?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+        url: jdbc:mysql://127.0.0.1:3306/warehouse?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
         username: root
         password: JJT@2025!yd
       # 从库数据源

+ 89 - 0
jjt-admin/src/main/resources/mapper/biz/FlowsConfigMapper.xml

@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.jjt.biz.mapper.FlowsConfigMapper">
+    
+    <resultMap type="FlowsConfig" id="FlowsConfigResult">
+        <result property="flowsId"    column="FLOWS_ID"    />
+        <result property="flowsName"    column="FLOWS_NAME"    />
+        <result property="houseId"    column="HOUSE_ID"    />
+        <result property="areaId"    column="AREA_ID"    />
+        <result property="createBy"    column="CREATE_BY"    />
+        <result property="createTime"    column="CREATE_TIME"    />
+        <result property="updateBy"    column="UPDATE_BY"    />
+        <result property="updateTime"    column="UPDATE_TIME"    />
+        <result property="remark"    column="REMARK"    />
+    </resultMap>
+
+    <sql id="selectFlowsConfigVo">
+        select FLOWS_ID, FLOWS_NAME, HOUSE_ID, AREA_ID, CREATE_BY, CREATE_TIME, UPDATE_BY, UPDATE_TIME, REMARK from flows_config
+    </sql>
+
+    <select id="selectFlowsConfigList" parameterType="FlowsConfig" resultMap="FlowsConfigResult">
+        <include refid="selectFlowsConfigVo"/>
+        <where>  
+            <if test="flowsId != null "> and FLOWS_ID = #{flowsId}</if>
+            <if test="flowsName != null  and flowsName != ''"> and FLOWS_NAME like concat('%', #{flowsName}, '%')</if>
+            <if test="houseId != null "> and HOUSE_ID = #{houseId}</if>
+            <if test="areaId != null "> and AREA_ID = #{areaId}</if>
+        </where>
+    </select>
+    
+    <select id="selectFlowsConfigByFlowsId" parameterType="Long" resultMap="FlowsConfigResult">
+        <include refid="selectFlowsConfigVo"/>
+        where FLOWS_ID = #{flowsId}
+    </select>
+
+    <insert id="insertFlowsConfig" parameterType="FlowsConfig">
+        insert into flows_config
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="flowsId != null">FLOWS_ID,</if>
+            <if test="flowsName != null and flowsName != ''">FLOWS_NAME,</if>
+            <if test="houseId != null">HOUSE_ID,</if>
+            <if test="areaId != null">AREA_ID,</if>
+            <if test="createBy != null">CREATE_BY,</if>
+            <if test="createTime != null">CREATE_TIME,</if>
+            <if test="updateBy != null">UPDATE_BY,</if>
+            <if test="updateTime != null">UPDATE_TIME,</if>
+            <if test="remark != null">REMARK,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="flowsId != null">#{flowsId},</if>
+            <if test="flowsName != null and flowsName != ''">#{flowsName},</if>
+            <if test="houseId != null">#{houseId},</if>
+            <if test="areaId != null">#{areaId},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="remark != null">#{remark},</if>
+         </trim>
+    </insert>
+
+    <update id="updateFlowsConfig" parameterType="FlowsConfig">
+        update flows_config
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="flowsName != null and flowsName != ''">FLOWS_NAME = #{flowsName},</if>
+            <if test="houseId != null">HOUSE_ID = #{houseId},</if>
+            <if test="areaId != null">AREA_ID = #{areaId},</if>
+            <if test="createBy != null">CREATE_BY = #{createBy},</if>
+            <if test="createTime != null">CREATE_TIME = #{createTime},</if>
+            <if test="updateBy != null">UPDATE_BY = #{updateBy},</if>
+            <if test="updateTime != null">UPDATE_TIME = #{updateTime},</if>
+            <if test="remark != null">REMARK = #{remark},</if>
+        </trim>
+        where FLOWS_ID = #{flowsId}
+    </update>
+
+    <delete id="deleteFlowsConfigByFlowsId" parameterType="Long">
+        delete from flows_config where FLOWS_ID = #{flowsId}
+    </delete>
+
+    <delete id="deleteFlowsConfigByFlowsIds" parameterType="String">
+        delete from flows_config where FLOWS_ID in 
+        <foreach item="flowsId" collection="array" open="(" separator="," close=")">
+            #{flowsId}
+        </foreach>
+    </delete>
+</mapper>

+ 98 - 0
jjt-admin/src/main/resources/mapper/biz/FlowsRecordMapper.xml

@@ -0,0 +1,98 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.jjt.biz.mapper.FlowsRecordMapper">
+    
+    <resultMap type="FlowsRecord" id="FlowsRecordResult">
+        <result property="recordId"    column="RECORD_ID"    />
+        <result property="flowsName"    column="FLOWS_NAME"    />
+        <result property="house"    column="HOUSE"    />
+        <result property="area"    column="AREA"    />
+        <result property="status"    column="STATUS"    />
+        <result property="journeyUrl"    column="JOURNEY_URL"    />
+        <result property="createBy"    column="CREATE_BY"    />
+        <result property="createTime"    column="CREATE_TIME"    />
+        <result property="updateBy"    column="UPDATE_BY"    />
+        <result property="updateTime"    column="UPDATE_TIME"    />
+        <result property="remark"    column="REMARK"    />
+    </resultMap>
+
+    <sql id="selectFlowsRecordVo">
+        select RECORD_ID, FLOWS_NAME, HOUSE, AREA, STATUS, JOURNEY_URL, CREATE_BY, CREATE_TIME, UPDATE_BY, UPDATE_TIME, REMARK from flows_record
+    </sql>
+
+    <select id="selectFlowsRecordList" parameterType="FlowsRecord" resultMap="FlowsRecordResult">
+        <include refid="selectFlowsRecordVo"/>
+        <where>  
+            <if test="flowsName != null  and flowsName != ''"> and FLOWS_NAME like concat('%', #{flowsName}, '%')</if>
+            <if test="house != null  and house != ''"> and HOUSE = #{house}</if>
+            <if test="area != null  and area != ''"> and AREA = #{area}</if>
+            <if test="status != null  and status != ''"> and STATUS = #{status}</if>
+            <if test="journeyUrl != null  and journeyUrl != ''"> and JOURNEY_URL = #{journeyUrl}</if>
+        </where>
+    </select>
+    
+    <select id="selectFlowsRecordByRecordId" parameterType="Long" resultMap="FlowsRecordResult">
+        <include refid="selectFlowsRecordVo"/>
+        where RECORD_ID = #{recordId}
+    </select>
+
+    <insert id="insertFlowsRecord" parameterType="FlowsRecord">
+        insert into flows_record
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="recordId != null">RECORD_ID,</if>
+            <if test="flowsName != null">FLOWS_NAME,</if>
+            <if test="house != null">HOUSE,</if>
+            <if test="area != null">AREA,</if>
+            <if test="status != null">STATUS,</if>
+            <if test="journeyUrl != null">JOURNEY_URL,</if>
+            <if test="createBy != null">CREATE_BY,</if>
+            <if test="createTime != null">CREATE_TIME,</if>
+            <if test="updateBy != null">UPDATE_BY,</if>
+            <if test="updateTime != null">UPDATE_TIME,</if>
+            <if test="remark != null">REMARK,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="recordId != null">#{recordId},</if>
+            <if test="flowsName != null">#{flowsName},</if>
+            <if test="house != null">#{house},</if>
+            <if test="area != null">#{area},</if>
+            <if test="status != null">#{status},</if>
+            <if test="journeyUrl != null">#{journeyUrl},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="remark != null">#{remark},</if>
+         </trim>
+    </insert>
+
+    <update id="updateFlowsRecord" parameterType="FlowsRecord">
+        update flows_record
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="flowsName != null">FLOWS_NAME = #{flowsName},</if>
+            <if test="house != null">HOUSE = #{house},</if>
+            <if test="area != null">AREA = #{area},</if>
+            <if test="status != null">STATUS = #{status},</if>
+            <if test="journeyUrl != null">JOURNEY_URL = #{journeyUrl},</if>
+            <if test="createBy != null">CREATE_BY = #{createBy},</if>
+            <if test="createTime != null">CREATE_TIME = #{createTime},</if>
+            <if test="updateBy != null">UPDATE_BY = #{updateBy},</if>
+            <if test="updateTime != null">UPDATE_TIME = #{updateTime},</if>
+            <if test="remark != null">REMARK = #{remark},</if>
+        </trim>
+        where RECORD_ID = #{recordId}
+    </update>
+
+    <delete id="deleteFlowsRecordByRecordId" parameterType="Long">
+        delete from flows_record where RECORD_ID = #{recordId}
+    </delete>
+
+    <delete id="deleteFlowsRecordByRecordIds" parameterType="String">
+        delete from flows_record where RECORD_ID in 
+        <foreach item="recordId" collection="array" open="(" separator="," close=")">
+            #{recordId}
+        </foreach>
+    </delete>
+</mapper>

+ 29 - 0
jjt-admin/src/test/java/com/test/FRTest.java

@@ -0,0 +1,29 @@
+package com.test;
+
+import com.jjt.JjtApplication;
+import com.jjt.biz.service.IFlowsRecordService;
+import org.junit.jupiter.api.Test;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.ActiveProfiles;
+
+import javax.annotation.Resource;
+
+/**
+ * DataTest$
+ *
+ * @author wukai
+ * @date 2025/5/22 17:27
+ */
+@ActiveProfiles("devp")
+@SpringBootTest(classes = JjtApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
+public class FRTest {
+    @Resource
+    private IFlowsRecordService service;
+
+
+    @Test
+    void test() {
+        service.syncFlowsRecord();
+    }
+
+}

+ 1 - 1
jjt-common/src/main/java/com/jjt/common/constant/Constants.java

@@ -163,7 +163,7 @@ public class Constants {
     /**
      * 定时任务白名单配置(仅允许访问的包名,如其他需要可以自行添加)
      */
-    public static final String[] JOB_WHITELIST_STR = {"com.jjt.quartz.task"};
+    public static final String[] JOB_WHITELIST_STR = {"com.jjt.quartz.task", "com.jjt.biz.task"};
 
     /**
      * 定时任务违规的字符

+ 8 - 0
jjt-system/src/main/java/com/jjt/system/service/ISysDeptService.java

@@ -115,6 +115,14 @@ public interface ISysDeptService {
     public int updateDept(SysDept dept);
 
     /**
+     * 查询部门树结构信息
+     *
+     * @param dept 部门信息
+     * @return 部门树信息集合
+     */
+    List<TreeSelect> selectDeptTreeList(Long dept);
+
+    /**
      * 删除部门管理信息
      *
      * @param deptId 部门ID

+ 15 - 0
jjt-system/src/main/java/com/jjt/system/service/impl/SysDeptServiceImpl.java

@@ -256,6 +256,21 @@ public class SysDeptServiceImpl implements ISysDeptService {
     }
 
     /**
+     * 查询部门树结构信息
+     *
+     * @param deptId 部门信息
+     * @return 部门树信息集合
+     */
+    @Override
+    public List<TreeSelect> selectDeptTreeList(Long deptId) {
+        List<SysDept> depts = new ArrayList<>();
+        depts.add(selectDeptById(deptId));
+        depts.addAll(deptMapper.selectChildrenDeptById(deptId));
+        return buildDeptTreeSelect(depts);
+    }
+
+
+    /**
      * 删除部门管理信息
      *
      * @param deptId 部门ID