Browse Source

成绩跟新

zhaoy 7 years ago
parent
commit
34532bf1a8

+ 7 - 2
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/business/service/impl/ScoreServiceImpl.java

@@ -321,9 +321,14 @@ public class ScoreServiceImpl implements ScoreService{
         List<ScoreImportdetail> items = data.getItems();
         Long schoolId = BaseContextHolder.getSchoolId();
         //Long gradeId = sysGradeMapper.selectByName(main.getSi_grade(), schoolId).getGrade_id();
+
+        Long classId = 0L;
+        Long gradeId = 0L;
         SysClazz sysClazz = sysClazzMapper.selectByClazzName(main.getSi_grade(), main.getSi_class() , schoolId);
-        Long classId = sysClazz.getClazz_id();
-        Long gradeId = sysClazz.getGrade_id();
+        if(sysClazz != null) {
+            classId = sysClazz.getClazz_id();
+            gradeId = sysClazz.getGrade_id();
+        }
         Long mId = main.getSi_id();
         if (null == main.getSi_id() || 0 == main.getSi_id()){
             main.setSi_date(new Date());

+ 18 - 18
applications/school/school-server/src/main/resources/mapper/ScoreMapper.xml

@@ -489,36 +489,36 @@
       )
   </insert>
 
-  <update id="updateDetailSelective" parameterType="com.usoftchina.smartschool.school.dto.CurriculumDetailDTO">
+  <update id="updateDetailSelective" parameterType="com.usoftchina.smartschool.school.po.ScoreImportdetail">
     <foreach collection="list" item="item" index="index" separator=";">
       update score_importdetail
       <set>
-        <if test="sd_siid != null and sd_siid != 0">
-          sd_siid = #{sd_siid, jdbcType=BIGINT},
+        <if test="item.sd_siid != null">
+            sd_siid = #{item.sd_siid, jdbcType=BIGINT},
         </if>
-        <if test="sd_stuid != null">
-          sd_stuid = #{sd_stuid,jdbcType=BIGINT},
+        <if test="item.sd_stuid != null">
+          sd_stuid = #{item.sd_stuid,jdbcType=BIGINT},
         </if>
-        <if test="sd_stu != null">
-          sd_stu = #{sd_stu,jdbcType=VARCHAR},
+        <if test="item.sd_stu != null">
+          sd_stu = #{item.sd_stu,jdbcType=VARCHAR},
         </if>
-        <if test="sd_score != null">
-          sd_score = #{sd_score,jdbcType=INTEGER},
+        <if test="item.sd_score != null">
+          sd_score = #{item.sd_score,jdbcType=INTEGER},
         </if>
-        <if test="sd_subject != null">
-          sd_subject = #{sd_subject,jdbcType=VARCHAR},
+        <if test="item.sd_subject != null">
+          sd_subject = #{item.sd_subject,jdbcType=VARCHAR},
         </if>
-        <if test="sd_remark != null">
-          sd_remark = #{sd_remark,jdbcType=VARCHAR},
+        <if test="item.sd_remark != null">
+          sd_remark = #{item.sd_remark,jdbcType=VARCHAR},
         </if>
-        <if test="school_id != null">
-          school_id = #{school_id,jdbcType=BIGINT},
+        <if test="item.school_id != null">
+          school_id = #{item.school_id,jdbcType=BIGINT},
         </if>
-        <if test="sd_stuNumber != null">
-          sd_stuNumber = #{sd_stuNumber,jdbcType=VARCHAR},
+        <if test="item.sd_stuNumber != null">
+          sd_stuNumber = #{item.sd_stuNumber,jdbcType=VARCHAR},
         </if>
       </set>
-      WHERE sd_id= #{sd_id,jdbcType=INTEGER}
+      WHERE sd_id= #{item.sd_id,jdbcType=BIGINT}
     </foreach>
   </update>