From a00f39501304841d56a0efa32f3d5e3d78a9e3f2 Mon Sep 17 00:00:00 2001 From: mzh820631607 Date: Tue, 29 Sep 2020 17:04:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=AD=E5=BF=83,=E7=8F=AD?= =?UTF-8?q?=E7=BA=A7=E5=88=97=E8=A1=A82020.09.29?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ClassTeachingController.java | 2 +- .../msdw/tms/controller/UserController.java | 5 -- .../java/com/msdw/tms/dao/QuestionsDao.java | 3 + src/main/java/com/msdw/tms/dao/UserDao.java | 2 + .../com/msdw/tms/entity/SchoolEntity.java | 34 +++++++++ .../com/msdw/tms/entity/UserInfoEntity.java | 2 +- .../tms/entity/UserPersonalFileEntity.java | 2 +- .../tms/entity/vo/UserProsonalEntityVo.java | 4 +- .../impl/EvaluationRulesServiceImpl.java | 10 +-- .../tms/service/impl/UserServiceImpl.java | 8 ++- .../resources/mapper/tms/ClassTeachingDao.xml | 3 +- .../resources/mapper/tms/QuestionsDao.xml | 9 +++ src/main/resources/mapper/tms/UserDao.xml | 72 +++++++++++++------ src/main/resources/mapper/tms/UserInfoDao.xml | 4 +- 14 files changed, 119 insertions(+), 41 deletions(-) create mode 100644 src/main/java/com/msdw/tms/entity/SchoolEntity.java diff --git a/src/main/java/com/msdw/tms/controller/ClassTeachingController.java b/src/main/java/com/msdw/tms/controller/ClassTeachingController.java index 41fe464..e696b86 100644 --- a/src/main/java/com/msdw/tms/controller/ClassTeachingController.java +++ b/src/main/java/com/msdw/tms/controller/ClassTeachingController.java @@ -76,7 +76,7 @@ public class ClassTeachingController implements ClassTeachingApi { if (isCode==0){ if (invitationCode!=null){ entity.setIsCode(isCode).setProjectId(projectId); - ExperimentalTeachingEntity result= classTeachingService.queryInvitationcode(entity); + ExperimentalTeachingEntity result= classTeachingService.queryInvitationcode(entity);//邀请码唯一 Integer code = result.getInvitationCode(); if (invitationCode.equals(code)==true){ return R.ok(); diff --git a/src/main/java/com/msdw/tms/controller/UserController.java b/src/main/java/com/msdw/tms/controller/UserController.java index 00f2d4a..8e5945b 100644 --- a/src/main/java/com/msdw/tms/controller/UserController.java +++ b/src/main/java/com/msdw/tms/controller/UserController.java @@ -93,11 +93,6 @@ public class UserController implements UserControllerApi { }else{ userService.updateUserPersonal(personalFile); } -// if (personalFileId>0&&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/QuestionsDao.java b/src/main/java/com/msdw/tms/dao/QuestionsDao.java index 7affe47..0a64cba 100644 --- a/src/main/java/com/msdw/tms/dao/QuestionsDao.java +++ b/src/main/java/com/msdw/tms/dao/QuestionsDao.java @@ -20,4 +20,7 @@ public interface QuestionsDao extends BaseMapper { Integer countTotalMultipleNum(); Integer countTotalJudgmentNum(); + + Integer countTotalMultiplenum(); + Integer countTotalJudgmentnum(); } diff --git a/src/main/java/com/msdw/tms/dao/UserDao.java b/src/main/java/com/msdw/tms/dao/UserDao.java index 9729cff..794c5f3 100644 --- a/src/main/java/com/msdw/tms/dao/UserDao.java +++ b/src/main/java/com/msdw/tms/dao/UserDao.java @@ -18,6 +18,8 @@ public interface UserDao extends BaseMapper { List queryPersonalFile(Integer userid); + List queryPersonalFileES(Integer userid); + List queryUserInfo(Integer userid); void insertPersonalInfo(UserPersonalFileEntity personalFile); diff --git a/src/main/java/com/msdw/tms/entity/SchoolEntity.java b/src/main/java/com/msdw/tms/entity/SchoolEntity.java new file mode 100644 index 0000000..ec5c177 --- /dev/null +++ b/src/main/java/com/msdw/tms/entity/SchoolEntity.java @@ -0,0 +1,34 @@ +package com.msdw.tms.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * 学校 + */ +@Data +@Accessors(chain = true) +@TableName("school") +public class SchoolEntity { + + @TableId(type = IdType.AUTO) + private Integer schoolId; + //学校名称 + private String schoolName; + //省份id + private Integer provinceId; + //省份名称 + private String provinceName; + //省份名称 + private Integer cityId; + //城市名 + private String cityName; + //层级 + private Integer level; + //状态(1已删除,0未删除) + private Integer isdel; + +} diff --git a/src/main/java/com/msdw/tms/entity/UserInfoEntity.java b/src/main/java/com/msdw/tms/entity/UserInfoEntity.java index de5b717..b69bda4 100644 --- a/src/main/java/com/msdw/tms/entity/UserInfoEntity.java +++ b/src/main/java/com/msdw/tms/entity/UserInfoEntity.java @@ -33,7 +33,7 @@ public class UserInfoEntity { //证件类型(1、身份证) private Integer documenttype; //身份证 - private String IDNumber; + private String idNumber; //教育程度(1、研究数及以上) private Integer educationDegree; //电话 diff --git a/src/main/java/com/msdw/tms/entity/UserPersonalFileEntity.java b/src/main/java/com/msdw/tms/entity/UserPersonalFileEntity.java index 9c1bfb2..0db7c1c 100644 --- a/src/main/java/com/msdw/tms/entity/UserPersonalFileEntity.java +++ b/src/main/java/com/msdw/tms/entity/UserPersonalFileEntity.java @@ -11,7 +11,7 @@ import java.io.Serializable; @Accessors(chain = true) @Data @TableName("hr_personal_file") -public class UserPersonalFileEntity implements Serializable { +public class UserPersonalFileEntity extends SchoolEntity implements Serializable { private static final long serialVersionUID = 1L; //个人档案 @TableId(type = IdType.AUTO) diff --git a/src/main/java/com/msdw/tms/entity/vo/UserProsonalEntityVo.java b/src/main/java/com/msdw/tms/entity/vo/UserProsonalEntityVo.java index 89a3ed5..be48ad1 100644 --- a/src/main/java/com/msdw/tms/entity/vo/UserProsonalEntityVo.java +++ b/src/main/java/com/msdw/tms/entity/vo/UserProsonalEntityVo.java @@ -13,8 +13,8 @@ public class UserProsonalEntityVo { private List personalFileEntities; private UserInfoEntity userInfoEntity; - private UserEntity userEntity; +// private UserEntity userEntity; //测试用 - private List userEntityVoList; +// private List userEntityVoList; } diff --git a/src/main/java/com/msdw/tms/service/impl/EvaluationRulesServiceImpl.java b/src/main/java/com/msdw/tms/service/impl/EvaluationRulesServiceImpl.java index ec25e96..fc2c9e1 100644 --- a/src/main/java/com/msdw/tms/service/impl/EvaluationRulesServiceImpl.java +++ b/src/main/java/com/msdw/tms/service/impl/EvaluationRulesServiceImpl.java @@ -108,14 +108,16 @@ public class EvaluationRulesServiceImpl extends ServiceImpl implements //用户sql user List userInfo = userMapper.queryUserInfo(id); map.put("userInfo",userInfo); + //个人档案sql - List userEntityVos = userMapper.queryPersonalFile(id); - map.put("userPersonalFile",userEntityVos); +// List userEntityVos = userMapper.queryPersonalFile(id);//档案里有学校信息时 +// map.put("userPersonalFile",userEntityVos); + List prosonalEntityESVos = userMapper.queryPersonalFileES(id);//档案里无学校信息时 + map.put("userPersonalFile",prosonalEntityESVos); + return map; } diff --git a/src/main/resources/mapper/tms/ClassTeachingDao.xml b/src/main/resources/mapper/tms/ClassTeachingDao.xml index ebea109..85675eb 100644 --- a/src/main/resources/mapper/tms/ClassTeachingDao.xml +++ b/src/main/resources/mapper/tms/ClassTeachingDao.xml @@ -16,7 +16,8 @@ experimental_number, start_time, stop_time, - `status` + `status`, + project_id FROM tms_experimental_teaching WHERE diff --git a/src/main/resources/mapper/tms/QuestionsDao.xml b/src/main/resources/mapper/tms/QuestionsDao.xml index 3daac08..6e26302 100644 --- a/src/main/resources/mapper/tms/QuestionsDao.xml +++ b/src/main/resources/mapper/tms/QuestionsDao.xml @@ -46,4 +46,13 @@ SELECT COUNT( 1 ) FROM tms_questions WHERE is_del = 0 AND is_enable = 1 AND question_type = 3 + + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/tms/UserDao.xml b/src/main/resources/mapper/tms/UserDao.xml index ad427fe..45e9c2a 100644 --- a/src/main/resources/mapper/tms/UserDao.xml +++ b/src/main/resources/mapper/tms/UserDao.xml @@ -41,29 +41,47 @@ AND s.isdel = 0 - SELECT - per.personalFileId, - per.schoolId, - per.schoolName, + personalFileId, + schoolId, + schoolName, disciplineId, - disciplineName, + disciplineName, professionalClassId, - per.professionalClassName, - per.professionalId, - per.professionalName, - per.personalCareerId, - s.cityId, - s.cityName, - s.provinceId, - s.provinceName - FROM - hr_personal_file per, - school s - WHERE - per.schoolId = s.schoolId - AND per.userId = #{userId} - AND s.isdel = 0 + professionalClassName, + professionalId, + professionalName, + personalCareerId + FROM + hr_personal_file + WHERE + userId = #{userId} @@ -72,25 +90,35 @@ per.personalCareerId = #{personalCareerId}, per.schoolId = #{schoolId}, + per.schoolId = NULL, per.schoolName = #{schoolName}, + per.schoolName = NULL, per.disciplineId = #{disciplineId}, + per.disciplineId = NULL, per.disciplineName = #{disciplineName}, + per.disciplineName = NULL, per.professionalId = #{professionalId}, + per.professionalId = NULL, per.professionalName = #{professionalName}, + per.professionalName = NULL, per.professionalClassId = #{professionalClassId}, + per.professionalClassId = NULL, per.professionalClassName = #{professionalClassName}, + per.professionalClassName = NULL, per.updatetime = NOW() WHERE per.userId = #{userId} AND per.personalFileId = #{personalFileId} + AND + per.schoolId = s.schoolId - + 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()) + (#{userId},#{personalCareerId},#{schoolId},#{schoolName},#{disciplineId},#{disciplineName},#{professionalId},#{professionalName},#{professionalClassId},#{professionalClassName},NOW()) \ No newline at end of file diff --git a/src/main/resources/mapper/tms/UserInfoDao.xml b/src/main/resources/mapper/tms/UserInfoDao.xml index c181464..2361f75 100644 --- a/src/main/resources/mapper/tms/UserInfoDao.xml +++ b/src/main/resources/mapper/tms/UserInfoDao.xml @@ -33,8 +33,8 @@ educationDegree = #{educationDegree}, - - IDNumber = #{IDNumber}, + + IDNumber = #{idNumber}, provinceId = #{provinceId},