Commit ccc30842 authored by 吴卿华's avatar 吴卿华

化工巡检

parent be94399c
......@@ -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));
}
/**
* 导出承包商及访客培训列表
*/
......
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.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));
}
/**
* 修改承包商及访客培训考试结果详情
*/
//@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));
}
}
......@@ -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
*
......@@ -98,6 +99,9 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
.authorizeRequests()
// 对于登录login 验证码captchaImage 允许匿名访问
.antMatchers("/login", "/captchaImage").anonymous()
.antMatchers("/system/result/list", "/captchaImage").anonymous()
.antMatchers("/contractTrain/list", "/captchaImage").anonymous()
.antMatchers("/contractTrain/getITContractorTrainCourse", "/captchaImage").anonymous()
.antMatchers(
HttpMethod.GET,
"/*.html",
......@@ -129,7 +133,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 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
*
* @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")
@Excel(name = "考试开始时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date testBeginTime;
/** 考试结束时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "考试结束时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date testEndTime;
/** 答对数量 */
@Excel(name = "答对数量")
private String score;
/** 是否合格:0 合格,1 不合格 */
@Excel(name = "是否合格:0 合格,1 不合格")
private String isQualified;
/** 是否删除(0正常,1删除) */
private String isDel;
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 new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("resultId", getResultId())
.append("beyondUnit", getBeyondUnit())
.append("name", getName())
.append("sex", getSex())
.append("phoneNum", getPhoneNum())
.append("testBeginTime", getTestBeginTime())
.append("testEndTime", getTestEndTime())
.append("score", getScore())
.append("isQualified", getIsQualified())
.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.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.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);
}
......@@ -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.TContractorTrainResultMapper;
import com.zehong.system.domain.TContractorTrainResult;
import com.zehong.system.service.ITContractorTrainResultService;
/**
* 承包商及访客培训考试结果详情Service业务层处理
*
* @author zehong
* @date 2022-12-27
*/
@Service
public class TContractorTrainResultServiceImpl implements ITContractorTrainResultService
{
@Autowired
private TContractorTrainResultMapper tContractorTrainResultMapper;
/**
* 查询承包商及访客培训考试结果详情
*
* @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);
}
}
......@@ -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.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 test_begin_time = #{testBeginTime}</if>
<if test="testEndTime != null "> and test_end_time = #{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
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),
......
<template>
<el-form ref="form" :model="form" :label-position="right" label-width="80px">
<h3>个人信息录入</h3>
<el-form-item label="单位">
<el-input
style="width: 70%;"
placeholder="请输入单位"
v-model="form.name"
clearable>
</el-input>
</el-form-item>
<el-form-item label="姓名">
<el-input
style="width: 70%;"
placeholder="请输入姓名"
v-model="form.name"
clearable>
</el-input>
</el-form-item>
<el-form-item label="性别">
<el-radio-group v-model="form.resource">
<el-radio label="男"></el-radio>
<el-radio label="女"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="手机号">
<el-input
style="width: 70%;"
placeholder="手机号"
v-model="form.name"
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: {
name: '',
region: '',
date1: '',
date2: '',
delivery: false,
type: [],
resource: '',
desc: '',
active: 0
},
sizeForm: {
name: '',
region: '',
date1: '',
date2: '',
delivery: false,
type: [],
resource: '',
desc: ''
},
}
},
methods: {
onSubmit() {
window.open("http://192.168.2.2/trainingMaterials", "_search");
console.log('submit!');
// 保留当前页,页面跳转至 /home 页
// this.$router.push("http://192.168.2.2/trainingMaterials");
// this.$router.push({name:'http://192.168.2.2/trainingMaterials',params: {id:'123456'}})
},
next() {
if (this.active++ > 2) this.active = 0;
}
}
}
</script>
<style>
</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 "@/views/educationPlanExam/myLessons/components/Question";
import GoodJob from "@/views/educationPlanExam/myLessons/components/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>
......@@ -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