|
@@ -15,7 +15,6 @@ import com.google.gson.Gson;
|
|
|
import com.google.gson.reflect.TypeToken;
|
|
|
import com.kingdee.bos.BOSException;
|
|
|
import com.kingdee.bos.Context;
|
|
|
-import com.kingdee.bos.dao.ormapping.ObjectUuidPK;
|
|
|
import com.kingdee.bos.dao.ormapping.impl.ImplUtils;
|
|
|
import com.kingdee.bos.metadata.entity.*;
|
|
|
import com.kingdee.bos.metadata.query.util.CompareType;
|
|
@@ -98,92 +97,92 @@ public class IncomeTaxDeclareListHandlerEx extends IncomeTaxDeclareListHandler {
|
|
|
Context ctx = SHRContext.getInstance().getContext();
|
|
|
try {
|
|
|
boolean isHaveTaxService = CmpTaxUtil.isHaveTaxService(ctx);
|
|
|
- if (!isHaveTaxService) {
|
|
|
- throw new ShrWebBizException(EASResource.getString("com.kingdee.shr.compensation.resource.CommonResource", "label136", ctx.getLocale()));
|
|
|
- } else {
|
|
|
- String selectedId = request.getParameter("selectedId");
|
|
|
- Map<String, Object> resultMap = new HashMap();
|
|
|
- Map<String, Object> declareData = this.getDeclareData(ctx, selectedId);
|
|
|
- Map<String, Object> paramMap = new HashMap();
|
|
|
- paramMap.put("declaData", declareData.get("WATI_TO_DECLARE"));
|
|
|
- LOG.error("paramMap-----------" + paramMap);
|
|
|
- try {
|
|
|
- //纳税单位
|
|
|
- List<String> advanceDeclareInfo = (List) declareData.get("advanceDeclareInfo");
|
|
|
- LOG.error("advanceDeclareInfo------------" + advanceDeclareInfo);
|
|
|
- if (!advanceDeclareInfo.isEmpty()) {
|
|
|
- throw new ShrWebBizException(this.combineError(advanceDeclareInfo));
|
|
|
- }
|
|
|
- //个税审批 审批状态=审批通过的数据
|
|
|
- List<IncomeTaxDeclarInfo> waitToDeclareList = (List) paramMap.get("declaData");
|
|
|
- if (waitToDeclareList.size() <= 0) {
|
|
|
- resultMap.put("success", false);
|
|
|
- resultMap.put("excel", "");
|
|
|
- resultMap.put("hasErrData", true);
|
|
|
- resultMap.put("hasCheckDataErr", true);
|
|
|
- resultMap.put("info", "不可重复声申报!!");
|
|
|
- JSONUtils.SUCCESS(resultMap);
|
|
|
- return;
|
|
|
- }
|
|
|
- //检查纳税申报数据
|
|
|
- Map<String, Object> checkResultMap = this.checkTaxDeclareData(ctx, request, waitToDeclareList);
|
|
|
- Boolean hasErr = (Boolean) checkResultMap.get("hasErrData");
|
|
|
- if (hasErr != null && hasErr) {
|
|
|
- resultMap.put("success", false);
|
|
|
- resultMap.put("excel", checkResultMap.get("excel"));
|
|
|
- resultMap.put("hasErrData", true);
|
|
|
- resultMap.put("hasCheckDataErr", true);
|
|
|
- resultMap.put("info", "");
|
|
|
- JSONUtils.SUCCESS(resultMap);
|
|
|
- return;
|
|
|
- }
|
|
|
- String errMsg = this.checkTaxCalStatus(ctx, waitToDeclareList);
|
|
|
- if (null != errMsg) {
|
|
|
- resultMap.put("success", false);
|
|
|
- resultMap.put("dataError", true);
|
|
|
- resultMap.put("errMsg", errMsg);
|
|
|
- JSONUtils.SUCCESS(resultMap);
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- checkResultMap = this.checkIncomeTaxIssue(ctx, waitToDeclareList);
|
|
|
- if (checkResultMap != null) {
|
|
|
- checkResultMap.put("success", false);
|
|
|
- JSONUtils.SUCCESS(checkResultMap);
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- //errMsg = this.checkReductionItems(ctx, waitToDeclareList);
|
|
|
- //if (null != errMsg) {
|
|
|
- // resultMap.put("success", false);
|
|
|
- // resultMap.put("reductionError", true);
|
|
|
- // resultMap.put("errMsg", errMsg);
|
|
|
- // JSONUtils.SUCCESS(resultMap);
|
|
|
- // return;
|
|
|
- //}
|
|
|
-
|
|
|
- //Map<String, Object> taxDeclareResult = IncomeTaxDeclareFacadeFactory.getLocalInstance(ctx).taxDeclare(paramMap);
|
|
|
- //调佣税友纳税申报
|
|
|
- Map<String, Object> taxDeclareResult = callShuiYouTaxDeclare(paramMap);
|
|
|
- Boolean isSuccess = (Boolean) taxDeclareResult.get("success");
|
|
|
- resultMap.put("success", isSuccess);
|
|
|
- resultMap.put("excel", "");
|
|
|
- resultMap.put("hasErrData", !isSuccess);
|
|
|
- resultMap.put("hasCheckDataErr", false);
|
|
|
- resultMap.put("info", declareData.get("info"));
|
|
|
- } catch (Exception var17) {
|
|
|
- var17.printStackTrace();
|
|
|
- LOG.error(var17.getMessage(), var17);
|
|
|
+ //if (!isHaveTaxService) {
|
|
|
+ // throw new ShrWebBizException(EASResource.getString("com.kingdee.shr.compensation.resource.CommonResource", "label136", ctx.getLocale()));
|
|
|
+ //} else {
|
|
|
+ String selectedId = request.getParameter("selectedId");
|
|
|
+ Map<String, Object> resultMap = new HashMap();
|
|
|
+ Map<String, Object> declareData = this.getDeclareData(ctx, selectedId);
|
|
|
+ Map<String, Object> paramMap = new HashMap();
|
|
|
+ paramMap.put("declaData", declareData.get("WATI_TO_DECLARE"));
|
|
|
+ LOG.error("paramMap-----------" + paramMap);
|
|
|
+ try {
|
|
|
+ //纳税单位
|
|
|
+ List<String> advanceDeclareInfo = (List) declareData.get("advanceDeclareInfo");
|
|
|
+ LOG.error("advanceDeclareInfo------------" + advanceDeclareInfo);
|
|
|
+ if (!advanceDeclareInfo.isEmpty()) {
|
|
|
+ throw new ShrWebBizException(this.combineError(advanceDeclareInfo));
|
|
|
+ }
|
|
|
+ //个税审批 审批状态=审批通过的数据
|
|
|
+ List<IncomeTaxDeclarInfo> waitToDeclareList = (List) paramMap.get("declaData");
|
|
|
+ if (waitToDeclareList.size() <= 0) {
|
|
|
resultMap.put("success", false);
|
|
|
resultMap.put("excel", "");
|
|
|
resultMap.put("hasErrData", true);
|
|
|
- resultMap.put("hasCheckDataErr", false);
|
|
|
- resultMap.put("info", declareData.get("info"));
|
|
|
- resultMap.put("errorMsg", var17.getMessage());
|
|
|
+ resultMap.put("hasCheckDataErr", true);
|
|
|
+ resultMap.put("info", "不可重复声申报!!");
|
|
|
+ JSONUtils.SUCCESS(resultMap);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ //检查纳税申报数据
|
|
|
+ Map<String, Object> checkResultMap = this.checkTaxDeclareData(ctx, request, waitToDeclareList);
|
|
|
+ Boolean hasErr = (Boolean) checkResultMap.get("hasErrData");
|
|
|
+ if (hasErr != null && hasErr) {
|
|
|
+ resultMap.put("success", false);
|
|
|
+ resultMap.put("excel", checkResultMap.get("excel"));
|
|
|
+ resultMap.put("hasErrData", true);
|
|
|
+ resultMap.put("hasCheckDataErr", true);
|
|
|
+ resultMap.put("info", "");
|
|
|
+ JSONUtils.SUCCESS(resultMap);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ String errMsg = this.checkTaxCalStatus(ctx, waitToDeclareList);
|
|
|
+ if (null != errMsg) {
|
|
|
+ resultMap.put("success", false);
|
|
|
+ resultMap.put("dataError", true);
|
|
|
+ resultMap.put("errMsg", errMsg);
|
|
|
+ JSONUtils.SUCCESS(resultMap);
|
|
|
+ return;
|
|
|
}
|
|
|
- LOG.error("taxDeclareAction-----------end-----------");
|
|
|
- JSONUtils.SUCCESS(resultMap);
|
|
|
+
|
|
|
+ checkResultMap = this.checkIncomeTaxIssue(ctx, waitToDeclareList);
|
|
|
+ if (checkResultMap != null) {
|
|
|
+ checkResultMap.put("success", false);
|
|
|
+ JSONUtils.SUCCESS(checkResultMap);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ //errMsg = this.checkReductionItems(ctx, waitToDeclareList);
|
|
|
+ //if (null != errMsg) {
|
|
|
+ // resultMap.put("success", false);
|
|
|
+ // resultMap.put("reductionError", true);
|
|
|
+ // resultMap.put("errMsg", errMsg);
|
|
|
+ // JSONUtils.SUCCESS(resultMap);
|
|
|
+ // return;
|
|
|
+ //}
|
|
|
+
|
|
|
+ //Map<String, Object> taxDeclareResult = IncomeTaxDeclareFacadeFactory.getLocalInstance(ctx).taxDeclare(paramMap);
|
|
|
+ //调佣税友纳税申报
|
|
|
+ Map<String, Object> taxDeclareResult = callShuiYouTaxDeclare(paramMap);
|
|
|
+ Boolean isSuccess = (Boolean) taxDeclareResult.get("success");
|
|
|
+ resultMap.put("success", isSuccess);
|
|
|
+ resultMap.put("excel", "");
|
|
|
+ resultMap.put("hasErrData", !isSuccess);
|
|
|
+ resultMap.put("hasCheckDataErr", false);
|
|
|
+ resultMap.put("info", declareData.get("info"));
|
|
|
+ } catch (Exception var17) {
|
|
|
+ var17.printStackTrace();
|
|
|
+ LOG.error(var17.getMessage(), var17);
|
|
|
+ resultMap.put("success", false);
|
|
|
+ resultMap.put("excel", "");
|
|
|
+ resultMap.put("hasErrData", true);
|
|
|
+ resultMap.put("hasCheckDataErr", false);
|
|
|
+ resultMap.put("info", declareData.get("info"));
|
|
|
+ resultMap.put("errorMsg", var17.getMessage());
|
|
|
}
|
|
|
+ LOG.error("taxDeclareAction-----------end-----------");
|
|
|
+ JSONUtils.SUCCESS(resultMap);
|
|
|
+ //}
|
|
|
} catch (JsonProcessingException e) {
|
|
|
e.printStackTrace();
|
|
|
throw new RuntimeException(e);
|
|
@@ -930,363 +929,4 @@ public class IncomeTaxDeclareListHandlerEx extends IncomeTaxDeclareListHandler {
|
|
|
resultMap.put("WATI_TO_DECLARE", waitToDeclareList);
|
|
|
return resultMap;
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- private void updateOrCancel(HttpServletRequest request, HttpServletResponse response, TaskCatalogEnum catalog)
|
|
|
- throws SHRWebException {
|
|
|
- Context ctx = SHRContext.getInstance().getContext();
|
|
|
- String selectedId = request.getParameter("selectedId");
|
|
|
- String oql = "select id, tbType, yearMonth, yearMonthDate, taxUnit.id, taxUnit.name, taxUnit.areaCode, taxUnit.taxNumber, taxUnit.regNumber, taxUnit.declPassword, taxUnit.realPassword, acceptId where id = '"
|
|
|
- + selectedId + "'";
|
|
|
-
|
|
|
- try {
|
|
|
- IncomeTaxDeclarCollection collection = IncomeTaxDeclarFactory.getLocalInstance(ctx)
|
|
|
- .getIncomeTaxDeclarCollection(oql);
|
|
|
- if (null != collection && collection.size() != 0) {
|
|
|
- IncomeTaxDeclarInfo incomeTaxDeclare = collection.get(0);
|
|
|
- if (TaskCatalogEnum.TaxDeclareUpdate == catalog) {
|
|
|
- //更新
|
|
|
- updateDeclare(ctx,incomeTaxDeclare);
|
|
|
- } else {
|
|
|
- //更新以外的
|
|
|
- if (TaskCatalogEnum.CancelTaxDeclare != catalog) {
|
|
|
- //撤销更正
|
|
|
- System.out.print("撤销更正找到方法");
|
|
|
- cancelUpdate( ctx ,incomeTaxDeclare);
|
|
|
- return;
|
|
|
- }
|
|
|
- //撤销申报
|
|
|
- System.out.print("作废申报找到方法");
|
|
|
- cancelDeclare(ctx,incomeTaxDeclare);
|
|
|
- System.out.print("作废申报完成");
|
|
|
- }
|
|
|
-
|
|
|
- String templateId = "4i4AAAAS76+Vh943";
|
|
|
- String columnSQL = "select t.fieldsn, f.FPROPNAME,f.fname_l2,f.fcustomfield from T_BS_SHRFileTemplateFields f left join t_HR_sTaxItem t on f.FPROPNAME = t.FNUMBER where f.fcmpimporttempid = '"
|
|
|
- + templateId + "' order by f.fsortsn ";
|
|
|
- IRowSet columnSet = DbUtil.executeQuery(ctx, columnSQL);
|
|
|
- StringBuilder tmpSQL = new StringBuilder();
|
|
|
- tmpSQL.append("select ");
|
|
|
- String dynamicFieldPrefix = "t";
|
|
|
- String local = SHRContext.getInstance().getContext().getLocale().getDisplayLanguage();
|
|
|
- int columnSize = columnSet.size();
|
|
|
-
|
|
|
- while (columnSet.next()) {
|
|
|
- int index = columnSet.getInt(1);
|
|
|
- String propName = columnSet.getString(2);
|
|
|
- int isCustom = columnSet.getInt(4);
|
|
|
- if (isCustom == 1 && index > 0) {
|
|
|
- tmpSQL.append(dynamicFieldPrefix).append(index).append(",");
|
|
|
- } else if (propName.endsWith("_")) {
|
|
|
- tmpSQL.append(propName).append(local).append(",");
|
|
|
- } else {
|
|
|
- tmpSQL.append(propName).append(",");
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- String sql = tmpSQL.substring(0, tmpSQL.length() - 1);
|
|
|
- Date date = incomeTaxDeclare.getYearMonthDate();
|
|
|
- String taxUnitId = incomeTaxDeclare.getTaxUnit().getId().toString();
|
|
|
- TbTypeEnum tbType = incomeTaxDeclare.getTbType();
|
|
|
- String personType = CmpConstants.getPayerTypeByTbType(tbType.getValue());
|
|
|
- String dataSQL = sql
|
|
|
- + " from t_hr_sTaxCalConfigDetail t left join T_BD_Person person on t.fPersonId = person.fid left join T_HR_STaxPersonRecord taxPersonRec on t.fPersonId = taxPersonRec.fPersonId left join T_HR_TaxUnit taxUnit on t.fTaxUnitId = taxUnit.fid left join T_HR_STaxIncomeItem item on t.fIncomeItemId = item.fid left join T_HR_STaxPersonRecordEntry pEntry on taxPersonRec.fid = pEntry.fBillId where t.fPeriodBegin = "
|
|
|
- + CmpDateUtil.toKSqlDate(date) + " and t.fTaxUnitId = '" + taxUnitId
|
|
|
- + "' and pEntry.fTaxUnitId = '" + taxUnitId + "' and pEntry.fPayerType = '" + personType
|
|
|
- + "'";
|
|
|
- IRowSet dataSet = DbUtil.executeQuery(ctx, dataSQL);
|
|
|
- List<List<Object>> dataList = new ArrayList();
|
|
|
- IRowSetMetaData metaData = dataSet.getRowSetMetaData();
|
|
|
-
|
|
|
- for (int rowIndex = 1; dataSet.next(); ++rowIndex) {
|
|
|
- List<Object> row = new ArrayList();
|
|
|
- row.add(rowIndex);
|
|
|
-
|
|
|
- for (int i = 1; i <= columnSize; ++i) {
|
|
|
- int dataType = metaData.getColumnType(i);
|
|
|
- row.add(ImplUtils.getDataFromDr(dataType, dataSet, i));
|
|
|
- }
|
|
|
-
|
|
|
- dataList.add(row);
|
|
|
- }
|
|
|
-
|
|
|
- String template = request.getSession().getServletContext().getRealPath("/")
|
|
|
- + "addon/compensation/web/resource/incomeTaxSbbExportTemplate.xlsx";
|
|
|
- String taxUnitName = incomeTaxDeclare.getTaxUnit().getName();
|
|
|
- String tbTypeName = incomeTaxDeclare.getTbType().getAlias();
|
|
|
- String period = TaxCalcFileUtils.getCnPeriod1(incomeTaxDeclare.getYearMonthDate());
|
|
|
- String timestamp = TaxCalcFileUtils.getTimestamp(new Date());
|
|
|
- String userTempDirAbsolutePath = UserUtil.getUserTempDirAbsolutePath(request.getSession());
|
|
|
- userTempDirAbsolutePath = userTempDirAbsolutePath + "/exportExcel";
|
|
|
- File dir = new File(userTempDirAbsolutePath);
|
|
|
- if (!dir.exists()) {
|
|
|
- dir.mkdirs();
|
|
|
- }
|
|
|
-
|
|
|
- String fileName = "个税申报表_" + taxUnitName + "_" + tbTypeName + "_" + period + "_" + timestamp
|
|
|
- + ".xlsx";
|
|
|
- String path = dir.getAbsolutePath() + File.separator + fileName;
|
|
|
- Map<String, String> params = new HashMap();
|
|
|
- params.put("startAndEnd", TaxCalcFileUtils.getCnPeriod2(incomeTaxDeclare.getYearMonthDate()));
|
|
|
- params.put("taxUnitName", taxUnitName);
|
|
|
- params.put("taxUnitNumber", incomeTaxDeclare.getTaxUnit().getTaxNumber());
|
|
|
- CmpExcelUtil.writeData2Template(dataList, template, 8, path, params);
|
|
|
- String headerStr = "attachment;filename=" + URLEncoder.encode(fileName, "utf-8");
|
|
|
- response.setHeader("Content-disposition", headerStr);
|
|
|
- response.getOutputStream().write(TaxCalcFileUtils.file2ByteArray(new File(path)));
|
|
|
- response.getOutputStream().flush();
|
|
|
- return;
|
|
|
- } else {
|
|
|
- throw new SHRWebException("没有找到申报记录");
|
|
|
- }
|
|
|
- } catch (Exception var37) {
|
|
|
- LOG.error("updateDeclareAction error: ", var37);
|
|
|
- throw new SHRWebException(var37.getMessage());
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- protected Map cancelUpdate(Context ctx, IncomeTaxDeclarInfo taxDeclare) throws BOSException {
|
|
|
- try {
|
|
|
- String sql = "select t.fAccept_id as acceptId from t_hr_sIncomeTaxDeclar d left join t_hr_sTaskIncomeTaxRelation r on d.fid = r.fBizId left join t_hr_sTaxCalTask t on r.fTaskId = t.fid where d.fid = '"
|
|
|
- + taxDeclare.getId().toString() + "' and t.fCatalog = " + 120;
|
|
|
- IRowSet rowSet = DbUtil.executeQuery(ctx, sql);
|
|
|
- if (rowSet.size() == 0) {
|
|
|
- throw new BOSException("找不到更正申报任务受理id");
|
|
|
- } else {
|
|
|
- while (rowSet.next()) {
|
|
|
- taxDeclare.setAcceptId(rowSet.getString("acceptId"));
|
|
|
- }
|
|
|
-
|
|
|
- return updateOrCancel(ctx, taxDeclare, TaskCatalogEnum.CancelTaxUpdate);
|
|
|
- }
|
|
|
- } catch (SQLException var5) {
|
|
|
- LOG.error("_cancelUpdate error: ", var5);
|
|
|
- throw new BOSException(var5.getMessage());
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- private Map updateOrCancel(Context ctx, IncomeTaxDeclarInfo taxDeclare, TaskCatalogEnum catalog)
|
|
|
- throws BOSException {
|
|
|
- JSONObject param = new JSONObject();
|
|
|
- String billId = StringUtils.cnulls(taxDeclare.getId());
|
|
|
- param.put("taxDeclarId", billId);
|
|
|
- param.put("taxDeclarBatchNo", StringUtils.cnulls(taxDeclare.getBatchNo()) );
|
|
|
- Map<String, Object> paramMap = new HashMap();
|
|
|
- DeclareCancelRequest requestObj = new DeclareCancelRequest();
|
|
|
- TaxUnitInfo taxUnit = taxDeclare.getTaxUnit();
|
|
|
- /// bizNo 外部业务编号 String(64) 是 外部业务编号,唯一,幂等需要,最长64位,建议使用UUID
|
|
|
- String bizNo = UUID.randomUUID().toString();
|
|
|
- paramMap.put("bizNo" , bizNo);
|
|
|
- requestObj.setBizNo(bizNo);
|
|
|
- //qymc 企业名称 String(64) 是 代报企业全称
|
|
|
- System.out.print("企业名称为:"+taxUnit.getName());
|
|
|
- paramMap.put("qymc" , taxUnit.getName() );
|
|
|
- requestObj.setName(taxUnit.getName());
|
|
|
- //djxhid 登记序号 String(64) 条件必填 存在多个登记序号时,需要指定传入一个.例:10117440105249764755
|
|
|
- paramMap.put("djxhid" , taxUnit.getRegNumber());
|
|
|
- requestObj.setRegistrationNumber(taxUnit.getRegNumber());
|
|
|
- //nsrsbh 税号 String(64) 是 扣缴单位纳税人识别号
|
|
|
- paramMap.put("nsrsbh" , taxUnit.getTaxNumber());
|
|
|
- requestObj.setTaxNo(taxUnit.getTaxNumber());
|
|
|
- //areaid 地区编号 String(64) 是 6位行政区划代码,精确到市级,例如:440100,参考省市区编码
|
|
|
- paramMap.put("areaid" , taxUnit.getAreaCode());
|
|
|
- requestObj.setArea(taxUnit.getAreaCode());
|
|
|
- //bmbh 部门编号 String(64) 条件必填 分部门代报时必传
|
|
|
- //bmmc 部门名称 String(64) 否
|
|
|
- //skssq 所属期 String(64) 是 格式YYYYMM。为空时, 根据任职受雇日期判断:
|
|
|
- String period = taxDeclare.getYearMonth();
|
|
|
- period = period.contains("-") ? period.replace("-", "") : period;
|
|
|
- period = period.substring(0, 6);
|
|
|
- requestObj.setMonth(period);
|
|
|
- paramMap.put("skssq" , period);
|
|
|
- //sblx 申报类型 String(64) 必填 1:综合所得;2:分类所得;3:非居民所得;4:限售股所得
|
|
|
- paramMap.put("sblx" , "1");
|
|
|
- requestObj.setDeclarationType("1");
|
|
|
- //sfqksd 是否清空所得数据 String(64) 否 0:不清空 1 清空, 默认为0, 作废申报的同时清空数据
|
|
|
- requestObj.setCancelImportDataOption("0");
|
|
|
- //jmsmmm 加密实名密码 String(64) 否 默认不传则设置为0,0表示不加密;1表示加密
|
|
|
- paramMap.put("jmsbmm" , "0");
|
|
|
- requestObj.setEncryptedRealNamePassword("0");
|
|
|
- if (!StringUtils.isEmpty(taxUnit.getRealPassword())) {
|
|
|
- //mmlx 密码类型 String(64) 否 默认不传则设置为0, 0表示申报密码;2表示实名账号实名密码
|
|
|
- paramMap.put("mmlx" , "2");
|
|
|
- requestObj.setPasswordType("2");
|
|
|
- //smzh 实名账号 String(64) 条件必填 当mmlx=2时,必填。
|
|
|
- paramMap.put("smzh", false);
|
|
|
- requestObj.setRealNameAccount("");
|
|
|
- //smmm 实名密码 String(64) 条件必填 当mmlx=2时,必填
|
|
|
- paramMap.put("smmm", Base64Utils.decode(taxUnit.getRealPassword()));
|
|
|
- requestObj.setRealNamePassword(Base64Utils.decode(taxUnit.getRealPassword()));
|
|
|
- }
|
|
|
- if (!StringUtils.isEmpty(taxUnit.getDeclPassword())) {
|
|
|
- //sbmm 申报密码 String(64) 条件必填 当mmlx=0时,必填
|
|
|
- paramMap.put("sbmm", Base64Utils.decode(taxUnit.getDeclPassword()));
|
|
|
- requestObj.setDeclarePassword(Base64Utils.decode(taxUnit.getDeclPassword()));
|
|
|
- //mmlx 密码类型 String(64) 否 默认不传则设置为0, 0表示申报密码;2表示实名账号实名密码
|
|
|
- paramMap.put("mmlx" , "0");
|
|
|
- requestObj.setPasswordType("0");
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- //客户端代理工厂
|
|
|
- try {
|
|
|
- ClientProxyFactory clientProxyFactory = ClientProxyFactoryUtils.getClientProxyFactory();
|
|
|
- //算税请求接口
|
|
|
- DeclarationRequest declarationRequest = clientProxyFactory.getDeclarationRequest();
|
|
|
- //获取请求参数
|
|
|
- if( catalog.equals(TaskCatalogEnum.CancelTaxDeclare) ) {
|
|
|
-// Gson gson = new Gson();
|
|
|
-// Type personType = new TypeToken<DeclareCancelRequest>(){}.getType();
|
|
|
-// DeclareCancelRequest newObj = gson.fromJson(gson.toJson(requestObj), personType);
|
|
|
- LOG.error("撤销申报执行参数:"+mapper.writeValueAsString(requestObj));
|
|
|
- //CancelTaxDeclare 作废申报 140
|
|
|
- ApiResponse<AsyncResult> apiResponse = declarationRequest.cancel (requestObj);
|
|
|
- LOG.error("撤销申报执行结果"+apiResponse.getHead().getMsg());
|
|
|
- if (apiResponse.getHead().getCode().equals("00000000")) {
|
|
|
- AsyncResult body = apiResponse.getBody();
|
|
|
- String requestId = body.getRequestId();
|
|
|
- LOG.error("requestId-----" + requestId);
|
|
|
- ISYUtilsFacade isyUtilsFacade = SYUtilsFacadeFactory.getLocalInstance(ctx);
|
|
|
- //backTask(url,requestId,回调osf服务,自定义参数,任务类型)
|
|
|
- JSONObject json = new JSONObject();
|
|
|
- json.put("requestId", requestId);
|
|
|
- json.put("reportType", "1");
|
|
|
-//
|
|
|
-// JSONObject paramJson = new JSONObject();
|
|
|
-// paramJson.put("taxDeclarId", taxDeclare.getId().toString());
|
|
|
-// paramJson.put("taxDeclarBatchNo", taxDeclare.getBatchNo());
|
|
|
- json.put("param", param );
|
|
|
- LOG.error("撤销申报执行调用后台开始"+param);
|
|
|
- isyUtilsFacade.addTask("CancelDeclareService", json.toJSONString(), TaskCatalogEnum.CancelTaxDeclare, "");
|
|
|
- LOG.error("撤销申报执行调用后台完成");
|
|
|
- }
|
|
|
- }else if(catalog.equals(TaskCatalogEnum.TaxDeclareUpdate)) {
|
|
|
- //更正申报 120
|
|
|
-// Gson gson = new Gson();
|
|
|
-// Type personType = new TypeToken<DeclareCorrectRequest>(){}.getType();
|
|
|
-// DeclareCorrectRequest newObj = gson.fromJson(gson.toJson(paramMap), personType);
|
|
|
- ObjectMapper mapper = new ObjectMapper();
|
|
|
- DeclareCorrectRequest newObj = mapper.convertValue(paramMap, DeclareCorrectRequest.class);
|
|
|
- LOG.error("更正申报执行参数:"+mapper.writeValueAsString(newObj));
|
|
|
- ApiResponse<AsyncResult> apiResponse = declarationRequest.correct (newObj);
|
|
|
- LOG.error("更正申报执行结果"+apiResponse.getHead().getMsg());
|
|
|
- if (apiResponse.getHead().getCode().equals("00000000")) {
|
|
|
- //同步接口;
|
|
|
- //个税申报批次号
|
|
|
- String taxDeclarBatchNo = taxDeclare.getBatchNo();
|
|
|
- IIncomeTaxDeclar iIncomeTaxDeclar = IncomeTaxDeclarFactory.getLocalInstance(ctx);
|
|
|
- IncomeTaxDeclarInfo incomeTaxDeclarInfo = iIncomeTaxDeclar.getIncomeTaxDeclarInfo(new ObjectUuidPK(billId));
|
|
|
- SelectorItemCollection updateSic = new SelectorItemCollection();
|
|
|
- updateSic.add("declareStatus");
|
|
|
- if (null != incomeTaxDeclarInfo) {
|
|
|
- incomeTaxDeclarInfo.setDeclareStatus(TaxDeclareStatusEnum.DECLARE_NO);
|
|
|
- iIncomeTaxDeclar.updatePartial(incomeTaxDeclarInfo, updateSic);
|
|
|
- }
|
|
|
- }
|
|
|
- }else if(catalog.equals(TaskCatalogEnum.CancelTaxUpdate )) {
|
|
|
- System.out.print("撤销更正执行");
|
|
|
- //撤销更正申报
|
|
|
-// Gson gson = new Gson();
|
|
|
-// Type personType = new TypeToken<DeclareCorrectRequest>(){}.getType();
|
|
|
-// DeclareCorrectRequest newObj = gson.fromJson(gson.toJson(paramMap), personType);
|
|
|
- ObjectMapper mapper = new ObjectMapper();
|
|
|
- DeclareCorrectRequest convertValue = mapper.convertValue(paramMap, DeclareCorrectRequest.class);
|
|
|
- LOG.error("撤销更正执行参数:"+mapper.writeValueAsString(convertValue));
|
|
|
- ApiResponse<AsyncResult> apiResponse = declarationRequest.cancelCorrect (convertValue);
|
|
|
- LOG.error("撤销更正执行结果"+apiResponse.getHead().getMsg());
|
|
|
- if (apiResponse.getHead().getCode().equals("00000000")) {
|
|
|
- //同步接口;
|
|
|
- //个税申报批次号
|
|
|
- String taxDeclarBatchNo = taxDeclare.getBatchNo();
|
|
|
- IIncomeTaxDeclar iIncomeTaxDeclar = IncomeTaxDeclarFactory.getLocalInstance(ctx);
|
|
|
-// IncomeTaxDeclarCollection incomeTaxDeclarCollection = iIncomeTaxDeclar.getIncomeTaxDeclarCollection("where batchNo = '" + taxDeclarBatchNo + "'");
|
|
|
- IncomeTaxDeclarInfo incomeTaxDeclarInfo = iIncomeTaxDeclar.getIncomeTaxDeclarInfo(new ObjectUuidPK(billId));
|
|
|
- SelectorItemCollection updateSic = new SelectorItemCollection();
|
|
|
- updateSic.add("declareStatus");
|
|
|
- if (null != incomeTaxDeclarInfo) {
|
|
|
-// IncomeTaxDeclarInfo incomeTaxDeclarInfo = incomeTaxDeclarCollection.get(0);
|
|
|
- incomeTaxDeclarInfo.setDeclareStatus(TaxDeclareStatusEnum.DECLARE_SUCCESS);
|
|
|
- iIncomeTaxDeclar.updatePartial(incomeTaxDeclarInfo, updateSic);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- } catch (IOException e) {
|
|
|
- e.printStackTrace();
|
|
|
- } catch (EASBizException e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
- return paramMap;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- /**
|
|
|
- * 撤销申请
|
|
|
- * @param ctx
|
|
|
- * @param taxDeclare
|
|
|
- * @return
|
|
|
- * @throws BOSException
|
|
|
- */
|
|
|
- protected Map cancelDeclare(Context ctx, IncomeTaxDeclarInfo taxDeclare) throws BOSException {
|
|
|
- return this.updateOrCancel(ctx, taxDeclare, TaskCatalogEnum.CancelTaxDeclare);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- /**
|
|
|
- * 更正
|
|
|
- * @param ctx
|
|
|
- * @param taxDeclare
|
|
|
- * @return
|
|
|
- * @throws BOSException
|
|
|
- */
|
|
|
- protected Map updateDeclare(Context ctx, IncomeTaxDeclarInfo taxDeclare) throws BOSException {
|
|
|
- return updateOrCancel(ctx, taxDeclare, TaskCatalogEnum.TaxDeclareUpdate);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- /**
|
|
|
- * 撤销申报
|
|
|
- *
|
|
|
- */
|
|
|
- public void cancelDeclareAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap)
|
|
|
- throws SHRWebException {
|
|
|
- this.updateOrCancel(request, response, TaskCatalogEnum.CancelTaxDeclare);
|
|
|
- request.setAttribute(CmpConstants.CMP_LOG_OPERATE, "cancelDeclare");
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 更正申请
|
|
|
- */
|
|
|
- public void updateDeclareAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap)
|
|
|
- throws SHRWebException {
|
|
|
- this.updateOrCancel(request, response, TaskCatalogEnum.TaxDeclareUpdate);
|
|
|
- request.setAttribute(CmpConstants.CMP_LOG_OPERATE, "updateDeclare");
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 撤销更正
|
|
|
- *
|
|
|
- */
|
|
|
- public void cancelUpdateAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap)
|
|
|
- throws SHRWebException {
|
|
|
- this.updateOrCancel(request, response, TaskCatalogEnum.CancelTaxUpdate);
|
|
|
- request.setAttribute(CmpConstants.CMP_LOG_OPERATE, "cancelUpdate");
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
}
|