培训教练员
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
package com.cool.store.enums;
|
||||
|
||||
/**
|
||||
* @author byd
|
||||
* @date 2024-04-30 15:54
|
||||
*/
|
||||
public enum AssessmentTemplateType {
|
||||
|
||||
TRAINER(0, "教练员"),
|
||||
STORE_MANAGER(1, "店长"),
|
||||
CLERK(2, "店员"),
|
||||
TRIPARTITE_ACCEPTANCE(3, "三方验收"),
|
||||
;
|
||||
|
||||
private Integer code;
|
||||
|
||||
private String name;
|
||||
|
||||
private AssessmentTemplateType(Integer code, String name) {
|
||||
this.code = code;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Integer getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public static AssessmentTemplateType getByCode(Integer code) {
|
||||
for (AssessmentTemplateType auditStatusEnum : AssessmentTemplateType.values()) {
|
||||
if (auditStatusEnum.getCode().equals(code)) {
|
||||
return auditStatusEnum;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import com.cool.store.mapper.AssessmentDataMapper;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import org.springframework.stereotype.Service;
|
||||
import tk.mybatis.mapper.entity.Example;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
@@ -19,6 +20,7 @@ import java.util.List;
|
||||
public class AssessmentDataDAO {
|
||||
@Resource
|
||||
private AssessmentDataMapper assessmentDataMapper;
|
||||
|
||||
public Boolean batchInsert(List<AssessmentDataDO> assessmentDataDOS) {
|
||||
if (CollectionUtils.isEmpty(assessmentDataDOS) && assessmentDataDOS.size() > 0) {
|
||||
for (AssessmentDataDO assessmentDataDO : assessmentDataDOS) {
|
||||
@@ -26,8 +28,9 @@ public class AssessmentDataDAO {
|
||||
}
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
return Boolean.FALSE;
|
||||
return Boolean.FALSE;
|
||||
}
|
||||
|
||||
public Integer batchUpdate(List<AssessmentDataDO> assessmentDataDOS) {
|
||||
if (CollectionUtils.isEmpty(assessmentDataDOS) && assessmentDataDOS.size() > 0) {
|
||||
|
||||
@@ -35,4 +38,26 @@ public class AssessmentDataDAO {
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public List<AssessmentDataDO> selectList(Long shopId, String userId) {
|
||||
return assessmentDataMapper.select(AssessmentDataDO.builder().shopId(shopId).assessmentUserId(userId).build());
|
||||
}
|
||||
|
||||
public AssessmentDataDO selectByTemplateId(Long templateId, String userId, Long shopId) {
|
||||
return assessmentDataMapper.selectOne(AssessmentDataDO.builder().shopId(shopId).templateId(templateId).assessmentUserId(userId).build());
|
||||
}
|
||||
|
||||
public Integer updateByPrimaryKeySelective(AssessmentDataDO assessmentDataDO) {
|
||||
return assessmentDataMapper.updateByPrimaryKeySelective(assessmentDataDO);
|
||||
}
|
||||
|
||||
public Integer insertSelective(AssessmentDataDO assessmentDataDO) {
|
||||
return assessmentDataMapper.insertSelective(assessmentDataDO);
|
||||
}
|
||||
|
||||
public Integer selectCount(String userId, Long shopId) {
|
||||
Example example = new Example(AssessmentDataDO.class);
|
||||
example.createCriteria().andEqualTo("assessmentUserId", userId).andEqualTo("shopId", shopId).andIsNotNull("qualified");
|
||||
return assessmentDataMapper.selectCountByExample(example);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.cool.store.entity.EmployeeTrainingDO;
|
||||
import com.cool.store.mapper.EmployeeTrainingMapper;
|
||||
import com.cool.store.vo.EmployeeTrainingVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@@ -22,9 +23,13 @@ public class EmployeeTrainingDAO {
|
||||
|
||||
public List<EmployeeTrainingVO> employeeTrainingList(String keyWord, List<String> regionIdList,
|
||||
List<String> authRegionIdList, Boolean assignFlag,
|
||||
String beginTime, String endTime, List<Long> shopIdList) {
|
||||
String beginTime, String endTime, List<Long> shopIdList,
|
||||
Integer theoreticalExamStatus,
|
||||
Integer practicalExamStatus,
|
||||
Integer assessmentStatus) {
|
||||
|
||||
return employeeTrainingMapper.employeeTrainingMapper(keyWord, regionIdList, authRegionIdList, assignFlag, beginTime, endTime, shopIdList);
|
||||
return employeeTrainingMapper.employeeTrainingMapper(keyWord, regionIdList, authRegionIdList, assignFlag, beginTime, endTime, shopIdList,
|
||||
theoreticalExamStatus, practicalExamStatus, assessmentStatus);
|
||||
}
|
||||
|
||||
public EmployeeTrainingDO selectById(Long id) {
|
||||
@@ -35,4 +40,21 @@ public class EmployeeTrainingDAO {
|
||||
public EmployeeTrainingDO selectByUserDetailId(Long userDetailId) {
|
||||
return employeeTrainingMapper.selectOne(EmployeeTrainingDO.builder().xfsgUserDetailId(userDetailId).build());
|
||||
}
|
||||
|
||||
public int insertSelective(EmployeeTrainingDO employeeTrainingDO) {
|
||||
|
||||
return employeeTrainingMapper.insertSelective(employeeTrainingDO);
|
||||
}
|
||||
|
||||
public int updateByPrimaryKeySelective(EmployeeTrainingDO employeeTrainingDO) {
|
||||
|
||||
return employeeTrainingMapper.updateByPrimaryKeySelective(employeeTrainingDO);
|
||||
}
|
||||
|
||||
public List<EmployeeTrainingVO> trainingListByShopId(Long shopId, String trainingTeacherUserId, Integer status) {
|
||||
|
||||
return employeeTrainingMapper.trainingListByShopId(shopId, trainingTeacherUserId, status);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -2,6 +2,8 @@ package com.cool.store.mapper;
|
||||
|
||||
import com.cool.store.entity.EmployeeTrainingDO;
|
||||
import com.cool.store.vo.EmployeeTrainingVO;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.models.auth.In;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
|
||||
@@ -11,5 +13,11 @@ public interface EmployeeTrainingMapper extends Mapper<EmployeeTrainingDO> {
|
||||
|
||||
List<EmployeeTrainingVO> employeeTrainingMapper(@Param("keyWord") String keyWord, @Param("regionIdList") List<String> regionIdList,
|
||||
@Param("authRegionIdList") List<String> authRegionIdList, @Param("assignFlag") Boolean assignFlag,
|
||||
@Param("beginTime") String beginTime, @Param("endTime") String endTime, @Param("shopIdList") List<Long> shopIdList);
|
||||
@Param("beginTime") String beginTime, @Param("endTime") String endTime, @Param("shopIdList") List<Long> shopIdList,
|
||||
@Param("theoreticalExamStatus") Integer theoreticalExamStatus,
|
||||
@Param("practicalExamStatus") Integer practicalExamStatus,
|
||||
@Param("assessmentStatus") Integer assessmentStatus);
|
||||
|
||||
List<EmployeeTrainingVO> trainingListByShopId(@Param("shopId") Long shopId, @Param("trainingTeacherUserId") String trainingTeacherUserId,
|
||||
@Param("status") Integer status);
|
||||
}
|
||||
@@ -79,5 +79,49 @@
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="theoreticalExamStatus != null">
|
||||
and e.theoretical_exam_status = #{theoreticalExamStatus}
|
||||
</if>
|
||||
<if test="practicalExamStatus != null">
|
||||
and e.practical_exam_status = #{practicalExamStatus}
|
||||
</if>
|
||||
<if test="assessmentStatus != null and assessmentStatus == 0">
|
||||
and e.assessment_total_num > e.assessment_num
|
||||
</if>
|
||||
<if test="assessmentStatus != null and assessmentStatus == 1">
|
||||
and e.assessment_total_num = e.assessment_num
|
||||
</if>
|
||||
</select>
|
||||
<select id="trainingListByShopId" resultType="com.cool.store.vo.EmployeeTrainingVO">
|
||||
select
|
||||
u.id,
|
||||
u.username,
|
||||
u.mobile,
|
||||
u.region_id as regionId,
|
||||
u.role_id as roleId,
|
||||
u.shop_id as shopId,
|
||||
s.shop_name as shopName,
|
||||
u.id_card as idCard,
|
||||
e.id as employeeTrainingId,
|
||||
e.training_store_id as trainingStoreId,
|
||||
e.training_teacher_user_id as trainingTeacherUserId,
|
||||
e.practical_assessment_user_id as practicalAssessmentUserId,
|
||||
e.assessment_num as assessmentNum,
|
||||
e.assessment_total_num as assessmentTotalNum,
|
||||
e.theoretical_exam_status as theoreticalExamStatus,
|
||||
e.theoretical_exam_score as theoreticalExamScore,
|
||||
e.practical_exam_status as practicalExamStatus,
|
||||
e.practical_exam_score as practicalExamScore,
|
||||
e.assessment_status as assessmentStatus
|
||||
from xfsg_temp_user_detail u
|
||||
left join xfsg_employee_training e on e.xfsg_user_detail_id = u.id
|
||||
left join xfsg_shop_info s on s.id = u.shop_id
|
||||
where u.deleted = 0
|
||||
<if test="trainingTeacherUserId != null and trainingTeacherUserId != ''">
|
||||
and e.training_teacher_user_id = #{trainingTeacherUserId}
|
||||
</if>
|
||||
<if test="shopId != null">
|
||||
and u.shop_id = #{shopId}
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -1,7 +1,16 @@
|
||||
package com.cool.store.entity;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.persistence.*;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Table(name = "xfsg_assessment_data")
|
||||
public class AssessmentDataDO {
|
||||
@Id
|
||||
@@ -29,7 +38,7 @@ public class AssessmentDataDO {
|
||||
/**
|
||||
* 店铺是否合格
|
||||
*/
|
||||
private Byte qualified;
|
||||
private Boolean qualified;
|
||||
|
||||
/**
|
||||
* 评分
|
||||
@@ -46,143 +55,4 @@ public class AssessmentDataDO {
|
||||
*/
|
||||
private String comments;
|
||||
|
||||
/**
|
||||
* @return id
|
||||
*/
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param id
|
||||
*/
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取xfsg_assessment_template.id
|
||||
*
|
||||
* @return template_id - xfsg_assessment_template.id
|
||||
*/
|
||||
public Long getTemplateId() {
|
||||
return templateId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置xfsg_assessment_template.id
|
||||
*
|
||||
* @param templateId xfsg_assessment_template.id
|
||||
*/
|
||||
public void setTemplateId(Long templateId) {
|
||||
this.templateId = templateId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 xfsg_shop_info id
|
||||
*
|
||||
* @return shop_id - xfsg_shop_info id
|
||||
*/
|
||||
public Long getShopId() {
|
||||
return shopId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置 xfsg_shop_info id
|
||||
*
|
||||
* @param shopId xfsg_shop_info id
|
||||
*/
|
||||
public void setShopId(Long shopId) {
|
||||
this.shopId = shopId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取考核人
|
||||
*
|
||||
* @return assessment_user_id - 考核人
|
||||
*/
|
||||
public String getAssessmentUserId() {
|
||||
return assessmentUserId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置考核人
|
||||
*
|
||||
* @param assessmentUserId 考核人
|
||||
*/
|
||||
public void setAssessmentUserId(String assessmentUserId) {
|
||||
this.assessmentUserId = assessmentUserId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取店铺是否合格
|
||||
*
|
||||
* @return qualified - 店铺是否合格
|
||||
*/
|
||||
public Byte getQualified() {
|
||||
return qualified;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置店铺是否合格
|
||||
*
|
||||
* @param qualified 店铺是否合格
|
||||
*/
|
||||
public void setQualified(Byte qualified) {
|
||||
this.qualified = qualified;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取评分
|
||||
*
|
||||
* @return score - 评分
|
||||
*/
|
||||
public Long getScore() {
|
||||
return score;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置评分
|
||||
*
|
||||
* @param score 评分
|
||||
*/
|
||||
public void setScore(Long score) {
|
||||
this.score = score;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取原因
|
||||
*
|
||||
* @return reason - 原因
|
||||
*/
|
||||
public String getReason() {
|
||||
return reason;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置原因
|
||||
*
|
||||
* @param reason 原因
|
||||
*/
|
||||
public void setReason(String reason) {
|
||||
this.reason = reason;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取评语
|
||||
*
|
||||
* @return comments - 评语
|
||||
*/
|
||||
public String getComments() {
|
||||
return comments;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置评语
|
||||
*
|
||||
* @param comments 评语
|
||||
*/
|
||||
public void setComments(String comments) {
|
||||
this.comments = comments;
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,13 @@
|
||||
package com.cool.store.entity;
|
||||
|
||||
import io.swagger.models.auth.In;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
import javax.persistence.*;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.cool.store.request;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author byd
|
||||
* @date 2024-04-30 17:30
|
||||
*/
|
||||
@Data
|
||||
public class EmployeeTrainingCommitListRequest {
|
||||
|
||||
@ApiModelProperty("培训结果列表")
|
||||
List<EmployeeTrainingCommitRequest> list;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.cool.store.request;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author byd
|
||||
* @date 2024-04-30 11:10
|
||||
*/
|
||||
@Data
|
||||
public class EmployeeTrainingCommitRequest {
|
||||
|
||||
|
||||
@ApiModelProperty("模版id")
|
||||
private Long templateId;
|
||||
|
||||
@ApiModelProperty("店铺id")
|
||||
private Long shopId;
|
||||
|
||||
@ApiModelProperty("考核人id")
|
||||
private String userDetailId;
|
||||
|
||||
/**
|
||||
* 店铺是否合格
|
||||
*/
|
||||
@ApiModelProperty("店铺是否合格")
|
||||
private Boolean qualified;
|
||||
|
||||
|
||||
}
|
||||
@@ -31,4 +31,14 @@ public class EmployeeTrainingRequest extends PageBasicInfo {
|
||||
|
||||
@ApiModelProperty("门店id列表")
|
||||
private List<String> storeIdList;
|
||||
|
||||
@ApiModelProperty("理论考试状态 0-未开始 1-合格 2-不合格")
|
||||
private Integer theoreticalExamStatus;
|
||||
|
||||
@ApiModelProperty("实操考试状态 0-未开始 1-合格 2-不合格")
|
||||
private Integer practicalExamStatus;
|
||||
|
||||
@ApiModelProperty("带训状态 0-未完成 1-已完成")
|
||||
private Integer assessmentStatus;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
package com.cool.store.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2024/4/25 11:26
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class AssessmentTemplateDataVO {
|
||||
|
||||
@ApiModelProperty("ID")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("数据项id")
|
||||
private Long assessmentDataId;
|
||||
|
||||
/**
|
||||
* 模板类型:0 - 教练员, 1 - 店长, 2 - 店员, 3 - 三方验收
|
||||
*/
|
||||
@ApiModelProperty("模板类型:0 - 教练员, 1 - 店长, 2 - 店员, 3 - 三方验收")
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 模板类别,可为空
|
||||
*/
|
||||
@ApiModelProperty("分类")
|
||||
private String category;
|
||||
|
||||
/**
|
||||
* 模板名称
|
||||
*/
|
||||
@ApiModelProperty("模板名称")
|
||||
private String templateName;
|
||||
|
||||
/**
|
||||
* 模板remark
|
||||
*/
|
||||
@ApiModelProperty("模板remark")
|
||||
private List<String> templateRemarkList;
|
||||
|
||||
/**
|
||||
* 考核项分值
|
||||
*/
|
||||
@ApiModelProperty("考核项分值")
|
||||
private Long score;
|
||||
|
||||
/**
|
||||
* 模板要求明细,包括详细的考核要求描述
|
||||
*/
|
||||
@ApiModelProperty("模板要求明细,包括详细的考核要求描述")
|
||||
private String templateRequirements;
|
||||
|
||||
|
||||
/**
|
||||
* 店铺是否合格
|
||||
*/
|
||||
@ApiModelProperty("店铺是否合格")
|
||||
private Boolean qualified;
|
||||
|
||||
/**
|
||||
* 评分
|
||||
*/
|
||||
@ApiModelProperty("得分")
|
||||
private Long goalScore;
|
||||
|
||||
/**
|
||||
* 原因
|
||||
*/
|
||||
@ApiModelProperty("原因")
|
||||
private String reason;
|
||||
|
||||
/**
|
||||
* 评语
|
||||
*/
|
||||
@ApiModelProperty("评语")
|
||||
private String comments;
|
||||
|
||||
|
||||
}
|
||||
@@ -3,6 +3,8 @@ package com.cool.store.vo;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author byd
|
||||
* @date 2024-04-30 10:53
|
||||
@@ -19,6 +21,9 @@ public class EmployeeTrainingVO {
|
||||
@ApiModelProperty("手机号")
|
||||
private String mobile;
|
||||
|
||||
@ApiModelProperty("身份证号")
|
||||
private String idCard;
|
||||
|
||||
@ApiModelProperty("区域id")
|
||||
private Long regionId;
|
||||
|
||||
@@ -63,4 +68,43 @@ public class EmployeeTrainingVO {
|
||||
|
||||
@ApiModelProperty("大区名称")
|
||||
private String largeRegionName;
|
||||
/**
|
||||
* 实训结束时间
|
||||
*/
|
||||
@ApiModelProperty("实训结束时间")
|
||||
private Date trainingEndTime;
|
||||
|
||||
/**
|
||||
* 实训门店ID
|
||||
*/
|
||||
@ApiModelProperty("实训门店ID")
|
||||
private String trainingStoreId;
|
||||
|
||||
/**
|
||||
* 实训门店ID
|
||||
*/
|
||||
@ApiModelProperty("实训门店名称")
|
||||
private String trainingStoreName;
|
||||
|
||||
/**
|
||||
* 带教老师ID
|
||||
*/
|
||||
@ApiModelProperty("带教老师ID")
|
||||
private String trainingTeacherUserId;
|
||||
|
||||
/**
|
||||
* 带教老师ID
|
||||
*/
|
||||
@ApiModelProperty("带教老师名称")
|
||||
private String trainingTeacherUserName;
|
||||
|
||||
/**
|
||||
* 实操考核人员ID
|
||||
*/
|
||||
@ApiModelProperty("实操考核人员ID")
|
||||
private String practicalAssessmentUserId;
|
||||
|
||||
@ApiModelProperty("实操考核人员名称")
|
||||
private String practicalAssessmentUserName;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
package com.cool.store.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author byd
|
||||
* @date 2024-04-30 10:53
|
||||
*/
|
||||
@Data
|
||||
public class EmployeeUserTrainingVO {
|
||||
|
||||
@ApiModelProperty("id")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("名字")
|
||||
private String username;
|
||||
|
||||
@ApiModelProperty("手机号")
|
||||
private String mobile;
|
||||
|
||||
@ApiModelProperty("身份证号")
|
||||
private String idCard;
|
||||
|
||||
@ApiModelProperty("区域id")
|
||||
private Long regionId;
|
||||
|
||||
@ApiModelProperty("角色id 170000000-店长 180000000-店员")
|
||||
private Long roleId;
|
||||
|
||||
@ApiModelProperty("店铺id")
|
||||
private Long shopId;
|
||||
|
||||
@ApiModelProperty("店铺名称")
|
||||
private Long shopName;
|
||||
|
||||
@ApiModelProperty("培训id")
|
||||
private Long employeeTrainingId;
|
||||
|
||||
@ApiModelProperty("考核项数")
|
||||
private Integer assessmentNum;
|
||||
|
||||
@ApiModelProperty("考核总项数")
|
||||
private Integer assessmentTotalNum;
|
||||
|
||||
@ApiModelProperty("实训开始时间")
|
||||
private Date trainingStartTime;
|
||||
/**
|
||||
* 实训结束时间
|
||||
*/
|
||||
@ApiModelProperty("实训结束时间")
|
||||
private Date trainingEndTime;
|
||||
|
||||
/**
|
||||
* 实训门店ID
|
||||
*/
|
||||
@ApiModelProperty("实训门店ID")
|
||||
private String trainingStoreId;
|
||||
|
||||
/**
|
||||
* 实训门店ID
|
||||
*/
|
||||
@ApiModelProperty("实训门店名称")
|
||||
private String trainingStoreName;
|
||||
|
||||
/**
|
||||
* 带教老师ID
|
||||
*/
|
||||
@ApiModelProperty("带教老师ID")
|
||||
private String trainingTeacherUserId;
|
||||
|
||||
/**
|
||||
* 带教老师ID
|
||||
*/
|
||||
@ApiModelProperty("带教老师名称")
|
||||
private String trainingTeacherUserName;
|
||||
|
||||
|
||||
@ApiModelProperty("培训数据")
|
||||
List<AssessmentTemplateDataVO> templateDataList;
|
||||
|
||||
}
|
||||
@@ -1,11 +1,15 @@
|
||||
package com.cool.store.service;
|
||||
|
||||
import com.cool.store.request.EmployeeTrainingCommitListRequest;
|
||||
import com.cool.store.request.EmployeeTrainingDetailRequest;
|
||||
import com.cool.store.request.EmployeeTrainingRequest;
|
||||
import com.cool.store.vo.EmployeeTrainingDetailVO;
|
||||
import com.cool.store.vo.EmployeeTrainingVO;
|
||||
import com.cool.store.vo.EmployeeUserTrainingVO;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author byd
|
||||
* @date 2024-04-30 10:16
|
||||
@@ -17,4 +21,12 @@ public interface EmployeeTrainingService {
|
||||
EmployeeTrainingDetailVO employeeTrainingDetail(Long id);
|
||||
|
||||
void distribution(EmployeeTrainingDetailRequest request);
|
||||
|
||||
List<EmployeeTrainingVO> trainingListByShopId(Long shopId);
|
||||
|
||||
List<EmployeeTrainingVO> trainerUserList(String userId, Integer status);
|
||||
|
||||
EmployeeUserTrainingVO trainerUserDetail(Long id);
|
||||
|
||||
void trainerUserCommit(EmployeeTrainingCommitListRequest request);
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package com.cool.store.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.cool.store.constants.CommonConstants;
|
||||
import com.cool.store.dao.*;
|
||||
import com.cool.store.entity.EmployeeTrainingDO;
|
||||
import com.cool.store.entity.ShopInfoDO;
|
||||
import com.cool.store.entity.StoreDO;
|
||||
import com.cool.store.entity.TempUserDetailDO;
|
||||
import com.cool.store.entity.*;
|
||||
import com.cool.store.enums.AssessmentTemplateType;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.request.EmployeeTrainingCommitListRequest;
|
||||
import com.cool.store.request.EmployeeTrainingDetailRequest;
|
||||
import com.cool.store.request.EmployeeTrainingRequest;
|
||||
import com.cool.store.service.EmployeeTrainingService;
|
||||
@@ -14,14 +14,19 @@ import com.cool.store.service.RegionService;
|
||||
import com.cool.store.service.SysRoleService;
|
||||
import com.cool.store.service.UserAuthMappingService;
|
||||
import com.cool.store.utils.poi.DateUtils;
|
||||
import com.cool.store.vo.AssessmentTemplateDataVO;
|
||||
import com.cool.store.vo.EmployeeTrainingDetailVO;
|
||||
import com.cool.store.vo.EmployeeTrainingVO;
|
||||
import com.cool.store.vo.EmployeeUserTrainingVO;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
/**
|
||||
* @author byd
|
||||
@@ -57,6 +62,12 @@ public class EmployeeTrainingServiceImpl implements EmployeeTrainingService {
|
||||
@Resource
|
||||
private StoreDao storeDao;
|
||||
|
||||
@Resource
|
||||
private AssessmentTemplateDAO assessmentTemplateDAO;
|
||||
|
||||
@Resource
|
||||
private AssessmentDataDAO assessmentDataDAO;
|
||||
|
||||
@Override
|
||||
public PageInfo<EmployeeTrainingVO> employeeTrainingList(String userId, EmployeeTrainingRequest request) {
|
||||
List<String> authRegionIdList = new ArrayList<>();
|
||||
@@ -66,7 +77,8 @@ public class EmployeeTrainingServiceImpl implements EmployeeTrainingService {
|
||||
PageHelper.startPage(request.getPageNum(), request.getPageSize());
|
||||
List<EmployeeTrainingVO> list = employeeTrainingDAO.employeeTrainingList(request.getKeyWord(), request.getRegionIdList(), authRegionIdList, request.getAssignFlag(),
|
||||
DateUtil.format(new Date(request.getBeginTime()), DateUtils.YYYY_MM_DD_HH_MM_SS),
|
||||
DateUtil.format(new Date(request.getEndTime()), DateUtils.YYYY_MM_DD_HH_MM_SS), null);
|
||||
DateUtil.format(new Date(request.getEndTime()), DateUtils.YYYY_MM_DD_HH_MM_SS), null,
|
||||
request.getTheoreticalExamStatus(), request.getPracticalExamStatus(), request.getAssessmentStatus());
|
||||
|
||||
list.forEach(item -> {
|
||||
Long regionId = item.getRegionId();
|
||||
@@ -124,15 +136,158 @@ public class EmployeeTrainingServiceImpl implements EmployeeTrainingService {
|
||||
return employeeTrainingVO;
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void distribution(EmployeeTrainingDetailRequest request) {
|
||||
TempUserDetailDO tempUserDetailDO = tempUserDetailDAO.selectById(request.getId());
|
||||
|
||||
EnterpriseUserDO enterpriseUserDO = enterpriseUserDAO.getUserInfoByThirdOaUniqueFlag(tempUserDetailDO.getIdCard());
|
||||
|
||||
EmployeeTrainingDO employeeTrainingDO = employeeTrainingDAO.selectByUserDetailId(request.getId());
|
||||
|
||||
if(employeeTrainingDO != null && employeeTrainingDO.getAssignFlag()){
|
||||
if (employeeTrainingDO != null && employeeTrainingDO.getAssignFlag()) {
|
||||
throw new ServiceException("已经分配");
|
||||
}
|
||||
if (employeeTrainingDO == null) {
|
||||
employeeTrainingDO = new EmployeeTrainingDO();
|
||||
}
|
||||
List<AssessmentTemplateDO> assessmentTemplateDOList = assessmentTemplateDAO.listByType(AssessmentTemplateType.TRAINER.getCode());
|
||||
|
||||
employeeTrainingDO.setAssignFlag(true);
|
||||
employeeTrainingDO.setTrainingTeacherUserId(request.getTrainingTeacherUserId());
|
||||
employeeTrainingDO.setTrainingStoreId(request.getTrainingStoreId());
|
||||
employeeTrainingDO.setTrainingStartTime(request.getTrainingStartTime());
|
||||
employeeTrainingDO.setTrainingEndTime(request.getTrainingEndTime());
|
||||
employeeTrainingDO.setPracticalAssessmentUserId(request.getPracticalAssessmentUserId());
|
||||
employeeTrainingDO.setEstimatedAssessmentTime(request.getEstimatedAssessmentTime());
|
||||
employeeTrainingDO.setAssessmentNum(0);
|
||||
employeeTrainingDO.setAssessmentTotalNum(assessmentTemplateDOList.size());
|
||||
if (employeeTrainingDO.getId() == null) {
|
||||
employeeTrainingDO.setXfsgUserDetailId(tempUserDetailDO.getId());
|
||||
employeeTrainingDO.setRegionId(tempUserDetailDO.getRegionId());
|
||||
employeeTrainingDO.setShopId(tempUserDetailDO.getShopId());
|
||||
employeeTrainingDAO.insertSelective(employeeTrainingDO);
|
||||
} else {
|
||||
employeeTrainingDAO.updateByPrimaryKeySelective(employeeTrainingDO);
|
||||
}
|
||||
Long shopId = tempUserDetailDO.getShopId();
|
||||
|
||||
//分配教练员之后初始化实训数据
|
||||
List<AssessmentDataDO> assessmentDataDOList = new ArrayList<>();
|
||||
assessmentTemplateDOList.forEach(assessmentTemplateDO -> {
|
||||
AssessmentDataDO assessmentDataDO = new AssessmentDataDO();
|
||||
assessmentDataDO.setTemplateId(assessmentTemplateDO.getId());
|
||||
assessmentDataDO.setAssessmentUserId(enterpriseUserDO.getUserId());
|
||||
assessmentDataDO.setShopId(shopId);
|
||||
assessmentDataDOList.add(assessmentDataDO);
|
||||
});
|
||||
assessmentDataDAO.batchInsert(assessmentDataDOList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EmployeeTrainingVO> trainingListByShopId(Long shopId) {
|
||||
|
||||
List<EmployeeTrainingVO> list = employeeTrainingDAO.trainingListByShopId(shopId, null, null);
|
||||
list.forEach(item -> {
|
||||
StoreDO storeDO = storeDao.getByStoreId(item.getTrainingStoreId());
|
||||
if (storeDO != null) {
|
||||
item.setTrainingStoreName(storeDO.getStoreName());
|
||||
}
|
||||
});
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EmployeeTrainingVO> trainerUserList(String userId, Integer status) {
|
||||
List<EmployeeTrainingVO> list = employeeTrainingDAO.trainingListByShopId(null, userId, status);
|
||||
list.forEach(item -> {
|
||||
StoreDO storeDO = storeDao.getByStoreId(item.getTrainingStoreId());
|
||||
if (storeDO != null) {
|
||||
item.setTrainingStoreName(storeDO.getStoreName());
|
||||
}
|
||||
});
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EmployeeUserTrainingVO trainerUserDetail(Long id) {
|
||||
EmployeeUserTrainingVO employeeUserTrainingVO = new EmployeeUserTrainingVO();
|
||||
TempUserDetailDO tempUserDetailDO = tempUserDetailDAO.selectById(id);
|
||||
|
||||
EnterpriseUserDO enterpriseUserDO = enterpriseUserDAO.getUserInfoByThirdOaUniqueFlag(tempUserDetailDO.getIdCard());
|
||||
|
||||
EmployeeTrainingDO employeeTrainingDO = employeeTrainingDAO.selectByUserDetailId(id);
|
||||
employeeUserTrainingVO.setEmployeeTrainingId(employeeTrainingDO.getId());
|
||||
employeeUserTrainingVO.setTrainingTeacherUserId(employeeTrainingDO.getTrainingTeacherUserId());
|
||||
employeeUserTrainingVO.setTrainingStoreId(employeeTrainingDO.getTrainingStoreId());
|
||||
employeeUserTrainingVO.setTrainingStartTime(employeeTrainingDO.getTrainingStartTime());
|
||||
employeeUserTrainingVO.setTrainingEndTime(employeeTrainingDO.getTrainingEndTime());
|
||||
employeeUserTrainingVO.setAssessmentNum(employeeTrainingDO.getAssessmentNum());
|
||||
employeeUserTrainingVO.setAssessmentTotalNum(employeeTrainingDO.getAssessmentTotalNum());
|
||||
employeeUserTrainingVO.setMobile(tempUserDetailDO.getMobile());
|
||||
employeeUserTrainingVO.setRoleId(tempUserDetailDO.getRoleId());
|
||||
employeeUserTrainingVO.setIdCard(tempUserDetailDO.getIdCard());
|
||||
List<AssessmentTemplateDO> assessmentTemplateDOList = assessmentTemplateDAO.listByType(AssessmentTemplateType.TRAINER.getCode());
|
||||
|
||||
List<AssessmentDataDO> assessmentDataDOList = assessmentDataDAO.selectList(tempUserDetailDO.getShopId(), enterpriseUserDO.getUserId());
|
||||
|
||||
Map<String, AssessmentDataDO> assessmentDataMap = new HashMap<>();
|
||||
assessmentDataDOList.forEach(item -> {
|
||||
assessmentDataMap.put(item.getTemplateId() + CommonConstants.COLON + item.getAssessmentUserId(), item);
|
||||
});
|
||||
List<AssessmentTemplateDataVO> templateDataVOList = new ArrayList<>();
|
||||
assessmentTemplateDOList.forEach(item -> {
|
||||
AssessmentTemplateDataVO assessmentTemplateDataVO = new AssessmentTemplateDataVO();
|
||||
AssessmentDataDO assessmentDataDO = assessmentDataMap.get(item.getId() + CommonConstants.COLON + enterpriseUserDO.getUserId());
|
||||
if (assessmentDataDO != null) {
|
||||
assessmentTemplateDataVO.setGoalScore(assessmentDataDO.getScore());
|
||||
assessmentTemplateDataVO.setReason(assessmentDataDO.getReason());
|
||||
assessmentTemplateDataVO.setComments(assessmentDataDO.getComments());
|
||||
assessmentTemplateDataVO.setQualified(assessmentDataDO.getQualified());
|
||||
assessmentTemplateDataVO.setAssessmentDataId(assessmentDataDO.getId());
|
||||
}
|
||||
assessmentTemplateDataVO.setScore(item.getScore());
|
||||
assessmentTemplateDataVO.setTemplateName(item.getTemplateName());
|
||||
assessmentTemplateDataVO.setTemplateRemarkList(Arrays.asList(item.getTemplateRemark().split(CommonConstants.COMMA)));
|
||||
assessmentTemplateDataVO.setCategory(item.getCategory());
|
||||
assessmentTemplateDataVO.setId(item.getId());
|
||||
assessmentTemplateDataVO.setType(item.getType());
|
||||
assessmentTemplateDataVO.setTemplateRequirements(item.getTemplateRequirements());
|
||||
templateDataVOList.add(assessmentTemplateDataVO);
|
||||
});
|
||||
employeeUserTrainingVO.setTemplateDataList(templateDataVOList);
|
||||
return employeeUserTrainingVO;
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void trainerUserCommit(EmployeeTrainingCommitListRequest request) {
|
||||
if(CollectionUtils.isEmpty(request.getList())){
|
||||
return;
|
||||
}
|
||||
Long shopId = request.getList().get(0).getShopId();
|
||||
Long userDetailId = request.getList().get(0).getShopId();
|
||||
TempUserDetailDO tempUserDetailDO = tempUserDetailDAO.selectById(userDetailId);
|
||||
EmployeeTrainingDO employeeTrainingDO = employeeTrainingDAO.selectByUserDetailId(userDetailId);
|
||||
|
||||
EnterpriseUserDO enterpriseUserDO = enterpriseUserDAO.getUserInfoByThirdOaUniqueFlag(tempUserDetailDO.getIdCard());
|
||||
String userId = enterpriseUserDO.getUserId();
|
||||
request.getList().forEach(item -> {
|
||||
AssessmentDataDO assessmentDataDO = assessmentDataDAO.selectByTemplateId(item.getTemplateId(), item.getUserDetailId(), item.getShopId());
|
||||
if (assessmentDataDO != null) {
|
||||
assessmentDataDO.setQualified(item.getQualified());
|
||||
assessmentDataDAO.updateByPrimaryKeySelective(assessmentDataDO);
|
||||
} else {
|
||||
assessmentDataDO = new AssessmentDataDO();
|
||||
assessmentDataDO.setTemplateId(item.getTemplateId());
|
||||
assessmentDataDO.setAssessmentUserId(item.getUserDetailId());
|
||||
assessmentDataDO.setShopId(item.getShopId());
|
||||
assessmentDataDO.setQualified(item.getQualified());
|
||||
assessmentDataDAO.insertSelective(assessmentDataDO);
|
||||
}
|
||||
});
|
||||
Integer num = assessmentDataDAO.selectCount(userId, shopId);
|
||||
employeeTrainingDO.setAssessmentNum(num);
|
||||
employeeTrainingDAO.updateByPrimaryKeySelective(employeeTrainingDO);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
package com.cool.store.controller.webb;
|
||||
|
||||
import com.cool.store.context.CurrentUserHolder;
|
||||
import com.cool.store.request.EmployeeTrainingCommitListRequest;
|
||||
import com.cool.store.request.EmployeeTrainingDetailRequest;
|
||||
import com.cool.store.request.EmployeeTrainingRequest;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.service.EmployeeTrainingService;
|
||||
import com.cool.store.vo.EmployeeTrainingDetailVO;
|
||||
import com.cool.store.vo.EmployeeTrainingVO;
|
||||
import com.cool.store.vo.EmployeeUserTrainingVO;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
@@ -15,6 +17,7 @@ import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author byd
|
||||
@@ -37,15 +40,47 @@ public class EmployeeTrainingController {
|
||||
@ApiOperation("员工培训详情")
|
||||
@GetMapping("/employeeTrainingDetail")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "employeeTrainingId", value = "培训id", required = true)
|
||||
@ApiImplicitParam(name = "id", value = "id", required = true)
|
||||
})
|
||||
public ResponseResult<EmployeeTrainingDetailVO> employeeTrainingDetail(@RequestParam("employeeTrainingId") Long employeeTrainingId) {
|
||||
return ResponseResult.success(employeeTrainingService.employeeTrainingDetail(employeeTrainingId));
|
||||
public ResponseResult<EmployeeTrainingDetailVO> employeeTrainingDetail(@RequestParam("id") Long id) {
|
||||
return ResponseResult.success(employeeTrainingService.employeeTrainingDetail(id));
|
||||
}
|
||||
|
||||
@ApiOperation("员工培训--分配")
|
||||
@PostMapping("/distribution")
|
||||
public ResponseResult<EmployeeTrainingDetailVO> distribution(@RequestBody EmployeeTrainingDetailRequest request) {
|
||||
return ResponseResult.success(employeeTrainingService.employeeTrainingDetail(request.getId()));
|
||||
public ResponseResult<Boolean> distribution(@RequestBody EmployeeTrainingDetailRequest request) {
|
||||
employeeTrainingService.distribution(request);
|
||||
return ResponseResult.success(Boolean.TRUE);
|
||||
}
|
||||
|
||||
@ApiOperation("培训进度-列表")
|
||||
@PostMapping("/trainingScheduleList")
|
||||
public ResponseResult<PageInfo<EmployeeTrainingVO>> trainingScheduleList(@RequestBody EmployeeTrainingRequest employeeTrainingRequest) {
|
||||
return ResponseResult.success(employeeTrainingService.employeeTrainingList(CurrentUserHolder.getUserId(), employeeTrainingRequest));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("培训-教练员-员工列表")
|
||||
@PostMapping("/trainerUserList")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "status", value = "带训状态 0-未完成 1-已完成", required = true)
|
||||
})
|
||||
public ResponseResult<List<EmployeeTrainingVO>> trainerUserList(@RequestParam("status") Integer status) {
|
||||
return ResponseResult.success(employeeTrainingService.trainerUserList(CurrentUserHolder.getUserId(), status));
|
||||
}
|
||||
|
||||
@ApiOperation("培训-教练员-员工带训详情")
|
||||
@PostMapping("/trainerUserDetail")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "用户id", required = true)
|
||||
})
|
||||
public ResponseResult<EmployeeUserTrainingVO> trainerUserDetail(Long id) {
|
||||
return ResponseResult.success(employeeTrainingService.trainerUserDetail(id));
|
||||
}
|
||||
|
||||
@ApiOperation("培训-教练员-提交培训")
|
||||
@PostMapping("/trainerUserCommit")
|
||||
public ResponseResult<Boolean> trainerUserCommit(@RequestBody EmployeeTrainingCommitListRequest request) {
|
||||
return ResponseResult.success(Boolean.TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.cool.store.controller.webc;
|
||||
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.service.EmployeeTrainingService;
|
||||
import com.cool.store.vo.EmployeeTrainingVO;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author byd
|
||||
* @date 2024-04-30 10:15
|
||||
*/
|
||||
@Api(tags = "mini员工培训")
|
||||
@RestController
|
||||
@RequestMapping("mini/employeeTraining")
|
||||
public class MiniEmployeeTrainingController {
|
||||
|
||||
@Resource
|
||||
private EmployeeTrainingService employeeTrainingService;
|
||||
|
||||
@ApiOperation("培训员工列表")
|
||||
@PostMapping("/trainingListByShopId")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "shopId", value = "店铺id", required = true)
|
||||
})
|
||||
public ResponseResult<List<EmployeeTrainingVO>> trainingListByShopId(@RequestParam("shopId") Long shopId) {
|
||||
return ResponseResult.success(employeeTrainingService.trainingListByShopId(shopId));
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user