Commit 2be5ba07 by zhiwj

好办导购

parent 4dfad34f
......@@ -9,7 +9,8 @@ package com.gic.enterprise.constant;
public enum AuditTypeEnum {
NORMAL(0, "普通审批项"),
RISK_MODE(1, "风险模式审批"),
DOWNLOAD_REPORT(2, "下载申请")
DOWNLOAD_REPORT(2, "下载申请"),
HAOBAN(3, "好办")
;
private Integer code;
......
......@@ -14,6 +14,7 @@ import java.util.Date;
public class AuditLogDTO implements Serializable {
private static final long serialVersionUID = -5504276110192964185L;
public interface ApplyValid {}
/**
......@@ -117,6 +118,15 @@ public class AuditLogDTO implements Serializable {
private String position;
private String projectName;
private String applyUserPhone;
private String auditUrl;
public String getAuditUrl() {
return auditUrl;
}
public void setAuditUrl(String auditUrl) {
this.auditUrl = auditUrl;
}
public Integer getAuditLogId() {
return auditLogId;
......
......@@ -97,23 +97,24 @@ public class AuditLogApiServiceImpl implements AuditLogApiService {
auditLogDTO.setProjectItemId(projectItem.getProjectItemId());
auditLogDTO.setProjectItemName(projectItem.getProjectItemName());
// 判断申请人是否存在
ServiceResponse<UserDTO> userServiceResponse = userApiService.getUserInfoById(auditLogDTO.getApplyUserId());
if (!userServiceResponse.isSuccess()) {
return EnterpriseServiceResponse.failure(ErrorCode.NOTEXISTS);
}
auditLogDTO.setApplyUserName(userServiceResponse.getResult().getUserName());
auditLogDTO.setApplyUserPhone(userServiceResponse.getResult().getPhoneNumber());
// 如果审批项是被禁用的 直接通过
if (projectItem.getUseStatus() == 0 || userServiceResponse.getResult().getSuperAdmin() == 1) {
String extraInfo = auditLogDTO.getExtraInfo();
JSONObject jsonObject = JSON.parseObject(extraInfo);
jsonObject.put("auditResult", DataSecurityAuditEnum.PASS.getCode());
String[] callback = projectItem.getCallbackUrl().split(GlobalInfo.FLAG_COMMA);
AsyncCallbackUtils.callBack(jsonObject, callback[0], callback[1]);
return EnterpriseServiceResponse.success();
if (!AuditTypeEnum.HAOBAN.getCode().equals(auditLogDTO.getAuditType())) {
// 如果不是好办的 需要判断申请人
ServiceResponse<UserDTO> userServiceResponse = userApiService.getUserInfoById(auditLogDTO.getApplyUserId());
if (!userServiceResponse.isSuccess()) {
return EnterpriseServiceResponse.failure(ErrorCode.NOTEXISTS);
}
auditLogDTO.setApplyUserName(userServiceResponse.getResult().getUserName());
auditLogDTO.setApplyUserPhone(userServiceResponse.getResult().getPhoneNumber());
// 如果审批项是被禁用的 直接通过
if (projectItem.getUseStatus() == 0 || userServiceResponse.getResult().getSuperAdmin() == 1) {
String extraInfo = auditLogDTO.getExtraInfo();
JSONObject jsonObject = JSON.parseObject(extraInfo);
jsonObject.put("auditResult", DataSecurityAuditEnum.PASS.getCode());
String[] callback = projectItem.getCallbackUrl().split(GlobalInfo.FLAG_COMMA);
AsyncCallbackUtils.callBack(jsonObject, callback[0], callback[1]);
return EnterpriseServiceResponse.success();
}
}
if (Constants.NORMAL_STATUS.equals(projectItem.getIsPlatform())) {
// todo 如果是平台审批项, 同一个平台审批项 如果24小时内有审核成功的,就拒绝提交
......@@ -354,7 +355,12 @@ public class AuditLogApiServiceImpl implements AuditLogApiService {
String position = userTypeEnum != null ? userTypeEnum.getMessage() : "";
String[] keyWord = {enterprise.getEnterpriseName(), auditLogDTO.getApplyUserName(), position, auditLogDTO.getProjectItemName()};
// todo 跳转地址
String url = String.format("%s/damo-system/wechat-approve.html?auditLogId=%d&openid=%s", config.getHost(), auditLogDTO.getAuditLogId(), auditorDTO.getOpenid());
String url;
if (AuditTypeEnum.HAOBAN.getCode().equals(auditLogDTO.getAuditType())) {
url = auditLogDTO.getAuditUrl();
} else {
url = String.format("%s/damo-system/wechat-approve.html?auditLogId=%d&openid=%s", config.getHost(), auditLogDTO.getAuditLogId(), auditorDTO.getOpenid());
}
logger.info("微信跳转 url:{}", url);
this.wxTemplateRouterApiService.sendForDownloadData(auditorDTO.getOpenid(), url, keyWord);
}
......
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