Pārlūkot izejas kodu

feat(business): 添加电站峰时段时间字段及相关数据库映射

- 为 StationInfoVO 类新增 peakTime 字段,表示峰时段时间
- 更新数据库映射文件 ThirdPartyStationInfoMapper.xml,新增 peak_time 字段映射
-
SheepHy 1 dienu atpakaļ
vecāks
revīzija
8806e3d11d

+ 4 - 1
src/main/java/com/zsElectric/boot/business/model/vo/StationInfoVO.java

@@ -40,9 +40,12 @@ public class StationInfoVO implements Serializable {
     @Schema(description = "慢充(格式:空闲/总数)")
     private String slowCharging;
 
-    @Schema(description = "峰值")
+    @Schema(description = "当前峰值")
     private String peakValue;
 
+    @Schema(description = "峰时段时间")
+    private String peakTime;
+
     @Schema(description = "平台价")
     private BigDecimal platformPrice;
 

+ 0 - 1
src/main/java/com/zsElectric/boot/security/provider/WxMiniAppPhoneCodeAuthenticationProvider.java

@@ -5,7 +5,6 @@ import cn.binarywang.wx.miniapp.bean.WxMaPhoneNumberInfo;
 import cn.hutool.core.util.StrUtil;
 import com.zsElectric.boot.business.model.entity.UserInfo;
 import com.zsElectric.boot.business.service.UserInfoService;
-import com.zsElectric.boot.security.model.AppletUserDetails;
 import com.zsElectric.boot.security.model.WxMiniAppPhoneCodeAuthenticationToken;
 import lombok.extern.slf4j.Slf4j;
 import me.chanjar.weixin.common.error.WxErrorException;

+ 0 - 1
src/main/java/com/zsElectric/boot/security/util/SecurityUtils.java

@@ -4,7 +4,6 @@ import cn.hutool.core.collection.CollectionUtil;
 import cn.hutool.core.util.StrUtil;
 import com.zsElectric.boot.common.constant.SecurityConstants;
 import com.zsElectric.boot.common.constant.SystemConstants;
-import com.zsElectric.boot.security.model.AppletUserDetails;
 import com.zsElectric.boot.security.model.SysUserDetails;
 import jakarta.servlet.http.HttpServletRequest;
 import org.springframework.http.HttpHeaders;

+ 12 - 0
src/main/resources/mapper/business/ThirdPartyStationInfoMapper.xml

@@ -144,6 +144,7 @@
         <result property="fastCharging" column="fast_charging"/>
         <result property="slowCharging" column="slow_charging"/>
         <result property="peakValue" column="peak_value"/>
+        <result property="peakTime" column="peak_time"/>
         <result property="platformPrice" column="platform_price"/>
         <result property="enterprisePrice" column="enterprise_price"/>
     </resultMap>
@@ -194,6 +195,17 @@
                 ORDER BY tppi.start_time DESC
                 LIMIT 1
             ) AS peak_value,
+            <!-- 峰时段时间(period_flag=2为峰时段) -->
+            (
+                SELECT tppi.start_time
+                FROM third_party_policy_info tppi
+                INNER JOIN third_party_equipment_price_policy tpepp ON tppi.price_policy_id = tpepp.id AND tpepp.is_deleted = 0
+                INNER JOIN third_party_connector_info tpci5 ON tpepp.connector_id = tpci5.connector_id AND tpci5.is_deleted = 0
+                WHERE tpci5.station_id = tpsi.station_id
+                    AND tppi.is_deleted = 0
+                    AND tppi.period_flag = 2
+                LIMIT 1
+            ) AS peak_time,
             <!-- 平台价(电费+服务费+运营费+综合销售费) -->
             (
                 SELECT