Browse Source

林武泰/新增研究成果接口

LinWuTai 1 year ago
parent
commit
2bc4b703de
25 changed files with 414 additions and 28 deletions
  1. 123 0
      lab-admin/src/main/java/com/ruoyi/asset/controller/VisitorController.java
  2. 32 1
      lab-admin/src/main/java/com/ruoyi/asset/domain/TbAsset.java
  3. 13 0
      lab-admin/src/main/java/com/ruoyi/asset/domain/dto/VisitorAssetInfoDTO.java
  4. 1 1
      lab-admin/src/main/java/com/ruoyi/asset/mapper/TbAssetMapper.java
  5. 14 0
      lab-admin/src/main/java/com/ruoyi/asset/service/ITbAssetService.java
  6. 15 0
      lab-admin/src/main/java/com/ruoyi/asset/service/ITbAssetVideoService.java
  7. 21 0
      lab-admin/src/main/java/com/ruoyi/asset/service/impl/TbAssetServiceImpl.java
  8. 15 3
      lab-admin/src/main/java/com/ruoyi/asset/service/impl/TbAssetVideoServiceImpl.java
  9. 2 2
      lab-admin/src/main/resources/application.yml
  10. 11 1
      lab-admin/src/main/resources/mapper/asset/TbAssetMapper.xml
  11. 6 0
      lab-common/pom.xml
  12. 88 0
      lab-common/src/main/java/com/ruoyi/common/utils/ChineseCharacterUtil.java
  13. 3 1
      lab-common/src/main/java/com/ruoyi/common/utils/file/FileUploadUtils.java
  14. 1 1
      lab-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java
  15. 7 0
      lab-system/src/main/java/com/ruoyi/system/mapper/SysNoticeMapper.java
  16. 7 0
      lab-system/src/main/java/com/ruoyi/system/service/ISysNoticeService.java
  17. 5 0
      lab-system/src/main/java/com/ruoyi/system/service/impl/SysNoticeServiceImpl.java
  18. 5 0
      lab-system/src/main/resources/mapper/system/SysNoticeMapper.xml
  19. 1 1
      lab-ui/.env.development
  20. 1 1
      lab-ui/.env.production
  21. 1 1
      lab-ui/.env.staging
  22. 10 10
      lab-ui/src/layout/components/Sidebar/Logo.vue
  23. 30 3
      lab-ui/src/views/asset/asset/index.vue
  24. 1 1
      lab-ui/src/views/login.vue
  25. 1 1
      lab-ui/vue.config.js

+ 123 - 0
lab-admin/src/main/java/com/ruoyi/asset/controller/VisitorController.java

@@ -0,0 +1,123 @@
+package com.ruoyi.asset.controller;
+
+import com.ruoyi.asset.domain.TbAsset;
+import com.ruoyi.asset.domain.TbDemoVideo;
+import com.ruoyi.asset.domain.dto.VisitorAssetInfoDTO;
+import com.ruoyi.asset.service.ITbAssetService;
+import com.ruoyi.asset.service.ITbAssetVideoService;
+import com.ruoyi.asset.service.ITbDemoVideoService;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.system.domain.SysNotice;
+import com.ruoyi.system.service.ISysNoticeService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * 学生访问Controller
+ *
+ * @author 原动力
+ * @date 2023-03-27
+ */
+@Api(tags = "资产信息")
+@RestController
+@RequestMapping("/visitor")
+public class VisitorController extends BaseController {
+    @Resource
+    private ITbAssetService assetService;
+
+    @Resource
+    private ITbAssetVideoService assetVideoService;
+
+    @Resource
+    private ITbDemoVideoService demoVideoService;
+
+    @Resource
+    private ISysNoticeService noticeService;
+
+    /**
+     * 查看公开设备列表
+     */
+    @ApiOperation("查看公开设备列表")
+    @GetMapping("/asset/list")
+    public AjaxResult assetList()
+    {
+        List<TbAsset> list = assetService.selectVisitorTbAsset();
+        return AjaxResult.success(list);
+    }
+
+    @ApiOperation("查看公开设备详情")
+    @GetMapping("/asset/detail/{barCode}")
+    public AjaxResult assetDetail(@PathVariable("barCode") String assetBarCode) {
+        TbAsset tbAsset = assetService.selectTbAssetByBarCode(assetBarCode);
+        if (tbAsset == null) {
+            return error("设备不存在");
+        }
+        VisitorAssetInfoDTO infoDTO = new VisitorAssetInfoDTO();
+        infoDTO.setTbAsset(tbAsset);
+        List<Long> demoVideoIds = assetVideoService.selectVisitorTbAssetVideoForDemoVideo(assetBarCode);
+        List<TbDemoVideo> demoVideos = new ArrayList<>();
+        if (!demoVideoIds.isEmpty()) {
+            for (Long demoVideoId : demoVideoIds) {
+                TbDemoVideo demoVideo = demoVideoService.getById(demoVideoId);
+                if (demoVideo != null) {
+                    demoVideos.add(demoVideo);
+                }
+            }
+        }
+        infoDTO.setDemoVideos(demoVideos);
+
+        return AjaxResult.success(infoDTO);
+    }
+
+    /**
+     * 获取最新研究成果
+     */
+    @GetMapping("/study/new")
+    public AjaxResult getNewStudy(@RequestParam(value = "number", required = false) Long number)
+    {
+        if (number == null || number <= 0) {
+            number = 1L;
+        }
+        List<SysNotice> sysNoticeList = noticeService.selectNewStudy(number);
+        if (sysNoticeList.isEmpty()) {
+            return AjaxResult.success("暂无数据", Collections.emptyList());
+        }
+        if (number == 1) {
+            SysNotice sysNotice = sysNoticeList.get(0);
+            return AjaxResult.success(sysNotice);
+        }
+        return AjaxResult.success(sysNoticeList);
+    }
+
+    /**
+     * 获取通知公告列表
+     */
+    @GetMapping("/study/list")
+    public TableDataInfo studyList()
+    {
+        startPage();
+        SysNotice notice = new SysNotice();
+        notice.setNoticeType("3");
+        notice.setStatus("0");
+        List<SysNotice> list = noticeService.selectNoticeList(notice);
+        return getDataTable(list);
+    }
+
+    /**
+     * 根据通知公告编号获取详细信息
+     */
+    @GetMapping(value = "/study/detail/{noticeId}")
+    public AjaxResult studyDetail(@PathVariable Long noticeId)
+    {
+        return AjaxResult.success(noticeService.selectNoticeById(noticeId));
+    }
+}

+ 32 - 1
lab-admin/src/main/java/com/ruoyi/asset/domain/TbAsset.java

@@ -44,6 +44,16 @@ public class TbAsset extends BaseEntity
     @TableField("name")
     private String name;
 
+    /** 资产简介 */
+    @Excel(name = "资产简介")
+    @TableField("introduce")
+    private String introduce;
+
+    /** 资产图片 */
+    @Excel(name = "图片")
+    @TableField("img")
+    private String img;
+
     /** 资产种类 */
     @Excel(name = "资产种类")
     @TableField("kind")
@@ -163,7 +173,24 @@ public class TbAsset extends BaseEntity
     {
         return name;
     }
-    public void setKind(String kind) 
+
+    public String getIntroduce() {
+        return introduce;
+    }
+
+    public void setIntroduce(String introduce) {
+        this.introduce = introduce;
+    }
+
+    public String getImg() {
+        return img;
+    }
+
+    public void setImg(String img) {
+        this.img = img;
+    }
+
+    public void setKind(String kind)
     {
         this.kind = kind;
     }
@@ -306,6 +333,8 @@ public class TbAsset extends BaseEntity
         return status;
     }
 
+
+
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
@@ -313,6 +342,8 @@ public class TbAsset extends BaseEntity
             .append("barCode", getBarCode())
             .append("number", getNumber())
             .append("name", getName())
+            .append("introduce", getIntroduce())
+            .append("img", getImg())
             .append("kind", getKind())
             .append("categoryNumber", getCategoryNumber())
             .append("amount", getAmount())

