Commit 86d792dd by zhiwj

修改审批

parent e265f1df
......@@ -122,7 +122,12 @@ public class AuditLogApiServiceImpl implements AuditLogApiService {
}
// 判断有没有审核员, 没有审核员就返回错误
ServiceResponse<List<AuditorDTO>> auditorResponse = auditorApiService.listAuditorByProject(auditLogDTO.getProjectItemId(), auditLogDTO.getApplyUserId(), auditLogDTO.getEnterpriseId());
ServiceResponse<List<AuditorDTO>> auditorResponse;
if (AuditTypeEnum.HAOBAN.getCode().equals(auditLogDTO.getAuditType())) {
auditorResponse = auditorApiService.listAuditorByProject(auditLogDTO.getProjectItemCode(), auditLogDTO.getEnterpriseId());
} else {
auditorResponse = auditorApiService.listAuditorByProject(auditLogDTO.getProjectItemId(), auditLogDTO.getApplyUserId(), auditLogDTO.getEnterpriseId());
}
// 普通管理员需要判断是否有审核员
if (!auditorResponse.isSuccess()) {
......@@ -162,7 +167,7 @@ public class AuditLogApiServiceImpl implements AuditLogApiService {
// 发送微信模板消息
sendWxMessage(auditorDTO, auditLogDTO);
}
if (auditorDTO.getUserId() != null) {
if (auditorDTO.getUserId() != null && !AuditTypeEnum.HAOBAN.getCode().equals(auditLogDTO.getAuditType())) {
ServiceResponse<UserDTO> userResponse = userApiService.getUserInfoById(auditorDTO.getUserId());
if (userResponse.isSuccess()) {
UserDTO userDTO = userResponse.getResult();
......@@ -244,21 +249,23 @@ public class AuditLogApiServiceImpl implements AuditLogApiService {
// }
// 修改审批状态
auditLogService.updateAudit(auditLogDTO);
// 回调
String extraInfo = auditLog.getExtraInfo();
JSONObject jsonObject = JSON.parseObject(extraInfo);
jsonObject.put("auditResult", auditLogDTO.getAuditResult());
jsonObject.put("auditorId", auditLogDTO.getAuditorId());
jsonObject.put("auditorPhone", auditLogDTO.getAuditorPhone());
jsonObject.put("auditorName", auditLogDTO.getAuditorName());
jsonObject.put("auditReason", auditLogDTO.getAuditReason());
String[] callback = projectItem.getCallbackUrl().split(GlobalInfo.FLAG_COMMA);
AsyncCallbackUtils.callBack(jsonObject, callback[0], callback[1]);
//发送通知消息
String url = config.getHost() + "/damo-system/examine-logs";
String result = auditLogDTO.getAuditResult() == 1? "已通过" : "未通过";
String content = "您的操作"+ result +"审核,可以在<a href='"+url+"' style='color:#2f54ed'>审核日志</a>查看到本次审核记录";
this.pushMessageApiService.pushUserMessage(auditLog.getEnterpriseId(), auditLog.getApplyUserId(),"系统消息", "审核结果", content);
if (StringUtils.isNotBlank(projectItem.getCallbackUrl())) {
// 回调
String extraInfo = auditLog.getExtraInfo();
JSONObject jsonObject = JSON.parseObject(extraInfo);
jsonObject.put("auditResult", auditLogDTO.getAuditResult());
jsonObject.put("auditorId", auditLogDTO.getAuditorId());
jsonObject.put("auditorPhone", auditLogDTO.getAuditorPhone());
jsonObject.put("auditorName", auditLogDTO.getAuditorName());
jsonObject.put("auditReason", auditLogDTO.getAuditReason());
String[] callback = projectItem.getCallbackUrl().split(GlobalInfo.FLAG_COMMA);
AsyncCallbackUtils.callBack(jsonObject, callback[0], callback[1]);
//发送通知消息
String url = config.getHost() + "/damo-system/examine-logs";
String result = auditLogDTO.getAuditResult() == 1 ? "已通过" : "未通过";
String content = "您的操作" + result + "审核,可以在<a href='" + url + "' style='color:#2f54ed'>审核日志</a>查看到本次审核记录";
this.pushMessageApiService.pushUserMessage(auditLog.getEnterpriseId(), auditLog.getApplyUserId(), "系统消息", "审核结果", content);
}
return EnterpriseServiceResponse.success();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment