Merge branch 'feature/qt' into develop
This commit is contained in:
commit
2a5a72f6ab
|
|
@ -1,10 +1,16 @@
|
|||
package com.engine.salary.biz;
|
||||
|
||||
import com.engine.salary.entity.salaryarchive.dto.SalaryArchiveListDTO;
|
||||
import com.engine.salary.entity.salaryarchive.param.SalaryArchiveQueryParam;
|
||||
import com.engine.salary.entity.salaryarchive.po.SalaryArchivePO;
|
||||
import com.engine.salary.mapper.archive.SalaryArchiveMapper;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import com.engine.salary.util.page.PageUtil;
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import weaver.conn.mybatis.MyBatisFactory;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class SalaryArchiveBiz {
|
||||
|
||||
public SalaryArchivePO getById(Long salaryArchiveId) {
|
||||
|
|
@ -17,4 +23,16 @@ public class SalaryArchiveBiz {
|
|||
}
|
||||
}
|
||||
|
||||
public PageInfo<SalaryArchiveListDTO> listPage(SalaryArchiveQueryParam param) {
|
||||
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
||||
try {
|
||||
SalaryArchiveMapper mapper = sqlSession.getMapper(SalaryArchiveMapper.class);
|
||||
PageUtil.start(param.getCurrent(), param.getPageSize());
|
||||
List<SalaryArchiveListDTO> list = mapper.list(param);
|
||||
PageInfo<SalaryArchiveListDTO> pageInfo = new PageInfo<SalaryArchiveListDTO>(list,SalaryArchiveListDTO.class);
|
||||
return pageInfo;
|
||||
} finally {
|
||||
sqlSession.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,42 @@
|
|||
package com.engine.salary.biz;
|
||||
|
||||
import com.engine.salary.entity.salaryarchive.po.SalaryArchiveDimissionPO;
|
||||
import com.engine.salary.mapper.archive.SalaryArchiveDimissionMapper;
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import weaver.conn.mybatis.MyBatisFactory;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class SalaryArchiveDimissionBiz {
|
||||
public List<SalaryArchiveDimissionPO> dimissionSets() {
|
||||
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
||||
try {
|
||||
SalaryArchiveDimissionMapper mapper = sqlSession.getMapper(SalaryArchiveDimissionMapper.class);
|
||||
return mapper.listAll();
|
||||
} finally {
|
||||
sqlSession.close();
|
||||
}
|
||||
}
|
||||
|
||||
public void updateById(SalaryArchiveDimissionPO po) {
|
||||
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
||||
try {
|
||||
SalaryArchiveDimissionMapper mapper = sqlSession.getMapper(SalaryArchiveDimissionMapper.class);
|
||||
mapper.updateIgnoreNull(po);
|
||||
sqlSession.commit();
|
||||
} finally {
|
||||
sqlSession.close();
|
||||
}
|
||||
}
|
||||
|
||||
public void insert(SalaryArchiveDimissionPO build) {
|
||||
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
||||
try {
|
||||
SalaryArchiveDimissionMapper mapper = sqlSession.getMapper(SalaryArchiveDimissionMapper.class);
|
||||
mapper.insertIgnoreNull(build);
|
||||
sqlSession.commit();
|
||||
} finally {
|
||||
sqlSession.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -19,4 +19,14 @@ public class SalaryArchiveItemBiz {
|
|||
sqlSession.close();
|
||||
}
|
||||
}
|
||||
|
||||
public List<SalaryArchiveItemPO> listByParam(SalaryArchiveItemQueryParam build) {
|
||||
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
||||
try {
|
||||
SalaryArchiveItemMapper mapper = sqlSession.getMapper(SalaryArchiveItemMapper.class);
|
||||
return mapper.listByParam(build);
|
||||
} finally {
|
||||
sqlSession.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,7 +45,6 @@ public class TaxRateBiz extends BaseBean {
|
|||
if (Objects.isNull(taxRateBase)) {
|
||||
SysTaxRateBase sysTaxRateBase = sysTaxRateBaseMapper.getById(id);
|
||||
taxRateBase = new TaxRateBase();
|
||||
//fixme 逻辑可能有问题,自定义和系统的id保持一致?
|
||||
if (sysTaxRateBase != null) {
|
||||
BeanUtils.copyProperties(sysTaxRateBase, taxRateBase);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import lombok.Data;
|
|||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 日期范围
|
||||
|
|
@ -24,10 +24,10 @@ import java.time.LocalDate;
|
|||
public class LocalDateRange {
|
||||
|
||||
//"开始日期
|
||||
private LocalDate fromDate;
|
||||
private Date fromDate;
|
||||
|
||||
//结束日期
|
||||
private LocalDate endDate;
|
||||
private Date endDate;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,13 @@
|
|||
package com.engine.salary.constant;
|
||||
|
||||
/**
|
||||
* @Description: 薪资项目常量
|
||||
* @Author: wangxiangzhong
|
||||
* @Date: 2021/12/30 13:32
|
||||
*/
|
||||
* 薪资项目常量
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
public class SalaryItemConstant {
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,5 +1,17 @@
|
|||
package com.engine.salary.entity.salaryarchive.bo;
|
||||
|
||||
import com.engine.salary.common.LocalDateRange;
|
||||
import com.engine.salary.entity.salaryarchive.dto.SalaryArchiveDataDTO;
|
||||
import com.engine.salary.entity.salaryarchive.dto.SalaryArchiveItemDataDTO;
|
||||
import com.engine.salary.entity.salaryarchive.dto.SalaryArchiveTaxAgentDataDTO;
|
||||
import com.engine.salary.entity.salaryarchive.po.SalaryArchiveItemPO;
|
||||
import com.engine.salary.entity.salaryarchive.po.SalaryArchiveTaxAgentPO;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Description: 薪资档案
|
||||
* @Author: wangxiangzhong
|
||||
|
|
@ -88,76 +100,76 @@ public class SalaryArchiveBO {
|
|||
* @param isOnlyTaxAgent
|
||||
* @return
|
||||
*/
|
||||
// public static List<SalaryArchiveDataDTO> buildSalaryArchiveData(List<SalaryArchiveTaxAgentPO> salaryArchiveTaxAgentList,
|
||||
// List<SalaryArchiveItemPO> salaryArchiveItemDataList,
|
||||
// LocalDateRange localDateRange,
|
||||
// List<Long> allEmployeeIds,
|
||||
// boolean isOnlyTaxAgent) {
|
||||
// // 开始日期
|
||||
// LocalDate start = localDateRange.getFromDate();
|
||||
// // 结束日期
|
||||
// LocalDate end = localDateRange.getEndDate();
|
||||
//
|
||||
// List<SalaryArchiveDataDTO> list = new ArrayList<>();
|
||||
// allEmployeeIds.forEach(e->{
|
||||
// // 同一个人的个税扣缴义务人调整历史数据
|
||||
// List<SalaryArchiveTaxAgentPO> salaryArchiveTaxAgents = salaryArchiveTaxAgentList.stream().filter(f->f.getEmployeeId().equals(e)).collect(Collectors.toList());
|
||||
// // 同一个人的薪资项目调整历史数据
|
||||
// List<SalaryArchiveItemPO> salaryArchiveItems = salaryArchiveItemDataList.stream().filter(d->d.getEmployeeId().equals(e)).collect(Collectors.toList());
|
||||
// List<Long> salaryArchiveItemIds = salaryArchiveItems.stream().map(SalaryArchiveItemPO::getSalaryItemId).distinct().collect(Collectors.toList());
|
||||
//
|
||||
// SalaryArchiveDataDTO salaryArchiveData = new SalaryArchiveDataDTO();
|
||||
// salaryArchiveData.setEmployeeId(e);
|
||||
// List<SalaryArchiveTaxAgentDataDTO> taxAgents = new ArrayList<>();
|
||||
// // 按个税扣缴义务人生效日期时间段切割
|
||||
// LocalDate endTemp = end;
|
||||
// for (SalaryArchiveTaxAgentPO salaryArchiveTaxAgent : salaryArchiveTaxAgents) {
|
||||
// Date fromDate = salaryArchiveTaxAgent.getEffectiveTime();
|
||||
// if (fromDate.isAfter(endTemp) || !endTemp.isAfter(start)) {
|
||||
// continue;
|
||||
// }
|
||||
// SalaryArchiveTaxAgentDataDTO taxAgent = new SalaryArchiveTaxAgentDataDTO();
|
||||
// taxAgent.setTaxAgentId(salaryArchiveTaxAgent.getTaxAgentId());
|
||||
// taxAgent.setEffectiveDateRange(LocalDateRange.builder().fromDate((fromDate.isBefore(start)?start:fromDate)).endDate(endTemp).build());
|
||||
//
|
||||
// // 薪资项目数据按个税扣缴义务人切割
|
||||
// if (!isOnlyTaxAgent) {
|
||||
// // 开始日期
|
||||
// LocalDate startItem = taxAgent.getEffectiveDateRange().getFromDate();
|
||||
// // 结束日期
|
||||
// LocalDate endItem = taxAgent.getEffectiveDateRange().getEndDate();
|
||||
// LocalDate endTempItem = endItem;
|
||||
// List<SalaryArchiveItemDataDTO> salaryItemValues = new ArrayList<>();
|
||||
//
|
||||
// for (Long salaryArchiveItemId : salaryArchiveItemIds) {
|
||||
// for (SalaryArchiveItemPO salaryArchiveItem : salaryArchiveItems) {
|
||||
// if (!salaryArchiveItemId.equals(salaryArchiveItem.getSalaryItemId())) {
|
||||
// continue;
|
||||
// }
|
||||
// LocalDate fromDateItem = salaryArchiveItem.getEffectiveTime();
|
||||
// if (fromDateItem.isAfter(endTempItem) || !endTempItem.isAfter(startItem)) {
|
||||
// continue;
|
||||
// }
|
||||
// SalaryArchiveItemDataDTO salaryArchiveItemData = new SalaryArchiveItemDataDTO();
|
||||
// salaryArchiveItemData.setEffectiveDateRange(LocalDateRange.builder().fromDate((fromDateItem.isBefore(startItem)?startItem:fromDateItem)).endDate(endTempItem).build());
|
||||
// salaryArchiveItemData.setSalaryItemId(salaryArchiveItem.getSalaryItemId());
|
||||
// salaryArchiveItemData.setValue(salaryArchiveItem.getItemValue());
|
||||
// salaryItemValues.add(salaryArchiveItemData);
|
||||
// endTempItem = fromDateItem;
|
||||
// }
|
||||
// endTempItem = endItem;
|
||||
// }
|
||||
//
|
||||
// taxAgent.setSalaryItemValues(salaryItemValues);
|
||||
// }
|
||||
//
|
||||
// taxAgents.add(taxAgent);
|
||||
// endTemp = fromDate;
|
||||
// }
|
||||
// salaryArchiveData.setTaxAgents(taxAgents);
|
||||
// list.add(salaryArchiveData);
|
||||
// });
|
||||
//
|
||||
// return list;
|
||||
// }
|
||||
public static List<SalaryArchiveDataDTO> buildSalaryArchiveData(List<SalaryArchiveTaxAgentPO> salaryArchiveTaxAgentList,
|
||||
List<SalaryArchiveItemPO> salaryArchiveItemDataList,
|
||||
LocalDateRange localDateRange,
|
||||
List<Long> allEmployeeIds,
|
||||
boolean isOnlyTaxAgent) {
|
||||
// 开始日期
|
||||
Date start = localDateRange.getFromDate();
|
||||
// 结束日期
|
||||
Date end = localDateRange.getEndDate();
|
||||
|
||||
List<SalaryArchiveDataDTO> list = new ArrayList<>();
|
||||
allEmployeeIds.forEach(e->{
|
||||
// 同一个人的个税扣缴义务人调整历史数据
|
||||
List<SalaryArchiveTaxAgentPO> salaryArchiveTaxAgents = salaryArchiveTaxAgentList.stream().filter(f->f.getEmployeeId().equals(e)).collect(Collectors.toList());
|
||||
// 同一个人的薪资项目调整历史数据
|
||||
List<SalaryArchiveItemPO> salaryArchiveItems = salaryArchiveItemDataList.stream().filter(d->d.getEmployeeId().equals(e)).collect(Collectors.toList());
|
||||
List<Long> salaryArchiveItemIds = salaryArchiveItems.stream().map(SalaryArchiveItemPO::getSalaryItemId).distinct().collect(Collectors.toList());
|
||||
|
||||
SalaryArchiveDataDTO salaryArchiveData = new SalaryArchiveDataDTO();
|
||||
salaryArchiveData.setEmployeeId(e);
|
||||
List<SalaryArchiveTaxAgentDataDTO> taxAgents = new ArrayList<>();
|
||||
// 按个税扣缴义务人生效日期时间段切割
|
||||
Date endTemp = end;
|
||||
for (SalaryArchiveTaxAgentPO salaryArchiveTaxAgent : salaryArchiveTaxAgents) {
|
||||
Date fromDate = salaryArchiveTaxAgent.getEffectiveTime();
|
||||
if (fromDate.after(endTemp) || !endTemp.after(start)) {
|
||||
continue;
|
||||
}
|
||||
SalaryArchiveTaxAgentDataDTO taxAgent = new SalaryArchiveTaxAgentDataDTO();
|
||||
taxAgent.setTaxAgentId(salaryArchiveTaxAgent.getTaxAgentId());
|
||||
taxAgent.setEffectiveDateRange(LocalDateRange.builder().fromDate((fromDate.before(start)?start:fromDate)).endDate(endTemp).build());
|
||||
|
||||
// 薪资项目数据按个税扣缴义务人切割
|
||||
if (!isOnlyTaxAgent) {
|
||||
// 开始日期
|
||||
Date startItem = taxAgent.getEffectiveDateRange().getFromDate();
|
||||
// 结束日期
|
||||
Date endItem = taxAgent.getEffectiveDateRange().getEndDate();
|
||||
Date endTempItem = endItem;
|
||||
List<SalaryArchiveItemDataDTO> salaryItemValues = new ArrayList<>();
|
||||
|
||||
for (Long salaryArchiveItemId : salaryArchiveItemIds) {
|
||||
for (SalaryArchiveItemPO salaryArchiveItem : salaryArchiveItems) {
|
||||
if (!salaryArchiveItemId.equals(salaryArchiveItem.getSalaryItemId())) {
|
||||
continue;
|
||||
}
|
||||
Date fromDateItem = salaryArchiveItem.getEffectiveTime();
|
||||
if (fromDateItem.after(endTempItem) || !endTempItem.after(startItem)) {
|
||||
continue;
|
||||
}
|
||||
SalaryArchiveItemDataDTO salaryArchiveItemData = new SalaryArchiveItemDataDTO();
|
||||
salaryArchiveItemData.setEffectiveDateRange(LocalDateRange.builder().fromDate((fromDateItem.before(startItem)?startItem:fromDateItem)).endDate(endTempItem).build());
|
||||
salaryArchiveItemData.setSalaryItemId(salaryArchiveItem.getSalaryItemId());
|
||||
salaryArchiveItemData.setValue(salaryArchiveItem.getItemValue());
|
||||
salaryItemValues.add(salaryArchiveItemData);
|
||||
endTempItem = fromDateItem;
|
||||
}
|
||||
endTempItem = endItem;
|
||||
}
|
||||
|
||||
taxAgent.setSalaryItemValues(salaryItemValues);
|
||||
}
|
||||
|
||||
taxAgents.add(taxAgent);
|
||||
endTemp = fromDate;
|
||||
}
|
||||
salaryArchiveData.setTaxAgents(taxAgents);
|
||||
list.add(salaryArchiveData);
|
||||
});
|
||||
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,9 @@ import lombok.Builder;
|
|||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 薪资档案
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
|
|
@ -17,22 +20,19 @@ import lombok.NoArgsConstructor;
|
|||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
//员工薪资档案")
|
||||
//员工薪资档案
|
||||
public class SalaryArchiveFormDTO {
|
||||
|
||||
//主键id")
|
||||
//主键id
|
||||
private Long id;
|
||||
|
||||
//人员信息表的主键id")
|
||||
//人员信息表的主键id
|
||||
private Long employeeId;
|
||||
|
||||
//基本信息")
|
||||
// private WeaForm baseInfo;
|
||||
//
|
||||
// //薪资档案")
|
||||
// private WeaForm adjustSalaryItems;
|
||||
//
|
||||
// //薪资项目调整记录的高级搜索")
|
||||
// private WeaSearchCondition salaryItemAdjustRecordSearchCondition;
|
||||
//基本信息
|
||||
private Map<String,Object> baseInfo;
|
||||
|
||||
//薪资档案
|
||||
private List<Map<String, Object>> adjustSalaryItems;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.engine.salary.entity.salaryarchive.dto;
|
|||
import com.cloudstore.eccom.pc.table.WeaTableType;
|
||||
import com.engine.salary.annotation.SalaryTable;
|
||||
import com.engine.salary.annotation.SalaryTableOperate;
|
||||
import com.engine.salary.annotation.TableTitle;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
|
@ -26,37 +27,44 @@ import lombok.NoArgsConstructor;
|
|||
})
|
||||
public class SalaryArchiveListDTO {
|
||||
|
||||
@TableTitle(title = "id", dataIndex = "id", key = "id")
|
||||
private Long id;
|
||||
|
||||
// @WeaFormat(
|
||||
// @WeaFormat(
|
||||
// label = "人员信息表的主键id",
|
||||
// tableColumn = @TableColumn(width = "20%")
|
||||
// )
|
||||
@TableTitle(title = "人员信息表的主键id", dataIndex = "employeeId", key = "employeeId")
|
||||
private Long employeeId;
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
@TableTitle(title = "姓名", dataIndex = "username", key = "username")
|
||||
private String username;
|
||||
|
||||
/**
|
||||
* 个税扣缴义务人
|
||||
*/
|
||||
@TableTitle(title = "个税扣缴义务人", dataIndex = "taxAgentName", key = "taxAgentName")
|
||||
private String taxAgentName;
|
||||
|
||||
/**
|
||||
* 部门
|
||||
*/
|
||||
@TableTitle(title = "部门", dataIndex = "departmentName", key = "departmentName")
|
||||
private String departmentName;
|
||||
|
||||
/**
|
||||
* 电话
|
||||
*/
|
||||
@TableTitle(title = "电话", dataIndex = "mobile", key = "mobile")
|
||||
private String mobile;
|
||||
|
||||
/**
|
||||
* 员工状态
|
||||
*/
|
||||
@TableTitle(title = "员工状态", dataIndex = "employeeStatus", key = "employeeStatus")
|
||||
private String employeeStatus;
|
||||
//
|
||||
// /**
|
||||
|
|
|
|||
|
|
@ -22,4 +22,6 @@ public class SalaryArchiveItemQueryParam {
|
|||
Collection<Long> salaryItemIds;
|
||||
|
||||
Collection<Long> salaryArchivesIds;
|
||||
|
||||
Collection<Long> employeeIds;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,37 +11,40 @@ import java.util.Collection;
|
|||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 薪资档案
|
||||
* @Author: wangxiangzhong
|
||||
* @Date: 2021-11-03 10:51
|
||||
*/
|
||||
* 薪资档案
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
//薪资档案查询参数")
|
||||
//薪资档案查询参数
|
||||
public class SalaryArchiveQueryParam extends BaseQueryParam {
|
||||
|
||||
private Collection<Long> ids;
|
||||
|
||||
//姓名")
|
||||
//姓名
|
||||
private String username;
|
||||
|
||||
//个税扣缴义务人id")
|
||||
//个税扣缴义务人id
|
||||
private Long taxAgentId;
|
||||
|
||||
//部门id")
|
||||
//部门id
|
||||
private List<Long> departmentIds;
|
||||
|
||||
//岗位id")
|
||||
//岗位id
|
||||
private List<Long> positionIds;
|
||||
|
||||
//状态")
|
||||
//状态
|
||||
private String userstatus;
|
||||
|
||||
//入职日期")
|
||||
//入职日期
|
||||
private List<LocalDate> hiredate;
|
||||
|
||||
//导入类型")
|
||||
//导入类型
|
||||
private String importType;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,4 +20,6 @@ public class SalaryArchiveTaxAgentQueryParam {
|
|||
private Date effectiveTime;
|
||||
|
||||
Collection<Long> salaryArchivesIds;
|
||||
|
||||
Collection<Long> employeeIds;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,9 +5,8 @@ import com.engine.salary.entity.salarysob.dto.SalarySobCycleDTO;
|
|||
import com.engine.salary.entity.salarysob.po.SalarySobPO;
|
||||
import com.engine.salary.enums.SalaryCycleTypeEnum;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.Period;
|
||||
import java.time.YearMonth;
|
||||
import java.time.*;
|
||||
import java.util.Date;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
|
|
@ -77,14 +76,20 @@ public class SalarySobCycleBO {
|
|||
if (result == null) {
|
||||
return null;
|
||||
}
|
||||
ZoneId zone = ZoneId.systemDefault();
|
||||
LocalDate fromDate = result.atEndOfMonth();
|
||||
if (fromDate.getDayOfMonth() > fromDay) {
|
||||
fromDate = result.atDay(fromDay);
|
||||
}
|
||||
Instant fromInstant = fromDate.atStartOfDay().atZone(zone).toInstant();
|
||||
|
||||
LocalDate endDate = fromDate.plusMonths(1).plusDays(-1);
|
||||
Instant endInstant = endDate.atStartOfDay().atZone(zone).toInstant();
|
||||
|
||||
|
||||
return LocalDateRange.builder()
|
||||
.fromDate(fromDate)
|
||||
.endDate(endDate)
|
||||
.fromDate(Date.from(fromInstant))
|
||||
.endDate(Date.from(endInstant))
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,51 @@
|
|||
package com.engine.salary.enums;
|
||||
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* @Description: 薪资-员工状态
|
||||
* @Author: wangxiangzhong
|
||||
* @Date: 2021/11/1 16:06
|
||||
*/
|
||||
public enum SalaryUserStatusEnum {
|
||||
|
||||
normal("normal", "在职", 100120),
|
||||
unavailable("unavailable", "离职", 85902),
|
||||
locked("locked", "锁定", 102825),
|
||||
unactive("unactive", "未激活", 102826),
|
||||
detached("detached", "无公司", 102827),
|
||||
temp("temp", "临时账号", 102828),
|
||||
invited("invited", "已邀请", 102829);
|
||||
|
||||
private String value;
|
||||
|
||||
private String defaultLabel;
|
||||
|
||||
private int labelId;
|
||||
|
||||
SalaryUserStatusEnum(String value, String defaultLabel, int labelId) {
|
||||
this.value = value;
|
||||
this.defaultLabel = defaultLabel;
|
||||
this.labelId = labelId;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public String getDefaultLabel() {
|
||||
return defaultLabel;
|
||||
}
|
||||
|
||||
public int getLabelId() {
|
||||
return labelId;
|
||||
}
|
||||
|
||||
public static String getDefaultLabelByValue(String value) {
|
||||
Optional<SalaryUserStatusEnum> optional = Arrays.stream(SalaryUserStatusEnum.values()).filter(r -> r.getValue().equals(value)).findFirst();
|
||||
return optional.isPresent() ? SalaryI18nUtil.getI18nLabel(optional.get().getLabelId(), optional.get().getDefaultLabel()) : "";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
package com.engine.salary.mapper.archive;
|
||||
|
||||
import com.engine.salary.entity.salaryarchive.po.SalaryArchiveDimissionPO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface SalaryArchiveDimissionMapper {
|
||||
|
||||
/**
|
||||
* 查询所有记录
|
||||
*
|
||||
* @return 返回集合,没有返回空List
|
||||
*/
|
||||
List<SalaryArchiveDimissionPO> listAll();
|
||||
|
||||
/**
|
||||
* 条件查询
|
||||
*
|
||||
* @return 返回集合,没有返回空List
|
||||
*/
|
||||
List<SalaryArchiveDimissionPO> listSome(SalaryArchiveDimissionPO salaryArchiveDimission);
|
||||
|
||||
|
||||
/**
|
||||
* 根据主键查询
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 返回记录,没有返回null
|
||||
*/
|
||||
SalaryArchiveDimissionPO getById(Long id);
|
||||
|
||||
/**
|
||||
* 新增,忽略null字段
|
||||
*
|
||||
* @param salaryArchiveDimission 新增的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int insertIgnoreNull(SalaryArchiveDimissionPO salaryArchiveDimission);
|
||||
|
||||
/**
|
||||
* 修改,修改所有字段
|
||||
*
|
||||
* @param salaryArchiveDimission 修改的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int update(SalaryArchiveDimissionPO salaryArchiveDimission);
|
||||
|
||||
/**
|
||||
* 修改,忽略null字段
|
||||
*
|
||||
* @param salaryArchiveDimission 修改的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int updateIgnoreNull(SalaryArchiveDimissionPO salaryArchiveDimission);
|
||||
|
||||
/**
|
||||
* 删除记录
|
||||
*
|
||||
* @param salaryArchiveDimission 待删除的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int delete(SalaryArchiveDimissionPO salaryArchiveDimission);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,186 @@
|
|||
<?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.archive.SalaryArchiveDimissionMapper">
|
||||
<resultMap id="BaseResultMap" type="com.engine.salary.entity.salaryarchive.po.SalaryArchiveDimissionPO">
|
||||
<result column="id" property="id"/>
|
||||
<result column="dimission_time_interval" property="dimissionTimeInterval"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
<result column="creator" property="creator"/>
|
||||
<result column="delete_type" property="deleteType"/>
|
||||
<result column="tenant_key" property="tenantKey"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 表字段 -->
|
||||
<sql id="baseColumns">
|
||||
t
|
||||
.
|
||||
id
|
||||
, t.dimission_time_interval
|
||||
, t.create_time
|
||||
, t.update_time
|
||||
, t.creator
|
||||
, t.delete_type
|
||||
, t.tenant_key
|
||||
</sql>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="listAll" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_salary_archive_dimission t
|
||||
WHERE delete_type = 0
|
||||
</select>
|
||||
|
||||
<!-- 根据主键获取单条记录 -->
|
||||
<select id="getById" resultMap="BaseResultMap" parameterType="Long">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_salary_archive_dimission t
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</select>
|
||||
|
||||
<!-- 条件查询 -->
|
||||
<select id="listSome" resultMap="BaseResultMap"
|
||||
parameterType="com.engine.salary.entity.salaryarchive.po.SalaryArchiveDimissionPO">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_salary_archive_dimission t
|
||||
WHERE delete_type = 0
|
||||
<if test="id != null">
|
||||
AND id = #{id}
|
||||
</if>
|
||||
<if test="dimissionTimeInterval != null">
|
||||
AND dimission_time_interval = #{dimissionTimeInterval}
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
AND create_time = #{createTime}
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
AND update_time = #{updateTime}
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
AND creator = #{creator}
|
||||
</if>
|
||||
<if test="deleteType != null">
|
||||
AND delete_type = #{deleteType}
|
||||
</if>
|
||||
<if test="tenantKey != null">
|
||||
AND tenant_key = #{tenantKey}
|
||||
</if>
|
||||
<if test="ids != null and ids.size()>0">
|
||||
AND id IN
|
||||
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
ORDER BY id DESC
|
||||
</select>
|
||||
|
||||
|
||||
<!-- 插入不为NULL的字段 -->
|
||||
<insert id="insertIgnoreNull" parameterType="com.engine.salary.entity.salaryarchive.po.SalaryArchiveDimissionPO"
|
||||
keyProperty="id" keyColumn="id" useGeneratedKeys="true"
|
||||
>
|
||||
INSERT INTO hrsa_salary_archive_dimission
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="dimissionTimeInterval != null">
|
||||
dimission_time_interval,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
creator,
|
||||
</if>
|
||||
<if test="deleteType != null">
|
||||
delete_type,
|
||||
</if>
|
||||
<if test="tenantKey != null">
|
||||
tenant_key,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id},
|
||||
</if>
|
||||
<if test="dimissionTimeInterval != null">
|
||||
#{dimissionTimeInterval},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
#{updateTime},
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
#{creator},
|
||||
</if>
|
||||
<if test="deleteType != null">
|
||||
#{deleteType},
|
||||
</if>
|
||||
<if test="tenantKey != null">
|
||||
#{tenantKey},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<!-- 更新,更新全部字段 -->
|
||||
<update id="update" parameterType="com.engine.salary.entity.salaryarchive.po.SalaryArchiveDimissionPO">
|
||||
UPDATE hrsa_salary_archive_dimission
|
||||
<set>
|
||||
dimission_time_interval=#{dimissionTimeInterval},
|
||||
create_time=#{createTime},
|
||||
update_time=#{updateTime},
|
||||
creator=#{creator},
|
||||
delete_type=#{deleteType},
|
||||
tenant_key=#{tenantKey},
|
||||
</set>
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</update>
|
||||
|
||||
|
||||
<!-- 更新不为NULL的字段 -->
|
||||
<update id="updateIgnoreNull" parameterType="com.engine.salary.entity.salaryarchive.po.SalaryArchiveDimissionPO">
|
||||
UPDATE hrsa_salary_archive_dimission
|
||||
<set>
|
||||
<if test="dimissionTimeInterval != null">
|
||||
dimission_time_interval=#{dimissionTimeInterval},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time=#{createTime},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time=#{updateTime},
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
creator=#{creator},
|
||||
</if>
|
||||
<if test="deleteType != null">
|
||||
delete_type=#{deleteType},
|
||||
</if>
|
||||
<if test="tenantKey != null">
|
||||
tenant_key=#{tenantKey},
|
||||
</if>
|
||||
</set>
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</update>
|
||||
|
||||
|
||||
<!-- 根据主键删除记录 -->
|
||||
<delete id="delete" parameterType="com.engine.salary.entity.salaryarchive.po.SalaryArchiveDimissionPO">
|
||||
UPDATE hrsa_salary_archive_dimission
|
||||
SET delete_type=1
|
||||
WHERE id = #{id}
|
||||
AND delete_type = 0
|
||||
</delete>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
@ -886,18 +886,24 @@
|
|||
FROM hrsa_salary_archive_item t
|
||||
WHERE delete_type = 0
|
||||
<if test="param.effectiveTime != null">
|
||||
AND t.effective_time <= #{effectiveTime}
|
||||
AND t.effective_time <= #{param.effectiveTime}
|
||||
</if>
|
||||
<if test="param.salaryItemIds != null and param.salaryItemIds.size()>0">
|
||||
AND t.salary_item_id IN
|
||||
<foreach collection="param.ids" open="(" item="salaryItemId" separator="," close=")">
|
||||
#{salaryItemId}
|
||||
#{param.salaryItemId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param.salaryArchiveIds != null and param.salaryArchiveIds.size()>0">
|
||||
AND t.salary_archive_id IN
|
||||
<foreach collection="param.ids" open="(" item="salaryArchiveId" separator="," close=")">
|
||||
#{salaryArchiveId}
|
||||
#{param.salaryArchiveId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param.employeeIds != null and param.employeeIds.size()>0">
|
||||
AND t.employee_id IN
|
||||
<foreach collection="param.ids" open="(" item="employeeId" separator="," close=")">
|
||||
#{param.employeeId}
|
||||
</foreach>
|
||||
</if>
|
||||
ORDER BY t.effective_time DESC
|
||||
|
|
|
|||
|
|
@ -70,10 +70,9 @@ public interface SalaryArchiveMapper {
|
|||
/**
|
||||
* 查询薪资档案列表
|
||||
* @param param
|
||||
* @param tenantKey
|
||||
* @return
|
||||
*/
|
||||
List<SalaryArchiveListDTO> list(@Param("param") SalaryArchiveQueryParam param, @Param("tenantKey") String tenantKey);
|
||||
List<SalaryArchiveListDTO> list(@Param("param") SalaryArchiveQueryParam param);
|
||||
|
||||
/**
|
||||
* 分页查询薪资档案列表
|
||||
|
|
|
|||
|
|
@ -305,6 +305,13 @@
|
|||
#{salaryArchiveId}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
<if test="param.employeeIds != null and param.employeeIds.size()>0">
|
||||
AND t.employee_id IN
|
||||
<foreach collection="param.employeeIds" open="(" item="employeeId" separator="," close=")">
|
||||
#{employeeId}
|
||||
</foreach>
|
||||
</if>
|
||||
ORDER BY t.effective_time DESC
|
||||
</select>
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,97 @@
|
|||
package com.engine.salary.service;
|
||||
|
||||
import com.engine.salary.entity.salaryarchive.dto.SalaryItemAdjustRecordListDTO;
|
||||
import com.engine.salary.entity.salaryarchive.param.SalaryArchiveItemSaveParam;
|
||||
import com.engine.salary.entity.salaryarchive.param.SalaryItemAdjustBeforeParam;
|
||||
import com.engine.salary.entity.salaryarchive.param.SalaryItemAdjustRecordQueryParam;
|
||||
import com.engine.salary.entity.salaryarchive.po.SalaryArchiveItemPO;
|
||||
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 薪资档案-薪资项目
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
public interface SalaryArchiveItemService {
|
||||
|
||||
/**
|
||||
* 获取单个薪资档案项目调整记录
|
||||
*
|
||||
* @param salaryArchiveItemId
|
||||
* @return
|
||||
*/
|
||||
SalaryArchiveItemPO getById(Long salaryArchiveItemId);
|
||||
|
||||
/**
|
||||
* 获取可以调整的薪资项目
|
||||
*
|
||||
*/
|
||||
List<SalaryItemPO> getCanAdjustSalaryItems();
|
||||
|
||||
/**
|
||||
* 获取薪资项目调整前的值
|
||||
*
|
||||
* @param adjustBeforeParam
|
||||
*/
|
||||
String getSalaryItemAdjustBeforeValue(SalaryItemAdjustBeforeParam adjustBeforeParam);
|
||||
|
||||
/**
|
||||
* 获取当前已生效
|
||||
*
|
||||
* @param salaryArchiveId
|
||||
* @param salaryItemPageIds
|
||||
*/
|
||||
List<SalaryArchiveItemPO> getEffectiveSalaryItems(Long salaryArchiveId, List<Long> salaryItemPageIds);
|
||||
|
||||
/**
|
||||
* 保存薪资项目调整
|
||||
*
|
||||
* @param saveParam
|
||||
* @return
|
||||
*/
|
||||
String saveSalaryItem(SalaryArchiveItemSaveParam saveParam);
|
||||
|
||||
/**
|
||||
* 删除薪资项目调整
|
||||
*
|
||||
* @param salaryArchiveItemId
|
||||
* @return
|
||||
*/
|
||||
String deleteSalaryItem(Long salaryArchiveItemId);
|
||||
|
||||
/**
|
||||
* 薪资调整记录列表(分页)
|
||||
*
|
||||
* @param page
|
||||
* @param queryParam
|
||||
* @param salaryItemIds
|
||||
* @param tenantKey
|
||||
* @return
|
||||
*/
|
||||
// Page<SalaryItemAdjustRecordListDTO> salaryItemAdjustRecordListPage(Page<SalaryItemAdjustRecordListDTO> page, SalaryItemAdjustRecordQueryParam queryParam, List<Long> salaryItemIds, String tenantKey);
|
||||
|
||||
/**
|
||||
* 薪资调整记录列表
|
||||
*
|
||||
* @param queryParam
|
||||
* @param salaryItemIds
|
||||
* @return
|
||||
*/
|
||||
List<SalaryItemAdjustRecordListDTO> salaryItemAdjustRecordList(SalaryItemAdjustRecordQueryParam queryParam, List<Long> salaryItemIds);
|
||||
|
||||
/**
|
||||
* 导出薪资项目的调整记录列表
|
||||
*
|
||||
* @param map
|
||||
* @param username
|
||||
* @param eteamsId
|
||||
* @param queryParam
|
||||
*/
|
||||
void exportAdjustRecordList(Map<String, Object> map, String username, String eteamsId, SalaryItemAdjustRecordQueryParam queryParam);
|
||||
}
|
||||
|
|
@ -1,130 +1,128 @@
|
|||
//package com.engine.salary.service;
|
||||
//
|
||||
//import com.engine.salary.common.LocalDateRange;
|
||||
//import com.engine.salary.entity.salaryarchive.dto.SalaryArchiveDataDTO;
|
||||
//import com.engine.salary.entity.salaryarchive.dto.SalaryArchiveListDTO;
|
||||
//import com.engine.salary.entity.salaryarchive.dto.TaxAgentListDTO;
|
||||
//import com.engine.salary.entity.salaryarchive.param.SalaryArchiveDimissionSaveParam;
|
||||
//import com.engine.salary.entity.salaryarchive.param.SalaryArchiveQueryParam;
|
||||
//import com.engine.salary.entity.salaryarchive.po.SalaryArchiveDimissionPO;
|
||||
//import com.engine.salary.entity.salaryarchive.po.SalaryArchiveItemPO;
|
||||
//import com.engine.salary.entity.salaryarchive.po.SalaryArchivePO;
|
||||
//import com.engine.salary.entity.salaryarchive.po.SalaryArchiveTaxAgentPO;
|
||||
//import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
||||
//import com.engine.salary.enums.salaryarchive.SalaryArchiveImportTypeEnum;
|
||||
//
|
||||
//import java.util.Collection;
|
||||
//import java.util.List;
|
||||
//import java.util.Map;
|
||||
//
|
||||
///**
|
||||
// * 薪资档案
|
||||
// * <p>Copyright: Copyright (c) 2022</p>
|
||||
// * <p>Company: 泛微软件</p>
|
||||
// *
|
||||
// * @author qiantao
|
||||
// * @version 1.0
|
||||
// **/
|
||||
//public interface SalaryArchiveService {
|
||||
//
|
||||
// /**
|
||||
// * 获取薪资档案单条主记录
|
||||
// *
|
||||
// * @param salaryArchiveId
|
||||
// * @return
|
||||
// */
|
||||
// SalaryArchivePO getById(Long salaryArchiveId);
|
||||
//
|
||||
// /**
|
||||
// * 薪资档案列表(分页)
|
||||
// *
|
||||
// * @param page
|
||||
// * @param queryParam
|
||||
// * @param tenantKey
|
||||
// * @return
|
||||
// */
|
||||
//// Page<SalaryArchiveListDTO> listPage(Page<SalaryArchiveListDTO> page, SalaryArchiveQueryParam queryParam, String tenantKey);
|
||||
//
|
||||
// /**
|
||||
// * 构建薪资档案数据
|
||||
// *
|
||||
// * @param salaryArchives
|
||||
// * @param taxAgentLists
|
||||
// * @param salaryItems
|
||||
// * @param isPage
|
||||
// * @return
|
||||
// */
|
||||
// List<Map<String, Object>> buildSalaryArchiveData(Collection<SalaryArchiveListDTO> salaryArchives, Collection<TaxAgentListDTO> taxAgentLists, List<SalaryItemPO> salaryItems, Boolean isPage);
|
||||
//
|
||||
// /**
|
||||
// * 获取薪资档案对应的当前生效的薪资项目
|
||||
// *
|
||||
// * @param salaryArchivesIds
|
||||
// * @return
|
||||
// */
|
||||
// List<SalaryArchiveItemPO> getCurrentEffectiveItemList(Collection<Long> salaryArchivesIds, Collection<Long> salaryItemIds);
|
||||
//
|
||||
// /**
|
||||
// * 获取薪资档案对应的当前生效的个税扣缴义务人
|
||||
// *
|
||||
// * @param salaryArchivesIds
|
||||
// * @return
|
||||
// */
|
||||
// List<SalaryArchiveTaxAgentPO> getCurrentEffectiveTaxAgentList(Collection<Long> salaryArchivesIds);
|
||||
//
|
||||
// /**
|
||||
// * 导出薪资档案列表
|
||||
// *
|
||||
// * @param map
|
||||
// * @param username
|
||||
// * @param eteamsId
|
||||
// * @param queryParam
|
||||
// * @throws Exception
|
||||
// */
|
||||
// void exportList(Map<String, Object> map, String username, String eteamsId, SalaryArchiveQueryParam queryParam);
|
||||
//
|
||||
// /**
|
||||
// * 下载导入模板
|
||||
// *
|
||||
// * @param map
|
||||
// * @param username
|
||||
// * @param eteamsId
|
||||
// * @param salaryArchiveImportTypeEnum
|
||||
// * @param queryParam
|
||||
// * @return
|
||||
// */
|
||||
// void downloadTemplate(Map<String, Object> map, String username, String eteamsId, SalaryArchiveImportTypeEnum salaryArchiveImportTypeEnum, SalaryArchiveQueryParam queryParam);
|
||||
//
|
||||
// /**
|
||||
// * 获取离职时段设置
|
||||
// *
|
||||
// */
|
||||
// List<SalaryArchiveDimissionPO> dimissionSets();
|
||||
//
|
||||
// /**
|
||||
// * 保存离职时段设置
|
||||
// *
|
||||
// * @param saveParam
|
||||
// * @return
|
||||
// */
|
||||
// String saveDimissionSet(SalaryArchiveDimissionSaveParam saveParam);
|
||||
//
|
||||
// /**
|
||||
// * 根据日期范围与人员id获取薪资档案-薪资项目数据
|
||||
// *
|
||||
// * @param localDateRange
|
||||
// * @param employeeIds 为空则返回所有人的
|
||||
// * @return
|
||||
// */
|
||||
// List<SalaryArchiveDataDTO> getSalaryArchiveData(LocalDateRange localDateRange, Collection<Long> employeeIds);
|
||||
//
|
||||
// /**
|
||||
// * 根据日期范围与人员id获取薪资档案-个税扣缴义务人数据
|
||||
// *
|
||||
// * @param localDateRange
|
||||
// * @param employeeIds 为空则返回所有人的
|
||||
// * @param tenantKey
|
||||
// * @return
|
||||
// */
|
||||
// List<SalaryArchiveDataDTO> getSalaryArchiveTaxAgentData(LocalDateRange localDateRange, Collection<Long> employeeIds, String tenantKey);
|
||||
//}
|
||||
package com.engine.salary.service;
|
||||
|
||||
import com.engine.salary.common.LocalDateRange;
|
||||
import com.engine.salary.entity.salaryarchive.dto.SalaryArchiveDataDTO;
|
||||
import com.engine.salary.entity.salaryarchive.dto.SalaryArchiveListDTO;
|
||||
import com.engine.salary.entity.salaryarchive.param.SalaryArchiveDimissionSaveParam;
|
||||
import com.engine.salary.entity.salaryarchive.param.SalaryArchiveQueryParam;
|
||||
import com.engine.salary.entity.salaryarchive.po.SalaryArchiveDimissionPO;
|
||||
import com.engine.salary.entity.salaryarchive.po.SalaryArchiveItemPO;
|
||||
import com.engine.salary.entity.salaryarchive.po.SalaryArchivePO;
|
||||
import com.engine.salary.entity.salaryarchive.po.SalaryArchiveTaxAgentPO;
|
||||
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
||||
import com.engine.salary.entity.taxrate.TaxAgent;
|
||||
import com.engine.salary.enums.salaryarchive.SalaryArchiveImportTypeEnum;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 薪资档案
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
public interface SalaryArchiveService {
|
||||
|
||||
/**
|
||||
* 获取薪资档案单条主记录
|
||||
*
|
||||
* @param salaryArchiveId
|
||||
* @return
|
||||
*/
|
||||
SalaryArchivePO getById(Long salaryArchiveId);
|
||||
|
||||
/**
|
||||
* 薪资档案列表(分页)
|
||||
*
|
||||
* @param queryParam
|
||||
* @return
|
||||
*/
|
||||
PageInfo<SalaryArchiveListDTO> listPage(SalaryArchiveQueryParam queryParam);
|
||||
|
||||
/**
|
||||
* 构建薪资档案数据
|
||||
*
|
||||
* @param salaryArchives
|
||||
* @param taxAgentLists
|
||||
* @param salaryItems
|
||||
* @param isPage
|
||||
* @return
|
||||
*/
|
||||
List<Map<String, Object>> buildSalaryArchiveData(Collection<SalaryArchiveListDTO> salaryArchives, Collection<TaxAgent> taxAgentLists, List<SalaryItemPO> salaryItems, Boolean isPage);
|
||||
|
||||
/**
|
||||
* 获取薪资档案对应的当前生效的薪资项目
|
||||
*
|
||||
* @param salaryArchivesIds
|
||||
* @return
|
||||
*/
|
||||
List<SalaryArchiveItemPO> getCurrentEffectiveItemList(Collection<Long> salaryArchivesIds, Collection<Long> salaryItemIds);
|
||||
|
||||
/**
|
||||
* 获取薪资档案对应的当前生效的个税扣缴义务人
|
||||
*
|
||||
* @param salaryArchivesIds
|
||||
* @return
|
||||
*/
|
||||
List<SalaryArchiveTaxAgentPO> getCurrentEffectiveTaxAgentList(Collection<Long> salaryArchivesIds);
|
||||
|
||||
/**
|
||||
* 导出薪资档案列表
|
||||
*
|
||||
* @param map
|
||||
* @param username
|
||||
* @param eteamsId
|
||||
* @param queryParam
|
||||
* @throws Exception
|
||||
*/
|
||||
void exportList(Map<String, Object> map, String username, String eteamsId, SalaryArchiveQueryParam queryParam);
|
||||
|
||||
/**
|
||||
* 下载导入模板
|
||||
*
|
||||
* @param map
|
||||
* @param username
|
||||
* @param eteamsId
|
||||
* @param salaryArchiveImportTypeEnum
|
||||
* @param queryParam
|
||||
* @return
|
||||
*/
|
||||
void downloadTemplate(Map<String, Object> map, String username, String eteamsId, SalaryArchiveImportTypeEnum salaryArchiveImportTypeEnum, SalaryArchiveQueryParam queryParam);
|
||||
|
||||
/**
|
||||
* 获取离职时段设置
|
||||
*
|
||||
*/
|
||||
List<SalaryArchiveDimissionPO> dimissionSets();
|
||||
|
||||
/**
|
||||
* 保存离职时段设置
|
||||
*
|
||||
* @param saveParam
|
||||
* @return
|
||||
*/
|
||||
String saveDimissionSet(SalaryArchiveDimissionSaveParam saveParam);
|
||||
|
||||
/**
|
||||
* 根据日期范围与人员id获取薪资档案-薪资项目数据
|
||||
*
|
||||
* @param localDateRange
|
||||
* @param employeeIds 为空则返回所有人的
|
||||
* @return
|
||||
*/
|
||||
List<SalaryArchiveDataDTO> getSalaryArchiveData(LocalDateRange localDateRange, Collection<Long> employeeIds);
|
||||
|
||||
/**
|
||||
* 根据日期范围与人员id获取薪资档案-个税扣缴义务人数据
|
||||
*
|
||||
* @param localDateRange
|
||||
* @param employeeIds 为空则返回所有人的
|
||||
* @return
|
||||
*/
|
||||
List<SalaryArchiveDataDTO> getSalaryArchiveTaxAgentData(LocalDateRange localDateRange, Collection<Long> employeeIds);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
package com.engine.salary.service;
|
||||
|
||||
import com.cloudstore.eccom.pc.table.WeaTable;
|
||||
import weaver.hrm.User;
|
||||
import com.engine.salary.entity.taxrate.TaxAgent;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
|
||||
public interface TaxAgentService {
|
||||
|
|
@ -18,4 +18,7 @@ public interface TaxAgentService {
|
|||
Map<String, Object> delete(Map<String, Object> params);
|
||||
|
||||
Map<String, Object> selectList(Map<String, Object> params);
|
||||
|
||||
Collection<TaxAgent> findAll();
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,390 @@
|
|||
//package com.engine.salary.service.impl;
|
||||
//
|
||||
//import com.alibaba.fastjson.JSONObject;
|
||||
//import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
|
||||
//import com.engine.core.impl.Service;
|
||||
//import com.engine.salary.service.SalaryArchiveItemService;
|
||||
//import com.google.common.collect.Lists;
|
||||
//import com.weaver.common.base.entity.result.WeaResult;
|
||||
//import com.weaver.common.base.enumeration.result.WeaResultCodeEnum;
|
||||
//import com.weaver.common.batch.context.BatchExportContext;
|
||||
//import com.weaver.common.batch.entity.BatchCallbackMessage;
|
||||
//import com.weaver.common.batch.handler.BatchExportHandler;
|
||||
//import com.weaver.common.component.table.page.Page;
|
||||
//import com.weaver.common.distribution.genid.IdGenerator;
|
||||
//import com.weaver.hrm.salary.common.excel.ExcelSheetData;
|
||||
//import com.weaver.hrm.salary.common.excel.ExportExcelInfo;
|
||||
//import com.weaver.hrm.salary.dao.SalaryArchiveItemMapper;
|
||||
//import com.weaver.hrm.salary.dao.SalaryArchiveMapper;
|
||||
//import com.weaver.hrm.salary.dao.SalaryItemMapper;
|
||||
//import com.weaver.hrm.salary.entity.salaryarchive.dto.*;
|
||||
//import com.weaver.hrm.salary.entity.salaryarchive.param.*;
|
||||
//import com.weaver.hrm.salary.entity.salaryarchive.po.SalaryArchiveItemPO;
|
||||
//import com.weaver.hrm.salary.entity.salaryarchive.po.SalaryArchivePO;
|
||||
//import com.weaver.hrm.salary.entity.salaryitem.po.SalaryItemPO;
|
||||
//import com.weaver.hrm.salary.enums.SalaryOnOffEnum;
|
||||
//import com.weaver.hrm.salary.enums.SalaryUserStatusEnum;
|
||||
//import com.weaver.hrm.salary.enums.salaryarchive.SalaryArchiveItemAdjustReasonEnum;
|
||||
//import com.weaver.hrm.salary.exception.SalaryRunTimeException;
|
||||
//import com.weaver.hrm.salary.service.SalaryBatchService;
|
||||
//import com.weaver.hrm.salary.util.SalaryDateUtil;
|
||||
//import com.weaver.hrm.salary.util.SalaryI18nUtil;
|
||||
//import org.apache.commons.collections4.CollectionUtils;
|
||||
//import org.apache.commons.lang3.StringUtils;
|
||||
//import org.slf4j.Logger;
|
||||
//import org.slf4j.LoggerFactory;
|
||||
//import org.springframework.transaction.annotation.Transactional;
|
||||
//
|
||||
//import javax.annotation.Resource;
|
||||
//import java.text.SimpleDateFormat;
|
||||
//import java.time.LocalDate;
|
||||
//import java.time.LocalDateTime;
|
||||
//import java.util.*;
|
||||
//import java.util.stream.Collectors;
|
||||
//
|
||||
///**
|
||||
// * 薪资档案薪资项目
|
||||
// * <p>Copyright: Copyright (c) 2022</p>
|
||||
// * <p>Company: 泛微软件</p>
|
||||
// *
|
||||
// * @author qiantao
|
||||
// * @version 1.0
|
||||
// **/
|
||||
//public class SalaryArchiveItemServiceImpl extends Service implements SalaryArchiveItemService {
|
||||
// private static final Logger log = LoggerFactory.getLogger(SalaryArchiveItemServiceImpl.class);
|
||||
// @Resource
|
||||
// private SalaryArchiveMapper salaryArchiveMapper;
|
||||
// @Resource
|
||||
// private SalaryItemMapper salaryItemMapper;
|
||||
// @Resource
|
||||
// private SalaryArchiveItemMapper salaryArchiveItemMapper;
|
||||
// @Resource
|
||||
// private SalaryBatchService salaryBatchService;
|
||||
//
|
||||
// @Override
|
||||
// public SalaryArchiveItemPO getById(Long salaryArchiveItemId, String tenantKey) {
|
||||
// return salaryArchiveItemMapper.getById(salaryArchiveItemId, tenantKey);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 获取未生效
|
||||
// *
|
||||
// * @param salaryArchiveId
|
||||
// * @param salaryItemIds
|
||||
// * @param tenantKey
|
||||
// * @return
|
||||
// */
|
||||
// private List<SalaryArchiveItemPO> getIneffectiveSalaryItems(Long salaryArchiveId, List<Long> salaryItemIds, String tenantKey) {
|
||||
// // 没有薪资项目时,给个不存在的,否则加载所有不合理
|
||||
// salaryItemIds = CollectionUtils.isEmpty(salaryItemIds)?Collections.singletonList(0L):salaryItemIds;
|
||||
// return new LambdaQueryChainWrapper<>(salaryArchiveItemMapper)
|
||||
// .eq(SalaryArchiveItemPO::getDeleteType, 0)
|
||||
// .eq(SalaryArchiveItemPO::getTenantKey, tenantKey)
|
||||
// .eq(SalaryArchiveItemPO::getSalaryArchiveId, salaryArchiveId)
|
||||
// .in(SalaryArchiveItemPO::getSalaryItemId, salaryItemIds)
|
||||
// .gt(SalaryArchiveItemPO::getEffectiveTime, LocalDate.now())
|
||||
// .list();
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 获取当前已生效
|
||||
// *
|
||||
// * @param salaryArchiveId
|
||||
// * @param salaryItemIds
|
||||
// * @param tenantKey
|
||||
// * @return
|
||||
// */
|
||||
// @Override
|
||||
// public List<SalaryArchiveItemPO> getEffectiveSalaryItems(Long salaryArchiveId, List<Long> salaryItemIds, String tenantKey) {
|
||||
// // 没有薪资项目时,给个不存在的,否则加载所有不合理
|
||||
// salaryItemIds = CollectionUtils.isEmpty(salaryItemIds)?Collections.singletonList(0L):salaryItemIds;
|
||||
// return new LambdaQueryChainWrapper<>(salaryArchiveItemMapper)
|
||||
// .eq(SalaryArchiveItemPO::getDeleteType, 0)
|
||||
// .eq(SalaryArchiveItemPO::getTenantKey, tenantKey)
|
||||
// .eq(SalaryArchiveItemPO::getSalaryArchiveId, salaryArchiveId)
|
||||
// .in(SalaryArchiveItemPO::getSalaryItemId, salaryItemIds)
|
||||
// .le(SalaryArchiveItemPO::getEffectiveTime, LocalDate.now())
|
||||
// .orderByDesc(SalaryArchiveItemPO::getEffectiveTime)
|
||||
// .list();
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public String getSalaryItemAdjustBeforeValue(SalaryItemAdjustBeforeParam adjustBeforeParam, Long currentEmployeeId, String currentTenantKey) {
|
||||
// WeaResult<String> checkResult = SalaryItemAdjustBeforeParam.checkParam(adjustBeforeParam, currentEmployeeId, currentTenantKey);
|
||||
// if (checkResult.getCode() == WeaResultCodeEnum.ERROR.getCode()) {
|
||||
// return checkResult.getData();
|
||||
// }
|
||||
// List<SalaryArchiveItemPO> archiveItemList;
|
||||
// if (adjustBeforeParam.getSalaryArchiveItemId()==null) {
|
||||
// archiveItemList = getEffectiveSalaryItems(adjustBeforeParam.getSalaryArchiveId(), Collections.singletonList(adjustBeforeParam.getSalaryItemId()), currentTenantKey);
|
||||
// } else {
|
||||
// SalaryArchiveItemPO salaryArchiveItem = salaryArchiveItemMapper.getById(adjustBeforeParam.getSalaryArchiveItemId(), currentTenantKey);
|
||||
// if (salaryArchiveItem == null) {
|
||||
// return "";
|
||||
// }
|
||||
// // 如果不是当前记录的
|
||||
// if (!salaryArchiveItem.getSalaryItemId().equals(adjustBeforeParam.getSalaryItemId())) {
|
||||
// archiveItemList = getEffectiveSalaryItems(adjustBeforeParam.getSalaryArchiveId(), Collections.singletonList(adjustBeforeParam.getSalaryItemId()), currentTenantKey);
|
||||
// } else {
|
||||
// archiveItemList = new LambdaQueryChainWrapper<>(salaryArchiveItemMapper)
|
||||
// .eq(SalaryArchiveItemPO::getDeleteType, 0)
|
||||
// .eq(SalaryArchiveItemPO::getTenantKey, currentTenantKey)
|
||||
// .eq(SalaryArchiveItemPO::getSalaryArchiveId, adjustBeforeParam.getSalaryArchiveId())
|
||||
// .eq(SalaryArchiveItemPO::getSalaryItemId, salaryArchiveItem.getSalaryItemId())
|
||||
// .lt(SalaryArchiveItemPO::getEffectiveTime, salaryArchiveItem.getEffectiveTime())
|
||||
// .orderByDesc(SalaryArchiveItemPO::getEffectiveTime)
|
||||
// .list();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// return CollectionUtils.isNotEmpty(archiveItemList)?archiveItemList.get(0).getItemValue():"";
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// @Transactional(rollbackFor = Exception.class)
|
||||
// public String saveSalaryItem(SalaryArchiveItemSaveParam saveParam, Long employeeId, String tenantKey) {
|
||||
// // 检查参数
|
||||
// SalaryArchiveItemSaveParam.checkParam(saveParam, employeeId, tenantKey);
|
||||
//
|
||||
// Long salaryArchiveId = saveParam.getSalaryArchiveId();
|
||||
// // 获取所有可被引用的薪资项目
|
||||
// List<SalaryItemPO> salaryItems = getCanAdjustSalaryItems(tenantKey);
|
||||
// // 待处理薪资项目
|
||||
// List<SalaryArchiveItemDetailSaveParam> salaryArchiveItems = saveParam.getSalaryArchiveItems().stream().filter(e -> {
|
||||
// Optional<SalaryItemPO> optional = salaryItems.stream().filter(i -> i.getId().equals(e.getSalaryItemId())).findFirst();
|
||||
// return optional.isPresent();
|
||||
// }).collect(Collectors.toList());
|
||||
// List<Long> salaryItemIds = salaryArchiveItems.stream().map(SalaryArchiveItemDetailSaveParam::getSalaryItemId).collect(Collectors.toList());
|
||||
//
|
||||
// // 薪资档案
|
||||
// SalaryArchivePO salaryArchive = salaryArchiveMapper.getById(salaryArchiveId, tenantKey);
|
||||
// // 获取当前已生效数据
|
||||
// List<SalaryArchiveItemPO> effectiveSalaryItems = getEffectiveSalaryItems(salaryArchiveId, salaryItemIds, tenantKey);
|
||||
//
|
||||
// // 获取未生效数据
|
||||
// List<SalaryArchiveItemPO> ineffectiveSalaryItems = getIneffectiveSalaryItems(salaryArchiveId, salaryItemIds, tenantKey);
|
||||
// // 待保存生效时间
|
||||
// LocalDate saveEffectiveTime = saveParam.getEffectiveTime();
|
||||
// // 当天
|
||||
// LocalDate today = LocalDate.now();
|
||||
// // 当前时间
|
||||
// LocalDateTime nowTime = LocalDateTime.now();
|
||||
//
|
||||
// List<Long> effectiveSalaryItemDels = Lists.newArrayList();
|
||||
// List<SalaryArchiveItemPO> salaryArchiveItemNews = Lists.newArrayList();
|
||||
// salaryArchiveItems.forEach(e -> {
|
||||
// // 已生效
|
||||
// List<SalaryArchiveItemPO> effectiveList = effectiveSalaryItems.stream().filter(i -> i.getSalaryItemId().equals(e.getSalaryItemId())).collect(Collectors.toList());
|
||||
// // 当前已生效
|
||||
// SalaryArchiveItemPO effectiveSalaryItem = CollectionUtils.isNotEmpty(effectiveList)&&effectiveList.size()>0?effectiveList.get(0):null;
|
||||
// // 当前已生效的前一次调整
|
||||
// SalaryArchiveItemPO effectiveBeforeSalaryItem = CollectionUtils.isNotEmpty(effectiveList)&&effectiveList.size()>1?effectiveList.get(1):null;
|
||||
// // 未生效
|
||||
// Optional<SalaryArchiveItemPO> optionalIneffective = ineffectiveSalaryItems.stream().filter(i -> i.getSalaryItemId().equals(e.getSalaryItemId())).findFirst();
|
||||
// SalaryArchiveItemPO ineffectiveSalaryItem = optionalIneffective.orElse(null);
|
||||
//
|
||||
// // 1.检验是否可以调整
|
||||
// if (effectiveSalaryItem != null) {
|
||||
// // 当前已经生效的时间
|
||||
// LocalDate effectiveTime = effectiveSalaryItem.getEffectiveTime();
|
||||
// // 1.1 如果早于<当前已生效
|
||||
// if (saveEffectiveTime.isBefore(effectiveTime)) {
|
||||
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 100429, "生效日期不可早于当前已生效的调整日期"));
|
||||
// // 1.2 如果等于当前已生效
|
||||
// } else if (saveEffectiveTime.isEqual(effectiveTime)) {
|
||||
// if (effectiveBeforeSalaryItem !=null && effectiveBeforeSalaryItem.getItemValue().equals(e.getAdjustValue())) {
|
||||
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 100432, "调整前后不可相同"));
|
||||
// }
|
||||
// if (ineffectiveSalaryItem != null && ineffectiveSalaryItem.getItemValue().equals(e.getAdjustValue())) {
|
||||
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 100434, "与未生效的调整后不可相同"));
|
||||
// }
|
||||
// // 1.3 如果>已经生效且<=今天
|
||||
// } else if (saveEffectiveTime.isAfter(effectiveTime) && !saveEffectiveTime.isAfter(today)) {
|
||||
// if (effectiveSalaryItem.getItemValue().equals(e.getAdjustValue())) {
|
||||
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 100432, "调整前后不可相同"));
|
||||
// }
|
||||
// if (ineffectiveSalaryItem != null && ineffectiveSalaryItem.getItemValue().equals(e.getAdjustValue())) {
|
||||
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 100434, "与未生效的调整后不可相同"));
|
||||
// }
|
||||
// // 1.4 如果>今天
|
||||
// } else if (saveEffectiveTime.isAfter(today) && effectiveSalaryItem.getItemValue().equals(e.getAdjustValue())) {
|
||||
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 100432, "调整前后不可相同"));
|
||||
// }
|
||||
// } else if (ineffectiveSalaryItem != null && ineffectiveSalaryItem.getItemValue().equals(e.getAdjustValue())) {
|
||||
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 100434, "与未生效的调整后不可相同"));
|
||||
// }
|
||||
// // 2.数据处理
|
||||
// if (effectiveSalaryItem != null && saveEffectiveTime.isEqual(effectiveSalaryItem.getEffectiveTime())) {
|
||||
// effectiveSalaryItemDels.add(effectiveSalaryItem.getId());
|
||||
// }
|
||||
// if (ineffectiveSalaryItem != null && saveEffectiveTime.isAfter(today)) {
|
||||
// effectiveSalaryItemDels.add(ineffectiveSalaryItem.getId());
|
||||
// }
|
||||
// salaryArchiveItemNews.add(buildInsert(salaryArchive, e.getSalaryItemId(), e.getAdjustValue(), saveParam, nowTime, employeeId, tenantKey));
|
||||
// });
|
||||
//
|
||||
// // 落库处理
|
||||
// if (CollectionUtils.isNotEmpty(effectiveSalaryItemDels)) {
|
||||
// salaryArchiveItemMapper.deleteBatchIds(effectiveSalaryItemDels);
|
||||
// }
|
||||
// if (CollectionUtils.isNotEmpty(salaryArchiveItemNews)) {
|
||||
// salaryArchiveItemMapper.batchInsert(salaryArchiveItemNews);
|
||||
// }
|
||||
//
|
||||
// return StringUtils.EMPTY;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 插入
|
||||
// *
|
||||
// * @param salaryArchive
|
||||
// * @param saveParam
|
||||
// * @param nowTime
|
||||
// * @param employeeId
|
||||
// * @param tenantKey
|
||||
// */
|
||||
// private SalaryArchiveItemPO buildInsert(SalaryArchivePO salaryArchive, Long salaryItemId, String adjustValue, SalaryArchiveItemSaveParam saveParam, LocalDateTime nowTime, Long employeeId, String tenantKey) {
|
||||
// return SalaryArchiveItemPO.builder()
|
||||
// .id(IdGenerator.generate())
|
||||
// .salaryArchiveId(saveParam.getSalaryArchiveId())
|
||||
// .employeeId(salaryArchive.getEmployeeId())
|
||||
// .effectiveTime(saveParam.getEffectiveTime())
|
||||
// .adjustReason(saveParam.getAdjustReason().getValue())
|
||||
// .description(saveParam.getDescription())
|
||||
// .salaryItemId(salaryItemId)
|
||||
// // 调整后
|
||||
// .itemValue(adjustValue)
|
||||
// .operator(employeeId)
|
||||
// .operateTime(nowTime)
|
||||
// .createTime(LocalDateTime.now())
|
||||
// .updateTime(LocalDateTime.now())
|
||||
// .creator(employeeId)
|
||||
// .tenantKey(tenantKey)
|
||||
// .build();
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// @Transactional(rollbackFor = Exception.class)
|
||||
// public String deleteSalaryItem(Long salaryArchiveItemId, Long currentEmployeeId, String currentTenantKey) {
|
||||
// SalaryArchiveItemPO salaryArchiveItem = salaryArchiveItemMapper.getById(salaryArchiveItemId, currentTenantKey);
|
||||
// if (salaryArchiveItem == null) {
|
||||
// return StringUtils.EMPTY;
|
||||
// }
|
||||
// if (salaryArchiveItem.getEffectiveTime().isAfter(LocalDate.now())) {
|
||||
// salaryArchiveItem.setDeleteType(1);
|
||||
// // 删除未生效数据
|
||||
// salaryArchiveItemMapper.updateById(salaryArchiveItem);
|
||||
// }
|
||||
// return StringUtils.EMPTY;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 获取所有可被引用的薪资项目
|
||||
// *
|
||||
// * @param tenantKey
|
||||
// * @return
|
||||
// */
|
||||
// @Override
|
||||
// public List<SalaryItemPO> getCanAdjustSalaryItems(String tenantKey) {
|
||||
// return new LambdaQueryChainWrapper<>(salaryItemMapper)
|
||||
// .eq(SalaryItemPO::getDeleteType, 0)
|
||||
// .eq(SalaryItemPO::getTenantKey, tenantKey)
|
||||
// .eq(SalaryItemPO::getUseInEmployeeSalary, SalaryOnOffEnum.ON.getValue())
|
||||
// .list();
|
||||
// }
|
||||
//
|
||||
//
|
||||
//
|
||||
// @Override
|
||||
// public Page<SalaryItemAdjustRecordListDTO> salaryItemAdjustRecordListPage(Page<SalaryItemAdjustRecordListDTO> page, SalaryItemAdjustRecordQueryParam queryParam, List<Long> salaryItemIds, String tenantKey) {
|
||||
// salaryArchiveItemMapper.salaryItemAdjustRecordList(page, queryParam, salaryItemIds, tenantKey);
|
||||
// return page;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public List<SalaryItemAdjustRecordListDTO> salaryItemAdjustRecordList(SalaryItemAdjustRecordQueryParam queryParam, List<Long> salaryItemIds, String tenantKey) {
|
||||
// return salaryArchiveItemMapper.salaryItemAdjustRecordList(queryParam, salaryItemIds, tenantKey);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void exportAdjustRecordList(Map<String, Object> map, String username, String eteamsId, SalaryItemAdjustRecordQueryParam queryParam, Long currentEmployeeId, String currentTenantKey) {
|
||||
// List<ExcelSheetData> sheetList = new ArrayList<>();
|
||||
//
|
||||
// ExcelSheetData excelSheetData = new ExcelSheetData();
|
||||
// // 1.工作簿名称
|
||||
// String nameI18n = SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 100438, "薪资项目调整记录");
|
||||
// excelSheetData.setSheetName(nameI18n);
|
||||
// String[] header = {
|
||||
// SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 85429, "姓名"),
|
||||
// SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 86187, "员工状态"),
|
||||
// SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 86185, "部门"),
|
||||
// SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 84960, "薪资项目"),
|
||||
// SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 85433, "调整前"),
|
||||
// SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 85434, "调整后"),
|
||||
// SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 85431, "调整原因"),
|
||||
// SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 85904, "生效日期"),
|
||||
// SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 85435, "操作人"),
|
||||
// SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 85436, "操作时间"),
|
||||
// SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 84961, "备注")
|
||||
// };
|
||||
// // 2.表头
|
||||
// excelSheetData.setHeaders(Collections.singletonList(header));
|
||||
// // 获取所有可被引用的薪资项目
|
||||
// List<SalaryItemPO> salaryItemList = getCanAdjustSalaryItems(currentTenantKey);
|
||||
// List<Long> salaryItemIds = salaryItemList.stream().map(SalaryItemPO::getId).collect(Collectors.toList());
|
||||
// // 获取记录
|
||||
// List<SalaryItemAdjustRecordListDTO> list = salaryArchiveItemMapper.salaryItemAdjustRecordList(queryParam, salaryItemIds, currentTenantKey);
|
||||
// List<SalaryItemAdjustRecordListDTO> listAll = salaryArchiveItemMapper.salaryItemAdjustRecordList(SalaryItemAdjustRecordQueryParam.builder().build(), salaryItemIds, currentTenantKey);
|
||||
// // 人员信息赋值
|
||||
// list.forEach(m->{
|
||||
// if (!org.springframework.util.CollectionUtils.isEmpty(listAll)) {
|
||||
// listAll.removeIf(a-> a.getId().equals(m.getId()));
|
||||
// }
|
||||
// Optional<SalaryItemAdjustRecordListDTO> optional = listAll.stream().filter(f->f.getSalaryArchiveId().equals(m.getSalaryArchiveId()) && f.getSalaryItemId().equals(m.getSalaryItemId())).findFirst();
|
||||
// m.setAdjustBefore(optional.isPresent()?optional.get().getAdjustAfter():"");
|
||||
//
|
||||
// m.setEmployeeStatus(SalaryUserStatusEnum.getDefaultLabelByValue(m.getEmployeeStatus(), currentEmployeeId, currentTenantKey));
|
||||
// m.setAdjustReason(SalaryArchiveItemAdjustReasonEnum.getDefaultLabelByValue(m.getAdjustReason(), currentEmployeeId, currentTenantKey));
|
||||
// });
|
||||
// SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
// List<List<Object>> rows = new ArrayList<>();
|
||||
// for (SalaryItemAdjustRecordListDTO dto : list) {
|
||||
// List<Object> row = new ArrayList<>();
|
||||
// row.add(dto.getUsername());
|
||||
// row.add(dto.getEmployeeStatus());
|
||||
// row.add(dto.getDepartmentName());
|
||||
// row.add(dto.getAdjustItem());
|
||||
// row.add(dto.getAdjustBefore());
|
||||
// row.add(dto.getAdjustAfter());
|
||||
// row.add(dto.getAdjustReason());
|
||||
// row.add(dto.getEffectiveTime()+"");
|
||||
// row.add(dto.getOperator());
|
||||
// row.add(format.format(dto.getOperateTime()));
|
||||
// row.add(dto.getDescription());
|
||||
// rows.add(row);
|
||||
// }
|
||||
// // 3.表数据
|
||||
// excelSheetData.setRows(rows);
|
||||
//
|
||||
// sheetList.add(excelSheetData);
|
||||
//
|
||||
// salaryBatchService.simpleExportExcel(ExportExcelInfo.builder()
|
||||
// .bizId(map.get("biz").toString())
|
||||
// .flag(true)
|
||||
// .userId(currentEmployeeId)
|
||||
// .eteamsId(eteamsId)
|
||||
// .tenantKey(currentTenantKey)
|
||||
// .operator(username)
|
||||
// .module(map.get("module").toString())
|
||||
// .fileName(nameI18n + SalaryDateUtil.getFormatLocalDateTime(LocalDateTime.now()))
|
||||
// .handlerName(map.get("function").toString())
|
||||
// .dataType(nameI18n)
|
||||
// .function(map.get("function").toString()).build(), sheetList);
|
||||
// }
|
||||
//
|
||||
// @BatchExportHandler("exportSalaryArchiveItemAdjustRecord")
|
||||
// public void exportSalaryArchiveItemAdjustRecordHandler() {
|
||||
// BatchCallbackMessage message = BatchExportContext.getBatchCallbackMessage();
|
||||
// log.info("接受到薪资项目操作记录导出的结果:{}", JSONObject.toJSONString(message));
|
||||
// }
|
||||
//}
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,9 +1,12 @@
|
|||
package com.engine.salary.service.impl;
|
||||
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.biz.TaxAgentBiz;
|
||||
import com.engine.salary.cmd.TaxAgent.*;
|
||||
import com.engine.salary.entity.taxrate.TaxAgent;
|
||||
import com.engine.salary.service.TaxAgentService;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
|
||||
public class TaxAgentServiceImpl extends Service implements TaxAgentService {
|
||||
|
|
@ -37,4 +40,9 @@ public class TaxAgentServiceImpl extends Service implements TaxAgentService {
|
|||
public Map<String, Object> selectList(Map<String, Object> params) {
|
||||
return commandExecutor.execute(new TaxAgentSelectListCmd(params,user));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<TaxAgent> findAll() {
|
||||
return new TaxAgentBiz().listAll();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,26 @@
|
|||
package com.engine.salary.web;
|
||||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.salary.entity.salaryarchive.param.SalaryArchiveDimissionSaveParam;
|
||||
import com.engine.salary.entity.salaryarchive.param.SalaryArchiveQueryParam;
|
||||
import com.engine.salary.util.ResponseResult;
|
||||
import com.engine.salary.wrapper.SalaryArchiveWrapper;
|
||||
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
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.POST;
|
||||
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.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 薪资档案
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
|
|
@ -9,13 +30,17 @@ package com.engine.salary.web;
|
|||
* @version 1.0
|
||||
**/
|
||||
public class SalaryArchiveController {
|
||||
private SalaryArchiveWrapper getSalaryArchiveWrapper(User user) {
|
||||
return ServiceUtil.getService(SalaryArchiveWrapper.class, user);
|
||||
}
|
||||
//
|
||||
// @Autowired
|
||||
// private SalaryArchiveWrapper salaryArchiveWrapper;
|
||||
// @Autowired
|
||||
// private SalaryArchiveItemWrapper salaryArchiveItemWrapper;
|
||||
// @Autowired
|
||||
// private SalaryArchiveTaxAgentWrapper salaryArchiveTaxAgentWrapper;
|
||||
|
||||
|
||||
// /******** 薪资档案主表 start ***********************************************************************************************/
|
||||
// /**
|
||||
// * 薪资档案列表的高级搜索
|
||||
|
|
@ -28,20 +53,25 @@ public class SalaryArchiveController {
|
|||
// public WeaResult<WeaSearchCondition> getSearchCondition() {
|
||||
// return WeaResult.success(salaryArchiveWrapper.getSearchCondition(UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()));
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 薪资档案列表
|
||||
// *
|
||||
// * @param queryParam
|
||||
// * @return
|
||||
// */
|
||||
// @PostMapping("/list")
|
||||
// @ApiOperation("薪资档案列表")
|
||||
// @WeaPermission
|
||||
// public WeaResult<WeaTable<LinkedHashMap>> list(@RequestBody SalaryArchiveQueryParam queryParam) {
|
||||
// return WeaResult.success(salaryArchiveWrapper.list(queryParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()));
|
||||
// }
|
||||
//
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 薪资档案列表
|
||||
*
|
||||
* @param queryParam
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/list")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String list(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryArchiveQueryParam queryParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<SalaryArchiveQueryParam, Map<String, Object>>().run(getSalaryArchiveWrapper(user)::list, queryParam);
|
||||
}
|
||||
|
||||
|
||||
// /**
|
||||
// * 导出薪资档案
|
||||
// *
|
||||
|
|
@ -54,62 +84,65 @@ public class SalaryArchiveController {
|
|||
// public WeaResult<Map<String, Object>> exportList(@RequestBody SalaryArchiveQueryParam queryParam) throws Exception {
|
||||
// return WeaResult.success(salaryArchiveWrapper.exportList(queryParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()));
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 获取薪资档案详情表单
|
||||
// *
|
||||
// * @param salaryArchiveId
|
||||
// * @return
|
||||
// */
|
||||
// @GetMapping("/getForm")
|
||||
// @ApiOperation("获取薪资档案详情表单")
|
||||
// @WeaPermission
|
||||
// public WeaResult<SalaryArchiveFormDTO> getFrom(@RequestParam Long salaryArchiveId) {
|
||||
// return WeaResult.success(salaryArchiveWrapper.getFrom(salaryArchiveId, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()));
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 获取离职时段设置表单
|
||||
// *
|
||||
// * @return
|
||||
// */
|
||||
// @GetMapping("/getDimissionSetForm")
|
||||
// @ApiOperation("获取离职时段设置表单")
|
||||
// @WeaPermission
|
||||
// public WeaResult<WeaForm> getDimissionSetForm() {
|
||||
// return WeaResult.success(salaryArchiveWrapper.getDimissionSetForm(TenantContext.getCurrentTenantKey()));
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 保存离职时段设置
|
||||
// *
|
||||
// * @return
|
||||
// */
|
||||
// @PostMapping("/saveDimissionSet")
|
||||
// @ApiOperation("保存离职时段设置")
|
||||
// @WeaPermission
|
||||
// public WeaResult<String> saveDimissionSet(@RequestBody SalaryArchiveDimissionSaveParam saveParam) {
|
||||
// return WeaResult.success(salaryArchiveWrapper.saveDimissionSet(saveParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()));
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 获取导入类型
|
||||
// *
|
||||
// * @return
|
||||
// */
|
||||
// @GetMapping("/getImportTypes")
|
||||
// @ApiOperation("获取导入类型")
|
||||
// @WeaPermission(publicPermission = true)
|
||||
// public WeaResult<List<Map<String, Object>>> getImportTypes() {
|
||||
// List<Map<String, Object>> importTypes = Arrays.stream(SalaryArchiveImportTypeEnum.values()).map(m -> {
|
||||
// Map<String, Object> map = new HashMap<>(2);
|
||||
// map.put("id", String.valueOf(m.getValue()));
|
||||
// map.put("content", SalaryI18nUtil.getI18nLabel(TenantContext.getCurrentTenantKey(), UserContext.getCurrentEmployeeId(), m.getLabelId(), m.getDefaultLabel()));
|
||||
// return map;
|
||||
// }).collect(Collectors.toList());
|
||||
// return WeaResult.success(importTypes);
|
||||
// }
|
||||
//
|
||||
|
||||
/**
|
||||
* 获取薪资档案详情表单
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GET
|
||||
@Path("/getForm")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String getFrom(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
String salaryArchiveIdStr = request.getParameter("salaryArchiveId");
|
||||
Long salaryArchiveId = null;
|
||||
if (StringUtils.isNotBlank(salaryArchiveIdStr)) {
|
||||
salaryArchiveId = Long.valueOf(salaryArchiveIdStr);
|
||||
}
|
||||
return new ResponseResult<Long, Map<String, Object>>().run(getSalaryArchiveWrapper(user)::getFrom, salaryArchiveId);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取离职时段设置表单
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GET
|
||||
@Path("/getDimissionSetForm")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String getDimissionSetForm(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<Long, Map<String, Object>>().run(getSalaryArchiveWrapper(user)::getDimissionSetForm);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存离职时段设置
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/saveDimissionSet")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String saveDimissionSet(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryArchiveDimissionSaveParam saveParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<SalaryArchiveDimissionSaveParam, String>().run(getSalaryArchiveWrapper(user)::saveDimissionSet, saveParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取导入类型
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GET
|
||||
@Path("/getImportTypes")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String getImportTypes(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<Long, List<Map<String, Object>>>().run(getSalaryArchiveWrapper(user)::getImportTypes);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 下载导入模板
|
||||
// *
|
||||
|
|
|
|||
|
|
@ -1,5 +1,36 @@
|
|||
package com.engine.salary.wrapper;
|
||||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.biz.EmployBiz;
|
||||
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
||||
import com.engine.salary.entity.salaryarchive.dto.SalaryArchiveBaseInfoFormDTO;
|
||||
import com.engine.salary.entity.salaryarchive.dto.SalaryArchiveFormDTO;
|
||||
import com.engine.salary.entity.salaryarchive.dto.SalaryArchiveListDTO;
|
||||
import com.engine.salary.entity.salaryarchive.param.SalaryArchiveDimissionSaveParam;
|
||||
import com.engine.salary.entity.salaryarchive.param.SalaryArchiveQueryParam;
|
||||
import com.engine.salary.entity.salaryarchive.po.SalaryArchiveDimissionPO;
|
||||
import com.engine.salary.entity.salaryarchive.po.SalaryArchiveItemPO;
|
||||
import com.engine.salary.entity.salaryarchive.po.SalaryArchivePO;
|
||||
import com.engine.salary.entity.salaryarchive.po.SalaryArchiveTaxAgentPO;
|
||||
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
||||
import com.engine.salary.entity.taxrate.TaxAgent;
|
||||
import com.engine.salary.enums.salaryarchive.SalaryArchiveImportTypeEnum;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.service.SalaryArchiveItemService;
|
||||
import com.engine.salary.service.SalaryArchiveService;
|
||||
import com.engine.salary.service.TaxAgentService;
|
||||
import com.engine.salary.service.impl.SalaryArchiveServiceImpl;
|
||||
import com.engine.salary.util.SalaryDateUtil;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import com.google.common.collect.Lists;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 薪资档案
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
|
|
@ -8,248 +39,147 @@ package com.engine.salary.wrapper;
|
|||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
public class SalaryArchiveWrapper {
|
||||
// private SalaryArchiveService salaryArchiveService;
|
||||
// private SalaryArchiveItemService salaryArchiveItemService;
|
||||
// private HrmCommonEmployeeService employeeService;
|
||||
// private TaxAgentService taxAgentService;
|
||||
public class SalaryArchiveWrapper extends Service {
|
||||
|
||||
private SalaryArchiveService getSalaryArchiveService(User user) {
|
||||
return (SalaryArchiveService) ServiceUtil.getService(SalaryArchiveServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalaryArchiveService salaryArchiveService;
|
||||
private SalaryArchiveItemService salaryArchiveItemService;
|
||||
private EmployBiz employeeService = new EmployBiz();
|
||||
private TaxAgentService taxAgentService;
|
||||
// private SalaryBatchService salaryBatchService;
|
||||
// private ExecutorService taskExecutor;
|
||||
//
|
||||
// /**
|
||||
// * 薪资档案列表-高级搜索
|
||||
// *
|
||||
// * @param employeeId
|
||||
// * @param tenantKey
|
||||
// * @return
|
||||
// */
|
||||
// public WeaSearchCondition getSearchCondition(Long employeeId, String tenantKey) {
|
||||
// List<WeaSearchConditionOption> taxAgentList = new ArrayList<>();
|
||||
// // 获取所有个税扣缴义务人
|
||||
// Collection<TaxAgentListDTO> taxAgentLists = taxAgentService.findAll(tenantKey);
|
||||
// taxAgentLists.forEach(e-> taxAgentList.add(new WeaSearchConditionOption(e.getId().toString(), e.getName())));
|
||||
//
|
||||
// WeaSearchCondition weaSearchCondition = SalaryFormatUtil.<SalaryArchiveSearchConditionDTO>getInstance()
|
||||
// .buildCondition(SalaryArchiveSearchConditionDTO.class,
|
||||
// SalaryArchiveSearchConditionDTO.builder().taxAgentOptions(taxAgentList).build(),
|
||||
// "salaryArchive");
|
||||
// // 入职日期-添加范围
|
||||
// SalaryArchiveBO.addDatePickerRangeOtherParams(weaSearchCondition, "hiredate", employeeId, tenantKey);
|
||||
// // 只保留常用条件
|
||||
// weaSearchCondition.setGroups(weaSearchCondition.getGroups().stream().filter(e-> "commonGroup".equals(e.getId())).collect(Collectors.toList()));
|
||||
//
|
||||
// return weaSearchCondition;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 薪资档案列表(分页)
|
||||
// *
|
||||
// * @param queryParam
|
||||
// * @param employeeId
|
||||
// * @param tenantKey
|
||||
// * @return
|
||||
// */
|
||||
// public WeaTable<LinkedHashMap> list(SalaryArchiveQueryParam queryParam, Long employeeId, String tenantKey) {
|
||||
// Collection<TaxAgentListDTO> taxAgentLists = taxAgentService.findAll(tenantKey);
|
||||
//
|
||||
// Page<SalaryArchiveListDTO> page = new Page<>(queryParam.getCurrent(), queryParam.getPageSize(), true);
|
||||
// page = salaryArchiveService.listPage(page, queryParam, tenantKey);
|
||||
//
|
||||
// Collection<SalaryArchiveListDTO> salaryArchives = page.getRecords();
|
||||
// // 获取所有可被引用的薪资项目
|
||||
// List<SalaryItemPO> salaryItems = salaryArchiveItemService.getCanAdjustSalaryItems(tenantKey);
|
||||
// List<Map<String, Object>> listMaps = salaryArchiveService.buildSalaryArchiveData(salaryArchives, taxAgentLists, salaryItems, employeeId, tenantKey, Boolean.TRUE);
|
||||
//
|
||||
// Page<Map<String, Object>> listPage = new Page<>(page.getCurrent(), page.getSize(), page.getTotal(), page.isSearchCount());
|
||||
// listPage.setRecords(listMaps);
|
||||
//
|
||||
// WeaTable<LinkedHashMap> weaTable = FormatManager.<LinkedHashMap>getInstance()
|
||||
// .genTable(LinkedHashMap.class, listPage);
|
||||
// weaTable.setPageUid("salaryArchive");
|
||||
// weaTable.setModule("hrmsalary");
|
||||
// //动态列组装
|
||||
// SalaryArchiveBO.buildSalaryArchiveTable(weaTable, salaryItems, employeeId, tenantKey, listMaps.size());
|
||||
// // 在外展示操作按钮
|
||||
// weaTable.getOperates().get(0).setOuter(Boolean.TRUE);
|
||||
// return weaTable;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 获取薪资档案详情表单
|
||||
// *
|
||||
// * @param salaryArchiveId
|
||||
// * @param employeeId
|
||||
// * @param tenantKey
|
||||
// * @return
|
||||
// */
|
||||
// public SalaryArchiveFormDTO getFrom(Long salaryArchiveId, Long employeeId, String tenantKey) {
|
||||
// if (salaryArchiveId == null) {
|
||||
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 100425, "薪资档案id不能为空"));
|
||||
// }
|
||||
// SalaryArchivePO po = salaryArchiveService.getById(salaryArchiveId, tenantKey);
|
||||
// if (po == null) {
|
||||
// throw new SalaryRunTimeException(String.format(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 100463, "薪资档案不存在")+"[id:%s]", salaryArchiveId));
|
||||
// }
|
||||
//
|
||||
// List<SimpleEmployee> employeeList = employeeService.getEmployeeByIds(Collections.singletonList(po.getEmployeeId()), tenantKey);
|
||||
// if (CollectionUtils.isEmpty(employeeList)) {
|
||||
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 100465, "薪资档案员工信息不存在"));
|
||||
// }
|
||||
//
|
||||
// // 获取当前已生效个税扣缴义务人
|
||||
// List<SalaryArchiveTaxAgentPO> taxAgentList = salaryArchiveService.getCurrentEffectiveTaxAgentList(Collections.singletonList(salaryArchiveId), tenantKey);
|
||||
// // 获取所有个税扣缴义务人
|
||||
// Collection<TaxAgentListDTO> taxAgentLists = taxAgentService.findAll(tenantKey);
|
||||
// String taxAgent = "";
|
||||
// if (CollectionUtils.isNotEmpty(taxAgentList)) {
|
||||
// SalaryArchiveTaxAgentPO salaryArchiveTaxAgent = taxAgentList.get(0);
|
||||
// Optional<TaxAgentListDTO> taxAgentOptional = taxAgentLists.stream().filter(f->f.getId().equals(salaryArchiveTaxAgent.getTaxAgentId())).findFirst();
|
||||
// taxAgent = taxAgentOptional.isPresent()?taxAgentOptional.get().getName():taxAgent;
|
||||
// }
|
||||
//
|
||||
// // 1.基本信息表单
|
||||
// SimpleEmployee employee = employeeList.get(0);
|
||||
// WeaForm salaryArchiveBaseInfoForm = SalaryFormatUtil.<SalaryArchiveBaseInfoFormDTO>getInstance().buildForm(SalaryArchiveBaseInfoFormDTO.class,
|
||||
// SalaryArchiveBaseInfoFormDTO.builder()
|
||||
// .username(employee.getUsername())
|
||||
// .department(employee.getDepartment().getName())
|
||||
// .position(employee.getPosition()==null?"":employee.getPosition().getName())
|
||||
// .hiredate(SalaryDateUtil.getFormatLocalDate(employee.getHiredate()))
|
||||
// .mobile(employee.getMobile())
|
||||
// .taxAgent(taxAgent)
|
||||
// .build());
|
||||
//
|
||||
// List<Map<String, Object>> salaryItems = Lists.newArrayList();
|
||||
// // 获取所有可被引用的薪资项目
|
||||
// List<SalaryItemPO> salaryItemList = salaryArchiveItemService.getCanAdjustSalaryItems(tenantKey);
|
||||
// Collection<Long> salaryItemIds = salaryItemList.stream().map(SalaryItemPO::getId).collect(Collectors.toList());
|
||||
// List<SalaryArchiveItemPO> salaryArchiveItemList = salaryArchiveService.getCurrentEffectiveItemList(Collections.singletonList(salaryArchiveId), salaryItemIds, tenantKey);
|
||||
// salaryArchiveItemList.forEach(m->{
|
||||
// Optional<SalaryItemPO> optionalItem = salaryItemList.stream().filter(f->f.getId().equals(m.getSalaryItemId())).findFirst();
|
||||
// if (optionalItem.isPresent()) {
|
||||
// Map<String, Object> salaryItemMap = new LinkedHashMap<>();
|
||||
// salaryItemMap.put("id", m.getId());
|
||||
// salaryItemMap.put("name", optionalItem.get().getName());
|
||||
// salaryItemMap.put("value", m.getItemValue());
|
||||
// salaryItems.add(salaryItemMap);
|
||||
// }
|
||||
// });
|
||||
//
|
||||
// // 2.薪资档案表单
|
||||
// WeaForm salaryItemFrom = buildSalaryItemForm(salaryItems);
|
||||
//
|
||||
// // 3.调整记录的高级搜索
|
||||
// // 3.1 薪资项目
|
||||
// WeaSearchCondition salaryItemAdjustRecordSearchCondition = buildSalaryItemAdjustRecordSearchCondition(employeeId, tenantKey);
|
||||
//
|
||||
// return SalaryArchiveFormDTO.builder()
|
||||
// .id(salaryArchiveId)
|
||||
// .employeeId(employee.getId())
|
||||
// .baseInfo(salaryArchiveBaseInfoForm)
|
||||
// .adjustSalaryItems(salaryItemFrom)
|
||||
// .salaryItemAdjustRecordSearchCondition(salaryItemAdjustRecordSearchCondition)
|
||||
// .build();
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 薪资调整记录的高级搜索
|
||||
// *
|
||||
// * @param employeeId
|
||||
// * @param tenantKey
|
||||
// * @return
|
||||
// */
|
||||
// private WeaSearchCondition buildSalaryItemAdjustRecordSearchCondition(Long employeeId, String tenantKey) {
|
||||
// WeaSearchCondition weaSearchCondition = SalaryFormatUtil.<SalaryItemAdjustRecordForFromSearchConditionDTO>getInstance()
|
||||
// .buildCondition(SalaryItemAdjustRecordForFromSearchConditionDTO.class,
|
||||
// SalaryItemAdjustRecordForFromSearchConditionDTO.builder().build(),
|
||||
// "salaryItemAdjustRecordForFromSearchCondition");
|
||||
// // 生效日期-添加范围
|
||||
// SalaryArchiveBO.addDatePickerRangeOtherParams(weaSearchCondition, "effectiveTime", employeeId, tenantKey);
|
||||
// // 操作日期-添加范围
|
||||
// SalaryArchiveBO.addDatePickerRangeOtherParams(weaSearchCondition, "operateTime", employeeId, tenantKey);
|
||||
//
|
||||
// // 只保留常用条件
|
||||
// weaSearchCondition.setGroups(weaSearchCondition.getGroups().stream().filter(e-> "commonGroup".equals(e.getId())).collect(Collectors.toList()));
|
||||
//
|
||||
// return weaSearchCondition;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 薪资档案-薪资档案表单
|
||||
// *
|
||||
// * @param salaryItems
|
||||
// * @return
|
||||
// */
|
||||
// private WeaForm buildSalaryItemForm(List<Map<String, Object>> salaryItems) {
|
||||
// // 构建表单
|
||||
// WeaForm salaryItemForm = new WeaForm();
|
||||
//
|
||||
// // 控件项目
|
||||
// Map<String, WeaFormItem> items = salaryItemForm.getItems();
|
||||
// // 控件布局
|
||||
// List<List<WeaFormLayout>> layout = salaryItemForm.getLayout();
|
||||
// // 控件数据
|
||||
// Map<String, Object> data = salaryItemForm.getData();
|
||||
//
|
||||
// List<WeaFormLayout> layoutSingles = Lists.newArrayList();
|
||||
// int i=0;
|
||||
// while (i<salaryItems.size()) {
|
||||
// WeaFormItem salaryItemItem = new WeaFormItem(WeaFormItemType.INPUT);
|
||||
// salaryItemItem.setReadOnly(Boolean.TRUE);
|
||||
// // 表单项
|
||||
// items.put(String.valueOf(salaryItems.get(i).get("id").toString()), salaryItemItem);
|
||||
// // 表单项布局
|
||||
// layoutSingles.add(new WeaFormLayout(String.valueOf(i/2), salaryItems.get(i).get("name").toString(), new String[]{salaryItems.get(i).get("id").toString()}));
|
||||
// // 如果是奇数并且最后一行加空白单元格
|
||||
// if (layoutSingles.size() % 2 != 0 && i == salaryItems.size()-1) {
|
||||
// layoutSingles.add(new WeaFormLayout(String.valueOf(i/2), "", new String[]{""}));
|
||||
// }
|
||||
// // 表单项数据
|
||||
// data.put(String.valueOf(salaryItems.get(i).get("id").toString()), salaryItems.get(i).get("value").toString());
|
||||
// i++;
|
||||
// }
|
||||
// // 栅格布局换行处理
|
||||
// int j=0;
|
||||
// while (j<=salaryItems.size()/2) {
|
||||
// int finalI = j;
|
||||
// if (CollectionUtils.isNotEmpty(layoutSingles)) {
|
||||
// layout.add(layoutSingles.stream().filter(f->f.getId().equals(String.valueOf(finalI))).collect(Collectors.toList()));
|
||||
// }
|
||||
// j++;
|
||||
// }
|
||||
//
|
||||
// return salaryItemForm;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 获取离职时段设置表单
|
||||
// *
|
||||
// * @param tenantKey
|
||||
// * @return
|
||||
// */
|
||||
// public WeaForm getDimissionSetForm(String tenantKey) {
|
||||
// WeaForm salaryTemplateBase = SalaryFormatUtil.<DimissionSetFormDTO>getInstance().buildForm(DimissionSetFormDTO.class, DimissionSetFormDTO.builder().build());
|
||||
// List<SalaryArchiveDimissionPO> dimissionSets = salaryArchiveService.dimissionSets(tenantKey);
|
||||
// Map<String, Object> data = new LinkedHashMap<>();
|
||||
// if (CollectionUtils.isNotEmpty(dimissionSets)) {
|
||||
// data.put("dimissionTimeInterval", dimissionSets.get(0).getDimissionTimeInterval());
|
||||
// }
|
||||
// salaryTemplateBase.setData(data);
|
||||
// return salaryTemplateBase;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 保存离职时段设置
|
||||
// *
|
||||
// * @param saveParam
|
||||
// * @param employeeId
|
||||
// * @param tenantKey
|
||||
// * @return
|
||||
// */
|
||||
// public String saveDimissionSet(SalaryArchiveDimissionSaveParam saveParam, Long employeeId, String tenantKey) {
|
||||
// return salaryArchiveService.saveDimissionSet(saveParam, employeeId, tenantKey);
|
||||
// }
|
||||
//
|
||||
|
||||
|
||||
/**
|
||||
* 薪资档案列表(分页)
|
||||
*
|
||||
* @param queryParam
|
||||
* @return
|
||||
*/
|
||||
public PageInfo<Map<String, Object>> list(SalaryArchiveQueryParam queryParam) {
|
||||
Collection<TaxAgent> taxAgentLists = taxAgentService.findAll();
|
||||
|
||||
PageInfo<SalaryArchiveListDTO> pageInfo = salaryArchiveService.listPage(queryParam);
|
||||
|
||||
Collection<SalaryArchiveListDTO> salaryArchives = pageInfo.getList();
|
||||
// 获取所有可被引用的薪资项目
|
||||
List<SalaryItemPO> salaryItems = salaryArchiveItemService.getCanAdjustSalaryItems();
|
||||
List<Map<String, Object>> listMaps = salaryArchiveService.buildSalaryArchiveData(salaryArchives, taxAgentLists, salaryItems, Boolean.TRUE);
|
||||
|
||||
PageInfo<Map<String, Object>> pageInfos = new PageInfo<Map<String, Object>>(listMaps);
|
||||
pageInfos.setTotal(listMaps.size());
|
||||
pageInfos.setPageNum(queryParam.getCurrent());
|
||||
pageInfos.setPageSize(queryParam.getPageSize());
|
||||
|
||||
return pageInfos;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取薪资档案详情表单
|
||||
*
|
||||
* @param salaryArchiveId
|
||||
* @return
|
||||
*/
|
||||
public SalaryArchiveFormDTO getFrom(Long salaryArchiveId) {
|
||||
if (salaryArchiveId == null) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100425, "薪资档案id不能为空"));
|
||||
}
|
||||
SalaryArchivePO po = salaryArchiveService.getById(salaryArchiveId);
|
||||
if (po == null) {
|
||||
throw new SalaryRunTimeException(String.format(SalaryI18nUtil.getI18nLabel(100463, "薪资档案不存在") + "[id:%s]", salaryArchiveId));
|
||||
}
|
||||
|
||||
List<DataCollectionEmployee> employeeList = employeeService.getEmployeeByIdsAll(Collections.singletonList(po.getEmployeeId()));
|
||||
if (CollectionUtils.isEmpty(employeeList)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100465, "薪资档案员工信息不存在"));
|
||||
}
|
||||
|
||||
// 获取当前已生效个税扣缴义务人
|
||||
List<SalaryArchiveTaxAgentPO> taxAgentList = salaryArchiveService.getCurrentEffectiveTaxAgentList(Collections.singletonList(salaryArchiveId));
|
||||
// 获取所有个税扣缴义务人
|
||||
Collection<TaxAgent> taxAgentLists = taxAgentService.findAll();
|
||||
String taxAgent = "";
|
||||
if (CollectionUtils.isNotEmpty(taxAgentList)) {
|
||||
SalaryArchiveTaxAgentPO salaryArchiveTaxAgent = taxAgentList.get(0);
|
||||
Optional<TaxAgent> taxAgentOptional = taxAgentLists.stream().filter(f -> f.getId().equals(salaryArchiveTaxAgent.getTaxAgentId())).findFirst();
|
||||
taxAgent = taxAgentOptional.isPresent() ? taxAgentOptional.get().getName() : taxAgent;
|
||||
}
|
||||
|
||||
// 1.基本信息表单
|
||||
Map<String, Object> baseInfo = new HashMap<>();
|
||||
DataCollectionEmployee employee = employeeList.get(0);
|
||||
SalaryArchiveBaseInfoFormDTO build = SalaryArchiveBaseInfoFormDTO.builder()
|
||||
.username(employee.getUsername())
|
||||
.department(employee.getDepartmentName())
|
||||
.position(employee.getJobtitleName() == null ? "" : employee.getJobtitleName())
|
||||
.hiredate(SalaryDateUtil.getFormatLocalDate(employee.getCompanystartdate()))
|
||||
.mobile(employee.getMobile())
|
||||
.taxAgent(taxAgent)
|
||||
.build();
|
||||
baseInfo.put("employee", build);
|
||||
|
||||
List<Map<String, Object>> salaryItems = Lists.newArrayList();
|
||||
// 获取所有可被引用的薪资项目
|
||||
List<SalaryItemPO> salaryItemList = salaryArchiveItemService.getCanAdjustSalaryItems();
|
||||
Collection<Long> salaryItemIds = salaryItemList.stream().map(SalaryItemPO::getId).collect(Collectors.toList());
|
||||
List<SalaryArchiveItemPO> salaryArchiveItemList = salaryArchiveService.getCurrentEffectiveItemList(Collections.singletonList(salaryArchiveId), salaryItemIds);
|
||||
salaryArchiveItemList.forEach(m -> {
|
||||
Optional<SalaryItemPO> optionalItem = salaryItemList.stream().filter(f -> f.getId().equals(m.getSalaryItemId())).findFirst();
|
||||
if (optionalItem.isPresent()) {
|
||||
Map<String, Object> salaryItemMap = new LinkedHashMap<>();
|
||||
salaryItemMap.put("id", m.getId());
|
||||
salaryItemMap.put("name", optionalItem.get().getName());
|
||||
salaryItemMap.put("value", m.getItemValue());
|
||||
salaryItems.add(salaryItemMap);
|
||||
}
|
||||
});
|
||||
|
||||
return SalaryArchiveFormDTO.builder()
|
||||
.id(salaryArchiveId)
|
||||
.employeeId(employee.getEmployeeId())
|
||||
.baseInfo(baseInfo)
|
||||
.adjustSalaryItems(salaryItems)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取离职时段设置表单
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Map<String, Object> getDimissionSetForm() {
|
||||
List<SalaryArchiveDimissionPO> dimissionSets = salaryArchiveService.dimissionSets();
|
||||
Map<String, Object> data = new LinkedHashMap<>();
|
||||
if (CollectionUtils.isNotEmpty(dimissionSets)) {
|
||||
data.put("dimissionTimeInterval", dimissionSets.get(0).getDimissionTimeInterval());
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存离职时段设置
|
||||
*
|
||||
* @param saveParam
|
||||
* @return
|
||||
*/
|
||||
public String saveDimissionSet(SalaryArchiveDimissionSaveParam saveParam) {
|
||||
return salaryArchiveService.saveDimissionSet(saveParam);
|
||||
}
|
||||
|
||||
public List<Map<String, Object>> getImportTypes() {
|
||||
List<Map<String, Object>> importTypes = Arrays.stream(SalaryArchiveImportTypeEnum.values()).map(m -> {
|
||||
Map<String, Object> map = new HashMap<>(2);
|
||||
map.put("id", String.valueOf(m.getValue()));
|
||||
map.put("content", SalaryI18nUtil.getI18nLabel( m.getLabelId(), m.getDefaultLabel()));
|
||||
return map;
|
||||
}).collect(Collectors.toList());
|
||||
return importTypes;
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 导出薪资档案
|
||||
// *
|
||||
|
|
|
|||
Loading…
Reference in New Issue