Commit 56ff1bec by guojuxing

Merge remote-tracking branch 'origin/developer' into developer

parents 449b793a 330ebe8c
......@@ -37,7 +37,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
......@@ -118,12 +117,12 @@ public class AuditLogApiServiceImpl implements AuditLogApiService {
// 判断有没有审核员, 没有审核员就返回错误
ServiceResponse<List<AuditorDTO>> auditorResponse = auditorApiService.listAuditorByProject(auditLogDTO.getProjectItemId(), auditLogDTO.getApplyUserId(), auditLogDTO.getEnterpriseId());
List<AuditorDTO> auditorList = Collections.emptyList();
// 普通管理员需要判断是否有审核员
if (!auditorResponse.isSuccess()) {
return EnterpriseServiceResponse.failure(auditorResponse.getCode(), auditorResponse.getMessage());
}
auditorList = auditorResponse.getResult();
List<AuditorDTO> auditorList = auditorResponse.getResult();
List<AuditorDTO> openidList = auditorList.stream().filter(e -> StringUtils.isNotBlank(e.getOpenid())).collect(Collectors.toList());
List<AuditorDTO> userIdList = auditorList.stream().filter(e -> e.getUserId() != null).collect(Collectors.toList());
if (CollectionUtils.isEmpty(openidList) && CollectionUtils.isEmpty(userIdList)) {
......@@ -150,6 +149,7 @@ public class AuditLogApiServiceImpl implements AuditLogApiService {
}
auditLogDTO.setAuditResult(DataSecurityAuditEnum.WAIT.getCode());
Integer auditLogId = auditLogService.save(auditLogDTO);
auditLogDTO.setAuditLogId(auditLogId);
for (AuditorDTO auditorDTO : auditorList) {
if (StringUtils.isNotBlank(auditorDTO.getOpenid())) {
......@@ -251,7 +251,7 @@ public class AuditLogApiServiceImpl implements AuditLogApiService {
String url = config.getHost() + "/damo-system/examine-logs";
String result = auditLogDTO.getAuditResult() == 1? "已通过" : "未通过";
String content = "您的操作"+ result +"审核,可以在<a href='"+url+"'>审核日志</a>查看到本次审核记录";
this.pushMessageApiService.pushUserMessage(auditLogDTO.getEnterpriseId(), auditLogDTO.getApplyUserId(),"系统消息", "审核结果", content);
this.pushMessageApiService.pushUserMessage(auditLog.getEnterpriseId(), auditLog.getApplyUserId(),"系统消息", "审核结果", content);
return EnterpriseServiceResponse.success();
}
......@@ -342,9 +342,11 @@ public class AuditLogApiServiceImpl implements AuditLogApiService {
UserDTO userDTO = userApiService.getUserById(auditLogDTO.getApplyUserId()).getResult();
LoginUserTypeEnum userTypeEnum = LoginUserTypeEnum.getByCode(userDTO.getLoginType());
String position = userTypeEnum != null ? userTypeEnum.getMessage() : "";
String[] keyWord = {enterprise.getEnterpriseName(), auditorDTO.getAuditorName(), position, auditLogDTO.getProjectItemName()};
String[] keyWord = {enterprise.getEnterpriseName(), auditLogDTO.getApplyUserName(), position, auditLogDTO.getProjectItemName()};
// todo 跳转地址
this.wxTemplateRouterApiService.sendForDownloadData(auditorDTO.getOpenid(), String.format("/wechat-approve.html?auditLogId=%d&openid=%s", auditLogDTO.getAuditLogId(), auditorDTO.getOpenid()), keyWord);
String 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);
}
}
......@@ -345,6 +345,7 @@ public class IndexModuleController {
result.put("card", card);
result.put("service", service);
result.put("applet", applet);
result.put("isSingleArea", card.size()<=1 && service.size()<=1 && applet.size()<=1);
return RestResponse.success(result);
}
......
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