fix
This commit is contained in:
parent
e1f1b4eeb7
commit
53ed800463
@ -63,5 +63,5 @@ public interface DepartmentsStaffRelateDao extends BaseMapper<DepartmentsStaffRe
|
|||||||
|
|
||||||
List<ReportProgressListDto> getDepartmentNameByStaffIds(@Param("staffIds") List<String> staffIds);
|
List<ReportProgressListDto> getDepartmentNameByStaffIds(@Param("staffIds") List<String> staffIds);
|
||||||
|
|
||||||
|
List<String> selectStaffIdsByDepartments(@Param("deparmentIds")List<String> deparmentIds);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -31,4 +31,6 @@ public interface StaffOccupationDao extends BaseMapper<StaffOccupationEntity> {
|
|||||||
void updateAllOccupation();
|
void updateAllOccupation();
|
||||||
|
|
||||||
void updateStatusByStaff(Long staffId, DepartmentStaffBo departmentStaffBo);
|
void updateStatusByStaff(Long staffId, DepartmentStaffBo departmentStaffBo);
|
||||||
|
|
||||||
|
List<String> removeDimissionStaffByStaffIds(@Param("staffIds") List<String> staffIds);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -40,5 +40,7 @@ public interface DepartmentsStaffRelateService extends IService<DepartmentsStaff
|
|||||||
DepartmentsStaffRelateEntity selectDepartmentByDepartmentId(String departmentId);
|
DepartmentsStaffRelateEntity selectDepartmentByDepartmentId(String departmentId);
|
||||||
|
|
||||||
DepartmentsStaffRelateEntity selectByStaffId(Long staffId);
|
DepartmentsStaffRelateEntity selectByStaffId(Long staffId);
|
||||||
|
|
||||||
|
List<String> selectStaffIdsByDepartments(List<String> deparmentIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -31,5 +31,7 @@ public interface StaffOccupationService extends IService<StaffOccupationEntity>
|
|||||||
void updateAllOccupation();
|
void updateAllOccupation();
|
||||||
|
|
||||||
void updateStatusByStaff(Long staffId, DepartmentStaffBo departmentStaffBo);
|
void updateStatusByStaff(Long staffId, DepartmentStaffBo departmentStaffBo);
|
||||||
|
|
||||||
|
List<String> removeDimissionStaffByStaffIds(List<String> staffIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -3,8 +3,10 @@ package com.lz.modules.app.service.impl;
|
|||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import com.lz.common.utils.StringUtil;
|
import com.lz.common.utils.StringUtil;
|
||||||
import com.lz.modules.job.model.responseBo.DepartmentStaffBo;
|
import com.lz.modules.job.model.responseBo.DepartmentStaffBo;
|
||||||
|
import org.apache.commons.collections.CollectionUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@ -90,4 +92,12 @@ public class DepartmentsStaffRelateServiceImpl extends ServiceImpl<DepartmentsSt
|
|||||||
public DepartmentsStaffRelateEntity selectByStaffId(Long staffId) {
|
public DepartmentsStaffRelateEntity selectByStaffId(Long staffId) {
|
||||||
return departmentsStaffRelateDao.selectByStaffId(staffId);
|
return departmentsStaffRelateDao.selectByStaffId(staffId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> selectStaffIdsByDepartments(List<String> deparmentIds) {
|
||||||
|
if(CollectionUtils.isEmpty(deparmentIds)){
|
||||||
|
return Collections.EMPTY_LIST;
|
||||||
|
}
|
||||||
|
return departmentsStaffRelateDao.selectStaffIdsByDepartments(deparmentIds);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,9 +10,12 @@ import com.lz.modules.app.dao.StaffOccupationDao;
|
|||||||
import com.lz.modules.app.entity.StaffOccupationEntity;
|
import com.lz.modules.app.entity.StaffOccupationEntity;
|
||||||
import com.lz.modules.app.service.StaffOccupationService;
|
import com.lz.modules.app.service.StaffOccupationService;
|
||||||
import com.lz.modules.job.model.responseBo.DepartmentStaffBo;
|
import com.lz.modules.job.model.responseBo.DepartmentStaffBo;
|
||||||
|
import org.apache.commons.collections.CollectionUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@ -62,4 +65,11 @@ public class StaffOccupationServiceImpl extends ServiceImpl<StaffOccupationDao,
|
|||||||
staffOccupationDao.updateStatusByStaff(staffId, departmentStaffBo);
|
staffOccupationDao.updateStatusByStaff(staffId, departmentStaffBo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> removeDimissionStaffByStaffIds(List<String> staffIds) {
|
||||||
|
if(CollectionUtils.isEmpty(staffIds)){
|
||||||
|
return Collections.EMPTY_LIST;
|
||||||
|
}
|
||||||
|
return staffOccupationDao.removeDimissionStaffByStaffIds(staffIds);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,6 +23,7 @@ import org.springframework.stereotype.Service;
|
|||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
@ -411,24 +412,13 @@ public class StaffServiceImpl extends ServiceImpl<StaffDao, StaffEntity> impleme
|
|||||||
return Lists.newArrayList();
|
return Lists.newArrayList();
|
||||||
}
|
}
|
||||||
//获取所有人员
|
//获取所有人员
|
||||||
List<DepartmentsStaffRelateEntity> list = departmentsStaffRelateService.list(new QueryWrapper<DepartmentsStaffRelateEntity>()
|
List<String> list = departmentsStaffRelateService.selectStaffIdsByDepartments(deparmentIds);
|
||||||
.select("staff_id")
|
|
||||||
.eq("is_delete", 0)
|
|
||||||
.in("department_id", deparmentIds));
|
|
||||||
if(CollectionUtils.isEmpty(list)){
|
if(CollectionUtils.isEmpty(list)){
|
||||||
return Lists.newArrayList();
|
return Lists.newArrayList();
|
||||||
}
|
}
|
||||||
//获取人员个数去重
|
//获取人员个数去重, 去除离职
|
||||||
List<String> staffs = list.stream().map(e -> e.getStaffId() + "").collect(Collectors.toList());
|
List<String> data = staffOccupationService.removeDimissionStaffByStaffIds(list);
|
||||||
staffs.removeIf(s -> {
|
return new ArrayList<>(new HashSet(data));
|
||||||
StaffOccupationInfoDto occupationByStaffId = staffOccupationService.getOccupationByStaffId(Long.valueOf(s));
|
|
||||||
if(occupationByStaffId==null || "1".equals(occupationByStaffId.getStaffStatus())){
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
List<String> staffdistincts = staffs.stream().distinct().collect(Collectors.toList());
|
|
||||||
return staffdistincts;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||||||
import com.lz.common.utils.ISelect;
|
import com.lz.common.utils.ISelect;
|
||||||
import com.lz.common.utils.PageUtils;
|
import com.lz.common.utils.PageUtils;
|
||||||
import com.lz.common.utils.R;
|
import com.lz.common.utils.R;
|
||||||
|
import com.lz.modules.app.service.StaffOccupationService;
|
||||||
import com.lz.modules.app.service.StaffService;
|
import com.lz.modules.app.service.StaffService;
|
||||||
import com.lz.modules.flow.dao.EvaluationGroupMapper;
|
import com.lz.modules.flow.dao.EvaluationGroupMapper;
|
||||||
import com.lz.modules.flow.entity.EvaluationGroup;
|
import com.lz.modules.flow.entity.EvaluationGroup;
|
||||||
@ -33,6 +34,8 @@ public class EvaluationGroupServiceImpl extends ServiceImpl<EvaluationGroupMappe
|
|||||||
private EvaluationGroupMapper evaluationGroupMapper;
|
private EvaluationGroupMapper evaluationGroupMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private StaffService staffService;
|
private StaffService staffService;
|
||||||
|
@Autowired
|
||||||
|
private StaffOccupationService staffOccupationService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -102,7 +105,9 @@ public class EvaluationGroupServiceImpl extends ServiceImpl<EvaluationGroupMappe
|
|||||||
String[] split = outIds.split(",");
|
String[] split = outIds.split(",");
|
||||||
depStaffIds.removeAll(Arrays.asList(split));
|
depStaffIds.removeAll(Arrays.asList(split));
|
||||||
}
|
}
|
||||||
//去重
|
List<String> distDepStaffIds = new ArrayList<>(new HashSet(depStaffIds));
|
||||||
return new ArrayList<>(new HashSet(depStaffIds));
|
//去除离职
|
||||||
|
List<String> data = staffOccupationService.removeDimissionStaffByStaffIds(distDepStaffIds);
|
||||||
|
return data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,18 +0,0 @@
|
|||||||
package com.lz.modules.performance.res;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: djc
|
|
||||||
* @Desc:
|
|
||||||
* @Date: 2020/10/20 15:54
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
public class AssessListRes {
|
|
||||||
//考核名称
|
|
||||||
private String name;
|
|
||||||
//时间周期
|
|
||||||
private String cycleTime;
|
|
||||||
//组人员
|
|
||||||
private String groupNum;
|
|
||||||
}
|
|
||||||
@ -343,7 +343,7 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="countNumByScoreLevel" resultType="com.lz.modules.performance.res.ChartStatistical">
|
<select id="countNumByScoreLevel" resultType="com.lz.modules.performance.res.ChartStatistical">
|
||||||
SELECT count(score_level) num,score_level as 'desc' from lz_result_record where is_delete=0 GROUP BY score_level
|
SELECT count(score_level) num,CASE score_level WHEN '0' THEN '无等级' ELSE score_level END as 'desc' from lz_result_record where is_delete=0 GROUP BY score_level
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectResultRankList" resultType="com.lz.modules.performance.res.ResultRankListRes">
|
<select id="selectResultRankList" resultType="com.lz.modules.performance.res.ResultRankListRes">
|
||||||
|
|||||||
@ -94,4 +94,13 @@
|
|||||||
</foreach>
|
</foreach>
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectStaffIdsByDepartments" resultType="String">
|
||||||
|
SELECT staff_id from lz_departments_staff_relate where is_delete = 0 and
|
||||||
|
department_id in
|
||||||
|
<foreach collection="deparmentIds" item="department_id" open="(" close=")"
|
||||||
|
separator=",">
|
||||||
|
#{department_id}
|
||||||
|
</foreach>
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@ -59,4 +59,13 @@
|
|||||||
update lz_staff_occupation set staff_status=#{departmentStaffBo.status},resignation_time=null, position=#{departmentStaffBo.position}, staff_no=#{departmentStaffBo.employeeNo} where is_delete=0 and staff_id = #{staffId}
|
update lz_staff_occupation set staff_status=#{departmentStaffBo.status},resignation_time=null, position=#{departmentStaffBo.position}, staff_no=#{departmentStaffBo.employeeNo} where is_delete=0 and staff_id = #{staffId}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<select id="removeDimissionStaffByStaffIds" resultType="String">
|
||||||
|
SELECT staff_id from lz_staff_occupation where staff_status = 0 and
|
||||||
|
staff_id in
|
||||||
|
<foreach collection="staffIds" item="staff_id" open="(" close=")"
|
||||||
|
separator=",">
|
||||||
|
#{staff_id}
|
||||||
|
</foreach>
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user