Compare commits

...

2 Commits

Author SHA1 Message Date
姜玉琦 c7dd2063a6 Merge branch 'dev_xd' of http://62.234.3.186:3000/jiangyq/YZProjectCloud into dev_xd 2024-10-07 22:44:04 +08:00
姜玉琦 7352d2df76 提交代码 2024-10-07 22:43:53 +08:00
34 changed files with 570 additions and 1279 deletions

View File

@ -18,24 +18,20 @@ public class BusTrainingVideo extends BaseEntity
/** 主键 */
private Long id;
/** 部门主键 */
@Excel(name = "部门主键")
private Long deptId;
/** 公司主键 */
private Long comId;
public String getDeptName() {
return deptName;
}
public void setDeptName(String deptName) {
this.deptName = deptName;
}
private String deptName;
/** 公司名称 */
@Excel(name = "公司名称")
private String comName;
/** 项目主键 */
@Excel(name = "项目主键")
private Long projectId;
/** 项目名称 */
@Excel(name = "项目名称")
private String projectName;
/** 培训名称 */
@Excel(name = "培训名称")
private String trainTitle;
@ -72,21 +68,18 @@ public class BusTrainingVideo extends BaseEntity
@Excel(name = "培训文件时长")
private String trainFileTimes;
/** 播放时长 */
@Excel(name = "播放时长")
private int palyTimes;
/** 播放顺序 */
@Excel(name = "播放顺序")
private int sortBy;
/** 删除标识 */
@Excel(name = "删除标识")
private Long isDel;
private int ord;
public int getOrd() {
return ord;
}
public void setOrd(int ord) {
this.ord = ord;
}
public void setId(Long id)
{
this.id = id;
@ -96,16 +89,24 @@ public class BusTrainingVideo extends BaseEntity
{
return id;
}
public void setDeptId(Long deptId)
{
this.deptId = deptId;
public Long getComId() {
return comId;
}
public Long getDeptId()
{
return deptId;
public void setComId(Long comId) {
this.comId = comId;
}
public void setProjectId(Long projectId)
public String getComName() {
return comName;
}
public void setComName(String comName) {
this.comName = comName;
}
public void setProjectId(Long projectId)
{
this.projectId = projectId;
}
@ -114,7 +115,16 @@ public class BusTrainingVideo extends BaseEntity
{
return projectId;
}
public void setTrainTitle(String trainTitle)
public String getProjectName() {
return projectName;
}
public void setProjectName(String projectName) {
this.projectName = projectName;
}
public void setTrainTitle(String trainTitle)
{
this.trainTitle = trainTitle;
}
@ -195,7 +205,24 @@ public class BusTrainingVideo extends BaseEntity
{
return trainFileTimes;
}
public void setIsDel(Long isDel)
public int getSortBy() {
return sortBy;
}
public void setSortBy(int sortBy) {
this.sortBy = sortBy;
}
public int getPalyTimes() {
return palyTimes;
}
public void setPalyTimes(int palyTimes) {
this.palyTimes = palyTimes;
}
public void setIsDel(Long isDel)
{
this.isDel = isDel;
}
@ -209,7 +236,7 @@ public class BusTrainingVideo extends BaseEntity
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("deptId", getDeptId())
.append("comId", getComId())
.append("projectId", getProjectId())
.append("trainTitle", getTrainTitle())
.append("trainType", getTrainType())
@ -220,6 +247,7 @@ public class BusTrainingVideo extends BaseEntity
.append("trainFilePath", getTrainFilePath())
.append("trainFileImage", getTrainFileImage())
.append("trainFileTimes", getTrainFileTimes())
.append("sortBy", getSortBy())
.append("isDel", getIsDel())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())

View File

@ -18,18 +18,32 @@ public class BusTrainingVideoUser extends BaseEntity
/** 主键 */
private Long id;
/** 部门主键 */
@Excel(name = "部门主键")
/** 公司主键 */
private Long deptId;
/** 公司名称 */
@Excel(name = "公司名称")
private String comName;
/** 项目主键 */
@Excel(name = "项目主键")
private Long projectId;
/** 项目名称 */
@Excel(name = "项目名称")
private String projectName;
/** 用户主键 */
@Excel(name = "用户主键")
private Long userId;
/** 用户名称 */
@Excel(name = "用户名称")
private String userNick;
/** 用户账号 */
@Excel(name = "用户账号")
private String userName;
/** 视频主键 */
@Excel(name = "视频主键")
private Long videoId;
@ -119,6 +133,38 @@ public class BusTrainingVideoUser extends BaseEntity
return isDel;
}
public String getComName() {
return comName;
}
public void setComName(String comName) {
this.comName = comName;
}
public String getProjectName() {
return projectName;
}
public void setProjectName(String projectName) {
this.projectName = projectName;
}
public String getUserNick() {
return userNick;
}
public void setUserNick(String userNick) {
this.userNick = userNick;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

View File

@ -1,61 +0,0 @@
package com.yanzhu.manage.mapper;
import java.util.List;
import com.yanzhu.manage.domain.BusExamInfoQues;
/**
* Mapper
*
* @author JiangYuQi
* @date 2024-08-25
*/
public interface BusExamInfoQuesMapper
{
/**
*
*
* @param examId
* @return
*/
public BusExamInfoQues selectBusExamInfoQuesByExamId(Long examId);
/**
*
*
* @param busExamInfoQues
* @return
*/
public List<BusExamInfoQues> selectBusExamInfoQuesList(BusExamInfoQues busExamInfoQues);
/**
*
*
* @param busExamInfoQues
* @return
*/
public int insertBusExamInfoQues(BusExamInfoQues busExamInfoQues);
/**
*
*
* @param busExamInfoQues
* @return
*/
public int updateBusExamInfoQues(BusExamInfoQues busExamInfoQues);
/**
*
*
* @param examId
* @return
*/
public int deleteBusExamInfoQuesByExamId(Long examId);
/**
*
*
* @param examIds
* @return
*/
public int deleteBusExamInfoQuesByExamIds(Long[] examIds);
}

View File

@ -1,61 +0,0 @@
package com.yanzhu.manage.mapper;
import java.util.List;
import com.yanzhu.manage.domain.BusExamQuestionResult;
/**
* Mapper
*
* @author JiangYuQi
* @date 2024-08-25
*/
public interface BusExamQuestionResultMapper
{
/**
*
*
* @param id
* @return
*/
public BusExamQuestionResult selectBusExamQuestionResultById(Long id);
/**
*
*
* @param busExamQuestionResult
* @return
*/
public List<BusExamQuestionResult> selectBusExamQuestionResultList(BusExamQuestionResult busExamQuestionResult);
/**
*
*
* @param busExamQuestionResult
* @return
*/
public int insertBusExamQuestionResult(BusExamQuestionResult busExamQuestionResult);
/**
*
*
* @param busExamQuestionResult
* @return
*/
public int updateBusExamQuestionResult(BusExamQuestionResult busExamQuestionResult);
/**
*
*
* @param id
* @return
*/
public int deleteBusExamQuestionResultById(Long id);
/**
*
*
* @param ids
* @return
*/
public int deleteBusExamQuestionResultByIds(Long[] ids);
}

View File

@ -1,61 +0,0 @@
package com.yanzhu.manage.mapper;
import java.util.List;
import com.yanzhu.manage.domain.BusExamUserResult;
/**
* Mapper
*
* @author JiangYuQi
* @date 2024-08-25
*/
public interface BusExamUserResultMapper
{
/**
*
*
* @param examUserId
* @return
*/
public BusExamUserResult selectBusExamUserResultByExamUserId(Long examUserId);
/**
*
*
* @param busExamUserResult
* @return
*/
public List<BusExamUserResult> selectBusExamUserResultList(BusExamUserResult busExamUserResult);
/**
*
*
* @param busExamUserResult
* @return
*/
public int insertBusExamUserResult(BusExamUserResult busExamUserResult);
/**
*
*
* @param busExamUserResult
* @return
*/
public int updateBusExamUserResult(BusExamUserResult busExamUserResult);
/**
*
*
* @param examUserId
* @return
*/
public int deleteBusExamUserResultByExamUserId(Long examUserId);
/**
*
*
* @param examUserIds
* @return
*/
public int deleteBusExamUserResultByExamUserIds(Long[] examUserIds);
}

View File

@ -1,6 +1,8 @@
package com.yanzhu.manage.mapper;
import java.util.List;
import java.util.Map;
import com.yanzhu.manage.domain.BusTrainingVideo;
/**
@ -27,6 +29,14 @@ public interface BusTrainingVideoMapper
*/
public List<BusTrainingVideo> selectBusTrainingVideoList(BusTrainingVideo busTrainingVideo);
/**
*
*
* @param busTrainingVideo
* @return
*/
public List<Map<String, Object>> findBusTrainingVideoByLevel(BusTrainingVideo busTrainingVideo);
/**
*
*

View File

@ -56,6 +56,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="projectId != null "> and bei.project_id = #{projectId}</if>
<if test="activeComId != null "> and bei.com_id = #{activeComId}</if>
<if test="activeProjectId != null "> and bei.project_id = #{activeProjectId}</if>
<if test="projectName != null and projectName != ''"> and pi.project_name like concat('%', #{projectName}, '%')</if>
<if test="examTitle != null and examTitle != ''"> and bei.exam_title = #{examTitle}</if>
<if test="examType != null and examType != ''"> and bei.exam_type = #{examType}</if>
<if test="craftType != null and craftType != ''"> and bei.craft_type = #{craftType}</if>
@ -157,16 +158,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update bus_exam_info set use_number = use_number+1 where id = #{id}
</update>
<delete id="deleteBusExamInfoById" parameterType="Long">
delete from bus_exam_info where id = #{id}
</delete>
<update id="deleteBusExamInfoById" parameterType="Long">
update bus_exam_info set is_del=2 where id = #{id}
</update>
<delete id="deleteBusExamInfoByIds" parameterType="String">
delete from bus_exam_info where id in
<update id="deleteBusExamInfoByIds" parameterType="String">
update bus_exam_info set is_del=2 where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</update>
<delete id="deleteBusExamInfoQuesByExamIds" parameterType="String">
delete from bus_exam_info_ques where exam_id in

View File

@ -1,69 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yanzhu.manage.mapper.BusExamInfoQuesMapper">
<resultMap type="BusExamInfoQues" id="BusExamInfoQuesResult">
<result property="examId" column="exam_id" />
<result property="questionId" column="question_id" />
<result property="marks" column="marks" />
<result property="sortBy" column="sort_by" />
</resultMap>
<sql id="selectBusExamInfoQuesVo">
select exam_id, question_id, marks, sort_by from bus_exam_info_ques
</sql>
<select id="selectBusExamInfoQuesList" parameterType="BusExamInfoQues" resultMap="BusExamInfoQuesResult">
<include refid="selectBusExamInfoQuesVo"/>
<where>
<if test="examId != null "> and exam_id = #{examId}</if>
<if test="questionId != null "> and question_id = #{questionId}</if>
<if test="marks != null "> and marks = #{marks}</if>
<if test="sortBy != null "> and sort_by = #{sortBy}</if>
</where>
</select>
<select id="selectBusExamInfoQuesByExamId" parameterType="Long" resultMap="BusExamInfoQuesResult">
<include refid="selectBusExamInfoQuesVo"/>
where exam_id = #{examId}
</select>
<insert id="insertBusExamInfoQues" parameterType="BusExamInfoQues">
insert into bus_exam_info_ques
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="examId != null">exam_id,</if>
<if test="questionId != null">question_id,</if>
<if test="marks != null">marks,</if>
<if test="sortBy != null">sort_by,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="examId != null">#{examId},</if>
<if test="questionId != null">#{questionId},</if>
<if test="marks != null">#{marks},</if>
<if test="sortBy != null">#{sortBy},</if>
</trim>
</insert>
<update id="updateBusExamInfoQues" parameterType="BusExamInfoQues">
update bus_exam_info_ques
<trim prefix="SET" suffixOverrides=",">
<if test="questionId != null">question_id = #{questionId},</if>
<if test="marks != null">marks = #{marks},</if>
<if test="sortBy != null">sort_by = #{sortBy},</if>
</trim>
where exam_id = #{examId}
</update>
<delete id="deleteBusExamInfoQuesByExamId" parameterType="Long">
delete from bus_exam_info_ques where exam_id = #{examId}
</delete>
<delete id="deleteBusExamInfoQuesByExamIds" parameterType="String">
delete from bus_exam_info_ques where exam_id in
<foreach item="examId" collection="array" open="(" separator="," close=")">
#{examId}
</foreach>
</delete>
</mapper>

View File

@ -56,7 +56,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="projectId != null "> and (beq.project_id = #{projectId} or beq.project_id is null)</if>
<if test="activeComId != null "> and (beq.com_id = #{activeComId} or beq.com_id is null)</if>
<if test="activeProjectId != null "> and (beq.project_id = #{activeProjectId} or beq.project_id is null)</if>
<if test="craftType != null and craftType != ''"> and beq.craft_type = #{craftType}</if>
<if test="projectName != null and projectName != ''"> and pi.project_name like concat('%', #{projectName}, '%')</if>
<if test="craftType != null and craftType != ''"> and find_in_set(#{craftType}, beq.craft_type)</if>
<if test="craftPost != null and craftPost != ''"> and find_in_set(#{craftPost}, beq.craft_post)</if>
<if test="questionDiff != null "> and beq.question_diff = #{questionDiff} </if>
<if test="questionType != null "> and beq.question_type = #{questionType} </if>

View File

@ -1,91 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yanzhu.manage.mapper.BusExamQuestionResultMapper">
<resultMap type="BusExamQuestionResult" id="BusExamQuestionResultResult">
<result property="id" column="id" />
<result property="questionId" column="question_id" />
<result property="opt" column="opt" />
<result property="result" column="result" />
<result property="isOk" column="is_ok" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectBusExamQuestionResultVo">
select id, question_id, opt, result, is_ok, create_by, create_time, update_by, update_time, remark from bus_exam_question_result
</sql>
<select id="selectBusExamQuestionResultList" parameterType="BusExamQuestionResult" resultMap="BusExamQuestionResultResult">
<include refid="selectBusExamQuestionResultVo"/>
<where>
<if test="questionId != null "> and question_id = #{questionId}</if>
<if test="opt != null and opt != ''"> and opt = #{opt}</if>
<if test="result != null and result != ''"> and result like concat('%', #{result}, '%')</if>
<if test="isOk != null "> and is_ok = #{isOk}</if>
</where>
</select>
<select id="selectBusExamQuestionResultById" parameterType="Long" resultMap="BusExamQuestionResultResult">
<include refid="selectBusExamQuestionResultVo"/>
where id = #{id}
</select>
<insert id="insertBusExamQuestionResult" parameterType="BusExamQuestionResult" useGeneratedKeys="true" keyProperty="id">
insert into bus_exam_question_result
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="questionId != null">question_id,</if>
<if test="opt != null">opt,</if>
<if test="result != null">result,</if>
<if test="isOk != null">is_ok,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="questionId != null">#{questionId},</if>
<if test="opt != null">#{opt},</if>
<if test="result != null">#{result},</if>
<if test="isOk != null">#{isOk},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateBusExamQuestionResult" parameterType="BusExamQuestionResult">
update bus_exam_question_result
<trim prefix="SET" suffixOverrides=",">
<if test="questionId != null">question_id = #{questionId},</if>
<if test="opt != null">opt = #{opt},</if>
<if test="result != null">result = #{result},</if>
<if test="isOk != null">is_ok = #{isOk},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteBusExamQuestionResultById" parameterType="Long">
delete from bus_exam_question_result where id = #{id}
</delete>
<delete id="deleteBusExamQuestionResultByIds" parameterType="String">
delete from bus_exam_question_result where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -64,7 +64,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="activeComId != null "> and beu.com_id = #{activeComId}</if>
<if test="activeProjectId != null "> and beu.project_id = #{activeProjectId}</if>
<if test="userId != null "> and beu.user_id = #{userId}</if>
<if test="userName != null and userName != ''"> and (beu.com_id = #{activeComId} or )</if>
<if test="projectName != null and projectName != ''"> and pi.project_name like concat('%', #{projectName}, '%')</if>
<if test="userName != null and userName != ''"> and (su.nick_name like concat('%', #{userName}, '%') or su.user_name like concat('%', #{userName}, '%') )</if>
<if test="examTitle != null and examTitle != ''"> and beu.exam_title = #{examTitle}</if>
<if test="examType != null and examType != ''"> and beu.exam_type = #{examType}</if>
<if test="craftType != null and craftType != ''"> and beu.craft_type = #{craftType}</if>
@ -158,16 +159,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where id = #{id}
</update>
<delete id="deleteBusExamUserById" parameterType="Long">
delete from bus_exam_user where id = #{id}
</delete>
<update id="deleteBusExamUserById" parameterType="Long">
update bus_exam_user set is_del=2 where id = #{id}
</update>
<delete id="deleteBusExamUserByIds" parameterType="String">
delete from bus_exam_user where id in
<update id="deleteBusExamUserByIds" parameterType="String">
update bus_exam_user set is_del=2 where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</update>
<delete id="deleteBusExamUserResultByExamUserIds" parameterType="String">
delete from bus_exam_user_result where exam_user_id in

View File

@ -1,79 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yanzhu.manage.mapper.BusExamUserResultMapper">
<resultMap type="BusExamUserResult" id="BusExamUserResultResult">
<result property="examUserId" column="exam_user_id" />
<result property="questionId" column="question_id" />
<result property="answers" column="answers" />
<result property="sortBy" column="sort_by" />
<result property="useRes" column="use_res" />
<result property="useMark" column="use_mark" />
</resultMap>
<sql id="selectBusExamUserResultVo">
select exam_user_id, question_id, answers, sort_by, use_res, use_mark from bus_exam_user_result
</sql>
<select id="selectBusExamUserResultList" parameterType="BusExamUserResult" resultMap="BusExamUserResultResult">
<include refid="selectBusExamUserResultVo"/>
<where>
<if test="examUserId != null "> and exam_user_id = #{examUserId}</if>
<if test="questionId != null "> and question_id = #{questionId}</if>
<if test="answers != null and answers != ''"> and answers = #{answers}</if>
<if test="sortBy != null "> and sort_by = #{sortBy}</if>
<if test="useRes != null and useRes != ''"> and use_res = #{useRes}</if>
<if test="useMark != null and useMark != ''"> and use_mark = #{useMark}</if>
</where>
</select>
<select id="selectBusExamUserResultByExamUserId" parameterType="Long" resultMap="BusExamUserResultResult">
<include refid="selectBusExamUserResultVo"/>
where exam_user_id = #{examUserId}
</select>
<insert id="insertBusExamUserResult" parameterType="BusExamUserResult">
insert into bus_exam_user_result
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="examUserId != null">exam_user_id,</if>
<if test="questionId != null">question_id,</if>
<if test="answers != null">answers,</if>
<if test="sortBy != null">sort_by,</if>
<if test="useRes != null">use_res,</if>
<if test="useMark != null">use_mark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="examUserId != null">#{examUserId},</if>
<if test="questionId != null">#{questionId},</if>
<if test="answers != null">#{answers},</if>
<if test="sortBy != null">#{sortBy},</if>
<if test="useRes != null">#{useRes},</if>
<if test="useMark != null">#{useMark},</if>
</trim>
</insert>
<update id="updateBusExamUserResult" parameterType="BusExamUserResult">
update bus_exam_user_result
<trim prefix="SET" suffixOverrides=",">
<if test="questionId != null">question_id = #{questionId},</if>
<if test="answers != null">answers = #{answers},</if>
<if test="sortBy != null">sort_by = #{sortBy},</if>
<if test="useRes != null">use_res = #{useRes},</if>
<if test="useMark != null">use_mark = #{useMark},</if>
</trim>
where exam_user_id = #{examUserId}
</update>
<delete id="deleteBusExamUserResultByExamUserId" parameterType="Long">
delete from bus_exam_user_result where exam_user_id = #{examUserId}
</delete>
<delete id="deleteBusExamUserResultByExamUserIds" parameterType="String">
delete from bus_exam_user_result where exam_user_id in
<foreach item="examUserId" collection="array" open="(" separator="," close=")">
#{examUserId}
</foreach>
</delete>
</mapper>

View File

@ -6,9 +6,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="BusTrainingVideo" id="BusTrainingVideoResult">
<result property="id" column="id" />
<result property="deptId" column="dept_id" />
<result property="deptName" column="dept_name"/>
<result property="comId" column="com_id" />
<result property="comName" column="com_name"/>
<result property="projectId" column="project_id" />
<result property="projectName" column="project_name" />
<result property="trainTitle" column="train_title" />
<result property="trainType" column="train_type" />
<result property="trainLevel" column="train_level" />
@ -18,7 +19,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="trainFilePath" column="train_file_path" />
<result property="trainFileImage" column="train_file_image" />
<result property="trainFileTimes" column="train_file_times" />
<result property="ord" column="ord"/>
<result property="palyTimes" column="paly_times"/>
<result property="sortBy" column="sort_by"/>
<result property="isDel" column="is_del" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
@ -28,36 +30,60 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectBusTrainingVideoVo">
select bus_training_video.*,sys_dept.dept_name
from bus_training_video
left join sys_dept on bus_training_video.dept_id=sys_dept.dept_id
select btv.*, sd.dept_name as com_name, pi.project_name
from bus_training_video btv
left join pro_project_info pi on pi.id = btv.project_id
left join sys_dept sd on sd.dept_id = btv.com_id
</sql>
<select id="selectBusTrainingVideoList" parameterType="BusTrainingVideo" resultMap="BusTrainingVideoResult">
<include refid="selectBusTrainingVideoVo"/>
<where>
<if test="deptId != null "> and dept_id = #{deptId}</if>
<if test="projectId != null "> and project_id = #{projectId}</if>
<if test="trainTitle != null and trainTitle != ''"> and train_title like concat('%', #{trainTitle}, '%')</if>
<if test="trainType != null and trainType != ''"> and train_type = #{trainType}</if>
<if test="trainLevel != null and trainLevel != ''"> and train_level = #{trainLevel}</if>
<if test="craftType != null and craftType != ''"> and craft_type = #{craftType}</if>
<if test="craftPost != null and craftPost != ''"> and craft_post = #{craftPost}</if>
<if test="trainFileType != null and trainFileType != ''"> and train_file_type = #{trainFileType}</if>
<if test="isDel != null "> and is_del = #{isDel}</if>
<where>
and btv.is_del != 2
<if test="comId != null "> and (btv.com_id = #{comId} or btv.com_id is null)</if>
<if test="projectId != null "> and (btv.project_id = #{projectId} or btv.project_id is null)</if>
<if test="activeComId != null "> and (btv.com_id = #{activeComId} or btv.com_id is null)</if>
<if test="activeProjectId != null "> and (btv.project_id = #{activeProjectId} or btv.project_id is null)</if>
<if test="projectName != null and projectName != ''"> and pi.project_name like concat('%', #{projectName}, '%')</if>
<if test="trainTitle != null and trainTitle != ''"> and btv.train_title like concat('%', #{trainTitle}, '%')</if>
<if test="trainType != null and trainType != ''"> and btv.train_type = #{trainType}</if>
<if test="trainLevel != null and trainLevel != ''"> and btv.train_level = #{trainLevel}</if>
<if test="craftType != null and craftType != ''"> and find_in_set(#{craftType}, btv.craft_type)</if>
<if test="craftPost != null and craftPost != ''"> and find_in_set(#{craftPost}, btv.craft_post)</if>
<if test="isDel != null "> and btv.is_del = #{isDel}</if>
</where>
order by ord
order by btv.id desc
</select>
<select id="findBusTrainingVideoByLevel" parameterType="BusTrainingVideo" resultType="map">
select btv.train_level as trainLevel, count(1) as total
from bus_training_video btv
left join pro_project_info pi on pi.id = btv.project_id
<where>
and btv.is_del != 2
<if test="comId != null "> and (btv.com_id = #{comId} or btv.com_id is null)</if>
<if test="projectId != null "> and (btv.project_id = #{projectId} or btv.project_id is null)</if>
<if test="activeComId != null "> and (btv.com_id = #{activeComId} or btv.com_id is null)</if>
<if test="activeProjectId != null "> and (btv.project_id = #{activeProjectId} or btv.project_id is null)</if>
<if test="projectName != null and projectName != ''"> and pi.project_name like concat('%', #{projectName}, '%')</if>
<if test="trainTitle != null and trainTitle != ''"> and btv.train_title like concat('%', #{trainTitle}, '%')</if>
<if test="trainType != null and trainType != ''"> and btv.train_type = #{trainType}</if>
<if test="craftType != null and craftType != ''"> and find_in_set(#{craftType}, btv.craft_type)</if>
<if test="craftPost != null and craftPost != ''"> and find_in_set(#{craftPost}, btv.craft_post)</if>
<if test="isDel != null "> and btv.is_del = #{isDel}</if>
</where>
group by btv.train_level
</select>
<select id="selectBusTrainingVideoById" parameterType="Long" resultMap="BusTrainingVideoResult">
<include refid="selectBusTrainingVideoVo"/>
where id = #{id}
where btv.id = #{id}
</select>
<insert id="insertBusTrainingVideo" parameterType="BusTrainingVideo" useGeneratedKeys="true" keyProperty="id">
insert into bus_training_video
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="deptId != null">dept_id,</if>
<if test="comId != null">com_id,</if>
<if test="projectId != null">project_id,</if>
<if test="trainTitle != null">train_title,</if>
<if test="trainType != null">train_type,</if>
@ -68,7 +94,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="trainFilePath != null">train_file_path,</if>
<if test="trainFileImage != null">train_file_image,</if>
<if test="trainFileTimes != null">train_file_times,</if>
<if test="ord != null and ord>=0">ord,</if>
<if test="palyTimes != null">paly_times,</if>
<if test="sortBy != null">sort_by,</if>
<if test="isDel != null">is_del,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
@ -77,7 +104,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="deptId != null">#{deptId},</if>
<if test="comId != null">#{comId},</if>
<if test="projectId != null">#{projectId},</if>
<if test="trainTitle != null">#{trainTitle},</if>
<if test="trainType != null">#{trainType},</if>
@ -88,7 +115,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="trainFilePath != null">#{trainFilePath},</if>
<if test="trainFileImage != null">#{trainFileImage},</if>
<if test="trainFileTimes != null">#{trainFileTimes},</if>
<if test="ord != null and ord>=0">#{ord},</if>
<if test="palyTimes != null">#{palyTimes},</if>
<if test="sortBy != null">#{sortBy},</if>
<if test="isDel != null">#{isDel},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
@ -101,7 +129,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<update id="updateBusTrainingVideo" parameterType="BusTrainingVideo">
update bus_training_video
<trim prefix="SET" suffixOverrides=",">
<if test="deptId != null">dept_id = #{deptId},</if>
<if test="comId != null">com_id = #{comId},</if>
<if test="projectId != null">project_id = #{projectId},</if>
<if test="trainTitle != null">train_title = #{trainTitle},</if>
<if test="trainType != null">train_type = #{trainType},</if>
@ -112,7 +140,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="trainFilePath != null">train_file_path = #{trainFilePath},</if>
<if test="trainFileImage != null">train_file_image = #{trainFileImage},</if>
<if test="trainFileTimes != null">train_file_times = #{trainFileTimes},</if>
<if test="ord != null and ord>=0">ord = #{ord},</if>
<if test="palyTimes != null">paly_times = #{palyTimes},</if>
<if test="sortBy != null">sort_by = #{sortBy},</if>
<if test="isDel != null">is_del = #{isDel},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
@ -123,14 +152,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where id = #{id}
</update>
<delete id="deleteBusTrainingVideoById" parameterType="Long">
delete from bus_training_video where id = #{id}
</delete>
<update id="deleteBusTrainingVideoById" parameterType="Long">
update bus_training_video set is_del=2 where id = #{id}
</update>
<delete id="deleteBusTrainingVideoByIds" parameterType="String">
delete from bus_training_video where id in
<update id="deleteBusTrainingVideoByIds" parameterType="String">
update bus_training_video set is_del=2 where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</update>
</mapper>

View File

@ -6,9 +6,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="BusTrainingVideoUser" id="BusTrainingVideoUserResult">
<result property="id" column="id" />
<result property="deptId" column="dept_id" />
<result property="comId" column="com_id" />
<result property="comName" column="com_name" />
<result property="projectId" column="project_id" />
<result property="projectName" column="project_name" />
<result property="userId" column="user_id" />
<result property="userNick" column="user_nick" />
<result property="userName" column="user_name" />
<result property="videoId" column="video_id" />
<result property="playStatus" column="play_status" />
<result property="sortBy" column="sort_by" />
@ -21,31 +25,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectBusTrainingVideoUserVo">
select id, dept_id, project_id, user_id, video_id, play_status, sort_by, is_del, create_by, create_time, update_by, update_time, remark from bus_training_video_user
select btvu.id, btvu.com_id, sd.dept_name as com_name, btvu.project_id, pi.project_name, btvu.user_id, su.nick_name as user_nick, su.user_name, btvu.video_id, btvu.play_status, btvu.sort_by, btvu.is_del, btvu.create_by, btvu.create_time, btvu.update_by, btvu.update_time, btvu.remark from bus_training_video_user btvu
left join pro_project_info pi on pi.id = btvu.project_id
left join sys_dept sd on sd.com_id = btvu.com_id
left join sys_user su on su.user_id = btvu.user_id
</sql>
<select id="selectBusTrainingVideoUserList" parameterType="BusTrainingVideoUser" resultMap="BusTrainingVideoUserResult">
<include refid="selectBusTrainingVideoUserVo"/>
<where>
<if test="deptId != null "> and dept_id = #{deptId}</if>
<if test="projectId != null "> and project_id = #{projectId}</if>
<if test="userId != null "> and user_id = #{userId}</if>
<if test="videoId != null "> and video_id = #{videoId}</if>
<if test="playStatus != null "> and play_status = #{playStatus}</if>
<if test="sortBy != null "> and sort_by = #{sortBy}</if>
<if test="isDel != null "> and is_del = #{isDel}</if>
<where>
btvu.is_del!=2
<if test="comId != null "> and btvu.com_id = #{comId}</if>
<if test="projectId != null "> and btvu.project_id = #{projectId}</if>
<if test="activeComId != null "> and btvu.com_id = #{activeComId}</if>
<if test="activeProjectId != null "> and btvu.project_id = #{activeProjectId}</if>
<if test="projectName != null and projectName != ''"> and pi.project_name like concat('%', #{projectName}, '%')</if>
<if test="userName != null and userName != ''"> and (su.nick_name like concat('%', #{userName}, '%') or su.user_name like concat('%', #{userName}, '%') )</if>
<if test="userId != null "> and btvu.user_id = #{userId}</if>
<if test="isDel != null "> and btvu.is_del = #{isDel}</if>
</where>
order by btvu.id desc
</select>
<select id="selectBusTrainingVideoUserById" parameterType="Long" resultMap="BusTrainingVideoUserResult">
<include refid="selectBusTrainingVideoUserVo"/>
where id = #{id}
where btvu.id = #{id}
</select>
<insert id="insertBusTrainingVideoUser" parameterType="BusTrainingVideoUser" useGeneratedKeys="true" keyProperty="id">
insert into bus_training_video_user
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="deptId != null">dept_id,</if>
<if test="comId != null">com_id,</if>
<if test="projectId != null">project_id,</if>
<if test="userId != null">user_id,</if>
<if test="videoId != null">video_id,</if>
@ -59,7 +69,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="deptId != null">#{deptId},</if>
<if test="comId != null">#{comId},</if>
<if test="projectId != null">#{projectId},</if>
<if test="userId != null">#{userId},</if>
<if test="videoId != null">#{videoId},</if>
@ -77,7 +87,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<update id="updateBusTrainingVideoUser" parameterType="BusTrainingVideoUser">
update bus_training_video_user
<trim prefix="SET" suffixOverrides=",">
<if test="deptId != null">dept_id = #{deptId},</if>
<if test="comId != null">com_id = #{comId},</if>
<if test="projectId != null">project_id = #{projectId},</if>
<if test="userId != null">user_id = #{userId},</if>
<if test="videoId != null">video_id = #{videoId},</if>
@ -93,14 +103,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where id = #{id}
</update>
<delete id="deleteBusTrainingVideoUserById" parameterType="Long">
delete from bus_training_video_user where id = #{id}
</delete>
<update id="deleteBusTrainingVideoUserById" parameterType="Long">
update bus_training_video_user set is_del=2 where id = #{id}
</update>
<delete id="deleteBusTrainingVideoUserByIds" parameterType="String">
delete from bus_training_video_user where id in
<update id="deleteBusTrainingVideoUserByIds" parameterType="String">
update bus_training_video_user set is_del=2 where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</update>
</mapper>

View File

@ -39,9 +39,4 @@ public class FastDfsSysFileServiceImpl implements ISysFileService
FileTypeUtils.getExtension(file), null);
return domain + "/" + storePath.getFullPath();
}
@Override
public String uploadFilePath(MultipartFile file, String path) throws Exception {
return null;
}
}

View File

@ -17,13 +17,4 @@ public interface ISysFileService
* @throws Exception
*/
public String uploadFile(MultipartFile file) throws Exception;
/**
*
*
* @param file
* @return 访
* @throws Exception
*/
public String uploadFilePath(MultipartFile file,String path) throws Exception;
}

View File

@ -44,21 +44,6 @@ public class LocalSysFileServiceImpl implements ISysFileService
public String uploadFile(MultipartFile file) throws Exception
{
String name = FileUploadUtils.upload(localFilePath, file);
String url = domain + localFilePrefix + name;
return url;
}
/**
* &&
*
* @param file
* @return 访
* @throws Exception
*/
@Override
public String uploadFilePath(MultipartFile file, String path) throws Exception {
String name = FileUploadUtils.upload(localFilePath+"/"+path, file);
String url = domain + localFilePrefix + name;
return url;
return localFilePrefix + name;
}
}

