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

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

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