Merge branch 'release/3.0.1.2503.01' into release/个税&业务线
# Conflicts: # src/com/engine/salary/service/SalaryAcctResultService.java # src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java # src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java # src/com/engine/salary/wrapper/SalarySobWrapper.java
This commit is contained in:
commit
b1c1587344
|
|
@ -1,5 +1,5 @@
|
||||||
log=false
|
log=false
|
||||||
defaultCloseNonStandard149=true
|
defaultCloseNonStandard149=true
|
||||||
AESEncryptScrect=990EB004A1C862721C1513AE90038C9E
|
AESEncryptScrect=990EB004A1C862721C1513AE90038C9E
|
||||||
version=2.19.1.2501.01
|
version=3.0.0.2503.01
|
||||||
openFormulaForcedEditing=false
|
openFormulaForcedEditing=false
|
||||||
|
|
@ -96,15 +96,18 @@ public class CheckStopSalaryAction implements Action {
|
||||||
List<TaxAgentPO> taxAgentPOS = getTaxAgentMapper().listByName(taxAgentName);
|
List<TaxAgentPO> taxAgentPOS = getTaxAgentMapper().listByName(taxAgentName);
|
||||||
if(CollectionUtils.isEmpty(taxAgentPOS)){
|
if(CollectionUtils.isEmpty(taxAgentPOS)){
|
||||||
requestInfo.getRequestManager().setMessage("个税扣缴义务人不存在!");
|
requestInfo.getRequestManager().setMessage("个税扣缴义务人不存在!");
|
||||||
|
log.error("停薪检查异常 requestId:{} msg:{}", requestInfo.getRequestid(), taxAgentName + "个税扣缴义务人不存在!");
|
||||||
return FAILURE_AND_CONTINUE;
|
return FAILURE_AND_CONTINUE;
|
||||||
}
|
}
|
||||||
Long taxAgentId = Long.valueOf( taxAgentPOS.get(0).getId() );
|
Long taxAgentId = Long.valueOf( taxAgentPOS.get(0).getId() );
|
||||||
Long employeeId = Long.valueOf(importDataMap.getOrDefault("员工id", "-1").toString());
|
Long employeeId = Long.valueOf(importDataMap.getOrDefault("员工id", "-1").toString());
|
||||||
if( importDataMap.get("最后发薪日期") == null || StringUtils.isBlank(importDataMap.get("最后发薪日期").toString())){
|
if( importDataMap.get("最后发薪日期") == null || StringUtils.isBlank(importDataMap.get("最后发薪日期").toString())){
|
||||||
requestInfo.getRequestManager().setMessage("缺少最后发薪日期字段!");
|
requestInfo.getRequestManager().setMessage("缺少最后发薪日期字段!");
|
||||||
|
log.error("停薪检查异常 requestId:{} msg:{}", requestInfo.getRequestid(), "缺少最后发薪日期字段!");
|
||||||
return FAILURE_AND_CONTINUE;
|
return FAILURE_AND_CONTINUE;
|
||||||
}else if(SalaryDateUtil.stringToDate(importDataMap.get("最后发薪日期").toString()) == null){
|
}else if(SalaryDateUtil.stringToDate(importDataMap.get("最后发薪日期").toString()) == null){
|
||||||
requestInfo.getRequestManager().setMessage("最后发薪日期格式错误,格式为yyyy-MM-dd");
|
requestInfo.getRequestManager().setMessage("最后发薪日期格式错误,格式为yyyy-MM-dd");
|
||||||
|
log.error("停薪检查异常 requestId:{} msg:{}", requestInfo.getRequestid(), "最后发薪日期格式错误,格式为yyyy-MM-dd" + importDataMap.get("最后发薪日期").toString());
|
||||||
return FAILURE_AND_CONTINUE;
|
return FAILURE_AND_CONTINUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -115,15 +118,17 @@ public class CheckStopSalaryAction implements Action {
|
||||||
List<SalaryArchivePO> salaryArchiveList = getSalaryArchiveService(user).listSome(SalaryArchivePO.builder().taxAgentId(taxAgentId).employeeId(employeeId).deleteType(NumberUtils.INTEGER_ZERO).build());
|
List<SalaryArchivePO> salaryArchiveList = getSalaryArchiveService(user).listSome(SalaryArchivePO.builder().taxAgentId(taxAgentId).employeeId(employeeId).deleteType(NumberUtils.INTEGER_ZERO).build());
|
||||||
if(CollectionUtils.isEmpty(salaryArchiveList)){
|
if(CollectionUtils.isEmpty(salaryArchiveList)){
|
||||||
requestInfo.getRequestManager().setMessage("该个税扣缴义务人下该员工不存在薪资档案,请检查后重试!");
|
requestInfo.getRequestManager().setMessage("该个税扣缴义务人下该员工不存在薪资档案,请检查后重试!");
|
||||||
|
log.error("停薪检查异常 requestId:{} msg:{}", requestInfo.getRequestid(), taxAgentId +"_"+ employeeId+"该个税扣缴义务人下该员工不存在薪资档案,请检查后重试!");
|
||||||
return FAILURE_AND_CONTINUE;
|
return FAILURE_AND_CONTINUE;
|
||||||
}
|
}
|
||||||
if(salaryArchiveList.size() > 1){
|
if(salaryArchiveList.size() > 1){
|
||||||
requestInfo.getRequestManager().setMessage("该个税扣缴义务人下该员工存在多条薪资档案记录,请检查后重试!");
|
requestInfo.getRequestManager().setMessage("该个税扣缴义务人下该员工存在多条薪资档案记录,请检查后重试!");
|
||||||
|
log.error("停薪检查异常 requestId:{} msg:{}", requestInfo.getRequestid(), taxAgentId +"_"+ employeeId+"该个税扣缴义务人下该员工存在多条薪资档案记录,请检查后重试!");
|
||||||
return FAILURE_AND_CONTINUE;
|
return FAILURE_AND_CONTINUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("停薪校验异常", e);
|
log.error("停薪检查异常", e);
|
||||||
requestInfo.getRequestManager().setMessage(e.getMessage());
|
requestInfo.getRequestManager().setMessage(e.getMessage());
|
||||||
return FAILURE_AND_CONTINUE;
|
return FAILURE_AND_CONTINUE;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -107,15 +107,18 @@ public class StopSalaryAction implements Action {
|
||||||
List<TaxAgentPO> taxAgentPOS = getTaxAgentMapper().listByName(taxAgentName);
|
List<TaxAgentPO> taxAgentPOS = getTaxAgentMapper().listByName(taxAgentName);
|
||||||
if(CollectionUtils.isEmpty(taxAgentPOS)){
|
if(CollectionUtils.isEmpty(taxAgentPOS)){
|
||||||
requestInfo.getRequestManager().setMessage("个税扣缴义务人不存在!");
|
requestInfo.getRequestManager().setMessage("个税扣缴义务人不存在!");
|
||||||
|
log.error("停薪异常 requestId:{} msg:{}", requestInfo.getRequestid(), taxAgentName + "个税扣缴义务人不存在!");
|
||||||
return FAILURE_AND_CONTINUE;
|
return FAILURE_AND_CONTINUE;
|
||||||
}
|
}
|
||||||
Long taxAgentId = Long.valueOf( taxAgentPOS.get(0).getId() );
|
Long taxAgentId = Long.valueOf( taxAgentPOS.get(0).getId() );
|
||||||
Long employeeId = Long.valueOf(importDataMap.getOrDefault("员工id", "-1").toString());
|
Long employeeId = Long.valueOf(importDataMap.getOrDefault("员工id", "-1").toString());
|
||||||
if( importDataMap.get("最后发薪日期") == null || StringUtils.isBlank(importDataMap.get("最后发薪日期").toString())){
|
if( importDataMap.get("最后发薪日期") == null || StringUtils.isBlank(importDataMap.get("最后发薪日期").toString())){
|
||||||
requestInfo.getRequestManager().setMessage("缺少最后发薪日期字段!");
|
requestInfo.getRequestManager().setMessage("缺少最后发薪日期字段!");
|
||||||
|
log.error("停薪异常 requestId:{} msg:{}", requestInfo.getRequestid(), "缺少最后发薪日期字段!");
|
||||||
return FAILURE_AND_CONTINUE;
|
return FAILURE_AND_CONTINUE;
|
||||||
}else if(SalaryDateUtil.stringToDate(importDataMap.get("最后发薪日期").toString()) == null){
|
}else if(SalaryDateUtil.stringToDate(importDataMap.get("最后发薪日期").toString()) == null){
|
||||||
requestInfo.getRequestManager().setMessage("最后发薪日期格式错误,格式为yyyy-MM-dd");
|
requestInfo.getRequestManager().setMessage("最后发薪日期格式错误,格式为yyyy-MM-dd");
|
||||||
|
log.error("停薪异常 requestId:{} msg:{}", requestInfo.getRequestid(), "最后发薪日期格式错误,格式为yyyy-MM-dd" + importDataMap.get("最后发薪日期").toString());
|
||||||
return FAILURE_AND_CONTINUE;
|
return FAILURE_AND_CONTINUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -123,10 +126,12 @@ public class StopSalaryAction implements Action {
|
||||||
List<SalaryArchivePO> salaryArchiveList = getSalaryArchiveService(user).listSome(SalaryArchivePO.builder().taxAgentId(taxAgentId).employeeId(employeeId).deleteType(NumberUtils.INTEGER_ZERO).build());
|
List<SalaryArchivePO> salaryArchiveList = getSalaryArchiveService(user).listSome(SalaryArchivePO.builder().taxAgentId(taxAgentId).employeeId(employeeId).deleteType(NumberUtils.INTEGER_ZERO).build());
|
||||||
if(CollectionUtils.isEmpty(salaryArchiveList)){
|
if(CollectionUtils.isEmpty(salaryArchiveList)){
|
||||||
requestInfo.getRequestManager().setMessage("该个税扣缴义务人下该员工不存在薪资档案,请检查后重试!");
|
requestInfo.getRequestManager().setMessage("该个税扣缴义务人下该员工不存在薪资档案,请检查后重试!");
|
||||||
|
log.error("停薪异常 requestId:{} msg:{}", requestInfo.getRequestid(), taxAgentId +"_"+ employeeId+"该个税扣缴义务人下该员工不存在薪资档案,请检查后重试!");
|
||||||
return FAILURE_AND_CONTINUE;
|
return FAILURE_AND_CONTINUE;
|
||||||
}
|
}
|
||||||
if(salaryArchiveList.size() > 1){
|
if(salaryArchiveList.size() > 1){
|
||||||
requestInfo.getRequestManager().setMessage("该个税扣缴义务人下该员工存在多条薪资档案记录,请检查后重试!");
|
requestInfo.getRequestManager().setMessage("该个税扣缴义务人下该员工存在多条薪资档案记录,请检查后重试!");
|
||||||
|
log.error("停薪异常 requestId:{} msg:{}", requestInfo.getRequestid(), taxAgentId +"_"+ employeeId+"该个税扣缴义务人下该员工存在多条薪资档案记录,请检查后重试!");
|
||||||
return FAILURE_AND_CONTINUE;
|
return FAILURE_AND_CONTINUE;
|
||||||
}
|
}
|
||||||
// 设置最后发薪日期
|
// 设置最后发薪日期
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
package com.engine.salary.entity.datacollection.bo;
|
package com.engine.salary.entity.datacollection.bo;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.NumberUtil;
|
||||||
import com.engine.core.impl.Service;
|
import com.engine.core.impl.Service;
|
||||||
import com.engine.salary.constant.SalaryArchiveConstant;
|
|
||||||
import com.engine.salary.constant.SalaryDefaultTenantConstant;
|
import com.engine.salary.constant.SalaryDefaultTenantConstant;
|
||||||
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
||||||
import com.engine.salary.entity.datacollection.param.VariableArchiveImportHandleParam;
|
import com.engine.salary.entity.datacollection.param.VariableArchiveImportHandleParam;
|
||||||
|
|
@ -23,7 +23,6 @@ import weaver.general.Util;
|
||||||
import weaver.hrm.User;
|
import weaver.hrm.User;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.regex.Pattern;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -232,7 +231,7 @@ public class VariableArchiveExcelBO extends Service {
|
||||||
if (optionalVariableItem.isPresent()) {
|
if (optionalVariableItem.isPresent()) {
|
||||||
VariableItemPO variableItemPO = optionalVariableItem.get();
|
VariableItemPO variableItemPO = optionalVariableItem.get();
|
||||||
// 数值类型判断
|
// 数值类型判断
|
||||||
boolean isNotNumber = variableItemPO.getDataType().equals(SalaryArchiveFieldTypeEnum.NUMBER.getValue()) && StringUtils.isNotEmpty(cellVal) && !Pattern.matches(SalaryArchiveConstant.NUMBER_REGEX, cellVal);
|
boolean isNotNumber = variableItemPO.getDataType().equals(SalaryArchiveFieldTypeEnum.NUMBER.getValue()) && StringUtils.isNotEmpty(cellVal) && !NumberUtil.isNumber(cellVal);
|
||||||
if (isNotNumber) {
|
if (isNotNumber) {
|
||||||
Map<String, String> errorMessageMap = Maps.newHashMap();
|
Map<String, String> errorMessageMap = Maps.newHashMap();
|
||||||
errorMessageMap.put("message", rowindex + key + numberErr);
|
errorMessageMap.put("message", rowindex + key + numberErr);
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
|
|
@ -18,6 +19,7 @@ import java.util.Date;
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
//数据采集-累计专项附加扣除记录
|
//数据采集-累计专项附加扣除记录
|
||||||
@SalaryTable(pageId = "a4f85287-3354-4275-adn9-7d06e54y6rj8", tableType = WeaTableType.CHECKBOX)
|
@SalaryTable(pageId = "a4f85287-3354-4275-adn9-7d06e54y6rj8", tableType = WeaTableType.CHECKBOX)
|
||||||
|
@Auth(page = "addUpDeduction")
|
||||||
public class AddUpDeductionRecordDTO {
|
public class AddUpDeductionRecordDTO {
|
||||||
|
|
||||||
//主键id
|
//主键id
|
||||||
|
|
@ -124,4 +126,6 @@ public class AddUpDeductionRecordDTO {
|
||||||
@Encrypt
|
@Encrypt
|
||||||
private String addUpInfantCare;
|
private String addUpInfantCare;
|
||||||
|
|
||||||
|
private Set<String> opts;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,7 @@
|
||||||
package com.engine.salary.entity.datacollection.dto;
|
package com.engine.salary.entity.datacollection.dto;
|
||||||
|
|
||||||
import com.cloudstore.eccom.pc.table.WeaTableType;
|
import com.cloudstore.eccom.pc.table.WeaTableType;
|
||||||
import com.engine.salary.annotation.Encrypt;
|
import com.engine.salary.annotation.*;
|
||||||
import com.engine.salary.annotation.SalaryTable;
|
|
||||||
import com.engine.salary.annotation.SalaryTableColumn;
|
|
||||||
import com.engine.salary.annotation.TableTitle;
|
|
||||||
import com.engine.salary.util.excel.ExcelProperty;
|
import com.engine.salary.util.excel.ExcelProperty;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
|
@ -28,6 +25,7 @@ import java.util.Date;
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@SalaryTable(pageId = "a5f85287-3354-4275-adn9-7d06e54y6rj8",tableType = WeaTableType.CHECKBOX)
|
@SalaryTable(pageId = "a5f85287-3354-4275-adn9-7d06e54y6rj8",tableType = WeaTableType.CHECKBOX)
|
||||||
|
@Auth(page = "addUpSituation")
|
||||||
public class AddUpSituationRecordDTO {
|
public class AddUpSituationRecordDTO {
|
||||||
|
|
||||||
@SalaryTableColumn(column = "id", display = false)
|
@SalaryTableColumn(column = "id", display = false)
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,57 @@
|
||||||
|
package com.engine.salary.entity.extemp.dto;
|
||||||
|
|
||||||
|
|
||||||
|
import com.engine.hrmelog.annotation.ElogTransform;
|
||||||
|
import com.engine.salary.annotation.TableTitle;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 外部人员
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
//hrsa_external_employee
|
||||||
|
@ElogTransform( name = "非系统人员")
|
||||||
|
public class ExtEmpDTO {
|
||||||
|
|
||||||
|
@ElogTransform(name = "主键id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 姓名
|
||||||
|
*/
|
||||||
|
@TableTitle(title = "姓名", dataIndex = "username", key = "username")
|
||||||
|
private String username;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门
|
||||||
|
*/
|
||||||
|
@TableTitle(title = "部门", dataIndex = "departmentName", key = "departmentName")
|
||||||
|
private String departmentName;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分部
|
||||||
|
*/
|
||||||
|
@TableTitle(title = "分部", dataIndex = "subcompanyName", key = "subcompanyName")
|
||||||
|
private String subcompanyName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入职日期
|
||||||
|
*/
|
||||||
|
@TableTitle(title = "入职日期", dataIndex = "companystartdate", key = "companystartdate")
|
||||||
|
private String companystartdate;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工号
|
||||||
|
*/
|
||||||
|
@TableTitle(title = "工号", dataIndex = "workcode", key = "workcode")
|
||||||
|
private String workcode;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -104,6 +104,11 @@ public class CalculateFormulaVarBO {
|
||||||
*/
|
*/
|
||||||
private List<Map<String, Object>> variableArchiveList;
|
private List<Map<String, Object>> variableArchiveList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上月核算结果
|
||||||
|
*/
|
||||||
|
List<SalaryAcctResultPO> lastMonthResultPOS;
|
||||||
|
|
||||||
public CalculateFormulaVarBO(List<DataCollectionEmployee> simpleEmployees,
|
public CalculateFormulaVarBO(List<DataCollectionEmployee> simpleEmployees,
|
||||||
List<SalaryArchiveDataDTO> salaryArchiveData,
|
List<SalaryArchiveDataDTO> salaryArchiveData,
|
||||||
List<AddUpSituation> addUpSituationPOS,
|
List<AddUpSituation> addUpSituationPOS,
|
||||||
|
|
@ -112,7 +117,8 @@ public class CalculateFormulaVarBO {
|
||||||
List<Map<String, Object>> welfareData,
|
List<Map<String, Object>> welfareData,
|
||||||
List<AttendQuoteDataDTO> attendQuoteDataDTOS,
|
List<AttendQuoteDataDTO> attendQuoteDataDTOS,
|
||||||
List<SalaryAcctResultPO> salaryAcctResultPOS,
|
List<SalaryAcctResultPO> salaryAcctResultPOS,
|
||||||
List<Map<String, Object>> variableArchiveList) {
|
List<Map<String, Object>> variableArchiveList,
|
||||||
|
List<SalaryAcctResultPO> lastMonthResultPOS) {
|
||||||
this.simpleEmployees = simpleEmployees;
|
this.simpleEmployees = simpleEmployees;
|
||||||
this.salaryArchiveData = salaryArchiveData;
|
this.salaryArchiveData = salaryArchiveData;
|
||||||
this.addUpSituationPOS = addUpSituationPOS;
|
this.addUpSituationPOS = addUpSituationPOS;
|
||||||
|
|
@ -122,6 +128,7 @@ public class CalculateFormulaVarBO {
|
||||||
this.attendQuoteDataDTOS = attendQuoteDataDTOS;
|
this.attendQuoteDataDTOS = attendQuoteDataDTOS;
|
||||||
this.salaryAcctResultPOS = salaryAcctResultPOS;
|
this.salaryAcctResultPOS = salaryAcctResultPOS;
|
||||||
this.variableArchiveList = variableArchiveList;
|
this.variableArchiveList = variableArchiveList;
|
||||||
|
this.lastMonthResultPOS = lastMonthResultPOS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -150,7 +157,10 @@ public class CalculateFormulaVarBO {
|
||||||
handleAttendQuoteData(salaryAcctCalculateBO, resultMap);
|
handleAttendQuoteData(salaryAcctCalculateBO, resultMap);
|
||||||
//处理核算人员信息
|
//处理核算人员信息
|
||||||
handleSalaryAcctEmployee(salaryAcctCalculateBO, resultMap);
|
handleSalaryAcctEmployee(salaryAcctCalculateBO, resultMap);
|
||||||
|
//处理人员信息
|
||||||
handleSimpleEmployees(resultMap);
|
handleSimpleEmployees(resultMap);
|
||||||
|
//处理上月薪资核算结果
|
||||||
|
handleLastMonthResult(salaryAcctCalculateBO, resultMap);
|
||||||
return resultMap;
|
return resultMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -234,6 +244,25 @@ public class CalculateFormulaVarBO {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void handleLastMonthResult(SalaryAcctCalculateBO salaryAcctCalculateBO, Map<String, List<FormulaVarValue>> resultMap) {
|
||||||
|
// key:薪资项目的id、value:薪资项目的code
|
||||||
|
Map<Long, String> salaryItemCodeMap = SalaryEntityUtil.convert2Map(salaryAcctCalculateBO.getSalaryItemPOS(), SalaryItemPO::getId, SalaryItemPO::getCode);
|
||||||
|
// key:employeeId_taxAgentId、value:薪资核算结果集合
|
||||||
|
Map<String, List<SalaryAcctResultPO>> salaryAcctResultMap = SalaryEntityUtil.group2Map(lastMonthResultPOS,
|
||||||
|
salaryAcctResultPO -> salaryAcctResultPO.getEmployeeId() + "_" + salaryAcctResultPO.getTaxAgentId());
|
||||||
|
// 填充到返回结果集中
|
||||||
|
salaryAcctResultMap.forEach((key, salaryAcctResultPOS) -> {
|
||||||
|
List<FormulaVarValue> formulaVarValues = resultMap.computeIfAbsent(key, k -> Lists.newArrayList());
|
||||||
|
formulaVarValues.addAll(salaryAcctResultPOS.stream()
|
||||||
|
.map(salaryAcctResultPO -> {
|
||||||
|
String fieldId = SalaryFormulaReferenceEnum.LAST_MONTH_CALC.getValue()
|
||||||
|
+ SalaryFormulaFieldConstant.FIELD_ID_SEPARATOR
|
||||||
|
+ salaryItemCodeMap.getOrDefault(salaryAcctResultPO.getSalaryItemId(), StringUtils.EMPTY);
|
||||||
|
return new FormulaVarValue().setFieldId(fieldId).setFieldValue(salaryAcctResultPO.getResultValue());
|
||||||
|
})
|
||||||
|
.collect(Collectors.toList()));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 处理薪资档案(会涉及调薪计薪规则)+处理核算日期
|
* 处理薪资档案(会涉及调薪计薪规则)+处理核算日期
|
||||||
|
|
@ -256,7 +285,7 @@ public class CalculateFormulaVarBO {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleVariableArchiveData(SalaryAcctCalculateBO salaryAcctCalculateBO, Map<String, List<FormulaVarValue>> resultMap) {
|
private void handleVariableArchiveData(SalaryAcctCalculateBO salaryAcctCalculateBO, Map<String, List<FormulaVarValue>> resultMap) {
|
||||||
Map<String, Map<String, Object>> variableArchiveMap = SalaryEntityUtil.convert2Map(variableArchiveList, map -> map.getOrDefault("taxAgentId", "").toString() + "-" + map.getOrDefault("employeeId", "").toString());
|
Map<String, Map<String, Object>> variableArchiveMap = SalaryEntityUtil.convert2Map(variableArchiveList, map -> map.getOrDefault("taxAgentIds", "").toString() + "-" + map.getOrDefault("employeeId", "").toString());
|
||||||
// 填充到返回结果集中
|
// 填充到返回结果集中
|
||||||
for (SalaryAcctEmployeePO salaryAcctEmployeePO : salaryAcctCalculateBO.getSalaryAcctEmployeePOS()) {
|
for (SalaryAcctEmployeePO salaryAcctEmployeePO : salaryAcctCalculateBO.getSalaryAcctEmployeePOS()) {
|
||||||
List<FormulaVarValue> formulaVarValues = resultMap.computeIfAbsent(salaryAcctEmployeePO.getEmployeeId() + "_" + salaryAcctEmployeePO.getTaxAgentId(),
|
List<FormulaVarValue> formulaVarValues = resultMap.computeIfAbsent(salaryAcctEmployeePO.getEmployeeId() + "_" + salaryAcctEmployeePO.getTaxAgentId(),
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
package com.engine.salary.entity.salaryarchive.bo;
|
package com.engine.salary.entity.salaryarchive.bo;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.NumberUtil;
|
||||||
import com.engine.core.impl.Service;
|
import com.engine.core.impl.Service;
|
||||||
import com.engine.salary.constant.SalaryArchiveConstant;
|
|
||||||
import com.engine.salary.constant.SalaryDefaultTenantConstant;
|
import com.engine.salary.constant.SalaryDefaultTenantConstant;
|
||||||
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
||||||
import com.engine.salary.entity.salaryarchive.dto.SalaryArchiveInitImportDTO;
|
import com.engine.salary.entity.salaryarchive.dto.SalaryArchiveInitImportDTO;
|
||||||
|
|
@ -35,7 +35,6 @@ import weaver.hrm.User;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
import java.util.regex.Pattern;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -826,7 +825,7 @@ public class SalaryArchiveExcelBO extends Service {
|
||||||
if (isEnable) {
|
if (isEnable) {
|
||||||
SalaryItemPO salaryItemPO = optionalSalaryItem.get();
|
SalaryItemPO salaryItemPO = optionalSalaryItem.get();
|
||||||
// 数值类型判断
|
// 数值类型判断
|
||||||
boolean isNotNumber = salaryItemPO.getDataType().equals(SalaryArchiveFieldTypeEnum.NUMBER.getValue()) && StringUtils.isNotEmpty(cellVal) && !Pattern.matches(SalaryArchiveConstant.NUMBER_REGEX, cellVal);
|
boolean isNotNumber = salaryItemPO.getDataType().equals(SalaryArchiveFieldTypeEnum.NUMBER.getValue()) && StringUtils.isNotEmpty(cellVal) && !NumberUtil.isNumber(cellVal);
|
||||||
if (isNotNumber) {
|
if (isNotNumber) {
|
||||||
Map<String, String> errorMessageMap = Maps.newHashMap();
|
Map<String, String> errorMessageMap = Maps.newHashMap();
|
||||||
errorMessageMap.put("message", rowindex + key + numberErr);
|
errorMessageMap.put("message", rowindex + key + numberErr);
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package com.engine.salary.entity.salaryarchive.dto;
|
package com.engine.salary.entity.salaryarchive.dto;
|
||||||
|
|
||||||
import com.engine.salary.annotation.Encrypt;
|
import com.engine.salary.annotation.Encrypt;
|
||||||
|
import com.engine.salary.annotation.I18n;
|
||||||
import com.engine.salary.annotation.TableTitle;
|
import com.engine.salary.annotation.TableTitle;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
|
@ -42,6 +43,7 @@ public class SalaryItemAdjustRecordListDTO {
|
||||||
private String username;
|
private String username;
|
||||||
|
|
||||||
@TableTitle(title = "部门", dataIndex = "departmentName", key = "departmentName")
|
@TableTitle(title = "部门", dataIndex = "departmentName", key = "departmentName")
|
||||||
|
@I18n
|
||||||
private String departmentName;
|
private String departmentName;
|
||||||
|
|
||||||
@TableTitle(title = "员工状态", dataIndex = "employeeStatus", key = "employeeStatus")
|
@TableTitle(title = "员工状态", dataIndex = "employeeStatus", key = "employeeStatus")
|
||||||
|
|
@ -66,6 +68,7 @@ public class SalaryItemAdjustRecordListDTO {
|
||||||
private Date effectiveTime;
|
private Date effectiveTime;
|
||||||
|
|
||||||
@TableTitle(title = "操作人", dataIndex = "operator", key = "operator")
|
@TableTitle(title = "操作人", dataIndex = "operator", key = "operator")
|
||||||
|
@I18n
|
||||||
private String operator;
|
private String operator;
|
||||||
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
|
|
||||||
|
|
@ -59,6 +59,7 @@ public class SalarySobPO {
|
||||||
@Deprecated
|
@Deprecated
|
||||||
private Long taxAgentId;
|
private Long taxAgentId;
|
||||||
|
|
||||||
|
@XStreamOmitField
|
||||||
List<Long> taxAgentIds;
|
List<Long> taxAgentIds;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ public enum SalaryFormulaReferenceEnum implements BaseEnum<String> {
|
||||||
|
|
||||||
SALARY_ITEM("salaryItem", "薪资项目", 84960),
|
SALARY_ITEM("salaryItem", "薪资项目", 84960),
|
||||||
// SALARY_ITEM_OF_HISTORY("salaryItemOfHistory", "历史台账薪资项目", 85364),
|
// SALARY_ITEM_OF_HISTORY("salaryItemOfHistory", "历史台账薪资项目", 85364),
|
||||||
|
LAST_MONTH_CALC("lastMonthCalc", "上月核算", 257728),
|
||||||
EMPLOYEE_INFO("employeeInfo", "员工基本信息", 85366),
|
EMPLOYEE_INFO("employeeInfo", "员工基本信息", 85366),
|
||||||
SALARY_ARCHIVES("salaryArchives", "薪资档案", 85368),
|
SALARY_ARCHIVES("salaryArchives", "薪资档案", 85368),
|
||||||
ATTEND("attend", "考勤引用", 85367),
|
ATTEND("attend", "考勤引用", 85367),
|
||||||
|
|
|
||||||
|
|
@ -192,4 +192,12 @@ public interface InsuranceAccountDetailMapper {
|
||||||
* 获取补差数据(账单月份+人员id+个税扣缴义务人)
|
* 获取补差数据(账单月份+人员id+个税扣缴义务人)
|
||||||
*/
|
*/
|
||||||
List<InsuranceAccountDetailPO> queryBalanceList(InsuranceAccountDetailPO po);
|
List<InsuranceAccountDetailPO> queryBalanceList(InsuranceAccountDetailPO po);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id删除
|
||||||
|
* @param ids
|
||||||
|
*/
|
||||||
|
void deleteByIds(@Param("ids")List<Long> ids);
|
||||||
|
|
||||||
|
void deleteByEmpIds(@Param("employeeIds")List<Long> deleteEmployeeIds, @Param("billMonth") String billMonth, @Param("paymentOrganization") Long paymentOrganization);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -553,6 +553,7 @@
|
||||||
|
|
||||||
<select id="selectList" resultMap="BaseResultMap">
|
<select id="selectList" resultMap="BaseResultMap">
|
||||||
SELECT
|
SELECT
|
||||||
|
t.id,
|
||||||
t.employee_id,t.social_sum,t.fund_sum,t.other_sum,t.fund_pay_org,t.social_pay_org,
|
t.employee_id,t.social_sum,t.fund_sum,t.other_sum,t.fund_pay_org,t.social_pay_org,
|
||||||
t.other_pay_org, t.payment_status
|
t.other_pay_org, t.payment_status
|
||||||
FROM
|
FROM
|
||||||
|
|
@ -1563,6 +1564,29 @@
|
||||||
AND employee_id = #{employeeId}
|
AND employee_id = #{employeeId}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteByIds">
|
||||||
|
UPDATE hrsa_bill_detail
|
||||||
|
SET delete_type = 1
|
||||||
|
WHERE delete_type = 0
|
||||||
|
<if test="ids != null and ids.size()>0">
|
||||||
|
AND id IN
|
||||||
|
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
</delete>
|
||||||
|
<delete id="deleteByEmpIds">
|
||||||
|
UPDATE hrsa_bill_detail
|
||||||
|
SET delete_type = 1
|
||||||
|
WHERE delete_type = 0
|
||||||
|
AND bill_month = #{billMonth}
|
||||||
|
AND payment_organization = #{paymentOrganization}
|
||||||
|
AND employee_id in
|
||||||
|
<foreach collection="employeeIds" open="(" item="employeeId" separator="," close=")">
|
||||||
|
#{employeeId}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
<select id="getOneByBpep" resultMap="BaseResultMap">
|
<select id="getOneByBpep" resultMap="BaseResultMap">
|
||||||
SELECT
|
SELECT
|
||||||
t.id,t.employee_id,t.social_per_json,t.social_com_json,
|
t.id,t.employee_id,t.social_per_json,t.social_com_json,
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,8 @@ public interface InsuranceBaseInfoMapper {
|
||||||
*/
|
*/
|
||||||
List<InsuranceArchivesBaseInfoPO> listAll();
|
List<InsuranceArchivesBaseInfoPO> listAll();
|
||||||
|
|
||||||
|
List<InsuranceArchivesBaseInfoPO> listByEmployeeIds(@Param("employeeIds")Collection<Long> employeeIds);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询对应id集合的记录
|
* 查询对应id集合的记录
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,18 @@
|
||||||
WHERE delete_type = 0
|
WHERE delete_type = 0
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="listByEmployeeIds"
|
||||||
|
resultType="com.engine.salary.entity.siarchives.po.InsuranceArchivesBaseInfoPO">
|
||||||
|
SELECT
|
||||||
|
<include refid="baseColumns"/>
|
||||||
|
FROM hrsa_insurance_base_info t
|
||||||
|
WHERE delete_type = 0
|
||||||
|
AND employee_id IN
|
||||||
|
<foreach collection="employeeIds" open="(" item="employeeId" separator="," close=")">
|
||||||
|
#{employeeId}
|
||||||
|
</foreach>
|
||||||
|
</select>
|
||||||
|
|
||||||
<!-- 查询对应id的数据 -->
|
<!-- 查询对应id的数据 -->
|
||||||
<select id="listByIds" resultMap="BaseResultMap">
|
<select id="listByIds" resultMap="BaseResultMap">
|
||||||
SELECT
|
SELECT
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,9 @@ public class SalaryStatisticsEmployeeSalaryQueryParam extends BaseQueryParam {
|
||||||
// 关键字
|
// 关键字
|
||||||
private String keyword;
|
private String keyword;
|
||||||
|
|
||||||
|
//人员ids
|
||||||
|
private List<Long> employeeIds;
|
||||||
|
|
||||||
// 起始年月
|
// 起始年月
|
||||||
private String startDateStr;
|
private String startDateStr;
|
||||||
private Date startDate;
|
private Date startDate;
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
||||||
import com.engine.salary.enums.UserStatusEnum;
|
import com.engine.salary.enums.UserStatusEnum;
|
||||||
import com.engine.salary.enums.auth.AuthFilterTypeEnum;
|
import com.engine.salary.enums.auth.AuthFilterTypeEnum;
|
||||||
import com.engine.salary.enums.datacollection.UseEmployeeTypeEnum;
|
import com.engine.salary.enums.datacollection.UseEmployeeTypeEnum;
|
||||||
|
import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum;
|
||||||
import com.engine.salary.enums.salarysob.SalaryEmployeeStatusEnum;
|
import com.engine.salary.enums.salarysob.SalaryEmployeeStatusEnum;
|
||||||
import com.engine.salary.mapper.salaryacct.SalaryAcctEmployeeMapper;
|
import com.engine.salary.mapper.salaryacct.SalaryAcctEmployeeMapper;
|
||||||
import com.engine.salary.report.common.constant.SalaryConstant;
|
import com.engine.salary.report.common.constant.SalaryConstant;
|
||||||
|
|
@ -221,12 +222,23 @@ public class SalaryStatisticsEmployeeServiceImpl extends Service implements Sala
|
||||||
List<SalaryAcctRecordPO> salaryAcctRecordPOS = getSalaryAcctRecordService(user).listAll();
|
List<SalaryAcctRecordPO> salaryAcctRecordPOS = getSalaryAcctRecordService(user).listAll();
|
||||||
Map<Long, Integer> salaryAcctRecordMap = SalaryEntityUtil.convert2Map(salaryAcctRecordPOS, SalaryAcctRecordPO::getId, SalaryAcctRecordPO::getAcctTimes);
|
Map<Long, Integer> salaryAcctRecordMap = SalaryEntityUtil.convert2Map(salaryAcctRecordPOS, SalaryAcctRecordPO::getId, SalaryAcctRecordPO::getAcctTimes);
|
||||||
|
|
||||||
|
List<SalaryItemPO> salaryItemPOList = getSalaryItemService(user).listAll();
|
||||||
|
Map<Long, String> itemDataTypeMap = SalaryEntityUtil.convert2Map(salaryItemPOList, SalaryItemPO::getId, SalaryItemPO::getDataType);
|
||||||
|
|
||||||
|
|
||||||
Map<Long, List<SalaryAcctResultPO>> acctResultValueList = SalaryEntityUtil.group2Map(salaryStatisticsEmployeeDetailResult.getSalaryAcctResultValueList(), SalaryAcctResultPO::getSalaryAcctEmpId);
|
Map<Long, List<SalaryAcctResultPO>> acctResultValueList = SalaryEntityUtil.group2Map(salaryStatisticsEmployeeDetailResult.getSalaryAcctResultValueList(), SalaryAcctResultPO::getSalaryAcctEmpId);
|
||||||
Map<Long, Map<String, String>> acctResultValueMap = new HashMap<>();
|
Map<Long, Map<String, Object>> acctResultValueMap = new HashMap<>();
|
||||||
acctResultValueList.forEach((k, v) -> {
|
acctResultValueList.forEach((k, v) -> {
|
||||||
Map<String, String> map = new HashMap();
|
Map<String, Object> map = new HashMap();
|
||||||
v.forEach(l -> {
|
v.forEach(l -> {
|
||||||
map.put(l.getSalaryItemId() + "", l.getResultValue());
|
String dataType = itemDataTypeMap.getOrDefault(l.getSalaryItemId(), "string");
|
||||||
|
SalaryDataTypeEnum typeEnum = SalaryDataTypeEnum.parseByValue(dataType);
|
||||||
|
String resultValue = l.getResultValue();
|
||||||
|
if (typeEnum == SalaryDataTypeEnum.NUMBER && NumberUtil.isNumber(resultValue)) {
|
||||||
|
map.put(l.getSalaryItemId() + "", Double.valueOf(resultValue));
|
||||||
|
} else {
|
||||||
|
map.put(l.getSalaryItemId() + "", resultValue);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
acctResultValueMap.put(k, map);
|
acctResultValueMap.put(k, map);
|
||||||
});
|
});
|
||||||
|
|
@ -238,7 +250,7 @@ public class SalaryStatisticsEmployeeServiceImpl extends Service implements Sala
|
||||||
Map<String, Object> map;
|
Map<String, Object> map;
|
||||||
for (SalaryAcctEmployeePO se : salaryStatisticsEmployeeDetailResult.getSalaryAcctEmployeeList()) {
|
for (SalaryAcctEmployeePO se : salaryStatisticsEmployeeDetailResult.getSalaryAcctEmployeeList()) {
|
||||||
map = Maps.newHashMap();
|
map = Maps.newHashMap();
|
||||||
Map<String, String> resultValueMap = Optional.ofNullable(acctResultValueMap.get(se.getId())).orElse(Maps.newHashMap());
|
Map<String, Object> resultValueMap = Optional.ofNullable(acctResultValueMap.get(se.getId())).orElse(Maps.newHashMap());
|
||||||
Map<String, Object> finalMap = map;
|
Map<String, Object> finalMap = map;
|
||||||
resultValueMap.forEach((k, v) -> {
|
resultValueMap.forEach((k, v) -> {
|
||||||
finalMap.put(k + SalaryConstant.DYNAMIC_SUFFIX, v);
|
finalMap.put(k + SalaryConstant.DYNAMIC_SUFFIX, v);
|
||||||
|
|
@ -309,6 +321,13 @@ public class SalaryStatisticsEmployeeServiceImpl extends Service implements Sala
|
||||||
List<Long> employeeIds = employeeList.stream().map(DataCollectionEmployee::getEmployeeId).collect(Collectors.toList());
|
List<Long> employeeIds = employeeList.stream().map(DataCollectionEmployee::getEmployeeId).collect(Collectors.toList());
|
||||||
salaryAcctEmployeeList = salaryAcctEmployeeList.stream().filter(acctEmp -> employeeIds.contains(acctEmp.getEmployeeId())).collect(Collectors.toList());
|
salaryAcctEmployeeList = salaryAcctEmployeeList.stream().filter(acctEmp -> employeeIds.contains(acctEmp.getEmployeeId())).collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//人员浏览按钮筛选
|
||||||
|
List<Long> employeeIds = queryParam.getEmployeeIds();
|
||||||
|
if(CollectionUtils.isNotEmpty(employeeIds)){
|
||||||
|
salaryAcctEmployeeList = salaryAcctEmployeeList.stream().filter(acctEmp -> employeeIds.contains(acctEmp.getEmployeeId())).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
if (CollectionUtils.isEmpty(salaryAcctEmployeeList)) {
|
if (CollectionUtils.isEmpty(salaryAcctEmployeeList)) {
|
||||||
return new PageInfo<>();
|
return new PageInfo<>();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -108,12 +108,9 @@ public class SalaryStatisticsPushServiceImpl extends Service implements SalarySt
|
||||||
private List<Map<String, Object>> buildReportIdsOptions(Long employeeId) {
|
private List<Map<String, Object>> buildReportIdsOptions(Long employeeId) {
|
||||||
List<Map<String, Object>> reportIdsOptions = new ArrayList<>();
|
List<Map<String, Object>> reportIdsOptions = new ArrayList<>();
|
||||||
List<SalaryStatisticsReportPO> reportPOS = getSalaryStatisticsReportService(user).listAll();
|
List<SalaryStatisticsReportPO> reportPOS = getSalaryStatisticsReportService(user).listAll();
|
||||||
Boolean needAuth = getTaxAgentService(user).isNeedAuth((long) user.getUID());
|
// 只能够分享创建人是本人的报表
|
||||||
if (needAuth) {
|
reportPOS = reportPOS.stream().filter(po -> po.getCreator().compareTo(employeeId) == 0).collect(Collectors.toList());
|
||||||
// 只能够分享创建人是本人的报表
|
reportPOS.forEach(po -> {
|
||||||
reportPOS = reportPOS.stream().filter(po -> po.getCreator().compareTo(employeeId) == 0).collect(Collectors.toList());
|
|
||||||
}
|
|
||||||
reportPOS.forEach( po -> {
|
|
||||||
Map<String, Object> option = new HashMap<>();
|
Map<String, Object> option = new HashMap<>();
|
||||||
option.put("id", po.getId().toString());
|
option.put("id", po.getId().toString());
|
||||||
option.put("reportName", po.getReportName());
|
option.put("reportName", po.getReportName());
|
||||||
|
|
@ -129,10 +126,6 @@ public class SalaryStatisticsPushServiceImpl extends Service implements SalarySt
|
||||||
if (Objects.isNull(salaryStatisticsPushPO)) {
|
if (Objects.isNull(salaryStatisticsPushPO)) {
|
||||||
throw new SalaryRunTimeException("该分享记录不存在");
|
throw new SalaryRunTimeException("该分享记录不存在");
|
||||||
}
|
}
|
||||||
Boolean needAuth = getTaxAgentService(user).isNeedAuth((long) user.getUID());
|
|
||||||
if (needAuth && salaryStatisticsPushPO.getCreator().compareTo(Long.valueOf(user.getUID())) != 0) {
|
|
||||||
throw new SalaryRunTimeException("无权查看该分享记录");
|
|
||||||
}
|
|
||||||
SalaryStatisticsPushDetail result = new SalaryStatisticsPushDetail();
|
SalaryStatisticsPushDetail result = new SalaryStatisticsPushDetail();
|
||||||
result.setDetailForm(buildDetailForm(salaryStatisticsPushPO));
|
result.setDetailForm(buildDetailForm(salaryStatisticsPushPO));
|
||||||
result.setDetailTable(buildDetailTable(param));
|
result.setDetailTable(buildDetailTable(param));
|
||||||
|
|
@ -279,10 +272,10 @@ public class SalaryStatisticsPushServiceImpl extends Service implements SalarySt
|
||||||
List<SalaryStatisticsPushDetailPO> salaryStatisticsPushDetailPOS = getSalaryStatisticsPushDetailService(user).queryPushDetailPOByBatchIds(batchId);
|
List<SalaryStatisticsPushDetailPO> salaryStatisticsPushDetailPOS = getSalaryStatisticsPushDetailService(user).queryPushDetailPOByBatchIds(batchId);
|
||||||
salaryStatisticsPushDetailPOS.stream().filter(po -> Objects.equals(po.getPushStatus(), "true") && !(Objects.equals(po.getRebackStatus(), "true")) && Objects.equals(uid, po.getEmployeeId()))
|
salaryStatisticsPushDetailPOS.stream().filter(po -> Objects.equals(po.getPushStatus(), "true") && !(Objects.equals(po.getRebackStatus(), "true")) && Objects.equals(uid, po.getEmployeeId()))
|
||||||
.collect(Collectors.toList()).forEach(e -> {
|
.collect(Collectors.toList()).forEach(e -> {
|
||||||
e.setViewStatus("true");
|
e.setViewStatus("true");
|
||||||
e.setUpdateTime(new Date());
|
e.setUpdateTime(new Date());
|
||||||
getSalaryStatisticsPushDetailService(user).updateIgnoreNull(e);
|
getSalaryStatisticsPushDetailService(user).updateIgnoreNull(e);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Override
|
// @Override
|
||||||
|
|
@ -342,7 +335,6 @@ public class SalaryStatisticsPushServiceImpl extends Service implements SalarySt
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// public CancleMessageEntity buildCancelMessageEntity(SalaryStatisticsPushDetailPO po, Long employeeId, String tenantKey) {
|
// public CancleMessageEntity buildCancelMessageEntity(SalaryStatisticsPushDetailPO po, Long employeeId, String tenantKey) {
|
||||||
// SalaryStatisticsPushPO pushPO = salaryStatisticsPushMapper.selectById(po.getBatchId());
|
// SalaryStatisticsPushPO pushPO = salaryStatisticsPushMapper.selectById(po.getBatchId());
|
||||||
// CancleMessageEntity cancleMessageEntity = new CancleMessageEntity();
|
// CancleMessageEntity cancleMessageEntity = new CancleMessageEntity();
|
||||||
|
|
@ -650,7 +642,7 @@ public class SalaryStatisticsPushServiceImpl extends Service implements SalarySt
|
||||||
Boolean needAuth = getTaxAgentService(user).isNeedAuth((long) user.getUID());
|
Boolean needAuth = getTaxAgentService(user).isNeedAuth((long) user.getUID());
|
||||||
List<SalaryStatisticsPushPO> salaryStatisticsPushPOS;
|
List<SalaryStatisticsPushPO> salaryStatisticsPushPOS;
|
||||||
if (needAuth) {
|
if (needAuth) {
|
||||||
salaryStatisticsPushPOS = getSalaryStatisticsPushMapper().listSome(SalaryStatisticsPushPO.builder().creator(Long.valueOf(user.getUID())).build());
|
salaryStatisticsPushPOS = getSalaryStatisticsPushMapper().listSome(SalaryStatisticsPushPO.builder().creator((long) user.getUID()).build());
|
||||||
} else {
|
} else {
|
||||||
salaryStatisticsPushPOS = getSalaryStatisticsPushMapper().listSome(SalaryStatisticsPushPO.builder().build());
|
salaryStatisticsPushPOS = getSalaryStatisticsPushMapper().listSome(SalaryStatisticsPushPO.builder().build());
|
||||||
}
|
}
|
||||||
|
|
@ -729,7 +721,7 @@ public class SalaryStatisticsPushServiceImpl extends Service implements SalarySt
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
List<SalaryStatisticsPushPO> pushList = new ArrayList<>();
|
List<SalaryStatisticsPushPO> pushList = new ArrayList<>();
|
||||||
List<List<Long>> partition = Lists.partition((List<Long>)batchIds, 1000);
|
List<List<Long>> partition = Lists.partition((List<Long>) batchIds, 1000);
|
||||||
partition.forEach(ids -> {
|
partition.forEach(ids -> {
|
||||||
pushList.addAll(getSalaryStatisticsPushMapper().listSome(SalaryStatisticsPushPO.builder().ids(ids).build()));
|
pushList.addAll(getSalaryStatisticsPushMapper().listSome(SalaryStatisticsPushPO.builder().ids(ids).build()));
|
||||||
});
|
});
|
||||||
|
|
@ -739,13 +731,13 @@ public class SalaryStatisticsPushServiceImpl extends Service implements SalarySt
|
||||||
@Override
|
@Override
|
||||||
public List<SalaryStatisticsPushPO> getPushListByReportIdAndIds(Long reportId, List<Long> ids) {
|
public List<SalaryStatisticsPushPO> getPushListByReportIdAndIds(Long reportId, List<Long> ids) {
|
||||||
List<SalaryStatisticsPushPO> pushList = getSalaryStatisticsPushMapper().listByReportIdAndIds(reportId.toString(), ids);
|
List<SalaryStatisticsPushPO> pushList = getSalaryStatisticsPushMapper().listByReportIdAndIds(reportId.toString(), ids);
|
||||||
pushList = pushList.stream().filter( push -> {
|
pushList = pushList.stream().filter(push -> {
|
||||||
return Arrays.asList(push.getReportIds().split(",")).contains(reportId.toString());
|
return Arrays.asList(push.getReportIds().split(",")).contains(reportId.toString());
|
||||||
}).collect(Collectors.toList());
|
}).collect(Collectors.toList());
|
||||||
return pushList;
|
return pushList;
|
||||||
}
|
}
|
||||||
|
|
||||||
List<SalaryStatisticsPushPO> filterReportByTime(List<SalaryStatisticsPushPO> pushList){
|
List<SalaryStatisticsPushPO> filterReportByTime(List<SalaryStatisticsPushPO> pushList) {
|
||||||
// 报表分享时间校验
|
// 报表分享时间校验
|
||||||
String formatLocalDateTime = SalaryDateUtil.getFormatLocalDate(LocalDateTime.now());
|
String formatLocalDateTime = SalaryDateUtil.getFormatLocalDate(LocalDateTime.now());
|
||||||
List<SalaryStatisticsPushPO> result = pushList.stream().filter(pushPO -> {
|
List<SalaryStatisticsPushPO> result = pushList.stream().filter(pushPO -> {
|
||||||
|
|
@ -763,14 +755,14 @@ public class SalaryStatisticsPushServiceImpl extends Service implements SalarySt
|
||||||
List<SalaryStatisticsPushDetailPO> successPushDetailList = getSalaryStatisticsPushDetailService(user).getSuccessPushDetailListByReceiver(uid);
|
List<SalaryStatisticsPushDetailPO> successPushDetailList = getSalaryStatisticsPushDetailService(user).getSuccessPushDetailListByReceiver(uid);
|
||||||
// 根据报表id,分享批次id查询分享批次信息
|
// 根据报表id,分享批次id查询分享批次信息
|
||||||
List<Long> batchIds = successPushDetailList.stream().map(SalaryStatisticsPushDetailPO::getBatchId).collect(Collectors.toList());
|
List<Long> batchIds = successPushDetailList.stream().map(SalaryStatisticsPushDetailPO::getBatchId).collect(Collectors.toList());
|
||||||
List<SalaryStatisticsPushPO> pushList= getPushListByReportIdAndIds(reportId,batchIds);
|
List<SalaryStatisticsPushPO> pushList = getPushListByReportIdAndIds(reportId, batchIds);
|
||||||
if (CollectionUtils.isEmpty(pushList)) {
|
if (CollectionUtils.isEmpty(pushList)) {
|
||||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"暂无权限查看该报表"));
|
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "暂无权限查看该报表"));
|
||||||
}
|
}
|
||||||
// 校验是否在分享的有效时间内
|
// 校验是否在分享的有效时间内
|
||||||
pushList = filterReportByTime(pushList);
|
pushList = filterReportByTime(pushList);
|
||||||
if (CollectionUtils.isEmpty(pushList)) {
|
if (CollectionUtils.isEmpty(pushList)) {
|
||||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"该报表的分享不在有效期内,无法查看"));
|
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "该报表的分享不在有效期内,无法查看"));
|
||||||
}
|
}
|
||||||
return pushList;
|
return pushList;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -439,7 +439,7 @@ public class SalaryStatisticsReportWrapper extends Service {
|
||||||
Map<String, Object> countResultMap = (Map<String, Object>) result.get("countResult");
|
Map<String, Object> countResultMap = (Map<String, Object>) result.get("countResult");
|
||||||
List<Map<String, Object>> list = page.getList();
|
List<Map<String, Object>> list = page.getList();
|
||||||
// 获取数据
|
// 获取数据
|
||||||
List<Map<String, Object>> records = list.stream().map(m -> m.entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, e -> e.getValue()))).collect(Collectors.toList());
|
List<Map<String, Object>> records = list.stream().map(m -> m.entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, e -> e.getValue() == null ? "" : e.getValue()))).collect(Collectors.toList());
|
||||||
records.add(countResultMap);
|
records.add(countResultMap);
|
||||||
|
|
||||||
List rows = new ArrayList<>();
|
List rows = new ArrayList<>();
|
||||||
|
|
|
||||||
|
|
@ -44,11 +44,10 @@ public interface AddUpDeductionService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 下载模板
|
* 下载模板
|
||||||
* @param isChief
|
|
||||||
* @param queryParam
|
* @param queryParam
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
XSSFWorkbook downloadTemplate(boolean isChief,AddUpDeductionQueryParam queryParam);
|
XSSFWorkbook downloadTemplate(AddUpDeductionQueryParam queryParam);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package com.engine.salary.service;
|
package com.engine.salary.service;
|
||||||
|
|
||||||
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
||||||
|
import com.engine.salary.entity.extemp.dto.ExtEmpDTO;
|
||||||
import com.engine.salary.entity.extemp.param.ExtEmpImportParam;
|
import com.engine.salary.entity.extemp.param.ExtEmpImportParam;
|
||||||
import com.engine.salary.entity.extemp.param.ExtEmpQueryParam;
|
import com.engine.salary.entity.extemp.param.ExtEmpQueryParam;
|
||||||
import com.engine.salary.entity.extemp.param.ExtEmpSaveParam;
|
import com.engine.salary.entity.extemp.param.ExtEmpSaveParam;
|
||||||
|
|
@ -19,7 +20,7 @@ public interface ExtEmpService {
|
||||||
|
|
||||||
List<ExtEmpPO> list(ExtEmpQueryParam param);
|
List<ExtEmpPO> list(ExtEmpQueryParam param);
|
||||||
|
|
||||||
PageInfo<ExtEmpPO> listPage (ExtEmpQueryParam param);
|
PageInfo<ExtEmpDTO> listPage (ExtEmpQueryParam param);
|
||||||
|
|
||||||
void save(ExtEmpSaveParam po);
|
void save(ExtEmpSaveParam po);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -320,5 +320,9 @@ public interface SIAccountService {
|
||||||
void cacheWelfareField(List<String> welfareNames);
|
void cacheWelfareField(List<String> welfareNames);
|
||||||
|
|
||||||
void cacheBalanceWelfareField(List<String> welfareNames);
|
void cacheBalanceWelfareField(List<String> welfareNames);
|
||||||
|
|
||||||
|
void deleteSocialAcctEmp(SaveCommonAccountParam param);
|
||||||
|
|
||||||
|
String addSocialAcctEmp(SaveCommonAccountParam param);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ import com.engine.salary.enums.common.SalaryLogOperateTypeEnum;
|
||||||
import com.engine.salary.util.page.PageInfo;
|
import com.engine.salary.util.page.PageInfo;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
@ -169,6 +170,7 @@ public interface SalaryAcctResultService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 锁定单元格
|
* 锁定单元格
|
||||||
|
*
|
||||||
* @param param
|
* @param param
|
||||||
*/
|
*/
|
||||||
void lock(SalaryAcctResultLockParam param);
|
void lock(SalaryAcctResultLockParam param);
|
||||||
|
|
@ -189,8 +191,8 @@ public interface SalaryAcctResultService {
|
||||||
void batchUpdateOriginResultValue(List<SalaryAcctResultPO> salaryAcctResultValues);
|
void batchUpdateOriginResultValue(List<SalaryAcctResultPO> salaryAcctResultValues);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description 薪资回算
|
|
||||||
* @return void
|
* @return void
|
||||||
|
* @description 薪资回算
|
||||||
* @author Harryxzy
|
* @author Harryxzy
|
||||||
* @date 2022/11/24 20:26
|
* @date 2022/11/24 20:26
|
||||||
*/
|
*/
|
||||||
|
|
@ -206,8 +208,8 @@ public interface SalaryAcctResultService {
|
||||||
List<SalaryAcctResultPO> listBySalaryAcctRecordIdsAndSalaryItemIds(Collection<Long> salaryAcctRecordIds, Collection<Long> salaryItemIds);
|
List<SalaryAcctResultPO> listBySalaryAcctRecordIdsAndSalaryItemIds(Collection<Long> salaryAcctRecordIds, Collection<Long> salaryItemIds);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description 根据薪资核算人员id、薪资项目id获取薪资核算结果
|
|
||||||
* @return List<SalaryAesultPO>
|
* @return List<SalaryAesultPO>
|
||||||
|
* @description 根据薪资核算人员id、薪资项目id获取薪资核算结果
|
||||||
* @author Harryxzy
|
* @author Harryxzy
|
||||||
* @date 2022/12/26 22:24
|
* @date 2022/12/26 22:24
|
||||||
*/
|
*/
|
||||||
|
|
@ -217,6 +219,7 @@ public interface SalaryAcctResultService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 检查当前用户是否有查看权限
|
* 检查当前用户是否有查看权限
|
||||||
|
*
|
||||||
* @param salaryAcctRecordId
|
* @param salaryAcctRecordId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
@ -224,10 +227,21 @@ public interface SalaryAcctResultService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 薪资核算结果批量更新
|
* 薪资核算结果批量更新
|
||||||
|
*
|
||||||
* @param param
|
* @param param
|
||||||
*/
|
*/
|
||||||
void batchUpdate(SalaryAcctResultBatchUpdateParam param);
|
void batchUpdate(SalaryAcctResultBatchUpdateParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询指定账套月份的数据
|
||||||
|
* <p>Copyright: Copyright (c) 2024</p>
|
||||||
|
* <p>Company: 泛微软件</p>
|
||||||
|
*
|
||||||
|
* @author qiantao
|
||||||
|
* @version 1.0
|
||||||
|
**/
|
||||||
|
List<SalaryAcctResultPO> listBySobSalaryMonth(Date salaryMonth, Long salarySobId, List<Long> employeeIds);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 记录日志
|
* 记录日志
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@ public class AuthRoleServiceImpl extends Service implements AuthRoleService {
|
||||||
List<AuthRolePO> authRolePOS = getAuthRoleMapper().list(param);
|
List<AuthRolePO> authRolePOS = getAuthRoleMapper().list(param);
|
||||||
int total = authRolePOS.size();
|
int total = authRolePOS.size();
|
||||||
|
|
||||||
List<AuthRoleDTO> collect = SalaryPageUtil.subList(param.getCurrent(), param.getPageSize(), authRolePOS)
|
List<AuthRoleDTO> list = SalaryPageUtil.subList(param.getCurrent(), param.getPageSize(), authRolePOS)
|
||||||
.stream().map(po -> {
|
.stream().map(po -> {
|
||||||
Long roleId = po.getId();
|
Long roleId = po.getId();
|
||||||
AuthMemberQueryParam roleQueryParam = AuthMemberQueryParam.builder().roleId(roleId).build();
|
AuthMemberQueryParam roleQueryParam = AuthMemberQueryParam.builder().roleId(roleId).build();
|
||||||
|
|
@ -84,7 +84,8 @@ public class AuthRoleServiceImpl extends Service implements AuthRoleService {
|
||||||
.resources(authResources.size())
|
.resources(authResources.size())
|
||||||
.build();
|
.build();
|
||||||
}).collect(Collectors.toList());
|
}).collect(Collectors.toList());
|
||||||
PageInfo<AuthRoleDTO> pageInfo = SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), collect, AuthRoleDTO.class);
|
PageInfo<AuthRoleDTO> pageInfo = SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), AuthRoleDTO.class);
|
||||||
|
pageInfo.setList(list);
|
||||||
pageInfo.setTotal(total);
|
pageInfo.setTotal(total);
|
||||||
return pageInfo;
|
return pageInfo;
|
||||||
}
|
}
|
||||||
|
|
@ -92,7 +93,7 @@ public class AuthRoleServiceImpl extends Service implements AuthRoleService {
|
||||||
@Override
|
@Override
|
||||||
public AuthRoleDTO getRole(Long id) {
|
public AuthRoleDTO getRole(Long id) {
|
||||||
AuthRolePO po = getAuthRoleMapper().getById(id);
|
AuthRolePO po = getAuthRoleMapper().getById(id);
|
||||||
if (po == null){
|
if (po == null) {
|
||||||
throw new SalaryRunTimeException("业务线不存在");
|
throw new SalaryRunTimeException("业务线不存在");
|
||||||
}
|
}
|
||||||
Long roleId = po.getId();
|
Long roleId = po.getId();
|
||||||
|
|
@ -244,6 +245,6 @@ public class AuthRoleServiceImpl extends Service implements AuthRoleService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<AuthRolePO> listAll() {
|
public List<AuthRolePO> listAll() {
|
||||||
return getAuthRoleMapper().listAll();
|
return getAuthRoleMapper().listAll();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -61,10 +61,6 @@ public class AuthServiceImpl extends Service implements AuthService {
|
||||||
Boolean isOpenDevolution = getTaxAgentService(user).isOpenDevolution();
|
Boolean isOpenDevolution = getTaxAgentService(user).isOpenDevolution();
|
||||||
boolean isAuth = clazz.isAnnotationPresent(Auth.class);
|
boolean isAuth = clazz.isAnnotationPresent(Auth.class);
|
||||||
|
|
||||||
if (!isOpenDevolution || !isAuth) {
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
Auth auth = clazz.getAnnotation(Auth.class);
|
Auth auth = clazz.getAnnotation(Auth.class);
|
||||||
String taxAgentIdField = auth.taxAgentIdField();
|
String taxAgentIdField = auth.taxAgentIdField();
|
||||||
String taxAgentIdFieldGetter = "get" + taxAgentIdField.substring(0, 1).toUpperCase() + taxAgentIdField.substring(1);
|
String taxAgentIdFieldGetter = "get" + taxAgentIdField.substring(0, 1).toUpperCase() + taxAgentIdField.substring(1);
|
||||||
|
|
@ -76,6 +72,34 @@ public class AuthServiceImpl extends Service implements AuthService {
|
||||||
String optsFieldGetter = "get" + optsField.substring(0, 1).toUpperCase() + optsField.substring(1);
|
String optsFieldGetter = "get" + optsField.substring(0, 1).toUpperCase() + optsField.substring(1);
|
||||||
String optsFieldSetter = "set" + optsField.substring(0, 1).toUpperCase() + optsField.substring(1);
|
String optsFieldSetter = "set" + optsField.substring(0, 1).toUpperCase() + optsField.substring(1);
|
||||||
|
|
||||||
|
//不开启分权
|
||||||
|
if (!isOpenDevolution) {
|
||||||
|
if (filterType == AuthFilterTypeEnum.DATA_OPT) {
|
||||||
|
list.forEach(t -> {
|
||||||
|
try {
|
||||||
|
Method optsFieldGetterMethod = t.getClass().getMethod(optsFieldGetter);
|
||||||
|
Set<String> opts = (Set<String>) optsFieldGetterMethod.invoke(t);
|
||||||
|
if (opts == null) {
|
||||||
|
opts = new HashSet<>();
|
||||||
|
}
|
||||||
|
opts.add("query");
|
||||||
|
opts.add("admin");
|
||||||
|
|
||||||
|
Method optsFieldSetterMethod = t.getClass().getMethod(optsFieldSetter, Set.class);
|
||||||
|
optsFieldSetterMethod.invoke(t, opts);
|
||||||
|
} catch (NoSuchMethodException | InvocationTargetException | IllegalAccessException e) {
|
||||||
|
throw new SalaryRunTimeException(e);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
//未配置分权
|
||||||
|
if (!isAuth) {
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
//给总管理员赋值最大权限
|
//给总管理员赋值最大权限
|
||||||
Boolean isChief = getTaxAgentService(user).isChief((long) user.getUID());
|
Boolean isChief = getTaxAgentService(user).isChief((long) user.getUID());
|
||||||
if (isChief || filterType == AuthFilterTypeEnum.NO_AUTH) {
|
if (isChief || filterType == AuthFilterTypeEnum.NO_AUTH) {
|
||||||
|
|
|
||||||
|
|
@ -1006,18 +1006,8 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageInfo<AddUpDeductionRecordDTO> recordListPage(AddUpDeductionQueryParam queryParam) {
|
public PageInfo<AddUpDeductionRecordDTO> recordListPage(AddUpDeductionQueryParam queryParam) {
|
||||||
long employeeId = (long) user.getUID();
|
|
||||||
|
|
||||||
Boolean needAuth = getTaxAgentService(user).isNeedAuth(employeeId);
|
|
||||||
if (needAuth) {
|
|
||||||
List<Long> taxAgentIdsAsAdmin = getTaxAgentService(user).listAllTaxAgentsAsAdmin(employeeId).stream().map(TaxAgentPO::getId).collect(Collectors.toList());
|
|
||||||
if (CollectionUtils.isEmpty(taxAgentIdsAsAdmin)) {
|
|
||||||
return new PageInfo<>(AddUpDeductionRecordDTO.class);
|
|
||||||
}
|
|
||||||
queryParam.setTaxAgentIds(taxAgentIdsAsAdmin);
|
|
||||||
}
|
|
||||||
|
|
||||||
List<AddUpDeductionRecordDTO> list = getAddUpDeductionMapper().recordList(queryParam);
|
List<AddUpDeductionRecordDTO> list = getAddUpDeductionMapper().recordList(queryParam);
|
||||||
|
list = getAuthService(user).auth(list, AuthFilterTypeEnum.DATA_OPT, AddUpDeductionRecordDTO.class);
|
||||||
PageInfo<AddUpDeductionRecordDTO> page = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), list, AddUpDeductionRecordDTO.class);
|
PageInfo<AddUpDeductionRecordDTO> page = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), list, AddUpDeductionRecordDTO.class);
|
||||||
encryptUtil.decryptList(page.getList(), AddUpDeductionRecordDTO.class);
|
encryptUtil.decryptList(page.getList(), AddUpDeductionRecordDTO.class);
|
||||||
return page;
|
return page;
|
||||||
|
|
@ -1119,7 +1109,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public XSSFWorkbook downloadTemplate(boolean isChief, AddUpDeductionQueryParam queryParam) {
|
public XSSFWorkbook downloadTemplate(AddUpDeductionQueryParam queryParam) {
|
||||||
|
|
||||||
String sheetName = SalaryI18nUtil.getI18nLabel(101603, "累计专项附加扣除导入模板");
|
String sheetName = SalaryI18nUtil.getI18nLabel(101603, "累计专项附加扣除导入模板");
|
||||||
String[] header = {SalaryI18nUtil.getI18nLabel(85429, "姓名"), SalaryI18nUtil.getI18nLabel(86184, "个税扣缴义务人"), SalaryI18nUtil.getI18nLabel(86185, "部门"), SalaryI18nUtil.getI18nLabel(86186, "手机号"), SalaryI18nUtil.getI18nLabel(86317, "工号"), SalaryI18nUtil.getI18nLabel(86318, "证件号码"), SalaryI18nUtil.getI18nLabel(86319, "入职日期"), SalaryI18nUtil.getI18nLabel(86321, "累计子女教育"), SalaryI18nUtil.getI18nLabel(86323, "累计继续教育"), SalaryI18nUtil.getI18nLabel(86324, "累计住房贷款利息"), SalaryI18nUtil.getI18nLabel(86325, "累计住房租金"), SalaryI18nUtil.getI18nLabel(86326, "累计赡养老人"), SalaryI18nUtil.getI18nLabel(105142, "累计大病医疗"), SalaryI18nUtil.getI18nLabel(105142, "累计婴幼儿照护")};
|
String[] header = {SalaryI18nUtil.getI18nLabel(85429, "姓名"), SalaryI18nUtil.getI18nLabel(86184, "个税扣缴义务人"), SalaryI18nUtil.getI18nLabel(86185, "部门"), SalaryI18nUtil.getI18nLabel(86186, "手机号"), SalaryI18nUtil.getI18nLabel(86317, "工号"), SalaryI18nUtil.getI18nLabel(86318, "证件号码"), SalaryI18nUtil.getI18nLabel(86319, "入职日期"), SalaryI18nUtil.getI18nLabel(86321, "累计子女教育"), SalaryI18nUtil.getI18nLabel(86323, "累计继续教育"), SalaryI18nUtil.getI18nLabel(86324, "累计住房贷款利息"), SalaryI18nUtil.getI18nLabel(86325, "累计住房租金"), SalaryI18nUtil.getI18nLabel(86326, "累计赡养老人"), SalaryI18nUtil.getI18nLabel(105142, "累计大病医疗"), SalaryI18nUtil.getI18nLabel(105142, "累计婴幼儿照护")};
|
||||||
|
|
|
||||||
|
|
@ -374,7 +374,6 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private List<List<Object>> getExcelRowDetailList(AddUpSituationQueryParam param) {
|
private List<List<Object>> getExcelRowDetailList(AddUpSituationQueryParam param) {
|
||||||
long employeeId = user.getUID();
|
|
||||||
//excel标题
|
//excel标题
|
||||||
List<Object> title = Arrays.asList("姓名", "税款所属期", "个税扣缴义务人", "部门", "手机号", "工号", "累计收入额", "累计减除费用",
|
List<Object> title = Arrays.asList("姓名", "税款所属期", "个税扣缴义务人", "部门", "手机号", "工号", "累计收入额", "累计减除费用",
|
||||||
"累计社保个人合计", "累计公积金个人合计", "累计企业(职业)年金及其他福利", "累计其他扣除", "累计免税收入", "累计准予扣除的捐赠额", "累计减免税额",
|
"累计社保个人合计", "累计公积金个人合计", "累计企业(职业)年金及其他福利", "累计其他扣除", "累计免税收入", "累计准予扣除的捐赠额", "累计减免税额",
|
||||||
|
|
@ -383,15 +382,8 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
|
||||||
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM");
|
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM");
|
||||||
//查询详细信息
|
//查询详细信息
|
||||||
List<AddUpSituationRecordDTO> list = biz.recordList(param);
|
List<AddUpSituationRecordDTO> list = biz.recordList(param);
|
||||||
|
list = getAuthService(user).auth(list, AuthFilterTypeEnum.QUERY_DATA, AddUpSituationRecordDTO.class);
|
||||||
|
|
||||||
// 开启了分权
|
|
||||||
if (getTaxAgentService(user).isOpenDevolution() || !getTaxAgentService(user).isChief(employeeId)) {
|
|
||||||
List<Long> taxAgentIdsAsAdmin = getTaxAgentService(user).listAllTaxAgentsAsAdmin(employeeId).stream().map(TaxAgentPO::getId).collect(Collectors.toList());
|
|
||||||
list = list.stream().filter(f ->
|
|
||||||
// 作为管理员
|
|
||||||
taxAgentIdsAsAdmin.contains(f.getTaxAgentId())
|
|
||||||
).collect(Collectors.toList());
|
|
||||||
}
|
|
||||||
final List<List<Object>> dataRowList = Optional.ofNullable(list)
|
final List<List<Object>> dataRowList = Optional.ofNullable(list)
|
||||||
.map(List::stream)
|
.map(List::stream)
|
||||||
.map(operatorStream -> operatorStream.map(dto -> {
|
.map(operatorStream -> operatorStream.map(dto -> {
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import com.engine.core.impl.Service;
|
||||||
import com.engine.salary.config.SalaryElogConfig;
|
import com.engine.salary.config.SalaryElogConfig;
|
||||||
import com.engine.hrmelog.entity.dto.LoggerContext;
|
import com.engine.hrmelog.entity.dto.LoggerContext;
|
||||||
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
||||||
|
import com.engine.salary.entity.extemp.dto.ExtEmpDTO;
|
||||||
import com.engine.salary.entity.extemp.param.ExtEmpImportParam;
|
import com.engine.salary.entity.extemp.param.ExtEmpImportParam;
|
||||||
import com.engine.salary.entity.extemp.param.ExtEmpQueryParam;
|
import com.engine.salary.entity.extemp.param.ExtEmpQueryParam;
|
||||||
import com.engine.salary.entity.extemp.param.ExtEmpSaveParam;
|
import com.engine.salary.entity.extemp.param.ExtEmpSaveParam;
|
||||||
|
|
@ -83,9 +84,21 @@ public class ExtEmpServiceImpl extends Service implements ExtEmpService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageInfo<ExtEmpPO> listPage(ExtEmpQueryParam param) {
|
public PageInfo<ExtEmpDTO> listPage(ExtEmpQueryParam param) {
|
||||||
List<ExtEmpPO> extEmpPOS = list(param);
|
List<ExtEmpPO> extEmpPOS = list(param);
|
||||||
return SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), extEmpPOS, ExtEmpPO.class);
|
|
||||||
|
List<ExtEmpDTO> list = extEmpPOS.stream().map(po -> {
|
||||||
|
return ExtEmpDTO.builder()
|
||||||
|
.id(po.getId())
|
||||||
|
.username(po.getUsername())
|
||||||
|
.departmentName(po.getDepartmentName())
|
||||||
|
.subcompanyName(po.getSubcompanyName())
|
||||||
|
.companystartdate(po.getCompanystartdate())
|
||||||
|
.workcode(po.getWorkcode())
|
||||||
|
.build();
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
|
||||||
|
return SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), list, ExtEmpDTO.class);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -289,7 +289,7 @@ public class PushServiceImpl extends Service implements PushService {
|
||||||
List<Long> salaryAcctEmployeeIds = SalaryEntityUtil.properties(salaryAcctCalculateBO.getSalaryAcctEmployeePOS(), SalaryAcctEmployeePO::getId, Collectors.toList());
|
List<Long> salaryAcctEmployeeIds = SalaryEntityUtil.properties(salaryAcctCalculateBO.getSalaryAcctEmployeePOS(), SalaryAcctEmployeePO::getId, Collectors.toList());
|
||||||
List<SalaryAcctResultPO> salaryAcctResultPOS = getSalaryAcctResultService(user).listBySalaryAcctEmployeeIds(salaryAcctEmployeeIds);
|
List<SalaryAcctResultPO> salaryAcctResultPOS = getSalaryAcctResultService(user).listBySalaryAcctEmployeeIds(salaryAcctEmployeeIds);
|
||||||
|
|
||||||
CalculateFormulaVarBO calculateFormulaVarBO = new CalculateFormulaVarBO(simpleEmployees, new ArrayList<>(), new ArrayList<>(), new ArrayList<>(), new ArrayList<>(), new ArrayList<>(), new ArrayList<>(), salaryAcctResultPOS, new ArrayList<>());
|
CalculateFormulaVarBO calculateFormulaVarBO = new CalculateFormulaVarBO(simpleEmployees, new ArrayList<>(), new ArrayList<>(), new ArrayList<>(), new ArrayList<>(), new ArrayList<>(), new ArrayList<>(), salaryAcctResultPOS, new ArrayList<>(),new ArrayList<>());
|
||||||
Map<String, List<CalculateFormulaVarBO.FormulaVarValue>> formulaVarMap = calculateFormulaVarBO.convert2FormulaVar(salaryAcctCalculateBO);
|
Map<String, List<CalculateFormulaVarBO.FormulaVarValue>> formulaVarMap = calculateFormulaVarBO.convert2FormulaVar(salaryAcctCalculateBO);
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -403,7 +403,7 @@ public class PushServiceImpl extends Service implements PushService {
|
||||||
List<Long> salaryAcctEmployeeIds = SalaryEntityUtil.properties(salaryAcctCalculateBO.getSalaryAcctEmployeePOS(), SalaryAcctEmployeePO::getId, Collectors.toList());
|
List<Long> salaryAcctEmployeeIds = SalaryEntityUtil.properties(salaryAcctCalculateBO.getSalaryAcctEmployeePOS(), SalaryAcctEmployeePO::getId, Collectors.toList());
|
||||||
List<SalaryAcctResultPO> salaryAcctResultPOS = getSalaryAcctResultService(user).listBySalaryAcctEmployeeIds(salaryAcctEmployeeIds);
|
List<SalaryAcctResultPO> salaryAcctResultPOS = getSalaryAcctResultService(user).listBySalaryAcctEmployeeIds(salaryAcctEmployeeIds);
|
||||||
|
|
||||||
CalculateFormulaVarBO calculateFormulaVarBO = new CalculateFormulaVarBO(simpleEmployees, new ArrayList<>(), new ArrayList<>(), new ArrayList<>(), new ArrayList<>(), new ArrayList<>(), new ArrayList<>(), salaryAcctResultPOS, new ArrayList<>());
|
CalculateFormulaVarBO calculateFormulaVarBO = new CalculateFormulaVarBO(simpleEmployees, new ArrayList<>(), new ArrayList<>(), new ArrayList<>(), new ArrayList<>(), new ArrayList<>(), new ArrayList<>(), salaryAcctResultPOS, new ArrayList<>(), new ArrayList<>());
|
||||||
Map<String, List<CalculateFormulaVarBO.FormulaVarValue>> formulaVarMap = calculateFormulaVarBO.convert2FormulaVar(salaryAcctCalculateBO);
|
Map<String, List<CalculateFormulaVarBO.FormulaVarValue>> formulaVarMap = calculateFormulaVarBO.convert2FormulaVar(salaryAcctCalculateBO);
|
||||||
|
|
||||||
List<PushSettingPO> pushSettingPOS = getPushSettingMapper().listSome(PushSettingPO.builder().able(1).build());
|
List<PushSettingPO> pushSettingPOS = getPushSettingMapper().listSome(PushSettingPO.builder().able(1).build());
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,10 @@ import com.engine.salary.entity.salaryformula.po.FormulaVar;
|
||||||
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
||||||
import com.engine.salary.entity.salarysob.dto.SalarySobCycleDTO;
|
import com.engine.salary.entity.salarysob.dto.SalarySobCycleDTO;
|
||||||
import com.engine.salary.entity.salarysob.po.SalarySobItemPO;
|
import com.engine.salary.entity.salarysob.po.SalarySobItemPO;
|
||||||
|
import com.engine.salary.entity.taxagent.param.TaxAgentQueryParam;
|
||||||
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
||||||
import com.engine.salary.entity.taxrate.TaxRateBase;
|
import com.engine.salary.entity.taxrate.TaxRateBase;
|
||||||
|
import com.engine.salary.enums.auth.AuthFilterTypeEnum;
|
||||||
import com.engine.salary.enums.salaryformula.ReferenceTypeEnum;
|
import com.engine.salary.enums.salaryformula.ReferenceTypeEnum;
|
||||||
import com.engine.salary.enums.salaryformula.SalaryFormulaReferenceEnum;
|
import com.engine.salary.enums.salaryformula.SalaryFormulaReferenceEnum;
|
||||||
import com.engine.salary.enums.salaryformula.SalarySQLReferenceEnum;
|
import com.engine.salary.enums.salaryformula.SalarySQLReferenceEnum;
|
||||||
|
|
@ -141,6 +143,7 @@ public class RemoteExcelServiceImpl extends Service implements RemoteExcelServic
|
||||||
if (referenceEnum != null) {
|
if (referenceEnum != null) {
|
||||||
switch (referenceEnum) {
|
switch (referenceEnum) {
|
||||||
case SALARY_ITEM:
|
case SALARY_ITEM:
|
||||||
|
case LAST_MONTH_CALC:
|
||||||
case ISSUED:
|
case ISSUED:
|
||||||
vars = salaryItem2FormulaVar(referenceEnum, extendParam);
|
vars = salaryItem2FormulaVar(referenceEnum, extendParam);
|
||||||
break;
|
break;
|
||||||
|
|
@ -239,6 +242,8 @@ public class RemoteExcelServiceImpl extends Service implements RemoteExcelServic
|
||||||
if (ReferenceTypeEnum.FORMULA.equals(referenceTypeEnum)) {
|
if (ReferenceTypeEnum.FORMULA.equals(referenceTypeEnum)) {
|
||||||
result.put(SalaryFormulaReferenceEnum.SALARY_ITEM.getDefaultLabel(),
|
result.put(SalaryFormulaReferenceEnum.SALARY_ITEM.getDefaultLabel(),
|
||||||
salaryItem2FormulaVar(SalaryFormulaReferenceEnum.SALARY_ITEM, null));
|
salaryItem2FormulaVar(SalaryFormulaReferenceEnum.SALARY_ITEM, null));
|
||||||
|
result.put(SalaryFormulaReferenceEnum.LAST_MONTH_CALC.getDefaultLabel(),
|
||||||
|
salaryItem2FormulaVar(SalaryFormulaReferenceEnum.LAST_MONTH_CALC, null));
|
||||||
result.put(SalaryFormulaReferenceEnum.ISSUED.getDefaultLabel(),
|
result.put(SalaryFormulaReferenceEnum.ISSUED.getDefaultLabel(),
|
||||||
salaryItem2FormulaVar(SalaryFormulaReferenceEnum.ISSUED, null));
|
salaryItem2FormulaVar(SalaryFormulaReferenceEnum.ISSUED, null));
|
||||||
result.put(SalaryFormulaReferenceEnum.SALARY_ARCHIVES.getDefaultLabel(),
|
result.put(SalaryFormulaReferenceEnum.SALARY_ARCHIVES.getDefaultLabel(),
|
||||||
|
|
@ -365,9 +370,9 @@ public class RemoteExcelServiceImpl extends Service implements RemoteExcelServic
|
||||||
} else {
|
} else {
|
||||||
salaryItems = getSalaryItemService(user).listByIds(salaryItemIds);
|
salaryItems = getSalaryItemService(user).listByIds(salaryItemIds);
|
||||||
}
|
}
|
||||||
Set<Long> taxAgentIds = getTaxAgentService(user).listAllTaxAgents((long) user.getUID())
|
TaxAgentQueryParam param = TaxAgentQueryParam.builder().build();
|
||||||
.stream().map(TaxAgentPO::getId)
|
param.setFilterType(AuthFilterTypeEnum.QUERY_DATA);
|
||||||
.collect(Collectors.toSet());
|
Set<Long> taxAgentIds = getTaxAgentService(user).listAuth(param).stream().map(TaxAgentPO::getId).collect(Collectors.toSet());
|
||||||
return salaryItems.stream()
|
return salaryItems.stream()
|
||||||
//薪资项目取消过滤档案,使得导入功能一页面为准
|
//薪资项目取消过滤档案,使得导入功能一页面为准
|
||||||
// .filter(e -> e.getUseInEmployeeSalary() == 0)
|
// .filter(e -> e.getUseInEmployeeSalary() == 0)
|
||||||
|
|
@ -397,8 +402,10 @@ public class RemoteExcelServiceImpl extends Service implements RemoteExcelServic
|
||||||
} else {
|
} else {
|
||||||
salaryItems = getSalaryItemService(user).listByIds(salaryItemIds);
|
salaryItems = getSalaryItemService(user).listByIds(salaryItemIds);
|
||||||
}
|
}
|
||||||
Set<Long> taxAgentIds = getTaxAgentService(user).listAllTaxAgents((long) user.getUID())
|
|
||||||
.stream().map(TaxAgentPO::getId).collect(Collectors.toSet());
|
TaxAgentQueryParam param = TaxAgentQueryParam.builder().build();
|
||||||
|
param.setFilterType(AuthFilterTypeEnum.QUERY_DATA);
|
||||||
|
Set<Long> taxAgentIds = getTaxAgentService(user).listAuth(param).stream().map(TaxAgentPO::getId).collect(Collectors.toSet());
|
||||||
return salaryItems.stream()
|
return salaryItems.stream()
|
||||||
.filter(e -> e.getUseInEmployeeSalary() == 1)
|
.filter(e -> e.getUseInEmployeeSalary() == 1)
|
||||||
.filter(e-> getSalaryItemService(user).filterInRange(taxAgentIds, e))
|
.filter(e-> getSalaryItemService(user).filterInRange(taxAgentIds, e))
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@ import com.engine.salary.entity.siexport.param.InsuranceExportParam;
|
||||||
import com.engine.salary.entity.siexport.po.AccountExportPO;
|
import com.engine.salary.entity.siexport.po.AccountExportPO;
|
||||||
import com.engine.salary.entity.sischeme.po.InsuranceSchemeDetailPO;
|
import com.engine.salary.entity.sischeme.po.InsuranceSchemeDetailPO;
|
||||||
import com.engine.salary.entity.sischeme.po.InsuranceSchemePO;
|
import com.engine.salary.entity.sischeme.po.InsuranceSchemePO;
|
||||||
|
import com.engine.salary.entity.taxagent.param.TaxAgentQueryParam;
|
||||||
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
||||||
import com.engine.salary.enums.OperateTypeEnum;
|
import com.engine.salary.enums.OperateTypeEnum;
|
||||||
import com.engine.salary.enums.UserStatusEnum;
|
import com.engine.salary.enums.UserStatusEnum;
|
||||||
|
|
@ -398,19 +399,6 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
|
||||||
Long employeeId = (long) user.getUID();
|
Long employeeId = (long) user.getUID();
|
||||||
Map<String, Object> datas = new HashMap<>();
|
Map<String, Object> datas = new HashMap<>();
|
||||||
|
|
||||||
// 分权逻辑
|
|
||||||
Boolean needAuth = getTaxAgentService(user).isNeedAuth((long) user.getUID());
|
|
||||||
if (needAuth) {
|
|
||||||
Collection<TaxAgentPO> taxAgentPOS = getTaxAgentService(user).listAllTaxAgents((long) user.getUID());
|
|
||||||
List<Long> taxAgents = taxAgentPOS.stream().map(TaxAgentPO::getId).collect(Collectors.toList());
|
|
||||||
if (CollectionUtils.isEmpty(taxAgents)) {
|
|
||||||
//防止普通用户查询
|
|
||||||
queryParam.setTaxAgents(Collections.singletonList(-1L));
|
|
||||||
} else {
|
|
||||||
queryParam.setTaxAgents(taxAgents);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//退差列表
|
//退差列表
|
||||||
queryParam.setPaymentStatus(PaymentStatusEnum.RECESSION.getValue());
|
queryParam.setPaymentStatus(PaymentStatusEnum.RECESSION.getValue());
|
||||||
|
|
||||||
|
|
@ -458,19 +446,6 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
|
||||||
Long employeeId = (long) user.getUID();
|
Long employeeId = (long) user.getUID();
|
||||||
Map<String, Object> datas = new HashMap<>();
|
Map<String, Object> datas = new HashMap<>();
|
||||||
|
|
||||||
// 分权逻辑
|
|
||||||
Boolean needAuth = getTaxAgentService(user).isNeedAuth((long) user.getUID());
|
|
||||||
if (needAuth) {
|
|
||||||
Collection<TaxAgentPO> taxAgentPOS = getTaxAgentService(user).listAllTaxAgents((long) user.getUID());
|
|
||||||
List<Long> taxAgents = taxAgentPOS.stream().map(TaxAgentPO::getId).collect(Collectors.toList());
|
|
||||||
if (CollectionUtils.isEmpty(taxAgents)) {
|
|
||||||
//防止普通用户查询
|
|
||||||
queryParam.setTaxAgents(Collections.singletonList(-1L));
|
|
||||||
} else {
|
|
||||||
queryParam.setTaxAgents(taxAgents);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//补差列表
|
//补差列表
|
||||||
queryParam.setPaymentStatus(PaymentStatusEnum.BALANCE.getValue());
|
queryParam.setPaymentStatus(PaymentStatusEnum.BALANCE.getValue());
|
||||||
|
|
||||||
|
|
@ -1514,7 +1489,9 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Collection<TaxAgentPO> getAdminTaxAgentList() {
|
public Collection<TaxAgentPO> getAdminTaxAgentList() {
|
||||||
return getTaxAgentService(user).listAllTaxAgentsAsAdmin((long) user.getUID());
|
TaxAgentQueryParam param = TaxAgentQueryParam.builder().build();
|
||||||
|
param.setFilterType(AuthFilterTypeEnum.ADMIN_DATA);
|
||||||
|
return getTaxAgentService(user).listAuth(param);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -4223,18 +4200,6 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
|
||||||
Long employeeId = (long) user.getUID();
|
Long employeeId = (long) user.getUID();
|
||||||
Map<String, Object> datas = new HashMap<>();
|
Map<String, Object> datas = new HashMap<>();
|
||||||
queryParam.setPageSize(10000000);
|
queryParam.setPageSize(10000000);
|
||||||
// 分权逻辑
|
|
||||||
Boolean needAuth = getTaxAgentService(user).isNeedAuth((long) user.getUID());
|
|
||||||
if (needAuth) {
|
|
||||||
Collection<TaxAgentPO> taxAgentPOS = getTaxAgentService(user).listAllTaxAgents((long) user.getUID());
|
|
||||||
List<Long> taxAgents = taxAgentPOS.stream().map(TaxAgentPO::getId).collect(Collectors.toList());
|
|
||||||
if (CollectionUtils.isEmpty(taxAgents)) {
|
|
||||||
//防止普通用户查询
|
|
||||||
queryParam.setTaxAgents(Collections.singletonList(-1L));
|
|
||||||
} else {
|
|
||||||
queryParam.setTaxAgents(taxAgents);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//退差列表
|
//退差列表
|
||||||
queryParam.setPaymentStatus(PaymentStatusEnum.RECESSION.getValue());
|
queryParam.setPaymentStatus(PaymentStatusEnum.RECESSION.getValue());
|
||||||
|
|
@ -4261,18 +4226,6 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
|
||||||
Long employeeId = (long) user.getUID();
|
Long employeeId = (long) user.getUID();
|
||||||
Map<String, Object> datas = new HashMap<>();
|
Map<String, Object> datas = new HashMap<>();
|
||||||
queryParam.setPageSize(10000000);
|
queryParam.setPageSize(10000000);
|
||||||
// 分权逻辑
|
|
||||||
Boolean needAuth = getTaxAgentService(user).isNeedAuth((long) user.getUID());
|
|
||||||
if (needAuth) {
|
|
||||||
Collection<TaxAgentPO> taxAgentPOS = getTaxAgentService(user).listAllTaxAgents((long) user.getUID());
|
|
||||||
List<Long> taxAgents = taxAgentPOS.stream().map(TaxAgentPO::getId).collect(Collectors.toList());
|
|
||||||
if (CollectionUtils.isEmpty(taxAgents)) {
|
|
||||||
//防止普通用户查询
|
|
||||||
queryParam.setTaxAgents(Collections.singletonList(-1L));
|
|
||||||
} else {
|
|
||||||
queryParam.setTaxAgents(taxAgents);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//补差列表
|
//补差列表
|
||||||
queryParam.setPaymentStatus(PaymentStatusEnum.BALANCE.getValue());
|
queryParam.setPaymentStatus(PaymentStatusEnum.BALANCE.getValue());
|
||||||
|
|
@ -4970,6 +4923,15 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
|
||||||
validIds.addAll(emp2);
|
validIds.addAll(emp2);
|
||||||
validIds.addAll(emp3);
|
validIds.addAll(emp3);
|
||||||
|
|
||||||
|
if (!param.isFlag()) {
|
||||||
|
// 不是首次创建核算 还需要添加历史核算人员
|
||||||
|
List<InsuranceAccountDetailPO> insuranceAccountDetailPOS = getInsuranceAccountDetailMapper().selectList(param.getBillMonth(), param.getPaymentOrganization());
|
||||||
|
List<Long> historyEmpIds = insuranceAccountDetailPOS.stream().filter(po -> po.getPaymentStatus().equals(PaymentStatusEnum.COMMON.getValue())).map(InsuranceAccountDetailPO::getEmployeeId).collect(Collectors.toList());
|
||||||
|
validIds.addAll(historyEmpIds);
|
||||||
|
List<Long> finalEmpIds = empIds;
|
||||||
|
empIds.addAll(historyEmpIds.stream().filter(empId -> !finalEmpIds.contains(empId)).collect(Collectors.toList()));
|
||||||
|
}
|
||||||
|
|
||||||
List<Long> finalValidIds = validIds.stream().distinct().collect(Collectors.toList());
|
List<Long> finalValidIds = validIds.stream().distinct().collect(Collectors.toList());
|
||||||
ids = empIds.stream().filter(finalValidIds::contains).collect(Collectors.toList());
|
ids = empIds.stream().filter(finalValidIds::contains).collect(Collectors.toList());
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -5027,14 +4989,11 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
|
||||||
Map<Long, InsuranceArchivesAccountPO> insuranceArchivesAccountPOS = getSIArchivesService(user).buildBatchAccount(ids, paymentOrganization);
|
Map<Long, InsuranceArchivesAccountPO> insuranceArchivesAccountPOS = getSIArchivesService(user).buildBatchAccount(ids, paymentOrganization);
|
||||||
List<InsuranceAccountDetailPO> historyDetailData = new ArrayList<>();
|
List<InsuranceAccountDetailPO> historyDetailData = new ArrayList<>();
|
||||||
List<DataCollectionEmployee> employeeList = getSalaryEmployeeService(user).listByIds(ids);
|
List<DataCollectionEmployee> employeeList = getSalaryEmployeeService(user).listByIds(ids);
|
||||||
if (!isFirstFlag) {
|
List<List<Long>> partition = Lists.partition(ids, 100);
|
||||||
// 不是首次核算,需要把社保历史数据取出
|
partition.forEach(part -> {
|
||||||
List<List<Long>> partition = Lists.partition(ids, 100);
|
historyDetailData.addAll(getInsuranceAccountDetailMapper().list(InsuranceAccountDetailParam.builder().billMonth(billMonth).paymentOrganization(paymentOrganization.toString()).employeeIds(part).build()));
|
||||||
partition.forEach(part -> {
|
historyDetailData.addAll(getInsuranceAccountDetailMapper().extList(InsuranceAccountDetailParam.builder().billMonth(billMonth).paymentOrganization(paymentOrganization.toString()).employeeIds(part).build()));
|
||||||
historyDetailData.addAll(getInsuranceAccountDetailMapper().list(InsuranceAccountDetailParam.builder().billMonth(billMonth).paymentOrganization(paymentOrganization.toString()).employeeIds(part).build()));
|
});
|
||||||
historyDetailData.addAll(getInsuranceAccountDetailMapper().extList(InsuranceAccountDetailParam.builder().billMonth(billMonth).paymentOrganization(paymentOrganization.toString()).employeeIds(part).build()));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
Map<Long, InsuranceAccountDetailPO> historyDetailDataMap = SalaryEntityUtil.convert2Map(historyDetailData, InsuranceAccountDetailPO::getEmployeeId);
|
Map<Long, InsuranceAccountDetailPO> historyDetailDataMap = SalaryEntityUtil.convert2Map(historyDetailData, InsuranceAccountDetailPO::getEmployeeId);
|
||||||
Map<Long, DataCollectionEmployee> employeeMap = SalaryEntityUtil.convert2Map(employeeList, DataCollectionEmployee::getEmployeeId);
|
Map<Long, DataCollectionEmployee> employeeMap = SalaryEntityUtil.convert2Map(employeeList, DataCollectionEmployee::getEmployeeId);
|
||||||
|
|
||||||
|
|
@ -5110,14 +5069,18 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
|
||||||
|
|
||||||
}
|
}
|
||||||
//临时表入库前先对(可能存在的)历史数据进行删除
|
//临时表入库前先对(可能存在的)历史数据进行删除
|
||||||
// List<List<Long>> partition = Lists.partition((List<Long>) ids, 100);
|
partition.forEach(part -> {
|
||||||
// partition.forEach(part -> {
|
getSIAccountDetailTempMapper().batchDelByEmpIdsAndMonthAndPayOrg(part, billMonth, paymentOrganization);
|
||||||
// getSIAccountDetailTempMapper().batchDelByEmpIdsAndMonthAndPayOrg(part, billMonth, paymentOrganization);
|
});
|
||||||
// });
|
// // 根据人员id删,会少删不再参与社保核算的人。
|
||||||
// 根据人员id删,会少删不再参与社保核算的人。
|
// getSIAccountDetailTempMapper().batchDelByMonthAndPayOrg(billMonth, paymentOrganization);
|
||||||
getSIAccountDetailTempMapper().batchDelByMonthAndPayOrg(billMonth, paymentOrganization);
|
|
||||||
//临时表数据入库
|
//临时表数据入库
|
||||||
if (CollectionUtils.isNotEmpty(list)) {
|
if (CollectionUtils.isNotEmpty(list)) {
|
||||||
|
if (!isFirstFlag) {
|
||||||
|
// 点击台账内的核算按钮,核算人员不变(不增加人)
|
||||||
|
List<String> existDataKey = historyDetailData.stream().map(po -> po.getPaymentOrganization() + "_" + po.getEmployeeId()).collect(Collectors.toList());
|
||||||
|
list = list.stream().filter(po -> existDataKey.contains(po.getPaymentOrganization() + "_" + po.getEmployeeId())).collect(Collectors.toList());
|
||||||
|
}
|
||||||
encryptUtil.encryptList(list, InsuranceAccountDetailTempPO.class);
|
encryptUtil.encryptList(list, InsuranceAccountDetailTempPO.class);
|
||||||
List<List<InsuranceAccountDetailTempPO>> lists = splitList(list, 20);
|
List<List<InsuranceAccountDetailTempPO>> lists = splitList(list, 20);
|
||||||
lists.forEach(subList -> {
|
lists.forEach(subList -> {
|
||||||
|
|
@ -6842,4 +6805,188 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
|
||||||
|
|
||||||
/*****以上代码为SIAccountBiz中方法逻辑迁移,旨在减少Biz类的使用*****/
|
/*****以上代码为SIAccountBiz中方法逻辑迁移,旨在减少Biz类的使用*****/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 正常缴纳页 删除社保核算人员
|
||||||
|
* @param param
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void deleteSocialAcctEmp(SaveCommonAccountParam param) {
|
||||||
|
if (StringUtils.isBlank(param.getBillMonth()) || param.getPaymentOrganization() == null) {
|
||||||
|
throw new SalaryRunTimeException("参数错误");
|
||||||
|
}
|
||||||
|
if (CollectionUtils.isEmpty(param.getIds())) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
List<InsuranceAccountDetailPO> insuranceAccountDetailPOS = getInsuranceAccountDetailMapper().selectList(param.getBillMonth(), param.getPaymentOrganization());
|
||||||
|
insuranceAccountDetailPOS = insuranceAccountDetailPOS.stream().filter(detailPO -> param.getIds().contains(detailPO.getId())).collect(Collectors.toList());
|
||||||
|
List<Long> deleteEmployeeIds = insuranceAccountDetailPOS.stream().map(InsuranceAccountDetailPO::getEmployeeId).collect(Collectors.toList());
|
||||||
|
deleteAccountDetailsByEmpIds(deleteEmployeeIds, param.getBillMonth(), param.getPaymentOrganization());
|
||||||
|
if (CollectionUtils.isNotEmpty(deleteEmployeeIds)) {
|
||||||
|
// 重新计算合计值
|
||||||
|
updateBatchAccount((AccountParam.builder().billMonth(param.getBillMonth()).paymentOrganization(param.getPaymentOrganization())).build());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void deleteAccountDetailsByEmpIds(List<Long> deleteEmployeeIds, String billMonth, Long paymentOrganization) {
|
||||||
|
if (CollectionUtils.isNotEmpty(deleteEmployeeIds)) {
|
||||||
|
List<List<Long>> partition = Lists.partition(deleteEmployeeIds, 100);
|
||||||
|
partition.forEach(part -> {
|
||||||
|
// 删除该台账下,员工的所有数据
|
||||||
|
getInsuranceAccountDetailMapper().deleteByEmpIds(part, billMonth, paymentOrganization);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 正常缴纳页 添加社保核算人员
|
||||||
|
* @param param
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String addSocialAcctEmp(SaveCommonAccountParam param) {
|
||||||
|
if (StringUtils.isBlank(param.getBillMonth()) || param.getPaymentOrganization() == null) {
|
||||||
|
throw new SalaryRunTimeException("参数错误");
|
||||||
|
}
|
||||||
|
if (CollectionUtils.isEmpty(param.getIncludes())) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
InsuranceAccountBatchPO insuranceAccountBatchPO = getInsuranceAccountBatchMapper().getByBillMonth(param.getBillMonth(), param.getPaymentOrganization());
|
||||||
|
if (insuranceAccountBatchPO == null) {
|
||||||
|
throw new SalaryRunTimeException("台账不存在或已被删除");
|
||||||
|
}
|
||||||
|
// 校验是否可以添加这些员工
|
||||||
|
List<Long> empIds = param.getIncludes();
|
||||||
|
List<Long> validIds = new ArrayList<>();
|
||||||
|
|
||||||
|
// 获取当前台账已经存在的人员
|
||||||
|
List<InsuranceAccountDetailPO> insuranceAccountDetailPOS = getInsuranceAccountDetailMapper().queryNormalListByBillMonth(param.getBillMonth(), param.getPaymentOrganization());
|
||||||
|
List<Long> existEmpIds = insuranceAccountDetailPOS.stream().map(InsuranceAccountDetailPO::getEmployeeId).collect(Collectors.toList());
|
||||||
|
Optional<Long> existOptional = empIds.stream().filter(existEmpIds::contains).findFirst();
|
||||||
|
if (existOptional.isPresent()) {
|
||||||
|
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(101581, "人员已存在,请勿重复添加"));
|
||||||
|
}
|
||||||
|
|
||||||
|
//过滤出需要核算的人员,即福利档案基础信息表中runStatus为正在缴纳和待减员的人员
|
||||||
|
List<InsuranceArchivesBaseInfoPO> baseInfoPOList = getInsuranceBaseInfoMapper().listByEmployeeIds(empIds);
|
||||||
|
List<Long> canAccountIds = baseInfoPOList.stream()
|
||||||
|
.filter(f->f.getPaymentOrganization().equals(param.getPaymentOrganization()))
|
||||||
|
.map(InsuranceArchivesBaseInfoPO::getEmployeeId)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
|
//20231122逻辑优化,过滤出不在起始缴纳月和最后缴纳月区间的人员
|
||||||
|
List<Long> empIdsInPayMonthRange = listCanPayEmpIds(param.getPaymentOrganization(), param.getBillMonth());
|
||||||
|
empIds = empIds.stream().filter(f->canAccountIds.contains(f) && empIdsInPayMonthRange.contains(f)).collect(Collectors.toList());
|
||||||
|
|
||||||
|
List<InsuranceArchivesSocialSchemePO> socials = getSIArchivesService(user).getSocialByEmployeeIds(empIds);
|
||||||
|
//过滤出目标个税扣缴义务人相关信息
|
||||||
|
socials = socials.stream().filter(f -> f.getPaymentOrganization().equals(param.getPaymentOrganization())).collect(Collectors.toList());
|
||||||
|
List<Long> emp1 = socials.stream()
|
||||||
|
.filter(s -> !(StringUtils.isBlank(s.getSocialEndTime()) && StringUtils.isBlank(s.getSocialStartTime())) &&
|
||||||
|
(StringUtils.isBlank(s.getSocialEndTime()) || (SalaryDateUtil.stringToDate(s.getSocialEndTime() + "-01") != null && !SalaryDateUtil.stringToDate(param.getBillMonth() + "-01").after(SalaryDateUtil.stringToDate(s.getSocialEndTime() + "-01")))) )
|
||||||
|
.map(InsuranceArchivesSocialSchemePO::getEmployeeId)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
|
List<InsuranceArchivesFundSchemePO> funds = getSIArchivesService(user).getFundByEmployeeIds(empIds);
|
||||||
|
//过滤出目标个税扣缴义务人相关信息
|
||||||
|
funds = funds.stream().filter(f -> f.getPaymentOrganization().equals(param.getPaymentOrganization())).collect(Collectors.toList());
|
||||||
|
List<Long> emp2 = funds.stream()
|
||||||
|
.filter(s -> !(StringUtils.isBlank(s.getFundStartTime()) && StringUtils.isBlank(s.getFundEndTime())) &&
|
||||||
|
(StringUtils.isBlank(s.getFundEndTime()) || (SalaryDateUtil.stringToDate(s.getFundEndTime() + "-01") != null && !SalaryDateUtil.stringToDate(param.getBillMonth() + "-01").after(SalaryDateUtil.stringToDate(s.getFundEndTime() + "-01")))))
|
||||||
|
.map(InsuranceArchivesFundSchemePO::getEmployeeId)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
|
List<InsuranceArchivesOtherSchemePO> others = getSIArchivesService(user).getOtherByEmployeeIds(empIds);
|
||||||
|
//过滤出目标个税扣缴义务人相关信息
|
||||||
|
others = others.stream().filter(f -> f.getPaymentOrganization().equals(param.getPaymentOrganization())).collect(Collectors.toList());
|
||||||
|
List<Long> emp3 = others.stream()
|
||||||
|
.filter(s -> !(StringUtils.isBlank(s.getOtherStartTime()) && StringUtils.isBlank(s.getOtherEndTime())) &&
|
||||||
|
(StringUtils.isBlank(s.getOtherEndTime()) || (SalaryDateUtil.stringToDate(s.getOtherEndTime() + "-01") != null && !SalaryDateUtil.stringToDate(param.getBillMonth() + "-01").after(SalaryDateUtil.stringToDate(s.getOtherEndTime() + "-01")))))
|
||||||
|
.map(InsuranceArchivesOtherSchemePO::getEmployeeId)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
validIds.addAll(emp1);
|
||||||
|
validIds.addAll(emp2);
|
||||||
|
validIds.addAll(emp3);
|
||||||
|
List<Long> finalValidIds = validIds.stream().distinct().collect(Collectors.toList());
|
||||||
|
List<Long> conNotAddEmpIds = param.getIncludes().stream().filter(empId -> !finalValidIds.contains(empId)).collect(Collectors.toList());
|
||||||
|
if (CollectionUtils.isNotEmpty(conNotAddEmpIds)) {
|
||||||
|
String canNotAddName = getSalaryEmployeeService(user).listByIds(conNotAddEmpIds).stream().map(DataCollectionEmployee::getUsername).collect(Collectors.joining(","));
|
||||||
|
throw new SalaryRunTimeException("添加失败,员工:" +canNotAddName + ",社保、公积金、其他福利需至少有一种在当前账单月需缴纳,并且社保档案需为在缴员工");
|
||||||
|
}
|
||||||
|
|
||||||
|
addCommonEmpAndAccount(param.getBillMonth(), empIds, param.getPaymentOrganization());
|
||||||
|
return "success";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加正常缴纳人员,并核算
|
||||||
|
* @param billMonth
|
||||||
|
* @param ids
|
||||||
|
* @param paymentOrganization
|
||||||
|
*/
|
||||||
|
public void addCommonEmpAndAccount(String billMonth, List<Long> ids, Long paymentOrganization) {
|
||||||
|
Map<Long, InsuranceArchivesAccountPO> insuranceArchivesAccountPOS = getSIArchivesService(user).buildBatchAccount(ids, paymentOrganization);
|
||||||
|
List<DataCollectionEmployee> employeeList = getSalaryEmployeeService(user).listByIds(ids);
|
||||||
|
Map<Long, DataCollectionEmployee> employeeMap = SalaryEntityUtil.convert2Map(employeeList, DataCollectionEmployee::getEmployeeId);
|
||||||
|
|
||||||
|
List<InsuranceAccountDetailTempPO> list = new ArrayList<>();
|
||||||
|
for (Map.Entry<Long, InsuranceArchivesAccountPO> entry : insuranceArchivesAccountPOS.entrySet()) {
|
||||||
|
Long k = entry.getKey();
|
||||||
|
InsuranceArchivesAccountPO v = entry.getValue();
|
||||||
|
InsuranceAccountDetailPO insuranceAccountDetailPO = new InsuranceAccountDetailPO();
|
||||||
|
insuranceAccountDetailPO.setBillMonth(billMonth);
|
||||||
|
insuranceAccountDetailPO.setBillStatus(BillStatusEnum.NOT_ARCHIVED.getValue());
|
||||||
|
insuranceAccountDetailPO.setCreator((long) user.getUID());
|
||||||
|
insuranceAccountDetailPO.setCreateTime(new Date());
|
||||||
|
insuranceAccountDetailPO.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue());
|
||||||
|
insuranceAccountDetailPO.setEmployeeId(k);
|
||||||
|
insuranceAccountDetailPO.setUpdateTime(new Date());
|
||||||
|
insuranceAccountDetailPO.setPaymentStatus(PaymentStatusEnum.COMMON.getValue());
|
||||||
|
insuranceAccountDetailPO.setResourceFrom(ResourceFromEnum.SYSTEM.getValue());
|
||||||
|
insuranceAccountDetailPO.setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY);
|
||||||
|
insuranceAccountDetailPO.setPaymentOrganization(paymentOrganization);
|
||||||
|
|
||||||
|
DataCollectionEmployee employee = employeeMap.get(k);
|
||||||
|
if (employee != null) {
|
||||||
|
insuranceAccountDetailPO.setSubcompanyName(employee.getSubcompanyName());
|
||||||
|
insuranceAccountDetailPO.setSubcompanyId(employee.getSubcompanyid());
|
||||||
|
insuranceAccountDetailPO.setDepartmentName(employee.getDepartmentName());
|
||||||
|
insuranceAccountDetailPO.setDepartmentId(employee.getDepartmentId());
|
||||||
|
insuranceAccountDetailPO.setJobtitleName(employee.getJobtitleName());
|
||||||
|
insuranceAccountDetailPO.setJobtitleId(employee.getJobtitleId());
|
||||||
|
insuranceAccountDetailPO.setJobcall(employee.getJobcall());
|
||||||
|
insuranceAccountDetailPO.setJobcallId(employee.getJobcallId());
|
||||||
|
insuranceAccountDetailPO.setStatus(employee.getStatus());
|
||||||
|
}
|
||||||
|
|
||||||
|
//核算社保
|
||||||
|
accountSocial(insuranceAccountDetailPO, v, billMonth);
|
||||||
|
//核算公积金
|
||||||
|
accountFund(insuranceAccountDetailPO, v, billMonth);
|
||||||
|
//核算其他福利
|
||||||
|
accountOther(insuranceAccountDetailPO, v, billMonth);
|
||||||
|
//计算合计
|
||||||
|
account(insuranceAccountDetailPO);
|
||||||
|
//临时表PO
|
||||||
|
InsuranceAccountDetailTempPO insuranceAccountDetailTempPO = new InsuranceAccountDetailTempPO();
|
||||||
|
BeanUtils.copyProperties(insuranceAccountDetailPO, insuranceAccountDetailTempPO);
|
||||||
|
list.add(insuranceAccountDetailTempPO);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 入库
|
||||||
|
//生成bill_detail入库数据
|
||||||
|
List<InsuranceAccountDetailPO> collect = list.stream().map(item -> {
|
||||||
|
InsuranceAccountDetailPO insuranceAccountDetailPO = new InsuranceAccountDetailPO();
|
||||||
|
BeanUtils.copyProperties(item, insuranceAccountDetailPO);
|
||||||
|
return insuranceAccountDetailPO;
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
if (CollectionUtils.isNotEmpty(collect)) {
|
||||||
|
encryptUtil.encryptList(collect, InsuranceAccountDetailPO.class);
|
||||||
|
List<List<InsuranceAccountDetailPO>> lists = splitDetailList(collect, 20);
|
||||||
|
lists.forEach(subList -> {
|
||||||
|
getInsuranceAccountDetailMapper().batchSaveAccountDetails(subList);
|
||||||
|
});
|
||||||
|
updateBatchAccount((AccountParam.builder().billMonth(billMonth).paymentOrganization(paymentOrganization)).build());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1582,14 +1582,14 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
|
||||||
List<Map<String, Object>> records = new ArrayList<>();
|
List<Map<String, Object>> records = new ArrayList<>();
|
||||||
|
|
||||||
Map<Long, InsuranceArchivesSocialSchemePO> socialSchemePOMap = encryptUtil.decryptList(this.getSocialByEmployeeIdAndPayOrg(insuranceArchivesEmployeePOS), InsuranceArchivesSocialSchemePO.class)
|
Map<Long, InsuranceArchivesSocialSchemePO> socialSchemePOMap = encryptUtil.decryptList(this.getSocialByEmployeeIdAndPayOrg(insuranceArchivesEmployeePOS), InsuranceArchivesSocialSchemePO.class)
|
||||||
.stream().collect(Collectors.toMap(InsuranceArchivesSocialSchemePO::getId, Function.identity()));
|
.stream().collect(Collectors.toMap(InsuranceArchivesSocialSchemePO::getId, Function.identity(), (a, b) -> a));
|
||||||
|
|
||||||
Map<Long, InsuranceArchivesFundSchemePO> fundSchemePOMap = encryptUtil.decryptList(this.getFundByEmployeeIdAndPayOrg(insuranceArchivesEmployeePOS), InsuranceArchivesFundSchemePO.class)
|
Map<Long, InsuranceArchivesFundSchemePO> fundSchemePOMap = encryptUtil.decryptList(this.getFundByEmployeeIdAndPayOrg(insuranceArchivesEmployeePOS), InsuranceArchivesFundSchemePO.class)
|
||||||
.stream().collect(Collectors.toMap(InsuranceArchivesFundSchemePO::getId, Function.identity()));
|
.stream().collect(Collectors.toMap(InsuranceArchivesFundSchemePO::getId, Function.identity(), (a, b) -> a));
|
||||||
List<InsuranceArchivesOtherSchemePO> otherByEmployeeList = this.getOtherByEmployeeIdAndPayOrg(insuranceArchivesEmployeePOS);
|
List<InsuranceArchivesOtherSchemePO> otherByEmployeeList = this.getOtherByEmployeeIdAndPayOrg(insuranceArchivesEmployeePOS);
|
||||||
encryptUtil.decryptList(otherByEmployeeList, InsuranceArchivesOtherSchemePO.class);
|
encryptUtil.decryptList(otherByEmployeeList, InsuranceArchivesOtherSchemePO.class);
|
||||||
Map<Long, InsuranceArchivesOtherSchemePO> otherSchemePOMap = otherByEmployeeList
|
Map<Long, InsuranceArchivesOtherSchemePO> otherSchemePOMap = otherByEmployeeList
|
||||||
.stream().collect(Collectors.toMap(InsuranceArchivesOtherSchemePO::getId, Function.identity()));
|
.stream().collect(Collectors.toMap(InsuranceArchivesOtherSchemePO::getId, Function.identity(), (a, b) -> a));
|
||||||
insuranceArchivesEmployeePOS.forEach(item -> {
|
insuranceArchivesEmployeePOS.forEach(item -> {
|
||||||
InsuranceArchivesSocialSchemePO socialItem = socialSchemePOMap.get(item.getSocialId());
|
InsuranceArchivesSocialSchemePO socialItem = socialSchemePOMap.get(item.getSocialId());
|
||||||
InsuranceArchivesFundSchemePO fundItem = fundSchemePOMap.get(item.getFundId());
|
InsuranceArchivesFundSchemePO fundItem = fundSchemePOMap.get(item.getFundId());
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,8 @@ import com.alibaba.fastjson.TypeReference;
|
||||||
import com.cloudstore.eccom.pc.table.WeaTableColumn;
|
import com.cloudstore.eccom.pc.table.WeaTableColumn;
|
||||||
import com.engine.common.util.ServiceUtil;
|
import com.engine.common.util.ServiceUtil;
|
||||||
import com.engine.core.impl.Service;
|
import com.engine.core.impl.Service;
|
||||||
import com.engine.salary.config.SalaryElogConfig;
|
|
||||||
import com.engine.hrmelog.entity.dto.LoggerContext;
|
import com.engine.hrmelog.entity.dto.LoggerContext;
|
||||||
|
import com.engine.salary.config.SalaryElogConfig;
|
||||||
import com.engine.salary.encrypt.EncryptUtil;
|
import com.engine.salary.encrypt.EncryptUtil;
|
||||||
import com.engine.salary.entity.siaccount.dto.InsuranceAccountViewListDTO;
|
import com.engine.salary.entity.siaccount.dto.InsuranceAccountViewListDTO;
|
||||||
import com.engine.salary.entity.siaccount.param.InsuranceAccountDetailParam;
|
import com.engine.salary.entity.siaccount.param.InsuranceAccountDetailParam;
|
||||||
|
|
@ -39,11 +39,10 @@ import com.engine.salary.util.SalaryI18nUtil;
|
||||||
import com.engine.salary.util.db.MapperProxyFactory;
|
import com.engine.salary.util.db.MapperProxyFactory;
|
||||||
import com.engine.salary.util.excel.ExcelUtil;
|
import com.engine.salary.util.excel.ExcelUtil;
|
||||||
import com.engine.salary.util.excel.ExcelUtilPlus;
|
import com.engine.salary.util.excel.ExcelUtilPlus;
|
||||||
import org.springframework.beans.BeanUtils;
|
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
|
||||||
import org.apache.commons.collections4.MapUtils;
|
import org.apache.commons.collections4.MapUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
import weaver.general.BaseBean;
|
import weaver.general.BaseBean;
|
||||||
import weaver.hrm.User;
|
import weaver.hrm.User;
|
||||||
|
|
||||||
|
|
@ -176,20 +175,6 @@ public class SIExportServiceImpl extends Service implements SIExportService {
|
||||||
//非系统人员核算明细
|
//非系统人员核算明细
|
||||||
List<AccountExportPO> extAccountExportPOS = getInsuranceExportMapper().exportExtAccount(paymentStatus, param);
|
List<AccountExportPO> extAccountExportPOS = getInsuranceExportMapper().exportExtAccount(paymentStatus, param);
|
||||||
accountExportPOS.addAll(extAccountExportPOS);
|
accountExportPOS.addAll(extAccountExportPOS);
|
||||||
// 分权逻辑
|
|
||||||
Boolean needAuth = getTaxAgentService(user).isNeedAuth((long) user.getUID());
|
|
||||||
if (needAuth) {
|
|
||||||
Collection<TaxAgentPO> taxAgentPOS = getTaxAgentService(user).listAllTaxAgents((long) user.getUID());
|
|
||||||
List<Long> taxAgents = taxAgentPOS.stream().map(TaxAgentPO::getId).collect(Collectors.toList());
|
|
||||||
if (CollectionUtils.isEmpty(taxAgents)) {
|
|
||||||
//防止普通用户查询
|
|
||||||
accountExportPOS = new ArrayList<>();
|
|
||||||
param = new InsuranceExportParam();
|
|
||||||
} else {
|
|
||||||
accountExportPOS.stream().filter(f -> taxAgents.contains(f.getPaymentOrganization())).collect(Collectors.toList());
|
|
||||||
param.setTaxAgents(taxAgents);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
accountExportPOS = getInsuranceExportMapper().exportAccount(paymentStatus, param);
|
accountExportPOS = getInsuranceExportMapper().exportAccount(paymentStatus, param);
|
||||||
//非系统人员核算明细
|
//非系统人员核算明细
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,8 @@ import com.alibaba.fastjson.JSON;
|
||||||
import com.api.formmode.mybatis.util.SqlProxyHandle;
|
import com.api.formmode.mybatis.util.SqlProxyHandle;
|
||||||
import com.engine.common.util.ServiceUtil;
|
import com.engine.common.util.ServiceUtil;
|
||||||
import com.engine.core.impl.Service;
|
import com.engine.core.impl.Service;
|
||||||
import com.engine.salary.config.SalaryElogConfig;
|
|
||||||
import com.engine.hrmelog.entity.dto.LoggerContext;
|
import com.engine.hrmelog.entity.dto.LoggerContext;
|
||||||
|
import com.engine.salary.config.SalaryElogConfig;
|
||||||
import com.engine.salary.encrypt.EncryptUtil;
|
import com.engine.salary.encrypt.EncryptUtil;
|
||||||
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
||||||
import com.engine.salary.entity.hrm.dto.HrmInfoDTO;
|
import com.engine.salary.entity.hrm.dto.HrmInfoDTO;
|
||||||
|
|
@ -14,9 +14,10 @@ import com.engine.salary.entity.siaccount.param.InsuranceAccountDetailParam;
|
||||||
import com.engine.salary.entity.siaccount.param.RecessionParam;
|
import com.engine.salary.entity.siaccount.param.RecessionParam;
|
||||||
import com.engine.salary.entity.siaccount.po.InsuranceAccountBatchPO;
|
import com.engine.salary.entity.siaccount.po.InsuranceAccountBatchPO;
|
||||||
import com.engine.salary.entity.siaccount.po.InsuranceAccountDetailPO;
|
import com.engine.salary.entity.siaccount.po.InsuranceAccountDetailPO;
|
||||||
import com.engine.salary.entity.taxagent.dto.TaxAgentEmployeeDTO;
|
import com.engine.salary.entity.siarchives.po.InsuranceArchivesBaseInfoPO;
|
||||||
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
||||||
import com.engine.salary.enums.OperateTypeEnum;
|
import com.engine.salary.enums.OperateTypeEnum;
|
||||||
|
import com.engine.salary.enums.auth.AuthFilterTypeEnum;
|
||||||
import com.engine.salary.enums.siaccount.BillStatusEnum;
|
import com.engine.salary.enums.siaccount.BillStatusEnum;
|
||||||
import com.engine.salary.enums.siaccount.PaymentStatusEnum;
|
import com.engine.salary.enums.siaccount.PaymentStatusEnum;
|
||||||
import com.engine.salary.enums.siaccount.ProjectTypeEnum;
|
import com.engine.salary.enums.siaccount.ProjectTypeEnum;
|
||||||
|
|
@ -25,11 +26,14 @@ import com.engine.salary.exception.SalaryRunTimeException;
|
||||||
import com.engine.salary.mapper.datacollection.EmployMapper;
|
import com.engine.salary.mapper.datacollection.EmployMapper;
|
||||||
import com.engine.salary.mapper.siaccount.InsuranceAccountBatchMapper;
|
import com.engine.salary.mapper.siaccount.InsuranceAccountBatchMapper;
|
||||||
import com.engine.salary.mapper.siaccount.InsuranceAccountDetailMapper;
|
import com.engine.salary.mapper.siaccount.InsuranceAccountDetailMapper;
|
||||||
|
import com.engine.salary.mapper.siarchives.InsuranceBaseInfoMapper;
|
||||||
import com.engine.salary.mapper.taxagent.TaxAgentMapper;
|
import com.engine.salary.mapper.taxagent.TaxAgentMapper;
|
||||||
import com.engine.salary.service.SIAccountService;
|
import com.engine.salary.service.SIAccountService;
|
||||||
import com.engine.salary.service.SIRecessionService;
|
import com.engine.salary.service.SIRecessionService;
|
||||||
import com.engine.salary.service.SalaryEmployeeService;
|
import com.engine.salary.service.SalaryEmployeeService;
|
||||||
import com.engine.salary.service.TaxAgentService;
|
import com.engine.salary.service.TaxAgentService;
|
||||||
|
import com.engine.salary.service.auth.AuthService;
|
||||||
|
import com.engine.salary.service.auth.AuthServiceImpl;
|
||||||
import com.engine.salary.util.SalaryAssert;
|
import com.engine.salary.util.SalaryAssert;
|
||||||
import com.engine.salary.util.SalaryEntityUtil;
|
import com.engine.salary.util.SalaryEntityUtil;
|
||||||
import com.engine.salary.util.SalaryI18nUtil;
|
import com.engine.salary.util.SalaryI18nUtil;
|
||||||
|
|
@ -69,6 +73,7 @@ public class SIRecessionServiceImpl extends Service implements SIRecessionServic
|
||||||
private SIAccountService getSIAccountService(User user) {
|
private SIAccountService getSIAccountService(User user) {
|
||||||
return ServiceUtil.getService(SIAccountServiceImpl.class, user);
|
return ServiceUtil.getService(SIAccountServiceImpl.class, user);
|
||||||
}
|
}
|
||||||
|
|
||||||
private InsuranceAccountBatchMapper getInsuranceAccountBatchMapper() {
|
private InsuranceAccountBatchMapper getInsuranceAccountBatchMapper() {
|
||||||
return MapperProxyFactory.getProxy(InsuranceAccountBatchMapper.class);
|
return MapperProxyFactory.getProxy(InsuranceAccountBatchMapper.class);
|
||||||
}
|
}
|
||||||
|
|
@ -81,6 +86,14 @@ public class SIRecessionServiceImpl extends Service implements SIRecessionServic
|
||||||
return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user);
|
return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private InsuranceBaseInfoMapper getInsuranceBaseInfoMapper() {
|
||||||
|
return MapperProxyFactory.getProxy(InsuranceBaseInfoMapper.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public AuthService getAuthService(User user) {
|
||||||
|
return ServiceUtil.getService(AuthServiceImpl.class, user);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void save(RecessionParam param, Long employeeId) {
|
public void save(RecessionParam param, Long employeeId) {
|
||||||
|
|
||||||
|
|
@ -102,11 +115,11 @@ public class SIRecessionServiceImpl extends Service implements SIRecessionServic
|
||||||
partitionEmpIds.forEach(p -> {
|
partitionEmpIds.forEach(p -> {
|
||||||
detailPOS.addAll(
|
detailPOS.addAll(
|
||||||
getInsuranceAccountDetailMapper().list(InsuranceAccountDetailParam.builder()
|
getInsuranceAccountDetailMapper().list(InsuranceAccountDetailParam.builder()
|
||||||
.paymentStatus(PaymentStatusEnum.COMMON.getValue())
|
.paymentStatus(PaymentStatusEnum.COMMON.getValue())
|
||||||
.recessionMonthList(param.getRecessionMonthList())
|
.recessionMonthList(param.getRecessionMonthList())
|
||||||
.employeeIds(p)
|
.employeeIds(p)
|
||||||
.paymentOrganization(param.getPaymentOrganization())
|
.paymentOrganization(param.getPaymentOrganization())
|
||||||
.build())
|
.build())
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -208,7 +221,6 @@ public class SIRecessionServiceImpl extends Service implements SIRecessionServic
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void recessionBaseBuild(RecessionParam param, InsuranceAccountDetailPO temp, InsuranceAccountDetailPO insuranceAccountDetailPO, DataCollectionEmployee employee) {
|
private void recessionBaseBuild(RecessionParam param, InsuranceAccountDetailPO temp, InsuranceAccountDetailPO insuranceAccountDetailPO, DataCollectionEmployee employee) {
|
||||||
InsuranceAccountBatchPO insuranceAccountBatchPO = getInsuranceAccountBatchMapper().getByBillMonth(param.getBillMonth(), Long.valueOf(param.getPaymentOrganization()));
|
InsuranceAccountBatchPO insuranceAccountBatchPO = getInsuranceAccountBatchMapper().getByBillMonth(param.getBillMonth(), Long.valueOf(param.getPaymentOrganization()));
|
||||||
temp.setPaymentStatus(PaymentStatusEnum.RECESSION.getValue());
|
temp.setPaymentStatus(PaymentStatusEnum.RECESSION.getValue());
|
||||||
|
|
@ -253,6 +265,7 @@ public class SIRecessionServiceImpl extends Service implements SIRecessionServic
|
||||||
temp.setFundPaymentComBaseString(insuranceAccountDetailPO.getFundPaymentComBaseString());
|
temp.setFundPaymentComBaseString(insuranceAccountDetailPO.getFundPaymentComBaseString());
|
||||||
temp.setOtherPaymentComBaseString(insuranceAccountDetailPO.getOtherPaymentComBaseString());
|
temp.setOtherPaymentComBaseString(insuranceAccountDetailPO.getOtherPaymentComBaseString());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void recessionSocial(RecessionParam param, InsuranceAccountDetailPO temp, InsuranceAccountDetailPO insuranceAccountDetailPO) {
|
private void recessionSocial(RecessionParam param, InsuranceAccountDetailPO temp, InsuranceAccountDetailPO insuranceAccountDetailPO) {
|
||||||
//退差社保个人缴费
|
//退差社保个人缴费
|
||||||
String socialPerJson = insuranceAccountDetailPO.getSocialPerJson();
|
String socialPerJson = insuranceAccountDetailPO.getSocialPerJson();
|
||||||
|
|
@ -396,15 +409,12 @@ public class SIRecessionServiceImpl extends Service implements SIRecessionServic
|
||||||
@Override
|
@Override
|
||||||
public PageInfo<HrmInfoDTO> getEmployeeListByTaxAgent(HrmQueryParam param) {
|
public PageInfo<HrmInfoDTO> getEmployeeListByTaxAgent(HrmQueryParam param) {
|
||||||
|
|
||||||
// 当前登录人员
|
List<InsuranceArchivesBaseInfoPO> list = getInsuranceBaseInfoMapper().listAll();
|
||||||
Long currentEmployeeId = (long) user.getUID();
|
list = getAuthService(user).auth(list, AuthFilterTypeEnum.ADMIN_DATA, InsuranceArchivesBaseInfoPO.class);
|
||||||
|
List<Long> employeeIds = SalaryEntityUtil.properties(list, InsuranceArchivesBaseInfoPO::getEmployeeId, Collectors.toList());
|
||||||
List<TaxAgentEmployeeDTO> taxAgentEmployeeDTOS = getTaxAgentService(user).listTaxAgentAndEmployee(currentEmployeeId);
|
|
||||||
Set<Long> employeeIds = SalaryEntityUtil.properties(taxAgentEmployeeDTOS, TaxAgentEmployeeDTO::getEmployeeId);
|
|
||||||
List<Long> empIds = new ArrayList<Long>(employeeIds);
|
|
||||||
List<HrmInfoDTO> resultData = new ArrayList<>();
|
List<HrmInfoDTO> resultData = new ArrayList<>();
|
||||||
if (employeeIds.size() > 0) {
|
if (employeeIds.size() > 0) {
|
||||||
List<List<Long>> partition = Lists.partition(empIds, 1000);
|
List<List<Long>> partition = Lists.partition(employeeIds, 1000);
|
||||||
partition.forEach(p -> {
|
partition.forEach(p -> {
|
||||||
param.setIds(p);
|
param.setIds(p);
|
||||||
resultData.addAll(getEmployMapper().listHrmInfoByIdAndName(param));
|
resultData.addAll(getEmployMapper().listHrmInfoByIdAndName(param));
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,6 @@ import com.engine.salary.entity.sischeme.po.InsuranceSchemeDetailPO;
|
||||||
import com.engine.salary.entity.sischeme.po.InsuranceSchemePO;
|
import com.engine.salary.entity.sischeme.po.InsuranceSchemePO;
|
||||||
import com.engine.salary.entity.sischeme.vo.InsuranceSchemeFormVO;
|
import com.engine.salary.entity.sischeme.vo.InsuranceSchemeFormVO;
|
||||||
import com.engine.salary.entity.sischeme.vo.SISchemeTableVO;
|
import com.engine.salary.entity.sischeme.vo.SISchemeTableVO;
|
||||||
import com.engine.salary.entity.taxagent.dto.TaxAgentEmployeeDTO;
|
|
||||||
import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeEmployeeDTO;
|
import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeEmployeeDTO;
|
||||||
import com.engine.salary.entity.taxagent.param.TaxAgentManageRangeSaveParam;
|
import com.engine.salary.entity.taxagent.param.TaxAgentManageRangeSaveParam;
|
||||||
import com.engine.salary.entity.taxagent.param.TaxAgentQueryParam;
|
import com.engine.salary.entity.taxagent.param.TaxAgentQueryParam;
|
||||||
|
|
@ -54,6 +53,8 @@ import com.engine.salary.mapper.sischeme.InsuranceSchemeMapper;
|
||||||
import com.engine.salary.mapper.sys.SalarySysConfMapper;
|
import com.engine.salary.mapper.sys.SalarySysConfMapper;
|
||||||
import com.engine.salary.mapper.taxagent.TaxAgentMapper;
|
import com.engine.salary.mapper.taxagent.TaxAgentMapper;
|
||||||
import com.engine.salary.service.*;
|
import com.engine.salary.service.*;
|
||||||
|
import com.engine.salary.service.auth.AuthService;
|
||||||
|
import com.engine.salary.service.auth.AuthServiceImpl;
|
||||||
import com.engine.salary.sys.entity.po.SalarySysConfPO;
|
import com.engine.salary.sys.entity.po.SalarySysConfPO;
|
||||||
import com.engine.salary.sys.entity.vo.OrderRuleVO;
|
import com.engine.salary.sys.entity.vo.OrderRuleVO;
|
||||||
import com.engine.salary.sys.enums.OpenEnum;
|
import com.engine.salary.sys.enums.OpenEnum;
|
||||||
|
|
@ -179,6 +180,10 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
|
||||||
return MapperProxyFactory.getProxy(EmployMapper.class);
|
return MapperProxyFactory.getProxy(EmployMapper.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public AuthService getAuthService(User user) {
|
||||||
|
return ServiceUtil.getService(AuthServiceImpl.class, user);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> getForm(Map<String, Object> params) {
|
public Map<String, Object> getForm(Map<String, Object> params) {
|
||||||
Map<String, Object> apidatas = new HashMap<>(16);
|
Map<String, Object> apidatas = new HashMap<>(16);
|
||||||
|
|
@ -356,16 +361,9 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
|
||||||
OrderRuleVO orderRule = getSalarySysConfService(user).orderRule();
|
OrderRuleVO orderRule = getSalarySysConfService(user).orderRule();
|
||||||
param.setOrderRule(orderRule);
|
param.setOrderRule(orderRule);
|
||||||
|
|
||||||
Boolean needAuth = getTaxAgentService().isNeedAuth(currentEmployeeId);
|
List<InsuranceArchivesEmployeePO> list = getSocialSchemeMapper().queryEmployeeList(param);
|
||||||
if (needAuth) {
|
list = getAuthService(user).auth(list, AuthFilterTypeEnum.QUERY_DATA, InsuranceArchivesEmployeePO.class);
|
||||||
List<TaxAgentEmployeeDTO> taxAgentEmployeeDTOS = getTaxAgentService().listTaxAgentAndEmployee(currentEmployeeId);
|
return list;
|
||||||
// Set<Long> employeeIds = SalaryEntityUtil.properties(taxAgentEmployeeDTOS, TaxAgentEmployeeDTO::getEmployeeId);
|
|
||||||
Set<Long> taxAgentIds = SalaryEntityUtil.properties(taxAgentEmployeeDTOS, TaxAgentEmployeeDTO::getTaxAgentId);
|
|
||||||
List<InsuranceArchivesEmployeePO> list = getSocialSchemeMapper().queryEmployeeList(param);
|
|
||||||
return list.stream().filter(f -> taxAgentIds.contains(f.getPaymentOrganization())).collect(Collectors.toList());
|
|
||||||
}
|
|
||||||
|
|
||||||
return getSocialSchemeMapper().queryEmployeeList(param);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -1014,7 +1012,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
|
||||||
singleAccount.add(cellData);
|
singleAccount.add(cellData);
|
||||||
}
|
}
|
||||||
|
|
||||||
isError = singleAccountCheck(singleAccount, welfareMap, insuranceArchivesAccountPOS, employeeByIds, excelComments, errorCount + 1, schemeNameIdMap, paymentNameIdMap, creator, i + 2, openDevolution, taxAgentManageRangeEmployeeTree, param);
|
isError = singleAccountCheck(singleAccount, welfareMap, insuranceArchivesAccountPOS, employeeByIds, excelComments, errorCount + 1, schemeNameIdMap, paymentNameIdMap, creator, i + 2, taxAgentManageRangeEmployeeTree, param);
|
||||||
if (isError) {
|
if (isError) {
|
||||||
errorCount += 1;
|
errorCount += 1;
|
||||||
// 添加错误数据
|
// 添加错误数据
|
||||||
|
|
@ -1073,7 +1071,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
|
||||||
public boolean singleAccountCheck(List<Map<String, Object>> singleAccount, Map<Long, String> welfareMap,
|
public boolean singleAccountCheck(List<Map<String, Object>> singleAccount, Map<Long, String> welfareMap,
|
||||||
List<InsuranceArchivesAccountPO> insuranceArchivesAccountPOS, List<DataCollectionEmployee> employeeByIds,
|
List<InsuranceArchivesAccountPO> insuranceArchivesAccountPOS, List<DataCollectionEmployee> employeeByIds,
|
||||||
List<Map<String, String>> excelComments, int i, Map<String, Long> schemeNameIdMap,
|
List<Map<String, String>> excelComments, int i, Map<String, Long> schemeNameIdMap,
|
||||||
Map<String, Long> paymentNameIdMap, Long creator, int index, Boolean openDevolution,
|
Map<String, Long> paymentNameIdMap, Long creator, int index,
|
||||||
List<TaxAgentManageRangeEmployeeDTO> taxAgentManageRangeEmployeeTree, SIArchiveImportParam param) {
|
List<TaxAgentManageRangeEmployeeDTO> taxAgentManageRangeEmployeeTree, SIArchiveImportParam param) {
|
||||||
boolean isError = false;
|
boolean isError = false;
|
||||||
String runStatus = param.getRunStatus();
|
String runStatus = param.getRunStatus();
|
||||||
|
|
@ -2088,19 +2086,9 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
|
||||||
//获取所有福利类型的id-name结合
|
//获取所有福利类型的id-name结合
|
||||||
Map<String, Long> schemeNameIdMap = schemeNameIdMap();
|
Map<String, Long> schemeNameIdMap = schemeNameIdMap();
|
||||||
Map<Long, String> welfareMap = welfareMap();
|
Map<Long, String> welfareMap = welfareMap();
|
||||||
|
|
||||||
// 获取所有个税扣缴义务人的名称和id的map
|
// 获取所有个税扣缴义务人的名称和id的map
|
||||||
Map<String, Long> paymentNameIdMap;
|
Map<String, Long> paymentNameIdMap = getTaxAgentService().listAll().stream().collect(Collectors.toMap(TaxAgentPO::getName, TaxAgentPO::getId));
|
||||||
|
|
||||||
//分权
|
|
||||||
// Boolean openDevolution = getTaxAgentService().isOpenDevolution();
|
|
||||||
// 流程处理,默认不开启分权
|
|
||||||
Boolean openDevolution = false;
|
|
||||||
if (openDevolution) {
|
|
||||||
paymentNameIdMap = getTaxAgentService().listAllTaxAgentsAsAdmin((long) user.getUID()).stream().collect(Collectors.toMap(TaxAgentPO::getName, TaxAgentPO::getId));
|
|
||||||
} else {
|
|
||||||
|
|
||||||
paymentNameIdMap = getTaxAgentService().listAll().stream().collect(Collectors.toMap(TaxAgentPO::getName, TaxAgentPO::getId));
|
|
||||||
}
|
|
||||||
|
|
||||||
//获取所有个税扣缴义务人树型
|
//获取所有个税扣缴义务人树型
|
||||||
List<TaxAgentManageRangeEmployeeDTO> taxAgentManageRangeEmployeeTree = getTaxAgentService().listTaxAgentAndEmployeeTree();
|
List<TaxAgentManageRangeEmployeeDTO> taxAgentManageRangeEmployeeTree = getTaxAgentService().listTaxAgentAndEmployeeTree();
|
||||||
|
|
@ -2158,7 +2146,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
|
||||||
singleAccount.add(cellData);
|
singleAccount.add(cellData);
|
||||||
}
|
}
|
||||||
|
|
||||||
isError = singleAccountCheck(singleAccount, welfareMap, insuranceArchivesAccountPOS, employeeByIds, excelComments, errorCount + 1, schemeNameIdMap, paymentNameIdMap, creator, i + 2, openDevolution, taxAgentManageRangeEmployeeTree, param);
|
isError = singleAccountCheck(singleAccount, welfareMap, insuranceArchivesAccountPOS, employeeByIds, excelComments, errorCount + 1, schemeNameIdMap, paymentNameIdMap, creator, i + 2, taxAgentManageRangeEmployeeTree, param);
|
||||||
if (isError) {
|
if (isError) {
|
||||||
errorCount += 1;
|
errorCount += 1;
|
||||||
// 添加错误数据
|
// 添加错误数据
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@ import com.engine.salary.enums.salaryformula.SalaryFormulaReferenceEnum;
|
||||||
import com.engine.salary.formlua.entity.standard.ExcelResult;
|
import com.engine.salary.formlua.entity.standard.ExcelResult;
|
||||||
import com.engine.salary.service.*;
|
import com.engine.salary.service.*;
|
||||||
import com.engine.salary.sys.enums.TaxDeclarationFunctionEnum;
|
import com.engine.salary.sys.enums.TaxDeclarationFunctionEnum;
|
||||||
|
import com.engine.salary.util.SalaryDateUtil;
|
||||||
import com.engine.salary.util.SalaryEntityUtil;
|
import com.engine.salary.util.SalaryEntityUtil;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
@ -189,9 +190,13 @@ public class SalaryAcctCalculateServiceImpl extends Service implements SalaryAcc
|
||||||
List<SalaryAcctEmployeePO> otherSalaryAcctEmployeePOS = getSalaryAcctEmployeeService(user).listBySalaryAcctRecordIdsAndEmployeeIds(otherSalaryAcctRecordIds, employeeIds);
|
List<SalaryAcctEmployeePO> otherSalaryAcctEmployeePOS = getSalaryAcctEmployeeService(user).listBySalaryAcctRecordIdsAndEmployeeIds(otherSalaryAcctRecordIds, employeeIds);
|
||||||
Map<String, List<SalaryAcctEmployeePO>> otherSalaryAcctEmployeePOMap = SalaryEntityUtil.group2Map(otherSalaryAcctEmployeePOS, salaryAcctEmployeePO -> salaryAcctEmployeePO.getEmployeeId() + "_" + salaryAcctEmployeePO.getTaxAgentId());
|
Map<String, List<SalaryAcctEmployeePO>> otherSalaryAcctEmployeePOMap = SalaryEntityUtil.group2Map(otherSalaryAcctEmployeePOS, salaryAcctEmployeePO -> salaryAcctEmployeePO.getEmployeeId() + "_" + salaryAcctEmployeePO.getTaxAgentId());
|
||||||
sw.stop();
|
sw.stop();
|
||||||
|
// 查询上个薪资所属月核算人员薪资数据
|
||||||
|
sw.start("查询上个薪资所属月核算人员薪资数据");
|
||||||
|
List<SalaryAcctResultPO> lastMonthResultPOS = getSalaryAcctResultService(user).listBySobSalaryMonth(SalaryDateUtil.toDate(salarySobCycleDTO.getSalaryMonth().minusMonths(1), 1), salaryAcctCalculateBO.getSalarySobPO().getId(), employeeIds);
|
||||||
|
sw.stop();
|
||||||
// 10、转换成公式编辑器中的变量
|
// 10、转换成公式编辑器中的变量
|
||||||
sw.start("转换成公式编辑器中的变量");
|
sw.start("转换成公式编辑器中的变量");
|
||||||
CalculateFormulaVarBO calculateFormulaVarBO = new CalculateFormulaVarBO(simpleEmployees, salaryArchiveData, addUpSituationPOS, addUpDeductionPOS, otherDeductionPOS, welfareData, attendQuoteDataDTOS, salaryAcctResultPOS, variableArchiveList);
|
CalculateFormulaVarBO calculateFormulaVarBO = new CalculateFormulaVarBO(simpleEmployees, salaryArchiveData, addUpSituationPOS, addUpDeductionPOS, otherDeductionPOS, welfareData, attendQuoteDataDTOS, salaryAcctResultPOS, variableArchiveList,lastMonthResultPOS);
|
||||||
Map<String, List<CalculateFormulaVarBO.FormulaVarValue>> formulaVarMap = calculateFormulaVarBO.convert2FormulaVar(salaryAcctCalculateBO);
|
Map<String, List<CalculateFormulaVarBO.FormulaVarValue>> formulaVarMap = calculateFormulaVarBO.convert2FormulaVar(salaryAcctCalculateBO);
|
||||||
sw.stop();
|
sw.stop();
|
||||||
sw.start("数据结构准备");
|
sw.start("数据结构准备");
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.engine.salary.service.impl;
|
package com.engine.salary.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import com.engine.common.util.ServiceUtil;
|
import com.engine.common.util.ServiceUtil;
|
||||||
import com.engine.core.impl.Service;
|
import com.engine.core.impl.Service;
|
||||||
import com.engine.hrmelog.entity.dto.LoggerContext;
|
import com.engine.hrmelog.entity.dto.LoggerContext;
|
||||||
|
|
@ -82,6 +83,8 @@ import java.util.concurrent.LinkedBlockingDeque;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import static com.engine.salary.sys.constant.SalarySysConstant.SALARY_ACCT_SYNC_TYPE;
|
||||||
|
|
||||||
import static com.engine.salary.constant.SalaryFormulaFieldConstant.SALARY_PATTERN;
|
import static com.engine.salary.constant.SalaryFormulaFieldConstant.SALARY_PATTERN;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -201,6 +204,7 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
|
||||||
private VariableItemService getVariableItemService(User user) {
|
private VariableItemService getVariableItemService(User user) {
|
||||||
return ServiceUtil.getService(VariableItemServiceImpl.class, user);
|
return ServiceUtil.getService(VariableItemServiceImpl.class, user);
|
||||||
}
|
}
|
||||||
|
|
||||||
private SalaryApprovalRuleService getSalaryApprovalRuleService(User user) {
|
private SalaryApprovalRuleService getSalaryApprovalRuleService(User user) {
|
||||||
return ServiceUtil.getService(SalaryApprovalRuleServiceImpl.class, user);
|
return ServiceUtil.getService(SalaryApprovalRuleServiceImpl.class, user);
|
||||||
}
|
}
|
||||||
|
|
@ -887,6 +891,8 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
|
||||||
// 12.4、是否采用系统算税
|
// 12.4、是否采用系统算税
|
||||||
TaxDeclarationFunctionEnum taxDeclarationFunction = getSalarySysConfService(user).getTaxDeclaration();
|
TaxDeclarationFunctionEnum taxDeclarationFunction = getSalarySysConfService(user).getTaxDeclaration();
|
||||||
// 12.5、多线程运算,运算结果存放在临时表中
|
// 12.5、多线程运算,运算结果存放在临时表中
|
||||||
|
//是否同步计算
|
||||||
|
boolean isSync = "0".equals(getSalarySysConfService(user).getValueByCode(SALARY_ACCT_SYNC_TYPE));
|
||||||
for (List<SalaryAcctEmployeePO> acctEmployeePOS : partition) {
|
for (List<SalaryAcctEmployeePO> acctEmployeePOS : partition) {
|
||||||
SalaryAcctCalculateBO salaryAcctCalculateBO = new SalaryAcctCalculateBO()
|
SalaryAcctCalculateBO salaryAcctCalculateBO = new SalaryAcctCalculateBO()
|
||||||
.setSalaryAcctRecordPO(salaryAcctRecordPO)
|
.setSalaryAcctRecordPO(salaryAcctRecordPO)
|
||||||
|
|
@ -909,13 +915,17 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
|
||||||
.setTaxDeclarationFunction(taxDeclarationFunction)
|
.setTaxDeclarationFunction(taxDeclarationFunction)
|
||||||
.setTaxIds(taxIds);
|
.setTaxIds(taxIds);
|
||||||
List<SalarySobBackItemPO> finalSalarySobBackItems = salarySobBackItems;
|
List<SalarySobBackItemPO> finalSalarySobBackItems = salarySobBackItems;
|
||||||
LocalRunnable localRunnable = new LocalRunnable() {
|
if (isSync) {
|
||||||
@Override
|
getSalaryAcctCalculateService(user).calculate(salaryAcctCalculateBO, simpleEmployee, finalSalarySobBackItems);
|
||||||
public void execute() {
|
} else {
|
||||||
getSalaryAcctCalculateService(user).calculate(salaryAcctCalculateBO, simpleEmployee, finalSalarySobBackItems);
|
LocalRunnable localRunnable = new LocalRunnable() {
|
||||||
}
|
@Override
|
||||||
};
|
public void execute() {
|
||||||
ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.HRM, "salaryAcctCalculate", localRunnable);
|
getSalaryAcctCalculateService(user).calculate(salaryAcctCalculateBO, simpleEmployee, finalSalarySobBackItems);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.HRM, "salaryAcctCalculate", localRunnable);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// 13、等待所有子线程执行完毕
|
// 13、等待所有子线程执行完毕
|
||||||
childMonitor.await();
|
childMonitor.await();
|
||||||
|
|
@ -944,7 +954,7 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
|
||||||
getSalaryAcctProgressService(user).finish(SalaryCacheKey.ACCT_PROGRESS + calculateParam.getSalaryAcctRecordId(), true);
|
getSalaryAcctProgressService(user).finish(SalaryCacheKey.ACCT_PROGRESS + calculateParam.getSalaryAcctRecordId(), true);
|
||||||
|
|
||||||
//更新薪资核算记录最后操作日期
|
//更新薪资核算记录最后操作日期
|
||||||
getSalaryAcctRecordService(user).updateDate(salaryAcctRecordPO.getId(),new Date());
|
getSalaryAcctRecordService(user).updateDate(salaryAcctRecordPO.getId(), new Date());
|
||||||
|
|
||||||
stopWatch.stop();
|
stopWatch.stop();
|
||||||
log.info(stopWatch.prettyPrint());
|
log.info(stopWatch.prettyPrint());
|
||||||
|
|
@ -952,6 +962,10 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
|
||||||
// 记录日志
|
// 记录日志
|
||||||
// 查询操作日志的targetName
|
// 查询操作日志的targetName
|
||||||
String targetName = getSalaryAcctRecordService(user).getLogTargetNameById(calculateParam.getSalaryAcctRecordId());
|
String targetName = getSalaryAcctRecordService(user).getLogTargetNameById(calculateParam.getSalaryAcctRecordId());
|
||||||
|
Collection<Long> ids = calculateParam.getIds();
|
||||||
|
if (CollectionUtils.isNotEmpty(ids)) {
|
||||||
|
targetName += ids;
|
||||||
|
}
|
||||||
LoggerContext<SalaryCheckResultPO> loggerContext = new LoggerContext<>();
|
LoggerContext<SalaryCheckResultPO> loggerContext = new LoggerContext<>();
|
||||||
loggerContext.setUser(user);
|
loggerContext.setUser(user);
|
||||||
loggerContext.setTargetId(String.valueOf(calculateParam.getSalaryAcctRecordId()));
|
loggerContext.setTargetId(String.valueOf(calculateParam.getSalaryAcctRecordId()));
|
||||||
|
|
@ -1492,6 +1506,31 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<SalaryAcctResultPO> listBySobSalaryMonth(Date salaryMonth, Long salarySobId, List<Long> employeeIds) {
|
||||||
|
List<SalaryAcctRecordPO> salaryAcctRecordPOS = getSalaryAcctRecordService(user).listSome(SalaryAcctRecordPO.builder().salarySobId(salarySobId).salaryMonth(salaryMonth).build());
|
||||||
|
List<Long> recordIds = SalaryEntityUtil.properties(salaryAcctRecordPOS, SalaryAcctRecordPO::getId, Collectors.toList());
|
||||||
|
|
||||||
|
if (CollUtil.isEmpty(recordIds)) {
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
|
List<SalaryAcctResultPO> salaryAcctResultPOS = new ArrayList<>();
|
||||||
|
SalaryAcctResultPO resultParam = SalaryAcctResultPO.builder().salaryAcctRecordIds(recordIds).build();
|
||||||
|
if (CollUtil.isNotEmpty(employeeIds)) {
|
||||||
|
List<List<Long>> partition = Lists.partition(employeeIds, 500);
|
||||||
|
for (List<Long> ids : partition){
|
||||||
|
resultParam.setEmployeeIds(ids);
|
||||||
|
List<SalaryAcctResultPO> acctResultPOS = getSalaryAcctResultMapper().listSome(resultParam);
|
||||||
|
salaryAcctResultPOS.addAll(acctResultPOS);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
salaryAcctResultPOS = getSalaryAcctResultMapper().listSome(resultParam);
|
||||||
|
}
|
||||||
|
|
||||||
|
encryptUtil.decryptList(salaryAcctResultPOS, SalaryAcctResultPO.class);
|
||||||
|
return salaryAcctResultPOS;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void writeBatchLog(SalaryAcctRecordPO salaryAcctRecord,
|
public void writeBatchLog(SalaryAcctRecordPO salaryAcctRecord,
|
||||||
Map<String, String> newResultValueMap,
|
Map<String, String> newResultValueMap,
|
||||||
|
|
|
||||||
|
|
@ -12,14 +12,17 @@ import com.engine.salary.config.SalaryElogConfig;
|
||||||
import com.engine.salary.constant.SalaryDefaultTenantConstant;
|
import com.engine.salary.constant.SalaryDefaultTenantConstant;
|
||||||
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
||||||
import com.engine.salary.entity.salaryarchive.config.ArchiveFieldConfig;
|
import com.engine.salary.entity.salaryarchive.config.ArchiveFieldConfig;
|
||||||
|
import com.engine.salary.entity.salaryarchive.dto.SalaryArchiveListDTO;
|
||||||
import com.engine.salary.entity.salaryarchive.dto.SalaryItemAdjustRecordListDTO;
|
import com.engine.salary.entity.salaryarchive.dto.SalaryItemAdjustRecordListDTO;
|
||||||
import com.engine.salary.entity.salaryarchive.param.*;
|
import com.engine.salary.entity.salaryarchive.param.*;
|
||||||
import com.engine.salary.entity.salaryarchive.po.SalaryArchiveItemPO;
|
import com.engine.salary.entity.salaryarchive.po.SalaryArchiveItemPO;
|
||||||
import com.engine.salary.entity.salaryarchive.po.SalaryArchivePO;
|
import com.engine.salary.entity.salaryarchive.po.SalaryArchivePO;
|
||||||
import com.engine.salary.entity.salaryitem.param.SalaryItemSearchParam;
|
import com.engine.salary.entity.salaryitem.param.SalaryItemSearchParam;
|
||||||
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
||||||
|
import com.engine.salary.entity.taxagent.param.TaxAgentQueryParam;
|
||||||
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
||||||
import com.engine.salary.enums.UserStatusEnum;
|
import com.engine.salary.enums.UserStatusEnum;
|
||||||
|
import com.engine.salary.enums.auth.AuthFilterTypeEnum;
|
||||||
import com.engine.salary.enums.datacollection.UseEmployeeTypeEnum;
|
import com.engine.salary.enums.datacollection.UseEmployeeTypeEnum;
|
||||||
import com.engine.salary.enums.salaryarchive.SalaryArchiveFieldTypeEnum;
|
import com.engine.salary.enums.salaryarchive.SalaryArchiveFieldTypeEnum;
|
||||||
import com.engine.salary.enums.salaryarchive.SalaryArchiveItemAdjustReasonEnum;
|
import com.engine.salary.enums.salaryarchive.SalaryArchiveItemAdjustReasonEnum;
|
||||||
|
|
@ -629,8 +632,11 @@ public class SalaryArchiveItemServiceImpl extends Service implements SalaryArchi
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<SalaryItemPO> getCanAdjustSalaryItems() {
|
public List<SalaryItemPO> getCanAdjustSalaryItems() {
|
||||||
Collection<TaxAgentPO> taxAgentPOS = getTaxAgentService(user).listAllTaxAgentsAsAdmin((long) user.getUID());
|
|
||||||
List<Long> taxAgentIds = SalaryEntityUtil.properties(taxAgentPOS, TaxAgentPO::getId, Collectors.toList());
|
TaxAgentQueryParam param = TaxAgentQueryParam.builder().build();
|
||||||
|
param.setFilterType(AuthFilterTypeEnum.QUERY_DATA);
|
||||||
|
Collection<TaxAgentPO> taxAgentList = getTaxAgentService(user).listAuth(param);
|
||||||
|
List<Long> taxAgentIds = SalaryEntityUtil.properties(taxAgentList, TaxAgentPO::getId, Collectors.toList());
|
||||||
|
|
||||||
List<SalaryItemPO> canAdjustSalaryItems = salaryItemMapper.getCanAdjustSalaryItems();
|
List<SalaryItemPO> canAdjustSalaryItems = salaryItemMapper.getCanAdjustSalaryItems();
|
||||||
canAdjustSalaryItems = canAdjustSalaryItems.stream()
|
canAdjustSalaryItems = canAdjustSalaryItems.stream()
|
||||||
|
|
@ -678,22 +684,11 @@ public class SalaryArchiveItemServiceImpl extends Service implements SalaryArchi
|
||||||
// 获取所有可被引用的薪资项目
|
// 获取所有可被引用的薪资项目
|
||||||
List<SalaryItemPO> salaryItemList = getCanAdjustSalaryItems();
|
List<SalaryItemPO> salaryItemList = getCanAdjustSalaryItems();
|
||||||
List<Long> salaryItemIds = salaryItemList.stream().map(SalaryItemPO::getId).collect(Collectors.toList());
|
List<Long> salaryItemIds = salaryItemList.stream().map(SalaryItemPO::getId).collect(Collectors.toList());
|
||||||
// 获取记录
|
//分权
|
||||||
long currentEmployeeId = user.getUID();
|
SalaryArchiveQueryParam archiveQueryParam = new SalaryArchiveQueryParam();
|
||||||
//是否开启分权
|
archiveQueryParam.setFilterType(AuthFilterTypeEnum.QUERY_DATA);
|
||||||
Boolean needAuth = getTaxAgentService(user).isNeedAuth(currentEmployeeId);
|
List<Long> salaryArchiveIds = getSalaryArchiveService(user).list(archiveQueryParam).stream().map(SalaryArchiveListDTO::getId).collect(Collectors.toList());
|
||||||
if (needAuth) {
|
queryParam.setSalaryArchiveIds(salaryArchiveIds);
|
||||||
Collection<TaxAgentPO> taxAgentPOS = getTaxAgentService(user).listAllTaxAgentsAsAdmin(currentEmployeeId);
|
|
||||||
List<Long> taxAgentIds = SalaryEntityUtil.properties(taxAgentPOS, TaxAgentPO::getId, Collectors.toList());
|
|
||||||
|
|
||||||
if (CollectionUtils.isEmpty(taxAgentIds)) {
|
|
||||||
// return new PageInfo<SalaryItemAdjustRecordListDTO>();
|
|
||||||
}
|
|
||||||
|
|
||||||
List<SalaryArchivePO> salaryArchives = getSalaryArchiveService(user).listSome(SalaryArchivePO.builder().taxAgentIds(taxAgentIds).build());
|
|
||||||
List<Long> salaryArchiveIds = SalaryEntityUtil.properties(salaryArchives, SalaryArchivePO::getId, Collectors.toList());
|
|
||||||
queryParam.setSalaryArchiveIds(salaryArchiveIds);
|
|
||||||
}
|
|
||||||
|
|
||||||
List<DataCollectionEmployee> employeeList = getSalaryEmployeeService(user).listAll(UseEmployeeTypeEnum.ALL);
|
List<DataCollectionEmployee> employeeList = getSalaryEmployeeService(user).listAll(UseEmployeeTypeEnum.ALL);
|
||||||
Map<Long, DataCollectionEmployee> employeeMap = SalaryEntityUtil.convert2Map(employeeList, DataCollectionEmployee::getEmployeeId);
|
Map<Long, DataCollectionEmployee> employeeMap = SalaryEntityUtil.convert2Map(employeeList, DataCollectionEmployee::getEmployeeId);
|
||||||
|
|
@ -718,6 +713,7 @@ public class SalaryArchiveItemServiceImpl extends Service implements SalaryArchi
|
||||||
;
|
;
|
||||||
})
|
})
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
SalaryI18nUtil.i18nList(listResult);
|
||||||
|
|
||||||
|
|
||||||
List<SalaryItemAdjustRecordListDTO> listAll = salaryArchiveItemMapper.salaryItemAdjustRecordList(SalaryItemAdjustRecordQueryParam.builder().build(), salaryItemIds);
|
List<SalaryItemAdjustRecordListDTO> listAll = salaryArchiveItemMapper.salaryItemAdjustRecordList(SalaryItemAdjustRecordQueryParam.builder().build(), salaryItemIds);
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@ import com.engine.salary.entity.salaryarchive.po.SalaryArchivePO;
|
||||||
import com.engine.salary.entity.salaryarchive.po.SalaryArchiveTaxAgentPO;
|
import com.engine.salary.entity.salaryarchive.po.SalaryArchiveTaxAgentPO;
|
||||||
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
||||||
import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeEmployeeDTO;
|
import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeEmployeeDTO;
|
||||||
|
import com.engine.salary.entity.taxagent.param.TaxAgentQueryParam;
|
||||||
import com.engine.salary.entity.taxagent.po.TaxAgentEmpChangePO;
|
import com.engine.salary.entity.taxagent.po.TaxAgentEmpChangePO;
|
||||||
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
||||||
import com.engine.salary.enums.OperateTypeEnum;
|
import com.engine.salary.enums.OperateTypeEnum;
|
||||||
|
|
@ -312,11 +313,11 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 当前可以管辖的人员
|
// 当前可以管辖的人员
|
||||||
Collection<TaxAgentPO> taxAgentList = new ArrayList<>();
|
|
||||||
if (currentEmployeeId != 1L) {
|
if (currentEmployeeId != 1L) {
|
||||||
taxAgentList = getTaxAgentService(user).listAllTaxAgents(currentEmployeeId);
|
TaxAgentQueryParam param = TaxAgentQueryParam.builder().build();
|
||||||
Collection<TaxAgentPO> finalTaxAgentList = taxAgentList;
|
param.setFilterType(AuthFilterTypeEnum.ADMIN_DATA);
|
||||||
taxAgentEmpChangeList = taxAgentEmpChangeList.stream().filter(f -> finalTaxAgentList.stream().anyMatch(e -> e.getId().equals(f.getTaxAgentId()))).collect(Collectors.toList());
|
Collection<TaxAgentPO> taxAgentList =getTaxAgentService(user).listAuth(param);
|
||||||
|
taxAgentEmpChangeList = taxAgentEmpChangeList.stream().filter(f -> taxAgentList.stream().anyMatch(e -> e.getId().equals(f.getTaxAgentId()))).collect(Collectors.toList());
|
||||||
if (CollectionUtils.isEmpty(taxAgentEmpChangeList)) {
|
if (CollectionUtils.isEmpty(taxAgentEmpChangeList)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -360,13 +361,13 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe
|
||||||
throw new SalaryRunTimeException("不允许删除薪资档案,请先开启删除档案规则配置!");
|
throw new SalaryRunTimeException("不允许删除薪资档案,请先开启删除档案规则配置!");
|
||||||
}
|
}
|
||||||
List<SalaryArchivePO> salaryArchiveList = getSalaryArchiveMapper().listSome(SalaryArchivePO.builder().ids(salaryArchiveIds).build());
|
List<SalaryArchivePO> salaryArchiveList = getSalaryArchiveMapper().listSome(SalaryArchivePO.builder().ids(salaryArchiveIds).build());
|
||||||
|
if (CollectionUtils.isEmpty(salaryArchiveList)) {
|
||||||
//查询当前登录人员管理的个税扣缴义务人
|
throw new SalaryRunTimeException("薪资档案不存在");
|
||||||
List<Long> canDeleteTaxAgentIds = getTaxAgentService(user).listAllTaxAgentsAsAdmin((long) user.getUID())
|
}
|
||||||
.stream().map(TaxAgentPO::getId).collect(Collectors.toList());
|
//权限,可操作的档案
|
||||||
boolean err = salaryArchiveList.stream().anyMatch(po -> !canDeleteTaxAgentIds.contains(po.getTaxAgentId()));
|
salaryArchiveList = getAuthService(user).auth(salaryArchiveList, AuthFilterTypeEnum.ADMIN_DATA, SalaryArchivePO.class);
|
||||||
if (CollectionUtils.isEmpty(salaryArchiveList) || err) {
|
if (CollectionUtils.isEmpty(salaryArchiveList)) {
|
||||||
throw new SalaryRunTimeException("薪资档案不存在,或没有权限删除该薪资档案!");
|
throw new SalaryRunTimeException("没有权限删除该薪资档案!");
|
||||||
}
|
}
|
||||||
Optional<SalaryArchivePO> fixedList = salaryArchiveList.stream().filter(archive -> !StringUtils.equals(archive.getRunStatus(), SalaryArchiveStatusEnum.PENDING.getValue())
|
Optional<SalaryArchivePO> fixedList = salaryArchiveList.stream().filter(archive -> !StringUtils.equals(archive.getRunStatus(), SalaryArchiveStatusEnum.PENDING.getValue())
|
||||||
&& !StringUtils.equals(archive.getRunStatus(), SalaryArchiveStatusEnum.STOP_FROM_PENDING.getValue())).findFirst();
|
&& !StringUtils.equals(archive.getRunStatus(), SalaryArchiveStatusEnum.STOP_FROM_PENDING.getValue())).findFirst();
|
||||||
|
|
@ -1097,9 +1098,13 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe
|
||||||
return StringUtils.EMPTY;
|
return StringUtils.EMPTY;
|
||||||
}
|
}
|
||||||
// 从待定薪到停薪
|
// 从待定薪到停薪
|
||||||
getSalaryArchiveMapper().deletePendingTodo(ids);
|
List<List<Long>> partition = Lists.partition((List<Long>) ids, 800);
|
||||||
|
partition.forEach(getSalaryArchiveMapper()::deletePendingTodo);
|
||||||
// 记录日志
|
// 记录日志
|
||||||
List<SalaryArchivePO> newList = getSalaryArchiveMapper().listSome(SalaryArchivePO.builder().ids(ids).build());
|
List<SalaryArchivePO> newList = new ArrayList<>();
|
||||||
|
partition.forEach(part -> {
|
||||||
|
newList.addAll(getSalaryArchiveMapper().listSome(SalaryArchivePO.builder().ids(part).build()));
|
||||||
|
});
|
||||||
String operatedesc = SalaryI18nUtil.getI18nLabel(0, "删除待办");
|
String operatedesc = SalaryI18nUtil.getI18nLabel(0, "删除待办");
|
||||||
recordLog(oldList, newList, operatedesc);
|
recordLog(oldList, newList, operatedesc);
|
||||||
|
|
||||||
|
|
@ -1129,11 +1134,14 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe
|
||||||
}
|
}
|
||||||
|
|
||||||
// 从待定薪到定薪
|
// 从待定薪到定薪
|
||||||
List<List<Long>> partition = Lists.partition((List<Long>) ids, 1000);
|
List<List<Long>> partition = Lists.partition((List<Long>) ids, 800);
|
||||||
partition.forEach(getSalaryArchiveMapper()::gotoFixed);
|
partition.forEach(getSalaryArchiveMapper()::gotoFixed);
|
||||||
|
|
||||||
// 记录日志
|
// 记录日志
|
||||||
List<SalaryArchivePO> newList = getSalaryArchiveMapper().listSome(SalaryArchivePO.builder().ids(ids).build());
|
List<SalaryArchivePO> newList = new ArrayList<>();
|
||||||
|
partition.forEach(part -> {
|
||||||
|
newList.addAll(getSalaryArchiveMapper().listSome(SalaryArchivePO.builder().ids(part).build()));
|
||||||
|
});
|
||||||
String operateDesc = SalaryI18nUtil.getI18nLabel(0, "设为发薪员工");
|
String operateDesc = SalaryI18nUtil.getI18nLabel(0, "设为发薪员工");
|
||||||
recordLog(salaryArchiveList, newList, operateDesc);
|
recordLog(salaryArchiveList, newList, operateDesc);
|
||||||
|
|
||||||
|
|
@ -1199,10 +1207,14 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe
|
||||||
}
|
}
|
||||||
|
|
||||||
// 从待停薪到停薪
|
// 从待停薪到停薪
|
||||||
getSalaryArchiveMapper().gotoStop(ids);
|
List<List<Long>> partition = Lists.partition((List<Long>) ids, 800);
|
||||||
|
partition.forEach(getSalaryArchiveMapper()::gotoStop);
|
||||||
|
|
||||||
// 记录日志
|
// 记录日志
|
||||||
List<SalaryArchivePO> newList = getSalaryArchiveMapper().listSome(SalaryArchivePO.builder().ids(ids).build());
|
List<SalaryArchivePO> newList = new ArrayList<>();
|
||||||
|
partition.forEach(part -> {
|
||||||
|
newList.addAll( getSalaryArchiveMapper().listSome(SalaryArchivePO.builder().ids(part).build()));
|
||||||
|
});
|
||||||
String operatedesc = SalaryI18nUtil.getI18nLabel(0, "停薪");
|
String operatedesc = SalaryI18nUtil.getI18nLabel(0, "停薪");
|
||||||
recordLog(oldList, newList, operatedesc);
|
recordLog(oldList, newList, operatedesc);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
package com.engine.salary.service.impl;
|
package com.engine.salary.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
|
||||||
import cn.hutool.core.util.NumberUtil;
|
import cn.hutool.core.util.NumberUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.api.formmode.mybatis.util.SqlProxyHandle;
|
import com.api.formmode.mybatis.util.SqlProxyHandle;
|
||||||
|
|
@ -20,6 +19,7 @@ import com.engine.salary.entity.salaryitem.config.SalaryItemExcelConfig;
|
||||||
import com.engine.salary.entity.salaryitem.param.*;
|
import com.engine.salary.entity.salaryitem.param.*;
|
||||||
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
||||||
import com.engine.salary.entity.salaryitem.po.SysSalaryItemPO;
|
import com.engine.salary.entity.salaryitem.po.SysSalaryItemPO;
|
||||||
|
import com.engine.salary.entity.salarysob.param.SalarySobQueryParam;
|
||||||
import com.engine.salary.entity.salarysob.po.SalarySobBackItemPO;
|
import com.engine.salary.entity.salarysob.po.SalarySobBackItemPO;
|
||||||
import com.engine.salary.entity.salarysob.po.SalarySobItemPO;
|
import com.engine.salary.entity.salarysob.po.SalarySobItemPO;
|
||||||
import com.engine.salary.entity.salarysob.po.SalarySobPO;
|
import com.engine.salary.entity.salarysob.po.SalarySobPO;
|
||||||
|
|
@ -34,6 +34,8 @@ import com.engine.salary.enums.sicategory.SharedTypeEnum;
|
||||||
import com.engine.salary.exception.SalaryRunTimeException;
|
import com.engine.salary.exception.SalaryRunTimeException;
|
||||||
import com.engine.salary.mapper.salaryitem.SalaryItemMapper;
|
import com.engine.salary.mapper.salaryitem.SalaryItemMapper;
|
||||||
import com.engine.salary.service.*;
|
import com.engine.salary.service.*;
|
||||||
|
import com.engine.salary.service.auth.AuthService;
|
||||||
|
import com.engine.salary.service.auth.AuthServiceImpl;
|
||||||
import com.engine.salary.sys.entity.vo.UploadConfigResponse;
|
import com.engine.salary.sys.entity.vo.UploadConfigResponse;
|
||||||
import com.engine.salary.util.JsonUtil;
|
import com.engine.salary.util.JsonUtil;
|
||||||
import com.engine.salary.util.SalaryEntityUtil;
|
import com.engine.salary.util.SalaryEntityUtil;
|
||||||
|
|
@ -112,6 +114,10 @@ public class SalaryItemServiceImpl extends Service implements SalaryItemService
|
||||||
return SqlProxyHandle.getProxy(SalaryItemMapper.class);
|
return SqlProxyHandle.getProxy(SalaryItemMapper.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public AuthService getAuthService(User user) {
|
||||||
|
return ServiceUtil.getService(AuthServiceImpl.class, user);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SalaryItemPO getById(Long id) {
|
public SalaryItemPO getById(Long id) {
|
||||||
return salaryItemBiz.getById(id);
|
return salaryItemBiz.getById(id);
|
||||||
|
|
@ -448,16 +454,10 @@ public class SalaryItemServiceImpl extends Service implements SalaryItemService
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Map<String, Object>> getSalarySobBySalaryItem(Long salaryItemId) {
|
public List<Map<String, Object>> getSalarySobBySalaryItem(Long salaryItemId) {
|
||||||
// 查询所有启用的薪资账套
|
// 查询所有管理的薪资账套
|
||||||
List<SalarySobItemPO> salarySobItemList = getSalarySobItemService(user).listBySalaryItemIds(Collections.singleton(salaryItemId));
|
SalarySobQueryParam salarySobQueryParam = new SalarySobQueryParam();
|
||||||
Set<Long> salarySobIds = SalaryEntityUtil.properties(salarySobItemList, SalarySobItemPO::getSalarySobId);
|
salarySobQueryParam.setFilterType(AuthFilterTypeEnum.ADMIN_DATA);
|
||||||
List<SalarySobPO> salarySobs = getSalarySobService(user).listByIds(salarySobIds);
|
List<SalarySobPO> salarySobs = getSalarySobService(user).listAuth(salarySobQueryParam);
|
||||||
// 获取能够管理的义务人
|
|
||||||
Boolean isChief = getTaxAgentService(user).isChief((long) user.getUID());
|
|
||||||
if (!isChief) {
|
|
||||||
Set<Long> taxAgentIds = SalaryEntityUtil.properties(getTaxAgentService(user).listAllTaxAgentsAsAdmin((long) user.getUID()), TaxAgentPO::getId);
|
|
||||||
salarySobs = salarySobs.stream().filter(sob -> CollectionUtil.intersection(taxAgentIds, sob.getTaxAgentIds()).size() > 0).collect(Collectors.toList());
|
|
||||||
}
|
|
||||||
return salarySobs.stream().map(m -> {
|
return salarySobs.stream().map(m -> {
|
||||||
Map<String, Object> map = new HashMap<>();
|
Map<String, Object> map = new HashMap<>();
|
||||||
map.put("id", String.valueOf(m.getId()));
|
map.put("id", String.valueOf(m.getId()));
|
||||||
|
|
|
||||||
|
|
@ -18,8 +18,6 @@ import com.engine.salary.entity.salaryformula.po.FormulaVar;
|
||||||
import com.engine.salary.entity.salaryformula.config.FormluaConfig;
|
import com.engine.salary.entity.salaryformula.config.FormluaConfig;
|
||||||
import com.engine.salary.entity.salaryformula.po.FormulaPO;
|
import com.engine.salary.entity.salaryformula.po.FormulaPO;
|
||||||
import com.engine.salary.entity.salaryformula.po.FormulaVar;
|
import com.engine.salary.entity.salaryformula.po.FormulaVar;
|
||||||
import com.engine.salary.entity.salaryitem.config.SalaryItemAllConfig;
|
|
||||||
import com.engine.salary.entity.salaryitem.param.SalaryItemSearchParam;
|
|
||||||
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
||||||
import com.engine.salary.entity.salarysob.bo.SalarySobItemAggregateBO;
|
import com.engine.salary.entity.salarysob.bo.SalarySobItemAggregateBO;
|
||||||
import com.engine.salary.entity.salarysob.dto.SalaryItemTopologyDTO;
|
import com.engine.salary.entity.salarysob.dto.SalaryItemTopologyDTO;
|
||||||
|
|
@ -28,11 +26,13 @@ import com.engine.salary.entity.salarysob.dto.SalarySobItemFormDTO;
|
||||||
import com.engine.salary.entity.salarysob.param.SalaryItemTopologyQueryParam;
|
import com.engine.salary.entity.salarysob.param.SalaryItemTopologyQueryParam;
|
||||||
import com.engine.salary.entity.salarysob.param.SalarySobItemSaveParam;
|
import com.engine.salary.entity.salarysob.param.SalarySobItemSaveParam;
|
||||||
import com.engine.salary.entity.salarysob.po.*;
|
import com.engine.salary.entity.salarysob.po.*;
|
||||||
|
import com.engine.salary.entity.taxagent.param.TaxAgentQueryParam;
|
||||||
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
||||||
import com.engine.salary.enums.OperateTypeEnum;
|
import com.engine.salary.enums.OperateTypeEnum;
|
||||||
import com.engine.salary.enums.SalaryValueTypeEnum;
|
import com.engine.salary.enums.SalaryValueTypeEnum;
|
||||||
import com.engine.salary.enums.salaryformula.SalaryFormulaReferenceEnum;
|
import com.engine.salary.enums.salaryformula.SalaryFormulaReferenceEnum;
|
||||||
import com.engine.salary.enums.salaryformula.SalarySQLReferenceEnum;
|
import com.engine.salary.enums.salaryformula.SalarySQLReferenceEnum;
|
||||||
|
import com.engine.salary.enums.auth.AuthFilterTypeEnum;
|
||||||
import com.engine.salary.exception.SalaryRunTimeException;
|
import com.engine.salary.exception.SalaryRunTimeException;
|
||||||
import com.engine.salary.mapper.salarysob.SalarySobDefaultItemMapper;
|
import com.engine.salary.mapper.salarysob.SalarySobDefaultItemMapper;
|
||||||
import com.engine.salary.mapper.salarysob.SalarySobEmpFieldMapper;
|
import com.engine.salary.mapper.salarysob.SalarySobEmpFieldMapper;
|
||||||
|
|
@ -194,15 +194,12 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe
|
||||||
Set<Long> backCalcItemIds = SalaryEntityUtil.properties(salarySobBackItems, SalarySobBackItemPO::getSalaryItemId);
|
Set<Long> backCalcItemIds = SalaryEntityUtil.properties(salarySobBackItems, SalarySobBackItemPO::getSalaryItemId);
|
||||||
salaryItemIds.addAll(backCalcItemIds);
|
salaryItemIds.addAll(backCalcItemIds);
|
||||||
|
|
||||||
Boolean needAuth = getTaxAgentService(user).isNeedAuth((long) user.getUID());
|
//账套项目分权
|
||||||
final Set<Long> ids = new HashSet<Long>();
|
TaxAgentQueryParam param = TaxAgentQueryParam.builder().build();
|
||||||
if (needAuth) {
|
param.setFilterType(AuthFilterTypeEnum.QUERY_DATA);
|
||||||
Set<Long> collect = getTaxAgentService(user).listAllTaxAgents((long) user.getUID())
|
Set<Long> ids = getTaxAgentService(user).listAuth(param).stream().map(TaxAgentPO::getId).collect(Collectors.toSet());
|
||||||
.stream().map(TaxAgentPO::getId).collect(Collectors.toSet());
|
|
||||||
ids.addAll(collect);
|
|
||||||
}
|
|
||||||
List<SalaryItemPO> salaryItemPOS = getSalaryItemService(user).listByIds(salaryItemIds).stream()
|
List<SalaryItemPO> salaryItemPOS = getSalaryItemService(user).listByIds(salaryItemIds).stream()
|
||||||
.filter(po -> Boolean.FALSE.equals(needAuth) || getSalaryItemService(user).filterInRange(ids, po))
|
.filter(po -> getSalaryItemService(user).filterInRange(ids, po))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
//获取系统值
|
//获取系统值
|
||||||
|
|
@ -247,13 +244,10 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe
|
||||||
Set<Long> backCalcItemIds = SalaryEntityUtil.properties(salarySobBackItems, SalarySobBackItemPO::getSalaryItemId);
|
Set<Long> backCalcItemIds = SalaryEntityUtil.properties(salarySobBackItems, SalarySobBackItemPO::getSalaryItemId);
|
||||||
salaryItemIds.addAll(backCalcItemIds);
|
salaryItemIds.addAll(backCalcItemIds);
|
||||||
|
|
||||||
Boolean needAuth = getTaxAgentService(user).isNeedAuth((long) user.getUID());
|
TaxAgentQueryParam param = TaxAgentQueryParam.builder().build();
|
||||||
final Set<Long> ids = new HashSet<Long>();
|
param.setFilterType(AuthFilterTypeEnum.QUERY_DATA);
|
||||||
if (needAuth) {
|
Set<Long> ids = getTaxAgentService(user).listAuth(param).stream().map(TaxAgentPO::getId).collect(Collectors.toSet());
|
||||||
Set<Long> collect = getTaxAgentService(user).listAllTaxAgents((long) user.getUID()).stream().map(TaxAgentPO::getId).collect(Collectors.toSet());
|
List<SalaryItemPO> salaryItemPOS = getSalaryItemService(user).listByIds(salaryItemIds).stream().filter(po -> getSalaryItemService(user).filterInRange(ids, po)).collect(Collectors.toList());
|
||||||
ids.addAll(collect);
|
|
||||||
}
|
|
||||||
List<SalaryItemPO> salaryItemPOS = getSalaryItemService(user).listByIds(salaryItemIds).stream().filter(po -> Boolean.FALSE.equals(needAuth) || getSalaryItemService(user).filterInRange(ids, po)).collect(Collectors.toList());
|
|
||||||
|
|
||||||
//获取系统值
|
//获取系统值
|
||||||
List<SalarySobDefaultItemPO> salarySobDefaultItemPOS = getSalarySobDefaultItemMapper().listAll();
|
List<SalarySobDefaultItemPO> salarySobDefaultItemPOS = getSalarySobDefaultItemMapper().listAll();
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.engine.salary.service.impl;
|
package com.engine.salary.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.engine.common.util.ServiceUtil;
|
import com.engine.common.util.ServiceUtil;
|
||||||
|
|
@ -1051,25 +1052,22 @@ public class SalarySobServiceImpl extends Service implements SalarySobService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void handleHistory() {
|
public void handleHistory() {
|
||||||
|
|
||||||
int count = getSobTaxLinkMapper().count();
|
|
||||||
if (count > 0) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
List<SalarySobPO> salarySobPOS = getSalarySobMapper().listAll();
|
List<SalarySobPO> salarySobPOS = getSalarySobMapper().listAll();
|
||||||
salarySobPOS.forEach(sobPO -> {
|
salarySobPOS.forEach(sobPO -> {
|
||||||
SobTaxLinkPO taxLinkPO = SobTaxLinkPO.builder()
|
List<SobTaxLinkPO> sobTaxLinkPOS = getSobTaxLinkMapper().listSome(SobTaxLinkPO.builder().sobId(sobPO.getId()).build());
|
||||||
.id(IdGenerator.generate())
|
if(CollUtil.isEmpty(sobTaxLinkPOS)){
|
||||||
.taxAgentId(sobPO.getTaxAgentId())
|
SobTaxLinkPO taxLinkPO = SobTaxLinkPO.builder()
|
||||||
.sobId(sobPO.getId())
|
.id(IdGenerator.generate())
|
||||||
.creator((long) user.getUID())
|
.taxAgentId(sobPO.getTaxAgentId())
|
||||||
.createTime(new Date())
|
.sobId(sobPO.getId())
|
||||||
.updateTime(new Date())
|
.creator((long) user.getUID())
|
||||||
.deleteType(0)
|
.createTime(new Date())
|
||||||
.tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY)
|
.updateTime(new Date())
|
||||||
.build();
|
.deleteType(0)
|
||||||
getSobTaxLinkMapper().insertIgnoreNull(taxLinkPO);
|
.tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY)
|
||||||
|
.build();
|
||||||
|
getSobTaxLinkMapper().insertIgnoreNull(taxLinkPO);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,6 @@ import com.engine.salary.entity.datacollection.param.SpecialAddDeductionParam;
|
||||||
import com.engine.salary.entity.datacollection.param.SpecialAddDeductionQueryParam;
|
import com.engine.salary.entity.datacollection.param.SpecialAddDeductionQueryParam;
|
||||||
import com.engine.salary.entity.datacollection.param.SpecialAddDeductionRecordDeleteParam;
|
import com.engine.salary.entity.datacollection.param.SpecialAddDeductionRecordDeleteParam;
|
||||||
import com.engine.salary.entity.datacollection.po.SpecialAddDeductionPO;
|
import com.engine.salary.entity.datacollection.po.SpecialAddDeductionPO;
|
||||||
import com.engine.salary.entity.taxagent.dto.TaxAgentEmployeeTaxAgentDTO;
|
|
||||||
import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeEmployeeDTO;
|
import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeEmployeeDTO;
|
||||||
import com.engine.salary.entity.taxagent.param.TaxAgentQueryParam;
|
import com.engine.salary.entity.taxagent.param.TaxAgentQueryParam;
|
||||||
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
||||||
|
|
@ -130,26 +129,6 @@ public class SpecialAddDeductionServiceImpl extends Service implements SpecialAd
|
||||||
return page;
|
return page;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void putQueryRange(SpecialAddDeductionQueryParam queryParam) {
|
|
||||||
Long employeeId = (long) user.getUID();
|
|
||||||
List<Long> taxAgentIdsAsAdmin = getTaxAgentService(user)
|
|
||||||
.listAllTaxAgentsAsAdmin(employeeId).stream().map(TaxAgentPO::getId)
|
|
||||||
.collect(Collectors.toList());
|
|
||||||
if (CollectionUtils.isEmpty(taxAgentIdsAsAdmin)) {
|
|
||||||
// 不是个税扣缴义务人管理员,限定搜索范围为当前登录人
|
|
||||||
List<Long> taxAgentIdsAsEmployee = getTaxAgentService(user)
|
|
||||||
.listAllTaxAgentsAsRange(Collections.singletonList(employeeId))
|
|
||||||
.stream().filter(t -> t.getEmployeeId().equals(employeeId))
|
|
||||||
.map(TaxAgentEmployeeTaxAgentDTO::getTaxAgentIds)
|
|
||||||
.flatMap(Collection::stream)
|
|
||||||
.collect(Collectors.toList());
|
|
||||||
queryParam.setTaxAgentIds(taxAgentIdsAsEmployee);
|
|
||||||
queryParam.setEmployeeId(employeeId);
|
|
||||||
} else {
|
|
||||||
//管理员设置相应的个税扣缴义务人来筛选
|
|
||||||
queryParam.setTaxAgentIds(taxAgentIdsAsAdmin);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -313,21 +313,9 @@ public class TaxAgentServiceImpl extends Service implements TaxAgentService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Collection<TaxAgentPO> listAllTaxAgentsAsAdmin(Long employeeId) {
|
public Collection<TaxAgentPO> listAllTaxAgentsAsAdmin(Long employeeId) {
|
||||||
List<TaxAgentPO> taxAgents = getTaxAgentMapper().listAll();
|
TaxAgentQueryParam param = TaxAgentQueryParam.builder().build();
|
||||||
// 是否开启分权
|
param.setFilterType(AuthFilterTypeEnum.ADMIN_DATA);
|
||||||
boolean isOpenDevolution = getTaxAgentBaseService(user).isOpenDevolution();
|
return listAuth(param);
|
||||||
if (!isOpenDevolution) {
|
|
||||||
return taxAgents;
|
|
||||||
}
|
|
||||||
List<Long> taxAgentIds = taxAgents.stream().map(TaxAgentPO::getId).collect(Collectors.toList());
|
|
||||||
List<Long> enableTaxAgentIds = Lists.newArrayList();
|
|
||||||
// 1.判断自己是否是管理员, 如果是管理员,就是能够查看所属个税扣缴义务人
|
|
||||||
List<TaxAgentAdminPO> taxAgentAdminList = getTaxAgentAdminService(user).listByTaxAgentIds(taxAgentIds);
|
|
||||||
// 是管理员的列表
|
|
||||||
List<Long> adminTaxAgentIds = taxAgentAdminList.stream().filter(f -> f.getEmployeeId().equals(employeeId)).map(TaxAgentAdminPO::getTaxAgentId).collect(Collectors.toList());
|
|
||||||
|
|
||||||
enableTaxAgentIds.addAll(adminTaxAgentIds);
|
|
||||||
return taxAgents.stream().filter(f -> enableTaxAgentIds.contains(f.getId())).collect(Collectors.toList());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -493,8 +481,6 @@ public class TaxAgentServiceImpl extends Service implements TaxAgentService {
|
||||||
}
|
}
|
||||||
// 删除管理员
|
// 删除管理员
|
||||||
getTaxAgentAdminService(user).deleteByTaxAgentIds(ids);
|
getTaxAgentAdminService(user).deleteByTaxAgentIds(ids);
|
||||||
// 删除分管理员和对应管理范围
|
|
||||||
// todo taxAgentSubAdminService.deleteByTaxAgentIds(ids);
|
|
||||||
// 删除人员范围
|
// 删除人员范围
|
||||||
getTaxAgentManageRangeService(user).deleteByTaxAgentIds(ids);
|
getTaxAgentManageRangeService(user).deleteByTaxAgentIds(ids);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@ import com.engine.common.util.ServiceUtil;
|
||||||
import com.engine.core.impl.Service;
|
import com.engine.core.impl.Service;
|
||||||
import com.engine.salary.encrypt.EncryptUtil;
|
import com.engine.salary.encrypt.EncryptUtil;
|
||||||
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
||||||
import com.engine.salary.entity.taxagent.dto.TaxAgentEmployeeDTO;
|
|
||||||
import com.engine.salary.entity.taxdeclaration.bo.TaxDeclarationBO;
|
import com.engine.salary.entity.taxdeclaration.bo.TaxDeclarationBO;
|
||||||
import com.engine.salary.entity.taxdeclaration.bo.TaxDeclarationDetailBO;
|
import com.engine.salary.entity.taxdeclaration.bo.TaxDeclarationDetailBO;
|
||||||
import com.engine.salary.entity.taxdeclaration.dto.*;
|
import com.engine.salary.entity.taxdeclaration.dto.*;
|
||||||
|
|
@ -27,7 +26,6 @@ import com.engine.salary.util.page.PageInfo;
|
||||||
import com.engine.salary.util.page.SalaryPageUtil;
|
import com.engine.salary.util.page.SalaryPageUtil;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.commons.lang3.BooleanUtils;
|
|
||||||
import weaver.hrm.User;
|
import weaver.hrm.User;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
@ -204,66 +202,13 @@ public class TaxDeclarationDetailServiceImpl extends Service implements TaxDecla
|
||||||
return TaxDeclarationDetailBO.convert2ListDTO4Annual(taxDeclarationDetailPOS, taxDeclarationEmployees, simpleEmployees);
|
return TaxDeclarationDetailBO.convert2ListDTO4Annual(taxDeclarationDetailPOS, taxDeclarationEmployees, simpleEmployees);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据权限范围过滤
|
|
||||||
*
|
|
||||||
* @param taxDeclarationPO
|
|
||||||
* @param taxDeclarationEmployeeDTOS
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
private List<TaxDeclarationEmployeeDTO> filterByAuthority(TaxDeclarationPO taxDeclarationPO, List<TaxDeclarationEmployeeDTO> taxDeclarationEmployeeDTOS) {
|
|
||||||
long employeeId = user.getUID();
|
|
||||||
if (CollectionUtils.isEmpty(taxDeclarationEmployeeDTOS)) {
|
|
||||||
return Collections.emptyList();
|
|
||||||
}
|
|
||||||
// 判断是否开启了分权
|
|
||||||
Boolean openDevolution = getTaxAgentService(user).isOpenDevolution();
|
|
||||||
// 是否是总管理员
|
|
||||||
Boolean isChief = getTaxAgentService(user).isChief(employeeId);
|
|
||||||
if (BooleanUtils.isFalse(openDevolution) || isChief) {
|
|
||||||
return taxDeclarationEmployeeDTOS;
|
|
||||||
}
|
|
||||||
// 查询权限范围内的人员
|
|
||||||
List<TaxAgentEmployeeDTO> taxAgentEmployeeDTOS = getTaxAgentService(user).listTaxAgentAndEmployee(employeeId);
|
|
||||||
Set<String> simpleEmployeeKeySet = SalaryEntityUtil.properties(taxAgentEmployeeDTOS, taxAgentEmployeeDTO -> taxAgentEmployeeDTO.getEmployeeId() + "-" + taxAgentEmployeeDTO.getTaxAgentId());
|
|
||||||
// 查询权限范围内的外部人员
|
|
||||||
// List<ExtEmployeePO> extEmployeePOS = extEmployeeService.listCanUseByEmployeeId(employeeId, tenantKey);
|
|
||||||
// Set<String> extEmployeeKeySet = SalaryEntityUtil.properties(extEmployeePOS, extEmployeePO -> extEmployeePO.getId() + "-" + extEmployeePO.getTaxAgentId());
|
|
||||||
// 根据权限范围过滤
|
|
||||||
return taxDeclarationEmployeeDTOS.stream().filter(taxDeclarationEmployeeDTO -> {
|
|
||||||
if (taxDeclarationEmployeeDTO.getEmployeeType() == null || Objects.equals(taxDeclarationEmployeeDTO.getEmployeeType(), EmployeeTypeEnum.ORGANIZATION.getValue())
|
|
||||||
&& simpleEmployeeKeySet.contains(taxDeclarationEmployeeDTO.getEmployeeId() + "-" + taxDeclarationPO.getTaxAgentId())) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
// if (Objects.equals(taxDeclarationEmployeeDTO.getEmployeeType(), EmployeeTypeEnum.EXT_EMPLOYEE.getValue())
|
|
||||||
// && extEmployeeKeySet.contains(taxDeclarationEmployeeDTO.getEmployeeId() + "-" + taxDeclarationPO.getTaxAgentId())) {
|
|
||||||
// return true;
|
|
||||||
// }
|
|
||||||
return false;
|
|
||||||
}).collect(Collectors.toList());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageInfo<TaxDeclarationWageListDTO> listDtoPageByParam4Wage(TaxDeclarationDetailListQueryParam queryParam) {
|
public PageInfo<TaxDeclarationWageListDTO> listDtoPageByParam4Wage(TaxDeclarationDetailListQueryParam queryParam) {
|
||||||
|
|
||||||
// 查询个税申报主表
|
|
||||||
TaxDeclarationPO taxDeclarationPO = getTaxDeclarationService(user).getById(queryParam.getTaxDeclarationId());
|
|
||||||
// 查询个税申报表明细的人员
|
// 查询个税申报表明细的人员
|
||||||
PageInfo<TaxDeclarationEmployeeDTO> employeeIdPage = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize());
|
PageInfo<TaxDeclarationEmployeeDTO> employeeIdPage = listPage4EmployeeIdByParam(queryParam);
|
||||||
// 判断是否开启了分权
|
|
||||||
Boolean openDevolution = getTaxAgentService(user).isOpenDevolution();
|
|
||||||
// 是否是总管理员
|
|
||||||
Boolean isChief = getTaxAgentService(user).isChief((long) user.getUID());
|
|
||||||
// if (BooleanUtils.isTrue(openDevolution) && !isChief) {
|
|
||||||
// List<TaxDeclarationEmployeeDTO> taxDeclarationEmployeeDTOS = getTaxDeclarationDetailMapper().list4EmployeeId(queryParam.getTaxDeclarationId());
|
|
||||||
// // 根据权限过滤
|
|
||||||
// taxDeclarationEmployeeDTOS = filterByAuthority(taxDeclarationPO, taxDeclarationEmployeeDTOS);
|
|
||||||
// employeeIdPage.setTotal(taxDeclarationEmployeeDTOS.size());
|
|
||||||
// employeeIdPage.setList(SalaryPageUtil.subList((int) employeeIdPage.getPageNum(), (int) employeeIdPage.getPageSize(), taxDeclarationEmployeeDTOS));
|
|
||||||
// } else {
|
|
||||||
employeeIdPage = listPage4EmployeeIdByParam(queryParam);
|
|
||||||
// }
|
|
||||||
PageInfo<TaxDeclarationWageListDTO> dtoPage = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), TaxDeclarationWageListDTO.class);
|
PageInfo<TaxDeclarationWageListDTO> dtoPage = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), TaxDeclarationWageListDTO.class);
|
||||||
dtoPage.setTotal(employeeIdPage.getTotal());
|
dtoPage.setTotal(employeeIdPage.getTotal());
|
||||||
if (CollectionUtils.isNotEmpty(employeeIdPage.getList())) {
|
if (CollectionUtils.isNotEmpty(employeeIdPage.getList())) {
|
||||||
|
|
@ -279,15 +224,6 @@ public class TaxDeclarationDetailServiceImpl extends Service implements TaxDecla
|
||||||
.map(TaxDeclarationEmployeeDTO::getEmployeeId)
|
.map(TaxDeclarationEmployeeDTO::getEmployeeId)
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
List<DataCollectionEmployee> simpleEmployees = getSalaryEmployeeService(user).getEmployeeByIds(simpleEmployeeIds);
|
List<DataCollectionEmployee> simpleEmployees = getSalaryEmployeeService(user).getEmployeeByIds(simpleEmployeeIds);
|
||||||
// 查询人员薪资(身份证号码等)
|
|
||||||
// List<SimpleUserInfo> simpleUserInfos = salaryEmployeeService.listByEmployeeIds(simpleEmployeeIds, tenantKey);
|
|
||||||
// 查询外部人员
|
|
||||||
// Set<Long> extEmployeeIds = employeeIdPage.getRecords().stream()
|
|
||||||
// .filter(taxDeclarationEmployeeDTO -> Objects.equals(taxDeclarationEmployeeDTO.getEmployeeType(), EmployeeTypeEnum.EXT_EMPLOYEE.getValue()))
|
|
||||||
// .map(TaxDeclarationEmployeeDTO::getEmployeeId)
|
|
||||||
// .collect(Collectors.toSet());
|
|
||||||
// List<ExtEmployeePO> extEmployees = extEmployeeService.listByIds(extEmployeeIds, tenantKey);
|
|
||||||
// 转换成列表dto
|
|
||||||
List<TaxDeclarationWageListDTO> taxDeclarationWageListDTOS = TaxDeclarationDetailBO.convert2ListDTO4Wage(taxDeclarationDetailPOS,
|
List<TaxDeclarationWageListDTO> taxDeclarationWageListDTOS = TaxDeclarationDetailBO.convert2ListDTO4Wage(taxDeclarationDetailPOS,
|
||||||
employeeIdPage.getList(), simpleEmployees);
|
employeeIdPage.getList(), simpleEmployees);
|
||||||
dtoPage.setList(taxDeclarationWageListDTOS);
|
dtoPage.setList(taxDeclarationWageListDTOS);
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO;
|
||||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO;
|
import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO;
|
||||||
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
||||||
import com.engine.salary.entity.salarysob.po.SalarySobPO;
|
import com.engine.salary.entity.salarysob.po.SalarySobPO;
|
||||||
|
import com.engine.salary.entity.taxagent.param.TaxAgentQueryParam;
|
||||||
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
||||||
import com.engine.salary.entity.taxdeclaration.bo.TaxDeclarationBO;
|
import com.engine.salary.entity.taxdeclaration.bo.TaxDeclarationBO;
|
||||||
import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationAddParam;
|
import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationAddParam;
|
||||||
|
|
@ -44,7 +45,6 @@ import com.engine.salary.util.page.SalaryPageUtil;
|
||||||
import com.engine.salary.util.valid.ValidUtil;
|
import com.engine.salary.util.valid.ValidUtil;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.commons.lang3.BooleanUtils;
|
|
||||||
import weaver.general.BaseBean;
|
import weaver.general.BaseBean;
|
||||||
import weaver.hrm.User;
|
import weaver.hrm.User;
|
||||||
|
|
||||||
|
|
@ -193,33 +193,15 @@ public class TaxDeclarationServiceImpl extends Service implements TaxDeclaration
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void save(TaxDeclarationSaveParam saveParam) {
|
public void save(TaxDeclarationSaveParam saveParam) {
|
||||||
long currentEmployeeId = user.getUID();
|
|
||||||
|
|
||||||
// 个税扣缴义务人id
|
|
||||||
Set<Long> taxAgentIds;
|
|
||||||
|
|
||||||
Long taxAgentId = saveParam.getTaxAgentId();
|
Long taxAgentId = saveParam.getTaxAgentId();
|
||||||
|
|
||||||
if (taxAgentId == null) {
|
if (taxAgentId == null) {
|
||||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "请选择要申报的扣缴义务人!"));
|
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "请选择要申报的扣缴义务人!"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (taxAgentId != null) {
|
// 个税扣缴义务人id
|
||||||
taxAgentIds = Collections.singleton(taxAgentId);
|
Set<Long> taxAgentIds = Collections.singleton(taxAgentId);
|
||||||
} else {
|
|
||||||
//管理的扣缴义务人一次性申报逻辑
|
|
||||||
Boolean openDevolution = getTaxAgentService(user).isOpenDevolution();
|
|
||||||
if (BooleanUtils.isFalse(openDevolution)) {
|
|
||||||
taxAgentIds = SalaryEntityUtil.properties(getTaxAgentService(user).listAll(), TaxAgentPO::getId);
|
|
||||||
} else {
|
|
||||||
taxAgentIds = SalaryEntityUtil.properties(getTaxAgentService(user).listAllTaxAgentsAsAdmin(currentEmployeeId), TaxAgentPO::getId);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 检查是否具有权限
|
|
||||||
if (CollectionUtils.isEmpty(taxAgentIds)) {
|
|
||||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "对不起,您不具备任何个税扣缴义务人的管理权限"));
|
|
||||||
}
|
|
||||||
|
|
||||||
// 查询个税扣缴义务人
|
// 查询个税扣缴义务人
|
||||||
List<TaxAgentPO> taxAgentPOS = getTaxAgentService(user).listByIds(taxAgentIds);
|
List<TaxAgentPO> taxAgentPOS = getTaxAgentService(user).listByIds(taxAgentIds);
|
||||||
|
|
@ -263,6 +245,11 @@ public class TaxDeclarationServiceImpl extends Service implements TaxDeclaration
|
||||||
// 查询薪资所属月的薪资核算记录
|
// 查询薪资所属月的薪资核算记录
|
||||||
salaryAcctRecordPOS = listBySalaryMonth(SalaryAcctRecordPO.builder().salaryMonths(salaryMonthDateRange).build());
|
salaryAcctRecordPOS = listBySalaryMonth(SalaryAcctRecordPO.builder().salaryMonths(salaryMonthDateRange).build());
|
||||||
|
|
||||||
|
// 无薪资核算记录,不允许生成个税申报表
|
||||||
|
if (CollectionUtils.isEmpty(salaryAcctRecordPOS)) {
|
||||||
|
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98874, "{0}无申报数据").replace("{0}", saveParam.getSalaryMonth().toString()));
|
||||||
|
}
|
||||||
|
|
||||||
// 如果当前薪资所属月下存在不同的税款所属期,属于异常业务场景,不允许生成个税申报表
|
// 如果当前薪资所属月下存在不同的税款所属期,属于异常业务场景,不允许生成个税申报表
|
||||||
taxCycle = salaryAcctRecordPOS.get(0).getTaxCycle();
|
taxCycle = salaryAcctRecordPOS.get(0).getTaxCycle();
|
||||||
boolean differentTaxCycle = salaryAcctRecordPOS.stream().anyMatch(salaryAcctRecordPO -> salaryAcctRecordPO.getTaxCycle().compareTo(taxCycle) != 0);
|
boolean differentTaxCycle = salaryAcctRecordPOS.stream().anyMatch(salaryAcctRecordPO -> salaryAcctRecordPO.getTaxCycle().compareTo(taxCycle) != 0);
|
||||||
|
|
@ -404,19 +391,13 @@ public class TaxDeclarationServiceImpl extends Service implements TaxDeclaration
|
||||||
public boolean checkByAuthority(TaxDeclarationPO taxDeclarationPO, Long employeeId) {
|
public boolean checkByAuthority(TaxDeclarationPO taxDeclarationPO, Long employeeId) {
|
||||||
// 判断是否开启了分权
|
// 判断是否开启了分权
|
||||||
Boolean openDevolution = getTaxAgentService(user).isOpenDevolution();
|
Boolean openDevolution = getTaxAgentService(user).isOpenDevolution();
|
||||||
// 判断是否是总管理员
|
// 获取所有个税扣缴义务人
|
||||||
Boolean isChief = getTaxAgentService(user).isChief(employeeId);
|
TaxAgentQueryParam param = TaxAgentQueryParam.builder().build();
|
||||||
if (openDevolution && !isChief) {
|
param.setFilterType(AuthFilterTypeEnum.ADMIN_DATA);
|
||||||
// 查询负责管理的个税扣缴义务人
|
Collection<TaxAgentPO> taxAgentList = getTaxAgentService(user).listAuth(param);
|
||||||
Collection<TaxAgentPO> taxAgentPOS = getTaxAgentService(user).listAllTaxAgentsAsAdmin(employeeId);
|
|
||||||
if (CollectionUtils.isEmpty(taxAgentPOS)) {
|
Set<Long> taxAgentIds = SalaryEntityUtil.properties(taxAgentList, TaxAgentPO::getId);
|
||||||
return false;
|
return taxAgentIds.contains(taxDeclarationPO.getTaxAgentId());
|
||||||
}
|
|
||||||
Set<Long> taxAgentIds = SalaryEntityUtil.properties(taxAgentPOS, TaxAgentPO::getId);
|
|
||||||
return taxAgentIds.contains(taxDeclarationPO.getTaxAgentId());
|
|
||||||
}
|
|
||||||
// 查询个税申报表
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -175,6 +175,7 @@ public class VariableArchiveServiceImpl extends Service implements VariableArchi
|
||||||
map.put("idNo", e.getIdNo());
|
map.put("idNo", e.getIdNo());
|
||||||
map.put("companystartdate", e.getCompanystartdate());
|
map.put("companystartdate", e.getCompanystartdate());
|
||||||
map.put("dismissdate", e.getDismissdate());
|
map.put("dismissdate", e.getDismissdate());
|
||||||
|
map.put("opts", e.getOpts());
|
||||||
|
|
||||||
// 浮动薪资项目动态
|
// 浮动薪资项目动态
|
||||||
Optional<Map<String, Object>> optionalItem = variableArchiveItemData.stream().filter(f -> f.get("variableArchiveId").toString().equals(e.getId().toString())).findFirst();
|
Optional<Map<String, Object>> optionalItem = variableArchiveItemData.stream().filter(f -> f.get("variableArchiveId").toString().equals(e.getId().toString())).findFirst();
|
||||||
|
|
|
||||||
|
|
@ -71,6 +71,11 @@ public class SalarySysConstant {
|
||||||
*/
|
*/
|
||||||
public static final String SALARY_ACCT_EMPLOYEE_RULE = "salaryAcctEmployeeRule";
|
public static final String SALARY_ACCT_EMPLOYEE_RULE = "salaryAcctEmployeeRule";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否采用线程池,同步异步。空/1异步, 0同步
|
||||||
|
*/
|
||||||
|
public static final String SALARY_ACCT_SYNC_TYPE = "SALARY_ACCT_SYNC_TYPE";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 工资单二次验证方式
|
* 工资单二次验证方式
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,11 @@ import java.util.stream.Collectors;
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class AutoSyncEmpArchiveStartDateJob extends BaseCronJob {
|
public class AutoSyncEmpArchiveStartDateJob extends BaseCronJob {
|
||||||
|
|
||||||
|
private String syncInsuranceArchive;
|
||||||
|
private String syncSalaryArchive;
|
||||||
|
|
||||||
|
private String allStayAddToPay;
|
||||||
|
private String allGotoFixed;
|
||||||
private SalaryArchiveService getSalaryArchiveService(User user) {
|
private SalaryArchiveService getSalaryArchiveService(User user) {
|
||||||
return ServiceUtil.getService(SalaryArchiveServiceImpl.class, user);
|
return ServiceUtil.getService(SalaryArchiveServiceImpl.class, user);
|
||||||
}
|
}
|
||||||
|
|
@ -55,12 +60,6 @@ public class AutoSyncEmpArchiveStartDateJob extends BaseCronJob {
|
||||||
return ServiceUtil.getService(SIArchivesServiceImpl.class, user);
|
return ServiceUtil.getService(SIArchivesServiceImpl.class, user);
|
||||||
}
|
}
|
||||||
|
|
||||||
private String syncInsuranceArchive;
|
|
||||||
private String syncSalaryArchive;
|
|
||||||
|
|
||||||
private String allStayAddToPay;
|
|
||||||
private String allGotoFixed;
|
|
||||||
|
|
||||||
private SalaryArchiveBiz getSalaryArchiveMapper = new SalaryArchiveBiz();
|
private SalaryArchiveBiz getSalaryArchiveMapper = new SalaryArchiveBiz();
|
||||||
|
|
||||||
private SocialSchemeMapper getSocialSchemeMapper() {
|
private SocialSchemeMapper getSocialSchemeMapper() {
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,13 @@ import java.util.*;
|
||||||
*/
|
*/
|
||||||
public class AutoSyncResignationEmpArchiveJob extends BaseCronJob {
|
public class AutoSyncResignationEmpArchiveJob extends BaseCronJob {
|
||||||
|
|
||||||
|
private String syncInsuranceArchive;
|
||||||
|
private String syncSalaryArchive;
|
||||||
|
|
||||||
|
private String allStayAddToPay;
|
||||||
|
private String allGotoFixed;
|
||||||
|
|
||||||
|
|
||||||
private SalaryArchiveService getSalaryArchiveService(User user) {
|
private SalaryArchiveService getSalaryArchiveService(User user) {
|
||||||
return ServiceUtil.getService(SalaryArchiveServiceImpl.class,user);
|
return ServiceUtil.getService(SalaryArchiveServiceImpl.class,user);
|
||||||
}
|
}
|
||||||
|
|
@ -73,39 +80,43 @@ public class AutoSyncResignationEmpArchiveJob extends BaseCronJob {
|
||||||
}
|
}
|
||||||
cal.add(Calendar.MONTH, preMonthValue);
|
cal.add(Calendar.MONTH, preMonthValue);
|
||||||
Map<Long, String> resignationMap = getSalaryEmployeeService(user).getResignationMapByDate(SalaryDateUtil.getFormatDate(cal.getTime()));
|
Map<Long, String> resignationMap = getSalaryEmployeeService(user).getResignationMapByDate(SalaryDateUtil.getFormatDate(cal.getTime()));
|
||||||
// 获取离职人员中没有设置最后发薪日期的薪资档案
|
|
||||||
List<SalaryArchivePO> salaryArchivePOS = getSalaryArchiveService(user).listPayEndDateIsNull(new ArrayList<>(resignationMap.keySet()));
|
if (StringUtils.isBlank(syncSalaryArchive) || !StringUtils.equals(syncSalaryArchive, "false")) {
|
||||||
Date now = new Date();
|
// 获取离职人员中没有设置最后发薪日期的薪资档案
|
||||||
List<SalaryArchivePO> needUpdateSalaryArchiveList = new ArrayList<>();
|
List<SalaryArchivePO> salaryArchivePOS = getSalaryArchiveService(user).listPayEndDateIsNull(new ArrayList<>(resignationMap.keySet()));
|
||||||
for(SalaryArchivePO archive : salaryArchivePOS){
|
Date now = new Date();
|
||||||
String dismissDate = resignationMap.get(archive.getEmployeeId());
|
List<SalaryArchivePO> needUpdateSalaryArchiveList = new ArrayList<>();
|
||||||
if (StringUtils.isNotBlank(dismissDate)) {
|
for(SalaryArchivePO archive : salaryArchivePOS){
|
||||||
archive.setPayEndDate(SalaryDateUtil.dateStrToLocalDate(dismissDate));
|
String dismissDate = resignationMap.get(archive.getEmployeeId());
|
||||||
archive.setUpdateTime(now);
|
if (StringUtils.isNotBlank(dismissDate)) {
|
||||||
needUpdateSalaryArchiveList.add(archive);
|
archive.setPayEndDate(SalaryDateUtil.dateStrToLocalDate(dismissDate));
|
||||||
|
archive.setUpdateTime(now);
|
||||||
|
needUpdateSalaryArchiveList.add(archive);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (CollectionUtils.isNotEmpty(needUpdateSalaryArchiveList)) {
|
||||||
|
getSalaryArchiveMapper.batchUpdate(needUpdateSalaryArchiveList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (CollectionUtils.isNotEmpty(needUpdateSalaryArchiveList)) {
|
if (StringUtils.isBlank(syncInsuranceArchive) || !StringUtils.equals(syncInsuranceArchive, "false")) {
|
||||||
getSalaryArchiveMapper.batchUpdate(needUpdateSalaryArchiveList);
|
// 获取离职人员中没有设置最后缴纳月的社保福利档案
|
||||||
}
|
|
||||||
|
|
||||||
// 获取离职人员中没有设置最后缴纳月的社保福利档案
|
|
||||||
// List<InsuranceArchivesBaseInfoPO> needSyncList = siArchivesBiz.listEndDateIsNull(new ArrayList<>(resignationMap.keySet()));
|
// List<InsuranceArchivesBaseInfoPO> needSyncList = siArchivesBiz.listEndDateIsNull(new ArrayList<>(resignationMap.keySet()));
|
||||||
List<InsuranceArchivesBaseInfoPO> needSyncList = getSIArchivesService(user).listEndDateIsNull(new ArrayList<>(resignationMap.keySet()));
|
List<InsuranceArchivesBaseInfoPO> needSyncList = getSIArchivesService(user).listEndDateIsNull(new ArrayList<>(resignationMap.keySet()));
|
||||||
// 设置社保、公积金最后缴纳月
|
// 设置社保、公积金最后缴纳月
|
||||||
for(InsuranceArchivesBaseInfoPO po : needSyncList){
|
for(InsuranceArchivesBaseInfoPO po : needSyncList){
|
||||||
String dismissDate = resignationMap.get(po.getEmployeeId());
|
String dismissDate = resignationMap.get(po.getEmployeeId());
|
||||||
if (StringUtils.isNotEmpty(dismissDate)) {
|
if (StringUtils.isNotEmpty(dismissDate)) {
|
||||||
dismissDate = StringUtils.substring(dismissDate,0,7);
|
dismissDate = StringUtils.substring(dismissDate,0,7);
|
||||||
// 更新社保最后缴纳月
|
// 更新社保最后缴纳月
|
||||||
Long socialArchivesId = po.getSocialArchivesId();
|
Long socialArchivesId = po.getSocialArchivesId();
|
||||||
getSocialSchemeMapper().updateEndTime(socialArchivesId, dismissDate);
|
getSocialSchemeMapper().updateEndTime(socialArchivesId, dismissDate);
|
||||||
// 更新公积金最后缴纳月
|
// 更新公积金最后缴纳月
|
||||||
Long fundArchivesId = po.getFundArchivesId();
|
Long fundArchivesId = po.getFundArchivesId();
|
||||||
getFundSchemeMapper().updateEndTime(fundArchivesId, dismissDate);
|
getFundSchemeMapper().updateEndTime(fundArchivesId, dismissDate);
|
||||||
// 更新企业年金及其他福利最后缴纳月
|
// 更新企业年金及其他福利最后缴纳月
|
||||||
Long otherArchivesId = po.getOtherArchivesId();
|
Long otherArchivesId = po.getOtherArchivesId();
|
||||||
getOtherSchemeMapper().updateEndTime(otherArchivesId, dismissDate);
|
getOtherSchemeMapper().updateEndTime(otherArchivesId, dismissDate);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package com.engine.salary.web;
|
package com.engine.salary.web;
|
||||||
|
|
||||||
import com.engine.common.util.ServiceUtil;
|
import com.engine.common.util.ServiceUtil;
|
||||||
|
import com.engine.salary.entity.extemp.dto.ExtEmpDTO;
|
||||||
import com.engine.salary.entity.extemp.param.ExtEmpImportParam;
|
import com.engine.salary.entity.extemp.param.ExtEmpImportParam;
|
||||||
import com.engine.salary.entity.extemp.param.ExtEmpQueryParam;
|
import com.engine.salary.entity.extemp.param.ExtEmpQueryParam;
|
||||||
import com.engine.salary.entity.extemp.param.ExtEmpSaveParam;
|
import com.engine.salary.entity.extemp.param.ExtEmpSaveParam;
|
||||||
|
|
@ -48,7 +49,7 @@ public class ExtEmpController {
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
public String list(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody ExtEmpQueryParam param) {
|
public String list(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody ExtEmpQueryParam param) {
|
||||||
User user = HrmUserVarify.getUser(request, response);
|
User user = HrmUserVarify.getUser(request, response);
|
||||||
return new ResponseResult<ExtEmpQueryParam, PageInfo<ExtEmpPO>>(user).run(getExtEmpWrapper(user)::listPage, param);
|
return new ResponseResult<ExtEmpQueryParam, PageInfo<ExtEmpDTO>>(user).run(getExtEmpWrapper(user)::listPage, param);
|
||||||
}
|
}
|
||||||
|
|
||||||
@POST
|
@POST
|
||||||
|
|
|
||||||
|
|
@ -243,6 +243,38 @@ public class SIAccountController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 正常缴纳页 删除社保核算人员
|
||||||
|
* @param request
|
||||||
|
* @param response
|
||||||
|
* @param param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@POST
|
||||||
|
@Path("/deleteSocialAcctEmp")
|
||||||
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
|
public String deleteSocialAcctEmp(@Context HttpServletRequest request, @Context HttpServletResponse response,
|
||||||
|
@RequestBody SaveCommonAccountParam param) {
|
||||||
|
User user = HrmUserVarify.getUser(request, response);
|
||||||
|
return new ResponseResult<SaveCommonAccountParam, String>(user).run(getService(user)::deleteSocialAcctEmp, param);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 正常缴纳页 添加社保核算人员
|
||||||
|
* @param request
|
||||||
|
* @param response
|
||||||
|
* @param param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@POST
|
||||||
|
@Path("/addSocialAcctEmp")
|
||||||
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
|
public String addSocialAcctEmp(@Context HttpServletRequest request, @Context HttpServletResponse response,
|
||||||
|
@RequestBody SaveCommonAccountParam param) {
|
||||||
|
User user = HrmUserVarify.getUser(request, response);
|
||||||
|
return new ResponseResult<SaveCommonAccountParam, String>(user).run(getService(user)::addSocialAcctEmp, param);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除月份表单
|
* 删除月份表单
|
||||||
|
|
|
||||||
|
|
@ -129,9 +129,7 @@ public class AddUpDeductionWrapper extends Service {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public XSSFWorkbook downloadTemplate(AddUpDeductionQueryParam queryParam) {
|
public XSSFWorkbook downloadTemplate(AddUpDeductionQueryParam queryParam) {
|
||||||
// 构建异步导出参数
|
return getAddUpDeductionService(user).downloadTemplate(queryParam);
|
||||||
boolean isChief = getTaxAgentService(user).isChief((long) user.getUID());
|
|
||||||
return getAddUpDeductionService(user).downloadTemplate(isChief, queryParam);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ package com.engine.salary.wrapper;
|
||||||
|
|
||||||
import com.engine.common.util.ServiceUtil;
|
import com.engine.common.util.ServiceUtil;
|
||||||
import com.engine.core.impl.Service;
|
import com.engine.core.impl.Service;
|
||||||
|
import com.engine.salary.entity.extemp.dto.ExtEmpDTO;
|
||||||
import com.engine.salary.entity.extemp.param.ExtEmpImportParam;
|
import com.engine.salary.entity.extemp.param.ExtEmpImportParam;
|
||||||
import com.engine.salary.entity.extemp.param.ExtEmpQueryParam;
|
import com.engine.salary.entity.extemp.param.ExtEmpQueryParam;
|
||||||
import com.engine.salary.entity.extemp.param.ExtEmpSaveParam;
|
import com.engine.salary.entity.extemp.param.ExtEmpSaveParam;
|
||||||
|
|
@ -30,7 +31,7 @@ public class ExtEmpWrapper extends Service {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public PageInfo<ExtEmpPO> listPage(ExtEmpQueryParam param) {
|
public PageInfo<ExtEmpDTO> listPage(ExtEmpQueryParam param) {
|
||||||
return getExtEmpService(user).listPage(param);
|
return getExtEmpService(user).listPage(param);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,6 @@ import com.engine.salary.entity.salaryarchive.dto.SingleSalaryItemAdjustRecordLi
|
||||||
import com.engine.salary.entity.salaryarchive.param.*;
|
import com.engine.salary.entity.salaryarchive.param.*;
|
||||||
import com.engine.salary.entity.salaryarchive.po.SalaryArchiveItemPO;
|
import com.engine.salary.entity.salaryarchive.po.SalaryArchiveItemPO;
|
||||||
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
||||||
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
|
||||||
import com.engine.salary.enums.OperateTypeEnum;
|
import com.engine.salary.enums.OperateTypeEnum;
|
||||||
import com.engine.salary.enums.UserStatusEnum;
|
import com.engine.salary.enums.UserStatusEnum;
|
||||||
import com.engine.salary.enums.auth.AuthFilterTypeEnum;
|
import com.engine.salary.enums.auth.AuthFilterTypeEnum;
|
||||||
|
|
@ -102,11 +101,8 @@ public class SalaryArchiveItemWrapper extends Service implements SalaryArchiveIt
|
||||||
columns.add(SalaryI18nUtil.getI18nLabel(85434, "调整后"));
|
columns.add(SalaryI18nUtil.getI18nLabel(85434, "调整后"));
|
||||||
// 获取所有可被引用的薪资项目
|
// 获取所有可被引用的薪资项目
|
||||||
List<SalaryItemPO> salaryItemList = getSalaryArchiveItemService(user).getCanAdjustSalaryItems();
|
List<SalaryItemPO> salaryItemList = getSalaryArchiveItemService(user).getCanAdjustSalaryItems();
|
||||||
Set<Long> taxAgentIds = getTaxAgentService(user).listAllTaxAgents((long) user.getUID())
|
|
||||||
.stream().map(TaxAgentPO::getId)
|
|
||||||
.collect(Collectors.toSet());
|
|
||||||
List<Map<String, Object>> salaryItems = salaryItemList.stream()
|
List<Map<String, Object>> salaryItems = salaryItemList.stream()
|
||||||
.filter(po -> getSalaryItemService(user).filterInRange(taxAgentIds, po))
|
|
||||||
.map(m -> {
|
.map(m -> {
|
||||||
Map<String, Object> salaryItemMap = new LinkedHashMap<>();
|
Map<String, Object> salaryItemMap = new LinkedHashMap<>();
|
||||||
salaryItemMap.put("id", String.valueOf(m.getId()));
|
salaryItemMap.put("id", String.valueOf(m.getId()));
|
||||||
|
|
|
||||||
|
|
@ -10,8 +10,10 @@ import com.engine.salary.entity.salaryarchive.param.SingleTaxAgentAdjustRecordQu
|
||||||
import com.engine.salary.entity.salaryarchive.param.TaxAgentAdjustRecordQueryParam;
|
import com.engine.salary.entity.salaryarchive.param.TaxAgentAdjustRecordQueryParam;
|
||||||
import com.engine.salary.entity.salaryarchive.po.SalaryArchiveTaxAgentPO;
|
import com.engine.salary.entity.salaryarchive.po.SalaryArchiveTaxAgentPO;
|
||||||
import com.engine.salary.entity.taxagent.dto.TaxAgentListDTO;
|
import com.engine.salary.entity.taxagent.dto.TaxAgentListDTO;
|
||||||
|
import com.engine.salary.entity.taxagent.param.TaxAgentQueryParam;
|
||||||
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
||||||
import com.engine.salary.enums.UserStatusEnum;
|
import com.engine.salary.enums.UserStatusEnum;
|
||||||
|
import com.engine.salary.enums.auth.AuthFilterTypeEnum;
|
||||||
import com.engine.salary.enums.salaryarchive.SalaryArchiveTaxAgentAdjustReasonEnum;
|
import com.engine.salary.enums.salaryarchive.SalaryArchiveTaxAgentAdjustReasonEnum;
|
||||||
import com.engine.salary.exception.SalaryRunTimeException;
|
import com.engine.salary.exception.SalaryRunTimeException;
|
||||||
import com.engine.salary.service.SalaryArchiveTaxAgentService;
|
import com.engine.salary.service.SalaryArchiveTaxAgentService;
|
||||||
|
|
@ -88,7 +90,10 @@ public class SalaryArchiveTaxAgentWrapper extends Service {
|
||||||
|
|
||||||
private Map<String, Object> buildTaxAgentForm(Date effectiveTime, String adjustReason, String adjustBefore, Long adjustAfter) {
|
private Map<String, Object> buildTaxAgentForm(Date effectiveTime, String adjustReason, String adjustBefore, Long adjustAfter) {
|
||||||
// 个税扣缴义务人下拉列表
|
// 个税扣缴义务人下拉列表
|
||||||
Collection<TaxAgentPO> taxAgentList = getTaxAgentService(user).listAllTaxAgentsAsAdmin((long)user.getUID());
|
TaxAgentQueryParam param = TaxAgentQueryParam.builder().build();
|
||||||
|
param.setFilterType(AuthFilterTypeEnum.ADMIN_DATA);
|
||||||
|
Collection<TaxAgentPO> taxAgentList = getTaxAgentService(user).listAuth(param);
|
||||||
|
|
||||||
Map<String, Object> map = new HashMap<>();
|
Map<String, Object> map = new HashMap<>();
|
||||||
map.put("adjustReasonList", SalaryArchiveTaxAgentAdjustReasonEnum.getList());
|
map.put("adjustReasonList", SalaryArchiveTaxAgentAdjustReasonEnum.getList());
|
||||||
map.put("taxAgentList", taxAgentList);
|
map.put("taxAgentList", taxAgentList);
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,9 @@ import com.cloudstore.eccom.pc.table.WeaTableColumn;
|
||||||
import com.cloudstore.eccom.result.WeaResultMsg;
|
import com.cloudstore.eccom.result.WeaResultMsg;
|
||||||
import com.engine.common.util.ServiceUtil;
|
import com.engine.common.util.ServiceUtil;
|
||||||
import com.engine.core.impl.Service;
|
import com.engine.core.impl.Service;
|
||||||
|
import com.engine.hrmelog.entity.dto.LoggerContext;
|
||||||
import com.engine.salary.component.SalaryWeaTable;
|
import com.engine.salary.component.SalaryWeaTable;
|
||||||
import com.engine.salary.config.SalaryElogConfig;
|
import com.engine.salary.config.SalaryElogConfig;
|
||||||
import com.engine.hrmelog.entity.dto.LoggerContext;
|
|
||||||
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
||||||
import com.engine.salary.entity.salaryarchive.bo.SalaryArchiveBO;
|
import com.engine.salary.entity.salaryarchive.bo.SalaryArchiveBO;
|
||||||
import com.engine.salary.entity.salaryarchive.dto.SalaryArchiveBaseInfoFormDTO;
|
import com.engine.salary.entity.salaryarchive.dto.SalaryArchiveBaseInfoFormDTO;
|
||||||
|
|
@ -147,12 +147,6 @@ public class SalaryArchiveWrapper extends Service {
|
||||||
// 获取所有可被引用的薪资项目
|
// 获取所有可被引用的薪资项目
|
||||||
List<SalaryItemPO> salaryItems = getSalaryArchiveItemService(user).getCanAdjustSalaryItems();
|
List<SalaryItemPO> salaryItems = getSalaryArchiveItemService(user).getCanAdjustSalaryItems();
|
||||||
|
|
||||||
Set<Long> userTaxAgentIds = getTaxAgentService(user).listAllTaxAgents((long) user.getUID())
|
|
||||||
.stream().map(TaxAgentPO::getId).collect(Collectors.toSet());
|
|
||||||
salaryItems = salaryItems.stream()
|
|
||||||
.filter(po -> getSalaryItemService(user).filterInRange(userTaxAgentIds, po))
|
|
||||||
.collect(Collectors.toList());
|
|
||||||
|
|
||||||
//整合所有的显示列(固定列+薪资项目动态列)
|
//整合所有的显示列(固定列+薪资项目动态列)
|
||||||
List<Map<String, Object>> listMaps = getSalaryArchiveService(user).buildSalaryArchiveData(salaryArchives, taxAgentLists, salaryItems, Boolean.TRUE);
|
List<Map<String, Object>> listMaps = getSalaryArchiveService(user).buildSalaryArchiveData(salaryArchives, taxAgentLists, salaryItems, Boolean.TRUE);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,9 @@ import com.engine.salary.entity.salarysob.param.SalaryItemTopologyQueryParam;
|
||||||
import com.engine.salary.entity.salarysob.param.SalarySobItemSaveParam;
|
import com.engine.salary.entity.salarysob.param.SalarySobItemSaveParam;
|
||||||
import com.engine.salary.entity.salarysob.po.SalarySobItemGroupPO;
|
import com.engine.salary.entity.salarysob.po.SalarySobItemGroupPO;
|
||||||
import com.engine.salary.entity.salarysob.po.SalarySobItemPO;
|
import com.engine.salary.entity.salarysob.po.SalarySobItemPO;
|
||||||
|
import com.engine.salary.entity.taxagent.param.TaxAgentQueryParam;
|
||||||
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
||||||
|
import com.engine.salary.enums.auth.AuthFilterTypeEnum;
|
||||||
import com.engine.salary.service.*;
|
import com.engine.salary.service.*;
|
||||||
import com.engine.salary.service.impl.*;
|
import com.engine.salary.service.impl.*;
|
||||||
import com.engine.salary.util.SalaryEntityUtil;
|
import com.engine.salary.util.SalaryEntityUtil;
|
||||||
|
|
@ -79,9 +81,10 @@ public class SalarySobItemWrapper extends Service {
|
||||||
|
|
||||||
List<SalaryItemPO> salaryItemList = getSalaryItemService(user).listByParam(queryParam);
|
List<SalaryItemPO> salaryItemList = getSalaryItemService(user).listByParam(queryParam);
|
||||||
|
|
||||||
Set<Long> taxAgentIds = getTaxAgentService(user).listAllTaxAgents((long) user.getUID())
|
TaxAgentQueryParam param = TaxAgentQueryParam.builder().build();
|
||||||
.stream().map(TaxAgentPO::getId)
|
param.setFilterType(AuthFilterTypeEnum.QUERY_DATA);
|
||||||
.collect(Collectors.toSet());
|
Set<Long> taxAgentIds = getTaxAgentService(user).listAuth(param).stream().map(TaxAgentPO::getId).collect(Collectors.toSet());
|
||||||
|
|
||||||
salaryItemList = salaryItemList.stream()
|
salaryItemList = salaryItemList.stream()
|
||||||
.filter(po -> getSalaryItemService(user).filterInRange(taxAgentIds, po))
|
.filter(po -> getSalaryItemService(user).filterInRange(taxAgentIds, po))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
package com.engine.salary.wrapper;
|
package com.engine.salary.wrapper;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
|
||||||
import com.engine.common.util.ServiceUtil;
|
import com.engine.common.util.ServiceUtil;
|
||||||
import com.engine.core.impl.Service;
|
import com.engine.core.impl.Service;
|
||||||
import com.engine.salary.constant.SalaryDefaultTenantConstant;
|
import com.engine.salary.constant.SalaryDefaultTenantConstant;
|
||||||
|
|
@ -17,10 +16,13 @@ import com.engine.salary.entity.salarysob.po.SalarySobDefaultBackItemPO;
|
||||||
import com.engine.salary.entity.salarysob.po.SalarySobPO;
|
import com.engine.salary.entity.salarysob.po.SalarySobPO;
|
||||||
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
||||||
import com.engine.salary.enums.salarysob.DeclareReportTypeEnum;
|
import com.engine.salary.enums.salarysob.DeclareReportTypeEnum;
|
||||||
|
import com.engine.salary.enums.auth.AuthFilterTypeEnum;
|
||||||
import com.engine.salary.enums.salarysob.IncomeCategoryEnum;
|
import com.engine.salary.enums.salarysob.IncomeCategoryEnum;
|
||||||
import com.engine.salary.enums.sicategory.DeleteTypeEnum;
|
import com.engine.salary.enums.sicategory.DeleteTypeEnum;
|
||||||
import com.engine.salary.exception.SalaryRunTimeException;
|
import com.engine.salary.exception.SalaryRunTimeException;
|
||||||
import com.engine.salary.service.*;
|
import com.engine.salary.service.*;
|
||||||
|
import com.engine.salary.service.auth.AuthService;
|
||||||
|
import com.engine.salary.service.auth.AuthServiceImpl;
|
||||||
import com.engine.salary.service.impl.*;
|
import com.engine.salary.service.impl.*;
|
||||||
import com.engine.salary.util.SalaryEntityUtil;
|
import com.engine.salary.util.SalaryEntityUtil;
|
||||||
import com.engine.salary.util.SalaryI18nUtil;
|
import com.engine.salary.util.SalaryI18nUtil;
|
||||||
|
|
@ -69,6 +71,9 @@ public class SalarySobWrapper extends Service {
|
||||||
return ServiceUtil.getService(SalarySobItemServiceImpl.class, user);
|
return ServiceUtil.getService(SalarySobItemServiceImpl.class, user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public AuthService getAuthService(User user) {
|
||||||
|
return ServiceUtil.getService(AuthServiceImpl.class, user);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 薪资账套列表
|
* 薪资账套列表
|
||||||
|
|
@ -286,15 +291,7 @@ public class SalarySobWrapper extends Service {
|
||||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98379, "参数错误,薪资账套不存在或者已被删除"));
|
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98379, "参数错误,薪资账套不存在或者已被删除"));
|
||||||
}
|
}
|
||||||
|
|
||||||
// 判断是否开启了分权
|
return getAuthService(user).auth(salarySobPO, AuthFilterTypeEnum.DATA_OPT, SalarySobPO.class);
|
||||||
Boolean openDevolution = getTaxAgentService(user).isOpenDevolution();
|
|
||||||
if (!openDevolution) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
Collection<TaxAgentPO> taxAgentPOS = getTaxAgentService(user).listAllTaxAgentsAsAdmin(employeeId);
|
|
||||||
Set<Long> taxAgentIds = SalaryEntityUtil.properties(taxAgentPOS, TaxAgentPO::getId);
|
|
||||||
Collection intersection = CollectionUtil.intersection(taxAgentIds, salarySobPO.getTaxAgentIds());
|
|
||||||
return intersection.size() > 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<SalarySobPO> listByTaxAgent(SalarySobQueryParam param) {
|
public List<SalarySobPO> listByTaxAgent(SalarySobQueryParam param) {
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ import com.engine.salary.entity.taxagent.po.TaxAgentAdminPO;
|
||||||
import com.engine.salary.entity.taxagent.po.TaxAgentExtRangePO;
|
import com.engine.salary.entity.taxagent.po.TaxAgentExtRangePO;
|
||||||
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
||||||
import com.engine.salary.enums.UserStatusEnum;
|
import com.engine.salary.enums.UserStatusEnum;
|
||||||
|
import com.engine.salary.enums.auth.AuthFilterTypeEnum;
|
||||||
import com.engine.salary.enums.salarysob.TargetTypeEnum;
|
import com.engine.salary.enums.salarysob.TargetTypeEnum;
|
||||||
import com.engine.salary.exception.SalaryRunTimeException;
|
import com.engine.salary.exception.SalaryRunTimeException;
|
||||||
import com.engine.salary.service.*;
|
import com.engine.salary.service.*;
|
||||||
|
|
@ -116,8 +117,6 @@ public class TaxAgentWrapper extends Service {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public PageInfo<Map<String, Object>> list(TaxAgentQueryParam queryParam) {
|
public PageInfo<Map<String, Object>> list(TaxAgentQueryParam queryParam) {
|
||||||
// 是否是总管理员
|
|
||||||
Boolean isChief = getTaxAgentService(user).isChief((long) user.getUID());
|
|
||||||
// 是否开启分权
|
// 是否开启分权
|
||||||
boolean isOpenDevolution = getTaxAgentBaseService(user).isOpenDevolution();
|
boolean isOpenDevolution = getTaxAgentBaseService(user).isOpenDevolution();
|
||||||
|
|
||||||
|
|
@ -448,11 +447,12 @@ public class TaxAgentWrapper extends Service {
|
||||||
*/
|
*/
|
||||||
public String syncRange() {
|
public String syncRange() {
|
||||||
long currentEmployeeId = (long) user.getUID();
|
long currentEmployeeId = (long) user.getUID();
|
||||||
List<Long> taxAgentIds = this.getTaxAgentService(user).listAllTaxAgents(currentEmployeeId).stream().map(TaxAgentPO::getId).collect(Collectors.toList());
|
|
||||||
|
|
||||||
String index = SalaryCacheKey.TAX_AGENT_MANAGE_RANGE_SYNC + "-" + currentEmployeeId;
|
String index = SalaryCacheKey.TAX_AGENT_MANAGE_RANGE_SYNC + "-" + currentEmployeeId;
|
||||||
String syncRange = Util.null2String(Util_DataCache.getObjVal(index));
|
String syncRange = Util.null2String(Util_DataCache.getObjVal(index));
|
||||||
if (StringUtils.isEmpty(syncRange)) {
|
if (StringUtils.isEmpty(syncRange)) {
|
||||||
|
TaxAgentQueryParam param = TaxAgentQueryParam.builder().build();
|
||||||
|
param.setFilterType(AuthFilterTypeEnum.ADMIN_DATA);
|
||||||
|
List<Long> taxAgentIds = getTaxAgentService(user).listAuth(param).stream().map(TaxAgentPO::getId).collect(Collectors.toList());
|
||||||
getTaxAgentManageRangeService(user).syncManageRange(taxAgentIds, index);
|
getTaxAgentManageRangeService(user).syncManageRange(taxAgentIds, index);
|
||||||
} else {
|
} else {
|
||||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(135788, "人员范围同步过于频繁,请稍后再试"));
|
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(135788, "人员范围同步过于频繁,请稍后再试"));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue