Browse Source

[update]:物料信息增加 作废、恢复流程

dev
youjianchi 10 months ago
parent
commit
9c2c852a7d
  1. 2
      ruoyi-activiti/src/main/java/com/ruoyi/process/general/service/IProcessService.java
  2. 3
      ruoyi-activiti/src/main/java/com/ruoyi/process/general/service/impl/ProcessServiceImpl.java
  3. 38
      ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpMaterialController.java
  4. 52
      ruoyi-admin/src/main/java/com/ruoyi/erp/domain/ErpMaterial.java
  5. 10
      ruoyi-admin/src/main/java/com/ruoyi/erp/domain/ErpMaterialVo.java
  6. 4
      ruoyi-admin/src/main/java/com/ruoyi/erp/service/IErpMaterialService.java
  7. 110
      ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpMaterialServiceImpl.java
  8. 23
      ruoyi-admin/src/main/resources/application-druid.yml
  9. 34
      ruoyi-admin/src/main/resources/mapper/erp/ErpMaterialMapper.xml
  10. 54
      ruoyi-admin/src/main/resources/templates/erp/material/material.html
  11. 11
      ruoyi-common/pom.xml

2
ruoyi-activiti/src/main/java/com/ruoyi/process/general/service/IProcessService.java

@ -35,7 +35,7 @@ public interface IProcessService {
*/
ProcessInstance submitApply(String applyUserId, String businessKey, String itemName, String itemConent, String key, Map<String, Object> variables);
void complete(String taskId, String instanceId, String itemName, String itemContent, String module, Map<String, Object> variables, HttpServletRequest request);
boolean complete(String taskId, String instanceId, String itemName, String itemContent, String module, Map<String, Object> variables, HttpServletRequest request);
/**
* 判断流程是否结束

3
ruoyi-activiti/src/main/java/com/ruoyi/process/general/service/impl/ProcessServiceImpl.java

@ -119,7 +119,7 @@ public class ProcessServiceImpl implements IProcessService {
}
@Override
public void complete(String taskId, String instanceId, String itemName, String itemContent, String module, Map<String, Object> variables, HttpServletRequest request) {
public boolean complete(String taskId, String instanceId, String itemName, String itemContent, String module, Map<String, Object> variables, HttpServletRequest request) {
Enumeration<String> parameterNames = request.getParameterNames();
String comment = null; // 批注
boolean agree = true;
@ -185,6 +185,7 @@ public class ProcessServiceImpl implements IProcessService {
} catch (Exception e) {
logger.error("error on complete task {}, variables={}", new Object[]{taskId, variables, e});
}
return agree;
}
@Override

38
ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpMaterialController.java

@ -130,7 +130,9 @@ public class ErpMaterialController extends BaseController
@ResponseBody
public AjaxResult addSave(ErpMaterial erpMaterial)
{
// 使用状态-否
erpMaterial.setUseStatus("0");
// 审核状态-待审核
erpMaterial.setAuditStatus("0");
erpMaterialService.submitApply(erpMaterial);
return AjaxResult.success();
@ -165,14 +167,34 @@ public class ErpMaterialController extends BaseController
@ModelAttribute("preloadObj") ErpMaterialVo erpMaterialVo, HttpServletRequest request) {
boolean saveEntityBoolean = BooleanUtils.toBoolean(saveEntity);
String instanceId = erpMaterialVo.getInstanceId();
processService.complete(taskId, instanceId, erpMaterialVo.getApplyTitle(), erpMaterialVo.getMaterialNo(), "material", new HashMap<String, Object>(), request);
String instanceType = erpMaterialVo.getInstanceType();
boolean approvedFlag = processService.complete(taskId, instanceId, erpMaterialVo.getApplyTitle(), erpMaterialVo.getMaterialNo(), "material", new HashMap<String, Object>(), request);
if(!approvedFlag){
// 审核状态-审核拒绝
erpMaterialVo.setAuditStatus("2");
}
// 如果任务已结束更新业务表状态
boolean processIsFinish = processService.judgeProcessIsFinish(instanceId);
if (processIsFinish) {
// 审核完成
// 审核通过
erpMaterialVo.setAuditStatus("1");
erpMaterialMapper.updateErpMaterial(erpMaterialVo);
// 提交
if("submit".equals(instanceType)){
// 使用状态-是
erpMaterialVo.setUseStatus("1");
}
// 作废
else if("cancel".equals(instanceType)){
// 使用状态-已作废
erpMaterialVo.setUseStatus("2");
}
// 恢复
else if("restore".equals(instanceType)){
// 使用状态-是
erpMaterialVo.setUseStatus("1");
}
}
erpMaterialMapper.updateErpMaterial(erpMaterialVo);
// 驳回申请后继续申请,可能修改表单
if (saveEntityBoolean) {
erpMaterialService.updateErpMaterial(erpMaterialVo);
@ -229,24 +251,26 @@ public class ErpMaterialController extends BaseController
/**
* 作废物料信息
*/
@RequiresPermissions("erp:material:cancel")
// @RequiresPermissions("erp:material:cancel")
@Log(title = "物料信息", businessType = BusinessType.CANCEL)
@GetMapping( "/cancel/{id}")
@ResponseBody
public AjaxResult cancel(@PathVariable("id") Long id){
return toAjax(erpMaterialService.cancelErpMaterialById(id));
erpMaterialService.cancelErpMaterialById(id);
return AjaxResult.success();
}
/**
* 恢复物料信息
*/
@RequiresPermissions("erp:material:restore")
// @RequiresPermissions("erp:material:restore")
@Log(title = "物料信息", businessType = BusinessType.RESTORE)
@GetMapping( "/restore/{id}")
@ResponseBody
public AjaxResult restore(@PathVariable("id")Long id)
{
return toAjax(erpMaterialService.restoreErpMaterialById(id));
erpMaterialService.restoreErpMaterialById(id);
return AjaxResult.success();
}
/**

52
ruoyi-admin/src/main/java/com/ruoyi/erp/domain/ErpMaterial.java

@ -34,11 +34,11 @@ public class ErpMaterial extends BaseEntity
@Excel(name = "物料名称")
private String materialName;
/** 审核状态 */
/** 审核状态 0-待审核 1-审核通过 2-审核拒绝*/
@Excel(name = "审核状态")
private String auditStatus;
/** 使用状态 */
/** 使用状态 0-否 1-是 2-已作废*/
@Excel(name = "使用状态")
private String useStatus;
/** 关联bom */
@ -79,6 +79,22 @@ public class ErpMaterial extends BaseEntity
@Excel(name = "流程实例ID")
private String instanceId;
/** 流程实例类型 */
@Excel(name = "流程实例类型")
private String instanceType;
/** 提交流程实例ID */
@Excel(name = "提交流程实例ID")
private String submitInstanceId;
/** 作废流程实例ID */
@Excel(name = "作废流程实例ID")
private String cancelInstanceId;
/** 恢复流程实例ID */
@Excel(name = "恢复流程实例ID")
private String restoreInstanceId;
/** 申请人 */
@Excel(name = "申请标题")
private String applyTitle;
@ -290,6 +306,38 @@ public class ErpMaterial extends BaseEntity
this.instanceId = instanceId;
}
public String getInstanceType() {
return instanceType;
}
public void setInstanceType(String instanceType) {
this.instanceType = instanceType;
}
public String getSubmitInstanceId() {
return submitInstanceId;
}
public void setSubmitInstanceId(String submitInstanceId) {
this.submitInstanceId = submitInstanceId;
}
public String getCancelInstanceId() {
return cancelInstanceId;
}
public void setCancelInstanceId(String cancelInstanceId) {
this.cancelInstanceId = cancelInstanceId;
}
public String getRestoreInstanceId() {
return restoreInstanceId;
}
public void setRestoreInstanceId(String restoreInstanceId) {
this.restoreInstanceId = restoreInstanceId;
}
public String getApplyTitle() {
return applyTitle;
}

