Merge remote-tracking branch 'remotes/origin/develop' into feature/checkImport

This commit is contained in:
sy 2022-08-26 09:18:06 +08:00
commit 8ea34ef7dd
48 changed files with 1075 additions and 327 deletions

View File

@ -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{
}

View File

@ -95,6 +95,10 @@ public class SIAccountBiz extends Service {
return MapperProxyFactory.getProxy(SIAccountUtilMapper.class);
}
private InsuranceAccountInspectMapper getInsuranceAccountInspectMapper() {
return MapperProxyFactory.getProxy(InsuranceAccountInspectMapper.class);
}
public PageInfo<InsuranceAccountBatchPO> listPage(InsuranceAccountBatchParam queryParam) {
SalaryPageUtil.start(queryParam.getCurrent(), queryParam.getPageSize());
List<InsuranceAccountBatchPO> list = getInsuranceAccountBatchMapper().list(queryParam);
@ -732,33 +736,14 @@ public class SIAccountBiz extends Service {
}
public void batchDelInspectDetail(List<InsuranceAccountInspectPO> list) {
MapperProxyFactory.getProxy(InsuranceAccountInspectMapper.class).batchDelInspectDetails(list);
//上报删除日志
// list.forEach(item -> {
// LoggerContext<InsuranceAccountInspectPO> 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<List<InsuranceAccountInspectPO>> lists = Lists.partition(list, 100);
lists.forEach(getInsuranceAccountInspectMapper()::batchDelInspectDetails);
}
public void batchSaveInspectDetail(List<InsuranceAccountInspectPO> list) {
MapperProxyFactory.getProxy(InsuranceAccountInspectMapper.class).batchSaveInspectDetails(list);
//上报新增日志
// list.forEach(item -> {
// LoggerContext<InsuranceAccountInspectPO> 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<List<InsuranceAccountInspectPO>> lists = Lists.partition(list, 100);
lists.forEach(getInsuranceAccountInspectMapper()::batchSaveInspectDetails);
}

View File

@ -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<InsuranceSchemeDetailDTO> insuranceSchemeDetailDTOList = getSchemeDetailFormDTO(welfareTypeEnum,id);
public InsuranceSchemeFormVO getForm(Long id, WelfareTypeEnum welfareTypeEnum) {
InsuranceSchemeDTO insuranceSchemeDTO = getSchemeFormDTO(welfareTypeEnum, id);
List<InsuranceSchemeDetailDTO> 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<ICategoryPO> insuranceCategoryPOS = iCategoryMapper.listByWelfareType(welfareType,null);
List<ICategoryPO> 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(StringUtils.isBlank(insuranceSchemePO.getSharedType()) ? "0" : insuranceSchemePO.getSharedType());
insuranceSchemeDTO.setTaxAgentIds(insuranceSchemePO.getTaxAgentIds());
}
return insuranceSchemeDTO;
}
/**
*社保方案基础信息主表
* 社保方案基础信息主表
*
* @param id
* @return
*/
@ -200,6 +205,7 @@ public class SISchemeBiz {
/**
* 获取所有方案
*
* @return
*/
public List<InsuranceSchemePO> listAll() {
@ -215,9 +221,9 @@ public class SISchemeBiz {
}
/**
* 社保方案基础信息明细表
*
* @param primaryId
* @return
*/
@ -236,25 +242,35 @@ 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<InsuranceSchemePO> 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<InsuranceSchemeDetailPO> insuranceSchemeDetailPOS = InsuranceSchemeBO.convertToInsuranceSchemeDetailPoList(saveParam.getInsuranceSchemeDetailList(),employeeId,insuranceSchemePO.getId());
List<InsuranceSchemeDetailPO> insuranceSchemeDetailPOS = InsuranceSchemeBO.convertToInsuranceSchemeDetailPoList(saveParam.getInsuranceSchemeDetailList(), employeeId, insuranceSchemePO.getId());
InsuranceSchemeDetailPOEncrypt.encryptList(insuranceSchemeDetailPOS);
insuranceSchemeDetailPOS.forEach(insuranceSchemeDetailMapper::insert);
@ -269,6 +285,7 @@ public class SISchemeBiz {
/**
* 更新
*
* @param updateParam
* @param employeeId
*/
@ -286,9 +303,17 @@ public class SISchemeBiz {
//福利方案名称重复
List<InsuranceSchemePO> 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 +330,7 @@ public class SISchemeBiz {
//记录操作日志
sqlSession.commit();
}finally {
} finally {
sqlSession.close();
}
@ -313,6 +338,7 @@ public class SISchemeBiz {
/**
* 复制方案
*
* @param id
* @param schemeName
* @param employeeId
@ -322,14 +348,14 @@ public class SISchemeBiz {
try {
InsuranceSchemeMapper insuranceSchemeMapper = sqlSession.getMapper(InsuranceSchemeMapper.class);
List<InsuranceSchemePO> 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 +411,14 @@ public class SISchemeBiz {
}
sqlSession.commit();
}finally {
} finally {
sqlSession.close();
}
}
/**
* 根据险种id和是否缴费查询社保方案明细表
*
* @param insuranceId 险种id
* @param isPayment 是否缴费
* @return list
@ -400,11 +427,11 @@ public class SISchemeBiz {
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
try {
InsuranceSchemeDetailMapper insuranceSchemeDetailMapper = sqlSession.getMapper(InsuranceSchemeDetailMapper.class);
List<InsuranceSchemeDetailPO> insuranceSchemeDetailPOList = insuranceSchemeDetailMapper.queryListByInsuranceIdIsPayment(insuranceId,isPayment);
List<InsuranceSchemeDetailPO> insuranceSchemeDetailPOList = insuranceSchemeDetailMapper.queryListByInsuranceIdIsPayment(insuranceId, isPayment);
InsuranceSchemeDetailPOEncrypt.decryptList(insuranceSchemeDetailPOList);
return insuranceSchemeDetailPOList;
}finally {
sqlSession.close();
} finally {
sqlSession.close();
}
}
@ -441,34 +468,37 @@ public class SISchemeBiz {
item.setLowerLimit(AESEncryptUtil.decrypt(item.getLowerLimit()));
return item;
}
public int checkBeforeDeleteSocialscheme(Map<String, Object> params){
return getSIAccountUtilMapper().checkBeforeDeleteSocialscheme((Collection<Long>)params.get("ids")).get(0).getNum();
}
public int checkBeforeDeleteAccumulationfund(Map<String, Object> params){
return getSIAccountUtilMapper().checkBeforeDeleteAccumulationfund((Collection<Long>)params.get("ids")).get(0).getNum();
}
public int checkBeforeDeleteOtherscheme(Map<String, Object> params){
return getSIAccountUtilMapper().checkBeforeDeleteOtherscheme((Collection<Long>)params.get("ids")).get(0).getNum();
}
public int checkBeforeDeleteBill(Map<String, Object> params,Integer welfareTypeId){
return getSIAccountUtilMapper().checkBeforeDeleteBill((Collection<Long>)params.get("ids"),welfareTypeId).get(0).getNum();
public int checkBeforeDeleteSocialscheme(Map<String, Object> params) {
return getSIAccountUtilMapper().checkBeforeDeleteSocialscheme((Collection<Long>) params.get("ids")).get(0).getNum();
}
public void deleteSocialscheme(Map<String, Object> params){
public int checkBeforeDeleteAccumulationfund(Map<String, Object> params) {
return getSIAccountUtilMapper().checkBeforeDeleteAccumulationfund((Collection<Long>) params.get("ids")).get(0).getNum();
}
public int checkBeforeDeleteOtherscheme(Map<String, Object> params) {
return getSIAccountUtilMapper().checkBeforeDeleteOtherscheme((Collection<Long>) params.get("ids")).get(0).getNum();
}
public int checkBeforeDeleteBill(Map<String, Object> params, Integer welfareTypeId) {
return getSIAccountUtilMapper().checkBeforeDeleteBill((Collection<Long>) params.get("ids"), welfareTypeId).get(0).getNum();
}
public void deleteSocialscheme(Map<String, Object> params) {
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
try {
InsuranceSchemeDetailMapper insuranceSchemeDetailMapper = sqlSession.getMapper(InsuranceSchemeDetailMapper.class);
InsuranceSchemeMapper insuranceSchemeMapper = sqlSession.getMapper(InsuranceSchemeMapper.class);
insuranceSchemeMapper.deleteByIds((Collection<Long>)params.get("ids"));
insuranceSchemeDetailMapper.deleteByIds((Collection<Long>)params.get("ids"));
insuranceSchemeMapper.deleteByIds((Collection<Long>) params.get("ids"));
insuranceSchemeDetailMapper.deleteByIds((Collection<Long>) params.get("ids"));
sqlSession.commit();
}finally {
} finally {
sqlSession.close();
}
}
}

View File

@ -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<SalarySobItemPO> 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<SalarySobItemPO> salarySobItemPOS) {
if(CollectionUtils.isEmpty(salarySobItemPOS)){
return;
@ -58,4 +70,39 @@ public class SalarySobItemBiz {
sqlSession.close();
}
}
public void deleteItemShowBySalarySobId(Collection<Long> 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<SalarySobItemPO> listBySalarySobIdAndGroupId(Long salarySobId, Collection<Long> salarySobItemGroupIds) {
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
try {
SalarySobItemMapper mapper = sqlSession.getMapper(SalarySobItemMapper.class);
return mapper.listBySalarySobIdAndGroupId(salarySobId,salarySobItemGroupIds);
} finally {
sqlSession.close();
}
}
}

View File

@ -62,4 +62,14 @@ public class SalarySobItemGroupBiz {
sqlSession.close();
}
}
public List<SalarySobItemGroupPO> listSomeWithItemHide(SalarySobItemGroupPO build) {
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
try {
SalarySobItemGroupMapper mapper = sqlSession.getMapper(SalarySobItemGroupMapper.class);
return mapper.listSomeWithItemHide(build);
} finally {
sqlSession.close();
}
}
}

View File

@ -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<Long> listSome(SalarySobItemHidePO salarySobPO) {
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
try {
SalarySobItemHideMapper mapper = sqlSession.getMapper(SalarySobItemHideMapper.class);
return mapper.getById(salarySobPO);
} finally {
sqlSession.close();
}
}
}

View File

@ -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;
}

View File

@ -85,12 +85,14 @@ public class SalarySobItemAggregateBO {
.salarySobId(e.getSalarySobId())
.name(e.getName())
.sortedIndex(e.getSortedIndex())
.itemHide(e.getItemHide())
.build())
.collect(Collectors.toList());
Map<Long, SalarySobItemGroupDTO> salarySobItemGroupDTOMap = SalaryEntityUtil.convert2Map(salarySobItemGroupDTOS, SalarySobItemGroupDTO::getId);
Map<Long, SalaryItemPO> salaryItemMap = SalaryEntityUtil.convert2Map(salaryItems, SalaryItemPO::getId);
Map<Long, List<SalarySobItemPO>> salarySobItemMap = SalaryEntityUtil.group2Map(salarySobItems, SalarySobItemPO::getSalarySobItemGroupId);
Map<Long, String> formulaMap = SalaryEntityUtil.convert2Map(expressFormulas, ExpressFormula::getId, ExpressFormula::getFormula);
// 薪资账套的薪资项目副本po转换成dto
salarySobItemMap.forEach((k, v) -> {
List<SalarySobItemDTO> 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()))

View File

@ -41,6 +41,7 @@ public class SalarySobItemDTO {
//名称
private String name;
//是否是薪资档案引用
private Integer useInEmployeeSalary;
@ -88,4 +89,8 @@ public class SalarySobItemDTO {
//是否可以删除
private boolean canDelete;
//该分类是否隐藏0不隐藏1隐藏
@JsonSerialize(using = ToStringSerializer.class)
private Long itemHide;
}

View File

@ -38,6 +38,10 @@ public class SalarySobItemGroupDTO {
//薪资项目分组排序字段")
private Integer sortedIndex;
//该分类是否隐藏0不隐藏1隐藏
@JsonSerialize(using = ToStringSerializer.class)
private Long itemHide;
//薪资项目分组下的薪资项目")
private List<SalarySobItemDTO> items;
}

View File

@ -73,6 +73,9 @@ public class SalarySobItemSaveParam {
//公式")
private Long formulaId;
//该分类是否隐藏0不隐藏1隐藏
private Long itemHide;
private Boolean canDelete;
}
@ -94,5 +97,8 @@ public class SalarySobItemSaveParam {
//分类下的薪资项目
private List<SalarySobItemParam> items;
//该分类是否隐藏0不隐藏1隐藏
private Long itemHide;
}
}

View File

@ -73,5 +73,8 @@ public class SalarySobItemGroupPO {
*/
private Date updateTime;
//该分类是否隐藏0不隐藏1隐藏
private Long itemHide;
Collection<Long> ids;
}

View File

@ -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 Long itemHide;
/**
* 创建人
*/
private Long creator;
/**
* 是否删除
*/
private Integer deleteType;
/**
* 租户
*/
private String tenantKey;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
}

View File

@ -88,6 +88,9 @@ public class SalarySobItemPO {
*/
private Date updateTime;
//该分类是否隐藏0不隐藏1隐藏
private Long itemHide;
//in
Collection<Long> ids;
Collection<Long> salarySobIds;

View File

@ -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;
}
}

View File

@ -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;
/**
* 备注
*/

View File

@ -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-启用
*/

View File

@ -0,0 +1,37 @@
package com.engine.salary.enums.sicategory;
import com.engine.salary.enums.BaseEnum;
public enum SharedTypeEnum implements BaseEnum<String> {
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;
}
}

View File

@ -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},

