个税字段配置
This commit is contained in:
parent
6a8c2dd8ac
commit
dc85ba6043
|
|
@ -6,7 +6,6 @@ import lombok.Data;
|
|||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 薪资账套的个税规则
|
||||
|
|
@ -44,12 +43,15 @@ public class SalarySobTaxRuleDTO {
|
|||
private String taxIndex;
|
||||
|
||||
//个税字段和薪资项目的对应关系
|
||||
private Map<String, Object> salaryItem;
|
||||
private Long salaryItemId;
|
||||
private String salaryItemName;
|
||||
|
||||
//个税字段的值
|
||||
private String value;
|
||||
|
||||
//对应关系是否可以编辑
|
||||
private boolean canEdit;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,27 +37,25 @@ public enum IncomeCategoryEnum implements BaseEnum<Integer> {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, SalarySobTaxRuleDTO> parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List<EmployeeDeclarePO> employeeDeclares) {
|
||||
SalarySobTaxRuleDTO salarySobTaxRuleDTO = SalarySobTaxRuleDTO.builder().incomeCategoryId(this.getValue().toString()).incomeCategoryName(this.getDefaultLabel()).build();
|
||||
List<SalarySobTaxRuleDTO.TaxRuleDTO> taxRules = this.getReportType().getTaxRules();
|
||||
public Map<Long, SalarySobTaxRuleDTO> parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List<EmployeeDeclarePO> employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) {
|
||||
List<SalarySobTaxRuleDTO.TaxRuleDTO> taxRules = taxRuleDTO.getTaxRules();
|
||||
|
||||
List<GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result> sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getZcgzxj().getSscglb();
|
||||
Map<String, GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result> idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result::getZzhm);
|
||||
Map<Long,SalarySobTaxRuleDTO> resultMap = new HashMap<>();
|
||||
Map<Long, SalarySobTaxRuleDTO> resultMap = new HashMap<>();
|
||||
for (EmployeeDeclarePO employeeDeclare : employeeDeclares) {
|
||||
GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result result = idNoResultMap.get(employeeDeclare.getCardNum());
|
||||
taxRules.forEach(rule->{
|
||||
taxRules.forEach(rule -> {
|
||||
String getter = "get" + rule.getTaxIndex().substring(0, 1).toUpperCase() + rule.getTaxIndex().substring(1);
|
||||
try {
|
||||
Method method = rule.getClass().getMethod(getter);
|
||||
Object invoke = method.invoke(rule);
|
||||
Method method = result.getClass().getMethod(getter);
|
||||
Object invoke = method.invoke(result);
|
||||
rule.setValue(Util.null2String(invoke));
|
||||
} catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) {
|
||||
log.error("no such method", ex);
|
||||
log.error("getTaxErr no such method {}", getter, ex);
|
||||
}
|
||||
});
|
||||
salarySobTaxRuleDTO.setTaxRules(taxRules);
|
||||
resultMap.put(employeeDeclare.getEmployeeId(),salarySobTaxRuleDTO );
|
||||
resultMap.put(employeeDeclare.getEmployeeId(), taxRuleDTO);
|
||||
}
|
||||
return resultMap;
|
||||
}
|
||||
|
|
@ -71,8 +69,27 @@ public enum IncomeCategoryEnum implements BaseEnum<Integer> {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, SalarySobTaxRuleDTO> parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List<EmployeeDeclarePO> employeeDeclares) {
|
||||
return null;
|
||||
public Map<Long, SalarySobTaxRuleDTO> parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List<EmployeeDeclarePO> employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) {
|
||||
List<SalarySobTaxRuleDTO.TaxRuleDTO> taxRules = taxRuleDTO.getTaxRules();
|
||||
|
||||
List<GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result> sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getLwbclb().getSscglb();
|
||||
Map<String, GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result> idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result::getZzhm);
|
||||
Map<Long, SalarySobTaxRuleDTO> resultMap = new HashMap<>();
|
||||
for (EmployeeDeclarePO employeeDeclare : employeeDeclares) {
|
||||
GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result result = idNoResultMap.get(employeeDeclare.getCardNum());
|
||||
taxRules.forEach(rule -> {
|
||||
String getter = "get" + rule.getTaxIndex().substring(0, 1).toUpperCase() + rule.getTaxIndex().substring(1);
|
||||
try {
|
||||
Method method = result.getClass().getMethod(getter);
|
||||
Object invoke = method.invoke(result);
|
||||
rule.setValue(Util.null2String(invoke));
|
||||
} catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) {
|
||||
log.error("getTaxErr no such method {}", getter, ex);
|
||||
}
|
||||
});
|
||||
resultMap.put(employeeDeclare.getEmployeeId(), taxRuleDTO);
|
||||
}
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
},
|
||||
|
|
@ -85,8 +102,27 @@ public enum IncomeCategoryEnum implements BaseEnum<Integer> {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, SalarySobTaxRuleDTO> parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List<EmployeeDeclarePO> employeeDeclares) {
|
||||
return null;
|
||||
public Map<Long, SalarySobTaxRuleDTO> parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List<EmployeeDeclarePO> employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) {
|
||||
List<SalarySobTaxRuleDTO.TaxRuleDTO> taxRules = taxRuleDTO.getTaxRules();
|
||||
|
||||
List<GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result> sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getQnycxjjsslb().getSscglb();
|
||||
Map<String, GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result> idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result::getZzhm);
|
||||
Map<Long, SalarySobTaxRuleDTO> resultMap = new HashMap<>();
|
||||
for (EmployeeDeclarePO employeeDeclare : employeeDeclares) {
|
||||
GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result result = idNoResultMap.get(employeeDeclare.getCardNum());
|
||||
taxRules.forEach(rule -> {
|
||||
String getter = "get" + rule.getTaxIndex().substring(0, 1).toUpperCase() + rule.getTaxIndex().substring(1);
|
||||
try {
|
||||
Method method = result.getClass().getMethod(getter);
|
||||
Object invoke = method.invoke(result);
|
||||
rule.setValue(Util.null2String(invoke));
|
||||
} catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) {
|
||||
log.error("getTaxErr no such method {}", getter, ex);
|
||||
}
|
||||
});
|
||||
resultMap.put(employeeDeclare.getEmployeeId(), taxRuleDTO);
|
||||
}
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
},
|
||||
|
|
@ -99,8 +135,27 @@ public enum IncomeCategoryEnum implements BaseEnum<Integer> {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, SalarySobTaxRuleDTO> parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List<EmployeeDeclarePO> employeeDeclares) {
|
||||
return null;
|
||||
public Map<Long, SalarySobTaxRuleDTO> parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List<EmployeeDeclarePO> employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) {
|
||||
List<SalarySobTaxRuleDTO.TaxRuleDTO> taxRules = taxRuleDTO.getTaxRules();
|
||||
|
||||
List<GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result> sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getNtycxbcjlb().getSscglb();
|
||||
Map<String, GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result> idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result::getZzhm);
|
||||
Map<Long, SalarySobTaxRuleDTO> resultMap = new HashMap<>();
|
||||
for (EmployeeDeclarePO employeeDeclare : employeeDeclares) {
|
||||
GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result result = idNoResultMap.get(employeeDeclare.getCardNum());
|
||||
taxRules.forEach(rule -> {
|
||||
String getter = "get" + rule.getTaxIndex().substring(0, 1).toUpperCase() + rule.getTaxIndex().substring(1);
|
||||
try {
|
||||
Method method = result.getClass().getMethod(getter);
|
||||
Object invoke = method.invoke(result);
|
||||
rule.setValue(Util.null2String(invoke));
|
||||
} catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) {
|
||||
log.error("getTaxErr no such method {}", getter, ex);
|
||||
}
|
||||
});
|
||||
resultMap.put(employeeDeclare.getEmployeeId(), taxRuleDTO);
|
||||
}
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
},
|
||||
|
|
@ -113,8 +168,27 @@ public enum IncomeCategoryEnum implements BaseEnum<Integer> {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, SalarySobTaxRuleDTO> parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List<EmployeeDeclarePO> employeeDeclares) {
|
||||
return null;
|
||||
public Map<Long, SalarySobTaxRuleDTO> parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List<EmployeeDeclarePO> employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) {
|
||||
List<SalarySobTaxRuleDTO.TaxRuleDTO> taxRules = taxRuleDTO.getTaxRules();
|
||||
|
||||
List<GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result> sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getJcldhtycxbcjlb().getSscglb();
|
||||
Map<String, GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result> idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result::getZzhm);
|
||||
Map<Long, SalarySobTaxRuleDTO> resultMap = new HashMap<>();
|
||||
for (EmployeeDeclarePO employeeDeclare : employeeDeclares) {
|
||||
GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result result = idNoResultMap.get(employeeDeclare.getCardNum());
|
||||
taxRules.forEach(rule -> {
|
||||
String getter = "get" + rule.getTaxIndex().substring(0, 1).toUpperCase() + rule.getTaxIndex().substring(1);
|
||||
try {
|
||||
Method method = result.getClass().getMethod(getter);
|
||||
Object invoke = method.invoke(result);
|
||||
rule.setValue(Util.null2String(invoke));
|
||||
} catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) {
|
||||
log.error("getTaxErr no such method {}", getter, ex);
|
||||
}
|
||||
});
|
||||
resultMap.put(employeeDeclare.getEmployeeId(), taxRuleDTO);
|
||||
}
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
},
|
||||
|
|
@ -127,8 +201,27 @@ public enum IncomeCategoryEnum implements BaseEnum<Integer> {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, SalarySobTaxRuleDTO> parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List<EmployeeDeclarePO> employeeDeclares) {
|
||||
return null;
|
||||
public Map<Long, SalarySobTaxRuleDTO> parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List<EmployeeDeclarePO> employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) {
|
||||
List<SalarySobTaxRuleDTO.TaxRuleDTO> taxRules = taxRuleDTO.getTaxRules();
|
||||
|
||||
List<GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result> sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getGrgqjl().getSscglb();
|
||||
Map<String, GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result> idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result::getZzhm);
|
||||
Map<Long, SalarySobTaxRuleDTO> resultMap = new HashMap<>();
|
||||
for (EmployeeDeclarePO employeeDeclare : employeeDeclares) {
|
||||
GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result result = idNoResultMap.get(employeeDeclare.getCardNum());
|
||||
taxRules.forEach(rule -> {
|
||||
String getter = "get" + rule.getTaxIndex().substring(0, 1).toUpperCase() + rule.getTaxIndex().substring(1);
|
||||
try {
|
||||
Method method = result.getClass().getMethod(getter);
|
||||
Object invoke = method.invoke(result);
|
||||
rule.setValue(Util.null2String(invoke));
|
||||
} catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) {
|
||||
log.error("getTaxErr no such method {}", getter, ex);
|
||||
}
|
||||
});
|
||||
resultMap.put(employeeDeclare.getEmployeeId(), taxRuleDTO);
|
||||
}
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
},
|
||||
|
|
@ -141,8 +234,27 @@ public enum IncomeCategoryEnum implements BaseEnum<Integer> {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, SalarySobTaxRuleDTO> parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List<EmployeeDeclarePO> employeeDeclares) {
|
||||
return null;
|
||||
public Map<Long, SalarySobTaxRuleDTO> parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List<EmployeeDeclarePO> employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) {
|
||||
List<SalarySobTaxRuleDTO.TaxRuleDTO> taxRules = taxRuleDTO.getTaxRules();
|
||||
|
||||
List<GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result> sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getQynj().getSscglb();
|
||||
Map<String, GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result> idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result::getZzhm);
|
||||
Map<Long, SalarySobTaxRuleDTO> resultMap = new HashMap<>();
|
||||
for (EmployeeDeclarePO employeeDeclare : employeeDeclares) {
|
||||
GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result result = idNoResultMap.get(employeeDeclare.getCardNum());
|
||||
taxRules.forEach(rule -> {
|
||||
String getter = "get" + rule.getTaxIndex().substring(0, 1).toUpperCase() + rule.getTaxIndex().substring(1);
|
||||
try {
|
||||
Method method = result.getClass().getMethod(getter);
|
||||
Object invoke = method.invoke(result);
|
||||
rule.setValue(Util.null2String(invoke));
|
||||
} catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) {
|
||||
log.error("getTaxErr no such method {}", getter, ex);
|
||||
}
|
||||
});
|
||||
resultMap.put(employeeDeclare.getEmployeeId(), taxRuleDTO);
|
||||
}
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
},
|
||||
|
|
@ -155,8 +267,27 @@ public enum IncomeCategoryEnum implements BaseEnum<Integer> {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, SalarySobTaxRuleDTO> parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List<EmployeeDeclarePO> employeeDeclares) {
|
||||
return null;
|
||||
public Map<Long, SalarySobTaxRuleDTO> parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List<EmployeeDeclarePO> employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) {
|
||||
List<SalarySobTaxRuleDTO.TaxRuleDTO> taxRules = taxRuleDTO.getTaxRules();
|
||||
|
||||
List<GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result> sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getBxyxy().getSscglb();
|
||||
Map<String, GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result> idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result::getZzhm);
|
||||
Map<Long, SalarySobTaxRuleDTO> resultMap = new HashMap<>();
|
||||
for (EmployeeDeclarePO employeeDeclare : employeeDeclares) {
|
||||
GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result result = idNoResultMap.get(employeeDeclare.getCardNum());
|
||||
taxRules.forEach(rule -> {
|
||||
String getter = "get" + rule.getTaxIndex().substring(0, 1).toUpperCase() + rule.getTaxIndex().substring(1);
|
||||
try {
|
||||
Method method = result.getClass().getMethod(getter);
|
||||
Object invoke = method.invoke(result);
|
||||
rule.setValue(Util.null2String(invoke));
|
||||
} catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) {
|
||||
log.error("getTaxErr no such method {}", getter, ex);
|
||||
}
|
||||
});
|
||||
resultMap.put(employeeDeclare.getEmployeeId(), taxRuleDTO);
|
||||
}
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
},
|
||||
|
|
@ -169,8 +300,27 @@ public enum IncomeCategoryEnum implements BaseEnum<Integer> {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, SalarySobTaxRuleDTO> parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List<EmployeeDeclarePO> employeeDeclares) {
|
||||
return null;
|
||||
public Map<Long, SalarySobTaxRuleDTO> parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List<EmployeeDeclarePO> employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) {
|
||||
List<SalarySobTaxRuleDTO.TaxRuleDTO> taxRules = taxRuleDTO.getTaxRules();
|
||||
|
||||
List<GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result> sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getZqjjr().getSscglb();
|
||||
Map<String, GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result> idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result::getZzhm);
|
||||
Map<Long, SalarySobTaxRuleDTO> resultMap = new HashMap<>();
|
||||
for (EmployeeDeclarePO employeeDeclare : employeeDeclares) {
|
||||
GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result result = idNoResultMap.get(employeeDeclare.getCardNum());
|
||||
taxRules.forEach(rule -> {
|
||||
String getter = "get" + rule.getTaxIndex().substring(0, 1).toUpperCase() + rule.getTaxIndex().substring(1);
|
||||
try {
|
||||
Method method = result.getClass().getMethod(getter);
|
||||
Object invoke = method.invoke(result);
|
||||
rule.setValue(Util.null2String(invoke));
|
||||
} catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) {
|
||||
log.error("getTaxErr no such method {}", getter, ex);
|
||||
}
|
||||
});
|
||||
resultMap.put(employeeDeclare.getEmployeeId(), taxRuleDTO);
|
||||
}
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
},
|
||||
|
|
@ -183,8 +333,27 @@ public enum IncomeCategoryEnum implements BaseEnum<Integer> {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, SalarySobTaxRuleDTO> parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List<EmployeeDeclarePO> employeeDeclares) {
|
||||
return null;
|
||||
public Map<Long, SalarySobTaxRuleDTO> parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List<EmployeeDeclarePO> employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) {
|
||||
List<SalarySobTaxRuleDTO.TaxRuleDTO> taxRules = taxRuleDTO.getTaxRules();
|
||||
|
||||
List<GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result> sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getQtlxlwbc().getSscglb();
|
||||
Map<String, GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result> idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result::getZzhm);
|
||||
Map<Long, SalarySobTaxRuleDTO> resultMap = new HashMap<>();
|
||||
for (EmployeeDeclarePO employeeDeclare : employeeDeclares) {
|
||||
GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result result = idNoResultMap.get(employeeDeclare.getCardNum());
|
||||
taxRules.forEach(rule -> {
|
||||
String getter = "get" + rule.getTaxIndex().substring(0, 1).toUpperCase() + rule.getTaxIndex().substring(1);
|
||||
try {
|
||||
Method method = result.getClass().getMethod(getter);
|
||||
Object invoke = method.invoke(result);
|
||||
rule.setValue(Util.null2String(invoke));
|
||||
} catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) {
|
||||
log.error("getTaxErr no such method {}", getter, ex);
|
||||
}
|
||||
});
|
||||
resultMap.put(employeeDeclare.getEmployeeId(), taxRuleDTO);
|
||||
}
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
},
|
||||
|
|
@ -197,8 +366,27 @@ public enum IncomeCategoryEnum implements BaseEnum<Integer> {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, SalarySobTaxRuleDTO> parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List<EmployeeDeclarePO> employeeDeclares) {
|
||||
return null;
|
||||
public Map<Long, SalarySobTaxRuleDTO> parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List<EmployeeDeclarePO> employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) {
|
||||
List<SalarySobTaxRuleDTO.TaxRuleDTO> taxRules = taxRuleDTO.getTaxRules();
|
||||
|
||||
List<GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result> sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getQtflxlwbc().getSscglb();
|
||||
Map<String, GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result> idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result::getZzhm);
|
||||
Map<Long, SalarySobTaxRuleDTO> resultMap = new HashMap<>();
|
||||
for (EmployeeDeclarePO employeeDeclare : employeeDeclares) {
|
||||
GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result result = idNoResultMap.get(employeeDeclare.getCardNum());
|
||||
taxRules.forEach(rule -> {
|
||||
String getter = "get" + rule.getTaxIndex().substring(0, 1).toUpperCase() + rule.getTaxIndex().substring(1);
|
||||
try {
|
||||
Method method = result.getClass().getMethod(getter);
|
||||
Object invoke = method.invoke(result);
|
||||
rule.setValue(Util.null2String(invoke));
|
||||
} catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) {
|
||||
log.error("getTaxErr no such method {}", getter, ex);
|
||||
}
|
||||
});
|
||||
resultMap.put(employeeDeclare.getEmployeeId(), taxRuleDTO);
|
||||
}
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
},
|
||||
|
|
@ -211,8 +399,27 @@ public enum IncomeCategoryEnum implements BaseEnum<Integer> {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, SalarySobTaxRuleDTO> parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List<EmployeeDeclarePO> employeeDeclares) {
|
||||
return null;
|
||||
public Map<Long, SalarySobTaxRuleDTO> parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List<EmployeeDeclarePO> employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) {
|
||||
List<SalarySobTaxRuleDTO.TaxRuleDTO> taxRules = taxRuleDTO.getTaxRules();
|
||||
|
||||
List<GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result> sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getGcsdlb().getSscglb();
|
||||
Map<String, GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result> idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result::getZzhm);
|
||||
Map<Long, SalarySobTaxRuleDTO> resultMap = new HashMap<>();
|
||||
for (EmployeeDeclarePO employeeDeclare : employeeDeclares) {
|
||||
GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result result = idNoResultMap.get(employeeDeclare.getCardNum());
|
||||
taxRules.forEach(rule -> {
|
||||
String getter = "get" + rule.getTaxIndex().substring(0, 1).toUpperCase() + rule.getTaxIndex().substring(1);
|
||||
try {
|
||||
Method method = result.getClass().getMethod(getter);
|
||||
Object invoke = method.invoke(result);
|
||||
rule.setValue(Util.null2String(invoke));
|
||||
} catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) {
|
||||
log.error("getTaxErr no such method {}", getter, ex);
|
||||
}
|
||||
});
|
||||
resultMap.put(employeeDeclare.getEmployeeId(), taxRuleDTO);
|
||||
}
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
},
|
||||
|
|
@ -225,8 +432,27 @@ public enum IncomeCategoryEnum implements BaseEnum<Integer> {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, SalarySobTaxRuleDTO> parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List<EmployeeDeclarePO> employeeDeclares) {
|
||||
return null;
|
||||
public Map<Long, SalarySobTaxRuleDTO> parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List<EmployeeDeclarePO> employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) {
|
||||
List<SalarySobTaxRuleDTO.TaxRuleDTO> taxRules = taxRuleDTO.getTaxRules();
|
||||
|
||||
List<GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result> sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getTxq().getSscglb();
|
||||
Map<String, GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result> idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result::getZzhm);
|
||||
Map<Long, SalarySobTaxRuleDTO> resultMap = new HashMap<>();
|
||||
for (EmployeeDeclarePO employeeDeclare : employeeDeclares) {
|
||||
GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result result = idNoResultMap.get(employeeDeclare.getCardNum());
|
||||
taxRules.forEach(rule -> {
|
||||
String getter = "get" + rule.getTaxIndex().substring(0, 1).toUpperCase() + rule.getTaxIndex().substring(1);
|
||||
try {
|
||||
Method method = result.getClass().getMethod(getter);
|
||||
Object invoke = method.invoke(result);
|
||||
rule.setValue(Util.null2String(invoke));
|
||||
} catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) {
|
||||
log.error("getTaxErr no such method {}", getter, ex);
|
||||
}
|
||||
});
|
||||
resultMap.put(employeeDeclare.getEmployeeId(), taxRuleDTO);
|
||||
}
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
},
|
||||
|
|
@ -239,8 +465,27 @@ public enum IncomeCategoryEnum implements BaseEnum<Integer> {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, SalarySobTaxRuleDTO> parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List<EmployeeDeclarePO> employeeDeclares) {
|
||||
return null;
|
||||
public Map<Long, SalarySobTaxRuleDTO> parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List<EmployeeDeclarePO> employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) {
|
||||
List<SalarySobTaxRuleDTO.TaxRuleDTO> taxRules = taxRuleDTO.getTaxRules();
|
||||
|
||||
List<GetASynIndividualIncomeTaxFeedbackResponse.Body.fjmsd.ssjgdx.result> sscglb = declareTaxResultFeedbackResponse.getBody().getFjmsd().getWjgzxjlb().getSscglb();
|
||||
Map<String, GetASynIndividualIncomeTaxFeedbackResponse.Body.fjmsd.ssjgdx.result> idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.fjmsd.ssjgdx.result::getZzhm);
|
||||
Map<Long, SalarySobTaxRuleDTO> resultMap = new HashMap<>();
|
||||
for (EmployeeDeclarePO employeeDeclare : employeeDeclares) {
|
||||
GetASynIndividualIncomeTaxFeedbackResponse.Body.fjmsd.ssjgdx.result result = idNoResultMap.get(employeeDeclare.getCardNum());
|
||||
taxRules.forEach(rule -> {
|
||||
String getter = "get" + rule.getTaxIndex().substring(0, 1).toUpperCase() + rule.getTaxIndex().substring(1);
|
||||
try {
|
||||
Method method = result.getClass().getMethod(getter);
|
||||
Object invoke = method.invoke(result);
|
||||
rule.setValue(Util.null2String(invoke));
|
||||
} catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) {
|
||||
log.error("getTaxErr no such method {}", getter, ex);
|
||||
}
|
||||
});
|
||||
resultMap.put(employeeDeclare.getEmployeeId(), taxRuleDTO);
|
||||
}
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
},
|
||||
|
|
@ -253,8 +498,27 @@ public enum IncomeCategoryEnum implements BaseEnum<Integer> {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, SalarySobTaxRuleDTO> parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List<EmployeeDeclarePO> employeeDeclares) {
|
||||
return null;
|
||||
public Map<Long, SalarySobTaxRuleDTO> parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List<EmployeeDeclarePO> employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) {
|
||||
List<SalarySobTaxRuleDTO.TaxRuleDTO> taxRules = taxRuleDTO.getTaxRules();
|
||||
|
||||
List<GetASynIndividualIncomeTaxFeedbackResponse.Body.fjmsd.ssjgdx.result> sscglb = declareTaxResultFeedbackResponse.getBody().getFjmsd().getWjrysyjjlb().getSscglb();
|
||||
Map<String, GetASynIndividualIncomeTaxFeedbackResponse.Body.fjmsd.ssjgdx.result> idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.fjmsd.ssjgdx.result::getZzhm);
|
||||
Map<Long, SalarySobTaxRuleDTO> resultMap = new HashMap<>();
|
||||
for (EmployeeDeclarePO employeeDeclare : employeeDeclares) {
|
||||
GetASynIndividualIncomeTaxFeedbackResponse.Body.fjmsd.ssjgdx.result result = idNoResultMap.get(employeeDeclare.getCardNum());
|
||||
taxRules.forEach(rule -> {
|
||||
String getter = "get" + rule.getTaxIndex().substring(0, 1).toUpperCase() + rule.getTaxIndex().substring(1);
|
||||
try {
|
||||
Method method = result.getClass().getMethod(getter);
|
||||
Object invoke = method.invoke(result);
|
||||
rule.setValue(Util.null2String(invoke));
|
||||
} catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) {
|
||||
log.error("getTaxErr no such method {}", getter, ex);
|
||||
}
|
||||
});
|
||||
resultMap.put(employeeDeclare.getEmployeeId(), taxRuleDTO);
|
||||
}
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
},
|
||||
|
|
@ -267,8 +531,27 @@ public enum IncomeCategoryEnum implements BaseEnum<Integer> {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, SalarySobTaxRuleDTO> parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List<EmployeeDeclarePO> employeeDeclares) {
|
||||
return null;
|
||||
public Map<Long, SalarySobTaxRuleDTO> parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List<EmployeeDeclarePO> employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) {
|
||||
List<SalarySobTaxRuleDTO.TaxRuleDTO> taxRules = taxRuleDTO.getTaxRules();
|
||||
|
||||
List<GetASynIndividualIncomeTaxFeedbackResponse.Body.fjmsd.ssjgdx.result> sscglb = declareTaxResultFeedbackResponse.getBody().getFjmsd().getLwbclb().getSscglb();
|
||||
Map<String, GetASynIndividualIncomeTaxFeedbackResponse.Body.fjmsd.ssjgdx.result> idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.fjmsd.ssjgdx.result::getZzhm);
|
||||
Map<Long, SalarySobTaxRuleDTO> resultMap = new HashMap<>();
|
||||
for (EmployeeDeclarePO employeeDeclare : employeeDeclares) {
|
||||
GetASynIndividualIncomeTaxFeedbackResponse.Body.fjmsd.ssjgdx.result result = idNoResultMap.get(employeeDeclare.getCardNum());
|
||||
taxRules.forEach(rule -> {
|
||||
String getter = "get" + rule.getTaxIndex().substring(0, 1).toUpperCase() + rule.getTaxIndex().substring(1);
|
||||
try {
|
||||
Method method = result.getClass().getMethod(getter);
|
||||
Object invoke = method.invoke(result);
|
||||
rule.setValue(Util.null2String(invoke));
|
||||
} catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) {
|
||||
log.error("getTaxErr no such method {}", getter, ex);
|
||||
}
|
||||
});
|
||||
resultMap.put(employeeDeclare.getEmployeeId(), taxRuleDTO);
|
||||
}
|
||||
return resultMap;
|
||||
}
|
||||
},
|
||||
NON_RESIDENT_INCOME_COMPENSATION_FOR_DISMISS(730, "0730", "解除劳动合同一次性补偿金", DeclareReportTypeEnum.NONRESIDENT_INCOME, 181945) {
|
||||
|
|
@ -280,8 +563,27 @@ public enum IncomeCategoryEnum implements BaseEnum<Integer> {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, SalarySobTaxRuleDTO> parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List<EmployeeDeclarePO> employeeDeclares) {
|
||||
return null;
|
||||
public Map<Long, SalarySobTaxRuleDTO> parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List<EmployeeDeclarePO> employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) {
|
||||
List<SalarySobTaxRuleDTO.TaxRuleDTO> taxRules = taxRuleDTO.getTaxRules();
|
||||
|
||||
List<GetASynIndividualIncomeTaxFeedbackResponse.Body.fjmsd.ssjgdx.result> sscglb = declareTaxResultFeedbackResponse.getBody().getFjmsd().getJcldhtycxbcjlb().getSscglb();
|
||||
Map<String, GetASynIndividualIncomeTaxFeedbackResponse.Body.fjmsd.ssjgdx.result> idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.fjmsd.ssjgdx.result::getZzhm);
|
||||
Map<Long, SalarySobTaxRuleDTO> resultMap = new HashMap<>();
|
||||
for (EmployeeDeclarePO employeeDeclare : employeeDeclares) {
|
||||
GetASynIndividualIncomeTaxFeedbackResponse.Body.fjmsd.ssjgdx.result result = idNoResultMap.get(employeeDeclare.getCardNum());
|
||||
taxRules.forEach(rule -> {
|
||||
String getter = "get" + rule.getTaxIndex().substring(0, 1).toUpperCase() + rule.getTaxIndex().substring(1);
|
||||
try {
|
||||
Method method = result.getClass().getMethod(getter);
|
||||
Object invoke = method.invoke(result);
|
||||
rule.setValue(Util.null2String(invoke));
|
||||
} catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) {
|
||||
log.error("getTaxErr no such method {}", getter, ex);
|
||||
}
|
||||
});
|
||||
resultMap.put(employeeDeclare.getEmployeeId(), taxRuleDTO);
|
||||
}
|
||||
return resultMap;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -307,7 +609,7 @@ public enum IncomeCategoryEnum implements BaseEnum<Integer> {
|
|||
public abstract void parseGetDeclareTaxResultFeedbackResponse(Map<String, List<List<Object>>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse);
|
||||
|
||||
|
||||
public abstract Map<Long, SalarySobTaxRuleDTO> parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List<EmployeeDeclarePO> employeeDeclares);
|
||||
public abstract Map<Long, SalarySobTaxRuleDTO> parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List<EmployeeDeclarePO> employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO);
|
||||
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -6,10 +6,10 @@ import com.engine.salary.constant.SalaryDefaultTenantConstant;
|
|||
import com.engine.salary.constant.SzyhApiConstant;
|
||||
import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO;
|
||||
import com.engine.salary.entity.salaryacct.bo.SalaryCalcTax;
|
||||
import com.engine.salary.entity.salaryacct.bo.SalaryCalcTaxFeedback;
|
||||
import com.engine.salary.entity.salaryacct.dto.SalaryCalcTaxInfoDTO;
|
||||
import com.engine.salary.entity.salaryacct.param.SalaryCalcTaxParam;
|
||||
import com.engine.salary.entity.salaryacct.po.*;
|
||||
import com.engine.salary.entity.salarysob.dto.SalarySobTaxRuleDTO;
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobTaxReportRulePO;
|
||||
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
||||
import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO;
|
||||
|
|
@ -27,7 +27,6 @@ import com.engine.salary.util.db.IdGenerator;
|
|||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
|
||||
public class SalaryCalcTaxServiceImpl extends Service implements SalaryCalcTaxService {
|
||||
|
|
@ -61,6 +60,10 @@ public class SalaryCalcTaxServiceImpl extends Service implements SalaryCalcTaxSe
|
|||
return ServiceUtil.getService(SalarySobTaxReportRuleServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalarySobTaxRuleService getSalarySobTaxRuleService(User user) {
|
||||
return ServiceUtil.getService(SalarySobTaxRuleServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private EmployeeDeclareService getEmployeeDeclareService(User user) {
|
||||
return ServiceUtil.getService(EmployeeDeclareServiceImpl.class, user);
|
||||
}
|
||||
|
|
@ -196,15 +199,13 @@ public class SalaryCalcTaxServiceImpl extends Service implements SalaryCalcTaxSe
|
|||
if (CollectionUtils.isEmpty(salaryAcctCalcTaxReqs)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(268184, "请先计算个税再获取反馈"));
|
||||
}
|
||||
// 查询薪资核算记录关联的薪资账套个税申报表字段对应
|
||||
List<SalarySobTaxReportRulePO> salarySobTaxReportRules = getSalarySobTaxReportRuleService(user).listBySalarySobIds(Collections.singleton(salaryAcctRecord.getSalarySobId()));
|
||||
Map<String, SalarySobTaxReportRulePO> salarySobTaxReportRuleMap = SalaryEntityUtil.convert2Map(salarySobTaxReportRules, SalarySobTaxReportRulePO::getReportColumnDataIndex);
|
||||
// 查询薪资核算记录关联的薪资账套个税字段对应
|
||||
List<SalarySobTaxRuleDTO> salarySobTaxRules = getSalarySobTaxRuleService(user).getSalarySobTaxRuleDTO(salaryAcctRecord.getSalarySobId());
|
||||
Map<String, SalarySobTaxRuleDTO> salarySobTaxRuleMap = SalaryEntityUtil.convert2Map(salarySobTaxRules, SalarySobTaxRuleDTO::getIncomeCategoryId);
|
||||
// 查询报送人员
|
||||
List<EmployeeDeclarePO> employeeDeclares = getEmployeeDeclareService(user).listBySalaryAcctTaxAgent(salaryAcctTaxAgents);
|
||||
Map<Long, List<EmployeeDeclarePO>> employeeDeclareMap = SalaryEntityUtil.group2Map(employeeDeclares, EmployeeDeclarePO::getTaxAgentId);
|
||||
|
||||
String url = apiConfig.getHost() + SzyhApiConstant.ASYN_INDIVIDUAL_INCOME_TAX_FEEDBACK;
|
||||
Map<String, String> header = SingnatureData.initHeader(Collections.emptyMap(), apiConfig.getAppKey(), apiConfig.getAppSecret());
|
||||
|
||||
List<SalaryAcctResultPO> resultPOS = new ArrayList<>();
|
||||
for (SalaryAcctCalcTaxReqPO salaryAcctCalcTaxReq : salaryAcctCalcTaxReqs) {
|
||||
|
|
@ -229,65 +230,8 @@ public class SalaryCalcTaxServiceImpl extends Service implements SalaryCalcTaxSe
|
|||
if (incomeCategoryEnum == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Map<Long, GetASynIndividualIncomeTaxFeedbackResponse.Body.result> empIdResult = incomeCategoryEnum.parseGetASynIndividualIncomeTaxFeedbackResponse(feedbackResponse, subEmployeeDeclares);
|
||||
|
||||
|
||||
Map<String, Object> dataMap = null;
|
||||
// switch (incomeCategoryEnum) {
|
||||
// case WAGES_AND_SALARIES:
|
||||
// dataMap = JsonUtil.parseMap(ZHSDMap.get("zcgzxj"), Object.class);
|
||||
// break;
|
||||
// case ONETIME_ANNUAL_BONUS:
|
||||
// dataMap = JsonUtil.parseMap(ZHSDMap.get("qnycxjjsslb"), Object.class);
|
||||
// break;
|
||||
// case COMPENSATION_FOR_RETIRE:
|
||||
// dataMap = JsonUtil.parseMap(ZHSDMap.get("ntycxbcjlb"), Object.class);
|
||||
// break;
|
||||
// case COMPENSATION_FOR_DISMISS:
|
||||
// dataMap = JsonUtil.parseMap(ZHSDMap.get("jcldhtycxbcjlb"), Object.class);
|
||||
// break;
|
||||
// case INCOME_FOR_INDIVIDUAL_EQUITY_INCENTIVE:
|
||||
// dataMap = JsonUtil.parseMap(ZHSDMap.get("grgqjl"), Object.class);
|
||||
// break;
|
||||
// case ANNUITY_RECEIPT:
|
||||
// dataMap = JsonUtil.parseMap(ZHSDMap.get("qynj"), Object.class);
|
||||
// break;
|
||||
// case REMUNERATION_FOR_LABOR:
|
||||
// dataMap = JsonUtil.parseMap(ZHSDMap.get("lwbclb"), Object.class);
|
||||
// break;
|
||||
// case INCOME_FOR_INSURANCE_SALESMAN:
|
||||
// dataMap = JsonUtil.parseMap(ZHSDMap.get("bxyxy"), Object.class);
|
||||
// break;
|
||||
// case INCOME_FOR_SECURITIES_BROKER:
|
||||
// dataMap = JsonUtil.parseMap(ZHSDMap.get("zqjjr"), Object.class);
|
||||
// break;
|
||||
// case REMUNERATION_FOR_OTHER_CONTINUOUS_LABOR:
|
||||
// dataMap = JsonUtil.parseMap(ZHSDMap.get("qtlxlwbc"), Object.class);
|
||||
// break;
|
||||
// case REMUNERATION_FOR_OTHER_LABOR:
|
||||
// dataMap = JsonUtil.parseMap(ZHSDMap.get("qtflxlwbc"), Object.class);
|
||||
// break;
|
||||
// case REMUNERATION_FOR_AUTHOR:
|
||||
// dataMap = JsonUtil.parseMap(ZHSDMap.get("gcsdlb"), Object.class);
|
||||
// break;
|
||||
// case ROYALTIES:
|
||||
// dataMap = JsonUtil.parseMap(ZHSDMap.get("txq"), Object.class);
|
||||
// break;
|
||||
// default:
|
||||
// dataMap = Collections.emptyMap();
|
||||
// break;
|
||||
// }
|
||||
|
||||
Map<Long, String> employeeIdKeyTaxMap;
|
||||
SalaryCalcTaxFeedback salaryCalcTaxFeedback = new SalaryCalcTaxFeedback(dataMap, subEmployeeDeclares);
|
||||
if (incomeCategoryEnum == IncomeCategoryEnum.WAGES_AND_SALARIES) {
|
||||
employeeIdKeyTaxMap = salaryCalcTaxFeedback.buildZCGZXJFeedback();
|
||||
} else {
|
||||
employeeIdKeyTaxMap = salaryCalcTaxFeedback.buildOtherFeedback();
|
||||
}
|
||||
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
SalarySobTaxRuleDTO taxRuleDTO = salarySobTaxRuleMap.get(incomeCategoryEnum.getValue().toString());
|
||||
Map<Long, SalarySobTaxRuleDTO> empIdResult = incomeCategoryEnum.parseGetASynIndividualIncomeTaxFeedbackResponse(feedbackResponse, subEmployeeDeclares,taxRuleDTO);
|
||||
List<SalaryAcctEmployeePO> subSalaryAcctEmployees = salaryAcctEmployeeMap.get(salaryAcctTaxAgent.getTaxAgentId() + "-" + salaryAcctTaxAgent.getIncomeCategory());
|
||||
if (CollectionUtils.isEmpty(subSalaryAcctEmployees)) {
|
||||
continue;
|
||||
|
|
@ -297,12 +241,13 @@ public class SalaryCalcTaxServiceImpl extends Service implements SalaryCalcTaxSe
|
|||
if (salaryAcctResultValue == null) {
|
||||
continue;
|
||||
}
|
||||
SalarySobTaxReportRulePO salarySobTaxReportRule = salarySobTaxReportRuleMap.get("refundedOrSupplementedTax" + salaryAcctEmployee.getIncomeCategory());
|
||||
if (salarySobTaxReportRule != null) {
|
||||
SalaryAcctResultPO salaryAcctResultPO = salaryAcctResultValue.get(salarySobTaxReportRule.getSalaryItemId());
|
||||
salaryAcctResultPO.setResultValue(employeeIdKeyTaxMap.get(salaryAcctEmployee.getEmployeeId()));
|
||||
SalarySobTaxRuleDTO salarySobTaxRuleDTO = empIdResult.get(salaryAcctEmployee.getEmployeeId());
|
||||
List<SalarySobTaxRuleDTO.TaxRuleDTO> taxRules = salarySobTaxRuleDTO.getTaxRules();
|
||||
taxRules.forEach(rule->{
|
||||
SalaryAcctResultPO salaryAcctResultPO = salaryAcctResultValue.get(rule.getSalaryItemId());
|
||||
salaryAcctResultPO.setResultValue(rule.getValue());
|
||||
resultPOS.add(salaryAcctResultPO);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@ import com.engine.salary.util.SalaryI18nUtil;
|
|||
import com.engine.salary.util.db.IdGenerator;
|
||||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.google.common.collect.Sets;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import weaver.hrm.User;
|
||||
|
|
@ -98,10 +97,8 @@ public class SalarySobTaxRuleServiceImpl extends Service implements SalarySobTax
|
|||
Long salaryItemId = salarySobTaxReportRuleMap.get(incomeCategoryId + "-" + taxRule.getTaxIndex());
|
||||
SalaryItemPO salaryItem = idKeySalaryItemMap.get(salaryItemId);
|
||||
if (Objects.nonNull(salaryItem)) {
|
||||
Map<String, Object> dataMap = Maps.newHashMap();
|
||||
dataMap.put("id", salaryItem.getId().toString());
|
||||
dataMap.put("name", salaryItem.getName());
|
||||
taxRule.setSalaryItem(dataMap);
|
||||
taxRule.setSalaryItemId(salaryItem.getId());
|
||||
taxRule.setSalaryItemName(salaryItem.getName());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,9 +7,9 @@ import java.util.List;
|
|||
|
||||
public class ParseTaxApi {
|
||||
public static void main(String[] args) {
|
||||
// readExcel("H:\\code\\salary\\test\\ApiDes.xlsx");
|
||||
readExcel("H:\\code\\salary\\test\\ApiDes.xlsx");
|
||||
|
||||
readExcel2("H:\\code\\salary\\test\\ApiDes.xlsx");
|
||||
// readExcel2("H:\\code\\salary\\test\\ApiDes.xlsx");
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue