提交修改

This commit is contained in:
quyixiao 2020-12-04 16:44:04 +08:00
parent 4e2976fe54
commit 03028ba53b

View File

@ -884,13 +884,18 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
} }
List<FlowRecord> flowRecords = flowRecordService.selectFlowRecordByRecordIdStatus(approvalDto.getResultRecordId(), 2); List<FlowRecord> flowRecords = flowRecordService.selectFlowRecordByRecordIdStatus(approvalDto.getResultRecordId(), 2);
Long commentId = 0l;
if (CollectionUtils.isNotEmpty(flowRecords)) { if (CollectionUtils.isNotEmpty(flowRecords)) {
FlowRecord preFlowRecord = flowRecords.get(0); FlowRecord preFlowRecord = flowRecords.get(0);
// 评论内容 // 评论内容
FlowChart flowChart = flowService.selectFlowChartByChartId(preFlowRecord.getFlowId()); FlowChart flowChart = flowService.selectFlowChartByChartId(preFlowRecord.getFlowId());
comment(approvalDto, flowChart); commentId = comment(approvalDto, flowChart);
} }
R r = apply(approvalDto);
return r.put("commentId",commentId);
}
public R apply( ApprovalDto approvalDto){
switch (approvalDto.getStatus()) { switch (approvalDto.getStatus()) {
case 1: //1 提交审批,审批通过 case 1: //1 提交审批,审批通过
return newSubmit(approvalDto, null); return newSubmit(approvalDto, null);
@ -920,7 +925,7 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
default: default:
break; break;
} }
return null; return R.ok();
} }
@ -1029,7 +1034,7 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
return newReject(approvalDto); return newReject(approvalDto);
} }
public void comment(ApprovalDto approvalDto, FlowChart flowChart) { public Long comment(ApprovalDto approvalDto, FlowChart flowChart) {
StaffEntity staffEntity = staffService.selectStaffById(approvalDto.getLoginUserId()); StaffEntity staffEntity = staffService.selectStaffById(approvalDto.getLoginUserId());
if (staffEntity != null) { if (staffEntity != null) {
ResultComment resultComment = new ResultComment(); ResultComment resultComment = new ResultComment();
@ -1039,7 +1044,9 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
resultComment.setRecordId(approvalDto.getResultRecordId()); resultComment.setRecordId(approvalDto.getResultRecordId());
resultComment.setOptDesc(approvalDto.getMenuName() + flowChart.getName()); resultComment.setOptDesc(approvalDto.getMenuName() + flowChart.getName());
resultCommentService.insertResultComment(resultComment); resultCommentService.insertResultComment(resultComment);
return resultComment.getId();
} }
return 0l;
} }
private R newSubmit(ApprovalDto approvalDto, Integer finishedStatus) { private R newSubmit(ApprovalDto approvalDto, Integer finishedStatus) {