Commit d1a98357 authored by luzhuang's avatar luzhuang

feat: 智学2.0 新增new显示字段

parent c830505b
...@@ -74,7 +74,7 @@ public class BCourseController extends PaginationController<BCourse> { ...@@ -74,7 +74,7 @@ public class BCourseController extends PaginationController<BCourse> {
return Result.builder(new PersistModel(1), return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS, MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR, MessageConstant.MESSAGE_ALERT_ERROR,
bCourseRepository.queryFirstLevel(curUser.getCorpId(),num)); bCourseServiceImpl.queryFirstLevel(curUser.getCorpId(),num));
} }
@ApiOperation(value = "304 逻辑删除", notes = "根据ID删除一条记录") @ApiOperation(value = "304 逻辑删除", notes = "根据ID删除一条记录")
......
...@@ -29,4 +29,7 @@ public class QueryCourseResDTO { ...@@ -29,4 +29,7 @@ public class QueryCourseResDTO {
@ApiModelProperty(value = "等级") @ApiModelProperty(value = "等级")
private String courseLevel; private String courseLevel;
@ApiModelProperty(value = "new的数量")
private int newCount;
} }
...@@ -30,5 +30,7 @@ public interface BCourseService { ...@@ -30,5 +30,7 @@ public interface BCourseService {
*/ */
List<AllCourseDTO> findAllCourse(String corpId); List<AllCourseDTO> findAllCourse(String corpId);
List<QueryCourseResDTO> queryFirstLevel(String corpId,int num);
} }
...@@ -9,6 +9,8 @@ import org.rcisoft.business.bcourse.dto.AllCourseDTO; ...@@ -9,6 +9,8 @@ import org.rcisoft.business.bcourse.dto.AllCourseDTO;
import org.rcisoft.business.bcourse.dto.QueryCourseResDTO; import org.rcisoft.business.bcourse.dto.QueryCourseResDTO;
import org.rcisoft.business.bcourse.entity.BCourse; import org.rcisoft.business.bcourse.entity.BCourse;
import org.rcisoft.business.bcourse.service.BCourseService; import org.rcisoft.business.bcourse.service.BCourseService;
import org.rcisoft.business.blesson.entity.BLesson;
import org.rcisoft.business.blesson.service.impl.BLessonServiceImpl;
import org.rcisoft.business.blesson.util.Recursion; import org.rcisoft.business.blesson.util.Recursion;
import org.rcisoft.core.aop.PageUtil; import org.rcisoft.core.aop.PageUtil;
import org.rcisoft.core.constant.MessageConstant; import org.rcisoft.core.constant.MessageConstant;
...@@ -28,6 +30,9 @@ public class BCourseServiceImpl implements BCourseService { ...@@ -28,6 +30,9 @@ public class BCourseServiceImpl implements BCourseService {
@Autowired @Autowired
private BCourseRepository bCourseRepository; private BCourseRepository bCourseRepository;
@Autowired
private BLessonServiceImpl bLessonService;
@Override @Override
public List<Map<String,Object>> queryBCourse(BCourse model) { public List<Map<String,Object>> queryBCourse(BCourse model) {
...@@ -245,4 +250,66 @@ public class BCourseServiceImpl implements BCourseService { ...@@ -245,4 +250,66 @@ public class BCourseServiceImpl implements BCourseService {
return bCourseRepository.findAllCourse(corpId); return bCourseRepository.findAllCourse(corpId);
} }
@Override
public List<QueryCourseResDTO> queryFirstLevel(String corpId,int num) {
List<QueryCourseResDTO> dtoList = bCourseRepository.queryFirstLevel(corpId,num);
return dtoList;
}
/**
* 生产分类中 new 的个数
* @param resDTOS 一级分类带子分类集合
* @return
*/
public List<QueryCourseResDTO> addNewFolder(List<QueryCourseResDTO> resDTOS){
List<BLesson> lessons = bLessonService.queryHomeBLessons();//查询首页显示的所有 课程(isNew 已赋值)
for (QueryCourseResDTO dto : resDTOS){
int num = 0; //属于当前分类的课程数
int secNum = 0 ;//下层分类中的课程数
for (BLesson b : lessons){
if("1".equals(b.getIsNew())){
num++;
}else{
continue;
}
}
if (dto.getChildren() == null)
continue;
for (QueryCourseResDTO dto1 : dto.getChildren()){
int num1 = 0;
int secNum1 = 0 ;//下层分类中的课程数
for (BLesson b : lessons){
if(b.getCourseId().equals(dto1.getKey()) && "1".equals(b.getIsNew())){
num1++;
}else{
continue;
}
}
secNum += num1;
if (dto.getChildren() == null)
continue;
for (QueryCourseResDTO dto2 : dto.getChildren()){
int num2 = 0;
for (BLesson b : lessons){
if(b.getCourseId().equals(dto2.getKey()) && "1".equals(b.getIsNew())){
num2++;
}else{
continue;
}
}
secNum1+=num2;
dto2.setNewCount(num2);
}
secNum += secNum1;
}
}
return resDTOS;
}
} }
...@@ -772,5 +772,25 @@ public class BLessonController extends PaginationController<BLesson> { ...@@ -772,5 +772,25 @@ public class BLessonController extends PaginationController<BLesson> {
} }
@ApiOperation(value = "644 点击课程", notes = "取消new显示")
@PostMapping(value = "/look")
public Result look(CurUser curUser, String lessonId) {
return Result.builder(bLessonService.look(curUser,lessonId),
MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR,
lessonId);
}
@ApiOperation(value = "645555 点击课程", notes = "取消new显示")
@PostMapping(value = "/test")
public Result test (CurUser curUser) {
return Result.builder(bLessonService.test(),
MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR,
"lessonId");
}
} }
...@@ -1219,5 +1219,25 @@ public interface BLessonRepository extends BaseMapper<BLesson> { ...@@ -1219,5 +1219,25 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
*/ */
@Select("select business_id from s_user WHERE account_id in (${accountIds}) and corp_id = #{corpId}") @Select("select business_id from s_user WHERE account_id in (${accountIds}) and corp_id = #{corpId}")
List<String> queryUserIdByAccountId(@Param("accountIds")String accountIds,@Param("corpId") String corpId); List<String> queryUserIdByAccountId(@Param("accountIds")String accountIds,@Param("corpId") String corpId);
/**
* 查询用户点击课程的数量
* @param userId
* @param lessonId
* @param type
* @return
*/
@Select("select count(0) from b_user_lesson_look where user_id = #{userId} and lesson_id = #{lessonId} and type = #{type}")
int getCountByUserAndLesson(@Param("userId") String userId, @Param("lessonId") String lessonId, @Param("type") String type);
/**
* 插入 数据
* @param userId
* @param lessonId
* @param type
* @return
*/
@Insert("insert into b_user_lesson_look VALUES (UUID(),#{userId},#{lessonId},#{type})")
int insertLook(@Param("userId") String userId,@Param("lessonId") String lessonId,@Param("type") String type);
} }
...@@ -283,6 +283,10 @@ public class BLesson extends IdEntity<BLesson> { ...@@ -283,6 +283,10 @@ public class BLesson extends IdEntity<BLesson> {
@ApiModelProperty(value = "学员id集合") @ApiModelProperty(value = "学员id集合")
List<String> personList; List<String> personList;
@Transient
@ApiModelProperty(value = "是不是new(0/1)")
private String isNew;
public void initModel(){ public void initModel(){
// this.setDefaultUrl(global.getDEFAULT_COURSE_LOCATION()); // this.setDefaultUrl(global.getDEFAULT_COURSE_LOCATION());
......
...@@ -301,4 +301,8 @@ public interface BLessonService{ ...@@ -301,4 +301,8 @@ public interface BLessonService{
List<ExamDto> userManageExamByPagination(PageUtil pageUtil, ExamQueryDto dto); List<ExamDto> userManageExamByPagination(PageUtil pageUtil, ExamQueryDto dto);
PersistModel look(CurUser curUser,String lessonId);
PersistModel test();
} }
...@@ -31,6 +31,4 @@ public class PersonValueClientDto { ...@@ -31,6 +31,4 @@ public class PersonValueClientDto {
@ApiModelProperty(value = "积分排序 0正序 1倒序") @ApiModelProperty(value = "积分排序 0正序 1倒序")
public String valueSort; public String valueSort;
} }
...@@ -8,6 +8,7 @@ public enum MessageEnum { ...@@ -8,6 +8,7 @@ public enum MessageEnum {
ZPKC("ZPKC","通知被指派了课程"), ZPKC("ZPKC","通知被指派了课程"),
ZPPX("ZPPX","通知被指派了培训"), ZPPX("ZPPX","通知被指派了培训"),
ZPKS("ZPKS","通知被指派了考试"), ZPKS("ZPKS","通知被指派了考试"),
NEWNOTICE("NEWNOTICE","发布新资源后,显示NEW标识的时间"),
; ;
MessageEnum(String name,String remarks) { MessageEnum(String name,String remarks) {
......
...@@ -6,6 +6,7 @@ import com.itextpdf.text.pdf.PdfCopy; ...@@ -6,6 +6,7 @@ import com.itextpdf.text.pdf.PdfCopy;
import com.itextpdf.text.pdf.PdfImportedPage; import com.itextpdf.text.pdf.PdfImportedPage;
import com.itextpdf.text.pdf.PdfReader; import com.itextpdf.text.pdf.PdfReader;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.rcisoft.core.result.Ret;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.io.File; import java.io.File;
...@@ -23,10 +24,15 @@ import java.util.List; ...@@ -23,10 +24,15 @@ import java.util.List;
@Slf4j @Slf4j
public class CutPdfUtil { public class CutPdfUtil {
public static void main(String[] args) { public static void main(String[] args) {
try { // try {
List<String> pdfList = toCutPdf("F:\\桌面整理\\文件\\测试资料\\06_API常用类.pdf","06_API常用类.pdf", 20); // List<String> pdfList = toCutPdf("F:\\桌面整理\\文件\\测试资料\\06_API常用类.pdf","06_API常用类.pdf", 20);
} catch (Exception e) { // } catch (Exception e) {
e.printStackTrace(); // e.printStackTrace();
// }
List<Long> haveJurisList = new ArrayList<>();
System.out.println(haveJurisList);
if (haveJurisList == null || haveJurisList.size() < 1){
System.out.println(haveJurisList);
} }
} }
......
...@@ -353,6 +353,11 @@ public class SysRoleServiceImpl implements SysRoleService { ...@@ -353,6 +353,11 @@ public class SysRoleServiceImpl implements SysRoleService {
UserUtil.setCurrentPersistOperation(bMessage); UserUtil.setCurrentPersistOperation(bMessage);
bMessage.setRemarks(MessageEnum.ZPKS.getRemarks()); bMessage.setRemarks(MessageEnum.ZPKS.getRemarks());
bMessageList.add(bMessage); bMessageList.add(bMessage);
//数据属于新消息通知 暂时共用message表
bMessage = new BMessage(MessageEnum.NEWNOTICE.getName(),"","",curUser.getCorpId(),7);
UserUtil.setCurrentPersistOperation(bMessage);
bMessage.setRemarks(MessageEnum.NEWNOTICE.getRemarks());
bMessageList.add(bMessage);
return bMessageRepository.insertList(bMessageList); return bMessageRepository.insertList(bMessageList);
} }
......
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