瀏覽代碼

首页待办,项目添加作废按钮,通知添加全部只读、批量只读操作

user5 4 年之前
父節點
當前提交
97a7a3a38f

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

@@ -566,8 +566,8 @@ public class RuralProjectRecordsService extends CrudService<RuralProjectRecordsD
             Office office = projectRecords.getOffice();
             office = officeService.get(office.getId());
             projectRecords.setOffice(office);
-            String contentStr = "项目编号:"+projectRecords.getProjectId()+",项目名称:"+ projectRecords.getProjectName()+",创建人:"+projectRecords.getCreateBy().getName()+",所属部门:"+projectRecords.getOffice().getName();
-            String titleStr = "项目名称:"+ projectRecords.getProjectName();
+            String contentStr = "项目【"+ projectRecords.getProjectName()+"】待审批,项目编号:"+projectRecords.getProjectId();
+            String titleStr = "项目【"+ projectRecords.getProjectName()+"】待审批";
 
             String businessKey = projectRecords.getId();
 
@@ -950,7 +950,9 @@ public class RuralProjectRecordsService extends CrudService<RuralProjectRecordsD
 					workProjectNotifyService.save(workProjectNotify1);
 				}
 			}else {
-				if (!"yes".equals(projectRecords.getAct().getFlag())) {
+				if (!"yes".equals(projectRecords.getAct().getFlag())) {//驳回待办提醒
+					str = "项目【"+ projectRecords.getProjectName()+"】需重新修改定义,项目编号:"+projectRecords.getProjectId();
+					titleStr = "项目【"+ projectRecords.getProjectName()+"】需重新修改定义";
 					WorkProjectNotify notify = new WorkProjectNotify();
 					notify.setNotifyId(projectRecords.getId());
 					userList = workProjectNotifyService.readByNotifyId(notify);

+ 18 - 0
src/main/java/com/jeeplus/modules/sys/web/LoginController.java

@@ -18,7 +18,9 @@ import com.jeeplus.modules.iim.service.MailBoxService;
 import com.jeeplus.modules.oa.entity.OaNotify;
 import com.jeeplus.modules.oa.service.OaNotifyService;
 import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecordReportInfo;
+import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecords;
 import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectRecordReportService;
+import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectRecordsService;
 import com.jeeplus.modules.sys.dao.UserDao;
 import com.jeeplus.modules.sys.entity.Office;
 import com.jeeplus.modules.sys.entity.Role;
@@ -87,6 +89,8 @@ public class LoginController extends BaseController{
 	private WorkCalendarService workCalendarService;
 	@Autowired
 	private RuralProjectRecordReportService ruralProjectRecordReportService;
+	@Autowired
+	private RuralProjectRecordsService ruralProjectRecordsService;
 
 	/**
 	 * 管理登录
@@ -412,6 +416,20 @@ public class LoginController extends BaseController{
 		workProjectNotify.setRemarks("待审批");
 		//待办事项
 		Page<WorkProjectNotify> notifyPage = workProjectNotifyService.findPage(new Page<WorkProjectNotify>(request, response), workProjectNotify);
+		if(notifyPage.getList().size()>0){
+			for (WorkProjectNotify info: notifyPage.getList()) {
+				//对项目进行处理,工程咨询,造价审核可添加作废按钮
+				if("39".equals(info.getType())){
+					RuralProjectRecords ruralProjectRecords = ruralProjectRecordsService.get(info.getNotifyId());
+					if(null != ruralProjectRecords) {
+						info.setProjectType(ruralProjectRecords.getProjectType());
+					}
+					else{
+						info.setProjectType("");
+					}
+				}
+			}
+		}
 		model.addAttribute("notifyPage", notifyPage.getList());
 		model.addAttribute("notifyCount", notifyPage.getList().size());//未读通知条数
 		model.addAttribute("notifyCount1", notifyPage.getCount());//未读通知条数

+ 6 - 0
src/main/java/com/jeeplus/modules/workprojectnotify/dao/WorkProjectNotifyDao.java

@@ -78,4 +78,10 @@ public interface WorkProjectNotifyDao extends CrudDao<WorkProjectNotify> {
      * @param processInstanceId
      */
     void deleteActivityProcessUser(String processInstanceId);
+
+    /**
+     * 通知消息 只读操作
+     * @param workProjectNotify
+     */
+    void readNotify(WorkProjectNotify workProjectNotify);
 }

+ 9 - 0
src/main/java/com/jeeplus/modules/workprojectnotify/entity/WorkProjectNotify.java

@@ -36,6 +36,7 @@ public class WorkProjectNotify extends DataEntity<WorkProjectNotify> {
 	private Date endDate;
 	private String userName;
 	private String view;
+	private String projectType;  //项目类型
 
 	public WorkProjectNotify() {
 		super();
@@ -187,4 +188,12 @@ public class WorkProjectNotify extends DataEntity<WorkProjectNotify> {
 	public void setView(String view) {
 		this.view = view;
 	}
+
+	public String getProjectType() {
+		return projectType;
+	}
+
+	public void setProjectType(String projectType) {
+		this.projectType = projectType;
+	}
 }

+ 8 - 0
src/main/java/com/jeeplus/modules/workprojectnotify/service/WorkProjectNotifyService.java

@@ -254,5 +254,13 @@ public class WorkProjectNotifyService extends CrudService<WorkProjectNotifyDao,
 	}
 
 
+	/**
+	 * 通知信息只读
+	 * @param workProjectNotify
+	 */
+	@Transactional(readOnly = false)
+	public void readNotify(WorkProjectNotify workProjectNotify) {
+		dao.readNotify(workProjectNotify);
+	}
 
 }

+ 65 - 2
src/main/java/com/jeeplus/modules/workprojectnotify/web/WorkProjectNotifyController.java

@@ -57,6 +57,7 @@ import com.jeeplus.modules.projectrecord.service.ProjectRecordsService;
 import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecords;
 import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecordsAlter;
 import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecordsReported;
+import com.jeeplus.modules.ruralprojectrecords.enums.ProjectStatusEnum;
 import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectMessageService;
 import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectRecordsAlterService;
 import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectRecordsService;
@@ -214,6 +215,7 @@ import org.activiti.engine.HistoryService;
 import org.activiti.engine.history.HistoricProcessInstance;
 import org.activiti.engine.runtime.ProcessInstance;
 import org.activiti.engine.task.Task;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
@@ -908,6 +910,45 @@ public class WorkProjectNotifyController extends BaseController {
 	}
 
 	/**
+	 * 批量只读通知信息
+	 */
+	@RequestMapping(value = "readRows")
+	@ResponseBody
+	public Map<String,Object> readRows(String ids) {
+		Map map = new HashMap();
+		String idArray[] =ids.split(",");
+		for(String id : idArray){
+			workProjectNotifyService.readNotify(workProjectNotifyService.get(id));
+		}
+		map.put("code",1);
+		map.put("msg","通知信息批量只读成功");
+		return map;
+	}
+
+	/**
+	 * 全部只读通知信息
+	 */
+	@RequestMapping(value = "readAll")
+	@ResponseBody
+	public Map<String,Object> readAll(WorkProjectNotify workProjectNotify,HttpServletRequest request, HttpServletResponse response) {
+		Map map = new HashMap();
+		User user = UserUtils.getUser();
+		workProjectNotify.setUser(user);
+		workProjectNotify.setStatus("0");
+		workProjectNotify.setRemarks("待通知");
+		workProjectNotify.setCompanyId(UserUtils.getSelectCompany().getId());
+		List<WorkProjectNotify> notifyList = workProjectNotifyService.findList(workProjectNotify);
+		if(notifyList.size()>0){
+			for(WorkProjectNotify notify : notifyList){
+				workProjectNotifyService.readNotify(workProjectNotifyService.get(notify.getId()));
+			}
+		}
+		map.put("code",1);
+		map.put("msg","通知信息全部只读成功");
+		return map;
+	}
+
+	/**
 	 * 已读通知列表页面
 	 */
 	@RequestMapping(value = {"listReadShow"})
@@ -1215,7 +1256,7 @@ public class WorkProjectNotifyController extends BaseController {
 					//通过通知信息id获取项目登记对象
 					ProjectRecords projectRecords = projectRecordsService.get(workProjectNotify.getNotifyId());
 					RuralProjectRecords ruralProjectRecords = ruralProjectRecordsService.get(workProjectNotify.getNotifyId());
-					if (projectRecords != null && StringUtils.isNotBlank(projectRecords.getId())) {
+					if (projectRecords != null && "3".equals(projectRecords.getProjectType())) {
 						projectRecordsService.queryProjectDetail(projectRecords);
 						flag = true;
 					}
@@ -3228,6 +3269,28 @@ public class WorkProjectNotifyController extends BaseController {
 		model.addAttribute("processInstanceId", processInstanceId);
 		return "modules/workprojectnotify/workProjectNotifyTask";
 	}
-	
+
+	/**
+	 * 删除项目
+	 */
+	@RequestMapping(value = "deleteNotify")
+	@ResponseBody
+	public Map<String,String> deleteNotify(WorkProjectNotify workProjectNotify, RedirectAttributes redirectAttributes) {
+		Map map = new HashMap();
+		if (workProjectNotify.getType().equals("39")) {    //项目登记
+			RuralProjectRecords projectRecords = ruralProjectRecordsService.get(workProjectNotify.getNotifyId());
+			int status = projectRecords.getProjectStatus();
+			if(status== ProjectStatusEnum.TSTORE.getValue()||status== ProjectStatusEnum.REJECTED.getValue()||status== ProjectStatusEnum.RECALL.getValue()){
+				ruralProjectRecordsService.delete(projectRecords);
+				map.put("code",1);
+				map.put("msg","作废项目成功");
+			}else{
+				map.put("code",0);
+				map.put("msg","作废项目失败,只有“暂存”、“驳回”、“撤回”状态的项目才能作废");
+			}
+		}
+		return map;
+	}
+
 
 }

+ 8 - 0
src/main/resources/mappings/modules/workprojectnotify/WorkProjectNotifyDao.xml

@@ -673,5 +673,13 @@
 		</choose>
 		) b
 	</select>
+
+	<update id="readNotify">
+	update
+	  work_project_notify
+	set
+	  status = 2
+	where id = #{id}
+	</update>
 	
 </mapper>

+ 64 - 1
src/main/webapp/webpage/modules/sys/sysHome.jsp

@@ -119,6 +119,62 @@
                 }
             });
         }
