人员信息报送temp
This commit is contained in:
parent
38f3461c64
commit
58eaddc33e
|
|
@ -0,0 +1,14 @@
|
||||||
|
package com.api.salary.web;
|
||||||
|
|
||||||
|
import javax.ws.rs.Path;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 人员报送
|
||||||
|
* @author: xiajun
|
||||||
|
* @modified By: xiajun
|
||||||
|
* @date: Created in 9/6/22 3:37 PM
|
||||||
|
* @version:v1.0
|
||||||
|
*/
|
||||||
|
@Path("/bs/hrmsalary/employeedeclare")
|
||||||
|
public class EmployeeDeclareController extends com.engine.salary.web.EmployeeDeclareController {
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,151 @@
|
||||||
|
package com.engine.salary.entity.employeedeclare.bo;
|
||||||
|
|
||||||
|
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
||||||
|
import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareFailListDTO;
|
||||||
|
import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareListDTO;
|
||||||
|
import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO;
|
||||||
|
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
||||||
|
import com.engine.salary.enums.employeedeclare.*;
|
||||||
|
import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum;
|
||||||
|
import com.engine.salary.util.SalaryDateUtil;
|
||||||
|
import com.engine.salary.util.SalaryEntityUtil;
|
||||||
|
import com.engine.salary.util.SalaryEnumUtil;
|
||||||
|
import com.engine.salary.util.SalaryI18nUtil;
|
||||||
|
import com.google.common.collect.Lists;
|
||||||
|
import com.google.common.collect.Maps;
|
||||||
|
import com.google.common.collect.Sets;
|
||||||
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 人员报送(人员)列表
|
||||||
|
* @author: xiajun
|
||||||
|
* @modified By: xiajun
|
||||||
|
* @date: Created in 9/2/22 4:06 PM
|
||||||
|
* @version:v1.0
|
||||||
|
*/
|
||||||
|
public class EmployeeDeclareList {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 转换成人员报送(人员)列表dto
|
||||||
|
*
|
||||||
|
* @param employeeDeclares
|
||||||
|
* @param taxAgents
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static List<EmployeeDeclareListDTO> convert(List<EmployeeDeclarePO> employeeDeclares,
|
||||||
|
List<TaxAgentPO> taxAgents) {
|
||||||
|
if (CollectionUtils.isEmpty(employeeDeclares)) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
Map<Long, String> taxAgentNameMap = SalaryEntityUtil.convert2Map(taxAgents, TaxAgentPO::getId, TaxAgentPO::getName);
|
||||||
|
List<EmployeeDeclareListDTO> dtoList = Lists.newArrayList();
|
||||||
|
for (EmployeeDeclarePO employeeDeclare : employeeDeclares) {
|
||||||
|
CardTypeEnum cardTypeEnum = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getCardType(), CardTypeEnum.class);
|
||||||
|
GenderEnum genderEnum = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getGender(), GenderEnum.class);
|
||||||
|
EmploymentStatusEnum employmentStatusEnum = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getEmploymentStatus(), EmploymentStatusEnum.class);
|
||||||
|
EmploymentTypeEnum employmentTypeEnum = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getEmploymentType(), EmploymentTypeEnum.class);
|
||||||
|
DeclareStatusEnum declareStatusEnum = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getDeclareStatus(), DeclareStatusEnum.class);
|
||||||
|
EmployeeDeclareListDTO dto = new EmployeeDeclareListDTO()
|
||||||
|
.setId(employeeDeclare.getId())
|
||||||
|
.setEmployeeId(employeeDeclare.getEmployeeId())
|
||||||
|
.setEmployeeType(EmployeeTypeEnum.parseByValue(employeeDeclare.getEmployeeType()))
|
||||||
|
.setEmployeeName(employeeDeclare.getEmployeeName())
|
||||||
|
.setJobNum(employeeDeclare.getJobNum())
|
||||||
|
.setTaxAgentName(taxAgentNameMap.get(employeeDeclare.getTaxAgentId()))
|
||||||
|
.setCardType(cardTypeEnum == null ? "" : SalaryI18nUtil.getI18nLabel(cardTypeEnum.getLabelId(), cardTypeEnum.getDefaultLabel()))
|
||||||
|
.setCardNum(employeeDeclare.getCardNum())
|
||||||
|
.setGender(genderEnum == null ? "" : genderEnum.getDefaultLabel())
|
||||||
|
.setBirthday(SalaryDateUtil.getFormatLocalDate(employeeDeclare.getBirthday()))
|
||||||
|
.setEmploymentStatus(employmentStatusEnum == null ? "" : SalaryI18nUtil.getI18nLabel(employmentStatusEnum.getLabelId(), employmentStatusEnum.getDefaultLabel()))
|
||||||
|
.setMobile(employeeDeclare.getMobile())
|
||||||
|
.setEmploymentType(employmentTypeEnum == null ? "" : SalaryI18nUtil.getI18nLabel(employmentTypeEnum.getLabelId(), employmentTypeEnum.getDefaultLabel()))
|
||||||
|
.setEmploymentDate(SalaryDateUtil.getFormatLocalDate(employeeDeclare.getEmploymentDate()))
|
||||||
|
.setDismissDate(SalaryDateUtil.getFormatLocalDate(employeeDeclare.getDismissDate()))
|
||||||
|
.setDeclareStatus(declareStatusEnum)
|
||||||
|
.setDeclareStatusDesc(declareStatusEnum == null ? "" : SalaryI18nUtil.getI18nLabel(declareStatusEnum.getLabelId(), declareStatusEnum.getDefaultLabel()))
|
||||||
|
.setDeclareErrorMsg(employeeDeclare.getDeclareErrorMsg());
|
||||||
|
dtoList.add(dto);
|
||||||
|
}
|
||||||
|
return dtoList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<EmployeeDeclareFailListDTO> convert2FailListDTO(List<EmployeeDeclarePO> employeeDeclares,
|
||||||
|
Map<String, DataCollectionEmployee> employeeInfoMap) {
|
||||||
|
if (CollectionUtils.isEmpty(employeeDeclares)) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
List<EmployeeDeclareFailListDTO> dtos = Lists.newArrayList();
|
||||||
|
for (EmployeeDeclarePO employeeDeclare : employeeDeclares) {
|
||||||
|
boolean isExtEmp = EmployeeTypeEnum.EXT_EMPLOYEE.getValue().compareTo(employeeDeclare.getEmployeeType()) == 0;
|
||||||
|
DataCollectionEmployee employee = employeeInfoMap.get(employeeDeclare.getEmployeeId() + "-" + isExtEmp);
|
||||||
|
|
||||||
|
CardTypeEnum cardTypeEnum = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getCardType(), CardTypeEnum.class);
|
||||||
|
EmployeeDeclareFailListDTO dto = new EmployeeDeclareFailListDTO()
|
||||||
|
.setId(employeeDeclare.getId())
|
||||||
|
.setEmployeeId(employeeDeclare.getEmployeeId())
|
||||||
|
.setEmployeeType(SalaryEnumUtil.enumMatchByValue(employeeDeclare.getEmployeeType(), EmployeeTypeEnum.class))
|
||||||
|
.setEmployeeName(employeeDeclare.getEmployeeName())
|
||||||
|
.setJobNum(employeeDeclare.getJobNum())
|
||||||
|
.setDepartmentName(employee == null ? "" : employee.getDepartmentName())
|
||||||
|
.setCardType(cardTypeEnum == null ? "" : cardTypeEnum.getDefaultLabel())
|
||||||
|
.setCardNum(employeeDeclare.getCardNum())
|
||||||
|
.setDeclareErrorMsg(employeeDeclare.getDeclareErrorMsg());
|
||||||
|
dtos.add(dto);
|
||||||
|
}
|
||||||
|
return dtos;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Map<Long, Set<String>> getUpdatedField(List<EmployeeDeclarePO> employeeDeclares, List<EmployeeDeclarePO> originEmployeeDeclares) {
|
||||||
|
if (CollectionUtils.isEmpty(employeeDeclares) || CollectionUtils.isEmpty(originEmployeeDeclares)) {
|
||||||
|
return Collections.emptyMap();
|
||||||
|
}
|
||||||
|
Map<Long, Set<String>> updatedFieldMap = Maps.newHashMap();
|
||||||
|
Map<Long, EmployeeDeclarePO> originEmployeeDeclareMap = SalaryEntityUtil.convert2Map(originEmployeeDeclares, EmployeeDeclarePO::getEmployeeId);
|
||||||
|
for (EmployeeDeclarePO employeeDeclare : employeeDeclares) {
|
||||||
|
Set<String> dataIndexSet = Sets.newHashSet();
|
||||||
|
EmployeeDeclarePO originEmployeeDeclare = originEmployeeDeclareMap.get(employeeDeclare.getEmployeeId());
|
||||||
|
if (originEmployeeDeclare == null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (!Objects.equals(employeeDeclare.getEmployeeName(), originEmployeeDeclare.getEmployeeName())) {
|
||||||
|
dataIndexSet.add("employeeName");
|
||||||
|
}
|
||||||
|
if (!Objects.equals(employeeDeclare.getJobNum(), originEmployeeDeclare.getJobNum())) {
|
||||||
|
dataIndexSet.add("jobNum");
|
||||||
|
}
|
||||||
|
if (!Objects.equals(employeeDeclare.getCardType(), originEmployeeDeclare.getCardType())) {
|
||||||
|
dataIndexSet.add("cardType");
|
||||||
|
}
|
||||||
|
if (!Objects.equals(employeeDeclare.getCardNum(), originEmployeeDeclare.getCardNum())) {
|
||||||
|
dataIndexSet.add("cardNum");
|
||||||
|
}
|
||||||
|
if (!Objects.equals(employeeDeclare.getGender(), originEmployeeDeclare.getGender())) {
|
||||||
|
dataIndexSet.add("gender");
|
||||||
|
}
|
||||||
|
if (!Objects.equals(employeeDeclare.getBirthday(), originEmployeeDeclare.getBirthday())) {
|
||||||
|
dataIndexSet.add("birthday");
|
||||||
|
}
|
||||||
|
if (!Objects.equals(employeeDeclare.getEmploymentStatus(), originEmployeeDeclare.getEmploymentStatus())) {
|
||||||
|
dataIndexSet.add("employmentStatus");
|
||||||
|
}
|
||||||
|
if (!Objects.equals(employeeDeclare.getMobile(), originEmployeeDeclare.getMobile())) {
|
||||||
|
dataIndexSet.add("mobile");
|
||||||
|
}
|
||||||
|
if (!Objects.equals(employeeDeclare.getEmploymentType(), originEmployeeDeclare.getEmploymentType())) {
|
||||||
|
dataIndexSet.add("employmentType");
|
||||||
|
}
|
||||||
|
if (!Objects.equals(employeeDeclare.getEmploymentDate(), originEmployeeDeclare.getEmploymentDate())) {
|
||||||
|
dataIndexSet.add("employmentDate");
|
||||||
|
}
|
||||||
|
if (!Objects.equals(employeeDeclare.getDismissDate(), originEmployeeDeclare.getDismissDate())) {
|
||||||
|
dataIndexSet.add("dismissDate");
|
||||||
|
}
|
||||||
|
updatedFieldMap.put(employeeDeclare.getEmployeeId(), dataIndexSet);
|
||||||
|
}
|
||||||
|
return updatedFieldMap;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,223 @@
|
||||||
|
package com.engine.salary.entity.employeedeclare.bo;
|
||||||
|
|
||||||
|
import com.api.formmode.page.util.Util;
|
||||||
|
import com.engine.salary.constant.SalaryDefaultTenantConstant;
|
||||||
|
import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareRefreshDTO;
|
||||||
|
import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO;
|
||||||
|
import com.engine.salary.entity.salaryarchive.po.SalaryArchivePO;
|
||||||
|
import com.engine.salary.enums.SalaryOnOffEnum;
|
||||||
|
import com.engine.salary.enums.employeedeclare.*;
|
||||||
|
import com.engine.salary.enums.salaryarchive.SalaryArchiveStatusEnum;
|
||||||
|
import com.engine.salary.enums.sicategory.DeleteTypeEnum;
|
||||||
|
import com.engine.salary.util.SalaryDateUtil;
|
||||||
|
import com.engine.salary.util.SalaryEntityUtil;
|
||||||
|
import com.engine.salary.util.SalaryI18nUtil;
|
||||||
|
import com.engine.salary.util.valid.SalaryCardUtil;
|
||||||
|
import com.google.common.collect.Lists;
|
||||||
|
import dm.jdbc.util.IdGenerator;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.YearMonth;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.function.Function;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description:
|
||||||
|
* @author: xiajun
|
||||||
|
* @modified By: xiajun
|
||||||
|
* @date: 2022/11/6 15:47
|
||||||
|
* @version:v1.0
|
||||||
|
*/
|
||||||
|
public class EmployeeDeclareRefresh {
|
||||||
|
|
||||||
|
public static Result refresh(EmployeeDeclareRefreshDTO dto, Long employeeId) {
|
||||||
|
Result result = new Result();
|
||||||
|
// 本月已有的需要报送的人员
|
||||||
|
Set<Long> employeeIds = SalaryEntityUtil.properties(dto.getEmployeeDeclares(), EmployeeDeclarePO::getEmployeeId);
|
||||||
|
// 员工的个人信息
|
||||||
|
Map<Long, SimpleUserInfo> simpleUserInfoMap = dto.getSimpleUserInfos().stream()
|
||||||
|
.filter(simpleUserInfo -> Objects.nonNull(simpleUserInfo) && Objects.nonNull(simpleUserInfo.getUser()))
|
||||||
|
.collect(Collectors.toMap(simpleUserInfo -> simpleUserInfo.getUser().getId(), Function.identity(), (a, b) -> a));
|
||||||
|
// 薪资档案的数据(任职受雇从业类型、起始发薪日期、最后发薪日期)
|
||||||
|
Map<Long, SalaryArchivePO> salaryArchiveMap = SalaryEntityUtil.convert2Map(dto.getSalaryArchives(), SalaryArchivePO::getEmployeeId);
|
||||||
|
// 非系统人员的数据(任职受雇从业类型)
|
||||||
|
Map<Long, ExtEmployeePO> extEmployeeMap = SalaryEntityUtil.convert2Map(dto.getExtEmployees(), ExtEmployeePO::getId);
|
||||||
|
LocalDateTime now = LocalDateTime.now();
|
||||||
|
// 对已有人员处理「人员状态」、「离职日期」、「任职受雇从业类型」
|
||||||
|
for (EmployeeDeclarePO employeeDeclare : dto.getEmployeeDeclares()) {
|
||||||
|
SalaryArchivePO salaryArchive = salaryArchiveMap.get(employeeDeclare.getEmployeeId());
|
||||||
|
if (salaryArchive != null && (Objects.equals(salaryArchive.getRunStatus(), SalaryArchiveStatusEnum.STOP_FROM_PENDING.getValue())
|
||||||
|
|| Objects.equals(salaryArchive.getRunStatus(), SalaryArchiveStatusEnum.STOP_FROM_SUSPEND.getValue()))) {
|
||||||
|
if (Objects.equals(employeeDeclare.getEmploymentStatus(), EmploymentStatusEnum.ABNORMAL.getValue())
|
||||||
|
|| Objects.equals(Util.null2String(employeeDeclare.getDismissDate()), Util.null2String(salaryArchive.getPayEndDate()))) {
|
||||||
|
employeeDeclare.setEmploymentStatus(EmploymentStatusEnum.ABNORMAL.getValue());
|
||||||
|
employeeDeclare.setDismissDate(salaryArchive.getPayEndDate());
|
||||||
|
employeeDeclare.setNewEmployeeInfo(1);
|
||||||
|
employeeDeclare.setUpdateTime(now);
|
||||||
|
result.getEmployeeDeclares().add(employeeDeclare);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (salaryArchive != null && !Objects.equals(employeeDeclare.getEmploymentType(), Util.getIntValue(salaryArchive.getEmploymentType()))) {
|
||||||
|
employeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue());
|
||||||
|
employeeDeclare.setEmploymentType(Util.getIntValue(salaryArchive.getEmploymentType()));
|
||||||
|
employeeDeclare.setNewEmployeeInfo(1);
|
||||||
|
}
|
||||||
|
ExtEmployeePO extEmployee = extEmployeeMap.get(employeeDeclare.getEmployeeId());
|
||||||
|
if (extEmployee != null && !Objects.equals(employeeDeclare.getEmploymentType(), extEmployee.getEmploymentType())) {
|
||||||
|
employeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue());
|
||||||
|
employeeDeclare.setEmploymentType(extEmployee.getEmploymentType());
|
||||||
|
employeeDeclare.setNewEmployeeInfo(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 自动保存上个月报送成功的人员
|
||||||
|
for (EmployeeDeclarePO preTaxCycleEmployeeDeclare : dto.getPreTaxCycleEmployeeDeclare()) {
|
||||||
|
if (!employeeIds.contains(preTaxCycleEmployeeDeclare.getEmployeeId())) {
|
||||||
|
EmployeeDeclarePO employeeDeclare = new EmployeeDeclarePO();
|
||||||
|
BeanUtils.copyProperties(preTaxCycleEmployeeDeclare, employeeDeclare);
|
||||||
|
employeeDeclare.setId(IdGenerator.generate())
|
||||||
|
.setTaxCycle(dto.getTaxCycle().toString())
|
||||||
|
.setNewEmployeeInfo(0)
|
||||||
|
.setCreateTime(now)
|
||||||
|
.setUpdateTime(now);
|
||||||
|
// 对人员处理「人员状态」、「离职日期」、「任职受雇从业类型」
|
||||||
|
SalaryArchivePO salaryArchive = salaryArchiveMap.get(employeeDeclare.getEmployeeId());
|
||||||
|
if (salaryArchive != null && (Objects.equals(salaryArchive.getRunStatus(), SalaryArchiveStatusEnum.STOP_FROM_PENDING.getValue())
|
||||||
|
|| Objects.equals(salaryArchive.getRunStatus(), SalaryArchiveStatusEnum.STOP_FROM_SUSPEND.getValue()))) {
|
||||||
|
employeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue());
|
||||||
|
employeeDeclare.setEmploymentStatus(EmploymentStatusEnum.ABNORMAL.getValue());
|
||||||
|
employeeDeclare.setDismissDate(salaryArchive.getPayEndDate());
|
||||||
|
employeeDeclare.setNewEmployeeInfo(1);
|
||||||
|
}
|
||||||
|
if (salaryArchive != null && !Objects.equals(Util.null2String(employeeDeclare.getEmploymentType()), salaryArchive.getEmploymentType())) {
|
||||||
|
employeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue());
|
||||||
|
employeeDeclare.setEmploymentType(Util.getIntValue(salaryArchive.getEmploymentType()));
|
||||||
|
employeeDeclare.setNewEmployeeInfo(1);
|
||||||
|
}
|
||||||
|
ExtEmployeePO extEmployee = extEmployeeMap.get(employeeDeclare.getEmployeeId());
|
||||||
|
if (extEmployee != null && !Objects.equals(employeeDeclare.getEmploymentType(), extEmployee.getEmploymentType())) {
|
||||||
|
employeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue());
|
||||||
|
employeeDeclare.setEmploymentType(extEmployee.getEmploymentType());
|
||||||
|
employeeDeclare.setNewEmployeeInfo(1);
|
||||||
|
}
|
||||||
|
employeeIds.add(employeeDeclare.getEmployeeId());
|
||||||
|
result.getNewEmployeeDeclares().add(employeeDeclare);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 薪资档案中新增的需报送的人员
|
||||||
|
for (HrmEmployeeComInfo hrmEmployeeComInfo : dto.getHrmEmployeeComInfos()) {
|
||||||
|
if (employeeIds.contains(hrmEmployeeComInfo.getId())) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
EmployeeDeclarePO employeeDeclare = initEmployeeDeclare(dto.getTaxAgentId(), dto.getTaxCycle(), now, employeeId, tenantKey);
|
||||||
|
SimpleUserInfo simpleUserInfo = simpleUserInfoMap.get(hrmEmployeeComInfo.getId());
|
||||||
|
String idNum = simpleUserInfo == null ? "" : simpleUserInfo.getIdNo();
|
||||||
|
employeeDeclare.setEmployeeId(hrmEmployeeComInfo.getId())
|
||||||
|
.setEmployeeType(EmployeeTypeEnum.ORGANIZATION.getValue())
|
||||||
|
.setEmployeeName(hrmEmployeeComInfo.getUsername())
|
||||||
|
.setJobNum(hrmEmployeeComInfo.getJob_num())
|
||||||
|
.setCardNum(idNum)
|
||||||
|
.setGender(StringUtils.equalsIgnoreCase(hrmEmployeeComInfo.getSex(), GenderEnum.MALE.name())
|
||||||
|
? GenderEnum.MALE.getValue() : GenderEnum.FEMALE.getValue())
|
||||||
|
.setBirthday(simpleUserInfo == null ? null : SalaryDateUtil.dateToLocalDate(simpleUserInfo.getBirthday()))
|
||||||
|
.setMobile(hrmEmployeeComInfo.getMobile());
|
||||||
|
if (StringUtils.isEmpty(idNum)) {
|
||||||
|
employeeDeclare.setDeclareStatus(DeclareStatusEnum.DECLARE_FAIL.getValue());
|
||||||
|
employeeDeclare.setDeclareErrorMsg(SalaryI18nUtil.getI18nLabel(187460, "身份证号不能为空"));
|
||||||
|
} else if (!SalaryCardUtil.checkIdNum(idNum)) {
|
||||||
|
employeeDeclare.setDeclareStatus(DeclareStatusEnum.DECLARE_FAIL.getValue());
|
||||||
|
employeeDeclare.setDeclareErrorMsg(SalaryI18nUtil.getI18nLabel(156510, "身份证号格式错误"));
|
||||||
|
} else {
|
||||||
|
employeeDeclare.setGender(SalaryCardUtil.judgeGender(idNum).getValue());
|
||||||
|
employeeDeclare.setBirthday(SalaryCardUtil.judgeBirthday(idNum));
|
||||||
|
}
|
||||||
|
// 对人员处理「人员状态」、「离职日期」
|
||||||
|
SalaryArchivePO salaryArchive = salaryArchiveMap.get(employeeDeclare.getEmployeeId());
|
||||||
|
if (salaryArchive != null) {
|
||||||
|
employeeDeclare.setEmploymentType(Util.getIntValue(salaryArchive.getEmploymentType()));
|
||||||
|
employeeDeclare.setEmploymentDate(salaryArchive.getPayStartDate());
|
||||||
|
if (Objects.equals(salaryArchive.getRunStatus(), SalaryArchiveStatusEnum.STOP_FROM_PENDING.getValue())
|
||||||
|
|| Objects.equals(salaryArchive.getRunStatus(), SalaryArchiveStatusEnum.STOP_FROM_SUSPEND.getValue())) {
|
||||||
|
employeeDeclare.setEmploymentStatus(EmploymentStatusEnum.ABNORMAL.getValue());
|
||||||
|
employeeDeclare.setDismissDate(salaryArchive.getPayEndDate());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
employeeIds.add(employeeDeclare.getEmployeeId());
|
||||||
|
result.getNewEmployeeDeclares().add(employeeDeclare);
|
||||||
|
}
|
||||||
|
// 非系统人员中新增的需报送的人员
|
||||||
|
for (ExtEmployeePO extEmployee : dto.getExtEmployees()) {
|
||||||
|
if (employeeIds.contains(extEmployee.getId())) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
EmployeeDeclarePO employeeDeclare = initEmployeeDeclare(dto.getTaxAgentId(), dto.getTaxCycle(), now, employeeId, tenantKey);
|
||||||
|
employeeDeclare.setEmployeeId(extEmployee.getId())
|
||||||
|
.setEmployeeType(EmployeeTypeEnum.EXT_EMPLOYEE.getValue())
|
||||||
|
.setEmployeeName(extEmployee.getUsername())
|
||||||
|
.setCardNum(extEmployee.getCardNum())
|
||||||
|
.setMobile(extEmployee.getMobile())
|
||||||
|
.setEmploymentType(extEmployee.getEmploymentType())
|
||||||
|
.setEmploymentDate(YearMonth.parse(extEmployee.getStartMonth()).atDay(1));
|
||||||
|
if (StringUtils.isEmpty(extEmployee.getCardNum())) {
|
||||||
|
employeeDeclare.setDeclareStatus(DeclareStatusEnum.DECLARE_FAIL.getValue());
|
||||||
|
employeeDeclare.setDeclareErrorMsg(SalaryI18nUtil.getI18nLabel(187460, "身份证号不能为空"));
|
||||||
|
} else if (!SalaryCardUtil.checkIdNum(extEmployee.getCardNum())) {
|
||||||
|
employeeDeclare.setDeclareStatus(DeclareStatusEnum.DECLARE_FAIL.getValue());
|
||||||
|
employeeDeclare.setDeclareErrorMsg(SalaryI18nUtil.getI18nLabel(156510, "身份证号格式错误"));
|
||||||
|
} else {
|
||||||
|
employeeDeclare.setGender(SalaryCardUtil.judgeGender(extEmployee.getCardNum()).getValue());
|
||||||
|
employeeDeclare.setBirthday(SalaryCardUtil.judgeBirthday(extEmployee.getCardNum()));
|
||||||
|
}
|
||||||
|
employeeIds.add(employeeDeclare.getEmployeeId());
|
||||||
|
result.getNewEmployeeDeclares().add(employeeDeclare);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
private static EmployeeDeclarePO initEmployeeDeclare(Long taxAgentId, YearMonth taxCycle, Date now, Long employeeId) {
|
||||||
|
return new EmployeeDeclarePO()
|
||||||
|
.setId(IdGenerator.generate())
|
||||||
|
.setTaxAgentId(taxAgentId)
|
||||||
|
.setTaxCycle(taxCycle.toString())
|
||||||
|
.setCardType(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getValue())
|
||||||
|
.setGender(GenderEnum.MALE.getValue())
|
||||||
|
.setEmploymentStatus(EmploymentStatusEnum.NORMAL.getValue())
|
||||||
|
.setEmploymentType(EmploymentTypeEnum.EMPLOYEE.getValue())
|
||||||
|
.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue())
|
||||||
|
.setDeclareErrorMsg("")
|
||||||
|
.setDisability(SalaryOnOffEnum.OFF.getValue())
|
||||||
|
.setDisabilityCardNo("")
|
||||||
|
.setLonelyOld(SalaryOnOffEnum.OFF.getValue())
|
||||||
|
.setMartyrDependents(SalaryOnOffEnum.OFF.getValue())
|
||||||
|
.setMartyrDependentsCardNo("")
|
||||||
|
.setDeductExpenses(SalaryOnOffEnum.ON.getValue())
|
||||||
|
.setSuccessfullyDeclared(0)
|
||||||
|
.setNewEmployeeInfo(0)
|
||||||
|
.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue())
|
||||||
|
.setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY)
|
||||||
|
.setCreator(employeeId)
|
||||||
|
.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue())
|
||||||
|
.setCreateTime(now)
|
||||||
|
.setUpdateTime(now);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class Result {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 已有的需要更新的报送人员
|
||||||
|
*/
|
||||||
|
private List<EmployeeDeclarePO> employeeDeclares;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增的报送人员
|
||||||
|
*/
|
||||||
|
private List<EmployeeDeclarePO> newEmployeeDeclares;
|
||||||
|
|
||||||
|
public Result() {
|
||||||
|
this.employeeDeclares = Lists.newArrayList();
|
||||||
|
this.newEmployeeDeclares = Lists.newArrayList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,84 @@
|
||||||
|
package com.engine.salary.entity.employeedeclare.dto;
|
||||||
|
|
||||||
|
import com.engine.salary.annotation.TableTitle;
|
||||||
|
import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 报送人员失败列表
|
||||||
|
* @author: xiajun
|
||||||
|
* @modified By: xiajun
|
||||||
|
* @date: Created in 2022/11/7 10:42 AM
|
||||||
|
* @version:v1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class EmployeeDeclareFailListDTO {
|
||||||
|
|
||||||
|
// 主键id
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
// 人员id
|
||||||
|
private Long employeeId;
|
||||||
|
|
||||||
|
// 人员类型
|
||||||
|
private EmployeeTypeEnum employeeType;
|
||||||
|
|
||||||
|
// @SalaryTableColumn(
|
||||||
|
// label = "姓名",
|
||||||
|
// labelId = 85429,
|
||||||
|
// width = "10%"
|
||||||
|
// )
|
||||||
|
@TableTitle(title = "姓名", dataIndex = "employeeName", key = "employeeName")
|
||||||
|
private String employeeName;
|
||||||
|
|
||||||
|
// @SalaryTableColumn(
|
||||||
|
// label = "工号",
|
||||||
|
// labelId = 86317,
|
||||||
|
// width = "10%"
|
||||||
|
// )
|
||||||
|
@TableTitle(title = "工号", dataIndex = "jobNum", key = "jobNum")
|
||||||
|
private String jobNum;
|
||||||
|
|
||||||
|
// 部门id
|
||||||
|
private String departmentId;
|
||||||
|
|
||||||
|
// @SalaryTableColumn(
|
||||||
|
// label = "部门",
|
||||||
|
// labelId = 86185,
|
||||||
|
// width = "10%"
|
||||||
|
// )
|
||||||
|
@TableTitle(title = "部门", dataIndex = "departmentName", key = "departmentName")
|
||||||
|
private String departmentName;
|
||||||
|
|
||||||
|
// @SalaryTableColumn(
|
||||||
|
// label = "证件类型",
|
||||||
|
// labelId = 105139,
|
||||||
|
// width = "10%"
|
||||||
|
// )
|
||||||
|
@TableTitle(title = "证件类型", dataIndex = "cardType", key = "cardType")
|
||||||
|
private String cardType;
|
||||||
|
|
||||||
|
// @SalaryTableColumn(
|
||||||
|
// label = "证件号码",
|
||||||
|
// labelId = 86318,
|
||||||
|
// width = "20%"
|
||||||
|
// )
|
||||||
|
@TableTitle(title = "证件号码", dataIndex = "cardNum", key = "cardNum")
|
||||||
|
private String cardNum;
|
||||||
|
|
||||||
|
// @SalaryTableColumn(
|
||||||
|
// label = "失败原因",
|
||||||
|
// labelId = 156405,
|
||||||
|
// width = "40%"
|
||||||
|
// )
|
||||||
|
@TableTitle(title = "失败原因", dataIndex = "declareErrorMsg", key = "declareErrorMsg")
|
||||||
|
private String declareErrorMsg;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,249 @@
|
||||||
|
package com.engine.salary.entity.employeedeclare.dto;
|
||||||
|
|
||||||
|
|
||||||
|
import com.engine.salary.annotation.TableTitle;
|
||||||
|
import com.engine.salary.enums.SalaryOnOffEnum;
|
||||||
|
import com.engine.salary.enums.employeedeclare.CardTypeEnum;
|
||||||
|
import com.engine.salary.enums.employeedeclare.EmploymentStatusEnum;
|
||||||
|
import com.engine.salary.enums.employeedeclare.EmploymentTypeEnum;
|
||||||
|
import com.engine.salary.enums.employeedeclare.GenderEnum;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 人员报送(人员)表单
|
||||||
|
* @author: xiajun
|
||||||
|
* @modified By: xiajun
|
||||||
|
* @date: Created in 9/6/22 10:14 AM
|
||||||
|
* @version:v1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class EmployeeDeclareFromDTO {
|
||||||
|
|
||||||
|
// 人员id
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
// 个税扣缴义务人id
|
||||||
|
|
||||||
|
private Long taxAgentId;
|
||||||
|
|
||||||
|
// @SalaryForm(
|
||||||
|
// label = "系统名称",
|
||||||
|
// labelId = 160460,
|
||||||
|
// items = {
|
||||||
|
// @SalaryFormItem(itemType = WeaFormItemType.TYPESBROWSER, browserModule = "hrmsalary",
|
||||||
|
// browserType = "salaryEmployeeCombinationBrowser", required = true)
|
||||||
|
// }
|
||||||
|
// )
|
||||||
|
// 系统名称
|
||||||
|
@TableTitle(title = "系统名称", dataIndex = "employee", key = "employee")
|
||||||
|
private String employee;
|
||||||
|
|
||||||
|
// @SalaryForm(
|
||||||
|
// label = "证件姓名",
|
||||||
|
// labelId = 160461,
|
||||||
|
// items = {
|
||||||
|
// @SalaryFormItem(itemType = WeaFormItemType.INPUT, maxLength = "40", required = true)
|
||||||
|
// }
|
||||||
|
// )
|
||||||
|
// 证件姓名
|
||||||
|
@TableTitle(title = "证件姓名", dataIndex = "employeeName", key = "employeeName")
|
||||||
|
private String employeeName;
|
||||||
|
|
||||||
|
// @SalaryForm(
|
||||||
|
// label = "工号",
|
||||||
|
// labelId = 86317,
|
||||||
|
// items = {
|
||||||
|
// @SalaryFormItem(itemType = WeaFormItemType.INPUT, maxLength = "40")
|
||||||
|
// }
|
||||||
|
// )
|
||||||
|
// 工号
|
||||||
|
@TableTitle(title = "工号", dataIndex = "jobNum", key = "jobNum")
|
||||||
|
private String jobNum;
|
||||||
|
|
||||||
|
// @SalaryForm(
|
||||||
|
// label = "国籍",
|
||||||
|
// labelId = 156406,
|
||||||
|
// items = {
|
||||||
|
// @SalaryFormItem(itemType = WeaFormItemType.INPUT, readOnly = true)
|
||||||
|
// }
|
||||||
|
// )
|
||||||
|
// 国籍
|
||||||
|
@TableTitle(title = "国籍", dataIndex = "nationality", key = "nationality")
|
||||||
|
private String nationality;
|
||||||
|
|
||||||
|
// @SalaryForm(
|
||||||
|
// label = "证件类型",
|
||||||
|
// labelId = 105139,
|
||||||
|
// items = {
|
||||||
|
// @SalaryFormItem(itemType = WeaFormItemType.SELECT, readOnly = true, optionsEnum = CardTypeEnum.class,
|
||||||
|
// required = true)
|
||||||
|
// }
|
||||||
|
// )
|
||||||
|
// 证件类型
|
||||||
|
@TableTitle(title = "证件类型", dataIndex = "cardType", key = "cardType")
|
||||||
|
private CardTypeEnum cardType;
|
||||||
|
|
||||||
|
// @SalaryForm(
|
||||||
|
// label = "证件号码",
|
||||||
|
// labelId = 86318,
|
||||||
|
// items = {
|
||||||
|
// @SalaryFormItem(itemType = WeaFormItemType.INPUT, required = true, maxLength = "18")
|
||||||
|
// }
|
||||||
|
// )
|
||||||
|
// 证件号码
|
||||||
|
@TableTitle(title = "证件号码", dataIndex = "cardNum", key = "cardNum")
|
||||||
|
private String cardNum;
|
||||||
|
|
||||||
|
// @SalaryForm(
|
||||||
|
// label = "性别",
|
||||||
|
// labelId = 98622,
|
||||||
|
// items = {
|
||||||
|
// @SalaryFormItem(itemType = WeaFormItemType.SELECT, required = true, optionsEnum = GenderEnum.class)
|
||||||
|
// }
|
||||||
|
// )
|
||||||
|
// 性别
|
||||||
|
@TableTitle(title = "性别", dataIndex = "gender", key = "gender")
|
||||||
|
private GenderEnum gender;
|
||||||
|
|
||||||
|
// @SalaryForm(
|
||||||
|
// label = "出生日期",
|
||||||
|
// labelId = 98624,
|
||||||
|
// items = {
|
||||||
|
// @SalaryFormItem(itemType = WeaFormItemType.DATEPICKER, required = true)
|
||||||
|
// }
|
||||||
|
// )
|
||||||
|
// 出生日期
|
||||||
|
@TableTitle(title = "出生日期", dataIndex = "birthday", key = "birthday")
|
||||||
|
private LocalDate birthday;
|
||||||
|
|
||||||
|
// @SalaryForm(
|
||||||
|
// label = "状态",
|
||||||
|
// labelId = 91075,
|
||||||
|
// items = {
|
||||||
|
// @SalaryFormItem(itemType = WeaFormItemType.RADIO, required = true, optionsEnum = EmploymentStatusEnum.class)
|
||||||
|
// }
|
||||||
|
// )
|
||||||
|
// 状态
|
||||||
|
@TableTitle(title = "状态", dataIndex = "employmentStatus", key = "employmentStatus")
|
||||||
|
private EmploymentStatusEnum employmentStatus;
|
||||||
|
|
||||||
|
// @SalaryForm(
|
||||||
|
// label = "手机号码",
|
||||||
|
// labelId = 98621,
|
||||||
|
// items = {
|
||||||
|
// @SalaryFormItem(itemType = WeaFormItemType.INPUT, required = true)
|
||||||
|
// }
|
||||||
|
// )
|
||||||
|
// 手机号码
|
||||||
|
@TableTitle(title = "手机号码", dataIndex = "mobile", key = "mobile")
|
||||||
|
private String mobile;
|
||||||
|
|
||||||
|
// @SalaryForm(
|
||||||
|
// label = "任职受雇从业类型",
|
||||||
|
// labelId = 156396,
|
||||||
|
// items = {
|
||||||
|
// @SalaryFormItem(itemType = WeaFormItemType.SELECT, required = true, optionsEnum = EmploymentTypeEnum.class)
|
||||||
|
// }
|
||||||
|
// )
|
||||||
|
// 任职受雇从业类型
|
||||||
|
@TableTitle(title = "任职受雇从业类型", dataIndex = "employmentType", key = "employmentType")
|
||||||
|
private EmploymentTypeEnum employmentType;
|
||||||
|
|
||||||
|
// @SalaryForm(
|
||||||
|
// label = "任职受雇从业日期",
|
||||||
|
// labelId = 156409,
|
||||||
|
// items = {
|
||||||
|
// @SalaryFormItem(itemType = WeaFormItemType.DATEPICKER, required = true)
|
||||||
|
// }
|
||||||
|
// )
|
||||||
|
// 任职受雇从业日期
|
||||||
|
@TableTitle(title = "任职受雇从业日期", dataIndex = "employmentDate", key = "employmentDate")
|
||||||
|
private LocalDate employmentDate;
|
||||||
|
|
||||||
|
// @SalaryForm(
|
||||||
|
// label = "离职日期",
|
||||||
|
// labelId = 95228,
|
||||||
|
// items = {
|
||||||
|
// @SalaryFormItem(itemType = WeaFormItemType.DATEPICKER)
|
||||||
|
// }
|
||||||
|
// )
|
||||||
|
// 离职日期
|
||||||
|
@TableTitle(title = "离职日期", dataIndex = "dismissDate", key = "dismissDate")
|
||||||
|
private LocalDate dismissDate;
|
||||||
|
|
||||||
|
// @SalaryForm(
|
||||||
|
// label = "是否残疾",
|
||||||
|
// labelId = 156399,
|
||||||
|
// items = {
|
||||||
|
// @SalaryFormItem(itemType = WeaFormItemType.RADIO, optionsEnum = SalaryOnOffEnum.class)
|
||||||
|
// }
|
||||||
|
// )
|
||||||
|
// 是否残疾
|
||||||
|
@TableTitle(title = "是否残疾", dataIndex = "disability", key = "disability")
|
||||||
|
private SalaryOnOffEnum disability;
|
||||||
|
|
||||||
|
// @SalaryForm(
|
||||||
|
// label = "残疾证号",
|
||||||
|
// labelId = 156412,
|
||||||
|
// items = {
|
||||||
|
// @SalaryFormItem(itemType = WeaFormItemType.INPUT)
|
||||||
|
// }
|
||||||
|
// )
|
||||||
|
// 残疾证号
|
||||||
|
@TableTitle(title = "残疾证号", dataIndex = "disabilityCardNo", key = "disabilityCardNo")
|
||||||
|
private String disabilityCardNo;
|
||||||
|
|
||||||
|
// @SalaryForm(
|
||||||
|
// label = "是否孤老",
|
||||||
|
// labelId = 156400,
|
||||||
|
// items = {
|
||||||
|
// @SalaryFormItem(itemType = WeaFormItemType.RADIO, optionsEnum = SalaryOnOffEnum.class)
|
||||||
|
// }
|
||||||
|
// )
|
||||||
|
// 是否孤老
|
||||||
|
@TableTitle(title = "是否孤老", dataIndex = "lonelyOld", key = "lonelyOld")
|
||||||
|
private SalaryOnOffEnum lonelyOld;
|
||||||
|
|
||||||
|
// @SalaryForm(
|
||||||
|
// label = "是否是烈属",
|
||||||
|
// labelId = 156401,
|
||||||
|
// items = {
|
||||||
|
// @SalaryFormItem(itemType = WeaFormItemType.RADIO, optionsEnum = SalaryOnOffEnum.class)
|
||||||
|
// }
|
||||||
|
// )
|
||||||
|
// 是否是烈属
|
||||||
|
@TableTitle(title = "是否是烈属", dataIndex = "martyrDependents", key = "martyrDependents")
|
||||||
|
private SalaryOnOffEnum martyrDependents;
|
||||||
|
|
||||||
|
// @SalaryForm(
|
||||||
|
// label = "烈属证号",
|
||||||
|
// labelId = 156413,
|
||||||
|
// items = {
|
||||||
|
// @SalaryFormItem(itemType = WeaFormItemType.INPUT)
|
||||||
|
// }
|
||||||
|
// )
|
||||||
|
// 烈属证号
|
||||||
|
@TableTitle(title = "烈属证号", dataIndex = "martyrDependentsCardNo", key = "martyrDependentsCardNo")
|
||||||
|
private String martyrDependentsCardNo;
|
||||||
|
|
||||||
|
// @SalaryForm(
|
||||||
|
// label = "是否扣除减除费用",
|
||||||
|
// labelId = 156402,
|
||||||
|
// items = {
|
||||||
|
// @SalaryFormItem(itemType = WeaFormItemType.RADIO, optionsEnum = SalaryOnOffEnum.class)
|
||||||
|
// }
|
||||||
|
// )
|
||||||
|
// 是否扣除减除费用
|
||||||
|
@TableTitle(title = "是否扣除减除费用", dataIndex = "deductExpenses", key = "deductExpenses")
|
||||||
|
private SalaryOnOffEnum deductExpenses;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,34 @@
|
||||||
|
package com.engine.salary.entity.employeedeclare.dto;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 报送人员信息
|
||||||
|
* @author: xiajun
|
||||||
|
* @modified By: xiajun
|
||||||
|
* @date: Created in 2022/11/8 11:38 AM
|
||||||
|
* @version:v1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class EmployeeDeclareInfoDTO {
|
||||||
|
|
||||||
|
// 是否修改过员工信息
|
||||||
|
private boolean showUpdate;
|
||||||
|
|
||||||
|
// 报送成功的人数
|
||||||
|
private Integer declareSuccessSize;
|
||||||
|
|
||||||
|
// 未报送的人数
|
||||||
|
private Integer notDeclareSize;
|
||||||
|
|
||||||
|
// 报送失败的人数
|
||||||
|
private Integer declareFailSize;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,109 @@
|
||||||
|
package com.engine.salary.entity.employeedeclare.dto;
|
||||||
|
|
||||||
|
import com.engine.salary.annotation.SalaryTable;
|
||||||
|
import com.engine.salary.annotation.SalaryTableColumn;
|
||||||
|
import com.engine.salary.enums.employeedeclare.DeclareStatusEnum;
|
||||||
|
import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 人员报送(人员)列表
|
||||||
|
* @author: xiajun
|
||||||
|
* @modified By: xiajun
|
||||||
|
* @date: Created in 9/2/22 10:45 AM
|
||||||
|
* @version:v1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@SalaryTable(pageId = "a4f89287-289scf07669d7a23de0ef8u8s2710oe7")
|
||||||
|
public class EmployeeDeclareListDTO {
|
||||||
|
|
||||||
|
// 主键id
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
// 人员ID
|
||||||
|
private Long employeeId;
|
||||||
|
|
||||||
|
// 人员类型
|
||||||
|
private EmployeeTypeEnum employeeType;
|
||||||
|
|
||||||
|
|
||||||
|
// 姓名
|
||||||
|
@SalaryTableColumn(text = "姓名", width = "10%", column = "employeeName")
|
||||||
|
private String employeeName;
|
||||||
|
|
||||||
|
// 分部
|
||||||
|
@SalaryTableColumn(text = "分部", width = "10%", column = "subCompanyName")
|
||||||
|
private String subCompanyName;
|
||||||
|
|
||||||
|
// 部门
|
||||||
|
@SalaryTableColumn(text = "部门", width = "10%", column = "departmentName")
|
||||||
|
private String departmentName;
|
||||||
|
|
||||||
|
// 个税扣缴义务人
|
||||||
|
@SalaryTableColumn(text = "个税扣缴义务人", width = "10%", column = "taxAgentName")
|
||||||
|
private String taxAgentName;
|
||||||
|
|
||||||
|
// 工号
|
||||||
|
@SalaryTableColumn(text = "工号", width = "10%", column = "jobNum")
|
||||||
|
private String jobNum;
|
||||||
|
|
||||||
|
// 证件类型
|
||||||
|
@SalaryTableColumn(text = "证件类型", width = "10%", column = "cardType")
|
||||||
|
private String cardType;
|
||||||
|
|
||||||
|
// 证件号码
|
||||||
|
@SalaryTableColumn(text = "证件号码", width = "10%", column = "cardNum")
|
||||||
|
private String cardNum;
|
||||||
|
|
||||||
|
// 性别
|
||||||
|
@SalaryTableColumn(text = "性别", width = "10%", column = "gender")
|
||||||
|
private String gender;
|
||||||
|
|
||||||
|
// 出生日期
|
||||||
|
@SalaryTableColumn(text = "出生日期", width = "10%", column = "birthday")
|
||||||
|
private String birthday;
|
||||||
|
|
||||||
|
// 人员状态
|
||||||
|
@SalaryTableColumn(text = "人员状态", width = "10%", column = "employmentStatus")
|
||||||
|
private String employmentStatus;
|
||||||
|
|
||||||
|
// 手机号码
|
||||||
|
@SalaryTableColumn(text = "手机号码", width = "10%", column = "mobile")
|
||||||
|
private String mobile;
|
||||||
|
|
||||||
|
// 任职受雇从业类型
|
||||||
|
@SalaryTableColumn(text = "任职受雇从业类型", width = "10%", column = "employmentType")
|
||||||
|
private String employmentType;
|
||||||
|
|
||||||
|
// 任职受雇从业日期
|
||||||
|
@SalaryTableColumn(text = "任职受雇从业日期", width = "10%", column = "employmentDate")
|
||||||
|
private String employmentDate;
|
||||||
|
|
||||||
|
|
||||||
|
// 离职日期
|
||||||
|
@SalaryTableColumn(text = "离职日期", width = "10%", column = "dismissDate")
|
||||||
|
private String dismissDate;
|
||||||
|
|
||||||
|
// 申报状态
|
||||||
|
private DeclareStatusEnum declareStatus;
|
||||||
|
|
||||||
|
// 申报状态
|
||||||
|
@SalaryTableColumn(text = "申报状态", width = "10%", column = "declareStatusDesc")
|
||||||
|
private String declareStatusDesc;
|
||||||
|
|
||||||
|
// 申报失败原因
|
||||||
|
private String declareErrorMsg;
|
||||||
|
|
||||||
|
// 编辑过的字段
|
||||||
|
private Set<String> updatedDataIndexSet;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,36 @@
|
||||||
|
package com.engine.salary.entity.employeedeclare.dto;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 人员进度
|
||||||
|
* @author: xiajun
|
||||||
|
* @modified By: xiajun
|
||||||
|
* @date: Created in 2022/11/23 11:38 AM
|
||||||
|
* @version:v1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class EmployeeDeclareRateDTO implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 6096347310269090985L;
|
||||||
|
|
||||||
|
@ApiModelProperty("缓存索引")
|
||||||
|
private String index;
|
||||||
|
@ApiModelProperty("提示信息")
|
||||||
|
private String msg;
|
||||||
|
@ApiModelProperty("状态")
|
||||||
|
private boolean status;
|
||||||
|
@ApiModelProperty("是否已经完成")
|
||||||
|
private boolean finish;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,50 @@
|
||||||
|
package com.engine.salary.entity.employeedeclare.dto;
|
||||||
|
|
||||||
|
|
||||||
|
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
||||||
|
import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO;
|
||||||
|
import com.engine.salary.entity.salaryarchive.po.SalaryArchivePO;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.time.YearMonth;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 人员报送,刷新数据
|
||||||
|
* @author: xiajun
|
||||||
|
* @modified By: xiajun
|
||||||
|
* @date: Created in 2022/11/23 10:52 AM
|
||||||
|
* @version:v1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class EmployeeDeclareRefreshDTO {
|
||||||
|
// 个税扣缴义务人
|
||||||
|
private Long taxAgentId;
|
||||||
|
|
||||||
|
// 税款所属期
|
||||||
|
private YearMonth taxCycle;
|
||||||
|
|
||||||
|
// 已有的报送人员
|
||||||
|
private List<EmployeeDeclarePO> employeeDeclares;
|
||||||
|
|
||||||
|
// 上个税款所属期的报送人员
|
||||||
|
private List<EmployeeDeclarePO> preTaxCycleEmployeeDeclare;
|
||||||
|
|
||||||
|
// 薪资档案中的人员
|
||||||
|
private List<SalaryArchivePO> salaryArchives;
|
||||||
|
|
||||||
|
// 员工基本信息
|
||||||
|
private List<DataCollectionEmployee> employeeInfos;
|
||||||
|
|
||||||
|
// // 员工基本信息
|
||||||
|
// private List<HrmEmployeeComInfo> hrmEmployeeComInfos;
|
||||||
|
//
|
||||||
|
// // 员工个人信息
|
||||||
|
// private List<SimpleUserInfo> simpleUserInfos;
|
||||||
|
//
|
||||||
|
// // 非系统人员
|
||||||
|
// private List<ExtEmployeePO> extEmployees;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,28 @@
|
||||||
|
package com.engine.salary.entity.employeedeclare.dto;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 人员报送(个税扣缴义务人)列表
|
||||||
|
* @author: xiajun
|
||||||
|
* @modified By: xiajun
|
||||||
|
* @date: Created in 9/2/22 10:35 AM
|
||||||
|
* @version:v1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class TaxAgentDeclareListDTO {
|
||||||
|
|
||||||
|
// 主键id
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
// 个税扣缴义务人
|
||||||
|
private String taxAgentName;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,97 @@
|
||||||
|
package com.engine.salary.entity.employeedeclare.param;
|
||||||
|
|
||||||
|
import com.engine.salary.common.BaseQueryParam;
|
||||||
|
import com.engine.salary.enums.SalaryOnOffEnum;
|
||||||
|
import com.engine.salary.enums.employeedeclare.DeclareStatusEnum;
|
||||||
|
import com.engine.salary.enums.employeedeclare.EmploymentStatusEnum;
|
||||||
|
import com.engine.salary.enums.employeedeclare.EmploymentTypeEnum;
|
||||||
|
import com.engine.salary.util.valid.DataCheck;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.YearMonth;
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 人员报送(人员)列表查询参数
|
||||||
|
* @author: xiajun
|
||||||
|
* @modified By: xiajun
|
||||||
|
* @date: Created in 9/2/22 3:24 PM
|
||||||
|
* @version:v1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class EmployeeDeclareAddListQueryParam extends BaseQueryParam {
|
||||||
|
|
||||||
|
// 列表id
|
||||||
|
private Collection<Long> ids;
|
||||||
|
|
||||||
|
|
||||||
|
// 个税扣缴义务人id
|
||||||
|
@DataCheck(require = true,message = "参数错误,个税扣缴义务人id不能为空")
|
||||||
|
private Long taxAgentId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 参数错误,税款所属期参数格式错误
|
||||||
|
*/
|
||||||
|
@DataCheck(require = true,message = "参数错误,税款所属期参数格式错误")
|
||||||
|
// 税款所属期
|
||||||
|
private YearMonth taxCycle;
|
||||||
|
|
||||||
|
// 报送状态
|
||||||
|
private DeclareStatusEnum declareStatus;
|
||||||
|
|
||||||
|
// 员工姓名/编号
|
||||||
|
private String keyword;
|
||||||
|
|
||||||
|
// 部门
|
||||||
|
private Collection<Long> departmentIds;
|
||||||
|
|
||||||
|
// 岗位
|
||||||
|
private Collection<Long> positionIds;
|
||||||
|
|
||||||
|
// 人员状态
|
||||||
|
private EmploymentStatusEnum employmentStatus;
|
||||||
|
|
||||||
|
// 任职受雇从业类型
|
||||||
|
private EmploymentTypeEnum employmentType;
|
||||||
|
|
||||||
|
// 任职受雇日期开始
|
||||||
|
private LocalDate fromEmploymentDate;
|
||||||
|
|
||||||
|
// 任职受雇日期结束
|
||||||
|
private LocalDate endEmploymentDate;
|
||||||
|
|
||||||
|
// 离职日期开始
|
||||||
|
private LocalDate fromDismissDate;
|
||||||
|
|
||||||
|
// 离职日期结束
|
||||||
|
private LocalDate endDismissDate;
|
||||||
|
|
||||||
|
// 是否残疾
|
||||||
|
private SalaryOnOffEnum disability;
|
||||||
|
|
||||||
|
// 是否孤老
|
||||||
|
private SalaryOnOffEnum lonelyOld;
|
||||||
|
|
||||||
|
// 是否是烈属
|
||||||
|
private SalaryOnOffEnum martyrDependents;
|
||||||
|
|
||||||
|
// 是否扣除减除费用
|
||||||
|
private SalaryOnOffEnum deductExpenses;
|
||||||
|
|
||||||
|
@JsonIgnore
|
||||||
|
// 税款所属期(上月)
|
||||||
|
private String preTaxCycle;
|
||||||
|
|
||||||
|
@ApiModelProperty
|
||||||
|
private List<String> customColumns;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,42 @@
|
||||||
|
package com.engine.salary.entity.employeedeclare.param;
|
||||||
|
|
||||||
|
import com.engine.salary.common.BaseQueryParam;
|
||||||
|
import com.engine.salary.util.valid.DataCheck;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.time.YearMonth;
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 报送人员失败查询参数
|
||||||
|
* @author: xiajun
|
||||||
|
* @modified By: xiajun
|
||||||
|
* @date: Created in 2022/11/7 11:14 AM
|
||||||
|
* @version:v1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class EmployeeDeclareFailListQueryParam extends BaseQueryParam {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 列表id
|
||||||
|
*/
|
||||||
|
private Collection<Long> ids;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 个税扣缴义务人id
|
||||||
|
*/
|
||||||
|
@DataCheck(require = true,message = "参数错误,个税扣缴义务人id不能为空")
|
||||||
|
private Long taxAgentId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 税款所属期
|
||||||
|
*/
|
||||||
|
@DataCheck(require = true,message = "参数错误,税款所属期参数格式错误")
|
||||||
|
private YearMonth taxCycle;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,87 @@
|
||||||
|
package com.engine.salary.entity.employeedeclare.param;
|
||||||
|
|
||||||
|
import com.engine.salary.common.BaseQueryParam;
|
||||||
|
import com.engine.salary.enums.SalaryOnOffEnum;
|
||||||
|
import com.engine.salary.enums.employeedeclare.DeclareStatusEnum;
|
||||||
|
import com.engine.salary.enums.employeedeclare.EmploymentStatusEnum;
|
||||||
|
import com.engine.salary.enums.employeedeclare.EmploymentTypeEnum;
|
||||||
|
import com.engine.salary.util.valid.DataCheck;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.YearMonth;
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 人员报送(人员)列表查询参数
|
||||||
|
* @author: xiajun
|
||||||
|
* @modified By: xiajun
|
||||||
|
* @date: Created in 9/2/22 3:24 PM
|
||||||
|
* @version:v1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class EmployeeDeclareListQueryParam extends BaseQueryParam {
|
||||||
|
|
||||||
|
// 列表id
|
||||||
|
private Collection<Long> ids;
|
||||||
|
|
||||||
|
// 个税扣缴义务人id
|
||||||
|
@DataCheck(require = true,message = "参数错误,个税扣缴义务人id不能为空")
|
||||||
|
private Long taxAgentId;
|
||||||
|
|
||||||
|
// 税款所属期
|
||||||
|
@DataCheck(require = true,message = "参数错误,税款所属期参数格式错误")
|
||||||
|
private YearMonth taxCycle;
|
||||||
|
|
||||||
|
// 报送状态
|
||||||
|
private DeclareStatusEnum declareStatus;
|
||||||
|
|
||||||
|
// 员工姓名/编号
|
||||||
|
private String keyword;
|
||||||
|
|
||||||
|
// 部门
|
||||||
|
private Collection<Long> departmentIds;
|
||||||
|
|
||||||
|
// 岗位
|
||||||
|
private Collection<Long> positionIds;
|
||||||
|
|
||||||
|
// 人员状态
|
||||||
|
private EmploymentStatusEnum employmentStatus;
|
||||||
|
|
||||||
|
// 任职受雇从业类型
|
||||||
|
private EmploymentTypeEnum employmentType;
|
||||||
|
|
||||||
|
// 任职受雇日期开始
|
||||||
|
private LocalDate fromEmploymentDate;
|
||||||
|
|
||||||
|
// 任职受雇日期结束
|
||||||
|
private LocalDate endEmploymentDate;
|
||||||
|
|
||||||
|
// 离职日期开始
|
||||||
|
private LocalDate fromDismissDate;
|
||||||
|
|
||||||
|
// 离职日期结束
|
||||||
|
private LocalDate endDismissDate;
|
||||||
|
|
||||||
|
// 是否残疾
|
||||||
|
private SalaryOnOffEnum disability;
|
||||||
|
|
||||||
|
// 是否孤老
|
||||||
|
private SalaryOnOffEnum lonelyOld;
|
||||||
|
|
||||||
|
// 是否是烈属
|
||||||
|
private SalaryOnOffEnum martyrDependents;
|
||||||
|
|
||||||
|
// 是否扣除减除费用
|
||||||
|
private SalaryOnOffEnum deductExpenses;
|
||||||
|
|
||||||
|
|
||||||
|
private List<String> customColumns;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,35 @@
|
||||||
|
package com.engine.salary.entity.employeedeclare.param;
|
||||||
|
|
||||||
|
import com.engine.salary.util.valid.DataCheck;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.time.YearMonth;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 人员报送
|
||||||
|
* @author: xiajun
|
||||||
|
* @modified By: xiajun
|
||||||
|
* @date: Created in 2022/10/28 6:06 PM
|
||||||
|
* @version:v1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class EmployeeDeclareParam {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 个税扣缴义务人id
|
||||||
|
*/
|
||||||
|
@DataCheck(require = true,message = "参数错误,个税扣缴义务人id不能为空")
|
||||||
|
private Long taxAgentId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 税款所属期
|
||||||
|
*/
|
||||||
|
@DataCheck(require = true,message = "参数错误,税款所属期参数格式错误")
|
||||||
|
private YearMonth taxCycle;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,35 @@
|
||||||
|
package com.engine.salary.entity.employeedeclare.param;
|
||||||
|
|
||||||
|
import com.engine.salary.util.valid.DataCheck;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.time.YearMonth;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 刷新报送人员
|
||||||
|
* @author: xiajun
|
||||||
|
* @modified By: xiajun
|
||||||
|
* @date: 2022/11/6 15:17
|
||||||
|
* @version:v1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class EmployeeDeclareRefreshParam {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 个税扣缴义务人id
|
||||||
|
*/
|
||||||
|
@DataCheck(require = true,message = "参数错误,个税扣缴义务人id不能为空")
|
||||||
|
private Long taxAgentId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 税款所属期
|
||||||
|
*/
|
||||||
|
@DataCheck(require = true,message = "参数错误,税款所属期参数格式错误")
|
||||||
|
private YearMonth taxCycle;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
package com.engine.salary.entity.employeedeclare.param;
|
||||||
|
|
||||||
|
import com.engine.salary.common.BaseQueryParam;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 人员报送(个税扣缴义务人)查询条件
|
||||||
|
* @author: xiajun
|
||||||
|
* @modified By: xiajun
|
||||||
|
* @date: Created in 9/2/22 10:59 AM
|
||||||
|
* @version:v1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class TaxAgentDeclareListQueryParam extends BaseQueryParam {
|
||||||
|
|
||||||
|
// "个税扣缴义务人名称"
|
||||||
|
private String taxAgentName;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,224 @@
|
||||||
|
package com.engine.salary.entity.employeedeclare.po;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 人员报送(人员)
|
||||||
|
* @TableName(value = "hrsa_employee_declare")
|
||||||
|
* @ElogTransform(name = "报送人员")
|
||||||
|
* @author: xiajun
|
||||||
|
* @modified By: xiajun
|
||||||
|
* @date: Created in 9/2/22 9:22 AM
|
||||||
|
* @version:v1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class EmployeeDeclarePO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键id
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 个税扣缴义务人
|
||||||
|
*/
|
||||||
|
private Long taxAgentId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 税款所属期
|
||||||
|
*/
|
||||||
|
private String taxCycle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人员id
|
||||||
|
*/
|
||||||
|
private Long employeeId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人员类型
|
||||||
|
*/
|
||||||
|
private Integer employeeType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人员名称
|
||||||
|
*/
|
||||||
|
private String employeeName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工号
|
||||||
|
*/
|
||||||
|
private String jobNum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 证件类型
|
||||||
|
*/
|
||||||
|
private Integer cardType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 证件号码
|
||||||
|
*/
|
||||||
|
private String cardNum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 性别
|
||||||
|
*/
|
||||||
|
private Integer gender;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出生日期
|
||||||
|
*/
|
||||||
|
private Date birthday;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态
|
||||||
|
*/
|
||||||
|
private Integer employmentStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手机号码
|
||||||
|
*/
|
||||||
|
private String mobile;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任职受雇从业类型
|
||||||
|
*/
|
||||||
|
private Integer employmentType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入职年度就业情形
|
||||||
|
*/
|
||||||
|
private String employmentFirstYear;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任职受雇从业日期
|
||||||
|
*/
|
||||||
|
private Date employmentDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 离职日期
|
||||||
|
*/
|
||||||
|
private Date dismissDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否残疾
|
||||||
|
*/
|
||||||
|
private Integer disability;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 残疾证号
|
||||||
|
*/
|
||||||
|
private String disabilityCardNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否孤老
|
||||||
|
*/
|
||||||
|
private Integer lonelyOld;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否是烈属
|
||||||
|
*/
|
||||||
|
private Integer martyrDependents;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 烈属证号
|
||||||
|
*/
|
||||||
|
private String martyrDependentsCardNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否扣除减除费用
|
||||||
|
*/
|
||||||
|
private Integer deductExpenses;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否成功报送过
|
||||||
|
* 注意:不仅仅是针对某一个月
|
||||||
|
* 0:从未报送成功过、1:报送成功过
|
||||||
|
*/
|
||||||
|
private Integer successfullyDeclared;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 员工信息是否发生变动:
|
||||||
|
* 0:本月未改动、1:本月有改动
|
||||||
|
*/
|
||||||
|
private Integer newEmployeeInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 申报状态
|
||||||
|
*/
|
||||||
|
private Integer declareStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 申报失败的错误信息
|
||||||
|
*/
|
||||||
|
private String declareErrorMsg;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 租户key
|
||||||
|
*/
|
||||||
|
private String tenantKey;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建人id
|
||||||
|
*/
|
||||||
|
private Long creator;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否删除
|
||||||
|
*/
|
||||||
|
private Integer deleteType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新时间
|
||||||
|
*/
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
|
||||||
|
public String toCompareString() {
|
||||||
|
return "EmployeeDeclarePO{" +
|
||||||
|
"id=" + id +
|
||||||
|
", taxAgentId=" + taxAgentId +
|
||||||
|
", taxCycle='" + taxCycle + '\'' +
|
||||||
|
", employeeId=" + employeeId +
|
||||||
|
", employeeType=" + employeeType +
|
||||||
|
", employeeName='" + employeeName + '\'' +
|
||||||
|
", jobNum='" + jobNum + '\'' +
|
||||||
|
", cardType=" + cardType +
|
||||||
|
", cardNum='" + cardNum + '\'' +
|
||||||
|
", gender=" + gender +
|
||||||
|
", birthday=" + birthday +
|
||||||
|
", employmentStatus=" + employmentStatus +
|
||||||
|
", mobile='" + mobile + '\'' +
|
||||||
|
", employmentType=" + employmentType +
|
||||||
|
", employmentFirstYear='" + employmentFirstYear + '\'' +
|
||||||
|
", employmentDate=" + employmentDate +
|
||||||
|
", dismissDate=" + dismissDate +
|
||||||
|
", disability=" + disability +
|
||||||
|
", disabilityCardNo='" + disabilityCardNo + '\'' +
|
||||||
|
", lonelyOld=" + lonelyOld +
|
||||||
|
", martyrDependents=" + martyrDependents +
|
||||||
|
", martyrDependentsCardNo='" + martyrDependentsCardNo + '\'' +
|
||||||
|
", deductExpenses=" + deductExpenses +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
|
||||||
|
private Collection<Long> ids;
|
||||||
|
private Collection<Long> employeeIds;
|
||||||
|
}
|
||||||
|
|
@ -2,6 +2,8 @@ package com.engine.salary.enums.salaryaccounting;
|
||||||
|
|
||||||
import com.engine.salary.enums.BaseEnum;
|
import com.engine.salary.enums.BaseEnum;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 人员类型
|
* 人员类型
|
||||||
*/
|
*/
|
||||||
|
|
@ -37,4 +39,13 @@ public enum EmployeeTypeEnum implements BaseEnum<Integer> {
|
||||||
public String getDefaultLabel() {
|
public String getDefaultLabel() {
|
||||||
return defaultLabel;
|
return defaultLabel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static EmployeeTypeEnum parseByValue(Integer value) {
|
||||||
|
for (EmployeeTypeEnum typeEnum : EmployeeTypeEnum.values()) {
|
||||||
|
if (Objects.equals(typeEnum.getValue(), value)) {
|
||||||
|
return typeEnum;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,107 @@
|
||||||
|
package com.engine.salary.mapper.employeedeclare;
|
||||||
|
|
||||||
|
import com.engine.salary.entity.employeedeclare.param.EmployeeDeclareAddListQueryParam;
|
||||||
|
import com.engine.salary.entity.employeedeclare.param.EmployeeDeclareListQueryParam;
|
||||||
|
import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Harryxzy
|
||||||
|
* @ClassName EmployeeDeclareMapper
|
||||||
|
* @date 2023/08/03 13:26
|
||||||
|
* @description
|
||||||
|
*/
|
||||||
|
public interface EmployeeDeclareMapper {
|
||||||
|
/**
|
||||||
|
* 查询所有记录
|
||||||
|
*
|
||||||
|
* @return 返回集合,没有返回空List
|
||||||
|
*/
|
||||||
|
List<EmployeeDeclarePO> listAll();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 条件查询
|
||||||
|
*
|
||||||
|
* @return 返回集合,没有返回空List
|
||||||
|
*/
|
||||||
|
List<EmployeeDeclarePO> listSome(EmployeeDeclarePO employeeDeclare);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据主键查询
|
||||||
|
*
|
||||||
|
* @param id 主键
|
||||||
|
* @return 返回记录,没有返回null
|
||||||
|
*/
|
||||||
|
EmployeeDeclarePO getById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增,忽略null字段
|
||||||
|
*
|
||||||
|
* @param employeeDeclare 新增的记录
|
||||||
|
* @return 返回影响行数
|
||||||
|
*/
|
||||||
|
int insertIgnoreNull(EmployeeDeclarePO employeeDeclare);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改,修改所有字段
|
||||||
|
*
|
||||||
|
* @param employeeDeclare 修改的记录
|
||||||
|
* @return 返回影响行数
|
||||||
|
*/
|
||||||
|
int update(EmployeeDeclarePO employeeDeclare);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改,忽略null字段
|
||||||
|
*
|
||||||
|
* @param employeeDeclare 修改的记录
|
||||||
|
* @return 返回影响行数
|
||||||
|
*/
|
||||||
|
int updateIgnoreNull(EmployeeDeclarePO employeeDeclare);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除记录
|
||||||
|
*
|
||||||
|
* @param employeeDeclare 待删除的记录
|
||||||
|
* @return 返回影响行数
|
||||||
|
*/
|
||||||
|
int delete(EmployeeDeclarePO employeeDeclare);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询报送的人员
|
||||||
|
*
|
||||||
|
* @param queryParam
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<EmployeeDeclarePO> listByParam(@Param("param") EmployeeDeclareListQueryParam queryParam );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询本月新增的人员
|
||||||
|
*
|
||||||
|
* @param queryParam
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<EmployeeDeclarePO> list4AddByParam(@Param("param") EmployeeDeclareAddListQueryParam queryParam);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询本月变动的人员
|
||||||
|
*
|
||||||
|
* @param queryParam
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<EmployeeDeclarePO> list4UpdateByParam(@Param("param") EmployeeDeclareListQueryParam queryParam);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据idList删除
|
||||||
|
* @param ids
|
||||||
|
* @param date 删除时间
|
||||||
|
*/
|
||||||
|
void deleteByIds(@Param("ids") Collection<Long> ids, @Param("date") Date date);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,687 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||||
|
<mapper namespace="com.engine.salary.mapper.employeedeclare.EmployeeDeclareMapper">
|
||||||
|
<resultMap id="BaseResultMap" type="com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO">
|
||||||
|
<result column="id" property="id" />
|
||||||
|
<result column="tax_agent_id" property="taxAgentId" />
|
||||||
|
<result column="tax_cycle" property="taxCycle" />
|
||||||
|
<result column="employee_id" property="employeeId" />
|
||||||
|
<result column="employee_type" property="employeeType" />
|
||||||
|
<result column="employee_name" property="employeeName" />
|
||||||
|
<result column="job_num" property="jobNum" />
|
||||||
|
<result column="card_type" property="cardType" />
|
||||||
|
<result column="card_num" property="cardNum" />
|
||||||
|
<result column="gender" property="gender" />
|
||||||
|
<result column="birthday" property="birthday" />
|
||||||
|
<result column="employment_status" property="employmentStatus" />
|
||||||
|
<result column="mobile" property="mobile" />
|
||||||
|
<result column="employment_type" property="employmentType" />
|
||||||
|
<result column="employment_first_year" property="employmentFirstYear" />
|
||||||
|
<result column="employment_date" property="employmentDate" />
|
||||||
|
<result column="dismiss_date" property="dismissDate" />
|
||||||
|
<result column="disability" property="disability" />
|
||||||
|
<result column="disability_card_no" property="disabilityCardNo" />
|
||||||
|
<result column="lonely_old" property="lonelyOld" />
|
||||||
|
<result column="martyr_dependents" property="martyrDependents" />
|
||||||
|
<result column="martyr_dependents_card_no" property="martyrDependentsCardNo" />
|
||||||
|
<result column="deduct_expenses" property="deductExpenses" />
|
||||||
|
<result column="successfully_declared" property="successfullyDeclared" />
|
||||||
|
<result column="new_employee_info" property="newEmployeeInfo" />
|
||||||
|
<result column="declare_status" property="declareStatus" />
|
||||||
|
<result column="declare_error_msg" property="declareErrorMsg" />
|
||||||
|
<result column="tenant_key" property="tenantKey" />
|
||||||
|
<result column="creator" property="creator" />
|
||||||
|
<result column="delete_type" property="deleteType" />
|
||||||
|
<result column="create_time" property="createTime" />
|
||||||
|
<result column="update_time" property="updateTime" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<!-- 表字段 -->
|
||||||
|
<sql id="baseColumns">
|
||||||
|
t.id
|
||||||
|
, t.tax_agent_id
|
||||||
|
, t.tax_cycle
|
||||||
|
, t.employee_id
|
||||||
|
, t.employee_type
|
||||||
|
, t.employee_name
|
||||||
|
, t.job_num
|
||||||
|
, t.card_type
|
||||||
|
, t.card_num
|
||||||
|
, t.gender
|
||||||
|
, t.birthday
|
||||||
|
, t.employment_status
|
||||||
|
, t.mobile
|
||||||
|
, t.employment_type
|
||||||
|
, t.employment_first_year
|
||||||
|
, t.employment_date
|
||||||
|
, t.dismiss_date
|
||||||
|
, t.disability
|
||||||
|
, t.disability_card_no
|
||||||
|
, t.lonely_old
|
||||||
|
, t.martyr_dependents
|
||||||
|
, t.martyr_dependents_card_no
|
||||||
|
, t.deduct_expenses
|
||||||
|
, t.successfully_declared
|
||||||
|
, t.new_employee_info
|
||||||
|
, t.declare_status
|
||||||
|
, t.declare_error_msg
|
||||||
|
, t.tenant_key
|
||||||
|
, t.creator
|
||||||
|
, t.delete_type
|
||||||
|
, t.create_time
|
||||||
|
, t.update_time
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 查询全部 -->
|
||||||
|
<select id="listAll" resultMap="BaseResultMap">
|
||||||
|
SELECT
|
||||||
|
<include refid="baseColumns" />
|
||||||
|
FROM hrsa_employee_declare t
|
||||||
|
WHERE delete_type = 0
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 根据主键获取单条记录 -->
|
||||||
|
<select id="getById" resultMap="BaseResultMap" parameterType="Long">
|
||||||
|
SELECT
|
||||||
|
<include refid="baseColumns" />
|
||||||
|
FROM hrsa_employee_declare t
|
||||||
|
WHERE id = #{id} AND delete_type = 0
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 条件查询 -->
|
||||||
|
<select id="listSome" resultMap="BaseResultMap" parameterType="com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO">
|
||||||
|
SELECT
|
||||||
|
<include refid="baseColumns" />
|
||||||
|
FROM hrsa_employee_declare t
|
||||||
|
WHERE delete_type = 0
|
||||||
|
<if test="id != null">
|
||||||
|
AND id = #{id}
|
||||||
|
</if>
|
||||||
|
<if test="taxAgentId != null">
|
||||||
|
AND tax_agent_id = #{taxAgentId}
|
||||||
|
</if>
|
||||||
|
<if test="taxCycle != null">
|
||||||
|
AND tax_cycle = #{taxCycle}
|
||||||
|
</if>
|
||||||
|
<if test="employeeId != null">
|
||||||
|
AND employee_id = #{employeeId}
|
||||||
|
</if>
|
||||||
|
<if test="employeeType != null">
|
||||||
|
AND employee_type = #{employeeType}
|
||||||
|
</if>
|
||||||
|
<if test="employeeName != null">
|
||||||
|
AND employee_name = #{employeeName}
|
||||||
|
</if>
|
||||||
|
<if test="jobNum != null">
|
||||||
|
AND job_num = #{jobNum}
|
||||||
|
</if>
|
||||||
|
<if test="cardType != null">
|
||||||
|
AND card_type = #{cardType}
|
||||||
|
</if>
|
||||||
|
<if test="cardNum != null">
|
||||||
|
AND card_num = #{cardNum}
|
||||||
|
</if>
|
||||||
|
<if test="gender != null">
|
||||||
|
AND gender = #{gender}
|
||||||
|
</if>
|
||||||
|
<if test="birthday != null">
|
||||||
|
AND birthday = #{birthday}
|
||||||
|
</if>
|
||||||
|
<if test="employmentStatus != null">
|
||||||
|
AND employment_status = #{employmentStatus}
|
||||||
|
</if>
|
||||||
|
<if test="mobile != null">
|
||||||
|
AND mobile = #{mobile}
|
||||||
|
</if>
|
||||||
|
<if test="employmentType != null">
|
||||||
|
AND employment_type = #{employmentType}
|
||||||
|
</if>
|
||||||
|
<if test="employmentFirstYear != null">
|
||||||
|
AND employment_first_year = #{employmentFirstYear}
|
||||||
|
</if>
|
||||||
|
<if test="employmentDate != null">
|
||||||
|
AND employment_date = #{employmentDate}
|
||||||
|
</if>
|
||||||
|
<if test="dismissDate != null">
|
||||||
|
AND dismiss_date = #{dismissDate}
|
||||||
|
</if>
|
||||||
|
<if test="disability != null">
|
||||||
|
AND disability = #{disability}
|
||||||
|
</if>
|
||||||
|
<if test="disabilityCardNo != null">
|
||||||
|
AND disability_card_no = #{disabilityCardNo}
|
||||||
|
</if>
|
||||||
|
<if test="lonelyOld != null">
|
||||||
|
AND lonely_old = #{lonelyOld}
|
||||||
|
</if>
|
||||||
|
<if test="martyrDependents != null">
|
||||||
|
AND martyr_dependents = #{martyrDependents}
|
||||||
|
</if>
|
||||||
|
<if test="martyrDependentsCardNo != null">
|
||||||
|
AND martyr_dependents_card_no = #{martyrDependentsCardNo}
|
||||||
|
</if>
|
||||||
|
<if test="deductExpenses != null">
|
||||||
|
AND deduct_expenses = #{deductExpenses}
|
||||||
|
</if>
|
||||||
|
<if test="successfullyDeclared != null">
|
||||||
|
AND successfully_declared = #{successfullyDeclared}
|
||||||
|
</if>
|
||||||
|
<if test="newEmployeeinfo != null">
|
||||||
|
AND new_employee_info = #{newEmployeeinfo}
|
||||||
|
</if>
|
||||||
|
<if test="declareStatus != null">
|
||||||
|
AND declare_status = #{declareStatus}
|
||||||
|
</if>
|
||||||
|
<if test="declareErrorMsg != null">
|
||||||
|
AND declare_error_msg = #{declareErrorMsg}
|
||||||
|
</if>
|
||||||
|
<if test="tenantKey != null">
|
||||||
|
AND tenant_key = #{tenantKey}
|
||||||
|
</if>
|
||||||
|
<if test="creator != null">
|
||||||
|
AND creator = #{creator}
|
||||||
|
</if>
|
||||||
|
<if test="createTime != null">
|
||||||
|
AND create_time = #{createTime}
|
||||||
|
</if>
|
||||||
|
<if test="updateTime != null">
|
||||||
|
AND update_time = #{updateTime}
|
||||||
|
</if>
|
||||||
|
<if test="employeeIds != null and employeeIds.size()>0">
|
||||||
|
AND employee_id IN
|
||||||
|
<foreach collection="employeeIds" open="(" item="employeeId" separator="," close=")">
|
||||||
|
#{employeeId}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
<if test="ids != null and ids.size()>0">
|
||||||
|
AND id IN
|
||||||
|
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
ORDER BY id DESC
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 插入不为NULL的字段 -->
|
||||||
|
<insert id="insertIgnoreNull" parameterType="com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO">
|
||||||
|
INSERT INTO hrsa_employee_declare
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
|
||||||
|
<if test="id != null">
|
||||||
|
id,
|
||||||
|
</if>
|
||||||
|
<if test="taxAgentId != null">
|
||||||
|
tax_agent_id,
|
||||||
|
</if>
|
||||||
|
<if test="taxCycle != null">
|
||||||
|
tax_cycle,
|
||||||
|
</if>
|
||||||
|
<if test="employeeId != null">
|
||||||
|
employee_id,
|
||||||
|
</if>
|
||||||
|
<if test="employeeType != null">
|
||||||
|
employee_type,
|
||||||
|
</if>
|
||||||
|
<if test="employeeName != null">
|
||||||
|
employee_name,
|
||||||
|
</if>
|
||||||
|
<if test="jobNum != null">
|
||||||
|
job_num,
|
||||||
|
</if>
|
||||||
|
<if test="cardType != null">
|
||||||
|
card_type,
|
||||||
|
</if>
|
||||||
|
<if test="cardNum != null">
|
||||||
|
card_num,
|
||||||
|
</if>
|
||||||
|
<if test="gender != null">
|
||||||
|
gender,
|
||||||
|
</if>
|
||||||
|
<if test="birthday != null">
|
||||||
|
birthday,
|
||||||
|
</if>
|
||||||
|
<if test="employmentStatus != null">
|
||||||
|
employment_status,
|
||||||
|
</if>
|
||||||
|
<if test="mobile != null">
|
||||||
|
mobile,
|
||||||
|
</if>
|
||||||
|
<if test="employmentType != null">
|
||||||
|
employment_type,
|
||||||
|
</if>
|
||||||
|
<if test="employmentFirstYear != null">
|
||||||
|
employment_first_year,
|
||||||
|
</if>
|
||||||
|
<if test="employmentDate != null">
|
||||||
|
employment_date,
|
||||||
|
</if>
|
||||||
|
<if test="dismissDate != null">
|
||||||
|
dismiss_date,
|
||||||
|
</if>
|
||||||
|
<if test="disability != null">
|
||||||
|
disability,
|
||||||
|
</if>
|
||||||
|
<if test="disabilityCardNo != null">
|
||||||
|
disability_card_no,
|
||||||
|
</if>
|
||||||
|
<if test="lonelyOld != null">
|
||||||
|
lonely_old,
|
||||||
|
</if>
|
||||||
|
<if test="martyrDependents != null">
|
||||||
|
martyr_dependents,
|
||||||
|
</if>
|
||||||
|
<if test="martyrDependentsCardNo != null">
|
||||||
|
martyr_dependents_card_no,
|
||||||
|
</if>
|
||||||
|
<if test="deductExpenses != null">
|
||||||
|
deduct_expenses,
|
||||||
|
</if>
|
||||||
|
<if test="successfullyDeclared != null">
|
||||||
|
successfully_declared,
|
||||||
|
</if>
|
||||||
|
<if test="newEmployeeinfo != null">
|
||||||
|
new_employee_info,
|
||||||
|
</if>
|
||||||
|
<if test="declareStatus != null">
|
||||||
|
declare_status,
|
||||||
|
</if>
|
||||||
|
<if test="declareErrorMsg != null">
|
||||||
|
declare_error_msg,
|
||||||
|
</if>
|
||||||
|
<if test="tenantKey != null">
|
||||||
|
tenant_key,
|
||||||
|
</if>
|
||||||
|
<if test="creator != null">
|
||||||
|
creator,
|
||||||
|
</if>
|
||||||
|
<if test="deleteType != null">
|
||||||
|
delete_type,
|
||||||
|
</if>
|
||||||
|
<if test="createTime != null">
|
||||||
|
create_time,
|
||||||
|
</if>
|
||||||
|
<if test="updateTime != null">
|
||||||
|
update_time,
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="id != null" >
|
||||||
|
#{id},
|
||||||
|
</if>
|
||||||
|
<if test="taxAgentId != null" >
|
||||||
|
#{taxAgentId},
|
||||||
|
</if>
|
||||||
|
<if test="taxCycle != null" >
|
||||||
|
#{taxCycle},
|
||||||
|
</if>
|
||||||
|
<if test="employeeId != null" >
|
||||||
|
#{employeeId},
|
||||||
|
</if>
|
||||||
|
<if test="employeeType != null" >
|
||||||
|
#{employeeType},
|
||||||
|
</if>
|
||||||
|
<if test="employeeName != null" >
|
||||||
|
#{employeeName},
|
||||||
|
</if>
|
||||||
|
<if test="jobNum != null" >
|
||||||
|
#{jobNum},
|
||||||
|
</if>
|
||||||
|
<if test="cardType != null" >
|
||||||
|
#{cardType},
|
||||||
|
</if>
|
||||||
|
<if test="cardNum != null" >
|
||||||
|
#{cardNum},
|
||||||
|
</if>
|
||||||
|
<if test="gender != null" >
|
||||||
|
#{gender},
|
||||||
|
</if>
|
||||||
|
<if test="birthday != null" >
|
||||||
|
#{birthday},
|
||||||
|
</if>
|
||||||
|
<if test="employmentStatus != null" >
|
||||||
|
#{employmentStatus},
|
||||||
|
</if>
|
||||||
|
<if test="mobile != null" >
|
||||||
|
#{mobile},
|
||||||
|
</if>
|
||||||
|
<if test="employmentType != null" >
|
||||||
|
#{employmentType},
|
||||||
|
</if>
|
||||||
|
<if test="employmentFirstYear != null" >
|
||||||
|
#{employmentFirstYear},
|
||||||
|
</if>
|
||||||
|
<if test="employmentDate != null" >
|
||||||
|
#{employmentDate},
|
||||||
|
</if>
|
||||||
|
<if test="dismissDate != null" >
|
||||||
|
#{dismissDate},
|
||||||
|
</if>
|
||||||
|
<if test="disability != null" >
|
||||||
|
#{disability},
|
||||||
|
</if>
|
||||||
|
<if test="disabilityCardNo != null" >
|
||||||
|
#{disabilityCardNo},
|
||||||
|
</if>
|
||||||
|
<if test="lonelyOld != null" >
|
||||||
|
#{lonelyOld},
|
||||||
|
</if>
|
||||||
|
<if test="martyrDependents != null" >
|
||||||
|
#{martyrDependents},
|
||||||
|
</if>
|
||||||
|
<if test="martyrDependentsCardNo != null" >
|
||||||
|
#{martyrDependentsCardNo},
|
||||||
|
</if>
|
||||||
|
<if test="deductExpenses != null" >
|
||||||
|
#{deductExpenses},
|
||||||
|
</if>
|
||||||
|
<if test="successfullyDeclared != null" >
|
||||||
|
#{successfullyDeclared},
|
||||||
|
</if>
|
||||||
|
<if test="newEmployeeinfo != null" >
|
||||||
|
#{newEmployeeinfo},
|
||||||
|
</if>
|
||||||
|
<if test="declareStatus != null" >
|
||||||
|
#{declareStatus},
|
||||||
|
</if>
|
||||||
|
<if test="declareErrorMsg != null" >
|
||||||
|
#{declareErrorMsg},
|
||||||
|
</if>
|
||||||
|
<if test="tenantKey != null" >
|
||||||
|
#{tenantKey},
|
||||||
|
</if>
|
||||||
|
<if test="creator != null" >
|
||||||
|
#{creator},
|
||||||
|
</if>
|
||||||
|
<if test="deleteType != null" >
|
||||||
|
#{deleteType},
|
||||||
|
</if>
|
||||||
|
<if test="createTime != null" >
|
||||||
|
#{createTime},
|
||||||
|
</if>
|
||||||
|
<if test="updateTime != null" >
|
||||||
|
#{updateTime},
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<!-- 更新,更新全部字段 -->
|
||||||
|
<update id="update" parameterType="com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO">
|
||||||
|
UPDATE hrsa_employee_declare
|
||||||
|
<set>
|
||||||
|
tax_agent_id=#{taxAgentId},
|
||||||
|
tax_cycle=#{taxCycle},
|
||||||
|
employee_id=#{employeeId},
|
||||||
|
employee_type=#{employeeType},
|
||||||
|
employee_name=#{employeeName},
|
||||||
|
job_num=#{jobNum},
|
||||||
|
card_type=#{cardType},
|
||||||
|
card_num=#{cardNum},
|
||||||
|
gender=#{gender},
|
||||||
|
birthday=#{birthday},
|
||||||
|
employment_status=#{employmentStatus},
|
||||||
|
mobile=#{mobile},
|
||||||
|
employment_type=#{employmentType},
|
||||||
|
employment_first_year=#{employmentFirstYear},
|
||||||
|
employment_date=#{employmentDate},
|
||||||
|
dismiss_date=#{dismissDate},
|
||||||
|
disability=#{disability},
|
||||||
|
disability_card_no=#{disabilityCardNo},
|
||||||
|
lonely_old=#{lonelyOld},
|
||||||
|
martyr_dependents=#{martyrDependents},
|
||||||
|
martyr_dependents_card_no=#{martyrDependentsCardNo},
|
||||||
|
deduct_expenses=#{deductExpenses},
|
||||||
|
successfully_declared=#{successfullyDeclared},
|
||||||
|
new_employee_info=#{newEmployeeinfo},
|
||||||
|
declare_status=#{declareStatus},
|
||||||
|
declare_error_msg=#{declareErrorMsg},
|
||||||
|
tenant_key=#{tenantKey},
|
||||||
|
creator=#{creator},
|
||||||
|
delete_type=#{deleteType},
|
||||||
|
create_time=#{createTime},
|
||||||
|
update_time=#{updateTime},
|
||||||
|
</set>
|
||||||
|
WHERE id = #{id} AND delete_type = 0
|
||||||
|
</update>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 更新不为NULL的字段 -->
|
||||||
|
<update id="updateIgnoreNull" parameterType="com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO">
|
||||||
|
UPDATE hrsa_employee_declare
|
||||||
|
<set>
|
||||||
|
<if test="taxAgentId != null" >
|
||||||
|
tax_agent_id=#{taxAgentId},
|
||||||
|
</if>
|
||||||
|
<if test="taxCycle != null" >
|
||||||
|
tax_cycle=#{taxCycle},
|
||||||
|
</if>
|
||||||
|
<if test="employeeId != null" >
|
||||||
|
employee_id=#{employeeId},
|
||||||
|
</if>
|
||||||
|
<if test="employeeType != null" >
|
||||||
|
employee_type=#{employeeType},
|
||||||
|
</if>
|
||||||
|
<if test="employeeName != null" >
|
||||||
|
employee_name=#{employeeName},
|
||||||
|
</if>
|
||||||
|
<if test="jobNum != null" >
|
||||||
|
job_num=#{jobNum},
|
||||||
|
</if>
|
||||||
|
<if test="cardType != null" >
|
||||||
|
card_type=#{cardType},
|
||||||
|
</if>
|
||||||
|
<if test="cardNum != null" >
|
||||||
|
card_num=#{cardNum},
|
||||||
|
</if>
|
||||||
|
<if test="gender != null" >
|
||||||
|
gender=#{gender},
|
||||||
|
</if>
|
||||||
|
<if test="birthday != null" >
|
||||||
|
birthday=#{birthday},
|
||||||
|
</if>
|
||||||
|
<if test="employmentStatus != null" >
|
||||||
|
employment_status=#{employmentStatus},
|
||||||
|
</if>
|
||||||
|
<if test="mobile != null" >
|
||||||
|
mobile=#{mobile},
|
||||||
|
</if>
|
||||||
|
<if test="employmentType != null" >
|
||||||
|
employment_type=#{employmentType},
|
||||||
|
</if>
|
||||||
|
<if test="employmentFirstYear != null" >
|
||||||
|
employment_first_year=#{employmentFirstYear},
|
||||||
|
</if>
|
||||||
|
<if test="employmentDate != null" >
|
||||||
|
employment_date=#{employmentDate},
|
||||||
|
</if>
|
||||||
|
<if test="dismissDate != null" >
|
||||||
|
dismiss_date=#{dismissDate},
|
||||||
|
</if>
|
||||||
|
<if test="disability != null" >
|
||||||
|
disability=#{disability},
|
||||||
|
</if>
|
||||||
|
<if test="disabilityCardNo != null" >
|
||||||
|
disability_card_no=#{disabilityCardNo},
|
||||||
|
</if>
|
||||||
|
<if test="lonelyOld != null" >
|
||||||
|
lonely_old=#{lonelyOld},
|
||||||
|
</if>
|
||||||
|
<if test="martyrDependents != null" >
|
||||||
|
martyr_dependents=#{martyrDependents},
|
||||||
|
</if>
|
||||||
|
<if test="martyrDependentsCardNo != null" >
|
||||||
|
martyr_dependents_card_no=#{martyrDependentsCardNo},
|
||||||
|
</if>
|
||||||
|
<if test="deductExpenses != null" >
|
||||||
|
deduct_expenses=#{deductExpenses},
|
||||||
|
</if>
|
||||||
|
<if test="successfullyDeclared != null" >
|
||||||
|
successfully_declared=#{successfullyDeclared},
|
||||||
|
</if>
|
||||||
|
<if test="newEmployeeinfo != null" >
|
||||||
|
new_employee_info=#{newEmployeeinfo},
|
||||||
|
</if>
|
||||||
|
<if test="declareStatus != null" >
|
||||||
|
declare_status=#{declareStatus},
|
||||||
|
</if>
|
||||||
|
<if test="declareErrorMsg != null" >
|
||||||
|
declare_error_msg=#{declareErrorMsg},
|
||||||
|
</if>
|
||||||
|
<if test="tenantKey != null" >
|
||||||
|
tenant_key=#{tenantKey},
|
||||||
|
</if>
|
||||||
|
<if test="creator != null" >
|
||||||
|
creator=#{creator},
|
||||||
|
</if>
|
||||||
|
<if test="deleteType != null" >
|
||||||
|
delete_type=#{deleteType},
|
||||||
|
</if>
|
||||||
|
<if test="createTime != null" >
|
||||||
|
create_time=#{createTime},
|
||||||
|
</if>
|
||||||
|
<if test="updateTime != null" >
|
||||||
|
update_time=#{updateTime},
|
||||||
|
</if>
|
||||||
|
</set>
|
||||||
|
WHERE id = #{id} AND delete_type = 0
|
||||||
|
</update>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 根据主键删除记录 -->
|
||||||
|
<delete id="delete" parameterType="com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO">
|
||||||
|
UPDATE hrsa_employee_declare
|
||||||
|
SET delete_type=1
|
||||||
|
WHERE id = #{id} AND delete_type = 0
|
||||||
|
</delete>
|
||||||
|
<delete id="deleteByIds">
|
||||||
|
UPDATE hrsa_employee_declare
|
||||||
|
SET delete_type=1,
|
||||||
|
update_time = #{date}
|
||||||
|
WHERE delete_type = 0
|
||||||
|
<if test="ids != null and param.ids.size()>0">
|
||||||
|
AND id IN
|
||||||
|
<foreach collection="param.ids" open="(" separator="," item="id" close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
|
||||||
|
<sql id="KeywordSql" databaseId="mysql">
|
||||||
|
<if test="param.keyword != null and param.keyword != ''">
|
||||||
|
AND (employee_name LIKE CONCAT('%',#{param.keyword},'%') OR job_num LIKE CONCAT('%',#{param.keyword},'%'))
|
||||||
|
</if>
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<sql id="KeywordSql" databaseId="oracle">
|
||||||
|
<if test="param.keyword != null and param.keyword != ''">
|
||||||
|
AND (employee_name LIKE '%'||#{param.keyword}||'%' OR job_num LIKE '%'||#{param.keyword}||'%')
|
||||||
|
</if>
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<sql id="KeywordSql" databaseId="postgresql">
|
||||||
|
<if test="param.keyword != null and param.keyword != ''">
|
||||||
|
AND (employee_name LIKE '%'||#{param.keyword}||'%' OR job_num LIKE '%'||#{param.keyword}||'%')
|
||||||
|
</if>
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<sql id="KeywordSql" databaseId="sqlserver">
|
||||||
|
<if test="param.keyword != null and param.keyword != ''">
|
||||||
|
AND (employee_name LIKE '%'+#{param.keyword}+'%' OR job_num LIKE '%'+#{param.keyword}+'%')
|
||||||
|
</if>
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<sql id="ParamSql">
|
||||||
|
AND tax_agent_id = #{param.taxAgentId}
|
||||||
|
AND tax_cycle = #{param.taxCycle}
|
||||||
|
<if test="param.ids != null and param.ids.size()>0">
|
||||||
|
AND id IN
|
||||||
|
<foreach collection="param.ids" open="(" separator="," item="id" close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
<if test="param.declareStatus != null">
|
||||||
|
AND declare_status = #{param.declareStatus.value}
|
||||||
|
</if>
|
||||||
|
<if test="param.employmentStatus != null">
|
||||||
|
AND employment_status = #{param.employmentStatus.value}
|
||||||
|
</if>
|
||||||
|
<if test="param.employmentType != null">
|
||||||
|
AND employment_type = #{param.employmentType.value}
|
||||||
|
</if>
|
||||||
|
<if test="param.fromEmploymentDate != null">
|
||||||
|
AND employment_date >= #{param.fromEmploymentDate}
|
||||||
|
</if>
|
||||||
|
<if test="param.endEmploymentDate != null">
|
||||||
|
AND #{param.endEmploymentDate} >= employment_date
|
||||||
|
</if>
|
||||||
|
<if test="param.fromDismissDate != null">
|
||||||
|
AND dismiss_date >= #{param.fromDismissDate}
|
||||||
|
</if>
|
||||||
|
<if test="param.endDismissDate != null">
|
||||||
|
AND #{param.endDismissDate} >= dismiss_date
|
||||||
|
</if>
|
||||||
|
<if test="param.disability != null">
|
||||||
|
AND disability = #{param.disability.value}
|
||||||
|
</if>
|
||||||
|
<if test="param.lonelyOld != null">
|
||||||
|
AND lonely_old = #{param.lonelyOld.value}
|
||||||
|
</if>
|
||||||
|
<if test="param.martyrDependents != null">
|
||||||
|
AND martyr_dependents = #{param.martyrDependents.value}
|
||||||
|
</if>
|
||||||
|
<if test="param.deductExpenses != null">
|
||||||
|
AND deduct_expenses = #{param.deductExpenses.value}
|
||||||
|
</if>
|
||||||
|
<!-- <if test="param.departmentIds != null and param.departmentIds.size()>0">-->
|
||||||
|
<!-- AND employee_type = 0 and employee_id IN (select id from {$publicdb}.employee emp where emp.department in (-->
|
||||||
|
<!-- <foreach collection="param.departmentIds" item="departmentId" separator=",">-->
|
||||||
|
<!-- #{departmentId}-->
|
||||||
|
<!-- </foreach>-->
|
||||||
|
<!-- ))-->
|
||||||
|
<!-- </if>-->
|
||||||
|
<!-- <if test="param.positionIds != null and param.positionIds.size()>0">-->
|
||||||
|
<!-- AND employee_type = 0 and employee_id IN (select id from {$publicdb}.employee emp where emp.position in (-->
|
||||||
|
<!-- <foreach collection="param.positionIds" item="positionId" separator=",">-->
|
||||||
|
<!-- #{positionId}-->
|
||||||
|
<!-- </foreach>-->
|
||||||
|
<!-- ))-->
|
||||||
|
<!-- </if>-->
|
||||||
|
<include refid="KeywordSql"/>
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="listByParam" resultMap="BaseResultMap">
|
||||||
|
SELECT
|
||||||
|
<include refid="baseColumns"/>
|
||||||
|
FROM hrsa_employee_declare t
|
||||||
|
WHERE delete_type = 0
|
||||||
|
<include refid="ParamSql"/>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="list4AddByParam" resultMap="BaseResultMap">
|
||||||
|
SELECT
|
||||||
|
<include refid="baseColumns"/>
|
||||||
|
FROM hrsa_employee_declare t
|
||||||
|
WHERE delete_type = 0
|
||||||
|
<include refid="ParamSql"/>
|
||||||
|
AND employee_id NOT IN (
|
||||||
|
SELECT employee_id
|
||||||
|
FROM hrsa_employee_declare
|
||||||
|
WHERE delete_type = 0
|
||||||
|
AND tax_agent_id = #{param.taxAgentId}
|
||||||
|
AND tax_cycle = #{param.preTaxCycle}
|
||||||
|
)
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="list4UpdateByParam" resultMap="BaseResultMap">
|
||||||
|
SELECT
|
||||||
|
<include refid="baseColumns"/>
|
||||||
|
FROM hrsa_employee_declare t
|
||||||
|
WHERE delete_type = 0
|
||||||
|
AND new_employee_info = 1
|
||||||
|
<include refid="ParamSql"/>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
|
|
@ -0,0 +1,182 @@
|
||||||
|
package com.engine.salary.service;
|
||||||
|
|
||||||
|
import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareFailListDTO;
|
||||||
|
import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareInfoDTO;
|
||||||
|
import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareListDTO;
|
||||||
|
import com.engine.salary.entity.employeedeclare.param.*;
|
||||||
|
import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO;
|
||||||
|
import com.engine.salary.util.page.PageInfo;
|
||||||
|
|
||||||
|
import java.time.YearMonth;
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 人员报送(人员)
|
||||||
|
* @author: xiajun
|
||||||
|
* @modified By: xiajun
|
||||||
|
* @date: Created in 9/2/22 3:16 PM
|
||||||
|
* @version:v1.0
|
||||||
|
*/
|
||||||
|
public interface EmployeeDeclareService{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询人员报送信息
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
EmployeeDeclarePO getById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询人员报送信息
|
||||||
|
*
|
||||||
|
* @param ids
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<EmployeeDeclarePO> listByIds(Collection<Long> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询人员报送信息
|
||||||
|
*
|
||||||
|
* @param taxCycle
|
||||||
|
* @param taxAgentId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<EmployeeDeclarePO> listByTaxCycleAndTaxAgentId(YearMonth taxCycle, Long taxAgentId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询人员报送信息
|
||||||
|
*
|
||||||
|
* @param taxCycle
|
||||||
|
* @param taxAgentId
|
||||||
|
* @param employeeIds
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<EmployeeDeclarePO> listByTaxCycleAndTaxAgentIdAndEmployeeIds(YearMonth taxCycle, Long taxAgentId,
|
||||||
|
Collection<Long> employeeIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询人员报送信息
|
||||||
|
*
|
||||||
|
* @param queryParam
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<EmployeeDeclarePO> listByParam(EmployeeDeclareListQueryParam queryParam);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询人员报送-本月新增
|
||||||
|
* *
|
||||||
|
*
|
||||||
|
* @param queryParam
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<EmployeeDeclarePO> list4AddByParam(EmployeeDeclareAddListQueryParam queryParam);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 本月变动
|
||||||
|
*
|
||||||
|
* @param queryParam
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<EmployeeDeclarePO> list4UpdateByParam(EmployeeDeclareListQueryParam queryParam);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 本月信息变动
|
||||||
|
*
|
||||||
|
* @param queryParam
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
PageInfo<EmployeeDeclarePO> listPage4UpdateByParam(EmployeeDeclareListQueryParam queryParam);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 本月报送失败
|
||||||
|
*
|
||||||
|
* @param param
|
||||||
|
* @param tenantKey
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
// List<EmployeeDeclarePO> list4FailByParam(EmployeeDeclareFailListQueryParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 本月报送失败
|
||||||
|
*
|
||||||
|
* @param param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
PageInfo<EmployeeDeclarePO> listPage4FailByParam(EmployeeDeclareFailListQueryParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存
|
||||||
|
*
|
||||||
|
* @param saveParam
|
||||||
|
* @param employeeId
|
||||||
|
* @param tenantKey
|
||||||
|
*/
|
||||||
|
// void save(EmployeeDeclareSaveParam saveParam, Long employeeId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量编辑
|
||||||
|
*
|
||||||
|
* @param batchUpdateParam
|
||||||
|
* @param employeeId
|
||||||
|
* @param tenantKey
|
||||||
|
*/
|
||||||
|
// void batchUpdate(EmployeeDeclareBatchUpdateParam batchUpdateParam, Long employeeId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*
|
||||||
|
* @param ids
|
||||||
|
*/
|
||||||
|
void deleteByIds(Collection<Long> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人员报送(人员)列表
|
||||||
|
*
|
||||||
|
* @param employeeDeclares
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<EmployeeDeclareListDTO> convert(List<EmployeeDeclarePO> employeeDeclares);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人员报送-失败列表
|
||||||
|
*
|
||||||
|
* @param employeeDeclares
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<EmployeeDeclareFailListDTO> convert2FailListDTO(List<EmployeeDeclarePO> employeeDeclares);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 刷新数据
|
||||||
|
*
|
||||||
|
* @param refreshParam
|
||||||
|
* @param employeeId
|
||||||
|
*/
|
||||||
|
void refresh(EmployeeDeclareRefreshParam refreshParam, Long employeeId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取人员报送的整体情况
|
||||||
|
*
|
||||||
|
* @param employeeDeclareParam
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
EmployeeDeclareInfoDTO getDeclareInfo(EmployeeDeclareParam employeeDeclareParam);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报送人员
|
||||||
|
*
|
||||||
|
* @param param
|
||||||
|
* @param tenantKey
|
||||||
|
*/
|
||||||
|
// void declare(EmployeeDeclareParam param, Long employeeId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取报送人员的反馈
|
||||||
|
*
|
||||||
|
* @param param
|
||||||
|
* @param tenantKey
|
||||||
|
*/
|
||||||
|
// void getDeclareFeedback(EmployeeDeclareParam param, EmployeeDeclareRateDTO employeeDeclareRate, Long employeeId);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,675 @@
|
||||||
|
package com.engine.salary.service.impl;
|
||||||
|
|
||||||
|
|
||||||
|
import com.engine.common.util.ServiceUtil;
|
||||||
|
import com.engine.core.impl.Service;
|
||||||
|
import com.engine.salary.common.LocalDateRange;
|
||||||
|
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
||||||
|
import com.engine.salary.entity.employeedeclare.bo.EmployeeDeclareList;
|
||||||
|
import com.engine.salary.entity.employeedeclare.bo.EmployeeDeclareRefresh;
|
||||||
|
import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareFailListDTO;
|
||||||
|
import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareInfoDTO;
|
||||||
|
import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareListDTO;
|
||||||
|
import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareRefreshDTO;
|
||||||
|
import com.engine.salary.entity.employeedeclare.param.*;
|
||||||
|
import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO;
|
||||||
|
import com.engine.salary.entity.salaryarchive.dto.SalaryArchiveDataDTO;
|
||||||
|
import com.engine.salary.entity.salaryarchive.po.SalaryArchivePO;
|
||||||
|
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
||||||
|
import com.engine.salary.enums.SalaryCycleTypeEnum;
|
||||||
|
import com.engine.salary.enums.employeedeclare.DeclareStatusEnum;
|
||||||
|
import com.engine.salary.enums.employeedeclare.EmploymentStatusEnum;
|
||||||
|
import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum;
|
||||||
|
import com.engine.salary.exception.SalaryRunTimeException;
|
||||||
|
import com.engine.salary.mapper.employeedeclare.EmployeeDeclareMapper;
|
||||||
|
import com.engine.salary.service.EmployeeDeclareService;
|
||||||
|
import com.engine.salary.service.SalaryArchiveService;
|
||||||
|
import com.engine.salary.service.SalaryEmployeeService;
|
||||||
|
import com.engine.salary.service.TaxAgentService;
|
||||||
|
import com.engine.salary.util.SalaryDateUtil;
|
||||||
|
import com.engine.salary.util.SalaryEntityUtil;
|
||||||
|
import com.engine.salary.util.SalaryI18nUtil;
|
||||||
|
import com.engine.salary.util.db.MapperProxyFactory;
|
||||||
|
import com.engine.salary.util.page.PageInfo;
|
||||||
|
import com.engine.salary.util.page.SalaryPageUtil;
|
||||||
|
import com.engine.salary.util.valid.ValidUtil;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import weaver.hrm.User;
|
||||||
|
|
||||||
|
import java.time.YearMonth;
|
||||||
|
import java.time.temporal.ChronoUnit;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 人员报送(人员)
|
||||||
|
* @author: xiajun
|
||||||
|
* @modified By: xiajun
|
||||||
|
* @date: Created in 9/2/22 3:17 PM
|
||||||
|
* @version:v1.0
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
public class EmployeeDeclareServiceImpl extends Service implements EmployeeDeclareService {
|
||||||
|
|
||||||
|
private EmployeeDeclareMapper getEmployeeDeclareMapper() {
|
||||||
|
return MapperProxyFactory.getProxy(EmployeeDeclareMapper.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
private TaxAgentService getTaxAgentService(User user) {
|
||||||
|
return ServiceUtil.getService(TaxAgentServiceImpl.class, user);
|
||||||
|
}
|
||||||
|
|
||||||
|
private SalaryEmployeeService getSalaryEmployeeService(User user) {
|
||||||
|
return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user);
|
||||||
|
}
|
||||||
|
|
||||||
|
private SalaryArchiveService getSalaryArchiveService(User user) {
|
||||||
|
return ServiceUtil.getService(SalaryArchiveServiceImpl.class, user);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EmployeeDeclarePO getById(Long id) {
|
||||||
|
return getEmployeeDeclareMapper().getById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<EmployeeDeclarePO> listByIds(Collection<Long> ids) {
|
||||||
|
if (CollectionUtils.isEmpty(ids)){
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
return getEmployeeDeclareMapper().listSome(EmployeeDeclarePO.builder().ids(ids).build());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<EmployeeDeclarePO> listByTaxCycleAndTaxAgentId(YearMonth taxCycle, Long taxAgentId) {
|
||||||
|
return getEmployeeDeclareMapper().listSome(EmployeeDeclarePO.builder()
|
||||||
|
.taxCycle(taxCycle.toString())
|
||||||
|
.taxAgentId(taxAgentId)
|
||||||
|
.build());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<EmployeeDeclarePO> listByTaxCycleAndTaxAgentIdAndEmployeeIds(YearMonth taxCycle, Long taxAgentId, Collection<Long> employeeIds) {
|
||||||
|
if (CollectionUtils.isEmpty(employeeIds)) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
return getEmployeeDeclareMapper().listSome(EmployeeDeclarePO.builder()
|
||||||
|
.taxCycle(taxCycle.toString())
|
||||||
|
.taxAgentId(taxAgentId)
|
||||||
|
.employeeIds(employeeIds)
|
||||||
|
.build());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<EmployeeDeclarePO> listByParam(EmployeeDeclareListQueryParam queryParam) {
|
||||||
|
return getEmployeeDeclareMapper().listByParam(queryParam);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<EmployeeDeclarePO> list4AddByParam(EmployeeDeclareAddListQueryParam queryParam) {
|
||||||
|
queryParam.setPreTaxCycle(queryParam.getTaxCycle().plus(-1, ChronoUnit.MONTHS).toString());
|
||||||
|
return getEmployeeDeclareMapper().list4AddByParam(queryParam);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<EmployeeDeclarePO> list4UpdateByParam(EmployeeDeclareListQueryParam queryParam) {
|
||||||
|
return getEmployeeDeclareMapper().list4UpdateByParam(queryParam);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageInfo<EmployeeDeclarePO> listPage4UpdateByParam(EmployeeDeclareListQueryParam queryParam) {
|
||||||
|
List<EmployeeDeclarePO> list = getEmployeeDeclareMapper().list4UpdateByParam(queryParam);
|
||||||
|
return SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), list, EmployeeDeclarePO.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Override
|
||||||
|
// public List<EmployeeDeclarePO> list4FailByParam(EmployeeDeclareFailListQueryParam queryParam) {
|
||||||
|
// return new LambdaQueryChainWrapper<>(employeeDeclareMapper)
|
||||||
|
// .eq(EmployeeDeclarePO::getTenantKey, tenantKey)
|
||||||
|
// .eq(EmployeeDeclarePO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue())
|
||||||
|
// .eq(EmployeeDeclarePO::getTaxAgentId, queryParam.getTaxAgentId())
|
||||||
|
// .eq(EmployeeDeclarePO::getTaxCycle, queryParam.getTaxCycle().toString())
|
||||||
|
// .eq(EmployeeDeclarePO::getDeclareStatus, DeclareStatusEnum.DECLARE_FAIL.getValue())
|
||||||
|
// .list();
|
||||||
|
// }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageInfo<EmployeeDeclarePO> listPage4FailByParam(EmployeeDeclareFailListQueryParam queryParam) {
|
||||||
|
ValidUtil.doValidator(queryParam);
|
||||||
|
List<EmployeeDeclarePO> list = getEmployeeDeclareMapper().listSome(EmployeeDeclarePO.builder()
|
||||||
|
.taxAgentId(queryParam.getTaxAgentId())
|
||||||
|
.taxCycle(queryParam.getTaxCycle().toString())
|
||||||
|
.declareStatus(DeclareStatusEnum.DECLARE_FAIL.getValue())
|
||||||
|
.build());
|
||||||
|
PageInfo<EmployeeDeclarePO> page = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(),
|
||||||
|
list, EmployeeDeclarePO.class);
|
||||||
|
return page;
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Override
|
||||||
|
// public void save(EmployeeDeclareSaveParam saveParam, Long employeeId) {
|
||||||
|
// LocalDateTime now = LocalDateTime.now();
|
||||||
|
// EmployeeDeclarePO employeeDeclare = new EmployeeDeclarePO()
|
||||||
|
// .setTaxAgentId(saveParam.getTaxAgentId())
|
||||||
|
// .setTaxCycle(saveParam.getTaxCycle().toString())
|
||||||
|
// .setEmployeeName(saveParam.getEmployeeName())
|
||||||
|
// .setJobNum(saveParam.getJobNum())
|
||||||
|
// .setCardType(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getValue())
|
||||||
|
// .setCardNum(saveParam.getCardNum())
|
||||||
|
// .setGender(SalaryCardUtil.judgeGender(saveParam.getCardNum()).getValue())
|
||||||
|
// .setBirthday(SalaryCardUtil.judgeBirthday(saveParam.getCardNum()))
|
||||||
|
// .setEmploymentStatus(saveParam.getEmploymentStatus().getValue())
|
||||||
|
// .setMobile(saveParam.getMobile())
|
||||||
|
// .setEmploymentType(saveParam.getEmploymentType().getValue())
|
||||||
|
// .setEmploymentFirstYear("")
|
||||||
|
// .setEmploymentDate(saveParam.getEmploymentDate())
|
||||||
|
// .setDismissDate(saveParam.getDismissDate())
|
||||||
|
// .setDisability(saveParam.getDisability().getValue())
|
||||||
|
// .setDisabilityCardNo(saveParam.getDisabilityCardNo())
|
||||||
|
// .setLonelyOld(saveParam.getLonelyOld().getValue())
|
||||||
|
// .setMartyrDependents(saveParam.getMartyrDependents().getValue())
|
||||||
|
// .setMartyrDependentsCardNo(saveParam.getMartyrDependentsCardNo())
|
||||||
|
// .setDeductExpenses(saveParam.getDeductExpenses().getValue())
|
||||||
|
// .setSuccessfullyDeclared(0)
|
||||||
|
// .setNewEmployeeInfo(0)
|
||||||
|
// .setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue())
|
||||||
|
// .setDeclareErrorMsg("");
|
||||||
|
// if (Objects.isNull(saveParam.getId())) {
|
||||||
|
// employeeDeclare.setId(IdGenerator.generate())
|
||||||
|
// .setEmployeeId(saveParam.getEmployeeId())
|
||||||
|
// .setEmployeeType(saveParam.getEmployeeType().getValue())
|
||||||
|
// .setTenantKey(tenantKey)
|
||||||
|
// .setCreator(employeeId)
|
||||||
|
// .setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue())
|
||||||
|
// .setCreateTime(now)
|
||||||
|
// .setUpdateTime(now);
|
||||||
|
// save(employeeDeclare);
|
||||||
|
// // 记录日志
|
||||||
|
// LoggerContext<EmployeeDeclarePO> loggerContext = new LoggerContext<>();
|
||||||
|
// loggerContext.setTargetId(Util.null2String(saveParam.getTaxAgentId()));
|
||||||
|
// loggerContext.setTargetName(employeeDeclare.getEmployeeName());
|
||||||
|
// loggerContext.setOperateType(OperateTypeEnum.ADD.getValue());
|
||||||
|
// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(156441, "新增报送人员"));
|
||||||
|
// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(156441, "新增报送人员:") + employeeDeclare.getEmployeeName());
|
||||||
|
// loggerContext.setNewValues(employeeDeclare);
|
||||||
|
// employeeDeclareLoggerTemplate.write(loggerContext);
|
||||||
|
// } else {
|
||||||
|
// EmployeeDeclarePO originEmployeeDeclare = getById(saveParam.getId(), tenantKey);
|
||||||
|
// if (Objects.isNull(originEmployeeDeclare)) {
|
||||||
|
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156442, "人员不存在或已被删除"));
|
||||||
|
// }
|
||||||
|
// if (Objects.equals(originEmployeeDeclare.getSuccessfullyDeclared(), 1)
|
||||||
|
// && !Objects.equals(originEmployeeDeclare.getEmployeeName(), employeeDeclare.getEmployeeName())
|
||||||
|
// && !Objects.equals(originEmployeeDeclare.getCardNum(), employeeDeclare.getCardNum())) {
|
||||||
|
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156443, "成功报送过的人员,姓名和证件号码只能修改其一,同时需要修改的请前往办税服务厅"));
|
||||||
|
// }
|
||||||
|
// employeeDeclare.setId(originEmployeeDeclare.getId())
|
||||||
|
// .setEmployeeId(originEmployeeDeclare.getEmployeeId())
|
||||||
|
// .setEmployeeType(originEmployeeDeclare.getEmployeeType())
|
||||||
|
// .setSuccessfullyDeclared(originEmployeeDeclare.getSuccessfullyDeclared())
|
||||||
|
// .setUpdateTime(now);
|
||||||
|
// // 判断本次编辑是否有修改人员信息
|
||||||
|
// if (!StringUtils.equals(employeeDeclare.toCompareString(), originEmployeeDeclare.toCompareString())) {
|
||||||
|
// employeeDeclare.setNewEmployeeInfo(1);
|
||||||
|
// }
|
||||||
|
// updateById(employeeDeclare);
|
||||||
|
// // 记录日志
|
||||||
|
// LoggerContext<EmployeeDeclarePO> loggerContext = new LoggerContext<>();
|
||||||
|
// loggerContext.setTargetId(Util.null2String(saveParam.getTaxAgentId()));
|
||||||
|
// loggerContext.setTargetName(employeeDeclare.getEmployeeName());
|
||||||
|
// loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue());
|
||||||
|
// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(156444, "编辑报送人员"));
|
||||||
|
// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(156444, "编辑报送人员:") + employeeDeclare.getEmployeeName());
|
||||||
|
// loggerContext.setOldValues(originEmployeeDeclare);
|
||||||
|
// loggerContext.setNewValues(employeeDeclare);
|
||||||
|
// employeeDeclareLoggerTemplate.write(loggerContext);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void batchUpdate(EmployeeDeclareBatchUpdateParam batchUpdateParam, Long employeeId) {
|
||||||
|
// // 查询报送人员
|
||||||
|
// List<EmployeeDeclarePO> employeeDeclares;
|
||||||
|
// if (CollectionUtils.isNotEmpty(batchUpdateParam.getIds())) {
|
||||||
|
// employeeDeclares = listByIds(batchUpdateParam.getIds(), tenantKey);
|
||||||
|
// } else {
|
||||||
|
// employeeDeclares = listByParam(batchUpdateParam, tenantKey);
|
||||||
|
// }
|
||||||
|
// // 人员为空时,不允许批量编辑
|
||||||
|
// if (CollectionUtils.isEmpty(employeeDeclares)) {
|
||||||
|
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(182693, "当前人员列表为空,请选择要批量编辑的人员"));
|
||||||
|
// }
|
||||||
|
// LocalDateTime now = LocalDateTime.now();
|
||||||
|
// // 校验参数
|
||||||
|
// if (Objects.equals(batchUpdateParam.getBatchUpdateItem(), "employmentStatus")) {
|
||||||
|
// EmploymentStatusEnum employmentStatusEnum = null;
|
||||||
|
// for (EmploymentStatusEnum value : EmploymentStatusEnum.values()) {
|
||||||
|
// if (Objects.equals(value.name(), batchUpdateParam.getItemValue())) {
|
||||||
|
// employmentStatusEnum = value;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// if (employmentStatusEnum == null) {
|
||||||
|
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(84026, "参数错误"));
|
||||||
|
// }
|
||||||
|
// for (EmployeeDeclarePO employeeDeclare : employeeDeclares) {
|
||||||
|
// if (!Objects.equals(employeeDeclare.getEmploymentStatus(), employmentStatusEnum.getValue())) {
|
||||||
|
// employeeDeclare.setEmploymentStatus(employmentStatusEnum.getValue());
|
||||||
|
// employeeDeclare.setNewEmployeeInfo(1);
|
||||||
|
// employeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue());
|
||||||
|
// employeeDeclare.setDeclareErrorMsg("");
|
||||||
|
// employeeDeclare.setUpdateTime(now);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// } else if (Objects.equals(batchUpdateParam.getBatchUpdateItem(), "employmentType")) {
|
||||||
|
// EmploymentTypeEnum employmentTypeEnum = null;
|
||||||
|
// for (EmploymentTypeEnum value : EmploymentTypeEnum.values()) {
|
||||||
|
// if (Objects.equals(value.name(), batchUpdateParam.getItemValue())) {
|
||||||
|
// employmentTypeEnum = value;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// if (employmentTypeEnum == null) {
|
||||||
|
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(84026, "参数错误"));
|
||||||
|
// }
|
||||||
|
// for (EmployeeDeclarePO employeeDeclare : employeeDeclares) {
|
||||||
|
// if (!Objects.equals(employeeDeclare.getEmploymentType(), employmentTypeEnum.getValue())) {
|
||||||
|
// employeeDeclare.setEmploymentType(employmentTypeEnum.getValue());
|
||||||
|
// employeeDeclare.setNewEmployeeInfo(1);
|
||||||
|
// employeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue());
|
||||||
|
// employeeDeclare.setDeclareErrorMsg("");
|
||||||
|
// employeeDeclare.setUpdateTime(now);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// } else if (Objects.equals(batchUpdateParam.getBatchUpdateItem(), "employmentDate")) {
|
||||||
|
// if (!SalaryDateUtil.checkDay(batchUpdateParam.getItemValue())) {
|
||||||
|
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(84026, "参数错误"));
|
||||||
|
// }
|
||||||
|
// LocalDate employmentDate = LocalDate.parse(batchUpdateParam.getItemValue());
|
||||||
|
// for (EmployeeDeclarePO employeeDeclare : employeeDeclares) {
|
||||||
|
// if (!Objects.equals(employeeDeclare.getEmploymentDate(), employmentDate)) {
|
||||||
|
// employeeDeclare.setEmploymentDate(employmentDate);
|
||||||
|
// employeeDeclare.setNewEmployeeInfo(1);
|
||||||
|
// employeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue());
|
||||||
|
// employeeDeclare.setDeclareErrorMsg("");
|
||||||
|
// employeeDeclare.setUpdateTime(now);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// } else if (Objects.equals(batchUpdateParam.getBatchUpdateItem(), "dismissDate")) {
|
||||||
|
// if (!SalaryDateUtil.checkDay(batchUpdateParam.getItemValue())) {
|
||||||
|
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(84026, "参数错误"));
|
||||||
|
// }
|
||||||
|
// LocalDate dismissDate = LocalDate.parse(batchUpdateParam.getItemValue());
|
||||||
|
// for (EmployeeDeclarePO employeeDeclare : employeeDeclares) {
|
||||||
|
// if (!Objects.equals(employeeDeclare.getDismissDate(), dismissDate)) {
|
||||||
|
// employeeDeclare.setDismissDate(dismissDate);
|
||||||
|
// employeeDeclare.setNewEmployeeInfo(1);
|
||||||
|
// employeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue());
|
||||||
|
// employeeDeclare.setDeclareErrorMsg("");
|
||||||
|
// employeeDeclare.setUpdateTime(now);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// } else if (Objects.equals(batchUpdateParam.getBatchUpdateItem(), "deductExpenses")) {
|
||||||
|
// SalaryOnOffEnum salaryOnOffEnum = null;
|
||||||
|
// for (SalaryOnOffEnum value : SalaryOnOffEnum.values()) {
|
||||||
|
// if (Objects.equals(value.name(), batchUpdateParam.getItemValue())) {
|
||||||
|
// salaryOnOffEnum = value;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// if (salaryOnOffEnum == null) {
|
||||||
|
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(84026, "参数错误"));
|
||||||
|
// }
|
||||||
|
// for (EmployeeDeclarePO employeeDeclare : employeeDeclares) {
|
||||||
|
// if (!Objects.equals(employeeDeclare.getDeductExpenses(), salaryOnOffEnum.getValue())) {
|
||||||
|
// employeeDeclare.setDeductExpenses(salaryOnOffEnum.getValue());
|
||||||
|
// employeeDeclare.setNewEmployeeInfo(1);
|
||||||
|
// employeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue());
|
||||||
|
// employeeDeclare.setDeclareErrorMsg("");
|
||||||
|
// employeeDeclare.setUpdateTime(now);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// updateBatchById(employeeDeclares);
|
||||||
|
// }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteByIds(Collection<Long> ids) {
|
||||||
|
List<EmployeeDeclarePO> employeeDeclares = listByIds(ids);
|
||||||
|
if (CollectionUtils.isEmpty(employeeDeclares)) {
|
||||||
|
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156466, "参数错误,人员不存在或已被删除"));
|
||||||
|
}
|
||||||
|
boolean declareSuccess = employeeDeclares.stream().anyMatch(e -> Objects.equals(e.getSuccessfullyDeclared(), 1));
|
||||||
|
if (declareSuccess) {
|
||||||
|
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156467, "报送成功过的人员不允许删除"));
|
||||||
|
}
|
||||||
|
getEmployeeDeclareMapper().deleteByIds(ids, new Date());
|
||||||
|
// 记录日志
|
||||||
|
// for (EmployeeDeclarePO employeeDeclare : employeeDeclares) {
|
||||||
|
// LoggerContext<EmployeeDeclarePO> loggerContext = new LoggerContext<>();
|
||||||
|
// loggerContext.setTargetId(Util.null2String(employeeDeclare.getTaxAgentId()));
|
||||||
|
// loggerContext.setTargetName(employeeDeclare.getEmployeeName());
|
||||||
|
// loggerContext.setOperateType(OperateTypeEnum.DELETE.getValue());
|
||||||
|
// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(156445, "删除报送人员"));
|
||||||
|
// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(156445, "删除报送人员:") + employeeDeclare.getEmployeeName());
|
||||||
|
// loggerContext.setNewValues(employeeDeclare);
|
||||||
|
// employeeDeclareLoggerTemplate.write(loggerContext);
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<EmployeeDeclareListDTO> convert(List<EmployeeDeclarePO> employeeDeclares) {
|
||||||
|
if (CollectionUtils.isEmpty(employeeDeclares)) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询个税扣缴义务人
|
||||||
|
Set<Long> taxAgentIds = SalaryEntityUtil.properties(employeeDeclares, EmployeeDeclarePO::getTaxAgentId);
|
||||||
|
List<TaxAgentPO> taxAgents = getTaxAgentService(user).listByIds(taxAgentIds);
|
||||||
|
List<EmployeeDeclareListDTO> dtoList = EmployeeDeclareList.convert(employeeDeclares, taxAgents);
|
||||||
|
// 人员id集合
|
||||||
|
List<Long> employeeIds = employeeDeclares.stream().map(EmployeeDeclarePO::getEmployeeId).distinct().collect(Collectors.toList());
|
||||||
|
// 获取人员部门、分部详细信息
|
||||||
|
Map<String, DataCollectionEmployee> employeeInfoMap = SalaryEntityUtil.convert2Map(getSalaryEmployeeService(user).getEmployeeByIdsAll(employeeIds), emp -> emp.getEmployeeId() + "-" + emp.isExtEmp());
|
||||||
|
// 补充分部,部门
|
||||||
|
dtoList.forEach(po -> {
|
||||||
|
boolean isExtEmp = EmployeeTypeEnum.EXT_EMPLOYEE.getValue().compareTo(po.getEmployeeType().getValue()) == 0;
|
||||||
|
DataCollectionEmployee employee = employeeInfoMap.get(po.getEmployeeId() + "-" + isExtEmp);
|
||||||
|
if(ObjectUtils.isNotEmpty(employee)){
|
||||||
|
po.setSubCompanyName(Optional.ofNullable(employee.getSubcompanyName()).orElse(""));
|
||||||
|
po.setDepartmentName(Optional.ofNullable(employee.getDepartmentName()).orElse(""));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return dtoList;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<EmployeeDeclareFailListDTO> convert2FailListDTO(List<EmployeeDeclarePO> employeeDeclares) {
|
||||||
|
if (CollectionUtils.isEmpty(employeeDeclares)) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
// 查询人员信息
|
||||||
|
List<Long> employeeIds = SalaryEntityUtil.properties(employeeDeclares, EmployeeDeclarePO::getEmployeeId, Collectors.toList());
|
||||||
|
Map<String, DataCollectionEmployee> employeeInfoMap = SalaryEntityUtil.convert2Map(getSalaryEmployeeService(user).getEmployeeByIdsAll(employeeIds), emp -> emp.getEmployeeId() + "-" + emp.isExtEmp());
|
||||||
|
return EmployeeDeclareList.convert2FailListDTO(employeeDeclares, employeeInfoMap);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void refresh(EmployeeDeclareRefreshParam refreshParam, Long employeeId) {
|
||||||
|
// 查询本月已有的需要报送的人员
|
||||||
|
List<EmployeeDeclarePO> employeeDeclares = listByTaxCycleAndTaxAgentId(refreshParam.getTaxCycle(), refreshParam.getTaxAgentId());
|
||||||
|
// 查询上月已有的需要报送的人员(只需要正常的)
|
||||||
|
List<EmployeeDeclarePO> preTaxCycleEmployeeDeclares = listByTaxCycleAndTaxAgentId(refreshParam.getTaxCycle().plus(-1,ChronoUnit.MONTHS), refreshParam.getTaxAgentId())
|
||||||
|
.stream()
|
||||||
|
.filter(e -> Objects.equals(e.getEmploymentStatus(), EmploymentStatusEnum.NORMAL.getValue())
|
||||||
|
&& Objects.equals(e.getDeclareStatus(), DeclareStatusEnum.DECLARE_SUCCESS.getValue()))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
// 查询个税扣缴义务人
|
||||||
|
TaxAgentPO taxAgent = getTaxAgentService(user).getById(refreshParam.getTaxAgentId());
|
||||||
|
// 根据税款所属期计算出薪资周期
|
||||||
|
YearMonth salaryCycle;
|
||||||
|
YearMonth taxCycle = refreshParam.getTaxCycle();
|
||||||
|
// TODO:先临时写死本月!!!!需先完成个税扣缴义务人的改造
|
||||||
|
// SalaryCycleTypeEnum salaryCycleTypeEnum = SalaryEnumUtil.enumMatchByValue(taxAgent.getTaxCycleType(), SalaryCycleTypeEnum.class);
|
||||||
|
SalaryCycleTypeEnum salaryCycleTypeEnum = SalaryCycleTypeEnum.THIS_MONTH;
|
||||||
|
if (salaryCycleTypeEnum == SalaryCycleTypeEnum.BEFORE_LAST_MONTH) {
|
||||||
|
salaryCycle = taxCycle.plus(2, ChronoUnit.MONTHS);
|
||||||
|
} else if (salaryCycleTypeEnum == SalaryCycleTypeEnum.LAST_MONTH) {
|
||||||
|
salaryCycle = taxCycle.plus(1, ChronoUnit.MONTHS);
|
||||||
|
} else if (salaryCycleTypeEnum == SalaryCycleTypeEnum.THIS_MONTH) {
|
||||||
|
salaryCycle = taxCycle;
|
||||||
|
} else if (salaryCycleTypeEnum == SalaryCycleTypeEnum.NEXT_MONTH) {
|
||||||
|
salaryCycle = taxCycle.plus(-1, ChronoUnit.MONTHS);
|
||||||
|
} else {
|
||||||
|
salaryCycle = taxCycle;
|
||||||
|
}
|
||||||
|
// 查询薪资档案的发薪人员
|
||||||
|
LocalDateRange salaryCycleRange = LocalDateRange.builder().fromDate(SalaryDateUtil.localDateToDate(salaryCycle.atDay(1))).endDate(SalaryDateUtil.localDateToDate(salaryCycle.atEndOfMonth())).build();
|
||||||
|
List<SalaryArchiveDataDTO> salaryArchiveDataDTOS = getSalaryArchiveService(user).getSalaryArchiveTaxAgentData(salaryCycleRange, Collections.emptyList(), refreshParam.getTaxAgentId());
|
||||||
|
List<Long> employeeIds = salaryArchiveDataDTOS.stream().map(SalaryArchiveDataDTO::getEmployeeId).collect(Collectors.toList());
|
||||||
|
List<SalaryArchivePO> salaryArchivePOS = getSalaryArchiveService(user).listSome(SalaryArchivePO.builder().taxAgentId(refreshParam.getTaxAgentId()).employeeIds(employeeIds).build());
|
||||||
|
|
||||||
|
// 本月增加了哪些人员
|
||||||
|
Set<Long> orgEmployeeIds = ((List<EmployeeDeclarePO>)CollectionUtils.union(preTaxCycleEmployeeDeclares, employeeDeclares))
|
||||||
|
.stream()
|
||||||
|
.filter(e -> Objects.equals(e.getEmployeeType(), EmployeeTypeEnum.ORGANIZATION.getValue()))
|
||||||
|
.map(EmployeeDeclarePO::getEmployeeId)
|
||||||
|
.collect(Collectors.toSet());
|
||||||
|
Set<Long> newOrgEmployeeIds = salaryArchiveDataDTOS.stream()
|
||||||
|
.map(SalaryArchiveDataDTO::getEmployeeId)
|
||||||
|
.filter(e -> !orgEmployeeIds.contains(e))
|
||||||
|
.collect(Collectors.toSet());
|
||||||
|
// 查询新增加的人员信息
|
||||||
|
List<DataCollectionEmployee> employeeInfos = getSalaryEmployeeService(user).getEmployeeByIdsAll(new ArrayList<>(newOrgEmployeeIds));
|
||||||
|
// List<SimpleUserInfo> newSimpleUserInfos = salaryEmployeeService.listByEmployeeIds(newOrgEmployeeIds, tenantKey);
|
||||||
|
// List<HrmEmployeeComInfo> newHrmEmployeeComInfos = comInfoCache.getCacheList(HrmEmployeeComInfo.class, Lists.newArrayList(newOrgEmployeeIds));
|
||||||
|
// 查询本月增加了哪些非系统人员
|
||||||
|
// List<ExtEmployeePO> extEmployees = extEmployeeService.listBySalaryCycleAndTaxAgentId(salaryCycleRange, refreshParam.getTaxAgentId(), tenantKey);
|
||||||
|
// Set<Long> extEmployeeIds = employeeDeclares.stream()
|
||||||
|
// .filter(e -> Objects.equals(e.getEmployeeType(), EmployeeTypeEnum.EXT_EMPLOYEE.getValue()))
|
||||||
|
// .map(EmployeeDeclarePO::getEmployeeId)
|
||||||
|
// .collect(Collectors.toSet());
|
||||||
|
// List<ExtEmployeePO> newExtEmployees = extEmployees.stream()
|
||||||
|
// .filter(e -> !extEmployeeIds.contains(e.getId()))
|
||||||
|
// .collect(Collectors.toList());
|
||||||
|
|
||||||
|
// 本次新增的需要报送的人员
|
||||||
|
EmployeeDeclareRefreshDTO dto = new EmployeeDeclareRefreshDTO()
|
||||||
|
.setTaxAgentId(taxAgent.getId())
|
||||||
|
.setTaxCycle(taxCycle)
|
||||||
|
.setEmployeeDeclares(employeeDeclares)
|
||||||
|
.setPreTaxCycleEmployeeDeclare(preTaxCycleEmployeeDeclares)
|
||||||
|
.setSalaryArchives(salaryArchivePOS)
|
||||||
|
.setEmployeeInfos(employeeInfos);
|
||||||
|
// .setHrmEmployeeComInfos(newHrmEmployeeComInfos)
|
||||||
|
// .setSimpleUserInfos(newSimpleUserInfos)
|
||||||
|
// .setExtEmployees(newExtEmployees)
|
||||||
|
EmployeeDeclareRefresh.Result result = EmployeeDeclareRefresh.refresh(dto, employeeId);
|
||||||
|
// // 保存新增的人员
|
||||||
|
// if (CollectionUtils.isNotEmpty(result.getNewEmployeeDeclares())) {
|
||||||
|
// saveBatch(result.getNewEmployeeDeclares());
|
||||||
|
// }
|
||||||
|
// // 更新已有人员
|
||||||
|
// if (CollectionUtils.isNotEmpty(result.getEmployeeDeclares())) {
|
||||||
|
// updateBatchById(result.getEmployeeDeclares());
|
||||||
|
// }
|
||||||
|
// // 记录日志
|
||||||
|
// LoggerContext<EmployeeDeclarePO> loggerContext = new LoggerContext<>();
|
||||||
|
// loggerContext.setTargetId(refreshParam.getTaxAgentId() + "-" + refreshParam.getTaxCycle().toString());
|
||||||
|
// loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156468, "个税扣缴义务人:「{0}」税款所属期:「{1}」").replace("{0}", taxAgent.getName()).replace("{1}", refreshParam.getTaxCycle().toString()));
|
||||||
|
// loggerContext.setOperator(Util.null2String(employeeId));
|
||||||
|
// loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue());
|
||||||
|
// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156447, "刷新数据"));
|
||||||
|
// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156447, "刷新数据"));
|
||||||
|
// employeeDeclareLoggerTemplate.write(loggerContext);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EmployeeDeclareInfoDTO getDeclareInfo(EmployeeDeclareParam employeeDeclareParam) {
|
||||||
|
// 查询本月已有的需要报送的人员
|
||||||
|
List<EmployeeDeclarePO> employeeDeclares = listByTaxCycleAndTaxAgentId(employeeDeclareParam.getTaxCycle(), employeeDeclareParam.getTaxAgentId());
|
||||||
|
// 本月是否有修改过人员信息
|
||||||
|
boolean updateEmployeeInfo = employeeDeclares.stream().anyMatch(e -> Objects.equals(e.getNewEmployeeInfo(), 1) && Objects.equals(e.getDeclareStatus(), DeclareStatusEnum.NOT_DECLARE.getValue()));
|
||||||
|
// 本月报送失败的人数
|
||||||
|
Integer declareFailSize = (int) employeeDeclares.stream().filter(e -> Objects.equals(e.getDeclareStatus(), DeclareStatusEnum.DECLARE_FAIL.getValue())).count();
|
||||||
|
// 本月未报送的人数
|
||||||
|
Integer notDeclareSize = (int) employeeDeclares.stream().filter(e -> Objects.equals(e.getDeclareStatus(), DeclareStatusEnum.NOT_DECLARE.getValue())).count();
|
||||||
|
// 本月报送成功的人数
|
||||||
|
Integer declareSuccessSize = (int) employeeDeclares.stream().filter(e -> Objects.equals(e.getDeclareStatus(), DeclareStatusEnum.DECLARE_SUCCESS.getValue())).count();
|
||||||
|
return new EmployeeDeclareInfoDTO()
|
||||||
|
.setShowUpdate(updateEmployeeInfo)
|
||||||
|
.setDeclareFailSize(declareFailSize)
|
||||||
|
.setNotDeclareSize(notDeclareSize)
|
||||||
|
.setDeclareSuccessSize(declareSuccessSize);
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Override
|
||||||
|
// @Transactional(rollbackFor = Exception.class)
|
||||||
|
// public void declare(EmployeeDeclareParam param, Long employeeId) {
|
||||||
|
// // 获取api配置信息
|
||||||
|
// TaxDeclarationApiConfigPO apiConfig = taxDeclarationApiConfigService.getConfig(tenantKey, employeeId, true);
|
||||||
|
// // 查询个税扣缴义务人
|
||||||
|
// TaxAgentPO taxAgent = taxAgentService.getById(param.getTaxAgentId(), employeeId, tenantKey);
|
||||||
|
// // 查询个税扣缴义务人关联的企业信息
|
||||||
|
// TaxAgentTaxReturnPO taxAgentTaxReturn = taxAgentTaxReturnService.getByTaxAgentId(param.getTaxAgentId(), tenantKey);
|
||||||
|
// if (Objects.isNull(taxAgentTaxReturn) || !Objects.equals(taxAgentTaxReturn.getCheckStatus(), TaxAgentTaxReturnStatusEnum.SUCCESS.getValue())) {
|
||||||
|
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156469, "个税扣缴义务人的报税信息验证未通过,请先维护好个税扣缴义务人的报税信息"));
|
||||||
|
// }
|
||||||
|
// // 查询需要报送的人员
|
||||||
|
// List<EmployeeDeclarePO> employeeDeclares = listByTaxCycleAndTaxAgentId(param.getTaxCycle(), param.getTaxAgentId(), tenantKey);
|
||||||
|
// if (CollectionUtils.isEmpty(employeeDeclares)) {
|
||||||
|
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156470, "当前报送人员列表暂无数据"));
|
||||||
|
// }
|
||||||
|
// EmployeeDeclareRecordPO employeeDeclareRecord = employeeDeclareRecordService.getByTaxCycleAndTaxAgentId(param.getTaxCycle(), param.getTaxAgentId(), tenantKey);
|
||||||
|
// if (employeeDeclareRecord != null && StringUtils.isNotEmpty(employeeDeclareRecord.getRequestId())) {
|
||||||
|
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156471, "报送中,稍后请点击【获取报送结果】更新报送状态"));
|
||||||
|
// }
|
||||||
|
// // 人员列表
|
||||||
|
// List<Map<String, Object>> employeeInfoMapList = EmployeeDeclareRequest.convert2RequestParam(employeeDeclares);
|
||||||
|
// // 企业信息
|
||||||
|
// Map<String, Object> requestParam = TaxAgentTaxReturnBO.convert2RequestMap(taxAgent, taxAgentTaxReturn);
|
||||||
|
// // 税款所属期
|
||||||
|
// requestParam.put("skssq", param.getTaxCycle().toString().replace("-", ""));
|
||||||
|
// // 人员列表
|
||||||
|
// requestParam.put("rylb", employeeInfoMapList);
|
||||||
|
//
|
||||||
|
// String reqJson = JsonUtil.toJsonString(requestParam);
|
||||||
|
// String url = apiConfig.getHost() + SzyhApiConstant.DECLARE_EMPLOYEE_INFO;
|
||||||
|
// Map<String, String> params = new HashMap<>(1);
|
||||||
|
// Map<String, String> header = SingnatureData.initHeader(params, apiConfig.getAppKey(), apiConfig.getAppSecret());
|
||||||
|
// String res = HttpUtil.doPost(url, header, reqJson, HttpUtil.JSON_TYPE);
|
||||||
|
// DeclareEmployeeInfoResponse declareEmployeeInfoResponse = JsonUtil.parseObject(res, DeclareEmployeeInfoResponse.class);
|
||||||
|
// if (Objects.isNull(declareEmployeeInfoResponse) || Objects.isNull(declareEmployeeInfoResponse.getHead())) {
|
||||||
|
// log.error("服务异常:" + res);
|
||||||
|
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156449, "服务异常"));
|
||||||
|
// }
|
||||||
|
// if (!Objects.equals(declareEmployeeInfoResponse.getHead().getCode(), SzyhApiConstant.SUCCESS_CODE)) {
|
||||||
|
// throw new SalaryRunTimeException(declareEmployeeInfoResponse.getHead().getMsg());
|
||||||
|
// }
|
||||||
|
// // 删除原来的人员报送记录
|
||||||
|
// employeeDeclareRecordService.deleteByTaxCycleAndTaxAgentId(param.getTaxCycle(), param.getTaxAgentId(), tenantKey);
|
||||||
|
// // 保存新的人员报送记录
|
||||||
|
// LocalDateTime now = LocalDateTime.now();
|
||||||
|
// AsyncRequestIdDTO asyncRequestIdDTO = declareEmployeeInfoResponse.getBody();
|
||||||
|
// employeeDeclareRecord = new EmployeeDeclareRecordPO()
|
||||||
|
// .setId(IdGenerator.generate())
|
||||||
|
// .setTaxAgentId(param.getTaxAgentId())
|
||||||
|
// .setTaxCycle(param.getTaxCycle().toString())
|
||||||
|
// .setRequestId(asyncRequestIdDTO.getRequestId())
|
||||||
|
// .setTenantKey(tenantKey)
|
||||||
|
// .setCreator(employeeId)
|
||||||
|
// .setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue())
|
||||||
|
// .setCreateTime(now)
|
||||||
|
// .setUpdateTime(now);
|
||||||
|
// employeeDeclareRecordService.save(employeeDeclareRecord);
|
||||||
|
// // 记录日志
|
||||||
|
// LoggerContext<EmployeeDeclarePO> loggerContext = new LoggerContext<>();
|
||||||
|
// loggerContext.setTargetId(param.getTaxAgentId() + "-" + param.getTaxCycle().toString());
|
||||||
|
// loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156468, "个税扣缴义务人:「{0}」税款所属期:「{1}」").replace("{0}", taxAgent.getName()).replace("{1}", param.getTaxCycle().toString()));
|
||||||
|
// loggerContext.setOperator(Util.null2String(employeeId));
|
||||||
|
// loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue());
|
||||||
|
// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156450, "全部报送"));
|
||||||
|
// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156450, "全部报送"));
|
||||||
|
// employeeDeclareLoggerTemplate.write(loggerContext);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// @Transactional(rollbackFor = Exception.class)
|
||||||
|
// public void getDeclareFeedback(EmployeeDeclareParam param, EmployeeDeclareRateDTO employeeDeclareRate, Long employeeId) {
|
||||||
|
// // 获取api配置信息
|
||||||
|
// TaxDeclarationApiConfigPO apiConfig = taxDeclarationApiConfigService.getConfig(tenantKey, employeeId, true);
|
||||||
|
// // 查询个税扣缴义务人
|
||||||
|
// TaxAgentPO taxAgent = taxAgentService.getById(param.getTaxAgentId(), employeeId, tenantKey);
|
||||||
|
// // 查询人员报送记录
|
||||||
|
// EmployeeDeclareRecordPO employeeDeclareRecord = employeeDeclareRecordService.getByTaxCycleAndTaxAgentId(param.getTaxCycle(), param.getTaxAgentId(), tenantKey);
|
||||||
|
// if (Objects.isNull(employeeDeclareRecord)) {
|
||||||
|
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey,employeeId,156451, "请先报送后再获取报送结果"));
|
||||||
|
// }
|
||||||
|
// if (StringUtils.isEmpty(employeeDeclareRecord.getRequestId())) {
|
||||||
|
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey,employeeId,156451, "请先报送后再获取报送结果"));
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// String url = apiConfig.getHost() + SzyhApiConstant.DECLARE_EMPLOYEE_INFO_FEEDBACK;
|
||||||
|
// Map<String, String> requestParam = ImmutableMap.of("requestId", employeeDeclareRecord.getRequestId());
|
||||||
|
// Map<String, String> header = SingnatureData.initHeader(Collections.emptyMap(), apiConfig.getAppKey(), apiConfig.getAppSecret());
|
||||||
|
// String res = HttpUtil.getRequest(url, header, requestParam);
|
||||||
|
// DeclareEmployeeFeedbackResponse declareEmployeeFeedbackResponse = JsonUtil.parseObject(res, DeclareEmployeeFeedbackResponse.class);
|
||||||
|
// if (Objects.isNull(declareEmployeeFeedbackResponse) || Objects.isNull(declareEmployeeFeedbackResponse.getHead())) {
|
||||||
|
// log.error("服务异常:" + res);
|
||||||
|
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey,employeeId,156449, "服务异常"));
|
||||||
|
// }
|
||||||
|
// if (!Objects.equals(declareEmployeeFeedbackResponse.getHead().getCode(), SzyhApiConstant.SUCCESS_CODE)) {
|
||||||
|
// throw new SalaryRunTimeException(declareEmployeeFeedbackResponse.getHead().getMsg());
|
||||||
|
// }
|
||||||
|
// DeclareEmployeeFeedbackResponse.DeclareEmployeeFeedbackResponseBody declareEmployeeFeedbackResponseBody = declareEmployeeFeedbackResponse.getBody();
|
||||||
|
// Map<String, Map<String, Object>> employeeFeedbackMap = SalaryEntityUtil.convert2Map(declareEmployeeFeedbackResponseBody.getBsjg(), e -> e.getOrDefault("xm", "")
|
||||||
|
// + "-" + e.getOrDefault("zzlx", "")
|
||||||
|
// + "-" + e.getOrDefault("zzhm", ""));
|
||||||
|
// // 流量使用情况
|
||||||
|
// TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper apiFlowUpdateWrapper =
|
||||||
|
// new TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper(tenantKey
|
||||||
|
// , employeeId, param.getTaxCycle().atDay(1)
|
||||||
|
// , apiConfig, EnumDeclareApiBusinessType.EMPLOYEE_DECLARATION);
|
||||||
|
// // 查询申报的人员列表
|
||||||
|
// LocalDateTime now = LocalDateTime.now();
|
||||||
|
// List<EmployeeDeclarePO> needUpdateEmployeeDeclares = Lists.newArrayList();
|
||||||
|
// List<EmployeeDeclarePO> employeeDeclares = listByTaxCycleAndTaxAgentId(param.getTaxCycle(), param.getTaxAgentId(), tenantKey);
|
||||||
|
// for (EmployeeDeclarePO employeeDeclare : employeeDeclares) {
|
||||||
|
// CardTypeEnum cardTypeEnum = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getCardType(), CardTypeEnum.class);
|
||||||
|
// String key = employeeDeclare.getEmployeeName()
|
||||||
|
// + "-" + (cardTypeEnum == null ? CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel() : cardTypeEnum.getDefaultLabel())
|
||||||
|
// + "-" + employeeDeclare.getCardNum();
|
||||||
|
// Map<String, Object> employeeInfoMap = employeeFeedbackMap.get(key);
|
||||||
|
// if (MapUtil.isEmpty(employeeInfoMap)) {
|
||||||
|
// continue;
|
||||||
|
// }
|
||||||
|
// // 报送状态
|
||||||
|
// employeeDeclare.setDeclareStatus(SalaryEntityUtil.getIntValue(employeeInfoMap.get("sbzt"), DeclareStatusEnum.NOT_DECLARE.getValue()));
|
||||||
|
// // 失败原因
|
||||||
|
// employeeDeclare.setDeclareErrorMsg(SalaryEntityUtil.null2String(employeeInfoMap.get("sbyy")));
|
||||||
|
// // 验证状态、银行卡验证状态
|
||||||
|
// // 是否报送成功了
|
||||||
|
// if (Objects.equals(employeeDeclare.getDeclareStatus(), DeclareStatusEnum.DECLARE_SUCCESS.getValue())) {
|
||||||
|
// employeeDeclare.setSuccessfullyDeclared(1);
|
||||||
|
// }
|
||||||
|
// employeeDeclare.setUpdateTime(now);
|
||||||
|
// needUpdateEmployeeDeclares.add(employeeDeclare);
|
||||||
|
//
|
||||||
|
// // 流量使用记录
|
||||||
|
// TaxDeclarationApiFlowRecordPO flowDetailPO = TaxApiFlowBO.buildTaxDeclarationApiFlowRecordPO(apiFlowUpdateWrapper, param.getTaxAgentId(), employeeDeclare.getEmployeeId());
|
||||||
|
// flowDetailPO.setResultStatus(DeclareStatusEnum.DECLARE_SUCCESS.getValue().equals(employeeDeclare.getDeclareStatus()) ? TaxAgentTaxReturnStatusEnum.SUCCESS.getValue() : TaxAgentTaxReturnStatusEnum.FAIL.getValue());
|
||||||
|
// apiFlowUpdateWrapper.getApiFlowDetailPOList().add(flowDetailPO);
|
||||||
|
// }
|
||||||
|
// // 更新员工的报送状态
|
||||||
|
// if (CollectionUtils.isNotEmpty(needUpdateEmployeeDeclares)) {
|
||||||
|
// updateBatchById(needUpdateEmployeeDeclares);
|
||||||
|
// }
|
||||||
|
// // 删除原来的人员报送记录
|
||||||
|
// employeeDeclareRecordService.deleteByTaxCycleAndTaxAgentId(param.getTaxCycle(), param.getTaxAgentId(), tenantKey);
|
||||||
|
// // 记录日志
|
||||||
|
// LoggerContext<EmployeeDeclarePO> loggerContext = new LoggerContext<>();
|
||||||
|
// loggerContext.setTargetId(param.getTaxAgentId() + "-" + param.getTaxCycle().toString());
|
||||||
|
// loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(tenantKey,employeeId,156468, "个税扣缴义务人:「{0}」税款所属期:「{1}」").replace("{0}", taxAgent.getName()).replace("{1}", param.getTaxCycle().toString()));
|
||||||
|
// loggerContext.setOperator(Util.null2String(employeeId));
|
||||||
|
// loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue());
|
||||||
|
// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(tenantKey,employeeId,156452, "获取结果反馈"));
|
||||||
|
// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(tenantKey,employeeId,156452, "获取结果反馈"));
|
||||||
|
// employeeDeclareLoggerTemplate.write(loggerContext);
|
||||||
|
// // 更新流量统计
|
||||||
|
// taxDeclarationApiBillingService.updateApiFlowInfo(apiFlowUpdateWrapper);
|
||||||
|
// // 报送失败的
|
||||||
|
// int declareFailSize = (int) needUpdateEmployeeDeclares.stream()
|
||||||
|
// .filter(e -> Objects.equals(e.getDeclareStatus(), DeclareStatusEnum.DECLARE_FAIL.getValue()))
|
||||||
|
// .count();
|
||||||
|
// employeeDeclareRate.setFinish(true);
|
||||||
|
// if (declareFailSize > 0) {
|
||||||
|
// employeeDeclareRate.setMsg(SalaryI18nUtil.getI18nLabel(tenantKey,employeeId,156472, "报送成功{0}条,报送失败{1}条")
|
||||||
|
// .replace("{0}", Util.null2String(needUpdateEmployeeDeclares.size() - declareFailSize))
|
||||||
|
// .replace("{1}", Util.null2String(declareFailSize)));
|
||||||
|
// } else {
|
||||||
|
// employeeDeclareRate.setMsg(SalaryI18nUtil.getI18nLabel(tenantKey,employeeId,187388, "报送成功{0}条").replace("{0}", Util.null2String(needUpdateEmployeeDeclares.size())));
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
@ -72,13 +72,13 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee
|
||||||
public List<DataCollectionEmployee> listAll(UseEmployeeTypeEnum empType) {
|
public List<DataCollectionEmployee> listAll(UseEmployeeTypeEnum empType) {
|
||||||
List<DataCollectionEmployee> result = new ArrayList<>();
|
List<DataCollectionEmployee> result = new ArrayList<>();
|
||||||
if (empType == UseEmployeeTypeEnum.ORG) {
|
if (empType == UseEmployeeTypeEnum.ORG) {
|
||||||
result = employBiz.listEmployee();
|
result = employBiz.listAll();
|
||||||
}
|
}
|
||||||
if (empType == UseEmployeeTypeEnum.EXT) {
|
if (empType == UseEmployeeTypeEnum.EXT) {
|
||||||
result = getExtEmpService(user).listEmployee();
|
result = getExtEmpService(user).listEmployee();
|
||||||
}
|
}
|
||||||
if (empType == UseEmployeeTypeEnum.ALL) {
|
if (empType == UseEmployeeTypeEnum.ALL) {
|
||||||
result.addAll(employBiz.listEmployee());
|
result.addAll(employBiz.listAll());
|
||||||
result.addAll(getExtEmpService(user).listEmployee());
|
result.addAll(getExtEmpService(user).listEmployee());
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
|
|
||||||
|
|
@ -2,34 +2,23 @@ package com.engine.salary.service.impl;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
|
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
|
||||||
|
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
||||||
import com.engine.salary.entity.taxapiflow.bo.TaxApiFlowBO;
|
import com.engine.salary.entity.taxapiflow.bo.TaxApiFlowBO;
|
||||||
import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowRecordListDTO;
|
import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowRecordListDTO;
|
||||||
import com.engine.salary.entity.taxapiflow.param.TaxDeclarationApiFlowRecordQueryParam;
|
import com.engine.salary.entity.taxapiflow.param.TaxDeclarationApiFlowRecordQueryParam;
|
||||||
import com.engine.salary.entity.taxapiflow.po.TaxDeclarationApiFlowRecordPO;
|
import com.engine.salary.entity.taxapiflow.po.TaxDeclarationApiFlowRecordPO;
|
||||||
import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO;
|
import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO;
|
||||||
|
import com.engine.salary.enums.sicategory.DeleteTypeEnum;
|
||||||
import com.engine.salary.enums.taxdeclaration.EnumDeclareApiBusinessType;
|
import com.engine.salary.enums.taxdeclaration.EnumDeclareApiBusinessType;
|
||||||
import com.engine.salary.mapper.taxdeclaration.TaxDeclarationApiFlowRecordMapper;
|
import com.engine.salary.mapper.taxdeclaration.TaxDeclarationApiFlowRecordMapper;
|
||||||
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.TaxDeclarationApiBillingService;
|
import com.engine.salary.service.TaxDeclarationApiBillingService;
|
||||||
import com.engine.salary.service.TaxDeclarationApiFlowWarnService;
|
import com.engine.salary.service.TaxDeclarationApiFlowWarnService;
|
||||||
|
import com.engine.salary.util.SalaryEntityUtil;
|
||||||
import com.engine.salary.util.SalaryI18nUtil;
|
import com.engine.salary.util.SalaryI18nUtil;
|
||||||
import com.engine.salary.util.page.PageInfo;
|
import com.engine.salary.util.page.PageInfo;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import com.weaver.common.batch.context.BatchExportContext;
|
|
||||||
import com.weaver.common.batch.entity.BatchCallbackMessage;
|
|
||||||
import com.weaver.common.batch.handler.BatchExportHandler;
|
|
||||||
import com.weaver.common.cache.tablecache.impl.ComInfoCache;
|
|
||||||
import com.weaver.common.component.table.page.Page;
|
|
||||||
import com.weaver.common.hrm.cache.HrmEmployeeComInfo;
|
|
||||||
import com.weaver.hrm.salary.common.SalaryPage;
|
|
||||||
import com.weaver.hrm.salary.common.excel.ExportWrapper;
|
|
||||||
import com.weaver.hrm.salary.entity.extemployee.po.ExtEmployeePO;
|
|
||||||
import com.weaver.hrm.salary.entity.taxagent.po.TaxAgentPO;
|
|
||||||
import com.weaver.hrm.salary.entity.taxapiflow.dto.*;
|
|
||||||
import com.weaver.hrm.salary.enums.sicategory.DeleteTypeEnum;
|
|
||||||
import com.weaver.hrm.salary.service.*;
|
|
||||||
import com.weaver.hrm.salary.util.*;
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,25 @@ public class SalaryEnumUtil {
|
||||||
return (T) Arrays.stream(list).filter(item -> Objects.equals(item.getValue(), value)).findFirst().get();
|
return (T) Arrays.stream(list).filter(item -> Objects.equals(item.getValue(), value)).findFirst().get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据枚举的value获取枚举对象
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
* @param clazz
|
||||||
|
* @param <T>
|
||||||
|
* @param <R>
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static <T extends BaseEnum<R>, R> T enumMatchByValue(R value, Class<T> clazz) {
|
||||||
|
T[] enumConstants = clazz.getEnumConstants();
|
||||||
|
for (T enumConstant : enumConstants) {
|
||||||
|
if (Objects.equals(enumConstant.getValue(), value)) {
|
||||||
|
return enumConstant;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 枚举数组转字符串
|
* 枚举数组转字符串
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,109 @@
|
||||||
|
package com.engine.salary.util.valid;
|
||||||
|
|
||||||
|
import com.engine.salary.enums.employeedeclare.GenderEnum;
|
||||||
|
import com.engine.salary.exception.SalaryRunTimeException;
|
||||||
|
import com.engine.salary.util.SalaryI18nUtil;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 身份证
|
||||||
|
* @author: xiajun
|
||||||
|
* @modified By: xiajun
|
||||||
|
* @date: Created in 2022/10/28 10:10 AM
|
||||||
|
* @version:v1.0
|
||||||
|
*/
|
||||||
|
public class SalaryCardUtil {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 15位的身份证长度
|
||||||
|
*/
|
||||||
|
public static final String CARD_15 = "^[1-9]\\d{5}\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{2}$";
|
||||||
|
/**
|
||||||
|
* 18位的身份证长度
|
||||||
|
*/
|
||||||
|
public static final String CARD_18 = "^[1-9]\\d{5}(18|19|([23]\\d))\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}[0-9Xx]$";
|
||||||
|
/**
|
||||||
|
* 手机号码
|
||||||
|
*/
|
||||||
|
public static final String MOBILE = "^1(3[0-9]|4[01456879]|5[0-35-9]|6[2567]|7[0-8]|8[0-9]|9[0-35-9])\\d{8}$";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验身份证号码
|
||||||
|
*
|
||||||
|
* @param idNumber
|
||||||
|
*/
|
||||||
|
public static boolean checkIdNum(String idNumber) {
|
||||||
|
Pattern pattern_15 = Pattern.compile(CARD_15);
|
||||||
|
Pattern pattern_18 = Pattern.compile(CARD_18);
|
||||||
|
if (!pattern_15.matcher(idNumber).find() && !pattern_18.matcher(idNumber).find()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验手机号码
|
||||||
|
*
|
||||||
|
* @param mobile
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static boolean checkMobile(String mobile) {
|
||||||
|
Pattern pattern_mobile = Pattern.compile(MOBILE);
|
||||||
|
if (!pattern_mobile.matcher(mobile).find()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据身份证号判断性别
|
||||||
|
*
|
||||||
|
* @param idNumber
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static GenderEnum judgeGender(String idNumber) throws IllegalArgumentException {
|
||||||
|
if (!checkIdNum(idNumber)) {
|
||||||
|
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156510, "身份证号格式错误"));
|
||||||
|
}
|
||||||
|
char sexIndex;
|
||||||
|
if (idNumber.length() == 18) {
|
||||||
|
//如果身份证号18位,取身份证号倒数第二位
|
||||||
|
sexIndex = idNumber.charAt(idNumber.length() - 2);
|
||||||
|
} else {
|
||||||
|
//如果身份证号15位,取身份证号最后一位
|
||||||
|
sexIndex = idNumber.charAt(idNumber.length() - 1);
|
||||||
|
}
|
||||||
|
int gender = Integer.parseInt(String.valueOf(sexIndex));
|
||||||
|
if (gender % 2 == 1) {
|
||||||
|
return GenderEnum.MALE;
|
||||||
|
} else {
|
||||||
|
return GenderEnum.FEMALE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据身份证的号码算出当前身份证持有者的生日
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static LocalDate judgeBirthday(String idNumber) throws IllegalArgumentException {
|
||||||
|
if (!checkIdNum(idNumber)) {
|
||||||
|
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156510, "身份证号格式错误"));
|
||||||
|
}
|
||||||
|
String year;
|
||||||
|
String month;
|
||||||
|
String day;
|
||||||
|
if (idNumber.length() == 18) {
|
||||||
|
year = idNumber.substring(6).substring(0, 4);// 得到年份
|
||||||
|
month = idNumber.substring(10).substring(0, 2);// 得到月份
|
||||||
|
day = idNumber.substring(12).substring(0, 2);//得到日
|
||||||
|
} else {
|
||||||
|
year = "19" + idNumber.substring(6, 8);// 年份
|
||||||
|
month = idNumber.substring(8, 10);// 月份
|
||||||
|
day = idNumber.substring(10, 12);//日
|
||||||
|
}
|
||||||
|
return LocalDate.parse(year + "-" + month + "-" + day);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,334 @@
|
||||||
|
package com.engine.salary.web;
|
||||||
|
|
||||||
|
|
||||||
|
import com.engine.common.util.ServiceUtil;
|
||||||
|
import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareFailListDTO;
|
||||||
|
import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareInfoDTO;
|
||||||
|
import com.engine.salary.entity.employeedeclare.dto.TaxAgentDeclareListDTO;
|
||||||
|
import com.engine.salary.entity.employeedeclare.param.*;
|
||||||
|
import com.engine.salary.util.ResponseResult;
|
||||||
|
import com.engine.salary.util.page.PageInfo;
|
||||||
|
import com.engine.salary.wrapper.EmployeeDeclareWrapper;
|
||||||
|
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||||
|
import oracle.jdbc.proxy.annotation.Post;
|
||||||
|
import weaver.hrm.HrmUserVarify;
|
||||||
|
import weaver.hrm.User;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import javax.ws.rs.*;
|
||||||
|
import javax.ws.rs.core.Context;
|
||||||
|
import javax.ws.rs.core.MediaType;
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 人员报送
|
||||||
|
* @author: xiajun
|
||||||
|
* @modified By: xiajun
|
||||||
|
* @date: Created in 9/6/22 3:37 PM
|
||||||
|
* @version:v1.0
|
||||||
|
*/
|
||||||
|
public class EmployeeDeclareController {
|
||||||
|
|
||||||
|
private EmployeeDeclareWrapper getEmployeeDeclareWrapper(User user) {
|
||||||
|
return ServiceUtil.getService(EmployeeDeclareWrapper.class, user);
|
||||||
|
}
|
||||||
|
|
||||||
|
// private SalaryBatchService salaryBatchService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人员报送-个税扣缴义务人列表
|
||||||
|
*
|
||||||
|
* @param param 查询条件
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@POST
|
||||||
|
@Path("/taxAgentDeclareList")
|
||||||
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
|
public String taxAgentDeclareList(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxAgentDeclareListQueryParam param) {
|
||||||
|
User user = HrmUserVarify.getUser(request, response);
|
||||||
|
return new ResponseResult<TaxAgentDeclareListQueryParam, PageInfo<TaxAgentDeclareListDTO>>(user).run(getEmployeeDeclareWrapper(user)::taxAgentDeclareList, param);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人员报送-全部人员列表
|
||||||
|
*
|
||||||
|
* @param queryParam 查询条件
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@POST
|
||||||
|
@Path("/list")
|
||||||
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
|
public String list(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareListQueryParam queryParam) {
|
||||||
|
User user = HrmUserVarify.getUser(request, response);
|
||||||
|
return new ResponseResult<EmployeeDeclareListQueryParam, Map<String, Object>>(user).run(getEmployeeDeclareWrapper(user)::list, queryParam);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人员报送-本月新增人员列表
|
||||||
|
*
|
||||||
|
* @param queryParam 查询条件
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Post
|
||||||
|
@Path("/list4Add")
|
||||||
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
|
public String list4Add(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareAddListQueryParam queryParam) {
|
||||||
|
User user = HrmUserVarify.getUser(request, response);
|
||||||
|
return new ResponseResult<EmployeeDeclareAddListQueryParam, Map<String, Object>>(user).run(getEmployeeDeclareWrapper(user)::list4Add, queryParam);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人员报送-本月信息变动列表
|
||||||
|
*
|
||||||
|
* @param queryParam 查询条件
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Post
|
||||||
|
@Path("/list4Update")
|
||||||
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
|
public String list4Update(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareListQueryParam queryParam) {
|
||||||
|
User user = HrmUserVarify.getUser(request, response);
|
||||||
|
return new ResponseResult<EmployeeDeclareListQueryParam, Map<String, Object>>(user).run(getEmployeeDeclareWrapper(user)::list4Update, queryParam);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人员报送-本月报送失败人员列表
|
||||||
|
*
|
||||||
|
* @param queryParam 查询条件
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@POST
|
||||||
|
@Path("/list4Fail")
|
||||||
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
|
public String list4Fail(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareFailListQueryParam queryParam) {
|
||||||
|
User user = HrmUserVarify.getUser(request, response);
|
||||||
|
return new ResponseResult<EmployeeDeclareFailListQueryParam, PageInfo<EmployeeDeclareFailListDTO>>(user).run(getEmployeeDeclareWrapper(user)::list4Fail, queryParam);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人员报送-获取新建或编辑的表单
|
||||||
|
*
|
||||||
|
* @param id 报送人员列表的主键id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GET
|
||||||
|
@Path("/getForm")
|
||||||
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
|
public String getForm(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "id") Long id) {
|
||||||
|
User user = HrmUserVarify.getUser(request, response);
|
||||||
|
return new ResponseResult<Long, Map<String, Object>>(user).run(getEmployeeDeclareWrapper(user)::getForm, id);
|
||||||
|
}
|
||||||
|
|
||||||
|
// @GetMapping("/getBatchUpdateForm")
|
||||||
|
// @ApiOperation("人员报送-获取批量编辑的表单")
|
||||||
|
// @WeaPermission
|
||||||
|
// public WeaResult<WeaForm> getBatchUpdateForm() {
|
||||||
|
// WeaForm weaForm = employeeDeclareWrapper.getBatchUpdateForm();
|
||||||
|
// return WeaResult.success(weaForm);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @GetMapping("/getSearchCondition")
|
||||||
|
// @ApiOperation("人员报送-获取高级搜索条件")
|
||||||
|
// @WeaPermission
|
||||||
|
// public WeaResult<WeaSearchCondition> getSearchCondition() {
|
||||||
|
// WeaSearchCondition searchCondition = employeeDeclareWrapper.getSearchCondition();
|
||||||
|
// return WeaResult.success(searchCondition);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 人员报送-新增人员/编辑人员保存
|
||||||
|
// *
|
||||||
|
// * @param saveParam 保存参数
|
||||||
|
// * @return
|
||||||
|
// */
|
||||||
|
// @PostMapping("/save")
|
||||||
|
// @ApiOperation("人员报送-新增人员/编辑人员保存")
|
||||||
|
// @WeaPermission
|
||||||
|
// public WeaResult<Object> save(@RequestBody @Validated EmployeeDeclareSaveParam saveParam) {
|
||||||
|
// employeeDeclareWrapper.save(saveParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey());
|
||||||
|
// return WeaResult.success(null);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 人员报送-批量编辑
|
||||||
|
// *
|
||||||
|
// * @param batchUpdateParam 批量编辑参数
|
||||||
|
// * @return
|
||||||
|
// */
|
||||||
|
// @PostMapping("/batchUpdate")
|
||||||
|
// @ApiOperation("人员报送-批量编辑")
|
||||||
|
// @WeaPermission
|
||||||
|
// public WeaResult<Object> batchUpdate(@RequestBody @Validated EmployeeDeclareBatchUpdateParam batchUpdateParam) {
|
||||||
|
// employeeDeclareWrapper.batchUpdate(batchUpdateParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey());
|
||||||
|
// return WeaResult.success(null);
|
||||||
|
// }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人员报送-删除
|
||||||
|
*
|
||||||
|
* @param ids 待删除的主键id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@POST
|
||||||
|
@Path("/delete")
|
||||||
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
|
public String deleteByIds(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody Collection<Long> ids) {
|
||||||
|
User user = HrmUserVarify.getUser(request, response);
|
||||||
|
return new ResponseResult<Collection<Long>, String>(user).run(getEmployeeDeclareWrapper(user)::deleteByIds, ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人员报送-刷新数据
|
||||||
|
*
|
||||||
|
* @param refreshParam 刷新数据的参数
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Post
|
||||||
|
@Path("/refresh")
|
||||||
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
|
public String refresh(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareRefreshParam refreshParam) {
|
||||||
|
User user = HrmUserVarify.getUser(request, response);
|
||||||
|
return new ResponseResult<EmployeeDeclareRefreshParam, String>(user).run(getEmployeeDeclareWrapper(user)::refresh, refreshParam);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人员报送-获取整体的报送情况
|
||||||
|
*
|
||||||
|
* @param employeeDeclareParam 获取整体的报送情况的参数
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@POST
|
||||||
|
@Path("/getDeclareInfo")
|
||||||
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
|
public String getDeclareInfo(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareParam employeeDeclareParam) {
|
||||||
|
User user = HrmUserVarify.getUser(request, response);
|
||||||
|
return new ResponseResult<EmployeeDeclareParam, EmployeeDeclareInfoDTO>(user).run(getEmployeeDeclareWrapper(user)::getDeclareInfo, employeeDeclareParam);
|
||||||
|
}
|
||||||
|
|
||||||
|
// /**
|
||||||
|
// * 人员报送-全部报送
|
||||||
|
// *
|
||||||
|
// * @param employeeDeclareParam 在线报送
|
||||||
|
// * @return
|
||||||
|
// */
|
||||||
|
// @PostMapping("/declare")
|
||||||
|
// @ApiOperation("人员报送-全部报送")
|
||||||
|
// @WeaPermission
|
||||||
|
// public WeaResult<Object> declare(@RequestBody @Validated EmployeeDeclareParam employeeDeclareParam) {
|
||||||
|
// String rateIndex = employeeDeclareWrapper.declare(employeeDeclareParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey());
|
||||||
|
// return WeaResult.success(rateIndex);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 人员报送-获取报送结果反馈
|
||||||
|
// *
|
||||||
|
// * @param employeeDeclareParam 获取反馈
|
||||||
|
// * @return
|
||||||
|
// */
|
||||||
|
// @PostMapping("/getDeclareFeedback")
|
||||||
|
// @ApiOperation("人员报送-获取报送结果反馈")
|
||||||
|
// @WeaPermission
|
||||||
|
// public WeaResult<Object> getDeclareFeedback(@RequestBody @Validated EmployeeDeclareParam employeeDeclareParam) {
|
||||||
|
// String rateIndex = employeeDeclareWrapper.getDeclareFeedback(employeeDeclareParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey());
|
||||||
|
// return WeaResult.success(rateIndex);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 人员报送-后端业务逻辑是否已经完成
|
||||||
|
// *
|
||||||
|
// * @param index 进度索引
|
||||||
|
// * @return
|
||||||
|
// */
|
||||||
|
// @GetMapping("/getRate")
|
||||||
|
// @ApiOperation("人员报送-后端业务逻辑是否已经完成")
|
||||||
|
// @WeaPermission
|
||||||
|
// public WeaResult<EmployeeDeclareRateDTO> getRate(@RequestParam(value = "index") String index) {
|
||||||
|
// EmployeeDeclareRateDTO rate = employeeDeclareWrapper.getRate(index, TenantContext.getCurrentTenantKey());
|
||||||
|
// return WeaResult.success(rate);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 人员报送-导出全部人员
|
||||||
|
// *
|
||||||
|
// * @param queryParam 导出参数
|
||||||
|
// * @return
|
||||||
|
// */
|
||||||
|
// @PostMapping("/export")
|
||||||
|
// @ApiOperation("人员报送-导出全部人员")
|
||||||
|
// @WeaPermission
|
||||||
|
// public WeaResult<Object> export(@RequestBody @Validated EmployeeDeclareListQueryParam queryParam) {
|
||||||
|
// Map<String, Object> exportMap = employeeDeclareWrapper.export(queryParam, UserContext.getCurrentUser());
|
||||||
|
// return WeaResult.success(exportMap);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 人员报送-导出本月新增人员
|
||||||
|
// *
|
||||||
|
// * @param queryParam 导出参数
|
||||||
|
// * @return
|
||||||
|
// */
|
||||||
|
// @PostMapping("/export4Add")
|
||||||
|
// @ApiOperation("人员报送-导出本月新增人员")
|
||||||
|
// @WeaPermission
|
||||||
|
// public WeaResult<Object> export4Add(@RequestBody @Validated EmployeeDeclareAddListQueryParam queryParam) {
|
||||||
|
// Map<String, Object> exportMap = employeeDeclareWrapper.export4Add(queryParam, UserContext.getCurrentUser());
|
||||||
|
// return WeaResult.success(exportMap);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 人员报送-导出本月信息变动人员
|
||||||
|
// *
|
||||||
|
// * @param queryParam 导出参数
|
||||||
|
// * @return
|
||||||
|
// */
|
||||||
|
// @PostMapping("/export4Update")
|
||||||
|
// @ApiOperation("人员报送-导出本月信息变动人员")
|
||||||
|
// @WeaPermission
|
||||||
|
// public WeaResult<Object> export4Update(@RequestBody @Validated EmployeeDeclareListQueryParam queryParam) {
|
||||||
|
// Map<String, Object> exportMap = employeeDeclareWrapper.export4Update(queryParam, UserContext.getCurrentUser());
|
||||||
|
// return WeaResult.success(exportMap);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 人员报送-导出本月报送失败的人员
|
||||||
|
// *
|
||||||
|
// * @param queryParam 导出参数
|
||||||
|
// * @return
|
||||||
|
// */
|
||||||
|
// @PostMapping("/export4Fail")
|
||||||
|
// @ApiOperation("人员报送-导出本月报送失败的人员")
|
||||||
|
// @WeaPermission
|
||||||
|
// public WeaResult<Object> export4Fail(@RequestBody @Validated EmployeeDeclareFailListQueryParam queryParam) {
|
||||||
|
// Map<String, Object> exportMap = employeeDeclareWrapper.export4Fail(queryParam, UserContext.getCurrentUser());
|
||||||
|
// return WeaResult.success(exportMap);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @GetMapping("/getImportParam")
|
||||||
|
// @ApiOperation("人员报送-获取导入参数")
|
||||||
|
// @WeaPermission
|
||||||
|
// public WeaResult<ExcelImportParam> getAcctResultImportParams() {
|
||||||
|
// String tenantKey = TenantContext.getCurrentTenantKey();
|
||||||
|
// Long currentEmployeeId = UserContext.getCurrentEmployeeId();
|
||||||
|
// return WeaResult.success(salaryBatchService.buildImportParam("importEmployeeDeclare",
|
||||||
|
// "importEmployeeDeclare",
|
||||||
|
// SalaryI18nUtil.getI18nLabel(tenantKey, currentEmployeeId, 158769, "人员信息报送"),
|
||||||
|
// null,
|
||||||
|
// null));
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 人员报送-导出导入模板
|
||||||
|
// *
|
||||||
|
// * @param importParam 获取导入模板
|
||||||
|
// * @return
|
||||||
|
// */
|
||||||
|
// @PostMapping("/exportTemplate")
|
||||||
|
// @ApiOperation("人员报送-导出导入模板")
|
||||||
|
// @WeaPermission
|
||||||
|
// public WeaResult<Object> exportTemplate(@RequestBody @Validated EmployeeDeclareImportParam importParam) {
|
||||||
|
// Map<String, Object> exportMap = employeeDeclareWrapper.exportTemplate(importParam, UserContext.getCurrentUser());
|
||||||
|
// return WeaResult.success(exportMap);
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,648 @@
|
||||||
|
package com.engine.salary.wrapper;
|
||||||
|
|
||||||
|
import com.cloudstore.dev.api.util.Util_DataCache;
|
||||||
|
import com.cloudstore.eccom.result.WeaResultMsg;
|
||||||
|
import com.engine.common.util.ServiceUtil;
|
||||||
|
import com.engine.core.impl.Service;
|
||||||
|
import com.engine.salary.cache.SalaryCacheKey;
|
||||||
|
import com.engine.salary.component.SalaryWeaTable;
|
||||||
|
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
||||||
|
import com.engine.salary.entity.employeedeclare.bo.EmployeeDeclareList;
|
||||||
|
import com.engine.salary.entity.employeedeclare.dto.*;
|
||||||
|
import com.engine.salary.entity.employeedeclare.param.*;
|
||||||
|
import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO;
|
||||||
|
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
||||||
|
import com.engine.salary.enums.SalaryOnOffEnum;
|
||||||
|
import com.engine.salary.enums.employeedeclare.*;
|
||||||
|
import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum;
|
||||||
|
import com.engine.salary.service.EmployeeDeclareService;
|
||||||
|
import com.engine.salary.service.SalaryEmployeeService;
|
||||||
|
import com.engine.salary.service.TaxAgentService;
|
||||||
|
import com.engine.salary.service.impl.EmployeeDeclareServiceImpl;
|
||||||
|
import com.engine.salary.service.impl.SalaryEmployeeServiceImpl;
|
||||||
|
import com.engine.salary.service.impl.TaxAgentServiceImpl;
|
||||||
|
import com.engine.salary.util.SalaryDateUtil;
|
||||||
|
import com.engine.salary.util.SalaryEntityUtil;
|
||||||
|
import com.engine.salary.util.SalaryEnumUtil;
|
||||||
|
import com.engine.salary.util.SalaryI18nUtil;
|
||||||
|
import com.engine.salary.util.page.Column;
|
||||||
|
import com.engine.salary.util.page.PageInfo;
|
||||||
|
import com.engine.salary.util.page.SalaryPageUtil;
|
||||||
|
import com.engine.salary.util.valid.ValidUtil;
|
||||||
|
import com.google.common.collect.Lists;
|
||||||
|
import com.weaver.util.threadPool.ThreadPoolUtil;
|
||||||
|
import com.weaver.util.threadPool.constant.ModulePoolEnum;
|
||||||
|
import com.weaver.util.threadPool.entity.LocalRunnable;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import weaver.hrm.User;
|
||||||
|
|
||||||
|
import java.time.temporal.ChronoUnit;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 人员报送(人员)
|
||||||
|
* @author: xiajun
|
||||||
|
* @modified By: xiajun
|
||||||
|
* @date: Created in 9/2/22 3:49 PM
|
||||||
|
* @version:v1.0
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
public class EmployeeDeclareWrapper extends Service {
|
||||||
|
|
||||||
|
private TaxAgentService getTaxAgentService(User user) {
|
||||||
|
return ServiceUtil.getService(TaxAgentServiceImpl.class, user);
|
||||||
|
}
|
||||||
|
|
||||||
|
private EmployeeDeclareService getEmployeeDeclareService(User user) {
|
||||||
|
return ServiceUtil.getService(EmployeeDeclareServiceImpl.class, user);
|
||||||
|
}
|
||||||
|
|
||||||
|
private SalaryEmployeeService getSalaryEmployeeService(User user) {
|
||||||
|
return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人员报送的个税扣缴义务人列表
|
||||||
|
*
|
||||||
|
* @param queryParam
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public PageInfo<TaxAgentDeclareListDTO> taxAgentDeclareList(TaxAgentDeclareListQueryParam queryParam) {
|
||||||
|
// 判断是否是“总管理员”
|
||||||
|
Boolean isChief = getTaxAgentService(user).isChief(Long.valueOf(user.getUID()));
|
||||||
|
// 是否开启分权
|
||||||
|
Boolean openDevolution = getTaxAgentService(user).isOpenDevolution();
|
||||||
|
// 查询个税扣缴义务人
|
||||||
|
List<TaxAgentPO> taxAgents = Lists.newArrayList();
|
||||||
|
if (!openDevolution || isChief) {
|
||||||
|
taxAgents = getTaxAgentService(user).listAll();
|
||||||
|
} else {
|
||||||
|
taxAgents = new ArrayList<>(getTaxAgentService(user).listAllTaxAgentsAsAdmin(Long.valueOf(user.getUID())));
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotEmpty(queryParam.getTaxAgentName())) {
|
||||||
|
taxAgents = taxAgents.stream().filter(e -> StringUtils.contains(e.getName(), queryParam.getTaxAgentName())).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
// 分页
|
||||||
|
List<TaxAgentPO> taxAgentPOS = SalaryPageUtil.subList(queryParam.getCurrent(), queryParam.getPageSize(), taxAgents);
|
||||||
|
List<TaxAgentDeclareListDTO> dtoList = Lists.newArrayList();
|
||||||
|
for (TaxAgentPO taxAgent : taxAgentPOS) {
|
||||||
|
TaxAgentDeclareListDTO dto = new TaxAgentDeclareListDTO().setId(taxAgent.getId()).setTaxAgentName(taxAgent.getName());
|
||||||
|
dtoList.add(dto);
|
||||||
|
}
|
||||||
|
return SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), dtoList, TaxAgentDeclareListDTO.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人员报送-全部人员列表
|
||||||
|
*
|
||||||
|
* @param queryParam
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Map<String, Object> list(EmployeeDeclareListQueryParam queryParam) {
|
||||||
|
ValidUtil.doValidator(queryParam);
|
||||||
|
List<EmployeeDeclarePO> employeeDeclarePOS = getEmployeeDeclareService(user).listByParam(queryParam);
|
||||||
|
employeeDeclarePOS = SalaryPageUtil.subList(queryParam.getCurrent(), queryParam.getPageSize(), employeeDeclarePOS);
|
||||||
|
List<EmployeeDeclareListDTO> convert = getEmployeeDeclareService(user).convert(employeeDeclarePOS);
|
||||||
|
PageInfo<EmployeeDeclareListDTO> pageInfo = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize());
|
||||||
|
pageInfo.setList(convert);
|
||||||
|
pageInfo.setTotal(employeeDeclarePOS.size());
|
||||||
|
|
||||||
|
// // 判断是否开启分部
|
||||||
|
// boolean subcompanySupport = hrmConfigSetCache.isSubcompanySupport(tenantKey);
|
||||||
|
// if (!subcompanySupport) {
|
||||||
|
// weaTable.getColumns().stream()
|
||||||
|
// .filter(e -> Objects.equals(e.getDataIndex(), "subCompanyName"))
|
||||||
|
// .findAny()
|
||||||
|
// .ifPresent(weaTableColumn -> weaTableColumn.setHide(true));
|
||||||
|
// }
|
||||||
|
SalaryWeaTable<EmployeeDeclareListDTO> table = new SalaryWeaTable<>(user, EmployeeDeclareListDTO.class);
|
||||||
|
WeaResultMsg result = new WeaResultMsg(false);
|
||||||
|
result.putAll(table.makeDataResult());
|
||||||
|
result.success();
|
||||||
|
|
||||||
|
Map<String, Object> datas = new HashMap<>();
|
||||||
|
datas.put("pageInfo", pageInfo);
|
||||||
|
datas.put("dataKey", result.getResultMap());
|
||||||
|
return datas;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人员报送-本月新增人员列表
|
||||||
|
*
|
||||||
|
* @param queryParam
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Map<String, Object> list4Add(EmployeeDeclareAddListQueryParam queryParam) {
|
||||||
|
List<EmployeeDeclarePO> addPOList = getEmployeeDeclareService(user).list4AddByParam(queryParam);
|
||||||
|
PageInfo<EmployeeDeclarePO> addPoPageInfo = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), addPOList, EmployeeDeclarePO.class);
|
||||||
|
List<EmployeeDeclareListDTO> addDTOList = getEmployeeDeclareService(user).convert(addPoPageInfo.getList());
|
||||||
|
// 分页
|
||||||
|
PageInfo<EmployeeDeclareListDTO> pageInfo = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize());
|
||||||
|
pageInfo.setList(addDTOList);
|
||||||
|
pageInfo.setTotal(addPOList.size());
|
||||||
|
|
||||||
|
// // 判断是否开启分部
|
||||||
|
// boolean subcompanySupport = hrmConfigSetCache.isSubcompanySupport(tenantKey);
|
||||||
|
// if (!subcompanySupport) {
|
||||||
|
// weaTable.getColumns().stream()
|
||||||
|
// .filter(e -> Objects.equals(e.getDataIndex(), "subCompanyName"))
|
||||||
|
// .findAny()
|
||||||
|
// .ifPresent(weaTableColumn -> weaTableColumn.setHide(true));
|
||||||
|
// }
|
||||||
|
|
||||||
|
SalaryWeaTable<EmployeeDeclareListDTO> table = new SalaryWeaTable<>(user, EmployeeDeclareListDTO.class);
|
||||||
|
WeaResultMsg result = new WeaResultMsg(false);
|
||||||
|
result.putAll(table.makeDataResult());
|
||||||
|
result.success();
|
||||||
|
|
||||||
|
Map<String, Object> datas = new HashMap<>();
|
||||||
|
datas.put("pageInfo", pageInfo);
|
||||||
|
datas.put("dataKey", result.getResultMap());
|
||||||
|
return datas;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人员报送-本月信息变动人员列表
|
||||||
|
*
|
||||||
|
* @param queryParam
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Map<String, Object> list4Update(EmployeeDeclareListQueryParam queryParam) {
|
||||||
|
PageInfo<EmployeeDeclarePO> poPageInfo = getEmployeeDeclareService(user).listPage4UpdateByParam(queryParam);
|
||||||
|
List<EmployeeDeclareListDTO> dtoList = getEmployeeDeclareService(user).convert(poPageInfo.getList());
|
||||||
|
PageInfo<EmployeeDeclareListDTO> dtoPageInfo = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), dtoList, EmployeeDeclareListDTO.class);
|
||||||
|
dtoPageInfo.setTotal(poPageInfo.getTotal());
|
||||||
|
// 查询上个月报送的人员
|
||||||
|
Set<Long> employeeIds = SalaryEntityUtil.properties(poPageInfo.getList(), EmployeeDeclarePO::getEmployeeId);
|
||||||
|
List<EmployeeDeclarePO> preTaxCycleEmployeeDeclares = getEmployeeDeclareService(user).listByTaxCycleAndTaxAgentIdAndEmployeeIds(
|
||||||
|
queryParam.getTaxCycle().plus(-1, ChronoUnit.MONTHS), queryParam.getTaxAgentId(), employeeIds);
|
||||||
|
// 获取修改了哪些字段
|
||||||
|
Map<Long, Set<String>> updatedFieldMap = EmployeeDeclareList.getUpdatedField(poPageInfo.getList(), preTaxCycleEmployeeDeclares);
|
||||||
|
for (EmployeeDeclareListDTO employeeDeclareListDTO : (List<EmployeeDeclareListDTO>)dtoPageInfo.getList()) {
|
||||||
|
Set<String> updatedDataIndexSet = updatedFieldMap.get(employeeDeclareListDTO);
|
||||||
|
employeeDeclareListDTO.setUpdatedDataIndexSet(updatedDataIndexSet);
|
||||||
|
}
|
||||||
|
// // 判断是否开启分部
|
||||||
|
// boolean subcompanySupport = hrmConfigSetCache.isSubcompanySupport(tenantKey);
|
||||||
|
// if (!subcompanySupport) {
|
||||||
|
// weaTable.getColumns().stream()
|
||||||
|
// .filter(e -> Objects.equals(e.getDataIndex(), "subCompanyName"))
|
||||||
|
// .findAny()
|
||||||
|
// .ifPresent(weaTableColumn -> weaTableColumn.setHide(true));
|
||||||
|
// }
|
||||||
|
SalaryWeaTable<EmployeeDeclareListDTO> table = new SalaryWeaTable<>(user, EmployeeDeclareListDTO.class);
|
||||||
|
WeaResultMsg result = new WeaResultMsg(false);
|
||||||
|
result.putAll(table.makeDataResult());
|
||||||
|
result.success();
|
||||||
|
|
||||||
|
Map<String, Object> datas = new HashMap<>();
|
||||||
|
datas.put("pageInfo", dtoPageInfo);
|
||||||
|
datas.put("dataKey", result.getResultMap());
|
||||||
|
return datas;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人员报送-本月报送失败人员列表
|
||||||
|
*
|
||||||
|
* @param queryParam
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public PageInfo<EmployeeDeclareFailListDTO> list4Fail(EmployeeDeclareFailListQueryParam queryParam) {
|
||||||
|
PageInfo<EmployeeDeclarePO> poPageInfo = getEmployeeDeclareService(user).listPage4FailByParam(queryParam);
|
||||||
|
List<EmployeeDeclareFailListDTO> dtoList = getEmployeeDeclareService(user).convert2FailListDTO(poPageInfo.getList());
|
||||||
|
PageInfo<EmployeeDeclareFailListDTO> dtoPageInfo = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(),
|
||||||
|
dtoList, EmployeeDeclareFailListDTO.class);
|
||||||
|
// 判断是否开启分部
|
||||||
|
// boolean subcompanySupport = hrmConfigSetCache.isSubcompanySupport(tenantKey);
|
||||||
|
// if (!subcompanySupport) {
|
||||||
|
// weaTable.getColumns().stream()
|
||||||
|
// .filter(e -> Objects.equals(e.getDataIndex(), "subCompanyName"))
|
||||||
|
// .findAny()
|
||||||
|
// .ifPresent(weaTableColumn -> weaTableColumn.setHide(true));
|
||||||
|
// }
|
||||||
|
return dtoPageInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人员报送-获取新建或编辑的表单
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Map<String, Object> getForm(Long id) {
|
||||||
|
// 证件类型默认"居民身份证"
|
||||||
|
EmployeeDeclarePO employeeDeclare;
|
||||||
|
EmployeeDeclareFromDTO employeeDeclareFrom = new EmployeeDeclareFromDTO()
|
||||||
|
.setCardType(CardTypeEnum.RESIDENT_IDENTITY_CARDS)
|
||||||
|
.setGender(GenderEnum.MALE)
|
||||||
|
.setEmploymentStatus(EmploymentStatusEnum.NORMAL)
|
||||||
|
.setEmploymentType(EmploymentTypeEnum.EMPLOYEE)
|
||||||
|
.setDisability(SalaryOnOffEnum.OFF)
|
||||||
|
.setLonelyOld(SalaryOnOffEnum.OFF)
|
||||||
|
.setMartyrDependents(SalaryOnOffEnum.OFF)
|
||||||
|
.setDeductExpenses(SalaryOnOffEnum.ON);
|
||||||
|
if (Objects.nonNull(id)) {
|
||||||
|
employeeDeclare = getEmployeeDeclareService(user).getById(id);
|
||||||
|
// 查询人员信息
|
||||||
|
List<DataCollectionEmployee> employeeList = getSalaryEmployeeService(user).getEmployeeByIdsAll(Arrays.asList(employeeDeclare.getEmployeeId()));
|
||||||
|
Optional<DataCollectionEmployee> employee;
|
||||||
|
if (Objects.equals(employeeDeclare.getEmployeeType(), EmployeeTypeEnum.ORGANIZATION.getValue())) {
|
||||||
|
employee = employeeList.stream().filter(e -> e.isExtEmp() == false).findFirst();
|
||||||
|
} else {
|
||||||
|
employee = employeeList.stream().filter(e -> e.isExtEmp() == true).findFirst();
|
||||||
|
}
|
||||||
|
employeeDeclareFrom.setId(employeeDeclare.getId())
|
||||||
|
.setTaxAgentId(employeeDeclare.getTaxAgentId())
|
||||||
|
.setEmployee(employee.isPresent() ? employee.get().getUsername() : "")
|
||||||
|
.setEmployeeName(employeeDeclare.getEmployeeName())
|
||||||
|
.setJobNum(employeeDeclare.getJobNum())
|
||||||
|
.setNationality(SalaryI18nUtil.getI18nLabel(94731, "中国"))
|
||||||
|
.setCardType(CardTypeEnum.RESIDENT_IDENTITY_CARDS)
|
||||||
|
.setCardNum(employeeDeclare.getCardNum())
|
||||||
|
.setGender(SalaryEnumUtil.enumMatchByValue(employeeDeclare.getGender(), GenderEnum.class))
|
||||||
|
.setBirthday(SalaryDateUtil.dateToLocalDate(employeeDeclare.getBirthday()))
|
||||||
|
.setEmploymentStatus(SalaryEnumUtil.enumMatchByValue(employeeDeclare.getEmploymentStatus(), EmploymentStatusEnum.class))
|
||||||
|
.setMobile(employeeDeclare.getMobile())
|
||||||
|
.setEmploymentType(SalaryEnumUtil.enumMatchByValue(employeeDeclare.getEmploymentType(), EmploymentTypeEnum.class))
|
||||||
|
.setEmploymentDate(SalaryDateUtil.dateToLocalDate(employeeDeclare.getEmploymentDate()))
|
||||||
|
.setDismissDate(SalaryDateUtil.dateToLocalDate(employeeDeclare.getDismissDate()))
|
||||||
|
.setDisability(SalaryEnumUtil.enumMatchByValue(employeeDeclare.getDisability(), SalaryOnOffEnum.class))
|
||||||
|
.setDisabilityCardNo(employeeDeclare.getDisabilityCardNo())
|
||||||
|
.setLonelyOld(SalaryEnumUtil.enumMatchByValue(employeeDeclare.getLonelyOld(), SalaryOnOffEnum.class))
|
||||||
|
.setMartyrDependents(SalaryEnumUtil.enumMatchByValue(employeeDeclare.getMartyrDependents(), SalaryOnOffEnum.class))
|
||||||
|
.setMartyrDependentsCardNo(employeeDeclare.getMartyrDependentsCardNo())
|
||||||
|
.setDeductExpenses(SalaryEnumUtil.enumMatchByValue(employeeDeclare.getDeductExpenses(), SalaryOnOffEnum.class));
|
||||||
|
} else {
|
||||||
|
employeeDeclare = null;
|
||||||
|
}
|
||||||
|
PageInfo<EmployeeDeclareFromDTO> pageInfo = new PageInfo<>(EmployeeDeclareFromDTO.class);
|
||||||
|
List<Column> columns = pageInfo.getColumns();
|
||||||
|
|
||||||
|
List<String> readOnlyColumns = new ArrayList<>();
|
||||||
|
columns.stream().forEach(column -> {
|
||||||
|
if (Objects.nonNull(column) && StringUtils.equals(column.getKey(), "employee")) {
|
||||||
|
readOnlyColumns.add(column.getKey());
|
||||||
|
}
|
||||||
|
if (employeeDeclare != null
|
||||||
|
&& Objects.equals(employeeDeclare.getDeclareStatus(), DeclareStatusEnum.DECLARE_SUCCESS.getValue())
|
||||||
|
&& (StringUtils.equals(column.getKey(), "employeeName") || StringUtils.equals(column.getKey(), "cardNum"))) {
|
||||||
|
readOnlyColumns.add(column.getKey());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
Map<String, Object> datas = new HashMap<>();
|
||||||
|
datas.put("data", employeeDeclareFrom);
|
||||||
|
datas.put("columns", columns);
|
||||||
|
datas.put("readOnlyColumns", readOnlyColumns);
|
||||||
|
return datas;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// /**
|
||||||
|
// * 人员报送-批量编辑的表单
|
||||||
|
// *
|
||||||
|
// * @return
|
||||||
|
// */
|
||||||
|
// public WeaForm getBatchUpdateForm() {
|
||||||
|
// WeaForm weaForm = new WeaForm();
|
||||||
|
// WeaFormItem batchUpdateItem = new WeaFormItem(WeaFormItemType.SELECT);
|
||||||
|
// List<WeaFormOption> options = new ArrayList<>();
|
||||||
|
// options.add(new WeaFormOption("employmentStatus", SalaryI18nUtil.getI18nLabel(91075, "状态")));
|
||||||
|
// options.add(new WeaFormOption("employmentType", SalaryI18nUtil.getI18nLabel(156396, "任职受雇从业类型")));
|
||||||
|
// options.add(new WeaFormOption("employmentDate", SalaryI18nUtil.getI18nLabel(156409, "任职受雇从业日期")));
|
||||||
|
// options.add(new WeaFormOption("dismissDate", SalaryI18nUtil.getI18nLabel(95228, "离职日期")));
|
||||||
|
// options.add(new WeaFormOption("deductExpenses", SalaryI18nUtil.getI18nLabel(156402, "是否扣除减除费用")));
|
||||||
|
// batchUpdateItem.setOptions(options);
|
||||||
|
//
|
||||||
|
// Map<String, Object> otherParams = new HashMap<>();
|
||||||
|
// WeaFormSalaryItem employmentStatus = new WeaFormSalaryItem(WeaFormItemType.SELECT);
|
||||||
|
// employmentStatus.setRequired(true);
|
||||||
|
// employmentStatus.setOptions(enum2Option(EmploymentStatusEnum.class));
|
||||||
|
// otherParams.put("employmentStatus", employmentStatus);
|
||||||
|
// WeaFormSalaryItem employmentType = new WeaFormSalaryItem(WeaFormItemType.SELECT);
|
||||||
|
// employmentType.setRequired(true);
|
||||||
|
// employmentType.setOptions(enum2Option(EmploymentTypeEnum.class));
|
||||||
|
// otherParams.put("employmentType", employmentType);
|
||||||
|
// WeaFormSalaryItem employmentDate = new WeaFormSalaryItem(WeaFormItemType.DATEPICKER);
|
||||||
|
// employmentDate.setRequired(true);
|
||||||
|
// otherParams.put("employmentDate", employmentDate);
|
||||||
|
// WeaFormSalaryItem dismissDate = new WeaFormSalaryItem(WeaFormItemType.DATEPICKER);
|
||||||
|
// dismissDate.setRequired(true);
|
||||||
|
// otherParams.put("dismissDate", dismissDate);
|
||||||
|
// WeaFormSalaryItem deductExpenses = new WeaFormSalaryItem(WeaFormItemType.RADIO);
|
||||||
|
// deductExpenses.setRequired(true);
|
||||||
|
// deductExpenses.setOptions(enum2Option(SalaryOnOffEnum.class));
|
||||||
|
// otherParams.put("deductExpenses", deductExpenses);
|
||||||
|
// batchUpdateItem.setOtherParams(otherParams);
|
||||||
|
// weaForm.getItems().put("batchUpdateItem", batchUpdateItem);
|
||||||
|
//
|
||||||
|
// List<WeaFormLayout> firstLine = new ArrayList<>();
|
||||||
|
// firstLine.add(new WeaFormLayout("batchUpdateItem", SalaryI18nUtil.getI18nLabel(145214, "批量编辑项目"), new String[]{"batchUpdateItem"}));
|
||||||
|
// List<WeaFormLayout> secondLine = new ArrayList<>();
|
||||||
|
// secondLine.add(new WeaFormLayout("itemValue", SalaryI18nUtil.getI18nLabel(145215, "批量编辑为"), new String[]{"itemValue"}));
|
||||||
|
// weaForm.getLayout().add(firstLine);
|
||||||
|
// weaForm.getLayout().add(secondLine);
|
||||||
|
// return weaForm;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// private <T extends BaseEnum> List<WeaFormOption> enum2Option(Class<T> optionsEnum) {
|
||||||
|
// BaseEnum[] enumConstants = optionsEnum.getEnumConstants();
|
||||||
|
// List<WeaFormOption> weaFormOptions = Lists.newArrayListWithExpectedSize(enumConstants.length);
|
||||||
|
// for (BaseEnum enumConstant : enumConstants) {
|
||||||
|
// weaFormOptions.add(new WeaFormOption(enumConstant.name(),
|
||||||
|
// SalaryI18nUtil.getI18nLabel(enumConstant.getLabelId(), enumConstant.getDefaultLabel())));
|
||||||
|
// }
|
||||||
|
// return weaFormOptions;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 人员报送-获取高级搜索条件
|
||||||
|
// *
|
||||||
|
// * @return
|
||||||
|
// */
|
||||||
|
// public WeaSearchCondition getSearchCondition() {
|
||||||
|
// EmployeeDeclareConditionDTO employeeDeclareCondition = new EmployeeDeclareConditionDTO();
|
||||||
|
// WeaSearchCondition searchCondition = SalaryFormatUtil.<EmployeeDeclareConditionDTO>getInstance()
|
||||||
|
// .buildCondition(EmployeeDeclareConditionDTO.class, employeeDeclareCondition, "employeeDeclareCondition");
|
||||||
|
// // "其他条件"不要
|
||||||
|
// searchCondition.getGroups().remove(1);
|
||||||
|
// searchCondition.getItems().forEach((k, v) -> {
|
||||||
|
// if (Objects.equals(k, "employmentDate") || Objects.equals(k, "dismissDate")) {
|
||||||
|
// Map<String, Object> otherParams = new HashMap<>();
|
||||||
|
// otherParams.put("isRange", "true");
|
||||||
|
// v.setOtherParams(otherParams);
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// return searchCondition;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 人员报送-新增人员/编辑人员保存
|
||||||
|
// *
|
||||||
|
// * @param saveParam
|
||||||
|
// * @param employeeId
|
||||||
|
// * @param tenantKey
|
||||||
|
// */
|
||||||
|
// public void save(EmployeeDeclareSaveParam saveParam, Long employeeId, String tenantKey) {
|
||||||
|
// employeeDeclareService.save(saveParam, employeeId, tenantKey);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 批量编辑
|
||||||
|
// *
|
||||||
|
// * @param batchUpdateParam
|
||||||
|
// * @param employeeId
|
||||||
|
// * @param tenantKey
|
||||||
|
// */
|
||||||
|
// public void batchUpdate(EmployeeDeclareBatchUpdateParam batchUpdateParam, Long employeeId, String tenantKey) {
|
||||||
|
// employeeDeclareService.batchUpdate(batchUpdateParam, employeeId, tenantKey);
|
||||||
|
// }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人员报送-删除
|
||||||
|
*
|
||||||
|
* @param ids
|
||||||
|
*/
|
||||||
|
public void deleteByIds(Collection<Long> ids) {
|
||||||
|
getEmployeeDeclareService(user).deleteByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人员报送-刷新数据
|
||||||
|
*
|
||||||
|
* @param refreshParam
|
||||||
|
*/
|
||||||
|
public String refresh(EmployeeDeclareRefreshParam refreshParam) {
|
||||||
|
EmployeeDeclareRateDTO employeeDeclareRate = new EmployeeDeclareRateDTO()
|
||||||
|
.setIndex(UUID.randomUUID().toString())
|
||||||
|
.setStatus(true)
|
||||||
|
.setFinish(false)
|
||||||
|
.setMsg("");
|
||||||
|
|
||||||
|
Util_DataCache.setObjVal(SalaryCacheKey.EMPLOYEE_DECLARE + "-" + employeeDeclareRate.getIndex(), employeeDeclareRate);
|
||||||
|
LocalRunnable localRunnable = new LocalRunnable() {
|
||||||
|
@Override
|
||||||
|
public void execute() {
|
||||||
|
try {
|
||||||
|
getEmployeeDeclareService(user).refresh(refreshParam, Long.valueOf(user.getUID()));
|
||||||
|
employeeDeclareRate.setFinish(true);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("刷新数据失败:{}", e.getMessage(), e);
|
||||||
|
employeeDeclareRate.setStatus(false).setFinish(true).setMsg(e.getMessage());
|
||||||
|
} finally {
|
||||||
|
Util_DataCache.setObjVal(SalaryCacheKey.EMPLOYEE_DECLARE + "-" + employeeDeclareRate.getIndex(), employeeDeclareRate);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "refresh", localRunnable);
|
||||||
|
return employeeDeclareRate.getIndex();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人员报送-获取人员报送的整体情况
|
||||||
|
*
|
||||||
|
* @param employeeDeclareParam
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public EmployeeDeclareInfoDTO getDeclareInfo(EmployeeDeclareParam employeeDeclareParam) {
|
||||||
|
return getEmployeeDeclareService(user).getDeclareInfo(employeeDeclareParam);
|
||||||
|
}
|
||||||
|
|
||||||
|
// /**
|
||||||
|
// * 人员报送-全部报送
|
||||||
|
// *
|
||||||
|
// * @param param
|
||||||
|
// * @param employeeId
|
||||||
|
// * @param tenantKey
|
||||||
|
// */
|
||||||
|
// public String declare(EmployeeDeclareParam param, Long employeeId, String tenantKey) {
|
||||||
|
// EmployeeDeclareRateDTO employeeDeclareRate = new EmployeeDeclareRateDTO()
|
||||||
|
// .setIndex(UUID.randomUUID().toString())
|
||||||
|
// .setStatus(true)
|
||||||
|
// .setFinish(false)
|
||||||
|
// .setMsg("");
|
||||||
|
// boolean cacheResult = salaryCacheService.set(SalaryCacheKey.EMPLOYEE_DECLARE, employeeDeclareRate.getIndex(), employeeDeclareRate);
|
||||||
|
// if (!cacheResult) {
|
||||||
|
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156513, "全部报送失败"));
|
||||||
|
// }
|
||||||
|
// LocalRunnable localRunnable = new LocalRunnable() {
|
||||||
|
// @Override
|
||||||
|
// public void execute() {
|
||||||
|
// try {
|
||||||
|
// employeeDeclareService.declare(param, employeeId, tenantKey);
|
||||||
|
// employeeDeclareRate.setFinish(true);
|
||||||
|
// } catch (SalaryRunTimeException | SalaryNullException e) {
|
||||||
|
// employeeDeclareRate.setStatus(false).setFinish(true).setMsg(e.getMessage());
|
||||||
|
// } catch (Exception e) {
|
||||||
|
// log.error("全部报送失败:{}", e.getMessage(), e);
|
||||||
|
// employeeDeclareRate.setStatus(false).setFinish(true).setMsg(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 187472, "系统错误,请联系管理员:") + e.getMessage());
|
||||||
|
// } finally {
|
||||||
|
// salaryCacheService.set(SalaryCacheKey.EMPLOYEE_DECLARE, employeeDeclareRate.getIndex(), employeeDeclareRate);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// };
|
||||||
|
// ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "declare", localRunnable);
|
||||||
|
// return employeeDeclareRate.getIndex();
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 人员报送-获取报送结果反馈
|
||||||
|
// *
|
||||||
|
// * @param param
|
||||||
|
// * @param tenantKey
|
||||||
|
// */
|
||||||
|
// public String getDeclareFeedback(EmployeeDeclareParam param, Long employeeId, String tenantKey) {
|
||||||
|
// EmployeeDeclareRateDTO employeeDeclareRate = new EmployeeDeclareRateDTO()
|
||||||
|
// .setIndex(UUID.randomUUID().toString())
|
||||||
|
// .setStatus(true)
|
||||||
|
// .setFinish(false)
|
||||||
|
// .setMsg("");
|
||||||
|
// boolean cacheResult = salaryCacheService.set(SalaryCacheKey.EMPLOYEE_DECLARE, employeeDeclareRate.getIndex(), employeeDeclareRate);
|
||||||
|
// if (!cacheResult) {
|
||||||
|
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156514, "获取报送结果反馈失败"));
|
||||||
|
// }
|
||||||
|
// LocalRunnable localRunnable = new LocalRunnable() {
|
||||||
|
// @Override
|
||||||
|
// public void execute() {
|
||||||
|
// try {
|
||||||
|
// employeeDeclareService.getDeclareFeedback(param, employeeDeclareRate, employeeId, tenantKey);
|
||||||
|
// employeeDeclareRate.setFinish(true);
|
||||||
|
// } catch (SalaryRunTimeException | SalaryNullException e) {
|
||||||
|
// employeeDeclareRate.setStatus(false).setFinish(true).setMsg(e.getMessage());
|
||||||
|
// } catch (Exception e) {
|
||||||
|
// log.error("获取报送结果反馈失败:{}", e.getMessage(), e);
|
||||||
|
// employeeDeclareRate.setStatus(false).setFinish(true).setMsg(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 187472, "系统错误,请联系管理员:") + e.getMessage());
|
||||||
|
// } finally {
|
||||||
|
// salaryCacheService.set(SalaryCacheKey.EMPLOYEE_DECLARE, employeeDeclareRate.getIndex(), employeeDeclareRate);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// };
|
||||||
|
// ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "getDeclareFeedback", localRunnable);
|
||||||
|
// return employeeDeclareRate.getIndex();
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 获取人员报送相关后端接口是否已经完成
|
||||||
|
// *
|
||||||
|
// * @param index
|
||||||
|
// * @param tenantKey
|
||||||
|
// * @return
|
||||||
|
// */
|
||||||
|
// public EmployeeDeclareRateDTO getRate(String index, String tenantKey) {
|
||||||
|
// return salaryCacheService.get(SalaryCacheKey.EMPLOYEE_DECLARE, index, EmployeeDeclareRateDTO.class);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 人员报送-导出本月全部的人员
|
||||||
|
// *
|
||||||
|
// * @param queryParam
|
||||||
|
// * @param simpleEmployee
|
||||||
|
// * @return
|
||||||
|
// */
|
||||||
|
// public Map<String, Object> export(EmployeeDeclareListQueryParam queryParam, SimpleEmployee simpleEmployee) {
|
||||||
|
// ExcelExportParam excelExportParam = new ExcelExportParam()
|
||||||
|
// .setBiz(String.valueOf(IdGenerator.generate()))
|
||||||
|
// .setModule(EntityType.hrmsalary.name())
|
||||||
|
// .setFunction("exportEmployeeDeclare");
|
||||||
|
// LocalRunnable localRunnable = new LocalRunnable() {
|
||||||
|
// @Override
|
||||||
|
// public void execute() {
|
||||||
|
// employeeDeclareExcelService.export(excelExportParam, queryParam, simpleEmployee);
|
||||||
|
// }
|
||||||
|
// };
|
||||||
|
// ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "exportEmployeeDeclare", localRunnable);
|
||||||
|
// return JsonUtil.parseMap(excelExportParam, Object.class);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 人员报送-导出本月新增的人员
|
||||||
|
// *
|
||||||
|
// * @param queryParam
|
||||||
|
// * @param simpleEmployee
|
||||||
|
// * @return
|
||||||
|
// */
|
||||||
|
// public Map<String, Object> export4Add(EmployeeDeclareAddListQueryParam queryParam, SimpleEmployee simpleEmployee) {
|
||||||
|
// ExcelExportParam excelExportParam = new ExcelExportParam()
|
||||||
|
// .setBiz(String.valueOf(IdGenerator.generate()))
|
||||||
|
// .setModule(EntityType.hrmsalary.name())
|
||||||
|
// .setFunction("exportEmployeeDeclare4Add");
|
||||||
|
// LocalRunnable localRunnable = new LocalRunnable() {
|
||||||
|
// @Override
|
||||||
|
// public void execute() {
|
||||||
|
// employeeDeclareExcelService.export4Add(excelExportParam, queryParam, simpleEmployee);
|
||||||
|
// }
|
||||||
|
// };
|
||||||
|
// ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "exportEmployeeDeclare4Add", localRunnable);
|
||||||
|
// return JsonUtil.parseMap(excelExportParam, Object.class);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 人员报送-导出本月信息变动的人员
|
||||||
|
// *
|
||||||
|
// * @param queryParam
|
||||||
|
// * @param simpleEmployee
|
||||||
|
// * @return
|
||||||
|
// */
|
||||||
|
// public Map<String, Object> export4Update(EmployeeDeclareListQueryParam queryParam, SimpleEmployee simpleEmployee) {
|
||||||
|
// ExcelExportParam excelExportParam = new ExcelExportParam()
|
||||||
|
// .setBiz(String.valueOf(IdGenerator.generate()))
|
||||||
|
// .setModule(EntityType.hrmsalary.name())
|
||||||
|
// .setFunction("exportEmployeeDeclare4Update");
|
||||||
|
// LocalRunnable localRunnable = new LocalRunnable() {
|
||||||
|
// @Override
|
||||||
|
// public void execute() {
|
||||||
|
// employeeDeclareExcelService.export4Update(excelExportParam, queryParam, simpleEmployee);
|
||||||
|
// }
|
||||||
|
// };
|
||||||
|
// ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "exportEmployeeDeclare4Update", localRunnable);
|
||||||
|
// return JsonUtil.parseMap(excelExportParam, Object.class);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 人员报送-导出本月报送失败的人员
|
||||||
|
// *
|
||||||
|
// * @param queryParam
|
||||||
|
// * @param simpleEmployee
|
||||||
|
// * @return
|
||||||
|
// */
|
||||||
|
// public Map<String, Object> export4Fail(EmployeeDeclareFailListQueryParam queryParam, SimpleEmployee simpleEmployee) {
|
||||||
|
// ExcelExportParam excelExportParam = new ExcelExportParam()
|
||||||
|
// .setBiz(String.valueOf(IdGenerator.generate()))
|
||||||
|
// .setModule(EntityType.hrmsalary.name())
|
||||||
|
// .setFunction("exportEmployeeDeclare4Fail");
|
||||||
|
// LocalRunnable localRunnable = new LocalRunnable() {
|
||||||
|
// @Override
|
||||||
|
// public void execute() {
|
||||||
|
// employeeDeclareExcelService.export4Fail(excelExportParam, queryParam, simpleEmployee);
|
||||||
|
// }
|
||||||
|
// };
|
||||||
|
// ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "exportEmployeeDeclare4Fail", localRunnable);
|
||||||
|
// return JsonUtil.parseMap(excelExportParam, Object.class);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 人员报送-导出导入模板
|
||||||
|
// *
|
||||||
|
// * @param importParam
|
||||||
|
// * @param simpleEmployee
|
||||||
|
// * @return
|
||||||
|
// */
|
||||||
|
// public Map<String, Object> exportTemplate(EmployeeDeclareImportParam importParam, SimpleEmployee simpleEmployee) {
|
||||||
|
// ExcelExportParam excelExportParam = new ExcelExportParam()
|
||||||
|
// .setBiz(String.valueOf(IdGenerator.generate()))
|
||||||
|
// .setModule(EntityType.hrmsalary.name())
|
||||||
|
// .setFunction("exportEmployeeDeclareTemplate");
|
||||||
|
// LocalRunnable localRunnable = new LocalRunnable() {
|
||||||
|
// @Override
|
||||||
|
// public void execute() {
|
||||||
|
// employeeDeclareExcelService.exportTemplate(excelExportParam, importParam, simpleEmployee);
|
||||||
|
// }
|
||||||
|
// };
|
||||||
|
// ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "exportEmployeeDeclareTemplate", localRunnable);
|
||||||
|
// return JsonUtil.parseMap(excelExportParam, Object.class);
|
||||||
|
// }
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue