Commit 7b58df6e by 赵剑炜

增加审核人信息

parent 921526bd
...@@ -227,6 +227,12 @@ public class BusForm implements Serializable { ...@@ -227,6 +227,12 @@ public class BusForm implements Serializable {
*/ */
@TableField(value = "destory_name") @TableField(value = "destory_name")
private String destoryName; private String destoryName;
/**
* 审核人信息
*/
@TableField(value = "current_assign")
private String currentAssign;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
......
...@@ -83,6 +83,11 @@ public class Reassignment implements Serializable { ...@@ -83,6 +83,11 @@ public class Reassignment implements Serializable {
private String examineState; private String examineState;
/** /**
* 当前审核人
*/
@TableField(value = "current_assign")
private String currentAssign;
/**
* 经办人 * 经办人
*/ */
@TableField(value = "user_name") @TableField(value = "user_name")
......
...@@ -25,7 +25,11 @@ public class Stocktake implements Serializable { ...@@ -25,7 +25,11 @@ public class Stocktake implements Serializable {
*/ */
@TableField(value = "process_id") @TableField(value = "process_id")
private String processId; private String processId;
/**
* 当前审核人
*/
@TableField(value = "current_assign")
private String currentAssign;
/** /**
* 单据业务类型:盘库stocktake * 单据业务类型:盘库stocktake
*/ */
......
...@@ -12,10 +12,11 @@ import com.junmp.junmpProcess.exception.WorkFlowException; ...@@ -12,10 +12,11 @@ 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.*;
import com.junmp.jyzb.entity.SupplierType; import com.junmp.jyzb.service.BusFormService;
import com.junmp.jyzb.service.OrderMainService; import com.junmp.jyzb.service.OrderMainService;
import com.junmp.jyzb.service.ReassignmentService; import com.junmp.jyzb.service.ReassignmentService;
import com.junmp.jyzb.service.StocktakeService;
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;
...@@ -54,6 +55,11 @@ public class CounterSignListener implements ExecutionListener { ...@@ -54,6 +55,11 @@ public class CounterSignListener implements ExecutionListener {
@Resource @Resource
public OrderMainService orderMainService; public OrderMainService orderMainService;
@Resource @Resource
private StocktakeService stocktakeService;
@Resource
public BusFormService busFormService;
@Resource
private MessageApi messageApi; private MessageApi messageApi;
@Resource @Resource
private RepositoryService repositoryService; private RepositoryService repositoryService;
...@@ -203,16 +209,46 @@ public class CounterSignListener implements ExecutionListener { ...@@ -203,16 +209,46 @@ public class CounterSignListener implements ExecutionListener {
.eq(OrderMain::getProcessId, execution.getProcessInstanceId())); .eq(OrderMain::getProcessId, execution.getProcessInstanceId()));
if (om!=null&&assigneeList.size()>0)//判断有没有启动的当前单据,并且下一审核人信息不为空,有启动的单据则把审核人信息加入 if (om!=null&&assigneeList.size()>0)//判断有没有启动的当前单据,并且下一审核人信息不为空,有启动的单据则把审核人信息加入
{ {
List<String> currentAssigneeList = (List<String>) assigneeList;
String assigneeString = String.join(",", currentAssigneeList); String assigneeString = String.join(",", assigneeList);
om.setCurrentAssign(assigneeString); om.setCurrentAssign(assigneeString);
orderMainService.updateById(om); orderMainService.updateById(om);
} }
} }
else if (orderType.equals("reassigment"))//警员相关 else if (orderType.equals("reassigment"))//调岗相关
{
Reassignment re= reassignmentService.getOne(new LambdaQueryWrapper<Reassignment>()
.eq(Reassignment::getProcessId, execution.getProcessInstanceId()));
if (re!=null&&assigneeList.size()>0)//判断有没有启动的当前单据,并且下一审核人信息不为空,有启动的单据则把审核人信息加入
{ {
String assigneeString = String.join(",", assigneeList);
re.setCurrentAssign(assigneeString);
reassignmentService.updateById(re);
}
}
else if (orderType.equals("bussinessOrder"))//业务单据
{
BusForm re= busFormService.getOne(new LambdaQueryWrapper<BusForm>()
.eq(BusForm::getProcessId, execution.getProcessInstanceId()));
if (re!=null&&assigneeList.size()>0)//判断有没有启动的当前单据,并且下一审核人信息不为空,有启动的单据则把审核人信息加入
{
String assigneeString = String.join(",", assigneeList);
re.setCurrentAssign(assigneeString);
busFormService.updateById(re);
}
}
else if (orderType.equals("stocktakeOrder"))//业务单据
{
Stocktake re= stocktakeService.getOne(new LambdaQueryWrapper<Stocktake>()
.eq(Stocktake::getProcessId, execution.getProcessInstanceId()));
if (re!=null&&assigneeList.size()>0)//判断有没有启动的当前单据,并且下一审核人信息不为空,有启动的单据则把审核人信息加入
{
String assigneeString = String.join(",", assigneeList);
re.setCurrentAssign(assigneeString);
stocktakeService.updateById(re);
}
} }
assigneeList.forEach(userId->//为相应的用户推送消息 assigneeList.forEach(userId->//为相应的用户推送消息
{ {
......
...@@ -106,8 +106,11 @@ public class BusFormServiceImpl extends ServiceImpl<BusFormMapper, BusForm> impl ...@@ -106,8 +106,11 @@ public class BusFormServiceImpl extends ServiceImpl<BusFormMapper, BusForm> impl
String ProcessInstanceId= FlowInstanceService.startProcessInstanceById(startProcessInstanceDTO); String ProcessInstanceId= FlowInstanceService.startProcessInstanceById(startProcessInstanceDTO);
busForm.setProcessId(ProcessInstanceId); busForm.setProcessId(ProcessInstanceId);
String assigns= FlowInstanceService.GetNextAssign(ProcessInstanceId);//这里需要手动更新审核人信息
busForm.setCurrentAssign(assigns);
} }
if(ObjectUtil.isNotNull(req.getId())){ if(ObjectUtil.isNotNull(req.getId())){
//已经是一个草稿,在点击提交的时候只需要更新即可,因为数据库中已经存在该单据 //已经是一个草稿,在点击提交的时候只需要更新即可,因为数据库中已经存在该单据
updateById(busForm); updateById(busForm);
......
...@@ -177,36 +177,23 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain ...@@ -177,36 +177,23 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
} }
//list返回数据 //list返回数据
List<String> list=new ArrayList<>(); List<String> list=new ArrayList<>();
String assigns= FlowInstanceService.GetNextAssign(processInstanceId);
order.setCurrentAssign(assigns);
if (processInstanceId.substring(0,2).equals("TG")){ if (processInstanceId.substring(0,2).equals("TG")){
processInstanceId = processInstanceId.substring(2); processInstanceId = processInstanceId.substring(2);
order.setProcessId(processInstanceId); order.setProcessId(processInstanceId);
if (ObjectUtil.isNotNull(req.getId()) && !req.getId().trim().isEmpty()) {
updateById(order);
} else {
//保存
this.save(order);
}
Task currentTask = taskService.createTaskQuery().processInstanceId(processInstanceId).singleResult(); Task currentTask = taskService.createTaskQuery().processInstanceId(processInstanceId).singleResult();
String assigns= FlowInstanceService.GetNextAssign(processInstanceId);
order.setCurrentAssign(assigns);
updateById(order);
// 直接完成当前任务 // 直接完成当前任务
taskService.complete(currentTask.getId()); taskService.complete(currentTask.getId());
}else { }else {
order.setProcessId(processInstanceId); order.setProcessId(processInstanceId);
}
if (ObjectUtil.isNotNull(req.getId()) && !req.getId().trim().isEmpty()) { if (ObjectUtil.isNotNull(req.getId()) && !req.getId().trim().isEmpty()) {
updateById(order); updateById(order);
} else { } else {
//保存 //保存
this.save(order); this.save(order);
} }
}
String assigns= FlowInstanceService.GetNextAssign(processInstanceId);//这里需要手动更新审核人信息
if (assigns != null && !assigns.isEmpty())
{
order.setCurrentAssign(assigns);
updateById(order);
}
list.add(order.getId()); list.add(order.getId());
for (OrderDetail orderDetail:detailList) { for (OrderDetail orderDetail:detailList) {
......
...@@ -724,6 +724,8 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman ...@@ -724,6 +724,8 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
startProcessInstanceDTO.setUserId(req.getUserId()); startProcessInstanceDTO.setUserId(req.getUserId());
String ProcessInstanceId= FlowInstanceService.startProcessInstanceById(startProcessInstanceDTO); String ProcessInstanceId= FlowInstanceService.startProcessInstanceById(startProcessInstanceDTO);
reassignment.setProcessId(ProcessInstanceId); reassignment.setProcessId(ProcessInstanceId);
String assigns= FlowInstanceService.GetNextAssign(ProcessInstanceId);//这里需要手动更新审核人信息
reassignment.setCurrentAssign(assigns);
reassignmentService.updateById(reassignment); reassignmentService.updateById(reassignment);
} }
return reassignment.getId(); return reassignment.getId();
......
...@@ -83,6 +83,11 @@ public class StocktakeServiceImpl extends ServiceImpl<StocktakeMapper, Stocktake ...@@ -83,6 +83,11 @@ public class StocktakeServiceImpl extends ServiceImpl<StocktakeMapper, Stocktake
startProcessInstanceDTO.setUserId(req.getUserId()); startProcessInstanceDTO.setUserId(req.getUserId());
String ProcessInstanceId= FlowInstanceService.startProcessInstanceById(startProcessInstanceDTO); String ProcessInstanceId= FlowInstanceService.startProcessInstanceById(startProcessInstanceDTO);
stocktake.setProcessId(ProcessInstanceId); stocktake.setProcessId(ProcessInstanceId);
String assigns= FlowInstanceService.GetNextAssign(ProcessInstanceId);//这里需要手动更新审核人信息
stocktake.setCurrentAssign(assigns);
updateById(stocktake);
} }
this.save(stocktake); this.save(stocktake);
return stocktake.getId(); return stocktake.getId();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论