个税对接,人员报送相关接口

This commit is contained in:
钱涛 2023-08-08 19:39:53 +08:00
parent 58eaddc33e
commit 827420c2bd
82 changed files with 1629 additions and 1125 deletions

View File

@ -1,34 +0,0 @@
create table hrsa_tax_declare_api_profile
(
id number primary key ,
create_time date,
update_time date,
creator number,
delete_type int default 0,
tenant_key varchar2(10),
api_profile int
);
/
create index id_tenant_key_22b215db on hrsa_tax_declare_api_profile(tenant_key);
/
create table hrsa_tax_payment_request
(
id number primary key ,
create_time date,
update_time date,
creator number,
delete_type int default 0,
tenant_key varchar2(10),
tax_agent_id number not null,
tax_declare_record_id number,
tax_year_month date not null,
request_id varchar2(50) not null,
request_type int not null
);
/
create index id_tenant_key_bcb610c7 on hrsa_tax_payment_request(tenant_key);
/

View File

@ -1,38 +0,0 @@
create table hrsa_tax_declare_api_config
(
id number primary key ,
create_time date,
update_time date,
creator number,
delete_type int default 0,
tenant_key varchar2(10),
host varchar2(255),
app_key varchar2(255),
app_secret varchar2(255)
);
/
create unique index idx_tenant_key_api_a6f21b46 on hrsa_tax_declare_api_config(tenant_key);
/
alter table hrsa_tax_declare_api_config modify host not null;
/
alter table hrsa_tax_declare_api_config modify app_key not null;
/
alter table hrsa_tax_declare_api_config modify app_secret not null;
/
alter table hrsa_tax_declare_api_config add enable_use int;
/
alter table hrsa_tax_declare_api_config add totality number;
/
alter table hrsa_tax_declare_api_config add remain number;
/
alter table hrsa_tax_declare_api_config add last_update_time date;
/

View File

@ -1,31 +0,0 @@
create table hrsa_tax_agent_tax_return
(
id number primary key ,
create_time date,
update_time date,
creator number,
delete_type int default 0,
tenant_key varchar2(10),
tax_agent_id number not null,
tax_code varchar2(50) not null,
tax_registration_number varchar2(50) not null,
department_code varchar2(50),
department_name varchar2(50),
nation varchar2(50),
province varchar2(50),
city varchar2(50),
area_code varchar2(50) not null,
password_type int not null,
real_account varchar2(50) ,
pwd varchar2(50) not null,
check_status int not null,
fail_reason varchar2(255)
);
/
create index id_tenant_key_tax_return on hrsa_tax_agent_tax_return(tenant_key);
/
create unique index id_tax_agent_id_tax_return on hrsa_tax_agent_tax_return(tax_agent_id);
/

View File

@ -0,0 +1,14 @@
package com.api.salary.web;
import javax.ws.rs.Path;
/**
* 智能算薪-计费
*
* @author chengliming
* @date 2022-11-15 16:05:40
*/
@Path("/bs/hrmsalary/taxdeclaration/apiflow")
public class TaxDeclarationApiFlowController extends com.engine.salary.web.TaxDeclarationApiFlowController{
}

View File

@ -18,9 +18,9 @@ import lombok.NoArgsConstructor;
@ApiModel("人员选项") @ApiModel("人员选项")
public class OptionDTO { public class OptionDTO {
@ApiModelProperty("人员ID") //人员ID")
private String id; private String id;
@ApiModelProperty("人员姓名") //人员姓名")
private String content; private String content;
} }

View File

@ -13,6 +13,6 @@ import lombok.Data;
@Data @Data
public class AsyncRequestIdDTO { public class AsyncRequestIdDTO {
@ApiModelProperty("异步接口中的requestId") //异步接口中的requestId")
private String requestId; private String requestId;
} }

View File

@ -7,8 +7,8 @@ import com.engine.salary.enums.sicategory.DeleteTypeEnum;
import dm.jdbc.util.IdGenerator; import dm.jdbc.util.IdGenerator;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import java.time.LocalDateTime;
import java.util.Collections; import java.util.Collections;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -43,14 +43,15 @@ public class PaymentAgencyBO {
} }
public static PaymentAgencyPO buildPaymentAgencyPO(PaymentAgencyFormDTO paymentAgencyFormDTO, Long employeeId, String tenantKey) { public static PaymentAgencyPO buildPaymentAgencyPO(PaymentAgencyFormDTO paymentAgencyFormDTO, Long employeeId, String tenantKey) {
Date now = new Date();
return PaymentAgencyPO.builder() return PaymentAgencyPO.builder()
.id(IdGenerator.generate()) .id(IdGenerator.generate())
.agencyName(paymentAgencyFormDTO.getAgencyName()) .agencyName(paymentAgencyFormDTO.getAgencyName())
.createTime(LocalDateTime.now()) .createTime(now)
.creator(employeeId) .creator(employeeId)
.tenantKey(tenantKey) .tenantKey(tenantKey)
.deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) .deleteType(DeleteTypeEnum.NOT_DELETED.getValue())
.updateTime(LocalDateTime.now()) .updateTime(now)
.remarks(paymentAgencyFormDTO.getRemarks()) .remarks(paymentAgencyFormDTO.getRemarks())
.build(); .build();
} }

View File

@ -5,7 +5,7 @@ import lombok.Builder;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import java.time.LocalDateTime; import java.util.Date;
@Data @Data
@Builder @Builder
@ -32,12 +32,12 @@ public class PaymentAgencyPO {
/** /**
* 创建时间 * 创建时间
*/ */
private LocalDateTime createTime; private Date createTime;
/** /**
* 更新时间 * 更新时间
*/ */
private LocalDateTime updateTime; private Date updateTime;
/** /**
* 创建人 * 创建人

View File

@ -2,11 +2,14 @@ package com.engine.salary.entity.employeedeclare.bo;
import com.api.formmode.page.util.Util; import com.api.formmode.page.util.Util;
import com.engine.salary.constant.SalaryDefaultTenantConstant; import com.engine.salary.constant.SalaryDefaultTenantConstant;
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareRefreshDTO; import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareRefreshDTO;
import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO;
import com.engine.salary.entity.extemp.po.ExtEmpPO;
import com.engine.salary.entity.salaryarchive.po.SalaryArchivePO; import com.engine.salary.entity.salaryarchive.po.SalaryArchivePO;
import com.engine.salary.enums.SalaryOnOffEnum; import com.engine.salary.enums.SalaryOnOffEnum;
import com.engine.salary.enums.employeedeclare.*; import com.engine.salary.enums.employeedeclare.*;
import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum;
import com.engine.salary.enums.salaryarchive.SalaryArchiveStatusEnum; import com.engine.salary.enums.salaryarchive.SalaryArchiveStatusEnum;
import com.engine.salary.enums.sicategory.DeleteTypeEnum; import com.engine.salary.enums.sicategory.DeleteTypeEnum;
import com.engine.salary.util.SalaryDateUtil; import com.engine.salary.util.SalaryDateUtil;
@ -16,13 +19,11 @@ import com.engine.salary.util.valid.SalaryCardUtil;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import dm.jdbc.util.IdGenerator; import dm.jdbc.util.IdGenerator;
import lombok.Data; import lombok.Data;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import java.time.LocalDateTime;
import java.time.YearMonth; import java.time.YearMonth;
import java.util.*; import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
/** /**
* @description: * @description:
@ -38,14 +39,12 @@ public class EmployeeDeclareRefresh {
// 本月已有的需要报送的人员 // 本月已有的需要报送的人员
Set<Long> employeeIds = SalaryEntityUtil.properties(dto.getEmployeeDeclares(), EmployeeDeclarePO::getEmployeeId); Set<Long> employeeIds = SalaryEntityUtil.properties(dto.getEmployeeDeclares(), EmployeeDeclarePO::getEmployeeId);
// 员工的个人信息 // 员工的个人信息
Map<Long, SimpleUserInfo> simpleUserInfoMap = dto.getSimpleUserInfos().stream() Map<Long, DataCollectionEmployee> simpleUserInfoMap = SalaryEntityUtil.convert2Map(dto.getHrmEmployeeComInfos(), DataCollectionEmployee::getEmployeeId);
.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, SalaryArchivePO> salaryArchiveMap = SalaryEntityUtil.convert2Map(dto.getSalaryArchives(), SalaryArchivePO::getEmployeeId);
// 非系统人员的数据任职受雇从业类型 // 非系统人员的数据任职受雇从业类型
Map<Long, ExtEmployeePO> extEmployeeMap = SalaryEntityUtil.convert2Map(dto.getExtEmployees(), ExtEmployeePO::getId); Map<Long, ExtEmpPO> extEmployeeMap = SalaryEntityUtil.convert2Map(dto.getExtEmployees(), ExtEmpPO::getId);
LocalDateTime now = LocalDateTime.now(); Date now = new Date();
// 对已有人员处理人员状态离职日期任职受雇从业类型 // 对已有人员处理人员状态离职日期任职受雇从业类型
for (EmployeeDeclarePO employeeDeclare : dto.getEmployeeDeclares()) { for (EmployeeDeclarePO employeeDeclare : dto.getEmployeeDeclares()) {
SalaryArchivePO salaryArchive = salaryArchiveMap.get(employeeDeclare.getEmployeeId()); SalaryArchivePO salaryArchive = salaryArchiveMap.get(employeeDeclare.getEmployeeId());
@ -60,17 +59,17 @@ public class EmployeeDeclareRefresh {
result.getEmployeeDeclares().add(employeeDeclare); result.getEmployeeDeclares().add(employeeDeclare);
} }
} }
if (salaryArchive != null && !Objects.equals(employeeDeclare.getEmploymentType(), Util.getIntValue(salaryArchive.getEmploymentType()))) { // if (salaryArchive != null && !Objects.equals(employeeDeclare.getEmploymentType(), Util.getIntValue(salaryArchive.getEmploymentType()))) {
employeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()); // employeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue());
employeeDeclare.setEmploymentType(Util.getIntValue(salaryArchive.getEmploymentType())); // employeeDeclare.setEmploymentType(Util.getIntValue(salaryArchive.getEmploymentType()));
employeeDeclare.setNewEmployeeInfo(1); // employeeDeclare.setNewEmployeeInfo(1);
} // }
ExtEmployeePO extEmployee = extEmployeeMap.get(employeeDeclare.getEmployeeId()); // ExtEmpPO extEmployee = extEmployeeMap.get(employeeDeclare.getEmployeeId());
if (extEmployee != null && !Objects.equals(employeeDeclare.getEmploymentType(), extEmployee.getEmploymentType())) { // if (extEmployee != null && !Objects.equals(employeeDeclare.getEmploymentType(), extEmployee.getEmploymentType())) {
employeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()); // employeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue());
employeeDeclare.setEmploymentType(extEmployee.getEmploymentType()); // employeeDeclare.setEmploymentType(extEmployee.getEmploymentType());
employeeDeclare.setNewEmployeeInfo(1); // employeeDeclare.setNewEmployeeInfo(1);
} // }
} }
// 自动保存上个月报送成功的人员 // 自动保存上个月报送成功的人员
for (EmployeeDeclarePO preTaxCycleEmployeeDeclare : dto.getPreTaxCycleEmployeeDeclare()) { for (EmployeeDeclarePO preTaxCycleEmployeeDeclare : dto.getPreTaxCycleEmployeeDeclare()) {
@ -91,37 +90,37 @@ public class EmployeeDeclareRefresh {
employeeDeclare.setDismissDate(salaryArchive.getPayEndDate()); employeeDeclare.setDismissDate(salaryArchive.getPayEndDate());
employeeDeclare.setNewEmployeeInfo(1); employeeDeclare.setNewEmployeeInfo(1);
} }
if (salaryArchive != null && !Objects.equals(Util.null2String(employeeDeclare.getEmploymentType()), salaryArchive.getEmploymentType())) { // if (salaryArchive != null && !Objects.equals(Util.null2String(employeeDeclare.getEmploymentType()), salaryArchive.getEmploymentType())) {
employeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()); // employeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue());
employeeDeclare.setEmploymentType(Util.getIntValue(salaryArchive.getEmploymentType())); // employeeDeclare.setEmploymentType(Util.getIntValue(salaryArchive.getEmploymentType()));
employeeDeclare.setNewEmployeeInfo(1); // employeeDeclare.setNewEmployeeInfo(1);
} // }
ExtEmployeePO extEmployee = extEmployeeMap.get(employeeDeclare.getEmployeeId()); // ExtEmployeePO extEmployee = extEmployeeMap.get(employeeDeclare.getEmployeeId());
if (extEmployee != null && !Objects.equals(employeeDeclare.getEmploymentType(), extEmployee.getEmploymentType())) { // if (extEmployee != null && !Objects.equals(employeeDeclare.getEmploymentType(), extEmployee.getEmploymentType())) {
employeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()); // employeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue());
employeeDeclare.setEmploymentType(extEmployee.getEmploymentType()); // employeeDeclare.setEmploymentType(extEmployee.getEmploymentType());
employeeDeclare.setNewEmployeeInfo(1); // employeeDeclare.setNewEmployeeInfo(1);
} // }
employeeIds.add(employeeDeclare.getEmployeeId()); employeeIds.add(employeeDeclare.getEmployeeId());
result.getNewEmployeeDeclares().add(employeeDeclare); result.getNewEmployeeDeclares().add(employeeDeclare);
} }
} }
// 薪资档案中新增的需报送的人员 // 薪资档案中新增的需报送的人员
for (HrmEmployeeComInfo hrmEmployeeComInfo : dto.getHrmEmployeeComInfos()) { for (DataCollectionEmployee hrmEmployeeComInfo : dto.getHrmEmployeeComInfos()) {
if (employeeIds.contains(hrmEmployeeComInfo.getId())) { if (employeeIds.contains(hrmEmployeeComInfo.getEmployeeId())) {
continue; continue;
} }
EmployeeDeclarePO employeeDeclare = initEmployeeDeclare(dto.getTaxAgentId(), dto.getTaxCycle(), now, employeeId, tenantKey); EmployeeDeclarePO employeeDeclare = initEmployeeDeclare(dto.getTaxAgentId(), dto.getTaxCycle(), now, employeeId);
SimpleUserInfo simpleUserInfo = simpleUserInfoMap.get(hrmEmployeeComInfo.getId()); DataCollectionEmployee simpleUserInfo = simpleUserInfoMap.get(hrmEmployeeComInfo.getEmployeeId());
String idNum = simpleUserInfo == null ? "" : simpleUserInfo.getIdNo(); String idNum = simpleUserInfo == null ? "" : simpleUserInfo.getIdNo();
employeeDeclare.setEmployeeId(hrmEmployeeComInfo.getId()) employeeDeclare.setEmployeeId(hrmEmployeeComInfo.getEmployeeId())
.setEmployeeType(EmployeeTypeEnum.ORGANIZATION.getValue()) .setEmployeeType(EmployeeTypeEnum.ORGANIZATION.getValue())
.setEmployeeName(hrmEmployeeComInfo.getUsername()) .setEmployeeName(hrmEmployeeComInfo.getUsername())
.setJobNum(hrmEmployeeComInfo.getJob_num()) .setJobNum(hrmEmployeeComInfo.getWorkcode())
.setCardNum(idNum) .setCardNum(idNum)
.setGender(StringUtils.equalsIgnoreCase(hrmEmployeeComInfo.getSex(), GenderEnum.MALE.name()) .setGender(StringUtils.equalsIgnoreCase(hrmEmployeeComInfo.getSex(), GenderEnum.MALE.name())
? GenderEnum.MALE.getValue() : GenderEnum.FEMALE.getValue()) ? GenderEnum.MALE.getValue() : GenderEnum.FEMALE.getValue())
.setBirthday(simpleUserInfo == null ? null : SalaryDateUtil.dateToLocalDate(simpleUserInfo.getBirthday())) .setBirthday(simpleUserInfo == null ? null : SalaryDateUtil.dateStrToLocalDate(simpleUserInfo.getBirthday()))
.setMobile(hrmEmployeeComInfo.getMobile()); .setMobile(hrmEmployeeComInfo.getMobile());
if (StringUtils.isEmpty(idNum)) { if (StringUtils.isEmpty(idNum)) {
employeeDeclare.setDeclareStatus(DeclareStatusEnum.DECLARE_FAIL.getValue()); employeeDeclare.setDeclareStatus(DeclareStatusEnum.DECLARE_FAIL.getValue());
@ -131,12 +130,12 @@ public class EmployeeDeclareRefresh {
employeeDeclare.setDeclareErrorMsg(SalaryI18nUtil.getI18nLabel(156510, "身份证号格式错误")); employeeDeclare.setDeclareErrorMsg(SalaryI18nUtil.getI18nLabel(156510, "身份证号格式错误"));
} else { } else {
employeeDeclare.setGender(SalaryCardUtil.judgeGender(idNum).getValue()); employeeDeclare.setGender(SalaryCardUtil.judgeGender(idNum).getValue());
employeeDeclare.setBirthday(SalaryCardUtil.judgeBirthday(idNum)); employeeDeclare.setBirthday(SalaryDateUtil.localDateToDate(SalaryCardUtil.judgeBirthday(idNum)));
} }
// 对人员处理人员状态离职日期 // 对人员处理人员状态离职日期
SalaryArchivePO salaryArchive = salaryArchiveMap.get(employeeDeclare.getEmployeeId()); SalaryArchivePO salaryArchive = salaryArchiveMap.get(employeeDeclare.getEmployeeId());
if (salaryArchive != null) { if (salaryArchive != null) {
employeeDeclare.setEmploymentType(Util.getIntValue(salaryArchive.getEmploymentType())); // employeeDeclare.setEmploymentType(Util.getIntValue(salaryArchive.getEmploymentType()));
employeeDeclare.setEmploymentDate(salaryArchive.getPayStartDate()); employeeDeclare.setEmploymentDate(salaryArchive.getPayStartDate());
if (Objects.equals(salaryArchive.getRunStatus(), SalaryArchiveStatusEnum.STOP_FROM_PENDING.getValue()) if (Objects.equals(salaryArchive.getRunStatus(), SalaryArchiveStatusEnum.STOP_FROM_PENDING.getValue())
|| Objects.equals(salaryArchive.getRunStatus(), SalaryArchiveStatusEnum.STOP_FROM_SUSPEND.getValue())) { || Objects.equals(salaryArchive.getRunStatus(), SalaryArchiveStatusEnum.STOP_FROM_SUSPEND.getValue())) {
@ -148,33 +147,34 @@ public class EmployeeDeclareRefresh {
result.getNewEmployeeDeclares().add(employeeDeclare); result.getNewEmployeeDeclares().add(employeeDeclare);
} }
// 非系统人员中新增的需报送的人员 // 非系统人员中新增的需报送的人员
for (ExtEmployeePO extEmployee : dto.getExtEmployees()) { // for (ExtEmployeePO extEmployee : dto.getExtEmployees()) {
if (employeeIds.contains(extEmployee.getId())) { // if (employeeIds.contains(extEmployee.getId())) {
continue; // continue;
} // }
EmployeeDeclarePO employeeDeclare = initEmployeeDeclare(dto.getTaxAgentId(), dto.getTaxCycle(), now, employeeId, tenantKey); // EmployeeDeclarePO employeeDeclare = initEmployeeDeclare(dto.getTaxAgentId(), dto.getTaxCycle(), now, employeeId, tenantKey);
employeeDeclare.setEmployeeId(extEmployee.getId()) // employeeDeclare.setEmployeeId(extEmployee.getId())
.setEmployeeType(EmployeeTypeEnum.EXT_EMPLOYEE.getValue()) // .setEmployeeType(EmployeeTypeEnum.EXT_EMPLOYEE.getValue())
.setEmployeeName(extEmployee.getUsername()) // .setEmployeeName(extEmployee.getUsername())
.setCardNum(extEmployee.getCardNum()) // .setCardNum(extEmployee.getCardNum())
.setMobile(extEmployee.getMobile()) // .setMobile(extEmployee.getMobile())
.setEmploymentType(extEmployee.getEmploymentType()) // .setEmploymentType(extEmployee.getEmploymentType())
.setEmploymentDate(YearMonth.parse(extEmployee.getStartMonth()).atDay(1)); // .setEmploymentDate(YearMonth.parse(extEmployee.getStartMonth()).atDay(1));
if (StringUtils.isEmpty(extEmployee.getCardNum())) { // if (StringUtils.isEmpty(extEmployee.getCardNum())) {
employeeDeclare.setDeclareStatus(DeclareStatusEnum.DECLARE_FAIL.getValue()); // employeeDeclare.setDeclareStatus(DeclareStatusEnum.DECLARE_FAIL.getValue());
employeeDeclare.setDeclareErrorMsg(SalaryI18nUtil.getI18nLabel(187460, "身份证号不能为空")); // employeeDeclare.setDeclareErrorMsg(SalaryI18nUtil.getI18nLabel(187460, "身份证号不能为空"));
} else if (!SalaryCardUtil.checkIdNum(extEmployee.getCardNum())) { // } else if (!SalaryCardUtil.checkIdNum(extEmployee.getCardNum())) {
employeeDeclare.setDeclareStatus(DeclareStatusEnum.DECLARE_FAIL.getValue()); // employeeDeclare.setDeclareStatus(DeclareStatusEnum.DECLARE_FAIL.getValue());
employeeDeclare.setDeclareErrorMsg(SalaryI18nUtil.getI18nLabel(156510, "身份证号格式错误")); // employeeDeclare.setDeclareErrorMsg(SalaryI18nUtil.getI18nLabel(156510, "身份证号格式错误"));
} else { // } else {
employeeDeclare.setGender(SalaryCardUtil.judgeGender(extEmployee.getCardNum()).getValue()); // employeeDeclare.setGender(SalaryCardUtil.judgeGender(extEmployee.getCardNum()).getValue());
employeeDeclare.setBirthday(SalaryCardUtil.judgeBirthday(extEmployee.getCardNum())); // employeeDeclare.setBirthday(SalaryCardUtil.judgeBirthday(extEmployee.getCardNum()));
} // }
employeeIds.add(employeeDeclare.getEmployeeId()); // employeeIds.add(employeeDeclare.getEmployeeId());
result.getNewEmployeeDeclares().add(employeeDeclare); // result.getNewEmployeeDeclares().add(employeeDeclare);
} // }
return result; return result;
} }
private static EmployeeDeclarePO initEmployeeDeclare(Long taxAgentId, YearMonth taxCycle, Date now, Long employeeId) { private static EmployeeDeclarePO initEmployeeDeclare(Long taxAgentId, YearMonth taxCycle, Date now, Long employeeId) {
return new EmployeeDeclarePO() return new EmployeeDeclarePO()
.setId(IdGenerator.generate()) .setId(IdGenerator.generate())

View File

@ -0,0 +1,142 @@
package com.engine.salary.entity.employeedeclare.bo;
import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO;
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 com.engine.salary.util.SalaryDateUtil;
import com.engine.salary.util.SalaryEnumUtil;
import lombok.Data;
import org.apache.commons.compress.utils.Lists;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @description: 个税对接人员报送
* @author: xiajun
* @modified By: xiajun
* @date: Created in 2022/11/2 11:05 AM
* @version:v1.0
*/
@Data
public class EmployeeDeclareRequest {
/**
* 转换成请求参数
*
* @param employeeDeclares
* @return
*/
public static List<Map<String, Object>> convert2RequestParam(List<EmployeeDeclarePO> employeeDeclares) {
List<Map<String, Object>> employeeInfoMapList = Lists.newArrayList();
for (EmployeeDeclarePO employeeDeclare : employeeDeclares) {
Map<String, Object> employeeInfoMap = new HashMap<>();
// 工号
employeeInfoMap.put("gh", employeeDeclare.getJobNum());
// *姓名
employeeInfoMap.put("xm", employeeDeclare.getEmployeeName());
// *证件类型
CardTypeEnum cardTypeEnum = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getCardType(), CardTypeEnum.class);
employeeInfoMap.put("zzlx", cardTypeEnum == null ? "" : cardTypeEnum.getDefaultLabel());
// *证件号码
employeeInfoMap.put("zzhm", employeeDeclare.getCardNum());
// *国籍
employeeInfoMap.put("gj", "中国");
// *性别
GenderEnum genderEnum = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getGender(), GenderEnum.class);
employeeInfoMap.put("xb", genderEnum == null ? "" : genderEnum.getDefaultLabel());
// *出生日期
employeeInfoMap.put("csny", employeeDeclare.getBirthday());
// *人员状态
EmploymentStatusEnum employmentStatusEnum = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getEmploymentStatus(), EmploymentStatusEnum.class);
employeeInfoMap.put("nsrzt", employmentStatusEnum == null ? "" : employmentStatusEnum.getDefaultLabel());
// *任职受雇类型
EmploymentTypeEnum employmentTypeEnum = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getEmploymentType(), EmploymentTypeEnum.class);
employeeInfoMap.put("sfgy", employmentTypeEnum == null ? "" : employmentTypeEnum.getDefaultLabel());
// 入职年度就业情形
employeeInfoMap.put("rzndjyqk", employeeDeclare.getEmploymentFirstYear());
// *手机号码
employeeInfoMap.put("lxdh", employeeDeclare.getMobile());
// *入职受雇日期
employeeInfoMap.put("rzsgrq", SalaryDateUtil.getFormatLocalDate(employeeDeclare.getEmploymentDate()));
// 离职日期
employeeInfoMap.put("lzrq", SalaryDateUtil.getFormatLocalDate(employeeDeclare.getDismissDate()));
// 是否残疾
SalaryOnOffEnum disability = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getDisability(), SalaryOnOffEnum.class);
employeeInfoMap.put("sfcj", disability == null ? "" : disability.getDefaultLabel());
// 残疾证号
employeeInfoMap.put("cjzh", employeeDeclare.getDisabilityCardNo());
// 是否扣除减除费用
SalaryOnOffEnum deductExpenses = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getDeductExpenses(), SalaryOnOffEnum.class);
employeeInfoMap.put("sfzdw", deductExpenses == null ? "" : deductExpenses.getDefaultLabel());
// 是否烈属
SalaryOnOffEnum martyrDependents = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getMartyrDependents(), SalaryOnOffEnum.class);
employeeInfoMap.put("sfls", martyrDependents == null ? "" : martyrDependents.getDefaultLabel());
// 烈属证号
employeeInfoMap.put("lszh", employeeDeclare.getMartyrDependentsCardNo());
// 是否孤老
SalaryOnOffEnum lonelyOld = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getLonelyOld(), SalaryOnOffEnum.class);
employeeInfoMap.put("sfgl", lonelyOld == null ? "" : lonelyOld.getDefaultLabel());
// 个人投资总额
employeeInfoMap.put("grgbze", "");
// 个人投资比例
employeeInfoMap.put("grgbbl", "");
// 备注
employeeInfoMap.put("bz", "");
// 人员地区
employeeInfoMap.put("rydq", "境内");
// 中文名
employeeInfoMap.put("xmzw", "");
// 出生地
employeeInfoMap.put("csd", "");
// 涉税事由
employeeInfoMap.put("sssx", "");
// 首次入境时间
employeeInfoMap.put("scrjsj", "");
// 预计离境时间
employeeInfoMap.put("yjljsj", "");
// 其他证件类型
employeeInfoMap.put("qtzzlx", "");
// 其他证件号码
employeeInfoMap.put("qtzzhm", "");
// 户籍地址省份城市区县街道详细地址
employeeInfoMap.put("hjszd_sheng", "");
employeeInfoMap.put("hjszd_shi", "");
employeeInfoMap.put("hjszd_qx", "");
employeeInfoMap.put("hjszd_jd", "");
employeeInfoMap.put("hjszd_xxdz", "");
// 居住地址省份城市区县街道详细地址
employeeInfoMap.put("lxdz_sheng", "");
employeeInfoMap.put("lxdz_shi", "");
employeeInfoMap.put("lxdz_qx", "");
employeeInfoMap.put("lxdz_jd", "");
employeeInfoMap.put("lxdz", "");
// 联系地
employeeInfoMap.put("wjrlxdz_sheng", "");
employeeInfoMap.put("wjrlxdz_shi", "");
employeeInfoMap.put("wjrlxdz_qx", "");
employeeInfoMap.put("wjrlxdz_jd", "");
employeeInfoMap.put("wjrlxdz_xxdz", "");
// 邮箱
employeeInfoMap.put("dzyx", "");
// 学历
employeeInfoMap.put("xl", "");
// 开户银行
employeeInfoMap.put("khyh", "");
// 开户银行省份
employeeInfoMap.put("khyhsfmz", "");
// 银行账号
employeeInfoMap.put("yhzh", "");
// 职务
employeeInfoMap.put("zw", "");
// 部门编号
employeeInfoMap.put("bmbh", "");
employeeInfoMapList.add(employeeInfoMap);
}
return employeeInfoMapList;
}
}

