Commit 7cbbb40c authored by zhangqingle's avatar zhangqingle

修改BUG

parent ac029a8f
...@@ -153,76 +153,16 @@ public class BChapterController extends PaginationController<BChapter> { ...@@ -153,76 +153,16 @@ public class BChapterController extends PaginationController<BChapter> {
MessageConstant.MESSAGE_ALERT_ERROR, MessageConstant.MESSAGE_ALERT_ERROR,
newFileUrl); newFileUrl);
} }
// @RequestMapping(value = "/downloadFile", method = RequestMethod.GET)
// public ResponseEntity<InputStreamResource> downloadFile(BFile bfile)
// throws IOException {
// log.debug("----------df1----------");
// String filePath = bChapterService.getDownLoadUrl(bfile);
// log.debug("----------df2----------");
// FileSystemResource file = new FileSystemResource(filePath);
// log.debug("----------df3----------");
// HttpHeaders headers = new HttpHeaders();
// log.debug("----------df4----------");
// headers.add("Cache-Control", "no-cache, no-store, must-revalidate");
// headers.add("Content-Disposition", String.format("attachment; filename=\"%s\"", file.getFilename()));
// headers.add("Pragma", "no-cache");
// headers.add("Expires", "0");
// log.debug("----------df5----------");
// return ResponseEntity
// .ok()
// .headers(headers)
// .contentLength(file.contentLength())
// .contentType(MediaType.parseMediaType("application/octet-stream"))
// .body(new InputStreamResource(file.getInputStream()));
// }
//
// //文件下载相关代码
// @RequestMapping("/download")
// public void downloadFile(BFile bfile, HttpServletResponse response) {
// String filePath = bChapterService.getDownLoadUrl(bfile);
// File file = new File(filePath);
// if (StringUtils.isNotEmpty(file.getName())) {
// //设置文件路径
// if (file.exists()) {
// log.debug("------------------test1------------------");
// // response.setContentType("application/force-download");
//// response.setContentType("multipart/form-data");
//
// response.setContentType("application/octet-stream;charset=utf-8");
//// response.setHeader("content-type", "application/octet-stream");
// String asd = file.getName();
// //response.setHeader("Content-Disposition", "attachment;fileName=" + file.getName());// 设置文件名
// response.setHeader("Content-Disposition", "attachment; filename=\"" + file.getName() + "\"; filename*=utf-8''" + file.getName());
//
// log.debug("------------------test2------------------");
// byte[] buffer = new byte[2048];
// FileInputStream fis = null;
// log.debug("------------------test3------------------");
// try {
// fis = new FileInputStream(file);
// OutputStream out = new BufferedOutputStream(response.getOutputStream());
// int b = 0;
// while ((b = fis.read(buffer)) != -1) {
// out.write(buffer, 0, b); //4.写到输出流(out)中
// }
// out.flush();
// out.close();
// } catch (Exception e) {
// e.printStackTrace();
// } finally {
// if (fis != null) {
// try {
// fis.close();
// } catch (IOException e) {
// e.printStackTrace();
// }
// }
//
// }
// }
// }
// }
// @ApiOperation(value = "209 查询章节带进度(外部分享)", notes = "查询章节带进度(外部分享)", response = QueryChapterListResDTO.class)
// @GetMapping(value = "/queryShareBChaptersWithProgress")
// public Result queryShareBChaptersWithProgress(CurUser curUser, @RequestParam String lessonId, BindingResult br) {
// Map<String, Object> map = new HashedMap();
// return Result.builder(new PersistModel(1),
// MessageConstant.MESSAGE_ALERT_SUCCESS,
// MessageConstant.MESSAGE_ALERT_ERROR,
// bChapterService.queryBChaptersWithProgress(lessonId,curUser));
// }
// //
......
...@@ -57,7 +57,8 @@ public interface BChapterRepository extends BaseMapper<BChapter> { ...@@ -57,7 +57,8 @@ public interface BChapterRepository extends BaseMapper<BChapter> {
"\tAND bc.pid = - 1 \n" + "\tAND bc.pid = - 1 \n" +
"\tAND bc.lesson_id = #{lessonId}\n" + "\tAND bc.lesson_id = #{lessonId}\n" +
"\t\n" + "\t\n" +
"\tAND bc.corp_id = #{corpId}\n" + " <if test=\"corpId !=null and corpId != ''\">and bc.corp_id = #{corpId}</if>" +
// "\tAND bc.corp_id = #{corpId}\n" +
"\t\n" + "\t\n" +
"ORDER BY\n" + "ORDER BY\n" +
"\tsort ASC</script>") "\tsort ASC</script>")
......
...@@ -178,7 +178,7 @@ public class BChapterServiceImpl implements BChapterService { ...@@ -178,7 +178,7 @@ public class BChapterServiceImpl implements BChapterService {
mtUserGetsReqDTOlecDept.setCorpId(curUser.getCorpId()); mtUserGetsReqDTOlecDept.setCorpId(curUser.getCorpId());
mtUserGetsReqDTOlecDept.setIds(lecturerIds); mtUserGetsReqDTOlecDept.setIds(lecturerIds);
List<MTUserInfoRspDTO> mtUserInfoRspDTOLecDeptList = mtCotactApiRequestClient.userGets(mtUserGetsReqDTOlecDept); List<MTUserInfoRspDTO> mtUserInfoRspDTOLecDeptList = mtCotactApiRequestClient.userGets(mtUserGetsReqDTOlecDept);
if (mtUserInfoRspDTOLecDeptList != null && mtUserInfoRspDTOList.size() > 0){ if (mtUserInfoRspDTOLecDeptList != null && mtUserInfoRspDTOLecDeptList.size() > 0){
mtUserInfoRspDTOLecDeptList.forEach(mtUserInfoRspDTO -> { mtUserInfoRspDTOLecDeptList.forEach(mtUserInfoRspDTO -> {
if (mtUserInfoRspDTO.getDepts() != null && mtUserInfoRspDTO.getDepts().size() > 0 && mtUserInfoRspDTO.getId().equals(bLesson.getLecturerId())){ if (mtUserInfoRspDTO.getDepts() != null && mtUserInfoRspDTO.getDepts().size() > 0 && mtUserInfoRspDTO.getId().equals(bLesson.getLecturerId())){
//设置部门名 //设置部门名
......
...@@ -352,6 +352,9 @@ public interface BLessonPersonRepository extends BaseMapper<BLessonPerson> { ...@@ -352,6 +352,9 @@ public interface BLessonPersonRepository extends BaseMapper<BLessonPerson> {
@Select("<script> select blp.business_id businessId," + @Select("<script> select blp.business_id businessId," +
" bl.lesson_name LessonTitle , " + " bl.lesson_name LessonTitle , " +
" bl.class_hour classHour , " + " bl.class_hour classHour , " +
" bl.train_start_date trainStartDate , " +
" bl.train_over_date trainOverDate , " +
" bl.train_sign_time trainSignTime , " +
" blp.is_appoint isAppoint , " + " blp.is_appoint isAppoint , " +
" blp.is_finish isFinish , " + " blp.is_finish isFinish , " +
" blp.learn_progress learnProgress , " + " blp.learn_progress learnProgress , " +
...@@ -395,8 +398,8 @@ public interface BLessonPersonRepository extends BaseMapper<BLessonPerson> { ...@@ -395,8 +398,8 @@ public interface BLessonPersonRepository extends BaseMapper<BLessonPerson> {
"<if test= \" param.appointDateSort !=null and param.appointDateSort !='' and param.appointDateSort =='1'.toString()\"> ORDER BY appointDate ASC </if> "+ "<if test= \" param.appointDateSort !=null and param.appointDateSort !='' and param.appointDateSort =='1'.toString()\"> ORDER BY appointDate ASC </if> "+
"<if test= \" param.finishDateSort !=null and param.finishDateSort !='' and param.finishDateSort =='0'.toString()\"> ORDER BY blp.finish_date DESC </if> "+ "<if test= \" param.finishDateSort !=null and param.finishDateSort !='' and param.finishDateSort =='0'.toString()\"> ORDER BY blp.finish_date DESC </if> "+
"<if test= \" param.finishDateSort !=null and param.finishDateSort !='' and param.finishDateSort =='1'.toString()\"> ORDER BY blp.finish_date ASC </if> "+ "<if test= \" param.finishDateSort !=null and param.finishDateSort !='' and param.finishDateSort =='1'.toString()\"> ORDER BY blp.finish_date ASC </if> "+
"<if test= \" param.applyDateSort !=null and param.applyDateSort !='' and param.applyDateSort =='0'.toString()\"> ORDER BY appointDate DESC </if> "+ "<if test= \" param.applyDateSort !=null and param.applyDateSort !='' and param.applyDateSort =='0'.toString()\"> ORDER BY applyDate DESC </if> "+
"<if test= \" param.applyDateSort !=null and param.applyDateSort !='' and param.applyDateSort =='1'.toString()\"> ORDER BY appointDate ASC </if> "+ "<if test= \" param.applyDateSort !=null and param.applyDateSort !='' and param.applyDateSort =='1'.toString()\"> ORDER BY applyDate ASC </if> "+
"<if test= \" param.signDateSort !=null and param.signDateSort !='' and param.signDateSort =='0'.toString()\"> ORDER BY blp.sign_date DESC </if> "+ "<if test= \" param.signDateSort !=null and param.signDateSort !='' and param.signDateSort =='0'.toString()\"> ORDER BY blp.sign_date DESC </if> "+
"<if test= \" param.signDateSort !=null and param.signDateSort !='' and param.signDateSort =='1'.toString()\"> ORDER BY blp.sign_date ASC </if> "+ "<if test= \" param.signDateSort !=null and param.signDateSort !='' and param.signDateSort =='1'.toString()\"> ORDER BY blp.sign_date ASC </if> "+
"<if test= \" param.learnProgressSort !=null and param.learnProgressSort !='' and param.learnProgressSort =='0'.toString()\"> ORDER BY CAST(learnProgress AS UNSIGNED) DESC </if> "+ "<if test= \" param.learnProgressSort !=null and param.learnProgressSort !='' and param.learnProgressSort =='0'.toString()\"> ORDER BY CAST(learnProgress AS UNSIGNED) DESC </if> "+
......
...@@ -51,6 +51,19 @@ public class StudentTrackingRspDTO { ...@@ -51,6 +51,19 @@ public class StudentTrackingRspDTO {
@Transient @Transient
private Date applyDate; private Date applyDate;
@DateTimeFormat(pattern="yyyy/MM/dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy/MM/dd HH:mm:ss")
@ApiModelProperty(value = "培训开始时间")
private Date trainStartDate;
@DateTimeFormat(pattern="yyyy/MM/dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy/MM/dd HH:mm:ss")
@ApiModelProperty(value = "培训结束时间")
private Date trainOverDate;
@ApiModelProperty(value = "培训签到时间(培训开始前 分钟数)")
private String trainSignTime;
@DateTimeFormat(pattern="yyyy/MM/dd HH:mm:ss") @DateTimeFormat(pattern="yyyy/MM/dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy/MM/dd HH:mm:ss") @JsonFormat(timezone = "GMT+8",pattern = "yyyy/MM/dd HH:mm:ss")
@ApiModelProperty(value = "签到日期") @ApiModelProperty(value = "签到日期")
......
...@@ -151,8 +151,6 @@ public class BLesson extends IdEntity<BLesson> { ...@@ -151,8 +151,6 @@ public class BLesson extends IdEntity<BLesson> {
@Length(min = 1,max = 255,message = "长度最小为1,最大为255") @Length(min = 1,max = 255,message = "长度最小为1,最大为255")
private String trainAddress; private String trainAddress;
@DateTimeFormat(pattern="yyyy/MM/dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy/MM/dd HH:mm:ss")
@ApiModelProperty(value = "培训签到时间(培训开始前 分钟数)") @ApiModelProperty(value = "培训签到时间(培训开始前 分钟数)")
@Length(min = 1,max = 15,message = "长度最小为1,最大为15") @Length(min = 1,max = 15,message = "长度最小为1,最大为15")
private String trainSignTime; private String trainSignTime;
......
...@@ -1377,7 +1377,21 @@ public class BLessonServiceImpl implements BLessonService { ...@@ -1377,7 +1377,21 @@ public class BLessonServiceImpl implements BLessonService {
trainTypeSelStr = "and now() > bl.train_over_date"; trainTypeSelStr = "and now() > bl.train_over_date";
} }
return bLessonPersonRepository.userManageLesson(userLessonDTO,trainTypeSelStr); List<StudentTrackingRspDTO> studentTrackingRspDTOList = bLessonPersonRepository.userManageLesson(userLessonDTO,trainTypeSelStr);
Date now = new Date();
studentTrackingRspDTOList.forEach(studentTrackingRspDTO -> {
Long time = Long.parseLong(studentTrackingRspDTO.getTrainSignTime()) * 60 * 1000;
Date signStart = new Date(studentTrackingRspDTO.getTrainStartDate().getTime() - time);
if (now.before(signStart)){
studentTrackingRspDTO.setTrainType("0");
}else if (studentTrackingRspDTO.getTrainOverDate().before(now)){
studentTrackingRspDTO.setTrainType("2");
}else{
studentTrackingRspDTO.setTrainType("1");
}
});
return studentTrackingRspDTOList;
} }
@Override @Override
......
...@@ -35,7 +35,7 @@ public interface BRStudentChapterRepository extends BaseMapper<BRStudentChapter> ...@@ -35,7 +35,7 @@ public interface BRStudentChapterRepository extends BaseMapper<BRStudentChapter>
*/ */
@Select("<script>select * from b_r_student_chapter brsc where 1=1 " @Select("<script>select * from b_r_student_chapter brsc where 1=1 "
+ "<if test=\"chapterId !=null and chapterId != '' \">and brsc.chapter_id = #{chapterId} </if> " + "<if test=\"chapterId !=null and chapterId != '' \">and brsc.chapter_id = #{chapterId} </if> "
+ "<if test=\"studentId !=null and studentId != '' \">and brsc.student_id = #{studentId} </if> " + "and brsc.student_id = #{studentId} "
+ "</script>") + "</script>")
@ResultMap(value = "BRStudentChapterResultMap" ) @ResultMap(value = "BRStudentChapterResultMap" )
List<BRStudentChapter> queryByStuIdAndChapter(@Param("chapterId") String chapterId,@Param("studentId") String studentId); List<BRStudentChapter> queryByStuIdAndChapter(@Param("chapterId") String chapterId,@Param("studentId") String studentId);
......
...@@ -45,7 +45,7 @@ public class CurUserAspect { ...@@ -45,7 +45,7 @@ public class CurUserAspect {
* 获取当前登陆人 * 获取当前登陆人
* @param joinPoint * @param joinPoint
*/ */
@Before("execution(* org.rcisoft..*.controller.*.*(..))") @Before("execution(* org.rcisoft..*.controller.*.*(..) ) ")
public void beforeInsert(JoinPoint joinPoint) throws ParseException { public void beforeInsert(JoinPoint joinPoint) throws ParseException {
if (joinPoint.getArgs().length < 2) if (joinPoint.getArgs().length < 2)
return; return;
...@@ -64,8 +64,13 @@ public class CurUserAspect { ...@@ -64,8 +64,13 @@ public class CurUserAspect {
//非法权限 //非法权限
log.debug("uid:\t" + curUser.getUserId() + "\t corpId:\t" + curUser.getCorpId() + "\t operate" log.debug("uid:\t" + curUser.getUserId() + "\t corpId:\t" + curUser.getCorpId() + "\t operate"
+ methodSignature.getName()); + methodSignature.getName());
//如果为外部分享 直接返回
if (StringUtils.isEmpty(curUser.getIsExternalShare()) && "1".equals(curUser.getIsExternalShare()) ){
return;
}
if(StringUtils.isEmpty(curUser.getUserId()) || StringUtils.isEmpty(curUser.getCorpId())) if(StringUtils.isEmpty(curUser.getUserId()) || StringUtils.isEmpty(curUser.getCorpId()))
throw new ServiceException(ResultExceptionEnum.USER_NO_AUTHEN); throw new ServiceException(ResultExceptionEnum.USER_NO_AUTHEN);
UserUtil.setCurUser(curUser); UserUtil.setCurUser(curUser);
//多线程判断是否有管理员 //多线程判断是否有管理员
......
package org.rcisoft.core.task;
//通知定时任务
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
@Component
@Slf4j
public class messageTask {
@Scheduled(cron = "0 0/1 * * * ?")
@Transactional(propagation = Propagation.REQUIRED, readOnly = false)
public void work() throws Exception {
//判断是否开启
//判断是否在设定时间内
//在时间内发送通知
}
}
...@@ -318,31 +318,31 @@ public class SysRoleServiceImpl implements SysRoleService { ...@@ -318,31 +318,31 @@ public class SysRoleServiceImpl implements SysRoleService {
@Transactional(propagation = Propagation.REQUIRED,isolation = Isolation.DEFAULT) @Transactional(propagation = Propagation.REQUIRED,isolation = Isolation.DEFAULT)
public int initBMessage(CurUser curUser) { public int initBMessage(CurUser curUser) {
List<BMessage> bMessageList = new ArrayList<>(); List<BMessage> bMessageList = new ArrayList<>();
BMessage bMessage = new BMessage("","0","1",curUser.getCorpId(),0); BMessage bMessage = new BMessage("PXJJKS","0","1",curUser.getCorpId(),0);
UserUtil.setCurrentPersistOperation(bMessage); UserUtil.setCurrentPersistOperation(bMessage);
bMessage.setRemarks("通知已报名人员线下培训即将开始"); bMessage.setRemarks("通知已报名人员线下培训即将开始");
bMessageList.add(bMessage); bMessageList.add(bMessage);
bMessage = new BMessage("","0","1",curUser.getCorpId(),1); bMessage = new BMessage("KSJJJS","0","1",curUser.getCorpId(),1);
UserUtil.setCurrentPersistOperation(bMessage); UserUtil.setCurrentPersistOperation(bMessage);
bMessage.setRemarks("通知参考人员在线考试即将结束"); bMessage.setRemarks("通知参考人员在线考试即将结束");
bMessageList.add(bMessage); bMessageList.add(bMessage);
bMessage = new BMessage("","","",curUser.getCorpId(),2); bMessage = new BMessage("FBPL","","",curUser.getCorpId(),2);
UserUtil.setCurrentPersistOperation(bMessage); UserUtil.setCurrentPersistOperation(bMessage);
bMessage.setRemarks("通知讲师有人对其主讲的课程或培训发表了评论"); bMessage.setRemarks("通知讲师有人对其主讲的课程或培训发表了评论");
bMessageList.add(bMessage); bMessageList.add(bMessage);
bMessage = new BMessage("","","",curUser.getCorpId(),3); bMessage = new BMessage("HFPL","","",curUser.getCorpId(),3);
UserUtil.setCurrentPersistOperation(bMessage); UserUtil.setCurrentPersistOperation(bMessage);
bMessage.setRemarks("通知评论发表人有人回复了该评论"); bMessage.setRemarks("通知评论发表人有人回复了该评论");
bMessageList.add(bMessage); bMessageList.add(bMessage);
bMessage = new BMessage("","","",curUser.getCorpId(),4); bMessage = new BMessage("ZPKC","","",curUser.getCorpId(),4);
UserUtil.setCurrentPersistOperation(bMessage); UserUtil.setCurrentPersistOperation(bMessage);
bMessage.setRemarks("通知被指派了课程"); bMessage.setRemarks("通知被指派了课程");
bMessageList.add(bMessage); bMessageList.add(bMessage);
bMessage = new BMessage("","","",curUser.getCorpId(),5); bMessage = new BMessage("ZPPX","","",curUser.getCorpId(),5);
UserUtil.setCurrentPersistOperation(bMessage); UserUtil.setCurrentPersistOperation(bMessage);
bMessage.setRemarks("通知被指派了培训"); bMessage.setRemarks("通知被指派了培训");
bMessageList.add(bMessage); bMessageList.add(bMessage);
bMessage = new BMessage("","","",curUser.getCorpId(),6); bMessage = new BMessage("ZPKS","","",curUser.getCorpId(),6);
UserUtil.setCurrentPersistOperation(bMessage); UserUtil.setCurrentPersistOperation(bMessage);
bMessage.setRemarks("通知被指派了考试"); bMessage.setRemarks("通知被指派了考试");
bMessageList.add(bMessage); bMessageList.add(bMessage);
......
...@@ -24,7 +24,11 @@ public class CurUser { ...@@ -24,7 +24,11 @@ public class CurUser {
@ApiModelProperty(value = "用户id") @ApiModelProperty(value = "用户id")
private String userId; private String userId;
@ApiModelProperty(value = "外部分享 1外部分享")
private String isExternalShare;
@ApiModelProperty(required = false,value = "请求id,不需要传递") @ApiModelProperty(required = false,value = "请求id,不需要传递")
private String requireId; private String requireId;
} }
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