From 28d9d2571b4544edb974751479224937dc5e5f58 Mon Sep 17 00:00:00 2001 From: rentaiming <806181062@qq.com> Date: 星期五, 26 七月 2024 09:02:27 +0800 Subject: [PATCH] 森林防火 供应商管理 --- ruoyi-modules/ruoyi-management/src/main/java/com/ruoyi/management/controller/SlVolumeProductionCkController.java | 4 + ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/controller/SysFileController.java | 10 +++- ruoyi-modules/ruoyi-management/src/main/java/com/ruoyi/management/controller/SlGoodsShelfController.java | 4 + ruoyi-modules/ruoyi-management/src/main/java/com/ruoyi/management/controller/SlEquipmentController.java | 5 ++ ruoyi-common/ruoyi-common-log/src/main/java/com/ruoyi/common/log/aspect/LogAspect.java | 33 ---------------- ruoyi-modules/ruoyi-management/src/main/java/com/ruoyi/management/controller/SlGoodsMaterialsController.java | 4 + ruoyi-modules/ruoyi-management/src/main/java/com/ruoyi/management/controller/SlStoreManagementController.java | 4 + ruoyi-modules/ruoyi-management/src/main/java/com/ruoyi/management/controller/SlVolumeProductionRkController.java | 5 ++ ruoyi-modules/ruoyi-management/src/main/java/com/ruoyi/management/controller/SlVolumeProductionZyController.java | 5 ++ ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/utils/StateCloudObsUtil.java | 25 +++++++++--- 10 files changed, 51 insertions(+), 48 deletions(-) diff --git a/ruoyi-common/ruoyi-common-log/src/main/java/com/ruoyi/common/log/aspect/LogAspect.java b/ruoyi-common/ruoyi-common-log/src/main/java/com/ruoyi/common/log/aspect/LogAspect.java index e4f2dd0..f2bd1cc 100644 --- a/ruoyi-common/ruoyi-common-log/src/main/java/com/ruoyi/common/log/aspect/LogAspect.java +++ b/ruoyi-common/ruoyi-common-log/src/main/java/com/ruoyi/common/log/aspect/LogAspect.java @@ -87,32 +87,19 @@ { // *========数据库日志=========*// SysOperLog operLog = new SysOperLog(); - operLog.setStatus(BusinessStatus.SUCCESS.ordinal()); // 请求的地址 String ip = IpUtils.getIpAddr(); - operLog.setOperIp(ip); - operLog.setOperUrl(StringUtils.substring(ServletUtils.getRequest().getRequestURI(), 0, 255)); String username = SecurityUtils.getUsername(); if (StringUtils.isNotBlank(username)) { operLog.setOperName(username); } - if (e != null) - { - operLog.setStatus(BusinessStatus.FAIL.ordinal()); - operLog.setErrorMsg(StringUtils.substring(e.getMessage(), 0, 2000)); - } // 设置方法名称 String className = joinPoint.getTarget().getClass().getName(); String methodName = joinPoint.getSignature().getName(); - operLog.setMethod(className + "." + methodName + "()"); - // 设置请求方式 - operLog.setRequestMethod(ServletUtils.getRequest().getMethod()); // 处理设置注解上的参数 getControllerMethodDescription(joinPoint, controllerLog, operLog, jsonResult); - // 设置消耗时间 - operLog.setCostTime(System.currentTimeMillis() - TIME_THREADLOCAL.get()); // 保存数据库 asyncLogService.saveSysLog(operLog); } @@ -137,12 +124,6 @@ */ public void getControllerMethodDescription(JoinPoint joinPoint, Log log, SysOperLog operLog, Object jsonResult) throws Exception { - // 设置action动作 - operLog.setBusinessType(log.businessType().ordinal()); - // 设置标题 - operLog.setTitle(log.title()); - // 设置操作人类别 - operLog.setOperatorType(log.operatorType().ordinal()); // 是否需要保存request,参数和值 if (log.isSaveRequestData()) { @@ -152,7 +133,6 @@ // 是否需要保存response,参数和值 if (log.isSaveResponseData() && StringUtils.isNotNull(jsonResult)) { - operLog.setJsonResult(StringUtils.substring(JSON.toJSONString(jsonResult), 0, 2000)); } } @@ -164,18 +144,7 @@ */ private void setRequestValue(JoinPoint joinPoint, SysOperLog operLog, String[] excludeParamNames) throws Exception { - String requestMethod = operLog.getRequestMethod(); - Map<?, ?> paramsMap = ServletUtils.getParamMap(ServletUtils.getRequest()); - if (StringUtils.isEmpty(paramsMap) - && (HttpMethod.PUT.name().equals(requestMethod) || HttpMethod.POST.name().equals(requestMethod))) - { - String params = argsArrayToString(joinPoint.getArgs(), excludeParamNames); - operLog.setOperParam(StringUtils.substring(params, 0, 2000)); - } - else - { - operLog.setOperParam(StringUtils.substring(JSON.toJSONString(paramsMap, excludePropertyPreFilter(excludeParamNames)), 0, 2000)); - } + } /** diff --git a/ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/controller/SysFileController.java b/ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/controller/SysFileController.java index 56dae85..9a649ee 100644 --- a/ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/controller/SysFileController.java +++ b/ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/controller/SysFileController.java @@ -3,6 +3,7 @@ import com.ruoyi.common.core.domain.R; import com.ruoyi.common.core.utils.file.FileUtils; import com.ruoyi.file.service.ISysFileService; +import com.ruoyi.file.utils.StateCloudObsUtil; import com.ruoyi.system.api.domain.SysFile; import io.swagger.annotations.ApiOperation; import java.io.InputStream; @@ -61,7 +62,8 @@ try { // 上传并返回访问地址 - return R.ok("1"); + String url = StateCloudObsUtil.uploadFile(file); + return R.ok(url); } catch (Exception e) { log.error("上传文件失败", e); return R.fail(e.getMessage()); @@ -77,7 +79,8 @@ List<String> urls = new ArrayList<>(); try { for (MultipartFile multipartFile : file) { - urls.add("1"); + String url = StateCloudObsUtil.uploadFile(multipartFile); + urls.add(url); } // 上传并返回访问地址 return R.ok(urls); @@ -93,7 +96,8 @@ try { // 上传并返回访问地址 - return R.ok("1"); + String url = StateCloudObsUtil.obsUploadStream(code, stream); + return R.ok(url); } catch (Exception e) { log.error("上传文件失败", e); return R.fail(e.getMessage()); diff --git a/ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/utils/StateCloudObsUtil.java b/ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/utils/StateCloudObsUtil.java index 5229da9..24a368d 100644 --- a/ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/utils/StateCloudObsUtil.java +++ b/ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/utils/StateCloudObsUtil.java @@ -1,18 +1,31 @@ -/* + package com.ruoyi.file.utils; +import java.io.IOException; import java.io.InputStream; import java.util.UUID; + +import com.amazonaws.ClientConfiguration; +import com.amazonaws.Protocol; +import com.amazonaws.auth.AWSCredentials; +import com.amazonaws.auth.AWSStaticCredentialsProvider; +import com.amazonaws.auth.BasicAWSCredentials; +import com.amazonaws.client.builder.AwsClientBuilder; +import com.amazonaws.services.s3.AmazonS3; +import com.amazonaws.services.s3.AmazonS3ClientBuilder; +import com.amazonaws.services.s3.model.ObjectMetadata; +import com.amazonaws.services.s3.model.PutObjectRequest; +import com.amazonaws.services.s3.model.PutObjectResult; import org.springframework.web.multipart.MultipartFile; -*/ + /** * 天翼云OBS 工具类 * * @author mitao * @date 2024/6/17 - *//* + */ public class StateCloudObsUtil { @@ -41,7 +54,7 @@ s3client = AmazonS3ClientBuilder.standard() .withCredentials(new AWSStaticCredentialsProvider(credentials)) .withClientConfiguration(awsClientConfig) - .withEndpointConfiguration(new EndpointConfiguration(END_POINT, "")) + .withEndpointConfiguration(new AwsClientBuilder.EndpointConfiguration(END_POINT, "")) .disableChunkedEncoding() .enablePathStyleAccess() .build(); @@ -78,7 +91,7 @@ s3client = AmazonS3ClientBuilder.standard() .withCredentials(new AWSStaticCredentialsProvider(credentials)) .withClientConfiguration(awsClientConfig) - .withEndpointConfiguration(new EndpointConfiguration(END_POINT, "")) + .withEndpointConfiguration(new AwsClientBuilder.EndpointConfiguration(END_POINT, "")) .disableChunkedEncoding() .enablePathStyleAccess() .build(); @@ -98,4 +111,4 @@ return fileName; } } -*/ + diff --git a/ruoyi-modules/ruoyi-management/src/main/java/com/ruoyi/management/controller/SlEquipmentController.java b/ruoyi-modules/ruoyi-management/src/main/java/com/ruoyi/management/controller/SlEquipmentController.java index 76d2d7c..a6df396 100644 --- a/ruoyi-modules/ruoyi-management/src/main/java/com/ruoyi/management/controller/SlEquipmentController.java +++ b/ruoyi-modules/ruoyi-management/src/main/java/com/ruoyi/management/controller/SlEquipmentController.java @@ -3,6 +3,7 @@ import com.ruoyi.common.core.domain.R; import com.ruoyi.common.core.utils.page.PageDTO; +import com.ruoyi.management.domain.SlEquipment; import com.ruoyi.management.domain.dto.InventoriesSuppDTO; import com.ruoyi.management.domain.dto.InventoriesSuppliesQuery; import com.ruoyi.management.domain.dto.SlEquipmentDTO; @@ -50,7 +51,9 @@ @DeleteMapping("/{id}") public R<?> delSlEquipment( @ApiParam(name = "id", value = "设备管理id", required = true) @PathVariable("id") Long id) { - slEquipmentService.removeById(id); + SlEquipment byId = slEquipmentService.getById(id); + byId.setDelFlag("1"); + slEquipmentService.updateById(byId); return R.ok(); } diff --git a/ruoyi-modules/ruoyi-management/src/main/java/com/ruoyi/management/controller/SlGoodsMaterialsController.java b/ruoyi-modules/ruoyi-management/src/main/java/com/ruoyi/management/controller/SlGoodsMaterialsController.java index 09157f8..73b0f09 100644 --- a/ruoyi-modules/ruoyi-management/src/main/java/com/ruoyi/management/controller/SlGoodsMaterialsController.java +++ b/ruoyi-modules/ruoyi-management/src/main/java/com/ruoyi/management/controller/SlGoodsMaterialsController.java @@ -49,7 +49,9 @@ @DeleteMapping("/{id}") public R<?> delStoreManagement( @ApiParam(name = "id", value = "货架管理id", required = true) @PathVariable("id") Long id) { - slGoodsMaterialsService.removeById(id); + SlGoodsMaterials byId = slGoodsMaterialsService.getById(id); + byId.setDelFlag("1"); + slGoodsMaterialsService.updateById(byId); return R.ok(); } diff --git a/ruoyi-modules/ruoyi-management/src/main/java/com/ruoyi/management/controller/SlGoodsShelfController.java b/ruoyi-modules/ruoyi-management/src/main/java/com/ruoyi/management/controller/SlGoodsShelfController.java index 70eed4f..fed1eb9 100644 --- a/ruoyi-modules/ruoyi-management/src/main/java/com/ruoyi/management/controller/SlGoodsShelfController.java +++ b/ruoyi-modules/ruoyi-management/src/main/java/com/ruoyi/management/controller/SlGoodsShelfController.java @@ -57,7 +57,9 @@ @DeleteMapping("/{id}") public R<?> delStoreManagement( @ApiParam(name = "id", value = "货架管理id", required = true) @PathVariable("id") Long id) { - slGoodsShelfService.removeById(id); + SlGoodsShelf byId = slGoodsShelfService.getById(id); + byId.setDelFlag("1"); + slGoodsShelfService.updateById(byId); return R.ok(); } diff --git a/ruoyi-modules/ruoyi-management/src/main/java/com/ruoyi/management/controller/SlStoreManagementController.java b/ruoyi-modules/ruoyi-management/src/main/java/com/ruoyi/management/controller/SlStoreManagementController.java index 7404f81..d579ac1 100644 --- a/ruoyi-modules/ruoyi-management/src/main/java/com/ruoyi/management/controller/SlStoreManagementController.java +++ b/ruoyi-modules/ruoyi-management/src/main/java/com/ruoyi/management/controller/SlStoreManagementController.java @@ -48,7 +48,9 @@ @DeleteMapping("/{id}") public R<?> delStoreManagement( @ApiParam(name = "id", value = "仓库管理id", required = true) @PathVariable("id") Long id) { - slStoreManagementService.removeById(id); + SlStoreManagement byId = slStoreManagementService.getById(id); + byId.setDelFlag("1"); + slStoreManagementService.updateById(byId); return R.ok(); } diff --git a/ruoyi-modules/ruoyi-management/src/main/java/com/ruoyi/management/controller/SlVolumeProductionCkController.java b/ruoyi-modules/ruoyi-management/src/main/java/com/ruoyi/management/controller/SlVolumeProductionCkController.java index c027fb1..27b89f7 100644 --- a/ruoyi-modules/ruoyi-management/src/main/java/com/ruoyi/management/controller/SlVolumeProductionCkController.java +++ b/ruoyi-modules/ruoyi-management/src/main/java/com/ruoyi/management/controller/SlVolumeProductionCkController.java @@ -71,7 +71,9 @@ @DeleteMapping("/{id}") public R<?> delStoreManagement( @ApiParam(name = "id", value = "出库批次id", required = true) @PathVariable("id") Integer id) { - slVolumeProductionCkService.removeById(id); + SlVolumeProductionCk byId = slVolumeProductionCkService.getById(id); + byId.setDelFlag("1"); + slVolumeProductionCkService.updateById(byId); return R.ok(); } } diff --git a/ruoyi-modules/ruoyi-management/src/main/java/com/ruoyi/management/controller/SlVolumeProductionRkController.java b/ruoyi-modules/ruoyi-management/src/main/java/com/ruoyi/management/controller/SlVolumeProductionRkController.java index 4fed20f..892691d 100644 --- a/ruoyi-modules/ruoyi-management/src/main/java/com/ruoyi/management/controller/SlVolumeProductionRkController.java +++ b/ruoyi-modules/ruoyi-management/src/main/java/com/ruoyi/management/controller/SlVolumeProductionRkController.java @@ -3,6 +3,7 @@ import com.ruoyi.common.core.domain.R; import com.ruoyi.common.core.utils.page.PageDTO; +import com.ruoyi.management.domain.SlVolumeProductionRk; import com.ruoyi.management.domain.dto.*; import com.ruoyi.management.domain.vo.ManagementimgVolumeProductionRkVO; import com.ruoyi.management.domain.vo.VolumeProductionRkgInventoryVO; @@ -58,7 +59,9 @@ @DeleteMapping("/{id}") public R<?> delStoreManagement( @ApiParam(name = "id", value = "入库批次id", required = true) @PathVariable("id") Long id) { - slVolumeProductionRkService.removeById(id); + SlVolumeProductionRk byId = slVolumeProductionRkService.getById(id); + byId.setDelFlag("1"); + slVolumeProductionRkService.updateById(byId); return R.ok(); } diff --git a/ruoyi-modules/ruoyi-management/src/main/java/com/ruoyi/management/controller/SlVolumeProductionZyController.java b/ruoyi-modules/ruoyi-management/src/main/java/com/ruoyi/management/controller/SlVolumeProductionZyController.java index cabb6cb..66d6296 100644 --- a/ruoyi-modules/ruoyi-management/src/main/java/com/ruoyi/management/controller/SlVolumeProductionZyController.java +++ b/ruoyi-modules/ruoyi-management/src/main/java/com/ruoyi/management/controller/SlVolumeProductionZyController.java @@ -3,6 +3,7 @@ import com.ruoyi.common.core.domain.R; import com.ruoyi.common.core.utils.page.PageDTO; +import com.ruoyi.management.domain.SlVolumeProductionZy; import com.ruoyi.management.domain.dto.*; import com.ruoyi.management.domain.vo.ManagementimgSlVolumeProductionCkVO; import com.ruoyi.management.domain.vo.ManagementimgVolumeProductionCkVO; @@ -63,7 +64,9 @@ @DeleteMapping("/{id}") public R<?> delStoreManagement( @ApiParam(name = "id", value = "转移批次id", required = true) @PathVariable("id") Integer id) { - slVolumeProductionZyService.removeById(id); + SlVolumeProductionZy byId = slVolumeProductionZyService.getById(id); + byId.setDelFlag("1"); + slVolumeProductionZyService.updateById(byId); return R.ok(); } -- Gitblit v1.7.1