个人中心,班级列表2020.09.29

hehai
mzh820631607 4 years ago
parent 67c6f15c52
commit a00f395013
  1. 2
      src/main/java/com/msdw/tms/controller/ClassTeachingController.java
  2. 5
      src/main/java/com/msdw/tms/controller/UserController.java
  3. 3
      src/main/java/com/msdw/tms/dao/QuestionsDao.java
  4. 2
      src/main/java/com/msdw/tms/dao/UserDao.java
  5. 34
      src/main/java/com/msdw/tms/entity/SchoolEntity.java
  6. 2
      src/main/java/com/msdw/tms/entity/UserInfoEntity.java
  7. 2
      src/main/java/com/msdw/tms/entity/UserPersonalFileEntity.java
  8. 4
      src/main/java/com/msdw/tms/entity/vo/UserProsonalEntityVo.java
  9. 10
      src/main/java/com/msdw/tms/service/impl/EvaluationRulesServiceImpl.java
  10. 8
      src/main/java/com/msdw/tms/service/impl/UserServiceImpl.java
  11. 3
      src/main/resources/mapper/tms/ClassTeachingDao.xml
  12. 9
      src/main/resources/mapper/tms/QuestionsDao.xml
  13. 66
      src/main/resources/mapper/tms/UserDao.xml
  14. 4
      src/main/resources/mapper/tms/UserInfoDao.xml

@ -76,7 +76,7 @@ public class ClassTeachingController implements ClassTeachingApi {
if (isCode==0){ if (isCode==0){
if (invitationCode!=null){ if (invitationCode!=null){
entity.setIsCode(isCode).setProjectId(projectId); entity.setIsCode(isCode).setProjectId(projectId);
ExperimentalTeachingEntity result= classTeachingService.queryInvitationcode(entity); ExperimentalTeachingEntity result= classTeachingService.queryInvitationcode(entity);//邀请码唯一
Integer code = result.getInvitationCode(); Integer code = result.getInvitationCode();
if (invitationCode.equals(code)==true){ if (invitationCode.equals(code)==true){
return R.ok(); return R.ok();

@ -93,11 +93,6 @@ public class UserController implements UserControllerApi {
}else{ }else{
userService.updateUserPersonal(personalFile); userService.updateUserPersonal(personalFile);
} }
// if (personalFileId>0&&personalFileId!=null){
// userService.updateUserPersonal(personalFile);
// }else if(personalFileId==null){
// userService.insertPersonalInfo(personalFile);
// }
} }
return R.ok(); return R.ok();
} }

@ -20,4 +20,7 @@ public interface QuestionsDao extends BaseMapper<QuestionsEntity> {
Integer countTotalMultipleNum(); Integer countTotalMultipleNum();
Integer countTotalJudgmentNum(); Integer countTotalJudgmentNum();
Integer countTotalMultiplenum();
Integer countTotalJudgmentnum();
} }

@ -18,6 +18,8 @@ public interface UserDao extends BaseMapper<UserEntity> {
List<UserProsonalEntityVo> queryPersonalFile(Integer userid); List<UserProsonalEntityVo> queryPersonalFile(Integer userid);
List<UserProsonalEntityVo> queryPersonalFileES(Integer userid);
List<UserProsonalEntityVo> queryUserInfo(Integer userid); List<UserProsonalEntityVo> queryUserInfo(Integer userid);
void insertPersonalInfo(UserPersonalFileEntity personalFile); void insertPersonalInfo(UserPersonalFileEntity personalFile);

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

@ -33,7 +33,7 @@ public class UserInfoEntity {
//证件类型(1、身份证) //证件类型(1、身份证)
private Integer documenttype; private Integer documenttype;
//身份证 //身份证
private String IDNumber; private String idNumber;
//教育程度(1、研究数及以上) //教育程度(1、研究数及以上)
private Integer educationDegree; private Integer educationDegree;
//电话 //电话

@ -11,7 +11,7 @@ import java.io.Serializable;
@Accessors(chain = true) @Accessors(chain = true)
@Data @Data
@TableName("hr_personal_file") @TableName("hr_personal_file")
public class UserPersonalFileEntity implements Serializable { public class UserPersonalFileEntity extends SchoolEntity implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
//个人档案 //个人档案
@TableId(type = IdType.AUTO) @TableId(type = IdType.AUTO)

@ -13,8 +13,8 @@ public class UserProsonalEntityVo {
private List<UserPersonalFileEntity> personalFileEntities; private List<UserPersonalFileEntity> personalFileEntities;
private UserInfoEntity userInfoEntity; private UserInfoEntity userInfoEntity;
private UserEntity userEntity; // private UserEntity userEntity;
//测试用 //测试用
private List<UserEntityVo> userEntityVoList; // private List<UserEntityVo> userEntityVoList;
} }

@ -108,14 +108,16 @@ public class EvaluationRulesServiceImpl extends ServiceImpl<EvaluationRulesDao,
} }
if (evaluationRules.getIsMultipleEnable().equals(Constant.IsEnable.ENABLE.getType())) {//启用 if (evaluationRules.getIsMultipleEnable().equals(Constant.IsEnable.ENABLE.getType())) {//启用
int multipleNum = evaluationRules.getMultipleNum(); int multipleNum = evaluationRules.getMultipleNum();
int totalMultipleNum = questionsService.count(queryWrapper.eq("question_type", // int totalMultipleNum = questionsService.count(queryWrapper.eq("question_type",
Constant.QuestionType.MULTIPLE_CHOICE.getType()));//多选题总数 // Constant.QuestionType.MULTIPLE_CHOICE.getType()));//多选题总数
int totalMultipleNum = questionsDao.countTotalMultiplenum();
numIncalid(multipleNum, totalMultipleNum); numIncalid(multipleNum, totalMultipleNum);
} }
if (evaluationRules.getIsJudgmentEnable().equals(Constant.IsEnable.ENABLE.getType())) {//启用 if (evaluationRules.getIsJudgmentEnable().equals(Constant.IsEnable.ENABLE.getType())) {//启用
int judgmentNum = evaluationRules.getJudgmentNum(); int judgmentNum = evaluationRules.getJudgmentNum();
int totalJudgmentNum = questionsService.count(queryWrapper.eq("question_type", // int totalJudgmentNum = questionsService.count(queryWrapper.eq("question_type",
Constant.QuestionType.TRUE_OR_FALSE.getType()));//判断题总数 // Constant.QuestionType.TRUE_OR_FALSE.getType()));//判断题总数
int totalJudgmentNum = questionsDao.countTotalJudgmentnum();
numIncalid(judgmentNum, totalJudgmentNum); numIncalid(judgmentNum, totalJudgmentNum);
} }

@ -57,9 +57,13 @@ public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements
//用户sql user //用户sql user
List<UserProsonalEntityVo> userInfo = userMapper.queryUserInfo(id); List<UserProsonalEntityVo> userInfo = userMapper.queryUserInfo(id);
map.put("userInfo",userInfo); map.put("userInfo",userInfo);
//个人档案sql //个人档案sql
List<UserProsonalEntityVo> userEntityVos = userMapper.queryPersonalFile(id); // List<UserProsonalEntityVo> userEntityVos = userMapper.queryPersonalFile(id);//档案里有学校信息时
map.put("userPersonalFile",userEntityVos); // map.put("userPersonalFile",userEntityVos);
List<UserProsonalEntityVo> prosonalEntityESVos = userMapper.queryPersonalFileES(id);//档案里无学校信息时
map.put("userPersonalFile",prosonalEntityESVos);
return map; return map;
} }

@ -16,7 +16,8 @@
experimental_number, experimental_number,
start_time, start_time,
stop_time, stop_time,
`status` `status`,
project_id
FROM FROM
tms_experimental_teaching tms_experimental_teaching
WHERE WHERE

@ -46,4 +46,13 @@
SELECT COUNT( 1 ) FROM tms_questions WHERE is_del = 0 AND is_enable = 1 AND question_type = 3 SELECT COUNT( 1 ) FROM tms_questions WHERE is_del = 0 AND is_enable = 1 AND question_type = 3
</select> </select>
<!--2020.09.29-->
<select id="countTotalMultiplenum" resultType="int">
SELECT COUNT( 1 ) FROM tms_questions WHERE is_del = 0 AND is_enable = 1 AND question_type = 2
</select>
<select id="countTotalJudgmentnum" resultType="int">
SELECT COUNT( 1 ) FROM tms_questions WHERE is_del = 0 AND is_enable = 1 AND question_type = 3
</select>
</mapper> </mapper>

@ -41,29 +41,47 @@
AND s.isdel = 0 AND s.isdel = 0
</select> </select>
<select id="queryPersonalFile" parameterType="com.msdw.tms.entity.PersonalFileEntity" resultType="hashMap"> <!-- <select id="queryPersonalFile" parameterType="com.msdw.tms.entity.PersonalFileEntity" resultType="hashMap">-->
<!-- SELECT-->
<!-- per.personalFileId,-->
<!-- per.schoolId,-->
<!-- per.schoolName,-->
<!-- disciplineId,-->
<!-- 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-->
<!-- </select>-->
<select id="queryPersonalFileES" parameterType="com.msdw.tms.entity.UserPersonalFileEntity" resultType="hashMap">
SELECT SELECT
per.personalFileId, personalFileId,
per.schoolId, schoolId,
per.schoolName, schoolName,
disciplineId, disciplineId,
disciplineName, disciplineName,
professionalClassId, professionalClassId,
per.professionalClassName, professionalClassName,
per.professionalId, professionalId,
per.professionalName, professionalName,
per.personalCareerId, personalCareerId
s.cityId,
s.cityName,
s.provinceId,
s.provinceName
FROM FROM
hr_personal_file per, hr_personal_file
school s
WHERE WHERE
per.schoolId = s.schoolId userId = #{userId}
AND per.userId = #{userId}
AND s.isdel = 0
</select> </select>
<update id="updateUserPersonal" parameterType="com.msdw.tms.entity.vo.UserProsonalEntityVo"> <update id="updateUserPersonal" parameterType="com.msdw.tms.entity.vo.UserProsonalEntityVo">
@ -72,25 +90,35 @@
<set> <set>
<if test="personalCareerId!=null">per.personalCareerId = #{personalCareerId},</if> <if test="personalCareerId!=null">per.personalCareerId = #{personalCareerId},</if>
<if test="schoolId!=null">per.schoolId = #{schoolId},</if> <if test="schoolId!=null">per.schoolId = #{schoolId},</if>
<if test="schoolId==null">per.schoolId = NULL,</if>
<if test="schoolName!=null">per.schoolName = #{schoolName},</if> <if test="schoolName!=null">per.schoolName = #{schoolName},</if>
<if test="schoolName==null">per.schoolName = NULL,</if>
<if test="disciplineId!=null">per.disciplineId = #{disciplineId},</if> <if test="disciplineId!=null">per.disciplineId = #{disciplineId},</if>
<if test="disciplineId==null">per.disciplineId = NULL,</if>
<if test="disciplineName!=null">per.disciplineName = #{disciplineName},</if> <if test="disciplineName!=null">per.disciplineName = #{disciplineName},</if>
<if test="disciplineName==null">per.disciplineName = NULL,</if>
<if test="professionalId!=null">per.professionalId = #{professionalId},</if> <if test="professionalId!=null">per.professionalId = #{professionalId},</if>
<if test="professionalId==null">per.professionalId = NULL,</if>
<if test="professionalName!=null">per.professionalName = #{professionalName},</if> <if test="professionalName!=null">per.professionalName = #{professionalName},</if>
<if test="professionalName==null">per.professionalName = NULL,</if>
<if test="professionalClassId!=null">per.professionalClassId = #{professionalClassId},</if> <if test="professionalClassId!=null">per.professionalClassId = #{professionalClassId},</if>
<if test="professionalClassId==null">per.professionalClassId = NULL,</if>
<if test="professionalClassName!=null">per.professionalClassName = #{professionalClassName},</if> <if test="professionalClassName!=null">per.professionalClassName = #{professionalClassName},</if>
<if test="professionalClassName==null">per.professionalClassName = NULL,</if>
<if test="updatetime==null">per.updatetime = NOW()</if> <if test="updatetime==null">per.updatetime = NOW()</if>
</set> </set>
WHERE WHERE
per.userId = #{userId} per.userId = #{userId}
AND AND
per.personalFileId = #{personalFileId} per.personalFileId = #{personalFileId}
AND
per.schoolId = s.schoolId
</update> </update>
<insert id="insertPersonalInfo" parameterType="int"> <insert id="insertPersonalInfo" useGeneratedKeys="true">
INSERT INTO hr_personal_file ( userId, personalCareerId, schoolId, schoolName, disciplineId, disciplineName, professionalId, professionalName, professionalClassId, professionalClassName, updatetime ) INSERT INTO hr_personal_file ( userId, personalCareerId, schoolId, schoolName, disciplineId, disciplineName, professionalId, professionalName, professionalClassId, professionalClassName, updatetime )
VALUES 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())
</insert> </insert>
</mapper> </mapper>

@ -33,8 +33,8 @@
<if test="educationDegree != null"> <if test="educationDegree != null">
educationDegree = #{educationDegree}, educationDegree = #{educationDegree},
</if> </if>
<if test="IDNumber != null"> <if test="idNumber != null">
IDNumber = #{IDNumber}, IDNumber = #{idNumber},
</if> </if>
<if test="provinceId != null"> <if test="provinceId != null">
provinceId = #{provinceId}, provinceId = #{provinceId},

Loading…
Cancel
Save