管辖范围考核人员
This commit is contained in:
@@ -61,10 +61,9 @@ public class EmployeeTrainingDAO {
|
|||||||
public List<EmployeeTrainingVO> assessmentUserList(String name, String practicalAssessmentUserId,
|
public List<EmployeeTrainingVO> assessmentUserList(String name, String practicalAssessmentUserId,
|
||||||
Integer assessmentStatus,
|
Integer assessmentStatus,
|
||||||
String estimatedAssessmentBeginTime, String estimatedAssessmentEndTime,
|
String estimatedAssessmentBeginTime, String estimatedAssessmentEndTime,
|
||||||
String actualAssessmentBeginTime, String actualAssessmentEndTime, List<String> storeIdList,
|
String actualAssessmentBeginTime, String actualAssessmentEndTime, List<String> storeIdList) {
|
||||||
List<String> authRegionIdList) {
|
|
||||||
return employeeTrainingMapper.assessmentUserList(name, practicalAssessmentUserId, assessmentStatus, estimatedAssessmentBeginTime,
|
return employeeTrainingMapper.assessmentUserList(name, practicalAssessmentUserId, assessmentStatus, estimatedAssessmentBeginTime,
|
||||||
estimatedAssessmentEndTime, actualAssessmentBeginTime, actualAssessmentEndTime, storeIdList, authRegionIdList);
|
estimatedAssessmentEndTime, actualAssessmentBeginTime, actualAssessmentEndTime, storeIdList);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<EmployeeTrainingDO> theoreticalList() {
|
public List<EmployeeTrainingDO> theoreticalList() {
|
||||||
|
|||||||
@@ -26,5 +26,5 @@ public interface EmployeeTrainingMapper extends Mapper<EmployeeTrainingDO> {
|
|||||||
@Param("assessmentStatus") Integer assessmentStatus,
|
@Param("assessmentStatus") Integer assessmentStatus,
|
||||||
@Param("estimatedAssessmentBeginTime") String estimatedAssessmentBeginTime, @Param("estimatedAssessmentEndTime") String estimatedAssessmentEndTime,
|
@Param("estimatedAssessmentBeginTime") String estimatedAssessmentBeginTime, @Param("estimatedAssessmentEndTime") String estimatedAssessmentEndTime,
|
||||||
@Param("actualAssessmentBeginTime") String actualAssessmentBeginTime, @Param("actualAssessmentEndTime") String actualAssessmentEndTime,
|
@Param("actualAssessmentBeginTime") String actualAssessmentBeginTime, @Param("actualAssessmentEndTime") String actualAssessmentEndTime,
|
||||||
@Param("storeIdList") List<String> storeIdList, @Param("authRegionIdList") List<String> authRegionIdList);
|
@Param("storeIdList") List<String> storeIdList);
|
||||||
}
|
}
|
||||||
@@ -86,6 +86,8 @@ public interface RegionMapper {
|
|||||||
|
|
||||||
List<String> getSubRegionIdsByRegionIds( @Param("regionIds")List<String> regionIds);
|
List<String> getSubRegionIdsByRegionIds( @Param("regionIds")List<String> regionIds);
|
||||||
|
|
||||||
|
List<String> getStoreIdsByRegionIds( @Param("regionIds")List<String> regionIds);
|
||||||
|
|
||||||
List<String> getSubIdsByRegionpaths( @Param("regionPaths")List<String> regionPaths);
|
List<String> getSubIdsByRegionpaths( @Param("regionPaths")List<String> regionPaths);
|
||||||
|
|
||||||
List<String> getRegionPathByRegionIds( @Param("regionIds")List<String> regionIds);
|
List<String> getRegionPathByRegionIds( @Param("regionIds")List<String> regionIds);
|
||||||
|
|||||||
@@ -181,9 +181,7 @@
|
|||||||
left join xfsg_employee_training e on e.xfsg_user_detail_id = u.id
|
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
|
left join xfsg_shop_info s on s.id = u.shop_id
|
||||||
where u.deleted = 0
|
where u.deleted = 0
|
||||||
<if test="practicalAssessmentUserId != null and practicalAssessmentUserId != ''">
|
|
||||||
and e.practical_assessment_user_id = #{practicalAssessmentUserId}
|
|
||||||
</if>
|
|
||||||
<if test="assessmentStatus != null">
|
<if test="assessmentStatus != null">
|
||||||
and e.assessment_status = #{assessmentStatus}
|
and e.assessment_status = #{assessmentStatus}
|
||||||
</if>
|
</if>
|
||||||
@@ -202,17 +200,19 @@
|
|||||||
<if test="name != null and name != ''">
|
<if test="name != null and name != ''">
|
||||||
and u.username like concat('%',#{name},'%')
|
and u.username like concat('%',#{name},'%')
|
||||||
</if>
|
</if>
|
||||||
<if test="storeIdList != null and storeIdList.size() > 0">
|
<if test="practicalAssessmentUserId != null and practicalAssessmentUserId != '' and storeIdList != null and storeIdList.size() > 0">
|
||||||
|
and (e.practical_assessment_user_id = #{practicalAssessmentUserId}
|
||||||
|
or e.training_store_id in
|
||||||
|
<foreach collection="storeIdList" item="item" index="index" open="(" separator="," close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
<if test="practicalAssessmentUserId == null and storeIdList != null and storeIdList.size() > 0">
|
||||||
and e.training_store_id in
|
and e.training_store_id in
|
||||||
<foreach collection="storeIdList" item="item" index="index" open="(" separator="," close=")">
|
<foreach collection="storeIdList" item="item" index="index" open="(" separator="," close=")">
|
||||||
#{item}
|
#{item}
|
||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</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>
|
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -285,6 +285,17 @@
|
|||||||
<foreach collection="regionIds" separator=" or " open="(" close=")" item="region" > region_path like concat("%", #{region}, "%")</foreach>
|
<foreach collection="regionIds" separator=" or " open="(" close=")" item="region" > region_path like concat("%", #{region}, "%")</foreach>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getStoreIdsByRegionIds" resultType="string">
|
||||||
|
select
|
||||||
|
store_id
|
||||||
|
from
|
||||||
|
region_${enterpriseId}
|
||||||
|
where
|
||||||
|
deleted = 0
|
||||||
|
and
|
||||||
|
<foreach collection="regionIds" separator=" or " open="(" close=")" item="region" > region_path like concat("%", #{region}, "%")</foreach>
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="getSubIdsByRegionpaths" resultType="string">
|
<select id="getSubIdsByRegionpaths" resultType="string">
|
||||||
select
|
select
|
||||||
id
|
id
|
||||||
|
|||||||
@@ -29,6 +29,13 @@ public interface UserAuthMappingService {
|
|||||||
*/
|
*/
|
||||||
List<String> getAuthRegionIdAndSubRegionIdByUserId(String userId);
|
List<String> getAuthRegionIdAndSubRegionIdByUserId(String userId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取用户授权的所有门店id
|
||||||
|
* @param userId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<String> getAuthStoreIdAndSubRegionIdByUserId(String userId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 提供 根据职位 意向区域 查 对应人的接口 同时返回人名字
|
* 提供 根据职位 意向区域 查 对应人的接口 同时返回人名字
|
||||||
* @param userRoleEnum
|
* @param userRoleEnum
|
||||||
|
|||||||
@@ -431,18 +431,27 @@ public class EmployeeTrainingServiceImpl implements EmployeeTrainingService {
|
|||||||
@Override
|
@Override
|
||||||
public PageInfo<EmployeeTrainingVO> assessmentUserList(String userId, EmployeeAssessmentRequest request) {
|
public PageInfo<EmployeeTrainingVO> assessmentUserList(String userId, EmployeeAssessmentRequest request) {
|
||||||
|
|
||||||
List<String> authRegionIdList = new ArrayList<>();
|
List<String> requestStoreIdList = request.getStoreIdList();
|
||||||
if (StringUtils.isNotBlank(userId) && !sysRoleService.checkIsAdmin(userId)) {
|
Boolean isAdmin = sysRoleService.checkIsAdmin(userId);
|
||||||
authRegionIdList = userAuthMappingService.getAuthRegionIdAndSubRegionIdByUserId(userId);
|
if (CollectionUtils.isEmpty(requestStoreIdList) && StringUtils.isNotBlank(userId) && !isAdmin) {
|
||||||
|
requestStoreIdList = userAuthMappingService.getAuthStoreIdAndSubRegionIdByUserId(userId);
|
||||||
|
if(CollectionUtils.isEmpty(requestStoreIdList)){
|
||||||
|
return new PageInfo<>();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
String practicalAssessmentUserId = userId;
|
||||||
|
//空意味着管理员
|
||||||
|
if(isAdmin){
|
||||||
|
practicalAssessmentUserId = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
PageHelper.startPage(request.getPageNum(), request.getPageSize());
|
PageHelper.startPage(request.getPageNum(), request.getPageSize());
|
||||||
List<EmployeeTrainingVO> employeeTrainingVOList = employeeTrainingDAO
|
List<EmployeeTrainingVO> employeeTrainingVOList = employeeTrainingDAO
|
||||||
.assessmentUserList(request.getName(), userId, request.getAssessmentStatus(),
|
.assessmentUserList(request.getName(), practicalAssessmentUserId, request.getAssessmentStatus(),
|
||||||
DateUtils.parseLongDateToStr(request.getEstimatedAssessmentBeginTime()),
|
DateUtils.parseLongDateToStr(request.getEstimatedAssessmentBeginTime()),
|
||||||
DateUtils.parseLongDateToStr(request.getEstimatedAssessmentEndTime()),
|
DateUtils.parseLongDateToStr(request.getEstimatedAssessmentEndTime()),
|
||||||
DateUtils.parseLongDateToStr(request.getActualAssessmentBeginTime()),
|
DateUtils.parseLongDateToStr(request.getActualAssessmentBeginTime()),
|
||||||
DateUtils.parseLongDateToStr(request.getActualAssessmentEndTime()), request.getStoreIdList(), authRegionIdList);
|
DateUtils.parseLongDateToStr(request.getActualAssessmentEndTime()), requestStoreIdList);
|
||||||
if (CollectionUtils.isEmpty(employeeTrainingVOList)) {
|
if (CollectionUtils.isEmpty(employeeTrainingVOList)) {
|
||||||
return new PageInfo<>(employeeTrainingVOList);
|
return new PageInfo<>(employeeTrainingVOList);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,6 +79,20 @@ public class UserAuthMappingServiceImpl implements UserAuthMappingService {
|
|||||||
return regionIds;
|
return regionIds;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> getAuthStoreIdAndSubRegionIdByUserId(String userId){
|
||||||
|
List<UserAuthMappingDO> userAuthMapping = listUserAuthMappingByUserId(userId);
|
||||||
|
if(CollectionUtils.isEmpty(userAuthMapping)){
|
||||||
|
return Lists.newArrayList();
|
||||||
|
}
|
||||||
|
List<String> regionIds = userAuthMapping.stream().map(UserAuthMappingDO::getMappingId).collect(Collectors.toList());
|
||||||
|
List<String> subRegionIds = regionMapper.getStoreIdsByRegionIds(regionIds);
|
||||||
|
if(CollectionUtils.isNotEmpty(subRegionIds)){
|
||||||
|
regionIds.addAll(subRegionIds);
|
||||||
|
}
|
||||||
|
return regionIds;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 提供 根据职位 意向区域 查 对应人的接口 同时返回人名字
|
* 提供 根据职位 意向区域 查 对应人的接口 同时返回人名字
|
||||||
* @param userRoleEnum
|
* @param userRoleEnum
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ public class EmployeeTrainingController {
|
|||||||
@ApiOperation("培训-战区经理-考核员工列表")
|
@ApiOperation("培训-战区经理-考核员工列表")
|
||||||
@PostMapping("/assessmentUserList")
|
@PostMapping("/assessmentUserList")
|
||||||
public ResponseResult<PageInfo<EmployeeTrainingVO>> assessmentUserList(@RequestBody EmployeeAssessmentRequest request) {
|
public ResponseResult<PageInfo<EmployeeTrainingVO>> assessmentUserList(@RequestBody EmployeeAssessmentRequest request) {
|
||||||
return ResponseResult.success(employeeTrainingService.assessmentUserList(null, request));
|
return ResponseResult.success(employeeTrainingService.assessmentUserList(CurrentUserHolder.getUserId(), request));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("培训-督导-考核员工列表")
|
@ApiOperation("培训-督导-考核员工列表")
|
||||||
|
|||||||
Reference in New Issue
Block a user