瀏覽代碼

文件上传添加文件大小展示项,调用收藏类文件上传时,取消文件大小限制

徐滕 1 月之前
父節點
當前提交
75f84cd6ac
共有 35 個文件被更改,包括 1582 次插入662 次删除
  1. 5 0
      src/main/java/com/jeeplus/modules/knowledgeSharing/service/KnowledgeSharingDetailsService.java
  2. 5 0
      src/main/java/com/jeeplus/modules/oa/service/OaNotifyService.java
  3. 18 0
      src/main/java/com/jeeplus/modules/projectAccessory/entity/CollectAccessoryInfo.java
  4. 80 2
      src/main/java/com/jeeplus/modules/projectAccessory/service/CollectAccessoryService.java
  5. 38 0
      src/main/java/com/jeeplus/modules/projectAccessory/utils/ProjectAccessoryUtil.java
  6. 4 3
      src/main/java/com/jeeplus/modules/projectAccessory/web/CollectAccessoryController.java
  7. 25 2
      src/main/java/com/jeeplus/modules/projectAccessory/web/ProjectAccessoryController.java
  8. 10 1
      src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectMessageNewService.java
  9. 10 1
      src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectMessageService.java
  10. 1 1
      src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectRecordsService.java
  11. 1 1
      src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralCostProjectRecordsController.java
  12. 8 0
      src/main/java/com/jeeplus/modules/sys/entity/Workattachment.java
  13. 20 3
      src/main/java/com/jeeplus/modules/sys/service/WorkattachmentService.java
  14. 9 0
      src/main/java/com/jeeplus/modules/workclientinfo/entity/WorkClientAttachment.java
  15. 1 1
      src/main/java/com/jeeplus/modules/workclientinfo/service/WorkClientInfoAllService.java
  16. 14 5
      src/main/resources/mappings/modules/collectAccessory/CollectAccessoryDao.xml
  17. 2 0
      src/main/resources/mappings/modules/projectAccessory/ProjectAccessoryDao.xml
  18. 8 2
      src/main/webapp/WEB-INF/tags/table/attachmentManager.tag
  19. 10 5
      src/main/webapp/WEB-INF/tags/table/fileUpload.tag
  20. 1087 217
      src/main/webapp/static/oss/ossupload.js
  21. 3 3
      src/main/webapp/webpage/include/head.jsp
  22. 1 1
      src/main/webapp/webpage/include/ossTools.jsp
  23. 2 0
      src/main/webapp/webpage/modules/collectAccessory/collectAccessoryCompanyList.jsp
  24. 4 0
      src/main/webapp/webpage/modules/collectAccessory/collectAccessoryList.jsp
  25. 2 0
      src/main/webapp/webpage/modules/collectAccessory/collectAccessoryOfficeList.jsp
  26. 2 1
      src/main/webapp/webpage/modules/projectAccessory/collectAccessoryForm.jsp
  27. 2 0
      src/main/webapp/webpage/modules/projectAccessory/collectAccessoryModify.jsp
  28. 1 1
      src/main/webapp/webpage/modules/projectAccessory/workAttachmentOverAllForm.jsp
  29. 1 1
      src/main/webapp/webpage/modules/projectcontentinfo/achievementFileDataForm.jsp
  30. 1 1
      src/main/webapp/webpage/modules/projectcontentinfo/basedDataForm.jsp
  31. 145 12
      src/main/webapp/webpage/modules/ruralprojectrecords/electronicSeal/ruralProjectRecordsReportInternalAuditSignatureView.jsp
  32. 8 3
      src/main/webapp/webpage/modules/sys/collectNewSelect.jsp
  33. 17 105
      src/main/webapp/webpage/modules/workclientinfo/all/workClientInfoForm.jsp
  34. 18 146
      src/main/webapp/webpage/modules/workreimbursement/all/workReimbursementAllFormAdd.jsp
  35. 19 144
      src/main/webapp/webpage/modules/workreimbursement/all/workReimbursementAllModifyApply.jsp

+ 5 - 0
src/main/java/com/jeeplus/modules/knowledgeSharing/service/KnowledgeSharingDetailsService.java

@@ -11,6 +11,7 @@ import com.jeeplus.common.utils.StringUtils;
 import com.jeeplus.modules.knowledgeSharing.dao.KnowledgeSharingDetailsDao;
 import com.jeeplus.modules.knowledgeSharing.dify.DifyApiClient;
 import com.jeeplus.modules.knowledgeSharing.entity.*;
+import com.jeeplus.modules.projectAccessory.utils.ProjectAccessoryUtil;
 import com.jeeplus.modules.sys.entity.Workattachment;
 import com.jeeplus.modules.sys.service.WorkattachmentService;
 import com.jeeplus.modules.sys.utils.UserUtils;
@@ -72,6 +73,10 @@ public class KnowledgeSharingDetailsService extends CrudService<KnowledgeSharing
         attchment.setAttachmentFlag("79");
         List<Workattachment> attachmentTwos = workattachmentService.findList(attchment);
         attachments.addAll(attachmentTwos);
+        for (Workattachment attachment : attachments) {
+            String bytesToMB = ProjectAccessoryUtil.bytesToMB(attachment.getFileSize());
+            attachment.setFileSize(bytesToMB);
+        }
         String columnId = knowledgeSharingInfo.getColumnId();
         String datasetId = getTypeIdByColumnId(columnId);
         knowledgeSharingInfo.setWorkAttachments(attachments);

+ 5 - 0
src/main/java/com/jeeplus/modules/oa/service/OaNotifyService.java

@@ -20,6 +20,7 @@ import com.jeeplus.modules.oa.entity.OaNotify;
 import com.jeeplus.modules.oa.entity.OaNotifyComment;
 import com.jeeplus.modules.oa.entity.OaNotifyRecord;
 import com.jeeplus.modules.oa.entity.OaNotifyView;
+import com.jeeplus.modules.projectAccessory.utils.ProjectAccessoryUtil;
 import com.jeeplus.modules.projectrecord.enums.ProjectStatusEnum;
 import com.jeeplus.modules.pushinfo.entity.Pushinfo;
 import com.jeeplus.modules.pushinfo.service.PushinfoService;
