Jelajahi Sumber

直接执行更新为后台任务执行模式

9060 8 bulan lalu
induk
melakukan
0156dca3af
17 mengubah file dengan 2616 tambahan dan 1056 penghapusan
  1. 0 905
      websrc/com/kingdee/eas/custom/shuiyou/inter/handler/InterInitDynamicListHandlerEx.java
  2. 61 0
      websrc/com/kingdee/eas/custom/shuiyou/inter/handler/TaskListHandler.java
  3. 683 0
      websrc/com/kingdee/eas/custom/shuiyou/inter/handler/TaxUnitListHandlerEx.java
  4. 0 61
      websrc/com/kingdee/eas/custom/shuiyou/service/PersonnelReportService.java
  5. 44 0
      websrc/com/kingdee/eas/custom/shuiyou/six/handler/CmpTaxDeclarationListHandlerEx.java
  6. 201 13
      websrc/com/kingdee/eas/custom/shuiyou/six/handler/TaxDirectDeductionListHandlerEx.java
  7. 790 0
      websrc/com/kingdee/eas/custom/shuiyou/six/handler/TaxPersonRecordListHandlerEx.java
  8. 253 0
      websrc/com/kingdee/eas/custom/shuiyou/six/osf/GetCompanyIncomesService.java
  9. 148 0
      websrc/com/kingdee/eas/custom/shuiyou/six/osf/GetPensionDownloadFeedback.java
  10. 51 0
      websrc/com/kingdee/eas/custom/shuiyou/six/osf/GetPensionDownloadService.java
  11. 110 3
      websrc/com/kingdee/eas/custom/shuiyou/six/osf/GetPreDeductConfirmFeedBack.java
  12. 52 0
      websrc/com/kingdee/eas/custom/shuiyou/six/osf/GetPreDeductConfirmService.java
  13. 85 51
      websrc/com/kingdee/eas/custom/shuiyou/six/osf/GetQuerySpecialAmountFeedback.java
  14. 1 1
      websrc/com/kingdee/eas/custom/shuiyou/six/osf/PensionInfoService.java
  15. 110 0
      websrc/com/kingdee/eas/custom/shuiyou/six/osf/PersonnelReportService.java
  16. 26 20
      websrc/com/kingdee/eas/custom/shuiyou/six/osf/QuerySpecialAmountService.java
  17. 1 2
      websrc/com/kingdee/eas/custom/shuiyou/six/osf/SixtyThousandConfirmService.java

+ 0 - 905
websrc/com/kingdee/eas/custom/shuiyou/inter/handler/InterInitDynamicListHandlerEx.java

