jiangbiao 1 rok temu
rodzic
commit
b25d31dbf4

+ 18 - 1
cpms-admin/src/main/java/com/cpms/project/asset/controller/TSpecdevAssetController.java

@@ -12,7 +12,10 @@ import com.cpms.common.utils.file.ExcelUtils;
 import com.cpms.common.utils.file.FileUploadUtils;
  import com.cpms.project.asset.domain.TSpecdevAsset;
 import com.cpms.project.asset.service.ITSpecdevAssetService;
-import org.apache.poi.ss.usermodel.*;
+ import com.cpms.project.file.domain.TFile;
+ import com.cpms.project.file.service.ITFileService;
+ import org.apache.commons.collections4.CollectionUtils;
+ import org.apache.poi.ss.usermodel.*;
 import org.apache.poi.ss.util.CellRangeAddress;
 import org.apache.poi.xssf.streaming.SXSSFWorkbook;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -37,6 +40,9 @@ public class TSpecdevAssetController extends BaseController {
     @Autowired
     private ITSpecdevAssetService tSpecdevAssetService;
 
+    @Autowired
+    private ITFileService tFileService;
+
     /**
      * 查询资产与运营列表
      */
@@ -45,6 +51,17 @@ public class TSpecdevAssetController extends BaseController {
     public TableDataInfo list(TSpecdevAsset tSpecdevAsset) {
         startPage();
         List<TSpecdevAsset> list = tSpecdevAssetService.selectTSpecdevAssetList(tSpecdevAsset);
+        for(TSpecdevAsset asset: list) {
+            TFile tFile = new TFile();
+            tFile.setLinkId(asset.getId());
+            tFile.setLinkName("tSpecdevAsset");
+            List<TFile> tFiles = tFileService.selectTFileList(tFile);
+            if (CollectionUtils.isNotEmpty(tFiles)){
+                asset.setCountNum(String.valueOf(tFiles.size()));
+            }else{
+                asset.setCountNum("0");
+            }
+        }
         return getDataTable(list);
     }
 

+ 10 - 0
cpms-admin/src/main/java/com/cpms/project/asset/domain/TSpecdevAsset.java

@@ -138,6 +138,16 @@ public class TSpecdevAsset extends BaseEntity
 
     private String fuzzy;
 
+    private String countNum;
+
+    public String getCountNum() {
+        return countNum;
+    }
+
+    public void setCountNum(String countNum) {
+        this.countNum = countNum;
+    }
+
     public String getFuzzy() {
         return fuzzy;
     }

+ 1 - 1
cpms-admin/src/main/java/com/cpms/project/asset/mapper/TSpecdevMainMapper.java

@@ -27,7 +27,7 @@ public interface TSpecdevMainMapper
      * @param tSpecdevMain 设备总
      * @return 设备总集合
      */
-    @DataScope(deptAlias = "d")
+//    @DataScope(deptAlias = "d")
     public List<TSpecdevMain> selectTSpecdevMainList(TSpecdevMain tSpecdevMain);
 
     /**

+ 12 - 5
cpms-admin/src/main/java/com/cpms/project/file/controller/TFileController.java

@@ -37,7 +37,7 @@ public class TFileController extends BaseController {
     /**
      * 查询附件列表
      */
-    @PreAuthorize("@ss.hasPermi('file:file:list')")
+//    @PreAuthorize("@ss.hasPermi('file:file:list')")
     @GetMapping("/list")
     public AjaxResult list(TFile tFile) {
         if (StringUtils.isEmpty(tFile.getLinkName())) {
@@ -47,11 +47,17 @@ public class TFileController extends BaseController {
         return AjaxResult.success(list);
     }
 
+    @PreAuthorize("@ss.hasPermi('file:file:query')")
+    @GetMapping("/greaterThan1GFile")
+    public AjaxResult greaterThan1GFile() {
+        return AjaxResult.success(tFileService.selectGreaterThan1GFileList());
+    }
+
 
     /**
      * 获取附件详细信息
      */
-    @PreAuthorize("@ss.hasPermi('file:file:query')")
+//    @PreAuthorize("@ss.hasPermi('file:file:query')")
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") Long id) {
         return AjaxResult.success(tFileService.selectTFileById(id));
@@ -60,7 +66,7 @@ public class TFileController extends BaseController {
     /**
      * 新增附件
      */
-    @PreAuthorize("@ss.hasPermi('file:file:add')")
+//    @PreAuthorize("@ss.hasPermi('file:file:add')")
     @Log(title = "附件", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody TFile tFile) {
@@ -70,7 +76,7 @@ public class TFileController extends BaseController {
     /**
      * 修改附件
      */
-    @PreAuthorize("@ss.hasPermi('file:file:edit')")
+//    @PreAuthorize("@ss.hasPermi('file:file:edit')")
     @Log(title = "附件", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody TFile tFile) {
@@ -80,7 +86,7 @@ public class TFileController extends BaseController {
     /**
      * 删除附件
      */
-    @PreAuthorize("@ss.hasPermi('file:file:remove')")
+//    @PreAuthorize("@ss.hasPermi('file:file:remove')")
     @Log(title = "附件", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids) {
@@ -132,6 +138,7 @@ public class TFileController extends BaseController {
             }
             tFile.setpId(pId);
             tFile.setFileSize(String.valueOf(new BigDecimal(file.getSize()).
+                    divide(BigDecimal.valueOf(1024), 2, RoundingMode.HALF_DOWN).
                     divide(BigDecimal.valueOf(1024), 2, RoundingMode.HALF_DOWN)));
             tFile.setUploader(getNickname());
             tFile.setUploadDate(new Date());

+ 1 - 0
cpms-admin/src/main/java/com/cpms/project/file/mapper/TFileMapper.java

@@ -27,6 +27,7 @@ public interface TFileMapper
      * @return 附件集合
      */
     public List<TFile> selectTFileList(TFile tFile);
+    public List<TFile> selectGreaterThan1GFileList();
 
     /**
      * 新增附件

+ 1 - 0
cpms-admin/src/main/java/com/cpms/project/file/service/ITFileService.java

@@ -27,6 +27,7 @@ public interface ITFileService
      * @return 附件集合
      */
     public List<TFile> selectTFileList(TFile tFile);
+    public List<TFile> selectGreaterThan1GFileList();
 
     /**
      * 新增附件

+ 6 - 0
cpms-admin/src/main/java/com/cpms/project/file/service/impl/TFileServiceImpl.java

@@ -44,6 +44,12 @@ public class TFileServiceImpl implements ITFileService
         return tFileMapper.selectTFileList(tFile);
     }
 
+    @Override
+    public List<TFile> selectGreaterThan1GFileList()
+    {
+        return tFileMapper.selectGreaterThan1GFileList();
+    }
+
     /**
      * 新增附件
      * 

+ 8 - 0
cpms-admin/src/main/resources/mapper/file/TFileMapper.xml

@@ -39,6 +39,14 @@
         </where>
     </select>
 
+    <select id="selectGreaterThan1GFileList" resultMap="TFileResult">
+        <include refid="selectTFileVo"/>
+        <where>
+            and file_size>=1024
+        and del_flag=0
+        </where>
+    </select>
+
     <select id="selectTFileById" parameterType="Long" resultMap="TFileResult">
         <include refid="selectTFileVo"/>
         where id = #{id}

+ 4 - 4
cpms-admin/src/main/resources/mapper/process/TLockValveMapper.xml

@@ -38,10 +38,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectTLockValveList" parameterType="TLockValve" resultMap="TLockValveResult">
         <include refid="selectTLockValveVo"/>
-        <where>  
-            <if test="unit != null  and unit != ''"> and unit = #{unit}</if>
-            <if test="vtNo != null  and vtNo != ''"> and vt_no = #{vtNo}</if>
-            <if test="pidNo != null  and pidNo != ''"> and pid_no = #{pidNo}</if>
+        <where>
+            <if test="unit != null  and unit != ''"> and unit like concat('%', #{unit}, '%')</if>
+            <if test="vtNo != null  and vtNo != ''"> and vt_no like concat('%', #{vtNo}, '%')</if>
+            <if test="pidNo != null  and pidNo != ''"> and pid_no like concat('%', #{pidNo}, '%')</if>
             <if test="locationDes != null  and locationDes != ''"> and location_des = #{locationDes}</if>
             <if test="medium != null  and medium != ''"> and medium = #{medium}</if>
             <if test="valveType != null  and valveType != ''"> and valve_type = #{valveType}</if>

+ 3 - 3
cpms-admin/src/main/resources/mapper/process/TValveCsocscMapper.xml

@@ -39,9 +39,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="selectTValveCsocscList" parameterType="TValveCsocsc" resultMap="TValveCsocscResult">
         <include refid="selectTValveCsocscVo"/>
         <where>
-            <if test="unit != null  and unit != ''"> and unit = #{unit}</if>
-            <if test="vtNo != null  and vtNo != ''"> and vt_no = #{vtNo}</if>
-            <if test="pidNo != null  and pidNo != ''"> and pid_no = #{pidNo}</if>
+            <if test="unit != null  and unit != ''"> and unit like concat('%', #{unit}, '%')</if>
+            <if test="vtNo != null  and vtNo != ''"> and vt_no like concat('%', #{vtNo}, '%')</if>
+            <if test="pidNo != null  and pidNo != ''"> and pid_no like concat('%', #{pidNo}, '%')</if>
             <if test="locationDes != null  and locationDes != ''"> and location_des = #{locationDes}</if>
             <if test="medium != null  and medium != ''"> and medium = #{medium}</if>
             <if test="valveType != null  and valveType != ''"> and valve_type = #{valveType}</if>

+ 3 - 3
cpms-admin/src/main/resources/mapper/process/TValveNoncMapper.xml

@@ -30,9 +30,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectTValveNoncList" parameterType="TValveNonc" resultMap="TValveNoncResult">
         <include refid="selectTValveNoncVo"/>
-        <where>  
-            <if test="vtNo != null  and vtNo != ''"> and vt_no = #{vtNo}</if>
-            <if test="pidNo != null  and pidNo != ''"> and pid_no = #{pidNo}</if>
+        <where>
+            <if test="vtNo != null  and vtNo != ''"> and vt_no like concat('%', #{vtNo}, '%')</if>
+            <if test="pidNo != null  and pidNo != ''"> and pid_no like concat('%', #{pidNo}, '%')</if>
             <if test="locationAt != null  and locationAt != ''"> and location_at = #{locationAt}</if>
             <if test="medium != null  and medium != ''"> and medium = #{medium}</if>
             <if test="valveType != null  and valveType != ''"> and valve_type = #{valveType}</if>

+ 1 - 0
cpms-admin/src/main/resources/mapper/sems/TSpecdevMainMapper.xml

@@ -84,6 +84,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updaterCode != null "> and updater_code = #{updaterCode}</if>
             <if test="updatedate != null "> and updatedate = #{updatedate}</if>
             <if test="deptId != null "> and dept_id = #{deptId}</if>
+            <if test="delFlag != null "> and d.del_flag = #{delFlag}</if>
             <if test="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
             <if test="fuzzy != null  and fuzzy != ''"> and (
                 dev_name like concat('%',#{fuzzy},'%') or

+ 32 - 32
cpms-common/src/main/java/com/cpms/common/utils/file/FileUploadUtils.java

@@ -166,38 +166,38 @@ public class FileUploadUtils
 
         String fileName = file.getOriginalFilename();
         String extension = getExtension(file);
-        if (allowedExtension != null && !isAllowedExtension(extension, allowedExtension))
-        {
-            if (allowedExtension == MimeTypeUtils.IMAGE_EXTENSION)
-            {
-                throw new InvalidExtensionException.InvalidImageExtensionException(allowedExtension, extension,
-                        fileName);
-            }
-            else if (allowedExtension == MimeTypeUtils.FLASH_EXTENSION)
-            {
-                throw new InvalidExtensionException.InvalidFlashExtensionException(allowedExtension, extension,
-                        fileName);
-            }
-            else if (allowedExtension == MimeTypeUtils.MEDIA_EXTENSION)
-            {
-                throw new InvalidExtensionException.InvalidMediaExtensionException(allowedExtension, extension,
-                        fileName);
-            }
-            else if (allowedExtension == MimeTypeUtils.VIDEO_EXTENSION)
-            {
-                throw new InvalidExtensionException.InvalidVideoExtensionException(allowedExtension, extension,
-                        fileName);
-            }
-            else if (allowedExtension == MimeTypeUtils.COD_EXTENSION)
-            {
-                throw new InvalidExtensionException.InvalidVideoExtensionException(allowedExtension, extension,
-                        fileName);
-            }
-            else
-            {
-                throw new InvalidExtensionException(allowedExtension, extension, fileName);
-            }
-        }
+//        if (allowedExtension != null && !isAllowedExtension(extension, allowedExtension))
+//        {
+//            if (allowedExtension == MimeTypeUtils.IMAGE_EXTENSION)
+//            {
+//                throw new InvalidExtensionException.InvalidImageExtensionException(allowedExtension, extension,
+//                        fileName);
+//            }
+//            else if (allowedExtension == MimeTypeUtils.FLASH_EXTENSION)
+//            {
+//                throw new InvalidExtensionException.InvalidFlashExtensionException(allowedExtension, extension,
+//                        fileName);
+//            }
+//            else if (allowedExtension == MimeTypeUtils.MEDIA_EXTENSION)
+//            {
+//                throw new InvalidExtensionException.InvalidMediaExtensionException(allowedExtension, extension,
+//                        fileName);
+//            }
+//            else if (allowedExtension == MimeTypeUtils.VIDEO_EXTENSION)
+//            {
+//                throw new InvalidExtensionException.InvalidVideoExtensionException(allowedExtension, extension,
+//                        fileName);
+//            }
+//            else if (allowedExtension == MimeTypeUtils.COD_EXTENSION)
+//            {
+//                throw new InvalidExtensionException.InvalidVideoExtensionException(allowedExtension, extension,
+//                        fileName);
+//            }
+//            else
+//            {
+//                throw new InvalidExtensionException(allowedExtension, extension, fileName);
+//            }
+//        }
     }
 
     /**

+ 6 - 0
cpms-ui/src/api/file/file.js

@@ -8,6 +8,12 @@ export function listFile(query) {
     params: query
   })
 }
+export function greaterThan1GFile() {
+  return request({
+    url: '/file/file/greaterThan1GFile',
+    method: 'get'
+  })
+}
 
 // 查询附件详细
 export function getFile(id) {

+ 1 - 1
cpms-ui/src/views/asset/asset/index.vue

@@ -148,7 +148,7 @@
                 size="mini"
                 type="text"
                 @click="handleSee(scope.row)"
-            >查看
+            >查看({{scope.row.countNum}})
             </el-button>
           </template>
         </el-table-column>

+ 8 - 1
cpms-ui/src/views/asset/specMain/index.vue

@@ -37,6 +37,13 @@
             @keyup.enter.native="handleQuery"
         />
       </el-form-item>
+      <el-form-item label="删除状态" prop="delFlag">
+        <el-select v-model="queryParams.delFlag"
+                   @change="handleQuery">
+          <el-option value="2" label="是"/>
+          <el-option value="0" label="否"/>
+        </el-select>
+      </el-form-item>
       <el-form-item label="全局搜索" prop="fuzzy">
         <el-input
             v-model="queryParams.fuzzy"
@@ -163,7 +170,7 @@
       <el-table-column :show-overflow-tooltip="true" align="center" label="是否删除" prop="delFlag"
                        width="100" :formatter="yseOrNoFormat"/>
       <el-table-column :show-overflow-tooltip="true" align="center" label="备注" prop="remarks"/>
-      <el-table-column align="center" class-name="small-padding fixed-width" fixed="right" label="操作" width="180">
+      <el-table-column align="center" class-name="small-padding fixed-width" fixed="right" label="操作" width="200">
         <template slot-scope="scope">
           <el-button
               v-hasPermi="['sems:main:edit']"

+ 18 - 2
cpms-ui/src/views/file/file/uploadFile.vue

@@ -36,6 +36,17 @@
         >上传文件
         </el-button>
       </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          icon="el-icon-s-order"
+          size="mini"
+          v-if="!queryParams.linkName"
+          v-hasPermi="['file:file:query']"
+          @click="getBigList"
+        >大文件列表
+        </el-button>
+      </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
@@ -95,7 +106,7 @@
           <span>{{ parseTime(scope.row.uploadDate, '{y}-{m}-{d}') }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="文件大小(Kb)" width="100" align="center" prop="fileSize"/>
+      <el-table-column label="文件大小(M)" width="100" align="center" prop="fileSize"/>
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
@@ -186,7 +197,7 @@
 </template>
 
 <script>
-import {addFile, delFile, getFile, listFile, updateFile} from "@/api/file/file";
+import {addFile, delFile, getFile, greaterThan1GFile, listFile, updateFile} from "@/api/file/file";
 import Treeselect from "@riophae/vue-treeselect";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 import {getToken} from "@/utils/auth";
@@ -265,6 +276,11 @@ export default {
     this.getList();
   },
   methods: {
+    getBigList(){
+      greaterThan1GFile().then(res=>{
+        this.fileList=res.data
+      })
+    },
     rowClick(row, column, event) {
       this.$refs.fileTable.toggleRowExpansion(row);
     },

+ 7 - 5
cpms-ui/src/views/index.vue

@@ -29,19 +29,21 @@
                     <url-icon name="汇率表"
                               url="https://app.powerbi.com/groups/me/apps/0be7009d-055c-4635-aa69-b1ca896acfce/reports/b50af5bc-57d5-4866-8537-d00bbd17e7b0/ReportSection9c27620626ccd4de907b?ctid=ecaa386b-c8df-4ce0-ad01-740cbdb5ba55&experience=power-bi&bookmarkGuid=Bookmark76f8e220a58b00d14bd9"/>
                     <url-icon name="ProCID Dashboard"
-                              url="https://app.powerbi.com/groups/me/reports/f19abff6-3d90-4b73-9c73-8d1ed158d4f7/ReportSectionccb625529076aa55aea7?experience=power-bi"/>
+                              url="https://app.powerbi.com/groups/me/reports/77658cd9-0ee2-415f-b3ab-455da86a6a42/ReportSection?ctid=ecaa386b-c8df-4ce0-ad01-740cbdb5ba55&openReportSource=ReportInvitation&experience=power-bi"/>
                   </el-carousel-item>
                   <el-carousel-item>
                     <url-icon name="AE 数据"
-                              url="https://app.powerbi.com/groups/me/reports/c56f4011-c30c-407b-8850-6a8869657ed8/ReportSection5c7cc43b5b5e4f381f65?experience=power-bi"/>
+                              url="https://app.powerbi.com/groups/me/reports/f19abff6-3d90-4b73-9c73-8d1ed158d4f7/ReportSectionccb625529076aa55aea7?experience=power-bi"/>
+
                   </el-carousel-item>
                   <el-carousel-item>
                     <url-icon name="Asset Management Dashboard GC - Power BI"
-                              url="https://oa.basf.com/wui/index.html#/main/portal/portal-1-1?menuIds=0,1&menuPathIds=0,1&_key=t13jkl"/>
+                              url="https://app.powerbi.com/groups/me/reports/c56f4011-c30c-407b-8850-6a8869657ed8/ReportSection5c7cc43b5b5e4f381f65?experience=power-bi"/>
+
                     <url-icon name="资产新增 报废 转移平台"
-                              url="https://app.powerbi.com/groups/me/reports/99ffb08d-2ece-4610-9896-44d0f80e7038/ReportSection60758fabfc1198291987?ctid=ecaa386b-c8df-4ce0-ad01-740cbdb5ba55&experience=power-bi"/>
+                              url="https://oa.basf.com/wui/index.html#/main/portal/portal-1-1?menuIds=0,1&menuPathIds=0,1&_key=t13jkl"/>
                     <url-icon name="Manufacturing Dashboard by CDT - Power BI"
-                              url="https://basf.sharepoint.com/sites/materials-engineering-ndt-asia/Shared%20Documents/Forms/AllItems.aspx?id=%2Fsites%2Fmaterials%2Dengineering%2Dndt%2Dasia%2FShared%20Documents%2Fsite%20support%2FBACH%2FTHF&p=true&originalPath=aHR0cHM6Ly9iYXNmLnNoYXJlcG9pbnQuY29tLzpmOi9zL21hdGVyaWFscy1lbmdpbmVlcmluZy1uZHQtYXNpYS9FaEwyQlljYWluSk5udjdWMmdpR0tja0JuUTJJSGh6VkFpZUZhTDRCdTFZQ2FRP3J0aW1lPXdvaERRSzZkMkVn"/>
+                              url="https://app.powerbi.com/groups/me/reports/99ffb08d-2ece-4610-9896-44d0f80e7038/ReportSection60758fabfc1198291987?ctid=ecaa386b-c8df-4ce0-ad01-740cbdb5ba55&experience=power-bi"/>
                     <url-icon name="历年GEA 设备评估汇总"
                               url="https://basf.sharepoint.com/sites/materials-engineering-ndt-asia/Shared%20Documents/Forms/AllItems.aspx?id=%2Fsites%2Fmaterials%2Dengineering%2Dndt%2Dasia%2FShared%20Documents%2Fsite%20support%2FBACH%2FTHF&p=true&originalPath=aHR0cHM6Ly9iYXNmLnNoYXJlcG9pbnQuY29tLzpmOi9zL21hdGVyaWFscy1lbmdpbmVlcmluZy1uZHQtYXNpYS9FaEwyQlljYWluSk5udjdWMmdpR0tja0JuUTJJSGh6VkFpZUZhTDRCdTFZQ2FRP3J0aW1lPXdvaERRSzZkMkVn"/>
                     <url-icon name="Manufacturing Dashboard"