Commit 721e186b authored by luzhuang's avatar luzhuang

Merge remote-tracking branch 'origin/meiteng-2.0' into meiteng-2.0

parents 4ffaf6c3 aba4c612
...@@ -868,10 +868,12 @@ public class BChapterServiceImpl implements BChapterService { ...@@ -868,10 +868,12 @@ public class BChapterServiceImpl implements BChapterService {
String[] lessonIds = ids.split(","); String[] lessonIds = ids.split(",");
String batchUDID = "批量下载打包" + System.currentTimeMillis(); String batchUDID = "批量下载打包" + System.currentTimeMillis();
//遍历每个id //遍历每个id
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
for (String id : lessonIds) { for (String id : lessonIds) {
List<BFile> fileList = bFileRepository.getFileByLessonId(id); List<BFile> fileList = bFileRepository.getFileByLessonId(id);
//batch是zip打包文件夹 bFile.getLessonId()替换形成name //batch是zip打包文件夹 bFile.getLessonId()替换形成name
String filePath = global.getBASE_UPLOAD_SERVER_LOCATION() + global.getCOURSE_LOCATION() + File.separator + batchUDID + File.separator + bLessonRepository.selectByPrimaryKey(id).getLessonName(); BLesson bLesson = bLessonRepository.selectByPrimaryKey(id);
String filePath = global.getBASE_UPLOAD_SERVER_LOCATION() + global.getCOURSE_LOCATION() + File.separator + batchUDID + File.separator + bLesson.getLessonName() + "-" + simpleDateFormat.format(bLesson.getCreateDate());
File file = new File(filePath); File file = new File(filePath);
if (fileList == null || fileList.size() < 1) if (fileList == null || fileList.size() < 1)
continue; continue;
......
package org.rcisoft.business.blabel.dao; package org.rcisoft.business.blabel.dao;
import org.apache.ibatis.annotations.*; import org.apache.ibatis.annotations.*;
import org.rcisoft.business.blabel.dto.QueryLabelResDTO;
import org.rcisoft.business.blabel.entity.BLabel; import org.rcisoft.business.blabel.entity.BLabel;
import org.rcisoft.core.base.BaseMapper; import org.rcisoft.core.base.BaseMapper;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
...@@ -32,4 +33,15 @@ public interface BLabelRepository extends BaseMapper<BLabel> { ...@@ -32,4 +33,15 @@ public interface BLabelRepository extends BaseMapper<BLabel> {
@Update("UPDATE b_label SET del_flag='1' where business_id = #{businessId}") @Update("UPDATE b_label SET del_flag='1' where business_id = #{businessId}")
int removeLabel(@Param("businessId") String id); int removeLabel(@Param("businessId") String id);
/**
* 查询课程push标签
* @return
*/
@Select("<script>" +
" select business_id businessId ,l_name lName " +
" from b_label where del_flag != 1 and flag = 1 " +
" and business_id in " +
"<foreach collection=\"list\" item=\"item\" open=\"(\" separator=\",\" close=\")\" > #{item} </foreach>" +
"</script>")
List<QueryLabelResDTO> queryPushLabel(@Param("list") String[] list);
} }
...@@ -1340,7 +1340,7 @@ public interface BLessonRepository extends BaseMapper<BLesson> { ...@@ -1340,7 +1340,7 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
* @param type * @param type
* @return * @return
*/ */
@Select("select count(0) from b_user_lesson_look where user_id = #{userId} and lesson_id = #{lessonId} and type = #{type}") @Select("select count(0) from b_user_lesson_look where user_id = #{userId} and lesson_id = #{lessonId}")
int getCountByUserAndLesson(@Param("userId") String userId, @Param("lessonId") String lessonId, @Param("type") String type); int getCountByUserAndLesson(@Param("userId") String userId, @Param("lessonId") String lessonId, @Param("type") String type);
/** /**
......
...@@ -168,6 +168,8 @@ public class BLesson extends IdEntity<BLesson> { ...@@ -168,6 +168,8 @@ public class BLesson extends IdEntity<BLesson> {
@Transient @Transient
private String trainType; private String trainType;
@ApiModelProperty(value = "平台推荐自带标签")
private String pushLable;
//------------------------------------- //-------------------------------------
...@@ -292,8 +294,6 @@ public class BLesson extends IdEntity<BLesson> { ...@@ -292,8 +294,6 @@ public class BLesson extends IdEntity<BLesson> {
@ApiModelProperty(value = "数据来源企业") @ApiModelProperty(value = "数据来源企业")
private String fromCorp; private String fromCorp;
@ApiModelProperty(value = "平台推荐自带标签")
private String pushLable;
public void initModel(){ public void initModel(){
......
...@@ -494,6 +494,7 @@ public class BLessonPersonServiceImpl implements BLessonPersonService { ...@@ -494,6 +494,7 @@ public class BLessonPersonServiceImpl implements BLessonPersonService {
for (BLessonPerson b : result) { for (BLessonPerson b : result) {
//step 1 查询look表中是否有对应任何课程的点击记录 //step 1 查询look表中是否有对应任何课程的点击记录
int flag = bLessonRepository.getCountByUserAndLesson(userId, b.getBusinessId(), "0"); int flag = bLessonRepository.getCountByUserAndLesson(userId, b.getBusinessId(), "0");
log.info("-----------addNew------课程查看状态2--" + b.getBusinessId() + "--" + userId + "--" + flag +"---------------");
//step 2 存在则返回,不存在则判断时间 满足条件 setIsNew() flag <= 0 说明此用户未点击过该课程 //step 2 存在则返回,不存在则判断时间 满足条件 setIsNew() flag <= 0 说明此用户未点击过该课程
if (flag <= 0) { if (flag <= 0) {
//获取课程的 指派时间 //获取课程的 指派时间
......
...@@ -16,6 +16,7 @@ import org.rcisoft.business.bfile.dao.BPFileRepository; ...@@ -16,6 +16,7 @@ import org.rcisoft.business.bfile.dao.BPFileRepository;
import org.rcisoft.business.bfile.dao.BTrainFileRepository; import org.rcisoft.business.bfile.dao.BTrainFileRepository;
import org.rcisoft.business.bfile.entity.BFile; import org.rcisoft.business.bfile.entity.BFile;
import org.rcisoft.business.bfile.entity.BTrainFile; import org.rcisoft.business.bfile.entity.BTrainFile;
import org.rcisoft.business.blabel.dao.BLabelRepository;
import org.rcisoft.business.blabel.dto.QueryLabelResDTO; import org.rcisoft.business.blabel.dto.QueryLabelResDTO;
import org.rcisoft.business.blesson.dao.*; import org.rcisoft.business.blesson.dao.*;
import org.rcisoft.business.blesson.dto.*; import org.rcisoft.business.blesson.dto.*;
...@@ -163,6 +164,9 @@ public class BLessonServiceImpl implements BLessonService { ...@@ -163,6 +164,9 @@ public class BLessonServiceImpl implements BLessonService {
@Autowired @Autowired
BFileRepository bFileRepository; BFileRepository bFileRepository;
@Autowired
BLabelRepository bLabelRepository;
@Value("${upload.replaceHttp:false}") @Value("${upload.replaceHttp:false}")
private String replaceHttp; private String replaceHttp;
...@@ -227,7 +231,6 @@ public class BLessonServiceImpl implements BLessonService { ...@@ -227,7 +231,6 @@ public class BLessonServiceImpl implements BLessonService {
if(LessonSycnEnum.OPEN.getCode().equals(flag)) if(LessonSycnEnum.OPEN.getCode().equals(flag))
bLessonRepository.hotNumberReCount2(bLesson.getBusinessId()); bLessonRepository.hotNumberReCount2(bLesson.getBusinessId());
} }
return bLesson; return bLesson;
} }
...@@ -1980,6 +1983,7 @@ public class BLessonServiceImpl implements BLessonService { ...@@ -1980,6 +1983,7 @@ public class BLessonServiceImpl implements BLessonService {
for (BLesson b : result) { for (BLesson b : result) {
//step 1 查询look表中是否有对应任何课程的点击记录 //step 1 查询look表中是否有对应任何课程的点击记录
int flag = bLessonRepository.getCountByUserAndLesson(userId, b.getBusinessId(), "0"); int flag = bLessonRepository.getCountByUserAndLesson(userId, b.getBusinessId(), "0");
log.info("-----------addNew------课程查看状态1--" + b.getBusinessId() + "--" + userId + "--" + flag + "---------------");
//step 2 存在则返回,不存在则判断时间 满足条件 setIsNew() flag <= 0 说明此用户未点击过该课程 //step 2 存在则返回,不存在则判断时间 满足条件 setIsNew() flag <= 0 说明此用户未点击过该课程
if (flag <= 0) { if (flag <= 0) {
//获取课程的 发布时间 //获取课程的 发布时间
......
...@@ -96,6 +96,7 @@ ...@@ -96,6 +96,7 @@
<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="is_trans" jdbcType="VARCHAR" property="isTrans"/>
<result column="push_lable" jdbcType="VARCHAR" property="pushLable"/>
<collection property="labelList" ofType="org.rcisoft.business.blabel.dto.QueryLabelResDTO" <collection property="labelList" ofType="org.rcisoft.business.blabel.dto.QueryLabelResDTO"
......
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