mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 02:55:04 +08:00
update
This commit is contained in:
@@ -319,6 +319,11 @@ public class OrderService {
|
||||
private String saveOrder2Database(GenerateOrderDTO dto) {
|
||||
String orderCode = IdUtils.getOrderCode();
|
||||
String transactionCode = IdUtils.generateTransactionCode(dto.getPileSn(), dto.getConnectorCode());
|
||||
|
||||
if (StringUtils.isBlank(dto.getStartType())) {
|
||||
dto.setStartType(StartTypeEnum.NOW.getValue());
|
||||
}
|
||||
|
||||
// 订单基本信息
|
||||
OrderBasicInfo orderBasicInfo = OrderBasicInfo.builder()
|
||||
.orderCode(orderCode)
|
||||
@@ -334,8 +339,8 @@ public class OrderService {
|
||||
.payAmount(dto.getChargeAmount())
|
||||
.payMode(dto.getPayMode())
|
||||
.orderAmount(BigDecimal.ZERO)
|
||||
.startType("appointment") // 测试代码用完删除
|
||||
.appointmentTime(DateUtils.addMinute(new Date(), 5))
|
||||
.startType(dto.getStartType())
|
||||
.appointmentTime(dto.getAppointmentTime())
|
||||
.build();
|
||||
|
||||
// 订单详情
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.jsowell.common.util;
|
||||
import com.google.common.primitives.Bytes;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import javax.xml.bind.DatatypeConverter;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Arrays;
|
||||
|
||||
@@ -128,9 +127,22 @@ public class YKCUtils {
|
||||
// System.out.println(binary);
|
||||
// System.out.println(aaa);
|
||||
|
||||
String hexString = "680d3c4000038800000000002701001568";
|
||||
byte[] bytes = BytesUtil.hexStringToByteArray(hexString);
|
||||
System.out.println(checkMsg(bytes));
|
||||
String hexString = "4f";
|
||||
byte[] bytes = new byte[]{0x4f};
|
||||
|
||||
String s = transitionTemperature(bytes);
|
||||
System.out.println(s);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 转换温度
|
||||
* BIN 码 1 整形,偏移量-50;待机置零
|
||||
*/
|
||||
public static String transitionTemperature(byte[] bytes) {
|
||||
String s = BytesUtil.binary(bytes, 10);
|
||||
int i = Integer.parseInt(s);
|
||||
i = i - 50;
|
||||
return String.valueOf(i);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@ public class UploadRealTimeMonitorHandler extends AbstractHandler {
|
||||
startIndex += length;
|
||||
length = 1;
|
||||
byte[] gunLineTemperatureByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
||||
String gunLineTemperature = String.valueOf(gunLineTemperatureByteArr[0]);
|
||||
String gunLineTemperature = YKCUtils.transitionTemperature(gunLineTemperatureByteArr);
|
||||
realTimeMonitorData.setGunLineTemperature(gunLineTemperature);
|
||||
|
||||
// 枪线编码 没有置零
|
||||
@@ -138,7 +138,7 @@ public class UploadRealTimeMonitorHandler extends AbstractHandler {
|
||||
startIndex += length;
|
||||
length = 1;
|
||||
byte[] batteryMaxTemperatureByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
||||
String batteryMaxTemperature = String.valueOf(batteryMaxTemperatureByteArr[0]);
|
||||
String batteryMaxTemperature = YKCUtils.transitionTemperature(batteryMaxTemperatureByteArr);
|
||||
realTimeMonitorData.setBatteryMaxTemperature(batteryMaxTemperature);
|
||||
|
||||
// 累计充电时间 单位: min;待机置零
|
||||
|
||||
@@ -6,6 +6,7 @@ import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 生成订单dto
|
||||
@@ -48,4 +49,15 @@ public class GenerateOrderDTO extends BasicPileDTO{
|
||||
* 计费模板相关信息
|
||||
*/
|
||||
private BillingTemplateVO billingTemplate;
|
||||
|
||||
/**
|
||||
* 启动类型
|
||||
* @see com.jsowell.common.enums.ykc.StartTypeEnum
|
||||
*/
|
||||
private String startType;
|
||||
|
||||
/**
|
||||
* 预约时间
|
||||
*/
|
||||
private Date appointmentTime;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user