|
@@ -3,21 +3,22 @@ package com.xy.service;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
+import com.xy.collections.list.JArrayList;
|
|
import com.xy.dto.DeviceAlgorithmChargingHistoryDto;
|
|
import com.xy.dto.DeviceAlgorithmChargingHistoryDto;
|
|
|
|
+import com.xy.dto.OrderMercManageDto;
|
|
import com.xy.entity.DeviceAlgorithmChargingHistory;
|
|
import com.xy.entity.DeviceAlgorithmChargingHistory;
|
|
import com.xy.mapper.DeviceAlgorithmChargingHistoryMapper;
|
|
import com.xy.mapper.DeviceAlgorithmChargingHistoryMapper;
|
|
-import com.xy.utils.MybatisPlusQuery;
|
|
|
|
-import com.xy.utils.PageBean;
|
|
|
|
-import com.xy.utils.PlusBeans;
|
|
|
|
-import com.xy.utils.R;
|
|
|
|
|
|
+import com.xy.utils.*;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import lombok.AllArgsConstructor;
|
|
import lombok.AllArgsConstructor;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
|
|
-import static com.xy.utils.PlusBeans.toPageBean;
|
|
|
|
|
|
+import java.util.List;
|
|
|
|
|
|
|
|
+import static com.xy.utils.Beans.copy;
|
|
|
|
+import static com.xy.utils.PlusBeans.toPageBean;
|
|
|
|
|
|
/**
|
|
/**
|
|
* <p>
|
|
* <p>
|
|
@@ -32,11 +33,21 @@ import static com.xy.utils.PlusBeans.toPageBean;
|
|
@Api(tags = "设备算法计费历史表")
|
|
@Api(tags = "设备算法计费历史表")
|
|
public class DeviceAlgorithmChargingHistoryServiceImpl extends ServiceImpl<DeviceAlgorithmChargingHistoryMapper, DeviceAlgorithmChargingHistory> implements DeviceAlgorithmChargingHistoryService {
|
|
public class DeviceAlgorithmChargingHistoryServiceImpl extends ServiceImpl<DeviceAlgorithmChargingHistoryMapper, DeviceAlgorithmChargingHistory> implements DeviceAlgorithmChargingHistoryService {
|
|
|
|
|
|
|
|
+ private OrderMercManageService orderMercManageService;
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
@ApiOperation("分页查询")
|
|
@ApiOperation("分页查询")
|
|
public R<PageBean<DeviceAlgorithmChargingHistoryDto.Vo>> page(@RequestBody DeviceAlgorithmChargingHistoryDto.Page page) {
|
|
public R<PageBean<DeviceAlgorithmChargingHistoryDto.Vo>> page(@RequestBody DeviceAlgorithmChargingHistoryDto.Page page) {
|
|
LambdaQueryWrapper<DeviceAlgorithmChargingHistory> lambdaQueryWrapper = new MybatisPlusQuery().eqWrapper(page, DeviceAlgorithmChargingHistory.class).build();
|
|
LambdaQueryWrapper<DeviceAlgorithmChargingHistory> lambdaQueryWrapper = new MybatisPlusQuery().eqWrapper(page, DeviceAlgorithmChargingHistory.class).build();
|
|
IPage<DeviceAlgorithmChargingHistory> iPage = page(PlusBeans.toIPage(page.getPage()), lambdaQueryWrapper);
|
|
IPage<DeviceAlgorithmChargingHistory> iPage = page(PlusBeans.toIPage(page.getPage()), lambdaQueryWrapper);
|
|
- return R.ok(toPageBean(DeviceAlgorithmChargingHistoryDto.Vo.class, iPage));
|
|
|
|
|
|
+ PageBean<DeviceAlgorithmChargingHistoryDto.Vo> pageBean = toPageBean(DeviceAlgorithmChargingHistoryDto.Vo.class, iPage);
|
|
|
|
+ List<DeviceAlgorithmChargingHistoryDto.Vo> records = pageBean.getRecords();
|
|
|
|
+ if (Emptys.check(records)) {
|
|
|
|
+ copy(records).target(
|
|
|
|
+ () -> orderMercManageService.list(new OrderMercManageDto.SelectList().setId(new JArrayList<>(records).getProperty(DeviceAlgorithmChargingHistoryDto.Vo::getOrderId))).getData()
|
|
|
|
+ , DeviceAlgorithmChargingHistoryDto.Vo::getOrderId, DeviceAlgorithmChargingHistoryDto.Vo::getFiles, OrderMercManageDto.Vo::getId, OrderMercManageDto.Vo::getFiles
|
|
|
|
+ ).builder();
|
|
|
|
+ }
|
|
|
|
+ return R.ok(pageBean);
|
|
}
|
|
}
|
|
}
|
|
}
|