+ 13 - 0
lab-admin/src/main/java/com/ruoyi/asset/domain/dto/VisitorAssetInfoDTO.java

@@ -0,0 +1,13 @@
+package com.ruoyi.asset.domain.dto;
+
+import com.ruoyi.asset.domain.TbAsset;
+import com.ruoyi.asset.domain.TbDemoVideo;
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class VisitorAssetInfoDTO {
+    private TbAsset tbAsset;
+    private List<TbDemoVideo> demoVideos;
+}

+ 1 - 1
lab-admin/src/main/java/com/ruoyi/asset/mapper/TbAssetMapper.java

@@ -74,7 +74,7 @@ public interface TbAssetMapper extends BaseMapper<TbAsset>
      */
     public int replace(TbAsset tbAsset);
 
-    @Select("select id, bar_code, number, name, kind, category_number, amount, quantity, quantity_unit, build_date, place_name, purpose, dept_id, registrant, specifications_model, remark, manufacturer, brand, supplier, status from tb_asset where bar_code = #{barCode}")
+    @Select("select id, bar_code, number, name, introduce, img, kind, category_number, amount, quantity, quantity_unit, build_date, place_name, purpose, dept_id, registrant, specifications_model, remark, manufacturer, brand, supplier, status from tb_asset where bar_code = #{barCode}")
     public TbAsset selectTbAssetByBarCode(String barCode);
 
     @Update("update tb_asset set status = #{status} where bar_code = #{barCode}")

+ 14 - 0
lab-admin/src/main/java/com/ruoyi/asset/service/ITbAssetService.java

@@ -27,6 +27,14 @@ public interface ITbAssetService extends IService<TbAsset>
     public TbAsset selectTbAssetById(Long id);
 
     /**
+     * 查询资产信息
+     *
+     * @param assetBarCode 设备条形码
+     * @return 资产信息
+     */
+    TbAsset selectTbAssetByBarCode(String assetBarCode);
+
+    /**
      * 查询资产信息列表
      * 
      * @param tbAsset 资产信息
@@ -106,4 +114,10 @@ public interface ITbAssetService extends IService<TbAsset>
      * @return 结果
      */
     AjaxResult countTbAsset();
+
+    /**
+     * 查看公开设备列表
+     * @return 资产信息列表
+     */
+    List<TbAsset> selectVisitorTbAsset();
 }

+ 15 - 0
lab-admin/src/main/java/com/ruoyi/asset/service/ITbAssetVideoService.java

@@ -1,6 +1,7 @@
 package com.ruoyi.asset.service;
 
 import java.util.List;
+import java.util.Set;
 
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.ruoyi.asset.domain.TbAssetVideo;
@@ -78,4 +79,18 @@ public interface ITbAssetVideoService extends IService<TbAssetVideo>
      * @return 结果
      */
     public int deleteTbAssetVideoById(Long id);
+
+    /**
+     * 查询公开设备视频绑定资产设备
+     * @return 资产设备条形码
+     */
+    Set<String> selectVisitorTbAssetVideoForAssetBarCode();
+
+    /**
+     * 查询公开设备视频绑定视频编码
+     *
+     * @param assetBarCode 资产设备条形码
+     * @return 演示视频编号集合
+     */
+    List<Long> selectVisitorTbAssetVideoForDemoVideo(String assetBarCode);
 }

+ 21 - 0
lab-admin/src/main/java/com/ruoyi/asset/service/impl/TbAssetServiceImpl.java

@@ -15,6 +15,7 @@ import com.ruoyi.asset.domain.dto.TbAssetDTO;
 import com.ruoyi.asset.domain.enums.TbAssetStatusEnum;
 import com.ruoyi.asset.mapper.TbAssetBorrowRecordMapper;
 import com.ruoyi.asset.mapper.TbAssetCategoryMapper;
+import com.ruoyi.asset.service.ITbAssetVideoService;
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.utils.UserUtils;
 import com.ruoyi.common.core.domain.entity.SysDept;
@@ -66,6 +67,17 @@ public class TbAssetServiceImpl extends ServiceImpl<TbAssetMapper, TbAsset> impl
     }
 
     /**
+     * 查询资产信息
+     *
+     * @param assetBarCode 资产设备条形码
+     * @return 资产信息
+     */
+    @Override
+    public TbAsset selectTbAssetByBarCode(String assetBarCode) {
+        return tbAssetMapper.selectTbAssetByBarCode(assetBarCode);
+    }
+
+    /**
      * 查询资产信息列表
      * 
      * @param tbAsset 资产信息
@@ -264,6 +276,15 @@ public class TbAssetServiceImpl extends ServiceImpl<TbAssetMapper, TbAsset> impl
         return AjaxResult.success("查询成功", resultMap);
     }
 
+    @Resource
+    private ITbAssetVideoService tbAssetVideoService;
+
+    @Override
+    public List<TbAsset> selectVisitorTbAsset() {
+        Set<String> assetBarCodeSet = tbAssetVideoService.selectVisitorTbAssetVideoForAssetBarCode();
+        return assetBarCodeSet.stream().map(assetBarCode -> tbAssetMapper.selectTbAssetByBarCode(assetBarCode)).collect(Collectors.toList());
+    }
+
     private ArrayList<TbAssetDTO> find(List<TbAsset> assetList) {
         List<SysDept> deptList = sysDeptMapper.allDept();
 

+ 15 - 3
lab-admin/src/main/java/com/ruoyi/asset/service/impl/TbAssetVideoServiceImpl.java

@@ -1,8 +1,6 @@
 package com.ruoyi.asset.service.impl;
 
-import java.util.ArrayList;
-import java.util.Comparator;
-import java.util.List;
+import java.util.*;
 import java.util.stream.Collectors;
 
 import cn.hutool.core.bean.BeanUtil;
@@ -160,4 +158,18 @@ public class TbAssetVideoServiceImpl extends ServiceImpl<TbAssetVideoMapper, TbA
     {
         return tbAssetVideoMapper.deleteTbAssetVideoById(id);
     }
+
+    @Override
+    public Set<String> selectVisitorTbAssetVideoForAssetBarCode() {
+        List<TbAssetVideo> list = list();
+        // 获取全部资产条形码
+        return list.stream()
+                .map(TbAssetVideo::getAssetBarCode).collect(Collectors.toCollection(HashSet::new));
+    }
+
+    @Override
+    public List<Long> selectVisitorTbAssetVideoForDemoVideo(String assetBarCode) {
+        List<TbAssetVideo> list = query().eq("asset_bar_code", assetBarCode).list();
+        return list.stream().map(TbAssetVideo::getDemoVideoId).collect(Collectors.toList());
+    }
 }

+ 2 - 2
lab-admin/src/main/resources/application.yml

@@ -59,9 +59,9 @@ spring:
   servlet:
      multipart:
        # 单个文件大小
-       max-file-size:  10MB
+       max-file-size:  200MB
        # 设置总上传的文件大小
-       max-request-size:  20MB
+       max-request-size:  500MB
   # 服务模块
   devtools:
     restart:

+ 11 - 1
lab-admin/src/main/resources/mapper/asset/TbAssetMapper.xml

@@ -9,6 +9,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="barCode"    column="bar_code"    />
         <result property="number"    column="number"    />
         <result property="name"    column="name"    />
+        <result property="introduce"    column="introduce"    />
+        <result property="img"    column="img"    />
         <result property="kind"    column="kind"    />
         <result property="categoryNumber"    column="category_number"    />
         <result property="amount"    column="amount"    />
@@ -28,7 +30,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectTbAssetVo">
-        select id, bar_code, number, name, kind, category_number, amount, quantity, quantity_unit, build_date, place_name, purpose, dept_id, registrant, specifications_model, remark, manufacturer, brand, supplier, status from tb_asset
+        select id, bar_code, number, name, introduce, img, kind, category_number, amount, quantity, quantity_unit, build_date, place_name, purpose, dept_id, registrant, specifications_model, remark, manufacturer, brand, supplier, status from tb_asset
     </sql>
 
     <select id="selectTbAssetList" parameterType="TbAsset" resultMap="TbAssetResult">
@@ -63,6 +65,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="barCode != null and barCode != ''">bar_code,</if>
             <if test="number != null and number != ''">number,</if>
             <if test="name != null and name != ''">name,</if>
+            <if test="introduce != null and introduce != ''">introduce,</if>
+            <if test="img != null and img != ''">img,</if>
             <if test="kind != null and kind != ''">kind,</if>
             <if test="categoryNumber != null and categoryNumber != ''">category_number,</if>
             <if test="amount != null">amount,</if>
@@ -84,6 +88,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="barCode != null and barCode != ''">#{barCode},</if>
             <if test="number != null and number != ''">#{number},</if>
             <if test="name != null and name != ''">#{name},</if>
+            <if test="introduce != null and introduce != ''">#{introduce},</if>
+            <if test="img != null and img != ''">#{img},</if>
             <if test="kind != null and kind != ''">#{kind},</if>
             <if test="categoryNumber != null and categoryNumber != ''">#{categoryNumber},</if>
             <if test="amount != null">#{amount},</if>
@@ -109,6 +115,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="barCode != null and barCode != ''">bar_code = #{barCode},</if>
             <if test="number != null and number != ''">number = #{number},</if>
             <if test="name != null and name != ''">name = #{name},</if>
+            <if test="introduce != null and introduce != ''">introduce = #{introduce},</if>
+            <if test="img != null and img != ''">img= #{img},</if>
             <if test="kind != null and kind != ''">kind = #{kind},</if>
             <if test="categoryNumber != null and categoryNumber != ''">category_number = #{categoryNumber},</if>
             <if test="amount != null">amount = #{amount},</if>
@@ -146,6 +154,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="barCode != null and barCode != ''">bar_code,</if>
             <if test="number != null and number != ''">number,</if>
             <if test="name != null and name != ''">name,</if>
+            <if test="introduce != null and introduce != ''">introduce,</if>
             <if test="kind != null and kind != ''">kind,</if>
             <if test="categoryNumber != null and categoryNumber != ''">category_number,</if>
             <if test="amount != null">amount,</if>
@@ -167,6 +176,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="barCode != null and barCode != ''">#{barCode},</if>
             <if test="number != null and number != ''">#{number},</if>
             <if test="name != null and name != ''">#{name},</if>
+            <if test="introduce != null and introduce != ''">#{introduce},</if>
             <if test="kind != null and kind != ''">#{kind},</if>
             <if test="categoryNumber != null and categoryNumber != ''">#{categoryNumber},</if>
             <if test="amount != null">#{amount},</if>

+ 6 - 0
lab-common/pom.xml

@@ -151,6 +151,12 @@
             <version>3.3</version>
         </dependency>
 
+        <dependency>
+            <groupId>com.belerweb</groupId>
+            <artifactId>pinyin4j</artifactId>
+            <version>2.5.1</version>
+        </dependency>
+
     </dependencies>
 
 </project>

+ 88 - 0
lab-common/src/main/java/com/ruoyi/common/utils/ChineseCharacterUtil.java

@@ -0,0 +1,88 @@
+package com.ruoyi.common.utils;
+
+import net.sourceforge.pinyin4j.PinyinHelper;
+import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat;
+import net.sourceforge.pinyin4j.format.HanyuPinyinToneType;
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * 汉字工具类
+ */
+public class ChineseCharacterUtil {
+    /**
+     * 将汉字转成拼音(取首字母或全拼)
+     * @param hanzi 汉字
+     * @param full 是否全拼
+     * @return
+     */
+    public static String convertHanzi2Pinyin(String hanzi,boolean full)
+    {
+        /*
+          ^[\u2E80-\u9FFF]+$ 匹配所有东亚区的语言
+          ^[\u4E00-\u9FFF]+$ 匹配简体和繁体
+          ^[\u4E00-\u9FA5]+$ 匹配简体
+         */
+        String regExp="^[\u4E00-\u9FFF]+$";
+        StringBuilder sb=new StringBuilder();
+        if(hanzi==null||"".equals(hanzi.trim()))
+        {
+            return "";
+        }
+        String pinyin;
+        for(int i=0;i<hanzi.length();i++)
+        {
+            char unit=hanzi.charAt(i);
+            if(match(String.valueOf(unit),regExp))//是汉字,则转拼音
+            {
+                pinyin=convertSingleHanzi2Pinyin(unit);
+                if(full)
+                {
+                    sb.append(pinyin);
+                }
+                else
+                {
+                    sb.append(pinyin.charAt(0));
+                }
+            }
+            else
+            {
+                sb.append(unit);
+            }
+        }
+        return sb.toString();
+    }
+    /**
+     * 将单个汉字转成拼音
+     * @param hanzi 汉字
+     * @return 拼音
+     */
+    private static String convertSingleHanzi2Pinyin(char hanzi)
+    {
+        HanyuPinyinOutputFormat outputFormat = new HanyuPinyinOutputFormat();
+        outputFormat.setToneType(HanyuPinyinToneType.WITHOUT_TONE);
+        String[] res;
+        StringBuilder sb=new StringBuilder();
+        try {
+            res = PinyinHelper.toHanyuPinyinStringArray(hanzi,outputFormat);
+            sb.append(res[0]);//对于多音字,只用第一个拼音
+        } catch (Exception e) {
+            e.printStackTrace();
+            return "";
+        }
+        return sb.toString();
+    }
+
+    /**
+     * @param str 源字符串
+     * @param regex 正则表达式
+     * @return 是否匹配
+     */
+    public static boolean match(String str,String regex)
+    {
+        Pattern pattern=Pattern.compile(regex);
+        Matcher matcher=pattern.matcher(str);
+        return matcher.find();
+    }
+}

