ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/TChargingPileServiceImpl.java
@@ -27,6 +27,7 @@ import com.ruoyi.common.core.web.page.PageInfo; import com.ruoyi.common.redis.service.RedisService; import com.ruoyi.common.security.utils.SecurityUtils; import com.ruoyi.integration.api.feignClient.IntegrationClient; import com.ruoyi.integration.api.feignClient.IotInterfaceClient; import com.ruoyi.integration.api.feignClient.UploadRealTimeMonitoringDataClient; import com.ruoyi.integration.api.model.UploadRealTimeMonitoringData; @@ -106,6 +107,9 @@ @Resource private TFaultMessageService faultMessageService; @Resource private IntegrationClient integrationClient; @@ -284,6 +288,11 @@ tChargingGun.setAccountingStrategyId(setAccountingStrategy.getAccountingStrategyId()); } chargingGunService.updateBatchById(list); //下发硬件更新计费模板 for (TChargingPile chargingPile : this.listByIds(id)) { integrationClient.setupBillingModel1(chargingPile.getCode()); } } @Override ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/controller/ChargingHandshakeController.java
@@ -29,7 +29,7 @@ */ @PostMapping("/getDataByOrderCode") public R<ChargingHandshake> getDataByOrderCode(@RequestParam("code") String code){ ChargingHandshake chargingHandshake = chargingHandshakeService.findById(code); ChargingHandshake chargingHandshake = chargingHandshakeService.getDataByOrderCode(code); return R.ok(chargingHandshake); } } ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/mongodb/service/ChargingHandshakeService.java
@@ -5,5 +5,7 @@ public interface ChargingHandshakeService extends BaseService<ChargingHandshake> { ChargingHandshake getDataByOrderCode(String code); } ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/mongodb/service/impl/ChargingHandshakeServiceImpl.java
@@ -5,8 +5,14 @@ import com.ruoyi.integration.mongodb.service.ChargingHandshakeService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.mongodb.core.MongoTemplate; import org.springframework.data.mongodb.core.query.Criteria; import org.springframework.data.mongodb.core.query.Query; import org.springframework.stereotype.Service; import java.time.LocalDateTime; import java.time.ZoneId; import java.time.ZonedDateTime; import java.time.format.DateTimeFormatter; import java.util.List; @Service @@ -28,4 +34,10 @@ public List<ChargingHandshake> findAll() { return mongoTemplate.findAll(ChargingHandshake.class); } @Override public ChargingHandshake getDataByOrderCode(String code) { List<ChargingHandshake> charging_gun_code = mongoTemplate.find(new Query().addCriteria(Criteria.where("transaction_serial_number").is(code)), ChargingHandshake.class); return charging_gun_code.size() > 0 ? charging_gun_code.get(0) : null; } } ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TChargingOrderServiceImpl.java
@@ -539,6 +539,7 @@ chargingOrder.setRechargePaymentStatus(2); chargingOrder.setRechargeSerialNumber(transaction_id); chargingOrder.setStatus(2); chargingOrder.setPayTime(LocalDateTime.now()); //添加安全检测数据到缓存中,每步安全检测完成后需要更新缓存数据 PreChargeCheck preChargeCheck = new PreChargeCheck(); @@ -796,8 +797,11 @@ one.setRefundStatus(2); one.setRefundTime(LocalDateTime.now()); chargingOrderRefundService.updateById(one); TChargingOrder chargingOrder = this.getById(one.getChargingOrderId()); chargingOrder.setPayTime(LocalDateTime.now()); chargingOrder.setRefundStatus(2); chargingOrder.setRefundSerialNumber(refund_id); chargingOrder.setRefundTime(LocalDateTime.now()); this.updateById(chargingOrder); return AjaxResult.success(); } @@ -840,6 +844,7 @@ Integer m = Integer.valueOf(data.getCumulative_charging_time() % 60); chargingDetails.setChargedTime(String.format("%02d", h) + ":" + String.format("%02d", m)); } //转换成UTC时间 ChargingHandshake chargingHandshake = chargingHandshakeClient.getDataByOrderCode(one.getCode()).getData(); if(null != chargingHandshake && null != data && null != one.getAppUserCarId()){ BigDecimal bms_battery_capacity = chargingHandshake.getBms_battery_capacity(); @@ -1967,8 +1972,6 @@ SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-DDTHH:mm:ss+TIMEZONE"); AjaxResult success = chargingOrderStartupFailureWxRefund(resp.getOutTradeNo(), resp.getTradeNo(), "SUCCESS", sdf1.format(new Date())); if(success.isSuccess()){ chargingOrder.setPayTime(LocalDateTime.now()); this.updateById(chargingOrder); chargingOrderRefundService.save(chargingOrderRefund); } }