瀏覽代碼

Merge remote-tracking branch 'origin/master'

shenhao 6 年之前
父節點
當前提交
27e763d06b
共有 47 個文件被更改,包括 3190 次插入5 次删除
  1. 445 0
      src/main/java/com/ssj/api/controller/ApiTrainController.java
  2. 42 0
      src/main/java/com/ssj/api/domain/model/RoleTypeModel.java
  3. 19 0
      src/main/java/com/ssj/api/domain/vo/UserBaseRequestVo.java
  4. 40 0
      src/main/java/com/ssj/api/domain/vo/train/TrainExamUserSaveVo.java
  5. 20 0
      src/main/java/com/ssj/api/domain/vo/train/TrainExamVo.java
  6. 29 0
      src/main/java/com/ssj/api/domain/vo/train/TrainLoginVo.java
  7. 60 0
      src/main/java/com/ssj/api/domain/vo/train/TrainVideoFileVo.java
  8. 29 0
      src/main/java/com/ssj/api/domain/vo/train/TrainVideoVo.java
  9. 36 0
      src/main/java/com/ssj/api/filter/CorsFilter.java
  10. 96 0
      src/main/java/com/ssj/api/security/SecurityAspect.java
  11. 19 0
      src/main/java/com/ssj/api/security/annotation/IgnoreSecurity.java
  12. 19 0
      src/main/java/com/ssj/api/security/annotation/ModifySecurity.java
  13. 19 0
      src/main/java/com/ssj/api/security/annotation/QueryIgnoreSecurity.java
  14. 108 0
      src/main/java/com/ssj/bean/sys/train/bean/ExamInfo.java
  15. 108 0
      src/main/java/com/ssj/bean/sys/train/bean/VideoFile.java
  16. 109 0
      src/main/java/com/ssj/bean/sys/train/bean/VideoInfo.java
  17. 98 0
      src/main/java/com/ssj/bean/sys/train/bean/VideoUser.java
  18. 1 1
      src/main/java/com/ssj/transaction/config/TransactionConfiguration.java
  19. 18 0
      src/main/java/com/ssj/dao/sys/train/dao/ExamInfoDao.java
  20. 27 0
      src/main/java/com/ssj/dao/sys/train/dao/TrainQueryDao.java
  21. 14 0
      src/main/java/com/ssj/dao/sys/train/dao/VideoFileDao.java
  22. 15 0
      src/main/java/com/ssj/dao/sys/train/dao/VideoInfoDao.java
  23. 18 0
      src/main/java/com/ssj/dao/sys/train/dao/VideoUserDao.java
  24. 232 0
      src/main/java/com/ssj/dao/sys/train/dao/impl/TrainQueryDaoImpl.java
  25. 22 0
      src/main/java/com/ssj/framework/core/common/controller/BaseController.java
  26. 17 0
      src/main/java/com/ssj/framework/core/util/HttpRemote.java
  27. 13 0
      src/main/java/com/ssj/service/sys/train/service/ExamInfoService.java
  28. 19 0
      src/main/java/com/ssj/service/sys/train/service/VideoFileService.java
  29. 23 0
      src/main/java/com/ssj/service/sys/train/service/VideoInfoService.java
  30. 24 0
      src/main/java/com/ssj/service/sys/train/service/VideoUserService.java
  31. 36 0
      src/main/java/com/ssj/service/sys/train/service/impl/ExamInfoServiceImpl.java
  32. 47 0
      src/main/java/com/ssj/service/sys/train/service/impl/VideoFileServiceImpl.java
  33. 56 0
      src/main/java/com/ssj/service/sys/train/service/impl/VideoInfoServiceImpl.java
  34. 56 0
      src/main/java/com/ssj/service/sys/train/service/impl/VideoUserServiceImpl.java
  35. 5 0
      src/main/java/com/ssj/service/weixin/user/service/impl/UserServiceImpl.java
  36. 285 0
      src/main/java/com/ssj/sys/controller/TrainController.java
  37. 1 1
      src/main/java/com/ssj/api/weixin/util/AesException.java
  38. 1 1
      src/main/java/com/ssj/api/weixin/util/ByteGroup.java
  39. 1 1
      src/main/java/com/ssj/api/weixin/util/PKCS7Encoder.java
  40. 1 1
      src/main/java/com/ssj/api/weixin/util/SHA1.java
  41. 二進制
      src/main/resources/static/sys/excel/exam_info.xlsx
  42. 207 0
      src/main/resources/templates/sys/train/file_edit.html
  43. 155 0
      src/main/resources/templates/sys/train/file_list.html
  44. 105 0
      src/main/resources/templates/sys/train/pace_list.html
  45. 97 0
      src/main/resources/templates/sys/train/pace_list_info.html
  46. 211 0
      src/main/resources/templates/sys/train/video_edit.html
  47. 187 0
      src/main/resources/templates/sys/train/video_list.html

+ 445 - 0
src/main/java/com/ssj/api/controller/ApiTrainController.java

@@ -0,0 +1,445 @@
+package com.ssj.api.controller;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.domain.Page;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.ssj.api.domain.model.RoleTypeModel;
+import com.ssj.api.domain.vo.train.TrainExamUserSaveVo;
+import com.ssj.api.domain.vo.train.TrainExamVo;
+import com.ssj.api.domain.vo.train.TrainLoginVo;
+import com.ssj.api.domain.vo.train.TrainVideoFileVo;
+import com.ssj.api.domain.vo.train.TrainVideoVo;
+import com.ssj.api.security.annotation.IgnoreSecurity;
+import com.ssj.bean.sys.train.bean.ExamInfo;
+import com.ssj.bean.sys.train.bean.VideoInfo;
+import com.ssj.bean.sys.train.bean.VideoUser;
+import com.ssj.bean.weixin.libmy.domain.TbLibManager;
+import com.ssj.bean.weixin.user.domain.User;
+import com.ssj.framework.core.common.controller.BaseController;
+import com.ssj.framework.core.util.CodecUtil;
+import com.ssj.framework.core.util.ResponseConstant;
+import com.ssj.framework.core.util.ResponseEntity;
+import com.ssj.service.sys.train.service.ExamInfoService;
+import com.ssj.service.sys.train.service.VideoFileService;
+import com.ssj.service.sys.train.service.VideoInfoService;
+import com.ssj.service.sys.train.service.VideoUserService;
+import com.ssj.service.weixin.library.service.IBookManagerService;
+import com.ssj.service.weixin.user.service.UserService;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+
+/**
+ * 
+ * 类描述: 培训系统
+ * 创建时间:2020年8月7日9:34:18
+ */
+@Api(value = "培训系统", tags = "培训系统")
+@RestController
+@RequestMapping("/api/train")
+public class ApiTrainController extends BaseController {
+	
+	@Autowired
+    private UserService userService;
+	
+    @Autowired
+    private IBookManagerService bookManagerService;
+    
+	@Autowired
+    private VideoUserService videoUserService;
+	
+	@Autowired
+    private VideoInfoService videoInfoService;
+	
+	@Autowired
+    private VideoFileService videoFileService;
+	
+	@Autowired
+    private ExamInfoService examInfoService;
+	
+
+	private static List<RoleTypeModel> defaultRoleTypeModels=new ArrayList<RoleTypeModel>();
+	private static List<String> defaultRoleTypeNames=new ArrayList<String>();
+	static {
+		defaultRoleTypeNames.add("校长端");
+		defaultRoleTypeNames.add("老师端");
+		defaultRoleTypeNames.add("家长端");
+		defaultRoleTypeNames.add("学生端");
+		
+		RoleTypeModel roleTypeModel1=new RoleTypeModel();
+		roleTypeModel1.setRoleType(1);
+		roleTypeModel1.setRoleName(defaultRoleTypeNames.get(0));
+		roleTypeModel1.setModules(new String[] {"现场管理","作业标注","学科怀疑"});
+		defaultRoleTypeModels.add(roleTypeModel1);
+		
+		RoleTypeModel roleTypeModel2=new RoleTypeModel();
+		roleTypeModel2.setRoleType(2);
+		roleTypeModel2.setRoleName(defaultRoleTypeNames.get(1));
+		roleTypeModel2.setModules(new String[] {"主要功能","其它功能"});
+		defaultRoleTypeModels.add(roleTypeModel2);
+		
+		
+		RoleTypeModel roleTypeModel3=new RoleTypeModel();
+		roleTypeModel3.setRoleType(3);
+		roleTypeModel3.setRoleName(defaultRoleTypeNames.get(2));
+		roleTypeModel3.setModules(new String[] {});
+		defaultRoleTypeModels.add(roleTypeModel3);
+		
+		RoleTypeModel roleTypeModel4=new RoleTypeModel();
+		roleTypeModel4.setRoleType(4);
+		roleTypeModel4.setRoleName(defaultRoleTypeNames.get(3));
+		roleTypeModel4.setModules(new String[] {});
+		defaultRoleTypeModels.add(roleTypeModel4);
+		
+	}
+	
+	
+	//查询出校长,老师的身份
+	private TbLibManager getTbLibManagerUserId(String userId) {
+		List<TbLibManager> teacherLists = bookManagerService.findAllManagerByTeacherId(userId);
+        if(CollectionUtils.isEmpty(teacherLists)) {
+        	return null;
+        }
+        TbLibManager tbLibManager=teacherLists.get(0);
+        for (TbLibManager libManager : teacherLists) {
+        	//有校长身份的,优先显示校长身份的数据
+			if(libManager.getType()==6) {
+				tbLibManager=libManager;
+				break;
+			}
+		}
+        return tbLibManager;
+	}
+	
+	
+	private Map<String, Object> getTrainVideoUserMap(Integer roleType,List<Map<String,Object>> list){
+		for (Map<String, Object> map : list) {
+			if(roleType==(int)map.get("role_type")) {
+				return map;
+			}
+		}
+		return null;
+	}
+	
+
+	@IgnoreSecurity
+	@RequestMapping(value = "/login", method = RequestMethod.POST)
+    @ApiOperation(value = "账号密码登录接口", httpMethod = "POST",  notes = "账号密码登录接口")
+    public ResponseEntity login(@RequestParam(name = "accessToken") String accessToken,
+    		@RequestBody TrainLoginVo requestVO) {
+        ResponseEntity responseEntity = new ResponseEntity();
+        Map<String, Object> data=new HashMap<String, Object>();
+        try {
+            User phoneUser = userService.findByMobile(requestVO.getLoginName());
+            if (phoneUser == null) {
+                responseEntity.failure(ResponseConstant.CODE_000, "账号无效");
+                return responseEntity;
+            }
+            User user = userService.getUserByPassword(requestVO.getLoginName(), requestVO.getPassword());
+            if (user == null) {
+            	responseEntity.failure("密码错误");
+                return responseEntity;
+            }
+            //查询该老师拥有的角色
+            TbLibManager tbLibManager = getTbLibManagerUserId(user.getId());
+            if(tbLibManager==null) {
+            	responseEntity.failure("账号无身份权限");
+                return responseEntity;
+            }
+
+            data.put("userId", user.getId());
+            data.put("name", StringUtils.isNotEmpty(tbLibManager.getName())? tbLibManager.getName(): "");
+            data.put("photo", StringUtils.isNotEmpty(user.getPhoto())? user.getPhoto(): "");
+            data.put("accessToken", getAccessToken(user.getId(),CodecUtil.createUUID()));
+            data.put("roleTypes", defaultRoleTypeModels);
+            responseEntity.success(data, "账号密码登录成功");
+        } catch (Exception e) {
+            logger.error("账号密码登录接口", e);
+            responseEntity.failure(ResponseConstant.CODE_500, "系统繁忙,请稍后重试");
+        }
+        return responseEntity;
+    }
+	
+	
+	
+	@RequestMapping(value = "/home")
+    @ApiOperation(value = "学习中心-选择身份接口",   notes = "学习中心-选择身份接口")
+    public ResponseEntity home(@RequestParam(name = "accessToken") String accessToken) {
+        ResponseEntity responseEntity = new ResponseEntity();
+        List<Map<String, Object>> data=new ArrayList<Map<String,Object>>();
+        try {
+            String userId = tokenManager.getUserId(accessToken);
+            TbLibManager tbLibManager = getTbLibManagerUserId(userId);
+            if(tbLibManager==null) {
+            	responseEntity.failure("账号无身份权限");
+                return responseEntity;
+            }
+            List<Map<String,Object>> list=videoUserService.findTrainVideoUserByUserId(userId);
+            
+            Map<String, Object> map1=new HashMap<String, Object>();
+            Map<String, Object> dataMap1=getTrainVideoUserMap(1, list);
+            map1.put("roleType", 1);
+            map1.put("roleName", defaultRoleTypeNames.get(0));
+            //校长才显示校长端
+            if(tbLibManager.getType()==6) {
+            	map1.put("successNum", dataMap1!=null ? Integer.parseInt(dataMap1.get("success_num").toString()):0);
+            	map1.put("countNum", dataMap1!=null ? Integer.parseInt(dataMap1.get("count_num").toString()):0);
+            	map1.put("unlock", (int)map1.get("successNum")>=(int)map1.get("countNum")?1:0);
+            }else {
+            	map1.put("successNum", 0);
+            	map1.put("countNum", 0);
+            	map1.put("unlock", 1);
+            }
+            data.add(map1);
+            
+            Map<String, Object> map2=new HashMap<String, Object>();
+            Map<String, Object> dataMap2=getTrainVideoUserMap(2, list);
+            map2.put("roleType", 2);
+            map2.put("roleName", defaultRoleTypeNames.get(1));
+            map2.put("successNum", dataMap2!=null ? Integer.parseInt(dataMap2.get("success_num").toString()):0);
+            map2.put("countNum", dataMap2!=null ? Integer.parseInt(dataMap2.get("count_num").toString()):0);
+            map2.put("unlock", (int)map2.get("successNum")>=(int)map2.get("countNum")?1:0);
+            data.add(map2);
+            
+            Map<String, Object> map3=new HashMap<String, Object>();
+            Map<String, Object> dataMap3=getTrainVideoUserMap(3, list);
+            map3.put("roleType", 3);
+            map3.put("roleName", defaultRoleTypeNames.get(2));
+            map3.put("successNum", dataMap3!=null ? Integer.parseInt(dataMap3.get("success_num").toString()):0);
+            map3.put("countNum", dataMap3!=null ? Integer.parseInt(dataMap3.get("count_num").toString()):0);
+            map3.put("unlock", (int)map3.get("successNum")>=(int)map3.get("countNum")?1:0);
+            data.add(map3);
+            
+            Map<String, Object> map4=new HashMap<String, Object>();
+            Map<String, Object> dataMap4=getTrainVideoUserMap(4, list);
+            map4.put("roleType", 4);
+            map4.put("roleName", defaultRoleTypeNames.get(3));
+            map4.put("successNum", dataMap4!=null ? Integer.parseInt(dataMap4.get("success_num").toString()):0);
+            map4.put("countNum", dataMap4!=null ? Integer.parseInt(dataMap4.get("count_num").toString()):0);
+            map4.put("unlock", (int)map4.get("successNum")>=(int)map4.get("countNum")?1:0);
+            data.add(map4);
+            
+            responseEntity.success(data, "查询成功");
+        } catch (Exception e) {
+            logger.error("学习中心-选择身份接口", e);
+            responseEntity.failure(ResponseConstant.CODE_500, "系统繁忙,请稍后重试");
+        }
+        return responseEntity;
+    }
+	
+	
+	
+	@RequestMapping(value = "/video")
+    @ApiOperation(value = "学习中心-视频学习内容",   notes = "学习中心-视频学习内容")
+    public ResponseEntity video(@RequestParam(name = "accessToken") String accessToken,
+    		@RequestBody TrainVideoVo requestVO) {
+        ResponseEntity responseEntity = new ResponseEntity();
+        List<Map<String, Object>> data=new ArrayList<Map<String,Object>>();
+        try {
+            String userId = tokenManager.getUserId(accessToken);
+            List<Map<String, Object>> list=videoInfoService.findTrainVideoUserByRoleType(userId, requestVO.getRoleType(), requestVO.getModule());
+            Map<String, Object> dataMap=null;
+            for (Map<String, Object> map : list) {
+            	dataMap=new HashMap<String, Object>();
+            	dataMap.put("id", map.get("id"));
+            	dataMap.put("roleType", map.get("role_type"));
+            	dataMap.put("module", map.get("module"));
+            	dataMap.put("title", map.get("title"));
+            	dataMap.put("description", map.get("description"));
+            	dataMap.put("url", map.get("url"));
+            	dataMap.put("roleName", defaultRoleTypeNames.get(Integer.parseInt(map.get("role_type").toString())-1));
+				if(Integer.parseInt(map.get("un_lock").toString())>0) {
+					dataMap.put("unlock", 1);
+				}else {
+					dataMap.put("unlock", 0);
+				}
+				data.add(dataMap);
+			}
+            responseEntity.success(data, "查询成功");
+        } catch (Exception e) {
+            logger.error("学习中心-视频学习内容接口", e);
+            responseEntity.failure(ResponseConstant.CODE_500, "系统繁忙,请稍后重试");
+        }
+        return responseEntity;
+    }
+
+	
+	
+	@RequestMapping(value = "/exam")
+    @ApiOperation(value = "学习中心-考核测试题目",   notes = "学习中心-考核测试题目")
+    public ResponseEntity exam(@RequestParam(name = "accessToken") String accessToken,
+    		@RequestBody TrainExamVo requestVO) {
+        ResponseEntity responseEntity = new ResponseEntity();
+        List<Map<String, Object>> data=new ArrayList<Map<String,Object>>();
+        try {
+            List<ExamInfo> examInfos=examInfoService.findExamInfoByVideoId(requestVO.getVideoId());
+            Map<String, Object> dataMap=null;
+            for (ExamInfo examInfo : examInfos) {
+            	dataMap=new HashMap<String, Object>();
+            	dataMap.put("id", examInfo.getId());
+            	dataMap.put("examNum", examInfo.getExamNum());
+            	dataMap.put("examType", examInfo.getExamType());
+            	dataMap.put("title", examInfo.getTitle());
+            	dataMap.put("options", StringUtils.isNotEmpty(examInfo.getOptions())? examInfo.getOptions().split(";") : "");
+            	dataMap.put("answer", StringUtils.isNotEmpty(examInfo.getAnswer())? examInfo.getAnswer().split(";") : "");
+            	dataMap.put("score", examInfo.getScore());
+            	data.add(dataMap);
+			}
+            responseEntity.success(data, "查询成功");
+        } catch (Exception e) {
+            logger.error("学习中心-考核测试题目接口", e);
+            responseEntity.failure(ResponseConstant.CODE_500, "系统繁忙,请稍后重试");
+        }
+        return responseEntity;
+    }
+	
+	
+	
+	
+	@RequestMapping(value = "/exam/user/save")
+    @ApiOperation(value = "学习中心-考核测试答案提交",   notes = "学习中心-考核测试答案提交")
+    public ResponseEntity examUserSave(@RequestParam(name = "accessToken") String accessToken,
+    		@RequestBody TrainExamUserSaveVo requestVO) {
+        ResponseEntity responseEntity = new ResponseEntity();
+        if(requestVO.getScore()==null || requestVO.getScore()<0) {
+        	 responseEntity.failure("分数不可小于0");
+        	 return responseEntity;
+        }
+        if(StringUtils.isEmpty(requestVO.getVideoId())) {
+       	 	responseEntity.failure("视频id不可为空");
+       	 	return responseEntity;
+        }
+        try {
+        	String userId = tokenManager.getUserId(accessToken);
+        	VideoInfo videoInfo=videoInfoService.getById(requestVO.getVideoId());
+        	VideoInfo maxVideoInfo=videoInfoService.getVideoInfoByMax(videoInfo.getRoleType(), videoInfo.getId());
+        	//不是最后一个视频,不做其它处理,直接解锁。
+        	if(maxVideoInfo!=null) {
+        		VideoUser videoUser=new VideoUser();
+        		videoUser.setVideoId(videoInfo.getId());
+        		videoUser.setUserId(userId);
+        		videoUser.setRoleType(videoInfo.getRoleType());
+        		videoUser.setModule(videoInfo.getModule());
+        		videoUser.setAnswerRecord(requestVO.getAnswer());
+        		videoUser.setScore(requestVO.getScore());
+        		videoUser.setStatus(1);
+        		videoUser.setCreateTime(new Date());
+        		videoUserService.save(videoUser);
+        	}else {
+        		//如果不够90,重新锁定RoleType的视频。
+        		VideoUser videoUser=new VideoUser();
+        		videoUser.setVideoId(videoInfo.getId());
+        		videoUser.setUserId(userId);
+        		videoUser.setRoleType(videoInfo.getRoleType());
+        		videoUser.setModule(videoInfo.getModule());
+        		videoUser.setAnswerRecord(requestVO.getAnswer());
+        		videoUser.setScore(requestVO.getScore());
+        		videoUser.setCreateTime(new Date());
+        		if(requestVO.getScore()<90) {
+        			videoUser.setStatus(0);
+        		}else {
+        			videoUser.setStatus(1);
+        		}
+        		videoUserService.save(videoUser);
+        		
+        		if(requestVO.getScore()<90) {
+	        		List<VideoUser> videoUsers=videoUserService.findVideoUserByUserIdAndRoleType(videoInfo.getRoleType(), userId);
+	        		if(videoUsers!=null && videoUsers.size()>0) {
+	        			for (VideoUser video : videoUsers) {
+	        				video.setStatus(0);
+	        			}
+	        			videoUserService.save(videoUsers);
+	        		}
+        		}
+        	}
+            responseEntity.success("保存成功");
+        } catch (Exception e) {
+            logger.error("学习中心-考核测试答案提交接口", e);
+            responseEntity.failure(ResponseConstant.CODE_500, "系统繁忙,请稍后重试");
+        }
+        return responseEntity;
+    }
+	
+	
+	
+	@RequestMapping(value = "/file")
+    @ApiOperation(value = "资料下载-资料列表",   notes = "资料下载-资料列表")
+    public ResponseEntity file(@RequestParam(name = "accessToken") String accessToken) {
+        ResponseEntity responseEntity = new ResponseEntity();
+        List<Map<String, Object>> data=new ArrayList<Map<String,Object>>();
+        try {
+            List<Map<String, Object>> videoFiles=videoFileService.findVideoFileByType();
+            Map<String, Object> dataMap=null;
+            for (Map<String, Object> map : videoFiles) {
+            	dataMap=new HashMap<String, Object>();
+            	dataMap.put("roleType", map.get("role_type"));
+            	dataMap.put("roleName", defaultRoleTypeNames.get(Integer.parseInt(map.get("role_type").toString())-1));
+            	dataMap.put("name", defaultRoleTypeNames.get(Integer.parseInt(map.get("role_type").toString())-1)+"学习资料");
+            	dataMap.put("num", map.get("num"));
+            	dataMap.put("url", map.get("url"));
+            	data.add(dataMap);
+			}
+            responseEntity.success(data, "查询成功");
+        } catch (Exception e) {
+            logger.error("学习中心-考核测试题目接口", e);
+            responseEntity.failure(ResponseConstant.CODE_500, "系统繁忙,请稍后重试");
+        }
+        return responseEntity;
+    }
+	
+	
+	
+	@RequestMapping(value = "/file/info")
+    @ApiOperation(value = "资料下载-资料明细列表",   notes = "资料下载-资料明细列表")
+    public ResponseEntity fileInfo(@RequestParam(name = "accessToken") String accessToken,
+    		@RequestBody TrainVideoFileVo requestVO) {
+        ResponseEntity responseEntity = new ResponseEntity();
+        Map<String, Object> data=new HashMap<String, Object>();
+        List< Map<String, Object>> list=new ArrayList<Map<String,Object>>();
+        try {
+        	Map<String, Object> params = new HashMap<String, Object>();
+    		params.put("roleType", requestVO.getRoleType());
+    		params.put("module", requestVO.getModule());
+    		params.put("name", requestVO.getName());
+    		
+            Page<Map<String,Object>> page = videoFileService.findVideoFileByPage(params, initPage(requestVO.getPageNo(), requestVO.getPageSize()));
+            List<Map<String,Object>> videoFiles=page.getContent();
+            Map<String, Object> dataMap=null;
+            for (Map<String, Object> map : videoFiles) {
+            	dataMap=new HashMap<String, Object>();
+            	dataMap.put("roleType", map.get("role_type"));
+            	dataMap.put("roleName", defaultRoleTypeNames.get(Integer.parseInt(map.get("role_type").toString())-1));
+            	dataMap.put("name", map.get("title"));
+            	dataMap.put("format", map.get("format"));
+            	dataMap.put("url", map.get("url"));
+            	dataMap.put("createTime", map.get("create_time"));
+            	list.add(dataMap);
+			}
+            
+            data.put("pages", page.getTotalPages());
+            data.put("pageNo", requestVO.getPageNo());
+            data.put("pageSize", requestVO.getPageSize());
+            data.put("list", list);
+            responseEntity.success(data, "查询成功");
+        } catch (Exception e) {
+            logger.error("学习中心-考核测试题目接口", e);
+            responseEntity.failure(ResponseConstant.CODE_500, "系统繁忙,请稍后重试");
+        }
+        return responseEntity;
+    }
+	
+	
+}