@@ -1,905 +0,0 @@
-package com.kingdee.eas.custom.shuiyou.inter.handler;
-
-import cn.hutool.core.util.StrUtil;
-import cn.hutool.json.JSONUtil;
-import com.kingdee.bos.BOSException;
-import com.kingdee.bos.Context;
-import com.kingdee.bos.dao.IObjectPK;
-import com.kingdee.bos.dao.ormapping.ObjectUuidPK;
-import com.kingdee.bos.util.BOSUuid;
-import com.kingdee.bos.util.EASResource;
-
-import com.kingdee.eas.basedata.person.Genders;
-import com.kingdee.eas.basedata.person.PersonInfo;
-import com.kingdee.eas.custom.shuiyou.RequestTypeEnum;
-import com.kingdee.eas.custom.shuiyou.incomeTax.ITaxSpeAddDedReportExFacade;
-import com.kingdee.eas.custom.shuiyou.incomeTax.TaxSpeAddDedReportExFacadeFactory;
-import com.kingdee.eas.custom.shuiyou.six.osf.vo.SixTPersonInfo;
-import com.kingdee.eas.custom.shuiyou.six.osf.vo.SpecialAmountInfo;
-import com.kingdee.eas.custom.shuiyou.task.TaskCatalogEnum;
-import com.kingdee.eas.custom.shuiyou.task.TaskFactory;
-import com.kingdee.eas.custom.shuiyou.task.TaskInfo;
-import com.kingdee.eas.custom.shuiyou.uitls.ISYUtilsFacade;
-import com.kingdee.eas.custom.shuiyou.uitls.SYUtilsFacadeFactory;
-import com.kingdee.eas.framework.CoreBaseCollection;
-import com.kingdee.eas.util.app.DbUtil;
-import com.kingdee.jdbc.rowset.IRowSet;
-import com.kingdee.shr.base.syssetting.api.bean.BatchMessageTipsBody;
-import com.kingdee.shr.base.syssetting.api.bean.BatchMessageTipsHeader;
-import com.kingdee.shr.base.syssetting.app.filter.HRFilterUtils;
-import com.kingdee.shr.base.syssetting.context.SHRContext;
-import com.kingdee.shr.base.syssetting.exception.SHRWebException;
-import com.kingdee.shr.base.syssetting.exception.ShrWebBizException;
-
-import com.kingdee.shr.compensation.*;
-import com.kingdee.shr.compensation.app.incomeTax.ITaxPersonReportFacade;
-import com.kingdee.shr.compensation.app.incomeTax.TaxPersonReportFacadeFactory;
-import com.kingdee.shr.compensation.app.tax.*;
-import com.kingdee.shr.compensation.app.tax.base.TaxItemInfo;
-import com.kingdee.shr.compensation.app.taxCal.*;
-import com.kingdee.shr.compensation.app.taxCal.vo.TaxCalBasicVO;
-import com.kingdee.shr.compensation.exception.ExceptionHandle;
-import com.kingdee.shr.compensation.taxCal.util.TaxItemUtil;
-import com.kingdee.shr.compensation.util.Base64Utils;
-import com.kingdee.shr.compensation.util.CmpDateUtil;
-import com.kingdee.shr.compensation.util.CmpStrUtil;
-import com.kingdee.shr.compensation.web.handler.taxCal.inter.InterInitDynamicListHandler;
-
-import org.apache.commons.lang3.StringUtils;
-import org.apache.log4j.Logger;
-import org.springframework.ui.ModelMap;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.math.BigDecimal;
-import java.sql.SQLException;
-import java.sql.Timestamp;
-import java.text.MessageFormat;
-import java.text.SimpleDateFormat;
-import java.util.*;
-
-/**
- * description: InterInitDynamicListHandler <br>
- * date: 2024/9/5 10:05 <br>
- * author: lhbj <br>
- * version: 1.0 <br>
- */
-public class InterInitDynamicListHandlerEx extends InterInitDynamicListHandler {
-    private static final long serialVersionUID = 1L;
-
-    private Map<String, String> taskMap;
-    private Map<String, Map<String, Object>> dataMap = new HashMap();
-    private List<String> sumTaxList;
-    private List<String> allTaxItemList;
-    private static final int FIXED_PARA_COUNT = 15;
-    private String userId;
-    private boolean isDelete = false;
-    private boolean isFbSubmit;
-
-    private static final Logger LOG = Logger.getLogger(InterInitDynamicListHandlerEx.class);
-    private boolean checkParams(Map<String, Object> paramMap) {
-        if (!paramMap.containsKey("accept_id") && !paramMap.containsKey("RELAYTASK")) {
-            return true;
-        } else {
-            return !paramMap.containsKey("TaxPersonRecordEntryIDS");
-        }
-    }
-    public void calTaxAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws SHRWebException {
-        Context ctx = SHRContext.getInstance().getContext();
-        String filterSql = this.getFilterSql(request, response, modelMap);
-        List<String> allIdList = new ArrayList();
-        List<String> succList = new ArrayList();
-        BatchMessageTipsHeader header = new BatchMessageTipsHeader();
-        int sucsess = 0;
-        int fail = 0;
-        int count = 0;
-        java.sql.Date periodBegin = null;
-        StringBuilder str = new StringBuilder();
-        str.append(" SELECT DETAIL.FID ID,detail.FTaxUnitID, DETAIL.FSTATE, DETAIL.FPERIODEND, DETAIL.FINCOMEITEMID,RECORD.FID RECORDID, ENTRY.FID ENTRYID,ENTRY.FACCEPTID FACCEPTID,ENTRY.FSUBMITSTATUS, ENTRY.FEMPLOYEDDATE, ");
-        str.append(" PERSON.FNAME_L2 NAME, PERSON.FNUMBER PERNUMBER, DETAIL.FPERIODBEGIN, ti.fName_l2 incomeItemName ");
-        str.append(" FROM T_HR_STAXCALINITDETAIL DETAIL ");
-        str.append(" INNER JOIN T_BD_PERSON PERSON ON DETAIL.FPERSONID = PERSON.FID ");
-        str.append(" LEFT JOIN T_HR_STAXPERSONRECORD RECORD ON RECORD.FPERSONID = PERSON.FID ");
-        str.append(" LEFT JOIN t_hr_sTaxIncomeItem ti ON DETAIL.fIncomeItemId = ti.fid ");
-        str.append(" LEFT JOIN T_HR_STAXPERSONRECORDENTRY ENTRY ON DETAIL.FPERSONID = ENTRY.FPERSONID ");
-        str.append(" AND detail.FTaxUnitID = entry.FTaxUnitID ");
-        str.append(" WHERE DETAIL.FID IN (").append(filterSql).append(")");
-        LOG.error(str);
-        try {
-            String sql = "select id,isAutoDeduct where id in(select FTaxUnitID from T_HR_STAXCALINITDETAIL where fid in (" + filterSql + "))";
-            TaxUnitCollection taxUnitCollection = TaxUnitFactory.getLocalInstance(ctx).getTaxUnitCollection(sql);
-            Set<String> autoDeductTaxUnit = new HashSet();
-            if (null != taxUnitCollection && taxUnitCollection.size() > 0) {
-                int i = 0;
-
-                for(int size = taxUnitCollection.size(); i < size; ++i) {
-                    TaxUnitInfo taxUnitInfo = taxUnitCollection.get(i);
-                    IsAllowedQuoted isAutoDeduct = taxUnitInfo.getIsAutoDeduct();
-                    if (1 == isAutoDeduct.getValue()) {
-                        autoDeductTaxUnit.add(taxUnitInfo.getId().toString());
-                    }
-                }
-            }
-
-            IRowSet rowSet1 = DbUtil.executeQuery(ctx, str.toString());
-
-            while(rowSet1.next()) {
-                if (count == 0) {
-                    periodBegin = rowSet1.getDate("FPERIODBEGIN");
-                }
-
-                ++count;
-                if (null != periodBegin && !periodBegin.equals(rowSet1.getDate("FPERIODBEGIN"))) {
-                    throw new ShrWebBizException(EASResource.getString("com.kingdee.shr.compensation.resource.CommonResource", "label69", ctx.getLocale()));
-                }
-
-                boolean isSuccess = true;
-                boolean isAutoDeductBoolean = autoDeductTaxUnit.contains(rowSet1.getString("FTaxUnitID"));
-                String incomeItemID = rowSet1.getString("FINCOMEITEMID");
-                String msg = EASResource.getString("com.kingdee.shr.compensation.resource.CommonResource", "label70", ctx.getLocale());
-                BatchMessageTipsBody body = new BatchMessageTipsBody();
-                body.setId(rowSet1.getString("ID"));
-                if (com.kingdee.util.StringUtils.isEmpty(rowSet1.getString("RECORDID"))) {
-                    isSuccess = false;
-                    msg = EASResource.getString("com.kingdee.shr.compensation.resource.CommonResource", "label71", ctx.getLocale());
-                } else if (com.kingdee.util.StringUtils.isEmpty(rowSet1.getString("ENTRYID"))) {
-                    isSuccess = false;
-                    msg = EASResource.getString("com.kingdee.shr.compensation.resource.CommonResource", "label72", ctx.getLocale());
-                } else if (30 != rowSet1.getInt("FSTATE") && 40 != rowSet1.getInt("FSTATE")) {
-                    if (rowSet1.getDate("FPERIODEND").before(rowSet1.getDate("FEMPLOYEDDATE"))) {
-                        isSuccess = false;
-                        msg = EASResource.getString("com.kingdee.shr.compensation.resource.CommonResource", "label77", ctx.getLocale());
-                    } else if ("1".equals(rowSet1.getString("FSubmitStatus")) && com.kingdee.util.StringUtils.isEmpty(rowSet1.getString("FAcceptId"))) {
-                        isSuccess = false;
-                        msg = EASResource.getString("com.kingdee.shr.compensation.resource.CommonResource", "label75", ctx.getLocale());
-                    } else if (null == rowSet1.getDate("FEMPLOYEDDATE")) {
-                        isSuccess = false;
-                        msg = EASResource.getString("com.kingdee.shr.compensation.resource.CommonResource", "label76", ctx.getLocale());
-                    } else if (("0".equals(rowSet1.getString("FSubmitStatus")) || "3".equals(rowSet1.getString("FSubmitStatus"))) && com.kingdee.util.StringUtils.isEmpty(rowSet1.getString("FAcceptId"))) {
-                        if (isAutoDeductBoolean && "8r0AAABCg2PDiOoP".equals(incomeItemID)) {
-                            msg = "该员工未进行人员报送,已同时生成人员报送任务、专项附加扣除申报任务和税款计算任务到金税系统,需要等待几分钟,可在任务执行监控中查看运行进度;算税完成后将会推送消息告知";
-                        } else {
-                            msg = EASResource.getString("com.kingdee.shr.compensation.resource.CommonResource", "label74", ctx.getLocale());
-                        }
-                    }
-                } else {
-                    isSuccess = false;
-                    msg = MessageFormat.format(EASResource.getString("com.kingdee.shr.compensation.resource.CommonResource", "label73", ctx.getLocale()), TaxCalInitDetailStateEnum.getEnum(rowSet1.getInt("FSTATE")).getAlias());
-                }
-
-                if (isSuccess) {
-                    ++sucsess;
-                    succList.add(rowSet1.getString("ID"));
-                } else {
-                    ++fail;
-                }
-
-                body.setMuitTipsState(isSuccess);
-                body.setMuitTipsMessage(msg);
-                List<Object> messageListExt = new ArrayList();
-                messageListExt.add(rowSet1.getString("NAME"));
-                messageListExt.add(rowSet1.getString("PERNUMBER"));
-                messageListExt.add(rowSet1.getString("incomeItemName"));
-                body.addMessageListExt(messageListExt);
-                header.addResult(body);
-                allIdList.add(rowSet1.getString("ID"));
-            }
-        } catch (Exception var25) {
-            ExceptionHandle.handleException(var25);
-        }
-
-        header.setBillId(CmpStrUtil.convertListToString(allIdList));
-        header.setFailureCount(fail);
-        header.setSuccessCount(sucsess);
-
-        try {
-            this._submitInitData(ctx,CmpStrUtil.convertCollectionToSql(succList), (String)null, TaxCalTaskCatalogEnum.CAL);
-        } catch (BOSException var24) {
-            ExceptionHandle.handleException(var24);
-        }
-
-        this.writeSuccessData(header);
-    }
-    protected String _submitInitData(Context ctx, String initIds, String relayTaskID, TaxCalTaskCatalogEnum taskCatalog) throws BOSException {
-        if (!com.kingdee.util.StringUtils.isEmpty(initIds) && !"''".equals(initIds)) {
-            LOG.error("_submitInitData:");
-            this.isFbSubmit = taskCatalog == TaxCalTaskCatalogEnum.FB_UPLOAD;
-            this.initUserID(ctx, relayTaskID);
-            this.updateAcceptId(ctx, initIds);
-            String taskId = this.createTask(ctx, initIds, taskCatalog);
-
-            this.getTaxItem(ctx);
-            this.updateLastTaskDetail(ctx, initIds);
-            String insertSql = this.getInsertTaskDetailSql();
-            List<Object[]> paramsList = this.getParamListData(ctx, initIds);
-            DbUtil.executeBatch(ctx, insertSql, paramsList);
-            if (!this.isFbSubmit) {
-                this.updateTaxCalInitData(ctx, initIds);
-            }
-
-            return taskId;
-        } else {
-            return null;
-        }
-    }
-
-    private void initUserID(Context ctx, String relayTaskId) {
-        this.userId = HRFilterUtils.getCurrentUserId(ctx);
-        if (("00000000-0000-0000-0000-00000000000013B7DE7F".equals(this.userId) || "256c221a-0106-1000-e000-10d7c0a813f413B7DE7F".equals(this.userId)) && !com.kingdee.util.StringUtils.isEmpty(relayTaskId)) {
-            String getCreatorSQL = " select top 1 FCreatorID from T_HR_STAXCALTASK where fid = '" + relayTaskId + "'";
-
-            try {
-                IRowSet rowSet = DbUtil.executeQuery(ctx, getCreatorSQL);
-                if (rowSet.next()) {
-                    this.userId = rowSet.getString("FCreatorID");
-                }
-            } catch (Exception var5) {
-                var5.printStackTrace();
-            }
-        }
-
-    }
-    private void updateAcceptId(Context ctx, String initIds) throws BOSException {
-        String str = " update T_HR_STAXCALINITDETAIL detail set FAcceptId = ( select FAcceptId from T_HR_STaxPersonRecordEntry entry  where detail.FTaxUnitId = entry.FTaxUnitId and detail.FPersonId = entry.FPersonId)  where fid in (" + initIds + ") ";
-        DbUtil.execute(ctx, str);
-    }
-
-    private void updateTaxCalInitData(Context ctx, String initIds) throws BOSException {
-        String sql = "UPDATE T_HR_STAXCALINITDETAIL SET FSTATE = 30 WHERE FID IN (" + initIds + ")  ";
-        DbUtil.execute(ctx, sql);
-    }
-
-    private void getTaxItem(Context ctx) {
-        this.allTaxItemList = new ArrayList();
-        this.sumTaxList = new ArrayList();
-        com.kingdee.shr.compensation.app.tax.base.TaxItemCollection itemColl = TaxItemUtil.getAllTaxItem(ctx, true);
-
-        for(int i = 0; i < itemColl.size(); ++i) {
-            TaxItemInfo info = itemColl.get(i);
-            this.allTaxItemList.add("T" + info.getFieldSn());
-            boolean isSum = info.isIsSum();
-            if (isSum) {
-                this.sumTaxList.add("T" + info.getFieldSn());
-            }
-        }
-    }
-    private void updateLastTaskDetail(Context ctx, String initIds) throws BOSException {
-        String str = " UPDATE T_HR_STAXCALTASKDETAIL A01 SET FDATASTATE = 30 WHERE EXISTS(  SELECT 1 FROM T_HR_STAXCALINITDETAIL A02  WHERE FID IN (" + initIds + ") " + " AND A01.FCMPCALTABLEID = A02.FCMPCALTABLEID) " + " AND A01.FDATASTATE = " + 10;
-        DbUtil.execute(ctx, str);
-    }
-
-    private String createTask(Context ctx, String initIds, TaxCalTaskCatalogEnum catalog) throws BOSException {
-        this.taskMap = new HashMap();
-        String str = " SELECT t.fTaxUnitId, t.fPeriodBegin, t.fIncomeItemId, e.FAcceptId, e.fid entryId, e.FSubmitStatus from T_HR_STaxCalInitDetail t left join T_HR_STaxPersonRecordEntry e  on t.fPersonId = e.fPersonId and t.fTaxUnitId = e.fTaxUnitId where t.fid IN (" + initIds + ")";
-        IRowSet rowSet = DbUtil.executeQuery(ctx, str);
-        if (rowSet.size() < 1) {
-            throw new BOSException(EASResource.getString("com.kingdee.shr.compensation.resource.TaxCalBaseResource", "label31", ctx.getLocale()));
-        } else {
-            HashMap taxUnitGroups = new HashMap();
-
-            try {
-                while(rowSet.next()) {
-                    String taxUnitId = rowSet.getString("fTaxUnitId");
-                    List<TaxCalBasicVO> calcList = (List)taxUnitGroups.get(taxUnitId);
-                    if (null == calcList) {
-                        calcList = new ArrayList();
-                        taxUnitGroups.put(taxUnitId, calcList);
-                    }
-
-                    TaxCalBasicVO vo = new TaxCalBasicVO();
-                    vo.setPeriodBegin(rowSet.getDate("fPeriodBegin"));
-                    vo.setTaxUnitId(rowSet.getString("fTaxUnitId"));
-                    vo.setIncomeItemId(rowSet.getString("fIncomeItemId"));
-                    vo.setAcceptId(rowSet.getString("FAcceptId"));
-                    vo.setSubmitStatus(rowSet.getString("FSubmitStatus"));
-                    vo.setEntryId(rowSet.getString("entryId"));
-                    ((List)calcList).add(vo);
-                }
-            } catch (SQLException var21) {
-                LOG.error(var21.getMessage(), var21);
-                throw new BOSException(var21.getMessage());
-            }
-
-            ITaxPersonReportFacade taxPersonReport = TaxPersonReportFacadeFactory.getLocalInstance(ctx);
-            ITaxSpeAddDedReportFacade taxSpeAddDedReportFacade = TaxSpeAddDedReportFacadeFactory.getLocalInstance(ctx);
-            ITaxSpeAddDedReportExFacade exFacade = TaxSpeAddDedReportExFacadeFactory.getLocalInstance(ctx);
-            ITaxServiceTaskFacade taxServiceTask = TaxServiceTaskFacadeFactory.getLocalInstance(ctx);
-            String taskId = null;
-
-            String id;
-            for(Iterator i$ = taxUnitGroups.entrySet().iterator(); i$.hasNext(); taskId = id) {
-                Map.Entry<String, List<TaxCalBasicVO>> group = (Map.Entry)i$.next();
-                Map<String, Object> paramMap = new HashMap();
-                String taxUnitId = (String)group.getKey();
-                List<TaxCalBasicVO> list = (List)group.getValue();
-                String yearMonth = CmpDateUtil.getDateStr(((TaxCalBasicVO)list.get(0)).getPeriodBegin(), "yyyy-MM");
-                paramMap.put("TAXUNITID", taxUnitId);
-                paramMap.put("PERIOD", yearMonth);
-                paramMap.put("creator", this.userId);
-                StringBuilder notReportedPersons = new StringBuilder();
-                this.initPersons(list, notReportedPersons);
-                if (notReportedPersons.length() == 0) {
-                    paramMap.put("accept_id", ((TaxCalBasicVO)list.get(0)).getAcceptId());
-                } else if (!this.isFbSubmit) {
-                    List relayTaskIDList = taxPersonReport.report(notReportedPersons.toString(), yearMonth, (String)null);
-                    if (null != relayTaskIDList && relayTaskIDList.size() == 1) {
-                        IObjectPK relayTaskID = (IObjectPK)relayTaskIDList.get(0);
-                        paramMap.put("RELAYTASK", relayTaskID.toString());
-                    }
-                }
-
-                String taxSpeAddDedEntryIds = this.getTaxSpeAddDedEntryIds(list);
-                LOG.error("taxSpeAddDedEntryIds:"+taxSpeAddDedEntryIds);
-                LOG.error("TaxCalTaskCatalogEnum:"+catalog);
-                if (TaxCalTaskCatalogEnum.CAL == catalog && taxSpeAddDedEntryIds.length() > 0) {
-                    paramMap.put("TaxPersonRecordEntryIDS", taxSpeAddDedEntryIds);
-                    paramMap.put("initIds",initIds);
-                    List relayTaskIDList = exFacade.report(paramMap);  //taxSpeAddDedReportFacade.report(paramMap);
-                    if (null != relayTaskIDList && relayTaskIDList.size() == 1) {
-                        IObjectPK relayTaskID = (IObjectPK)relayTaskIDList.get(0);
-                        paramMap.put("RELAYTASK", relayTaskID.toString());
-                    }
-                }
-
-                id = taxServiceTask.addTask(catalog, paramMap).toString();
-                this.taskMap.put(taxUnitId, id);
-            }
-
-            return taskId;
-        }
-    }
-    private String getTaxSpeAddDedEntryIds(List<TaxCalBasicVO> list) {
-        StringBuilder entryIds = new StringBuilder();
-        Iterator i$ = list.iterator();
-
-        while(i$.hasNext()) {
-            TaxCalBasicVO vo = (TaxCalBasicVO)i$.next();
-            if ("8r0AAABCg2PDiOoP".equals(vo.getIncomeItemId())) {
-                if (entryIds.length() > 0) {
-                    entryIds.append(",");
-                }
-
-                entryIds.append("'").append(vo.getEntryId()).append("'");
-            }
-        }
-
-        return entryIds.toString();
-    }
-    private boolean isNotSubmittedPerson(TaxCalBasicVO vo) {
-        return "0".equals(vo.getSubmitStatus()) || "3".equals(vo.getSubmitStatus());
-    }
-    private void initPersons(List<TaxCalBasicVO> list, StringBuilder notReported) {
-        Iterator i$ = list.iterator();
-
-        while(i$.hasNext()) {
-            TaxCalBasicVO vo = (TaxCalBasicVO)i$.next();
-            if (this.isNotSubmittedPerson(vo)) {
-                if (notReported.length() > 0) {
-                    notReported.append(",");
-                }
-
-                notReported.append("'").append(vo.getEntryId()).append("'");
-            }
-        }
-
-    }
-    private String getInsertTaskDetailSql() {
-        StringBuilder str = new StringBuilder();
-        StringBuilder itemStr = new StringBuilder();
-        Iterator i$ = this.allTaxItemList.iterator();
-
-        while(i$.hasNext()) {
-            String s = (String)i$.next();
-            str.append(s).append(",");
-            itemStr.append(",?");
-        }
-
-        String taxItems = str.substring(0, str.length() - 1);
-        str = new StringBuilder();
-        str.append(" INSERT INTO T_HR_STAXCALTASKDETAIL(FID, FCALTASKID, FRELAYID, FCMPCALTABLEID, FPERSONID, ");
-        str.append(" FTAXUNITID, FPERIODBEGIN, FPERIODEND, FINCOMEITEMID, FACCEPTID, ");
-        str.append(" FCREATORID, FCREATETIME, FLASTUPDATEUSERID, FLASTUPDATETIME,FDataState, ").append(taxItems);
-        str.append(" )");
-        str.append(" values(?, ?, ?, ?, ?, ");
-        str.append(" ?, ?, ?, ?, ?, ");
-        str.append(" ?, ?, ?, ?, ? ");
-        str.append(itemStr);
-        str.append(")");
-        return str.toString();
-    }
-    private List<Object[]> getParamListData(Context ctx, String initIds) throws BOSException {
-        List<Object[]> paramsList = new ArrayList();
-        StringBuilder str = new StringBuilder();
-        Iterator i$ = this.allTaxItemList.iterator();
-
-        while(i$.hasNext()) {
-            String s = (String)i$.next();
-            str.append(",").append(s);
-        }
-
-        String taxItem = str.toString();
-        if (!this.isDelete) {
-            this.getSubmittedData(ctx, initIds);
-        }
-
-        Set<String> personSet = new HashSet();
-        str = new StringBuilder();
-        str.append(" SELECT FCMPCALTABLEID, FPERSONID, FTAXUNITID, FPERIODBEGIN, FPERIODEND, ");
-        str.append(" FINCOMEITEMID,FID,fAcceptId ").append(taxItem);
-        str.append(" FROM T_HR_STAXCALINITDETAIL ");
-        str.append(" WHERE FID IN (").append(initIds).append(")");
-        str.append(" ORDER BY FTAXUNITID, FINCOMEITEMID, FPERSONID, FCREATETIME ");
-        IRowSet rowSet = DbUtil.executeQuery(ctx, str.toString());
-
-        try {
-            while(rowSet.next()) {
-                String taxUnitId = rowSet.getString("FTAXUNITID");
-                String incomeItemId = rowSet.getString("FINCOMEITEMID");
-                String personId = rowSet.getString("FPERSONID");
-                String personKey = this.getPersonKey(taxUnitId, incomeItemId, personId);
-                if (!personSet.contains(personKey)) {
-                    personSet.add(personKey);
-                    String taskId = (String)this.taskMap.get(taxUnitId);
-                    Object[] param = this.sumLastData(rowSet, personKey, taskId);
-                    paramsList.add(param);
-                }
-            }
-        } catch (SQLException var14) {
-            var14.printStackTrace();
-            LOG.error(var14);
-        }
-
-        return paramsList;
-    }
-    private Object[] sumLastData(IRowSet rowSet, String personKey, String taskId) throws SQLException {
-        Timestamp createTime = new Timestamp(System.currentTimeMillis());
-        Map<String, Object> rowMap = new HashMap();
-        if (this.dataMap.containsKey(personKey)) {
-            rowMap = (Map)this.dataMap.get(personKey);
-            Iterator i$ = this.sumTaxList.iterator();
-
-            while(i$.hasNext()) {
-                String taxItem = (String)i$.next();
-                BigDecimal detail = null == rowSet.getBigDecimal(taxItem) ? BigDecimal.ZERO : rowSet.getBigDecimal(taxItem);
-                BigDecimal sum = null == ((Map)rowMap).get(taxItem) ? BigDecimal.ZERO : (BigDecimal)((Map)rowMap).get(taxItem);
-                ((Map)rowMap).put(taxItem, detail.add(sum));
-            }
-        }
-
-        Object[] param = new Object[15 + this.allTaxItemList.size()];
-        param[0] = BOSUuid.create("01CB8082").toString();
-        param[1] = taskId;
-        param[2] = ((Map)rowMap).get("FCMPCALTABLEID");
-        param[3] = rowSet.getString("FCMPCALTABLEID");
-        param[4] = rowSet.getString("FPERSONID");
-        param[5] = rowSet.getString("FTAXUNITID");
-        param[6] = rowSet.getDate("FPERIODBEGIN");
-        param[7] = rowSet.getDate("FPERIODEND");
-        param[8] = rowSet.getString("FINCOMEITEMID");
-        param[9] = rowSet.getString("fAcceptId");
-        param[10] = this.userId;
-        param[11] = createTime;
-        param[12] = this.userId;
-        param[13] = createTime;
-        param[14] = 10;
-
-        for(int i = 0; i < this.allTaxItemList.size(); ++i) {
-            param[15 + i] = ((Map)rowMap).containsKey(this.allTaxItemList.get(i)) ? ((Map)rowMap).get(this.allTaxItemList.get(i)) : rowSet.getBigDecimal((String)this.allTaxItemList.get(i));
-        }
-
-        return param;
-    }
-    private String getPersonKey(String taxUnitId, String incomeItemId, String personId) {
-        return taxUnitId + "_" + incomeItemId + "_" + personId;
-    }
-    private void getSubmittedData(Context ctx, String initIds) throws BOSException {
-        if (null != this.sumTaxList && !this.sumTaxList.isEmpty()) {
-            StringBuilder str = new StringBuilder();
-
-            String taxItem;
-            for(Iterator i$ = this.sumTaxList.iterator(); i$.hasNext(); str.append("SUMDATA.").append(taxItem)) {
-                taxItem = (String)i$.next();
-                if (str.length() > 0) {
-                    str.append(",");
-                }
-            }
-
-            String sumItems = str.toString();
-            str = new StringBuilder();
-            str.append(" SELECT SUMDATA.FPERSONID, SUMDATA.FTAXUNITID, SUMDATA.FINCOMEITEMID,SUMDATA.FCMPCALTABLEID, ").append(sumItems);
-            str.append(" FROM T_HR_STAXCALTASKDETAIL SUMDATA ");
-            str.append(" INNER JOIN T_HR_STAXCALINITDETAIL INIT ON SUMDATA.FCMPCALTABLEID = INIT.FCMPCALTABLEID and SUMDATA.fIncomeItemId = INIT.fIncomeItemId AND INIT.FSTATE = 40 ");
-            str.append(" INNER JOIN T_HR_STAXCALTASK TASK ON SUMDATA.FCALTASKID = TASK.FID ");
-            str.append(" INNER JOIN T_HR_STAXINCOMEITEM INCOMEITEM ON SUMDATA.FINCOMEITEMID =  INCOMEITEM.FID ");
-            str.append(" WHERE EXISTS( ");
-            str.append(" SELECT 1 FROM T_HR_STAXCALINITDETAIL DETAIL ");
-            str.append(" WHERE DETAIL.FID IN (").append(initIds).append(") ");
-            str.append(" AND INIT.FPERSONID = DETAIL.FPERSONID AND INIT.FTAXUNITID = DETAIL.FTAXUNITID ");
-            str.append(" AND INIT.FINCOMEITEMID = DETAIL.FINCOMEITEMID AND INIT.FPERIODBEGIN = DETAIL.FPERIODBEGIN) ");
-            str.append(" AND TASK.FSTATE = ").append(40);
-            str.append(" AND SUMDATA.FDATASTATE = ").append(10);
-            str.append(" AND INCOMEITEM.FTAXCALMETHOD = ").append(10);
-            str.append(" ORDER BY SUMDATA.FPERSONID, SUMDATA.FTAXUNITID, SUMDATA.FINCOMEITEMID, SUMDATA.FCREATETIME DESC ");
-            IRowSet rowSet = DbUtil.executeQuery(ctx, str.toString());
-
-            try {
-                while(rowSet.next()) {
-                    this.combineRowData(rowSet);
-                }
-            } catch (SQLException var7) {
-                var7.printStackTrace();
-            }
-
-        }
-    }
-    private void combineRowData(IRowSet rowSet) {
-        Map<String, Object> rowMap = new HashMap();
-        String key = null;
-
-        try {
-            key = this.getPersonKey(rowSet.getString("FTAXUNITID"), rowSet.getString("FINCOMEITEMID"), rowSet.getString("FPERSONID"));
-            if (this.dataMap.containsKey(key)) {
-                return;
-            }
-
-            Iterator i$ = this.sumTaxList.iterator();
-
-            while(i$.hasNext()) {
-                String taxItem = (String)i$.next();
-                rowMap.put(taxItem, rowSet.getBigDecimal(taxItem));
-            }
-
-            rowMap.put("FCMPCALTABLEID", rowSet.getString("FCMPCALTABLEID"));
-        } catch (SQLException var6) {
-            var6.printStackTrace();
-        }
-
-        this.dataMap.put(key, rowMap);
-    }
-    protected List _report(Context ctx, Map paramMap) throws BOSException {
-        LOG.error("_report:"+paramMap);
-        if (this.checkParams(paramMap)) {
-            throw new BOSException("专项附加扣除申报服务参数缺失,请检查参数");
-        } else {
-
-            String taxUnitID = (String)paramMap.get("TAXUNITID");
-            String period = (String)paramMap.get("PERIOD");
-            String taxPersonRecordEntryIDS = (String)paramMap.get("TaxPersonRecordEntryIDS");
-            SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
-            TaxUnitCollection taxUnitCollection = TaxUnitFactory.getLocalInstance(ctx).getTaxUnitCollection("select id,name,number,taxNumber,areaCode,regNumber,declPassword,realPassword,isAutoDeduct where id = '" + taxUnitID + "'");
-            LOG.error("taxUnitCollection:"+taxUnitCollection);
-            if (null != taxUnitCollection && taxUnitCollection.size() != 0) {
-                TaxUnitInfo taxUnitInfo = taxUnitCollection.get(0);
-                IsAllowedQuoted isAutoDeduct = taxUnitInfo.getIsAutoDeduct();
-                if (0 == isAutoDeduct.getValue()) {
-                    return null;
-                } else {
-                    LOG.error("period:"+period);
-                    period = period.replace("-", "");
-                    int periodYear = Integer.parseInt(period.substring(0, 4));
-                    int periodMonth = Integer.parseInt(period.substring(4, 6));
-                    StringBuilder checkSQL = new StringBuilder();
-                    checkSQL.append(" SELECT ");
-                    checkSQL.append(" PERSON.FID PERSONID, ");
-                    checkSQL.append(" PERSON.FNAME_L2 PERSONNAME, ");
-                    checkSQL.append(" PERSON.FNUMBER PERSONNUMBER, ");
-                    checkSQL.append(" PERSON.FGENDER GENDER, ");
-
-                    checkSQL.append(" TAX.FPHONENUMBER PHONENUMBER, ");
-                    checkSQL.append(" ENTRY.FPERSONSTATUS PERSONSTATUS, ");
-                    checkSQL.append(" ENTRY.FEMPLOYEDTYPE EMPLOYEDTYPE, ");
-                    checkSQL.append(" ENTRY.FEMPLOYEDDATE EMPLOYEDDATE, ");
-                    checkSQL.append(" isnull(TAX.FBIRTHDAY,PERSON.FBIRTHDAY) BIRTHDAY, ");
-                    checkSQL.append(" nl.fname_l2 NATIONALITY, ");
-                    checkSQL.append(" TAX.FISOVERSEA ISOVERSEA,");
-                    checkSQL.append(" ENTRY.FDEPARTUREDATE DEPARTUREDATE,");
-
-                    checkSQL.append(" TAX.FINVESTMENTTOTAL INVESTMENTTOTAL,");
-                    checkSQL.append(" TAX.FINVESTMENTRATE INVESTMENTRATE,");
-                    checkSQL.append(" TAX.FISDISABILITY ISDISABILITY,");
-                    checkSQL.append(" TAX.FISHERO ISHERO,");
-                    checkSQL.append(" TAX.FISOLD ISOLD,");
-                    checkSQL.append(" ENTRY.FDEDUCTFEES DEDUCTFEES,");
-                    checkSQL.append(" TAX.FDISCARDNUMBER DISCARDNUMBER,");
-                    checkSQL.append(" TAX.FHEROCARDNUMBER HEROCARDNUMBER,");
-                    checkSQL.append(" TAX.FEMAIL EMAIL,");
-                    checkSQL.append(" dip.fname_l2 EDULEVEL,");
-                    checkSQL.append(" TAX.FPOSITION POSITION,");
-                    checkSQL.append(" bank.fname_l2 BANKNAME,");
-                    checkSQL.append(" TAX.FBANKCARDPROVINCE BANKCARDPROVINCE,");
-                    checkSQL.append(" TAX.FACCOUNT BANKACCOUNT,");
-
-                    checkSQL.append(" birNl.fName_l2 BIRTHPLACE,");
-                    checkSQL.append(" TAX.FTAXREASON TAXREASON,");
-                    checkSQL.append(" TAX.FENTRYDATE ENTRYDATE,");
-                    checkSQL.append(" TAX.FLEAVEDATE LEAVEDATE,");
-
-                    checkSQL.append(" TAX.FCARDTYPE CARDTYPE, ");
-                    checkSQL.append(" TAX.FReportName reportName, ");
-                    checkSQL.append(" TAX.FCARDNUMBER CARDNUMBER, ");
-                    checkSQL.append(" ENTRY.FID ENTRYID, ");
-                    checkSQL.append(" ENTRY.FTAXUNITID TAXUNITID, ");
-                    checkSQL.append(" RECORD.FID RECORDID, ");
-                    checkSQL.append(" RECORD.FSTATE ");
-                    checkSQL.append(" FROM T_HR_STAXPERSONRECORD TAX ");
-                    checkSQL.append(" INNER JOIN T_HR_STAXPERSONRECORDENTRY ENTRY ON TAX.FID = ENTRY.FBILLID  ");
-                    checkSQL.append(" LEFT JOIN T_HR_STAXSPEADDDEDRECORD RECORD ON ENTRY.FPERSONID = RECORD.FPERSONID AND ENTRY.FTAXUNITID = RECORD.FTAXUNITID ");
-                    checkSQL.append(" AND RECORD.FPERIODYEAR  =  ").append(periodYear);
-                    checkSQL.append(" AND RECORD.FPERIODMONTH = ").append(periodMonth);
-                    checkSQL.append(" AND RECORD.FTAXUNITID = '").append(taxUnitInfo.getId().toString()).append("' ");
-                    checkSQL.append(" INNER JOIN T_BD_PERSON PERSON ON ENTRY.FPERSONID = PERSON.FID  ");
-                    checkSQL.append(" LEFT JOIN T_BD_Nationality nl ON nl.fid = TAX.FNATIONALITYID  ");
-                    checkSQL.append(" LEFT JOIN T_BD_HRDiploma dip ON dip.fid = TAX.FEDULEVELID  ");
-                    checkSQL.append(" LEFT JOIN T_HR_SBank bank ON bank.fid = TAX.FBANKID  ");
-                    checkSQL.append(" LEFT JOIN T_BD_Nationality birNl ON birNl.fid = TAX.FBIRTHPLACEID  ");
-                    checkSQL.append(" WHERE ");
-                    checkSQL.append(" ENTRY.FID IN (").append(taxPersonRecordEntryIDS).append(") ");
-                    String updateRecordSQL = " update T_HR_STAXSPEADDDEDRECORD set Fstate = 30, CFTaskID = ? where FID = ?";
-                    ArrayList updateParamList = new ArrayList();
-                    ISYUtilsFacade facade = SYUtilsFacadeFactory.getLocalInstance(ctx);
-                    try {
-                        LOG.error("_report:"+checkSQL);
-                        IRowSet rowSet = DbUtil.executeQuery(ctx, checkSQL.toString());
-                        List<SixTPersonInfo> rylb = new ArrayList();
-                        CoreBaseCollection recordCollection = new CoreBaseCollection();
-                        HashSet reportPersonSet = new HashSet();
-
-                        while(true) {
-                            while(true) {
-                                if (!rowSet.next()) {
-                                    if (rylb.isEmpty()) {
-                                        return null;
-                                    }
-                                    SpecialAmountInfo specialAmountInfo = new SpecialAmountInfo();
-                                    specialAmountInfo.setBizNo(facade.getBizNo());
-                                    specialAmountInfo.setQymc(taxUnitInfo.getName());
-
-                                    specialAmountInfo.setMmlx("0");
-                                    specialAmountInfo.setSmzh(null);
-
-                                    specialAmountInfo.setJmsmmm(null);
-                                    specialAmountInfo.setSbmm(Base64Utils.decode(taxUnitInfo.getDeclPassword()));
-                                    specialAmountInfo.setJmsbmm(null);
-                                    specialAmountInfo.setDjxhid(taxUnitInfo.getRegNumber());
-                                    specialAmountInfo.setNsrsbh(taxUnitInfo.getTaxNumber());
-                                    specialAmountInfo.setAreaid(taxUnitInfo.getAreaCode());
-                                    specialAmountInfo.setSkssq(period);
-                                    specialAmountInfo.setBmbh(null);
-                                    specialAmountInfo.setBmmc(null);
-                                    specialAmountInfo.setSfrysb(null);
-                                    specialAmountInfo.setXzms("1");
-                                    specialAmountInfo.setRylb(rylb);
-                                    paramMap.put("qymc", taxUnitInfo.getName());
-                                    paramMap.put("nsrsbh", taxUnitInfo.getTaxNumber());
-                                    paramMap.put("areaid", taxUnitInfo.getAreaCode());
-                                    paramMap.put("sdyf", period);
-                                    paramMap.put("ver", "V2.0.000");
-                                    paramMap.put("djxhid", taxUnitInfo.getRegNumber());
-                                    paramMap.put("smmm", Base64Utils.decode(taxUnitInfo.getRealPassword()));
-                                    paramMap.put("sbmm", Base64Utils.decode(taxUnitInfo.getDeclPassword()));
-                                    paramMap.put("xzzxxx", "是");
-                                    Map<String, Object> dataMap = new HashMap();
-                                    dataMap.put("rylb", rylb);
-                                    paramMap.put("data", dataMap);
-                                    Map<String,Object> config = facade.getConfig();
-                                    String url = config.get("ip")+"/gateway/iit/special/querySpecialAmount";
-                                    String tastId = facade.addTask(url, RequestTypeEnum.POST, JSONUtil.toJsonStr(specialAmountInfo),"querySpecialAmountService", TaskCatalogEnum.TAXSPEADDDEDREPORT,null);
-
-                                    TaskInfo taxCalTaskInfo = TaskFactory.getLocalInstance(ctx).getTaskInfo(new ObjectUuidPK(tastId));
-
-                                    int i = 0;
-
-                                    for(int size = recordCollection.size(); i < size; ++i) {
-                                        TaxSpeAddDedRecordInfo taxSpeAddDedRecordInfo = (TaxSpeAddDedRecordInfo)recordCollection.get(i);
-                                        taxSpeAddDedRecordInfo.put("task",taxCalTaskInfo);
-                                    }
-
-                                    Object[] objects;
-                                    for(Iterator i$ = updateParamList.iterator(); i$.hasNext(); objects[0] = tastId) {
-                                        objects = (Object[])i$.next();
-                                    }
-
-                                    TaxSpeAddDedRecordFactory.getLocalInstance(ctx).saveBatchData(recordCollection);
-                                    if (updateParamList.size() > 0) {
-                                        DbUtil.executeBatch(ctx, updateRecordSQL, updateParamList);
-                                    }
-
-                                    List<IObjectPK> arrayList = new ArrayList();
-                                    arrayList.add(new ObjectUuidPK(tastId));
-                                    return arrayList;
-                                }
-
-                                String recordId = rowSet.getString("RECORDID");
-                                if (StringUtils.isEmpty(recordId)) {
-                                    break;
-                                }
-
-                                int state = rowSet.getInt("FSTATE");
-                                if (40 != state && 30 != state) {
-                                    if (50 == state) {
-                                        Object[] updateParam = new Object[]{null, recordId};
-                                        updateParamList.add(updateParam);
-                                    }
-                                    break;
-                                }
-                            }
-
-                            String personId = rowSet.getString("PERSONID");
-                            String personName = rowSet.getString("reportName");
-                            String personNumber = rowSet.getString("PERSONNUMBER");
-                            String phoneNumber = rowSet.getString("PHONENUMBER");
-                            String personStatus = rowSet.getString("PERSONSTATUS");
-                            String employedType = rowSet.getString("EMPLOYEDTYPE");
-                            Date employeddate = rowSet.getDate("EMPLOYEDDATE");
-                            String gender = rowSet.getString("GENDER");
-                            if (StringUtils.isEmpty(personName)) {
-                                personName = rowSet.getString("PERSONNAME");
-                            }
-                            Date birthday = rowSet.getDate("BIRTHDAY");
-                            String nationality = rowSet.getString("NATIONALITY");
-                            String isoversea = rowSet.getString("ISOVERSEA");
-                            Date departuredate = rowSet.getDate("DEPARTUREDATE");
-                            String investmenttotal = rowSet.getString("INVESTMENTTOTAL");
-                            String investmentrate = rowSet.getString("INVESTMENTRATE");
-
-                            String isdisability = rowSet.getString("ISDISABILITY");
-                            String ishero = rowSet.getString("ISHERO");
-                            String isold = rowSet.getString("ISOLD");
-                            String deductfees = rowSet.getString("DEDUCTFEES");
-                            String discardnumber = rowSet.getString("DISCARDNUMBER");
-                            String herocardnumber = rowSet.getString("HEROCARDNUMBER");
-                            String email = rowSet.getString("EMAIL");
-
-                            String edulevel = rowSet.getString("EDULEVEL");
-
-                            String position = rowSet.getString("POSITION");
-                            String bankname = rowSet.getString("BANKNAME");
-                            String bankcardprovince = rowSet.getString("BANKCARDPROVINCE");
-                            String bankaccount = rowSet.getString("BANKACCOUNT");
-
-                            String birthplace = rowSet.getString("BIRTHPLACE");
-                            String taxreason = rowSet.getString("TAXREASON");
-                            Date entrydate = rowSet.getDate("ENTRYDATE");
-                            Date leavedate = rowSet.getDate("LEAVEDATE");
-
-
-                            String cardType = rowSet.getString("CARDTYPE");
-                            String cardNumber = rowSet.getString("CARDNUMBER");
-                            String reportPersonSetKey = personId + "_" + taxUnitID + "_" + periodYear + "_" + periodMonth;
-                            if (!reportPersonSet.contains(reportPersonSetKey)) {
-                                reportPersonSet.add(reportPersonSetKey);
-                                SixTPersonInfo sixTPersonInfo = new SixTPersonInfo();
-                                sixTPersonInfo.setXm(personName);
-                                sixTPersonInfo.setZzlx(CardTypeEnum.getEnum(cardType).getAlias());
-                                sixTPersonInfo.setZzhm(cardNumber);
-                                sixTPersonInfo.setQtzzlx(null);
-                                sixTPersonInfo.setQtzzhm(null);
-                                sixTPersonInfo.setGh(personNumber);
-                                sixTPersonInfo.setSkssq(period);
-                                sixTPersonInfo.setLxdh(phoneNumber);
-                                sixTPersonInfo.setNsrzt(("1".equals(personStatus)? PersonStatusEnum.Normal.getAlias():PersonStatusEnum.NotNormal.getAlias()));
-                                if(StrUtil.isNotBlank(employedType)) {
-                                    sixTPersonInfo.setSfgy(EmployedTypeEnum.getEnum(employedType).getAlias());
-                                }else{
-                                    sixTPersonInfo.setSfgy(null);
-                                }
-                                if(null!=employeddate){
-                                    sixTPersonInfo.setRzsgrq(format.format(employeddate));
-                                }else {
-                                    sixTPersonInfo.setRzsgrq(format.format(new Date()));
-                                }
-                                if(null!=gender) {
-                                    sixTPersonInfo.setXb(Genders.getEnum(Integer.parseInt(gender)).getAlias());
-                                }else{
-                                    sixTPersonInfo.setXb(Genders.Male.getAlias());
-                                }
-
-                                sixTPersonInfo.setCsny(format.format(birthday));
-
-                                if(StrUtil.isNotBlank(nationality)){
-                                    sixTPersonInfo.setGj(nationality);
-                                }else{
-                                    sixTPersonInfo.setGj("中国");
-                                }
-
-                                sixTPersonInfo.setRydq("0".equals(isoversea)?"境内":"境外");
-                                if(null!=departuredate) {
-                                    sixTPersonInfo.setLzrq(format.format(departuredate));
-                                }else {
-                                    sixTPersonInfo.setLzrq("");
-                                }
-
-                                if(StrUtil.isNotBlank(investmenttotal)){
-                                    sixTPersonInfo.setGrgbze(investmenttotal);
-                                }else {
-                                    sixTPersonInfo.setGrgbze(null);
-                                }
-                                if(StrUtil.isNotBlank(investmentrate)){
-                                    sixTPersonInfo.setGrgbbl(investmentrate);
-                                }else {
-                                    sixTPersonInfo.setGrgbbl(null);
-                                }
-                                if(StrUtil.isNotBlank(isdisability)) {
-                                    sixTPersonInfo.setSfcj("0".equals(isdisability)?"否":"是");
-                                }else {
-                                    sixTPersonInfo.setSfcj(null);
-                                }
-                                if(StrUtil.isNotBlank(ishero)) {
-                                    sixTPersonInfo.setSfls("0".equals(ishero)?"否":"是");
-                                }else {
-                                    sixTPersonInfo.setSfls(null);
-                                }
-                                if(StrUtil.isNotBlank(isold)) {
-                                    sixTPersonInfo.setSfgl("0".equals(isold)?"否":"是");
-                                }else {
-                                    sixTPersonInfo.setSfgl(null);
-                                }
-                                if(StrUtil.isNotBlank(deductfees)) {
-                                    sixTPersonInfo.setSfzdw(DeductFeesEnum.getEnum(deductfees).getAlias());
-                                }else {
-                                    sixTPersonInfo.setSfzdw(null);
-                                }
-
-                                sixTPersonInfo.setCjzh(discardnumber);
-                                sixTPersonInfo.setLszh(herocardnumber);
-                                sixTPersonInfo.setDzyx(email);
-                                sixTPersonInfo.setXl(edulevel);
-                                if(StrUtil.isNotBlank(position)) {
-                                    sixTPersonInfo.setZw(PositionTypeEnum.getEnum(position).getAlias());
-                                }else{
-                                    sixTPersonInfo.setZw(null);
-                                }
-                                sixTPersonInfo.setKhyh(bankname);
-                                sixTPersonInfo.setKhyhsfmz(bankcardprovince);
-                                sixTPersonInfo.setYhzh(bankaccount);
-                                sixTPersonInfo.setLxdz_sheng(null);
-                                sixTPersonInfo.setLxdz_shi(null);
-                                sixTPersonInfo.setLxdz_qx(null);
-                                sixTPersonInfo.setLxdz_jd(null);
-                                sixTPersonInfo.setLxdz(null);
-                                sixTPersonInfo.setHjszd_sheng(null);
-                                sixTPersonInfo.setHjszd_shi(null);
-                                sixTPersonInfo.setHjszd_qx(null);
-                                sixTPersonInfo.setHjszd_jd(null);
-                                sixTPersonInfo.setHjszd_xxdz(null);
-                                sixTPersonInfo.setBz(null);
-                                sixTPersonInfo.setCsd(birthplace);
-                                sixTPersonInfo.setSssx(taxreason);
-                                  if(null!=entrydate){
-                                      sixTPersonInfo.setScrjsj(format.format(entrydate));
-                                  }
-                                if(null!=leavedate){
-                                    sixTPersonInfo.setYjljsj(format.format(leavedate));
-                                }
-
-                                sixTPersonInfo.setWjrlxdz_sheng(null);
-                                sixTPersonInfo.setWjrlxdz_shi(null);
-                                sixTPersonInfo.setWjrlxdz_qx(null);
-                                sixTPersonInfo.setWjrlxdz_jd(null);
-                                sixTPersonInfo.setWjrlxdz_xxdz(null);
-                                sixTPersonInfo.setXmzw(null);
-                                sixTPersonInfo.setBz(null);
-
-                                rylb.add(sixTPersonInfo);
-                                TaxSpeAddDedRecordInfo taxSpeAddDedRecordInfo = new TaxSpeAddDedRecordInfo();
-                                taxSpeAddDedRecordInfo.setTaxUnit(taxUnitInfo);
-                                PersonInfo personInfo = new PersonInfo();
-                                personInfo.setId(BOSUuid.read(personId));
-                                taxSpeAddDedRecordInfo.setPerson(personInfo);
-                                taxSpeAddDedRecordInfo.setPeriodYear(periodYear);
-                                taxSpeAddDedRecordInfo.setPeriodMonth(periodMonth);
-                                taxSpeAddDedRecordInfo.setState(TaxCalInitDetailStateEnum.RUNNING);
-                                recordCollection.add(taxSpeAddDedRecordInfo);
-                            }
-                        }
-                    } catch (Exception var27) {
-                        LOG.error(var27.getMessage(), var27);
-                        throw new BOSException("生成项附加扣除申报服务时,判断是否存在未下载的专项附加扣除信息数据出错", var27);
-                    }
-                }
-            } else {
-                throw new BOSException("生成项附加扣除申报服务时,未获取到对应的纳税单位数据,请联系管理员检查数据是否被删除");
-            }
-        }
-    }
-}

