其他分享
首页 > 其他分享> > 浦镇质量系统平台-任务管理Week02

浦镇质量系统平台-任务管理Week02

作者:互联网

浦镇质量系统平台-任务管理Week02

菜单设置 taskList.jsp
<div class="tabbable">
           <ul class="nav nav-tabs padding-12 tab-color-blue background-blue" id="myTab2">
               <li class="active">
                   <a data-toggle="tab" href="#taskNcr">NCR任务</a>
               </li>
               <li>
                   <a data-toggle="tab" href="#taskExod">例外转序任务</a>
               </li>
           </ul>
           <div class="tab-content"
                style="padding: 0px 0px;padding-right: 0px;padding-left: 0px;padding-top: 0px;padding-bottom: 0px;">
               <div id="taskNcr" class="tab-pane in active">
                   <table id="ncrgrid-table"></table>
                   <div id="ncrgrid-pager"></div>
               </div>
               <div id="taskExod" class="tab-pane">
                   <table id="exodgrid-table"></table>
                   <div id="exodgrid-pager"></div>
               </div>
           </div>
       </div>
var gridIds = new Array("ncr", "exod");
			var colModel = {};
            colModel['ncr'] = [
                {name: 'id', index: 'id', label: '主键', key: true, hidden: true},
                {name: 'processInstanceId', index: 'processInstanceId', hidden: true},
                {name: 'edit', index: 'edit', label: '操作', width: '60'},
                {name: 'no', index: 'no', label: '编号', width: 210},
                {name: 'openTime', index: 'openTime', label: '开立时间', width: 200},
                {name: 'creatUser', index: 'creatUser', label: '开立人', width: 150},
                {name: 'engineer', index: 'engineer', label: '质量工程师', width: 180},
                {name: 'checkUser', index: 'checkUser', label: '当前处置人', width: 150},
                {name: 'status', index: 'status', label: '状态', width: 150}
            ];
            colModel['exod'] = [
                {name: 'id', index: 'id', label: '主键', key: true, hidden: true},
                {name: 'processInstanceId', index: 'processInstanceId', hidden: true},
                {name: 'edit', index: 'edit', label: '操作', width: '60'},
                {name: 'no', index: 'no', label: '编号', width: 210},
                {name: 'openTime', index: 'openTime', label: '开立时间', width: 200},
                {name: 'creatUser', index: 'creatUser', label: '开立人', width: 150},
                {name: 'engineer', index: 'engineer', label: '质量工程师', width: 180},
                {name: 'checkUser', index: 'checkUser', label: '当前处置人', width: 150},
                {name: 'statusName', index: 'status', label: '状态', width: 150}
            ];