View File

@ -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)
</select>

View File

@ -21,7 +21,8 @@ public interface SalarySobItemGroupMapper {
* @return 返回集合没有返回空List
*/
List<SalarySobItemGroupPO> listSome(SalarySobItemGroupPO salarySobItemGroup);
List<SalarySobItemGroupPO> listSomeWithItemHide(SalarySobItemGroupPO build);
/**
* 根据主键查询
@ -85,5 +86,6 @@ public interface SalarySobItemGroupMapper {
* @param salarySobItemGroups
*/
void batchInsert(@Param("collection") Collection<SalarySobItemGroupPO> salarySobItemGroups);
}

View File

@ -12,6 +12,7 @@
<result column="creator" property="creator"/>
<result column="delete_type" property="deleteType"/>
<result column="tenant_key" property="tenantKey"/>
<result column="item_hide" property="itemHide"/>
</resultMap>
<!-- 表字段 -->
@ -93,6 +94,35 @@
</select>
<select id="listSomeWithItemHide" resultMap="BaseResultMap"
parameterType="com.engine.salary.entity.salarysob.po.SalarySobItemGroupPO">
SELECT
t
.
id
, t.salary_sob_id
, t.name
, t.sorted_index
, t.description
, t.create_time
, t.update_time
, t.creator
, t.delete_type
, t.tenant_key
, h.item_hide
from hrsa_salary_sob_item_group t LEFT JOIN hrsa_salary_item_hide h ON t.id=h.salary_item_id
where t.delete_type=0
<if test="id != null">
AND t.id = #{id}
</if>
<if test="salarySobId != null">
AND t.salary_sob_id = #{salarySobId}
</if>
ORDER BY id DESC
</select>
<!-- 插入不为NULL的字段 -->
<insert id="insertIgnoreNull" parameterType="com.engine.salary.entity.salarysob.po.SalarySobItemGroupPO">
INSERT INTO hrsa_salary_sob_item_group

View File

@ -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<Long> getById(SalarySobItemHidePO salarySobPO);
}

View File

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.engine.salary.mapper.salarysob.SalarySobItemHideMapper">
<!-- 根据账套id获取关闭显示开关的itemID -->
<select id="getById" resultType="java.lang.Long">
SELECT salary_item_id FROM hrsa_salary_item_hide
where delete_type=0
and salary_sob_id=#{salarySobId}
and item_hide=1
<if test="isGroup!=null">
and is_group=#{isGroup}
</if>
</select>
</mapper>

View File

@ -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<SalarySobItemPO> listSome(SalarySobItemPO salarySobItemPO);
List<SalarySobItemPO> listBySalarySobIdWithHideItem(SalarySobItemPO salarySobItemPO);
/**
* 根据主键查询
@ -86,5 +88,24 @@ public interface SalarySobItemMapper {
* @param salarySobItems
*/
void batchInsert(@Param("collection") Collection<SalarySobItemPO> salarySobItems);
/**
* 删除工资项目是否显示
*
* @param salarySobIds
*/
void deleteItemShowBySalarySobId(@Param("salarySobIds")Collection<Long> salarySobIds);
/**
* 插入薪资项目分组是否显示
* @param salarySobItemHidePO
*/
void insertItemShow(SalarySobItemHidePO salarySobItemHidePO);
/**
* 根据账套id以及薪资项目分组获取
* @param
*/
List<SalarySobItemPO> listBySalarySobIdAndGroupId(@Param("salarySobId") Long salarySobId,@Param("salarySobItemGroupIds") Collection<Long> salarySobItemGroupIds);
}

View File

