Commit 2ada45dd authored by luzhuang's avatar luzhuang

feat: 课程、章节 修改日志记录

parent 9b88068b
...@@ -199,7 +199,8 @@ public class BChapterController extends PaginationController<BChapter> { ...@@ -199,7 +199,8 @@ public class BChapterController extends PaginationController<BChapter> {
@ApiImplicitParam(name = "ids", value = "课程ids(用英文逗号隔开)", required = true, dataType = "varchar") @ApiImplicitParam(name = "ids", value = "课程ids(用英文逗号隔开)", required = true, dataType = "varchar")
@PostMapping("/getBatchsDownload") @PostMapping("/getBatchsDownload")
public Result getBatchsDownload(CurUser curUser,@RequestParam String ids, BindingResult br) throws IOException { public Result getBatchsDownload(CurUser curUser,@RequestParam String ids, BindingResult br) throws IOException {
String newFileUrl = bChapterService.getBatchsDownload(ids); // String newFileUrl = bChapterService.getBatchsDownload(ids);
String newFileUrl = "http://192.168.5.54/eduServer/course/zip/6d454523b48d4885a6e2bee4a2bcd967.zip";
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,
......
...@@ -22,12 +22,17 @@ import org.rcisoft.business.bfile.entity.BFile; ...@@ -22,12 +22,17 @@ import org.rcisoft.business.bfile.entity.BFile;
import org.rcisoft.business.blesson.entity.BLessonPerson; import org.rcisoft.business.blesson.entity.BLessonPerson;
import org.rcisoft.business.blesson.entity.BViewrange; import org.rcisoft.business.blesson.entity.BViewrange;
import org.rcisoft.business.blesson.enums.IsFinishEnum; import org.rcisoft.business.blesson.enums.IsFinishEnum;
import org.rcisoft.business.blesson.enums.LessonSycnEnum;
import org.rcisoft.business.blesson.enums.LessonTypeEnum;
import org.rcisoft.business.blesson.enums.ReleaseStateEnum; import org.rcisoft.business.blesson.enums.ReleaseStateEnum;
import org.rcisoft.business.blesson.service.BLessonService; import org.rcisoft.business.blesson.service.BLessonService;
import org.rcisoft.business.blesson.service.impl.BLessonServiceImpl; import org.rcisoft.business.blesson.service.impl.BLessonServiceImpl;
import org.rcisoft.business.blesson.util.QueryDepart; import org.rcisoft.business.blesson.util.QueryDepart;
import org.rcisoft.business.blessonlog.dao.BLessonLogRepository;
import org.rcisoft.business.blessonlog.entity.BLessonLog;
import org.rcisoft.business.bmaterial.dao.BMaterialRepository; import org.rcisoft.business.bmaterial.dao.BMaterialRepository;
import org.rcisoft.business.bmaterial.entity.BMaterial; import org.rcisoft.business.bmaterial.entity.BMaterial;
import org.rcisoft.business.bmessage.dao.BMessageRepository;
import org.rcisoft.business.bpersonvalue.entity.BPersonValue; import org.rcisoft.business.bpersonvalue.entity.BPersonValue;
import org.rcisoft.business.brstudentchapter.dao.BRStudentChapterRepository; import org.rcisoft.business.brstudentchapter.dao.BRStudentChapterRepository;
import org.rcisoft.business.brstudentchapter.entity.BRStudentChapter; import org.rcisoft.business.brstudentchapter.entity.BRStudentChapter;
...@@ -99,6 +104,10 @@ public class BChapterServiceImpl implements BChapterService { ...@@ -99,6 +104,10 @@ public class BChapterServiceImpl implements BChapterService {
OfficeToPdf officeToPdf; OfficeToPdf officeToPdf;
@Autowired @Autowired
BLessonServiceImpl bLessonServiceImpl; BLessonServiceImpl bLessonServiceImpl;
@Autowired
BMessageRepository bMessageRepository;
@Autowired
BLessonLogRepository bLessonLogRepository;
@Autowired @Autowired
BViewrangeRepository bViewrangeRepository; BViewrangeRepository bViewrangeRepository;
...@@ -567,7 +576,12 @@ public class BChapterServiceImpl implements BChapterService { ...@@ -567,7 +576,12 @@ public class BChapterServiceImpl implements BChapterService {
bMaterial.setFileSize(dto.getFileSize()); bMaterial.setFileSize(dto.getFileSize());
bMaterialRepository.insertMaterial(bMaterial); bMaterialRepository.insertMaterial(bMaterial);
} }
//查询 当前资源共享状态
String flag = bMessageRepository.getSycnValue(model.getCorpId());
//开启共享状态 编辑课程时 添加日志
if(LessonSycnEnum.OPEN.getCode().equals(flag)){
bLessonLogRepository.insertSelective(BLessonLog.generate("编辑章节",model.getBusinessId()));
}
return new PersistModel(line); return new PersistModel(line);
} }
...@@ -726,6 +740,13 @@ public class BChapterServiceImpl implements BChapterService { ...@@ -726,6 +740,13 @@ public class BChapterServiceImpl implements BChapterService {
//删除student_chapter表中数据 //删除student_chapter表中数据
bChapterRepository.deleteBStudentChapter(id, curUser.getUserId()); bChapterRepository.deleteBStudentChapter(id, curUser.getUserId());
//查询 当前资源共享状态
String flag = bMessageRepository.getSycnValue(curUser.getCorpId());
//开启共享状态 编辑课程时 添加日志
if(LessonSycnEnum.OPEN.getCode().equals(flag) ){
bLessonLogRepository.insertSelective(BLessonLog.generate("删除章节",oldId));
}
return new PersistModel(line); return new PersistModel(line);
} }
......
...@@ -1273,31 +1273,21 @@ public interface BLessonRepository extends BaseMapper<BLesson> { ...@@ -1273,31 +1273,21 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
* 查询平台推荐 * 查询平台推荐
* @return * @return
*/ */
@Select(" <script> select distinct bl.* " + @Select(" <script>select distinct bl.* " +
" ,su.name lecturerName " + " ,su.name lecturerName " +
" ,suc.name createByName " + " ,suc.name createByName " +
" from b_lesson bl " + " from b_lesson bl " +
" left join s_user su on su.business_id = bl.lecturer_id " + " right join b_lesson_corp blc on blc.lesson_id = bl.business_id and bl.corp_id = '###' " +
// " and su.del_flag != 1 and su.flag = 1 " + " left join s_user su on su.business_id = bl.lecturer_id " +
" and su.corp_id = '6' " +
" and su.corp_id = #{curUser.corpId} "+ " left join s_user suc on suc.business_id = bl.create_by " +
" and suc.corp_id = '6' " +
" left join s_user suc on suc.business_id = bl.create_by " + " left join b_viewrange bv on bl.business_id = bv.lesson_id " +
// " and suc.del_flag != 1 and suc.flag = 1 " + " and bv.del_flag != 1 and bv.flag = 1 " +
" and bv.corp_id = '6' " +
" and suc.corp_id = #{curUser.corpId} "+ " left join b_viewrange_son bvs on bv.business_id = bvs.viewrange_id " +
" where bl.del_flag != 1 and bl.flag = 1 " +
" left join b_viewrange bv on bl.business_id = bv.lesson_id " + " and blc.corp_id = '6' " +
" and bv.del_flag != 1 and bv.flag = 1 " +
" and bv.corp_id = #{curUser.corpId} "+
" left join b_viewrange_son bvs on bv.business_id = bvs.viewrange_id " +
// " left join b_course bc on bc.business_id = bl.course_id " +
" where bl.del_flag != 1 and bl.flag = 1 " +
" and bl.corp_id = #{curUser.corpId} "+
" and bl.release_state = 2 " + " and bl.release_state = 2 " +
" and ((bvs.type = 0 and bvs.target_id = #{curUser.userId}) " + " and ((bvs.type = 0 and bvs.target_id = #{curUser.userId}) " +
" or (bl.lecturer_id = #{curUser.userId}) " + " or (bl.lecturer_id = #{curUser.userId}) " +
...@@ -1305,12 +1295,11 @@ public interface BLessonRepository extends BaseMapper<BLesson> { ...@@ -1305,12 +1295,11 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
" or (bvs.type = 1 and bvs.target_id in " + " or (bvs.type = 1 and bvs.target_id in " +
" <foreach item='item' index='index' collection='departs' open='(' separator=',' close=')'> #{item} </foreach>)" + " <foreach item='item' index='index' collection='departs' open='(' separator=',' close=')'> #{item} </foreach>)" +
" </if> " + " </if> " +
" or (bl.business_id not in (select lesson_id from b_viewrange where del_flag != 1 and flag = 1 AND lesson_id IS NOT NULL ))) " + " or (bl.business_id not in (select lesson_id from b_viewrange where del_flag != 1 and flag = 1 AND lesson_id IS NOT NULL ))) " +
" and bl.person_number >= (select `value` from b_dictionary where type = 'ZXRS' and corp_id = #{curUser.corpId}) + 0 " + //ZXRS 在学人数 " order by bl.release_date desc " +
" order by CAST(bl.person_number AS UNSIGNED) desc,bl.release_date desc " +
"</script>") "</script>")
@ResultMap(value = "BasePushResultMap") @ResultMap(value = "BasePushResultMap")
List<BLesson> queryPush(String corpId); List<BLesson> queryPush(@Param("curUser") CurUser curUser, @Param("departs") List<String> departs);
/** /**
* 查询 企业下 lessons * 查询 企业下 lessons
......
...@@ -289,6 +289,9 @@ public class BLesson extends IdEntity<BLesson> { ...@@ -289,6 +289,9 @@ public class BLesson extends IdEntity<BLesson> {
@ApiModelProperty(value = "是否为企业转化(1 转化)") @ApiModelProperty(value = "是否为企业转化(1 转化)")
private String isTrans; private String isTrans;
@ApiModelProperty(value = "数据来源企业")
private String fromCorp;
public void initModel(){ public void initModel(){
// this.setDefaultUrl(global.getDEFAULT_COURSE_LOCATION()); // this.setDefaultUrl(global.getDEFAULT_COURSE_LOCATION());
......
package org.rcisoft.business.blesson.enums;
import lombok.Getter;
@Getter
public enum LessonSycnEnum {
CLOSE("0"),
OPEN("1"),
;
LessonSycnEnum(String code) {
this.code = code;
}
private String code;
}
...@@ -14,6 +14,7 @@ import org.rcisoft.business.blesson.dao.*; ...@@ -14,6 +14,7 @@ import org.rcisoft.business.blesson.dao.*;
import org.rcisoft.business.blesson.dto.*; import org.rcisoft.business.blesson.dto.*;
import org.rcisoft.business.blesson.entity.*; import org.rcisoft.business.blesson.entity.*;
import org.rcisoft.business.blesson.enums.IsApplyEnum; import org.rcisoft.business.blesson.enums.IsApplyEnum;
import org.rcisoft.business.blesson.enums.LessonSycnEnum;
import org.rcisoft.business.blesson.enums.LessonTypeEnum; import org.rcisoft.business.blesson.enums.LessonTypeEnum;
import org.rcisoft.business.blesson.enums.ReleaseStateEnum; import org.rcisoft.business.blesson.enums.ReleaseStateEnum;
import org.rcisoft.business.blesson.service.BLessonService; import org.rcisoft.business.blesson.service.BLessonService;
...@@ -22,6 +23,8 @@ import org.rcisoft.business.blesson.util.LessonSyncUtil; ...@@ -22,6 +23,8 @@ import org.rcisoft.business.blesson.util.LessonSyncUtil;
import org.rcisoft.business.blesson.util.QueryDepart; import org.rcisoft.business.blesson.util.QueryDepart;
import org.rcisoft.business.blesson.util.Recursion; import org.rcisoft.business.blesson.util.Recursion;
import org.rcisoft.business.blesson.dao.BViewrangeRepository; import org.rcisoft.business.blesson.dao.BViewrangeRepository;
import org.rcisoft.business.blessonlog.dao.BLessonLogRepository;
import org.rcisoft.business.blessonlog.entity.BLessonLog;
import org.rcisoft.business.bmaterial.dao.BMaterialRepository; import org.rcisoft.business.bmaterial.dao.BMaterialRepository;
import org.rcisoft.business.bmaterial.entity.BMaterial; import org.rcisoft.business.bmaterial.entity.BMaterial;
import org.rcisoft.business.bmessage.dao.BMessageRepository; import org.rcisoft.business.bmessage.dao.BMessageRepository;
...@@ -134,6 +137,9 @@ public class BLessonServiceImpl implements BLessonService { ...@@ -134,6 +137,9 @@ public class BLessonServiceImpl implements BLessonService {
@Autowired @Autowired
BMessageRepository bMessageRepository; BMessageRepository bMessageRepository;
@Autowired
BLessonLogRepository bLessonLogRepository;
@Autowired @Autowired
SendNoticeService sendNoticeService; SendNoticeService sendNoticeService;
...@@ -259,21 +265,7 @@ public class BLessonServiceImpl implements BLessonService { ...@@ -259,21 +265,7 @@ public class BLessonServiceImpl implements BLessonService {
departs.removeAll(Collections.singleton(null)); departs.removeAll(Collections.singleton(null));
departs.removeAll(Collections.singleton("")); departs.removeAll(Collections.singleton(""));
} }
List<BLesson> result = bLessonRepository.queryPersonMore(curUser, departs); List<BLesson> result = bLessonRepository.queryPush(curUser, departs);
return addNew(result);
}
public List<BLesson> queryPush(String corpId) {
List<BLesson> result = bLessonRepository.queryPush(corpId);
for (BLesson b : result){
String pushLable = bLessonRepository.getPushLable(b.getBusinessId());
if( StringUtils.isEmpty(pushLable)){
b.setLabelList(bLessonRepository.queryLabelByLessonId(b.getBusinessId()));
}else {
b.setLabelList(bLessonRepository.queryPushLabelByLessonId(pushLable,b.getBusinessId()));
}
}
return addNew(result); return addNew(result);
} }
...@@ -425,6 +417,12 @@ public class BLessonServiceImpl implements BLessonService { ...@@ -425,6 +417,12 @@ public class BLessonServiceImpl implements BLessonService {
} }
} else { } else {
UserUtil.setCurrentMergeOperation(model); UserUtil.setCurrentMergeOperation(model);
//查询 当前资源共享状态
String flag = bMessageRepository.getSycnValue(model.getCorpId());
//开启共享状态 编辑课程时 添加日志
if(LessonSycnEnum.OPEN.getCode().equals(flag) && LessonTypeEnum.LESSON.getCode().equals(model.getLessonType())){
bLessonLogRepository.insertSelective(BLessonLog.generate("编辑课程",model.getBusinessId()));
}
line = bLessonRepository.updateByPrimaryKeySelective(model); line = bLessonRepository.updateByPrimaryKeySelective(model);
//若培训结束时间改变 修改学生签到状态 //若培训结束时间改变 修改学生签到状态
//查询课程信息 //查询课程信息
...@@ -1129,7 +1127,7 @@ public class BLessonServiceImpl implements BLessonService { ...@@ -1129,7 +1127,7 @@ public class BLessonServiceImpl implements BLessonService {
ListAllLesson = bLessonRepository.queryInterestedListByPagination(model); ListAllLesson = bLessonRepository.queryInterestedListByPagination(model);
break; break;
case "5": case "5":
ListAllLesson = this.queryPush(model.getCorpId()); // ListAllLesson = this.queryPush(model);
break; break;
default: default:
throw new ServiceException(ResultServiceEnums.INVALID_PARAMETER_VALUE); throw new ServiceException(ResultServiceEnums.INVALID_PARAMETER_VALUE);
......
...@@ -53,5 +53,13 @@ public interface BMessageRepository extends BaseMapper<BMessage> { ...@@ -53,5 +53,13 @@ public interface BMessageRepository extends BaseMapper<BMessage> {
+ "</script>") + "</script>")
@ResultMap(value = "BaseResultMap" ) @ResultMap(value = "BaseResultMap" )
List<BMessage> queryByNameAndCorp(@Param("name") String name, @Param("corpId") String corpId); List<BMessage> queryByNameAndCorp(@Param("name") String name, @Param("corpId") String corpId);
/**
* 查询 资源共享同步 的状态
* @param corpId
* @return
*/
@Select("select time_value from b_message where 1=1 and del_flag != 1 and flag = 1 and `name`= 'SHARE' and corp_id = #{corpId}")
String getSycnValue(String corpId);
} }
...@@ -53,7 +53,4 @@ public class FeignConfig { ...@@ -53,7 +53,4 @@ public class FeignConfig {
return new SpringEncoder(objectFactory); return new SpringEncoder(objectFactory);
} }
} }
...@@ -42,6 +42,9 @@ ...@@ -42,6 +42,9 @@
<result column="value_consume" jdbcType="VARCHAR" property="valueConsume"/> <result column="value_consume" jdbcType="VARCHAR" property="valueConsume"/>
<result column="value_gain" jdbcType="VARCHAR" property="valueGain"/> <result column="value_gain" jdbcType="VARCHAR" property="valueGain"/>
<result column="value_update_date" jdbcType="TIMESTAMP" property="valueUpdateDate"/> <result column="value_update_date" jdbcType="TIMESTAMP" property="valueUpdateDate"/>
<result column="is_trans" jdbcType="VARCHAR" property="isTrans"/>
<result column="from_corp" jdbcType="VARCHAR" property="fromCorp"/>
<!----> <!---->
<collection property="labelList" ofType="org.rcisoft.business.blabel.dto.QueryLabelResDTO" <collection property="labelList" ofType="org.rcisoft.business.blabel.dto.QueryLabelResDTO"
javaType="java.util.ArrayList" select="org.rcisoft.business.blesson.dao.BLessonRepository.queryLabelByLessonId" javaType="java.util.ArrayList" select="org.rcisoft.business.blesson.dao.BLessonRepository.queryLabelByLessonId"
......
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