feat(flow): 添加投诉处理驳回功能

- 在ITsComplaintAcceptService接口中新增opinionReject和feedbackReject方法
- 在TsComplaintAcceptController控制器中添加意见驳回和反馈驳回的REST端点
- 实现TsComplaintAcceptServiceImpl中的驳回业务逻辑,包括状态更新和标记设置
- 为TsComplaintTask和TsPlanExecuteRel实体类添加rejectMark字段
- 更新相关BO、VO类和XML映射文件以支持驳回标记字段
- 实现驳回时对当前记录和其他关联记录的状态更新机制
This commit is contained in:
2026-06-23 17:34:39 +08:00
parent 6cf855b004
commit 499d9c5611
13 changed files with 142 additions and 0 deletions

View File

@@ -122,4 +122,32 @@ public class TsComplaintAcceptController extends BaseController {
List<Long> deptIdList = Arrays.stream(deptIds.split(",")).map(Long::parseLong).collect(Collectors.toList());
return toAjax(iTsComplaintAcceptService.feedbackDispatch(acceptId, deptIdList));
}
/**
* 意见驳回当前部门taskStatus→1、rejectMark→1主表flowStatus→1其他部门rejectMark→2
*
* @param taskId 代办任务ID
* @param reason 驳回意见填入deptOpinion
*/
@Log(title = "意见驳回", businessType = BusinessType.UPDATE)
@PostMapping("/opinionReject/{taskId}")
public R<Void> opinionReject(@NotNull(message = "主键不能为空")
@PathVariable Long taskId,
@RequestParam String reason) {
return toAjax(iTsComplaintAcceptService.opinionReject(taskId, reason));
}
/**
* 反馈驳回当前部门executeStatus→1、rejectMark→1主表flowStatus→3其他部门rejectMark→2
*
* @param relId 执行反馈记录ID
* @param reason 驳回原因填入executeResult
*/
@Log(title = "反馈驳回", businessType = BusinessType.UPDATE)
@PostMapping("/feedbackReject/{relId}")
public R<Void> feedbackReject(@NotNull(message = "主键不能为空")
@PathVariable Long relId,
@RequestParam String reason) {
return toAjax(iTsComplaintAcceptService.feedbackReject(relId, reason));
}
}

View File

