package com.kingdee.eas.custom.compensation.handler; import cn.com.servyou.dto.ApiResponse; import cn.com.servyou.dto.AsyncResult; import cn.com.servyou.dto.declare.CompanyDeclareRequest; import cn.com.servyou.dto.tax.*; import cn.com.servyou.rmi.client.ClientProxyFactory; import cn.com.servyou.service.DeclarationRequest; import com.alibaba.fastjson.JSONObject; import com.fasterxml.jackson.databind.ObjectMapper; import com.kingdee.bos.BOSException; import com.kingdee.bos.Context; import com.kingdee.bos.dao.ormapping.ObjectUuidPK; import com.kingdee.eas.basedata.hraux.NationalityInfo; import com.kingdee.eas.basedata.person.PersonInfo; import com.kingdee.eas.common.EASBizException; import com.kingdee.eas.custom.shuiyou.task.TaskCatalogEnum; import com.kingdee.eas.custom.shuiyou.uitls.ISYUtilsFacade; import com.kingdee.eas.custom.shuiyou.uitls.SYUtilsFacadeFactory; import com.kingdee.eas.custom.shuiyou.utils.ClientProxyFactoryUtils; import com.kingdee.shr.base.syssetting.context.SHRContext; import com.kingdee.shr.base.syssetting.exception.SHRWebException; import com.kingdee.shr.base.syssetting.web.json.JSONUtils; import com.kingdee.shr.compensation.app.tax.*; import com.kingdee.shr.compensation.util.Base64Utils; import com.kingdee.shr.compensation.web.handler.tax.IncomeTaxDeclareListHandler; import com.kingdee.util.StringUtils; import org.apache.log4j.Logger; import org.springframework.ui.ModelMap; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.math.BigDecimal; import java.sql.SQLException; import java.text.SimpleDateFormat; import java.util.*; /** * @author qingwu * @date 2024/9/18 * @apiNote 个税申报扩展 */ public class IncomeTaxDeclareListHandlerEx extends IncomeTaxDeclareListHandler { Logger logger = Logger.getLogger("com.kingdee.eas.custom.compensation.handler.IncomeTaxDeclareListHandlerEx"); String personName = "测试姜凌"; String cardType = "居民身份证"; String cardNumber = "828888201005039412"; /** * 个税申报 * * @param request * @param response * @param modelMap */ public void taxDeclaresAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws BOSException, SHRWebException { logger.error("taxDeclareAction-----start-------"); Context ctx = SHRContext.getInstance().getContext(); //个税申报 //String selectedId = request.getParameter("selectedId"); //String sqlInString = CmpUtils.spiltToSqlString(selectedId); //if (StringUtils.isEmpty(sqlInString)) { // sqlInString = "''"; //} try { //String oqlBuffer = "select id,yearMonth,totalPerson,totalMoney,taxRebate,declareStatus,versionCode,yearMonthDate,tbType,taxUnit.id,taxUnit.name,taxUnit.taxNumber,taxUnit.regNumber,taxUnit.areaCode,taxUnit.declPassword, batchNo where id in ( " + sqlInString + " )"; //IncomeTaxDeclarCollection declareCollection = IncomeTaxDeclarFactory.getLocalInstance(ctx).getIncomeTaxDeclarCollection(oqlBuffer); IncomeTaxDeclarCollection declareCollection = new IncomeTaxDeclarCollection(); Map>> declareDataMap = null; List> list = new ArrayList<>(); Map map = new HashMap<>(); map.put("personName", personName); map.put("cardType", cardType); map.put("cardNumber",cardNumber); if (declareCollection.size() == 0) { declareCollection.add(new IncomeTaxDeclarInfo()); } ApiResponse apiResponse = null; ObjectMapper mapper = new ObjectMapper(); for (int i = 0; i < declareCollection.size(); i++) { IncomeTaxDeclarInfo incomeTaxDeclarInfo = declareCollection.get(i); //纳税单位 //TaxUnitInfo taxUnitInfo = incomeTaxDeclarInfo.getTaxUnit(); TaxUnitInfo taxUnitInfo = TaxUnitFactory.getLocalInstance(ctx).getTaxUnitInfo(new ObjectUuidPK("FqEAAACXVqyPHZiq")); //年月 //String yearMonth = incomeTaxDeclarInfo.getYearMonth(); //反算服务 ClientProxyFactory clientProxyFactory = ClientProxyFactoryUtils.getClientProxyFactory(); //算税请求接口 DeclarationRequest declarationRequest = clientProxyFactory.getDeclarationRequest(); //获取请求参数 //获取请求参数 CompanyDeclareRequest declareRequestParameter = getDeclareRequestParameter(taxUnitInfo, declareDataMap, "202408"); //申报数据报送 apiResponse = declarationRequest.send(declareRequestParameter); logger.error("asyncResultApiResponse-----getCode-------" + apiResponse.getHead().getCode()); logger.error("asyncResultApiResponse-----getMsg--------" + apiResponse.getHead().getMsg()); if (apiResponse.getHead().getCode().equals("00000000")) { AsyncResult body = apiResponse.getBody(); String requestId = body.getRequestId(); logger.error("requestId-----" + requestId); logger.error("apiResponse-----" + mapper.writeValueAsString(apiResponse)); //查询反算反馈结果 ISYUtilsFacade isyUtilsFacade = SYUtilsFacadeFactory.getLocalInstance(ctx); //backTask(url,requestId,回调osf服务,自定义参数,任务类型) //isyUtilsFacade.backTask(isyUtilsFacade.getConfig().get("ip") + "/gateway/iit/reverseCalculateTax/getASynIndividualIncomeTaxFeedback", requestId, "synIndividualIncomeTaxService", jsonObject.toString(), TaskCatalogEnum.CAL_GET); JSONObject json = new JSONObject(); json.put("requestId", requestId); //json.put("param", jsonObject.toString()); isyUtilsFacade.addTask("synIncomeTaxDeclareService", json.toJSONString(), TaskCatalogEnum.TAX, ""); } } JSONUtils.writeJson(response, mapper.writeValueAsString(apiResponse)); logger.error("taxDeclareAction-----end-------"); } catch (IOException e) { throw new RuntimeException(e); } catch (EASBizException e) { throw new RuntimeException(e); } catch (SQLException e) { throw new RuntimeException(e); } } ///** // * 个税申报 // * // * @param request // * @param response // * @param modelMap // */ //@Override //public void taxDeclareAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws BOSException, SHRWebException { // super.taxDeclareAction(request, response, modelMap); // logger.error("taxDeclareAction-----start-------"); // // Context ctx = SHRContext.getInstance().getContext(); // //个税申报 // String selectedId = request.getParameter("selectedId"); // String sqlInString = CmpUtils.spiltToSqlString(selectedId); // if (StringUtils.isEmpty(sqlInString)) { // sqlInString = "''"; // } // try { // String oqlBuffer = "select id,yearMonth,totalPerson,totalMoney,taxRebate,declareStatus,versionCode,yearMonthDate,tbType,taxUnit.id,taxUnit.name,taxUnit.taxNumber,taxUnit.regNumber,taxUnit.areaCode,taxUnit.declPassword, batchNo where id in ( " + sqlInString + " )"; // IncomeTaxDeclarCollection declareCollection = IncomeTaxDeclarFactory.getLocalInstance(ctx).getIncomeTaxDeclarCollection(oqlBuffer); // Map>> declareDataMap = null; // if (declareCollection.size() == 0) { // declareCollection.add(new IncomeTaxDeclarInfo()); // } // for (int i = 0; i < declareCollection.size(); i++) { // IncomeTaxDeclarInfo incomeTaxDeclarInfo = declareCollection.get(i); // //纳税单位 // //TaxUnitInfo taxUnitInfo = incomeTaxDeclarInfo.getTaxUnit(); // TaxUnitInfo taxUnitInfo = TaxUnitFactory.getLocalInstance(ctx).getTaxUnitInfo(new ObjectUuidPK("FqEAAACXVqyPHZiq")); // //年月 // //String yearMonth = incomeTaxDeclarInfo.getYearMonth(); // //反算服务 // ClientProxyFactory clientProxyFactory = ClientProxyFactoryUtils.getClientProxyFactory(); // //算税请求接口 // DeclarationRequest declarationRequest = clientProxyFactory.getDeclarationRequest(); // //获取请求参数 // //获取请求参数 // CompanyDeclareRequest declareRequestParameter = getDeclareRequestParameter(taxUnitInfo, declareDataMap, "202408"); // //申报数据报送 // ApiResponse apiResponse = declarationRequest.send(declareRequestParameter); // logger.error("asyncResultApiResponse-----getCode-------" + apiResponse.getHead().getCode()); // logger.error("asyncResultApiResponse-----getMsg--------" + apiResponse.getHead().getMsg()); // if (apiResponse.getHead().getCode().equals("00000000")) { // AsyncResult body = apiResponse.getBody(); // String requestId = body.getRequestId(); // logger.error("requestId-----" + requestId); // //查询反算反馈结果 // ISYUtilsFacade isyUtilsFacade = SYUtilsFacadeFactory.getLocalInstance(ctx); // //backTask(url,requestId,回调osf服务,自定义参数,任务类型) // //isyUtilsFacade.backTask(isyUtilsFacade.getConfig().get("ip") + "/gateway/iit/reverseCalculateTax/getASynIndividualIncomeTaxFeedback", requestId, "synIndividualIncomeTaxService", jsonObject.toString(), TaskCatalogEnum.CAL_GET); // JSONObject json = new JSONObject(); // json.put("requestId", requestId); // //json.put("param", jsonObject.toString()); // isyUtilsFacade.addTask("synIncomeTaxDeclareService", json.toJSONString(), TaskCatalogEnum.TAX, ""); // } // } // logger.error("taxDeclareAction-----end-------"); // // } catch (IOException e) { // throw new RuntimeException(e); // } catch (EASBizException e) { // throw new RuntimeException(e); // } //} /** * 获取请求参数 * 注意: * 1.解除劳动合同一次性补偿金、全年一次性奖金所得,不能单独申报,需要同正常工资薪金一起申报。 * 2.解除劳动合同一次性补偿金、稿酬所得,由于税务规则需要,解除劳动合同一次性补偿金、稿酬所得必须填写免税附表。 * * @param taxUnitInfo * @param declareDataMap * @param yearMonth * @return */ private CompanyDeclareRequest getDeclareRequestParameter(TaxUnitInfo taxUnitInfo, Map>> declareDataMap, String yearMonth) throws BOSException, SQLException, EASBizException { CompanyDeclareRequest declareRequestPara = new CompanyDeclareRequest(); //随机id String bizNo = UUID.randomUUID().toString(); logger.error("bizNo:" + bizNo); //外部业务订单号* declareRequestPara.setBizNo(bizNo); //企业名称* declareRequestPara.setName(taxUnitInfo.getName()); //税号* declareRequestPara.setTaxNo(taxUnitInfo.getTaxNumber()); //行政区划代码* declareRequestPara.setArea(taxUnitInfo.getAreaCode()); //登记序号 declareRequestPara.setRegistrationNumber(taxUnitInfo.getRegNumber()); //部门编号 //declareRequestPara.setDeptNo(""); //部门名称 //declareRequestPara.setDeptName(""); //税款所属期YYYYMM* declareRequestPara.setMonth(yearMonth); //实名账号 //declareRequestPara.setRealNameAccount(); //实名密码 //declareRequestPara.setRealNamePassword(); //加密实名密码 //declareRequestPara.setEncryptedRealNamePassword(); //申报密码 //declareRequestPara.setDeclarePassword("Aa123456"); String declPassword = taxUnitInfo.getDeclPassword(); if (StringUtils.isEmpty(declPassword)) { throw new BOSException("申报密码不能为空!"); } declareRequestPara.setDeclarePassword(Base64Utils.decode(declPassword)); //加密申报密码 //taxRequestPara.setEncryptedDeclarePassword(); //密码类型* declareRequestPara.setPasswordType("0"); //离职日期处理策略 1、不传或传1,代表离职日期自动清空,即人员状态由“非正常”变更为“正常”时,离职日期字段自动清空,默认逻辑。 //2、传2离职日期不自动清空,即人员状态由“非正常”变更为“正常”时,离职日期不自动清空,客户如需清空需对离职日期字段传入空字符串。 //declareRequestPara.setResignDateStrategy(); //企业员工列表 List companyEmployeeList = getCompanyEmployeeList(); declareRequestPara.setCompanyEmployeeList(companyEmployeeList); //综合所得 //综合所得对象 ComplexIncomeRequest complexIncomeRequest = new ComplexIncomeRequest(); //纳税人次 //complexIncomeRequest.setTaxCount(); //应扣缴税额 //complexIncomeRequest.setRefundTax(); //减免方式 //complexIncomeRequest.setDeductionMode(); //减免比例 //complexIncomeRequest.setRatio(); //减免限额 //complexIncomeRequest.setLimitAmount(); ////正常工资薪金对象 //NormalSalarySpecIncome normalSalarySpecIncome = getNormalSalarySpecIncome(declareDataMap); //complexIncomeRequest.setNormalSalarySpecIncome(normalSalarySpecIncome); //全年一次性奖金收入列表 //List annualOneTimeBonusIncomeList = getAnnualOneTimeBonusIncomeList(declareDataMap); //List annualOneTimeBonusIncomeList = new ArrayList(); //ComplexIncome annualOneTimeBonusIncome = getAnnualOneTimeBonusIncome(); //annualOneTimeBonusIncomeList.add(annualOneTimeBonusIncome); //complexIncomeRequest.setAnnualOneTimeBonusIncome(annualOneTimeBonusIncomeList); //一般劳务报酬所得列表 //List laborRemunerationIncome = getLaborRemunerationIncome(declareDataMap); ////解除劳动合同一次性补偿金列表 //List compensateIncome = getCompensateIncome(declareDataMap); //complexIncomeRequest.setCompensateIncome(compensateIncome); //测试 正常工资薪金对象 NormalSalarySpecIncome normalSalarySpecIncome = getNormalSalarySpecIncomes(); complexIncomeRequest.setNormalSalarySpecIncome(normalSalarySpecIncome); //测试 全年一次性奖金 List annualOneTimeBonusIncome = getAnnualOneTimeBonusIncomes(); complexIncomeRequest.setAnnualOneTimeBonusIncome(annualOneTimeBonusIncome); ////测试 一般劳务报酬所得列表 //List laborRemunerationIncome = getLaborRemunerationIncomes(); //complexIncomeRequest.setLaborRemunerationIncome(laborRemunerationIncome); declareRequestPara.setComplexIncomeRequest(complexIncomeRequest); return declareRequestPara; } /** * 获取一般劳务报酬所得 * taxItemPlanName 个税项目名称 * cmpschemeid 计算规则ID * * @return */ public List getLaborRemunerationIncomes() { List complexIncomeList = new ArrayList(); ComplexIncome complexIncome = new ComplexIncome(); //姓名 complexIncome.setName(personName); //证照类型 complexIncome.setLicenseType(cardType); complexIncome.setLicenseNumber(cardNumber); //税后收入额 complexIncome.setAbroadIncome(new BigDecimal("123123")); //收入额 complexIncome.setIncome(new BigDecimal("10000")); //所得项目名称 complexIncome.setIncomeItemName("一般劳务报酬所得"); complexIncomeList.add(complexIncome); return complexIncomeList; } /** * 获取全年一次性奖金 * taxItemPlanName 个税项目名称 * cmpschemeid 计算规则ID * * @return */ public List getAnnualOneTimeBonusIncomes() { List complexIncomeList = new ArrayList(); ComplexIncome complexIncome = new ComplexIncome(); //姓名 complexIncome.setName(personName); //证照类型 complexIncome.setLicenseType(cardType); complexIncome.setLicenseNumber(cardNumber); //税后收入额 complexIncome.setAbroadIncome(new BigDecimal("123123")); //收入额 complexIncome.setIncome(new BigDecimal("10000")); //所得项目名称 complexIncome.setIncomeItemName("全年一次性奖金收入"); complexIncomeList.add(complexIncome); return complexIncomeList; } /** * 企业员工列表* * * @return */ private List getCompanyEmployeeList() { List companyEmployeeList = new ArrayList(); //获取人员数据 DetailCompanyEmployee detailCompanyEmployee = getDetailCompanyEmployee(); companyEmployeeList.add(detailCompanyEmployee); return companyEmployeeList; } /** * 解除劳动合同一次性补偿金列表 * * @param caluDataMap * @return */ private List getCompensateIncome( Map>> caluDataMap) { List compensateIncome = new ArrayList(); List> list = caluDataMap.get("jcldhtlb"); for (int i = 0; list != null && i < list.size(); i++) { //个税应用+税款计算初算明细表 Map map = list.get(i); ComplexIncome complexIncome = new ComplexIncome(); //姓名* complexIncome.setName((String) map.get("personName")); //证件类型名称* complexIncome.setLicenseType((String) map.get("cardType")); //证件号码* complexIncome.setLicenseNumber((String) map.get("cardNumber")); //todo 是否自动生成免税附表 complexIncome.setIsAutoGenerateExempt("是"); //当期收入额* complexIncome.setIncome((BigDecimal) map.get("t39")); //免税收入 complexIncome.setExemptIncome((BigDecimal) map.get("t2")); //其他 //complexIncome.setOther(BigDecimal.ZERO); //减免税额 无 complexIncome.setTaxDeduction((BigDecimal) map.get("t17")); //备注 //complexIncome.setRemark(""); //所得项目名称* complexIncome.setIncomeItemName("解除劳动合同一次性补偿金"); //准予扣除的捐赠额 无 complexIncome.setDeductibleDonation((BigDecimal) map.get("t16")); compensateIncome.add(complexIncome); } return compensateIncome; } /** * 一般劳务报酬所得列表 * * @param caluDataMap * @return */ private List getLaborRemunerationIncome(Map>> caluDataMap) { List laborRemunerationIncome = new ArrayList<>(); List> list = caluDataMap.get("lwbclb"); for (int i = 0; list != null && i < list.size(); i++) { Map map = list.get(i); ComplexIncome complexIncome = new ComplexIncome(); //姓名* complexIncome.setName((String) map.get("personName")); //证件类型名称* complexIncome.setLicenseType((String) map.get("cardType")); //证件号码* complexIncome.setLicenseNumber((String) map.get("cardNumber")); //是否明细申报 //complexIncome.setIsDetailedDeclaration(""); //当期收入额* complexIncome.setIncome((BigDecimal) map.get("t1")); //免税收入 complexIncome.setExemptIncome((BigDecimal) map.get("t2")); //商业健康保险 complexIncome.setCommercialHealthInsurance((BigDecimal) map.get("t13")); //税延养老保险 complexIncome.setExtensionEndowmentInsurance((BigDecimal) map.get("t14")); //其他 //complexIncome.setOther(BigDecimal.ZERO); //减免税额 complexIncome.setTaxDeduction((BigDecimal) map.get("t17")); //备注 //complexIncome.setRemark(""); //减除费用 // complexIncome.setDeductionAmount(BigDecimal.ZERO); //应纳税额 //complexIncome.setPayableAmount(BigDecimal.ZERO); //税率 //complexIncome.setTaxRate(BigDecimal.ZERO); //所得项目名称* complexIncome.setIncomeItemName("一般劳务报酬所得"); //允许扣除的税费 complexIncome.setTaxDeductible((BigDecimal) map.get("t18")); laborRemunerationIncome.add(complexIncome); } return laborRemunerationIncome; } /** * 获取全年一次性奖金 * taxItemPlanName 个税项目名称 * cmpschemeid 计算规则ID * * @return */ public ComplexIncome getAnnualOneTimeBonusIncome() throws SQLException, BOSException { ComplexIncome complexIncome = new ComplexIncome(); //姓名 complexIncome.setName(personName); //证照类型 complexIncome.setLicenseType(cardType); complexIncome.setLicenseNumber(cardNumber); //税后收入额 complexIncome.setAbroadIncome(new BigDecimal("123123")); //收入额 complexIncome.setIncome(new BigDecimal("10000")); return complexIncome; } /** * 全年一次性奖金收入列表 * * @return */ private List getAnnualOneTimeBonusIncomeList( Map>> caluDataMap) { List annualOneTimeBonusIncome = new ArrayList<>(); List> list = caluDataMap.get("qnycxjjsslb"); for (int i = 0; list != null && i < list.size(); i++) { Map map = list.get(i); ComplexIncome complexIncome = new ComplexIncome(); //姓名* complexIncome.setName((String) map.get("personName")); //证件类型名称* complexIncome.setLicenseType((String) map.get("cardType")); //证件号码* complexIncome.setLicenseNumber((String) map.get("cardNumber")); //当期收入额* complexIncome.setIncome((BigDecimal) map.get("t1")); //免税收入 complexIncome.setExemptIncome((BigDecimal) map.get("t2")); //其他 //complexIncome.setOther(BigDecimal.ZERO); //减免税额 complexIncome.setTaxDeduction((BigDecimal) map.get("t17")); //备注 //complexIncome.setRemark(""); //所得项目名称* complexIncome.setIncomeItemName("全年一次性奖金收入"); //准予扣除的捐赠额 complexIncome.setDeductibleDonation((BigDecimal) map.get("t16")); annualOneTimeBonusIncome.add(complexIncome); } return annualOneTimeBonusIncome; } /** * 获取正常工资薪金对象 * * @return */ public NormalSalarySpecIncome getNormalSalarySpecIncomes() throws BOSException, EASBizException { //正常工资薪金对象 NormalSalarySpecIncome normalSalarySpecIncome = new NormalSalarySpecIncome(); //正常工资薪金列表 List normalSalarySpec = new ArrayList(); ComplexIncome complexIncome = new ComplexIncome(); //姓名 complexIncome.setName(personName); //证照类型 complexIncome.setLicenseType(cardType); complexIncome.setLicenseNumber(cardNumber); //税后收入额 complexIncome.setAbroadIncome(new BigDecimal("10000")); //收入额 complexIncome.setIncome(new BigDecimal("10000")); //所得项目名称 complexIncome.setIncomeItemName("正常工资薪金"); normalSalarySpecIncome.setNormalSalarySpec(normalSalarySpec); return normalSalarySpecIncome; } /** * 人员 * * @return */ public DetailCompanyEmployee getDetailCompanyEmployee() { //人员对象 DetailCompanyEmployee detailCompanyEmployee = new DetailCompanyEmployee(); //姓名 detailCompanyEmployee.setName(personName); //证照类型 detailCompanyEmployee.setLicenseType(cardType); //证照号码 detailCompanyEmployee.setLicenseNumber(cardNumber); //人员状态 //detailCompanyEmployee.setState(personInfo.getEmployeeType().getName()); ////人员报税信息->任职受雇从业信息 //ITaxPersonRecordEntry iTaxPersonRecordEntry = TaxPersonRecordEntryFactory.getLocalInstance(ctx); //TaxPersonRecordEntryCollection taxPersonRecordEntryCollection = iTaxPersonRecordEntry.getTaxPersonRecordEntryCollection("where person.id = '" + personInfo.getId() + "'"); //TaxPersonRecordEntryInfo taxPersonRecordEntryInfo = taxPersonRecordEntryCollection.get(0); //任职受雇类型 可选择雇员、保险营销员、证券经纪人、其他、实习学生(全日制学历教育) detailCompanyEmployee.setIsEmployee("雇员"); //手机号 detailCompanyEmployee.setPhone("13333282630"); //detailCompanyEmployee.setIsEmployee(taxPersonRecordEntryInfo.getEmployedType().getAlias()); //受雇日期 YYYY-MM-DD,不能大于当前时间,任职受雇类型选择雇员、保险营销员、证券经纪人时必录 SimpleDateFormat inputFormat = new SimpleDateFormat("yyyy-MM-dd"); detailCompanyEmployee.setEmployedDate("2022-10-02"); ////性别 detailCompanyEmployee.setGender("女"); ////出生日期 detailCompanyEmployee.setBirthday("2001-01-01"); //国籍 nationality //NationalityInfo nationality = personInfo.getNationality(); detailCompanyEmployee.setNationality("中国"); return detailCompanyEmployee; } /** * 获取正常工资薪金参数 * * @return */ private NormalSalarySpecIncome getNormalSalarySpecIncome (Map>> caluDataMap) { //正常工资薪金对象 NormalSalarySpecIncome normalSalarySpecIncome = new NormalSalarySpecIncome(); //正常工资薪金是否需要专项* //normalSalarySpecIncome.setZcgzxjsfxyzx(""); //正常工资薪金是否传入累计(申报/单月计算时使用) //normalSalarySpecIncome.setZcgzxjsfcrlj(""); //年金算税上限选项 normalSalarySpecIncome.setAnnuityAndHouseProvidentFundOption(""); //个人养老金策略 normalSalarySpecIncome.setPersonalPensionOption(""); //上月个人养老金策略 normalSalarySpecIncome.setLastMonthPersonalPensionOption(""); List normalSalarySpec = new ArrayList<>(); //正常工资薪金(带专项)列表* normalSalarySpecIncome.setNormalSalarySpec(normalSalarySpec); List> list = caluDataMap.get("zcgzxjlb"); for (int i = 0; list != null && i < list.size(); i++) { Map map = list.get(i); ComplexIncome complexIncome = new ComplexIncome(); //姓名* complexIncome.setName((String) map.get("personName")); //证件类型名称* complexIncome.setLicenseType((String) map.get("cardType")); //证件号码* complexIncome.setLicenseNumber((String) map.get("cardNumber")); //是否明细申报 //complexIncome.setIsDetailedDeclaration(""); //当期收入额* complexIncome.setIncome((BigDecimal) map.get("t1")); //免税收入 complexIncome.setExemptIncome((BigDecimal) map.get("t2")); //基本养老保险 complexIncome.setEndowmentInsurance((BigDecimal) map.get("t3")); //基本医疗保险 complexIncome.setMedicalInsurance((BigDecimal) map.get("t4")); //失业保险 complexIncome.setUnemploymentInsurance((BigDecimal) map.get("t5")); //住房公积金 complexIncome.setHouseProvidentFund((BigDecimal) map.get("t6")); //子女教育支出 complexIncome.setChildEducationExpenditure((BigDecimal) map.get("t64")); //赡养老人支出 complexIncome.setSupportElderExpenditure((BigDecimal) map.get("t65")); //住房租金支出 complexIncome.setHouseRentExpenditure((BigDecimal) map.get("t67")); //房屋贷款支出 complexIncome.setHouseLoanExpenditure((BigDecimal) map.get("t66")); //继续教育支出 complexIncome.setContinueEducationExpenditure((BigDecimal) map.get("t68")); //婴幼儿照护支出 complexIncome.setBabyCareExpenditure((BigDecimal) map.get("t70")); //todo 企业年金/职业年金 complexIncome.setAnnuity(BigDecimal.ZERO); //商业健康保险 complexIncome.setCommercialHealthInsurance((BigDecimal) map.get("t13")); //税延养老保险 complexIncome.setExtensionEndowmentInsurance((BigDecimal) map.get("t14")); //其他 complexIncome.setOther(BigDecimal.ZERO); //减免税额 complexIncome.setTaxDeduction(BigDecimal.ZERO); //备注 根据政策要求,填写【其他】项,一定在备注中写明具体扣除项目名称 complexIncome.setRemark(""); //应纳税额 complexIncome.setPayableAmount(BigDecimal.ZERO); //已缴税额 complexIncome.setPaidAmount(BigDecimal.ZERO); //税率 complexIncome.setTaxRate(BigDecimal.ZERO); //所得项目名称 complexIncome.setIncomeItemName("正常工资薪金"); //累计收入额 本年累计收入=本期所有的工资薪金所得收入之和+往期工资薪金所得收入之和(见税款计算) complexIncome.setAccumulatedIncome(BigDecimal.ZERO); //累计专项扣除额 complexIncome.setAccumulatedSpecDeduction(BigDecimal.ZERO); //累计其他扣除额 complexIncome.setAccumulatedOtherDeduction(BigDecimal.ZERO); //累计减除费用额 complexIncome.setAccumulatedDeductionAmount(BigDecimal.ZERO); //累计子女教育支出 complexIncome.setAccumulatedChildEducation(BigDecimal.ZERO); //累计继续教育支出 complexIncome.setAccumulatedContinueEducation(BigDecimal.ZERO); //累计住房租金支出 complexIncome.setAccumulatedHouseRent(BigDecimal.ZERO); //累计房屋贷款支出 complexIncome.setAccumulatedHouseLoan(BigDecimal.ZERO); //累计赡养老人支出 complexIncome.setAccumulatedSupportElder(BigDecimal.ZERO); //累计3岁以下婴幼儿照护支出 complexIncome.setAccumulatedBabyCare(BigDecimal.ZERO); //累计准予扣除的捐赠额 complexIncome.setAccumulatedDeductibleDonation(BigDecimal.ZERO); //累计个人养老金 complexIncome.setAccumulatedPersonalPension(BigDecimal.ZERO); //累计个人养老金校验码 complexIncome.setAccumulatedPersonalPensionCheckCode(""); //准予扣除的捐赠额 complexIncome.setDeductibleDonation(BigDecimal.ZERO); //试用公式 complexIncome.setFormula(""); //境内工作天数 complexIncome.setDomesticWorkingDays(BigDecimal.ZERO); //境外工作天数 complexIncome.setAbroadWorkingDays(BigDecimal.ZERO); //境外支付 complexIncome.setAbroadIncome(BigDecimal.ZERO); //境内支付 complexIncome.setDomesticIncome(BigDecimal.ZERO); normalSalarySpec.add(complexIncome); } return normalSalarySpecIncome; } /** * 获取企业人员列表 */ private List getCompanyEmployeeList(Map>> caluDataMap) { List companyEmployeeList = new ArrayList<>(); List> list = caluDataMap.get("zcgzxjlb"); for (int i = 0; list != null && i < list.size(); i++) { Map map = list.get(i); DetailCompanyEmployee employee = new DetailCompanyEmployee(); //姓名* employee.setName((String) map.get("personName")); //证件类型名称* employee.setLicenseType((String) map.get("cardType")); //证件号码* employee.setLicenseNumber((String) map.get("cardNumber")); //部门编号 //employee.setDeptNo(""); //工号 employee.setEmployeeNumber((String) map.get("personNumber")); //所属期 //employee.setPeriod(""); //手机号码 中国籍必填;非中国籍首次入境时间超过一个月必填; employee.setPhone((String) map.get("phoneNumber")); //人员状态* 默认为正常,可选择正常/非正常 employee.setState((String) map.get("personstatusName")); //是否雇员* 可选择雇员、保险营销员、证券经纪人、其他、实习学生(全日制学历教育) employee.setIsEmployee((String) map.get("employedtypeName")); //入职年度就业情况 当雇员保险营销员、证券经纪人时可选择:当年首次入职学生、当年首次入职其他人员。其他情况下填写默认为空 employee.setFirstEmploymentSituation((String) map.get("situationName")); //受雇日期 employee.setEmployedDate((String) map.get("employeddate")); //性别* 男/女 employee.setGender((String) map.get("gender")); //出生日期* YYYY-MM-DD 需要和身份证上保持一致 employee.setBirthday((String) map.get("birthday")); //国籍* employee.setNationality((String) map.get("nationalityName")); //人员地区* 境内/境外 employee.setArea((String) map.get("isoversea")); //离职日期 employee.setResignDate((String) map.get("departuredate")); //个人投资总额 employee.setPersonInvestment((BigDecimal) map.get("investmenttotal")); //个人投资比例 employee.setPersonInvestmentRatio((BigDecimal) map.get("investmentrate")); //是否残疾 String isdisability = (String) map.get("isdisability"); employee.setIsDisabled(isdisability); if ("是".equals(isdisability)) { //todo 残疾证件类型 employee.setDisableCardTypeName("残疾证"); } //是否烈属 employee.setIsMartyr((String) map.get("ishero")); //是否孤老 employee.setIsBereavedGaffer((String) map.get("isold")); //残疾证号 employee.setDisableCardNumber((String) map.get("discardnumber")); //烈属证号 employee.setMartyrCardNumber((String) map.get("herocardnumber")); //电子邮箱 employee.setEmail((String) map.get("email")); //学历 employee.setEducation((String) map.get("diploma")); //职务 employee.setPosition((String) map.get("positionName")); //开户银行省份(名字) employee.setDepositBankProvinceName((String) map.get("bankcardprovince")); //开户银行 employee.setDepositBank((String) map.get("bankcardprovince")); //银行账号 employee.setBankAccount((String) map.get("account")); //居住省份 employee.setResidentProvince((String) map.get("address")); //居住城市 employee.setResidentCity((String) map.get("addresscity")); //居住区县 employee.setResidentDistrict((String) map.get("addresscounty")); //居住街道 employee.setResidentStreet((String) map.get("addressstreet")); //户籍省份 employee.setCensusProvince((String) map.get("hometown")); //户籍城市 employee.setCensusCity((String) map.get("hometowncity")); //户籍区县 employee.setCensusDistrict((String) map.get("hometowncountry")); //户籍街道 employee.setCensusStreet((String) map.get("hometownstreet")); //户籍详细地址 employee.setCensusAddress((String) map.get("hometowndetailed")); //备注 employee.setEmpRemark((String) map.get("desc")); //出生地 employee.setBirthplace((String) map.get("birthplaceName")); //首次入境时间 employee.setFirstEntryDate((String) map.get("entrydate")); //预计离境时间 employee.setEstimatedDepartureDate((String) map.get("leavedate")); //联系地省份 employee.setContactProvince((String) map.get("contactaddress")); //联系地城市 employee.setContactCity((String) map.get("contactcity")); //联系地区县 employee.setContactDistrict((String) map.get("contactcountry")); //联系地街道 employee.setContactStreet((String) map.get("contactstreet")); //联系地详细地址 employee.setContactStreet((String) map.get("contactdetailed")); //中文名 employee.setChineseName((String) map.get("chinesename")); //涉税事项 employee.setTaxRelatedReason((String) map.get("taxreason")); //其他证件号码 employee.setOtherLicenseNumber((String) map.get("othercardnumber")); //其他证件类型 其他证件类型为:外国人永久居留身份证(外国人永久居留证),外国护照,中华人民共和国外国人工作许可证(A类),中华人民共和国外国人工作许可证(B类),中华人民共和国外国人工作许可证(C类),中华人民共和国港澳居民居住证,中华人民共和国台湾居民居住证,中国护照,港澳居民来往内地通行证,台湾居民来往大陆通行证,其他证件号码必填 employee.setOtherLicenseType((String) map.get("othercardtype")); //是否扣除减除费用(原是否主单位) employee.setIsMainUnits((String) map.get("deductfees")); companyEmployeeList.add(employee); } return companyEmployeeList; } }