Commit 3eedb71f authored by YangZhaoJun1's avatar YangZhaoJun1

Merge branch 'master' of http://103.249.252.109:90/lcy/education

parents 16a4119b 9d781405
...@@ -7,11 +7,13 @@ import io.swagger.annotations.ApiImplicitParams; ...@@ -7,11 +7,13 @@ import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.map.HashedMap; import org.apache.commons.collections.map.HashedMap;
import org.rcisoft.business.bchapter.dao.BChapterRepository;
import org.rcisoft.business.bchapter.dto.QueryScoreListDTO; import org.rcisoft.business.bchapter.dto.QueryScoreListDTO;
import org.rcisoft.business.bchapter.dto.ScoreInfoDTO; import org.rcisoft.business.bchapter.dto.ScoreInfoDTO;
import org.rcisoft.business.bchapter.entity.BChapter; import org.rcisoft.business.bchapter.entity.BChapter;
import org.rcisoft.business.bchapter.enums.IsCompleteEnum; import org.rcisoft.business.bchapter.enums.IsCompleteEnum;
import org.rcisoft.business.bchapter.service.BChapterService; import org.rcisoft.business.bchapter.service.BChapterService;
import org.rcisoft.business.bsl.dao.BSlRepository;
import org.rcisoft.business.bsl.service.BSlService; import org.rcisoft.business.bsl.service.BSlService;
import org.rcisoft.common.component.Global; import org.rcisoft.common.component.Global;
import org.rcisoft.common.controller.PaginationController; import org.rcisoft.common.controller.PaginationController;
...@@ -367,4 +369,19 @@ public class BChapterController extends PaginationController<BChapter> { ...@@ -367,4 +369,19 @@ public class BChapterController extends PaginationController<BChapter> {
MessageConstant.MESSAGE_ALERT_ERROR, MessageConstant.MESSAGE_ALERT_ERROR,
bChapterService.chapterListBySlId(slId)); bChapterService.chapterListBySlId(slId));
} }
@ApiOperation(value="更改文件是否完成", notes="更改文件是否完成")
@ApiImplicitParams({@ApiImplicitParam(name = "type", value = "完成的类型 ppt是1 pdf是2 video是3", required = true, dataType = "varchar"),
@ApiImplicitParam(name = "chapterId", value = "章节id", required = true, dataType = "varchar"),
@ApiImplicitParam(name = "studentCode", value = "学号", required = true, dataType = "varchar")})
@PreAuthorize("hasRole('ROLE_1001')")
@PostMapping(value = "/updateToFinish")
public Result u(String type,String chapterId,String code) {
String stuId = bChapterService.queryStuIdByCode(code);
int data = bChapterService.updateToFinish(type,stuId,chapterId);
return Result.builder(new PersistModel(data),
MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR,
code);
}
} }
...@@ -303,5 +303,16 @@ public interface BChapterRepository extends BaseMapper<BChapter> { ...@@ -303,5 +303,16 @@ public interface BChapterRepository extends BaseMapper<BChapter> {
"(SELECT chapter_name from b_chapter where business_id = bc.business_id))) as chapterName\n" + "(SELECT chapter_name from b_chapter where business_id = bc.business_id))) as chapterName\n" +
" from b_chapter bc where bc.pid !='-1' AND bc.sl_id = #{slId} ORDER BY chapterName </script>") " from b_chapter bc where bc.pid !='-1' AND bc.sl_id = #{slId} ORDER BY chapterName </script>")
List<ChapterSelectDto> chapterListBySlId(String slId); List<ChapterSelectDto> chapterListBySlId(String slId);
@Select("<script>select business_id from b_student where code = #{code} and del_flag = 0 and flag = 1</script>")
String queryStuIdByCode(String code);
@Update("<script>update b_r_student_chapter\n" +
"<if test=\"type !=null and type != '' and type == 1 \"> set ppt_finish = 1 </if>" +
"<if test=\"type !=null and type != '' and type == 2 \"> set pdf_finish = 1 </if>" +
"<if test=\"type !=null and type != '' and type == 3 \"> set video_finish = 1 </if>" +
"where student_id = #{stuId} and chapter_id = #{chapterId} </script>")
int updateToFinish( @Param("stuId") String stuId, @Param("type") String type,@Param("chapterId") String chapterId);
} }
...@@ -108,6 +108,9 @@ public class BChapter extends IdEntity<BChapter> { ...@@ -108,6 +108,9 @@ public class BChapter extends IdEntity<BChapter> {
@Transient @Transient
private String studentName; private String studentName;
@Transient
private String type;
public BChapter(String businessId) { public BChapter(String businessId) {
this.businessId = businessId; this.businessId = businessId;
......
...@@ -113,4 +113,8 @@ public interface BChapterService{ ...@@ -113,4 +113,8 @@ public interface BChapterService{
List<ScoreReportDto> scoreReport(String slId); List<ScoreReportDto> scoreReport(String slId);
List<ChapterSelectDto> chapterListBySlId(String slId); List<ChapterSelectDto> chapterListBySlId(String slId);
String queryStuIdByCode(String code);
int updateToFinish(String type, String stuId, String chapterId);
} }
...@@ -506,5 +506,15 @@ public class BChapterServiceImpl implements BChapterService { ...@@ -506,5 +506,15 @@ public class BChapterServiceImpl implements BChapterService {
return bChapterRepository.chapterListBySlId(slId); return bChapterRepository.chapterListBySlId(slId);
} }
@Override
public String queryStuIdByCode(String code) {
return bChapterRepository.queryStuIdByCode(code);
}
@Override
public int updateToFinish(String type, String stuId, String chapterId) {
return bChapterRepository.updateToFinish(stuId,type,chapterId);
}
} }
...@@ -24,4 +24,10 @@ public class StudentChapterScoreVO { ...@@ -24,4 +24,10 @@ public class StudentChapterScoreVO {
private String scoreId; private String scoreId;
/*是否智评*/ /*是否智评*/
private String automatic; private String automatic;
/*ppt是否完成*/
private String ppt_finish;
/*pdf是否完成*/
private String pdf_finish;
/*video是否完成*/
private String video_finish;
} }
...@@ -157,12 +157,12 @@ public class TQuestionController extends PaginationController<TQuestion> { ...@@ -157,12 +157,12 @@ public class TQuestionController extends PaginationController<TQuestion> {
public Result queryBChapters(String chapterId) { public Result queryBChapters(String chapterId) {
Map<String, Object> map = new HashedMap(); Map<String, Object> map = new HashedMap();
String num = ""; String num = "";
map.put("List1",tQuestionServiceImpl.queryQuestionsByChap_IdAndQtype(chapterId, "1")); map.put("ChoiceList",tQuestionServiceImpl.queryQuestionsByChap_IdAndQtype(chapterId, "1"));
map.put("List2",tQuestionServiceImpl.queryQuestionsByChap_IdAndQtype(chapterId, "2")); map.put("MultiSelectList",tQuestionServiceImpl.queryQuestionsByChap_IdAndQtype(chapterId, "2"));
map.put("List3",tQuestionServiceImpl.queryQuestionsByChap_IdAndQtype(chapterId, "3")); map.put("JudgmentList",tQuestionServiceImpl.queryQuestionsByChap_IdAndQtype(chapterId, "3"));
num = "NumOf1 : "+tQuestionServiceImpl.queryNumByType("1")+ num = "NumOfChoice : "+tQuestionServiceImpl.queryNumByType("1")+
"NumOf2 : "+tQuestionServiceImpl.queryNumByType("2")+ "NumOfMultiSelect : "+tQuestionServiceImpl.queryNumByType("2")+
"NumOf3 : "+tQuestionServiceImpl.queryNumByType("3"); "NumOfJudgment : "+tQuestionServiceImpl.queryNumByType("3");
map.put("Num",num); map.put("Num",num);
return Result.builder(new PersistModel(1), return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS, MessageConstant.MESSAGE_ALERT_SUCCESS,
......
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