@@ -62,6 +62,10 @@ public class TsComplaintTask extends BaseEntity {
* 备注
*/
private String remark;
/**
* 驳回标记 0=无驳回 1=本部门驳回 2=存在部门驳回
*/
private Long rejectMark;
/**
* 删除标识 0=正常 2=删除
*/

View File

@@ -62,6 +62,10 @@ public class TsPlanExecuteRel extends BaseEntity {
* 备注
*/
private String remark;
/**
* 驳回标记 0=无驳回 1=本部门驳回 2=存在部门驳回
*/
private Long rejectMark;
/**
* 删除标识 0=正常 2=删除
*/

View File

@@ -64,6 +64,10 @@ public class TsComplaintTaskBo extends BaseEntity {
*/
private String fillFile;
/**
* 驳回标记 0=无驳回 1=本部门驳回 2=存在部门驳回
*/
private Long rejectMark;
/**
* 备注
*/

View File

@@ -64,6 +64,10 @@ public class TsPlanExecuteRelBo extends BaseEntity {
*/
private String feedbackFile;
/**
* 驳回标记 0=无驳回 1=本部门驳回 2=存在部门驳回
*/
private Long rejectMark;
/**
* 备注
*/

View File

@@ -76,6 +76,10 @@ public class TsComplaintTaskVo {
@ExcelProperty(value = "意见文件")
private String fillFile;
/**
* 驳回标记 0=无驳回 1=本部门驳回 2=存在部门驳回
*/
private Long rejectMark;
/**
* 备注
*/

View File

@@ -75,6 +75,10 @@ public class TsPlanExecuteRelVo {
@ExcelProperty(value = "反馈文件")
private String feedbackFile;
/**
* 驳回标记 0=无驳回 1=本部门驳回 2=存在部门驳回
*/
private Long rejectMark;
/**
* 备注
*/

View File

@@ -56,4 +56,14 @@ public interface ITsComplaintAcceptService {
* 反馈下发修改flow_status=4按传入部门创建执行反馈记录
*/
Boolean feedbackDispatch(Long acceptId, List<Long> deptIds);
/**
* 意见驳回taskStatus→1、rejectMark→1主表flowStatus→1其他task的rejectMark→2
*/
Boolean opinionReject(Long taskId, String reason);
/**
* 反馈驳回executeStatus→1、rejectMark→1主表flowStatus→3其他rel的rejectMark→2
*/
Boolean feedbackReject(Long relId, String reason);
}

View File

@@ -184,6 +184,82 @@ public class TsComplaintAcceptServiceImpl implements ITsComplaintAcceptService {
return true;
}
/**
* 意见驳回
* 当前tasktaskStatus→1已审核、rejectMark→1本部门驳回
* 主表flowStatus→1待审核
* 其他task若rejectMark!=1则→2存在部门驳回
*/
@Override
public Boolean opinionReject(Long taskId, String reason) {
if (taskId == null) {
return false;
}
TsComplaintTask currentTask = tsComplaintTaskMapper.selectById(taskId);
if (currentTask == null) {
return false;
}
Long acceptId = currentTask.getAcceptId();
// 1. 更新当前tasktaskStatus=1, rejectMark=1
LambdaUpdateWrapper<TsComplaintTask> taskUw = Wrappers.lambdaUpdate();
taskUw.eq(TsComplaintTask::getTaskId, taskId)
.set(TsComplaintTask::getTaskStatus, 1L)
.set(TsComplaintTask::getRejectMark, 1L)
.set(TsComplaintTask::getDeptOpinion, reason);
tsComplaintTaskMapper.update(null, taskUw);
// 2. 主表flowStatus→1待审核
LambdaUpdateWrapper<TsComplaintAccept> acceptUw = Wrappers.lambdaUpdate();
acceptUw.eq(TsComplaintAccept::getAcceptId, acceptId)
.set(TsComplaintAccept::getFlowStatus, 1L);
baseMapper.update(null, acceptUw);
// 3. 同acceptId下其他task若rejectMark!=1则→2
LambdaUpdateWrapper<TsComplaintTask> otherUw = Wrappers.lambdaUpdate();
otherUw.eq(TsComplaintTask::getAcceptId, acceptId)
.ne(TsComplaintTask::getTaskId, taskId)
.ne(TsComplaintTask::getRejectMark, 1L)
.set(TsComplaintTask::getRejectMark, 2L);
tsComplaintTaskMapper.update(null, otherUw);
return true;
}
/**
* 反馈驳回
* 当前relexecuteStatus→1已反馈、rejectMark→1本部门驳回
* 主表flowStatus→3待总负责人汇总方案
* 其他rel若rejectMark!=1则→2存在部门驳回
*/
@Override
public Boolean feedbackReject(Long relId, String reason) {
if (relId == null) {
return false;
}
TsPlanExecuteRel currentRel = tsPlanExecuteRelMapper.selectById(relId);
if (currentRel == null) {
return false;
}
Long acceptId = currentRel.getAcceptId();
// 1. 更新当前relexecuteStatus=1, rejectMark=1
LambdaUpdateWrapper<TsPlanExecuteRel> relUw = Wrappers.lambdaUpdate();
relUw.eq(TsPlanExecuteRel::getRelId, relId)
.set(TsPlanExecuteRel::getExecuteStatus, 1L)
.set(TsPlanExecuteRel::getRejectMark, 1L)
.set(TsPlanExecuteRel::getExecuteResult, reason);
tsPlanExecuteRelMapper.update(null, relUw);
// 2. 主表flowStatus→3待总负责人汇总方案
LambdaUpdateWrapper<TsComplaintAccept> acceptUw = Wrappers.lambdaUpdate();
acceptUw.eq(TsComplaintAccept::getAcceptId, acceptId)
.set(TsComplaintAccept::getFlowStatus, 3L);
baseMapper.update(null, acceptUw);
// 3. 同acceptId下其他rel若rejectMark!=1则→2
LambdaUpdateWrapper<TsPlanExecuteRel> otherUw = Wrappers.lambdaUpdate();
otherUw.eq(TsPlanExecuteRel::getAcceptId, acceptId)
.ne(TsPlanExecuteRel::getRelId, relId)
.ne(TsPlanExecuteRel::getRejectMark, 1L)
.set(TsPlanExecuteRel::getRejectMark, 2L);
tsPlanExecuteRelMapper.update(null, otherUw);
return true;
}
/**
* 保存前的数据校验
*/

View File

@@ -114,6 +114,7 @@ public class TsComplaintTaskServiceImpl implements ITsComplaintTaskService {
lqw.eq(bo.getFillUserId() != null, TsComplaintTask::getFillUserId, bo.getFillUserId());
lqw.eq(bo.getFillTime() != null, TsComplaintTask::getFillTime, bo.getFillTime());
lqw.eq(StringUtils.isNotBlank(bo.getFillFile()), TsComplaintTask::getFillFile, bo.getFillFile());
lqw.eq(bo.getRejectMark() != null, TsComplaintTask::getRejectMark, bo.getRejectMark());
return lqw;
}

View File

@@ -111,6 +111,7 @@ public class TsPlanExecuteRelServiceImpl implements ITsPlanExecuteRelService {
lqw.eq(bo.getFeedbackUserId() != null, TsPlanExecuteRel::getFeedbackUserId, bo.getFeedbackUserId());
lqw.eq(bo.getFeedbackTime() != null, TsPlanExecuteRel::getFeedbackTime, bo.getFeedbackTime());
lqw.eq(StringUtils.isNotBlank(bo.getFeedbackFile()), TsPlanExecuteRel::getFeedbackFile, bo.getFeedbackFile());
lqw.eq(bo.getRejectMark() != null, TsPlanExecuteRel::getRejectMark, bo.getRejectMark());
return lqw;
}

View File

@@ -20,6 +20,7 @@
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="rejectMark" column="reject_mark"/>
</resultMap>

View File

@@ -20,6 +20,7 @@
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="rejectMark" column="reject_mark"/>
</resultMap>