+ 42 - 0
src/main/java/com/ssj/api/domain/model/RoleTypeModel.java

@@ -0,0 +1,42 @@
+package com.ssj.api.domain.model;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class RoleTypeModel {
+	
+	private Integer roleType;
+	
+	private String roleName;
+	
+	private String[] modules;
+
+	public Integer getRoleType() {
+		return roleType;
+	}
+
+	public void setRoleType(Integer roleType) {
+		this.roleType = roleType;
+	}
+
+	public String getRoleName() {
+		return roleName;
+	}
+
+	public void setRoleName(String roleName) {
+		this.roleName = roleName;
+	}
+
+	public String[] getModules() {
+		return modules;
+	}
+
+	public void setModules(String[] modules) {
+		this.modules = modules;
+	}
+
+	
+	
+	
+
+}

+ 19 - 0
src/main/java/com/ssj/api/domain/vo/UserBaseRequestVo.java

@@ -0,0 +1,19 @@
+package com.ssj.api.domain.vo;
+
+import com.ssj.bean.common.framework.core.domain.BaseRequest;
+
+public class UserBaseRequestVo extends BaseRequest {
+	
+	private static final long serialVersionUID = 1L;
+	
+	private String userId;
+
+	public String getUserId() {
+		return userId;
+	}
+
+	public void setUserId(String userId) {
+		this.userId = userId;
+	}
+	
+}

+ 40 - 0
src/main/java/com/ssj/api/domain/vo/train/TrainExamUserSaveVo.java

@@ -0,0 +1,40 @@
+package com.ssj.api.domain.vo.train;
+
+import com.ssj.bean.common.framework.core.domain.BaseRequest;
+
+public class TrainExamUserSaveVo extends BaseRequest {
+	
+	private static final long serialVersionUID = 1L;
+	
+	private String videoId;
+
+	private String answer;
+	
+	private Integer score;
+	
+	public String getVideoId() {
+		return videoId;
+	}
+
+	public void setVideoId(String videoId) {
+		this.videoId = videoId;
+	}
+
+	public String getAnswer() {
+		return answer;
+	}
+
+	public void setAnswer(String answer) {
+		this.answer = answer;
+	}
+
+	public Integer getScore() {
+		return score;
+	}
+
+	public void setScore(Integer score) {
+		this.score = score;
+	}
+
+	
+}

+ 20 - 0
src/main/java/com/ssj/api/domain/vo/train/TrainExamVo.java

@@ -0,0 +1,20 @@
+package com.ssj.api.domain.vo.train;
+
+import com.ssj.bean.common.framework.core.domain.BaseRequest;
+
+public class TrainExamVo extends BaseRequest {
+	
+	private static final long serialVersionUID = 1L;
+	
+	private String videoId;
+
+	public String getVideoId() {
+		return videoId;
+	}
+
+	public void setVideoId(String videoId) {
+		this.videoId = videoId;
+	}
+
+	
+}

+ 29 - 0
src/main/java/com/ssj/api/domain/vo/train/TrainLoginVo.java

@@ -0,0 +1,29 @@
+package com.ssj.api.domain.vo.train;
+
+import com.ssj.bean.common.framework.core.domain.BaseRequest;
+
+public class TrainLoginVo extends BaseRequest {
+	
+	private static final long serialVersionUID = 1L;
+	
+	private String loginName;
+	
+	private String password;
+
+	public String getLoginName() {
+		return loginName;
+	}
+
+	public void setLoginName(String loginName) {
+		this.loginName = loginName;
+	}
+
+	public String getPassword() {
+		return password;
+	}
+
+	public void setPassword(String password) {
+		this.password = password;
+	}
+	
+}

+ 60 - 0
src/main/java/com/ssj/api/domain/vo/train/TrainVideoFileVo.java

@@ -0,0 +1,60 @@
+package com.ssj.api.domain.vo.train;
+
+import com.ssj.bean.common.framework.core.domain.BaseRequest;
+
+public class TrainVideoFileVo extends BaseRequest {
+	
+	private static final long serialVersionUID = 1L;
+	
+	private Integer pageNo;
+	
+	private Integer pageSize;
+	
+	private Integer roleType;
+	
+	private String module;
+	
+	private String name;
+
+	public Integer getPageNo() {
+		return pageNo;
+	}
+
+	public void setPageNo(Integer pageNo) {
+		this.pageNo = pageNo;
+	}
+
+	public Integer getPageSize() {
+		return pageSize;
+	}
+
+	public void setPageSize(Integer pageSize) {
+		this.pageSize = pageSize;
+	}
+
+	public Integer getRoleType() {
+		return roleType;
+	}
+
+	public void setRoleType(Integer roleType) {
+		this.roleType = roleType;
+	}
+
+	public String getModule() {
+		return module;
+	}
+
+	public void setModule(String module) {
+		this.module = module;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+	
+	
+}

+ 29 - 0
src/main/java/com/ssj/api/domain/vo/train/TrainVideoVo.java

@@ -0,0 +1,29 @@
+package com.ssj.api.domain.vo.train;
+
+import com.ssj.bean.common.framework.core.domain.BaseRequest;
+
+public class TrainVideoVo extends BaseRequest {
+	
+	private static final long serialVersionUID = 1L;
+	
+	private Integer roleType;
+	
+	private String module;
+
+	public Integer getRoleType() {
+		return roleType;
+	}
+
+	public void setRoleType(Integer roleType) {
+		this.roleType = roleType;
+	}
+
+	public String getModule() {
+		return module;
+	}
+
+	public void setModule(String module) {
+		this.module = module;
+	}
+
+}

+ 36 - 0
src/main/java/com/ssj/api/filter/CorsFilter.java

@@ -0,0 +1,36 @@
+package com.ssj.api.filter;
+
+import java.io.IOException;
+
+import javax.servlet.Filter;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.annotation.WebFilter;
+import javax.servlet.http.HttpServletResponse;
+
+import org.springframework.stereotype.Component;
+@Component
+@WebFilter(urlPatterns = "/*", filterName = "corsFilter")  //这里的“/*” 表示的是需要拦截的请求路径
+public class CorsFilter implements Filter {
+
+    @Override
+    public void init(FilterConfig filterConfig) throws ServletException {
+    }
+
+    @Override
+    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
+        HttpServletResponse httpResponse = (HttpServletResponse)servletResponse;
+        httpResponse.setHeader("Access-Control-Allow-Headers","DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,x_requested_with,If-Modified-Since,Cache-Control,Content-Type,Authorization");
+        httpResponse.setHeader("Access-Control-Allow-Credentials", "true");
+        httpResponse.setHeader("Access-Control-Allow-Methods", "GET, POST, OPTIONS");
+        httpResponse.addHeader("Access-Control-Allow-Origin", "*");
+        filterChain.doFilter(servletRequest, httpResponse);
+    }
+
+    @Override
+    public void destroy() {
+    }
+}

