Merge branch 'feature/外籍人员' into release/个税版本
This commit is contained in:
commit
8f76daf0d1
|
|
@ -0,0 +1,12 @@
|
|||
ALTER TABLE hrsa_employee_declare ADD (
|
||||
nationality varchar2(255) NULL ,
|
||||
birthplace varchar2(255) NULL ,
|
||||
tax_reasons varchar2(255) NULL ,
|
||||
entry_date date NULL ,
|
||||
departure_date date NULL
|
||||
);
|
||||
/
|
||||
|
||||
update hrsa_employee_declare set nationality = 'Öйú' where nationality is null;
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
CREATE TABLE hrsa_tax_declare_status (
|
||||
id NUMBER(38,0) primary key NOT NULL,
|
||||
tax_declare_record_id NUMBER(38,0) NULL ,
|
||||
report_type number NULL ,
|
||||
request_id varchar2(100) ,
|
||||
tax_declare_type number NULL ,
|
||||
tax_declare_status number NULL ,
|
||||
display_update_icon number NULL ,
|
||||
tax_declare_error_msg varchar2(1000) ,
|
||||
person_num number NULL ,
|
||||
tax_pay_amount varchar2(255) ,
|
||||
tax_paid_amount varchar2(255) ,
|
||||
tax_pure_paid_amount varchar2(255) ,
|
||||
declare_request_id varchar2(100) ,
|
||||
delete_type number NULL
|
||||
);
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
ALTER TABLE hrsa_employee_declare ADD (
|
||||
nationality varchar2(255) NULL ,
|
||||
birthplace varchar2(255) NULL ,
|
||||
tax_reasons varchar2(255) NULL ,
|
||||
entry_date date NULL ,
|
||||
departure_date date NULL
|
||||
);
|
||||
/
|
||||
|
||||
update hrsa_employee_declare set nationality = 'Öйú' where nationality is null;
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
CREATE TABLE hrsa_tax_declare_status (
|
||||
id NUMBER(38,0) primary key NOT NULL,
|
||||
tax_declare_record_id NUMBER(38,0) NULL ,
|
||||
report_type number NULL ,
|
||||
request_id varchar2(100) ,
|
||||
tax_declare_type number NULL ,
|
||||
tax_declare_status number NULL ,
|
||||
display_update_icon number NULL ,
|
||||
tax_declare_error_msg varchar2(1000) ,
|
||||
person_num number NULL ,
|
||||
tax_pay_amount varchar2(255) ,
|
||||
tax_paid_amount varchar2(255) ,
|
||||
tax_pure_paid_amount varchar2(255) ,
|
||||
declare_request_id varchar2(100) ,
|
||||
delete_type number NULL
|
||||
);
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
ALTER TABLE hrsa_employee_declare ADD (
|
||||
nationality varchar2(255) NULL ,
|
||||
birthplace varchar2(255) NULL ,
|
||||
tax_reasons varchar2(255) NULL ,
|
||||
entry_date date NULL ,
|
||||
departure_date date NULL
|
||||
);
|
||||
/
|
||||
|
||||
update hrsa_employee_declare set nationality = 'Öйú' where nationality is null;
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
CREATE TABLE hrsa_tax_declare_status (
|
||||
id NUMBER(38,0) primary key NOT NULL,
|
||||
tax_declare_record_id NUMBER(38,0) NULL ,
|
||||
report_type number NULL ,
|
||||
request_id varchar2(100) ,
|
||||
tax_declare_type number NULL ,
|
||||
tax_declare_status number NULL ,
|
||||
display_update_icon number NULL ,
|
||||
tax_declare_error_msg varchar2(1000) ,
|
||||
person_num number NULL ,
|
||||
tax_pay_amount varchar2(255) ,
|
||||
tax_paid_amount varchar2(255) ,
|
||||
tax_pure_paid_amount varchar2(255) ,
|
||||
declare_request_id varchar2(100) ,
|
||||
delete_type number NULL
|
||||
);
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
ALTER TABLE hrsa_employee_declare
|
||||
ADD COLUMN nationality varchar(255) NULL,
|
||||
ADD COLUMN birthplace varchar(255) NULL,
|
||||
ADD COLUMN tax_reasons varchar(255) NULL,
|
||||
ADD COLUMN entry_date date NULL,
|
||||
ADD COLUMN departure_date date NULL ;
|
||||
|
||||
update hrsa_employee_declare set nationality = 'Öйú' where nationality is null;
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
CREATE TABLE hrsa_tax_declare_status (
|
||||
id bigint(0) NOT NULL ,
|
||||
tax_declare_record_id bigint(0) NULL ,
|
||||
report_type int(0) NULL ,
|
||||
request_id varchar(100) ,
|
||||
tax_declare_type tinyint(0) NULL ,
|
||||
tax_declare_status tinyint(0) NULL ,
|
||||
display_update_icon tinyint(0) NULL ,
|
||||
tax_declare_error_msg varchar(1000) ,
|
||||
person_num int(0) NULL ,
|
||||
tax_pay_amount varchar(255) ,
|
||||
tax_paid_amount varchar(255) ,
|
||||
tax_pure_paid_amount varchar(255) ,
|
||||
declare_request_id varchar(100) ,
|
||||
delete_type int(0) NULL,
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
ALTER TABLE hrsa_employee_declare ADD (
|
||||
nationality varchar2(255) NULL ,
|
||||
birthplace varchar2(255) NULL ,
|
||||
tax_reasons varchar2(255) NULL ,
|
||||
entry_date date NULL ,
|
||||
departure_date date NULL
|
||||
);
|
||||
/
|
||||
|
||||
update hrsa_employee_declare set nationality = 'Öйú' where nationality is null
|
||||
/
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
CREATE TABLE hrsa_tax_declare_status (
|
||||
id NUMBER(38,0) primary key NOT NULL,
|
||||
tax_declare_record_id NUMBER(38,0) NULL ,
|
||||
report_type number NULL ,
|
||||
request_id varchar2(100) ,
|
||||
tax_declare_type number NULL ,
|
||||
tax_declare_status number NULL ,
|
||||
display_update_icon number NULL ,
|
||||
tax_declare_error_msg varchar2(1000) ,
|
||||
person_num number NULL ,
|
||||
tax_pay_amount varchar2(255) ,
|
||||
tax_paid_amount varchar2(255) ,
|
||||
tax_pure_paid_amount varchar2(255) ,
|
||||
declare_request_id varchar2(100) ,
|
||||
delete_type number NULL
|
||||
)
|
||||
/
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
ALTER TABLE hrsa_employee_declare
|
||||
ADD COLUMN nationality varchar(255) NULL ,
|
||||
ADD COLUMN birthplace varchar(255) NULL ,
|
||||
ADD COLUMN tax_reasons varchar(255) NULL ,
|
||||
ADD COLUMN entry_date timestamp NULL DEFAULT NULL ,
|
||||
ADD COLUMN departure_date timestamp NULL DEFAULT NULL ;
|
||||
|
||||
update hrsa_employee_declare set nationality = 'Öйú' where nationality is null;
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
CREATE TABLE hrsa_tax_declare_status (
|
||||
id bigserial NOT NULL ,
|
||||
tax_declare_record_id bigint NULL ,
|
||||
report_type int NULL ,
|
||||
request_id varchar(100) ,
|
||||
tax_declare_type int NULL ,
|
||||
tax_declare_status int NULL ,
|
||||
display_update_icon int NULL ,
|
||||
tax_declare_error_msg varchar(1000) ,
|
||||
person_num int NULL ,
|
||||
tax_pay_amount varchar(255) ,
|
||||
tax_paid_amount varchar(255) ,
|
||||
tax_pure_paid_amount varchar(255) ,
|
||||
declare_request_id varchar(100) ,
|
||||
delete_type int NULL,
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
ALTER TABLE hrsa_employee_declare
|
||||
ADD nationality varchar(255) NULL ,
|
||||
ADD birthplace varchar(255) NULL ,
|
||||
ADD tax_reasons varchar(255) NULL ,
|
||||
entry_date datetime NULL ,
|
||||
departure_date datetime NULL
|
||||
GO
|
||||
|
||||
update hrsa_employee_declare set nationality = 'Öйú' where nationality is null
|
||||
GO
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
create table hrsa_tax_declare_status
|
||||
(
|
||||
id bigint primary key ,
|
||||
tax_declare_record_id bigint NULL ,
|
||||
report_type int NULL ,
|
||||
request_id varchar(100) ,
|
||||
tax_declare_type tinyint NULL ,
|
||||
tax_declare_status tinyint NULL ,
|
||||
display_update_icon tinyint NULL ,
|
||||
tax_declare_error_msg varchar(1000) ,
|
||||
person_num int NULL ,
|
||||
tax_pay_amount varchar(255) ,
|
||||
tax_paid_amount varchar(255) ,
|
||||
tax_pure_paid_amount varchar(255) ,
|
||||
declare_request_id varchar(100) ,
|
||||
delete_type int NULL
|
||||
)
|
||||
GO
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
ALTER TABLE hrsa_employee_declare ADD (
|
||||
nationality varchar2(255) NULL ,
|
||||
birthplace varchar2(255) NULL ,
|
||||
tax_reasons varchar2(255) NULL ,
|
||||
entry_date date NULL ,
|
||||
departure_date date NULL
|
||||
);
|
||||
/
|
||||
|
||||
update hrsa_employee_declare set nationality = 'Öйú' where nationality is null;
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
CREATE TABLE hrsa_tax_declare_status (
|
||||
id NUMBER(38,0) primary key NOT NULL,
|
||||
tax_declare_record_id NUMBER(38,0) NULL ,
|
||||
report_type number NULL ,
|
||||
request_id varchar2(100) ,
|
||||
tax_declare_type number NULL ,
|
||||
tax_declare_status number NULL ,
|
||||
display_update_icon number NULL ,
|
||||
tax_declare_error_msg varchar2(1000) ,
|
||||
person_num number NULL ,
|
||||
tax_pay_amount varchar2(255) ,
|
||||
tax_paid_amount varchar2(255) ,
|
||||
tax_pure_paid_amount varchar2(255) ,
|
||||
declare_request_id varchar2(100) ,
|
||||
delete_type number NULL
|
||||
);
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (700000000000000001, NULL, NULL, NULL, 0, 'all_teams', '1', '700', '当期收入额', 'royaltiesIncome', 'number', 'sre', NULL, 0);
|
||||
INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (700000000000000002, NULL, NULL, NULL, 0, 'all_teams', '1', '700', '免税收入', 'royaltiesTaxFreeIncome', 'number', 'mssd', NULL, 0);
|
||||
INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (700000000000000003, NULL, NULL, NULL, 0, 'all_teams', '1', '700', '其他', 'royaltiesOther', 'number', 'qt', NULL, 0);
|
||||
INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (700000000000000004, NULL, NULL, NULL, 0, 'all_teams', '1', '700', '备注', 'royaltiesRemark', 'string', 'bz', NULL, 0);
|
||||
INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (700000000000000005, NULL, NULL, NULL, 0, 'all_teams', '1', '700', '减免税额', 'royaltiesTaxDeduction', 'number', 'jmse', NULL, 0);
|
||||
|
|
@ -2,11 +2,8 @@ package com.engine.salary.entity.employeedeclare.bo;
|
|||
|
||||
import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareExcelDTO;
|
||||
import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO;
|
||||
import com.engine.salary.enums.employeedeclare.CardTypeEnum;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.util.SalaryDateUtil;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
/**
|
||||
* @author Harryxzy
|
||||
|
|
@ -23,22 +20,27 @@ public class EmployeeDeclareBO {
|
|||
EmployeeDeclarePO po = EmployeeDeclarePO.builder()
|
||||
.jobNum(dto.getJobNum())
|
||||
.employeeName(dto.getEmployeeName())
|
||||
.cardType(dto.getCardType() == null ? null :CardTypeEnum.RESIDENT_IDENTITY_CARDS.getValue())
|
||||
.cardType(dto.getCardType())
|
||||
.cardNum(dto.getCardNum())
|
||||
.employmentStatus(StringUtils.isBlank(dto.getEmploymentStatus()) ? null : new Integer(dto.getEmploymentStatus()))
|
||||
.employmentType(StringUtils.isBlank(dto.getEmploymentType()) ? null : new Integer(dto.getEmploymentType()))
|
||||
.nationality(dto.getNationality())
|
||||
.employmentStatus(dto.getEmploymentStatus())
|
||||
.employmentType(dto.getEmploymentType())
|
||||
.employmentFirstYear(dto.getEmploymentFirstYear())
|
||||
.mobile(dto.getMobile())
|
||||
.employmentDate(StringUtils.isBlank(dto.getEmploymentDate()) ? null : SalaryDateUtil.stringToDate(dto.getEmploymentDate()) )
|
||||
.dismissDate(StringUtils.isBlank(dto.getDismissDate()) ? null : SalaryDateUtil.stringToDate(dto.getDismissDate()))
|
||||
.employmentDate(dto.getEmploymentDate())
|
||||
.dismissDate(dto.getDismissDate())
|
||||
.disability(dto.getDisability())
|
||||
.disabilityCardNo(dto.getDisabilityCardNo())
|
||||
.martyrDependents(dto.getMartyrDependents())
|
||||
.martyrDependentsCardNo(dto.getMartyrDependentsCardNo())
|
||||
.lonelyOld(dto.getLonelyOld())
|
||||
.deductExpenses(dto.getDeductExpenses())
|
||||
.gender(StringUtils.isBlank(dto.getGender()) ? null : new Integer(dto.getGender()))
|
||||
.birthday(StringUtils.isBlank(dto.getBirthday()) ? null : SalaryDateUtil.stringToDate(dto.getBirthday()))
|
||||
.entryDate(dto.getEntryDate())
|
||||
.departureDate(dto.getDepartureDate())
|
||||
.gender(dto.getGender())
|
||||
.birthplace(dto.getBirthplace())
|
||||
.birthday(dto.getBirthday())
|
||||
.taxReasons(dto.getTaxReasons())
|
||||
.build();
|
||||
return po;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@ public class EmployeeDeclareList {
|
|||
.setEmployeeName(employeeDeclare.getEmployeeName())
|
||||
.setJobNum(employeeDeclare.getJobNum())
|
||||
.setTaxAgentName(taxAgentNameMap.get(employeeDeclare.getTaxAgentId()))
|
||||
.setNationality(employeeDeclare.getNationality())
|
||||
.setCardType(cardTypeEnum == null ? "" : SalaryI18nUtil.getI18nLabel(cardTypeEnum.getLabelId(), cardTypeEnum.getDefaultLabel()))
|
||||
.setCardNum(employeeDeclare.getCardNum())
|
||||
.setGender(genderEnum == null ? "" : genderEnum.getDefaultLabel())
|
||||
|
|
|
|||
|
|
@ -15,9 +15,9 @@ import com.engine.salary.enums.sicategory.DeleteTypeEnum;
|
|||
import com.engine.salary.util.SalaryDateUtil;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import com.engine.salary.util.db.IdGenerator;
|
||||
import com.engine.salary.util.valid.SalaryCardUtil;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.engine.salary.util.db.IdGenerator;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
|
|
@ -30,8 +30,6 @@ public class EmployeeDeclareRefresh {
|
|||
Result result = new Result();
|
||||
// 本月已有的需要报送的人员
|
||||
Set<Long> employeeIds = SalaryEntityUtil.properties(dto.getEmployeeDeclares(), EmployeeDeclarePO::getEmployeeId);
|
||||
// 员工的个人信息
|
||||
Map<Long, DataCollectionEmployee> simpleUserInfoMap = SalaryEntityUtil.convert2Map(dto.getHrmEmployeeComInfos(), DataCollectionEmployee::getEmployeeId);
|
||||
// 薪资档案的数据(任职受雇从业类型、起始发薪日期、最后发薪日期)
|
||||
Map<Long, SalaryArchivePO> salaryArchiveMap = SalaryEntityUtil.convert2Map(dto.getSalaryArchives(), SalaryArchivePO::getEmployeeId);
|
||||
// 非系统人员的数据(任职受雇从业类型)
|
||||
|
|
@ -103,26 +101,35 @@ public class EmployeeDeclareRefresh {
|
|||
if (employeeIds.contains(hrmEmployeeComInfo.getEmployeeId())) {
|
||||
continue;
|
||||
}
|
||||
EmployeeDeclarePO employeeDeclare = initEmployeeDeclare(dto.getTaxAgentId(), dto.getTaxCycle(), now, employeeId);
|
||||
DataCollectionEmployee simpleUserInfo = simpleUserInfoMap.get(hrmEmployeeComInfo.getEmployeeId());
|
||||
String idNum = simpleUserInfo != null && simpleUserInfo.getIdNo() != null ? simpleUserInfo.getIdNo().toUpperCase() : "";
|
||||
//是否为外籍人员,通过证件号码判断
|
||||
String idNum = hrmEmployeeComInfo.getIdNo() != null ? hrmEmployeeComInfo.getIdNo().toUpperCase() : "";
|
||||
CardTypeEnum cardType = CardTypeEnum.RESIDENT_IDENTITY_CARDS;
|
||||
if (!SalaryCardUtil.checkIdNum(idNum)) {
|
||||
cardType = CardTypeEnum.FOREIGN_PASSPORT;
|
||||
}
|
||||
EmployeeDeclarePO employeeDeclare = initEmployeeDeclare(dto.getTaxAgentId(), dto.getTaxCycle(), employeeId);
|
||||
employeeDeclare.setEmployeeId(hrmEmployeeComInfo.getEmployeeId());
|
||||
employeeDeclare.setEmployeeType(EmployeeTypeEnum.ORGANIZATION.getValue());
|
||||
employeeDeclare.setEmployeeName(hrmEmployeeComInfo.getUsername());
|
||||
employeeDeclare.setJobNum(hrmEmployeeComInfo.getWorkcode());
|
||||
employeeDeclare.setCardType(cardType.getValue());
|
||||
employeeDeclare.setCardNum(idNum);
|
||||
employeeDeclare.setGender(StringUtils.equalsIgnoreCase(hrmEmployeeComInfo.getSex(), GenderEnum.MALE.name()) ? GenderEnum.MALE.getValue() : GenderEnum.FEMALE.getValue());
|
||||
employeeDeclare.setBirthday(simpleUserInfo == null || simpleUserInfo.getBirthday() == null ? null : SalaryDateUtil.dateStrToLocalDate(simpleUserInfo.getBirthday()));
|
||||
employeeDeclare.setGender(StringUtils.equalsIgnoreCase(hrmEmployeeComInfo.getSex(), GenderEnum.MALE.getValue().toString()) ? GenderEnum.MALE.getValue() : GenderEnum.FEMALE.getValue());
|
||||
employeeDeclare.setBirthday(hrmEmployeeComInfo.getBirthday() == null ? null : SalaryDateUtil.dateStrToLocalDate(hrmEmployeeComInfo.getBirthday()));
|
||||
employeeDeclare.setMobile(hrmEmployeeComInfo.getMobile());
|
||||
if (StringUtils.isEmpty(idNum)) {
|
||||
employeeDeclare.setDeclareStatus(DeclareStatusEnum.DECLARE_FAIL.getValue());
|
||||
employeeDeclare.setDeclareErrorMsg(SalaryI18nUtil.getI18nLabel(187460, "身份证号不能为空"));
|
||||
} else if (!SalaryCardUtil.checkIdNum(idNum)) {
|
||||
employeeDeclare.setDeclareStatus(DeclareStatusEnum.DECLARE_FAIL.getValue());
|
||||
employeeDeclare.setDeclareErrorMsg(SalaryI18nUtil.getI18nLabel(156510, "身份证号格式错误"));
|
||||
} else {
|
||||
employeeDeclare.setDeclareErrorMsg(SalaryI18nUtil.getI18nLabel(187460, "证件号码不能为空"));
|
||||
}
|
||||
if (cardType == CardTypeEnum.RESIDENT_IDENTITY_CARDS) {
|
||||
employeeDeclare.setGender(SalaryCardUtil.judgeGender(idNum).getValue());
|
||||
employeeDeclare.setBirthday(SalaryDateUtil.localDateToDate(SalaryCardUtil.judgeBirthday(idNum)));
|
||||
employeeDeclare.setNationality("中国");
|
||||
} else {
|
||||
// fixme 阿富汗
|
||||
// employeeDeclare.setNationality("阿富汗");
|
||||
// employeeDeclare.setEntryDate();
|
||||
// employeeDeclare.setDepartureDate();
|
||||
}
|
||||
// 对人员处理「人员状态」、「离职日期」
|
||||
SalaryArchivePO salaryArchive = salaryArchiveMap.get(employeeDeclare.getEmployeeId());
|
||||
|
|
@ -167,13 +174,11 @@ public class EmployeeDeclareRefresh {
|
|||
return result;
|
||||
}
|
||||
|
||||
private static EmployeeDeclarePO initEmployeeDeclare(Long taxAgentId, Date taxCycle, Date now, Long employeeId) {
|
||||
private static EmployeeDeclarePO initEmployeeDeclare(Long taxAgentId, Date taxCycle, Long employeeId) {
|
||||
EmployeeDeclarePO employeeDeclarePO = new EmployeeDeclarePO();
|
||||
employeeDeclarePO.setId(IdGenerator.generate());
|
||||
employeeDeclarePO.setTaxAgentId(taxAgentId);
|
||||
employeeDeclarePO.setTaxCycle(taxCycle);
|
||||
employeeDeclarePO.setCardType(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getValue());
|
||||
employeeDeclarePO.setGender(GenderEnum.MALE.getValue());
|
||||
employeeDeclarePO.setEmploymentStatus(EmploymentStatusEnum.NORMAL.getValue());
|
||||
employeeDeclarePO.setEmploymentType(EmploymentTypeEnum.EMPLOYEE.getValue());
|
||||
employeeDeclarePO.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue());
|
||||
|
|
@ -190,8 +195,8 @@ public class EmployeeDeclareRefresh {
|
|||
employeeDeclarePO.setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY);
|
||||
employeeDeclarePO.setCreator(employeeId);
|
||||
employeeDeclarePO.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue());
|
||||
employeeDeclarePO.setCreateTime(now);
|
||||
employeeDeclarePO.setUpdateTime(now);
|
||||
employeeDeclarePO.setCreateTime(new Date());
|
||||
employeeDeclarePO.setUpdateTime(new Date());
|
||||
return employeeDeclarePO;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import com.engine.salary.util.SalaryDateUtil;
|
|||
import com.engine.salary.util.SalaryEnumUtil;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.compress.utils.Lists;
|
||||
import weaver.general.Util;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
|
@ -41,17 +42,20 @@ public class EmployeeDeclareRequest {
|
|||
// *姓名
|
||||
employeeInfoMap.put("xm", employeeDeclare.getEmployeeName());
|
||||
// *证件类型
|
||||
CardTypeEnum cardTypeEnum = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getCardType(), CardTypeEnum.class);
|
||||
employeeInfoMap.put("zzlx", cardTypeEnum == null ? "" : cardTypeEnum.getDefaultLabel());
|
||||
CardTypeEnum cardTypeEnum = CardTypeEnum.getByValue(employeeDeclare.getCardType());
|
||||
employeeInfoMap.put("zzlx", cardTypeEnum.getDefaultLabel());
|
||||
// *证件号码
|
||||
employeeInfoMap.put("zzhm", employeeDeclare.getCardNum());
|
||||
// *国籍
|
||||
employeeInfoMap.put("gj", "中国");
|
||||
String nationality = employeeDeclare.getNationality();
|
||||
employeeInfoMap.put("gj", nationality);
|
||||
// 人员地区
|
||||
employeeInfoMap.put("rydq", cardTypeEnum == CardTypeEnum.RESIDENT_IDENTITY_CARDS ? "境内" : "境外");
|
||||
// *性别
|
||||
GenderEnum genderEnum = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getGender(), GenderEnum.class);
|
||||
employeeInfoMap.put("xb", genderEnum == null ? "" : genderEnum.getDefaultLabel());
|
||||
// *出生日期
|
||||
employeeInfoMap.put("csny", employeeDeclare.getBirthday());
|
||||
employeeInfoMap.put("csny", SalaryDateUtil.getFormatLocalDate(employeeDeclare.getBirthday()));
|
||||
// *人员状态
|
||||
EmploymentStatusEnum employmentStatusEnum = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getEmploymentStatus(), EmploymentStatusEnum.class);
|
||||
employeeInfoMap.put("nsrzt", employmentStatusEnum == null ? "" : employmentStatusEnum.getDefaultLabel());
|
||||
|
|
@ -88,18 +92,16 @@ public class EmployeeDeclareRequest {
|
|||
employeeInfoMap.put("grgbbl", "");
|
||||
// 备注
|
||||
employeeInfoMap.put("bz", "");
|
||||
// 人员地区
|
||||
employeeInfoMap.put("rydq", "境内");
|
||||
// 中文名
|
||||
employeeInfoMap.put("xmzw", "");
|
||||
// 出生地:
|
||||
employeeInfoMap.put("csd", "");
|
||||
employeeInfoMap.put("csd", Util.null2String(employeeDeclare.getBirthplace()));
|
||||
// 涉税事由
|
||||
employeeInfoMap.put("sssx", "");
|
||||
employeeInfoMap.put("sssx", Util.null2String(employeeDeclare.getTaxReasons()));
|
||||
// 首次入境时间
|
||||
employeeInfoMap.put("scrjsj", "");
|
||||
employeeInfoMap.put("scrjsj", SalaryDateUtil.getFormatLocalDate(employeeDeclare.getEntryDate()));
|
||||
// 预计离境时间
|
||||
employeeInfoMap.put("yjljsj", "");
|
||||
employeeInfoMap.put("yjljsj", SalaryDateUtil.getFormatLocalDate(employeeDeclare.getDepartureDate()));
|
||||
// 其他证件类型
|
||||
employeeInfoMap.put("qtzzlx", "");
|
||||
// 其他证件号码
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import lombok.Data;
|
|||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
|
|
@ -67,27 +68,39 @@ public class EmployeeDeclareExcelDTO {
|
|||
// 证件类型
|
||||
@SalaryTableColumn(text = "证件类型", width = "10%", column = "cardType")
|
||||
@TableTitle(title = "证件类型", dataIndex = "cardType", key = "cardType")
|
||||
private String cardType;
|
||||
private Integer cardType;
|
||||
|
||||
// 证件号码
|
||||
@SalaryTableColumn(text = "证件号码", width = "10%", column = "cardNum")
|
||||
@TableTitle(title = "证件号码", dataIndex = "cardNum", key = "cardNum")
|
||||
private String cardNum;
|
||||
|
||||
// 性别
|
||||
@SalaryTableColumn(text = "国籍", width = "10%", column = "nationality")
|
||||
@TableTitle(title = "国籍", dataIndex = "nationality", key = "nationality")
|
||||
private String nationality;
|
||||
|
||||
// 性别
|
||||
@SalaryTableColumn(text = "性别", width = "10%", column = "gender")
|
||||
@TableTitle(title = "性别", dataIndex = "gender", key = "gender")
|
||||
private String gender;
|
||||
private Integer gender;
|
||||
|
||||
/**
|
||||
* 出生地
|
||||
*/
|
||||
@SalaryTableColumn(text = "出生地", width = "10%", column = "birthplace")
|
||||
@TableTitle(title = "出生地", dataIndex = "birthplace", key = "birthplace")
|
||||
private String birthplace;
|
||||
|
||||
// 出生日期
|
||||
@SalaryTableColumn(text = "出生日期", width = "10%", column = "birthday")
|
||||
@TableTitle(title = "出生日期", dataIndex = "birthday", key = "birthday")
|
||||
private String birthday;
|
||||
private Date birthday;
|
||||
|
||||
// 人员状态
|
||||
@SalaryTableColumn(text = "人员状态", width = "10%", column = "employmentStatus")
|
||||
@TableTitle(title = "人员状态", dataIndex = "employmentStatus", key = "employmentStatus")
|
||||
private String employmentStatus;
|
||||
private Integer employmentStatus;
|
||||
|
||||
// 手机号码
|
||||
@SalaryTableColumn(text = "手机号码", width = "10%", column = "mobile")
|
||||
|
|
@ -97,12 +110,12 @@ public class EmployeeDeclareExcelDTO {
|
|||
// 任职受雇从业类型
|
||||
@SalaryTableColumn(text = "任职受雇从业类型", width = "10%", column = "employmentType")
|
||||
@TableTitle(title = "任职受雇从业类型", dataIndex = "employmentType", key = "employmentType")
|
||||
private String employmentType;
|
||||
private Integer employmentType;
|
||||
|
||||
// 任职受雇从业日期
|
||||
@SalaryTableColumn(text = "任职受雇从业日期", width = "10%", column = "employmentDate")
|
||||
@TableTitle(title = "任职受雇从业日期", dataIndex = "employmentDate", key = "employmentDate")
|
||||
private String employmentDate;
|
||||
private Date employmentDate;
|
||||
|
||||
// 入职年度就业情形
|
||||
private String employmentFirstYear;
|
||||
|
|
@ -111,7 +124,33 @@ public class EmployeeDeclareExcelDTO {
|
|||
// 离职日期
|
||||
@SalaryTableColumn(text = "离职日期", width = "10%", column = "dismissDate")
|
||||
@TableTitle(title = "离职日期", dataIndex = "dismissDate", key = "dismissDate")
|
||||
private String dismissDate;
|
||||
private Date dismissDate;
|
||||
|
||||
/**
|
||||
* 首次入境时间
|
||||
*/
|
||||
@SalaryTableColumn(text = "首次入境时间", width = "10%", column = "entryDate")
|
||||
@TableTitle(title = "首次入境时间", dataIndex = "entryDate", key = "entryDate")
|
||||
private Date entryDate;
|
||||
|
||||
/**
|
||||
* 预计离境时间
|
||||
*/
|
||||
@SalaryTableColumn(text = "预计离境时间", width = "10%", column = "departureDate")
|
||||
@TableTitle(title = "预计离境时间", dataIndex = "departureDate", key = "departureDate")
|
||||
private Date departureDate;
|
||||
|
||||
/**
|
||||
* 涉税事由,
|
||||
* 任职受雇
|
||||
* 提供临时劳务
|
||||
* 转让财产
|
||||
* 从事投资和经营活动
|
||||
* 其他
|
||||
*/
|
||||
@SalaryTableColumn(text = "涉税事由", width = "10%", column = "taxReasons")
|
||||
@TableTitle(title = "涉税事由", dataIndex = "taxReasons", key = "taxReasons")
|
||||
private String taxReasons;
|
||||
|
||||
// 是否残疾
|
||||
private Integer disability;
|
||||
|
|
|
|||
|
|
@ -67,6 +67,23 @@ public class EmployeeDeclareFromDTO {
|
|||
@TableTitle(title = "性别", dataIndex = "gender", key = "gender")
|
||||
private GenderEnum gender;
|
||||
|
||||
/**
|
||||
* 涉税事由,
|
||||
* 任职受雇
|
||||
* 提供临时劳务
|
||||
* 转让财产
|
||||
* 从事投资和经营活动
|
||||
* 其他
|
||||
*/
|
||||
@TableTitle(title = "涉税事由", dataIndex = "taxReasons", key = "taxReasons")
|
||||
private String taxReasons;
|
||||
|
||||
/**
|
||||
* 出生地
|
||||
*/
|
||||
@TableTitle(title = "出生地", dataIndex = "birthplace", key = "birthplace")
|
||||
private String birthplace;
|
||||
|
||||
// 出生日期
|
||||
@TableTitle(title = "出生日期", dataIndex = "birthday", key = "birthday")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
|
|
@ -94,6 +111,19 @@ public class EmployeeDeclareFromDTO {
|
|||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
private Date dismissDate;
|
||||
|
||||
|
||||
// 首次入境时间
|
||||
@TableTitle(title = "首次入境时间", dataIndex = "entryDate", key = "entryDate")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
private Date entryDate;
|
||||
|
||||
// 预计离境时间
|
||||
@TableTitle(title = "预计离境时间", dataIndex = "departureDate", key = "departureDate")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
private Date departureDate;
|
||||
|
||||
|
||||
|
||||
// 是否残疾
|
||||
@TableTitle(title = "是否残疾", dataIndex = "disability", key = "disability")
|
||||
private SalaryOnOffEnum disability;
|
||||
|
|
|
|||
|
|
@ -70,6 +70,12 @@ public class EmployeeDeclareListDTO {
|
|||
@ExcelHead(title = "工号", dataIndex = "jobNum")
|
||||
private String jobNum;
|
||||
|
||||
// 国籍
|
||||
@SalaryTableColumn(text = "国籍", width = "10%", column = "nationality")
|
||||
@TableTitle(title = "国籍", dataIndex = "nationality", key = "nationality")
|
||||
@ExcelHead(title = "国籍", dataIndex = "nationality")
|
||||
private String nationality;
|
||||
|
||||
// 证件类型
|
||||
@SalaryTableColumn(text = "证件类型", width = "10%", column = "cardType")
|
||||
@TableTitle(title = "证件类型", dataIndex = "cardType", key = "cardType")
|
||||
|
|
|
|||
|
|
@ -22,75 +22,99 @@ import java.util.Date;
|
|||
@Data
|
||||
public class EmployeeDeclareSaveParam {
|
||||
|
||||
//主键id")
|
||||
//主键id
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 参数错误,个税扣缴义务人id不能为空
|
||||
*/
|
||||
//个税扣缴义务人id")
|
||||
//个税扣缴义务人id
|
||||
private Long taxAgentId;
|
||||
|
||||
/**
|
||||
* 参数错误,税款所属期参数格式错误
|
||||
*/
|
||||
//税款所属期")
|
||||
//税款所属期
|
||||
private Date taxCycle;
|
||||
|
||||
//员工id")
|
||||
//员工id
|
||||
private Long employeeId;
|
||||
|
||||
//员工类型")
|
||||
//员工类型
|
||||
private EmployeeTypeEnum employeeType;
|
||||
|
||||
//姓名")
|
||||
//姓名
|
||||
private String employeeName;
|
||||
|
||||
//工号")
|
||||
//工号
|
||||
private String jobNum;
|
||||
|
||||
//证件类型")
|
||||
//国籍
|
||||
private String nationality;
|
||||
|
||||
/**
|
||||
* 出生地
|
||||
*/
|
||||
private String birthplace;
|
||||
|
||||
/**
|
||||
* 涉税事由,
|
||||
* 任职受雇
|
||||
* 提供临时劳务
|
||||
* 转让财产
|
||||
* 从事投资和经营活动
|
||||
* 其他
|
||||
*/
|
||||
private String taxReasons;
|
||||
|
||||
//证件类型
|
||||
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 LocalDate entryDate;
|
||||
|
||||
//预计离境时间
|
||||
private LocalDate departureDate;
|
||||
|
||||
//是否残疾
|
||||
private SalaryOnOffEnum disability;
|
||||
|
||||
//残疾证号")
|
||||
//残疾证号
|
||||
private String disabilityCardNo;
|
||||
|
||||
//是否孤老")
|
||||
//是否孤老
|
||||
private SalaryOnOffEnum lonelyOld;
|
||||
|
||||
//是否是烈属")
|
||||
//是否是烈属
|
||||
private SalaryOnOffEnum martyrDependents;
|
||||
|
||||
//烈属证号")
|
||||
//烈属证号
|
||||
private String martyrDependentsCardNo;
|
||||
|
||||
//是否扣除减除费用")
|
||||
//是否扣除减除费用
|
||||
private SalaryOnOffEnum deductExpenses;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,43 @@
|
|||
package com.engine.salary.entity.employeedeclare.param;
|
||||
|
||||
import com.engine.salary.common.BaseQueryParam;
|
||||
import com.engine.salary.enums.employeedeclare.CardTypeEnum;
|
||||
import com.engine.salary.util.valid.DataCheck;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 人员报送
|
||||
* <p>Copyright: Copyright (c) 2023</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class EmployeeInformationChangeParam extends BaseQueryParam {
|
||||
|
||||
/**
|
||||
* 人员记录id
|
||||
*/
|
||||
@DataCheck(require = true,message = "参数错误,id不能为空")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String name;
|
||||
|
||||
//证件类型
|
||||
private CardTypeEnum cardType;
|
||||
|
||||
//证件号码
|
||||
private String cardNum;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
package com.engine.salary.entity.employeedeclare.param;
|
||||
|
||||
import com.engine.salary.common.BaseQueryParam;
|
||||
import com.engine.salary.util.valid.DataCheck;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 人员报送
|
||||
* <p>Copyright: Copyright (c) 2023</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class EmployeeInvalidParam extends BaseQueryParam {
|
||||
|
||||
/**
|
||||
* 人员记录id
|
||||
*/
|
||||
@DataCheck(require = true,message = "参数错误,id不能为空")
|
||||
private Long id;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -2,6 +2,8 @@ package com.engine.salary.entity.employeedeclare.po;
|
|||
|
||||
|
||||
import com.engine.hrmelog.annotation.ElogTransform;
|
||||
import com.engine.salary.enums.employeedeclare.CardTypeEnum;
|
||||
import com.engine.salary.enums.employeedeclare.GenderEnum;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
|
@ -63,6 +65,13 @@ public class EmployeeDeclarePO {
|
|||
@ElogTransform(name = "人员名称")
|
||||
private String employeeName;
|
||||
|
||||
/**
|
||||
* 国籍
|
||||
*/
|
||||
@ElogTransform(name = "国籍")
|
||||
private String nationality;
|
||||
|
||||
|
||||
/**
|
||||
* 工号
|
||||
*/
|
||||
|
|
@ -71,6 +80,7 @@ public class EmployeeDeclarePO {
|
|||
|
||||
/**
|
||||
* 证件类型
|
||||
* @see CardTypeEnum
|
||||
*/
|
||||
@ElogTransform(name = "证件类型")
|
||||
private Integer cardType;
|
||||
|
|
@ -80,9 +90,22 @@ public class EmployeeDeclarePO {
|
|||
*/
|
||||
@ElogTransform(name = "证件号码")
|
||||
private String cardNum;
|
||||
//
|
||||
// /**
|
||||
// * 其他证件类型
|
||||
// */
|
||||
// @ElogTransform(name = "其他证件类型")
|
||||
// private Integer otherCardType;
|
||||
//
|
||||
// /**
|
||||
// * 其他证件号码
|
||||
// */
|
||||
// @ElogTransform(name = "其他证件号码")
|
||||
// private String otherCardNum;
|
||||
|
||||
/**
|
||||
* 性别
|
||||
* @see GenderEnum
|
||||
*/
|
||||
@ElogTransform(name = "性别")
|
||||
private Integer gender;
|
||||
|
|
@ -93,6 +116,23 @@ public class EmployeeDeclarePO {
|
|||
@ElogTransform(name = "出生日期")
|
||||
private Date birthday;
|
||||
|
||||
/**
|
||||
* 出生地
|
||||
*/
|
||||
@ElogTransform(name = "出生地")
|
||||
private String birthplace;
|
||||
|
||||
/**
|
||||
* 涉税事由,
|
||||
* 任职受雇
|
||||
* 提供临时劳务
|
||||
* 转让财产
|
||||
* 从事投资和经营活动
|
||||
* 其他
|
||||
*/
|
||||
@ElogTransform(name = "涉税事由")
|
||||
private String taxReasons;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
|
|
@ -129,6 +169,19 @@ public class EmployeeDeclarePO {
|
|||
@ElogTransform(name = "离职日期")
|
||||
private Date dismissDate;
|
||||
|
||||
|
||||
/**
|
||||
* 首次入境时间
|
||||
*/
|
||||
@ElogTransform(name = "首次入境时间")
|
||||
private Date entryDate;
|
||||
|
||||
/**
|
||||
* 预计离境时间
|
||||
*/
|
||||
@ElogTransform(name = "预计离境时间")
|
||||
private Date departureDate;
|
||||
|
||||
/**
|
||||
* 是否残疾
|
||||
*/
|
||||
|
|
@ -231,17 +284,22 @@ public class EmployeeDeclarePO {
|
|||
", employeeId=" + employeeId +
|
||||
", employeeType=" + employeeType +
|
||||
", employeeName='" + employeeName + '\'' +
|
||||
", nationality='" + nationality + '\'' +
|
||||
", jobNum='" + jobNum + '\'' +
|
||||
", cardType=" + cardType +
|
||||
", cardNum='" + cardNum + '\'' +
|
||||
", gender=" + gender +
|
||||
", birthday=" + birthday +
|
||||
", birthplace='" + birthplace + '\'' +
|
||||
", taxReasons='" + taxReasons + '\'' +
|
||||
", employmentStatus=" + employmentStatus +
|
||||
", mobile='" + mobile + '\'' +
|
||||
", employmentType=" + employmentType +
|
||||
", employmentFirstYear='" + employmentFirstYear + '\'' +
|
||||
", employmentDate=" + employmentDate +
|
||||
", dismissDate=" + dismissDate +
|
||||
", entryDate=" + entryDate +
|
||||
", departureDate=" + departureDate +
|
||||
", disability=" + disability +
|
||||
", disabilityCardNo='" + disabilityCardNo + '\'' +
|
||||
", lonelyOld=" + lonelyOld +
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ public class TaxAgentTaxReturnPO implements Serializable {
|
|||
/**
|
||||
* 企业名称
|
||||
*/
|
||||
private Long taxAgentName;
|
||||
private String taxAgentName;
|
||||
|
||||
/**
|
||||
* 税号
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationValuePO;
|
|||
import com.engine.salary.entity.taxdeclaration.po.TaxReportColumnPO;
|
||||
import com.engine.salary.enums.employeedeclare.CardTypeEnum;
|
||||
import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum;
|
||||
import com.engine.salary.report.enums.IncomeCategoryEnum;
|
||||
import com.engine.salary.enums.salarysob.IncomeCategoryEnum;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
|
|
@ -146,7 +146,7 @@ public class TaxDeclarationRequest {
|
|||
// 姓名
|
||||
requestParam.put("xm", employeeDeclare.getEmployeeName());
|
||||
// 证件类型
|
||||
requestParam.put("zzlx", CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel());
|
||||
requestParam.put("zzlx", CardTypeEnum.getByValue(employeeDeclare.getCardType()).getDefaultLabel());
|
||||
// 证件号码
|
||||
requestParam.put("zzhm", employeeDeclare.getCardNum());
|
||||
// 所得项目
|
||||
|
|
@ -162,4 +162,50 @@ public class TaxDeclarationRequest {
|
|||
}
|
||||
return requestParam;
|
||||
}
|
||||
|
||||
|
||||
public static Map<String, Object> convert2fjmsdRequestParam(List<TaxReportColumnPO> taxReportColumns,
|
||||
List<TaxDeclarationPO> taxDeclarations,
|
||||
List<TaxDeclarationValuePO> taxDeclarationValues,
|
||||
List<EmployeeDeclarePO> employeeDeclares) {
|
||||
Map<String, Map<String, Object>> objRequestParam = Maps.newHashMap();
|
||||
Map<String, List<Map<String, Object>>> listRequestParam = Maps.newHashMap();
|
||||
Map<String, List<TaxReportColumnPO>> taxReportColumnMap = SalaryEntityUtil.group2Map(taxReportColumns, TaxReportColumnPO::getIncomeCategory);
|
||||
Map<Long, EmployeeDeclarePO> employeeDeclareMap = SalaryEntityUtil.convert2Map(employeeDeclares, EmployeeDeclarePO::getEmployeeId);
|
||||
Map<Long, List<TaxDeclarationValuePO>> taxDeclarationValueMap = SalaryEntityUtil.group2Map(taxDeclarationValues, TaxDeclarationValuePO::getTaxDeclarationId);
|
||||
for (TaxDeclarationPO taxDeclaration : taxDeclarations) {
|
||||
List<TaxDeclarationValuePO> values = taxDeclarationValueMap.get(taxDeclaration.getId());
|
||||
for (TaxDeclarationValuePO taxDeclarationValue : values) {
|
||||
EmployeeDeclarePO employeeDeclare = employeeDeclareMap.get(taxDeclarationValue.getEmployeeId());
|
||||
IncomeCategoryEnum incomeCategoryEnum = IncomeCategoryEnum.parseByValue(taxDeclaration.getIncomeCategory());
|
||||
if (employeeDeclare == null || incomeCategoryEnum == null) {
|
||||
continue;
|
||||
}
|
||||
List<TaxReportColumnPO> taxReportColumnList = taxReportColumnMap.get(Util.null2String(incomeCategoryEnum.getValue()));
|
||||
Map<String, Object> employeeRequestParam = convert2RequestParam(incomeCategoryEnum, taxReportColumnList, taxDeclarationValue, employeeDeclare);
|
||||
if (incomeCategoryEnum == IncomeCategoryEnum.NON_RESIDENT_INCOME_WAGES_AND_SALARIES) {
|
||||
// 无住所个人正常工资薪金
|
||||
List<Map<String, Object>> employeeRequestParams = listRequestParam.computeIfAbsent("wjgzxjlb", k -> Lists.newArrayList());
|
||||
employeeRequestParams.add(employeeRequestParam);
|
||||
} else if (incomeCategoryEnum == IncomeCategoryEnum.NON_RESIDENT_INCOME_MONTHLY_BONUS) {
|
||||
// 全年一次性奖金收入
|
||||
List<Map<String, Object>> employeeRequestParams = listRequestParam.computeIfAbsent("wjrysyjjlb", k -> Lists.newArrayList());
|
||||
employeeRequestParams.add(employeeRequestParam);
|
||||
} else if (incomeCategoryEnum == IncomeCategoryEnum.NON_RESIDENT_INCOME_REMUNERATION_FOR_LABOR) {
|
||||
// 内退一次性补偿金
|
||||
List<Map<String, Object>> employeeRequestParams = listRequestParam.computeIfAbsent("lwbclb", k -> Lists.newArrayList());
|
||||
employeeRequestParams.add(employeeRequestParam);
|
||||
} else if (incomeCategoryEnum == IncomeCategoryEnum.NON_RESIDENT_INCOME_COMPENSATION_FOR_DISMISS) {
|
||||
// 解除劳动合同一次性补偿金
|
||||
List<Map<String, Object>> employeeRequestParams = listRequestParam.computeIfAbsent("jcldhtycxbcjlb", k -> Lists.newArrayList());
|
||||
employeeRequestParams.add(employeeRequestParam);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, Object> requestParam = Maps.newHashMap();
|
||||
requestParam.putAll(objRequestParam);
|
||||
requestParam.putAll(listRequestParam);
|
||||
return requestParam;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ public class TaxDeclarationValueList {
|
|||
if (employeeDeclare != null) {
|
||||
dataMap.put(cnKey ? "工号" : "jobNum", employeeDeclare.getJobNum());
|
||||
dataMap.put(cnKey ? "姓名" : "username", employeeDeclare.getEmployeeName());
|
||||
dataMap.put(cnKey ? "证件类型" : "cardType", SalaryI18nUtil.getI18nLabel(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getLabelId(), CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel()));
|
||||
dataMap.put(cnKey ? "证件类型" : "cardType",CardTypeEnum.getByValue(employeeDeclare.getCardType()).getDefaultLabel() );
|
||||
dataMap.put(cnKey ? "证件号码" : "cardNum", employeeDeclare.getCardNum());
|
||||
} else if (taxDeclarationValue.getEmployeeType() == null || Objects.equals(taxDeclarationValue.getEmployeeType(), EmployeeTypeEnum.ORGANIZATION.getValue())) {
|
||||
DataCollectionEmployee simpleEmployee = simpleEmployeeMap.get(taxDeclarationValue.getEmployeeId());
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ public class TaxDeclareEmployeeBO {
|
|||
abnormalEmployeeListDTO
|
||||
.setEmployeeName(employeeDeclare.getEmployeeName())
|
||||
.setJobNum(employeeDeclare.getJobNum())
|
||||
.setCardType(SalaryI18nUtil.getI18nLabel(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getLabelId(), CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel()))
|
||||
.setCardType(CardTypeEnum.getByValue(employeeDeclare.getCardType()).getDefaultLabel())
|
||||
.setCardNum(employeeDeclare.getCardNum())
|
||||
.setDeclareStatus(declareStatusEnum)
|
||||
.setDeclareStatusDesc(declareStatusEnum == null ? "" : SalaryI18nUtil.getI18nLabel(declareStatusEnum.getLabelId(), declareStatusEnum.getDefaultLabel()));
|
||||
|
|
|
|||
|
|
@ -0,0 +1,33 @@
|
|||
package com.engine.salary.entity.taxdeclaration.dto;
|
||||
|
||||
import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationPO;
|
||||
import com.engine.salary.entity.taxdeclaration.po.TaxDeclareStatusPO;
|
||||
import com.engine.salary.enums.salarysob.DeclareReportTypeEnum;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 个税申报类型
|
||||
* <p>Copyright: Copyright (c) 2023</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class TaxDeclarationReportDTO {
|
||||
|
||||
private DeclareReportTypeEnum reportType;
|
||||
|
||||
private TaxDeclareStatusPO status;
|
||||
|
||||
private List<TaxDeclarationPO> taxDeclarations;
|
||||
|
||||
}
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
package com.engine.salary.entity.taxdeclaration.param;
|
||||
|
||||
import com.engine.salary.util.valid.DataCheck;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
|
@ -12,7 +13,12 @@ import lombok.experimental.Accessors;
|
|||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class DeclareTaxResultFeedbackQueryParam {
|
||||
|
||||
@DataCheck(require = true, message = "个税申报记录id不能为空!")
|
||||
Long id;
|
||||
|
||||
@DataCheck(require = true, message = "申报类型不能为空!")
|
||||
Integer reportType;
|
||||
|
||||
String requestId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.engine.salary.entity.taxdeclaration.param;
|
||||
|
||||
import com.engine.salary.enums.salarysob.DeclareReportTypeEnum;
|
||||
import com.engine.salary.util.valid.DataCheck;
|
||||
import lombok.Data;
|
||||
|
||||
|
|
@ -14,6 +15,16 @@ import lombok.Data;
|
|||
@Data
|
||||
public class TaxDeclareRecordParam {
|
||||
|
||||
//个税申报记录id")
|
||||
/**
|
||||
* 个税申报记录id
|
||||
*/
|
||||
@DataCheck(require = true,message = "个税申报记录id不能为空!")
|
||||
private Long taxDeclareRecordId;
|
||||
|
||||
/**
|
||||
* 申报类型
|
||||
* @see DeclareReportTypeEnum
|
||||
*/
|
||||
@DataCheck(require = true,message = "申报类型不能为空!")
|
||||
private Integer reportType;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,25 +48,32 @@ public class TaxDeclareRecordPO implements Serializable {
|
|||
private Date taxCycle;
|
||||
/**
|
||||
* 申报类型
|
||||
*
|
||||
* @see TaxDeclareTypeEnum
|
||||
*/
|
||||
@Deprecated
|
||||
private Integer taxDeclareType;
|
||||
/**
|
||||
* 申报状态
|
||||
*
|
||||
* @see TaxDeclareStatusEnum
|
||||
*/
|
||||
@Deprecated
|
||||
private Integer taxDeclareStatus;
|
||||
/**
|
||||
* 申报失败的错误信息
|
||||
*/
|
||||
@Deprecated
|
||||
private String taxDeclareErrorMsg;
|
||||
/**
|
||||
* 请求的requestId
|
||||
*/
|
||||
@Deprecated
|
||||
private String requestId;
|
||||
/**
|
||||
* 申报的requestId,用于下载申报过程
|
||||
*/
|
||||
@Deprecated
|
||||
private String declareRequestId;
|
||||
/**
|
||||
* 备注
|
||||
|
|
@ -74,15 +81,19 @@ public class TaxDeclareRecordPO implements Serializable {
|
|||
private String remark;
|
||||
|
||||
//应缴金额
|
||||
@Deprecated
|
||||
private String taxPayAmount;
|
||||
|
||||
//实缴总额
|
||||
@Deprecated
|
||||
private String taxPaidAmount;
|
||||
|
||||
//实缴税额(不含滞纳金等)
|
||||
@Deprecated
|
||||
private String taxPurePaidAmount;
|
||||
|
||||
//申报人数
|
||||
@Deprecated
|
||||
private Integer personNum;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -0,0 +1,79 @@
|
|||
package com.engine.salary.entity.taxdeclaration.po;
|
||||
|
||||
import com.engine.salary.enums.salarysob.DeclareReportTypeEnum;
|
||||
import com.engine.salary.enums.taxdeclaration.TaxDeclareStatusEnum;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class TaxDeclareStatusPO {
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 申报记录id
|
||||
*/
|
||||
private Long taxDeclareRecordId;
|
||||
/**
|
||||
* 申报类型 1:综合所得; 2: 分类所得;3:非居民所得;4:限售股所得
|
||||
* @see DeclareReportTypeEnum
|
||||
*/
|
||||
private Integer reportType;
|
||||
/**
|
||||
* 供应商第三方系统返回的requestid
|
||||
*/
|
||||
private String requestId;
|
||||
/**
|
||||
* 申报类型
|
||||
*/
|
||||
private Integer taxDeclareType;
|
||||
/**
|
||||
* 申报状态
|
||||
* @see TaxDeclareStatusEnum
|
||||
*/
|
||||
private Integer taxDeclareStatus;
|
||||
/**
|
||||
* 刷新标识
|
||||
*/
|
||||
private Integer displayUpdateIcon;
|
||||
/**
|
||||
* 错误信息
|
||||
*/
|
||||
private String taxDeclareErrorMsg;
|
||||
/**
|
||||
* 申报人数
|
||||
*/
|
||||
private Integer personNum;
|
||||
/**
|
||||
* 应缴
|
||||
*/
|
||||
private String taxPayAmount;
|
||||
/**
|
||||
* 实缴总额
|
||||
*/
|
||||
private String taxPaidAmount;
|
||||
/**
|
||||
* 实缴(不含滞纳金)
|
||||
*/
|
||||
private String taxPurePaidAmount;
|
||||
/**
|
||||
* 记录申报业务id,用于下载内置算税过程
|
||||
*/
|
||||
private String declareRequestId;
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
private Integer deleteType;
|
||||
|
||||
//主键id集合
|
||||
private Collection<Long> ids;
|
||||
|
||||
}
|
||||
|
|
@ -44,4 +44,7 @@ public class TaxPaymentQueryParam {
|
|||
|
||||
//是否为反馈校验 0否 1是")
|
||||
private Integer checkFeedback;
|
||||
|
||||
//申报表类型
|
||||
private Integer reportType;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,9 @@ package com.engine.salary.enums.employeedeclare;
|
|||
|
||||
import com.engine.salary.enums.BaseEnum;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 证件类型
|
||||
* <p>Copyright: Copyright (c) 2023</p>
|
||||
|
|
@ -12,7 +15,8 @@ import com.engine.salary.enums.BaseEnum;
|
|||
**/
|
||||
public enum CardTypeEnum implements BaseEnum<Integer> {
|
||||
|
||||
RESIDENT_IDENTITY_CARDS(0, "居民身份证", 105564);
|
||||
RESIDENT_IDENTITY_CARDS(0, "居民身份证", 105564),
|
||||
FOREIGN_PASSPORT(1, "外国护照", 105564);
|
||||
|
||||
CardTypeEnum(int value, String defaultLabel, int labelId) {
|
||||
this.value = value;
|
||||
|
|
@ -40,4 +44,26 @@ public enum CardTypeEnum implements BaseEnum<Integer> {
|
|||
public Integer getLabelId() {
|
||||
return labelId;
|
||||
}
|
||||
|
||||
public static CardTypeEnum getByValue(Integer value) {
|
||||
for (CardTypeEnum e : CardTypeEnum.values()) {
|
||||
if (Objects.equals(e.getValue(), value)) {
|
||||
return e;
|
||||
}
|
||||
}
|
||||
return RESIDENT_IDENTITY_CARDS;
|
||||
}
|
||||
|
||||
public static CardTypeEnum getByDefaultLabel(String defaultLabel) {
|
||||
if (defaultLabel == null) {
|
||||
return null;
|
||||
}
|
||||
CardTypeEnum[] enumAry = CardTypeEnum.values();
|
||||
for(int i = 0; i < Arrays.asList(enumAry).size(); i++){
|
||||
if (enumAry[i].getDefaultLabel().equals(defaultLabel)) {
|
||||
return enumAry[i];
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.engine.salary.enums.employeedeclare;
|
|||
import com.engine.salary.enums.BaseEnum;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 性别
|
||||
|
|
@ -56,4 +57,13 @@ public enum GenderEnum implements BaseEnum<Integer> {
|
|||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static GenderEnum getDefaultLabelByValue(Integer value) {
|
||||
for (GenderEnum e : GenderEnum.values()) {
|
||||
if (Objects.equals(e.getValue(), value)) {
|
||||
return e;
|
||||
}
|
||||
}
|
||||
return MALE;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,58 @@
|
|||
package com.engine.salary.enums.employeedeclare;
|
||||
|
||||
import com.engine.salary.enums.BaseEnum;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 涉税事由
|
||||
* <p>Copyright: Copyright (c) 2023</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
public enum TaxReasonEnum implements BaseEnum<String> {
|
||||
|
||||
Employment("任职受雇", "任职受雇", 105564),
|
||||
PROVIDE_TEMPORARY_LABOR_SERVICES("提供临时劳务", "提供临时劳务", 105564),
|
||||
TRANSFER_OF_PROPERTY("转让财产", "转让财产", 105564),
|
||||
ENGAGE_IN_INVESTMENT_AND_BUSINESS_ACTIVITIES("从事投资和经营活动", "从事投资和经营活动", 105564),
|
||||
OTHER("其他", "其他", 105564);
|
||||
|
||||
TaxReasonEnum(String value, String defaultLabel, int labelId) {
|
||||
this.value = value;
|
||||
this.defaultLabel = defaultLabel;
|
||||
this.labelId = labelId;
|
||||
}
|
||||
|
||||
private String value;
|
||||
|
||||
private String defaultLabel;
|
||||
|
||||
private int labelId;
|
||||
|
||||
@Override
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDefaultLabel() {
|
||||
return defaultLabel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getLabelId() {
|
||||
return labelId;
|
||||
}
|
||||
|
||||
public static TaxReasonEnum getDefaultLabelByValue(Integer value) {
|
||||
for (TaxReasonEnum e : TaxReasonEnum.values()) {
|
||||
if (Objects.equals(e.getValue(), value)) {
|
||||
return e;
|
||||
}
|
||||
}
|
||||
return Employment;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
package com.engine.salary.enums.salarysob;
|
||||
|
||||
|
||||
import com.engine.salary.enums.BaseEnum;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 申报类型 1:综合所得; 2: 分类所得;3:非居民所得;4:限售股所得
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
public enum DeclareReportTypeEnum implements BaseEnum<Integer> {
|
||||
COMPREHENSIVE_INCOME(1, "综合所得", 100133),
|
||||
CLASSIFIED_INCOME(2, "分类所得", 86185),
|
||||
NONRESIDENT_INCOME(3, "非居民所得", 107369),
|
||||
RESTRICTED_SHARES_INCOME(4, "限售股所得", 90633);
|
||||
|
||||
private int value;
|
||||
|
||||
private String defaultLabel;
|
||||
|
||||
private int labelId;
|
||||
|
||||
DeclareReportTypeEnum(int value, String defaultLabel, int labelId) {
|
||||
this.value = value;
|
||||
this.defaultLabel = defaultLabel;
|
||||
this.labelId = labelId;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Integer getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getLabelId() {
|
||||
return labelId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDefaultLabel() {
|
||||
return defaultLabel;
|
||||
}
|
||||
|
||||
public static DeclareReportTypeEnum parseByValue(Integer value) {
|
||||
for (DeclareReportTypeEnum targetTypeEnum : DeclareReportTypeEnum.values()) {
|
||||
if (Objects.equals(targetTypeEnum.getValue(), value)) {
|
||||
return targetTypeEnum;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
package com.engine.salary.enums.salarysob;
|
||||
|
||||
import com.engine.salary.enums.BaseEnum;
|
||||
import com.engine.salary.remote.tax.response.employee.GetDeclareTaxResultFeedbackResponse;
|
||||
import com.engine.salary.remote.tax.response.declare.GetDeclareTaxResultFeedbackResponse;
|
||||
import com.engine.salary.util.excel.ExcelUtil;
|
||||
import com.google.common.collect.Lists;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
|
|
@ -19,7 +19,7 @@ import java.util.*;
|
|||
public enum IncomeCategoryEnum implements BaseEnum<Integer> {
|
||||
|
||||
// todo 多语言
|
||||
WAGES_AND_SALARIES(1, "0101", "正常工资薪金", 160487) {
|
||||
WAGES_AND_SALARIES(1, "0101", "正常工资薪金", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 160487) {
|
||||
@Override
|
||||
public Map<String, List<List<Object>>> parseGetDeclareTaxResultFeedbackResponse(Map<String, List<List<Object>>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) {
|
||||
List<GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw> zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getZcgzxj().getSscglb();
|
||||
|
|
@ -28,7 +28,7 @@ public enum IncomeCategoryEnum implements BaseEnum<Integer> {
|
|||
return result;
|
||||
}
|
||||
},
|
||||
REMUNERATION_FOR_LABOR(4, "0400", "一般劳务报酬所得", 160488) {
|
||||
REMUNERATION_FOR_LABOR(4, "0400", "一般劳务报酬所得", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 160488) {
|
||||
@Override
|
||||
public Map<String, List<List<Object>>> parseGetDeclareTaxResultFeedbackResponse(Map<String, List<List<Object>>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) {
|
||||
List<GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw> zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getLwbclb().getSscglb();
|
||||
|
|
@ -37,7 +37,7 @@ public enum IncomeCategoryEnum implements BaseEnum<Integer> {
|
|||
return result;
|
||||
}
|
||||
},
|
||||
ONETIME_ANNUAL_BONUS(2, "0103", "全年一次性奖金收入", 160489) {
|
||||
ONETIME_ANNUAL_BONUS(2, "0103", "全年一次性奖金收入", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 160489) {
|
||||
@Override
|
||||
public Map<String, List<List<Object>>> parseGetDeclareTaxResultFeedbackResponse(Map<String, List<List<Object>>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) {
|
||||
List<GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw> zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getQnycxjjsslb().getSscglb();
|
||||
|
|
@ -46,7 +46,7 @@ public enum IncomeCategoryEnum implements BaseEnum<Integer> {
|
|||
return result;
|
||||
}
|
||||
},
|
||||
COMPENSATION_FOR_RETIRE(107, "0107", "内退一次性补偿金", 181936) {
|
||||
COMPENSATION_FOR_RETIRE(107, "0107", "内退一次性补偿金", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181936) {
|
||||
@Override
|
||||
public Map<String, List<List<Object>>> parseGetDeclareTaxResultFeedbackResponse(Map<String, List<List<Object>>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) {
|
||||
List<GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw> zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getNtycxbcjlb().getSscglb();
|
||||
|
|
@ -55,7 +55,7 @@ public enum IncomeCategoryEnum implements BaseEnum<Integer> {
|
|||
return result;
|
||||
}
|
||||
},
|
||||
COMPENSATION_FOR_DISMISS(108, "0108", "解除劳动合同一次性补偿金", 181937) {
|
||||
COMPENSATION_FOR_DISMISS(108, "0108", "解除劳动合同一次性补偿金", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181937) {
|
||||
@Override
|
||||
public Map<String, List<List<Object>>> parseGetDeclareTaxResultFeedbackResponse(Map<String, List<List<Object>>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) {
|
||||
List<GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw> zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getJcldhtycxbcjlb().getSscglb();
|
||||
|
|
@ -64,7 +64,7 @@ public enum IncomeCategoryEnum implements BaseEnum<Integer> {
|
|||
return result;
|
||||
}
|
||||
},
|
||||
INCOME_FOR_INDIVIDUAL_EQUITY_INCENTIVE(109, "0109", "个人股权激励收入", 181938) {
|
||||
INCOME_FOR_INDIVIDUAL_EQUITY_INCENTIVE(109, "0109", "个人股权激励收入", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181938) {
|
||||
@Override
|
||||
public Map<String, List<List<Object>>> parseGetDeclareTaxResultFeedbackResponse(Map<String, List<List<Object>>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) {
|
||||
List<GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw> zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getGrgqjl().getSscglb();
|
||||
|
|
@ -73,7 +73,7 @@ public enum IncomeCategoryEnum implements BaseEnum<Integer> {
|
|||
return result;
|
||||
}
|
||||
},
|
||||
ANNUITY_RECEIPT(110, "0110", "年金领取", 181939) {
|
||||
ANNUITY_RECEIPT(110, "0110", "年金领取", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181939) {
|
||||
@Override
|
||||
public Map<String, List<List<Object>>> parseGetDeclareTaxResultFeedbackResponse(Map<String, List<List<Object>>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) {
|
||||
List<GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw> zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getQynj().getSscglb();
|
||||
|
|
@ -82,7 +82,7 @@ public enum IncomeCategoryEnum implements BaseEnum<Integer> {
|
|||
return result;
|
||||
}
|
||||
},
|
||||
INCOME_FOR_INSURANCE_SALESMAN(402, "0402", "保险营销员佣金收入", 181940) {
|
||||
INCOME_FOR_INSURANCE_SALESMAN(402, "0402", "保险营销员佣金收入", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181940) {
|
||||
@Override
|
||||
public Map<String, List<List<Object>>> parseGetDeclareTaxResultFeedbackResponse(Map<String, List<List<Object>>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) {
|
||||
List<GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw> zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getBxyxy().getSscglb();
|
||||
|
|
@ -91,7 +91,7 @@ public enum IncomeCategoryEnum implements BaseEnum<Integer> {
|
|||
return result;
|
||||
}
|
||||
},
|
||||
INCOME_FOR_SECURITIES_BROKER(403, "0403", "证券经纪人佣金收入", 181942) {
|
||||
INCOME_FOR_SECURITIES_BROKER(403, "0403", "证券经纪人佣金收入", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181942) {
|
||||
@Override
|
||||
public Map<String, List<List<Object>>> parseGetDeclareTaxResultFeedbackResponse(Map<String, List<List<Object>>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) {
|
||||
List<GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw> zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getZqjjr().getSscglb();
|
||||
|
|
@ -100,7 +100,7 @@ public enum IncomeCategoryEnum implements BaseEnum<Integer> {
|
|||
return result;
|
||||
}
|
||||
},
|
||||
REMUNERATION_FOR_OTHER_CONTINUOUS_LABOR(489, "0489", "其他连续劳务报酬所得", 181943) {
|
||||
REMUNERATION_FOR_OTHER_CONTINUOUS_LABOR(489, "0489", "其他连续劳务报酬所得", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181943) {
|
||||
@Override
|
||||
public Map<String, List<List<Object>>> parseGetDeclareTaxResultFeedbackResponse(Map<String, List<List<Object>>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) {
|
||||
List<GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw> zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getQtlxlwbc().getSscglb();
|
||||
|
|
@ -109,7 +109,7 @@ public enum IncomeCategoryEnum implements BaseEnum<Integer> {
|
|||
return result;
|
||||
}
|
||||
},
|
||||
REMUNERATION_FOR_OTHER_LABOR(499, "0499", "其他非连续劳务报酬所得", 175330) {
|
||||
REMUNERATION_FOR_OTHER_LABOR(499, "0499", "其他非连续劳务报酬所得", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 175330) {
|
||||
@Override
|
||||
public Map<String, List<List<Object>>> parseGetDeclareTaxResultFeedbackResponse(Map<String, List<List<Object>>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) {
|
||||
List<GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw> zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getQtflxlwbc().getSscglb();
|
||||
|
|
@ -118,7 +118,7 @@ public enum IncomeCategoryEnum implements BaseEnum<Integer> {
|
|||
return result;
|
||||
}
|
||||
},
|
||||
REMUNERATION_FOR_AUTHOR(500, "0500", "稿酬所得", 181944) {
|
||||
REMUNERATION_FOR_AUTHOR(500, "0500", "稿酬所得", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181944) {
|
||||
@Override
|
||||
public Map<String, List<List<Object>>> parseGetDeclareTaxResultFeedbackResponse(Map<String, List<List<Object>>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) {
|
||||
List<GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw> zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getGcsdlb().getSscglb();
|
||||
|
|
@ -127,7 +127,7 @@ public enum IncomeCategoryEnum implements BaseEnum<Integer> {
|
|||
return result;
|
||||
}
|
||||
},
|
||||
ROYALTIES(600, "0600", "特许权使用费所得", 181945) {
|
||||
ROYALTIES(600, "0600", "特许权使用费所得", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181945) {
|
||||
@Override
|
||||
public Map<String, List<List<Object>>> parseGetDeclareTaxResultFeedbackResponse(Map<String, List<List<Object>>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) {
|
||||
List<GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw> zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getTxq().getSscglb();
|
||||
|
|
@ -136,25 +136,63 @@ public enum IncomeCategoryEnum implements BaseEnum<Integer> {
|
|||
return result;
|
||||
}
|
||||
},
|
||||
;
|
||||
NON_RESIDENT_INCOME_WAGES_AND_SALARIES(700, "0700", "无住所个人正常工资薪金", DeclareReportTypeEnum.NONRESIDENT_INCOME, 181945) {
|
||||
@Override
|
||||
public Map<String, List<List<Object>>> parseGetDeclareTaxResultFeedbackResponse(Map<String, List<List<Object>>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) {
|
||||
List<GetDeclareTaxResultFeedbackResponse.Body.fjmsd.fjmsdssjgdx.fjmsdscbw> fjmsd = declareTaxResultFeedbackResponse.getBody().getFjmsd().getWjgzxjlb().getSscglb();
|
||||
List<List<Object>> sheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.fjmsd.fjmsdssjgdx.fjmsdscbw.class, fjmsd);
|
||||
result.put(this.getDefaultLabel(), sheetData);
|
||||
return result;
|
||||
}
|
||||
},
|
||||
NON_RESIDENT_INCOME_MONTHLY_BONUS(710, "0710", "无住所个人数月奖金", DeclareReportTypeEnum.NONRESIDENT_INCOME, 181945) {
|
||||
@Override
|
||||
public Map<String, List<List<Object>>> parseGetDeclareTaxResultFeedbackResponse(Map<String, List<List<Object>>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) {
|
||||
List<GetDeclareTaxResultFeedbackResponse.Body.fjmsd.fjmsdssjgdx.fjmsdscbw> fjmsd = declareTaxResultFeedbackResponse.getBody().getFjmsd().getWjrysyjjlb().getSscglb();
|
||||
List<List<Object>> sheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.fjmsd.fjmsdssjgdx.fjmsdscbw.class, fjmsd);
|
||||
result.put(this.getDefaultLabel(), sheetData);
|
||||
return result;
|
||||
}
|
||||
},
|
||||
NON_RESIDENT_INCOME_REMUNERATION_FOR_LABOR(720, "0720", "一般劳务报酬所得", DeclareReportTypeEnum.NONRESIDENT_INCOME, 181945) {
|
||||
@Override
|
||||
public Map<String, List<List<Object>>> parseGetDeclareTaxResultFeedbackResponse(Map<String, List<List<Object>>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) {
|
||||
List<GetDeclareTaxResultFeedbackResponse.Body.fjmsd.fjmsdssjgdx.fjmsdscbw> fjmsd = declareTaxResultFeedbackResponse.getBody().getFjmsd().getLwbclb().getSscglb();
|
||||
List<List<Object>> sheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.fjmsd.fjmsdssjgdx.fjmsdscbw.class, fjmsd);
|
||||
result.put(this.getDefaultLabel(), sheetData);
|
||||
return result;
|
||||
}
|
||||
},
|
||||
NON_RESIDENT_INCOME_COMPENSATION_FOR_DISMISS(730, "0730", "解除劳动合同一次性补偿金", DeclareReportTypeEnum.NONRESIDENT_INCOME, 181945) {
|
||||
@Override
|
||||
public Map<String, List<List<Object>>> parseGetDeclareTaxResultFeedbackResponse(Map<String, List<List<Object>>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) {
|
||||
List<GetDeclareTaxResultFeedbackResponse.Body.fjmsd.fjmsdssjgdx.fjmsdscbw> fjmsd = declareTaxResultFeedbackResponse.getBody().getFjmsd().getJcldhtycxbcjlb().getSscglb();
|
||||
List<List<Object>> sheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.fjmsd.fjmsdssjgdx.fjmsdscbw.class, fjmsd);
|
||||
result.put(this.getDefaultLabel(), sheetData);
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
private int value;
|
||||
|
||||
private String code;
|
||||
|
||||
private DeclareReportTypeEnum reportType;
|
||||
|
||||
private String defaultLabel;
|
||||
|
||||
private int labelId;
|
||||
|
||||
IncomeCategoryEnum(int value, String code, String defaultLabel, int labelId) {
|
||||
IncomeCategoryEnum(int value, String code, String defaultLabel, DeclareReportTypeEnum reportType, int labelId) {
|
||||
this.value = value;
|
||||
this.code = code;
|
||||
this.defaultLabel = defaultLabel;
|
||||
this.reportType = reportType;
|
||||
this.labelId = labelId;
|
||||
}
|
||||
|
||||
public abstract Map<String, List<List<Object>>> parseGetDeclareTaxResultFeedbackResponse(Map<String, List<List<Object>>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse);
|
||||
public abstract Map<String, List<List<Object>>> parseGetDeclareTaxResultFeedbackResponse(Map<String, List<List<Object>>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse);
|
||||
|
||||
@Override
|
||||
public Integer getValue() {
|
||||
|
|
@ -175,6 +213,10 @@ public enum IncomeCategoryEnum implements BaseEnum<Integer> {
|
|||
return defaultLabel;
|
||||
}
|
||||
|
||||
public DeclareReportTypeEnum getReportType() {
|
||||
return reportType;
|
||||
}
|
||||
|
||||
|
||||
public static IncomeCategoryEnum parseByValue(Integer value) {
|
||||
for (IncomeCategoryEnum incomeCategoryEnum : IncomeCategoryEnum.values()) {
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
<result column="employee_type" property="employeeType"/>
|
||||
<result column="employee_name" property="employeeName"/>
|
||||
<result column="job_num" property="jobNum"/>
|
||||
<result column="nationality" property="nationality"/>
|
||||
<result column="card_type" property="cardType"/>
|
||||
<result column="card_num" property="cardNum"/>
|
||||
<result column="gender" property="gender"/>
|
||||
|
|
@ -20,6 +21,8 @@
|
|||
<result column="employment_date" property="employmentDate"/>
|
||||
<result column="dismiss_date" property="dismissDate"/>
|
||||
<result column="disability" property="disability"/>
|
||||
<result column="entry_date" property="entryDate"/>
|
||||
<result column="departure_date" property="departureDate"/>
|
||||
<result column="disability_card_no" property="disabilityCardNo"/>
|
||||
<result column="lonely_old" property="lonelyOld"/>
|
||||
<result column="martyr_dependents" property="martyrDependents"/>
|
||||
|
|
@ -34,6 +37,8 @@
|
|||
<result column="delete_type" property="deleteType"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
<result column="birthplace" property="birthplace"/>
|
||||
<result column="tax_reasons" property="taxReasons"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 表字段 -->
|
||||
|
|
@ -47,6 +52,7 @@
|
|||
, t.employee_type
|
||||
, t.employee_name
|
||||
, t.job_num
|
||||
, t.nationality
|
||||
, t.card_type
|
||||
, t.card_num
|
||||
, t.gender
|
||||
|
|
@ -57,6 +63,8 @@
|
|||
, t.employment_first_year
|
||||
, t.employment_date
|
||||
, t.dismiss_date
|
||||
, t.entry_date
|
||||
, t.departure_date
|
||||
, t.disability
|
||||
, t.disability_card_no
|
||||
, t.lonely_old
|
||||
|
|
@ -72,6 +80,8 @@
|
|||
, t.delete_type
|
||||
, t.create_time
|
||||
, t.update_time
|
||||
, t.birthplace
|
||||
, t.tax_reasons
|
||||
</sql>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
|
|
@ -118,6 +128,9 @@
|
|||
<if test="jobNum != null">
|
||||
AND job_num = #{jobNum}
|
||||
</if>
|
||||
<if test="nationality != null">
|
||||
AND nationality = #{nationality}
|
||||
</if>
|
||||
<if test="cardType != null">
|
||||
AND card_type = #{cardType}
|
||||
</if>
|
||||
|
|
@ -238,6 +251,9 @@
|
|||
<if test="jobNum != null">
|
||||
job_num,
|
||||
</if>
|
||||
<if test="nationality != null">
|
||||
nationality,
|
||||
</if>
|
||||
<if test="cardType != null">
|
||||
card_type,
|
||||
</if>
|
||||
|
|
@ -268,6 +284,12 @@
|
|||
<if test="dismissDate != null">
|
||||
dismiss_date,
|
||||
</if>
|
||||
<if test="entryDate != null">
|
||||
entry_date,
|
||||
</if>
|
||||
<if test="departureDate != null">
|
||||
departure_date,
|
||||
</if>
|
||||
<if test="disability != null">
|
||||
disability,
|
||||
</if>
|
||||
|
|
@ -313,6 +335,12 @@
|
|||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
<if test="birthplace != null">
|
||||
birthplace,
|
||||
</if>
|
||||
<if test="taxReasons != null">
|
||||
tax_reasons,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
|
|
@ -336,6 +364,9 @@
|
|||
<if test="jobNum != null">
|
||||
#{jobNum},
|
||||
</if>
|
||||
<if test="nationality != null">
|
||||
#{nationality},
|
||||
</if>
|
||||
<if test="cardType != null">
|
||||
#{cardType},
|
||||
</if>
|
||||
|
|
@ -366,6 +397,12 @@
|
|||
<if test="dismissDate != null">
|
||||
#{dismissDate},
|
||||
</if>
|
||||
<if test="entryDate != null">
|
||||
#{entryDate},
|
||||
</if>
|
||||
<if test="departureDate != null">
|
||||
#{departureDate},
|
||||
</if>
|
||||
<if test="disability != null">
|
||||
#{disability},
|
||||
</if>
|
||||
|
|
@ -411,6 +448,12 @@
|
|||
<if test="updateTime != null">
|
||||
#{updateTime},
|
||||
</if>
|
||||
<if test="birthplace != null">
|
||||
#{birthplace},
|
||||
</if>
|
||||
<if test="taxReasons != null">
|
||||
#{taxReasons},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
|
@ -420,6 +463,7 @@
|
|||
(
|
||||
birthday,
|
||||
card_num,
|
||||
nationality,
|
||||
card_type,
|
||||
create_time,
|
||||
creator,
|
||||
|
|
@ -430,6 +474,8 @@
|
|||
disability,
|
||||
disability_card_no,
|
||||
dismiss_date,
|
||||
entry_date,
|
||||
departure_date,
|
||||
employee_id,
|
||||
employee_name,
|
||||
employee_type,
|
||||
|
|
@ -449,12 +495,15 @@
|
|||
tax_agent_id,
|
||||
tax_cycle,
|
||||
tenant_key,
|
||||
update_time
|
||||
update_time,
|
||||
birthplace,
|
||||
tax_reasons
|
||||
)
|
||||
VALUES
|
||||
<foreach collection="collection" item="item" separator=",">(
|
||||
#{item.birthday},
|
||||
#{item.cardNum},
|
||||
#{item.nationality},
|
||||
#{item.cardType},
|
||||
#{item.createTime},
|
||||
#{item.creator},
|
||||
|
|
@ -465,6 +514,8 @@
|
|||
#{item.disability},
|
||||
#{item.disabilityCardNo},
|
||||
#{item.dismissDate},
|
||||
#{item.entryDate},
|
||||
#{item.departureDate},
|
||||
#{item.employeeId},
|
||||
#{item.employeeName},
|
||||
#{item.employeeType},
|
||||
|
|
@ -484,7 +535,9 @@
|
|||
#{item.taxAgentId},
|
||||
#{item.taxCycle},
|
||||
#{item.tenantKey},
|
||||
#{item.updateTime}
|
||||
#{item.updateTime},
|
||||
#{item.birthplace},
|
||||
#{item.taxReasons}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
|
@ -494,6 +547,7 @@
|
|||
INSERT INTO hrsa_employee_declare (
|
||||
birthday,
|
||||
card_num,
|
||||
nationality,
|
||||
card_type,
|
||||
create_time,
|
||||
creator,
|
||||
|
|
@ -504,6 +558,8 @@
|
|||
disability,
|
||||
disability_card_no,
|
||||
dismiss_date,
|
||||
entry_date,
|
||||
departure_date,
|
||||
employee_id,
|
||||
employee_name,
|
||||
employee_type,
|
||||
|
|
@ -523,14 +579,17 @@
|
|||
tax_agent_id,
|
||||
tax_cycle,
|
||||
tenant_key,
|
||||
update_time
|
||||
update_time,
|
||||
birthplace,
|
||||
tax_reasons
|
||||
)
|
||||
|
||||
<foreach collection="collection" item="item" separator="union all">
|
||||
select
|
||||
#{item.birthday,jdbcType=DATE},
|
||||
#{item.cardNum,jdbcType=VARCHAR},
|
||||
#{item.cardType,jdbcType=},
|
||||
#{item.nationality,jdbcType=VARCHAR},
|
||||
#{item.cardType,jdbcType=INTEGER},
|
||||
#{item.createTime,jdbcType=DATE},
|
||||
#{item.creator,jdbcType=DOUBLE},
|
||||
#{item.declareErrorMsg,jdbcType=VARCHAR},
|
||||
|
|
@ -540,6 +599,8 @@
|
|||
#{item.disability,jdbcType=INTEGER},
|
||||
#{item.disabilityCardNo,jdbcType=VARCHAR},
|
||||
#{item.dismissDate,jdbcType=DATE},
|
||||
#{item.entryDate,jdbcType=DATE},
|
||||
#{item.departureDate,jdbcType=DATE},
|
||||
#{item.employeeId,jdbcType=DOUBLE},
|
||||
#{item.employeeName,jdbcType=VARCHAR},
|
||||
#{item.employeeType,jdbcType=INTEGER},
|
||||
|
|
@ -559,7 +620,9 @@
|
|||
#{item.taxAgentId,jdbcType=DOUBLE},
|
||||
#{item.taxCycle,jdbcType=DATE},
|
||||
#{item.tenantKey,jdbcType=VARCHAR},
|
||||
#{item.updateTime,jdbcType=DATE}
|
||||
#{item.updateTime,jdbcType=DATE},
|
||||
#{item.birthplace,jdbcType=VARCHAR},
|
||||
#{item.taxReasons,jdbcType=VARCHAR}
|
||||
from dual
|
||||
</foreach>
|
||||
</insert>
|
||||
|
|
@ -570,6 +633,7 @@
|
|||
INSERT INTO hrsa_employee_declare (
|
||||
birthday,
|
||||
card_num,
|
||||
nationality,
|
||||
card_type,
|
||||
create_time,
|
||||
creator,
|
||||
|
|
@ -580,6 +644,8 @@
|
|||
disability,
|
||||
disability_card_no,
|
||||
dismiss_date,
|
||||
entry_date,
|
||||
departure_date,
|
||||
employee_id,
|
||||
employee_name,
|
||||
employee_type,
|
||||
|
|
@ -599,12 +665,15 @@
|
|||
tax_agent_id,
|
||||
tax_cycle,
|
||||
tenant_key,
|
||||
update_time
|
||||
update_time,
|
||||
birthplace,
|
||||
tax_reasons
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
#{item.birthday},
|
||||
#{item.cardNum},
|
||||
#{item.nationality},
|
||||
#{item.cardType},
|
||||
#{item.createTime},
|
||||
#{item.creator},
|
||||
|
|
@ -615,6 +684,8 @@
|
|||
#{item.disability},
|
||||
#{item.disabilityCardNo},
|
||||
#{item.dismissDate},
|
||||
#{item.entryDate},
|
||||
#{item.departureDate},
|
||||
#{item.employeeId},
|
||||
#{item.employeeName},
|
||||
#{item.employeeType},
|
||||
|
|
@ -634,7 +705,9 @@
|
|||
#{item.taxAgentId},
|
||||
#{item.taxCycle},
|
||||
#{item.tenantKey},
|
||||
#{item.updateTime}
|
||||
#{item.updateTime},
|
||||
#{item.birthplace},
|
||||
#{item.taxReasons}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
|
@ -650,6 +723,7 @@
|
|||
employee_type=#{employeeType},
|
||||
employee_name=#{employeeName},
|
||||
job_num=#{jobNum},
|
||||
nationality=#{nationality},
|
||||
card_type=#{cardType},
|
||||
card_num=#{cardNum},
|
||||
gender=#{gender},
|
||||
|
|
@ -660,6 +734,8 @@
|
|||
employment_first_year=#{employmentFirstYear},
|
||||
employment_date=#{employmentDate},
|
||||
dismiss_date=#{dismissDate},
|
||||
entry_date=#{entryDate},
|
||||
departure_date=#{departureDate},
|
||||
disability=#{disability},
|
||||
disability_card_no=#{disabilityCardNo},
|
||||
lonely_old=#{lonelyOld},
|
||||
|
|
@ -675,6 +751,8 @@
|
|||
delete_type=#{deleteType},
|
||||
create_time=#{createTime},
|
||||
update_time=#{updateTime},
|
||||
birthplace=#{birthplace},
|
||||
tax_reasons=#{taxReasons},
|
||||
</set>
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</update>
|
||||
|
|
@ -702,6 +780,9 @@
|
|||
<if test="jobNum != null">
|
||||
job_num=#{jobNum},
|
||||
</if>
|
||||
<if test="nationality != null">
|
||||
nationality=#{nationality},
|
||||
</if>
|
||||
<if test="cardType != null">
|
||||
card_type=#{cardType},
|
||||
</if>
|
||||
|
|
@ -730,6 +811,10 @@
|
|||
employment_date=#{employmentDate},
|
||||
</if>
|
||||
dismiss_date=#{dismissDate},
|
||||
entry_date=#{entryDate},
|
||||
departure_date=#{departureDate},
|
||||
birthplace=#{birthplace},
|
||||
tax_reasons=#{taxReasons},
|
||||
<if test="disability != null">
|
||||
disability=#{disability},
|
||||
</if>
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
<result column="pwd" property="pwd"/>
|
||||
<result column="real_account" property="realAccount"/>
|
||||
<result column="tax_agent_id" property="taxAgentId"/>
|
||||
<result column="tax_agent_name" property="taxAgentName"/>
|
||||
<result column="tax_code" property="taxCode"/>
|
||||
<result column="tax_registration_number" property="taxRegistrationNumber"/>
|
||||
<result column="tenant_key" property="tenantKey"/>
|
||||
|
|
@ -69,7 +70,8 @@
|
|||
</select>
|
||||
|
||||
<!-- 条件查询 -->
|
||||
<select id="listSome" resultMap="BaseResultMap" parameterType="com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO">
|
||||
<select id="listSome" resultMap="BaseResultMap"
|
||||
parameterType="com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_tax_agent_tax_return t
|
||||
|
|
@ -401,8 +403,11 @@
|
|||
<select id="selectOneByTaxAgentId" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
,a.name as tax_agent_name
|
||||
FROM hrsa_tax_agent_tax_return t
|
||||
WHERE delete_type = 0 and tax_agent_id=#{taxAgentId}
|
||||
left join hrsa_tax_agent a
|
||||
on t.tax_agent_id = a.id
|
||||
WHERE t.delete_type = 0 and a.delete_type = 0 and tax_agent_id=#{taxAgentId}
|
||||
</select>
|
||||
|
||||
<update id="updateByTaxAgentId" parameterType="com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO">
|
||||
|
|
|
|||
|
|
@ -0,0 +1,74 @@
|
|||
package com.engine.salary.mapper.taxdeclaration;
|
||||
|
||||
import com.engine.salary.entity.taxdeclaration.po.TaxDeclareStatusPO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
public interface TaxDeclareStatusMapper {
|
||||
|
||||
/**
|
||||
* 查询所有记录
|
||||
*
|
||||
* @return 返回集合,没有返回空List
|
||||
*/
|
||||
List<TaxDeclareStatusPO> listAll();
|
||||
|
||||
/**
|
||||
* 条件查询
|
||||
*
|
||||
* @return 返回集合,没有返回空List
|
||||
*/
|
||||
List<TaxDeclareStatusPO> listSome(TaxDeclareStatusPO taxDeclareStatus);
|
||||
|
||||
|
||||
/**
|
||||
* 根据主键查询
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 返回记录,没有返回null
|
||||
*/
|
||||
TaxDeclareStatusPO getById(Long id);
|
||||
|
||||
TaxDeclareStatusPO getDeclareStatus(@Param("taxDeclareRecordId")Long taxDeclareRecordId,@Param("reportType")Integer reportType);
|
||||
|
||||
/**
|
||||
* 新增,忽略null字段
|
||||
*
|
||||
* @param taxDeclareStatus 新增的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int insertIgnoreNull(TaxDeclareStatusPO taxDeclareStatus);
|
||||
|
||||
/**
|
||||
* 修改,修改所有字段
|
||||
*
|
||||
* @param taxDeclareStatus 修改的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int update(TaxDeclareStatusPO taxDeclareStatus);
|
||||
|
||||
/**
|
||||
* 修改,忽略null字段
|
||||
*
|
||||
* @param taxDeclareStatus 修改的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int updateIgnoreNull(TaxDeclareStatusPO taxDeclareStatus);
|
||||
|
||||
/**
|
||||
* 删除记录
|
||||
*
|
||||
* @param taxDeclareStatus 待删除的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int delete(TaxDeclareStatusPO taxDeclareStatus);
|
||||
|
||||
/**
|
||||
* 批量删除记录
|
||||
* @param ids 主键id集合
|
||||
*/
|
||||
void deleteByIds(@Param("ids") Collection<Long> ids);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,311 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.engine.salary.mapper.taxdeclaration.TaxDeclareStatusMapper">
|
||||
<resultMap id="BaseResultMap" type="com.engine.salary.entity.taxdeclaration.po.TaxDeclareStatusPO">
|
||||
<result column="id" property="id"/>
|
||||
<result column="tax_declare_record_id" property="taxDeclareRecordId"/>
|
||||
<result column="report_type" property="reportType"/>
|
||||
<result column="request_id" property="requestId"/>
|
||||
<result column="tax_declare_type" property="taxDeclareType"/>
|
||||
<result column="tax_declare_status" property="taxDeclareStatus"/>
|
||||
<result column="display_update_icon" property="displayUpdateIcon"/>
|
||||
<result column="tax_declare_error_msg" property="taxDeclareErrorMsg"/>
|
||||
<result column="person_num" property="personNum"/>
|
||||
<result column="tax_pay_amount" property="taxPayAmount"/>
|
||||
<result column="tax_paid_amount" property="taxPaidAmount"/>
|
||||
<result column="tax_pure_paid_amount" property="taxPurePaidAmount"/>
|
||||
<result column="declare_request_id" property="declareRequestId"/>
|
||||
<result column="delete_type" property="deleteType"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 表字段 -->
|
||||
<sql id="baseColumns">
|
||||
t
|
||||
.
|
||||
id
|
||||
, t.tax_declare_record_id
|
||||
, t.report_type
|
||||
, t.request_id
|
||||
, t.tax_declare_type
|
||||
, t.tax_declare_status
|
||||
, t.display_update_icon
|
||||
, t.tax_declare_error_msg
|
||||
, t.person_num
|
||||
, t.tax_pay_amount
|
||||
, t.tax_paid_amount
|
||||
, t.tax_pure_paid_amount
|
||||
, t.declare_request_id
|
||||
, t.delete_type
|
||||
</sql>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="listAll" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_tax_declare_status t
|
||||
WHERE delete_type = 0
|
||||
</select>
|
||||
|
||||
<!-- 根据主键获取单条记录 -->
|
||||
<select id="getById" resultMap="BaseResultMap" parameterType="Long">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_tax_declare_status t
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</select>
|
||||
|
||||
<select id="getDeclareStatus" resultMap="BaseResultMap" >
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_tax_declare_status t
|
||||
WHERE delete_type = 0
|
||||
AND tax_declare_record_id = #{taxDeclareRecordId}
|
||||
AND report_type = #{reportType}
|
||||
</select>
|
||||
|
||||
|
||||
<!-- 条件查询 -->
|
||||
<select id="listSome" resultMap="BaseResultMap"
|
||||
parameterType="com.engine.salary.entity.taxdeclaration.po.TaxDeclareStatusPO">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_tax_declare_status t
|
||||
WHERE delete_type = 0
|
||||
<if test="id != null">
|
||||
AND id = #{id}
|
||||
</if>
|
||||
<if test="taxDeclareRecordId != null">
|
||||
AND tax_declare_record_id = #{taxDeclareRecordId}
|
||||
</if>
|
||||
<if test="reportType != null">
|
||||
AND report_type = #{reportType}
|
||||
</if>
|
||||
<if test="requestId != null">
|
||||
AND request_id = #{requestId}
|
||||
</if>
|
||||
<if test="taxDeclareType != null">
|
||||
AND tax_declare_type = #{taxDeclareType}
|
||||
</if>
|
||||
<if test="taxDeclareStatus != null">
|
||||
AND tax_declare_status = #{taxDeclareStatus}
|
||||
</if>
|
||||
<if test="displayUpdateIcon != null">
|
||||
AND display_update_icon = #{displayUpdateIcon}
|
||||
</if>
|
||||
<if test="taxDeclareErrorMsg != null">
|
||||
AND tax_declare_error_msg = #{taxDeclareErrorMsg}
|
||||
</if>
|
||||
<if test="personNum != null">
|
||||
AND person_num = #{personNum}
|
||||
</if>
|
||||
<if test="taxPayAmount != null">
|
||||
AND tax_pay_amount = #{taxPayAmount}
|
||||
</if>
|
||||
<if test="taxPaidAmount != null">
|
||||
AND tax_paid_amount = #{taxPaidAmount}
|
||||
</if>
|
||||
<if test="taxPurePaidAmount != null">
|
||||
AND tax_pure_paid_amount = #{taxPurePaidAmount}
|
||||
</if>
|
||||
<if test="declareRequestId != null">
|
||||
AND declare_request_id = #{declareRequestId}
|
||||
</if>
|
||||
<if test="deleteType != null">
|
||||
AND delete_type = #{deleteType}
|
||||
</if>
|
||||
<if test="ids != null and ids.size()>0">
|
||||
AND id IN
|
||||
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
ORDER BY id DESC
|
||||
</select>
|
||||
|
||||
|
||||
<!-- 插入不为NULL的字段 -->
|
||||
<insert id="insertIgnoreNull" parameterType="com.engine.salary.entity.taxdeclaration.po.TaxDeclareStatusPO">
|
||||
INSERT INTO hrsa_tax_declare_status
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="taxDeclareRecordId != null">
|
||||
tax_declare_record_id,
|
||||
</if>
|
||||
<if test="reportType != null">
|
||||
report_type,
|
||||
</if>
|
||||
<if test="requestId != null">
|
||||
request_id,
|
||||
</if>
|
||||
<if test="taxDeclareType != null">
|
||||
tax_declare_type,
|
||||
</if>
|
||||
<if test="taxDeclareStatus != null">
|
||||
tax_declare_status,
|
||||
</if>
|
||||
<if test="displayUpdateIcon != null">
|
||||
display_update_icon,
|
||||
</if>
|
||||
<if test="taxDeclareErrorMsg != null">
|
||||
tax_declare_error_msg,
|
||||
</if>
|
||||
<if test="personNum != null">
|
||||
person_num,
|
||||
</if>
|
||||
<if test="taxPayAmount != null">
|
||||
tax_pay_amount,
|
||||
</if>
|
||||
<if test="taxPaidAmount != null">
|
||||
tax_paid_amount,
|
||||
</if>
|
||||
<if test="taxPurePaidAmount != null">
|
||||
tax_pure_paid_amount,
|
||||
</if>
|
||||
<if test="declareRequestId != null">
|
||||
declare_request_id,
|
||||
</if>
|
||||
<if test="deleteType != null">
|
||||
delete_type,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id},
|
||||
</if>
|
||||
<if test="taxDeclareRecordId != null">
|
||||
#{taxDeclareRecordId},
|
||||
</if>
|
||||
<if test="reportType != null">
|
||||
#{reportType},
|
||||
</if>
|
||||
<if test="requestId != null">
|
||||
#{requestId},
|
||||
</if>
|
||||
<if test="taxDeclareType != null">
|
||||
#{taxDeclareType},
|
||||
</if>
|
||||
<if test="taxDeclareStatus != null">
|
||||
#{taxDeclareStatus},
|
||||
</if>
|
||||
<if test="displayUpdateIcon != null">
|
||||
#{displayUpdateIcon},
|
||||
</if>
|
||||
<if test="taxDeclareErrorMsg != null">
|
||||
#{taxDeclareErrorMsg},
|
||||
</if>
|
||||
<if test="personNum != null">
|
||||
#{personNum},
|
||||
</if>
|
||||
<if test="taxPayAmount != null">
|
||||
#{taxPayAmount},
|
||||
</if>
|
||||
<if test="taxPaidAmount != null">
|
||||
#{taxPaidAmount},
|
||||
</if>
|
||||
<if test="taxPurePaidAmount != null">
|
||||
#{taxPurePaidAmount},
|
||||
</if>
|
||||
<if test="declareRequestId != null">
|
||||
#{declareRequestId},
|
||||
</if>
|
||||
<if test="deleteType != null">
|
||||
#{deleteType},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
||||
|
||||
<!-- 更新,更新全部字段 -->
|
||||
<update id="update" parameterType="com.engine.salary.entity.taxdeclaration.po.TaxDeclareStatusPO">
|
||||
UPDATE hrsa_tax_declare_status
|
||||
<set>
|
||||
tax_declare_record_id=#{taxDeclareRecordId},
|
||||
report_type=#{reportType},
|
||||
request_id=#{requestId},
|
||||
tax_declare_type=#{taxDeclareType},
|
||||
tax_declare_status=#{taxDeclareStatus},
|
||||
display_update_icon=#{displayUpdateIcon},
|
||||
tax_declare_error_msg=#{taxDeclareErrorMsg},
|
||||
person_num=#{personNum},
|
||||
tax_pay_amount=#{taxPayAmount},
|
||||
tax_paid_amount=#{taxPaidAmount},
|
||||
tax_pure_paid_amount=#{taxPurePaidAmount},
|
||||
declare_request_id=#{declareRequestId},
|
||||
delete_type=#{deleteType},
|
||||
</set>
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</update>
|
||||
|
||||
|
||||
<!-- 更新不为NULL的字段 -->
|
||||
<update id="updateIgnoreNull" parameterType="com.engine.salary.entity.taxdeclaration.po.TaxDeclareStatusPO">
|
||||
UPDATE hrsa_tax_declare_status
|
||||
<set>
|
||||
<if test="taxDeclareRecordId != null">
|
||||
tax_declare_record_id=#{taxDeclareRecordId},
|
||||
</if>
|
||||
<if test="reportType != null">
|
||||
report_type=#{reportType},
|
||||
</if>
|
||||
<if test="requestId != null">
|
||||
request_id=#{requestId},
|
||||
</if>
|
||||
<if test="taxDeclareType != null">
|
||||
tax_declare_type=#{taxDeclareType},
|
||||
</if>
|
||||
<if test="taxDeclareStatus != null">
|
||||
tax_declare_status=#{taxDeclareStatus},
|
||||
</if>
|
||||
<if test="displayUpdateIcon != null">
|
||||
display_update_icon=#{displayUpdateIcon},
|
||||
</if>
|
||||
<if test="taxDeclareErrorMsg != null">
|
||||
tax_declare_error_msg=#{taxDeclareErrorMsg},
|
||||
</if>
|
||||
<if test="personNum != null">
|
||||
person_num=#{personNum},
|
||||
</if>
|
||||
<if test="taxPayAmount != null">
|
||||
tax_pay_amount=#{taxPayAmount},
|
||||
</if>
|
||||
<if test="taxPaidAmount != null">
|
||||
tax_paid_amount=#{taxPaidAmount},
|
||||
</if>
|
||||
<if test="taxPurePaidAmount != null">
|
||||
tax_pure_paid_amount=#{taxPurePaidAmount},
|
||||
</if>
|
||||
<if test="declareRequestId != null">
|
||||
declare_request_id=#{declareRequestId},
|
||||
</if>
|
||||
<if test="deleteType != null">
|
||||
delete_type=#{deleteType},
|
||||
</if>
|
||||
</set>
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</update>
|
||||
|
||||
|
||||
<!-- 根据主键删除记录 -->
|
||||
<delete id="delete">
|
||||
UPDATE hrsa_tax_declare_status
|
||||
SET delete_type=1
|
||||
WHERE id = #{id}
|
||||
AND delete_type = 0
|
||||
</delete>
|
||||
|
||||
<delete id="deleteByIds">
|
||||
UPDATE hrsa_tax_declare_status
|
||||
SET delete_type = 1
|
||||
WHERE delete_type = 0
|
||||
AND id IN
|
||||
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
package com.engine.salary.remote.tax.client;
|
||||
|
||||
import com.engine.salary.remote.tax.response.employee.GetDeclareTaxResultFeedbackResponse;
|
||||
import com.engine.salary.remote.tax.response.declare.GetDeclareTaxResultFeedbackResponse;
|
||||
import com.engine.salary.util.HttpUtil;
|
||||
import com.engine.salary.util.JsonUtil;
|
||||
import com.engine.salary.util.SingnatureData;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,10 @@ package com.engine.salary.remote.tax.client;
|
|||
|
||||
import com.engine.salary.entity.employeedeclare.param.EmployeeDeclareParam;
|
||||
import com.engine.salary.enums.taxagent.TaxAgentTaxReturnPasswordTypeEnum;
|
||||
import com.engine.salary.remote.tax.request.employee.BatchInvalidSubmissionRequest;
|
||||
import com.engine.salary.remote.tax.request.employee.GetCompanyEmployeeRequest;
|
||||
import com.engine.salary.remote.tax.request.employee.InformationChangeRequest;
|
||||
import com.engine.salary.remote.tax.request.employee.MergedEmployeeArchivesRequest;
|
||||
import com.engine.salary.remote.tax.response.employee.GetCompanyEmployeeResponse;
|
||||
import com.engine.salary.util.HttpUtil;
|
||||
import com.engine.salary.util.JsonUtil;
|
||||
|
|
@ -11,8 +14,10 @@ import com.engine.salary.util.SingnatureData;
|
|||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* 人员信息登记报送客户端
|
||||
|
|
@ -34,8 +39,8 @@ public class EmployeeClient extends TaxBaseClient {
|
|||
|
||||
String url = super.apiConfig.getHost() + "gateway/iit/data/getCompanyEmployee";
|
||||
GetCompanyEmployeeRequest getCompanyEmployeeRequest = new GetCompanyEmployeeRequest();
|
||||
getCompanyEmployeeRequest.setNsrsbh( returnPO.getTaxCode());
|
||||
getCompanyEmployeeRequest.setQymc("");
|
||||
getCompanyEmployeeRequest.setNsrsbh(returnPO.getTaxCode());
|
||||
getCompanyEmployeeRequest.setQymc(returnPO.getTaxAgentName());
|
||||
getCompanyEmployeeRequest.setDjxhid(StringUtils.isNotEmpty(returnPO.getTaxRegistrationNumber()) ? returnPO.getTaxRegistrationNumber() : null);
|
||||
getCompanyEmployeeRequest.setAreaid(returnPO.getAreaCode());
|
||||
getCompanyEmployeeRequest.setBmbh(StringUtils.isNotEmpty(returnPO.getDepartmentCode()) ? returnPO.getDepartmentCode() : null);
|
||||
|
|
@ -45,10 +50,10 @@ public class EmployeeClient extends TaxBaseClient {
|
|||
getCompanyEmployeeRequest.setSmzh(realNamePwd ? returnPO.getRealAccount() : null);
|
||||
getCompanyEmployeeRequest.setSmmm(realNamePwd ? returnPO.getPwd() : null);
|
||||
getCompanyEmployeeRequest.setJmsmmm("0");
|
||||
getCompanyEmployeeRequest.setMmlx(""+returnPO.getPasswordType());
|
||||
getCompanyEmployeeRequest.setMmlx("" + returnPO.getPasswordType());
|
||||
getCompanyEmployeeRequest.setSsyf(SalaryDateUtil.getFormatYYYYMM(param.getTaxCycle()));
|
||||
getCompanyEmployeeRequest.setPageNo(""+param.getCurrent());
|
||||
getCompanyEmployeeRequest.setPageSize(""+param.getPageSize());
|
||||
getCompanyEmployeeRequest.setPageNo("" + param.getCurrent());
|
||||
getCompanyEmployeeRequest.setPageSize("" + param.getPageSize());
|
||||
|
||||
String reqJson = JsonUtil.toJsonString(getCompanyEmployeeRequest);
|
||||
log.info("getCompanyEmployee params --- \n{}\n", reqJson);
|
||||
|
|
@ -62,4 +67,107 @@ public class EmployeeClient extends TaxBaseClient {
|
|||
|
||||
}
|
||||
|
||||
public String batchInvalidSubmission(BatchInvalidSubmissionRequest batchInvalidSubmissionRequest) {
|
||||
|
||||
String url = super.apiConfig.getHost() + "gateway/iit/declare/batchInvalidSubmission";
|
||||
batchInvalidSubmissionRequest.setNsrsbh(returnPO.getTaxCode());
|
||||
batchInvalidSubmissionRequest.setBizNo(UUID.randomUUID().toString().replace("-", ""));
|
||||
batchInvalidSubmissionRequest.setQymc(returnPO.getTaxAgentName());
|
||||
batchInvalidSubmissionRequest.setDjxhid(StringUtils.isNotEmpty(returnPO.getTaxRegistrationNumber()) ? returnPO.getTaxRegistrationNumber() : null);
|
||||
batchInvalidSubmissionRequest.setAreaid(returnPO.getAreaCode());
|
||||
batchInvalidSubmissionRequest.setBmbh(StringUtils.isNotEmpty(returnPO.getDepartmentCode()) ? returnPO.getDepartmentCode() : null);
|
||||
boolean realNamePwd = TaxAgentTaxReturnPasswordTypeEnum.REAL_NAME_PASSWORD.getValue().equals(returnPO.getPasswordType());
|
||||
batchInvalidSubmissionRequest.setSbmm(realNamePwd ? null : returnPO.getPwd());
|
||||
batchInvalidSubmissionRequest.setJmsbmm("0");
|
||||
batchInvalidSubmissionRequest.setSmzh(realNamePwd ? returnPO.getRealAccount() : null);
|
||||
batchInvalidSubmissionRequest.setSmmm(realNamePwd ? returnPO.getPwd() : null);
|
||||
batchInvalidSubmissionRequest.setJmsmmm("0");
|
||||
batchInvalidSubmissionRequest.setMmlx("" + returnPO.getPasswordType());
|
||||
|
||||
|
||||
String reqJson = JsonUtil.toJsonString(batchInvalidSubmissionRequest);
|
||||
log.info("batchInvalidSubmission params --- \n{}\n", reqJson);
|
||||
Map<String, String> params = new HashMap<>(1);
|
||||
Map<String, String> header = SingnatureData.initHeader(params, apiConfig.getAppKey(), apiConfig.getAppSecret());
|
||||
|
||||
// 开始请求
|
||||
String res = HttpUtil.doPost(url, header, reqJson, HttpUtil.JSON_TYPE);
|
||||
log.info("batchInvalidSubmission res --- {}", res);
|
||||
// return JsonUtil.parseObject(res, GetCompanyEmployeeResponse.class);
|
||||
return res;
|
||||
}
|
||||
|
||||
public String informationChange(InformationChangeRequest informationChangeRequest) {
|
||||
|
||||
String url = super.apiConfig.getHost() + "gateway/iit/employee/informationChange";
|
||||
informationChangeRequest.setNsrsbh(returnPO.getTaxCode());
|
||||
informationChangeRequest.setBizNo(UUID.randomUUID().toString().replace("-", ""));
|
||||
informationChangeRequest.setQymc(returnPO.getTaxAgentName());
|
||||
informationChangeRequest.setDjxhid(StringUtils.isNotEmpty(returnPO.getTaxRegistrationNumber()) ? returnPO.getTaxRegistrationNumber() : null);
|
||||
informationChangeRequest.setAreaid(returnPO.getAreaCode());
|
||||
informationChangeRequest.setBmbh(StringUtils.isNotEmpty(returnPO.getDepartmentCode()) ? returnPO.getDepartmentCode() : null);
|
||||
boolean realNamePwd = TaxAgentTaxReturnPasswordTypeEnum.REAL_NAME_PASSWORD.getValue().equals(returnPO.getPasswordType());
|
||||
informationChangeRequest.setSbmm(realNamePwd ? null : returnPO.getPwd());
|
||||
informationChangeRequest.setJmsbmm("0");
|
||||
informationChangeRequest.setSmzh(realNamePwd ? returnPO.getRealAccount() : null);
|
||||
informationChangeRequest.setSmmm(realNamePwd ? returnPO.getPwd() : null);
|
||||
informationChangeRequest.setJmsmmm("0");
|
||||
informationChangeRequest.setMmlx("" + returnPO.getPasswordType());
|
||||
|
||||
|
||||
String reqJson = JsonUtil.toJsonString(informationChangeRequest);
|
||||
log.info("informationChangeRequest params --- \n{}\n", reqJson);
|
||||
Map<String, String> params = new HashMap<>(1);
|
||||
Map<String, String> header = SingnatureData.initHeader(params, apiConfig.getAppKey(), apiConfig.getAppSecret());
|
||||
|
||||
// 开始请求
|
||||
String res = HttpUtil.doPost(url, header, reqJson, HttpUtil.JSON_TYPE);
|
||||
log.info("informationChangeRequest res --- {}", res);
|
||||
// return JsonUtil.parseObject(res, GetCompanyEmployeeResponse.class);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
public String mergedEmployeeArchives(MergedEmployeeArchivesRequest mergedEmployeeArchivesRequest) {
|
||||
|
||||
String url = super.apiConfig.getHost() + "gateway/iit/mergedEmployeeArchives/query";
|
||||
mergedEmployeeArchivesRequest.setNsrsbh(returnPO.getTaxCode());
|
||||
mergedEmployeeArchivesRequest.setBizNo(UUID.randomUUID().toString().replace("-", ""));
|
||||
mergedEmployeeArchivesRequest.setQymc(returnPO.getTaxAgentName());
|
||||
mergedEmployeeArchivesRequest.setDjxhid(StringUtils.isNotEmpty(returnPO.getTaxRegistrationNumber()) ? returnPO.getTaxRegistrationNumber() : null);
|
||||
mergedEmployeeArchivesRequest.setAreaid(returnPO.getAreaCode());
|
||||
mergedEmployeeArchivesRequest.setBmbh(StringUtils.isNotEmpty(returnPO.getDepartmentCode()) ? returnPO.getDepartmentCode() : null);
|
||||
boolean realNamePwd = TaxAgentTaxReturnPasswordTypeEnum.REAL_NAME_PASSWORD.getValue().equals(returnPO.getPasswordType());
|
||||
mergedEmployeeArchivesRequest.setSbmm(realNamePwd ? null : returnPO.getPwd());
|
||||
mergedEmployeeArchivesRequest.setJmsbmm("0");
|
||||
mergedEmployeeArchivesRequest.setSmzh(realNamePwd ? returnPO.getRealAccount() : null);
|
||||
mergedEmployeeArchivesRequest.setSmmm(realNamePwd ? returnPO.getPwd() : null);
|
||||
mergedEmployeeArchivesRequest.setJmsmmm("0");
|
||||
mergedEmployeeArchivesRequest.setMmlx("" + returnPO.getPasswordType());
|
||||
|
||||
|
||||
String reqJson = JsonUtil.toJsonString(mergedEmployeeArchivesRequest);
|
||||
log.info("mergedEmployeeArchivesRequest params --- \n{}\n", reqJson);
|
||||
Map<String, String> params = new HashMap<>(1);
|
||||
Map<String, String> header = SingnatureData.initHeader(params, apiConfig.getAppKey(), apiConfig.getAppSecret());
|
||||
|
||||
// 开始请求
|
||||
String res = HttpUtil.doPost(url, header, reqJson, HttpUtil.JSON_TYPE);
|
||||
log.info("mergedEmployeeArchivesRequest res --- {}", res);
|
||||
// return JsonUtil.parseObject(res, GetCompanyEmployeeResponse.class);
|
||||
return res;
|
||||
}
|
||||
|
||||
public String mergedEmployeeArchivesFeedback(String requestId) {
|
||||
|
||||
String url = super.apiConfig.getHost() + "gateway/iit/mergedEmployeeArchives/getFeedback";
|
||||
Map<String, String> params = new HashMap<>(1);
|
||||
params.put("requestId", requestId);
|
||||
log.info("mergedEmployeeArchivesFeedback requestId --- \n{}\n", requestId);
|
||||
Map<String, String> header = SingnatureData.initHeader(Collections.emptyMap(), apiConfig.getAppKey(), apiConfig.getAppSecret());
|
||||
String res = HttpUtil.getRequest(url, header, params);
|
||||
log.info("mergedEmployeeArchivesFeedback res --- {}", res);
|
||||
// return JsonUtil.parseObject(res, GetCompanyEmployeeResponse.class);
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,62 @@
|
|||
package com.engine.salary.remote.tax.client;
|
||||
|
||||
import com.engine.salary.enums.taxagent.TaxAgentTaxReturnPasswordTypeEnum;
|
||||
import com.engine.salary.remote.tax.request.payment.QueryArrearageRequest;
|
||||
import com.engine.salary.util.HttpUtil;
|
||||
import com.engine.salary.util.JsonUtil;
|
||||
import com.engine.salary.util.SingnatureData;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
@Slf4j
|
||||
public class PaymentClient extends TaxBaseClient {
|
||||
public PaymentClient(Long taxAgentId) {
|
||||
super(taxAgentId);
|
||||
}
|
||||
|
||||
public void queryArrearage(String taxCycle) {
|
||||
QueryArrearageRequest queryArrearageRequest = new QueryArrearageRequest();
|
||||
queryArrearageRequest.setNsrsbh(returnPO.getTaxCode());
|
||||
queryArrearageRequest.setQymc(returnPO.getTaxAgentName());
|
||||
queryArrearageRequest.setDjxhid(StringUtils.isNotEmpty(returnPO.getTaxRegistrationNumber()) ? returnPO.getTaxRegistrationNumber() : null);
|
||||
queryArrearageRequest.setAreaid(returnPO.getAreaCode());
|
||||
queryArrearageRequest.setBmbh(StringUtils.isNotEmpty(returnPO.getDepartmentCode()) ? returnPO.getDepartmentCode() : null);
|
||||
boolean realNamePwd = TaxAgentTaxReturnPasswordTypeEnum.REAL_NAME_PASSWORD.getValue().equals(returnPO.getPasswordType());
|
||||
queryArrearageRequest.setSbmm(realNamePwd ? null : returnPO.getPwd());
|
||||
queryArrearageRequest.setJmsbmm("0");
|
||||
queryArrearageRequest.setSmzh(realNamePwd ? returnPO.getRealAccount() : null);
|
||||
queryArrearageRequest.setSmmm(realNamePwd ? returnPO.getPwd() : null);
|
||||
queryArrearageRequest.setJmsmmm("0");
|
||||
queryArrearageRequest.setMmlx("" + returnPO.getPasswordType());
|
||||
|
||||
queryArrearageRequest.setBizNo(UUID.randomUUID().toString());
|
||||
queryArrearageRequest.setSkssq(taxCycle);
|
||||
|
||||
|
||||
String reqJson = JsonUtil.toJsonString(queryArrearageRequest);
|
||||
|
||||
String url = super.apiConfig.getHost() + "/gateway/iit/payment/queryArrearage";
|
||||
Map<String, String> params = new HashMap<>(1);
|
||||
Map<String, String> header = SingnatureData.initHeader(params, apiConfig.getAppKey(), apiConfig.getAppSecret());
|
||||
String res = HttpUtil.doPost(url, header, reqJson, HttpUtil.JSON_TYPE);
|
||||
System.out.println(res);
|
||||
|
||||
getArrearageQueryFeedback("");
|
||||
}
|
||||
|
||||
public void getArrearageQueryFeedback(String requestId) {
|
||||
Map<String, String> params = new HashMap<>(1);
|
||||
params.put("requestId", "43dd5abf686946f59cfea50a51f8183a");
|
||||
Map<String, String> header = SingnatureData.initHeader(Collections.emptyMap(), apiConfig.getAppKey(), apiConfig.getAppSecret());
|
||||
String url = super.apiConfig.getHost() + "/gateway/iit/payment/getArrearageQueryFeedback";
|
||||
String res = HttpUtil.getRequest(url, header, params);
|
||||
|
||||
System.out.println(res);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,71 @@
|
|||
package com.engine.salary.remote.tax.request.employee;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class BatchInvalidSubmissionRequest {
|
||||
|
||||
|
||||
private String bizNo;
|
||||
|
||||
/**
|
||||
* 税号 必填:是 扣缴单位纳税人识别号
|
||||
*/
|
||||
private String nsrsbh;
|
||||
/**
|
||||
* 企业名称 必填:是 扣缴义务人名称:例如:测试网络科技有限公司
|
||||
*/
|
||||
private String qymc;
|
||||
/**
|
||||
* 登记序号 必填:条件必填 存在多个登记序号时,需要指定传入一个.例:10117440105249764755
|
||||
*/
|
||||
private String djxhid;
|
||||
/**
|
||||
* 地区编号 必填:是 6位行政区划代码,精确到市级,例如:440100,,参考省市区编码
|
||||
*/
|
||||
private String areaid;
|
||||
/**
|
||||
* 部门编号 必填:条件必填 分部门代报时必传
|
||||
*/
|
||||
private String bmbh;
|
||||
/**
|
||||
* 申报密码 必填:条件必填 当mmlx=0时,必填
|
||||
*/
|
||||
private String sbmm;
|
||||
/**
|
||||
* 加密实名密码 必填:否 默认不传则设置为0,0表示不加密;1表示加密
|
||||
*/
|
||||
private String jmsbmm;
|
||||
/**
|
||||
* 实名账号 必填:是
|
||||
*/
|
||||
private String smzh;
|
||||
/**
|
||||
* 实名密码 必填:是
|
||||
*/
|
||||
private String smmm;
|
||||
/**
|
||||
* 加密实名密码 必填:否 默认不传则设置为0,0表示不加密;1表示加密 参考3.4代报、实名密码加密说明
|
||||
*/
|
||||
private String jmsmmm;
|
||||
|
||||
/**
|
||||
* 密码类型 必填:是 0表示申报密码; 2表示实名账号实名密码
|
||||
*/
|
||||
private String mmlx;
|
||||
|
||||
/**
|
||||
* 人员列表 必填:是
|
||||
*/
|
||||
protected List<RY> rylb;
|
||||
|
||||
|
||||
@Data
|
||||
public static class RY {
|
||||
private String xm;
|
||||
private String zzhm;
|
||||
private String zzlx;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
package com.engine.salary.remote.tax.request.employee;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class InformationChangeRequest {
|
||||
|
||||
|
||||
private String bizNo;
|
||||
|
||||
/**
|
||||
* 税号 必填:是 扣缴单位纳税人识别号
|
||||
*/
|
||||
private String nsrsbh;
|
||||
/**
|
||||
* 企业名称 必填:是 扣缴义务人名称:例如:测试网络科技有限公司
|
||||
*/
|
||||
private String qymc;
|
||||
/**
|
||||
* 登记序号 必填:条件必填 存在多个登记序号时,需要指定传入一个.例:10117440105249764755
|
||||
*/
|
||||
private String djxhid;
|
||||
/**
|
||||
* 地区编号 必填:是 6位行政区划代码,精确到市级,例如:440100,,参考省市区编码
|
||||
*/
|
||||
private String areaid;
|
||||
/**
|
||||
* 部门编号 必填:条件必填 分部门代报时必传
|
||||
*/
|
||||
private String bmbh;
|
||||
/**
|
||||
* 申报密码 必填:条件必填 当mmlx=0时,必填
|
||||
*/
|
||||
private String sbmm;
|
||||
/**
|
||||
* 加密实名密码 必填:否 默认不传则设置为0,0表示不加密;1表示加密
|
||||
*/
|
||||
private String jmsbmm;
|
||||
/**
|
||||
* 实名账号 必填:是
|
||||
*/
|
||||
private String smzh;
|
||||
/**
|
||||
* 实名密码 必填:是
|
||||
*/
|
||||
private String smmm;
|
||||
/**
|
||||
* 加密实名密码 必填:否 默认不传则设置为0,0表示不加密;1表示加密 参考3.4代报、实名密码加密说明
|
||||
*/
|
||||
private String jmsmmm;
|
||||
|
||||
/**
|
||||
* 密码类型 必填:是 0表示申报密码; 2表示实名账号实名密码
|
||||
*/
|
||||
private String mmlx;
|
||||
|
||||
private String xm;
|
||||
private String zzlx;
|
||||
private String zzhm;
|
||||
}
|
||||
|
|
@ -0,0 +1,71 @@
|
|||
package com.engine.salary.remote.tax.request.employee;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class MergedEmployeeArchivesRequest {
|
||||
|
||||
|
||||
private String bizNo;
|
||||
|
||||
/**
|
||||
* 税号 必填:是 扣缴单位纳税人识别号
|
||||
*/
|
||||
private String nsrsbh;
|
||||
/**
|
||||
* 企业名称 必填:是 扣缴义务人名称:例如:测试网络科技有限公司
|
||||
*/
|
||||
private String qymc;
|
||||
/**
|
||||
* 登记序号 必填:条件必填 存在多个登记序号时,需要指定传入一个.例:10117440105249764755
|
||||
*/
|
||||
private String djxhid;
|
||||
/**
|
||||
* 地区编号 必填:是 6位行政区划代码,精确到市级,例如:440100,,参考省市区编码
|
||||
*/
|
||||
private String areaid;
|
||||
/**
|
||||
* 部门编号 必填:条件必填 分部门代报时必传
|
||||
*/
|
||||
private String bmbh;
|
||||
/**
|
||||
* 申报密码 必填:条件必填 当mmlx=0时,必填
|
||||
*/
|
||||
private String sbmm;
|
||||
/**
|
||||
* 加密实名密码 必填:否 默认不传则设置为0,0表示不加密;1表示加密
|
||||
*/
|
||||
private String jmsbmm;
|
||||
/**
|
||||
* 实名账号 必填:是
|
||||
*/
|
||||
private String smzh;
|
||||
/**
|
||||
* 实名密码 必填:是
|
||||
*/
|
||||
private String smmm;
|
||||
/**
|
||||
* 加密实名密码 必填:否 默认不传则设置为0,0表示不加密;1表示加密 参考3.4代报、实名密码加密说明
|
||||
*/
|
||||
private String jmsmmm;
|
||||
|
||||
/**
|
||||
* 密码类型 必填:是 0表示申报密码; 2表示实名账号实名密码
|
||||
*/
|
||||
private String mmlx;
|
||||
|
||||
/**
|
||||
* 人员列表 必填:是
|
||||
*/
|
||||
protected List<BatchInvalidSubmissionRequest.RY> bdrys;
|
||||
|
||||
|
||||
@Data
|
||||
public static class RY {
|
||||
private String xm;
|
||||
private String zzlx;
|
||||
private String zzhm;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
package com.engine.salary.remote.tax.request.payment;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class QueryArrearageRequest {
|
||||
/**
|
||||
* 外部业务编号 必填:是 外部业务编号,唯一,幂等需要,最长64位,建议使用UUID
|
||||
*/
|
||||
private String bizNo;
|
||||
/**
|
||||
* 企业名称 必填:是 代报企业全称
|
||||
*/
|
||||
private String qymc;
|
||||
/**
|
||||
* 密码类型 必填:否 默认不传则设置为0, 0表示申报密码;2表示实名账号实名密码
|
||||
*/
|
||||
private String mmlx;
|
||||
/**
|
||||
* 实名账号 必填:选择必填 当mmlx=2时,必填
|
||||
*/
|
||||
private String smzh;
|
||||
/**
|
||||
* 实名密码 必填:选择必填 当mmlx=2时,必填
|
||||
*/
|
||||
private String smmm;
|
||||
/**
|
||||
* 加密实名密码 必填:否 默认不传则设置为0,0表示不加密;1表示加密 参考3.4代报、实名密码加密说明
|
||||
*/
|
||||
private String jmsmmm;
|
||||
|
||||
/**
|
||||
* 登记序号 必填:否 存在多个登记序号时,需要指定传入一个.例:10117440105249764755
|
||||
*/
|
||||
private String djxhid;
|
||||
/**
|
||||
* 税号 必填:是 扣缴单位纳税人识别号
|
||||
*/
|
||||
private String nsrsbh;
|
||||
/**
|
||||
* 税款所属期 必填:是 默认为当前月份,格式YYYYMM
|
||||
*/
|
||||
private String skssq;
|
||||
/**
|
||||
* 地区编号 必填:是 6位行政区划代码,精确到市级,例如:440100,参考省市区编码
|
||||
*/
|
||||
private String areaid;
|
||||
/**
|
||||
* 部门编号 必填:否 分部门代报时必传
|
||||
*/
|
||||
private String bmbh;
|
||||
/**
|
||||
* 部门名称 必填:否
|
||||
*/
|
||||
private String bmmc;
|
||||
/**
|
||||
* 申报密码 必填:条件必填 当mmlx=0时,必填
|
||||
*/
|
||||
private String sbmm;
|
||||
/**
|
||||
* 加密申报密码 必填:否 默认不传则设置为0,0表示不加密;1表示加密
|
||||
*/
|
||||
private String jmsbmm;
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.engine.salary.remote.tax.response.employee;
|
||||
package com.engine.salary.remote.tax.response.declare;
|
||||
|
||||
import com.engine.salary.annotation.SalaryTableColumn;
|
||||
import com.engine.salary.entity.taxpayment.response.BaseResponse;
|
||||
|
|
@ -51,19 +51,16 @@ public class GetDeclareTaxResultFeedbackResponse extends BaseResponse {
|
|||
// * 分类所得 必填:是 见分类所得计算结果
|
||||
// */
|
||||
// private 对象 flsd;
|
||||
// /**
|
||||
// * 非居民所得 必填:是 见非居民所得计算结果
|
||||
// */
|
||||
// private 对象 fjmsd;
|
||||
// /**
|
||||
/**
|
||||
* 非居民所得 必填:是 见非居民所得计算结果
|
||||
*/
|
||||
private fjmsd fjmsd;
|
||||
|
||||
// /**
|
||||
// * 限售股所得 必填:是 见限售股所得计算结果
|
||||
// */
|
||||
// private 对象 xsgsd;
|
||||
|
||||
/**
|
||||
* 人员申报失败列表 必填:是 参考人员代报结果对象
|
||||
*/
|
||||
private List<rydbjgdx> rysbsblb;
|
||||
|
||||
@Data
|
||||
public static class zhsd {
|
||||
|
|
@ -660,6 +657,248 @@ public class GetDeclareTaxResultFeedbackResponse extends BaseResponse {
|
|||
|
||||
}
|
||||
|
||||
|
||||
@Data
|
||||
public static class fjmsd {
|
||||
/**
|
||||
* 正常工资薪金(无住所个人正常工资薪金)所得列表 参考非居民所得算税结果对象
|
||||
*/
|
||||
private fjmsdssjgdx wjgzxjlb;
|
||||
/**
|
||||
* 无住所个人数月奖金列表 参考非居民所得算税结果对象
|
||||
*/
|
||||
private fjmsdssjgdx wjrysyjjlb;
|
||||
/**
|
||||
* 劳务报酬列表 参考非居民所得算税结果对象
|
||||
*/
|
||||
private fjmsdssjgdx lwbclb;
|
||||
/**
|
||||
* 稿酬所得列表 参考非居民所得算税结果对象
|
||||
*/
|
||||
private fjmsdssjgdx gcsdlb;
|
||||
/**
|
||||
* 利息姑息红利所得列表 参考非居民所得算税结果对象
|
||||
*/
|
||||
private fjmsdssjgdx lxgxhllb;
|
||||
/**
|
||||
* 股权转让列表 参考非居民所得算税结果对象
|
||||
*/
|
||||
private fjmsdssjgdx gqzrlb;
|
||||
/**
|
||||
* 其他财产转让列表 参考非居民所得算税结果对象
|
||||
*/
|
||||
private fjmsdssjgdx qtcczrlb;
|
||||
/**
|
||||
* 偶然所得列表 参考非居民所得算税结果对象
|
||||
*/
|
||||
private fjmsdssjgdx orsdlb;
|
||||
/**
|
||||
* 解除劳动合同一次性补偿金列表 参考非居民所得算税结果对象
|
||||
*/
|
||||
private fjmsdssjgdx jcldhtycxbcjlb;
|
||||
/**
|
||||
* 保险营销员薪金算税结果对象 参考非居民所得算税结果对象
|
||||
*/
|
||||
private fjmsdssjgdx bxyxy;
|
||||
/**
|
||||
* 证券经纪人薪金算税结果对象 参考非居民所得算税结果对象
|
||||
*/
|
||||
private fjmsdssjgdx zqjjr;
|
||||
/**
|
||||
* 个人股权激励结果对象 参考非居民所得算税结果对象
|
||||
*/
|
||||
private fjmsdssjgdx grgqjl;
|
||||
/**
|
||||
* 特许权使用费所得 参考非居民所得算税结果对象
|
||||
*/
|
||||
private fjmsdssjgdx txqsyfsd;
|
||||
/**
|
||||
* 个人房屋出租所得 参考非居民所得算税结果对象
|
||||
*/
|
||||
private fjmsdssjgdx grfwczsd;
|
||||
|
||||
/**
|
||||
* 非居民所得算税结果对象
|
||||
*/
|
||||
@Data
|
||||
public static class fjmsdssjgdx {
|
||||
/**
|
||||
* 非居民算税成功列表 参考输入报文非居民所得输出结果报文
|
||||
*/
|
||||
private List<fjmsdscbw> sscglb;
|
||||
/**
|
||||
* 非居民算税失败列表 参考输入报文非居民所得输出结果报文
|
||||
*/
|
||||
private List<fjmsdscbw> sssblb;
|
||||
/**
|
||||
* 非居民算税失败原因列表 参考算税失败原因对象
|
||||
*/
|
||||
private List<rydbjgdx> sssbyylb;
|
||||
/**
|
||||
* 参与非居民算税总人数
|
||||
*/
|
||||
private int sszrs;
|
||||
/**
|
||||
* 非居民算税失败总人数
|
||||
*/
|
||||
private int sssbrs;
|
||||
|
||||
/**
|
||||
* 4.4.1.3.4.2非居民所得输出结果报文
|
||||
*/
|
||||
@Data
|
||||
public static class fjmsdscbw {
|
||||
/**
|
||||
* 姓名 必填:是
|
||||
*/
|
||||
@SalaryTableColumn(text = "姓名", width = "10%", column = "xm")
|
||||
@ExcelHead(title = "姓名", dataIndex = "xm")
|
||||
private String xm;
|
||||
|
||||
/**
|
||||
* 证件类型名称 必填:是
|
||||
*/
|
||||
@SalaryTableColumn(text = "证件类型", width = "10%", column = "zzlx")
|
||||
@ExcelHead(title = "证件类型", dataIndex = "zzlx")
|
||||
private String zzlx;
|
||||
|
||||
/**
|
||||
* 证件号码 必填:是
|
||||
*/
|
||||
@SalaryTableColumn(text = "证件号码", width = "10%", column = "zzhm")
|
||||
@ExcelHead(title = "证件号码", dataIndex = "zzhm")
|
||||
private String zzhm;
|
||||
|
||||
/**
|
||||
* 收入额 必填:是
|
||||
*/
|
||||
@SalaryTableColumn(text = "收入额", width = "10%", column = "sre")
|
||||
@ExcelHead(title = "收入额", dataIndex = "sre")
|
||||
private String sre;
|
||||
|
||||
/**
|
||||
* 累计收入(不含本次) 必填:是
|
||||
*/
|
||||
@SalaryTableColumn(text = "累计收入(不含本次)", width = "10%", column = "ljsre")
|
||||
@ExcelHead(title = "累计收入(不含本次)", dataIndex = "ljsre")
|
||||
private String ljsre;
|
||||
|
||||
/**
|
||||
* 免税收入 必填:是
|
||||
*/
|
||||
@SalaryTableColumn(text = "免税收入", width = "10%", column = "mssd")
|
||||
@ExcelHead(title = "免税收入", dataIndex = "mssd")
|
||||
private String mssd;
|
||||
/**
|
||||
* 财产原值 必填:是
|
||||
*/
|
||||
private String ccyz;
|
||||
/**
|
||||
* 允许扣除的税费 必填:是
|
||||
*/
|
||||
private String yxkcsf;
|
||||
/**
|
||||
* 投资抵扣 必填:是
|
||||
*/
|
||||
private String tzdk;
|
||||
/**
|
||||
* 其他 必填:是
|
||||
*/
|
||||
private String qt;
|
||||
/**
|
||||
* 备注 必填:是
|
||||
*/
|
||||
private String bz;
|
||||
/**
|
||||
* 实际工作年限 必填:是
|
||||
*/
|
||||
private String sjgznxs;
|
||||
/**
|
||||
* 减除费用 必填:是
|
||||
*/
|
||||
private String jcfy;
|
||||
/**
|
||||
* 准予扣除的捐赠额 必填:是
|
||||
*/
|
||||
@SalaryTableColumn(text = "准予扣除的捐赠额", width = "10%", column = "zykcjze")
|
||||
@ExcelHead(title = "准予扣除的捐赠额", dataIndex = "zykcjze")
|
||||
private String zykcjze;
|
||||
/**
|
||||
* 税前扣除项目合计 必填:是
|
||||
*/
|
||||
private String sqkcxmhj;
|
||||
/**
|
||||
* 应纳税额所得额 必填:是
|
||||
*/
|
||||
@SalaryTableColumn(text = "应纳税额所得额", width = "10%", column = "ynssde")
|
||||
@ExcelHead(title = "应纳税额所得额", dataIndex = "ynssde")
|
||||
private String ynssde;
|
||||
/**
|
||||
* 应纳税额 必填:是
|
||||
*/
|
||||
@SalaryTableColumn(text = "应纳税额", width = "10%", column = "ynse")
|
||||
@ExcelHead(title = "应纳税额", dataIndex = "ynse")
|
||||
private String ynse;
|
||||
/**
|
||||
* 减免税额 必填:是
|
||||
*/
|
||||
private String jmse;
|
||||
/**
|
||||
* 应扣缴税额 必填:是
|
||||
*/
|
||||
@SalaryTableColumn(text = "应扣缴税额", width = "10%", column = "yingkjse")
|
||||
@ExcelHead(title = "应扣缴税额", dataIndex = "yingkjse")
|
||||
private String yingkjse;
|
||||
/**
|
||||
* 已扣缴税额 必填:是 无需填写该值,按0处理
|
||||
*/
|
||||
@SalaryTableColumn(text = "已扣缴税额", width = "10%", column = "ykjse")
|
||||
@ExcelHead(title = "已扣缴税额", dataIndex = "ykjse")
|
||||
private String ykjse;
|
||||
/**
|
||||
* 税率 必填:是
|
||||
*/
|
||||
@SalaryTableColumn(text = "税率", width = "10%", column = "sl")
|
||||
@ExcelHead(title = "税率", dataIndex = "sl")
|
||||
private String sl;
|
||||
/**
|
||||
* 速算扣除数 必填:是
|
||||
*/
|
||||
@SalaryTableColumn(text = "速算扣除数", width = "10%", column = "sskcs")
|
||||
@ExcelHead(title = "速算扣除数", dataIndex = "sskcs")
|
||||
private String sskcs;
|
||||
/**
|
||||
* 代报方式 必填:是
|
||||
*/
|
||||
private String sbfs;
|
||||
/**
|
||||
* 应补退税额 必填:是
|
||||
*/
|
||||
@SalaryTableColumn(text = "应补退税额", width = "10%", column = "ybtse")
|
||||
@ExcelHead(title = "应补退税额", dataIndex = "ybtse")
|
||||
private String ybtse;
|
||||
/**
|
||||
* 非居民所得项目名字 必填:是非居民所得薪金类别-无住所个人正常工资薪金、全年一次性奖金收入
|
||||
*/
|
||||
private String sdxm;
|
||||
/**
|
||||
* 所得期间起 必填:是 YYYY-MM
|
||||
*/
|
||||
private String sdqjq;
|
||||
/**
|
||||
* 所得期间止 必填:是 YYYY-MM
|
||||
*/
|
||||
private String sdqjz;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 人员申报失败列表 必填:是 参考人员代报结果对象
|
||||
*/
|
||||
private List<rydbjgdx> rysbsblb;
|
||||
|
||||
/**
|
||||
* 4.4.1.3.1.1人员代报结果对象
|
||||
*/
|
||||
|
|
@ -176,6 +176,19 @@ public interface EmployeeDeclareService{
|
|||
*/
|
||||
void getDeclareFeedback(EmployeeDeclareParam param, EmployeeDeclareRateDTO employeeDeclareRate);
|
||||
|
||||
/**
|
||||
* 作废人员
|
||||
* @param param
|
||||
*/
|
||||
String invalid(EmployeeInvalidParam param);
|
||||
|
||||
/**
|
||||
* 关键信息变更
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
String informationChange(EmployeeInformationChangeParam param);
|
||||
|
||||
/**
|
||||
* 同步任职受雇日期为入职日期
|
||||
*
|
||||
|
|
@ -184,4 +197,5 @@ public interface EmployeeDeclareService{
|
|||
String syncEmploymentDate(EmployeeDeclareSyncStartDateParam param);
|
||||
|
||||
void batchInsert(List<EmployeeDeclarePO> insertList);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationRateDTO;
|
|||
import com.engine.salary.entity.taxdeclaration.param.DeclareTaxResultFeedbackQueryParam;
|
||||
import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationListQueryParam;
|
||||
import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationSaveParam;
|
||||
import com.engine.salary.entity.taxdeclaration.param.TaxDeclareRecordParam;
|
||||
import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationPO;
|
||||
import com.engine.salary.entity.taxdeclaration.po.TaxDeclareRecordPO;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
|
|
@ -84,9 +85,8 @@ public interface TaxDeclareRecordService {
|
|||
/**
|
||||
* 税局端申报明细查询
|
||||
*
|
||||
* @param id
|
||||
*/
|
||||
String queryCompanyIncomes(Long id);
|
||||
String queryCompanyIncomes(TaxDeclareRecordParam taxDeclareRecordParam);
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -131,14 +131,14 @@ public interface TaxDeclareRecordService {
|
|||
*
|
||||
* @param id
|
||||
*/
|
||||
void declare(Long id);
|
||||
void declare(Long id, Integer reportType);
|
||||
|
||||
/**
|
||||
* 个税申报获取反馈
|
||||
*
|
||||
* @param id
|
||||
*/
|
||||
void getDeclareFeedback(Long id, TaxDeclarationRateDTO taxDeclarationRate);
|
||||
void getDeclareFeedback(Long id, Integer reportType, TaxDeclarationRateDTO taxDeclarationRate);
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -156,21 +156,21 @@ public interface TaxDeclareRecordService {
|
|||
*
|
||||
* @param id
|
||||
*/
|
||||
void cancelDeclare(Long id);
|
||||
void cancelDeclare(Long id, Integer reportType);
|
||||
|
||||
/**
|
||||
* 获取作废反馈
|
||||
*
|
||||
* @param id
|
||||
*/
|
||||
void getCancelFeedback(Long id, TaxDeclarationRateDTO taxDeclarationRate);
|
||||
void getCancelFeedback(Long id, Integer reportType, TaxDeclarationRateDTO taxDeclarationRate);
|
||||
|
||||
/**
|
||||
* 更正申报
|
||||
*
|
||||
* @param id
|
||||
*/
|
||||
void updateDeclare(Long id);
|
||||
void updateDeclare(Long id, Integer reportType);
|
||||
|
||||
/**
|
||||
* 撤销申报
|
||||
|
|
@ -186,8 +186,6 @@ public interface TaxDeclareRecordService {
|
|||
*/
|
||||
String queryDeclareStatus(Long id);
|
||||
|
||||
|
||||
|
||||
void updateById(TaxDeclareRecordPO taxDeclareRecord);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,40 @@
|
|||
package com.engine.salary.service;
|
||||
|
||||
import com.engine.salary.entity.taxdeclaration.po.TaxDeclareStatusPO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 个税申报表状态
|
||||
* <p>Copyright: Copyright (c) 2023</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
public interface TaxDeclareStatusService {
|
||||
|
||||
List<TaxDeclareStatusPO> getTaxDeclareStatusByTaxDeclareRecordId(Long taxDeclareRecordId);
|
||||
|
||||
|
||||
/**
|
||||
* 获取申报记录状态
|
||||
* @param taxDeclareRecordId
|
||||
* @param reportType
|
||||
* @return
|
||||
*/
|
||||
TaxDeclareStatusPO getTaxDeclareStatus(Long taxDeclareRecordId, Integer reportType);
|
||||
|
||||
/**
|
||||
* 更新主记录,返回申报记录状态列表
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
List<TaxDeclareStatusPO> updateRecord(Long id);
|
||||
|
||||
/**
|
||||
* 更新申报状态,同时更新主记录
|
||||
* @param declareStatus
|
||||
*/
|
||||
void updateTaxDeclareStatus(TaxDeclareStatusPO declareStatus,boolean updateRecord);
|
||||
}
|
||||
|
|
@ -26,13 +26,12 @@ import com.engine.salary.exception.SalaryRunTimeException;
|
|||
import com.engine.salary.mapper.taxpayment.TaxPaymentRequestMapper;
|
||||
import com.engine.salary.service.*;
|
||||
import com.engine.salary.util.*;
|
||||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
import com.engine.salary.util.db.IdGenerator;
|
||||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
|
@ -52,6 +51,9 @@ public abstract class AbstractTaxPaymentService extends Service implements TaxPa
|
|||
return ServiceUtil.getService(TaxAgentTaxReturnServiceImpl.class, user);
|
||||
}
|
||||
|
||||
protected TaxDeclareStatusService getTaxDeclareStatusService(User user) {
|
||||
return ServiceUtil.getService(TaxDeclareStatusServiceImpl.class, user);
|
||||
}
|
||||
protected TaxAgentService getTaxAgentService(User user) {
|
||||
return ServiceUtil.getService(TaxAgentServiceImpl.class, user);
|
||||
}
|
||||
|
|
@ -142,7 +144,6 @@ public abstract class AbstractTaxPaymentService extends Service implements TaxPa
|
|||
return new TempWrapper(apiConfigPO, taxReturnPO, taxAgentPO, taxDeclareRecord);
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public String getRequestId(TaxPaymentQueryParam param) {
|
||||
TempWrapper tempWrapper = checkBeforeGetRequestIdResponse(param);
|
||||
QuerySpecialAmountResponse queryResponse = getRequestIdResponse(tempWrapper.taxReturnPO, tempWrapper.taxAgentPO.getName(),
|
||||
|
|
|
|||
|
|
@ -16,10 +16,7 @@ import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
|||
import com.engine.salary.enums.OperateTypeEnum;
|
||||
import com.engine.salary.enums.SalaryOnOffEnum;
|
||||
import com.engine.salary.enums.datacollection.UseEmployeeTypeEnum;
|
||||
import com.engine.salary.enums.employeedeclare.CardTypeEnum;
|
||||
import com.engine.salary.enums.employeedeclare.DeclareStatusEnum;
|
||||
import com.engine.salary.enums.employeedeclare.EmploymentStatusEnum;
|
||||
import com.engine.salary.enums.employeedeclare.EmploymentTypeEnum;
|
||||
import com.engine.salary.enums.employeedeclare.*;
|
||||
import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum;
|
||||
import com.engine.salary.enums.sicategory.DeleteTypeEnum;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
|
|
@ -101,14 +98,20 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee
|
|||
List<Object> row = Lists.newArrayList();
|
||||
row.add(employeeDeclare.getJobNum());
|
||||
row.add(employeeDeclare.getEmployeeName());
|
||||
row.add(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel());
|
||||
row.add(CardTypeEnum.getByValue(employeeDeclare.getCardType()).getDefaultLabel());
|
||||
row.add(employeeDeclare.getCardNum());
|
||||
row.add(employeeDeclare.getNationality());
|
||||
row.add(GenderEnum.getDefaultLabelByValue(employeeDeclare.getGender()).getDefaultLabel());
|
||||
row.add(employeeDeclare.getBirthplace());
|
||||
row.add(employeeDeclare.getBirthday());
|
||||
row.add(employmentStatusEnum == null ? "" : employmentStatusEnum.getDefaultLabel());
|
||||
row.add(employmentTypeEnum == null ? EmploymentTypeEnum.EMPLOYEE.getDefaultLabel() : employmentTypeEnum.getDefaultLabel());
|
||||
row.add(employeeDeclare.getEmploymentFirstYear());
|
||||
row.add(employeeDeclare.getMobile());
|
||||
row.add(employmentTypeEnum == null ? EmploymentTypeEnum.EMPLOYEE.getDefaultLabel() : employmentTypeEnum.getDefaultLabel());
|
||||
row.add(SalaryDateUtil.getFormatDate(employeeDeclare.getEmploymentDate()));
|
||||
row.add(SalaryDateUtil.getFormatDate(employeeDeclare.getDismissDate()));
|
||||
row.add(SalaryDateUtil.getFormatDate(employeeDeclare.getEntryDate()));
|
||||
row.add(SalaryDateUtil.getFormatDate(employeeDeclare.getDepartureDate()));
|
||||
row.add(employeeDeclare.getTaxReasons());
|
||||
row.add(Objects.equals(employeeDeclare.getDisability(), 1) ? yesI18 : noI18);
|
||||
row.add(employeeDeclare.getDisabilityCardNo());
|
||||
row.add(Objects.equals(employeeDeclare.getMartyrDependents(), 1) ? yesI18 : noI18);
|
||||
|
|
@ -211,7 +214,7 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee
|
|||
Sheet sheet = ExcelSupport.parseFile(fileInputStream, 0, EXCEL_TYPE_XLSX);
|
||||
// 表头
|
||||
List<String> headers = ExcelSupport.getSheetHeader(sheet, 0);
|
||||
|
||||
|
||||
// 检查表头
|
||||
String isCorrectHeader = checkHeader(headers, headerList);
|
||||
if (isCorrectHeader != null) {
|
||||
|
|
@ -235,7 +238,7 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee
|
|||
EmployeeDeclareExcelDTO employeeDeclareExcel = new EmployeeDeclareExcelDTO();
|
||||
for (String dataKey : headerList) {
|
||||
String dataValue = Util.null2String(map.get(dataKey));
|
||||
if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel( 0, "工号"))) {
|
||||
if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "工号"))) {
|
||||
if (StringUtils.equals(checkType, "jobNum") && StringUtils.isEmpty(dataValue)) {
|
||||
isError = true;
|
||||
Map<String, String> errorMessageMap = Maps.newHashMap();
|
||||
|
|
@ -253,30 +256,66 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee
|
|||
employeeDeclareExcel.setEmployeeName(dataValue);
|
||||
}
|
||||
} else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "证件类型"))) {
|
||||
employeeDeclareExcel.setCardType(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getValue().toString());
|
||||
if (StringUtils.isEmpty(dataValue)) {
|
||||
isError = true;
|
||||
Map<String, String> errorMessageMap = Maps.newHashMap();
|
||||
errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "证件类型不能为空"));
|
||||
errorData.add(errorMessageMap);
|
||||
} else {
|
||||
CardTypeEnum cardTypeEnum = CardTypeEnum.getByDefaultLabel(dataValue);
|
||||
if (cardTypeEnum == null) {
|
||||
isError = true;
|
||||
Map<String, String> errorMessageMap = Maps.newHashMap();
|
||||
errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "证件类型填写错误,只能填写居民身份证、外国护照"));
|
||||
errorData.add(errorMessageMap);
|
||||
} else {
|
||||
employeeDeclareExcel.setCardType(cardTypeEnum.getValue());
|
||||
}
|
||||
}
|
||||
} else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "证件号码"))) {
|
||||
if (StringUtils.isEmpty(dataValue)) {
|
||||
isError = true;
|
||||
Map<String, String> errorMessageMap = Maps.newHashMap();
|
||||
errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "证件号码不能为空"));
|
||||
errorData.add(errorMessageMap);
|
||||
} else if (!SalaryCardUtil.checkIdNum(dataValue)) {
|
||||
isError = true;
|
||||
Map<String, String> errorMessageMap = Maps.newHashMap();
|
||||
errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "证件号码格式不正确"));
|
||||
errorData.add(errorMessageMap);
|
||||
} else {
|
||||
// 身份证号全部转为大写
|
||||
employeeDeclareExcel.setCardNum(dataValue.toUpperCase());
|
||||
employeeDeclareExcel.setGender(SalaryCardUtil.judgeGender(dataValue).getValue().toString());
|
||||
employeeDeclareExcel.setBirthday(SalaryCardUtil.judgeBirthday(dataValue).toString());
|
||||
// employeeDeclareExcel.setGender(SalaryCardUtil.judgeGender(dataValue).getValue().toString());
|
||||
// employeeDeclareExcel.setBirthday(SalaryCardUtil.judgeBirthday(dataValue).toString());
|
||||
}
|
||||
} else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "人员状态"))) {
|
||||
} else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "国籍"))) {
|
||||
employeeDeclareExcel.setNationality(dataValue);
|
||||
} else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "性别"))) {
|
||||
Integer gender = GenderEnum.getValueByDefaultLabel(dataValue);
|
||||
if (gender == null) {
|
||||
isError = true;
|
||||
Map<String, String> errorMessageMap = Maps.newHashMap();
|
||||
errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "性别填写有误!"));
|
||||
errorData.add(errorMessageMap);
|
||||
} else {
|
||||
employeeDeclareExcel.setGender(gender);
|
||||
}
|
||||
} else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "出生地"))) {
|
||||
employeeDeclareExcel.setBirthplace(dataValue);
|
||||
} else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "出生日期"))) {
|
||||
if (StringUtils.isNotBlank(dataValue) && dataValue.length() >= 10) {
|
||||
dataValue = dataValue.substring(0, 10);
|
||||
}
|
||||
if (!SalaryDateUtil.checkDay(dataValue)) {
|
||||
isError = true;
|
||||
Map<String, String> errorMessageMap = Maps.newHashMap();
|
||||
errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "日期格式不正确"));
|
||||
errorData.add(errorMessageMap);
|
||||
} else {
|
||||
employeeDeclareExcel.setBirthday(SalaryDateUtil.dateStrToLocalDate(dataValue));
|
||||
}
|
||||
} else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "状态"))) {
|
||||
boolean legalDataValue = false;
|
||||
for (EmploymentStatusEnum employmentStatusEnum : EmploymentStatusEnum.values()) {
|
||||
if (StringUtils.equals(dataValue, employmentStatusEnum.getDefaultLabel())) {
|
||||
legalDataValue = true;
|
||||
employeeDeclareExcel.setEmploymentStatus(employmentStatusEnum.getValue().toString());
|
||||
employeeDeclareExcel.setEmploymentStatus(employmentStatusEnum.getValue());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -286,23 +325,6 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee
|
|||
errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "人员状态只能填写正常或非正常"));
|
||||
errorData.add(errorMessageMap);
|
||||
}
|
||||
} else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "任职受雇从业类型"))) {
|
||||
boolean legalDataValue = false;
|
||||
for (EmploymentTypeEnum employmentTypeEnum : EmploymentTypeEnum.values()) {
|
||||
if (StringUtils.equals(dataValue, employmentTypeEnum.getDefaultLabel())) {
|
||||
legalDataValue = true;
|
||||
employeeDeclareExcel.setEmploymentType(employmentTypeEnum.getValue().toString());
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!legalDataValue) {
|
||||
isError = true;
|
||||
Map<String, String> errorMessageMap = Maps.newHashMap();
|
||||
errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "任职受雇从业类型填写错误"));
|
||||
errorData.add(errorMessageMap);
|
||||
}
|
||||
} else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "入职年度就业情形"))) {
|
||||
employeeDeclareExcel.setEmploymentFirstYear(dataValue);
|
||||
} else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "手机号码"))) {
|
||||
if (StringUtils.isEmpty(dataValue)) {
|
||||
isError = true;
|
||||
|
|
@ -317,6 +339,21 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee
|
|||
} else {
|
||||
employeeDeclareExcel.setMobile(dataValue);
|
||||
}
|
||||
} else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "任职受雇从业类型"))) {
|
||||
boolean legalDataValue = false;
|
||||
for (EmploymentTypeEnum employmentTypeEnum : EmploymentTypeEnum.values()) {
|
||||
if (StringUtils.equals(dataValue, employmentTypeEnum.getDefaultLabel())) {
|
||||
legalDataValue = true;
|
||||
employeeDeclareExcel.setEmploymentType(employmentTypeEnum.getValue());
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!legalDataValue) {
|
||||
isError = true;
|
||||
Map<String, String> errorMessageMap = Maps.newHashMap();
|
||||
errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "任职受雇从业类型填写错误"));
|
||||
errorData.add(errorMessageMap);
|
||||
}
|
||||
} else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "任职受雇从业日期"))) {
|
||||
if (StringUtils.isEmpty(dataValue)) {
|
||||
if (!Objects.equals(employeeDeclareExcel.getEmploymentType(), EmploymentTypeEnum.OTHER.getValue().toString())) {
|
||||
|
|
@ -327,7 +364,7 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee
|
|||
}
|
||||
} else {
|
||||
if (StringUtils.isNotBlank(dataValue) && dataValue.length() >= 10) {
|
||||
dataValue = dataValue.substring(0,10);
|
||||
dataValue = dataValue.substring(0, 10);
|
||||
}
|
||||
if (!SalaryDateUtil.checkDay(dataValue)) {
|
||||
isError = true;
|
||||
|
|
@ -335,7 +372,7 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee
|
|||
errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "日期格式不正确"));
|
||||
errorData.add(errorMessageMap);
|
||||
} else {
|
||||
employeeDeclareExcel.setEmploymentDate(SalaryDateUtil.getFormatDate(SalaryDateUtil.dateStrToLocalDate(dataValue)));
|
||||
employeeDeclareExcel.setEmploymentDate(SalaryDateUtil.dateStrToLocalDate(dataValue));
|
||||
}
|
||||
}
|
||||
} else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "离职日期"))) {
|
||||
|
|
@ -348,7 +385,7 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee
|
|||
}
|
||||
} else {
|
||||
if (StringUtils.isNotBlank(dataValue) && dataValue.length() >= 10) {
|
||||
dataValue = dataValue.substring(0,10);
|
||||
dataValue = dataValue.substring(0, 10);
|
||||
}
|
||||
if (!SalaryDateUtil.checkDay(dataValue)) {
|
||||
isError = true;
|
||||
|
|
@ -356,9 +393,35 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee
|
|||
errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "日期格式不正确"));
|
||||
errorData.add(errorMessageMap);
|
||||
} else {
|
||||
employeeDeclareExcel.setDismissDate(SalaryDateUtil.getFormatDate(SalaryDateUtil.dateStrToLocalDate(dataValue)));
|
||||
employeeDeclareExcel.setDismissDate(SalaryDateUtil.dateStrToLocalDate(dataValue));
|
||||
}
|
||||
}
|
||||
} else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "首次入境时间"))) {
|
||||
if (StringUtils.isNotBlank(dataValue) && dataValue.length() >= 10) {
|
||||
dataValue = dataValue.substring(0, 10);
|
||||
}
|
||||
if (!SalaryDateUtil.checkDay(dataValue)) {
|
||||
isError = true;
|
||||
Map<String, String> errorMessageMap = Maps.newHashMap();
|
||||
errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "日期格式不正确"));
|
||||
errorData.add(errorMessageMap);
|
||||
} else {
|
||||
employeeDeclareExcel.setEntryDate(SalaryDateUtil.dateStrToLocalDate(dataValue));
|
||||
}
|
||||
} else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "预计离境时间"))) {
|
||||
if (StringUtils.isNotBlank(dataValue) && dataValue.length() >= 10) {
|
||||
dataValue = dataValue.substring(0, 10);
|
||||
}
|
||||
if (!SalaryDateUtil.checkDay(dataValue)) {
|
||||
isError = true;
|
||||
Map<String, String> errorMessageMap = Maps.newHashMap();
|
||||
errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "日期格式不正确"));
|
||||
errorData.add(errorMessageMap);
|
||||
} else {
|
||||
employeeDeclareExcel.setDepartureDate(SalaryDateUtil.dateStrToLocalDate(dataValue));
|
||||
}
|
||||
} else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "涉税事由"))) {
|
||||
employeeDeclareExcel.setTaxReasons(dataValue);
|
||||
} else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "是否残疾"))) {
|
||||
if (StringUtils.equals(dataValue, SalaryOnOffEnum.ON.getDefaultLabel())) {
|
||||
employeeDeclareExcel.setDisability(SalaryOnOffEnum.ON.getValue());
|
||||
|
|
@ -528,12 +591,12 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee
|
|||
}
|
||||
|
||||
|
||||
public static String[] getNullPropertyNames (Object source) {
|
||||
public static String[] getNullPropertyNames(Object source) {
|
||||
final BeanWrapper src = new BeanWrapperImpl(source);
|
||||
PropertyDescriptor[] pds = src.getPropertyDescriptors();
|
||||
|
||||
Set<String> emptyNames = new HashSet<>();
|
||||
for(PropertyDescriptor pd : pds) {
|
||||
for (PropertyDescriptor pd : pds) {
|
||||
Object srcValue = src.getPropertyValue(pd.getName());
|
||||
// 此处判断可根据需求修改
|
||||
if (srcValue == null) {
|
||||
|
|
@ -545,7 +608,6 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee
|
|||
}
|
||||
|
||||
|
||||
|
||||
private EmployeeDeclarePO buildEmployeeDeclare(DataCollectionEmployee extEmployee, DataCollectionEmployee simpleEmployee,
|
||||
EmployeeDeclareExcelDTO employeeDeclareExcel, Long taxAgentId,
|
||||
Date taxCycle, Date now) {
|
||||
|
|
@ -1086,12 +1148,18 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee
|
|||
headers.add(SalaryI18nUtil.getI18nLabel(111111, "姓名"));
|
||||
headers.add(SalaryI18nUtil.getI18nLabel(111111, "证件类型"));
|
||||
headers.add(SalaryI18nUtil.getI18nLabel(111111, "证件号码"));
|
||||
headers.add(SalaryI18nUtil.getI18nLabel(111111, "人员状态"));
|
||||
headers.add(SalaryI18nUtil.getI18nLabel(111111, "任职受雇从业类型"));
|
||||
headers.add(SalaryI18nUtil.getI18nLabel(111111, "入职年度就业情形"));
|
||||
headers.add(SalaryI18nUtil.getI18nLabel(111111, "国籍"));
|
||||
headers.add(SalaryI18nUtil.getI18nLabel(111111, "性别"));
|
||||
headers.add(SalaryI18nUtil.getI18nLabel(111111, "出生地"));
|
||||
headers.add(SalaryI18nUtil.getI18nLabel(111111, "出生日期"));
|
||||
headers.add(SalaryI18nUtil.getI18nLabel(111111, "状态"));
|
||||
headers.add(SalaryI18nUtil.getI18nLabel(111111, "手机号码"));
|
||||
headers.add(SalaryI18nUtil.getI18nLabel(111111, "任职受雇从业类型"));
|
||||
headers.add(SalaryI18nUtil.getI18nLabel(111111, "任职受雇从业日期"));
|
||||
headers.add(SalaryI18nUtil.getI18nLabel(111111, "离职日期"));
|
||||
headers.add(SalaryI18nUtil.getI18nLabel(111111, "首次入境时间"));
|
||||
headers.add(SalaryI18nUtil.getI18nLabel(111111, "预计离境时间"));
|
||||
headers.add(SalaryI18nUtil.getI18nLabel(111111, "涉税事由"));
|
||||
headers.add(SalaryI18nUtil.getI18nLabel(111111, "是否残疾"));
|
||||
headers.add(SalaryI18nUtil.getI18nLabel(111111, "残疾证号"));
|
||||
headers.add(SalaryI18nUtil.getI18nLabel(111111, "是否烈属"));
|
||||
|
|
|
|||
|
|
@ -42,13 +42,15 @@ import com.engine.salary.enums.taxagent.TaxAgentTaxReturnStatusEnum;
|
|||
import com.engine.salary.enums.taxdeclaration.EnumDeclareApiBusinessType;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.mapper.employeedeclare.EmployeeDeclareMapper;
|
||||
import com.engine.salary.remote.tax.client.EmployeeClient;
|
||||
import com.engine.salary.remote.tax.request.employee.BatchInvalidSubmissionRequest;
|
||||
import com.engine.salary.remote.tax.request.employee.InformationChangeRequest;
|
||||
import com.engine.salary.service.*;
|
||||
import com.engine.salary.util.*;
|
||||
import com.engine.salary.util.db.IdGenerator;
|
||||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import com.engine.salary.util.page.SalaryPageUtil;
|
||||
import com.engine.salary.util.valid.SalaryCardUtil;
|
||||
import com.engine.salary.util.valid.ValidUtil;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.Lists;
|
||||
|
|
@ -56,7 +58,6 @@ import lombok.extern.slf4j.Slf4j;
|
|||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.User;
|
||||
|
||||
|
|
@ -195,16 +196,21 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla
|
|||
employeeDeclare.setTaxCycle(saveParam.getTaxCycle());
|
||||
employeeDeclare.setEmployeeName(saveParam.getEmployeeName());
|
||||
employeeDeclare.setJobNum(saveParam.getJobNum());
|
||||
employeeDeclare.setCardType(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getValue());
|
||||
employeeDeclare.setNationality(saveParam.getNationality());
|
||||
employeeDeclare.setCardType(saveParam.getCardType().getValue());
|
||||
employeeDeclare.setCardNum(saveParam.getCardNum().toUpperCase());
|
||||
employeeDeclare.setGender(SalaryCardUtil.judgeGender(saveParam.getCardNum()).getValue());
|
||||
employeeDeclare.setBirthday(SalaryDateUtil.localDateToDate(SalaryCardUtil.judgeBirthday(saveParam.getCardNum())));
|
||||
employeeDeclare.setGender(saveParam.getGender().getValue());
|
||||
employeeDeclare.setBirthday(SalaryDateUtil.localDateToDate(saveParam.getBirthday()));
|
||||
employeeDeclare.setBirthplace(saveParam.getBirthplace());
|
||||
employeeDeclare.setTaxReasons(saveParam.getTaxReasons());
|
||||
employeeDeclare.setEmploymentStatus(saveParam.getEmploymentStatus().getValue());
|
||||
employeeDeclare.setMobile(saveParam.getMobile());
|
||||
employeeDeclare.setEmploymentType(saveParam.getEmploymentType().getValue());
|
||||
employeeDeclare.setEmploymentFirstYear("");
|
||||
employeeDeclare.setEmploymentDate(SalaryDateUtil.localDateToDate(saveParam.getEmploymentDate()));
|
||||
employeeDeclare.setDismissDate(SalaryDateUtil.localDateToDate(saveParam.getDismissDate()));
|
||||
employeeDeclare.setEntryDate(SalaryDateUtil.localDateToDate(saveParam.getEntryDate()));
|
||||
employeeDeclare.setDepartureDate(SalaryDateUtil.localDateToDate(saveParam.getDepartureDate()));
|
||||
employeeDeclare.setDisability(saveParam.getDisability().getValue());
|
||||
employeeDeclare.setDisabilityCardNo(saveParam.getDisabilityCardNo());
|
||||
employeeDeclare.setLonelyOld(saveParam.getLonelyOld().getValue());
|
||||
|
|
@ -387,7 +393,7 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla
|
|||
}
|
||||
boolean declareSuccess = employeeDeclares.stream().anyMatch(e -> Objects.equals(e.getSuccessfullyDeclared(), 1));
|
||||
if (declareSuccess) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156467, "报送成功过的人员不允许删除"));
|
||||
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156467, "报送成功过的人员不允许删除"));
|
||||
}
|
||||
getEmployeeDeclareMapper().deleteByIds(ids, new Date());
|
||||
// 记录日志
|
||||
|
|
@ -445,7 +451,6 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla
|
|||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void refresh(EmployeeDeclareRefreshParam refreshParam, Long employeeId) {
|
||||
// 查询本月已有的需要报送的人员
|
||||
List<EmployeeDeclarePO> employeeDeclares = listByTaxCycleAndTaxAgentId(refreshParam.getTaxCycle(), refreshParam.getTaxAgentId());
|
||||
|
|
@ -510,20 +515,15 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla
|
|||
.setEmployeeDeclares(employeeDeclares)
|
||||
.setPreTaxCycleEmployeeDeclare(preTaxCycleEmployeeDeclares)
|
||||
.setSalaryArchives(salaryArchivePOS)
|
||||
// .setEmployeeInfos(employeeInfos)
|
||||
.setHrmEmployeeComInfos(employeeInfos);
|
||||
// .setSimpleUserInfos(newSimpleUserInfos)
|
||||
// .setExtEmployees(newExtEmployees)
|
||||
EmployeeDeclareRefresh.Result result = EmployeeDeclareRefresh.refresh(dto, employeeId);
|
||||
// 保存新增的人员
|
||||
if (CollectionUtils.isNotEmpty(result.getNewEmployeeDeclares())) {
|
||||
result.getNewEmployeeDeclares().forEach(getEmployeeDeclareMapper()::insertIgnoreNull);
|
||||
// getEmployeeDeclareMapper().batchInsert((result.getNewEmployeeDeclares()));
|
||||
}
|
||||
// 更新已有人员
|
||||
if (CollectionUtils.isNotEmpty(result.getEmployeeDeclares())) {
|
||||
result.getEmployeeDeclares().forEach(getEmployeeDeclareMapper()::updateIgnoreNull);
|
||||
// updateBatchById(result.getEmployeeDeclares());
|
||||
}
|
||||
|
||||
// 记录日志
|
||||
|
|
@ -721,6 +721,45 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String invalid(EmployeeInvalidParam param) {
|
||||
List<EmployeeDeclarePO> employeeDeclarePOS = listByIds(Collections.singletonList(param.getId()));
|
||||
if (CollectionUtils.isEmpty(employeeDeclarePOS)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "未找到该人员"));
|
||||
}
|
||||
|
||||
BatchInvalidSubmissionRequest request = new BatchInvalidSubmissionRequest();
|
||||
List<BatchInvalidSubmissionRequest.RY> rys = employeeDeclarePOS.stream().map(po -> {
|
||||
BatchInvalidSubmissionRequest.RY ry = new BatchInvalidSubmissionRequest.RY();
|
||||
ry.setXm(po.getEmployeeName());
|
||||
ry.setZzhm(po.getCardNum());
|
||||
ry.setZzlx(CardTypeEnum.getByValue(po.getCardType()).getDefaultLabel());
|
||||
return ry;
|
||||
}).collect(Collectors.toList());
|
||||
request.setRylb(rys);
|
||||
|
||||
EmployeeClient employeeClient = new EmployeeClient(employeeDeclarePOS.get(0).getTaxAgentId());
|
||||
String s = employeeClient.batchInvalidSubmission(request);
|
||||
return s;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String informationChange(EmployeeInformationChangeParam param) {
|
||||
EmployeeDeclarePO employeeDeclarePO = getById(param.getId());
|
||||
if (employeeDeclarePO == null) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "未找到该人员"));
|
||||
}
|
||||
|
||||
InformationChangeRequest request =new InformationChangeRequest();
|
||||
request.setXm(param.getName());
|
||||
request.setZzlx(param.getCardType().getDefaultLabel());
|
||||
request.setZzhm(param.getCardNum());
|
||||
EmployeeClient employeeClient = new EmployeeClient(employeeDeclarePO.getTaxAgentId());
|
||||
String s = employeeClient.informationChange(request);
|
||||
return s;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String syncEmploymentDate(EmployeeDeclareSyncStartDateParam param) {
|
||||
List<DataCollectionEmployee> employeeList = getSalaryEmployeeService(user).listAll(UseEmployeeTypeEnum.ALL);
|
||||
|
|
|
|||
|
|
@ -314,7 +314,6 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
|
|||
* @param currentEmployeeId
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void handleStayDelData(long currentEmployeeId) {
|
||||
log.info("福利档案中待减员数据自动处理逻辑开始:");
|
||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM");
|
||||
|
|
@ -351,7 +350,6 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
|
|||
* 福利档案中增量数据处理
|
||||
* @param currentEmployeeId
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void handleChangeData(long currentEmployeeId) {
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -135,7 +135,6 @@
|
|||
// }
|
||||
//
|
||||
// @Override
|
||||
// @Transactional(rollbackFor = Exception.class)
|
||||
// public void calcByEmployeeIds(Long salaryAcctRecordId, Collection<Long> salaryAcctEmployeeIds, DataCollectionEmployee simpleEmployee) throws Exception {
|
||||
// SalaryAcctRateDTO salaryAcctRate = new SalaryAcctRateDTO("" + salaryAcctRecordId);
|
||||
// try {
|
||||
|
|
|
|||
|
|
@ -403,7 +403,6 @@ public class SalaryArchiveExcelServiceImpl extends Service implements SalaryArch
|
|||
// * 导入薪资档案
|
||||
// */
|
||||
// @BatchImportHandler("importSalaryArchive")
|
||||
// @Transactional(rollbackFor = Exception.class)
|
||||
// public void importSalaryArchive() {
|
||||
// BatchDocumentMessage message = BatchImportContext.getBatchDocumentMessage();
|
||||
// log.info("【薪资档案】接收到上传的数据:{}", String.format("batchTaskId=%s, fileName=%s", message.getBatchTaskId(), message.getBatchFile().getName()));
|
||||
|
|
|
|||
|
|
@ -253,7 +253,6 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe
|
|||
*
|
||||
* @param currentEmployeeId
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void handleSuspendData(Long currentEmployeeId) {
|
||||
List<String> personnelStatuss = new ArrayList<String>() {{
|
||||
add("4");
|
||||
|
|
|
|||
|
|
@ -28,13 +28,12 @@ import com.engine.salary.service.TaxDeclarationApiFlowWarnService;
|
|||
import com.engine.salary.util.SalaryAssert;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import com.engine.salary.util.db.IdGenerator;
|
||||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import com.engine.salary.util.page.SalaryPageUtil;
|
||||
import com.engine.salary.util.db.IdGenerator;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import weaver.common.MessageUtil;
|
||||
import weaver.email.EmailWorkRunnable;
|
||||
import weaver.general.BaseBean;
|
||||
|
|
@ -103,7 +102,6 @@ public class TaxDeclarationApiFlowWarnServiceImpl extends Service implements Tax
|
|||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteReceiver(Long id) {
|
||||
TaxDeclarationApiFlowWarnReceiverPO receiverPO = getWarnReceiverPOById(id);
|
||||
SalaryAssert.notNull(receiverPO, "该提醒对象不存在,请刷新页面后重试");
|
||||
|
|
|
|||
|
|
@ -20,10 +20,7 @@ import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationValueListDTO;
|
|||
import com.engine.salary.entity.taxdeclaration.param.ContrastQueryParam;
|
||||
import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationValueListQueryParam;
|
||||
import com.engine.salary.entity.taxdeclaration.param.TaxDeclareRecordDetailSaveParam;
|
||||
import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationPO;
|
||||
import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationValuePO;
|
||||
import com.engine.salary.entity.taxdeclaration.po.TaxDeclareRecordPO;
|
||||
import com.engine.salary.entity.taxdeclaration.po.TaxReportColumnPO;
|
||||
import com.engine.salary.entity.taxdeclaration.po.*;
|
||||
import com.engine.salary.enums.OperateTypeEnum;
|
||||
import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum;
|
||||
import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum;
|
||||
|
|
@ -34,7 +31,7 @@ import com.engine.salary.exception.SalaryRunTimeException;
|
|||
import com.engine.salary.mapper.taxdeclaration.TaxDeclarationValueMapper;
|
||||
import com.engine.salary.mapper.taxdeclaration.TaxDeclareRecordMapper;
|
||||
import com.engine.salary.remote.tax.client.DeclareClient;
|
||||
import com.engine.salary.remote.tax.response.employee.GetDeclareTaxResultFeedbackResponse;
|
||||
import com.engine.salary.remote.tax.response.declare.GetDeclareTaxResultFeedbackResponse;
|
||||
import com.engine.salary.service.*;
|
||||
import com.engine.salary.util.*;
|
||||
import com.engine.salary.util.db.IdGenerator;
|
||||
|
|
@ -78,6 +75,11 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar
|
|||
return MapperProxyFactory.getProxy(TaxDeclareRecordMapper.class);
|
||||
}
|
||||
|
||||
private TaxDeclareStatusService getTaxDeclareStatusService(User user) {
|
||||
return ServiceUtil.getService(TaxDeclareStatusServiceImpl.class, user);
|
||||
}
|
||||
|
||||
|
||||
private SalaryEmployeeService getSalaryEmployeeService(User user) {
|
||||
return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user);
|
||||
}
|
||||
|
|
@ -355,10 +357,12 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar
|
|||
throw new SalaryRunTimeException("申报记录不存在!");
|
||||
}
|
||||
|
||||
Integer reportType = IncomeCategoryEnum.parseByValue(taxDeclaration.getIncomeCategory()).getReportType().getValue();
|
||||
TaxDeclareStatusPO taxDeclareStatus = getTaxDeclareStatusService(user).getTaxDeclareStatus(taxDeclareRecordPO.getId(), reportType);
|
||||
|
||||
//线上数据
|
||||
DeclareClient declareClient = new DeclareClient(taxDeclareRecordPO.getTaxAgentId());
|
||||
GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse = declareClient.getDeclareTaxResultFeedback(taxDeclareRecordPO.getDeclareRequestId());
|
||||
GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse = declareClient.getDeclareTaxResultFeedback(taxDeclareStatus.getDeclareRequestId());
|
||||
|
||||
Map<String, List<List<Object>>> onlineDataMap = new HashMap<>();
|
||||
List<TaxDeclarationPO> list = getTaxDeclarationService(user).listByTaxDeclareRecordId(taxDeclareRecordPO.getId());
|
||||
|
|
|
|||
|
|
@ -2,12 +2,12 @@ package com.engine.salary.service.impl;
|
|||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.hrmelog.entity.dto.LoggerContext;
|
||||
import com.engine.salary.common.LocalDateRange;
|
||||
import com.engine.salary.common.YearMonthRange;
|
||||
import com.engine.salary.config.SalaryElogConfig;
|
||||
import com.engine.salary.constant.SalaryDefaultTenantConstant;
|
||||
import com.engine.salary.constant.SzyhApiConstant;
|
||||
import com.engine.hrmelog.entity.dto.LoggerContext;
|
||||
import com.engine.salary.entity.datacollection.AddUpSituation;
|
||||
import com.engine.salary.entity.employeedeclare.bo.EmployeeDeclareRequest;
|
||||
import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO;
|
||||
|
|
@ -27,10 +27,7 @@ import com.engine.salary.entity.taxapiflow.bo.TaxApiFlowBO;
|
|||
import com.engine.salary.entity.taxapiflow.po.TaxDeclarationApiFlowRecordPO;
|
||||
import com.engine.salary.entity.taxdeclaration.bo.*;
|
||||
import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationRateDTO;
|
||||
import com.engine.salary.entity.taxdeclaration.param.AbnormalEmployeeListQueryParam;
|
||||
import com.engine.salary.entity.taxdeclaration.param.DeclareTaxResultFeedbackQueryParam;
|
||||
import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationListQueryParam;
|
||||
import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationSaveParam;
|
||||
import com.engine.salary.entity.taxdeclaration.param.*;
|
||||
import com.engine.salary.entity.taxdeclaration.po.*;
|
||||
import com.engine.salary.entity.taxdeclaration.response.CancelDeclareFeedbackResponse;
|
||||
import com.engine.salary.entity.taxdeclaration.response.DeclareTaxFeedbackResponse;
|
||||
|
|
@ -39,14 +36,16 @@ import com.engine.salary.entity.taxdeclaration.response.UpdateDeclareResponse;
|
|||
import com.engine.salary.enums.OperateTypeEnum;
|
||||
import com.engine.salary.enums.employeedeclare.DeclareStatusEnum;
|
||||
import com.engine.salary.enums.salaryaccounting.SalaryAcctRecordStatusEnum;
|
||||
import com.engine.salary.enums.salarysob.DeclareReportTypeEnum;
|
||||
import com.engine.salary.enums.salarysob.IncomeCategoryEnum;
|
||||
import com.engine.salary.enums.sicategory.DeleteTypeEnum;
|
||||
import com.engine.salary.enums.taxagent.TaxAgentTaxReturnStatusEnum;
|
||||
import com.engine.salary.enums.taxdeclaration.*;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.mapper.taxdeclaration.TaxDeclareRecordMapper;
|
||||
import com.engine.salary.mapper.taxdeclaration.TaxDeclareStatusMapper;
|
||||
import com.engine.salary.remote.tax.client.DeclareClient;
|
||||
import com.engine.salary.remote.tax.response.employee.GetDeclareTaxResultFeedbackResponse;
|
||||
import com.engine.salary.remote.tax.response.declare.GetDeclareTaxResultFeedbackResponse;
|
||||
import com.engine.salary.service.*;
|
||||
import com.engine.salary.service.factory.TaxPaymentServiceFactory;
|
||||
import com.engine.salary.util.*;
|
||||
|
|
@ -55,6 +54,7 @@ import com.engine.salary.util.db.MapperProxyFactory;
|
|||
import com.engine.salary.util.excel.ExcelUtil;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import com.engine.salary.util.page.SalaryPageUtil;
|
||||
import com.engine.salary.util.valid.ValidUtil;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Sets;
|
||||
|
|
@ -70,6 +70,8 @@ import java.time.YearMonth;
|
|||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.engine.salary.enums.taxdeclaration.TaxDeclareStatusEnum.NOT_DECLARE;
|
||||
|
||||
/**
|
||||
* 个税申报
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
|
|
@ -86,6 +88,14 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe
|
|||
return MapperProxyFactory.getProxy(TaxDeclareRecordMapper.class);
|
||||
}
|
||||
|
||||
private TaxDeclareStatusMapper getTaxDeclareStatusMapper() {
|
||||
return MapperProxyFactory.getProxy(TaxDeclareStatusMapper.class);
|
||||
}
|
||||
|
||||
private TaxDeclareStatusService getTaxDeclareStatusService(User user) {
|
||||
return ServiceUtil.getService(TaxDeclareStatusServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private TaxDeclarationService getTaxDeclarationService(User user) {
|
||||
return ServiceUtil.getService(TaxDeclarationServiceImpl.class, user);
|
||||
}
|
||||
|
|
@ -272,12 +282,12 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe
|
|||
TaxDeclareRecordPO oldTaxDeclareRecord = taxDeclareRecordMap.get(taxCycleEntry.getKey() + "-" + taxAgentIdEntry.getKey());
|
||||
// 如果已经生成了个税申报表,并且个税申报表已经申报过了,就跳过
|
||||
if (oldTaxDeclareRecord != null) {
|
||||
if (!(Objects.equals(oldTaxDeclareRecord.getTaxDeclareType(), TaxDeclareTypeEnum.NORMAL_DECLARE.getValue()) && Objects.equals(oldTaxDeclareRecord.getTaxDeclareStatus(), TaxDeclareStatusEnum.NOT_DECLARE.getValue()))) {
|
||||
if (!(Objects.equals(oldTaxDeclareRecord.getTaxDeclareType(), TaxDeclareTypeEnum.NORMAL_DECLARE.getValue()) && Objects.equals(oldTaxDeclareRecord.getTaxDeclareStatus(), NOT_DECLARE.getValue()))) {
|
||||
continue;
|
||||
}
|
||||
needDeleteTaxDeclareRecordIds.add(oldTaxDeclareRecord.getId());
|
||||
}
|
||||
TaxDeclareRecordPO taxDeclareRecord = new TaxDeclareRecordPO().setId(IdGenerator.generate()).setTaxAgentId(taxAgentIdEntry.getKey()).setSalaryMonth(saveParam.getSalaryMonth()).setTaxCycle(taxCycleEntry.getKey()).setTaxDeclareType(TaxDeclareTypeEnum.NORMAL_DECLARE.getValue()).setTaxDeclareStatus(TaxDeclareStatusEnum.NOT_DECLARE.getValue()).setRemark(saveParam.getDescription()).setCreator((long) user.getUID()).setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY).setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()).setCreateTime(now).setUpdateTime(now);
|
||||
TaxDeclareRecordPO taxDeclareRecord = new TaxDeclareRecordPO().setId(IdGenerator.generate()).setTaxAgentId(taxAgentIdEntry.getKey()).setSalaryMonth(saveParam.getSalaryMonth()).setTaxCycle(taxCycleEntry.getKey()).setTaxDeclareType(TaxDeclareTypeEnum.NORMAL_DECLARE.getValue()).setTaxDeclareStatus(NOT_DECLARE.getValue()).setRemark(saveParam.getDescription()).setCreator((long) user.getUID()).setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY).setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()).setCreateTime(now).setUpdateTime(now);
|
||||
newTaxDeclareRecords.add(taxDeclareRecord);
|
||||
// 生成个税申报表
|
||||
TaxDeclarationResult taxDeclarationResult = generateReportPerRecord(taxDeclareRecord, taxAgentIdEntry.getValue());
|
||||
|
|
@ -319,20 +329,20 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe
|
|||
|
||||
//更新核算记录状态
|
||||
getSalaryAcctRecordService(user).updateStatusByIds(salaryAcctRecordIds, SalaryAcctRecordStatusEnum.DECLARED);
|
||||
// 记录日志
|
||||
for (TaxDeclareRecordPO taxDeclareRecord : newTaxDeclareRecords) {
|
||||
LoggerContext<TaxDeclarationPO> loggerContext = new LoggerContext<>();
|
||||
loggerContext.setUser(user);
|
||||
loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId()));
|
||||
loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "个税扣缴义务人「{0}」税款所属期「{1}」")
|
||||
.replace("{0}", taxAgentNameMap.getOrDefault(taxDeclareRecord.getTaxAgentId(), StringUtils.EMPTY))
|
||||
.replace("{1}", SalaryDateUtil.getFormatYearMonth(taxDeclareRecord.getTaxCycle())));
|
||||
loggerContext.setOperateType(OperateTypeEnum.ADD.getValue());
|
||||
loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "生成个税申报表"));
|
||||
loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "生成个税申报表"));
|
||||
loggerContext.setNewValues(taxDeclareRecord);
|
||||
SalaryElogConfig.taxDeclarationLoggerTemplate.write(loggerContext);
|
||||
}
|
||||
// 记录日志
|
||||
for (TaxDeclareRecordPO taxDeclareRecord : newTaxDeclareRecords) {
|
||||
LoggerContext<TaxDeclarationPO> loggerContext = new LoggerContext<>();
|
||||
loggerContext.setUser(user);
|
||||
loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId()));
|
||||
loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "个税扣缴义务人「{0}」税款所属期「{1}」")
|
||||
.replace("{0}", taxAgentNameMap.getOrDefault(taxDeclareRecord.getTaxAgentId(), StringUtils.EMPTY))
|
||||
.replace("{1}", SalaryDateUtil.getFormatYearMonth(taxDeclareRecord.getTaxCycle())));
|
||||
loggerContext.setOperateType(OperateTypeEnum.ADD.getValue());
|
||||
loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "生成个税申报表"));
|
||||
loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "生成个税申报表"));
|
||||
loggerContext.setNewValues(taxDeclareRecord);
|
||||
SalaryElogConfig.taxDeclarationLoggerTemplate.write(loggerContext);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -342,7 +352,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe
|
|||
if (Objects.isNull(taxDeclareRecord)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156495, "参数异常,个税申报记录不存在或已被删除"));
|
||||
}
|
||||
if (!Objects.equals(taxDeclareRecord.getTaxDeclareStatus(), TaxDeclareStatusEnum.NOT_DECLARE.getValue()) && !Objects.equals(taxDeclareRecord.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARE_FAIL.getValue())) {
|
||||
if (!Objects.equals(taxDeclareRecord.getTaxDeclareStatus(), NOT_DECLARE.getValue()) && !Objects.equals(taxDeclareRecord.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARE_FAIL.getValue())) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(182700, "对不起,只有未申报状态下可以刷新数据"));
|
||||
}
|
||||
// 查询税款所属期下的薪资核算人员
|
||||
|
|
@ -399,8 +409,8 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe
|
|||
.replace("{0}", taxAgent.getName())
|
||||
.replace("{1}", SalaryDateUtil.getFormatYearMonth(taxDeclareRecord.getTaxCycle())));
|
||||
loggerContext.setOperateType(OperateTypeEnum.ADD.getValue());
|
||||
loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel( 0, "刷新个税申报数据"));
|
||||
loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel( 0, "刷新个税申报数据"));
|
||||
loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "刷新个税申报数据"));
|
||||
loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "刷新个税申报数据"));
|
||||
SalaryElogConfig.taxDeclarationLoggerTemplate.write(loggerContext);
|
||||
}
|
||||
|
||||
|
|
@ -482,7 +492,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe
|
|||
for (Map.Entry<Date, List<SalaryAcctTaxAgentPO>> taxCycleEntry : taxCycleKeySalaryAcctTaxAgentMap.entrySet()) {
|
||||
Set<Long> archivedTaxAgentIds = SalaryEntityUtil.properties(taxCycleEntry.getValue(), SalaryAcctTaxAgentPO::getTaxAgentId);
|
||||
List<TaxDeclareRecordPO> taxDeclareRecords = listBySalaryMonthAndTaxAgentIds(saveParam.getSalaryMonth(), archivedTaxAgentIds);
|
||||
TaxDeclareRecordPO declareSuccessTaxDeclareRecord = taxDeclareRecords.stream().filter(taxDeclareRecordPO -> archivedTaxAgentIds.contains(taxDeclareRecordPO.getTaxAgentId()) && !(Objects.equals(taxDeclareRecordPO.getTaxDeclareStatus(), TaxDeclareStatusEnum.NOT_DECLARE.getValue()) || Objects.equals(taxDeclareRecordPO.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARE_FAIL.getValue()))).findAny().orElse(null);
|
||||
TaxDeclareRecordPO declareSuccessTaxDeclareRecord = taxDeclareRecords.stream().filter(taxDeclareRecordPO -> archivedTaxAgentIds.contains(taxDeclareRecordPO.getTaxAgentId()) && !(Objects.equals(taxDeclareRecordPO.getTaxDeclareStatus(), NOT_DECLARE.getValue()) || Objects.equals(taxDeclareRecordPO.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARE_FAIL.getValue()))).findAny().orElse(null);
|
||||
// 已经申报成功了的个税申报表的个税扣缴义务人不允许重新生成
|
||||
if (Objects.nonNull(declareSuccessTaxDeclareRecord)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(160522, "已开启智能算薪业务,个税扣缴义务人{0}的税款所属期{1}的个税申报表正在申报中或者已经申报成功,不可重复生成").replace("{0}", taxAgentNameMap.get(declareSuccessTaxDeclareRecord.getTaxAgentId())).replace("{1}", SalaryDateUtil.getFormatYearMonth(declareSuccessTaxDeclareRecord.getTaxCycle())));
|
||||
|
|
@ -583,7 +593,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe
|
|||
if (CollectionUtils.isEmpty(taxDeclareRecords)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(160524, "个税申报表不存在或已被删除"));
|
||||
}
|
||||
List<TaxDeclareRecordPO> cantDeleteTaxDeclareRecords = taxDeclareRecords.stream().filter(e -> !(Objects.equals(e.getTaxDeclareType(), TaxDeclareTypeEnum.NORMAL_DECLARE.getValue()) && Objects.equals(e.getTaxDeclareStatus(), TaxDeclareStatusEnum.NOT_DECLARE.getValue()))).collect(Collectors.toList());
|
||||
List<TaxDeclareRecordPO> cantDeleteTaxDeclareRecords = taxDeclareRecords.stream().filter(e -> !(Objects.equals(e.getTaxDeclareType(), TaxDeclareTypeEnum.NORMAL_DECLARE.getValue()) && Objects.equals(e.getTaxDeclareStatus(), NOT_DECLARE.getValue()))).collect(Collectors.toList());
|
||||
if (CollectionUtils.isNotEmpty(cantDeleteTaxDeclareRecords)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(177854, "个税申报表已经申报,无法删除"));
|
||||
}
|
||||
|
|
@ -609,35 +619,41 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe
|
|||
});
|
||||
|
||||
// 记录日志
|
||||
writeDeleteLog(taxDeclareRecords);
|
||||
writeDeleteLog(taxDeclareRecords);
|
||||
}
|
||||
|
||||
private void writeDeleteLog(List<TaxDeclareRecordPO> taxDeclareRecords) {
|
||||
// 记录日志
|
||||
List<TaxAgentPO> taxAgents = getTaxAgentService(user).listByIds(SalaryEntityUtil.properties(taxDeclareRecords, TaxDeclareRecordPO::getTaxAgentId));
|
||||
Map<Long, String> taxAgentNameMap = SalaryEntityUtil.convert2Map(taxAgents, TaxAgentPO::getId, TaxAgentPO::getName);
|
||||
for (TaxDeclareRecordPO taxDeclareRecord : taxDeclareRecords) {
|
||||
LoggerContext<TaxDeclarationPO> loggerContext = new LoggerContext<>();
|
||||
loggerContext.setUser(user);
|
||||
loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId()));
|
||||
loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "个税扣缴义务人「{0}」税款所属期「{1}」")
|
||||
.replace("{0}", taxAgentNameMap.getOrDefault(taxDeclareRecord.getTaxAgentId(), StringUtils.EMPTY))
|
||||
.replace("{1}", SalaryDateUtil.getFormatYearMonth(taxDeclareRecord.getTaxCycle())));
|
||||
loggerContext.setOperateType(OperateTypeEnum.DELETE.getValue());
|
||||
loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(156453, "删除个税申报表"));
|
||||
loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(156453, "删除个税申报表"));
|
||||
SalaryElogConfig.taxDeclarationLoggerTemplate.write(loggerContext);
|
||||
}
|
||||
}
|
||||
private void writeDeleteLog(List<TaxDeclareRecordPO> taxDeclareRecords) {
|
||||
// 记录日志
|
||||
List<TaxAgentPO> taxAgents = getTaxAgentService(user).listByIds(SalaryEntityUtil.properties(taxDeclareRecords, TaxDeclareRecordPO::getTaxAgentId));
|
||||
Map<Long, String> taxAgentNameMap = SalaryEntityUtil.convert2Map(taxAgents, TaxAgentPO::getId, TaxAgentPO::getName);
|
||||
for (TaxDeclareRecordPO taxDeclareRecord : taxDeclareRecords) {
|
||||
LoggerContext<TaxDeclarationPO> loggerContext = new LoggerContext<>();
|
||||
loggerContext.setUser(user);
|
||||
loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId()));
|
||||
loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "个税扣缴义务人「{0}」税款所属期「{1}」")
|
||||
.replace("{0}", taxAgentNameMap.getOrDefault(taxDeclareRecord.getTaxAgentId(), StringUtils.EMPTY))
|
||||
.replace("{1}", SalaryDateUtil.getFormatYearMonth(taxDeclareRecord.getTaxCycle())));
|
||||
loggerContext.setOperateType(OperateTypeEnum.DELETE.getValue());
|
||||
loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(156453, "删除个税申报表"));
|
||||
loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(156453, "删除个税申报表"));
|
||||
SalaryElogConfig.taxDeclarationLoggerTemplate.write(loggerContext);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void declare(Long id) {
|
||||
public void declare(Long id, Integer reportType) {
|
||||
|
||||
DeclareReportTypeEnum declareReportType = DeclareReportTypeEnum.parseByValue(reportType);
|
||||
|
||||
TaxDeclareStatusPO declareStatus = getTaxDeclareStatusService(user).getTaxDeclareStatus(id, reportType);
|
||||
|
||||
|
||||
TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id);
|
||||
TaxDeclareRecordPO taxDeclareRecord = taxDeclareRequest.getTaxDeclareRecord();
|
||||
if (StringUtils.isNotEmpty(taxDeclareRecord.getRequestId()) && Objects.equals(taxDeclareRecord.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARING.getValue())) {
|
||||
if (StringUtils.isNotEmpty(declareStatus.getRequestId()) && Objects.equals(declareStatus.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARING.getValue())) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(160526, "目前正处于申报中,请稍后片刻再点击「申报反馈」获取结果"));
|
||||
}
|
||||
if (StringUtils.isNotEmpty(taxDeclareRecord.getRequestId()) && Objects.equals(taxDeclareRecord.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARE_CANCELLING.getValue())) {
|
||||
if (StringUtils.isNotEmpty(declareStatus.getRequestId()) && Objects.equals(declareStatus.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARE_CANCELLING.getValue())) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(160527, "目前正处于作废申报中,请稍后片刻再点击「作废反馈」获取结果"));
|
||||
}
|
||||
|
||||
|
|
@ -674,9 +690,19 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe
|
|||
// 人员列表
|
||||
List<Map<String, Object>> employeeDeclareParam = EmployeeDeclareRequest.convert2RequestParam(employeeDeclares);
|
||||
requestParam.put("rylb", employeeDeclareParam);
|
||||
// 综合所得
|
||||
Map<String, Object> taxDeclarationParam = TaxDeclarationRequest.convert2RequestParam(taxReportColumns, taxDeclarations, taxDeclarationValues, employeeDeclares);
|
||||
requestParam.put("zhsd", taxDeclarationParam);
|
||||
|
||||
if (declareReportType == DeclareReportTypeEnum.COMPREHENSIVE_INCOME) {
|
||||
// 综合所得
|
||||
Map<String, Object> taxDeclarationParam = TaxDeclarationRequest.convert2RequestParam(taxReportColumns, taxDeclarations, taxDeclarationValues, employeeDeclares);
|
||||
requestParam.put("zhsd", taxDeclarationParam);
|
||||
}
|
||||
|
||||
if (declareReportType == DeclareReportTypeEnum.NONRESIDENT_INCOME) {
|
||||
//非居民所得代扣代缴 fjmsd
|
||||
Map<String, Object> fjmsdRequestParam = TaxDeclarationRequest.convert2fjmsdRequestParam(taxReportColumns, taxDeclarations, taxDeclarationValues, employeeDeclares);
|
||||
requestParam.put("fjmsd", fjmsdRequestParam);
|
||||
}
|
||||
|
||||
String reqJson = JsonUtil.toJsonString(requestParam);
|
||||
String url = apiConfig.getHost() + SzyhApiConstant.DECLARE_TAX;
|
||||
Map<String, String> params = new HashMap<>(1);
|
||||
|
|
@ -690,44 +716,49 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe
|
|||
if (!Objects.equals(declareTaxResponse.getHead().getCode(), SzyhApiConstant.SUCCESS_CODE)) {
|
||||
throw new SalaryRunTimeException(declareTaxResponse.getHead().getMsg());
|
||||
}
|
||||
// 更新个税申报记录
|
||||
taxDeclareRecord.setTaxDeclareStatus(TaxDeclareStatusEnum.DECLARING.getValue());
|
||||
taxDeclareRecord.setRequestId(declareTaxResponse.getBody().getRequestId());
|
||||
taxDeclareRecord.setUpdateTime(new Date());
|
||||
//清除之前的错误
|
||||
taxDeclareRecord.setTaxDeclareErrorMsg("");
|
||||
getTaxDeclareRecordMapper().updateIgnoreNull(taxDeclareRecord);
|
||||
|
||||
// 删除个税申报申报失败的数据
|
||||
getTaxDeclareFailService(user).deleteByTaxDeclareRecordIds(Collections.singleton(taxDeclareRecord.getId()));
|
||||
|
||||
//更新个税申报状态
|
||||
declareStatus.setTaxDeclareStatus(TaxDeclareStatusEnum.DECLARING.getValue());
|
||||
declareStatus.setRequestId(declareTaxResponse.getBody().getRequestId());
|
||||
declareStatus.setTaxDeclareErrorMsg("");
|
||||
getTaxDeclareStatusService(user).updateTaxDeclareStatus(declareStatus,true);
|
||||
|
||||
// 记录日志
|
||||
TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent();
|
||||
LoggerContext<TaxDeclarationPO> loggerContext = new LoggerContext<>();
|
||||
loggerContext.setUser(user);
|
||||
loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId()));
|
||||
loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(203562, "个税扣缴义务人「{0}」税款所属期「{1}」")
|
||||
.replace("{0}", taxAgent.getName())
|
||||
.replace("{1}", SalaryDateUtil.getFormatYearMonth(taxDeclareRecord.getTaxCycle())));
|
||||
loggerContext.setOperateType(OperateTypeEnum.ADD.getValue());
|
||||
loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(156454, "在线申报"));
|
||||
loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(156454, "在线申报"));
|
||||
SalaryElogConfig.taxDeclarationLoggerTemplate.write(loggerContext);
|
||||
TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent();
|
||||
LoggerContext<TaxDeclarationPO> loggerContext = new LoggerContext<>();
|
||||
loggerContext.setUser(user);
|
||||
loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId()));
|
||||
loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(203562, "个税扣缴义务人「{0}」税款所属期「{1}」")
|
||||
.replace("{0}", taxAgent.getName())
|
||||
.replace("{1}", SalaryDateUtil.getFormatYearMonth(taxDeclareRecord.getTaxCycle())));
|
||||
loggerContext.setOperateType(OperateTypeEnum.ADD.getValue());
|
||||
loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(156454, "在线申报"));
|
||||
loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(156454, "在线申报"));
|
||||
SalaryElogConfig.taxDeclarationLoggerTemplate.write(loggerContext);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void getDeclareFeedback(Long id, TaxDeclarationRateDTO taxDeclarationRate) {
|
||||
public void getDeclareFeedback(Long id, Integer reportType, TaxDeclarationRateDTO taxDeclarationRate) {
|
||||
TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id);
|
||||
TaxDeclareRecordPO taxDeclareRecord = taxDeclareRequest.getTaxDeclareRecord();
|
||||
if (StringUtils.isEmpty(taxDeclareRecord.getRequestId()) || !Objects.equals(taxDeclareRecord.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARING.getValue())) {
|
||||
|
||||
TaxDeclareStatusPO declareStatus = getTaxDeclareStatusService(user).getTaxDeclareStatus(id, reportType);
|
||||
|
||||
if (StringUtils.isEmpty(declareStatus.getRequestId()) || !Objects.equals(declareStatus.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARING.getValue())) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156496, "请先点击「在线申报」后再点击「申报反馈」获取申报结果"));
|
||||
}
|
||||
|
||||
TaxDeclarationApiConfigPO apiConfig = taxDeclareRequest.getTaxDeclarationApiConfig();
|
||||
String url = apiConfig.getHost() + SzyhApiConstant.DECLARE_TAX_FEEDBACK;
|
||||
ImmutableMap<String, String> requestParam = ImmutableMap.of("requestId", taxDeclareRecord.getRequestId(), "reportType", "1");
|
||||
ImmutableMap<String, String> requestParam = ImmutableMap.of("requestId", declareStatus.getRequestId(), "reportType", reportType + "");
|
||||
Map<String, String> header = SingnatureData.initHeader(Collections.emptyMap(), apiConfig.getAppKey(), apiConfig.getAppSecret());
|
||||
String res = HttpUtil.getRequest(url, header, requestParam);
|
||||
log.info("申报反馈返回数据: {}, taxDeclareRecord: {}", res, JsonUtil.toJsonString(taxDeclareRecord));
|
||||
log.info("申报反馈返回数据: {}, taxDeclareRecord: {},declareStatus :{}", res, JsonUtil.toJsonString(taxDeclareRecord), JsonUtil.toJsonString(declareStatus));
|
||||
DeclareTaxFeedbackResponse declareTaxFeedbackResponse = JsonUtil.parseObject(res, DeclareTaxFeedbackResponse.class);
|
||||
if (Objects.isNull(declareTaxFeedbackResponse) || Objects.isNull(declareTaxFeedbackResponse.getHead())) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156449, "服务异常"));
|
||||
|
|
@ -777,14 +808,13 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe
|
|||
}
|
||||
}
|
||||
}
|
||||
taxDeclareRecord.setTaxDeclareErrorMsg(String.join(",", errorMsg));
|
||||
declareStatus.setTaxDeclareErrorMsg(String.join(",", errorMsg));
|
||||
} else {
|
||||
//清除之前的错误
|
||||
taxDeclareRecord.setTaxDeclareErrorMsg("");
|
||||
declareStatus.setTaxDeclareErrorMsg("");
|
||||
}
|
||||
// 申报状态
|
||||
Integer declareStatus = SalaryEntityUtil.getIntValue(declareTaxFeedbackResponse.getBody().get("sbztbj"), -1);
|
||||
TaxDeclareStatusEnum taxDeclareStatusEnum = SalaryEnumUtil.enumMatchByValue(declareStatus, TaxDeclareStatusEnum.class);
|
||||
TaxDeclareStatusEnum taxDeclareStatusEnum = SalaryEnumUtil.enumMatchByValue(SalaryEntityUtil.getIntValue(declareTaxFeedbackResponse.getBody().get("sbztbj"), -1), TaxDeclareStatusEnum.class);
|
||||
if (taxDeclareStatusEnum == null) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156509, "服务异常,接口返回数据有误"));
|
||||
}
|
||||
|
|
@ -792,33 +822,35 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe
|
|||
if (declareFeedBackStatusEnum == DeclareFeedBackStatusEnum.DECLARE_FAIL) {
|
||||
taxDeclareStatusEnum = TaxDeclareStatusEnum.DECLARE_FAIL;
|
||||
}
|
||||
taxDeclareRecord.setTaxDeclareStatus(taxDeclareStatusEnum.getValue());
|
||||
declareStatus.setTaxDeclareStatus(taxDeclareStatusEnum.getValue());
|
||||
// 申报类型
|
||||
taxDeclareRecord.setTaxPayAmount(Util.null2String(declareTaxFeedbackResponse.getBody().get("ykjse")));
|
||||
taxDeclareRecord.setPersonNum(Integer.parseInt(Optional.ofNullable(declareTaxFeedbackResponse.getBody().get("nsrc")).orElse("0").toString()));
|
||||
taxDeclareRecord.setDeclareRequestId(taxDeclareRecord.getRequestId());
|
||||
taxDeclareRecord.setRequestId("");
|
||||
taxDeclareRecord.setUpdateTime(new Date());
|
||||
BigDecimal purePaidAmount = SalaryEntityUtil.empty2Zero(taxDeclareRecord.getTaxPurePaidAmount());
|
||||
BigDecimal payAmount = SalaryEntityUtil.empty2Zero(taxDeclareRecord.getTaxPayAmount());
|
||||
declareStatus.setTaxPayAmount(Util.null2String(declareTaxFeedbackResponse.getBody().get("ykjse")));
|
||||
declareStatus.setPersonNum(Integer.parseInt(Optional.ofNullable(declareTaxFeedbackResponse.getBody().get("nsrc")).orElse("0").toString()));
|
||||
declareStatus.setDeclareRequestId(declareStatus.getRequestId());
|
||||
declareStatus.setRequestId("");
|
||||
//实缴(不含滞纳金)
|
||||
BigDecimal purePaidAmount = SalaryEntityUtil.empty2Zero(declareStatus.getTaxPurePaidAmount());
|
||||
//应缴
|
||||
BigDecimal payAmount = SalaryEntityUtil.empty2Zero(declareStatus.getTaxPayAmount());
|
||||
if (TaxDeclareStatusEnum.DECLARE_SUCCESS_PAID.equals(taxDeclareStatusEnum) || TaxDeclareStatusEnum.DECLARE_SUCCESS_NO_PAY.equals(taxDeclareStatusEnum)) {
|
||||
// 如果是已缴纳状态,则更新已缴纳金额,判断是否需要线下退税
|
||||
if (purePaidAmount.compareTo(payAmount) > 0) {
|
||||
taxDeclareRecord.setTaxPayAmount(payAmount.subtract(purePaidAmount).toString());
|
||||
BigDecimal paidAmount = SalaryEntityUtil.empty2Zero(taxDeclareRecord.getTaxPaidAmount());
|
||||
declareStatus.setTaxPayAmount(payAmount.subtract(purePaidAmount).toString());
|
||||
BigDecimal paidAmount = SalaryEntityUtil.empty2Zero(declareStatus.getTaxPaidAmount());
|
||||
taxDeclarationRate.setMsg(String.format(SalaryI18nUtil.getI18nLabel(183789, "应缴税额(不含滞纳金等):%s元,已缴金额(可能含滞纳金等):%s元,当前已缴款金额大于应缴纳金额,请线下前往办税大厅办理退款。"), payAmount, paidAmount));
|
||||
taxDeclarationRate.setMsgPersist(true);
|
||||
} else if (purePaidAmount.compareTo(payAmount) == 0) {
|
||||
taxDeclareRecord.setTaxPayAmount(BigDecimal.ZERO.toString());
|
||||
declareStatus.setTaxPayAmount(BigDecimal.ZERO.toString());
|
||||
} else {
|
||||
throw new SalaryRunTimeException("缴款数据异常,请处理后重试");
|
||||
}
|
||||
} else if (TaxDeclareStatusEnum.DECLARE_SUCCESS_UNPAID.equals(taxDeclareStatusEnum)) {
|
||||
// 如果不是已缴纳状态,则减掉之前的已缴纳金额去更新应缴纳金额
|
||||
taxDeclareRecord.setTaxPayAmount(payAmount.subtract(purePaidAmount).toString());
|
||||
declareStatus.setTaxPayAmount(payAmount.subtract(purePaidAmount).toString());
|
||||
}
|
||||
// 更新个税申报记录
|
||||
getTaxDeclareRecordMapper().updateIgnoreNull(taxDeclareRecord);
|
||||
//更新申报状态
|
||||
getTaxDeclareStatusService(user).updateTaxDeclareStatus(declareStatus,true);
|
||||
|
||||
// 如果申报失败
|
||||
if (CollectionUtils.isNotEmpty(taxDeclareFails)) {
|
||||
getTaxDeclareFailService(user).saveBatch(taxDeclareFails);
|
||||
|
|
@ -832,29 +864,31 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe
|
|||
getTaxDeclarationApiBillingService(user).updateApiFlowInfo(apiFlowUpdateWrapper);
|
||||
|
||||
// 记录日志
|
||||
TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent();
|
||||
LoggerContext<TaxDeclarationPO> loggerContext = new LoggerContext<>();
|
||||
loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId()));
|
||||
loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(203562, "个税扣缴义务人「{0}」税款所属期「{1}」")
|
||||
.replace("{0}", taxAgent.getName())
|
||||
.replace("{1}", SalaryDateUtil.getFormatYearMonth(taxDeclareRecord.getTaxCycle())));
|
||||
loggerContext.setUser(user);
|
||||
loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue());
|
||||
loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "申报反馈"));
|
||||
loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "申报反馈"));
|
||||
TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent();
|
||||
LoggerContext<TaxDeclarationPO> loggerContext = new LoggerContext<>();
|
||||
loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId()));
|
||||
loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(203562, "个税扣缴义务人「{0}」税款所属期「{1}」")
|
||||
.replace("{0}", taxAgent.getName())
|
||||
.replace("{1}", SalaryDateUtil.getFormatYearMonth(taxDeclareRecord.getTaxCycle())));
|
||||
loggerContext.setUser(user);
|
||||
loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue());
|
||||
loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "申报反馈"));
|
||||
loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "申报反馈"));
|
||||
SalaryElogConfig.taxDeclarationLoggerTemplate.write(loggerContext);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cancelDeclare(Long id) {
|
||||
public void cancelDeclare(Long id, Integer reportType) {
|
||||
TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id);
|
||||
TaxDeclareRecordPO taxDeclareRecord = taxDeclareRequest.getTaxDeclareRecord();
|
||||
|
||||
TaxDeclareStatusPO declareStatus = getTaxDeclareStatusService(user).getTaxDeclareStatus(id, reportType);
|
||||
// 更正申报成功后不能作废
|
||||
if (Objects.equals(taxDeclareRecord.getTaxDeclareType(), TaxDeclareTypeEnum.UPDATE_DECLARE.getValue())) {
|
||||
if (Objects.equals(declareStatus.getTaxDeclareType(), TaxDeclareTypeEnum.UPDATE_DECLARE.getValue())) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(182701, "更正申报后不允许作废"));
|
||||
}
|
||||
// 只有申报成功,无需缴款/申报成功,未缴款的状态才能作废
|
||||
if (!Objects.equals(taxDeclareRecord.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARE_SUCCESS_NO_PAY.getValue()) && !Objects.equals(taxDeclareRecord.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARE_SUCCESS_UNPAID.getValue())) {
|
||||
if (!Objects.equals(declareStatus.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARE_SUCCESS_NO_PAY.getValue()) && !Objects.equals(declareStatus.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARE_SUCCESS_UNPAID.getValue())) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156497, "只有申报成功,无需缴款/申报成功,未缴款的状态才能作废"));
|
||||
}
|
||||
// 供应商信息
|
||||
|
|
@ -864,7 +898,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe
|
|||
// 税款所属期
|
||||
requestParam.put("skssq", SalaryDateUtil.getFormatYYYYMM(taxDeclareRecord.getTaxCycle()));
|
||||
// 申报类型
|
||||
requestParam.put("sblx", "1");
|
||||
requestParam.put("sblx", reportType + "");
|
||||
// 作废银联缴款凭证
|
||||
// taxPaymentServiceFactory.get(TaxPaymentServiceTypeEnum.WITHHOLDING_VOUCHER.getValue()).cancelWithholdingVoucher(apiConfig, taxDeclareRecord, requestParam);
|
||||
// 是否清空所得
|
||||
|
|
@ -883,37 +917,41 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe
|
|||
if (!Objects.equals(declareTaxResponse.getHead().getCode(), SzyhApiConstant.SUCCESS_CODE)) {
|
||||
throw new SalaryRunTimeException(declareTaxResponse.getHead().getMsg());
|
||||
}
|
||||
// 更新个税申报记录
|
||||
taxDeclareRecord.setTaxDeclareStatus(TaxDeclareStatusEnum.DECLARE_CANCELLING.getValue());
|
||||
taxDeclareRecord.setRequestId(declareTaxResponse.getBody().getRequestId());
|
||||
taxDeclareRecord.setUpdateTime(new Date());
|
||||
getTaxDeclareRecordMapper().updateIgnoreNull(taxDeclareRecord);
|
||||
// 更新个税申报状态
|
||||
declareStatus.setTaxDeclareStatus(TaxDeclareStatusEnum.DECLARE_CANCELLING.getValue());
|
||||
declareStatus.setRequestId(declareTaxResponse.getBody().getRequestId());
|
||||
getTaxDeclareStatusService(user).updateTaxDeclareStatus(declareStatus,true);
|
||||
|
||||
// 记录日志
|
||||
TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent();
|
||||
LoggerContext<TaxDeclarationPO> loggerContext = new LoggerContext<>();
|
||||
loggerContext.setUser(user);
|
||||
loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId()));
|
||||
loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "个税扣缴义务人「{0}」税款所属期「{1}」")
|
||||
.replace("{0}", taxAgent.getName())
|
||||
.replace("{1}", SalaryDateUtil.getFormatYearMonth(taxDeclareRecord.getTaxCycle())));
|
||||
loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue());
|
||||
loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "申报作废"));
|
||||
loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "申报作废"));
|
||||
// 记录日志
|
||||
TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent();
|
||||
LoggerContext<TaxDeclarationPO> loggerContext = new LoggerContext<>();
|
||||
loggerContext.setUser(user);
|
||||
loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId()));
|
||||
loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "个税扣缴义务人「{0}」税款所属期「{1}」")
|
||||
.replace("{0}", taxAgent.getName())
|
||||
.replace("{1}", SalaryDateUtil.getFormatYearMonth(taxDeclareRecord.getTaxCycle())));
|
||||
loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue());
|
||||
loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "申报作废"));
|
||||
loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "申报作废"));
|
||||
SalaryElogConfig.taxDeclarationLoggerTemplate.write(loggerContext);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getCancelFeedback(Long id, TaxDeclarationRateDTO taxDeclarationRate) {
|
||||
public void getCancelFeedback(Long id, Integer reportType, TaxDeclarationRateDTO taxDeclarationRate) {
|
||||
TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id);
|
||||
TaxDeclareRecordPO taxDeclareRecord = taxDeclareRequest.getTaxDeclareRecord();
|
||||
if (!Objects.equals(taxDeclareRecord.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARE_CANCELLING.getValue()) || StringUtils.isEmpty(taxDeclareRecord.getRequestId())) {
|
||||
|
||||
TaxDeclareStatusPO declareStatus = getTaxDeclareStatusService(user).getTaxDeclareStatus(id, reportType);
|
||||
|
||||
|
||||
if (!Objects.equals(declareStatus.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARE_CANCELLING.getValue()) || StringUtils.isEmpty(declareStatus.getRequestId())) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156500, "请先点击「作废申报」后再来点击「申报反馈」按钮获取结果"));
|
||||
}
|
||||
|
||||
// 供应商信息
|
||||
TaxDeclarationApiConfigPO apiConfig = taxDeclareRequest.getTaxDeclarationApiConfig();
|
||||
String url = apiConfig.getHost() + SzyhApiConstant.CANCEL_DECLARE_FEEDBACK;
|
||||
ImmutableMap<String, String> requestParam = ImmutableMap.of("requestId", taxDeclareRecord.getRequestId(), "reportType", "1");
|
||||
ImmutableMap<String, String> requestParam = ImmutableMap.of("requestId", declareStatus.getRequestId(), "reportType", reportType + "");
|
||||
Map<String, String> header = SingnatureData.initHeader(Collections.emptyMap(), apiConfig.getAppKey(), apiConfig.getAppSecret());
|
||||
String res = HttpUtil.getRequest(url, header, requestParam);
|
||||
log.info("作废反馈返回数据:" + res);
|
||||
|
|
@ -935,22 +973,23 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe
|
|||
if (taxDeclareStatusEnum == null) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156509, "服务异常,接口返回数据有误"));
|
||||
}
|
||||
taxDeclareRecord.setTaxDeclareStatus(taxDeclareStatusEnum.getValue());
|
||||
taxDeclareRecord.setRequestId("");
|
||||
taxDeclareRecord.setUpdateTime(new Date());
|
||||
getTaxDeclareRecordMapper().updateIgnoreNull(taxDeclareRecord);
|
||||
|
||||
//更新个税申报状态
|
||||
declareStatus.setTaxDeclareStatus(taxDeclareStatusEnum.getValue());
|
||||
declareStatus.setRequestId("");
|
||||
getTaxDeclareStatusService(user).updateTaxDeclareStatus(declareStatus,true);
|
||||
|
||||
// 记录日志
|
||||
TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent();
|
||||
LoggerContext<TaxDeclarationPO> loggerContext = new LoggerContext<>();
|
||||
loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId()));
|
||||
loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "个税扣缴义务人「{0}」税款所属期「{1}」")
|
||||
.replace("{0}", taxAgent.getName())
|
||||
.replace("{1}", SalaryDateUtil.getFormatYearMonth(taxDeclareRecord.getTaxCycle())));
|
||||
loggerContext.setUser(user);
|
||||
loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue());
|
||||
loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "获取申报作废的反馈"));
|
||||
loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "获取申报作废的反馈"));
|
||||
TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent();
|
||||
LoggerContext<TaxDeclarationPO> loggerContext = new LoggerContext<>();
|
||||
loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId()));
|
||||
loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "个税扣缴义务人「{0}」税款所属期「{1}」")
|
||||
.replace("{0}", taxAgent.getName())
|
||||
.replace("{1}", SalaryDateUtil.getFormatYearMonth(taxDeclareRecord.getTaxCycle())));
|
||||
loggerContext.setUser(user);
|
||||
loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue());
|
||||
loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "获取申报作废的反馈"));
|
||||
loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "获取申报作废的反馈"));
|
||||
SalaryElogConfig.taxDeclarationLoggerTemplate.write(loggerContext);
|
||||
}
|
||||
|
||||
|
|
@ -972,26 +1011,33 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe
|
|||
@Override
|
||||
public XSSFWorkbook exportGetDeclareTaxResultFeedback(DeclareTaxResultFeedbackQueryParam param) {
|
||||
Long id = param.getId();
|
||||
TaxDeclareRecordPO taxDeclareRecord = getById(id);
|
||||
String requestId = param.getRequestId();
|
||||
TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id);
|
||||
TaxDeclareRecordPO taxDeclareRecord = taxDeclareRequest.getTaxDeclareRecord();
|
||||
TaxDeclareStatusPO declareStatus = getTaxDeclareStatusService(user).getTaxDeclareStatus(id, param.getReportType());
|
||||
|
||||
DeclareClient declareClient = new DeclareClient(taxDeclareRecord.getTaxAgentId());
|
||||
GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse = declareClient.getDeclareTaxResultFeedback(StringUtils.isEmpty(requestId) ? taxDeclareRecord.getDeclareRequestId() : requestId);
|
||||
GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse = declareClient.getDeclareTaxResultFeedback(StringUtils.isEmpty(requestId) ? declareStatus.getDeclareRequestId() : requestId);
|
||||
|
||||
Map<String, List<List<Object>>> map = new HashMap<>();
|
||||
List<TaxDeclarationPO> list = getTaxDeclarationService(user).listByTaxDeclareRecordId(id);
|
||||
list.stream().map(TaxDeclarationPO::getIncomeCategory).map(IncomeCategoryEnum::parseByValue).forEach(e -> e.parseGetDeclareTaxResultFeedbackResponse(map, declareTaxResultFeedbackResponse));
|
||||
list.stream()
|
||||
.map(TaxDeclarationPO::getIncomeCategory)
|
||||
.map(IncomeCategoryEnum::parseByValue)
|
||||
.filter(incomeCategoryEnum -> incomeCategoryEnum.getReportType().getValue().equals(param.getReportType()))
|
||||
.collect(Collectors.toList()).forEach(e -> e.parseGetDeclareTaxResultFeedbackResponse(map, declareTaxResultFeedbackResponse));
|
||||
return ExcelUtil.genWorkbookV2(map);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void updateDeclare(Long id) {
|
||||
public void updateDeclare(Long id, Integer reportType) {
|
||||
TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id);
|
||||
TaxDeclareRecordPO taxDeclareRecord = taxDeclareRequest.getTaxDeclareRecord();
|
||||
TaxDeclareStatusPO declareStatus = getTaxDeclareStatusService(user).getTaxDeclareStatus(id, reportType);
|
||||
|
||||
|
||||
List<Integer> taxDeclareStatusEnumValueList = Lists.newArrayList(TaxDeclareStatusEnum.DECLARE_SUCCESS_UNPAID.getValue(), TaxDeclareStatusEnum.DECLARE_SUCCESS_NO_PAY.getValue(), TaxDeclareStatusEnum.DECLARE_SUCCESS_PAID.getValue(), TaxDeclareStatusEnum.DECLARE_SUCCESS_PAYING.getValue());
|
||||
if (!taxDeclareStatusEnumValueList.contains(taxDeclareRecord.getTaxDeclareStatus())) {
|
||||
if (!taxDeclareStatusEnumValueList.contains(declareStatus.getTaxDeclareStatus())) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(182702, "对不起,只有申报成功后才允许更正申报"));
|
||||
}
|
||||
// 供应商信息
|
||||
|
|
@ -1001,7 +1047,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe
|
|||
// 税款所属期
|
||||
requestParam.put("skssq", SalaryDateUtil.getFormatYYYYMM(taxDeclareRecord.getTaxCycle()));
|
||||
// 申报类型
|
||||
requestParam.put("sblx", "1");
|
||||
requestParam.put("sblx", reportType + "");
|
||||
// 请求
|
||||
String reqJson = JsonUtil.toJsonString(requestParam);
|
||||
log.info("更正申报请求数据:" + reqJson);
|
||||
|
|
@ -1017,27 +1063,27 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe
|
|||
if (!Objects.equals(updateDeclareResponse.getHead().getCode(), SzyhApiConstant.SUCCESS_CODE)) {
|
||||
throw new SalaryRunTimeException(updateDeclareResponse.getHead().getMsg());
|
||||
}
|
||||
taxDeclareRecord.setTaxDeclareType(TaxDeclareTypeEnum.UPDATE_DECLARE.getValue());
|
||||
taxDeclareRecord.setTaxDeclareStatus(TaxDeclareStatusEnum.NOT_DECLARE.getValue());
|
||||
taxDeclareRecord.setRequestId("");
|
||||
taxDeclareRecord.setUpdateTime(new Date());
|
||||
getTaxDeclareRecordMapper().updateIgnoreNull(taxDeclareRecord);
|
||||
|
||||
//更新申报状态
|
||||
declareStatus.setTaxDeclareType(TaxDeclareTypeEnum.UPDATE_DECLARE.getValue());
|
||||
declareStatus.setTaxDeclareStatus(NOT_DECLARE.getValue());
|
||||
declareStatus.setRequestId("");
|
||||
getTaxDeclareStatusService(user).updateTaxDeclareStatus(declareStatus,true);
|
||||
|
||||
// 记录日志
|
||||
TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent();
|
||||
LoggerContext<TaxDeclarationPO> loggerContext = new LoggerContext<>();
|
||||
loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId()));
|
||||
loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "个税扣缴义务人「{0}」税款所属期「{1}」")
|
||||
.replace("{0}", taxAgent.getName())
|
||||
.replace("{1}", SalaryDateUtil.getFormatYearMonth(taxDeclareRecord.getTaxCycle())));
|
||||
loggerContext.setUser(user);
|
||||
loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue());
|
||||
loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "更正申报"));
|
||||
loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "更正申报"));
|
||||
TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent();
|
||||
LoggerContext<TaxDeclarationPO> loggerContext = new LoggerContext<>();
|
||||
loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId()));
|
||||
loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "个税扣缴义务人「{0}」税款所属期「{1}」")
|
||||
.replace("{0}", taxAgent.getName())
|
||||
.replace("{1}", SalaryDateUtil.getFormatYearMonth(taxDeclareRecord.getTaxCycle())));
|
||||
loggerContext.setUser(user);
|
||||
loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue());
|
||||
loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "更正申报"));
|
||||
loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "更正申报"));
|
||||
SalaryElogConfig.taxDeclarationLoggerTemplate.write(loggerContext);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void cancelCorrect(Long id) {
|
||||
TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id);
|
||||
|
|
@ -1076,17 +1122,17 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe
|
|||
// getTaxDeclareRecordMapper().updateIgnoreNull(taxDeclareRecord);
|
||||
|
||||
// 记录日志
|
||||
// TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent();
|
||||
// LoggerContext<TaxDeclarationPO> loggerContext = new LoggerContext<>();
|
||||
// loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId()));
|
||||
// loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(203562, "个税扣缴义务人「{0}」税款所属期「{1}」")
|
||||
// .replace("{0}", taxAgent.getName())
|
||||
// .replace("{1}", taxDeclareRecord.getTaxCycle()));
|
||||
// loggerContext.setOperator(Util.null2String(employeeId));
|
||||
// loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue());
|
||||
// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(177637, "更正申报"));
|
||||
// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(177637, "更正申报"));
|
||||
// taxDeclarationLoggerTemplate.write(loggerContext);
|
||||
// TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent();
|
||||
// LoggerContext<TaxDeclarationPO> loggerContext = new LoggerContext<>();
|
||||
// loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId()));
|
||||
// loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(203562, "个税扣缴义务人「{0}」税款所属期「{1}」")
|
||||
// .replace("{0}", taxAgent.getName())
|
||||
// .replace("{1}", taxDeclareRecord.getTaxCycle()));
|
||||
// loggerContext.setOperator(Util.null2String(employeeId));
|
||||
// loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue());
|
||||
// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(177637, "更正申报"));
|
||||
// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(177637, "更正申报"));
|
||||
// taxDeclarationLoggerTemplate.write(loggerContext);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -1097,8 +1143,6 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe
|
|||
Map<String, Object> requestParam = taxDeclareRequest.getRequestParam();
|
||||
// 税款所属期
|
||||
requestParam.put("skssq", SalaryDateUtil.getFormatYYYYMM(taxDeclareRecord.getTaxCycle()));
|
||||
// 申报类型
|
||||
requestParam.put("sblx", "1");
|
||||
// 请求
|
||||
String reqJson = JsonUtil.toJsonString(requestParam);
|
||||
String url = apiConfig.getHost() + SzyhApiConstant.QUERY_DECLARE_STATUS;
|
||||
|
|
@ -1110,15 +1154,17 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe
|
|||
}
|
||||
|
||||
@Override
|
||||
public String queryCompanyIncomes(Long id) {
|
||||
TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id);
|
||||
public String queryCompanyIncomes(TaxDeclareRecordParam taxDeclareRecordParam) {
|
||||
ValidUtil.doValidator(taxDeclareRecordParam);
|
||||
|
||||
TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(taxDeclareRecordParam.getTaxDeclareRecordId());
|
||||
TaxDeclarationApiConfigPO apiConfig = taxDeclareRequest.getTaxDeclarationApiConfig();
|
||||
TaxDeclareRecordPO taxDeclareRecord = taxDeclareRequest.getTaxDeclareRecord();
|
||||
Map<String, Object> requestParam = taxDeclareRequest.getRequestParam();
|
||||
// 税款所属期
|
||||
requestParam.put("skssq", SalaryDateUtil.getFormatYYYYMM(taxDeclareRecord.getTaxCycle()));
|
||||
// 报表类型
|
||||
requestParam.put("reportType", "1");
|
||||
requestParam.put("reportType", taxDeclareRecordParam.getReportType());
|
||||
// 页码
|
||||
requestParam.put("pageNo", "1");
|
||||
// 每页数量
|
||||
|
|
|
|||
|
|
@ -0,0 +1,142 @@
|
|||
package com.engine.salary.service.impl;
|
||||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationPO;
|
||||
import com.engine.salary.entity.taxdeclaration.po.TaxDeclareRecordPO;
|
||||
import com.engine.salary.entity.taxdeclaration.po.TaxDeclareStatusPO;
|
||||
import com.engine.salary.enums.salarysob.IncomeCategoryEnum;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.mapper.taxdeclaration.TaxDeclareRecordMapper;
|
||||
import com.engine.salary.mapper.taxdeclaration.TaxDeclareStatusMapper;
|
||||
import com.engine.salary.service.TaxDeclarationService;
|
||||
import com.engine.salary.service.TaxDeclareStatusService;
|
||||
import com.engine.salary.util.SalaryDateUtil;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import com.engine.salary.util.db.IdGenerator;
|
||||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
|
||||
import static com.engine.salary.enums.taxdeclaration.TaxDeclareStatusEnum.NOT_DECLARE;
|
||||
|
||||
/**
|
||||
* 个税申报
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
@Slf4j
|
||||
public class TaxDeclareStatusServiceImpl extends Service implements TaxDeclareStatusService {
|
||||
|
||||
|
||||
private TaxDeclareRecordMapper getTaxDeclareRecordMapper() {
|
||||
return MapperProxyFactory.getProxy(TaxDeclareRecordMapper.class);
|
||||
}
|
||||
|
||||
private TaxDeclareStatusMapper getTaxDeclareStatusMapper() {
|
||||
return MapperProxyFactory.getProxy(TaxDeclareStatusMapper.class);
|
||||
}
|
||||
|
||||
private TaxDeclarationService getTaxDeclarationService(User user) {
|
||||
return ServiceUtil.getService(TaxDeclarationServiceImpl.class, user);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TaxDeclareStatusPO> getTaxDeclareStatusByTaxDeclareRecordId(Long taxDeclareRecordId) {
|
||||
return getTaxDeclareStatusMapper().listSome(TaxDeclareStatusPO.builder().taxDeclareRecordId(taxDeclareRecordId).build());
|
||||
}
|
||||
|
||||
@Override
|
||||
public TaxDeclareStatusPO getTaxDeclareStatus(Long taxDeclareRecordId, Integer reportType) {
|
||||
return getTaxDeclareStatusMapper().getDeclareStatus(taxDeclareRecordId, reportType);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void updateTaxDeclareStatus(TaxDeclareStatusPO declareStatus, boolean updateRecord) {
|
||||
//更新申报表状态
|
||||
getTaxDeclareStatusMapper().updateIgnoreNull(declareStatus);
|
||||
|
||||
//更新主记录
|
||||
if (updateRecord) {
|
||||
updateRecord(declareStatus.getTaxDeclareRecordId());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<TaxDeclareStatusPO> updateRecord(Long id) {
|
||||
|
||||
// 查询个税申报记录
|
||||
TaxDeclareRecordPO taxDeclareRecord = getTaxDeclareRecordMapper().getById(id);
|
||||
if (Objects.isNull(taxDeclareRecord)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156495, "参数异常,个税申报记录不存在或已被删除"));
|
||||
}
|
||||
|
||||
// 查询个税申报表
|
||||
List<TaxDeclarationPO> taxDeclarations = getTaxDeclarationService(user).listByTaxCycleAndTaxAgentIds(SalaryDateUtil.localDate2YearMonth(taxDeclareRecord.getTaxCycle()), Collections.singleton(taxDeclareRecord.getTaxAgentId()));
|
||||
if (CollectionUtils.isEmpty(taxDeclarations)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156494, "当前无可申报的数据"));
|
||||
}
|
||||
|
||||
Set<Integer> reportTypes = new HashSet<>();
|
||||
taxDeclarations.forEach(taxDeclarationPO -> {
|
||||
reportTypes.add(IncomeCategoryEnum.parseByValue(taxDeclarationPO.getIncomeCategory()).getReportType().getValue());
|
||||
});
|
||||
|
||||
List<TaxDeclareStatusPO> statuses = new ArrayList<>();
|
||||
|
||||
int personNum = 0;
|
||||
BigDecimal taxPayAmount = new BigDecimal(0);
|
||||
BigDecimal taxPaidAmount = new BigDecimal(0);
|
||||
BigDecimal taxPurePaidAmount = new BigDecimal(0);
|
||||
|
||||
for (Integer reportType : reportTypes) {
|
||||
TaxDeclareStatusPO declareStatus = getTaxDeclareStatus(id, reportType);
|
||||
if (declareStatus == null) {
|
||||
declareStatus = TaxDeclareStatusPO.builder()
|
||||
.id(IdGenerator.generate())
|
||||
.taxDeclareRecordId(id)
|
||||
.reportType(reportType)
|
||||
.taxDeclareType(taxDeclareRecord.getTaxDeclareType())
|
||||
.taxDeclareStatus(taxDeclareRecord.getTaxDeclareStatus())
|
||||
.taxDeclareErrorMsg(taxDeclareRecord.getTaxDeclareErrorMsg())
|
||||
.personNum(taxDeclareRecord.getPersonNum())
|
||||
.taxPayAmount(taxDeclareRecord.getTaxPayAmount())
|
||||
.taxPaidAmount(taxDeclareRecord.getTaxPaidAmount())
|
||||
.taxPurePaidAmount(taxDeclareRecord.getTaxPaidAmount())
|
||||
.deleteType(0)
|
||||
.build();
|
||||
getTaxDeclareStatusMapper().insertIgnoreNull(declareStatus);
|
||||
}
|
||||
statuses.add(declareStatus);
|
||||
|
||||
personNum += declareStatus.getPersonNum() == null ? 0 : declareStatus.getPersonNum();
|
||||
taxPayAmount = taxPayAmount.add(SalaryEntityUtil.empty2Zero(declareStatus.getTaxPayAmount()));
|
||||
taxPaidAmount = taxPaidAmount.add(SalaryEntityUtil.empty2Zero(declareStatus.getTaxPaidAmount()));
|
||||
taxPurePaidAmount = taxPurePaidAmount.add(SalaryEntityUtil.empty2Zero(declareStatus.getTaxPurePaidAmount()));
|
||||
}
|
||||
|
||||
//更新记录的状态,各个报表状态一致则采纳,否则取最小的进度状态
|
||||
Integer declareStatusEnum = statuses.stream().map(TaxDeclareStatusPO::getTaxDeclareStatus).min(Comparator.comparing(Integer::valueOf)).orElse(NOT_DECLARE.getValue());
|
||||
|
||||
taxDeclareRecord.setPersonNum(personNum);
|
||||
taxDeclareRecord.setTaxPayAmount(taxPayAmount.toString());
|
||||
taxDeclareRecord.setTaxPaidAmount(taxPaidAmount.toString());
|
||||
taxDeclareRecord.setTaxPurePaidAmount(taxPurePaidAmount.toString());
|
||||
taxDeclareRecord.setTaxDeclareStatus(declareStatusEnum);
|
||||
getTaxDeclareRecordMapper().updateIgnoreNull(taxDeclareRecord);
|
||||
|
||||
return statuses;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -10,13 +10,13 @@ import com.engine.salary.entity.taxpayment.dto.TaxWithheldVoucherResultDTO;
|
|||
import com.engine.salary.entity.taxpayment.param.TaxPaymentQueryParam;
|
||||
import com.engine.salary.entity.taxpayment.response.BaseResponse;
|
||||
import com.engine.salary.entity.taxpayment.response.WithheldVoucherResponse;
|
||||
import com.engine.salary.enums.salarysob.DeclareReportTypeEnum;
|
||||
import com.engine.salary.enums.taxdeclaration.TaxPaymentServiceTypeEnum;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.util.SalaryDateUtil;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
|
|
@ -41,7 +41,6 @@ public class TaxPaymentWithheldVoucherServiceImpl extends AbstractTaxPaymentServ
|
|||
return postRequest(apiConfig, url, requestParam, clazz);
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public TaxWithheldVoucherResultDTO getWithheldVoucher(TaxPaymentQueryParam param) {
|
||||
TempWrapper tempWrapper = checkBeforeGetRequestIdResponse(param);
|
||||
|
|
@ -49,10 +48,20 @@ public class TaxPaymentWithheldVoucherServiceImpl extends AbstractTaxPaymentServ
|
|||
param, tempWrapper.getApiConfigPO(), WithheldVoucherResponse.class);
|
||||
// 校验请求结果
|
||||
String responseCode = Optional.ofNullable(queryResponse).map(WithheldVoucherResponse::getHead).map(SzyhResponseHead::getCode).orElse(null);
|
||||
WithheldVoucherResponse.Feedback feedback = Optional.ofNullable(queryResponse).map(WithheldVoucherResponse::getBody).map(WithheldVoucherResponse.Body::getZhsd).orElse(null);
|
||||
WithheldVoucherResponse.Feedback feedback = Optional.ofNullable(queryResponse).map(WithheldVoucherResponse::getBody).map(body -> {
|
||||
if (DeclareReportTypeEnum.COMPREHENSIVE_INCOME.getValue().equals(param.getReportType())) {
|
||||
return body.getZhsd();
|
||||
} else if (DeclareReportTypeEnum.CLASSIFIED_INCOME.getValue().equals(param.getReportType())) {
|
||||
return body.getFlsd();
|
||||
} else if (DeclareReportTypeEnum.NONRESIDENT_INCOME.getValue().equals(param.getReportType())) {
|
||||
return body.getFjmsd();
|
||||
} else {
|
||||
return body.getXsgsd();
|
||||
}
|
||||
}).orElse(null);
|
||||
if (!SzyhApiConstant.SUCCESS_CODE.equals(responseCode) || Objects.isNull(feedback)) {
|
||||
log.info("getWithheldVoucher code error:{}", JSON.toJSONString(queryResponse));
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel( 95828, "税局接口异常,请稍后重试"));
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(95828, "税局接口异常,请稍后重试"));
|
||||
}
|
||||
Integer status = SalaryEntityUtil.getIntValue(feedback.getJkzt(), -1);
|
||||
if (status.equals(1)) {
|
||||
|
|
@ -61,7 +70,7 @@ public class TaxPaymentWithheldVoucherServiceImpl extends AbstractTaxPaymentServ
|
|||
}
|
||||
List<TaxWithheldVoucherResultDTO.Voucher> vouchers = new ArrayList<>();
|
||||
for (int i = 1; i <= feedback.getWszmlb().size(); i++) {
|
||||
vouchers.add(new TaxWithheldVoucherResultDTO.Voucher(SalaryI18nUtil.getI18nLabel( 184013, "完税证明") + i, feedback.getWszmlb().get(i - 1)));
|
||||
vouchers.add(new TaxWithheldVoucherResultDTO.Voucher(SalaryI18nUtil.getI18nLabel(184013, "完税证明") + i, feedback.getWszmlb().get(i - 1)));
|
||||
}
|
||||
return new TaxWithheldVoucherResultDTO().setVouchers(vouchers);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO;
|
|||
import com.engine.salary.entity.taxagent.response.SzyhResponseHead;
|
||||
import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO;
|
||||
import com.engine.salary.entity.taxdeclaration.po.TaxDeclareRecordPO;
|
||||
import com.engine.salary.entity.taxdeclaration.po.TaxDeclareStatusPO;
|
||||
import com.engine.salary.entity.taxpayment.dto.TaxAgreementFeedbackResultDTO;
|
||||
import com.engine.salary.entity.taxpayment.dto.TaxAmountFormDTO;
|
||||
import com.engine.salary.entity.taxpayment.dto.TaxFeedbackResultDTO;
|
||||
|
|
@ -16,6 +17,8 @@ import com.engine.salary.entity.taxpayment.po.TaxPaymentRequestPO;
|
|||
import com.engine.salary.entity.taxpayment.response.BaseResponse;
|
||||
import com.engine.salary.entity.taxpayment.response.WithholdingFeedbackResponse;
|
||||
import com.engine.salary.enums.SalaryOnOffEnum;
|
||||
import com.engine.salary.enums.salarysob.DeclareReportTypeEnum;
|
||||
import com.engine.salary.enums.taxdeclaration.TaxDeclareStatusEnum;
|
||||
import com.engine.salary.enums.taxdeclaration.TaxPaymentServiceTypeEnum;
|
||||
import com.engine.salary.enums.taxdeclaration.TaxPaymentStatusEnum;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
|
|
@ -23,8 +26,7 @@ import com.engine.salary.util.*;
|
|||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 三方缴款
|
||||
|
|
@ -52,30 +54,66 @@ public class TaxPaymentWithholdingServiceImpl extends AbstractTaxPaymentService
|
|||
log.info("getAgreementQueryFeedbackResponse not success: {}", JSON.toJSONString(feedbackResponse));
|
||||
throw new SalaryRunTimeException(msg);
|
||||
}
|
||||
WithholdingFeedbackResponse.Feedback feedback = Optional.of(feedbackResponse)
|
||||
.map(WithholdingFeedbackResponse::getBody)
|
||||
.map(WithholdingFeedbackResponse.Body::getZhsdjk)
|
||||
.orElse(null);
|
||||
if (feedback == null) {
|
||||
log.info("getAgreementQueryFeedbackResponse empty data error: {}", JSON.toJSONString(feedbackResponse));
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(175338, "税局接口错误,未返回有效数据"));
|
||||
|
||||
List<TaxDeclareStatusPO> statuses = getTaxDeclareStatusService(user).getTaxDeclareStatusByTaxDeclareRecordId(param.getTaxDeclareRecordId());
|
||||
for (TaxDeclareStatusPO status : statuses) {
|
||||
WithholdingFeedbackResponse.Feedback feedback = Optional.of(feedbackResponse)
|
||||
.map(WithholdingFeedbackResponse::getBody)
|
||||
.map(body -> {
|
||||
if (Objects.equals(status.getReportType(), DeclareReportTypeEnum.COMPREHENSIVE_INCOME.getValue())) {
|
||||
return body.getZhsdjk();
|
||||
} else if (Objects.equals(status.getReportType(), DeclareReportTypeEnum.CLASSIFIED_INCOME.getValue())) {
|
||||
return body.getFlsdjk();
|
||||
} else if (Objects.equals(status.getReportType(), DeclareReportTypeEnum.NONRESIDENT_INCOME.getValue())) {
|
||||
return body.getFjmsdjk();
|
||||
} else {
|
||||
return body.getXsgsdjk();
|
||||
}
|
||||
|
||||
})
|
||||
.orElse(null);
|
||||
if (feedback == null) {
|
||||
log.info("getAgreementQueryFeedbackResponse empty data error: {}", JSON.toJSONString(feedbackResponse));
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(175338, "税局接口错误,未返回有效数据"));
|
||||
}
|
||||
// 判断缴款状态是否成功
|
||||
Integer paymentStatus = SalaryEntityUtil.getIntValue(feedback.getJkzt(), -1);
|
||||
TaxPaymentStatusEnum paymentStatusEnum = SalaryEnumUtil.enumMatchByValue(paymentStatus, TaxPaymentStatusEnum.class);
|
||||
if (paymentStatusEnum != TaxPaymentStatusEnum.SUCCESS) {
|
||||
// fixme
|
||||
throw new SalaryRunTimeException(String.format("缴款失败,失败原因:%s,申报状态:%s", feedback.getJksbyy(), feedback.getSbzt()));
|
||||
}
|
||||
// 累计实缴金额
|
||||
BigDecimal totalPaid = feedback.getKkfhlb().stream().map(e -> new BigDecimal(e.getSjse())).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
|
||||
if (TaxDeclareStatusEnum.DECLARE_SUCCESS_PAID.getValue().equals(status.getTaxDeclareStatus())) {
|
||||
throw new SalaryRunTimeException("当前申报表状态为已缴款,无法更新状态");
|
||||
}
|
||||
BigDecimal taxPayAmount = SalaryEntityUtil.empty2Zero(status.getTaxPayAmount());
|
||||
BigDecimal taxPurePaidAmount = SalaryEntityUtil.empty2Zero(status.getTaxPurePaidAmount());
|
||||
if (SalaryEntityUtil.empty2Zero(status.getTaxPaidAmount()).equals(totalPaid)
|
||||
&& taxPayAmount.compareTo(BigDecimal.ZERO) > 0) {
|
||||
throw new SalaryRunTimeException("请进行缴款后再刷新缴款状态");
|
||||
}
|
||||
status.setTaxDeclareStatus(TaxDeclareStatusEnum.DECLARE_SUCCESS_PAID.getValue());
|
||||
status.setTaxPaidAmount(totalPaid.toString());
|
||||
status.setTaxPurePaidAmount(taxPurePaidAmount.add(taxPayAmount).toString());
|
||||
status.setTaxPayAmount(BigDecimal.ZERO.toString());
|
||||
getTaxDeclareStatusService(user).updateTaxDeclareStatus(status, false);
|
||||
}
|
||||
|
||||
TaxAmountFormDTO taxAmountFormDTO = queryTaxAmount(param);
|
||||
// 判断缴款状态是否成功
|
||||
Integer paymentStatus = SalaryEntityUtil.getIntValue(feedback.getJkzt(), -1);
|
||||
TaxPaymentStatusEnum paymentStatusEnum = SalaryEnumUtil.enumMatchByValue(paymentStatus, TaxPaymentStatusEnum.class);
|
||||
if (paymentStatusEnum != TaxPaymentStatusEnum.SUCCESS) {
|
||||
throw new SalaryRunTimeException(String.format("缴款失败,失败原因:%s,申报状态:%s", feedback.getJksbyy(), feedback.getSbzt()));
|
||||
}
|
||||
// 累计实缴金额
|
||||
BigDecimal totalPaid = feedback.getKkfhlb().stream().map(e -> new BigDecimal(e.getSjse())).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
// 更新个税申报记录状态为已缴款
|
||||
TaxDeclareRecordPO taxDeclareRecord = updateTaxDeclareRecord(param, totalPaid);
|
||||
|
||||
//更新主记录
|
||||
getTaxDeclareStatusService(user).updateRecord(param.getTaxDeclareRecordId());
|
||||
// 更新缴款请求为已反馈
|
||||
updateTaxPaymentRequest(param);
|
||||
BigDecimal otherAmount = totalPaid.subtract(SalaryEntityUtil.empty2Zero(taxDeclareRecord.getTaxPurePaidAmount()));
|
||||
|
||||
TaxDeclareRecordPO declareRecordPO = getTaxDeclareRecordService(user).getById(param.getTaxDeclareRecordId());
|
||||
BigDecimal otherAmount = SalaryEntityUtil.empty2Zero(declareRecordPO.getTaxPaidAmount()).subtract(SalaryEntityUtil.empty2Zero(declareRecordPO.getTaxPurePaidAmount()));
|
||||
|
||||
return new TaxAgreementFeedbackResultDTO()
|
||||
.setPayAmount(SalaryEntityUtil.thousandthConvert(totalPaid.toString()))
|
||||
.setPayAmount(SalaryEntityUtil.thousandthConvert(SalaryEntityUtil.empty2Zero(declareRecordPO.getTaxPaidAmount()).toString()))
|
||||
.setOtherAmount(SalaryEntityUtil.thousandthConvert(otherAmount.toString()))
|
||||
.setPersonNum(taxAmountFormDTO.getPersonNum());
|
||||
}
|
||||
|
|
@ -94,8 +132,8 @@ public class TaxPaymentWithholdingServiceImpl extends AbstractTaxPaymentService
|
|||
String url = apiConfig.getHost() + SzyhApiConstant.DECLARE_WITH_HOLDING;
|
||||
Map<String, Object> requestParam = DataCollectionBO.getApiBaseQueryParams(returnPO, taxAgentName, SalaryDateUtil.getFormatYYYYMM(param.getTaxYearMonth()));
|
||||
requestParam.put("sfxyh", param.getProtocolNumber());
|
||||
requestParam.put("ynse", param.getTaxAmount());
|
||||
requestParam.put("sblx", "1");
|
||||
// requestParam.put("ynse", param.getTaxAmount());
|
||||
// requestParam.put("sblx", "1");
|
||||
return postRequest(apiConfig, url, requestParam, clazz);
|
||||
}
|
||||
|
||||
|
|
@ -103,7 +141,6 @@ public class TaxPaymentWithholdingServiceImpl extends AbstractTaxPaymentService
|
|||
protected TempWrapper checkBeforeGetRequestIdResponse(TaxPaymentQueryParam param) {
|
||||
TempWrapper tempWrapper = super.checkBeforeGetRequestIdResponse(param);
|
||||
Map<String, Object> requestParam = DataCollectionBO.getApiBaseQueryParams(tempWrapper.getTaxReturnPO(), tempWrapper.getTaxAgentPO().getName(), SalaryDateUtil.getFormatYYYYMM(param.getTaxYearMonth()));
|
||||
requestParam.put("sblx", 1);
|
||||
cancelWithholdingVoucher(tempWrapper.getApiConfigPO(), tempWrapper.getTaxDeclareRecord(), requestParam);
|
||||
return tempWrapper;
|
||||
}
|
||||
|
|
@ -117,13 +154,15 @@ public class TaxPaymentWithholdingServiceImpl extends AbstractTaxPaymentService
|
|||
.taxYearMonth(taxDeclareRecord.getTaxCycle())
|
||||
.build());
|
||||
|
||||
// if (paymentRequestPO != null) {
|
||||
// if (paymentRequestPO != null) {
|
||||
List<TaxDeclareStatusPO> statuses = getTaxDeclareStatusService(user).getTaxDeclareStatusByTaxDeclareRecordId(taxDeclareRecord.getId());
|
||||
statuses.forEach(status -> {
|
||||
requestParam.put("sblx", status.getReportType());
|
||||
String url = apiConfig.getHost() + SzyhApiConstant.CANCEL_WITHHOLDING_VOUCHER;
|
||||
QuerySpecialAmountResponse cancelResponse = postRequest(apiConfig, url, requestParam, QuerySpecialAmountResponse.class);
|
||||
SzyhResponseHead head = Optional.ofNullable(cancelResponse).map(QuerySpecialAmountResponse::getHead)
|
||||
.orElse(new SzyhResponseHead("0", SalaryI18nUtil.getI18nLabel(183785, "银联缴款凭证作废失败,请稍后重试")));
|
||||
SalaryAssert.isTrue(SzyhApiConstant.SUCCESS_CODE.equals(head.getCode())
|
||||
|| SzyhApiConstant.NONE_VOUCHER_CODE.equals(head.getCode()), head.getMsg());
|
||||
SalaryAssert.isTrue(SzyhApiConstant.SUCCESS_CODE.equals(head.getCode()) || SzyhApiConstant.NONE_VOUCHER_CODE.equals(head.getCode()), head.getMsg());
|
||||
|
||||
getTaxPaymentRequestMapper().updateFeedbackByRequestTypeTaxAgentIdTaxYearMonth(TaxPaymentRequestPO
|
||||
.builder()
|
||||
|
|
@ -132,7 +171,9 @@ public class TaxPaymentWithholdingServiceImpl extends AbstractTaxPaymentService
|
|||
.taxAgentId(taxDeclareRecord.getTaxAgentId())
|
||||
.taxYearMonth(taxDeclareRecord.getTaxCycle())
|
||||
.build());
|
||||
// }
|
||||
});
|
||||
|
||||
// }
|
||||
}
|
||||
|
||||
protected BaseResponse getFeedbackResponse(TaxDeclarationApiConfigPO apiConfig, String requestId) {
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO;
|
|||
import com.engine.salary.entity.taxagent.response.SzyhResponseHead;
|
||||
import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO;
|
||||
import com.engine.salary.entity.taxdeclaration.po.TaxDeclareRecordPO;
|
||||
import com.engine.salary.entity.taxdeclaration.po.TaxDeclareStatusPO;
|
||||
import com.engine.salary.entity.taxpayment.bo.TaxPaymentBO;
|
||||
import com.engine.salary.entity.taxpayment.dto.TaxFeedbackResultDTO;
|
||||
import com.engine.salary.entity.taxpayment.dto.TaxWithholdingVoucherFeedbackDTO;
|
||||
|
|
@ -23,7 +24,6 @@ import com.engine.salary.enums.taxdeclaration.TaxPaymentStatusEnum;
|
|||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.util.*;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
|
@ -44,7 +44,6 @@ import java.util.stream.Collectors;
|
|||
public class TaxPaymentWithholdingVoucherServiceImpl extends AbstractTaxPaymentService {
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public TaxFeedbackResultDTO getFeedback(TaxPaymentQueryParam param) {
|
||||
WithholdingVoucherFeedbackResponse feedbackResponse = (WithholdingVoucherFeedbackResponse) checkBeforeGetFeedbackResponse(param);
|
||||
// 校验请求结果
|
||||
|
|
@ -100,7 +99,7 @@ public class TaxPaymentWithholdingVoucherServiceImpl extends AbstractTaxPaymentS
|
|||
String url = apiConfig.getHost() + api;
|
||||
Map<String, Object> requestParam = DataCollectionBO.getApiBaseQueryParams(returnPO, taxAgentName, SalaryDateUtil.getFormatYYYYMM(param.getTaxYearMonth()));
|
||||
if (syncStatus) {
|
||||
requestParam.put("bblx", "1");
|
||||
requestParam.put("bblx", param.getReportType());
|
||||
}
|
||||
return postRequest(apiConfig, url, requestParam, clazz);
|
||||
}
|
||||
|
|
@ -114,6 +113,11 @@ public class TaxPaymentWithholdingVoucherServiceImpl extends AbstractTaxPaymentS
|
|||
.taxYearMonth(taxDeclareRecord.getTaxCycle())
|
||||
.build());
|
||||
// if (paymentRequestPO != null) {
|
||||
|
||||
List<TaxDeclareStatusPO> statuses = getTaxDeclareStatusService(user).getTaxDeclareStatusByTaxDeclareRecordId(taxDeclareRecord.getId());
|
||||
statuses.forEach(status -> {
|
||||
requestParam.put("sblx", status.getReportType());
|
||||
|
||||
String url = apiConfig.getHost() + SzyhApiConstant.CANCEL_WITHHOLDING_VOUCHER;
|
||||
QuerySpecialAmountResponse cancelResponse = postRequest(apiConfig, url, requestParam, QuerySpecialAmountResponse.class);
|
||||
SzyhResponseHead head = Optional.ofNullable(cancelResponse).map(QuerySpecialAmountResponse::getHead)
|
||||
|
|
@ -126,11 +130,11 @@ public class TaxPaymentWithholdingVoucherServiceImpl extends AbstractTaxPaymentS
|
|||
.taxAgentId(taxDeclareRecord.getTaxAgentId())
|
||||
.taxYearMonth(taxDeclareRecord.getTaxCycle())
|
||||
.build());
|
||||
});
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void syncWithholdingFeedback(TaxPaymentQueryParam param) {
|
||||
TempWrapper tempWrapper = checkBeforeGetRequestIdResponse(param);
|
||||
SyncWithholdingFeedbackResponse response = getRequestIdResponse(tempWrapper.getTaxReturnPO(), tempWrapper.getTaxAgentPO().getName(),
|
||||
|
|
@ -166,11 +170,9 @@ public class TaxPaymentWithholdingVoucherServiceImpl extends AbstractTaxPaymentS
|
|||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void cancelWithholdingVoucher(TaxPaymentQueryParam param) {
|
||||
TempWrapper tempWrapper = checkBeforeGetRequestIdResponse(param);
|
||||
Map<String, Object> requestParam = DataCollectionBO.getApiBaseQueryParams(tempWrapper.getTaxReturnPO(), tempWrapper.getTaxAgentPO().getName(), SalaryDateUtil.getFormatYYYYMM(param.getTaxYearMonth()));
|
||||
requestParam.put("sblx", 1);
|
||||
cancelWithholdingVoucher(tempWrapper.getApiConfigPO(), tempWrapper.getTaxDeclareRecord(), requestParam);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,11 @@ import com.engine.salary.enums.employeedeclare.GenderEnum;
|
|||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
|
|
@ -16,34 +20,11 @@ import java.util.regex.Pattern;
|
|||
* @version 1.0
|
||||
**/
|
||||
public class SalaryCardUtil {
|
||||
|
||||
/**
|
||||
* 15位的身份证长度
|
||||
*/
|
||||
public static final String CARD_15 = "^[1-9]\\d{5}\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{2}$";
|
||||
/**
|
||||
* 18位的身份证长度
|
||||
*/
|
||||
public static final String CARD_18 = "^[1-9]\\d{5}(18|19|([23]\\d))\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}[0-9Xx]$";
|
||||
/**
|
||||
* 手机号码
|
||||
*/
|
||||
public static final String MOBILE = "^1(3[0-9]|4[01456879]|5[0-35-9]|6[2567]|7[0-8]|8[0-9]|9[0-35-9])\\d{8}$";
|
||||
|
||||
/**
|
||||
* 校验身份证号码
|
||||
*
|
||||
* @param idNumber
|
||||
*/
|
||||
public static boolean checkIdNum(String idNumber) {
|
||||
Pattern pattern_15 = Pattern.compile(CARD_15);
|
||||
Pattern pattern_18 = Pattern.compile(CARD_18);
|
||||
if (!pattern_15.matcher(idNumber).find() && !pattern_18.matcher(idNumber).find()) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验手机号码
|
||||
*
|
||||
|
|
@ -107,4 +88,387 @@ public class SalaryCardUtil {
|
|||
}
|
||||
return LocalDate.parse(year + "-" + month + "-" + day);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 省、直辖市代码表:
|
||||
* 11 : 北京 12 : 天津 13 : 河北 14 : 山西 15 : 内蒙古
|
||||
* 21 : 辽宁 22 : 吉林 23 : 黑龙江 31 : 上海 32 : 江苏
|
||||
* 33 : 浙江 34 : 安徽 35 : 福建 36 : 江西 37 : 山东
|
||||
* 41 : 河南 42 : 湖北 43 : 湖南 44 : 广东 45 : 广西 46 : 海南
|
||||
* 50 : 重庆 51 : 四川 52 : 贵州 53 : 云南 54 : 西藏
|
||||
* 61 : 陕西 62 : 甘肃 63 : 青海 64 : 宁夏 65 : 新疆
|
||||
* 71 : 台湾
|
||||
* 81 : 香港 82 : 澳门
|
||||
* 91 : 国外
|
||||
* </pre>
|
||||
*/
|
||||
private static String[] cityCode = { "11", "12", "13", "14", "15", "21",
|
||||
"22", "23", "31", "32", "33", "34", "35", "36", "37", "41", "42",
|
||||
"43", "44", "45", "46", "50", "51", "52", "53", "54", "61", "62",
|
||||
"63", "64", "65", "71", "81", "82", "91" };
|
||||
|
||||
/**
|
||||
* 每位加权因子
|
||||
*/
|
||||
private static int power[] = { 7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5,
|
||||
8, 4, 2 };
|
||||
|
||||
/**
|
||||
* 验证所有的身份证的合法性
|
||||
*
|
||||
* @param idcard
|
||||
* 身份证
|
||||
* @return 合法返回true,否则返回false
|
||||
*/
|
||||
public static boolean checkIdNum(String idcard) {
|
||||
if (idcard == null || "".equals(idcard)) {
|
||||
return false;
|
||||
}
|
||||
if (idcard.length() == 15) {
|
||||
return validate15IDCard(idcard);
|
||||
}
|
||||
if(idcard.length()==18) {
|
||||
return validate18Idcard(idcard);
|
||||
}
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 判断18位身份证的合法性
|
||||
* </p>
|
||||
* 根据〖中华人民共和国国家标准GB11643-1999〗中有关公民身份号码的规定,公民身份号码是特征组合码,由十七位数字本体码和一位数字校验码组成。
|
||||
* 排列顺序从左至右依次为:六位数字地址码,八位数字出生日期码,三位数字顺序码和一位数字校验码。
|
||||
* <p>
|
||||
* 顺序码: 表示在同一地址码所标识的区域范围内,对同年、同月、同 日出生的人编定的顺序号,顺序码的奇数分配给男性,偶数分配 给女性。
|
||||
* </p>
|
||||
* <p>
|
||||
* 1.前1、2位数字表示:所在省份的代码; 2.第3、4位数字表示:所在城市的代码; 3.第5、6位数字表示:所在区县的代码;
|
||||
* 4.第7~14位数字表示:出生年、月、日; 5.第15、16位数字表示:所在地的派出所的代码;
|
||||
* 6.第17位数字表示性别:奇数表示男性,偶数表示女性;
|
||||
* 7.第18位数字是校检码:也有的说是个人信息码,一般是随计算机的随机产生,用来检验身份证的正确性。校检码可以是0~9的数字,有时也用x表示。
|
||||
* </p>
|
||||
* <p>
|
||||
* 第十八位数字(校验码)的计算方法为: 1.将前面的身份证号码17位数分别乘以不同的系数。从第一位到第十七位的系数分别为:7 9 10 5 8 4
|
||||
* 2 1 6 3 7 9 10 5 8 4 2
|
||||
* </p>
|
||||
* <p>
|
||||
* 2.将这17位数字和系数相乘的结果相加。
|
||||
* </p>
|
||||
* <p>
|
||||
* 3.用加出来和除以11,看余数是多少
|
||||
* </p>
|
||||
* 4.余数只可能有0 1 2 3 4 5 6 7 8 9 10这11个数字。其分别对应的最后一位身份证的号码为1 0 X 9 8 7 6 5 4 3
|
||||
* 2。
|
||||
* <p>
|
||||
* 5.通过上面得知如果余数是2,就会在身份证的第18位数字上出现罗马数字的Ⅹ。如果余数是10,身份证的最后一位号码就是2。
|
||||
* </p>
|
||||
*
|
||||
* @param idcard
|
||||
* @return
|
||||
*/
|
||||
public static boolean validate18Idcard(String idcard) {
|
||||
if (idcard == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// 非18位为假
|
||||
int s=18;
|
||||
if (idcard.length() != s) {
|
||||
return false;
|
||||
}
|
||||
// 获取前17位
|
||||
String idcard17 = idcard.substring(0, 17);
|
||||
|
||||
// 前17位全部为数字
|
||||
if (!isDigital(idcard17)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
String provinceid = idcard.substring(0, 2);
|
||||
// 校验省份
|
||||
if (!checkProvinceid(provinceid)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// 校验出生日期
|
||||
String birthday = idcard.substring(6, 14);
|
||||
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
|
||||
|
||||
try {
|
||||
Date birthDate = sdf.parse(birthday);
|
||||
String tmpDate = sdf.format(birthDate);
|
||||
// 出生年月日不正确
|
||||
if (!tmpDate.equals(birthday)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
} catch (ParseException e1) {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// 获取第18位
|
||||
String idcard18Code = idcard.substring(17, 18);
|
||||
|
||||
char c[] = idcard17.toCharArray();
|
||||
|
||||
int bit[] = converCharToInt(c);
|
||||
|
||||
int sum17 = 0;
|
||||
|
||||
sum17 = getPowerSum(bit);
|
||||
|
||||
// 将和值与11取模得到余数进行校验码判断
|
||||
String checkCode = getCheckCodeBySum(sum17);
|
||||
if (null == checkCode) {
|
||||
return false;
|
||||
}
|
||||
// 将身份证的第18位与算出来的校码进行匹配,不相等就为假
|
||||
if (!idcard18Code.equalsIgnoreCase(checkCode)) {
|
||||
return false;
|
||||
}
|
||||
//System.out.println("正确");
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验15位身份证
|
||||
*
|
||||
* <pre>
|
||||
* 只校验省份和出生年月日
|
||||
* </pre>
|
||||
*
|
||||
* @param idcard
|
||||
* @return
|
||||
*/
|
||||
public static boolean validate15IDCard(String idcard) {
|
||||
if (idcard == null) {
|
||||
return false;
|
||||
}
|
||||
// 非15位为假
|
||||
int s=15;
|
||||
if (idcard.length() != s) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// 15全部为数字
|
||||
if (!isDigital(idcard)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
String provinceid = idcard.substring(0, 2);
|
||||
// 校验省份
|
||||
if (!checkProvinceid(provinceid)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
String birthday = idcard.substring(6, 12);
|
||||
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyMMdd");
|
||||
|
||||
try {
|
||||
Date birthDate = sdf.parse(birthday);
|
||||
String tmpDate = sdf.format(birthDate);
|
||||
// 身份证日期错误
|
||||
if (!tmpDate.equals(birthday)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
} catch (ParseException e1) {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将15位的身份证转成18位身份证
|
||||
*
|
||||
* @param idcard
|
||||
* @return
|
||||
*/
|
||||
public static String convertIdcarBy15bit(String idcard) {
|
||||
if (idcard == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// 非15位身份证
|
||||
int s=15;
|
||||
if (idcard.length() != s) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// 15全部为数字
|
||||
if (!isDigital(idcard)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
String provinceid = idcard.substring(0, 2);
|
||||
// 校验省份
|
||||
if (!checkProvinceid(provinceid)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
String birthday = idcard.substring(6, 12);
|
||||
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyMMdd");
|
||||
|
||||
Date birthdate = null;
|
||||
try {
|
||||
birthdate = sdf.parse(birthday);
|
||||
String tmpDate = sdf.format(birthdate);
|
||||
// 身份证日期错误
|
||||
if (!tmpDate.equals(birthday)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
} catch (ParseException e1) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Calendar cday = Calendar.getInstance();
|
||||
cday.setTime(birthdate);
|
||||
String year = String.valueOf(cday.get(Calendar.YEAR));
|
||||
|
||||
String idcard17 = idcard.substring(0, 6) + year + idcard.substring(8);
|
||||
|
||||
char c[] = idcard17.toCharArray();
|
||||
String checkCode = "";
|
||||
|
||||
// 将字符数组转为整型数组
|
||||
int bit[] = converCharToInt(c);
|
||||
|
||||
int sum17 = 0;
|
||||
sum17 = getPowerSum(bit);
|
||||
|
||||
// 获取和值与11取模得到余数进行校验码
|
||||
checkCode = getCheckCodeBySum(sum17);
|
||||
|
||||
// 获取不到校验位
|
||||
if (null == checkCode) {
|
||||
return null;
|
||||
}
|
||||
// 将前17位与第18位校验码拼接
|
||||
idcard17 += checkCode;
|
||||
return idcard17;
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验省份
|
||||
*
|
||||
* @param provinceid
|
||||
* @return 合法返回TRUE,否则返回FALSE
|
||||
*/
|
||||
private static boolean checkProvinceid(String provinceid) {
|
||||
for (String id : cityCode) {
|
||||
if (id.equals(provinceid)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 数字验证
|
||||
*
|
||||
* @param str
|
||||
* @return
|
||||
*/
|
||||
private static boolean isDigital(String str) {
|
||||
return str.matches("^[0-9]*$");
|
||||
}
|
||||
|
||||
/**
|
||||
* 将身份证的每位和对应位的加权因子相乘之后,再得到和值
|
||||
*
|
||||
* @param bit
|
||||
* @return
|
||||
*/
|
||||
private static int getPowerSum(int[] bit) {
|
||||
|
||||
int sum = 0;
|
||||
|
||||
if (power.length != bit.length) {
|
||||
return sum;
|
||||
}
|
||||
|
||||
for (int i = 0; i < bit.length; i++) {
|
||||
for (int j = 0; j < power.length; j++) {
|
||||
if (i == j) {
|
||||
sum = sum + bit[i] * power[j];
|
||||
}
|
||||
}
|
||||
}
|
||||
return sum;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将和值与11取模得到余数进行校验码判断
|
||||
*
|
||||
* @param sum17
|
||||
* @param sum17
|
||||
* @return 校验位
|
||||
*/
|
||||
private static String getCheckCodeBySum(int sum17) {
|
||||
String checkCode = null;
|
||||
switch (sum17 % 11) {
|
||||
case 10:
|
||||
checkCode = "2";
|
||||
break;
|
||||
case 9:
|
||||
checkCode = "3";
|
||||
break;
|
||||
case 8:
|
||||
checkCode = "4";
|
||||
break;
|
||||
case 7:
|
||||
checkCode = "5";
|
||||
break;
|
||||
case 6:
|
||||
checkCode = "6";
|
||||
break;
|
||||
case 5:
|
||||
checkCode = "7";
|
||||
break;
|
||||
case 4:
|
||||
checkCode = "8";
|
||||
break;
|
||||
case 3:
|
||||
checkCode = "9";
|
||||
break;
|
||||
case 2:
|
||||
checkCode = "x";
|
||||
break;
|
||||
case 1:
|
||||
checkCode = "0";
|
||||
break;
|
||||
case 0:
|
||||
checkCode = "1";
|
||||
break;
|
||||
default:
|
||||
}
|
||||
return checkCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将字符数组转为整型数组
|
||||
*
|
||||
* @param c
|
||||
* @return
|
||||
* @throws NumberFormatException
|
||||
*/
|
||||
private static int[] converCharToInt(char[] c) throws NumberFormatException {
|
||||
int[] a = new int[c.length];
|
||||
int k = 0;
|
||||
for (char temp : c) {
|
||||
a[k++] = Integer.parseInt(String.valueOf(temp));
|
||||
}
|
||||
return a;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -242,6 +242,22 @@ public class EmployeeDeclareController {
|
|||
return new ResponseResult<EmployeeDeclareParam, String>(user).run(getEmployeeDeclareWrapper(user)::getDeclareFeedback, employeeDeclareParam);
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/invalid")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String invalid(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeInvalidParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<EmployeeInvalidParam, String>(user).run(getEmployeeDeclareWrapper(user)::invalid, param);
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/informationChange")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String informationChange(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeInformationChangeParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<EmployeeInformationChangeParam, String>(user).run(getEmployeeDeclareWrapper(user)::informationChange, param);
|
||||
}
|
||||
|
||||
/**
|
||||
* 人员报送-后端业务逻辑是否已经完成
|
||||
*
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.engine.salary.web;
|
|||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.salary.entity.taxdeclaration.dto.*;
|
||||
import com.engine.salary.entity.taxdeclaration.param.*;
|
||||
import com.engine.salary.entity.taxdeclaration.po.TaxDeclareStatusPO;
|
||||
import com.engine.salary.enums.salarysob.IncomeCategoryEnum;
|
||||
import com.engine.salary.service.TaxDeclarationExcelService;
|
||||
import com.engine.salary.service.TaxDeclarationService;
|
||||
|
|
@ -90,18 +91,32 @@ public class TaxDeclarationController {
|
|||
return new ResponseResult<Long, Map>(user).run(getTaxDeclareRecordWrapper(user)::getForm, id);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 个税申报表相关信息
|
||||
* 个税申报左侧分类
|
||||
*
|
||||
* @param id 个税申报记录id
|
||||
* @return
|
||||
*/
|
||||
@GET
|
||||
@Path("/getTaxReports")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String getTaxReportType(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "id") Long id) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<Long, List<TaxDeclareStatusPO>>(user).run(getTaxDeclareRecordWrapper(user)::getTaxReports, id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 个税申报表相关信息
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/getTaxDeclarationInfo")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String getTaxDeclarationInfo(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "id") Long id) {
|
||||
public String getTaxDeclarationInfo(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclareRecordParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<Long, TaxDeclarationInfoDTO>(user).run(getTaxDeclareRecordWrapper(user)::getTaxDeclarationInfoById, id);
|
||||
return new ResponseResult<TaxDeclareRecordParam, TaxDeclarationInfoDTO>(user).run(getTaxDeclareRecordWrapper(user)::getTaxDeclarationInfoById, param);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -164,15 +179,14 @@ public class TaxDeclarationController {
|
|||
/**
|
||||
* 获取个税申报记录下的个税申报表TAB
|
||||
*
|
||||
* @param id 个税申报记录id
|
||||
* @return
|
||||
*/
|
||||
@GET
|
||||
@POST
|
||||
@Path("/getTaxDeclarationTab")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String getTaxDeclarationTab(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "id") Long id) {
|
||||
public String getTaxDeclarationTab(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclareRecordParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<Long, List<TaxDeclarationTabDTO>>(user).run(getTaxDeclareRecordWrapper(user)::getTaxDeclarationTab, id);
|
||||
return new ResponseResult<TaxDeclareRecordParam, List<TaxDeclarationTabDTO>>(user).run(getTaxDeclareRecordWrapper(user)::getTaxDeclarationTab, param);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -184,7 +198,7 @@ public class TaxDeclarationController {
|
|||
@POST
|
||||
@Path("/addTaxDeclaration")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String addTaxDeclarationTab(@Context HttpServletRequest request, @Context HttpServletResponse response, TaxDeclarationAddParam param) {
|
||||
public String addTaxDeclarationTab(@Context HttpServletRequest request, @Context HttpServletResponse response,@RequestBody TaxDeclarationAddParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<TaxDeclarationAddParam, String>(user).run(getTaxDeclareRecordWrapper(user)::addTaxDeclaration, param);
|
||||
}
|
||||
|
|
@ -200,7 +214,7 @@ public class TaxDeclarationController {
|
|||
@POST
|
||||
@Path("/deleteTaxDeclaration")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String deleteTaxDeclaration(@Context HttpServletRequest request, @Context HttpServletResponse response, TaxDeclarationDeleteParam param) {
|
||||
public String deleteTaxDeclaration(@Context HttpServletRequest request, @Context HttpServletResponse response,@RequestBody TaxDeclarationDeleteParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<TaxDeclarationDeleteParam, String>(user).run(getTaxDeclareRecordWrapper(user)::deleteTaxDeclaration, param);
|
||||
}
|
||||
|
|
@ -217,7 +231,7 @@ public class TaxDeclarationController {
|
|||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String declare(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclareRecordParam taxDeclareRecordParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<Long, String>(user).run(getTaxDeclareRecordWrapper(user)::declare, taxDeclareRecordParam.getTaxDeclareRecordId());
|
||||
return new ResponseResult<TaxDeclareRecordParam, String>(user).run(getTaxDeclareRecordWrapper(user)::declare, taxDeclareRecordParam);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -231,7 +245,7 @@ public class TaxDeclarationController {
|
|||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String getDeclareFeedback(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclareRecordParam taxDeclareRecordParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<Long, String>(user).run(getTaxDeclareRecordWrapper(user)::getDeclareFeedback, taxDeclareRecordParam.getTaxDeclareRecordId());
|
||||
return new ResponseResult<TaxDeclareRecordParam, String>(user).run(getTaxDeclareRecordWrapper(user)::getDeclareFeedback, taxDeclareRecordParam);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -291,7 +305,7 @@ public class TaxDeclarationController {
|
|||
@POST
|
||||
@Path("/contrast")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String contrast(@Context HttpServletRequest request, @Context HttpServletResponse response,@RequestBody ContrastQueryParam param) {
|
||||
public String contrast(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody ContrastQueryParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<ContrastQueryParam, Map<String, Object>>(user).run(getTaxDeclareRecordWrapper(user)::contrast, param);
|
||||
}
|
||||
|
|
@ -340,7 +354,7 @@ public class TaxDeclarationController {
|
|||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String cancel(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclareRecordParam taxDeclareRecordParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<Long, String>(user).run(getTaxDeclareRecordWrapper(user)::cancelDeclare, taxDeclareRecordParam.getTaxDeclareRecordId());
|
||||
return new ResponseResult<TaxDeclareRecordParam, String>(user).run(getTaxDeclareRecordWrapper(user)::cancelDeclare, taxDeclareRecordParam);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -354,7 +368,7 @@ public class TaxDeclarationController {
|
|||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String getCancelFeedback(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclareRecordParam taxDeclareRecordParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<Long, String>(user).run(getTaxDeclareRecordWrapper(user)::getCancelFeedback, taxDeclareRecordParam.getTaxDeclareRecordId());
|
||||
return new ResponseResult<TaxDeclareRecordParam, String>(user).run(getTaxDeclareRecordWrapper(user)::getCancelFeedback, taxDeclareRecordParam);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -368,7 +382,7 @@ public class TaxDeclarationController {
|
|||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String updateDeclare(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclareRecordParam taxDeclareRecordParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<Long, String>(user).run(getTaxDeclareRecordWrapper(user)::updateDeclare, taxDeclareRecordParam.getTaxDeclareRecordId());
|
||||
return new ResponseResult<TaxDeclareRecordParam, String>(user).run(getTaxDeclareRecordWrapper(user)::updateDeclare, taxDeclareRecordParam);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -377,13 +391,13 @@ public class TaxDeclarationController {
|
|||
* @param taxDeclareRecordParam 撤销更正申报参数
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/cancelCorrect")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String cancelCorrect(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclareRecordParam taxDeclareRecordParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<Long, String>(user).run(getTaxDeclareRecordWrapper(user)::cancelCorrect, taxDeclareRecordParam.getTaxDeclareRecordId());
|
||||
}
|
||||
// @POST
|
||||
// @Path("/cancelCorrect")
|
||||
// @Produces(MediaType.APPLICATION_JSON)
|
||||
// public String cancelCorrect(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclareRecordParam taxDeclareRecordParam) {
|
||||
// User user = HrmUserVarify.getUser(request, response);
|
||||
// return new ResponseResult<Long, String>(user).run(getTaxDeclareRecordWrapper(user)::cancelCorrect, taxDeclareRecordParam.getTaxDeclareRecordId());
|
||||
// }
|
||||
|
||||
/**
|
||||
* 税局端申报状态查询
|
||||
|
|
@ -410,7 +424,7 @@ public class TaxDeclarationController {
|
|||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String queryCompanyIncomes(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclareRecordParam taxDeclareRecordParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<Long, String>(user).run(getTaxDeclareRecordWrapper(user)::queryCompanyIncomes, taxDeclareRecordParam.getTaxDeclareRecordId());
|
||||
return new ResponseResult<TaxDeclareRecordParam, String>(user).run(getTaxDeclareRecordWrapper(user)::queryCompanyIncomes,taxDeclareRecordParam);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -508,8 +522,6 @@ public class TaxDeclarationController {
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 个税申报表详情列表
|
||||
*
|
||||
|
|
|
|||
|
|
@ -279,8 +279,12 @@ public class EmployeeDeclareWrapper extends Service {
|
|||
.setEmployee(Collections.singletonList(employeeMap))
|
||||
.setEmployeeName(employeeDeclare.getEmployeeName())
|
||||
.setJobNum(employeeDeclare.getJobNum())
|
||||
.setNationality(SalaryI18nUtil.getI18nLabel(94731, "中国"))
|
||||
.setCardType(CardTypeEnum.RESIDENT_IDENTITY_CARDS)
|
||||
.setNationality(employeeDeclare.getNationality())
|
||||
.setNationality(employeeDeclare.getNationality())
|
||||
.setNationality(employeeDeclare.getNationality())
|
||||
.setEntryDate(employeeDeclare.getEntryDate())
|
||||
.setDepartureDate(employeeDeclare.getDepartureDate())
|
||||
.setCardType(CardTypeEnum.getByValue(employeeDeclare.getCardType()))
|
||||
.setCardNum(employeeDeclare.getCardNum())
|
||||
.setGender(SalaryEnumUtil.enumMatchByValue(employeeDeclare.getGender(), GenderEnum.class))
|
||||
.setBirthday(employeeDeclare.getBirthday())
|
||||
|
|
@ -294,7 +298,9 @@ public class EmployeeDeclareWrapper extends Service {
|
|||
.setLonelyOld(SalaryEnumUtil.enumMatchByValue(employeeDeclare.getLonelyOld(), SalaryOnOffEnum.class))
|
||||
.setMartyrDependents(SalaryEnumUtil.enumMatchByValue(employeeDeclare.getMartyrDependents(), SalaryOnOffEnum.class))
|
||||
.setMartyrDependentsCardNo(employeeDeclare.getMartyrDependentsCardNo())
|
||||
.setDeductExpenses(SalaryEnumUtil.enumMatchByValue(employeeDeclare.getDeductExpenses(), SalaryOnOffEnum.class));
|
||||
.setDeductExpenses(SalaryEnumUtil.enumMatchByValue(employeeDeclare.getDeductExpenses(), SalaryOnOffEnum.class))
|
||||
.setBirthplace(employeeDeclare.getBirthplace())
|
||||
.setTaxReasons(employeeDeclare.getTaxReasons());
|
||||
} else {
|
||||
employeeDeclare = null;
|
||||
}
|
||||
|
|
@ -537,6 +543,17 @@ public class EmployeeDeclareWrapper extends Service {
|
|||
return employeeDeclareRate.getIndex();
|
||||
}
|
||||
|
||||
public String invalid(EmployeeInvalidParam param) {
|
||||
return getEmployeeDeclareService(user).invalid(param);
|
||||
}
|
||||
|
||||
public String informationChange(EmployeeInformationChangeParam param) {
|
||||
return getEmployeeDeclareService(user).informationChange(param);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取人员报送相关后端接口是否已经完成
|
||||
*
|
||||
|
|
|
|||
|
|
@ -2,9 +2,9 @@ package com.engine.salary.wrapper;
|
|||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.hrmelog.entity.dto.LoggerContext;
|
||||
import com.engine.salary.cache.SalaryCacheKey;
|
||||
import com.engine.salary.config.SalaryElogConfig;
|
||||
import com.engine.hrmelog.entity.dto.LoggerContext;
|
||||
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
||||
import com.engine.salary.entity.employeedeclare.param.EmployeeDeclareListQueryParam;
|
||||
import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO;
|
||||
|
|
@ -17,6 +17,7 @@ import com.engine.salary.enums.OperateTypeEnum;
|
|||
import com.engine.salary.enums.employeedeclare.CardTypeEnum;
|
||||
import com.engine.salary.enums.employeedeclare.DeclareStatusEnum;
|
||||
import com.engine.salary.enums.employeedeclare.EmploymentStatusEnum;
|
||||
import com.engine.salary.enums.salarysob.DeclareReportTypeEnum;
|
||||
import com.engine.salary.enums.salarysob.IncomeCategoryEnum;
|
||||
import com.engine.salary.enums.taxdeclaration.TaxDeclareStatusEnum;
|
||||
import com.engine.salary.enums.taxdeclaration.TaxDeclareTypeEnum;
|
||||
|
|
@ -27,12 +28,13 @@ import com.engine.salary.util.SalaryDateUtil;
|
|||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.engine.salary.util.SalaryEnumUtil;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import com.engine.salary.util.db.IdGenerator;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import com.engine.salary.util.page.SalaryPageUtil;
|
||||
import com.engine.salary.util.valid.ValidUtil;
|
||||
import com.weaver.util.threadPool.ThreadPoolUtil;
|
||||
import com.weaver.util.threadPool.constant.ModulePoolEnum;
|
||||
import com.weaver.util.threadPool.entity.LocalRunnable;
|
||||
import com.engine.salary.util.db.IdGenerator;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.compress.utils.Lists;
|
||||
|
|
@ -62,6 +64,10 @@ public class TaxDeclareRecordWrapper extends Service {
|
|||
return ServiceUtil.getService(TaxDeclareRecordServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private TaxDeclareStatusService getTaxDeclareStatusService(User user) {
|
||||
return ServiceUtil.getService(TaxDeclareStatusServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private TaxAgentService getTaxAgentService(User user) {
|
||||
return ServiceUtil.getService(TaxAgentServiceImpl.class, user);
|
||||
}
|
||||
|
|
@ -287,18 +293,22 @@ public class TaxDeclareRecordWrapper extends Service {
|
|||
/**
|
||||
* 获取个税申报记录下的个税申报表TAB
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
public List<TaxDeclarationTabDTO> getTaxDeclarationTab(Long id) {
|
||||
public List<TaxDeclarationTabDTO> getTaxDeclarationTab(TaxDeclareRecordParam param) {
|
||||
ValidUtil.doValidator(param);
|
||||
|
||||
// 查询个税申报记录
|
||||
TaxDeclareRecordPO taxDeclareRecord = getTaxDeclareRecordService(user).getById(id);
|
||||
TaxDeclareRecordPO taxDeclareRecord = getTaxDeclareRecordService(user).getById(param.getTaxDeclareRecordId());
|
||||
|
||||
// 查询个税申报记录下的个税申报表
|
||||
List<TaxDeclarationPO> taxDeclarations = getTaxDeclarationService(user).listByTaxCycleAndTaxAgentIds(SalaryDateUtil.localDate2YearMonth(taxDeclareRecord.getTaxCycle()),
|
||||
Collections.singleton(taxDeclareRecord.getTaxAgentId()));
|
||||
// taxDeclarations = taxDeclarations.stream()
|
||||
// .filter(e -> Objects.equals(e.getControlView(), 0) || Objects.equals(e.getCreator(), (long)user.getUID()))
|
||||
// .collect(Collectors.toList());
|
||||
|
||||
//筛选申报类型
|
||||
DeclareReportTypeEnum declareReportTypeEnum = DeclareReportTypeEnum.parseByValue(param.getReportType());
|
||||
taxDeclarations = taxDeclarations.stream().filter(po -> IncomeCategoryEnum.parseByValue(po.getIncomeCategory()).getReportType() == declareReportTypeEnum).collect(Collectors.toList());
|
||||
|
||||
Map<Integer, TaxDeclarationPO> taxDeclarationMap = SalaryEntityUtil.convert2Map(taxDeclarations, TaxDeclarationPO::getIncomeCategory);
|
||||
List<TaxDeclarationTabDTO> tabs = Lists.newArrayList();
|
||||
for (IncomeCategoryEnum incomeCategoryEnum : IncomeCategoryEnum.values()) {
|
||||
|
|
@ -331,12 +341,14 @@ public class TaxDeclareRecordWrapper extends Service {
|
|||
/**
|
||||
* 查询个税申报表的基本信息
|
||||
*
|
||||
* @param id 个税申报表id
|
||||
* @return
|
||||
*/
|
||||
public TaxDeclarationInfoDTO getTaxDeclarationInfoById(Long id) {
|
||||
public TaxDeclarationInfoDTO getTaxDeclarationInfoById(TaxDeclareRecordParam param) {
|
||||
ValidUtil.doValidator(param);
|
||||
|
||||
// 查询个税申报表
|
||||
TaxDeclareRecordPO taxDeclareRecord = getTaxDeclareRecordService(user).getById(id);
|
||||
Long taxDeclareRecordId = param.getTaxDeclareRecordId();
|
||||
TaxDeclareRecordPO taxDeclareRecord = getTaxDeclareRecordService(user).getById(taxDeclareRecordId);
|
||||
if (Objects.isNull(taxDeclareRecord)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98877, "个税申报表不存在或已删除"));
|
||||
}
|
||||
|
|
@ -352,8 +364,11 @@ public class TaxDeclareRecordWrapper extends Service {
|
|||
List<TaxDeclareFailPO> taxDeclareFails = getTaxDeclareFailService(user).listByTaxDeclareRecordIds(Collections.singleton(taxDeclareRecord.getId()));
|
||||
// 查询个税扣缴义务人
|
||||
TaxAgentPO taxAgentPO = getTaxAgentService(user).getById(taxDeclareRecord.getTaxAgentId());
|
||||
TaxDeclareTypeEnum taxDeclareTypeEnum = SalaryEnumUtil.enumMatchByValue(taxDeclareRecord.getTaxDeclareType(), TaxDeclareTypeEnum.class);
|
||||
TaxDeclareStatusEnum taxDeclareStatusEnum = SalaryEnumUtil.enumMatchByValue(taxDeclareRecord.getTaxDeclareStatus(), TaxDeclareStatusEnum.class);
|
||||
|
||||
TaxDeclareStatusPO taxDeclareStatus = getTaxDeclareStatusService(user).getTaxDeclareStatus(taxDeclareRecordId, param.getReportType());
|
||||
TaxDeclareTypeEnum taxDeclareTypeEnum = SalaryEnumUtil.enumMatchByValue(taxDeclareStatus.getTaxDeclareType(), TaxDeclareTypeEnum.class);
|
||||
TaxDeclareStatusEnum taxDeclareStatusEnum = SalaryEnumUtil.enumMatchByValue(taxDeclareStatus.getTaxDeclareStatus(), TaxDeclareStatusEnum.class);
|
||||
|
||||
return TaxDeclarationInfoDTO.builder()
|
||||
.salaryMonth(taxDeclareRecord.getSalaryMonth())
|
||||
.taxCycle(taxDeclareRecord.getTaxCycle())
|
||||
|
|
@ -363,11 +378,11 @@ public class TaxDeclareRecordWrapper extends Service {
|
|||
.declareTypeDesc(taxDeclareTypeEnum == null ? "" : SalaryI18nUtil.getI18nLabel(taxDeclareTypeEnum.getLabelId(), taxDeclareTypeEnum.getDefaultLabel()))
|
||||
.declareStatus(taxDeclareStatusEnum)
|
||||
.declareStatusDesc(taxDeclareStatusEnum == null ? "" : SalaryI18nUtil.getI18nLabel(taxDeclareStatusEnum.getLabelId(), taxDeclareStatusEnum.getDefaultLabel()))
|
||||
.declareErrorMsg(taxDeclareRecord.getTaxDeclareErrorMsg())
|
||||
.declareErrorMsg(taxDeclareStatus.getTaxDeclareErrorMsg())
|
||||
.displayIcon(Objects.equals(taxDeclareRecord.getDisplayUpdateIcon(), 1))
|
||||
.declareFailSize(taxDeclareFails.size())
|
||||
.abnormalSize(notDeclareTaxDeclareEmployees.size() + noValueTaxDeclareEmployees.size())
|
||||
.taxPaidAmount(SalaryEntityUtil.thousandthConvert(taxDeclareRecord.getTaxPaidAmount()))
|
||||
.taxPaidAmount(SalaryEntityUtil.thousandthConvert(taxDeclareStatus.getTaxPaidAmount()))
|
||||
.build();
|
||||
}
|
||||
|
||||
|
|
@ -432,9 +447,12 @@ public class TaxDeclareRecordWrapper extends Service {
|
|||
/**
|
||||
* 申报
|
||||
*
|
||||
* @param id
|
||||
* @param
|
||||
*/
|
||||
public String declare(Long id) {
|
||||
public String declare(TaxDeclareRecordParam taxDeclareRecordParam) {
|
||||
ValidUtil.doValidator(taxDeclareRecordParam);
|
||||
|
||||
Long id = taxDeclareRecordParam.getTaxDeclareRecordId();
|
||||
checkBefore(id);
|
||||
TaxDeclarationRateDTO taxDeclarationRate = new TaxDeclarationRateDTO().setStatus(true).setIndex(Util.null2String(id))
|
||||
.setMsg(SalaryI18nUtil.getI18nLabel(156454, "在线申报"));
|
||||
|
|
@ -443,7 +461,7 @@ public class TaxDeclareRecordWrapper extends Service {
|
|||
@Override
|
||||
public void execute() {
|
||||
try {
|
||||
getTaxDeclareRecordService(user).declare(id);
|
||||
getTaxDeclareRecordService(user).declare(id, taxDeclareRecordParam.getReportType());
|
||||
taxDeclarationRate.setFinish(true);
|
||||
} catch (SalaryRunTimeException e) {
|
||||
taxDeclarationRate.setStatus(false).setFinish(true).setMsg(e.getMessage());
|
||||
|
|
@ -461,10 +479,11 @@ public class TaxDeclareRecordWrapper extends Service {
|
|||
|
||||
/**
|
||||
* 获取申报反馈
|
||||
*
|
||||
* @param id
|
||||
*/
|
||||
public String getDeclareFeedback(Long id) {
|
||||
public String getDeclareFeedback(TaxDeclareRecordParam param) {
|
||||
ValidUtil.doValidator(param);
|
||||
|
||||
Long id = param.getTaxDeclareRecordId();
|
||||
checkBefore(id);
|
||||
TaxDeclarationRateDTO taxDeclarationRate = new TaxDeclarationRateDTO().setStatus(true).setIndex(Util.null2String(id))
|
||||
.setMsg(SalaryI18nUtil.getI18nLabel(182680, "获取申报反馈"));
|
||||
|
|
@ -473,7 +492,7 @@ public class TaxDeclareRecordWrapper extends Service {
|
|||
@Override
|
||||
public void execute() {
|
||||
try {
|
||||
getTaxDeclareRecordService(user).getDeclareFeedback(id, taxDeclarationRate);
|
||||
getTaxDeclareRecordService(user).getDeclareFeedback(id, param.getReportType(), taxDeclarationRate);
|
||||
taxDeclarationRate.setFinish(true);
|
||||
} catch (SalaryRunTimeException e) {
|
||||
taxDeclarationRate.setStatus(false).setFinish(true).setMsg(e.getMessage());
|
||||
|
|
@ -501,10 +520,10 @@ public class TaxDeclareRecordWrapper extends Service {
|
|||
|
||||
/**
|
||||
* 作废
|
||||
*
|
||||
* @param id
|
||||
*/
|
||||
public String cancelDeclare(Long id) {
|
||||
public String cancelDeclare(TaxDeclareRecordParam param) {
|
||||
ValidUtil.doValidator(param);
|
||||
Long id = param.getTaxDeclareRecordId();
|
||||
checkBefore(id);
|
||||
TaxDeclarationRateDTO taxDeclarationRate = new TaxDeclarationRateDTO().setStatus(true).setIndex(Util.null2String(id))
|
||||
.setMsg(SalaryI18nUtil.getI18nLabel(158842, "作废申报"));
|
||||
|
|
@ -513,7 +532,7 @@ public class TaxDeclareRecordWrapper extends Service {
|
|||
@Override
|
||||
public void execute() {
|
||||
try {
|
||||
getTaxDeclareRecordService(user).cancelDeclare(id);
|
||||
getTaxDeclareRecordService(user).cancelDeclare(id, param.getReportType());
|
||||
taxDeclarationRate.setFinish(true);
|
||||
} catch (SalaryRunTimeException e) {
|
||||
taxDeclarationRate.setStatus(false).setFinish(true).setMsg(e.getMessage());
|
||||
|
|
@ -531,10 +550,10 @@ public class TaxDeclareRecordWrapper extends Service {
|
|||
|
||||
/**
|
||||
* 获取作废反馈
|
||||
*
|
||||
* @param id
|
||||
*/
|
||||
public String getCancelFeedback(Long id) {
|
||||
public String getCancelFeedback(TaxDeclareRecordParam param) {
|
||||
ValidUtil.doValidator(param);
|
||||
Long id = param.getTaxDeclareRecordId();
|
||||
checkBefore(id);
|
||||
TaxDeclarationRateDTO taxDeclarationRate = new TaxDeclarationRateDTO().setStatus(true).setIndex(Util.null2String(id))
|
||||
.setMsg(SalaryI18nUtil.getI18nLabel(182681, "获取作废申报反馈"));
|
||||
|
|
@ -543,7 +562,7 @@ public class TaxDeclareRecordWrapper extends Service {
|
|||
@Override
|
||||
public void execute() {
|
||||
try {
|
||||
getTaxDeclareRecordService(user).getCancelFeedback(id, taxDeclarationRate);
|
||||
getTaxDeclareRecordService(user).getCancelFeedback(id, param.getReportType(), taxDeclarationRate);
|
||||
taxDeclarationRate.setFinish(true);
|
||||
} catch (SalaryRunTimeException e) {
|
||||
taxDeclarationRate.setStatus(false).setFinish(true).setMsg(e.getMessage());
|
||||
|
|
@ -562,10 +581,11 @@ public class TaxDeclareRecordWrapper extends Service {
|
|||
/**
|
||||
* 更正申报
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
public String updateDeclare(Long id) {
|
||||
public String updateDeclare(TaxDeclareRecordParam param) {
|
||||
ValidUtil.doValidator(param);
|
||||
Long id = param.getTaxDeclareRecordId();
|
||||
checkBefore(id);
|
||||
TaxDeclarationRateDTO taxDeclarationRate = new TaxDeclarationRateDTO().setStatus(true).setIndex(Util.null2String(id))
|
||||
.setMsg(SalaryI18nUtil.getI18nLabel(177637, "更正申报"));
|
||||
|
|
@ -574,7 +594,7 @@ public class TaxDeclareRecordWrapper extends Service {
|
|||
@Override
|
||||
public void execute() {
|
||||
try {
|
||||
getTaxDeclareRecordService(user).updateDeclare(id);
|
||||
getTaxDeclareRecordService(user).updateDeclare(id, param.getReportType());
|
||||
taxDeclarationRate.setFinish(true);
|
||||
} catch (SalaryRunTimeException e) {
|
||||
taxDeclarationRate.setStatus(false).setFinish(true).setMsg(e.getMessage());
|
||||
|
|
@ -634,11 +654,10 @@ public class TaxDeclareRecordWrapper extends Service {
|
|||
/**
|
||||
* 税局端申报明细查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
public String queryCompanyIncomes(Long id) {
|
||||
return getTaxDeclareRecordService(user).queryCompanyIncomes(id);
|
||||
public String queryCompanyIncomes(TaxDeclareRecordParam taxDeclareRecordParam) {
|
||||
return getTaxDeclareRecordService(user).queryCompanyIncomes(taxDeclareRecordParam);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -652,6 +671,7 @@ public class TaxDeclareRecordWrapper extends Service {
|
|||
|
||||
/**
|
||||
* 导出在线对比
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -865,9 +885,13 @@ public class TaxDeclareRecordWrapper extends Service {
|
|||
.replace("{1}", SalaryDateUtil.getFormatYearMonth(taxDeclareRecordPO.getTaxCycle()))
|
||||
.replace("{2}", declarationValuePO.getEmployeeId().toString()));
|
||||
loggerContext.setOperateType(OperateTypeEnum.DELETE.getValue());
|
||||
loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel( 0, "删除个税申报数据"));
|
||||
loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel( 0, "删除个税申报数据"));
|
||||
loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "删除个税申报数据"));
|
||||
loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "删除个税申报数据"));
|
||||
loggerContext.setOldValues(declarationValuePO);
|
||||
SalaryElogConfig.taxDeclarationLoggerTemplate.write(loggerContext);
|
||||
}
|
||||
|
||||
public List<TaxDeclareStatusPO> getTaxReports(Long id) {
|
||||
return getTaxDeclareStatusService(user).updateRecord(id);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,9 +7,9 @@ import java.util.List;
|
|||
|
||||
public class ParseTaxApi {
|
||||
public static void main(String[] args) {
|
||||
// readExcel("H:\\code\\salary\\resource\\sql\\ApiDes.xlsx");
|
||||
readExcel("H:\\code\\salary\\test\\ApiDes.xlsx");
|
||||
|
||||
readExcel2("H:\\code\\salary\\resource\\sql\\ApiDes.xlsx");
|
||||
// readExcel2("H:\\code\\salary\\test\\ApiDes.xlsx");
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue