Browse Source

修改故障上报失败问题

LinWuTai 1 year ago
parent
commit
53d913ed55

+ 0 - 1
lab-admin/src/main/java/com/ruoyi/asset/controller/TbDemoVideoController.java

@@ -10,7 +10,6 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
 import cn.hutool.core.util.StrUtil;
-import com.ruoyi.asset.domain.dto.BatchTbAssetVideoDTO;
 import com.ruoyi.common.config.RuoYiConfig;
 import com.ruoyi.common.utils.ByteUtils;
 import com.ruoyi.common.utils.file.FileUploadUtils;

+ 11 - 0
lab-admin/src/main/java/com/ruoyi/asset/domain/dto/TbAssetVideoDTO.java

@@ -1,5 +1,6 @@
 package com.ruoyi.asset.domain.dto;
 
+import com.ruoyi.asset.domain.TbAsset;
 import com.ruoyi.asset.domain.TbAssetVideo;
 import com.ruoyi.asset.domain.TbDemoVideo;
 import org.apache.commons.lang3.builder.ToStringBuilder;
@@ -8,6 +9,8 @@ import org.apache.commons.lang3.builder.ToStringStyle;
 public class TbAssetVideoDTO extends TbAssetVideo {
     private TbDemoVideo tbDemoVideo;
 
+    private TbAsset tbAsset;
+
     public TbDemoVideo getTbDemoVideo() {
         return tbDemoVideo;
     }
@@ -16,6 +19,14 @@ public class TbAssetVideoDTO extends TbAssetVideo {
         this.tbDemoVideo = tbDemoVideo;
     }
 
+    public TbAsset getTbAsset() {
+        return tbAsset;
+    }
+
+    public void setTbAsset(TbAsset tbAsset) {
+        this.tbAsset = tbAsset;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

+ 20 - 0
lab-admin/src/main/java/com/ruoyi/asset/domain/dto/TbFaultReportDTO.java

@@ -8,6 +8,10 @@ import org.apache.commons.lang3.builder.ToStringStyle;
 public class TbFaultReportDTO extends TbFaultReport {
     private TbAsset tbAsset;
 
+    private String username;
+
+    private String nickname;
+
     public TbAsset getTbAsset() {
         return tbAsset;
     }
@@ -16,6 +20,22 @@ public class TbFaultReportDTO extends TbFaultReport {
         this.tbAsset = tbAsset;
     }
 
+    public String getUsername() {
+        return username;
+    }
+
+    public void setUsername(String username) {
+        this.username = username;
+    }
+
+    public String getNickname() {
+        return nickname;
+    }
+
+    public void setNickname(String nickname) {
+        this.nickname = nickname;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

+ 1 - 1
lab-admin/src/main/java/com/ruoyi/asset/service/ITbFaultReportService.java

@@ -24,7 +24,7 @@ public interface ITbFaultReportService extends IService<TbFaultReport>
      * @param id 故障报备主键
      * @return 故障报备
      */
-    public TbFaultReport selectTbFaultReportById(Long id);
+    public TbFaultReportDTO selectTbFaultReportById(Long id);
 
     /**
      * 查询故障报备列表

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

@@ -76,9 +76,12 @@ public class TbAssetVideoServiceImpl extends ServiceImpl<TbAssetVideoMapper, TbA
         for (TbAssetVideo assetVideo : collect) {
             Long demoVideoId = assetVideo.getDemoVideoId();
             TbDemoVideo tbDemoVideo = tbDemoVideoMapper.selectTbDemoVideoById(demoVideoId);
+            String assetBarCode = assetVideo.getAssetBarCode();
+            TbAsset tbAsset = tbAssetMapper.selectTbAssetByBarCode(assetBarCode);
 
             TbAssetVideoDTO tbAssetVideoDTO = BeanUtil.toBean(assetVideo, TbAssetVideoDTO.class);
             tbAssetVideoDTO.setTbDemoVideo(tbDemoVideo);
+            tbAssetVideoDTO.setTbAsset(tbAsset);
             videoDTOS.add(tbAssetVideoDTO);
         }
 

+ 21 - 3
lab-admin/src/main/java/com/ruoyi/asset/service/impl/TbFaultReportServiceImpl.java

@@ -65,9 +65,18 @@ public class TbFaultReportServiceImpl extends ServiceImpl<TbFaultReportMapper, T
      * @return 故障报备
      */
     @Override
-    public TbFaultReport selectTbFaultReportById(Long id)
+    public TbFaultReportDTO selectTbFaultReportById(Long id)
     {
-        return tbFaultReportMapper.selectTbFaultReportById(id);
+        TbFaultReport tbFaultReport = tbFaultReportMapper.selectTbFaultReportById(id);
+        TbFaultReportDTO tbFaultReportDTO = BeanUtil.toBean(tbFaultReport, TbFaultReportDTO.class);
+        String assetBarCode = tbFaultReport.getAssetBarCode();
+        TbAsset tbAsset = tbAssetMapper.selectTbAssetByBarCode(assetBarCode);
+        Long userId = tbFaultReport.getUserId();
+        SysUser sysUser = userMapper.selectUserById(userId);
+        tbFaultReportDTO.setUsername(sysUser.getUserName());
+        tbFaultReportDTO.setNickname(sysUser.getNickName());
+        tbFaultReportDTO.setTbAsset(tbAsset);
+        return tbFaultReportDTO;
     }
 
     /**
@@ -85,6 +94,10 @@ public class TbFaultReportServiceImpl extends ServiceImpl<TbFaultReportMapper, T
             TbFaultReportDTO tbFaultReportDTO = BeanUtil.toBean(faultReport, TbFaultReportDTO.class);
             String assetBarCode = faultReport.getAssetBarCode();
             TbAsset tbAsset = tbAssetMapper.selectTbAssetByBarCode(assetBarCode);
+            Long userId = faultReport.getUserId();
+            SysUser sysUser = userMapper.selectUserById(userId);
+            tbFaultReportDTO.setUsername(sysUser.getUserName());
+            tbFaultReportDTO.setNickname(sysUser.getNickName());
             tbFaultReportDTO.setTbAsset(tbAsset);
             faultReportDTOS.add(tbFaultReportDTO);
         }
@@ -226,8 +239,13 @@ public class TbFaultReportServiceImpl extends ServiceImpl<TbFaultReportMapper, T
             return AjaxResult.error("故障报备已处理");
         }
         Long feedbackStatus = faultReportProcessDTO.getFeedbackStatus();
-        if (feedbackStatus == null || feedbackStatus < 1 || feedbackStatus > 2){
+        if (feedbackStatus == null) {
+            return AjaxResult.error("状态反馈不能为空");
+        }
+        if (feedbackStatus > 0){
             feedbackStatus = TbAssetStatusEnum.normal.getStatusCode();
+        } else {
+            feedbackStatus = TbAssetStatusEnum.scrap.getStatusCode();
         }
         faultReport.setProcessState(TbFaultProcessStateEnum.processed.getProcessStateCode());
         faultReport.setProcessResult(faultReportProcessDTO.getProcessResult());

+ 1 - 1
lab-ui/src/components/RuoYi/Doc/index.vue

@@ -9,7 +9,7 @@ export default {
   name: 'RuoYiDoc',
   data() {
     return {
-      url: 'http://doc.ruoyi.vip/ruoyi-vue'
+      url: '#'
     }
   },
   methods: {

+ 1 - 1
lab-ui/src/components/RuoYi/Git/index.vue

@@ -9,7 +9,7 @@ export default {
   name: 'RuoYiGit',
   data() {
     return {
-      url: 'https://gitee.com/y_project/RuoYi-Vue'
+      url: '#'
     }
   },
   methods: {

+ 1 - 13
lab-ui/src/layout/components/Navbar.vue

@@ -8,14 +8,6 @@
     <div class="right-menu">
       <template v-if="device!=='mobile'">
         <search id="header-search" class="right-menu-item" />
-        
-        <el-tooltip content="源码地址" effect="dark" placement="bottom">
-          <ruo-yi-git id="ruoyi-git" class="right-menu-item hover-effect" />
-        </el-tooltip>
-
-        <el-tooltip content="文档地址" effect="dark" placement="bottom">
-          <ruo-yi-doc id="ruoyi-doc" class="right-menu-item hover-effect" />
-        </el-tooltip>
 
         <screenfull id="screenfull" class="right-menu-item hover-effect" />
 
@@ -54,8 +46,6 @@ import Hamburger from '@/components/Hamburger'
 import Screenfull from '@/components/Screenfull'
 import SizeSelect from '@/components/SizeSelect'
 import Search from '@/components/HeaderSearch'
-import RuoYiGit from '@/components/RuoYi/Git'
-import RuoYiDoc from '@/components/RuoYi/Doc'
 
 export default {
   components: {
@@ -64,9 +54,7 @@ export default {
     Hamburger,
     Screenfull,
     SizeSelect,
-    Search,
-    RuoYiGit,
-    RuoYiDoc
+    Search
   },
   computed: {
     ...mapGetters([

+ 36 - 1
lab-ui/src/views/asset/assetVideo/index.vue

@@ -72,7 +72,12 @@
     <el-table v-loading="loading" :data="assetVideoList" @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
       <!-- <el-table-column label="编号" align="center" prop="id" /> -->
-      <el-table-column label="设备条形码" align="center" prop="assetBarCode" />
+      <!-- <el-table-column label="设备条形码" align="center" prop="assetBarCode" /> -->
+      <el-table-column label="设备条形码" align="center">
+        <template slot-scope="scope">
+          <a style="color: #409EFF" @click="openMore(scope.row)">{{scope.row.assetBarCode}}</a>
+        </template>
+      </el-table-column>
       <el-table-column label="演示视频名称" align="center" prop="tbDemoVideo.name" />
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
@@ -93,6 +98,27 @@
         </template>
       </el-table-column>
     </el-table>
+
+    <el-dialog title="资产信息" :visible.sync="assetShow">
+      <el-descriptions title="资产信息">
+        <el-descriptions-item label="资产编号">{{assetInfo.number}}</el-descriptions-item>
+        <el-descriptions-item label="资产名称">{{assetInfo.name}}</el-descriptions-item>
+        <el-descriptions-item label="资产种类">{{assetInfo.kind}}</el-descriptions-item>
+        <el-descriptions-item label="分类编号">{{assetInfo.categoryNumber}}</el-descriptions-item>
+        <el-descriptions-item label="资产原值">{{assetInfo.amount}}</el-descriptions-item>
+        <el-descriptions-item label="数量">{{assetInfo.quantity}}</el-descriptions-item>
+        <el-descriptions-item label="计量单位">{{assetInfo.quantityUnit}}</el-descriptions-item>
+        <el-descriptions-item label="取得时间">{{assetInfo.buildDate}}</el-descriptions-item>
+        <el-descriptions-item label="存放地点">{{assetInfo.placeName}}</el-descriptions-item>
+        <el-descriptions-item label="资产用途">{{assetInfo.purpose}}</el-descriptions-item>
+        <el-descriptions-item label="使用部门">{{assetInfo.deptName}}</el-descriptions-item>
+        <el-descriptions-item label="登记人">{{assetInfo.registrant}}</el-descriptions-item>
+        <el-descriptions-item label="规格型号">{{assetInfo.specificationsModel}}</el-descriptions-item>
+        <el-descriptions-item label="生产厂商">{{assetInfo.manufacturer}}</el-descriptions-item>
+        <el-descriptions-item label="品牌型号">{{assetInfo.brand}}</el-descriptions-item>
+        <el-descriptions-item label="供应商">{{assetInfo.supplier}}</el-descriptions-item>
+      </el-descriptions>
+    </el-dialog>
     
     <pagination
       v-show="total>0"
@@ -141,6 +167,10 @@ export default {
       total: 0,
       // 设备视频表格数据
       assetVideoList: [],
+      // 是否显示设备信息
+      assetShow: false,
+      // 设备信息
+      assetInfo: {},
       // 弹出层标题
       title: "",
       // 是否显示弹出层
@@ -208,6 +238,11 @@ export default {
       this.single = selection.length!==1
       this.multiple = !selection.length
     },
+    /** 打开查看设备信息 */
+    openMore(row) {
+      this.assetShow = true
+      this.assetInfo = row.tbAsset
+    },
     /** 新增按钮操作 */
     handleAdd() {
       this.reset();

+ 1 - 1
lab-ui/src/views/asset/fault/index.vue

@@ -221,7 +221,7 @@
         <el-form-item label="状态反馈" prop="feedbackStatus">
           <el-radio-group v-model="faultForm.feedbackStatus" size="small">
             <el-radio label="1" border>正常</el-radio>
-            <el-radio label="2" border>报废</el-radio>
+            <el-radio label="0" border>报废</el-radio>
           </el-radio-group>
         </el-form-item>
       </el-form>

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

@@ -56,7 +56,7 @@
     </el-form>
     <!--  底部  -->
     <div class="el-login-footer">
-      <span>Copyright © 2018-2022 ruoyi.vip All Rights Reserved.</span>
+      <span>Copyright © 2023 xxx All Rights Reserved.</span>
     </div>
   </div>
 </template>

+ 2 - 2
lab-ui/src/views/register.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="register">
     <el-form ref="registerForm" :model="registerForm" :rules="registerRules" class="register-form">
-      <h3 class="title">若依后台管理系统</h3>
+      <h3 class="title">设备后台管理系统</h3>
       <el-form-item prop="username">
         <el-input v-model="registerForm.username" type="text" auto-complete="off" placeholder="账号">
           <svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" />
@@ -61,7 +61,7 @@
     </el-form>
     <!--  底部  -->
     <div class="el-register-footer">
-      <span>Copyright © 2018-2022 ruoyi.vip All Rights Reserved.</span>
+      <span>Copyright © 2023 xxx All Rights Reserved.</span>
     </div>
   </div>
 </template>