调用实例
public static String getToken()
{
String token = "";
JSONObject object = new JSONObject();
object.put("appid", "appid");
object.put("secretkey", "secretkey");
if(null == httpClient)
{
httpClient = HttpClientBuilder.create().build();
}
HttpPost httpPost = new HttpPost("http://localhost/login");
httpPost.addHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.81 Safari/537.36");
try
{
StringEntity se = new StringEntity(object.toString());
se.setContentEncoding("UTF-8");
se.setContentType("application/x-www-form-urlencoded");
httpPost.setEntity(se);
HttpResponse response = httpClient.execute(httpPost);
JSONObject result = (JSONObject) JSONObject.parseObject(String.valueOf(response));
if(result.containsKey("token"))
{
token = result.getString("token");
}
}
catch (IOException e)
{
e.printStackTrace();
}
return token;
}
调用接口公共类
package com.landray.kmss.third.cmbchina.httpservice;
import com.alibaba.fastjson.JSONObject;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import java.io.IOException;
public class HttpPostUtil {
private static HttpClient httpClient = HttpClients.createDefault();
public static JSONObject doPost(String url, JSONObject jsonObject) {
JSONObject returnGetDataJson = new JSONObject();
HttpPost httpPost;
String resultStr = "";
if (null == httpClient) {
httpClient = HttpClientBuilder.create().build();
}
httpPost = new HttpPost(url);
try {
StringEntity se = new StringEntity(jsonObject.toString());
se.setContentEncoding("GB18030");
se.setContentType("application/json");
httpPost.setEntity(se);
HttpResponse response = httpClient.execute(httpPost);
if (response != null) {
HttpEntity resEntity = response.getEntity();
if (resEntity != null) {
resultStr = EntityUtils.toString(resEntity);
JSONObject resultJson = JSONObject.parseObject(resultStr);
if (resultJson != null && !resultJson.isEmpty()) {
if (resultJson.getBoolean("success")) {
return resultJson;
} else {
returnGetDataJson.put("success", resultJson.getBoolean("success"));
returnGetDataJson.put("message", resultJson.get("message").toString());
returnGetDataJson.put("msgCode", resultJson.get("msgCode").toString());
}
}
}
}
} catch (IOException e) {
e.printStackTrace();
returnGetDataJson.put("success", false);
returnGetDataJson.put("message", "请求接口异常");
returnGetDataJson.put("msgCode", "请求接口异常");
} catch (Exception e) {
e.printStackTrace();
returnGetDataJson.put("success", false);
returnGetDataJson.put("message", "请求接口异常");
returnGetDataJson.put("msgCode", "请求接口异常");
}
return returnGetDataJson;
}
}
接口常量定义类
package com.landray.kmss.third.cmbchina.httpservice;
public class HttpPostConstant {
public static final String GETCARDINFODATAURL = "";
public static final String GETTRANSDATAURL = "";
public static final String PARAMAP = "paraMap";
public static final String CLIENTID = "clientId";
public static final String CLIENTSECRET = "clientSecret";
public static final String CORNUM = "corNum";
public static final String POSTDATE = "postDate";
}
接口请求参数配置信息
package com.landray.kmss.third.cmbchina.service;
import com.landray.kmss.sys.metadata.interfaces.IExtendDataService;
import com.landray.kmss.third.cmbchina.model.ThirdCmbchinaParamap;
import java.util.List;
public interface IThirdCmbchinaParamapService extends IExtendDataService {
List<ThirdCmbchinaParamap> getParamapData() throws Exception;
}
package com.landray.kmss.third.cmbchina.service.spring;
import com.landray.kmss.common.actions.RequestContext;
import com.landray.kmss.common.convertor.ConvertorContext;
import com.landray.kmss.common.dao.HQLInfo;
import com.landray.kmss.common.forms.IExtendForm;
import com.landray.kmss.common.model.IBaseModel;
import com.landray.kmss.sys.metadata.interfaces.ExtendDataServiceImp;
import com.landray.kmss.sys.notify.interfaces.ISysNotifyMainCoreService;
import com.landray.kmss.third.cmbchina.model.ThirdCmbchinaParamap;
import com.landray.kmss.third.cmbchina.service.IThirdCmbchinaParamapService;
import com.landray.kmss.third.cmbchina.util.ThirdCmbchinaUtil;
import com.landray.kmss.util.SpringBeanUtil;
import java.util.List;
public class ThirdCmbchinaParamapServiceImp extends ExtendDataServiceImp implements IThirdCmbchinaParamapService {
private ISysNotifyMainCoreService sysNotifyMainCoreService;
public IBaseModel convertBizFormToModel(IExtendForm form, IBaseModel model, ConvertorContext context) throws Exception {
model = super.convertBizFormToModel(form, model, context);
if (model instanceof ThirdCmbchinaParamap) {
ThirdCmbchinaParamap thirdCmbchinaParamap = (ThirdCmbchinaParamap) model;
}
return model;
}
public IBaseModel initBizModelSetting(RequestContext requestContext) throws Exception {
ThirdCmbchinaParamap thirdCmbchinaParamap = new ThirdCmbchinaParamap();
ThirdCmbchinaUtil.initModelFromRequest(thirdCmbchinaParamap, requestContext);
return thirdCmbchinaParamap;
}
public void initCoreServiceFormSetting(IExtendForm form, IBaseModel model, RequestContext requestContext) throws Exception {
ThirdCmbchinaParamap thirdCmbchinaParamap = (ThirdCmbchinaParamap) model;
}
public ISysNotifyMainCoreService getSysNotifyMainCoreService() {
if (sysNotifyMainCoreService == null) {
sysNotifyMainCoreService = (ISysNotifyMainCoreService) SpringBeanUtil.getBean("sysNotifyMainCoreService");
}
return sysNotifyMainCoreService;
}
@Override
public List<ThirdCmbchinaParamap> getParamapData() throws Exception {
HQLInfo hqlInfo = new HQLInfo();
try {
hqlInfo.setWhereBlock("thirdCmbchinaParamap.paraMapFd1 = :paraMapFd1");
hqlInfo.setParameter("paraMapFd1", "0");
} catch (Exception e) {
e.printStackTrace();
}
return this.findList(hqlInfo);
}
}
商务卡卡片信息处理
package com.landray.kmss.third.cmbchina.service;
import com.landray.kmss.sys.metadata.interfaces.IExtendDataService;
public interface IThirdCmbchinaBusicardinfoService extends IExtendDataService {
void deleteCardInfoByCorNum(String corNum) throws Exception;
}
package com.landray.kmss.third.cmbchina.service.spring;
import com.landray.kmss.common.actions.RequestContext;
import com.landray.kmss.common.convertor.ConvertorContext;
import com.landray.kmss.common.forms.IExtendForm;
import com.landray.kmss.common.model.IBaseModel;
import com.landray.kmss.sys.metadata.interfaces.ExtendDataServiceImp;
import com.landray.kmss.sys.notify.interfaces.ISysNotifyMainCoreService;
import com.landray.kmss.third.cmbchina.model.ThirdCmbchinaBusicardinfo;
import com.landray.kmss.third.cmbchina.service.IThirdCmbchinaBusicardinfoService;
import com.landray.kmss.third.cmbchina.util.ThirdCmbchinaUtil;
import com.landray.kmss.util.SpringBeanUtil;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
public class ThirdCmbchinaBusicardinfoServiceImp extends ExtendDataServiceImp implements IThirdCmbchinaBusicardinfoService {
private ISysNotifyMainCoreService sysNotifyMainCoreService;
public IBaseModel convertBizFormToModel(IExtendForm form, IBaseModel model, ConvertorContext context) throws Exception {
model = super.convertBizFormToModel(form, model, context);
if (model instanceof ThirdCmbchinaBusicardinfo) {
ThirdCmbchinaBusicardinfo thirdCmbchinaBusicardinfo = (ThirdCmbchinaBusicardinfo) model;
}
return model;
}
public IBaseModel initBizModelSetting(RequestContext requestContext) throws Exception {
ThirdCmbchinaBusicardinfo thirdCmbchinaBusicardinfo = new ThirdCmbchinaBusicardinfo();
ThirdCmbchinaUtil.initModelFromRequest(thirdCmbchinaBusicardinfo, requestContext);
return thirdCmbchinaBusicardinfo;
}
public void initCoreServiceFormSetting(IExtendForm form, IBaseModel model, RequestContext requestContext) throws Exception {
ThirdCmbchinaBusicardinfo thirdCmbchinaBusicardinfo = (ThirdCmbchinaBusicardinfo) model;
}
public ISysNotifyMainCoreService getSysNotifyMainCoreService() {
if (sysNotifyMainCoreService == null) {
sysNotifyMainCoreService = (ISysNotifyMainCoreService) SpringBeanUtil.getBean("sysNotifyMainCoreService");
}
return sysNotifyMainCoreService;
}
protected IThirdCmbchinaBusicardinfoService thirdCmbchinaBusicardinfoService;
public IThirdCmbchinaBusicardinfoService getThirdCmbchinaBusicardinfoService() {
if (thirdCmbchinaBusicardinfoService == null) {
thirdCmbchinaBusicardinfoService = (IThirdCmbchinaBusicardinfoService) SpringBeanUtil
.getBean("thirdCmbchinaBusicardinfoService");
}
return thirdCmbchinaBusicardinfoService;
}
@Override
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public void deleteCardInfoByCorNum(String corNum) throws Exception {
try {
StringBuilder sql = new StringBuilder();
sql.append("delete from third_cmbchina_busicardinfo where cor_num = ?");
getThirdCmbchinaBusicardinfoService().getBaseDao().getHibernateSession()
.createSQLQuery(sql.toString()).setString(0, corNum).executeUpdate();
} catch (Exception e) {
e.printStackTrace();
}
}
}
商务卡卡片信息查询接口
package com.landray.kmss.third.cmbchina.httpservice;
import com.alibaba.fastjson.JSONObject;
import com.landray.kmss.common.service.IBaseService;
public interface BusiCardInfoQuery extends IBaseService {
JSONObject getCardInfoData() throws Exception;
}
package com.landray.kmss.third.cmbchina.httpservice.impl;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.landray.kmss.common.service.BaseServiceImp;
import com.landray.kmss.common.service.IBaseService;
import com.landray.kmss.third.cmbchina.httpservice.BusiCardInfoQuery;
import com.landray.kmss.third.cmbchina.httpservice.HttpPostUtil;
import com.landray.kmss.third.cmbchina.model.ThirdCmbchinaBusicardinfo;
import com.landray.kmss.third.cmbchina.model.ThirdCmbchinaParamap;
import com.landray.kmss.third.cmbchina.service.IThirdCmbchinaBusicardinfoService;
import com.landray.kmss.third.cmbchina.service.IThirdCmbchinaParamapService;
import com.landray.kmss.util.SpringBeanUtil;
import com.landray.kmss.web.annotation.RestApi;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.List;
import static com.landray.kmss.third.cmbchina.httpservice.HttpPostConstant.*;
import static com.landray.kmss.util.SpringBeanUtil.getBean;
@Controller
@RequestMapping(value = "/api/third-cmbchina/busiCardInfoQuery", method = RequestMethod.POST)
@RestApi(docUrl = "", name = "busiCardInfoQueryServiceImp", resourceKey = "third-cmbchina:module.third.cmbchina")
public class BusiCardInfoQueryImpl extends BaseServiceImp implements BusiCardInfoQuery {
private IThirdCmbchinaBusicardinfoService thirdCmbchinaBusicardinfoService;
public IBaseService getServiceImp() {
if (thirdCmbchinaBusicardinfoService == null) {
thirdCmbchinaBusicardinfoService = (IThirdCmbchinaBusicardinfoService) getBean("thirdCmbchinaBusicardinfoService");
}
return thirdCmbchinaBusicardinfoService;
}
private IThirdCmbchinaParamapService thirdCmbchinaParamapService;
private IThirdCmbchinaParamapService getThirdCmbchinaParamapService() {
if (thirdCmbchinaParamapService == null) {
thirdCmbchinaParamapService = (IThirdCmbchinaParamapService) getBean("thirdCmbchinaParamapService");
}
return thirdCmbchinaParamapService;
}
public IThirdCmbchinaBusicardinfoService getThirdCmbchinaBusicardinfoService() {
if (thirdCmbchinaBusicardinfoService == null) {
thirdCmbchinaBusicardinfoService = (IThirdCmbchinaBusicardinfoService) SpringBeanUtil
.getBean("thirdCmbchinaBusicardinfoService");
}
return thirdCmbchinaBusicardinfoService;
}
@Override
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
@ResponseBody
@RequestMapping(value = "/getCardInfoData", method = RequestMethod.POST)
public JSONObject getCardInfoData() throws Exception {
JSONObject returnJsonObject = new JSONObject();
JSONArray returnJsonArray = new JSONArray();
boolean isSuccess = true;
try {
List<ThirdCmbchinaParamap> parMapList = getThirdCmbchinaParamapService().getParamapData();
if (parMapList.size() > 0) {
ThirdCmbchinaParamap thirdCmbchinaParamap;
String clientId;
String clientSecret;
String companyName;
String paramMapCorNum;
for (int i = 0; i < parMapList.size(); i++) {
JSONObject companyJson = new JSONObject();
thirdCmbchinaParamap = parMapList.get(i);
if (thirdCmbchinaParamap != null) {
clientId = thirdCmbchinaParamap.getClientId();
clientSecret = thirdCmbchinaParamap.getClientSecret();
companyName = thirdCmbchinaParamap.getCompanyName();
paramMapCorNum = thirdCmbchinaParamap.getCorNum();
if ((!"".equals(clientId) && clientId != "") && (!"".equals(clientSecret) && clientSecret != "") && (!"".equals(paramMapCorNum) && paramMapCorNum != "")) {
JSONObject paraMapJson = new JSONObject();
JSONObject paraMapKeyJson = new JSONObject();
paraMapKeyJson.put(CLIENTID, clientId);
paraMapKeyJson.put(CLIENTSECRET, clientSecret);
paraMapJson.put(PARAMAP, paraMapKeyJson);
JSONObject doPostJson = HttpPostUtil.doPost(GETCARDINFODATAURL, paraMapJson);
if (doPostJson != null && !doPostJson.isEmpty() && doPostJson.size() != 0) {
if (doPostJson.getBoolean("success")) {
isSuccess = true;
if (doPostJson.containsKey("object")) {
JSONArray jsonArray = doPostJson.getJSONArray("object");
if (jsonArray != null) {
JSONObject jsonItem;
getThirdCmbchinaBusicardinfoService().deleteCardInfoByCorNum(paramMapCorNum);
for (int z = 0; z < jsonArray.size(); z++) {
jsonItem = jsonArray.getJSONObject(z);
ThirdCmbchinaBusicardinfo cardInfo = new ThirdCmbchinaBusicardinfo();
if (jsonItem != null && !jsonItem.isEmpty()) {
cardInfo.setCorNum(jsonItem.getString("corNum"));
cardInfo.setCorChiName(jsonItem.getString("corChiName"));
cardInfo.setActNum(jsonItem.getString("actNum"));
cardInfo.setAcctNbr(jsonItem.getString("acctNbr"));
cardInfo.setCardNumber(jsonItem.getString("cardNumber"));
cardInfo.setHolderChiName(jsonItem.getString("holderChiName"));
cardInfo.setHolderEngName(jsonItem.getString("holderEngName"));
cardInfo.setEmpNumber(jsonItem.getString("empNumber"));
cardInfo.setActivationCode(jsonItem.getString("activationCode"));
cardInfo.setActivationDate(jsonItem.getString("activationDate"));
cardInfo.setCirculationFlag(jsonItem.getString("circulationFlag"));
cardInfo.setCancelDate(jsonItem.getString("cancelDate"));
getServiceImp().add(cardInfo);
}
}
}
}
} else {
isSuccess = false;
}
companyJson.put("success", doPostJson.getBoolean("success"));
companyJson.put("message", doPostJson.get("message").toString());
companyJson.put("msgCode", doPostJson.get("msgCode").toString());
companyJson.put("msgCompany", companyName);
returnJsonArray.add(companyJson);
}
}
}
}
} else {
returnJsonObject.put("success", false);
returnJsonObject.put("message", "没有查询到公司配置信息");
return returnJsonObject;
}
} catch (Exception e) {
e.printStackTrace();
returnJsonObject.put("success", false);
returnJsonObject.put("message", "抛出异常");
return returnJsonObject;
}
if (isSuccess) {
returnJsonObject.put("success", true);
} else {
returnJsonObject.put("success", false);
}
returnJsonObject.put("message", returnJsonArray);
return returnJsonObject;
}
}
招商银行新商务卡交易数据查询接口
package com.landray.kmss.third.cmbchina.httpservice;
import com.alibaba.fastjson.JSONObject;
import com.landray.kmss.common.service.IBaseService;
public interface BusiTranDataQuery extends IBaseService {
JSONObject getTranData() throws Exception;
}
package com.landray.kmss.third.cmbchina.httpservice.impl;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.landray.kmss.common.service.BaseServiceImp;
import com.landray.kmss.common.service.IBaseService;
import com.landray.kmss.third.cmbchina.httpservice.BusiTranDataQuery;
import com.landray.kmss.third.cmbchina.httpservice.HttpPostUtil;
import com.landray.kmss.third.cmbchina.model.ThirdCmbchinaBusitrandata;
import com.landray.kmss.third.cmbchina.model.ThirdCmbchinaParamap;
import com.landray.kmss.third.cmbchina.service.IThirdCmbchinaBusitrandataService;
import com.landray.kmss.third.cmbchina.service.IThirdCmbchinaParamapService;
import com.landray.kmss.web.annotation.RestApi;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.Calendar;
import java.util.List;
import static com.landray.kmss.third.cmbchina.httpservice.HttpPostConstant.*;
import static com.landray.kmss.util.SpringBeanUtil.getBean;
@Controller
@RequestMapping(value = "/api/third-cmbchina/busiTranDataQuery", method = RequestMethod.POST)
@RestApi(docUrl = "", name = "busiTranDataQueryServiceImp", resourceKey = "third-cmbchina:module.third.cmbchina")
public class BusiTranDataQueryImpl extends BaseServiceImp implements BusiTranDataQuery {
private IThirdCmbchinaBusitrandataService thirdCmbchinaBusitrandataService;
public IBaseService getServiceImp() {
if (thirdCmbchinaBusitrandataService == null) {
thirdCmbchinaBusitrandataService = (IThirdCmbchinaBusitrandataService) getBean("thirdCmbchinaBusitrandataService");
}
return thirdCmbchinaBusitrandataService;
}
private IThirdCmbchinaParamapService thirdCmbchinaParamapService;
private IThirdCmbchinaParamapService getThirdCmbchinaParamapService() {
if (thirdCmbchinaParamapService == null) {
thirdCmbchinaParamapService = (IThirdCmbchinaParamapService) getBean("thirdCmbchinaParamapService");
}
return thirdCmbchinaParamapService;
}
@Override
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
@ResponseBody
@RequestMapping(value = "/getTranData", method = RequestMethod.POST)
public JSONObject getTranData() throws Exception {
JSONObject returnJsonObject = new JSONObject();
JSONArray returnJsonArray = new JSONArray();
boolean isSuccess = true;
try {
List<ThirdCmbchinaParamap> parMapList = getThirdCmbchinaParamapService().getParamapData();
if (parMapList.size() > 0) {
ThirdCmbchinaParamap thirdCmbchinaParamap;
String clientId;
String clientSecret;
String companyName;
String paramMapCorNum;
String postdate;
for (int i = 0; i < parMapList.size(); i++) {
JSONObject companyJson = new JSONObject();
thirdCmbchinaParamap = parMapList.get(i);
if (thirdCmbchinaParamap != null) {
clientId = thirdCmbchinaParamap.getClientId();
clientSecret = thirdCmbchinaParamap.getClientSecret();
companyName = thirdCmbchinaParamap.getCompanyName();
paramMapCorNum = thirdCmbchinaParamap.getCorNum();
if ((!"".equals(clientId) && clientId != "") && (!"".equals(clientSecret) && clientSecret != "") && (!"".equals(paramMapCorNum) && paramMapCorNum != "")) {
Calendar startCalendar = Calendar.getInstance();
startCalendar.set(2023, Calendar.AUGUST, 1);
Calendar endCalendar = Calendar.getInstance();
endCalendar.set(2023, Calendar.AUGUST, 31);
String monStr;
String dayStr;
while (startCalendar.compareTo(endCalendar) <= 0) {
int year = startCalendar.get(Calendar.YEAR);
int month = startCalendar.get(Calendar.MONTH) + 1;
int day = startCalendar.get(Calendar.DAY_OF_MONTH);
if (month < 10) {
monStr = "0" + month + "";
} else {
monStr = month + "";
}
if (day < 10) {
dayStr = "0" + day + "";
} else {
dayStr = day + "";
}
postdate = year + "-" + monStr + "-" + dayStr;
JSONObject paraMapJson = new JSONObject();
JSONObject paraMapKeyJson = new JSONObject();
paraMapKeyJson.put(CLIENTID, clientId);
paraMapKeyJson.put(CLIENTSECRET, clientSecret);
paraMapKeyJson.put(CORNUM, paramMapCorNum);
paraMapKeyJson.put(POSTDATE, postdate);
paraMapJson.put(PARAMAP, paraMapKeyJson);
JSONObject doPostJson = HttpPostUtil.doPost(GETTRANSDATAURL, paraMapJson);
if (doPostJson != null && !doPostJson.isEmpty() && doPostJson.size() != 0) {
if (doPostJson.getBoolean("success")) {
isSuccess = true;
if (doPostJson.containsKey("object")) {
JSONArray jsonArray = doPostJson.getJSONArray("object");
if (jsonArray != null) {
JSONObject jsonItem;
for (int z = 0; z < jsonArray.size(); z++) {
jsonItem = jsonArray.getJSONObject(z);
ThirdCmbchinaBusitrandata trandata = new ThirdCmbchinaBusitrandata();
if (jsonItem != null && !jsonItem.isEmpty()) {
trandata.setCorNum(jsonItem.getString("corNum"));
trandata.setActNum(jsonItem.getString("actNum"));
trandata.setAcctNbr(jsonItem.getString("acctNbr"));
trandata.setBilMon(jsonItem.getString("bilMon"));
trandata.setBilDate(jsonItem.getString("bilDate"));
trandata.setCrdNum(jsonItem.getString("crdNum"));
trandata.setActChiNam(jsonItem.getString("actChiNam"));
trandata.setActEngNam(jsonItem.getString("actEngNam"));
trandata.setEmpNum(jsonItem.getString("empNum"));
trandata.setTrsDte(jsonItem.getString("trsDte"));
trandata.setTrxTim(jsonItem.getString("trxTim"));
trandata.setOriCurAmt(jsonItem.getString("oriCurAmt"));
trandata.setOriCurCod(jsonItem.getString("oriCurCod"));
trandata.setPosDate(jsonItem.getString("posDate"));
trandata.setPosCurAmt(jsonItem.getString("posCurAmt"));
trandata.setPosCurCod(jsonItem.getString("posCurCod"));
trandata.setAcpCtyCod(jsonItem.getString("acpCtyCod"));
trandata.setAcpType(jsonItem.getString("acpType"));
trandata.setAcpId(jsonItem.getString("acpId"));
trandata.setAcpName(jsonItem.getString("acpName"));
trandata.setAprCod(jsonItem.getString("aprCod"));
trandata.setTrxRef(jsonItem.getString("trxRef"));
trandata.setTrsCod(jsonItem.getString("trsCod"));
trandata.setTrsVchNbr(jsonItem.getString("trsVchNbr"));
trandata.setSeqNum(jsonItem.getString("seqNum"));
getServiceImp().add(trandata);
}
}
}
}
} else {
isSuccess = false;
}
companyJson.put("success", doPostJson.getBoolean("success"));
companyJson.put("message", doPostJson.get("message").toString());
companyJson.put("msgCode", doPostJson.get("msgCode").toString());
companyJson.put("msgCompany", companyName);
companyJson.put("postdate", postdate);
returnJsonArray.add(companyJson);
}
startCalendar.add(Calendar.DAY_OF_MONTH, 1);
}
}
}
}
} else {
returnJsonObject.put("success", false);
returnJsonObject.put("message", "没有查询到公司配置信息");
return returnJsonObject;
}
} catch (Exception e) {
e.printStackTrace();
returnJsonObject.put("success", false);
returnJsonObject.put("message", "抛出异常");
return returnJsonObject;
}
if (isSuccess) {
returnJsonObject.put("success", true);
} else {
returnJsonObject.put("success", false);
}
returnJsonObject.put("message", returnJsonArray);
return returnJsonObject;
}
}
spring.xml配置bean
<!--商务卡卡片信息查询接口-->
<bean id="busiCardInfoQueryServiceImpl" class="com.landray.kmss.third.cmbchina.httpservice.impl.BusiCardInfoQueryImpl"/>
<!--招商银行新商务卡交易数据查询接口-->
<bean id="busiTranDataQuerServiceyImpl" class="com.landray.kmss.third.cmbchina.httpservice.impl.BusiTranDataQueryImpl"/>