+ 61 - 0
websrc/com/kingdee/eas/custom/shuiyou/inter/handler/TaskListHandler.java

@@ -0,0 +1,61 @@
+package com.kingdee.eas.custom.shuiyou.inter.handler;
+
+import com.kingdee.bos.Context;
+import com.kingdee.bos.dao.ormapping.ObjectUuidPK;
+import com.kingdee.bos.metadata.entity.SelectorItemCollection;
+import com.kingdee.bos.metadata.entity.SelectorItemInfo;
+import com.kingdee.eas.custom.shuiyou.task.ITask;
+import com.kingdee.eas.custom.shuiyou.task.TaskFactory;
+import com.kingdee.eas.custom.shuiyou.task.TaskInfo;
+import com.kingdee.shr.base.syssetting.context.SHRContext;
+import com.kingdee.shr.base.syssetting.exception.SHRWebException;
+import com.kingdee.shr.base.syssetting.web.handler.ListHandler;
+import org.springframework.ui.ModelMap;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * description: TaskListHandler <br>
+ * date: 2024/9/12 10:56 <br>
+ * author: lhbj <br>
+ * version: 1.0 <br>
+ */
+public class TaskListHandler extends ListHandler {
+
+
+    public String enableAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws SHRWebException {
+        String billId = this.getBillId(request);
+        Context ctx = SHRContext.getInstance().getContext();
+        try {
+            ITask iTask = TaskFactory.getLocalInstance(ctx);
+            SelectorItemCollection sc = new SelectorItemCollection();
+            sc.add(new SelectorItemInfo("id"));
+            sc.add(new SelectorItemInfo("url"));
+            sc.add(new SelectorItemInfo("requestId"));
+            sc.add(new SelectorItemInfo("requestType"));
+            sc.add(new SelectorItemInfo("requestParam.id"));
+            sc.add(new SelectorItemInfo("requestParam.paramContent"));
+            sc.add(new SelectorItemInfo("requestResult.id"));
+            sc.add(new SelectorItemInfo("requestResult.resultContent"));
+            sc.add(new SelectorItemInfo("requestState"));
+            sc.add(new SelectorItemInfo("state"));
+            sc.add(new SelectorItemInfo("name"));
+            sc.add(new SelectorItemInfo("osfServiceName"));
+            sc.add(new SelectorItemInfo("number"));
+            sc.add(new SelectorItemInfo("taskPre.id"));
+            sc.add(new SelectorItemInfo("taskPre.state"));
+            sc.add(new SelectorItemInfo("taskPre.requestState"));
+            String[] ids = billId.split(",");
+            for(String id : ids) {
+                //Ö¸¶¨idÖ´ÐÐÈÎÎñ
+                TaskInfo taskInfo = iTask.getTaskInfo(new ObjectUuidPK(id), sc);
+                taskInfo.setContext(ctx).execute();
+            }
+        }catch (Exception e){
+            e.printStackTrace();
+        }
+        this.writeSuccessData(billId);
+        return null;
+    }
+}

+ 683 - 0
websrc/com/kingdee/eas/custom/shuiyou/inter/handler/TaxUnitListHandlerEx.java

