Merge branch 'feature/240801-浮动薪资' into custom/京贵投资
This commit is contained in:
commit
71f10872bd
|
|
@ -0,0 +1,3 @@
|
|||
alter table hrsa_variable_archive add tax_agent_id NUMBER(38,0);
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
alter table hrsa_variable_archive add tax_agent_id NUMBER(38,0);
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
alter table hrsa_variable_archive add tax_agent_id NUMBER(38,0);
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1 @@
|
|||
alter table hrsa_variable_archive add tax_agent_id bigint;
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
alter table hrsa_variable_archive add tax_agent_id NUMBER(38,0)
|
||||
/
|
||||
|
|
@ -0,0 +1 @@
|
|||
alter table hrsa_variable_archive add tax_agent_id bigint;
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
alter table hrsa_variable_archive add tax_agent_id bigint
|
||||
GO
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
alter table hrsa_variable_archive add tax_agent_id NUMBER(38,0);
|
||||
/
|
||||
|
||||
|
|
@ -37,6 +37,7 @@ public class VariableArchiveBO {
|
|||
WeaTableColumn employeeIdColumn = new WeaTableColumn("100px", "人员信息表的主键id", "employeeId");
|
||||
employeeIdColumn.setDisplay(WeaBoolAttr.FALSE);
|
||||
columns.add(employeeIdColumn);
|
||||
columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(85429, "个税扣缴义务人"), "taxAgentName"));
|
||||
columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(85429, "姓名"), "username"));
|
||||
columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(86185, "部门"), "departmentName"));
|
||||
columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(86186, "手机号"), "mobile"));
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import com.engine.salary.entity.datacollection.param.VariableArchiveImportHandle
|
|||
import com.engine.salary.entity.datacollection.po.VariableArchiveItemPO;
|
||||
import com.engine.salary.entity.datacollection.po.VariableArchivePO;
|
||||
import com.engine.salary.entity.datacollection.po.VariableItemPO;
|
||||
import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeEmployeeDTO;
|
||||
import com.engine.salary.enums.UserStatusEnum;
|
||||
import com.engine.salary.enums.salaryarchive.SalaryArchiveFieldTypeEnum;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
|
|
@ -174,20 +175,35 @@ public class VariableArchiveExcelBO extends Service {
|
|||
return isError;
|
||||
}
|
||||
|
||||
// 个税扣缴义务人
|
||||
String taxAgentCellVal = Optional.ofNullable(map.get(taxAgentI18n)).orElse("").toString();
|
||||
map.put("taxAgent", taxAgentCellVal);
|
||||
Optional<TaxAgentManageRangeEmployeeDTO> optionalTaxAgent = importHandleParam.getTaxAgentList().stream().filter(m -> m.getTaxAgentName().equals(taxAgentCellVal)).findFirst();
|
||||
if (!optionalTaxAgent.isPresent()) {
|
||||
Map<String, String> errorMessageMap = Maps.newHashMap();
|
||||
errorMessageMap.put("message", rowindex + "个税扣缴义务人不存在,或不在权限范围内");
|
||||
excelComments.add(errorMessageMap);
|
||||
isError = true;
|
||||
return isError;
|
||||
}
|
||||
Long taxAgentId = optionalTaxAgent.get().getTaxAgentId();
|
||||
map.put("taxAgentId", taxAgentId);
|
||||
|
||||
// 用于初始化导入数据校验
|
||||
map.put("employeeId", employeeId);
|
||||
if (allTodoVariableArchives.contains(employeeId.toString())) {
|
||||
String repeatKey = optionalTaxAgent.get().getTaxAgentId() + "-" + employeeId.toString();
|
||||
if (allTodoVariableArchives.contains(repeatKey)) {
|
||||
Map<String, String> errorMessageMap = Maps.newHashMap();
|
||||
errorMessageMap.put("message", rowindex + "存在重复数据");
|
||||
excelComments.add(errorMessageMap);
|
||||
isError = true;
|
||||
return isError;
|
||||
} else {
|
||||
allTodoVariableArchives.add(employeeId.toString());
|
||||
allTodoVariableArchives.add(repeatKey);
|
||||
}
|
||||
|
||||
// 构建薪资档案
|
||||
VariableArchivePO finalVariableArchive = buildVariableArchive(employeeId, importHandleParam);
|
||||
VariableArchivePO finalVariableArchive = buildVariableArchive(employeeId, taxAgentId, importHandleParam);
|
||||
map.put("variableArchiveId", finalVariableArchive.getId());
|
||||
List<Long> needDelArchiveItemIds = new ArrayList<>();
|
||||
for (int j = 0; j < headers.size(); j++) {
|
||||
|
|
@ -267,16 +283,18 @@ public class VariableArchiveExcelBO extends Service {
|
|||
* 构建浮动薪资档案对象
|
||||
*
|
||||
* @param employeeId
|
||||
* @param taxAgentId
|
||||
* @param importHandleParam
|
||||
* @return
|
||||
*/
|
||||
public static VariableArchivePO buildVariableArchive(Long employeeId, VariableArchiveImportHandleParam importHandleParam) {
|
||||
VariableArchivePO variableArchivePO = importHandleParam.getVariableArchivesMap().get(employeeId);
|
||||
public static VariableArchivePO buildVariableArchive(Long employeeId, Long taxAgentId, VariableArchiveImportHandleParam importHandleParam) {
|
||||
VariableArchivePO variableArchivePO = importHandleParam.getVariableArchivesMap().get(taxAgentId + "-" + employeeId);
|
||||
if (variableArchivePO == null) {
|
||||
// 新增浮动档案
|
||||
variableArchivePO = VariableArchivePO.builder()
|
||||
.id(IdGenerator.generate())
|
||||
.employeeId(employeeId)
|
||||
.taxAgentId(taxAgentId)
|
||||
.salaryMonth(importHandleParam.getSalaryMonthDate())
|
||||
.createTime(importHandleParam.getNowTime())
|
||||
.updateTime(importHandleParam.getNowTime())
|
||||
|
|
|
|||
|
|
@ -34,6 +34,18 @@ public class VariableArchiveListDTO {
|
|||
|
||||
private Date salaryMonth;
|
||||
|
||||
/**
|
||||
* 个税扣缴义务人
|
||||
*/
|
||||
@TableTitle(title = "个税扣缴义务人", dataIndex = "taxAgentName", key = "taxAgentName")
|
||||
@I18n
|
||||
private String taxAgentName;
|
||||
|
||||
/**
|
||||
* 个税扣缴义务人id
|
||||
*/
|
||||
private String taxAgentId;
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
|||
import com.engine.salary.entity.datacollection.po.VariableArchiveItemPO;
|
||||
import com.engine.salary.entity.datacollection.po.VariableArchivePO;
|
||||
import com.engine.salary.entity.datacollection.po.VariableItemPO;
|
||||
import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeEmployeeDTO;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
|
@ -59,7 +60,7 @@ public class VariableArchiveImportHandleParam {
|
|||
/**
|
||||
* 查询已有的浮动薪资档案基本数据
|
||||
*/
|
||||
Map<Long, VariableArchivePO> variableArchivesMap;
|
||||
Map<String, VariableArchivePO> variableArchivesMap;
|
||||
|
||||
/**
|
||||
* 浮动薪资项目id
|
||||
|
|
@ -71,6 +72,11 @@ public class VariableArchiveImportHandleParam {
|
|||
*/
|
||||
Map<String, List<VariableArchiveItemPO>> effectiveItemListMap;
|
||||
|
||||
/**
|
||||
* 获取所有个税扣缴义务人
|
||||
*/
|
||||
Collection<TaxAgentManageRangeEmployeeDTO> taxAgentList;
|
||||
|
||||
/**
|
||||
* 当前时间
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -25,6 +25,9 @@ public class VariableArchiveQueryParam extends BaseQueryParam {
|
|||
// 主键id
|
||||
private Long id;
|
||||
|
||||
// 个税扣缴义务人
|
||||
private List<Long> taxAgentIds;
|
||||
|
||||
// 薪资年月
|
||||
@DataCheck(require = true,message = "薪资所属月不能为空")
|
||||
private String salaryMonth;
|
||||
|
|
|
|||
|
|
@ -25,6 +25,9 @@ public class VariableArchiveSaveParam {
|
|||
@DataCheck(require = true,message = "薪资所属月不能为空")
|
||||
private String salaryMonth;
|
||||
|
||||
@DataCheck(require = true,message = "义务人id不能为空")
|
||||
private Long taxAgentIds;
|
||||
|
||||
private Date salaryMonthDate;
|
||||
|
||||
// 人员id
|
||||
|
|
|
|||
|
|
@ -28,6 +28,8 @@ public class VariableArchivePO {
|
|||
*/
|
||||
private Long employeeId;
|
||||
|
||||
private Long taxAgentId;
|
||||
|
||||
/**
|
||||
* 薪资月份
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -253,27 +253,23 @@ public class CalculateFormulaVarBO {
|
|||
}
|
||||
|
||||
private void handleVariableArchiveData(SalaryAcctCalculateBO salaryAcctCalculateBO, Map<String, List<FormulaVarValue>> resultMap) {
|
||||
// 浮动薪资可选字段
|
||||
Map<Long, List<FormulaVarValue>> tempMap = Maps.newHashMapWithExpectedSize(variableArchiveList.size());
|
||||
variableArchiveList.forEach(map -> {
|
||||
Long key = Long.valueOf(map.get("employeeId").toString());
|
||||
List<FormulaVarValue> formulaVarValues = tempMap.computeIfAbsent(key, k -> Lists.newArrayList());
|
||||
Map<String, Map<String, Object>> variableArchiveMap = SalaryEntityUtil.convert2Map(variableArchiveList, map -> map.getOrDefault("taxAgentIds", "").toString() + "-" + map.getOrDefault("employeeId", "").toString());
|
||||
// 填充到返回结果集中
|
||||
for (SalaryAcctEmployeePO salaryAcctEmployeePO : salaryAcctCalculateBO.getSalaryAcctEmployeePOS()) {
|
||||
List<FormulaVarValue> formulaVarValues = resultMap.computeIfAbsent(salaryAcctEmployeePO.getEmployeeId() + "_" + salaryAcctEmployeePO.getTaxAgentId(),
|
||||
k -> Lists.newArrayList());
|
||||
|
||||
String key = salaryAcctEmployeePO.getTaxAgentId().toString() + "-" + salaryAcctEmployeePO.getEmployeeId().toString();
|
||||
Map<String, Object> map = variableArchiveMap.getOrDefault(key, Collections.emptyMap());
|
||||
formulaVarValues.addAll(salaryAcctCalculateBO.getVariableItems().stream().map(field -> {
|
||||
String fieldId = SalaryFormulaReferenceEnum.VARIABLE_ITEM.getValue()
|
||||
+ SalaryFormulaFieldConstant.FIELD_ID_SEPARATOR
|
||||
+ field.getCode();
|
||||
|
||||
|
||||
String value = map.getOrDefault(field.getId() + SalaryItemConstant.VARIABLE_ITEM_DYNAMIC_SUFFIX, StringUtils.EMPTY) == null ? StringUtils.EMPTY
|
||||
: map.getOrDefault(field.getId() + SalaryItemConstant.VARIABLE_ITEM_DYNAMIC_SUFFIX, StringUtils.EMPTY).toString();
|
||||
return new FormulaVarValue().setFieldId(fieldId).setFieldValue(value);
|
||||
}).collect(Collectors.toList()));
|
||||
});
|
||||
// 填充到返回结果集中
|
||||
for (SalaryAcctEmployeePO salaryAcctEmployeePO : salaryAcctCalculateBO.getSalaryAcctEmployeePOS()) {
|
||||
List<FormulaVarValue> formulaVarValues = resultMap.computeIfAbsent(salaryAcctEmployeePO.getEmployeeId() + "_" + salaryAcctEmployeePO.getTaxAgentId(),
|
||||
k -> Lists.newArrayList());
|
||||
formulaVarValues.addAll(tempMap.getOrDefault(salaryAcctEmployeePO.getEmployeeId(), Collections.emptyList()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
<sql id="baseColumns">
|
||||
t.id
|
||||
, t.employee_id
|
||||
, t.tax_agent_id
|
||||
, t.salary_month
|
||||
, t.create_time
|
||||
, t.update_time
|
||||
|
|
@ -52,6 +53,9 @@
|
|||
<if test="employeeId != null">
|
||||
AND employee_id = #{employeeId}
|
||||
</if>
|
||||
<if test="taxAgentId != null">
|
||||
AND tax_agent_id = #{taxAgentId}
|
||||
</if>
|
||||
<if test="salaryMonth != null">
|
||||
AND salary_month = #{salaryMonth}
|
||||
</if>
|
||||
|
|
@ -83,6 +87,7 @@
|
|||
<sql id="variableArchiveColumn">
|
||||
t.id
|
||||
, t.employee_id
|
||||
, t.tax_agent_id
|
||||
, t.salary_month
|
||||
, t.create_time
|
||||
, t.update_time
|
||||
|
|
@ -97,6 +102,8 @@
|
|||
, e.enddate as dismissdate
|
||||
, d.departmentname AS departmentName
|
||||
, c.subcompanyname AS subcompanyName
|
||||
, a.name AS taxAgentName
|
||||
, a.id AS taxAgentId
|
||||
</sql>
|
||||
|
||||
<select id="list" resultType="com.engine.salary.entity.datacollection.dto.VariableArchiveListDTO">
|
||||
|
|
@ -106,13 +113,24 @@
|
|||
LEFT JOIN hrmresource e ON e.id = t.employee_id
|
||||
LEFT JOIN hrmdepartment d ON d.id = e.departmentid
|
||||
LEFT JOIN hrmsubcompany c ON c.id = e.subcompanyid1
|
||||
WHERE delete_type = 0
|
||||
LEFT JOIN hrsa_tax_agent a ON t.tax_agent_id = a.id
|
||||
WHERE t.delete_type = 0
|
||||
and e.status not in (7)
|
||||
and (e.accounttype is null or e.accounttype = 0)
|
||||
<!-- 个税扣缴义务人 -->
|
||||
<if test="param.taxAgentIds != null and param.taxAgentIds.size()>0">
|
||||
AND t.tax_agent_id IN
|
||||
<foreach collection="param.taxAgentIds" open="(" item="taxAgentId" separator="," close=")">
|
||||
#{taxAgentId}
|
||||
</foreach>
|
||||
</if>
|
||||
<!-- 薪资所属月 -->
|
||||
<if test="param.salaryMonth != null">
|
||||
AND t.salary_month = #{param.salaryMonthDate}
|
||||
</if>
|
||||
<if test="param.id != null">
|
||||
AND t.id = #{param.id}
|
||||
</if>
|
||||
<if test="param.ids != null and param.ids.size()>0">
|
||||
AND t.id IN
|
||||
<foreach collection="param.ids" open="(" item="id" separator="," close=")">
|
||||
|
|
@ -152,13 +170,24 @@
|
|||
LEFT JOIN hrmresource e ON e.id = t.employee_id
|
||||
LEFT JOIN hrmdepartment d ON d.id = e.departmentid
|
||||
LEFT JOIN hrmsubcompany c ON c.id = e.subcompanyid1
|
||||
WHERE delete_type = 0
|
||||
LEFT JOIN hrsa_tax_agent a ON t.tax_agent_id = a.id
|
||||
WHERE t.delete_type = 0
|
||||
and e.status not in (7)
|
||||
and (e.accounttype is null or e.accounttype = 0)
|
||||
<!-- 个税扣缴义务人 -->
|
||||
<if test="param.taxAgentIds != null and param.taxAgentIds.size()>0">
|
||||
AND t.tax_agent_id IN
|
||||
<foreach collection="param.taxAgentIds" open="(" item="taxAgentId" separator="," close=")">
|
||||
#{taxAgentId}
|
||||
</foreach>
|
||||
</if>
|
||||
<!-- 薪资所属月 -->
|
||||
<if test="param.salaryMonth != null">
|
||||
AND t.salary_month = #{param.salaryMonthDate}
|
||||
</if>
|
||||
<if test="param.id != null">
|
||||
AND t.id = #{param.id}
|
||||
</if>
|
||||
<if test="param.ids != null and param.ids.size()>0">
|
||||
AND t.id IN
|
||||
<foreach collection="param.ids" open="(" item="id" separator="," close=")">
|
||||
|
|
@ -198,13 +227,24 @@
|
|||
LEFT JOIN hrmresource e ON e.id = t.employee_id
|
||||
LEFT JOIN hrmdepartment d ON d.id = e.departmentid
|
||||
LEFT JOIN hrmsubcompany c ON c.id = e.subcompanyid1
|
||||
WHERE delete_type = 0
|
||||
LEFT JOIN hrsa_tax_agent a ON t.tax_agent_id = a.id
|
||||
WHERE t.delete_type = 0
|
||||
and e.status not in (7)
|
||||
and (e.accounttype is null or e.accounttype = 0)
|
||||
<!-- 个税扣缴义务人 -->
|
||||
<if test="param.taxAgentIds != null and param.taxAgentIds.size()>0">
|
||||
AND t.tax_agent_id IN
|
||||
<foreach collection="param.taxAgentIds" open="(" item="taxAgentId" separator="," close=")">
|
||||
#{taxAgentId}
|
||||
</foreach>
|
||||
</if>
|
||||
<!-- 薪资所属月 -->
|
||||
<if test="param.salaryMonth != null">
|
||||
AND t.salary_month = #{param.salaryMonthDate}
|
||||
</if>
|
||||
<if test="param.id != null">
|
||||
AND t.id = #{param.id}
|
||||
</if>
|
||||
<if test="param.ids != null and param.ids.size()>0">
|
||||
AND t.id IN
|
||||
<foreach collection="param.ids" open="(" item="id" separator="," close=")">
|
||||
|
|
@ -247,6 +287,9 @@
|
|||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="taxAgentId != null">
|
||||
tax_agent_id,
|
||||
</if>
|
||||
<if test="employeeId != null">
|
||||
employee_id,
|
||||
</if>
|
||||
|
|
@ -273,6 +316,9 @@
|
|||
<if test="id != null" >
|
||||
#{id},
|
||||
</if>
|
||||
<if test="taxAgentId != null">
|
||||
#{taxAgentId},
|
||||
</if>
|
||||
<if test="employeeId != null" >
|
||||
#{employeeId},
|
||||
</if>
|
||||
|
|
|
|||
|
|
@ -68,5 +68,5 @@ public interface VariableArchiveService {
|
|||
|
||||
void deleteSelectVariableArchive(Collection<Long> deleteIds);
|
||||
|
||||
List<Map<String, Object>> listBySalaryMonthAndEmployeeIds(YearMonth salaryMonth, List<Long> employeeIds);
|
||||
List<Map<String, Object>> listBySalaryMonthAndEmployeeIds(YearMonth salaryMonth, List<Long> employeeIds, Long taxAgentId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -164,7 +164,7 @@ public class SalaryAcctCalculateServiceImpl extends Service implements SalaryAcc
|
|||
sw.stop();
|
||||
// 查询浮动薪资
|
||||
sw.start("查询浮动薪资");
|
||||
List<Map<String, Object>> variableArchiveList = getVariableArchiveService(user).listBySalaryMonthAndEmployeeIds(salarySobCycleDTO.getSalaryMonth(), employeeIds);
|
||||
List<Map<String, Object>> variableArchiveList = getVariableArchiveService(user).listBySalaryMonthAndEmployeeIds(salarySobCycleDTO.getSalaryMonth(), employeeIds, taxAgentId);
|
||||
sw.stop();
|
||||
// 薪资回算时回算前的核算结果 (没有回算项)
|
||||
sw.start("查询薪资回算时回算前的核算结果");
|
||||
|
|
@ -219,9 +219,6 @@ public class SalaryAcctCalculateServiceImpl extends Service implements SalaryAcc
|
|||
for (List<Long> salaryItemIds : salaryAcctCalculateBO.getSalaryItemIdWithPriorityList()) {
|
||||
// 同一运算优先级下的薪资项目逐个独立运算
|
||||
for (Long salaryItemId : salaryItemIds) {
|
||||
if (salaryItemId.equals(1723115683903L)) {
|
||||
System.out.println("d");
|
||||
}
|
||||
String resultValue;
|
||||
SalaryItemPO salaryItemPO = salaryItemMap.get(salaryItemId);
|
||||
ExpressFormula expressFormula;
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ import com.engine.salary.entity.datacollection.po.VariableArchiveItemPO;
|
|||
import com.engine.salary.entity.datacollection.po.VariableArchivePO;
|
||||
import com.engine.salary.entity.datacollection.po.VariableItemPO;
|
||||
import com.engine.salary.entity.salaryarchive.dto.SalaryArchiveInitImportDTO;
|
||||
import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeEmployeeDTO;
|
||||
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
||||
import com.engine.salary.enums.datacollection.UseEmployeeTypeEnum;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
|
|
@ -114,10 +115,13 @@ public class VariableArchiveServiceImpl extends Service implements VariableArchi
|
|||
Boolean isChief = getTaxAgentService(user).isChief(employeeId);
|
||||
// 是否开启分权
|
||||
Boolean openDevolution = getTaxAgentService(user).isOpenDevolution();
|
||||
Collection<TaxAgentPO> taxAgentPOS = getTaxAgentService(user).listAllTaxAgentsAsAdmin(employeeId);
|
||||
if (BooleanUtils.isTrue(openDevolution) && !isChief && CollectionUtils.isEmpty(taxAgentPOS)) {
|
||||
// 无权限
|
||||
return Collections.emptyList();
|
||||
if (BooleanUtils.isTrue(openDevolution) && !isChief) {
|
||||
Collection<TaxAgentPO> taxAgentPOS = getTaxAgentService(user).listAllTaxAgentsAsAdmin(employeeId);
|
||||
List<Long> taxAgentIds = taxAgentPOS.stream().map(TaxAgentPO::getId).collect(Collectors.toList());
|
||||
if (CollectionUtils.isNotEmpty(queryParam.getTaxAgentIds())) {
|
||||
taxAgentIds = taxAgentIds.stream().filter(queryParam.getTaxAgentIds()::contains).collect(Collectors.toList());
|
||||
}
|
||||
queryParam.setTaxAgentIds(taxAgentIds);
|
||||
}
|
||||
|
||||
// 浮动薪酬档案列表
|
||||
|
|
@ -161,6 +165,8 @@ public class VariableArchiveServiceImpl extends Service implements VariableArchi
|
|||
variableArchives.forEach(e -> {
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("id", e.getId());
|
||||
map.put("taxAgentName", e.getTaxAgentName());
|
||||
map.put("taxAgentIds", e.getTaxAgentId());
|
||||
map.put("username", e.getUsername());
|
||||
map.put("salaryMonth", SalaryDateUtil.getFormatYearMonth(e.getSalaryMonth()));
|
||||
map.put("employeeId", e.getEmployeeId());
|
||||
|
|
@ -190,7 +196,8 @@ public class VariableArchiveServiceImpl extends Service implements VariableArchi
|
|||
public void createData(VariableArchiveSaveParam saveParam) {
|
||||
ValidUtil.doValidator(saveParam);
|
||||
saveParam.setSalaryMonthDate(SalaryDateUtil.dateStrToLocalYearMonth(saveParam.getSalaryMonth()));
|
||||
List<VariableArchivePO> variableArchivePOList = getVariableArchiveMapper().listSome(VariableArchivePO.builder().salaryMonth(saveParam.getSalaryMonthDate()).employeeId(saveParam.getEmployeeId()).build());
|
||||
|
||||
List<VariableArchivePO> variableArchivePOList = getVariableArchiveMapper().listSome(VariableArchivePO.builder().salaryMonth(saveParam.getSalaryMonthDate()).taxAgentId(saveParam.getTaxAgentIds()).employeeId(saveParam.getEmployeeId()).build());
|
||||
if (CollectionUtils.isNotEmpty(variableArchivePOList)) {
|
||||
// 先删除原有档案
|
||||
List<Long> variableArchiveIds = variableArchivePOList.stream().map(VariableArchivePO::getId).collect(Collectors.toList());
|
||||
|
|
@ -202,6 +209,7 @@ public class VariableArchiveServiceImpl extends Service implements VariableArchi
|
|||
VariableArchivePO variableArchivePO = VariableArchivePO.builder()
|
||||
.id(IdGenerator.generate())
|
||||
.employeeId(saveParam.getEmployeeId())
|
||||
.taxAgentId(saveParam.getTaxAgentIds())
|
||||
.salaryMonth(saveParam.getSalaryMonthDate())
|
||||
.creator(Long.valueOf(user.getUID()))
|
||||
.createTime(now)
|
||||
|
|
@ -285,6 +293,7 @@ public class VariableArchiveServiceImpl extends Service implements VariableArchi
|
|||
// 获取所有可被引用的薪资项目
|
||||
List<VariableItemPO> variableItems = getVariableItemService(user).listAll();
|
||||
List<Object> header = Lists.newArrayList();
|
||||
header.add(SalaryI18nUtil.getI18nLabel(0, "个税扣缴义务人"));
|
||||
header.add(SalaryI18nUtil.getI18nLabel(85429, "姓名"));
|
||||
header.add(SalaryI18nUtil.getI18nLabel(86185, "部门"));
|
||||
header.add(SalaryI18nUtil.getI18nLabel(86186, "手机号"));
|
||||
|
|
@ -306,6 +315,7 @@ public class VariableArchiveServiceImpl extends Service implements VariableArchi
|
|||
// 组装数据
|
||||
listMaps.forEach(e -> {
|
||||
List<Object> row = new ArrayList<>();
|
||||
row.add(e.get("taxAgentName").toString());
|
||||
row.add(e.get("username").toString());
|
||||
row.add(Optional.ofNullable(e.get("departmentName")).orElse("").toString());
|
||||
row.add(e.get("mobile") == null ? "" : e.get("mobile").toString());
|
||||
|
|
@ -440,12 +450,16 @@ public class VariableArchiveServiceImpl extends Service implements VariableArchi
|
|||
List<VariableArchivePO> variableArchiveList = getVariableArchiveMapper().listSome(VariableArchivePO.builder().salaryMonth(SalaryDateUtil.dateStrToLocalYearMonth(param.getSalaryMonth())).build());
|
||||
|
||||
List<Long> variableArchiveIds = variableArchiveList.stream().map(VariableArchivePO::getId).collect(Collectors.toList());
|
||||
Map<Long, VariableArchivePO> variableArchivesMap = SalaryEntityUtil.convert2Map(variableArchiveList, k -> k.getEmployeeId());
|
||||
Map<String, VariableArchivePO> variableArchivesMap = SalaryEntityUtil.convert2Map(variableArchiveList, k -> k.getTaxAgentId() + "-" + k.getEmployeeId());
|
||||
|
||||
// 获取浮动薪资档案明细数据
|
||||
List<VariableArchiveItemPO> variableArchiveItemPOS = getVariableArchiveItemService(user).listByVariableArchiveIds(variableArchiveIds);
|
||||
Map<String, List<VariableArchiveItemPO>> variableArchiveItemMap = SalaryEntityUtil.group2Map(variableArchiveItemPOS, k -> k.getVariableArchiveId() + "-" + k.getVariableItemId());
|
||||
|
||||
Collection<TaxAgentManageRangeEmployeeDTO> taxAgentList;
|
||||
taxAgentList = getTaxAgentService(user).listTaxAgentAndEmployeeTree((long) user.getUID());
|
||||
|
||||
|
||||
return VariableArchiveImportHandleParam.builder()
|
||||
.imageId(param.getImageId())
|
||||
.salaryMonth(param.getSalaryMonth())
|
||||
|
|
@ -464,6 +478,8 @@ public class VariableArchiveServiceImpl extends Service implements VariableArchi
|
|||
.variableItemIds(variableItemIds)
|
||||
// 查询已生效的浮动薪资项目数据
|
||||
.effectiveItemListMap(variableArchiveItemMap)
|
||||
// 可以管理的义务人
|
||||
.taxAgentList(taxAgentList)
|
||||
// 当前时间
|
||||
.nowTime(new Date())
|
||||
// 当天
|
||||
|
|
@ -505,6 +521,7 @@ public class VariableArchiveServiceImpl extends Service implements VariableArchi
|
|||
// 获取所有可被引用的薪资项目
|
||||
List<VariableItemPO> variableItems = getVariableItemService(user).listAll();
|
||||
List<Object> header = Lists.newArrayList();
|
||||
header.add(SalaryI18nUtil.getI18nLabel(0, "个税扣缴义务人"));
|
||||
header.add(SalaryI18nUtil.getI18nLabel(85429, "姓名"));
|
||||
header.add(SalaryI18nUtil.getI18nLabel(86185, "部门"));
|
||||
header.add(SalaryI18nUtil.getI18nLabel(86186, "手机号"));
|
||||
|
|
@ -524,6 +541,7 @@ public class VariableArchiveServiceImpl extends Service implements VariableArchi
|
|||
// 组装数据
|
||||
listMaps.forEach(e -> {
|
||||
List<Object> row = new ArrayList<>();
|
||||
row.add(e.get("taxAgentName").toString());
|
||||
row.add(e.get("username").toString());
|
||||
row.add(Optional.ofNullable(e.get("departmentName")).orElse("").toString());
|
||||
row.add(e.get("mobile") == null ? "" : e.get("mobile").toString());
|
||||
|
|
@ -559,8 +577,13 @@ public class VariableArchiveServiceImpl extends Service implements VariableArchi
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> listBySalaryMonthAndEmployeeIds(YearMonth salaryMonth, List<Long> employeeIds) {
|
||||
VariableArchiveQueryParam queryParam = VariableArchiveQueryParam.builder().employeeIds(employeeIds).salaryMonth(SalaryDateUtil.getFormatYearMonth(salaryMonth)).salaryMonthDate(SalaryDateUtil.toDate(salaryMonth,1)).build();
|
||||
public List<Map<String, Object>> listBySalaryMonthAndEmployeeIds(YearMonth salaryMonth, List<Long> employeeIds, Long taxAgentId) {
|
||||
VariableArchiveQueryParam queryParam = VariableArchiveQueryParam.builder()
|
||||
.employeeIds(employeeIds)
|
||||
.salaryMonth(SalaryDateUtil.getFormatYearMonth(salaryMonth))
|
||||
.salaryMonthDate(SalaryDateUtil.toDate(salaryMonth,1))
|
||||
.taxAgentIds(Collections.singletonList(taxAgentId))
|
||||
.build();
|
||||
List<VariableArchiveListDTO> variableArchiveListDTO = list(queryParam);
|
||||
return buildVariableArchiveData(variableArchiveListDTO);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue