@@ -78,17 +78,17 @@ public class InvwCardDetailsManagerImpl extends AbstractInvwManager implements I | |||
//先校验 | |||
InvwCardDetails cardDetails = repo.findById(dto.getId()).orElse(null); | |||
if (!InvDeviceStatus.NEW.equals(cardDetails.getStatus())){ | |||
throw new ManagerException("设备正常在库时可移除"); | |||
throw new ManagerException("设备正常在库时可移除!"); | |||
} | |||
InvwWarehouse warehouse = warehouseRepo.findByCodeAndStatus(cardDetails.getStoreCode(), EnableStatus.ENABLE); | |||
String agencyId = findAgencyIdByToken(dto.getAccessToken()); | |||
if (warehouse.getWarehouseLevel() == 1){//一级仓库设备黔通人员可操作 | |||
if(!"52010106004".equals(agencyId)){ | |||
throw new ManagerException("一级仓库设备仅黔通人员可操作"); | |||
throw new ManagerException("一级仓库设备仅黔通人员可操作!"); | |||
} | |||
}else { | |||
if (warehouse.getAgencyId().equals(agencyId)){ | |||
throw new ManagerException("二三级仓库仅设备渠道人员可操作"); | |||
if (!warehouse.getAgencyId().equals(agencyId)){ | |||
throw new ManagerException("二三级仓库仅设备渠道人员可操作!"); | |||
} | |||
} | |||
cardDetails.setStatus(InvDeviceStatus.DELETED); | |||
@@ -140,7 +140,7 @@ public class InvwCardDetailsManagerImpl extends AbstractInvwManager implements I | |||
Map<String, String> storeMap = storeList.stream().collect(Collectors.toMap(InvwWarehouse::getCode, InvwWarehouse::getName)); | |||
List<InvwCardDetailsExcelModel> excelModelList2 = excelModelList.stream().peek(t -> t.setStoreName(storeMap.get(t.getStoreCode()))).collect(Collectors.toList()); | |||
File file = EasyExcelUtil.exportExcelFile(InvwCardDetailsExcelModel.class, excelModelList2, "卡设备"); | |||
String filePath = minioUtil.fileUploadHttp(file, "invw", BucketFileBus.INVW); | |||
String filePath = minioUtil.fileUploadHttp(file, BucketFileBus.INVW); | |||
CommExcelFileResponseDTO responseDTO = new CommExcelFileResponseDTO(); | |||
return responseDTO.setFilePath(filePath); | |||
} |
@@ -68,7 +68,7 @@ public class InvwQryCardBatchManagerImpl extends AbstractCommManager implements | |||
// 写入数据 | |||
EasyExcel.write(file, InvwQryCardBatchExcelModel.class).sheet(excelName).doWrite(excelModels); | |||
// 上传文件 | |||
String uploadUrl = minioUtil.fileUploadHttp(file, "invw", BucketFileBus.INVW); | |||
String uploadUrl = minioUtil.fileUploadHttp(file, BucketFileBus.INVW); | |||
CommExcelFileResponseDTO response = new CommExcelFileResponseDTO(); | |||
response.setFilePath(minioUtil.getOuterUrl(uploadUrl)); | |||
return response; |
@@ -68,7 +68,7 @@ public class InvwQryCardsManagerImpl extends AbstractCommManager implements Invw | |||
// 写入数据 | |||
EasyExcel.write(file, InvwQryCardsExcelModel.class).sheet(excelName).doWrite(excelModels); | |||
// 上传文件 | |||
String uploadUrl = minioUtil.fileUploadHttp(file, "invw", BucketFileBus.INVW); | |||
String uploadUrl = minioUtil.fileUploadHttp(file, BucketFileBus.INVW); | |||
CommExcelFileResponseDTO response = new CommExcelFileResponseDTO(); | |||
response.setFilePath(minioUtil.getOuterUrl(uploadUrl)); | |||
return response; |
@@ -83,7 +83,7 @@ public class InvwObuDetailsManagerImpl extends AbstractInvwManager implements In | |||
throw new ManagerException("一级仓库设备仅黔通人员可操作"); | |||
} | |||
}else { | |||
if (warehouse.getAgencyId().equals(agencyId)){ | |||
if (!warehouse.getAgencyId().equals(agencyId)){ | |||
throw new ManagerException("二三级仓库仅设备渠道人员可操作"); | |||
} | |||
} | |||
@@ -156,7 +156,7 @@ public class InvwObuDetailsManagerImpl extends AbstractInvwManager implements In | |||
Map<String, String> storeMap = storeList.stream().collect(Collectors.toMap(InvwWarehouse::getCode, InvwWarehouse::getName)); | |||
List<InvwObuDetailsExcelModel> excelModelList2 = excelModelList.stream().peek(t -> t.setStoreName(storeMap.get(t.getStoreCode()))).collect(Collectors.toList()); | |||
File file = EasyExcelUtil.exportExcelFile(InvwObuDetailsExcelModel.class, excelModelList2, "签设备"); | |||
String filePath = minioUtil.fileUploadHttp(file, "invw", BucketFileBus.INVW); | |||
String filePath = minioUtil.fileUploadHttp(file, BucketFileBus.INVW); | |||
CommExcelFileResponseDTO responseDTO = new CommExcelFileResponseDTO(); | |||
return responseDTO.setFilePath(filePath); | |||
} |
@@ -68,7 +68,7 @@ public class InvwQryObuBatchManagerImpl extends AbstractCommManager implements I | |||
// 写入数据 | |||
EasyExcel.write(file, InvwQryObuBatchExcelModel.class).sheet(excelName).doWrite(excelModels); | |||
// 上传文件 | |||
String uploadUrl = minioUtil.fileUploadHttp(file, "invw", BucketFileBus.INVW); | |||
String uploadUrl = minioUtil.fileUploadHttp(file, BucketFileBus.INVW); | |||
CommExcelFileResponseDTO response = new CommExcelFileResponseDTO(); | |||
response.setFilePath(minioUtil.getOuterUrl(uploadUrl)); | |||
return response; |
@@ -68,7 +68,7 @@ public class InvwQryObusManagerImpl extends AbstractCommManager implements InvwQ | |||
// 写入数据 | |||
EasyExcel.write(file, InvwQryObusExcelModel.class).sheet(excelName).doWrite(excelModels); | |||
// 上传文件 | |||
String uploadUrl = minioUtil.fileUploadHttp(file, "ivnw", BucketFileBus.INVW); | |||
String uploadUrl = minioUtil.fileUploadHttp(file, BucketFileBus.INVW); | |||
CommExcelFileResponseDTO response = new CommExcelFileResponseDTO(); | |||
response.setFilePath(minioUtil.getOuterUrl(uploadUrl)); | |||
return response; |
@@ -217,7 +217,7 @@ public class InvwStocktakingInfoManagerImpl extends AbstractInvwManager implemen | |||
try { | |||
File tempFile = File.createTempFile("temp_error_设备移除错误反馈表", ".xlsx"); | |||
EasyExcel.write(tempFile, InvwStocktakingInfoRemoveModel.class).sheet("设备移除错误反馈表").doWrite(result); | |||
return minioUtil.fileUploadHttp(tempFile, "invw", BucketFileBus.INVW); | |||
return minioUtil.fileUploadHttp(tempFile, BucketFileBus.INVW); | |||
} catch (Exception e) { | |||
throw e; | |||
} |
@@ -106,7 +106,7 @@ public class IssueOrderRefundManagerImpl extends AbstractManagewManager implemen | |||
List<IssueOrderRefund> list = repo.list(pageRequest); | |||
List<IssueOrderRefundExcelModel> excelModelList = SourceTargetMapper.INSTANCE.orderRefundToModelList(list); | |||
File file = EasyExcelUtil.exportExcelFile(IssueOrderRefundExcelModel.class, excelModelList, "退费管理"); | |||
String filePath = minioUtil.fileUploadHttp(file, "managew", BucketFileBus.MANAGEW); | |||
String filePath = minioUtil.fileUploadHttp(file, BucketFileBus.MANAGEW); | |||
return new IssueOrderRefundExportResponseDTO(filePath); | |||
} | |||
@@ -109,7 +109,7 @@ public class IssueOrderRefundManagerImpl extends AbstractSettlewManager implemen | |||
List<IssueOrderRefund> list = repo.list(pageRequest); | |||
List<IssueOrderRefundExcelModel> excelModelList = SourceTargetMapper.INSTANCE.orderRefundToModelList(list); | |||
File file = EasyExcelUtil.exportExcelFile(IssueOrderRefundExcelModel.class, excelModelList, "退费管理"); | |||
String filePath = minioUtil.fileUploadHttp(file, "settlew", BucketFileBus.SETTLEW); | |||
String filePath = minioUtil.fileUploadHttp(file, BucketFileBus.SETTLEW); | |||
return new IssueOrderRefundExportResponseDTO(filePath); | |||
} | |||