Merge remote-tracking branch 'origin/master'
| | |
| | | */ |
| | | public interface XpAppUserCouponMapper extends BaseMapper<XpAppUserCoupon> { |
| | | |
| | | Page<XpAppUserCouponListVo> userCouponList(@Param("page") Page<XpAppUserCouponListVo> page, @Param("query") XpUserCouponListQuery query, @Param("uid") String uid); |
| | | Page<XpAppUserCouponListVo> userCouponList(@Param("page") Page<XpAppUserCouponListVo> page, @Param("query") XpUserCouponListQuery query, @Param("uid") Long uid); |
| | | |
| | | } |
| | |
| | | @Override |
| | | public XpAppUserCouponVo userCouponList(XpUserCouponListQuery query, String uid) { |
| | | Page<XpAppUserCouponListVo> page = new Page<>(query.getPageNum(), query.getPageSize()); |
| | | Page<XpAppUserCouponListVo> list = baseMapper.userCouponList(page, query, uid); |
| | | Page<XpAppUserCouponListVo> list = baseMapper.userCouponList(page, query, Long.valueOf(uid)); |
| | | XpAppUserCouponVo vo = new XpAppUserCouponVo(); |
| | | vo.setTotal((int) page.getTotal()); |
| | | vo.setList(list.getRecords()); |
| File was renamed from xp-robotaxi-api/src/main/java/com/xiaopeng/api/factory/operation/ReassignOrderClientFallbackFactory.java |
| | |
| | | package com.xiaopeng.api.factory.operation; |
| | | package com.xiaopeng.api.factory.order; |
| | | |
| | | import com.xiaopeng.api.dto.operation.ReassignOrderDTO; |
| | | import com.xiaopeng.api.feignClient.operation.ReassignOrderClient; |
| | |
| | | package com.xiaopeng.api.feignClient.operation; |
| | | |
| | | import com.xiaopeng.api.dto.operation.ReassignOrderDTO; |
| | | import com.xiaopeng.api.factory.operation.ReassignOrderClientFallbackFactory; |
| | | import com.xiaopeng.api.factory.operation.XpSystemSettingClientFallbackFactory; |
| | | import com.xiaopeng.api.model.operation.XpFeedbackType; |
| | | import com.xiaopeng.api.factory.order.ReassignOrderClientFallbackFactory; |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.common.core.dto.ServiceNameConstantsEnum; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | |
| | | com.xiaopeng.api.factory.operation.XpWhiteListClientFallbackFactory |
| | | com.xiaopeng.api.factory.operation.XpElectronicFenceClientFallbackFactory |
| | | com.xiaopeng.api.factory.operation.XpCruisePlanClientFallbackFactory |
| | | com.xiaopeng.api.factory.operation.ReassignOrderClientFallbackFactory |
| | | com.xiaopeng.api.factory.order.ReassignOrderClientFallbackFactory |
| | | com.xiaopeng.api.factory.vehicleConvoy.UserVehicleClientFallbackFactory |
| | | com.xiaopeng.api.factory.vehicleConvoy.XpFleetOperationsClientFallbackFactory |
| | | com.xiaopeng.api.factory.pushMessage.XpPushMessageClientFallbackFactory |
| | |
| | | if (StringUtils.matches(url, signProperties.getWhites())) { |
| | | return chain.filter(exchange); |
| | | } |
| | | |
| | | // 判断是否为multipart请求 |
| | | String contentType = request.getHeaders().getFirst("Content-Type"); |
| | | boolean isMultipart = contentType != null && contentType.toLowerCase().contains("multipart/"); |
| | | |
| | | |
| | | //校验签名 |
| | | if(signProperties.getEnable()){ |
| | | String sign = request.getHeaders().getFirst(TokenConstants.SIGN); |
| | |
| | | } |
| | | //数据缓存保留24小时 |
| | | redisService.setCacheObject("sign:nonce:" + nonce, nonce, 24L, TimeUnit.DAYS); |
| | | return authSign(exchange, chain, sign, nonce, timestamp); |
| | | // 对于multipart请求,只校验headers,不读取body |
| | | if(isMultipart){ |
| | | return authMultipartSign(exchange, chain, sign, nonce, timestamp); |
| | | } else { |
| | | return authSign(exchange, chain, sign, nonce, timestamp); |
| | | } |
| | | } |
| | | return chain.filter(exchange.mutate().request(mutate.build()).build()); |
| | | } |
| | |
| | | return ServletUtils.webFluxResponseWriter(exchange.getResponse(), msg, HttpStatus.BAD_REQUEST); |
| | | } |
| | | |
| | | /** |
| | | * multipart请求的签名校验(不读取文件流) |
| | | * @return |
| | | */ |
| | | private Mono<Void> authMultipartSign(ServerWebExchange exchange, GatewayFilterChain chain, String sign, String nonce, String timestamp){ |
| | | // 对于multipart请求,只使用headers信息进行签名验证 |
| | | // 构造基于headers的签名字符串 |
| | | JSONObject headerParams = new JSONObject(); |
| | | headerParams.put("content-type", exchange.getRequest().getHeaders().getFirst("Content-Type")); |
| | | headerParams.put("content-length", exchange.getRequest().getHeaders().getFirst("Content-Length")); |
| | | if(!authSign(headerParams, sign, nonce, timestamp)){ |
| | | return unauthorizedResponse(exchange, "请求失败,请稍后重试!"); |
| | | } |
| | | // 直接放行,不读取body |
| | | return chain.filter(exchange); |
| | | } |
| | | |
| | | /** |
| | | * 校验签名 |
| | |
| | | @ApiOperation(value = "任务中心列表", response = TaskPageListVO.class, tags = "运维APP-任务中心") |
| | | @PostMapping("/api/v1/task/pageList") |
| | | public R<PageInfo<TaskPageListVO>> pageList(@RequestBody TaskPageListQuery query) { |
| | | query.setUserId(tokenService.getLoginOperationUser().getXpOperationsUser().getId()); |
| | | PageInfo<TaskPageListVO> pageList = xpTaskService.pageList(query); |
| | | return R.ok(pageList); |
| | | } |
| | |
| | | } |
| | | } |
| | | @ApiOperation(value = "邀请码导入") |
| | | @PostMapping("/base/v1/invitation/importExcel") |
| | | @PostMapping("/api/v1/invitation/importExcel") |
| | | public R<String> importExcel(@RequestPart("file") MultipartFile file) { |
| | | System.out.println("文件名 = " + file.getOriginalFilename()); |
| | | System.out.println("文件大小 = " + file.getSize()); |
| | | System.out.println("ContentType = " + file.getContentType()); |
| | | ImportParams params = new ImportParams(); |
| | | params.setHeadRows(1); //表头行数 |
| | | InputStream inputStream = null; |
| | |
| | | .filter(item -> item instanceof XpRegion) |
| | | .map(item -> (XpRegion) item) |
| | | .collect(Collectors.toList()); |
| | | |
| | | if(query.getCityName()!=null){ |
| | | list = list.stream().filter(item -> item.getName().contains(query.getCityName()) || item.getInitial().contains(query.getCityName())).collect(Collectors.toList()); |
| | | } |
| | | } catch (ClassCastException e) { |
| | | // 缓存数据结构异常,重新加载 |
| | | redisService.deleteObject(CacheConstants.XP_REGION); |
| | | } |
| | | }else { |
| | | list = regionService.list(Wrappers.lambdaQuery(XpRegion.class).ne(XpRegion::getParentId, 0).isNotNull(XpRegion::getInitial).orderByAsc(XpRegion::getInitial)); |
| | | list = regionService.list(Wrappers.lambdaQuery(XpRegion.class).ne(XpRegion::getParentId, 0).and(w->w.like(query.getCityName()!=null , XpRegion::getInitial, query.getCityName()).or().like(query.getCityName()!=null , XpRegion::getInitial, query.getCityName())).like(query.getCityName()!=null , XpRegion::getName, query.getCityName()).isNotNull(XpRegion::getInitial).orderByAsc(XpRegion::getInitial)); |
| | | redisService.setCacheList(CacheConstants.XP_REGION_CITY, list); |
| | | } |
| | | List<XpOpenCity> openCities = openCityService.list(new LambdaQueryWrapper<XpOpenCity>().eq(XpOpenCity::getStatus,1)); |
| | |
| | | continue; |
| | | } |
| | | XpVehicle vehiclePosition = vehiclePositionR.getData(); |
| | | if (vehiclePosition.getStatus() != 1 || vehiclePosition.getState() != 0) { |
| | | if (vehiclePosition.getStatus() != 1 || vehiclePosition.getState() != 0 || vehiclePosition.getVehicleType()==1) { |
| | | lock.unlock(); |
| | | continue; |
| | | } |
| | |
| | | continue; |
| | | } |
| | | XpVehicle vehicleId1 = vehicleR.getData(); |
| | | if (vehicleId1.getStatus() != 1 || vehicleId1.getState() != 0) { |
| | | if (vehicleId1.getStatus() != 1 || vehicleId1.getState() != 0 || vehicleId1.getVehicleType()==1) { |
| | | lock.unlock(); |
| | | continue; |
| | | } |