包头工作流提交

This commit is contained in:
guoshengxiong 2025-04-18 10:07:08 +08:00
parent 786c00c997
commit a952421d78
3 changed files with 28 additions and 1 deletions

View File

@ -4,10 +4,19 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wflow.bean.entity.WflowModelHistorys; import com.wflow.bean.entity.WflowModelHistorys;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/** /**
* @author : willian fu * @author : willian fu
* @date : 2022/8/24 * @date : 2022/8/24
*/ */
@Mapper @Mapper
public interface WflowModelHistorysMapper extends BaseMapper<WflowModelHistorys> { public interface WflowModelHistorysMapper extends BaseMapper<WflowModelHistorys> {
/**
* 查询最新的历史
*
* @param idList
* @return
*/
List<WflowModelHistorys> getNewsVersionList(List<String> idList);
} }

View File

@ -0,0 +1,13 @@
<?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.wflow.mapper.WflowModelHistorysMapper">
<select id="getNewsVersionList" resultType="com.wflow.bean.entity.WflowModelHistorys">
SELECT h1.*
FROM wflow_model_historys h1
join (select max(version) as version from wflow_model_historys group by version)t on t.version=h1.version
WHERE id in
<foreach collection="idList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</select>
</mapper>

View File

@ -8,7 +8,12 @@ import org.springframework.stereotype.Component;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.HashSet;
import java.util.Random; import java.util.Random;
import java.util.Set;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadPoolExecutor;
/** /**
* 添加流程引擎默认配置 * 添加流程引擎默认配置
@ -25,6 +30,6 @@ public class WflowEngineConfigurationConfigurer implements EngineConfigurationCo
engineConfiguration.setActivityBehaviorFactory(new WflowActivityBehaviorFactory()); engineConfiguration.setActivityBehaviorFactory(new WflowActivityBehaviorFactory());
engineConfiguration.setBpmnDeployer(new CustomIdBpmnDeployer()); engineConfiguration.setBpmnDeployer(new CustomIdBpmnDeployer());
//重写flowable的id生成器生成流程实例ID规则为wf+ 日期时间数字 + 4位随机数 //重写flowable的id生成器生成流程实例ID规则为wf+ 日期时间数字 + 4位随机数
engineConfiguration.setIdGenerator(() -> "wf" + LocalDateTime.now().format(formatter) + String.format("%04d", new Random().nextInt(10000))); // engineConfiguration.setIdGenerator(() -> "wf" + LocalDateTime.now().format(formatter) + String.format("%04d", new Random().nextInt(10000)));
} }
} }