+
+        function projectDialogres(title,url,deleteUrl,width,height,target) {
+            parent.index = "";
+            if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端,就使用自适应大小弹窗
+                width='auto';
+                height='auto';
+            }else{//如果是PC端,根据用户设置的width和height显示。
+
+            }
+            top.layer.open({
+                type: 2,
+                area: [width, height],
+                title: title,
+                maxmin: true, //开启最大化最小化按钮
+                content: url ,
+                skin: 'three-btns',
+                btn: ['重新申请','作废', '关闭'],
+                btn1: function (index, layero) {
+                    var body = top.layer.getChildFrame('body', index);
+                    var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+                    var inputForm = body.find('#inputForm');
+                    var top_iframe;
+                    if (target) {
+                        top_iframe = target;//如果指定了iframe,则在改frame中跳转
+                    } else {
+                        top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+                    }
+                    inputForm.attr("target", top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+                    if (iframeWin.contentWindow.doSubmit(3)) {
+                        top.layer.close(index);//关闭对话框。
+                        setTimeout(function () {
+                            top.layer.close(index)
+                        }, 100);//延时0.1秒,对应360 7.1版本bug
+                    }
+                },
+                btn2:function(index,layero){
+                    top.layer.confirm("项目作废", {icon: 3, title:'系统提示'}, function(index){
+                        $.ajax({
+                            type:'post',
+                            url:deleteUrl,
+                            success:function(data){
+                                top.layer.closeAll();//关闭所有对话框。
+                                if(data.code == 1){
+                                    top.layer.msg(data.msg, {icon: 1});
+                                }else{
+                                    top.layer.msg(data.msg, {icon: 0});
+                                }
+                                window.location.reload();
+                            }
+                        })
+                    });
+                    return false;
+                },cancel: function(index){
+                }
+            });
+        }
         function openDialogresExample(title,url,width,height,target) {
             parent.index = "";
             if (navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)) {//如果是移动端,就使用自适应大小弹窗
@@ -788,7 +844,14 @@
                     xml = "<a  href=\"javascript:void(0)\" onclick=\"openDialogres('重新申请', '${ctx}/workprojectnotify/workProjectNotify/form?id=${workProjectNotify.id}','95%','95%')\">";
                 </c:when>
                 <c:when test="${workProjectNotify.remarks eq '重新申请'  && workProjectNotify.status != 1}">
-                    xml = "<a  href=\"javascript:void(0)\" onclick=\"openDialogres('重新申请', '${ctx}/workprojectnotify/workProjectNotify/form?id=${workProjectNotify.id}','95%','95%')\">";
+                    <c:choose>
+                        <c:when test="${workProjectNotify.type eq 39 && (workProjectNotify.projectType eq 1 || workProjectNotify.projectType eq 2)}">
+                            xml = "<a  href=\"javascript:void(0)\" onclick=\"projectDialogres('重新申请', '${ctx}/workprojectnotify/workProjectNotify/form?id=${workProjectNotify.id}','${ctx}/workprojectnotify/workProjectNotify/deleteNotify?id=${workProjectNotify.id}','95%','95%')\">";
+                        </c:when>
+                        <c:otherwise>
+                            xml = "<a  href=\"javascript:void(0)\" onclick=\"openDialogres('重新申请', '${ctx}/workprojectnotify/workProjectNotify/form?id=${workProjectNotify.id}','95%','95%')\">";
+                        </c:otherwise>
+                    </c:choose>
                 </c:when>
                 <c:when test="${workProjectNotify.type eq 86}">
                   xml = "<a href=\"javascript:void(0)\" onclick=\"openDialogre('档案信息修改申请', '${ctx}/workprojectnotify/workProjectNotify/form?id=${workProjectNotify.id}','95%','95%')\">";

+ 57 - 1
src/main/webapp/webpage/modules/workprojectnotify/workProjectNotifyShowList.jsp

@@ -172,6 +172,8 @@
 		<div class="full-width fl">
 			<div class="contentShadow layui-form contentDetails">
 				<div class="nav-btns">
+					<button id="readRows" class="nav-btn nav-btn-edit"><i class="fa fa-eye"> 批量只读</i></button>
+					<button id="readAll" class="nav-btn nav-btn-delete"><i class="fa fa-eye"> 全部只读</i></button>
 					<button class="nav-btn nav-btn-refresh" data-toggle="tooltip" data-placement="left" onclick="sortOrRefresh()" title="刷新"><i class="glyphicon glyphicon-repeat"></i>&nbsp;刷新</button>
 					<div style="clear: both;"></div>
 				</div>
@@ -193,7 +195,7 @@
             ,elem: '#contentTable'
             ,page: false
             ,cols: [[
-                // {checkbox: true, fixed: true},
+				{checkbox: true, fixed: true},
                 {field:'index',align:'center',  width:40,title: '序号'}
                 ,{align:'center', title: '类型', width:100,templet:function(d){
                         return "<span title='"+ d.type1 +"'>" + d.type1 + "</span>";
@@ -294,6 +296,60 @@
             // ,height: 315
         });
 
+		function readRows(){
+			var checkStatus = layui.table.checkStatus('contentTable');
+			var data = checkStatus.data;
+			var ids="";
+			for(var i = 0; i < data.length;i++)
+			{
+				if(i != 0)
+					ids += "," + data[i].id;
+				else
+					ids += data[i].id;
+			}
+
+			if(ids == ""){
+				top.layer.alert('请至少选择一条数据!', {icon: 0, title:'警告'});
+				return;
+			}
+			top.layer.confirm('确认要将标记信息只读吗?', {icon: 3, title:'系统提示'}, function(index){
+				$.ajax({
+					type:'post',
+					url:"/a/workprojectnotify/workProjectNotify/readRows?ids="+ids,
+					success:function(data){
+						top.layer.close(index);
+						if(data.code == 1){
+							top.layer.msg(data.msg, {icon: 1});
+						}else{
+							top.layer.msg(data.msg, {icon: 0});
+						}
+						window.location.reload();
+					}
+				})
+			});
+		}
+		$('#readRows').on('click',readRows);
+		$('#readAll').on('click',readAll);
+		function readAll(){
+			var content = $("#content").val();
+			var type = $("#type").val();
+			top.layer.confirm('确认要将所有信息标记只读吗?', {icon: 3, title:'系统提示'}, function(index){
+				$.ajax({
+					type:'post',
+					url:"/a/workprojectnotify/workProjectNotify/readAll",
+					data: {"content":content,"type":type},
+					success:function(data){
+						top.layer.close(index);
+						if(data.code == 1){
+							top.layer.msg(data.msg, {icon: 1});
+						}else{
+							top.layer.msg(data.msg, {icon: 0});
+						}
+						window.location.reload();
+					}
+				})
+			});
+		}
     })
 
     resizeListTable(140);