View File

@ -42,9 +42,4 @@ public class MinioSysFileServiceImpl implements ISysFileService
client.putObject(args);
return minioConfig.getUrl() + "/" + minioConfig.getBucketName() + "/" + fileName;
}
@Override
public String uploadFilePath(MultipartFile file, String path) throws Exception {
return null;
}
}

View File

@ -14,6 +14,7 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* Controller
@ -40,6 +41,18 @@ public class BusTrainingVideoController extends BaseController
return getDataTable(list);
}
/**
*
* @RequiresPermissions("manage:busTrainingVideo:list")
*
* @param busTrainingVideo
* @return
*/
@GetMapping("/findGroupByLevel")
public AjaxResult findBusTrainingVideoByLevel(BusTrainingVideo busTrainingVideo){
return success(busTrainingVideoService.findBusTrainingVideoByLevel(busTrainingVideo));
}
/**
*
*/

View File

@ -1,61 +0,0 @@
package com.yanzhu.manage.service;
import java.util.List;
import com.yanzhu.manage.domain.BusExamInfoQues;
/**
* Service
*
* @author JiangYuQi
* @date 2024-08-25
*/
public interface IBusExamInfoQuesService
{
/**
*
*
* @param examId
* @return
*/
public BusExamInfoQues selectBusExamInfoQuesByExamId(Long examId);
/**
*
*
* @param busExamInfoQues
* @return
*/
public List<BusExamInfoQues> selectBusExamInfoQuesList(BusExamInfoQues busExamInfoQues);
/**
*
*
* @param busExamInfoQues
* @return
*/
public int insertBusExamInfoQues(BusExamInfoQues busExamInfoQues);
/**
*
*
* @param busExamInfoQues
* @return
*/
public int updateBusExamInfoQues(BusExamInfoQues busExamInfoQues);
/**
*
*
* @param examIds
* @return
*/
public int deleteBusExamInfoQuesByExamIds(Long[] examIds);
/**
*
*
* @param examId
* @return
*/
public int deleteBusExamInfoQuesByExamId(Long examId);
}