+ 3 - 1
lab-common/src/main/java/com/ruoyi/common/utils/file/FileUploadUtils.java

@@ -4,6 +4,8 @@ import java.io.File;
 import java.io.IOException;
 import java.nio.file.Paths;
 import java.util.Objects;
+
+import com.ruoyi.common.utils.ChineseCharacterUtil;
 import org.apache.commons.io.FilenameUtils;
 import org.springframework.web.multipart.MultipartFile;
 import com.ruoyi.common.config.RuoYiConfig;
@@ -123,7 +125,7 @@ public class FileUploadUtils
     public static final String extractFilename(MultipartFile file)
     {
         return StringUtils.format("{}/{}_{}.{}", DateUtils.datePath(),
-                FilenameUtils.getBaseName(file.getOriginalFilename()), Seq.getId(Seq.uploadSeqType), getExtension(file));
+                ChineseCharacterUtil.convertHanzi2Pinyin(FilenameUtils.getBaseName(file.getOriginalFilename()), false), Seq.getId(Seq.uploadSeqType), getExtension(file));
     }
 
     public static final File getAbsoluteFile(String uploadDir, String fileName) throws IOException

+ 1 - 1
lab-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java

@@ -112,7 +112,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
                 .antMatchers("/login", "/register", "/captchaImage", "/asset/demoVideo/player**").anonymous()
                 // 静态资源,可匿名访问
                 .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll()