loadGrid(gridIds[0]);
var activeTab = $(e.target)[0].hash;
if (activeTab == "#taskNcr") loadGrid(gridIds[0]);
gridComplete: function () {
                        var ids = jQuery(grid_selector).jqGrid('getDataIDs');
                        for (var i = 0; i < ids.length; i++) {
                            var rowData = $(grid_selector).getRowData(ids[i]);
                            var status = rowData.status;
                            var id = rowData.id;
                            var taskId = rowData.taskId;
                            var btn = '';
                            if (gridId===gridIds[0]) {
                                btn = '<div class="action-buttons" style="white-space:normal">\
                                <a data-action="detail" data-id="' + rowData.id + '" data-processInstanceId="' + rowData.processInstanceId + '"\
                                href="javascript:void(0);" class="tooltip-success green" data-rel="tooltip" title="明细">\
                                <i class="ace-icon fa fa-file-text-o bigger-130"></i></a>\
                                \<a data-action="stop" data-id="' + rowData.id + '" data-taskId="' + rowData.taskId + '" href="javascript:void(0);" class="tooltip-success green" data-rel="tooltip" title="关闭">\
                                <i class="ace-icon fa fa-ban bigger-130 red"></i></a>\
                                </div>';
                            } else {
                                btn = '<div class="action-buttons" style="white-space:normal">\
                                <a data-action="detail2" data-id="' + rowData.id + '" data-processInstanceId="' + rowData.processInstanceId + '"\
                                href="javascript:void(0);" class="tooltip-success green" data-rel="tooltip" title="明细">\
                                <i class="ace-icon fa fa-file-text-o bigger-130"></i></a>\
                                \<a data-action="stop2" data-id="' + rowData.id + '" data-taskId="' + rowData.taskId + '" href="javascript:void(0);" class="tooltip-success green" data-rel="tooltip" title="关闭">\
                                <i class="ace-icon fa fa-ban bigger-130 red"></i></a>\
                                </div>';
                            }
                            jQuery(grid_selector).jqGrid('setRowData', ids[i], {edit: btn});
                        }
                        $(grid_selector).find('a[data-action=detail]').on('click', function (event) {
                            var id = $(this).attr('data-id');
                            var processInstanceId = $(this).attr('data-processInstanceId');
                            _from(id, processInstanceId);
                        });
                        $(grid_selector).find('a[data-action=stop]').on('click', function (event) {
                            var id = $(this).attr('data-id');
                            _stop(id);
                        });
                        $(grid_selector).find('a[data-action=detail2]').on('click', function (event) {
                            var id = $(this).attr('data-id');
                            _from2(id);
                        });
                        $(grid_selector).find('a[data-action=stop2]').on('click', function (event) {
                            var id = $(this).attr('data-id');
                            _stop2(id);
                        });
                    },
                    editurl: "/dummy.html",//nothing is saved
                    caption: "任务列表"
                });
