Commit d6461a87 by 赵剑炜

获取最新代码

parent ef0d24b6
...@@ -86,6 +86,8 @@ public class OrderMain implements Serializable { ...@@ -86,6 +86,8 @@ public class OrderMain implements Serializable {
@TableField("inv_list") @TableField("inv_list")
private String invList; private String invList;
@TableField("current_assign")
private String currentAssign;
@TableField("return_date") @TableField("return_date")
private Date returnDate; private Date returnDate;
......
...@@ -5,16 +5,20 @@ import cn.hutool.core.date.DateTime; ...@@ -5,16 +5,20 @@ import cn.hutool.core.date.DateTime;
import cn.hutool.core.map.MapUtil; import cn.hutool.core.map.MapUtil;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference; import com.alibaba.fastjson.TypeReference;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.junmp.junmpProcess.dto.UserListDTO; import com.junmp.junmpProcess.dto.UserListDTO;
import com.junmp.junmpProcess.dto.json.*; import com.junmp.junmpProcess.dto.json.*;
import com.junmp.junmpProcess.exception.WorkFlowException; import com.junmp.junmpProcess.exception.WorkFlowException;
import com.junmp.junmpProcess.mapper.OrgUserMapper; import com.junmp.junmpProcess.mapper.OrgUserMapper;
import com.junmp.junmpProcess.service.Repository.ProcessTemplateService; import com.junmp.junmpProcess.service.Repository.ProcessTemplateService;
import com.junmp.jyzb.api.exception.enums.OrderExceptionEnum; import com.junmp.jyzb.api.exception.enums.OrderExceptionEnum;
import com.junmp.jyzb.entity.OrderMain;
import com.junmp.jyzb.entity.SupplierType; import com.junmp.jyzb.entity.SupplierType;
import com.junmp.jyzb.service.OrderMainService;
import com.junmp.v2.auth.api.bean.login.LoginUser; import com.junmp.v2.auth.api.bean.login.LoginUser;
import com.junmp.v2.auth.api.context.LoginContext; import com.junmp.v2.auth.api.context.LoginContext;
import com.junmp.v2.common.exception.base.ServiceException; import com.junmp.v2.common.exception.base.ServiceException;
import com.junmp.v2.dict.entity.SysDict;
import com.junmp.v2.message.api.MessageApi; import com.junmp.v2.message.api.MessageApi;
import com.junmp.v2.message.api.bean.req.MessageReq; import com.junmp.v2.message.api.bean.req.MessageReq;
import com.junmp.v2.message.api.bean.req.MessageSendReq; import com.junmp.v2.message.api.bean.req.MessageSendReq;
...@@ -46,10 +50,8 @@ import static com.junmp.junmpProcess.utils.BpmnModelUtils.getChildNode; ...@@ -46,10 +50,8 @@ import static com.junmp.junmpProcess.utils.BpmnModelUtils.getChildNode;
*/ */
@Component @Component
public class CounterSignListener implements ExecutionListener { public class CounterSignListener implements ExecutionListener {
@Autowired
private ProcessEngine processEngine;
@Resource @Resource
private TaskService taskService; public OrderMainService orderMainService;
@Resource @Resource
private MessageApi messageApi; private MessageApi messageApi;
@Resource @Resource
...@@ -188,25 +190,26 @@ public class CounterSignListener implements ExecutionListener { ...@@ -188,25 +190,26 @@ public class CounterSignListener implements ExecutionListener {
assigneeList.add(LoginContext.getContext().getLoginUser().getUserId().toString()); assigneeList.add(LoginContext.getContext().getLoginUser().getUserId().toString());
execution.setVariable("skip", true); execution.setVariable("skip", true);
// // 查询当前执行流程实例的任务列表
// String processInstanceId = execution.getProcessInstanceId();
// List<Task> tasks = taskService.createTaskQuery().processInstanceId(processInstanceId).list();
//
// // 如果任务列表为空,说明流程刚启动,直接完成整个流程实例
// if (tasks.isEmpty()) {
// ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
// RuntimeService runtimeService = processEngine.getRuntimeService();
// runtimeService.deleteProcessInstance(processInstanceId, "自动审批通过");
// } else {
// // 完成找到的第一个任务
// taskService.complete(tasks.get(0).getId(), null);
// }
} }
if (assigneeList.size()!=0) if (assigneeList.size()!=0)
{ {
execution.setVariable(variable, assigneeList); execution.setVariable(variable, assigneeList);
execution.setVariable("currentAssignee", assigneeList);
//为流程进行中的单据设置审核信息
String orderType= execution.getVariable("orderType").toString();
if (orderType.equals("workOrder"))
{
OrderMain om= orderMainService.getOne(new LambdaQueryWrapper<OrderMain>()
.eq(OrderMain::getProcessId, execution.getProcessInstanceId()));
if (om!=null)//判断有没有启动的当前单据
{
List<String> currentAssigneeList = (List<String>) om;
String assigneeString = String.join(",", currentAssigneeList);
om.setCurrentAssign(assigneeString);
orderMainService.updateById(om);
}
}
assigneeList.forEach(userId->//为相应的用户推送消息 assigneeList.forEach(userId->//为相应的用户推送消息
{ {
if (userId!=LoginContext.getContext().getLoginUser().getUserId().toString())//非本人审核单据 if (userId!=LoginContext.getContext().getLoginUser().getUserId().toString())//非本人审核单据
......
package com.junmp.junmpProcess.mapper; package com.junmp.junmpProcess.mapper;
import com.junmp.junmpProcess.dto.UserListDTO; import com.junmp.junmpProcess.dto.UserListDTO;
import io.lettuce.core.dynamic.annotation.Param;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import java.util.List; import java.util.List;
...@@ -26,4 +27,6 @@ public interface OrgUserMapper { ...@@ -26,4 +27,6 @@ public interface OrgUserMapper {
public List<UserListDTO> QueryUserWithParentOrg(String userId); public List<UserListDTO> QueryUserWithParentOrg(String userId);
public UserListDTO QueryUser(String userId); public UserListDTO QueryUser(String userId);
public Boolean UpdateOrder(@Param("orderType") String orderType,@Param("process_id") String processId, @Param("current_assign") String currentAssign);
} }
...@@ -72,6 +72,9 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask ...@@ -72,6 +72,9 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
@Resource @Resource
private SysUserService sysUserService; private SysUserService sysUserService;
@Resource
private OrgUserMapper orgUserMapper;
@Autowired @Autowired
private ProcessTemplateService processTemplateService; private ProcessTemplateService processTemplateService;
@Autowired @Autowired
...@@ -118,10 +121,6 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask ...@@ -118,10 +121,6 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
taskService.createAttachment("option", taskId, task.getProcessInstanceId(), attachment.getName(), attachment.getName(), attachment.getUrl()); taskService.createAttachment("option", taskId, task.getProcessInstanceId(), attachment.getName(), attachment.getName(), attachment.getUrl());
} }
} }
// if (StringUtils.isNotBlank(handleDataDTO.getSignInfo())) {
// taskService.addComment(task.getId(), task.getProcessInstanceId(), "sign", handleDataDTO.getSignInfo());
// }
taskService.complete(task.getId()); taskService.complete(task.getId());
HistoricTaskInstance historicTask = historyService HistoricTaskInstance historicTask = historyService
.createHistoricTaskInstanceQuery() .createHistoricTaskInstanceQuery()
...@@ -137,6 +136,22 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask ...@@ -137,6 +136,22 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
} }
else
{
// HistoricVariableInstance orderType = historyService.createHistoricVariableInstanceQuery().processInstanceId(processInstanceId).variableName("orderType").list().get(0);
// if (orderType.equals("workOrder"))
// {
// Object assigneeObject = runtimeService.getVariable(processInstanceId, "currentAssignee");
//
// if (assigneeObject instanceof List) {
// List<String> assigneeList = (List<String>) assigneeObject;
//
// String assigneeString = String.join(",", assigneeList);
// orgUserMapper.UpdateOrder("bussiness_order_main",processInstanceId,assigneeString);
// // 现在 assigneeString 中包含了集合元素用逗号拼接的字符串
// }
// }
}
return new ResponseResult(HttpStatus.SUCCESS, ReturnMsg.PASS,ReturnMsg.PASS); return new ResponseResult(HttpStatus.SUCCESS, ReturnMsg.PASS,ReturnMsg.PASS);
} }
......
...@@ -38,7 +38,11 @@ ...@@ -38,7 +38,11 @@
where su.user_id = ${userId} where su.user_id = ${userId}
</select> </select>
<update id="UpdateOrder">
UPDATE #{orderType}
SET current_assign = #{current_assign}
WHERE process_id = #{process_id}
</update>
<select id="QueryUserWithParentOrg" resultMap="UserListDTO"> <select id="QueryUserWithParentOrg" resultMap="UserListDTO">
SELECT SELECT
CASE CASE
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论