Просмотр исходного кода

Merge branch 'release_toaliyun_real_202112' of https://git.malls.iformall.com/server/formallProject into release_toaliyun_real_202112

release_toaliyun_real
xhxu 4 лет назад
Родитель
Сommit
a316d85283
2 измененных файлов: 23 добавлений и 12 удалений
  1. +3
    -3
      mallinkService/src/main/java/com/iformall/service/park/impl/haikangweishi/HaiKangWeiShiParkService.java
  2. +20
    -9
      mallinkService/src/main/java/com/iformall/service/park/impl/haikangweishi/HaiKangWeiShiUtil.java

+ 3
- 3
mallinkService/src/main/java/com/iformall/service/park/impl/haikangweishi/HaiKangWeiShiParkService.java Просмотреть файл

@@ -165,7 +165,7 @@ public class HaiKangWeiShiParkService extends BaseParkService implements ParkAda
String _endTime = attribute.getString("costTime");//离场时间,格式为“yyyy-MM-dd HH:mi:ss” String _endTime = attribute.getString("costTime");//离场时间,格式为“yyyy-MM-dd HH:mi:ss”
String payPath = ""; String payPath = "";
return new ResultData(new ParkStopFee(parkOrderId,haikang.utcToLocal(_createTime),haikang.utcToLocal(_endTime), return new ResultData(new ParkStopFee(parkOrderId,haikang.utcToLocal(_createTime),haikang.utcToLocal(_endTime),
String.valueOf(attribute.getDouble("shouldCost")),appId,payPath,null,null,"请支付后15分钟内离场"));
String.valueOf(attribute.getDouble("shouldCost")),appId,payPath,null,null,"0元勿使用优惠券,无法退回。支付后15分钟内离场"));
} }


