个人中心

hehai
mzh820631607 4 years ago
parent 2c85fdf738
commit 67c6f15c52
  1. 4
      src/main/java/com/msdw/tms/api/EvaluationRecordControllerApi.java
  2. 10
      src/main/java/com/msdw/tms/controller/EvaluationRecordController.java
  3. 15
      src/main/java/com/msdw/tms/controller/UserController.java
  4. 3
      src/main/java/com/msdw/tms/dao/UserDao.java
  5. 3
      src/main/java/com/msdw/tms/service/UserService.java
  6. 5
      src/main/java/com/msdw/tms/service/impl/UserServiceImpl.java
  7. 29
      src/main/resources/mapper/tms/UserDao.xml

@ -75,8 +75,8 @@ public interface EvaluationRecordControllerApi {
/** /**
* 查询是否能够开启实验 * 查询是否能够开启实验
*/ */
@ApiOperation(value = "查询是否能够开启实验", notes = "查询是否能够开启实验") // @ApiOperation(value = "查询是否能够开启实验", notes = "查询是否能够开启实验")
R isOpenExperiment(Integer userId); // R isOpenExperiment(Integer userId);
@ApiOperation(value = "查询是否能开启虚拟仿真实验",notes = "查询是否能开启虚拟仿真实验") @ApiOperation(value = "查询是否能开启虚拟仿真实验",notes = "查询是否能开启虚拟仿真实验")
R isOpenExercise(Integer userId); R isOpenExercise(Integer userId);

@ -119,7 +119,7 @@ public class EvaluationRecordController implements EvaluationRecordControllerApi
* @param userId * @param userId
* @return * @return
*/ */
@Override // @Override
@GetMapping("/can_experiment") @GetMapping("/can_experiment")
public R isOpenExperiment(Integer userId) { public R isOpenExperiment(Integer userId) {
boolean openExperiment = evaluationRecordService.isOpenExperiment(userId); boolean openExperiment = evaluationRecordService.isOpenExperiment(userId);
@ -135,10 +135,10 @@ public class EvaluationRecordController implements EvaluationRecordControllerApi
if (score>=60){ if (score>=60){
return R.ok("true"); return R.ok("true");
}else{ }else{
return R.error("false"); return R.error(200,"false");
} }
}else{ }else{
return R.error("false"); return R.error(200,"false");
} }
} }
@ -152,10 +152,10 @@ public class EvaluationRecordController implements EvaluationRecordControllerApi
if (score>=60){ if (score>=60){
return R.ok("true"); return R.ok("true");
}else{ }else{
return R.error("false"); return R.error(200,"false");
} }
}else{ }else{
return R.error("false"); return R.error(200,"false");
} }
} }

@ -84,7 +84,20 @@ public class UserController implements UserControllerApi {
// userInfoService.updateById(userInfo); // userInfoService.updateById(userInfo);
for (int i = 0;i<entityList.size();i++){ for (int i = 0;i<entityList.size();i++){
UserPersonalFileEntity personalFile = entityList.get(i); UserPersonalFileEntity personalFile = entityList.get(i);
userService.updateUserPersonal(personalFile); Integer personalFileId = personalFile.getPersonalFileId();
if (personalFile.getPersonalCareerId()==null){
return R.error(403,"false,personalCareerId can not be empty!!!");
}
if(personalFileId==null){
userService.insertPersonalInfo(personalFile);
}else{
userService.updateUserPersonal(personalFile);
}
// if (personalFileId>0&&personalFileId!=null){
// userService.updateUserPersonal(personalFile);
// }else if(personalFileId==null){
// userService.insertPersonalInfo(personalFile);
// }
} }
return R.ok(); return R.ok();
} }

@ -17,5 +17,8 @@ public interface UserDao extends BaseMapper<UserEntity> {
void updateUserPersonal(UserPersonalFileEntity vo); void updateUserPersonal(UserPersonalFileEntity vo);
List<UserProsonalEntityVo> queryPersonalFile(Integer userid); List<UserProsonalEntityVo> queryPersonalFile(Integer userid);
List<UserProsonalEntityVo> queryUserInfo(Integer userid); List<UserProsonalEntityVo> queryUserInfo(Integer userid);
void insertPersonalInfo(UserPersonalFileEntity personalFile);
} }

