Commit 8fd158d1 authored by YangZhaoJun1's avatar YangZhaoJun1

解决bug

parent e1b0f272
...@@ -153,8 +153,8 @@ public class BClassController extends PaginationController<BClass> { ...@@ -153,8 +153,8 @@ public class BClassController extends PaginationController<BClass> {
@ApiOperation(value="查询班级列表", notes="查询班级列表赋值在下拉框中") @ApiOperation(value="查询班级列表", notes="查询班级列表赋值在下拉框中")
@GetMapping(value = "/queryBClassList") @GetMapping(value = "/queryBClassList")
public Result queryBClassList() { public Result queryBClassList(String type) {
List<SelectModel> bClass = bClassService.queryBClassList(); List<SelectModel> bClass = bClassService.queryBClassList(type);
return Result.builder(new PersistModel(1), return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS, MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR, MessageConstant.MESSAGE_ALERT_ERROR,
......
package org.rcisoft.business.bclass.dao; package org.rcisoft.business.bclass.dao;
import org.apache.ibatis.annotations.Insert; import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap; import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import org.rcisoft.business.bclass.entity.BClass; import org.rcisoft.business.bclass.entity.BClass;
...@@ -50,9 +51,10 @@ public interface BClassRepository extends BaseMapper<BClass> { ...@@ -50,9 +51,10 @@ public interface BClassRepository extends BaseMapper<BClass> {
"</foreach></script>") "</foreach></script>")
int insertBusinessClassList(List<BClass> bClasses); int insertBusinessClassList(List<BClass> bClasses);
@Select("select * from b_class where del_flag != 1 and flag = 1") @Select("<script>select * from b_class where del_flag != 1 and flag = 1 " +
"<if test=\"type!=null and type!=''\">and type = #{type}</if></script>")
@ResultMap(value = "BaseResultMap" ) @ResultMap(value = "BaseResultMap" )
List<BClass> queryBClassList(); List<BClass> queryBClassList(@Param("type") String type);
@Select("select class_name from b_class where find_in_set(code,#{classesCode}) and del_flag != 1 and flag = 1") @Select("select class_name from b_class where find_in_set(code,#{classesCode}) and del_flag != 1 and flag = 1")
List<String> queryClassNamesByIds(String classesCode); List<String> queryClassNamesByIds(String classesCode);
......
...@@ -75,5 +75,5 @@ public interface BClassService{ ...@@ -75,5 +75,5 @@ public interface BClassService{
*/ */
PersistModel businessImportExcel(HSSFWorkbook hwb, String token) throws IOException; PersistModel businessImportExcel(HSSFWorkbook hwb, String token) throws IOException;
List<SelectModel> queryBClassList(); List<SelectModel> queryBClassList(String type);
} }
...@@ -272,8 +272,8 @@ public class BClassServiceImpl implements BClassService { ...@@ -272,8 +272,8 @@ public class BClassServiceImpl implements BClassService {
} }
@Override @Override
public List<SelectModel> queryBClassList() { public List<SelectModel> queryBClassList(String type) {
List<BClass> bClass = bClassRepository.queryBClassList(); List<BClass> bClass = bClassRepository.queryBClassList(type);
ArrayList<SelectModel> comBoxModel = new ArrayList<SelectModel>(); ArrayList<SelectModel> comBoxModel = new ArrayList<SelectModel>();
for(BClass c : bClass){ for(BClass c : bClass){
SelectModel selectModel = new SelectModel(); SelectModel selectModel = new SelectModel();
......
...@@ -156,20 +156,27 @@ public class BFileController extends PaginationController<BFile> { ...@@ -156,20 +156,27 @@ public class BFileController extends PaginationController<BFile> {
*/ */
@ApiOperation(value="下载文件", notes="下载文件") @ApiOperation(value="下载文件", notes="下载文件")
@ApiImplicitParam(name = "chapterId", value = "章节ID", required = true, dataType = "varchar") @ApiImplicitParam(name = "chapterId", value = "章节ID", required = true, dataType = "varchar")
@PostMapping(value = "/downloadFile") @PostMapping(value = "/downloadFileWithoutAuth")
public Result downloadFile(String chapterId, HttpServletResponse response){ public Result downloadFileWithoutAuth(String chapterId, HttpServletResponse response){
BFile video = bFileService.queryFileUrlByChapterId(chapterId); BFile bFile = bFileService.queryFileUrlByChapterId(chapterId);
BufferedInputStream bis = null; BufferedInputStream bis = null;
BufferedOutputStream bos = null; BufferedOutputStream bos = null;
if(video.getVideoUrl()!=""&&video.getVideoUrl()!=null){ if(bFile.getFileUrl()!=""&&bFile.getFileUrl()!=null){
try { try {
File file=new File(global.getBASE_UPLOAD_SERVER_LOCATION()+video.getVideoUrl()); File file=new File(global.getBASE_UPLOAD_SERVER_LOCATION()+bFile.getFileUrl());
bis = new BufferedInputStream(new FileInputStream(file)); bis = new BufferedInputStream(new FileInputStream(file));
bos = new BufferedOutputStream(response.getOutputStream()); bos = new BufferedOutputStream(response.getOutputStream());
String fileName = "";
if(bFile.getVideoName()!=null&&!bFile.getVideoName().equals("")&&bFile.getVideoName().endsWith(".zip")){
fileName = bFile.getVideoName();
}else{
fileName = file.getName();
}
response.reset(); response.reset();
response.setContentType("application/octet-stream;charset=utf-8"); response.setContentType("application/octet-stream;charset=utf-8");
response.setHeader("Content-Disposition", "attachment;filename="+ new String((video.getVideoName()).getBytes(), "iso-8859-1")); response.setHeader("Content-Disposition", "attachment;filename="+ new String((fileName).getBytes(), "iso-8859-1"));
response.setHeader("Access-Control-Allow-Origin", "*"); response.setHeader("Access-Control-Allow-Origin", "*");
IOUtils.copy(bis, bos); IOUtils.copy(bis, bos);
}catch (Exception e){ }catch (Exception e){
...@@ -199,5 +206,6 @@ public class BFileController extends PaginationController<BFile> { ...@@ -199,5 +206,6 @@ public class BFileController extends PaginationController<BFile> {
""); "");
} }
} }
} }
...@@ -267,7 +267,10 @@ public class BFileServiceImpl implements BFileService { ...@@ -267,7 +267,10 @@ public class BFileServiceImpl implements BFileService {
e.printStackTrace(); e.printStackTrace();
} }
} }
bFile.setVideoName(name+ "." +uploadFileSuffix);//文件名 //上传的是文件时才存文件名,方便下载时取
if(bFile.getType().equals("1")){
bFile.setVideoName(name+ "." +uploadFileSuffix);//文件名
}
if (bFile.getType().equals("0")){ if (bFile.getType().equals("0")){
......
...@@ -140,9 +140,9 @@ public class BStudentServiceImpl implements BStudentService { ...@@ -140,9 +140,9 @@ public class BStudentServiceImpl implements BStudentService {
List<String> valuesEmailExist = new ArrayList<>(); List<String> valuesEmailExist = new ArrayList<>();
List<String> valuesGrade = new ArrayList<>(); List<String> valuesGrade = new ArrayList<>();
int i = 1; int i = 0;
for (String[] value : values) { for (String[] value : values) {
i++;
String stuCode = value[0]; String stuCode = value[0];
//判断1:学号是否满足8~15位; //判断1:学号是否满足8~15位;
...@@ -225,7 +225,6 @@ public class BStudentServiceImpl implements BStudentService { ...@@ -225,7 +225,6 @@ public class BStudentServiceImpl implements BStudentService {
users.add(user); users.add(user);
userRoles.add(userRole); userRoles.add(userRole);
} }
i++;
} }
......
...@@ -93,9 +93,9 @@ public class BTeacherServiceImpl implements BTeacherService { ...@@ -93,9 +93,9 @@ public class BTeacherServiceImpl implements BTeacherService {
List<String> valuesShort = new ArrayList<>(); List<String> valuesShort = new ArrayList<>();
List<String> valuesIncomplete = new ArrayList<>(); List<String> valuesIncomplete = new ArrayList<>();
List<String> valuesAgencyExist = new ArrayList<>(); List<String> valuesAgencyExist = new ArrayList<>();
int i = 1; int i = 0;
for (String[] value : values) { for (String[] value : values) {
i++;
String teaCode = value[0]; String teaCode = value[0];
//判断1:学号是否满足8~15位; //判断1:学号是否满足8~15位;
...@@ -176,7 +176,6 @@ public class BTeacherServiceImpl implements BTeacherService { ...@@ -176,7 +176,6 @@ public class BTeacherServiceImpl implements BTeacherService {
users.add(user); users.add(user);
userRoles.add(userRole); userRoles.add(userRole);
} }
i++;
} }
String result = ""; String result = "";
if (teachers.size()>0){ if (teachers.size()>0){
......
...@@ -52,14 +52,14 @@ public class JwtAuthenTokenFilter extends OncePerRequestFilter { ...@@ -52,14 +52,14 @@ public class JwtAuthenTokenFilter extends OncePerRequestFilter {
/**/ /**/
String lk = rcRedisServiceImpl.get("lk"); String lk = rcRedisServiceImpl.get("lk");
// if(StringUtils.isBlank(lk) || !"1".equals(lk)){ if(StringUtils.isBlank(lk) || !"1".equals(lk)){
// if(permitRes==-1) { if(permitRes==-1) {
// Result result = new Result(); Result result = new Result();
// result.setCode(202); result.setCode(202);
// ResponseUtil.responseResult(response, result); ResponseUtil.responseResult(response, result);
// return; return;
// } }
// } }
// 取得header // 取得header
String authHeader = request.getHeader(this.tokenHeader); String authHeader = request.getHeader(this.tokenHeader);
//判断header头 //判断header头
......
...@@ -209,8 +209,8 @@ public interface SysRoleRepository extends BaseMapper<SysRole> { ...@@ -209,8 +209,8 @@ public interface SysRoleRepository extends BaseMapper<SysRole> {
* @param businessId * @param businessId
* @return * @return
*/ */
@Delete("DELETE sr " + @Delete("DELETE " +
"FROM" + "FROM " +
"s_r_user_role sr " + "s_r_user_role sr " +
"LEFT JOIN s_user s on s.business_id = sr.user_id " + "LEFT JOIN s_user s on s.business_id = sr.user_id " +
"LEFT JOIN ${tb} c ON c. CODE = s.login_name " + "LEFT JOIN ${tb} c ON c. CODE = s.login_name " +
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment