Commit fed02cbc authored by zhangjianqian's avatar zhangjianqian

培训修改,新增承包商培训类型

parent 375fa540
...@@ -87,6 +87,24 @@ public class TTrainCourse extends BaseEntity ...@@ -87,6 +87,24 @@ public class TTrainCourse extends BaseEntity
@Excel(name = "考试人员") @Excel(name = "考试人员")
private String testPersons; private String testPersons;
private Integer personnelType;
public String getPlanName() {
return planName;
}
public void setPlanName(String planName) {
this.planName = planName;
}
public Integer getPersonnelType() {
return personnelType;
}
public void setPersonnelType(Integer personnelType) {
this.personnelType = personnelType;
}
public void setCourseId(Long courseId) public void setCourseId(Long courseId)
{ {
this.courseId = courseId; this.courseId = courseId;
......
...@@ -26,6 +26,8 @@ public class TTrainPlan extends BaseEntity ...@@ -26,6 +26,8 @@ public class TTrainPlan extends BaseEntity
@Excel(name = "计划名称") @Excel(name = "计划名称")
private String planName; private String planName;
private Integer personnelType;
/** 排序 */ /** 排序 */
@Excel(name = "排序") @Excel(name = "排序")
private Integer sort; private Integer sort;
...@@ -37,6 +39,14 @@ public class TTrainPlan extends BaseEntity ...@@ -37,6 +39,14 @@ public class TTrainPlan extends BaseEntity
private List<PlanPostVo> postList; private List<PlanPostVo> postList;
public Integer getPersonnelType() {
return personnelType;
}
public void setPersonnelType(Integer personnelType) {
this.personnelType = personnelType;
}
public List<PlanPostVo> getPostList() { public List<PlanPostVo> getPostList() {
return postList; return postList;
} }
......
...@@ -45,7 +45,17 @@ public class TTrainUserCourse extends BaseEntity ...@@ -45,7 +45,17 @@ public class TTrainUserCourse extends BaseEntity
@Excel(name = "创建人") @Excel(name = "创建人")
private String createUser; private String createUser;
public void setUserCourseId(Long userCourseId) private Integer personnelType;
public Integer getPersonnelType() {
return personnelType;
}
public void setPersonnelType(Integer personnelType) {
this.personnelType = personnelType;
}
public void setUserCourseId(Long userCourseId)
{ {
this.userCourseId = userCourseId; this.userCourseId = userCourseId;
} }
......
...@@ -67,7 +67,7 @@ public interface TTrainCourseMapper ...@@ -67,7 +67,7 @@ public interface TTrainCourseMapper
* @param userIds * @param userIds
* @return * @return
*/ */
public int insertUserCourse(@Param("courseId") Long courseId,@Param("userIds") List<String> userIds); public int insertUserCourse(@Param("courseId") Long courseId,@Param("userIds") List<String> userIds,@Param("personnelType")Integer personnelType);
/** /**
* 用户课程表 * 用户课程表
......
...@@ -3,6 +3,7 @@ package com.zehong.system.service.impl; ...@@ -3,6 +3,7 @@ package com.zehong.system.service.impl;
import com.zehong.common.utils.DateUtils; import com.zehong.common.utils.DateUtils;
import com.zehong.system.domain.TTrainCourse; import com.zehong.system.domain.TTrainCourse;
import com.zehong.system.domain.TTrainCourseTopic; import com.zehong.system.domain.TTrainCourseTopic;
import com.zehong.system.domain.TTrainPlan;
import com.zehong.system.domain.TTrainUserCourse; import com.zehong.system.domain.TTrainUserCourse;
import com.zehong.system.domain.vo.UserCourseVo; import com.zehong.system.domain.vo.UserCourseVo;
import com.zehong.system.mapper.TTrainCourseMapper; import com.zehong.system.mapper.TTrainCourseMapper;
...@@ -58,7 +59,7 @@ public class TTrainCourseServiceImpl implements ITTrainCourseService ...@@ -58,7 +59,7 @@ public class TTrainCourseServiceImpl implements ITTrainCourseService
return 0; return 0;
} }
List<String> userIds = tTrainPlanMapper.selectAlluserByplanId(course.getCourseType()); List<String> userIds = tTrainPlanMapper.selectAlluserByplanId(course.getCourseType());
tTrainCourseMapper.insertUserCourse(courseId,userIds); tTrainCourseMapper.insertUserCourse(courseId,userIds,course.getPersonnelType());
course.setStatus(1); course.setStatus(1);
course.setReleaseTime(new Date()); course.setReleaseTime(new Date());
return tTrainCourseMapper.updateTTrainCourse(course); return tTrainCourseMapper.updateTTrainCourse(course);
...@@ -84,6 +85,12 @@ public class TTrainCourseServiceImpl implements ITTrainCourseService ...@@ -84,6 +85,12 @@ public class TTrainCourseServiceImpl implements ITTrainCourseService
@Override @Override
public Long insertTTrainCourse(TTrainCourse tTrainCourse) public Long insertTTrainCourse(TTrainCourse tTrainCourse)
{ {
if(tTrainCourse.getCourseType()!=null){
TTrainPlan p = tTrainPlanMapper.selectTTrainPlanById(tTrainCourse.getCourseType());
if(p!=null){
tTrainCourse.setPersonnelType(p.getPersonnelType());
}
}
tTrainCourse.setCreateTime(DateUtils.getNowDate()); tTrainCourse.setCreateTime(DateUtils.getNowDate());
tTrainCourseMapper.insertTTrainCourse(tTrainCourse); tTrainCourseMapper.insertTTrainCourse(tTrainCourse);
return tTrainCourse.getCourseId(); return tTrainCourse.getCourseId();
...@@ -184,7 +191,7 @@ public class TTrainCourseServiceImpl implements ITTrainCourseService ...@@ -184,7 +191,7 @@ public class TTrainCourseServiceImpl implements ITTrainCourseService
return 0; return 0;
} }
//新增考试人员 //新增考试人员
tTrainCourseMapper.insertUserCourse(tTrainCourse.getCourseId(),Arrays.asList(course.getTestPersons())); tTrainCourseMapper.insertUserCourse(tTrainCourse.getCourseId(),Arrays.asList(course.getTestPersons()),course.getPersonnelType());
tTrainCourse.setStatus(1); tTrainCourse.setStatus(1);
tTrainCourse.setReleaseTime(new Date()); tTrainCourse.setReleaseTime(new Date());
return tTrainCourseMapper.updateTTrainCourse(tTrainCourse); return tTrainCourseMapper.updateTTrainCourse(tTrainCourse);
......
...@@ -11,6 +11,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -11,6 +11,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="planName" column="plan_name" /> <result property="planName" column="plan_name" />
<result property="courseConent" column="course_conent" /> <result property="courseConent" column="course_conent" />
<result property="status" column="status" /> <result property="status" column="status" />
<result property="personnelType" column="personnel_type" />
<result property="releaseTime" column="release_time" /> <result property="releaseTime" column="release_time" />
<result property="enclosure" column="enclosure" /> <result property="enclosure" column="enclosure" />
<result property="video" column="video" /> <result property="video" column="video" />
...@@ -26,7 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -26,7 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectTTrainCourseVo"> <sql id="selectTTrainCourseVo">
select course_id, course_name, course_type, course_conent, status, release_time, enclosure, video, qualified_num, topic_num, create_time, create_user, is_del, data_kind, test_start_time, test_end_time, test_persons from t_train_course select course_id, course_name, course_type, course_conent, status,personnel_type, release_time, enclosure, video, qualified_num, topic_num, create_time, create_user, is_del, data_kind, test_start_time, test_end_time, test_persons from t_train_course
</sql> </sql>
<select id="selectTTrainCourseList" parameterType="TTrainCourse" resultMap="TTrainCourseResult"> <select id="selectTTrainCourseList" parameterType="TTrainCourse" resultMap="TTrainCourseResult">
...@@ -63,6 +64,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -63,6 +64,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="courseType != null">course_type,</if> <if test="courseType != null">course_type,</if>
<if test="courseConent != null">course_conent,</if> <if test="courseConent != null">course_conent,</if>
<if test="status != null">status,</if> <if test="status != null">status,</if>
<if test="personnelType != null">personnel_type,</if>
<if test="releaseTime != null">release_time,</if> <if test="releaseTime != null">release_time,</if>
<if test="enclosure != null">enclosure,</if> <if test="enclosure != null">enclosure,</if>
<if test="video != null">video,</if> <if test="video != null">video,</if>
...@@ -81,6 +83,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -81,6 +83,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="courseType != null">#{courseType},</if> <if test="courseType != null">#{courseType},</if>
<if test="courseConent != null">#{courseConent},</if> <if test="courseConent != null">#{courseConent},</if>
<if test="status != null">#{status},</if> <if test="status != null">#{status},</if>
<if test="personnelType != null">#{personnelType},</if>
<if test="releaseTime != null">#{releaseTime},</if> <if test="releaseTime != null">#{releaseTime},</if>
<if test="enclosure != null">#{enclosure},</if> <if test="enclosure != null">#{enclosure},</if>
<if test="video != null">#{video},</if> <if test="video != null">#{video},</if>
...@@ -103,6 +106,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -103,6 +106,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="courseType != null">course_type = #{courseType},</if> <if test="courseType != null">course_type = #{courseType},</if>
<if test="courseConent != null">course_conent = #{courseConent},</if> <if test="courseConent != null">course_conent = #{courseConent},</if>
<if test="status != null">status = #{status},</if> <if test="status != null">status = #{status},</if>
<if test="personnelType != null">personnel_type = #{personnelType},</if>
<if test="releaseTime != null">release_time = #{releaseTime},</if> <if test="releaseTime != null">release_time = #{releaseTime},</if>
<if test="enclosure != null">enclosure = #{enclosure},</if> <if test="enclosure != null">enclosure = #{enclosure},</if>
<if test="video != null">video = #{video},</if> <if test="video != null">video = #{video},</if>
...@@ -130,9 +134,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -130,9 +134,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach> </foreach>
</delete> </delete>
<insert id="insertUserCourse"> <insert id="insertUserCourse">
INSERT INTO t_train_user_course(user_id,course_id,create_time) VALUES INSERT INTO t_train_user_course(user_id,course_id,personnel_type,create_time) VALUES
<foreach collection="userIds" separator="," item="item"> <foreach collection="userIds" separator="," item="item">
(#{item},#{courseId},NOW()) (#{item},#{courseId},#{personnelType},NOW())
</foreach> </foreach>
</insert> </insert>
<select id="userCourseList" resultType="com.zehong.system.domain.vo.UserCourseVo"> <select id="userCourseList" resultType="com.zehong.system.domain.vo.UserCourseVo">
...@@ -143,7 +147,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -143,7 +147,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
FROM t_train_user_course uc FROM t_train_user_course uc
LEFT JOIN t_train_course c ON c.`course_id` = uc.`course_id` LEFT JOIN t_train_course c ON c.`course_id` = uc.`course_id`
LEFT JOIN t_train_plan p ON p.`plan_id` = c.`course_type` LEFT JOIN t_train_plan p ON p.`plan_id` = c.`course_type`
WHERE uc.user_id = #{userId} WHERE uc.user_id = #{userId} and uc.personnel_type =1
<if test="type!=null and type == 1"> <if test="type!=null and type == 1">
and uc.state !=2 and uc.state !=2
</if> </if>
......
...@@ -8,12 +8,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -8,12 +8,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="planId" column="plan_id" /> <result property="planId" column="plan_id" />
<result property="planName" column="plan_name" /> <result property="planName" column="plan_name" />
<result property="sort" column="sort" /> <result property="sort" column="sort" />
<result property="personnelType" column="personnel_type" />
<result property="createTime" column="create_time" /> <result property="createTime" column="create_time" />
<result property="createUser" column="create_user" /> <result property="createUser" column="create_user" />
</resultMap> </resultMap>
<sql id="selectTTrainPlanVo"> <sql id="selectTTrainPlanVo">
select plan_id, plan_name, sort, create_time, create_user from t_train_plan select plan_id, plan_name, sort, create_time,personnel_type, create_user from t_train_plan
</sql> </sql>
<select id="selectTTrainPlanList" parameterType="TTrainPlan" resultMap="TTrainPlanResult"> <select id="selectTTrainPlanList" parameterType="TTrainPlan" resultMap="TTrainPlanResult">
...@@ -36,6 +37,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -36,6 +37,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="planId != null">plan_id,</if> <if test="planId != null">plan_id,</if>
<if test="planName != null">plan_name,</if> <if test="planName != null">plan_name,</if>
<if test="sort != null">sort,</if> <if test="sort != null">sort,</if>
<if test="personnelType != null">personnel_type,</if>
<if test="createTime != null">create_time,</if> <if test="createTime != null">create_time,</if>
<if test="createUser != null">create_user,</if> <if test="createUser != null">create_user,</if>
</trim> </trim>
...@@ -43,6 +45,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -43,6 +45,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="planId != null">#{planId},</if> <if test="planId != null">#{planId},</if>
<if test="planName != null">#{planName},</if> <if test="planName != null">#{planName},</if>
<if test="sort != null">#{sort},</if> <if test="sort != null">#{sort},</if>
<if test="personnelType != null">#{personnelType},</if>
<if test="createTime != null">#{createTime},</if> <if test="createTime != null">#{createTime},</if>
<if test="createUser != null">#{createUser},</if> <if test="createUser != null">#{createUser},</if>
</trim> </trim>
...@@ -62,6 +65,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -62,6 +65,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="planName != null">plan_name = #{planName},</if> <if test="planName != null">plan_name = #{planName},</if>
<if test="sort != null">sort = #{sort},</if> <if test="sort != null">sort = #{sort},</if>
<if test="personnelType != null">personnel_type = #{personnelType},</if>
<if test="createTime != null">create_time = #{createTime},</if> <if test="createTime != null">create_time = #{createTime},</if>
<if test="createUser != null">create_user = #{createUser},</if> <if test="createUser != null">create_user = #{createUser},</if>
</trim> </trim>
......
...@@ -9,6 +9,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -9,6 +9,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="userId" column="user_id" /> <result property="userId" column="user_id" />
<result property="courseId" column="course_id" /> <result property="courseId" column="course_id" />
<result property="state" column="state" /> <result property="state" column="state" />
<result property="personnelType" column="personnel_type" />
<result property="examinationTime" column="examination_time" /> <result property="examinationTime" column="examination_time" />
<result property="examinationResult" column="examination_result" /> <result property="examinationResult" column="examination_result" />
<result property="createTime" column="create_time" /> <result property="createTime" column="create_time" />
...@@ -16,12 +17,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -16,12 +17,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectTTrainUserCourseVo"> <sql id="selectTTrainUserCourseVo">
select user_course_id, user_id, course_id, state, examination_time, examination_result, create_time, create_user from t_train_user_course select user_course_id, user_id, course_id, state, examination_time, personnel_type,examination_result, create_time, create_user from t_train_user_course
</sql> </sql>
<select id="selectTTrainUserCourseList" parameterType="TTrainUserCourse" resultMap="TTrainUserCourseResult"> <select id="selectTTrainUserCourseList" parameterType="TTrainUserCourse" resultMap="TTrainUserCourseResult">
<include refid="selectTTrainUserCourseVo"/> <include refid="selectTTrainUserCourseVo"/>
<where> <where>
<if test="userId != null "> and user_id = #{userId}</if> <if test="userId != null "> and user_id = #{userId}</if>
<if test="courseId != null "> and course_id = #{courseId}</if> <if test="courseId != null "> and course_id = #{courseId}</if>
<if test="state != null "> and state = #{state}</if> <if test="state != null "> and state = #{state}</if>
...@@ -42,6 +43,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -42,6 +43,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="userId != null">user_id,</if> <if test="userId != null">user_id,</if>
<if test="courseId != null">course_id,</if> <if test="courseId != null">course_id,</if>
<if test="state != null">state,</if> <if test="state != null">state,</if>
<if test="personnelType != null">personnel_type,</if>
<if test="examinationTime != null">examination_time,</if> <if test="examinationTime != null">examination_time,</if>
<if test="examinationResult != null">examination_result,</if> <if test="examinationResult != null">examination_result,</if>
<if test="createTime != null">create_time,</if> <if test="createTime != null">create_time,</if>
...@@ -51,6 +53,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -51,6 +53,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="userId != null">#{userId},</if> <if test="userId != null">#{userId},</if>
<if test="courseId != null">#{courseId},</if> <if test="courseId != null">#{courseId},</if>
<if test="state != null">#{state},</if> <if test="state != null">#{state},</if>
<if test="personnelType != null">#{personnelType},</if>
<if test="examinationTime != null">#{examinationTime},</if> <if test="examinationTime != null">#{examinationTime},</if>
<if test="examinationResult != null">#{examinationResult},</if> <if test="examinationResult != null">#{examinationResult},</if>
<if test="createTime != null">#{createTime},</if> <if test="createTime != null">#{createTime},</if>
...@@ -64,6 +67,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -64,6 +67,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="userId != null">user_id = #{userId},</if> <if test="userId != null">user_id = #{userId},</if>
<if test="courseId != null">course_id = #{courseId},</if> <if test="courseId != null">course_id = #{courseId},</if>
<if test="state != null">state = #{state},</if> <if test="state != null">state = #{state},</if>
<if test="personnelType != null">personnel_type = #{personnelType},</if>
<if test="examinationTime != null">examination_time = #{examinationTime},</if> <if test="examinationTime != null">examination_time = #{examinationTime},</if>
<if test="examinationResult != null">examination_result = #{examinationResult},</if> <if test="examinationResult != null">examination_result = #{examinationResult},</if>
<if test="createTime != null">create_time = #{createTime},</if> <if test="createTime != null">create_time = #{createTime},</if>
......
...@@ -70,16 +70,16 @@ ...@@ -70,16 +70,16 @@
<el-table v-loading="loading" :data="lessonsList"> <el-table v-loading="loading" :data="lessonsList">
<el-table-column label="课程标题" align="center" prop="courseName" /> <el-table-column label="课程标题" align="center" prop="courseName" />
<el-table-column label="课程类别" align="center" prop="courseType"> <el-table-column label="课程类别" align="center" prop="planName">
<template v-slot="scope"> <!--<template v-slot="scope">-->
<div> <!--<div>-->
{{ <!--{{-->
courseOptions.filter( <!--courseOptions.filter(-->
(item) => item.planId == scope.row.courseType <!--(item) => item.planId == scope.row.courseType-->
)[0].planName <!--)[0].planName-->
}} <!--}}-->
</div> <!--</div>-->
</template> <!--</template>-->
</el-table-column> </el-table-column>
<el-table-column label="课程状态" align="center" prop="status"> <el-table-column label="课程状态" align="center" prop="status">
<template v-slot="scope"> <template v-slot="scope">
...@@ -241,7 +241,7 @@ export default { ...@@ -241,7 +241,7 @@ export default {
this.loading = true; this.loading = true;
getLessons(this.queryParams) getLessons(this.queryParams)
.then((res) => { .then((res) => {
// console.log(res); console.log(res);
this.lessonsList = res.rows; this.lessonsList = res.rows;
this.total = res.total; this.total = res.total;
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment