Răsfoiți Sursa

优化资产信息上传

LinWuTai 1 an în urmă
părinte
comite
295241eac6

+ 8 - 7
ruoyi-admin/src/main/java/com/ruoyi/asset/domain/TbAssetInformation.java

@@ -203,20 +203,21 @@ public class TbAssetInformation extends BaseEntity
    // @Excel(name = "预留字段j")
     private String reservedColumnJ;
 
+    /** 位置ID */
     private Long locationId;
-
+    /** 位置名称 */
     private String locationName;
-
+    /** 位置标签 */
     private String locationLabel;
-
+    /** 分类ID */
     private Long categoryId;
-
+    /** 分类名称 */
     private String categoryName;
-
+    /** 使用部门名称 */
     private String userDepartmentName;
-
+    /** 管理部门名称 */
     private String departmentName;
-
+    /** 使用公司名称 */
     private String corporationName;
 
 }

+ 10 - 0
ruoyi-admin/src/main/java/com/ruoyi/inventory/controller/TbAssetInventoryController.java

@@ -87,6 +87,16 @@ public class TbAssetInventoryController extends BaseController
     }
 
     /**
+     * 获取资产盘点记录详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('inventory:inventory:query')")
+    @GetMapping(value = "/info/{orderNumber}")
+    public AjaxResult getInfo2(@PathVariable("orderNumber") String orderNumber)
+    {
+        return success(tbAssetInventoryService.selectTbAssetInventoryByNum(orderNumber));
+    }
+
+    /**
      * 新增资产盘点记录
      */
     @PreAuthorize("@ss.hasPermi('inventory:inventory:add')")

+ 6 - 2
ruoyi-admin/src/main/java/com/ruoyi/inventory/service/impl/TbAssetInventoryServiceImpl.java

@@ -232,7 +232,7 @@ public class TbAssetInventoryServiceImpl implements ITbAssetInventoryService
         List<String> _list = informations.stream().map(TbAssetInformation::getNumber).collect(Collectors.toList());
 
         //已盘点,1
-        List<String> green = (List) CollectionUtil.intersection(_list, list);
+        List<String> green = (List<String>) CollectionUtil.intersection(_list, list);
         //未盘点,2
         List<String> red = new ArrayList<>(_list);
         red.removeAll(list);
@@ -252,7 +252,11 @@ public class TbAssetInventoryServiceImpl implements ITbAssetInventoryService
     private void setInventoryDetail(List<String> list, TbInventoryDetail detail, String orderNumber, Long isUpdate){
         for (String number : list) {
             detail.setOrderNumber(orderNumber);
-            detail.setInventoryMetadata(JSONUtil.toJsonStr(informationMapper.selectTbAssetInformationByAssetNumber(number)));
+            TbAssetInformation tbAssetInformation = informationMapper.selectTbAssetInformationByAssetNumber(number);
+            if (tbAssetInformation == null) {
+                continue;
+            }
+            detail.setInventoryMetadata(JSONUtil.toJsonStr(tbAssetInformation));
             detail.setIsUpdateData(isUpdate);
             tbInventoryDetailMapper.insertTbInventoryDetail(detail);
         }

+ 7 - 3
ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java

@@ -1223,9 +1223,13 @@ public class ExcelUtil<T>
             }
             else
             {
-                if (itemArray[1].equals(propertyValue))
-                {
-                    return itemArray[0];
+                if (itemArray.length > 1) {
+                    if (itemArray[1].equals(propertyValue))
+                    {
+                        return itemArray[0];
+                    }
+                } else {
+                    return "";
                 }
             }
         }

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

@@ -111,7 +111,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
                 // 过滤请求
                 .authorizeRequests()
                 // 对于登录login 注册register 验证码captchaImage 允许匿名访问
-                .antMatchers("/login", "/register", "/captchaImage","/inventory/inventory/takeStock", "/asset/location/tree","/visitor/**", "/print/**").permitAll()
+                .antMatchers("/login", "/register", "/captchaImage","/inventory/inventory/takeStock", "/inventory/inventory/info/**", "/asset/location/tree","/visitor/**", "/print/**").permitAll()
                 // 静态资源,可匿名访问
                 .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**", "/asset/location/code/**").permitAll()
                 .antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll()

+ 15 - 25
ruoyi-ui/src/views/asset/location/index.vue

@@ -39,31 +39,25 @@
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
-    <el-table
-      v-loading="loading"
-      :data="locationList" 
-      row-key="id"
-      @selection-change="handleSelectionChange" 
-      :tree-props="{children: 'children', hasChildren: 'hasChildren'}
-    ">
+    <el-table v-loading="loading" :data="locationList" row-key="id" @selection-change="handleSelectionChange" :tree-props="{ children: 'children', hasChildren: 'hasChildren' }">
       <el-table-column type="selection" width="55" align="center" />
       <!-- <el-table-column label="位置编号" align="center" prop="number" /> -->
       <el-table-column label="名称" align="center" prop="name" />
       <el-table-column label="二维码" align="center" prop="number">
         <template slot-scope="scope">
-          <image-preview :src="getCode(scope.row.number)" :width="80" :height="80"/>
+          <image-preview :src="getCode(scope.row.number)" :width="80" :height="80" />
         </template>
       </el-table-column>
-      <el-table-column label="编号" align="center" prop="id" />
+      <el-table-column label="位置编码" align="center" prop="number" />
       <el-table-column label="上级位置" align="center" prop="parentId" />
       <!-- <el-table-column label="祖级列表" align="center" prop="sequence" /> -->
       <el-table-column label="位置标签" align="center" prop="label">
         <template slot-scope="scope">
-          <el-tag v-if="getLevel(scope.row.sequence) === 1">{{scope.row.label}}</el-tag>
-          <el-tag type="success" v-if="getLevel(scope.row.sequence) === 2">{{scope.row.label}}</el-tag>
-          <el-tag type="warning" v-if="getLevel(scope.row.sequence) === 3">{{scope.row.label}}</el-tag>
-          <el-tag type="danger" v-if="getLevel(scope.row.sequence) === 4">{{scope.row.label}}</el-tag>
-          <el-tag type="info" v-if="getLevel(scope.row.sequence) > 4">{{scope.row.label}}</el-tag>
+          <el-tag v-if="getLevel(scope.row.sequence) === 1">{{ scope.row.label }}</el-tag>
+          <el-tag type="success" v-if="getLevel(scope.row.sequence) === 2">{{ scope.row.label }}</el-tag>
+          <el-tag type="warning" v-if="getLevel(scope.row.sequence) === 3">{{ scope.row.label }}</el-tag>
+          <el-tag type="danger" v-if="getLevel(scope.row.sequence) === 4">{{ scope.row.label }}</el-tag>
+          <el-tag type="info" v-if="getLevel(scope.row.sequence) > 4">{{ scope.row.label }}</el-tag>
         </template>
       </el-table-column>
       <el-table-column label="备注" align="center" prop="remark" />
@@ -82,7 +76,7 @@
     <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
         <el-form-item label="位置编号">
-          <el-input v-model="form.number" placeholder="请输入位置编号" disabled/>
+          <el-input v-model="form.number" placeholder="请输入位置编号" disabled />
         </el-form-item>
         <el-form-item label="名称" prop="name">
           <el-input v-model="form.name" placeholder="请输入名称" />
@@ -108,8 +102,8 @@
 
 <script>
 import { getLocation, delLocation, addLocation, updateLocation, tree, treeSelect, selectQrCode, downloadCode } from '@/api/asset/location'
-import Treeselect from "@riophae/vue-treeselect";
-import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+import Treeselect from '@riophae/vue-treeselect'
+import '@riophae/vue-treeselect/dist/vue-treeselect.css'
 
 export default {
   name: 'Location',
@@ -153,7 +147,7 @@ export default {
         createTime: [{ required: true, message: '创建时间不能为空', trigger: 'blur' }],
         updateTime: [{ required: true, message: '最后修改时间不能为空', trigger: 'blur' }],
       },
-      locationOption: []
+      locationOption: [],
     }
   },
   created() {
@@ -176,13 +170,13 @@ export default {
       this.getTreeSelect()
     },
     getTreeSelect() {
-      treeSelect().then(res => {
+      treeSelect().then((res) => {
         console.log('下拉树结果', res)
         this.locationOption = res.data
       })
     },
     getLevel(sequence) {
-      return sequence.split(",").length
+      return sequence.split(',').length
     },
     getCode(number) {
       return selectQrCode(number)
@@ -285,11 +279,7 @@ export default {
     },
     handleDownload() {
       // downloadCode(this.ids)
-      this.download(
-        '/asset/location/download/code/' + this.ids,
-        {},
-        `location_${new Date().getTime()}.zip`
-      )
+      this.download('/asset/location/download/code/' + this.ids, {}, `location_${new Date().getTime()}.zip`)
     },
     /** 导出按钮操作 */
     handleExport() {

+ 1 - 0
ruoyi-ui/src/views/system/dept/index.vue

@@ -57,6 +57,7 @@
       :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
     >
       <el-table-column prop="deptName" label="部门名称" width="260"></el-table-column>
+      <el-table-column prop="deptId" label="部门编号" width="260"></el-table-column>
       <el-table-column prop="orderNum" label="排序" width="200"></el-table-column>
       <el-table-column prop="status" label="状态" width="100">
         <template slot-scope="scope">