新增 站点枪口利用率趋势统计接口

This commit is contained in:
Lemon
2024-08-13 15:47:31 +08:00
parent f4b03719fd
commit 8e53b07253
5 changed files with 63 additions and 3 deletions

View File

@@ -137,6 +137,7 @@
| ---------- | ------------ | -------- | --------------------------------------- |
| stationIds | List<String> | Y | 站点id数组 |
| type | String | Y | 日期类型1-近7天2-近30天3-近一年) |
| dateTime | String | N | 用户选中某天的日期 |
### 反参

View File

@@ -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;
}
}

View File

@@ -185,4 +185,11 @@ public interface PileStationInfoService {
* @return
*/
StationBusinessAnalyzeInfoVO getStationOrderQuantityInfo(StationBusinessAnalyzeInfoDTO dto);
/**
* 查询站点枪利用率趋势信息
* @param dto
* @return
*/
StationBusinessAnalyzeInfoVO getStationConnectorUsedInfo(StationBusinessAnalyzeInfoDTO dto);
}

View File

@@ -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<String> 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<BusinessOrderDetailInfoVO> orderDetailByStationIds = orderBasicInfoService.getOrderDetailByStationIds(stationIds, startTime, endTime);
if (CollectionUtils.isEmpty(orderDetailByStationIds)) {
throw new BusinessException(ReturnCodeEnum.CODE_SELECT_INFO_IS_NULL);
}
// 分组出来key为日期value为订单信息
return null;
}
}

View File

@@ -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());