zc 7 years ago
parent
commit
24e4ad1d6d

+ 11 - 1
src/main/java/com/izouma/awesomeadmin/model/FileInfo.java

@@ -20,7 +20,7 @@ public class FileInfo{
     private Integer fatherId;
     private Integer fatherId;
     private ImgInfo imgInfo;
     private ImgInfo imgInfo;
     private String image;
     private String image;
-
+    private Integer imgId;
     private String idStr;
     private String idStr;
 
 
     private String searchKey;
     private String searchKey;
@@ -146,6 +146,8 @@ public void setIdStr(String idStr) {
         this.imgInfo = imgInfo;
         this.imgInfo = imgInfo;
 
 
         this.image = imgInfo.getUrl();
         this.image = imgInfo.getUrl();
+
+        this.imgId = imgInfo.getId();
     }
     }
 
 
     public String getImage() {
     public String getImage() {
@@ -156,5 +158,13 @@ public void setIdStr(String idStr) {
         this.image = image;
         this.image = image;
     }
     }
 
 
+    public Integer getImgId() {
+        return imgId;
+    }
+
+    public void setImgId(Integer imgId) {
+        this.imgId = imgId;
+    }
+
 }
 }
 
 

+ 10 - 0
src/main/java/com/izouma/awesomeadmin/model/MemberInfo.java

