mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-07 01:46:47 +08:00
案例样式修改
This commit is contained in:
@@ -137,6 +137,7 @@ public class CasesRecommendApi extends ApiBaseController {
|
||||
public void downloadTemplate(HttpServletResponse response) throws Exception {
|
||||
// 通过工具类创建writer,默认创建xls格式
|
||||
ExcelWriter writer = ExcelUtil.getWriter();
|
||||
writer.setColumnWidth(0, 40);
|
||||
writer.writeHeadRow(ListUtil.toList("标题"));
|
||||
response.setContentType("application/vnd.ms-excel;charset=utf-8");
|
||||
response.setHeader("Content-Disposition", "attachment;filename=failData.xls");
|
||||
@@ -228,12 +229,12 @@ public class CasesRecommendApi extends ApiBaseController {
|
||||
// 拼接上列明。我这里用的最土的方法,很不优雅别学我
|
||||
LinkedHashMap<String, String> map = new LinkedHashMap<>();
|
||||
map.put("案例名称", "caseTitle");
|
||||
map.put("推送用户", "pushUserName");
|
||||
map.put("目标用户", "pushUserName");
|
||||
map.put("所属组织", "recommendOrgName");
|
||||
map.put("推送时间", "pushTime");
|
||||
map.put("是否查看", "readFlag");
|
||||
map.put("首次查看时间", "readStartTime");
|
||||
map.put("总查看时间", "totalReadTime");
|
||||
map.put("总查看时间(秒)", "totalReadTime");
|
||||
|
||||
CasesRecommend casesRecommend = iCasesRecommendService.findById(vo.getCasesRecommendId());
|
||||
|
||||
@@ -255,9 +256,20 @@ public class CasesRecommendApi extends ApiBaseController {
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
response.setContentType("application/octet-stream");
|
||||
response.setHeader("Content-disposition", "attachment;filename=casesRecommend.xls");
|
||||
ExportsExcelSenderUtil.export(map, exportVos, outputStream, "yyyy-MM-dd HH:mm:ss");
|
||||
// 通过工具类创建writer,默认创建xls格式
|
||||
ExcelWriter writer = ExcelUtil.getWriter();
|
||||
writer.setColumnWidth(0, 40);
|
||||
writer.write(exportVos, true);
|
||||
response.setContentType("application/vnd.ms-excel;charset=utf-8");
|
||||
response.setHeader("Content-Disposition", "attachment;filename=casesRecommend.xls");
|
||||
ServletOutputStream out = response.getOutputStream();
|
||||
writer.flush(out, true);
|
||||
writer.close();
|
||||
IoUtil.close(out);
|
||||
|
||||
// response.setContentType("application/octet-stream");
|
||||
// response.setHeader("Content-disposition", "attachment;filename=casesRecommend.xls");
|
||||
// ExportsExcelSenderUtil.export(map, exportVos, outputStream, "yyyy-MM-dd HH:mm:ss");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("导出失败", e.getMessage());
|
||||
|
||||
@@ -33,38 +33,35 @@ public interface CasesRecordDao extends JpaRepository<Cases, String>, JpaSpecifi
|
||||
" or b.keyword4 like CONCAT('%',:#{#condition.keyWord},'%')" +
|
||||
" or b.keyword5 like CONCAT('%',:#{#condition.keyWord},'%'),1=1)" +
|
||||
" and if(:#{#condition.yearsEmpty},1=1, YEAR(b.sys_create_time) in (:#{#condition.years}))" +
|
||||
" and if(IFNULL(:#{#condition.majorType},'') !='',b.major_type = :#{#condition.majorType},1=1) " +
|
||||
" and if(:#{#condition.org1Empty}, 1=1, b.org_domain_parent in (:#{#condition.org1}))" +
|
||||
" and if(:#{#condition.org2Empty}, 1=1, b.org_domain_parent2 in (:#{#condition.org2}))" +
|
||||
" and if(:#{#condition.org3Empty}, 1=1, b.org_domain_parent3 in (:#{#condition.org3}))" +
|
||||
" and if(:#{#condition.caseIdsEmpty}, 1=1, b.id in (:#{#condition.caseIds}))" +
|
||||
" and ("+
|
||||
" if(:#{#condition.allOrgEmpty}, 1=1, 1=2)" +
|
||||
" or if(:#{#condition.org1Empty}, 1=2, b.org_domain_parent in (:#{#condition.org1}))" +
|
||||
" or if(:#{#condition.org2Empty}, 1=2, b.org_domain_parent2 in (:#{#condition.org2}))" +
|
||||
" or if(:#{#condition.org3Empty}, 1=2, b.org_domain_parent3 in (:#{#condition.org3}))" +
|
||||
")" +
|
||||
" 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.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},'%')" +
|
||||
" or b.keyword2 like CONCAT('%',:#{#condition.keyWord},'%')" +
|
||||
" or b.keyword3 like CONCAT('%',:#{#condition.keyWord},'%')" +
|
||||
" or b.keyword4 like CONCAT('%',:#{#condition.keyWord},'%')" +
|
||||
" or b.keyword5 like CONCAT('%',:#{#condition.keyWord},'%'),1=1)" +
|
||||
" and if(:#{#condition.yearsEmpty},1=1, YEAR(b.sys_create_time) in (:#{#condition.years}))" +
|
||||
" and if(IFNULL(:#{#condition.majorType},'') !='' ,b.major_type = :#{#condition.majorType},1=1) " +
|
||||
" and if(:#{#condition.org1Empty}, 1=1, b.org_domain_parent in (:#{#condition.org1}))" +
|
||||
" and if(:#{#condition.org2Empty}, 1=1, b.org_domain_parent2 in (:#{#condition.org2}))" +
|
||||
" 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")
|
||||
" 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.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},'%')" +
|
||||
" or b.keyword2 like CONCAT('%',:#{#condition.keyWord},'%')" +
|
||||
" or b.keyword3 like CONCAT('%',:#{#condition.keyWord},'%')" +
|
||||
" or b.keyword4 like CONCAT('%',:#{#condition.keyWord},'%')" +
|
||||
" or b.keyword5 like CONCAT('%',:#{#condition.keyWord},'%'),1=1)" +
|
||||
" and if(:#{#condition.yearsEmpty},1=1, YEAR(b.sys_create_time) in (:#{#condition.years}))" +
|
||||
" and if(:#{#condition.caseIdsEmpty}, 1=1, b.id in (:#{#condition.caseIds}))" +
|
||||
" and ("+
|
||||
" if(:#{#condition.allOrgEmpty}, 1=1, 1=2)" +
|
||||
" or if(:#{#condition.org1Empty}, 1=1, b.org_domain_parent in (:#{#condition.org1}))" +
|
||||
" or if(:#{#condition.org2Empty}, 1=1, b.org_domain_parent2 in (:#{#condition.org2}))" +
|
||||
" or 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" +
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
package com.xboe.module.boecase.dto;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.xboe.module.scorm.rte.model.datatype.Int;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Data
|
||||
public class CasePageVo extends PageDto {
|
||||
@@ -63,22 +59,29 @@ public class CasePageVo extends PageDto {
|
||||
*/
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
* 案例ids
|
||||
*/
|
||||
private List<String> caseIds;
|
||||
|
||||
|
||||
public boolean isCaseIdsEmpty() {
|
||||
return CollUtil.isEmpty(this.caseIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 推荐id
|
||||
*/
|
||||
private Long refId;
|
||||
|
||||
private List<String> org1;
|
||||
private List<String> org2;
|
||||
private List<String> org3;
|
||||
|
||||
public boolean isYearsEmpty() {
|
||||
return CollUtil.isEmpty(this.years);
|
||||
}
|
||||
|
||||
public List<String> getOrg1() {
|
||||
if (CollectionUtils.isNotEmpty(this.orgDomainDtos)) {
|
||||
return orgDomainDtos.stream().map(OrgDomainDto::getParent).filter(StrUtil::isNotBlank).collect(Collectors.toList());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean isOrg1Empty() {
|
||||
return CollUtil.isEmpty(this.getOrg1());
|
||||
}
|
||||
@@ -91,18 +94,8 @@ public class CasePageVo extends PageDto {
|
||||
return CollUtil.isEmpty(this.getOrg3());
|
||||
}
|
||||
|
||||
public List<String> getOrg2() {
|
||||
if (CollectionUtils.isNotEmpty(this.orgDomainDtos)) {
|
||||
return orgDomainDtos.stream().flatMap(it->it.getChildren().stream()).map(OrgDomainDto::getParent).filter(StrUtil::isNotBlank).collect(Collectors.toList());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public List<String> getOrg3() {
|
||||
if (CollectionUtils.isNotEmpty(this.orgDomainDtos)) {
|
||||
return orgDomainDtos.stream().flatMap(it->it.getChildren().stream().flatMap(i->i.getChildren().stream())).map(OrgDomainDto::getParent).filter(StrUtil::isNotBlank).collect(Collectors.toList());
|
||||
}
|
||||
return null;
|
||||
public boolean isAllOrgEmpty() {
|
||||
return this.isOrg1Empty() && this.isOrg2Empty() && this.isOrg3Empty();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
package com.xboe.module.boecase.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import cn.hutool.core.annotation.Alias;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class CasesRecommendPushRecordExportVo {
|
||||
@@ -11,23 +10,29 @@ public class CasesRecommendPushRecordExportVo {
|
||||
/**
|
||||
* 案例标题
|
||||
*/
|
||||
@Alias(value = "案例标题")
|
||||
private String caseTitle;
|
||||
/**
|
||||
* 推送用户名称
|
||||
*/
|
||||
@Alias(value = "目标用户")
|
||||
private String pushUserName;
|
||||
/**推荐组织名称*/
|
||||
@Alias(value = "所属组织")
|
||||
private String recommendOrgName;
|
||||
|
||||
@Alias(value = "推送时间")
|
||||
private String pushTime;
|
||||
|
||||
@Alias(value = "是否查看")
|
||||
private String readFlag;
|
||||
|
||||
/**
|
||||
* 首次查看时间
|
||||
*/
|
||||
@Alias(value = "首次查看时间")
|
||||
private String readStartTime;
|
||||
|
||||
@Alias(value = "总查看时间(秒)")
|
||||
private String totalReadTime;
|
||||
|
||||
}
|
||||
|
||||
@@ -34,16 +34,6 @@ import javax.transaction.Transactional;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import com.xboe.module.boecase.dao.CasesMajorTypeDao;
|
||||
import com.xboe.core.orm.FieldFilters;
|
||||
import com.xboe.core.orm.FieldUpdateType;
|
||||
import com.xboe.core.orm.IFieldFilter;
|
||||
import com.xboe.core.orm.LikeMatchMode;
|
||||
import com.xboe.core.orm.QueryBuilder;
|
||||
import com.xboe.core.orm.UpdateBuilder;
|
||||
import com.xboe.module.boecase.dao.CasesDao;
|
||||
import com.xboe.module.boecase.entity.Cases;
|
||||
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
@@ -73,14 +63,14 @@ public class CasesServiceImpl implements ICasesService {
|
||||
|
||||
/**
|
||||
* 案例分页查询,用于门户的查询
|
||||
* */
|
||||
*/
|
||||
@Override
|
||||
public PageList<Cases> queryPageCases(int pageIndex, int pageSize, CaseVo caseVo) {
|
||||
QueryBuilder query=QueryBuilder.from(Cases.class);
|
||||
PageList<Cases> page=null;
|
||||
QueryBuilder query = QueryBuilder.from(Cases.class);
|
||||
PageList<Cases> page = null;
|
||||
List<IFieldFilter> filters = new ArrayList<>();
|
||||
filters.add(FieldFilters.eq("deleted",false));
|
||||
List<IFieldFilter> likes=new ArrayList<IFieldFilter>();
|
||||
filters.add(FieldFilters.eq("deleted", false));
|
||||
List<IFieldFilter> likes = new ArrayList<IFieldFilter>();
|
||||
likes.add(FieldFilters.like("title", LikeMatchMode.ANYWHERE, caseVo.getKeyWord()));
|
||||
likes.add(FieldFilters.like("authorName", LikeMatchMode.ANYWHERE, caseVo.getKeyWord()));
|
||||
likes.add(FieldFilters.like("keyword1", LikeMatchMode.ANYWHERE, caseVo.getKeyWord()));
|
||||
@@ -90,23 +80,22 @@ public class CasesServiceImpl implements ICasesService {
|
||||
likes.add(FieldFilters.like("keyword5", LikeMatchMode.ANYWHERE, caseVo.getKeyWord()));
|
||||
|
||||
|
||||
if(StringUtil.isNotBlank(caseVo.getKeyWord())) {
|
||||
if (StringUtil.isNotBlank(caseVo.getKeyWord())) {
|
||||
filters.add(FieldFilters.or(likes));
|
||||
}
|
||||
|
||||
if(StringUtils.isNotBlank(caseVo.getOrgDomain())){
|
||||
if(caseVo.getOrgDomain().contains(",")){
|
||||
if (StringUtils.isNotBlank(caseVo.getOrgDomain())) {
|
||||
if (caseVo.getOrgDomain().contains(",")) {
|
||||
String[] split = caseVo.getOrgDomain().split(",");
|
||||
List<String> strings = Arrays.asList(split);
|
||||
filters.add(FieldFilters.in("orgDomainParent",strings));
|
||||
}else{
|
||||
filters.add(FieldFilters.eq("orgDomainParent",caseVo.getOrgDomain()));
|
||||
filters.add(FieldFilters.in("orgDomainParent", strings));
|
||||
} else {
|
||||
filters.add(FieldFilters.eq("orgDomainParent", caseVo.getOrgDomain()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
//增加只是查询有附件的
|
||||
filters.add(FieldFilters.isNotNull("filePath"));
|
||||
filters.add(FieldFilters.ne("filePath", ""));
|
||||
@@ -144,8 +133,8 @@ public class CasesServiceImpl implements ICasesService {
|
||||
}
|
||||
}
|
||||
|
||||
if(StringUtils.isNotBlank(caseVo.getCaseType())){
|
||||
filters.add(FieldFilters.eq("caseType",caseVo.getCaseType()));
|
||||
if (StringUtils.isNotBlank(caseVo.getCaseType())) {
|
||||
filters.add(FieldFilters.eq("caseType", caseVo.getCaseType()));
|
||||
}
|
||||
if (caseVo.getBreCommend() != null) {
|
||||
if (!caseVo.getBreCommend()) {
|
||||
@@ -172,7 +161,7 @@ public class CasesServiceImpl implements ICasesService {
|
||||
} else {
|
||||
order = OrderCondition.desc("sysCreateTime");
|
||||
}
|
||||
|
||||
|
||||
|
||||
query.addFilters(filters);
|
||||
query.addOrder(order);
|
||||
@@ -232,38 +221,52 @@ public class CasesServiceImpl implements ICasesService {
|
||||
}
|
||||
}
|
||||
List<OrgDomainDto> orgDomainDtos = caseVo.getOrgDomainDtos();
|
||||
IFieldFilter orgDomain = null;
|
||||
List<String> level1 = new ArrayList<>();
|
||||
List<String> level2 = new ArrayList<>();
|
||||
List<String> level3 = new ArrayList<>();
|
||||
if (CollUtil.isNotEmpty(orgDomainDtos)) {
|
||||
for (int i = 0; i < orgDomainDtos.size(); i++) {
|
||||
OrgDomainDto domainDto = orgDomainDtos.get(i);
|
||||
String orgDomainParent = domainDto.getParent();
|
||||
IFieldFilter itemFilter = FieldFilters.eq("orgDomainParent", orgDomainParent);
|
||||
List<OrgDomainDto> orgDomainParent2 = domainDto.getChildren();
|
||||
if (CollUtil.isNotEmpty(orgDomainParent2)) {
|
||||
List<String> seconds = orgDomainParent2.stream().map(OrgDomainDto::getParent).collect(Collectors.toList());
|
||||
IFieldFilter orgDomainParentFilter = FieldFilters.in("orgDomainParent2", seconds);
|
||||
itemFilter = FieldFilters.and(itemFilter, orgDomainParentFilter);
|
||||
}
|
||||
for (OrgDomainDto orgDomainDto : orgDomainParent2) {
|
||||
List<OrgDomainDto> orgDomainParent3 = orgDomainDto.getChildren();
|
||||
if (CollUtil.isNotEmpty(orgDomainParent3)) {
|
||||
List<String> thirds = orgDomainParent3.stream().map(OrgDomainDto::getParent).collect(Collectors.toList());
|
||||
IFieldFilter orgDomainParent3Filter = FieldFilters.eq("orgDomainParent3", thirds);
|
||||
itemFilter = FieldFilters.and(itemFilter, orgDomainParent3Filter);
|
||||
for (OrgDomainDto orgDomainDto : orgDomainParent2) {
|
||||
List<OrgDomainDto> orgDomainParent3 = orgDomainDto.getChildren();
|
||||
if (CollUtil.isNotEmpty(orgDomainParent3)) {
|
||||
List<String> parent = orgDomainParent3.stream().map(OrgDomainDto::getParent).collect(Collectors.toList());
|
||||
level3.addAll(parent);
|
||||
} else {
|
||||
String parent = orgDomainDto.getParent();
|
||||
level2.add(parent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (i == 0) {
|
||||
orgDomain = itemFilter;
|
||||
} else {
|
||||
orgDomain = FieldFilters.or(orgDomain, itemFilter);
|
||||
} else {
|
||||
String orgDomainParent = domainDto.getParent();
|
||||
level1.add(orgDomainParent);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Objects.nonNull(orgDomain)) {
|
||||
filters.add(orgDomain);
|
||||
List<IFieldFilter> subFilter = new ArrayList();
|
||||
if (CollUtil.isNotEmpty(level1)) {
|
||||
IFieldFilter filter1 = FieldFilters.in("orgDomainParent", level1);
|
||||
subFilter.add(filter1);
|
||||
}
|
||||
if (CollUtil.isNotEmpty(level2)) {
|
||||
IFieldFilter filter2 = FieldFilters.in("orgDomainParent2", level2);
|
||||
subFilter.add(filter2);
|
||||
}
|
||||
if (CollUtil.isNotEmpty(level3)) {
|
||||
IFieldFilter filter3 = FieldFilters.in("orgDomainParent3", level3);
|
||||
subFilter.add(filter3);
|
||||
}
|
||||
if (CollUtil.isNotEmpty(subFilter)) {
|
||||
if (subFilter.size() == 1) {
|
||||
filters.add(subFilter.get(0));
|
||||
} else if(subFilter.size() == 2) {
|
||||
filters.add(FieldFilters.or(subFilter.get(0), subFilter.get(1)));
|
||||
} else {
|
||||
filters.add(FieldFilters.or(subFilter));
|
||||
}
|
||||
}
|
||||
|
||||
if (StringUtils.isNotBlank(caseVo.getCaseType())) {
|
||||
filters.add(FieldFilters.eq("caseType", caseVo.getCaseType()));
|
||||
}
|
||||
@@ -346,6 +349,48 @@ public class CasesServiceImpl implements ICasesService {
|
||||
public PageList<Cases> queryRecommendPageCasesV2(CasePageVo caseVo) {
|
||||
|
||||
PageRequest pageRequest = PageRequest.of(caseVo.getPageIndex() - 1, caseVo.getPageSize());
|
||||
|
||||
|
||||
String majorType = caseVo.getMajorType();
|
||||
if (StringUtil.isNotBlank(majorType)) {
|
||||
List<CasesMajorType> casesTypes = casesMajorTypeRepoDao.findCasesBy(StrUtil.split(majorType, ","));
|
||||
if (CollUtil.isNotEmpty(casesTypes)) {
|
||||
List<String> caseIds = casesTypes.stream().map(CasesMajorType::getCaseId).collect(Collectors.toList());
|
||||
caseVo.setCaseIds(caseIds);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
List<OrgDomainDto> orgDomainDtos = caseVo.getOrgDomainDtos();
|
||||
List<String> level1 = new ArrayList<>();
|
||||
List<String> level2 = new ArrayList<>();
|
||||
List<String> level3 = new ArrayList<>();
|
||||
if (CollUtil.isNotEmpty(orgDomainDtos)) {
|
||||
for (int i = 0; i < orgDomainDtos.size(); i++) {
|
||||
OrgDomainDto domainDto = orgDomainDtos.get(i);
|
||||
List<OrgDomainDto> orgDomainParent2 = domainDto.getChildren();
|
||||
if (CollUtil.isNotEmpty(orgDomainParent2)) {
|
||||
for (OrgDomainDto orgDomainDto : orgDomainParent2) {
|
||||
List<OrgDomainDto> orgDomainParent3 = orgDomainDto.getChildren();
|
||||
if (CollUtil.isNotEmpty(orgDomainParent3)) {
|
||||
List<String> parent = orgDomainParent3.stream().map(OrgDomainDto::getParent).collect(Collectors.toList());
|
||||
level3.addAll(parent);
|
||||
} else {
|
||||
String parent = orgDomainDto.getParent();
|
||||
level2.add(parent);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
String orgDomainParent = domainDto.getParent();
|
||||
level1.add(orgDomainParent);
|
||||
}
|
||||
}
|
||||
}
|
||||
caseVo.setOrg1(level1);
|
||||
caseVo.setOrg2(level2);
|
||||
caseVo.setOrg3(level3);
|
||||
|
||||
Page<Cases> cases = casesRecordDao.queryList(pageRequest,caseVo);
|
||||
PageList<Cases> pageList = new PageList<>();
|
||||
pageList.setCount((int) cases.getTotalElements());
|
||||
@@ -687,7 +732,7 @@ public class CasesServiceImpl implements ICasesService {
|
||||
|
||||
/**
|
||||
* 首页案例
|
||||
* */
|
||||
*/
|
||||
@Override
|
||||
public List<CaseDto> caseRandom(Integer pageSize, String orderField, Boolean orderAsc) {
|
||||
|
||||
@@ -848,7 +893,8 @@ public class CasesServiceImpl implements ICasesService {
|
||||
@Override
|
||||
public List<DictItem> majorTypes() {
|
||||
List<DictItem> major_type = sysDictionaryDao.findByKey("major_type");
|
||||
String hql = "select cm.majorId,count(cm.id) from CasesMajorType cm,Cases c where cm.caseId=c.id and cm.majorId=c.majorType and c.deleted=false and (c.filePath is not null or c.filePath!='') group by cm.majorId";
|
||||
//cm.caseId=c.id and
|
||||
String hql = "select cm.majorId,count(cm.caseId) from CasesMajorType cm,Cases c where cm.caseId=c.id and c.deleted=false and (c.filePath is not null and c.filePath != '') group by cm.majorId";
|
||||
List<Object[]> listByHql = casesDao.findListByHql(hql);
|
||||
List<DictItem> dictItems = new ArrayList<>();
|
||||
for (DictItem d : major_type) {
|
||||
@@ -940,7 +986,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 a.deleted = false 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<>();
|
||||
|
||||
Reference in New Issue
Block a user