mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-09 19:06:49 +08:00
Merge branch 'master' of https://codeup.aliyun.com/648097ddb583fece2f059e59/boe/java-servers into zcwy-dev
This commit is contained in:
@@ -198,7 +198,7 @@ public class CasesApi extends ApiBaseController {
|
||||
caseExportVo.setTitle(c.getTitle());
|
||||
caseExportVo.setConfidentialityLevel(c.getConfidentialityLevel());
|
||||
caseExportVo.setViews(c.getViews());
|
||||
caseExportVo.setRecommends(c.getRecommends());
|
||||
caseExportVo.setRecommends(c.getRecommends1());
|
||||
caseExportVo.setCites(c.getCites());
|
||||
caseExportVo.setPraises(c.getPraises());
|
||||
caseExportVo.setComments(c.getComments());
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.xboe.common.PageList;
|
||||
import com.xboe.core.orm.BaseDao;
|
||||
import com.xboe.core.orm.FieldFilters;
|
||||
import com.xboe.core.orm.IFieldFilter;
|
||||
import com.xboe.module.boecase.dto.CaseVo;
|
||||
import com.xboe.module.boecase.entity.Cases;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@@ -33,5 +34,4 @@ public class CasesDao extends BaseDao<Cases> {
|
||||
public Cases getByTitle(String title) {
|
||||
return this.getGenericDao().findOne(Cases.class, FieldFilters.eq("title", title));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.xboe.module.boecase.dao;
|
||||
|
||||
import com.xboe.module.boecase.dto.CasePageVo;
|
||||
import com.xboe.module.boecase.dto.CaseVo;
|
||||
import com.xboe.module.boecase.entity.Cases;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
@@ -10,6 +11,9 @@ import org.springframework.data.jpa.repository.Query;
|
||||
import org.springframework.data.repository.query.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import javax.persistence.SqlResultSetMapping;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author : civism
|
||||
* @version 1.0
|
||||
@@ -20,8 +24,7 @@ public interface CasesRecordDao extends JpaRepository<Cases, String>, JpaSpecifi
|
||||
|
||||
@Query(nativeQuery = true, value = "select c.* from ( select b.*" +
|
||||
" from boe_cases_recommend_push_record a INNER JOIN boe_cases b on a.case_id = b.id" +
|
||||
" where b.deleted=0 and a.push_status = 3 and a.push_user_id= :#{#condition.userId}" +
|
||||
" and if(IFNULL(:#{#condition.refId},'') !='' ,a.recommend_id = :#{#condition.refId},1=1) " +
|
||||
" where b.deleted=0 and a.push_status = 3 and a.deleted=0 and a.push_user_id= :#{#condition.userId}" +
|
||||
" and if(IFNULL(:#{#condition.keyWord},'')!='',b.title like CONCAT('%',:#{#condition.keyWord},'%')" +
|
||||
" or b.author_name like CONCAT('%',:#{#condition.keyWord},'%')" +
|
||||
" or b.keyword1 like CONCAT('%',:#{#condition.keyWord},'%')" +
|
||||
@@ -37,8 +40,7 @@ public interface CasesRecordDao extends JpaRepository<Cases, String>, JpaSpecifi
|
||||
" order by a.sys_create_time DESC, a.read_flag ASC) as c group by c.id",
|
||||
countQuery = "select count(*) FROM (select c.* from ( select b.*" +
|
||||
" from boe_cases_recommend_push_record a INNER JOIN boe_cases b on a.case_id = b.id " +
|
||||
" where b.deleted=0 and a.push_status = 3 and a.push_user_id= :#{#condition.userId}" +
|
||||
" and if(IFNULL(:#{#condition.refId},'') !='' ,a.recommend_id = :#{#condition.refId},1=1) " +
|
||||
" where b.deleted=0 and a.push_status = 3 and a.deleted=0 and a.push_user_id= :#{#condition.userId}" +
|
||||
" and if(IFNULL(:#{#condition.keyWord},'')!='',b.title like CONCAT('%',:#{#condition.keyWord},'%')" +
|
||||
" or b.author_name like CONCAT('%',:#{#condition.keyWord},'%')" +
|
||||
" or b.keyword1 like CONCAT('%',:#{#condition.keyWord},'%')" +
|
||||
@@ -53,4 +55,24 @@ public interface CasesRecordDao extends JpaRepository<Cases, String>, JpaSpecifi
|
||||
" and if(:#{#condition.org3Empty}, 1=1, b.org_domain_parent3 in (:#{#condition.org3}))" +
|
||||
" order by a.sys_create_time DESC, a.read_flag ASC ) as c group by c.id) as d")
|
||||
Page<Cases> queryList(Pageable pageable, @Param("condition") CasePageVo casePage);
|
||||
|
||||
// @Query(nativeQuery = true, value = "SELECT bc.*, COUNT(bcrpr.case_id) AS recommends1 FROM boe_cases bc LEFT JOIN boe_cases_recommend_push_record bcrpr ON bc.id = bcrpr.case_id" +
|
||||
// " where bc.deleted = 0" +
|
||||
// " and if(IFNULL(:#{#caseVo.keyWord},'')!='',bc.title like CONCAT('%',:#{#caseVo.keyWord},'%'),1=1)" +
|
||||
// " and if(IFNULL(:#{#caseVo.authorName},'')!='',bc.author_name like CONCAT('%',:#{#caseVo.authorName},'%'),1=1)" +
|
||||
// " and if(IFNULL(:#{#caseVo.orgDomain},'') !='' ,bc.org_domain_parent = :#{#caseVo.orgDomain},1=1) " +
|
||||
// " and if(IFNULL(:#{#caseVo.excellent},'') !='' ,bc.excellent = :#{#caseVo.excellent},1=1) " +
|
||||
// " and if(IFNULL(:#{#caseVo.isTop},'') !='' ,bc.is_top = :#{#caseVo.isTop},1=1) " +
|
||||
// " GROUP BY bc.id ORDER BY bc.sys_create_time desc")
|
||||
// List<Cases> exportCase(@Param("caseVo")CaseVo caseVo);
|
||||
|
||||
@Query("SELECT new Cases(bc.title, bc.authorName, bc.comments, bc.views, bc.praises, bc.shares, bc.favorites, COUNT(bcrpr.caseId), bc.cites, bc.confidentialityLevel) FROM Cases bc LEFT JOIN CasesRecommendPushRecord bcrpr ON bc.id = bcrpr.caseId" +
|
||||
" where bc.deleted = false" +
|
||||
" and (:keyWord IS NULL or bc.title LIKE %:keyWord%)" +
|
||||
" and (:authorName IS NULL or bc.authorName LIKE %:authorName%)" +
|
||||
" and (:orgDomain IS NULL or bc.orgDomainParent = :orgDomain)" +
|
||||
" and (:excellent IS NULL or bc.excellent = :excellent)" +
|
||||
" and (:isTop IS NULL or bc.isTop = :isTop)" +
|
||||
" GROUP BY bc.id ORDER BY bc.sysCreateTime desc")
|
||||
List<Cases> exportCase(String keyWord, String authorName,String orgDomain,Boolean excellent,Boolean isTop);
|
||||
}
|
||||
|
||||
@@ -103,8 +103,7 @@ public class Cases extends BaseEntity {
|
||||
private Integer favorites;
|
||||
|
||||
// 推荐量
|
||||
@Column(name = "recommends", nullable = false)
|
||||
private Integer recommends;
|
||||
private Long recommends1;
|
||||
|
||||
// 引用量
|
||||
@Column(name = "cites", nullable = false)
|
||||
@@ -268,14 +267,14 @@ public class Cases extends BaseEntity {
|
||||
private String recommendOrgName;
|
||||
|
||||
@Transient
|
||||
private Long recommendId;
|
||||
private String refId;
|
||||
|
||||
public Long getRecommendId() {
|
||||
return recommendId;
|
||||
public String getRefId() {
|
||||
return refId;
|
||||
}
|
||||
|
||||
public void setRecommendId(Long recommendId) {
|
||||
this.recommendId = recommendId;
|
||||
public void setRefId(String refId) {
|
||||
this.refId = refId;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
@@ -294,6 +293,15 @@ public class Cases extends BaseEntity {
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
public Long getRecommends1() {
|
||||
return recommends1;
|
||||
}
|
||||
@Transient
|
||||
public void setRecommends1(Long recommends1) {
|
||||
this.recommends1 = recommends1;
|
||||
}
|
||||
|
||||
|
||||
public Cases() {
|
||||
|
||||
}
|
||||
@@ -365,4 +373,17 @@ public class Cases extends BaseEntity {
|
||||
public Cases(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public Cases(String title,String authorName, int comments, int views, int praises, int shares, int favorites, Long recommends1, int cites, String confidentialityLevel) {
|
||||
this.title = title;
|
||||
this.views = views;
|
||||
this.praises = praises;
|
||||
this.shares = shares;
|
||||
this.favorites = favorites;
|
||||
this.recommends1 = recommends1;
|
||||
this.cites = cites;
|
||||
this.comments = comments;
|
||||
this.authorName = authorName;
|
||||
this.confidentialityLevel = confidentialityLevel;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -94,7 +94,8 @@ public class CasesRecommendPushRecord extends BaseEntity {
|
||||
public CasesRecommendPushRecord() {
|
||||
}
|
||||
|
||||
public CasesRecommendPushRecord(String recommendId,String caseId) {
|
||||
public CasesRecommendPushRecord(String id,String recommendId,String caseId) {
|
||||
this.setId(id);
|
||||
this.recommendId = recommendId;
|
||||
this.caseId = caseId;
|
||||
}
|
||||
|
||||
@@ -211,6 +211,7 @@ public class CasesRecommendPushRecordServiceImpl implements ICasesRecommendPushR
|
||||
.addUpdateField("readFlag", 1)
|
||||
.addUpdateField("readStartTime", new Date())
|
||||
.addFilter(FieldFilters.eq("id", caseRecommendId))
|
||||
.addFilter(FieldFilters.eq("readFlag", 0))
|
||||
.builder()) > 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -288,7 +288,7 @@ public class CasesServiceImpl implements ICasesService {
|
||||
if (CollUtil.isNotEmpty(list) && StrUtil.isNotBlank(caseVo.getUserId())) {
|
||||
List<String> caseIds = list.stream().map(Cases::getId).collect(Collectors.toList());
|
||||
QueryBuilder recommendCasesQuery = QueryBuilder.from(CasesRecommendPushRecord.class);
|
||||
recommendCasesQuery.addField("new CasesRecommendPushRecord(recommendId,caseId)");
|
||||
recommendCasesQuery.addField("new CasesRecommendPushRecord(id,recommendId,caseId)");
|
||||
List<IFieldFilter> subFilters = new ArrayList<>();
|
||||
subFilters.add(FieldFilters.eq("pushUserId", caseVo.getUserId()));
|
||||
subFilters.add(FieldFilters.in("caseId", caseIds));
|
||||
@@ -341,7 +341,7 @@ public class CasesServiceImpl implements ICasesService {
|
||||
String userId = caseVo.getUserId();
|
||||
if (CollUtil.isNotEmpty(caseIds)) {
|
||||
QueryBuilder recommendCasesQuery = QueryBuilder.from(CasesRecommendPushRecord.class);
|
||||
recommendCasesQuery.addField("new CasesRecommendPushRecord(recommendId,caseId)");
|
||||
recommendCasesQuery.addField("new CasesRecommendPushRecord(id,recommendId,caseId)");
|
||||
List<IFieldFilter> subFilters = new ArrayList<>();
|
||||
subFilters.add(FieldFilters.eq("pushUserId", userId));
|
||||
subFilters.add(FieldFilters.in("caseId", caseIds));
|
||||
@@ -367,6 +367,7 @@ public class CasesServiceImpl implements ICasesService {
|
||||
if (Objects.nonNull(one)) {
|
||||
CasesRecommend recommend = collect.get(one.getRecommendId());
|
||||
it.setBreCommend(1);
|
||||
it.setRefId(one.getId());
|
||||
it.setRecommendOrgName(recommend.getRecommendOrgName());
|
||||
it.setSysCreateTime(recommend.getRecommendTime());
|
||||
}
|
||||
@@ -428,38 +429,12 @@ public class CasesServiceImpl implements ICasesService {
|
||||
|
||||
@Override
|
||||
public List<Cases> exportCase(CaseVo caseVo) {
|
||||
List<IFieldFilter> filters = new ArrayList<>();
|
||||
filters.add(FieldFilters.eq("deleted", false));
|
||||
if (StringUtils.isNotBlank(caseVo.getKeyWord())) {
|
||||
filters.add(FieldFilters.like("title", LikeMatchMode.ANYWHERE, caseVo.getKeyWord()));
|
||||
}
|
||||
if (StringUtils.isNotBlank(caseVo.getOrgDomain())) {
|
||||
filters.add(FieldFilters.eq("orgDomainParent", caseVo.getOrgDomain()));
|
||||
}
|
||||
if (caseVo.getExcellent() != null) {
|
||||
filters.add(FieldFilters.eq("excellent", caseVo.getExcellent()));
|
||||
}
|
||||
if (caseVo.getIsTop() != null) {
|
||||
filters.add(FieldFilters.eq("isTop", caseVo.getIsTop()));
|
||||
}
|
||||
if (StringUtils.isNotBlank(caseVo.getAuthorName())) {
|
||||
filters.add(FieldFilters.like("authorName", LikeMatchMode.ANYWHERE, caseVo.getAuthorName()));
|
||||
}
|
||||
List<Cases> list = casesRecordDao.exportCase(caseVo.getKeyWord(), caseVo.getAuthorName(), caseVo.getOrgDomain(), caseVo.getExcellent(), caseVo.getIsTop());
|
||||
|
||||
OrderCondition order = null;
|
||||
if (StringUtils.isNotBlank(caseVo.getOrderField())) {
|
||||
if (caseVo.getOrderAsc() == null || caseVo.getOrderAsc()) {
|
||||
order = OrderCondition.asc(caseVo.getOrderField());
|
||||
} else {
|
||||
order = OrderCondition.desc(caseVo.getOrderField());
|
||||
}
|
||||
} else {
|
||||
order = OrderCondition.desc("sysCreateTime");
|
||||
}
|
||||
List<Cases> list = casesDao.findListByFilters(order, filters);
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<Cases> managerCaseTitleList(CaseVo caseVo) {
|
||||
QueryBuilder query = QueryBuilder.from(Cases.class);
|
||||
@@ -817,7 +792,7 @@ public class CasesServiceImpl implements ICasesService {
|
||||
cases.setShares(0);
|
||||
cases.setFavorites(0);
|
||||
cases.setCites(0);
|
||||
cases.setRecommends(0);
|
||||
cases.setRecommends1(0L);
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
List<String> majorIds = cases.getMajorIds();
|
||||
for (String s : majorIds) {
|
||||
@@ -951,7 +926,7 @@ public class CasesServiceImpl implements ICasesService {
|
||||
String accountId = current.getAccountId();
|
||||
List<Cases> result = new ArrayList<>();
|
||||
try {
|
||||
String hql = "select a.caseId FROM CasesRecommendPushRecord a left join Cases b ON a.caseId = b.id WHERE a.pushUserId=?1 and a.pushStatus=3 and b.deleted = false group by a.caseId ORDER By a.pushTime DESC";
|
||||
String hql = "select a.caseId FROM CasesRecommendPushRecord a left join Cases b ON a.caseId = b.id WHERE a.pushUserId=?1 and a.pushStatus=3 and a.deleted = false and b.deleted = false group by a.caseId ORDER By a.pushTime DESC";
|
||||
List<String> listFields = casesRecommendDao.findListFields(hql, CASE_LEN, ListUtil.toList(accountId));
|
||||
// List<String> listFields = new ArrayList<>();
|
||||
List<String> caseIds = new ArrayList<>();
|
||||
|
||||
@@ -10,7 +10,7 @@ public class CaseExportVo {
|
||||
|
||||
private Integer views;
|
||||
|
||||
private Integer recommends;
|
||||
private Long recommends;
|
||||
|
||||
private Integer cites;
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.xboe.module.course.api;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@@ -221,9 +222,11 @@ public class CourseFullTextApi extends ApiBaseController{
|
||||
paras.setOpenCourse(dto.getOpenCourse());
|
||||
if(StringUtils.isNotBlank(dto.getOrderField())) {
|
||||
if(dto.getOrderField().equals("studys")) {
|
||||
paras.setOrderType(2);
|
||||
paras.setOrderType(2);//最热
|
||||
}else if (dto.getOrderField().equals("publishTime")){
|
||||
paras.setOrderType(1);//最新
|
||||
}else {
|
||||
paras.setOrderType(1);
|
||||
paras.setOrderType(3);//好评
|
||||
}
|
||||
}
|
||||
|
||||
@@ -261,7 +264,19 @@ public class CourseFullTextApi extends ApiBaseController{
|
||||
c.setTeacher(ct.getTeacherName());
|
||||
}
|
||||
}
|
||||
|
||||
if (StringUtils.isNotBlank(c.getKeywords()) ){
|
||||
String[] keywords = c.getKeywords().split(",");
|
||||
if (keywords.length == 1){
|
||||
keywords = c.getKeywords().split(" ");
|
||||
}
|
||||
if (keywords.length > 0){
|
||||
List<String> keywordsList = Arrays.asList(keywords);
|
||||
c.setKeywordsList(keywordsList);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return success(coursePageList);
|
||||
}catch(Exception e) {
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
## redis
|
||||
spring.redis.database=2
|
||||
spring.redis.host=10.251.160.38
|
||||
spring.redis.password=qwert!W577
|
||||
spring.redis.port=6379
|
||||
|
||||
## datasource config
|
||||
spring.jpa.hibernate.ddl-auto=none
|
||||
spring.datasource.driverClassName=com.mysql.jdbc.Driver
|
||||
# spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
|
||||
spring.datasource.url=jdbc:mysql://10.251.160.40:3306/boe_base?useSSL=false&useUnicode=true&characterEncoding=UTF8&zeroDateTimeBehavior=convertToNull
|
||||
spring.datasource.username=admin
|
||||
spring.datasource.password=boeRds01
|
||||
|
||||
logging.level.org.hibernate.SQL=DEBUG
|
||||
logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE
|
||||
|
||||
# 设置logback.xml位置
|
||||
logging.config=classpath:log/logback-test.xml
|
||||
|
||||
server.tomcat.accept-count=1000
|
||||
|
||||
# 最大可被连接数,默认10000
|
||||
server.tomcat.max-connections=10000
|
||||
|
||||
# 最大工作线程数,默认200,
|
||||
server.tomcat.threads.max=500
|
||||
|
||||
# 最小工作线程数,初始化分配线程数,默认10
|
||||
server.tomcat.threads.min-spare=100
|
||||
# 定制KeepAliveTimeout,设置30秒内没有请求则服务器自动断开keepalive连接
|
||||
server.tomcat.keep-alive-timeout=3000
|
||||
## 当客户端发送超过10000个请求则自动断开keepalive连接
|
||||
server.tomcat.max-keep-alive-requests=10000
|
||||
|
||||
## xboe config
|
||||
xboe.api.cross_filter=true
|
||||
|
||||
## 上传存储的路径配置
|
||||
xboe.upload.file.temp_path=/tmp
|
||||
xboe.upload.file.save_path=/home/www/elearning/upload
|
||||
xboe.upload.file.http_path=http://10.251.160.135/upload
|
||||
|
||||
## 外部接口调用地址 旧系统机构及用户数据接口
|
||||
xboe.externalinterface.url.system=http://127.0.0.1:9091
|
||||
|
||||
## 新增加的教师的内部调用接口
|
||||
xboe.old.base.url=https://10.251.160.135
|
||||
|
||||
## 用户统计接口的api地址
|
||||
xboe.stat.base.url=http://127.0.0.1:9080
|
||||
xboe.server.userbasic.url=https://10.251.160.135/userbasic
|
||||
|
||||
#加密盐
|
||||
#jasypt.encryptor.password=jasypt
|
||||
jasypt.encryptor.algorithm=PBEWithMD5AndDES
|
||||
jasypt.encryptor.iv-generator-classname=org.jasypt.iv.NoIvGenerator
|
||||
|
||||
# elasticsearch config
|
||||
xboe.elasticsearch.server.ip=10.251.129.25
|
||||
xboe.elasticsearch.server.port=9200
|
||||
xboe.elasticsearch.server.user=elastic
|
||||
xboe.elasticsearch.server.password=Boe@es123
|
||||
|
||||
## 邮件的配置
|
||||
xboe.email.url=https://10.251.160.135/api/b1/email/send
|
||||
xboe.email.from=boeu_learning@boe.com.cn
|
||||
xboe.email.user=
|
||||
xboe.email.security=
|
||||
Reference in New Issue
Block a user