|
|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
package cn.iocoder.yudao.module.mes.controller.admin.dvrepair;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
|
|
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
|
|
|
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|
|
|
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
|
|
|
|
@ -28,6 +29,7 @@ import java.io.IOException;
|
|
|
|
|
import java.net.URLEncoder;
|
|
|
|
|
import java.time.LocalDateTime;
|
|
|
|
|
import java.time.format.DateTimeFormatter;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
@ -186,11 +188,11 @@ public class DvRepairController {
|
|
|
|
|
@Operation(summary = "根据设备Id获得维修历史记录")
|
|
|
|
|
@Parameter(name = "deviceId", description = "设备Id", required = false, example = "1024")
|
|
|
|
|
@PreAuthorize("@ss.hasPermission('mes:ticket-management:query')")
|
|
|
|
|
public CommonResult<List<DvRepairLineRespVO>> getRepairListByDeviceId(@RequestParam(value = "deviceId", required = false) Long deviceId,
|
|
|
|
|
public CommonResult<List<DvRepairDO>> getRepairListByDeviceId(@RequestParam(value = "deviceId", required = false) Long deviceId,
|
|
|
|
|
@RequestParam(value = "code", required = false) String code,
|
|
|
|
|
@RequestParam(name = "startTime",required = false) String startTime,
|
|
|
|
|
@RequestParam(name = "endTime",required = false) String endTime) {
|
|
|
|
|
List<DvRepairLineRespVO> dvRepairDOList = dvRepairService.getRepairListByDeviceId(deviceId, code, startTime, endTime, null);
|
|
|
|
|
List<DvRepairDO> dvRepairDOList = dvRepairService.getRepairListByDeviceId(deviceId, code, startTime, endTime, null);
|
|
|
|
|
return success(dvRepairDOList);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -207,8 +209,13 @@ public class DvRepairController {
|
|
|
|
|
HttpServletResponse response) throws IOException {
|
|
|
|
|
|
|
|
|
|
// 查询数据
|
|
|
|
|
List<DvRepairLineRespVO> dvRepairDOList = dvRepairService.getRepairListByDeviceId(deviceId, null, startTime, endTime, ids);
|
|
|
|
|
|
|
|
|
|
List<DvRepairDO> dvRepairDOList = dvRepairService.getRepairListByDeviceId(deviceId, null, startTime, endTime, ids);
|
|
|
|
|
List<DvRepairLineRespVO> dvRepairLineRespVOS = new ArrayList<>();
|
|
|
|
|
dvRepairDOList.stream().forEach(dvRepairDO -> {
|
|
|
|
|
DvRepairLineRespVO dvRepairLineRespVO = new DvRepairLineRespVO();
|
|
|
|
|
BeanUtil.copyProperties(dvRepairDO, dvRepairLineRespVO);
|
|
|
|
|
dvRepairLineRespVOS.add(dvRepairLineRespVO);
|
|
|
|
|
});
|
|
|
|
|
// 设置响应头
|
|
|
|
|
response.setContentType("application/vnd.ms-excel;charset=UTF-8");
|
|
|
|
|
response.setHeader("Content-Disposition",
|
|
|
|
|
@ -216,7 +223,7 @@ public class DvRepairController {
|
|
|
|
|
response.setHeader("Content-Encoding", "identity");
|
|
|
|
|
// 导出Excel
|
|
|
|
|
String fileName = String.format("维修记录_%s.xls", LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss")));
|
|
|
|
|
ExcelUtils.write(response, fileName, "维修记录", DvRepairLineRespVO.class, dvRepairDOList);
|
|
|
|
|
ExcelUtils.write(response, fileName, "维修记录", DvRepairLineRespVO.class, dvRepairLineRespVOS);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private PageResult<DvRepairRespVO> buildCreatorName(PageResult<DvRepairRespVO> dvSubjectRespVOPageResult) {
|
|
|
|
|
|