2024-08-09 10:21:40 +08:00
|
|
|
package com.engine.salary.service.impl;
|
|
|
|
|
|
|
|
|
|
import com.engine.core.impl.Service;
|
2024-10-14 10:38:30 +08:00
|
|
|
import com.engine.salary.encrypt.EncryptUtil;
|
2024-08-09 10:21:40 +08:00
|
|
|
import com.engine.salary.entity.datacollection.po.VariableArchiveItemPO;
|
|
|
|
|
import com.engine.salary.mapper.datacollection.VariableArchiveItemMapper;
|
|
|
|
|
import com.engine.salary.service.VariableArchiveItemService;
|
|
|
|
|
import com.engine.salary.util.db.MapperProxyFactory;
|
|
|
|
|
import com.google.common.collect.Lists;
|
|
|
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
|
|
|
|
|
|
|
|
import java.util.Collections;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @author Harryxzy
|
|
|
|
|
* @ClassName VariableArchiveItemServiceImpl
|
|
|
|
|
* @date 2024/08/07 9:29
|
|
|
|
|
* @description 浮动薪酬档案明细
|
|
|
|
|
*/
|
|
|
|
|
public class VariableArchiveItemServiceImpl extends Service implements VariableArchiveItemService {
|
2024-10-14 10:38:30 +08:00
|
|
|
private EncryptUtil encryptUtil = new EncryptUtil();
|
2024-08-09 10:21:40 +08:00
|
|
|
|
|
|
|
|
private VariableArchiveItemMapper getVariableArchiveItemMapper(){
|
|
|
|
|
return MapperProxyFactory.getProxy(VariableArchiveItemMapper.class);
|
|
|
|
|
}
|
|
|
|
|
|
2024-10-16 15:47:18 +08:00
|
|
|
@Override
|
|
|
|
|
public List<VariableArchiveItemPO> listAll() {
|
|
|
|
|
return getVariableArchiveItemMapper().listAll();
|
|
|
|
|
}
|
|
|
|
|
|
2024-08-09 10:21:40 +08:00
|
|
|
/**
|
|
|
|
|
* 根据浮动薪资档案id获取
|
|
|
|
|
*
|
|
|
|
|
* @param variableArchiveIds
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public List<VariableArchiveItemPO> listByVariableArchiveIds(List<Long> variableArchiveIds) {
|
|
|
|
|
if (CollectionUtils.isEmpty(variableArchiveIds)) {
|
|
|
|
|
return Collections.emptyList();
|
|
|
|
|
}
|
2024-10-14 10:38:30 +08:00
|
|
|
List<VariableArchiveItemPO> variableArchiveItemPOS = getVariableArchiveItemMapper().listSome(VariableArchiveItemPO.builder().variableArchiveIds(variableArchiveIds).build());
|
|
|
|
|
return encryptUtil.decryptList(variableArchiveItemPOS, VariableArchiveItemPO.class);
|
2024-08-09 10:21:40 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查询浮动薪酬档案中已使用的浮动薪资项目
|
|
|
|
|
*
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public List<Long> listUsingItems() {
|
|
|
|
|
return getVariableArchiveItemMapper().listUsingItems();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public int batchInsert(List<VariableArchiveItemPO> insertList) {
|
2024-08-13 15:25:57 +08:00
|
|
|
if (CollectionUtils.isEmpty(insertList)) {
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
2024-10-14 10:38:30 +08:00
|
|
|
encryptUtil.encryptList(insertList, VariableArchiveItemPO.class);
|
2024-08-13 15:25:57 +08:00
|
|
|
List<List<VariableArchiveItemPO>> partition = Lists.partition(insertList, 50);
|
|
|
|
|
partition.forEach(part -> getVariableArchiveItemMapper().batchInsert(part));
|
|
|
|
|
return 0;
|
2024-08-09 10:21:40 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void deleteByArchiveIds(List<Long> variableArchiveIds) {
|
|
|
|
|
if (CollectionUtils.isEmpty(variableArchiveIds)) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
List<List<Long>> partition = Lists.partition(variableArchiveIds, 500);
|
|
|
|
|
partition.forEach(part -> getVariableArchiveItemMapper().deleteByArchiveIds(part));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void deleteByIds(List<Long> variableArchiveItemIds) {
|
|
|
|
|
if (CollectionUtils.isEmpty(variableArchiveItemIds)) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
List<List<Long>> partition = Lists.partition(variableArchiveItemIds, 500);
|
|
|
|
|
partition.forEach(part -> getVariableArchiveItemMapper().deleteByIds(part));
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|