|
|
|
@ -3702,12 +3702,14 @@ public class ScheduleServiceImpl implements ScheduleService { |
|
|
|
|| !StringUtils.hasText(inData.getOrderNo()) || !StringUtils.hasText(inData.getSeqNo())) { |
|
|
|
return; |
|
|
|
} |
|
|
|
String reportBy = resolveTodoOperator(inData); |
|
|
|
int updatedRows = scheduleTodoMessageMapper.markLatestAuditedLockTodoOperated( |
|
|
|
inData.getSite(), |
|
|
|
inData.getBuNo(), |
|
|
|
inData.getOrderNo(), |
|
|
|
inData.getSeqNo(), |
|
|
|
TODO_MSG_SOURCE_PREFIX + "%"); |
|
|
|
TODO_MSG_SOURCE_PREFIX + "%", |
|
|
|
reportBy); |
|
|
|
if (updatedRows <= 0) { |
|
|
|
return; |
|
|
|
} |
|
|
|
@ -3758,7 +3760,8 @@ public class ScheduleServiceImpl implements ScheduleService { |
|
|
|
if (!StringUtils.hasText(site) || !StringUtils.hasText(buNo) || !StringUtils.hasText(infoCode)) { |
|
|
|
throw new XJException("审核参数不完整"); |
|
|
|
} |
|
|
|
scheduleTodoMessageMapper.markTodoAudited(site, buNo, infoCode); |
|
|
|
String auditBy = resolveTodoOperator(inData); |
|
|
|
scheduleTodoMessageMapper.markTodoAudited(site, buNo, infoCode, auditBy); |
|
|
|
} |
|
|
|
|
|
|
|
private Map<String, Object> buildTodoCenterQuery(Map<String, Object> inData, boolean includePaging) { |
|
|
|
@ -3808,6 +3811,43 @@ public class ScheduleServiceImpl implements ScheduleService { |
|
|
|
return StringUtils.hasText(text) ? text : ""; |
|
|
|
} |
|
|
|
|
|
|
|
private String resolveTodoOperator(SearchScheduleData inData) { |
|
|
|
if (inData == null) { |
|
|
|
return null; |
|
|
|
} |
|
|
|
String operator = trimToEmpty(inData.getOperatorId()); |
|
|
|
if (!StringUtils.hasText(operator)) { |
|
|
|
operator = trimToEmpty(inData.getUsername()); |
|
|
|
} |
|
|
|
if (!StringUtils.hasText(operator)) { |
|
|
|
operator = trimToEmpty(inData.getUserName()); |
|
|
|
} |
|
|
|
if (!StringUtils.hasText(operator)) { |
|
|
|
operator = trimToEmpty(inData.getCreatedBy()); |
|
|
|
} |
|
|
|
return StringUtils.hasText(operator) ? truncate(operator, 50) : null; |
|
|
|
} |
|
|
|
|
|
|
|
private String resolveTodoOperator(Map<String, Object> inData) { |
|
|
|
if (inData == null || inData.isEmpty()) { |
|
|
|
return null; |
|
|
|
} |
|
|
|
String operator = trimToEmpty(inData.get("auditBy")); |
|
|
|
if (!StringUtils.hasText(operator)) { |
|
|
|
operator = trimToEmpty(inData.get("operatorId")); |
|
|
|
} |
|
|
|
if (!StringUtils.hasText(operator)) { |
|
|
|
operator = trimToEmpty(inData.get("username")); |
|
|
|
} |
|
|
|
if (!StringUtils.hasText(operator)) { |
|
|
|
operator = trimToEmpty(inData.get("userName")); |
|
|
|
} |
|
|
|
if (!StringUtils.hasText(operator)) { |
|
|
|
operator = trimToEmpty(inData.get("createdBy")); |
|
|
|
} |
|
|
|
return StringUtils.hasText(operator) ? truncate(operator, 50) : null; |
|
|
|
} |
|
|
|
|
|
|
|
private boolean needMatchRoleForBadge(Map<String, Object> inData) { |
|
|
|
String matchRoleOnly = trimToEmpty(inData == null ? null : inData.get("matchRoleOnly")); |
|
|
|
return FLAG_Y.equalsIgnoreCase(matchRoleOnly) || "true".equalsIgnoreCase(matchRoleOnly); |
|
|
|
@ -4150,11 +4190,21 @@ public class ScheduleServiceImpl implements ScheduleService { |
|
|
|
entity.setInfoCode(transNo.getNewTransNo()); |
|
|
|
entity.setSeqNo(inData.getSeqNo()); |
|
|
|
entity.setOrderNo(inData.getOrderNo()); |
|
|
|
entity.setCreatedBy(StringUtils.hasText(inData.getOperatorId()) ? inData.getOperatorId() : inData.getCreatedBy()); |
|
|
|
String operator = resolveTodoOperator(inData); |
|
|
|
entity.setCreatedBy(operator); |
|
|
|
entity.setMessageSource(buildTodoMessageSource(inData.getFunctionName())); |
|
|
|
entity.setAuditFlag(audited ? FLAG_Y : FLAG_N); |
|
|
|
entity.setOperateFlag(operated ? FLAG_Y : FLAG_N); |
|
|
|
entity.setLockFlag(lockRequired ? FLAG_Y : FLAG_N); |
|
|
|
Date now = new Date(); |
|
|
|
if (audited) { |
|
|
|
entity.setAuditTime(now); |
|
|
|
entity.setAuditBy(operator); |
|
|
|
} |
|
|
|
if (operated) { |
|
|
|
entity.setReportTime(now); |
|
|
|
entity.setReportBy(operator); |
|
|
|
} |
|
|
|
entity.setResponsibilityDept(StringUtils.hasText(responsibilityDept) ? responsibilityDept : null); |
|
|
|
scheduleTodoMessageMapper.insertTodoMessage(entity); |
|
|
|
} |
|
|
|
|