瀏覽代碼

Merge branch 'master' into test

李进 1 年之前
父節點
當前提交
6defe1c7a1

+ 30 - 0
device-api-service-merc-mini/src/main/java/com/xy/controller/DeviceAlgorithmChargingController.java

@@ -0,0 +1,30 @@
+package com.xy.controller;
+
+import com.xy.annotate.RestMappingController;
+import com.xy.dto.DeviceAlgorithmChargingDto;
+import com.xy.service.DeviceAlgorithmChargingServiceImpl;
+import com.xy.utils.MercAuthUtils;
+import com.xy.utils.PageBean;
+import com.xy.utils.R;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.AllArgsConstructor;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+
+@AllArgsConstructor
+@Api(tags = "小程序-设备计费历史表")
+@RestMappingController("merc-mini/device-algorithm-charging")
+public class DeviceAlgorithmChargingController {
+
+    private DeviceAlgorithmChargingServiceImpl deviceAlgorithmChargingService;
+
+    @PostMapping("page")
+    @ApiOperation("分页查询")
+    public R<PageBean<DeviceAlgorithmChargingDto.Vo>> page(@RequestBody @Validated DeviceAlgorithmChargingDto.Page page) {
+        page.setMercId(MercAuthUtils.getMercId());
+        return deviceAlgorithmChargingService.page(page);
+    }
+
+}

+ 27 - 0
device-api-service-merc-mini/src/main/java/com/xy/controller/DeviceChargingHistoryController.java

@@ -0,0 +1,27 @@
+package com.xy.controller;
+
+import com.xy.annotate.RestMappingController;
+import com.xy.dto.DeviceChargingHistoryDto;
+import com.xy.service.DeviceChargingHistoryServiceImpl;
+import com.xy.utils.MercAuthUtils;
+import com.xy.utils.PageBean;
+import com.xy.utils.R;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.AllArgsConstructor;
+import org.springframework.web.bind.annotation.PostMapping;
+
+@AllArgsConstructor
+@Api(tags = "小程序-设备计费历史表")
+@RestMappingController("merc-mini/device-charging-history")
+public class DeviceChargingHistoryController {
+
+    private DeviceChargingHistoryServiceImpl deviceChargingHistoryService;
+
+    @PostMapping("page")
+    @ApiOperation("分页查询")
+    public R<PageBean<DeviceChargingHistoryDto.Vo>> page(DeviceChargingHistoryDto.Page page) {
+        page.setMercId(MercAuthUtils.getMercId());
+        return deviceChargingHistoryService.page(page);
+    }
+}

+ 3 - 0
device-api-service/src/main/java/com/xy/entity/DeviceAlgorithmCharging.java