+ 96 - 0
src/main/java/com/ssj/api/security/SecurityAspect.java

@@ -0,0 +1,96 @@
+package com.ssj.api.security;
+
+import java.lang.reflect.Method;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.commons.lang3.StringUtils;
+import org.aspectj.lang.ProceedingJoinPoint;
+import org.aspectj.lang.annotation.Around;
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.Pointcut;
+import org.aspectj.lang.reflect.MethodSignature;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.web.context.request.RequestContextHolder;
+import org.springframework.web.context.request.ServletRequestAttributes;
+
+import com.ssj.api.security.annotation.IgnoreSecurity;
+import com.ssj.api.security.annotation.ModifySecurity;
+import com.ssj.framework.core.security.exception.RequestsException;
+import com.ssj.framework.core.security.exception.TokenException;
+import com.ssj.framework.core.security.manager.TokenManager;
+import com.ssj.framework.core.util.StringUtil;
+
+
+/**
+ * 
+ * 类名称:SecurityAspect<br>
+ * 类描述:用于检查 token 的切面<br>
+ * @version v1.0
+ *
+ */
+@Aspect
+@Component
+public class SecurityAspect {
+	private static final Logger logger = LoggerFactory.getLogger(SecurityAspect.class);
+	@Autowired
+	private TokenManager tokenManager;
+    @Pointcut("@annotation(org.springframework.web.bind.annotation.RequestMapping)")
+	public void methodPointcut(){}
+    /**
+	 * 拦截器具体实现
+	 * @param pjp
+	 * @return JsonResult(被拦截方法的执行结果,或需要登录的错误提示。)
+	 */
+	@Around("methodPointcut()") //指定拦截器规则;也可以直接把“execution(* com.xjj.........)”写进这里
+	public Object Interceptor(ProceedingJoinPoint pjp)throws Throwable{
+		MethodSignature signature = (MethodSignature) pjp.getSignature();
+		Method method = signature.getMethod(); //获取被拦截的方法
+		HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
+		if (method.isAnnotationPresent(IgnoreSecurity.class)  ) {
+			logger.info("直接过滤url:{}", request.getRequestURI());
+			return pjp.proceed();
+		}
+
+//		String methodName = method.getName(); //获取被拦截的方法名
+	//	logger.info("请求getRequestURI:{}",  request.getRequestURI());
+	//	logger.info("请求getContextPath:{}",  request.getContextPath());
+		String url = request.getRequestURI().replaceFirst(request.getContextPath(), "");
+		logger.info("请求url:{}", url);
+		if ( !StringUtils.startsWith(url, "/wxapi/") && !StringUtils.startsWith(url, "/api/")) {
+            return pjp.proceed();
+        }
+		String token = StringUtils.isBlank(request.getHeader("accessToken")) ? request.getParameter("accessToken") : request.getHeader("accessToken");
+
+	//	logger.info("请求方法:{}", methodName);
+		logger.info("请求token:{}", token);
+		// 检查 token 有效性
+		if (token == null || !tokenManager.checkToken(token)) {
+			String message = String.format("token [%s] is invalid", token);
+			//失效标识
+			String key = "invalid_reason_" + token;
+			String reason = tokenManager.getString(key);
+			//reason为“1”:被强制下线;reason为“2”:被超级管理员挤下线;reason为“3”:资料正在审核中,请重新登录;
+			if (StringUtil.isNotBlank(reason)) {
+				message += (",失效原因为:{" + reason + "}");
+				tokenManager.delString(key);
+			}
+			throw new TokenException(message);
+		}
+        if(method.isAnnotationPresent(ModifySecurity.class)){
+            String requestsNum = tokenManager.getString(token+url);
+            if(requestsNum!=null){
+                String message = String.format("请求太频繁 [%s] 请稍后", token+url);
+                throw new RequestsException(message);
+            }
+            tokenManager.setString(token+url, "1",2);
+        }
+        // 调用目标方法
+        Object obj = pjp.proceed();
+//        tokenManager.delString(token + url);
+        return obj;
+	}
+}

+ 19 - 0
src/main/java/com/ssj/api/security/annotation/IgnoreSecurity.java

@@ -0,0 +1,19 @@
+package com.ssj.api.security.annotation;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * 
+ * 类名称:IgnoreSecurity<br>
+ * 类描述:忽略安全性检查<br>
+ * @version v1.0
+ *
+ */
+@Documented
+@Target(ElementType.METHOD)
+@Retention(RetentionPolicy.RUNTIME)
+public @interface IgnoreSecurity {}

+ 19 - 0
src/main/java/com/ssj/api/security/annotation/ModifySecurity.java

@@ -0,0 +1,19 @@
+package com.ssj.api.security.annotation;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/** 
+ * @author  ZhangCaibao 
+ * @version 2018年7月26日 下午2:57:53 
+ *  类描述:修改安全性检查
+ */
+@Documented
+@Target(ElementType.METHOD)
+@Retention(RetentionPolicy.RUNTIME)
+public @interface ModifySecurity {
+
+}

+ 19 - 0
src/main/java/com/ssj/api/security/annotation/QueryIgnoreSecurity.java

@@ -0,0 +1,19 @@
+package com.ssj.api.security.annotation;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/** 
+ * @author  ZhangCaibao 
+ * @version 2018年7月26日 下午2:57:53 
+ *  类描述:查询忽略安全性检查
+ */
+@Documented
+@Target(ElementType.METHOD)
+@Retention(RetentionPolicy.RUNTIME)
+public @interface QueryIgnoreSecurity {
+
+}

+ 108 - 0
src/main/java/com/ssj/bean/sys/train/bean/ExamInfo.java

@@ -0,0 +1,108 @@
+package com.ssj.bean.sys.train.bean;
+
+import java.util.Date;
+
+import javax.persistence.Entity;
+import javax.persistence.Table;
+
+import com.ssj.bean.common.framework.core.domain.BaseEntity;
+
+@Entity
+@Table(name = "tr_exam_info")
+public class ExamInfo extends BaseEntity {
+	
+	private static final long serialVersionUID = 890135943022798129L;
+ 
+	private Integer roleType;
+	
+	private String videoId;
+	
+	private Integer examNum;
+	
+	private Integer examType;
+	
+	private String title;
+	
+	private String options;
+	
+	private String answer;
+	
+	private Integer score;
+	
+	private Date createTime;
+
+	public Integer getRoleType() {
+		return roleType;
+	}
+
+	public void setRoleType(Integer roleType) {
+		this.roleType = roleType;
+	}
+
+	public String getVideoId() {
+		return videoId;
+	}
+
+	public void setVideoId(String videoId) {
+		this.videoId = videoId;
+	}
+
+	public Integer getExamNum() {
+		return examNum;
+	}
+
+	public void setExamNum(Integer examNum) {
+		this.examNum = examNum;
+	}
+
+	public Integer getExamType() {
+		return examType;
+	}
+
+	public void setExamType(Integer examType) {
+		this.examType = examType;
+	}
+
+	public String getTitle() {
+		return title;
+	}
+
+	public void setTitle(String title) {
+		this.title = title;
+	}
+
+	public String getOptions() {
+		return options;
+	}
+
+	public void setOptions(String options) {
+		this.options = options;
+	}
+
+	public String getAnswer() {
+		return answer;
+	}
+
+	public void setAnswer(String answer) {
+		this.answer = answer;
+	}
+
+	public Date getCreateTime() {
+		return createTime;
+	}
+
+	public void setCreateTime(Date createTime) {
+		this.createTime = createTime;
+	}
+
+	public Integer getScore() {
+		return score;
+	}
+
+	public void setScore(Integer score) {
+		this.score = score;
+	}
+
+	
+	
+}

+ 108 - 0
src/main/java/com/ssj/bean/sys/train/bean/VideoFile.java

@@ -0,0 +1,108 @@
+package com.ssj.bean.sys.train.bean;
+
+import java.util.Date;
+
+import javax.persistence.Entity;
+import javax.persistence.Table;
+
+import com.ssj.bean.common.framework.core.domain.BaseEntity;
+
+@Entity
+@Table(name = "tr_video_file")
+public class VideoFile extends BaseEntity {
+	
+	private static final long serialVersionUID = 890135943022798129L;
+ 
+	private Integer type;
+	
+	private Integer roleType;
+	
+	private String module;
+	
+	private String title;
+	
+	private String url;
+	
+	private String format;
+	
+	private Integer status;
+	
+	private Date createTime;
+	
+	private Date updateTime;
+
+	public Integer getType() {
+		return type;
+	}
+
+	public void setType(Integer type) {
+		this.type = type;
+	}
+
+	public Integer getRoleType() {
+		return roleType;
+	}
+
+	public void setRoleType(Integer roleType) {
+		this.roleType = roleType;
+	}
+
+	public String getModule() {
+		return module;
+	}
+
+	public void setModule(String module) {
+		this.module = module;
+	}
+
+	public String getTitle() {
+		return title;
+	}
+
+	public void setTitle(String title) {
+		this.title = title;
+	}
+	
+	public String getUrl() {
+		return url;
+	}
+
+	public void setUrl(String url) {
+		this.url = url;
+	}
+
+	public Integer getStatus() {
+		return status;
+	}
+
+	public void setStatus(Integer status) {
+		this.status = status;
+	}
+
+	public Date getCreateTime() {
+		return createTime;
+	}
+
+	public void setCreateTime(Date createTime) {
+		this.createTime = createTime;
+	}
+
+	public Date getUpdateTime() {
+		return updateTime;
+	}
+
+	public void setUpdateTime(Date updateTime) {
+		this.updateTime = updateTime;
+	}
+
+	public String getFormat() {
+		return format;
+	}
+
+	public void setFormat(String format) {
+		this.format = format;
+	}
+
+
+	
+}

+ 109 - 0
src/main/java/com/ssj/bean/sys/train/bean/VideoInfo.java

@@ -0,0 +1,109 @@
+package com.ssj.bean.sys.train.bean;
+
+import java.util.Date;
+
+import javax.persistence.Entity;
+import javax.persistence.Table;
+
+import com.ssj.bean.common.framework.core.domain.BaseEntity;
+
+@Entity
+@Table(name = "tr_video_info")
+public class VideoInfo extends BaseEntity {
+	
+	private static final long serialVersionUID = 890135943022798129L;
+ 
+	private Integer roleType;
+	
+	private String module;
+	
+	private String title;
+	
+	private String description;
+	
+	private String url;
+	
+	private Integer indes;
+	
+	private Integer status;
+	
+	private Date createTime;
+	
+	private Date updateTime;
+
+	public Integer getRoleType() {
+		return roleType;
+	}
+
+	public void setRoleType(Integer roleType) {
+		this.roleType = roleType;
+	}
+
+	public String getModule() {
+		return module;
+	}
+
+	public void setModule(String module) {
+		this.module = module;
+	}
+
+	public String getTitle() {
+		return title;
+	}
+
+	public void setTitle(String title) {
+		this.title = title;
+	}
+
+	public String getDescription() {
+		return description;
+	}
+
+	public void setDescription(String description) {
+		this.description = description;
+	}
+
+	public String getUrl() {
+		return url;
+	}
+
+	public void setUrl(String url) {
+		this.url = url;
+	}
+
+	
+
+	public Integer getIndes() {
+		return indes;
+	}
+
+	public void setIndes(Integer indes) {
+		this.indes = indes;
+	}
+
+	public Integer getStatus() {
+		return status;
+	}
+
+	public void setStatus(Integer status) {
+		this.status = status;
+	}
+
+	public Date getCreateTime() {
+		return createTime;
+	}
+
+	public void setCreateTime(Date createTime) {
+		this.createTime = createTime;
+	}
+
+	public Date getUpdateTime() {
+		return updateTime;
+	}
+
+	public void setUpdateTime(Date updateTime) {
+		this.updateTime = updateTime;
+	}
+	
+	
+}

+ 98 - 0
src/main/java/com/ssj/bean/sys/train/bean/VideoUser.java

@@ -0,0 +1,98 @@
+package com.ssj.bean.sys.train.bean;
+
+import java.util.Date;
+
+import javax.persistence.Entity;
+import javax.persistence.Table;
+
+import com.ssj.bean.common.framework.core.domain.BaseEntity;
+
+@Entity
+@Table(name = "tr_video_user")
+public class VideoUser extends BaseEntity {
+	
+	private static final long serialVersionUID = 890135943022798129L;
+ 
+	private Integer roleType;
+	
+	private String module;
+	
+	private String userId;
+	
+	private String videoId;
+	
+	private String answerRecord;
+	
+	private Integer score;
+	
+	private Integer status;
+	
+	private Date createTime;
+
+	public Integer getRoleType() {
+		return roleType;
+	}
+
+	public void setRoleType(Integer roleType) {
+		this.roleType = roleType;
+	}
+
+	public String getModule() {
+		return module;
+	}
+
+	public void setModule(String module) {
+		this.module = module;
+	}
+
+	public String getUserId() {
+		return userId;
+	}
+
+	public void setUserId(String userId) {
+		this.userId = userId;
+	}
+
+	public String getVideoId() {
+		return videoId;
+	}
+
+	public void setVideoId(String videoId) {
+		this.videoId = videoId;
+	}
+
+	public Date getCreateTime() {
+		return createTime;
+	}
+
+	public void setCreateTime(Date createTime) {
+		this.createTime = createTime;
+	}
+
+	public String getAnswerRecord() {
+		return answerRecord;
+	}
+
+	public void setAnswerRecord(String answerRecord) {
+		this.answerRecord = answerRecord;
+	}
+
+	public Integer getScore() {
+		return score;
+	}
+
+	public void setScore(Integer score) {
+		this.score = score;
+	}
+
+	public Integer getStatus() {
+		return status;
+	}
+
+	public void setStatus(Integer status) {
+		this.status = status;
+	}
+	
+	
+	
+}

+ 1 - 1
src/main/java/com/ssj/transaction/config/TransactionConfiguration.java

@@ -1,4 +1,4 @@
-package com.ssj.transaction.config;
+package com.ssj.config;
 
 import org.aspectj.lang.annotation.Aspect;
 import org.springframework.aop.Advisor;

+ 18 - 0
src/main/java/com/ssj/dao/sys/train/dao/ExamInfoDao.java

@@ -0,0 +1,18 @@
+package com.ssj.dao.sys.train.dao;
+
+import java.util.List;
+
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.Query;
+import org.springframework.stereotype.Repository;
+
+import com.ssj.bean.sys.train.bean.ExamInfo;
+
+
+@Repository
+public interface ExamInfoDao extends JpaRepository<ExamInfo, String> {
+
+	@Query(nativeQuery = true,value = "SELECT * from tr_exam_info t WHERE t.video_id=?1 ORDER BY t.exam_num asc ")
+	List<ExamInfo> findExamInfoByVideoId(String videoId);
+
+}