View File

@ -1,61 +0,0 @@
package com.yanzhu.manage.service;
import java.util.List;
import com.yanzhu.manage.domain.BusExamQuestionResult;
/**
* Service
*
* @author JiangYuQi
* @date 2024-08-25
*/
public interface IBusExamQuestionResultService
{
/**
*
*
* @param id
* @return
*/
public BusExamQuestionResult selectBusExamQuestionResultById(Long id);
/**
*
*
* @param busExamQuestionResult
* @return
*/
public List<BusExamQuestionResult> selectBusExamQuestionResultList(BusExamQuestionResult busExamQuestionResult);
/**
*
*
* @param busExamQuestionResult
* @return
*/
public int insertBusExamQuestionResult(BusExamQuestionResult busExamQuestionResult);
/**
*
*
* @param busExamQuestionResult
* @return
*/
public int updateBusExamQuestionResult(BusExamQuestionResult busExamQuestionResult);
/**
*
*
* @param ids
* @return
*/
public int deleteBusExamQuestionResultByIds(Long[] ids);
/**
*
*
* @param id
* @return
*/
public int deleteBusExamQuestionResultById(Long id);
}

View File

@ -1,61 +0,0 @@
package com.yanzhu.manage.service;
import java.util.List;
import com.yanzhu.manage.domain.BusExamUserResult;
/**
* Service
*
* @author JiangYuQi
* @date 2024-08-25
*/
public interface IBusExamUserResultService
{
/**
*
*
* @param examUserId
* @return
*/
public BusExamUserResult selectBusExamUserResultByExamUserId(Long examUserId);
/**
*
*
* @param busExamUserResult
* @return
*/
public List<BusExamUserResult> selectBusExamUserResultList(BusExamUserResult busExamUserResult);
/**
*
*
* @param busExamUserResult
* @return
*/
public int insertBusExamUserResult(BusExamUserResult busExamUserResult);
/**
*
*
* @param busExamUserResult
* @return
*/
public int updateBusExamUserResult(BusExamUserResult busExamUserResult);
/**
*
*
* @param examUserIds
* @return
*/
public int deleteBusExamUserResultByExamUserIds(Long[] examUserIds);
/**
*
*
* @param examUserId
* @return
*/
public int deleteBusExamUserResultByExamUserId(Long examUserId);
}

View File

@ -1,6 +1,8 @@
package com.yanzhu.manage.service;
import java.util.List;
import java.util.Map;
import com.yanzhu.manage.domain.BusTrainingVideo;
/**
@ -27,6 +29,14 @@ public interface IBusTrainingVideoService
*/
public List<BusTrainingVideo> selectBusTrainingVideoList(BusTrainingVideo busTrainingVideo);
/**
*
*
* @param busTrainingVideo
* @return
*/
public List<Map<String, Object>> findBusTrainingVideoByLevel(BusTrainingVideo busTrainingVideo);
/**
*
*

View File

@ -1,101 +0,0 @@
package com.yanzhu.manage.service.impl;
import java.util.Date;
import java.util.List;
import com.yanzhu.common.core.context.SecurityContextHolder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yanzhu.manage.mapper.BusExamInfoQuesMapper;
import com.yanzhu.manage.domain.BusExamInfoQues;
import com.yanzhu.manage.service.IBusExamInfoQuesService;
/**
* Service
*
* @author JiangYuQi
* @date 2024-08-25
*/
@Service
public class BusExamInfoQuesServiceImpl implements IBusExamInfoQuesService
{
@Autowired
private BusExamInfoQuesMapper busExamInfoQuesMapper;
/**
*
*
* @param examId
* @return
*/
@Override
public BusExamInfoQues selectBusExamInfoQuesByExamId(Long examId)
{
return busExamInfoQuesMapper.selectBusExamInfoQuesByExamId(examId);
}
/**
*
*
* @param busExamInfoQues
* @return
*/
@Override
public List<BusExamInfoQues> selectBusExamInfoQuesList(BusExamInfoQues busExamInfoQues)
{
return busExamInfoQuesMapper.selectBusExamInfoQuesList(busExamInfoQues);
}
/**
*
*
* @param busExamInfoQues
* @return
*/
@Override
public int insertBusExamInfoQues(BusExamInfoQues busExamInfoQues)
{
busExamInfoQues.setCreateBy(SecurityContextHolder.getUserName());
busExamInfoQues.setCreateTime(new Date());
return busExamInfoQuesMapper.insertBusExamInfoQues(busExamInfoQues);
}
/**
*
*
* @param busExamInfoQues
* @return
*/
@Override
public int updateBusExamInfoQues(BusExamInfoQues busExamInfoQues)
{
busExamInfoQues.setUpdateBy(SecurityContextHolder.getUserName());
busExamInfoQues.setUpdateTime(new Date());
return busExamInfoQuesMapper.updateBusExamInfoQues(busExamInfoQues);
}
/**
*
*
* @param examIds
* @return
*/
@Override
public int deleteBusExamInfoQuesByExamIds(Long[] examIds)
{
return busExamInfoQuesMapper.deleteBusExamInfoQuesByExamIds(examIds);
}
/**
*
*
* @param examId
* @return
*/
@Override
public int deleteBusExamInfoQuesByExamId(Long examId)
{
return busExamInfoQuesMapper.deleteBusExamInfoQuesByExamId(examId);
}
}

View File

@ -5,6 +5,7 @@ import java.util.List;
import com.yanzhu.common.core.context.SecurityContextHolder;
import com.yanzhu.common.core.utils.DateUtils;
import com.yanzhu.common.core.utils.StringUtils;
import com.yanzhu.common.security.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
@ -47,6 +48,8 @@ public class BusExamInfoServiceImpl implements IBusExamInfoService
@Override
public List<BusExamInfo> selectBusExamInfoList(BusExamInfo busExamInfo)
{
busExamInfo.setActiveComId(SecurityUtils.getLoginUser().getProjectDeptId());
busExamInfo.setActiveProjectId(SecurityUtils.getLoginUser().getProjectId());
return busExamInfoMapper.selectBusExamInfoList(busExamInfo);
}

View File

@ -1,100 +0,0 @@
package com.yanzhu.manage.service.impl;
import java.util.List;
import com.yanzhu.common.core.context.SecurityContextHolder;
import com.yanzhu.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yanzhu.manage.mapper.BusExamQuestionResultMapper;
import com.yanzhu.manage.domain.BusExamQuestionResult;
import com.yanzhu.manage.service.IBusExamQuestionResultService;
/**
* Service
*
* @author JiangYuQi
* @date 2024-08-25
*/
@Service
public class BusExamQuestionResultServiceImpl implements IBusExamQuestionResultService
{
@Autowired
private BusExamQuestionResultMapper busExamQuestionResultMapper;
/**
*
*
* @param id
* @return
*/
@Override
public BusExamQuestionResult selectBusExamQuestionResultById(Long id)
{
return busExamQuestionResultMapper.selectBusExamQuestionResultById(id);
}
/**
*
*
* @param busExamQuestionResult
* @return
*/
@Override
public List<BusExamQuestionResult> selectBusExamQuestionResultList(BusExamQuestionResult busExamQuestionResult)
{
return busExamQuestionResultMapper.selectBusExamQuestionResultList(busExamQuestionResult);
}
/**
*
*
* @param busExamQuestionResult
* @return
*/
@Override
public int insertBusExamQuestionResult(BusExamQuestionResult busExamQuestionResult)
{
busExamQuestionResult.setCreateTime(DateUtils.getNowDate());
busExamQuestionResult.setCreateBy(SecurityContextHolder.getUserName());
return busExamQuestionResultMapper.insertBusExamQuestionResult(busExamQuestionResult);
}
/**
*
*
* @param busExamQuestionResult
* @return
*/
@Override
public int updateBusExamQuestionResult(BusExamQuestionResult busExamQuestionResult)
{
busExamQuestionResult.setUpdateTime(DateUtils.getNowDate());
busExamQuestionResult.setUpdateBy(SecurityContextHolder.getUserName());
return busExamQuestionResultMapper.updateBusExamQuestionResult(busExamQuestionResult);
}
/**
*
*
* @param ids
* @return
*/
@Override
public int deleteBusExamQuestionResultByIds(Long[] ids)
{
return busExamQuestionResultMapper.deleteBusExamQuestionResultByIds(ids);
}
/**
*
*
* @param id
* @return
*/
@Override
public int deleteBusExamQuestionResultById(Long id)
{
return busExamQuestionResultMapper.deleteBusExamQuestionResultById(id);
}
}

View File

@ -1,100 +0,0 @@
package com.yanzhu.manage.service.impl;
import java.util.Date;
import java.util.List;
import com.yanzhu.common.core.context.SecurityContextHolder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yanzhu.manage.mapper.BusExamUserResultMapper;
import com.yanzhu.manage.domain.BusExamUserResult;
import com.yanzhu.manage.service.IBusExamUserResultService;
/**
* Service
*
* @author JiangYuQi
* @date 2024-08-25
*/
@Service
public class BusExamUserResultServiceImpl implements IBusExamUserResultService
{
@Autowired
private BusExamUserResultMapper busExamUserResultMapper;
/**
*
*
* @param examUserId
* @return
*/
@Override
public BusExamUserResult selectBusExamUserResultByExamUserId(Long examUserId)
{
return busExamUserResultMapper.selectBusExamUserResultByExamUserId(examUserId);
}
/**
*
*
* @param busExamUserResult
* @return
*/
@Override
public List<BusExamUserResult> selectBusExamUserResultList(BusExamUserResult busExamUserResult)
{
return busExamUserResultMapper.selectBusExamUserResultList(busExamUserResult);
}
/**
*
*
* @param busExamUserResult
* @return
*/
@Override
public int insertBusExamUserResult(BusExamUserResult busExamUserResult)
{
busExamUserResult.setCreateBy(SecurityContextHolder.getUserName());
busExamUserResult.setCreateTime(new Date());
return busExamUserResultMapper.insertBusExamUserResult(busExamUserResult);
}
/**
*
*
* @param busExamUserResult
* @return
*/
@Override
public int updateBusExamUserResult(BusExamUserResult busExamUserResult)
{
busExamUserResult.setUpdateBy(SecurityContextHolder.getUserName());
busExamUserResult.setUpdateTime(new Date());
return busExamUserResultMapper.updateBusExamUserResult(busExamUserResult);
}
/**
*
*
* @param examUserIds
* @return
*/
@Override
public int deleteBusExamUserResultByExamUserIds(Long[] examUserIds)
{
return busExamUserResultMapper.deleteBusExamUserResultByExamUserIds(examUserIds);
}
/**
*
*
* @param examUserId
* @return
*/
@Override
public int deleteBusExamUserResultByExamUserId(Long examUserId)
{
return busExamUserResultMapper.deleteBusExamUserResultByExamUserId(examUserId);
}
}

View File

