| | |
| | | SrmSupplierExcelVO excelVO = BeanUtils.toBean(supplier, SrmSupplierExcelVO.class); |
| | | excelVO.setType(toTypeLabel(supplier.getType())); |
| | | excelVO.setStatus(toStatusLabel(supplier.getStatus())); |
| | | excelVO.setOnlineStatusLabel(toOnlineStatusLabel(supplier.getOnlineStatus())); |
| | | excelVO.setPurchaseCategoryLabel(toPurchaseCategoryLabel(supplier.getPurchaseCategory())); |
| | | excelList.add(excelVO); |
| | | } |
| | | ExcelUtils.write(response, "供应商数据.xlsx", "供应商", SrmSupplierExcelVO.class, excelList); |
| | |
| | | /** |
| | | * 状态 0 启用 / 1 禁用 -> 中文文案;空值返回空 |
| | | */ |
| | | private static String toPurchaseCategoryLabel(Integer purchaseCategory) { |
| | | if (purchaseCategory == null || purchaseCategory == 0) { |
| | | return "未分类"; |
| | | } |
| | | return purchaseCategory == 2 ? "原辅料" : "代理商品"; |
| | | } |
| | | |
| | | private static String toOnlineStatusLabel(Integer onlineStatus) { |
| | | if (onlineStatus == null) { |
| | | return "在线"; |
| | | } |
| | | return onlineStatus == 2 ? "离线" : "在线"; |
| | | } |
| | | |
| | | private static String toStatusLabel(Integer status) { |
| | | if (status == null) { |
| | | return null; |