skyline 7 ヶ月 前
コミット
7b556c72ff

+ 1 - 1
admin-web/src/stores/themeConfig.ts

@@ -139,7 +139,7 @@ export const useThemeConfig = defineStore('themeConfig', {
              * 全局网站标题 / 副标题
              */
             // 网站主标题(菜单导航、浏览器当前网页标题)
-            globalTitle: 'Yeswash运营平台',
+            globalTitle: '超级进化车生活',
             // 网站副标题(登录页顶部文字)
             globalViceTitle: '',
             // 网站副标题(登录页顶部文字)

+ 3 - 2
admin-web/src/views/admin/station/device/index.vue

@@ -141,6 +141,7 @@ const state = reactive({
         )
       }
     },
+    {label: '平台费率', prop: 'feeRateName', width: 120, query: true, type: 'text', resizable: true, fixed: 'left'},
     // {label: '设备名称', prop: 'deviceName', width: 180, query: true, type: 'text', resizable: true, fixed: 'left'},
     // {label: '产品key', prop: 'productKey', width: 180, query: true, type: 'text', resizable: true},
     {label: '状态', prop: 'state', width: 90, query: true, type: 'dict', conf: {dict: 'WashDevice.status'}, resizable: true},
@@ -154,8 +155,8 @@ const state = reactive({
       }
     },
     {label: '功能', prop: 'functions', width: 180, query: true, type: 'text', resizable: true},
-    {label: '是否有泡沫', prop: 'hasFoam', width: 180, query: true, type: 'dict', conf: {dict: 'WashDevice.foam'}, resizable: true},
-    {label: '是否有水', prop: 'hasWater', width: 180, query: true, type: 'dict', conf: {dict: 'WashDevice.water'}, resizable: true},
+    {label: '是否有泡沫', prop: 'hasFoam', width: 120, query: true, type: 'dict', conf: {dict: 'WashDevice.foam'}, resizable: true},
+    {label: '是否有水', prop: 'hasWater', width: 120, query: true, type: 'dict', conf: {dict: 'WashDevice.water'}, resizable: true},
     // {label: '当前温度', prop: 'temperatureChip', width: 180, query: false, type: 'text', resizable: true},
     {label: '创建时间', prop: 'createTime', query: false, sortable: 'custom', type: 'datetime', resizable: true, conf: {format: (val: any) => u.fmt.fmtDateTime(val)}},
     {label: '更新时间', prop: 'updateTime', query: false, sortable: 'custom', type: 'datetime', resizable: true, conf: {format: (val: any) => u.fmt.fmtDateTime(val)}},

+ 5 - 0
car-wash-entity/src/main/java/com/kym/entity/StationFeeRate.java

@@ -31,6 +31,11 @@ public class StationFeeRate extends BaseEntity {
      */
     private Long feeRateId;
 
+    /**
+     * 平台费率名称
+     */
+    private String feeRateName;
+
     /**
      * 平台费率(0.1代表10%)
      */

+ 10 - 0
car-wash-entity/src/main/java/com/kym/entity/vo/WashDeviceVo.java

@@ -32,6 +32,16 @@ public class WashDeviceVo extends BaseEntity {
      */
     private String stationName;
 
+    /**
+     * 平台-费率配置id
+     */
+    private Long feeRateId;
+
+    /**
+     * 平台-费率配置名称
+     */
+    private String feeRateName;
+
     /**
      * 站点编号
      */

+ 1 - 1
car-wash-miniapp/src/main/java/com/kym/miniapp/controller/PaymentController.java

@@ -32,7 +32,7 @@ public class PaymentController {
      * @param rechargeConfigId
      * @return
      */
-    @ApiLog("微信支付")
+    @ApiLog("用户充值微信支付")
     @GetMapping("/wxPay")
     @ResponseBody
     R<?> prepay(@RequestParam Long rechargeConfigId, @RequestParam(value = "stationId", defaultValue = "000") String stationId) { //todo 前端更新后修改

+ 12 - 18
car-wash-service/src/main/java/com/kym/service/impl/WashDeviceServiceImpl.java

@@ -4,12 +4,14 @@ import cn.dev33.satoken.stp.StpUtil;
 import com.github.pagehelper.PageHelper;
 import com.kym.common.exception.BusinessException;
 import com.kym.common.utils.CommUtil;
+import com.kym.entity.StationFeeRate;
 import com.kym.entity.WashDevice;
 import com.kym.entity.WashOrder;
 import com.kym.entity.common.PageBean;
 import com.kym.entity.queryParams.DeviceQueryParams;
 import com.kym.entity.vo.WashDeviceVo;
 import com.kym.mapper.WashDeviceMapper;
+import com.kym.service.StationFeeRateService;
 import com.kym.service.WashDeviceService;
 import com.kym.service.WashOrderService;
 import com.kym.service.cache.KymCache;
@@ -19,6 +21,8 @@ import org.springframework.stereotype.Service;
 
 import java.util.ArrayList;
 import java.util.List;
+import java.util.function.Function;
+import java.util.stream.Collectors;
 
 /**
  * <p>
@@ -33,8 +37,11 @@ public class WashDeviceServiceImpl extends MyBaseServiceImpl<WashDeviceMapper, W
 
     private WashOrderService washOrderService;
 
-    public WashDeviceServiceImpl(WashOrderService washOrderService) {
+    private StationFeeRateService stationFeeRateService;
+
+    public WashDeviceServiceImpl(WashOrderService washOrderService,StationFeeRateService stationFeeRateService) {
         this.washOrderService = washOrderService;
+        this.stationFeeRateService = stationFeeRateService;
     }
 
 
@@ -64,23 +71,6 @@ public class WashDeviceServiceImpl extends MyBaseServiceImpl<WashDeviceMapper, W
             vo.setShortId(KymCache.INSTANCE.getShortIdByProductKeyAndDeviceName(washDevice.getProductKey(), washDevice.getDeviceName()));
             vo.setSeqName(KymCache.INSTANCE.getSeqNameByShortId(vo.getShortId()));
             voList.add(vo);
-
-            // TODO 测试数据,上线前删除
-            voList.add(vo);
-            voList.add(vo);
-            voList.add(vo);
-            voList.add(vo);
-            voList.add(vo);
-            voList.add(vo);
-            voList.add(vo);
-            voList.add(vo);
-            voList.add(vo);
-            voList.add(vo);
-            voList.add(vo);
-            voList.add(vo);
-            voList.add(vo);
-            voList.add(vo);
-            voList.add(vo);
         }
         return voList;
     }
@@ -176,12 +166,16 @@ public class WashDeviceServiceImpl extends MyBaseServiceImpl<WashDeviceMapper, W
         List<WashDevice> list = lambdaQuery()
                 .eq(CommUtil.isNotEmptyAndNull(query.getStationId()), WashDevice::getStationId, query.getStationId())
                 .list();
+        // 获取站点-费率配置Map
+        var stationId2FeeRate = stationFeeRateService.lambdaQuery().in(StationFeeRate::getStationId, list.stream().map(WashDevice::getStationId).toList()).list().stream().collect(Collectors.toMap(StationFeeRate::getStationId, Function.identity()));
         var voList = new ArrayList<WashDeviceVo>();
         list.forEach(item -> {
             var vo = new WashDeviceVo();
             BeanUtils.copyProperties(item, vo);
             vo.setShortId(KymCache.INSTANCE.getShortIdByProductKeyAndDeviceName(item.getProductKey(), item.getDeviceName()));
             vo.setStationName(KymCache.INSTANCE.getStationNameById(item.getStationId()));
+            vo.setFeeRateId(stationId2FeeRate.get(item.getStationId()).getId());
+            vo.setFeeRateName(stationId2FeeRate.get(item.getStationId()).getFeeRateName());
             voList.add(vo);
         });
         return new PageBean<>(voList);