| | |
| | | } |
| | | |
| | | @GetMapping("/simple-list") |
| | | @Operation(summary = "获取供应商精简列表(仅返回已通过准入审批的供应商)") |
| | | @Operation(summary = "获取供应商精简列表(返回启用状态的供应商档案)") |
| | | public CommonResult<List<SrmSupplierRespVO>> getSupplierSimpleList() { |
| | | List<SrmSupplierDO> list = supplierService.getSupplierSimpleList(); |
| | | return success(BeanUtils.toBean(list, SrmSupplierRespVO.class)); |
| | |
| | | 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; |