Browse Source

个人意见

sangwenwei 1 năm trước cách đây
mục cha
commit
c36cd03483

+ 1 - 0
src/main/java/com/jeeplus/common/utils/MenuStatusEnum.java

@@ -83,6 +83,7 @@ public enum MenuStatusEnum {
     DISPUTE_MEDIATION("c0ce72cbeb5d446a946795b0a3b7e4a4","纠纷调解"),
     ELECTRONIC_SIGNATURE("50cfb2ad32814623a976bb7776e87c12","电子用章管理"),
     EBUSINESS_SIGNATURE("976b008b2c0f402ea7015bb15665d1f4","业务用章管理"),
+    PERSON_OPINION("de550330b679418cb43165c4937afa68","个人意见"),
     END("19940722131313","废弃");
 
     private String value;

+ 9 - 0
src/main/java/com/jeeplus/modules/identification/dao/PersonOpinionDao.java

@@ -0,0 +1,9 @@
+package com.jeeplus.modules.identification.dao;
+
+import com.jeeplus.common.persistence.CrudDao;
+import com.jeeplus.common.persistence.annotation.MyBatisDao;
+import com.jeeplus.modules.identification.entity.AuditTemplate;
+
+@MyBatisDao
+public interface PersonOpinionDao extends CrudDao<AuditTemplate> {
+}

+ 57 - 0
src/main/java/com/jeeplus/modules/identification/service/PersonOpinionService.java

@@ -0,0 +1,57 @@
+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.dao.PersonOpinionDao;
+import com.jeeplus.modules.identification.entity.AuditTemplate;
+import com.jeeplus.modules.sys.entity.User;
+import com.jeeplus.modules.sys.utils.UserUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+
+@Service
+@Transactional(readOnly = true)
+public class PersonOpinionService extends CrudService<PersonOpinionDao, AuditTemplate> {
+
+    @Autowired
+    private PersonOpinionDao personOpinionDao;
+
+
+    /**
+     * 查询列表
+     * @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.PERSON_OPINION.getValue()));
+            auditTemplate.setCreateBy(UserUtils.getUser());
+        }
+        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;
+    }
+
+    @Transactional(readOnly = false)
+    public Integer deleteById(AuditTemplate auditTemplate){
+        return personOpinionDao.delete(auditTemplate);
+    }
+
+}

+ 92 - 0
src/main/java/com/jeeplus/modules/identification/web/PersonOpinionController.java

@@ -0,0 +1,92 @@
+package com.jeeplus.modules.identification.web;
+
+import com.jeeplus.common.config.Global;
+import com.jeeplus.common.persistence.Page;
+import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.common.web.BaseController;
+import com.jeeplus.modules.identification.entity.AuditTemplate;
+import com.jeeplus.modules.identification.service.PersonOpinionService;
+import com.jeeplus.modules.sys.utils.UserUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@Controller
+@RequestMapping(value = "${adminPath}/personOpinion/personOpinion")
+public class PersonOpinionController extends BaseController {
+
+    @Autowired
+    private PersonOpinionService personOpinionService;
+
+
+    @ModelAttribute
+    public AuditTemplate get(@RequestParam(required=false) String id) {
+        AuditTemplate entity = null;
+        if (StringUtils.isNotBlank(id)){
+            entity = personOpinionService.get(id);
+        }
+        if (entity == null){
+            entity = new AuditTemplate();
+        }
+        return entity;
+    }
+    /**
+     * 增加模板页面
+     * @param model
+     * @return
+     */
+    @RequestMapping(value = {"list",""})
+    public String list(AuditTemplate auditTemplate, HttpServletRequest request, HttpServletResponse response, Model model) {
+        Page<AuditTemplate> page=personOpinionService.findPage(new Page<AuditTemplate>(request, response),auditTemplate);
+        model.addAttribute("page",page);
+        model.addAttribute("auditTemplate",auditTemplate);
+        return "modules/personOpinion/personOpinionList";
+    }
+
+    /**
+     * 增加模板页面
+     * @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/personOpinion/personOpinionAddForm";
+    }
+    /**
+     * 增加模板信息
+     * @param model
+     * @return
+     */
+    @RequestMapping(value = "save")
+    public String save(AuditTemplate auditTemplate, Model model) {
+        personOpinionService.save(auditTemplate);
+        return "redirect:"+ Global.getAdminPath()+"/personOpinion/personOpinion/?repage";
+    }
+
+    /**
+     * 删除
+     * @param model
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping(value = "delete")
+    public String delete(AuditTemplate auditTemplate, Model model) {
+        try {
+            int i=personOpinionService.deleteById(auditTemplate);
+        }catch (Exception e){
+            return "删除失败";
+        }
+        return "删除成功";
+    }
+
+
+}

+ 127 - 0
src/main/resources/mappings/modules/identification/PersonOpinionDao.xml

@@ -0,0 +1,127 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.jeeplus.modules.identification.dao.PersonOpinionDao">
+    <sql id="auditColumns">
+		distinct a.id AS "id",
+		a.create_by AS "createBy.id",
+		a.create_date AS "createDate",
+		a.update_by AS "updateBy.id",
+		a.update_date AS "updateDate",
+		a.del_flag AS "delFlag",
+		a.name AS "name",
+		a.identification as "identification",
+		a.content as "content",
+		a.office_id as "officeId"
+	</sql>
+
+    <select id="get" resultType="com.jeeplus.modules.identification.entity.AuditTemplate" >
+        SELECT
+        <include refid="auditColumns"/>
+        FROM audit_template a
+        WHERE a.id = #{id}
+    </select>
+    <select id="findList" resultType="com.jeeplus.modules.identification.entity.AuditTemplate" >
+        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>
+            <if test="createBy!=null and createBy!=''">
+                <if test="createBy.id!=null and createBy.id!=''">
+                    And a.create_by = #{createBy.id}
+                </if>
+            </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="queryCount" resultType="int" >
+        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>
+            <if test="createBy!=null and createBy!=''">
+                <if test="createBy.id!=null and createBy.id!=''">
+                    And a.create_by = #{createBy.id}
+                </if>
+            </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>
+
+    <insert id="insert">
+		INSERT INTO audit_template(
+			id,
+			create_by,
+			create_date,
+			update_by,
+			update_date,
+			del_flag,
+			name,
+			identification,
+			content,
+			office_id
+		) VALUES (
+			#{id},
+			#{createBy.id},
+			#{createDate},
+			#{updateBy.id},
+			#{updateDate},
+			#{delFlag},
+			#{name},
+			#{identification},
+			#{content},
+			#{createBy.office.id}
+		)
+	</insert>
+
+    <update id="update">
+		UPDATE audit_template SET
+			update_by = #{updateBy.id},
+			update_date = #{updateDate},
+			identification=#{identification},
+			name = #{name},
+			content=#{content}
+		WHERE id = #{id}
+	</update>
+
+
+    <!--物理删除-->
+    <update id="delete">
+		DELETE FROM audit_template
+		WHERE id = #{id}
+	</update>
+
+</mapper>

+ 103 - 0
src/main/webapp/webpage/modules/personOpinion/personOpinionAddForm.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}/personOpinion/personOpinion/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" <c:if test="${auditTemplate.identification=='workreimbursement'}">selected</c:if> >报销审核意见</option>
+                            <option value="workinvoice" <c:if test="${auditTemplate.identification=='workinvoice'}">selected</c:if> >发票审核意见</option>
+                            <option value="oaNotify" <c:if test="${auditTemplate.identification=='oaNotify'}">selected</c:if> >公告审核意见</option>
+                            <option value="workContractInfo" <c:if test="${auditTemplate.identification=='workContractInfo'}">selected</c:if> >合同审核意见</option>
+                            <option value="workContractRecord" <c:if test="${auditTemplate.identification=='workContractRecord'}">selected</c:if> >合同归档审核意见</option>
+                            <option value="workContractBorrow" <c:if test="${auditTemplate.identification=='workContractBorrow'}">selected</c:if> >合同借用审核意见</option>
+                            <option value="ruralprojectrecords" <c:if test="${auditTemplate.identification=='ruralprojectrecords'}">selected</c:if> >项目登记审核意见</option>
+                            <option value="projectReportDataLeader" <c:if test="${auditTemplate.identification=='projectReportDataLeader'}">selected</c:if> >新增报告项目组成员审核意见</option>
+                            <option value="projectReportData" <c:if test="${auditTemplate.identification=='projectReportData'}">selected</c:if> >报告审核意见</option>
+                            <option value="projectcontentinfoFile"<c:if test="${auditTemplate.identification=='projectcontentinfoFile'}">selected</c:if>>归档审核意见</option>
+                            <option value="ruralprojectrecordsCheck" <c:if test="${auditTemplate.identification=='ruralprojectrecordsCheck'}">selected</c:if> >选查审核意见</option>
+                            <option value="projectFilingBatch" <c:if test="${auditTemplate.identification=='projectFilingBatch'}">selected</c:if> >批量归档审核意见</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>

+ 205 - 0
src/main/webapp/webpage/modules/personOpinion/personOpinionList.jsp

@@ -0,0 +1,205 @@
+<%@ 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}/personOpinion/personOpinion/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>
+
+<form:form id="inputForm"  modelAttribute="auditTemplate"  action="${ctx}/personOpinion/personOpinion/" 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: 98%">
+            <div class="nav-btns">
+                <div class="layui-btn-group" style="float: left">
+                    <button class="layui-btn layui-btn-sm layui-bg-blue" onclick="openDialogre('添加模板', '${ctx}/personOpinion/personOpinion/toAddSave','95%', '95%','','添加,关闭')">&nbsp;添加</button>
+                    <button class="layui-btn layui-btn-sm layui-bg-green" data-toggle="tooltip" data-placement="left" onclick="sortOrRefresh()" title="刷新"> 刷新</button>
+                </div>
+                <div style="clear: both;"></div>
+            </div>
+            <table class="oa-table layui-table">
+                <thead>
+                    <th width="20%">模板类型</th>
+                    <th width="40%">模板</th>
+                    <th width="20%">创建人</th>
+                    <th width="20%">操作</th>
+                </thead>
+                <tbody>
+                    <c:forEach items="${page.list}" var="tem">
+                        <tr align="center" >
+                            <td>${tem.name}</td>
+                            <td><span title="${tem.content}">${tem.content}</span></td>
+                            <td>${tem.createBy.name}</td>
+                            <td>
+                                <div class="layui-btn-group">
+                                    <div class="op-btn-box">
+                                        <a href="${ctx}/personOpinion/personOpinion/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}/personOpinion/personOpinion/toAddSave?id=${tem.id}','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>