@@ -107,6 +108,10 @@ public class OaNotifyService extends CrudService<OaNotifyDao, OaNotify> {
         OaNotify oaNotify = dao.get(id);
         if(null != oaNotify){
             List<Workattachment> attachmentList = workattachmentService.getListByAttachmentIdAndFlag(id, "79");
+            for (Workattachment attachment : attachmentList) {
+                String bytesToMB = ProjectAccessoryUtil.bytesToMB(attachment.getFileSize());
+                attachment.setFileSize(bytesToMB);
+            }
             oaNotify.setWorkAttachments(attachmentList);
             //添加当前文件服务器类型
             oaNotify.setUploadMode(uploadMode);

+ 18 - 0
src/main/java/com/jeeplus/modules/projectAccessory/entity/CollectAccessoryInfo.java

@@ -12,6 +12,7 @@ public class CollectAccessoryInfo extends DataEntity<CollectAccessoryInfo> {
     private String url;     //附件路径
     private String fileName;     //附件名称
     private String fileSize;     //附件大小
+    private String fileSizeStr;     //附件大小
     private String userId;  //收藏人
     private String type;    //收藏类型
     private String officeId;    //部门id
@@ -27,6 +28,7 @@ public class CollectAccessoryInfo extends DataEntity<CollectAccessoryInfo> {
     private Integer individualFlag;    //个人判定
     private String classification;    //收藏分类
     private String fileDescription;    //文件描述
+    private String fileSource;    //数据来源(0:其他;1:个人上传;2:部门共享;3:公司共享)
 
 
     public String getUrl() {
@@ -172,4 +174,20 @@ public class CollectAccessoryInfo extends DataEntity<CollectAccessoryInfo> {
     public void setFileDescription(String fileDescription) {
         this.fileDescription = fileDescription;
     }
+
+    public String getFileSource() {
+        return fileSource;
+    }
+
+    public void setFileSource(String fileSource) {
+        this.fileSource = fileSource;
+    }
+
+    public String getFileSizeStr() {
+        return fileSizeStr;
+    }
+
+    public void setFileSizeStr(String fileSizeStr) {
+        this.fileSizeStr = fileSizeStr;
+    }
 }

+ 80 - 2
src/main/java/com/jeeplus/modules/projectAccessory/service/CollectAccessoryService.java

@@ -3,8 +3,10 @@ package com.jeeplus.modules.projectAccessory.service;
 import com.google.common.collect.Lists;
 import com.jeeplus.common.persistence.Page;
 import com.jeeplus.common.service.CrudService;
+import com.jeeplus.common.utils.StringUtils;
 import com.jeeplus.modules.projectAccessory.dao.CollectAccessoryDao;
 import com.jeeplus.modules.projectAccessory.entity.CollectAccessoryInfo;
+import com.jeeplus.modules.projectAccessory.utils.ProjectAccessoryUtil;
 import com.jeeplus.modules.sys.entity.User;
 import com.jeeplus.modules.sys.entity.Workattachment;
 import com.jeeplus.modules.sys.service.WorkattachmentService;
@@ -16,6 +18,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.text.DecimalFormat;
 import java.util.*;
 
 /**
@@ -66,7 +69,13 @@ public class CollectAccessoryService extends CrudService<CollectAccessoryDao, Co
         collectAccessoryInfo.setPage(page);
         List<CollectAccessoryInfo> list = super.findList(collectAccessoryInfo);
         collectAccessoryInfo.setType("1");
-        List<CollectAccessoryInfo> individualList = dao.getTypeList(collectAccessoryInfo);
+        List<CollectAccessoryInfo> individualList = Lists.newArrayList();
+        if("2".equals(type) || "3".equals(type)){
+            collectAccessoryInfo.setPage(null);
+            individualList = dao.getTypeList(collectAccessoryInfo);
+        }else{
+            individualList = dao.getTypeList(collectAccessoryInfo);
+        }
         collectAccessoryInfo.setType("2");
         collectAccessoryInfo.setPage(null);
         List<CollectAccessoryInfo> officeList = dao.getTypeList(collectAccessoryInfo);
@@ -100,7 +109,44 @@ public class CollectAccessoryService extends CrudService<CollectAccessoryDao, Co
                 }
             }
         }
+        //计算文件打小
+        for (CollectAccessoryInfo info : list) {
+            if(null == info.getCollectType()){
+                String fileSize = info.getFileSize();
+                // 调用工具类转换字节到MB
+                String fileSizeMB = ProjectAccessoryUtil.bytesToMB(fileSize);
+                info.setFileSize(fileSizeMB);
+            }else if(1 == info.getCollectType()){
+                String fileSize = info.getFileSize();
+                info.setFileSize(fileSize);
+            }
+        }
         workattachmentService.attachmentManageByUrlOnCollect(list);
+        for (CollectAccessoryInfo info : list) {
+            if(StringUtils.isNotBlank(info.getFileSource())){
+                switch (info.getFileSource()) {
+                    case "6":
+                        info.setFileSource("报销管理");
+                        break;
+                    case "5":
+                        info.setFileSource("客户管理");
+                        break;
+                    case "79":
+                        info.setFileSource("公告管理");
+                        break;
+                    case "44":
+                    case "45":
+                        info.setFileSource("合同管理");
+                        break;
+                    case "100":
+                        info.setFileSource("项目管理");
+                        break;
+                    case "183":
+                        info.setFileSource("知识分享");
+                        break;
+                }
+            }
+        }
         page.setList(list);
         return page;
     }
@@ -123,6 +169,21 @@ public class CollectAccessoryService extends CrudService<CollectAccessoryDao, Co
         collectAccessoryInfo.setCompanyId(UserUtils.getUser().getCompany().getId());
         //添加上传人信息
         collectAccessoryInfo.setCollectUser(UserUtils.getUser());
+        //根据分享上传类型设置数据来源
+        switch (collectAccessoryInfo.getType()){
+            case "1":
+                //个人收藏
+                collectAccessoryInfo.setFileSource("1");
+                break;
+            case "2":
+                //部门共享
+                collectAccessoryInfo.setFileSource("2");
+                break;
+            case "3":
+                //公司共享
+                collectAccessoryInfo.setFileSource("3");
+                break;
+        }
         int saveResult = dao.saveCollectAccessory(collectAccessoryInfo);
         //判断收藏类型(1:个人收藏;2:部门收藏;3:公司收藏)
         //部门收藏和公司收藏要给对应类型的所有人发送通知
@@ -183,10 +244,27 @@ public class CollectAccessoryService extends CrudService<CollectAccessoryDao, Co
      * @param collectAccessoryInfo
      */
     @Transactional(readOnly = false)
-    public Integer shareSave(CollectAccessoryInfo collectAccessoryInfo){
+    public Integer shareSave(CollectAccessoryInfo collectAccessoryInfo, String fileSource){
         User loginUser = UserUtils.getUser();
         //保存信息
         collectAccessoryInfo.preInsert();
+        //根据分享上传类型设置数据来源
+        switch (fileSource){
+            case "1":
+                //个人收藏
+                collectAccessoryInfo.setFileSource("1");
+                break;
+            case "2":
+                //部门共享
+                collectAccessoryInfo.setFileSource("2");
+                break;
+            case "3":
+                //公司共享
+                collectAccessoryInfo.setFileSource("3");
+                break;
+            default:
+                break;
+        }
         int saveResult = dao.saveCollectAccessory(collectAccessoryInfo);
         //判断收藏类型(1:个人收藏;2:部门收藏;3:公司收藏)
         //部门收藏和公司收藏要给对应类型的所有人发送通知

+ 38 - 0
src/main/java/com/jeeplus/modules/projectAccessory/utils/ProjectAccessoryUtil.java

@@ -0,0 +1,38 @@
+package com.jeeplus.modules.projectAccessory.utils;
+
+import java.text.DecimalFormat;
+
+public class ProjectAccessoryUtil {
+
+    // 1MB = 1024*1024 字节
+    private static final long BYTES_PER_MB = 1024L * 1024L;
+    // 保留两位小数的格式化器
+    private static final DecimalFormat DF = new DecimalFormat("0.00");
+
+    /**
+     * 将字节数(字符串)转换为MB
+     * @param byteStr 字节数字符串(如"1048576")
+     * @return 转换后的MB字符串(如"1.00 MB"),转换失败返回null
+     */
+    public static String bytesToMB(String byteStr) {
+        if (byteStr == null || byteStr.trim().isEmpty()) {
+            return null;
+        }
+
+        try {
+            // 将字符串转换为长整数(支持大文件)
+            long bytes = Long.parseLong(byteStr.trim());
+            // 处理0字节的特殊情况
+            if (bytes <= 0) {
+                return "0.00";
+            }
+            // 计算MB并格式化
+            double mb = (double) bytes / BYTES_PER_MB;
+            return DF.format(mb);
+        } catch (NumberFormatException e) {
+            // 处理非数字格式的异常
+            System.err.println("无效的字节数格式:" + byteStr);
+            return null;
+        }
+    }
+}

+ 4 - 3
src/main/java/com/jeeplus/modules/projectAccessory/web/CollectAccessoryController.java

@@ -180,7 +180,7 @@ public class CollectAccessoryController extends BaseController {
         return map;
     }
     /**
-     * 收藏附件信息
+     * 收藏附件信息(个人)
      */
     @RequestMapping(value = "saveGeCollectAccessory")
     @ResponseBody
@@ -250,7 +250,7 @@ public class CollectAccessoryController extends BaseController {
     public String shareAccessory(CollectAccessoryInfo collectAccessoryInfo) {
         CollectAccessoryInfo shareInfo = collectAccessoryService.get(collectAccessoryInfo.getId());
         shareInfo.setType(collectAccessoryInfo.getType());
-        collectAccessoryService.shareSave(shareInfo);
+        collectAccessoryService.shareSave(shareInfo,"");
         return "redirect:"+Global.getAdminPath()+"/collectAccessory/collectAccessory/?repage";
     }
 
@@ -263,9 +263,10 @@ public class CollectAccessoryController extends BaseController {
     public Object saveCollect(CollectAccessoryInfo collectAccessoryInfo, Model model) {
         Map<String,Object> map = new HashMap<>();
         CollectAccessoryInfo info = collectAccessoryService.get(collectAccessoryInfo.getId());
+        String fileSource = info.getType();
         info.setType("1");
         //收藏附件信息
-        Integer result = collectAccessoryService.shareSave(info);
+        Integer result = collectAccessoryService.shareSave(info,fileSource);
         if(result == 1){
             map.put("str","收藏附件信息成功!");
             map.put("success",true);

+ 25 - 2
src/main/java/com/jeeplus/modules/projectAccessory/web/ProjectAccessoryController.java

@@ -20,6 +20,7 @@ import com.jeeplus.modules.projectAccessory.entity.ProjectTemplateInfo;
 import com.jeeplus.modules.projectAccessory.service.CollectAccessoryService;
 import com.jeeplus.modules.projectAccessory.service.ProjectAccessoryService;
 import com.jeeplus.modules.projectAccessory.service.ProjectTemplateService;
+import com.jeeplus.modules.projectAccessory.utils.ProjectAccessoryUtil;
 import com.jeeplus.modules.projectEngineering.service.ProjectEngineeringService;
 import com.jeeplus.modules.projectcontentinfo.service.ProjectBasedDataService;
 import com.jeeplus.modules.projectmaterialstorage.service.ProjectMaterialStorageService;
@@ -406,6 +407,16 @@ public class ProjectAccessoryController extends BaseController {
 	@RequestMapping(value = "collectAccessoryModify")
 	public String collectAccessoryModify(CollectAccessoryInfo collectAccessoryInfo,Model model){
 		collectAccessoryInfo = collectAccessoryService.getInfo(collectAccessoryInfo.getId());
+		//计算文件打小
+		if(null == collectAccessoryInfo.getCollectType()){
+			String fileSize = collectAccessoryInfo.getFileSize();
+			// 调用工具类转换字节到MB
+			String fileSizeMB = ProjectAccessoryUtil.bytesToMB(fileSize);
+			collectAccessoryInfo.setFileSize(fileSizeMB);
+		}else if(1 == collectAccessoryInfo.getCollectType()){
+			String fileSize = collectAccessoryInfo.getFileSize();
+			collectAccessoryInfo.setFileSize(fileSize);
+		}
 		model.addAttribute("collectAccessoryInfo", collectAccessoryInfo);
 		return "modules/projectAccessory/collectAccessoryModify";
 	}
@@ -548,6 +559,7 @@ public class ProjectAccessoryController extends BaseController {
 			collectAccessoryInfo.setFileName(workattachment.getAttachmentName());
 			//添加文件描述信息
 			collectAccessoryInfo.setFileDescription(workattachment.getDescription());
+			collectAccessoryInfo.setFileSource(workattachment.getAttachmentFlag());
 		}
 		//收藏附件信息
 		Integer result = projectAccessoryService.saveCollectAccessory(collectAccessoryInfo);
@@ -635,8 +647,19 @@ public class ProjectAccessoryController extends BaseController {
 			Page<CollectAccessoryInfo> page = projectAccessoryService.getCollectList(
 					new Page<CollectAccessoryInfo>(request, response), collectAccessoryInfo);
 
-
-			// 7. 传递转义后的参数到页面(确保hidden字段渲染正确)
+			List<CollectAccessoryInfo> list = page.getList();
+			for (CollectAccessoryInfo info : list) {
+				if(null == info.getCollectType()){
+					String fileSize = info.getFileSize();
+					// 调用工具类转换字节到MB
+					String fileSizeMB = ProjectAccessoryUtil.bytesToMB(fileSize);
+					info.setFileSizeStr(fileSizeMB);
+				}else if(1 == info.getCollectType()){
+					String fileSize = info.getFileSize();
+					info.setFileSizeStr(fileSize);
+				}
+			}
+		// 7. 传递转义后的参数到页面(确保hidden字段渲染正确)
 			model.addAttribute("url", url);
 			model.addAttribute("fieldLabels", safeFieldLabels); // 转义后的值
 			model.addAttribute("fieldKeys", safeFieldKeys);

+ 10 - 1
src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectMessageNewService.java

@@ -3108,7 +3108,7 @@ public class RuralProjectMessageNewService extends CrudService<RuralProjectMessa
                 certificateTypeList.add(info.getName());
             }
             String join = String.join(",", certificateTypeList);
-            if(join.contains("161,171")){
+            if(join.contains("161") && join.contains(",")){
                 //排除 重新申请|撤销
                 Iterator<WorkStaffCertificate> it = list.iterator();
                 while(it.hasNext()){
@@ -3117,6 +3117,15 @@ public class RuralProjectMessageNewService extends CrudService<RuralProjectMessa
                         it.remove();
                     }
                 }
+            }else if(join.contains("171") && join.contains(",")){
+                //排除 重新申请|撤销
+                Iterator<WorkStaffCertificate> it = list.iterator();
+                while(it.hasNext()){
+                    WorkStaffCertificate w = it.next();
+                    if(!"171".equals(w.getName())){
+                        it.remove();
+                    }
+                }
             }
         }
         return list;

+ 10 - 1
src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectMessageService.java

@@ -3823,7 +3823,7 @@ public class RuralProjectMessageService extends CrudService<RuralProjectMessageD
                 certificateTypeList.add(info.getName());
             }
             String join = String.join(",", certificateTypeList);
-            if(join.contains("161,171")){
+            if(join.contains("161") && join.contains(",")){
                 //排除 重新申请|撤销
                 Iterator<WorkStaffCertificate> it = list.iterator();
                 while(it.hasNext()){
@@ -3832,6 +3832,15 @@ public class RuralProjectMessageService extends CrudService<RuralProjectMessageD
                         it.remove();
                     }
                 }
+            }else if(join.contains("171") && join.contains(",")){
+                //排除 重新申请|撤销
+                Iterator<WorkStaffCertificate> it = list.iterator();
+                while(it.hasNext()){
+                    WorkStaffCertificate w = it.next();
+                    if(!"171".equals(w.getName())){
+                        it.remove();
+                    }
+                }
             }
         }
         return list;

+ 1 - 1
src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectRecordsService.java

@@ -3199,7 +3199,7 @@ public class RuralProjectRecordsService extends CrudService<RuralProjectRecordsD
 		otherAttchmentInfo.setAttachmentIdList(otherAttachmentIdList);
 		List<WorkClientAttachment> otherAttachmentList = workattachmentService.getInfoList(otherAttchmentInfo);
 		//数据处理(如果为阿里云文件服务器,则对查看的路径进行处理)
-		workattachmentService.clientAttachmentManageOnUrl(otherAttachmentList);
+		//workattachmentService.clientAttachmentManageOnUrl(otherAttachmentList);
 		//对查询出来的文件数据进行分组
 		Map<String, List<WorkClientAttachment>> otherStringListMap = dataMessageAttachmentDispose(otherAttachmentList);
 		List<String> projectTemplateIdList = Lists.newArrayList();

+ 1 - 1
src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralCostProjectRecordsController.java

@@ -1221,7 +1221,7 @@ public class RuralCostProjectRecordsController extends BaseController {
 		if (projectRecords!=null&&StringUtils.isNotBlank(projectRecords.getId())) {
 			projectRecords = projectRecordsService.getQueryProjectUsers(projectRecords.getId());
 			RuralProjectcontentinfo ruralProjectcontentinfo = projectRecordsService.formAccessory(projectRecords);
-			projectRecordsService.disposeData(ruralProjectcontentinfo);
+			//projectRecordsService.disposeData(ruralProjectcontentinfo);
 			model.addAttribute("projectcontentinfo", ruralProjectcontentinfo);
 		 	model.addAttribute("projectRecords", projectRecords);
 		}else {

+ 8 - 0
src/main/java/com/jeeplus/modules/sys/entity/Workattachment.java

@@ -34,6 +34,7 @@ public class Workattachment extends DataEntity<Workattachment> {
 	private String projectId;	//项目id
 	private String sort;	//排序
 	private String description;	//文件描述
+	private String collectType;	//判定类型
 
 	//0:未成功,1:成功
 	private String syncDifySync;	//同步至dify的状态
@@ -195,4 +196,11 @@ public class Workattachment extends DataEntity<Workattachment> {
 		this.description = description;
 	}
 
+	public String getCollectType() {
+		return collectType;
+	}
+
+	public void setCollectType(String collectType) {
+		this.collectType = collectType;
+	}
 }

+ 20 - 3
src/main/java/com/jeeplus/modules/sys/service/WorkattachmentService.java

@@ -13,6 +13,7 @@ import com.jeeplus.modules.externalUnit.entity.ExternalUnitWorkClientAttachment;
 import com.jeeplus.modules.isignature.service.ISignatureDocumentService;
 import com.jeeplus.modules.projectAccessory.dao.ProjectAccessoryDao;
 import com.jeeplus.modules.projectAccessory.entity.CollectAccessoryInfo;
+import com.jeeplus.modules.projectAccessory.utils.ProjectAccessoryUtil;
 import com.jeeplus.modules.sys.dao.WorkattachmentDao;
 import com.jeeplus.modules.sys.entity.User;
 import com.jeeplus.modules.sys.entity.Workattachment;
@@ -571,6 +572,12 @@ public class WorkattachmentService extends CrudService<WorkattachmentDao, Workat
 	 */
 	public List<WorkClientAttachment> getAttachmentList(WorkClientAttachment workClientAttachment){
 		List<WorkClientAttachment> list = workClientAttachmentDao.findList(workClientAttachment);
+		if("79".equals(workClientAttachment.getAttachmentFlag()) || "183".equals(workClientAttachment.getAttachmentFlag())){
+			for (WorkClientAttachment attachment : list) {
+				String bytesToMB = ProjectAccessoryUtil.bytesToMB(attachment.getFileSize());
+				attachment.setFileSize(bytesToMB);
+			}
+		}
 		CollectAccessoryInfo cAInfo = new CollectAccessoryInfo();
 		User loginUser = UserUtils.getUser();
 		if(StringUtils.isNotBlank(loginUser.getId())){
@@ -797,6 +804,11 @@ public class WorkattachmentService extends CrudService<WorkattachmentDao, Workat
 			CollectAccessoryInfo collectAccessoryInfo = projectAccessoryDao.getCollectAccessoryInfo1(cAInfo);
 			if(null != collectAccessoryInfo){
 				info.setCollectFlag("1");
+				if(null == collectAccessoryInfo.getCollectType()){
+					Double fileSize = Double.valueOf(info.getFileSize())/1024/1024;
+					info.setFileSize(String.format("%.2f", fileSize));
+					info.setFileSizeFlag("1");
+				}
 			}else{
 				info.setCollectFlag("0");
 			}
@@ -988,9 +1000,14 @@ public class WorkattachmentService extends CrudService<WorkattachmentDao, Workat
 						if(StringUtils.isNotBlank(info.getFileSizeFlag()) && "1".equals(info.getFileSizeFlag())){
 
 						}else{
-							Double fileSize = Double.valueOf(info.getFileSize())/1024/1024;
-							info.setFileSize(String.format("%.2f", fileSize));
-							info.setFileSizeFlag("1");
+							if(StringUtils.isNotBlank(info.getFileSize())){
+								Double fileSize = Double.valueOf(info.getFileSize());
+								if(fileSize > 2000){
+									fileSize = Double.valueOf(info.getFileSize())/1024/1024;
+									info.setFileSize(String.format("%.2f", fileSize));
+									info.setFileSizeFlag("1");
+								}
+							}
 						}
 					}
 					if(info.getUrl().contains("/xg-qz")){

+ 9 - 0
src/main/java/com/jeeplus/modules/workclientinfo/entity/WorkClientAttachment.java

@@ -38,6 +38,7 @@ public class WorkClientAttachment extends DataEntity<WorkClientAttachment> {
 	private String description;	//说明
 	private String divIdType;//判定条件
 	private String syncDifySync;		// 是否被标记
+	private String collectType;		// 判定参数
 
 	private Date beginDate;
 	private Date endDate;
@@ -222,4 +223,12 @@ public class WorkClientAttachment extends DataEntity<WorkClientAttachment> {
 	public void setSyncDifySync(String syncDifySync) {
 		this.syncDifySync = syncDifySync;
 	}
+
+	public String getCollectType() {
+		return collectType;
+	}
+
+	public void setCollectType(String collectType) {
+		this.collectType = collectType;
+	}
 }

+ 1 - 1
src/main/java/com/jeeplus/modules/workclientinfo/service/WorkClientInfoAllService.java

@@ -449,7 +449,7 @@ public class WorkClientInfoAllService extends CrudService<WorkClientInfoDao, Wor
             }
             if (WorkClientAttachment.DEL_FLAG_NORMAL.equals(workClientAttachment.getDelFlag())){
                 workClientAttachment.setAttachmentId(workClientInfo.getId());
-                workClientAttachment.setAttachmentFlag("44");
+                workClientAttachment.setAttachmentFlag("5");
                 workClientAttachment.setAttachmentUser(UserUtils.getUser().getId());
                 if (StringUtils.isBlank(workClientAttachment.getId()) || "null".equals(workClientAttachment.getId())){
                     workattachmentService.insertOnWorkClientAttachment(workClientAttachment);

+ 14 - 5
src/main/resources/mappings/modules/collectAccessory/CollectAccessoryDao.xml

@@ -20,6 +20,13 @@
 		a.file_size AS "fileSize",
  		ifnull(a.classification,'未分类') as "classification",
 		a.fileDescription AS "fileDescription",
+		CASE a.file_source
+        WHEN 0 THEN '其他'
+        WHEN 1 THEN '个人上传'
+        WHEN 2 THEN '部门共享'
+        WHEN 3 THEN '公司共享'
+        ELSE a.file_source  -- 处理未定义的数值
+		END AS "fileSource",
 		su.name as "collectUser.name",
 		suc.name as "createBy.name"
 	</sql>
@@ -86,7 +93,7 @@
 				ORDER BY ${page.orderBy}
 			</when>
 			<otherwise>
-				ORDER BY a.create_date asc,a.file_name asc
+				ORDER BY a.create_date desc,a.file_name asc
 			</otherwise>
 		</choose>
 	</select>
@@ -153,7 +160,8 @@
 		  collect_user_id,
 		  file_size,
 		  classification,
-		  fileDescription
+		  fileDescription,
+		  file_source
 		)
 		values
 		  (
@@ -173,7 +181,8 @@
 			#{collectUser.id},
 			#{fileSize},
 			#{classification},
-			#{fileDescription}
+			#{fileDescription},
+			#{fileSource}
 		  )
 	</insert>
 
@@ -202,7 +211,7 @@
 				</if>
 			</if>
 		</where>
-		ORDER BY a.create_date asc,a.file_name asc
+		ORDER BY a.create_date desc,a.file_name asc
 	</select>
 
 	<select id="companyList" resultType="com.jeeplus.modules.projectAccessory.entity.CollectAccessoryInfo" >
@@ -213,7 +222,7 @@
 		<where>
 			a.type = #{type} and a.del_flag = 0
 		</where>
-		ORDER BY a.create_date asc,a.file_name asc
+		ORDER BY a.create_date desc,a.file_name asc
 	</select>
 	<select id="classificationList" resultType="java.lang.String" >
 		SELECT DISTINCT(ifnull(classification,'未分类')) as "classification" FROM `work_collect_accessory`

+ 2 - 0
src/main/resources/mappings/modules/projectAccessory/ProjectAccessoryDao.xml

@@ -227,6 +227,7 @@
 		  collect_user_id,
 		  file_size
 		  ,fileDescription
+		  ,file_source
 		)
 		values
 		  (
@@ -246,6 +247,7 @@
 			#{collectUserId},
 			#{fileSize}
 			,#{fileDescription}
+			,#{fileSource}
 		  )
 	</insert>
 

+ 8 - 2
src/main/webapp/WEB-INF/tags/table/attachmentManager.tag

@@ -135,6 +135,7 @@
                 <th>文件预览</th>
                 <th>上传人</th>
                 <th>上传时间</th>
+                <th>文件大小(MB)</th>
                 <th width="200px">操作</th>
             </tr>
             </thead>
@@ -239,6 +240,9 @@
                         <%-- 上传时间 --%>
                     <td><fmt:formatDate value="${attach.createDate}" type="both"/></td>
 
+                        <%-- 文件大小 --%>
+                    <td>${attach.fileSize}</td>
+
                         <%-- 操作按钮(下载/收藏/删除) --%>
                     <td class="op-td">
                         <div class="op-btn-box">
@@ -353,7 +357,7 @@
 
             // 显示上传进度条并执行上传
             $("#addFile" + divId).show();
-            multipartUploadWithSts(storeAs, file, attachmentId, attachmentFlag, uploadPath, divId, size);
+            multipartUploadWithStsOnFileSize(storeAs, file, attachmentId, attachmentFlag, uploadPath, divId, size);
         }
     }
 
@@ -400,13 +404,15 @@
         for(var i = 0;i<files.length;i++) {
             var file = files[i];
             var attachmentId = "";
+            var collectType = file.collectType;
             var attachmentFlag = '${attachmentFlag}';
             var storeAs = '${storeAs}';
             var uploadPath = "http://gangwan-app.oss-cn-hangzhou.aliyuncs.com/" + storeAs;
             /*将这段字符串存到数据库即可*/
             var divId = "_${baseId}";
             $("#addFile" + divId).show();
-            multipartUploadWithStsCollection(storeAs, file, attachmentId, attachmentFlag, uploadPath, divId, size);
+            console.log(collectType)
+            multipartUploadWithStsCollectionOnFileSize(storeAs, file, attachmentId, attachmentFlag, uploadPath, divId, size, "1", collectType);
         }
     }
 </script>

+ 10 - 5
src/main/webapp/WEB-INF/tags/table/fileUpload.tag

@@ -133,8 +133,9 @@
                 <th width="30%">文件预览</th>
                 <th width="80px">上传人</th>
                 <th width="160px">上传时间</th>
+                <th width="100px">文件大小(MB)</th>
                 <th width="30%">文件描述</th>
-                <th width="200px">操作</th>
+                <th width="140px">操作</th>
                 <th class="hide"></th>
             </tr>
             </thead>
@@ -178,6 +179,9 @@
                             <%-- 上传时间 --%>
                         <td><fmt:formatDate value="${attach.createDate}" type="both"/></td>
 
+                            <%-- 文件大小 --%>
+                        <td>${attach.fileSize}</td>
+
                             <%-- 文件描述 --%>
                         <td style="padding:0px"><input id="workAttachments${status.index + 1}_description" name="workAttachments[${status.index + 1}].description" type="text" value="${attach.description}"  class="form-control layui-input" placeholder="请输入文件描述" style="width: 100%;height: 100%;padding:0px;background-color: #FFFFFF;" readonly="true" onclick="openInfo('workAttachments${status.index + 1}',this.value)"/></td>
 
@@ -319,7 +323,7 @@
             $("#${baseId}_addFile").show();
             var fileCount = $("#${baseId}_fileCount").val();
             $("#${baseId}_fileCount").val(parseInt(fileCount)+1);
-            multipartUploadWithStsOnProcessAccessory("${storeAs}", file, attachmentId, attachmentFlag, uploadPath, divId, ${baseId}_size, fileCount);
+            multipartUploadWithStsOnProcessAccessoryAndFileSize("${storeAs}", file, attachmentId, attachmentFlag, uploadPath, divId, ${baseId}_size, fileCount);
         }
     }
 
@@ -424,12 +428,13 @@
             }
             var fileSize = file.fileSize;
             console.log("fileSize",fileSize)
-            if(attachLength && attachLength.trim() !== '') {
+            /*if(attachLength && attachLength.trim() !== '') {
                 if (parseFloat(fileSize) > parseFloat(attachLength)) {
+                    console.log("attachLength",attachLength)
                     top.layer.msg("上传附件只能上传:" + attachLength + "M以下的文件", {icon: 0});
                     return false;
                 }
-            }
+            }*/
 
 
 
@@ -442,7 +447,7 @@
             $("#addFile" + divId).show();
             var fileCount = $("#${baseId}_fileCount").val();
             $("#${baseId}_fileCount").val(parseInt(fileCount)+1);
-            multipartUploadWithStsCollectionCollect(storeAs, file,attachmentId,attachmentFlag,uploadPath,divId,size,fileCount);
+            multipartUploadWithStsCollectionCollectOnFileSize(storeAs, file,attachmentId,attachmentFlag,uploadPath,divId,size,fileCount);
         }
     }
 </script>

File diff suppressed because it is too large
+ 1087 - 217
src/main/webapp/static/oss/ossupload.js


+ 3 - 3
src/main/webapp/webpage/include/head.jsp

@@ -93,13 +93,13 @@
             document.write('<script type="text/javascript" src="${ctxStatic}/oss/lib/crypto1/hmac/hmac.js"><\/script>');
             document.write('<script type="text/javascript" src="${ctxStatic}/oss/lib/crypto1/sha1/sha1.js"><\/script>');
             document.write('<script type="text/javascript" src="${ctxStatic}/oss/lib/base64.js"><\/script>');
-            document.write('<script type="text/javascript" src="${ctxStatic}/oss/ie-ossupload.js?18"><\/script>');
+            document.write('<script type="text/javascript" src="${ctxStatic}/oss/ie-ossupload.js?20"><\/script>');
         }
         else
         {
              document.write('<script src="http://gosspublic.alicdn.com/aliyun-oss-sdk-4.4.4.min.js"><\/script>');
             document.write('<script src="${ctxStatic}/bos/node_modules/@baiducloud/sdk/dist/baidubce-sdk.bundle.min.js"><\/script>');
-            document.write('<script type="text/javascript" src="${ctxStatic}/oss/ossupload.js?18"><\/script>');
+            document.write('<script type="text/javascript" src="${ctxStatic}/oss/ossupload.js?20"><\/script>');
             /*document.write('<script type="text/javascript" src="${ctxStatic}/bos/bosupload.js"><\/script>');*/
         }
     }
@@ -107,7 +107,7 @@
     {
          document.write('<script src="http://gosspublic.alicdn.com/aliyun-oss-sdk-4.4.4.min.js"><\/script>');
         document.write('<script src="${ctxStatic}/bos/node_modules/@baiducloud/sdk/dist/baidubce-sdk.bundle.min.js"><\/script>');
-        document.write('<script type="text/javascript" src="${ctxStatic}/oss/ossupload.js?18"><\/script>');
+        document.write('<script type="text/javascript" src="${ctxStatic}/oss/ossupload.js?20"><\/script>');
         /*document.write('<script type="text/javascript" src="${ctxStatic}/bos/bosupload.js"><\/script>');*/
     }
 

+ 1 - 1
src/main/webapp/webpage/include/ossTools.jsp

@@ -9,4 +9,4 @@
 <script type="text/javascript" src="${ctxStatic}/oss/lib/plupload-2.3.6/plupload-2.3.6/js/jquery.plupload.queue/jquery.plupload.queue.js"></script>
 <script type="text/javascript" src="${ctxStatic}/oss/lib/plupload-2.3.6/plupload-2.3.6/js/plupload.dev.js"></script>
 <script type="text/javascript" src="${ctxStatic}/oss/upload.js"></script>
-<script type="text/javascript" src="${ctxStatic}/oss/ossupload.js?18"></script>
+<script type="text/javascript" src="${ctxStatic}/oss/ossupload.js?20"></script>

+ 2 - 0
src/main/webapp/webpage/modules/collectAccessory/collectAccessoryCompanyList.jsp

@@ -371,6 +371,7 @@
 				,{field:'fileDescription',align:'center', title: '文件描述',  width:150,templet:function(d){
 						return "<span title='"+d.fileDescription+"'>"+d.fileDescription+"</span>"
 					}}
+				,{field:'fileSize',align:'center', title: '文件大小(MB)',  width:150}
 				,{field:'createName',align:'center', title: '上传人',  width:150}
 				,{field:'collectUserName',align:'center', title: '收藏人',  width:150}
 				,{field:'createDate',align:'center', title: '上传/收藏时间',  width:150}
@@ -400,6 +401,7 @@
                     ,"collectUserName":"${collectAccessoryInfo.collectUser.name}"
 					,"individualFlag":"${collectAccessoryInfo.individualFlag}"
 					,"fileDescription":"${collectAccessoryInfo.fileDescription}"
+					,"fileSize":"${collectAccessoryInfo.fileSize}"
 					,"classification":"${collectAccessoryInfo.classification}"
 					,"createDate":"<fmt:formatDate value="${collectAccessoryInfo.createDate}" pattern="yyyy-MM-dd"/>"
 

+ 4 - 0
src/main/webapp/webpage/modules/collectAccessory/collectAccessoryList.jsp

@@ -453,6 +453,8 @@
 				,{field:'fileDescription',align:'center', title: '文件描述',  width:150,templet:function(d){
 						return "<span title='"+d.fileDescription+"'>"+d.fileDescription+"</span>"
 					}}
+				,{field:'fileSize',align:'center', title: '文件大小(MB)',  width:150}
+				,{field:'fileSource',align:'center', title: '数据来源',  width:150}
 				,{field:'collectUserName',align:'center', title: '上传人',  width:150}
 				,{field:'createName',align:'center', title: '收藏人',  width:150}
 				,{field:'createDate',align:'center', title: '上传/收藏时间',  width:150}
@@ -492,6 +494,8 @@
 					,"companyFlag":"${collectAccessoryInfo.companyFlag}"
 					,"fileDescription":"${collectAccessoryInfo.fileDescription}"
 					,"classification":"${collectAccessoryInfo.classification}"
+					,"fileSize":"${collectAccessoryInfo.fileSize}"
+					,"fileSource":"${collectAccessoryInfo.fileSource}"
 					,"createDate":"<fmt:formatDate value="${collectAccessoryInfo.createDate}" pattern="yyyy-MM-dd"/>"
 					,"currentUser":<c:if test="${fns:getUser().id eq collectAccessoryInfo.createBy.id}">1</c:if>
 				}

+ 2 - 0
src/main/webapp/webpage/modules/collectAccessory/collectAccessoryOfficeList.jsp

@@ -372,6 +372,7 @@
 				,{field:'fileDescription',align:'center', title: '文件描述',  width:150,templet:function(d){
 						return "<span title='"+d.fileDescription+"'>"+d.fileDescription+"</span>"
 					}}
+				,{field:'fileSize',align:'center', title: '文件大小(MB)',  width:150}
 				,{field:'createName',align:'center', title: '上传人',  width:150}
 				,{field:'collectUserName',align:'center', title: '收藏人',  width:150}
 				,{field:'createDate',align:'center', title: '上传/收藏时间',  width:150}
@@ -400,6 +401,7 @@
                     ,"collectUserName":"${collectAccessoryInfo.collectUser.name}"
 					,"individualFlag":"${collectAccessoryInfo.individualFlag}"
 					,"fileDescription":"${collectAccessoryInfo.fileDescription}"
+					,"fileSize":"${collectAccessoryInfo.fileSize}"
 					,"classification":"${collectAccessoryInfo.classification}"
 					,"createDate":"<fmt:formatDate value="${collectAccessoryInfo.createDate}" pattern="yyyy-MM-dd"/>"
                 }

+ 2 - 1
src/main/webapp/webpage/modules/projectAccessory/collectAccessoryForm.jsp

@@ -109,7 +109,7 @@
 				var uploadPath="http://gangwan-app.oss-cn-hangzhou.aliyuncs.com/"+storeAs;/*将这段字符串存到数据库即可*/
 				var divId = "_attachment";
 				$("#addFile"+divId).show();
-				CollectUploadWithSts(storeAs, file,attachmentId,attachmentFlag,uploadPath,divId,size);}
+				CollectUploadWithStsOnFileSize(storeAs, file,attachmentId,attachmentFlag,uploadPath,divId,size);}
 		}
 		function showfile(){
 			var length=$("#file_attachment tr").length;
@@ -175,6 +175,7 @@
 							<th width="50%">文件预览</th>
 							<th>上传人</th>
 							<th>上传时间</th>
+							<th>文件大小(MB)</th>
 							<th width="200px">操作</th>
 						</tr>
 						</thead>

+ 2 - 0
src/main/webapp/webpage/modules/projectAccessory/collectAccessoryModify.jsp

@@ -169,6 +169,7 @@
 							<th width="50%">文件预览</th>
 							<th>上传人</th>
 							<th>上传时间</th>
+							<th>文件大小(MB)</th>
 						</tr>
 						</thead>
 						<tbody id="file_attachment">
@@ -212,6 +213,7 @@
 
 								<td>${collectAccessoryInfo.createBy.name}</td>
 								<td><fmt:formatDate value="${collectAccessoryInfo.createDate}" type="both"/></td>
+								<td>${collectAccessoryInfo.fileSize}</td>
 							</tr>
 						</tbody>
 					</table>

+ 1 - 1
src/main/webapp/webpage/modules/projectAccessory/workAttachmentOverAllForm.jsp

@@ -261,7 +261,7 @@
 					storeAs="workAttachment"
 					attachmentFlag="100"
 					attachTypes="${projectTemplateInfo.attachTypes}"
-					attachLength="${projectTemplateInfo.attachLength}"
+					attachLength=""
 			/>
 
 			<%--<div class="form-group layui-row">

+ 1 - 1
src/main/webapp/webpage/modules/projectcontentinfo/achievementFileDataForm.jsp

@@ -6,7 +6,7 @@
 	<meta name="decorator" content="default"/>
 	<link href="${ctxStatic}/bootstrap-select-1.12.4/css/bootstrap-select.min.css" rel="stylesheet" />
 	<script src="${ctxStatic}/bootstrap-select-1.12.4/js/bootstrap-select.min.js"></script>
-	<script type="text/javascript" src="${ctxStatic}/oss/ossupload.js?18"></script>
+	<script type="text/javascript" src="${ctxStatic}/oss/ossupload.js?20"></script>
 	<style>
 		label.error{
 			top:40px;

+ 1 - 1
src/main/webapp/webpage/modules/projectcontentinfo/basedDataForm.jsp

@@ -6,7 +6,7 @@
 	<meta name="decorator" content="default"/>
 	<link href="${ctxStatic}/bootstrap-select-1.12.4/css/bootstrap-select.min.css" rel="stylesheet" />
 	<script src="${ctxStatic}/bootstrap-select-1.12.4/js/bootstrap-select.min.js"></script>
-	<script type="text/javascript" src="${ctxStatic}/oss/ossupload.js?18"></script>
+	<script type="text/javascript" src="${ctxStatic}/oss/ossupload.js?20"></script>
 	<style>
 		label.error{
 			top:40px;

+ 145 - 12
src/main/webapp/webpage/modules/ruralprojectrecords/electronicSeal/ruralProjectRecordsReportInternalAuditSignatureView.jsp

@@ -1087,20 +1087,153 @@
                         </tr>
                         </thead>
                         <tbody id="file_attachment">
+                        <c:forEach items="${projectRecords.workAttachments}" var = "workClientAttachment" varStatus="status">
+                            <tr>
+                                    <%-- <td>${status.index + 1}</td>--%>
+                                <c:choose>
+                                    <c:when test="${projectRecords.uploadMode == 2}">
+                                        <c:choose>
+                                            <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
+                                                <td><img src="${workClientAttachment.temporaryUrl}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.temporaryUrl}','90%','90%')" alt="${workClientAttachment.attachmentName}">
+                                            </c:when>
+                                            <c:otherwise>
+                                                <c:choose>
+                                                    <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
+                                                        <td><a class="attention-info" href="javascript:void(0)" onclick="preview('预览','${workClientAttachment.temporaryUrl}','90%','90%','1')">${workClientAttachment.attachmentName}</a></td>
+                                                    </c:when>
+                                                    <c:otherwise>
+                                                        <c:choose>
+                                                            <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'rar')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'zip')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jar')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'7z')}">
+                                                                <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',3)">${workClientAttachment.attachmentName}</a></td>
+                                                            </c:when>
+                                                            <c:otherwise>
+                                                                <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',2)">${workClientAttachment.attachmentName}</a></td>
+                                                            </c:otherwise>
+                                                        </c:choose>
+                                                    </c:otherwise>
+                                                </c:choose>
+                                            </c:otherwise>
+                                        </c:choose>
+                                    </c:when>
+                                    <c:otherwise>
+                                        <c:choose>
+                                            <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
+                                                <td><img src="${workClientAttachment.url}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.url}','90%','90%')" alt="${workClientAttachment.attachmentName}">
+                                            </c:when>
+                                            <c:otherwise>
+                                                <c:choose>
+                                                    <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
+                                                        <td><a class="attention-info" href="javascript:void(0)" onclick="preview('预览','${workClientAttachment.url}','90%','90%','1')">${workClientAttachment.attachmentName}</a></td>
+                                                    </c:when>
+                                                    <c:otherwise>
+                                                        <c:choose>
+                                                            <c:when test="${workReimbursement.uploadMode == 2}">
+                                                                <c:choose>
+                                                                    <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
+                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
+                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
+                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
+                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
+                                                                        <td><img src="${workClientAttachment.temporaryUrl}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.temporaryUrl}','90%','90%')" alt="${workClientAttachment.attachmentName}">
+                                                                    </c:when>
+                                                                    <c:otherwise>
+                                                                        <c:choose>
+                                                                            <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
+                                                                                <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',1)">${workClientAttachment.attachmentName}</a></td>
+                                                                            </c:when>
+                                                                            <c:otherwise>
+                                                                                <c:choose>
+                                                                                    <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'rar')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'zip')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jar')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'7z')}">
+                                                                                        <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',3)">${workClientAttachment.attachmentName}</a></td>
+                                                                                    </c:when>
+                                                                                    <c:otherwise>
+                                                                                        <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',2)">${workClientAttachment.attachmentName}</a></td>
+                                                                                    </c:otherwise>
+                                                                                </c:choose>
+                                                                            </c:otherwise>
+                                                                        </c:choose>
+                                                                    </c:otherwise>
+                                                                </c:choose>
+                                                            </c:when>
+                                                            <c:otherwise>
+                                                                <c:choose>
+                                                                    <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
+                                                   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
+                                                   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
+                                                   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
+                                                   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
+                                                                        <td><img src="${workClientAttachment.url}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.url}','90%','90%')" alt="${workClientAttachment.attachmentName}">
+                                                                    </c:when>
+                                                                    <c:otherwise>
+                                                                        <c:choose>
+                                                                            <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
+                                                                                <td><a href="javascript:void(0)" onclick="openPreview('${workClientAttachment.url}',1)">${workClientAttachment.attachmentName}</a></td>
+                                                                            </c:when>
+                                                                            <c:otherwise>
+                                                                                <c:choose>
+                                                                                    <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'rar')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'zip')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jar')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'7z')}">
+                                                                                        <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.url}',3)">${workClientAttachment.attachmentName}</a></td>
+                                                                                    </c:when>
+                                                                                    <c:otherwise>
+                                                                                        <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.url}',2)">${workClientAttachment.attachmentName}</a></td>
+                                                                                    </c:otherwise>
+                                                                                </c:choose>
+                                                                            </c:otherwise>
+                                                                        </c:choose>
+                                                                    </c:otherwise>
+                                                                </c:choose>
+                                                            </c:otherwise>
+                                                        </c:choose>
+                                                    </c:otherwise>
+                                                </c:choose>
+                                            </c:otherwise>
+                                        </c:choose>
+                                    </c:otherwise>
+                                </c:choose>
+
+                                <td>${workClientAttachment.createBy.name}</td>
+                                <td><fmt:formatDate value="${workClientAttachment.createDate}" type="both"/></td>
+                                <td class="op-td">
+                                    <div class="op-btn-box" >
+                                        <a href="javascript:location.href='${ctx}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent('${workClientAttachment.url}');" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+                                        <c:if test="${status.index == 0}">
+                                            <c:if test="${not empty projectRecords.reportInternalAuditSignatureContractId}">
 
+                                                <c:choose>
+                                                    <c:when test="${projectRecords.reportInternalAuditSignatureUrlFlag == 1}">
+                                                        <a href="${projectRecords.reportInternalAuditSignatureUrl}" class="op-btn  op-btn-download layui-bg-orange">内审报告签章下载</a>
+                                                    </c:when>
+                                                    <c:otherwise>
+                                                        <a href="javascript:location.href='${ctx}/ruralProject/signatureCallBack/downLoadReportAttach?contractId='+'${projectRecords.reportInternalAuditSignatureContractId}'" class="op-btn  op-btn-download layui-bg-orange">报告签章下载</a>
+                                                    </c:otherwise>
+                                                </c:choose>
+                                            </c:if>
+                                        </c:if>
 
-                            <%-- 引用附件列表Tag --%>
-                        <!-- attachments" 附件列表数据(必填) -->
-                        <!-- showSerialNo="false" 是否显示序号列(默认false) -->
-                        <!-- uploadMode 上传模式(默认2-阿里云) -->
-                        <!-- deleteParamsSuffix="_attachment" 删除参数后缀(防冲突) -->
-                        <table:fileShowDisplay
-                                attachments="${projectRecords.workAttachments}"
-                                uploadMode="${projectRecords.uploadMode}"
-                                deleteParamsSuffix="_attachment"
-                                deleteDomPrefix="addFile_attachment"
-                                enableDelete="false"
-                        />
+                                            <%--													<c:if test="${workClientAttachment.createBy.id eq fns:getUser().id}">--%>
+                                            <%--														<a href="javascript:void(0)" onclick="deleteFileFromAliyun(this,'${ctx}/sys/workattachment/deleteFileFromAliyun?url=${workClientAttachment.url}&id=${workClientAttachment.id}&type=2','addFile_attachment','_attachment')" class="op-btn op-btn-delete" ><i class="fa fa-trash"></i>&nbsp;删除</a>--%>
+                                            <%--													</c:if>--%>
+                                    </div>
+                                </td>
+                            </tr>
+                        </c:forEach>
 
                         </tbody>
                     </table>

+ 8 - 3
src/main/webapp/webpage/modules/sys/collectNewSelect.jsp

@@ -34,7 +34,9 @@
                 var label5 = $(this).parent().parent().parent().find(".codelabel5").html();
                 var label6 = $(this).parent().parent().parent().find(".codelabel6").html();
                 var label7 = $(this).parent().parent().parent().find(".codelabel7").html();
-                var data= {'id':id,'fileName':label5,'createName':label2,'url':label3,'fileSize':label6,'linUrl':label1,'fileType':label7};
+                var label8 = $(this).parent().parent().parent().find(".codelabel8").html();
+                var label9 = $(this).parent().parent().parent().find(".codelabel9").html();
+                var data= {'id':id,'fileName':label5,'createName':label2,'url':label3,'fileSize':label6,'linUrl':label1,'fileType':label7,'collectType':label9};
                 arr.push(data);
 			})
             return arr;
@@ -95,9 +97,10 @@
 						<tr>
 							<th width="50"></th>
 								<th style="display:none">编号</th>
-								<th width="60%">附件名称</th>
-								<th width="20%">收藏人</th>
+								<th width="50%">附件名称</th>
+								<th width="10%">收藏人</th>
 								<th width="20%">收藏时间</th>
+								<th width="20%">文件大小(MB)</th>
 						</tr>
 					</thead>
 					<tbody>
@@ -153,10 +156,12 @@
 							</c:choose>
 							<td title="${obj.createBy.name}" class="codelabel2">${obj.createBy.name}</td>
 							<td title="${obj.createDateStr}" class="codelabel4">${obj.createDateStr}</td>
+							<td title="${obj.fileSizeStr}" class="codelabel8">${obj.fileSizeStr}</td>
 							<td style="display:none" class="codelabel3">${obj.url}</td>
 							<td style="display:none" class="codelabel5">${obj.fileName}</td>
 							<td style="display:none" class="codelabel6">${obj.fileSize}</td>
 							<td style="display:none" class="codelabel7">${obj.type}</td>
+							<td style="display:none" class="codelabel9">${obj.collectType}</td>
 						</tr>
 					</c:forEach>
 					</c:when>

+ 17 - 105
src/main/webapp/webpage/modules/workclientinfo/all/workClientInfoForm.jsp

@@ -167,9 +167,9 @@
 					}
 				}
 			});
-            $("#attachment_btn").click(function () {
+            /*$("#attachment_btn").click(function () {
                 $("#attachment_file").click();
-            });
+            });*/
             $('input[name="hasUscc"]').on('ifChecked', function(event){
                 disUscc(event.target.defaultValue);
             });
@@ -773,109 +773,21 @@
             </div>
 
 
-            <div class="form-group layui-row">
-                <div class="form-group-label"><h2>附件信息</h2></div>
-                <div class="layui-item nav-btns">
-                    <a id="attachment_btn" class="nav-btn nav-btn-add" title="添加附件"><i class="fa fa-plus"></i>&nbsp;添加附件</a>
-                </div>
-                <div id="addFile_attachment" style="display: none" class="upload-progress">
-                    <span id="fileName_attachment"></span>
-                    <b><span id="baifenbi_attachment"></span></b>
-                    <div class="progress">
-                            <%--进度条--%>
-                        <div id="jindutiao_attachment" class="progress-bar" style="width: 0%" aria-valuenow="0">
-                        </div>
-                    </div>
-                </div>
-                <input id="attachment_file" type="file" name="attachment_file" multiple="multiple"
-                       style="display: none;" onChange="if(this.value)insertTitle(this.value);"/>
-                <span id="attachment_title"></span>
-                <div class="layui-item layui-col-xs12" style="padding:0 16px;">
-                    <table id="upTable" class="table table-bordered table-condensed details">
-                        <thead>
-                        <tr>
-                                <%-- <th>序号</th>--%>
-                            <th>文件</th>
-                            <th>上传人</th>
-                            <th>上传时间</th>
-                            <th width="150px">操作</th>
-                        </tr>
-                        </thead>
-                        <tbody id="file_attachment">
-                        <c:forEach items="${workClientInfo.workAttachments}" var="workClientAttachment"
-                                   varStatus="status">
-                            <tr>
-                                    <%-- <td>${status.index + 1}</td>--%>
-                                <c:choose>
-                                    <c:when test="${workClientInfo.uploadMode == 2}">
-                                        <c:choose>
-                                            <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
-                                                   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
-                                                   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
-                                                   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
-                                                   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
-                                                <td><img src="${workClientAttachment.temporaryUrl}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.temporaryUrl}','90%','90%')" alt="${workClientAttachment.attachmentName}">
-                                            </c:when>
-                                            <c:otherwise>
-                                                <c:choose>
-                                                    <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
-                                                        <td><a class="attention-info" href="javascript:void(0)" onclick="preview('预览','${workClientAttachment.temporaryUrl}','90%','90%','1')">${workClientAttachment.attachmentName}</a></td>
-                                                    </c:when>
-                                                    <c:otherwise>
-                                                        <td><a class="attention-info" href="javascript:void(0)" onclick="preview('预览','${workClientAttachment.temporaryUrl}','90%','90%')">${workClientAttachment.attachmentName}</a></td>
-                                                    </c:otherwise>
-                                                </c:choose>
-                                            </c:otherwise>
-                                        </c:choose>
-                                    </c:when>
-                                    <c:otherwise>
-                                        <c:choose>
-                                            <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
-                                             or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
-                                             or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
-                                             or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
-                                             or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
-                                                <td><img src="${workClientAttachment.url}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.url}','90%','90%')" alt="${workClientAttachment.attachmentName}">
-                                            </c:when>
-                                            <c:otherwise>
-                                                <c:choose>
-                                                    <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
-                                                        <td><a class="attention-info" href="javascript:void(0)"
-                                                               onclick="preview('预览','${workClientAttachment.url}','90%','90%','1')">${workClientAttachment.attachmentName}</a>
-                                                        </td>
-                                                    </c:when>
-                                                    <c:otherwise>
-                                                        <td><a class="attention-info" href="javascript:void(0)"
-                                                               onclick="preview('预览','${workClientAttachment.url}','90%','90%')">${workClientAttachment.attachmentName}</a>
-                                                        </td>
-                                                    </c:otherwise>
-                                                </c:choose>
-                                            </c:otherwise>
-                                        </c:choose>
-                                    </c:otherwise>
-                                </c:choose>
-
-
-
-                                <td>${workClientAttachment.createBy.name}</td>
-                                <td><fmt:formatDate value="${workClientAttachment.createDate}" type="both"/></td>
-                                <td class="op-td">
-                                    <div class="op-btn-box">
-                                        <a href="javascript:location.href='${ctx}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent('${workClientAttachment.url}');"
-                                           class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
-                                        <c:if test="${workClientAttachment.createBy.id eq fns:getUser().id}">
-                                            <a href="javascript:void(0)"
-                                               onclick="deleteFileFromAliyun(this,'${ctx}/sys/workattachment/deleteFileFromAliyun?url=${workClientAttachment.url}&id=${workClientAttachment.id}&type=2','addFile')"
-                                               class="op-btn op-btn-delete"><i class="fa fa-trash"></i>&nbsp;删除</a>
-                                        </c:if>
-                                    </div>
-                                </td>
-                            </tr>
-                        </c:forEach>
-                        </tbody>
-                    </table>
-                </div>
-            </div>
+            <!-- fileHandlerFuncName="myCustomHandler" 自定义函数名 -->
+            <!-- attachmentFlag="6" 附件标识 -->
+            <!-- storeAs="wrkReimbursement" 存储路径标识 -->
+            <!-- showOperateArea="false" 是否展示新增按钮,默认true -->
+            <table:attachmentManager
+                    title="附件信息"
+                    addBtnText="添加附件"
+                    baseId="attachment"
+                    attachments="${workClientInfo.workAttachments}"
+                    fileHandlerFuncName="insertTitle"
+                    attachmentFlag="5"
+                    storeAs="workClientInfo"
+            />
+
+
             <div class="form-group layui-row page-end"></div>
         </form:form>
     </div>

+ 18 - 146
src/main/webapp/webpage/modules/workreimbursement/all/workReimbursementAllFormAdd.jsp

@@ -91,9 +91,9 @@
                 type : 'date'
                 , trigger: 'click'
             });
-            $("#attachment_btn").click(function () {
+            /*$("#attachment_btn").click(function () {
                 $("#attachment_file").click();
-            });
+            });*/
             $("#attachment_btn_xml").click(function () {
                 $("#attachment_InvoiceReimbursement_file").click();
             });
@@ -519,7 +519,7 @@
             });
 
         }
-        function insertTitle(tValue){
+        /*function insertTitle(tValue){
             var list = "${workReimbursement.workAttachments}";
             var size = (list.split('url')).length-1;
             var files = $("#attachment_file")[0].files;
@@ -530,12 +530,12 @@
                 var timestamp=new Date().getTime();
 
                 var storeAs = "wrkReimbursement";
-                var uploadPath="http://gangwan-app.oss-cn-hangzhou.aliyuncs.com/"+storeAs;/*将这段字符串存到数据库即可*/
+                var uploadPath="http://gangwan-app.oss-cn-hangzhou.aliyuncs.com/"+storeAs;/!*将这段字符串存到数据库即可*!/
                 var divId = "_attachment";
                 $("#addFile"+divId).show();
                 multipartUploadWithSts(storeAs, file,attachmentId,attachmentFlag,uploadPath,divId,size);}
 
-        }
+        }*/
 
         async function insertTitleInvoiceReimbursement(tValue) {
             var id = "${workReimbursement.id}";
@@ -1870,149 +1870,21 @@
             </div>
         </div>
 --%>
+        <!-- fileHandlerFuncName="myCustomHandler" 自定义函数名 -->
+        <!-- attachmentFlag="6" 附件标识 -->
+        <!-- storeAs="wrkReimbursement" 存储路径标识 -->
+        <!-- showOperateArea="false" 是否展示新增按钮,默认true -->
+        <table:attachmentManager
+                title="附件信息"
+                addBtnText="添加附件"
+                baseId="attachment"
+                attachments="${workReimbursement.workAttachments}"
+                fileHandlerFuncName="insertTitle"
+                attachmentFlag="6"
+                storeAs="wrkReimbursement"
+        />
 
-        <div class="form-group layui-row">
-            <div class="form-group-label"><h2>附件信息</h2></div>
-            <div class="layui-item nav-btns">
-                <a id="attachment_btn" class="nav-btn nav-btn-add" title="添加附件"><i class="fa fa-plus"></i>&nbsp;添加附件</a>
-                <sys:collectSelect  id="linkman" url="${ctx}/workclientinfo/workClientInfo/linkmanList"
-                                    name="linkman.id"  title="选择资料库"
-                                    cssClass="form-control judgment" fieldLabels="资料库" fieldKeys="name"
-                                    searchLabel="资料库" searchKey="fileName"></sys:collectSelect>
-            </div>
-            <div id="addFile_attachment" style="display: none" class="upload-progress">
-                <span id="fileName_attachment" ></span>
-                <b><span id="baifenbi_attachment" ></span></b>
-                <div class="progress">
-                    <div id="jindutiao_attachment" class="progress-bar" style="width: 0%" aria-valuenow="0">
-                    </div>
-                </div>
-            </div>
-            <input id="attachment_file" type="file" name="attachment_file" multiple="multiple" style="display: none;" onChange="if(this.value)insertTitle(this.value);"/>
-            <span id="attachment_title"></span>
-            <div class="layui-item layui-col-xs12" style="padding:0 16px;">
-                <table id="upTable" class="table table-bordered table-condensed details">
-                    <thead>
-                    <tr>
-                            <%-- <th>序号</th>--%>
-                        <th>文件预览</th>
-                        <th>上传人</th>
-                        <th>上传时间</th>
-                        <th width="200px">操作</th>
-                    </tr>
-                    </thead>
-                    <tbody id="file_attachment">
-                    <c:forEach items="${workReimbursement.workAttachments}" var = "workClientAttachment" varStatus="status">
-                        <tr>
-                                <%-- <td>${status.index + 1}</td>--%>
-                        <c:choose>
-                            <c:when test="${workReimbursement.uploadMode == 2}">
-                                <c:choose>
-                                    <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
-                                               or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
-                                               or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
-                                               or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
-                                               or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
-                                        <td><img src="${workClientAttachment.temporaryUrl}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.temporaryUrl}','90%','90%')" alt="${workClientAttachment.attachmentName}">
-                                    </c:when>
-                                    <c:otherwise>
-                                        <c:choose>
-                                            <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
-                                                <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',1)">${workClientAttachment.attachmentName}</a></td>
-                                            </c:when>
-                                            <c:otherwise>
-                                                <c:choose>
-                                                    <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'rar')
-                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'zip')
-                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jar')
-                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'7z')}">
-                                                        <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',3)">${workClientAttachment.attachmentName}</a></td>
-                                                    </c:when>
-                                                    <c:otherwise>
-                                                        <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',2)">${workClientAttachment.attachmentName}</a></td>
-                                                    </c:otherwise>
-                                                </c:choose>
-                                            </c:otherwise>
-                                        </c:choose>
-                                    </c:otherwise>
-                                </c:choose>
-                            </c:when>
-                            <c:otherwise>
-                                <c:choose>
-                                    <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
-                                               or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
-                                               or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
-                                               or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
-                                               or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
-                                        <td><img src="${workClientAttachment.url}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.url}','90%','90%')" alt="${workClientAttachment.attachmentName}"></td>
-                                    </c:when>
-                                    <c:otherwise>
-                                        <c:choose>
-                                            <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
-                                                <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.url}',1)">${workClientAttachment.attachmentName}</a></td>
-                                            </c:when>
-                                            <c:otherwise>
-                                                <c:choose>
-                                                    <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'rar')
-                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'zip')
-                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jar')
-                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'7z')}">
-                                                        <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.url}',3)">${workClientAttachment.attachmentName}</a></td>
-                                                    </c:when>
-                                                    <c:otherwise>
-                                                        <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.url}',2)">${workClientAttachment.attachmentName}</a></td>
-                                                    </c:otherwise>
-                                                </c:choose>
-                                            </c:otherwise>
-                                        </c:choose>
-                                    </c:otherwise>
-                                </c:choose>
-                            </c:otherwise>
-                        </c:choose>
-
-
-                            <td>${workClientAttachment.createBy.name}</td>
-                            <td><fmt:formatDate value="${workClientAttachment.createDate}" type="both"/></td>
-                            <td class="op-td">
-                                <div class="op-btn-box" >
-                                        <%--附件下载删除--%>
-                                    <c:choose>
-                                        <c:when test="${workReimbursement.uploadMode == 2}">
-                                            <c:choose>
-                                                <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
-                                                    <a href="${workClientAttachment.temporaryUrl}" target="_blank" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
-                                                </c:when>
-                                                <c:otherwise>
-                                                    <c:choose>
-                                                        <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'xml')}">
-                                                            <a href="javascript:location.href='${ctx}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent('${workClientAttachment.url}');" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
-                                                        </c:when>
-                                                        <c:otherwise>
-                                                            <a href="${workClientAttachment.temporaryUrl}" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
-                                                        </c:otherwise>
-                                                    </c:choose>
-                                                </c:otherwise>
-                                            </c:choose>
-                                        </c:when>
-                                        <c:otherwise>
-                                            <a href="javascript:location.href='${ctx}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent('${workClientAttachment.url}');" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
-                                        </c:otherwise>
-                                    </c:choose>
-                                    <c:if test="${workClientAttachment.collectFlag != 1}">
-                                        <a href="javascript:void(0)" onclick="collectingAccessory(this,'${ctx}/projectAccessory/projectAccessory/saveCollectAccessory','${workClientAttachment.url}','${workClientAttachment.createBy.id}','${workClientAttachment.fileSize}')" class="op-btn op-btn-delete"   style="background-color: #FFB800"><i class="layui-icon layui-icon-rate"></i>&nbsp;收藏</a>
-                                    </c:if>
-                                    <c:if test="${workClientAttachment.createBy.id eq fns:getUser().id}">
-                                        <a href="javascript:void(0)" onclick="deleteFileFromAliyun(this,'${ctx}/sys/workattachment/deleteFileFromAliyun?url=${workClientAttachment.url}&id=${workClientAttachment.id}&type=2','addFile')" class="op-btn op-btn-delete" ><i class="fa fa-trash"></i>&nbsp;删除</a>
-                                    </c:if>
 
-                                </div>
-                            </td>
-                        </tr>
-                    </c:forEach>
-                    </tbody>
-                </table>
-            </div>
-        </div>
         <div class="form-group layui-row page-end"></div>
     </form:form>
 </div>

+ 19 - 144
src/main/webapp/webpage/modules/workreimbursement/all/workReimbursementAllModifyApply.jsp

@@ -112,9 +112,9 @@
                 type : 'date'
 , trigger: 'click'
             });
-            $("#attachment_btn").click(function () {
+            /*$("#attachment_btn").click(function () {
                 $("#attachment_file").click();
-            });
+            });*/
 
             $("#attachment_btn_InvoiceReimbursement").click(function () {
                 $("#attachment_InvoiceReimbursement_file").click();
@@ -591,7 +591,7 @@
             });
 
         }
-        function insertTitle(tValue){
+        /*function insertTitle(tValue){
             var list = "${workReimbursement.workAttachments}";
             var size = (list.split('url')).length-1;
             var files = $("#attachment_file")[0].files;            for(var i = 0;i<files.length;i++) {                var file = files[i];
@@ -601,11 +601,11 @@
                 var timestamp=new Date().getTime();
 
                 var storeAs = "wrkReimbursement";
-                var uploadPath="http://gangwan-app.oss-cn-hangzhou.aliyuncs.com/"+storeAs;/*将这段字符串存到数据库即可*/
+                var uploadPath="http://gangwan-app.oss-cn-hangzhou.aliyuncs.com/"+storeAs;/!*将这段字符串存到数据库即可*!/
                 var divId = "_attachment";
                 $("#addFile"+divId).show();
                 multipartUploadWithSts(storeAs, file,attachmentId,attachmentFlag,uploadPath,divId,size);}
-        }
+        }*/
 
         async function insertTitleInvoiceReimbursement(tValue) {
             var id = "${workReimbursement.id}";
@@ -2144,147 +2144,22 @@
             </div>
         </div>--%>
 
-        <div class="form-group layui-row">
-            <div class="form-group-label"><h2>附件信息</h2></div>
-            <div class="layui-item nav-btns">
-                <a id="attachment_btn" class="nav-btn nav-btn-add" title="添加附件"><i class="fa fa-plus"></i>&nbsp;添加附件</a>
-                <sys:collectSelect  id="linkman" url="${ctx}/workclientinfo/workClientInfo/linkmanList"
-                                    name="linkman.id"  title="选择资料库"
-                                    cssClass="form-control judgment" fieldLabels="资料库" fieldKeys="name"
-                                    searchLabel="资料库" searchKey="fileName"></sys:collectSelect>
-            </div>
-            <div id="addFile_attachment" style="display: none" class="upload-progress">
-                <span id="fileName_attachment" ></span>
-                <b><span id="baifenbi_attachment" ></span></b>
-                <div class="progress">
-                    <div id="jindutiao_attachment" class="progress-bar" style="width: 0%" aria-valuenow="0">
-                    </div>
-                </div>
-            </div>
-            <input id="attachment_file" type="file" name="attachment_file" multiple="multiple" style="display: none;" onChange="if(this.value)insertTitle(this.value);"/>
-            <span id="attachment_title"></span>
-            <div class="layui-item layui-col-xs12" style="padding:0 16px;">
-                <table id="upTable" class="table table-bordered table-condensed details">
-                    <thead>
-                    <tr>
-                            <%-- <th>序号</th>--%>
-                        <th>文件预览</th>
-                        <th>上传人</th>
-                        <th>上传时间</th>
-                        <th width="200px">操作</th>
-                    </tr>
-                    </thead>
-                    <tbody id="file_attachment">
-                    <c:forEach items="${workReimbursement.workAttachments}" var = "workClientAttachment" varStatus="status">
-                        <tr>
-                                <%-- <td>${status.index + 1}</td>--%>
-                            <c:choose>
-                                <c:when test="${workReimbursement.uploadMode == 2}">
-                                    <c:choose>
-                                        <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
-                                                   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
-                                                   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
-                                                   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
-                                                   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
-                                            <td><img src="${workClientAttachment.temporaryUrl}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.temporaryUrl}','90%','90%')" alt="${workClientAttachment.attachmentName}">
-                                        </c:when>
-                                        <c:otherwise>
-                                            <c:choose>
-                                                <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
-                                                    <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',1)">${workClientAttachment.attachmentName}</a></td>
-                                                </c:when>
-                                                <c:otherwise>
-                                                    <c:choose>
-                                                        <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'rar')
-                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'zip')
-                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jar')
-                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'7z')}">
-                                                            <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',3)">${workClientAttachment.attachmentName}</a></td>
-                                                        </c:when>
-                                                        <c:otherwise>
-                                                            <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',2)">${workClientAttachment.attachmentName}</a></td>
-                                                        </c:otherwise>
-                                                    </c:choose>
-                                                </c:otherwise>
-                                            </c:choose>
-                                        </c:otherwise>
-                                    </c:choose>
-                                </c:when>
-                                <c:otherwise>
-                                    <c:choose>
-                                        <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
-                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
-                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
-                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
-                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
-                                            <td><img src="${workClientAttachment.url}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.url}','90%','90%')" alt="${workClientAttachment.attachmentName}">
-                                        </c:when>
-                                        <c:otherwise>
-                                            <c:choose>
-                                                <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
-                                                    <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.url}',1)">${workClientAttachment.attachmentName}</a></td>
-                                                </c:when>
-                                                <c:otherwise>
-                                                    <c:choose>
-                                                        <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'rar')
-                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'zip')
-                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jar')
-                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'7z')}">
-                                                            <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.url}',3)">${workClientAttachment.attachmentName}</a></td>
-                                                        </c:when>
-                                                        <c:otherwise>
-                                                            <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.url}',2)">${workClientAttachment.attachmentName}</a></td>
-                                                        </c:otherwise>
-                                                    </c:choose>
-                                                </c:otherwise>
-                                            </c:choose>
-                                        </c:otherwise>
-                                    </c:choose>
-                                </c:otherwise>
-                            </c:choose>
 
