Commit 1efe52a6 by guojuxing

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

parents 8b8ccb2d 93d94d66
......@@ -36,6 +36,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
......@@ -249,7 +250,7 @@ public class AuditLogApiServiceImpl implements AuditLogApiService {
// }
// 修改审批状态
auditLogService.updateAudit(auditLogDTO);
if (StringUtils.isNotBlank(projectItem.getCallbackUrl())) {
if (!AuditTypeEnum.HAOBAN.getCode().equals(auditLogDTO.getAuditType()) && StringUtils.isNotBlank(projectItem.getCallbackUrl())) {
// 回调
String extraInfo = auditLog.getExtraInfo();
JSONObject jsonObject = JSON.parseObject(extraInfo);
......@@ -357,19 +358,33 @@ public class AuditLogApiServiceImpl implements AuditLogApiService {
private void sendWxMessage(AuditorDTO auditorDTO, AuditLogDTO auditLogDTO) {
TabEnterprise enterprise = enterpriseService.getEnterpriseById(auditLogDTO.getEnterpriseId());
UserDTO userDTO = userApiService.getUserById(auditLogDTO.getApplyUserId()).getResult();
LoginUserTypeEnum userTypeEnum = LoginUserTypeEnum.getByCode(userDTO.getLoginType());
String position = userTypeEnum != null ? userTypeEnum.getMessage() : "";
String position;
if (AuditTypeEnum.HAOBAN.getCode().equals(auditLogDTO.getAuditType())) {
position = StringUtils.isBlank(auditLogDTO.getPosition()) ? "" : auditLogDTO.getPosition();
} else {
UserDTO userDTO = userApiService.getUserById(auditLogDTO.getApplyUserId()).getResult();
LoginUserTypeEnum userTypeEnum = LoginUserTypeEnum.getByCode(userDTO.getLoginType());
position = userTypeEnum != null ? userTypeEnum.getMessage() : "";
}
String[] keyWord = {enterprise.getEnterpriseName(), auditLogDTO.getApplyUserName(), position, auditLogDTO.getProjectItemName()};
// todo 跳转地址
String url;
if (AuditTypeEnum.HAOBAN.getCode().equals(auditLogDTO.getAuditType())) {
url = String.format("%s%s?auditLogId=%d&openid=%s", config.getHost(), auditLogDTO.getAuditUrl(), auditLogDTO.getAuditLogId(), auditorDTO.getOpenid());
if (StringUtils.isNotBlank(auditLogDTO.getExtraInfo())) {
JSONObject jsonObject = JSON.parseObject(auditLogDTO.getExtraInfo());
StringBuilder sb = new StringBuilder();
for (Map.Entry<String, Object> entry : jsonObject.entrySet()) {
sb.append("&").append(entry.getKey()).append("=").append(entry.getValue());
}
url += sb.toString();
}
} 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);
ServiceResponse<String> serviceResponse = this.wxTemplateRouterApiService.sendForDownloadData(auditorDTO.getOpenid(), url, keyWord);
logger.info("微信跳转结果:{},{}", serviceResponse.isSuccess(), serviceResponse.getMessage());
}
}
......@@ -265,7 +265,6 @@
from tab_audit_log
where status = 1
and audit_result = 0
-- and audit_expire_time &lt; #{auditExpireTime}
<if test="enterpriseId != null ">
and enterprise_id = #{enterpriseId}
</if>
......
......@@ -215,6 +215,9 @@
<include refid="Base_Column_List" />
from tab_download_log
where status = 1
<if test="enterpriseId != null ">
and enterprise_id = #{enterpriseId}
</if>
<if test="startTime != null and startTime != '' ">
and create_time &gt; #{startTime}
</if>
......
......@@ -416,12 +416,16 @@ public class IndexModuleController {
Integer enterpriseId = UserDetailUtils.getUserDetail().getEnterpriseId();
List<Integer> authStoreIdList = new ArrayList<>();
if(UserDetailUtils.getUserDetail().getUserInfo().getSuperAdmin() != 1){
ServiceResponse<List<Integer>> authResponse = this.storeWidgetApiService.listStoreIdByStoreWidgetId(enterpriseId, UserDetailUtils.getUserDetail().getUserResourceInfo().getStoreResource().intValue());
if(authResponse.isSuccess()){
authStoreIdList = authResponse.getResult();
}
if(CollectionUtils.isEmpty(authStoreIdList)){
if (UserDetailUtils.getUserDetail().getUserResourceInfo().getStoreResource() == null) {
authStoreIdList.add(-1);
} else {
ServiceResponse<List<Integer>> authResponse = this.storeWidgetApiService.listStoreIdByStoreWidgetId(enterpriseId, UserDetailUtils.getUserDetail().getUserResourceInfo().getStoreResource().intValue());
if(authResponse.isSuccess()){
authStoreIdList = authResponse.getResult();
}
if(CollectionUtils.isEmpty(authStoreIdList)){
authStoreIdList.add(-1);
}
}
}
return authStoreIdList;
......
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