| | |
| | | } |
| | | |
| | | /** |
| | | * 培训计划完成列表 |
| | | * @param companyId |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "培训计划完成列表") |
| | | @GetMapping("/plan/listByStatue") |
| | | public CommonResult selectTrainPlanListByState(@RequestParam("companyId") Integer companyId){ |
| | | return CommonResult.success(trainPlanService.selectTrainPlanListByStatus(companyId)); |
| | | } |
| | | |
| | | /** |
| | | * 培训计划新增 |
| | | * @param trainPlan |
| | | * @return |
| | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | import java.io.Serializable; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | |
| | | @TableField("course_name") |
| | | private String courseName; |
| | | |
| | | @ApiModelProperty(value = "培训时间") |
| | | @TableField("plan_date") |
| | | private LocalDate planDate; |
| | | |
| | | @NotNull(message = "培训等级不能为空") |
| | | @ApiModelProperty(value = "培训等级(1公司级 2部门级 3车间级 默认1)",required = true) |
| | | @TableField("level") |
| | |
| | | private String paperName; |
| | | |
| | | @ApiModelProperty(value = "证书") |
| | | @TableField("certifity") |
| | | private String certifity; |
| | | @TableField("paper_student_id") |
| | | private Long paperStudentId; |
| | | |
| | | @TableField(exist = false) |
| | | private String number; |
| | | |
| | | @ApiModelProperty(value = "审核经历次数") |
| | | @TableField("amount") |
| | |
| | | package com.gkhy.exam.system.domain.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonInclude; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Getter; |
| | |
| | | private Long companyId; |
| | | @ApiModelProperty(value = "公司名称") |
| | | private String companyName; |
| | | @ApiModelProperty(value = "证书id") |
| | | private Long paperStudentId; |
| | | private String number; |
| | | private Integer passed; |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.gkhy.exam.system.domain.TrainPlan; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.mapstruct.Mapper; |
| | | |
| | | import java.util.List; |
| | |
| | | public interface TrainPlanMapper extends BaseMapper<TrainPlan> { |
| | | List<TrainPlan> selectTrainPlan(TrainPlan trainPlan); |
| | | |
| | | List<TrainPlan> selectByCompanyId(@Param("companyId") Integer companyId); |
| | | } |
| | |
| | | CommonResult updateTrainPlan(TrainPlan trainPlan); |
| | | |
| | | CommonResult deletedTrainPlan(Integer trainPlanId); |
| | | |
| | | CommonResult selectTrainPlanListByStatus(Integer companyId); |
| | | } |
| | |
| | | package com.gkhy.exam.system.service.impl; |
| | | |
| | | import cn.hutool.core.lang.Snowflake; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import cn.hutool.core.util.RandomUtil; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.gkhy.exam.common.api.CommonPage; |
| | |
| | | //生成考试证书编号 |
| | | DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
| | | String format = LocalDate.now().format(dateTimeFormatter); |
| | | Long l = baseMapper.selectCount(Wrappers.<ExPaperStudent>lambdaQuery().eq(ExPaperStudent::getPassed, 1).eq(ExPaperStudent::getState,2)); |
| | | l+=1; |
| | | paperStudent.setNumber("AQSC-"+format+"-"+l); |
| | | String timestamp = String.valueOf(System.currentTimeMillis()).substring(9, 13); |
| | | paperStudent.setNumber("AQSC-"+format+"-"+timestamp); |
| | | } |
| | | |
| | | |
| | | if (exPaperStudent.getScore()>paperStudent.getScore()){ |
| | | if (exPaperStudent.getScore()>=paperStudent.getScore()){ |
| | | paperStudent.setScore(exPaperStudent.getScore()); |
| | | paperStudent.setNumber(exPaperStudent.getNumber()); |
| | | } |
| | | } |
| | | int row=baseMapper.updateById(paperStudent); |
| | |
| | | if(paperStudentList.size()>0){ |
| | | trainRecordVOList.addAll(paperStudentList.stream().map(item -> { |
| | | TrainRecordVO trainRecordVO=new TrainRecordVO(); |
| | | trainRecordVO.setPaperStudentId(item.getId()); |
| | | trainRecordVO.setStudentId(item.getStudentId()); |
| | | trainRecordVO.setTrainType(2); |
| | | trainRecordVO.setPassed(item.getPassed()); |
| | |
| | | trainPlanMapper.updateById(trainPlan); |
| | | return CommonResult.success(); |
| | | } |
| | | |
| | | @Override |
| | | public CommonResult selectTrainPlanListByStatus(Integer companyId) { |
| | | List<TrainPlan> trainPlans = trainPlanMapper.selectByCompanyId(companyId); |
| | | return CommonResult.success(trainPlans); |
| | | } |
| | | } |
| | |
| | | </resultMap> |
| | | |
| | | <sql id="selectExamRecordVo"> |
| | | select a.id, a.company_id, a.student_id, a.plan_name, a.course_name,a.level,a.period,a.actual_period,a.score, |
| | | select a.id, a.company_id, a.student_id, a.plan_name, a.course_name,a.level,a.plan_date,a.period,a.actual_period,a.score, |
| | | a.passed, a.create_by, a.create_time, a.update_by, a.update_time, a.remark,b.name as company_name |
| | | from ex_exam_record a |
| | | left join sys_company b on b.id=a.company_id |
| | |
| | | es.`name` AS person_name, |
| | | es.dept_id, |
| | | sd.dept_name, |
| | | eep.`name` as paper_name, |
| | | iae.`certifity`, |
| | | eep.`name` AS paper_name, |
| | | iae.`paper_student_id`, |
| | | eps.`number`, |
| | | iae.`amount`, |
| | | iae.`conclusion`, |
| | | iae.`del_flag`, |
| | |
| | | iae.`update_time` |
| | | FROM |
| | | internal_audit_evaluate iae |
| | | LEFT JOIN ex_student es ON iae.person_id = es.id |
| | | LEFT JOIN sys_dept sd ON es.dept_id = sd.dept_id |
| | | LEFT JOIN sys_company sc ON iae.company_id = sc.id |
| | | LEFT JOIN ex_paper_student eps on eps.student_id = iae.person_id and eps.number = iae.certifity |
| | | LEFT JOIN ex_exam_paper eep on eps.paper_id = eep.id |
| | | LEFT JOIN ex_student es ON iae.person_id = es.id |
| | | LEFT JOIN sys_dept sd ON es.dept_id = sd.dept_id |
| | | LEFT JOIN sys_company sc ON iae.company_id = sc.id |
| | | LEFT JOIN ex_paper_student eps ON eps.id = iae.paper_student_id |
| | | LEFT JOIN ex_exam_paper eep ON eps.paper_id = eep.id |
| | | WHERE |
| | | iae.del_flag = 1 |
| | | <if test="companyId!=null and companyId!=''"> |
| | | and iae.company_id = #{companyId} |
| | | </if> |
| | | ORDER BY |
| | | iae.create_time ASC |
| | | <if test="companyId!=null and companyId!=''"> |
| | | and iae.company_id = #{companyId} |
| | | </if> |
| | | ORDER BY |
| | | iae.create_time ASC |
| | | </select> |
| | | </mapper> |
| | |
| | | </if> |
| | | ORDER BY tp.create_time ASC |
| | | </select> |
| | | <select id="selectByCompanyId" resultType="com.gkhy.exam.system.domain.TrainPlan"> |
| | | SELECT |
| | | `id`, |
| | | `company_id`, |
| | | `train_name`, |
| | | `train_time`, |
| | | `dept_id`, |
| | | `train_object`, |
| | | `num`, |
| | | `hour`, |
| | | `money`, |
| | | `modality`, |
| | | `status`, |
| | | `del_flag`, |
| | | `create_by`, |
| | | `create_time`, |
| | | `update_by`, |
| | | `update_time` |
| | | FROM |
| | | `train_plan` |
| | | WHERE |
| | | del_flag = 1 |
| | | AND `status` = 0 |
| | | <if test="companyId!=null"> |
| | | and company_id = #{companyId} |
| | | </if> |
| | | </select> |
| | | </mapper> |