-                            <td>${workClientAttachment.createBy.name}</td>
-                            <td><fmt:formatDate value="${workClientAttachment.createDate}" type="both"/></td>
-                            <td class="op-td">
-                                <div class="op-btn-box" >
-                                        <%--附件下载删除--%>
-                                    <c:choose>
-                                        <c:when test="${workReimbursement.uploadMode == 2}">
-                                            <c:choose>
-                                                <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
-                                                    <a href="${workClientAttachment.temporaryUrl}" target="_blank" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
-                                                </c:when>
-                                                <c:otherwise>
-                                                    <c:choose>
-                                                        <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'xml')}">
-                                                            <a href="javascript:location.href='${ctx}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent('${workClientAttachment.url}');" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
-                                                        </c:when>
-                                                        <c:otherwise>
-                                                            <a href="${workClientAttachment.temporaryUrl}" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
-                                                        </c:otherwise>
-                                                    </c:choose>
-                                                </c:otherwise>
-                                            </c:choose>
-                                        </c:when>
-                                        <c:otherwise>
-                                            <a href="javascript:location.href='${ctx}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent('${workClientAttachment.url}');" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
-                                        </c:otherwise>
-                                    </c:choose>
 
-                                    <c:if test="${workClientAttachment.createBy.id eq fns:getUser().id}">
-                                        <a href="javascript:void(0)" onclick="deleteFileFromAliyun(this,'${ctx}/sys/workattachment/deleteFileFromAliyun?url=${workClientAttachment.url}&id=${workClientAttachment.id}&type=2','addFile')" class="op-btn op-btn-delete" ><i class="fa fa-trash"></i>&nbsp;删除</a>
-                                    </c:if>
-                                    <c:if test="${workClientAttachment.collectFlag != 1}">
-                                        <a href="javascript:void(0)" onclick="collectingAccessory(this,'${ctx}/projectAccessory/projectAccessory/saveCollectAccessory','${workClientAttachment.url}','${workClientAttachment.createBy.id}','${workClientAttachment.fileSize}')" class="op-btn op-btn-delete" style="background-color: #FFB800"><i class="layui-icon layui-icon-rate"></i>&nbsp;收藏</a>
-                                    </c:if>
-                                </div>
-                            </td>
-                        </tr>
-                    </c:forEach>
-                    </tbody>
-                </table>
-            </div>
-        </div>
+        <!-- fileHandlerFuncName="myCustomHandler" 自定义函数名 -->
+        <!-- attachmentFlag="6" 附件标识 -->
+        <!-- storeAs="wrkReimbursement" 存储路径标识 -->
+        <!-- showOperateArea="false" 是否展示新增按钮,默认true -->
+        <table:attachmentManager
+                title="附件信息"
+                addBtnText="添加附件"
+                baseId="attachment"
+                attachments="${workReimbursement.workAttachments}"
+                fileHandlerFuncName="insertTitle"
+                attachmentFlag="6"
+                storeAs="wrkReimbursement"
+        />
+
 
         <div class="form-group layui-row">
             <div class="form-group-label"><h2>${projectNotifyType}审批流程</h2></div>