skyline 2 yıl önce
ebeveyn
işleme
c1f8317162

+ 0 - 16
service/src/main/java/com/kym/service/admin/IContactService.java

@@ -1,16 +0,0 @@
-package com.kym.service.admin;
-
-import com.kym.entity.admin.Contact;
-import com.baomidou.mybatisplus.extension.service.IService;
-
-/**
- * <p>
- *  服务类
- * </p>
- *
- * @author skyline
- * @since 2023-08-15
- */
-public interface IContactService extends IService<Contact> {
-
-}

+ 2 - 5
service/src/main/java/com/kym/service/admin/impl/StationServiceImpl.java

@@ -15,8 +15,6 @@ import com.kym.service.admin.EquipmentInfoService;
 import com.kym.service.admin.StationService;
 import com.kym.service.enplus.EnPlusService;
 import com.kym.service.utils.KymCache;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 import org.springframework.beans.BeanUtils;
 import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Service;
@@ -38,7 +36,6 @@ import java.util.List;
 @DS("db-admin")
 public class StationServiceImpl extends ServiceImpl<StationMapper, Station> implements StationService {
 
-    private static final Logger LOGGER = LoggerFactory.getLogger(StationServiceImpl.class);
     private final KymCache kymCache;
 
     private final EquipmentInfoService equipmentInfoService;
@@ -117,7 +114,7 @@ public class StationServiceImpl extends ServiceImpl<StationMapper, Station> impl
         var stationList = new ArrayList<Station>();
         var equipmentList = new ArrayList<EquipmentInfo>();
         stationVoList.forEach(vo -> {
-            if(vo.getEquipmentInfos().size()>0){
+            if (vo.getEquipmentInfos().size() > 0) {
                 vo.getEquipmentInfos().forEach(item -> {
                     var equipment = new EquipmentInfo()
                             .setStationId(vo.getStationId())
@@ -132,7 +129,7 @@ public class StationServiceImpl extends ServiceImpl<StationMapper, Station> impl
             BeanUtils.copyProperties(vo, station);
             stationList.add(station);
         });
-        // saveBatch(stationList);
+        saveBatch(stationList);
         equipmentInfoService.saveBatch(equipmentList);
     }
 

+ 5 - 5
service/src/main/java/com/kym/service/enplus/impl/EnNotifyServiceImpl.java

@@ -226,7 +226,7 @@ public class EnNotifyServiceImpl implements EnNotifyService {
         var startChargeSeq = data.getString("StartChargeSeq");
         var chargeOrder = chargeOrderService.getChargingOrderByStartChargeSeq(startChargeSeq);
         // EN+平台推送重试策略是当天失败第二天再推送一次,仅此一次。EN+订单页面可以多次手动推送,所以这里要先判断订单状态,避免重复处理。
-        if (chargeOrder.getChargeStatus() != 4) {
+        if (chargeOrder.getChargeStatus() != ChargeOrder.CHARGE_STATUS_已结束) {
             // 更新订单信息
             chargeOrder.setEndTime(LocalDateTime.parse(data.getString("EndTime"), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
             chargeOrder.setTotalPower(data.getDoubleValue("TotalPower"));
@@ -237,9 +237,9 @@ public class EnNotifyServiceImpl implements EnNotifyService {
             chargeOrder.setSumPeriod(data.getIntValue("SumPeriod"));
             chargeOrder.setChargeDetail(data.getString("ChargeDetails"));
             // 订单成功
-            chargeOrder.setOrderStatus(1);
+            chargeOrder.setOrderStatus(ChargeOrder.ORDER_STATUS_成功);
             // 充电结束
-            chargeOrder.setChargeStatus(4);
+            chargeOrder.setChargeStatus(ChargeOrder.CHARGE_STATUS_已结束);
             chargeOrderService.updateById(chargeOrder);
 
             // 扣费
@@ -252,11 +252,11 @@ public class EnNotifyServiceImpl implements EnNotifyService {
             walletDetail.setUserId(chargeOrder.getUserId());
             walletDetail.setOrderNo(startChargeSeq);
             // 消费
-            walletDetail.setType(3);
+            walletDetail.setType(WalletDetail.TYPE_消费);
             walletDetail.setAmount(chargeOrder.getTotalMoney());
             walletDetail.setTransactionTime(LocalDateTime.parse(data.getString("EndTime"), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
             // 已确认
-            walletDetail.setStatus(1);
+            walletDetail.setStatus(WalletDetail.STATUS_已确认);
             walletDetailService.save(walletDetail);
         }
         return """