个人中心

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. 13
      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 = "查询是否能够开启实验")
R isOpenExperiment(Integer userId);
// @ApiOperation(value = "查询是否能够开启实验", notes = "查询是否能够开启实验")
// R isOpenExperiment(Integer userId);
@ApiOperation(value = "查询是否能开启虚拟仿真实验",notes = "查询是否能开启虚拟仿真实验")
R isOpenExercise(Integer userId);

@ -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");
}
}

@ -84,8 +84,21 @@ public class UserController implements UserControllerApi {
// userInfoService.updateById(userInfo);
for (int i = 0;i<entityList.size();i++){
UserPersonalFileEntity personalFile = entityList.get(i);
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();
}
// /**

@ -17,5 +17,8 @@ public interface UserDao extends BaseMapper<UserEntity> {
void updateUserPersonal(UserPersonalFileEntity vo);
List<UserProsonalEntityVo> queryPersonalFile(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.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<UserEntity> {
void updateUserPersonal(UserPersonalFileEntity personalFile);
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);
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
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()
<set>
<if test="personalCareerId!=null">per.personalCareerId = #{personalCareerId},</if>
<if test="schoolId!=null">per.schoolId = #{schoolId},</if>
<if test="schoolName!=null">per.schoolName = #{schoolName},</if>
<if test="disciplineId!=null">per.disciplineId = #{disciplineId},</if>
<if test="disciplineName!=null">per.disciplineName = #{disciplineName},</if>
<if test="professionalId!=null">per.professionalId = #{professionalId},</if>
<if test="professionalName!=null">per.professionalName = #{professionalName},</if>
<if test="professionalClassId!=null">per.professionalClassId = #{professionalClassId},</if>
<if test="professionalClassName!=null">per.professionalClassName = #{professionalClassName},</if>
<if test="updatetime==null">per.updatetime = NOW()</if>
</set>
WHERE
per.userId = #{userId}
AND
per.personalFileId = #{personalFileId}
</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>
Loading…
Cancel
Save