/** /**
@@ -192,12 +192,12 @@ public class HaiKangWeiShiParkService extends BaseParkService implements ParkAda
return new ResultData(ErrorCode.COUPON_IS_EMPTY.getCode(),"当前停车券没有关联停车场优惠券配置[planNo]。"+coupon.getTitle()); return new ResultData(ErrorCode.COUPON_IS_EMPTY.getCode(),"当前停车券没有关联停车场优惠券配置[planNo]。"+coupon.getTitle());
} }
JSONObject retObj = haikang.useCoupon(park,planNo,carNumber,orderNo, getCacheToken(park),haikang.getAuthorization(park,getCacheToken(park))); JSONObject retObj = haikang.useCoupon(park,planNo,carNumber,orderNo, getCacheToken(park),haikang.getAuthorization(park,getCacheToken(park)));
if (retObj.getIntValue("code") == 0){
if (retObj.getString("code").equals("0")){
return new ResultData(); return new ResultData();
}else { }else {
logger.error("haikangweishi useCoupon error. paramMap: {} . haikangResult: {}",JSON.toJSONString(paramMap),retObj); logger.error("haikangweishi useCoupon error. paramMap: {} . haikangResult: {}",JSON.toJSONString(paramMap),retObj);
String msg = retObj.getString("msg"); String msg = retObj.getString("msg");
return new ResultData(retObj.getIntValue("code"), "当前用户领用到海康威视停车券失败:"+msg);
return new ResultData(ErrorCode.CYF_STOP_FEE_FAIL.getCode(), "当前用户领用到海康威视停车券失败:["+retObj.getString("code")+"]"+msg);
} }
} }




+ 20
- 9
mallinkService/src/main/java/com/iformall/service/park/impl/haikangweishi/HaiKangWeiShiUtil.java Просмотреть файл

@@ -227,7 +227,9 @@ public class HaiKangWeiShiUtil {
Map couponmap = new HashMap(); Map couponmap = new HashMap();
couponmap.put("plateNo", carNumber); couponmap.put("plateNo", carNumber);
couponmap.put("ruleId", couponNo); couponmap.put("ruleId", couponNo);
params.put("coupons", "["+JSON.toJSONString(couponmap)+"]");//商户编号
List<Map> coupons = new ArrayList<Map>();
coupons.add(couponmap);
params.put("coupons", coupons);//商户编号
String retCode = ProcBussiness(COUPON_USE, params,token,Authrozitaion); String retCode = ProcBussiness(COUPON_USE, params,token,Authrozitaion);
if (StringUtils.isBlank(retCode)) { if (StringUtils.isBlank(retCode)) {
throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(), "haikang useCoupon error. has no result"); throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(), "haikang useCoupon error. has no result");
@@ -239,7 +241,7 @@ public class HaiKangWeiShiUtil {
throw new MallinkException(errStatus,"haikang useCoupon error.["+result.getString("error")+"]"+result.getString("message")); throw new MallinkException(errStatus,"haikang useCoupon error.["+result.getString("error")+"]"+result.getString("message"));
} }
if (!result.getString("code").equals("200") ) {
if (!result.getString("code").equals("0") ) {
String message = result.getString("msg"); String message = result.getString("msg");
throw new MallinkException(result.getInteger("code"), "haikang useCoupon error."+message); throw new MallinkException(result.getInteger("code"), "haikang useCoupon error."+message);
} }
@@ -325,10 +327,14 @@ public class HaiKangWeiShiUtil {
} }
} }


long currentTime = System.currentTimeMillis();
StringBuffer requestlog = new StringBuffer();
if (null != pairs) { if (null != pairs) {
log.info("haikangweishi httpRequest:[url]"+url+"[params]"+JSON.toJSONString(pairs)); log.info("haikangweishi httpRequest:[url]"+url+"[params]"+JSON.toJSONString(pairs));
requestlog.append("haikangweishi httpRequest:[url]").append(url).append("[params]").append(JSON.toJSONString(pairs));
}else { }else {
log.info("haikangweishi httpRequest:[url]"+url); log.info("haikangweishi httpRequest:[url]"+url);
requestlog.append("haikangweishi httpRequest:[url]").append(url);
} }
HttpResponse response = null; HttpResponse response = null;
try { try {
@@ -336,7 +342,7 @@ public class HaiKangWeiShiUtil {
} catch (Exception e) { } catch (Exception e) {
log.error(e.getLocalizedMessage(),e); log.error(e.getLocalizedMessage(),e);
} }
long responseCostTime = (System.currentTimeMillis()-currentTime)/1000;
String result = null; String result = null;


//打印StatusLine //打印StatusLine
@@ -345,7 +351,8 @@ public class HaiKangWeiShiUtil {
//获取实体 //获取实体
HttpEntity httpEntity= response.getEntity(); HttpEntity httpEntity= response.getEntity();
result = EntityUtils.toString(httpEntity, "UTF-8"); result = EntityUtils.toString(httpEntity, "UTF-8");
log.debug(result);
requestlog.append("[response]").append(result).append("[costTime(seconds)]").append(responseCostTime);
log.debug(requestlog.toString());
} catch (Exception e) { } catch (Exception e) {
log.error(e.getLocalizedMessage(),e); log.error(e.getLocalizedMessage(),e);
} }
@@ -375,11 +382,14 @@ public class HaiKangWeiShiUtil {
} }
HttpEntity entity = builder.build(); HttpEntity entity = builder.build();
httpPost.setEntity(entity); httpPost.setEntity(entity);
long currentTime = System.currentTimeMillis();
StringBuffer requestlog = new StringBuffer();
if (null != pairs) { if (null != pairs) {
log.info("haikangweishi httpRequest:[url]"+url+"[params]"+JSON.toJSONString(pairs));
log.info("haikangweishi httpRequest start :[url]"+url+"[params]"+JSON.toJSONString(pairs));
requestlog.append("haikangweishi httpRequest:[url]").append(url).append("[params]").append(JSON.toJSONString(pairs));
}else { }else {
log.info("haikangweishi httpRequest:[url]"+url);
log.info("haikangweishi httpRequest start :[url]"+url);
requestlog.append("haikangweishi httpRequest:[url]").append(url);
} }
HttpResponse response = null; HttpResponse response = null;
try { try {
@@ -387,7 +397,7 @@ public class HaiKangWeiShiUtil {
} catch (Exception e) { } catch (Exception e) {
log.error(e.getLocalizedMessage(),e); log.error(e.getLocalizedMessage(),e);
} }
long responseCostTime = (System.currentTimeMillis()-currentTime)/1000;
String result = null; String result = null;


//打印StatusLine //打印StatusLine
@@ -396,7 +406,8 @@ public class HaiKangWeiShiUtil {
//获取实体 //获取实体
HttpEntity httpEntity= response.getEntity(); HttpEntity httpEntity= response.getEntity();
result = EntityUtils.toString(httpEntity, "UTF-8"); result = EntityUtils.toString(httpEntity, "UTF-8");
log.debug(result);
requestlog.append("[response]").append(result).append("[costTime(seconds)]").append(responseCostTime);
log.debug(requestlog.toString());
} catch (Exception e) { } catch (Exception e) {
log.error(e.getLocalizedMessage(),e); log.error(e.getLocalizedMessage(),e);
} }


Загрузка…
Отмена
Сохранить