[修改] 调整变更人的bug
This commit is contained in:
@@ -46,4 +46,6 @@ public interface PowerApplyActDao extends BaseMapper<PowerApplyAct> {
|
||||
int batchInsert(@Param("list")List<PowerApplyAct> powerApplyActs);
|
||||
|
||||
List<PowerApplyActPageVO> selectListBydataId(@Param("dataId")String dataId);
|
||||
|
||||
int batchDel(@Param("ids") List<String> ids);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.adc.da.report.service;
|
||||
|
||||
import com.adc.da.report.eo.PowerApply;
|
||||
import com.adc.da.report.eo.PowerApplyAct;
|
||||
import com.adc.da.report.vo.DeleteParamRequestVO;
|
||||
import com.adc.da.report.vo.PowerApplyPageVO;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
@@ -55,4 +56,6 @@ public interface IPowerApplyService {
|
||||
* @description 根据id或id数组进行删除
|
||||
*/
|
||||
public void deleteById(DeleteParamRequestVO deleteParamVO);
|
||||
|
||||
void saveBatch(List<PowerApplyAct> powerApplyActs);
|
||||
}
|
||||
|
||||
+15
@@ -1,8 +1,10 @@
|
||||
package com.adc.da.report.service.impl;
|
||||
|
||||
|
||||
import com.adc.da.report.dao.mysql.PowerApplyActDao;
|
||||
import com.adc.da.report.dao.mysql.PowerApplyDao;
|
||||
import com.adc.da.report.eo.PowerApply;
|
||||
import com.adc.da.report.eo.PowerApplyAct;
|
||||
import com.adc.da.report.service.IPowerApplyService;
|
||||
import com.adc.da.report.vo.DeleteParamRequestVO;
|
||||
import com.adc.da.report.vo.PowerApplyPageVO;
|
||||
@@ -11,11 +13,13 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author bu
|
||||
@@ -27,6 +31,10 @@ import java.util.List;
|
||||
@Service
|
||||
public class IpowerApplyServiceImpl extends ServiceImpl<PowerApplyDao, PowerApply> implements IPowerApplyService {
|
||||
|
||||
@Autowired
|
||||
private PowerApplyActDao powerApplyActDao;
|
||||
|
||||
|
||||
/**
|
||||
* @param powerApplyPageVO
|
||||
* @return <com.adc.da.report.entity.PowerApply>
|
||||
@@ -109,5 +117,12 @@ public class IpowerApplyServiceImpl extends ServiceImpl<PowerApplyDao, PowerAppl
|
||||
baseMapper.update(powerApply,wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveBatch(List<PowerApplyAct> powerApplyActs) {
|
||||
baseMapper.saveBatch(powerApplyActs);
|
||||
List<String> ids = powerApplyActs.stream().map(a -> a.getId()).collect(Collectors.toList());
|
||||
powerApplyActDao.batchDel(ids);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -60,6 +60,13 @@
|
||||
(#{item.id}, #{item.prcId}, #{item.taskId}, #{item.dataId}, #{item.reportId}, #{item.power}, #{item.applyReason}, #{item.userId}, #{item.createUserId}, #{item.createDate}, #{item.updateDate}, #{item.updateUserId}, #{item.delFlag})
|
||||
</foreach>
|
||||
</insert>
|
||||
<update id="batchDel">
|
||||
UPDATE power_apply_act set del_flag = 1
|
||||
where id in
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
|
||||
<!-- 根据查询VO进行分页查询 -->
|
||||
|
||||
@@ -85,6 +85,7 @@
|
||||
<if test="pageVO.usid !='' and pageVO.usid != null">
|
||||
AND eo.id NOT IN ( SELECT ru.reportId FROM tr_report_user ru WHERE ru.userId = #{pageVO.usid} )
|
||||
AND eo.id NOT IN ( SELECT tt.report_id FROM power_apply tt WHERE tt.user_id = #{pageVO.usid} )
|
||||
AND eo.id NOT IN (SELECT tt.report_id FROM power_apply_act tt WHERE tt.user_id = #{pageVO.usid} and del_flag != 1 )
|
||||
</if>
|
||||
<if test="pageVO.name !='' and pageVO.name != null">
|
||||
and name like CONCAT(CONCAT('%',#{pageVO.name}),'%')
|
||||
|
||||
+8
-1
@@ -252,12 +252,19 @@ public class TodoTaskController {
|
||||
}
|
||||
//监控流程中 变更处理人为永久变更
|
||||
if (replaceMap != null){
|
||||
ibusProcessApproveService.changeAssignee(replaceMap,taskId);
|
||||
ibusProcessApproveService.changeAssignee(replaceMap,pId);
|
||||
}
|
||||
|
||||
log.info("task {} find " + taskId);
|
||||
return WrapMapper.ok("改派成功");
|
||||
}
|
||||
@ApiOperation(value = "查询当前任务", notes = "查询当前任务")
|
||||
@ApiImplicitParams(@ApiImplicitParam(name = "taskId", value = "任务id"))
|
||||
@GetMapping("/selectTask")
|
||||
public ResponseMessage completeTaskByUserId(String taskId) {
|
||||
Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
|
||||
return Result.success(task);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "完成任务", notes = "流程单个节点任务,直接完成任务")
|
||||
@ApiImplicitParams({@ApiImplicitParam(name = "taskId", value = "任务id"),
|
||||
|
||||
+2
-2
@@ -16,7 +16,7 @@ public interface IBusProcessApproveService extends IService<BusProcessApprove> {
|
||||
/**
|
||||
* 监控流程中 变更处理人为永久变更
|
||||
* @param replaceMap
|
||||
* @param taskId
|
||||
* @param pId
|
||||
*/
|
||||
void changeAssignee(String replaceMap,String taskId);
|
||||
void changeAssignee(String replaceMap,String pId);
|
||||
}
|
||||
|
||||
+8
-4
@@ -30,12 +30,16 @@ public class BusProcessApproveServiceImpl extends ServiceImpl<BusProcessApproveM
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeAssignee(String replaceMap,String taskId) {
|
||||
BusProcessApprove busProcessApprove = baseMapper.selectEoByTask(taskId);
|
||||
public void changeAssignee(String replaceMap,String prcId) {
|
||||
List<BusProcessApprove> busProcessApproves = baseMapper.selectEoByPrcIdAndTask(prcId);
|
||||
BusProcessApprove busProcessApprove = busProcessApproves.get(0);
|
||||
String fromValsJson = busProcessApprove.getFromValsJson();
|
||||
JSONObject jsonObject = JSON.parseObject(fromValsJson);
|
||||
String[] split = replaceMap.split(":");
|
||||
jsonObject.replace(split[0],split[1]);
|
||||
String[] split = replaceMap.split(",");
|
||||
String[] split1 = split[0].split(":");
|
||||
String[] split2 = split[1].split(":");
|
||||
jsonObject.replace(split1[0],split1[1]);
|
||||
jsonObject.replace(split2[0],split2[1]);
|
||||
busProcessApprove.setFromValsJson(jsonObject.toJSONString());
|
||||
baseMapper.updateById(busProcessApprove);
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@ package com.adc.da.wkflow.listener.powerApply;
|
||||
|
||||
import com.adc.da.login.util.UserUtils;
|
||||
import com.adc.da.report.dao.mysql.PowerApplyActDao;
|
||||
import com.adc.da.report.dao.mysql.PowerApplyDao;
|
||||
import com.adc.da.report.eo.PowerApplyAct;
|
||||
import com.adc.da.report.service.IPowerApplyService;
|
||||
import com.adc.da.wkflow.business_main.entity.BusProcessApprove;
|
||||
import com.adc.da.wkflow.business_main.entity.BusProcessNew;
|
||||
import com.adc.da.wkflow.business_main.service.IBusProcessApproveService;
|
||||
@@ -25,7 +25,7 @@ public class aid3 implements TaskListener {
|
||||
@Override
|
||||
public void notify(DelegateTask delegateTask) {
|
||||
PowerApplyActDao powerApplyActDao = SpringContextUtil.getBean(PowerApplyActDao.class);
|
||||
PowerApplyDao powerApplyDao = SpringContextUtil.getBean(PowerApplyDao.class);
|
||||
IPowerApplyService iPowerApplyService = SpringContextUtil.getBean(IPowerApplyService.class);
|
||||
IBusProcessNewService busBean = SpringContextUtil.getBean(IBusProcessNewService.class);
|
||||
IBusProcessApproveService approveService = SpringContextUtil.getBean(IBusProcessApproveService.class);
|
||||
//查询task任务
|
||||
@@ -60,7 +60,7 @@ public class aid3 implements TaskListener {
|
||||
// 1: 同意 2:退回
|
||||
delegateTask.setVariable("flag",s);
|
||||
if ("1".equals(s)){
|
||||
powerApplyDao.saveBatch(powerApplyActs);
|
||||
iPowerApplyService.saveBatch(powerApplyActs);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user