Browse Source

Merge branch 'dev' of ssh://10.10.100.21/source/smartschool-platform into dev

zhaoy 7 years ago
parent
commit
b81e1219ef

+ 5 - 0
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/basic/service/impl/ClassServiceImpl.java

@@ -55,6 +55,10 @@ public class ClassServiceImpl implements ClassService{
         Long id = clazz.getClazz_id();
         Long school_id = BaseContextHolder.getSchoolId();
         school_id = 1l;
+        //判断是否存在年纪名称
+        if (StringUtils.isEmpty(clazz.getClazz_grade())) {
+            throw new BizException(BizExceptionCode.NONGRADE);
+        }
 
         //插入从表数据
         List<SysTeacherClazz> insertDetails = new ArrayList<>();
@@ -63,6 +67,7 @@ public class ClassServiceImpl implements ClassService{
         //新增
         if (StringUtils.isEmpty(id) || "0".equals(id.toString())) {
             clazz.setClazz_status(1);
+            clazz.setClazz_nickname(clazz.getClazz_grade() + clazz.getClazz_name());
             sysClazzMapper.insertSelective(clazz);
             for (SysTeacherClazz teacher : teachers) {
                 teacher.setClazz_id(clazz.getClazz_id());

+ 2 - 0
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/basic/service/impl/GradeServiceImpl.java

@@ -136,6 +136,8 @@ public class GradeServiceImpl implements GradeService{
                         if (null != detail) {
                            detail.setGrade_id(grade_id);
                            detail.setClazz_status(1);
+                           detail.setClazz_grade(grade.getGrade_name());
+                           detail.setClazz_nickname(grade.getGrade_name() + detail.getClazz_name());
                            clazzes.add(detail);
                         }
                     }

+ 1 - 0
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/basic/service/impl/StudentServiceImpl.java

@@ -75,6 +75,7 @@ public class StudentServiceImpl implements StudentService{
         List<SysParents> items = formdata.getItems();
         Long id = student.getStu_id();
         Long schoolid = BaseContextHolder.getSchoolId();
+        schoolid = 1l;
         //插入从表数据
         List<SysParents> insertDetails = new ArrayList<>();
         //更新从表数据

+ 2 - 1
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/exception/BizExceptionCode.java

@@ -11,7 +11,8 @@ public enum BizExceptionCode implements BaseExceptionCode {
     BIZ_IMPORT_ERROREXCEL(500002, "请选用正确的导入模板"),
     EMPTY_DATA(76100,"数据为空,请填写后再保存"),
     EXISTS_STU(500003,"该班级存在学生,无法删除"),
-    USELESS_DATA(50001, "无效数据");
+    USELESS_DATA(50001, "无效数据"),
+    NONGRADE(500004, "无年纪名称");
 
     private int code;
     private String message;

+ 20 - 0
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/po/SysClazz.java

@@ -22,8 +22,28 @@ public class SysClazz implements Serializable{
 
     private Integer clazz_no;
 
+    private String clazz_grade;
+
+    private String clazz_nickname;
+
     private Boolean leaf = true;
 
+    public String getClazz_grade() {
+        return clazz_grade;
+    }
+
+    public void setClazz_grade(String clazz_grade) {
+        this.clazz_grade = clazz_grade;
+    }
+
+    public String getClazz_nickname() {
+        return clazz_nickname;
+    }
+
+    public void setClazz_nickname(String clazz_nickname) {
+        this.clazz_nickname = clazz_nickname;
+    }
+
     public Boolean getLeaf() {
         return leaf;
     }

+ 60 - 0
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/po/SysStudent.java

@@ -37,6 +37,66 @@ public class SysStudent {
 
     private Long school_id;
 
+    private String stu_classnickname;
+
+    private String stu_class;
+
+    private String stu_grade;
+
+    private String stu_native;
+
+    private String stu_nation;
+
+    private String stu_political;
+
+    public String getStu_classnickname() {
+        return stu_classnickname;
+    }
+
+    public void setStu_classnickname(String stu_classnickname) {
+        this.stu_classnickname = stu_classnickname;
+    }
+
+    public String getStu_class() {
+        return stu_class;
+    }
+
+    public void setStu_class(String stu_class) {
+        this.stu_class = stu_class;
+    }
+
+    public String getStu_grade() {
+        return stu_grade;
+    }
+
+    public void setStu_grade(String stu_grade) {
+        this.stu_grade = stu_grade;
+    }
+
+    public String getStu_native() {
+        return stu_native;
+    }
+
+    public void setStu_native(String stu_native) {
+        this.stu_native = stu_native;
+    }
+
+    public String getStu_nation() {
+        return stu_nation;
+    }
+
+    public void setStu_nation(String stu_nation) {
+        this.stu_nation = stu_nation;
+    }
+
+    public String getStu_political() {
+        return stu_political;
+    }
+
+    public void setStu_political(String stu_political) {
+        this.stu_political = stu_political;
+    }
+
     public Long getStu_id() {
         return stu_id;
     }

+ 20 - 0
applications/school/school-server/src/main/resources/mapper/SysClazzMapper.xml

@@ -8,6 +8,8 @@
     <result column="clazz_status" property="clazz_status" jdbcType="INTEGER" />
     <result column="clazz_remarks" property="clazz_remarks" jdbcType="VARCHAR" />
     <result column="grade_id" property="grade_id" jdbcType="BIGINT" />
+    <result column="clazz_nickname" property="clazz_nickname" jdbcType="VARCHAR" />
+    <result column="clazz_grade" property="clazz_grade" jdbcType="VARCHAR" />
   </resultMap>
   <sql id="Base_Column_List" >
     clazz_id, clazz_name, clazz_adress, clazz_status, clazz_remarks, grade_id
@@ -52,6 +54,12 @@
       <if test="grade_id != null" >
         grade_id,
       </if>
+      <if test="clazz_grade != null" >
+        clazz_grade,
+      </if>
+      <if test="clazz_nickname != null" >
+        clazz_nickname,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides="," >
       <if test="clazz_name != null" >
@@ -69,6 +77,12 @@
       <if test="grade_id != null" >
         #{grade_id,jdbcType=BIGINT},
       </if>
+      <if test="clazz_grade != null" >
+        #{clazz_grade,jdbcType=VARCHAR},
+      </if>
+      <if test="clazz_nickname != null" >
+        #{clazz_nickname,jdbcType=VARCHAR},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.smartschool.school.po.SysClazz" >
@@ -89,6 +103,12 @@
       <if test="grade_id != null" >
         grade_id = #{grade_id,jdbcType=BIGINT},
       </if>
+      <if test="clazz_nickname != null" >
+        clazz_nickname = #{clazz_nickname,jdbcType=VARCHAR},
+      </if>
+      <if test="clazz_grade != null" >
+        clazz_grade = #{clazz_grade,jdbcType=VARCHAR},
+      </if>
     </set>
     where clazz_id = #{clazz_id,jdbcType=BIGINT}
   </update>

+ 62 - 1
applications/school/school-server/src/main/resources/mapper/SysStudentMapper.xml

@@ -17,7 +17,14 @@
     <result column="stu_remarks" property="stu_remarks" jdbcType="VARCHAR" />
     <result column="clazz_id" property="clazz_id" jdbcType="BIGINT" />
     <result column="school_id" property="school_id" jdbcType="BIGINT" />
+    <result column="stu_classnickname" property="stu_classnickname" jdbcType="VARCHAR" />
+    <result column="stu_class" property="stu_class" jdbcType="VARCHAR" />
+    <result column="stu_grade" property="stu_grade" jdbcType="VARCHAR" />
+    <result column="stu_native" property="stu_native" jdbcType="VARCHAR" />
+    <result column="stu_nation" property="stu_nation" jdbcType="VARCHAR" />
+    <result column="stu_political" property="stu_political" jdbcType="VARCHAR" />
   </resultMap>
+
   <sql id="Base_Column_List" >
     stu_id, stu_number, stu_name, stu_enroll_date, stu_graduate_date, stu_birthday, stu_age, 
     stu_sex, stu_address, stu_photo, stu_status, stu_is_write, stu_remarks, clazz_id, 
@@ -25,7 +32,7 @@
   </sql>
   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
     select 
-    <include refid="Base_Column_List" />
+    *
     from sys_student
     where stu_id = #{stu_id,jdbcType=BIGINT}
   </select>
@@ -95,6 +102,24 @@
       <if test="school_id != null" >
         school_id,
       </if>
+      <if test="stu_classnickname != null" >
+        stu_classnickname,
+      </if>
+      <if test="stu_class != null" >
+        stu_class,
+      </if>
+      <if test="stu_grade != null" >
+        stu_grade,
+      </if>
+      <if test="stu_native != null" >
+        stu_native,
+      </if>
+      <if test="stu_nation != null" >
+        stu_nation,
+      </if>
+      <if test="stu_political != null" >
+        stu_political,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides="," >
       <if test="stu_number != null" >
@@ -139,6 +164,24 @@
       <if test="school_id != null" >
         #{school_id,jdbcType=BIGINT},
       </if>
+      <if test="stu_classnickname != null" >
+        #{stu_classnickname,jdbcType=VARCHAR},
+      </if>
+      <if test="stu_class != null" >
+        #{stu_class,jdbcType=VARCHAR},
+      </if>
+      <if test="stu_grade != null" >
+        #{stu_grade,jdbcType=VARCHAR},
+      </if>
+      <if test="stu_native != null" >
+        #{stu_native,jdbcType=VARCHAR},
+      </if>
+      <if test="stu_nation != null" >
+        #{stu_nation,jdbcType=VARCHAR},
+      </if>
+      <if test="stu_political != null" >
+        #{stu_political,jdbcType=VARCHAR},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.smartschool.school.po.SysStudent" >
@@ -186,6 +229,24 @@
       <if test="school_id != null" >
         school_id = #{school_id,jdbcType=BIGINT},
       </if>
+      <if test="stu_classnickname != null" >
+        stu_classnickname = #{stu_classnickname,jdbcType=VARCHAR},
+      </if>
+      <if test="stu_class != null" >
+        stu_class = #{stu_class,jdbcType=VARCHAR},
+      </if>
+      <if test="stu_grade != null" >
+        stu_grade = #{stu_grade,jdbcType=VARCHAR},
+      </if>
+      <if test="stu_native != null" >
+        stu_native = #{stu_native,jdbcType=VARCHAR},
+      </if>
+      <if test="stu_nation != null" >
+        stu_nation = #{stu_nation,jdbcType=VARCHAR},
+      </if>
+      <if test="stu_political != null" >
+        stu_political = #{stu_political,jdbcType=VARCHAR},
+      </if>
     </set>
     where stu_id = #{stu_id,jdbcType=BIGINT}
   </update>