|
@@ -1,22 +1,14 @@
|
|
|
package com.xy.controller;
|
|
|
|
|
|
-import cn.hutool.core.collection.CollUtil;
|
|
|
import com.xy.annotate.RestMappingController;
|
|
|
-import com.xy.dto.DeviceDataDayDto;
|
|
|
import com.xy.dto.be.MercDto;
|
|
|
import com.xy.service.DeviceDataDayService;
|
|
|
import com.xy.service.be.MercService;
|
|
|
-import com.xy.utils.Emptys;
|
|
|
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;
|
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
|
|
-import javax.validation.Valid;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
@@ -35,37 +27,37 @@ public class MercMiniDeviceDataController {
|
|
|
private final DeviceDataDayService deviceDataDayService;
|
|
|
private final MercService mercService;
|
|
|
|
|
|
- @PostMapping("sumPage")
|
|
|
- @ApiOperation("设备销售数据统计分页")
|
|
|
- public R<PageBean<DeviceDataDayDto.SumPageVo>> sumPage(@RequestBody @Valid DeviceDataDayDto.SumPageDto dto) {
|
|
|
- dto.setMercId(MercAuthUtils.getMercId());
|
|
|
- if (Emptys.check(dto.getDeviceId())) {
|
|
|
- dto.setMercDeviceIds(CollUtil.newArrayList(dto.getDeviceId()));
|
|
|
- } else {
|
|
|
- List<Long> mercDeviceIds = getMercDeviceIds();
|
|
|
- if (CollUtil.isEmpty(mercDeviceIds)) {
|
|
|
- return R.ok(new PageBean<>());
|
|
|
- }
|
|
|
- dto.setMercDeviceIds(mercDeviceIds);
|
|
|
- }
|
|
|
- return R.ok(deviceDataDayService.sumPage(dto).getData());
|
|
|
- }
|
|
|
-
|
|
|
- @PostMapping("sumCount")
|
|
|
- @ApiOperation("设备销售数据统计总计")
|
|
|
- public R<DeviceDataDayDto.SumCountVo> sumCount(@RequestBody @Valid DeviceDataDayDto.SumCountDto dto) {
|
|
|
- dto.setMercId(MercAuthUtils.getMercId());
|
|
|
- if (Emptys.check(dto.getDeviceId())) {
|
|
|
- dto.setMercDeviceIds(CollUtil.newArrayList(dto.getDeviceId()));
|
|
|
- } else {
|
|
|
- List<Long> mercDeviceIds = getMercDeviceIds();
|
|
|
- if (CollUtil.isEmpty(mercDeviceIds)) {
|
|
|
- return R.ok(new DeviceDataDayDto.SumCountVo());
|
|
|
- }
|
|
|
- dto.setMercDeviceIds(mercDeviceIds);
|
|
|
- }
|
|
|
- return R.ok(deviceDataDayService.sumCount(dto).getData());
|
|
|
- }
|
|
|
+// @PostMapping("sumPage")
|
|
|
+// @ApiOperation("设备销售数据统计分页")
|
|
|
+// public R<PageBean<DeviceDataDayDto.SumPageVo>> sumPage(@RequestBody @Valid DeviceDataDayDto.SumPageDto dto) {
|
|
|
+// dto.setMercId(MercAuthUtils.getMercId());
|
|
|
+// if (Emptys.check(dto.getDeviceId())) {
|
|
|
+// dto.setMercDeviceIds(CollUtil.newArrayList(dto.getDeviceId()));
|
|
|
+// } else {
|
|
|
+// List<Long> mercDeviceIds = getMercDeviceIds();
|
|
|
+// if (CollUtil.isEmpty(mercDeviceIds)) {
|
|
|
+// return R.ok(new PageBean<>());
|
|
|
+// }
|
|
|
+// dto.setMercDeviceIds(mercDeviceIds);
|
|
|
+// }
|
|
|
+// return R.ok(deviceDataDayService.sumPage(dto).getData());
|
|
|
+// }
|
|
|
+//
|
|
|
+// @PostMapping("sumCount")
|
|
|
+// @ApiOperation("设备销售数据统计总计")
|
|
|
+// public R<DeviceDataDayDto.SumCountVo> sumCount(@RequestBody @Valid DeviceDataDayDto.SumCountDto dto) {
|
|
|
+// dto.setMercId(MercAuthUtils.getMercId());
|
|
|
+// if (Emptys.check(dto.getDeviceId())) {
|
|
|
+// dto.setMercDeviceIds(CollUtil.newArrayList(dto.getDeviceId()));
|
|
|
+// } else {
|
|
|
+// List<Long> mercDeviceIds = getMercDeviceIds();
|
|
|
+// if (CollUtil.isEmpty(mercDeviceIds)) {
|
|
|
+// return R.ok(new DeviceDataDayDto.SumCountVo());
|
|
|
+// }
|
|
|
+// dto.setMercDeviceIds(mercDeviceIds);
|
|
|
+// }
|
|
|
+// return R.ok(deviceDataDayService.sumCount(dto).getData());
|
|
|
+// }
|
|
|
|
|
|
/**
|
|
|
* 获取商户设备列表
|