+ 27 - 0
src/main/java/com/ssj/dao/sys/train/dao/TrainQueryDao.java

@@ -0,0 +1,27 @@
+package com.ssj.dao.sys.train.dao;
+
+import java.util.List;
+import java.util.Map;
+
+import org.springframework.data.domain.Page;
+import org.springframework.data.domain.Pageable;
+
+public interface TrainQueryDao {
+
+	public Page<Map<String, Object>> findTrainVideoInfoByPage(Map<String, Object> params, Pageable pageable);
+	
+	public Page<Map<String, Object>> findMerchantTeaNumByPage(Map<String, Object> params, Pageable pageable);
+	
+	public Page<Map<String, Object>> findTeaInfoNumByPage(Map<String, Object> params, Pageable pageable);
+	
+	public Map<String, Object> findTrainVideoUserByPage(Map<String, Object> params);
+
+	public List<Map<String, Object>> findTrainVideoUserByUserId(String userId);
+	
+	public List<Map<String, Object>> findTrainVideoUserByRoleType(String userId,Integer roleType,String module);
+	
+	public List<Map<String, Object>> findVideoFileByType();
+	
+	public Page<Map<String, Object>> findVideoFileByPage(Map<String, Object> params, Pageable pageable);
+
+}

+ 14 - 0
src/main/java/com/ssj/dao/sys/train/dao/VideoFileDao.java

@@ -0,0 +1,14 @@
+package com.ssj.dao.sys.train.dao;
+
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.stereotype.Repository;
+
+import com.ssj.bean.sys.train.bean.VideoFile;
+
+
+@Repository
+public interface VideoFileDao extends JpaRepository<VideoFile, String> {
+	
+	
+	
+}

+ 15 - 0
src/main/java/com/ssj/dao/sys/train/dao/VideoInfoDao.java

@@ -0,0 +1,15 @@
+package com.ssj.dao.sys.train.dao;
+
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.Query;
+import org.springframework.stereotype.Repository;
+
+import com.ssj.bean.sys.train.bean.VideoInfo;
+
+
+@Repository
+public interface VideoInfoDao extends JpaRepository<VideoInfo, String> {
+
+	@Query(nativeQuery = true,value =  "SELECT * FROM tr_video_info t WHERE t.`status`=1 AND t.role_type=?1 AND t.indes>( SELECT v.indes from `tr_video_info` v WHERE v.id=?2 ) ORDER BY t.indes ASC LIMIT 1 ")
+	public VideoInfo getVideoInfoByMax(Integer roleType,String id);
+}

+ 18 - 0
src/main/java/com/ssj/dao/sys/train/dao/VideoUserDao.java

@@ -0,0 +1,18 @@
+package com.ssj.dao.sys.train.dao;
+
+import java.util.List;
+
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.Query;
+import org.springframework.stereotype.Repository;
+
+import com.ssj.bean.sys.train.bean.VideoUser;
+
+
+@Repository
+public interface VideoUserDao extends JpaRepository<VideoUser, String> {
+
+	@Query(nativeQuery = true,value =  " SELECT * from tr_video_user t WHERE t.`status`=1 AND t.role_type=?1 AND t.user_id=?2  ORDER BY t.create_time asc  ")
+	public List<VideoUser> findVideoUserByUserIdAndRoleType(Integer roleType,String userId);
+
+}

+ 232 - 0
src/main/java/com/ssj/dao/sys/train/dao/impl/TrainQueryDaoImpl.java

@@ -0,0 +1,232 @@
+package com.ssj.dao.sys.train.dao.impl;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.domain.Page;
+import org.springframework.data.domain.Pageable;
+import org.springframework.stereotype.Repository;
+
+import com.ssj.dao.sys.train.dao.TrainQueryDao;
+import com.ssj.framework.core.persistence.PagingHibernateJdbcDao;
+
+@Repository
+public class TrainQueryDaoImpl  implements TrainQueryDao {
+
+    @Autowired
+    private PagingHibernateJdbcDao dao;
+    
+    @Override
+	public Page<Map<String, Object>> findTrainVideoInfoByPage(Map<String, Object> params, Pageable pageable) {
+		StringBuilder sb = new StringBuilder();
+		List<Object> param = new ArrayList<>();
+        sb.append(" SELECT * from tr_video_info t WHERE 1=1 ");
+        if(params.get("roleType")!=null && StringUtils.isNotEmpty(params.get("roleType").toString())) {
+       	 	sb.append(" t.role_type=?  ");
+       	 	param.add(params.get("roleType"));
+        }
+        if(params.get("module")!=null && StringUtils.isNotEmpty(params.get("module").toString())) {
+        	sb.append(" and t.module like concat('%',?,'%')  ");
+        	param.add(params.get("module"));
+        }
+        if(params.get("title")!=null && StringUtils.isNotEmpty(params.get("title").toString())) {
+       	  	sb.append(" and t.title like concat('%',?,'%')  ");
+       	  	param.add(params.get("title"));
+        }
+        if(params.get("status")!=null && StringUtils.isNotEmpty(params.get("status").toString())) {
+       	  	sb.append(" and t.status =? ");
+       	  	param.add(params.get("status"));
+        }
+        sb.append(" ORDER BY t.indes ASC,t.create_time DESC ");
+        return dao.findPage(sb.toString(),param.toArray(),pageable);
+	}
+
+	@Override
+	public Page<Map<String, Object>> findMerchantTeaNumByPage(Map<String, Object> params, Pageable pageable) {
+		StringBuilder sb = new StringBuilder();
+		List<Object> param = new ArrayList<>();
+        sb.append(" SELECT 	t.unit_name,t.id,t.pos_code,t.lib_id, ");
+        sb.append(" (SELECT COUNT(DISTINCT m.id) from tr_video_info m WHERE m.role_type=1 AND m.`status`=1 ) as role_num_1, ");
+        sb.append(" (SELECT COUNT(DISTINCT m.id) from tr_video_info m WHERE m.role_type=2 AND m.`status`=1 ) as role_num_2, ");
+        sb.append(" (SELECT COUNT(DISTINCT m.id) from tr_video_info m WHERE m.role_type=3 AND m.`status`=1 ) as role_num_3, ");
+        sb.append(" (SELECT COUNT(DISTINCT m.id) from tr_video_info m WHERE m.role_type=4 AND m.`status`=1 ) as role_num_4, ");
+        sb.append(" (SELECT COUNT(DISTINCT m.user_id) from tb_lib_manager m WHERE m.type=6 AND m.lib_id=t.lib_id) as pal_num, ");
+        sb.append(" (SELECT COUNT(DISTINCT m.user_id) from tb_lib_manager m WHERE m.lib_id=t.lib_id) as tea_num ");
+        sb.append(" from fx_merchant t WHERE 1=1 AND t.lib_id is not null ");
+        if(params.get("unitName")!=null && StringUtils.isNotEmpty(params.get("unitName").toString())) {
+       	 	sb.append(" AND t.unit_name like concat('%',?,'%') ");
+       	 	param.add(params.get("unitName"));
+        }
+        sb.append(" ORDER BY t.create_time desc ");
+        return dao.findPage(sb.toString(),param.toArray(),pageable);
+	}
+
+	@Override
+	public Page<Map<String, Object>> findTeaInfoNumByPage(Map<String, Object> params, Pageable pageable) {
+		StringBuilder sb = new StringBuilder();
+		List<Object> param = new ArrayList<>();
+        sb.append(" SELECT   *, ");
+        sb.append(" ( SELECT IFNULL(COUNT(DISTINCT u.user_id),0) from tr_video_user u LEFT JOIN tr_video_info i ON u.video_id=i.id WHERE i.`status`=1 AND u.`status`=1 AND u.role_type=1 AND u.user_id=t.user_id 	) as role_count_1,");
+        sb.append(" ( SELECT IFNULL(COUNT(DISTINCT u.user_id),0) from tr_video_user u LEFT JOIN tr_video_info i ON u.video_id=i.id WHERE i.`status`=1 AND u.`status`=1 AND u.role_type=2 AND u.user_id=t.user_id 	) as role_count_2,");
+        sb.append(" ( SELECT IFNULL(COUNT(DISTINCT u.user_id),0) from tr_video_user u LEFT JOIN tr_video_info i ON u.video_id=i.id WHERE i.`status`=1 AND u.`status`=1 AND u.role_type=3 AND u.user_id=t.user_id 	) as role_count_3,");
+        sb.append(" ( SELECT IFNULL(COUNT(DISTINCT u.user_id),0) from tr_video_user u LEFT JOIN tr_video_info i ON u.video_id=i.id WHERE i.`status`=1 AND u.`status`=1 AND u.role_type=4 AND u.user_id=t.user_id 	) as role_count_4,");
+       
+        sb.append(" (SELECT COUNT(DISTINCT m.id) from tr_video_info m WHERE m.role_type=1 AND m.`status`=1) as role_num_1, ");
+        sb.append(" (SELECT COUNT(DISTINCT m.id) from tr_video_info m WHERE m.role_type=2 AND m.`status`=1) as role_num_2, ");
+        sb.append(" (SELECT COUNT(DISTINCT m.id) from tr_video_info m WHERE m.role_type=3 AND m.`status`=1) as role_num_3, ");
+        sb.append(" (SELECT COUNT(DISTINCT m.id) from tr_video_info m WHERE m.role_type=4 AND m.`status`=1) as role_num_4  ");
+        
+        sb.append(" from tb_lib_manager t WHERE 1=1 ");
+        sb.append(" AND t.lib_id=?   ");
+        param.add(params.get("libId"));
+       
+        if(params.get("type")!=null && StringUtils.isNotEmpty(params.get("type").toString())) {
+        	 sb.append(" AND t.type=? ");
+        	 param.add(params.get("type"));
+        }
+        if(params.get("name")!=null && StringUtils.isNotEmpty(params.get("name").toString())) {
+        	sb.append(" AND t.name like concat('%',?,'%') ");
+       	 	param.add(params.get("name"));
+        }
+        sb.append(" GROUP BY t.user_id ");
+        sb.append(" ORDER BY t.create_time desc ");
+        return dao.findPage(sb.toString(),param.toArray(),pageable);
+	}
+	
+	
+	
+	@Override
+	public Map<String, Object> findTrainVideoUserByPage(Map<String, Object> params) {
+		StringBuilder sb = new StringBuilder();
+		List<Object> param = new ArrayList<>();
+		sb.append(" SELECT  ");
+		sb.append(" 	(SELECT COUNT(*)  from ( ");
+		sb.append(" 		SELECT  u.user_id,COUNT(DISTINCT u.video_id) AS count from tr_video_user u");
+		sb.append(" 		LEFT JOIN tr_video_info i ON u.video_id=i.id");
+		sb.append(" 		LEFT JOIN tb_lib_manager m ON u.user_id=m.user_id");
+		sb.append(" 		WHERE i.`status`=1 AND u.`status`=1 AND u.role_type=1 AND m.lib_id=? ");
+		sb.append(" 		GROUP BY u.user_id ");
+		sb.append(" 		HAVING count>=? ");
+		sb.append(" 	) as tmp) as role_count_1, ");
+		param.add(params.get("lib_id"));
+	    param.add(params.get("role_num_1"));
+		
+		sb.append(" 	(SELECT COUNT(*)  from ( ");
+		sb.append(" 		SELECT  u.user_id,COUNT(DISTINCT u.video_id) AS count from tr_video_user u");
+		sb.append(" 		LEFT JOIN tr_video_info i ON u.video_id=i.id");
+		sb.append(" 		LEFT JOIN tb_lib_manager m ON u.user_id=m.user_id");
+		sb.append(" 		WHERE i.`status`=1 AND u.`status`=1 AND u.role_type=2 AND m.lib_id=? ");
+		sb.append(" 		GROUP BY u.user_id ");
+		sb.append(" 		HAVING count>=? ");
+		sb.append(" 	) as tmp) as role_count_2, ");
+		param.add(params.get("lib_id"));
+	    param.add(params.get("role_num_2"));
+	    
+	    
+	    sb.append(" 	(SELECT COUNT(*)  from ( ");
+		sb.append(" 		SELECT  u.user_id,COUNT(DISTINCT u.video_id) AS count from tr_video_user u");
+		sb.append(" 		LEFT JOIN tr_video_info i ON u.video_id=i.id");
+		sb.append(" 		LEFT JOIN tb_lib_manager m ON u.user_id=m.user_id");
+		sb.append(" 		WHERE i.`status`=1 AND u.`status`=1 AND u.role_type=3 AND m.lib_id=? ");
+		sb.append(" 		GROUP BY u.user_id ");
+		sb.append(" 		HAVING count>=? ");
+		sb.append(" 	) as tmp) as role_count_3, ");
+		param.add(params.get("lib_id"));
+	    param.add(params.get("role_num_3"));
+	    
+	    sb.append(" 	(SELECT COUNT(*)  from ( ");
+  		sb.append(" 		SELECT  u.user_id,COUNT(DISTINCT u.video_id) AS count from tr_video_user u");
+  		sb.append(" 		LEFT JOIN tr_video_info i ON u.video_id=i.id");
+  		sb.append(" 		LEFT JOIN tb_lib_manager m ON u.user_id=m.user_id");
+  		sb.append(" 		WHERE i.`status`=1 AND u.`status`=1 AND u.role_type=4 AND m.lib_id=? ");
+  		sb.append(" 		GROUP BY u.user_id ");
+  		sb.append(" 		HAVING count>=? ");
+  		sb.append(" 	) as tmp) as role_count_4 ");
+  		param.add(params.get("lib_id"));
+  	    param.add(params.get("role_num_4"));
+  	    
+  	    List<Map<String, Object>> list= dao.findMap(sb.toString(),param.toArray());
+  	    
+        return list!=null && list.size()>0 ? list.get(0): new HashMap<String, Object>();
+	}
+
+	@Override
+	public List<Map<String, Object>> findTrainVideoUserByUserId(String userId) {
+		StringBuilder sb = new StringBuilder();
+		List<Object> param = new ArrayList<>();
+        sb.append(" SELECT ");
+        sb.append(" t.role_type as role_type, ");
+        sb.append(" COUNT(*) as count_num,  ");
+        sb.append(" ( ");
+        sb.append("  	SELECT COUNT(DISTINCT u.video_id)  from tr_video_user u ");
+        sb.append("  	LEFT JOIN tr_video_info i ON u.video_id=i.id");
+        sb.append("  	WHERE i.`status`=1 AND u.`status`=1 AND t.role_type=u.role_type AND u.user_id=? ");
+        sb.append(" ) as success_num ");
+        sb.append(" from tr_video_info t WHERE t.`status`=1 GROUP BY t.role_type ORDER BY t.role_type ");
+        param.add(userId);
+        return dao.findMap(sb.toString(),param.toArray());
+	}
+
+	@Override
+	public List<Map<String, Object>> findTrainVideoUserByRoleType(String userId, Integer roleType, String module) {
+		StringBuilder sb = new StringBuilder();
+		List<Object> param = new ArrayList<>();
+        sb.append(" SELECT *, ");
+        sb.append(" (SELECT count(DISTINCT u.video_id) from tr_video_user u WHERE u.video_id=t.id AND u.user_id=? AND u.`status`=1  ) as un_lock ");
+        sb.append(" from tr_video_info t   ");
+        sb.append(" WHERE t.`status`=1  ");
+        param.add(userId);
+        if(roleType!=null) {
+	        sb.append("  AND t.role_type=?  ");
+	     	param.add(roleType);
+        }
+        if(StringUtils.isNotEmpty(module)) {
+        	sb.append("  AND t.module=?  ");
+        	param.add(module);
+        }
+        sb.append("  ORDER BY t.indes asc ");
+        return dao.findMap(sb.toString(),param.toArray());
+	}
+
+	@Override
+	public List<Map<String, Object>> findVideoFileByType() {
+		StringBuilder sb = new StringBuilder();
+		List<Object> param = new ArrayList<>();
+        sb.append(" SELECT t.role_type,	t.url, ");
+        sb.append(" (SELECT count(1) from `tr_video_file` f WHERE f.`status`=1 AND f.type=2 AND f.role_type=t.role_type) as num  ");
+        sb.append(" FROM  `tr_video_file` t WHERE  t.`status`=1 AND t.type=1 GROUP BY t.role_type  ORDER BY t.role_type ASC ");
+        return dao.findMap(sb.toString(),param.toArray());
+	}
+
+	@Override
+	public Page<Map<String, Object>> findVideoFileByPage(Map<String, Object> params, Pageable pageable) {
+		StringBuilder sb = new StringBuilder();
+		List<Object> param = new ArrayList<>();
+        sb.append(" SELECT * from tr_video_file t WHERE t.`status`=1  ");
+        if(params.get("type")!=null && StringUtils.isNotEmpty(params.get("type").toString())) {
+       	 	sb.append(" AND t.type=?  ");
+       	 	param.add(params.get("type"));
+        }
+        if(params.get("roleType")!=null && StringUtils.isNotEmpty(params.get("roleType").toString())) {
+       	 	sb.append(" AND t.role_type=?  ");
+       	 	param.add(params.get("roleType"));
+        }
+        if(params.get("module")!=null && StringUtils.isNotEmpty(params.get("module").toString())) {
+        	sb.append(" AND t.module=?  ");
+        	param.add(params.get("module"));
+        }
+        if(params.get("name")!=null && StringUtils.isNotEmpty(params.get("name").toString())) {
+       	  	sb.append(" AND t.title like concat('%',?,'%')  ");
+       	  	param.add(params.get("name"));
+        }
+        sb.append("  ORDER BY t.create_time DESC ");
+        return dao.findPage(sb.toString(),param.toArray(),pageable);
+	}
+
+	
+	
+}

