|
|
@ -107,8 +107,8 @@ public class InventorymoveRecordMainController { |
|
|
|
PageResult<InventorymoveRecordMainRespVO> result = InventorymoveRecordMainConvert.INSTANCE.convertPage(pageResult); |
|
|
|
for(InventorymoveRecordMainRespVO vo : result.getList()) { |
|
|
|
//后端创建个字段作为前端展示的虚拟字段
|
|
|
|
vo.setCreator(userApi.getUser(Long.valueOf(vo.getCreator())).getNickname()); |
|
|
|
vo.setDepartmentCode(deptApi.getDept(userApi.getUser(Long.valueOf(vo.getCreator())).getDeptId()).getName()); |
|
|
|
vo.setCreator(userApi.getUser(Long.valueOf(vo.getCreator())).getNickname()); |
|
|
|
} |
|
|
|
return success(result); |
|
|
|
} |
|
|
@ -121,8 +121,8 @@ public class InventorymoveRecordMainController { |
|
|
|
PageResult<InventorymoveRecordMainRespVO> result = InventorymoveRecordMainConvert.INSTANCE.convertPage(pageResult); |
|
|
|
for(InventorymoveRecordMainRespVO vo : result.getList()) { |
|
|
|
//后端创建个字段作为前端展示的虚拟字段
|
|
|
|
vo.setCreator(userApi.getUser(Long.valueOf(vo.getCreator())).getNickname()); |
|
|
|
vo.setDepartmentCode(deptApi.getDept(userApi.getUser(Long.valueOf(vo.getCreator())).getDeptId()).getName()); |
|
|
|
vo.setCreator(userApi.getUser(Long.valueOf(vo.getCreator())).getNickname()); |
|
|
|
} |
|
|
|
return success(result); |
|
|
|
} |
|
|
@ -134,17 +134,14 @@ public class InventorymoveRecordMainController { |
|
|
|
HttpServletResponse response) throws IOException { |
|
|
|
List<InventorymoveRecordMainDO> list = inventorymoveRecordMainService.getInventorymoveRecordMainList(exportReqVO); |
|
|
|
// 导出 Excel
|
|
|
|
List<InventorymoveRecordMainExcelVO> datas = InventorymoveRecordMainConvert.INSTANCE.convertList02(list); |
|
|
|
for(InventorymoveRecordMainExcelVO vo : datas) { |
|
|
|
AdminUserRespDTO user = userApi.getUser(Long.valueOf(vo.getCreator())); |
|
|
|
//后端创建个字段作为前端展示的虚拟字段
|
|
|
|
vo.setCreator(user.getNickname()); |
|
|
|
} |
|
|
|
ExcelUtils.write(response, "库存转移记录主.xls", "数据", InventorymoveRecordMainExcelVO.class, datas); |
|
|
|
//组装vo
|
|
|
|
Map<Integer, String[]> mapDropDown = new HashMap<>(); |
|
|
|
List<InventorymoveRecordMainExcelVO> resultList = this.getExcelVo(list, mapDropDown); |
|
|
|
ExcelUtils.write(response, "库存转移申请.xlsx", "库存转移申请数据", InventorymoveRecordMainExcelVO.class, resultList, mapDropDown); |
|
|
|
} |
|
|
|
|
|
|
|
@GetMapping("/export-excel-senior") |
|
|
|
@Operation(summary = "导出库存转移申请 Excel") |
|
|
|
@Operation(summary = "导出库存转移记录主 Excel") |
|
|
|
@PreAuthorize("@ss.hasPermission('wms:inventorymove-record-main:export')") |
|
|
|
@OperateLog(type = EXPORT) |
|
|
|
public void exportInventorymoveRecordMainSeniorExcel(@Valid @RequestBody CustomConditions conditions, HttpServletResponse response) throws IOException { |
|
|
@ -158,27 +155,27 @@ public class InventorymoveRecordMainController { |
|
|
|
private List<InventorymoveRecordMainExcelVO> getExcelVo(List<InventorymoveRecordMainDO> list, Map<Integer, String[]> mapDropDown) { |
|
|
|
String[] trueFalse = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.TRUE_FALSE); |
|
|
|
mapDropDown.put(3, trueFalse); |
|
|
|
mapDropDown.put(23, trueFalse); |
|
|
|
mapDropDown.put(22, trueFalse); |
|
|
|
String[] interfaceType = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.INTERFACE_TYPE); |
|
|
|
mapDropDown.put(11, interfaceType); |
|
|
|
mapDropDown.put(48, interfaceType); |
|
|
|
mapDropDown.put(46, interfaceType); |
|
|
|
String[] locationType = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.LOCATION_TYPE); |
|
|
|
mapDropDown.put(18, locationType); |
|
|
|
mapDropDown.put(21, locationType); |
|
|
|
mapDropDown.put(17, locationType); |
|
|
|
mapDropDown.put(20, locationType); |
|
|
|
String[] inventoryStatus = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.INVENTORY_STATUS); |
|
|
|
mapDropDown.put(32, inventoryStatus); |
|
|
|
mapDropDown.put(40, inventoryStatus); |
|
|
|
mapDropDown.put(31, inventoryStatus); |
|
|
|
mapDropDown.put(39, inventoryStatus); |
|
|
|
String[] uom = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.UOM); |
|
|
|
mapDropDown.put(46, uom); |
|
|
|
mapDropDown.put(45, uom); |
|
|
|
List<InventorymoveRecordMainExcelVO> resultList = new ArrayList<>(); |
|
|
|
// 导出
|
|
|
|
for(InventorymoveRecordMainDO mainDO : list) { |
|
|
|
List<InventorymoveRecordDetailDO> subList = inventorymoveRecordDetailService.selectList(mainDO.getId()); |
|
|
|
for(InventorymoveRecordDetailDO detailDO : subList) { |
|
|
|
InventorymoveRecordMainExcelVO vo = InventorymoveRecordMainConvert.INSTANCE.convert(mainDO, detailDO); |
|
|
|
vo.setDepartmentCode(deptApi.getDept(userApi.getUser(Long.valueOf(vo.getCreator())).getDeptId()).getName()); |
|
|
|
vo.setCreator(userApi.getUser(Long.valueOf(mainDO.getCreator())).getNickname()); |
|
|
|
vo.setCreatorDetail(userApi.getUser(Long.valueOf(detailDO.getCreator())).getNickname()); |
|
|
|
vo.setDepartmentCode(deptApi.getDept(userApi.getUser(Long.valueOf(vo.getCreator())).getDeptId()).getName()); |
|
|
|
resultList.add(vo); |
|
|
|
} |
|
|
|
} |
|
|
|