-                .antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll()
+                .antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**", "/visitor/**").permitAll()
                 // 除上面外的所有请求全部需要鉴权认证
                 .anyRequest().authenticated()
                 .and()

+ 7 - 0
lab-system/src/main/java/com/ruoyi/system/mapper/SysNoticeMapper.java

@@ -71,4 +71,11 @@ public interface SysNoticeMapper
      * @return 通知信息
      */
     List<SysNotice> selectNewInform(Long number);
+
+    /**
+     * 获取最新number条研究成果
+     *
+     * @return 研究成果
+     */
+    List<SysNotice> selectNewStudy(Long number);
 }

+ 7 - 0
lab-system/src/main/java/com/ruoyi/system/service/ISysNoticeService.java

@@ -72,4 +72,11 @@ public interface ISysNoticeService
      * @return 公告信息
      */
     List<SysNotice> selectNewInform(Long number);
+
+    /**
+     * 获取最新number条研究成果
+     *
+     * @return 研究成果
+     */
+    List<SysNotice> selectNewStudy(Long number);
 }

+ 5 - 0
lab-system/src/main/java/com/ruoyi/system/service/impl/SysNoticeServiceImpl.java

@@ -104,4 +104,9 @@ public class SysNoticeServiceImpl implements ISysNoticeService
     public List<SysNotice> selectNewInform(Long number) {
         return noticeMapper.selectNewInform(number);
     }