+ 22 - 0
src/main/java/com/ssj/framework/core/common/controller/BaseController.java

@@ -1,5 +1,9 @@
 package com.ssj.framework.core.common.controller;
 import com.ssj.bean.sys.role.domain.Admin;
+import com.ssj.bean.weixin.user.domain.UserAccount;
+import com.ssj.framework.core.security.manager.TokenManager;
+import com.ssj.service.weixin.user.service.UserAccountService;
+
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -30,6 +34,13 @@ public abstract class BaseController {
 
     @Autowired
     protected HttpServletResponse response;
+    
+    @Autowired
+    protected UserAccountService userAccountService;
+    
+    @Autowired
+    protected TokenManager tokenManager;
+	
 
     /**
      * 绑定字符过滤编辑器
@@ -134,4 +145,15 @@ public abstract class BaseController {
         }
         return resultMap;
     }
+    
+    protected String getAccessToken(String userId,String accessToken){
+        UserAccount userAccount = userAccountService.findByUserIdAndType(userId,11);
+        if(userAccount == null) {
+            accessToken = tokenManager.createToken(accessToken, userId, "APP_TEACHER");
+        }else {
+            accessToken = tokenManager.createToken(accessToken, userId, userAccount.getOpenid(), 4, userAccount.getUnionid(),"APP_TEACHER");
+        }
+        return accessToken;
+    }
+    
 }

+ 17 - 0
src/main/java/com/ssj/framework/core/util/HttpRemote.java

@@ -246,4 +246,21 @@ public class HttpRemote {
         }
         return null;
     }
+    
+    
+    
+    
+    public static void main(String[] args) throws Exception {
+		
+    	Map<String, Object> argsMap=new HashMap<String, Object>();
+    	argsMap.put("section", "xxhearing");
+    	argsMap.put("type", "file");
+    	argsMap.put("id", "793");
+    	argsMap.put("UserId", "");
+    	argsMap.put("Token", "");
+    	
+		String html=POSTMethod("http://api.zhibuji.com/zhi53/api/Common/QRCodeParse", argsMap);
+    	System.out.println(html);
+    	
+	}
 }

+ 13 - 0
src/main/java/com/ssj/service/sys/train/service/ExamInfoService.java

@@ -0,0 +1,13 @@
+package com.ssj.service.sys.train.service;
+
+import java.util.List;
+
+import com.ssj.bean.sys.train.bean.ExamInfo;
+import com.ssj.framework.core.common.service.BaseService;
+
+
+public interface ExamInfoService extends BaseService<ExamInfo, String> {
+
+	List<ExamInfo> findExamInfoByVideoId(String videoId);
+	
+}

+ 19 - 0
src/main/java/com/ssj/service/sys/train/service/VideoFileService.java

@@ -0,0 +1,19 @@
+package com.ssj.service.sys.train.service;
+
+import java.util.List;
+import java.util.Map;
+
+import org.springframework.data.domain.Page;
+import org.springframework.data.domain.Pageable;
+
+import com.ssj.bean.sys.train.bean.VideoFile;
+import com.ssj.framework.core.common.service.BaseService;
+
+
+public interface VideoFileService extends BaseService<VideoFile, String> {
+
+	public List<Map<String, Object>> findVideoFileByType();
+	
+	public Page<Map<String, Object>> findVideoFileByPage(Map<String, Object> params, Pageable pageable) ;
+	 
+}

+ 23 - 0
src/main/java/com/ssj/service/sys/train/service/VideoInfoService.java

@@ -0,0 +1,23 @@
+package com.ssj.service.sys.train.service;
+
+import java.util.List;
+import java.util.Map;
+
+import org.springframework.data.domain.Page;
+import org.springframework.data.domain.Pageable;
+
+import com.ssj.bean.sys.train.bean.VideoInfo;
+import com.ssj.framework.core.common.service.BaseService;
+
+
+public interface VideoInfoService extends BaseService<VideoInfo, String> {
+
+	public Page<Map<String, Object>> findTrainVideoInfoByPage(Map<String, Object> params, Pageable pageable);
+	
+	public Page<Map<String, Object>> findMerchantTeaNumByPage(Map<String, Object> params, Pageable pageable);
+	
+	public List<Map<String, Object>> findTrainVideoUserByRoleType(String userId,Integer roleType,String module);
+	
+	public VideoInfo getVideoInfoByMax(Integer roleType,String id);
+	
+}

+ 24 - 0
src/main/java/com/ssj/service/sys/train/service/VideoUserService.java

@@ -0,0 +1,24 @@
+package com.ssj.service.sys.train.service;
+
+import java.util.List;
+import java.util.Map;
+
+import org.springframework.data.domain.Page;
+import org.springframework.data.domain.Pageable;
+
+import com.ssj.bean.sys.train.bean.VideoUser;
+import com.ssj.framework.core.common.service.BaseService;
+
+
+public interface VideoUserService extends BaseService<VideoUser, String> {
+
+	public Page<Map<String, Object>> findTeaInfoNumByPage(Map<String, Object> params, Pageable pageable);
+	
+	public Map<String, Object> findTrainVideoUserByPage(Map<String, Object> params);
+	
+	public List<Map<String, Object>> findTrainVideoUserByUserId(String userId);
+	
+	public List<VideoUser> findVideoUserByUserIdAndRoleType(Integer roleType,String userId);
+	
+	
+}

+ 36 - 0
src/main/java/com/ssj/service/sys/train/service/impl/ExamInfoServiceImpl.java

@@ -0,0 +1,36 @@
+package com.ssj.service.sys.train.service.impl;
+
+import java.util.List;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.repository.PagingAndSortingRepository;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import com.ssj.bean.sys.train.bean.ExamInfo;
+import com.ssj.dao.sys.train.dao.ExamInfoDao;
+import com.ssj.dao.sys.train.dao.TrainQueryDao;
+import com.ssj.framework.core.common.service.BaseServiceImpl;
+import com.ssj.service.sys.train.service.ExamInfoService;
+
+@Service
+@Transactional
+public class ExamInfoServiceImpl extends BaseServiceImpl<ExamInfo, String> implements ExamInfoService {
+
+    @Autowired
+    private ExamInfoDao examInfoDao;
+    
+    @Autowired
+    private TrainQueryDao trainQueryDao;
+
+    @Override
+	public PagingAndSortingRepository<ExamInfo, String> getDao() {
+		return examInfoDao;
+	}
+
+	@Override
+	public List<ExamInfo> findExamInfoByVideoId(String videoId) {
+		return examInfoDao.findExamInfoByVideoId(videoId);
+	}
+
+}

+ 47 - 0
src/main/java/com/ssj/service/sys/train/service/impl/VideoFileServiceImpl.java

@@ -0,0 +1,47 @@
+package com.ssj.service.sys.train.service.impl;
+
+import java.util.List;
+import java.util.Map;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.domain.Page;
+import org.springframework.data.domain.Pageable;
+import org.springframework.data.repository.PagingAndSortingRepository;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import com.ssj.bean.sys.train.bean.VideoFile;
+import com.ssj.dao.sys.train.dao.TrainQueryDao;
+import com.ssj.dao.sys.train.dao.VideoFileDao;
+import com.ssj.framework.core.common.service.BaseServiceImpl;
+import com.ssj.service.sys.train.service.VideoFileService;
+
+@Service
+@Transactional
+public class VideoFileServiceImpl extends BaseServiceImpl<VideoFile, String> implements VideoFileService {
+
+    @Autowired
+    private VideoFileDao videoFileDao;
+    
+    @Autowired
+    private TrainQueryDao trainQueryDao;	
+
+    @Override
+	public PagingAndSortingRepository<VideoFile, String> getDao() {
+		return videoFileDao;
+	}
+
+
+	@Override
+	public List<Map<String, Object>> findVideoFileByType() {
+		return trainQueryDao.findVideoFileByType();
+	}
+    
+	@Override
+	public Page<Map<String, Object>> findVideoFileByPage(Map<String, Object> params, Pageable pageable) {
+		return trainQueryDao.findVideoFileByPage(params, pageable);
+	}
+
+    
+}
+

+ 56 - 0
src/main/java/com/ssj/service/sys/train/service/impl/VideoInfoServiceImpl.java

@@ -0,0 +1,56 @@
+package com.ssj.service.sys.train.service.impl;
+
+import java.util.List;
+import java.util.Map;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.domain.Page;
+import org.springframework.data.domain.Pageable;
+import org.springframework.data.repository.PagingAndSortingRepository;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import com.ssj.bean.sys.train.bean.VideoInfo;
+import com.ssj.dao.sys.train.dao.TrainQueryDao;
+import com.ssj.dao.sys.train.dao.VideoInfoDao;
+import com.ssj.framework.core.common.service.BaseServiceImpl;
+import com.ssj.service.sys.train.service.VideoInfoService;
+
+@Service
+@Transactional
+public class VideoInfoServiceImpl extends BaseServiceImpl<VideoInfo, String> implements VideoInfoService {
+
+    @Autowired
+    private VideoInfoDao videoInfoDao;
+    
+    @Autowired
+    private TrainQueryDao trainQueryDao;
+
+    @Override
+	public PagingAndSortingRepository<VideoInfo, String> getDao() {
+		return videoInfoDao;
+	}
+
+	@Override
+	public Page<Map<String, Object>> findTrainVideoInfoByPage(Map<String, Object> params, Pageable pageable) {
+		return trainQueryDao.findTrainVideoInfoByPage(params, pageable);
+	}
+
+	@Override
+	public Page<Map<String, Object>> findMerchantTeaNumByPage(Map<String, Object> params, Pageable pageable) {
+		return trainQueryDao.findMerchantTeaNumByPage(params, pageable);
+	}
+
+	@Override
+	public List<Map<String, Object>> findTrainVideoUserByRoleType(String userId, Integer roleType, String module) {
+		return trainQueryDao.findTrainVideoUserByRoleType(userId, roleType, module);
+	}
+
+	@Override
+	public VideoInfo getVideoInfoByMax(Integer roleType, String id) {
+		return videoInfoDao.getVideoInfoByMax(roleType, id);
+	}
+	
+	
+
+}

+ 56 - 0
src/main/java/com/ssj/service/sys/train/service/impl/VideoUserServiceImpl.java

@@ -0,0 +1,56 @@
+package com.ssj.service.sys.train.service.impl;
+
+import java.util.List;
+import java.util.Map;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.domain.Page;
+import org.springframework.data.domain.Pageable;
+import org.springframework.data.repository.PagingAndSortingRepository;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import com.ssj.bean.sys.train.bean.VideoUser;
+import com.ssj.dao.sys.train.dao.TrainQueryDao;
+import com.ssj.dao.sys.train.dao.VideoUserDao;
+import com.ssj.framework.core.common.service.BaseServiceImpl;
+import com.ssj.service.sys.train.service.VideoUserService;
+
+@Service
+@Transactional
+public class VideoUserServiceImpl extends BaseServiceImpl<VideoUser, String> implements VideoUserService {
+
+    @Autowired
+    private VideoUserDao videoUserDao;
+    
+    @Autowired
+    private TrainQueryDao trainQueryDao;
+
+    @Override
+	public PagingAndSortingRepository<VideoUser, String> getDao() {
+		return videoUserDao;
+	}
+
+    @Override
+	public Page<Map<String, Object>> findTeaInfoNumByPage(Map<String, Object> params, Pageable pageable) {
+		return trainQueryDao.findTeaInfoNumByPage(params, pageable);
+	}
+    
+	@Override
+	public Map<String, Object> findTrainVideoUserByPage(Map<String, Object> params) {
+		return trainQueryDao.findTrainVideoUserByPage(params);
+	}
+
+	@Override
+	public List<Map<String, Object>> findTrainVideoUserByUserId(String userId) {
+		return trainQueryDao.findTrainVideoUserByUserId(userId);
+	}
+
+	@Override
+	public List<VideoUser> findVideoUserByUserIdAndRoleType(Integer roleType, String userId) {
+		return videoUserDao.findVideoUserByUserIdAndRoleType(roleType, userId);
+	}
+
+	
+
+}

+ 5 - 0
src/main/java/com/ssj/service/weixin/user/service/impl/UserServiceImpl.java

@@ -686,6 +686,11 @@ public class UserServiceImpl extends BaseServiceImpl<User, String> implements Us
 		}
 		return false;
 	}
+	
+	public static void main(String[] args) {
+		System.out.println(PasswordUtil.initPassword("123456", "123456"));
+		
+	}
 
 	@Override
 	public ResponseEntity bindWeixin(String accessToken, AppWxUserInfo appWxUserInfo) {

+ 285 - 0
src/main/java/com/ssj/sys/controller/TrainController.java

@@ -0,0 +1,285 @@
+package com.ssj.sys.controller;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.domain.Page;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.multipart.MultipartFile;
+
+import com.ssj.bean.common.framework.core.domain.Response;
+import com.ssj.bean.sys.train.bean.ExamInfo;
+import com.ssj.bean.sys.train.bean.VideoFile;
+import com.ssj.bean.sys.train.bean.VideoInfo;
+import com.ssj.framework.basic.common.bean.SplitPage;
+import com.ssj.framework.core.common.controller.BaseController;
+import com.ssj.framework.core.util.ResponseEntity;
+import com.ssj.service.sys.train.service.ExamInfoService;
+import com.ssj.service.sys.train.service.VideoFileService;
+import com.ssj.service.sys.train.service.VideoInfoService;
+import com.ssj.service.sys.train.service.VideoUserService;
+
+@RequestMapping("sys/train")
+@Controller
+public class TrainController extends BaseController {
+
+	@Autowired
+	private ExamInfoService examInfoService;
+
+	@Autowired
+	private VideoFileService videoFileService;
+	
+	@Autowired
+	private VideoInfoService videoInfoService;
+	
+	@Autowired
+	private VideoUserService videoUserService;
+	
+	@RequestMapping("/video/list")
+	public String videoList(Model model,
+			@RequestParam(required = false, defaultValue = "10") int pageSize,
+			@RequestParam(required = false, defaultValue = "1") int pageNo)
+			throws Exception {
+		
+		Map<String, Object> params = new HashMap<String, Object>();
+		params.put("rolType", request.getParameter("rolType")==null?"":request.getParameter("rolType"));
+		params.put("module", request.getParameter("module")==null?"":request.getParameter("module"));
+		params.put("title", request.getParameter("title")==null?"":request.getParameter("title"));
+		params.put("index", request.getParameter("index")==null?"":request.getParameter("index"));
+		
+		SplitPage sp = new SplitPage();
+        sp.setAction(request.getRequestURI());
+        sp.setPageNo(pageNo);
+        sp.setPageSize(pageSize);
+        sp.setParams(params);
+        Page<Map<String,Object>> page = videoInfoService.findTrainVideoInfoByPage(params, initPage(pageNo, pageSize));
+        List<Map<String,Object>> list=page.getContent();
+       
+        sp.setRowCnt((int) page.getTotalElements());
+        model.addAttribute("list",list);
+        model.addAttribute("listNavigatHtml", sp.getSysPaginHtml());
+        model.addAttribute("page", sp);
+        model.addAttribute("search", params);
+		return "sys/train/video_list";
+	}
+	
+	
+	@RequestMapping("/video/edit")
+	public String videoEdit(Model model,String id)
+			throws Exception {
+		VideoInfo videoInfo=new VideoInfo();
+		if(StringUtils.isNotEmpty(id)) {
+			videoInfo=videoInfoService.getById(id);
+		}
+		model.addAttribute("videoInfo",videoInfo);
+		return "sys/train/video_edit";
+	}
+	
+
+	 @RequestMapping("/video/save")
+	 @ResponseBody
+	 public Response videoSave(VideoInfo param) throws Exception{
+    	Response response = new  Response();
+    	if(StringUtils.isNotEmpty(param.getId())) {
+	    	VideoInfo videoInfo=videoInfoService.getById(param.getId());
+	    	videoInfo.setDescription(param.getDescription());
+	    	videoInfo.setIndes(param.getIndes());
+	    	videoInfo.setModule(param.getModule());
+	    	videoInfo.setRoleType(param.getRoleType());
+	    	videoInfo.setStatus(param.getStatus());
+	    	videoInfo.setTitle(param.getTitle());
+	    	videoInfo.setUpdateTime(new Date());
+	    	videoInfoService.save(videoInfo);
+    	}else {
+    		param.setCreateTime(new Date());
+    		videoInfoService.save(param);
+    	}
+    	response.success();
+    	return response;
+	 }
+	
+	
+	
+
+	
+	@RequestMapping("/pace/list")
+	public String paceList(Model model,
+			@RequestParam(required = false, defaultValue = "10") int pageSize,
+			@RequestParam(required = false, defaultValue = "1") int pageNo)
+			throws Exception { 
+		
+		Map<String, Object> params = new HashMap<String, Object>();
+		params.put("unitName", request.getParameter("unitName")==null?"":request.getParameter("unitName"));
+		
+		SplitPage sp = new SplitPage();
+        sp.setAction(request.getRequestURI());
+        sp.setPageNo(pageNo);
+        sp.setPageSize(pageSize);
+        sp.setParams(params);
+        Page<Map<String,Object>> page = videoInfoService.findMerchantTeaNumByPage(params, initPage(pageNo, pageSize));
+        List<Map<String,Object>> list=page.getContent();
+        for (Map<String, Object> pageMap : list) {
+        	Map<String, Object> map=videoUserService.findTrainVideoUserByPage(pageMap);
+        	pageMap.putAll(map);
+		}
+        
+        sp.setRowCnt((int) page.getTotalElements());
+        model.addAttribute("list",list);
+        model.addAttribute("listNavigatHtml", sp.getSysPaginHtml());
+        model.addAttribute("page", sp);
+        model.addAttribute("search", params);
+
+		return "sys/train/pace_list";
+	}
+	
+	
+	
+	@RequestMapping("/pace/list/info")
+	public String paceListInfo(Model model,
+			@RequestParam(required = false, defaultValue = "10") int pageSize,
+			@RequestParam(required = false, defaultValue = "1") int pageNo)
+			throws Exception { 
+		
+		Map<String, Object> params = new HashMap<String, Object>();
+		params.put("name", request.getParameter("name")==null?"":request.getParameter("name"));
+		params.put("type", request.getParameter("type")==null?"":request.getParameter("type"));
+		params.put("libId", request.getParameter("libId")==null?"":request.getParameter("libId"));
+		
+		SplitPage sp = new SplitPage();
+        sp.setAction(request.getRequestURI());
+        sp.setPageNo(pageNo);
+        sp.setPageSize(pageSize);
+        sp.setParams(params);
+        Page<Map<String,Object>> page = videoUserService.findTeaInfoNumByPage(params, initPage(pageNo, pageSize));
+        List<Map<String,Object>> list=page.getContent();
+
+        sp.setRowCnt((int) page.getTotalElements());
+        model.addAttribute("list",list);
+        model.addAttribute("listNavigatHtml", sp.getSysPaginHtml());
+        model.addAttribute("page", sp);
+        model.addAttribute("search", params);
+
+		return "sys/train/pace_list_info";
+	}
+	
+	
+	
+	@RequestMapping("/import/exam/info")
+	@ResponseBody
+    public ResponseEntity importDeviceData(HttpServletRequest request, HttpServletResponse response,
+    		@RequestParam("file") MultipartFile file,String videoId)
+    				throws Exception {
+		ResponseEntity responseEntity = new  ResponseEntity();
+		try {
+			VideoInfo videoInfo=videoInfoService.getById(videoId);
+			List<Map<String,String>> datas=ImLibUserController.analysisExFile(file);
+			if(datas!=null && datas.size()>0){
+				List<ExamInfo> examInfos=new ArrayList<ExamInfo>();
+				ExamInfo examInfo=null;
+				for (Map<String,String> map : datas) {
+					examInfo=new ExamInfo();
+					examInfo.setRoleType(videoInfo.getRoleType());
+					examInfo.setVideoId(videoInfo.getId());
+					examInfo.setExamNum(Integer.valueOf(map.get("data_0")));
+					examInfo.setExamType(Integer.valueOf(map.get("data_1")));
+					examInfo.setTitle(map.get("data_2"));
+					examInfo.setOptions(map.get("data_3"));
+					examInfo.setAnswer(map.get("data_4"));
+					examInfo.setScore(Integer.valueOf(map.get("data_5")));
+					if(map.containsKey("data_6") && StringUtils.isNotEmpty(map.get("data_6"))) {
+						examInfo.setId(map.get("data_6"));
+					}
+					examInfo.setCreateTime(new Date());
+					examInfos.add(examInfo);
+				}
+				examInfoService.save(examInfos);
+			}
+			
+		} catch (Exception e) {
+			logger.error("异常", e);
+			responseEntity.failure("导入异常:"+e.getMessage());
+		}
+		return responseEntity;
+    }
+	
+	
+	
+	@RequestMapping("/file/list")
+	public String fileList(Model model,
+			@RequestParam(required = false, defaultValue = "10") int pageSize,
+			@RequestParam(required = false, defaultValue = "1") int pageNo)
+			throws Exception {
+		
+		Map<String, Object> params = new HashMap<String, Object>();
+		params.put("type", request.getParameter("type")==null?"":request.getParameter("type"));
+		params.put("rolType", request.getParameter("rolType")==null?"":request.getParameter("rolType"));
+		params.put("module", request.getParameter("module")==null?"":request.getParameter("module"));
+		params.put("title", request.getParameter("title")==null?"":request.getParameter("title"));
+		
+		SplitPage sp = new SplitPage();
+        sp.setAction(request.getRequestURI());
+        sp.setPageNo(pageNo);
+        sp.setPageSize(pageSize);
+        sp.setParams(params);
+        Page<Map<String,Object>> page = videoFileService.findVideoFileByPage(params, initPage(pageNo, pageSize));
+        List<Map<String,Object>> list=page.getContent();
+       
+        sp.setRowCnt((int) page.getTotalElements());
+        model.addAttribute("list",list);
+        model.addAttribute("listNavigatHtml", sp.getSysPaginHtml());
+        model.addAttribute("page", sp);
+        model.addAttribute("search", params);
+		return "sys/train/file_list";
+	}
+	
+	
+	@RequestMapping("/file/edit")
+	public String fileEdit(Model model,String id)
+			throws Exception {
+		VideoFile videoFile=new VideoFile();
+		if(StringUtils.isNotEmpty(id)) {
+			videoFile=videoFileService.getById(id);
+		}
+		model.addAttribute("videoFile",videoFile);
+		return "sys/train/file_edit";
+	}
+	
+
+	 @RequestMapping("/file/save")
+	 @ResponseBody
+	 public Response fileSave(VideoFile param) throws Exception{
+    	Response response = new  Response();
+    	if(StringUtils.isNotEmpty(param.getId())) {
+    		VideoFile videoFile=videoFileService.getById(param.getId());
+    		videoFile.setModule(param.getModule());
+    		videoFile.setRoleType(param.getRoleType());
+    		videoFile.setStatus(param.getStatus());
+    		videoFile.setTitle(param.getTitle());
+    		videoFile.setFormat(param.getFormat());
+    		videoFile.setUpdateTime(new Date());
+    		videoFileService.save(videoFile);
+    	}else {
+    		param.setCreateTime(new Date());
+    		videoFileService.save(param);
+    	}
+    	response.success();
+    	return response;
+	 }
+	
+	
+	
+	
+	
+}

+ 1 - 1
src/main/java/com/ssj/api/weixin/util/AesException.java

@@ -1,4 +1,4 @@
-package com.ssj.api.weixin.util;
+package com.ssj.weixin.utils;
 
 @SuppressWarnings("serial")
 public class AesException extends Exception {

+ 1 - 1
src/main/java/com/ssj/api/weixin/util/ByteGroup.java

@@ -1,4 +1,4 @@
-package com.ssj.api.weixin.util;
+package com.ssj.weixin.utils;
 
 import java.util.ArrayList;
 

+ 1 - 1
src/main/java/com/ssj/api/weixin/util/PKCS7Encoder.java

@@ -6,7 +6,7 @@
 
 // ------------------------------------------------------------------------
 
-package com.ssj.api.weixin.util;
+package com.ssj.weixin.utils;
 
 import java.nio.charset.Charset;
 import java.util.Arrays;

+ 1 - 1
src/main/java/com/ssj/api/weixin/util/SHA1.java

@@ -6,7 +6,7 @@
 
 // ------------------------------------------------------------------------
 
-package com.ssj.api.weixin.util;
+package com.ssj.weixin.utils;
 
 import java.security.MessageDigest;
 import java.util.Arrays;

二進制
src/main/resources/static/sys/excel/exam_info.xlsx


+ 207 - 0
src/main/resources/templates/sys/train/file_edit.html

@@ -0,0 +1,207 @@
+<html xmlns:th="http://www.thymeleaf.org">
+<head>
+<title>私塾家</title>
+<script th:include="sys/common/metaCSS" th:remove="tag"></script> 
+<script th:include="sys/common/metaJS" th:remove="tag"></script> 
+<script src="sys/js/My97DatePicker/WdatePicker.js" th:src="@{/static/sys/js/My97DatePicker/WdatePicker.js}"></script>
+<link rel="stylesheet" href="https://www.17sucai.com/preview/1528155/2019-03-29/v/css/jsmodern.min.css">
+<script src="https://www.17sucai.com/preview/1528155/2019-03-29/v/js/jsmodern.min.js"></script>
+
+<script type="text/javascript" src="https://www.sharingschool.com/dcui/tools/ueditor/ueditor.config.js?version=1811271348"></script>
+<script type="text/javascript" src="https://www.sharingschool.com/dcui/tools/ueditor/ueditor.all.min.js?version=1812061808"></script>
+<script type="text/javascript" src="https://www.sharingschool.com/dcui/tools/ueditor/lang/zh-cn/zh-cn.js?version=1811271348"></script>
+
+</head>
+<style>
+	.tablelink{margin-right:10px;}
+	.stylecss{
+	      color: red;
+	}
+	.select_width{
+	     width: 220px;
+	}
+	.date_width{
+	     width: 150px;
+	}
+	
+	.tablelist th,td{
+		white-space: nowrap;
+		text-overflow: ellipsis;
+		overflow: hidden;
+	}
+	.tablelist td a{
+    	text-decoration: underline;
+	}
+	
+</style>
+
+<style>
+#video {
+	width: 400px;
+	height: 250px;
+	position: relative;
+	margin-bottom: 20px;
+	margin-left: 134px;
+}
+
+#video video {
+	width: 100%;
+	height: 100%;
+	object-fit: fill;
+}
+
+.VideoBtn {
+	position: absolute;
+	left: 50%;
+	top: 50%;
+	display: block;
+	width: 70px;
+	height: 70px;
+	margin-left: -35px;
+	margin-top: -35px;
+	cursor: pointer;
+	z-index: 10;
+}
+</style>
+
+
+
+<body>
+<div class="place">
+	<span>位置:</span>
+	<ul class="placeul">
+		<li><a href="#">视频培训系统</a></li>
+		<li><a href="#">培训视频编辑</a></li>
+	</ul>
+</div>
+<div class="formbody">
+	<form id="submitFrom" method="post" class="form-horizontal form-validate">
+		<input type="hidden" name="id" id="id"  th:value="${videoFile.id}"/>
+		<ul class="forminfo">
+			 <li class="clearfix" >
+				<label>资料类型:<b>*</b></label>
+				<select class="scinput select_width"  name="type"  style="width: 345px;"  >
+					<option value="1"  th:selected="${videoFile.type==1 ? true : false}">压缩包</option>
+					<option value="2"  th:selected="${videoFile.type==2 ? true : false}">资料文件</option>
+				</select>
+		    </li>
+			 <li class="clearfix" >
+				<label>学习内容:<b>*</b></label>
+				<select class="scinput select_width"  name="roleType"  style="width: 345px;"  >
+					<option value="1"  th:selected="${videoFile.roleType==1 ? true : false}">校长端</option>
+					<option value="2"  th:selected="${videoFile.roleType==2 ? true : false}">老师端</option>
+					<option value="3"  th:selected="${videoFile.roleType==3 ? true : false}">家长端</option>
+					<option value="4"  th:selected="${videoFile.roleType==4 ? true : false}">学生端</option>
+				</select>
+		    </li>
+			<li class="clearfix" >
+				<label>资料模块:<b></b></label>
+				<input type="text"  name="module" class="dfinput fl" th:value="${videoFile.module}"/>
+			</li>
+			<li class="clearfix" >
+				<label>资料名称:<b>*</b></label>
+				<input type="text" name="title" class="dfinput fl" id="title" th:value="${videoFile.title}"/>
+			</li>
+			<li class="clearfix" >
+				<label>资料格式:<b>*</b></label>
+				<input type="text" name="format" class="dfinput fl" id="format" th:value="${videoFile.format}"/>
+			</li>
+			<li class="clearfix" >
+				<label>资料路径:<b>*</b></label>
+				<input type="text" name="url" class="dfinput fl" id="url" th:value="${videoFile.url}"/>
+			</li>
+			<li class="clearfix" >
+				<label>发布状态:<b>*</b></label>
+				<select class="scinput select_width"  name="status"   style="width: 345px;" >
+					<option value="1" th:selected="${videoFile.status==1 ? true : false}">发布</option>
+					<option value="0" th:selected="${videoFile.status==0 ? true : false}">未发布</option>
+					<option value="2" th:selected="${videoFile.status==2 ? true : false}">下架</option>
+				</select>
+		    </li>
+		   
+			<li>
+				<label>&nbsp;</label>
+				<button type="button" class="btn" onclick="saveFrom()">保存</button>
+				<button type="button" class="btn" onclick="window.history.go(-1);">取消</button>
+			</li>
+		</ul>
+	</form>
+</div>
+</body>
+
+<!--视频插件调用方法-->
+<script>
+$(function () {
+	//视频
+	jsModern.video("#video");
+	//播放视频
+	$(".VideoBtn").click(function () {
+		var video = document.getElementById("videoShow");
+		video.play();
+		$('.VideoBtn').hide();
+	})
+})
+</script>
+
+<script type="text/javascript">
+var tool = 
+	[
+		"fullscreen", "undo", "redo", "|",
+		"bold", "italic", "underline", "fontborder", "strikethrough", "superscript", "subscript", "removeformat", "formatmatch", "autotypeset", "blockquote", "pasteplain", "|", "forecolor", "backcolor", "insertorderedlist", "insertunorderedlist", "selectall", "cleardoc", "|",
+		"rowspacingtop", "rowspacingbottom", "lineheight", "|",
+		"customstyle", "paragraph", "fontfamily", "fontsize", "|",
+		"directionalityltr", "directionalityrtl", "indent", "|",
+		"justifyleft", "justifycenter", "justifyright", "justifyjustify", "|", "touppercase", "tolowercase", "|",
+		"imagenone", "imageleft", "imageright", "imagecenter", "|",
+		"emotion","pagebreak", "template", "|",
+		"horizontal", "date", "time", "spechars",  "|",
+		"inserttable", "deletetable", "insertparagraphbeforetable", "insertrow", "deleterow", "insertcol", "deletecol", "mergecells", "mergeright", "mergedown", "splittocells", "splittorows", "splittocols", "charts", "|",
+		"preview", "searchreplace","drafts" 
+		];
+          
+var editor = new baidu.editor.ui.Editor({
+	//toolbars: [tool],
+	elementPathEnabled : false
+    ,wordCount:false         //是否开启字数统计
+    ,maximumWords:2000       //允许的最大字符数
+    ,wordCountMsg:'当前已输入 {#count} 个字符,您还可以输入{#leave} 个字符'
+    //超出字数限制提示  留空支持多语言自动切换,否则按此配置显示
+    ,wordOverFlowMsg:'<span style="color:red;">你输入的字符个数已经超出最大允许值!</span>' 
+});
+
+$(function(){
+	editor.render('editor');
+	editor.ready( function () { editor.setContent( $('#description').val() ); });  
+});
+</script>
+
+<script type="text/javascript">
+$(function () {
+
+})
+
+function saveFrom(){
+	var contents = UE.getEditor('editor').getContent();
+	$('#description').val(contents);
+	var url="[[${sysUrl}]]/sys/train/video/save";
+	var params = $("#submitFrom").serialize();
+	$.post(url,params,function(data){
+		if(data != null){
+				if(data.meta.success){
+					layer.msg("操作成功!",{icon:1});
+			    	setTimeout(function(){
+			    		window.location.href ='[[${sysUrl}]]/sys/train/video/list.html';
+					},1000);
+				}else{
+					layer.msg(data.meta.message,{icon:11});
+				}
+		}
+		
+	});
+}
+
+
+</script>
+
+
+</html>

+ 155 - 0
src/main/resources/templates/sys/train/file_list.html

@@ -0,0 +1,155 @@
+<html xmlns:th="http://www.thymeleaf.org">
+<head>
+<title>私塾家</title>
+<script th:include="sys/common/metaCSS" th:remove="tag"></script> 
+<script th:include="sys/common/metaJS" th:remove="tag"></script> 
+<script src="sys/js/My97DatePicker/WdatePicker.js" th:src="@{/static/sys/js/My97DatePicker/WdatePicker.js}"></script>
+</head>
+<style>
+	.tablelink{margin-right:10px;}
+	.stylecss{
+	      color: red;
+	}
+	.select_width{
+	     width: 220px;
+	}
+	.date_width{
+	     width: 150px;
+	}
+	
+	.tablelist th,td{
+		white-space: nowrap;
+		text-overflow: ellipsis;
+		overflow: hidden;
+	}
+	.tablelist td a{
+    	text-decoration: underline;
+	}
+	
+</style>
+<body>
+<div class="place">
+	<span>位置:</span>
+	<ul class="placeul">
+		<li><a href="#">视频培训系统</a></li>
+		<li><a href="#">培训视频管理</a></li>
+	</ul>
+</div>
+<div class="rightinfo">
+	<form id="seachform" th:action="@{/sys/train/file/list.html}" method="post">
+	<input type="hidden" name="pageSize" id="pageSize" value="10" />
+	<ul class="seachform">
+		<li>
+			<label>资料类型:</label>
+			<select class="scinput select_width"  name="type"   style="width: 150px;" >
+				<option value="">全部</option>
+				<option value="1" th:selected="${search.get('type') eq '1'}">压缩包</option>
+				<option value="2" th:selected="${search.get('type') eq '2'}">资料文件</option>
+			</select>
+	    </li>
+		<li>
+			<label>学习内容:</label>
+			<select class="scinput select_width"  name="roleType"   style="width: 150px;" >
+				<option value="">全部</option>
+				<option value="1" th:selected="${search.get('roleType') eq '1'}">校长端</option>
+				<option value="2" th:selected="${search.get('roleType') eq '2'}">老师端</option>
+				<option value="3" th:selected="${search.get('roleType') eq '3'}">家长端</option>
+				<option value="4" th:selected="${search.get('roleType') eq '4'}">学生端</option>
+			</select>
+	    </li>
+	    <li>
+			<label>状态:</label>
+			<select class="scinput select_width"  name="status"   style="width: 150px;" >
+				<option value="">全部</option>
+				<option value="0" th:selected="${search.get('status') eq '0'}">未发布</option>
+				<option value="1" th:selected="${search.get('status') eq '1'}">发布</option>
+				<option value="2" th:selected="${search.get('status') eq '2'}">删除</option>
+			</select>
+	    </li>
+	    <li>
+			 <label>模块:</label>
+			 <input name="module" type="text" class="scinput" th:value="${search.module}"  />
+		</li>
+		<li>
+			 <label>资料名称:</label>
+			 <input name="title" type="text" class="scinput"  th:value="${search.title}"   />
+		</li>
+		<li>
+			<input type="button" class="scbtn" value="查询" />
+		</li>
+		<li>
+			<ul class="toolbar">
+				<a th:href="@{/sys/train/file/edit.html}">
+					<li class="click"><span><img th:src="@{/static/sys/images/t01.png}"></span>添加资料</li>
+				</a>
+			</ul>
+		</li>
+	</ul>
+
+	</form> 
+	
+	
+	
+
+	<table class="tablelist">
+		<thead>
+		    <tr>
+		    	<th >序号</th>
+		    	<th >资料类型 </th>
+		    	<th >学习内容 </th>
+		    	<th >模块 </th>
+		    	<th >资料名称</th>
+		    	<th >资料路径</th>
+		    	<th >资料格式</th>
+		    	<th >状态 </th>
+		    	<th >上传时间 </th>
+		    	<th >操作 </th>
+		    </tr> 
+		</thead>
+		<tbody>
+			<tr th:each="item:${list}" >
+				<td th:text="${itemStat.count}"></td>
+				<td  th:switch="${item.type}">
+				   <span th:case="1" style="color:red">压缩包</span>
+				   <span th:case="2" >资料文件</span>
+				</td>
+				<td  th:switch="${item.role_type}">
+				   <span th:case="1" style="color:red">校长端</span>
+				   <span th:case="2" style="color:red">老师端</span>
+				   <span th:case="3" style="color:red">家长端</span>
+				   <span th:case="4" style="color:red">学生端</span>
+				</td>
+				<td th:text="${item.module}"></td>
+				<td th:text="${item.title}"></td>
+				<td th:text="${item.url}"></td>
+				<td th:text="${item.format}"></td>
+				<td  th:switch="${item.status}">
+				   <span th:case="0" >未发布</span>
+				   <span th:case="1" >发布</span>
+				   <span th:case="2" style="color:red">已下架</span>
+				</td>
+				<td th:text="${item.create_time}"></td>
+				<td >
+					<a th:href="@{/sys/train/file/edit.html(id=${item.id})}" class="tablelink">编辑</a>
+				</td>
+			</tr>
+		</tbody>
+	</table>
+
+	<!-- 分页 -->
+	<div class="pagin">
+    	<div class="message">共<i class="blue">[[${page.rowCnt}]]</i>条记录,当前显示第&nbsp;<i class="blue">[[${page.pageNo }]]&nbsp;</i>页</div>
+    	<div th:utext='${listNavigatHtml}' th:remove="tag" ></div>
+   	</div>
+   	
+</div>
+</body>
+
+<script type="text/javascript">
+$(function () {
+	 
+	
+})
+</script>
+
+</html>

+ 105 - 0
src/main/resources/templates/sys/train/pace_list.html

@@ -0,0 +1,105 @@
+<html xmlns:th="http://www.thymeleaf.org">
+<head>
+<title>私塾家</title>
+<script th:include="sys/common/metaCSS" th:remove="tag"></script> 
+<script th:include="sys/common/metaJS" th:remove="tag"></script> 
+<script src="sys/js/My97DatePicker/WdatePicker.js" th:src="@{/static/sys/js/My97DatePicker/WdatePicker.js}"></script>
+</head>
+<style>
+	.tablelink{margin-right:10px;}
+	.stylecss{
+	      color: red;
+	}
+	.select_width{
+	     width: 220px;
+	}
+	.date_width{
+	     width: 150px;
+	}
+	
+	.tablelist th,td{
+		white-space: nowrap;
+		text-overflow: ellipsis;
+		overflow: hidden;
+	}
+	.tablelist td a{
+    	text-decoration: underline;
+	}
+	
+</style>
+<body>
+<div class="place">
+	<span>位置:</span>
+	<ul class="placeul">
+		<li><a href="#">视频培训系统</a></li>
+		<li><a href="#">培训学习进度</a></li>
+	</ul>
+</div>
+<div class="rightinfo">
+	<form id="seachform" th:action="@{/sys/train/pace/list.html}" method="post">
+	<input type="hidden" name="pageSize" id="pageSize" value="10" />
+	<ul class="seachform">
+			<li>
+			 <label>商户名称</label>
+			  <input name="unitName" type="text" class="scinput" th:value="${search.unitName}"   />
+		    </li>
+			<li>
+				<input type="button" class="scbtn" value="查询" />
+			</li>
+	</ul>
+	</form> 
+
+	<table class="tablelist">
+		<thead>
+		    <tr>
+		    	<th >序号 </th>
+		    	<th >商户名称 </th>
+		    	<th >校长端(完成人数/总人数) </th>
+		    	<th >老师端(完成人数/总人数) </th>
+		    	<th >家长端(完成人数/总人数) </th>
+		    	<th >学生端(完成人数/总人数)  </th>
+		    </tr> 
+		</thead>
+		<tbody>
+			<tr th:each="item:${list}" >
+				<td th:text="${itemStat.count}"></td>
+				<td th:text="${item.unit_name}"></td>
+				<td >
+					<a th:href="@{/sys/train/pace/list/info.html(libId=${item.lib_id},type='6' )}">
+						[[${item.role_count_1 +'/'+ item.pal_num}]]
+					</a>
+				</td>
+				<td >
+					<a th:href="@{/sys/train/pace/list/info.html(libId=${item.lib_id} )}">
+						[[${item.role_count_2 +'/'+ item.tea_num}]]
+					</a>
+				</td>
+				<td >
+					<a th:href="@{/sys/train/pace/list/info.html(libId=${item.lib_id} )}">
+						[[${item.role_count_3 +'/'+ item.tea_num}]]
+					</a>
+				</td>
+				<td >
+					<a th:href="@{/sys/train/pace/list/info.html(libId=${item.lib_id} )}">
+						[[${item.role_count_4 +'/'+ item.tea_num}]]
+					</a>
+				</td>
+			</tr>
+		</tbody>
+	</table>
+
+	<!-- 分页 -->
+	<div class="pagin">
+    	<div class="message">共<i class="blue">[[${page.rowCnt}]]</i>条记录,当前显示第&nbsp;<i class="blue">[[${page.pageNo }]]&nbsp;</i>页</div>
+    	<div th:utext='${listNavigatHtml}' th:remove="tag" ></div>
+   	</div>
+</div>
+</body>
+
+<script type="text/javascript">
+$(function () {
+	
+})
+</script>
+
+</html>

+ 97 - 0
src/main/resources/templates/sys/train/pace_list_info.html

@@ -0,0 +1,97 @@
+<html xmlns:th="http://www.thymeleaf.org">
+<head>
+<title>私塾家</title>
+<script th:include="sys/common/metaCSS" th:remove="tag"></script> 
+<script th:include="sys/common/metaJS" th:remove="tag"></script> 
+<script src="sys/js/My97DatePicker/WdatePicker.js" th:src="@{/static/sys/js/My97DatePicker/WdatePicker.js}"></script>
+</head>
+<style>
+	.tablelink{margin-right:10px;}
+	.stylecss{
+	      color: red;
+	}
+	.select_width{
+	     width: 220px;
+	}
+	.date_width{
+	     width: 150px;
+	}
+	
+	.tablelist th,td{
+		white-space: nowrap;
+		text-overflow: ellipsis;
+		overflow: hidden;
+	}
+	.tablelist td a{
+    	text-decoration: underline;
+	}
+	
+</style>
+<body>
+<div class="place">
+	<span>位置:</span>
+	<ul class="placeul">
+		<li><a href="#">视频培训系统</a></li>
+		<li><a href="#">培训学习进度</a></li>
+	</ul>
+</div>
+<div class="rightinfo">
+	<form id="seachform" th:action="@{/sys/train/pace/list.html}" method="post">
+	<input type="hidden" name="pageSize" id="pageSize" value="10" />
+	<ul class="seachform">
+			<li>
+			 <label>老师名称</label>
+			  <input name="name" type="text" class="scinput"  th:value="${search.name}"   />
+		    </li>
+			<li>
+				<input type="button" class="scbtn" value="查询" />
+			</li>
+	</ul>
+	</form> 
+
+	<table class="tablelist">
+		<thead>
+		    <tr>
+		    	<th >序号 </th>
+		    	<th >老师名称 </th>
+		    	<th >校长端(完成数/总数) </th>
+		    	<th >老师端(完成数/总数) </th>
+		    	<th >家长端(完成数/总数) </th>
+		    	<th >学生端(完成数/总数)  </th>
+		    </tr> 
+		</thead>
+		<tbody>
+			<tr th:each="item:${list}" >
+				<td th:text="${itemStat.count}"></td>
+				<td th:text="${item.name}"></td>
+				<td >
+						[[${item.role_count_1 +'/'+ item.role_num_1}]]
+				</td>
+				<td >
+						[[${item.role_count_2 +'/'+ item.role_num_2}]]
+				</td>
+				<td >
+						[[${item.role_count_3 +'/'+ item.role_num_3}]]
+				</td>
+				<td >
+						[[${item.role_count_4 +'/'+ item.role_num_4}]]
+				</td>
+			</tr>
+		</tbody>
+	</table>
+
+	<!-- 分页 -->
+	<div class="pagin">
+    	<div class="message">共<i class="blue">[[${page.rowCnt}]]</i>条记录,当前显示第&nbsp;<i class="blue">[[${page.pageNo }]]&nbsp;</i>页</div>
+    	<div th:utext='${listNavigatHtml}' th:remove="tag" ></div>
+   	</div>
+</div>
+</body>
+
+<script type="text/javascript">
+$(function () {
+	
+})
+</script>
+
+</html>

+ 211 - 0
src/main/resources/templates/sys/train/video_edit.html

@@ -0,0 +1,211 @@
+<html xmlns:th="http://www.thymeleaf.org">
+<head>
+<title>私塾家</title>
+<script th:include="sys/common/metaCSS" th:remove="tag"></script> 
+<script th:include="sys/common/metaJS" th:remove="tag"></script> 
+<script src="sys/js/My97DatePicker/WdatePicker.js" th:src="@{/static/sys/js/My97DatePicker/WdatePicker.js}"></script>
+<link rel="stylesheet" href="https://www.17sucai.com/preview/1528155/2019-03-29/v/css/jsmodern.min.css">
+<script src="https://www.17sucai.com/preview/1528155/2019-03-29/v/js/jsmodern.min.js"></script>
+
+<script type="text/javascript" src="https://www.sharingschool.com/dcui/tools/ueditor/ueditor.config.js?version=1811271348"></script>
+<script type="text/javascript" src="https://www.sharingschool.com/dcui/tools/ueditor/ueditor.all.min.js?version=1812061808"></script>
+<script type="text/javascript" src="https://www.sharingschool.com/dcui/tools/ueditor/lang/zh-cn/zh-cn.js?version=1811271348"></script>
+
+</head>
+<style>
+	.tablelink{margin-right:10px;}
+	.stylecss{
+	      color: red;
+	}
+	.select_width{
+	     width: 220px;
+	}
+	.date_width{
+	     width: 150px;
+	}
+	
+	.tablelist th,td{
+		white-space: nowrap;
+		text-overflow: ellipsis;
+		overflow: hidden;
+	}
+	.tablelist td a{
+    	text-decoration: underline;
+	}
+	
+</style>
+
+<style>
+#video {
+	width: 400px;
+	height: 250px;
+	position: relative;
+	margin-bottom: 20px;
+	margin-left: 134px;
+}
+
+#video video {
+	width: 100%;
+	height: 100%;
+	object-fit: fill;
+}
+
+.VideoBtn {
+	position: absolute;
+	left: 50%;
+	top: 50%;
+	display: block;
+	width: 70px;
+	height: 70px;
+	margin-left: -35px;
+	margin-top: -35px;
+	cursor: pointer;
+	z-index: 10;
+}
+</style>
+
+
+
+<body>
+<div class="place">
+	<span>位置:</span>
+	<ul class="placeul">
+		<li><a href="#">视频培训系统</a></li>
+		<li><a href="#">培训视频编辑</a></li>
+	</ul>
+</div>
+<div class="formbody">
+	<div id="video">
+		<video th:src="${videoInfo.url}" id="videoShow"></video>
+		<span class="VideoBtn"><img src="https://www.17sucai.com/preview/1528155/2019-03-29/v/images/bo1.png"></span>
+	</div>
+	<form id="submitFrom" method="post" class="form-horizontal form-validate">
+		<input type="hidden" name="id" id="id"  th:value="${videoInfo.id}"/>
+		<ul class="forminfo">
+			 <li class="clearfix" >
+				<label>学习内容:<b>*</b></label>
+				<select class="scinput select_width"  name="roleType"  style="width: 345px;"  >
+					<option value="1"  th:selected="${videoInfo.roleType==1 ? true : false}">校长端</option>
+					<option value="2"  th:selected="${videoInfo.roleType==2 ? true : false}">老师端</option>
+					<option value="3"  th:selected="${videoInfo.roleType==3 ? true : false}">家长端</option>
+					<option value="4"  th:selected="${videoInfo.roleType==4 ? true : false}">学生端</option>
+				</select>
+		    </li>
+			<li class="clearfix" >
+				<label>资料模块:<b>*</b></label>
+				<input type="text"  name="module" class="dfinput fl" th:value="${videoInfo.module}"/>
+			</li>
+			<li class="clearfix" >
+				<label>资料名称:<b>*</b></label>
+				<input type="text" name="title" class="dfinput fl" id="title" th:value="${videoInfo.title}"/>
+			</li>
+			<li class="clearfix" >
+				<label>资料路径:<b>*</b></label>
+				<input type="text" name="url" class="dfinput fl" id="url" th:value="${videoInfo.url}"/>
+			</li>
+			<li class="clearfix" >
+				<label>排序(顺序):<b>*</b></label>
+				<input type="text" name="indes" class="dfinput fl" id="index" th:value="${videoInfo.indes}"/>
+			</li>
+			<li class="clearfix" >
+				<label>发布状态:<b>*</b></label>
+				<select class="scinput select_width"  name="status"   style="width: 345px;" >
+					<option value="1" th:selected="${videoInfo.status==1 ? true : false}">发布</option>
+					<option value="0" th:selected="${videoInfo.status==0 ? true : false}">未发布</option>
+					<option value="2" th:selected="${videoInfo.status==2 ? true : false}">下架</option>
+				</select>
+		    </li>
+		    
+		     <li>
+			 	<br/>
+				<label>资料介绍:<b>*</b></label>
+				<input type="hidden" name="description" id="description" th:value="${videoInfo.description}"/>
+				<script id="editor" type="text/plain"   style="line-height: 20px; overflow: hidden;width:80%;height:300px"></script>
+			 </li>
+		    
+			<li>
+				<label>&nbsp;</label>
+				<button type="button" class="btn" onclick="saveFrom()">保存</button>
+				<button type="button" class="btn" onclick="window.history.go(-1);">取消</button>
+			</li>
+		</ul>
+	</form>
+</div>
+</body>
+
+<!--视频插件调用方法-->
+<script>
+$(function () {
+	//视频
+	jsModern.video("#video");
+	//播放视频
+	$(".VideoBtn").click(function () {
+		var video = document.getElementById("videoShow");
+		video.play();
+		$('.VideoBtn').hide();
+	})
+})
+</script>
+
+<script type="text/javascript">
+var tool = 
+	[
+		"fullscreen", "undo", "redo", "|",
+		"bold", "italic", "underline", "fontborder", "strikethrough", "superscript", "subscript", "removeformat", "formatmatch", "autotypeset", "blockquote", "pasteplain", "|", "forecolor", "backcolor", "insertorderedlist", "insertunorderedlist", "selectall", "cleardoc", "|",
+		"rowspacingtop", "rowspacingbottom", "lineheight", "|",
+		"customstyle", "paragraph", "fontfamily", "fontsize", "|",
+		"directionalityltr", "directionalityrtl", "indent", "|",
+		"justifyleft", "justifycenter", "justifyright", "justifyjustify", "|", "touppercase", "tolowercase", "|",
+		"imagenone", "imageleft", "imageright", "imagecenter", "|",
+		"emotion","pagebreak", "template", "|",
+		"horizontal", "date", "time", "spechars",  "|",
+		"inserttable", "deletetable", "insertparagraphbeforetable", "insertrow", "deleterow", "insertcol", "deletecol", "mergecells", "mergeright", "mergedown", "splittocells", "splittorows", "splittocols", "charts", "|",
+		"preview", "searchreplace","drafts" 
+		];
+          
+var editor = new baidu.editor.ui.Editor({
+	//toolbars: [tool],
+	elementPathEnabled : false
+    ,wordCount:false         //是否开启字数统计
+    ,maximumWords:2000       //允许的最大字符数
+    ,wordCountMsg:'当前已输入 {#count} 个字符,您还可以输入{#leave} 个字符'
+    //超出字数限制提示  留空支持多语言自动切换,否则按此配置显示
+    ,wordOverFlowMsg:'<span style="color:red;">你输入的字符个数已经超出最大允许值!</span>' 
+});
+
+$(function(){
+	editor.render('editor');
+	editor.ready( function () { editor.setContent( $('#description').val() ); });  
+});
+</script>
+
+<script type="text/javascript">
+$(function () {
+
+})
+
+function saveFrom(){
+	var contents = UE.getEditor('editor').getContent();
+	$('#description').val(contents);
+	var url="[[${sysUrl}]]/sys/train/video/save";
+	var params = $("#submitFrom").serialize();
+	$.post(url,params,function(data){
+		if(data != null){
+				if(data.meta.success){
+					layer.msg("操作成功!",{icon:1});
+			    	setTimeout(function(){
+			    		window.location.href ='[[${sysUrl}]]/sys/train/video/list.html';
+					},1000);
+				}else{
+					layer.msg(data.meta.message,{icon:11});
+				}
+		}
+		
+	});
+}
+
+
+</script>
+
+
+</html>

+ 187 - 0
src/main/resources/templates/sys/train/video_list.html

@@ -0,0 +1,187 @@
+<html xmlns:th="http://www.thymeleaf.org">
+<head>
+<title>私塾家</title>
+<script th:include="sys/common/metaCSS" th:remove="tag"></script> 
+<script th:include="sys/common/metaJS" th:remove="tag"></script> 
+<script src="sys/js/My97DatePicker/WdatePicker.js" th:src="@{/static/sys/js/My97DatePicker/WdatePicker.js}"></script>
+</head>
+<style>
+	.tablelink{margin-right:10px;}
+	.stylecss{
+	      color: red;
+	}
+	.select_width{
+	     width: 220px;
+	}
+	.date_width{
+	     width: 150px;
+	}
+	
+	.tablelist th,td{
+		white-space: nowrap;
+		text-overflow: ellipsis;
+		overflow: hidden;
+	}
+	.tablelist td a{
+    	text-decoration: underline;
+	}
+	
+</style>
+<body>
+<div class="place">
+	<span>位置:</span>
+	<ul class="placeul">
+		<li><a href="#">视频培训系统</a></li>
+		<li><a href="#">培训视频管理</a></li>
+	</ul>
+</div>
+<div class="rightinfo">
+	<form id="seachform" th:action="@{/sys/train/video/list.html}" method="post">
+	<input type="hidden" name="pageSize" id="pageSize" value="10" />
+	<ul class="seachform">
+		<li>
+			<label>学习内容:</label>
+			<select class="scinput select_width"  name="roleType"   style="width: 150px;" >
+				<option value="">全部</option>
+				<option value="1" th:selected="${search.get('roleType') eq '1'}" >校长端</option>
+				<option value="2" th:selected="${search.get('roleType') eq '2'}">老师端</option>
+				<option value="3" th:selected="${search.get('roleType') eq '3'}">家长端</option>
+				<option value="4" th:selected="${search.get('roleType') eq '4'}">学生端</option>
+			</select>
+	    </li>
+	    <li>
+			<label>状态:</label>
+			<select class="scinput select_width"  name="status"   style="width: 150px;" >
+				<option value="">全部</option>
+				<option value="0" th:selected="${search.get('status') eq '0'}">未发布</option>
+				<option value="1" th:selected="${search.get('status') eq '1'}">发布</option>
+				<option value="2" th:selected="${search.get('status') eq '2'}">删除</option>
+			</select>
+	    </li>
+	    <li>
+			 <label>模块:</label>
+			 <input name="module" type="text" class="scinput" th:value="${search.module}"   />
+		</li>
+		<li>
+			 <label>资料名称:</label>
+			 <input name="title" type="text" class="scinput" th:value="${search.title}"   />
+		</li>
+		<li>
+			<input type="button" class="scbtn" value="查询" />
+		</li>
+		<li>
+			<ul class="toolbar">
+				<a th:href="@{/sys/train/video/edit.html}">
+					<li class="click"><span><img th:src="@{/static/sys/images/t01.png}"></span>添加视频</li>
+				</a>
+			</ul>
+		</li>
+	</ul>
+	
+	<ul class="toolbar" style="margin-bottom: 10px;">
+		<li class="click">
+			<a th:href="@{/static/sys/excel/exam_info.xlsx}">
+				<span><img th:src="@{/static/sys/images/t02.png}"></span>下载测题模板
+			</a>
+		</li>
+	</ul>
+	
+	</form> 
+	
+	
+	
+
+	<table class="tablelist">
+		<thead>
+		    <tr>
+		    	<th >序号</th>
+		    	<th >学习内容 </th>
+		    	<th >模块 </th>
+		    	<th >资料名称</th>
+		    	<th >资料路径</th>
+		    	<th >排序(从小到大)</th>
+		    	<th >状态 </th>
+		    	<th >上传时间 </th>
+		    	<th >操作 </th>
+		    </tr> 
+		</thead>
+		<tbody>
+			<tr th:each="item:${list}" >
+				<td th:text="${itemStat.count}"></td>
+				<td  th:switch="${item.role_type}">
+				   <span th:case="1" style="color:red">校长端</span>
+				   <span th:case="2" style="color:red">老师端</span>
+				   <span th:case="3" style="color:red">家长端</span>
+				   <span th:case="4" style="color:red">学生端</span>
+				</td>
+				<td th:text="${item.module}"></td>
+				<td th:text="${item.title}"></td>
+				<td th:text="${item.url}"></td>
+				<td th:text="${item.indes}"></td>
+				<td  th:switch="${item.status}">
+				   <span th:case="0" >未发布</span>
+				   <span th:case="1" >发布</span>
+				   <span th:case="2" style="color:red">已下架</span>
+				</td>
+				<td th:text="${item.create_time}"></td>
+				<td >
+					<a th:href="@{/sys/train/video/edit.html(id=${item.id})}" class="tablelink">编辑</a>
+					<a href="javascript:;"  th:if="${item.status==0 || item.status==2 }" th:onclick="'joinServiceEdit(\''+${item.id}+'\')'" class="tablelink">发布</a>
+					<a href="javascript:;"   th:onclick="'importexaminfo(\''+${item.id}+'\')'" class="tablelink">导入小测</a>
+					<span style="display: none">
+						<input type="file" id="importexaminfo_file">
+						<input type="hidden" id="importexaminfo_file_id">
+					</span>
+				</td>
+			</tr>
+		</tbody>
+	</table>
+
+	<!-- 分页 -->
+	<div class="pagin">
+    	<div class="message">共<i class="blue">[[${page.rowCnt}]]</i>条记录,当前显示第&nbsp;<i class="blue">[[${page.pageNo }]]&nbsp;</i>页</div>
+    	<div th:utext='${listNavigatHtml}' th:remove="tag" ></div>
+   	</div>
+   	
+</div>
+</body>
+
+<script type="text/javascript">
+$(function () {
+	 $("#importexaminfo_file").change(function () {
+		var formData = new FormData();
+	        formData.append("file", document.getElementById("importexaminfo_file").files[0]);  
+	        $.ajax({
+	        	url: "[[${sysUrl}]]/sys/train/import/exam/info?videoId="+$("#importexaminfo_file_id").val(),
+	            type: "POST",
+	            data: formData,
+	            contentType: false,
+	            processData: false,
+	            success: function (data) {
+	                if (data.status == "success") {
+	                	parent.layer.msg("导入成功",{icon:1});
+				    	setTimeout(function(){
+				    		location.reload();
+						},500);
+	                }else {
+	                    alert(data.msg);
+	                }
+	            },
+	            error: function () {
+	            	 alert("上传失败,请刷新后重试。");
+	            }
+	        });
+		
+	})
+	
+})
+
+	
+	function importexaminfo(videoId) {
+		$("#importexaminfo_file_id").val(videoId);
+		$("#importexaminfo_file").click();
+    };
+
+</script>
+
+</html>