Ver Fonte

反算 个税

“luojun” há 8 meses atrás
pai
commit
4c1b1d6703

+ 18 - 13
websrc/com/kingdee/eas/custom/compensation/handler/CmpCalDynamicListHandlerExExEx.java

@@ -117,18 +117,23 @@ public class CmpCalDynamicListHandlerExExEx extends CmpCalDynamicListHandlerExEx
             if (cmpCalTableCollection.size() > 0) {
                 for (int i = 0; i < cmpCalTableCollection.size(); i++) {
                     String personId = cmpCalTableCollection.get(i).getPerson().getId().toString();
-                    //获取纳税单位
-                    String sql = getSalaryOrgMappingByPersonId(personId);
-                    logger.error("getSalaryOrgMappingByPersonId--------" + sql);
-                    IRowSet iRowSet = DbUtil.executeQuery(ctx, sql);
-                    String taxUnitId = null;
-                    while (iRowSet.next()) {
-                        taxUnitId = iRowSet.getString("taxunit");
-                    }
-                    if (!StringUtils.isEmpty(taxUnitId)) {
-                        //throw new ShrWebBizException("员工ID:" + personId + "未获取到纳税单位!!");
-                        TaxUnitAndPerson taxUnitAndPerson = new TaxUnitAndPerson(taxUnitId, personId);
-                        taxUnitAndPeople.add(taxUnitAndPerson);
+                    //查询是否存在税后保实发
+                    Integer abroadIncome = getAbroadIncome(personId, cmpschemeid);
+                    logger.error("abroadIncome-----------" + personId + "--------------" + cmpschemeid);
+                    if (abroadIncome != null) {
+                        //获取纳税单位
+                        String sql = getSalaryOrgMappingByPersonId(personId);
+                        logger.error("getSalaryOrgMappingByPersonId--------" + sql);
+                        IRowSet iRowSet = DbUtil.executeQuery(ctx, sql);
+                        String taxUnitId = null;
+                        while (iRowSet.next()) {
+                            taxUnitId = iRowSet.getString("taxunit");
+                        }
+                        if (!StringUtils.isEmpty(taxUnitId)) {
+                            //throw new ShrWebBizException("员工ID:" + personId + "未获取到纳税单位!!");
+                            TaxUnitAndPerson taxUnitAndPerson = new TaxUnitAndPerson(taxUnitId, personId);
+                            taxUnitAndPeople.add(taxUnitAndPerson);
+                        }
                     }
                 }
             }
@@ -186,7 +191,7 @@ public class CmpCalDynamicListHandlerExExEx extends CmpCalDynamicListHandlerExEx
                     JSONObject json = new JSONObject();
                     json.put("requestId", requestId);
                     json.put("param", jsonObject.toString());
-                    isyUtilsFacade.addTask("synIndividualIncomeTaxService", json.toJSONString(), TaskCatalogEnum.PERSON, "");
+                    isyUtilsFacade.addTask("synIndividualIncomeTaxService", json.toJSONString(), TaskCatalogEnum.UN_CAL_GET, "");
                     //isyUtilsFacade.backTask("https://test-openapi.17win.com/gateway/iit/reverseCalculateTax/getASynIndividualIncomeTaxFeedback", requestId, "synIndividualIncomeTaxService", jsonObject.toString(), TaskCatalogEnum.CAL_GET);
                     //查询反算反馈结果
                     //ISYUtilsFacade isyUtilsFacade = SYUtilsFacadeFactory.getLocalInstance(ctx);

+ 4 - 3
websrc/com/kingdee/eas/custom/compensation/service/SynIncomeTaxDeclareService.java

@@ -92,7 +92,9 @@ public class SynIncomeTaxDeclareService implements IHRMsfService {
                 body = feedback.getBody();
                 logInfo.setOutParameter(mapper.writeValueAsString(body));//回参
                 LogInfoFactory.getLocalInstance(context).addnew(logInfo);
-                saveTaxDeclaration(context, param);
+                if (body.getDeclarationStateCode().equals("6") || body.getDeclarationStateCode().equals("5")) {
+                    saveTaxDeclaration(context, param);
+                }
             }
             return MessageResult.SUCCESS(mapper.writeValueAsString(body));
         } catch (IOException e) {
@@ -112,8 +114,7 @@ public class SynIncomeTaxDeclareService implements IHRMsfService {
     public void saveTaxDeclaration(Context ctx, JSONObject param) throws BOSException, EASBizException {
         logger.error("saveTaxDeclaration------------------");
         //个税申报ID
-        String taxDeclarId = param.getString("taxDeclarId");
-
+        //String taxDeclarId = param.getString("taxDeclarId");
         //个税申报批次号
         String taxDeclarBatchNo = param.getString("taxDeclarBatchNo");
         IIncomeTaxDeclar iIncomeTaxDeclar = IncomeTaxDeclarFactory.getLocalInstance(ctx);

+ 3 - 3
websrc/com/kingdee/eas/custom/individualback/TaxPersonRecordListHandlerExEx.java

@@ -127,8 +127,8 @@ public class TaxPersonRecordListHandlerExEx extends TaxPersonRecordListHandlerEx
         //上个月数据
         //TaxPersonRecordEntryCollection taxPersonRecordEntryCollUp = iTaxPersonRecordEntry.getTaxPersonRecordEntryCollection("select * ,person.* where  taxUnit = '" + taxUnitId + "' and lastReportMonth = '" + previousMonth + "' ");
         //人员报税信息数据
-        //TaxPersonRecordEntryCollection taxPersonRecordEntryCollDn = iTaxPersonRecordEntry.getTaxPersonRecordEntryCollection("select * ,person.*  where  taxUnit = '" + taxUnitId + "' and  personStatus = '1' ");
-        TaxPersonRecordEntryCollection taxPersonRecordEntryCollDn = iTaxPersonRecordEntry.getTaxPersonRecordEntryCollection("select * ,person.*  where personStatus = '1' ");
+        TaxPersonRecordEntryCollection taxPersonRecordEntryCollDn = iTaxPersonRecordEntry.getTaxPersonRecordEntryCollection("select * ,person.*  where  taxUnit = '" + taxUnitId + "' and  personStatus = '1' ");
+        //TaxPersonRecordEntryCollection taxPersonRecordEntryCollDn = iTaxPersonRecordEntry.getTaxPersonRecordEntryCollection("select * ,person.*  where personStatus = '1' ");
         //保存上个月的核算人员
         //List<String> listUp = new ArrayList<>();
         //for (int i = 0; i < personIds.size(); i++) {
@@ -303,7 +303,7 @@ public class TaxPersonRecordListHandlerExEx extends TaxPersonRecordListHandlerEx
                     //人员
                     taxPersonRecordInfo.setPerson(personInfo);
                     //报税姓名
-                    taxPersonRecordInfo.setReportName("测试" + personInfo.getName());
+                    taxPersonRecordInfo.setReportName(personInfo.getName());
                     //证件类型
                     if (personInfo.getIdCardNO() != null || personInfo.getPassportNO() != null) {
                         if (null == personInfo.getIdCardNO()) {