LIVE_YE пре 1 година
родитељ
комит
c0bcf97124

+ 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();
     }
 

+ 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);
                 }
 
                 //新增用户与角色管理