| | |
| | | import com.ycl.exception.ApiException; |
| | | import com.ycl.service.apiKey.IApiKeyService; |
| | | import com.ycl.utils.MD5Util; |
| | | import com.ycl.vo.cockpit.CockpitVO; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | |
| | | /** |
| | | * 驾驶舱 |
| | | * |
| | | * @param appId appId |
| | | * @param appKey appKey |
| | | * @param sign sign |
| | | * @param beginTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @param regionId 区域Id |
| | | * @param params |
| | | */ |
| | | public void cockpit(String appId, String appKey, String sign, String beginTime, String endTime, String regionId) { |
| | | apiKeyService.checkIsExist(appId, appKey, "驾驶仓"); |
| | | public void cockpit(CockpitVO params) { |
| | | apiKeyService.checkIsExist(params.getAppId(), params.getAppKey(), "驾驶仓"); |
| | | StringBuffer sb = new StringBuffer(); |
| | | sb.append(appId); |
| | | sb.append(appKey); |
| | | sb.append("appId="); |
| | | sb.append(params.getAppId()); |
| | | sb.append("&appKey="); |
| | | sb.append(params.getAppKey()); |
| | | String result; |
| | | if (!StringUtils.isBlank(beginTime) && !StringUtils.isBlank(endTime)) { |
| | | sb.append(beginTime); |
| | | sb.append(endTime); |
| | | if (!StringUtils.isBlank(params.getBeginTime()) && !StringUtils.isBlank(params.getEndTime())) { |
| | | sb.append("&beginTime="); |
| | | sb.append(params.getBeginTime()); |
| | | sb.append("&endTime="); |
| | | sb.append(params.getEndTime()); |
| | | } |
| | | if (!StringUtils.isBlank(regionId)) { |
| | | sb.append(regionId); |
| | | if (params.getStreetId() != null) { |
| | | sb.append("&streetId="); |
| | | sb.append(params.getStreetId()); |
| | | } |
| | | if (params.getPageIndex() != null && params.getPageSize() != null) { |
| | | sb.append("&pageIndex="); |
| | | sb.append(params.getPageIndex()); |
| | | sb.append("&pageSize="); |
| | | sb.append(params.getPageSize()); |
| | | } |
| | | result = MD5Util.md5Encrypt32Lower(sb.toString()); |
| | | if (!sign.equals(result)) { |
| | | throw new ApiException(ResultCode.SIGN_ERROR); |
| | | } |
| | | // if (!params.getSign().equals(result)) { |
| | | // throw new ApiException(ResultCode.SIGN_ERROR); |
| | | // } |
| | | } |
| | | } |