mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 19:45:09 +08:00
Merge branch 'dev' of http://192.168.2.46:8099/jsowell/jsowell-charger-web into dev
This commit is contained in:
@@ -16,7 +16,7 @@ import java.util.Map;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
@Order(1)
|
||||
@Order(2)
|
||||
public class InitializeAdapayConfig implements CommandLineRunner {
|
||||
|
||||
@Value("${adapay.debugFlag}")
|
||||
@@ -36,7 +36,6 @@ public class InitializeAdapayConfig implements CommandLineRunner {
|
||||
|
||||
@Override
|
||||
public void run(String... args) throws Exception {
|
||||
log.info(">>>>>>>>>>>>>>>服务启动执行,执行加载数据等操作 InitializeAdapayConfig order 1 <<<<<<<<<<<<<");
|
||||
/*
|
||||
单商户
|
||||
*/
|
||||
@@ -47,6 +46,7 @@ public class InitializeAdapayConfig implements CommandLineRunner {
|
||||
目前有jsowell和xixiao
|
||||
*/
|
||||
multiMerchant();
|
||||
log.info(">>>>>>>>>>>>>>>服务启动执行,执行加载数据等操作 InitializeAdapayConfig order 2 <<<<<<<<<<<<<");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -11,7 +11,7 @@ import org.springframework.stereotype.Component;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
@Order(2)
|
||||
@Order(4)
|
||||
public class AliPayConfig implements CommandLineRunner {
|
||||
@Value("${alipay.gatewayHost}")
|
||||
private String gatewayHost;
|
||||
@@ -33,7 +33,6 @@ public class AliPayConfig implements CommandLineRunner {
|
||||
|
||||
@Override
|
||||
public void run(String... args) throws Exception {
|
||||
log.info(">>>>>>>>>>>>>>>服务启动执行,执行加载数据等操作 AliPayConfig order 2 <<<<<<<<<<<<<");
|
||||
// 设置参数(全局只需设置一次)
|
||||
Config config = new Config();
|
||||
config.protocol = Constants.HTTPS;
|
||||
@@ -57,5 +56,6 @@ public class AliPayConfig implements CommandLineRunner {
|
||||
// 可设置AES密钥,调用AES加解密相关接口时需要(可选)
|
||||
config.encryptKey = encryptKey;
|
||||
Factory.setOptions(config);
|
||||
log.info(">>>>>>>>>>>>>>>服务启动执行,执行加载数据等操作 AliPayConfig order 4 <<<<<<<<<<<<<");
|
||||
}
|
||||
}
|
||||
@@ -76,7 +76,7 @@ public class OrderBasicInfo {
|
||||
private String vinCode;
|
||||
|
||||
/**
|
||||
* 启动方式(0-后管启动;1-用户app启动;2-卡启动;3-离线卡启动; 4-联联平台启动; 5-车辆vin码启动)
|
||||
* 启动方式(0-后管启动;1-用户app启动;2-卡启动;3-离线卡启动; 4-联联平台启动; 5-车辆vin码启动; 6-个人桩预约启动)
|
||||
*/
|
||||
private String startMode;
|
||||
|
||||
|
||||
@@ -17,6 +17,14 @@ import java.math.BigDecimal;
|
||||
@Data
|
||||
public class GenerateOrderDTO extends BasicPileDTO{
|
||||
private static final long serialVersionUID = -1374766807594759104L;
|
||||
|
||||
/**
|
||||
* 交易流水号
|
||||
* 无transactionCode, 表示由平台端启动充电, 平台自行生成交易流水号
|
||||
* 有transactionCode, 表示桩端主动启动充电, 平台使用桩端生成的交易流水号
|
||||
*/
|
||||
private String transactionCode;
|
||||
|
||||
/**
|
||||
* 会员id
|
||||
*/
|
||||
|
||||
@@ -5,6 +5,9 @@ import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 0x65预约充电启动结果封装对象
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@@ -31,7 +34,7 @@ public class ReservationChargingStartupResult {
|
||||
private String vinCode;
|
||||
|
||||
/**
|
||||
* 启动结果
|
||||
* 启动结果 0x00失败 0x01成功
|
||||
*/
|
||||
private String startupResult;
|
||||
|
||||
|
||||
@@ -471,4 +471,10 @@ public interface OrderBasicInfoService{
|
||||
* @param endTime
|
||||
*/
|
||||
List<BusinessOrderDetailInfoVO> getOrderDetailByStationIds(List<String> stationIds, String startTime, String endTime);
|
||||
|
||||
/**
|
||||
* 创建预约启动充电订单
|
||||
* @param chargingStartupResult
|
||||
*/
|
||||
void createReservationOrder(ReservationChargingStartupResult chargingStartupResult);
|
||||
}
|
||||
|
||||
@@ -3530,7 +3530,10 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
|
||||
@Override
|
||||
public OrderBasicInfo saveOrder2Database(GenerateOrderDTO dto) throws ParseException {
|
||||
String orderCode = generateNewOrderCode();
|
||||
String transactionCode = IdUtils.generateTransactionCode(dto.getPileSn(), dto.getConnectorCode());
|
||||
String transactionCode = dto.getTransactionCode();
|
||||
if (StringUtils.isBlank(transactionCode)) {
|
||||
transactionCode = IdUtils.generateTransactionCode(dto.getPileSn(), dto.getConnectorCode());
|
||||
}
|
||||
|
||||
if (StringUtils.isBlank(dto.getStartType())) {
|
||||
dto.setStartType(StartTypeEnum.NOW.getValue());
|
||||
@@ -3593,31 +3596,35 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
|
||||
// 订单详情
|
||||
BillingTemplateVO billingTemplate = dto.getBillingTemplate();
|
||||
logger.info("订单使用的计费模板-orderCode:{}, billingTemplate:{}", orderCode, JSON.toJSONString(billingTemplate));
|
||||
BigDecimal sharpElectricityPrice = billingTemplate.getSharpElectricityPrice() != null ? billingTemplate.getSharpElectricityPrice() : BigDecimal.ZERO;
|
||||
BigDecimal sharpServicePrice = billingTemplate.getSharpServicePrice() != null ? billingTemplate.getSharpServicePrice() : BigDecimal.ZERO;
|
||||
BigDecimal peakElectricityPrice = billingTemplate.getPeakElectricityPrice() != null ? billingTemplate.getPeakElectricityPrice() : BigDecimal.ZERO;
|
||||
BigDecimal peakServicePrice = billingTemplate.getPeakServicePrice() != null ? billingTemplate.getPeakServicePrice() : BigDecimal.ZERO;
|
||||
BigDecimal flatElectricityPrice = billingTemplate.getFlatElectricityPrice() != null ? billingTemplate.getFlatElectricityPrice() : BigDecimal.ZERO;
|
||||
BigDecimal flatServicePrice = billingTemplate.getFlatServicePrice() != null ? billingTemplate.getFlatServicePrice() : BigDecimal.ZERO;
|
||||
BigDecimal valleyElectricityPrice = billingTemplate.getValleyElectricityPrice() != null ? billingTemplate.getValleyElectricityPrice() : BigDecimal.ZERO;
|
||||
BigDecimal valleyServicePrice = billingTemplate.getValleyServicePrice() != null ? billingTemplate.getValleyServicePrice() : BigDecimal.ZERO;
|
||||
OrderDetail orderDetail = null;
|
||||
if (billingTemplate != null) {
|
||||
BigDecimal sharpElectricityPrice = billingTemplate.getSharpElectricityPrice() != null ? billingTemplate.getSharpElectricityPrice() : BigDecimal.ZERO;
|
||||
BigDecimal sharpServicePrice = billingTemplate.getSharpServicePrice() != null ? billingTemplate.getSharpServicePrice() : BigDecimal.ZERO;
|
||||
BigDecimal peakElectricityPrice = billingTemplate.getPeakElectricityPrice() != null ? billingTemplate.getPeakElectricityPrice() : BigDecimal.ZERO;
|
||||
BigDecimal peakServicePrice = billingTemplate.getPeakServicePrice() != null ? billingTemplate.getPeakServicePrice() : BigDecimal.ZERO;
|
||||
BigDecimal flatElectricityPrice = billingTemplate.getFlatElectricityPrice() != null ? billingTemplate.getFlatElectricityPrice() : BigDecimal.ZERO;
|
||||
BigDecimal flatServicePrice = billingTemplate.getFlatServicePrice() != null ? billingTemplate.getFlatServicePrice() : BigDecimal.ZERO;
|
||||
BigDecimal valleyElectricityPrice = billingTemplate.getValleyElectricityPrice() != null ? billingTemplate.getValleyElectricityPrice() : BigDecimal.ZERO;
|
||||
BigDecimal valleyServicePrice = billingTemplate.getValleyServicePrice() != null ? billingTemplate.getValleyServicePrice() : BigDecimal.ZERO;
|
||||
|
||||
OrderDetail orderDetail = OrderDetail.builder()
|
||||
.orderCode(orderCode)
|
||||
.sharpPrice(sharpElectricityPrice.add(sharpServicePrice))
|
||||
.sharpElectricityPrice(sharpElectricityPrice)
|
||||
.sharpServicePrice(sharpServicePrice)
|
||||
.peakPrice(peakElectricityPrice.add(peakServicePrice))
|
||||
.peakElectricityPrice(peakElectricityPrice)
|
||||
.peakServicePrice(peakServicePrice)
|
||||
.flatPrice(flatElectricityPrice.add(flatServicePrice))
|
||||
.flatElectricityPrice(flatElectricityPrice)
|
||||
.flatServicePrice(flatServicePrice)
|
||||
.valleyPrice(valleyElectricityPrice.add(valleyServicePrice))
|
||||
.valleyElectricityPrice(valleyElectricityPrice)
|
||||
.valleyServicePrice(valleyServicePrice)
|
||||
.build();
|
||||
orderDetail = OrderDetail.builder()
|
||||
.orderCode(orderCode)
|
||||
.sharpPrice(sharpElectricityPrice.add(sharpServicePrice))
|
||||
.sharpElectricityPrice(sharpElectricityPrice)
|
||||
.sharpServicePrice(sharpServicePrice)
|
||||
.peakPrice(peakElectricityPrice.add(peakServicePrice))
|
||||
.peakElectricityPrice(peakElectricityPrice)
|
||||
.peakServicePrice(peakServicePrice)
|
||||
.flatPrice(flatElectricityPrice.add(flatServicePrice))
|
||||
.flatElectricityPrice(flatElectricityPrice)
|
||||
.flatServicePrice(flatServicePrice)
|
||||
.valleyPrice(valleyElectricityPrice.add(valleyServicePrice))
|
||||
.valleyElectricityPrice(valleyElectricityPrice)
|
||||
.valleyServicePrice(valleyServicePrice)
|
||||
.build();
|
||||
}
|
||||
|
||||
// 保存到数据库
|
||||
OrderTransactionDTO createOrderTransactionDTO = OrderTransactionDTO.builder()
|
||||
.orderBasicInfo(orderBasicInfo)
|
||||
.orderDetail(orderDetail)
|
||||
@@ -3745,5 +3752,44 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
|
||||
return orderBasicInfoMapper.getOrderDetailByStationIds(stationIds, startTime, endTime);
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建预约订单/预约充电订单/
|
||||
* @param chargingStartupResult
|
||||
*/
|
||||
@Override
|
||||
public void createReservationOrder(ReservationChargingStartupResult chargingStartupResult) {
|
||||
String orderCode = generateNewOrderCode();
|
||||
String transactionCode = chargingStartupResult.getTransactionCode();
|
||||
|
||||
String status = StringUtils.equals(chargingStartupResult.getStartupResult(), "00")
|
||||
? OrderStatusEnum.IN_THE_CHARGING.getValue()
|
||||
: OrderStatusEnum.ORDER_CLOSE_TIMEOUT.getValue();
|
||||
|
||||
// 订单基本信息
|
||||
OrderBasicInfo orderBasicInfo = OrderBasicInfo.builder()
|
||||
.orderCode(orderCode)
|
||||
.transactionCode(transactionCode)
|
||||
.orderStatus(status)
|
||||
.pileSn(chargingStartupResult.getPileSn())
|
||||
.connectorCode(chargingStartupResult.getConnectorCode())
|
||||
.pileConnectorCode(chargingStartupResult.getPileSn() + chargingStartupResult.getConnectorCode())
|
||||
.startMode("6")
|
||||
.payStatus(Constants.TWO)
|
||||
.payMode(Constants.THREE)
|
||||
.orderAmount(BigDecimal.ZERO)
|
||||
.virtualAmount(BigDecimal.ZERO)
|
||||
.settleAmount(BigDecimal.ZERO)
|
||||
.startType(StartTypeEnum.RESERVED.getValue())
|
||||
.reason(chargingStartupResult.getFailReason())
|
||||
.build();
|
||||
|
||||
// 保存到数据库
|
||||
OrderTransactionDTO createOrderTransactionDTO = OrderTransactionDTO.builder()
|
||||
.orderBasicInfo(orderBasicInfo)
|
||||
.orderDetail(null)
|
||||
.build();
|
||||
pileTransactionService.doCreateOrder(createOrderTransactionDTO);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -90,6 +90,9 @@ public class PileBasicInfoServiceImpl implements PileBasicInfoService {
|
||||
@Autowired
|
||||
private WxAppletRemoteService wxAppletRemoteService;
|
||||
|
||||
@Autowired
|
||||
private OrderBasicInfoService orderBasicInfoService;
|
||||
|
||||
/**
|
||||
* 查询设备管理
|
||||
*
|
||||
@@ -1218,7 +1221,10 @@ public class PileBasicInfoServiceImpl implements PileBasicInfoService {
|
||||
*/
|
||||
@Override
|
||||
public void startupResult(ReservationChargingStartupResult chargingStartupResult) {
|
||||
// 创建订单
|
||||
orderBasicInfoService.createReservationOrder(chargingStartupResult);
|
||||
|
||||
// 小程序通知
|
||||
wxAppletRemoteService.reservationStartupResultSendMsg();
|
||||
wxAppletRemoteService.reservationStartupResultSendMsg(chargingStartupResult);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -184,7 +184,7 @@ public class PileReservationInfoServiceImpl implements PileReservationInfoServic
|
||||
.reservedEndTime(pileReservationInfo.getEndTime().toLocalTime())
|
||||
.amount(Constants.WHITELIST_DEFAULT_AMOUNT)
|
||||
.build();
|
||||
pileRemoteService.reservationCharging(command);
|
||||
// pileRemoteService.reservationCharging(command);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -235,7 +235,7 @@ public class PileReservationInfoServiceImpl implements PileReservationInfoServic
|
||||
.reservedEndTime(pileReservationInfo.getEndTime().toLocalTime())
|
||||
.amount(Constants.WHITELIST_DEFAULT_AMOUNT)
|
||||
.build();
|
||||
pileRemoteService.reservationCharging(command);
|
||||
// pileRemoteService.reservationCharging(command);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -413,12 +413,8 @@ public class PileReservationInfoServiceImpl implements PileReservationInfoServic
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* 操作
|
||||
* 0x01:启动 0x02:取消 0x03:修改
|
||||
*/
|
||||
// 操作 0x01:启动 0x02:取消 0x03:修改
|
||||
String operation = "03";
|
||||
|
||||
if (StringUtils.isNotBlank(dto.getStartTime())) {
|
||||
pileReservationInfo.setStartTime(Time.valueOf(dto.getStartTime()));
|
||||
operation = "03";
|
||||
@@ -427,6 +423,10 @@ public class PileReservationInfoServiceImpl implements PileReservationInfoServic
|
||||
pileReservationInfo.setEndTime(Time.valueOf(dto.getEndTime()));
|
||||
operation = "03";
|
||||
}
|
||||
if (StringUtils.isNotBlank(dto.getVerifyIdentity())) {
|
||||
pileReservationInfo.setVerifyIdentity(dto.getVerifyIdentity());
|
||||
operation = "03";
|
||||
}
|
||||
if (StringUtils.isNotBlank(dto.getStatus())) {
|
||||
pileReservationInfo.setStatus(dto.getStatus());
|
||||
if (StringUtils.equals(dto.getStatus(), Constants.ZERO)) {
|
||||
@@ -437,12 +437,11 @@ public class PileReservationInfoServiceImpl implements PileReservationInfoServic
|
||||
operation = "01";
|
||||
}
|
||||
}
|
||||
if (StringUtils.isNotBlank(dto.getVerifyIdentity())) {
|
||||
pileReservationInfo.setVerifyIdentity(dto.getVerifyIdentity());
|
||||
}
|
||||
pileReservationInfo.setUpdateBy(dto.getMemberId());
|
||||
this.insertOrUpdateSelective(pileReservationInfo);
|
||||
|
||||
/*
|
||||
先发送指令, 收到回复更新数据库
|
||||
*/
|
||||
// 查询会员的绑定vin列表 2024年7月30日11点04分 以当前请求会员的VIN为准
|
||||
List<MemberPlateNumberVO> plateNumberVOList = memberPlateNumberRelationService.selectMemberPlateNumberRelation(dto.getMemberId());
|
||||
List<String> vinCodes = Lists.newArrayList();
|
||||
@@ -457,10 +456,7 @@ public class PileReservationInfoServiceImpl implements PileReservationInfoServic
|
||||
while (vinCodes.size() < 3) {
|
||||
vinCodes.add("");
|
||||
}
|
||||
|
||||
String type = StringUtils.equals(pileReservationInfo.getReservationType(), "single") ? "00" : "01";
|
||||
|
||||
// 发送指令
|
||||
ReservationChargingCommand command = ReservationChargingCommand.builder()
|
||||
.transactionCode(Constants.ILLEGAL_TRANSACTION_CODE)
|
||||
.pileSn(pileReservationInfo.getPileSn())
|
||||
@@ -476,6 +472,11 @@ public class PileReservationInfoServiceImpl implements PileReservationInfoServic
|
||||
.amount(Constants.WHITELIST_DEFAULT_AMOUNT)
|
||||
.build();
|
||||
pileRemoteService.reservationCharging(command);
|
||||
|
||||
// 从redis中获取回复, 3秒没有获取到判为超时
|
||||
|
||||
|
||||
this.insertOrUpdateSelective(pileReservationInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -56,9 +56,9 @@ public class YKCPushCommandServiceImpl implements YKCPushCommandService {
|
||||
// 需要记录报文的数据帧类型
|
||||
private final List<String> frameTypeList = Lists.newArrayList(
|
||||
YKCUtils.frameType2Str(YKCFrameTypeCode.REMOTE_RESTART_CODE.getBytes()),
|
||||
YKCUtils.frameType2Str(YKCFrameTypeCode.REMOTE_CONTROL_START_CODE.getBytes()),
|
||||
YKCUtils.frameType2Str(YKCFrameTypeCode.REMOTE_STOP_CHARGING_CODE.getBytes()),
|
||||
YKCUtils.frameType2Str(YKCFrameTypeCode.RESERVATION_CHARGING_CODE.getBytes())
|
||||
YKCUtils.frameType2Str(YKCFrameTypeCode.REMOTE_CONTROL_START_CHARGING_CODE.getBytes()),
|
||||
YKCUtils.frameType2Str(YKCFrameTypeCode.REMOTE_CONTROL_STOP_CHARGING_CODE.getBytes()),
|
||||
YKCUtils.frameType2Str(YKCFrameTypeCode.RESERVATION_CHARGING_SETUP_CODE.getBytes())
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -77,8 +77,8 @@ public class YKCPushCommandServiceImpl implements YKCPushCommandService {
|
||||
log.error("push命令[{}]失败, 桩号:{}无法获取到长连接, 请检查充电桩连接状态!", value, pileSn);
|
||||
return false;
|
||||
}
|
||||
/**
|
||||
* 拼接报文
|
||||
/*
|
||||
拼接报文
|
||||
*/
|
||||
// 起始标志
|
||||
byte[] head = new byte[]{0x68};
|
||||
@@ -100,11 +100,12 @@ public class YKCPushCommandServiceImpl implements YKCPushCommandService {
|
||||
|
||||
// 帧校验域
|
||||
byte[] crc = BytesUtil.intToBytes(CRC16Util.calcCrc16(temp));
|
||||
|
||||
// 返回报文
|
||||
byte[] writeMsg = Bytes.concat(head, length, temp, crc);
|
||||
|
||||
// 返回完整的报文 string类型
|
||||
String wholeMsg = BytesUtil.binary(writeMsg, 16);
|
||||
// log.info("[" + channel.remoteAddress() + "] 主动发送push请求信息:{}", wholeMsg);
|
||||
ByteBuf byteBuf = channel.alloc().buffer().writeBytes(writeMsg);
|
||||
ChannelFuture channelFuture = channel.writeAndFlush(byteBuf);
|
||||
channelFuture.addListener((ChannelFutureListener) channelFutureListener -> {
|
||||
@@ -176,7 +177,7 @@ public class YKCPushCommandServiceImpl implements YKCPushCommandService {
|
||||
byte[] accountBalanceByteArr = YKCUtils.getPriceByte(chargeAmount.toString(), 2);
|
||||
|
||||
byte[] msgBody = Bytes.concat(orderIdByteArr, pileSnByteArr, connectorCodeByteArr, logicCardNumByteArr, physicsCardNumByteArr, accountBalanceByteArr);
|
||||
this.push(msgBody, pileSn, YKCFrameTypeCode.REMOTE_CONTROL_START_CODE);
|
||||
this.push(msgBody, pileSn, YKCFrameTypeCode.REMOTE_CONTROL_START_CHARGING_CODE);
|
||||
log.info("【=====平台下发充电指令=====】:订单id:{}, 桩号:{}, 枪口号:{}, 逻辑卡号:{}, 物理卡号:{}, 账户余额:{}",
|
||||
transactionCode, pileSn, BytesUtil.bcd2Str(connectorCodeByteArr), logicCardNum, physicsCardNum, chargeAmount);
|
||||
}
|
||||
@@ -192,7 +193,7 @@ public class YKCPushCommandServiceImpl implements YKCPushCommandService {
|
||||
String connectorCode = command.getConnectorCode();
|
||||
// 远程停机
|
||||
byte[] msgBody = Bytes.concat(BytesUtil.str2Bcd(pileSn), BytesUtil.str2Bcd(connectorCode));
|
||||
this.push(msgBody, pileSn, YKCFrameTypeCode.REMOTE_STOP_CHARGING_CODE);
|
||||
this.push(msgBody, pileSn, YKCFrameTypeCode.REMOTE_CONTROL_STOP_CHARGING_CODE);
|
||||
log.info("【=====平台下发指令=====】:远程停止充电,桩号:{},枪口号:{}", pileSn, connectorCode);
|
||||
}
|
||||
|
||||
@@ -474,7 +475,7 @@ public class YKCPushCommandServiceImpl implements YKCPushCommandService {
|
||||
// 拼装msg信息
|
||||
byte[] msg = Bytes.concat(pileSnByteArr, connectorCodeByteArr, operateByteArr, obligateByteArr);
|
||||
|
||||
this.push(msg, pileSn, YKCFrameTypeCode.REMOTE_CONTROL_GROUND_LOCK_LIFTING_CODE);
|
||||
this.push(msg, pileSn, YKCFrameTypeCode.REMOTE_CONTROL_GROUND_LOCK_CODE);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -539,7 +540,7 @@ public class YKCPushCommandServiceImpl implements YKCPushCommandService {
|
||||
reservationTypeByteArr, verifyIdentityByteArr, vin1ByteArr, vin2ByteArr, vin3ByteArr,
|
||||
reservedStartTimeByteArr, reservedEndTimeByteArr, amountByteArr);
|
||||
|
||||
this.push(msg, pileSn, YKCFrameTypeCode.RESERVATION_CHARGING_CODE);
|
||||
this.push(msg, pileSn, YKCFrameTypeCode.RESERVATION_CHARGING_SETUP_CODE);
|
||||
|
||||
log.info("【=====平台下发指令=====】: 预约充电指令, 交易流水号:{}, 桩编号:{}, 枪口号:{}, 操作:{}, 身份验证:{}, 开始时间:{}, 结束时间:{}, 启动金额:{}",
|
||||
transactionCode, pileSn, connectorCode, operation, verifyIdentity, DateUtils.formatDateTime(reservedStartTime), DateUtils.formatDateTime(reservedEndTime), amount);
|
||||
|
||||
@@ -242,6 +242,9 @@ public abstract class AbstractProgramLogic implements InitializingBean {
|
||||
BigDecimal orderAmount = orderBasicInfo.getOrderAmount();
|
||||
// 更新订单详情 查询订单详情 修改订单数据
|
||||
OrderDetail orderDetail = orderBasicInfoService.getOrderDetailByOrderCode(orderCode);
|
||||
if (orderDetail == null) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
// 总电费金额
|
||||
BigDecimal totalElectricityAmount = BigDecimal.ZERO;
|
||||
@@ -612,6 +615,12 @@ public abstract class AbstractProgramLogic implements InitializingBean {
|
||||
String stationId = orderBasicInfo.getStationId(); // 站点id
|
||||
String merchantId = orderBasicInfo.getMerchantId(); // 运营商id
|
||||
|
||||
if (orderDetail == null) {
|
||||
logger.info("计算订单折扣V2, OrderDetail为空(orderCode:{}, transactionCode:{}), 直接返回!",
|
||||
orderBasicInfo.getOrderCode(), orderBasicInfo.getTransactionCode());
|
||||
return;
|
||||
}
|
||||
|
||||
// 原始电费金额
|
||||
BigDecimal originalTotalElectricityAmount = orderDetail.getTotalElectricityAmount();
|
||||
// 原始服务费金额
|
||||
|
||||
@@ -71,7 +71,10 @@ public class DelayMerchantProgramLogic extends AbstractProgramLogic {
|
||||
orderBasicInfoService.analysisPileParameter(dto);
|
||||
|
||||
// 校验充电桩相关的信息
|
||||
orderBasicInfoService.checkPileInfo(dto);
|
||||
if (StringUtils.isBlank(dto.getTransactionCode())) {
|
||||
// 无transactionCode, 表示由平台端启动充电, 需要验证充电桩状态
|
||||
orderBasicInfoService.checkPileInfo(dto);
|
||||
}
|
||||
|
||||
// 保存订单到数据库 saveOrder2Database
|
||||
return orderBasicInfoService.saveOrder2Database(dto);
|
||||
@@ -430,7 +433,8 @@ public class DelayMerchantProgramLogic extends AbstractProgramLogic {
|
||||
// 从redis中取出实时记录保存到表中
|
||||
realTimeMonitorDataRedis2DB(orderBasicInfo.getTransactionCode(), orderBasicInfo.getOrderCode());
|
||||
|
||||
logger.info("结算订单end:{} OrderTransactionDTO:{}", orderBasicInfo.getOrderCode(), JSON.toJSONString(dto));
|
||||
logger.info("结算订单end! orderCode:{}, transactionCode:{}, OrderTransactionDTO:{}",
|
||||
orderBasicInfo.getOrderCode(), orderBasicInfo.getTransactionCode(), JSON.toJSONString(dto));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -72,7 +72,10 @@ public class NotDelayMerchantProgramLogic extends AbstractProgramLogic {
|
||||
orderBasicInfoService.analysisPileParameter(dto);
|
||||
|
||||
// 校验充电桩相关的信息
|
||||
orderBasicInfoService.checkPileInfo(dto);
|
||||
if (StringUtils.isBlank(dto.getTransactionCode())) {
|
||||
// 无transactionCode, 表示由平台端启动充电, 需要验证充电桩状态
|
||||
orderBasicInfoService.checkPileInfo(dto);
|
||||
}
|
||||
|
||||
// 保存订单到数据库 saveOrder2Database
|
||||
return orderBasicInfoService.saveOrder2Database(dto);
|
||||
|
||||
@@ -3,13 +3,15 @@ package com.jsowell.wxpay.config;
|
||||
|
||||
import com.jsowell.wxpay.common.WeChatPayParameter;
|
||||
import com.jsowell.wxpay.utils.WechatPayUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.CommandLineRunner;
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Order(3)
|
||||
@Slf4j
|
||||
@Component
|
||||
@Order(5)
|
||||
public class WechatPayConfig implements CommandLineRunner {
|
||||
/**
|
||||
* 公众号appid
|
||||
@@ -78,7 +80,6 @@ public class WechatPayConfig implements CommandLineRunner {
|
||||
|
||||
@Override
|
||||
public void run(String... args) throws Exception {
|
||||
System.out.println(">>>>>>>>>>>>>>>服务启动执行,执行加载数据等操作 WechatPayConfig order 3 <<<<<<<<<<<<<");
|
||||
//微信支付
|
||||
WeChatPayParameter.mchId = wechatMchId;
|
||||
WeChatPayParameter.appId = wechatAppId;
|
||||
@@ -94,5 +95,6 @@ public class WechatPayConfig implements CommandLineRunner {
|
||||
WeChatPayParameter.mchSerialNo = mchSerialNo;
|
||||
//获取平台证书
|
||||
WeChatPayParameter.certificateMap = WechatPayUtils.refreshCertificate();
|
||||
log.info(">>>>>>>>>>>>>>>服务启动执行,执行加载数据等操作 WechatPayConfig order 5 <<<<<<<<<<<<<");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ import com.jsowell.common.util.DateUtils;
|
||||
import com.jsowell.common.util.StringUtils;
|
||||
import com.jsowell.common.util.http.HttpUtils;
|
||||
import com.jsowell.pile.domain.MemberBasicInfo;
|
||||
import com.jsowell.pile.dto.ReservationChargingStartupResult;
|
||||
import com.jsowell.pile.service.MemberBasicInfoService;
|
||||
import com.jsowell.pile.service.PileBillingTemplateService;
|
||||
import com.jsowell.pile.service.OrderBasicInfoService;
|
||||
@@ -277,7 +278,7 @@ public class WxAppletRemoteService {
|
||||
/**
|
||||
* 预约充电结果小程序服务通知
|
||||
*/
|
||||
public Map<String, String> reservationStartupResultSendMsg() {
|
||||
public Map<String, String> reservationStartupResultSendMsg(ReservationChargingStartupResult chargingStartupResult) {
|
||||
AppletTemplateMessageSendDTO msgInfo = new AppletTemplateMessageSendDTO();
|
||||
return uniAppSendMsg(msgInfo);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user