|
@@ -1,9 +1,12 @@
|
|
|
package com.jkcredit.invoice.credit.interserver;
|
|
|
|
|
|
import cn.com.taiji.sdk.model.comm.protocol.tts.trade.service.CardTradeModel;
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.jkcredit.invoice.common.DataResult;
|
|
|
+import com.jkcredit.invoice.credit.dto.CardChangeDto;
|
|
|
+import com.jkcredit.invoice.credit.dto.CardChangeQueryDto;
|
|
|
import com.jkcredit.invoice.model.entity.customer.CustomerCarRec;
|
|
|
import com.jkcredit.invoice.model.entity.customer.CustomerRec;
|
|
|
import com.jkcredit.invoice.service.customer.CustomerRecService;
|
|
@@ -807,4 +810,109 @@ public class SelfCarInterServiceImpl implements SelfCarInterService {
|
|
|
}
|
|
|
return result;
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public DataResult customerCardChange(String appKey, String api, String data, String requestid) {
|
|
|
+ long costtimestart = System.currentTimeMillis();
|
|
|
+ DataResult result = new DataResult();
|
|
|
+ result.setData(3);
|
|
|
+ result.setCode(200);
|
|
|
+ result.setRequestid(requestid);
|
|
|
+ result.setMsg("无法认证");
|
|
|
+
|
|
|
+ try {
|
|
|
+ log.info("[-SelfCarInterServiceImpl.customerCarUnRec-] request appKey=" + appKey + " ,api=" + api + " ,data=" +data+ " ,requestid=" +requestid);
|
|
|
+
|
|
|
+ CardChangeQueryDto cardChangeQueryDto = JSON.parseObject(data,CardChangeQueryDto.class);
|
|
|
+
|
|
|
+ if(cardChangeQueryDto == null || StringUtils.isEmpty(cardChangeQueryDto.getCompanyNum())
|
|
|
+ || StringUtils.isEmpty(cardChangeQueryDto.getApplyId()) || StringUtils.isEmpty(cardChangeQueryDto.getCardId()))
|
|
|
+ {
|
|
|
+ result.setMsg("必传参数不足");
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ CustomerRec customerRec = new CustomerRec();
|
|
|
+ customerRec.setCustomerName(appKey);
|
|
|
+ customerRec.setCompanyNum(cardChangeQueryDto.getCompanyNum());
|
|
|
+ CustomerRec customerRec1 = customerRecMapper.selectByCustomerNameAndCompanyNum(customerRec);
|
|
|
+ if (null == customerRec1){
|
|
|
+ result.setMsg("该企业编号未注册企业!");
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ RespR rs = selfCarService.customerCardChangeQuery(cardChangeQueryDto);
|
|
|
+ long costtimeend = System.currentTimeMillis();
|
|
|
+ log.info("[-SelfCarInterServiceImpl.customerCarUnRec-] result is "
|
|
|
+ + rs.toString() + ", request is " + data + " ,costtime="
|
|
|
+ + (costtimeend - costtimestart));
|
|
|
+ if(null != rs && rs.getCode() == 0){
|
|
|
+ result.setData(1);
|
|
|
+ result.setCode(200);
|
|
|
+ result.setMsg(rs.getData().toString());
|
|
|
+ return result;
|
|
|
+ } else {
|
|
|
+ result.setData(3);
|
|
|
+ result.setCode(200);
|
|
|
+ result.setMsg(rs.getMsg());
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("[-SelfCarInterServiceImpl.customerCarUnRec-] get httpclient exception is "
|
|
|
+ + e + ", request is " + data);
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public DataResult customerCardChangeQuery(String appKey, String api, String data, String requestid) {
|
|
|
+ long costtimestart = System.currentTimeMillis();
|
|
|
+ DataResult result = new DataResult();
|
|
|
+ result.setData(3);
|
|
|
+ result.setCode(200);
|
|
|
+ result.setRequestid(requestid);
|
|
|
+ result.setMsg("无法认证");
|
|
|
+
|
|
|
+ try {
|
|
|
+ log.info("[-SelfCarInterServiceImpl.customerCarUnRec-] request appKey=" + appKey + " ,api=" + api + " ,data=" +data+ " ,requestid=" +requestid);
|
|
|
+
|
|
|
+ CardChangeDto cardChangeDto = JSON.parseObject(data,CardChangeDto.class);
|
|
|
+
|
|
|
+ if(cardChangeDto == null || StringUtils.isEmpty(cardChangeDto.getCompanyNum())
|
|
|
+ || StringUtils.isEmpty(cardChangeDto.getTargetCompanyNum()) || cardChangeDto.getCardIdList()==null
|
|
|
+ || cardChangeDto.getCardIdList().size()==0)
|
|
|
+ {
|
|
|
+ result.setMsg("必传参数不足");
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ CustomerRec customerRec = new CustomerRec();
|
|
|
+ customerRec.setCustomerName(appKey);
|
|
|
+ customerRec.setCompanyNum(cardChangeDto.getCompanyNum());
|
|
|
+ CustomerRec customerRec1 = customerRecMapper.selectByCustomerNameAndCompanyNum(customerRec);
|
|
|
+ if (null == customerRec1){
|
|
|
+ result.setMsg("该企业编号未注册企业!");
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ RespR rs = selfCarService.customerCardChange(cardChangeDto);
|
|
|
+ long costtimeend = System.currentTimeMillis();
|
|
|
+ log.info("[-SelfCarInterServiceImpl.customerCarUnRec-] result is "
|
|
|
+ + rs.toString() + ", request is " + data + " ,costtime="
|
|
|
+ + (costtimeend - costtimestart));
|
|
|
+ if(null != rs && rs.getCode() == 0){
|
|
|
+ result.setData(1);
|
|
|
+ result.setCode(200);
|
|
|
+ result.setMsg(rs.getData().toString());
|
|
|
+ return result;
|
|
|
+ } else {
|
|
|
+ result.setData(3);
|
|
|
+ result.setCode(200);
|
|
|
+ result.setMsg(rs.getMsg());
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("[-SelfCarInterServiceImpl.customerCarUnRec-] get httpclient exception is "
|
|
|
+ + e + ", request is " + data);
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
}
|