Forráskód Böngészése

文件共享通知

user5 3 éve
szülő
commit
acddbc54d8

+ 29 - 12
src/main/java/com/jeeplus/modules/projectAccessory/service/CollectAccessoryService.java

@@ -1,5 +1,6 @@
 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.modules.projectAccessory.dao.CollectAccessoryDao;
@@ -35,6 +36,22 @@ public class CollectAccessoryService extends CrudService<CollectAccessoryDao, Co
     }
 
     /**
+     * 根据id查询收藏文件的信息
+     * @param id
+     * @return
+     */
+    public CollectAccessoryInfo getInfo(String id) {
+        CollectAccessoryInfo collectAccessoryInfo = super.get(id);
+        if (null != collectAccessoryInfo){
+            List<CollectAccessoryInfo> list = Lists.newArrayList();
+            list.add(collectAccessoryInfo);
+            workattachmentService.attachmentManageByUrlOnCollect(list);
+            collectAccessoryInfo = list.get(0);
+        }
+        return collectAccessoryInfo;
+    }
+
+    /**
      * 查询所有数据
      * @param collectAccessoryInfo
      * @return
@@ -122,12 +139,12 @@ public class CollectAccessoryService extends CrudService<CollectAccessoryDao, Co
                                         .saveNotify(collectAccessoryInfo.getId(),
                                                 user,
                                                 user.getCompany().getId(),
-                                                "文件收藏成功",
+                                                "文件共享成功",
                                                 "文件"+collectAccessoryInfo.getFileName()+"部门收藏成功",
-                                                "92",
+                                                "104",
                                                 "0",
                                                 "待通知",
-                                                "文件收藏成功"));
+                                                "文件共享成功"));
                     }
                     break;
                 case "3":
@@ -140,12 +157,12 @@ public class CollectAccessoryService extends CrudService<CollectAccessoryDao, Co
                                         .saveNotify(collectAccessoryInfo.getId(),
                                                 user,
                                                 user.getCompany().getId(),
-                                                "文件收藏成功",
+                                                "文件共享成功",
                                                 "文件"+collectAccessoryInfo.getFileName()+"公司收藏成功",
-                                                "92",
+                                                "104",
                                                 "0",
                                                 "待通知",
-                                                "文件收藏成功"));
+                                                "文件共享成功"));
                     }
                     break;
             }
@@ -181,12 +198,12 @@ public class CollectAccessoryService extends CrudService<CollectAccessoryDao, Co
                                         .saveNotify(collectAccessoryInfo.getId(),
                                                 user,
                                                 user.getCompany().getId(),
-                                                "文件收藏成功",
+                                                "文件部门共享成功",
                                                 "文件"+collectAccessoryInfo.getFileName()+"部门收藏成功",
-                                                "92",
+                                                "104",
                                                 "0",
                                                 "待通知",
-                                                "文件收藏成功"));
+                                                "文件部门共享成功"));
                     }
                     break;
                 case "3":
@@ -199,12 +216,12 @@ public class CollectAccessoryService extends CrudService<CollectAccessoryDao, Co
                                         .saveNotify(collectAccessoryInfo.getId(),
                                                 user,
                                                 user.getCompany().getId(),
-                                                "文件收藏成功",
+                                                "文件公司共享成功",
                                                 "文件"+collectAccessoryInfo.getFileName()+"公司收藏成功",
-                                                "92",
+                                                "104",
                                                 "0",
                                                 "待通知",
-                                                "文件收藏成功"));
+                                                "文件公司共享成功"));
                     }
                     break;
             }

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

@@ -328,7 +328,7 @@ public class ProjectAccessoryService extends TreeService<ProjectAccessoryDao, Pr
                                                 user.getCompany().getId(),
                                                 "文件收藏成功",
                                                 "文件"+collectAccessoryInfo.getFileName()+"部门收藏成功",
-                                                "92",
+                                                "104",
                                                 "0",
                                                 "待通知",
                                                 "文件收藏成功"));
@@ -346,7 +346,7 @@ public class ProjectAccessoryService extends TreeService<ProjectAccessoryDao, Pr
                                                 user.getCompany().getId(),
                                                 "文件收藏成功",
                                                 "文件"+collectAccessoryInfo.getFileName()+"公司收藏成功",
-                                                "92",
+                                                "104",
                                                 "0",
                                                 "待通知",
                                                 "文件收藏成功"));

+ 9 - 0
src/main/java/com/jeeplus/modules/workprojectnotify/web/WorkProjectNotifyController.java

@@ -36,8 +36,10 @@ import com.jeeplus.modules.oabuy.service.OaBuyService;
 import com.jeeplus.modules.oaperformance.entity.OaPerformance;
 import com.jeeplus.modules.oaperformance.service.OaPerformanceService;
 import com.jeeplus.modules.officeintroduce.dao.OfficeintroduceDao;
+import com.jeeplus.modules.projectAccessory.entity.CollectAccessoryInfo;
 import com.jeeplus.modules.projectAccessory.entity.ProjectAccessoryRelationInfo;
 import com.jeeplus.modules.projectAccessory.entity.ProjectTemplateInfo;
+import com.jeeplus.modules.projectAccessory.service.CollectAccessoryService;
 import com.jeeplus.modules.projectAccessory.service.ProjectAccessoryRelationService;
 import com.jeeplus.modules.projectAccessory.service.ProjectTemplateService;
 import com.jeeplus.modules.projectEngineering.entity.ProjectEngineeringInfo;
@@ -483,6 +485,8 @@ public class WorkProjectNotifyController extends BaseController {
 	private SubProjectInfoService subProjectInfoService;
 	@Autowired
 	private WorkProjectNotifyDao workProjectNotifyDao;
+	@Autowired
+	private CollectAccessoryService collectAccessoryService;
 
 	@ModelAttribute
 	public WorkProjectNotify get(@RequestParam(required=false) String id) {
@@ -4509,6 +4513,11 @@ public class WorkProjectNotifyController extends BaseController {
 						return "modules/ruralprojectrecords/view/projectReportRecordView";
 
 					}
+				} else if (workProjectNotify.getType().equals("104")) {    //项目登记
+					CollectAccessoryInfo collectAccessoryInfo = collectAccessoryService.getInfo(workProjectNotify.getNotifyId());
+					model.addAttribute("collectAccessoryInfo", collectAccessoryInfo);
+					return "modules/collectAccessory/collectAccessoryView";
+
 				} else if (workProjectNotify.getType().equals("65")) {    //工作内容报告归档
 					ProjectReportRecord projectReportRecord = ruralProjectRecordsDownMessageService.get(workProjectNotify.getNotifyId());
 					//获取项目信息

+ 143 - 0
src/main/webapp/webpage/modules/collectAccessory/collectAccessoryView.jsp

@@ -0,0 +1,143 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+	<title>收文管理管理</title>
+	<meta name="decorator" content="default"/>
+	<script type="text/javascript">
+		var validateForm;
+		function doSubmit(i){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
+			if(validateForm.form()){
+				$("#inputForm").submit();
+				return true;
+			}
+
+			return false;
+		}
+		$(document).ready(function() {
+			validateForm = $("#inputForm").validate({
+				submitHandler: function(form){
+					loading('正在提交,请稍等...');
+					form.submit();
+				},
+				errorContainer: "#messageBox",
+				errorPlacement: function(error, element) {
+					$("#messageBox").text("输入有误,请先更正。");
+					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
+						error.appendTo(element.parent().parent());
+					} else {
+						error.insertAfter(element);
+					}
+				}
+			});
+			$("#attachment_btn").click(function () {
+				$("#attachment_file").click();
+			});
+		});
+	</script>
+</head>
+<body>
+<div class="single-form">
+	<div class="container">
+		<form:form id="inputForm" modelAttribute="collectAccessoryInfo" action="" method="post" class="form-horizontal">
+			<div class="form-group layui-row">
+				<div class="form-group-label"><h2>文件信息</h2></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>
+				<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 width="50%">文件预览</th>
+							<th>共享人</th>
+							<th>共享时间</th>
+						</tr>
+						</thead>
+						<tbody id="file_attachment">
+							<tr>
+								<input type="hidden" id="projectTemplateId" name="id" value="${collectAccessoryInfo.id}" />
+									<%-- <td>${status.index + 1}</td>--%>
+										<c:choose>
+											<c:when test="${collectAccessoryInfo.uploadMode == 2}">
+												<c:choose>
+													<c:when test="${fn:containsIgnoreCase(collectAccessoryInfo.fileName,'jpg')
+                                                           or fn:containsIgnoreCase(collectAccessoryInfo.fileName,'png')
+                                                           or fn:containsIgnoreCase(collectAccessoryInfo.fileName,'gif')
+                                                           or fn:containsIgnoreCase(collectAccessoryInfo.fileName,'bmp')
+                                                           or fn:containsIgnoreCase(collectAccessoryInfo.fileName,'jpeg')}">
+														<td><img src="${collectAccessoryInfo.temporaryUrl}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${collectAccessoryInfo.temporaryUrl}','90%','90%')" alt="${collectAccessoryInfo.fileName}">
+													</c:when>
+													<c:otherwise>
+														<c:choose>
+															<c:when test="${fn:containsIgnoreCase(collectAccessoryInfo.fileName,'pdf')}">
+																<td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${collectAccessoryInfo.temporaryUrl}',1)">${collectAccessoryInfo.fileName}</a></td>
+															</c:when>
+															<c:otherwise>
+																<td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${collectAccessoryInfo.temporaryUrl}',2)">${collectAccessoryInfo.fileName}</a></td>
+															</c:otherwise>
+														</c:choose>
+													</c:otherwise>
+												</c:choose>
+											</c:when>
+											<c:otherwise>
+												<c:choose>
+													<c:when test="${fn:containsIgnoreCase(collectAccessoryInfo.fileName,'jpg')
+                                                           or fn:containsIgnoreCase(collectAccessoryInfo.fileName,'png')
+                                                           or fn:containsIgnoreCase(collectAccessoryInfo.fileName,'gif')
+                                                           or fn:containsIgnoreCase(collectAccessoryInfo.fileName,'bmp')
+                                                           or fn:containsIgnoreCase(collectAccessoryInfo.fileName,'jpeg')}">
+														<td><img src="${collectAccessoryInfo.url}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${collectAccessoryInfo.url}','90%','90%')" alt="${collectAccessoryInfo.fileName}"></td>
+													</c:when>
+													<c:otherwise>
+														<c:choose>
+															<c:when test="${fn:containsIgnoreCase(collectAccessoryInfo.fileName,'pdf')}">
+																<td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${collectAccessoryInfo.url}',1)">${collectAccessoryInfo.fileName}</a></td>
+															</c:when>
+															<c:otherwise>
+																<td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${collectAccessoryInfo.url}',2)">${collectAccessoryInfo.fileName}</a></td>
+															</c:otherwise>
+														</c:choose>
+													</c:otherwise>
+												</c:choose>
+											</c:otherwise>
+										</c:choose>
+
+								<td>${collectAccessoryInfo.createBy.name}</td>
+								<td><fmt:formatDate value="${collectAccessoryInfo.createDate}" type="both"/></td>
+							</tr>
+						</tbody>
+					</table>
+				</div>
+			</div>
+		</form:form>
+	</div>
+</div>
+<script>
+
+		function collectingAccessory(obj,url,fileUrl,uploadUserId,fileSize){
+		$.ajax({
+			type:"post",
+			url:url,
+			data: {"url":fileUrl,"type":"1","collectType":1,"collectUserId":uploadUserId,"fileSize":fileSize},
+			success:function(data){
+				if(data.success){
+					$(obj).hide()
+					//关闭当前页
+					top.layer.close(index)
+					parent.layer.msg(data.str,{icon:1});
+				}else {
+					parent.layer.msg(data.str,{icon:2});
+				}
+			}
+		});
+	}
+</script>
+</body>
+</html>