From 42210fdce8a56d8a2697d689aeecc1160f47e841 Mon Sep 17 00:00:00 2001 From: songguoqiang <765017469@qq.com> Date: Fri, 10 May 2024 08:30:09 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=87=E4=BB=B6=E5=BD=92=E8=BF=98=20?= =?UTF-8?q?=E5=A4=87=E4=BB=B6=E5=87=BA=E5=BA=93=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../itemaccounts/ItemAccountsController.java | 15 ++++++++++- .../itemaccounts/vo/ItemAccountsExcelVO.java | 26 +++++++++++-------- .../ItemInLocationController.java | 6 +++++ .../vo/ItemInLocationExcelVO.java | 22 +++++++++++++--- .../ItemOutLocationController.java | 7 +++++ .../vo/ItemOutLocationExcelVO.java | 22 +++++++++++++--- 6 files changed, 80 insertions(+), 18 deletions(-) diff --git a/win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/controller/itemaccounts/ItemAccountsController.java b/win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/controller/itemaccounts/ItemAccountsController.java index 97b781a..82b5b8f 100644 --- a/win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/controller/itemaccounts/ItemAccountsController.java +++ b/win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/controller/itemaccounts/ItemAccountsController.java @@ -3,6 +3,7 @@ package com.win.module.eam.controller.itemaccounts; import com.win.framework.common.pojo.CommonResult; import com.win.framework.common.pojo.CustomConditions; import com.win.framework.common.pojo.PageResult; +import com.win.framework.dict.core.util.DictFrameworkUtils; import com.win.framework.excel.core.util.ExcelUtils; import com.win.framework.operatelog.core.annotations.OperateLog; import com.win.module.eam.controller.item.vo.ItemRespVO; @@ -13,6 +14,7 @@ import com.win.module.eam.dal.dataobject.item.ItemDO; import com.win.module.eam.dal.dataobject.itemaccounts.ItemAccountsDO; import com.win.module.eam.dal.dataobject.location.LocationDO; import com.win.module.eam.dal.dataobject.locationarea.LocationAreaDO; +import com.win.module.eam.enums.DictTypeConstants; import com.win.module.eam.service.item.ItemService; import com.win.module.eam.service.itemaccounts.ItemAccountsService; import com.win.module.eam.service.location.LocationService; @@ -140,7 +142,18 @@ public class ItemAccountsController { List list = itemAccountsService.getItemAccountsList(exportReqVO); // 导出 Excel List datas = ItemAccountsConvert.INSTANCE.convertList02(list); - ExcelUtils.write(response, "备件台账.xls", "数据", ItemAccountsExcelVO.class, datas); + for(ItemAccountsExcelVO vo:datas){ + ItemDO itemDO = itemService.getByNumber(vo.getItemNumber()); + vo.setItemName(itemDO.getName()); + LocationDO locationDO = locationService.getByNumber(vo.getLocationNumber()); + vo.setLocationName(locationDO.getName()); + LocationAreaDO locationAreaDO = locationAreaService.getByNumber(vo.getAreaNumber()); + vo.setAreaName(locationAreaDO.getName()); + } + Map mapDropDown = new HashMap<>(); + String[] type = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.ITEM_ACCOUNT_LOCATION_TYPE); + mapDropDown.put(7, type); + ExcelUtils.write(response, "备件台账.xls", "数据", ItemAccountsExcelVO.class, datas,mapDropDown); } @GetMapping("/get-import-template") diff --git a/win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/controller/itemaccounts/vo/ItemAccountsExcelVO.java b/win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/controller/itemaccounts/vo/ItemAccountsExcelVO.java index ae8767e..7fb8b1d 100644 --- a/win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/controller/itemaccounts/vo/ItemAccountsExcelVO.java +++ b/win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/controller/itemaccounts/vo/ItemAccountsExcelVO.java @@ -1,5 +1,6 @@ package com.win.module.eam.controller.itemaccounts.vo; +import com.alibaba.excel.annotation.ExcelIgnore; import com.alibaba.excel.annotation.ExcelProperty; import lombok.Data; @@ -17,28 +18,31 @@ public class ItemAccountsExcelVO { @ExcelProperty("备件编号") private String itemNumber; - @ExcelProperty("库区编号") + @ExcelProperty("备件编号") + private String itemName; + + @ExcelProperty("库区名称") private String areaNumber; + @ExcelProperty("库区名称") + private String areaName; + @ExcelProperty("库位编号") private String locationNumber; + @ExcelProperty("库位名称") + private String locationName; + @ExcelProperty("库存数量") private BigDecimal qty; - @ExcelProperty("是否账内库TRUE账内FALSE账外") - private String isInAccount; + @ExcelProperty("库存类型") + private String type; @ExcelProperty("创建时间") private LocalDateTime createTime; + @ExcelIgnore + private String isInAccount; - @ExcelProperty("地点ID") - private String siteId; - - @ExcelProperty("是否可用") - private String available; - - @ExcelProperty("并发乐观锁") - private Integer concurrencyStamp; } diff --git a/win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/controller/iteminlocation/ItemInLocationController.java b/win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/controller/iteminlocation/ItemInLocationController.java index 06209af..1556de8 100644 --- a/win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/controller/iteminlocation/ItemInLocationController.java +++ b/win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/controller/iteminlocation/ItemInLocationController.java @@ -115,6 +115,12 @@ public class ItemInLocationController { List list = itemInLocationService.getItemInLocationList(exportReqVO); // 导出 Excel List datas = ItemInLocationConvert.INSTANCE.convertList02(list); + for(ItemInLocationExcelVO vo:datas){ + ItemDO itemDO = itemService.getByNumber(vo.getItemNumber()); + vo.setItemName(itemDO.getName()); + LocationDO locationDO = locationService.getByNumber(vo.getLocationNumber()); + vo.setLocationName(locationDO.getName()); + } ExcelUtils.write(response, "备件入库记录.xls", "数据", ItemInLocationExcelVO.class, datas); } diff --git a/win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/controller/iteminlocation/vo/ItemInLocationExcelVO.java b/win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/controller/iteminlocation/vo/ItemInLocationExcelVO.java index 2919502..a8ce7e3 100644 --- a/win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/controller/iteminlocation/vo/ItemInLocationExcelVO.java +++ b/win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/controller/iteminlocation/vo/ItemInLocationExcelVO.java @@ -1,5 +1,6 @@ package com.win.module.eam.controller.iteminlocation.vo; +import com.alibaba.excel.annotation.ExcelIgnore; import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; import java.util.*; @@ -17,19 +18,34 @@ import com.alibaba.excel.annotation.ExcelProperty; @Data public class ItemInLocationExcelVO { - @ExcelProperty("入库编号") + @ExcelIgnore private String number; @ExcelProperty("备件编号") private String itemNumber; + @ExcelProperty("备件名称") + private String itemName; + + @ExcelIgnore + private String areaNumber; + + @ExcelIgnore + private String areaName; + @ExcelProperty("库位编号") private String locationNumber; - @ExcelProperty("入库类型") - private String type; + @ExcelProperty("库位名称") + private String locationName; @ExcelProperty("数量") private BigDecimal qty; + @ExcelProperty("领用人") + private String receiver; + + @ExcelProperty("创建时间") + private LocalDateTime createTime; + } diff --git a/win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/controller/itemoutlocation/ItemOutLocationController.java b/win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/controller/itemoutlocation/ItemOutLocationController.java index 1caeae4..fab3cb5 100644 --- a/win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/controller/itemoutlocation/ItemOutLocationController.java +++ b/win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/controller/itemoutlocation/ItemOutLocationController.java @@ -6,6 +6,7 @@ import com.win.framework.common.pojo.PageResult; import com.win.framework.excel.core.util.ExcelUtils; import com.win.framework.operatelog.core.annotations.OperateLog; import com.win.module.eam.controller.itemaccounts.vo.ItemAccountsRespVO; +import com.win.module.eam.controller.iteminlocation.vo.ItemInLocationExcelVO; import com.win.module.eam.controller.itemoutlocation.vo.*; import com.win.module.eam.convert.itemoutlocation.ItemOutLocationConvert; import com.win.module.eam.dal.dataobject.item.ItemDO; @@ -116,6 +117,12 @@ public class ItemOutLocationController { List list = itemOutLocationService.getItemOutLocationList(exportReqVO); // 导出 Excel List datas = ItemOutLocationConvert.INSTANCE.convertList02(list); + for(ItemOutLocationExcelVO vo:datas){ + ItemDO itemDO = itemService.getByNumber(vo.getItemNumber()); + vo.setItemName(itemDO.getName()); + LocationDO locationDO = locationService.getByNumber(vo.getLocationNumber()); + vo.setLocationName(locationDO.getName()); + } ExcelUtils.write(response, "备件出库记录.xls", "数据", ItemOutLocationExcelVO.class, datas); } diff --git a/win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/controller/itemoutlocation/vo/ItemOutLocationExcelVO.java b/win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/controller/itemoutlocation/vo/ItemOutLocationExcelVO.java index 28974d5..677428a 100644 --- a/win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/controller/itemoutlocation/vo/ItemOutLocationExcelVO.java +++ b/win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/controller/itemoutlocation/vo/ItemOutLocationExcelVO.java @@ -1,5 +1,6 @@ package com.win.module.eam.controller.itemoutlocation.vo; +import com.alibaba.excel.annotation.ExcelIgnore; import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; import java.util.*; @@ -17,19 +18,34 @@ import com.alibaba.excel.annotation.ExcelProperty; @Data public class ItemOutLocationExcelVO { - @ExcelProperty("出库编号") + @ExcelIgnore private String number; @ExcelProperty("备件编号") private String itemNumber; + @ExcelProperty("备件名称") + private String itemName; + + @ExcelIgnore + private String areaNumber; + + @ExcelIgnore + private String areaName; + @ExcelProperty("库位编号") private String locationNumber; - @ExcelProperty("出库类型") - private String type; + @ExcelProperty("库位名称") + private String locationName; @ExcelProperty("数量") private BigDecimal qty; + @ExcelProperty("领用人") + private String receiver; + + @ExcelProperty("创建时间") + private LocalDateTime createTime; + }