@ -1,9 +1,11 @@
package com.yanzhu.manage.service.impl;
import java.util.List;
import java.util.Map;
import com.yanzhu.common.core.context.SecurityContextHolder;
import com.yanzhu.common.core.utils.DateUtils;
import com.yanzhu.common.security.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yanzhu.manage.mapper.BusTrainingVideoMapper;
@ -43,9 +45,24 @@ public class BusTrainingVideoServiceImpl implements IBusTrainingVideoService
@Override
public List<BusTrainingVideo> selectBusTrainingVideoList(BusTrainingVideo busTrainingVideo)
{
busTrainingVideo.setActiveComId(SecurityUtils.getLoginUser().getProjectDeptId());
busTrainingVideo.setActiveProjectId(SecurityUtils.getLoginUser().getProjectId());
return busTrainingVideoMapper.selectBusTrainingVideoList(busTrainingVideo);
}
/**
*
*
* @param busTrainingVideo
* @return
*/
@Override
public List<Map<String, Object>> findBusTrainingVideoByLevel(BusTrainingVideo busTrainingVideo){
busTrainingVideo.setActiveComId(SecurityUtils.getLoginUser().getProjectDeptId());
busTrainingVideo.setActiveProjectId(SecurityUtils.getLoginUser().getProjectId());
return busTrainingVideoMapper.findBusTrainingVideoByLevel(busTrainingVideo);
}
/**
*
*

View File

@ -2,6 +2,7 @@ package com.yanzhu.manage.service.impl;
import com.yanzhu.common.core.context.SecurityContextHolder;
import com.yanzhu.common.core.utils.DateUtils;
import com.yanzhu.common.security.utils.SecurityUtils;
import com.yanzhu.manage.domain.BusTrainingVideoUser;
import com.yanzhu.manage.mapper.BusTrainingVideoUserMapper;
import com.yanzhu.manage.service.IBusTrainingVideoUserService;
@ -43,6 +44,8 @@ public class BusTrainingVideoUserServiceImpl implements IBusTrainingVideoUserSer
@Override
public List<BusTrainingVideoUser> selectBusTrainingVideoUserList(BusTrainingVideoUser busTrainingVideoUser)
{
busTrainingVideoUser.setActiveComId(SecurityUtils.getLoginUser().getProjectDeptId());
busTrainingVideoUser.setActiveProjectId(SecurityUtils.getLoginUser().getProjectId());
return busTrainingVideoUserMapper.selectBusTrainingVideoUserList(busTrainingVideoUser);
}

View File

@ -144,8 +144,8 @@ public class SysUserController extends BaseController {
}
// 以项目人员身份登录
sysUser = userService.selectUserByUserName(username, Convert.toLong(list.get(0).get("project_id")));
sysUser.setActiveComId(sysUser.getComId());
sysUser.setActiveComName(sysUser.getComName());
sysUser.setActiveComId(Convert.toLong(list.get(0).get("com_id")));
sysUser.setActiveComName(Convert.toStr(list.get(0).get("com_name")));
sysUser.setActiveProjectId(Convert.toLong(list.get(0).get("project_id")));
sysUser.setActiveProjectName(Convert.toStr(list.get(0).get("project_name")));
}
@ -171,8 +171,8 @@ public class SysUserController extends BaseController {
SysUser sysUser = userService.selectUserByUserName(username, deptId);
List<Map<String, Object>> list = userService.selectProjectsByUserId(sysUser.getUserId());
sysUser.setActiveComId(sysUser.getComId());
sysUser.setActiveComName(sysUser.getComName());
sysUser.setActiveComId(Convert.toLong(list.get(0).get("com_id")));
sysUser.setActiveComName(Convert.toStr(list.get(0).get("com_name")));
sysUser.setActiveProjectId(Convert.toLong(list.get(0).get("project_id")));
sysUser.setActiveProjectName(Convert.toStr(list.get(0).get("project_name")));
@ -222,21 +222,7 @@ public class SysUserController extends BaseController {
*/
@GetMapping("getInfo")
public AjaxResult getInfo() {
SysUser cache = SecurityUtils.getLoginUser().getSysUser();
SysUser user;
if (SecurityUtils.isAdmin(cache.getUserId())) {
user = userService.selectUserById(cache.getUserId());
} else {
if (SecurityUtils.isGSAdmin()) {
user = userService.selectUserByIdAndDept(cache.getUserId(), cache.getComId());
} else {
user = userService.selectUserByIdAndDept(cache.getUserId(), cache.getActiveProjectId());
}
}
user.setActiveComId(cache.getComId());
user.setActiveComName(cache.getComName());
user.setActiveProjectId(cache.getActiveProjectId());
user.setActiveProjectName(cache.getActiveProjectName());
SysUser user = SecurityUtils.getLoginUser().getSysUser();
// 角色集合
Set<String> roles = permissionService.getRolePermission(user);
// 权限集合

View File

@ -9,6 +9,15 @@ export function listBusTrainingVideo(query) {
})
}
// 统计培训视频列表
export function findBusTrainingVideo(query) {
return request({
url: '/manage/busTrainingVideo/findGroupByLevel',
method: 'get',
params: query
})
}
// 查询培训视频详细
export function getBusTrainingVideo(id) {
return request({

View File

@ -498,7 +498,7 @@ function submitForm() {
let craftPostValues = [];
form.value.craftPost.forEach((item) => {
if(craftTypeValues.indexOf(item[0])<0){
craftTypeValues.push(item[0])
craftTypeValues.push(item[0]);
}
craftPostValues.push(item[1]);
});
@ -626,8 +626,8 @@ function initPage() {
}
}
/** 初始化岗位 */
function initPost() {
//
let craftTypeDatas=pro_craft_type._object.pro_craft_type;
let craftPostDatas=pro_craft_post._object.pro_craft_post;
craftTypeDatas.forEach(item =>{
@ -654,7 +654,7 @@ getList();
<style lang="scss" scope>
.gap-2{
.el-tag--default{
margin:3px 4px;
margin:2px 3px;
}
}
.el-divider__text{

View File

@ -1,36 +1,27 @@
<template>
<div class="app-container bus-training-video-index">
<el-row :gutter="20">
<!--部门数据-->
<el-col :span="6" :xs="24" v-if="1==2">
<div class="head-container">
<el-input v-model="deptName" placeholder="请输入部门名称" clearable prefix-icon="Search"
style="margin-bottom: 20px" />
</div>
<div class="head-container">
<el-tree :data="deptOptions" :props="{ label: 'label', children: 'children' }" :expand-on-click-node="false"
:filter-node-method="filterNode" ref="deptTreeRef" node-key="id" highlight-current accordion
:default-expanded-keys="defaultEK" @node-click="handleNodeClick" />
</div>
</el-col>
<el-col :span="24" :xs="24">
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="文件名称" prop="trainTitle">
<el-input v-model="queryParams.trainTitle" placeholder="请输入培训名称" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="教育级别" prop="trainLevel">
<el-select v-model="queryParams.trainLevel" placeholder="请选择培训级别" clearable>
<el-option v-for="dict in edu_train_level" :key="dict.value" :label="dict.label" :value="dict.value" />
</el-select>
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="项目名称" prop="projectName" v-if="!userStore.currentProId">
<el-input
v-model="queryParams.projectName"
placeholder="请输入项目名称"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="工种" v-if="queryParams.trainLevel==4" prop="craftType" className="fitem-craft-type el-form-item el-form-item--default asterisk-left">
<el-select v-model="queryParams.craftType" placeholder="请选择工种类型" clearable @change="getQueryCraftPost">
<el-option v-for="dict in pro_craft_type" :key="dict.value" :label="dict.label" :value="dict.value" />
</el-select>
<el-select style="margin-left:10px;" v-model="queryParams.craftPost" placeholder="请选择工种岗位" clearable>
<el-option v-for="dict in data.queryCraftPostList" :key="dict.value" :label="dict.label" :value="dict.value" />
<el-form-item label="培训名称" prop="trainTitle">
<el-input v-model="queryParams.trainTitle" placeholder="请输入培训名称" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="培训类型" prop="trainType">
<el-select v-model="queryParams.trainType" placeholder="请选择培训类型" clearable>
<el-option v-for="dict in edu_train_type" :key="dict.value" :label="dict.label" :value="dict.value" />
</el-select>
</el-form-item>
<el-form-item label="工种岗位" prop="craftPost">
<el-select v-model="queryParams.craftPost" placeholder="请选择工种岗位" clearable>
<el-option v-for="dict in pro_craft_post" :key="dict.value" :label="dict.label" :value="dict.value" />
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery"></el-button>
<el-button icon="Refresh" @click="resetQuery"></el-button>
@ -42,7 +33,6 @@
<el-button type="primary" plain icon="Plus" @click="handleAdd"
v-hasPermi="['manage:busTrainingVideo:add']">新增</el-button>
</el-col>
<!--
<el-col :span="1.5">
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate"
v-hasPermi="['manage:busTrainingVideo:edit']">修改</el-button>
@ -55,124 +45,137 @@
<el-button type="warning" plain icon="Download" @click="handleExport"
v-hasPermi="['manage:busTrainingVideo:export']">导出</el-button>
</el-col>
-->
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-tabs
v-model="queryParams.trainLevel"
type="card"
class="demo-tabs"
@tab-change="getList"
>
<el-tab-pane :label="'公司级('+tabs.gsj+''" name="2" />
<el-tab-pane :label="'项目级('+tabs.xmj+''" name="3" />
<el-tab-pane :label="'班组级('+tabs.bzj+''" name="4" />
</el-tabs>
<el-table v-loading="loading" :data="busTrainingVideoList" @selection-change="handleSelectionChange">
<el-table-column label="部门" align="center" prop="deptName" />
<el-table-column label="归属模块" align="center" prop="trainType">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="所属公司" align="center" prop="comName" width="120" :show-overflow-tooltip="true">
<template #default="scope">
<dict-tag :options="video_module" :value="scope.row.trainType" />
<span v-if="scope.row.comId">{{scope.row.comName}}</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="培训级别" align="center" prop="trainLevel">
<el-table-column label="项目名称" align="center" prop="projectName" width="120" :show-overflow-tooltip="true">
<template #default="scope">
<span v-if="scope.row.projectId">{{scope.row.projectName}}</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="培训名称" align="center" prop="trainTitle"/>
<el-table-column label="培训类型" align="center" prop="trainType" width="120">
<template #default="scope">
<dict-tag :options="edu_train_type" :value="scope.row.trainType" />
</template>
</el-table-column>
<el-table-column label="培训级别" align="center" prop="trainLevel" width="100">
<template #default="scope">
<dict-tag :options="edu_train_level" :value="scope.row.trainLevel" />
</template>
</el-table-column>
<el-table-column label="工种" align="center" width="300">
<el-table-column label="工种岗位" align="center" width="450">
<template #default="scope">
<dict-tag :options="pro_craft_type" :value="scope.row.craftType" />
<dict-tag :options="pro_craft_post" :value="scope.row.craftPost" />
<div v-if="scope.row.craftPost" class="flex gap-2">
<el-tag
v-for="dict in pro_craft_post"
v-show="scope.row.craftPost.indexOf(dict.value)>-1"
effect="dark"
>
{{ dict.label }}
</el-tag>
</div>
<div v-if="!scope.row.craftPost">-</div>
</template>
</el-table-column>
<el-table-column label="视频路径" align="center" prop="videoUrl" width="200px">
<el-table-column label="是否启用" align="center" prop="isDel" width="88">
<template #default="scope">
<video height="80" width="200" controls :key="scope.row.trainFilePath" v-if="scope.row.trainFilePath">
<source :src="scope.row.trainFilePath" type="video/mp4"/>
您的浏览器不支持Video标签
</video>
<el-tooltip :content="scope.row.isDel == 0 ? '启用' : '停用'" placement="top">
<el-switch
:active-value="parseInt(0)"
:inactive-value="parseInt(1)"
v-model="scope.row.isDel"
:disabled="scope.row.disabledState"
@change="setStatus($event, scope.row)"
/>
</el-tooltip>
</template>
</el-table-column>
<el-table-column label="培训文件时长" align="center" prop="trainFileTimes">
<template #default="scope">{{ scope.row.trainFileTimes }}</template>
<el-table-column label="培训时长" align="center" prop="palyTimes" width="80">
<template #default="scope">{{ scope.row.palyTimes }}</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" width="120">
<template #default="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<el-table-column label="操作" align="center" fixed="right" width="150" class-name="small-padding fixed-width">
<template #default="scope">
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
<el-button v-if="!scope.row.disabledState" link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
v-hasPermi="['manage:busTrainingVideo:edit']">修改</el-button>
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
<el-button v-if="!scope.row.disabledState" link type="primary" icon="Delete" @click="handleDelete(scope.row)"
v-hasPermi="['manage:busTrainingVideo:remove']">删除</el-button>
<el-button v-if="scope.row.disabledState" type="danger" link disabled>-</el-button>
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize"
@pagination="getList" />
</el-col>
</el-row>
<!-- 添加或修改培训视频对话框 -->
<el-dialog :title="title" v-model="open" width="500px" append-to-body :close-on-click-modal="false" :close-on-press-escape="false" class="bus-training-video-dlg">
<el-dialog :title="title" v-model="open" width="680px" append-to-body modal-class="bus-training-video-dlg">
<el-form ref="busTrainingVideoRef" :model="form" :rules="rules" label-width="80px">
<el-form-item label="归属公司" prop="deptId">
<el-input v-model="form.compName" disabled/>
<el-form-item label="所属公司" v-if="form.comId">
<el-tag effect="plain">{{ form.comName }}</el-tag>
</el-form-item>
<el-form-item label="归属模块" prop="trainType">
<el-select v-model="form.trainType" placeholder="请选择培训类型">
<el-option v-for="dict in video_module" :key="dict.value" :label="dict.label"
<el-form-item label="项目名称" v-if="form.projectId && form.trainLevel && form.trainLevel!='1'" >
<el-tag effect="plain">{{ form.projectName }}</el-tag>
</el-form-item>
<el-form-item label="培训类型" prop="trainType">
<el-select v-model="form.trainType" placeholder="请选择培训类型" style="width:100%">
<el-option v-for="dict in edu_train_type" :key="dict.value" :label="dict.label"
:value="dict.value"></el-option>
</el-select>
</el-form-item>
<el-form-item label="文件名称" prop="trainTitle">
<el-input v-model="form.trainTitle" placeholder="请输入培训名称" />
<el-form-item label="培训名称" prop="trainTitle">
<el-input v-model="form.trainTitle" placeholder="请输入培训名称" maxlength="64" show-word-limit />
</el-form-item>
<el-form-item label="教育级别" prop="trainLevel">
<el-select v-model="form.trainLevel" placeholder="请选择培训级别">
<el-option v-for="dict in edu_train_level" :key="dict.value" :label="dict.label"
<el-form-item label="培训级别" prop="trainLevel">
<el-select v-model="form.trainLevel" placeholder="请选择培训级别" @change="trainLevelChange" style="width:100%">
<el-option v-for="dict in data.eduTrainLevelList" :key="dict.value" :label="dict.label"
:value="dict.value"></el-option>
</el-select>
</el-form-item>
<el-row v-if="form.trainLevel==4">
<el-col :span="12">
<el-form-item label="归属工种" prop="craftType">
<el-select v-model="form.craftType" placeholder="请选择工种类型" @change="getCraftPost">
<el-option v-for="dict in pro_craft_type" :key="dict.value" :label="dict.label"
:value="dict.value"></el-option>
</el-select>
<el-form-item label="工种岗位" prop="craftPost">
<el-cascader
v-model="form.craftPost"
:options="craftPostOptions"
:props="casProps"
style="width: 100%"
placeholder="请选择工种岗位"
/>
</el-form-item>
</el-col>
<el-col :span="12" class="no-form-label" style="padding-left:10px;">
<el-form-item label="no" prop="craftPost">
<el-select v-model="form.craftPost" placeholder="请选择工种岗位">
<el-option v-for="dict in data.craftPostList" :key="dict.value" :label="dict.label"
:value="dict.value"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="显示排序" prop="ord">
<el-input-number v-model="form.ord" controls-position="right" :min="0" style="width:160px;"/>
</el-form-item>
<el-form-item label="视频时长" prop="trainFileTimes">
<el-input v-model="form.trainFileTimes" placeholder="请输入视频时长" style="width:180px;">
<template #append></template>
</el-input>
<el-form-item label="播放时长" prop="palyTimes">
<el-input v-model.number="form.palyTimes" placeholder="请输入播放时长" maxlength="8" show-word-limit/>
</el-form-item>
<el-form-item label="培训文件类型" prop="trainFileType">
<el-input v-model="form.trainFileType" type="textarea" placeholder="请输入内容" />
<el-form-item label="播放排序" prop="sortBy">
<el-input v-model.number="form.sortBy" placeholder="请输入播放排序" maxlength="8" show-word-limit/>
</el-form-item>
<el-form-item label="培训文件主图" prop="trainFileImage">
<image-upload v-model="form.trainFileImage" />
<el-form-item label="培训视频" prop="trainFilePath">
<file-upload v-model="form.trainFilePath" :limit="1" :fileType="['mp4']" :fileSize="500" />
</el-form-item>
<el-form-item label="培训文件时长" prop="trainFileTimes">
<el-input v-model="form.trainFileTimes" placeholder="请输入培训文件时长" />
</el-form-item>
<el-form-item label="删除标识" prop="isDel">
<el-select v-model="form.isDel" placeholder="请选择删除标识">
<el-option v-for="dict in sys_is_del" :key="dict.value" :label="dict.label"
:value="parseInt(dict.value)"></el-option>
</el-select>
</el-form-item>
<el-form-item label="视频文件" prop="trainFilePath" :class="form.trainFilePath?'has-video':'no-video'" class="fitem-video">
<file-upload v-model="form.trainFilePath" :limit="1" :fileType="['mp4']" :fileSize="100"/>
<el-form-item label="视频主图" prop="trainFileImage">
<file-upload v-model="form.trainFileImage" :limit="1" :fileType="['jpg','jpeg','png']" />
</el-form-item>
</el-form>
<template #footer>
@ -186,11 +189,10 @@
</template>
<script setup name="BusTrainingVideo">
import { listBusTrainingVideo, getBusTrainingVideo, delBusTrainingVideo, addBusTrainingVideo, updateBusTrainingVideo } from "@/api/manage/busTrainingVideo";
import { deptTreeSelect } from "@/api/system/user";
import { listBusTrainingVideo, findBusTrainingVideo, getBusTrainingVideo, delBusTrainingVideo, addBusTrainingVideo, updateBusTrainingVideo } from "@/api/manage/busTrainingVideo";
import useUserStore from '@/store/modules/user'
const { proxy } = getCurrentInstance();
const { edu_train_level, edu_train_type, pro_craft_type, sys_is_del, pro_craft_post,video_module } = proxy.useDict('edu_train_level', 'edu_train_type', 'pro_craft_type', 'sys_is_del', 'pro_craft_post','video_module');
const { edu_train_level, edu_train_type, pro_craft_type, sys_is_del, pro_craft_post } = proxy.useDict('edu_train_level', 'edu_train_type', 'pro_craft_type', 'sys_is_del', 'pro_craft_post');
const busTrainingVideoList = ref([]);
const open = ref(false);
@ -201,35 +203,32 @@ const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const title = ref("");
const deptOptions = ref(undefined);
const deptName = ref("");
const defaultEK = ref([100]);
const tabs = ref({'gsj':0,'xmj':0,'bzj':0});
const activeName = ref("gsj");
const craftPostOptions = ref([]);
const data = reactive({
form: {},
queryParams: {
pageNum: 1,
pageSize: 10,
deptId: null,
comId: null,
projectId: null,
projectName: null,
trainTitle: null,
trainType: null,
trainLevel: null,
craftType: null,
trainLevel: '2',
craftPost: null,
trainFileType: null,
isDel: null,
},
rules: {
deptId:[{ required: true, message: "归属公司不能为空", trigger: "blur" }],
trainType:[{ required: true, message: "归属模块不能为空", trigger: "blur" }],
trainTitle:[{ required: true, message: "文件名称不能为空", trigger: "blur" }],
trainLevel:[{ required: true, message: "教育级别不能为空", trigger: "blur" }],
craftType:[{ required: true, message: "工种不能为空", trigger: "blur" }],
trainType:[{ required: true, message: "培训类型不能为空", trigger: "blur" }],
trainTitle:[{ required: true, message: "培训名称不能为空", trigger: "blur" }],
trainLevel:[{ required: true, message: "培训级别不能为空", trigger: "blur" }],
craftPost:[{ required: true, message: "工种岗位不能为空", trigger: "blur" }],
ord:[{ required: true, message: "显示排序不能为空", trigger: "blur" }],
trainFileTimes:[{ required: true, message: "视频时长不能为空", trigger: "blur" }],
//trainFilePath:[{ required: true, message: "", trigger: "blur" }],
sortBy:[{ required: true, message: "显示排序不能为空", trigger: "blur" },{ type: "number", message: "请输入数字类型", trigger: "blur" }],
trainFilePath:[{ required: true, message: "培训视频不能为空", trigger: "blur" }],
trainFileImage:[{ required: true, message: "视频主图不能为空", trigger: "blur" }],
},
craftPostList:[],
queryCraftPostList:[]
@ -238,14 +237,42 @@ const data = reactive({
const { queryParams, form, rules } = toRefs(data);
const userStore = useUserStore()
const casProps = {
value: "value",
label: "label",
multiple: true,
};
/** 查询培训视频列表 */
function getList() {
loading.value = true;
listBusTrainingVideo(queryParams.value).then(response => {
response.rows.forEach(item => {
item.disabledState = initRowDisabled(item);
})
busTrainingVideoList.value = response.rows;
total.value = response.total;
loading.value = false;
});
findCount();
}
function findCount() {
findBusTrainingVideo(queryParams.value).then(response => {
let countMap = {'gsj':0,'xmj':0,'bzj':0};
response.data.forEach(item =>{
if(item.trainLevel=='2'){
countMap.gsj = item.total;
}else if(item.trainLevel=='3'){
countMap.xmj = item.total;
}else if(item.trainLevel=='4'){
countMap.bzj = item.total;
}else{
//...
}
});
tabs.value = countMap;
});
}
//
@ -277,37 +304,12 @@ function reset() {
data.craftPostList=[]
}
function getQueryCraftPost(){
let datas=pro_craft_post._object.pro_craft_post;
if(queryParams.value.craftType){
data.queryCraftPostList= datas.filter(d=>d.elTagClass==queryParams.value.craftType);
}else{
data.queryCraftPostList= [];
}
}
function getCraftPost(){
let datas=pro_craft_post._object.pro_craft_post;
console.log("dsds",datas)
if(form.value.craftType){
data.craftPostList= datas.filter(d=>d.elTagClass==form.value.craftType);
}else{
data.craftPostList= [];
}
}
/** 搜索按钮操作 */
function handleQuery() {
queryParams.value.pageNum = 1;
getList();
}
/** 节点单击事件 */
function handleNodeClick(data) {
queryParams.value.deptId = data.id;
handleQuery();
};
/** 重置按钮操作 */
function resetQuery() {
proxy.resetForm("queryRef");
@ -323,7 +325,15 @@ function handleSelectionChange(selection) {
/** 新增按钮操作 */
function handleAdd() {
if(!userStore.currentComId){
proxy.$modal.msgWarning("请切换到项目数据!!!");
open.value = false;
return false;
}
reset();
initPost();
form.value.comId = userStore.currentComId;
form.value.comName = userStore.currentComName;
open.value = true;
title.value = "添加培训视频";
}
@ -331,6 +341,7 @@ function handleAdd() {
/** 修改按钮操作 */
function handleUpdate(row) {
reset();
initPost();
const _id = row.id || ids.value
getBusTrainingVideo(_id).then(response => {
form.value = response.data;
@ -339,12 +350,40 @@ function handleUpdate(row) {
});
}
/** 培训级别操作 */
function trainLevelChange(){
if(form.value.trainLevel){
if(form.value.trainLevel=='3' || form.value.trainLevel=='4'){
if(!userStore.currentProId){
proxy.$modal.msgWarning("请切换到项目数据!!!");
open.value = false;
return false;
}else{
form.value.projectId = userStore.currentProId;
form.value.projectName = userStore.currentProName;
}
}else{
form.value.projectId = null;
form.value.projectName = null;
}
}
}
/** 提交按钮 */
function submitForm() {
proxy.$refs["busTrainingVideoRef"].validate(valid => {
if (valid) {
let path=form.value.trainFilePath;
form.value.trainFilePath=path.substring( path.indexOf("/statics/"));
form.value.remark = JSON.stringify(form.value.craftPost);
let craftTypeValues = [];
let craftPostValues = [];
form.value.craftPost.forEach((item) => {
if(craftTypeValues.indexOf(item[0])<0){
craftTypeValues.push(item[0]);
}
craftPostValues.push(item[1]);
});
form.value.craftType = craftTypeValues.toString();
form.value.craftPost = craftPostValues.toString();
if (form.value.id != null) {
updateBusTrainingVideo(form.value).then(response => {
proxy.$modal.msgSuccess("修改成功");
@ -362,6 +401,28 @@ function submitForm() {
});
}
/** 启用状态滑块控制 */
function setStatus(val, row) {
proxy.$modal
.confirm(`是否确认${val == 0 ? "启用" : "停用"}当前数据项?`)
.then(function () {
let param = {'id': row.id, 'isDel': val};
return updateBusTrainingVideo(param);
})
.then(() => {
getList();
proxy.$modal.msgSuccess("修改成功");
})
.catch(() => {
//
if (val == 0) {
row.isDel = 1;
} else {
row.isDel = 0;
}
});
}
/** 删除按钮操作 */
function handleDelete(row) {
const _ids = row.id || ids.value;
@ -379,26 +440,58 @@ function handleExport() {
...queryParams.value
}, `busTrainingVideo_${new Date().getTime()}.xlsx`)
}
/** 通过条件过滤节点 */
const filterNode = (value, data) => {
if (!value) return true;
return data.label.indexOf(value) !== -1;
};
/** 根据名称筛选部门树 */
watch(deptName, val => {
proxy.$refs["deptTreeRef"].filter(val);
});
/** 查询部门下拉树结构 */
function getDeptTree() {
deptTreeSelect().then(response => {
deptOptions.value = response.data;
/** 初始化行标识 */
function initRowDisabled(row) {
let roles = userStore.roles;
if(roles.includes("admin")){
return false;
}else if(roles.includes("gsAdmin") && row.comId){
return false;
}else if(row.projectId){
return false;
}else{
return true;
}
}
/** 初始化岗位 */
function initPost() {
let craftTypeDatas=pro_craft_type._object.pro_craft_type;
let craftPostDatas=pro_craft_post._object.pro_craft_post;
craftTypeDatas.forEach(item =>{
item.children = craftPostDatas.filter(deatil=>deatil.elTagClass==item.value);
});
};
console.log("DEFAULT" , craftTypeDatas);
craftPostOptions.value = craftTypeDatas;
initTrainLevel();
}
function initTrainLevel() {
let datas=edu_train_level._object.edu_train_level;
let roles = userStore.roles;
if(roles.includes("admin") || roles.includes("gsAdmin")){
//
data.eduTrainLevelList = datas;
}else{
data.eduTrainLevelList = datas.filter(detail=>detail.value!='2');
}
}
getList();
getDeptTree();
</script>
<style lang="scss">
.gap-2{
.el-tag--default{
margin:2px 3px;
}
}
.bus-training-video-dlg{
.el-dialog__body{
overflow: auto;
max-height: 680px;
}
}
.bus-training-video-index{
.fitem-craft-type{
.el-select{

View File

@ -1,50 +1,18 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="部门主键" prop="deptId">
<el-form-item label="项目名称" prop="projectName" v-if="!userStore.currentProId">
<el-input
v-model="queryParams.deptId"
placeholder="请输入部门主键"
v-model="queryParams.projectName"
placeholder="请输入项目名称"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="项目主键" prop="projectId">
<el-form-item label="用户账号" prop="userName">
<el-input
v-model="queryParams.projectId"
placeholder="请输入项目主键"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="用户主键" prop="userId">
<el-input
v-model="queryParams.userId"
placeholder="请输入用户主键"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="视频主键" prop="videoId">
<el-input
v-model="queryParams.videoId"
placeholder="请输入视频主键"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="排序" prop="sortBy">
<el-input
v-model="queryParams.sortBy"
placeholder="请输入排序"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="删除标识" prop="isDel">
<el-input
v-model="queryParams.isDel"
placeholder="请输入删除标识"
v-model="queryParams.userName"
placeholder="请输入用户账号"
clearable
@keyup.enter="handleQuery"
/>
@ -55,7 +23,7 @@
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-row v-if="false" :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
@ -98,19 +66,22 @@
</el-row>
<el-table v-loading="loading" :data="busTrainingVideoUserList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="主键" align="center" prop="id" />
<el-table-column label="部门主键" align="center" prop="deptId" />
<el-table-column label="项目主键" align="center" prop="projectId" />
<el-table-column label="用户主键" align="center" prop="userId" />
<el-table-column label="视频主键" align="center" prop="videoId" />
<el-table-column label="播放状态" align="center" prop="playStatus" />
<el-table-column label="排序" align="center" prop="sortBy" />
<el-table-column label="删除标识" align="center" prop="isDel" />
<el-table-column label="所属公司" align="center" prop="comName" />
<el-table-column label="项目名称" align="center" prop="projectName" />
<el-table-column label="用户账号" align="center" prop="userName" />
<el-table-column label="培训状态" align="center" prop="playStatus" />
<el-table-column label="培训排序" align="center" prop="sortBy" />
<el-table-column label="培训时间" align="center" prop="createTime" width="120">
<template #default="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template #default="scope">
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['manage:busTrainingVideoUser:edit']"></el-button>
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['manage:busTrainingVideoUser:remove']"></el-button>
<el-button v-if="false" link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['manage:busTrainingVideoUser:edit']"></el-button>
<el-button v-if="false" link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['manage:busTrainingVideoUser:remove']"></el-button>
<el-button type="danger" link disabled>-</el-button>
</template>
</el-table-column>
</el-table>