mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-10 19:36:50 +08:00
add 案例分类添加功能
This commit is contained in:
@@ -11,12 +11,14 @@ import com.xboe.core.orm.FieldFilters;
|
|||||||
import com.xboe.module.boecase.dao.CasesMajorTypeDao;
|
import com.xboe.module.boecase.dao.CasesMajorTypeDao;
|
||||||
import com.xboe.module.boecase.dto.*;
|
import com.xboe.module.boecase.dto.*;
|
||||||
import com.xboe.module.boecase.entity.CasesMajorType;
|
import com.xboe.module.boecase.entity.CasesMajorType;
|
||||||
|
import com.xboe.module.boecase.service.ICasesRecommendPushRecordService;
|
||||||
import com.xboe.module.boecase.vo.CaseExportVo;
|
import com.xboe.module.boecase.vo.CaseExportVo;
|
||||||
import com.xboe.module.dict.entity.DictItem;
|
import com.xboe.module.dict.entity.DictItem;
|
||||||
import com.xboe.module.excel.ExportsExcelSenderUtil;
|
import com.xboe.module.excel.ExportsExcelSenderUtil;
|
||||||
|
|
||||||
import com.xboe.system.user.dao.UserDao;
|
import com.xboe.system.user.dao.UserDao;
|
||||||
import com.xboe.system.user.entity.User;
|
import com.xboe.system.user.entity.User;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
@@ -63,6 +65,9 @@ public class CasesApi extends ApiBaseController {
|
|||||||
@Resource
|
@Resource
|
||||||
private UserDao userDao;
|
private UserDao userDao;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ICasesRecommendPushRecordService casesRecommendPushRecordService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用于后台管理
|
* 用于后台管理
|
||||||
* @param pager
|
* @param pager
|
||||||
@@ -123,9 +128,8 @@ public class CasesApi extends ApiBaseController {
|
|||||||
return success(views);
|
return success(views);
|
||||||
}
|
}
|
||||||
|
|
||||||
// @PostMapping("/queryListV2")
|
@PostMapping("/queryListV2")
|
||||||
// public JsonResponse<PageList<Cases>> queryCaseBreV2(@Validated @RequestBody CasePageVo req){
|
public JsonResponse<PageList<Cases>> queryCaseBreV2(@Validated @RequestBody CasePageVo req){
|
||||||
public JsonResponse<PageList<Cases>> queryCaseBreV2(CasePageVo req){
|
|
||||||
String type = req.getType();
|
String type = req.getType();
|
||||||
PageList<Cases> views;
|
PageList<Cases> views;
|
||||||
req.setUserId(getCurrent().getAccountId());
|
req.setUserId(getCurrent().getAccountId());
|
||||||
@@ -524,14 +528,21 @@ public class CasesApi extends ApiBaseController {
|
|||||||
if(StringUtil.isBlank(cases.getAuthorId())){
|
if(StringUtil.isBlank(cases.getAuthorId())){
|
||||||
return badRequest("请选择作者");
|
return badRequest("请选择作者");
|
||||||
}
|
}
|
||||||
|
// if(StringUtils.isBlank(cases.getType())){
|
||||||
|
// return badRequest("type参数不能为空");
|
||||||
|
// }
|
||||||
if(cases.getExcellent()==null){
|
if(cases.getExcellent()==null){
|
||||||
cases.setExcellent(false);
|
cases.setExcellent(false);
|
||||||
}
|
}
|
||||||
if(StringUtils.isBlank(cases.getConfidentialityLevel())) {
|
if(StringUtils.isBlank(cases.getConfidentialityLevel())) {
|
||||||
cases.setConfidentialityLevel("内部");
|
cases.setConfidentialityLevel("内部");
|
||||||
}
|
}
|
||||||
|
String type = cases.getType();
|
||||||
try {
|
try {
|
||||||
casesService.update(cases);
|
casesService.update(cases);
|
||||||
|
if(type.equals("recommend")){
|
||||||
|
casesRecommendPushRecordService.update(cases);
|
||||||
|
}
|
||||||
return success(true);
|
return success(true);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("更新案例错误",e);
|
log.error("更新案例错误",e);
|
||||||
|
|||||||
@@ -257,6 +257,18 @@ public class Cases extends BaseEntity {
|
|||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private LocalDateTime excellentTime;
|
private LocalDateTime excellentTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* type 种类
|
||||||
|
* 区分 案例/推荐案例
|
||||||
|
*/
|
||||||
|
@Transient
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
@Transient
|
@Transient
|
||||||
private List<String> majorIds;
|
private List<String> majorIds;
|
||||||
|
|
||||||
|
|||||||
@@ -79,6 +79,26 @@ public class CasesRecommendPushRecord extends BaseEntity {
|
|||||||
@Column(name = "read_start_time")
|
@Column(name = "read_start_time")
|
||||||
private Date readStartTime;
|
private Date readStartTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* sysType1
|
||||||
|
*/
|
||||||
|
@Column(name = "sys_type1")
|
||||||
|
private String sysType1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* sysType2
|
||||||
|
*/
|
||||||
|
@Column(name = "sys_type2")
|
||||||
|
private String sysType2;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* sysType3
|
||||||
|
*/
|
||||||
|
@Column(name = "sys_type3")
|
||||||
|
private String sysType3;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// /**
|
// /**
|
||||||
// * 最后查看时间
|
// * 最后查看时间
|
||||||
// */
|
// */
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.xboe.module.boecase.service;
|
package com.xboe.module.boecase.service;
|
||||||
|
|
||||||
import com.xboe.core.CurrentUser;
|
import com.xboe.core.CurrentUser;
|
||||||
|
import com.xboe.module.boecase.entity.Cases;
|
||||||
import com.xboe.module.boecase.entity.CasesRecommend;
|
import com.xboe.module.boecase.entity.CasesRecommend;
|
||||||
import com.xboe.module.boecase.entity.CasesRecommendPushRecord;
|
import com.xboe.module.boecase.entity.CasesRecommendPushRecord;
|
||||||
import com.xboe.module.boecase.vo.CasesRecommendLaunchVo;
|
import com.xboe.module.boecase.vo.CasesRecommendLaunchVo;
|
||||||
@@ -45,10 +46,17 @@ public interface ICasesRecommendPushRecordService {
|
|||||||
*/
|
*/
|
||||||
boolean startRead(String caseRecommendId);
|
boolean startRead(String caseRecommendId);
|
||||||
|
|
||||||
|
boolean update(Cases cases);
|
||||||
|
|
||||||
// /**
|
// /**
|
||||||
// * 结束读
|
// * 结束读
|
||||||
// * @param caseRecommendId
|
// * @param caseRecommendId
|
||||||
// * @return
|
// * @return
|
||||||
// */
|
// */
|
||||||
// boolean endRead(String caseRecommendId);
|
// boolean endRead(String caseRecommendId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 推荐案例修改
|
||||||
|
*/
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import com.xboe.module.boecase.service.ICasesRecommendPushRecordService;
|
|||||||
import com.xboe.module.boecase.vo.CasesRecommendLaunchVo;
|
import com.xboe.module.boecase.vo.CasesRecommendLaunchVo;
|
||||||
import com.xboe.system.user.dao.UserDao;
|
import com.xboe.system.user.dao.UserDao;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
@@ -225,6 +226,28 @@ public class CasesRecommendPushRecordServiceImpl implements ICasesRecommendPushR
|
|||||||
.builder()) > 0;
|
.builder()) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean update(Cases cases) {
|
||||||
|
String sysType1 = "";
|
||||||
|
String sysType2 = "";
|
||||||
|
String sysType3 = "";
|
||||||
|
if(StringUtils.isNotEmpty(cases.getSysType1())){
|
||||||
|
sysType1 = cases.getSysType1();
|
||||||
|
}
|
||||||
|
if(StringUtils.isNotEmpty(cases.getSysType2())){
|
||||||
|
sysType2 = cases.getSysType2();
|
||||||
|
}
|
||||||
|
if(StringUtils.isNotEmpty(cases.getSysType3())){
|
||||||
|
sysType3 = cases.getSysType3();
|
||||||
|
}
|
||||||
|
return casesRecommendPushRecordDao.update(UpdateBuilder.from(CasesRecommendPushRecord.class)
|
||||||
|
.addUpdateField("sys_type1",sysType1)
|
||||||
|
.addUpdateField("sys_type2",sysType2)
|
||||||
|
.addUpdateField("sys_type3",sysType3)
|
||||||
|
.addFilter(FieldFilters.eq("id",cases.getId())).builder()
|
||||||
|
) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
// @Override
|
// @Override
|
||||||
// public boolean endRead(String caseRecommendId) {
|
// public boolean endRead(String caseRecommendId) {
|
||||||
// CasesRecommendPushRecord casesRecommendPushRecord = casesRecommendPushRecordDao.get(caseRecommendId);
|
// CasesRecommendPushRecord casesRecommendPushRecord = casesRecommendPushRecordDao.get(caseRecommendId);
|
||||||
|
|||||||
Reference in New Issue
Block a user