+
+    @Override
+    public List<SysNotice> selectNewStudy(Long number) {
+        return noticeMapper.selectNewStudy(number);
+    }
 }

+ 5 - 0
lab-system/src/main/resources/mapper/system/SysNoticeMapper.xml

@@ -98,4 +98,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <include refid="selectNoticeVo"/>
         where status = 0 and notice_type = 1 order by create_time desc, update_time desc limit #{number}
     </select>
+
+    <select id="selectNewStudy" parameterType="Long" resultMap="SysNoticeResult">
+        <include refid="selectNoticeVo"/>
+        where status = 0 and notice_type = 3 order by create_time desc, update_time desc limit #{number}
+    </select>
 </mapper>

+ 1 - 1
lab-ui/.env.development

@@ -1,5 +1,5 @@
 # 页面标题
-VUE_APP_TITLE = 若依管理系统
+VUE_APP_TITLE = 设备管理系统
 
 # 开发环境配置
 ENV = 'development'

+ 1 - 1
lab-ui/.env.production

@@ -1,5 +1,5 @@
 # 页面标题
-VUE_APP_TITLE = 若依管理系统
+VUE_APP_TITLE = 设备管理系统
 
 # 生产环境配置
 ENV = 'production'

+ 1 - 1
lab-ui/.env.staging

@@ -1,5 +1,5 @@
 # 页面标题
-VUE_APP_TITLE = 若依管理系统
+VUE_APP_TITLE = 设备管理系统
 
 NODE_ENV = production
 

+ 10 - 10
lab-ui/src/layout/components/Sidebar/Logo.vue

@@ -1,13 +1,13 @@
 <template>
-  <div class="sidebar-logo-container" :class="{'collapse':collapse}" :style="{ backgroundColor: sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground }">
+  <div class="sidebar-logo-container" :class="{ collapse: collapse }" :style="{ backgroundColor: sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground }">
     <transition name="sidebarLogoFade">
       <router-link v-if="collapse" key="collapse" class="sidebar-logo-link" to="/">
         <img v-if="logo" :src="logo" class="sidebar-logo" />
-        <h1 v-else class="sidebar-title" :style="{ color: sideTheme === 'theme-dark' ? variables.logoTitleColor : variables.logoLightTitleColor }">{{ title }} </h1>
+        <h1 v-else class="sidebar-title" :style="{ color: sideTheme === 'theme-dark' ? variables.logoTitleColor : variables.logoLightTitleColor }">{{ title }}</h1>
       </router-link>
       <router-link v-else key="expand" class="sidebar-logo-link" to="/">
         <img v-if="logo" :src="logo" class="sidebar-logo" />
-        <h1 class="sidebar-title" :style="{ color: sideTheme === 'theme-dark' ? variables.logoTitleColor : variables.logoLightTitleColor }">{{ title }} </h1>
+        <h1 class="sidebar-title" :style="{ color: sideTheme === 'theme-dark' ? variables.logoTitleColor : variables.logoLightTitleColor }">{{ title }}</h1>
       </router-link>
     </transition>
   </div>
@@ -22,23 +22,23 @@ export default {
   props: {
     collapse: {
       type: Boolean,
-      required: true
-    }
+      required: true,
+    },
   },
   computed: {
     variables() {
-      return variables;
+      return variables
     },
     sideTheme() {
       return this.$store.state.settings.sideTheme
-    }
+    },
   },
   data() {
     return {
-      title: '若依管理系统',
-      logo: logoImg
+      title: '设备管理系统',
+      logo: logoImg,
     }
-  }
+  },
 }
 </script>
 

