From 8e53b0725370af313c85ee7b069f485e2664d3ba Mon Sep 17 00:00:00 2001 From: Lemon Date: Tue, 13 Aug 2024 15:47:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20=E7=AB=99=E7=82=B9?= =?UTF-8?q?=E6=9E=AA=E5=8F=A3=E5=88=A9=E7=94=A8=E7=8E=87=E8=B6=8B=E5=8A=BF?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/运营小程序接口文档.md | 1 + .../BusinessStationInfoController.java | 19 +++++++++++ .../pile/service/PileStationInfoService.java | 7 ++++ .../impl/PileStationInfoServiceImpl.java | 33 +++++++++++++++++++ .../thirdparty/common/CommonService.java | 6 ++-- 5 files changed, 63 insertions(+), 3 deletions(-) diff --git a/doc/运营小程序接口文档.md b/doc/运营小程序接口文档.md index 15a155a09..dd2f3d272 100644 --- a/doc/运营小程序接口文档.md +++ b/doc/运营小程序接口文档.md @@ -137,6 +137,7 @@ | ---------- | ------------ | -------- | --------------------------------------- | | stationIds | List | Y | 站点id数组 | | type | String | Y | 日期类型(1-近7天;2-近30天;3-近一年) | +| dateTime | String | N | 用户选中某天的日期 | ### 反参 diff --git a/jsowell-admin/src/main/java/com/jsowell/api/uniapp/business/BusinessStationInfoController.java b/jsowell-admin/src/main/java/com/jsowell/api/uniapp/business/BusinessStationInfoController.java index eaa6291e2..fd995617e 100644 --- a/jsowell-admin/src/main/java/com/jsowell/api/uniapp/business/BusinessStationInfoController.java +++ b/jsowell-admin/src/main/java/com/jsowell/api/uniapp/business/BusinessStationInfoController.java @@ -112,4 +112,23 @@ public class BusinessStationInfoController extends BaseController { logger.info("查询站点订单数量趋势信息 params:{}, result:{}", JSONObject.toJSONString(dto), response); return response; } + + /** + * 查询站点枪利用率趋势信息 + * @return + */ + @PostMapping("/getStationConnectorUsedInfo") + public RestApiResponse getStationConnectorUsedInfo(@RequestBody StationBusinessAnalyzeInfoDTO dto) { + RestApiResponse response = null; + try { + StationBusinessAnalyzeInfoVO vo = pileStationInfoService.getStationConnectorUsedInfo(dto); + response = new RestApiResponse<>(ImmutableMap.of("stationBusinessAnalyzeInfoVO", vo)); + } catch (Exception e) { + logger.error("查询站点枪利用率趋势信息 error", e); + response = new RestApiResponse<>(e); + } + logger.info("查询站点枪利用率趋势信息 params:{}, result:{}", JSONObject.toJSONString(dto), response); + return response; + } + } diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/PileStationInfoService.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/PileStationInfoService.java index 601b22401..c05c3c479 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/PileStationInfoService.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/PileStationInfoService.java @@ -185,4 +185,11 @@ public interface PileStationInfoService { * @return */ StationBusinessAnalyzeInfoVO getStationOrderQuantityInfo(StationBusinessAnalyzeInfoDTO dto); + + /** + * 查询站点枪利用率趋势信息 + * @param dto + * @return + */ + StationBusinessAnalyzeInfoVO getStationConnectorUsedInfo(StationBusinessAnalyzeInfoDTO dto); } diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileStationInfoServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileStationInfoServiceImpl.java index 39b651e2b..4ad988dec 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileStationInfoServiceImpl.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileStationInfoServiceImpl.java @@ -36,6 +36,8 @@ import com.jsowell.pile.vo.uniapp.customer.CurrentTimePriceDetails; import com.jsowell.pile.vo.web.PileStationVO; import com.jsowell.system.service.SysDeptService; import com.jsowell.system.service.SysUserService; +import com.yi.business.geo.GeoCodeInfo; +import com.yi.business.geo.TermRelationTreeCoordinate; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -1133,4 +1135,35 @@ public class PileStationInfoServiceImpl implements PileStationInfoService { vo.setStationOrderQuantityInfoList(list); return vo; } + + /** + * 查询站点枪利用率趋势信息 + * @param dto + * @return + */ + @Override + public StationBusinessAnalyzeInfoVO getStationConnectorUsedInfo(StationBusinessAnalyzeInfoDTO dto) { + List stationIds = dto.getStationIds(); + String type = dto.getType(); + String dateTime = dto.getDateTime(); + String startTime = ""; + String endTime = ""; + if (StringUtils.equals(Constants.ONE, type)) { + // 7天 + startTime = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, DateUtils.addDays(new Date(), -7)); + endTime = DateUtils.dateTimeNow(DateUtils.YYYY_MM_DD); + } else if (StringUtils.equals(Constants.TWO, type)) { + // 30天 + startTime = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, DateUtils.addDays(new Date(), -30)); + endTime = DateUtils.dateTimeNow(DateUtils.YYYY_MM_DD); + } + // 根据站点ids和开始、结束日期查询订单表 + List orderDetailByStationIds = orderBasicInfoService.getOrderDetailByStationIds(stationIds, startTime, endTime); + if (CollectionUtils.isEmpty(orderDetailByStationIds)) { + throw new BusinessException(ReturnCodeEnum.CODE_SELECT_INFO_IS_NULL); + } + + // 分组出来key为日期,value为订单信息 + return null; + } } \ No newline at end of file diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/common/CommonService.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/common/CommonService.java index 3a41dc35f..482cad3cb 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/common/CommonService.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/common/CommonService.java @@ -263,9 +263,9 @@ public class CommonService { if (StringUtils.equals(ThirdPlatformTypeEnum.LIAN_LIAN_PLATFORM.getTypeCode(), thirdPartyType)) { // 联联 OrderBasicInfo orderInfo = orderBasicInfoService.getOrderInfoByTransactionCode(transactionCode); - if (orderInfo == null) { - return; - } + // if (orderInfo == null) { + // return; + // } // log.info("推送联联平台实时数据 params: orderBasicInfo:{}", JSON.toJSONString(orderInfo)); // 设备状态变化推送 notification_stationStatus dto.setThirdPartyType(ThirdPlatformTypeEnum.LIAN_LIAN_PLATFORM.getTypeCode());