|
|
@@ -2,6 +2,7 @@ package com.kingdee.eas.custom.shuiyou.taxCal.service;
|
|
|
|
|
|
import cn.com.servyou.dto.ApiResponse;
|
|
|
import cn.com.servyou.dto.Head;
|
|
|
+import cn.com.servyou.dto.employee.EmployeeDeclareFeedback;
|
|
|
import cn.com.servyou.dto.tax.*;
|
|
|
import cn.com.servyou.rmi.client.ClientProxyFactory;
|
|
|
import cn.com.servyou.service.TaxRequest;
|
|
|
@@ -45,6 +46,7 @@ public class GetASynIndividualIncomeTaxFeedback implements IHRMsfService {
|
|
|
private String taxUnitId = null;//纳税单位id
|
|
|
private String period = null;//税款所属期 yyyy-MM
|
|
|
private String creator = null;//创建人id
|
|
|
+ private String initIds = null;
|
|
|
private String periodBegin = null;//税款所属期起 yyyy-MM-dd
|
|
|
private String periodEnd = null;//税款所属期止 yyyy-MM-dd
|
|
|
private ObjectMapper objectMapper = new ObjectMapper();
|
|
|
@@ -73,6 +75,7 @@ public class GetASynIndividualIncomeTaxFeedback implements IHRMsfService {
|
|
|
taxUnitId = paramDataMap.get("TAXUNITID");//纳税单位id
|
|
|
period = paramDataMap.get("PERIOD");//周期yyyy-MM
|
|
|
creator = paramDataMap.get("creator");//创建人id
|
|
|
+ initIds = paramDataMap.get("initIds");//初算数据id
|
|
|
String requestId = paramDataMap.get("requestId");
|
|
|
StringBuilder errorMsg = new StringBuilder();
|
|
|
if (StringUtils.isEmpty(taxUnitId)) {
|
|
|
@@ -147,47 +150,66 @@ public class GetASynIndividualIncomeTaxFeedback implements IHRMsfService {
|
|
|
//综合所得
|
|
|
ComplexIncomeResultRequest complexIncomeResult = body.getComplexIncomeResultRequest();
|
|
|
//人员申报失败列表
|
|
|
-// List<EmployeeDeclareFeedback> employeeDeclareFeedbacks = complexIncomeResult.getEmployeeDeclareFeedbacks();
|
|
|
-// for (int i = 0; employeeDeclareFeedbacks != null && i < employeeDeclareFeedbacks.size(); i++) {
|
|
|
-// EmployeeDeclareFeedback employeeDeclareFeedback = employeeDeclareFeedbacks.get(i);
|
|
|
-// //姓名
|
|
|
-// String name = employeeDeclareFeedback.getName();
|
|
|
-// //证件类型名称
|
|
|
-// String licenseType = employeeDeclareFeedback.getLicenseType();
|
|
|
-// //证件号码
|
|
|
-// String licenseNumber = employeeDeclareFeedback.getLicenseNumber();
|
|
|
-// //报送状态 1 待报送 2 代报中 3 代报失败 4 代报成功
|
|
|
-// String submissionState = employeeDeclareFeedback.getSubmissionState();
|
|
|
-// //人员验证状态 0 若是身份证,状态为验证中;其他证件为暂不验证 1 验证通过 2 验证不通过 4 待验证 9 同代码0处理
|
|
|
-// String authenticationState = employeeDeclareFeedback.getAuthenticationState();
|
|
|
-// //失败原因
|
|
|
-// String message = employeeDeclareFeedback.getMessage();
|
|
|
-// //专项报送状态 2 代报成功 3 代报失败
|
|
|
-// String deductionSubmissionState = employeeDeclareFeedback.getDeductionSubmissionState();
|
|
|
-// //专项报送结果原因
|
|
|
-// String deductionMessage = employeeDeclareFeedback.getDeductionMessage();
|
|
|
-// }
|
|
|
- logger.info("正常工资薪金算税结果对象");
|
|
|
+ List<EmployeeDeclareFeedback> employeeDeclareFeedbacks = complexIncomeResult.getEmployeeDeclareFeedbacks();
|
|
|
+ String updateSqlTemp = "/*dialect*/update T_HR_STaxCalInitDetail set FERRORINFO = '%s',FSTATE = '50' " +
|
|
|
+ "where fpersonId = '%s' and fid in (%s) and FSTATE =30";
|
|
|
+ for (int i = 0; employeeDeclareFeedbacks != null && i < employeeDeclareFeedbacks.size(); i++) {
|
|
|
+ EmployeeDeclareFeedback employeeDeclareFeedback = employeeDeclareFeedbacks.get(i);
|
|
|
+ //失败原因
|
|
|
+ String message = employeeDeclareFeedback.getMessage();
|
|
|
+ if (!StringUtils.isEmpty(message)) {
|
|
|
+ //姓名
|
|
|
+ String name = employeeDeclareFeedback.getName();
|
|
|
+ //证件类型名称
|
|
|
+ String licenseType = employeeDeclareFeedback.getLicenseType();
|
|
|
+ //证件号码
|
|
|
+ String licenseNumber = employeeDeclareFeedback.getLicenseNumber();
|
|
|
+ //员工id
|
|
|
+ String personId = taxPersonRecordMap.get(licenseNumber + licenseType);
|
|
|
+ if (StringUtils.isEmpty(personId)) {
|
|
|
+ logger.error("未匹配到人员 证件号: " + licenseNumber + " 证件类型: " + licenseType);
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ //报送状态 1 待报送 2 代报中 3 代报失败 4 代报成功
|
|
|
+ //String submissionState = employeeDeclareFeedback.getSubmissionState();
|
|
|
+ //人员验证状态 0 若是身份证,状态为验证中;其他证件为暂不验证 1 验证通过 2 验证不通过 4 待验证 9 同代码0处理
|
|
|
+ //String authenticationState = employeeDeclareFeedback.getAuthenticationState();
|
|
|
+ //专项报送状态 2 代报成功 3 代报失败
|
|
|
+ //String deductionSubmissionState = employeeDeclareFeedback.getDeductionSubmissionState();
|
|
|
+ //专项报送结果原因
|
|
|
+ //String deductionMessage = employeeDeclareFeedback.getDeductionMessage();
|
|
|
+ try {
|
|
|
+ logger.error("报送失败人员 " + name);
|
|
|
+ logger.error("报送失败原因 " + message);
|
|
|
+ String updateSql = String.format(updateSqlTemp, message, personId, initIds);
|
|
|
+ logger.error("报送失败更新sql " + updateSql);
|
|
|
+ DbUtil.execute(ctx, updateSql);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ logger.error("正常工资薪金算税结果对象");
|
|
|
//正常工资薪金算税结果对象
|
|
|
ComplexTaxCalculateResult normalSalarySpecIncome = complexIncomeResult.getNormalSalarySpecIncome();
|
|
|
handleComplexTaxCalculateResult(ctx, normalSalarySpecIncome);
|
|
|
- logger.info("全年一次性奖金收入算税结果对象");
|
|
|
+ logger.error("全年一次性奖金收入算税结果对象");
|
|
|
//全年一次性奖金收入算税结果对象
|
|
|
ComplexTaxCalculateResult annualOneTimeBonusIncome = complexIncomeResult.getAnnualOneTimeBonusIncome();
|
|
|
handleComplexTaxCalculateResult(ctx, annualOneTimeBonusIncome);
|
|
|
- logger.info("一般劳务报酬算税结果对象");
|
|
|
+ logger.error("一般劳务报酬算税结果对象");
|
|
|
//一般劳务报酬算税结果对象
|
|
|
ComplexTaxCalculateResult laborRemunerationIncome = complexIncomeResult.getLaborRemunerationIncome();
|
|
|
handleComplexTaxCalculateResult(ctx, laborRemunerationIncome);
|
|
|
- logger.info("解除劳动合同一次性补偿金算税结果对象");
|
|
|
+ logger.error("解除劳动合同一次性补偿金算税结果对象");
|
|
|
//解除劳动合同一次性补偿金算税结果对象
|
|
|
ComplexTaxCalculateResult compensateIncome = complexIncomeResult.getCompensateIncome();
|
|
|
handleComplexTaxCalculateResult(ctx, compensateIncome);
|
|
|
messageResult = MessageResult.SUCCESS();
|
|
|
}
|
|
|
- logger.info("保存日志对象");
|
|
|
+ logger.error("保存日志对象");
|
|
|
iLogInfo.addnew(logInfo);
|
|
|
- logger.info("返回结果");
|
|
|
+ logger.error("返回结果");
|
|
|
return messageResult;
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
@@ -903,7 +925,7 @@ public class GetASynIndividualIncomeTaxFeedback implements IHRMsfService {
|
|
|
if (taxPersonRecordMap == null) {
|
|
|
taxPersonRecordMap = new HashMap<>();
|
|
|
}
|
|
|
- String oql = "select bill.person.id,bill.cardType,bill.cardNumber where submitStatus='2'";
|
|
|
+ String oql = "select bill.person.id,bill.cardType,bill.cardNumber";
|
|
|
TaxPersonRecordEntryCollection taxPersonRecordEntryCollection =
|
|
|
TaxPersonRecordEntryFactory.getLocalInstance(ctx).getTaxPersonRecordEntryCollection(oql);
|
|
|
for (int i = 0; i < taxPersonRecordEntryCollection.size(); i++) {
|