瀏覽代碼

文物模块, 新增urlList字段, 多张图片以逗号隔开

wuweihao 3 年之前
父節點
當前提交
2e0bab4df2

+ 21 - 0
zhoushan-system-api/src/main/java/com/fdage/controller/CollectionController.java

@@ -1,5 +1,8 @@
 package com.fdage.controller;
 
+import cn.hutool.core.collection.CollectionUtil;
+import cn.hutool.core.collection.ListUtil;
+import cn.hutool.core.util.StrUtil;
 import com.fdage.aop.WebControllerLog;
 import com.fdage.constant.ConfigConstant;
 import com.fdage.constant.ConstantUrl;
@@ -83,6 +86,7 @@ public class CollectionController {
 
         TbCollection collection = new TbCollection();
         BeanUtils.copyProperties(bo, collection);
+//        collection.setTypeImages(convertTypeImages(bo.getTypeImages()));
         collection.setUnityUrl("/collection/unity/" + bo.getDirCode());
 //        collection.setUnityUrl(configConstant.serverBasePath + "/collection/unity/" + bo.getDirCode());
         service.insert(collection);
@@ -115,10 +119,27 @@ public class CollectionController {
 
         TbCollection collection = new TbCollection();
         BeanUtils.copyProperties(bo, collection);
+//        collection.setTypeImages(convertTypeImages(bo.getTypeImages()));
         service.update(collection);
         return AjaxJson.success();
     }
 
+    // 将数组转字符串
+//    private String convertTypeImages(List<String> param){
+//        StringBuilder buffer = new StringBuilder();
+//        int size = param.size();
+//        int flag = 0;
+//        for (String s : param) {
+//            flag ++;
+//            buffer.append(s);
+//            if (size != flag) {
+//                buffer.append(",");
+//            }
+//        }
+//        return buffer.toString();
+//
+//    }
+
     @PostMapping("deleteCollection")
     @ResponseBody
     @WebControllerLog(description = "文物库-删除文物")

+ 8 - 0
zhoushan-system-common/src/main/java/com/fdage/request/RequestCollection.java

@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiOperation;
 import lombok.Data;
 
 import java.util.Date;
+import java.util.List;
 
 /**
  * Created by Hb_zzZ on 2019/9/11.
@@ -48,4 +49,11 @@ public class RequestCollection extends RequestBase{
 
     @ApiModelProperty(value = "目录code", notes = "上传文件使用")
     private String dirCode;
+
+    // 2021-09-22
+    @ApiModelProperty(value = "类型: 2D 、 3D")
+    private String type;
+
+    @ApiModelProperty(value = "轮播板式")
+    private String urlList;
 }

+ 9 - 0
zhoushan-system-common/src/main/java/com/fdage/respon/ResponCollection.java

@@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 import java.util.Date;
+import java.util.List;
 
 /**
  * Created by Hb_zzZ on 2019/9/11.
@@ -59,4 +60,12 @@ public class ResponCollection {
 
     @ApiModelProperty(value = "目录code", notes = "上传文件使用")
     private String dirCode;
+
+
+    // 2021-09-22
+    @ApiModelProperty(value = "类型: 2D 、 3D")
+    private String type;
+
+    @ApiModelProperty(value = "轮播板式")
+    private String urlList;
 }

+ 219 - 183
zhoushan-system-dao/src/main/java/com/fdage/pojo/TbCollection.java

@@ -1,9 +1,12 @@
 package com.fdage.pojo;
 
 import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
 
 import java.util.Date;
+import java.util.List;
 
+@Data
 public class TbCollection {
     private Long id;
 
@@ -46,6 +49,8 @@ public class TbCollection {
     private Integer downloadNum;
 
 
+
+
     @ApiModelProperty(value = "图片")
     private String icon;
 
@@ -56,187 +61,218 @@ public class TbCollection {
     private String visit;
 
 
-    public String getVisit() {
-        return visit;
-    }
-
-    public void setVisit(String visit) {
-        this.visit = visit;
-    }
-
-    public String getIcon() {
-        return icon;
-    }
-
-    public void setIcon(String icon) {
-        this.icon = icon;
-    }
-
-    public String getDirCode() {
-        return dirCode;
-    }
-
-    public void setDirCode(String dirCode) {
-        this.dirCode = dirCode;
-    }
-
-    public Integer getDownloadNum() {
-        return downloadNum;
-    }
-
-    public void setDownloadNum(Integer downloadNum) {
-        this.downloadNum = downloadNum;
-    }
-
-    public Integer getLikeNum() {
-        return likeNum;
-    }
-
-    public void setLikeNum(Integer likeNum) {
-        this.likeNum = likeNum;
-    }
-
-    public Integer getOpenNum() {
-        return openNum;
-    }
-
-    public void setOpenNum(Integer openNum) {
-        this.openNum = openNum;
-    }
-
-    public Integer getSearchNum() {
-        return searchNum;
-    }
-
-    public void setSearchNum(Integer searchNum) {
-        this.searchNum = searchNum;
-    }
-
-    public String getUnityUrl() {
-        return unityUrl;
-    }
-
-    public void setUnityUrl(String unityUrl) {
-        this.unityUrl = unityUrl;
-    }
-
-    public String getUnityPic() {
-        return unityPic;
-    }
-
-    public void setUnityPic(String unityPic) {
-        this.unityPic = unityPic;
-    }
-
-    public String getNum() {
-        return num;
-    }
-
-    public void setNum(String num) {
-        this.num = num;
-    }
-
-    public Long getId() {
-        return id;
-    }
-
-    public void setId(Long id) {
-        this.id = id;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name == null ? null : name.trim();
-    }
-
-    public Long getTypeId() {
-        return typeId;
-    }
-
-    public void setTypeId(Long typeId) {
-        this.typeId = typeId;
-    }
-
-    public Long getTimeId() {
-        return timeId;
-    }
-
-    public void setTimeId(Long timeId) {
-        this.timeId = timeId;
-    }
-
-    public Date getDiscoveryTime() {
-        return discoveryTime;
-    }
-
-    public void setDiscoveryTime(Date discoveryTime) {
-        this.discoveryTime = discoveryTime;
-    }
-
-    public Date getRepairTime() {
-        return repairTime;
-    }
-
-    public void setRepairTime(Date repairTime) {
-        this.repairTime = repairTime;
-    }
-
-    public String getVenue() {
-        return venue;
-    }
-
-    public void setVenue(String venue) {
-        this.venue = venue == null ? null : venue.trim();
-    }
-
-    public String getPic() {
-        return pic;
-    }
-
-    public void setPic(String pic) {
-        this.pic = pic == null ? null : pic.trim();
-    }
-
-    public String getModelUrl() {
-        return modelUrl;
-    }
-
-    public void setModelUrl(String modelUrl) {
-        this.modelUrl = modelUrl == null ? null : modelUrl.trim();
-    }
-
-    public String getContentUrl() {
-        return contentUrl;
-    }
-
-    public void setContentUrl(String contentUrl) {
-        this.contentUrl = contentUrl == null ? null : contentUrl.trim();
-    }
-
-    public Integer getState() {
-        return state;
-    }
-
-    public void setState(Integer state) {
-        this.state = state;
-    }
-
-    public Date getCreateTime() {
-        return createTime;
-    }
-
-    public void setCreateTime(Date createTime) {
-        this.createTime = createTime;
-    }
-
-    public String getDescription() {
-        return description;
-    }
-
-    public void setDescription(String description) {
-        this.description = description == null ? null : description.trim();
-    }
+    // 2021-09-22
+    @ApiModelProperty(value = "类型: 2D 、 3D")
+    private String type;
+
+    @ApiModelProperty(value = "轮播板式", notes = "数组转字符串存储")
+    private String urlList;
+
+//    public String getTypeImages() {
+//        return typeImages;
+//    }
+
+//    public void setTypeImages(String typeImages) {
+//        this.typeImages = typeImages;
+//    }
+//
+//
+//
+//
+//
+//
+//
+//    public String getType() {
+//        return type;
+//    }
+//
+//    public void setType(String type) {
+//        this.type = type;
+//    }
+//
+//
+//
+//    public String getVisit() {
+//        return visit;
+//    }
+//
+//    public void setVisit(String visit) {
+//        this.visit = visit;
+//    }
+//
+//    public String getIcon() {
+//        return icon;
+//    }
+//
+//    public void setIcon(String icon) {
+//        this.icon = icon;
+//    }
+//
+//    public String getDirCode() {
+//        return dirCode;
+//    }
+//
+//    public void setDirCode(String dirCode) {
+//        this.dirCode = dirCode;
+//    }
+//
+//    public Integer getDownloadNum() {
+//        return downloadNum;
+//    }
+//
+//    public void setDownloadNum(Integer downloadNum) {
+//        this.downloadNum = downloadNum;
+//    }
+//
+//    public Integer getLikeNum() {
+//        return likeNum;
+//    }
+//
+//    public void setLikeNum(Integer likeNum) {
+//        this.likeNum = likeNum;
+//    }
+//
+//    public Integer getOpenNum() {
+//        return openNum;
+//    }
+//
+//    public void setOpenNum(Integer openNum) {
+//        this.openNum = openNum;
+//    }
+//
+//    public Integer getSearchNum() {
+//        return searchNum;
+//    }
+//
+//    public void setSearchNum(Integer searchNum) {
+//        this.searchNum = searchNum;
+//    }
+//
+//    public String getUnityUrl() {
+//        return unityUrl;
+//    }
+//
+//    public void setUnityUrl(String unityUrl) {
+//        this.unityUrl = unityUrl;
+//    }
+//
+//    public String getUnityPic() {
+//        return unityPic;
+//    }
+//
+//    public void setUnityPic(String unityPic) {
+//        this.unityPic = unityPic;
+//    }
+//
+//    public String getNum() {
+//        return num;
+//    }
+//
+//    public void setNum(String num) {
+//        this.num = num;
+//    }
+//
+//    public Long getId() {
+//        return id;
+//    }
+//
+//    public void setId(Long id) {
+//        this.id = id;
+//    }
+//
+//    public String getName() {
+//        return name;
+//    }
+//
+//    public void setName(String name) {
+//        this.name = name == null ? null : name.trim();
+//    }
+//
+//    public Long getTypeId() {
+//        return typeId;
+//    }
+//
+//    public void setTypeId(Long typeId) {
+//        this.typeId = typeId;
+//    }
+//
+//    public Long getTimeId() {
+//        return timeId;
+//    }
+//
+//    public void setTimeId(Long timeId) {
+//        this.timeId = timeId;
+//    }
+//
+//    public Date getDiscoveryTime() {
+//        return discoveryTime;
+//    }
+//
+//    public void setDiscoveryTime(Date discoveryTime) {
+//        this.discoveryTime = discoveryTime;
+//    }
+//
+//    public Date getRepairTime() {
+//        return repairTime;
+//    }
+//
+//    public void setRepairTime(Date repairTime) {
+//        this.repairTime = repairTime;
+//    }
+//
+//    public String getVenue() {
+//        return venue;
+//    }
+//
+//    public void setVenue(String venue) {
+//        this.venue = venue == null ? null : venue.trim();
+//    }
+//
+//    public String getPic() {
+//        return pic;
+//    }
+//
+//    public void setPic(String pic) {
+//        this.pic = pic == null ? null : pic.trim();
+//    }
+//
+//    public String getModelUrl() {
+//        return modelUrl;
+//    }
+//
+//    public void setModelUrl(String modelUrl) {
+//        this.modelUrl = modelUrl == null ? null : modelUrl.trim();
+//    }
+//
+//    public String getContentUrl() {
+//        return contentUrl;
+//    }
+//
+//    public void setContentUrl(String contentUrl) {
+//        this.contentUrl = contentUrl == null ? null : contentUrl.trim();
+//    }
+//
+//    public Integer getState() {
+//        return state;
+//    }
+//
+//    public void setState(Integer state) {
+//        this.state = state;
+//    }
+//
+//    public Date getCreateTime() {
+//        return createTime;
+//    }
+//
+//    public void setCreateTime(Date createTime) {
+//        this.createTime = createTime;
+//    }
+//
+//    public String getDescription() {
+//        return description;
+//    }
+//
+//    public void setDescription(String description) {
+//        this.description = description == null ? null : description.trim();
+//    }
 }

+ 21 - 1
zhoushan-system-dao/src/main/resources/mapper/base/TbCollectionMapper.xml

@@ -30,7 +30,7 @@
   </resultMap>
   <sql id="Base_Column_List">
     id, name, type_id, time_id, num, dir_code, icon, discovery_time, repair_time, venue, pic, unity_pic, unity_url, model_url, content_url,
-    state, create_time, like_num, open_num, search_num, download_num
+    state, create_time, like_num, open_num, search_num, download_num, type, url_list
   </sql>
   <sql id="Blob_Column_List">
     description
@@ -130,6 +130,12 @@
       <if test="dirCode != null">
         dir_code,
       </if>
+      <if test="urlList != null">
+        url_list ,
+      </if>
+      <if test="type != null">
+        type ,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="id != null">
@@ -186,6 +192,13 @@
       <if test="dirCode != null">
         #{dirCode,jdbcType=VARCHAR},
       </if>
+
+      <if test="urlList != null">
+        #{urlList,jdbcType=VARCHAR},
+      </if>
+      <if test="type != null">
+        #{type,jdbcType=VARCHAR},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.fdage.pojo.TbCollection">
@@ -242,6 +255,13 @@
       <if test="dirCode != null">
         dir_code = #{dirCode,jdbcType=VARCHAR},
       </if>
+      <if test="urlList != null">
+        url_list = #{urlList,jdbcType=VARCHAR},
+      </if>
+      <if test="type != null">
+        type = #{type,jdbcType=VARCHAR},
+      </if>
+
     </set>
     where id = #{id,jdbcType=BIGINT}
   </update>

+ 4 - 4
zhoushan-system-dao/src/main/resources/mapper/cust/TbCollectionMapperCust.xml

@@ -21,7 +21,7 @@
     a.repair_time as repairTime, a.venue, a.model_url as modelUrl, a.content_url as contentUrl, a.state,
     a.create_time as createTime, a.description, b.name as timeName, c.name as typeName, a.pic, a.num,
     a.like_num as likeNum, a.open_num as openNum, a.search_num as searchNum, download_num as downloadNum,
-    a.unity_pic as unityPic, a.unity_url as unityUrl, a.icon, a.dir_code as dirCode
+    a.unity_pic as unityPic, a.unity_url as unityUrl, a.icon, a.dir_code as dirCode, a.type, a.url_list
     from tb_collection a LEFT JOIN tb_collection_time b on a.time_id = b.id
     LEFT JOIN tb_collection_type c ON a.type_id = c.id
     WHERE 1 = 1
@@ -44,7 +44,7 @@
     a.repair_time as repairTime, a.venue, a.model_url as modelUrl, a.content_url as contentUrl, a.state,
     a.create_time as createTime, a.description, b.name as timeName, c.name as typeName, a.pic, a.num,
     a.like_num as likeNum, a.open_num as openNum, a.search_num as searchNum, download_num as downloadNum,
-     a.unity_pic as unityPic, a.unity_url as unityUrl
+     a.unity_pic as unityPic, a.unity_url as unityUrl, a.type, a.url_list
     from tb_collection a LEFT JOIN tb_collection_time b on a.time_id = b.id
     LEFT JOIN tb_collection_type c ON a.type_id = c.id
     LEFT JOIN tb_exhibition_collection d ON a.id = d.collection_id
@@ -56,7 +56,7 @@
     a.repair_time as repairTime, a.venue, a.model_url as modelUrl, a.content_url as contentUrl, a.state,
     a.create_time as createTime, a.description, b.name as timeName, c.name as typeName, a.pic, a.num,
     a.like_num as likeNum, a.open_num as openNum, a.search_num as searchNum, download_num as downloadNum,
-    a.unity_pic as unityPic, a.unity_url as unityUrl
+    a.unity_pic as unityPic, a.unity_url as unityUrl, a.type, a.url_list
     from tb_collection a LEFT JOIN tb_collection_time b on a.time_id = b.id
     LEFT JOIN tb_collection_type c ON a.type_id = c.id
     WHERE 1 = 1
@@ -105,7 +105,7 @@
     a.repair_time as repairTime, a.venue, a.model_url as modelUrl, a.content_url as contentUrl, a.state,
     a.create_time as createTime, a.description, b.name as timeName, c.name as typeName, a.pic, a.num,
     a.like_num as likeNum, a.open_num as openNum, a.search_num as searchNum, download_num as downloadNum,
-    a.unity_pic as unityPic, a.unity_url as unityUrl
+    a.unity_pic as unityPic, a.unity_url as unityUrl, a.type, a.url_list
     from tb_collection a LEFT JOIN tb_collection_time b on a.time_id = b.id
     LEFT JOIN tb_collection_type c ON a.type_id = c.id
     WHERE 1 = 1

+ 8 - 0
zhoushan-system-service/src/main/java/com/fdage/service/impl/CollectionServiceImpl.java

@@ -1,6 +1,7 @@
 package com.fdage.service.impl;
 
 import cn.hutool.core.io.FileUtil;
+import cn.hutool.core.util.StrUtil;
 import com.fdage.constant.ConfigConstant;
 import com.fdage.dao.base.TbCollectionMapper;
 import com.fdage.dao.base.TbCollectionTimeMapper;
@@ -91,6 +92,11 @@ public class CollectionServiceImpl implements ICollectionService {
         }
         ResponCollection result = new ResponCollection();
         BeanUtils.copyProperties(collection, result);
+//        String typeImages = collection.getTypeImages();
+//        if (StringUtils.isNotBlank(typeImages)){
+//            List<String> images = Arrays.asList(StrUtil.split(typeImages, ","));
+//            result.setTypeImages(images);
+//        }
         TbCollectionType type = typeMapper.selectByPrimaryKey(collection.getTypeId());
         if(type != null){
             result.setTypeName(type.getName());
@@ -113,6 +119,8 @@ public class CollectionServiceImpl implements ICollectionService {
         return result;
     }
 
+
+
     @Override
     public List<ResponCollection> findList(RequestCollection bo) {
         if(bo == null){