Commit 3838a8b4 authored by YangZhaoJun1's avatar YangZhaoJun1

04.27教师学生工号验证汉字

parent 179a2237
...@@ -53,4 +53,7 @@ ALTER TABLE `s_user` ...@@ -53,4 +53,7 @@ ALTER TABLE `s_user`
ALTER TABLE `s_user` ALTER TABLE `s_user`
ADD COLUMN `is_created` varchar(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT 0 COMMENT '是否是创建的用户(企业教学负责人等)0否1是' AFTER `agency_code`; ADD COLUMN `is_created` varchar(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT 0 COMMENT '是否是创建的用户(企业教学负责人等)0否1是' AFTER `agency_code`;
/*user表性别默认空*/
ALTER TABLE `s_user`
MODIFY COLUMN `sex` varchar(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '性别(0:男,1:女)' AFTER `phone`;
...@@ -23,8 +23,7 @@ public interface BCourseCodeRepository extends BaseMapper<BCourseCode> { ...@@ -23,8 +23,7 @@ public interface BCourseCodeRepository extends BaseMapper<BCourseCode> {
*/ */
@Select("<script>select * from b_course_code where 1=1 " @Select("<script>select * from b_course_code where 1=1 "
+ "<if test=\"delFlag !=null and delFlag != '' \">and del_flag = #{delFlag} </if> " + "<if test=\"delFlag !=null and delFlag != '' \">and del_flag = #{delFlag} </if> "
+ "<if test=\"flag !=null and flag != '' \">and flag = #{flag} </if> " + "order by seq asc</script>")
+ "</script>")
@ResultMap(value = "BaseResultMap" ) @ResultMap(value = "BaseResultMap" )
List<BCourseCode> queryBCourseCodes(BCourseCode bCourseCode); List<BCourseCode> queryBCourseCodes(BCourseCode bCourseCode);
......
...@@ -54,7 +54,6 @@ public class BCourseCodeServiceImpl implements BCourseCodeService { ...@@ -54,7 +54,6 @@ public class BCourseCodeServiceImpl implements BCourseCodeService {
*/ */
@Override @Override
public List<BCourseCode> findAll(BCourseCode bCourseCode){ public List<BCourseCode> findAll(BCourseCode bCourseCode){
bCourseCode.setStart();
bCourseCode.setNotDeleted(); bCourseCode.setNotDeleted();
return bCourseCodeRepository.queryBCourseCodes(bCourseCode); return bCourseCodeRepository.queryBCourseCodes(bCourseCode);
} }
......
...@@ -50,7 +50,6 @@ public class BSl extends IdEntity<BSl> { ...@@ -50,7 +50,6 @@ public class BSl extends IdEntity<BSl> {
private String termCode;//学期编号 private String termCode;//学期编号
//private String isOnline;//是否上线,(0:待上线,1:已上线,2:已下线) //private String isOnline;//是否上线,(0:待上线,1:已上线,2:已下线)
@Length(min = 1,max = 128,message = "长度最小为1,最大为100") @Length(min = 1,max = 128,message = "长度最小为1,最大为100")
@NotBlank
private String slCoverUrl; //课程封面 private String slCoverUrl; //课程封面
@Length(min = 1,max = 200,message = "长度最小为1,最大为200") @Length(min = 1,max = 200,message = "长度最小为1,最大为200")
private String slNotes; //课程简介 private String slNotes; //课程简介
...@@ -61,10 +60,8 @@ public class BSl extends IdEntity<BSl> { ...@@ -61,10 +60,8 @@ public class BSl extends IdEntity<BSl> {
@Length(min = 1,max = 256,message = "长度最小为1,最大为200") @Length(min = 1,max = 256,message = "长度最小为1,最大为200")
private String recommendCourse; //推荐原因 private String recommendCourse; //推荐原因
@Length(min = 1,max = 32,message = "长度最小为1,最大为30") @Length(min = 1,max = 32,message = "长度最小为1,最大为30")
@NotBlank
private String gitLabProjectId; //gitlab项目id private String gitLabProjectId; //gitlab项目id
@Length(min = 1,max = 256,message = "长度最小为1,最大为200") @Length(min = 1,max = 256,message = "长度最小为1,最大为200")
@NotBlank
private String gitLabProjectName; //gitlab项目名 private String gitLabProjectName; //gitlab项目名
@Length(min = 1,max = 8,message = "长度最小为1,最大为8") @Length(min = 1,max = 8,message = "长度最小为1,最大为8")
@NotBlank @NotBlank
......
...@@ -56,6 +56,7 @@ public class BStudent extends IdEntity<BStudent> { ...@@ -56,6 +56,7 @@ public class BStudent extends IdEntity<BStudent> {
private String recommendCourse; private String recommendCourse;
/*年级*/ /*年级*/
@Length(min = 1,max = 15,message = "长度最小为8,最大为15")
private String gradeCode; private String gradeCode;
@Length(min = 1,max = 15,message = "长度最小为1,最大为15") @Length(min = 1,max = 15,message = "长度最小为1,最大为15")
......
...@@ -21,29 +21,13 @@ public interface BTeacherRepository extends BaseMapper<BTeacher> { ...@@ -21,29 +21,13 @@ public interface BTeacherRepository extends BaseMapper<BTeacher> {
* @param param * @param param
* @return * @return
*/ */
@Select("<script>SELECT\n" + @Select("<script>SELECT b.`business_id`,b.`is_recommend`,b.`recommend_date`,b.`recommend_order`,b.`recommend_course`,b.`code`,\n" +
"\tb.`business_id`,\n" + "b.create_by,b.create_date,b.del_flag,b.flag,b.remarks,b.update_by,b.update_date,u.`name`,u.email,\n" +
"\tb.`is_recommend`,\n" + "u.phone,u.sex,u.head_pic,u.agency_code,ba.`name` as agencyName\n" +
"\tb.`recommend_date`,\n" + "FROM b_teacher b\n" +
"\tb.`recommend_order`,\n" +
"\tb.`recommend_course`,\n" +
"\tb.`code`,\n" +
"\tb.create_by,\n" +
"\tb.create_date,\n" +
"\tb.del_flag,\n" +
"\tb.flag,\n" +
"\tb.remarks,\n" +
"\tb.update_by,\n" +
"\tb.update_date,\n" +
"\tu.`name`,\n" +
"\tu.email,\n" +
"\tu.phone,\n" +
"\tu.sex,\n" +
"\tu.head_pic\n" +
"FROM\n" +
"\tb_teacher b\n" +
"LEFT JOIN s_user u ON b.`code` = u.login_name\n" + "LEFT JOIN s_user u ON b.`code` = u.login_name\n" +
" where b.del_flag != 1" + "LEFT JOIN b_agency ba ON u.agency_code = ba.`code`\n" +
"where b.del_flag != 1" +
"<if test=\"name!=null\">and u.`name` like #{name}</if>"+ "<if test=\"name!=null\">and u.`name` like #{name}</if>"+
"<if test=\"code!=null\">and b.`code` like #{code}</if>" + "<if test=\"code!=null\">and b.`code` like #{code}</if>" +
"<if test=\"teacherCode!=null\">and b.`code` != #{teacherCode}</if></script>") "<if test=\"teacherCode!=null\">and b.`code` != #{teacherCode}</if></script>")
......
...@@ -66,6 +66,13 @@ public class BTeacher extends IdEntity<BTeacher> { ...@@ -66,6 +66,13 @@ public class BTeacher extends IdEntity<BTeacher> {
@Transient @Transient
private String teacherCode; private String teacherCode;
@Transient
private String agencyName;
@Transient
private String agencyCode;
public BTeacher(String code) { public BTeacher(String code) {
this.code = code; this.code = code;
} }
......
package org.rcisoft.core.util;
/**
* 判断字符串中是否含有中文
* Created by Administrator on 2018/4/26.
*/
public class TestChinese {
public static boolean isChineseChar(char c) {
return c >= 0x4E00 && c <= 0x9FA5;// 根据字节码判断
}
public static boolean isChinese(String str) {
if (str == null) return false;
for (char c : str.toCharArray()) {
if (isChineseChar(c)) return true;// 有一个中文字符就返回
}
return false;
}
}
...@@ -29,6 +29,7 @@ public class ExcelDownloadController { ...@@ -29,6 +29,7 @@ public class ExcelDownloadController {
private static final String STUDNET_SL_FILE_NAME = "student-sl.xls"; private static final String STUDNET_SL_FILE_NAME = "student-sl.xls";
private static final String LESSON_FILE_NAME = "lesson.xls"; private static final String LESSON_FILE_NAME = "lesson.xls";
private static final String SL_FILE_NAME = "sl.xls"; private static final String SL_FILE_NAME = "sl.xls";
private static final String ROOM_FILE_NAME = "room.xls";
@Autowired @Autowired
private Global global; private Global global;
...@@ -89,6 +90,9 @@ public class ExcelDownloadController { ...@@ -89,6 +90,9 @@ public class ExcelDownloadController {
case "7": case "7":
name = SL_FILE_NAME; name = SL_FILE_NAME;
break; break;
case "8":
name = ROOM_FILE_NAME;
break;
} }
return name; return name;
} }
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
<insert id="addExcel"> <insert id="addExcel">
insert into b_rooms(business_id,campus,building,classroom_no,classroom_name,category,class_seat,exam_seat, insert into b_rooms(business_id,campus,building,classroom_no,classroom_name,category,class_seat,exam_seat,
plan,flag,del_flag,update_by,create_by,create_date,update_date,code) plan,flag,del_flag,update_by,create_by,create_date,update_date,`code`)
values values
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
(#{item.businessId},#{item.campus},#{item.building}, (#{item.businessId},#{item.campus},#{item.building},
......
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