10
ruoyi-admin/src/main/java/com/ruoyi/erp/domain/ErpMaterialVo.java

@ -22,6 +22,8 @@ public class ErpMaterialVo extends ErpMaterial {
private String suspendState;
/** 待办用户id */
private String todoUserId;
/** 流程实例类型名称 */
private String instanceTypeName;
public String getApplyUserName() {
return applyUserName;
@ -78,4 +80,12 @@ public class ErpMaterialVo extends ErpMaterial {
public void setTodoUserId(String todoUserId) {
this.todoUserId = todoUserId;
}
public String getInstanceTypeName() {
return instanceTypeName;
}
public void setInstanceTypeName(String instanceTypeName) {
this.instanceTypeName = instanceTypeName;
}
}

4
ruoyi-admin/src/main/java/com/ruoyi/erp/service/IErpMaterialService.java

@ -67,14 +67,14 @@ public interface IErpMaterialService
* @param id
* @return
*/
int cancelErpMaterialById(Long id);
ProcessInstance cancelErpMaterialById(Long id);
/**
* 恢复物料信息
* @param id
* @return
*/
int restoreErpMaterialById(Long id);
ProcessInstance restoreErpMaterialById(Long id);
String checkMaterialNoUnique(String materialNo);

110
ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpMaterialServiceImpl.java

@ -24,8 +24,10 @@ import org.activiti.engine.TaskService;
import org.activiti.engine.impl.persistence.entity.TaskEntityImpl;
import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.task.Task;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.*;
@ -66,6 +68,7 @@ public class ErpMaterialServiceImpl implements IErpMaterialService
@Autowired
private ISysRoleService roleService;
/**
* 查询物料信息
*
@ -238,13 +241,58 @@ public class ErpMaterialServiceImpl implements IErpMaterialService
}
@Override
public int cancelErpMaterialById(Long id) {
return erpMaterialMapper.cancelErpMaterialById(id);
@Transactional(rollbackFor = Exception.class)
public ProcessInstance cancelErpMaterialById(Long id) {
ErpMaterialVo erpMaterialVo = erpMaterialMapper.selectErpMaterialById(id);
// 审核状态-待审核
erpMaterialVo.setAuditStatus("0");
SysUser user = ShiroUtils.getSysUser();
// 启动流程
String applyTitle = user.getUserName()+"发起了物料信息作废审批-"+DateUtils.dateTimeNow();
String instanceType = "cancel";
ErpMaterial erpMaterial = new ErpMaterial();
BeanUtils.copyProperties(erpMaterialVo,erpMaterial);
ProcessInstance processInstance = startProcessInstance(applyTitle,instanceType,erpMaterial, user);
String processInstanceId = processInstance.getProcessInstanceId();
// 作废实例id
erpMaterial.setCancelInstanceId(processInstanceId);
// 存在提交完就流程结束的情况
boolean processIsFinish = processService.judgeProcessIsFinish(processInstanceId);
if(processIsFinish){
// 审核状态-审核通过
erpMaterial.setAuditStatus("1");
// 使用状态-已作废
erpMaterial.setUseStatus("2");
}
erpMaterialMapper.updateErpMaterial(erpMaterial);
return processInstance;
}
@Override
public int restoreErpMaterialById(Long id) {
return erpMaterialMapper.restoreErpMaterialById(id);
public ProcessInstance restoreErpMaterialById(Long id) {
ErpMaterialVo erpMaterialVo = erpMaterialMapper.selectErpMaterialById(id);
// 审核状态-待审核
erpMaterialVo.setAuditStatus("0");
SysUser user = ShiroUtils.getSysUser();
// 启动流程
String applyTitle = user.getUserName()+"发起了物料信息恢复审批-"+DateUtils.dateTimeNow();
String instanceType = "restore";
ErpMaterial erpMaterial = new ErpMaterial();
BeanUtils.copyProperties(erpMaterialVo,erpMaterial);
ProcessInstance processInstance = startProcessInstance(applyTitle,instanceType,erpMaterial, user);
String processInstanceId = processInstance.getProcessInstanceId();
// 恢复实例id
erpMaterial.setRestoreInstanceId(processInstanceId);
// 存在提交完就流程结束的情况
boolean processIsFinish = processService.judgeProcessIsFinish(processInstanceId);
if(processIsFinish){
// 审核状态-审核通过
erpMaterial.setAuditStatus("1");
// 使用状态-是
erpMaterial.setUseStatus("1");
}
erpMaterialMapper.updateErpMaterial(erpMaterial);
return processInstance;
}
@Override
@ -278,16 +326,49 @@ public class ErpMaterialServiceImpl implements IErpMaterialService
* @return
*/
@Override
@Transactional(rollbackFor = Exception.class)
public ProcessInstance submitApply(ErpMaterial erpMaterial) {
String applyUser = ShiroUtils.getLoginName();
SysUser user = ShiroUtils.getSysUser();
erpMaterial.setApplyUser(user.getLoginName());
erpMaterial.setApplyTime(DateUtils.getNowDate());
insertErpMaterial(erpMaterial);
String businessKey = erpMaterial.getId().toString(); // 实体类 ID,作为流程的业务 key
// 启动流程
String applyTitle = user.getUserName()+"发起了物料信息提交审批-"+DateUtils.dateTimeNow();
String instanceType = "submit";
ProcessInstance processInstance = startProcessInstance(applyTitle,instanceType,erpMaterial, user);
String processInstanceId = processInstance.getProcessInstanceId();
// 提交实例id
erpMaterial.setSubmitInstanceId(processInstanceId);
// 存在提交完就流程结束的情况
boolean processIsFinish = processService.judgeProcessIsFinish(processInstanceId);
if(processIsFinish){
// 审核状态-审核通过
erpMaterial.setAuditStatus("1");
// 使用状态-是
erpMaterial.setUseStatus("1");
}
erpMaterialMapper.updateErpMaterial(erpMaterial);
return processInstance;
}
private ProcessInstance startProcessInstance(String applyTitle,String instanceType,ErpMaterial erpMaterial, SysUser user) {
Long materialId = erpMaterial.getId();
String businessKey = materialId.toString(); // 实体类 ID,作为流程的业务 key
String key = "material";
Map<String,Object> variables = new HashMap<>();
// 构造authority传参
buildAuthority(user, variables);
erpMaterial.setApplyTitle(applyTitle);
// 启动流程
ProcessInstance processInstance = processService.submitApply(user.getLoginName(), businessKey, applyTitle, erpMaterial.getMaterialNo(), key, variables);
String processInstanceId = processInstance.getId();
erpMaterial.setInstanceId(processInstanceId); // 建立双向关系
erpMaterial.setInstanceType(instanceType);
return processInstance;
}
private void buildAuthority(SysUser user, Map<String, Object> variables) {
Set<String> roleKeys = roleService.selectRoleKeys(user.getUserId());
// 角色不同审核人不同
if(roleKeys.contains("yfzjRole")){
@ -299,20 +380,5 @@ public class ErpMaterialServiceImpl implements IErpMaterialService
}else if(roleKeys.contains("gcwyRole")){
variables.put("authority",1);
}
// 启动流程
String applyTitle = user.getUserName()+"发起了物料信息审批-"+DateUtils.dateTimeNow();
erpMaterial.setApplyTitle(applyTitle);
ProcessInstance processInstance = processService.submitApply(applyUser, businessKey, applyTitle, erpMaterial.getMaterialNo(), key, variables);
String processInstanceId = processInstance.getId();
erpMaterial.setInstanceId(processInstanceId); // 建立双向关系
// 存在提交完就流程结束的情况
boolean processIsFinish = processService.judgeProcessIsFinish(processInstanceId);
if(processIsFinish){
// 审核完成
erpMaterial.setAuditStatus("1");
}
erpMaterialMapper.updateErpMaterial(erpMaterial);
return processInstance;
}
}

23
ruoyi-admin/src/main/resources/application-druid.yml

@ -7,12 +7,25 @@ spring:
port: 6379
password: Read-in2023
timeout: 6000ms # 连接超时时长(毫秒)
lettuce:
# lettuce:
# cluster:
# refresh:
# adptive: true
# pool:
# max-active: 1000 # 连接池最大连接数(使用负值表示没有限制)
# max-wait: -1ms # 连接池最大阻塞等待时间(使用负值表示没有限制)
# max-idle: 10 # 连接池中的最大空闲连接
# min-idle: 5 # 连接池中的最小空闲连接
jedis:
pool:
max-active: 1000 # 连接池最大连接数(使用负值表示没有限制)
max-wait: -1ms # 连接池最大阻塞等待时间(使用负值表示没有限制)
max-idle: 10 # 连接池中的最大空闲连接
min-idle: 5 # 连接池中的最小空闲连接
# 最大空闲连接
max-idle: 10
# 最小空闲链接
min-idle: 5
# 最大连接数(负数表示没有限制)
max-active: 1000
# 最大阻塞等待时间(负数表示没有限制)
max-wait: -1
datasource:
type: com.alibaba.druid.pool.DruidDataSource
driverClassName: com.mysql.cj.jdbc.Driver

34
ruoyi-admin/src/main/resources/mapper/erp/ErpMaterialMapper.xml

@ -28,22 +28,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="photoAttachId" column="photo_attach_id" />
<result property="photoUrl" column="photo_url" />
<result property="instanceId" column="instance_id" />
<result property="instanceType" column="instance_type" />
<result property="instanceTypeName" column="instance_type_name" />
<result property="submitInstanceId" column="submit_instance_id" />
<result property="cancelInstanceId" column="cancel_instance_id" />
<result property="restoreInstanceId" column="restore_instance_id" />
<result property="applyTitle" column="apply_title" />
<result property="applyUser" column="apply_user" />
<result property="applyTime" column="apply_time" />
</resultMap>
<sql id="selectErpMaterialVo">
select id, del_flag, create_by, create_time, update_by, update_time, remark,bomNo, material_no, material_name, audit_status, use_status, hava_product_tem,product_item,itemName, material_type, process_method, unit, brand, `describe`, warehouse_dept,instance_id,apply_title,apply_user,apply_time from erp_material
select id, del_flag, create_by, create_time, update_by, update_time, remark,bomNo, material_no, material_name, audit_status, use_status, hava_product_tem,product_item,itemName, material_type, process_method, unit, brand, `describe`, warehouse_dept,instance_id,instance_type,submit_instance_id,cancel_instance_id,restore_instance_id,apply_title,apply_user,apply_time from erp_material
</sql>
<select id="selectErpMaterialList" parameterType="ErpMaterialVo" resultMap="ErpMaterialResult">
select erp.id, erp.del_flag, erp.create_by, erp.create_time, erp.update_by, erp.update_time, erp.remark,erp.bomNo, erp.material_no
, erp.material_name, erp.audit_status, erp.use_status, erp.hava_product_tem, erp.product_item,erp.`itemName`, erp.material_type, erp.process_method
, erp.unit, erp.brand, erp.`describe`, erp.warehouse_dept
,erp.instance_id,erp.apply_title,erp.apply_user,erp.apply_time
,erp.instance_id,erp.instance_type,process_type_dict.dict_label as instance_type_name,erp.submit_instance_id,erp.cancel_instance_id,erp.restore_instance_id,erp.apply_title,erp.apply_user,erp.apply_time
,file.url as photo_url
from erp_material as erp
from erp_material erp
left join(
select dict_value,dict_label from sys_dict_data
where dict_type = 'processType'
)process_type_dict
on erp.instance_type = process_type_dict.dict_value
left join (
select
att.rel_id
@ -75,6 +85,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="describe != null and describe != ''"> and erp.`describe` = #{describe}</if>
<if test="warehouseDept != null and warehouseDept != ''"> and erp.warehouse_dept = #{warehouseDept}</if>
<if test="instanceId != null and instanceId != ''"> and erp.instance_id = #{instanceId}</if>
<if test="instanceType != null and instanceType != ''"> and erp.instance_type = #{instanceType}</if>
<if test="submitInstanceId != null and submitInstanceId != ''"> and erp.submit_instance_id = #{submitInstanceId}</if>
<if test="cancelInstanceId != null and cancelInstanceId != ''"> and erp.cancel_instance_id = #{cancelInstanceId}</if>
<if test="restoreInstanceId != null and restoreInstanceId != ''"> and erp.restore_instance_id = #{restoreInstanceId}</if>
<if test="applyTitle != null and applyTitle != ''"> and erp.apply_title = #{applyTitle}</if>
<if test="applyUser != null and applyUser != ''"> and erp.apply_user = #{applyUser}</if>
<if test="applyTime != null "> and erp.apply_time = #{applyTime}</if>
@ -86,7 +100,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select erp.id, erp.del_flag, erp.create_by, erp.create_time, erp.update_by, erp.update_time, erp.remark,erp.bomNo, erp.material_no
, erp.material_name, erp.audit_status, erp.use_status, erp.hava_product_tem,erp.product_item,erp.itemName, erp.material_type
, erp.process_method, erp.unit, erp.brand, erp.describe, erp.warehouse_dept
,erp.instance_id,erp.apply_title,erp.apply_user,erp.apply_time
,erp.instance_id,erp.instance_type,erp.submit_instance_id,erp.cancel_instance_id,erp.restore_instance_id,erp.apply_title,erp.apply_user,erp.apply_time
,att.id as photo_attach_id
from erp_material erp
left join sys_attach att
@ -119,6 +133,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="auditStatus != null">audit_status,</if>
<if test="useStatus != null">use_status,</if>
<if test="instanceId != null">instance_id,</if>
<if test="instanceType != null">instance_type,</if>
<if test="submitInstanceId != null">submit_instance_id,</if>
<if test="cancelInstanceId != null">cancel_instance_id,</if>
<if test="restoreInstanceId != null">restore_instance_id,</if>
<if test="applyTitle != null">apply_title,</if>
<if test="applyUser != null">apply_user,</if>
<if test="applyTime != null">apply_time,</if>
@ -145,6 +163,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="auditStatus != null">#{auditStatus},</if>
<if test="useStatus != null">#{useStatus},</if>
<if test="instanceId != null">#{instanceId},</if>
<if test="instanceType != null">#{instanceType},</if>
<if test="submitInstanceId != null">#{submitInstanceId},</if>
<if test="cancelInstanceId != null">#{cancelInstanceId},</if>
<if test="restoreInstanceId != null">#{restoreInstanceId},</if>
<if test="applyTitle != null">#{applyTitle},</if>
<if test="applyUser != null">#{applyUser},</if>
<if test="applyTime != null">#{applyTime},</if>
@ -177,6 +199,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="describe != null">`describe` = #{describe},</if>
<if test="warehouseDept != null">warehouse_dept = #{warehouseDept},</if>
<if test="instanceId != null">instance_id = #{instanceId},</if>
<if test="instanceType != null">instance_type = #{instanceType},</if>
<if test="submitInstanceId != null">submit_instance_id = #{submitInstanceId},</if>
<if test="cancelInstanceId != null">cancel_instance_id = #{cancelInstanceId},</if>
<if test="restoreInstanceId != null">restore_instance_id = #{restoreInstanceId},</if>
<if test="applyTitle != null">apply_title = #{applyTitle},</if>
<if test="applyUser != null">apply_user = #{applyUser},</if>
<if test="applyTime != null">apply_time = #{applyTime},</if>

54
ruoyi-admin/src/main/resources/templates/erp/material/material.html

@ -411,6 +411,7 @@
var cancelFlag = [[${@permission.hasPermi('erp:material:cancel')}]];
var restoreFlag = [[${@permission.hasPermi('erp:material:restore')}]];
var auditStatusDatas = [[${@dict.getType('auditStatus')}]];
// var processTypeDatas = [[${@dict.getType('processType')}]];
var useStatusDatas = [[${@dict.getType('useStatus')}]];
var processMethodDatas = [[${@dict.getType('processMethod')}]];
var sysUnitClassDatas = [[${@dict.getType('sysUnitClassDatas')}]];
@ -447,7 +448,28 @@
},
{
field: 'instanceId',
title: '流程实例ID'
title: '流程实例ID',
visible: false
},
{
field: 'submitInstanceId',
title: '流程提交实例ID',
visible: false
},
{
field: 'cancelInstanceId',
title: '流程作废实例ID',
visible: false
},
{
field: 'restoreInstanceId',
title: '流程恢复实例ID',
visible: false
},
{
field: 'instanceTypeName',
title: '流程实例类型',
visible: false
},
{
field: 'applyUser',
@ -499,6 +521,11 @@
},
{
field: 'createBy',
title: '工程员ID',
visible: false
},
{
field: 'createUserName',
title: '工程员'
},
{
@ -593,27 +620,36 @@
align: 'center',
formatter: function(value, row, index) {
var actions = [];
// 审核状态-审核通过 使用状态-是 未发起作废流程
if(row.auditStatus=="1" && row.useStatus=="1" && !row.cancelInstanceId){
// 作废
actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="$.operate.cancel(\'' + row.id + '\')"><i class="fa fa-remove"></i> 作废</a>');
// 编辑
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i> 编辑</a> ');
}
// 已作废
if(row.useStatus=="2" && !row.restoreInstanceId){
// 恢复
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="$.operate.restore(\'' + row.id + '\')"><i class="fa fa-window-restore"></i> 恢复</a> ');
}
// 有流程实例id
if (row.instanceId) {
// 有待办人展示审批按钮,
if (row.todoUserId) {
var todoUserIdList = row.todoUserId.split(",");
if(todoUserIdList.includes(loginName)){
var nodeName = row.taskName=='驳回调整'?' 调整申请':' 审批';
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="showVerifyDialog(\'' + prefix + '\',\'' + row.taskId + '\', \'' + row.taskName + '\')"><i class="fa fa-edit"></i> '+nodeName+'</a> ');
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="showVerifyDialog(\'' + prefix + '\',\'' + row.taskId + '\', \'' + row.taskName+"-"+row.instanceTypeName+"申请" + '\')"><i class="fa fa-edit"></i> '+nodeName+'</a> ');
}
}
// 详情
actions.push('<a class="btn btn-primary btn-xs" href="javascript:void(0)" onclick="$.operate.detail(\'' + row.id + '\')"><i class="fa fa-eye"></i> 详情</a> ');
// 审批历史
actions.push('<a class="btn btn-warning btn-xs" href="javascript:void(0)" onclick="showHistoryDialog(\'' + row.instanceId + '\')"><i class="fa fa-list"></i> 审批历史</a> ');
// 进度查看
actions.push('<a class="btn btn-info btn-xs" href="javascript:void(0)" onclick="showProcessImgDialog(\'' + row.instanceId + '\')"><i class="fa fa-image"></i> 进度查看</a> ');
} else {
// 编辑
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
// 删除
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
}
// 详情
actions.push('<a class="btn btn-primary btn-xs" href="javascript:void(0)" onclick="$.operate.detail(\'' + row.id + '\')"><i class="fa fa-eye"></i> 详情</a> ');
/*actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-primary btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="showdetails(\'' + index + '\')"><i class="fa fa-eye"></i>详情</a> ');
actions.push('<a class="btn btn-success btn-xs ' + auditFlag + '" href="javascript:void(0)" onclick="showMaterial(\'' + index + '\')"><i class="fa fa-file-o"></i>审核</a> ');

11
ruoyi-common/pom.xml

@ -66,6 +66,17 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
<exclusions>
<exclusion>
<groupId>io.lettuce</groupId>
<artifactId>lettuce-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
</dependency>
<!-- pagehelper 分页插件 -->

Loading…
Cancel
Save