|
|
@ -3,6 +3,7 @@ package com.win.module.eam.controller.transaction; |
|
|
|
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.ItemPageReqVO; |
|
|
@ -12,6 +13,7 @@ import com.win.module.eam.convert.item.ItemConvert; |
|
|
|
import com.win.module.eam.convert.transaction.TransactionConvert; |
|
|
|
import com.win.module.eam.dal.dataobject.item.ItemDO; |
|
|
|
import com.win.module.eam.dal.dataobject.transaction.TransactionDO; |
|
|
|
import com.win.module.eam.enums.DictTypeConstants; |
|
|
|
import com.win.module.eam.service.item.ItemService; |
|
|
|
import com.win.module.eam.service.transaction.TransactionService; |
|
|
|
import io.swagger.v3.oas.annotations.Operation; |
|
|
@ -25,9 +27,7 @@ import javax.annotation.Resource; |
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
import javax.validation.Valid; |
|
|
|
import java.io.IOException; |
|
|
|
import java.util.Arrays; |
|
|
|
import java.util.Collection; |
|
|
|
import java.util.List; |
|
|
|
import java.util.*; |
|
|
|
|
|
|
|
import static com.win.framework.common.pojo.CommonResult.success; |
|
|
|
import static com.win.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; |
|
|
@ -101,9 +101,14 @@ public class TransactionController { |
|
|
|
public void exportExcel(@Valid TransactionExportReqVO exportReqVO, |
|
|
|
HttpServletResponse response) throws IOException { |
|
|
|
List<TransactionDO> list = Service.getList(exportReqVO); |
|
|
|
Map<Integer, String[]> mapDropDown = new HashMap<>(); |
|
|
|
String[] transaction_type = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.TRANSACTION_TYPE); |
|
|
|
String[] inventory_action = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.INVENTORY_ACTION); |
|
|
|
mapDropDown.put(2, transaction_type); |
|
|
|
mapDropDown.put(3, inventory_action); |
|
|
|
// 导出 Excel
|
|
|
|
List<TransactionExcelVO> datas = TransactionConvert.INSTANCE.convertList02(list); |
|
|
|
ExcelUtils.write(response, "库存事务.xls", "数据", TransactionExcelVO.class, datas); |
|
|
|
ExcelUtils.write(response, "库存事务.xls", "数据", TransactionExcelVO.class, datas,mapDropDown); |
|
|
|
} |
|
|
|
|
|
|
|
@GetMapping("/get-import-template") |
|
|
|