+ 30 - 3
lab-ui/src/views/asset/asset/index.vue

@@ -211,7 +211,24 @@
       <el-table-column label="编号" align="center" prop="id" />
       <el-table-column label="条形码" align="center" prop="barCode" />
       <el-table-column label="资产编号" align="center" prop="number" />
+      <el-table-column label="资产图片" align="center" prop="img" width="90">
+        <template slot-scope="scope">
+          <image-preview :src="scope.row.img" :width="80" :height="80" v-show="!(scope.row.img===''||scope.row.img==null)"/>
+        </template>
+      </el-table-column>
       <el-table-column label="资产名称" align="center" prop="name" />
+      <el-table-column label="资产简介" align="center" prop="introduce">
+        <template slot-scope="scope">
+          <el-popover
+            placement="right"
+            title="资产简介"
+            width="500"
+            trigger="hover"
+            :content="scope.row.introduce">
+            <el-button slot="reference">查看</el-button>
+          </el-popover>
+        </template>
+      </el-table-column>
       <el-table-column label="资产种类" align="center" prop="kind">
         <template slot-scope="scope">
           <dict-tag :options="dict.type.asset_kind" :value="scope.row.kind"/>
@@ -293,6 +310,12 @@
         <el-form-item label="资产名称" prop="name">
           <el-input v-model="form.name" placeholder="请输入资产名称" />
         </el-form-item>
+        <el-form-item label="照片">
+          <image-upload v-model="form.img" :limit="1" />
+        </el-form-item>
+        <el-form-item label="资产简介">
+          <el-input type="textarea" :rows="2" v-model="form.introduce" placeholder="请输入资产简介" />
+        </el-form-item>
         <el-form-item label="资产种类" prop="kind">
           <el-select v-model="form.kind" placeholder="请选择资产种类">
             <el-option
@@ -356,7 +379,8 @@
             :options="deptList"
             :show-all-levels="false"
             filterable
-            clearable :props="{value: 'id'}"
+            clearable 
+            :props="{value: 'id', emitPath: false}"
             placeholder="请选择使用部门"
           ></el-cascader>
         </el-form-item>
@@ -422,7 +446,6 @@
         <el-button @click="upload.open = false">取 消</el-button>
       </div>
     </el-dialog>
-
     
     <!-- 批量添加设备视频对话框 -->
     <el-dialog :title="title" :visible.sync="openBanding" width="700px" append-to-body>
@@ -437,6 +460,7 @@ import { allCategory } from '@/api/asset/category.js'
 import { treeselect } from '@/api/system/dept.js'
 import { allPlace } from '@/api/asset/place.js'
 import { getToken } from "@/utils/auth";
+import ImageUpload from "@/components/ImageUpload"
 export default {
   name: "Asset",
   dicts: ['asset_kind', 'asset_prupose', 'asset_status'],
@@ -544,6 +568,9 @@ export default {
       openBanding: false
     };
   },
+  components: {
+    ImageUpload
+  },
   created() {
     this.initData();
   },
@@ -689,7 +716,7 @@ export default {
         const dept = this.form.deptId
         if (dept.length <= 0 || dept == null) {
           this.form.deptId = null
-        } else {
+        } else if (dept instanceof Array) {
           this.form.deptId = dept[dept.length-1]
         }
         if (valid) {

+ 1 - 1
lab-ui/src/views/login.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="login">
     <el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form">
-      <h3 class="title">若依后台管理系统</h3>
+      <h3 class="title">设备管理系统</h3>
       <el-form-item prop="username">
         <el-input
           v-model="loginForm.username"

+ 1 - 1
lab-ui/vue.config.js

@@ -35,7 +35,7 @@ module.exports = {
     proxy: {
       // detail: https://cli.vuejs.org/config/#devserver-proxy
       [process.env.VUE_APP_BASE_API]: {
-        target: `http://192.168.0.101:8080`,
+        target: `http://localhost:8080`,
         changeOrigin: true,
         pathRewrite: {
           ['^' + process.env.VUE_APP_BASE_API]: ''