mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-11 03:46:50 +08:00
提交发起
This commit is contained in:
@@ -0,0 +1,85 @@
|
|||||||
|
package com.xboe.api;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.ListUtil;
|
||||||
|
import cn.hutool.core.lang.Opt;
|
||||||
|
import cn.hutool.http.HttpRequest;
|
||||||
|
import cn.hutool.json.JSONUtil;
|
||||||
|
import com.xboe.api.vo.*;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
import java.util.concurrent.ForkJoinPool;
|
||||||
|
import java.util.stream.IntStream;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@Slf4j
|
||||||
|
public class ThirdApi {
|
||||||
|
|
||||||
|
public static final ForkJoinPool REQUEST_TASK = new ForkJoinPool(100);
|
||||||
|
|
||||||
|
@Value("${orgTree.orgChildTreeList}")
|
||||||
|
private String orgChildTreeListUrl;
|
||||||
|
|
||||||
|
@Value("${audience.usersByAudienceList}")
|
||||||
|
private String usersByAudienceList;
|
||||||
|
|
||||||
|
@Value("${userBasic.searchUserList}")
|
||||||
|
private String searchUserListUrl;
|
||||||
|
|
||||||
|
|
||||||
|
public List<UserInfoList> getAllUserList(UserListParam userListParam, String token) {
|
||||||
|
log.info("获取用户");
|
||||||
|
String resp = Optional.ofNullable(HttpRequest.post(searchUserListUrl).body(JSONUtil.toJsonStr(userListParam)).header("token", token).execute().body()).orElseThrow(() -> new RuntimeException("token校验失败"));
|
||||||
|
System.out.println(resp);
|
||||||
|
return Opt.ofBlankAble(resp).map(t -> JSONUtil.toBean(resp, UserInfoListRootBean.class).success())
|
||||||
|
.map(UserInfoListRootBean::getResult)
|
||||||
|
.map(result -> Opt.ofEmptyAble(result.getUserInfoList()).peek(t -> nextPage(userListParam, token, t, result)).orElse(ListUtil.toList()))
|
||||||
|
.orElse(ListUtil.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
private void getAllUserList(UserListParam userListParam, String token, List<UserInfoList> userInfoLists) {
|
||||||
|
log.info("获取用户2");
|
||||||
|
String resp = Optional.ofNullable(HttpRequest.post(searchUserListUrl).body(JSONUtil.toJsonStr(userListParam)).header("token", token).execute().body()).orElseThrow(() -> new RuntimeException("token校验失败"));
|
||||||
|
System.out.println(resp);
|
||||||
|
Opt.ofBlankAble(resp).map(t -> JSONUtil.toBean(t, UserInfoListRootBean.class).success()).map(UserInfoListRootBean::getResult).map(UserInfoListRootBean.ResultData::getUserInfoList).stream().flatMap(Collection::stream).forEach(userInfoLists::add);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void nextPage(UserListParam userListParam, String token, List<UserInfoList> userInfoLists, UserInfoListRootBean.ResultData t) {
|
||||||
|
System.out.println("获取用户--" + userListParam.getPage());
|
||||||
|
if (t.getTotalPage() > userListParam.getPage()) {
|
||||||
|
REQUEST_TASK.submit(() -> IntStream.range(userListParam.getPage(), t.getTotalPage()).parallel().forEach(i -> getAllUserList(userListParam.withPage(i + 1), token, userInfoLists))).join();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public List<OrgRootBean.ResultData> getOrgChildTree(String id, String token) {
|
||||||
|
log.info("getOrgChildTree");
|
||||||
|
String resp = Optional.ofNullable(HttpRequest.post(orgChildTreeListUrl).header("token", token).body(JSONUtil.toJsonStr(TreeSearchVo.builder().orgId(id).build())).execute().body()).orElseThrow(() -> new RuntimeException("token校验失败"));
|
||||||
|
return Opt.ofNullable(JSONUtil.toBean(resp, OrgRootBean.class).success()).map(OrgRootBean::getResult).orElse(ListUtil.empty());
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<AuditList> getAllAudienceList(AuditListParam userListParam, String token) {
|
||||||
|
String resp = Optional.ofNullable(HttpRequest.post(usersByAudienceList).body(JSONUtil.toJsonStr(userListParam)).header("token", token).execute().body()).orElseThrow(() -> new RuntimeException("token校验失败"));
|
||||||
|
return Opt.ofBlankAble(resp).map(t -> JSONUtil.toBean(resp, AuditRootBean.class).success())
|
||||||
|
.map(AuditRootBean::getResult)
|
||||||
|
.map(result -> Opt.ofEmptyAble(result.getList()).peek(t -> nextPage(userListParam, t, result, token)).orElse(ListUtil.toList()))
|
||||||
|
.orElse(ListUtil.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
private void nextPage(AuditListParam userListParam, List<AuditList> t, Result result, String token) {
|
||||||
|
if (result.getTotalPage() > userListParam.getPage()) {
|
||||||
|
REQUEST_TASK.submit(() -> IntStream.range(userListParam.getPage(), result.getTotalPage()).parallel().forEach(i -> getAllAudienceList(userListParam.withPage(i + 1), t, token))).join();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void getAllAudienceList(AuditListParam userListParam, List<AuditList> list, String token) {
|
||||||
|
String resp = Optional.ofNullable(HttpRequest.post(usersByAudienceList).body(JSONUtil.toJsonStr(userListParam)).header("token", token).execute().body()).orElseThrow(() -> new RuntimeException("token校验失败"));
|
||||||
|
Opt.ofBlankAble(resp).map(t -> JSONUtil.toBean(t, AuditRootBean.class).success()).map(AuditRootBean::getResult).map(Result::getList).stream().flatMap(Collection::stream).forEach(list::add);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package com.xboe.api.vo; /**
|
||||||
|
* Copyright 2022 bejson.com
|
||||||
|
*/
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Auto-generated: 2022-12-10 14:3:18
|
||||||
|
*
|
||||||
|
* @author bejson.com (i@bejson.com)
|
||||||
|
* @website http://www.bejson.com/java2pojo/
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class AuditList {
|
||||||
|
private long audienceId;
|
||||||
|
private long userId;
|
||||||
|
private long id;
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package com.xboe.api.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@With
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class AuditListParam implements Cloneable {
|
||||||
|
private String audienceId;
|
||||||
|
private Integer page;
|
||||||
|
private Integer pageSize;
|
||||||
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
package com.xboe.api.vo; /**
|
||||||
|
* Copyright 2022 bejson.com
|
||||||
|
*/
|
||||||
|
|
||||||
|
import cn.hutool.json.JSONUtil;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Auto-generated: 2022-12-10 14:3:18
|
||||||
|
*
|
||||||
|
* @author bejson.com (i@bejson.com)
|
||||||
|
* @website http://www.bejson.com/java2pojo/
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Slf4j
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class AuditRootBean {
|
||||||
|
|
||||||
|
private String error;
|
||||||
|
private String message;
|
||||||
|
private String permissions;
|
||||||
|
private Result result;
|
||||||
|
private int status;
|
||||||
|
private Date timestamp;
|
||||||
|
|
||||||
|
public AuditRootBean success() {
|
||||||
|
if (this.status != 200) {
|
||||||
|
log.error("获取受众列表失败----{}", JSONUtil.toJsonPrettyStr(this));
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
package com.xboe.api.vo;
|
||||||
|
|
||||||
|
import cn.hutool.json.JSONUtil;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Slf4j
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class OrgRootBean {
|
||||||
|
|
||||||
|
private String error;
|
||||||
|
private String message;
|
||||||
|
private String permissions;
|
||||||
|
private List<ResultData> result;
|
||||||
|
private int status;
|
||||||
|
private Date timestamp;
|
||||||
|
|
||||||
|
public OrgRootBean success() {
|
||||||
|
if (this.status != 200) {
|
||||||
|
log.error("获取组织列表失败----{}", JSONUtil.toJsonPrettyStr(this));
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class ResultData {
|
||||||
|
|
||||||
|
private String id;
|
||||||
|
private String parentId;
|
||||||
|
private String oldKid;
|
||||||
|
private String oldParentId;
|
||||||
|
private String name;
|
||||||
|
private String code;
|
||||||
|
private String namePath;
|
||||||
|
private int level;
|
||||||
|
private int status;
|
||||||
|
private String description;
|
||||||
|
private boolean isMakeOrg;
|
||||||
|
private boolean isServiceSite;
|
||||||
|
private String managerId;
|
||||||
|
private String hrbpId;
|
||||||
|
private Date createTime;
|
||||||
|
private String createBy;
|
||||||
|
private String oldOrgId;
|
||||||
|
private String oldOrgParentId;
|
||||||
|
private String companyId;
|
||||||
|
private String sassId;
|
||||||
|
private String orgRepository;
|
||||||
|
private String orgFactory;
|
||||||
|
private String directChildList;
|
||||||
|
private List<Result> treeChildList;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package com.xboe.api.vo; /**
|
||||||
|
* Copyright 2022 bejson.com
|
||||||
|
*/
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Auto-generated: 2022-12-10 14:3:18
|
||||||
|
*
|
||||||
|
* @author bejson.com (i@bejson.com)
|
||||||
|
* @website http://www.bejson.com/java2pojo/
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class Result {
|
||||||
|
|
||||||
|
private int totalElement;
|
||||||
|
private int totalPage;
|
||||||
|
private List<AuditList> list;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package com.xboe.api.vo;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class TreeSearchVo {
|
||||||
|
private String keyword;
|
||||||
|
private String orgId;
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
package com.xboe.api.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class UserInfoList {
|
||||||
|
|
||||||
|
private long id;
|
||||||
|
private String bandCode;
|
||||||
|
private String bandDesc;
|
||||||
|
private Boolean deleted;
|
||||||
|
private Long departId;
|
||||||
|
private String description;
|
||||||
|
private String domainId;
|
||||||
|
private String departName;
|
||||||
|
private String duty;
|
||||||
|
private int employeeStatus;
|
||||||
|
private String companyId;
|
||||||
|
private String orgName;
|
||||||
|
private Integer gender;
|
||||||
|
private String jobName;
|
||||||
|
private String kid;
|
||||||
|
private int learningDuration;
|
||||||
|
private String mobile;
|
||||||
|
private String realName;
|
||||||
|
private String oldDepartId;
|
||||||
|
private String orgNamePath;
|
||||||
|
private String orgTreeType;
|
||||||
|
private String payrollPlaceId;
|
||||||
|
private String payrollPlaceName;
|
||||||
|
private long personId;
|
||||||
|
private String positionMgrLevel;
|
||||||
|
private String rank;
|
||||||
|
private long sassId;
|
||||||
|
private int status;
|
||||||
|
private String telephoneNo;
|
||||||
|
private String userNo;
|
||||||
|
private String email;
|
||||||
|
private String avatar;
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package com.xboe.api.vo;
|
||||||
|
|
||||||
|
import cn.hutool.json.JSONUtil;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Slf4j
|
||||||
|
public class UserInfoListRootBean {
|
||||||
|
|
||||||
|
private String error;
|
||||||
|
private String message;
|
||||||
|
private String permissions;
|
||||||
|
private ResultData result;
|
||||||
|
private int status;
|
||||||
|
private Date timestamp;
|
||||||
|
|
||||||
|
public UserInfoListRootBean success() {
|
||||||
|
if (this.status != 200) {
|
||||||
|
log.error("获取学员列表失败----{}", JSONUtil.toJsonPrettyStr(this));
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class ResultData {
|
||||||
|
|
||||||
|
private int totalElement;
|
||||||
|
private int totalPage;
|
||||||
|
private List<UserInfoList> userInfoList;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package com.xboe.api.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@With
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class UserListParam {
|
||||||
|
private String id;
|
||||||
|
private String departId;
|
||||||
|
private String userNo;
|
||||||
|
private String realName;
|
||||||
|
@Builder.Default
|
||||||
|
private int page = 1;
|
||||||
|
@Builder.Default
|
||||||
|
private int pageSize = 10;
|
||||||
|
}
|
||||||
@@ -32,6 +32,7 @@ import org.springframework.web.multipart.MultipartFile;
|
|||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.servlet.ServletOutputStream;
|
import javax.servlet.ServletOutputStream;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -179,7 +180,7 @@ public class CasesRecommendApi extends ApiBaseController {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@PostMapping("/launch")
|
@PostMapping("/launch")
|
||||||
public JsonResponse<Boolean> excelImport(@RequestBody CasesRecommendLaunchVo casesRecommendLaunch) {
|
public JsonResponse<Boolean> launch(@RequestBody CasesRecommendLaunchVo casesRecommendLaunch, HttpServletRequest request) {
|
||||||
if (!CasesRecommendLaunchTypeEnum.COMMON.getLaunchType().equals(casesRecommendLaunch.getLaunchType()) && !CasesRecommendLaunchTypeEnum.IMPORT.getLaunchType().equals(casesRecommendLaunch.getLaunchType())) {
|
if (!CasesRecommendLaunchTypeEnum.COMMON.getLaunchType().equals(casesRecommendLaunch.getLaunchType()) && !CasesRecommendLaunchTypeEnum.IMPORT.getLaunchType().equals(casesRecommendLaunch.getLaunchType())) {
|
||||||
throw new RuntimeException("参数错误");
|
throw new RuntimeException("参数错误");
|
||||||
}
|
}
|
||||||
@@ -191,7 +192,12 @@ public class CasesRecommendApi extends ApiBaseController {
|
|||||||
if (CollectionUtil.isEmpty(casesRecommendLaunch.getPushUserIdList())) {
|
if (CollectionUtil.isEmpty(casesRecommendLaunch.getPushUserIdList())) {
|
||||||
throw new RuntimeException("参数错误");
|
throw new RuntimeException("参数错误");
|
||||||
}
|
}
|
||||||
return success(iCasesRecommendPushRecordService.launchPush(casesRecommendLaunch, getCurrent()));
|
String token = request.getHeader("Xboe-Access-Token");
|
||||||
|
if (StringUtils.isEmpty(token)) {
|
||||||
|
token = request.getHeader("token");
|
||||||
|
}
|
||||||
|
|
||||||
|
return success(iCasesRecommendPushRecordService.launchPush(casesRecommendLaunch, getCurrent(), token));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ public interface ICasesRecommendPushRecordService {
|
|||||||
* @param
|
* @param
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
boolean launchPush(CasesRecommendLaunchVo casesRecommendLaunch, CurrentUser currentUser);
|
boolean launchPush(CasesRecommendLaunchVo casesRecommendLaunch, CurrentUser currentUser,String token);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据案例推荐ID查询案例推送列表信息
|
* 根据案例推荐ID查询案例推送列表信息
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ package com.xboe.module.boecase.service.impl;
|
|||||||
|
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
|
import com.xboe.api.ThirdApi;
|
||||||
|
import com.xboe.api.vo.*;
|
||||||
import com.xboe.core.CurrentUser;
|
import com.xboe.core.CurrentUser;
|
||||||
import com.xboe.core.event.IEventDataSender;
|
import com.xboe.core.event.IEventDataSender;
|
||||||
import com.xboe.core.orm.FieldFilters;
|
import com.xboe.core.orm.FieldFilters;
|
||||||
@@ -62,8 +64,11 @@ public class CasesRecommendPushRecordServiceImpl implements ICasesRecommendPushR
|
|||||||
@Autowired(required = false)
|
@Autowired(required = false)
|
||||||
private IEventDataSender eventDataSender;
|
private IEventDataSender eventDataSender;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ThirdApi thirdApi;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean launchPush(CasesRecommendLaunchVo casesRecommendLaunch, CurrentUser currentUser) {
|
public boolean launchPush(CasesRecommendLaunchVo casesRecommendLaunch, CurrentUser currentUser, String token) {
|
||||||
|
|
||||||
|
|
||||||
CasesRecommend casesRecommend = new CasesRecommend();
|
CasesRecommend casesRecommend = new CasesRecommend();
|
||||||
@@ -85,12 +90,42 @@ public class CasesRecommendPushRecordServiceImpl implements ICasesRecommendPushR
|
|||||||
List<String> caseIdList = importDataList.stream().filter(casesRecommendLaunchImportData -> casesRecommendLaunchImportData.getStatus() == 1).map(CasesRecommendLaunchImportData::getCaseId).collect(Collectors.toList());
|
List<String> caseIdList = importDataList.stream().filter(casesRecommendLaunchImportData -> casesRecommendLaunchImportData.getStatus() == 1).map(CasesRecommendLaunchImportData::getCaseId).collect(Collectors.toList());
|
||||||
caseIds.addAll(caseIdList);
|
caseIds.addAll(caseIdList);
|
||||||
}
|
}
|
||||||
|
List<String> userIds = new ArrayList<>();
|
||||||
|
if (CollectionUtil.isNotEmpty(casesRecommendLaunch.getPushUserIdList())) {
|
||||||
|
userIds.addAll(casesRecommendLaunch.getPushUserIdList());
|
||||||
|
}
|
||||||
|
// 组织
|
||||||
|
if (CollectionUtil.isNotEmpty(casesRecommendLaunch.getDeptIds())) {
|
||||||
|
for (String orgId : casesRecommendLaunch.getDeptIds()) {
|
||||||
|
List<OrgRootBean.ResultData> orgChildTree = thirdApi.getOrgChildTree(orgId, token);
|
||||||
|
if (CollectionUtil.isNotEmpty(orgChildTree)) {
|
||||||
|
for (OrgRootBean.ResultData result : orgChildTree) {
|
||||||
|
UserListParam build = UserListParam.builder().departId(result.getId()).pageSize(100).build();
|
||||||
|
List<UserInfoList> allUserList = thirdApi.getAllUserList(build, token);
|
||||||
|
if (CollectionUtil.isNotEmpty(allUserList)) {
|
||||||
|
for (UserInfoList userInfo : allUserList) {
|
||||||
|
userIds.add(String.valueOf(userInfo.getId()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 受众关联
|
||||||
|
if (CollectionUtil.isNotEmpty(casesRecommendLaunch.getGroupIds())) {
|
||||||
|
for (String groupId : casesRecommendLaunch.getGroupIds()) {
|
||||||
|
List<AuditList> allAudienceList = thirdApi.getAllAudienceList(AuditListParam.builder().audienceId(groupId).pageSize(100).page(1).build(), token);
|
||||||
|
if (CollectionUtil.isNotEmpty(allAudienceList)) {
|
||||||
|
allAudienceList.forEach(auditList -> userIds.add(String.valueOf(auditList.getUserId())));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (String caseId : caseIds) {
|
for (String caseId : caseIds) {
|
||||||
Cases cases = casesDao.get(caseId);
|
Cases cases = casesDao.get(caseId);
|
||||||
List<CasesRecommendPushRecord> pushRecords = new ArrayList<>();
|
List<CasesRecommendPushRecord> pushRecords = new ArrayList<>();
|
||||||
Map<String, Object> userMap = userDao.findMap("id", "name", FieldFilters.in("id", casesRecommendLaunch.getPushUserIdList()));
|
Map<String, Object> userMap = userDao.findMap("id", "name", FieldFilters.in("id", casesRecommendLaunch.getPushUserIdList()));
|
||||||
|
for (String userId : userIds) {
|
||||||
for (String userId : casesRecommendLaunch.getPushUserIdList()) {
|
|
||||||
CasesRecommendPushRecord casesRecommendPushRecord = new CasesRecommendPushRecord();
|
CasesRecommendPushRecord casesRecommendPushRecord = new CasesRecommendPushRecord();
|
||||||
casesRecommendPushRecord.setRecommendId(casesRecommend.getId());
|
casesRecommendPushRecord.setRecommendId(casesRecommend.getId());
|
||||||
casesRecommendPushRecord.setCaseId(caseId);
|
casesRecommendPushRecord.setCaseId(caseId);
|
||||||
|
|||||||
@@ -33,6 +33,17 @@ public class CasesRecommendLaunchVo {
|
|||||||
*/
|
*/
|
||||||
private List<String> pushUserIdList;
|
private List<String> pushUserIdList;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组织列表
|
||||||
|
*/
|
||||||
|
private List<String> deptIds;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 受众列表
|
||||||
|
*/
|
||||||
|
private List<String> groupIds;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 推荐机构
|
* 推荐机构
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -2,15 +2,10 @@ spring.profiles.active=@profileActive@
|
|||||||
spring.application.name=boe-server-all
|
spring.application.name=boe-server-all
|
||||||
server.port=9090
|
server.port=9090
|
||||||
server.servlet.session.timeout=30m
|
server.servlet.session.timeout=30m
|
||||||
|
|
||||||
server.servlet.encoding.charset=UTF-8
|
server.servlet.encoding.charset=UTF-8
|
||||||
server.servlet.encoding.enabled=true
|
server.servlet.encoding.enabled=true
|
||||||
server.servlet.encoding.force=true
|
server.servlet.encoding.force=true
|
||||||
|
|
||||||
server.tomcat.uri-encoding=UTF-8
|
server.tomcat.uri-encoding=UTF-8
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ok.http.connect-timeout=30
|
ok.http.connect-timeout=30
|
||||||
ok.http.read-timeout=30
|
ok.http.read-timeout=30
|
||||||
ok.http.write-timeout=30
|
ok.http.write-timeout=30
|
||||||
@@ -18,31 +13,24 @@ ok.http.write-timeout=30
|
|||||||
ok.http.max-idle-connections=200
|
ok.http.max-idle-connections=200
|
||||||
# 连接空闲时间最多为 300 秒
|
# 连接空闲时间最多为 300 秒
|
||||||
ok.http.keep-alive-duration=300
|
ok.http.keep-alive-duration=300
|
||||||
|
|
||||||
#spring.jackson.locale=
|
#spring.jackson.locale=
|
||||||
#spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
|
#spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
|
||||||
# spring.jackson.default-property-inclusion=NON_NULL
|
# spring.jackson.default-property-inclusion=NON_NULL
|
||||||
spring.jackson.time-zone=GMT+8
|
spring.jackson.time-zone=GMT+8
|
||||||
|
|
||||||
spring.servlet.multipart.max-file-size=1024MB
|
spring.servlet.multipart.max-file-size=1024MB
|
||||||
spring.servlet.multipart.max-request-size=1024MB
|
spring.servlet.multipart.max-request-size=1024MB
|
||||||
|
|
||||||
## 静态文件目录,默认是在static下面,以后独立到nginx下面配置
|
## 静态文件目录,默认是在static下面,以后独立到nginx下面配置
|
||||||
spring.mvc.static-path-pattern=/cdn/**
|
spring.mvc.static-path-pattern=/cdn/**
|
||||||
|
|
||||||
|
|
||||||
spring.redis.lettuce.pool.max-active=8
|
spring.redis.lettuce.pool.max-active=8
|
||||||
spring.redis.lettuce.pool.min-idle=0
|
spring.redis.lettuce.pool.min-idle=0
|
||||||
spring.redis.lettuce.pool.max-idle=30
|
spring.redis.lettuce.pool.max-idle=30
|
||||||
spring.redis.lettuce.pool.max-wait=10000ms
|
spring.redis.lettuce.pool.max-wait=10000ms
|
||||||
spring.redis.lettuce.shutdown-timeout=100ms
|
spring.redis.lettuce.shutdown-timeout=100ms
|
||||||
|
|
||||||
# 上传的临时目录,部署到服务器必须指定
|
# 上传的临时目录,部署到服务器必须指定
|
||||||
# spring.servlet.multipart.location=
|
# spring.servlet.multipart.location=
|
||||||
|
|
||||||
# jpa config
|
# jpa config
|
||||||
spring.jpa.database = MYSQL
|
spring.jpa.database=MYSQL
|
||||||
spring.jpa.show-sql = false
|
spring.jpa.show-sql=false
|
||||||
# spring.jpa.properties.hibernate.cache.use_second_level_cache=true
|
# spring.jpa.properties.hibernate.cache.use_second_level_cache=true
|
||||||
# spring.jpa.properties.hibernate.cache.region.factory_class=org.hibernate.cache.ehcache.EhCacheRegionFactory
|
# spring.jpa.properties.hibernate.cache.region.factory_class=org.hibernate.cache.ehcache.EhCacheRegionFactory
|
||||||
spring.jpa.properties.hibernate.naming_strategy=org.hibernate.cfg.EJB3NamingStrategy
|
spring.jpa.properties.hibernate.naming_strategy=org.hibernate.cfg.EJB3NamingStrategy
|
||||||
@@ -52,12 +40,13 @@ spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect
|
|||||||
# spring.jpa.properties.hibernate.allow_update_outside_transaction=true
|
# spring.jpa.properties.hibernate.allow_update_outside_transaction=true
|
||||||
# spring.jpa.properties.hibernate.current_session_context_class=org.springframework.orm.hibernate5.SpringSessionContext
|
# spring.jpa.properties.hibernate.current_session_context_class=org.springframework.orm.hibernate5.SpringSessionContext
|
||||||
spring.jpa.properties.hibernate.current_session_context_class=org.springframework.orm.hibernate5.SpringSessionContext
|
spring.jpa.properties.hibernate.current_session_context_class=org.springframework.orm.hibernate5.SpringSessionContext
|
||||||
|
|
||||||
|
|
||||||
# 设置logback.xml位置
|
# 设置logback.xml位置
|
||||||
logging.config=classpath:log/logback-@profileActive@.xml
|
logging.config=classpath:log/logback-@profileActive@.xml
|
||||||
|
|
||||||
# 用于分布式id生成不重复的处理 配置,0-31 的数值
|
# 用于分布式id生成不重复的处理 配置,0-31 的数值
|
||||||
# config.id.generator.server.num=1
|
# config.id.generator.server.num=1
|
||||||
# config.id.generator.datacenter.num=1
|
# config.id.generator.datacenter.num=1
|
||||||
|
boe.domain=https://pretest.zcwytd.com
|
||||||
|
orgTree.orgTreeList=${boe.domain}/userbasic/org/list
|
||||||
|
# ????id????????????
|
||||||
|
orgTree.orgChildTreeList=${boe.domain}/userbasic/org/childOrgs
|
||||||
|
userBasic.searchUserList=${boe.domain}/userbasic/user/list
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<!--应用名称-->
|
<!--应用名称-->
|
||||||
<property name="APP_NAME" value="boe-server-all"/>
|
<property name="APP_NAME" value="boe-server-all"/>
|
||||||
<!--日志文件保存路径-->
|
<!--日志文件保存路径-->
|
||||||
<property name="LOG_FILE_PATH" value="/app/logs/"/>
|
<property name="LOG_FILE_PATH" value="./logs/"/>
|
||||||
<contextName>${APP_NAME}</contextName>
|
<contextName>${APP_NAME}</contextName>
|
||||||
<!--每天记录日志到文件appender-->
|
<!--每天记录日志到文件appender-->
|
||||||
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
|||||||
Reference in New Issue
Block a user