@@ -27,6 +27,9 @@ public class DeviceAlgorithmCharging implements Serializable {
     @ApiModelProperty(value = "id")
     private Long id;
 
+    @ApiModelProperty(value = "商户id")
+    private Long mercId;
+
     @ApiModelProperty(value = "设备id")
     private Long deviceId;
 

+ 3 - 0
device-api-service/src/main/java/com/xy/entity/DeviceAlgorithmChargingHistory.java

@@ -27,6 +27,9 @@ public class DeviceAlgorithmChargingHistory implements Serializable {
     @ApiModelProperty(value = "id")
     private Long id;
 
+    @ApiModelProperty(value = "商户id")
+    private Long mercId;
+
     @ApiModelProperty(value = "订单id")
     private String orderId;
 

+ 3 - 0
device-api-service/src/main/java/com/xy/entity/DeviceChargingHistory.java

@@ -29,6 +29,9 @@ public class DeviceChargingHistory extends BaseEntity<DeviceChargingHistory> imp
     @ApiModelProperty(value = "订单id")
     private String orderId;
 
+    @ApiModelProperty(value = "商户id")
+    private Long mercId;
+
     @ApiModelProperty(value = "设备id")
     private Long deviceId;
 

+ 4 - 0
device-api-service/src/main/java/com/xy/service/DeviceAlgorithmChargingServiceImpl.java

@@ -93,6 +93,7 @@ public class DeviceAlgorithmChargingServiceImpl extends ServiceImpl<DeviceAlgori
         deviceAlgorithmChargings.forEach(deviceAlgorithmCharging -> {
             DeviceAlgorithmChargingHistory deviceAlgorithmChargingHistory = new DeviceAlgorithmChargingHistory()
                     .setId(YitIdHelper.nextId())
+                    .setMercId(pay.getMercId())
                     .setOrderId(pay.getOrderId())
                     .setDeviceId(deviceAlgorithmCharging.getDeviceId())
                     .setAlgorithmId(deviceAlgorithmCharging.getAlgorithmId())
@@ -170,6 +171,7 @@ public class DeviceAlgorithmChargingServiceImpl extends ServiceImpl<DeviceAlgori
                     timeout = Integer.valueOf(DataTime.toString(DataTime.toLocal(stringAround1), "yyyyMMdd"));
                 }
                 DeviceAlgorithmCharging deviceAlgorithmChargingInfo = new DeviceAlgorithmCharging()
+                        .setMercId(deviceAlgorithmChargingHistory.getMercId())
                         .setDeviceId(deviceAlgorithmChargingHistory.getDeviceId())
                         .setAlgorithmId(deviceAlgorithmChargingHistory.getAlgorithmId())
                         .setUnusedSize(moon.getSize())
@@ -185,6 +187,7 @@ public class DeviceAlgorithmChargingServiceImpl extends ServiceImpl<DeviceAlgori
         //处理无期限
         infs.forEach(deviceAlgorithmChargingHistory -> {
             DeviceAlgorithmCharging deviceAlgorithmChargingInfo = new DeviceAlgorithmCharging()
+                    .setMercId(deviceAlgorithmChargingHistory.getMercId())
                     .setDeviceId(deviceAlgorithmChargingHistory.getDeviceId())
                     .setAlgorithmId(deviceAlgorithmChargingHistory.getAlgorithmId())
                     .setUnusedSize(deviceAlgorithmChargingHistory.getChargingSize())
@@ -199,6 +202,7 @@ public class DeviceAlgorithmChargingServiceImpl extends ServiceImpl<DeviceAlgori
         //处理赠送
         gives.forEach(deviceAlgorithmChargingHistory -> {
             DeviceAlgorithmCharging deviceAlgorithmChargingInfo = new DeviceAlgorithmCharging()
+                    .setMercId(deviceAlgorithmChargingHistory.getMercId())
                     .setDeviceId(deviceAlgorithmChargingHistory.getDeviceId())
                     .setAlgorithmId(deviceAlgorithmChargingHistory.getAlgorithmId())
                     .setUnusedSize(deviceAlgorithmChargingHistory.getChargingSize())

+ 1 - 0
device-api-service/src/main/java/com/xy/service/DeviceChargingServiceImpl.java

@@ -178,6 +178,7 @@ public class DeviceChargingServiceImpl extends ServiceImpl<DeviceChargingMapper,
         deviceChargings.forEach(deviceCharging -> {
             DeviceChargingHistory deviceChargingHistory = new DeviceChargingHistory()
                     .createId()
+                    .setMercId(pay.getMercId())
                     .setOrderId(pay.getOrderId())
                     .setDeviceId(deviceCharging.getDeviceId())
                     .setChargingSize(deviceCharging.getNum())

+ 7 - 0
device-api/src/main/java/com/xy/dto/DeviceAlgorithmChargingDto.java

@@ -52,6 +52,10 @@ public class DeviceAlgorithmChargingDto {
         @ApiModelProperty(value = "支付类型 2=支付宝 3=微信 100=赠送")
         private Integer payType;
 
+        @NotNull(message = "mercId不能为空")
+        @ApiModelProperty(value = "商户id")
+        private Long mercId;
+
         @NotEmpty(message = "deviceAlgorithmChargings不能为空")
         @ApiModelProperty("计费信息")
         private List<DeviceAlgorithmCharging> deviceAlgorithmChargings;
@@ -121,6 +125,9 @@ public class DeviceAlgorithmChargingDto {
         @ApiModelProperty(value = "id")
         private Long id;
 
+        @ApiModelProperty(value = "商户id")
+        private Long mercId;
+
         @ApiModelProperty(value = "设备id")
         private Long deviceId;
 

+ 3 - 0
device-api/src/main/java/com/xy/dto/DeviceAlgorithmChargingHistoryDto.java

@@ -35,6 +35,9 @@ public class DeviceAlgorithmChargingHistoryDto {
         @ApiModelProperty(value = "id")
         private Long id;
 
+        @ApiModelProperty(value = "商户id")
+        private Long mercId;
+
         @ApiModelProperty(value = "订单id")
         private String orderId;
 

+ 4 - 0
device-api/src/main/java/com/xy/dto/DeviceChargingDto.java

@@ -71,6 +71,10 @@ public class DeviceChargingDto {
         @ApiModelProperty("订单号")
         private String orderId;
 
+        @NotNull(message = "mercId不能为空")
+        @ApiModelProperty(value = "商户id")
+        private Long mercId;
+
         @NotEmpty(message = "deviceChargings不能为空")
         @ApiModelProperty("续费信息")
         private List<DeviceCharging> deviceChargings;

+ 3 - 0
device-api/src/main/java/com/xy/dto/DeviceChargingHistoryDto.java

@@ -25,6 +25,9 @@ public class DeviceChargingHistoryDto {
         @ApiModelProperty(value = "id")
         private Long id;
 
+        @ApiModelProperty(value = "商户id")
+        private Long mercId;
+
         @ApiModelProperty(value = "订单id")
         private String orderId;