From 67c6f15c52d6fd07ae27761b2a9c35d61d03a5e8 Mon Sep 17 00:00:00 2001 From: mzh820631607 Date: Tue, 29 Sep 2020 10:13:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=AD=E5=BF=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/EvaluationRecordControllerApi.java | 4 +-- .../EvaluationRecordController.java | 10 +++---- .../msdw/tms/controller/UserController.java | 15 +++++++++- src/main/java/com/msdw/tms/dao/UserDao.java | 3 ++ .../com/msdw/tms/service/UserService.java | 3 ++ .../tms/service/impl/UserServiceImpl.java | 5 ++++ src/main/resources/mapper/tms/UserDao.xml | 29 ++++++++++++------- 7 files changed, 50 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/msdw/tms/api/EvaluationRecordControllerApi.java b/src/main/java/com/msdw/tms/api/EvaluationRecordControllerApi.java index d2a1bc1..2ec18f6 100644 --- a/src/main/java/com/msdw/tms/api/EvaluationRecordControllerApi.java +++ b/src/main/java/com/msdw/tms/api/EvaluationRecordControllerApi.java @@ -75,8 +75,8 @@ public interface EvaluationRecordControllerApi { /** * 查询是否能够开启实验 */ - @ApiOperation(value = "查询是否能够开启实验", notes = "查询是否能够开启实验") - R isOpenExperiment(Integer userId); +// @ApiOperation(value = "查询是否能够开启实验", notes = "查询是否能够开启实验") +// R isOpenExperiment(Integer userId); @ApiOperation(value = "查询是否能开启虚拟仿真实验",notes = "查询是否能开启虚拟仿真实验") R isOpenExercise(Integer userId); diff --git a/src/main/java/com/msdw/tms/controller/EvaluationRecordController.java b/src/main/java/com/msdw/tms/controller/EvaluationRecordController.java index f6be33a..a2cdf17 100644 --- a/src/main/java/com/msdw/tms/controller/EvaluationRecordController.java +++ b/src/main/java/com/msdw/tms/controller/EvaluationRecordController.java @@ -119,7 +119,7 @@ public class EvaluationRecordController implements EvaluationRecordControllerApi * @param userId * @return */ - @Override +// @Override @GetMapping("/can_experiment") public R isOpenExperiment(Integer userId) { boolean openExperiment = evaluationRecordService.isOpenExperiment(userId); @@ -135,10 +135,10 @@ public class EvaluationRecordController implements EvaluationRecordControllerApi if (score>=60){ return R.ok("true"); }else{ - return R.error("false"); + return R.error(200,"false"); } }else{ - return R.error("false"); + return R.error(200,"false"); } } @@ -152,10 +152,10 @@ public class EvaluationRecordController implements EvaluationRecordControllerApi if (score>=60){ return R.ok("true"); }else{ - return R.error("false"); + return R.error(200,"false"); } }else{ - return R.error("false"); + return R.error(200,"false"); } } diff --git a/src/main/java/com/msdw/tms/controller/UserController.java b/src/main/java/com/msdw/tms/controller/UserController.java index e141e57..00f2d4a 100644 --- a/src/main/java/com/msdw/tms/controller/UserController.java +++ b/src/main/java/com/msdw/tms/controller/UserController.java @@ -84,7 +84,20 @@ public class UserController implements UserControllerApi { // userInfoService.updateById(userInfo); for (int i = 0;i0&&personalFileId!=null){ +// userService.updateUserPersonal(personalFile); +// }else if(personalFileId==null){ +// userService.insertPersonalInfo(personalFile); +// } } return R.ok(); } diff --git a/src/main/java/com/msdw/tms/dao/UserDao.java b/src/main/java/com/msdw/tms/dao/UserDao.java index c01f8ae..9729cff 100644 --- a/src/main/java/com/msdw/tms/dao/UserDao.java +++ b/src/main/java/com/msdw/tms/dao/UserDao.java @@ -17,5 +17,8 @@ public interface UserDao extends BaseMapper { void updateUserPersonal(UserPersonalFileEntity vo); List queryPersonalFile(Integer userid); + List queryUserInfo(Integer userid); + + void insertPersonalInfo(UserPersonalFileEntity personalFile); } diff --git a/src/main/java/com/msdw/tms/service/UserService.java b/src/main/java/com/msdw/tms/service/UserService.java index a286562..eda8181 100644 --- a/src/main/java/com/msdw/tms/service/UserService.java +++ b/src/main/java/com/msdw/tms/service/UserService.java @@ -2,6 +2,7 @@ package com.msdw.tms.service; import com.baomidou.mybatisplus.extension.service.IService; import com.msdw.tms.common.utils.PageUtils; +import com.msdw.tms.entity.PersonalFileEntity; import com.msdw.tms.entity.UserEntity; import com.msdw.tms.entity.UserInfoEntity; import com.msdw.tms.entity.UserPersonalFileEntity; @@ -21,4 +22,6 @@ public interface UserService extends IService { void updateUserPersonal(UserPersonalFileEntity personalFile); HashMap queryUserInfo(Integer id); + + void insertPersonalInfo(UserPersonalFileEntity personalFile); } diff --git a/src/main/java/com/msdw/tms/service/impl/UserServiceImpl.java b/src/main/java/com/msdw/tms/service/impl/UserServiceImpl.java index cd2a2cc..78f7781 100644 --- a/src/main/java/com/msdw/tms/service/impl/UserServiceImpl.java +++ b/src/main/java/com/msdw/tms/service/impl/UserServiceImpl.java @@ -62,4 +62,9 @@ public class UserServiceImpl extends ServiceImpl implements map.put("userPersonalFile",userEntityVos); return map; } + + @Override + public void insertPersonalInfo(UserPersonalFileEntity personalFile) { + userMapper.insertPersonalInfo(personalFile); + } } diff --git a/src/main/resources/mapper/tms/UserDao.xml b/src/main/resources/mapper/tms/UserDao.xml index dded3a0..ad427fe 100644 --- a/src/main/resources/mapper/tms/UserDao.xml +++ b/src/main/resources/mapper/tms/UserDao.xml @@ -69,21 +69,28 @@ UPDATE hr_personal_file per - SET - per.personalCareerId = #{personalCareerId}, - per.schoolId = #{schoolId}, - per.schoolName = #{schoolName}, - per.disciplineId = #{disciplineId}, - per.disciplineName = #{disciplineName}, - per.professionalId = #{professionalId}, - per.professionalName = #{professionalName}, - per.professionalClassId = #{professionalClassId}, - per.professionalClassName = #{professionalClassName}, - per.updatetime = NOW() + + per.personalCareerId = #{personalCareerId}, + per.schoolId = #{schoolId}, + per.schoolName = #{schoolName}, + per.disciplineId = #{disciplineId}, + per.disciplineName = #{disciplineName}, + per.professionalId = #{professionalId}, + per.professionalName = #{professionalName}, + per.professionalClassId = #{professionalClassId}, + per.professionalClassName = #{professionalClassName}, + per.updatetime = NOW() + WHERE per.userId = #{userId} AND per.personalFileId = #{personalFileId} + + + 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()) + \ No newline at end of file