Bladeren bron

审批意见模板管理

[user3] 4 jaren geleden
bovenliggende
commit
c974629b0c

+ 9 - 0
src/main/java/com/jeeplus/modules/identification/entity/AuditTemplate.java

@@ -8,6 +8,7 @@ public class AuditTemplate extends DataEntity<AuditTemplate> {
     private String identification;  //模板标识
     private String content; //模板内容
     private String name; //模板标识名称
+    private String officeId; //部门id
 
     public String getIdentification() {
         return identification;
@@ -32,4 +33,12 @@ public class AuditTemplate extends DataEntity<AuditTemplate> {
     public void setName(String name) {
         this.name = name;
     }
+
+    public String getOfficeId() {
+        return officeId;
+    }
+
+    public void setOfficeId(String officeId) {
+        this.officeId = officeId;
+    }
 }

+ 31 - 0
src/main/java/com/jeeplus/modules/identification/service/AuditTemplateService.java

@@ -1,9 +1,14 @@
 package com.jeeplus.modules.identification.service;
 
+import com.jeeplus.common.persistence.Page;
 import com.jeeplus.common.service.CrudService;
+import com.jeeplus.common.utils.MenuStatusEnum;
 import com.jeeplus.modules.identification.dao.AuditTemplateDao;
 import com.jeeplus.modules.identification.entity.AuditTemplate;
+import com.jeeplus.modules.projectFilingBatch.entity.ProjectFilingBatch;
+import com.jeeplus.modules.sys.entity.User;
 import com.jeeplus.modules.sys.utils.UserUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -17,6 +22,32 @@ import java.util.List;
 public class AuditTemplateService  extends CrudService<AuditTemplateDao, AuditTemplate> {
     @Autowired
     private AuditTemplateDao auditTemplateDao;
+
+    /**
+     * 查询列表
+     * @param page          分页对象
+     * @param auditTemplate
+     * @return
+     */
+    @Override
+    public Page<AuditTemplate> findPage(Page<AuditTemplate> page, AuditTemplate auditTemplate){
+        //设置数据权限
+        if(!UserUtils.getUser().isAdmin()) {
+            auditTemplate.setOfficeId(UserUtils.getSelectOffice().getId());
+            auditTemplate.getSqlMap().put("dsf", dataScopeFilter(auditTemplate.getCurrentUser(), "o", "u", "s", MenuStatusEnum.WORK_CLIENT_INFO.getValue()));
+        }
+        int count = dao.queryCount(auditTemplate);
+        page.setCount(count);
+        page.setCountFlag(false);
+        auditTemplate.setPage(page);
+        List<AuditTemplate> auditTemplates = findList(auditTemplate);
+        for (AuditTemplate template:auditTemplates){
+            User user=UserUtils.get(template.getCreateBy().getId());
+            template.setCreateBy(user);
+        }
+        page.setList(auditTemplates);
+        return page;
+    }
     /**
      * 根据标识和当前登录人查找模板信息
      * @param auditTemplate

+ 27 - 3
src/main/java/com/jeeplus/modules/identification/web/AuditTemplateController.java

@@ -46,7 +46,19 @@ public class AuditTemplateController extends BaseController {
      * @param model
      * @return
      */
-    @RequestMapping(value = {"templateList"})
+    @RequestMapping(value = {"list",""})
+    public String list(AuditTemplate auditTemplate, HttpServletRequest request, HttpServletResponse response, Model model) {
+        Page<AuditTemplate> page=auditTemplateService.findPage(new Page<AuditTemplate>(request, response),auditTemplate);
+        model.addAttribute("page",page);
+        model.addAttribute("auditTemplate",auditTemplate);
+        return "modules/identification/AuditTemplateList";
+    }
+    /**
+     * 增加模板页面
+     * @param model
+     * @return
+     */
+    @RequestMapping(value = "templateList")
     public String templateList(AuditTemplate auditTemplate, HttpServletRequest request, HttpServletResponse response, Model model) {
         List<AuditTemplate> auditTemplates=auditTemplateService.findByIdentification(auditTemplate);
         model.addAttribute("auditTemplates",auditTemplates);
@@ -58,13 +70,24 @@ public class AuditTemplateController extends BaseController {
      * @param model
      * @return
      */
-    @RequestMapping(value = {"toSave"})
+    @RequestMapping(value = "toSave")
     public String toSave(AuditTemplate auditTemplate, HttpServletRequest request, HttpServletResponse response, Model model) {
         auditTemplate.setCreateBy(UserUtils.getUser());
         model.addAttribute("auditTemplate",auditTemplate);
         return "modules/identification/AuditTemplateForm";
     }
     /**
+     * 增加模板页面
+     * @param model
+     * @return
+     */
+    @RequestMapping(value = "toAddSave")
+    public String toAddSave(AuditTemplate auditTemplate, HttpServletRequest request, HttpServletResponse response, Model model) {
+        auditTemplate.setCreateBy(UserUtils.getUser());
+        model.addAttribute("auditTemplate",auditTemplate);
+        return "modules/identification/AuditTemplateAddForm";
+    }
+    /**
      * 增加模板信息
      * @param model
      * @return
@@ -72,8 +95,9 @@ public class AuditTemplateController extends BaseController {
     @RequestMapping(value = "save")
     public String save(AuditTemplate auditTemplate, Model model) {
         auditTemplateService.save(auditTemplate);
-        return "redirect:" + adminPath + "/auditTemplate/auditTemplate/?repage";
+        return "redirect:"+Global.getAdminPath()+"/auditTemplate/auditTemplate/?repage";
     }
+
     /**
      * 审核-展示
      * @param model

+ 38 - 3
src/main/resources/mappings/modules/identification/AuditTemplateDao.xml

@@ -11,7 +11,8 @@
 		a.del_flag AS "delFlag",
 		a.name AS "name",
 		a.identification as "identification",
-		a.content as "content"
+		a.content as "content",
+		a.office_id as "officeId"
 	</sql>
 	<select id="get" resultType="com.jeeplus.modules.identification.entity.AuditTemplate" >
 		SELECT
@@ -23,6 +24,18 @@
 		SELECT
 			<include refid="auditColumns"/>
 		FROM audit_template a
+		<where>
+			a.del_flag='0'
+			<if test="sqlMap.dsf !=null and sqlMap.dsf!=''">
+				${sqlMap.dsf}
+			</if>
+			<if test="name !=null and name != ''">
+				and a.name like concat('%',#{name},'%')
+			</if>
+			<if test="content !=null and content != ''">
+				and a.content like concat('%',#{content},'%')
+			</if>
+		</where>
 		<choose>
 			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
 				ORDER BY ${page.orderBy}
@@ -36,6 +49,26 @@
         SELECT
         count(distinct a.id)
         FROM audit_template a
+		<where>
+			a.del_flag='0'
+			<if test="sqlMap.dsf !=null and sqlMap.dsf!=''">
+				${sqlMap.dsf}
+			</if>
+			<if test="name !=null and name != ''">
+				and a.name like concat('%',#{name},'%')
+			</if>
+			<if test="content !=null and content != ''">
+				and a.content like concat('%',#{content},'%')
+			</if>
+		</where>
+		<choose>
+			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
+				ORDER BY ${page.orderBy}
+			</when>
+			<otherwise>
+				ORDER BY a.update_date DESC
+			</otherwise>
+		</choose>
     </select>
 
 	<select id="findAllList" resultType="com.jeeplus.modules.identification.entity.AuditTemplate" >
@@ -80,7 +113,8 @@
 			del_flag,
 			name,
 			identification,
-			content
+			content,
+			office_id
 		) VALUES (
 			#{id},
 			#{createBy.id},
@@ -90,7 +124,8 @@
 			#{delFlag},
 			#{name},
 			#{identification},
-			#{content}
+			#{content},
+			#{createBy.office.id}
 		)
 	</insert>
 

+ 103 - 0
src/main/webapp/webpage/modules/identification/AuditTemplateAddForm.jsp

@@ -0,0 +1,103 @@
+<%@ 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" src="${ctxStatic}/layui/layui.js"></script>
+    <link rel='stylesheet' type="text/css" href="${ctxStatic}/layui/css/layui.css"/>
+    <script src="${ctxStatic}/layer-v2.3/layui/xmSelect.js" charset="utf-8"></script>
+    <style>
+        label.error{
+            top:40px;
+            left:0;
+        }
+        #standardDetail-error{
+            top:82px;
+            left:0;
+        }
+    </style>
+    <script type="text/javascript">
+        var validateForm;
+        function doSubmit(){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
+            if(validateForm.form()){
+                $("#inputForm").submit();
+                return true;
+            }
+            return false;
+        }
+        $(document).ready(function() {
+            layui.use(['form', 'layer'], function () {
+                var form = layui.form;
+                form.on('select(identification)', function(data){
+                   $("#name").val(this.innerHTML)
+                });
+            });
+            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);
+                    }
+                }
+            });
+            var edit = "${workReviewStandard.id}";
+            if(edit!=null && edit!=''){
+                $("#reviewParentButton").attr("disabled","disabled");
+            }
+        });
+    </script>
+</head>
+<body>
+<div class="single-form">
+    <div class="container">
+        <form:form id="inputForm" modelAttribute="auditTemplate" action="${ctx}/auditTemplate/auditTemplate/save" method="post" class="form-horizontal layui-form">
+            <form:hidden path="id"/>
+            <form:hidden path="createBy.name" readonly="true"  htmlEscape="false" class="form-control layui-input"/>
+            <form:hidden path="name" id="name" readonly="true" htmlEscape="false"  class="form-control layui-input"/>
+            <div class="form-group layui-row first">
+                <div class="form-group-label"><h2>审核模板信息</h2></div>
+                <div class="layui-item layui-col-sm6">
+                    <label class="layui-form-label">模板类型:</label>
+                    <div class="layui-input-block">
+                        <select name="identification" lay-filter="identification" >
+                            <option value=""></option>
+                            <option value="workreimbursement">报销审核意见</option>
+                            <option value="workinvoice">发票审核意见</option>
+                            <option value="oaNotify">公告审核意见</option>
+                            <option value="workContractInfo">合同审核意见</option>
+                            <option value="workContractRecord">合同归档审核意见</option>
+                            <option value="workContractBorrow">合同借用审核意见</option>
+                            <option value="ruralprojectrecords">项目登记审核意见</option>
+                            <option value="projectReportDataLeader">新增报告项目组成员审核意见</option>
+                            <option value="projectReportData">报告审核意见</option>
+                            <option value="projectcontentinfoFile">归档审核意见</option>
+                            <option value="ruralprojectrecordsCheck">选查审核意见</option>
+                            <option value="projectFilingBatch">批量归档审核意见</option>
+                        </select>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm12 with-textarea">
+                    <label class="layui-form-label ">模板信息:</label>
+                    <div class="layui-input-block">
+                        <form:textarea path="content" placeholder="请输入模板信息" id="content" htmlEscape="false" rows="4"  maxlength="255"  class="form-control required"/>
+                    </div>
+                </div>
+            </div>
+        </form:form>
+    </div>
+</div>
+<script src="${ctxStatic}/layer-v2.3/layui/layui.all.js" charset="utf-8"></script>
+<script>
+
+
+</script>
+</body>
+</html>

+ 198 - 0
src/main/webapp/webpage/modules/identification/AuditTemplateList.jsp

@@ -0,0 +1,198 @@
+<%@ 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" src="${ctxStatic}/layui/layui.js"></script>
+    <link rel='stylesheet' type="text/css" href="${ctxStatic}/layui/css/layui.css"/>
+    <script src="${ctxStatic}/layer-v2.3/layui/xmSelect.js" charset="utf-8"></script>
+    <style>
+        label.error{
+            top:40px;
+            left:0;
+        }
+        #standardDetail-error{
+            top:82px;
+            left:0;
+        }
+    </style>
+    <script type="text/javascript">
+        var validateForm;
+        function doSubmit(){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
+            if(validateForm.form()){
+                $("#inputForm").submit();
+                return true;
+            }
+            return false;
+        }
+        $(document).ready(function() {
+            layui.use(['form', 'layer'], function () {
+                var form = layui.form;
+            });
+            validateForm = $("#inputForm").validate({
+                submitHandler: function(form){
+                    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);
+                    }
+                }
+            });
+            $("#cus_name").show();
+            $("#cus_name").siblings().hide();
+            //搜索框收放
+            $('#moresee').click(function(){
+                if($('#moresees').is(':visible'))
+                {
+                    $('#moresees').slideUp(0,resizeListWindow4);
+                    $('#moresee i').removeClass("glyphicon glyphicon-menu-up").addClass("glyphicon glyphicon-menu-down");
+                }else{
+                    $('#moresees').slideDown(0,resizeListWindow4);
+                    $('#moresee i').removeClass("glyphicon glyphicon-menu-down").addClass("glyphicon glyphicon-menu-up");
+                }
+            });
+        });
+        function openDialogre(title,url,width,height,target,buttons) {
+            if (navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)) {//如果是移动端,就使用自适应大小弹窗
+                width = 'auto';
+                height = 'auto';
+            } else {//如果是PC端,根据用户设置的width和height显示。
+            }
+            var split = buttons.split(",");
+            top.layer.open({
+                type: 2,
+                area: [width, height],
+                title: title,
+                maxmin: true, //开启最大化最小化按钮
+                skin: 'three-btns',
+                content: url,
+                btn: split,
+                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
+                    }
+                    if(iframeWin.contentWindow.doSubmit(1) ){
+                        top.layer.close(index);//关闭对话框。
+                        setTimeout(function(){
+                            location = '${ctx}/auditTemplate/auditTemplate/list';
+                        }, 100);//延时0.1秒,对应360 7.1版本bug
+                    }
+                },
+                btn2:function(index){
+                }
+            });
+        }
+        function deleteByid(mess, href) {
+            top.layer.confirm(mess, {icon: 3, title:'系统提示'}, function(index){
+                if (typeof href == 'function') {
+                    href();
+                }else{
+                    resetTip(); //loading();
+                    $.ajax({
+                        url:href,
+                        type:"post",
+                        success:function(data){
+                            parent.layer.msg(data,{icon:1});
+                            rereset();
+                        }
+                    });
+                }
+                top.layer.close(index);
+            });
+            return false;
+        }
+        function rereset(){//重置,页码清零
+            $("#pageNo").val(0);
+            $("#inputForm div.query input").val("");
+            $("#inputForm div.query select").val("");
+            $("#inputForm").submit();
+            return false;
+        }
+        function page(n,s){//翻页
+            $("#pageNo").val(n);
+            $("#pageSize").val(s);
+            $("#inputForm").submit();
+            $("span.page-size").text(s);
+            return false;
+        }
+    </script>
+</head>
+<body>
+<%--<div style="margin: 10px 30px;background-color: #FFB800"> <a href="javascript:void(0)"  onclick="openDialogre('添加模板', '${ctx}/auditTemplate/auditTemplate/toSave?identification=${auditTemplate.identification}&name=${auditTemplate.name}','80%', '50%','','添加,关闭')" class="nav-btn layui-btn layui-btn-sm" ><i class="fa fa-file-excel-o"></i> 添加审核意见模板</a></div>--%>
+<form:form id="inputForm"  modelAttribute="auditTemplate"  action="${ctx}/auditTemplate/auditTemplate/" method="post" class="form-inline">
+    <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
+    <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
+    <div class="commonQuery lw6" style="margin-bottom: 20px;">
+        <div class="layui-item query athird">
+            <label class="layui-form-label">模板类型:</label>
+            <div class="layui-input-block">
+                <form:input path="name" htmlEscape="false" maxlength="64"  class=" form-control layui-input"/>
+            </div>
+        </div>
+        <div class="layui-item query athird">
+            <label class="layui-form-label">模板内容:</label>
+            <div class="layui-input-block">
+                <form:input path="content" htmlEscape="false" maxlength="64"   class=" form-control layui-input"/>
+            </div>
+        </div>
+        <div class="layui-item athird">
+            <div class="layui-btn-group search-spacing">
+                <button id="searchQuery" class="layui-btn layui-btn-sm layui-bg-blue" onclick="search()">查询</button>
+                <button id="searchReset" class="layui-btn layui-btn-sm " onclick="rereset()">重置</button>
+            </div>
+        </div>
+        <div style="clear:both;"></div>
+    </div>
+    <div class="single-form">
+        <div class="container" style="width: 95%">
+            <table class="table table-bordered">
+                <thead>
+                    <th>模板类型</th>
+                    <th>模板</th>
+                    <th>创建人</th>
+                    <th>操作</th>
+                </thead>
+                <tbody>
+                    <c:forEach items="${page.list}" var="tem">
+                        <tr align="center" >
+                            <td>${tem.name}</td>
+                            <td>${tem.content}</td>
+                            <td>${tem.createBy.name}</td>
+                            <td>
+                                <div class="layui-btn-group">
+                                    <div class="op-btn-box">
+                                        <a href="${ctx}/auditTemplate/auditTemplate/delete?id=${tem.id}" onclick="return deleteByid('确认要删除该审核模板吗?', this.href)"   class="layui-btn layui-btn-xs layui-bg-red"> 删除</a>
+                                    </div>
+                                    <div class="op-btn-box">
+                                        <a style="color: white" onclick="openDialogre('添加模板', '${ctx}/auditTemplate/auditTemplate/toAddSave','80%', '70%','','添加,关闭')" class="layui-btn layui-btn-xs" >添加审核意见模板</a>
+                                    </div>
+                                </div>
+                            </td>
+                        </tr>
+                    </c:forEach>
+                </tbody>
+            </table>
+            <!-- 分页代码 -->
+            <table:page page="${page}"></table:page>
+        </div>
+    </div>
+</form:form>
+<script src="${ctxStatic}/layer-v2.3/layui/layui.all.js" charset="utf-8"></script>
+<script>
+
+
+</script>
+</body>
+</html>