|
@@ -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("生成项附加扣除申报服务时,未获取到对应的纳税单位数据,请联系管理员检查数据是否被删除");
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-}
|