Browse Source

备件归还 备件出库导出

master
songguoqiang 6 months ago
parent
commit
42210fdce8
  1. 15
      win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/controller/itemaccounts/ItemAccountsController.java
  2. 26
      win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/controller/itemaccounts/vo/ItemAccountsExcelVO.java
  3. 6
      win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/controller/iteminlocation/ItemInLocationController.java
  4. 22
      win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/controller/iteminlocation/vo/ItemInLocationExcelVO.java
  5. 7
      win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/controller/itemoutlocation/ItemOutLocationController.java
  6. 22
      win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/controller/itemoutlocation/vo/ItemOutLocationExcelVO.java

15
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.CommonResult;
import com.win.framework.common.pojo.CustomConditions; import com.win.framework.common.pojo.CustomConditions;
import com.win.framework.common.pojo.PageResult; 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.excel.core.util.ExcelUtils;
import com.win.framework.operatelog.core.annotations.OperateLog; import com.win.framework.operatelog.core.annotations.OperateLog;
import com.win.module.eam.controller.item.vo.ItemRespVO; 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.itemaccounts.ItemAccountsDO;
import com.win.module.eam.dal.dataobject.location.LocationDO; import com.win.module.eam.dal.dataobject.location.LocationDO;
import com.win.module.eam.dal.dataobject.locationarea.LocationAreaDO; 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.item.ItemService;
import com.win.module.eam.service.itemaccounts.ItemAccountsService; import com.win.module.eam.service.itemaccounts.ItemAccountsService;
import com.win.module.eam.service.location.LocationService; import com.win.module.eam.service.location.LocationService;
@ -140,7 +142,18 @@ public class ItemAccountsController {
List<ItemAccountsDO> list = itemAccountsService.getItemAccountsList(exportReqVO); List<ItemAccountsDO> list = itemAccountsService.getItemAccountsList(exportReqVO);
// 导出 Excel // 导出 Excel
List<ItemAccountsExcelVO> datas = ItemAccountsConvert.INSTANCE.convertList02(list); List<ItemAccountsExcelVO> 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<Integer, String[]> 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") @GetMapping("/get-import-template")

26
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; package com.win.module.eam.controller.itemaccounts.vo;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data; import lombok.Data;
@ -17,28 +18,31 @@ public class ItemAccountsExcelVO {
@ExcelProperty("备件编号") @ExcelProperty("备件编号")
private String itemNumber; private String itemNumber;
@ExcelProperty("库区编号") @ExcelProperty("备件编号")
private String itemName;
@ExcelProperty("库区名称")
private String areaNumber; private String areaNumber;
@ExcelProperty("库区名称")
private String areaName;
@ExcelProperty("库位编号") @ExcelProperty("库位编号")
private String locationNumber; private String locationNumber;
@ExcelProperty("库位名称")
private String locationName;
@ExcelProperty("库存数量") @ExcelProperty("库存数量")
private BigDecimal qty; private BigDecimal qty;
@ExcelProperty("是否账内库TRUE账内FALSE账外") @ExcelProperty("库存类型")
private String isInAccount; private String type;
@ExcelProperty("创建时间") @ExcelProperty("创建时间")
private LocalDateTime createTime; private LocalDateTime createTime;
@ExcelIgnore
private String isInAccount;
@ExcelProperty("地点ID")
private String siteId;
@ExcelProperty("是否可用")
private String available;
@ExcelProperty("并发乐观锁")
private Integer concurrencyStamp;
} }

6
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<ItemInLocationDO> list = itemInLocationService.getItemInLocationList(exportReqVO); List<ItemInLocationDO> list = itemInLocationService.getItemInLocationList(exportReqVO);
// 导出 Excel // 导出 Excel
List<ItemInLocationExcelVO> datas = ItemInLocationConvert.INSTANCE.convertList02(list); List<ItemInLocationExcelVO> 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); ExcelUtils.write(response, "备件入库记录.xls", "数据", ItemInLocationExcelVO.class, datas);
} }

22
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; package com.win.module.eam.controller.iteminlocation.vo;
import com.alibaba.excel.annotation.ExcelIgnore;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*; import lombok.*;
import java.util.*; import java.util.*;
@ -17,19 +18,34 @@ import com.alibaba.excel.annotation.ExcelProperty;
@Data @Data
public class ItemInLocationExcelVO { public class ItemInLocationExcelVO {
@ExcelProperty("入库编号") @ExcelIgnore
private String number; private String number;
@ExcelProperty("备件编号") @ExcelProperty("备件编号")
private String itemNumber; private String itemNumber;
@ExcelProperty("备件名称")
private String itemName;
@ExcelIgnore
private String areaNumber;
@ExcelIgnore
private String areaName;
@ExcelProperty("库位编号") @ExcelProperty("库位编号")
private String locationNumber; private String locationNumber;
@ExcelProperty("入库类型") @ExcelProperty("库位名称")
private String type; private String locationName;
@ExcelProperty("数量") @ExcelProperty("数量")
private BigDecimal qty; private BigDecimal qty;
@ExcelProperty("领用人")
private String receiver;
@ExcelProperty("创建时间")
private LocalDateTime createTime;
} }

7
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.excel.core.util.ExcelUtils;
import com.win.framework.operatelog.core.annotations.OperateLog; import com.win.framework.operatelog.core.annotations.OperateLog;
import com.win.module.eam.controller.itemaccounts.vo.ItemAccountsRespVO; 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.controller.itemoutlocation.vo.*;
import com.win.module.eam.convert.itemoutlocation.ItemOutLocationConvert; import com.win.module.eam.convert.itemoutlocation.ItemOutLocationConvert;
import com.win.module.eam.dal.dataobject.item.ItemDO; import com.win.module.eam.dal.dataobject.item.ItemDO;
@ -116,6 +117,12 @@ public class ItemOutLocationController {
List<ItemOutLocationDO> list = itemOutLocationService.getItemOutLocationList(exportReqVO); List<ItemOutLocationDO> list = itemOutLocationService.getItemOutLocationList(exportReqVO);
// 导出 Excel // 导出 Excel
List<ItemOutLocationExcelVO> datas = ItemOutLocationConvert.INSTANCE.convertList02(list); List<ItemOutLocationExcelVO> 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); ExcelUtils.write(response, "备件出库记录.xls", "数据", ItemOutLocationExcelVO.class, datas);
} }

22
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; package com.win.module.eam.controller.itemoutlocation.vo;
import com.alibaba.excel.annotation.ExcelIgnore;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*; import lombok.*;
import java.util.*; import java.util.*;
@ -17,19 +18,34 @@ import com.alibaba.excel.annotation.ExcelProperty;
@Data @Data
public class ItemOutLocationExcelVO { public class ItemOutLocationExcelVO {
@ExcelProperty("出库编号") @ExcelIgnore
private String number; private String number;
@ExcelProperty("备件编号") @ExcelProperty("备件编号")
private String itemNumber; private String itemNumber;
@ExcelProperty("备件名称")
private String itemName;
@ExcelIgnore
private String areaNumber;
@ExcelIgnore
private String areaName;
@ExcelProperty("库位编号") @ExcelProperty("库位编号")
private String locationNumber; private String locationNumber;
@ExcelProperty("出库类型") @ExcelProperty("库位名称")
private String type; private String locationName;
@ExcelProperty("数量") @ExcelProperty("数量")
private BigDecimal qty; private BigDecimal qty;
@ExcelProperty("领用人")
private String receiver;
@ExcelProperty("创建时间")
private LocalDateTime createTime;
} }

Loading…
Cancel
Save