This commit is contained in:
xiang2lin 2025-05-09 17:38:53 +08:00
parent adb4a566d4
commit 97840df6a1
9 changed files with 202 additions and 62 deletions

View File

@ -14,8 +14,10 @@ public class SysFlowEntity extends BaseEntity {
private String name;
/** 流程分类id */
private String classId;
private String className;
/** 触发方式id */
private String triggerModeId;
private String triggerModeName;
/** 应用组id */
private String nifiGroupId;
/** 流程描述 */
@ -70,5 +72,21 @@ public class SysFlowEntity extends BaseEntity {
public void setStatus(String status) {
this.status = status;
}
public String getClassName() {
return className;
}
public void setClassName(String className) {
this.className = className;
}
public String getTriggerModeName() {
return triggerModeName;
}
public void setTriggerModeName(String triggerModeName) {
this.triggerModeName = triggerModeName;
}
}

View File

@ -12,46 +12,49 @@
<result property="name" column="name" jdbcType="VARCHAR"/>
<result property="status" column="status" jdbcType="VARCHAR"/>
<result property="classId" column="class_id" jdbcType="VARCHAR"/>
<result property="className" column="className" jdbcType="VARCHAR"/>
<result property="triggerModeId" column="trigger_mode_id" jdbcType="VARCHAR"/>
<result property="nifiGroupId" column="nifi_group_id" jdbcType="VARCHAR"/>
<result property="description" column="description" jdbcType="VARCHAR"/>
</resultMap>
<!-- 查询的字段-->
<sql id = "SysFlowEntity_Base_Column_List">
id
,create_user_id
,create_time
,modify_user_id
,modify_time
,sts
,name
,status
,class_id
,trigger_mode_id
,nifi_group_id
,description
sf.id
,sf.create_user_id
,sf.create_time
,sf.modify_user_id
,sf.modify_time
,sf.sts
,sf.name
,sf.status
,sf.class_id
,sfc.name as className
,sf.trigger_mode_id
,sf.nifi_group_id
,sf.description
</sql>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-SysFlowEntity-result" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowEntity">
select
<include refid="SysFlowEntity_Base_Column_List" />
from sys_flow
from sys_flow sf
left join sys_flow_class sfc on sfc.id = sf.class_id
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id = #{id} </if>
<if test="create_user_id != null and create_user_id != ''"> and create_user_id = #{create_user_id} </if>
<if test="create_time != null"> and create_time = #{create_time} </if>
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id = #{modify_user_id} </if>
<if test="modify_time != null"> and modify_time = #{modify_time} </if>
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
<if test="name != null and name != ''"> and name = #{name} </if>
<if test="status != null and status != ''"> and status = #{status} </if>
<if test="classId != null and classId != ''"> and class_id = #{classId} </if>
<if test="triggerModeId != null and triggerModeId != ''"> and trigger_mode_id = #{triggerModeId} </if>
<if test="nifiGroupId != null and nifiGroupId != ''"> and nifi_group_id = #{nifiGroupId} </if>
<if test="description != null and description != ''"> and description = #{description} </if>
and sts='Y'
<if test="id != null and id != ''"> and sf.id = #{id} </if>
<if test="create_user_id != null and create_user_id != ''"> and sf.create_user_id = #{create_user_id} </if>
<if test="create_time != null"> and sf.create_time = #{create_time} </if>
<if test="modify_user_id != null and modify_user_id != ''"> and sf.modify_user_id = #{modify_user_id} </if>
<if test="modify_time != null"> and sf.modify_time = #{modify_time} </if>
<if test="sts != null and sts != ''"> and sf.sts = #{sts} </if>
<if test="name != null and name != ''"> and sf.name = #{name} </if>
<if test="status != null and status != ''"> and sf.status = #{status} </if>
<if test="classId != null and classId != ''"> and sf.class_id = #{classId} </if>
<if test="triggerModeId != null and triggerModeId != ''"> and sf.trigger_mode_id = #{triggerModeId} </if>
<if test="nifiGroupId != null and nifiGroupId != ''"> and sf.nifi_group_id = #{nifiGroupId} </if>
<if test="description != null and description != ''"> and sf.description = #{description} </if>
and sf.sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
<if test=" sort == null or sort == ''.toString() "> order by sf.sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
@ -81,23 +84,24 @@
<select id="entity_list_like" resultMap="get-SysFlowEntity-result" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowEntity">
select
<include refid="SysFlowEntity_Base_Column_List" />
from sys_flow
from sys_flow sf
left join sys_flow_class sfc on sfc.id = sf.class_id
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id like concat('%',#{id},'%') </if>
<if test="create_user_id != null and create_user_id != ''"> and create_user_id like concat('%',#{create_user_id},'%') </if>
<if test="create_time != null"> and create_time like concat('%',#{create_time},'%') </if>
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id like concat('%',#{modify_user_id},'%') </if>
<if test="modify_time != null"> and modify_time like concat('%',#{modify_time},'%') </if>
<if test="sts != null and sts != ''"> and sts like concat('%',#{sts},'%') </if>
<if test="name != null and name != ''"> and name like concat('%',#{name},'%') </if>
<if test="status != null and status != ''"> and status like concat('%',#{status},'%') </if>
<if test="classId != null and classId != ''"> and class_id like concat('%',#{classId},'%') </if>
<if test="triggerModeId != null and triggerModeId != ''"> and trigger_mode_id like concat('%',#{triggerModeId},'%') </if>
<if test="nifiGroupId != null and nifiGroupId != ''"> and nifi_group_id like concat('%',#{nifiGroupId},'%') </if>
<if test="description != null and description != ''"> and description like concat('%',#{description},'%') </if>
and sts='Y'
<if test="id != null and id != ''"> and sf.id like concat('%',#{id},'%') </if>
<if test="create_user_id != null and create_user_id != ''"> and sf.create_user_id like concat('%',#{create_user_id},'%') </if>
<if test="create_time != null"> and sf.create_time like concat('%',#{create_time},'%') </if>
<if test="modify_user_id != null and modify_user_id != ''"> and sf.modify_user_id like concat('%',#{modify_user_id},'%') </if>
<if test="modify_time != null"> and sf.modify_time like concat('%',#{modify_time},'%') </if>
<if test="sts != null and sts != ''"> and sf.sts like concat('%',#{sts},'%') </if>
<if test="name != null and name != ''"> and sf.name like concat('%',#{name},'%') </if>
<if test="status != null and status != ''"> and sf.status like concat('%',#{status},'%') </if>
<if test="classId != null and classId != ''"> and sf.class_id like concat('%',#{classId},'%') </if>
<if test="triggerModeId != null and triggerModeId != ''"> and sf.trigger_mode_id like concat('%',#{triggerModeId},'%') </if>
<if test="nifiGroupId != null and nifiGroupId != ''"> and sf.nifi_group_id like concat('%',#{nifiGroupId},'%') </if>
<if test="description != null and description != ''"> and sf.description like concat('%',#{description},'%') </if>
and sf.sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
<if test=" sort == null or sort == ''.toString() "> order by sf.sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
@ -105,21 +109,22 @@
<select id="SysFlowentity_list_or" resultMap="get-SysFlowEntity-result" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowEntity">
select
<include refid="SysFlowEntity_Base_Column_List" />
from sys_flow
from sys_flow sf
left join sys_flow_class sfc on sfc.id = sf.class_id
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> or id = #{id} </if>
<if test="create_user_id != null and create_user_id != ''"> or create_user_id = #{create_user_id} </if>
<if test="create_time != null"> or create_time = #{create_time} </if>
<if test="modify_user_id != null and modify_user_id != ''"> or modify_user_id = #{modify_user_id} </if>
<if test="modify_time != null"> or modify_time = #{modify_time} </if>
<if test="sts != null and sts != ''"> or sts = #{sts} </if>
<if test="name != null and name != ''"> or name = #{name} </if>
<if test="status != null and status != ''"> or status = #{status} </if>
<if test="classId != null and classId != ''"> or class_id = #{classId} </if>
<if test="triggerModeId != null and triggerModeId != ''"> or trigger_mode_id = #{triggerModeId} </if>
<if test="nifiGroupId != null and nifiGroupId != ''"> or nifi_group_id = #{nifiGroupId} </if>
<if test="description != null and description != ''"> or description = #{description} </if>
and sts='Y'
<if test="id != null and id != ''"> or sf.id = #{id} </if>
<if test="create_user_id != null and create_user_id != ''"> or sf.create_user_id = #{create_user_id} </if>
<if test="create_time != null"> or sf.create_time = #{create_time} </if>
<if test="modify_user_id != null and modify_user_id != ''"> or sf.modify_user_id = #{modify_user_id} </if>
<if test="modify_time != null"> or sf.modify_time = #{modify_time} </if>
<if test="sts != null and sts != ''"> or sf.sts = #{sts} </if>
<if test="name != null and name != ''"> or sf.name = #{name} </if>
<if test="status != null and status != ''"> or sf.status = #{status} </if>
<if test="classId != null and classId != ''"> or sf.class_id = #{classId} </if>
<if test="triggerModeId != null and triggerModeId != ''"> or sf.trigger_mode_id = #{triggerModeId} </if>
<if test="nifiGroupId != null and nifiGroupId != ''"> or sf.nifi_group_id = #{nifiGroupId} </if>
<if test="description != null and description != ''"> or sf.description = #{description} </if>
and sf.sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>

View File

@ -47,4 +47,11 @@ public interface ISysFlowClassRuleService extends IBaseService<SysFlowClassRuleE
* @return
*/
JsonResultEntity queryRulePagedInfo(JSONObject object);
/**
* 查询待分配权限的用户列表
* @param object
* @return
*/
JsonResultEntity queryUserList(JSONObject object);
}

View File

@ -13,6 +13,12 @@ import com.hzya.frame.web.entity.JsonResultEntity;
*/
public interface ISysFlowClassService extends IBaseService<SysFlowClassEntity, String>{
/**
* 根据Id查询
* @param object
* @return
*/
JsonResultEntity getFlowClass(JSONObject object);
/**
* 新增流程分类
* @param object

View File

@ -13,6 +13,13 @@ import com.hzya.frame.web.entity.JsonResultEntity;
*/
public interface ISysFlowNifiConstantService extends IBaseService<SysFlowNifiConstantEntity, String>{
/**
* 详情
* @param object
* @return
*/
JsonResultEntity getNifiConstant(JSONObject object);
/**
* 保存nifi常量
* @param object

View File

@ -8,6 +8,8 @@ import com.github.pagehelper.PageInfo;
import com.hzya.frame.sys.flow.entity.SysFlowClassRuleEntity;
import com.hzya.frame.sys.flow.dao.ISysFlowClassRuleDao;
import com.hzya.frame.sys.flow.service.ISysFlowClassRuleService;
import com.hzya.frame.sysnew.user.dao.ISysUserDao;
import com.hzya.frame.sysnew.user.entity.SysUserEntity;
import com.hzya.frame.uuid.UUIDUtils;
import com.hzya.frame.web.entity.BaseResult;
import com.hzya.frame.web.entity.JsonResultEntity;
@ -28,7 +30,8 @@ import java.util.List;
public class SysFlowClassRuleServiceImpl extends BaseService<SysFlowClassRuleEntity, String> implements ISysFlowClassRuleService {
private ISysFlowClassRuleDao sysFlowClassRuleDao;
@Autowired
private ISysUserDao sysUserDao;
@Autowired
public void setSysFlowClassRuleDao(ISysFlowClassRuleDao dao) {
this.sysFlowClassRuleDao = dao;
@ -150,7 +153,18 @@ public class SysFlowClassRuleServiceImpl extends BaseService<SysFlowClassRuleEnt
PageInfo pageInfo = new PageInfo(queryByLike);
return BaseResult.getSuccessMessageEntity("查询数据成功",pageInfo);
}
/**
* 查询待分配权限的用户列表
*
* @param object
* @return
*/
@Override
public JsonResultEntity queryUserList(JSONObject object) {
SysUserEntity userEntity = getData("jsonStr",object,SysUserEntity.class);
List<SysUserEntity> sysUserEntities = sysUserDao.queryList(userEntity, "com.hzya.frame.sysnew.user.dao.impl.SysUserDaoImpl.entity_list_notin_sys_flowClass");
return BaseResult.getSuccessMessageEntity("查询成功",sysUserEntities);
}
/**
* 检查参数
* @param entity 参数对象

View File

@ -2,11 +2,16 @@ package com.hzya.frame.sys.flow.service.impl;
import cn.hutool.core.lang.Assert;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.sys.dictionaryshopNew.service.ISysDictionaryshopNewService;
import com.hzya.frame.sys.flow.dao.ISysFlowClassRuleDao;
import com.hzya.frame.sys.flow.dao.ISysFlowDao;
import com.hzya.frame.sys.flow.entity.SysFlowClassEntity;
import com.hzya.frame.sys.flow.dao.ISysFlowClassDao;
import com.hzya.frame.sys.flow.entity.SysFlowClassRuleEntity;
import com.hzya.frame.sys.flow.entity.SysFlowEntity;
import com.hzya.frame.sys.flow.service.ISysFlowClassService;
import com.hzya.frame.sysnew.user.dao.ISysUserDao;
import com.hzya.frame.sysnew.user.entity.SysUserEntity;
import com.hzya.frame.uuid.UUIDUtils;
import com.hzya.frame.web.entity.BaseResult;
import com.hzya.frame.web.entity.JsonResultEntity;
@ -14,9 +19,9 @@ import com.hzya.frame.web.exception.BaseSystemException;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.Resource;
import com.hzya.frame.basedao.service.impl.BaseService;
import java.util.Date;
import java.util.List;
/**
@ -31,13 +36,34 @@ public class SysFlowClassServiceImpl extends BaseService<SysFlowClassEntity, Str
private ISysFlowClassDao sysFlowClassDao;
@Autowired
private ISysFlowDao sysFlowDao;
@Autowired
private ISysFlowClassRuleDao flowClassRuleDao;
@Autowired
private ISysUserDao sysUserDao;
@Autowired
public void setSysFlowClassDao(ISysFlowClassDao dao) {
this.sysFlowClassDao = dao;
this.dao = dao;
}
/**
* 根据Id查询
*
* @param object
* @return
*/
@Override
public JsonResultEntity getFlowClass(JSONObject object) {
SysFlowClassEntity flowClass = getData("jsonStr",object,SysFlowClassEntity.class);
try {
this.checkParams(flowClass,"get");
}catch(Exception e){
return BaseResult.getFailureMessageEntity(e.getMessage());
}
SysFlowClassEntity sysFlowClassEntity = sysFlowClassDao.queryOne(flowClass);
return BaseResult.getSuccessMessageEntity("查询详情成功",sysFlowClassEntity);
}
/**
* 新增流程分类
*
@ -54,6 +80,20 @@ public class SysFlowClassServiceImpl extends BaseService<SysFlowClassEntity, Str
}
flowClass.setId(UUIDUtils.getUUID());
sysFlowClassDao.save(flowClass);
//给创建分类的用户保存一下权限
SysUserEntity sysUserEntity = sysUserDao.get(flowClass.getCreate_user_id());
SysFlowClassRuleEntity ruleEntity = new SysFlowClassRuleEntity();
ruleEntity.setFlowClassId(flowClass.getId());
ruleEntity.setUserId(flowClass.getCreate_user_id());
if (null != sysUserEntity){
ruleEntity.setUserName(sysUserEntity.getPersonName());
ruleEntity.setUserCode(sysUserEntity.getPersonCode());
}
ruleEntity.setCreate_time(new Date());
ruleEntity.setModify_time(new Date());
ruleEntity.setCreate_user_id(flowClass.getCreate_user_id());
ruleEntity.setModify_user_id(flowClass.getModify_user_id());
flowClassRuleDao.save(ruleEntity);
return BaseResult.getSuccessMessageEntity("新增成功");
}
@ -92,7 +132,6 @@ public class SysFlowClassServiceImpl extends BaseService<SysFlowClassEntity, Str
sysFlowClassDao.logicRemove(flowClass);
return BaseResult.getSuccessMessageEntity("删除成功");
}
/**
* 参数检查
* @param flowClass
@ -131,6 +170,8 @@ public class SysFlowClassServiceImpl extends BaseService<SysFlowClassEntity, Str
if (CollectionUtils.isNotEmpty(query)){
throw new BaseSystemException("该分类已被引用,删除失败");
}
}else if ("get".equals(type)){//查询详情
Assert.notEmpty(flowClass.getId(),"id不能为空");
}
}
}

View File

@ -35,6 +35,24 @@ public class SysFlowNifiConstantServiceImpl extends BaseService<SysFlowNifiConst
this.dao = dao;
}
/**
* 详情
*
* @param object
* @return
*/
@Override
public JsonResultEntity getNifiConstant(JSONObject object) {
SysFlowNifiConstantEntity sysFlowNifiConstantEntity = null;
try {
sysFlowNifiConstantEntity = preCheck(object,"get");
}catch(Exception e){
return BaseResult.getFailureMessageEntity(e.getMessage());
}
SysFlowNifiConstantEntity nifiConstant = sysFlowNifiConstantDao.queryOne(sysFlowNifiConstantEntity);
return BaseResult.getSuccessMessageEntity("查询详情成功",nifiConstant);
}
/**
* 保存nifi常量
*
@ -123,6 +141,8 @@ public class SysFlowNifiConstantServiceImpl extends BaseService<SysFlowNifiConst
}
}else if ("delete".equals(type)){
Assert.notEmpty(entity.getId(),"id不能为空");
}else if ("get".equals(type)){
Assert.notEmpty(entity.getId(),"id不能为空");
}
}

View File

@ -4,6 +4,8 @@ import cn.hutool.core.lang.Assert;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hzya.frame.sys.dictionaryshopNew.entity.SysDictionaryshopNew;
import com.hzya.frame.sys.dictionaryshopNew.service.ISysDictionaryshopNewService;
import com.hzya.frame.sys.flow.entity.SysFlowEntity;
import com.hzya.frame.sys.flow.dao.ISysFlowDao;
import com.hzya.frame.sys.flow.service.ISysFlowService;
@ -28,7 +30,8 @@ import java.util.List;
public class SysFlowServiceImpl extends BaseService<SysFlowEntity, String> implements ISysFlowService {
private ISysFlowDao sysFlowDao;
@Autowired
private ISysDictionaryshopNewService sysDictionaryshopNewService;
@Autowired
public void setSysFlowDao(ISysFlowDao dao) {
this.sysFlowDao = dao;
@ -106,6 +109,11 @@ public class SysFlowServiceImpl extends BaseService<SysFlowEntity, String> imple
return BaseResult.getFailureMessageEntity(e.getMessage());
}
List<SysFlowEntity> list = sysFlowDao.query(flowEntity);
if (CollectionUtils.isNotEmpty(list)){
for (SysFlowEntity sysFlowEntity : list) {
transferDictionary(sysFlowEntity);
}
}
return BaseResult.getSuccessMessageEntity("查询数据成功",list);
}
@ -125,6 +133,11 @@ public class SysFlowServiceImpl extends BaseService<SysFlowEntity, String> imple
}
PageHelper.startPage(flowEntity.getPageNum(),flowEntity.getPageSize());
List<SysFlowEntity> queryByLike = sysFlowDao.queryByLike(flowEntity);
if (CollectionUtils.isNotEmpty(queryByLike)){
for (SysFlowEntity sysFlowEntity : queryByLike) {
transferDictionary(sysFlowEntity);
}
}
PageInfo pageInfo = new PageInfo(queryByLike);
return BaseResult.getSuccessMessageEntity("pageInfo",pageInfo);
}
@ -165,4 +178,13 @@ public class SysFlowServiceImpl extends BaseService<SysFlowEntity, String> imple
Assert.notNull(entity.getPageSize(),"pageSize不能为空");
}
}
private void transferDictionary(SysFlowEntity sysFlowEntity){
if (null != sysFlowEntity){
SysDictionaryshopNew dictionaryshopByValue = sysDictionaryshopNewService.getDictionaryshopByValue("sys_flow", "trigger_mode_id", sysFlowEntity.getTriggerModeId());
if (null != dictionaryshopByValue){
sysFlowEntity.setTriggerModeName(dictionaryshopByValue.getColumnContent());
}
}
}
}