@@ -22,6 +22,7 @@ public class MemberInfo{
     private ImgInfo photo;
     private ImgInfo photo;
     private String imgUrl;
     private String imgUrl;
     private Integer stationId;
     private Integer stationId;
+    private Integer imgId;
 
 
 private String idStr;
 private String idStr;
 
 
@@ -155,6 +156,7 @@ public void setIdStr(String idStr) {
     public void setPhoto(ImgInfo photo) {
     public void setPhoto(ImgInfo photo) {
         this.photo = photo;
         this.photo = photo;
         this.imgUrl = photo.getUrl();
         this.imgUrl = photo.getUrl();
+        this.imgId = photo.getId();
     }
     }
 
 
     public Integer getStationId() {
     public Integer getStationId() {
@@ -164,5 +166,13 @@ public void setIdStr(String idStr) {
     public void setStationId(Integer stationId) {
     public void setStationId(Integer stationId) {
         this.stationId = stationId;
         this.stationId = stationId;
     }
     }
+
+    public Integer getImgId() {
+        return imgId;
+    }
+
+    public void setImgId(Integer imgId) {
+        this.imgId = imgId;
+    }
 }
 }
 
 

+ 34 - 24
src/main/java/com/izouma/awesomeadmin/model/MenuInfo.java

@@ -23,6 +23,7 @@ public class MenuInfo{
     private List<SubItem> subItem;
     private List<SubItem> subItem;
     private List<MemberInfo> members;
     private List<MemberInfo> members;
     private List<ImgInfo> images;
     private List<ImgInfo> images;
+    private Integer imgId;
 
 
 private String idStr;
 private String idStr;
 
 
@@ -45,6 +46,7 @@ private String orderByStr;
     public void setMenuIco(ImgInfo menuIco) {
     public void setMenuIco(ImgInfo menuIco) {
         this.menuIco = menuIco;
         this.menuIco = menuIco;
         this.imgUrl = menuIco.getUrl();
         this.imgUrl = menuIco.getUrl();
+        this.imgId = menuIco.getId();
     }
     }
 
 
     public String getImgUrl() {
     public String getImgUrl() {
@@ -126,37 +128,37 @@ private String orderByStr;
         this.stationInfo = stationInfo;
         this.stationInfo = stationInfo;
     }
     }
 
 
-public String getSearchKey() {
-    return searchKey;
-}
+    public String getSearchKey() {
+        return searchKey;
+    }
 
 
-public void setSearchKey(String searchKey) {
-    this.searchKey = searchKey;
-}
+    public void setSearchKey(String searchKey) {
+        this.searchKey = searchKey;
+    }
 
 
-public String getAdvancedQuery() {
-    return advancedQuery;
-}
+    public String getAdvancedQuery() {
+        return advancedQuery;
+    }
 
 
-public void setAdvancedQuery(String advancedQuery) {
-    this.advancedQuery = advancedQuery;
-}
+    public void setAdvancedQuery(String advancedQuery) {
+        this.advancedQuery = advancedQuery;
+    }
 
 
-public String getOrderByStr() {
-    return orderByStr;
-}
+    public String getOrderByStr() {
+        return orderByStr;
+    }
 
 
-public void setOrderByStr(String orderByStr) {
-    this.orderByStr = orderByStr;
-}
+    public void setOrderByStr(String orderByStr) {
+        this.orderByStr = orderByStr;
+    }
 
 
-public String getIdStr() {
-    return idStr;
-}
+    public String getIdStr() {
+        return idStr;
+    }
 
 
-public void setIdStr(String idStr) {
-    this.idStr = idStr;
-}
+    public void setIdStr(String idStr) {
+        this.idStr = idStr;
+    }
 
 
     public List<SubItem> getSubItem() {
     public List<SubItem> getSubItem() {
         return subItem;
         return subItem;
@@ -181,5 +183,13 @@ public void setIdStr(String idStr) {
     public void setImages(List<ImgInfo> images) {
     public void setImages(List<ImgInfo> images) {
         this.images = images;
         this.images = images;
     }
     }
+
+    public Integer getImgId() {
+        return imgId;
+    }
+
+    public void setImgId(Integer imgId) {
+        this.imgId = imgId;
+    }
 }
 }
 
 

+ 10 - 1
src/main/java/com/izouma/awesomeadmin/model/SubItem.java

@@ -18,6 +18,7 @@ public class SubItem{
     private Integer menuInfoId;
     private Integer menuInfoId;
     private ImgInfo icon;
     private ImgInfo icon;
     private String imgUrl;
     private String imgUrl;
+    private Integer imgId;
 
 
 private String idStr;
 private String idStr;
 
 
@@ -33,6 +34,14 @@ private String advancedQuery;
 */
 */
 private String orderByStr;
 private String orderByStr;
 
 
+    public Integer getImgId() {
+        return imgId;
+    }
+
+    public void setImgId(Integer imgId) {
+        this.imgId = imgId;
+    }
+
     public Integer getId(){
     public Integer getId(){
         return this.id;
         return this.id;
     }
     }
@@ -130,7 +139,7 @@ public void setIdStr(String idStr) {
         this.icon = icon;
         this.icon = icon;
 
 
         this.imgUrl = icon.getUrl();
         this.imgUrl = icon.getUrl();
-
+        this.imgId = icon.getId();
     }
     }
 
 
     public String getImgUrl() {
     public String getImgUrl() {

+ 2 - 3
src/main/java/com/izouma/awesomeadmin/web/FileInfoController.java

@@ -110,10 +110,9 @@ public class FileInfoController {
         if (num) {
         if (num) {
 
 
             ImgInfo img = new ImgInfo();
             ImgInfo img = new ImgInfo();
-            img.setFatherId(record.getId());
-            img.setType(5);
+            img.setId(record.getImgId());
             img.setUrl(record.getImage());
             img.setUrl(record.getImage());
-            imgInfoService.createImgInfo(img);
+            imgInfoService.updateImgInfo(img);
             return new Result(true, record.getId());
             return new Result(true, record.getId());
         }
         }
         return new Result(false, "保存异常");
         return new Result(false, "保存异常");

+ 2 - 3
src/main/java/com/izouma/awesomeadmin/web/MemberInfoController.java

@@ -150,10 +150,9 @@ public class MemberInfoController {
             operateHistoryService.createOperateHistory(oh);
             operateHistoryService.createOperateHistory(oh);
 
 
             ImgInfo img = new ImgInfo();
             ImgInfo img = new ImgInfo();
-            img.setFatherId(record.getId());
-            img.setType(3);
+            img.setId(record.getImgId());
             img.setUrl(record.getImgUrl());
             img.setUrl(record.getImgUrl());
-            imgInfoService.createImgInfo(img);
+            imgInfoService.updateImgInfo(img);
 
 
             return new Result(true, "保存成功");
             return new Result(true, "保存成功");
         }
         }

+ 3 - 4
src/main/java/com/izouma/awesomeadmin/web/MenuInfoController.java

@@ -148,11 +148,10 @@ public class MenuInfoController {
             operateHistoryService.createOperateHistory(oh);
             operateHistoryService.createOperateHistory(oh);
 
 
             ImgInfo img = new ImgInfo();
             ImgInfo img = new ImgInfo();
-            img.setFatherId(record.getId());
-            img.setType(0);
+            img.setId(record.getImgId());
             img.setUrl(record.getImgUrl());
             img.setUrl(record.getImgUrl());
-            imgInfoService.createImgInfo(img);
-             return new Result(true, "保存成功");
+            imgInfoService.updateImgInfo(img);
+            return new Result(true, "保存成功");
         }
         }
         return new Result(false, "保存异常");
         return new Result(false, "保存异常");
     }
     }

+ 2 - 3
src/main/java/com/izouma/awesomeadmin/web/SubItemController.java

@@ -109,10 +109,9 @@ public class SubItemController {
         if (num) {
         if (num) {
 
 
             ImgInfo img = new ImgInfo();
             ImgInfo img = new ImgInfo();
-            img.setFatherId(record.getId());
-            img.setType(4);
+            img.setId(record.getImgId());
             img.setUrl(record.getImgUrl());
             img.setUrl(record.getImgUrl());
-            imgInfoService.createImgInfo(img);
+            imgInfoService.updateImgInfo(img);
             return new Result(true, "保存成功");
             return new Result(true, "保存成功");
         }
         }
         return new Result(false, "保存异常");
         return new Result(false, "保存异常");