[修改] 监控流程 调整处理人 永久
This commit is contained in:
@@ -42,6 +42,13 @@ public interface IUserEoService {
|
||||
UserEO getUserEoById(String usid);
|
||||
|
||||
List<UserVO> getUserByIdList(List<String> userIdList);
|
||||
|
||||
/**
|
||||
* 不考虑 删除的情况
|
||||
* 因流程中 人员被删除,但是审批历史中人要 回显正确
|
||||
* @param userIdList
|
||||
* @return
|
||||
*/
|
||||
List<UserVO> getUserByIdListNodel(List<String> userIdList);
|
||||
|
||||
IPage<Map<String, Object>> list(int pageNo, int pageSize, String account, String roleName);
|
||||
@@ -57,6 +64,11 @@ public interface IUserEoService {
|
||||
public void importExcelUser(List<UserImportVO> list);
|
||||
|
||||
List<Map<String, Object>> allList(String account, String roleName);
|
||||
|
||||
/**
|
||||
* 不考虑 删除的情况
|
||||
* 因流程中 人员被删除,但是审批历史中人要 回显正确
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
UserEO getUserByIdNodel(String userId);
|
||||
}
|
||||
|
||||
+7
-8
@@ -5,7 +5,6 @@ import com.adc.da.login.util.UserUtils;
|
||||
import com.adc.da.sys.entity.UserEO;
|
||||
import com.adc.da.sys.service.iservice.IUserEoService;
|
||||
import com.adc.da.wkflow.business_activiti.service.ActivitDefineService;
|
||||
import com.adc.da.wkflow.business_main.entity.BusProcessApprove;
|
||||
import com.adc.da.wkflow.business_main.entity.BusProcessName;
|
||||
import com.adc.da.wkflow.business_main.service.IBusProcessApproveService;
|
||||
import com.adc.da.wkflow.business_main.service.IBusProcessNameService;
|
||||
@@ -217,13 +216,13 @@ public class ActivitDefineController {
|
||||
ibusprocessnameService.save(one);
|
||||
}
|
||||
|
||||
BusProcessApprove busProcessApprove = new BusProcessApprove();
|
||||
busProcessApprove.setFromValsJson(JSON.toJSONString(approveData));
|
||||
busProcessApprove.setTaskId(task.getId());
|
||||
busProcessApprove.setCreateDate(new Date());
|
||||
busProcessApprove.setPrcId(pi.getId());
|
||||
busProcessApprove.setCreateUserId(UserUtils.getUserId());
|
||||
ibusProcessApproveService.save(busProcessApprove);
|
||||
// BusProcessApprove busProcessApprove = new BusProcessApprove();
|
||||
// busProcessApprove.setFromValsJson(JSON.toJSONString(approveData));
|
||||
// busProcessApprove.setTaskId(task.getId());
|
||||
// busProcessApprove.setCreateDate(new Date());
|
||||
// busProcessApprove.setPrcId(pi.getId());
|
||||
// busProcessApprove.setCreateUserId(UserUtils.getUserId());
|
||||
// ibusProcessApproveService.save(busProcessApprove);
|
||||
log.info("启动流程实例,获取id-->{},实例名称-->{}", pi.getId(), pd.getName());
|
||||
return WrapMapper.ok(task.getId());
|
||||
}
|
||||
|
||||
+14
-1
@@ -204,12 +204,21 @@ public class TodoTaskController {
|
||||
return WrapMapper.ok("改派成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 转办
|
||||
* @param taskId
|
||||
* @param assignee
|
||||
* @param userId
|
||||
* @param pId
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "新改派任务")
|
||||
@ApiImplicitParams({@ApiImplicitParam(name = "taskId", value = "任务id"),
|
||||
@ApiImplicitParam(name = "assignee", value = "被改派人员"), @ApiImplicitParam(name = "userId", value = "改派人员"),
|
||||
@ApiImplicitParam(name = "pId", value = "流程实例ID")})
|
||||
@GetMapping("/changeAssigneeNew")
|
||||
public Wrapper<String> changeAssigneeNew(String taskId, String assignee, String userId, String pId) {
|
||||
public Wrapper<String> changeAssigneeNew(String taskId, String assignee, String userId, String pId,
|
||||
@RequestParam(required = false,value = "replaceMap")String replaceMap) {
|
||||
|
||||
List<String> list = Arrays.asList(taskId.split(","));
|
||||
for (String str : list) {
|
||||
@@ -241,6 +250,10 @@ public class TodoTaskController {
|
||||
iBusProcessEntrustService.save(busProcessEntrust);
|
||||
}
|
||||
}
|
||||
//监控流程中 变更处理人为永久变更
|
||||
if (replaceMap != null){
|
||||
ibusProcessApproveService.changeAssignee(replaceMap,taskId);
|
||||
}
|
||||
|
||||
log.info("task {} find " + taskId);
|
||||
return WrapMapper.ok("改派成功");
|
||||
|
||||
+2
@@ -20,4 +20,6 @@ public interface BusProcessApproveMapper extends BaseMapper<BusProcessApprove> {
|
||||
List<BusProcessApprove> selectEoByPrcIdAndTask(@Param("prcId") String prcId);
|
||||
|
||||
BusProcessApprove selectEoByDataId(@Param("dataId") String dataId);
|
||||
|
||||
BusProcessApprove selectEoByTask(@Param("taskId")String taskId);
|
||||
}
|
||||
|
||||
+7
@@ -4,6 +4,7 @@ import com.adc.da.wkflow.business_main.entity.BusProcessApprove;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 审批历史业务类
|
||||
* 用于审批历史的查询的存取
|
||||
@@ -12,4 +13,10 @@ public interface IBusProcessApproveService extends IService<BusProcessApprove> {
|
||||
|
||||
List<BusProcessApprove> selectEoByPrcIdAndTask(String prcId);
|
||||
|
||||
/**
|
||||
* 监控流程中 变更处理人为永久变更
|
||||
* @param replaceMap
|
||||
* @param taskId
|
||||
*/
|
||||
void changeAssignee(String replaceMap,String taskId);
|
||||
}
|
||||
|
||||
+13
@@ -3,6 +3,8 @@ package com.adc.da.wkflow.business_main.service.impl;
|
||||
import com.adc.da.wkflow.business_main.entity.BusProcessApprove;
|
||||
import com.adc.da.wkflow.business_main.mapper.BusProcessApproveMapper;
|
||||
import com.adc.da.wkflow.business_main.service.IBusProcessApproveService;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -26,4 +28,15 @@ public class BusProcessApproveServiceImpl extends ServiceImpl<BusProcessApproveM
|
||||
|
||||
return baseMapper.selectEoByPrcIdAndTask(prcId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeAssignee(String replaceMap,String taskId) {
|
||||
BusProcessApprove busProcessApprove = baseMapper.selectEoByTask(taskId);
|
||||
String fromValsJson = busProcessApprove.getFromValsJson();
|
||||
JSONObject jsonObject = JSON.parseObject(fromValsJson);
|
||||
String[] split = replaceMap.split(":");
|
||||
jsonObject.replace(split[0],split[1]);
|
||||
busProcessApprove.setFromValsJson(jsonObject.toJSONString());
|
||||
baseMapper.updateById(busProcessApprove);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,5 +54,8 @@ public class aid2 implements TaskListener {
|
||||
String s = object.getString("flag") == "" || object.getString("flag") == null ? FlagEnum.AGREE.getValue() : object.getString("flag");
|
||||
// 1: 同意 2:退回
|
||||
delegateTask.setVariable("flag",s);
|
||||
//审批人
|
||||
delegateTask.setVariable("oneApprove",object.getString("oneApprove"));
|
||||
delegateTask.setVariable("twoApprove",object.getString("twoApprove"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,6 +54,9 @@ public class aid3 implements TaskListener {
|
||||
String fromValsJson = list.get(0).getFromValsJson();
|
||||
JSONObject object = JSONObject.parseObject(fromValsJson);
|
||||
String s = object.getString("flag") == "" || object.getString("flag") == null ? FlagEnum.AGREE.getValue() : object.getString("flag");
|
||||
//审批人
|
||||
delegateTask.setVariable("oneApprove",object.getString("oneApprove"));
|
||||
delegateTask.setVariable("twoApprove",object.getString("twoApprove"));
|
||||
// 1: 同意 2:退回
|
||||
delegateTask.setVariable("flag",s);
|
||||
if ("1".equals(s)){
|
||||
|
||||
@@ -9,4 +9,7 @@
|
||||
<select id="selectEoByDataId" resultType="com.adc.da.wkflow.business_main.entity.BusProcessApprove">
|
||||
select * from bus_process_approve where data_id =#{dataId}
|
||||
</select>
|
||||
<select id="selectEoByTask" resultType="com.adc.da.wkflow.business_main.entity.BusProcessApprove">
|
||||
select * from bus_process_approve where task_id =#{taskId}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user