外部人员
This commit is contained in:
parent
32b1a2db48
commit
a61b7ac7bc
|
|
@ -36,6 +36,8 @@ public class SalaryArchiveListDTO {
|
|||
@TableTitle(title = "人员信息表的主键id", dataIndex = "employeeId", key = "employeeId")
|
||||
private Long employeeId;
|
||||
|
||||
private Integer employeeType;
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -80,4 +80,9 @@ public class SalaryArchiveQueryParam extends BaseQueryParam {
|
|||
//列表类型:PENDING:待定薪;FIXED:发薪;SUSPEND:待停薪;STOP:停薪"
|
||||
private SalaryArchiveListTypeEnum listType;
|
||||
|
||||
/**
|
||||
* 是否是外部系统档案
|
||||
*/
|
||||
private boolean extSalaryArchiveList;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,6 +51,13 @@ public interface SalaryArchiveMapper {
|
|||
*/
|
||||
List<SalaryArchiveListDTO> list(@Param("param") SalaryArchiveQueryParam param);
|
||||
|
||||
/**
|
||||
* 外部人员
|
||||
* @param queryParam
|
||||
* @return
|
||||
*/
|
||||
List<SalaryArchiveListDTO> listExtSalaryArchive(@Param("param")SalaryArchiveQueryParam queryParam);
|
||||
|
||||
|
||||
/**
|
||||
* 批量插入
|
||||
|
|
@ -122,4 +129,6 @@ public interface SalaryArchiveMapper {
|
|||
void deletePendingTodo(@Param("ids") Collection<Long> ids);
|
||||
|
||||
void deleteSuspendTodo(@Param("ids") Collection<Long> ids);
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -327,6 +327,95 @@
|
|||
</if>
|
||||
</select>
|
||||
|
||||
<!-- 薪资档案列表 -->
|
||||
<select id="listExtSalaryArchive" resultType="com.engine.salary.entity.salaryarchive.dto.SalaryArchiveListDTO">
|
||||
SELECT
|
||||
t
|
||||
.
|
||||
id
|
||||
, t.employee_id
|
||||
, t.create_time
|
||||
, t.update_time
|
||||
, t.creator
|
||||
, t.delete_type
|
||||
, t.tenant_key
|
||||
, t.tax_agent_id
|
||||
, t.pay_start_date
|
||||
, t.pay_end_date
|
||||
, t.run_status
|
||||
, t.employee_type
|
||||
, e.mobile
|
||||
, e.workcode
|
||||
, e.username
|
||||
, e.status AS employeeStatus
|
||||
, e.companystartdate as companystartdate
|
||||
, e.status AS employeeStatus
|
||||
, e.department_name as departmentName
|
||||
, e.subcompany_name AS subcompanyName
|
||||
FROM
|
||||
hrsa_salary_archive t
|
||||
LEFT JOIN hrsa_external_employee e ON e.id = t.employee_id
|
||||
WHERE t.delete_type = 0
|
||||
and t.employee_type is not null
|
||||
<if test="param.ids != null and param.ids.size()>0">
|
||||
AND t.id IN
|
||||
<foreach collection="param.ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
<!-- 个税扣缴义务人 -->
|
||||
<if test="param.taxAgentId != null">
|
||||
AND t.tax_agent_id = #{param.taxAgentId}
|
||||
</if>
|
||||
<!-- 姓名 -->
|
||||
<if test="param.username != null and param.username != ''">
|
||||
AND e.username like CONCAT('%',#{param.username},'%')
|
||||
</if>
|
||||
<!-- 分部 -->
|
||||
<if test="param.subcompanyIds != null and param.subcompanyIds.size()>0">
|
||||
AND e.subcompany_id IN
|
||||
<foreach collection="param.subcompanyIds" open="(" item="subcompanyId" separator="," close=")">
|
||||
#{subcompanyId}
|
||||
</foreach>
|
||||
</if>
|
||||
<!-- 部门 -->
|
||||
<if test="param.departmentIds != null and param.departmentIds.size()>0">
|
||||
AND e.department_id IN
|
||||
<foreach collection="param.departmentIds" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
<!-- 岗位 -->
|
||||
<if test="param.positionIds != null and param.positionIds.size()>0">
|
||||
AND e.jobtitle_id IN
|
||||
<foreach collection="param.positionIds" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
<!-- 状态 -->
|
||||
<if test="param.userstatus != null and param.userstatus != ''">
|
||||
AND e.status = #{param.userstatus}
|
||||
</if>
|
||||
<!-- 入职日期 -->
|
||||
<if test="param.hiredate != null and param.hiredate.size() == 2">
|
||||
AND (e.companystartdate BETWEEN #{param.hiredate[0]} AND #{param.hiredate[1]})
|
||||
</if>
|
||||
<!-- 人事状态 -->
|
||||
<if test="param.personnelStatuss != null and param.personnelStatuss.size()>0">
|
||||
AND e.status IN
|
||||
<foreach collection="param.personnelStatuss" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
<!-- 档案状态 -->
|
||||
<if test="param.runStatusList != null and param.runStatusList.size()>0">
|
||||
AND t.run_status IN
|
||||
<foreach collection="param.runStatusList" open="(" item="runStatus" separator="," close=")">
|
||||
#{runStatus}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<insert id="batchInsert">
|
||||
INSERT INTO hrsa_salary_archive (
|
||||
id,
|
||||
|
|
|
|||
|
|
@ -43,4 +43,5 @@ public interface ExtEmpService {
|
|||
Collection<DataCollectionEmployee> getEmployeeByIdsAll(List<Long> ids);
|
||||
|
||||
Collection<DataCollectionEmployee> listAllForReport();
|
||||
ExtEmpPO getById(Long id);
|
||||
}
|
||||
|
|
@ -36,6 +36,8 @@ public interface SalaryArchiveService {
|
|||
*/
|
||||
SalaryArchivePO getById(Long salaryArchiveId);
|
||||
|
||||
List<SalaryArchiveListDTO> getSalaryArchiveList (SalaryArchiveQueryParam queryParam);
|
||||
|
||||
List<SalaryArchivePO> listSome(SalaryArchivePO po);
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -56,6 +56,7 @@ public class ExtEmpServiceImpl extends Service implements ExtEmpService {
|
|||
BeanUtils.copyProperties(param, po);
|
||||
|
||||
po.setId(IdGenerator.generate());
|
||||
po.setStatus("3");
|
||||
po.setCreator((long) user.getUID());
|
||||
po.setModifier((long) user.getUID());
|
||||
Date now = new Date();
|
||||
|
|
@ -133,6 +134,11 @@ public class ExtEmpServiceImpl extends Service implements ExtEmpService {
|
|||
return getExternalEmployeeMapper().listAllForReport();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExtEmpPO getById(Long id) {
|
||||
return getExternalEmployeeMapper().getById(id);
|
||||
}
|
||||
|
||||
|
||||
public DataCollectionEmployee cover(ExtEmpPO extPo) {
|
||||
if (extPo == null) {
|
||||
|
|
|
|||
|
|
@ -306,7 +306,7 @@ public class SalaryArchiveExcelServiceImpl extends Service implements SalaryArch
|
|||
rows.add(header);
|
||||
// 获取所有个税扣缴义务人
|
||||
Collection<TaxAgentPO> taxAgentList = getTaxAgentService(user).listAll();
|
||||
Collection<SalaryArchiveListDTO> salaryArchives = getSalaryArchiveMapper().list(queryParam);
|
||||
Collection<SalaryArchiveListDTO> salaryArchives = salaryArchiveService(user).getSalaryArchiveList(queryParam);
|
||||
// boolean isSearchIdNo = enableHr && StringUtils.isNotEmpty(queryParam.getIdNo());
|
||||
// if (isSearchIdNo) {
|
||||
// Map<Long, String> idNoEmpMap = salaryEmployeeService
|
||||
|
|
|
|||
|
|
@ -153,6 +153,14 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe
|
|||
return getSalaryArchiveMapper().listSome(po);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SalaryArchiveListDTO> getSalaryArchiveList(SalaryArchiveQueryParam queryParam) {
|
||||
if (queryParam.isExtSalaryArchiveList()) {
|
||||
return getSalaryArchiveMapper().listExtSalaryArchive(queryParam);
|
||||
}
|
||||
return getSalaryArchiveMapper().list(queryParam);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageInfo<SalaryArchiveListDTO> listPage(SalaryArchiveQueryParam queryParam) {
|
||||
long currentEmployeeId = user.getUID();
|
||||
|
|
@ -161,7 +169,7 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe
|
|||
* 异步处理档案数据
|
||||
*/
|
||||
String handleable = Util.null2String(Util_DataCache.getObjVal("salaryArchiveHandleable"));
|
||||
if (StringUtils.isBlank(handleable) || OpenEnum.OPEN.getValue().equals(handleable)) {
|
||||
if ((StringUtils.isBlank(handleable) || OpenEnum.OPEN.getValue().equals(handleable)) && !queryParam.isExtSalaryArchiveList()) {
|
||||
new Thread() {
|
||||
public void run() {
|
||||
Util_DataCache.setObjVal("salaryArchiveHandleable", "0");
|
||||
|
|
@ -182,7 +190,7 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe
|
|||
//排序配置
|
||||
OrderRuleVO orderRule = getSalarySysConfService(user).orderRule();
|
||||
queryParam.setOrderRule(orderRule);
|
||||
List<SalaryArchiveListDTO> list = getSalaryArchiveMapper().list(queryParam);
|
||||
List<SalaryArchiveListDTO> list = getSalaryArchiveList(queryParam);
|
||||
list = list.stream()
|
||||
//过滤档案状态
|
||||
.filter(dto -> {
|
||||
|
|
@ -231,12 +239,13 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe
|
|||
|
||||
// 1.定薪员工非在职
|
||||
if (CollectionUtils.isNotEmpty(personnelStatuss)) {
|
||||
List<SalaryArchiveListDTO> noNormalList = getSalaryArchiveMapper().list(SalaryArchiveQueryParam.builder()
|
||||
SalaryArchiveQueryParam queryParam = SalaryArchiveQueryParam.builder()
|
||||
// 离职
|
||||
.personnelStatuss(personnelStatuss)
|
||||
// 定薪列表
|
||||
.runStatusList(Collections.singletonList(SalaryArchiveStatusEnum.FIXED.getValue()))
|
||||
.build());
|
||||
.build();
|
||||
List<SalaryArchiveListDTO> noNormalList = getSalaryArchiveList(queryParam);
|
||||
if (CollectionUtils.isNotEmpty(noNormalList)) {
|
||||
List<Long> idList = noNormalList.stream().map(SalaryArchiveListDTO::getId).collect(Collectors.toList());
|
||||
List<List<Long>> partition = Lists.partition(idList, 999);
|
||||
|
|
@ -328,12 +337,12 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe
|
|||
Set<Long> taxAgentIds = SalaryEntityUtil.properties(taxAgentPOS, TaxAgentPO::getId);
|
||||
|
||||
//获取所有薪资档案
|
||||
List<SalaryArchiveListDTO> list = getSalaryArchiveMapper().list(queryParam);
|
||||
List<SalaryArchiveListDTO> list = getSalaryArchiveList(queryParam);
|
||||
List<SalaryArchiveListDTO> finalAllArchive = list.stream().filter(dto -> employeeId.contains(dto.getEmployeeId()) && taxAgentIds.contains(dto.getTaxAgentId())).collect(Collectors.toList());
|
||||
|
||||
return finalAllArchive;
|
||||
} else {
|
||||
return getSalaryArchiveMapper().list(queryParam);
|
||||
return getSalaryArchiveList(queryParam);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -450,7 +459,7 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe
|
|||
String sheetName = SalaryI18nUtil.getI18nLabel(85368, "薪资档案");
|
||||
// 获取所有可被引用的薪资项目
|
||||
List<SalaryItemPO> salaryItems = salaryItemMapper.getCanAdjustSalaryItems();
|
||||
String[] header = {SalaryI18nUtil.getI18nLabel(85429, "姓名"), SalaryI18nUtil.getI18nLabel(86184, "个税扣缴义务人"), SalaryI18nUtil.getI18nLabel(86185, "部门"), SalaryI18nUtil.getI18nLabel(86176, "工号"),SalaryI18nUtil.getI18nLabel(86186, "手机号"), SalaryI18nUtil.getI18nLabel(91075, "状态"), SalaryI18nUtil.getI18nLabel(91075, "起始发薪日期"), SalaryI18nUtil.getI18nLabel(91075, "最后发薪日期")};
|
||||
String[] header = {SalaryI18nUtil.getI18nLabel(85429, "姓名"), SalaryI18nUtil.getI18nLabel(86184, "个税扣缴义务人"), SalaryI18nUtil.getI18nLabel(86185, "部门"), SalaryI18nUtil.getI18nLabel(86176, "工号"), SalaryI18nUtil.getI18nLabel(86186, "手机号"), SalaryI18nUtil.getI18nLabel(91075, "状态"), SalaryI18nUtil.getI18nLabel(91075, "起始发薪日期"), SalaryI18nUtil.getI18nLabel(91075, "最后发薪日期")};
|
||||
// 2.表头
|
||||
List<Object> headerList = new ArrayList<>(Arrays.asList(header));
|
||||
for (SalaryItemPO salaryItem : salaryItems) {
|
||||
|
|
@ -468,7 +477,7 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe
|
|||
OrderRuleVO orderRule = getSalarySysConfService(user).orderRule();
|
||||
queryParam.setOrderRule(orderRule);
|
||||
|
||||
Collection<SalaryArchiveListDTO> salaryArchives = getSalaryArchiveMapper().list(queryParam);
|
||||
Collection<SalaryArchiveListDTO> salaryArchives = getSalaryArchiveList(queryParam);
|
||||
|
||||
//分权
|
||||
Boolean needAuth = getTaxAgentService(user).isNeedAuth(employeeId);
|
||||
|
|
@ -783,7 +792,6 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe
|
|||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 处理历史数据
|
||||
* 下回发版可删除
|
||||
|
|
|
|||
|
|
@ -13,9 +13,7 @@ import weaver.hrm.User;
|
|||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.ws.rs.POST;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.Produces;
|
||||
import javax.ws.rs.*;
|
||||
import javax.ws.rs.core.Context;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import java.util.Collection;
|
||||
|
|
@ -66,5 +64,14 @@ public class ExtEmpController {
|
|||
return new ResponseResult<Collection<Long>, String>(user).run(getExtEmpWrapper(user)::delete, ids);
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/detail")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String save(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "id") Long id) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<Long, ExtEmpPO>(user).run(getExtEmpWrapper(user)::detail, id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -223,6 +223,22 @@ public class SalaryArchiveController {
|
|||
return new ResponseResult<SalaryArchiveQueryParam, Map<String, Object>>(user).run(getSalaryArchiveWrapper(user)::stopList, queryParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 外部人员列表
|
||||
* @param request
|
||||
* @param response
|
||||
* @param queryParam
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/extList")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String extList(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryArchiveQueryParam queryParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<SalaryArchiveQueryParam, Map<String, Object>>(user).run(getSalaryArchiveWrapper(user)::listPage, queryParam);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 取消停薪
|
||||
|
|
|
|||
|
|
@ -42,4 +42,8 @@ public class ExtEmpWrapper extends Service {
|
|||
public void delete(Collection<Long> ids) {
|
||||
getExtEmpService(user).delete(ids);
|
||||
}
|
||||
|
||||
public ExtEmpPO detail(Long id) {
|
||||
return getExtEmpService(user).getById(id);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -183,8 +183,6 @@ public class SalaryArchiveWrapper extends Service {
|
|||
* @return
|
||||
*/
|
||||
public Map<String, Object> listPage(SalaryArchiveQueryParam queryParam) {
|
||||
// queryParam.setRunStatusList(Arrays.asList(SalaryArchiveStatusEnum.FIXED.getValue()));
|
||||
// WeaTable<LinkedHashMap> weaTable = list(queryParam, SalaryArchiveListTypeEnum.PENDING);
|
||||
Map<String, Object> list = list(queryParam);
|
||||
return list;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue