yxk-20260525-审批意见表新增办理人的部门id和部门名称

This commit is contained in:
ye1023
2026-05-25 10:31:31 +08:00
parent f5c980841b
commit 1ac4ccef9c
@@ -120,7 +120,10 @@ public class ExtActBpmLogServiceImpl extends ServiceImpl<ExtActBpmLogMapper, Ext
//写入新的审批意见表 //写入新的审批意见表
saveTaskApprovalOpinion(bpmlog, processInstance, RECORD_TYPE_PROCESS, saveTaskApprovalOpinion(bpmlog, processInstance, RECORD_TYPE_PROCESS,
resolveHandleActionType(map, rejectDescription), resolveActionResult(reason, "同意"), resolveHandleActionType(map, rejectDescription), resolveActionResult(reason, "同意"),
task != null ? task.getCreateTime() : null); task != null ? task.getCreateTime() : null,
user != null ? user.getOrgId() : null,
resolveDeptName(username),
user != null ? user.getOrgCode() : null);
} }
@Override @Override
@@ -155,7 +158,10 @@ public class ExtActBpmLogServiceImpl extends ServiceImpl<ExtActBpmLogMapper, Ext
saveTaskApprovalOpinion(taskLog, processInstance, RECORD_TYPE_SYSTEM, saveTaskApprovalOpinion(taskLog, processInstance, RECORD_TYPE_SYSTEM,
resolveSystemActionType(comment), resolveActionResult(comment, "系统记录"), resolveSystemActionType(comment), resolveActionResult(comment, "系统记录"),
task != null ? task.getCreateTime() : null); task != null ? task.getCreateTime() : null,
user != null ? user.getOrgId() : null,
resolveDeptName(username),
user != null ? user.getOrgCode() : null);
} }
/** /**
@@ -189,7 +195,10 @@ public class ExtActBpmLogServiceImpl extends ServiceImpl<ExtActBpmLogMapper, Ext
this.baseMapper.insert(bpmlog); this.baseMapper.insert(bpmlog);
saveTaskApprovalOpinion(bpmlog, processInstance, RECORD_TYPE_PROCESS, ACTION_ADD_SIGN, resolveActionResult(reason, "加签"), saveTaskApprovalOpinion(bpmlog, processInstance, RECORD_TYPE_PROCESS, ACTION_ADD_SIGN, resolveActionResult(reason, "加签"),
task != null ? task.getCreateTime() : null); task != null ? task.getCreateTime() : null,
user != null ? user.getOrgId() : null,
resolveDeptName(username),
user != null ? user.getOrgCode() : null);
} }
@Override @Override
@@ -204,7 +213,7 @@ public class ExtActBpmLogServiceImpl extends ServiceImpl<ExtActBpmLogMapper, Ext
*/ */
private void saveTaskApprovalOpinion(ExtActBpmLog bpmLog, ProcessInstance processInstance, private void saveTaskApprovalOpinion(ExtActBpmLog bpmLog, ProcessInstance processInstance,
String recordType, String actionType, String actionResult, String recordType, String actionType, String actionResult,
Date startTime) { Date startTime, String opDeptId, String opDeptName, String opDeptCode) {
try { try {
TaskApprovalOpinion opinion = new TaskApprovalOpinion(); TaskApprovalOpinion opinion = new TaskApprovalOpinion();
opinion.setRecordType(recordType); opinion.setRecordType(recordType);
@@ -219,6 +228,9 @@ public class ExtActBpmLogServiceImpl extends ServiceImpl<ExtActBpmLogMapper, Ext
opinion.setOpUserName(bpmLog.getOpUserName()); opinion.setOpUserName(bpmLog.getOpUserName());
opinion.setOpTime(bpmLog.getOpTime()); opinion.setOpTime(bpmLog.getOpTime());
opinion.setStartTime(startTime); opinion.setStartTime(startTime);
opinion.setOpDeptId(opDeptId);
opinion.setOpDeptName(opDeptName);
opinion.setOpDeptCode(opDeptCode);
opinion.setDelFlag("0"); opinion.setDelFlag("0");
opinion.setCreateBy(bpmLog.getOpUserId()); opinion.setCreateBy(bpmLog.getOpUserId());
opinion.setCreateTime(bpmLog.getOpTime()); opinion.setCreateTime(bpmLog.getOpTime());
@@ -232,6 +244,18 @@ public class ExtActBpmLogServiceImpl extends ServiceImpl<ExtActBpmLogMapper, Ext
} }
} }
private String resolveDeptName(String username) {
try {
List<String> names = sysBaseAPI.getDepartNamesByUsername(username);
if (names != null && !names.isEmpty()) {
return names.get(0);
}
} catch (Exception e) {
log.debug("获取部门名称失败, username={}", username, e);
}
return null;
}
private String appendRejectDescription(String reason, String rejectDescription) { private String appendRejectDescription(String reason, String rejectDescription) {
if (oConvertUtils.isNotEmpty(rejectDescription)) { if (oConvertUtils.isNotEmpty(rejectDescription)) {
return reason + "" + rejectDescription + ""; return reason + "" + rejectDescription + "";