Merge branch 'release/2.14.2.2405.02' into release/2.14.3.2406.01
This commit is contained in:
commit
9aa2a03425
|
|
@ -1,6 +1,5 @@
|
|||
package com.engine.salary.biz;
|
||||
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobItemHidePO;
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobItemPO;
|
||||
import com.engine.salary.mapper.salarysob.SalarySobItemMapper;
|
||||
import com.google.common.collect.Lists;
|
||||
|
|
@ -73,19 +72,7 @@ public class SalarySobItemBiz {
|
|||
}
|
||||
}
|
||||
|
||||
public void InsertItemShow(SalarySobItemHidePO salarySobItemHidePO) {
|
||||
if (salarySobItemHidePO == null) {
|
||||
return;
|
||||
}
|
||||
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
||||
try {
|
||||
SalarySobItemMapper mapper = sqlSession.getMapper(SalarySobItemMapper.class);
|
||||
mapper.insertItemShow(salarySobItemHidePO);
|
||||
sqlSession.commit();
|
||||
} finally {
|
||||
sqlSession.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public List<SalarySobItemPO> listBySalarySobIdAndGroupId(Long salarySobId, Collection<Long> salarySobItemGroupIds) {
|
||||
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
||||
|
|
@ -131,21 +118,6 @@ public class SalarySobItemBiz {
|
|||
}
|
||||
|
||||
|
||||
public void batchInsertItemShow(List<SalarySobItemHidePO> list) {
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
return;
|
||||
}
|
||||
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
||||
try {
|
||||
SalarySobItemMapper mapper = sqlSession.getMapper(SalarySobItemMapper.class);
|
||||
List<List<SalarySobItemHidePO>> partition = Lists.partition( list, 100);
|
||||
partition.forEach(mapper::batchInsertItemShow);
|
||||
sqlSession.commit();
|
||||
} finally {
|
||||
sqlSession.close();
|
||||
}
|
||||
}
|
||||
|
||||
public void update(SalarySobItemPO salarySobItemPO) {
|
||||
if (Objects.isNull(salarySobItemPO)) {
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -67,8 +67,6 @@ public class SalarySobItemBO {
|
|||
List<SalaryItemPO> defaultSalaryItemPOS,
|
||||
Long employeeId, String tenantKey) {
|
||||
Date now = new Date();
|
||||
// 需要保存的隐藏项目
|
||||
List<SalarySobItemHidePO> needInsertItemHides = new ArrayList<>();
|
||||
// 处理薪资账套默认的薪资项目分类
|
||||
Map<Long, Long> salarySobItemGroupIdMap = Maps.newHashMapWithExpectedSize(salarySobDefaultItemGroupPOS.size());
|
||||
List<SalarySobItemGroupPO> salarySobItemGroups = Lists.newArrayListWithExpectedSize(salarySobDefaultItemGroupPOS.size());
|
||||
|
|
@ -87,20 +85,6 @@ public class SalarySobItemBO {
|
|||
.deleteType(NumberUtils.INTEGER_ZERO)
|
||||
.build());
|
||||
salarySobItemGroupIdMap.put(salarySobDefaultItemGroupPO.getId(), salarySobItemGroupId);
|
||||
|
||||
// 保存薪资项目分类隐藏信息
|
||||
needInsertItemHides.add(SalarySobItemHidePO.builder()
|
||||
.id(IdGenerator.generate())
|
||||
.salarySobId(salarySobId)
|
||||
.salaryItemId(salarySobItemGroupId)
|
||||
.isGroup(1)
|
||||
.itemHide(0L)
|
||||
.creator(employeeId)
|
||||
.createTime(now)
|
||||
.updateTime(now)
|
||||
.deleteType(NumberUtils.INTEGER_ZERO)
|
||||
.tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY)
|
||||
.build());
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -127,20 +111,6 @@ public class SalarySobItemBO {
|
|||
.tenantKey(tenantKey)
|
||||
.deleteType(NumberUtils.INTEGER_ZERO)
|
||||
.build());
|
||||
|
||||
// 保存薪资项目隐藏信息
|
||||
needInsertItemHides.add(SalarySobItemHidePO.builder()
|
||||
.id(IdGenerator.generate())
|
||||
.salarySobId(salarySobId)
|
||||
.salaryItemId(salaryItemPO.getId())
|
||||
.isGroup(0)
|
||||
.itemHide(Long.valueOf(salaryItemPO.getHideDefault()== null ? 0 : salaryItemPO.getHideDefault()))
|
||||
.creator(employeeId)
|
||||
.createTime(now)
|
||||
.updateTime(now)
|
||||
.deleteType(NumberUtils.INTEGER_ZERO)
|
||||
.tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY)
|
||||
.build());
|
||||
}
|
||||
// 处理薪资账套默认的自定义薪资项目(开启了"默认使用")
|
||||
for (int i = 0; i < defaultSalaryItemPOS.size(); i++) {
|
||||
|
|
@ -167,19 +137,6 @@ public class SalarySobItemBO {
|
|||
.tenantKey(tenantKey)
|
||||
.deleteType(NumberUtils.INTEGER_ZERO)
|
||||
.build());
|
||||
// 保存薪资项目隐藏信息
|
||||
needInsertItemHides.add(SalarySobItemHidePO.builder()
|
||||
.id(IdGenerator.generate())
|
||||
.salarySobId(salarySobId)
|
||||
.salaryItemId(salaryItemPO.getId())
|
||||
.isGroup(0)
|
||||
.itemHide(Long.valueOf(salaryItemPO.getHideDefault() == null ? 0 : salaryItemPO.getHideDefault()))
|
||||
.creator(employeeId)
|
||||
.createTime(now)
|
||||
.updateTime(now)
|
||||
.deleteType(NumberUtils.INTEGER_ZERO)
|
||||
.tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY)
|
||||
.build());
|
||||
}
|
||||
|
||||
// 薪资账套默认的回算薪资项目
|
||||
|
|
@ -207,7 +164,7 @@ public class SalarySobItemBO {
|
|||
}
|
||||
|
||||
return new Result().setNeedInsertSalarySobItems(salarySobItems).setNeedInsertSalarySobItemGroups(salarySobItemGroups)
|
||||
.setNeedInsertSalarySobBackItems(salarySobBackItems).setNeedInsertItemHides(needInsertItemHides);
|
||||
.setNeedInsertSalarySobBackItems(salarySobBackItems);
|
||||
}
|
||||
|
||||
@Data
|
||||
|
|
@ -228,10 +185,5 @@ public class SalarySobItemBO {
|
|||
* 需要保存的回算薪资项目
|
||||
*/
|
||||
List<SalarySobBackItemPO> needInsertSalarySobBackItems;
|
||||
|
||||
/**
|
||||
* 需要保存的薪资项目隐藏信息
|
||||
*/
|
||||
List<SalarySobItemHidePO> needInsertItemHides;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
package com.engine.salary.mapper.salarysob;
|
||||
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobItemHidePO;
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobItemPO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
|
|
@ -89,12 +88,6 @@ public interface SalarySobItemMapper {
|
|||
*/
|
||||
void deleteItemShowBySalarySobId(@Param("salarySobIds")Collection<Long> salarySobIds);
|
||||
|
||||
/**
|
||||
* 插入薪资项目分组是否显示
|
||||
* @param salarySobItemHidePO
|
||||
*/
|
||||
void insertItemShow(SalarySobItemHidePO salarySobItemHidePO);
|
||||
|
||||
/**
|
||||
* 根据账套id以及薪资项目分组获取
|
||||
* @param
|
||||
|
|
@ -104,9 +97,4 @@ public interface SalarySobItemMapper {
|
|||
|
||||
void deleteByGroupIds(@Param("groupIds") List<Long> needDeleteGroupIds);
|
||||
|
||||
/**
|
||||
* 批量插入薪资项目分组是否显示
|
||||
* @param list
|
||||
*/
|
||||
void batchInsertItemShow(@Param("collection")List<SalarySobItemHidePO> list);
|
||||
}
|
||||
|
|
@ -346,72 +346,6 @@
|
|||
</foreach>
|
||||
</insert>
|
||||
|
||||
<insert id="insertItemShow">
|
||||
insert into hrsa_salary_item_hide (id,salary_sob_id,salary_item_id,is_group,item_hide,
|
||||
creator,tenant_key,create_time,update_time,delete_type)
|
||||
VALUES (#{id},#{salarySobId},#{salaryItemId},
|
||||
#{isGroup},#{itemHide},#{creator},
|
||||
#{tenantKey},#{createTime},#{updateTime},0)
|
||||
</insert>
|
||||
|
||||
<insert id="batchInsertItemShow">
|
||||
insert into hrsa_salary_item_hide (id,salary_sob_id,salary_item_id,is_group,item_hide,
|
||||
creator,tenant_key,create_time,update_time,delete_type)
|
||||
VALUES
|
||||
<foreach collection="collection" item="item" separator=",">
|
||||
(
|
||||
#{item.id},
|
||||
#{item.salarySobId},
|
||||
#{item.salaryItemId},
|
||||
#{item.isGroup},
|
||||
#{item.itemHide},
|
||||
#{item.creator},
|
||||
#{item.tenantKey},
|
||||
#{item.createTime},
|
||||
#{item.updateTime},
|
||||
0
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
<insert id="batchInsertItemShow" databaseId="oracle">
|
||||
insert into hrsa_salary_item_hide (id,salary_sob_id,salary_item_id,is_group,item_hide,
|
||||
creator,tenant_key,create_time,update_time,delete_type)
|
||||
<foreach collection="collection" item="item" separator="union all">
|
||||
select
|
||||
#{item.id,jdbcType=DOUBLE},
|
||||
#{item.salarySobId,jdbcType=DOUBLE},
|
||||
#{item.salaryItemId,jdbcType=DOUBLE},
|
||||
#{item.isGroup,jdbcType=INTEGER},
|
||||
#{item.itemHide,jdbcType=INTEGER},
|
||||
#{item.creator,jdbcType=DOUBLE},
|
||||
#{item.tenantKey,jdbcType=VARCHAR},
|
||||
#{item.createTime,jdbcType=DATE},
|
||||
#{item.updateTime,jdbcType=DATE},
|
||||
0
|
||||
from dual
|
||||
</foreach>
|
||||
</insert>
|
||||
<insert id="batchInsertItemShow" databaseId="sqlserver">
|
||||
<foreach collection="collection" item="item" separator=";">
|
||||
insert into hrsa_salary_item_hide (id,salary_sob_id,salary_item_id,is_group,item_hide,
|
||||
creator,tenant_key,create_time,update_time,delete_type)
|
||||
VALUES
|
||||
(
|
||||
#{item.id},
|
||||
#{item.salarySobId},
|
||||
#{item.salaryItemId},
|
||||
#{item.isGroup},
|
||||
#{item.itemHide},
|
||||
#{item.creator},
|
||||
#{item.tenantKey},
|
||||
#{item.createTime},
|
||||
#{item.updateTime},
|
||||
0
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
|
||||
<update id="deleteByGroupIds">
|
||||
UPDATE hrsa_salary_sob_item
|
||||
SET delete_type = 1
|
||||
|
|
|
|||
|
|
@ -2,10 +2,10 @@ package com.engine.salary.service.impl;
|
|||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.hrmelog.entity.dto.LoggerContext;
|
||||
import com.engine.salary.biz.*;
|
||||
import com.engine.salary.config.SalaryElogConfig;
|
||||
import com.engine.salary.constant.SalaryDefaultTenantConstant;
|
||||
import com.engine.hrmelog.entity.dto.LoggerContext;
|
||||
import com.engine.salary.entity.salaryBill.po.SalaryTemplatePO;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO;
|
||||
import com.engine.salary.entity.salaryitem.bo.SysSalaryItemBO;
|
||||
|
|
@ -33,7 +33,6 @@ import com.engine.salary.sys.service.SalarySysConfService;
|
|||
import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import com.engine.salary.util.db.IdGenerator;
|
||||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import com.engine.salary.util.page.SalaryPageUtil;
|
||||
|
|
@ -42,7 +41,6 @@ import com.engine.salary.util.valid.ValidUtil;
|
|||
import com.google.common.collect.Lists;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.BooleanUtils;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.math.NumberUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
|
|
@ -387,13 +385,6 @@ public class SalarySobServiceImpl extends Service implements SalarySobService {
|
|||
if (CollectionUtils.isNotEmpty(result.getNeedInsertSalarySobBackItems())) {
|
||||
getSalarySobBackItemService(user).batchInsert(result.getNeedInsertSalarySobBackItems());
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(result.getNeedInsertItemHides())) {
|
||||
//去重
|
||||
List<SalarySobItemHidePO> list = new ArrayList<>(result.getNeedInsertItemHides().stream()
|
||||
.collect(Collectors.toMap(SalarySobItemHidePO::getSalaryItemId, Function.identity(), (oldValue, newValue) -> oldValue))
|
||||
.values());
|
||||
salarySobItemService.batchInsertItemShow(list);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -721,60 +712,12 @@ public class SalarySobServiceImpl extends Service implements SalarySobService {
|
|||
getSalarySobBackItemService(user).batchInsert(result.getSalarySobBackItems());
|
||||
}
|
||||
|
||||
// 复制薪资账套的薪资项目隐藏副本
|
||||
if (CollectionUtils.isNotEmpty(result.getSalarySobItems())) {
|
||||
List<SalarySobItemPO> salarySobItems = result.getSalarySobItems();
|
||||
Date now = new Date();
|
||||
salarySobItems.stream().forEach(k -> {
|
||||
Long salarySobItemShowId = IdGenerator.generate();
|
||||
SalarySobItemHidePO salarySobItemHidePO = SalarySobItemHidePO.builder()
|
||||
.id(salarySobItemShowId)
|
||||
.salarySobId(k.getSalarySobId())
|
||||
.salaryItemId(k.getSalaryItemId())
|
||||
.isGroup(0)
|
||||
.itemHide(k.getItemHide())
|
||||
.creator((long) user.getUID())
|
||||
.deleteType(NumberUtils.INTEGER_ZERO)
|
||||
.createTime(now)
|
||||
.updateTime(now)
|
||||
.tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY)
|
||||
.build();
|
||||
if (k.getItemHide() == null) {
|
||||
salarySobItemHidePO.setItemHide(Long.valueOf(0));
|
||||
}
|
||||
salarySobItemService.InsertItemShow(salarySobItemHidePO);
|
||||
});
|
||||
}
|
||||
|
||||
// 复制薪资账套的薪资项目分类
|
||||
if (CollectionUtils.isNotEmpty(result.getSalarySobItemGroups())) {
|
||||
salarySobItemGroupService.batchInsert(result.getSalarySobItemGroups());
|
||||
}
|
||||
|
||||
// 复制薪资账套的薪资项目分类隐藏信息
|
||||
if (CollectionUtils.isNotEmpty(result.getSalarySobItemGroups())) {
|
||||
List<SalarySobItemGroupPO> salarySobItemGroups = result.getSalarySobItemGroups();
|
||||
Date now = new Date();
|
||||
salarySobItemGroups.stream().forEach(k -> {
|
||||
Long salarySobItemShowId = IdGenerator.generate();
|
||||
SalarySobItemHidePO salarySobItemHidePO = SalarySobItemHidePO.builder()
|
||||
.id(salarySobItemShowId)
|
||||
.salarySobId(k.getSalarySobId())
|
||||
.salaryItemId(k.getId())
|
||||
.isGroup(1)
|
||||
.itemHide(k.getItemHide())
|
||||
.creator((long) user.getUID())
|
||||
.deleteType(NumberUtils.INTEGER_ZERO)
|
||||
.createTime(now)
|
||||
.updateTime(now)
|
||||
.tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY)
|
||||
.build();
|
||||
if (k.getItemHide() == null) {
|
||||
salarySobItemHidePO.setItemHide(Long.valueOf(0));
|
||||
}
|
||||
salarySobItemService.InsertItemShow(salarySobItemHidePO);
|
||||
});
|
||||
}
|
||||
|
||||
// 复制薪资账套的调薪计薪规则
|
||||
if (CollectionUtils.isNotEmpty(result.getSalaryAdjustmentRules())) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue