Browse Source

fix设备管理费查询

tanbin 1 năm trước cách đây
mục cha
commit
1f9d41b849

+ 37 - 0
device-api-service/src/main/java/com/xy/service/MercExtraFeeService.java

@@ -0,0 +1,37 @@
+package com.xy.service;
+
+import com.xy.annotate.RestMappingController;
+import com.xy.dto.DeviceInfoDto;
+import com.xy.dto.MercFeeExtraDTO;
+import com.xy.utils.R;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.RequiredArgsConstructor;
+import org.springframework.stereotype.Service;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+
+import javax.validation.Valid;
+
+/**
+ * 商户扩展费用
+ *
+ * @author 谭斌
+ * @date 2024/04/15
+ */
+@Service
+@RequiredArgsConstructor
+@Api(tags = "商户扩展费用-各种类型")
+@RestMappingController("merc/fee/extra")
+public class MercExtraFeeService {
+
+    private final DeviceInfoServiceImpl deviceInfoService;
+
+    @ApiOperation("按类型获取费用")
+    @PostMapping("getByType")
+    public R getByType(@RequestBody @Valid MercFeeExtraDTO.Query q) {
+        return R.ok();
+    }
+
+
+}

+ 7 - 6
device-api-service/src/main/resources/mapper/DeviceChargingMapper.xml

@@ -1,7 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.xy.mapper.DeviceChargingMapper">
-
     <resultMap id="queryPageMap" type="com.xy.dto.DeviceChargingDto$PageVo">
         <association property="deviceInfo" javaType="com.xy.dto.DeviceInfoDto$Vo">
             <id column="device_id" property="deviceId"/>
@@ -29,16 +28,18 @@
             </association>
         </association>
         <association property="deviceCharging" javaType="com.xy.dto.DeviceChargingDto$Vo">
-            <result column="charging_sum_money" property="chargingSumMoney" />
-            <result column="timeout" property="timeout" />
-            <result column="last_charging_time" property="lastChargingTime" />
-            <result column="charging_create_time" property="createTime" />
+            <result column="charging_sum_money" property="chargingSumMoney"/>
+            <result column="timeout" property="timeout"/>
+            <result column="last_charging_time" property="lastChargingTime"/>
+            <result column="charging_create_time" property="createTime"/>
         </association>
     </resultMap>
 
     <select id="page" resultMap="queryPageMap">
         select di.*,
         ds.net_state,
+        dc.last_charging_money,
+        dc.last_charging_pay_type,
         dc.charging_sum_money, dc.timeout, dc.last_charging_time, dc.create_time as charging_create_time
         from device_info di
         join device_status ds on (di.device_id = ds.device_id)
@@ -54,7 +55,7 @@
         <if test="queryPage.chargingStatus != null and queryPage.chargingStatus != ''">
             <!-- 即将过期 -->
             <if test="queryPage.chargingStatus == 1">
-               and dc.timeout >= #{queryPage.thisTime} and dc.timeout &lt;= #{queryPage.theTime}
+                and dc.timeout >= #{queryPage.thisTime} and dc.timeout &lt;= #{queryPage.theTime}
             </if>
             <!-- 已过期 -->
             <if test="queryPage.chargingStatus == 2">

+ 36 - 0
device-api/src/main/java/com/xy/dto/MercFeeExtraDTO.java

@@ -0,0 +1,36 @@
+package com.xy.dto;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.xy.utils.PageBean;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+import javax.validation.constraints.NotNull;
+import java.time.LocalDateTime;
+import java.util.List;
+
+/**
+ * <p>
+ * 商户扩展费用
+ * </p>
+ *
+ * @author 谭斌
+ * @since 2024-04-07
+ */
+public class MercFeeExtraDTO {
+    @Data
+    @Accessors(chain = true)
+    public static class Query {
+
+        @NotNull(message = "商户ID不能为空")
+        @ApiModelProperty(value = "商户ID")
+        private Long mercId;
+
+        @NotNull(message = "查询类型不可为空")
+        @ApiModelProperty(value = "类型 1设备管理费。2设备激活费。3算法扣费标准。4流量卡费")
+        private Integer type;
+    }
+
+
+}