From a86c2eb2db34d2d350e5c2eb72bf6416ec89c0d2 Mon Sep 17 00:00:00 2001
From: xyc <jc_xiong@hotmail.com>
Date: 星期二, 19 十一月 2024 11:43:03 +0800
Subject: [PATCH] 1)可靠性评定时新增模型检查处理; 2)获取任务二项分布参数时,去掉模型的匹配。

---
 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