|
@@ -1,6 +1,7 @@
|
|
|
package com.kingdee.eas.custom.shuiyou.incomeTax;
|
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
+import cn.hutool.json.JSONObject;
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
import com.kingdee.bos.dao.IObjectPK;
|
|
|
import com.kingdee.bos.dao.ormapping.ObjectUuidPK;
|
|
@@ -12,11 +13,11 @@ 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.MessageResult;
|
|
|
+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.custom.shuiyou.uitls.URLConfigEnum;
|
|
|
import com.kingdee.eas.framework.CoreBaseCollection;
|
|
|
import com.kingdee.eas.util.app.DbUtil;
|
|
|
import com.kingdee.jdbc.rowset.IRowSet;
|
|
@@ -35,10 +36,9 @@ import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
|
import java.lang.String;
|
|
|
|
|
|
-public class TaxSpeAddDedReportExFacadeControllerBean extends AbstractTaxSpeAddDedReportExFacadeControllerBean
|
|
|
-{
|
|
|
+public class TaxSpeAddDedReportExFacadeControllerBean extends AbstractTaxSpeAddDedReportExFacadeControllerBean {
|
|
|
private static Logger logger =
|
|
|
- Logger.getLogger("com.kingdee.eas.custom.shuiyou.incomeTax.TaxSpeAddDedReportExFacadeControllerBean");
|
|
|
+ Logger.getLogger("com.kingdee.eas.custom.shuiyou.incomeTax.TaxSpeAddDedReportExFacadeControllerBean");
|
|
|
|
|
|
private static final long serialVersionUID = 1L;
|
|
|
|
|
@@ -58,29 +58,29 @@ public class TaxSpeAddDedReportExFacadeControllerBean extends AbstractTaxSpeAddD
|
|
|
return !paramMap.containsKey("TaxPersonRecordEntryIDS");
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
@Override
|
|
|
- protected MessageResult _report(Context ctx, Map paramMap) throws BOSException {
|
|
|
+ protected String _report(Context ctx, Map paramMap) throws BOSException {
|
|
|
|
|
|
- logger.error("_report:"+paramMap);
|
|
|
+ logger.error("_report:" + paramMap);
|
|
|
if (this.checkParams(paramMap)) {
|
|
|
throw new BOSException("专项附加扣除申报服务参数缺失,请检查参数");
|
|
|
} else {
|
|
|
- //前置任务
|
|
|
- String RELAYTASK = (String)paramMap.get("RELAYTASK");
|
|
|
- String taxUnitID = (String)paramMap.get("TAXUNITID");
|
|
|
- String initIds = (String)paramMap.get("initIds");
|
|
|
- String period = (String)paramMap.get("PERIOD");
|
|
|
- String taxPersonRecordEntryIDS = (String)paramMap.get("TaxPersonRecordEntryIDS");
|
|
|
+ String RELAYTASK = (String) paramMap.get("RELAYTASK");
|
|
|
+ String taxUnitID = (String) paramMap.get("TAXUNITID");
|
|
|
+ String initIds = (String) paramMap.get("initIds");
|
|
|
+ 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 + "'");
|
|
|
- logger.error("taxUnitCollection:"+taxUnitCollection);
|
|
|
+ logger.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 {
|
|
|
- logger.error("period:"+period);
|
|
|
+ logger.error("period:" + period);
|
|
|
period = period.replace("-", "");
|
|
|
int periodYear = Integer.parseInt(period.substring(0, 4));
|
|
|
int periodMonth = Integer.parseInt(period.substring(4, 6));
|
|
@@ -144,14 +144,14 @@ public class TaxSpeAddDedReportExFacadeControllerBean extends AbstractTaxSpeAddD
|
|
|
ArrayList updateParamList = new ArrayList();
|
|
|
ISYUtilsFacade facade = SYUtilsFacadeFactory.getLocalInstance(ctx);
|
|
|
try {
|
|
|
- logger.error("_report:"+checkSQL);
|
|
|
+ logger.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) {
|
|
|
+ while (true) {
|
|
|
+ while (true) {
|
|
|
if (!rowSet.next()) {
|
|
|
if (rylb.isEmpty()) {
|
|
|
return null;
|
|
@@ -189,33 +189,31 @@ public class TaxSpeAddDedReportExFacadeControllerBean extends AbstractTaxSpeAddD
|
|
|
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")+ URLConfigEnum.QUERYPREDEDUCT_VALUE;
|
|
|
- String result = facade.post(url, JSONUtil.toJsonStr(specialAmountInfo));
|
|
|
-// if
|
|
|
-// facade.addTask("GetQuerySpecialAmountFeedback",);
|
|
|
-// 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 MessageResult.SUCCESS();
|
|
|
+
|
|
|
+ String tastId = facade.addTask("querySpecialAmountService", JSONUtil.toJsonStr(specialAmountInfo), TaskCatalogEnum.GETTRIAGREEMENT, RELAYTASK);
|
|
|
+
|
|
|
+ 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 tastId;
|
|
|
}
|
|
|
|
|
|
String recordId = rowSet.getString("RECORDID");
|
|
@@ -286,66 +284,66 @@ public class TaxSpeAddDedReportExFacadeControllerBean extends AbstractTaxSpeAddD
|
|
|
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.setNsrzt(("1".equals(personStatus) ? PersonStatusEnum.Normal.getAlias() : PersonStatusEnum.NotNormal.getAlias()));
|
|
|
+ if (StrUtil.isNotBlank(employedType)) {
|
|
|
sixTPersonInfo.setSfgy(EmployedTypeEnum.getEnum(employedType).getAlias());
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
sixTPersonInfo.setSfgy(null);
|
|
|
}
|
|
|
- if(null!=employeddate){
|
|
|
+ if (null != employeddate) {
|
|
|
sixTPersonInfo.setRzsgrq(format.format(employeddate));
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
sixTPersonInfo.setRzsgrq(format.format(new Date()));
|
|
|
}
|
|
|
- if(null!=gender) {
|
|
|
+ if (null != gender) {
|
|
|
sixTPersonInfo.setXb(Genders.getEnum(Integer.parseInt(gender)).getAlias());
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
sixTPersonInfo.setXb(Genders.Male.getAlias());
|
|
|
}
|
|
|
|
|
|
sixTPersonInfo.setCsny(format.format(birthday));
|
|
|
|
|
|
- if(StrUtil.isNotBlank(nationality)){
|
|
|
+ if (StrUtil.isNotBlank(nationality)) {
|
|
|
sixTPersonInfo.setGj(nationality);
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
sixTPersonInfo.setGj("中国");
|
|
|
}
|
|
|
|
|
|
- sixTPersonInfo.setRydq("0".equals(isoversea)?"境内":"境外");
|
|
|
- if(null!=departuredate) {
|
|
|
+ sixTPersonInfo.setRydq("0".equals(isoversea) ? "境内" : "境外");
|
|
|
+ if (null != departuredate) {
|
|
|
sixTPersonInfo.setLzrq(format.format(departuredate));
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
sixTPersonInfo.setLzrq("");
|
|
|
}
|
|
|
|
|
|
- if(StrUtil.isNotBlank(investmenttotal)){
|
|
|
+ if (StrUtil.isNotBlank(investmenttotal)) {
|
|
|
sixTPersonInfo.setGrgbze(investmenttotal);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
sixTPersonInfo.setGrgbze(null);
|
|
|
}
|
|
|
- if(StrUtil.isNotBlank(investmentrate)){
|
|
|
+ if (StrUtil.isNotBlank(investmentrate)) {
|
|
|
sixTPersonInfo.setGrgbbl(investmentrate);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
sixTPersonInfo.setGrgbbl(null);
|
|
|
}
|
|
|
- if(StrUtil.isNotBlank(isdisability)) {
|
|
|
- sixTPersonInfo.setSfcj("0".equals(isdisability)?"否":"是");
|
|
|
- }else {
|
|
|
+ if (StrUtil.isNotBlank(isdisability)) {
|
|
|
+ sixTPersonInfo.setSfcj("0".equals(isdisability) ? "否" : "是");
|
|
|
+ } else {
|
|
|
sixTPersonInfo.setSfcj(null);
|
|
|
}
|
|
|
- if(StrUtil.isNotBlank(ishero)) {
|
|
|
- sixTPersonInfo.setSfls("0".equals(ishero)?"否":"是");
|
|
|
- }else {
|
|
|
+ if (StrUtil.isNotBlank(ishero)) {
|
|
|
+ sixTPersonInfo.setSfls("0".equals(ishero) ? "否" : "是");
|
|
|
+ } else {
|
|
|
sixTPersonInfo.setSfls(null);
|
|
|
}
|
|
|
- if(StrUtil.isNotBlank(isold)) {
|
|
|
- sixTPersonInfo.setSfgl("0".equals(isold)?"否":"是");
|
|
|
- }else {
|
|
|
+ if (StrUtil.isNotBlank(isold)) {
|
|
|
+ sixTPersonInfo.setSfgl("0".equals(isold) ? "否" : "是");
|
|
|
+ } else {
|
|
|
sixTPersonInfo.setSfgl(null);
|
|
|
}
|
|
|
- if(StrUtil.isNotBlank(deductfees)) {
|
|
|
+ if (StrUtil.isNotBlank(deductfees)) {
|
|
|
sixTPersonInfo.setSfzdw(DeductFeesEnum.getEnum(deductfees).getAlias());
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
sixTPersonInfo.setSfzdw(null);
|
|
|
}
|
|
|
|
|
@@ -353,9 +351,9 @@ public class TaxSpeAddDedReportExFacadeControllerBean extends AbstractTaxSpeAddD
|
|
|
sixTPersonInfo.setLszh(herocardnumber);
|
|
|
sixTPersonInfo.setDzyx(email);
|
|
|
sixTPersonInfo.setXl(edulevel);
|
|
|
- if(StrUtil.isNotBlank(position)) {
|
|
|
+ if (StrUtil.isNotBlank(position)) {
|
|
|
sixTPersonInfo.setZw(PositionTypeEnum.getEnum(position).getAlias());
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
sixTPersonInfo.setZw(null);
|
|
|
}
|
|
|
sixTPersonInfo.setKhyh(bankname);
|
|
@@ -374,10 +372,10 @@ public class TaxSpeAddDedReportExFacadeControllerBean extends AbstractTaxSpeAddD
|
|
|
sixTPersonInfo.setBz(null);
|
|
|
sixTPersonInfo.setCsd(birthplace);
|
|
|
sixTPersonInfo.setSssx(taxreason);
|
|
|
- if(null!=entrydate){
|
|
|
+ if (null != entrydate) {
|
|
|
sixTPersonInfo.setScrjsj(format.format(entrydate));
|
|
|
}
|
|
|
- if(null!=leavedate){
|
|
|
+ if (null != leavedate) {
|
|
|
sixTPersonInfo.setYjljsj(format.format(leavedate));
|
|
|
}
|
|
|
|
|
@@ -416,7 +414,7 @@ public class TaxSpeAddDedReportExFacadeControllerBean extends AbstractTaxSpeAddD
|
|
|
protected void _save(Context ctx, String taskID, String result) throws BOSException {
|
|
|
super._save(ctx, taskID, result);
|
|
|
Map<String, Object> bodyMap = (Map) JSONUtils.convertJsonToObject(ctx, result, Map.class);
|
|
|
- String code = (String)bodyMap.get("code");
|
|
|
+ String code = (String) bodyMap.get("code");
|
|
|
if ("00000000".equals(code)) {
|
|
|
String updateSql = "update T_HR_STAXSPEADDDEDRECORD set FSTATE = 40 where CFTaskID = '" + taskID + "'";
|
|
|
DbUtil.execute(ctx, updateSql);
|