View File

@ -1,6 +1,5 @@
package com.engine.salary.entity.employeedeclare.dto; package com.engine.salary.entity.employeedeclare.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
import lombok.Data; import lombok.Data;
@ -25,12 +24,12 @@ public class EmployeeDeclareRateDTO implements Serializable {
private static final long serialVersionUID = 6096347310269090985L; private static final long serialVersionUID = 6096347310269090985L;
@ApiModelProperty("缓存索引") //缓存索引")
private String index; private String index;
@ApiModelProperty("提示信息") //提示信息")
private String msg; private String msg;
@ApiModelProperty("状态") //状态")
private boolean status; private boolean status;
@ApiModelProperty("是否已经完成") //是否已经完成")
private boolean finish; private boolean finish;
} }

View File

@ -3,6 +3,7 @@ package com.engine.salary.entity.employeedeclare.dto;
import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.datacollection.DataCollectionEmployee;
import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO;
import com.engine.salary.entity.extemp.po.ExtEmpPO;
import com.engine.salary.entity.salaryarchive.po.SalaryArchivePO; import com.engine.salary.entity.salaryarchive.po.SalaryArchivePO;
import lombok.Data; import lombok.Data;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
@ -36,15 +37,12 @@ public class EmployeeDeclareRefreshDTO {
private List<SalaryArchivePO> salaryArchives; private List<SalaryArchivePO> salaryArchives;
// 员工基本信息 // 员工基本信息
private List<DataCollectionEmployee> employeeInfos; private List<DataCollectionEmployee> hrmEmployeeComInfos;
// // 员工基本信息
// private List<HrmEmployeeComInfo> hrmEmployeeComInfos;
// //
// // 员工个人信息 // // 员工个人信息
// private List<SimpleUserInfo> simpleUserInfos; // private List<SimpleUserInfo> simpleUserInfos;
//
// // 非系统人员 // 非系统人员
// private List<ExtEmployeePO> extEmployees; private List<ExtEmpPO> extEmployees;
} }

View File

@ -0,0 +1,96 @@
package com.engine.salary.entity.employeedeclare.param;
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 com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.time.LocalDate;
import java.time.YearMonth;
/**
* @description: 人员报送人员保存参数
* @author: xiajun
* @modified By: xiajun
* @date: Created in 9/6/22 1:50 PM
* @version:v1.0
*/
@Data
public class EmployeeDeclareSaveParam {
//主键id")
private Long id;
/**
* 参数错误个税扣缴义务人id不能为空
*/
//个税扣缴义务人id")
private Long taxAgentId;
/**
* 参数错误税款所属期参数格式错误
*/
//税款所属期")
private YearMonth taxCycle;
//员工id")
private Long employeeId;
//员工类型")
private EmployeeTypeEnum employeeType;
//姓名")
private String employeeName;
//工号")
private String jobNum;
//证件类型")
private CardTypeEnum cardType;
//证件号码")
private String cardNum;
//性别")
private GenderEnum gender;
//出生日期")
private LocalDate birthday;
//状态")
private EmploymentStatusEnum employmentStatus;
//手机号码")
private String mobile;
//任职受雇从业类型")
private EmploymentTypeEnum employmentType;
//任职受雇从业日期")
private LocalDate employmentDate;
//离职日期")
private LocalDate dismissDate;
//是否残疾")
private SalaryOnOffEnum disability;
//残疾证号")
private String disabilityCardNo;
//是否孤老")
private SalaryOnOffEnum lonelyOld;
//是否是烈属")
private SalaryOnOffEnum martyrDependents;
//烈属证号")
private String martyrDependentsCardNo;
//是否扣除减除费用")
private SalaryOnOffEnum deductExpenses;
}

View File

@ -0,0 +1,56 @@
package com.engine.salary.entity.employeedeclare.po;
import lombok.Data;
import lombok.experimental.Accessors;
import java.util.Date;
/**
* @description: 员工报送记录
* @author: xiajun
* @modified By: xiajun
* @date: 2022/11/6 16:50
* @version:v1.0
*/
@Data
@Accessors(chain = true)
//"hrsa_employee_declare_record")
public class EmployeeDeclareRecordPO {
/**
* 主键id
*/
private Long id;
/**
* 个税扣缴义务人
*/
private Long taxAgentId;
/**
* 税款所属期
*/
private String taxCycle;
/**
* 请求的requestId
*/
private String requestId;
/**
* 租户key
*/
private String tenantKey;
/**
* 创建人id
*/
private Long creator;
/**
* 是否删除
*/
private Integer deleteType;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
}

View File

@ -0,0 +1,35 @@
package com.engine.salary.entity.employeedeclare.response;
import com.engine.salary.entity.taxagent.response.SzyhResponseHead;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
import java.util.Map;
/**
* @description: 报送人员的反馈
* @author: xiajun
* @modified By: xiajun
* @date: Created in 2022/10/27 10:41 AM
* @version:v1.0
*/
@Data
public class DeclareEmployeeFeedbackResponse {
@ApiModelProperty("接口状态")
private SzyhResponseHead head;
@ApiModelProperty("返回数据")
private DeclareEmployeeFeedbackResponseBody body;
@Data
public static class DeclareEmployeeFeedbackResponseBody {
@ApiModelProperty("人员数据")
private List<Map<String, Object>> bsjg;
@ApiModelProperty("requestId")
private String requestId;
}
}

View File

@ -0,0 +1,23 @@
package com.engine.salary.entity.employeedeclare.response;
import com.engine.salary.common.taxdeclare.AsyncRequestIdDTO;
import com.engine.salary.entity.taxagent.response.SzyhResponseHead;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @description: 报送人员的返回数据
* @author: xiajun
* @modified By: xiajun
* @date: Created in 2022/10/25 4:49 PM
* @version:v1.0
*/
@Data
public class DeclareEmployeeInfoResponse {
@ApiModelProperty("接口状态")
private SzyhResponseHead head;
@ApiModelProperty("接口数据")
private AsyncRequestIdDTO body;
}

View File

@ -6,7 +6,7 @@ import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import java.time.LocalDateTime; import java.util.Date;
/** /**
* @description: 核算结果的校验结果明细临时存储 * @description: 核算结果的校验结果明细临时存储
@ -76,10 +76,10 @@ public class SalaryCheckResultDetailTempPO {
/** /**
* 创建时间 * 创建时间
*/ */
private LocalDateTime createTime; private Date createTime;
/** /**
* 更新时间 * 更新时间
*/ */
private LocalDateTime updateTime; private Date updateTime;
} }

View File

@ -5,7 +5,7 @@ import lombok.Builder;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import java.time.LocalDateTime; import java.util.Date;
/** /**
* @description: 薪资核算校验异常结果 * @description: 薪资核算校验异常结果
@ -64,10 +64,10 @@ public class SalaryCheckResultPO {
/** /**
* 创建时间 * 创建时间
*/ */
private LocalDateTime createTime; private Date createTime;
/** /**
* 更新时间 * 更新时间
*/ */
private LocalDateTime updateTime; private Date updateTime;
} }

View File

@ -5,7 +5,7 @@ import lombok.Builder;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import java.time.LocalDateTime; import java.util.Date;
/** /**
* @description: 薪资核算校验异常结果明细 * @description: 薪资核算校验异常结果明细
@ -74,10 +74,10 @@ public class SalaryCheckResultRecordPO {
/** /**
* 创建时间 * 创建时间
*/ */
private LocalDateTime createTime; private Date createTime;
/** /**
* 更新时间 * 更新时间
*/ */
private LocalDateTime updateTime; private Date updateTime;
} }

View File

@ -11,7 +11,7 @@ import com.engine.salary.enums.taxagent.TaxAgentTaxReturnStatusEnum;
import com.engine.salary.util.Sm4Utils; import com.engine.salary.util.Sm4Utils;
import dm.jdbc.util.IdGenerator; import dm.jdbc.util.IdGenerator;
import java.time.LocalDateTime; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.UUID; import java.util.UUID;
@ -43,6 +43,7 @@ public class TaxAgentTaxReturnBO {
} }
public static TaxAgentTaxReturnPO convertParam2Po4Insert(TaxDeclarationApiConfigPO apiConfig, TaxAgentTaxReturnSaveParam saveParam) throws Exception { public static TaxAgentTaxReturnPO convertParam2Po4Insert(TaxDeclarationApiConfigPO apiConfig, TaxAgentTaxReturnSaveParam saveParam) throws Exception {
Date now = new Date();
return TaxAgentTaxReturnPO.builder() return TaxAgentTaxReturnPO.builder()
.taxAgentId(saveParam.getTaxAgentId()) .taxAgentId(saveParam.getTaxAgentId())
.taxCode(saveParam.getTaxCode()) .taxCode(saveParam.getTaxCode())
@ -57,12 +58,13 @@ public class TaxAgentTaxReturnBO {
.id(IdGenerator.generate()) .id(IdGenerator.generate())
.checkStatus(TaxAgentTaxReturnStatusEnum.NOT_COMMIT.getValue()) .checkStatus(TaxAgentTaxReturnStatusEnum.NOT_COMMIT.getValue())
.deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) .deleteType(DeleteTypeEnum.NOT_DELETED.getValue())
.createTime(LocalDateTime.now()) .createTime(now)
.updateTime(LocalDateTime.now()) .updateTime(now)
.build(); .build();
} }
public static void convertParam2Po4Update(TaxDeclarationApiConfigPO apiConfig, TaxAgentTaxReturnPO po, TaxAgentTaxReturnSaveParam saveParam) throws Exception { public static void convertParam2Po4Update(TaxDeclarationApiConfigPO apiConfig, TaxAgentTaxReturnPO po, TaxAgentTaxReturnSaveParam saveParam) throws Exception {
Date now = new Date();
po.setTaxCode(saveParam.getTaxCode()) po.setTaxCode(saveParam.getTaxCode())
.setNation(saveParam.getNation()) .setNation(saveParam.getNation())
.setCity(saveParam.getCity()) .setCity(saveParam.getCity())
@ -72,7 +74,7 @@ public class TaxAgentTaxReturnBO {
.setPwd(Sm4Utils.encryptEcb(apiConfig.getAppSecret(), saveParam.getPassword())) .setPwd(Sm4Utils.encryptEcb(apiConfig.getAppSecret(), saveParam.getPassword()))
.setPasswordType(TaxAgentTaxReturnPasswordTypeEnum.valueOf(saveParam.getPasswordType()).getValue()) .setPasswordType(TaxAgentTaxReturnPasswordTypeEnum.valueOf(saveParam.getPasswordType()).getValue())
.setTaxAgentId(saveParam.getTaxAgentId()) .setTaxAgentId(saveParam.getTaxAgentId())
.setUpdateTime(LocalDateTime.now()); .setUpdateTime(now);
} }
public static Map<String, Object> convert2RequestMap(TaxAgentPO taxAgent, TaxAgentTaxReturnPO taxAgentTaxReturn) { public static Map<String, Object> convert2RequestMap(TaxAgentPO taxAgent, TaxAgentTaxReturnPO taxAgentTaxReturn) {

View File

@ -24,19 +24,19 @@ public class TaxAgentTaxReturnCheckDTO {
* 验证状态 * 验证状态
* @see TaxAgentTaxReturnStatusEnum * @see TaxAgentTaxReturnStatusEnum
*/ */
@ApiModelProperty("验证状态") //验证状态")
private Integer status; private Integer status;
@ApiModelProperty("登记序号") //登记序号")
private String taxRegistrationNumber; private String taxRegistrationNumber;
@ApiModelProperty("部门编号") //部门编号")
private String departmentCode; private String departmentCode;
@ApiModelProperty("验证提示信息") //验证提示信息")
private String message; private String message;
@ApiModelProperty("详细数据") //详细数据")
private List<TaxAgentTaxReturnCheckFormDTO> records; private List<TaxAgentTaxReturnCheckFormDTO> records;
public void setMessage(String message, String currentTenantKey, Long currentEmployeeId) { public void setMessage(String message, String currentTenantKey, Long currentEmployeeId) {

View File

@ -24,51 +24,51 @@ import lombok.NoArgsConstructor;
@ApiModel("税友验证信息") @ApiModel("税友验证信息")
public class TaxAgentTaxReturnCheckFormDTO { public class TaxAgentTaxReturnCheckFormDTO {
@ApiModelProperty("税号") //税号")
private String taxCode; private String taxCode;
@ApiModelProperty("验证信息id") //验证信息id")
@JsonSerialize(using = ToStringSerializer.class) @JsonSerialize(using = ToStringSerializer.class)
private Long index; private Long index;
@ApiModelProperty("个税扣缴义务人id") //个税扣缴义务人id")
@JsonSerialize(using = ToStringSerializer.class) @JsonSerialize(using = ToStringSerializer.class)
private Long taxAgentId; private Long taxAgentId;
@ApiModelProperty("个税扣缴义务人") //个税扣缴义务人")
private String taxAgentName; private String taxAgentName;
@ApiModelProperty("登记序号") //登记序号")
private String taxRegistrationNumber; private String taxRegistrationNumber;
@ApiModelProperty("纳税人状态") //纳税人状态")
private String taxpayerStatus; private String taxpayerStatus;
@ApiModelProperty("法人姓名") //法人姓名")
private String legalPersonName; private String legalPersonName;
@ApiModelProperty("联系电话") //联系电话")
private String mobile; private String mobile;
@ApiModelProperty("生产经营地址") //生产经营地址")
private String businessAddress; private String businessAddress;
@ApiModelProperty("行业名称") //行业名称")
private String industryName; private String industryName;
@ApiModelProperty("主管税务机关") //主管税务机关")
private String taxAuthorities; private String taxAuthorities;
@ApiModelProperty("主管税务科所") //主管税务科所")
private String taxBranch; private String taxBranch;
@ApiModelProperty("是否分部门备案") //是否分部门备案")
private SalaryOnOffEnum divideFiling; private SalaryOnOffEnum divideFiling;
@ApiModelProperty("部门名称") //部门名称")
private String departmentName; private String departmentName;
@ApiModelProperty("部门编码") //部门编码")
private String departmentCode; private String departmentCode;
} }

View File

@ -24,50 +24,50 @@ import lombok.experimental.Accessors;
@ApiModel("报税信息表单") @ApiModel("报税信息表单")
public class TaxAgentTaxReturnMainFormDTO { public class TaxAgentTaxReturnMainFormDTO {
@ApiModelProperty("主键id") //主键id")
@JsonSerialize(using = ToStringSerializer.class) @JsonSerialize(using = ToStringSerializer.class)
private Long id; private Long id;
@ApiModelProperty("名称") //名称")
private String name; private String name;
@ApiModelProperty("税号") //税号")
private String taxCode; private String taxCode;
@ApiModelProperty("报税所属区域") //报税所属区域")
private String city; private String city;
@ApiModelProperty("省份") //省份")
private String province; private String province;
@ApiModelProperty("国家") //国家")
private String nation; private String nation;
@ApiModelProperty("行政区划代码") //行政区划代码")
private String areaCode; private String areaCode;
@ApiModelProperty("密码校验类型") //密码校验类型")
private TaxAgentTaxReturnPasswordTypeEnum passwordType; private TaxAgentTaxReturnPasswordTypeEnum passwordType;
@ApiModelProperty("个税网报密码") //个税网报密码")
private String netPassword; private String netPassword;
@ApiModelProperty("实名账号") //实名账号")
private String account; private String account;
@ApiModelProperty("实名账号密码") //实名账号密码")
private String realNamePassword; private String realNamePassword;
@ApiModelProperty("登记序号") //登记序号")
private String taxRegistrationNumber; private String taxRegistrationNumber;
@ApiModelProperty("部门编码") //部门编码")
private String departmentCode; private String departmentCode;
@ApiModelProperty("报税信息验证状态") //报税信息验证状态")
private TaxAgentTaxReturnStatusEnum checkStatus; private TaxAgentTaxReturnStatusEnum checkStatus;
@ApiModelProperty("失败原因") //失败原因")
private String failReason; private String failReason;
} }

View File

@ -21,47 +21,47 @@ import lombok.NoArgsConstructor;
@ApiModel("个税扣缴义务人-报税信息-保存参数") @ApiModel("个税扣缴义务人-报税信息-保存参数")
public class TaxAgentTaxReturnSaveParam { public class TaxAgentTaxReturnSaveParam {
@ApiModelProperty("个税扣缴义务人id") //个税扣缴义务人id")
private Long taxAgentId; private Long taxAgentId;
@ApiModelProperty("税号") //税号")
private String taxCode; private String taxCode;
@ApiModelProperty("登记序号") //登记序号")
private String taxRegistrationNumber; private String taxRegistrationNumber;
@ApiModelProperty("省级") //省级")
private String province; private String province;
@ApiModelProperty("市级") //市级")
private String city; private String city;
@ApiModelProperty("国家") //国家")
private String nation; private String nation;
@ApiModelProperty("密码校验类型") //密码校验类型")
private String passwordType; private String passwordType;
@ApiModelProperty("密码") //密码")
private String password; private String password;
@ApiModelProperty("实名账号") //实名账号")
private String account; private String account;
@ApiModelProperty("部门编码,分部门备案时填入") //部门编码分部门备案时填入")
private String departmentCode; private String departmentCode;
@ApiModelProperty("部门名称,分部门备案时填入") //部门名称分部门备案时填入")
private String departmentName; private String departmentName;
@ApiModelProperty("请求类型 1.保存并验证 2.仅保存") //请求类型 1.保存并验证 2.仅保存")
private Integer requestType = 1; private Integer requestType = 1;
@ApiModelProperty("验证类型 1.请求税友验证报税信息 2.请求税友验证登记序号+税号 3.请求税友验证部门编码") //验证类型 1.请求税友验证报税信息 2.请求税友验证登记序号+税号 3.请求税友验证部门编码")
@JsonIgnore @JsonIgnore
private Integer type; private Integer type;
@ApiModelProperty("地区编码") //地区编码")
private String areaCode; private String areaCode;
public void checkParam() { public void checkParam() {

View File

@ -1,91 +1,88 @@
//package com.engine.salary.entity.taxapiflow.bo; package com.engine.salary.entity.taxapiflow.bo;
//
//import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowRecordListDTO; import com.engine.salary.constant.SalaryDefaultTenantConstant;
//import com.engine.salary.entity.taxapiflow.po.TaxDeclarationApiFlowRecordPO; import com.engine.salary.entity.extemp.po.ExtEmpPO;
//import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowRecordListDTO;
//import com.engine.salary.enums.sicategory.DeleteTypeEnum; import com.engine.salary.entity.taxapiflow.param.TaxDeclarationBillingConfigSaveParam;
//import com.engine.salary.enums.taxagent.TaxAgentTaxReturnStatusEnum; import com.engine.salary.entity.taxapiflow.po.TaxDeclarationApiFlowRecordPO;
//import com.engine.salary.service.impl.TaxDeclarationApiBillingServiceImpl; import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO;
//import com.weaver.common.distribution.genid.IdGenerator; import com.engine.salary.enums.SalaryOnOffEnum;
//import com.weaver.hrm.salary.entity.extemployee.po.ExtEmployeePO; import com.engine.salary.enums.sicategory.DeleteTypeEnum;
//import com.weaver.hrm.salary.entity.taxapiflow.param.TaxDeclarationBillingConfigSaveParam; import com.engine.salary.enums.taxagent.TaxAgentTaxReturnStatusEnum;
//import com.weaver.hrm.salary.entity.taxapiflow.po.TaxDeclarationApiFlowWarnConfigPO; import com.engine.salary.enums.taxdeclaration.EnumDeclareApiBusinessType;
//import com.weaver.hrm.salary.enums.salaryitem.SalaryOnOffEnum; import com.engine.salary.service.impl.TaxDeclarationApiBillingServiceImpl;
//import com.weaver.hrm.salary.enums.taxdeclaration.EnumDeclareApiBusinessType; import com.engine.salary.util.SalaryDateUtil;
//import com.weaver.hrm.salary.util.SalaryDateUtil; import com.engine.salary.util.SalaryEnumUtil;
//import com.weaver.hrm.salary.util.SalaryEnumUtil; import dm.jdbc.util.IdGenerator;
//import com.weaver.hrm.salary.util.SalaryI18nUtil; import org.apache.commons.lang3.StringUtils;
//import com.weaver.mc.api.entity.*;
//import com.weaver.mc.util.StringUtils; import java.util.Date;
//import com.weaver.teams.domain.EntityType; import java.util.Optional;
// import java.util.concurrent.atomic.AtomicInteger;
//import java.time.LocalDate;
//import java.time.LocalDateTime; /**
//import java.util.*; * @author chengliming
//import java.util.concurrent.atomic.AtomicInteger; * @date 2022-11-16 1:41 PM
// **/
///** public class TaxApiFlowBO {
// * @author chengliming
// * @date 2022-11-16 1:41 PM /**
// **/ * 流量使用情况
//public class TaxApiFlowBO { *
// * @param wrapper 包装类
// /** * @param taxAgentId
// * 流量使用情况 * @param employeeId
// * * @return
// * @param wrapper 包装类 */
// * @param taxAgentId public static TaxDeclarationApiFlowRecordPO buildTaxDeclarationApiFlowRecordPO(TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper wrapper,
// * @param employeeId Long taxAgentId,
// * @return Long employeeId) {
// */ Date now = new Date();
// public static TaxDeclarationApiFlowRecordPO buildTaxDeclarationApiFlowRecordPO(TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper wrapper, return TaxDeclarationApiFlowRecordPO.builder()
// Long taxAgentId, .id(IdGenerator.generate())
// Long employeeId) { .deduct(null)
// return TaxDeclarationApiFlowRecordPO.builder() .businessType(wrapper.getBusinessType().getValue())
// .id(IdGenerator.generate()) .taxMonth(wrapper.getTaxYearMonth())
// .deduct(null) .useTime(now)
// .businessType(wrapper.getBusinessType().getValue()) .createTime(now)
// .taxMonth(wrapper.getTaxYearMonth()) .updateTime(now)
// .useTime(LocalDate.now()) .employeeId(employeeId)
// .createTime(LocalDateTime.now()) .taxAgentId(taxAgentId)
// .updateTime(LocalDateTime.now()) .resultStatus(TaxAgentTaxReturnStatusEnum.SUCCESS.getValue())
// .employeeId(employeeId) .deleteType(DeleteTypeEnum.NOT_DELETED.getValue())
// .taxAgentId(taxAgentId) .tenantKey(wrapper.getTenantKey())
// .resultStatus(TaxAgentTaxReturnStatusEnum.SUCCESS.getValue()) .creator(wrapper.getCurrentEmployeeId())
// .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) .build();
// .tenantKey(wrapper.getTenantKey()) }
// .creator(wrapper.getCurrentEmployeeId())
// .build(); public static TaxDeclarationApiFlowRecordListDTO taxDeclarationApiFlowRecordPo2ListDTO(TaxDeclarationApiBillingServiceImpl.TempPropertiesWrapper propertiesWrapper, AtomicInteger indexNum, TaxDeclarationApiFlowRecordPO e) {
// } String internalUsername = propertiesWrapper.getEmpNameMap().get(e.getEmployeeId());
// String idNo = propertiesWrapper.getEmpIdNoMap().get(e.getEmployeeId());
// public static TaxDeclarationApiFlowRecordListDTO taxDeclarationApiFlowRecordPo2ListDTO(TaxDeclarationApiBillingServiceImpl.TempPropertiesWrapper propertiesWrapper, AtomicInteger indexNum, TaxDeclarationApiFlowRecordPO e) { String externalUsername = propertiesWrapper.getExtEmployeeMap().getOrDefault(e.getEmployeeId(), new ExtEmpPO()).getUsername();
// String internalUsername = propertiesWrapper.getEmpNameMap().get(e.getEmployeeId()); String externalIdNo = propertiesWrapper.getExtEmployeeMap().getOrDefault(e.getEmployeeId(), new ExtEmpPO()).getIdNo();
// String idNo = propertiesWrapper.getEmpIdNoMap().get(e.getEmployeeId()); String creator = propertiesWrapper.getEmpNameMap().get(e.getCreator());
// String externalUsername = propertiesWrapper.getExtEmployeeMap().getOrDefault(e.getEmployeeId(), new ExtEmployeePO()).getUsername(); String taxAgentName = propertiesWrapper.getTaxAgentNameMap().get(e.getTaxAgentId());
// String externalIdNo = propertiesWrapper.getExtEmployeeMap().getOrDefault(e.getEmployeeId(), new ExtEmployeePO()).getCardNum();
// String creator = propertiesWrapper.getEmpNameMap().get(e.getCreator()); boolean isInternal = StringUtils.isNotEmpty(internalUsername);
// String taxAgentName = propertiesWrapper.getTaxAgentNameMap().get(e.getTaxAgentId()); return TaxDeclarationApiFlowRecordListDTO.builder()
// .id(e.getId())
// boolean isInternal = StringUtils.isNotEmpty(internalUsername); .indexNum(indexNum.getAndIncrement())
// return TaxDeclarationApiFlowRecordListDTO.builder() .createTime(SalaryDateUtil.getFormatLocalDate(e.getCreateTime()))
// .id(e.getId()) .taxAgentName(taxAgentName)
// .indexNum(indexNum.getAndIncrement()) .employeeName(isInternal ? internalUsername : externalUsername)
// .createTime(SalaryDateUtil.DATE_TIME_FORMATTER.format(e.getCreateTime())) .employeeType(isInternal ? "inside" : "external")
// .taxAgentName(taxAgentName) .idCardNo(isInternal ? idNo : externalIdNo)
// .employeeName(isInternal ? internalUsername : externalUsername) .employeeId(e.getEmployeeId())
// .employeeType(isInternal ? "inside" : "external") .businessTypeName(SalaryEnumUtil.enumMatchByValue(e.getBusinessType(), EnumDeclareApiBusinessType.class).getDefaultLabel())
// .idCardNo(isInternal ? idNo : externalIdNo) .result(TaxAgentTaxReturnStatusEnum.parseByValue(e.getResultStatus()).getDefaultLabel())
// .employeeId(e.getEmployeeId()) .creator(creator)
// .businessTypeName(SalaryEnumUtil.enumMatchByValue(e.getBusinessType(), EnumDeclareApiBusinessType.class).getDefaultLabel()) .creatorId(e.getCreator())
// .result(TaxAgentTaxReturnStatusEnum.parseByValue(e.getResultStatus()).getDefaultLabel()) .build();
// .creator(creator) }
// .creatorId(e.getCreator())
// .build();
// }
//
// public static SendMessageEntity buildSendMessageEntity(TaxDeclarationApiFlowWarnConfigPO warnConfig, List<UserEntity> receivers, TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper updateWrapper) { // public static SendMessageEntity buildSendMessageEntity(TaxDeclarationApiFlowWarnConfigPO warnConfig, List<UserEntity> receivers, TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper updateWrapper) {
// String title = SalaryI18nUtil.getI18nLabel(160389, "智能算薪流量不足提醒"); // String title = SalaryI18nUtil.getI18nLabel(111, "智能算薪流量不足提醒");
// String desc = String.format(SalaryI18nUtil.getI18nLabel(184069, "智能算薪流量已不足%s请及时采购续费避免次月无法使用。"), warnConfig.getThreshold()); // String desc = String.format(SalaryI18nUtil.getI18nLabel(111, "智能算薪流量已不足%s请及时采购续费避免次月无法使用。"), warnConfig.getThreshold());
// Entity entity = new Entity() // Entity entity = new Entity()
// .setId(IdGenerator.generate() + "") // .setId(IdGenerator.generate() + "")
// .setModule(EntityType.hrmsalary.name()) // .setModule(EntityType.hrmsalary.name())
@ -120,27 +117,27 @@
// smg.setEmailInfo(emailEntity); // smg.setEmailInfo(emailEntity);
// return smg; // return smg;
// } // }
//
// public static TaxDeclarationApiConfigPO buildTaxDeclarationApiConfigPO(TaxDeclarationBillingConfigSaveParam saveParam, public static TaxDeclarationApiConfigPO buildTaxDeclarationApiConfigPO(TaxDeclarationBillingConfigSaveParam saveParam,
// Long currentEmployeeId, Long currentEmployeeId) {
// String currentTenantKey) { Date now = new Date();
// saveParam.setAppKey(Optional.ofNullable(saveParam.getAppKey()).orElse(" ")); saveParam.setAppKey(Optional.ofNullable(saveParam.getAppKey()).orElse(" "));
// saveParam.setAppSecret(Optional.ofNullable(saveParam.getAppSecret()).orElse(" ")); saveParam.setAppSecret(Optional.ofNullable(saveParam.getAppSecret()).orElse(" "));
// return TaxDeclarationApiConfigPO.builder() return TaxDeclarationApiConfigPO.builder()
// .id(IdGenerator.generate()) .id(IdGenerator.generate())
// .appKey(saveParam.getAppKey()) .appKey(saveParam.getAppKey())
// .appSecret(saveParam.getAppSecret()) .appSecret(saveParam.getAppSecret())
// .enableUse(SalaryOnOffEnum.valueOf(saveParam.getEnable()).getValue()) .enableUse(SalaryOnOffEnum.valueOf(saveParam.getEnable()).getValue())
// .createTime(LocalDateTime.now()) .createTime(now)
// .updateTime(LocalDateTime.now()) .updateTime(now)
// .creator(currentEmployeeId) .creator(currentEmployeeId)
// .tenantKey(currentTenantKey) .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY)
// .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) .deleteType(DeleteTypeEnum.NOT_DELETED.getValue())
// .build(); .build();
// } }
//
// @Override @Override
// public String toString() { public String toString() {
// return "TaxApiFlowBO{}"; return "TaxApiFlowBO{}";
// } }
//} }

View File

@ -21,15 +21,15 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor @AllArgsConstructor
@ApiModel("智能算税-流量提醒-创建规则参数") @ApiModel("智能算税-流量提醒-创建规则参数")
public class CreateMessageRuleParamDTO { public class CreateMessageRuleParamDTO {
@ApiModelProperty("模块") //模块")
@JsonSerialize(using = ToStringSerializer.class) @JsonSerialize(using = ToStringSerializer.class)
private Integer moduleId; private Integer moduleId;
@ApiModelProperty("事件") //事件")
@JsonSerialize(using = ToStringSerializer.class) @JsonSerialize(using = ToStringSerializer.class)
private Integer eventId; private Integer eventId;
@ApiModelProperty("业务") //业务")
@JsonSerialize(using = ToStringSerializer.class) @JsonSerialize(using = ToStringSerializer.class)
private Long businessId; private Long businessId;
} }

View File

@ -21,42 +21,42 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor @AllArgsConstructor
@ApiModel("智能算税-流量使用记录") @ApiModel("智能算税-流量使用记录")
public class TaxDeclarationApiFlowRecordListDTO { public class TaxDeclarationApiFlowRecordListDTO {
@ApiModelProperty("id") //id")
@JsonSerialize(using = ToStringSerializer.class) @JsonSerialize(using = ToStringSerializer.class)
private Long id; private Long id;
@ApiModelProperty("序号") //序号")
private Integer indexNum; private Integer indexNum;
@ApiModelProperty("使用时间") //使用时间")
private String createTime; private String createTime;
@ApiModelProperty("个税扣缴义务人") //个税扣缴义务人")
private String taxAgentName; private String taxAgentName;
@ApiModelProperty("人员") //人员")
private String employeeName; private String employeeName;
@ApiModelProperty("人员类型") //人员类型")
private String employeeType; private String employeeType;
@ApiModelProperty("人员id") //人员id")
@JsonSerialize(using = ToStringSerializer.class) @JsonSerialize(using = ToStringSerializer.class)
private Long employeeId; private Long employeeId;
@ApiModelProperty("创建人id") //创建人id")
@JsonSerialize(using = ToStringSerializer.class) @JsonSerialize(using = ToStringSerializer.class)
private Long creatorId; private Long creatorId;
@ApiModelProperty("身份证号码") //身份证号码")
private String idCardNo; private String idCardNo;
@ApiModelProperty("接口业务") //接口业务")
private String businessTypeName; private String businessTypeName;
@ApiModelProperty("操作人") //操作人")
private String creator; private String creator;
@ApiModelProperty("结果") //结果")
private String result; private String result;
} }

View File

@ -22,7 +22,7 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor @AllArgsConstructor
@ApiModel("智能算税-流量统计-月度详情") @ApiModel("智能算税-流量统计-月度详情")
public class TaxDeclarationApiFlowStatisticDetailListDTO { public class TaxDeclarationApiFlowStatisticDetailListDTO {
@ApiModelProperty("id") //id")
@JsonSerialize(using = ToStringSerializer.class) @JsonSerialize(using = ToStringSerializer.class)
private Long id; private Long id;
@ -32,10 +32,10 @@ public class TaxDeclarationApiFlowStatisticDetailListDTO {
@JsonIgnore @JsonIgnore
private String taxAgentName; private String taxAgentName;
@ApiModelProperty("税款所属期") //税款所属期")
private String taxMonth; private String taxMonth;
@ApiModelProperty("月使用流量数") //月使用流量数")
private Integer used; private Integer used;
} }

View File

@ -21,20 +21,20 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor @AllArgsConstructor
@ApiModel("智能算税-流量统计") @ApiModel("智能算税-流量统计")
public class TaxDeclarationApiFlowStatisticListDTO { public class TaxDeclarationApiFlowStatisticListDTO {
@ApiModelProperty("id") //id")
@JsonSerialize(using = ToStringSerializer.class) @JsonSerialize(using = ToStringSerializer.class)
private Long id; private Long id;
@ApiModelProperty("序号") //序号")
private Integer indexNum; private Integer indexNum;
@ApiModelProperty("个税扣缴义务人") //个税扣缴义务人")
private String taxAgentName; private String taxAgentName;
@ApiModelProperty("个税扣缴义务人ID") //个税扣缴义务人ID")
@JsonSerialize(using = ToStringSerializer.class) @JsonSerialize(using = ToStringSerializer.class)
private Long taxAgentId; private Long taxAgentId;
@ApiModelProperty("已使用") //已使用")
private Integer used; private Integer used;
} }

View File

@ -21,18 +21,18 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor @AllArgsConstructor
@ApiModel("智能算税-流量统计") @ApiModel("智能算税-流量统计")
public class TaxDeclarationApiFlowTotalDTO { public class TaxDeclarationApiFlowTotalDTO {
@ApiModelProperty("总流量") //总流量")
@JsonSerialize(using = ToStringSerializer.class) @JsonSerialize(using = ToStringSerializer.class)
private Long total; private Long total;
@ApiModelProperty("剩余流量") //剩余流量")
@JsonSerialize(using = ToStringSerializer.class) @JsonSerialize(using = ToStringSerializer.class)
private Long remain; private Long remain;
@ApiModelProperty("已使用流量") //已使用流量")
@JsonSerialize(using = ToStringSerializer.class) @JsonSerialize(using = ToStringSerializer.class)
private Long used; private Long used;
@ApiModelProperty("最后更新时间") //最后更新时间")
private String lastUpdateTime; private String lastUpdateTime;
} }

View File

@ -22,28 +22,28 @@ import lombok.NoArgsConstructor;
@ApiModel("智能算税-流量不足提醒-表单") @ApiModel("智能算税-流量不足提醒-表单")
public class TaxDeclarationApiFlowWarnConfigFormDTO { public class TaxDeclarationApiFlowWarnConfigFormDTO {
@ApiModelProperty("主键id") //主键id")
@JsonSerialize(using = ToStringSerializer.class) @JsonSerialize(using = ToStringSerializer.class)
private Long id; private Long id;
@ApiModelProperty("提醒开关") //提醒开关")
private Boolean enable; private Boolean enable;
@ApiModelProperty("提醒规则") //提醒规则")
private Integer threshold; private Integer threshold;
@ApiModelProperty("提醒推送方式") //提醒推送方式")
private String config; private String config;
@ApiModelProperty("业务ID") //业务ID")
@JsonSerialize(using = ToStringSerializer.class) @JsonSerialize(using = ToStringSerializer.class)
private Long businessId; private Long businessId;
@ApiModelProperty("模块") //模块")
@JsonSerialize(using = ToStringSerializer.class) @JsonSerialize(using = ToStringSerializer.class)
private String moduleId; private String moduleId;
@ApiModelProperty("事件") //事件")
@JsonSerialize(using = ToStringSerializer.class) @JsonSerialize(using = ToStringSerializer.class)
private String eventId; private String eventId;
} }

View File

@ -26,20 +26,20 @@ import java.util.List;
@ApiModel("智能算税-流量不足提醒对象-表单") @ApiModel("智能算税-流量不足提醒对象-表单")
public class TaxDeclarationApiFlowWarnReceiverFormDTO { public class TaxDeclarationApiFlowWarnReceiverFormDTO {
@ApiModelProperty("主键id") //主键id")
@JsonSerialize(using = ToStringSerializer.class) @JsonSerialize(using = ToStringSerializer.class)
private Long id; private Long id;
@ApiModelProperty("提醒对象") //提醒对象")
private List<OptionDTO> employee; private List<OptionDTO> employee;
@ApiModelProperty("手机号") //手机号")
private String mobile; private String mobile;
@ApiModelProperty("邮箱列表") //邮箱列表")
private String email; private String email;
@ApiModelProperty("邮箱列表下拉框") //邮箱列表下拉框")
@JsonIgnore @JsonIgnore
private List<String> emailOptions; private List<String> emailOptions;
} }

View File

@ -23,20 +23,20 @@ import net.minidev.json.annotate.JsonIgnore;
@ApiModel("智能算税-流量提醒对象") @ApiModel("智能算税-流量提醒对象")
public class TaxDeclarationApiFlowWarnReceiverListDTO { public class TaxDeclarationApiFlowWarnReceiverListDTO {
@ApiModelProperty("id") //id")
@JsonSerialize(using = ToStringSerializer.class) @JsonSerialize(using = ToStringSerializer.class)
private Long id; private Long id;
@ApiModelProperty("提醒对象") //提醒对象")
private String employeeName; private String employeeName;
@JsonIgnore @JsonIgnore
@JsonSerialize(using = ToStringSerializer.class) @JsonSerialize(using = ToStringSerializer.class)
private Long employeeId; private Long employeeId;
@ApiModelProperty("手机号") //手机号")
private String mobile; private String mobile;
@ApiModelProperty("邮箱") //邮箱")
private String email; private String email;
} }

View File

@ -22,16 +22,16 @@ import lombok.NoArgsConstructor;
@ApiModel("智能算税-启用设置-表单") @ApiModel("智能算税-启用设置-表单")
public class TaxDeclarationBillingConfigFormDTO { public class TaxDeclarationBillingConfigFormDTO {
@ApiModelProperty("主键id") //主键id")
@JsonSerialize(using = ToStringSerializer.class) @JsonSerialize(using = ToStringSerializer.class)
private Long id; private Long id;
@ApiModelProperty("appKey") //appKey")
private String appKey; private String appKey;
@ApiModelProperty("appSecret") //appSecret")
private String appSecret; private String appSecret;
@ApiModelProperty("智能算薪开关") //智能算薪开关")
private Boolean enable; private Boolean enable;
} }

View File

@ -13,11 +13,11 @@ import javax.validation.constraints.NotNull;
**/ **/
@Data @Data
public class CreateMessageRuleParam { public class CreateMessageRuleParam {
@ApiModelProperty("业务ID") //业务ID")
@NotNull(message = "业务ID不能为空") @NotNull(message = "业务ID不能为空")
private String businessId; private String businessId;
@ApiModelProperty("详细规则") //详细规则")
@NotNull(message = "详细规则不能为空") @NotNull(message = "详细规则不能为空")
private String config; private String config;
} }

View File

@ -24,14 +24,14 @@ import java.time.YearMonth;
@ApiModel("流量月度详情查询参数") @ApiModel("流量月度详情查询参数")
public class TaxDeclarationApiFlowMonthQueryParam extends BaseQueryParam { public class TaxDeclarationApiFlowMonthQueryParam extends BaseQueryParam {
@ApiModelProperty("个税扣缴义务人id") //个税扣缴义务人id")
@NotNull(message = "个税扣缴义务人不能为空") @NotNull(message = "个税扣缴义务人不能为空")
private Long taxAgentId; private Long taxAgentId;
@ApiModelProperty("税款所属期开始时间") //税款所属期开始时间")
private YearMonth startTaxMonth; private YearMonth startTaxMonth;
@ApiModelProperty("税款所属期结束时间") //税款所属期结束时间")
private YearMonth endTaxMonth; private YearMonth endTaxMonth;
public Integer getStartTaxMonth() { public Integer getStartTaxMonth() {

View File

@ -23,18 +23,18 @@ import java.time.LocalDate;
@ApiModel("流量月度详情查询参数") @ApiModel("流量月度详情查询参数")
public class TaxDeclarationApiFlowRecordQueryParam extends BaseQueryParam { public class TaxDeclarationApiFlowRecordQueryParam extends BaseQueryParam {
@ApiModelProperty("个税扣缴义务人id") //个税扣缴义务人id")
private Long taxAgentId; private Long taxAgentId;
@ApiModelProperty("开始时间") //开始时间")
private LocalDate startDate; private LocalDate startDate;
@ApiModelProperty("结束时间") //结束时间")
private LocalDate endDate; private LocalDate endDate;
@ApiModelProperty("业务接口类型") //业务接口类型")
private Integer businessType; private Integer businessType;
@ApiModelProperty("结果") //结果")
private Integer result; private Integer result;
} }

View File

@ -21,20 +21,20 @@ import javax.validation.constraints.NotNull;
@AllArgsConstructor @AllArgsConstructor
@ApiModel("流量不足提醒规则创建") @ApiModel("流量不足提醒规则创建")
public class TaxDeclarationApiFlowWarnConfigSaveParam { public class TaxDeclarationApiFlowWarnConfigSaveParam {
@ApiModelProperty("提醒对象Id") //提醒对象Id")
private Long id; private Long id;
@ApiModelProperty("提醒阈值") //提醒阈值")
@NotNull(message = "提醒规则不能为空") @NotNull(message = "提醒规则不能为空")
private Long threshold; private Long threshold;
@ApiModelProperty("提醒开关是否打开") //提醒开关是否打开")
private Boolean enable; private Boolean enable;
@ApiModelProperty("业务ID") //业务ID")
@NotNull(message = "推送方式不能为空") @NotNull(message = "推送方式不能为空")
private Long businessId; private Long businessId;
@ApiModelProperty("规则") //规则")
private String config; private String config;
} }

View File

@ -19,18 +19,18 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor @AllArgsConstructor
@ApiModel("流量不足提醒对象") @ApiModel("流量不足提醒对象")
public class TaxDeclarationApiFlowWarnReceiverSaveParam { public class TaxDeclarationApiFlowWarnReceiverSaveParam {
@ApiModelProperty("提醒对象Id") //提醒对象Id")
private Long id; private Long id;
@ApiModelProperty("提醒配置Id") //提醒配置Id")
private Long warnConfigId; private Long warnConfigId;
@ApiModelProperty("人员Id") //人员Id")
private Long employeeId; private Long employeeId;
@ApiModelProperty("邮箱") //邮箱")
private String email; private String email;
@ApiModelProperty("手机号") //手机号")
private String mobile; private String mobile;
} }

View File

@ -20,16 +20,16 @@ import lombok.NoArgsConstructor;
@ApiModel("智能算薪配置参数") @ApiModel("智能算薪配置参数")
public class TaxDeclarationBillingConfigSaveParam { public class TaxDeclarationBillingConfigSaveParam {
@ApiModelProperty("appKey") //appKey")
private String appKey; private String appKey;
@ApiModelProperty("appSecret") //appSecret")
private String appSecret; private String appSecret;
@ApiModelProperty("enable") //enable")
private String enable; private String enable;
@ApiModelProperty("配置ID") //配置ID")
private Long configId; private Long configId;
} }

View File

@ -6,7 +6,7 @@ import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import java.io.Serializable; import java.io.Serializable;
import java.time.LocalDateTime; import java.util.Date;
/** /**
* 流量不足提醒对象 * 流量不足提醒对象
@ -52,12 +52,12 @@ public class TaxDeclarationApiFlowWarnReceiverPO implements Serializable {
/** /**
* 创建时间 * 创建时间
*/ */
private LocalDateTime createTime; private Date createTime;
/** /**
* 更新时间 * 更新时间
*/ */
private LocalDateTime updateTime; private Date updateTime;
/** /**
* 创建人 * 创建人

View File

@ -18,32 +18,32 @@ import lombok.experimental.Accessors;
@Accessors(chain = true) @Accessors(chain = true)
public class AbnormalEmployeeListDTO { public class AbnormalEmployeeListDTO {
@ApiModelProperty("主键id") //主键id")
@JsonSerialize(using = ToStringSerializer.class) @JsonSerialize(using = ToStringSerializer.class)
private Long id; private Long id;
@ApiModelProperty("关联人员类型") //关联人员类型")
private Integer employeeType; private Integer employeeType;
@ApiModelProperty("关联人员id") //关联人员id")
@JsonSerialize(using = ToStringSerializer.class) @JsonSerialize(using = ToStringSerializer.class)
private Long employeeId; private Long employeeId;
@ApiModelProperty("姓名") //姓名")
private String employeeName; private String employeeName;
@ApiModelProperty("工号") //工号")
private String jobNum; private String jobNum;
@ApiModelProperty("证件类型") //证件类型")
private String cardType; private String cardType;
@ApiModelProperty("证件号码") //证件号码")
private String cardNum; private String cardNum;
@ApiModelProperty("报送状态") //报送状态")
private DeclareStatusEnum declareStatus; private DeclareStatusEnum declareStatus;
@ApiModelProperty("报送状态") //报送状态")
private String declareStatusDesc; private String declareStatusDesc;
} }

View File

@ -17,26 +17,26 @@ import lombok.experimental.Accessors;
@Accessors(chain = true) @Accessors(chain = true)
public class FailEmployeeListDTO { public class FailEmployeeListDTO {
@ApiModelProperty("主键id") //主键id")
@JsonSerialize(using = ToStringSerializer.class) @JsonSerialize(using = ToStringSerializer.class)
private Long id; private Long id;
@ApiModelProperty("姓名") //姓名")
private String employeeName; private String employeeName;
@ApiModelProperty("个税扣缴义务人id") //个税扣缴义务人id")
@JsonSerialize(using = ToStringSerializer.class) @JsonSerialize(using = ToStringSerializer.class)
private Long taxAgentId; private Long taxAgentId;
@ApiModelProperty("个税扣缴义务人名称") //个税扣缴义务人名称")
private String taxAgentName; private String taxAgentName;
@ApiModelProperty("证件号码") //证件号码")
private String cardNum; private String cardNum;
@ApiModelProperty("失败原因") //失败原因")
private String errorMsg; private String errorMsg;
@ApiModelProperty("所得项目") //所得项目")
private String incomeCategory; private String incomeCategory;
} }

View File

@ -19,15 +19,15 @@ public class TaxDeclarationRateDTO implements Serializable {
private static final long serialVersionUID = 8478996890743085394L; private static final long serialVersionUID = 8478996890743085394L;
@ApiModelProperty("缓存索引") //缓存索引")
private String index; private String index;
@ApiModelProperty("提示信息") //提示信息")
private String msg; private String msg;
@ApiModelProperty("状态") //状态")
private boolean status; private boolean status;
@ApiModelProperty("是否已经完成") //是否已经完成")
private boolean finish; private boolean finish;
@ApiModelProperty("提示信息是否自动消失") //提示信息是否自动消失")
private boolean msgPersist; private boolean msgPersist;
} }

View File

@ -18,13 +18,13 @@ import lombok.experimental.Accessors;
@Accessors(chain = true) @Accessors(chain = true)
public class TaxDeclarationTabDTO { public class TaxDeclarationTabDTO {
@ApiModelProperty("Tab页签的名称") //Tab页签的名称")
private String tabName; private String tabName;
@ApiModelProperty("收入所得类型") //收入所得类型")
private IncomeCategoryEnum incomeCategory; private IncomeCategoryEnum incomeCategory;
@ApiModelProperty("个税申报表id") //个税申报表id")
@JsonSerialize(using = ToStringSerializer.class) @JsonSerialize(using = ToStringSerializer.class)
private Long taxDeclarationId; private Long taxDeclarationId;
} }

View File

@ -26,15 +26,15 @@ import java.util.Map;
@ApiModel("个税申报记录表单") @ApiModel("个税申报记录表单")
public class TaxDeclareRecordFormDTO { public class TaxDeclareRecordFormDTO {
@ApiModelProperty("薪资所属月") //薪资所属月")
private YearMonth salaryMonth; private YearMonth salaryMonth;
@ApiModelProperty("个税扣缴义务人范围") //个税扣缴义务人范围")
private TaxAgentRangeEnum taxAgentRange; private TaxAgentRangeEnum taxAgentRange;
@ApiModelProperty("个税扣缴义务人id") //个税扣缴义务人id")
private List<Map<String, Object>> taxAgentIds; private List<Map<String, Object>> taxAgentIds;
@ApiModelProperty("备注") //备注")
private String description; private String description;
} }

View File

@ -22,47 +22,47 @@ public class TaxDeclareRecordListDTO {
@JsonSerialize(using = ToStringSerializer.class) @JsonSerialize(using = ToStringSerializer.class)
private Long id; private Long id;
@ApiModelProperty("个税扣缴义务人") //个税扣缴义务人")
@JsonSerialize(using = ToStringSerializer.class) @JsonSerialize(using = ToStringSerializer.class)
private Long taxAgentId; private Long taxAgentId;
@ApiModelProperty("个税扣缴义务人名称") //个税扣缴义务人名称")
private String taxAgentName; private String taxAgentName;
@ApiModelProperty("薪资所属月") //薪资所属月")
private String salaryMonth; private String salaryMonth;
@ApiModelProperty("税款所属期") //税款所属期")
private String taxCycle; private String taxCycle;
@ApiModelProperty("申报类型") //申报类型")
private TaxDeclareTypeEnum taxDeclareType; private TaxDeclareTypeEnum taxDeclareType;
@ApiModelProperty("申报类型") //申报类型")
private String taxDeclareTypeDesc; private String taxDeclareTypeDesc;
@ApiModelProperty("申报状态") //申报状态")
private TaxDeclareStatusEnum taxDeclareStatus; private TaxDeclareStatusEnum taxDeclareStatus;
@ApiModelProperty("申报状态") //申报状态")
private String taxDeclareStatusDesc; private String taxDeclareStatusDesc;
@ApiModelProperty("已缴金额") //已缴金额")
private String taxPaidAmount; private String taxPaidAmount;
@ApiModelProperty("操作人id") //操作人id")
@JsonSerialize(using = ToStringSerializer.class) @JsonSerialize(using = ToStringSerializer.class)
private Long operateEmployeeId; private Long operateEmployeeId;
@ApiModelProperty("操作人名称") //操作人名称")
private String operateEmployeeName; private String operateEmployeeName;
@ApiModelProperty("操作时间") //操作时间")
private String operateTime; private String operateTime;
@ApiModelProperty("备注") //备注")
private String description; private String description;
@ApiModelProperty("是否展示图标") //是否展示图标")
private boolean displayIcon; private boolean displayIcon;
} }

View File

@ -17,17 +17,17 @@ import lombok.experimental.Accessors;
@Accessors(chain = true) @Accessors(chain = true)
public class AbnormalEmployeeListQueryParam extends BaseQueryParam { public class AbnormalEmployeeListQueryParam extends BaseQueryParam {
@ApiModelProperty("工号、姓名、身份证号码") //工号姓名身份证号码")
private String keyword; private String keyword;
@ApiModelProperty("个税申报记录id") //个税申报记录id")
private Long taxDeclareRecordId; private Long taxDeclareRecordId;
@JsonIgnore @JsonIgnore
@ApiModelProperty("个税扣缴义务人id") //个税扣缴义务人id")
private Long taxAgentId; private Long taxAgentId;
@JsonIgnore @JsonIgnore
@ApiModelProperty("税款所属期") //税款所属期")
private String taxCycle; private String taxCycle;
} }

View File

@ -17,15 +17,15 @@ import lombok.Data;
@ApiModel("个税申报表记录列表查询参数") @ApiModel("个税申报表记录列表查询参数")
public class TaxDeclarationValueListQueryParam extends BaseQueryParam { public class TaxDeclarationValueListQueryParam extends BaseQueryParam {
@ApiModelProperty("个税申报记录id") //个税申报记录id")
private Long taxDeclareRecordId; private Long taxDeclareRecordId;
@ApiModelProperty("个税申报表id") //个税申报表id")
private Long taxDeclarationId; private Long taxDeclarationId;
@ApiModelProperty("收入所得项目") //收入所得项目")
private IncomeCategoryEnum incomeCategory; private IncomeCategoryEnum incomeCategory;
@ApiModelProperty("导出excel时加密的密码") //导出excel时加密的密码")
private String sharePassword; private String sharePassword;
} }

View File

@ -13,6 +13,6 @@ import lombok.Data;
@Data @Data
public class TaxDeclareRecordParam { public class TaxDeclareRecordParam {
@ApiModelProperty("个税申报记录id") //个税申报记录id")
private Long taxDeclareRecordId; private Long taxDeclareRecordId;
} }

View File

@ -7,7 +7,7 @@ import lombok.NoArgsConstructor;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import java.io.Serializable; import java.io.Serializable;
import java.time.LocalDateTime; import java.util.Date;
/** /**
* 个税申报相关api配置 * 个税申报相关api配置
@ -61,7 +61,7 @@ public class TaxDeclarationApiConfigPO implements Serializable {
/** /**
* 流量最后更新时间 * 流量最后更新时间
*/ */
private LocalDateTime lastUpdateTime; private Date lastUpdateTime;
/** /**
* 租户key * 租户key
@ -81,10 +81,10 @@ public class TaxDeclarationApiConfigPO implements Serializable {
/** /**
* 创建时间 * 创建时间
*/ */
private LocalDateTime createTime; private Date createTime;
/** /**
* 更新时间 * 更新时间
*/ */
private LocalDateTime updateTime; private Date updateTime;
} }

View File

@ -8,7 +8,7 @@ import lombok.NoArgsConstructor;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import java.io.Serializable; import java.io.Serializable;
import java.time.LocalDateTime; import java.util.Date;
/** /**
* 个税申报相关api配置 * 个税申报相关api配置
@ -56,10 +56,10 @@ public class TaxDeclarationApiProfilePO implements Serializable {
/** /**
* 创建时间 * 创建时间
*/ */
private LocalDateTime createTime; private Date createTime;
/** /**
* 更新时间 * 更新时间
*/ */
private LocalDateTime updateTime; private Date updateTime;
} }

View File

@ -4,7 +4,7 @@ import lombok.Data;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import java.io.Serializable; import java.io.Serializable;
import java.time.LocalDateTime; import java.util.Date;
import java.util.Map; import java.util.Map;
/** /**
@ -71,10 +71,10 @@ public class TaxDeclarationValuePO implements Serializable {
/** /**
* 创建时间 * 创建时间
*/ */
private LocalDateTime createTime; private Date createTime;
/** /**
* 更新时间 * 更新时间
*/ */
private LocalDateTime updateTime; private Date updateTime;
} }

View File

@ -13,9 +13,9 @@ import lombok.Data;
@Data @Data
public class TaxDeclareEmployeePO { public class TaxDeclareEmployeePO {
@ApiModelProperty("人员id") //人员id")
private Long employeeId; private Long employeeId;
@ApiModelProperty("人员类型") //人员类型")
private Integer employeeType; private Integer employeeType;
} }

View File

@ -4,7 +4,7 @@ import lombok.Data;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import java.io.Serializable; import java.io.Serializable;
import java.time.LocalDateTime; import java.util.Date;
/** /**
* @description: 个税申报 * @description: 个税申报
@ -102,10 +102,10 @@ public class TaxDeclareRecordPO implements Serializable {
* 创建时间 * 创建时间
*/ */
//创建时间", ignore = true) //创建时间", ignore = true)
private LocalDateTime createTime; private Date createTime;
/** /**
* 更新时间 * 更新时间
*/ */
//更新时间", ignore = true) //更新时间", ignore = true)
private LocalDateTime updateTime; private Date updateTime;
} }

View File

@ -2,7 +2,7 @@ package com.engine.salary.entity.taxdeclaration.po;
import lombok.Data; import lombok.Data;
import java.time.LocalDateTime; import java.util.Date;
/** /**
* @description: 个税申报表表头 * @description: 个税申报表表头
@ -39,7 +39,7 @@ public class TaxReportColumnPO {
//name = "是否删除", ignore = true) //name = "是否删除", ignore = true)
private Integer deleteType; private Integer deleteType;
//name = "创建时间", ignore = true) //name = "创建时间", ignore = true)
private LocalDateTime createTime; private Date createTime;
//name = "更新时间", ignore = true) //name = "更新时间", ignore = true)
private LocalDateTime updateTime; private Date updateTime;
} }

View File

@ -16,9 +16,9 @@ import java.util.Map;
@Data @Data
public class CancelDeclareFeedbackResponse { public class CancelDeclareFeedbackResponse {
@ApiModelProperty("接口状态") //接口状态")
private SzyhResponseHead head; private SzyhResponseHead head;
@ApiModelProperty("接口状态") //接口状态")
private Map<String, Object> body; private Map<String, Object> body;
} }

View File

@ -15,9 +15,9 @@ import lombok.Data;
@Data @Data
public class CancelDeclareResponse { public class CancelDeclareResponse {
@ApiModelProperty("接口状态") //接口状态")
private SzyhResponseHead head; private SzyhResponseHead head;
@ApiModelProperty("接口数据") //接口数据")
private AsyncRequestIdDTO body; private AsyncRequestIdDTO body;
} }

View File

@ -16,9 +16,9 @@ import java.util.Map;
@Data @Data
public class DeclareTaxFeedbackResponse { public class DeclareTaxFeedbackResponse {
@ApiModelProperty("接口状态") //接口状态")
private SzyhResponseHead head; private SzyhResponseHead head;
@ApiModelProperty("接口状态") //接口状态")
private Map<String, Object> body; private Map<String, Object> body;
} }

View File

@ -15,9 +15,9 @@ import lombok.Data;
@Data @Data
public class DeclareTaxResponse { public class DeclareTaxResponse {
@ApiModelProperty("接口状态") //接口状态")
private SzyhResponseHead head; private SzyhResponseHead head;
@ApiModelProperty("接口数据") //接口数据")
private AsyncRequestIdDTO body; private AsyncRequestIdDTO body;
} }

View File

@ -16,6 +16,6 @@ import lombok.Data;
@ApiModel("更正申报的返回数据") @ApiModel("更正申报的返回数据")
public class UpdateDeclareResponse { public class UpdateDeclareResponse {
@ApiModelProperty("接口状态") //接口状态")
private SzyhResponseHead head; private SzyhResponseHead head;
} }

View File

@ -21,9 +21,9 @@ import lombok.NoArgsConstructor;
public class TaxAgreementBankFormDTO { public class TaxAgreementBankFormDTO {
@ApiModelProperty("开户行") //开户行")
private String bank; private String bank;
@ApiModelProperty("开户账号") //开户账号")
private String bankNo; private String bankNo;
} }

View File

@ -22,12 +22,12 @@ import lombok.experimental.Accessors;
@AllArgsConstructor @AllArgsConstructor
@ApiModel("获取三方查询反馈结果") @ApiModel("获取三方查询反馈结果")
public class TaxAgreementFeedbackResultDTO extends TaxFeedbackResultDTO { public class TaxAgreementFeedbackResultDTO extends TaxFeedbackResultDTO {
@ApiModelProperty("实缴金额") //实缴金额")
private String payAmount; private String payAmount;
@ApiModelProperty("滞纳金等金额") //滞纳金等金额")
private String otherAmount; private String otherAmount;
@ApiModelProperty("申报人数") //申报人数")
private String personNum; private String personNum;
} }

View File

@ -31,7 +31,7 @@
// @SalaryFormItem(itemType = WeaFormItemType.INPUT, maxLength = "50", readOnly = true) // @SalaryFormItem(itemType = WeaFormItemType.INPUT, maxLength = "50", readOnly = true)
// } // }
// ) // )
// @ApiModelProperty("个税扣缴义务人") // //个税扣缴义务人")
// private String taxAgent; // private String taxAgent;
// //
// @SalaryForm( // @SalaryForm(
@ -42,7 +42,7 @@
// @SalaryFormItem(itemType = WeaFormItemType.INPUT, maxLength = "50", readOnly = true) // @SalaryFormItem(itemType = WeaFormItemType.INPUT, maxLength = "50", readOnly = true)
// } // }
// ) // )
// @ApiModelProperty("应缴金额") // //应缴金额")
// private String amount; // private String amount;
// //
// @SalaryForm( // @SalaryForm(
@ -53,6 +53,6 @@
// @SalaryFormItem(itemType = WeaFormItemType.INPUT, maxLength = "50", readOnly = true) // @SalaryFormItem(itemType = WeaFormItemType.INPUT, maxLength = "50", readOnly = true)
// } // }
// ) // )
// @ApiModelProperty("申报人数") // //申报人数")
// private String personNum; // private String personNum;
//} //}

View File

@ -20,15 +20,15 @@ import lombok.experimental.Accessors;
@AllArgsConstructor @AllArgsConstructor
@ApiModel("获取反馈结果") @ApiModel("获取反馈结果")
public class TaxFeedbackResultDTO { public class TaxFeedbackResultDTO {
@ApiModelProperty("请求id") //请求id")
private String requestId; private String requestId;
@ApiModelProperty("提示语") //提示语")
private String msg; private String msg;
@ApiModelProperty("处理结果") //处理结果")
private String result; private String result;
@ApiModelProperty("是否结束轮询") //是否结束轮询")
private Boolean finish; private Boolean finish;
} }

View File

@ -20,7 +20,7 @@ import lombok.NoArgsConstructor;
@ApiModel("查询缴费信息") @ApiModel("查询缴费信息")
public class TaxPayTypeFormDTO { public class TaxPayTypeFormDTO {
@ApiModelProperty("缴款方式") //缴款方式")
private String type; private String type;
} }

View File

@ -24,16 +24,16 @@ import java.util.List;
@AllArgsConstructor @AllArgsConstructor
@ApiModel("获取完税证明") @ApiModel("获取完税证明")
public class TaxWithheldVoucherResultDTO extends TaxFeedbackResultDTO { public class TaxWithheldVoucherResultDTO extends TaxFeedbackResultDTO {
@ApiModelProperty("完税证明") //完税证明")
private List<Voucher> vouchers; private List<Voucher> vouchers;
@Data @Data
@AllArgsConstructor @AllArgsConstructor
public static class Voucher { public static class Voucher {
@ApiModelProperty("名称") //名称")
private String name; private String name;
@ApiModelProperty("内容") //内容")
private String content; private String content;
} }
} }

View File

@ -20,27 +20,27 @@ import java.time.YearMonth;
@ApiModel("查询企业三方信息") @ApiModel("查询企业三方信息")
public class TaxPaymentQueryParam { public class TaxPaymentQueryParam {
@ApiModelProperty("个税扣缴义务人id") //个税扣缴义务人id")
private Long taxAgentId; private Long taxAgentId;
@ApiModelProperty("税款所属期") //税款所属期")
private YearMonth taxYearMonth; private YearMonth taxYearMonth;
@ApiModelProperty("个税申报记录id") //个税申报记录id")
private Long taxDeclareRecordId; private Long taxDeclareRecordId;
/** /**
* TaxPaymentServiceTypeEnum * TaxPaymentServiceTypeEnum
*/ */
@ApiModelProperty("业务类型") //业务类型")
private Integer type; private Integer type;
@ApiModelProperty("三方协议号") //三方协议号")
private String protocolNumber; private String protocolNumber;
@ApiModelProperty("应缴税额") //应缴税额")
private String taxAmount; private String taxAmount;
@ApiModelProperty("是否为反馈校验 0否 1是") //是否为反馈校验 0否 1是")
private Integer checkFeedback; private Integer checkFeedback;
} }

View File

@ -7,7 +7,7 @@ import lombok.NoArgsConstructor;
import java.io.Serializable; import java.io.Serializable;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.LocalDateTime; import java.util.Date;
/** /**
* 个税辅助缴款-三方缴款请求 * 个税辅助缴款-三方缴款请求
@ -93,11 +93,11 @@ public class TaxPaymentRequestPO implements Serializable {
* 创建时间 * 创建时间
*/ */
//创建时间", ignore = true) //创建时间", ignore = true)
private LocalDateTime createTime; private Date createTime;
/** /**
* 更新时间 * 更新时间
*/ */
//更新时间", ignore = true) //更新时间", ignore = true)
private LocalDateTime updateTime; private Date updateTime;
} }

View File

@ -0,0 +1,21 @@
package com.engine.salary.service;
import com.engine.salary.entity.employeedeclare.po.EmployeeDeclareRecordPO;
import java.time.YearMonth;
/**
* @description: 员工报送记录
* @author: xiajun
* @modified By: xiajun
* @date: 2022/11/6 16:54
* @version:v1.0
*/
public interface EmployeeDeclareRecordService {
EmployeeDeclareRecordPO getByTaxCycleAndTaxAgentId(YearMonth taxCycle, Long taxAgentId);
void deleteByTaxCycleAndTaxAgentId(YearMonth taxCycle, Long taxAgentId);
void save(EmployeeDeclareRecordPO employeeDeclareRecord);
}

View File

@ -3,6 +3,7 @@ package com.engine.salary.service;
import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareFailListDTO; import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareFailListDTO;
import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareInfoDTO; import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareInfoDTO;
import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareListDTO; import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareListDTO;
import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareRateDTO;
import com.engine.salary.entity.employeedeclare.param.*; import com.engine.salary.entity.employeedeclare.param.*;
import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO;
import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.PageInfo;
@ -111,10 +112,8 @@ public interface EmployeeDeclareService{
* 保存 * 保存
* *
* @param saveParam * @param saveParam
* @param employeeId
* @param tenantKey
*/ */
// void save(EmployeeDeclareSaveParam saveParam, Long employeeId); void save(EmployeeDeclareSaveParam saveParam);
/** /**
* 批量编辑 * 批量编辑
@ -168,15 +167,13 @@ public interface EmployeeDeclareService{
* 报送人员 * 报送人员
* *
* @param param * @param param
* @param tenantKey
*/ */
// void declare(EmployeeDeclareParam param, Long employeeId); void declare(EmployeeDeclareParam param);
/** /**
* 获取报送人员的反馈 * 获取报送人员的反馈
* *
* @param param * @param param
* @param tenantKey
*/ */
// void getDeclareFeedback(EmployeeDeclareParam param, EmployeeDeclareRateDTO employeeDeclareRate, Long employeeId); void getDeclareFeedback(EmployeeDeclareParam param, EmployeeDeclareRateDTO employeeDeclareRate);
} }

View File

@ -1,12 +1,6 @@
package com.engine.salary.service; package com.engine.salary.service;
import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowRecordListDTO;
import com.engine.salary.entity.taxapiflow.param.TaxDeclarationApiFlowRecordQueryParam;
import com.engine.salary.service.impl.TaxDeclarationApiBillingServiceImpl; import com.engine.salary.service.impl.TaxDeclarationApiBillingServiceImpl;
import com.engine.salary.util.page.PageInfo;
import java.util.List;
import java.util.Map;
/** /**
* 个税申报计费service * 个税申报计费service
@ -23,21 +17,21 @@ public interface TaxDeclarationApiBillingService {
*/ */
void updateApiFlowInfo(TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper updateWrapper); void updateApiFlowInfo(TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper updateWrapper);
/** // /**
* 获取流量使用记录(分页) // * 获取流量使用记录(分页)
* // *
* @param queryParam // * @param queryParam
* @return // * @return
*/ // */
PageInfo<TaxDeclarationApiFlowRecordListDTO> pageFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam); // PageInfo<TaxDeclarationApiFlowRecordListDTO> pageFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam);
//
/** // /**
* 获取流量使用记录不分页 // * 获取流量使用记录不分页
* // *
* @param queryParam // * @param queryParam
* @return // * @return
*/ // */
List<TaxDeclarationApiFlowRecordListDTO> listFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam); // List<TaxDeclarationApiFlowRecordListDTO> listFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam);
/** /**
* 导出流量使用记录 * 导出流量使用记录
@ -45,6 +39,6 @@ public interface TaxDeclarationApiBillingService {
* @param queryParam * @param queryParam
* @param map * @param map
*/ */
void exportFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam, Map<String, Object> map); // void exportFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam, Map<String, Object> map);
} }

View File

@ -0,0 +1,46 @@
package com.engine.salary.service.impl;
import com.engine.core.impl.Service;
import com.engine.salary.entity.employeedeclare.po.EmployeeDeclareRecordPO;
import com.engine.salary.service.EmployeeDeclareRecordService;
import java.time.YearMonth;
/**
* @description: 员工报送记录
* @author: xiajun
* @modified By: xiajun
* @date: 2022/11/6 16:55
* @version:v1.0
*/
public class EmployeeDeclareRecordServiceImpl extends Service implements EmployeeDeclareRecordService {
@Override
public EmployeeDeclareRecordPO getByTaxCycleAndTaxAgentId(YearMonth taxCycle, Long taxAgentId) {
// return new LambdaQueryChainWrapper<>(baseMapper)
// .eq(EmployeeDeclareRecordPO::getTenantKey, tenantKey)
// .eq(EmployeeDeclareRecordPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue())
// .eq(EmployeeDeclareRecordPO::getTaxCycle, taxCycle.toString())
// .eq(EmployeeDeclareRecordPO::getTaxAgentId, taxAgentId)
// .one();
return null;
}
@Override
public void deleteByTaxCycleAndTaxAgentId(YearMonth taxCycle, Long taxAgentId) {
// new LambdaUpdateChainWrapper<>(baseMapper)
// .eq(EmployeeDeclareRecordPO::getTenantKey, tenantKey)
// .eq(EmployeeDeclareRecordPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue())
// .eq(EmployeeDeclareRecordPO::getTaxCycle, taxCycle.toString())
// .eq(EmployeeDeclareRecordPO::getTaxAgentId, taxAgentId)
// .set(EmployeeDeclareRecordPO::getDeleteType, DeleteTypeEnum.DELETED.getValue())
// .set(EmployeeDeclareRecordPO::getUpdateTime, LocalDateTime.now())
// .update();
}
@Override
public void save(EmployeeDeclareRecordPO employeeDeclareRecord) {
}
}

View File

@ -1,42 +1,57 @@
package com.engine.salary.service.impl; package com.engine.salary.service.impl;
import cn.hutool.core.map.MapUtil;
import com.engine.common.util.ServiceUtil; import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service; import com.engine.core.impl.Service;
import com.engine.salary.common.LocalDateRange; import com.engine.salary.common.LocalDateRange;
import com.engine.salary.common.taxdeclare.AsyncRequestIdDTO;
import com.engine.salary.constant.SalaryDefaultTenantConstant;
import com.engine.salary.constant.SzyhApiConstant;
import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.datacollection.DataCollectionEmployee;
import com.engine.salary.entity.employeedeclare.bo.EmployeeDeclareList; import com.engine.salary.entity.employeedeclare.bo.EmployeeDeclareList;
import com.engine.salary.entity.employeedeclare.bo.EmployeeDeclareRefresh; import com.engine.salary.entity.employeedeclare.bo.EmployeeDeclareRefresh;
import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareFailListDTO; import com.engine.salary.entity.employeedeclare.bo.EmployeeDeclareRequest;
import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareInfoDTO; import com.engine.salary.entity.employeedeclare.dto.*;
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.param.*;
import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO;
import com.engine.salary.entity.employeedeclare.po.EmployeeDeclareRecordPO;
import com.engine.salary.entity.employeedeclare.response.DeclareEmployeeFeedbackResponse;
import com.engine.salary.entity.employeedeclare.response.DeclareEmployeeInfoResponse;
import com.engine.salary.entity.salaryarchive.dto.SalaryArchiveDataDTO; import com.engine.salary.entity.salaryarchive.dto.SalaryArchiveDataDTO;
import com.engine.salary.entity.salaryarchive.po.SalaryArchivePO; import com.engine.salary.entity.salaryarchive.po.SalaryArchivePO;
import com.engine.salary.entity.taxagent.bo.TaxAgentTaxReturnBO;
import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.entity.taxagent.po.TaxAgentPO;
import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO;
import com.engine.salary.entity.taxapiflow.bo.TaxApiFlowBO;
import com.engine.salary.entity.taxapiflow.po.TaxDeclarationApiFlowRecordPO;
import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO;
import com.engine.salary.enums.SalaryCycleTypeEnum; import com.engine.salary.enums.SalaryCycleTypeEnum;
import com.engine.salary.enums.employeedeclare.CardTypeEnum;
import com.engine.salary.enums.employeedeclare.DeclareStatusEnum; import com.engine.salary.enums.employeedeclare.DeclareStatusEnum;
import com.engine.salary.enums.employeedeclare.EmploymentStatusEnum; import com.engine.salary.enums.employeedeclare.EmploymentStatusEnum;
import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum; import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum;
import com.engine.salary.enums.sicategory.DeleteTypeEnum;
import com.engine.salary.enums.taxagent.TaxAgentTaxReturnStatusEnum;
import com.engine.salary.enums.taxdeclaration.EnumDeclareApiBusinessType;
import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.exception.SalaryRunTimeException;
import com.engine.salary.mapper.employeedeclare.EmployeeDeclareMapper; import com.engine.salary.mapper.employeedeclare.EmployeeDeclareMapper;
import com.engine.salary.service.EmployeeDeclareService; import com.engine.salary.service.*;
import com.engine.salary.service.SalaryArchiveService; import com.engine.salary.util.*;
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.db.MapperProxyFactory;
import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.PageInfo;
import com.engine.salary.util.page.SalaryPageUtil; import com.engine.salary.util.page.SalaryPageUtil;
import com.engine.salary.util.valid.SalaryCardUtil;
import com.engine.salary.util.valid.ValidUtil; import com.engine.salary.util.valid.ValidUtil;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;
import dm.jdbc.util.IdGenerator;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import weaver.general.Util;
import weaver.hrm.User; import weaver.hrm.User;
import java.time.YearMonth; import java.time.YearMonth;
@ -70,6 +85,18 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla
return ServiceUtil.getService(SalaryArchiveServiceImpl.class, user); return ServiceUtil.getService(SalaryArchiveServiceImpl.class, user);
} }
private TaxDeclarationApiConfigService getTaxDeclarationApiConfigService(User user) {
return ServiceUtil.getService(TaxDeclarationApiConfigServiceImpl.class, user);
}
private TaxAgentTaxReturnService getTaxAgentTaxReturnService(User user) {
return ServiceUtil.getService(TaxAgentTaxReturnServiceImpl.class, user);
}
private EmployeeDeclareRecordService getEmployeeDeclareRecordService(User user) {
return ServiceUtil.getService(EmployeeDeclareRecordServiceImpl.class, user);
}
@Override @Override
public EmployeeDeclarePO getById(Long id) { public EmployeeDeclarePO getById(Long id) {
return getEmployeeDeclareMapper().getById(id); return getEmployeeDeclareMapper().getById(id);
@ -77,7 +104,7 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla
@Override @Override
public List<EmployeeDeclarePO> listByIds(Collection<Long> ids) { public List<EmployeeDeclarePO> listByIds(Collection<Long> ids) {
if (CollectionUtils.isEmpty(ids)){ if (CollectionUtils.isEmpty(ids)) {
return Collections.emptyList(); return Collections.emptyList();
} }
return getEmployeeDeclareMapper().listSome(EmployeeDeclarePO.builder().ids(ids).build()); return getEmployeeDeclareMapper().listSome(EmployeeDeclarePO.builder().ids(ids).build());
@ -150,45 +177,45 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla
return page; return page;
} }
// @Override @Override
// public void save(EmployeeDeclareSaveParam saveParam, Long employeeId) { public void save(EmployeeDeclareSaveParam saveParam) {
// LocalDateTime now = LocalDateTime.now(); Date now = new Date();
// EmployeeDeclarePO employeeDeclare = new EmployeeDeclarePO() EmployeeDeclarePO employeeDeclare = new EmployeeDeclarePO()
// .setTaxAgentId(saveParam.getTaxAgentId()) .setTaxAgentId(saveParam.getTaxAgentId())
// .setTaxCycle(saveParam.getTaxCycle().toString()) .setTaxCycle(saveParam.getTaxCycle().toString())
// .setEmployeeName(saveParam.getEmployeeName()) .setEmployeeName(saveParam.getEmployeeName())
// .setJobNum(saveParam.getJobNum()) .setJobNum(saveParam.getJobNum())
// .setCardType(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getValue()) .setCardType(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getValue())
// .setCardNum(saveParam.getCardNum()) .setCardNum(saveParam.getCardNum())
// .setGender(SalaryCardUtil.judgeGender(saveParam.getCardNum()).getValue()) .setGender(SalaryCardUtil.judgeGender(saveParam.getCardNum()).getValue())
// .setBirthday(SalaryCardUtil.judgeBirthday(saveParam.getCardNum())) .setBirthday(SalaryDateUtil.localDateToDate(SalaryCardUtil.judgeBirthday(saveParam.getCardNum())))
// .setEmploymentStatus(saveParam.getEmploymentStatus().getValue()) .setEmploymentStatus(saveParam.getEmploymentStatus().getValue())
// .setMobile(saveParam.getMobile()) .setMobile(saveParam.getMobile())
// .setEmploymentType(saveParam.getEmploymentType().getValue()) .setEmploymentType(saveParam.getEmploymentType().getValue())
// .setEmploymentFirstYear("") .setEmploymentFirstYear("")
// .setEmploymentDate(saveParam.getEmploymentDate()) .setEmploymentDate(SalaryDateUtil.localDateToDate(saveParam.getEmploymentDate()))
// .setDismissDate(saveParam.getDismissDate()) .setDismissDate(SalaryDateUtil.localDateToDate(saveParam.getDismissDate()))
// .setDisability(saveParam.getDisability().getValue()) .setDisability(saveParam.getDisability().getValue())
// .setDisabilityCardNo(saveParam.getDisabilityCardNo()) .setDisabilityCardNo(saveParam.getDisabilityCardNo())
// .setLonelyOld(saveParam.getLonelyOld().getValue()) .setLonelyOld(saveParam.getLonelyOld().getValue())
// .setMartyrDependents(saveParam.getMartyrDependents().getValue()) .setMartyrDependents(saveParam.getMartyrDependents().getValue())
// .setMartyrDependentsCardNo(saveParam.getMartyrDependentsCardNo()) .setMartyrDependentsCardNo(saveParam.getMartyrDependentsCardNo())
// .setDeductExpenses(saveParam.getDeductExpenses().getValue()) .setDeductExpenses(saveParam.getDeductExpenses().getValue())
// .setSuccessfullyDeclared(0) .setSuccessfullyDeclared(0)
// .setNewEmployeeInfo(0) .setNewEmployeeInfo(0)
// .setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()) .setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue())
// .setDeclareErrorMsg(""); .setDeclareErrorMsg("");
// if (Objects.isNull(saveParam.getId())) { if (Objects.isNull(saveParam.getId())) {
// employeeDeclare.setId(IdGenerator.generate()) employeeDeclare.setId(IdGenerator.generate())
// .setEmployeeId(saveParam.getEmployeeId()) .setEmployeeId(saveParam.getEmployeeId())
// .setEmployeeType(saveParam.getEmployeeType().getValue()) .setEmployeeType(saveParam.getEmployeeType().getValue())
// .setTenantKey(tenantKey) .setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY)
// .setCreator(employeeId) .setCreator((long) user.getUID())
// .setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()) .setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue())
// .setCreateTime(now) .setCreateTime(now)
// .setUpdateTime(now); .setUpdateTime(now);
// save(employeeDeclare); getEmployeeDeclareMapper().insertIgnoreNull(employeeDeclare);
// // 记录日志 // 记录日志
// LoggerContext<EmployeeDeclarePO> loggerContext = new LoggerContext<>(); // LoggerContext<EmployeeDeclarePO> loggerContext = new LoggerContext<>();
// loggerContext.setTargetId(Util.null2String(saveParam.getTaxAgentId())); // loggerContext.setTargetId(Util.null2String(saveParam.getTaxAgentId()));
// loggerContext.setTargetName(employeeDeclare.getEmployeeName()); // loggerContext.setTargetName(employeeDeclare.getEmployeeName());
@ -197,27 +224,27 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla
// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(156441, "新增报送人员:") + employeeDeclare.getEmployeeName()); // loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(156441, "新增报送人员:") + employeeDeclare.getEmployeeName());
// loggerContext.setNewValues(employeeDeclare); // loggerContext.setNewValues(employeeDeclare);
// employeeDeclareLoggerTemplate.write(loggerContext); // employeeDeclareLoggerTemplate.write(loggerContext);
// } else { } else {
// EmployeeDeclarePO originEmployeeDeclare = getById(saveParam.getId(), tenantKey); EmployeeDeclarePO originEmployeeDeclare = getById(saveParam.getId());
// if (Objects.isNull(originEmployeeDeclare)) { if (Objects.isNull(originEmployeeDeclare)) {
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156442, "人员不存在或已被删除")); throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156442, "人员不存在或已被删除"));
// } }
// if (Objects.equals(originEmployeeDeclare.getSuccessfullyDeclared(), 1) if (Objects.equals(originEmployeeDeclare.getSuccessfullyDeclared(), 1)
// && !Objects.equals(originEmployeeDeclare.getEmployeeName(), employeeDeclare.getEmployeeName()) && !Objects.equals(originEmployeeDeclare.getEmployeeName(), employeeDeclare.getEmployeeName())
// && !Objects.equals(originEmployeeDeclare.getCardNum(), employeeDeclare.getCardNum())) { && !Objects.equals(originEmployeeDeclare.getCardNum(), employeeDeclare.getCardNum())) {
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156443, "成功报送过的人员,姓名和证件号码只能修改其一,同时需要修改的请前往办税服务厅")); throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156443, "成功报送过的人员,姓名和证件号码只能修改其一,同时需要修改的请前往办税服务厅"));
// } }
// employeeDeclare.setId(originEmployeeDeclare.getId()) employeeDeclare.setId(originEmployeeDeclare.getId())
// .setEmployeeId(originEmployeeDeclare.getEmployeeId()) .setEmployeeId(originEmployeeDeclare.getEmployeeId())
// .setEmployeeType(originEmployeeDeclare.getEmployeeType()) .setEmployeeType(originEmployeeDeclare.getEmployeeType())
// .setSuccessfullyDeclared(originEmployeeDeclare.getSuccessfullyDeclared()) .setSuccessfullyDeclared(originEmployeeDeclare.getSuccessfullyDeclared())
// .setUpdateTime(now); .setUpdateTime(now);
// // 判断本次编辑是否有修改人员信息 // 判断本次编辑是否有修改人员信息
// if (!StringUtils.equals(employeeDeclare.toCompareString(), originEmployeeDeclare.toCompareString())) { if (!StringUtils.equals(employeeDeclare.toCompareString(), originEmployeeDeclare.toCompareString())) {
// employeeDeclare.setNewEmployeeInfo(1); employeeDeclare.setNewEmployeeInfo(1);
// } }
// updateById(employeeDeclare); getEmployeeDeclareMapper().updateIgnoreNull(employeeDeclare);
// // 记录日志 // 记录日志
// LoggerContext<EmployeeDeclarePO> loggerContext = new LoggerContext<>(); // LoggerContext<EmployeeDeclarePO> loggerContext = new LoggerContext<>();
// loggerContext.setTargetId(Util.null2String(saveParam.getTaxAgentId())); // loggerContext.setTargetId(Util.null2String(saveParam.getTaxAgentId()));
// loggerContext.setTargetName(employeeDeclare.getEmployeeName()); // loggerContext.setTargetName(employeeDeclare.getEmployeeName());
@ -227,9 +254,9 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla
// loggerContext.setOldValues(originEmployeeDeclare); // loggerContext.setOldValues(originEmployeeDeclare);
// loggerContext.setNewValues(employeeDeclare); // loggerContext.setNewValues(employeeDeclare);
// employeeDeclareLoggerTemplate.write(loggerContext); // employeeDeclareLoggerTemplate.write(loggerContext);
// } }
// } }
//
// @Override // @Override
// public void batchUpdate(EmployeeDeclareBatchUpdateParam batchUpdateParam, Long employeeId) { // public void batchUpdate(EmployeeDeclareBatchUpdateParam batchUpdateParam, Long employeeId) {
// // 查询报送人员 // // 查询报送人员
@ -376,7 +403,7 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla
dtoList.forEach(po -> { dtoList.forEach(po -> {
boolean isExtEmp = EmployeeTypeEnum.EXT_EMPLOYEE.getValue().compareTo(po.getEmployeeType().getValue()) == 0; boolean isExtEmp = EmployeeTypeEnum.EXT_EMPLOYEE.getValue().compareTo(po.getEmployeeType().getValue()) == 0;
DataCollectionEmployee employee = employeeInfoMap.get(po.getEmployeeId() + "-" + isExtEmp); DataCollectionEmployee employee = employeeInfoMap.get(po.getEmployeeId() + "-" + isExtEmp);
if(ObjectUtils.isNotEmpty(employee)){ if (ObjectUtils.isNotEmpty(employee)) {
po.setSubCompanyName(Optional.ofNullable(employee.getSubcompanyName()).orElse("")); po.setSubCompanyName(Optional.ofNullable(employee.getSubcompanyName()).orElse(""));
po.setDepartmentName(Optional.ofNullable(employee.getDepartmentName()).orElse("")); po.setDepartmentName(Optional.ofNullable(employee.getDepartmentName()).orElse(""));
} }
@ -401,7 +428,7 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla
// 查询本月已有的需要报送的人员 // 查询本月已有的需要报送的人员
List<EmployeeDeclarePO> employeeDeclares = listByTaxCycleAndTaxAgentId(refreshParam.getTaxCycle(), refreshParam.getTaxAgentId()); List<EmployeeDeclarePO> employeeDeclares = listByTaxCycleAndTaxAgentId(refreshParam.getTaxCycle(), refreshParam.getTaxAgentId());
// 查询上月已有的需要报送的人员(只需要正常的) // 查询上月已有的需要报送的人员(只需要正常的)
List<EmployeeDeclarePO> preTaxCycleEmployeeDeclares = listByTaxCycleAndTaxAgentId(refreshParam.getTaxCycle().plus(-1,ChronoUnit.MONTHS), refreshParam.getTaxAgentId()) List<EmployeeDeclarePO> preTaxCycleEmployeeDeclares = listByTaxCycleAndTaxAgentId(refreshParam.getTaxCycle().plus(-1, ChronoUnit.MONTHS), refreshParam.getTaxAgentId())
.stream() .stream()
.filter(e -> Objects.equals(e.getEmploymentStatus(), EmploymentStatusEnum.NORMAL.getValue()) .filter(e -> Objects.equals(e.getEmploymentStatus(), EmploymentStatusEnum.NORMAL.getValue())
&& Objects.equals(e.getDeclareStatus(), DeclareStatusEnum.DECLARE_SUCCESS.getValue())) && Objects.equals(e.getDeclareStatus(), DeclareStatusEnum.DECLARE_SUCCESS.getValue()))
@ -432,7 +459,7 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla
List<SalaryArchivePO> salaryArchivePOS = getSalaryArchiveService(user).listSome(SalaryArchivePO.builder().taxAgentId(refreshParam.getTaxAgentId()).employeeIds(employeeIds).build()); List<SalaryArchivePO> salaryArchivePOS = getSalaryArchiveService(user).listSome(SalaryArchivePO.builder().taxAgentId(refreshParam.getTaxAgentId()).employeeIds(employeeIds).build());
// 本月增加了哪些人员 // 本月增加了哪些人员
Set<Long> orgEmployeeIds = ((List<EmployeeDeclarePO>)CollectionUtils.union(preTaxCycleEmployeeDeclares, employeeDeclares)) Set<Long> orgEmployeeIds = ((List<EmployeeDeclarePO>) CollectionUtils.union(preTaxCycleEmployeeDeclares, employeeDeclares))
.stream() .stream()
.filter(e -> Objects.equals(e.getEmployeeType(), EmployeeTypeEnum.ORGANIZATION.getValue())) .filter(e -> Objects.equals(e.getEmployeeType(), EmployeeTypeEnum.ORGANIZATION.getValue()))
.map(EmployeeDeclarePO::getEmployeeId) .map(EmployeeDeclarePO::getEmployeeId)
@ -446,12 +473,12 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla
// List<SimpleUserInfo> newSimpleUserInfos = salaryEmployeeService.listByEmployeeIds(newOrgEmployeeIds, tenantKey); // List<SimpleUserInfo> newSimpleUserInfos = salaryEmployeeService.listByEmployeeIds(newOrgEmployeeIds, tenantKey);
// List<HrmEmployeeComInfo> newHrmEmployeeComInfos = comInfoCache.getCacheList(HrmEmployeeComInfo.class, Lists.newArrayList(newOrgEmployeeIds)); // List<HrmEmployeeComInfo> newHrmEmployeeComInfos = comInfoCache.getCacheList(HrmEmployeeComInfo.class, Lists.newArrayList(newOrgEmployeeIds));
// 查询本月增加了哪些非系统人员 // 查询本月增加了哪些非系统人员
// List<ExtEmployeePO> extEmployees = extEmployeeService.listBySalaryCycleAndTaxAgentId(salaryCycleRange, refreshParam.getTaxAgentId(), tenantKey); // List<ExtEmpPO> extEmployees = extEmployeeService.listBySalaryCycleAndTaxAgentId(salaryCycleRange, refreshParam.getTaxAgentId());
// Set<Long> extEmployeeIds = employeeDeclares.stream() // Set<Long> extEmployeeIds = employeeDeclares.stream()
// .filter(e -> Objects.equals(e.getEmployeeType(), EmployeeTypeEnum.EXT_EMPLOYEE.getValue())) // .filter(e -> Objects.equals(e.getEmployeeType(), EmployeeTypeEnum.EXT_EMPLOYEE.getValue()))
// .map(EmployeeDeclarePO::getEmployeeId) // .map(EmployeeDeclarePO::getEmployeeId)
// .collect(Collectors.toSet()); // .collect(Collectors.toSet());
// List<ExtEmployeePO> newExtEmployees = extEmployees.stream() // List<ExtEmpPO> newExtEmployees = extEmployees.stream()
// .filter(e -> !extEmployeeIds.contains(e.getId())) // .filter(e -> !extEmployeeIds.contains(e.getId()))
// .collect(Collectors.toList()); // .collect(Collectors.toList());
@ -462,8 +489,8 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla
.setEmployeeDeclares(employeeDeclares) .setEmployeeDeclares(employeeDeclares)
.setPreTaxCycleEmployeeDeclare(preTaxCycleEmployeeDeclares) .setPreTaxCycleEmployeeDeclare(preTaxCycleEmployeeDeclares)
.setSalaryArchives(salaryArchivePOS) .setSalaryArchives(salaryArchivePOS)
.setEmployeeInfos(employeeInfos); // .setEmployeeInfos(employeeInfos)
// .setHrmEmployeeComInfos(newHrmEmployeeComInfos) .setHrmEmployeeComInfos(employeeInfos);
// .setSimpleUserInfos(newSimpleUserInfos) // .setSimpleUserInfos(newSimpleUserInfos)
// .setExtEmployees(newExtEmployees) // .setExtEmployees(newExtEmployees)
EmployeeDeclareRefresh.Result result = EmployeeDeclareRefresh.refresh(dto, employeeId); EmployeeDeclareRefresh.Result result = EmployeeDeclareRefresh.refresh(dto, employeeId);
@ -478,11 +505,11 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla
// // 记录日志 // // 记录日志
// LoggerContext<EmployeeDeclarePO> loggerContext = new LoggerContext<>(); // LoggerContext<EmployeeDeclarePO> loggerContext = new LoggerContext<>();
// loggerContext.setTargetId(refreshParam.getTaxAgentId() + "-" + refreshParam.getTaxCycle().toString()); // 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.setTargetName(SalaryI18nUtil.getI18nLabel(156468, "个税扣缴义务人:「{0}」税款所属期:「{1}」").replace("{0}", taxAgent.getName()).replace("{1}", refreshParam.getTaxCycle().toString()));
// loggerContext.setOperator(Util.null2String(employeeId)); // loggerContext.setOperator(Util.null2String(employeeId));
// loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); // loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue());
// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156447, "刷新数据")); // loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(156447, "刷新数据"));
// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156447, "刷新数据")); // loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(156447, "刷新数据"));
// employeeDeclareLoggerTemplate.write(loggerContext); // employeeDeclareLoggerTemplate.write(loggerContext);
} }
@ -505,171 +532,168 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla
.setDeclareSuccessSize(declareSuccessSize); .setDeclareSuccessSize(declareSuccessSize);
} }
// @Override @Override
// @Transactional(rollbackFor = Exception.class) public void declare(EmployeeDeclareParam param) {
// public void declare(EmployeeDeclareParam param, Long employeeId) { // 获取api配置信息
// // 获取api配置信息 TaxDeclarationApiConfigPO apiConfig = getTaxDeclarationApiConfigService(user).getConfig(true);
// TaxDeclarationApiConfigPO apiConfig = taxDeclarationApiConfigService.getConfig(tenantKey, employeeId, true); // 查询个税扣缴义务人
// // 查询个税扣缴义务人 TaxAgentPO taxAgent = getTaxAgentService(user).getById(param.getTaxAgentId());
// TaxAgentPO taxAgent = taxAgentService.getById(param.getTaxAgentId(), employeeId, tenantKey); // 查询个税扣缴义务人关联的企业信息
// // 查询个税扣缴义务人关联的企业信息 TaxAgentTaxReturnPO taxAgentTaxReturn = getTaxAgentTaxReturnService(user).getByTaxAgentId(param.getTaxAgentId());
// TaxAgentTaxReturnPO taxAgentTaxReturn = taxAgentTaxReturnService.getByTaxAgentId(param.getTaxAgentId(), tenantKey); if (Objects.isNull(taxAgentTaxReturn) || !Objects.equals(taxAgentTaxReturn.getCheckStatus(), TaxAgentTaxReturnStatusEnum.SUCCESS.getValue())) {
// if (Objects.isNull(taxAgentTaxReturn) || !Objects.equals(taxAgentTaxReturn.getCheckStatus(), TaxAgentTaxReturnStatusEnum.SUCCESS.getValue())) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156469, "个税扣缴义务人的报税信息验证未通过,请先维护好个税扣缴义务人的报税信息"));
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156469, "个税扣缴义务人的报税信息验证未通过,请先维护好个税扣缴义务人的报税信息")); }
// } // 查询需要报送的人员
// // 查询需要报送的人员 List<EmployeeDeclarePO> employeeDeclares = listByTaxCycleAndTaxAgentId(param.getTaxCycle(), param.getTaxAgentId());
// List<EmployeeDeclarePO> employeeDeclares = listByTaxCycleAndTaxAgentId(param.getTaxCycle(), param.getTaxAgentId(), tenantKey); if (CollectionUtils.isEmpty(employeeDeclares)) {
// if (CollectionUtils.isEmpty(employeeDeclares)) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156470, "当前报送人员列表暂无数据"));
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156470, "当前报送人员列表暂无数据")); }
// } EmployeeDeclareRecordPO employeeDeclareRecord = getEmployeeDeclareRecordService(user).getByTaxCycleAndTaxAgentId(param.getTaxCycle(), param.getTaxAgentId());
// EmployeeDeclareRecordPO employeeDeclareRecord = employeeDeclareRecordService.getByTaxCycleAndTaxAgentId(param.getTaxCycle(), param.getTaxAgentId(), tenantKey); if (employeeDeclareRecord != null && StringUtils.isNotEmpty(employeeDeclareRecord.getRequestId())) {
// if (employeeDeclareRecord != null && StringUtils.isNotEmpty(employeeDeclareRecord.getRequestId())) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156471, "报送中,稍后请点击【获取报送结果】更新报送状态"));
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156471, "报送中,稍后请点击【获取报送结果】更新报送状态")); }
// } // 人员列表
// // 人员列表 List<Map<String, Object>> employeeInfoMapList = EmployeeDeclareRequest.convert2RequestParam(employeeDeclares);
// List<Map<String, Object>> employeeInfoMapList = EmployeeDeclareRequest.convert2RequestParam(employeeDeclares); // 企业信息
// // 企业信息 Map<String, Object> requestParam = TaxAgentTaxReturnBO.convert2RequestMap(taxAgent, taxAgentTaxReturn);
// Map<String, Object> requestParam = TaxAgentTaxReturnBO.convert2RequestMap(taxAgent, taxAgentTaxReturn); // 税款所属期
// // 税款所属期 requestParam.put("skssq", param.getTaxCycle().toString().replace("-", ""));
// requestParam.put("skssq", param.getTaxCycle().toString().replace("-", "")); // 人员列表
// // 人员列表 requestParam.put("rylb", employeeInfoMapList);
// requestParam.put("rylb", employeeInfoMapList);
// String reqJson = JsonUtil.toJsonString(requestParam);
// String reqJson = JsonUtil.toJsonString(requestParam); String url = apiConfig.getHost() + SzyhApiConstant.DECLARE_EMPLOYEE_INFO;
// String url = apiConfig.getHost() + SzyhApiConstant.DECLARE_EMPLOYEE_INFO; Map<String, String> params = new HashMap<>(1);
// Map<String, String> params = new HashMap<>(1); Map<String, String> header = SingnatureData.initHeader(params, apiConfig.getAppKey(), apiConfig.getAppSecret());
// Map<String, String> header = SingnatureData.initHeader(params, apiConfig.getAppKey(), apiConfig.getAppSecret()); String res = HttpUtil.doPost(url, header, reqJson, HttpUtil.JSON_TYPE);
// String res = HttpUtil.doPost(url, header, reqJson, HttpUtil.JSON_TYPE); DeclareEmployeeInfoResponse declareEmployeeInfoResponse = JsonUtil.parseObject(res, DeclareEmployeeInfoResponse.class);
// DeclareEmployeeInfoResponse declareEmployeeInfoResponse = JsonUtil.parseObject(res, DeclareEmployeeInfoResponse.class); if (Objects.isNull(declareEmployeeInfoResponse) || Objects.isNull(declareEmployeeInfoResponse.getHead())) {
// if (Objects.isNull(declareEmployeeInfoResponse) || Objects.isNull(declareEmployeeInfoResponse.getHead())) { log.error("服务异常:" + res);
// log.error("服务异常:" + res); throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156449, "服务异常"));
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156449, "服务异常")); }
// } if (!Objects.equals(declareEmployeeInfoResponse.getHead().getCode(), SzyhApiConstant.SUCCESS_CODE)) {
// if (!Objects.equals(declareEmployeeInfoResponse.getHead().getCode(), SzyhApiConstant.SUCCESS_CODE)) { throw new SalaryRunTimeException(declareEmployeeInfoResponse.getHead().getMsg());
// throw new SalaryRunTimeException(declareEmployeeInfoResponse.getHead().getMsg()); }
// } // 删除原来的人员报送记录
// // 删除原来的人员报送记录 getEmployeeDeclareRecordService(user).deleteByTaxCycleAndTaxAgentId(param.getTaxCycle(), param.getTaxAgentId());
// employeeDeclareRecordService.deleteByTaxCycleAndTaxAgentId(param.getTaxCycle(), param.getTaxAgentId(), tenantKey); // 保存新的人员报送记录
// // 保存新的人员报送记录 Date now =new Date();
// LocalDateTime now = LocalDateTime.now(); AsyncRequestIdDTO asyncRequestIdDTO = declareEmployeeInfoResponse.getBody();
// AsyncRequestIdDTO asyncRequestIdDTO = declareEmployeeInfoResponse.getBody(); employeeDeclareRecord = new EmployeeDeclareRecordPO()
// employeeDeclareRecord = new EmployeeDeclareRecordPO() .setId(IdGenerator.generate())
// .setId(IdGenerator.generate()) .setTaxAgentId(param.getTaxAgentId())
// .setTaxAgentId(param.getTaxAgentId()) .setTaxCycle(param.getTaxCycle().toString())
// .setTaxCycle(param.getTaxCycle().toString()) .setRequestId(asyncRequestIdDTO.getRequestId())
// .setRequestId(asyncRequestIdDTO.getRequestId()) .setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY)
// .setTenantKey(tenantKey) .setCreator((long)user.getUID())
// .setCreator(employeeId) .setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue())
// .setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()) .setCreateTime(now)
// .setCreateTime(now) .setUpdateTime(now);
// .setUpdateTime(now); getEmployeeDeclareRecordService(user).save(employeeDeclareRecord);
// employeeDeclareRecordService.save(employeeDeclareRecord); // 记录日志
// // 记录日志
// LoggerContext<EmployeeDeclarePO> loggerContext = new LoggerContext<>(); // LoggerContext<EmployeeDeclarePO> loggerContext = new LoggerContext<>();
// loggerContext.setTargetId(param.getTaxAgentId() + "-" + param.getTaxCycle().toString()); // 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.setTargetName(SalaryI18nUtil.getI18nLabel(156468, "个税扣缴义务人:「{0}」税款所属期:「{1}」").replace("{0}", taxAgent.getName()).replace("{1}", param.getTaxCycle().toString()));
// loggerContext.setOperator(Util.null2String(employeeId)); // loggerContext.setOperator(Util.null2String(employeeId));
// loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); // loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue());
// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156450, "全部报送")); // loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(156450, "全部报送"));
// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156450, "全部报送")); // loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(156450, "全部报送"));
// employeeDeclareLoggerTemplate.write(loggerContext); // employeeDeclareLoggerTemplate.write(loggerContext);
// } }
//
// @Override @Override
// @Transactional(rollbackFor = Exception.class) public void getDeclareFeedback(EmployeeDeclareParam param, EmployeeDeclareRateDTO employeeDeclareRate) {
// public void getDeclareFeedback(EmployeeDeclareParam param, EmployeeDeclareRateDTO employeeDeclareRate, Long employeeId) { // 获取api配置信息
// // 获取api配置信息 TaxDeclarationApiConfigPO apiConfig = getTaxDeclarationApiConfigService(user).getConfig(true);
// TaxDeclarationApiConfigPO apiConfig = taxDeclarationApiConfigService.getConfig(tenantKey, employeeId, true); // 查询个税扣缴义务人
// // 查询个税扣缴义务人 TaxAgentPO taxAgent = getTaxAgentService(user).getById(param.getTaxAgentId());
// TaxAgentPO taxAgent = taxAgentService.getById(param.getTaxAgentId(), employeeId, tenantKey); // 查询人员报送记录
// // 查询人员报送记录 EmployeeDeclareRecordPO employeeDeclareRecord = getEmployeeDeclareRecordService(user).getByTaxCycleAndTaxAgentId(param.getTaxCycle(), param.getTaxAgentId());
// EmployeeDeclareRecordPO employeeDeclareRecord = employeeDeclareRecordService.getByTaxCycleAndTaxAgentId(param.getTaxCycle(), param.getTaxAgentId(), tenantKey); if (Objects.isNull(employeeDeclareRecord)) {
// if (Objects.isNull(employeeDeclareRecord)) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156451, "请先报送后再获取报送结果"));
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey,employeeId,156451, "请先报送后再获取报送结果")); }
// } if (StringUtils.isEmpty(employeeDeclareRecord.getRequestId())) {
// if (StringUtils.isEmpty(employeeDeclareRecord.getRequestId())) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156451, "请先报送后再获取报送结果"));
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey,employeeId,156451, "请先报送后再获取报送结果")); }
// }
// String url = apiConfig.getHost() + SzyhApiConstant.DECLARE_EMPLOYEE_INFO_FEEDBACK;
// String url = apiConfig.getHost() + SzyhApiConstant.DECLARE_EMPLOYEE_INFO_FEEDBACK; ImmutableMap<String, String> requestParam = ImmutableMap.of("requestId", employeeDeclareRecord.getRequestId());
// Map<String, String> requestParam = ImmutableMap.of("requestId", employeeDeclareRecord.getRequestId()); Map<String, String> header = SingnatureData.initHeader(Collections.emptyMap(), apiConfig.getAppKey(), apiConfig.getAppSecret());
// Map<String, String> header = SingnatureData.initHeader(Collections.emptyMap(), apiConfig.getAppKey(), apiConfig.getAppSecret()); String res = HttpUtil.getRequest(url, header, requestParam);
// String res = HttpUtil.getRequest(url, header, requestParam); DeclareEmployeeFeedbackResponse declareEmployeeFeedbackResponse = JsonUtil.parseObject(res, DeclareEmployeeFeedbackResponse.class);
// DeclareEmployeeFeedbackResponse declareEmployeeFeedbackResponse = JsonUtil.parseObject(res, DeclareEmployeeFeedbackResponse.class); if (Objects.isNull(declareEmployeeFeedbackResponse) || Objects.isNull(declareEmployeeFeedbackResponse.getHead())) {
// if (Objects.isNull(declareEmployeeFeedbackResponse) || Objects.isNull(declareEmployeeFeedbackResponse.getHead())) { log.error("服务异常:" + res);
// log.error("服务异常:" + res); throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156449, "服务异常"));
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey,employeeId,156449, "服务异常")); }
// } if (!Objects.equals(declareEmployeeFeedbackResponse.getHead().getCode(), SzyhApiConstant.SUCCESS_CODE)) {
// if (!Objects.equals(declareEmployeeFeedbackResponse.getHead().getCode(), SzyhApiConstant.SUCCESS_CODE)) { throw new SalaryRunTimeException(declareEmployeeFeedbackResponse.getHead().getMsg());
// throw new SalaryRunTimeException(declareEmployeeFeedbackResponse.getHead().getMsg()); }
// } DeclareEmployeeFeedbackResponse.DeclareEmployeeFeedbackResponseBody declareEmployeeFeedbackResponseBody = declareEmployeeFeedbackResponse.getBody();
// DeclareEmployeeFeedbackResponse.DeclareEmployeeFeedbackResponseBody declareEmployeeFeedbackResponseBody = declareEmployeeFeedbackResponse.getBody(); Map<String, Map<String, Object>> employeeFeedbackMap = SalaryEntityUtil.convert2Map(declareEmployeeFeedbackResponseBody.getBsjg(), e -> e.getOrDefault("xm", "")
// Map<String, Map<String, Object>> employeeFeedbackMap = SalaryEntityUtil.convert2Map(declareEmployeeFeedbackResponseBody.getBsjg(), e -> e.getOrDefault("xm", "") + "-" + e.getOrDefault("zzlx", "")
// + "-" + e.getOrDefault("zzlx", "") + "-" + e.getOrDefault("zzhm", ""));
// + "-" + e.getOrDefault("zzhm", "")); // 流量使用情况
// // 流量使用情况 TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper apiFlowUpdateWrapper = new TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper( SalaryDateUtil.localDateToDate(param.getTaxCycle().atDay(1)), apiConfig, EnumDeclareApiBusinessType.EMPLOYEE_DECLARATION);
// TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper apiFlowUpdateWrapper = // 查询申报的人员列表
// new TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper(tenantKey Date now = new Date();
// , employeeId, param.getTaxCycle().atDay(1) List<EmployeeDeclarePO> needUpdateEmployeeDeclares = Lists.newArrayList();
// , apiConfig, EnumDeclareApiBusinessType.EMPLOYEE_DECLARATION); List<EmployeeDeclarePO> employeeDeclares = listByTaxCycleAndTaxAgentId(param.getTaxCycle(), param.getTaxAgentId());
// // 查询申报的人员列表 for (EmployeeDeclarePO employeeDeclare : employeeDeclares) {
// LocalDateTime now = LocalDateTime.now(); CardTypeEnum cardTypeEnum = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getCardType(), CardTypeEnum.class);
// List<EmployeeDeclarePO> needUpdateEmployeeDeclares = Lists.newArrayList(); String key = employeeDeclare.getEmployeeName()
// List<EmployeeDeclarePO> employeeDeclares = listByTaxCycleAndTaxAgentId(param.getTaxCycle(), param.getTaxAgentId(), tenantKey); + "-" + (cardTypeEnum == null ? CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel() : cardTypeEnum.getDefaultLabel())
// for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { + "-" + employeeDeclare.getCardNum();
// CardTypeEnum cardTypeEnum = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getCardType(), CardTypeEnum.class); Map<String, Object> employeeInfoMap = employeeFeedbackMap.get(key);
// String key = employeeDeclare.getEmployeeName() if (MapUtil.isEmpty(employeeInfoMap)) {
// + "-" + (cardTypeEnum == null ? CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel() : cardTypeEnum.getDefaultLabel()) continue;
// + "-" + employeeDeclare.getCardNum(); }
// Map<String, Object> employeeInfoMap = employeeFeedbackMap.get(key); // 报送状态
// if (MapUtil.isEmpty(employeeInfoMap)) { employeeDeclare.setDeclareStatus(SalaryEntityUtil.getIntValue(employeeInfoMap.get("sbzt"), DeclareStatusEnum.NOT_DECLARE.getValue()));
// continue; // 失败原因
// } employeeDeclare.setDeclareErrorMsg(SalaryEntityUtil.null2String(employeeInfoMap.get("sbyy")));
// // 报送状态 // 验证状态银行卡验证状态
// employeeDeclare.setDeclareStatus(SalaryEntityUtil.getIntValue(employeeInfoMap.get("sbzt"), DeclareStatusEnum.NOT_DECLARE.getValue())); // 是否报送成功了
// // 失败原因 if (Objects.equals(employeeDeclare.getDeclareStatus(), DeclareStatusEnum.DECLARE_SUCCESS.getValue())) {
// employeeDeclare.setDeclareErrorMsg(SalaryEntityUtil.null2String(employeeInfoMap.get("sbyy"))); employeeDeclare.setSuccessfullyDeclared(1);
// // 验证状态银行卡验证状态 }
// // 是否报送成功了 employeeDeclare.setUpdateTime(now);
// if (Objects.equals(employeeDeclare.getDeclareStatus(), DeclareStatusEnum.DECLARE_SUCCESS.getValue())) { needUpdateEmployeeDeclares.add(employeeDeclare);
// employeeDeclare.setSuccessfullyDeclared(1);
// } // 流量使用记录
// employeeDeclare.setUpdateTime(now); TaxDeclarationApiFlowRecordPO flowDetailPO = TaxApiFlowBO.buildTaxDeclarationApiFlowRecordPO(apiFlowUpdateWrapper, param.getTaxAgentId(), employeeDeclare.getEmployeeId());
// needUpdateEmployeeDeclares.add(employeeDeclare); flowDetailPO.setResultStatus(DeclareStatusEnum.DECLARE_SUCCESS.getValue().equals(employeeDeclare.getDeclareStatus()) ? TaxAgentTaxReturnStatusEnum.SUCCESS.getValue() : TaxAgentTaxReturnStatusEnum.FAIL.getValue());
// apiFlowUpdateWrapper.getApiFlowDetailPOList().add(flowDetailPO);
// // 流量使用记录 }
// TaxDeclarationApiFlowRecordPO flowDetailPO = TaxApiFlowBO.buildTaxDeclarationApiFlowRecordPO(apiFlowUpdateWrapper, param.getTaxAgentId(), employeeDeclare.getEmployeeId()); // 更新员工的报送状态
// flowDetailPO.setResultStatus(DeclareStatusEnum.DECLARE_SUCCESS.getValue().equals(employeeDeclare.getDeclareStatus()) ? TaxAgentTaxReturnStatusEnum.SUCCESS.getValue() : TaxAgentTaxReturnStatusEnum.FAIL.getValue()); if (CollectionUtils.isNotEmpty(needUpdateEmployeeDeclares)) {
// apiFlowUpdateWrapper.getApiFlowDetailPOList().add(flowDetailPO); //todo
// }
// // 更新员工的报送状态
// if (CollectionUtils.isNotEmpty(needUpdateEmployeeDeclares)) {
// updateBatchById(needUpdateEmployeeDeclares); // updateBatchById(needUpdateEmployeeDeclares);
// } }
// // 删除原来的人员报送记录 // 删除原来的人员报送记录
// employeeDeclareRecordService.deleteByTaxCycleAndTaxAgentId(param.getTaxCycle(), param.getTaxAgentId(), tenantKey); getEmployeeDeclareRecordService(user).deleteByTaxCycleAndTaxAgentId(param.getTaxCycle(), param.getTaxAgentId());
// // 记录日志 // 记录日志
// LoggerContext<EmployeeDeclarePO> loggerContext = new LoggerContext<>(); // LoggerContext<EmployeeDeclarePO> loggerContext = new LoggerContext<>();
// loggerContext.setTargetId(param.getTaxAgentId() + "-" + param.getTaxCycle().toString()); // 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.setTargetName(SalaryI18nUtil.getI18nLabel(156468, "个税扣缴义务人:「{0}」税款所属期:「{1}」").replace("{0}", taxAgent.getName()).replace("{1}", param.getTaxCycle().toString()));
// loggerContext.setOperator(Util.null2String(employeeId)); // loggerContext.setOperator(Util.null2String(employeeId));
// loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); // loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue());
// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(tenantKey,employeeId,156452, "获取结果反馈")); // loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(156452, "获取结果反馈"));
// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(tenantKey,employeeId,156452, "获取结果反馈")); // loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(156452, "获取结果反馈"));
// employeeDeclareLoggerTemplate.write(loggerContext); // employeeDeclareLoggerTemplate.write(loggerContext);
// // 更新流量统计 // 更新流量统计
//todo
// taxDeclarationApiBillingService.updateApiFlowInfo(apiFlowUpdateWrapper); // taxDeclarationApiBillingService.updateApiFlowInfo(apiFlowUpdateWrapper);
// // 报送失败的 // 报送失败的
// int declareFailSize = (int) needUpdateEmployeeDeclares.stream() int declareFailSize = (int) needUpdateEmployeeDeclares.stream()
// .filter(e -> Objects.equals(e.getDeclareStatus(), DeclareStatusEnum.DECLARE_FAIL.getValue())) .filter(e -> Objects.equals(e.getDeclareStatus(), DeclareStatusEnum.DECLARE_FAIL.getValue()))
// .count(); .count();
// employeeDeclareRate.setFinish(true); employeeDeclareRate.setFinish(true);
// if (declareFailSize > 0) { if (declareFailSize > 0) {
// employeeDeclareRate.setMsg(SalaryI18nUtil.getI18nLabel(tenantKey,employeeId,156472, "报送成功{0}条,报送失败{1}条") employeeDeclareRate.setMsg(SalaryI18nUtil.getI18nLabel(156472, "报送成功{0}条,报送失败{1}条")
// .replace("{0}", Util.null2String(needUpdateEmployeeDeclares.size() - declareFailSize)) .replace("{0}", Util.null2String(needUpdateEmployeeDeclares.size() - declareFailSize))
// .replace("{1}", Util.null2String(declareFailSize))); .replace("{1}", Util.null2String(declareFailSize)));
// } else { } else {
// employeeDeclareRate.setMsg(SalaryI18nUtil.getI18nLabel(tenantKey,employeeId,187388, "报送成功{0}条").replace("{0}", Util.null2String(needUpdateEmployeeDeclares.size()))); employeeDeclareRate.setMsg(SalaryI18nUtil.getI18nLabel(187388, "报送成功{0}条").replace("{0}", Util.null2String(needUpdateEmployeeDeclares.size())));
// } }
// } }
} }