@ -2,6 +2,7 @@ package com.msdw.tms.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.msdw.tms.common.utils.PageUtils; import com.msdw.tms.common.utils.PageUtils;
import com.msdw.tms.entity.PersonalFileEntity;
import com.msdw.tms.entity.UserEntity; import com.msdw.tms.entity.UserEntity;
import com.msdw.tms.entity.UserInfoEntity; import com.msdw.tms.entity.UserInfoEntity;
import com.msdw.tms.entity.UserPersonalFileEntity; import com.msdw.tms.entity.UserPersonalFileEntity;
@ -21,4 +22,6 @@ public interface UserService extends IService<UserEntity> {
void updateUserPersonal(UserPersonalFileEntity personalFile); void updateUserPersonal(UserPersonalFileEntity personalFile);
HashMap<String,UserProsonalEntityVo> queryUserInfo(Integer id); HashMap<String,UserProsonalEntityVo> queryUserInfo(Integer id);
void insertPersonalInfo(UserPersonalFileEntity personalFile);
} }

@ -62,4 +62,9 @@ public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements
map.put("userPersonalFile",userEntityVos); map.put("userPersonalFile",userEntityVos);
return map; return map;
} }
@Override
public void insertPersonalInfo(UserPersonalFileEntity personalFile) {
userMapper.insertPersonalInfo(personalFile);
}
} }

@ -69,21 +69,28 @@
<update id="updateUserPersonal" parameterType="com.msdw.tms.entity.vo.UserProsonalEntityVo"> <update id="updateUserPersonal" parameterType="com.msdw.tms.entity.vo.UserProsonalEntityVo">
UPDATE UPDATE
hr_personal_file per hr_personal_file per
SET <set>
per.personalCareerId = #{personalCareerId}, <if test="personalCareerId!=null">per.personalCareerId = #{personalCareerId},</if>
per.schoolId = #{schoolId}, <if test="schoolId!=null">per.schoolId = #{schoolId},</if>
per.schoolName = #{schoolName}, <if test="schoolName!=null">per.schoolName = #{schoolName},</if>
per.disciplineId = #{disciplineId}, <if test="disciplineId!=null">per.disciplineId = #{disciplineId},</if>
per.disciplineName = #{disciplineName}, <if test="disciplineName!=null">per.disciplineName = #{disciplineName},</if>
per.professionalId = #{professionalId}, <if test="professionalId!=null">per.professionalId = #{professionalId},</if>
per.professionalName = #{professionalName}, <if test="professionalName!=null">per.professionalName = #{professionalName},</if>
per.professionalClassId = #{professionalClassId}, <if test="professionalClassId!=null">per.professionalClassId = #{professionalClassId},</if>
per.professionalClassName = #{professionalClassName}, <if test="professionalClassName!=null">per.professionalClassName = #{professionalClassName},</if>
per.updatetime = NOW() <if test="updatetime==null">per.updatetime = NOW()</if>
</set>
WHERE WHERE
per.userId = #{userId} per.userId = #{userId}
AND AND
per.personalFileId = #{personalFileId} per.personalFileId = #{personalFileId}
</update> </update>
<insert id="insertPersonalInfo" parameterType="int">
INSERT INTO hr_personal_file ( userId, personalCareerId, schoolId, schoolName, disciplineId, disciplineName, professionalId, professionalName, professionalClassId, professionalClassName, updatetime )
VALUES
(#{userId},#{personalCareerId,jdbcType=INTEGER},#{schoolId,jdbcType=INTEGER},#{schoolName,jdbcType=VARCHAR},#{disciplineId,jdbcType=INTEGER},#{disciplineName,jdbcType=VARCHAR},#{professionalId,jdbcType=INTEGER},#{professionalName,jdbcType=VARCHAR},#{professionalClassId,jdbcType=INTEGER},#{professionalClassName,jdbcType=INTEGER},NOW())
</insert>
</mapper> </mapper>
Loading…
Cancel
Save