提交 87def190 编写于 作者: ibizdev's avatar ibizdev

ibiz4j 发布系统代码

上级 d32da08b
......@@ -24,96 +24,158 @@ import org.springframework.data.annotation.Transient;
import cn.ibizlab.util.annotation.Audit;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.baomidou.mybatisplus.annotation.*;
import cn.ibizlab.util.domain.EntityMP;
/**
* [工作流任务] 对象
* 实体[工作流任务]
*/
@Builder
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class WFTask extends EntityBase implements Serializable {
@JsonIgnoreProperties(value = "handler")
@TableName(value = "IBZTASK",resultMap = "WFTaskResultMap")
public class WFTask extends EntityMP implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 任务标识
*/
@DEField(name = "taskid" , isKeyField=true)
@TableId(value= "taskid",type=IdType.ASSIGN_UUID)
@JSONField(name = "id")
@JsonProperty("id")
private String id;
/**
* 状态
*/
@DEField(name = "taskname")
@TableField(value = "taskname")
@JSONField(name = "name")
@JsonProperty("name")
private String name;
/**
* DefinitionId
*/
@DEField(name = "definitionid")
@JSONField(name = "processDefinitionId")
@JsonProperty("processDefinitionId")
@TableField(value = "definitionid")
@JSONField(name = "processdefinitionid")
@JsonProperty("processdefinitionid")
private String processdefinitionid;
/**
* DefinitionKey
*/
@DEField(name = "definitionkey")
@JSONField(name = "processDefinitionKey")
@JsonProperty("processDefinitionKey")
@TableField(value = "definitionkey")
@JSONField(name = "processdefinitionkey")
@JsonProperty("processdefinitionkey")
private String processdefinitionkey;
/**
* 流程
*/
@DEField(name = "definitionname")
@JSONField(name = "processDefinitionName")
@JsonProperty("processDefinitionName")
@TableField(value = "definitionname")
@JSONField(name = "processdefinitionname")
@JsonProperty("processdefinitionname")
private String processdefinitionname;
/**
* TaskDefinitionKey
*/
@JSONField(name = "taskDefinitionKey")
@JsonProperty("taskDefinitionKey")
@TableField(value = "taskdefinitionkey")
@JSONField(name = "taskdefinitionkey")
@JsonProperty("taskdefinitionkey")
private String taskdefinitionkey;
/**
* 待办事项
*/
@TableField(value = "description")
@JSONField(name = "description")
@JsonProperty("description")
private String description;
/**
* 发起时间
*/
@TableField(value = "createtime")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "createTime" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("createTime")
@JSONField(name = "createtime" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("createtime")
private Timestamp createtime;
/**
* 实例标识
*/
@DEField(name = "instanceid")
@JSONField(name = "processInstanceId")
@JsonProperty("processInstanceId")
@TableField(value = "instanceid")
@JSONField(name = "processinstanceid")
@JsonProperty("processinstanceid")
private String processinstanceid;
/**
* 业务键值
*/
@DEField(name = "businesskey")
@JSONField(name = "processInstanceBusinessKey")
@JsonProperty("processInstanceBusinessKey")
@TableField(value = "businesskey")
@JSONField(name = "processinstancebusinesskey")
@JsonProperty("processinstancebusinesskey")
private String processinstancebusinesskey;
/**
* 设置 [状态]
*/
public void setName(String name){
this.name = name ;
this.modify("taskname",name);
}
/**
* 设置 [DefinitionId]
*/
public void setProcessdefinitionid(String processdefinitionid){
this.processdefinitionid = processdefinitionid ;
this.modify("definitionid",processdefinitionid);
}
/**
* 设置 [DefinitionKey]
*/
public void setProcessdefinitionkey(String processdefinitionkey){
this.processdefinitionkey = processdefinitionkey ;
this.modify("definitionkey",processdefinitionkey);
}
/**
* 设置 [流程]
*/
public void setProcessdefinitionname(String processdefinitionname){
this.processdefinitionname = processdefinitionname ;
this.modify("definitionname",processdefinitionname);
}
/**
* 设置 [TaskDefinitionKey]
*/
public void setTaskdefinitionkey(String taskdefinitionkey){
this.taskdefinitionkey = taskdefinitionkey ;
this.modify("taskdefinitionkey",taskdefinitionkey);
}
/**
* 设置 [待办事项]
*/
public void setDescription(String description){
this.description = description ;
this.modify("description",description);
}
/**
* 设置 [发起时间]
*/
public void setCreatetime(Timestamp createtime){
this.createtime = createtime ;
this.modify("createtime",createtime);
}
/**
* 格式化日期 [发起时间]
......@@ -125,6 +187,23 @@ public class WFTask extends EntityBase implements Serializable {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
return sdf.format(createtime);
}
/**
* 设置 [实例标识]
*/
public void setProcessinstanceid(String processinstanceid){
this.processinstanceid = processinstanceid ;
this.modify("instanceid",processinstanceid);
}
/**
* 设置 [业务键值]
*/
public void setProcessinstancebusinesskey(String processinstancebusinesskey){
this.processinstancebusinesskey = processinstancebusinesskey ;
this.modify("businesskey",processinstancebusinesskey);
}
}
......@@ -17,36 +17,118 @@ import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import cn.ibizlab.util.filter.SearchContextBase;
import cn.ibizlab.util.filter.QueryWrapperContext;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import cn.ibizlab.core.workflow.domain.WFTask;
/**
* ServiceApi数据实体[WFTask] 查询条件对象
* 关系型数据实体[WFTask] 查询条件对象
*/
@Slf4j
@Data
public class WFTaskSearchContext extends SearchContextBase {
private String n_taskname_like;//[状态]
public class WFTaskSearchContext extends QueryWrapperContext<WFTask> {
private String n_taskname_like;//[状态]
public void setN_taskname_like(String n_taskname_like) {
this.n_taskname_like = n_taskname_like;
if(!ObjectUtils.isEmpty(this.n_taskname_like)){
this.getSearchCond().like("taskname", n_taskname_like);
}
}
private String n_definitionid_eq;//[DefinitionId]
public void setN_definitionid_eq(String n_definitionid_eq) {
this.n_definitionid_eq = n_definitionid_eq;
if(!ObjectUtils.isEmpty(this.n_definitionid_eq)){
this.getSearchCond().eq("definitionid", n_definitionid_eq);
}
}
private String n_definitionkey_eq;//[DefinitionKey]
public void setN_definitionkey_eq(String n_definitionkey_eq) {
this.n_definitionkey_eq = n_definitionkey_eq;
if(!ObjectUtils.isEmpty(this.n_definitionkey_eq)){
this.getSearchCond().eq("definitionkey", n_definitionkey_eq);
}
}
private String n_definitionkey_leftlike;//[DefinitionKey]
public void setN_definitionkey_leftlike(String n_definitionkey_leftlike) {
this.n_definitionkey_leftlike = n_definitionkey_leftlike;
if(!ObjectUtils.isEmpty(this.n_definitionkey_leftlike)){
this.getSearchCond().likeRight("definitionkey", n_definitionkey_leftlike);
}
}
private String n_definitionkey_like;//[DefinitionKey]
public void setN_definitionkey_like(String n_definitionkey_like) {
this.n_definitionkey_like = n_definitionkey_like;
if(!ObjectUtils.isEmpty(this.n_definitionkey_like)){
this.getSearchCond().like("definitionkey", n_definitionkey_like);
}
}
private String n_definitionname_like;//[流程]
public void setN_definitionname_like(String n_definitionname_like) {
this.n_definitionname_like = n_definitionname_like;
if(!ObjectUtils.isEmpty(this.n_definitionname_like)){
this.getSearchCond().like("definitionname", n_definitionname_like);
}
}
private String n_taskdefinitionkey_eq;//[TaskDefinitionKey]
public void setN_taskdefinitionkey_eq(String n_taskdefinitionkey_eq) {
this.n_taskdefinitionkey_eq = n_taskdefinitionkey_eq;
if(!ObjectUtils.isEmpty(this.n_taskdefinitionkey_eq)){
this.getSearchCond().eq("taskdefinitionkey", n_taskdefinitionkey_eq);
}
}
private String n_taskdefinitionkey_like;//[TaskDefinitionKey]
public void setN_taskdefinitionkey_like(String n_taskdefinitionkey_like) {
this.n_taskdefinitionkey_like = n_taskdefinitionkey_like;
if(!ObjectUtils.isEmpty(this.n_taskdefinitionkey_like)){
this.getSearchCond().like("taskdefinitionkey", n_taskdefinitionkey_like);
}
}
private String n_description_like;//[待办事项]
public void setN_description_like(String n_description_like) {
this.n_description_like = n_description_like;
if(!ObjectUtils.isEmpty(this.n_description_like)){
this.getSearchCond().like("description", n_description_like);
}
}
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
@JSONField(format="yyyy-MM-dd HH:mm:ss")
private Timestamp n_createtime_gtandeq;//[发起时间]
public void setN_createtime_gtandeq(Timestamp n_createtime_gtandeq) {
this.n_createtime_gtandeq = n_createtime_gtandeq;
if(!ObjectUtils.isEmpty(this.n_createtime_gtandeq)){
this.getSearchCond().ge("createtime", n_createtime_gtandeq);
}
}
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
@JSONField(format="yyyy-MM-dd HH:mm:ss")
private Timestamp n_createtime_ltandeq;//[发起时间]
public void setN_createtime_ltandeq(Timestamp n_createtime_ltandeq) {
this.n_createtime_ltandeq = n_createtime_ltandeq;
if(!ObjectUtils.isEmpty(this.n_createtime_ltandeq)){
this.getSearchCond().le("createtime", n_createtime_ltandeq);
}
}
private String n_businesskey_eq;//[业务键值]
public void setN_businesskey_eq(String n_businesskey_eq) {
this.n_businesskey_eq = n_businesskey_eq;
if(!ObjectUtils.isEmpty(this.n_businesskey_eq)){
this.getSearchCond().eq("businesskey", n_businesskey_eq);
}
}
/**
* 启用快速搜索
*/
public void setQuery(String query)
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSearchCond().and( wrapper ->
wrapper.like("taskname", query)
);
}
}
}
package cn.ibizlab.core.workflow.mapper;
import java.util.List;
import org.apache.ibatis.annotations.*;
import java.util.Map;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import java.util.HashMap;
import org.apache.ibatis.annotations.Select;
import cn.ibizlab.core.workflow.domain.WFTask;
import cn.ibizlab.core.workflow.filter.WFTaskSearchContext;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import java.io.Serializable;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.alibaba.fastjson.JSONObject;
public interface WFTaskMapper extends BaseMapper<WFTask>{
Page<WFTask> searchDefault(IPage page, @Param("srf") WFTaskSearchContext context, @Param("ew") Wrapper<WFTask> wrapper) ;
@Override
WFTask selectById(Serializable id);
@Override
int insert(WFTask entity);
@Override
int updateById(@Param(Constants.ENTITY) WFTask entity);
@Override
int update(@Param(Constants.ENTITY) WFTask entity, @Param("ew") Wrapper<WFTask> updateWrapper);
@Override
int deleteById(Serializable id);
/**
* 自定义查询SQL
* @param sql
* @return
*/
@Select("${sql}")
List<JSONObject> selectBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义更新SQL
* @param sql
* @return
*/
@Update("${sql}")
boolean updateBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义插入SQL
* @param sql
* @return
*/
@Insert("${sql}")
boolean insertBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义删除SQL
* @param sql
* @return
*/
@Delete("${sql}")
boolean deleteBySQL(@Param("sql") String sql, @Param("et")Map param);
}
......@@ -18,10 +18,12 @@ import cn.ibizlab.core.workflow.domain.WFTask;
import cn.ibizlab.core.workflow.filter.WFTaskSearchContext;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 实体[WFTask] 服务对象接口
*/
public interface IWFTaskService{
public interface IWFTaskService extends IService<WFTask>{
boolean create(WFTask et) ;
void createBatch(List<WFTask> list) ;
......@@ -35,8 +37,21 @@ public interface IWFTaskService{
boolean save(WFTask et) ;
void saveBatch(List<WFTask> list) ;
Page<WFTask> searchDefault(WFTaskSearchContext context) ;
/**
*自定义查询SQL
* @param sql select * from table where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return select * from table where id = '1'
*/
List<JSONObject> select(String sql, Map param);
/**
*自定义SQL
* @param sql update table set name ='test' where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return update table set name ='test' where id = '1'
*/
boolean execute(String sql, Map param);
}
......@@ -31,44 +31,73 @@ import cn.ibizlab.util.helper.CachedBeanCopier;
import cn.ibizlab.util.helper.DEFieldCacheMap;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.ibizlab.core.workflow.mapper.WFTaskMapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.alibaba.fastjson.JSONObject;
import org.springframework.util.StringUtils;
/**
* 实体[工作流任务] 无存储服务对象接口实现
* 实体[工作流任务] 服务对象接口实现
*/
@Slf4j
@Service
public class WFTaskServiceImpl implements IWFTaskService {
@Service("WFTaskServiceImpl")
public class WFTaskServiceImpl extends ServiceImpl<WFTaskMapper, WFTask> implements IWFTaskService {
protected int batchSize = 500;
@Override
@Transactional
public boolean create(WFTask et) {
//代码实现
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getId()),et);
return true;
}
public void createBatch(List<WFTask> list){
@Override
public void createBatch(List<WFTask> list) {
this.saveBatch(list,batchSize);
}
@Override
@Transactional
public boolean update(WFTask et) {
//代码实现
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("taskid",et.getId())))
return false;
CachedBeanCopier.copy(get(et.getId()),et);
return true;
}
public void updateBatch(List<WFTask> list){
@Override
public void updateBatch(List<WFTask> list) {
updateBatchById(list,batchSize);
}
@Override
@Transactional
public boolean remove(String key) {
return true;
boolean result=removeById(key);
return result ;
}
public void removeBatch(Collection<String> idList){
@Override
public void removeBatch(Collection<String> idList) {
removeByIds(idList);
}
@Override
@Transactional
public WFTask get(String key) {
WFTask et = new WFTask();
WFTask et = getById(key);
if(et==null){
et=new WFTask();
et.setId(key);
}
else{
}
return et;
}
......@@ -79,20 +108,36 @@ public class WFTaskServiceImpl implements IWFTaskService {
@Override
public boolean checkKey(WFTask et) {
return false;
return (!ObjectUtils.isEmpty(et.getId()))&&(!Objects.isNull(this.getById(et.getId())));
}
@Override
@Transactional
public boolean save(WFTask et) {
//代码实现
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
public void saveBatch(List<WFTask> list) {
@Transactional
public boolean saveOrUpdate(WFTask et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
public boolean saveBatch(Collection<WFTask> list) {
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
public void saveBatch(List<WFTask> list) {
saveOrUpdateBatch(list,batchSize);
}
......@@ -101,10 +146,42 @@ public class WFTaskServiceImpl implements IWFTaskService {
*/
@Override
public Page<WFTask> searchDefault(WFTaskSearchContext context) {
return new PageImpl<WFTask>(new ArrayList(),context.getPageable(),0);
com.baomidou.mybatisplus.extension.plugins.pagination.Page<WFTask> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<WFTask>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
@Override
public List<JSONObject> select(String sql, Map param){
return this.baseMapper.selectBySQL(sql,param);
}
@Override
@Transactional
public boolean execute(String sql , Map param){
if (sql == null || sql.isEmpty()) {
return false;
}
if (sql.toLowerCase().trim().startsWith("insert")) {
return this.baseMapper.insertBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("update")) {
return this.baseMapper.updateBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("delete")) {
return this.baseMapper.deleteBySQL(sql,param);
}
log.warn("暂未支持的SQL语法");
return true;
}
}
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd">
<!--输出实体[WF_GROUP]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-wf_group-26-1">
<createTable tableName="IBZWFGROUP">
<column name="GROUPID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_WF_GROUP_GROUPID"/>
</column>
<column name="GROUPNAME" remarks="" type="VARCHAR(100)">
</column>
<column name="GROUPSCOPE" remarks="" type="VARCHAR(100)">
</column>
</createTable>
</changeSet>
<!--输出实体[WF_GROUP_MEMBER]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-wf_group_member-50-2">
<createTable tableName="IBZWFMEMBER">
<column name="MEMBERID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_WF_GROUP_MEMBER_MEMBERID"/>
</column>
<column name="MEMBERNAME" remarks="" type="VARCHAR(100)">
</column>
<column name="GROUPID" remarks="" type="VARCHAR(100)">
</column>
<column name="USERID" remarks="" type="VARCHAR(100)">
</column>
</createTable>
</changeSet>
<!--输出实体[WF_DEFINITION]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-wf_definition-58-3">
<createTable tableName="IBZWFDEFINITION">
<column name="DEFINITIONKEY" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_WF_DEFINITION_DEFINITIONKEY"/>
</column>
<column name="DEFINITIONNAME" remarks="" type="VARCHAR(100)">
</column>
<column name="MODELVERSION" remarks="" type="INT">
</column>
<column name="MODELENABLE" remarks="" type="INT">
</column>
<column name="PSSYSTEMID" remarks="" type="VARCHAR(100)">
</column>
<column name="MD5CHECK" remarks="" type="VARCHAR(100)">
</column>
<column name="BPMNFILE" remarks="" type="VARCHAR(1000)">
</column>
<column name="DEPLOYKEY" remarks="" type="VARCHAR(100)">
</column>
</createTable>
</changeSet>
<!--输出实体[WF_PSSYSTEM]数据结构 -->
<!--输出实体[WF_GROUP]外键关系 -->
<!--输出实体[WF_GROUP_MEMBER]外键关系 -->
<changeSet author="a_A_5d9d78509" id="fk-wf_group_member-50-5">
<addForeignKeyConstraint baseColumnNames="GROUPID" baseTableName="IBZWFMEMBER" constraintName="DER1N_WF_GROUP_MEMBER_WF_GROUP" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="GROUPID" referencedTableName="IBZWFGROUP" validate="true"/>
</changeSet>
<!--输出实体[WF_DEFINITION]外键关系 -->
<!--输出实体[WF_PSSYSTEM]外键关系 -->
</databaseChangeLog>
!!!!模版产生代码错误:----
Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??
----
----
FTL stack trace ("~" means nesting-related):
- Failed at: ${dbinst.getUserName()} [in template "CODETEMPL_zh_CN" at line 28, column 24]
----
\ No newline at end of file
......@@ -8,7 +8,7 @@
<![CDATA[select t1.* from (SELECT t1.`BPMNFILE`, t1.`DEFINITIONKEY`, t1.`DEFINITIONNAME`, t1.`DEPLOYKEY`, t1.`MD5CHECK`, t1.`MODELENABLE`, t1.`MODELVERSION`, t1.`PSSYSTEMID` FROM `IBZWFDEFINITION` t1 ) t1 where definitionkey=#{id}]]>
</select>
<select id="selectById" resultMap="WFProcessDefinitionResultMap" databaseId="oracle">
<![CDATA[select t1.* from (SELECT t1.BPMNFILE, t1.DEFINITIONKEY, t1.DEFINITIONNAME, t1.DEPLOYKEY, t1.MD5CHECK, t1.MODELENABLE, t1.MODELVERSION, t1.PSSYSTEMID, t1.TASKDEFINITIONKEY FROM IBZWFDEFINITION t1 ) t1 where definitionkey=#{id}]]>
<![CDATA[select t1.* from (SELECT t1.BPMNFILE, t1.DEFINITIONKEY, t1.DEFINITIONNAME, t1.DEPLOYKEY, t1.MD5CHECK, t1.MODELENABLE, t1.MODELVERSION, t1.PSSYSTEMID FROM IBZWFDEFINITION t1 ) t1 where definitionkey=#{id}]]>
</select>
<select id="selectById" resultMap="WFProcessDefinitionResultMap" databaseId="postgresql">
<![CDATA[select t1.* from (SELECT t1.BPMNFILE, t1.DEFINITIONKEY, t1.DEFINITIONNAME, t1.DEPLOYKEY, t1.MD5CHECK, t1.MODELENABLE, t1.MODELVERSION, t1.PSSYSTEMID, t1.TASKDEFINITIONKEY FROM IBZWFDEFINITION t1 ) t1 where definitionkey=#{id}]]>
......@@ -38,7 +38,7 @@
</sql>
<!--数据查询[Default]-->
<sql id="Default" databaseId="oracle">
<![CDATA[ SELECT t1.BPMNFILE, t1.DEFINITIONKEY, t1.DEFINITIONNAME, t1.DEPLOYKEY, t1.MD5CHECK, t1.MODELENABLE, t1.MODELVERSION, t1.PSSYSTEMID, t1.TASKDEFINITIONKEY FROM IBZWFDEFINITION t1
<![CDATA[ SELECT t1.BPMNFILE, t1.DEFINITIONKEY, t1.DEFINITIONNAME, t1.DEPLOYKEY, t1.MD5CHECK, t1.MODELENABLE, t1.MODELVERSION, t1.PSSYSTEMID FROM IBZWFDEFINITION t1
]]>
</sql>
<!--数据查询[Default]-->
......@@ -53,7 +53,7 @@
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="oracle">
<![CDATA[ SELECT t1.BPMNFILE, t1.DEFINITIONKEY, t1.DEFINITIONNAME, t1.DEPLOYKEY, t1.MD5CHECK, t1.MODELENABLE, t1.MODELVERSION, t1.PSSYSTEMID, t1.TASKDEFINITIONKEY FROM IBZWFDEFINITION t1
<![CDATA[ SELECT t1.BPMNFILE, t1.DEFINITIONKEY, t1.DEFINITIONNAME, t1.DEPLOYKEY, t1.MD5CHECK, t1.MODELENABLE, t1.MODELVERSION, t1.PSSYSTEMID FROM IBZWFDEFINITION t1
]]>
</sql>
<!--数据查询[View]-->
......
<?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="cn.ibizlab.core.workflow.mapper.WFTaskMapper">
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
<resultMap id="WFTaskResultMap" type="cn.ibizlab.core.workflow.domain.WFTask" autoMapping="true">
<id property="id" column="taskid" /><!--主键字段映射-->
<result property="name" column="taskname" />
<result property="processdefinitionid" column="definitionid" />
<result property="processdefinitionkey" column="definitionkey" />
<result property="processdefinitionname" column="definitionname" />
<result property="processinstanceid" column="instanceid" />
<result property="processinstancebusinesskey" column="businesskey" />
</resultMap>
<!--数据集合[Default]-->
<select id="searchDefault" parameterType="cn.ibizlab.core.workflow.filter.WFTaskSearchContext" resultMap="WFTaskResultMap">
select t1.* from (
<include refid="Default" />
)t1
<where><if test="ew!=null and ew.sqlSegment!=null and !ew.emptyOfWhere">${ew.sqlSegment}</if></where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">${ew.sqlSegment}</if>
</select>
<!--数据查询[Default]-->
<sql id="Default" databaseId="mysql">
<![CDATA[ SELECT t1.`BUSINESSKEY`, t1.`CREATETIME`, t1.`DEFINITIONID`, t1.`DEFINITIONKEY`, t1.`DEFINITIONNAME`, t1.`DESCRIPTION`, t1.`INSTANCEID`, t1.`TASKDEFINITIONKEY`, t1.`TASKID`, t1.`TASKNAME` FROM `IBZTASK` t1
]]>
</sql>
<!--数据查询[Default]-->
<sql id="Default" databaseId="oracle">
<![CDATA[ SELECT t1.BUSINESSKEY, t1.CREATETIME, t1.DEFINITIONID, t1.DEFINITIONKEY, t1.DEFINITIONNAME, t1.DESCRIPTION, t1.INSTANCEID, t1.TASKDEFINITIONKEY, t1.TASKID, t1.TASKNAME FROM IBZTASK t1
]]>
</sql>
<!--数据查询[Default]-->
<sql id="Default" databaseId="postgresql">
<![CDATA[ SELECT t1.BUSINESSKEY, t1.DEFINITIONKEY, t1.INSTANCEID, t1.TASKDEFINITIONKEY, t1.TASKID, t1.TASKNAME FROM IBZTASK t1
]]>
</sql>
</mapper>
......@@ -47,6 +47,7 @@ public class WFTaskResource {
@Lazy
public WFTaskMapping wftaskMapping;
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFTask-Create-all')")
@ApiOperation(value = "新建工作流任务", tags = {"工作流任务" }, notes = "新建工作流任务")
@RequestMapping(method = RequestMethod.POST, value = "/wftasks")
@Transactional
......@@ -57,6 +58,7 @@ public class WFTaskResource {
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFTask-Create-all')")
@ApiOperation(value = "批量新建工作流任务", tags = {"工作流任务" }, notes = "批量新建工作流任务")
@RequestMapping(method = RequestMethod.POST, value = "/wftasks/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<WFTaskDTO> wftaskdtos) {
......@@ -64,6 +66,7 @@ public class WFTaskResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFTask-Update-all')")
@ApiOperation(value = "更新工作流任务", tags = {"工作流任务" }, notes = "更新工作流任务")
@RequestMapping(method = RequestMethod.PUT, value = "/wftasks/{wftask_id}")
@Transactional
......@@ -75,6 +78,7 @@ public class WFTaskResource {
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFTask-Update-all')")
@ApiOperation(value = "批量更新工作流任务", tags = {"工作流任务" }, notes = "批量更新工作流任务")
@RequestMapping(method = RequestMethod.PUT, value = "/wftasks/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<WFTaskDTO> wftaskdtos) {
......@@ -82,6 +86,7 @@ public class WFTaskResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFTask-Remove-all')")
@ApiOperation(value = "删除工作流任务", tags = {"工作流任务" }, notes = "删除工作流任务")
@RequestMapping(method = RequestMethod.DELETE, value = "/wftasks/{wftask_id}")
@Transactional
......@@ -89,6 +94,7 @@ public class WFTaskResource {
return ResponseEntity.status(HttpStatus.OK).body(wftaskService.remove(wftask_id));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFTask-Remove-all')")
@ApiOperation(value = "批量删除工作流任务", tags = {"工作流任务" }, notes = "批量删除工作流任务")
@RequestMapping(method = RequestMethod.DELETE, value = "/wftasks/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
......@@ -96,6 +102,7 @@ public class WFTaskResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFTask-Get-all')")
@ApiOperation(value = "获取工作流任务", tags = {"工作流任务" }, notes = "获取工作流任务")
@RequestMapping(method = RequestMethod.GET, value = "/wftasks/{wftask_id}")
public ResponseEntity<WFTaskDTO> get(@PathVariable("wftask_id") String wftask_id) {
......@@ -116,12 +123,14 @@ public class WFTaskResource {
return ResponseEntity.status(HttpStatus.OK).body(wftaskService.checkKey(wftaskMapping.toDomain(wftaskdto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFTask-Save-all')")
@ApiOperation(value = "保存工作流任务", tags = {"工作流任务" }, notes = "保存工作流任务")
@RequestMapping(method = RequestMethod.POST, value = "/wftasks/save")
public ResponseEntity<Boolean> save(@RequestBody WFTaskDTO wftaskdto) {
return ResponseEntity.status(HttpStatus.OK).body(wftaskService.save(wftaskMapping.toDomain(wftaskdto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFTask-Save-all')")
@ApiOperation(value = "批量保存工作流任务", tags = {"工作流任务" }, notes = "批量保存工作流任务")
@RequestMapping(method = RequestMethod.POST, value = "/wftasks/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<WFTaskDTO> wftaskdtos) {
......@@ -129,6 +138,7 @@ public class WFTaskResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFTask-searchDefault-all')")
@ApiOperation(value = "获取DEFAULT", tags = {"工作流任务" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/wftasks/fetchdefault")
public ResponseEntity<List<WFTaskDTO>> fetchDefault(WFTaskSearchContext context) {
......@@ -141,6 +151,7 @@ public class WFTaskResource {
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFTask-searchDefault-all')")
@ApiOperation(value = "查询DEFAULT", tags = {"工作流任务" } ,notes = "查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/wftasks/searchdefault")
public ResponseEntity<Page<WFTaskDTO>> searchDefault(@RequestBody WFTaskSearchContext context) {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册