@ -121,6 +121,53 @@
ORDER BY id DESC
</select>
<select id="listBySalarySobIdAndGroupId"
resultType="com.engine.salary.entity.salarysob.po.SalarySobItemPO">
SELECT
<include refid="baseColumns"/>
FROM hrsa_salary_sob_item t
WHERE delete_type = 0
<if test="salarySobId != null ">
AND salary_sob_id = #{salarySobId}
</if>
<if test="salarySobItemGroupIds != null and salarySobItemGroupIds.size()>0">
AND salary_sob_item_group_id IN
<foreach collection="salarySobItemGroupIds" open="(" item="id" separator="," close=",0)">
#{id}
</foreach>
</if>
<if test="salarySobItemGroupIds == null or salarySobItemGroupIds.size() == 0">
AND salary_sob_item_group_id IN (0)
</if>
</select>
<select id="listBySalarySobIdWithHideItem"
resultType="com.engine.salary.entity.salarysob.po.SalarySobItemPO">
SELECT
t.create_time
, t.creator
, t.delete_type
, t.description
, t.formula_id
, t.id
, t.salary_item_id
, t.salary_sob_id
, t.salary_sob_item_group_id
, t.sorted_index
, t.tenant_key
, t.update_time
,t.can_delete
,h.item_hide
FROM hrsa_salary_sob_item t
LEFT JOIN hrsa_salary_item_hide h ON t.salary_item_id=h.salary_item_id and t.salary_sob_id = h.salary_sob_id
WHERE t.delete_type = 0
and t.salary_sob_id=#{salarySobId}
ORDER BY id DESC
</select>
<!-- 插入不为NULL的字段 -->
<insert id="insertIgnoreNull" parameterType="com.engine.salary.entity.salarysob.po.SalarySobItemPO">
@ -284,6 +331,16 @@
AND delete_type = 0
</delete>
<!-- 根据薪资账套ID删除记录 -->
<delete id="deleteItemShowBySalarySobId">
DELETE FROM hrsa_salary_item_hide
WHERE delete_type = 0
AND salary_sob_id IN
<foreach collection="salarySobIds" open="(" item="salarySobId" separator="," close=")">
#{salarySobId}
</foreach>
</delete>
<update id="deleteBySalarySobIds">
UPDATE hrsa_salary_sob_item
@ -369,5 +426,13 @@
</foreach>
</insert>
<insert id="insertItemShow">
insert into hrsa_salary_item_hide (id,salary_sob_id,salary_item_id,is_group,item_hide,
creator,tenant_key,create_time,update_time,delete_type)
VALUES (#{id},#{salarySobId},#{salaryItemId},
#{isGroup},#{itemHide},#{creator},
#{tenantKey},#{createTime},#{updateTime},0)
</insert>
</mapper>

View File

@ -79,39 +79,35 @@
</trim>
</insert>
<!-- <insert id="insert" parameterType="com.engine.salary.entity.sicategory.po.ICategoryPO" databaseId="oracle"-->
<!-- >-->
<!-- <selectKey keyProperty="id" resultType="long" order="AFTER">-->
<!-- select hrsa_insurance_category_id.currval from dual-->
<!-- </selectKey>-->
<!-- INSERT INTO hrsa_insurance_category-->
<!-- <trim prefix="(" suffix=")" suffixOverrides=",">-->
<!-- id,-->
<!-- insurance_name,-->
<!-- welfare_type,-->
<!-- is_use,-->
<!-- payment_scope,-->
<!-- data_type,-->
<!-- create_time,-->
<!-- update_time,-->
<!-- creator,-->
<!-- delete_type,-->
<!-- tenant_key,-->
<!-- </trim>-->
<!-- <trim prefix="VALUES (" suffix=")" suffixOverrides=",">-->
<!-- #{id},-->
<!-- #{insuranceName},-->
<!-- #{welfareType},-->
<!-- #{isUse},-->
<!-- #{paymentScope},-->
<!-- #{dataType},-->
<!-- #{createTime},-->
<!-- #{updateTime},-->
<!-- #{creator},-->
<!-- #{deleteType},-->
<!-- #{tenantKey},-->
<!-- </trim>-->
<!-- </insert>-->
<insert id="insert" parameterType="com.engine.salary.entity.sicategory.po.ICategoryPO" databaseId="oracle">
INSERT INTO hrsa_insurance_category
<trim prefix="(" suffix=")" suffixOverrides=",">
id,
insurance_name,
welfare_type,
is_use,
payment_scope,
data_type,
create_time,
update_time,
creator,
delete_type,
tenant_key,
</trim>
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
#{id},
#{insuranceName},
#{welfareType},
#{isUse},
#{paymentScope},
#{dataType},
#{createTime},
#{updateTime},
#{creator},
#{deleteType},
#{tenantKey},
</trim>
</insert>
<select id="listByName" resultMap="BaseResultMap">

View File

@ -14,6 +14,8 @@
<result column="creator" property="creator"/>
<result column="delete_type" property="deleteType"/>
<result column="tenant_key" property="tenantKey"/>
<result column="shared_type" property="sharedType" />
<result column="tax_agent_ids" property="taxAgentIds" />
</resultMap>
<!-- 表字段 -->
@ -30,6 +32,8 @@
, t.creator
, t.delete_type
, t.tenant_key
, t.shared_type
, t.tax_agent_ids
</sql>
@ -85,6 +89,8 @@
creator,
delete_type,
tenant_key,
shared_type,
tax_agent_ids
</trim>
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
#{paymentArea},
@ -98,6 +104,8 @@
#{creator},
#{deleteType},
#{tenantKey},
#{sharedType},
#{taxAgentIds}
</trim>
</insert>
@ -119,6 +127,8 @@
creator,
delete_type,
tenant_key,
shared_type,
tax_agent_ids
</trim>
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
#{paymentArea},
@ -132,6 +142,8 @@
#{creator},
#{deleteType},
#{tenantKey},
#{sharedType},
#{taxAgentIds}
</trim>
</insert>
@ -144,6 +156,8 @@
payment_type=#{paymentType},
scheme_name=#{schemeName},
remarks=#{remarks},
shared_type=#{sharedType},
tax_agent_ids=#{taxAgentIds}
</set>
WHERE id = #{id} AND delete_type = 0
</update>

View File

@ -31,6 +31,14 @@ public interface SalarySobItemGroupService {
*/
List<SalarySobItemGroupPO> listBySalarySobId(Long salarySobId);
/**
* 根据薪资账套id查询薪资账套的薪资项目分类带上隐藏信息
*
* @param salarySobId 薪资账套id
* @return
*/
List<SalarySobItemGroupPO> listBySalarySobIdWithItemHide(Long salarySobId);
/**
* 批量保存
*

View File

@ -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<Long> listHideGroupBysalarySobId(SalarySobItemHidePO salarySobId);
}

View File

@ -32,6 +32,20 @@ public interface SalarySobItemService {
*/
List<SalarySobItemPO> listBySalarySobId(Long salarySobId);
/**
* 根据薪资账套id查询薪资账套的薪资项目副本(不包括已隐藏的薪资项目列)
*
* @param salarySobId 薪资账套的id
* @return
*/
List<SalarySobItemPO> listBySalarySobIdWithHideItem(Long salarySobId);
/**
* 根据薪资账套id和薪资项目分类查询薪资账套的薪资项目副本
*
*/
List<SalarySobItemPO> listBySalarySobIdAndGroupId(Long salarySobId,Collection<Long> 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<Long> salarySobIds);
/**
* 根据薪资账套id删除薪资项目是否显示
*
*/
void deleteItemShowBySalarySobIds(Collection<Long> salarySobIds);
}

View File

@ -310,16 +310,16 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
}
// 分权判断
if (openDevolution) {
Optional<TaxAgentManageRangeEmployeeDTO.TaxAgentEmployee> optionalTaxAgentEmp = taxAgentEmployees.stream().filter(f -> f.getEmployeeId().equals(addUpDeduction.getEmployeeId())).findFirst();
if (!optionalTaxAgentEmp.isPresent()) {
Map<String, String> errorMessageMap = Maps.newHashMap();
errorMessageMap.put("message", rowIndex + "该条数据不在个税扣缴义务人人员范围内,不可导入");
errorData.add(errorMessageMap);
errorSum += 1;
}
}
//fixme 分权判断
// if (openDevolution) {
// Optional<TaxAgentManageRangeEmployeeDTO.TaxAgentEmployee> optionalTaxAgentEmp = taxAgentEmployees.stream().filter(f -> f.getEmployeeId().equals(addUpDeduction.getEmployeeId())).findFirst();
// if (!optionalTaxAgentEmp.isPresent()) {
// Map<String, String> errorMessageMap = Maps.newHashMap();
// errorMessageMap.put("message", rowIndex + "该条数据不在个税扣缴义务人人员范围内,不可导入");
// errorData.add(errorMessageMap);
// errorSum += 1;
// }
// }
// 判断是否有核算过
if (CollectionUtils.isNotEmpty(salaryAcctEmployees)) {

View File

@ -682,16 +682,16 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
}
}
// 分权判断
if (openDevolution) {
Optional<TaxAgentManageRangeEmployeeDTO.TaxAgentEmployee> optionalTaxAgentEmp = taxAgentEmployees.stream().filter(f -> f.getEmployeeId().equals(po.getEmployeeId())).findFirst();
if (!optionalTaxAgentEmp.isPresent()) {
Map<String, String> errorMessageMap = Maps.newHashMap();
errorMessageMap.put("message", rowIndex + "该条数据不在个税扣缴义务人人员范围内,不可导入");
errorData.add(errorMessageMap);
errorSum += 1;
}
}
// fixme 分权判断若员工离职后不在扣缴义务人范围内会有异常
// if (openDevolution) {
// Optional<TaxAgentManageRangeEmployeeDTO.TaxAgentEmployee> optionalTaxAgentEmp = taxAgentEmployees.stream().filter(f -> f.getEmployeeId().equals(po.getEmployeeId())).findFirst();
// if (!optionalTaxAgentEmp.isPresent()) {
// Map<String, String> errorMessageMap = Maps.newHashMap();
// errorMessageMap.put("message", rowIndex + "该条数据不在个税扣缴义务人人员范围内,不可导入");
// errorData.add(errorMessageMap);
// errorSum += 1;
// }
// }
// 判断是否有核算过
if (CollectionUtils.isNotEmpty(salaryAcctEmployees)) {

View File

@ -302,17 +302,17 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
po.setDeductionAllowedDonation(deductionAllowedDonation);
// 分权判断
if (openDevolution) {
OtherDeductionPO finalPoE = po;
Optional<TaxAgentManageRangeEmployeeDTO.TaxAgentEmployee> optionalTaxAgentEmp = taxAgentEmployees.stream().filter(f -> f.getEmployeeId().equals(finalPoE.getEmployeeId())).findFirst();
if (!optionalTaxAgentEmp.isPresent()) {
Map<String, String> errorMessageMap = Maps.newHashMap();
errorMessageMap.put("message", rowIndex + "该条数据不在个税扣缴义务人人员范围内,不可导入");
errorData.add(errorMessageMap);
errorSum += 1;
}
}
//fixme 分权判断
// if (openDevolution) {
// OtherDeductionPO finalPoE = po;
// Optional<TaxAgentManageRangeEmployeeDTO.TaxAgentEmployee> optionalTaxAgentEmp = taxAgentEmployees.stream().filter(f -> f.getEmployeeId().equals(finalPoE.getEmployeeId())).findFirst();
// if (!optionalTaxAgentEmp.isPresent()) {
// Map<String, String> errorMessageMap = Maps.newHashMap();
// errorMessageMap.put("message", rowIndex + "该条数据不在个税扣缴义务人人员范围内,不可导入");
// errorData.add(errorMessageMap);
// errorSum += 1;
// }
// }
// 判断是否有核算过
if (CollectionUtils.isNotEmpty(salaryAcctEmployees)) {
OtherDeductionPO finalPo = po;

View File

@ -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<Long, String> getSchemeIdNameMap() {
Map<Long, String> result = new HashMap<>();
List<InsuranceSchemePO> insuranceSchemePOS = MapperProxyFactory.getProxy(InsuranceSchemeMapper.class).listAll();
List<InsuranceSchemePO> 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<InsuranceSchemeListDTO> list(InsuranceSchemeParam queryParam) {
SalaryAssert.notNull(queryParam.getWelfareTypeEnum(), SalaryI18nUtil.getI18nLabel(84026, "参数错误"));
SalaryPageUtil.start(queryParam.getCurrent(), queryParam.getPageSize());
List<InsuranceSchemePO> insuranceSchemePOS = MapperProxyFactory.getProxy(InsuranceSchemeMapper.class).listByWelfareType(queryParam.getWelfareTypeEnum().getValue());
PageInfo<InsuranceSchemePO> pageInfo = new PageInfo<>(insuranceSchemePOS, InsuranceSchemePO.class);
List<InsuranceSchemeListDTO> 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<InsuranceSchemePO> insuranceSchemePOS;
Boolean needAuth = getTaxAgentService().isNeedAuth(currentEmployeeId);
if (needAuth) {
insuranceSchemePOS = getInsuranceSchemeMapper().listByWelfareType(queryParam.getWelfareTypeEnum().getValue());
//分权
Collection<TaxAgentPO> taxAgentPOS = getTaxAgentService().listAllTaxAgents(currentEmployeeId);
List<Long> authTaxAgentIds = SalaryEntityUtil.properties(taxAgentPOS, TaxAgentPO::getId, Collectors.toList());
insuranceSchemePOS = insuranceSchemePOS.stream().filter(po -> {
String taxAgentIdsStr = po.getTaxAgentIds();
List<Long> 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<InsuranceSchemeListDTO> 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<InsuranceSchemeListDTO> 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<Long, InsuranceArchivesSocialSchemePO> socialSchemePOMap =
socialList
.stream().collect(Collectors.toMap(InsuranceArchivesSocialSchemePO::getEmployeeId, Function.identity()));
Map<Long, InsuranceArchivesFundSchemePO> fundSchemePOMap =
fundList
.stream().collect(Collectors.toMap(InsuranceArchivesFundSchemePO::getEmployeeId, Function.identity()));
Map<Long, InsuranceArchivesOtherSchemePO> otherSchemePOMap =
otherList
.stream().collect(Collectors.toMap(InsuranceArchivesOtherSchemePO::getEmployeeId, Function.identity()));
Map<Long, InsuranceArchivesSocialSchemePO> socialSchemePOMap = socialList.stream().collect(Collectors.toMap(InsuranceArchivesSocialSchemePO::getEmployeeId, Function.identity()));
Map<Long, InsuranceArchivesFundSchemePO> fundSchemePOMap = fundList.stream().collect(Collectors.toMap(InsuranceArchivesFundSchemePO::getEmployeeId, Function.identity()));
Map<Long, InsuranceArchivesOtherSchemePO> 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<String> collect = queryInsuranceSchemeDetailList(id).stream().map(InsuranceSchemeDetailPO::getInsuranceId).distinct().collect(Collectors.toList())
.stream().map(this::queryInsuranceName).collect(Collectors.toList());
List<String> 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<String, String> socialMap = new HashMap<>();
Map<Long, ICategoryPO> socialCollect = new HashMap<>();
Map<Long, ICategoryPO> customSocial =
getICategoryMapper().listByWelfareType(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), null)
.stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity()));
Map<Long, ICategoryPO> customSocial = getICategoryMapper().listByWelfareType(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), null).stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity()));
Map<Long, ICategoryPO> sysSocial =
getICategoryMapper().listByWelfareType(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), DataTypeEnum.SYSTEM.getValue())
.stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity()));
Map<Long, ICategoryPO> 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<String, String> fundMap = new HashMap<>();
Map<Long, ICategoryPO> fundCollect = new HashMap<>();
Map<Long, ICategoryPO> customFund =
getICategoryMapper().listByWelfareType(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), null)
.stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity()));
Map<Long, ICategoryPO> sysFund =
getICategoryMapper().listByWelfareType(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), DataTypeEnum.SYSTEM.getValue())
.stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity()));
Map<Long, ICategoryPO> customFund = getICategoryMapper().listByWelfareType(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), null).stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity()));
Map<Long, ICategoryPO> 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<String, String> otherMap = new HashMap<>();
Map<Long, ICategoryPO> otherCollect = new HashMap<>();
Map<Long, ICategoryPO> customOther =
getICategoryMapper().listByWelfareType(WelfareTypeEnum.OTHER.getValue(), null)
.stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity()));
Map<Long, ICategoryPO> sysOther =
getICategoryMapper().listByWelfareType(WelfareTypeEnum.OTHER.getValue(), DataTypeEnum.SYSTEM.getValue())
.stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity()));
Map<Long, ICategoryPO> customOther = getICategoryMapper().listByWelfareType(WelfareTypeEnum.OTHER.getValue(), null).stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity()));
Map<Long, ICategoryPO> 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<Map<String, Object>> singleAccount, Map<Long, String> welfareMap, List<InsuranceArchivesAccountPO> insuranceArchivesAccountPOS,
List<DataCollectionEmployee> employeeByIds,
List<Map<String, String>> excelComments, int i, Map<String, Long> schemeNameIdMap, Map<String, Long> paymentNameIdMap, Long creator, int index,
Boolean openDevolution,
List<TaxAgentManageRangeEmployeeDTO> taxAgentManageRangeEmployeeTree
) {
public boolean singleAccountCheck(List<Map<String, Object>> singleAccount, Map<Long, String> welfareMap, List<InsuranceArchivesAccountPO> insuranceArchivesAccountPOS, List<DataCollectionEmployee> employeeByIds, List<Map<String, String>> excelComments, int i, Map<String, Long> schemeNameIdMap, Map<String, Long> paymentNameIdMap, Long creator, int index, Boolean openDevolution, List<TaxAgentManageRangeEmployeeDTO> 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<DataCollectionEmployee> 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<DataCollectionEmployee> 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<String, String> errorMessageMap = Maps.newHashMap();
errorMessageMap.put("message", rowIndex + "员工信息不存在");
@ -748,9 +725,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
Map<String, Object> fundEndTimeMap = findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91484, "公积金最后缴纳月"));
Map<String, Object> otherStartTimeMap = findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91490, "其他福利起始缴纳月"));
Map<String, Object> 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<String, String> 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<String, String> 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<Long> o = taxAgentManageRangeEmployeeDTO.getEmployeeList().stream().map(TaxAgentManageRangeEmployeeDTO.TaxAgentEmployee::getEmployeeId).filter(e -> e.equals(employeeId)).findFirst();
if(!o.isPresent()){
if (!o.isPresent()) {
Map<String, String> 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<String, String> 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<String, String> 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<String, String> 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<Long, String> 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<String, String> 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<Long, String> welfareMap, List<Map<String, Object>> singleAccount, Map<String, Long> schemeNameIdMap,
Map<String, Long> paymentNameIdMap, Long creator) {
public InsuranceArchivesSocialSchemePO buildSocialPO(Long employeeId, Map<Long, String> welfareMap, List<Map<String, Object>> singleAccount, Map<String, Long> schemeNameIdMap, Map<String, Long> 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<InsuranceSchemeDetailPO> insuranceSchemeDetailPOS =
getInsuranceSchemeDetailMapper().queryListBySchemeId(insuranceArchivesSocialSchemePO.getSocialSchemeId());
List<InsuranceSchemeDetailPO> insuranceSchemeDetailPOS = getInsuranceSchemeDetailMapper().queryListBySchemeId(insuranceArchivesSocialSchemePO.getSocialSchemeId());
InsuranceSchemeDetailPOEncrypt.decryptList(insuranceSchemeDetailPOS);
if (CollectionUtils.isNotEmpty(insuranceSchemeDetailPOS)) {
List<Long> 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<Long, String> welfareMap, List<Map<String, Object>> singleAccount, Map<String, Long> schemeNameIdMap,
Map<String, Long> paymentNameIdMap, Long creator) {
public InsuranceArchivesFundSchemePO buildFundPO(Long employeeId, Map<Long, String> welfareMap, List<Map<String, Object>> singleAccount, Map<String, Long> schemeNameIdMap, Map<String, Long> 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<Long, String> welfareMap, List<Map<String, Object>> singleAccount, Map<String, Long> schemeNameIdMap,
Map<String, Long> paymentNameIdMap, Long creator) {
public InsuranceArchivesOtherSchemePO buildOtherPO(Long employeeId, Map<Long, String> welfareMap, List<Map<String, Object>> singleAccount, Map<String, Long> schemeNameIdMap, Map<String, Long> 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<InsuranceArchivesAccountPO> insuranceArchivesAccountPOS) {
//导入社保档案
List<InsuranceArchivesSocialSchemePO> socialSchemePOS = insuranceArchivesAccountPOS.stream().filter(Objects::nonNull).map(InsuranceArchivesAccountPO::getSocial)
.collect(Collectors.toList());
List<InsuranceArchivesSocialSchemePO> 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<Long> socialEmployeeIds = socialSchemePOS.stream().map(InsuranceArchivesSocialSchemePO::getEmployeeId).collect(Collectors.toList());
List<List<Long>> 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<InsuranceArchivesFundSchemePO> fundSchemePOS = insuranceArchivesAccountPOS.stream().filter(Objects::nonNull).map(InsuranceArchivesAccountPO::getFund)
.collect(Collectors.toList());
List<InsuranceArchivesFundSchemePO> 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<Long> fundEmployeeIds = fundSchemePOS.stream().map(InsuranceArchivesFundSchemePO::getEmployeeId).collect(Collectors.toList());
List<List<Long>> 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<InsuranceArchivesOtherSchemePO> otherSchemePOS = insuranceArchivesAccountPOS.stream().filter(Objects::nonNull).map(InsuranceArchivesAccountPO::getOther)
.collect(Collectors.toList());
List<InsuranceArchivesOtherSchemePO> 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<Long> otherEmployeeIds = otherSchemePOS.stream().map(InsuranceArchivesOtherSchemePO::getEmployeeId).collect(Collectors.toList());
List<List<Long>> otherEmployeeIdsPartition = Lists.partition(otherEmployeeIds, 100);
otherEmployeeIdsPartition.forEach(getOtherSchemeMapper()::batchDeleteByEmployeeIds);

View File

@ -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;
@ -37,6 +38,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;
@ -258,13 +260,14 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc
*/
public List<WeaTableColumnGroup> listWeaTableColumn(SalaryAcctRecordPO salaryAcctRecordPO) {
// 查询薪资账套下的薪资项目+员工信息字段
SalarySobItemAggregateDTO salarySobItemAggregateDTO = getSalarySobItemService(user).getAggregateBySalarySobId(salaryAcctRecordPO.getSalarySobId());
SalarySobItemAggregateDTO salarySobItemAggregateDTO = getSalarySobItemService(user).getAggregateWithItemHideBySalarySobId(salaryAcctRecordPO.getSalarySobId());
// 构建薪资核算结果列表表头
return SalaryAcctResultBO.buildTableColumns(salarySobItemAggregateDTO);
}
/**
* 报表表头
*
* @param salaryAcctRecordPO
* @return
*/
@ -345,8 +348,8 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98747, "薪资核算记录不存在或已被删除"));
}
// 模板表头(默认必带"个税扣缴义务人""姓名")
List<Object> headerList = Lists.newArrayList(SalaryI18nUtil.getI18nLabel(85429, "姓名"), SalaryI18nUtil.getI18nLabel(86184, "个税扣缴义务人"));
List<String> dataIndexList = Lists.newArrayList("username", "taxAgentName");
List<Object> headerList = Lists.newArrayList(SalaryI18nUtil.getI18nLabel(85429, "姓名"), "部门", SalaryI18nUtil.getI18nLabel(86184, "个税扣缴义务人"));
List<String> dataIndexList = Lists.newArrayList("username", "departmentName", "taxAgentName");
// 查询薪资项目
List<SalaryItemPO> salaryItemPOS = getSalaryItemService(user).listByIds(param.getSalaryItemIds());
for (SalaryItemPO salaryItemPO : salaryItemPOS) {
@ -571,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<String, Object> map = data.get(i);
@ -586,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<String, String> 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<DataCollectionEmployee> 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<String, String> 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<String, String> 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<String, String> 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 {
@ -616,7 +646,7 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc
if (taxAgentId == null || taxAgentId <= 0) {
isError = true;
Map<String, String> 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);
}
@ -626,7 +656,7 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc
if (salaryItemId == null || salaryItemId <= 0) {
isError = true;
Map<String, String> 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 {
@ -684,7 +714,20 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc
&& !salaryAcctEmployeeMap.containsKey(employeeId + "-" + taxAgentId)) {
isError = true;
Map<String, String> 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<String, String> 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);
}
@ -700,6 +743,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) {
@ -733,10 +780,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());

View File

@ -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<SalarySobItemGroupPO> salarySobItemGroupPOS = getSalarySobItemGroupService(user).listBySalarySobIdWithItemHide(salaryAcctEmployeePO.getSalarySobId());
// 获取关闭显示的分类
List<Long> 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<Long> salarySobItemGroupIds = salarySobItemGroupPOS.stream().map(SalarySobItemGroupPO::getId).collect(Collectors.toList());
// 查询薪资账套的薪资项目副本(已经过滤关闭分类显示按钮的薪资项目)
List<SalarySobItemPO> salarySobItemPOS = getSalarySobItemService(user).listBySalarySobIdAndGroupId(salaryAcctEmployeePO.getSalarySobId(),salarySobItemGroupIds);
//----------------------------------------------
// 查询薪资核算所用薪资账套的薪资项目副本
List<SalarySobItemPO> salarySobItemPOS = getSalarySobItemService(user).listBySalarySobId(salaryAcctEmployeePO.getSalarySobId());
// List<SalarySobItemPO> salarySobItemPOS = getSalarySobItemService(user).listBySalarySobId(salaryAcctEmployeePO.getSalarySobId());
// 获取关闭显示的薪资项目
List<Long> 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<Long> salaryItemIds = SalaryEntityUtil.properties(salarySobItemPOS, SalarySobItemPO::getSalaryItemId);
List<SalaryItemPO> salaryItemPOS = getSalaryItemService(user).listByIds(salaryItemIds);
@ -205,6 +232,7 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
List<SalaryAcctResultPO> salaryAcctResultPOS = listBySalaryAcctEmployeeId(salaryAcctEmployeeId);
// 查询个税扣缴义务人
TaxAgentPO taxAgent = getTaxAgentService(user).getById(salaryAcctEmployeePO.getTaxAgentId());
// 转换成薪资核算结果详情dto
return SalaryAcctResultBO.convert2DetailDTO(simpleEmployee, taxAgent, salaryAcctEmployeePO, salarySobEmpFieldPOS, salarySobItemPOS, salaryItemPOS, salaryAcctResultPOS);
}

View File

@ -30,6 +30,11 @@ public class SalarySobItemGroupServiceImpl extends Service implements SalarySobI
return salarySobItemGroupMapper.listSome(SalarySobItemGroupPO.builder().salarySobId(salarySobId).build());
}
@Override
public List<SalarySobItemGroupPO> listBySalarySobIdWithItemHide(Long salarySobId) {
return salarySobItemGroupMapper.listSomeWithItemHide(SalarySobItemGroupPO.builder().salarySobId(salarySobId).build());
}
@Override
public void batchSave(Collection<SalarySobItemGroupPO> salarySobItemGroupPOS) {
salarySobItemGroupMapper.batchInsert(salarySobItemGroupPOS);

View File

@ -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<Long> listHideGroupBysalarySobId(SalarySobItemHidePO salarySobPO) {
return salarySobItemHideMapper.listSome(salarySobPO);
}
}

View File

@ -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<SalarySobItemPO> listBySalarySobIdWithHideItem(Long salarySobId) {
return salarySobItemMapper.listBySalarySobIdWithHideItem(SalarySobItemPO.builder().salarySobId(salarySobId).build());
}
@Override
public List<SalarySobItemPO> listBySalarySobIdAndGroupId(Long salarySobId,Collection<Long> salarySobItemGroupIds) {
return salarySobItemMapper.listBySalarySobIdAndGroupId(salarySobId,salarySobItemGroupIds);
}
@Override
public List<SalarySobItemPO> listBySalarySobIds(Collection<Long> salarySobIds) {
return salarySobItemMapper.listSome(SalarySobItemPO.builder().salarySobIds(salarySobIds).build());
@ -110,9 +122,11 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe
// 查询薪资账套的员工信息字段
List<SalarySobEmpFieldPO> salarySobEmpFieldPOS = getSalarySobEmpFieldService(user).listBySalarySobId(salarySobId);
// 查询薪资账套的薪资项目分类
List<SalarySobItemGroupPO> salarySobItemGroupPOS = getSalarySobItemGroupService(user).listBySalarySobId(salarySobId);
List<SalarySobItemGroupPO> salarySobItemGroupPOS = getSalarySobItemGroupService(user).listBySalarySobIdWithItemHide(salarySobId);
// 查询薪资账套的薪资项目副本
List<SalarySobItemPO> salarySobItemPOS = listBySalarySobId(salarySobId);
List<SalarySobItemPO> salarySobItemPOS =listBySalarySobIdWithHideItem (salarySobId);
// 薪资账套的薪资项目副本所用的公式id
Set<Long> formulaIds = SalaryEntityUtil.properties(salarySobItemPOS, SalarySobItemPO::getFormulaId);
// 查询公式详情
@ -120,6 +134,48 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe
// 查询薪资账套的薪资项目副本所关联的薪资项目
Set<Long> salaryItemIds = SalaryEntityUtil.properties(salarySobItemPOS, SalarySobItemPO::getSalaryItemId);
List<SalaryItemPO> 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<SalarySobEmpFieldPO> salarySobEmpFieldPOS = getSalarySobEmpFieldService(user).listBySalarySobId(salarySobId);
// 查询薪资账套的薪资项目分类
List<SalarySobItemGroupPO> salarySobItemGroupPOS = getSalarySobItemGroupService(user).listBySalarySobIdWithItemHide(salarySobId);
// 获取关闭显示的分类
List<Long> 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<Long> salarySobItemGroupIds = salarySobItemGroupPOS.stream().map(SalarySobItemGroupPO::getId).collect(Collectors.toList());
// 查询薪资账套的薪资项目副本(已经过滤关闭分类显示按钮的薪资项目)
List<SalarySobItemPO> salarySobItemPOS = listBySalarySobIdAndGroupId(salarySobId,salarySobItemGroupIds);
// 获取关闭显示的薪资项目
List<Long> 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<Long> formulaIds = SalaryEntityUtil.properties(salarySobItemPOS, SalarySobItemPO::getFormulaId);
// 查询公式详情
List<ExpressFormula> expressFormulas = getSalaryFormulaService(user).listExpressFormula(formulaIds);
// 查询薪资账套的薪资项目副本所关联的薪资项目
Set<Long> salaryItemIds = SalaryEntityUtil.properties(salarySobItemPOS, SalarySobItemPO::getSalaryItemId);
List<SalaryItemPO> 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(Long.valueOf(0));
}
salarySobItemMapper.InsertItemShow(salarySobGroupItemHidePO);
// //获取分类id
// List<SalarySobItemGroupPO> 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<Long> salarySobIds) {
salarySobItemMapper.deleteBySalarySobIds(salarySobIds);
}
@Override
public void deleteItemShowBySalarySobIds(Collection<Long> salarySobIds) {
salarySobItemMapper.deleteItemShowBySalarySobId(salarySobIds);
}
}

