外协人员批量审批

This commit is contained in:
2025-12-11 14:49:20 +08:00
parent 0b48e4d785
commit 470e14e7a2
28 changed files with 2304 additions and 35 deletions

View File

@@ -3,6 +3,7 @@ package com.jeelowcode.service.bpm.config.framework.portal.core.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import java.util.Date;
@@ -12,6 +13,7 @@ import static com.jeelowcode.tool.framework.common.util.date.DateUtils.TIME_ZONE
/**
* 描述:接收待阅流程请求参数
*/
@Accessors(chain = true)
@Data
public class ReceiveCCRequestDTO {

View File

@@ -6,10 +6,12 @@ import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import lombok.Data;
import lombok.experimental.Accessors;
import java.util.Collection;
@Schema(description = "管理后台 - 流程实例抄送的创建 Request VO")
@Accessors(chain = true)
@Data
public class BpmProcessInstanceCopyCreateReqVO {

View File

@@ -4,6 +4,7 @@ import com.jeelowcode.tool.framework.mybatis.core.dataobject.BaseDO;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.*;
import lombok.experimental.Accessors;
/**
* 流程抄送 DO
@@ -12,6 +13,7 @@ import lombok.*;
* @since 2024-01-22
*/
@TableName(value = "bpm_process_instance_copy", autoResultMap = true)
@Accessors(chain = true)
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)

View File

@@ -1,5 +1,6 @@
package com.jeelowcode.service.bpm.service.impl;
import cn.hutool.json.JSONObject;
import com.jeelowcode.core.framework.entity.FormEntity;
import com.jeelowcode.core.framework.enums.ApproveStatusEnum;
import com.jeelowcode.core.framework.mapper.FormMapper;
@@ -9,13 +10,9 @@ import com.jeelowcode.service.bpm.controller.vo.instance.BpmProcessInstanceRespV
import com.jeelowcode.service.bpm.service.IBpmProcessInstanceService;
import com.jeelowcode.tool.framework.datapermission.core.annotation.DataPermission;
import lombok.extern.slf4j.Slf4j;
import org.flowable.engine.impl.persistence.entity.ExecutionEntityImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;
@Service
@Slf4j
@@ -27,8 +24,6 @@ public class BillApproveStatusService {
public void afterSubmit(String processInstanceId){
Map<String,Object> map = new HashMap<>();
//流程实例id
BpmProcessInstanceRespVO vo = SpringUtils.getBean(IBpmProcessInstanceService.class).getProcessInstanceVO(processInstanceId);
//获取到的自定义表单数据id
@@ -37,17 +32,16 @@ public class BillApproveStatusService {
Long formId = vo.getProcessDefinition().getFormId();
FormEntity formEntity = SpringUtils.getBean(FormMapper.class).getByWebId(formId);
Map<String,Object> json = new HashMap<>();
// 使用 editJsonData 方法,这样会触发增强机制
JSONObject json = new JSONObject();
json.put("id", id);
json.put(ApproveStatusEnum.codeField, ApproveStatusEnum.APPROVING.getCode());
json.put(ApproveStatusEnum.nameField, ApproveStatusEnum.APPROVING.getDesc());
json.put("ProcessInstanceId", processInstanceId);
dbformDataService.update(formEntity.getTableName(),id,json);
json.put("processInstanceId", processInstanceId);
dbformDataService.editJsonData(formEntity.getId(), json);
}
public void afterApproved(String processInstanceId){
Map<String,Object> map = new HashMap<>();
//流程实例id
BpmProcessInstanceRespVO vo = SpringUtils.getBean(IBpmProcessInstanceService.class).getProcessInstanceVO(processInstanceId);
//获取到的自定义表单数据id
@@ -55,17 +49,15 @@ public class BillApproveStatusService {
//数据表id
Long formId = vo.getProcessDefinition().getFormId();
FormEntity formEntity = SpringUtils.getBean(FormMapper.class).getByWebId(formId);
Map<String,Object> json = new HashMap<>();
// 使用 editJsonData 方法,这样会触发增强机制
JSONObject json = new JSONObject();
json.put("id", id);
json.put(ApproveStatusEnum.codeField, ApproveStatusEnum.APPROVED.getCode());
json.put(ApproveStatusEnum.nameField, ApproveStatusEnum.APPROVED.getDesc());
dbformDataService.update(formEntity.getTableName(),id,json);
dbformDataService.editJsonData(formEntity.getId(), json);
}
public void afterRejected(String processInstanceId){
Map<String,Object> map = new HashMap<>();
//流程实例id
BpmProcessInstanceRespVO vo = SpringUtils.getBean(IBpmProcessInstanceService.class).getProcessInstanceVO(processInstanceId);
//获取到的自定义表单数据id
@@ -73,18 +65,16 @@ public class BillApproveStatusService {
//数据表id
Long formId = vo.getProcessDefinition().getFormId();
FormEntity formEntity = SpringUtils.getBean(FormMapper.class).getByWebId(formId);
Map<String,Object> json = new HashMap<>();
// 使用 editJsonData 方法,这样会触发增强机制
JSONObject json = new JSONObject();
json.put("id", id);
json.put(ApproveStatusEnum.codeField, ApproveStatusEnum.REJECTED.getCode());
json.put(ApproveStatusEnum.nameField, ApproveStatusEnum.REJECTED.getDesc());
dbformDataService.update(formEntity.getTableName(),id,json);
dbformDataService.editJsonData(formEntity.getId(), json);
}
public void afterCancel(String processInstanceId){
Map<String,Object> map = new HashMap<>();
//流程实例id
BpmProcessInstanceRespVO vo = SpringUtils.getBean(IBpmProcessInstanceService.class).getProcessInstanceVO(processInstanceId);
//获取到的自定义表单数据id
@@ -92,11 +82,11 @@ public class BillApproveStatusService {
//数据表id
Long formId = vo.getProcessDefinition().getFormId();
FormEntity formEntity = SpringUtils.getBean(FormMapper.class).getByWebId(formId);
Map<String,Object> json = new HashMap<>();
// 使用 editJsonData 方法,这样会触发增强机制
JSONObject json = new JSONObject();
json.put("id", id);
json.put(ApproveStatusEnum.codeField, ApproveStatusEnum.UNAPPROVED.getCode());
json.put(ApproveStatusEnum.nameField, ApproveStatusEnum.UNAPPROVED.getDesc());
dbformDataService.update(formEntity.getTableName(),id,json);
dbformDataService.editJsonData(formEntity.getId(), json);
}
}

View File

@@ -24,7 +24,6 @@ import com.jeelowcode.service.bpm.service.IBpmProcessInstanceCopyService;
import com.jeelowcode.service.bpm.service.IBpmProcessInstanceService;
import com.jeelowcode.service.bpm.service.IBpmTaskService;
import com.jeelowcode.service.bpm.dto.BpmDelegateExecutionDTO;
import com.jeelowcode.tool.framework.common.util.object.ObjectUtils;
import lombok.extern.slf4j.Slf4j;
import org.flowable.engine.RuntimeService;
import org.flowable.engine.delegate.DelegateExecution;