From 289e685e09b2d60fcb52a85847273348465f37b5 Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Wed, 24 Aug 2022 10:31:42 +0800 Subject: [PATCH 01/12] =?UTF-8?q?xzy-=E8=96=AA=E8=B5=84=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E6=98=BE=E9=9A=90=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../engine/salary/biz/SalarySobItemBiz.java | 47 ++++++ .../salary/biz/SalarySobItemGroupBiz.java | 10 ++ .../salary/biz/SalarySobItemHideBiz.java | 22 +++ .../bo/SalarySobItemAggregateBO.java | 3 + .../salarysob/dto/SalarySobItemDTO.java | 4 + .../salarysob/dto/SalarySobItemGroupDTO.java | 3 + .../param/SalarySobItemSaveParam.java | 6 + .../salarysob/po/SalarySobItemGroupPO.java | 3 + .../salarysob/po/SalarySobItemHidePO.java | 71 ++++++++++ .../entity/salarysob/po/SalarySobItemPO.java | 3 + .../salarysob/SalarySobItemGroupMapper.java | 6 +- .../salarysob/SalarySobItemGroupMapper.xml | 30 ++++ .../salarysob/SalarySobItemHideMapper.java | 15 ++ .../salarysob/SalarySobItemHideMapper.xml | 21 +++ .../mapper/salarysob/SalarySobItemMapper.java | 27 +++- .../mapper/salarysob/SalarySobItemMapper.xml | 65 +++++++++ .../service/SalarySobItemGroupService.java | 8 ++ .../service/SalarySobItemHideService.java | 16 +++ .../salary/service/SalarySobItemService.java | 27 ++++ .../impl/SalaryAcctExcelServiceImpl.java | 2 +- .../impl/SalaryAcctResultServiceImpl.java | 38 ++++- .../impl/SalarySobItemGroupServiceImpl.java | 5 + .../impl/SalarySobItemHideServiceImpl.java | 18 +++ .../impl/SalarySobItemServiceImpl.java | 134 +++++++++++++++++- .../salary/web/SalarySobController.java | 2 + 25 files changed, 569 insertions(+), 17 deletions(-) create mode 100644 src/com/engine/salary/biz/SalarySobItemHideBiz.java create mode 100644 src/com/engine/salary/entity/salarysob/po/SalarySobItemHidePO.java create mode 100644 src/com/engine/salary/mapper/salarysob/SalarySobItemHideMapper.java create mode 100644 src/com/engine/salary/mapper/salarysob/SalarySobItemHideMapper.xml create mode 100644 src/com/engine/salary/service/SalarySobItemHideService.java create mode 100644 src/com/engine/salary/service/impl/SalarySobItemHideServiceImpl.java diff --git a/src/com/engine/salary/biz/SalarySobItemBiz.java b/src/com/engine/salary/biz/SalarySobItemBiz.java index f741947a3..bd7cfde0e 100644 --- a/src/com/engine/salary/biz/SalarySobItemBiz.java +++ b/src/com/engine/salary/biz/SalarySobItemBiz.java @@ -1,5 +1,6 @@ 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; @@ -32,6 +33,17 @@ 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)){ return; @@ -58,4 +70,39 @@ public class SalarySobItemBiz { sqlSession.close(); } } + + public void deleteItemShowBySalarySobId(Collection salarySobIds) { + SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession(); + try { + SalarySobItemMapper mapper = sqlSession.getMapper(SalarySobItemMapper.class); + mapper.deleteItemShowBySalarySobId(salarySobIds); + sqlSession.commit(); + } finally { + sqlSession.close(); + } + } + + 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(); + try { + SalarySobItemMapper mapper = sqlSession.getMapper(SalarySobItemMapper.class); + return mapper.listBySalarySobIdAndGroupId(salarySobId,salarySobItemGroupIds); + } finally { + sqlSession.close(); + } + } } diff --git a/src/com/engine/salary/biz/SalarySobItemGroupBiz.java b/src/com/engine/salary/biz/SalarySobItemGroupBiz.java index 67d2939c9..c54097ae2 100644 --- a/src/com/engine/salary/biz/SalarySobItemGroupBiz.java +++ b/src/com/engine/salary/biz/SalarySobItemGroupBiz.java @@ -62,4 +62,14 @@ public class SalarySobItemGroupBiz { sqlSession.close(); } } + + public List listSomeWithItemHide(SalarySobItemGroupPO build) { + SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession(); + try { + SalarySobItemGroupMapper mapper = sqlSession.getMapper(SalarySobItemGroupMapper.class); + return mapper.listSomeWithItemHide(build); + } finally { + sqlSession.close(); + } + } } diff --git a/src/com/engine/salary/biz/SalarySobItemHideBiz.java b/src/com/engine/salary/biz/SalarySobItemHideBiz.java new file mode 100644 index 000000000..ceec5ab42 --- /dev/null +++ b/src/com/engine/salary/biz/SalarySobItemHideBiz.java @@ -0,0 +1,22 @@ +package com.engine.salary.biz; + +import com.engine.salary.entity.salarysob.po.SalarySobItemHidePO; +import com.engine.salary.mapper.salarysob.SalarySobItemHideMapper; +import org.apache.ibatis.session.SqlSession; +import weaver.conn.mybatis.MyBatisFactory; + +import java.util.List; + +public class SalarySobItemHideBiz { + + public List listSome(SalarySobItemHidePO salarySobPO) { + SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession(); + try { + SalarySobItemHideMapper mapper = sqlSession.getMapper(SalarySobItemHideMapper.class); + return mapper.getById(salarySobPO); + } finally { + sqlSession.close(); + } + } + +} diff --git a/src/com/engine/salary/entity/salarysob/bo/SalarySobItemAggregateBO.java b/src/com/engine/salary/entity/salarysob/bo/SalarySobItemAggregateBO.java index bd8203929..5dbadc876 100644 --- a/src/com/engine/salary/entity/salarysob/bo/SalarySobItemAggregateBO.java +++ b/src/com/engine/salary/entity/salarysob/bo/SalarySobItemAggregateBO.java @@ -85,12 +85,14 @@ public class SalarySobItemAggregateBO { .salarySobId(e.getSalarySobId()) .name(e.getName()) .sortedIndex(e.getSortedIndex()) + .itemHide(e.getItemHide()) .build()) .collect(Collectors.toList()); Map salarySobItemGroupDTOMap = SalaryEntityUtil.convert2Map(salarySobItemGroupDTOS, SalarySobItemGroupDTO::getId); Map salaryItemMap = SalaryEntityUtil.convert2Map(salaryItems, SalaryItemPO::getId); Map> salarySobItemMap = SalaryEntityUtil.group2Map(salarySobItems, SalarySobItemPO::getSalarySobItemGroupId); Map formulaMap = SalaryEntityUtil.convert2Map(expressFormulas, ExpressFormula::getId, ExpressFormula::getFormula); + // 薪资账套的薪资项目副本po转换成dto salarySobItemMap.forEach((k, v) -> { List items = Lists.newArrayList(); @@ -104,6 +106,7 @@ public class SalarySobItemAggregateBO { .salaryItemId(salaryItemPO.getId()) .dateType(salaryItemPO.getDataType()) .name(salaryItemPO.getName()) + .itemHide(salarySobItemPO.getItemHide()) .formulaId(salarySobItemPO.getFormulaId()) .formulaContent(formulaMap.getOrDefault(salarySobItemPO.getFormulaId(), "")) .taxDeclarationColumn(SalaryItemBO.buildTaxDeclarationColumn(salaryItemPO.getCode())) diff --git a/src/com/engine/salary/entity/salarysob/dto/SalarySobItemDTO.java b/src/com/engine/salary/entity/salarysob/dto/SalarySobItemDTO.java index 16a7033d5..f03a8468c 100644 --- a/src/com/engine/salary/entity/salarysob/dto/SalarySobItemDTO.java +++ b/src/com/engine/salary/entity/salarysob/dto/SalarySobItemDTO.java @@ -41,6 +41,7 @@ public class SalarySobItemDTO { //名称 private String name; + //是否是薪资档案引用 private Integer useInEmployeeSalary; @@ -88,4 +89,7 @@ public class SalarySobItemDTO { //是否可以删除 private boolean canDelete; + + //该分类是否隐藏(0不隐藏,1隐藏) + private Integer itemHide; } diff --git a/src/com/engine/salary/entity/salarysob/dto/SalarySobItemGroupDTO.java b/src/com/engine/salary/entity/salarysob/dto/SalarySobItemGroupDTO.java index 8c589c282..7571b18d3 100644 --- a/src/com/engine/salary/entity/salarysob/dto/SalarySobItemGroupDTO.java +++ b/src/com/engine/salary/entity/salarysob/dto/SalarySobItemGroupDTO.java @@ -38,6 +38,9 @@ public class SalarySobItemGroupDTO { //薪资项目分组排序字段") private Integer sortedIndex; + //该分类是否隐藏(0不隐藏,1隐藏) + private Integer itemHide; + //薪资项目分组下的薪资项目") private List items; } diff --git a/src/com/engine/salary/entity/salarysob/param/SalarySobItemSaveParam.java b/src/com/engine/salary/entity/salarysob/param/SalarySobItemSaveParam.java index edb9725da..b496115e8 100644 --- a/src/com/engine/salary/entity/salarysob/param/SalarySobItemSaveParam.java +++ b/src/com/engine/salary/entity/salarysob/param/SalarySobItemSaveParam.java @@ -73,6 +73,9 @@ public class SalarySobItemSaveParam { //公式") private Long formulaId; + //该分类是否隐藏(0不隐藏,1隐藏) + private Integer itemHide; + private Boolean canDelete; } @@ -94,5 +97,8 @@ public class SalarySobItemSaveParam { //分类下的薪资项目 private List items; + + //该分类是否隐藏(0不隐藏,1隐藏) + private Integer itemHide; } } diff --git a/src/com/engine/salary/entity/salarysob/po/SalarySobItemGroupPO.java b/src/com/engine/salary/entity/salarysob/po/SalarySobItemGroupPO.java index b81df8fa6..7d47935af 100644 --- a/src/com/engine/salary/entity/salarysob/po/SalarySobItemGroupPO.java +++ b/src/com/engine/salary/entity/salarysob/po/SalarySobItemGroupPO.java @@ -73,5 +73,8 @@ public class SalarySobItemGroupPO { */ private Date updateTime; + //该分类是否隐藏(0不隐藏,1隐藏) + private Integer itemHide; + Collection ids; } diff --git a/src/com/engine/salary/entity/salarysob/po/SalarySobItemHidePO.java b/src/com/engine/salary/entity/salarysob/po/SalarySobItemHidePO.java new file mode 100644 index 000000000..4dafcb92c --- /dev/null +++ b/src/com/engine/salary/entity/salarysob/po/SalarySobItemHidePO.java @@ -0,0 +1,71 @@ +package com.engine.salary.entity.salarysob.po; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * @Description hrsa_salary_item_hide 薪资项目是否在薪资核算中展示 + * @author Harryxzy + * @date 2022/8/22 18:00 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class SalarySobItemHidePO { + + /** + * ID + */ + private Long id; + + /** + * 账套ID + */ + private Long salarySobId; + + /** + * 薪资项目ID + */ + private Long salaryItemId; + + /** + * 类型(是否是项目组 0-不是 1-是) + */ + private Integer isGroup; + + /** + * 是否隐藏(0-不隐藏 1-隐藏) + */ + private Integer itemHide; + + /** + * 创建人 + */ + private Long creator; + + /** + * 是否删除 + */ + private Integer deleteType; + + /** + * 租户 + */ + private String tenantKey; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 更新时间 + */ + private Date updateTime; + +} diff --git a/src/com/engine/salary/entity/salarysob/po/SalarySobItemPO.java b/src/com/engine/salary/entity/salarysob/po/SalarySobItemPO.java index f9e287df2..bdfc35475 100644 --- a/src/com/engine/salary/entity/salarysob/po/SalarySobItemPO.java +++ b/src/com/engine/salary/entity/salarysob/po/SalarySobItemPO.java @@ -88,6 +88,9 @@ public class SalarySobItemPO { */ private Date updateTime; + //该分类是否隐藏(0不隐藏,1隐藏) + private Integer itemHide; + //in Collection ids; Collection salarySobIds; diff --git a/src/com/engine/salary/mapper/salarysob/SalarySobItemGroupMapper.java b/src/com/engine/salary/mapper/salarysob/SalarySobItemGroupMapper.java index f5dfcc103..82324c399 100644 --- a/src/com/engine/salary/mapper/salarysob/SalarySobItemGroupMapper.java +++ b/src/com/engine/salary/mapper/salarysob/SalarySobItemGroupMapper.java @@ -21,7 +21,8 @@ public interface SalarySobItemGroupMapper { * @return 返回集合,没有返回空List */ List listSome(SalarySobItemGroupPO salarySobItemGroup); - + + List listSomeWithItemHide(SalarySobItemGroupPO build); /** * 根据主键查询 @@ -85,5 +86,6 @@ public interface SalarySobItemGroupMapper { * @param salarySobItemGroups */ void batchInsert(@Param("collection") Collection salarySobItemGroups); - + + } \ No newline at end of file diff --git a/src/com/engine/salary/mapper/salarysob/SalarySobItemGroupMapper.xml b/src/com/engine/salary/mapper/salarysob/SalarySobItemGroupMapper.xml index d4540fcd8..bd29320f7 100644 --- a/src/com/engine/salary/mapper/salarysob/SalarySobItemGroupMapper.xml +++ b/src/com/engine/salary/mapper/salarysob/SalarySobItemGroupMapper.xml @@ -12,6 +12,7 @@ + @@ -93,6 +94,35 @@ + + + + INSERT INTO hrsa_salary_sob_item_group diff --git a/src/com/engine/salary/mapper/salarysob/SalarySobItemHideMapper.java b/src/com/engine/salary/mapper/salarysob/SalarySobItemHideMapper.java new file mode 100644 index 000000000..bd2033fa5 --- /dev/null +++ b/src/com/engine/salary/mapper/salarysob/SalarySobItemHideMapper.java @@ -0,0 +1,15 @@ +package com.engine.salary.mapper.salarysob; + +import com.engine.salary.entity.salarysob.po.SalarySobItemHidePO; + +import java.util.List; + +public interface SalarySobItemHideMapper { + + /** + * 根据账套id获取关闭显示开关的itemID + * @param salarySobPO + * @return + */ + List getById(SalarySobItemHidePO salarySobPO); +} diff --git a/src/com/engine/salary/mapper/salarysob/SalarySobItemHideMapper.xml b/src/com/engine/salary/mapper/salarysob/SalarySobItemHideMapper.xml new file mode 100644 index 000000000..b20be3fa6 --- /dev/null +++ b/src/com/engine/salary/mapper/salarysob/SalarySobItemHideMapper.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/com/engine/salary/mapper/salarysob/SalarySobItemMapper.java b/src/com/engine/salary/mapper/salarysob/SalarySobItemMapper.java index f6d450cd2..9c96ac650 100644 --- a/src/com/engine/salary/mapper/salarysob/SalarySobItemMapper.java +++ b/src/com/engine/salary/mapper/salarysob/SalarySobItemMapper.java @@ -1,7 +1,7 @@ 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.Mapper; import org.apache.ibatis.annotations.Param; import java.util.Collection; @@ -23,7 +23,9 @@ public interface SalarySobItemMapper { * @return 返回集合,没有返回空List */ List listSome(SalarySobItemPO salarySobItemPO); - + + List listBySalarySobIdWithHideItem(SalarySobItemPO salarySobItemPO); + /** * 根据主键查询 @@ -86,5 +88,24 @@ public interface SalarySobItemMapper { * @param salarySobItems */ void batchInsert(@Param("collection") Collection salarySobItems); - + + + /** + * 删除工资项目是否显示 + * + * @param salarySobIds + */ + void deleteItemShowBySalarySobId(@Param("salarySobIds")Collection salarySobIds); + + /** + * 插入薪资项目分组是否显示 + * @param salarySobItemHidePO + */ + void insertItemShow(SalarySobItemHidePO salarySobItemHidePO); + + /** + * 根据账套id以及薪资项目分组获取 + * @param + */ + List listBySalarySobIdAndGroupId(@Param("salarySobId") Long salarySobId,@Param("salarySobItemGroupIds") Collection salarySobItemGroupIds); } \ 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 d57bc554e..146873136 100644 --- a/src/com/engine/salary/mapper/salarysob/SalarySobItemMapper.xml +++ b/src/com/engine/salary/mapper/salarysob/SalarySobItemMapper.xml @@ -121,6 +121,53 @@ ORDER BY id DESC + + + + + @@ -284,6 +331,16 @@ AND delete_type = 0 + + + DELETE FROM hrsa_salary_item_hide + WHERE delete_type = 0 + AND salary_sob_id IN + + #{salarySobId} + + + UPDATE hrsa_salary_sob_item @@ -369,5 +426,13 @@ + + insert into hrsa_salary_item_hide(id,salary_sob_id,salary_item_id,is_group,item_hide, + creator,tenant_key,CREATE_TIME,update_time) + VALUES(#{id},#{salarySobId},#{salaryItemId}, + #{isGroup},#{itemHide},#{creator}, + #{tenantKey},#{createTime},#{updateTime}); + + \ No newline at end of file diff --git a/src/com/engine/salary/service/SalarySobItemGroupService.java b/src/com/engine/salary/service/SalarySobItemGroupService.java index d42e63f8b..85ce3d51f 100644 --- a/src/com/engine/salary/service/SalarySobItemGroupService.java +++ b/src/com/engine/salary/service/SalarySobItemGroupService.java @@ -31,6 +31,14 @@ public interface SalarySobItemGroupService { */ List listBySalarySobId(Long salarySobId); + /** + * 根据薪资账套id查询薪资账套的薪资项目分类带上隐藏信息 + * + * @param salarySobId 薪资账套id + * @return + */ + List listBySalarySobIdWithItemHide(Long salarySobId); + /** * 批量保存 * diff --git a/src/com/engine/salary/service/SalarySobItemHideService.java b/src/com/engine/salary/service/SalarySobItemHideService.java new file mode 100644 index 000000000..7551c75c2 --- /dev/null +++ b/src/com/engine/salary/service/SalarySobItemHideService.java @@ -0,0 +1,16 @@ +package com.engine.salary.service; + +import com.engine.salary.entity.salarysob.po.SalarySobItemHidePO; + +import java.util.List; + +public interface SalarySobItemHideService { + + /** + * 根据薪资账套id查询哪些字段关闭显示 + * + * @param salarySobId + * @return + */ + List listHideGroupBysalarySobId(SalarySobItemHidePO salarySobId); +} diff --git a/src/com/engine/salary/service/SalarySobItemService.java b/src/com/engine/salary/service/SalarySobItemService.java index 318ddaf37..933c1ead7 100644 --- a/src/com/engine/salary/service/SalarySobItemService.java +++ b/src/com/engine/salary/service/SalarySobItemService.java @@ -32,6 +32,20 @@ public interface SalarySobItemService { */ List listBySalarySobId(Long salarySobId); + /** + * 根据薪资账套id查询薪资账套的薪资项目副本(不包括已隐藏的薪资项目列) + * + * @param salarySobId 薪资账套的id + * @return + */ + List listBySalarySobIdWithHideItem(Long salarySobId); + + /** + * 根据薪资账套id和薪资项目分类查询薪资账套的薪资项目副本 + * + */ + List listBySalarySobIdAndGroupId(Long salarySobId,Collection salarySobItemGroupIds); + /** * 根据薪资账套id查询薪资账套的薪资项目副本 * @@ -73,6 +87,13 @@ public interface SalarySobItemService { */ SalarySobItemAggregateDTO getAggregateBySalarySobId(Long salarySobId); + /** + * 根据薪资账套id获取薪资账套的薪资项目聚合(员工信息、薪资项目副本、薪资项目分类)(不包含已设置为隐藏的) + * @param salarySobId + * @return + */ + SalarySobItemAggregateDTO getAggregateWithItemHideBySalarySobId(Long salarySobId); + /** * 保存 * @@ -92,4 +113,10 @@ public interface SalarySobItemService { * */ void deleteBySalarySobIds(Collection salarySobIds); + + /** + * 根据薪资账套id删除薪资项目是否显示 + * + */ + void deleteItemShowBySalarySobIds(Collection salarySobIds); } diff --git a/src/com/engine/salary/service/impl/SalaryAcctExcelServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctExcelServiceImpl.java index 17216bddb..39583cf2f 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctExcelServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctExcelServiceImpl.java @@ -258,7 +258,7 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc */ public List listWeaTableColumn(SalaryAcctRecordPO salaryAcctRecordPO) { // 查询薪资账套下的薪资项目+员工信息字段 - SalarySobItemAggregateDTO salarySobItemAggregateDTO = getSalarySobItemService(user).getAggregateBySalarySobId(salaryAcctRecordPO.getSalarySobId()); + SalarySobItemAggregateDTO salarySobItemAggregateDTO = getSalarySobItemService(user).getAggregateWithItemHideBySalarySobId(salaryAcctRecordPO.getSalarySobId()); // 构建薪资核算结果列表表头 return SalaryAcctResultBO.buildTableColumns(salarySobItemAggregateDTO); } diff --git a/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java index 9850e786f..98fb02af7 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java @@ -27,10 +27,7 @@ import com.engine.salary.entity.salaryacct.po.SalaryAcctResultTempPO; import com.engine.salary.entity.salaryformula.ExpressFormula; import com.engine.salary.entity.salaryitem.po.SalaryItemPO; import com.engine.salary.entity.salarysob.dto.*; -import com.engine.salary.entity.salarysob.po.SalarySobAdjustRulePO; -import com.engine.salary.entity.salarysob.po.SalarySobEmpFieldPO; -import com.engine.salary.entity.salarysob.po.SalarySobItemPO; -import com.engine.salary.entity.salarysob.po.SalarySobPO; +import com.engine.salary.entity.salarysob.po.*; import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.enums.salaryaccounting.SalaryAcctRecordStatusEnum; import com.engine.salary.enums.salarysob.IncomeCategoryEnum; @@ -117,6 +114,10 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe return ServiceUtil.getService(SalarySobAdjustRuleServiceImpl.class, user); } + private SalarySobItemHideService getSalarySobItemHideService(User user) { + return (SalarySobItemHideService) ServiceUtil.getService(SalarySobItemHideServiceImpl.class, user); + } + private SalaryAcctCalculateService getSalaryAcctCalculateService(User user) { return ServiceUtil.getService(SalaryAcctCalculateServiceImpl.class, user); } @@ -144,6 +145,11 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe return ServiceUtil.getService(SalaryAcctReportServiceImpl.class, user); } + private SalarySobItemGroupService getSalarySobItemGroupService(User user) { + return (SalarySobItemGroupService) ServiceUtil.getService(SalarySobItemGroupServiceImpl.class, user); + } + + private SalaryCheckResultService salaryCheckResultService; @Override @@ -192,8 +198,29 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe if (Objects.isNull(salaryAcctEmployeePO)) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98831, "薪资核算人员不存在或已被删除")); } + //---------------------------------------------- + + // 查询薪资账套的薪资项目分类 + List salarySobItemGroupPOS = getSalarySobItemGroupService(user).listBySalarySobIdWithItemHide(salaryAcctEmployeePO.getSalarySobId()); + // 获取关闭显示的分类 + List hideGroupIDs = getSalarySobItemHideService(user).listHideGroupBysalarySobId(SalarySobItemHidePO.builder().salarySobId(salaryAcctEmployeePO.getSalarySobId()).isGroup(1).build()); + // 过滤关闭显示的薪资项目分类 + salarySobItemGroupPOS = salarySobItemGroupPOS.stream().filter(group -> !(hideGroupIDs.contains(group.getId()))).collect(Collectors.toList()); + // 获取薪资项目分类ID + List salarySobItemGroupIds = salarySobItemGroupPOS.stream().map(SalarySobItemGroupPO::getId).collect(Collectors.toList()); + + // 查询薪资账套的薪资项目副本(已经过滤关闭分类显示按钮的薪资项目) + List salarySobItemPOS = getSalarySobItemService(user).listBySalarySobIdAndGroupId(salaryAcctEmployeePO.getSalarySobId(),salarySobItemGroupIds); + //---------------------------------------------- + // 查询薪资核算所用薪资账套的薪资项目副本 - List salarySobItemPOS = getSalarySobItemService(user).listBySalarySobId(salaryAcctEmployeePO.getSalarySobId()); +// List salarySobItemPOS = getSalarySobItemService(user).listBySalarySobId(salaryAcctEmployeePO.getSalarySobId()); + // 获取关闭显示的薪资项目 + List hideItemIDs = getSalarySobItemHideService(user).listHideGroupBysalarySobId(SalarySobItemHidePO.builder().salarySobId(salaryAcctEmployeePO.getSalarySobId()).isGroup(0).build()); + // 过滤薪资项目 + salarySobItemPOS = salarySobItemPOS.stream().filter(item->!(hideItemIDs.contains(item.getSalaryItemId())) ).collect(Collectors.toList()); + + // 查询薪资项目 Set salaryItemIds = SalaryEntityUtil.properties(salarySobItemPOS, SalarySobItemPO::getSalaryItemId); List salaryItemPOS = getSalaryItemService(user).listByIds(salaryItemIds); @@ -205,6 +232,7 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe List salaryAcctResultPOS = listBySalaryAcctEmployeeId(salaryAcctEmployeeId); // 查询个税扣缴义务人 TaxAgentPO taxAgent = getTaxAgentService(user).getById(salaryAcctEmployeePO.getTaxAgentId()); + // 转换成薪资核算结果详情dto return SalaryAcctResultBO.convert2DetailDTO(simpleEmployee, taxAgent, salaryAcctEmployeePO, salarySobEmpFieldPOS, salarySobItemPOS, salaryItemPOS, salaryAcctResultPOS); } diff --git a/src/com/engine/salary/service/impl/SalarySobItemGroupServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobItemGroupServiceImpl.java index a46462b91..366a23d7d 100644 --- a/src/com/engine/salary/service/impl/SalarySobItemGroupServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySobItemGroupServiceImpl.java @@ -30,6 +30,11 @@ public class SalarySobItemGroupServiceImpl extends Service implements SalarySobI return salarySobItemGroupMapper.listSome(SalarySobItemGroupPO.builder().salarySobId(salarySobId).build()); } + @Override + public List listBySalarySobIdWithItemHide(Long salarySobId) { + return salarySobItemGroupMapper.listSomeWithItemHide(SalarySobItemGroupPO.builder().salarySobId(salarySobId).build()); + } + @Override public void batchSave(Collection salarySobItemGroupPOS) { salarySobItemGroupMapper.batchInsert(salarySobItemGroupPOS); diff --git a/src/com/engine/salary/service/impl/SalarySobItemHideServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobItemHideServiceImpl.java new file mode 100644 index 000000000..8a30b7ba5 --- /dev/null +++ b/src/com/engine/salary/service/impl/SalarySobItemHideServiceImpl.java @@ -0,0 +1,18 @@ +package com.engine.salary.service.impl; + +import com.engine.core.impl.Service; +import com.engine.salary.biz.SalarySobItemHideBiz; +import com.engine.salary.entity.salarysob.po.SalarySobItemHidePO; +import com.engine.salary.service.SalarySobItemHideService; + +import java.util.List; + +public class SalarySobItemHideServiceImpl extends Service implements SalarySobItemHideService { + + private SalarySobItemHideBiz salarySobItemHideMapper = new SalarySobItemHideBiz(); + + @Override + public List listHideGroupBysalarySobId(SalarySobItemHidePO salarySobPO) { + return salarySobItemHideMapper.listSome(salarySobPO); + } +} diff --git a/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java index fb2b2611d..43b2ab9e8 100644 --- a/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java @@ -11,10 +11,7 @@ import com.engine.salary.entity.salaryitem.po.SalaryItemPO; import com.engine.salary.entity.salarysob.bo.SalarySobItemAggregateBO; import com.engine.salary.entity.salarysob.dto.SalarySobItemAggregateDTO; import com.engine.salary.entity.salarysob.param.SalarySobItemSaveParam; -import com.engine.salary.entity.salarysob.po.SalarySobEmpFieldPO; -import com.engine.salary.entity.salarysob.po.SalarySobItemGroupPO; -import com.engine.salary.entity.salarysob.po.SalarySobItemPO; -import com.engine.salary.entity.salarysob.po.SalarySobPO; +import com.engine.salary.entity.salarysob.po.*; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.service.*; import com.engine.salary.util.SalaryEntityUtil; @@ -27,6 +24,7 @@ import org.apache.commons.lang3.math.NumberUtils; import weaver.hrm.User; import java.util.*; +import java.util.stream.Collectors; /** * 薪资账套的薪资项目副本 @@ -51,6 +49,10 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe return (SalarySobItemGroupService) ServiceUtil.getService(SalarySobItemGroupServiceImpl.class, user); } + private SalarySobItemHideService getSalarySobItemHideService(User user) { + return (SalarySobItemHideService) ServiceUtil.getService(SalarySobItemHideServiceImpl.class, user); + } + private SalaryFormulaService getSalaryFormulaService(User user) { return (SalaryFormulaService) ServiceUtil.getService(SalaryFormulaServiceImpl.class, user); } @@ -70,6 +72,16 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe return salarySobItemMapper.listSome(SalarySobItemPO.builder().salarySobId(salarySobId).build()); } + @Override + public List listBySalarySobIdWithHideItem(Long salarySobId) { + return salarySobItemMapper.listBySalarySobIdWithHideItem(SalarySobItemPO.builder().salarySobId(salarySobId).build()); + } + + @Override + public List listBySalarySobIdAndGroupId(Long salarySobId,Collection salarySobItemGroupIds) { + return salarySobItemMapper.listBySalarySobIdAndGroupId(salarySobId,salarySobItemGroupIds); + } + @Override public List listBySalarySobIds(Collection salarySobIds) { return salarySobItemMapper.listSome(SalarySobItemPO.builder().salarySobIds(salarySobIds).build()); @@ -110,9 +122,11 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe // 查询薪资账套的员工信息字段 List salarySobEmpFieldPOS = getSalarySobEmpFieldService(user).listBySalarySobId(salarySobId); // 查询薪资账套的薪资项目分类 - List salarySobItemGroupPOS = getSalarySobItemGroupService(user).listBySalarySobId(salarySobId); + List salarySobItemGroupPOS = getSalarySobItemGroupService(user).listBySalarySobIdWithItemHide(salarySobId); + // 查询薪资账套的薪资项目副本 - List salarySobItemPOS = listBySalarySobId(salarySobId); + List salarySobItemPOS =listBySalarySobIdWithHideItem (salarySobId); + // 薪资账套的薪资项目副本所用的公式id Set formulaIds = SalaryEntityUtil.properties(salarySobItemPOS, SalarySobItemPO::getFormulaId); // 查询公式详情 @@ -120,6 +134,48 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe // 查询薪资账套的薪资项目副本所关联的薪资项目 Set salaryItemIds = SalaryEntityUtil.properties(salarySobItemPOS, SalarySobItemPO::getSalaryItemId); List salaryItemPOS = getSalaryItemService(user).listByIds(salaryItemIds); + + // 转换成聚合dto + SalarySobItemAggregateBO salarySobItemAggregateBO = new SalarySobItemAggregateBO(salarySobPO, salarySobEmpFieldPOS, + salarySobItemGroupPOS, salarySobItemPOS, expressFormulas, salaryItemPOS); + return salarySobItemAggregateBO.convert2AggregateDTO(); + } + + @Override + public SalarySobItemAggregateDTO getAggregateWithItemHideBySalarySobId(Long salarySobId) { + // 查询薪资账套 + SalarySobPO salarySobPO = salarySobBiz.getById(salarySobId); + if (Objects.isNull(salarySobPO)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98379, "参数错误,薪资账套不存在或者已被删除")); + } + // 查询薪资账套的员工信息字段 + List salarySobEmpFieldPOS = getSalarySobEmpFieldService(user).listBySalarySobId(salarySobId); + // 查询薪资账套的薪资项目分类 + List salarySobItemGroupPOS = getSalarySobItemGroupService(user).listBySalarySobIdWithItemHide(salarySobId); + + // 获取关闭显示的分类 + List hideGroupIDs = getSalarySobItemHideService(user).listHideGroupBysalarySobId(SalarySobItemHidePO.builder().salarySobId(salarySobId).isGroup(1).build()); + // 过滤关闭显示的薪资项目分类 + salarySobItemGroupPOS = salarySobItemGroupPOS.stream().filter(group -> !(hideGroupIDs.contains(group.getId()))).collect(Collectors.toList()); + // 获取薪资项目分类ID + List salarySobItemGroupIds = salarySobItemGroupPOS.stream().map(SalarySobItemGroupPO::getId).collect(Collectors.toList()); + + // 查询薪资账套的薪资项目副本(已经过滤关闭分类显示按钮的薪资项目) + List salarySobItemPOS = listBySalarySobIdAndGroupId(salarySobId,salarySobItemGroupIds); + + // 获取关闭显示的薪资项目 + List hideItemIDs = getSalarySobItemHideService(user).listHideGroupBysalarySobId(SalarySobItemHidePO.builder().salarySobId(salarySobId).isGroup(0).build()); + salarySobItemPOS = salarySobItemPOS.stream().filter(group -> !(hideItemIDs.contains(group.getSalaryItemId()))).collect(Collectors.toList()); + + // 薪资账套的薪资项目副本所用的公式id + Set formulaIds = SalaryEntityUtil.properties(salarySobItemPOS, SalarySobItemPO::getFormulaId); + // 查询公式详情 + List expressFormulas = getSalaryFormulaService(user).listExpressFormula(formulaIds); + // 查询薪资账套的薪资项目副本所关联的薪资项目 + Set salaryItemIds = SalaryEntityUtil.properties(salarySobItemPOS, SalarySobItemPO::getSalaryItemId); + List salaryItemPOS = getSalaryItemService(user).listByIds(salaryItemIds); + + // 转换成聚合dto SalarySobItemAggregateBO salarySobItemAggregateBO = new SalarySobItemAggregateBO(salarySobPO, salarySobEmpFieldPOS, salarySobItemGroupPOS, salarySobItemPOS, expressFormulas, salaryItemPOS); @@ -186,6 +242,8 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe } } + + /** * 清楚原相关数据 * @@ -198,6 +256,9 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe deleteBySalarySobIds(Collections.singleton(salarySobId)); // 删除薪资账套的薪资项目分类 getSalarySobItemGroupService(user).deleteBySalarySobIds(Collections.singleton(salarySobId)); + // 删除薪资项目是否显示 + deleteItemShowBySalarySobIds(Collections.singleton(salarySobId)); + } /** @@ -248,6 +309,28 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe .build(); //保存分类 salarySobItemGroupBiz.insert(salarySobItemGroupPO); + + + // 保存薪资项目分类 字段显隐 + Long salarySobGroupItemShowId = IdGenerator.generate(); + SalarySobItemHidePO salarySobGroupItemHidePO = SalarySobItemHidePO.builder() + .id(salarySobGroupItemShowId) + .salarySobId(salarySobId) + .salaryItemId(salarySobItemGroupId) + .isGroup(1) + .itemHide(itemGroupParam.getItemHide()) + .creator(employeeId) + .createTime(now) + .updateTime(now) + .deleteType(NumberUtils.INTEGER_ZERO) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .build(); + if(itemGroupParam.getItemHide()==null){ + salarySobGroupItemHidePO.setItemHide(0); + } + salarySobItemMapper.InsertItemShow(salarySobGroupItemHidePO); + + // //获取分类id // List salarySobItemGroupPOS = salarySobItemGroupBiz.listSome(SalarySobItemGroupPO.builder().salarySobId(salarySobId).name(itemGroupParam.getName()).build()); // Long salarySobItemGroupId = salarySobItemGroupPOS.get(0).getId(); @@ -269,9 +352,27 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe .canDelete(itemParam.getCanDelete() == null ? NumberUtils.INTEGER_ONE : (itemParam.getCanDelete() ? NumberUtils.INTEGER_ONE : NumberUtils.INTEGER_ZERO)) .build(); salarySobItems.add(salarySobItemPO); + + // 保存薪资项目是否展示 + Long salarySobItemShowId = IdGenerator.generate(); + SalarySobItemHidePO salarySobItemHidePO = SalarySobItemHidePO.builder() + .id(salarySobItemShowId) + .salarySobId(salarySobId) + .salaryItemId(itemParam.getSalaryItemId()) + .isGroup(0) + .itemHide(itemParam.getItemHide()) + .creator(employeeId) + .createTime(now) + .updateTime(now) + .deleteType(NumberUtils.INTEGER_ZERO) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .build(); + salarySobItemMapper.InsertItemShow(salarySobItemHidePO); + } } + for (SalarySobItemSaveParam.SalarySobItemParam itemParam : saveParam.getItems()) { SalarySobItemPO salarySobItemPO = SalarySobItemPO.builder() .salarySobId(salarySobId) @@ -288,6 +389,22 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe .canDelete(itemParam.getCanDelete() == null ? NumberUtils.INTEGER_ONE : (itemParam.getCanDelete() ? NumberUtils.INTEGER_ONE : NumberUtils.INTEGER_ZERO)) .build(); salarySobItems.add(salarySobItemPO); + + // 保存未分类薪资项目是否展示 + Long salarySobItemShowId = IdGenerator.generate(); + SalarySobItemHidePO salarySobItemHidePO = SalarySobItemHidePO.builder() + .id(salarySobItemShowId) + .salarySobId(salarySobId) + .salaryItemId(itemParam.getSalaryItemId()) + .isGroup(0) + .itemHide(itemParam.getItemHide()) + .creator(employeeId) + .createTime(now) + .updateTime(now) + .deleteType(NumberUtils.INTEGER_ZERO) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .build(); + salarySobItemMapper.InsertItemShow(salarySobItemHidePO); } // 保存薪资账套的薪资项目副本 @@ -306,4 +423,9 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe public void deleteBySalarySobIds(Collection salarySobIds) { salarySobItemMapper.deleteBySalarySobIds(salarySobIds); } + + @Override + public void deleteItemShowBySalarySobIds(Collection salarySobIds) { + salarySobItemMapper.deleteItemShowBySalarySobId(salarySobIds); + } } diff --git a/src/com/engine/salary/web/SalarySobController.java b/src/com/engine/salary/web/SalarySobController.java index 6aa3e7ae2..29bb81de7 100644 --- a/src/com/engine/salary/web/SalarySobController.java +++ b/src/com/engine/salary/web/SalarySobController.java @@ -264,6 +264,8 @@ public class SalarySobController { + + /**********************************薪资账套的薪资项目 end*********************************/ /**********************************调薪计薪规则 start*********************************/ From 7dfe9ee732ea290c227db881faa20555edbd6b65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 24 Aug 2022 12:03:04 +0800 Subject: [PATCH 02/12] =?UTF-8?q?=E7=A6=8F=E5=88=A9=E6=96=B9=E6=A1=88?= =?UTF-8?q?=E5=88=86=E6=9D=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/engine/salary/biz/SISchemeBiz.java | 2 +- .../entity/sischeme/bo/InsuranceSchemeBO.java | 4 + .../sischeme/dto/InsuranceSchemeDTO.java | 12 + .../entity/sischeme/po/InsuranceSchemePO.java | 14 ++ .../enums/sicategory/SharedTypeEnum.java | 37 +++ .../mapper/sischeme/InsuranceSchemeMapper.xml | 14 ++ .../service/impl/SISchemeServiceImpl.java | 229 ++++++------------ .../engine/salary/util/SalaryEntityUtil.java | 18 ++ .../engine/salary/web/SISchemeController.java | 14 -- 9 files changed, 180 insertions(+), 164 deletions(-) create mode 100644 src/com/engine/salary/enums/sicategory/SharedTypeEnum.java diff --git a/src/com/engine/salary/biz/SISchemeBiz.java b/src/com/engine/salary/biz/SISchemeBiz.java index 7c81d4479..a5f1382c1 100644 --- a/src/com/engine/salary/biz/SISchemeBiz.java +++ b/src/com/engine/salary/biz/SISchemeBiz.java @@ -246,7 +246,7 @@ public class SISchemeBiz { //保存福利项目主表 InsuranceSchemeMapper insuranceSchemeMapper = sqlSession.getMapper(InsuranceSchemeMapper.class); List listResult = insuranceSchemeMapper.listByName(saveParam.getInsuranceScheme().getSchemeName()); - SalaryAssert.isEmpty(listResult, "该福利名称已经存在"); + SalaryAssert.isEmpty(listResult, "该福利名称已经存在,福利名称系统全局唯一"); InsuranceSchemePO insuranceSchemePO = InsuranceSchemeBO.convert2BatchPO(saveParam.getInsuranceScheme(), employeeId); insuranceSchemeMapper.insert(insuranceSchemePO); diff --git a/src/com/engine/salary/entity/sischeme/bo/InsuranceSchemeBO.java b/src/com/engine/salary/entity/sischeme/bo/InsuranceSchemeBO.java index fb2e3afba..1a6cdd3d5 100644 --- a/src/com/engine/salary/entity/sischeme/bo/InsuranceSchemeBO.java +++ b/src/com/engine/salary/entity/sischeme/bo/InsuranceSchemeBO.java @@ -38,6 +38,8 @@ public class InsuranceSchemeBO { .schemeName(dto.getSchemeName()) .paymentType(dto.getPaymentType().getValue()) .welfareType(dto.getWelfareType().getValue()) + .sharedType(dto.getSharedType()) + .taxAgentIds(dto.getTaxAgentIds()) .isUse(1) .paymentArea(dto.getPaymentArea()) .remarks(dto.getRemarks()) @@ -82,6 +84,8 @@ public class InsuranceSchemeBO { po.setPaymentType(dto.getPaymentType().getValue()); po.setSchemeName(dto.getSchemeName()); po.setRemarks(dto.getRemarks()); + po.setSharedType(dto.getSharedType()); + po.setTaxAgentIds(dto.getTaxAgentIds()); return po; } } diff --git a/src/com/engine/salary/entity/sischeme/dto/InsuranceSchemeDTO.java b/src/com/engine/salary/entity/sischeme/dto/InsuranceSchemeDTO.java index d71d8ba48..f27776bc1 100644 --- a/src/com/engine/salary/entity/sischeme/dto/InsuranceSchemeDTO.java +++ b/src/com/engine/salary/entity/sischeme/dto/InsuranceSchemeDTO.java @@ -1,6 +1,7 @@ package com.engine.salary.entity.sischeme.dto; import com.engine.salary.enums.sicategory.PaymentTypeEnum; +import com.engine.salary.enums.sicategory.SharedTypeEnum; import com.engine.salary.enums.sicategory.WelfareTypeEnum; import lombok.AllArgsConstructor; import lombok.Builder; @@ -39,6 +40,17 @@ public class InsuranceSchemeDTO { */ private String schemeName; + /** + * 共享权限 + * @see SharedTypeEnum + */ + private String sharedType; + + /** + * 个税扣缴义务人 + */ + private String taxAgentIds; + /** * 备注 */ diff --git a/src/com/engine/salary/entity/sischeme/po/InsuranceSchemePO.java b/src/com/engine/salary/entity/sischeme/po/InsuranceSchemePO.java index 8a2042a5b..002ecdac8 100644 --- a/src/com/engine/salary/entity/sischeme/po/InsuranceSchemePO.java +++ b/src/com/engine/salary/entity/sischeme/po/InsuranceSchemePO.java @@ -1,5 +1,6 @@ package com.engine.salary.entity.sischeme.po; +import com.engine.salary.enums.sicategory.SharedTypeEnum; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -18,6 +19,7 @@ import java.util.Date; @Builder @NoArgsConstructor @AllArgsConstructor +//hrsa_social_security_scheme public class InsuranceSchemePO { /** @@ -45,6 +47,18 @@ public class InsuranceSchemePO { */ private Integer welfareType; + /** + * 共享权限 + * + * @see SharedTypeEnum + */ + private String sharedType; + + /** + * 个税扣缴义务人 + */ + private String taxAgentIds; + /** * 是否启用 0-停用 1-启用 */ diff --git a/src/com/engine/salary/enums/sicategory/SharedTypeEnum.java b/src/com/engine/salary/enums/sicategory/SharedTypeEnum.java new file mode 100644 index 000000000..7ff3d03cd --- /dev/null +++ b/src/com/engine/salary/enums/sicategory/SharedTypeEnum.java @@ -0,0 +1,37 @@ +package com.engine.salary.enums.sicategory; + +import com.engine.salary.enums.BaseEnum; + + +public enum SharedTypeEnum implements BaseEnum { + PUBLIC("0", "公共", 86568), + PRIVATE("1", "私有", 86569); + + private String value; + + private String defaultLabel; + + private Integer labelId; + + SharedTypeEnum(String value, String defaultLabel, Integer labelId) { + this.value = value; + this.defaultLabel = defaultLabel; + this.labelId = labelId; + } + + + @Override + public String getValue() { + return this.value; + } + + @Override + public Integer getLabelId() { + return this.labelId; + } + + @Override + public String getDefaultLabel() { + return this.defaultLabel; + } +} diff --git a/src/com/engine/salary/mapper/sischeme/InsuranceSchemeMapper.xml b/src/com/engine/salary/mapper/sischeme/InsuranceSchemeMapper.xml index c1c08c17e..7575dd027 100644 --- a/src/com/engine/salary/mapper/sischeme/InsuranceSchemeMapper.xml +++ b/src/com/engine/salary/mapper/sischeme/InsuranceSchemeMapper.xml @@ -14,6 +14,8 @@ + + @@ -30,6 +32,8 @@ , t.creator , t.delete_type , t.tenant_key + , t.shared_type + , t.tax_agent_ids @@ -85,6 +89,8 @@ creator, delete_type, tenant_key, + shared_type, + tax_agent_ids #{paymentArea}, @@ -98,6 +104,8 @@ #{creator}, #{deleteType}, #{tenantKey}, + #{sharedType}, + #{taxAgentIds} @@ -119,6 +127,8 @@ creator, delete_type, tenant_key, + shared_type, + tax_agent_ids #{paymentArea}, @@ -132,6 +142,8 @@ #{creator}, #{deleteType}, #{tenantKey}, + #{sharedType}, + #{taxAgentIds} @@ -144,6 +156,8 @@ payment_type=#{paymentType}, scheme_name=#{schemeName}, remarks=#{remarks}, + shared_type=#{sharedType}, + tax_agent_ids=#{taxAgentIds} WHERE id = #{id} AND delete_type = 0 diff --git a/src/com/engine/salary/service/impl/SISchemeServiceImpl.java b/src/com/engine/salary/service/impl/SISchemeServiceImpl.java index 2fdd05e63..ad8e1e567 100644 --- a/src/com/engine/salary/service/impl/SISchemeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SISchemeServiceImpl.java @@ -86,6 +86,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { private InsuranceSchemeMapper getInsuranceSchemeMapper() { return MapperProxyFactory.getProxy(InsuranceSchemeMapper.class); } + private TaxAgentMapper getTaxAgentMapper() { return MapperProxyFactory.getProxy(TaxAgentMapper.class); } @@ -153,7 +154,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { @Override public Map getSchemeIdNameMap() { Map result = new HashMap<>(); - List insuranceSchemePOS = MapperProxyFactory.getProxy(InsuranceSchemeMapper.class).listAll(); + List insuranceSchemePOS = getInsuranceSchemeMapper().listAll(); if (CollectionUtils.isNotEmpty(insuranceSchemePOS)) { result = insuranceSchemePOS.stream().collect(Collectors.toMap(InsuranceSchemePO::getId, InsuranceSchemePO::getSchemeName)); } @@ -163,26 +164,33 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { @Override public PageInfo list(InsuranceSchemeParam queryParam) { SalaryAssert.notNull(queryParam.getWelfareTypeEnum(), SalaryI18nUtil.getI18nLabel(84026, "参数错误")); - - SalaryPageUtil.start(queryParam.getCurrent(), queryParam.getPageSize()); - List insuranceSchemePOS = MapperProxyFactory.getProxy(InsuranceSchemeMapper.class).listByWelfareType(queryParam.getWelfareTypeEnum().getValue()); - PageInfo pageInfo = new PageInfo<>(insuranceSchemePOS, InsuranceSchemePO.class); - List collect = insuranceSchemePOS.stream().map(item -> - InsuranceSchemeListDTO.builder() - .id(item.getId()) - .paymentType(SalaryI18nUtil.getI18nLabel(buildPaymentTypeEnum(item.getPaymentType()).getLabelId(), - buildPaymentTypeEnum(item.getPaymentType()).getDefaultLabel())) - .schemeName(item.getSchemeName()) - .paymentArea(item.getPaymentArea()) - .paymentScope(buildPaymentScope(item.getId())) - .remarks(item.getRemarks()) - .build() - ).collect(Collectors.toList()); + Long currentEmployeeId = (long) user.getUID(); + List insuranceSchemePOS; + Boolean needAuth = getTaxAgentService().isNeedAuth(currentEmployeeId); + if (needAuth) { + insuranceSchemePOS = getInsuranceSchemeMapper().listByWelfareType(queryParam.getWelfareTypeEnum().getValue()); + //分权 + Collection taxAgentPOS = getTaxAgentService().listAllTaxAgents(currentEmployeeId); + List authTaxAgentIds = SalaryEntityUtil.properties(taxAgentPOS, TaxAgentPO::getId, Collectors.toList()); + insuranceSchemePOS = insuranceSchemePOS.stream().filter(po -> { + String taxAgentIdsStr = po.getTaxAgentIds(); + List taxAgentIds = new ArrayList<>(); + if (StringUtils.isNotBlank(taxAgentIdsStr)) { + taxAgentIds = Arrays.stream(taxAgentIdsStr.split(",")).map(Long::valueOf).collect(Collectors.toList()); + } + return StringUtils.isBlank(po.getSharedType()) || SharedTypeEnum.PUBLIC.getValue().equals(po.getSharedType()) || (SharedTypeEnum.PRIVATE.getValue().equals(po.getSharedType()) && SalaryEntityUtil.judgeIntersection(authTaxAgentIds, taxAgentIds)); + }).collect(Collectors.toList()); + } else { + insuranceSchemePOS = getInsuranceSchemeMapper().listByWelfareType(queryParam.getWelfareTypeEnum().getValue()); + } PageInfo dtoPage = new PageInfo<>(InsuranceSchemeListDTO.class); dtoPage.setPageNum(queryParam.getCurrent()); dtoPage.setPageSize(queryParam.getPageSize()); - dtoPage.setTotal(pageInfo.getTotal()); + dtoPage.setTotal(insuranceSchemePOS.size()); + //分页 + insuranceSchemePOS = SalaryPageUtil.subList(queryParam.getCurrent(), queryParam.getPageSize(), insuranceSchemePOS); + List collect = insuranceSchemePOS.stream().map(item -> InsuranceSchemeListDTO.builder().id(item.getId()).paymentType(SalaryI18nUtil.getI18nLabel(buildPaymentTypeEnum(item.getPaymentType()).getLabelId(), buildPaymentTypeEnum(item.getPaymentType()).getDefaultLabel())).schemeName(item.getSchemeName()).paymentArea(item.getPaymentArea()).paymentScope(buildPaymentScope(item.getId())).remarks(item.getRemarks()).build()).collect(Collectors.toList()); dtoPage.setList(collect); return dtoPage; } @@ -226,15 +234,9 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { otherList.addAll(InsuranceArchivesOtherSchemePOEncrypt.decryptList(siArchivesBiz.getOtherByEmployeeIds(ids))); } - Map socialSchemePOMap = - socialList - .stream().collect(Collectors.toMap(InsuranceArchivesSocialSchemePO::getEmployeeId, Function.identity())); - Map fundSchemePOMap = - fundList - .stream().collect(Collectors.toMap(InsuranceArchivesFundSchemePO::getEmployeeId, Function.identity())); - Map otherSchemePOMap = - otherList - .stream().collect(Collectors.toMap(InsuranceArchivesOtherSchemePO::getEmployeeId, Function.identity())); + Map socialSchemePOMap = socialList.stream().collect(Collectors.toMap(InsuranceArchivesSocialSchemePO::getEmployeeId, Function.identity())); + Map fundSchemePOMap = fundList.stream().collect(Collectors.toMap(InsuranceArchivesFundSchemePO::getEmployeeId, Function.identity())); + Map otherSchemePOMap = otherList.stream().collect(Collectors.toMap(InsuranceArchivesOtherSchemePO::getEmployeeId, Function.identity())); insuranceArchivesEmployeePOS.forEach(item -> { InsuranceArchivesSocialSchemePO socialItem = socialSchemePOMap.get(item.getEmployeeId()); InsuranceArchivesFundSchemePO fundItem = fundSchemePOMap.get(item.getEmployeeId()); @@ -254,7 +256,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { }); if (socialJson != null) { map.putAll(socialJson); - // SalaryEntityUtil.thousandthConvert(socialJson, map); + // SalaryEntityUtil.thousandthConvert(socialJson, map); } map.put("socialAccount", socialItem.getSocialAccount()); map.put("socialStartTime", socialItem.getSocialStartTime()); @@ -267,7 +269,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { }); if (fundJson != null) { map.putAll(fundJson); - // SalaryEntityUtil.thousandthConvert(fundJson, map); + // SalaryEntityUtil.thousandthConvert(fundJson, map); } map.put("supplementFundAccount", fundItem.getSupplementFundAccount()); map.put("fundStartTime", fundItem.getFundStartTime()); @@ -368,8 +370,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { * @return result */ public String buildPaymentScope(Long id) { - List collect = queryInsuranceSchemeDetailList(id).stream().map(InsuranceSchemeDetailPO::getInsuranceId).distinct().collect(Collectors.toList()) - .stream().map(this::queryInsuranceName).collect(Collectors.toList()); + List collect = queryInsuranceSchemeDetailList(id).stream().map(InsuranceSchemeDetailPO::getInsuranceId).distinct().collect(Collectors.toList()).stream().map(this::queryInsuranceName).collect(Collectors.toList()); return StringUtils.join(collect, "、"); } @@ -389,8 +390,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { if (schemeId == null) { return ""; } - InsuranceSchemePO insuranceSchemePO = - getInsuranceSchemeMapper().getById(schemeId); + InsuranceSchemePO insuranceSchemePO = getInsuranceSchemeMapper().getById(schemeId); if (insuranceSchemePO == null) { return ""; } else { @@ -487,13 +487,9 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { }); Map socialMap = new HashMap<>(); Map socialCollect = new HashMap<>(); - Map customSocial = - getICategoryMapper().listByWelfareType(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), null) - .stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity())); + Map customSocial = getICategoryMapper().listByWelfareType(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), null).stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity())); - Map sysSocial = - getICategoryMapper().listByWelfareType(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), DataTypeEnum.SYSTEM.getValue()) - .stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity())); + Map sysSocial = getICategoryMapper().listByWelfareType(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), DataTypeEnum.SYSTEM.getValue()).stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity())); socialCollect.putAll(customSocial); socialCollect.putAll(sysSocial); socialSet.forEach(item -> { @@ -503,12 +499,8 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { }); Map fundMap = new HashMap<>(); Map fundCollect = new HashMap<>(); - Map customFund = - getICategoryMapper().listByWelfareType(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), null) - .stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity())); - Map sysFund = - getICategoryMapper().listByWelfareType(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), DataTypeEnum.SYSTEM.getValue()) - .stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity())); + Map customFund = getICategoryMapper().listByWelfareType(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), null).stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity())); + Map sysFund = getICategoryMapper().listByWelfareType(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), DataTypeEnum.SYSTEM.getValue()).stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity())); fundCollect.putAll(customFund); fundCollect.putAll(sysFund); fundSet.forEach(item -> { @@ -518,12 +510,8 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { }); Map otherMap = new HashMap<>(); Map otherCollect = new HashMap<>(); - Map customOther = - getICategoryMapper().listByWelfareType(WelfareTypeEnum.OTHER.getValue(), null) - .stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity())); - Map sysOther = - getICategoryMapper().listByWelfareType(WelfareTypeEnum.OTHER.getValue(), DataTypeEnum.SYSTEM.getValue()) - .stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity())); + Map customOther = getICategoryMapper().listByWelfareType(WelfareTypeEnum.OTHER.getValue(), null).stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity())); + Map sysOther = getICategoryMapper().listByWelfareType(WelfareTypeEnum.OTHER.getValue(), DataTypeEnum.SYSTEM.getValue()).stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity())); otherCollect.putAll(customOther); otherCollect.putAll(sysOther); otherSet.forEach(item -> { @@ -631,9 +619,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { singleAccount.add(cellData); } - isError = singleAccountCheck(singleAccount, welfareMap, insuranceArchivesAccountPOS, employeeByIds, excelComments, errorCount + 1, schemeNameIdMap, - paymentNameIdMap, - creator, i + 2, openDevolution, taxAgentManageRangeEmployeeTree); + isError = singleAccountCheck(singleAccount, welfareMap, insuranceArchivesAccountPOS, employeeByIds, excelComments, errorCount + 1, schemeNameIdMap, paymentNameIdMap, creator, i + 2, openDevolution, taxAgentManageRangeEmployeeTree); if (isError) { errorCount += 1; // 添加错误数据 @@ -689,12 +675,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { return userState; } - public boolean singleAccountCheck(List> singleAccount, Map welfareMap, List insuranceArchivesAccountPOS, - List employeeByIds, - List> excelComments, int i, Map schemeNameIdMap, Map paymentNameIdMap, Long creator, int index, - Boolean openDevolution, - List taxAgentManageRangeEmployeeTree - ) { + public boolean singleAccountCheck(List> singleAccount, Map welfareMap, List insuranceArchivesAccountPOS, List employeeByIds, List> excelComments, int i, Map schemeNameIdMap, Map paymentNameIdMap, Long creator, int index, Boolean openDevolution, List taxAgentManageRangeEmployeeTree) { boolean isError = false; String userName = (String) singleAccount.get(0).get(SalaryI18nUtil.getI18nLabel(85429, "姓名")); String deparmentName = (String) singleAccount.get(1).get(SalaryI18nUtil.getI18nLabel(86185, "部门")); @@ -707,11 +688,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { excelComments.add(errorMessageMap); isError = true; } - List employees = employeeByIds.stream().filter(e -> (StringUtils.isBlank(userName) || Objects.equals(e.getUsername(), userName)) - && (StringUtils.isBlank(deparmentName) || Objects.equals(e.getDepartmentName(), deparmentName)) - && (StringUtils.isBlank(telephone) || Objects.equals(e.getMobile(), telephone)) - && (StringUtils.isBlank(userStatus) || Objects.equals(userStateExchange(e.getStatus()), userStatus))) - .collect(Collectors.toList()); + List employees = employeeByIds.stream().filter(e -> (StringUtils.isBlank(userName) || Objects.equals(e.getUsername(), userName)) && (StringUtils.isBlank(deparmentName) || Objects.equals(e.getDepartmentName(), deparmentName)) && (StringUtils.isBlank(telephone) || Objects.equals(e.getMobile(), telephone)) && (StringUtils.isBlank(userStatus) || Objects.equals(userStateExchange(e.getStatus()), userStatus))).collect(Collectors.toList()); if (CollectionUtils.isEmpty(employees)) { Map errorMessageMap = Maps.newHashMap(); errorMessageMap.put("message", rowIndex + "员工信息不存在"); @@ -748,9 +725,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { Map fundEndTimeMap = findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91484, "公积金最后缴纳月")); Map otherStartTimeMap = findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91490, "其他福利起始缴纳月")); Map otherEndTimeMap = findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91494, "其他福利最后缴纳月")); - if (StringUtils.isBlank((String) socialMap.get(SalaryI18nUtil.getI18nLabel(91323, "社保方案名称"))) && StringUtils.isBlank( - (String) fundMap.get(SalaryI18nUtil.getI18nLabel(91485, "公积金方案名称"))) - && StringUtils.isBlank((String) otherMap.get(SalaryI18nUtil.getI18nLabel(91496, "其他福利方案名称")))) { + if (StringUtils.isBlank((String) socialMap.get(SalaryI18nUtil.getI18nLabel(91323, "社保方案名称"))) && StringUtils.isBlank((String) fundMap.get(SalaryI18nUtil.getI18nLabel(91485, "公积金方案名称"))) && StringUtils.isBlank((String) otherMap.get(SalaryI18nUtil.getI18nLabel(91496, "其他福利方案名称")))) { Map errorMessageMap = Maps.newHashMap(); errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(100312, "社保,公积金,其他福利方案名称不可同时为空")); excelComments.add(errorMessageMap); @@ -764,7 +739,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(100579, "个税扣缴义务人不允许为空")); excelComments.add(errorMessageMap); isError = true; - }else if (!paymentNameIdMap.containsKey(paymentOrg)) { + } else if (!paymentNameIdMap.containsKey(paymentOrg)) { Map errorMessageMap = Maps.newHashMap(); errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(100312, "社保缴纳组织应和个税扣缴义务人名称一致,社保缴纳组织不存在或不在权限范围内")); excelComments.add(errorMessageMap); @@ -775,7 +750,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { Long paymentOrgId = paymentNameIdMap.get(paymentOrg); TaxAgentManageRangeEmployeeDTO taxAgentManageRangeEmployeeDTO = taxAgentManageRangeEmployeeTree.stream().filter(tax -> tax.getTaxAgentId().equals(paymentOrgId)).findFirst().get(); Optional o = taxAgentManageRangeEmployeeDTO.getEmployeeList().stream().map(TaxAgentManageRangeEmployeeDTO.TaxAgentEmployee::getEmployeeId).filter(e -> e.equals(employeeId)).findFirst(); - if(!o.isPresent()){ + if (!o.isPresent()) { Map errorMessageMap = Maps.newHashMap(); errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(100312, "该条数据不在个税扣缴义务人人员范围内,不可导入")); excelComments.add(errorMessageMap); @@ -849,18 +824,15 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { excelComments.add(errorMessageMap); isError = true; } - if (StringUtils.isNotBlank((String) socialMap.get(SalaryI18nUtil.getI18nLabel(91323, "社保方案名称"))) - && schemeNameIdMap.get((String) socialMap.get(SalaryI18nUtil.getI18nLabel(91323, "社保方案名称"))) == null) { + if (StringUtils.isNotBlank((String) socialMap.get(SalaryI18nUtil.getI18nLabel(91323, "社保方案名称"))) && schemeNameIdMap.get((String) socialMap.get(SalaryI18nUtil.getI18nLabel(91323, "社保方案名称"))) == null) { Map errorMessageMap = Maps.newHashMap(); - errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(100322, - "社保方案不存在")); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(100322, "社保方案不存在")); excelComments.add(errorMessageMap); isError = true; } else { insuranceArchivesSocialSchemePO = buildSocialPO(employeeId, welfareMap, singleAccount, schemeNameIdMap, paymentNameIdMap, creator); } - if (StringUtils.isNotBlank((String) fundMap.get(SalaryI18nUtil.getI18nLabel(91485, "公积金方案名称"))) - && schemeNameIdMap.get((String) fundMap.get(SalaryI18nUtil.getI18nLabel(91485, "公积金方案名称"))) == null) { + if (StringUtils.isNotBlank((String) fundMap.get(SalaryI18nUtil.getI18nLabel(91485, "公积金方案名称"))) && schemeNameIdMap.get((String) fundMap.get(SalaryI18nUtil.getI18nLabel(91485, "公积金方案名称"))) == null) { Map errorMessageMap = Maps.newHashMap(); errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(100323, "公积金方案不存在")); excelComments.add(errorMessageMap); @@ -868,8 +840,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { } else { insuranceArchivesFundSchemePO = buildFundPO(employeeId, welfareMap, singleAccount, schemeNameIdMap, paymentNameIdMap, creator); } - if (StringUtils.isNotBlank((String) fundMap.get(SalaryI18nUtil.getI18nLabel(91496, "其他福利方案名称"))) - && schemeNameIdMap.get((String) fundMap.get(SalaryI18nUtil.getI18nLabel(91496, "其他福利方案名称"))) == null) { + if (StringUtils.isNotBlank((String) fundMap.get(SalaryI18nUtil.getI18nLabel(91496, "其他福利方案名称"))) && schemeNameIdMap.get((String) fundMap.get(SalaryI18nUtil.getI18nLabel(91496, "其他福利方案名称"))) == null) { Map errorMessageMap = Maps.newHashMap(); errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(100324, "其他福利方案不存在")); excelComments.add(errorMessageMap); @@ -879,11 +850,11 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { } /**************校验申报基数**************/ for (Map.Entry entry : welfareMap.entrySet()) { - String keyName = entry.getValue()+SalaryI18nUtil.getI18nLabel(100293, "申报基数"); - String numberVlue = findElement(singleAccount, keyName).get(keyName) == null ?"": findElement(singleAccount, keyName).get(keyName).toString(); - if (!"".equals(numberVlue) && !NumberUtils.isParsable(numberVlue)){ + String keyName = entry.getValue() + SalaryI18nUtil.getI18nLabel(100293, "申报基数"); + String numberVlue = findElement(singleAccount, keyName).get(keyName) == null ? "" : findElement(singleAccount, keyName).get(keyName).toString(); + if (!"".equals(numberVlue) && !NumberUtils.isParsable(numberVlue)) { Map errorMessageMap = Maps.newHashMap(); - errorMessageMap.put("message", rowIndex+keyName + SalaryI18nUtil.getI18nLabel(100581, "请输入数字")); + errorMessageMap.put("message", rowIndex + keyName + SalaryI18nUtil.getI18nLabel(100581, "请输入数字")); excelComments.add(errorMessageMap); isError = true; } @@ -909,27 +880,21 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { } - public InsuranceArchivesSocialSchemePO buildSocialPO(Long employeeId, Map welfareMap, List> singleAccount, Map schemeNameIdMap, - Map paymentNameIdMap, Long creator) { + public InsuranceArchivesSocialSchemePO buildSocialPO(Long employeeId, Map welfareMap, List> singleAccount, Map schemeNameIdMap, Map paymentNameIdMap, Long creator) { if (employeeId == null) { return null; } InsuranceArchivesSocialSchemePO insuranceArchivesSocialSchemePO = new InsuranceArchivesSocialSchemePO(); insuranceArchivesSocialSchemePO.setId(IdGenerator.generate()); - insuranceArchivesSocialSchemePO.setSocialAccount((String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91324, "社保账号")).get( - SalaryI18nUtil.getI18nLabel(91324, "社保账号"))); - insuranceArchivesSocialSchemePO.setSocialSchemeId(schemeNameIdMap.get( - (String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91323, "社保方案名称")).get( - SalaryI18nUtil.getI18nLabel(91323, "社保方案名称")))); - String socialStartDate = (String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91319, "社保起始缴纳月")).get( - SalaryI18nUtil.getI18nLabel(91319, "社保起始缴纳月")); + insuranceArchivesSocialSchemePO.setSocialAccount((String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91324, "社保账号")).get(SalaryI18nUtil.getI18nLabel(91324, "社保账号"))); + insuranceArchivesSocialSchemePO.setSocialSchemeId(schemeNameIdMap.get((String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91323, "社保方案名称")).get(SalaryI18nUtil.getI18nLabel(91323, "社保方案名称")))); + String socialStartDate = (String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91319, "社保起始缴纳月")).get(SalaryI18nUtil.getI18nLabel(91319, "社保起始缴纳月")); if (StringUtils.isNotBlank(socialStartDate) && socialStartDate.length() > 7) { socialStartDate = socialStartDate.substring(0, 7); } insuranceArchivesSocialSchemePO.setSocialStartTime(socialStartDate); - String socialEndDate = (String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91320, "社保最后缴纳月")).get( - SalaryI18nUtil.getI18nLabel(91320, "社保最后缴纳月")); + String socialEndDate = (String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91320, "社保最后缴纳月")).get(SalaryI18nUtil.getI18nLabel(91320, "社保最后缴纳月")); if (StringUtils.isNotBlank(socialEndDate) && socialEndDate.length() > 7) { socialEndDate = socialEndDate.substring(0, 7); } @@ -937,9 +902,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { insuranceArchivesSocialSchemePO.setTenantKey(""); insuranceArchivesSocialSchemePO.setWelfareType(WelfareTypeEnum.SOCIAL_SECURITY.getValue()); insuranceArchivesSocialSchemePO.setUpdateTime(new Date()); - insuranceArchivesSocialSchemePO.setPaymentOrganization(paymentNameIdMap.get( - (String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91325, "个税扣缴义务人")).get( - SalaryI18nUtil.getI18nLabel(91325, "个税扣缴义务人")))); + insuranceArchivesSocialSchemePO.setPaymentOrganization(paymentNameIdMap.get((String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91325, "个税扣缴义务人")).get(SalaryI18nUtil.getI18nLabel(91325, "个税扣缴义务人")))); insuranceArchivesSocialSchemePO.setNonPayment(NonPaymentEnum.YES.getValue()); insuranceArchivesSocialSchemePO.setCreator(creator); insuranceArchivesSocialSchemePO.setCreateTime(new Date()); @@ -947,8 +910,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { insuranceArchivesSocialSchemePO.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()); insuranceArchivesSocialSchemePO.setEmployeeId(employeeId); insuranceArchivesSocialSchemePO.setUnderTake(UndertakerEnum.SCOPE_PERSON.getValue()); - List insuranceSchemeDetailPOS = - getInsuranceSchemeDetailMapper().queryListBySchemeId(insuranceArchivesSocialSchemePO.getSocialSchemeId()); + List insuranceSchemeDetailPOS = getInsuranceSchemeDetailMapper().queryListBySchemeId(insuranceArchivesSocialSchemePO.getSocialSchemeId()); InsuranceSchemeDetailPOEncrypt.decryptList(insuranceSchemeDetailPOS); if (CollectionUtils.isNotEmpty(insuranceSchemeDetailPOS)) { List insuranceIds = insuranceSchemeDetailPOS.stream().map(InsuranceSchemeDetailPO::getInsuranceId).collect(Collectors.toList()); @@ -958,9 +920,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { continue; } if (findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "申报基数")) != null) { - socialPaymentBase.put(String.valueOf(insuranceId), - (String) findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "申报基数")).get( - welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "申报基数"))); + socialPaymentBase.put(String.valueOf(insuranceId), (String) findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "申报基数")).get(welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "申报基数"))); } } insuranceArchivesSocialSchemePO.setSocialPaymentBaseString(JSON.toJSONString(socialPaymentBase)); @@ -969,8 +929,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { } - public InsuranceArchivesFundSchemePO buildFundPO(Long employeeId, Map welfareMap, List> singleAccount, Map schemeNameIdMap, - Map paymentNameIdMap, Long creator) { + public InsuranceArchivesFundSchemePO buildFundPO(Long employeeId, Map welfareMap, List> singleAccount, Map schemeNameIdMap, Map paymentNameIdMap, Long creator) { if (employeeId == null) { return null; @@ -981,30 +940,22 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { insuranceArchivesFundSchemePO.setTenantKey(""); insuranceArchivesFundSchemePO.setCreateTime(new Date()); insuranceArchivesFundSchemePO.setUpdateTime(new Date()); - insuranceArchivesFundSchemePO.setFundSchemeId(schemeNameIdMap.get( - (String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91485, "公积金方案名称")).get( - SalaryI18nUtil.getI18nLabel(91485, "公积金方案名称")))); - insuranceArchivesFundSchemePO.setFundAccount((String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91486, "公积金账号")).get( - SalaryI18nUtil.getI18nLabel(91486, "公积金账号"))); - insuranceArchivesFundSchemePO.setSupplementFundAccount((String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91487, "补充公积金账号")).get( - SalaryI18nUtil.getI18nLabel(91487, "补充公积金账号"))); - String fundStartDate = (String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91483, "公积金起始缴纳月")).get( - SalaryI18nUtil.getI18nLabel(91483, "公积金起始缴纳月")); + insuranceArchivesFundSchemePO.setFundSchemeId(schemeNameIdMap.get((String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91485, "公积金方案名称")).get(SalaryI18nUtil.getI18nLabel(91485, "公积金方案名称")))); + insuranceArchivesFundSchemePO.setFundAccount((String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91486, "公积金账号")).get(SalaryI18nUtil.getI18nLabel(91486, "公积金账号"))); + insuranceArchivesFundSchemePO.setSupplementFundAccount((String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91487, "补充公积金账号")).get(SalaryI18nUtil.getI18nLabel(91487, "补充公积金账号"))); + String fundStartDate = (String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91483, "公积金起始缴纳月")).get(SalaryI18nUtil.getI18nLabel(91483, "公积金起始缴纳月")); if (StringUtils.isNotBlank(fundStartDate) && fundStartDate.length() > 7) { fundStartDate = fundStartDate.substring(0, 7); } insuranceArchivesFundSchemePO.setFundStartTime(fundStartDate); - String fundEndDate = (String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91484, "公积金最后缴纳月")).get( - SalaryI18nUtil.getI18nLabel(91484, "公积金最后缴纳月")); + String fundEndDate = (String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91484, "公积金最后缴纳月")).get(SalaryI18nUtil.getI18nLabel(91484, "公积金最后缴纳月")); if (StringUtils.isNotBlank(fundEndDate) && fundEndDate.length() > 7) { fundEndDate = fundEndDate.substring(0, 7); } insuranceArchivesFundSchemePO.setFundEndTime(fundEndDate); insuranceArchivesFundSchemePO.setWelfareType(WelfareTypeEnum.ACCUMULATION_FUND.getValue()); - insuranceArchivesFundSchemePO.setPaymentOrganization(paymentNameIdMap.get( - (String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91488, "个税扣缴义务人")).get( - SalaryI18nUtil.getI18nLabel(91488, "个税扣缴义务人")))); + insuranceArchivesFundSchemePO.setPaymentOrganization(paymentNameIdMap.get((String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91488, "个税扣缴义务人")).get(SalaryI18nUtil.getI18nLabel(91488, "个税扣缴义务人")))); insuranceArchivesFundSchemePO.setNonPayment(NonPaymentEnum.YES.getValue()); insuranceArchivesFundSchemePO.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()); insuranceArchivesFundSchemePO.setUnderTake(UndertakerEnum.SCOPE_PERSON.getValue()); @@ -1020,9 +971,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { continue; } if (findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "申报基数")) != null) { - socialPaymentBase.put(String.valueOf(insuranceId), - (String) findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "申报基数")).get( - welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "申报基数"))); + socialPaymentBase.put(String.valueOf(insuranceId), (String) findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "申报基数")).get(welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "申报基数"))); } } insuranceArchivesFundSchemePO.setFundPaymentBaseString(JSON.toJSONString(socialPaymentBase)); @@ -1031,8 +980,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { } - public InsuranceArchivesOtherSchemePO buildOtherPO(Long employeeId, Map welfareMap, List> singleAccount, Map schemeNameIdMap, - Map paymentNameIdMap, Long creator) { + public InsuranceArchivesOtherSchemePO buildOtherPO(Long employeeId, Map welfareMap, List> singleAccount, Map schemeNameIdMap, Map paymentNameIdMap, Long creator) { if (employeeId == null) { return null; @@ -1043,24 +991,18 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { insuranceArchivesOtherSchemePO.setTenantKey(""); insuranceArchivesOtherSchemePO.setCreateTime(new Date()); insuranceArchivesOtherSchemePO.setUpdateTime(new Date()); - insuranceArchivesOtherSchemePO.setOtherSchemeId( - schemeNameIdMap.get((String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91496, "其他福利方案名称")).get( - SalaryI18nUtil.getI18nLabel(91496, "其他福利方案名称")))); - String otherStartDate = (String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91490, "其他福利起始缴纳月")).get( - SalaryI18nUtil.getI18nLabel(91490, "其他福利起始缴纳月")); + insuranceArchivesOtherSchemePO.setOtherSchemeId(schemeNameIdMap.get((String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91496, "其他福利方案名称")).get(SalaryI18nUtil.getI18nLabel(91496, "其他福利方案名称")))); + String otherStartDate = (String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91490, "其他福利起始缴纳月")).get(SalaryI18nUtil.getI18nLabel(91490, "其他福利起始缴纳月")); if (StringUtils.isNotBlank(otherStartDate) && otherStartDate.length() > 7) { otherStartDate = otherStartDate.substring(0, 7); } insuranceArchivesOtherSchemePO.setOtherStartTime(otherStartDate); - String otherEndDate = (String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91494, "其他福利最后缴纳月")).get( - SalaryI18nUtil.getI18nLabel(91494, "其他福利最后缴纳月")); + String otherEndDate = (String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91494, "其他福利最后缴纳月")).get(SalaryI18nUtil.getI18nLabel(91494, "其他福利最后缴纳月")); if (StringUtils.isNotBlank(otherEndDate) && otherEndDate.length() > 7) { otherEndDate = otherEndDate.substring(0, 7); } insuranceArchivesOtherSchemePO.setOtherEndTime(otherEndDate); - insuranceArchivesOtherSchemePO.setPaymentOrganization(paymentNameIdMap.get( - (String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91497, "个税扣缴义务人")).get( - SalaryI18nUtil.getI18nLabel(91497, "个税扣缴义务人")))); + insuranceArchivesOtherSchemePO.setPaymentOrganization(paymentNameIdMap.get((String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91497, "个税扣缴义务人")).get(SalaryI18nUtil.getI18nLabel(91497, "个税扣缴义务人")))); insuranceArchivesOtherSchemePO.setWelfareType(WelfareTypeEnum.OTHER.getValue()); insuranceArchivesOtherSchemePO.setNonPayment(NonPaymentEnum.YES.getValue()); insuranceArchivesOtherSchemePO.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()); @@ -1076,9 +1018,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { continue; } if (findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "申报基数")) != null) { - socialPaymentBase.put(String.valueOf(insuranceId), - (String) findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "申报基数")).get( - welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "申报基数"))); + socialPaymentBase.put(String.valueOf(insuranceId), (String) findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "申报基数")).get(welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "申报基数"))); } } insuranceArchivesOtherSchemePO.setOtherPaymentBaseString(JSON.toJSONString(socialPaymentBase)); @@ -1088,12 +1028,9 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { public void handleImportData(List insuranceArchivesAccountPOS) { //导入社保档案 - List socialSchemePOS = insuranceArchivesAccountPOS.stream().filter(Objects::nonNull).map(InsuranceArchivesAccountPO::getSocial) - .collect(Collectors.toList()); + List socialSchemePOS = insuranceArchivesAccountPOS.stream().filter(Objects::nonNull).map(InsuranceArchivesAccountPO::getSocial).collect(Collectors.toList()); if (CollectionUtils.isNotEmpty(socialSchemePOS)) { - socialSchemePOS = socialSchemePOS.stream().collect(Collectors.collectingAndThen(Collectors.toCollection( - () -> new TreeSet<>(Comparator.comparing(InsuranceArchivesSocialSchemePO::getEmployeeId)) - ), ArrayList::new)); + socialSchemePOS = socialSchemePOS.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(InsuranceArchivesSocialSchemePO::getEmployeeId))), ArrayList::new)); List socialEmployeeIds = socialSchemePOS.stream().map(InsuranceArchivesSocialSchemePO::getEmployeeId).collect(Collectors.toList()); List> socialEmployeeIdPartition = Lists.partition(socialEmployeeIds, 100); socialEmployeeIdPartition.forEach(getSocialSchemeMapper()::batchDeleteByEmployeeIds); @@ -1102,12 +1039,9 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { partition.forEach(getSocialSchemeMapper()::batchSave); } //导入公积金档案 - List fundSchemePOS = insuranceArchivesAccountPOS.stream().filter(Objects::nonNull).map(InsuranceArchivesAccountPO::getFund) - .collect(Collectors.toList()); + List fundSchemePOS = insuranceArchivesAccountPOS.stream().filter(Objects::nonNull).map(InsuranceArchivesAccountPO::getFund).collect(Collectors.toList()); if (CollectionUtils.isNotEmpty(fundSchemePOS)) { - fundSchemePOS = fundSchemePOS.stream().collect(Collectors.collectingAndThen(Collectors.toCollection( - () -> new TreeSet<>(Comparator.comparing(InsuranceArchivesFundSchemePO::getEmployeeId)) - ), ArrayList::new)); + fundSchemePOS = fundSchemePOS.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(InsuranceArchivesFundSchemePO::getEmployeeId))), ArrayList::new)); List fundEmployeeIds = fundSchemePOS.stream().map(InsuranceArchivesFundSchemePO::getEmployeeId).collect(Collectors.toList()); List> fundEmployeeIdsPartition = Lists.partition(fundEmployeeIds, 100); fundEmployeeIdsPartition.forEach(getFundSchemeMapper()::batchDeleteByEmployeeIds); @@ -1116,12 +1050,9 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { partition.forEach(getFundSchemeMapper()::batchSave); } //导入其他福利档案 - List otherSchemePOS = insuranceArchivesAccountPOS.stream().filter(Objects::nonNull).map(InsuranceArchivesAccountPO::getOther) - .collect(Collectors.toList()); + List otherSchemePOS = insuranceArchivesAccountPOS.stream().filter(Objects::nonNull).map(InsuranceArchivesAccountPO::getOther).collect(Collectors.toList()); if (CollectionUtils.isNotEmpty(otherSchemePOS)) { - otherSchemePOS = otherSchemePOS.stream().collect(Collectors.collectingAndThen(Collectors.toCollection( - () -> new TreeSet<>(Comparator.comparing(InsuranceArchivesOtherSchemePO::getEmployeeId)) - ), ArrayList::new)); + otherSchemePOS = otherSchemePOS.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(InsuranceArchivesOtherSchemePO::getEmployeeId))), ArrayList::new)); List otherEmployeeIds = otherSchemePOS.stream().map(InsuranceArchivesOtherSchemePO::getEmployeeId).collect(Collectors.toList()); List> otherEmployeeIdsPartition = Lists.partition(otherEmployeeIds, 100); otherEmployeeIdsPartition.forEach(getOtherSchemeMapper()::batchDeleteByEmployeeIds); diff --git a/src/com/engine/salary/util/SalaryEntityUtil.java b/src/com/engine/salary/util/SalaryEntityUtil.java index 66fb0080c..254a18639 100644 --- a/src/com/engine/salary/util/SalaryEntityUtil.java +++ b/src/com/engine/salary/util/SalaryEntityUtil.java @@ -191,4 +191,22 @@ public class SalaryEntityUtil { return value.setScale(newScale, roundingMode); } + + /** + * 两个集合是否有交集 + * @param list1 + * @param list2 + * @param + * @return + */ + public static boolean judgeIntersection(List list1,List list2){ + boolean flag = false; + List origin = new ArrayList<>(); + origin.addAll(list1); + origin.retainAll(list2); + if(origin.size()>0){ + flag = true; + } + return flag; + } } diff --git a/src/com/engine/salary/web/SISchemeController.java b/src/com/engine/salary/web/SISchemeController.java index b0d9cef18..edbbd0e01 100644 --- a/src/com/engine/salary/web/SISchemeController.java +++ b/src/com/engine/salary/web/SISchemeController.java @@ -82,20 +82,6 @@ public class SISchemeController { * @param response * @return */ -// @GET -// @Path("/getTable") -// @Produces(MediaType.APPLICATION_JSON) -// public String getTable(@Context HttpServletRequest request, @Context HttpServletResponse response, -// @QueryParam("searchCondition") String searchCondition, @QueryParam("welfareTypeEnum") WelfareTypeEnum welfareTypeEnum ) { -// User user = HrmUserVarify.getUser(request, response); -// InsuranceSchemeDTO insuranceSchemeDTO = InsuranceSchemeDTO.builder().welfareType(welfareTypeEnum).build(); -// Integer welfareType = insuranceSchemeDTO.getWelfareType().getValue(); -// Map map = ParamUtil.request2Map(request); -// map.put("searchCondition",searchCondition); -// map.put("welfareType",welfareType); -// return ResponseResult.run(getService(user)::listPage, map); -// } - @POST @Path("/getTable") @Produces(MediaType.APPLICATION_JSON) From 1567ecb9565da66e8021ba7a3dbb2988d950d225 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 24 Aug 2022 14:24:20 +0800 Subject: [PATCH 03/12] =?UTF-8?q?=E6=A0=B8=E7=AE=97=E7=BB=93=E6=9E=9C?= =?UTF-8?q?=E7=9A=84=E5=AF=BC=E5=85=A5bug=EF=BC=8Cnull?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/service/impl/SalaryAcctExcelServiceImpl.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/com/engine/salary/service/impl/SalaryAcctExcelServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctExcelServiceImpl.java index 17216bddb..009faaf99 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctExcelServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctExcelServiceImpl.java @@ -37,6 +37,7 @@ import com.engine.salary.util.valid.ValidUtil; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Sets; +import com.wbi.util.Util; import dm.jdbc.util.IdGenerator; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; @@ -265,6 +266,7 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc /** * 报表表头 + * * @param salaryAcctRecordPO * @return */ @@ -733,10 +735,9 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc } for (SalaryAcctResultReportPO po : salaryAcctResultReportOfOneEmp) { - po.setEmployeeId(employeeId.toString()); + po.setEmployeeId(Util.null2String(employeeId)); po.setTaxAgentId(taxAgentId); - po.setSalaryAcctEmpId(salaryAcctEmpId.toString()); - + po.setSalaryAcctEmpId(Util.null2String(salaryAcctEmpId)); DataCollectionEmployee emp = emps.get(employeeId); po.setSubcompanyId(emp.getSubcompanyid()); From 71b2f6f41cd02b8c60b800f835f67945d1313412 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 24 Aug 2022 16:51:57 +0800 Subject: [PATCH 04/12] =?UTF-8?q?=E5=AF=BC=E5=85=A5=E6=A0=B8=E7=AE=97?= =?UTF-8?q?=E7=BB=93=E6=9E=9C=E6=97=B6=E5=8E=BB=E9=99=A4=E5=A4=9A=E4=BD=99?= =?UTF-8?q?=E7=9A=84=E4=BA=BA=E5=91=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/service/impl/SalaryAcctExcelServiceImpl.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/com/engine/salary/service/impl/SalaryAcctExcelServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctExcelServiceImpl.java index 009faaf99..76ad034ee 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctExcelServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctExcelServiceImpl.java @@ -702,6 +702,10 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc continue; } SalaryAcctEmployeePO salaryAcctEmployee = salaryAcctEmployeeMap.get(employeeId + "-" + taxAgentId); + //多余的人 + if (salaryAcctEmployee == null) { + continue; + } Long salaryAcctEmpId = Optional.ofNullable(salaryAcctEmployee).map(SalaryAcctEmployeePO::getId).orElse(0L); if (StringUtils.equals("importExcelAcctResult", importType)) { for (ExcelAcctResultPO excelAcctResultPO : excelAcctResultsOfOneEmp) { From a4e6042adf5e70d899d30cad75102f8a18caf410 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 24 Aug 2022 20:00:57 +0800 Subject: [PATCH 05/12] =?UTF-8?q?=E8=B0=83=E8=96=AA=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/api/salary/web/ProcessController.java | 8 ++++ .../process/dto/SalaryAdjustmentDTO.java | 18 ++++++++ .../sys/service/SalarySysConfService.java | 3 ++ .../impl/SalarySysConfServiceImpl.java | 5 +++ .../engine/salary/web/ProcessController.java | 42 +++++++++++++++++++ .../engine/salary/wrapper/ProcessWrapper.java | 39 +++++++++++++++++ 6 files changed, 115 insertions(+) create mode 100644 src/com/api/salary/web/ProcessController.java create mode 100644 src/com/engine/salary/entity/process/dto/SalaryAdjustmentDTO.java create mode 100644 src/com/engine/salary/web/ProcessController.java create mode 100644 src/com/engine/salary/wrapper/ProcessWrapper.java diff --git a/src/com/api/salary/web/ProcessController.java b/src/com/api/salary/web/ProcessController.java new file mode 100644 index 000000000..60fcf484f --- /dev/null +++ b/src/com/api/salary/web/ProcessController.java @@ -0,0 +1,8 @@ +package com.api.salary.web; + +import javax.ws.rs.Path; + +@Path("/bs/hrmsalary/process") +public class ProcessController extends com.engine.salary.web.ProcessController{ + +} diff --git a/src/com/engine/salary/entity/process/dto/SalaryAdjustmentDTO.java b/src/com/engine/salary/entity/process/dto/SalaryAdjustmentDTO.java new file mode 100644 index 000000000..d1d1d0544 --- /dev/null +++ b/src/com/engine/salary/entity/process/dto/SalaryAdjustmentDTO.java @@ -0,0 +1,18 @@ +package com.engine.salary.entity.process.dto; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class SalaryAdjustmentDTO { + + private String isShow; + + private String url; + +} diff --git a/src/com/engine/salary/sys/service/SalarySysConfService.java b/src/com/engine/salary/sys/service/SalarySysConfService.java index 6fe051aa3..3f8a9ecff 100644 --- a/src/com/engine/salary/sys/service/SalarySysConfService.java +++ b/src/com/engine/salary/sys/service/SalarySysConfService.java @@ -1,5 +1,6 @@ package com.engine.salary.sys.service; +import com.engine.salary.sys.entity.po.SalarySysConfPO; import com.engine.salary.sys.enums.TaxDeclarationFunctionEnum; /** @@ -20,4 +21,6 @@ public interface SalarySysConfService { * @return 执行结果 */ boolean operateTaxDeclarationFunction(TaxDeclarationFunctionEnum flag); + + SalarySysConfPO getOneByCode(String code); } diff --git a/src/com/engine/salary/sys/service/impl/SalarySysConfServiceImpl.java b/src/com/engine/salary/sys/service/impl/SalarySysConfServiceImpl.java index 9ef9f631c..a949bf57c 100644 --- a/src/com/engine/salary/sys/service/impl/SalarySysConfServiceImpl.java +++ b/src/com/engine/salary/sys/service/impl/SalarySysConfServiceImpl.java @@ -59,4 +59,9 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe } return true; } + + @Override + public SalarySysConfPO getOneByCode(String code) { + return getSalarySysConfMapper().getOneByCode(code); + } } diff --git a/src/com/engine/salary/web/ProcessController.java b/src/com/engine/salary/web/ProcessController.java new file mode 100644 index 000000000..bb1096dbe --- /dev/null +++ b/src/com/engine/salary/web/ProcessController.java @@ -0,0 +1,42 @@ +package com.engine.salary.web; + +import com.engine.common.util.ServiceUtil; +import com.engine.salary.entity.process.dto.SalaryAdjustmentDTO; +import com.engine.salary.util.ResponseResult; +import com.engine.salary.wrapper.ProcessWrapper; +import lombok.extern.slf4j.Slf4j; +import weaver.hrm.HrmUserVarify; +import weaver.hrm.User; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.MediaType; +import java.util.Map; + +@Slf4j +public class ProcessController { + + private ProcessWrapper getProcessWrapper(User user) { + return ServiceUtil.getService(ProcessWrapper.class, user); + } + + /** + * 发起调薪流程信息 + * @param request + * @param response + * @return + */ + @GET + @Path("/salaryAdjustmentInfo") + @Produces(MediaType.APPLICATION_JSON) + public String getSearchCondition(@Context HttpServletRequest request, @Context HttpServletResponse response) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult, SalaryAdjustmentDTO>(user).run(getProcessWrapper(user)::salaryAdjustment); + } + + +} diff --git a/src/com/engine/salary/wrapper/ProcessWrapper.java b/src/com/engine/salary/wrapper/ProcessWrapper.java new file mode 100644 index 000000000..d06f510df --- /dev/null +++ b/src/com/engine/salary/wrapper/ProcessWrapper.java @@ -0,0 +1,39 @@ +package com.engine.salary.wrapper; + +import com.engine.common.util.ServiceUtil; +import com.engine.core.impl.Service; +import com.engine.salary.entity.process.dto.SalaryAdjustmentDTO; +import com.engine.salary.sys.entity.po.SalarySysConfPO; +import com.engine.salary.sys.service.SalarySysConfService; +import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl; +import weaver.hrm.User; + +/** + * 流程 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +public class ProcessWrapper extends Service { + + private SalarySysConfService getSalarySysConfService(User user) { + return ServiceUtil.getService(SalarySysConfServiceImpl.class, user); + } + + public SalaryAdjustmentDTO salaryAdjustment() { + + SalaryAdjustmentDTO build = SalaryAdjustmentDTO.builder().isShow("false").build(); + SalarySysConfPO needSalaryAdjustmentProcess = getSalarySysConfService(user).getOneByCode("needSalaryAdjustmentProcess"); + if (needSalaryAdjustmentProcess != null) { + build.setIsShow(needSalaryAdjustmentProcess.getConfValue()); + SalarySysConfPO salaryAdjustmentProcessUrl = getSalarySysConfService(user).getOneByCode("salaryAdjustmentProcessUrl"); + if (salaryAdjustmentProcessUrl != null) { + build.setUrl(salaryAdjustmentProcessUrl.getConfValue()); + } + return build; + } + return build; + } +} From 9244440a0dedc72aa7884d8a891ea08130e87985 Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Thu, 25 Aug 2022 09:20:51 +0800 Subject: [PATCH 06/12] =?UTF-8?q?xzy-=E8=96=AA=E8=B5=84=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E6=98=BE=E9=9A=90=E6=8E=A7=E5=88=B6(=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E4=BC=A0=E5=8F=82itemHide=E4=B8=BA=E5=AD=97=E7=AC=A6=E4=B8=B2)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../engine/salary/entity/salarysob/dto/SalarySobItemDTO.java | 3 ++- .../salary/entity/salarysob/dto/SalarySobItemGroupDTO.java | 3 ++- .../salary/entity/salarysob/param/SalarySobItemSaveParam.java | 4 ++-- .../salary/entity/salarysob/po/SalarySobItemGroupPO.java | 2 +- .../salary/entity/salarysob/po/SalarySobItemHidePO.java | 2 +- .../engine/salary/entity/salarysob/po/SalarySobItemPO.java | 2 +- .../engine/salary/service/impl/SalarySobItemServiceImpl.java | 2 +- 7 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/com/engine/salary/entity/salarysob/dto/SalarySobItemDTO.java b/src/com/engine/salary/entity/salarysob/dto/SalarySobItemDTO.java index f03a8468c..e23dc6f16 100644 --- a/src/com/engine/salary/entity/salarysob/dto/SalarySobItemDTO.java +++ b/src/com/engine/salary/entity/salarysob/dto/SalarySobItemDTO.java @@ -91,5 +91,6 @@ public class SalarySobItemDTO { private boolean canDelete; //该分类是否隐藏(0不隐藏,1隐藏) - private Integer itemHide; + @JsonSerialize(using = ToStringSerializer.class) + private Long itemHide; } diff --git a/src/com/engine/salary/entity/salarysob/dto/SalarySobItemGroupDTO.java b/src/com/engine/salary/entity/salarysob/dto/SalarySobItemGroupDTO.java index 7571b18d3..ee06db0a6 100644 --- a/src/com/engine/salary/entity/salarysob/dto/SalarySobItemGroupDTO.java +++ b/src/com/engine/salary/entity/salarysob/dto/SalarySobItemGroupDTO.java @@ -39,7 +39,8 @@ public class SalarySobItemGroupDTO { private Integer sortedIndex; //该分类是否隐藏(0不隐藏,1隐藏) - private Integer itemHide; + @JsonSerialize(using = ToStringSerializer.class) + private Long itemHide; //薪资项目分组下的薪资项目") private List items; diff --git a/src/com/engine/salary/entity/salarysob/param/SalarySobItemSaveParam.java b/src/com/engine/salary/entity/salarysob/param/SalarySobItemSaveParam.java index b496115e8..a1ebb158d 100644 --- a/src/com/engine/salary/entity/salarysob/param/SalarySobItemSaveParam.java +++ b/src/com/engine/salary/entity/salarysob/param/SalarySobItemSaveParam.java @@ -74,7 +74,7 @@ public class SalarySobItemSaveParam { private Long formulaId; //该分类是否隐藏(0不隐藏,1隐藏) - private Integer itemHide; + private Long itemHide; private Boolean canDelete; } @@ -99,6 +99,6 @@ public class SalarySobItemSaveParam { private List items; //该分类是否隐藏(0不隐藏,1隐藏) - private Integer itemHide; + private Long itemHide; } } diff --git a/src/com/engine/salary/entity/salarysob/po/SalarySobItemGroupPO.java b/src/com/engine/salary/entity/salarysob/po/SalarySobItemGroupPO.java index 7d47935af..4a6b5502a 100644 --- a/src/com/engine/salary/entity/salarysob/po/SalarySobItemGroupPO.java +++ b/src/com/engine/salary/entity/salarysob/po/SalarySobItemGroupPO.java @@ -74,7 +74,7 @@ public class SalarySobItemGroupPO { private Date updateTime; //该分类是否隐藏(0不隐藏,1隐藏) - private Integer itemHide; + private Long itemHide; Collection ids; } diff --git a/src/com/engine/salary/entity/salarysob/po/SalarySobItemHidePO.java b/src/com/engine/salary/entity/salarysob/po/SalarySobItemHidePO.java index 4dafcb92c..8ceb1db26 100644 --- a/src/com/engine/salary/entity/salarysob/po/SalarySobItemHidePO.java +++ b/src/com/engine/salary/entity/salarysob/po/SalarySobItemHidePO.java @@ -41,7 +41,7 @@ public class SalarySobItemHidePO { /** * 是否隐藏(0-不隐藏 1-隐藏) */ - private Integer itemHide; + private Long itemHide; /** * 创建人 diff --git a/src/com/engine/salary/entity/salarysob/po/SalarySobItemPO.java b/src/com/engine/salary/entity/salarysob/po/SalarySobItemPO.java index bdfc35475..0464d63f8 100644 --- a/src/com/engine/salary/entity/salarysob/po/SalarySobItemPO.java +++ b/src/com/engine/salary/entity/salarysob/po/SalarySobItemPO.java @@ -89,7 +89,7 @@ public class SalarySobItemPO { private Date updateTime; //该分类是否隐藏(0不隐藏,1隐藏) - private Integer itemHide; + private Long itemHide; //in Collection ids; diff --git a/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java index 43b2ab9e8..85aea4b5b 100644 --- a/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java @@ -326,7 +326,7 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) .build(); if(itemGroupParam.getItemHide()==null){ - salarySobGroupItemHidePO.setItemHide(0); + salarySobGroupItemHidePO.setItemHide(Long.valueOf(0)); } salarySobItemMapper.InsertItemShow(salarySobGroupItemHidePO); From 8b84f0b15faa4436901503a52662b574b51c23fa Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Thu, 25 Aug 2022 09:59:19 +0800 Subject: [PATCH 07/12] =?UTF-8?q?xzy-fix=E5=8C=97=E4=BA=AC=E5=9F=8E?= =?UTF-8?q?=E5=BB=BA=E9=9B=86=E5=9B=A2-=E8=80=83=E5=8B=A4=E5=BC=95?= =?UTF-8?q?=E7=94=A8=E4=B8=AD=E5=BC=95=E7=94=A8=E6=97=B6=E6=8A=A5=E9=94=99?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/mapper/datacollection/AttendQuoteDataValueMapper.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/engine/salary/mapper/datacollection/AttendQuoteDataValueMapper.xml b/src/com/engine/salary/mapper/datacollection/AttendQuoteDataValueMapper.xml index 11f373497..e96e8b59c 100644 --- a/src/com/engine/salary/mapper/datacollection/AttendQuoteDataValueMapper.xml +++ b/src/com/engine/salary/mapper/datacollection/AttendQuoteDataValueMapper.xml @@ -324,7 +324,7 @@ select #{item.employeeId,jdbcType=DOUBLE}, #{item.attendQuoteId,jdbcType=DOUBLE}, - #{item.attendQuoteDataId,jdbcType=DOUBLE},s + #{item.attendQuoteDataId,jdbcType=DOUBLE}, #{item.attendQuoteFieldId,jdbcType=DOUBLE}, #{item.dataValue,jdbcType=VARCHAR}, #{item.createTime,jdbcType=DATE}, From bc794b45850093425597968ab26cd17c4718bb87 Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Thu, 25 Aug 2022 11:52:24 +0800 Subject: [PATCH 08/12] =?UTF-8?q?xzy-fix=E7=A4=BE=E4=BF=9D=E7=A6=8F?= =?UTF-8?q?=E5=88=A9=E6=96=B9=E6=A1=88=E6=97=A0=E6=B3=95=E6=96=B0=E5=BB=BA?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E7=A6=8F=E5=88=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/sicategory/ICategoryMapper.xml | 62 +++++++++---------- 1 file changed, 29 insertions(+), 33 deletions(-) diff --git a/src/com/engine/salary/mapper/sicategory/ICategoryMapper.xml b/src/com/engine/salary/mapper/sicategory/ICategoryMapper.xml index 8b7fd6df7..d41ca1336 100644 --- a/src/com/engine/salary/mapper/sicategory/ICategoryMapper.xml +++ b/src/com/engine/salary/mapper/sicategory/ICategoryMapper.xml @@ -79,39 +79,35 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + INSERT INTO hrsa_insurance_category + + id, + insurance_name, + welfare_type, + is_use, + payment_scope, + data_type, + create_time, + update_time, + creator, + delete_type, + tenant_key, + + + #{id}, + #{insuranceName}, + #{welfareType}, + #{isUse}, + #{paymentScope}, + #{dataType}, + #{createTime}, + #{updateTime}, + #{creator}, + #{deleteType}, + #{tenantKey}, + + - SELECT salary_item_id FROM `hrsa_salary_item_hide` + SELECT salary_item_id FROM hrsa_salary_item_hide where delete_type=0 and salary_sob_id=#{salarySobId} and item_hide=1 diff --git a/src/com/engine/salary/mapper/salarysob/SalarySobItemMapper.xml b/src/com/engine/salary/mapper/salarysob/SalarySobItemMapper.xml index 146873136..624eb4f93 100644 --- a/src/com/engine/salary/mapper/salarysob/SalarySobItemMapper.xml +++ b/src/com/engine/salary/mapper/salarysob/SalarySobItemMapper.xml @@ -427,11 +427,11 @@ - insert into hrsa_salary_item_hide(id,salary_sob_id,salary_item_id,is_group,item_hide, - creator,tenant_key,CREATE_TIME,update_time) - VALUES(#{id},#{salarySobId},#{salaryItemId}, + 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}); + #{tenantKey},#{createTime},#{updateTime},0) From bfcda3525aa32d748fcbb1a95a66788148671565 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 25 Aug 2022 16:46:12 +0800 Subject: [PATCH 10/12] =?UTF-8?q?1=E3=80=81=E7=A6=8F=E5=88=A9=E6=96=B9?= =?UTF-8?q?=E6=A1=88=E5=88=86=E6=9D=83=202=E3=80=81=E7=B4=AF=E8=AE=A1?= =?UTF-8?q?=E3=80=81=E5=BE=80=E6=9C=9F=E3=80=81=E5=85=B6=E4=BB=96=E5=AF=BC?= =?UTF-8?q?=E5=85=A5=E5=88=86=E6=9D=83=203=E3=80=81=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E7=B2=BE=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/engine/salary/biz/SIAccountBiz.java | 33 ++---- src/com/engine/salary/biz/SISchemeBiz.java | 109 +++++++++++------- .../mapper/datacollection/EmployMapper.xml | 7 +- .../impl/AddUpDeductionServiceImpl.java | 20 ++-- .../impl/AddUpSituationServiceImpl.java | 20 ++-- .../impl/OtherDeductionServiceImpl.java | 22 ++-- .../impl/SalaryAcctExcelServiceImpl.java | 61 ++++++++-- .../salary/util/excel/ExcelSupport.java | 11 +- 8 files changed, 173 insertions(+), 110 deletions(-) diff --git a/src/com/engine/salary/biz/SIAccountBiz.java b/src/com/engine/salary/biz/SIAccountBiz.java index 907d03375..2596c9747 100644 --- a/src/com/engine/salary/biz/SIAccountBiz.java +++ b/src/com/engine/salary/biz/SIAccountBiz.java @@ -95,6 +95,10 @@ public class SIAccountBiz extends Service { return MapperProxyFactory.getProxy(SIAccountUtilMapper.class); } + private InsuranceAccountInspectMapper getInsuranceAccountInspectMapper() { + return MapperProxyFactory.getProxy(InsuranceAccountInspectMapper.class); + } + public PageInfo listPage(InsuranceAccountBatchParam queryParam) { SalaryPageUtil.start(queryParam.getCurrent(), queryParam.getPageSize()); List list = getInsuranceAccountBatchMapper().list(queryParam); @@ -732,33 +736,14 @@ public class SIAccountBiz extends Service { } public void batchDelInspectDetail(List list) { - MapperProxyFactory.getProxy(InsuranceAccountInspectMapper.class).batchDelInspectDetails(list); - //上报删除日志 -// list.forEach(item -> { -// LoggerContext insuranceSchemeContext = new LoggerContext<>(); -// insuranceSchemeContext.setTargetId(String.valueOf(item.getId())); -// insuranceSchemeContext.setTargetName(String.valueOf(item.getEmployeeId())); -// insuranceSchemeContext.setOperateType(OperateTypeEnum.DELETE.getValue()); -// insuranceSchemeContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(100445, "删除核算异常记录")); -// insuranceSchemeContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(100445, "删除核算异常记录")); -// insuranceSchemeContext.setNewValues(item); -// siAccountLoggerTemplate.write(insuranceSchemeContext); -// }); + List> lists = Lists.partition(list, 100); + lists.forEach(getInsuranceAccountInspectMapper()::batchDelInspectDetails); + } public void batchSaveInspectDetail(List list) { - MapperProxyFactory.getProxy(InsuranceAccountInspectMapper.class).batchSaveInspectDetails(list); - //上报新增日志 -// list.forEach(item -> { -// LoggerContext insuranceSchemeContext = new LoggerContext<>(); -// insuranceSchemeContext.setTargetId(String.valueOf(item.getId())); -// insuranceSchemeContext.setTargetName(String.valueOf(item.getEmployeeId())); -// insuranceSchemeContext.setOperateType(OperateTypeEnum.ADD.getValue()); -// insuranceSchemeContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(100447, "新建核算异常记录")); -// insuranceSchemeContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(100447, "新建核算异常记录")); -// insuranceSchemeContext.setNewValues(item); -// siAccountLoggerTemplate.write(insuranceSchemeContext); -// }); + List> lists = Lists.partition(list, 100); + lists.forEach(getInsuranceAccountInspectMapper()::batchSaveInspectDetails); } diff --git a/src/com/engine/salary/biz/SISchemeBiz.java b/src/com/engine/salary/biz/SISchemeBiz.java index a5f1382c1..846745513 100644 --- a/src/com/engine/salary/biz/SISchemeBiz.java +++ b/src/com/engine/salary/biz/SISchemeBiz.java @@ -33,7 +33,6 @@ import java.util.stream.Collectors; /** * @Author weaver_cl - * * @Date 2022/3/7 * @Version V1.0 **/ @@ -42,15 +41,17 @@ public class SISchemeBiz { private SIAccountUtilMapper getSIAccountUtilMapper() { return SqlProxyHandle.getProxy(SIAccountUtilMapper.class); } + /** * 获取社保方案 + * * @param id * @param welfareTypeEnum * @return */ - public InsuranceSchemeFormVO getForm(Long id, WelfareTypeEnum welfareTypeEnum) { - InsuranceSchemeDTO insuranceSchemeDTO = getSchemeFormDTO(welfareTypeEnum,id); - List insuranceSchemeDetailDTOList = getSchemeDetailFormDTO(welfareTypeEnum,id); + public InsuranceSchemeFormVO getForm(Long id, WelfareTypeEnum welfareTypeEnum) { + InsuranceSchemeDTO insuranceSchemeDTO = getSchemeFormDTO(welfareTypeEnum, id); + List insuranceSchemeDetailDTOList = getSchemeDetailFormDTO(welfareTypeEnum, id); return InsuranceSchemeFormVO.builder().schemeBatch(insuranceSchemeDTO).schemeDetailList(insuranceSchemeDetailDTOList).build(); } @@ -68,7 +69,7 @@ public class SISchemeBiz { PaymentScopeEnum[] paymentScopeEnums = SalaryEnumUtil.stringToEnums(item.getPaymentScope(), ","); Arrays.stream(paymentScopeEnums).forEach(e -> { InsuranceSchemeDetailDTO insuranceSchemeDetailDTO = InsuranceSchemeDetailDTO.builder().build(); - InsuranceSchemeDetailPO insuranceSchemeDetailPO = getByPPI(id,e.getValue(),item.getId()); + InsuranceSchemeDetailPO insuranceSchemeDetailPO = getByPPI(id, e.getValue(), item.getId()); if (insuranceSchemeDetailPO == null) { insuranceSchemeDetailDTO = InsuranceSchemeDetailDTO.builder() .id((long) (Math.random() * 10000)) @@ -125,6 +126,7 @@ public class SISchemeBiz { /** * 根据福利类型获取 + * * @param welfareType * @return */ @@ -132,7 +134,7 @@ public class SISchemeBiz { SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession(); try { ICategoryMapper iCategoryMapper = sqlSession.getMapper(ICategoryMapper.class); - List insuranceCategoryPOS = iCategoryMapper.listByWelfareType(welfareType,null); + List insuranceCategoryPOS = iCategoryMapper.listByWelfareType(welfareType, null); return insuranceCategoryPOS; } finally { sqlSession.close(); @@ -150,7 +152,7 @@ public class SISchemeBiz { InsuranceSchemeDetailPO insuranceSchemeDetailPO = insuranceSchemeDetailMapper.getByPPI(primaryId, paymentScope, insuranceId); InsuranceSchemeDetailPOEncrypt.decryptItem(insuranceSchemeDetailPO); return insuranceSchemeDetailPO; - }finally { + } finally { sqlSession.close(); } } @@ -167,7 +169,7 @@ public class SISchemeBiz { InsuranceSchemeDTO insuranceSchemeDTO = InsuranceSchemeDTO.builder().paymentType(PaymentTypeEnum.SCHEME_TOWN).welfareType(welfareTypeEnum).build(); if (id != null) { InsuranceSchemePO insuranceSchemePO = getById(id); - SalaryAssert.notNull(insuranceSchemePO,"福利方案不存在"); + SalaryAssert.notNull(insuranceSchemePO, "福利方案不存在"); //BeanUtils.copyProperties(insuranceSchemePO, insuranceSchemeDTO); insuranceSchemeDTO.setId(insuranceSchemePO.getId()); insuranceSchemeDTO.setPaymentArea(insuranceSchemePO.getPaymentArea()); @@ -175,12 +177,15 @@ public class SISchemeBiz { insuranceSchemeDTO.setSchemeName(insuranceSchemePO.getSchemeName()); insuranceSchemeDTO.setPaymentType(SalaryEnumUtil.enumMatchByValue(insuranceSchemePO.getPaymentType(), PaymentTypeEnum.values(), PaymentTypeEnum.class)); insuranceSchemeDTO.setWelfareType(welfareTypeEnum); + insuranceSchemeDTO.setSharedType(insuranceSchemePO.getSharedType() == null ? "0" : insuranceSchemePO.getSharedType()); + insuranceSchemeDTO.setTaxAgentIds(insuranceSchemePO.getSharedType()); } return insuranceSchemeDTO; } /** - *社保方案基础信息主表 + * 社保方案基础信息主表 + * * @param id * @return */ @@ -200,6 +205,7 @@ public class SISchemeBiz { /** * 获取所有方案 + * * @return */ public List listAll() { @@ -215,9 +221,9 @@ public class SISchemeBiz { } - /** * 社保方案基础信息明细表 + * * @param primaryId * @return */ @@ -236,25 +242,36 @@ public class SISchemeBiz { /** * 新增 + * * @param saveParam * @param employeeId */ public void save(InsuranceSchemeReqParam saveParam, long employeeId) { SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession(); - try{ + try { //保存福利项目主表 InsuranceSchemeMapper insuranceSchemeMapper = sqlSession.getMapper(InsuranceSchemeMapper.class); List listResult = insuranceSchemeMapper.listByName(saveParam.getInsuranceScheme().getSchemeName()); - SalaryAssert.isEmpty(listResult, "该福利名称已经存在,福利名称系统全局唯一"); + SalaryAssert.isEmpty(listResult, "该福利名称已经存在,福利名称系统全局唯一"); InsuranceSchemePO insuranceSchemePO = InsuranceSchemeBO.convert2BatchPO(saveParam.getInsuranceScheme(), employeeId); + if (insuranceSchemePO.getSharedType() == null) { + insuranceSchemePO.setSharedType(SharedTypeEnum.PUBLIC.getValue()); + } else { + if (insuranceSchemePO.getSharedType().equals(SharedTypeEnum.PRIVATE.getValue()) && StringUtils.isBlank(insuranceSchemePO.getTaxAgentIds())) { + throw new SalaryRunTimeException("方案可见性为私有时,未设置可见范围"); + } + } + + insuranceSchemeMapper.insert(insuranceSchemePO); - //日志 + + //保存福利项目明细表 InsuranceSchemeDetailMapper insuranceSchemeDetailMapper = sqlSession.getMapper(InsuranceSchemeDetailMapper.class); - List insuranceSchemeDetailPOS = InsuranceSchemeBO.convertToInsuranceSchemeDetailPoList(saveParam.getInsuranceSchemeDetailList(),employeeId,insuranceSchemePO.getId()); + List insuranceSchemeDetailPOS = InsuranceSchemeBO.convertToInsuranceSchemeDetailPoList(saveParam.getInsuranceSchemeDetailList(), employeeId, insuranceSchemePO.getId()); InsuranceSchemeDetailPOEncrypt.encryptList(insuranceSchemeDetailPOS); insuranceSchemeDetailPOS.forEach(insuranceSchemeDetailMapper::insert); @@ -269,6 +286,7 @@ public class SISchemeBiz { /** * 更新 + * * @param updateParam * @param employeeId */ @@ -286,9 +304,17 @@ public class SISchemeBiz { //福利方案名称重复 List insuranceSchemePOList = insuranceSchemeMapper.listByName(updateParam.getInsuranceScheme().getSchemeName()); - if(CollectionUtils.isNotEmpty(insuranceSchemePOList)) { + if (CollectionUtils.isNotEmpty(insuranceSchemePOList)) { boolean repeat = insuranceSchemePOList.stream().anyMatch(item -> !Objects.equals(item.getId(), updateParam.getInsuranceScheme().getId())); - SalaryAssert.isTrue(!repeat,"福利方案名称重复"); + SalaryAssert.isTrue(!repeat, "福利方案名称重复"); + } + + if (insuranceSchemePO.getSharedType() == null) { + insuranceSchemePO.setSharedType(SharedTypeEnum.PUBLIC.getValue()); + } else { + if (insuranceSchemePO.getSharedType().equals(SharedTypeEnum.PRIVATE.getValue()) && StringUtils.isBlank(insuranceSchemePO.getTaxAgentIds())) { + throw new SalaryRunTimeException("方案可见性为私有时,未设置可见范围"); + } } //更新福利方案主表 @@ -305,7 +331,7 @@ public class SISchemeBiz { //记录操作日志 sqlSession.commit(); - }finally { + } finally { sqlSession.close(); } @@ -313,6 +339,7 @@ public class SISchemeBiz { /** * 复制方案 + * * @param id * @param schemeName * @param employeeId @@ -322,14 +349,14 @@ public class SISchemeBiz { try { InsuranceSchemeMapper insuranceSchemeMapper = sqlSession.getMapper(InsuranceSchemeMapper.class); List listResult = insuranceSchemeMapper.listByName(schemeName); - SalaryAssert.isEmpty(listResult, "方案名称重复"); + SalaryAssert.isEmpty(listResult, "方案名称重复"); InsuranceSchemeDetailMapper insuranceSchemeDetailMapper = sqlSession.getMapper(InsuranceSchemeDetailMapper.class); if (Objects.isNull(id)) { throw new SalaryRunTimeException("方案id为空"); } - if(Objects.isNull(schemeName)) { + if (Objects.isNull(schemeName)) { throw new SalaryRunTimeException("复制方案名为空"); } @@ -385,13 +412,14 @@ public class SISchemeBiz { } sqlSession.commit(); - }finally { + } finally { sqlSession.close(); } } /** * 根据险种id和是否缴费查询社保方案明细表 + * * @param insuranceId 险种id * @param isPayment 是否缴费 * @return list @@ -400,11 +428,11 @@ public class SISchemeBiz { SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession(); try { InsuranceSchemeDetailMapper insuranceSchemeDetailMapper = sqlSession.getMapper(InsuranceSchemeDetailMapper.class); - List insuranceSchemeDetailPOList = insuranceSchemeDetailMapper.queryListByInsuranceIdIsPayment(insuranceId,isPayment); + List insuranceSchemeDetailPOList = insuranceSchemeDetailMapper.queryListByInsuranceIdIsPayment(insuranceId, isPayment); InsuranceSchemeDetailPOEncrypt.decryptList(insuranceSchemeDetailPOList); return insuranceSchemeDetailPOList; - }finally { - sqlSession.close(); + } finally { + sqlSession.close(); } } @@ -441,34 +469,37 @@ public class SISchemeBiz { item.setLowerLimit(AESEncryptUtil.decrypt(item.getLowerLimit())); return item; } - public int checkBeforeDeleteSocialscheme(Map params){ - return getSIAccountUtilMapper().checkBeforeDeleteSocialscheme((Collection)params.get("ids")).get(0).getNum(); - } - public int checkBeforeDeleteAccumulationfund(Map params){ - return getSIAccountUtilMapper().checkBeforeDeleteAccumulationfund((Collection)params.get("ids")).get(0).getNum(); - } - public int checkBeforeDeleteOtherscheme(Map params){ - return getSIAccountUtilMapper().checkBeforeDeleteOtherscheme((Collection)params.get("ids")).get(0).getNum(); - } - public int checkBeforeDeleteBill(Map params,Integer welfareTypeId){ - return getSIAccountUtilMapper().checkBeforeDeleteBill((Collection)params.get("ids"),welfareTypeId).get(0).getNum(); + + public int checkBeforeDeleteSocialscheme(Map params) { + return getSIAccountUtilMapper().checkBeforeDeleteSocialscheme((Collection) params.get("ids")).get(0).getNum(); } - public void deleteSocialscheme(Map params){ + public int checkBeforeDeleteAccumulationfund(Map params) { + return getSIAccountUtilMapper().checkBeforeDeleteAccumulationfund((Collection) params.get("ids")).get(0).getNum(); + } + + public int checkBeforeDeleteOtherscheme(Map params) { + return getSIAccountUtilMapper().checkBeforeDeleteOtherscheme((Collection) params.get("ids")).get(0).getNum(); + } + + public int checkBeforeDeleteBill(Map params, Integer welfareTypeId) { + return getSIAccountUtilMapper().checkBeforeDeleteBill((Collection) params.get("ids"), welfareTypeId).get(0).getNum(); + } + + public void deleteSocialscheme(Map params) { SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession(); try { InsuranceSchemeDetailMapper insuranceSchemeDetailMapper = sqlSession.getMapper(InsuranceSchemeDetailMapper.class); InsuranceSchemeMapper insuranceSchemeMapper = sqlSession.getMapper(InsuranceSchemeMapper.class); - insuranceSchemeMapper.deleteByIds((Collection)params.get("ids")); - insuranceSchemeDetailMapper.deleteByIds((Collection)params.get("ids")); + insuranceSchemeMapper.deleteByIds((Collection) params.get("ids")); + insuranceSchemeDetailMapper.deleteByIds((Collection) params.get("ids")); sqlSession.commit(); - }finally { + } finally { sqlSession.close(); } } - } diff --git a/src/com/engine/salary/mapper/datacollection/EmployMapper.xml b/src/com/engine/salary/mapper/datacollection/EmployMapper.xml index 43bba1ce7..812e005ad 100644 --- a/src/com/engine/salary/mapper/datacollection/EmployMapper.xml +++ b/src/com/engine/salary/mapper/datacollection/EmployMapper.xml @@ -163,7 +163,7 @@ c.id as jobtitleId, e.companystartdate as companystartdate, e.mobile as mobile, - e.enddate as dismissdate + e.enddate as dismissdate from hrmresource e left join hrmdepartment d on e.departmentid = d.id left join hrmjobtitles c on e.jobtitle = c.id @@ -242,8 +242,11 @@ e.subcompanyid1 as subcompanyid, e.costcenterid as costcenterId, e.locationid as locationId, - e.jobtitle as jobtitleId + e.jobtitle as jobtitleId, + d.departmentname as departmentName, + d.id as departmentId from hrmresource e + left join hrmdepartment d on e.departmentid = d.id where e.status not in (7) and (e.accounttype is null or e.accounttype = 0) diff --git a/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java b/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java index a81048c93..cf769c220 100644 --- a/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java +++ b/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java @@ -303,16 +303,16 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction } - // 分权判断 - if (openDevolution) { - Optional optionalTaxAgentEmp = taxAgentEmployees.stream().filter(f -> f.getEmployeeId().equals(addUpDeduction.getEmployeeId())).findFirst(); - if (!optionalTaxAgentEmp.isPresent()) { - Map errorMessageMap = Maps.newHashMap(); - errorMessageMap.put("message", rowIndex + "该条数据不在个税扣缴义务人人员范围内,不可导入"); - errorData.add(errorMessageMap); - errorSum += 1; - } - } + //fixme 分权判断 +// if (openDevolution) { +// Optional optionalTaxAgentEmp = taxAgentEmployees.stream().filter(f -> f.getEmployeeId().equals(addUpDeduction.getEmployeeId())).findFirst(); +// if (!optionalTaxAgentEmp.isPresent()) { +// Map errorMessageMap = Maps.newHashMap(); +// errorMessageMap.put("message", rowIndex + "该条数据不在个税扣缴义务人人员范围内,不可导入"); +// errorData.add(errorMessageMap); +// errorSum += 1; +// } +// } // 判断是否有核算过 if (CollectionUtils.isNotEmpty(salaryAcctEmployees)) { diff --git a/src/com/engine/salary/service/impl/AddUpSituationServiceImpl.java b/src/com/engine/salary/service/impl/AddUpSituationServiceImpl.java index 74d4930d1..a254d31f0 100644 --- a/src/com/engine/salary/service/impl/AddUpSituationServiceImpl.java +++ b/src/com/engine/salary/service/impl/AddUpSituationServiceImpl.java @@ -680,16 +680,16 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation } } - // 分权判断 - if (openDevolution) { - Optional optionalTaxAgentEmp = taxAgentEmployees.stream().filter(f -> f.getEmployeeId().equals(po.getEmployeeId())).findFirst(); - if (!optionalTaxAgentEmp.isPresent()) { - Map errorMessageMap = Maps.newHashMap(); - errorMessageMap.put("message", rowIndex + "该条数据不在个税扣缴义务人人员范围内,不可导入"); - errorData.add(errorMessageMap); - errorSum += 1; - } - } + // fixme 分权判断,若员工离职后,不在扣缴义务人范围内,会有异常 +// if (openDevolution) { +// Optional optionalTaxAgentEmp = taxAgentEmployees.stream().filter(f -> f.getEmployeeId().equals(po.getEmployeeId())).findFirst(); +// if (!optionalTaxAgentEmp.isPresent()) { +// Map errorMessageMap = Maps.newHashMap(); +// errorMessageMap.put("message", rowIndex + "该条数据不在个税扣缴义务人人员范围内,不可导入"); +// errorData.add(errorMessageMap); +// errorSum += 1; +// } +// } // 判断是否有核算过 if (CollectionUtils.isNotEmpty(salaryAcctEmployees)) { diff --git a/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java b/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java index 62458947e..8346e9bff 100644 --- a/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java +++ b/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java @@ -300,17 +300,17 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction po.setDeductionAllowedDonation(deductionAllowedDonation); - // 分权判断 - if (openDevolution) { - OtherDeductionPO finalPoE = po; - Optional optionalTaxAgentEmp = taxAgentEmployees.stream().filter(f -> f.getEmployeeId().equals(finalPoE.getEmployeeId())).findFirst(); - if (!optionalTaxAgentEmp.isPresent()) { - Map errorMessageMap = Maps.newHashMap(); - errorMessageMap.put("message", rowIndex + "该条数据不在个税扣缴义务人人员范围内,不可导入"); - errorData.add(errorMessageMap); - errorSum += 1; - } - } + //fixme 分权判断 +// if (openDevolution) { +// OtherDeductionPO finalPoE = po; +// Optional optionalTaxAgentEmp = taxAgentEmployees.stream().filter(f -> f.getEmployeeId().equals(finalPoE.getEmployeeId())).findFirst(); +// if (!optionalTaxAgentEmp.isPresent()) { +// Map errorMessageMap = Maps.newHashMap(); +// errorMessageMap.put("message", rowIndex + "该条数据不在个税扣缴义务人人员范围内,不可导入"); +// errorData.add(errorMessageMap); +// errorSum += 1; +// } +// } // 判断是否有核算过 if (CollectionUtils.isNotEmpty(salaryAcctEmployees)) { OtherDeductionPO finalPo = po; diff --git a/src/com/engine/salary/service/impl/SalaryAcctExcelServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctExcelServiceImpl.java index 4e3f2e132..4e1240ae2 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctExcelServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctExcelServiceImpl.java @@ -25,6 +25,7 @@ import com.engine.salary.entity.salarysob.po.SalarySobEmpFieldPO; import com.engine.salary.entity.salarysob.po.SalarySobItemPO; import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.enums.SalaryValueTypeEnum; +import com.engine.salary.enums.UserStatusEnum; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.service.*; import com.engine.salary.util.SalaryEntityUtil; @@ -347,8 +348,8 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98747, "薪资核算记录不存在或已被删除")); } // 模板表头(默认必带"个税扣缴义务人"、"姓名") - List headerList = Lists.newArrayList(SalaryI18nUtil.getI18nLabel(85429, "姓名"), SalaryI18nUtil.getI18nLabel(86184, "个税扣缴义务人")); - List dataIndexList = Lists.newArrayList("username", "taxAgentName"); + List headerList = Lists.newArrayList(SalaryI18nUtil.getI18nLabel(85429, "姓名"), "部门", SalaryI18nUtil.getI18nLabel(86184, "个税扣缴义务人")); + List dataIndexList = Lists.newArrayList("username", "departmentName", "taxAgentName"); // 查询薪资项目 List salaryItemPOS = getSalaryItemService(user).listByIds(param.getSalaryItemIds()); for (SalaryItemPO salaryItemPO : salaryItemPOS) { @@ -573,6 +574,9 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc throw new RuntimeException("无数据"); } for (int i = 0; i < data.size(); i++) { + + String row = "第" + (i + 2) + "行"; + int usernameIndex = 0; boolean isError = false; Map map = data.get(i); @@ -588,29 +592,53 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc continue; } String dataValue = (String) map.getOrDefault(dataKey.toString(), ""); + + String deparmentName = (String) map.getOrDefault("部门", ""); + if (StringUtils.equals(SalaryI18nUtil.getI18nLabel(85429, "姓名"), dataKey.toString())) { usernameIndex = j; if (StringUtils.isEmpty(dataValue)) { isError = true; Map errorMessageMap = Maps.newHashMap(); - errorMessageMap.put("message", SalaryI18nUtil.getI18nLabel(102838, "姓名不能为空")); + errorMessageMap.put("message", row + SalaryI18nUtil.getI18nLabel(102838, "姓名不能为空")); excelComments.add(errorMessageMap); //salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(102838, "姓名不能为空"), i, i, j, j); } else { - employeeId = salaryEmployeeMap.getOrDefault(dataValue, 0L); - if (employeeId == null || employeeId <= 0) { + + List employeeSameIds = salaryEmployees.stream().filter(e -> (StringUtils.isBlank(dataValue) || Objects.equals(e.getUsername(), dataValue)) + && (StringUtils.isBlank(deparmentName) || Objects.equals(e.getDepartmentName(), deparmentName))) + .collect(Collectors.toList()); + + if (CollectionUtils.isEmpty(employeeSameIds)) { isError = true; Map errorMessageMap = Maps.newHashMap(); - errorMessageMap.put("message", SalaryI18nUtil.getI18nLabel(100579, "姓名错误,系统内不存在该姓名")); + errorMessageMap.put("message", row + SalaryI18nUtil.getI18nLabel(100579, "姓名错误,系统内不存在该姓名")); excelComments.add(errorMessageMap); // salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(100579, "姓名错误,系统内不存在该姓名"), i, i, j, j); + } else if (employeeSameIds.size() > 1) { + //存在离职和在职状态取在职状态 + employeeSameIds = employeeSameIds.stream() + .filter(e -> UserStatusEnum.getNormalStatus().contains(e.getStatus())) + .collect(Collectors.toList()); + if (employeeSameIds.size() != 1) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", row + "员工信息不能为空且不可重复(姓名与部门同时确认唯一)"); + excelComments.add(errorMessageMap); + } else { + employeeId = CollectionUtils.isNotEmpty(employeeSameIds) && employeeSameIds.size() == 1 ? employeeSameIds.get(0).getEmployeeId() : null; + } + } else { + employeeId = employeeSameIds.get(0).getEmployeeId(); } } + }else if (StringUtils.equals(SalaryI18nUtil.getI18nLabel(86184, "部门"), dataKey.toString())) { + } else if (StringUtils.equals(SalaryI18nUtil.getI18nLabel(86184, "个税扣缴义务人"), dataKey.toString())) { if (StringUtils.isEmpty(dataValue)) { isError = true; Map errorMessageMap = Maps.newHashMap(); - errorMessageMap.put("message", SalaryI18nUtil.getI18nLabel(100579, SalaryI18nUtil.getI18nLabel(102839, "个税扣缴义务人不能为空"))); + errorMessageMap.put("message", row + SalaryI18nUtil.getI18nLabel(100579, SalaryI18nUtil.getI18nLabel(102839, "个税扣缴义务人不能为空"))); excelComments.add(errorMessageMap); // salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(102839, "个税扣缴义务人不能为空"), i, i, j, j); } else { @@ -618,7 +646,7 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc if (taxAgentId == null || taxAgentId <= 0) { isError = true; Map errorMessageMap = Maps.newHashMap(); - errorMessageMap.put("message", SalaryI18nUtil.getI18nLabel(100579, SalaryI18nUtil.getI18nLabel(102840, "个税扣缴义务人错误,系统内不存在该个税扣缴义务人"))); + errorMessageMap.put("message", row + SalaryI18nUtil.getI18nLabel(100579, SalaryI18nUtil.getI18nLabel(102840, "个税扣缴义务人错误,系统内不存在该个税扣缴义务人"))); excelComments.add(errorMessageMap); // salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(102840, "个税扣缴义务人错误,系统内不存在该个税扣缴义务人"), i, i, j, j); } @@ -628,7 +656,7 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc if (salaryItemId == null || salaryItemId <= 0) { isError = true; Map errorMessageMap = Maps.newHashMap(); - errorMessageMap.put("message", SalaryI18nUtil.getI18nLabel(100579, SalaryI18nUtil.getI18nLabel(102840, "本次核算所用账套不包含该薪资项目"))); + errorMessageMap.put("message", row + SalaryI18nUtil.getI18nLabel(100579, SalaryI18nUtil.getI18nLabel(102840, "本次核算所用账套不包含该薪资项目"))); excelComments.add(errorMessageMap); // salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(102841, "表头错误,本次核算所用账套不包含该薪资项目"), i, i, j, j); } else { @@ -686,7 +714,20 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc && !salaryAcctEmployeeMap.containsKey(employeeId + "-" + taxAgentId)) { isError = true; Map errorMessageMap = Maps.newHashMap(); - errorMessageMap.put("message", SalaryI18nUtil.getI18nLabel(100579, SalaryI18nUtil.getI18nLabel(102840, "本次薪资核算不包含该人员"))); + errorMessageMap.put("message", row + SalaryI18nUtil.getI18nLabel(100579, SalaryI18nUtil.getI18nLabel(102840, "本次薪资核算不包含该人员"))); + excelComments.add(errorMessageMap); +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(102842, "本次薪资核算不包含该人员"), i, i, usernameIndex, usernameIndex); + } + + // 如果个税扣缴义务人+人员目前不在核算人员里面,不支持导入 + if (StringUtils.equals("importSalaryAcctResult", importType) + && (employeeId != null && employeeId > 0) + && (taxAgentId != null && taxAgentId > 0) + && i == data.size() - 1 + && !salaryAcctEmployeeMap.containsKey(employeeId + "-" + taxAgentId)) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", row + SalaryI18nUtil.getI18nLabel(100579, SalaryI18nUtil.getI18nLabel(102840, "本次薪资核算不包含该人员"))); excelComments.add(errorMessageMap); // salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(102842, "本次薪资核算不包含该人员"), i, i, usernameIndex, usernameIndex); } diff --git a/src/com/engine/salary/util/excel/ExcelSupport.java b/src/com/engine/salary/util/excel/ExcelSupport.java index 93d1289ea..a13341a87 100644 --- a/src/com/engine/salary/util/excel/ExcelSupport.java +++ b/src/com/engine/salary/util/excel/ExcelSupport.java @@ -8,6 +8,7 @@ import org.springframework.web.multipart.MultipartFile; import java.io.BufferedInputStream; import java.io.InputStream; +import java.text.DecimalFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; @@ -15,8 +16,6 @@ import java.util.Date; import java.util.Iterator; import java.util.List; -import static org.apache.poi.ss.usermodel.CellType.STRING; - public class ExcelSupport { @@ -106,6 +105,9 @@ public class ExcelSupport { return getCellValue(sheet.getRow(rowIndex).getCell(cellIndex)); } + + private static final DecimalFormat decimalFormat = new DecimalFormat("####################.###########"); + /** * 格式化解析的数据 */ @@ -117,8 +119,9 @@ public class ExcelSupport { if (DateUtil.isCellDateFormatted(cell)) { cellValue = getDateStr(cell.getDateCellValue(), pattern); } else { - cell.setCellType(STRING); - cellValue = cell.getStringCellValue(); +// cell.setCellType(STRING); +// cellValue = cell.getStringCellValue(); + cellValue = decimalFormat.format(cell.getNumericCellValue()); } break; case STRING: // 字符串类型 From 60fb7fb11072f98c04064b8449b7e15539f5aac0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 25 Aug 2022 17:05:36 +0800 Subject: [PATCH 11/12] =?UTF-8?q?1=E3=80=81=E5=8F=AF=E8=A7=81=E6=80=A7?= =?UTF-8?q?=E8=8C=83=E5=9B=B4=E5=9B=9E=E6=98=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/engine/salary/biz/SISchemeBiz.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/engine/salary/biz/SISchemeBiz.java b/src/com/engine/salary/biz/SISchemeBiz.java index 846745513..581177946 100644 --- a/src/com/engine/salary/biz/SISchemeBiz.java +++ b/src/com/engine/salary/biz/SISchemeBiz.java @@ -178,7 +178,7 @@ public class SISchemeBiz { insuranceSchemeDTO.setPaymentType(SalaryEnumUtil.enumMatchByValue(insuranceSchemePO.getPaymentType(), PaymentTypeEnum.values(), PaymentTypeEnum.class)); insuranceSchemeDTO.setWelfareType(welfareTypeEnum); insuranceSchemeDTO.setSharedType(insuranceSchemePO.getSharedType() == null ? "0" : insuranceSchemePO.getSharedType()); - insuranceSchemeDTO.setTaxAgentIds(insuranceSchemePO.getSharedType()); + insuranceSchemeDTO.setTaxAgentIds(insuranceSchemePO.getTaxAgentIds()); } return insuranceSchemeDTO; } From aab48a1733a717eae907c3b8a7c8b578a24a1ae0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 25 Aug 2022 17:34:30 +0800 Subject: [PATCH 12/12] =?UTF-8?q?1=E3=80=81=E5=8F=AF=E8=A7=81=E6=80=A7?= =?UTF-8?q?=E8=8C=83=E5=9B=B4=E5=9B=9E=E6=98=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/engine/salary/biz/SISchemeBiz.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/com/engine/salary/biz/SISchemeBiz.java b/src/com/engine/salary/biz/SISchemeBiz.java index 581177946..b965b7cb9 100644 --- a/src/com/engine/salary/biz/SISchemeBiz.java +++ b/src/com/engine/salary/biz/SISchemeBiz.java @@ -177,7 +177,7 @@ public class SISchemeBiz { insuranceSchemeDTO.setSchemeName(insuranceSchemePO.getSchemeName()); insuranceSchemeDTO.setPaymentType(SalaryEnumUtil.enumMatchByValue(insuranceSchemePO.getPaymentType(), PaymentTypeEnum.values(), PaymentTypeEnum.class)); insuranceSchemeDTO.setWelfareType(welfareTypeEnum); - insuranceSchemeDTO.setSharedType(insuranceSchemePO.getSharedType() == null ? "0" : insuranceSchemePO.getSharedType()); + insuranceSchemeDTO.setSharedType(StringUtils.isBlank(insuranceSchemePO.getSharedType()) ? "0" : insuranceSchemePO.getSharedType()); insuranceSchemeDTO.setTaxAgentIds(insuranceSchemePO.getTaxAgentIds()); } return insuranceSchemeDTO; @@ -268,7 +268,6 @@ public class SISchemeBiz { insuranceSchemeMapper.insert(insuranceSchemePO); - //保存福利项目明细表 InsuranceSchemeDetailMapper insuranceSchemeDetailMapper = sqlSession.getMapper(InsuranceSchemeDetailMapper.class); List insuranceSchemeDetailPOS = InsuranceSchemeBO.convertToInsuranceSchemeDetailPoList(saveParam.getInsuranceSchemeDetailList(), employeeId, insuranceSchemePO.getId());