View File

@ -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);
}

View File

@ -59,4 +59,9 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe
}
return true;
}
@Override
public SalarySysConfPO getOneByCode(String code) {
return getSalarySysConfMapper().getOneByCode(code);
}
}

View File

@ -191,4 +191,22 @@ public class SalaryEntityUtil {
return value.setScale(newScale, roundingMode);
}
/**
* 两个集合是否有交集
* @param list1
* @param list2
* @param <T>
* @return
*/
public static <T> boolean judgeIntersection(List<T> list1,List<T> list2){
boolean flag = false;
List<T> origin = new ArrayList<>();
origin.addAll(list1);
origin.retainAll(list2);
if(origin.size()>0){
flag = true;
}
return flag;
}
}

View File

@ -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: // 字符串类型

View File

@ -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<Map<String, Object>, SalaryAdjustmentDTO>(user).run(getProcessWrapper(user)::salaryAdjustment);
}
}

View File

@ -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<String, Object> 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)

View File

@ -264,6 +264,8 @@ public class SalarySobController {
/**********************************薪资账套的薪资项目 end*********************************/
/**********************************调薪计薪规则 start*********************************/

View File

@ -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;
/**
* 流程
* <p>Copyright: Copyright (c) 2022</p>
* <p>Company: 泛微软件</p>
*
* @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;
}
}