Commit 921526bd by 赵剑炜

调整审核流

parent bd6bb885
......@@ -15,6 +15,7 @@ import com.junmp.jyzb.api.exception.enums.OrderExceptionEnum;
import com.junmp.jyzb.entity.OrderMain;
import com.junmp.jyzb.entity.SupplierType;
import com.junmp.jyzb.service.OrderMainService;
import com.junmp.jyzb.service.ReassignmentService;
import com.junmp.v2.auth.api.bean.login.LoginUser;
import com.junmp.v2.auth.api.context.LoginContext;
import com.junmp.v2.common.exception.base.ServiceException;
......@@ -58,9 +59,8 @@ public class CounterSignListener implements ExecutionListener {
private RepositoryService repositoryService;
@Resource
private OrgUserMapper orgUserMapper;
@Resource
private HistoryService historyService;
private ReassignmentService reassignmentService;
@Override
public void notify(DelegateExecution execution) {
String currentActivityId = execution.getCurrentActivityId();
......@@ -201,15 +201,19 @@ public class CounterSignListener implements ExecutionListener {
{
OrderMain om= orderMainService.getOne(new LambdaQueryWrapper<OrderMain>()
.eq(OrderMain::getProcessId, execution.getProcessInstanceId()));
if (om!=null)//判断有没有启动的当前单据
if (om!=null&&assigneeList.size()>0)//判断有没有启动的当前单据,并且下一审核人信息不为空,有启动的单据则把审核人信息加入
{
List<String> currentAssigneeList = (List<String>) om;
List<String> currentAssigneeList = (List<String>) assigneeList;
String assigneeString = String.join(",", currentAssigneeList);
om.setCurrentAssign(assigneeString);
orderMainService.updateById(om);
}
}
else if (orderType.equals("reassigment"))//警员相关
{
}
assigneeList.forEach(userId->//为相应的用户推送消息
{
if (userId!=LoginContext.getContext().getLoginUser().getUserId().toString())//非本人审核单据
......
......@@ -178,15 +178,18 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
//list返回数据
List<String> list=new ArrayList<>();
if (processInstanceId.substring(0,2).equals("TG")){
String substring = processInstanceId.substring(2);
order.setProcessId(substring);
processInstanceId = processInstanceId.substring(2);
order.setProcessId(processInstanceId);
if (ObjectUtil.isNotNull(req.getId()) && !req.getId().trim().isEmpty()) {
updateById(order);
} else {
//保存
this.save(order);
}
Task currentTask = taskService.createTaskQuery().processInstanceId(substring).singleResult();
Task currentTask = taskService.createTaskQuery().processInstanceId(processInstanceId).singleResult();
String assigns= FlowInstanceService.GetNextAssign(processInstanceId);
order.setCurrentAssign(assigns);
updateById(order);
// 直接完成当前任务
taskService.complete(currentTask.getId());
}else {
......@@ -198,6 +201,13 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
this.save(order);
}
}
String assigns= FlowInstanceService.GetNextAssign(processInstanceId);//这里需要手动更新审核人信息
if (assigns != null && !assigns.isEmpty())
{
order.setCurrentAssign(assigns);
updateById(order);
}
list.add(order.getId());
for (OrderDetail orderDetail:detailList) {
list.add(Long.toString(orderDetail.getId()));
......
......@@ -39,6 +39,13 @@ public interface IFlowInstanceService {
String startProcessInstanceById(StartProcessInstanceDTO processInstanceDto);
/**
* 获取下一审核人信息
*
* @return
*/
String GetNextAssign(String processInstanceId);
/**
* 通过流程实例id獲取表單ID
*
* @return
......
......@@ -33,6 +33,7 @@ import org.flowable.engine.repository.ProcessDefinition;
import org.flowable.engine.runtime.ProcessInstance;
import org.flowable.engine.runtime.ProcessInstanceBuilder;
import org.flowable.task.api.Task;
import org.flowable.variable.api.history.HistoricVariableInstance;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
......@@ -103,6 +104,24 @@ public class FlowInstanceServiceImpl extends FlowServiceFactory implements IFlow
return historicProcessInstance;
}
///获取下一个审核人信息
@Override
public String GetNextAssign(String processInstanceId)
{
String assigneeString="";
Object assigneeObject = runtimeService.getVariable(processInstanceId, "currentAssignee");
if (assigneeObject instanceof List) {
List<String> assigneeList = (List<String>) assigneeObject;
assigneeString = String.join(",", assigneeList);
// 现在 assigneeString 中包含了集合元素用逗号拼接的字符串
}
return assigneeString;
}
@Override
public String startProcessInstanceById(StartProcessInstanceDTO processInstanceDto) {
SysUser StartUser=new SysUser();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论