update 电池算法应用Service

This commit is contained in:
Lemon
2025-04-08 16:14:51 +08:00
parent f871234f8e
commit 2b12f9e80b
2 changed files with 69 additions and 0 deletions

View File

@@ -24,6 +24,56 @@ public class ChargeAlgorithmData {
*/
private String orderCode;
/**
* 站点详细地址
*/
private String siteAddress;
/**
* 站点编号
*/
private String siteCode;
/**
* 桩编号
*/
private String pileCode;
/**
* 枪编号
*/
private String gunNo;
/**
* 车主年龄段
*/
private String age;
/**
* 车主性别
*/
private String gender;
/**
* 用车场景
*/
private String scene;
/**
* 车辆使用年限
*/
private String serviceLife;
/**
* 车辆累计里程
*/
private String odometer;
/**
* 站点名称
*/
private String siteName;
/**
* 初始SOC
*/

View File

@@ -12,8 +12,10 @@ import com.jsowell.common.util.StringUtils;
import com.jsowell.pile.domain.OrderSplitRecord;
import com.jsowell.pile.service.OrderBasicInfoService;
import com.jsowell.pile.service.PileBasicInfoService;
import com.jsowell.pile.service.PileStationInfoService;
import com.jsowell.pile.thirdparty.ParameterConfigData;
import com.jsowell.pile.vo.uniapp.customer.OrderVO;
import com.jsowell.pile.vo.web.PileStationVO;
import com.jsowell.thirdparty.platform.domain.ChargeAlgorithmData;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -43,6 +45,9 @@ public class ChargeAlgorithmService {
@Autowired
private PileBasicInfoService pileBasicInfoService;
@Autowired
private PileStationInfoService pileStationInfoService;
@Autowired
private RedisCache redisCache;
@@ -58,6 +63,9 @@ public class ChargeAlgorithmService {
if (orderVO == null) {
return "订单信息为空";
}
// 查询站点信息
PileStationVO stationVO = pileStationInfoService.getStationInfo(orderVO.getStationId());
// 计算充电时长
long chargingTime = DateUtils.intervalTime(orderVO.getStartTime(), orderVO.getEndTime());
String transactionCode = orderVO.getTransactionCode();
@@ -125,6 +133,17 @@ public class ChargeAlgorithmService {
// .gunTemp("0") // 充电枪温度
.doorStatus(Constants.zero) // 舱门状态
.siteAddress(stationVO.getAddress())
.siteCode(stationVO.getId())
.pileCode(orderVO.getPileSn())
.gunNo(orderVO.getPileConnectorCode())
.age("0")
.gender("0")
.scene("0")
.serviceLife("0")
.odometer("0")
.siteName(stationVO.getStationName())
.build();