yxk-20260525-审批意见表新增办理人的部门id和部门名称
This commit is contained in:
+28
-4
@@ -120,7 +120,10 @@ public class ExtActBpmLogServiceImpl extends ServiceImpl<ExtActBpmLogMapper, Ext
|
||||
//写入新的审批意见表
|
||||
saveTaskApprovalOpinion(bpmlog, processInstance, RECORD_TYPE_PROCESS,
|
||||
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
|
||||
@@ -155,7 +158,10 @@ public class ExtActBpmLogServiceImpl extends ServiceImpl<ExtActBpmLogMapper, Ext
|
||||
|
||||
saveTaskApprovalOpinion(taskLog, processInstance, RECORD_TYPE_SYSTEM,
|
||||
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);
|
||||
|
||||
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
|
||||
@@ -204,7 +213,7 @@ public class ExtActBpmLogServiceImpl extends ServiceImpl<ExtActBpmLogMapper, Ext
|
||||
*/
|
||||
private void saveTaskApprovalOpinion(ExtActBpmLog bpmLog, ProcessInstance processInstance,
|
||||
String recordType, String actionType, String actionResult,
|
||||
Date startTime) {
|
||||
Date startTime, String opDeptId, String opDeptName, String opDeptCode) {
|
||||
try {
|
||||
TaskApprovalOpinion opinion = new TaskApprovalOpinion();
|
||||
opinion.setRecordType(recordType);
|
||||
@@ -219,6 +228,9 @@ public class ExtActBpmLogServiceImpl extends ServiceImpl<ExtActBpmLogMapper, Ext
|
||||
opinion.setOpUserName(bpmLog.getOpUserName());
|
||||
opinion.setOpTime(bpmLog.getOpTime());
|
||||
opinion.setStartTime(startTime);
|
||||
opinion.setOpDeptId(opDeptId);
|
||||
opinion.setOpDeptName(opDeptName);
|
||||
opinion.setOpDeptCode(opDeptCode);
|
||||
opinion.setDelFlag("0");
|
||||
opinion.setCreateBy(bpmLog.getOpUserId());
|
||||
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) {
|
||||
if (oConvertUtils.isNotEmpty(rejectDescription)) {
|
||||
return reason + " 【" + rejectDescription + "】";
|
||||
|
||||
Reference in New Issue
Block a user