Преглед на файлове

Merge remote-tracking branch 'origin/master'

Administrator преди 1 година
родител
ревизия
2633458c25

+ 2 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/StudentInfoMapper.java

@@ -58,4 +58,6 @@ public interface StudentInfoMapper
      * @return 结果
      */
     public int deleteStudentInfoByIds(Long[] ids);
+
+    StudentInfo selectStudentInfoByStudentId(Long studentId);
 }

+ 3 - 2
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/RegisterParentsServiceImpl.java

@@ -16,6 +16,7 @@ import org.springframework.stereotype.Service;
 import com.ruoyi.system.mapper.RegisterParentsMapper;
 import com.ruoyi.system.domain.RegisterParents;
 import com.ruoyi.system.service.IRegisterParentsService;
+import org.springframework.transaction.annotation.Transactional;
 
 /**
  * 注册-家长Service业务层处理
@@ -24,7 +25,7 @@ import com.ruoyi.system.service.IRegisterParentsService;
  * @date 2023-05-25
  */
 @Service
-public class RegisterParentsServiceImpl implements IRegisterParentsService 
+public class RegisterParentsServiceImpl implements IRegisterParentsService
 {
     @Autowired
     private RegisterParentsMapper registerParentsMapper;
@@ -63,6 +64,7 @@ public class RegisterParentsServiceImpl implements IRegisterParentsService
      * @return 结果
      */
     @Override
+    @Transactional
     public AjaxResult insertRegisterParents(RegisterParents registerParents)
     {
 
@@ -93,7 +95,6 @@ public class RegisterParentsServiceImpl implements IRegisterParentsService
             }
         }
 
-
         return count > 0 ? AjaxResult.success() : AjaxResult.error();
     }
 

+ 29 - 7
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/StudentInfoOldServiceImpl.java

@@ -111,14 +111,36 @@ public class StudentInfoOldServiceImpl implements IStudentInfoOldService
         List<Object> x = new ArrayList<>();
         List<Object> y1 = new ArrayList<>();
         List<Object> y2 = new ArrayList<>();
-        for (StudentInfoOld infoOld : StudentInfoOldList) {
-            x.add(DateUtils.dateTime(infoOld.getUpdateTime()));
-            y1.add(infoOld.getHeight());
-            y2.add(infoOld.getWeight());
+        String sg = "0";
+        String tz = "0";
+
+        for (int i = 0; i < StudentInfoOldList.size(); i++) {
+            StudentInfoOld infoOld = StudentInfoOldList.get(i);
+            if(i==0){
+                sg = infoOld.getHeight();
+                tz = infoOld.getWeight();
+                x.add(DateUtils.dateTime(infoOld.getUpdateTime()));
+                y1.add(infoOld.getHeight());
+                y2.add(infoOld.getWeight());
+
+                map.put("X",x);
+                map.put("Y1",y1);
+                map.put("Y2",y2);
+            }else{
+                if(!sg.equals(infoOld.getHeight()) || !tz.equals(infoOld.getWeight())){
+                    sg = infoOld.getHeight();
+                    tz = infoOld.getWeight();
+                    x.add(DateUtils.dateTime(infoOld.getUpdateTime()));
+                    y1.add(infoOld.getHeight());
+                    y2.add(infoOld.getWeight());
+
+                    map.put("X",x);
+                    map.put("Y1",y1);
+                    map.put("Y2",y2);
+                }
+            }
         }
-        map.put("X",x);
-        map.put("Y1",y1);
-        map.put("Y2",y2);
+
         return AjaxResult.success("成功",map);
     }
 }

+ 1 - 1
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/StudentInfoServiceImpl.java

@@ -85,7 +85,7 @@ public class StudentInfoServiceImpl implements IStudentInfoService
     public int updateStudentInfo(StudentInfo studentInfo)
     {
         //查询修改前数据
-        StudentInfo student = studentInfoMapper.selectStudentInfoById(studentInfo.getId());
+        StudentInfo student = studentInfoMapper.selectStudentInfoByStudentId(studentInfo.getStudentId());
         StudentInfoOld studentInfoOld = new StudentInfoOld();
         ClassUtils.copyProperties(student, studentInfoOld);
         studentInfoOld.setCreateTime(DateUtils.getNowDate());

+ 4 - 1
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ZhxyShyjServiceImpl.java

@@ -178,13 +178,16 @@ public class ZhxyShyjServiceImpl implements IZhxyShyjService
                 if(use==null){
                     use = new SysUser();
                     use.setOpenId(registerTeacher.getOpenId());
-                    //use.setDeptId(dept.getDeptId());
+                    use.setDeptId(registerTeacher.getSchoolId());
                     use.setUserName(registerTeacher.getUserPhone());
                     use.setNickName(registerTeacher.getUserName());
                     use.setPhonenumber(registerTeacher.getUserPhone());
                     use.setPassword(SecurityUtils.encryptPassword("1qaz!QAZ"));
                     use.setCreateTime(DateUtils.getNowDate());
                     userMapper.insertUser(use);
+                }else{
+                    use.setDeptId(registerTeacher.getSchoolId());
+                    userMapper.updateUser(use);
                 }
 
                 //新增用户与角色管理

+ 5 - 0
ruoyi-system/src/main/resources/mapper/system/StudentInfoMapper.xml

@@ -79,12 +79,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="address != null  and address != ''"> and s.address = #{address}</if>
             <if test="classId != null "> and f.class_id = #{classId}</if>
         </where>
+        order by create_time desc;
     </select>
     
     <select id="selectStudentInfoById" parameterType="Long" resultMap="StudentInfoResult">
         <include refid="selectStudentInfoVo"/>
         where id = #{id}
     </select>
+    <select id="selectStudentInfoByStudentId" resultMap="StudentInfoResult">
+        <include refid="selectStudentInfoVo"/>
+        where student_id = #{studentId}
+    </select>
 
 
     <insert id="insertStudentInfo" parameterType="StudentInfo" useGeneratedKeys="true" keyProperty="id">