| @@ -136,11 +136,17 @@ public class DaHuaParkService extends BaseParkService implements ParkAdapterServ | |||||
| if (StringUtils.isBlank(retCode)) { | if (StringUtils.isBlank(retCode)) { | ||||
| throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(), "dahua getCarStopFee error. has no result"); | throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(), "dahua getCarStopFee error. has no result"); | ||||
| } | } | ||||
| String appId = "wxe01cc0f34a5c70dc"; | |||||
| JSONObject result = JSON.parseObject(retCode); | JSONObject result = JSON.parseObject(retCode); | ||||
| if (!result.getBoolean("success") ) { | if (!result.getBoolean("success") ) { | ||||
| String message = result.getString("errMsg"); | String message = result.getString("errMsg"); | ||||
| throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(), "dahua getCarStopFee error."+message); | |||||
| if (StringUtils.isNotBlank(message)&& message.contains("操作过于频繁")) { | |||||
| return new ParkStopFee("-111",dahua.utcToLocal("1990-01-01 00:00:00"),dahua.utcToLocal("1990-01-01 00:00:00"), | |||||
| "999999999",appId,"payPath",null,null,"大华提示:"+message); | |||||
| }else { | |||||
| //do nothing | |||||
| throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(), "dahua getCarStopFee error."+message); | |||||
| } | |||||
| } | } | ||||
| JSONObject attribute = result.getJSONObject("data"); | JSONObject attribute = result.getJSONObject("data"); | ||||
| if (null == attribute ) { | if (null == attribute ) { | ||||
| @@ -148,10 +154,9 @@ public class DaHuaParkService extends BaseParkService implements ParkAdapterServ | |||||
| } | } | ||||
| BigDecimal totalFee = attribute.getBigDecimal("notPaidAmount"); | BigDecimal totalFee = attribute.getBigDecimal("notPaidAmount"); | ||||
| String appId = "wxe01cc0f34a5c70dc"; | |||||
| String parkOrderId = attribute.getString("parkingRecordId"); | String parkOrderId = attribute.getString("parkingRecordId"); | ||||
| Integer freeMinute = (Integer)park.getVendorParamsByKey("freeMinute"); | Integer freeMinute = (Integer)park.getVendorParamsByKey("freeMinute"); | ||||
| Date createTime = DateUtils.string2Date(attribute.getString("carInTime"),DateUtils.DATE_TIME_PATTERN).getTime();//计费时间,格式为“yyyy-MM-dd HH:mi:ss” | Date createTime = DateUtils.string2Date(attribute.getString("carInTime"),DateUtils.DATE_TIME_PATTERN).getTime();//计费时间,格式为“yyyy-MM-dd HH:mi:ss” | ||||
| Long seconds = attribute.getLong("duration");//停车时长秒 | Long seconds = attribute.getLong("duration");//停车时长秒 | ||||
| Date endTime = DateUtils.getSecondsTimeAfter(seconds, createTime);//离场时间,格式为“yyyy-MM-dd HH:mi:ss” | Date endTime = DateUtils.getSecondsTimeAfter(seconds, createTime);//离场时间,格式为“yyyy-MM-dd HH:mi:ss” | ||||