View File

@ -1,51 +1,47 @@
package com.engine.salary.service.impl; package com.engine.salary.service.impl;
import com.alibaba.fastjson.JSONObject; import com.engine.common.util.ServiceUtil;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; import com.engine.core.impl.Service;
import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.entity.extemp.po.ExtEmpPO;
import com.engine.salary.entity.taxapiflow.bo.TaxApiFlowBO;
import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowRecordListDTO;
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.page.PageInfo;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import weaver.hrm.User;
import java.time.LocalDate; import java.util.ArrayList;
import java.util.*; import java.util.Date;
import java.util.concurrent.atomic.AtomicInteger; import java.util.List;
import java.util.stream.Collectors; import java.util.Map;
/** /**
* @author chengliming * @author chengliming
* @date 2022-11-11 2:57 PM * @date 2022-11-11 2:57 PM
**/ **/
@Slf4j @Slf4j
public class TaxDeclarationApiBillingServiceImpl implements TaxDeclarationApiBillingService { public class TaxDeclarationApiBillingServiceImpl extends Service implements TaxDeclarationApiBillingService {
private TaxDeclarationApiFlowRecordMapper taxDeclarationApiFlowRecordMapper; private TaxDeclarationApiFlowRecordMapper taxDeclarationApiFlowRecordMapper;
private TaxAgentService taxAgentService; public TaxAgentService getTaxAgentService(User user) {
return ServiceUtil.getService(TaxAgentServiceImpl.class, user);
private SalaryEmployeeService salaryEmployeeService; }
public SalaryEmployeeService getSalaryEmployeeService(User user) {
return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user);
}
// private SalaryBatchService salaryBatchService; // private SalaryBatchService salaryBatchService;
private TaxDeclarationApiFlowWarnService taxDeclarationApiFlowWarnService; private TaxDeclarationApiFlowWarnService taxDeclarationApiFlowWarnService;
// private ComInfoCache comInfoCache; // private ComInfoCache comInfoCache;
// private ExtEmployeeService extEmployeeService; // private ExtEmployeeService extEmployeeService;
@ -65,112 +61,106 @@ public class TaxDeclarationApiBillingServiceImpl implements TaxDeclarationApiBil
} }
} }
@Override // @Override
public PageInfo<TaxDeclarationApiFlowRecordListDTO> pageFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam) { // public PageInfo<TaxDeclarationApiFlowRecordListDTO> pageFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam) {
LambdaQueryChainWrapper<TaxDeclarationApiFlowRecordPO> queryChainWrapper = getFlowRecordQueryChainWrapper(queryParam); // LambdaQueryChainWrapper<TaxDeclarationApiFlowRecordPO> queryChainWrapper = getFlowRecordQueryChainWrapper(queryParam);
Page<TaxDeclarationApiFlowRecordPO> flowRecordPOPage = queryChainWrapper.page(new Page<>(queryParam.getCurrent(), queryParam.getPageSize(), true)); // Page<TaxDeclarationApiFlowRecordPO> flowRecordPOPage = queryChainWrapper.page(new Page<>(queryParam.getCurrent(), queryParam.getPageSize(), true));
List<TaxDeclarationApiFlowRecordPO> records = flowRecordPOPage.getRecords(); // List<TaxDeclarationApiFlowRecordPO> records = flowRecordPOPage.getRecords();
if (records.isEmpty()) { // if (records.isEmpty()) {
return new PageInfo<>(); // return new PageInfo<>();
} // }
TempPropertiesWrapper propertiesWrapper = getUserInfoAndTaxAgentMap(records); // TempPropertiesWrapper propertiesWrapper = getUserInfoAndTaxAgentMap(records);
// 转换数据 // // 转换数据
AtomicInteger indexNum = new AtomicInteger(1); // AtomicInteger indexNum = new AtomicInteger(1);
List<TaxDeclarationApiFlowRecordListDTO> listDTOS = records.stream().map(e -> // List<TaxDeclarationApiFlowRecordListDTO> listDTOS = records.stream().map(e ->
TaxApiFlowBO.taxDeclarationApiFlowRecordPo2ListDTO(propertiesWrapper, indexNum, e) // TaxApiFlowBO.taxDeclarationApiFlowRecordPo2ListDTO(propertiesWrapper, indexNum, e)
).collect(Collectors.toList()); // ).collect(Collectors.toList());
return new SalaryPage<>(queryParam.getCurrent(), queryParam.getPageSize(), flowRecordPOPage.getTotal(), listDTOS); // return new SalaryPage<>(queryParam.getCurrent(), queryParam.getPageSize(), flowRecordPOPage.getTotal(), listDTOS);
} // }
//
// @Override
// public List<TaxDeclarationApiFlowRecordListDTO> listFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam) {
// LambdaQueryChainWrapper<TaxDeclarationApiFlowRecordPO> queryChainWrapper = getFlowRecordQueryChainWrapper(queryParam);
// List<TaxDeclarationApiFlowRecordPO> list = queryChainWrapper.list();
// if (list.isEmpty()) {
// return new ArrayList<>();
// }
// TempPropertiesWrapper propertiesWrapper = getUserInfoAndTaxAgentMap(list);
// // 转换数据
// AtomicInteger indexNum = new AtomicInteger(1);
// return list.stream().map(e -> TaxApiFlowBO.taxDeclarationApiFlowRecordPo2ListDTO(propertiesWrapper, indexNum, e)).collect(Collectors.toList());
// }
//
// private TempPropertiesWrapper getUserInfoAndTaxAgentMap(List<TaxDeclarationApiFlowRecordPO> list, String currentTenantKey) {
// Map<Long, Long> employeeTaxAgentMap = SalaryEntityUtil.convert2Map(list, TaxDeclarationApiFlowRecordPO::getEmployeeId, TaxDeclarationApiFlowRecordPO::getTaxAgentId);
// // 获取人员信息
// List<HrmEmployeeComInfo> employeeComInfos = comInfoCache.getCacheList(HrmEmployeeComInfo.class, new ArrayList<>(employeeTaxAgentMap.keySet()));
// Map<Long, String> empNameMap = SalaryEntityUtil.convert2Map(employeeComInfos, HrmEmployeeComInfo::getId, HrmEmployeeComInfo::getUsername);
// Map<Long, String> empIdNoMap = getSalaryEmployeeService(user).mapByEmployeeIds(employeeTaxAgentMap.keySet());
// List<ExtEmployeePO> extEmployeePOS = extEmployeeService.listAll(currentTenantKey);
// Map<Long, ExtEmployeePO> extEmployeeMap = SalaryEntityUtil.convert2Map(extEmployeePOS, ExtEmployeePO::getId);
// // 获取个税扣缴义务人信息
// List<TaxAgentPO> taxAgentPOS = getTaxAgentService(user).listByIds(new HashSet<>(employeeTaxAgentMap.values()));
// Map<Long, String> taxAgentNameMap = SalaryEntityUtil.convert2Map(taxAgentPOS, TaxAgentPO::getId, TaxAgentPO::getName);
// return new TempPropertiesWrapper(empNameMap, empIdNoMap, taxAgentNameMap, extEmployeeMap);
// }
//
// private LambdaQueryChainWrapper<TaxDeclarationApiFlowRecordPO> getFlowRecordQueryChainWrapper(TaxDeclarationApiFlowRecordQueryParam queryParam, String currentTenantKey) {
// LambdaQueryChainWrapper<TaxDeclarationApiFlowRecordPO> chainWrapper = new LambdaQueryChainWrapper<>(taxDeclarationApiFlowRecordMapper)
// .eq(TaxDeclarationApiFlowRecordPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue())
// .eq(TaxDeclarationApiFlowRecordPO::getTenantKey)
// .eq(queryParam.getTaxAgentId() != null, TaxDeclarationApiFlowRecordPO::getTaxAgentId, queryParam.getTaxAgentId())
// .eq(queryParam.getBusinessType() != null, TaxDeclarationApiFlowRecordPO::getBusinessType, queryParam.getBusinessType())
// .eq(queryParam.getResult() != null, TaxDeclarationApiFlowRecordPO::getResultStatus, queryParam.getResult());
// if (queryParam.getStartDate() != null && queryParam.getEndDate() != null) {
// chainWrapper = chainWrapper.ge(TaxDeclarationApiFlowRecordPO::getUseTime, queryParam.getStartDate())
// .le(TaxDeclarationApiFlowRecordPO::getUseTime, queryParam.getEndDate());
// }
// return chainWrapper;
// }
@Override // @Override
public List<TaxDeclarationApiFlowRecordListDTO> listFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam) { // public void exportFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam, Map<String, Object> map) {
LambdaQueryChainWrapper<TaxDeclarationApiFlowRecordPO> queryChainWrapper = getFlowRecordQueryChainWrapper(queryParam); // ExportWrapper exportWrapper = new ExportWrapper(map, employeeId, tenantKey);
List<TaxDeclarationApiFlowRecordPO> list = queryChainWrapper.list(); // // 表头
if (list.isEmpty()) { // List<String> headers = exportWrapper.getHeaders();
return new ArrayList<>(); // headers.add(SalaryI18nUtil.getI18nLabel( 159083, "时间"));
} // headers.add(SalaryI18nUtil.getI18nLabel( 86184, "个税扣缴义务人"));
TempPropertiesWrapper propertiesWrapper = getUserInfoAndTaxAgentMap(list); // headers.add(SalaryI18nUtil.getI18nLabel( 100133, "人员"));
// 转换数据 // headers.add(SalaryI18nUtil.getI18nLabel( 106277, "身份证号"));
AtomicInteger indexNum = new AtomicInteger(1); // headers.add(SalaryI18nUtil.getI18nLabel( 159085, "接口服务"));
return list.stream().map(e -> TaxApiFlowBO.taxDeclarationApiFlowRecordPo2ListDTO(propertiesWrapper, indexNum, e)).collect(Collectors.toList()); // headers.add(SalaryI18nUtil.getI18nLabel( 85435, "操作人"));
} // headers.add(SalaryI18nUtil.getI18nLabel( 159086, "结果"));
// exportWrapper.getExcelSheetData().setHeaders(Collections.singletonList(headers.toArray(new String[]{})));
private TempPropertiesWrapper getUserInfoAndTaxAgentMap(List<TaxDeclarationApiFlowRecordPO> list, String currentTenantKey) { // // 获取数据
Map<Long, Long> employeeTaxAgentMap = SalaryEntityUtil.convert2Map(list, TaxDeclarationApiFlowRecordPO::getEmployeeId, TaxDeclarationApiFlowRecordPO::getTaxAgentId); // List<TaxDeclarationApiFlowRecordListDTO> dtoList = listFlowRecord(queryParam, employeeId, tenantKey);
// 获取人员信息 // // 组装数据
List<HrmEmployeeComInfo> employeeComInfos = comInfoCache.getCacheList(HrmEmployeeComInfo.class, new ArrayList<>(employeeTaxAgentMap.keySet())); // for (TaxDeclarationApiFlowRecordListDTO dto : dtoList) {
Map<Long, String> empNameMap = SalaryEntityUtil.convert2Map(employeeComInfos, HrmEmployeeComInfo::getId, HrmEmployeeComInfo::getUsername); // List<Object> row = new ArrayList<>();
Map<Long, String> empIdNoMap = salaryEmployeeService.mapByEmployeeIds(employeeTaxAgentMap.keySet()); // row.add(dto.getCreateTime());
List<ExtEmployeePO> extEmployeePOS = extEmployeeService.listAll(currentTenantKey); // row.add(dto.getTaxAgentName());
Map<Long, ExtEmployeePO> extEmployeeMap = SalaryEntityUtil.convert2Map(extEmployeePOS, ExtEmployeePO::getId); // row.add(dto.getEmployeeName());
// 获取个税扣缴义务人信息 // row.add(dto.getIdCardNo());
List<TaxAgentPO> taxAgentPOS = taxAgentService.listByIds(new HashSet<>(employeeTaxAgentMap.values())); // row.add(dto.getBusinessTypeName());
Map<Long, String> taxAgentNameMap = SalaryEntityUtil.convert2Map(taxAgentPOS, TaxAgentPO::getId, TaxAgentPO::getName); // row.add(dto.getCreator());
return new TempPropertiesWrapper(empNameMap, empIdNoMap, taxAgentNameMap, extEmployeeMap); // row.add(dto.getResult());
} // exportWrapper.getRows().add(row);
// }
private LambdaQueryChainWrapper<TaxDeclarationApiFlowRecordPO> getFlowRecordQueryChainWrapper(TaxDeclarationApiFlowRecordQueryParam queryParam, String currentTenantKey) { // // 生成表格
LambdaQueryChainWrapper<TaxDeclarationApiFlowRecordPO> chainWrapper = new LambdaQueryChainWrapper<>(taxDeclarationApiFlowRecordMapper) // buildExcelData(exportWrapper);
.eq(TaxDeclarationApiFlowRecordPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) // }
.eq(TaxDeclarationApiFlowRecordPO::getTenantKey)
.eq(queryParam.getTaxAgentId() != null, TaxDeclarationApiFlowRecordPO::getTaxAgentId, queryParam.getTaxAgentId())
.eq(queryParam.getBusinessType() != null, TaxDeclarationApiFlowRecordPO::getBusinessType, queryParam.getBusinessType())
.eq(queryParam.getResult() != null, TaxDeclarationApiFlowRecordPO::getResultStatus, queryParam.getResult());
if (queryParam.getStartDate() != null && queryParam.getEndDate() != null) {
chainWrapper = chainWrapper.ge(TaxDeclarationApiFlowRecordPO::getUseTime, queryParam.getStartDate())
.le(TaxDeclarationApiFlowRecordPO::getUseTime, queryParam.getEndDate());
}
return chainWrapper;
}
@Override
public void exportFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam, Map<String, Object> map) {
ExportWrapper exportWrapper = new ExportWrapper(map, employeeId, tenantKey);
// 表头
List<String> headers = exportWrapper.getHeaders();
headers.add(SalaryI18nUtil.getI18nLabel( 159083, "时间"));
headers.add(SalaryI18nUtil.getI18nLabel( 86184, "个税扣缴义务人"));
headers.add(SalaryI18nUtil.getI18nLabel( 100133, "人员"));
headers.add(SalaryI18nUtil.getI18nLabel( 106277, "身份证号"));
headers.add(SalaryI18nUtil.getI18nLabel( 159085, "接口服务"));
headers.add(SalaryI18nUtil.getI18nLabel( 85435, "操作人"));
headers.add(SalaryI18nUtil.getI18nLabel( 159086, "结果"));
exportWrapper.getExcelSheetData().setHeaders(Collections.singletonList(headers.toArray(new String[]{})));
// 获取数据
List<TaxDeclarationApiFlowRecordListDTO> dtoList = listFlowRecord(queryParam, employeeId, tenantKey);
// 组装数据
for (TaxDeclarationApiFlowRecordListDTO dto : dtoList) {
List<Object> row = new ArrayList<>();
row.add(dto.getCreateTime());
row.add(dto.getTaxAgentName());
row.add(dto.getEmployeeName());
row.add(dto.getIdCardNo());
row.add(dto.getBusinessTypeName());
row.add(dto.getCreator());
row.add(dto.getResult());
exportWrapper.getRows().add(row);
}
// 生成表格
buildExcelData(exportWrapper);
}
/**
* 构建excel数据
*
* @param wrapper
*/
private void buildExcelData(ExportWrapper wrapper) {
wrapper.getExcelSheetData().setRows(wrapper.getRows());
wrapper.getSheetList().add(wrapper.getExcelSheetData());
salaryBatchService.simpleExportExcel(wrapper.buildExportExcelInfo(), wrapper.getSheetList());
}
@BatchExportHandler("exportFlowRecord")
public void exportFlowRecordHandler() {
BatchCallbackMessage message = BatchExportContext.getBatchCallbackMessage();
log.info("接收到流量使用记录导出的结果:{}", JSONObject.toJSONString(message));
}
// /**
// * 构建excel数据
// *
// * @param wrapper
// */
// private void buildExcelData(ExportWrapper wrapper) {
// wrapper.getExcelSheetData().setRows(wrapper.getRows());
// wrapper.getSheetList().add(wrapper.getExcelSheetData());
// salaryBatchService.simpleExportExcel(wrapper.buildExportExcelInfo(), wrapper.getSheetList());
// }
//
/** /**
* 封装一些临时的集合类便于方法复用 * 封装一些临时的集合类便于方法复用
*/ */
@ -185,7 +175,7 @@ public class TaxDeclarationApiBillingServiceImpl implements TaxDeclarationApiBil
// 获取个税扣缴义务人信息 // 获取个税扣缴义务人信息
private Map<Long, String> taxAgentNameMap; private Map<Long, String> taxAgentNameMap;
// 获取非系统人员 // 获取非系统人员
private Map<Long, ExtEmployeePO> extEmployeeMap; private Map<Long, ExtEmpPO> extEmployeeMap;
} }
@Data @Data
@ -193,7 +183,7 @@ public class TaxDeclarationApiBillingServiceImpl implements TaxDeclarationApiBil
private String tenantKey; private String tenantKey;
private Long currentEmployeeId; private Long currentEmployeeId;
// 税款所属期 // 税款所属期
private LocalDate taxYearMonth; private Date taxYearMonth;
// api流量使用情况 // api流量使用情况
private List<TaxDeclarationApiFlowRecordPO> apiFlowDetailPOList; private List<TaxDeclarationApiFlowRecordPO> apiFlowDetailPOList;
// 当前租户的api接口配置 // 当前租户的api接口配置
@ -201,7 +191,7 @@ public class TaxDeclarationApiBillingServiceImpl implements TaxDeclarationApiBil
// 接口类型 // 接口类型
private EnumDeclareApiBusinessType businessType; private EnumDeclareApiBusinessType businessType;
public ApiFlowUpdateWrapper(String tenantKey, Long currentEmployeeId, LocalDate taxYearMonth, TaxDeclarationApiConfigPO apiConfig, EnumDeclareApiBusinessType businessType) { public ApiFlowUpdateWrapper( Date taxYearMonth, TaxDeclarationApiConfigPO apiConfig, EnumDeclareApiBusinessType businessType) {
this.tenantKey = tenantKey; this.tenantKey = tenantKey;
this.currentEmployeeId = currentEmployeeId; this.currentEmployeeId = currentEmployeeId;
this.taxYearMonth = taxYearMonth; this.taxYearMonth = taxYearMonth;

View File

@ -15,15 +15,11 @@ import com.engine.salary.mapper.taxdeclaration.TaxDeclarationApiProfileMapper;
import com.engine.salary.mapper.taxdeclaration.TaxDeclareApiConfigMapper; import com.engine.salary.mapper.taxdeclaration.TaxDeclareApiConfigMapper;
import com.engine.salary.service.TaxDeclarationApiConfigService; import com.engine.salary.service.TaxDeclarationApiConfigService;
import com.engine.salary.util.*; import com.engine.salary.util.*;
import com.engine.salary.util.db.MapperProxyFactory;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDateTime; import java.util.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
/** /**
* @author chengliming * @author chengliming
@ -32,13 +28,16 @@ import java.util.Optional;
@Slf4j @Slf4j
public class TaxDeclarationApiConfigServiceImpl extends Service implements TaxDeclarationApiConfigService { public class TaxDeclarationApiConfigServiceImpl extends Service implements TaxDeclarationApiConfigService {
private TaxDeclareApiConfigMapper taxDeclareApiConfigMapper; private TaxDeclareApiConfigMapper getTaxDeclareApiConfigMapper() {
return MapperProxyFactory.getProxy(TaxDeclareApiConfigMapper.class);
private TaxDeclarationApiProfileMapper taxDeclarationApiProfileMapper; }
private TaxDeclarationApiProfileMapper getTaxDeclarationApiProfileMapper() {
return MapperProxyFactory.getProxy(TaxDeclarationApiProfileMapper.class);
}
@Override @Override
public TaxDeclarationApiConfigPO getConfig(boolean needValid) { public TaxDeclarationApiConfigPO getConfig(boolean needValid) {
TaxDeclarationApiConfigPO configPO = taxDeclareApiConfigMapper.getOne(); TaxDeclarationApiConfigPO configPO = getTaxDeclareApiConfigMapper().getOne();
if (needValid) { if (needValid) {
String tips1 = SalaryI18nUtil.getI18nLabel(183786, "当前用户智能算薪尚未配置,请先前往[设置] -> [智能算薪]中配置"); String tips1 = SalaryI18nUtil.getI18nLabel(183786, "当前用户智能算薪尚未配置,请先前往[设置] -> [智能算薪]中配置");
String tips2 = SalaryI18nUtil.getI18nLabel(183787, "当前用户智能算薪尚未启用,请先前往[设置] -> [智能算薪]中启用该配置"); String tips2 = SalaryI18nUtil.getI18nLabel(183787, "当前用户智能算薪尚未启用,请先前往[设置] -> [智能算薪]中启用该配置");
@ -57,21 +56,21 @@ public class TaxDeclarationApiConfigServiceImpl extends Service implements TaxDe
@Override @Override
public void insert(TaxDeclarationApiConfigPO configPO) { public void insert(TaxDeclarationApiConfigPO configPO) {
taxDeclareApiConfigMapper.insertIgnoreNull(configPO); getTaxDeclareApiConfigMapper().insertIgnoreNull(configPO);
} }
@Override @Override
public void update(TaxDeclarationApiConfigPO config) { public void update(TaxDeclarationApiConfigPO config) {
taxDeclareApiConfigMapper.updateIgnoreNull(config); getTaxDeclareApiConfigMapper().updateIgnoreNull(config);
} }
@Override @Override
@Transactional(rollbackFor = Exception.class)
public void enableConfig(TaxDeclarationBillingConfigSaveParam saveParam) { public void enableConfig(TaxDeclarationBillingConfigSaveParam saveParam) {
TaxDeclarationApiConfigPO config = this.getConfig(false); TaxDeclarationApiConfigPO config = this.getConfig(false);
Date now = new Date();
if (config != null) { if (config != null) {
config.setEnableUse(SalaryOnOffEnum.valueOf(saveParam.getEnable()).getValue()) config.setEnableUse(SalaryOnOffEnum.valueOf(saveParam.getEnable()).getValue())
.setUpdateTime(LocalDateTime.now()); .setUpdateTime(now);
update(config); update(config);
} else { } else {
config = TaxApiFlowBO.buildTaxDeclarationApiConfigPO(saveParam, (long) user.getUID()); config = TaxApiFlowBO.buildTaxDeclarationApiConfigPO(saveParam, (long) user.getUID());
@ -81,14 +80,13 @@ public class TaxDeclarationApiConfigServiceImpl extends Service implements TaxDe
} }
@Override @Override
@Transactional(rollbackFor = Exception.class)
public void saveConfig(TaxDeclarationBillingConfigSaveParam saveParam) { public void saveConfig(TaxDeclarationBillingConfigSaveParam saveParam) {
TaxDeclarationApiConfigPO config = this.getConfig(false); TaxDeclarationApiConfigPO config = this.getConfig(false);
if (config != null) { if (config != null) {
config.setAppKey(saveParam.getAppKey()) config.setAppKey(saveParam.getAppKey())
.setAppSecret(saveParam.getAppSecret()) .setAppSecret(saveParam.getAppSecret())
.setEnableUse(SalaryOnOffEnum.valueOf(saveParam.getEnable()).getValue()) .setEnableUse(SalaryOnOffEnum.valueOf(saveParam.getEnable()).getValue())
.setUpdateTime(LocalDateTime.now()); .setUpdateTime(new Date());
update(config); update(config);
} else { } else {
config = TaxApiFlowBO.buildTaxDeclarationApiConfigPO(saveParam, (long) user.getUID()); config = TaxApiFlowBO.buildTaxDeclarationApiConfigPO(saveParam, (long) user.getUID());
@ -109,7 +107,7 @@ public class TaxDeclarationApiConfigServiceImpl extends Service implements TaxDe
} }
private String getApiHost() { private String getApiHost() {
List<TaxDeclarationApiProfilePO> apiProfiles = taxDeclarationApiProfileMapper.listAll(); List<TaxDeclarationApiProfilePO> apiProfiles = getTaxDeclarationApiProfileMapper().listAll();
if (apiProfiles.isEmpty() || TaxDeclareApiProfileEnum.PROD.getValue().equals(apiProfiles.get(0).getApiProfile())) { if (apiProfiles.isEmpty() || TaxDeclareApiProfileEnum.PROD.getValue().equals(apiProfiles.get(0).getApiProfile())) {
return SzyhApiConstant.HOST_URL; return SzyhApiConstant.HOST_URL;
} }

View File

@ -2,30 +2,30 @@
// //
//import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; //import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
//import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper; //import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper;
//import com.engine.salary.entity.taxagent.po.TaxAgentEmployeePO;
//import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowWarnReceiverListDTO;
//import com.engine.salary.entity.taxapiflow.po.TaxDeclarationApiFlowWarnConfigPO; //import com.engine.salary.entity.taxapiflow.po.TaxDeclarationApiFlowWarnConfigPO;
//import com.engine.salary.entity.taxapiflow.po.TaxDeclarationApiFlowWarnReceiverPO;
//import com.engine.salary.mapper.taxdeclaration.TaxDeclarationApiFlowWarnConfigMapper; //import com.engine.salary.mapper.taxdeclaration.TaxDeclarationApiFlowWarnConfigMapper;
//import com.engine.salary.service.SalaryEmployeeService; //import com.engine.salary.service.SalaryEmployeeService;
//import com.engine.salary.service.TaxDeclarationApiFlowWarnService; //import com.engine.salary.service.TaxDeclarationApiFlowWarnService;
//import com.engine.salary.util.SalaryEntityUtil;
//import com.weaver.common.base.entity.result.WeaResult; //import com.weaver.common.base.entity.result.WeaResult;
//import com.weaver.common.distribution.genid.IdGenerator; //import com.weaver.common.distribution.genid.IdGenerator;
//import com.weaver.framework.spring.annotation.AopClass; //import com.weaver.framework.spring.annotation.AopClass;
//import com.weaver.hrm.salary.common.OptionDTO; //import com.weaver.hrm.salary.common.OptionDTO;
//import com.weaver.hrm.salary.dao.TaxDeclarationApiFlowWarnReceiverMapper; //import com.weaver.hrm.salary.dao.TaxDeclarationApiFlowWarnReceiverMapper;
//import com.weaver.hrm.salary.entity.taxagent.po.TaxAgentEmployeePO;
//import com.weaver.hrm.salary.entity.taxapiflow.bo.TaxApiFlowBO; //import com.weaver.hrm.salary.entity.taxapiflow.bo.TaxApiFlowBO;
//import com.weaver.hrm.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowWarnReceiverFormDTO; //import com.weaver.hrm.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowWarnReceiverFormDTO;
//import com.weaver.hrm.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowWarnReceiverListDTO;
//import com.weaver.hrm.salary.entity.taxapiflow.param.CreateMessageRuleParam; //import com.weaver.hrm.salary.entity.taxapiflow.param.CreateMessageRuleParam;
//import com.weaver.hrm.salary.entity.taxapiflow.param.TaxDeclarationApiFlowWarnConfigSaveParam; //import com.weaver.hrm.salary.entity.taxapiflow.param.TaxDeclarationApiFlowWarnConfigSaveParam;
//import com.weaver.hrm.salary.entity.taxapiflow.param.TaxDeclarationApiFlowWarnReceiverSaveParam; //import com.weaver.hrm.salary.entity.taxapiflow.param.TaxDeclarationApiFlowWarnReceiverSaveParam;
//import com.weaver.hrm.salary.entity.taxapiflow.po.TaxDeclarationApiFlowWarnReceiverPO;
//import com.weaver.hrm.salary.entity.taxapiflow.response.QueryAccountBalanceResponse; //import com.weaver.hrm.salary.entity.taxapiflow.response.QueryAccountBalanceResponse;
//import com.weaver.hrm.salary.enums.salaryitem.SalaryOnOffEnum; //import com.weaver.hrm.salary.enums.salaryitem.SalaryOnOffEnum;
//import com.weaver.hrm.salary.enums.sicategory.DeleteTypeEnum; //import com.weaver.hrm.salary.enums.sicategory.DeleteTypeEnum;
//import com.weaver.hrm.salary.service.TaxAgentService; //import com.weaver.hrm.salary.service.TaxAgentService;
//import com.weaver.hrm.salary.service.TaxDeclarationApiFlowStatisticService; //import com.weaver.hrm.salary.service.TaxDeclarationApiFlowStatisticService;
//import com.weaver.hrm.salary.util.SalaryAssert; //import com.weaver.hrm.salary.util.SalaryAssert;
//import com.weaver.hrm.salary.util.SalaryEntityUtil;
//import com.weaver.hrm.salary.util.SalaryI18nUtil; //import com.weaver.hrm.salary.util.SalaryI18nUtil;
//import com.weaver.mc.api.async.AsyncSystemMessageRest; //import com.weaver.mc.api.async.AsyncSystemMessageRest;
//import com.weaver.mc.api.entity.*; //import com.weaver.mc.api.entity.*;

View File

@ -358,4 +358,51 @@ public class SalaryEntityUtil {
} }
public static String null2String(Object obj) {
if (Objects.isNull(obj)) {
return "";
}
return obj.toString();
}
public static String null2String(Object obj, String def) {
if (Objects.isNull(obj)) {
return def;
}
return obj.toString();
}
public static Integer getIntValue(Object obj, Integer def) {
if (Objects.isNull(obj)) {
return def;
}
try {
return StringUtils.isEmpty(String.valueOf(obj)) ? def : Integer.valueOf(String.valueOf(obj));
} catch (NumberFormatException e) {
return def;
}
}
public static BigDecimal getBigDecimal(Object value, int scale) {
String valueStr = null2String(value);
if (StringUtils.isEmpty(valueStr)) {
return BigDecimal.ZERO;
}
try {
return new BigDecimal(valueStr).setScale(scale, RoundingMode.HALF_UP);
} catch (NumberFormatException e) {
return null;
}
}
public static BigDecimal getBigDecimal(Object value, int scale, BigDecimal defValue) {
try {
return new BigDecimal(null2String(value)).setScale(scale, RoundingMode.HALF_UP);
} catch (NumberFormatException e) {
return defValue;
}
}
} }

View File

@ -10,7 +10,6 @@ import com.engine.salary.util.ResponseResult;
import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.PageInfo;
import com.engine.salary.wrapper.EmployeeDeclareWrapper; import com.engine.salary.wrapper.EmployeeDeclareWrapper;
import io.swagger.v3.oas.annotations.parameters.RequestBody; import io.swagger.v3.oas.annotations.parameters.RequestBody;
import oracle.jdbc.proxy.annotation.Post;
import weaver.hrm.HrmUserVarify; import weaver.hrm.HrmUserVarify;
import weaver.hrm.User; import weaver.hrm.User;
@ -35,8 +34,6 @@ public class EmployeeDeclareController {
return ServiceUtil.getService(EmployeeDeclareWrapper.class, user); return ServiceUtil.getService(EmployeeDeclareWrapper.class, user);
} }
// private SalaryBatchService salaryBatchService;
/** /**
* 人员报送-个税扣缴义务人列表 * 人员报送-个税扣缴义务人列表
* *
@ -71,7 +68,7 @@ public class EmployeeDeclareController {
* @param queryParam 查询条件 * @param queryParam 查询条件
* @return * @return
*/ */
@Post @POST
@Path("/list4Add") @Path("/list4Add")
@Produces(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON)
public String list4Add(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareAddListQueryParam queryParam) { public String list4Add(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareAddListQueryParam queryParam) {
@ -85,7 +82,7 @@ public class EmployeeDeclareController {
* @param queryParam 查询条件 * @param queryParam 查询条件
* @return * @return
*/ */
@Post @POST
@Path("/list4Update") @Path("/list4Update")
@Produces(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON)
public String list4Update(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareListQueryParam queryParam) { public String list4Update(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareListQueryParam queryParam) {
@ -123,7 +120,7 @@ public class EmployeeDeclareController {
// @GetMapping("/getBatchUpdateForm") // @GetMapping("/getBatchUpdateForm")
// @ApiOperation("人员报送-获取批量编辑的表单") // @ApiOperation("人员报送-获取批量编辑的表单")
// @WeaPermission // @Produces(MediaType.APPLICATION_JSON)
// public WeaResult<WeaForm> getBatchUpdateForm() { // public WeaResult<WeaForm> getBatchUpdateForm() {
// WeaForm weaForm = employeeDeclareWrapper.getBatchUpdateForm(); // WeaForm weaForm = employeeDeclareWrapper.getBatchUpdateForm();
// return WeaResult.success(weaForm); // return WeaResult.success(weaForm);
@ -131,35 +128,35 @@ public class EmployeeDeclareController {
// //
// @GetMapping("/getSearchCondition") // @GetMapping("/getSearchCondition")
// @ApiOperation("人员报送-获取高级搜索条件") // @ApiOperation("人员报送-获取高级搜索条件")
// @WeaPermission // @Produces(MediaType.APPLICATION_JSON)
// public WeaResult<WeaSearchCondition> getSearchCondition() { // public WeaResult<WeaSearchCondition> getSearchCondition() {
// WeaSearchCondition searchCondition = employeeDeclareWrapper.getSearchCondition(); // WeaSearchCondition searchCondition = employeeDeclareWrapper.getSearchCondition();
// return WeaResult.success(searchCondition); // return WeaResult.success(searchCondition);
// } // }
//
// /** /**
// * 人员报送-新增人员/编辑人员保存 * 人员报送-新增人员/编辑人员保存
// * *
// * @param saveParam 保存参数 * @param saveParam 保存参数
// * @return * @return
// */ */
// @PostMapping("/save") @POST
// @ApiOperation("人员报送-新增人员/编辑人员保存") @Path("/save")
// @WeaPermission @Produces(MediaType.APPLICATION_JSON)
// public WeaResult<Object> save(@RequestBody @Validated EmployeeDeclareSaveParam saveParam) { public String save(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareSaveParam saveParam) {
// employeeDeclareWrapper.save(saveParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()); User user = HrmUserVarify.getUser(request, response);
// return WeaResult.success(null); return new ResponseResult<EmployeeDeclareSaveParam, PageInfo<EmployeeDeclareFailListDTO>>(user).run(getEmployeeDeclareWrapper(user)::save, saveParam);
// } }
//
// /** // /**
// * 人员报送-批量编辑 // * 人员报送-批量编辑
// * // *
// * @param batchUpdateParam 批量编辑参数 // * @param batchUpdateParam 批量编辑参数
// * @return // * @return
// */ // */
// @PostMapping("/batchUpdate") // @Path("/batchUpdate")
// @ApiOperation("人员报送-批量编辑") // @ApiOperation("人员报送-批量编辑")
// @WeaPermission // @Produces(MediaType.APPLICATION_JSON)
// public WeaResult<Object> batchUpdate(@RequestBody @Validated EmployeeDeclareBatchUpdateParam batchUpdateParam) { // public WeaResult<Object> batchUpdate(@RequestBody @Validated EmployeeDeclareBatchUpdateParam batchUpdateParam) {
// employeeDeclareWrapper.batchUpdate(batchUpdateParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()); // employeeDeclareWrapper.batchUpdate(batchUpdateParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey());
// return WeaResult.success(null); // return WeaResult.success(null);
@ -185,7 +182,7 @@ public class EmployeeDeclareController {
* @param refreshParam 刷新数据的参数 * @param refreshParam 刷新数据的参数
* @return * @return
*/ */
@Post @POST
@Path("/refresh") @Path("/refresh")
@Produces(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON)
public String refresh(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareRefreshParam refreshParam) { public String refresh(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareRefreshParam refreshParam) {
@ -207,34 +204,34 @@ public class EmployeeDeclareController {
return new ResponseResult<EmployeeDeclareParam, EmployeeDeclareInfoDTO>(user).run(getEmployeeDeclareWrapper(user)::getDeclareInfo, employeeDeclareParam); return new ResponseResult<EmployeeDeclareParam, EmployeeDeclareInfoDTO>(user).run(getEmployeeDeclareWrapper(user)::getDeclareInfo, employeeDeclareParam);
} }
// /** /**
// * 人员报送-全部报送 * 人员报送-全部报送
// * *
// * @param employeeDeclareParam 在线报送 * @param employeeDeclareParam 在线报送
// * @return * @return
// */ */
// @PostMapping("/declare") @POST
// @ApiOperation("人员报送-全部报送") @Path("/declare")
// @WeaPermission @Produces(MediaType.APPLICATION_JSON)
// public WeaResult<Object> declare(@RequestBody @Validated EmployeeDeclareParam employeeDeclareParam) { public String declare(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareParam employeeDeclareParam) {
// String rateIndex = employeeDeclareWrapper.declare(employeeDeclareParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()); User user = HrmUserVarify.getUser(request, response);
// return WeaResult.success(rateIndex); return new ResponseResult<EmployeeDeclareParam, EmployeeDeclareInfoDTO>(user).run(getEmployeeDeclareWrapper(user)::declare, employeeDeclareParam);
// } }
//
// /** /**
// * 人员报送-获取报送结果反馈 * 人员报送-获取报送结果反馈
// * *
// * @param employeeDeclareParam 获取反馈 * @param employeeDeclareParam 获取反馈
// * @return * @return
// */ */
// @PostMapping("/getDeclareFeedback") @POST
// @ApiOperation("人员报送-获取报送结果反馈") @Path("/getDeclareFeedback")
// @WeaPermission @Produces(MediaType.APPLICATION_JSON)
// public WeaResult<Object> getDeclareFeedback(@RequestBody @Validated EmployeeDeclareParam employeeDeclareParam) { public String getDeclareFeedback(@Context HttpServletRequest request, @Context HttpServletResponse response,@RequestBody EmployeeDeclareParam employeeDeclareParam) {
// String rateIndex = employeeDeclareWrapper.getDeclareFeedback(employeeDeclareParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()); User user = HrmUserVarify.getUser(request, response);
// return WeaResult.success(rateIndex); return new ResponseResult<EmployeeDeclareParam, EmployeeDeclareInfoDTO>(user).run(getEmployeeDeclareWrapper(user)::getDeclareFeedback, employeeDeclareParam);
// } }
//
// /** // /**
// * 人员报送-后端业务逻辑是否已经完成 // * 人员报送-后端业务逻辑是否已经完成
// * // *
@ -243,7 +240,7 @@ public class EmployeeDeclareController {
// */ // */
// @GetMapping("/getRate") // @GetMapping("/getRate")
// @ApiOperation("人员报送-后端业务逻辑是否已经完成") // @ApiOperation("人员报送-后端业务逻辑是否已经完成")
// @WeaPermission // @Produces(MediaType.APPLICATION_JSON)
// public WeaResult<EmployeeDeclareRateDTO> getRate(@RequestParam(value = "index") String index) { // public WeaResult<EmployeeDeclareRateDTO> getRate(@RequestParam(value = "index") String index) {
// EmployeeDeclareRateDTO rate = employeeDeclareWrapper.getRate(index, TenantContext.getCurrentTenantKey()); // EmployeeDeclareRateDTO rate = employeeDeclareWrapper.getRate(index, TenantContext.getCurrentTenantKey());
// return WeaResult.success(rate); // return WeaResult.success(rate);
@ -255,9 +252,9 @@ public class EmployeeDeclareController {
// * @param queryParam 导出参数 // * @param queryParam 导出参数
// * @return // * @return
// */ // */
// @PostMapping("/export") // @Path("/export")
// @ApiOperation("人员报送-导出全部人员") // @ApiOperation("人员报送-导出全部人员")
// @WeaPermission // @Produces(MediaType.APPLICATION_JSON)
// public WeaResult<Object> export(@RequestBody @Validated EmployeeDeclareListQueryParam queryParam) { // public WeaResult<Object> export(@RequestBody @Validated EmployeeDeclareListQueryParam queryParam) {
// Map<String, Object> exportMap = employeeDeclareWrapper.export(queryParam, UserContext.getCurrentUser()); // Map<String, Object> exportMap = employeeDeclareWrapper.export(queryParam, UserContext.getCurrentUser());
// return WeaResult.success(exportMap); // return WeaResult.success(exportMap);
@ -269,9 +266,9 @@ public class EmployeeDeclareController {
// * @param queryParam 导出参数 // * @param queryParam 导出参数
// * @return // * @return
// */ // */
// @PostMapping("/export4Add") // @Path("/export4Add")
// @ApiOperation("人员报送-导出本月新增人员") // @ApiOperation("人员报送-导出本月新增人员")
// @WeaPermission // @Produces(MediaType.APPLICATION_JSON)
// public WeaResult<Object> export4Add(@RequestBody @Validated EmployeeDeclareAddListQueryParam queryParam) { // public WeaResult<Object> export4Add(@RequestBody @Validated EmployeeDeclareAddListQueryParam queryParam) {
// Map<String, Object> exportMap = employeeDeclareWrapper.export4Add(queryParam, UserContext.getCurrentUser()); // Map<String, Object> exportMap = employeeDeclareWrapper.export4Add(queryParam, UserContext.getCurrentUser());
// return WeaResult.success(exportMap); // return WeaResult.success(exportMap);
@ -283,9 +280,9 @@ public class EmployeeDeclareController {
// * @param queryParam 导出参数 // * @param queryParam 导出参数
// * @return // * @return
// */ // */
// @PostMapping("/export4Update") // @Path("/export4Update")
// @ApiOperation("人员报送-导出本月信息变动人员") // @ApiOperation("人员报送-导出本月信息变动人员")
// @WeaPermission // @Produces(MediaType.APPLICATION_JSON)
// public WeaResult<Object> export4Update(@RequestBody @Validated EmployeeDeclareListQueryParam queryParam) { // public WeaResult<Object> export4Update(@RequestBody @Validated EmployeeDeclareListQueryParam queryParam) {
// Map<String, Object> exportMap = employeeDeclareWrapper.export4Update(queryParam, UserContext.getCurrentUser()); // Map<String, Object> exportMap = employeeDeclareWrapper.export4Update(queryParam, UserContext.getCurrentUser());
// return WeaResult.success(exportMap); // return WeaResult.success(exportMap);
@ -297,9 +294,9 @@ public class EmployeeDeclareController {
// * @param queryParam 导出参数 // * @param queryParam 导出参数
// * @return // * @return
// */ // */
// @PostMapping("/export4Fail") // @Path("/export4Fail")
// @ApiOperation("人员报送-导出本月报送失败的人员") // @ApiOperation("人员报送-导出本月报送失败的人员")
// @WeaPermission // @Produces(MediaType.APPLICATION_JSON)
// public WeaResult<Object> export4Fail(@RequestBody @Validated EmployeeDeclareFailListQueryParam queryParam) { // public WeaResult<Object> export4Fail(@RequestBody @Validated EmployeeDeclareFailListQueryParam queryParam) {
// Map<String, Object> exportMap = employeeDeclareWrapper.export4Fail(queryParam, UserContext.getCurrentUser()); // Map<String, Object> exportMap = employeeDeclareWrapper.export4Fail(queryParam, UserContext.getCurrentUser());
// return WeaResult.success(exportMap); // return WeaResult.success(exportMap);
@ -307,7 +304,7 @@ public class EmployeeDeclareController {
// //
// @GetMapping("/getImportParam") // @GetMapping("/getImportParam")
// @ApiOperation("人员报送-获取导入参数") // @ApiOperation("人员报送-获取导入参数")
// @WeaPermission // @Produces(MediaType.APPLICATION_JSON)
// public WeaResult<ExcelImportParam> getAcctResultImportParams() { // public WeaResult<ExcelImportParam> getAcctResultImportParams() {
// String tenantKey = TenantContext.getCurrentTenantKey(); // String tenantKey = TenantContext.getCurrentTenantKey();
// Long currentEmployeeId = UserContext.getCurrentEmployeeId(); // Long currentEmployeeId = UserContext.getCurrentEmployeeId();
@ -324,9 +321,9 @@ public class EmployeeDeclareController {
// * @param importParam 获取导入模板 // * @param importParam 获取导入模板
// * @return // * @return
// */ // */
// @PostMapping("/exportTemplate") // @Path("/exportTemplate")
// @ApiOperation("人员报送-导出导入模板") // @ApiOperation("人员报送-导出导入模板")
// @WeaPermission // @Produces(MediaType.APPLICATION_JSON)
// public WeaResult<Object> exportTemplate(@RequestBody @Validated EmployeeDeclareImportParam importParam) { // public WeaResult<Object> exportTemplate(@RequestBody @Validated EmployeeDeclareImportParam importParam) {
// Map<String, Object> exportMap = employeeDeclareWrapper.exportTemplate(importParam, UserContext.getCurrentUser()); // Map<String, Object> exportMap = employeeDeclareWrapper.exportTemplate(importParam, UserContext.getCurrentUser());
// return WeaResult.success(exportMap); // return WeaResult.success(exportMap);

View File

@ -0,0 +1,119 @@
package com.engine.salary.web;
import com.engine.common.util.ServiceUtil;
import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowRecordListDTO;
import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationBillingConfigFormDTO;
import com.engine.salary.entity.taxapiflow.param.TaxDeclarationApiFlowRecordQueryParam;
import com.engine.salary.entity.taxapiflow.param.TaxDeclarationBillingConfigSaveParam;
import com.engine.salary.util.ResponseResult;
import com.engine.salary.util.page.PageInfo;
import com.engine.salary.wrapper.TaxDeclarationApiFlowBillingWrapper;
import io.swagger.v3.oas.annotations.parameters.RequestBody;
import weaver.hrm.HrmUserVarify;
import weaver.hrm.User;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
/**
* 智能算薪-计费
*
* @author chengliming
* @date 2022-11-15 16:05:40
*/
public class TaxDeclarationApiFlowController {
private TaxDeclarationApiFlowBillingWrapper getTaxDeclarationApiFlowBillingWrapper(User user) {
return ServiceUtil.getService(TaxDeclarationApiFlowBillingWrapper.class, user);
}
/**
* 计费配置保存
*
* @param saveParam 保存参数
* @return WeaResult 返回结果
*/
@POST
@Path("/billing/config/save")
@Produces(MediaType.APPLICATION_JSON)
public String saveConfig(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclarationBillingConfigSaveParam saveParam) {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<TaxDeclarationBillingConfigSaveParam, String>(user).run(getTaxDeclarationApiFlowBillingWrapper(user)::saveConfig, saveParam);
}
/**
* 计费配置开关
*
* @param saveParam 保存参数
* @return WeaResult 返回结果
*/
@POST
@Path("/billing/config/enable")
@Produces(MediaType.APPLICATION_JSON)
public String enableConfig(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclarationBillingConfigSaveParam saveParam) {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<TaxDeclarationBillingConfigSaveParam, String>(user).run(getTaxDeclarationApiFlowBillingWrapper(user)::enableConfig, saveParam);
}
/**
* 查询计费配置开关状态
*
* @return WeaResult 返回结果
*/
@GET
@Path("/billing/config/status")
@Produces(MediaType.APPLICATION_JSON)
public String getConfigStatus(@Context HttpServletRequest request, @Context HttpServletResponse response) {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<TaxDeclarationBillingConfigSaveParam, Boolean>(user).run(getTaxDeclarationApiFlowBillingWrapper(user)::getConfigStatus);
}
/**
* 计费配置编辑表单
*
* @return WeaResult 返回结果
*/
@GET
@Path("/billing/config/get")
@Produces(MediaType.APPLICATION_JSON)
public String getConfig(@Context HttpServletRequest request, @Context HttpServletResponse response) {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<TaxDeclarationBillingConfigSaveParam, TaxDeclarationBillingConfigFormDTO>(user).run(getTaxDeclarationApiFlowBillingWrapper(user)::getConfig);
}
/**
* 接口流量使用记录
*
* @param queryParam 查询条件
* @return WeaResult 返回结果
*/
@POST
@Path("/record/list")
@Produces(MediaType.APPLICATION_JSON)
public String getFlowRecord(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclarationApiFlowRecordQueryParam queryParam) {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<TaxDeclarationApiFlowRecordQueryParam, PageInfo<TaxDeclarationApiFlowRecordListDTO>>(user).run(getTaxDeclarationApiFlowBillingWrapper(user)::getFlowRecord, queryParam);
}
//
// /**
// * 导出接口流量使用记录
// *
// * @param queryParam 查询条件
// * @return WeaResult 返回结果
// */
// @POST
// @Path("/record/export")
// @Produces(MediaType.APPLICATION_JSON)
// public String exportFlowRecord(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclarationApiFlowRecordQueryParam queryParam) {
// User user = HrmUserVarify.getUser(request, response);
// return new ResponseResult<TaxDeclarationApiFlowRecordQueryParam, PageInfo<TaxDeclarationApiFlowRecordListDTO>>(user).run(getTaxDeclarationApiFlowBillingWrapper(user)::getFlowRecord,queryParam);
// return WeaResult.success(getTaxDeclarationApiFlowBillingWrapper.exportFlowRecord(queryParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()));
// }
}

View File

@ -15,10 +15,13 @@ import com.engine.salary.entity.taxagent.po.TaxAgentPO;
import com.engine.salary.enums.SalaryOnOffEnum; import com.engine.salary.enums.SalaryOnOffEnum;
import com.engine.salary.enums.employeedeclare.*; import com.engine.salary.enums.employeedeclare.*;
import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum; import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum;
import com.engine.salary.exception.SalaryRunTimeException;
import com.engine.salary.service.EmployeeDeclareService; import com.engine.salary.service.EmployeeDeclareService;
import com.engine.salary.service.SalaryCacheService;
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.impl.EmployeeDeclareServiceImpl; import com.engine.salary.service.impl.EmployeeDeclareServiceImpl;
import com.engine.salary.service.impl.SalaryCacheServiceImpl;
import com.engine.salary.service.impl.SalaryEmployeeServiceImpl; import com.engine.salary.service.impl.SalaryEmployeeServiceImpl;
import com.engine.salary.service.impl.TaxAgentServiceImpl; import com.engine.salary.service.impl.TaxAgentServiceImpl;
import com.engine.salary.util.SalaryDateUtil; import com.engine.salary.util.SalaryDateUtil;
@ -63,6 +66,10 @@ public class EmployeeDeclareWrapper extends Service {
return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user);
} }
private SalaryCacheService getSalaryCacheService(User user) {
return ServiceUtil.getService(SalaryCacheServiceImpl.class, user);
}
/** /**
* 人员报送的个税扣缴义务人列表 * 人员报送的个税扣缴义务人列表
@ -182,7 +189,7 @@ public class EmployeeDeclareWrapper extends Service {
queryParam.getTaxCycle().plus(-1, ChronoUnit.MONTHS), queryParam.getTaxAgentId(), employeeIds); queryParam.getTaxCycle().plus(-1, ChronoUnit.MONTHS), queryParam.getTaxAgentId(), employeeIds);
// 获取修改了哪些字段 // 获取修改了哪些字段
Map<Long, Set<String>> updatedFieldMap = EmployeeDeclareList.getUpdatedField(poPageInfo.getList(), preTaxCycleEmployeeDeclares); Map<Long, Set<String>> updatedFieldMap = EmployeeDeclareList.getUpdatedField(poPageInfo.getList(), preTaxCycleEmployeeDeclares);
for (EmployeeDeclareListDTO employeeDeclareListDTO : (List<EmployeeDeclareListDTO>)dtoPageInfo.getList()) { for (EmployeeDeclareListDTO employeeDeclareListDTO : (List<EmployeeDeclareListDTO>) dtoPageInfo.getList()) {
Set<String> updatedDataIndexSet = updatedFieldMap.get(employeeDeclareListDTO); Set<String> updatedDataIndexSet = updatedFieldMap.get(employeeDeclareListDTO);
employeeDeclareListDTO.setUpdatedDataIndexSet(updatedDataIndexSet); employeeDeclareListDTO.setUpdatedDataIndexSet(updatedDataIndexSet);
} }
@ -378,19 +385,17 @@ public class EmployeeDeclareWrapper extends Service {
// }); // });
// return searchCondition; // return searchCondition;
// } // }
//
// /** /**
// * 人员报送-新增人员/编辑人员保存 * 人员报送-新增人员/编辑人员保存
// * *
// * @param saveParam * @param saveParam
// * @param employeeId */
// * @param tenantKey public void save(EmployeeDeclareSaveParam saveParam) {
// */ getEmployeeDeclareService(user).save(saveParam);
// public void save(EmployeeDeclareSaveParam saveParam, Long employeeId, String tenantKey) { }
// employeeDeclareService.save(saveParam, employeeId, tenantKey);
// }
//
//
// /** // /**
// * 批量编辑 // * 批量编辑
// * // *
@ -399,7 +404,7 @@ public class EmployeeDeclareWrapper extends Service {
// * @param tenantKey // * @param tenantKey
// */ // */
// public void batchUpdate(EmployeeDeclareBatchUpdateParam batchUpdateParam, Long employeeId, String tenantKey) { // public void batchUpdate(EmployeeDeclareBatchUpdateParam batchUpdateParam, Long employeeId, String tenantKey) {
// employeeDeclareService.batchUpdate(batchUpdateParam, employeeId, tenantKey); // getEmployeeDeclareService(user).batchUpdate(batchUpdateParam, employeeId, tenantKey);
// } // }
/** /**
@ -452,79 +457,76 @@ public class EmployeeDeclareWrapper extends Service {
return getEmployeeDeclareService(user).getDeclareInfo(employeeDeclareParam); return getEmployeeDeclareService(user).getDeclareInfo(employeeDeclareParam);
} }
// /** /**
// * 人员报送-全部报送 * 人员报送-全部报送
// * *
// * @param param * @param param
// * @param employeeId */
// * @param tenantKey public String declare(EmployeeDeclareParam param) {
// */ EmployeeDeclareRateDTO employeeDeclareRate = new EmployeeDeclareRateDTO()
// public String declare(EmployeeDeclareParam param, Long employeeId, String tenantKey) { .setIndex(UUID.randomUUID().toString())
// EmployeeDeclareRateDTO employeeDeclareRate = new EmployeeDeclareRateDTO() .setStatus(true)
// .setIndex(UUID.randomUUID().toString()) .setFinish(false)
// .setStatus(true) .setMsg("");
// .setFinish(false) getSalaryCacheService(user).set(SalaryCacheKey.EMPLOYEE_DECLARE + employeeDeclareRate.getIndex(), employeeDeclareRate);
// .setMsg("");
// boolean cacheResult = salaryCacheService.set(SalaryCacheKey.EMPLOYEE_DECLARE, employeeDeclareRate.getIndex(), employeeDeclareRate);
// if (!cacheResult) { // if (!cacheResult) {
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156513, "全部报送失败")); // throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156513, "全部报送失败"));
// } // }
// LocalRunnable localRunnable = new LocalRunnable() { LocalRunnable localRunnable = new LocalRunnable() {
// @Override @Override
// public void execute() { public void execute() {
// try { try {
// employeeDeclareService.declare(param, employeeId, tenantKey); getEmployeeDeclareService(user).declare(param);
// employeeDeclareRate.setFinish(true); employeeDeclareRate.setFinish(true);
// } catch (SalaryRunTimeException | SalaryNullException e) { } catch (SalaryRunTimeException e) {
// employeeDeclareRate.setStatus(false).setFinish(true).setMsg(e.getMessage()); employeeDeclareRate.setStatus(false).setFinish(true).setMsg(e.getMessage());
// } catch (Exception e) { } catch (Exception e) {
// log.error("全部报送失败:{}", e.getMessage(), e); log.error("全部报送失败:{}", e.getMessage(), e);
// employeeDeclareRate.setStatus(false).setFinish(true).setMsg(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 187472, "系统错误,请联系管理员:") + e.getMessage()); employeeDeclareRate.setStatus(false).setFinish(true).setMsg(SalaryI18nUtil.getI18nLabel(187472, "系统错误,请联系管理员:") + e.getMessage());
// } finally { } finally {
// salaryCacheService.set(SalaryCacheKey.EMPLOYEE_DECLARE, employeeDeclareRate.getIndex(), employeeDeclareRate); getSalaryCacheService(user).set(SalaryCacheKey.EMPLOYEE_DECLARE + employeeDeclareRate.getIndex(), employeeDeclareRate);
// } }
// } }
// }; };
// ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "declare", localRunnable); ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "declare", localRunnable);
// return employeeDeclareRate.getIndex(); return employeeDeclareRate.getIndex();
// } }
//
// /** /**
// * 人员报送-获取报送结果反馈 * 人员报送-获取报送结果反馈
// * *
// * @param param * @param param
// * @param tenantKey */
// */ public String getDeclareFeedback(EmployeeDeclareParam param) {
// public String getDeclareFeedback(EmployeeDeclareParam param, Long employeeId, String tenantKey) { EmployeeDeclareRateDTO employeeDeclareRate = new EmployeeDeclareRateDTO()
// EmployeeDeclareRateDTO employeeDeclareRate = new EmployeeDeclareRateDTO() .setIndex(UUID.randomUUID().toString())
// .setIndex(UUID.randomUUID().toString()) .setStatus(true)
// .setStatus(true) .setFinish(false)
// .setFinish(false) .setMsg("");
// .setMsg(""); getSalaryCacheService(user).set(SalaryCacheKey.EMPLOYEE_DECLARE + employeeDeclareRate.getIndex(), employeeDeclareRate);
// boolean cacheResult = salaryCacheService.set(SalaryCacheKey.EMPLOYEE_DECLARE, employeeDeclareRate.getIndex(), employeeDeclareRate);
// if (!cacheResult) { // if (!cacheResult) {
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156514, "获取报送结果反馈失败")); // throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156514, "获取报送结果反馈失败"));
// } // }
// LocalRunnable localRunnable = new LocalRunnable() { LocalRunnable localRunnable = new LocalRunnable() {
// @Override @Override
// public void execute() { public void execute() {
// try { try {
// employeeDeclareService.getDeclareFeedback(param, employeeDeclareRate, employeeId, tenantKey); getEmployeeDeclareService(user).getDeclareFeedback(param, employeeDeclareRate);
// employeeDeclareRate.setFinish(true); employeeDeclareRate.setFinish(true);
// } catch (SalaryRunTimeException | SalaryNullException e) { } catch (SalaryRunTimeException e) {
// employeeDeclareRate.setStatus(false).setFinish(true).setMsg(e.getMessage()); employeeDeclareRate.setStatus(false).setFinish(true).setMsg(e.getMessage());
// } catch (Exception e) { } catch (Exception e) {
// log.error("获取报送结果反馈失败:{}", e.getMessage(), e); log.error("获取报送结果反馈失败:{}", e.getMessage(), e);
// employeeDeclareRate.setStatus(false).setFinish(true).setMsg(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 187472, "系统错误,请联系管理员:") + e.getMessage()); employeeDeclareRate.setStatus(false).setFinish(true).setMsg(SalaryI18nUtil.getI18nLabel(187472, "系统错误,请联系管理员:") + e.getMessage());
// } finally { } finally {
// salaryCacheService.set(SalaryCacheKey.EMPLOYEE_DECLARE, employeeDeclareRate.getIndex(), employeeDeclareRate); getSalaryCacheService(user).set(SalaryCacheKey.EMPLOYEE_DECLARE + employeeDeclareRate.getIndex(), employeeDeclareRate);
// } }
// } }
// }; };
// ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "getDeclareFeedback", localRunnable); ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "getDeclareFeedback", localRunnable);
// return employeeDeclareRate.getIndex(); return employeeDeclareRate.getIndex();
// } }
//
// /** // /**
// * 获取人员报送相关后端接口是否已经完成 // * 获取人员报送相关后端接口是否已经完成
// * // *
@ -533,7 +535,7 @@ public class EmployeeDeclareWrapper extends Service {
// * @return // * @return
// */ // */
// public EmployeeDeclareRateDTO getRate(String index, String tenantKey) { // public EmployeeDeclareRateDTO getRate(String index, String tenantKey) {
// return salaryCacheService.get(SalaryCacheKey.EMPLOYEE_DECLARE, index, EmployeeDeclareRateDTO.class); // return getSalaryCacheService(user).get(SalaryCacheKey.EMPLOYEE_DECLARE, index, EmployeeDeclareRateDTO.class);
// } // }
// //
// /** // /**

View File

@ -1,13 +1,20 @@
package com.engine.salary.wrapper; package com.engine.salary.wrapper;
import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowRecordListDTO;
import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationBillingConfigFormDTO; import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationBillingConfigFormDTO;
import com.engine.salary.entity.taxapiflow.param.TaxDeclarationApiFlowRecordQueryParam;
import com.engine.salary.entity.taxapiflow.param.TaxDeclarationBillingConfigSaveParam; import com.engine.salary.entity.taxapiflow.param.TaxDeclarationBillingConfigSaveParam;
import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO;
import com.engine.salary.enums.SalaryOnOffEnum; import com.engine.salary.enums.SalaryOnOffEnum;
import com.engine.salary.service.TaxDeclarationApiBillingService; import com.engine.salary.service.TaxDeclarationApiBillingService;
import com.engine.salary.service.TaxDeclarationApiConfigService; import com.engine.salary.service.TaxDeclarationApiConfigService;
import com.engine.salary.service.impl.TaxDeclarationApiBillingServiceImpl;
import com.engine.salary.service.impl.TaxDeclarationApiConfigServiceImpl;
import com.engine.salary.util.page.PageInfo;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component; import weaver.hrm.User;
/** /**
* 个税申报计费 * 个税申报计费
@ -16,21 +23,22 @@ import org.springframework.stereotype.Component;
* @date 2022-11-11 15:16:22 * @date 2022-11-11 15:16:22
*/ */
@Slf4j @Slf4j
@Component public class TaxDeclarationApiFlowBillingWrapper extends Service {
public class TaxDeclarationApiFlowBillingWrapper {
private TaxDeclarationApiBillingService taxDeclarationApiBillingService;
private TaxDeclarationApiConfigService taxDeclarationApiConfigService;
// private SalaryBatchService salaryBatchService;
public void saveConfig(TaxDeclarationBillingConfigSaveParam saveParam, Long currentEmployeeId, String currentTenantKey) { public TaxDeclarationApiBillingService getTaxDeclarationApiBillingService(User user) {
taxDeclarationApiConfigService.saveConfig(saveParam); return ServiceUtil.getService(TaxDeclarationApiBillingServiceImpl.class, user);
}
public TaxDeclarationApiConfigService getTaxDeclarationApiConfigService(User user) {
return ServiceUtil.getService(TaxDeclarationApiConfigServiceImpl.class, user);
}
public void saveConfig(TaxDeclarationBillingConfigSaveParam saveParam) {
getTaxDeclarationApiConfigService(user).saveConfig(saveParam);
} }
public TaxDeclarationBillingConfigFormDTO getConfig() { public TaxDeclarationBillingConfigFormDTO getConfig() {
TaxDeclarationApiConfigPO config = taxDeclarationApiConfigService.getConfig( false); TaxDeclarationApiConfigPO config = getTaxDeclarationApiConfigService(user).getConfig(false);
if (config == null) { if (config == null) {
return TaxDeclarationBillingConfigFormDTO.builder().appKey("").appSecret("").enable(true).build(); return TaxDeclarationBillingConfigFormDTO.builder().appKey("").appSecret("").enable(true).build();
} }
@ -42,10 +50,11 @@ public class TaxDeclarationApiFlowBillingWrapper {
.build(); .build();
} }
// public WeaTable<TaxDeclarationApiFlowRecordListDTO> getFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam, Long currentEmployeeId, String currentTenantKey) { public PageInfo<TaxDeclarationApiFlowRecordListDTO> getFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam) {
// PageInfo<TaxDeclarationApiFlowRecordListDTO> page = taxDeclarationApiBillingService.pageFlowRecord(queryParam); // PageInfo<TaxDeclarationApiFlowRecordListDTO> page = getTaxDeclarationApiBillingService(user).pageFlowRecord(queryParam);
// return SalaryFormatUtil.<TaxDeclarationApiFlowRecordListDTO>getInstance().buildTable(TaxDeclarationApiFlowRecordListDTO.class, page); // return page;
// } return null;
}
// public Map<String, Object> exportFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam, Long employeeId, String tenantKey) { // public Map<String, Object> exportFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam, Long employeeId, String tenantKey) {
// List<TaxDeclarationApiFlowRecordListDTO> dtoList = taxDeclarationApiBillingService.listFlowRecord(queryParam, employeeId, tenantKey); // List<TaxDeclarationApiFlowRecordListDTO> dtoList = taxDeclarationApiBillingService.listFlowRecord(queryParam, employeeId, tenantKey);
@ -66,12 +75,12 @@ public class TaxDeclarationApiFlowBillingWrapper {
// return map; // return map;
// } // }
public void enableConfig(TaxDeclarationBillingConfigSaveParam saveParam, Long currentEmployeeId, String currentTenantKey) { public void enableConfig(TaxDeclarationBillingConfigSaveParam saveParam) {
taxDeclarationApiConfigService.enableConfig(saveParam); getTaxDeclarationApiConfigService(user).enableConfig(saveParam);
} }
public Boolean getConfigStatus(String currentTenantKey, Long currentEmployeeId) { public Boolean getConfigStatus() {
TaxDeclarationApiConfigPO config = taxDeclarationApiConfigService.getConfig( false); TaxDeclarationApiConfigPO config = getTaxDeclarationApiConfigService(user).getConfig(false);
return config == null || SalaryOnOffEnum.ON.getValue().equals(config.getEnableUse()); return config == null || SalaryOnOffEnum.ON.getValue().equals(config.getEnableUse());
} }
} }