diff --git a/src/com/engine/salary/biz/SalarySobItemBiz.java b/src/com/engine/salary/biz/SalarySobItemBiz.java index 66ac63d0c..233eae306 100644 --- a/src/com/engine/salary/biz/SalarySobItemBiz.java +++ b/src/com/engine/salary/biz/SalarySobItemBiz.java @@ -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; @@ -34,16 +33,6 @@ public class SalarySobItemBiz { } } - public List listBySalarySobIdWithHideItem(SalarySobItemPO build) { - SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession(); - try { - SalarySobItemMapper mapper = sqlSession.getMapper(SalarySobItemMapper.class); - return mapper.listBySalarySobIdWithHideItem(build); - } finally { - sqlSession.close(); - } - } - public void batchInsert(Collection salarySobItemPOS) { if (CollectionUtils.isEmpty(salarySobItemPOS)) { @@ -83,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 listBySalarySobIdAndGroupId(Long salarySobId, Collection salarySobItemGroupIds) { SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession(); @@ -141,21 +118,6 @@ public class SalarySobItemBiz { } - public void batchInsertItemShow(List list) { - if (CollectionUtils.isEmpty(list)) { - return; - } - SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession(); - try { - SalarySobItemMapper mapper = sqlSession.getMapper(SalarySobItemMapper.class); - List> partition = Lists.partition( list, 100); - partition.forEach(mapper::batchInsertItemShow); - sqlSession.commit(); - } finally { - sqlSession.close(); - } - } - public void update(SalarySobItemPO salarySobItemPO) { if (Objects.isNull(salarySobItemPO)) { return; diff --git a/src/com/engine/salary/entity/salarysob/bo/SalarySobItemBO.java b/src/com/engine/salary/entity/salarysob/bo/SalarySobItemBO.java index 049d06c5c..bc8aa4ecb 100644 --- a/src/com/engine/salary/entity/salarysob/bo/SalarySobItemBO.java +++ b/src/com/engine/salary/entity/salarysob/bo/SalarySobItemBO.java @@ -67,8 +67,6 @@ public class SalarySobItemBO { List defaultSalaryItemPOS, Long employeeId, String tenantKey) { Date now = new Date(); - // 需要保存的隐藏项目 - List needInsertItemHides = new ArrayList<>(); // 处理薪资账套默认的薪资项目分类 Map salarySobItemGroupIdMap = Maps.newHashMapWithExpectedSize(salarySobDefaultItemGroupPOS.size()); List 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()); } @@ -128,20 +112,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++) { @@ -169,19 +139,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()); } // 薪资账套默认的回算薪资项目 @@ -209,7 +166,7 @@ public class SalarySobItemBO { } return new Result().setNeedInsertSalarySobItems(salarySobItems).setNeedInsertSalarySobItemGroups(salarySobItemGroups) - .setNeedInsertSalarySobBackItems(salarySobBackItems).setNeedInsertItemHides(needInsertItemHides); + .setNeedInsertSalarySobBackItems(salarySobBackItems); } @Data @@ -230,10 +187,5 @@ public class SalarySobItemBO { * 需要保存的回算薪资项目 */ List needInsertSalarySobBackItems; - - /** - * 需要保存的薪资项目隐藏信息 - */ - List needInsertItemHides; } } diff --git a/src/com/engine/salary/mapper/salarysob/SalarySobItemMapper.java b/src/com/engine/salary/mapper/salarysob/SalarySobItemMapper.java index 0900cfa60..dd2e00621 100644 --- a/src/com/engine/salary/mapper/salarysob/SalarySobItemMapper.java +++ b/src/com/engine/salary/mapper/salarysob/SalarySobItemMapper.java @@ -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; @@ -24,7 +23,6 @@ public interface SalarySobItemMapper { */ List listSome(SalarySobItemPO salarySobItemPO); - List listBySalarySobIdWithHideItem(SalarySobItemPO salarySobItemPO); /** @@ -35,14 +33,7 @@ public interface SalarySobItemMapper { */ SalarySobItemPO getById(Long id); - /** - * 新增,忽略null字段 - * - * @param salarySobItemPO 新增的记录 - * @return 返回影响行数 - */ - int insertIgnoreNull(SalarySobItemPO salarySobItemPO); - + /** * 修改,修改所有字段 * @@ -50,7 +41,7 @@ public interface SalarySobItemMapper { * @return 返回影响行数 */ int update(SalarySobItemPO salarySobItemPO); - + /** * 修改,忽略null字段 * @@ -97,12 +88,6 @@ public interface SalarySobItemMapper { */ void deleteItemShowBySalarySobId(@Param("salarySobIds")Collection salarySobIds); - /** - * 插入薪资项目分组是否显示 - * @param salarySobItemHidePO - */ - void insertItemShow(SalarySobItemHidePO salarySobItemHidePO); - /** * 根据账套id以及薪资项目分组获取 * @param @@ -112,9 +97,4 @@ public interface SalarySobItemMapper { void deleteByGroupIds(@Param("groupIds") List needDeleteGroupIds); - /** - * 批量插入薪资项目分组是否显示 - * @param list - */ - void batchInsertItemShow(@Param("collection")List list); } \ No newline at end of file diff --git a/src/com/engine/salary/mapper/salarysob/SalarySobItemMapper.xml b/src/com/engine/salary/mapper/salarysob/SalarySobItemMapper.xml index d7226ffdc..04c91d121 100644 --- a/src/com/engine/salary/mapper/salarysob/SalarySobItemMapper.xml +++ b/src/com/engine/salary/mapper/salarysob/SalarySobItemMapper.xml @@ -17,6 +17,7 @@ + @@ -41,6 +42,7 @@ , t.pattern , t.value_type , t.item_hide + , t.income_category @@ -151,129 +153,6 @@ - - - - - - INSERT INTO hrsa_salary_sob_item - - - - create_time, - - - creator, - - - delete_type, - - - description, - - - formula_id, - - - id, - - - salary_item_id, - - - salary_sob_id, - - - salary_sob_item_group_id, - - - sorted_index, - - - tenant_key, - - - update_time, - - - can_delete, - - - item_hide, - - - - - #{createTime}, - - - #{creator}, - - - #{deleteType}, - - - #{description}, - - - #{formulaId}, - - - #{id}, - - - #{salaryItemId}, - - - #{salarySobId}, - - - #{salarySobItemGroupId}, - - - #{sortedIndex}, - - - #{tenantKey}, - - - #{updateTime}, - - - #{canDelete}, - - - #{itemHide}, - - - - UPDATE hrsa_salary_sob_item @@ -294,6 +173,7 @@ pattern=#{pattern}, value_type=#{valueType}, item_hide=#{itemHide}, + income_category=#{incomeCategory}, WHERE id = #{id} AND delete_type = 0 @@ -351,6 +231,9 @@ item_hide=#{itemHide}, + + income_category=#{incomeCategory}, + WHERE id = #{id} AND delete_type = 0 @@ -397,7 +280,7 @@ INSERT INTO hrsa_salary_sob_item(salary_sob_id, salary_item_id, salary_sob_item_group_id, formula_id, - sorted_index, description, create_time, update_time, creator, delete_type, tenant_key,can_delete,rounding_mode,pattern,value_type,salary_item_code,item_hide) + sorted_index, description, create_time, update_time, creator, delete_type, tenant_key,can_delete,rounding_mode,pattern,value_type,salary_item_code,item_hide,income_category) VALUES ( @@ -417,13 +300,14 @@ #{item.pattern}, #{item.valueType}, #{item.salaryItemCode}, - #{item.itemHide} + #{item.itemHide}, + #{item.incomeCategory} ) INSERT INTO hrsa_salary_sob_item( salary_sob_id, salary_item_id, salary_sob_item_group_id, formula_id, - sorted_index, description, create_time, update_time, creator, delete_type, tenant_key,can_delete,rounding_mode,pattern,value_type,salary_item_code,item_hide) + sorted_index, description, create_time, update_time, creator, delete_type, tenant_key,can_delete,rounding_mode,pattern,value_type,salary_item_code,item_hide,income_category) select @@ -443,14 +327,15 @@ #{item.pattern,jdbcType=INTEGER}, #{item.valueType,jdbcType=INTEGER}, #{item.salaryItemCode,jdbcType=INTEGER}, - #{item.itemHide,jdbcType=DOUBLE} + #{item.itemHide,jdbcType=DOUBLE}, + #{item.incomeCategory,jdbcType=VARCHAR} from dual INSERT INTO hrsa_salary_sob_item( salary_sob_id, salary_item_id, salary_sob_item_group_id, formula_id, - sorted_index, description, create_time, update_time, creator, delete_type, tenant_key,can_delete,rounding_mode,pattern,value_type,salary_item_code,item_hide) + sorted_index, description, create_time, update_time, creator, delete_type, tenant_key,can_delete,rounding_mode,pattern,value_type,salary_item_code,item_hide,income_category) VALUES ( #{item.salarySobId}, @@ -469,76 +354,11 @@ #{item.pattern}, #{item.valueType}, #{item.salaryItemCode}, - #{item.itemHide} - ) - - - - - 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 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 + #{item.incomeCategory} ) - - 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) - - 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 - - - - - 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 - ) - - - UPDATE hrsa_salary_sob_item diff --git a/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java index a8cfe0900..84e48c3d2 100644 --- a/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java @@ -2,6 +2,7 @@ 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.SalarySobBiz; import com.engine.salary.biz.SalarySobItemBiz; import com.engine.salary.biz.SalarySobItemGroupBiz; @@ -9,9 +10,8 @@ import com.engine.salary.biz.SalarySobItemHideBiz; import com.engine.salary.config.SalaryElogConfig; import com.engine.salary.constant.SalaryDefaultTenantConstant; import com.engine.salary.entity.salaryacct.bo.SalaryAcctCalculatePriorityBO; -import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO; -import com.engine.hrmelog.entity.dto.LoggerContext; import com.engine.salary.entity.salaryacct.bo.SalaryAcctConfig; +import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO; import com.engine.salary.entity.salaryformula.ExpressFormula; import com.engine.salary.entity.salaryformula.po.FormulaVar; import com.engine.salary.entity.salaryitem.po.SalaryItemPO; @@ -380,6 +380,8 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe Date now = new Date(); Long salarySobId = saveParam.getSalarySobId(); + SalarySobPO sob = salarySobBiz.getById(salarySobId); + String incomeCategory = sob.getIncomeCategory() == null ? "1" : sob.getIncomeCategory().toString(); List itemGroups = saveParam.getItemGroups(); List newGroupIds = SalaryEntityUtil.properties(itemGroups, SalarySobItemSaveParam.SalarySobItemGroupParam::getId, Collectors.toList()); List salarySobItemGroupPOS = getSalarySobItemGroupService(user).listBySalarySobId(salarySobId); @@ -405,6 +407,7 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe SalaryItemPO salaryItemPO = checkItemExists(itemParam.getSalaryItemId(), salaryItemsMap); SalarySobItemPO salarySobItemPO = SalarySobItemPO.builder() .salarySobId(salarySobId) + .incomeCategory(incomeCategory) .salaryItemId(itemParam.getSalaryItemId()) .salaryItemCode(salaryItemPO.getCode()) .salarySobItemGroupId(salarySobItemGroupId) @@ -447,6 +450,7 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe SalaryItemPO salaryItemPO = checkItemExists(itemParam.getSalaryItemId(), salaryItemsMap); SalarySobItemPO salarySobItemPO = SalarySobItemPO.builder() .salarySobId(salarySobId) + .incomeCategory(incomeCategory) .salaryItemId(itemParam.getSalaryItemId()) .salaryItemCode(salaryItemPO.getCode()) .salarySobItemGroupId(groupId) @@ -471,6 +475,7 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe SalaryItemPO salaryItemPO = checkItemExists(itemParam.getSalaryItemId(), salaryItemsMap); SalarySobItemPO salarySobItemPO = SalarySobItemPO.builder() .id(itemParam.getId()) + .incomeCategory(incomeCategory) .salaryItemId(itemParam.getSalaryItemId()) .salaryItemCode(salaryItemPO.getCode()) .salarySobItemGroupId(groupId) @@ -510,13 +515,13 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe for (SalarySobItemSaveParam.SalarySobItemParam itemParam : needAddItems) { SalaryItemPO salaryItemPO = checkItemExists(itemParam.getSalaryItemId(), salaryItemsMap); - SalarySobItemPO salarySobItemPO = SalarySobItemPO.builder().salarySobId(salarySobId).salaryItemId(itemParam.getSalaryItemId()).salaryItemCode(salaryItemPO.getCode()).salarySobItemGroupId(NumberUtils.LONG_ZERO).formulaId(Optional.ofNullable(itemParam.getFormulaId()).orElse(NumberUtils.LONG_ZERO)).sortedIndex(itemParam.getSortedIndex()).description(StringUtils.EMPTY).creator(employeeId).createTime(now).updateTime(now).deleteType(NumberUtils.INTEGER_ZERO).tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY).canDelete(itemParam.getCanDelete() == null ? NumberUtils.INTEGER_ONE : (itemParam.getCanDelete() ? NumberUtils.INTEGER_ONE : NumberUtils.INTEGER_ZERO)).roundingMode(itemParam.getRoundingMode() == null ? salaryItemPO.getRoundingMode() : itemParam.getRoundingMode()).pattern(itemParam.getPattern() == null ? salaryItemPO.getPattern() : itemParam.getPattern()).valueType(itemParam.getValueType() == null ? salaryItemPO.getValueType() : itemParam.getValueType()).itemHide(itemParam.getItemHide()).build(); + SalarySobItemPO salarySobItemPO = SalarySobItemPO.builder().salarySobId(salarySobId).incomeCategory(incomeCategory).salaryItemId(itemParam.getSalaryItemId()).salaryItemCode(salaryItemPO.getCode()).salarySobItemGroupId(NumberUtils.LONG_ZERO).formulaId(Optional.ofNullable(itemParam.getFormulaId()).orElse(NumberUtils.LONG_ZERO)).sortedIndex(itemParam.getSortedIndex()).description(StringUtils.EMPTY).creator(employeeId).createTime(now).updateTime(now).deleteType(NumberUtils.INTEGER_ZERO).tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY).canDelete(itemParam.getCanDelete() == null ? NumberUtils.INTEGER_ONE : (itemParam.getCanDelete() ? NumberUtils.INTEGER_ONE : NumberUtils.INTEGER_ZERO)).roundingMode(itemParam.getRoundingMode() == null ? salaryItemPO.getRoundingMode() : itemParam.getRoundingMode()).pattern(itemParam.getPattern() == null ? salaryItemPO.getPattern() : itemParam.getPattern()).valueType(itemParam.getValueType() == null ? salaryItemPO.getValueType() : itemParam.getValueType()).itemHide(itemParam.getItemHide()).build(); salarySobItems.add(salarySobItemPO); } for (SalarySobItemSaveParam.SalarySobItemParam itemParam : needUpdateItems) { SalaryItemPO salaryItemPO = checkItemExists(itemParam.getSalaryItemId(), salaryItemsMap); - SalarySobItemPO salarySobItemPO = SalarySobItemPO.builder().id(itemParam.getId()).formulaId(Optional.ofNullable(itemParam.getFormulaId()).orElse(NumberUtils.LONG_ZERO)).sortedIndex(itemParam.getSortedIndex()).updateTime(now).canDelete(itemParam.getCanDelete() == null ? NumberUtils.INTEGER_ONE : (itemParam.getCanDelete() ? NumberUtils.INTEGER_ONE : NumberUtils.INTEGER_ZERO)).roundingMode(itemParam.getRoundingMode() == null ? salaryItemPO.getRoundingMode() : itemParam.getRoundingMode()).pattern(itemParam.getPattern() == null ? salaryItemPO.getPattern() : itemParam.getPattern()).valueType(itemParam.getValueType() == null ? salaryItemPO.getValueType() : itemParam.getValueType()).itemHide(itemParam.getItemHide()).build(); + SalarySobItemPO salarySobItemPO = SalarySobItemPO.builder().id(itemParam.getId()).incomeCategory(incomeCategory).formulaId(Optional.ofNullable(itemParam.getFormulaId()).orElse(NumberUtils.LONG_ZERO)).sortedIndex(itemParam.getSortedIndex()).updateTime(now).canDelete(itemParam.getCanDelete() == null ? NumberUtils.INTEGER_ONE : (itemParam.getCanDelete() ? NumberUtils.INTEGER_ONE : NumberUtils.INTEGER_ZERO)).roundingMode(itemParam.getRoundingMode() == null ? salaryItemPO.getRoundingMode() : itemParam.getRoundingMode()).pattern(itemParam.getPattern() == null ? salaryItemPO.getPattern() : itemParam.getPattern()).valueType(itemParam.getValueType() == null ? salaryItemPO.getValueType() : itemParam.getValueType()).itemHide(itemParam.getItemHide()).build(); getSalarySobItemMapper().updateIgnoreNull(salarySobItemPO); } @@ -679,12 +684,12 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe // 查询薪资项目副本 List salarySobItemPOS = listBySalarySobId(salarySobId); // 查询薪资项目 - List salaryItemIds = SalaryEntityUtil.properties(salarySobItemPOS, SalarySobItemPO::getSalaryItemId,Collectors.toList()); + List salaryItemIds = SalaryEntityUtil.properties(salarySobItemPOS, SalarySobItemPO::getSalaryItemId, Collectors.toList()); List salaryItems = getSalaryItemService(user).listByIds(salaryItemIds); // 查询公式详情 - List formulaIds = SalaryEntityUtil.properties(salaryItems, SalaryItemPO::getFormulaId,Collectors.toList()); + List formulaIds = SalaryEntityUtil.properties(salaryItems, SalaryItemPO::getFormulaId, Collectors.toList()); List expressFormulas = getSalaryFormulaService(user).listExpressFormula(formulaIds); - SalaryAcctCalculatePriorityBO.calculatePriority(salarySobItemPOS,salaryItems,expressFormulas,new ArrayList<>(),new HashSet<>()); + SalaryAcctCalculatePriorityBO.calculatePriority(salarySobItemPOS, salaryItems, expressFormulas, new ArrayList<>(), new HashSet<>()); } /** diff --git a/src/com/engine/salary/service/impl/SalarySobServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobServiceImpl.java index 9d146b115..83fe0d68d 100644 --- a/src/com/engine/salary/service/impl/SalarySobServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySobServiceImpl.java @@ -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; @@ -45,7 +45,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; @@ -405,13 +404,6 @@ public class SalarySobServiceImpl extends Service implements SalarySobService { if (CollectionUtils.isNotEmpty(result.getNeedInsertSalarySobBackItems())) { getSalarySobBackItemService(user).batchInsert(result.getNeedInsertSalarySobBackItems()); } - if (CollectionUtils.isNotEmpty(result.getNeedInsertItemHides())) { - //去重 - List list = new ArrayList<>(result.getNeedInsertItemHides().stream() - .collect(Collectors.toMap(SalarySobItemHidePO::getSalaryItemId, Function.identity(), (oldValue, newValue) -> oldValue)) - .values()); - salarySobItemService.batchInsertItemShow(list); - } } /** @@ -689,7 +681,7 @@ public class SalarySobServiceImpl extends Service implements SalarySobService { // 查询薪资账套的员工信息字段 List salarySobEmpFieldPOS = salarySobEmpFieldService.listSome(SalarySobEmpFieldPO.builder().salarySobId(duplicateParam.getId()).build()); // 查询薪资账套的薪资项目副本 - List salarySobItemPOS = salarySobItemService.listBySalarySobIdWithHideItem(SalarySobItemPO.builder().salarySobId(duplicateParam.getId()).build()); + List salarySobItemPOS = salarySobItemService.listSome(SalarySobItemPO.builder().salarySobId(duplicateParam.getId()).build()); // 薪资项目副本去重 salarySobItemPOS = salarySobItemPOS.stream().filter(SalaryEntityUtil.distinctByKey(PO -> PO.getSalarySobId() + "-" + PO.getSalaryItemId())).collect(Collectors.toList()); // 查询薪资账套的薪资项目分类 @@ -739,60 +731,12 @@ public class SalarySobServiceImpl extends Service implements SalarySobService { getSalarySobBackItemService(user).batchInsert(result.getSalarySobBackItems()); } - // 复制薪资账套的薪资项目隐藏副本 - if (CollectionUtils.isNotEmpty(result.getSalarySobItems())) { - List 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 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())) {