From c13d4402aa449fb443fcca7ee95485b30cdf227c Mon Sep 17 00:00:00 2001 From: xiaofajia <1665375861@qq.com> Date: Tue, 3 Dec 2024 18:03:18 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A8=E6=A0=BC=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yudao/common/DictBaseConstants.java | 2 + .../admin/RepairOrderInfoController.java | 52 +++++++++++ .../module/order/vo/RepairOrderExportVO.java | 63 +++++++++++++ .../yudao/common/RepairDictConstants.java | 12 +++ .../admin/DlRepairSoController.java | 35 +++++++ .../admin/DlRepairSoiController.java | 79 +++++++++++++++- .../stockOperate/vo/RepairSoExportVO.java | 59 ++++++++++++ .../stockOperate/vo/RepairSoiExportVO.java | 65 +++++++++++++ .../admin/DlRepairStController.java | 61 ++++++++++++ .../admin/DlRepairStiController.java | 81 ++++++++++++++++ .../stockTransfer/vo/RepairSoiExportVO.java | 66 +++++++++++++ .../stockTransfer/vo/RepairStExportVO.java | 54 +++++++++++ .../admin/DlRepairTicketsController.java | 92 +++++++++++++++++-- .../admin/DlTicketWaresController.java | 40 ++++++++ .../tickets/vo/TicketExportByStatusVO.java | 41 +++++++++ .../tickets/vo/TicketWaresExportVO.java | 48 ++++++++++ .../module/tickets/vo/TicketsExportVO.java | 44 +++++++++ 17 files changed, 885 insertions(+), 9 deletions(-) create mode 100644 dl-module-base/src/main/java/cn/iocoder/yudao/module/order/vo/RepairOrderExportVO.java create mode 100644 dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/vo/RepairSoExportVO.java create mode 100644 dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/vo/RepairSoiExportVO.java create mode 100644 dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockTransfer/vo/RepairSoiExportVO.java create mode 100644 dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockTransfer/vo/RepairStExportVO.java create mode 100644 dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/vo/TicketExportByStatusVO.java create mode 100644 dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/vo/TicketWaresExportVO.java create mode 100644 dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/vo/TicketsExportVO.java diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/common/DictBaseConstants.java b/dl-module-base/src/main/java/cn/iocoder/yudao/common/DictBaseConstants.java index f7d72b57..2ff34521 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/common/DictBaseConstants.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/common/DictBaseConstants.java @@ -45,4 +45,6 @@ public class DictBaseConstants { public static final String DICT_CAR_CATEGORY = "car_category"; /** 车辆性质 */ public static final String DICT_CAR_NATURE = "car_nature"; + /** 支付方式 */ + public static final String REPAIR_PAY_TYPE = "repair_pay_type"; } diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/order/controller/admin/RepairOrderInfoController.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/order/controller/admin/RepairOrderInfoController.java index dde61feb..fe611f25 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/order/controller/admin/RepairOrderInfoController.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/order/controller/admin/RepairOrderInfoController.java @@ -1,9 +1,12 @@ package cn.iocoder.yudao.module.order.controller.admin; +import cn.hutool.core.collection.CollUtil; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.util.object.BeanUtils; +import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; import cn.iocoder.yudao.module.order.entity.RepairOrderInfo; import cn.iocoder.yudao.module.order.service.RepairOrderInfoService; +import cn.iocoder.yudao.module.order.vo.RepairOrderExportVO; import cn.iocoder.yudao.module.order.vo.RepairOrderInfoPageReqVO; import cn.iocoder.yudao.module.order.vo.RepairOrderInfoRespVO; import cn.iocoder.yudao.module.order.vo.RepairOrderInfoSaveReqVO; @@ -17,13 +20,18 @@ import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; import javax.validation.Valid; import java.io.IOException; import java.security.InvalidKeyException; import java.security.NoSuchAlgorithmException; import java.security.SignatureException; +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception0; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; @Tag(name = "管理后台 - 维修模块 订单") @@ -113,4 +121,48 @@ public class RepairOrderInfoController { public CommonResult toPay(@RequestParam("id")String id) throws IOException, NoSuchAlgorithmException, SignatureException, InvalidKeyException { return success(repairOrderInfoService.payTransactionsCode(id)); } + + /** + * 导出数据 + * + * @author 小李 + * @date 17:03 2024/12/3 + * @param pageReqVO 请求对象 + **/ + @GetMapping("/export") + @Operation(summary = "导出数据") + public void exportData(RepairOrderInfoPageReqVO pageReqVO, HttpServletResponse response)throws IOException{ + int pageNo = 1, pageSize = 1000; + List list = new ArrayList<>(); + Page page = new Page<>(pageNo, pageSize); + do { + IPage repairOrderInfoRespVOIPage = repairOrderInfoService.queryListPage(pageReqVO, page); + List records = repairOrderInfoRespVOIPage.getRecords(); + if (CollUtil.isEmpty(records)){ + break; + } + List convertedRecords = records.stream().map(item -> BeanUtils.toBean(item, RepairOrderExportVO.class)).collect(Collectors.toList()); + list.addAll(convertedRecords); + pageNo++; + page.setCurrent(pageNo); + }while (true); + if (CollUtil.isEmpty(list)){ + throw exception0(500, "没有数据可以导出"); + } + list.forEach(item -> { + switch (item.getGoodsType()){ + case "1": + item.setGoodsType("会员充值"); + break; + case "2": + item.setGoodsType("维修服务"); + break; + case "3": + item.setGoodsType("保养卡"); + break; + } + item.setOrderStatus(item.getOrderStatus().equals("0") ? "待支付" : "已支付"); + }); + ExcelUtils.write(response, "订单数据.xls", "数据", RepairOrderExportVO.class, list); + } } \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/order/vo/RepairOrderExportVO.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/order/vo/RepairOrderExportVO.java new file mode 100644 index 00000000..52005d3b --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/order/vo/RepairOrderExportVO.java @@ -0,0 +1,63 @@ +package cn.iocoder.yudao.module.order.vo; + +import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; +import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.math.BigDecimal; +import java.time.LocalDateTime; + +import static cn.iocoder.yudao.common.DictBaseConstants.REPAIR_PAY_TYPE; + +/** + * 用于维修订单导出VO + * + * @author 小李 + * @date 17:05 2024/12/3 +**/ +@Data +@ExcelIgnoreUnannotated +public class RepairOrderExportVO { + + @ExcelProperty("订单号") + private String orderNo; + + @ExcelProperty("服务名称") + private String goodsTitle; + + @ExcelProperty("消费类型") + private String goodsType; + + @ExcelProperty("客户姓名") + private String cusName; + + @ExcelProperty("客户手机号") + private String cusPhone; + + @ExcelProperty("商品原价(元)") + private BigDecimal goodsPrice; + + @ExcelProperty("实付金额(元)") + private BigDecimal payMoney; + + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @ExcelProperty("下单时间") + private LocalDateTime orderTime; + + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @ExcelProperty("支付时间") + private LocalDateTime payTime; + + @ExcelProperty(value = "支付方式", converter = DictConvert.class) + @DictFormat(REPAIR_PAY_TYPE) + private String payType; + + @ExcelProperty("订单状态") + private String orderStatus; +} diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/common/RepairDictConstants.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/common/RepairDictConstants.java index a410cdb0..c541d183 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/common/RepairDictConstants.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/common/RepairDictConstants.java @@ -22,4 +22,16 @@ public interface RepairDictConstants { /** 维修工人工种 */ String REPAIR_WORK_TYPE = "repair_work_type"; + + /** 维修类别 */ + String REPAIR_TYPE = "repair_type"; + + /** 配件申请单审核状态 */ + String TICKET_WARES_STATUS = "ticket_wares_status"; + + /** 库存操作单据状态 */ + String REPAIR_SO_STATUS = "repair_so_status"; + + /** 调拨状态 */ + String REPAIR_ST_STATUS = "repair_st_status"; } diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/controller/admin/DlRepairSoController.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/controller/admin/DlRepairSoController.java index 0185b5be..985ccd56 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/controller/admin/DlRepairSoController.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/controller/admin/DlRepairSoController.java @@ -1,17 +1,29 @@ package cn.iocoder.yudao.module.stockOperate.controller.admin; +import cn.hutool.core.collection.CollUtil; import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.framework.common.util.object.BeanUtils; +import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; import cn.iocoder.yudao.module.stockOperate.entity.DlRepairSo; import cn.iocoder.yudao.module.stockOperate.service.DlRepairSoService; import cn.iocoder.yudao.module.stockOperate.vo.DlRepairSoReqVO; import cn.iocoder.yudao.module.stockOperate.vo.DlRepairSoRespVO; +import cn.iocoder.yudao.module.stockOperate.vo.RepairSoExportVO; +import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import io.swagger.v3.oas.annotations.Operation; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception0; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; /** @@ -144,5 +156,28 @@ public class DlRepairSoController { dlRepairSoService.inWare(repairSoRespVO); return CommonResult.ok(); } + + @GetMapping("/export") + @Operation(summary = "导出数据") + public void exportData(DlRepairSoReqVO repairSoReqVO, HttpServletResponse response)throws IOException { + int pageNo = 1, pageSize = 1000; + List list = new ArrayList<>(); + Page page = new Page<>(pageNo, pageSize); + do { + IPage repairSoPage = dlRepairSoService.getRepairSoPage(repairSoReqVO, page); + List records = repairSoPage.getRecords(); + if (CollUtil.isEmpty(records)){ + break; + } + List convertedRecords = records.stream().map(item -> BeanUtils.toBean(item, RepairSoExportVO.class)).collect(Collectors.toList()); + list.addAll(convertedRecords); + pageNo++; + page.setCurrent(pageNo); + }while (true); + if (CollUtil.isEmpty(list)){ + throw exception0(500, "没有数据可以导出"); + } + ExcelUtils.write(response, "单据数据.xls", "数据", RepairSoExportVO.class, list); + } } diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/controller/admin/DlRepairSoiController.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/controller/admin/DlRepairSoiController.java index e6d1fc2b..2b1651c8 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/controller/admin/DlRepairSoiController.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/controller/admin/DlRepairSoiController.java @@ -1,22 +1,37 @@ package cn.iocoder.yudao.module.stockOperate.controller.admin; +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.ObjectUtil; import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; +import cn.iocoder.yudao.module.conf.entity.BaseWarehouse; +import cn.iocoder.yudao.module.conf.service.BaseWarehouseService; +import cn.iocoder.yudao.module.project.entity.RepairWares; +import cn.iocoder.yudao.module.stockOperate.entity.DlRepairSo; import cn.iocoder.yudao.module.stockOperate.entity.DlRepairSoi; import cn.iocoder.yudao.module.stockOperate.service.DlRepairSoiService; -import cn.iocoder.yudao.module.stockOperate.vo.DlRepairSoiReqVO; -import cn.iocoder.yudao.module.stockOperate.vo.DlRepairSoiRespVO; +import cn.iocoder.yudao.module.stockOperate.vo.*; +import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import io.swagger.v3.oas.annotations.Operation; +import org.springframework.context.annotation.Lazy; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception0; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; /** @@ -33,6 +48,10 @@ public class DlRepairSoiController{ @Resource private DlRepairSoiService dlRepairSoiService; + @Resource + @Lazy + private BaseWarehouseService warehouseService; + /** * 采购单领料单子表 分页 * @@ -107,5 +126,61 @@ public class DlRepairSoiController{ Page page = new Page<>(pageNo, pageSize); return success(dlRepairSoiService.getSoBySupplier(reqVO, page)); } + + /** + * 导出数据 + * + * @author 小李 + * @date 16:30 2024/12/3 + **/ + @GetMapping("/export") + @Operation(summary = "导出数据") + public void exportData(DlRepairSoiReqVO repairSoiReqVO, HttpServletResponse response)throws IOException { + int pageNo = 1, pageSize = 1000; + Page page = new Page<>(pageNo, pageSize); + List allList = new ArrayList<>(); + do { + IPage repairSoiPage = dlRepairSoiService.getRepairSoiPage(repairSoiReqVO, page); + List records = repairSoiPage.getRecords(); + if (CollUtil.isEmpty(records)){ + break; + } + allList.addAll(records); + pageNo++; + page.setCurrent(pageNo); + }while (true); + if (CollUtil.isEmpty(allList)){ + throw exception0(500, "没有数据可以导出"); + } + List ids = allList.stream().map(DlRepairSoi::getId).collect(Collectors.toList()); + List repairSoiByIds = dlRepairSoiService.getRepairSoiByIds(ids); + List warehouses = warehouseService.list(); + Map warehousesMap = warehouses.stream().collect(Collectors.toMap(BaseWarehouse::getId, BaseWarehouse::getName)); + List list = repairSoiByIds.stream().map(item -> { + DlRepairSo so = item.getSo(); + RepairWares repairWares = item.getRepairWares(); + RepairSoiExportVO repairSoiExportVO = new RepairSoiExportVO(); + repairSoiExportVO.setSoNo(so.getSoNo()); + repairSoiExportVO.setName(repairWares.getName()); + repairSoiExportVO.setUserName(so.getUserName()); + repairSoiExportVO.setCode(repairWares.getCode()); + repairSoiExportVO.setBarCode(repairWares.getBarCode()); + repairSoiExportVO.setModel(repairWares.getModel()); + repairSoiExportVO.setGoodsCount(item.getGoodsCount()); + repairSoiExportVO.setGoodsPrice(item.getGoodsPrice()); + BigDecimal goodsPrice = ObjectUtil.isNotEmpty(item.getGoodsPrice()) ? item.getGoodsPrice() : BigDecimal.ZERO; + int goodsCount = ObjectUtil.isNotEmpty(item.getGoodsCount()) ? item.getGoodsCount() : 0; + repairSoiExportVO.setTotal(goodsPrice.multiply(BigDecimal.valueOf(goodsCount))); + repairSoiExportVO.setSupplierName(so.getSupplierName()); + if (ObjectUtil.isNotEmpty(item.getWareId())) { + repairSoiExportVO.setWarehouseName(warehousesMap.get(item.getWareId())); + } + repairSoiExportVO.setCropId(so.getCorpId()); + repairSoiExportVO.setCreateTime(so.getCreateTime()); + repairSoiExportVO.setRemark(item.getRemark()); + return repairSoiExportVO; + }).collect(Collectors.toList()); + ExcelUtils.write(response, "作废单据数据.xls", "数据", RepairSoiExportVO.class, list); + } } diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/vo/RepairSoExportVO.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/vo/RepairSoExportVO.java new file mode 100644 index 00000000..cc49caff --- /dev/null +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/vo/RepairSoExportVO.java @@ -0,0 +1,59 @@ +package cn.iocoder.yudao.module.stockOperate.vo; + +import cn.iocoder.yudao.common.RepairDictConstants; +import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; +import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import com.baomidou.mybatisplus.annotation.TableField; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.math.BigDecimal; +import java.time.LocalDateTime; +import java.util.Date; + +/** + * 用于采购单导出VO + * + * @author 小李 + * @date 16:03 2024/12/3 +**/ +@Data +@ExcelIgnoreUnannotated +public class RepairSoExportVO { + + /** + * 单据编号;自动生成 + */ + @ExcelProperty("单号") + private String soNo; + + @ExcelProperty("供应商") + private String supplierName; + + @ExcelProperty("操作人") + private String userName; + + @ExcelProperty("数量") + private Integer itemCount; + + @ExcelProperty("金额") + private BigDecimal totalPrice; + + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + @DateTimeFormat(pattern="yyyy-MM-dd") + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @ExcelProperty(value = "状态", converter = DictConvert.class) + @DictFormat(RepairDictConstants.REPAIR_SO_STATUS) + private String soStatus; + + @ExcelProperty("备注") + private String remark; + + @ExcelProperty("门店") + private String corpName; +} diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/vo/RepairSoiExportVO.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/vo/RepairSoiExportVO.java new file mode 100644 index 00000000..34a8aac3 --- /dev/null +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/vo/RepairSoiExportVO.java @@ -0,0 +1,65 @@ +package cn.iocoder.yudao.module.stockOperate.vo; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.math.BigDecimal; +import java.time.LocalDateTime; + +/** + * 用于导出库存操作子表的VO + * + * @author 小李 + * @date 16:32 2024/12/3 +**/ +@Data +@ExcelIgnoreUnannotated +public class RepairSoiExportVO { + + @ExcelProperty("单号") + private String soNo; + + @ExcelProperty("商品名称") + private String name; + + @ExcelProperty("操作人") + private String userName; + + @ExcelProperty("商品编码") + private String code; + + @ExcelProperty("条形码") + private String barCode; + + @ExcelProperty("规格") + private String model; + + @ExcelProperty("数量") + private Integer goodsCount; + + @ExcelProperty("价格") + private BigDecimal goodsPrice; + + @ExcelProperty("合计") + private BigDecimal total; + + @ExcelProperty("供应商") + private String supplierName; + + @ExcelProperty("仓库") + private String warehouseName; + + @ExcelProperty("门店") + private String cropId; + + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + @DateTimeFormat(pattern="yyyy-MM-dd") + @ExcelProperty("时间") + private LocalDateTime createTime; + + @ExcelProperty("备注") + private String remark; +} diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockTransfer/controller/admin/DlRepairStController.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockTransfer/controller/admin/DlRepairStController.java index 9adb14a2..7f8681eb 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockTransfer/controller/admin/DlRepairStController.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockTransfer/controller/admin/DlRepairStController.java @@ -1,17 +1,34 @@ package cn.iocoder.yudao.module.stockTransfer.controller.admin; +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.ObjectUtil; import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.framework.common.util.object.BeanUtils; +import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; +import cn.iocoder.yudao.module.company.entity.Company; +import cn.iocoder.yudao.module.company.service.CompanyService; import cn.iocoder.yudao.module.stockTransfer.entity.DlRepairSt; import cn.iocoder.yudao.module.stockTransfer.service.DlRepairStService; import cn.iocoder.yudao.module.stockTransfer.vo.DlRepairStReqVO; import cn.iocoder.yudao.module.stockTransfer.vo.DlRepairStRespVO; +import cn.iocoder.yudao.module.stockTransfer.vo.RepairStExportVO; +import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import io.swagger.v3.oas.annotations.Operation; +import org.springframework.context.annotation.Lazy; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception0; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; /** @@ -28,6 +45,10 @@ public class DlRepairStController{ @Resource private DlRepairStService dlRepairStService; + @Resource + @Lazy + private CompanyService companyService; + /** * 调拨单 新增 * @@ -86,5 +107,45 @@ public class DlRepairStController{ public CommonResult getSt(@RequestParam("id") String id){ return success(dlRepairStService.getSt(id)); } + + /** + * 导出数据 + * + * @author 小李 + * @date 17:26 2024/12/3 + * @param repairStReqVO 请求对象 + **/ + @GetMapping("/export") + @Operation(summary = "导出数据") + public void exportData(DlRepairStReqVO repairStReqVO, HttpServletResponse response)throws IOException { + int pageNo = 1, pageSize = 1000; + List list = new ArrayList<>(); + Page page = new Page<>(pageNo, pageSize); + do { + IPage stPage = dlRepairStService.getStPage(repairStReqVO, page); + List records = stPage.getRecords(); + if (CollUtil.isEmpty(records)){ + break; + } + List convertedRecords = records.stream().map(item -> BeanUtils.toBean(item, RepairStExportVO.class)).collect(Collectors.toList()); + list.addAll(convertedRecords); + pageNo++; + page.setCurrent(pageNo); + }while (true); + if (CollUtil.isEmpty(list)){ + throw exception0(500, "没有数据可以导出"); + } + List companies = companyService.list(); + Map companyMap = companies.stream().collect(Collectors.toMap(Company::getId, Company::getCorpName)); + list.forEach(item -> { + if (ObjectUtil.isNotEmpty(item.getInCorpId()) && ObjectUtil.isNotEmpty(companyMap.get(item.getInCorpId()))){ + item.setInCorpId(companyMap.get(item.getInCorpId())); + } + if (ObjectUtil.isNotEmpty(item.getOutCorpId()) && ObjectUtil.isNotEmpty(companyMap.get(item.getOutCorpId()))){ + item.setOutCorpId(companyMap.get(item.getOutCorpId())); + } + }); + ExcelUtils.write(response, "单据数据.xls", "数据", RepairStExportVO.class, list); + } } diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockTransfer/controller/admin/DlRepairStiController.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockTransfer/controller/admin/DlRepairStiController.java index 0c7a915a..31336e14 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockTransfer/controller/admin/DlRepairStiController.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockTransfer/controller/admin/DlRepairStiController.java @@ -1,21 +1,39 @@ package cn.iocoder.yudao.module.stockTransfer.controller.admin; +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.ObjectUtil; import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; +import cn.iocoder.yudao.module.company.entity.Company; +import cn.iocoder.yudao.module.company.service.CompanyService; +import cn.iocoder.yudao.module.project.entity.RepairWares; +import cn.iocoder.yudao.module.stockTransfer.entity.DlRepairSt; import cn.iocoder.yudao.module.stockTransfer.entity.DlRepairSti; import cn.iocoder.yudao.module.stockTransfer.service.DlRepairStiService; +import cn.iocoder.yudao.module.stockTransfer.vo.DlRepairStiQueryVO; import cn.iocoder.yudao.module.stockTransfer.vo.DlRepairStiReqVO; +import cn.iocoder.yudao.module.stockTransfer.vo.RepairSoiExportVO; +import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import io.swagger.v3.oas.annotations.Operation; +import org.springframework.context.annotation.Lazy; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception0; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; /** @@ -32,6 +50,10 @@ public class DlRepairStiController{ @Resource private DlRepairStiService dlRepairStiService; + @Resource + @Lazy + private CompanyService companyService; + /** * 调拨单子表 分页 * @@ -62,5 +84,64 @@ public class DlRepairStiController{ public CommonResult getStIsWares(@RequestParam("ids") List ids){ return success(dlRepairStiService.getStIsWares(ids)); } + + /** + * 导出数据 + * + * @author 小李 + * @date 17:43 2024/12/3 + * @param repairStiReqVO 请求对象 + **/ + @GetMapping("/export") + @Operation(summary = "导出数据") + public void exportData(DlRepairStiReqVO repairStiReqVO, HttpServletResponse response)throws IOException { + int pageNo = 1, pageSize = 1000; + Page page = new Page<>(pageNo, pageSize); + List allList = new ArrayList<>(); + do { + IPage stiPage = dlRepairStiService.getStiPage(repairStiReqVO, page); + List records = stiPage.getRecords(); + if (CollUtil.isEmpty(records)){ + break; + } + allList.addAll(records); + pageNo++; + page.setCurrent(pageNo); + }while (true); + if (CollUtil.isEmpty(allList)){ + throw exception0(500, "没有数据可以导出"); + } + List companies = companyService.list(); + Map companyMap = companies.stream().collect(Collectors.toMap(Company::getId, Company::getCorpName)); + List ids = allList.stream().map(DlRepairSti::getId).collect(Collectors.toList()); + List stIsWares = dlRepairStiService.getStIsWares(ids); + List list = stIsWares.stream().map(item -> { + RepairSoiExportVO repairSoiExportVO = new RepairSoiExportVO(); + DlRepairSt st = item.getSt(); + RepairWares wares = item.getWares(); + repairSoiExportVO.setStNo(st.getStNo()); + repairSoiExportVO.setName(wares.getName()); + repairSoiExportVO.setModel(wares.getModel()); + repairSoiExportVO.setCode(wares.getCode()); + repairSoiExportVO.setBarCode(wares.getBarCode()); + repairSoiExportVO.setGoodsCount(item.getGoodsCount()); + repairSoiExportVO.setPrice(wares.getPrice()); + int goodsCount = ObjectUtil.isNotEmpty(item.getGoodsCount()) ? item.getGoodsCount() : 0; + BigDecimal price = ObjectUtil.isNotEmpty(wares.getPrice()) ? wares.getPrice() : BigDecimal.ZERO; + repairSoiExportVO.setTotalPrice(price.multiply(BigDecimal.valueOf(goodsCount))); + repairSoiExportVO.setGoodsPrice(item.getGoodsPrice()); + repairSoiExportVO.setUserName(st.getUserName()); + if (ObjectUtil.isNotEmpty(st.getInCorpId()) && ObjectUtil.isNotEmpty(companyMap.get(st.getInCorpId()))) { + repairSoiExportVO.setInCorpId(companyMap.get(st.getInCorpId())); + } + if (ObjectUtil.isNotEmpty(st.getOutCorpId()) && ObjectUtil.isNotEmpty(companyMap.get(st.getOutCorpId()))) { + repairSoiExportVO.setOutCorpId(companyMap.get(st.getOutCorpId())); + } + repairSoiExportVO.setStTime(st.getStTime()); + repairSoiExportVO.setRemark(item.getRemark()); + return repairSoiExportVO; + }).collect(Collectors.toList()); + ExcelUtils.write(response, "调拨详细数据.xls", "数据", RepairSoiExportVO.class, list); + } } diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockTransfer/vo/RepairSoiExportVO.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockTransfer/vo/RepairSoiExportVO.java new file mode 100644 index 00000000..893bacc0 --- /dev/null +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockTransfer/vo/RepairSoiExportVO.java @@ -0,0 +1,66 @@ +package cn.iocoder.yudao.module.stockTransfer.vo; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.math.BigDecimal; +import java.time.LocalDateTime; +import java.util.Date; + +/** + * 用于调拨单子表导出VO + * + * @author 小李 + * @date 17:43 2024/12/3 +**/ +@Data +@ExcelIgnoreUnannotated +public class RepairSoiExportVO { + + @ExcelProperty("单号") + private String stNo; + + @ExcelProperty("商品名称") + private String name; + + @ExcelProperty("规格") + private String model; + + @ExcelProperty("商品编码") + private String code; + + @ExcelProperty("条形码") + private String barCode; + + @ExcelProperty("数量") + private Integer goodsCount; + + @ExcelProperty("成本") + private BigDecimal price; + + @ExcelProperty("金额") + private BigDecimal goodsPrice; + + @ExcelProperty("合计金额") + private BigDecimal totalPrice; + + @ExcelProperty("负责人") + private String userName; + + @ExcelProperty("调出门店") + private String outCorpId; + + @ExcelProperty("调入门店") + private String inCorpId; + + @ExcelProperty("调拨时间") + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + private Date stTime; + + @ExcelProperty("备注") + private String remark; +} diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockTransfer/vo/RepairStExportVO.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockTransfer/vo/RepairStExportVO.java new file mode 100644 index 00000000..be8e03a8 --- /dev/null +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockTransfer/vo/RepairStExportVO.java @@ -0,0 +1,54 @@ +package cn.iocoder.yudao.module.stockTransfer.vo; + +import cn.iocoder.yudao.common.RepairDictConstants; +import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; +import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 用于调拨相关的导出VO + * + * @author 小李 + * @date 17:27 2024/12/3 +**/ +@Data +@ExcelIgnoreUnannotated +public class RepairStExportVO { + + @ExcelProperty("调出门店") + private String outCorpId; + + @ExcelProperty("调入门店") + private String inCorpId; + + @ExcelProperty("单号") + private String stNo; + + @ExcelProperty("调拨人") + private String userName; + + @ExcelProperty("总数量") + private Integer itemCount; + + @ExcelProperty("总金额") + private BigDecimal totalPrice; + + @ExcelProperty(value = "状态", converter = DictConvert.class) + @DictFormat(RepairDictConstants.REPAIR_ST_STATUS) + private String stStatus; + + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd") + @ExcelProperty("调拨日期") + private Date stTime; + + @ExcelProperty("备注") + private String remark; +} diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/controller/admin/DlRepairTicketsController.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/controller/admin/DlRepairTicketsController.java index 934e40a1..e01b9d76 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/controller/admin/DlRepairTicketsController.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/controller/admin/DlRepairTicketsController.java @@ -1,15 +1,16 @@ package cn.iocoder.yudao.module.tickets.controller.admin; +import cn.hutool.core.collection.CollUtil; import cn.hutool.core.date.DateUtil; import cn.iocoder.yudao.common.RepairCons; import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.framework.common.util.object.BeanUtils; +import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; import cn.iocoder.yudao.module.tickets.entity.DlRepairTickets; import cn.iocoder.yudao.module.tickets.service.DlRepairTicketsService; -import cn.iocoder.yudao.module.tickets.vo.CustomerAndCarVO; -import cn.iocoder.yudao.module.tickets.vo.DlRepairTicketsReqVO; -import cn.iocoder.yudao.module.tickets.vo.DlRepairTicketsRespVO; -import cn.iocoder.yudao.module.tickets.vo.NoticeCusVO; +import cn.iocoder.yudao.module.tickets.vo.*; +import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import io.swagger.v3.oas.annotations.Operation; import org.apache.commons.lang3.StringUtils; @@ -17,10 +18,11 @@ import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; -import java.util.Date; -import java.util.HashMap; -import java.util.Map; +import java.io.IOException; +import java.util.*; +import java.util.stream.Collectors; +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception0; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; /** @@ -438,5 +440,81 @@ public class DlRepairTicketsController { public CommonResult getCusAndCarById(@RequestParam("id") String id) { return success(dlRepairTicketsService.getCusAndCarById(id)); } + + /** + * 导出数据 + * + * @author 小李 + * @date 14:51 2024/12/3 + * @param repairTicketsReqVO 请求对象 + **/ + @GetMapping("/export") + @Operation(summary = "导出数据") + public void exportData(DlRepairTicketsReqVO repairTicketsReqVO, HttpServletResponse response)throws IOException { + int pageNo = 1, pageSize = 1000; + Page page = new Page<>(pageNo, pageSize); + if (StringUtils.isEmpty(repairTicketsReqVO.getSelectType())) { + //查询类型为空,默认查待处理的 + repairTicketsReqVO.setSelectType(RepairCons.TICKETS_WAITING); + } + List list = new ArrayList<>(); + do { + IPage pageType = dlRepairTicketsService.getPageType(repairTicketsReqVO, page); + List records = pageType.getRecords(); + if (CollUtil.isEmpty(records)){ + break; + } + List convertedRecords = records.stream().map(item -> BeanUtils.toBean(item, TicketsExportVO.class)).collect(Collectors.toList()); + list.addAll(convertedRecords); + pageNo++; + page.setCurrent(pageNo); + }while (true); + if (CollUtil.isEmpty(list)){ + throw exception0(500, "没有数据可以导出"); + } + ExcelUtils.write(response, "工单数据.xls", "数据", TicketsExportVO.class, list); + } + + /** + * 导出数据 根据工单状态 + * + * @author 小李 + * @date 15:19 2024/12/3 + * @param repairTicketsReqVO 请求对象 + **/ + @GetMapping("/exportByStatus") + @Operation(summary = "导出数据 根据工单状态") + public void exportByStatus(DlRepairTicketsReqVO repairTicketsReqVO, HttpServletResponse response)throws IOException{ + int pageNo = 1, pageSize = 1000; + List list = new ArrayList<>(); + Page page = new Page<>(pageNo, pageSize); + do { + IPage ticketsPage = dlRepairTicketsService.getTicketsPage(repairTicketsReqVO, page); + List records = ticketsPage.getRecords(); + if (CollUtil.isEmpty(records)){ + break; + } + List convertedRecords = records.stream().map(item -> BeanUtils.toBean(item, TicketExportByStatusVO.class)).collect(Collectors.toList()); + list.addAll(convertedRecords); + pageNo++; + page.setCurrent(pageNo); + }while (true); + if (CollUtil.isEmpty(list)){ + throw exception0(500, "没有数据可以导出"); + } + String name = ""; + switch (repairTicketsReqVO.getTicketsStatus()){ + case "01": + name = "待结算工单数据.xls"; + break; + case "02": + name = "已结算工单数据.xls"; + break; + case "03": + name = "已作废工单数据.xls"; + break; + } + ExcelUtils.write(response, name, "数据", TicketExportByStatusVO.class, list); + } } diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/controller/admin/DlTicketWaresController.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/controller/admin/DlTicketWaresController.java index 1df612e4..77ef308e 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/controller/admin/DlTicketWaresController.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/controller/admin/DlTicketWaresController.java @@ -1,18 +1,28 @@ package cn.iocoder.yudao.module.tickets.controller.admin; +import cn.hutool.core.collection.CollUtil; import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.framework.common.util.object.BeanUtils; +import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; import cn.iocoder.yudao.module.tickets.entity.DlTicketWares; import cn.iocoder.yudao.module.tickets.service.DlTicketWaresService; import cn.iocoder.yudao.module.tickets.vo.DlTicketWaresReqVO; import cn.iocoder.yudao.module.tickets.vo.DlTicketWaresRespVO; +import cn.iocoder.yudao.module.tickets.vo.TicketWaresExportVO; +import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import io.swagger.v3.oas.annotations.Operation; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.ArrayList; import java.util.List; +import java.util.stream.Collectors; +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception0; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; /** @@ -210,5 +220,35 @@ public class DlTicketWaresController { public CommonResult getByIds(@RequestParam("ids") List ids){ return success(dlTicketWaresService.getByIds(ids)); } + + /** + * 导出数据 + * + * @author 小李 + * @date 15:02 2024/12/3 + * @param reqVO 请求对象 + **/ + @GetMapping("/export") + @Operation(summary = "导出数据") + public void exportData(DlTicketWaresReqVO reqVO, HttpServletResponse response)throws IOException { + int pageNo = 1, pageSize = 1000; + List list = new ArrayList<>(); + Page page = new Page<>(pageNo, pageSize); + do { + IPage waresServicePage = dlTicketWaresService.getPage(reqVO, page); + List records = waresServicePage.getRecords(); + if (CollUtil.isEmpty(records)){ + break; + } + List convertedRecords = records.stream().map(item -> BeanUtils.toBean(item, TicketWaresExportVO.class)).collect(Collectors.toList()); + list.addAll(convertedRecords); + pageNo++; + page.setCurrent(pageNo); + }while (true); + if (CollUtil.isEmpty(list)){ + throw exception0(500, "没有数据可以导出"); + } + ExcelUtils.write(response, "配件申请单数据.xls", "数据", TicketWaresExportVO.class, list); + } } diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/vo/TicketExportByStatusVO.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/vo/TicketExportByStatusVO.java new file mode 100644 index 00000000..fdc6023c --- /dev/null +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/vo/TicketExportByStatusVO.java @@ -0,0 +1,41 @@ +package cn.iocoder.yudao.module.tickets.vo; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.math.BigDecimal; +import java.time.LocalDateTime; + +/** + * 用于导出不对状态的工单 + * + * @author 小李 + * @date 15:21 2024/12/3 +**/ +@Data +@ExcelIgnoreUnannotated +public class TicketExportByStatusVO extends TicketsExportVO{ + + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") + @DateTimeFormat(pattern="yyyy-MM-dd") + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @ExcelProperty("合计金额") + private BigDecimal totalPrice; + + @ExcelProperty("参考成本") + private BigDecimal cost; + + @ExcelProperty("参考毛利") + private BigDecimal profit; + + @ExcelProperty("服务顾问") + private String adviserName; + + @ExcelProperty("备注") + private String remark; +} diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/vo/TicketWaresExportVO.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/vo/TicketWaresExportVO.java new file mode 100644 index 00000000..900fa039 --- /dev/null +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/vo/TicketWaresExportVO.java @@ -0,0 +1,48 @@ +package cn.iocoder.yudao.module.tickets.vo; + +import cn.iocoder.yudao.common.RepairDictConstants; +import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; +import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import lombok.Data; + +/** + * 用于配件申请单数据导出VO + * + * @author 小李 + * @date 15:03 2024/12/3 +**/ +@Data +@ExcelIgnoreUnannotated +public class TicketWaresExportVO { + + @ExcelProperty("单据号") + private String no; + + @ExcelProperty("客户名称") + private String userName; + + @ExcelProperty("客户电话") + private String userMobile; + + @ExcelProperty("车牌号") + private String licenseNumber; + + @ExcelProperty("申请人") + private String repairName; + + @ExcelProperty(value = "岗位", converter = DictConvert.class) + @DictFormat(RepairDictConstants.REPAIR_WORK_TYPE) + private String repairWork; + + @ExcelProperty("服务顾问") + private String adviserName; + + @ExcelProperty(value = "状态", converter = DictConvert.class) + @DictFormat(RepairDictConstants.TICKET_WARES_STATUS) + private String status; + + @ExcelProperty("备注") + private String remark; +} diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/vo/TicketsExportVO.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/vo/TicketsExportVO.java new file mode 100644 index 00000000..6927d8be --- /dev/null +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/vo/TicketsExportVO.java @@ -0,0 +1,44 @@ +package cn.iocoder.yudao.module.tickets.vo; + +import cn.iocoder.yudao.common.RepairDictConstants; +import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; +import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import lombok.Data; + +/** + * 用于工单数据导出 + * + * @author 小李 + * @date 14:41 2024/12/3 +**/ +@Data +@ExcelIgnoreUnannotated +public class TicketsExportVO { + + @ExcelProperty("订单编号") + private String ticketNo; + + @ExcelProperty(value = "维修类别", converter = DictConvert.class) + @DictFormat(RepairDictConstants.REPAIR_TYPE) + private String repairType; + + @ExcelProperty("客户名称") + private String userName; + + @ExcelProperty("车牌号") + private String carNo; + + @ExcelProperty("车系") + private String carBrandName; + + @ExcelProperty("手机号") + private String userMobile; + + @ExcelProperty("经办人姓名") + private String handleName; + + @ExcelProperty("经办人电话") + private String handleMobile; +}