员工培训
This commit is contained in:
@@ -2,10 +2,8 @@ package com.cool.store.dao;
|
||||
|
||||
import com.cool.store.entity.AssessmentDataDO;
|
||||
import com.cool.store.mapper.AssessmentDataMapper;
|
||||
import com.sun.org.apache.xpath.internal.operations.Bool;
|
||||
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;
|
||||
@@ -43,7 +41,6 @@ public class AssessmentDataDAO {
|
||||
public List<AssessmentDataDO> selectList(Long shopId, String userId, List<Long> templateIdList) {
|
||||
Example example = new Example(AssessmentDataDO.class);
|
||||
example.createCriteria().andEqualTo("assessmentUserId", userId).andEqualTo("shopId", shopId).andIn("templateId", templateIdList);
|
||||
|
||||
return assessmentDataMapper.selectByExample(example);
|
||||
}
|
||||
|
||||
@@ -79,4 +76,9 @@ public class AssessmentDataDAO {
|
||||
assessmentDataMapper.deleteByShopId(shopId);
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
public void batchInsertDO(List<AssessmentDataDO> assessmentDataDOList) {
|
||||
assessmentDataMapper.batchInsert(assessmentDataDOList);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -12,4 +12,6 @@ public interface AssessmentDataMapper extends Mapper<AssessmentDataDO> {
|
||||
|
||||
List<AssessmentDataDO> selectListByShopId(@Param("shopId") Long shopId);
|
||||
Boolean deleteByShopId(@Param("shopId") Long shopId);
|
||||
|
||||
Integer batchInsert(@Param("assessmentDataList") List<AssessmentDataDO> assessmentDataList);
|
||||
}
|
||||
@@ -14,6 +14,15 @@
|
||||
<result column="reason" jdbcType="VARCHAR" property="reason" />
|
||||
<result column="comments" jdbcType="VARCHAR" property="comments" />
|
||||
</resultMap>
|
||||
<insert id="batchInsert">
|
||||
insert into xfsg_assessment_data (template_id, shop_id,
|
||||
assessment_user_id)
|
||||
values
|
||||
<foreach collection="assessmentDataList" item="item" separator=",">
|
||||
( #{item.templateId}, #{item.shopId},
|
||||
#{item.assessmentUserId})
|
||||
</foreach>
|
||||
</insert>
|
||||
<update id="batchUpdate">
|
||||
update xfsg_assessment_data
|
||||
<set>
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
<result column="template_remark" jdbcType="VARCHAR" property="templateRemark" />
|
||||
<result column="score" jdbcType="BIGINT" property="score" />
|
||||
<result column="template_requirements" jdbcType="LONGVARCHAR" property="templateRequirements" />
|
||||
<result column="check_type" jdbcType="VARCHAR" property="checkType" />
|
||||
</resultMap>
|
||||
|
||||
|
||||
|
||||
@@ -45,8 +45,14 @@
|
||||
e.theoretical_exam_score as theoreticalExamScore,
|
||||
e.practical_exam_status as practicalExamStatus,
|
||||
e.practical_exam_score as practicalExamScore,
|
||||
e.assessment_status as assessmentStatus
|
||||
|
||||
e.assessment_status as assessmentStatus,
|
||||
e.training_teacher_user_id as trainingTeacherUserId,
|
||||
e.practical_assessment_user_id as practicalAssessmentUserId,
|
||||
e.training_start_time as trainingStartTime,
|
||||
e.training_end_time as trainingEndTime,
|
||||
e.training_store_id as trainingStoreId,
|
||||
e.estimated_assessment_time as estimatedAssessmentTime,
|
||||
e.actual_assessment_time as actualAssessmentTime
|
||||
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
|
||||
|
||||
@@ -55,4 +55,8 @@ public class AssessmentDataDO {
|
||||
*/
|
||||
private String comments;
|
||||
|
||||
private String picture;
|
||||
|
||||
private String video;
|
||||
|
||||
}
|
||||
@@ -1,7 +1,10 @@
|
||||
package com.cool.store.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.persistence.*;
|
||||
|
||||
@Data
|
||||
@Table(name = "xfsg_assessment_template")
|
||||
public class AssessmentTemplateDO {
|
||||
@Id
|
||||
@@ -41,125 +44,6 @@ public class AssessmentTemplateDO {
|
||||
@Column(name = "template_requirements")
|
||||
private String templateRequirements;
|
||||
|
||||
/**
|
||||
* @return id
|
||||
*/
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param id
|
||||
*/
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取模板类型:0 - 教练员, 1 - 店长, 2 - 店员, 3 - 三方验收
|
||||
*
|
||||
* @return type - 模板类型:0 - 教练员, 1 - 店长, 2 - 店员, 3 - 三方验收
|
||||
*/
|
||||
public Integer getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置模板类型:0 - 教练员, 1 - 店长, 2 - 店员, 3 - 三方验收
|
||||
*
|
||||
* @param type 模板类型:0 - 教练员, 1 - 店长, 2 - 店员, 3 - 三方验收
|
||||
*/
|
||||
public void setType(Integer type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取模板类别,可为空
|
||||
*
|
||||
* @return category - 模板类别,可为空
|
||||
*/
|
||||
public String getCategory() {
|
||||
return category;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置模板类别,可为空
|
||||
*
|
||||
* @param category 模板类别,可为空
|
||||
*/
|
||||
public void setCategory(String category) {
|
||||
this.category = category;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取模板名称
|
||||
*
|
||||
* @return template_name - 模板名称
|
||||
*/
|
||||
public String getTemplateName() {
|
||||
return templateName;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置模板名称
|
||||
*
|
||||
* @param templateName 模板名称
|
||||
*/
|
||||
public void setTemplateName(String templateName) {
|
||||
this.templateName = templateName;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取模板remark
|
||||
*
|
||||
* @return template_remark - 模板remark
|
||||
*/
|
||||
public String getTemplateRemark() {
|
||||
return templateRemark;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置模板remark
|
||||
*
|
||||
* @param templateRemark 模板remark
|
||||
*/
|
||||
public void setTemplateRemark(String templateRemark) {
|
||||
this.templateRemark = templateRemark;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取考核项分值
|
||||
*
|
||||
* @return score - 考核项分值
|
||||
*/
|
||||
public Long getScore() {
|
||||
return score;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置考核项分值
|
||||
*
|
||||
* @param score 考核项分值
|
||||
*/
|
||||
public void setScore(Long score) {
|
||||
this.score = score;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取模板要求明细,包括详细的考核要求描述
|
||||
*
|
||||
* @return template_requirements - 模板要求明细,包括详细的考核要求描述
|
||||
*/
|
||||
public String getTemplateRequirements() {
|
||||
return templateRequirements;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置模板要求明细,包括详细的考核要求描述
|
||||
*
|
||||
* @param templateRequirements 模板要求明细,包括详细的考核要求描述
|
||||
*/
|
||||
public void setTemplateRequirements(String templateRequirements) {
|
||||
this.templateRequirements = templateRequirements;
|
||||
}
|
||||
@Column(name = "check_type")
|
||||
private String checkType;
|
||||
}
|
||||
@@ -24,4 +24,10 @@ public class EmployeeAssessmentCommitRequest {
|
||||
|
||||
@ApiModelProperty("评语")
|
||||
private String comments;
|
||||
|
||||
@ApiModelProperty("图片")
|
||||
private String picture;
|
||||
|
||||
@ApiModelProperty("视频")
|
||||
private String video;
|
||||
}
|
||||
|
||||
@@ -12,6 +12,9 @@ import java.util.List;
|
||||
@Data
|
||||
public class EmployeeTrainingCommitListRequest {
|
||||
|
||||
@ApiModelProperty("员工id")
|
||||
private Long userDetailId;
|
||||
|
||||
@ApiModelProperty("培训结果列表")
|
||||
List<EmployeeTrainingCommitRequest> list;
|
||||
}
|
||||
|
||||
@@ -80,5 +80,12 @@ public class AssessmentTemplateDataVO {
|
||||
@ApiModelProperty("评语")
|
||||
private String comments;
|
||||
|
||||
@ApiModelProperty("考核方式")
|
||||
private String checkType;
|
||||
|
||||
@ApiModelProperty("图片")
|
||||
private String picture;
|
||||
|
||||
@ApiModelProperty("视频")
|
||||
private String video;
|
||||
}
|
||||
|
||||
@@ -70,6 +70,12 @@ public class EmployeeTrainingVO {
|
||||
@ApiModelProperty("实训结束时间")
|
||||
private Date trainingEndTime;
|
||||
|
||||
/**
|
||||
* 实训结束时间
|
||||
*/
|
||||
@ApiModelProperty("实训开始时间")
|
||||
private Date trainingStartTime;
|
||||
|
||||
/**
|
||||
* 实训门店ID
|
||||
*/
|
||||
|
||||
@@ -35,7 +35,7 @@ public class EmployeeUserTrainingVO {
|
||||
private Long shopId;
|
||||
|
||||
@ApiModelProperty("店铺名称")
|
||||
private Long shopName;
|
||||
private String shopName;
|
||||
|
||||
@ApiModelProperty("培训id")
|
||||
private Long employeeTrainingId;
|
||||
|
||||
@@ -81,10 +81,29 @@ public class EmployeeTrainingServiceImpl implements EmployeeTrainingService {
|
||||
|
||||
List<Long> regionIds = list.stream().map(EmployeeTrainingVO::getRegionId).distinct().collect(Collectors.toList());
|
||||
|
||||
List<String> storeIdList = list.stream().map(EmployeeTrainingVO::getTrainingStoreId).distinct().collect(Collectors.toList());
|
||||
|
||||
List<StoreDO> storeDOList = storeDAO.getEffectiveStoreByStoreIds(storeIdList);
|
||||
Map<String, String> storeNameMap = storeDOList.stream().collect(Collectors.toMap(StoreDO::getStoreId, StoreDO::getStoreName));
|
||||
|
||||
List<String> userIdList = list.stream().map(EmployeeTrainingVO::getTrainingTeacherUserId).distinct().collect(Collectors.toList());
|
||||
|
||||
|
||||
List<String> practicalUserIdList = list.stream().map(EmployeeTrainingVO::getPracticalAssessmentUserId).distinct().collect(Collectors.toList());
|
||||
|
||||
if (CollectionUtils.isNotEmpty(practicalUserIdList)) {
|
||||
userIdList.addAll(practicalUserIdList);
|
||||
}
|
||||
|
||||
Map<String, String> userNameMap = enterpriseUserDAO.getUserNameMap(userIdList);
|
||||
|
||||
Map<Long, String> regionNameMap = regionService.getBelongWarRegionNameMap(regionIds);
|
||||
|
||||
list.forEach(item -> {
|
||||
item.setRegionNodeName(regionNameMap.get(item.getRegionId()));
|
||||
item.setTrainingStoreName(storeNameMap.get(item.getTrainingStoreId()));
|
||||
item.setTrainingTeacherUserName(userNameMap.get(item.getTrainingTeacherUserId()));
|
||||
item.setPracticalAssessmentUserName(userNameMap.get(item.getPracticalAssessmentUserId()));
|
||||
});
|
||||
return new PageInfo<>(list);
|
||||
}
|
||||
@@ -179,7 +198,7 @@ public class EmployeeTrainingServiceImpl implements EmployeeTrainingService {
|
||||
assessmentDataDO.setShopId(shopId);
|
||||
assessmentDataDOList.add(assessmentDataDO);
|
||||
});
|
||||
assessmentDataDAO.batchInsert(assessmentDataDOList);
|
||||
assessmentDataDAO.batchInsertDO(assessmentDataDOList);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -207,6 +226,9 @@ public class EmployeeTrainingServiceImpl implements EmployeeTrainingService {
|
||||
@Override
|
||||
public List<EmployeeTrainingVO> trainerUserList(String userId, Integer status) {
|
||||
List<EmployeeTrainingVO> list = employeeTrainingDAO.trainingListByShopId(null, userId, status);
|
||||
if(CollectionUtils.isEmpty(list)){
|
||||
return list;
|
||||
}
|
||||
List<String> storeIdList = list.stream().map(EmployeeTrainingVO::getTrainingStoreId).collect(Collectors.toList());
|
||||
List<StoreDO> storeDOList = storeDAO.getEffectiveStoreByStoreIds(storeIdList);
|
||||
Map<String, String> storeNameMap = storeDOList.stream().collect(Collectors.toMap(StoreDO::getStoreId, StoreDO::getStoreName));
|
||||
@@ -239,6 +261,20 @@ public class EmployeeTrainingServiceImpl implements EmployeeTrainingService {
|
||||
employeeUserTrainingVO.setMobile(tempUserDetailDO.getMobile());
|
||||
employeeUserTrainingVO.setRoleId(tempUserDetailDO.getRoleId());
|
||||
employeeUserTrainingVO.setIdCard(tempUserDetailDO.getIdCard());
|
||||
employeeUserTrainingVO.setId(tempUserDetailDO.getId());
|
||||
employeeUserTrainingVO.setUsername(tempUserDetailDO.getUsername());
|
||||
employeeUserTrainingVO.setRegionId(tempUserDetailDO.getRegionId());
|
||||
employeeUserTrainingVO.setShopId(tempUserDetailDO.getShopId());
|
||||
ShopInfoDO shopInfoDO = shopInfoDAO.getShopInfo(tempUserDetailDO.getShopId());
|
||||
if(shopInfoDO != null){
|
||||
employeeUserTrainingVO.setShopName(shopInfoDO.getShopName());
|
||||
}
|
||||
StoreDO storeDO = storeDAO.getByStoreId(employeeTrainingDO.getTrainingStoreId());
|
||||
if(storeDO != null){
|
||||
employeeUserTrainingVO.setTrainingStoreName(storeDO.getStoreName());
|
||||
}
|
||||
|
||||
employeeUserTrainingVO.setTrainingTeacherUserName(enterpriseUserDAO.getUserName(employeeTrainingDO.getTrainingTeacherUserId()));
|
||||
List<AssessmentTemplateDO> assessmentTemplateDOList = assessmentTemplateDAO.listByType(AssessmentTemplateType.TRAINER.getCode());
|
||||
List<Long> templateIdList = assessmentTemplateDOList.stream().map(AssessmentTemplateDO::getId).collect(Collectors.toList());
|
||||
|
||||
@@ -280,8 +316,8 @@ public class EmployeeTrainingServiceImpl implements EmployeeTrainingService {
|
||||
if (CollectionUtils.isEmpty(request.getList())) {
|
||||
return;
|
||||
}
|
||||
Long shopId = request.getList().get(0).getShopId();
|
||||
Long userDetailId = request.getList().get(0).getShopId();
|
||||
|
||||
Long userDetailId = request.getUserDetailId();
|
||||
TempUserDetailDO tempUserDetailDO = tempUserDetailDAO.selectById(userDetailId);
|
||||
EmployeeTrainingDO employeeTrainingDO = employeeTrainingDAO.selectByUserDetailId(userDetailId);
|
||||
|
||||
@@ -300,13 +336,13 @@ public class EmployeeTrainingServiceImpl implements EmployeeTrainingService {
|
||||
} else {
|
||||
assessmentDataDO = new AssessmentDataDO();
|
||||
assessmentDataDO.setTemplateId(item.getTemplateId());
|
||||
assessmentDataDO.setAssessmentUserId(item.getUserDetailId());
|
||||
assessmentDataDO.setAssessmentUserId(userId);
|
||||
assessmentDataDO.setShopId(item.getShopId());
|
||||
assessmentDataDO.setQualified(item.getQualified());
|
||||
assessmentDataDAO.insertSelective(assessmentDataDO);
|
||||
}
|
||||
});
|
||||
Integer num = assessmentDataDAO.selectCount(userId, shopId);
|
||||
Integer num = assessmentDataDAO.selectCount(userId, tempUserDetailDO.getShopId());
|
||||
employeeTrainingDO.setAssessmentNum(num);
|
||||
if (num.equals(employeeTrainingDO.getAssessmentTotalNum())) {
|
||||
employeeTrainingDO.setAssessmentStatus(1);
|
||||
@@ -396,6 +432,8 @@ public class EmployeeTrainingServiceImpl implements EmployeeTrainingService {
|
||||
assessmentTemplateDataVO.setComments(assessmentDataDO.getComments());
|
||||
assessmentTemplateDataVO.setQualified(assessmentDataDO.getQualified());
|
||||
assessmentTemplateDataVO.setAssessmentDataId(assessmentDataDO.getId());
|
||||
assessmentTemplateDataVO.setPicture(assessmentDataDO.getPicture());
|
||||
assessmentTemplateDataVO.setVideo(assessmentDataDO.getVideo());
|
||||
}
|
||||
assessmentTemplateDataVO.setScore(item.getScore());
|
||||
assessmentTemplateDataVO.setTemplateName(item.getTemplateName());
|
||||
@@ -405,6 +443,7 @@ public class EmployeeTrainingServiceImpl implements EmployeeTrainingService {
|
||||
assessmentTemplateDataVO.setType(item.getType());
|
||||
assessmentTemplateDataVO.setCategory(item.getCategory());
|
||||
assessmentTemplateDataVO.setTemplateRequirements(item.getTemplateRequirements());
|
||||
assessmentTemplateDataVO.setCheckType(item.getCheckType());
|
||||
templateDataVOList.add(assessmentTemplateDataVO);
|
||||
});
|
||||
assessmentUserTrainingVO.setTemplateDataList(templateDataVOList);
|
||||
|
||||
@@ -62,9 +62,9 @@ public class EmployeeTrainingController {
|
||||
@ApiOperation("培训-教练员-员工列表")
|
||||
@PostMapping("/trainerUserList")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "status", value = "带训状态 0-未完成 1-已完成", required = true)
|
||||
@ApiImplicitParam(name = "status", value = "带训状态 0-未完成 1-已完成")
|
||||
})
|
||||
public ResponseResult<List<EmployeeTrainingVO>> trainerUserList(@RequestParam("status") Integer status) {
|
||||
public ResponseResult<List<EmployeeTrainingVO>> trainerUserList(@RequestParam(value = "status", required = false) Integer status) {
|
||||
return ResponseResult.success(employeeTrainingService.trainerUserList(CurrentUserHolder.getUserId(), status));
|
||||
}
|
||||
|
||||
|
||||
@@ -3,12 +3,14 @@ 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.*;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user