培训
This commit is contained in:
@@ -1,10 +1,13 @@
|
||||
package com.cool.store.dao;
|
||||
|
||||
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.springframework.stereotype.Repository;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author byd
|
||||
@@ -16,4 +19,20 @@ public class EmployeeTrainingDAO {
|
||||
|
||||
@Resource
|
||||
private EmployeeTrainingMapper employeeTrainingMapper;
|
||||
|
||||
public List<EmployeeTrainingVO> employeeTrainingList(String keyWord, List<String> regionIdList,
|
||||
List<String> authRegionIdList, Boolean assignFlag,
|
||||
String beginTime, String endTime, List<Long> shopIdList) {
|
||||
|
||||
return employeeTrainingMapper.employeeTrainingMapper(keyWord, regionIdList, authRegionIdList, assignFlag, beginTime, endTime, shopIdList);
|
||||
}
|
||||
|
||||
public EmployeeTrainingDO selectById(Long id) {
|
||||
|
||||
return employeeTrainingMapper.selectByPrimaryKey(id);
|
||||
}
|
||||
|
||||
public EmployeeTrainingDO selectByUserDetailId(Long userDetailId) {
|
||||
return employeeTrainingMapper.selectOne(EmployeeTrainingDO.builder().xfsgUserDetailId(userDetailId).build());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,15 @@
|
||||
package com.cool.store.mapper;
|
||||
|
||||
import com.cool.store.entity.EmployeeTrainingDO;
|
||||
import com.cool.store.vo.EmployeeTrainingVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
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);
|
||||
}
|
||||
@@ -1,31 +1,83 @@
|
||||
<?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.cool.store.mapper.EmployeeTrainingMapper">
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.entity.EmployeeTrainingDO">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
-->
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="shop_id" jdbcType="BIGINT" property="shopId" />
|
||||
<result column="region_id" jdbcType="BIGINT" property="regionId" />
|
||||
<result column="xfsg_user_detail_id" jdbcType="BIGINT" property="xfsgUserDetailId" />
|
||||
<result column="assign_flag" jdbcType="TINYINT" property="assignFlag" />
|
||||
<result column="training_start_time" jdbcType="TIMESTAMP" property="trainingStartTime" />
|
||||
<result column="training_end_time" jdbcType="TIMESTAMP" property="trainingEndTime" />
|
||||
<result column="training_store_id" jdbcType="VARCHAR" property="trainingStoreId" />
|
||||
<result column="training_teacher_user_id" jdbcType="VARCHAR" property="trainingTeacherUserId" />
|
||||
<result column="practical_assessment_user_id" jdbcType="VARCHAR" property="practicalAssessmentUserId" />
|
||||
<result column="estimated_assessment_time" jdbcType="TIMESTAMP" property="estimatedAssessmentTime" />
|
||||
<result column="actual_assessment_time" jdbcType="TIMESTAMP" property="actualAssessmentTime" />
|
||||
<result column="assessment_num" jdbcType="INTEGER" property="assessmentNum" />
|
||||
<result column="assessment_total_num" jdbcType="INTEGER" property="assessmentTotalNum" />
|
||||
<result column="theoretical_exam_status" jdbcType="TINYINT" property="theoreticalExamStatus" />
|
||||
<result column="theoretical_exam_score" jdbcType="INTEGER" property="theoreticalExamScore" />
|
||||
<result column="practical_exam_status" jdbcType="TINYINT" property="practicalExamStatus" />
|
||||
<result column="practical_exam_score" jdbcType="INTEGER" property="practicalExamScore" />
|
||||
<result column="assessment_status" jdbcType="TINYINT" property="assessmentStatus" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
<result column="deleted" jdbcType="BIT" property="deleted" />
|
||||
</resultMap>
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.entity.EmployeeTrainingDO">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
-->
|
||||
<id column="id" jdbcType="BIGINT" property="id"/>
|
||||
<result column="shop_id" jdbcType="BIGINT" property="shopId"/>
|
||||
<result column="region_id" jdbcType="BIGINT" property="regionId"/>
|
||||
<result column="xfsg_user_detail_id" jdbcType="BIGINT" property="xfsgUserDetailId"/>
|
||||
<result column="assign_flag" jdbcType="TINYINT" property="assignFlag"/>
|
||||
<result column="training_start_time" jdbcType="TIMESTAMP" property="trainingStartTime"/>
|
||||
<result column="training_end_time" jdbcType="TIMESTAMP" property="trainingEndTime"/>
|
||||
<result column="training_store_id" jdbcType="VARCHAR" property="trainingStoreId"/>
|
||||
<result column="training_teacher_user_id" jdbcType="VARCHAR" property="trainingTeacherUserId"/>
|
||||
<result column="practical_assessment_user_id" jdbcType="VARCHAR" property="practicalAssessmentUserId"/>
|
||||
<result column="estimated_assessment_time" jdbcType="TIMESTAMP" property="estimatedAssessmentTime"/>
|
||||
<result column="actual_assessment_time" jdbcType="TIMESTAMP" property="actualAssessmentTime"/>
|
||||
<result column="assessment_num" jdbcType="INTEGER" property="assessmentNum"/>
|
||||
<result column="assessment_total_num" jdbcType="INTEGER" property="assessmentTotalNum"/>
|
||||
<result column="theoretical_exam_status" jdbcType="TINYINT" property="theoreticalExamStatus"/>
|
||||
<result column="theoretical_exam_score" jdbcType="INTEGER" property="theoreticalExamScore"/>
|
||||
<result column="practical_exam_status" jdbcType="TINYINT" property="practicalExamStatus"/>
|
||||
<result column="practical_exam_score" jdbcType="INTEGER" property="practicalExamScore"/>
|
||||
<result column="assessment_status" jdbcType="TINYINT" property="assessmentStatus"/>
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
|
||||
<result column="deleted" jdbcType="BIT" property="deleted"/>
|
||||
</resultMap>
|
||||
<select id="employeeTrainingMapper" 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,
|
||||
e.id as employeeTrainingId,
|
||||
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="keyWord != null and keyWord != ''">
|
||||
and (u.username like concat('%',#{keyWord},'%') or u.mobile like concat('%',#{keyWord},'%'))
|
||||
</if>
|
||||
<if test="regionIdList != null and regionIdList.size() > 0">
|
||||
and u.region_id in
|
||||
<foreach collection="regionIdList" item="item" index="index" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="authRegionIdList != null and authRegionIdList.size() > 0">
|
||||
and u.region_id in
|
||||
<foreach collection="authRegionIdList" item="item" index="index" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="assignFlag != null">
|
||||
and e.assign_flag = #{assignFlag}
|
||||
</if>
|
||||
<if test="beginTime != null and beginTime != ''">
|
||||
and e.register_time >= #{beginTime}
|
||||
</if>
|
||||
<if test="endTime != null and endTime != ''">
|
||||
and e.register_time <= #{endTime}
|
||||
</if>
|
||||
<if test="shopIdList != null and shopIdList.size() > 0">
|
||||
and u.shop_id in
|
||||
<foreach collection="shopIdList" item="item" index="index" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -39,7 +39,7 @@ public class EmployeeTrainingDO {
|
||||
* 是否分配 0-待分配 1-已分配
|
||||
*/
|
||||
@Column(name = "assign_flag")
|
||||
private Byte assignFlag;
|
||||
private Boolean assignFlag;
|
||||
|
||||
/**
|
||||
* 实训开始时间
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.cool.store.request;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author byd
|
||||
* @date 2024-04-30 10:53
|
||||
*/
|
||||
@Data
|
||||
public class EmployeeTrainingDetailRequest {
|
||||
|
||||
@ApiModelProperty("id")
|
||||
private Long id;
|
||||
/**
|
||||
* 实训开始时间
|
||||
*/
|
||||
@ApiModelProperty("实训开始时间")
|
||||
private Date trainingStartTime;
|
||||
|
||||
/**
|
||||
* 实训结束时间
|
||||
*/
|
||||
@ApiModelProperty("实训结束时间")
|
||||
private Date trainingEndTime;
|
||||
|
||||
/**
|
||||
* 实训门店ID
|
||||
*/
|
||||
@ApiModelProperty("实训门店ID")
|
||||
private String trainingStoreId;
|
||||
|
||||
|
||||
/**
|
||||
* 带教老师ID
|
||||
*/
|
||||
@ApiModelProperty("带教老师ID")
|
||||
private String trainingTeacherUserId;
|
||||
|
||||
|
||||
/**
|
||||
* 实操考核人员ID
|
||||
*/
|
||||
@ApiModelProperty("实操考核人员ID")
|
||||
private String practicalAssessmentUserId;
|
||||
|
||||
|
||||
/**
|
||||
* 预计考核时间
|
||||
*/
|
||||
@ApiModelProperty("预计考核时间")
|
||||
private Date estimatedAssessmentTime;
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.cool.store.request;
|
||||
|
||||
import com.cool.store.common.PageBasicInfo;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author byd
|
||||
* @date 2024-04-30 11:10
|
||||
*/
|
||||
@Data
|
||||
public class EmployeeTrainingRequest extends PageBasicInfo {
|
||||
|
||||
|
||||
@ApiModelProperty("姓名或者手机号")
|
||||
private String keyWord;
|
||||
|
||||
@ApiModelProperty("区域id列表")
|
||||
private List<String> regionIdList;
|
||||
|
||||
@ApiModelProperty("是否分配 0-待分配 1-已分配")
|
||||
private Boolean assignFlag;
|
||||
|
||||
@ApiModelProperty("开始时间")
|
||||
private Long beginTime;
|
||||
|
||||
@ApiModelProperty("结束时间")
|
||||
private Long endTime;
|
||||
|
||||
@ApiModelProperty("门店id列表")
|
||||
private List<String> storeIdList;
|
||||
}
|
||||
@@ -0,0 +1,159 @@
|
||||
package com.cool.store.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author byd
|
||||
* @date 2024-04-30 10:53
|
||||
*/
|
||||
@Data
|
||||
public class EmployeeTrainingDetailVO {
|
||||
|
||||
@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 String roleId;
|
||||
|
||||
@ApiModelProperty("店铺id")
|
||||
private Long shopId;
|
||||
|
||||
@ApiModelProperty("店铺名称")
|
||||
private String shopName;
|
||||
|
||||
@ApiModelProperty("培训id")
|
||||
private Long employeeTrainingId;
|
||||
|
||||
|
||||
@ApiModelProperty("战区名称")
|
||||
private String regionName;
|
||||
|
||||
@ApiModelProperty("大区ID")
|
||||
private Long largeRegionId;
|
||||
|
||||
@ApiModelProperty("大区名称")
|
||||
private String largeRegionName;
|
||||
|
||||
/**
|
||||
* 实训开始时间
|
||||
*/
|
||||
@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;
|
||||
|
||||
/**
|
||||
* 实操考核人员ID
|
||||
*/
|
||||
@ApiModelProperty("实操考核人员ID")
|
||||
private String practicalAssessmentUserId;
|
||||
|
||||
@ApiModelProperty("实操考核人员名称")
|
||||
private String practicalAssessmentUserName;
|
||||
|
||||
/**
|
||||
* 预计考核时间
|
||||
*/
|
||||
@ApiModelProperty("预计考核时间")
|
||||
private Date estimatedAssessmentTime;
|
||||
|
||||
/**
|
||||
* 实际考核时间
|
||||
*/
|
||||
@ApiModelProperty("实际考核时间")
|
||||
private Date actualAssessmentTime;
|
||||
|
||||
/**
|
||||
* 是否分配 0-待分配 1-已分配
|
||||
*/
|
||||
@ApiModelProperty("是否分配 0-待分配 1-已分配")
|
||||
private Boolean assignFlag;
|
||||
|
||||
/**
|
||||
* 考核项数
|
||||
*/
|
||||
@ApiModelProperty("考核项数")
|
||||
private Integer assessmentNum;
|
||||
|
||||
/**
|
||||
* 考核总项数
|
||||
*/
|
||||
@ApiModelProperty("考核总项数")
|
||||
private Integer assessmentTotalNum;
|
||||
|
||||
/**
|
||||
* 理论考试状态 0-未开始 1-合格 2-不合格
|
||||
*/
|
||||
@ApiModelProperty("理论考试状态 0-未开始 1-合格 2-不合格")
|
||||
private Byte theoreticalExamStatus;
|
||||
|
||||
/**
|
||||
* 理论考试分值
|
||||
*/
|
||||
@ApiModelProperty("理论考试分值")
|
||||
private Integer theoreticalExamScore;
|
||||
|
||||
/**
|
||||
* 实操考试状态 0-未开始 1-合格 2-不合格
|
||||
*/
|
||||
@ApiModelProperty("实操考试状态 0-未开始 1-合格 2-不合格")
|
||||
private Byte practicalExamStatus;
|
||||
|
||||
/**
|
||||
* 实操考试分值
|
||||
*/
|
||||
@ApiModelProperty("实操考试分值")
|
||||
private Integer practicalExamScore;
|
||||
|
||||
/**
|
||||
* 考核状态 0-培训中 1-带考核 2-考核通过 3-考核不通过
|
||||
*/
|
||||
@ApiModelProperty("考核状态 0-培训中 1-带考核 2-考核通过 3-考核不通过")
|
||||
private Byte assessmentStatus;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package com.cool.store.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author byd
|
||||
* @date 2024-04-30 10:53
|
||||
*/
|
||||
@Data
|
||||
public class EmployeeTrainingVO {
|
||||
|
||||
@ApiModelProperty("id")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("名字")
|
||||
private String username;
|
||||
|
||||
@ApiModelProperty("手机号")
|
||||
private String mobile;
|
||||
|
||||
@ApiModelProperty("区域id")
|
||||
private Long regionId;
|
||||
|
||||
@ApiModelProperty("角色id 170000000-店长 180000000-店员")
|
||||
private String roleId;
|
||||
|
||||
@ApiModelProperty("店铺id")
|
||||
private Long shopId;
|
||||
|
||||
@ApiModelProperty("店铺名称")
|
||||
private Long shopName;
|
||||
|
||||
@ApiModelProperty("培训id")
|
||||
private Long employeeTrainingId;
|
||||
|
||||
@ApiModelProperty("考核项数")
|
||||
private Integer assessmentNum;
|
||||
|
||||
@ApiModelProperty("考核总项数")
|
||||
private Integer assessmentTotalNum;
|
||||
|
||||
@ApiModelProperty("理论考试状态 0-未开始 1-合格 2-不合格")
|
||||
private Integer theoreticalExamStatus;
|
||||
|
||||
@ApiModelProperty("理论考试分值")
|
||||
private Integer theoreticalExamScore;
|
||||
|
||||
@ApiModelProperty("实操考试状态 0-未开始 1-合格 2-不合格")
|
||||
private Integer practicalExamStatus;
|
||||
|
||||
@ApiModelProperty("实操考试分值")
|
||||
private Integer practicalExamScore;
|
||||
|
||||
@ApiModelProperty("考核状态 0-培训中 1-带考核 2-考核通过 3-考核不通过")
|
||||
private Integer assessmentStatus;
|
||||
|
||||
@ApiModelProperty("战区名称")
|
||||
private String regionName;
|
||||
|
||||
@ApiModelProperty("大区ID")
|
||||
private Long largeRegionId;
|
||||
|
||||
@ApiModelProperty("大区名称")
|
||||
private String largeRegionName;
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package com.cool.store.vo;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -20,4 +21,10 @@ public class TempUserDetailListVO {
|
||||
|
||||
@ApiModelProperty("店铺code")
|
||||
private String storeNum;
|
||||
|
||||
/**
|
||||
* 店铺子阶段状态
|
||||
*/
|
||||
@ApiModelProperty("店铺子阶段状态")
|
||||
private Integer shopSubStageStatus;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.cool.store.service;
|
||||
|
||||
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.github.pagehelper.PageInfo;
|
||||
|
||||
/**
|
||||
* @author byd
|
||||
* @date 2024-04-30 10:16
|
||||
*/
|
||||
public interface EmployeeTrainingService {
|
||||
|
||||
PageInfo<EmployeeTrainingVO> employeeTrainingList(String userId, EmployeeTrainingRequest request);
|
||||
|
||||
EmployeeTrainingDetailVO employeeTrainingDetail(Long id);
|
||||
|
||||
void distribution(EmployeeTrainingDetailRequest request);
|
||||
}
|
||||
@@ -22,4 +22,6 @@ public interface TempUserDetailService {
|
||||
TempUserDetailInfoVO getUserInfoByIdUserDetailId(Long id);
|
||||
|
||||
StaffBaseInfoDTO getUserInfoByIdCard(String idCard);
|
||||
|
||||
void registrationCompleted(Long shopId);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,138 @@
|
||||
package com.cool.store.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
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.exception.ServiceException;
|
||||
import com.cool.store.request.EmployeeTrainingDetailRequest;
|
||||
import com.cool.store.request.EmployeeTrainingRequest;
|
||||
import com.cool.store.service.EmployeeTrainingService;
|
||||
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.EmployeeTrainingDetailVO;
|
||||
import com.cool.store.vo.EmployeeTrainingVO;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @author byd
|
||||
* @date 2024-04-30 10:16
|
||||
*/
|
||||
@Service
|
||||
public class EmployeeTrainingServiceImpl implements EmployeeTrainingService {
|
||||
|
||||
@Resource
|
||||
private SysRoleService sysRoleService;
|
||||
|
||||
@Resource
|
||||
private UserAuthMappingService userAuthMappingService;
|
||||
|
||||
@Resource
|
||||
private EmployeeTrainingDAO employeeTrainingDAO;
|
||||
|
||||
@Resource
|
||||
private RegionService regionService;
|
||||
|
||||
@Resource
|
||||
private RegionDao regionDao;
|
||||
|
||||
@Resource
|
||||
private TempUserDetailDAO tempUserDetailDAO;
|
||||
|
||||
@Resource
|
||||
private ShopInfoDAO shopInfoDAO;
|
||||
|
||||
@Resource
|
||||
private EnterpriseUserDAO enterpriseUserDAO;
|
||||
|
||||
@Resource
|
||||
private StoreDao storeDao;
|
||||
|
||||
@Override
|
||||
public PageInfo<EmployeeTrainingVO> employeeTrainingList(String userId, EmployeeTrainingRequest request) {
|
||||
List<String> authRegionIdList = new ArrayList<>();
|
||||
if (!sysRoleService.checkIsAdmin(userId)) {
|
||||
authRegionIdList = userAuthMappingService.getAuthRegionIdAndSubRegionIdByUserId(userId);
|
||||
}
|
||||
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);
|
||||
|
||||
list.forEach(item -> {
|
||||
Long regionId = item.getRegionId();
|
||||
Long bigRegionIdByAreaId = regionService.getBigRegionIdByAreaId(item.getRegionId());
|
||||
Map<Long, String> regionNameMap = regionDao.getRegionNameMap(Arrays.asList(bigRegionIdByAreaId, item.getRegionId()));
|
||||
item.setRegionName(regionNameMap.get(item.getRegionId()));
|
||||
item.setLargeRegionId(bigRegionIdByAreaId);
|
||||
item.setLargeRegionName(regionNameMap.get(bigRegionIdByAreaId));
|
||||
});
|
||||
return new PageInfo<>(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EmployeeTrainingDetailVO employeeTrainingDetail(Long id) {
|
||||
TempUserDetailDO tempUserDetailDO = tempUserDetailDAO.selectById(id);
|
||||
|
||||
EmployeeTrainingDO employeeTrainingDO = employeeTrainingDAO.selectByUserDetailId(id);
|
||||
|
||||
EmployeeTrainingDetailVO employeeTrainingVO = new EmployeeTrainingDetailVO();
|
||||
employeeTrainingVO.setId(employeeTrainingDO.getId());
|
||||
employeeTrainingVO.setRegionId(employeeTrainingDO.getRegionId());
|
||||
employeeTrainingVO.setTrainingStartTime(employeeTrainingDO.getTrainingStartTime());
|
||||
employeeTrainingVO.setTrainingEndTime(employeeTrainingDO.getTrainingEndTime());
|
||||
employeeTrainingVO.setTrainingStoreId(employeeTrainingDO.getTrainingStoreId());
|
||||
StoreDO storeDO = storeDao.getByStoreId(employeeTrainingDO.getTrainingStoreId());
|
||||
if (storeDO != null) {
|
||||
employeeTrainingVO.setTrainingStoreName(storeDO.getStoreName());
|
||||
}
|
||||
employeeTrainingVO.setTrainingTeacherUserId(employeeTrainingDO.getTrainingTeacherUserId());
|
||||
employeeTrainingVO.setTrainingTeacherUserName(enterpriseUserDAO.getUserName(employeeTrainingDO.getTrainingTeacherUserId()));
|
||||
employeeTrainingVO.setAssessmentStatus(employeeTrainingDO.getAssessmentStatus());
|
||||
employeeTrainingVO.setAssessmentNum(employeeTrainingDO.getAssessmentNum());
|
||||
employeeTrainingVO.setAssessmentTotalNum(employeeTrainingDO.getAssessmentTotalNum());
|
||||
employeeTrainingVO.setTheoreticalExamStatus(employeeTrainingDO.getTheoreticalExamStatus());
|
||||
employeeTrainingVO.setTheoreticalExamScore(employeeTrainingDO.getTheoreticalExamScore());
|
||||
employeeTrainingVO.setPracticalExamStatus(employeeTrainingDO.getPracticalExamStatus());
|
||||
employeeTrainingVO.setPracticalExamScore(employeeTrainingDO.getPracticalExamScore());
|
||||
employeeTrainingVO.setEstimatedAssessmentTime(employeeTrainingDO.getEstimatedAssessmentTime());
|
||||
employeeTrainingVO.setActualAssessmentTime(employeeTrainingDO.getActualAssessmentTime());
|
||||
employeeTrainingVO.setPracticalAssessmentUserId(employeeTrainingDO.getPracticalAssessmentUserId());
|
||||
employeeTrainingVO.setPracticalAssessmentUserName(enterpriseUserDAO.getUserName(employeeTrainingDO.getPracticalAssessmentUserId()));
|
||||
employeeTrainingVO.setAssignFlag(employeeTrainingDO.getAssignFlag());
|
||||
employeeTrainingVO.setShopId(employeeTrainingDO.getShopId());
|
||||
ShopInfoDO shopInfoDO = shopInfoDAO.getShopInfo(employeeTrainingDO.getShopId());
|
||||
employeeTrainingVO.setShopName(shopInfoDO.getShopName());
|
||||
Long bigRegionIdByAreaId = regionService.getBigRegionIdByAreaId(employeeTrainingDO.getRegionId());
|
||||
Map<Long, String> regionNameMap = regionDao.getRegionNameMap(Arrays.asList(bigRegionIdByAreaId, employeeTrainingDO.getRegionId()));
|
||||
employeeTrainingVO.setRegionName(regionNameMap.get(employeeTrainingDO.getRegionId()));
|
||||
employeeTrainingVO.setLargeRegionId(bigRegionIdByAreaId);
|
||||
employeeTrainingVO.setLargeRegionName(regionNameMap.get(bigRegionIdByAreaId));
|
||||
employeeTrainingVO.setRegionId(employeeTrainingDO.getRegionId());
|
||||
employeeTrainingVO.setMobile(tempUserDetailDO.getMobile());
|
||||
employeeTrainingVO.setUsername(tempUserDetailDO.getUsername());
|
||||
employeeTrainingVO.setIdCard(tempUserDetailDO.getIdCard());
|
||||
return employeeTrainingVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void distribution(EmployeeTrainingDetailRequest request) {
|
||||
TempUserDetailDO tempUserDetailDO = tempUserDetailDAO.selectById(request.getId());
|
||||
|
||||
EmployeeTrainingDO employeeTrainingDO = employeeTrainingDAO.selectByUserDetailId(request.getId());
|
||||
|
||||
if(employeeTrainingDO != null && employeeTrainingDO.getAssignFlag()){
|
||||
throw new ServiceException("已经分配");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -2,12 +2,16 @@ package com.cool.store.service.impl;
|
||||
|
||||
import com.cool.store.dao.EnterpriseUserDAO;
|
||||
import com.cool.store.dao.ShopInfoDAO;
|
||||
import com.cool.store.dao.ShopStageInfoDAO;
|
||||
import com.cool.store.dao.TempUserDetailDAO;
|
||||
import com.cool.store.dto.ehr.StaffBaseInfoDTO;
|
||||
import com.cool.store.entity.EnterpriseUserDO;
|
||||
import com.cool.store.entity.ShopInfoDO;
|
||||
import com.cool.store.entity.ShopStageInfoDO;
|
||||
import com.cool.store.entity.TempUserDetailDO;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.enums.point.ShopSubStageEnum;
|
||||
import com.cool.store.enums.point.ShopSubStageStatusEnum;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.request.TempUserDetailRequest;
|
||||
import com.cool.store.service.TempUserDetailService;
|
||||
@@ -21,10 +25,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @author byd
|
||||
@@ -45,6 +46,9 @@ public class TempUserDetailServiceImpl implements TempUserDetailService {
|
||||
@Autowired
|
||||
private XfsgEhrService xfsgEhrService;
|
||||
|
||||
@Autowired
|
||||
private ShopStageInfoDAO shopStageInfoDAO;
|
||||
|
||||
@Override
|
||||
public TempUserDetailListVO userList(Long shopId) {
|
||||
List<TempUserDetailDO> tempUserDetailDOList = tempUserDetailDAO.userList(shopId);
|
||||
@@ -73,6 +77,10 @@ public class TempUserDetailServiceImpl implements TempUserDetailService {
|
||||
tempUserDetailListVO.setUserList(resultList);
|
||||
tempUserDetailListVO.setShopId(shopId);
|
||||
tempUserDetailListVO.setStoreNum(shopInfoDO.getStoreNum());
|
||||
ShopStageInfoDO shopStageInfoDO = shopStageInfoDAO.getShopSubStageInfo(shopId, ShopSubStageEnum.SHOP_STAGE_5);
|
||||
if(shopStageInfoDO != null){
|
||||
tempUserDetailListVO.setShopSubStageStatus(shopStageInfoDO.getShopSubStageStatus());
|
||||
}
|
||||
return tempUserDetailListVO;
|
||||
}
|
||||
|
||||
@@ -151,4 +159,13 @@ public class TempUserDetailServiceImpl implements TempUserDetailService {
|
||||
return xfsgEhrService.getUserInfoByCode(enterpriseUserDO.getJobnumber());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registrationCompleted(Long shopId) {
|
||||
ShopStageInfoDO shopStageInfoDO = shopStageInfoDAO.getShopSubStageInfo(shopId, ShopSubStageEnum.SHOP_STAGE_5);
|
||||
if(shopStageInfoDO != null){
|
||||
shopStageInfoDO.setShopSubStageStatus(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_51.getShopSubStageStatus());
|
||||
shopStageInfoDAO.batchUpdate(Collections.singletonList(shopStageInfoDO));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.cool.store.controller.webb;
|
||||
|
||||
import com.cool.store.context.CurrentUserHolder;
|
||||
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.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 javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @author byd
|
||||
* @date 2024-04-30 10:15
|
||||
*/
|
||||
@Api(tags = "员工培训")
|
||||
@RestController
|
||||
@RequestMapping("pc/employeeTraining")
|
||||
public class EmployeeTrainingController {
|
||||
|
||||
@Resource
|
||||
private EmployeeTrainingService employeeTrainingService;
|
||||
|
||||
@ApiOperation("待巡员工列表")
|
||||
@PostMapping("/employeeTrainingList")
|
||||
public ResponseResult<PageInfo<EmployeeTrainingVO>> employeeTrainingList(@RequestBody EmployeeTrainingRequest employeeTrainingRequest) {
|
||||
return ResponseResult.success(employeeTrainingService.employeeTrainingList(CurrentUserHolder.getUserId(), employeeTrainingRequest));
|
||||
}
|
||||
|
||||
@ApiOperation("员工培训详情")
|
||||
@GetMapping("/employeeTrainingDetail")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "employeeTrainingId", value = "培训id", required = true)
|
||||
})
|
||||
public ResponseResult<EmployeeTrainingDetailVO> employeeTrainingDetail(@RequestParam("employeeTrainingId") Long employeeTrainingId) {
|
||||
return ResponseResult.success(employeeTrainingService.employeeTrainingDetail(employeeTrainingId));
|
||||
}
|
||||
|
||||
@ApiOperation("员工培训--分配")
|
||||
@PostMapping("/distribution")
|
||||
public ResponseResult<EmployeeTrainingDetailVO> distribution(@RequestBody EmployeeTrainingDetailRequest request) {
|
||||
return ResponseResult.success(employeeTrainingService.employeeTrainingDetail(request.getId()));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user