diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/supplier/controller/admin/BaseSupplierController.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/supplier/controller/admin/BaseSupplierController.java index 106a4fb7..1eac0d2f 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/supplier/controller/admin/BaseSupplierController.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/supplier/controller/admin/BaseSupplierController.java @@ -1,12 +1,16 @@ package cn.iocoder.yudao.module.supplier.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.supplier.entity.BaseSupplier; import cn.iocoder.yudao.module.supplier.service.BaseSupplierService; import cn.iocoder.yudao.module.supplier.vo.BaseSupplierPageReqVO; import cn.iocoder.yudao.module.supplier.vo.BaseSupplierRespVO; import cn.iocoder.yudao.module.supplier.vo.BaseSupplierSaveReqVO; +import cn.iocoder.yudao.module.supplier.vo.SupplierExportVO; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; @@ -18,8 +22,15 @@ 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.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 = "管理后台 - 供应商") @@ -137,4 +148,40 @@ public class BaseSupplierController { .like(BaseSupplier::getName,name); return success(baseSupplierService.list(queryWrapper)); } + + /** + * 导出数据 + * + * @author 小李 + * @date 17:30 2024/12/2 + * @param pageReqVO 请求对象 + **/ + @GetMapping("/export") + @Operation(summary = "导出数据") + public void exportData(BaseSupplierPageReqVO pageReqVO, HttpServletResponse response)throws IOException { + int pageNo = 1, pageSize = 1000; + List list = new ArrayList<>(); + Page page = new Page<>(pageNo, pageSize); + do { + IPage baseSupplierRespVOIPage = baseSupplierService.queryListPage(pageReqVO, page); + List records = baseSupplierRespVOIPage.getRecords(); + if (CollUtil.isEmpty(records)){ + break; + } + List convertedRecords = records.stream().map(item -> BeanUtils.toBean(item, SupplierExportVO.class)).collect(Collectors.toList()); + list.addAll(convertedRecords); + pageNo++; + page.setCurrent(pageNo); + }while (true); + if (CollUtil.isEmpty(list)){ + throw exception0(500, "没有数据可以导出"); + } + list.forEach(item -> { + if (ObjectUtil.isNotEmpty(item.getStatus())){ + item.setStatus(item.getStatus().equals("01") ? "启用" : "禁用"); + } + item.setCorpId(ObjectUtil.isEmpty(item.getCorpId()) ? "未绑定": "已绑定"); + }); + ExcelUtils.write(response, "供应商数据.xls", "数据", SupplierExportVO.class, list); + } } \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/supplier/vo/SupplierExportVO.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/supplier/vo/SupplierExportVO.java new file mode 100644 index 00000000..33c0334c --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/supplier/vo/SupplierExportVO.java @@ -0,0 +1,43 @@ +package cn.iocoder.yudao.module.supplier.vo; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import lombok.Data; + +/** + * 用于导出供应商VO + * + * @author 小李 + * @date 17:30 2024/12/2 +**/ +@Data +@ExcelIgnoreUnannotated +public class SupplierExportVO { + + @ExcelProperty("供应商名称") + private String name; + + @ExcelProperty("联系人") + private String linkName; + + @ExcelProperty("联系电话") + private String linkPhone; + + @ExcelProperty("手机号码") + private String phone; + + @ExcelProperty("传真") + private String fax; + + @ExcelProperty("地址") + private String address; + + @ExcelProperty("状态") + private String status; + + @ExcelProperty("备注") + private String remark; + + @ExcelProperty("绑定状态") + private String corpId; +} 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 c58e973d..a410cdb0 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 @@ -19,4 +19,7 @@ public interface RepairDictConstants { /** 配件相关提醒配置 */ String REPAIR_WARES_NOTICE = "repair_wares_notice"; + + /** 维修工人工种 */ + String REPAIR_WORK_TYPE = "repair_work_type"; } diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/controller/admin/RepairWorkerController.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/controller/admin/RepairWorkerController.java index 6c61363e..b298da64 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/controller/admin/RepairWorkerController.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/controller/admin/RepairWorkerController.java @@ -1,15 +1,19 @@ package cn.iocoder.yudao.module.base.controller.admin; +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.ObjectUtil; import cn.iocoder.yudao.common.MessageSend; import cn.iocoder.yudao.common.dto.MessageDTO; 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.app.controller.admin.NotifyMessageSocket; import cn.iocoder.yudao.module.base.entity.RepairWorker; import cn.iocoder.yudao.module.base.service.RepairWorkerService; import cn.iocoder.yudao.module.base.vo.RepairWorkerPageReqVO; import cn.iocoder.yudao.module.base.vo.RepairWorkerRespVO; import cn.iocoder.yudao.module.base.vo.RepairWorkerSaveReqVO; +import cn.iocoder.yudao.module.base.vo.WorkerExportVO; import cn.iocoder.yudao.module.system.api.user.dto.UserDTO; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; @@ -21,11 +25,14 @@ import org.springframework.validation.annotation.Validated; 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.common.BaseConstants.QUALS_INTERIM_PERIOD; +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception0; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.ok; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; @@ -168,4 +175,41 @@ public class RepairWorkerController { } return ok(); } + + /** + * 导出数据 + * + * @author 小李 + * @date 17:50 2024/12/2 + * @param pageReqVO 请求对象 + **/ + @GetMapping("/export") + @Operation(summary = "导出数据") + public void exportData(RepairWorkerPageReqVO pageReqVO, HttpServletResponse response)throws IOException{ + int pageNo = 1, pageSize = 1000; + List list = new ArrayList<>(); + Page page = new Page<>(pageNo,pageSize); + do { + IPage repairWorkerRespVOIPage = workerService.queryListPage(pageReqVO, page); + List records = repairWorkerRespVOIPage.getRecords(); + if (CollUtil.isEmpty(records)){ + break; + } + List convertedRecords = records.stream().map(item -> BeanUtils.toBean(item, WorkerExportVO.class)).collect(Collectors.toList()); + list.addAll(convertedRecords); + pageNo++; + page.setCurrent(pageNo); + }while (true); + + if (CollUtil.isEmpty(list)){ + throw exception0(500, "没有数据可以导出"); + } + + list.forEach(item -> { + if (ObjectUtil.isNotEmpty(item.getIsLeads())){ + item.setIsLeads(item.getIsLeads().equals("1") ? "班组长" : "维修工"); + } + }); + ExcelUtils.write(response, "维修工人数据.xls", "数据", WorkerExportVO.class, list); + } } \ No newline at end of file diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/vo/WorkerExportVO.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/vo/WorkerExportVO.java new file mode 100644 index 00000000..cd56d743 --- /dev/null +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/vo/WorkerExportVO.java @@ -0,0 +1,32 @@ +package cn.iocoder.yudao.module.base.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 17:45 2024/12/2 +**/ +@Data +@ExcelIgnoreUnannotated +public class WorkerExportVO { + + @ExcelProperty("姓名") + private String userName; + + @ExcelProperty(value = "工种", converter = DictConvert.class) + @DictFormat(RepairDictConstants.REPAIR_WORK_TYPE) + private String workType; + + @ExcelProperty("角色") + private String isLeads; + + @ExcelProperty("备注") + private String remark; +} diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/other/controller/admin/DlRepairOtherController.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/other/controller/admin/DlRepairOtherController.java index bd059a11..41451de2 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/other/controller/admin/DlRepairOtherController.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/other/controller/admin/DlRepairOtherController.java @@ -1,20 +1,30 @@ package cn.iocoder.yudao.module.other.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.other.entity.DlRepairOther; import cn.iocoder.yudao.module.other.service.DlRepairOtherService; import cn.iocoder.yudao.module.other.vo.DlRepairOtherReqVO; import cn.iocoder.yudao.module.other.vo.DlRepairOtherRespVO; +import cn.iocoder.yudao.module.other.vo.OtherExportVO; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +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.Comparator; 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; /** @@ -84,5 +94,42 @@ public class DlRepairOtherController { List list = dlRepairOtherService.list(new LambdaQueryWrapper().eq(DlRepairOther::getName, name)); return success(list.stream().max(Comparator.comparing(DlRepairOther::getCreateTime)).orElse(null)); } + + /** + * 导出数据 + * + * @author 小李 + * @date 16:39 2024/12/2 + * @param repairOtherReqVO 请求对象 + **/ + @GetMapping("/export") + @Operation(summary = "导出数据") + public void exportData(DlRepairOtherReqVO repairOtherReqVO, HttpServletResponse response) throws IOException { + int pageNo = 1, pageSize = 1000; + List list = new ArrayList<>(); + Page page = new Page<>(pageNo, pageSize); + do { + IPage otherPage = dlRepairOtherService.getOtherPage(repairOtherReqVO, page); + List records = otherPage.getRecords(); + + if (CollUtil.isEmpty(records)){ + break; + } + + List convertedRecords = records.stream() + .map(item -> BeanUtils.toBean(item, OtherExportVO.class)) + .collect(Collectors.toList()); + list.addAll(convertedRecords); + + pageNo++; + page.setCurrent(pageNo); + } while (true); + + if (CollUtil.isEmpty(list)){ + throw exception0(500, "没有数据可以导出"); + } + + ExcelUtils.write(response, "附加数据.xls", "数据", OtherExportVO.class, list); + } } diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/other/vo/OtherExportVO.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/other/vo/OtherExportVO.java new file mode 100644 index 00000000..80f352e6 --- /dev/null +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/other/vo/OtherExportVO.java @@ -0,0 +1,24 @@ +package cn.iocoder.yudao.module.other.vo; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 用于导出维修附加内容的VO + * + * @author 小李 + * @date 16:20 2024/12/2 +**/ +@Data +@ExcelIgnoreUnannotated +public class OtherExportVO { + + @ExcelProperty("名称") + private String name; + + @ExcelProperty("价格") + private BigDecimal price; +} diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/controller/admin/RepairProjectController.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/controller/admin/RepairProjectController.java index db435e3d..b324a1f2 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/controller/admin/RepairProjectController.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/controller/admin/RepairProjectController.java @@ -1,28 +1,38 @@ package cn.iocoder.yudao.module.project.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.conf.entity.BaseType; +import cn.iocoder.yudao.module.conf.entity.BaseWarehouse; +import cn.iocoder.yudao.module.conf.service.BaseTypeService; +import cn.iocoder.yudao.module.conf.service.BaseWarehouseService; import cn.iocoder.yudao.module.project.entity.RepairProject; import cn.iocoder.yudao.module.project.service.RepairProjectService; -import cn.iocoder.yudao.module.project.vo.RepairProjectPageReqVO; -import cn.iocoder.yudao.module.project.vo.RepairProjectRespVO; -import cn.iocoder.yudao.module.project.vo.RepairProjectSaveReqVO; +import cn.iocoder.yudao.module.project.vo.*; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.context.annotation.Lazy; 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.util.ArrayList; import java.util.Comparator; 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; @Tag(name = "管理后台 - 维修项目") @@ -34,6 +44,14 @@ public class RepairProjectController { @Resource private RepairProjectService repairProjectService; + @Resource + @Lazy + private BaseWarehouseService warehouseService; + + @Resource + @Lazy + private BaseTypeService typeService; + /** * 创建维修项目 * @@ -137,4 +155,46 @@ public class RepairProjectController { public CommonResult getRepairProjectAndCateGory(){ return success(repairProjectService.getRepairProjectAndCateGory()); } + + /** + * 导出数据 + * + * @author 小李 + * @date 17:09 2024/12/2 + * @param pageReqVO 请求对象 + **/ + @GetMapping("/export") + @Operation(summary = "导出数据") + public void exportData(RepairProjectPageReqVO pageReqVO, HttpServletResponse response)throws IOException { + int pageNo = 1, pageSize = 1000; + List list = new ArrayList<>(); + Page page = new Page<>(pageNo, pageSize); + do { + IPage repairProjectRespVOIPage = repairProjectService.queryListPage(pageReqVO, page); + List records = repairProjectRespVOIPage.getRecords(); + + if (CollUtil.isEmpty(records)){ + break; + } + + records.forEach(item -> { + if (ObjectUtil.isNotEmpty(item.getTypeName())){ + item.setType(item.getTypeName()); + } + }); + + List convertedRecords = records.stream().map(item -> BeanUtils.toBean(item, ProjectExportVO.class)).collect(Collectors.toList()); + list.addAll(convertedRecords); + + pageNo++; + page.setCurrent(pageNo); + }while (true); + + if (CollUtil.isEmpty(list)){ + throw exception0(500, "没有数据可以导出"); + } + + ExcelUtils.write(response, "维修项目数据.xls", "数据", ProjectExportVO.class, list); + } + } \ No newline at end of file diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/controller/admin/RepairWaresController.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/controller/admin/RepairWaresController.java index 16a08e30..163e09bf 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/controller/admin/RepairWaresController.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/controller/admin/RepairWaresController.java @@ -1,16 +1,25 @@ package cn.iocoder.yudao.module.project.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.conf.entity.BaseType; +import cn.iocoder.yudao.module.conf.entity.BaseWarehouse; +import cn.iocoder.yudao.module.conf.service.BaseTypeService; +import cn.iocoder.yudao.module.conf.service.BaseWarehouseService; import cn.iocoder.yudao.module.project.entity.RepairWares; import cn.iocoder.yudao.module.project.service.RepairWaresService; import cn.iocoder.yudao.module.project.vo.*; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Parameters; import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.context.annotation.Lazy; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; @@ -19,10 +28,15 @@ import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; import javax.validation.Valid; +import java.io.IOException; import java.math.BigDecimal; +import java.util.ArrayList; import java.util.Collections; 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; @Tag(name = "管理后台 - 配件库") @@ -34,6 +48,14 @@ public class RepairWaresController { @Resource private RepairWaresService waresService; + @Resource + @Lazy + private BaseWarehouseService warehouseService; + + @Resource + @Lazy + private BaseTypeService typeService; + /** * 创建配件库 * @@ -193,4 +215,54 @@ public class RepairWaresController { List list = ExcelUtils.read(file, RepairWaresExcelVO.class); return success(waresService.importData(list, updateSupport)); } + + /** + * 导出数据 + * + * @author 小李 + * @date 17:20 2024/12/2 + * @param pageReqVO 请求对象 + **/ + @GetMapping("/export") + @Operation(summary = "导出数据") + public void exportData(RepairWaresPageReqVO pageReqVO, HttpServletResponse response)throws IOException { + int pageNo = 1, pageSize = 1000; + List list = new ArrayList<>(); + Page page = new Page<>(pageNo, pageSize); + do { + IPage waresPage = waresService.getWaresPage(pageReqVO, page); + List records = waresPage.getRecords(); + + if (CollUtil.isEmpty(records)){ + break; + } + + List convertedRecords = records.stream().map(item -> BeanUtils.toBean(item, RepairWaresExcelVO.class)).collect(Collectors.toList()); + list.addAll(convertedRecords); + + pageNo++; + page.setCurrent(pageNo); + }while (true); + + if (CollUtil.isEmpty(list)){ + throw exception0(500, "没有数据可以导出"); + } + + List warehouses = warehouseService.list(); + Map warehousesMap = warehouses.stream().collect(Collectors.toMap(BaseWarehouse::getId, BaseWarehouse::getName)); + + List types = typeService.list(new LambdaQueryWrapper().eq(BaseType::getType, "02")); + Map typesMap = types.stream().collect(Collectors.toMap(BaseType::getId, BaseType::getName)); + + list.forEach(item -> { + if (ObjectUtil.isNotEmpty(item.getWarehouse()) && ObjectUtil.isNotEmpty(warehousesMap.get(item.getWarehouse()))){ + item.setWarehouse(warehousesMap.get(item.getWarehouse())); + } + if (ObjectUtil.isNotEmpty(item.getType()) && ObjectUtil.isNotEmpty(typesMap.get(item.getType()))){ + item.setType(typesMap.get(item.getType())); + } + }); + + ExcelUtils.write(response, "维修配件数据.xls", "数据", RepairWaresExcelVO.class, list); + } } \ No newline at end of file diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/vo/ProjectExportVO.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/vo/ProjectExportVO.java new file mode 100644 index 00000000..67d10018 --- /dev/null +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/vo/ProjectExportVO.java @@ -0,0 +1,57 @@ +package cn.iocoder.yudao.module.project.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.time.LocalDateTime; + +/** + * 用于导出维修项目的VO + * + * @author 小李 + * @date 17:03 2024/12/2 +**/ +@Data +@ExcelIgnoreUnannotated +public class ProjectExportVO { + + @ExcelProperty("名称") + private String name; + + @ExcelProperty("成本") + private Long cost; + + @ExcelProperty("规格") + private String spec; + + @ExcelProperty("售价") + private BigDecimal price; + + @ExcelProperty("编码") + private String code; + + @ExcelProperty(value = "单位", converter = DictConvert.class) + @DictFormat(RepairDictConstants.REPAIR_UNIT) + private String unit; + + @ExcelProperty("分类") + private String type; + + @ExcelProperty("工时") + private String manHour; + + @ExcelProperty("备注") + private String remark; + + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @ExcelProperty("创建时间") + private LocalDateTime createTime; +}