@@ -0,0 +1,683 @@
+package com.kingdee.eas.custom.shuiyou.inter.handler;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.kingdee.bos.BOSException;
+import com.kingdee.bos.Context;
+import com.kingdee.bos.dao.ormapping.ObjectUuidPK;
+import com.kingdee.bos.util.BOSUuid;
+import com.kingdee.eas.basedata.hraux.BirthplaceFactory;
+import com.kingdee.eas.basedata.hraux.NationalityFactory;
+import com.kingdee.eas.basedata.person.PersonFactory;
+import com.kingdee.eas.common.EASBizException;
+import com.kingdee.eas.custom.shuiyou.registration.RegistrationInfoCollection;
+import com.kingdee.eas.custom.shuiyou.registration.RegistrationInfoFactory;
+import com.kingdee.eas.custom.shuiyou.registration.RegistrationInfoInfo;
+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.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.incomeTax.*;
+import com.kingdee.shr.compensation.app.tax.TaxUnitCollection;
+import com.kingdee.shr.compensation.app.tax.TaxUnitFactory;
+import com.kingdee.shr.compensation.app.tax.TaxUnitInfo;
+import com.kingdee.shr.compensation.util.Base64Utils;
+import com.kingdee.shr.compensation.web.handler.tax.taxUnit.TaxUnitListHandler;
+import okhttp3.*;
+import org.apache.log4j.Logger;
+import org.springframework.ui.ModelMap;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.math.BigDecimal;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+public class TaxUnitListHandlerEx extends TaxUnitListHandler {
+    private Properties propt = new Properties();
+    private static Logger logger = Logger.getLogger("com.kingdee.eas.custom.shuiyou.TaxUnitListHandlerEx");
+
+    /**
+     * 企业注册
+     *
+     * @param request
+     * @param response
+     * @param modelMap
+     * @throws SHRWebException
+     */
+    public void businessAegistrationAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws SHRWebException {
+        String entrance = "com.kingdee.eas.custom.jiuzhoutong.shuiyou.TaxUnitListHandlerEx.businessAegistrationAction";
+        Map<String, Object> returnMap = new HashMap<String, Object>();
+        logger.error("=========进入:" + entrance + "==========");
+        String id = request.getParameter("id");
+        Context context = SHRContext.getInstance().getContext();
+        Map<String, String> commonParameter = null;
+        String postBody = "";
+        String post = "";
+        try {
+            logger.error("=====获取基本信息=====");
+            this.propt.load(new FileInputStream(System.getProperty("EAS_HOME") + "/server/properties/sy/syConfig.properties"));
+            logger.error("=======获取报税企业信息=====");
+            TaxUnitInfo taxUnitInfo = TaxUnitFactory.getLocalInstance(context).getTaxUnitInfo(new ObjectUuidPK(id));
+            String name = taxUnitInfo.getName();//企业名称
+            String taxNumber = taxUnitInfo.getTaxNumber();//税号
+            String areaCode = taxUnitInfo.getAreaCode();//行政区代码
+            logger.error("企业名称:" + name);
+            logger.error("税号:" + taxNumber);
+            logger.error("行政区代码:" + areaCode);
+            logger.error("==========================");
+
+
+            logger.error("==========发送请求 post================");
+            OkHttpClient client = new OkHttpClient();
+            String ip = propt.getProperty("ip");
+            String url = ip + "/gateway/iit/declare/getCompanyRegisterInfo";
+            logger.error("地址:" + url);
+            postBody = "{\"qymc\":\"" + name + "\",\"nsrsbh\":\"" + taxNumber + "\",\"areaid\":\"" + areaCode + "\"}";
+            logger.error("参数:" + postBody);
+            logger.error("公共参数:" + JSONObject.toJSONString(commonParameter));
+
+            post = SYUtilsFacadeFactory.getLocalInstance(context).post(url, postBody);
+            //gateway/iit/declare/getCompanyRegisterInfo
+//            RequestBody body = RequestBody.create(MediaType.parse("application/json"), postBody);
+//            Request sYRequest = new Request.Builder()
+//                    .url(url)
+//                    .post(body).headers(Headers.of(commonParameter))
+//                    .build();
+//            sYResponse = client.newCall(sYRequest).execute();
+
+            logger.error("返回参数:" + post);
+            //返回值需要改 不是JSONArray 类型 需要更具 正常返回值来判断
+            //JSONArray jsonArray = JSONArray.parseArray(post);
+            JSONObject returnDate = JSONObject.parseObject(post);
+            JSONObject head = returnDate.getJSONObject("head");
+            String description = head.getString("description");
+            RegistrationInfoInfo registrationInfo;
+            if (!"成功".equals(description)) {
+                returnMap.put("code", 500);
+                returnMap.put("error", "接口调用失败,请看日志");
+                JSONUtils.SUCCESS(returnMap);
+                return;
+            }
+
+            JSONArray body = returnDate.getJSONArray("body");
+//            if (body.size() > 0) {
+//                logger.error("写入数据:"+body.toJSONString());
+//                logger.error("删除原有的数据以便以写入行的数据");
+//                String sql = "delete from CT_REG_RegistrationInfo";
+//                DBUtil.execute(context, sql);
+//            }
+            logger.error("写入数据:");
+            for (int i = 0; i < body.size(); i++) {
+                JSONObject jsonObject = body.getJSONObject(i);
+                String djxhid = jsonObject.getString("djxhid");//	登记序号
+                RegistrationInfoCollection registrationInfoCollection = RegistrationInfoFactory.getLocalInstance(context).getRegistrationInfoCollection("where djxhid = '" + djxhid + "'");
+                if (registrationInfoCollection.size() == 0) {
+                    registrationInfo = new RegistrationInfoInfo();
+                } else {
+                    registrationInfo = registrationInfoCollection.get(0);
+                }
+
+                registrationInfo.setDjxhid(djxhid);
+                String qymc = jsonObject.getString("qymc");//	企业名称
+
+                registrationInfo.setQymc(qymc);
+                String frxm = jsonObject.getString("frxm");//	法人姓名
+                registrationInfo.setFrxm(frxm);
+
+                String lxdh = jsonObject.getString("lxdh");//	联系电话
+                registrationInfo.setLxdh(lxdh);
+
+                String scjydz = jsonObject.getString("scjydz");//	生产经营地址
+                registrationInfo.setScjydz(scjydz);
+
+                String hymc = jsonObject.getString("hymc");//	行业名称
+                registrationInfo.setHymc(hymc);
+
+                String zgswjgmc = jsonObject.getString("zgswjgmc");//	主管税务机关名称
+                registrationInfo.setZgswjgmc(zgswjgmc);
+
+                String zgswjg = jsonObject.getString("zgswjg");//	主管税务机关代码
+                registrationInfo.setZgswjg(zgswjg);
+
+                String zgswjgskdm = jsonObject.getString("zgswjgskdm");//	主管税务分局所科代码
+                registrationInfo.setZgswjgskdm(zgswjgskdm);
+
+                String zgswjgskmc = jsonObject.getString("zgswjgskmc");//	主管税务分局所科名称
+                registrationInfo.setZgswjgskmc(zgswjgskmc);
+
+                String fbmba = jsonObject.getString("fbmba");//	是否分部门备案
+                registrationInfo.setFbmba(fbmba);
+
+                String smzh = jsonObject.getString("smzh");//	实名账号
+                registrationInfo.setSmzh(smzh);
+
+                String shxydm = jsonObject.getString("shxydm");//	社会信用代码
+                registrationInfo.setShxydm(shxydm);
+
+                String nsrsbm = jsonObject.getString("nsrsbm");//	纳税人识别码
+                registrationInfo.setNsrsbm(nsrsbm);
+
+                String yzbm = jsonObject.getString("yzbm");//	邮政编码
+                registrationInfo.setYzbm(yzbm);
+
+                String cwxm = jsonObject.getString("cwxm");//	财务负责人
+                registrationInfo.setCwxm(cwxm);
+
+                String hydm = jsonObject.getString("hydm");//	行业代码
+                registrationInfo.setHydm(hydm);
+
+                String jjlxdm = jsonObject.getString("jjlxdm");//	经济类型名称代码
+                registrationInfo.setJjlxdm(jjlxdm);
+
+                String jjlxmc = jsonObject.getString("jjlxmc");//	经济类型名称
+                registrationInfo.setJjlxmc(jjlxmc);
+
+                String ssglydm = jsonObject.getString("ssglydm");//	税收管理员代码
+                registrationInfo.setSsglydm(ssglydm);
+
+                String bsrxm = jsonObject.getString("bsrxm");//	报税人姓名
+                registrationInfo.setBsrxm(bsrxm);
+
+                String jdxzdm = jsonObject.getString("jdxzdm");//	街道乡镇代码
+                registrationInfo.setJdxzdm(jdxzdm);
+
+                String kjywrdm = jsonObject.getString("kjywrdm");//	扣缴义务人代码
+                registrationInfo.setKjywrdm(kjywrdm);
+
+                String djrq = jsonObject.getString("djrq");//	登记日期
+                registrationInfo.setDjrq(djrq);
+
+                String swjgdm = jsonObject.getString("swjgdm");//	税务机关代码
+                registrationInfo.setSwjgdm(swjgdm);
+
+                String swjgmc = jsonObject.getString("swjgmc");//	税务机关名称
+                registrationInfo.setSwjgmc(swjgmc);
+
+                String sfscjyqy = jsonObject.getString("sfscjyqy");//	是否是生产经营企业
+                registrationInfo.setSfscjyqy(sfscjyqy);
+
+                String nsrztdm = jsonObject.getString("nsrztdm");//	纳税人状态代码
+                registrationInfo.setNsrztdm(nsrztdm);
+
+                String nsrztmc = jsonObject.getString("nsrztmc");//	纳税人状态名称
+                registrationInfo.setNsrztmc(nsrztmc);
+                if (registrationInfoCollection.size() == 0) {
+                    RegistrationInfoFactory.getLocalInstance(context).save(registrationInfo);
+                } else {
+                    RegistrationInfoFactory.getLocalInstance(context).update(new ObjectUuidPK(registrationInfo.getId()), registrationInfo);
+                }
+            }
+            logger.error("记录成功接口日志");
+            returnMap.put("code", 200);
+            returnMap.put("error", "");
+            returnMap.put("info", "注册成功");
+        } catch (BOSException e) {
+            logger.error("记录BOSException报错接口日志");
+            returnMap.put("code", 500);
+            returnMap.put("error", e);
+        } catch (EASBizException e) {
+            logger.error("记录 EASBizException 报错接口日志");
+            returnMap.put("code", 500);
+            returnMap.put("error", e);
+        } catch (FileNotFoundException e) {
+            logger.error("记录 FileNotFoundException 报错接口日志");
+            returnMap.put("code", 500);
+            returnMap.put("error", e);
+        } catch (IOException e) {
+            logger.error("记录 IOException 报错接口日志");
+            returnMap.put("code", 500);
+            returnMap.put("error", e);
+        }
+        JSONUtils.SUCCESS(returnMap);
+        logger.error("======================退出==================================");
+    }
+
+    /**
+     * 人员报送
+     * @param request
+     * @param response
+     * @param modelMap
+     * @throws SHRWebException
+     */
+    public void personnelReportAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws SHRWebException {
+        logger.error("==进入到==com.kingdee.eas.custom.shuiyou.TaxUnitListHandlerEx.personnelReportAction=====================");
+        Context context = SHRContext.getInstance().getContext();
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
+        Map<String,Object> returnMap = new HashMap<String,Object>();
+        String selectedIds = request.getParameter("selectedIds");
+        String taxPeriodDate = request.getParameter("taxPeriodDate");
+        if (taxPeriodDate==null||"".equals(taxPeriodDate)){
+            SimpleDateFormat taxPeriodFormat = new SimpleDateFormat("yyyyMM");
+            taxPeriodDate=taxPeriodFormat.format(new Date());
+        }
+        try {
+            this.propt.load(new FileInputStream(System.getProperty("EAS_HOME") + "/server/properties/sy/syConfig.properties"));
+            TaxUnitCollection taxUnitCollection = TaxUnitFactory.getLocalInstance(context).getTaxUnitCollection();
+            for (int i = 0; i < taxUnitCollection.size(); i++) {
+                TaxUnitInfo taxUnitInfo = taxUnitCollection.get(i);
+                String bizNo = UUID.randomUUID().toString().replace("-", "");
+                String qymc = taxUnitInfo.getName();//企业名称
+                String mmlx = "0";//密码类型 0表示申报密码;2表示实名账号实名密码
+                String smzh = "";//实名账号
+                String smmm = "";//实名密码
+                String jmsmmm = "";//加密实名密码
+                String sbmm = "";
+                if (taxUnitInfo.getDeclPassword()!=null&&!"".equals(taxUnitInfo.getDeclPassword())){
+                    byte[] decode = Base64.getDecoder().decode(taxUnitInfo.getDeclPassword());
+                    sbmm  = new String(decode);//;//申报密码
+                }
+                String jmsbmm = "";//申报密码加密
+                String djxhid = taxUnitInfo.getRegNumber();//登记序号
+                String nsrsbh = taxUnitInfo.getTaxNumber();//税号
+                String areaid = taxUnitInfo.getAreaCode();//地区编码
+                String bmbh = "";//部门编号
+                String bmmc = "";//部门编码
+                String skssq = taxPeriodDate;//所属期  ----还不知道怎么定这个东西
+                String lzrqcl = "";
+                JSONObject postBody = new JSONObject();
+                postBody.put("bizNo",bizNo);
+                postBody.put("qymc", qymc);
+                postBody.put("mmlx", mmlx);
+                postBody.put("smzh", smzh);
+                postBody.put("smmm", smmm);
+                postBody.put("jmsmmm", jmsmmm);
+                postBody.put("sbmm", sbmm);
+                postBody.put("jmsbmm", jmsbmm);
+                postBody.put("djxhid", djxhid);
+                postBody.put("nsrsbh", nsrsbh);
+                postBody.put("areaid", areaid);
+                postBody.put("bmbh", bmbh);
+                postBody.put("bmmc", bmmc);
+                postBody.put("skssq", skssq);
+                postBody.put("lzrqcl", lzrqcl);
+                BOSUuid id = taxUnitInfo.getId();
+                //STaxPersonRecordEntry
+                TaxPersonRecordEntryCollection taxPersonRecordEntrys = null;
+                if (selectedIds!=null&&!selectedIds.equals("")){
+                    taxPersonRecordEntrys = TaxPersonRecordEntryFactory.getLocalInstance(context).
+                            getTaxPersonRecordEntryCollection("select * , bill.* where taxUnit = '" + id.toString() + "' and id in (" + selectedIds + ")");
+                }else {
+                    taxPersonRecordEntrys = TaxPersonRecordEntryFactory.getLocalInstance(context).
+                            getTaxPersonRecordEntryCollection("select * , bill.* where taxUnit = '" + id.toString() + "' ");
+                }
+
+
+                JSONArray rylb = new JSONArray();
+                JSONObject personInfo = null;
+                int size = taxPersonRecordEntrys.size();
+                if (size==0){
+                    break;
+                }
+                for (int j = 0; j < size; j++) {
+                    personInfo = new JSONObject();
+                    TaxPersonRecordEntryInfo taxPersonRecordEntryInfo = taxPersonRecordEntrys.get(j);
+                    TaxPersonRecordInfo bill = taxPersonRecordEntryInfo.getBill();
+                    String xm = bill.getReportName();//姓名
+                    String zzlx = bill.getCardType().getAlias();//证件类型
+                    String zzhm = bill.getCardNumber();//证件号码
+                    String s = cardTypeReflection(zzlx);//证件类型
+                    Boolean cardType = isCardType(s);
+                    String qtzzlx = "";//其他证件类型
+                    String qtzzhm = "";//其他证件号码
+                    if (cardType) {
+                        qtzzlx = cardTypeReflection(bill.getOtherCardType().getAlias());//其他证件类型
+                        qtzzhm = bill.getOtherCardNumber();//其他证件号码
+                    }
+                    String bmbh1 = "";//部门编码
+                    String rybscl = "";//人员报送策略
+                    String gh = "";//工号
+                    String skssq1 = taxPeriodDate;//所属期
+                    String lxdh = bill.getPhoneNumber(); //电话
+                    String nsrzt = taxPersonRecordEntryInfo.getPersonStatus().getValue();//人员状态
+                    String sfgy = taxPersonRecordEntryInfo.getEmployedType().getAlias();//任职受雇类型
+                    String rzndjyqk = "";//入职年度就业情形
+                    String rzsgrq = "";//受雇日期
+                    if ("雇员、保险营销员、证券经纪人".indexOf(sfgy) >= 0) {
+                        Date employedDate = taxPersonRecordEntryInfo.getEmployedDate();
+                        rzsgrq = simpleDateFormat.format(employedDate);
+                    }
+                    String xb = bill.getGender().getAlias();//性别
+                    String csny = simpleDateFormat.format(bill.getBirthday());//出生日期
+                    String gj = NationalityFactory.getLocalInstance(context).getNationalityInfo(new ObjectUuidPK(bill.getNationality().getId())).getName();//国际
+                    String rydq = bill.getIsOversea().getAlias();//是否境内
+                    if (rydq.equals("否")) {
+                        rydq = "境内";
+                    } else {
+                        rydq = "境外";
+                    }
+                    String lzrq = "";//离职日期
+                    if (nsrzt.equals("0")) {
+                        lzrq = simpleDateFormat.format(taxPersonRecordEntryInfo.getDepartureDate());
+                    }
+                    BigDecimal grgbbl = bill.getInvestmentRate();//个人投资总额
+                    BigDecimal grgbze = bill.getInvestmentTotal();//个人投资比例
+                    String sfcj = bill.isIsDisability() ? "是" : "否";
+                    String cjzjlx = "";//残疾证件类型
+                    String cjzh = "";//残疾证号
+                    if ("是".equals(sfcj)) {
+                        cjzjlx = "";//           系统没有需要加
+                        cjzh = bill.getDisCardNumber();
+                    }
+                    String sfls = bill.isIsHero() ? "是" : "否";
+                    String lszh = "";
+                    if ("是".equals(sfls)) {
+                        lszh = bill.getHeroCardNumber();
+                    }
+                    String sfgl = ""; //是否孤老
+                    String sfzdw = "";//是否扣除减除费用
+                    String dzyx = "";//邮箱
+                    String xl = "";
+                    String zw = "";//	职务
+                    String khyh = "";//	开户银行
+                    String khyhsfmz = "";//	开户银行省份
+                    String yhzh = "";//	银行账号
+                    String lxdz_sheng = "";//	居住省份
+                    String lxdz_shi = "";//	居住城市
+                    String lxdz_qx = "";//	居住区县
+                    String lxdz_jd = "";//	居住街道
+                    String lxdz = "";//	居住详细地址
+                    String hjszd_sheng = "";//	户籍省份
+                    String hjszd_shi = "";//	户籍城市
+                    String hjszd_qx = "";//	户籍区县
+                    String hjszd_jd = "";//	户籍街道
+                    String hjszd_xxdz = "";//	户籍详细地址
+                    String bz = "";//	备注
+                    String csd = "";
+                    String sssx = "";
+                    if (gj.indexOf("中国") < 0) {
+                        logger.error(JSONObject.toJSONString(bill.getBirthPlace()));
+                        logger.error(bill.getBirthPlace().getId());
+                        csd = BirthplaceFactory.getLocalInstance(context).
+                                getBirthplaceInfo(new ObjectUuidPK(bill.getBirthPlace().getId())).getName();
+                        sssx = bill.getTaxReason().getAlias();
+                    }
+                    String ss = "港澳居民来往内地通行证、港澳居民居住证、台湾居民来往大陆通行证、台湾居民居住证、外国护照、外国人永久居留身份证、外国人来华工作许可证A、外国人来华工作许可证B、外国人来华工作许可证C时";
+                    String scrjsj = "";
+                    String yjljsj = "";
+                    if (ss.indexOf(s) >= 0) {
+                        scrjsj = simpleDateFormat.format(bill.getEntryDate());
+                        yjljsj = simpleDateFormat.format(bill.getLeaveDate());
+                    }
+                    String wjrlxdz_sheng = "";//	联系地省份
+                    String wjrlxdz_shi = "";//	联系地城市
+                    String wjrlxdz_qx = "";//	联系地区县
+                    String wjrlxdz_jd = "";//	联系地街道
+                    String wjrlxdz_xxdz = "";//	联系地详细地址
+                    String xmzw = "";//	中文名
+                    ss = "外国护照、外国人永久居留身份证、外国人工作许可证(A类)、外国人工作许可证(B类)、外国人工作许可证(C类)";
+                    if (ss.indexOf(s) < 0) {
+                        xmzw = bill.getChineseName();
+                    }
+                    personInfo.put("xm", xm);
+                    personInfo.put("zzlx", s);
+                    personInfo.put("zzhm", zzhm);
+                    personInfo.put("qtzzlx", qtzzlx);
+                    personInfo.put("qtzzhm", qtzzhm);
+                    personInfo.put("bmbh", bmbh1);
+                    personInfo.put("rybscl", rybscl);
+                    personInfo.put("gh", gh);
+                    personInfo.put("skssq", skssq1);
+                    personInfo.put("lxdh", lxdh);
+                    if (nsrzt.equals("1")){
+                        nsrzt="正常";
+                    }else{
+                        nsrzt = "非正常";
+                    }
+                    personInfo.put("nsrzt", nsrzt);
+                    personInfo.put("sfgy", sfgy);
+                    personInfo.put("rzndjyqk", rzndjyqk);
+                    personInfo.put("rzsgrq", rzsgrq);
+                    personInfo.put("xb", xb);
+                    personInfo.put("csny", csny);
+                    personInfo.put("gj", gj);
+                    personInfo.put("rydq", rydq);
+                    personInfo.put("lzrq", lzrq);
+                    personInfo.put("grgbbl", grgbbl);
+                    personInfo.put("grgbze", grgbze);
+                    personInfo.put("sfcj", sfcj);
+                    personInfo.put("cjzjlx", cjzjlx);
+                    personInfo.put("cjzh", cjzh);
+                    personInfo.put("sfls", sfls);
+                    personInfo.put("lszh", lszh);
+                    personInfo.put("sfgl", sfgl);
+                    personInfo.put("sfzdw", sfzdw);
+                    personInfo.put("dzyx", dzyx);
+                    personInfo.put("xl", xl);
+                    personInfo.put("zw", zw);
+                    personInfo.put("khyh", khyh);
+                    personInfo.put("khyhsfmz", khyhsfmz);
+                    personInfo.put("yhzh", yhzh);
+                    personInfo.put("lxdz_sheng", lxdz_sheng);
+                    personInfo.put("lxdz_shi", lxdz_shi);
+                    personInfo.put("lxdz_qx", lxdz_qx);
+                    personInfo.put("lxdz_jd", lxdz_jd);
+                    personInfo.put("lxdz", lxdz);
+                    personInfo.put("hjszd_sheng", hjszd_sheng);
+                    personInfo.put("hjszd_shi", hjszd_shi);
+                    personInfo.put("hjszd_qx", hjszd_qx);
+                    personInfo.put("hjszd_jd", hjszd_jd);
+                    personInfo.put("hjszd_xxdz", hjszd_xxdz);
+                    personInfo.put("bz", bz);
+                    personInfo.put("csd", csd);
+                    personInfo.put("sssx", sssx);
+                    personInfo.put("scrjsj", scrjsj);
+                    personInfo.put("yjljsj", yjljsj);
+                    personInfo.put("wjrlxdz_sheng", wjrlxdz_sheng);
+                    personInfo.put("wjrlxdz_shi", wjrlxdz_shi);
+                    personInfo.put("wjrlxdz_qx", wjrlxdz_qx);
+                    personInfo.put("wjrlxdz_jd", wjrlxdz_jd);
+                    personInfo.put("wjrlxdz_xxdz", wjrlxdz_xxdz);
+                    personInfo.put("xmzw", xmzw);
+                    rylb.add(personInfo);
+
+                }
+                postBody.put("rylb", rylb);
+                String ip = propt.getProperty("ip");
+                String url = ip + "/gateway/iit/declare/declareEmployeeInfo";
+                logger.error("===请求参数=="+postBody+"========");
+                ISYUtilsFacade localInstance = SYUtilsFacadeFactory.getLocalInstance(context);
+                String post = localInstance.post(url, postBody.toJSONString());
+                System.out.println(post);
+                JSONObject postJSON = JSONObject.parseObject(post);
+                //校验 请求是否成功
+                JSONObject head = postJSON.getJSONObject("head");
+                if (head.getString("status").equals("N")){
+                    returnMap.put("code",500);
+                    returnMap.put("error","请求失败");
+                    JSONUtils.SUCCESS(returnMap);
+                    return;
+                }
+                JSONObject body = postJSON.getJSONObject("body");
+                String string = body.getString("requestId");
+                url = ip+"/gateway/iit/declare/getEmployeeInfoFeedback";
+                String s = localInstance.backTask(url, string, "personnelReportService", null, TaskCatalogEnum.PERSON);
+                logger.error("返回参数:"+post);
+                logger.error("返回参数:"+s);
+                returnMap.put("code",200);
+                returnMap.put("info","报送成功");
+                JSONUtils.SUCCESS(returnMap);
+            }
+
+        } catch (BOSException e) {
+            JSONUtils.ERROR("BOSException",e);
+            throw new RuntimeException(e);
+        } catch (FileNotFoundException e) {
+            JSONUtils.ERROR("FileNotFoundException",e);
+            throw new RuntimeException(e);
+        } catch (IOException e) {
+            JSONUtils.ERROR("IOException",e);
+            throw new RuntimeException(e);
+        } catch (EASBizException e) {
+            JSONUtils.ERROR("EASBizException",e);
+            throw new RuntimeException(e);
+        }
+    }
+
+    /**
+     * 养老金下载
+     * @param request
+     * @param response
+     * @param modelMap
+     * @throws SHRWebException
+     */
+    public void pensionInfoAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws SHRWebException {
+        logger.error("==进入到==com.kingdee.eas.custom.shuiyou.TaxUnitListHandlerEx.personnelReportAction=====================");
+        Context context = SHRContext.getInstance().getContext();
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
+        SimpleDateFormat skssqFormat = new SimpleDateFormat("yyyyMM");
+        Map<String,Object> returnMap = new HashMap<String,Object>();
+        Calendar cal = Calendar.getInstance();
+        String skssq = skssqFormat.format(cal.getTime());
+        try {
+            this.propt.load(new FileInputStream(System.getProperty("EAS_HOME") + "/server/properties/sy/syConfig.properties"));
+            TaxUnitCollection taxUnitCollection = TaxUnitFactory.getLocalInstance(context).getTaxUnitCollection();
+            for (int i = 0; i < taxUnitCollection.size(); i++) {
+                TaxUnitInfo taxUnitInfo = taxUnitCollection.get(i);
+                String bizNo = UUID.randomUUID().toString().replace("-", "");
+                String qymc = taxUnitInfo.getName();//企业名称
+                String mmlx = "0";//密码类型 0表示申报密码;2表示实名账号实名密码
+                String smzh = "";//实名账号
+                String smmm = "";//实名密码
+                String jmsmmm = "";//加密实名密码
+                byte[] decode = Base64.getDecoder().decode(taxUnitInfo.getDeclPassword());
+                String sbmm = new String(decode);//;//申报密码
+                String jmsbmm = "";//申报密码加密
+                String djxhid = taxUnitInfo.getRegNumber();//登记序号
+                String nsrsbh = taxUnitInfo.getTaxNumber();//税号
+                String areaid = taxUnitInfo.getAreaCode();//地区编码
+                String bmbh = "";//部门编号
+                String bmmc = "";//部门编码
+
+                Integer year = cal.get(Calendar.YEAR);
+
+                String lzrqcl = "";
+                JSONObject postBody = new JSONObject();
+                postBody.put("bizNo",bizNo);
+                postBody.put("qymc", qymc);
+                postBody.put("mmlx", mmlx);
+                postBody.put("smzh", smzh);
+                postBody.put("smmm", smmm);
+                postBody.put("jmsmmm", jmsmmm);
+                postBody.put("sbmm", sbmm);
+                postBody.put("jmsbmm", jmsbmm);
+                postBody.put("djxhid", djxhid);
+                postBody.put("nsrsbh", nsrsbh);
+                postBody.put("areaid", areaid);
+                postBody.put("bmbh", bmbh);
+                postBody.put("bmmc", bmmc);
+                postBody.put("year", year);
+                postBody.put("skssq",skssq);
+                postBody.put("lzrqcl", lzrqcl);
+                BOSUuid id = taxUnitInfo.getId();
+                //STaxPersonRecordEntry
+                TaxPersonRecordEntryCollection taxPersonRecordEntrys =
+                        TaxPersonRecordEntryFactory.getLocalInstance(context).
+                                getTaxPersonRecordEntryCollection("select * , bill.* where taxUnit = '" + id.toString() + "'");
+                JSONArray rylb = new JSONArray();
+                JSONObject personInfo = null;
+                int size = taxPersonRecordEntrys.size();
+                if (size==0){
+                    break;
+                }
+                for (int j = 0; j < size; j++) {
+                    personInfo = new JSONObject();
+                    TaxPersonRecordEntryInfo taxPersonRecordEntryInfo = taxPersonRecordEntrys.get(j);
+                    TaxPersonRecordInfo bill = taxPersonRecordEntryInfo.getBill();
+                    String xm = PersonFactory.getLocalInstance(context).getPersonInfo(new ObjectUuidPK(bill.getPerson().getId())).getName();//姓名
+                    String zzlx = bill.getCardType().getAlias();//证件类型
+                    String zzhm = bill.getCardNumber();//证件号码
+                    String s = cardTypeReflection(zzlx);//证件类型
+                    personInfo.put("xm",xm);
+                    personInfo.put("zzlx",s );
+                    personInfo.put("zzhm",zzhm);
+                    rylb.add(personInfo);
+                }
+                postBody.put("rylb", rylb);
+                String ip = propt.getProperty("ip");
+                String url = ip + "/gateway/iit/personalPension/download";
+                logger.error("===请求参数=="+postBody+"========");
+                ISYUtilsFacade localInstance = SYUtilsFacadeFactory.getLocalInstance(context);
+                String post = localInstance.post(url, postBody.toJSONString());
+                JSONObject postJSON = JSONObject.parseObject(post);
+                //校验 请求是否成功
+                JSONObject head = postJSON.getJSONObject("head");
+                if (head.getString("status").equals("N")){
+                    returnMap.put("code",500);
+                    returnMap.put("error","请求失败");
+                    JSONUtils.SUCCESS(returnMap);
+                    return;
+                }
+                JSONObject body = postJSON.getJSONObject("body");
+                String string = body.getString("requestId");
+                url = ip+"/gateway/iit/personalPension/getDownloadFeedback";
+                String s = localInstance.backTask(url, string, "", null, TaskCatalogEnum.PERSON);
+                logger.error("返回参数:"+post);
+                returnMap.put("code",200);
+                returnMap.put("info","下载中");
+                JSONUtils.SUCCESS(returnMap);
+            }
+
+        } catch (BOSException e) {
+            JSONUtils.ERROR("BOSException",e);
+            throw new RuntimeException(e);
+        } catch (FileNotFoundException e) {
+            JSONUtils.ERROR("FileNotFoundException",e);
+            throw new RuntimeException(e);
+        } catch (IOException e) {
+            JSONUtils.ERROR("IOException",e);
+            throw new RuntimeException(e);
+        } catch (EASBizException e) {
+            JSONUtils.ERROR("EASBizException",e);
+            throw new RuntimeException(e);
+        }
+    }
+
+
+    public static void main(String[] args) {
+        String encode = Base64Utils.encode("asdasd");
+        System.out.println(encode);
+    }
+
+    public String cardTypeReflection(String cardTypeName) {
+        switch (cardTypeName) {
+            case "居民身份证":
+                return "居民身份证";
+            case "中国护照":
+                return "中国护照";
+            case "港澳居民来往内地通行证":
+                return "港澳居民来往内地通行证";
+            case "中华人民共和国港澳居民居住证":
+                return "港澳居民来往内地通行证";
+            case "台湾居民来往大陆通行证":
+                return "台湾居民来往大陆通行证";
+            case "中华人民共和国台湾居民居住证":
+                return "台湾居民居住证";
+            case "外国护照":
+                return "外国护照";
+            case "外国人永久居留身份证":
+                return "外国人永久居留身份证";
+            case "中华人民共和国外国人工作许可证(A类)":
+                return "外国人工作许可证(A类)";
+            case "中华人民共和国外国人工作许可证(B类)":
+                return "外国人工作许可证(B类)";
+            case "中华人民共和国外国人工作许可证(C类)":
+                return "外国人工作许可证(C类)";
+        }
+        return "";
+    }
+
+    public Boolean isCardType(String cardType) {
+        String cardTypes = "港澳居民居住证,台湾居民居住证,外国人永久居留身份证,外国人工作许可证(A类),外国人工作许可证(B类),外国人工作许可证(C类)";
+        if (cardTypes.indexOf(cardType) >= 0) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+}

+ 0 - 61
websrc/com/kingdee/eas/custom/shuiyou/service/PersonnelReportService.java

@@ -1,61 +0,0 @@
-package com.kingdee.eas.custom.shuiyou.service;
-
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
-import com.kingdee.bos.BOSException;
-import com.kingdee.bos.Context;
-import com.kingdee.bos.bsf.service.app.IHRMsfService;
-import com.kingdee.bos.dao.ormapping.ObjectUuidPK;
-import com.kingdee.bos.util.BOSUuid;
-import com.kingdee.eas.common.EASBizException;
-import com.kingdee.shr.compensation.SubmitStatusEnum;
-import com.kingdee.shr.compensation.app.incomeTax.TaxPersonRecordEntryFactory;
-import com.kingdee.shr.compensation.app.incomeTax.TaxPersonRecordEntryInfo;
-import org.apache.log4j.Logger;
-
-import java.util.Map;
-
-public class PersonnelReportService implements IHRMsfService {
-    private static Logger logger = Logger.getLogger("com.kingdee.eas.custom.shuiyou.service.PersonnelReportService");
-    @Override
-    public Object process(Context context, Map map) throws EASBizException, BOSException {
-        logger.error("com.kingdee.eas.custom.shuiyou.service.PersonnelReportService.process");
-        Object o = map.get("result");
-        if (o == null) {
-            throw new RuntimeException("参数result为空");
-        }
-        JSONObject jsonObject = JSONObject.parseObject(o.toString());
-        logger.error("入参:"+jsonObject);
-        JSONObject body = jsonObject.getJSONObject("body");
-        JSONArray bsjgs = body.getJSONArray("bsjg");
-        for (int b = 0; b < bsjgs.size(); b++) {
-            JSONObject bsjg = bsjgs.getJSONObject(b);
-            String nsrsbh = bsjg.getString("nsrsbh");
-            TaxPersonRecordEntryInfo taxPersonRecordEntry =
-                    TaxPersonRecordEntryFactory.getLocalInstance(context).
-                            getTaxPersonRecordEntryInfo("select * , bill.* where taxNumber = '" + nsrsbh + "'");
-            String sbzt = bsjg.getString("sbzt");//报送状态 1	待报送 2	代报中 3	代报失败 4	代报成功
-            taxPersonRecordEntry.setSubmitStatus(StartReflection(sbzt));
-            bsjg.getString("rzzt");//验证状态0	若是身份证,状态为验证中;其他证件为暂不验证 1	验证通过 2	验证不通过 4	待验证 9	同代码0处理
-            //bsjg.getString("sfyjd");//是否建档
-            String sbyy = bsjg.getString("sbyy");//失败原因
-            taxPersonRecordEntry.setFailReason(sbyy);
-            BOSUuid id = taxPersonRecordEntry.getId();
-            TaxPersonRecordEntryFactory.getLocalInstance(context).update(new ObjectUuidPK(id),taxPersonRecordEntry);
-        }
-        return null;
-    }
-    public SubmitStatusEnum StartReflection(String start){
-        switch (start){
-            case "1":
-                return SubmitStatusEnum.NotSubmit;
-            case "2":
-                return SubmitStatusEnum.Submiting;
-            case "3":
-                return SubmitStatusEnum.SubmitFail;
-            case "4":
-                return SubmitStatusEnum.HaveSubmit;
-        }
-        return null;
-    }
-}

+ 44 - 0
websrc/com/kingdee/eas/custom/shuiyou/six/handler/CmpTaxDeclarationListHandlerEx.java

@@ -0,0 +1,44 @@
+package com.kingdee.eas.custom.shuiyou.six.handler;
+
+import cn.hutool.core.util.StrUtil;
+import com.google.common.collect.Maps;
+import com.kingdee.bos.BOSException;
+import com.kingdee.bos.Context;
+import com.kingdee.eas.common.EASBizException;
+import com.kingdee.shr.base.syssetting.MSFServiceFacadeFactory;
+import com.kingdee.shr.base.syssetting.context.SHRContext;
+import com.kingdee.shr.base.syssetting.exception.SHRWebException;
+import com.kingdee.shr.base.syssetting.exception.ShrWebBizException;
+
+import com.kingdee.shr.base.syssetting.web.json.JSONUtils;
+import com.kingdee.shr.compensation.web.handler.CmpTaxDeclarationListHandler;
+import org.springframework.ui.ModelMap;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.Map;
+
+/**
+ * description: CmpTaxDeclarationListHandlerEx <br>
+ * date: 2024/9/13 19:53 <br>
+ * author: lhbj <br>
+ * version: 1.0 <br>
+ */
+public class CmpTaxDeclarationListHandlerEx extends CmpTaxDeclarationListHandler {
+
+
+    public String getCompanyIncomesAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws SHRWebException, BOSException, EASBizException {
+        Context ctx = SHRContext.getInstance().getContext();
+        String skssq = request.getParameter("skssq");
+        if(StrUtil.isBlank(skssq)){
+            new ShrWebBizException("ÖÜÆÚΪ¿Õ,Çë´«Èë");
+        }
+        Map<String,String> param = Maps.newHashMap();
+        param.put("skssq",skssq);
+        Object obj = MSFServiceFacadeFactory.getLocalInstance(ctx).processService("getCompanyIncomesService", param);
+
+        JSONUtils.SUCCESS(obj);
+        return null;
+    }
+
+}

+ 201 - 13
websrc/com/kingdee/eas/custom/shuiyou/six/handler/TaxDirectDeductionListHandlerEx.java

@@ -1,25 +1,21 @@
 package com.kingdee.eas.custom.shuiyou.six.handler;
 
-import cn.hutool.json.JSONConfig;
 import cn.hutool.json.JSONObject;
 import cn.hutool.json.JSONUtil;
 import com.kingdee.bos.BOSException;
 import com.kingdee.bos.Context;
 import com.kingdee.bos.dao.IObjectPK;
-import com.kingdee.bos.dao.ormapping.ObjectUuidPK;
 import com.kingdee.bos.metadata.entity.EntityViewInfo;
-import com.kingdee.bos.rabbitmq.guava.Lists;
+import com.kingdee.bos.metadata.entity.FilterInfo;
 import com.kingdee.bos.sql.ParserException;
 import com.kingdee.bos.util.BOSUuid;
 import com.kingdee.eas.common.EASBizException;
 import com.kingdee.eas.custom.shuiyou.incomeTax.TaxDirectDeductionExFacadeFactory;
-import com.kingdee.eas.custom.shuiyou.six.osf.vo.SixTConfirmInfo;
-import com.kingdee.eas.custom.shuiyou.six.osf.vo.SixTPersonInfo;
-import com.kingdee.eas.custom.shuiyou.task.TaskCatalogEnum;
-import com.kingdee.eas.custom.shuiyou.uitls.ISYUtilsFacade;
 
+import com.kingdee.eas.custom.shuiyou.uitls.ISYUtilsFacade;
 import com.kingdee.eas.custom.shuiyou.uitls.SYUtilsFacadeFactory;
 import com.kingdee.eas.custom.shuiyou.uitls.URLConfigEnum;
+import com.kingdee.eas.custom.shuiyou.vo.SixTConfirmInfo;
 import com.kingdee.eas.util.app.DbUtil;
 import com.kingdee.jdbc.rowset.IRowSet;
 import com.kingdee.shr.base.syssetting.app.filter.HRFilterUtils;
@@ -35,8 +31,9 @@ import com.kingdee.shr.compensation.app.taxCal.*;
 import com.kingdee.shr.compensation.util.Base64Utils;
 import com.kingdee.shr.compensation.util.CmpDateUtil;
 import com.kingdee.shr.compensation.util.CmpStrUtil;
-import com.kingdee.shr.compensation.util.TaxReportUtil;
 
+import com.kingdee.shr.compensation.util.TaxReportUtil;
+import com.kingdee.shr.compensation.util.filter.CmpTaxUnitPermFilter;
 import com.kingdee.shr.compensation.util.lock.CmpDistributedLockUtils;
 import com.kingdee.shr.compensation.web.handler.tax.TaxDirectDeductionListHandler;
 import com.kingdee.util.StringUtils;
@@ -58,11 +55,40 @@ import java.util.*;
 public class TaxDirectDeductionListHandlerEx extends TaxDirectDeductionListHandler {
     private static final Logger LOG = Logger.getLogger(TaxDirectDeductionListHandler.class);
 
-    public void specialAmountAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws SHRWebException {
-
+    protected FilterInfo getDefaultFilter(HttpServletRequest request, HttpServletResponse response) throws SHRWebException {
+        FilterInfo customFilter = null;
+//        Context ctx = SHRContext.getInstance().getContext();
+//        String sql = CmpTaxUnitPermFilter.getCurPersonPermTaxUnitSql(ctx);
+//        String inRange = "''";
+//        if (!"".equals(sql)) {
+//            inRange = sql;
+//        }
+//
+//        String oql = "taxPersonRecordEntry.taxUnit.id in (" + inRange + ")";
+//        if (customFilter == null) {
+//            //int lastYear = CmpDateUtil.getYear(new Date()) - 1;
+//           // oql = oql + " and taxUnitDeduction.year = " + lastYear;
+//
+//            try {
+//                customFilter = new FilterInfo(oql);
+//            } catch (ParserException var12) {
+//                LOG.error(var12.getMessage(), var12);
+//            }
+//        } else {
+//            try {
+//                FilterInfo inRangeFilterInfo = new FilterInfo(oql);
+//                customFilter.mergeFilter(inRangeFilterInfo, "AND");
+//            } catch (BOSException var10) {
+//                LOG.error(var10.getMessage(), var10);
+//            } catch (ParserException var11) {
+//                LOG.error(var11.getMessage(), var11);
+//            }
+//        }
 
+        return customFilter;
     }
 
+
     /**
      * 获取人员名单
      * @param request
@@ -73,13 +99,18 @@ public class TaxDirectDeductionListHandlerEx extends TaxDirectDeductionListHandl
     public void personCollectAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws SHRWebException {
         Context ctx = SHRContext.getInstance().getContext();
         String ids = request.getParameter("taxUnitIds");
+        String period = request.getParameter("period");
         int thisYear = CmpDateUtil.getYear(new Date());
         Map<String, Object> map = new HashMap();
         map.put("taxUnitIds", ids);
-        map.put("period", thisYear + "-01");
+        if(!StringUtils.isEmpty(period)&&period.indexOf("-")>=0){
+            String[] periods=period.split("-");
+            map.put("period", periods[0]+"-01");
+        } else {
+            map.put("period", (thisYear-1) + "-01");
+        }
         try {
-
-            List<IObjectPK> list = TaxDirectDeductionExFacadeFactory.getLocalInstance(ctx).staffCollection(map);
+            List<IObjectPK> list = this._staffCollection(ctx,map);
         } catch (BOSException var9) {
             LOG.error("staffCollection failed, caused by: ", var9);
             throw new ShrWebBizException(var9.getMessage());
@@ -87,6 +118,163 @@ public class TaxDirectDeductionListHandlerEx extends TaxDirectDeductionListHandl
     }
 
 
+    protected List _staffCollection(Context ctx, Map paramMap) throws BOSException {
+
+        if (null != paramMap && null != paramMap.get("taxUnitIds") && null != paramMap.get("period")) {
+            String taxUnitIds = (String)paramMap.get("taxUnitIds");
+            List<IObjectPK> arrayList = new ArrayList();
+            String oql = "select id,name,number,taxNumber,areaCode,regNumber,declPassword,realPassword,isAutoDeduct where id in " + CmpStrUtil.buildInSql(taxUnitIds);
+            TaxUnitCollection taxUnitCollection = TaxUnitFactory.getLocalInstance(ctx).getTaxUnitCollection(oql);
+            List<Object[]> params = new ArrayList();
+            ISYUtilsFacade facade = SYUtilsFacadeFactory.getLocalInstance(ctx);
+            Map<String,String> config =facade.getConfig();
+            for(int i = 0; i < taxUnitCollection.size(); ++i) {
+                TaxUnitInfo taxUnitInfo = taxUnitCollection.get(i);
+                String yearMonth = TaxReportUtil.getCurrentYearMonth((String)paramMap.get("period"));
+                int year = Integer.parseInt(yearMonth.substring(0, 4));
+                SixTConfirmInfo sixTConfirmInfo = new SixTConfirmInfo();
+                sixTConfirmInfo.setBizNo(System.currentTimeMillis()+"");
+                sixTConfirmInfo.setQymc(taxUnitInfo.getName());
+                sixTConfirmInfo.setMmlx(null);
+                sixTConfirmInfo.setSmzh(null);
+                sixTConfirmInfo.setSmmm(null);
+                sixTConfirmInfo.setJmsmmm(null);
+                sixTConfirmInfo.setDjxhid(taxUnitInfo.getRegNumber());
+                sixTConfirmInfo.setNsrsbh(taxUnitInfo.getTaxNumber());
+                sixTConfirmInfo.setAreaid(taxUnitInfo.getAreaCode());
+                sixTConfirmInfo.setBmbh(null);
+                sixTConfirmInfo.setBmmc(null);
+                sixTConfirmInfo.setSbmm(Base64Utils.decode(taxUnitInfo.getDeclPassword()));
+                sixTConfirmInfo.setJmsbmm(null);
+                sixTConfirmInfo.setSkssnd(String.valueOf(year));
+                taxUnitInfo.put("year",year);
+                //sixTConfirmInfo.setAcceptId(acceptIdMap.get(taxUnitDeductionInfo.getId().toString()));
+                sixTConfirmInfo.setTAXUNITID(taxUnitInfo.getId().toString());
+                String result = facade.post(config.get("ip")+ URLConfigEnum.QUERYPREDEDUCT_VALUE, JSONUtil.toJsonStr(sixTConfirmInfo));
+
+                String taxUnitDeductionId = this.saveTaxUnitDeduction(ctx, taxUnitInfo, year);
+                Object[] param = new Object[]{null, taxUnitDeductionId, BOSUuid.create("46E337F4").toString()};
+                params.add(param);
+                if(null!=result) {
+                    //成功写入人员是否6w
+                    this._saveStaffCollection(ctx,taxUnitInfo,result);
+                }else{
+                    throw new BOSException("接口调用异常");
+                }
+            }
+            String sqlString = "insert into T_HR_STaskIncomeTaxRelation (FTaskId,FBizId,Fid) values (?, ?, ?)";
+            DbUtil.executeBatch(ctx, sqlString, params);
+            return arrayList;
+        } else {
+            throw new BOSException("6万直接扣除人员归集接口服务参数缺失,请检查参数");
+        }
+    }
+
+    protected String saveTaxUnitDeduction(Context ctx, TaxUnitInfo taxUnit, int year) throws BOSException {
+        IObjectPK pk;
+        try {
+            String taxUnitId = taxUnit.getId().toString();
+            String deleteSQL = "delete from T_HR_STaxUnitDeduction where fTaxUnitId = '" + taxUnitId + "' and fYear = " + year;
+            DbUtil.execute(ctx, deleteSQL);
+            deleteSQL = "delete from t_hr_sTaxDirectDeduction where fTaxUnitDeductionId in (select fid from T_HR_STaxUnitDeduction where fTaxUnitId = '" + taxUnitId + "' and fYear = " + year + ")";
+            DbUtil.execute(ctx, deleteSQL);
+            TaxUnitDeductionInfo info = new TaxUnitDeductionInfo();
+            info.setTaxUnit(taxUnit);
+            info.setYear(year);
+            info.setIsCollection(true);
+            pk = TaxUnitDeductionFactory.getLocalInstance(ctx).save(info);
+        } catch (EASBizException var8) {
+            LOG.error("_saveStaffCollection error: ", var8);
+            throw new BOSException(var8.getMessage());
+        }
+
+        return pk.toString();
+    }
+
+    protected String getTaxUnitDeduction(Context ctx, TaxUnitInfo taxUnit, int year) throws BOSException {
+        String oql = "select id where taxUnit.id = '" + taxUnit.getId().toString() + "' and year = " + year;
+        TaxUnitDeductionCollection collection = TaxUnitDeductionFactory.getLocalInstance(ctx).getTaxUnitDeductionCollection(oql);
+        if (null != collection && !collection.isEmpty()) {
+            return collection.get(0).getId().toString();
+        } else {
+            throw new BOSException("没有找到纳税单位归集信息");
+        }
+    }
+
+
+    protected synchronized void _saveStaffCollection(Context ctx, TaxUnitInfo taxUnit, String result) throws BOSException {
+        JSONObject object = JSONUtil.parseObj(result);
+        JSONObject head = object.getJSONObject("head");
+        Map<String, Object> headMap = (Map)object.get("head");
+        Map<String, Object> bodyMap = (Map)object.get("body");
+        if ("00000000".equals(head.getStr("code"))) {
+            System.out.println("_saveStaffCollection:start");
+            List<Map<String, Object>> kczglbList = (bodyMap.containsKey("kczglb") ? (List<Map<String, Object>>) bodyMap.get("kczglb") : null);
+            if (null != kczglbList && !kczglbList.isEmpty()) {
+                String prefix = "person_collect_";
+                String resource = taxUnit.getId().toString();
+                boolean flag = CmpDistributedLockUtils.tryLock(ctx, prefix, resource);
+                if (flag) {
+                    try {
+                        int year = taxUnit.getInt("year");
+                        String taxUnitDeductionId = this.getTaxUnitDeduction(ctx, taxUnit, year);
+                        Map<String, Integer> personMap = new HashMap();
+                        String userId = HRFilterUtils.getCurrentUserId(ctx);
+                        Iterator itgjrylb = kczglbList.iterator();
+
+                        while(itgjrylb.hasNext()) {
+                            Map<String, Object> stringObjectMap = (Map)itgjrylb.next();
+                            personMap.put(stringObjectMap.get("zzhm").toString(), "是".equals(stringObjectMap.get("kcbs")) ? 1 : 0);
+                        }
+                        String cardNumbers = CmpStrUtil.converMapToString(personMap);
+                        String sql = "SELECT e.fid, r.fCardNumber FROM t_hr_sTaxPersonRecordEntry e, t_hr_sTaxPersonRecord r WHERE e.fTaxUnitID = '" + resource + "' " + " and e.fBillId = r.fid " + " and r.fCardNumber IN (" + cardNumbers + ")";
+                        IRowSet rowSet = DbUtil.executeQuery(ctx, sql);
+                        Timestamp createTime = new Timestamp(System.currentTimeMillis());
+                        List<Object[]> paramList = new ArrayList();
+                        HashMap personSet = new HashMap();
+
+                        while(rowSet.next()) {
+                            Object[] param = new Object[10];
+                            String taxPersonRecordEntryId = rowSet.getString(1);
+                            param[0] = taxPersonRecordEntryId;
+                            Integer isDirect = (Integer)personMap.get(rowSet.getString(2));
+                            param[1] = isDirect;
+                            param[2] = taxUnitDeductionId;
+                            param[3] = userId;
+                            param[4] = createTime;
+                            param[5] = userId;
+                            param[6] = createTime;
+                            param[7] = BOSUuid.create("F831C6DA").toString();
+                            param[8] = "";
+                            param[9] = 10;
+                            personSet.put(taxPersonRecordEntryId, isDirect);
+                            paramList.add(param);
+                        }
+                        System.out.println("_saveStaffCollection:"+JSONUtil.toJsonStr(paramList));
+                        String batchSql = "INSERT INTO T_HR_STAXDIRECTDEDUCTION( FTaxPersonRecordEntryId, FISDECDUT, FTAXUNITDEDUCTIONID, FCREATORID, FCREATETIME,  FLASTUPDATEUSERID, FLASTUPDATETIME, FID, FTaskId, fSate)  VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
+                        DbUtil.executeBatch(ctx, batchSql, paramList);
+                        sql = "UPDATE t_hr_sTaxPersonRecordEntry SET fIsDirect = ? WHERE fid = ?";
+                        paramList = new ArrayList();
+                        Iterator itPersonSet = personSet.entrySet().iterator();
+
+                        while(itPersonSet.hasNext()) {
+                            Map.Entry<String, Integer> entry = (Map.Entry)itPersonSet.next();
+                            Object[] param = new Object[]{entry.getValue(), entry.getKey()};
+                            paramList.add(param);
+                        }
+                        DbUtil.executeBatch(ctx, sql, paramList);
+                        System.out.println("_saveStaffCollection:"+JSONUtil.toJsonStr(paramList));
+                    } catch (Exception var33) {
+                        LOG.error("_saveStaffCollection error: ", var33);
+                    } finally {
+                        CmpDistributedLockUtils.unlock(ctx, prefix, resource);
+                    }
+                }
+            }
+        }else{
+            throw new BOSException(result);
+        }
+    }
     /**
      * 确认人员名单
      * @param request

+ 790 - 0
websrc/com/kingdee/eas/custom/shuiyou/six/handler/TaxPersonRecordListHandlerEx.java

@@ -0,0 +1,790 @@
+package com.kingdee.eas.custom.shuiyou.six.handler;
+
+import cn.hutool.json.JSONUtil;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.google.common.collect.Maps;
+import com.kingdee.bos.BOSException;
+import com.kingdee.bos.Context;
+import com.kingdee.bos.dao.IObjectPK;
+import com.kingdee.bos.dao.ormapping.ObjectUuidPK;
+import com.kingdee.bos.metadata.entity.EntityViewInfo;
+import com.kingdee.bos.metadata.entity.FilterInfo;
+import com.kingdee.bos.metadata.entity.SelectorItemCollection;
+import com.kingdee.bos.metadata.entity.SelectorItemInfo;
+import com.kingdee.bos.sql.ParserException;
+import com.kingdee.bos.util.BOSUuid;
+import com.kingdee.eas.basedata.hraux.BirthplaceFactory;
+import com.kingdee.eas.basedata.hraux.NationalityFactory;
+import com.kingdee.eas.common.EASBizException;
+import com.kingdee.eas.custom.shuiyou.incomeTax.ITaxPersonReportExFacade;
+import com.kingdee.eas.custom.shuiyou.incomeTax.TaxPersonReportExFacadeFactory;
+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.framework.CoreBaseCollection;
+import com.kingdee.eas.framework.CoreBaseInfo;
+import com.kingdee.eas.framework.util.FilterUtility;
+import com.kingdee.eas.util.app.DbUtil;
+import com.kingdee.shr.base.syssetting.context.SHRContext;
+import com.kingdee.shr.base.syssetting.exception.SHRWebException;
+import com.kingdee.shr.base.syssetting.exception.ShrWebBizException;
+import com.kingdee.shr.base.syssetting.util.SqlFilter;
+import com.kingdee.shr.base.syssetting.web.json.JSONUtils;
+import com.kingdee.shr.compensation.*;
+import com.kingdee.shr.compensation.app.entity.TaxPersonEntity;
+import com.kingdee.shr.compensation.app.entity.Triple;
+import com.kingdee.shr.compensation.app.incomeTax.*;
+import com.kingdee.shr.compensation.app.tax.TaxUnitCollection;
+import com.kingdee.shr.compensation.app.tax.TaxUnitFactory;
+import com.kingdee.shr.compensation.app.tax.TaxUnitInfo;
+import com.kingdee.shr.compensation.app.taxCal.ITaxServiceTaskFacade;
+import com.kingdee.shr.compensation.app.taxCal.TaxCalTaskCatalogEnum;
+import com.kingdee.shr.compensation.app.taxCal.TaxServiceTaskFacadeFactory;
+import com.kingdee.shr.compensation.util.Base64Utils;
+import com.kingdee.shr.compensation.util.CmpDateUtil;
+import com.kingdee.shr.compensation.util.TaxReportUtil;
+import com.kingdee.shr.compensation.util.filter.CmpTaxUnitPermFilter;
+import com.kingdee.shr.compensation.web.handler.incometax.TaxPersonRecordListHandler;
+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.lang.reflect.Field;
+import java.math.BigDecimal;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+/**
+ * description: TaxPersonRecordListHandlerEx <br>
+ * date: 2024/9/11 14:25 <br>
+ * author: lhbj <br>
+ * version: 1.0 <br>
+ */
+public class TaxPersonRecordListHandlerEx extends TaxPersonRecordListHandler {
+    private static Logger logger = Logger.getLogger("com.kingdee.eas.custom.shuiyou.TaxUnitListHandlerEx");
+    /**
+     * 人员报送
+     * @param request
+     * @param response
+     * @param modelMap
+     * @throws SHRWebException
+     */
+    @Override
+    public String reportAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws SHRWebException {
+        Context ctx = SHRContext.getInstance().getContext();
+        String selectedIds = request.getParameter("selectedIds");
+        String taxPeriodDate = request.getParameter("taxPeriodDate");
+        HashMap map = new HashMap();
+
+        try {
+            if (!StringUtils.isEmpty(selectedIds)) {
+                int count = 0;
+                selectedIds = "'" + selectedIds.replaceAll(",", "','") + "'";
+                String oql = " select id,submitStatus where id in (" + selectedIds + ")";
+                ITaxPersonRecordEntry iTaxPersonRecordEntry = TaxPersonRecordEntryFactory.getLocalInstance(ctx);
+                TaxPersonRecordEntryCollection taxRecordEntryCollection = iTaxPersonRecordEntry.getTaxPersonRecordEntryCollection(oql);
+
+                for(int i = 0; i < taxRecordEntryCollection.size(); ++i) {
+                    TaxPersonRecordEntryInfo taxPersonRecordEntryInfo = taxRecordEntryCollection.get(i);
+                    if (SubmitStatusEnum.Submiting.equals(taxPersonRecordEntryInfo.getSubmitStatus()) || SubmitStatusEnum.HaveSubmit.equals(taxPersonRecordEntryInfo.getSubmitStatus())) {
+                        ++count;
+                    }
+                }
+
+                if (count == taxRecordEntryCollection.size()) {
+                    map.put("message", TaxReportMessageEnum.Report_False.getAlias());
+                } else if (count == 0) {
+                    map.put("message", TaxReportMessageEnum.Report_True.getAlias());
+                } else {
+                    map.put("message", TaxReportMessageEnum.Report_Between.getAlias());
+                }
+            } else {
+                map.put("message", TaxReportMessageEnum.Report_Between.getAlias());
+            }
+
+            String filter = this.getFilter(request, response, modelMap);
+
+
+            logger.error("------------>>>>reportAction:taxPeriodDate" + taxPeriodDate);
+            ITaxPersonReportExFacade iTaxPersonReportFacade = TaxPersonReportExFacadeFactory.getLocalInstance(ctx);
+            iTaxPersonReportFacade.report(selectedIds, taxPeriodDate, filter);
+            //this._report(ctx,selectedIds, taxPeriodDate, filter);
+            JSONUtils.SUCCESS(map);
+            return null;
+        } catch (Exception var14) {
+            logger.error(var14.getMessage(), var14);
+            System.err.println("--------------->>>>>>>>捕获异常:" + var14.getMessage().toString());
+            throw new ShrWebBizException(var14.getMessage());
+        }
+    }
+    private Set<String> getPersonsSet(List<TaxPersonEntity> taxPersonEntitys, String sdyf) {
+        Set<String> result = new HashSet();
+        if (null != taxPersonEntitys && taxPersonEntitys.size() >= 1) {
+            Iterator i$ = taxPersonEntitys.iterator();
+
+            while(i$.hasNext()) {
+                TaxPersonEntity taxPersonEntity = (TaxPersonEntity)i$.next();
+                result.add(taxPersonEntity.getXm() + "_" + taxPersonEntity.getZzhm() + "_" + taxPersonEntity.getZzlx() + "_" + sdyf);
+            }
+
+            return result;
+        } else {
+            return result;
+        }
+    }
+    private Map<TaxUnitInfo, List<TaxPersonRecordEntryInfo>> getEntryMap(TaxPersonRecordEntryCollection taxRecordEntryCollection) {
+        Map<TaxUnitInfo, List<TaxPersonRecordEntryInfo>> entryMap = new HashMap();
+        Map<String, List<TaxPersonRecordEntryInfo>> stringEntryMap = new HashMap();
+        Map<String, TaxUnitInfo> taxUnitMap = new HashMap();
+
+        for(int i = 0; i < taxRecordEntryCollection.size(); ++i) {
+            TaxPersonRecordEntryInfo taxPersonRecordEntryInfo = taxRecordEntryCollection.get(i);
+            TaxUnitInfo taxUnit = taxPersonRecordEntryInfo.getTaxUnit();
+            if (!taxUnitMap.containsKey(taxUnit.getId().toString())) {
+                taxUnitMap.put(taxUnit.getId().toString(), taxUnit);
+            }
+
+            if (stringEntryMap.containsKey(taxUnit.getId().toString())) {
+                List<TaxPersonRecordEntryInfo> taxPersonRecordEntryInfos = (List)stringEntryMap.get(taxUnit.getId().toString());
+                taxPersonRecordEntryInfos.add(taxPersonRecordEntryInfo);
+            } else {
+                List<TaxPersonRecordEntryInfo> taxPersonRecordEntryInfos = new ArrayList();
+                taxPersonRecordEntryInfos.add(taxPersonRecordEntryInfo);
+                stringEntryMap.put(taxUnit.getId().toString(), taxPersonRecordEntryInfos);
+            }
+        }
+
+        Iterator i$ = stringEntryMap.entrySet().iterator();
+
+        while(i$.hasNext()) {
+            Map.Entry<String, List<TaxPersonRecordEntryInfo>> entry = (Map.Entry)i$.next();
+            entryMap.put(taxUnitMap.get(entry.getKey()), entry.getValue());
+        }
+
+        return entryMap;
+    }
+    private List<Object[]> getParamsList(CoreBaseCollection coreBaseCollection, String taskId) {
+        List<Object[]> paramsList = new ArrayList();
+
+        for(int i = 0; i < coreBaseCollection.size(); ++i) {
+            CoreBaseInfo coreBaseInfo = coreBaseCollection.get(i);
+            Object[] object;
+            String bankCardStatus;
+            String id;
+            if (coreBaseInfo instanceof TaxPersonRecordEntryInfo) {
+                object = new Object[6];
+                TaxPersonRecordEntryInfo taxPersonRecordEntryInfo = (TaxPersonRecordEntryInfo)coreBaseInfo;
+                bankCardStatus = taxPersonRecordEntryInfo.getSubmitStatus().getValue();
+                String identityStatus = taxPersonRecordEntryInfo.getIdentityStatus().getValue();
+                String lastReportMonth = taxPersonRecordEntryInfo.getLastReportMonth();
+                id = taxPersonRecordEntryInfo.getId().toString();
+                object[0] = bankCardStatus;
+                object[1] = identityStatus;
+                object[2] = taskId != null ? taskId : "-1";
+                object[3] = lastReportMonth;
+                object[4] = CmpDateUtil.toSqlDate(lastReportMonth + "-01");
+                object[5] = id;
+                paramsList.add(object);
+            }
+
+            if (coreBaseInfo instanceof TaxPersonRecordInfo) {
+                object = new Object[2];
+                TaxPersonRecordInfo taxPersonRecordInfo = (TaxPersonRecordInfo)coreBaseInfo;
+                bankCardStatus = taxPersonRecordInfo.getBankCardStatus().getValue();
+                id = taxPersonRecordInfo.getId().toString();
+                object[0] = bankCardStatus;
+                object[1] = id;
+                paramsList.add(object);
+            }
+        }
+
+        return paramsList;
+    }
+
+    protected Map<TaxUnitInfo, Triple<List<TaxPersonEntity>, CoreBaseCollection, CoreBaseCollection>> getTripleMap(TaxPersonRecordEntryCollection taxRecordEntryCollection, String taxPeriodDate) {
+        Map<TaxUnitInfo, Triple<List<TaxPersonEntity>, CoreBaseCollection, CoreBaseCollection>> tripleMap = new HashMap();
+        Map<TaxUnitInfo, List<TaxPersonRecordEntryInfo>> entryMap = this.getEntryMap(taxRecordEntryCollection);
+        Set<String> billIdSet = new HashSet();
+        Iterator i$ = entryMap.entrySet().iterator();
+
+        while(i$.hasNext()) {
+            Map.Entry<TaxUnitInfo, List<TaxPersonRecordEntryInfo>> entry = (Map.Entry)i$.next();
+            Triple<List<TaxPersonEntity>, CoreBaseCollection, CoreBaseCollection> triple = new Triple();
+            TaxUnitInfo key = (TaxUnitInfo)entry.getKey();
+            List<TaxPersonRecordEntryInfo> value = (List)entry.getValue();
+            List<TaxPersonEntity> taxPersonEntitys = new ArrayList();
+            CoreBaseCollection entryBaseCollection = new CoreBaseCollection();
+            CoreBaseCollection billBaseCollection = new CoreBaseCollection();
+            Iterator i$value = value.iterator();
+
+            while(i$value.hasNext()) {
+                TaxPersonRecordEntryInfo taxPersonRecordEntryInfo = (TaxPersonRecordEntryInfo)i$value.next();
+                TaxPersonEntity taxPersonEntity = TaxReportUtil.taxPersonRecordEntryInfo2TaxPersonEntity(taxPersonRecordEntryInfo);
+                taxPersonEntitys.add(taxPersonEntity);
+                taxPersonRecordEntryInfo.setSubmitStatus(SubmitStatusEnum.Submiting);
+                taxPersonRecordEntryInfo.setIdentityStatus(IdentityStatusEnume.VerifyING);
+                taxPersonRecordEntryInfo.setLastReportMonth(taxPeriodDate);
+                entryBaseCollection.add(taxPersonRecordEntryInfo);
+                TaxPersonRecordInfo bill = taxPersonRecordEntryInfo.getBill();
+                if (!billIdSet.contains(bill.getId().toString())) {
+                    bill.setBankCardStatus(BankCardStatusEnum.VerifyING);
+                    billBaseCollection.add(bill);
+                    billIdSet.add(bill.getId().toString());
+                }
+            }
+
+            triple.setFirst(taxPersonEntitys);
+            triple.setSecond(entryBaseCollection);
+            triple.setThree(billBaseCollection);
+            tripleMap.put(key, triple);
+        }
+
+        return tripleMap;
+    }
+    protected List<IObjectPK> _report(Context ctx, String entryIDs, String taxPeriodDate, String filter) throws BOSException {
+        String curPersonPermTaxUnitSql = CmpTaxUnitPermFilter.getCurPersonPermTaxUnitSql(ctx);
+        String oql = "select *,bill.*,bill.person.*,bill.nationality.*,bill.position.*,bill.birthPlace.*,bill.eduLevel.*,bill.bank.name,bill.hrBank.name,taxUnit.id,taxUnit.areacode,taxUnit.name,taxUnit.taxNumber,taxUnit.areaCode,taxUnit.regNumber,taxUnit.declPassword,taxUnit.realPassword where (submitStatus=0 or submitStatus=3) ";
+        logger.error("------------>>>>_report:" + oql);
+        if (!StringUtils.isEmpty(entryIDs)) {
+            oql = oql + " and taxUnit.id in (" + curPersonPermTaxUnitSql + ")";
+            oql = oql + " and id in (" + entryIDs + ")";
+        } else {
+            if (StringUtils.isEmpty(filter)) {
+                return null;
+            }
+
+            oql = oql + " and " + filter;
+        }
+        ArrayList arrayList = new ArrayList();
+        try {
+            ITaxPersonRecordEntry iTaxPersonRecordEntry = TaxPersonRecordEntryFactory.getLocalInstance(ctx);
+            TaxPersonRecordEntryCollection taxRecordEntryCollection = iTaxPersonRecordEntry.getTaxPersonRecordEntryCollection(oql);
+            if (taxRecordEntryCollection.size() == 0) {
+                return null;
+            } else {
+                Map<TaxUnitInfo, Triple<List<TaxPersonEntity>, CoreBaseCollection, CoreBaseCollection>> tripleMap = this.getTripleMap(taxRecordEntryCollection, taxPeriodDate);
+                ITaxServiceTaskFacade iTaxServiceTaskFacade = TaxServiceTaskFacadeFactory.getLocalInstance(ctx);
+                Iterator i$ = tripleMap.entrySet().iterator();
+                ISYUtilsFacade localInstance = SYUtilsFacadeFactory.getLocalInstance(ctx);
+                Map<String,String> propt=localInstance.getConfig();
+                while(i$.hasNext()) {
+                    Map.Entry<TaxUnitInfo, Triple<List<TaxPersonEntity>, CoreBaseCollection, CoreBaseCollection>> entry = (Map.Entry)i$.next();
+                    TaxUnitInfo taxUnitInfo = (TaxUnitInfo)entry.getKey();
+                    Triple<List<TaxPersonEntity>, CoreBaseCollection, CoreBaseCollection> value = (Triple)entry.getValue();
+                    List<TaxPersonEntity> taxPersonEntitys = (List)value.getFirst();
+                    CoreBaseCollection entryBaseCollection = (CoreBaseCollection)value.getSecond();
+                    CoreBaseCollection billBaseCollection = (CoreBaseCollection)value.getThree();
+                    Map<String, Object> reMap = new HashMap();
+                    reMap.put("nsrsbh", taxUnitInfo.getTaxNumber());
+                    reMap.put("areaid", taxUnitInfo.getAreaCode());
+                    reMap.put("djxhid", taxUnitInfo.getRegNumber());
+                    reMap.put("ver", "V2.0.000");
+                    reMap.put("sbmm", Base64Utils.decode(taxUnitInfo.getDeclPassword()));
+                    String realPassword = taxUnitInfo.getRealPassword();
+                    if (!StringUtils.isEmpty(realPassword)) {
+                        reMap.put("smmm", Base64Utils.decode(realPassword));
+                    }
+
+                    reMap.put("zrs", taxPersonEntitys.size());
+                    String sdyf = TaxReportUtil.getCurrentYearMonth(taxPeriodDate);
+                    reMap.put("sdyf", sdyf);
+                    reMap.put("bmbh", "");
+                    reMap.put("nsrlb", taxPersonEntitys);
+                    reMap.put("TAXUNITID", taxUnitInfo.getId().toString());
+                    Set<String> persons = this.getPersonsSet(taxPersonEntitys, sdyf);
+                    reMap.put("persons", persons);
+                    //二开开始
+                    String bizNo = UUID.randomUUID().toString().replace("-", "");
+                    String qymc = taxUnitInfo.getName();//企业名称
+                    String mmlx = "0";//密码类型 0表示申报密码;2表示实名账号实名密码
+                    String smzh = "";//实名账号
+                    String smmm = "";//实名密码
+                    String jmsmmm = "";//加密实名密码
+                    String sbmm = "";
+                    sbmm=( Base64Utils.decode(taxUnitInfo.getDeclPassword()));
+                    String jmsbmm = "";//申报密码加密
+                    String djxhid = taxUnitInfo.getRegNumber();//登记序号
+                    String nsrsbh = taxUnitInfo.getTaxNumber();//税号
+                    String areaid = taxUnitInfo.getAreaCode();//地区编码
+                    String bmbh = "";//部门编号
+                    String bmmc = "";//部门编码
+                    String skssq = sdyf;//所属期
+                    String lzrqcl = "";
+                    JSONObject postBody = new JSONObject();
+                    postBody.put("bizNo",bizNo);
+                    postBody.put("qymc", qymc);
+                    postBody.put("mmlx", mmlx);
+                    postBody.put("smzh", smzh);
+                    postBody.put("smmm", smmm);
+                    postBody.put("jmsmmm", jmsmmm);
+                    postBody.put("sbmm", sbmm);
+                    postBody.put("jmsbmm", jmsbmm);
+                    postBody.put("djxhid", djxhid);
+                    postBody.put("nsrsbh", nsrsbh);
+                    postBody.put("areaid", areaid);
+                    postBody.put("bmbh", bmbh);
+                    postBody.put("bmmc", bmmc);
+                    postBody.put("skssq", skssq);
+                    postBody.put("lzrqcl", lzrqcl);
+                    BOSUuid id = taxUnitInfo.getId();
+                    JSONArray rylb = new JSONArray();
+                    for(TaxPersonEntity personEntity : taxPersonEntitys){
+                        Map<String,Object> person = this.objectToMap(personEntity);
+
+                        TaxPersonRecordInfo rInfo=null;
+                        String zzhm=personEntity.getZzhm();
+                        for(int i=0;i<billBaseCollection.size();i++){
+                            TaxPersonRecordInfo r1Info= (TaxPersonRecordInfo) billBaseCollection.get(i);
+                            if(zzhm.equals(r1Info.getCardNumber())) {
+                                rInfo=r1Info;
+                                break;
+                            }
+                        }
+                        person.put("skssq",sdyf);
+                        Optional<IsOverseaEnum> oversea = Optional.ofNullable(rInfo.getIsOversea());
+                        person.put("rydq","0".equals(oversea.orElse(IsOverseaEnum.NotOversea).getValue())?"境内":"境外");
+                        person.put("grgbbl",rInfo.getInvestmentRate());//个人投资总额
+                        person.put("grgbze",rInfo.getInvestmentTotal());//个人投资比例
+                        person.put("khyhsfmz",rInfo.getBankCardProvince());//开户银行省份(名字)
+                        person.put("rybscl","否");//开户银行省份(名字)
+                        rylb.add(person);
+                    }
+                    postBody.put("rylb",rylb);
+                    String ip = propt.get("ip");
+                    String url = ip + "/gateway/iit/declare/declareEmployeeInfo";
+                    logger.error("===请求参数=="+postBody+"========");
+                    String post = localInstance.post(url, postBody.toJSONString());
+                    System.out.println(post);
+                    JSONObject postJSON = JSONObject.parseObject(post);
+                    //校验 请求是否成功
+                    JSONObject head = postJSON.getJSONObject("head");
+                    String code = (String) head.get("code");
+                    if ("00000000".equals(code)){
+                        JSONObject body = postJSON.getJSONObject("body");
+
+                        String taskId = localInstance.addTask("personnelReportService", JSONUtil.toJsonStr(body), TaskCatalogEnum.PERSON,null);
+                        List<Object[]> recordEntryParamsList = this.getParamsList(entryBaseCollection, taskId);
+                        String recordEntrySql = "update T_HR_STaxPersonRecordEntry set FSubmitStatus= ?, FIdentityStatus=?,CFTaskID=?, FLastReportMonth=?,FEndDate=? where fid =?";
+                        DbUtil.executeBatch(ctx, recordEntrySql, recordEntryParamsList);
+                        logger.info("--------->>>>>更新报送状态、验证状态:recordEntrySql:" + recordEntrySql + "------>>>>recordEntryParamsList:" + recordEntryParamsList + "---------->>>addTask:" + taskId);
+                        List<Object[]> recordParamsList = this.getParamsList(billBaseCollection, (String)null);
+                        String recordSql = "update T_HR_STaxPersonRecord set FBankCardStatus=? where fid =?";
+                        DbUtil.executeBatch(ctx, recordSql, recordParamsList);
+                        logger.info("--------->>>>>更新银行卡号状态:recordSql:" + recordSql + "------>>>>recordParamsList:" + recordParamsList);
+                        arrayList.add(taskId);
+                    }
+                }
+                return arrayList;
+            }
+        } catch (Exception var28) {
+            logger.error(var28.getMessage(), var28);
+            logger.error("------------>>>>捕获异常:" + var28.getMessage());
+            throw new BOSException(var28.getMessage(), var28);
+        }
+    }
+
+    public Map<String,Object> objectToMap(Object obj){
+        Map<String,Object> map = Maps.newHashMap();
+        Class<?> clazz = obj.getClass();
+        for(Field field : clazz.getDeclaredFields()){
+            try{
+                field.setAccessible(true);
+                map.put(field.getName(),field.get(obj));
+            }catch (IllegalAccessException e){
+                e.printStackTrace();
+            }
+        }
+        return map;
+    }
+
+
+
+    protected String getFilter(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws SHRWebException {
+        super.prepareQueryList(request, response, modelMap);
+        EntityViewInfo assembleEntityViewInfo = this.assembleEntityViewInfo(request, modelMap);
+        FilterInfo filter = assembleEntityViewInfo.getFilter();
+        return filter.toSql();
+    }
+    protected EntityViewInfo assembleEntityViewInfo(HttpServletRequest request, ModelMap modelMap) throws SHRWebException {
+        EntityViewInfo defaultEntityViewInfo = (EntityViewInfo)modelMap.get("DataGridEntityView");
+        if (defaultEntityViewInfo == null) {
+            defaultEntityViewInfo = new EntityViewInfo();
+        }
+
+        String[] selector;
+        SelectorItemCollection sic;
+        int len$;
+        if (!StringUtils.isEmpty(request.getParameter("selector"))) {
+            selector = request.getParameter("selector").split(",");
+            sic = defaultEntityViewInfo.getSelector();
+            int i = 0;
+
+            for(len$ = selector.length; i < len$; ++i) {
+                sic.add(new SelectorItemInfo(selector[i]));
+            }
+        }
+
+        if (!StringUtils.isEmpty(request.getParameter("columnModel"))) {
+            selector = request.getParameter("columnModel").split(",");
+            sic = defaultEntityViewInfo.getSelector();
+            String[] arr$ = selector;
+            len$ = selector.length;
+
+            for(int i$ = 0; i$ < len$; ++i$) {
+                String s = arr$[i$];
+                if (SqlFilter.isvalid(s)) {
+                    sic.add(new SelectorItemInfo(s));
+                }
+            }
+        }
+
+        String filter = (String)modelMap.get("filter");
+        if (StringUtils.isEmpty(filter)) {
+            filter = request.getParameter("filter");
+        }
+
+        if (!StringUtils.isEmpty(filter)) {
+            try {
+                FilterInfo filterInfo = new FilterInfo(filter);
+                if (FilterUtility.hasFilterItem(defaultEntityViewInfo.getFilter())) {
+                    defaultEntityViewInfo.getFilter().mergeFilter(filterInfo, "AND");
+                } else {
+                    defaultEntityViewInfo.setFilter(new FilterInfo(filter));
+                }
+            } catch (ParserException var12) {
+                throw new SHRWebException(var12.getMessage(), var12);
+            } catch (BOSException var13) {
+                throw new SHRWebException(var13.getMessage(), var13);
+            }
+        }
+
+        String filterItems = (String)modelMap.get("filterItems");
+        if (StringUtils.isEmpty(filterItems)) {
+            filterItems = request.getParameter("filterItems");
+        }
+
+        if (!StringUtils.isEmpty(filterItems)) {
+            try {
+                FilterInfo filterInfo = new FilterInfo(filterItems);
+                if (FilterUtility.hasFilterItem(defaultEntityViewInfo.getFilter())) {
+                    defaultEntityViewInfo.getFilter().mergeFilter(filterInfo, "AND");
+                } else {
+                    defaultEntityViewInfo.setFilter(new FilterInfo(filterItems));
+                }
+            } catch (ParserException var10) {
+                throw new SHRWebException(var10);
+            } catch (BOSException var11) {
+                throw new SHRWebException(var11);
+            }
+        }
+        return defaultEntityViewInfo;
+    }
+    public String personnelReportAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws SHRWebException {
+        logger.error("==进入到==com.kingdee.eas.custom.shuiyou.TaxUnitListHandlerEx.personnelReportAction=====================");
+        Context context = SHRContext.getInstance().getContext();
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
+        Map<String,Object> returnMap = new HashMap<String,Object>();
+        String selectedIds = request.getParameter("selectedIds");
+        String taxPeriodDate = request.getParameter("taxPeriodDate");
+        if (taxPeriodDate==null||"".equals(taxPeriodDate)){
+            SimpleDateFormat taxPeriodFormat = new SimpleDateFormat("yyyyMM");
+            taxPeriodDate=taxPeriodFormat.format(new Date());
+        }
+        try {
+            ISYUtilsFacade localInstance = SYUtilsFacadeFactory.getLocalInstance(context);
+            Map<String,String> propt=localInstance.getConfig();
+            TaxUnitCollection taxUnitCollection = TaxUnitFactory.getLocalInstance(context).getTaxUnitCollection();
+            for (int i = 0; i < taxUnitCollection.size(); i++) {
+                TaxUnitInfo taxUnitInfo = taxUnitCollection.get(i);
+                String bizNo = UUID.randomUUID().toString().replace("-", "");
+                String qymc = taxUnitInfo.getName();//企业名称
+                String mmlx = "0";//密码类型 0表示申报密码;2表示实名账号实名密码
+                String smzh = "";//实名账号
+                String smmm = "";//实名密码
+                String jmsmmm = "";//加密实名密码
+                String sbmm = "";
+                if (taxUnitInfo.getDeclPassword()!=null&&!"".equals(taxUnitInfo.getDeclPassword())){
+                    byte[] decode = Base64.getDecoder().decode(taxUnitInfo.getDeclPassword());
+                    sbmm  = new String(decode);//;//申报密码
+                }
+                String jmsbmm = "";//申报密码加密
+                String djxhid = taxUnitInfo.getRegNumber();//登记序号
+                String nsrsbh = taxUnitInfo.getTaxNumber();//税号
+                String areaid = taxUnitInfo.getAreaCode();//地区编码
+                String bmbh = "";//部门编号
+                String bmmc = "";//部门编码
+                String skssq = taxPeriodDate;//所属期  ----还不知道怎么定这个东西
+                String lzrqcl = "";
+                JSONObject postBody = new JSONObject();
+                postBody.put("bizNo",bizNo);
+                postBody.put("qymc", qymc);
+                postBody.put("mmlx", mmlx);
+                postBody.put("smzh", smzh);
+                postBody.put("smmm", smmm);
+                postBody.put("jmsmmm", jmsmmm);
+                postBody.put("sbmm", sbmm);
+                postBody.put("jmsbmm", jmsbmm);
+                postBody.put("djxhid", djxhid);
+                postBody.put("nsrsbh", nsrsbh);
+                postBody.put("areaid", areaid);
+                postBody.put("bmbh", bmbh);
+                postBody.put("bmmc", bmmc);
+                postBody.put("skssq", skssq);
+                postBody.put("lzrqcl", lzrqcl);
+                BOSUuid id = taxUnitInfo.getId();
+                //STaxPersonRecordEntry
+                TaxPersonRecordEntryCollection taxPersonRecordEntrys = null;
+                if (selectedIds!=null&&!selectedIds.equals("")){
+                    taxPersonRecordEntrys = TaxPersonRecordEntryFactory.getLocalInstance(context).
+                            getTaxPersonRecordEntryCollection("select * , bill.* where taxUnit = '" + id.toString() + "' and id in (" + selectedIds + ")");
+                }else {
+                    taxPersonRecordEntrys = TaxPersonRecordEntryFactory.getLocalInstance(context).
+                            getTaxPersonRecordEntryCollection("select * , bill.* where taxUnit = '" + id.toString() + "' ");
+                }
+
+
+                JSONArray rylb = new JSONArray();
+                JSONObject personInfo = null;
+                int size = taxPersonRecordEntrys.size();
+                if (size==0){
+                    break;
+                }
+                for (int j = 0; j < size; j++) {
+                    personInfo = new JSONObject();
+                    TaxPersonRecordEntryInfo taxPersonRecordEntryInfo = taxPersonRecordEntrys.get(j);
+                    TaxPersonRecordInfo bill = taxPersonRecordEntryInfo.getBill();
+                    String xm = bill.getReportName();//姓名
+                    String zzlx = bill.getCardType().getAlias();//证件类型
+                    String zzhm = bill.getCardNumber();//证件号码
+                    String s = cardTypeReflection(zzlx);//证件类型
+                    Boolean cardType = isCardType(s);
+                    String qtzzlx = "";//其他证件类型
+                    String qtzzhm = "";//其他证件号码
+                    if (cardType) {
+                        qtzzlx = cardTypeReflection(bill.getOtherCardType().getAlias());//其他证件类型
+                        qtzzhm = bill.getOtherCardNumber();//其他证件号码
+                    }
+                    String bmbh1 = "";//部门编码
+                    String rybscl = "";//人员报送策略
+                    String gh = "";//工号
+                    String skssq1 = taxPeriodDate;//所属期
+                    String lxdh = bill.getPhoneNumber(); //电话
+                    String nsrzt = taxPersonRecordEntryInfo.getPersonStatus().getValue();//人员状态
+                    String sfgy = taxPersonRecordEntryInfo.getEmployedType().getAlias();//任职受雇类型
+                    String rzndjyqk = "";//入职年度就业情形
+                    String rzsgrq = "";//受雇日期
+                    if ("雇员、保险营销员、证券经纪人".indexOf(sfgy) >= 0) {
+                        Date employedDate = taxPersonRecordEntryInfo.getEmployedDate();
+                        rzsgrq = simpleDateFormat.format(employedDate);
+                    }
+                    String xb = bill.getGender().getAlias();//性别
+                    String csny = simpleDateFormat.format(bill.getBirthday());//出生日期
+                    String gj = NationalityFactory.getLocalInstance(context).getNationalityInfo(new ObjectUuidPK(bill.getNationality().getId())).getName();//国际
+                    String rydq = bill.getIsOversea().getAlias();//是否境内
+                    if (rydq.equals("否")) {
+                        rydq = "境内";
+                    } else {
+                        rydq = "境外";
+                    }
+                    String lzrq = "";//离职日期
+                    if (nsrzt.equals("0")) {
+                        lzrq = simpleDateFormat.format(taxPersonRecordEntryInfo.getDepartureDate());
+                    }
+                    BigDecimal grgbbl = bill.getInvestmentRate();//个人投资总额
+                    BigDecimal grgbze = bill.getInvestmentTotal();//个人投资比例
+                    String sfcj = bill.isIsDisability() ? "是" : "否";
+                    String cjzjlx = "";//残疾证件类型
+                    String cjzh = "";//残疾证号
+                    if ("是".equals(sfcj)) {
+                        cjzjlx = "";//           系统没有需要加
+                        cjzh = bill.getDisCardNumber();
+                    }
+                    String sfls = bill.isIsHero() ? "是" : "否";
+                    String lszh = "";
+                    if ("是".equals(sfls)) {
+                        lszh = bill.getHeroCardNumber();
+                    }
+                    String sfgl = ""; //是否孤老
+                    String sfzdw = "";//是否扣除减除费用
+                    String dzyx = "";//邮箱
+                    String xl = "";
+                    String zw = "";//	职务
+                    String khyh = "";//	开户银行
+                    String khyhsfmz = "";//	开户银行省份
+                    String yhzh = "";//	银行账号
+                    String lxdz_sheng = "";//	居住省份
+                    String lxdz_shi = "";//	居住城市
+                    String lxdz_qx = "";//	居住区县
+                    String lxdz_jd = "";//	居住街道
+                    String lxdz = "";//	居住详细地址
+                    String hjszd_sheng = "";//	户籍省份
+                    String hjszd_shi = "";//	户籍城市
+                    String hjszd_qx = "";//	户籍区县
+                    String hjszd_jd = "";//	户籍街道
+                    String hjszd_xxdz = "";//	户籍详细地址
+                    String bz = "";//	备注
+                    String csd = "";
+                    String sssx = "";
+                    if (gj.indexOf("中国") < 0) {
+                        logger.error(JSONObject.toJSONString(bill.getBirthPlace()));
+                        logger.error(bill.getBirthPlace().getId());
+                        csd = BirthplaceFactory.getLocalInstance(context).
+                                getBirthplaceInfo(new ObjectUuidPK(bill.getBirthPlace().getId())).getName();
+                        sssx = bill.getTaxReason().getAlias();
+                    }
+                    String ss = "港澳居民来往内地通行证、港澳居民居住证、台湾居民来往大陆通行证、台湾居民居住证、外国护照、外国人永久居留身份证、外国人来华工作许可证A、外国人来华工作许可证B、外国人来华工作许可证C时";
+                    String scrjsj = "";
+                    String yjljsj = "";
+                    if (ss.indexOf(s) >= 0) {
+                        scrjsj = simpleDateFormat.format(bill.getEntryDate());
+                        yjljsj = simpleDateFormat.format(bill.getLeaveDate());
+                    }
+                    String wjrlxdz_sheng = "";//	联系地省份
+                    String wjrlxdz_shi = "";//	联系地城市
+                    String wjrlxdz_qx = "";//	联系地区县
+                    String wjrlxdz_jd = "";//	联系地街道
+                    String wjrlxdz_xxdz = "";//	联系地详细地址
+                    String xmzw = "";//	中文名
+                    ss = "外国护照、外国人永久居留身份证、外国人工作许可证(A类)、外国人工作许可证(B类)、外国人工作许可证(C类)";
+                    if (ss.indexOf(s) < 0) {
+                        xmzw = bill.getChineseName();
+                    }
+                    personInfo.put("xm", xm);
+                    personInfo.put("zzlx", s);
+                    personInfo.put("zzhm", zzhm);
+                    personInfo.put("qtzzlx", qtzzlx);
+                    personInfo.put("qtzzhm", qtzzhm);
+                    personInfo.put("bmbh", bmbh1);
+                    personInfo.put("rybscl", rybscl);
+                    personInfo.put("gh", gh);
+                    personInfo.put("skssq", skssq1);
+                    personInfo.put("lxdh", lxdh);
+                    if (nsrzt.equals("1")){
+                        nsrzt="正常";
+                    }else{
+                        nsrzt = "非正常";
+                    }
+                    personInfo.put("nsrzt", nsrzt);
+                    personInfo.put("sfgy", sfgy);
+                    personInfo.put("rzndjyqk", rzndjyqk);
+                    personInfo.put("rzsgrq", rzsgrq);
+                    personInfo.put("xb", xb);
+                    personInfo.put("csny", csny);
+                    personInfo.put("gj", gj);
+                    personInfo.put("rydq", rydq);
+                    personInfo.put("lzrq", lzrq);
+                    personInfo.put("grgbbl", grgbbl);
+                    personInfo.put("grgbze", grgbze);
+                    personInfo.put("sfcj", sfcj);
+                    personInfo.put("cjzjlx", cjzjlx);
+                    personInfo.put("cjzh", cjzh);
+                    personInfo.put("sfls", sfls);
+                    personInfo.put("lszh", lszh);
+                    personInfo.put("sfgl", sfgl);
+                    personInfo.put("sfzdw", sfzdw);
+                    personInfo.put("dzyx", dzyx);
+                    personInfo.put("xl", xl);
+                    personInfo.put("zw", zw);
+                    personInfo.put("khyh", khyh);
+                    personInfo.put("khyhsfmz", khyhsfmz);
+                    personInfo.put("yhzh", yhzh);
+                    personInfo.put("lxdz_sheng", lxdz_sheng);
+                    personInfo.put("lxdz_shi", lxdz_shi);
+                    personInfo.put("lxdz_qx", lxdz_qx);
+                    personInfo.put("lxdz_jd", lxdz_jd);
+                    personInfo.put("lxdz", lxdz);
+                    personInfo.put("hjszd_sheng", hjszd_sheng);
+                    personInfo.put("hjszd_shi", hjszd_shi);
+                    personInfo.put("hjszd_qx", hjszd_qx);
+                    personInfo.put("hjszd_jd", hjszd_jd);
+                    personInfo.put("hjszd_xxdz", hjszd_xxdz);
+                    personInfo.put("bz", bz);
+                    personInfo.put("csd", csd);
+                    personInfo.put("sssx", sssx);
+                    personInfo.put("scrjsj", scrjsj);
+                    personInfo.put("yjljsj", yjljsj);
+                    personInfo.put("wjrlxdz_sheng", wjrlxdz_sheng);
+                    personInfo.put("wjrlxdz_shi", wjrlxdz_shi);
+                    personInfo.put("wjrlxdz_qx", wjrlxdz_qx);
+                    personInfo.put("wjrlxdz_jd", wjrlxdz_jd);
+                    personInfo.put("wjrlxdz_xxdz", wjrlxdz_xxdz);
+                    personInfo.put("xmzw", xmzw);
+                    rylb.add(personInfo);
+
+                }
+                postBody.put("rylb", rylb);
+                String ip = propt.get("ip");
+                String url = ip + "/gateway/iit/declare/declareEmployeeInfo";
+                logger.error("===请求参数=="+postBody+"========");
+
+                String post = localInstance.post(url, postBody.toJSONString());
+                System.out.println(post);
+                JSONObject postJSON = JSONObject.parseObject(post);
+                //校验 请求是否成功
+                JSONObject head = postJSON.getJSONObject("head");
+                if (head.getString("status").equals("N")){
+                    returnMap.put("code",500);
+                    returnMap.put("error","请求失败");
+                    JSONUtils.SUCCESS(returnMap);
+                    return null;
+                }
+                JSONObject body = postJSON.getJSONObject("body");
+                String string = body.getString("requestId");
+
+                String s = localInstance.addTask("personnelReportService", JSONUtil.toJsonStr(body), TaskCatalogEnum.PERSON,null);
+                logger.error("返回参数:"+post);
+                logger.error("返回参数:"+s);
+                returnMap.put("code",200);
+                returnMap.put("info","报送成功");
+                JSONUtils.SUCCESS(returnMap);
+            }
+
+        } catch (BOSException e) {
+            JSONUtils.ERROR("BOSException",e);
+            throw new RuntimeException(e);
+        } catch (EASBizException e) {
+            JSONUtils.ERROR("EASBizException",e);
+            throw new RuntimeException(e);
+        }
+        return null;
+    }
+    public String cardTypeReflection(String cardTypeName) {
+        switch (cardTypeName) {
+            case "居民身份证":
+                return "居民身份证";
+            case "中国护照":
+                return "中国护照";
+            case "港澳居民来往内地通行证":
+                return "港澳居民来往内地通行证";
+            case "中华人民共和国港澳居民居住证":
+                return "港澳居民来往内地通行证";
+            case "台湾居民来往大陆通行证":
+                return "台湾居民来往大陆通行证";
+            case "中华人民共和国台湾居民居住证":
+                return "台湾居民居住证";
+            case "外国护照":
+                return "外国护照";
+            case "外国人永久居留身份证":
+                return "外国人永久居留身份证";
+            case "中华人民共和国外国人工作许可证(A类)":
+                return "外国人工作许可证(A类)";
+            case "中华人民共和国外国人工作许可证(B类)":
+                return "外国人工作许可证(B类)";
+            case "中华人民共和国外国人工作许可证(C类)":
+                return "外国人工作许可证(C类)";
+        }
+        return "";
+    }
+    public Boolean isCardType(String cardType) {
+        String cardTypes = "港澳居民居住证,台湾居民居住证,外国人永久居留身份证,外国人工作许可证(A类),外国人工作许可证(B类),外国人工作许可证(C类)";
+        if (cardTypes.indexOf(cardType) >= 0) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+}

+ 253 - 0
websrc/com/kingdee/eas/custom/shuiyou/six/osf/GetCompanyIncomesService.java

@@ -0,0 +1,253 @@
+package com.kingdee.eas.custom.shuiyou.six.osf;
+
+import cn.hutool.core.util.StrUtil;
+import cn.hutool.json.JSONArray;
+import cn.hutool.json.JSONObject;
+import cn.hutool.json.JSONUtil;
+import com.kingdee.bos.BOSException;
+import com.kingdee.bos.Context;
+import com.kingdee.bos.bsf.service.app.IHRMsfService;
+import com.kingdee.bos.metadata.entity.*;
+import com.kingdee.bos.metadata.query.util.CompareType;
+import com.kingdee.eas.basedata.person.*;
+import com.kingdee.eas.common.EASBizException;
+import com.kingdee.eas.custom.shuiyou.task.MessageResult;
+import com.kingdee.eas.custom.shuiyou.uitls.ISYUtilsFacade;
+import com.kingdee.eas.custom.shuiyou.uitls.SYUtilsFacadeFactory;
+import com.kingdee.eas.custom.shuiyou.uitls.URLConfigEnum;
+import com.kingdee.eas.framework.CoreBaseCollection;
+
+import com.kingdee.shr.compensation.app.tax.*;
+import com.kingdee.shr.dydeploy.web.executeSql.ExceptionUtils;
+
+
+import java.math.BigDecimal;
+import java.text.SimpleDateFormat;
+
+import java.util.Calendar;
+
+import java.util.Map;
+
+/**
+ * description: GetCompanyIncomes <br>
+ * date: 2024/9/13 19:02 <br>
+ * author: lhbj <br>
+ * version: 1.0 <br>
+ */
+public class GetCompanyIncomesService implements IHRMsfService {
+    @Override
+    public Object process(Context context, Map map) throws EASBizException, BOSException {
+        String this_taskid = (String) map.get("this_taskId");
+        String param = (String) map.get("paramData");
+        ISYUtilsFacade facade = SYUtilsFacadeFactory.getLocalInstance(context);
+        Map<String, String> config = facade.getConfig();
+        ITaxUnit taxUnit = TaxUnitFactory.getLocalInstance(context);
+        String skssq = (String) map.get("skssq");
+        MessageResult messageResult = null;
+        try {
+            JSONObject parJSONMap = null;
+            if (StrUtil.isNotBlank(param)) {
+                parJSONMap = JSONUtil.parseObj(param);
+                if (StrUtil.isBlank(skssq)) {
+                    skssq = (String) parJSONMap.getStr("skssq");
+                }
+            }
+
+            BigDecimal ZERO = BigDecimal.ZERO;
+            EntityViewInfo viewInfo = new EntityViewInfo();
+            SelectorItemCollection sc = new SelectorItemCollection();
+            sc.add(new SelectorItemInfo("id"));
+            sc.add(new SelectorItemInfo("number"));
+            sc.add(new SelectorItemInfo("name"));
+            sc.add(new SelectorItemInfo("realPassword"));//实名密码
+            sc.add(new SelectorItemInfo("declPassword"));//申报密码
+            sc.add(new SelectorItemInfo("areaCode"));//行政区划代码
+            sc.add(new SelectorItemInfo("regNumber"));//登记号
+            sc.add(new SelectorItemInfo("taxNumber"));//扣缴单位纳税人识别号
+            sc.add(new SelectorItemInfo("state"));
+            viewInfo.setSelector(sc);
+            FilterInfo filterInfo = new FilterInfo();
+            filterInfo.getFilterItems().add(new FilterItemInfo("state", "1", CompareType.EQUALS));
+            viewInfo.setFilter(filterInfo);
+            TaxUnitCollection taxUnitCollection = taxUnit.getTaxUnitCollection(viewInfo);
+            ITaxDeclaration taxDeclaration = TaxDeclarationFactory.getLocalInstance(context);
+            IPerson iPerson = PersonFactory.getLocalInstance(context);
+            EntityViewInfo personViewInfo = new EntityViewInfo();
+            SelectorItemCollection personSc = new SelectorItemCollection();
+            personSc.add(new SelectorItemInfo("id"));
+            personViewInfo.setSelector(personSc);
+            SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
+            System.out.println("GetCompanyIncomesService:"+taxUnitCollection.toString());
+            for (int i = 0; i < taxUnitCollection.size(); i++) {
+                TaxUnitInfo taxUnitInfo = taxUnitCollection.get(i);
+                String declPassword = taxUnitInfo.getDeclPassword();
+                String areaid = taxUnitInfo.getAreaCode();
+                String name = taxUnitInfo.getName();
+                String djxhid = taxUnitInfo.getRegNumber();
+                String nsrsbh = taxUnitInfo.getTaxNumber();
+                if (StrUtil.isNotBlank(nsrsbh) && StrUtil.isNotBlank(djxhid) &&
+                        StrUtil.isNotBlank(name) && StrUtil.isNotBlank(areaid) &&
+                        StrUtil.isNotBlank(declPassword)) {
+                    int pageNo = 1;
+                    int pageSize = 4999;
+                    boolean next =false;
+                    do {
+                        next =false;
+
+                        String result = facade.post(config.get("ip") + URLConfigEnum.GETCOMPANYINCOMES_VALUE, param);
+                        System.out.println("GetCompanyIncomesService:result:"+result.toString());
+                        TaxDeclarationInfo info = new TaxDeclarationInfo();
+                        JSONObject resultMap = JSONUtil.parseObj(result);
+                        JSONObject head = resultMap.getJSONObject("head");
+                        JSONObject body = resultMap.getJSONObject("body");
+                        String code = head.getStr("code");
+                        if ("00000000".equals(code)) {
+                            String total = body.getStr("total");
+                            Integer totalInt = Integer.valueOf(total);
+                            if (totalInt.compareTo(0) > 0) {
+                                if(totalInt.compareTo(pageSize+pageNo) > 0){
+                                    pageNo=pageNo+1;
+                                    next =true;
+                                }
+                                JSONArray sfmx = body.getJSONArray("sfmx");
+                                CoreBaseCollection collection = new CoreBaseCollection();
+                                for (int j = 0; j < sfmx.size(); j++) {
+                                    TaxDeclarationInfo declaration = new TaxDeclarationInfo();
+                                    JSONObject sfm = sfmx.getJSONObject(j);
+                                    String zjhm = sfm.getStr("zjhm");
+                                    FilterInfo personfilterInfo = new FilterInfo();
+                                    personfilterInfo.getFilterItems().add(new FilterItemInfo("idCardNO", zjhm, CompareType.EQUALS));
+                                    FilterInfo personfilterInfo2 = new FilterInfo();
+                                    personfilterInfo2.getFilterItems().add(new FilterItemInfo("passportNO", zjhm, CompareType.EQUALS));
+                                    personfilterInfo.mergeFilter(personfilterInfo2, "or");
+                                    personViewInfo.setFilter(personfilterInfo);
+                                    PersonCollection perc = iPerson.getPersonCollection(personViewInfo);
+                                    PersonInfo personInfo = null;
+                                    if (null != perc) {
+                                        personInfo = perc.get(0);
+                                    }
+                                    if (null == personInfo) {
+                                        continue;
+                                    }
+                                    declaration.setPerson(personInfo);
+                                    Integer year = Integer.valueOf(skssq.substring(0, 4));
+                                    Integer month = Integer.valueOf(skssq.substring(4, 6));
+                                    declaration.setPeriodYear(year);
+                                    declaration.setPeriodMonth(month);
+                                    Calendar begin = Calendar.getInstance();
+                                    begin.set(year, month, 1);
+                                    declaration.setTaxPeriodBegin(begin.getTime());
+                                    begin.add(Calendar.MONTH, 1);
+                                    begin.add(Calendar.DAY_OF_MONTH, -1);
+                                    declaration.setTaxPeriodEnd(begin.getTime());
+                                    declaration.setTaxUnit(taxUnitInfo);
+                                    declaration.setIdType(sfm.getStr("zjlx"));//证件类型
+                                    declaration.setIdNO(zjhm);
+                                    declaration.setTaxPayerNum(sfm.getStr(nsrsbh));
+                                    declaration.setIsPersonal(("1".equals(sfm.getStr("sffjm"))) ? false : true);//非居民个人;1:否 2:是
+                                    declaration.setProceedItem(sfm.getStr("sdxmmc"));//所得项目名称
+                                    String income = sfm.getStr("sre");
+                                    declaration.setIncome(StrUtil.isNotBlank(income) ? new BigDecimal(income) : ZERO);
+                                    String cost = sfm.getStr("fy");
+                                    declaration.setIncome(StrUtil.isNotBlank(cost) ? new BigDecimal(cost) : ZERO);
+                                    String exemptIncome = sfm.getStr("mssr");
+                                    declaration.setExemptIncome(StrUtil.isNotBlank(exemptIncome) ? new BigDecimal(exemptIncome) : ZERO);
+                                    String deductions = sfm.getStr("jcfy");
+                                    declaration.setDeductions(StrUtil.isNotBlank(deductions) ? new BigDecimal(deductions) : ZERO);
+                                    String basicPension = sfm.getStr("jbylaobxf");
+                                    declaration.setBasicPension(StrUtil.isNotBlank(basicPension) ? new BigDecimal(basicPension) : ZERO);
+                                    String basicMedical = sfm.getStr("jbylbxf");
+                                    declaration.setBasicMedical(StrUtil.isNotBlank(basicMedical) ? new BigDecimal(basicMedical) : ZERO);
+                                    String unemployment = sfm.getStr("sybxf");
+                                    declaration.setUnemployment(StrUtil.isNotBlank(unemployment) ? new BigDecimal(unemployment) : ZERO);
+                                    String housingFund = sfm.getStr("zfgjj");
+                                    declaration.setHousingFund(StrUtil.isNotBlank(housingFund) ? new BigDecimal(housingFund) : ZERO);
+                                    String annuity = sfm.getStr("nj");
+                                    declaration.setAnnuity(StrUtil.isNotBlank(annuity) ? new BigDecimal(annuity) : ZERO);
+                                    String comHelath = sfm.getStr("syjkbx");
+                                    declaration.setComHelath(StrUtil.isNotBlank(comHelath) ? new BigDecimal(comHelath) : ZERO);
+                                    String taxDeferred = sfm.getStr("syylbx");
+                                    declaration.setTaxDeferred(StrUtil.isNotBlank(taxDeferred) ? new BigDecimal(taxDeferred) : ZERO);
+                                    String originalValue = sfm.getStr("ccyz");
+                                    declaration.setOriginalValue(StrUtil.isNotBlank(originalValue) ? new BigDecimal(originalValue) : ZERO);
+                                    String taxAllowReduct = sfm.getStr("yxkcsf");
+                                    declaration.setTaxAllowReduct(StrUtil.isNotBlank(taxAllowReduct) ? new BigDecimal(taxAllowReduct) : ZERO);
+                                    String otherDeductions = sfm.getStr("qt");
+                                    declaration.setOtherDeductions(StrUtil.isNotBlank(otherDeductions) ? new BigDecimal(otherDeductions) : ZERO);
+                                    String incomeSum = sfm.getStr("ljsre");
+                                    declaration.setIncomeSum(StrUtil.isNotBlank(incomeSum) ? new BigDecimal(incomeSum) : ZERO);
+                                    String deductionSum = sfm.getStr("ljjcfy");
+                                    declaration.setDeductionSum(StrUtil.isNotBlank(deductionSum) ? new BigDecimal(deductionSum) : ZERO);
+                                    String specialDeductSum = sfm.getStr("ljzxkc");
+                                    declaration.setSpecialDeductSum(StrUtil.isNotBlank(specialDeductSum) ? new BigDecimal(specialDeductSum) : ZERO);
+                                    String ChildEducateSum = sfm.getStr("ljznjy");
+                                    declaration.setChildEducateSum(StrUtil.isNotBlank(ChildEducateSum) ?
+                                            new BigDecimal(ChildEducateSum) : ZERO);
+                                    String OldSupportSum = sfm.getStr("ljsylr");
+                                    declaration.setOldSupportSum(StrUtil.isNotBlank(OldSupportSum) ?
+                                            new BigDecimal(OldSupportSum) : ZERO);
+                                    String LoanInterestSum = sfm.getStr("ljzfdklx");
+                                    declaration.setLoanInterestSum(StrUtil.isNotBlank(LoanInterestSum) ?
+                                            new BigDecimal(LoanInterestSum) : ZERO);
+                                    String HousingRentSum = sfm.getStr("ljzfzj");
+                                    declaration.setHousingRentSum(StrUtil.isNotBlank(HousingRentSum) ?
+                                            new BigDecimal(HousingRentSum) : ZERO);
+                                    String ContinueEducateSum = sfm.getStr("ljjxjy");
+                                    declaration.setContinueEducateSum(StrUtil.isNotBlank(ContinueEducateSum) ?
+                                            new BigDecimal(ContinueEducateSum) : ZERO);
+                                    String OtherDeductionSum = sfm.getStr("ljqtkc");
+                                    declaration.setOtherDeductionSum(StrUtil.isNotBlank(OtherDeductionSum) ?
+                                            new BigDecimal(OtherDeductionSum) : ZERO);
+                                    String TaxableRatio = sfm.getStr("jjbl");
+                                    declaration.setTaxableRatio(StrUtil.isNotBlank(TaxableRatio) ?
+                                            new BigDecimal(TaxableRatio) : ZERO);
+                                    String AllowDonationSum = sfm.getStr("zykcjze");
+                                    declaration.setAllowDonationSum(StrUtil.isNotBlank(AllowDonationSum) ?
+                                            new BigDecimal(AllowDonationSum) : ZERO);
+                                    String TaxableIncomeSum = sfm.getStr("ynssde");
+                                    declaration.setTaxableIncomeSum(StrUtil.isNotBlank(TaxableIncomeSum) ?
+                                            new BigDecimal(TaxableIncomeSum) : ZERO);
+                                    String TaxRatio = sfm.getStr("sl");
+                                    declaration.setTaxRatio(StrUtil.isNotBlank(TaxRatio) ?
+                                            new BigDecimal(TaxRatio) : ZERO);
+                                    String QuickDeduct = sfm.getStr("sskcs");
+                                    declaration.setQuickDeduct(StrUtil.isNotBlank(QuickDeduct) ?
+                                            new BigDecimal(QuickDeduct) : ZERO);
+
+                                    String TaxPayableSum = sfm.getStr("ynse");
+                                    declaration.setTaxPayableSum(StrUtil.isNotBlank(TaxPayableSum) ?
+                                            new BigDecimal(TaxPayableSum) : ZERO);
+                                    String TaxCreditSum = sfm.getStr("jmse");
+                                    declaration.setTaxCreditSum(StrUtil.isNotBlank(TaxCreditSum) ?
+                                            new BigDecimal(TaxCreditSum) : ZERO);
+                                    String TaxPaidSum = sfm.getStr("ykjse");
+                                    declaration.setTaxPaidSum(StrUtil.isNotBlank(TaxPaidSum) ?
+                                            new BigDecimal(TaxPaidSum) : ZERO);
+                                    String TaxSupOrRefund = sfm.getStr("ybtse");
+                                    declaration.setTaxSupOrRefund(StrUtil.isNotBlank(TaxSupOrRefund) ?
+                                            new BigDecimal(TaxSupOrRefund) : ZERO);
+                                    declaration.setSourceType(SourceType.outer);
+                                    declaration.setItemDefine(ItemDefine.NormalSalary);
+                                    declaration.setReportName(sfm.getStr("xm"));
+                                    String InFantSum = sfm.getStr("ljyyezhzc");
+                                    declaration.setInFantSum(StrUtil.isNotBlank(InFantSum) ?
+                                            new BigDecimal(InFantSum) : ZERO);
+                                    String PersonalPension = sfm.getStr("ljgrylj");
+                                    declaration.setPersonalPension(StrUtil.isNotBlank(PersonalPension) ?
+                                            new BigDecimal(PersonalPension) : ZERO);
+                                    collection.add(declaration);
+                                }
+                                taxDeclaration.addnewBatchData(collection);
+                            }
+                        }
+                    }while (next);
+                }
+            }
+            messageResult = MessageResult.SUCCESS();
+        } catch (Exception e) {
+            e.printStackTrace();
+            messageResult = MessageResult.ERROR(ExceptionUtils.getStackTrace(e));
+        }
+        return messageResult;
+    }
+}

+ 148 - 0
websrc/com/kingdee/eas/custom/shuiyou/six/osf/GetPensionDownloadFeedback.java

@@ -0,0 +1,148 @@
+package com.kingdee.eas.custom.shuiyou.six.osf;
+
+import cn.hutool.json.JSONArray;
+import cn.hutool.json.JSONObject;
+import cn.hutool.json.JSONUtil;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import com.kingdee.bos.BOSException;
+import com.kingdee.bos.Context;
+import com.kingdee.bos.bsf.service.app.IHRMsfService;
+import com.kingdee.bos.dao.ormapping.ObjectUuidPK;
+import com.kingdee.bos.metadata.entity.SelectorItemCollection;
+import com.kingdee.bos.metadata.entity.SelectorItemInfo;
+
+import com.kingdee.eas.common.EASBizException;
+import com.kingdee.eas.custom.shuiyou.task.*;
+import com.kingdee.eas.custom.shuiyou.uitls.ISYUtilsFacade;
+import com.kingdee.eas.custom.shuiyou.uitls.SYUtilsFacadeFactory;
+import com.kingdee.eas.custom.shuiyou.uitls.URLConfigEnum;
+import com.kingdee.eas.util.app.DbUtil;
+import com.kingdee.jdbc.rowset.IRowSet;
+import com.kingdee.shr.dydeploy.web.executeSql.ExceptionUtils;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 养老金下载反馈
+ * description: GetDownloadFeedback <br>
+ * date: 2024/9/12 16:58 <br>
+ * author: lhbj <br>
+ * version: 1.0 <br>
+ */
+public class GetPensionDownloadFeedback implements IHRMsfService {
+    @Override
+    public Object process(Context context, Map map) throws EASBizException, BOSException {
+        ITask iTask = TaskFactory.getLocalInstance(context);
+        ISYUtilsFacade facade = SYUtilsFacadeFactory.getLocalInstance(context);
+        //获取请求结果
+        TaskInfo taskInfo = null;
+
+        String paramData = (String) map.get("paramData");
+        MessageResult messageResult = null;
+        try {
+            Map<String, Object> config = facade.getConfig();
+            String url = config.get("ip") + URLConfigEnum.PENSIONDOWNLOADFEEDBACK_VALUE;
+            JSONObject paramMap = JSONUtil.parseObj(paramData);
+            //获取传入任务id
+            String preTaskId = (String) paramMap.get("parent_taskid");
+            String initIds = (String) paramMap.get("initIds");
+            //获取本次的数据id
+            String taxIDS = initIds;
+            StringBuilder sel = new StringBuilder();
+            sel.append(" select tax.fid,stpr.FCARDNUMBER from ");
+            sel.append(" T_HR_STAXCALINITDETAIL tax ");
+            sel.append(" left join T_HR_STaxPersonRecord stpr on stpr.FPERSONID=tax.FPERSONID ");
+            sel.append(" left join T_HR_STaxPersonRecordEntry stpre on stpre.FBILLID =stpr.fid ");
+            sel.append(" where tax.FTAXUNITID=stpre.FTAXUNITID ");
+            sel.append(" and tax.fid in (" + taxIDS + ")");
+            IRowSet rs = DbUtil.executeQuery(context, sel.toString());
+            Map<String, String> card_idMap = Maps.newHashMap();
+
+            while (rs.next()) {
+                String id = rs.getString("fid");
+                String card = rs.getString("FCARDNUMBER");
+                card_idMap.put(card, id);
+            }
+
+            SelectorItemCollection sc = new SelectorItemCollection();
+            sc.add(new SelectorItemInfo("id"));
+            sc.add(new SelectorItemInfo("url"));
+            sc.add(new SelectorItemInfo("requestId"));
+            sc.add(new SelectorItemInfo("requestType"));
+            sc.add(new SelectorItemInfo("requestParam.id"));
+            sc.add(new SelectorItemInfo("requestParam.paramContent"));
+            sc.add(new SelectorItemInfo("requestResult.id"));
+            sc.add(new SelectorItemInfo("requestResult.resultContent"));
+            sc.add(new SelectorItemInfo("requestState"));
+            sc.add(new SelectorItemInfo("state"));
+            sc.add(new SelectorItemInfo("name"));
+            sc.add(new SelectorItemInfo("osfServiceName"));
+            sc.add(new SelectorItemInfo("number"));
+            sc.add(new SelectorItemInfo("taskPre.id"));
+            sc.add(new SelectorItemInfo("taskPre.state"));
+            sc.add(new SelectorItemInfo("taskPre.requestState"));
+            taskInfo = iTask.getTaskInfo(new ObjectUuidPK(preTaskId), sc);
+            int pageNo = 1;
+            int pageSize = 4999;
+            boolean next = false;
+            StringBuilder updateljgrylj = new StringBuilder();
+            updateljgrylj.append("update T_HR_STAXCALINITDETAIL set T46 =? where fid=?");
+            List<String[]> list = Lists.newArrayList();
+
+            String result = facade.get(url, paramData);
+            JSONObject resultMap = JSONUtil.parseObj(result);
+            JSONObject head = resultMap.getJSONObject("head");
+            JSONArray body = resultMap.getJSONArray("body");
+            String code = head.getStr("code");
+            if ("00000000".equals(code)) {
+                for(int j =0; j<body.size();j++) {
+                    JSONObject bod = body.getJSONObject(j);
+                    JSONArray ljjg = bod.getJSONArray("ljjg");
+                    //遍历明细数据
+                    for (int i = 0; i < ljjg.size(); i++) {
+                        JSONObject sfn = ljjg.getJSONObject(i);
+                        String zzhm = sfn.getStr("zzhm");
+                        String ljgrylj = sfn.getStr("ljgrylj");
+                        String[] par = new String[2];
+                        par[0] = card_idMap.get(zzhm);
+                        par[1] = ljgrylj;
+                        list.add(par);
+                    }
+                }
+                DbUtil.executeBatch(context, updateljgrylj.toString(), list);
+                messageResult = MessageResult.SUCCESS(result);
+            } else if ("00000004".equals(head.getStr("code"))) {
+                messageResult = MessageResult.AGAIN();
+            } else {
+                messageResult = MessageResult.FAILED(result);
+            }
+
+        } catch (Exception e) {
+            e.printStackTrace();
+            messageResult = MessageResult.ERROR(ExceptionUtils.getStackTrace(e));
+        }
+        return messageResult;
+    }
+
+    /**
+     * 查询项目
+     *
+     * @param context
+     * @param number
+     * @return
+     */
+    protected String getFieldByNumber(Context context, String number) {
+        String sql = "select ('T'||FIELDSN) fieldName,fname_L2 from T_HR_STaxItem where FSIMPLENAME=?";
+        try {
+            IRowSet rs = DbUtil.executeQuery(context, sql, new String[]{number});
+            if (rs.next()) {
+                return rs.getString("fieldName");
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
+}

+ 51 - 0
websrc/com/kingdee/eas/custom/shuiyou/six/osf/GetPensionDownloadService.java

@@ -0,0 +1,51 @@
+package com.kingdee.eas.custom.shuiyou.six.osf;
+
+import cn.hutool.json.JSONObject;
+import cn.hutool.json.JSONUtil;
+import com.kingdee.bos.BOSException;
+import com.kingdee.bos.Context;
+import com.kingdee.bos.bsf.service.app.IHRMsfService;
+import com.kingdee.eas.common.EASBizException;
+import com.kingdee.eas.custom.shuiyou.task.MessageResult;
+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.uitls.URLConfigEnum;
+
+import java.util.Map;
+
+/**
+ * ÑøÀϽðÏÂÔØ
+ * description: DownloadService <br>
+ * date: 2024/9/12 17:01 <br>
+ * author: lhbj <br>
+ * version: 1.0 <br>
+ */
+public class GetPensionDownloadService implements IHRMsfService {
+    @Override
+    public Object process(Context context, Map map) throws EASBizException, BOSException {
+        String this_taskid= (String) map.get("this_taskId");
+        String param= (String) map.get("paramData");
+        ISYUtilsFacade facade = SYUtilsFacadeFactory.getLocalInstance(context);
+        Map<String,String> config =facade.getConfig();
+        String result = facade.post(config.get("ip")+ URLConfigEnum.PENSIONDOWNLOAD_VALUE, param);
+        MessageResult msgr = null;
+        if(null!=result) {
+            JSONObject object = JSONUtil.parseObj(result);
+            JSONObject head = object.getJSONObject("head");
+            if("00000000".equals(head.getStr("code"))) {
+                JSONObject body = object.getJSONObject("body");
+                body.set("parent_taskid",this_taskid);
+                String taskId = facade.addTask("getPensionDownloadFeedback",JSONUtil.toJsonStr(body), TaskCatalogEnum.PERSON_GET,null);
+                msgr = MessageResult.SUCCESS(taskId);
+            }else if("00000004".equals(head.getStr("code")))  {
+                msgr = MessageResult.AGAIN();
+            }else {
+                msgr = MessageResult.FAILED(result);
+            }
+        }else{
+            msgr = MessageResult.ERROR(result);
+        }
+        return msgr;
+    }
+}

+ 110 - 3
websrc/com/kingdee/eas/custom/shuiyou/six/osf/GetPreDeductConfirmFeedBack.java

@@ -1,16 +1,31 @@
 package com.kingdee.eas.custom.shuiyou.six.osf;
 
+import cn.hutool.json.JSONArray;
+import cn.hutool.json.JSONObject;
 import cn.hutool.json.JSONUtil;
+import com.google.common.collect.Lists;
 import com.kingdee.bos.BOSException;
 import com.kingdee.bos.Context;
 import com.kingdee.bos.bsf.service.app.IHRMsfService;
+import com.kingdee.bos.dao.ormapping.ObjectUuidPK;
+import com.kingdee.bos.metadata.entity.SelectorItemCollection;
+import com.kingdee.bos.metadata.entity.SelectorItemInfo;
+import com.kingdee.bos.util.BOSUuid;
 import com.kingdee.eas.common.EASBizException;
 
+import com.kingdee.eas.custom.shuiyou.task.*;
+import com.kingdee.eas.custom.shuiyou.uitls.ISYUtilsFacade;
+import com.kingdee.eas.custom.shuiyou.uitls.SYUtilsFacadeFactory;
+import com.kingdee.eas.custom.shuiyou.uitls.URLConfigEnum;
+import com.kingdee.eas.util.app.DbUtil;
+import com.kingdee.shr.dydeploy.web.executeSql.ExceptionUtils;
 import org.apache.log4j.Logger;
 
+import java.util.List;
 import java.util.Map;
 
 /**
+ * 諶壺靡等�'毀嚏
  * description: GetPreDeductConfirmFeedBack <br>
  * date: 2024/8/29 15:02 <br>
  * author: lhbj <br>
@@ -20,9 +35,101 @@ public class GetPreDeductConfirmFeedBack implements IHRMsfService {
     private static final Logger LOG = Logger.getLogger(GetPreDeductConfirmFeedBack.class);
     @Override
     public Object process(Context context, Map map) throws EASBizException, BOSException {
-        String json = JSONUtil.toJsonStr(map);
-        LOG.error(json);
 
-        return json;
+        ITask iTask = TaskFactory.getLocalInstance(context);
+        ISYUtilsFacade facade = SYUtilsFacadeFactory.getLocalInstance(context);
+        //鳳龰ワА賦彆
+        TaskInfo taskInfo=null;
+
+        String paramData = (String) map.get("paramData");
+        MessageResult messageResult=null;
+        try {
+            Map<String, Object> config = facade.getConfig();
+            String url = config.get("ip") + URLConfigEnum.GETPREDEDUCTCONFIRMFEEDBACK_VALUE;
+            JSONObject paramMap = JSONUtil.parseObj(paramData);
+            //鳳龰換⻌¦昢id
+            String preTaskId = (String) paramMap.get("parent_taskid");
+
+            SelectorItemCollection sc = new SelectorItemCollection();
+            sc.add(new SelectorItemInfo("id"));
+            sc.add(new SelectorItemInfo("url"));
+            sc.add(new SelectorItemInfo("requestId"));
+            sc.add(new SelectorItemInfo("requestType"));
+            sc.add(new SelectorItemInfo("requestParam.id"));
+            sc.add(new SelectorItemInfo("requestParam.paramContent"));
+            sc.add(new SelectorItemInfo("requestResult.id"));
+            sc.add(new SelectorItemInfo("requestResult.resultContent"));
+            sc.add(new SelectorItemInfo("requestState"));
+            sc.add(new SelectorItemInfo("state"));
+            sc.add(new SelectorItemInfo("name"));
+            sc.add(new SelectorItemInfo("osfServiceName"));
+            sc.add(new SelectorItemInfo("number"));
+            sc.add(new SelectorItemInfo("taskPre.id"));
+            sc.add(new SelectorItemInfo("taskPre.state"));
+            sc.add(new SelectorItemInfo("taskPre.requestState"));
+            taskInfo = iTask.getTaskInfo(new ObjectUuidPK(preTaskId),sc);
+
+            String result = facade.get(url,paramData);
+            JSONObject resultMap = JSONUtil.parseObj(result);
+            JSONObject head = resultMap.getJSONObject("head");
+            JSONObject body = resultMap.getJSONObject("body");
+            String code = head.getStr("code");
+            if ("00000000".equals(code)) {
+                TaskRequestParamInfo requestParamInfo = taskInfo.getRequestParam();
+                String paramCon = requestParamInfo.getParamContent();
+                JSONObject json = JSONUtil.parseObj(paramCon);
+                JSONArray kczglb=json.getJSONArray("kczglb");
+                List<String[]> listUp = Lists.newArrayList();
+                StringBuilder sqler = new StringBuilder();
+                sqler.append(" update T_HR_STaxDirectDeduction set FSATE='20' where fid in ( ");
+                sqler.append(" select tdd.fid from T_HR_STaxDirectDeduction tdd ");
+                sqler.append(" left join T_HR_STaxPersonRecordEntry tpre on tpre.fid=tdd.FTAXPERSONRECORDENTRYID ");
+                sqler.append(" left join T_HR_STaxPersonRecord tpr on tpr.fid=tpre.FBILLID ");
+                sqler.append(" left join T_HR_STaxUnitDeduction tud on tud.fid=tdd.FTAXUNITDEDUCTIONID ");
+                sqler.append(" where tpre.fid is not null and tud.FTAXUNITID = tpre.FTAXUNITID and tpr.FCARDNUMBER=?)");
+                for(int i=0;i<kczglb.size();i++){
+                    JSONObject kczgl = kczglb.getJSONObject(i);
+                    String zzhm = kczgl.getStr("zzhm");
+                    String[] param = new String[1];
+                    param[0]=zzhm;
+                    listUp.add(param);
+                }
+                if (!listUp.isEmpty()) {
+                    DbUtil.executeBatch(context, sqler.toString(), listUp);
+                }
+                JSONArray jsonArray = body.getJSONArray("kcqrsblb");
+                List<String[]> list = Lists.newArrayList();
+                for(int i=0;i<jsonArray.size();i++){
+
+                    JSONObject obj = jsonArray.getJSONObject(i);
+                    String zzhm = obj.getStr("zzhm");
+                    String sbyy = obj.getStr("sbyy");
+                    String[] param = new String[2];
+                    param[0]=(sbyy);
+                    param[1]=(zzhm);
+                    list.add(param);
+                }
+
+                StringBuilder sql = new StringBuilder();
+                sql.append(" update T_HR_STaxDirectDeduction set FSATE='30',FERRORMSG_L2=? where fid in ( ");
+                sql.append(" select tdd.fid from T_HR_STaxDirectDeduction tdd ");
+                sql.append(" left join T_HR_STaxPersonRecordEntry tpre on tpre.fid=tdd.FTAXPERSONRECORDENTRYID ");
+                sql.append(" left join T_HR_STaxPersonRecord tpr on tpr.fid=tpre.FBILLID ");
+                sql.append(" left join T_HR_STaxUnitDeduction tud on tud.fid=tdd.FTAXUNITDEDUCTIONID ");
+                sql.append(" where tpre.fid is not null and tud.FTAXUNITID = tpre.FTAXUNITID and tpr.FCARDNUMBER=?)");
+                if (!list.isEmpty()) {
+                    DbUtil.executeBatch(context, sql.toString(), list);
+                }
+                messageResult=MessageResult.SUCCESS(result);
+            }else if("00000004".equals(head.getStr("code")))  {
+                messageResult = MessageResult.AGAIN();
+            }else {
+                messageResult = MessageResult.FAILED(result);
+            }
+        }catch (Exception e){
+            e.printStackTrace();
+            messageResult = MessageResult.ERROR(ExceptionUtils.getStackTrace(e));
+        }
+        return messageResult;
     }
 }

+ 52 - 0
websrc/com/kingdee/eas/custom/shuiyou/six/osf/GetPreDeductConfirmService.java

@@ -0,0 +1,52 @@
+package com.kingdee.eas.custom.shuiyou.six.osf;
+
+import cn.hutool.json.JSONObject;
+import cn.hutool.json.JSONUtil;
+import com.kingdee.bos.BOSException;
+import com.kingdee.bos.Context;
+import com.kingdee.bos.bsf.service.app.IHRMsfService;
+import com.kingdee.eas.common.EASBizException;
+import com.kingdee.eas.custom.shuiyou.task.MessageResult;
+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.uitls.URLConfigEnum;
+
+
+import java.util.Map;
+
+/**
+ * ¿Û³ýÃûµ¥È·ÈÏ
+ * description: GetPreDeductConfirmService <br>
+ * date: 2024/9/11 11:44 <br>
+ * author: lhbj <br>
+ * version: 1.0 <br>
+ */
+public class GetPreDeductConfirmService  implements IHRMsfService {
+    @Override
+    public Object process(Context context, Map map) throws EASBizException, BOSException {
+        String this_taskid= (String) map.get("this_taskId");
+        String param= (String) map.get("paramData");
+        ISYUtilsFacade facade = SYUtilsFacadeFactory.getLocalInstance(context);
+        Map<String,String> config =facade.getConfig();
+        String result = facade.post(config.get("ip")+URLConfigEnum.CONFIRMPREDEDUCT_VALUE, param);
+        MessageResult msgr = null;
+        if(null!=result) {
+            JSONObject object = JSONUtil.parseObj(result);
+            JSONObject head = object.getJSONObject("head");
+            if("00000000".equals(head.getStr("code"))) {
+                JSONObject body = object.getJSONObject("body");
+                body.set("parent_taskid",this_taskid);
+                String taskId = facade.addTask("getPreDeductConfirmFeedBack",JSONUtil.toJsonStr(body), TaskCatalogEnum.COLLECTION_CONFIRM_GET,null);
+                msgr = MessageResult.SUCCESS(taskId);
+            }else if("00000004".equals(head.getStr("code")))  {
+                msgr = MessageResult.AGAIN();
+            }else{
+                msgr = MessageResult.FAILED(result);
+            }
+        }else{
+            msgr = MessageResult.ERROR(result);
+        }
+        return msgr;
+    }
+}

+ 85 - 51
websrc/com/kingdee/eas/custom/shuiyou/six/osf/GetQuerySpecialAmountFeedback.java

@@ -8,16 +8,15 @@ import com.google.common.collect.Maps;
 import com.kingdee.bos.BOSException;
 import com.kingdee.bos.Context;
 import com.kingdee.bos.bsf.service.app.IHRMsfService;
-import com.kingdee.bos.dao.ormapping.ObjectUuidPK;
-import com.kingdee.bos.metadata.entity.EntityViewInfo;
 import com.kingdee.bos.metadata.entity.SelectorItemCollection;
 import com.kingdee.bos.metadata.entity.SelectorItemInfo;
 import com.kingdee.bos.rabbitmq.guava.Lists;
+import com.kingdee.bos.util.BOSUuid;
 import com.kingdee.eas.common.EASBizException;
-import com.kingdee.eas.custom.shuiyou.task.ITask;
-import com.kingdee.eas.custom.shuiyou.task.TaskCollection;
-import com.kingdee.eas.custom.shuiyou.task.TaskFactory;
-import com.kingdee.eas.custom.shuiyou.task.TaskInfo;
+import com.kingdee.eas.custom.shuiyou.task.*;
+import com.kingdee.eas.custom.shuiyou.uitls.ISYUtilsFacade;
+import com.kingdee.eas.custom.shuiyou.uitls.SYUtilsFacadeFactory;
+import com.kingdee.eas.custom.shuiyou.uitls.URLConfigEnum;
 import com.kingdee.eas.util.app.DbUtil;
 import com.kingdee.jdbc.rowset.IRowSet;
 
@@ -25,66 +24,101 @@ import java.util.List;
 import java.util.Map;
 
 /**
+ * 人员专项附加扣除金额查询结果反馈
  * description: GetQuerySpecialAmountFeedback <br>
  * date: 2024/9/9 16:03 <br>
  * author: lhbj <br>
  * version: 1.0 <br>
  */
 public class GetQuerySpecialAmountFeedback implements IHRMsfService {
+
     @Override
     public Object process(Context context, Map map) throws EASBizException, BOSException {
-        //获取请求结果
-        String result = (String) map.get("result");
-        //获取请求参数
-        String paramData = (String) map.get("paramData");
-        JSONObject paramMap = JSONUtil.parseObj(paramData);
-        //获取传入任务id
-        String preTaskId = paramMap.getStr("preTaskId");
-        String skssq = paramMap.getStr("skssq");
         SelectorItemCollection sc = new SelectorItemCollection();
-        sc.add(new SelectorItemInfo("id"));
-        sc.add(new SelectorItemInfo("url"));
-        sc.add(new SelectorItemInfo("requestId"));
-        sc.add(new SelectorItemInfo("requestType"));
-        sc.add(new SelectorItemInfo("requestParam.id"));
-        sc.add(new SelectorItemInfo("requestParam.paramContent"));
+        sc.add(new SelectorItemInfo("state"));
         ITask iTask = TaskFactory.getLocalInstance(context);
-        TaskInfo taskInfo = iTask.getTaskInfo(new ObjectUuidPK(preTaskId),sc);
-        JSONObject paramContent = JSONUtil.parseObj(taskInfo.getRequestParam().getParamContent());
-        String taxPersonRecordEntryIDS = paramContent.getStr("taxPersonRecordEntryIDS");
+        ISYUtilsFacade facade = SYUtilsFacadeFactory.getLocalInstance(context);
+        //获取请求结果
+        TaskInfo taskInfo=new TaskInfo();
 
-        JSONObject resultMap = JSONUtil.parseObj(result);
-        JSONObject head = resultMap.getJSONObject("head");
-        JSONObject body = resultMap.getJSONObject("body");
-        String code = head.getStr("code");
-        if("00000000".equals(code)){
-            Map<String,List<String>> sql_param = Maps.newHashMap();
-            JSONArray ryxxlb = body.getJSONArray("ryxxlb");
-            for(int i=0;i<ryxxlb.size();i++){
-                JSONObject ryxx = ryxxlb.getJSONObject(i);
-                StringBuilder sql = new StringBuilder();
-                sql.append("update T_HR_STAXCALINITDETAIL set ");
-                List<String> paramList = Lists.newArrayList();
-                for(Map.Entry<String,Object> entry : ryxx.entrySet()){
-                    String key =entry.getKey();
-                    Object value =entry.getValue();
-                    String field = this.getFieldByNumber(context,key);
-                    if(StrUtil.isNotBlank(field)) {
-                        paramList.add(StrUtil.toString(value));
-                        sql.append(field+"=?,");
-                    }
-                }
+        String paramData = (String) map.get("paramData");
+        MessageResult messageResult=null;
+        try {
+            JSONObject paramMap = JSONUtil.parseObj(paramData);
+            //获取传入任务id
+            String preTaskId = (String) paramMap.get("parent_taskid");
+            taskInfo.setId(BOSUuid.read(preTaskId));
+            taskInfo.setState(TaskStateEnum.FINISHED);
+            String initIds = (String) paramMap.get("initIds");
 
-                String zzhm = ryxx.getStr("zzhm");
-                sql=sql.delete(sql.length()-1,sql.length());
+            Map<String, Object> config = facade.getConfig();
+            String url = config.get("ip") + URLConfigEnum.QUERYPREDEDUCT_VALUE;
+            String result = facade.get(url,paramData);
+            //获取本次的数据id
+            String taxIDS =initIds;
+            StringBuilder sel = new StringBuilder();
+            sel.append(" select tax.fid,stpr.FCARDNUMBER from ");
+            sel.append(" T_HR_STAXCALINITDETAIL tax ");
+            sel.append(" left join T_HR_STaxPersonRecord stpr on stpr.FPERSONID=tax.FPERSONID ");
+            sel.append(" left join T_HR_STaxPersonRecordEntry stpre on stpre.FBILLID =stpr.fid ");
+            sel.append(" where tax.FTAXUNITID=stpre.FTAXUNITID ");
+            sel.append(" and tax.fid in (" + taxIDS + ")");
+            IRowSet rs = DbUtil.executeQuery(context, sel.toString());
+            Map<String,String> card_idMap=Maps.newHashMap();
 
-                //select * from T_BD_Person where FIDCARDNO=''
-                sql.append(" where ");
-                sql_param.put(sql.toString(),paramList);
+            while (rs.next()) {
+                String id = rs.getString("fid");
+                String card = rs.getString("FCARDNUMBER");
+                card_idMap.put(card,id);
             }
-        }
+            JSONObject resultMap = JSONUtil.parseObj(result);
+            JSONObject head = resultMap.getJSONObject("head");
+            JSONObject body = resultMap.getJSONObject("body");
+            String code = head.getStr("code");
+            if ("00000000".equals(code)) {
+                Map<String, List<String>> sql_param = Maps.newHashMap();
+                JSONArray ryxxlb = body.getJSONArray("ryxxlb");
+                for (int i = 0; i < ryxxlb.size(); i++) {
+                    JSONObject ryxx = ryxxlb.getJSONObject(i);
+                    StringBuilder sql = new StringBuilder();
+                    sql.append("update T_HR_STAXCALINITDETAIL set ");
+                    List<String> paramList = Lists.newArrayList();
+                    for (Map.Entry<String, Object> entry : ryxx.entrySet()) {
+                        String key = entry.getKey();
+                        Object value = entry.getValue();
+                        String field = this.getFieldByNumber(context, key);
+                        if (StrUtil.isNotBlank(field)) {
+                            paramList.add(StrUtil.toString(value));
+                            sql.append(field + "=?,");
+                        }
+                    }
 
-        return null;
+                    String zzhm = ryxx.getStr("zzhm");
+                    sql = sql.delete(sql.length() - 1, sql.length());
+                    sql.append(" where fid =?");
+                    paramList.add(card_idMap.get(zzhm));
+                    sql_param.put(sql.toString(), paramList);
+                }
+                for(Map.Entry<String,List<String>> entry : sql_param.entrySet()){
+                    String sql = entry.getKey();
+                    List<String> list = entry.getValue();
+                    DbUtil.execute(context,sql,list.toArray());
+                }
+                messageResult = MessageResult.SUCCESS(result);
+            }else if("00000004".equals(head.getStr("code")))  {
+                messageResult = MessageResult.AGAIN();
+            }else {
+                messageResult = MessageResult.FAILED();
+            }
+
+        }catch (Exception e){
+            e.printStackTrace();
+            taskInfo.setState(TaskStateEnum.FAIDED);
+            messageResult = MessageResult.ERROR(e.getMessage());
+        }finally {
+            iTask.updatePartial(taskInfo, sc);
+        }
+        return messageResult;
     }
 
     protected String getFieldByNumber(Context context,String number){

+ 1 - 1
websrc/com/kingdee/eas/custom/shuiyou/service/PensionInfoService.java → websrc/com/kingdee/eas/custom/shuiyou/six/osf/PensionInfoService.java

@@ -1,4 +1,4 @@
-package com.kingdee.eas.custom.shuiyou.service;
+package com.kingdee.eas.custom.shuiyou.six.osf;
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;

+ 110 - 0
websrc/com/kingdee/eas/custom/shuiyou/six/osf/PersonnelReportService.java

@@ -0,0 +1,110 @@
+package com.kingdee.eas.custom.shuiyou.six.osf;
+
+import cn.hutool.json.JSONArray;
+import cn.hutool.json.JSONObject;
+import cn.hutool.json.JSONUtil;
+
+import com.kingdee.bos.BOSException;
+import com.kingdee.bos.Context;
+import com.kingdee.bos.bsf.service.app.IHRMsfService;
+import com.kingdee.bos.metadata.entity.SelectorItemCollection;
+import com.kingdee.bos.metadata.entity.SelectorItemInfo;
+import com.kingdee.eas.common.EASBizException;
+import com.kingdee.eas.custom.shuiyou.task.MessageResult;
+import com.kingdee.eas.custom.shuiyou.uitls.ISYUtilsFacade;
+import com.kingdee.eas.custom.shuiyou.uitls.SYUtilsFacadeFactory;
+import com.kingdee.shr.compensation.BankCardStatusEnum;
+import com.kingdee.shr.compensation.IdentityStatusEnume;
+import com.kingdee.shr.compensation.SubmitStatusEnum;
+import com.kingdee.shr.compensation.app.incomeTax.ITaxPersonRecordEntry;
+import com.kingdee.shr.compensation.app.incomeTax.TaxPersonRecordEntryFactory;
+import com.kingdee.shr.compensation.app.incomeTax.TaxPersonRecordEntryInfo;
+import com.kingdee.shr.compensation.app.incomeTax.TaxPersonRecordInfo;
+import com.kingdee.shr.dydeploy.web.executeSql.ExceptionUtils;
+import org.apache.log4j.Logger;
+import java.util.Map;
+
+
+/**
+ * 人员报送反馈接口
+ */
+public class PersonnelReportService implements IHRMsfService {
+    private static Logger logger = Logger.getLogger("com.kingdee.eas.custom.shuiyou.service.PersonnelReportService");
+    @Override
+    public Object process(Context context, Map map) throws EASBizException, BOSException {
+        logger.error("com.kingdee.eas.custom.shuiyou.service.PersonnelReportService.process");
+        MessageResult messageResult=null;
+        String paramData = (String) map.get("paramData");
+        System.out.println("PersonnelReportService:"+paramData);
+        ISYUtilsFacade facade = SYUtilsFacadeFactory.getLocalInstance(context);
+        Map<String,String> config = facade.getConfig();
+        String url = config.get("ip")+"/gateway/iit/declare/getEmployeeInfoFeedback";
+        String result=null;
+        try {
+
+            result = facade.get(url, paramData);
+            if (result == null) {
+                messageResult = MessageResult.ERROR("参数result为空");
+            } else {
+                JSONObject jsonObject = JSONUtil.parseObj(result);
+                logger.error("入参:" + jsonObject);
+                JSONObject head = jsonObject.getJSONObject("head");
+
+                String code =head.getStr("code");
+                if ("00000000".equals(code)){
+                    JSONObject body = jsonObject.getJSONObject("body");
+                    if(body.containsKey("bsjg")) {
+                        JSONArray bsjgs = body.getJSONArray("bsjg");
+                        SelectorItemCollection sc = new SelectorItemCollection();
+                        sc.add(new SelectorItemInfo("identityStatus"));
+                        sc.add(new SelectorItemInfo("submitStatus"));
+                        sc.add(new SelectorItemInfo("failReason"));
+                        sc.add(new SelectorItemInfo("failReason"));
+                        sc.add(new SelectorItemInfo("bill.bankCardStatus"));
+                        for (int b = 0; b < bsjgs.size(); b++) {
+                            JSONObject bsjg = bsjgs.getJSONObject(b);
+                            String zzhm = bsjg.getStr("zzhm");
+                            ITaxPersonRecordEntry tyse = TaxPersonRecordEntryFactory.getLocalInstance(context);
+                            TaxPersonRecordEntryInfo taxPersonRecordEntry = tyse.getTaxPersonRecordEntryInfo("select * , bill.* where bill.cardnumber = '" + zzhm + "'");
+                            String sbzt = bsjg.getStr("sbzt");//报送状态 1	待报送 2	代报中 3	代报失败 4	代报成功
+                            taxPersonRecordEntry.setSubmitStatus(StartReflection(sbzt));
+                            String rzzt = bsjg.getStr("rzzt");//验证状态0	若是身份证,状态为验证中;其他证件为暂不验证 1	验证通过 2	验证不通过 4	待验证 9	同代码0处理
+                            taxPersonRecordEntry.setIdentityStatus(IdentityStatusEnume.getEnum(("4".compareTo(rzzt) < 0 ? "0" : rzzt)));
+                            //bsjg.getString("sfyjd");//是否建档
+                            String sbyy = bsjg.getStr("sbyy");//失败原因
+                            taxPersonRecordEntry.setFailReason(sbyy);
+                            String yhkzhzt = bsjg.getStr("yhkzhzt");//银行卡账号状态
+                            TaxPersonRecordInfo taxPersonRecord = taxPersonRecordEntry.getBill();
+                            taxPersonRecord.setBankCardStatus(BankCardStatusEnum.getEnum(("1".equals(yhkzhzt) ? "2" : "3")));
+                            tyse.updatePartial(taxPersonRecordEntry, sc);
+                        }
+                        messageResult = MessageResult.SUCCESS(result);
+                    }else {
+                        messageResult = MessageResult.FAILED(result);
+                    }
+                }else if("00000004".equals(head.getStr("code")))  {
+                    messageResult = MessageResult.AGAIN();
+                }else {
+                    messageResult = MessageResult.FAILED(result);
+                }
+            }
+        }catch (Exception e){
+            e.printStackTrace();
+            messageResult = MessageResult.ERROR(ExceptionUtils.getStackTrace(e)+result);
+        }
+        return messageResult;
+    }
+    public SubmitStatusEnum StartReflection(String start){
+        switch (start){
+            case "1":
+                return SubmitStatusEnum.NotSubmit;
+            case "2":
+                return SubmitStatusEnum.Submiting;
+            case "3":
+                return SubmitStatusEnum.SubmitFail;
+            case "4":
+                return SubmitStatusEnum.HaveSubmit;
+        }
+        return null;
+    }
+}

+ 26 - 20
websrc/com/kingdee/eas/custom/shuiyou/six/osf/QuerySpecialAmountService.java

@@ -1,14 +1,16 @@
 package com.kingdee.eas.custom.shuiyou.six.osf;
 
+
 import cn.hutool.json.JSONObject;
 import cn.hutool.json.JSONUtil;
 import com.kingdee.bos.BOSException;
 import com.kingdee.bos.Context;
 import com.kingdee.bos.bsf.service.app.IHRMsfService;
 import com.kingdee.eas.common.EASBizException;
+import com.kingdee.eas.custom.shuiyou.vo.SpecialAmountInfo;
+import com.kingdee.eas.custom.shuiyou.task.MessageResult;
 import com.kingdee.eas.custom.shuiyou.task.TaskCatalogEnum;
 import com.kingdee.eas.custom.shuiyou.uitls.ISYUtilsFacade;
-import com.kingdee.eas.custom.shuiyou.uitls.SYUtilsFacade;
 import com.kingdee.eas.custom.shuiyou.uitls.SYUtilsFacadeFactory;
 import com.kingdee.eas.custom.shuiyou.uitls.URLConfigEnum;
 import org.apache.log4j.Logger;
@@ -25,28 +27,32 @@ import java.util.Map;
 public class QuerySpecialAmountService implements IHRMsfService {
 
     private static final Logger LOG = Logger.getLogger(GetPreDeductConfirmFeedBack.class);
+
     @Override
     public Object process(Context ctx, Map map) throws EASBizException, BOSException {
-        String result = (String) map.get("result");
-        String taskId = (String) map.get("taskId");
-        String paramData = (String) map.get("paramData");
-        JSONObject paramMap = JSONUtil.parseObj(paramData);
-        JSONObject resultMap = JSONUtil.parseObj(result);
-        JSONObject head = resultMap.getJSONObject("head");
-        JSONObject body = resultMap.getJSONObject("body");
-        String requestId = body.getStr("requestId");
-        body.set("skssq",paramMap.get("skssq"));
-        body.set("preTaskId",paramMap.get("taskId"));
-        String code = head.getStr("code");
-        String json = JSONUtil.toJsonStr(map);
+        String this_taskid= (String) map.get("this_taskId");
+        String param= (String) map.get("paramData");
         ISYUtilsFacade facade = SYUtilsFacadeFactory.getLocalInstance(ctx);
-        Map<String,Object> config = facade.getConfig();
-
-        if("00000000".equals(code)){
-            String rest = facade.backTask(config.get("ip")+ URLConfigEnum.GETQUERYSPECIALAMOUNTFEEDBACK_VALUE, requestId,"getQuerySpecialAmountFeedback", JSONUtil.toJsonStr(body), TaskCatalogEnum.TAXSPEADDDEDREPORT_GET);
+        Map<String, Object> config = facade.getConfig();
+        String url = config.get("ip") + URLConfigEnum.QUERYPREDEDUCT_VALUE;
+        String result = facade.post(url, param);
+        JSONObject jsonObject = JSONUtil.parseObj(result);
+        JSONObject head = jsonObject.getJSONObject("head");
+        String code = head.getStr("code");
+        String msg = head.getStr("msg");
+        JSONObject body = jsonObject.getJSONObject("body");
+        SpecialAmountInfo info = JSONUtil.toBean(param,SpecialAmountInfo.class);
+        MessageResult msgr = null;
+        if ("00000000".equals(code)) {
+            body.set("initIds", info.getTaxPersonRecordEntryIDS());
+            body.set("parent_taskid", this_taskid);
+            String tastId = facade.addTask("getQuerySpecialAmountFeedback", JSONUtil.toJsonStr(body), TaskCatalogEnum.GETTRIAGREEMENT_GET, null);
+            msgr = MessageResult.AWAIT_W();
+        }else if("00000004".equals(head.getStr("code")))  {
+            msgr = MessageResult.AGAIN();
+        }else{
+            msgr = MessageResult.FAILED(msg);
         }
-        LOG.error(json);
-
-        return json;
+        return msgr;
     }
 }

+ 1 - 2
websrc/com/kingdee/eas/custom/shuiyou/six/osf/SixtyThousandConfirmService.java

@@ -5,7 +5,7 @@ import com.kingdee.bos.BOSException;
 import com.kingdee.bos.Context;
 import com.kingdee.eas.base.permission.UserInfo;
 import com.kingdee.eas.custom.shuiyou.interfacelog.LogInfoInfo;
-import com.kingdee.eas.custom.shuiyou.six.osf.vo.SixTConfirmInfo;
+import com.kingdee.eas.custom.shuiyou.vo.SixTConfirmInfo;
 
 
 import com.kingdee.eas.custom.shuiyou.uitls.ISYUtilsFacade;
@@ -16,7 +16,6 @@ import java.io.FileInputStream;
 import java.io.IOException;
 import java.sql.Timestamp;
 import java.util.Date;
-import java.util.Map;
 import java.util.Optional;
 import java.util.Properties;