Commit 3740f15b authored by zhangqingle's avatar zhangqingle

修改接口

parent 357a8386
......@@ -439,7 +439,7 @@
<build>
<finalName>edu</finalName>
<finalName>zx-education-1.0.0</finalName>
<resources>
<resource>
<directory>src/main/resources</directory>
......
......@@ -389,14 +389,16 @@ public class BChapterServiceImpl implements BChapterService {
double newLearnProgress = Double.parseDouble(numberFormat.format((float) (learnProgress * Integer.parseInt(bLesson.getClassHour()) - studentChapter.getProgress()) / Float.parseFloat(bLesson.getClassHour())));
if (newLearnProgress == 0) {
lessonPerson.setIsFinish("0");
lessonPerson.setFinishDate(null);
// lessonPerson.setFinishDate(null);
lessonPerson.setFinishDateSetNull("1");
}
if (0 < newLearnProgress && newLearnProgress < 1) {
lessonPerson.setIsFinish("1");
lessonPerson.setFinishDate(null);
// lessonPerson.setFinishDate(null);
lessonPerson.setFinishDateSetNull("1");
}
lessonPerson.setLearnProgress(newLearnProgress * 100 + "%");
bLessonPersonRepository.updateByPrimaryKeySelective(lessonPerson);
bLessonPersonRepository.updateAtChapter(lessonPerson);
studentChapter.setProgress(0);
studentChapter.setCurrentLocation(0);
brStudentChapterRepository.updateById(studentChapter);
......@@ -454,14 +456,16 @@ public class BChapterServiceImpl implements BChapterService {
}
if (0 == Double.parseDouble(newLearnProgress)){
lessonPerson.setIsFinish("0");
lessonPerson.setFinishDate(null);
// lessonPerson.setFinishDate(null);
lessonPerson.setFinishDateSetNull("1");
}else {
if (learnProgress > 0 && Double.parseDouble(newLearnProgress) < 0.01) {
newLearnProgress = "0.01";
}
if ("2".equals(lessonPerson.getIsFinish()) && Double.parseDouble(newLearnProgress) < 1) {
lessonPerson.setIsFinish("1");
lessonPerson.setFinishDate(null);
// lessonPerson.setFinishDate(null);
lessonPerson.setFinishDateSetNull("1");
}
if (Double.parseDouble(newLearnProgress) >= 1) {
newLearnProgress = "1";
......@@ -478,7 +482,7 @@ public class BChapterServiceImpl implements BChapterService {
lessonPerson.setLearnProgress(Float.parseFloat(newLearnProgress)*100+"%");
bLessonPersonRepository.updateByPrimaryKeySelective(lessonPerson);
bLessonPersonRepository.updateAtChapter(lessonPerson);
}
}
......
package org.rcisoft.business.bdiscuss.service.impl;
import org.rcisoft.business.bdiscuss.dto.BDiscussDto;
import org.rcisoft.business.blesson.dao.BLessonRepository;
import org.rcisoft.common.util.feignDto.MTUserGetsReqDTO;
import org.rcisoft.common.util.feignDto.MTUserInfoRspDTO;
import org.rcisoft.common.util.outClient.MTCotactApiRequestClient;
......@@ -37,6 +38,9 @@ public class BDiscussServiceImpl implements BDiscussService {
@Autowired
MTCotactApiRequestClient mtCotactApiRequestClient;
@Autowired
BLessonRepository bLessonRepository;
/**
* 保存 bDiscuss
* @param bDiscuss
......@@ -50,6 +54,7 @@ public class BDiscussServiceImpl implements BDiscussService {
int line = bDiscussRepository.insertSelective(bDiscuss);
// log.info(UserUtil.getUserInfoProp(bDiscuss.getToken(),UserUtil.USER_USERNAME)+"新增了ID为"+
// bDiscuss.getBusinessId()+"的信息");
bLessonRepository.discussNumberReCount(bDiscuss.getLessonId());
return new PersistModel(line);
}
......
......@@ -371,7 +371,7 @@ public interface BLessonPersonRepository extends BaseMapper<BLessonPerson> {
"and bl.corp_id = #{param.corpId} "+
"and blp.person_id = #{param.userId} "+
"and blp.person_id = #{param.personId} "+
"<if test= \" param.isAppoint != null and param.isAppoint != ''\">and blp.is_appoint = #{param.isAppoint} </if> " +
"<if test=\" param.lessonTitle !=null and param.lessonTitle != ''\">and bl.lesson_name like CONCAT('%',#{param.lessonTitle},'%')</if>" +
"<if test= \" param.isFinish != null and param.isFinish != ''\">and blp.is_finish = #{param.isFinish} </if> " +
......@@ -441,6 +441,25 @@ public interface BLessonPersonRepository extends BaseMapper<BLessonPerson> {
"<if test= \" handInTimeSort != null and handInTimeSort != '' and handInTimeSort == '1'.toString()\">, a.e_endtime desc </if> " +
"</script>")
List<ExamDto> userManageExam(ExamQueryDto dto);
@Update({"<script>",
"update b_lesson_person",
" <set>",
" <if test=\"updateBy != null and updateBy != ''\">update_by=#{updateBy},</if>",
" <if test=\"updateDate != null\">update_date=#{updateDate},</if>",
" <if test=\"delFlag != null and delFlag != ''\">del_flag=#{delFlag},</if>",
" <if test=\"flag != null and flag != ''\">flag=#{flag},</if>",
" <if test=\"remarks != null and remarks != ''\">remarks=#{remarks},</if>",
" <if test=\"personId != null and personId != ''\">person_id=#{personId},</if>",
" <if test=\"lessonId != null and lessonId != ''\">lesson_id=#{lessonId},</if>",
" <if test=\"learnProgress != null and learnProgress != ''\">learn_progress=#{learnProgress},</if>",
" <if test=\"isFinish != null and isFinish != ''\" >is_finish=#{isFinish},</if>",
" <if test=\"everFinished != null and everFinished != ''\">ever_finished=#{everFinished},</if>",
" <if test=\"finishDateSetNull != null and finishDateSetNull != '' and finishDateSetNull == '1'.toString()\">`finish_date` = NULL,</if>",
" </set>",
" where business_id=#{businessId}",
"</script>"})
int updateAtChapter(BLessonPerson bLessonPerson);
}
......@@ -704,6 +704,20 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
" </script>" )
int hotNumberReCount(String lessonId);
/**
* 重新统计评论数
*
*
* @param lessonId
* @return
*/
@Update("<script>update b_lesson set discuss_number = " +
"(select count(1) from b_discuss where 1=1 " +
" and lesson_id = #{lessonId}) where 1=1 " +
" and business_id = #{lessonId} " +
" </script>" )
int discussNumberReCount(String lessonId);
/**
* 列表页分页查询全部课程
* @param model
......
......@@ -9,6 +9,9 @@ import java.util.Date;
@Data
public class UserLessonDTO {
@ApiModelProperty(value = "学员id")
private String personId;
@ApiModelProperty(value = "课程标题")
private String lessonTitle;
......
......@@ -170,6 +170,7 @@ public class BLesson extends IdEntity<BLesson> {
private String trainDateState;
@ApiModelProperty(value = "0 未开始 1签到中(进行中) 2已结束")
@Transient
private String trainType;
......
......@@ -145,6 +145,10 @@ public class BLessonPerson extends IdEntity<BLessonPerson> {
@Transient
private String fullDept;
@ApiModelProperty(value = "学完时间是否置空 1置空")
@Transient
private String finishDateSetNull;
//初始化
public void initModel(){
UserUtil.setCurrentPersistOperation(this);
......
......@@ -352,11 +352,8 @@ public class BLessonPersonServiceImpl implements BLessonPersonService {
if (bLesson == null){
throw new ServiceException(ResultServiceEnums.NOT_LESSON_ERROR);
}
if (bLessonPerson == null && "0".equals(bLesson.getLessonType())){
throw new ServiceException(ResultServiceEnums.APPOINT_NOT_CLOSE);
}
if (bLessonPerson == null && "1".equals(bLesson.getLessonType())){
throw new ServiceException(ResultServiceEnums.LEARN_LESSON_NOT_EXISTS);
throw new ServiceException(ResultServiceEnums.APPLY_TRAIN_NOT_EXISTS);
}
Date now = new Date();
......
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