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.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<ItemAccountsDO> list = itemAccountsService.getItemAccountsList(exportReqVO);
// 导出 Excel
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")

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;
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;
}

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);
// 导出 Excel
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);
}

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;
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;
}

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.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<ItemOutLocationDO> list = itemOutLocationService.getItemOutLocationList(exportReqVO);
// 导出 Excel
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);
}

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;
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;
}

Loading…
Cancel
Save