$("#editDivId").html(object.responseText).dialog
TaskManageDao.java TaskManageDao.xml
<select id="findNcrList" resultType="com.dhc.qmis.basisData.entity.TaskManage">
        select
        t.id                  as         "id",
        t.process_instance_id as         "processInstanceId",
        t.no                  as         "no",
        t.create_date         as         "openTime",
        cr.name               as         "creatUser",
        t.status			  as 		 "status",
        e.name                as         "engineer",
        listagg(to_char(cu.name),',')within group (order by cu.name)    as         "checkUser"
        from qmis_ncr_report_info t
        left join llm_invcl li on t.project_id = li.id
        left join llm_wk lw on t.station_id = lw.id
        left join sys_user d on t.dis_user = d.id
        left join sys_user r on r.id = t.ratify_user
        left join sys_user c on c.id = t.close_user
        left join sys_user cr on cr.id = t.create_by
        left join sys_user ap on ap.id = t.appro_user
        left join sys_user a on a.id = t.approva_user
        left join sys_user e on e.id=t.engineer
        left join sys_office off on t.work_shop = off.id
        left join QMIS_BAS_SUPPLIER_INFO spl on spl.id = t.supplier
        left join act_ru_task u on t.process_instance_id = u.proc_inst_id_
        left join act_ru_identitylink i on i.task_id_ = u.id_
        left join sys_user cu on cu.id=i.user_id_
        where t.del_flag = '0' and t.status!='00' and t.status!='01'
        <if test="projectId !=null and projectId !=''">
            and t.project_id = #{projectId}
        </if>
        <if test="creatUser !=null and creatUser !=''">
            and t.create_by = #{creatUser}
        </if>
        <if test="checkUser !=null and checkUser !=''">
            and i.user_id_ = #{checkUser}
        </if>
        <if test="status !=null and status !=''">
            and t.status = #{status}
        </if>
        <if test="beginDate !=null and beginDate !=''">
            and t.create_date &gt;= #{beginDate}
        </if>
        <if test="endDate !=null and endDate !=''">
            and t.create_date &lt;=  #{endDate}+1
        </if>
        <if test="searchList !=null">
            <foreach collection="searchList" index="index" item="search" open="and"
                     separator="and" close="">
                (upper(li.invclassname) LIKE upper(
                <if test="dbName == 'oracle'">'%'||#{search}||'%'</if>
                <if test="dbName == 'mysql'">CONCAT('%', #{search}, '%')</if>
                ) or
                upper(lw.gzzxmc) LIKE upper(
                <if test="dbName == 'oracle'">'%'||#{search}||'%'</if>
                <if test="dbName == 'mysql'">CONCAT('%', #{search}, '%')</if>
                ) or
                upper(t.no) LIKE upper(
                <if test="dbName == 'oracle'">'%'||#{search}||'%'</if>
                <if test="dbName == 'mysql'">CONCAT('%', #{search}, '%')</if>
                ) or
                upper(t.prd_no) LIKE upper(
                <if test="dbName == 'oracle'">'%'||#{search}||'%'</if>
                <if test="dbName == 'mysql'">CONCAT('%', #{search}, '%')</if>
                ) or
                upper(t.work_shop) LIKE upper(
                <if test="dbName == 'oracle'">'%'||#{search}||'%'</if>
                <if test="dbName == 'mysql'">CONCAT('%', #{search}, '%')</if>
                ) or
                upper(off.name) LIKE upper(
                <if test="dbName == 'oracle'">'%'||#{search}||'%'</if>
                <if test="dbName == 'mysql'">CONCAT('%', #{search}, '%')</if>
                ) or
                upper(c.name) LIKE upper(
                <if test="dbName == 'oracle'">'%'||#{search}||'%'</if>
                <if test="dbName == 'mysql'">CONCAT('%', #{search}, '%')</if>
                ) or
                upper(t.supplier) LIKE upper(
                <if test="dbName == 'oracle'">'%'||#{search}||'%'</if>
                <if test="dbName == 'mysql'">CONCAT('%', #{search}, '%')</if>
                ) or
                upper(cr.name) LIKE upper(
                <if test="dbName == 'oracle'">'%'||#{search}||'%'</if>
                <if test="dbName == 'mysql'">CONCAT('%', #{search}, '%')</if>
                ) or
                upper(a.name) LIKE upper(
                <if test="dbName == 'oracle'">'%'||#{search}||'%'</if>
                <if test="dbName == 'mysql'">CONCAT('%', #{search}, '%')</if>
                ) or
                upper(t.prd_name) LIKE upper(
                <if test="dbName == 'oracle'">'%'||#{search}||'%'</if>
                <if test="dbName == 'mysql'">CONCAT('%', #{search}, '%')</if>
                ) or
                upper(ap.name) LIKE upper(
                <if test="dbName == 'oracle'">'%'||#{search}||'%'</if>
                <if test="dbName == 'mysql'">CONCAT('%', #{search}, '%')</if>
                ) or
                upper(t.fault_code) LIKE upper(
                <if test="dbName == 'oracle'">'%'||#{search}||'%'</if>
                <if test="dbName == 'mysql'">CONCAT('%', #{search}, '%')</if>
                )or
                upper(t.ncr_desc) LIKE upper(
                <if test="dbName == 'oracle'">'%'||#{search}||'%'</if>
                <if test="dbName == 'mysql'">CONCAT('%', #{search}, '%')</if>
                )or
                upper(t.mater_code) LIKE upper(
                <if test="dbName == 'oracle'">'%'||#{search}||'%'</if>
                <if test="dbName == 'mysql'">CONCAT('%', #{search}, '%')</if>
                ))
            </foreach>
        </if>
        GROUP BY
        t.id,
        t.process_instance_id,
        t.no,
        cr.name,
        t.status,
        t.create_date,
        e.name
        <choose>
            <when test="page !=null and page.orderBy != null and page.orderBy != ''">
                ORDER BY ${page.orderBy}
            </when>
            <otherwise>
                order by  "status","creatUser","checkUser"
            </otherwise>
        </choose>
    </select>
TaskManage.java TaskManageService.java TaskManageController.java

标签:Week02,upper,search,name,index,平台,浦镇,var,id
来源: https://blog.51cto.com/u_15185289/2783919