From 664db98c9e8595ce4dd636a27f480e3a08b81ff5 Mon Sep 17 00:00:00 2001
From: xyc <jc_xiong@hotmail.com>
Date: 星期五, 21 二月 2025 11:13:51 +0800
Subject: [PATCH] 新增可忽略的维修时间
---
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/sysPictureBase/controller/SysPictureBaseController.java | 53 ++++++-----------------------------------------------
1 files changed, 6 insertions(+), 47 deletions(-)
diff --git a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/sysPictureBase/controller/SysPictureBaseController.java b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/sysPictureBase/controller/SysPictureBaseController.java
index 8147d2a..29e7de6 100644
--- a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/sysPictureBase/controller/SysPictureBaseController.java
+++ b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/sysPictureBase/controller/SysPictureBaseController.java
@@ -73,42 +73,10 @@
} else {
sysPictureBaseService.insert(sysPictureBase);
}
- if (sysPictureBase.getIsDefault()==1){
- if (sysPictureBase.getId()==null){
- sysPictureBaseService.updateByDefault(sysPictureBase.getId(),sysPictureBase.getProductType());
- sysPictureBaseService.updateProdeuctImg(sysPictureBase.getId(),sysPictureBase.getProductType(),null);
- }else{
- if (!sysPictureBase.getId().equals(sysPictureBase.getId())){
- sysPictureBaseService.updateByDefault(sysPictureBase.getId(),sysPictureBase.getProductType());
- sysPictureBaseService.updateProdeuctImg(sysPictureBase.getId(),sysPictureBase.getProductType(),sysPictureBase.getId());
- }
- }
+ if (sysPictureBase.getIsDefault() == 1 && sysPictureBase.getProductType()!=20) {
+ sysPictureBaseService.updateByDefault(sysPictureBase.getId(), sysPictureBase.getProductType());
+ sysPictureBaseService.updateProdeuctImg(sysPictureBase.getId(), sysPictureBase.getProductType(), null);
}
-/* if (file != null) {
- BufferedImage bufferedImage = null;
- try {
- String fileName = file.getOriginalFilename();
- String[] arr = fileName.split("\\.");
- String suffixName = arr[arr.length - 1].toLowerCase();
-
- bufferedImage = ImageIO.read(file.getInputStream());
- // 瀹藉害
- int width = bufferedImage.getWidth();
- sysPictureBase.setWidth(width);
- // 楂樺害
- int height = bufferedImage.getHeight();
- sysPictureBase.setHeight(height);
- sysPictureBaseService.update(sysPictureBase);
- String tempUploadDir = localPath + "/product_img/";
- File dir = new File(tempUploadDir);
- if (!dir.exists()) {
- dir.mkdirs();
- }
- ImageIO.write(bufferedImage, suffixName, new File(tempUploadDir + sysPictureBase.getId().toString()));
- } catch (IOException e) {
- e.printStackTrace();
- }
- }*/
return Result.ok();
}
@@ -136,24 +104,14 @@
//鍏虫祦
outputStream.close();
in.close();
- } catch (IOException e) {
+ } catch (IOException e) {
e.printStackTrace();
}
}
@RequestMapping("/getSvgImage")
public void getSvgImage(HttpServletResponse response, Long id) {
- try {
- SysPictureBase data = sysPictureBaseService.get(id);
- String svgContent = data.getSvgContent();
- response.setContentType("image/svg+xml");
- response.getWriter().write(svgContent);
- response.getWriter().flush();
- response.getWriter().close();
-
- } catch (IOException e) {
- e.printStackTrace();
- }
+ sysPictureBaseService.getSvgImage(response,id);
}
@GetMapping("/getDefaultImg")
@@ -161,6 +119,7 @@
SysPictureBase data = sysPictureBaseService.getDefaultImg(productType);
return Result.ok(data);
}
+
@DeleteMapping
@ApiOperation("鍒犻櫎")
@LogOperation("鍒犻櫎")
--
Gitblit v1.9.1