Commit 460f791c authored by zhangjianqian's avatar zhangjianqian

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	danger-manage-web/src/views/educationPlanExam/myLessons/CheckLesson/index.vue
parents da704ed1 7321ff8b
......@@ -22,7 +22,7 @@ import com.zehong.common.core.page.TableDataInfo;
/**
* 承包商及访客培训Controller
*
*
* @author zehong
* @date 2022-12-27
*/
......@@ -45,6 +45,16 @@ public class TContractorTrainCourseController extends BaseController
return getDataTable(list);
}
/**
* 查询承包商及访客培训信息
* @param tContractorTrainCourse
* @return
*/
@GetMapping("/getITContractorTrainCourse")
public AjaxResult getITContractorTrainCourse(TContractorTrainCourse tContractorTrainCourse){
return AjaxResult.success(tContractorTrainCourseService.getITContractorTrainCourse(tContractorTrainCourse));
}
/**
* 导出承包商及访客培训列表
*/
......
......@@ -22,7 +22,7 @@ import com.zehong.common.core.page.TableDataInfo;
/**
* 承包商及访客培训题库Controller
*
*
* @author zehong
* @date 2022-12-27
*/
......
......@@ -25,7 +25,7 @@ import com.zehong.common.core.page.TableDataInfo;
/**
* 安全承诺公告Controller
*
*
* @author zehong
* @date 2022-12-21
*/
......@@ -39,7 +39,7 @@ public class TSafetyCommitmentAnnouncementController extends BaseController
/**
* 查询安全承诺公告列表
*/
@PreAuthorize("@ss.hasPermi('system:announcement:list')")
// @PreAuthorize("@ss.hasPermi('system:announcement:list')")
@GetMapping("/list")
public TableDataInfo list(TSafetyCommitmentAnnouncement tSafetyCommitmentAnnouncement)
{
......
package com.zehong.web.controller.system;
import java.util.Date;
import java.util.List;
import java.util.Map;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.zehong.common.annotation.Log;
import com.zehong.common.core.controller.BaseController;
import com.zehong.common.core.domain.AjaxResult;
import com.zehong.common.enums.BusinessType;
import com.zehong.system.domain.TContractorTrainResult;
import com.zehong.system.service.ITContractorTrainResultService;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.common.core.page.TableDataInfo;
/**
* 承包商及访客培训考试结果详情Controller
*
* @author zehong
* @date 2022-12-27
*/
@RestController
@RequestMapping("/system/result")
public class TContractorTrainResultController extends BaseController
{
@Autowired
private ITContractorTrainResultService tContractorTrainResultService;
/**
* 查询承包商及访客培训考试结果详情列表
*/
//@PreAuthorize("@ss.hasPermi('system:result:list')")
@GetMapping("/list")
public TableDataInfo list(TContractorTrainResult tContractorTrainResult)
{
startPage();
List<TContractorTrainResult> list = tContractorTrainResultService.selectTContractorTrainResultList(tContractorTrainResult);
return getDataTable(list);
}
/**
* 导出承包商及访客培训考试结果详情列表
*/
//@PreAuthorize("@ss.hasPermi('system:result:export')")
@Log(title = "承包商及访客培训考试结果详情", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(TContractorTrainResult tContractorTrainResult)
{
List<TContractorTrainResult> list = tContractorTrainResultService.selectTContractorTrainResultList(tContractorTrainResult);
ExcelUtil<TContractorTrainResult> util = new ExcelUtil<TContractorTrainResult>(TContractorTrainResult.class);
return util.exportExcel(list, "承包商及访客培训考试结果详情数据");
}
/**
* 获取承包商及访客培训考试结果详情详细信息
*/
//@PreAuthorize("@ss.hasPermi('system:result:query')")
@GetMapping(value = "/{resultId}")
public AjaxResult getInfo(@PathVariable("resultId") Long resultId)
{
return AjaxResult.success(tContractorTrainResultService.selectTContractorTrainResultById(resultId));
}
/**
* 新增承包商及访客培训考试结果详情
*/
//@PreAuthorize("@ss.hasPermi('system:result:add')")
@Log(title = "承包商及访客培训考试结果详情", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TContractorTrainResult tContractorTrainResult)
{
return toAjax(tContractorTrainResultService.insertTContractorTrainResult(tContractorTrainResult));
}
@ApiOperation("用户课程考试交卷")
@GetMapping("/examination")
public AjaxResult examination( TContractorTrainResult tContractorTrainResult){
//结束时间
tContractorTrainResult.setTestEndTime(new Date());
Map<String, Object> examination = tContractorTrainResultService.examination(tContractorTrainResult);
return AjaxResult.success(examination);
}
/**
* 修改承包商及访客培训考试结果详情
*/
//@PreAuthorize("@ss.hasPermi('system:result:edit')")
@Log(title = "承包商及访客培训考试结果详情", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TContractorTrainResult tContractorTrainResult)
{
return toAjax(tContractorTrainResultService.updateTContractorTrainResult(tContractorTrainResult));
}
/**
* 删除承包商及访客培训考试结果详情
*/
//@PreAuthorize("@ss.hasPermi('system:result:remove')")
@Log(title = "承包商及访客培训考试结果详情", businessType = BusinessType.DELETE)
@DeleteMapping("/{resultIds}")
public AjaxResult remove(@PathVariable Long[] resultIds)
{
return toAjax(tContractorTrainResultService.deleteTContractorTrainResultByIds(resultIds));
}
}
package com.zehong.web.controller.system;
import java.util.List;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.zehong.common.annotation.Log;
import com.zehong.common.core.controller.BaseController;
import com.zehong.common.core.domain.AjaxResult;
import com.zehong.common.enums.BusinessType;
import com.zehong.system.domain.TContractorTrainResultDetail;
import com.zehong.system.service.ITContractorTrainResultDetailService;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.common.core.page.TableDataInfo;
/**
* 承包商及访客培训考试结果详情Controller
*
* @author wu
* @date 2022-12-30
*/
@RestController
@RequestMapping("/system/detail")
public class TContractorTrainResultDetailController extends BaseController
{
@Autowired
private ITContractorTrainResultDetailService tContractorTrainResultDetailService;
/**
* 查询承包商及访客培训考试结果详情列表
*/
//@PreAuthorize("@ss.hasPermi('system:detail:list')")
@GetMapping("/list")
public TableDataInfo list(TContractorTrainResultDetail tContractorTrainResultDetail)
{
startPage();
List<TContractorTrainResultDetail> list = tContractorTrainResultDetailService.selectTContractorTrainResultDetailList(tContractorTrainResultDetail);
return getDataTable(list);
}
/**
* 导出承包商及访客培训考试结果详情列表
*/
//@PreAuthorize("@ss.hasPermi('system:detail:export')")
@Log(title = "承包商及访客培训考试结果详情", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(TContractorTrainResultDetail tContractorTrainResultDetail)
{
List<TContractorTrainResultDetail> list = tContractorTrainResultDetailService.selectTContractorTrainResultDetailList(tContractorTrainResultDetail);
ExcelUtil<TContractorTrainResultDetail> util = new ExcelUtil<TContractorTrainResultDetail>(TContractorTrainResultDetail.class);
return util.exportExcel(list, "承包商及访客培训考试结果详情数据");
}
/**
* 获取承包商及访客培训考试结果详情详细信息
*/
//@PreAuthorize("@ss.hasPermi('system:detail:query')")
@GetMapping(value = "/{detailId}")
public AjaxResult getInfo(@PathVariable("detailId") Long detailId)
{
return AjaxResult.success(tContractorTrainResultDetailService.selectTContractorTrainResultDetailById(detailId));
}
/**
* 新增承包商及访客培训考试结果详情
*/
//@PreAuthorize("@ss.hasPermi('system:detail:add')")
@Log(title = "承包商及访客培训考试结果详情", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TContractorTrainResultDetail tContractorTrainResultDetail)
{
return toAjax(tContractorTrainResultDetailService.insertTContractorTrainResultDetail(tContractorTrainResultDetail));
}
/**
* 修改承包商及访客培训考试结果详情
*/
//@PreAuthorize("@ss.hasPermi('system:detail:edit')")
@Log(title = "承包商及访客培训考试结果详情", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TContractorTrainResultDetail tContractorTrainResultDetail)
{
return toAjax(tContractorTrainResultDetailService.updateTContractorTrainResultDetail(tContractorTrainResultDetail));
}
/**
* 删除承包商及访客培训考试结果详情
*/
//@PreAuthorize("@ss.hasPermi('system:detail:remove')")
@Log(title = "承包商及访客培训考试结果详情", businessType = BusinessType.DELETE)
@DeleteMapping("/{detailIds}")
public AjaxResult remove(@PathVariable Long[] detailIds)
{
return toAjax(tContractorTrainResultDetailService.deleteTContractorTrainResultDetailByIds(detailIds));
}
}
......@@ -41,6 +41,7 @@ public class TTrainCourseBankController extends BaseController
public TableDataInfo list(TTrainCourseBank tTrainCourseBank)
{
startPage();
System.out.println(tTrainCourseBank);
List<TTrainCourseBank> list = tTrainCourseBankService.selectTTrainCourseBankList(tTrainCourseBank);
return getDataTable(list);
}
......
package com.zehong.framework.config;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.http.HttpMethod;
import org.springframework.security.authentication.AuthenticationManager;
......@@ -20,7 +21,7 @@ import com.zehong.framework.security.handle.LogoutSuccessHandlerImpl;
/**
* spring security配置
*
*
* @author zehong
*/
@EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true)
......@@ -31,7 +32,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
*/
@Autowired
private UserDetailsService userDetailsService;
/**
* 认证失败处理类
*/
......@@ -55,7 +56,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
*/
@Autowired
private CorsFilter corsFilter;
/**
* 解决 无法直接注入 AuthenticationManager
*
......@@ -103,11 +104,17 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
"/*.html",
"/**/*.html",
"/**/*.css",
"/**/*.js"
"/**/*.js",
"/contractTrain/getITContractorTrainCourse",
"/contractTrain/list",
"/system/result/list",
"/contractTrainTopic/list",
"/system/result/**"
).permitAll()
.antMatchers(
HttpMethod.POST,
"/subscription/**"
"/subscription/**",
"/system/result/**"
).permitAll()
.antMatchers("/profile/**").anonymous()
.antMatchers("/common/download**").anonymous()
......@@ -129,7 +136,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
httpSecurity.addFilterBefore(corsFilter, LogoutFilter.class);
}
/**
* 强散列哈希加密实现
*/
......
package com.zehong.system.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.zehong.common.annotation.Excel;
import com.zehong.common.core.domain.BaseEntity;
/**
* 承包商及访客培训考试结果详情对象 t_contractor_train_result
*
* @author zehong
* @date 2022-12-27
*/
public class TContractorTrainResult extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 结果id */
private Long resultId;
/** 所属单位 */
@Excel(name = "所属单位")
private String beyondUnit;
/** 姓名 */
@Excel(name = "姓名")
private String name;
/** 性别:0 男,1 女 */
@Excel(name = "性别:0 男,1 女")
private String sex;
/** 手机号 */
@Excel(name = "手机号")
private String phoneNum;
/** 考试开始时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "考试开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date testBeginTime;
/** 考试结束时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "考试结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date testEndTime;
/** 答对数量 */
@Excel(name = "答对数量")
private String score;
/** 是否合格:0 合格,1 不合格 */
@Excel(name = "是否合格:0 合格,1 不合格")
private String isQualified;
/** 是否删除(0正常,1删除) */
private String isDel;
private String answers;
public static long getSerialVersionUID() {
return serialVersionUID;
}
public String getAnswers() {
return answers;
}
public void setAnswers(String answers) {
this.answers = answers;
}
public void setResultId(Long resultId)
{
this.resultId = resultId;
}
public Long getResultId()
{
return resultId;
}
public void setBeyondUnit(String beyondUnit)
{
this.beyondUnit = beyondUnit;
}
public String getBeyondUnit()
{
return beyondUnit;
}
public void setName(String name)
{
this.name = name;
}
public String getName()
{
return name;
}
public void setSex(String sex)
{
this.sex = sex;
}
public String getSex()
{
return sex;
}
public void setPhoneNum(String phoneNum)
{
this.phoneNum = phoneNum;
}
public String getPhoneNum()
{
return phoneNum;
}
public void setTestBeginTime(Date testBeginTime)
{
this.testBeginTime = testBeginTime;
}
public Date getTestBeginTime()
{
return testBeginTime;
}
public void setTestEndTime(Date testEndTime)
{
this.testEndTime = testEndTime;
}
public Date getTestEndTime()
{
return testEndTime;
}
public void setScore(String score)
{
this.score = score;
}
public String getScore()
{
return score;
}
public void setIsQualified(String isQualified)
{
this.isQualified = isQualified;
}
public String getIsQualified()
{
return isQualified;
}
public void setIsDel(String isDel)
{
this.isDel = isDel;
}
public String getIsDel()
{
return isDel;
}
@Override
public String toString() {
return "TContractorTrainResult{" +
"resultId=" + resultId +
", beyondUnit='" + beyondUnit + '\'' +
", name='" + name + '\'' +
", sex='" + sex + '\'' +
", phoneNum='" + phoneNum + '\'' +
", testBeginTime=" + testBeginTime +
", testEndTime=" + testEndTime +
", score='" + score + '\'' +
", isQualified='" + isQualified + '\'' +
", isDel='" + isDel + '\'' +
", answers='" + answers + '\'' +
'}';
}
}
package com.zehong.system.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.zehong.common.annotation.Excel;
import com.zehong.common.core.domain.BaseEntity;
/**
* 承包商及访客培训考试结果详情对象 t_contractor_train_result_detail
*
* @author wu
* @date 2022-12-30
*/
public class TContractorTrainResultDetail extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 结果详情id */
private Long detailId;
/** 结果关联id */
@Excel(name = "结果关联id")
private Long resultId;
/** 题目内容 */
@Excel(name = "题目内容")
private String topicTitle;
/** 题目选项(json) */
@Excel(name = "题目选项", readConverterExp = "j=son")
private String topicOption;
/** 答案 */
@Excel(name = "答案")
private Integer answer;
/** 所选答案 */
@Excel(name = "所选答案")
private Integer answerChoice;
/** 答题结果:0 对,1 错 */
@Excel(name = "答题结果:0 对,1 错")
private String result;
/** 是否删除(0正常,1删除) */
@Excel(name = "是否删除(0正常,1删除)")
private String isDel;
public void setDetailId(Long detailId)
{
this.detailId = detailId;
}
public Long getDetailId()
{
return detailId;
}
public void setResultId(Long resultId)
{
this.resultId = resultId;
}
public Long getResultId()
{
return resultId;
}
public void setTopicTitle(String topicTitle)
{
this.topicTitle = topicTitle;
}
public String getTopicTitle()
{
return topicTitle;
}
public void setTopicOption(String topicOption)
{
this.topicOption = topicOption;
}
public String getTopicOption()
{
return topicOption;
}
public void setAnswer(Integer answer)
{
this.answer = answer;
}
public Integer getAnswer()
{
return answer;
}
public void setAnswerChoice(Integer answerChoice)
{
this.answerChoice = answerChoice;
}
public Integer getAnswerChoice()
{
return answerChoice;
}
public void setResult(String result)
{
this.result = result;
}
public String getResult()
{
return result;
}
public void setIsDel(String isDel)
{
this.isDel = isDel;
}
public String getIsDel()
{
return isDel;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("detailId", getDetailId())
.append("resultId", getResultId())
.append("topicTitle", getTopicTitle())
.append("topicOption", getTopicOption())
.append("answer", getAnswer())
.append("answerChoice", getAnswerChoice())
.append("result", getResult())
.append("createTime", getCreateTime())
.append("isDel", getIsDel())
.append("remark", getRemark())
.toString();
}
}
......@@ -5,15 +5,15 @@ import com.zehong.system.domain.TContractorTrainCourse;
/**
* 承包商及访客培训Mapper接口
*
*
* @author zehong
* @date 2022-12-27
*/
public interface TContractorTrainCourseMapper
public interface TContractorTrainCourseMapper
{
/**
* 查询承包商及访客培训
*
*
* @param contractorCourseId 承包商及访客培训ID
* @return 承包商及访客培训
*/
......@@ -21,7 +21,7 @@ public interface TContractorTrainCourseMapper
/**
* 查询承包商及访客培训列表
*
*
* @param tContractorTrainCourse 承包商及访客培训
* @return 承包商及访客培训集合
*/
......@@ -29,7 +29,7 @@ public interface TContractorTrainCourseMapper
/**
* 新增承包商及访客培训
*
*
* @param tContractorTrainCourse 承包商及访客培训
* @return 结果
*/
......@@ -37,7 +37,7 @@ public interface TContractorTrainCourseMapper
/**
* 修改承包商及访客培训
*
*
* @param tContractorTrainCourse 承包商及访客培训
* @return 结果
*/
......@@ -45,7 +45,7 @@ public interface TContractorTrainCourseMapper
/**
* 删除承包商及访客培训
*
*
* @param contractorCourseId 承包商及访客培训ID
* @return 结果
*/
......@@ -53,9 +53,16 @@ public interface TContractorTrainCourseMapper
/**
* 批量删除承包商及访客培训
*
*
* @param contractorCourseIds 需要删除的数据ID
* @return 结果
*/
public int deleteTContractorTrainCourseByIds(Long[] contractorCourseIds);
/**
* 查询承包商及访客培训
* @param tContractorTrainCourse
* @return
*/
TContractorTrainCourse getITContractorTrainCourse(TContractorTrainCourse tContractorTrainCourse);
}
package com.zehong.system.mapper;
import java.util.List;
import com.zehong.system.domain.TContractorTrainResultDetail;
/**
* 承包商及访客培训考试结果详情Mapper接口
*
* @author wu
* @date 2022-12-30
*/
public interface TContractorTrainResultDetailMapper
{
/**
* 查询承包商及访客培训考试结果详情
*
* @param detailId 承包商及访客培训考试结果详情ID
* @return 承包商及访客培训考试结果详情
*/
public TContractorTrainResultDetail selectTContractorTrainResultDetailById(Long detailId);
/**
* 查询承包商及访客培训考试结果详情列表
*
* @param tContractorTrainResultDetail 承包商及访客培训考试结果详情
* @return 承包商及访客培训考试结果详情集合
*/
public List<TContractorTrainResultDetail> selectTContractorTrainResultDetailList(TContractorTrainResultDetail tContractorTrainResultDetail);
/**
* 新增承包商及访客培训考试结果详情
*
* @param tContractorTrainResultDetail 承包商及访客培训考试结果详情
* @return 结果
*/
public int insertTContractorTrainResultDetail(TContractorTrainResultDetail tContractorTrainResultDetail);
/**
* 修改承包商及访客培训考试结果详情
*
* @param tContractorTrainResultDetail 承包商及访客培训考试结果详情
* @return 结果
*/
public int updateTContractorTrainResultDetail(TContractorTrainResultDetail tContractorTrainResultDetail);
/**
* 删除承包商及访客培训考试结果详情
*
* @param detailId 承包商及访客培训考试结果详情ID
* @return 结果
*/
public int deleteTContractorTrainResultDetailById(Long detailId);
/**
* 批量删除承包商及访客培训考试结果详情
*
* @param detailIds 需要删除的数据ID
* @return 结果
*/
public int deleteTContractorTrainResultDetailByIds(Long[] detailIds);
}
package com.zehong.system.mapper;
import java.util.List;
import com.zehong.system.domain.TContractorTrainResult;
/**
* 承包商及访客培训考试结果详情Mapper接口
*
* @author zehong
* @date 2022-12-27
*/
public interface TContractorTrainResultMapper
{
/**
* 查询承包商及访客培训考试结果详情
*
* @param resultId 承包商及访客培训考试结果详情ID
* @return 承包商及访客培训考试结果详情
*/
public TContractorTrainResult selectTContractorTrainResultById(Long resultId);
/**
* 查询承包商及访客培训考试结果详情列表
*
* @param tContractorTrainResult 承包商及访客培训考试结果详情
* @return 承包商及访客培训考试结果详情集合
*/
public List<TContractorTrainResult> selectTContractorTrainResultList(TContractorTrainResult tContractorTrainResult);
/**
* 新增承包商及访客培训考试结果详情
*
* @param tContractorTrainResult 承包商及访客培训考试结果详情
* @return 结果
*/
public int insertTContractorTrainResult(TContractorTrainResult tContractorTrainResult);
/**
* 修改承包商及访客培训考试结果详情
*
* @param tContractorTrainResult 承包商及访客培训考试结果详情
* @return 结果
*/
public int updateTContractorTrainResult(TContractorTrainResult tContractorTrainResult);
/**
* 删除承包商及访客培训考试结果详情
*
* @param resultId 承包商及访客培训考试结果详情ID
* @return 结果
*/
public int deleteTContractorTrainResultById(Long resultId);
/**
* 批量删除承包商及访客培训考试结果详情
*
* @param resultIds 需要删除的数据ID
* @return 结果
*/
public int deleteTContractorTrainResultByIds(Long[] resultIds);
}
......@@ -5,15 +5,15 @@ import com.zehong.system.domain.TContractorTrainCourse;
/**
* 承包商及访客培训Service接口
*
*
* @author zehong
* @date 2022-12-27
*/
public interface ITContractorTrainCourseService
public interface ITContractorTrainCourseService
{
/**
* 查询承包商及访客培训
*
*
* @param contractorCourseId 承包商及访客培训ID
* @return 承包商及访客培训
*/
......@@ -21,7 +21,7 @@ public interface ITContractorTrainCourseService
/**
* 查询承包商及访客培训列表
*
*
* @param tContractorTrainCourse 承包商及访客培训
* @return 承包商及访客培训集合
*/
......@@ -29,7 +29,7 @@ public interface ITContractorTrainCourseService
/**
* 新增承包商及访客培训
*
*
* @param tContractorTrainCourse 承包商及访客培训
* @return 结果
*/
......@@ -37,7 +37,7 @@ public interface ITContractorTrainCourseService
/**
* 修改承包商及访客培训
*
*
* @param tContractorTrainCourse 承包商及访客培训
* @return 结果
*/
......@@ -45,7 +45,7 @@ public interface ITContractorTrainCourseService
/**
* 批量删除承包商及访客培训
*
*
* @param contractorCourseIds 需要删除的承包商及访客培训ID
* @return 结果
*/
......@@ -53,9 +53,16 @@ public interface ITContractorTrainCourseService
/**
* 删除承包商及访客培训信息
*
*
* @param contractorCourseId 承包商及访客培训ID
* @return 结果
*/
public int deleteTContractorTrainCourseById(Long contractorCourseId);
/**
* 查询承包商及访客培训
* @param tContractorTrainCourse
* @return
*/
TContractorTrainCourse getITContractorTrainCourse(TContractorTrainCourse tContractorTrainCourse);
}
package com.zehong.system.service;
import java.util.List;
import com.zehong.system.domain.TContractorTrainResultDetail;
/**
* 承包商及访客培训考试结果详情Service接口
*
* @author wu
* @date 2022-12-30
*/
public interface ITContractorTrainResultDetailService
{
/**
* 查询承包商及访客培训考试结果详情
*
* @param detailId 承包商及访客培训考试结果详情ID
* @return 承包商及访客培训考试结果详情
*/
public TContractorTrainResultDetail selectTContractorTrainResultDetailById(Long detailId);
/**
* 查询承包商及访客培训考试结果详情列表
*
* @param tContractorTrainResultDetail 承包商及访客培训考试结果详情
* @return 承包商及访客培训考试结果详情集合
*/
public List<TContractorTrainResultDetail> selectTContractorTrainResultDetailList(TContractorTrainResultDetail tContractorTrainResultDetail);
/**
* 新增承包商及访客培训考试结果详情
*
* @param tContractorTrainResultDetail 承包商及访客培训考试结果详情
* @return 结果
*/
public int insertTContractorTrainResultDetail(TContractorTrainResultDetail tContractorTrainResultDetail);
/**
* 修改承包商及访客培训考试结果详情
*
* @param tContractorTrainResultDetail 承包商及访客培训考试结果详情
* @return 结果
*/
public int updateTContractorTrainResultDetail(TContractorTrainResultDetail tContractorTrainResultDetail);
/**
* 批量删除承包商及访客培训考试结果详情
*
* @param detailIds 需要删除的承包商及访客培训考试结果详情ID
* @return 结果
*/
public int deleteTContractorTrainResultDetailByIds(Long[] detailIds);
/**
* 删除承包商及访客培训考试结果详情信息
*
* @param detailId 承包商及访客培训考试结果详情ID
* @return 结果
*/
public int deleteTContractorTrainResultDetailById(Long detailId);
}
package com.zehong.system.service;
import java.util.List;
import java.util.Map;
import com.zehong.system.domain.TContractorTrainResult;
/**
* 承包商及访客培训考试结果详情Service接口
*
* @author zehong
* @date 2022-12-27
*/
public interface ITContractorTrainResultService
{
/**
* 查询承包商及访客培训考试结果详情
*
* @param resultId 承包商及访客培训考试结果详情ID
* @return 承包商及访客培训考试结果详情
*/
public TContractorTrainResult selectTContractorTrainResultById(Long resultId);
/**
* 查询承包商及访客培训考试结果详情列表
*
* @param tContractorTrainResult 承包商及访客培训考试结果详情
* @return 承包商及访客培训考试结果详情集合
*/
public List<TContractorTrainResult> selectTContractorTrainResultList(TContractorTrainResult tContractorTrainResult);
/**
* 新增承包商及访客培训考试结果详情
*
* @param tContractorTrainResult 承包商及访客培训考试结果详情
* @return 结果
*/
public int insertTContractorTrainResult(TContractorTrainResult tContractorTrainResult);
/**
* 修改承包商及访客培训考试结果详情
*
* @param tContractorTrainResult 承包商及访客培训考试结果详情
* @return 结果
*/
public int updateTContractorTrainResult(TContractorTrainResult tContractorTrainResult);
/**
* 批量删除承包商及访客培训考试结果详情
*
* @param resultIds 需要删除的承包商及访客培训考试结果详情ID
* @return 结果
*/
public int deleteTContractorTrainResultByIds(Long[] resultIds);
/**
* 删除承包商及访客培训考试结果详情信息
*
* @param resultId 承包商及访客培训考试结果详情ID
* @return 结果
*/
public int deleteTContractorTrainResultById(Long resultId);
/**
* 用户课程考试交卷
* @param tContractorTrainResult
*/
Map<String,Object> examination(TContractorTrainResult tContractorTrainResult);
}
......@@ -10,19 +10,19 @@ import com.zehong.system.service.ITContractorTrainCourseService;
/**
* 承包商及访客培训Service业务层处理
*
*
* @author zehong
* @date 2022-12-27
*/
@Service
public class TContractorTrainCourseServiceImpl implements ITContractorTrainCourseService
public class TContractorTrainCourseServiceImpl implements ITContractorTrainCourseService
{
@Autowired
private TContractorTrainCourseMapper tContractorTrainCourseMapper;
/**
* 查询承包商及访客培训
*
*
* @param contractorCourseId 承包商及访客培训ID
* @return 承包商及访客培训
*/
......@@ -34,7 +34,7 @@ public class TContractorTrainCourseServiceImpl implements ITContractorTrainCours
/**
* 查询承包商及访客培训列表
*
*
* @param tContractorTrainCourse 承包商及访客培训
* @return 承包商及访客培训
*/
......@@ -46,7 +46,7 @@ public class TContractorTrainCourseServiceImpl implements ITContractorTrainCours
/**
* 新增承包商及访客培训
*
*
* @param tContractorTrainCourse 承包商及访客培训
* @return 结果
*/
......@@ -59,7 +59,7 @@ public class TContractorTrainCourseServiceImpl implements ITContractorTrainCours
/**
* 修改承包商及访客培训
*
*
* @param tContractorTrainCourse 承包商及访客培训
* @return 结果
*/
......@@ -71,7 +71,7 @@ public class TContractorTrainCourseServiceImpl implements ITContractorTrainCours
/**
* 批量删除承包商及访客培训
*
*
* @param contractorCourseIds 需要删除的承包商及访客培训ID
* @return 结果
*/
......@@ -83,7 +83,7 @@ public class TContractorTrainCourseServiceImpl implements ITContractorTrainCours
/**
* 删除承包商及访客培训信息
*
*
* @param contractorCourseId 承包商及访客培训ID
* @return 结果
*/
......@@ -92,4 +92,14 @@ public class TContractorTrainCourseServiceImpl implements ITContractorTrainCours
{
return tContractorTrainCourseMapper.deleteTContractorTrainCourseById(contractorCourseId);
}
/**
* 查询承包商及访客培训
* @param tContractorTrainCourse
* @return
*/
@Override
public TContractorTrainCourse getITContractorTrainCourse(TContractorTrainCourse tContractorTrainCourse) {
return tContractorTrainCourseMapper.getITContractorTrainCourse(tContractorTrainCourse);
}
}
package com.zehong.system.service.impl;
import java.util.List;
import com.zehong.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zehong.system.mapper.TContractorTrainCourseTopicMapper;
import com.zehong.system.domain.TContractorTrainCourse;
import com.zehong.system.domain.TContractorTrainCourseTopic;
import com.zehong.system.mapper.TContractorTrainCourseMapper;
import com.zehong.system.mapper.TContractorTrainCourseTopicMapper;
import com.zehong.system.service.ITContractorTrainCourseTopicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.List;
/**
* 承包商及访客培训题库Service业务层处理
......@@ -19,6 +24,8 @@ public class TContractorTrainCourseTopicServiceImpl implements ITContractorTrain
{
@Autowired
private TContractorTrainCourseTopicMapper tContractorTrainCourseTopicMapper;
@Resource
private TContractorTrainCourseMapper tContractorTrainCourseMapper;
/**
* 查询承包商及访客培训题库
......@@ -51,8 +58,14 @@ public class TContractorTrainCourseTopicServiceImpl implements ITContractorTrain
* @return 结果
*/
@Override
@Transactional(rollbackFor = Exception.class)
public int insertTContractorTrainCourseTopic(TContractorTrainCourseTopic tContractorTrainCourseTopic)
{
TContractorTrainCourse course = tContractorTrainCourseMapper.selectTContractorTrainCourseById(tContractorTrainCourseTopic.getContractorCourseId());
if(course!=null){
course.setTopicNum(course.getTopicNum()+1);
tContractorTrainCourseMapper.updateTContractorTrainCourse(course);
}
tContractorTrainCourseTopic.setCreateTime(DateUtils.getNowDate());
return tContractorTrainCourseTopicMapper.insertTContractorTrainCourseTopic(tContractorTrainCourseTopic);
}
......@@ -76,8 +89,18 @@ public class TContractorTrainCourseTopicServiceImpl implements ITContractorTrain
* @return 结果
*/
@Override
@Transactional(rollbackFor = Exception.class)
public int deleteTContractorTrainCourseTopicByIds(Long[] topicIds)
{
for(Long topicId : topicIds){
TContractorTrainCourseTopic topic = tContractorTrainCourseTopicMapper.selectTContractorTrainCourseTopicById(topicId);
TContractorTrainCourse course = tContractorTrainCourseMapper.selectTContractorTrainCourseById(topic.getContractorCourseId());
if(course!=null){
course.setTopicNum(course.getTopicNum() - 1);
tContractorTrainCourseMapper.updateTContractorTrainCourse(course);
}
}
return tContractorTrainCourseTopicMapper.deleteTContractorTrainCourseTopicByIds(topicIds);
}
......
package com.zehong.system.service.impl;
import java.util.List;
import com.zehong.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zehong.system.mapper.TContractorTrainResultDetailMapper;
import com.zehong.system.domain.TContractorTrainResultDetail;
import com.zehong.system.service.ITContractorTrainResultDetailService;
/**
* 承包商及访客培训考试结果详情Service业务层处理
*
* @author wu
* @date 2022-12-30
*/
@Service
public class TContractorTrainResultDetailServiceImpl implements ITContractorTrainResultDetailService
{
@Autowired
private TContractorTrainResultDetailMapper tContractorTrainResultDetailMapper;
/**
* 查询承包商及访客培训考试结果详情
*
* @param detailId 承包商及访客培训考试结果详情ID
* @return 承包商及访客培训考试结果详情
*/
@Override
public TContractorTrainResultDetail selectTContractorTrainResultDetailById(Long detailId)
{
return tContractorTrainResultDetailMapper.selectTContractorTrainResultDetailById(detailId);
}
/**
* 查询承包商及访客培训考试结果详情列表
*
* @param tContractorTrainResultDetail 承包商及访客培训考试结果详情
* @return 承包商及访客培训考试结果详情
*/
@Override
public List<TContractorTrainResultDetail> selectTContractorTrainResultDetailList(TContractorTrainResultDetail tContractorTrainResultDetail)
{
return tContractorTrainResultDetailMapper.selectTContractorTrainResultDetailList(tContractorTrainResultDetail);
}
/**
* 新增承包商及访客培训考试结果详情
*
* @param tContractorTrainResultDetail 承包商及访客培训考试结果详情
* @return 结果
*/
@Override
public int insertTContractorTrainResultDetail(TContractorTrainResultDetail tContractorTrainResultDetail)
{
tContractorTrainResultDetail.setCreateTime(DateUtils.getNowDate());
return tContractorTrainResultDetailMapper.insertTContractorTrainResultDetail(tContractorTrainResultDetail);
}
/**
* 修改承包商及访客培训考试结果详情
*
* @param tContractorTrainResultDetail 承包商及访客培训考试结果详情
* @return 结果
*/
@Override
public int updateTContractorTrainResultDetail(TContractorTrainResultDetail tContractorTrainResultDetail)
{
return tContractorTrainResultDetailMapper.updateTContractorTrainResultDetail(tContractorTrainResultDetail);
}
/**
* 批量删除承包商及访客培训考试结果详情
*
* @param detailIds 需要删除的承包商及访客培训考试结果详情ID
* @return 结果
*/
@Override
public int deleteTContractorTrainResultDetailByIds(Long[] detailIds)
{
return tContractorTrainResultDetailMapper.deleteTContractorTrainResultDetailByIds(detailIds);
}
/**
* 删除承包商及访客培训考试结果详情信息
*
* @param detailId 承包商及访客培训考试结果详情ID
* @return 结果
*/
@Override
public int deleteTContractorTrainResultDetailById(Long detailId)
{
return tContractorTrainResultDetailMapper.deleteTContractorTrainResultDetailById(detailId);
}
}
package com.zehong.system.service.impl;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.zehong.common.utils.DateUtils;
import com.zehong.system.domain.*;
import com.zehong.system.mapper.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zehong.system.service.ITContractorTrainResultService;
/**
* 承包商及访客培训考试结果详情Service业务层处理
*
* @author zehong
* @date 2022-12-27
*/
@Service
public class TContractorTrainResultServiceImpl implements ITContractorTrainResultService
{
@Autowired
private TContractorTrainResultMapper tContractorTrainResultMapper;
@Autowired
private TBankSubjectMapper tBankSubjectMapper;
@Autowired
private TContractorTrainCourseTopicMapper tContractorTrainCourseTopicMapper;
@Autowired
private TContractorTrainCourseMapper tContractorTrainCourseMapper;
@Autowired
private TContractorTrainResultDetailMapper tContractorTrainResultDetailMapper;
/**
* 查询承包商及访客培训考试结果详情
*
* @param resultId 承包商及访客培训考试结果详情ID
* @return 承包商及访客培训考试结果详情
*/
@Override
public TContractorTrainResult selectTContractorTrainResultById(Long resultId)
{
return tContractorTrainResultMapper.selectTContractorTrainResultById(resultId);
}
/**
* 查询承包商及访客培训考试结果详情列表
*
* @param tContractorTrainResult 承包商及访客培训考试结果详情
* @return 承包商及访客培训考试结果详情
*/
@Override
public List<TContractorTrainResult> selectTContractorTrainResultList(TContractorTrainResult tContractorTrainResult)
{
return tContractorTrainResultMapper.selectTContractorTrainResultList(tContractorTrainResult);
}
/**
* 新增承包商及访客培训考试结果详情
*
* @param tContractorTrainResult 承包商及访客培训考试结果详情
* @return 结果
*/
@Override
public int insertTContractorTrainResult(TContractorTrainResult tContractorTrainResult)
{
tContractorTrainResult.setCreateTime(DateUtils.getNowDate());
return tContractorTrainResultMapper.insertTContractorTrainResult(tContractorTrainResult);
}
/**
* 修改承包商及访客培训考试结果详情
*
* @param tContractorTrainResult 承包商及访客培训考试结果详情
* @return 结果
*/
@Override
public int updateTContractorTrainResult(TContractorTrainResult tContractorTrainResult)
{
return tContractorTrainResultMapper.updateTContractorTrainResult(tContractorTrainResult);
}
/**
* 批量删除承包商及访客培训考试结果详情
*
* @param resultIds 需要删除的承包商及访客培训考试结果详情ID
* @return 结果
*/
@Override
public int deleteTContractorTrainResultByIds(Long[] resultIds)
{
return tContractorTrainResultMapper.deleteTContractorTrainResultByIds(resultIds);
}
/**
* 删除承包商及访客培训考试结果详情信息
*
* @param resultId 承包商及访客培训考试结果详情ID
* @return 结果
*/
@Override
public int deleteTContractorTrainResultById(Long resultId)
{
return tContractorTrainResultMapper.deleteTContractorTrainResultById(resultId);
}
/**
* 用户课程考试交卷
* @param tContractorTrainResult
*/
@Override
public Map<String,Object> examination(TContractorTrainResult tContractorTrainResult) {
TContractorTrainCourseTopic tContractorTrainCourseTopic=new TContractorTrainCourseTopic();
String answers = tContractorTrainResult.getAnswers();
//交卷答题
String[] split = answers.split(",");
//查询考试题和答案
List<TContractorTrainCourseTopic> tContractorTrainCourseTopics = tContractorTrainCourseTopicMapper.selectTContractorTrainCourseTopicList(tContractorTrainCourseTopic);
//正确答案数量
int num = 0;
for(Integer i=0;i<split.length;i++){
if(Integer.parseInt(split[i])==tContractorTrainCourseTopics.get(i).getAnswer()){
num++;
}
}
TContractorTrainCourse tContractorTrainCourse=new TContractorTrainCourse();
//查询需要正确几道题算通过
TContractorTrainCourse itContractorTrainCourse = tContractorTrainCourseMapper.getITContractorTrainCourse(tContractorTrainCourse);
//判断答题是否合格
if(num>=itContractorTrainCourse.getQualifiedNum()){
tContractorTrainResult.setIsQualified("0");
}else {
tContractorTrainResult.setIsQualified("1");
}
//答对数量
tContractorTrainResult.setScore(String.valueOf(num));
tContractorTrainResult.setCreateTime(new Date());
//承包商及访客培训考试结果 添加方法
tContractorTrainResultMapper.insertTContractorTrainResult(tContractorTrainResult);
/**添加承包商及访客培训考试结果详情*/
for (int n=0;n<split.length;n++){
TContractorTrainResultDetail tContractorTrainResultDetail=new TContractorTrainResultDetail();
//设置结果管理id
tContractorTrainResultDetail.setResult(String.valueOf(tContractorTrainResult.getResultId()));
//设置题目内容
tContractorTrainResultDetail.setTopicTitle(tContractorTrainCourseTopics.get(n).getTopicTitle());
//设置题目选项
tContractorTrainResultDetail.setTopicOption(tContractorTrainCourseTopics.get(n).getTopicOption());
//答案
tContractorTrainResultDetail.setAnswer(tContractorTrainCourseTopics.get(n).getAnswer());
//所选答案
tContractorTrainResultDetail.setAnswerChoice(Integer.valueOf(split[n]));
//答案结果
if (Integer.valueOf(split[n])==tContractorTrainCourseTopics.get(n).getAnswer()){
tContractorTrainResultDetail.setResult("0");
}else {
tContractorTrainResultDetail.setResult("1");
}
tContractorTrainResultDetail.setCreateTime(new Date());
tContractorTrainResultDetail.setResultId(tContractorTrainResult.getResultId());
tContractorTrainResultDetailMapper.insertTContractorTrainResultDetail(tContractorTrainResultDetail);
}
Map<String,Object> map = new HashMap<>();
map.put("answer",num);
map.put("qualifiedNum",itContractorTrainCourse.getQualifiedNum());
map.put("topicNum",tContractorTrainCourseTopics.size());
return map;
}
}
......@@ -3,7 +3,7 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zehong.system.mapper.TContractorTrainCourseMapper">
<resultMap type="TContractorTrainCourse" id="TContractorTrainCourseResult">
<result property="contractorCourseId" column="contractor_course_id" />
<result property="courseName" column="course_name" />
......@@ -24,7 +24,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectTContractorTrainCourseList" parameterType="TContractorTrainCourse" resultMap="TContractorTrainCourseResult">
<include refid="selectTContractorTrainCourseVo"/>
<where>
<where>
<if test="courseName != null and courseName != ''"> and course_name like concat('%', #{courseName}, '%')</if>
<if test="courseConent != null and courseConent != ''"> and course_conent = #{courseConent}</if>
<if test="enclosure != null and enclosure != ''"> and enclosure = #{enclosure}</if>
......@@ -35,12 +35,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="isDel != null and isDel != ''"> and is_del = #{isDel}</if>
</where>
</select>
<select id="selectTContractorTrainCourseById" parameterType="Long" resultMap="TContractorTrainCourseResult">
<include refid="selectTContractorTrainCourseVo"/>
where contractor_course_id = #{contractorCourseId}
</select>
<insert id="insertTContractorTrainCourse" parameterType="TContractorTrainCourse" useGeneratedKeys="true" keyProperty="contractorCourseId">
insert into t_contractor_train_course
<trim prefix="(" suffix=")" suffixOverrides=",">
......@@ -91,9 +91,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<delete id="deleteTContractorTrainCourseByIds" parameterType="String">
delete from t_contractor_train_course where contractor_course_id in
delete from t_contractor_train_course where contractor_course_id in
<foreach item="contractorCourseId" collection="array" open="(" separator="," close=")">
#{contractorCourseId}
</foreach>
</delete>
</mapper>
\ No newline at end of file
<!--查询承包商及访客培训-->
<select id="getITContractorTrainCourse" resultMap="TContractorTrainCourseResult">
<include refid="selectTContractorTrainCourseVo"/>
limit 0,1
</select>
</mapper>
<?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.zehong.system.mapper.TContractorTrainResultDetailMapper">
<resultMap type="TContractorTrainResultDetail" id="TContractorTrainResultDetailResult">
<result property="detailId" column="detail_id" />
<result property="resultId" column="result_id" />
<result property="topicTitle" column="topic_title" />
<result property="topicOption" column="topic_option" />
<result property="answer" column="answer" />
<result property="answerChoice" column="answer_choice" />
<result property="result" column="result" />
<result property="createTime" column="create_time" />
<result property="isDel" column="is_del" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectTContractorTrainResultDetailVo">
select detail_id, result_id, topic_title, topic_option, answer, answer_choice, result, create_time, is_del, remark from t_contractor_train_result_detail
</sql>
<select id="selectTContractorTrainResultDetailList" parameterType="TContractorTrainResultDetail" resultMap="TContractorTrainResultDetailResult">
<include refid="selectTContractorTrainResultDetailVo"/>
<where>
<if test="resultId != null "> and result_id = #{resultId}</if>
<if test="topicTitle != null and topicTitle != ''"> and topic_title = #{topicTitle}</if>
<if test="topicOption != null and topicOption != ''"> and topic_option = #{topicOption}</if>
<if test="answer != null "> and answer = #{answer}</if>
<if test="answerChoice != null "> and answer_choice = #{answerChoice}</if>
<if test="result != null and result != ''"> and result = #{result}</if>
<if test="isDel != null and isDel != ''"> and is_del = #{isDel}</if>
</where>
</select>
<select id="selectTContractorTrainResultDetailById" parameterType="Long" resultMap="TContractorTrainResultDetailResult">
<include refid="selectTContractorTrainResultDetailVo"/>
where detail_id = #{detailId}
</select>
<insert id="insertTContractorTrainResultDetail" parameterType="TContractorTrainResultDetail" useGeneratedKeys="true" keyProperty="detailId">
insert into t_contractor_train_result_detail
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="resultId != null">result_id,</if>
<if test="topicTitle != null">topic_title,</if>
<if test="topicOption != null">topic_option,</if>
<if test="answer != null">answer,</if>
<if test="answerChoice != null">answer_choice,</if>
<if test="result != null">result,</if>
<if test="createTime != null">create_time,</if>
<if test="isDel != null">is_del,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="resultId != null">#{resultId},</if>
<if test="topicTitle != null">#{topicTitle},</if>
<if test="topicOption != null">#{topicOption},</if>
<if test="answer != null">#{answer},</if>
<if test="answerChoice != null">#{answerChoice},</if>
<if test="result != null">#{result},</if>
<if test="createTime != null">#{createTime},</if>
<if test="isDel != null">#{isDel},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateTContractorTrainResultDetail" parameterType="TContractorTrainResultDetail">
update t_contractor_train_result_detail
<trim prefix="SET" suffixOverrides=",">
<if test="resultId != null">result_id = #{resultId},</if>
<if test="topicTitle != null">topic_title = #{topicTitle},</if>
<if test="topicOption != null">topic_option = #{topicOption},</if>
<if test="answer != null">answer = #{answer},</if>
<if test="answerChoice != null">answer_choice = #{answerChoice},</if>
<if test="result != null">result = #{result},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="isDel != null">is_del = #{isDel},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where detail_id = #{detailId}
</update>
<delete id="deleteTContractorTrainResultDetailById" parameterType="Long">
delete from t_contractor_train_result_detail where detail_id = #{detailId}
</delete>
<delete id="deleteTContractorTrainResultDetailByIds" parameterType="String">
delete from t_contractor_train_result_detail where detail_id in
<foreach item="detailId" collection="array" open="(" separator="," close=")">
#{detailId}
</foreach>
</delete>
</mapper>
\ No newline at end of file
<?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.zehong.system.mapper.TContractorTrainResultMapper">
<resultMap type="TContractorTrainResult" id="TContractorTrainResultResult">
<result property="resultId" column="result_id" />
<result property="beyondUnit" column="beyond_unit" />
<result property="name" column="name" />
<result property="sex" column="sex" />
<result property="phoneNum" column="phone_num" />
<result property="testBeginTime" column="test_begin_time" />
<result property="testEndTime" column="test_end_time" />
<result property="score" column="score" />
<result property="isQualified" column="is_qualified" />
<result property="createTime" column="create_time" />
<result property="isDel" column="is_del" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectTContractorTrainResultVo">
select result_id, beyond_unit, name, sex, phone_num, test_begin_time, test_end_time, score, is_qualified, create_time, is_del, remark from t_contractor_train_result
</sql>
<select id="selectTContractorTrainResultList" parameterType="TContractorTrainResult" resultMap="TContractorTrainResultResult">
<include refid="selectTContractorTrainResultVo"/>
<where>
<if test="beyondUnit != null and beyondUnit != ''"> and beyond_unit = #{beyondUnit}</if>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="sex != null and sex != ''"> and sex = #{sex}</if>
<if test="phoneNum != null and phoneNum != ''"> and phone_num = #{phoneNum}</if>
<if test="testBeginTime != null and testEndTime != null"> and test_begin_time BETWEEN #{testBeginTime} AND #{testEndTime}</if>
<if test="score != null and score != ''"> and score = #{score}</if>
<if test="isQualified != null and isQualified != ''"> and is_qualified = #{isQualified}</if>
</where>
</select>
<select id="selectTContractorTrainResultById" parameterType="Long" resultMap="TContractorTrainResultResult">
<include refid="selectTContractorTrainResultVo"/>
where result_id = #{resultId}
</select>
<insert id="insertTContractorTrainResult" parameterType="TContractorTrainResult" useGeneratedKeys="true" keyProperty="resultId">
insert into t_contractor_train_result
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="beyondUnit != null">beyond_unit,</if>
<if test="name != null">name,</if>
<if test="sex != null">sex,</if>
<if test="phoneNum != null">phone_num,</if>
<if test="testBeginTime != null">test_begin_time,</if>
<if test="testEndTime != null">test_end_time,</if>
<if test="score != null">score,</if>
<if test="isQualified != null">is_qualified,</if>
<if test="createTime != null">create_time,</if>
<if test="isDel != null">is_del,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="beyondUnit != null">#{beyondUnit},</if>
<if test="name != null">#{name},</if>
<if test="sex != null">#{sex},</if>
<if test="phoneNum != null">#{phoneNum},</if>
<if test="testBeginTime != null">#{testBeginTime},</if>
<if test="testEndTime != null">#{testEndTime},</if>
<if test="score != null">#{score},</if>
<if test="isQualified != null">#{isQualified},</if>
<if test="createTime != null">#{createTime},</if>
<if test="isDel != null">#{isDel},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateTContractorTrainResult" parameterType="TContractorTrainResult">
update t_contractor_train_result
<trim prefix="SET" suffixOverrides=",">
<if test="beyondUnit != null">beyond_unit = #{beyondUnit},</if>
<if test="name != null">name = #{name},</if>
<if test="sex != null">sex = #{sex},</if>
<if test="phoneNum != null">phone_num = #{phoneNum},</if>
<if test="testBeginTime != null">test_begin_time = #{testBeginTime},</if>
<if test="testEndTime != null">test_end_time = #{testEndTime},</if>
<if test="score != null">score = #{score},</if>
<if test="isQualified != null">is_qualified = #{isQualified},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="isDel != null">is_del = #{isDel},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where result_id = #{resultId}
</update>
<delete id="deleteTContractorTrainResultById" parameterType="Long">
delete from t_contractor_train_result where result_id = #{resultId}
</delete>
<delete id="deleteTContractorTrainResultByIds" parameterType="String">
delete from t_contractor_train_result where result_id in
<foreach item="resultId" collection="array" open="(" separator="," close=")">
#{resultId}
</foreach>
</delete>
</mapper>
\ No newline at end of file
......@@ -3,7 +3,7 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zehong.system.mapper.TStaningBookMapper">
<resultMap type="TStaningBook" id="TStaningBookResult">
<result property="bookId" column="book_id" />
<result property="troubleName" column="trouble_name" />
......@@ -46,12 +46,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql>
<select id="selectTStaningBookList" parameterType="TStaningBook" resultMap="TStaningBookResult">
SELECT b.*,s1.`staff_name` AS escalationName,
SELECT b.*,s5.nick_name AS escalationName,
s2.`staff_name` AS rectificationName,
s3.`staff_name` AS personLiableName ,
d.`dept_name` AS deptName
FROM t_staning_book b
LEFT JOIN t_staff s1 ON b.`escalation` = s1.`staff_id`
LEFT JOIN sys_user s5 ON b.escalation=s5.user_id
LEFT JOIN t_staff s2 ON b.`rectification` = s2.`staff_id`
LEFT JOIN t_staff s3 ON b.`person_liable` = s3.`staff_id`
LEFT JOIN sys_dept d ON d.`dept_id` = b.`dept_id`
......@@ -66,12 +67,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="state != null "> and b.state = #{state}</if>
</where>
</select>
<select id="selectTStaningBookById" parameterType="Long" resultMap="TStaningBookResult">
<include refid="selectTStaningBookVo"/>
where book_id = #{bookId}
</select>
<insert id="insertTStaningBook" parameterType="TStaningBook" useGeneratedKeys="true" keyProperty="bookId">
insert into t_staning_book
<trim prefix="(" suffix=")" suffixOverrides=",">
......@@ -179,7 +180,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<delete id="deleteTStaningBookByIds" parameterType="String">
delete from t_staning_book where book_id in
delete from t_staning_book where book_id in
<foreach item="bookId" collection="array" open="(" separator="," close=")">
#{bookId}
</foreach>
......@@ -196,4 +197,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and DATE_SUB(now(), INTERVAL 365 DAY) &lt; date(find_time)
</if>
</select>
</mapper>
\ No newline at end of file
</mapper>
......@@ -26,6 +26,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<where>
<if test="bankName != null and bankName != ''"> and a.bank_name like concat('%', #{bankName}, '%')</if>
</where>
<where>
<if test="deptId != null and deptId != ''"> and a.dept_id = #{deptId} </if>
</where>
group by bank_id desc
</select>
......
import request from '@/utils/request'
// 查询承包商及访客培训考试结果详情列表
export function listResult(query) {
return request({
url: '/system/result/list',
method: 'get',
params: query
})
}
// 查询承包商及访客培训考试结果详情详细
export function getResult(resultId) {
return request({
url: '/system/result/' + resultId,
method: 'get'
})
}
// 新增承包商及访客培训考试结果详情
export function addResult(data) {
return request({
url: '/system/result',
method: 'post',
data: data
})
}
// 修改承包商及访客培训考试结果详情
export function updateResult(data) {
return request({
url: '/system/result',
method: 'put',
data: data
})
}
// 删除承包商及访客培训考试结果详情
export function delResult(resultId) {
return request({
url: '/system/result/' + resultId,
method: 'delete'
})
}
// 导出承包商及访客培训考试结果详情
export function exportResult(query) {
return request({
url: '/system/result/export',
method: 'get',
params: query
})
}
\ No newline at end of file
......@@ -8,6 +8,14 @@ export function listTopic(query) {
params: query
})
}
// 新增承包商及访客培训考试结果
export function setEsult(query) {
return request({
url: '/system/result/examination',
method: 'get',
params: query
})
}
// 查询承包商及访客培训题库详细
export function getTopic(topicId) {
......
import request from '@/utils/request'
// 查询承包商及访客培训信息
export function ITContractorTrainCourse(query) {
return request({
url: '/contractTrain/getITContractorTrainCourse',
method: 'get',
params: query
})
}
......@@ -7,7 +7,7 @@ import { getToken } from "@/utils/auth";
NProgress.configure({ showSpinner: false });
const whiteList = ["/login", "/auth-redirect", "/bind", "/register"];
const whiteList = ["/login", "/auth-redirect", "/bind", "/register","/enterInformation","/trainingMaterials",];
router.beforeEach((to, from, next) => {
NProgress.start();
......
......@@ -48,6 +48,16 @@ export const constantRoutes = [
component: (resolve) => require(['@/views/error/404'], resolve),
hidden: true
},
{
path: '/enterInformation',
component: (resolve) => require(['@/views/visitorExam/EnterInformation'], resolve),
hidden: true
},
{
path: '/trainingMaterials',
component: (resolve) => require(['@/views/visitorExam/Trainingmaterials/index'], resolve),
hidden: true
},
// {
// path: '/bigWindow',
// component: (resolve) => require(['@/views/bigWindow'], resolve),
......
......@@ -55,7 +55,8 @@ service.interceptors.response.use(res => {
const msg = errorCode[code] || res.data.msg || errorCode['default']
if (code === 401) {
MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', {
confirmButtonText: '重新登录',
// 重新登录
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}
......
......@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-22 10:38:49
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-12-26 09:54:47
* @LastEditTime: 2023-01-04 17:50:46
* @FilePath: /danger-manage-web/src/views/lessonsProgram/components/addLesson.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
......
......@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-22 10:59:44
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-09-28 17:52:32
* @LastEditTime: 2023-01-04 17:47:53
* @FilePath: /danger-manage-web/src/views/lessonsProgram/components/Lession.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
......@@ -107,6 +107,7 @@
@resFun="getFileInfoFile"
@remove="listRemoveFile"
:fileArr="fileListFile"
:fileType="fileType"
/>
<el-input v-show="false" disabled v-model="form.enclosure"></el-input>
</el-form-item>
......@@ -146,6 +147,7 @@ export default {
video: "",
enclosure: "",
},
fileType: ["doc", "docx", "xls", "xlsx", "ppt", "txt", "pdf"],
fileListVideo: [],
fileListFile: [],
readOnly: false,
......
......@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-20 20:14:18
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-09-28 16:59:32
* @LastEditTime: 2023-01-05 09:38:13
* @FilePath: /danger-manage-web/src/views/myLessons/CheckLesson.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
......@@ -39,10 +39,10 @@
</div>
</div>
<div class="bt flex fz14 video">
<div class="bt flex fz14 video" >
<div class="a">视频文件</div>
<div class="b">
<div class="video">
<div class="video" v-if="lessonData.video">
<video-player
class="video-player vjs-custom-skin"
ref="videoPlayer"
......@@ -50,6 +50,7 @@
:options="playerOptions"
></video-player>
</div>
<div v-else>未上传视频</div>
</div>
</div>
......@@ -61,6 +62,9 @@
<el-button style="padding: 0; margin-left: 20px" type="text">
<a :href="lessonData.enclosure">下载</a>
</el-button>
<el-button style="padding: 0; margin-left: 20px" type="text">
<a @click="openXslx(lessonData.enclosure)">预览</a>
</el-button>
</div>
</div>
</div>
......@@ -100,6 +104,9 @@
:visible.sync="answerOpen"
@jj="jj"
/>
<el-dialog :visible.sync="iframeVisible" width="80%">
<iframe style="width: 100%; height: 600px" :src="ky"></iframe>
</el-dialog>
</div>
</template>
......@@ -121,6 +128,7 @@ export default {
playerOptions: {
aspectRatio: "16:9",
},
dingshi:null,
// 课程类型
courseOptions: [],
......@@ -134,6 +142,8 @@ export default {
fenshu: 0,
answerOpen: false,
lessonTypeName: "",
iframeVisible: false,
ky: "https://view.xdocin.com/222-223-203-154-8082_o52uv3.htm",
};
},
created() {
......
......@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-20 14:29:26
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-09-28 18:00:44
* @LastEditTime: 2023-01-03 15:10:43
* @FilePath: /danger-manage-web/src/views/myLessons/components/LearnItem.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
......@@ -12,7 +12,7 @@
<div class="allone">
<img v-if="itemData.dataKind==0" style="height: 18px" src="@/assets/img/ykao.png"/>
<img v-if="itemData.dataKind==1" style="height: 18px" src="@/assets/img/skao.png"/>
<div class="lesson" style="width: 75%"> {{ itemData.courseName }}</div>
<div class="lesson zzz" style="width: 75%" :title="itemData.courseName"> {{ itemData.courseName }}</div>
</div>
<div class="time">发布时间:{{ itemData.createTime }}</div>
<div class="bottom flex">
......
......@@ -5,6 +5,7 @@
ref="queryForm"
:inline="true"
label-width="68px"
>
<!-- <el-form-item label="课件类别" prop="courseType">
<el-select
......@@ -23,7 +24,7 @@
</el-form-item> -->
<el-form-item
label="所属单位"
label="归属部门"
prop="deptId"
ref="treeItem"
>
......@@ -36,10 +37,10 @@
style="width:200px"
/>
</el-form-item>
<el-form-item label="名称" prop="courseName">
<el-form-item label="题库名称" prop="courseName">
<el-input
v-model="queryParams.courseName"
placeholder="考试时间"
v-model="queryParams.bankName"
placeholder="题库名称"
clearable
size="small"
/>
......@@ -89,7 +90,7 @@
<el-table-column label="题库名称" align="center" prop="bankName">
</el-table-column>
<el-table-column
label="所属单位"
label="归属部门"
align="center"
prop="courseType"
>
......
......@@ -181,7 +181,8 @@
dataKind: "",
releaseTimeBegin: "",
releaseTimeEnd: ""
}
};
this.getTestList();
},
courseDetail(courseId){
this.testStatDetailOpen = true;
......
......@@ -259,13 +259,13 @@ export default {
},
/** 新增按钮操作 */
handleAdd() {
this.$refs.Dia.title = "新增培训课程";
this.$refs.Dia.title = "新增考试试卷";
this.componentsNum = 1;
this.courseId = null;
this.dilogFlag = true;
},
changeLesson(courseId) {
this.$refs.Dia.title = "修改培训课程";
this.$refs.Dia.title = "修改考试试卷";
this.componentsNum = 1;
this.courseId = courseId;
this.dilogFlag = true;
......
......@@ -27,15 +27,16 @@
<div>
<div class="top">参与培训人员({{personnelOptions.length}})</div>
<div class="bottom">
<el-checkbox-group class="" v-model="infoData.postIds">
<!-- <el-checkbox-group class="" v-model="infoData.postIds"> -->
<el-checkbox
:disabled="!isActive"
v-model="personnel.ischeck"
v-for="personnel in personnelOptions"
:label="personnel.postId"
:key="personnel.postId"
>{{ personnel.postName }}</el-checkbox
>
</el-checkbox-group>
<!-- </el-checkbox-group> -->
</div>
</div>
</div>
......
<template>
<div class="form-wrapper">
<div style="width: 100%;height:100%;">
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
<el-form-item label="培训名称" prop="name">
<el-input v-model="ruleForm.name"></el-input>
<el-form :model="contractTrainForm" :rules="rules" ref="contractTrainForm" label-width="100px" class="demo-ruleForm">
<el-form-item label="培训名称" prop="courseName">
<el-input v-model="contractTrainForm.courseName"></el-input>
</el-form-item>
<el-form-item label="培训内容" prop="region">
<el-input type="textarea" v-model="ruleForm.region" rows="5"></el-input>
<el-form-item label="培训内容" prop="courseConent">
<el-input type="textarea" v-model="contractTrainForm.courseConent" rows="5"></el-input>
</el-form-item>
<div class="flex">
<el-form-item label="视频上传" v-if="!readOnly" prop="video">
<FileUpload
listType="picture"
@resFun="getFileInfoVideo"
@remove="listRemoveVideo"
:fileArr="fileListVideo"
:fileSize="500"
:fileType="['mp4']"
/>
<el-input v-show="false" disabled v-model="contractTrainForm.video"></el-input>
</el-form-item>
<el-form-item label="附件上传" v-if="!readOnly" prop="enclosure">
<FileUpload
listType="picture"
@resFun="getFileInfoFile"
@remove="listRemoveFile"
:fileArr="fileListFile"
/>
<el-input v-show="false" disabled v-model="contractTrainForm.enclosure"></el-input>
</el-form-item>
</div>
</el-form>
</div>
<el-form>
<div class="flex">
<el-form-item label="视频上传" v-if="!readOnly" prop="video">
<FileUpload
listType="picture"
@resFun="getFileInfoVideo"
@remove="listRemoveVideo"
:fileArr="fileListVideo"
:fileSize="500"
:fileType="['mp4']"
/>
<el-input v-show="false" disabled v-model="form.video"></el-input>
</el-form-item>
<el-form-item label="附件上传" v-if="!readOnly" prop="enclosure">
<FileUpload
listType="picture"
@resFun="getFileInfoFile"
@remove="listRemoveFile"
:fileArr="fileListFile"
/>
<el-input v-show="false" disabled v-model="form.enclosure"></el-input>
</el-form-item>
</div>
</el-form>
<visitorQuestion></visitorQuestion>
<visitorQuestion ref="visitorQuestion"></visitorQuestion>
</div>
</template>
<script>
import FileUpload from "@/components/FileUpload";
import uploadfile from "@/assets/uploadfile.png";
import visitorQuestion from "@/views/educationPlanExam/visitorProgram/visitorQuestion";
// import visitorDia from "@/views/educationPlanExam/visitorProgram/visitorDia";
export default {
data() {
return {
ruleForm: {
name: '',
region: '',
},
form: {
video: "",
enclosure: "",
},
fileListVideo: [],
fileListFile: [],
readOnly: false,
rules: {
name: [
{ required: true, message: '请输入培训名称', trigger: 'blur' }
],
region: [
{ required: true, message: '请输入培训内容', trigger: 'change' }
],
video: [
{ required: true, trigger: "blue", message: "视频不能为空" }
],
enclosure: [
{ required: true, trigger: "blur", message: "附件不能为空" },
],
import FileUpload from "@/components/FileUpload";
import uploadfile from "@/assets/uploadfile.png";
import visitorQuestion from "@/views/educationPlanExam/visitorProgram/visitorQuestion";
import {listCourse} from "@/api/contractTrain/contractTrain";
export default {
data() {
return {
contractTrainForm: {
courseName: '',
courseConent: '',
video: "",
enclosure: "",
},
fileListVideo: [],
fileListFile: [],
readOnly: false,
rules: {
name: [
{ required: true, message: '请输入培训名称', trigger: 'blur' }
],
region: [
{ required: true, message: '请输入培训内容', trigger: 'change' }
],
video: [
{ required: true, trigger: "blue", message: "视频不能为空" }
],
enclosure: [
{ required: true, trigger: "blur", message: "附件不能为空" },
],
},
};
},
components: {
FileUpload,
visitorQuestion,
},
created() {
this.getContractTrainList();
},
methods: {
getContractTrainList(){
listCourse().then(res =>{
this.contractTrainForm = res.rows[0];
if(this.contractTrainForm.video){
this.fileListVideo = [
{
name: this.contractTrainForm.courseName + "视频",
url: uploadfile,
},
];
}
if(this.contractTrainForm.enclosure){
this.fileListFile = [
{
name: this.contractTrainForm.courseName + "附件",
url: uploadfile,
},
];
}
this.$refs.visitorQuestion.rightNum = this.contractTrainForm.qualifiedNum;
this.$refs.visitorQuestion.getContractTopicList(this.contractTrainForm.contractorCourseId)
})
},
submitForm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
alert('submit!');
} else {
console.log('error submit!!');
return false;
}
};
});
},
components: {
FileUpload,
visitorQuestion,
getFileInfoVideo(res) {
this.contractTrainForm.video = res.url;
this.fileListVideo = [
{
name: res.fileName,
url: uploadfile,
},
];
},
created() {
if (this.courseId) {
this.getLessonById();
}
listRemoveVideo(e) {
this.fileListVideo = [];
this.contractTrainForm.video = "";
// this.form.videoName = null;
},
getFileInfoFile(res) {
this.contractTrainForm.enclosure = res.url;
this.fileListFile = [
{
name: res.fileName,
url: uploadfile,
},
];
},
listRemoveFile(e) {
this.fileListFild = [];
this.contractTrainForm.enclosure = "";
// this.form.fileName = null;
},
methods: {
submitForm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
alert('submit!');
} else {
console.log('error submit!!');
return false;
}
});
},
getFileInfoVideo(res) {
this.form.video = res.url;
// this.form.videoName = res.fileName;
this.fileListVideo = [
{
name: res.fileName,
url: uploadfile,
},
];
},
listRemoveVideo(e) {
this.fileListVideo = [];
this.form.video = "";
// this.form.videoName = null;
},
getFileInfoFile(res) {
this.form.enclosure = res.url;
// this.form.enclosureName = res.fileName;
this.fileListFile = [
{
name: res.fileName,
url: uploadfile,
},
];
},
listRemoveFile(e) {
this.fileListFild = [];
this.form.enclosure = "";
// this.form.fileName = null;
},
}
}
</script>
}
</script>
<style lang="scss" scoped>
.form-wrapper {
padding-top: 30px;
......@@ -139,4 +153,4 @@ import visitorQuestion from "@/views/educationPlanExam/visitorProgram/visitorQue
justify-content: space-around;
padding: 20px 30px;
}
</style>
\ No newline at end of file
</style>
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="姓名" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入姓名"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="所属单位" prop="beyondUnit">
<el-input
v-model="queryParams.beyondUnit"
placeholder="请输入所属单位"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="考试时间" prop="releaseTimeBegin">
<el-date-picker
v-model="testTime"
value-format="yyyy-MM-dd HH:mm:ss"
type="datetimerange"
range-separator="至"
start-placeholder="开始时间"
end-placeholder="结束时间"
@change="dateFormat">
</el-date-picker>
</el-form-item>
<el-form-item label="是否合格" prop="isQualified">
<el-select v-model="queryParams.isQualified" placeholder="请选择" clearable size="small">
<el-option label="合格" value="0" />
<el-option label="不合格" value="1" />
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="resultList">
<el-table-column label="姓名" align="center" prop="name" />
<el-table-column label="所属单位" align="center" prop="beyondUnit" />
<el-table-column label="性别" align="center" prop="sex">
<template slot-scope="scope">
<span v-if="scope.row.sex == '0'"></span>
<span v-if="scope.row.sex == '1'"></span>
</template>
</el-table-column>
<el-table-column label="手机号" align="center" prop="phoneNum" />
<el-table-column label="考试开始时间" align="center" prop="testBeginTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.testBeginTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="考试结束时间" align="center" prop="testEndTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.testEndTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="正确率" align="center" prop="score">
<template slot-scope="scope">
<span>{{Math.round(scope.row.score/topicNum* 100)}}%</span>
</template>
</el-table-column>
<el-table-column label="是否合格" align="center" prop="isQualified">
<template slot-scope="scope">
<span v-if="scope.row.isQualified == '0'">合格</span>
<span v-if="scope.row.isQualified == '1'">不合格</span>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<script>
import { listResult, getResult, delResult, addResult, updateResult, exportResult } from "@/api/contractTrain/contractTrainResult";
import {listCourse} from "@/api/contractTrain/contractTrain";
export default {
name: "Result",
components: {
},
data() {
return {
// 遮罩层
loading: true,
// 导出遮罩层
exportLoading: false,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 承包商及访客培训考试结果详情表格数据
resultList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
beyondUnit: null,
name: null,
sex: null,
phoneNum: null,
testBeginTime: null,
testEndTime: null,
score: null,
isQualified: null,
},
testTime: "",
//题目数量
topicNum: 0
};
},
created() {
this.getList();
this.getQualifiedNum();
},
methods: {
/** 查询承包商及访客培训考试结果详情列表 */
getList() {
this.loading = true;
console.log("this.queryParams---",this.queryParams)
listResult(this.queryParams).then(response => {
this.resultList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
resultId: null,
beyondUnit: null,
name: null,
sex: null,
phoneNum: null,
testBeginTime: null,
testEndTime: null,
score: null,
isQualified: null,
createTime: null,
isDel: null,
remark: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.testTime = "";
this.queryParams.testBeginTime = "";
this.queryParams.testEndTime = "";
this.handleQuery();
},
dateFormat(picker){
this.queryParams.testBeginTime = picker[0];
this.queryParams.testEndTime = picker[1];
},
getQualifiedNum(){
listCourse().then(res =>{
if(res.code == 200){
this.topicNum = res.rows[0].topicNum;
}
})
}
}
};
</script>
......@@ -143,9 +143,10 @@
/>
<!-- 添加或修改应急演练对话框 -->
<el-dialog :title="title" :visible.sync="open" width="1800px" append-to-body>
<el-dialog :title="title" :visible.sync="open" width="1100px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="90px">
<div class="division">
<div class="division" style="margin-bottom:20px" >
<div class="div-kuang" style="width: 50%;">
<el-form-item label="演练名称" prop="drillName">
<el-input v-model="form.drillName" placeholder="请输入演练名称" />
......@@ -199,21 +200,20 @@
</el-form-item>
</div>
</div>
<div class="div-kuang" style="width: 95%;margin-left: 2%">
<el-form-item label="选择人员" prop="releaseTime">
<!-- table -->
<!-- jsonSelectNameList就是呗选中的人员的json -->
<!-- getPeopleList 是每次选中或者删除人员都会返回 一个所有人员列表的json串,[{staffId:staffId,staffName:staffName},{staffId:staffId,staffName:staffName}] -->
<!-- 要在jsonSelectNameList赋值完毕之后 调用一下 this.$refs.changePaple.changeNameList 135行 -->
<ChangePapel
ref="changePaple"
:jsonSelectNameList="jsonSelectNameList"
@getPeopleList="getPeopleList"
/>
</el-form-item>
</div>
<div class="div-kuang" style="width: 100%;">
<el-form-item label="选择人员" prop="releaseTime">
<!-- table -->
<!-- jsonSelectNameList就是呗选中的人员的json -->
<!-- getPeopleList 是每次选中或者删除人员都会返回 一个所有人员列表的json串,[{staffId:staffId,staffName:staffName},{staffId:staffId,staffName:staffName}] -->
<!-- 要在jsonSelectNameList赋值完毕之后 调用一下 this.$refs.changePaple.changeNameList 135行 -->
<ChangePapel
ref="changePaple"
:jsonSelectNameList="jsonSelectNameList"
@getPeopleList="getPeopleList"
/>
</el-form-item>
</div>
......@@ -258,7 +258,7 @@
</div>
<div class="div-kuang" style="width: 58%;margin-left: 2%">
<el-form-item label="参演人员:" prop="drillPeople">
<span>{{form.drillPeople}}</span>
<span style="margin-right:5px" v-for='item in form.jsonPeople' :key="item.peoPleId">{{item.peoPleName}}</span>
</el-form-item>
<el-form-item label="演练内容:">
<editor v-model="form.drillContent" :min-height="240" :readOnly="readOnly"/>
......@@ -396,10 +396,6 @@ export default {
});
},
mounted() {
// this.jsonSelectNameList
// '[{"staffId":880,"staffName":"孙卓亚"},{"staffId":871,"staffName":"张玉宾"},{"staffId":869,"staffName":"李二朝"},{"staffId":870,"staffName":"盖永峰"},{"staffId":868,"staffName":"刘丽艳"},{"staffId":867,"staffName":"霍文俊"},{"staffId":866,"staffName":"刘志坚"},{"staffId":865,"staffName":"郝文权"},{"staffId":864,"staffName":"齐雪军"},{"staffId":852,"staffName":"刘江平"},{"staffId":853,"staffName":"谷建海"},{"staffId":851,"staffName":"丁振国"},{"staffId":850,"staffName":"齐江波"},{"staffId":849,"staffName":"周立新"},{"staffId":848,"staffName":"史志波"},{"staffId":847,"staffName":"王增波"},{"staffId":846,"staffName":"杨彦龙"},{"staffId":845,"staffName":"杨华国"},{"staffId":844,"staffName":"王青华"}]';
this.$refs.changePaple.changeNameList(this.jsonSelectNameList);
},
methods: {
// 获取参考人员的list
......@@ -428,6 +424,9 @@ export default {
const data = [];
TStaffList(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
this.jsonSelectNameList=response;
this.$nextTick(()=>{
this.$refs.changePaple.changeNameList(this.jsonSelectNameList);
})
// response.rows.forEach((city, index) => {
// data.push({
// label: city.staffName,
......@@ -511,11 +510,13 @@ export default {
// this.cities = response.rows.staffName;
// generateData.cities=['shanghai', 'beijing', 'guangzhou', 'shenzhen', 'nanjing', 'xian', 'chengdu']
// });
this.generateData();
this.reset();
this.open = true;
this.title = "添加应急演练";
this.$nextTick(()=>{
this.$refs.changePaple.changeNameList(this.jsonSelectNameList);
})
},
/** 修改按钮操作 */
handleUpdate(row) {
......@@ -525,6 +526,11 @@ export default {
this.form = response.data;
this.open = true;
this.title = "修改应急演练";
console.log(response.data.drillPeople)
this.jsonSelectNameList=response.data.drillPeople;
this.$nextTick(()=>{
this.$refs.changePaple.changeNameList(this.jsonSelectNameList);
})
});
},
/** 评估按钮操作 */
......@@ -565,6 +571,8 @@ export default {
handleDetail(row) {
getDrill(row.drillId).then(response => {
this.form = response.data;
this.form.jsonPeople = JSON.parse(this.form.drillPeople)
console.log(this.form.jsonPeople)
this.form.drillType = this.selectDictLabel(this.drillTypeOptions, row.drillType);
this.form.drillForm = this.selectDictLabel(this.drillFormOptions, row.drillForm);
this.open2 = true;
......@@ -607,6 +615,7 @@ export default {
background: white;
padding-top:20px ;
padding-right: 20px;
padding-bottom:10px;
border-radius: 10px;
}
.division{
......
<template>
<el-form ref="form" :rules="rules" :model="form" label-width="80px">
<h3>个人信息录入</h3>
<el-form-item label="单位" prop="beyondUnit">
<el-input
style="width: 70%;"
placeholder="请输入单位"
v-model="form.beyondUnit"
maxlength="30"
clearable>
</el-input>
</el-form-item>
<el-form-item label="姓名">
<el-input
style="width: 70%;"
placeholder="请输入姓名"
v-model="form.name"
maxlength="11"
clearable>
</el-input>
</el-form-item>
<el-form-item label="性别">
<el-radio-group v-model="form.sex">
<el-radio label="0"></el-radio>
<el-radio label="1"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="手机号">
<el-input
style="width: 70%;"
placeholder="手机号"
v-model="form.phoneNum"
type="number"
maxlength="11"
clearable>
</el-input>
</el-form-item>
<el-form-item>
<el-button @click="onSubmit" type="primary" >下一步</el-button>
<el-button>取消</el-button>
</el-form-item>
</el-form>
</template>
<script>
export default {
name: "EnterInformation",
data() {
return {
form: {
beyondUnit: null,
name: null,
sex: null,
phoneNum: null,
testBeginTime:null,
},
}
},
methods: {
/**
* 获取当前时间
*/
currentTime() {
var date = new Date();
var year = date.getFullYear(); //月份从0~11,所以加一
let month = date.getMonth();
var dateArr = [
date.getMonth() + 1,
date.getDate(),
date.getHours(),
date.getMinutes(),
date.getSeconds(),
];
//如果格式是MM则需要此步骤,如果是M格式则此循环注释掉
for (var i = 0; i < dateArr.length; i++) {
if (dateArr[i] >= 1 && dateArr[i] <= 9) {
dateArr[i] = "0" + dateArr[i];
}
}
var strDate =
year +
"/" +
dateArr[0] +
"/" +
dateArr[1] +
" " +
dateArr[2] +
":" +
dateArr[3] +
":" +
dateArr[4];
//此处可以拿外部的变量接收 strDate:2022-05-01 13:25:30
//this.date = strDate;
this.form.testBeginTime=strDate;
},
onSubmit() {
this.currentTime();
// let params = this.form;
let params = JSON.stringify(this.form);
console.log(this.form.beyondUnit)
if (!this.form.beyondUnit){
console.log(params.beyondUnit)
this.$message('请输入单位');
}else if (!this.form.name){
this.$message('请输入姓名');
}else if (!this.form.sex){
this.$message('请选择性别');
}else if (!this.form.phoneNum){
this.$message('请输入手机号');
}else if (this.form.phoneNum.length>11){
this.$message('长度超出11位');
} else {
const routeData = this.$router.resolve({
path: '/trainingMaterials', //跳转目标窗口的地址
query: {
params //括号内是要传递给新窗口的参数
}
})
window.open(routeData.href, "_search");
}
},
next() {
if (this.active++ > 2) this.active = 0;
}
}
}
</script>
<style>
</style>
<template>
<el-dialog
class="answerLesson"
title="开始答题"
:visible.sync="visible"
width="87.5%"
:close-on-click-modal="false"
:close-on-press-escape="false"
:before-close="dialogCancel"
@closed="closeFinished"
destroy-on-close
>
<div ref="myBody" class="body" v-loading="loading">
<!-- <div class="text">-->
<!-- <div class="float">访客和供应商培训管理</div>-->
<!-- </div>-->
<transition name="fade" mode="out-in">
<div :key="goodJobShow">
<template v-if="!goodJobShow">
<transition name="fade" mode="out-in" >
<div class="question-wrapper" v-if="visible" :key="nowQuestion">
<div v-for="(item, index) in list" :key="item.id">
<Question
style="width: 89%;"
v-if="index === nowQuestion"
:questionObj="item"
:index="index"
:nowQuestion="nowQuestion"
:selectLetter="selectLetter"
@changeLetter="changeLetter"
/>
</div>
</div>
</transition>
<div class="select flex">
<div class="select-item flex">
<div
class="item"
:class="{
active:
answerArr.findIndex(
(item) => item.questionNum === index + 1
) >= 0,
now: index === nowQuestion,
}"
v-for="(item, index) in list"
:key="item.id + 'a' + index"
@click="questionNumClick(index)"
>
{{ index + 1 }}
</div>
<div @click="nextBtnClick" class="btn">下一题</div>
</div>
</div>
</template>
<template v-else>
<div :style="{ height: startHeight }">
<GoodJob :goodJobData="goodJobData" />
</div>
</template>
</div>
</transition>
</div>
<div slot="footer" class="dialog-footer">
<!-- <el-button type="primary" @click="closeFinished" v-if="goodJobShow"-->
<!-- >重新考试</el-button-->
<!-- >-->
<el-button type="primary" @click="closeFinished" v-if="goodJobShow"
>确定</el-button
>
<el-button type="primary" @click="dialogSubmitForm" v-else
>交卷</el-button
>
<el-button @click="dialogCancel">取消</el-button>
</div>
</el-dialog>
</template>
<script>
import Question from "../Trainingmaterials/components/Question";
import GoodJob from "../Trainingmaterials/components/GoodJob.vue";
import {
userQuestionList,
setAnswer,
} from "@/api/educationPlanExam/lessonsProgram";
import {
listTopic,
setEsult
} from "@/api/contractTrain/contractTrainTopic";
export default {
name: "AnswerLesson",
props: {
visible: {
type: Boolean,
default: false,
},
userCourseId: {
type: [Number, String],
},
courseId: {
type: [Number, String],
},
},
from:{
answers:{}
},
components: {
Question,
GoodJob,
},
data() {
return {
nowQuestion: 0,
startHeight: "0px",
goodJobShow: false,
goodJobData: {},
loading: false,
from:{},
list: [
{
id: 19,
text: "j9",
question: ["adsf", "dfgsdfg", "adsfadsf", "dfasdfadsf"],
},
],
answerArr: [],
// 题目是否被答过,如果答过,就把值传回去,如果没有答过,就是空
selectLetter: 999,
};
},
// watch: {
// visible(newValue) {
// if (newValue) {
// this.$nextTick(() => {
// this.saveBody();
// });
// }
// },
// },
created() {
listTopic().then((res) => {
console.log(res);
this.list = res.rows.map((item) => {
return {
id: item.topicId,
text: item.topicTitle,
question: JSON.parse(item.topicOption).map((item) => item.value),
};
});
});
},
methods: {
saveBody() {
this.startHeight = this.$refs.myBody.offsetHeight - 55 + "px";
},
dialogSubmitForm() {
console.log(JSON.parse(this.$route.query.params))
// this.answerClear();
// this.$emit("update:visible", false);
this.saveBody();
const answers = this.answerArr.map((item) => item.answer).join(",");
this.form=JSON.parse(this.$route.query.params);
this.loading = true;
console.log(this.form)
this.form.answers=answers
console.log(this.form)
setEsult(this.form)
.then((res) => {
if (res.code == 200) {
this.goodJobData = res.data;
this.goodJobShow = true;
}
})
.finally(() => {
this.loading = false;
// 是否作对
this.$emit('jj',this.goodJobData)
});
},
dialogCancel() {
this.$emit("update:visible", false);
},
// 关闭之后
closeFinished() {
const routeData = this.$router.resolve({
path: '/enterInformation', //跳转目标窗口的地址
query: {
}
})
window.open(routeData.href, "_search");
// this.answerClear();
this.goodJobShow = false;
},
answerClear() {
this.answerArr = [];
this.nowQuestion = 0;
},
// 点题目时
questionNumClick(index) {
// 是否是回答过的,数组中存在它,那它就是回答过的
const bool =
this.answerArr.findIndex((item) => item.questionNum === index + 1) >= 0;
// 或者下一题与当前题目是紧挨着的并且当前题目是答完的,相差为1就算是紧挨着的
const nowQuestionAnswerBool = this.nextQuestion(index);
if (bool || nowQuestionAnswerBool) {
this.nowQuestion = index;
}
// 赋值,如果答过的,就传回去,如果没答过,就是空 变成字符串是因为0位false
this.selectLetter =
this.answerArr[this.nowQuestion]?.answer + "" || 99999;
},
nextBtnClick() {
// 到头了,打完了
if (this.nowQuestion + 1 == this.list.length) return;
this.questionNumClick(this.nowQuestion + 1);
},
// 紧挨着且当前题目是打完的
nextQuestion(index) {
// 下一题相差1
// const nextIndexBool = index - this.nowQuestion == 1;
// 答案数组的长度,就是档当前达到了第几题,长度-1是因为题目是从0开始记录
const nextIndexBool = index - (this.answerArr.length - 1) == 1;
// 当前题已经回答过
const nowQuestionAnswerBool =
this.answerArr.findIndex(
(item) => item.questionNum === this.nowQuestion + 1
) >= 0;
return nextIndexBool && nowQuestionAnswerBool;
},
changeLetter(letter) {
console.log(letter);
console.log(this.$route.query) // 输出为:{params:"message"}
const obj = {};
obj.questionNum = this.nowQuestion + 1;
obj.answer = letter;
// 数组中是否存在这个题目
const index = this.answerArr.findIndex(
(item) => item.questionNum === this.nowQuestion + 1
);
if (index < 0) {
// 如果不存在
// 推入
this.answerArr.push(obj);
} else {
// 如果存在
// 替换
this.answerArr.splice(index, 1, obj);
}
// console.log(this.answerArr);
},
},
};
</script>
<style lang="scss" scoped>
.body {
width: 120%;
height: 100%;
padding-right: 40px;
padding-left: 20px;
.question-wrapper {
}
.text {
margin-bottom: 16px;
.float {
padding-right: 70%;
width: 106%;
height: 28px;
background: #1d84ff;
line-height: 28px;
color: #ffffff;
font-size: 10px;
text-align: right;
float: right;
}
&:after {
content: "";
display: block;
clear: both;
}
}
.select {
.select-item {
padding-top: 30px;
flex-wrap: wrap;
> div {
margin-bottom: 10px;
}
.item {
width: 38px;
height: 28px;
border: 1px solid #bbbbbb;
line-height: 28px;
font-size: 14px;
text-align: center;
margin-right: 18px;
cursor: pointer;
&.active {
background: #e9e9e9;
}
&.now {
background: #a3d3ff;
border: none;
}
}
.btn {
width: 84px;
height: 28px;
background: #e8f4ff;
border: 1px solid #a3d3ff;
color: #1d84ff;
text-align: center;
line-height: 28px;
font-size: 14px;
cursor: pointer;
&:hover {
background: rgba(29, 132, 255, 0.5);
color: #ffffff;
}
}
}
}
}
</style>
<template>
<el-dialog
class="answerLesson"
title="开始答题"
:visible.sync="visible"
width="57.5%"
:close-on-click-modal="false"
:close-on-press-escape="false"
:before-close="dialogCancel"
@closed="closeFinished"
destroy-on-close
>
<div ref="myBody" class="body" v-loading="loading">
<div class="text">
<div class="float">炼铁车间炉前工安全生产规范课程</div>
</div>
<transition name="fade" mode="out-in">
<div :key="goodJobShow">
<template v-if="!goodJobShow">
<transition name="fade" mode="out-in">
<div class="question-wrapper" v-if="visible" :key="nowQuestion">
<div v-for="(item, index) in list" :key="item.id">
<Question
v-if="index === nowQuestion"
:questionObj="item"
:index="index"
:nowQuestion="nowQuestion"
:selectLetter="selectLetter"
@changeLetter="changeLetter"
/>
</div>
</div>
</transition>
<div class="select flex">
<div class="select-item flex">
<div
class="item"
:class="{
active:
answerArr.findIndex(
(item) => item.questionNum === index + 1
) >= 0,
now: index === nowQuestion,
}"
v-for="(item, index) in list"
:key="item.id + 'a' + index"
@click="questionNumClick(index)"
>
{{ index + 1 }}
</div>
<div @click="nextBtnClick" class="btn">下一题</div>
</div>
</div>
</template>
<template v-else>
<div :style="{ height: startHeight }">
<GoodJob :goodJobData="goodJobData" />
</div>
</template>
</div>
</transition>
</div>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="closeFinished" v-if="goodJobShow"
>重新考试</el-button
>
<el-button type="primary" @click="dialogSubmitForm" v-else
>交卷</el-button
>
<el-button @click="dialogCancel">取消</el-button>
</div>
</el-dialog>
</template>
<script>
import Question from "./Question";
import GoodJob from "./GoodJob.vue";
import {
userQuestionList,
setAnswer,
} from "@/api/educationPlanExam/lessonsProgram";
export default {
name: "AnswerLesson",
props: {
visible: {
type: Boolean,
default: false,
},
userCourseId: {
type: [Number, String],
},
courseId: {
type: [Number, String],
},
},
components: {
Question,
GoodJob,
},
data() {
return {
nowQuestion: 0,
startHeight: "0px",
goodJobShow: false,
goodJobData: {},
loading: false,
list: [
{
id: 19,
text: "j9",
question: ["adsf", "dfgsdfg", "adsfadsf", "dfasdfadsf"],
},
],
answerArr: [],
// 题目是否被答过,如果答过,就把值传回去,如果没有答过,就是空
selectLetter: 999,
};
},
// watch: {
// visible(newValue) {
// if (newValue) {
// this.$nextTick(() => {
// this.saveBody();
// });
// }
// },
// },
created() {
userQuestionList({ courseId: this.courseId }).then((res) => {
console.log(res.data);
this.list = res.data.map((item) => {
return {
id: item.topicId,
text: item.topicTitle,
question: JSON.parse(item.topicOption).map((item) => item.value),
};
});
});
},
methods: {
saveBody() {
this.startHeight = this.$refs.myBody.offsetHeight - 55 + "px";
},
dialogSubmitForm() {
// this.answerClear();
// this.$emit("update:visible", false);
this.saveBody();
const answers = this.answerArr.map((item) => item.answer).join(",");
this.loading = true;
setAnswer({
userCourseId: this.userCourseId,
answers,
})
.then((res) => {
if (res.code == 200) {
this.goodJobData = res.data;
this.goodJobShow = true;
}
})
.finally(() => {
this.loading = false;
// 是否作对
this.$emit('jj',this.goodJobData)
});
},
dialogCancel() {
this.$emit("update:visible", false);
},
// 关闭之后
closeFinished() {
this.answerClear();
this.goodJobShow = false;
},
answerClear() {
this.answerArr = [];
this.nowQuestion = 0;
},
// 点题目时
questionNumClick(index) {
// 是否是回答过的,数组中存在它,那它就是回答过的
const bool =
this.answerArr.findIndex((item) => item.questionNum === index + 1) >= 0;
// 或者下一题与当前题目是紧挨着的并且当前题目是答完的,相差为1就算是紧挨着的
const nowQuestionAnswerBool = this.nextQuestion(index);
if (bool || nowQuestionAnswerBool) {
this.nowQuestion = index;
}
// 赋值,如果答过的,就传回去,如果没答过,就是空 变成字符串是因为0位false
this.selectLetter =
this.answerArr[this.nowQuestion]?.answer + "" || 99999;
},
nextBtnClick() {
// 到头了,打完了
if (this.nowQuestion + 1 == this.list.length) return;
this.questionNumClick(this.nowQuestion + 1);
},
// 紧挨着且当前题目是打完的
nextQuestion(index) {
// 下一题相差1
// const nextIndexBool = index - this.nowQuestion == 1;
// 答案数组的长度,就是档当前达到了第几题,长度-1是因为题目是从0开始记录
const nextIndexBool = index - (this.answerArr.length - 1) == 1;
// 当前题已经回答过
const nowQuestionAnswerBool =
this.answerArr.findIndex(
(item) => item.questionNum === this.nowQuestion + 1
) >= 0;
return nextIndexBool && nowQuestionAnswerBool;
},
changeLetter(letter) {
console.log(letter);
const obj = {};
obj.questionNum = this.nowQuestion + 1;
obj.answer = letter;
// 数组中是否存在这个题目
const index = this.answerArr.findIndex(
(item) => item.questionNum === this.nowQuestion + 1
);
if (index < 0) {
// 如果不存在
// 推入
this.answerArr.push(obj);
} else {
// 如果存在
// 替换
this.answerArr.splice(index, 1, obj);
}
// console.log(this.answerArr);
},
},
};
</script>
<style lang="scss" scoped>
.body {
width: 100%;
height: 100%;
padding-right: 50px;
padding-left: 60px;
.question-wrapper {
}
.text {
margin-bottom: 27px;
.float {
padding-right: 7px;
width: 411px;
height: 28px;
background: #1d84ff;
line-height: 28px;
color: #ffffff;
font-size: 14px;
text-align: right;
float: right;
}
&:after {
content: "";
display: block;
clear: both;
}
}
.select {
.select-item {
padding-top: 20px;
flex-wrap: wrap;
> div {
margin-bottom: 10px;
}
.item {
width: 28px;
height: 28px;
border: 1px solid #bbbbbb;
line-height: 28px;
font-size: 14px;
text-align: center;
margin-right: 18px;
cursor: pointer;
&.active {
background: #e9e9e9;
}
&.now {
background: #a3d3ff;
border: none;
}
}
.btn {
width: 84px;
height: 28px;
background: #e8f4ff;
border: 1px solid #a3d3ff;
color: #1d84ff;
text-align: center;
line-height: 28px;
font-size: 14px;
cursor: pointer;
&:hover {
background: rgba(29, 132, 255, 0.5);
color: #ffffff;
}
}
}
}
}
</style>
<!--
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-21 17:20:49
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-09-28 11:56:49
* @FilePath: /danger-manage-web/src/views/myLessons/components/GoodJob.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div class="goodjob-wrapper flex">
<div class="text flex">
<div class="text flex">
<template v-if="goodJobData.answer >= goodJobData.qualifiedNum">
<div class="icon"><i class="iconfont icon-smiling" /></div>
<div>
恭喜你,做对{{ goodJobData.answer }}道题得分{{
Math.floor((goodJobData.answer / goodJobData.topicNum) * 100)
}},成绩合格!
</div>
</template>
<template v-else>
<div class="icon"><i class="iconfont icon-nanguo" /></div>
<div>
继续努力,做对{{ goodJobData.answer }}道题得分{{
Math.floor((goodJobData.answer / goodJobData.topicNum) * 100)
}},成绩不合格!
</div>
</template>
</div>
</div>
</div>
</template>
<script>
export default {
name: "",
props: {
goodJobData: {
type: Object,
},
},
data() {
return {};
},
methods: {},
};
</script>
<style lang="scss" scoped>
.goodjob-wrapper {
justify-content: center;
align-items: center;
width: 86%;
height: 100%;
border-bottom: 1px solid #bbbbbb;
.text {
width: 94%;
height: 174px;
color: #1d84ff;
background: #f9f9f9 100%;
border-radius: 15px;
line-height: 40px;
font-size: 28px;
justify-content: center;
align-items: center;
.icon {
margin-right: 10px;
.iconfont {
color: #e2852a;
font-size: 40px !important;
}
}
}
}
</style>
<!--
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-20 14:17:00
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-09-28 13:05:49
* @FilePath: /danger-manage-web/src/views/myLessions/components/learnAfter.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div class="learnbrfore flex">
<transition name="fade" mode="out-in">
<div class="top flex" :key="currentPage">
<div
v-show="index < 9 * currentPage && index >= 9 * (currentPage - 1)"
v-for="(item, index) in afterList"
:key="index + ''"
class="learn-item"
>
<LearnItem
:state="state"
:itemData="item"
@examination="examination"
/>
</div>
</div>
</transition>
<div class="bottom flex">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="currentPage"
:page-size="9"
:layout="total > 9 ? layout : layout2"
:total="afterList.length"
>
</el-pagination>
</div>
</div>
</template>
<script>
import LearnItem from "./LearnItem";
export default {
name: "learnbrfore",
components: {
LearnItem,
},
props: {
state: {
type: Object,
},
list: {
type: Array,
default: () => {
return [];
},
},
},
data() {
return {
// list: [
// { state: 2},
// { state: 2},
// { state: 2},
// { state: 2},
// { state: 2},
// { state: 2},
// { state: 2},
// { state: 2},
// { state: 2},
// ],
currentPage: 1,
total: 19,
layout: "prev, pager, next, jumper",
layout2: "prev, pager, next",
};
},
computed: {
afterList() {
return this.list.filter((item) => item.state > 1);
},
},
created() {
console.log("after");
},
methods: {
handleSizeChange(val) {
console.log(`每页 ${val} 条`);
},
handleCurrentChange(val) {
console.log(`当前页: ${val}`);
},
examination(e) {
this.$emit("examination", e);
},
},
};
</script>
<style lang="scss" scoped>
.learnbrfore {
width: 100%;
height: 100%;
flex-direction: column;
.top {
width: 100%;
flex: 1;
padding: 2px;
box-sizing: border-box;
// justify-content: space-between;
flex-wrap: wrap;
.learn-item {
width: 32.5%;
height: 31.5%;
margin-right: 1.25%;
&:nth-child(3n) {
margin-right: 0px;
}
}
}
.bottom {
height: 12.7%;
max-height: 100px;
justify-content: center;
align-items: center;
}
}
</style>
<!--
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-20 14:17:00
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-09-28 09:37:40
* @FilePath: /danger-manage-web/src/views/myLessions/components/learnAfter.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div class="learnbrfore flex">
<transition name="fade" mode="out-in">
<div class="top flex" :key="currentPage">
<div
v-show="index < 9 * currentPage && index >= 9 * (currentPage - 1)"
v-for="(item, index) in beforeList"
:key="index + ''"
class="learn-item"
>
<LearnItem
:state="state"
:itemData="item"
@examination="examination"
/>
</div>
</div>
</transition>
<div class="bottom flex">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="currentPage"
:page-size="9"
:layout="total > 9 ? layout : layout2"
:total="beforeList.length"
>
</el-pagination>
</div>
</div>
</template>
<script>
import LearnItem from "./LearnItem";
export default {
name: "learnbrfore",
components: {
LearnItem,
},
props: {
state: {
type: Object,
},
list: {
type: Array,
default: () => {
return [];
},
},
},
data() {
return {
// list: [
// { state: 0 },
// { state: 1 },
// { state: 0 },
// { state: 1 },
// { state: 0 },
// { state: 1 },
// { state: 1 },
// { state: 1 },
// { state: 0 },
// ],
currentPage: 1,
total: 19,
layout: "prev, pager, next, jumper",
layout2: "prev, pager, next",
};
},
computed: {
beforeList() {
return this.list.filter((item) => item.state < 2);
},
},
created() {
console.log("before");
},
methods: {
handleSizeChange(val) {
console.log(`每页 ${val} 条`);
},
handleCurrentChange(val) {
console.log(`当前页: ${val}`);
},
examination(e) {
this.$emit("examination", e);
},
},
};
</script>
<style lang="scss" scoped>
.learnbrfore {
width: 100%;
height: 100%;
flex-direction: column;
.top {
width: 100%;
flex: 1;
padding: 2px;
box-sizing: border-box;
// justify-content: space-between;
flex-wrap: wrap;
.learn-item {
width: 32.5%;
height: 31.5%;
margin-right: 1.25%;
&:nth-child(3n) {
margin-right: 0px;
}
}
}
.bottom {
height: 12.7%;
max-height: 100px;
justify-content: center;
align-items: center;
}
}
</style>
<!--
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-20 11:30:14
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-09-28 09:19:38
* @FilePath: /danger-manage-web/src/views/myLessons/components/Left.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div class="lession-left-wrapper flex">
<el-tabs class="top" v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="待学习" name="first"></el-tab-pane>
<el-tab-pane label="已学习" name="second"></el-tab-pane>
</el-tabs>
<div class="middle flex">
<transition name="fade-transform" mode="out-in">
<keep-alive>
<component :is="currentTabComponent" @examination="examination" :state="state" :list="list"></component>
</keep-alive>
</transition>
</div>
</div>
</template>
<script>
import LearnAfter from "./LearnAfter";
import LearnBefore from "./LearnBefore";
import {getUserLessons} from "@/api/educationPlanExam/lessonsProgram"
export default {
name: "lession-left",
components: {
// LearnAfter,
// LearnBefore,
},
data() {
return {
activeName: "first",
currentTabComponent: LearnBefore,
list:[],
state:{
"0":'未学习',
"1":'未通过',
"2":"通过"
},
};
},
created(){
this.getUserLessons();
},
methods: {
getUserLessons(){
getUserLessons().then(res=>{
console.log(res.rows);
this.list = res.rows;
})
},
handleClick(tab) {
if (tab.paneName == "first") {
this.currentTabComponent = LearnBefore;
} else {
this.currentTabComponent = LearnAfter;
}
},
examination(e){
this.$emit('examination',e)
}
},
};
</script>
<style lang="scss" scoped>
.lession-left-wrapper {
padding: 5px 26px 0;
height: 100%;
width: 100%;
flex-direction: column;
.top {
// margin-bottom: 47px;
}
.middle {
flex: 1;
height: 100%;
width: 100%;
justify-content: space-between;
overflow: hidden;
}
// .bottom{
// max-height: 105px;
// height: 11%;
// }
}
</style>
......@@ -3,14 +3,14 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.zehong</groupId>
<artifactId>zehong</artifactId>
<version>3.5.0</version>
<name>zehong</name>
<description>项目管理系统</description>
<properties>
<zehong.version>3.5.0</zehong.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
......@@ -33,7 +33,7 @@
<velocity.version>1.7</velocity.version>
<jwt.version>0.9.1</jwt.version>
</properties>
<!-- 依赖声明 -->
<dependencyManagement>
<dependencies>
......@@ -262,4 +262,4 @@
</pluginRepository>
</pluginRepositories>
</project>
\ No newline at end of file
</project>
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