Przeglądaj źródła

最近在线客服

suochencheng 7 lat temu
rodzic
commit
20711fa0e1

+ 2 - 0
src/main/java/com/izouma/awesomeadmin/dao/CustomerServiceMapper.java

@@ -29,5 +29,7 @@ public interface CustomerServiceMapper{
     CustomerService queryCustomerService(CustomerService record);
 
     List<CustomerService> query(CustomerService record);
+
+    List<CustomerService> getRecentlyLoginList(CustomerService record);
 }
 

+ 243 - 216
src/main/java/com/izouma/awesomeadmin/dao/CustomerServiceMapper.xml

@@ -1,24 +1,24 @@
 <?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.izouma.awesomeadmin.dao.CustomerServiceMapper" >
-    <resultMap id="BaseResultMap" type="com.izouma.awesomeadmin.model.CustomerService" >
-                <id column="id" property="id" jdbcType="INTEGER" />
-                                        <result column="del_flag" property="delFlag" jdbcType="CHAR" />
-                                <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
-                                <result column="update_user" property="updateUser" jdbcType="VARCHAR" />
-                                <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
-                                <result column="create_user" property="createUser" jdbcType="VARCHAR" />
-                                <result column="store_id" property="storeId" jdbcType="VARCHAR" />
-                                <result column="service_name" property="serviceName" jdbcType="VARCHAR" />
-                                <result column="password" property="password" jdbcType="VARCHAR" />
-                                <result column="username" property="username" jdbcType="VARCHAR" />
-                                <result column="icon" property="icon" jdbcType="VARCHAR" />
-                                <result column="use_flag" property="useFlag" jdbcType="CHAR" />
-                                <result column="status_flag" property="statusFlag" jdbcType="INTEGER" />
-                                <result column="login_time" property="loginTime" jdbcType="TIMESTAMP" />
-            </resultMap>
-    <sql id="Base_Column_List" >
-        <trim  suffixOverrides="," >
+<mapper namespace="com.izouma.awesomeadmin.dao.CustomerServiceMapper">
+    <resultMap id="BaseResultMap" type="com.izouma.awesomeadmin.model.CustomerService">
+        <id column="id" property="id" jdbcType="INTEGER"/>
+        <result column="del_flag" property="delFlag" jdbcType="CHAR"/>
+        <result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
+        <result column="update_user" property="updateUser" jdbcType="VARCHAR"/>
+        <result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
+        <result column="create_user" property="createUser" jdbcType="VARCHAR"/>
+        <result column="store_id" property="storeId" jdbcType="VARCHAR"/>
+        <result column="service_name" property="serviceName" jdbcType="VARCHAR"/>
+        <result column="password" property="password" jdbcType="VARCHAR"/>
+        <result column="username" property="username" jdbcType="VARCHAR"/>
+        <result column="icon" property="icon" jdbcType="VARCHAR"/>
+        <result column="use_flag" property="useFlag" jdbcType="CHAR"/>
+        <result column="status_flag" property="statusFlag" jdbcType="INTEGER"/>
+        <result column="login_time" property="loginTime" jdbcType="TIMESTAMP"/>
+    </resultMap>
+    <sql id="Base_Column_List">
+        <trim suffixOverrides=",">
             id,
 
             del_flag,
@@ -47,155 +47,156 @@
 
             login_time,
 
-            </trim>
+        </trim>
     </sql>
-    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
+    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer">
         select
-        <include refid="Base_Column_List" />
+        <include refid="Base_Column_List"/>
         from customer_service
         where id = #{id,jdbcType=INTEGER}
     </select>
-    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
         delete from customer_service
         where id = #{id,jdbcType=INTEGER}
     </delete>
-    <insert id="insertSelective" parameterType="com.izouma.awesomeadmin.model.CustomerService" useGeneratedKeys="true" keyProperty="id">
+    <insert id="insertSelective" parameterType="com.izouma.awesomeadmin.model.CustomerService" useGeneratedKeys="true"
+            keyProperty="id">
         insert into customer_service
-        <trim prefix="(" suffix=")" suffixOverrides="," >
-                <if test="id!= null" >
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id!= null">
                 id,
             </if>
-                <if test="delFlag!= null" >
+            <if test="delFlag!= null">
                 del_flag,
             </if>
-                <if test="updateTime!= null" >
+            <if test="updateTime!= null">
                 update_time,
             </if>
-                <if test="updateUser!= null" >
+            <if test="updateUser!= null">
                 update_user,
             </if>
-                <if test="createTime!= null" >
+            <if test="createTime!= null">
                 create_time,
             </if>
-                <if test="createUser!= null" >
+            <if test="createUser!= null">
                 create_user,
             </if>
-                <if test="storeId!= null" >
+            <if test="storeId!= null">
                 store_id,
             </if>
-                <if test="serviceName!= null" >
+            <if test="serviceName!= null">
                 service_name,
             </if>
-                <if test="password!= null" >
+            <if test="password!= null">
                 password,
             </if>
-                <if test="username!= null" >
+            <if test="username!= null">
                 username,
             </if>
-                <if test="icon!= null" >
+            <if test="icon!= null">
                 icon,
             </if>
-                <if test="useFlag!= null" >
+            <if test="useFlag!= null">
                 use_flag,
             </if>
-                <if test="statusFlag!= null" >
+            <if test="statusFlag!= null">
                 status_flag,
             </if>
-                <if test="loginTime!= null" >
+            <if test="loginTime!= null">
                 login_time,
             </if>
-            </trim>
-        <trim prefix="values (" suffix=")" suffixOverrides="," >
-                    <if test="id != null" >
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">
                 #{id,jdbcType=INTEGER},
             </if>
-                    <if test="delFlag != null" >
+            <if test="delFlag != null">
                 #{delFlag,jdbcType=CHAR},
             </if>
-                    <if test="updateTime != null" >
+            <if test="updateTime != null">
                 #{updateTime,jdbcType=TIMESTAMP},
             </if>
-                    <if test="updateUser != null" >
+            <if test="updateUser != null">
                 #{updateUser,jdbcType=VARCHAR},
             </if>
-                    <if test="createTime != null" >
+            <if test="createTime != null">
                 #{createTime,jdbcType=TIMESTAMP},
             </if>
-                    <if test="createUser != null" >
+            <if test="createUser != null">
                 #{createUser,jdbcType=VARCHAR},
             </if>
-                    <if test="storeId != null" >
+            <if test="storeId != null">
                 #{storeId,jdbcType=VARCHAR},
             </if>
-                    <if test="serviceName != null" >
+            <if test="serviceName != null">
                 #{serviceName,jdbcType=VARCHAR},
             </if>
-                    <if test="password != null" >
+            <if test="password != null">
                 #{password,jdbcType=VARCHAR},
             </if>
-                    <if test="username != null" >
+            <if test="username != null">
                 #{username,jdbcType=VARCHAR},
             </if>
-                    <if test="icon != null" >
+            <if test="icon != null">
                 #{icon,jdbcType=VARCHAR},
             </if>
-                    <if test="useFlag != null" >
+            <if test="useFlag != null">
                 #{useFlag,jdbcType=CHAR},
             </if>
-                    <if test="statusFlag != null" >
+            <if test="statusFlag != null">
                 #{statusFlag,jdbcType=INTEGER},
             </if>
-                    <if test="loginTime != null" >
+            <if test="loginTime != null">
                 #{loginTime,jdbcType=TIMESTAMP},
             </if>
-                </trim>
+        </trim>
     </insert>
-    <update id="updateByPrimaryKeySelective" parameterType="com.izouma.awesomeadmin.model.CustomerService" >
+    <update id="updateByPrimaryKeySelective" parameterType="com.izouma.awesomeadmin.model.CustomerService">
         update customer_service
-        <set >
-                    <if test="id != null" >
-               id= #{id,jdbcType=INTEGER},
+        <set>
+            <if test="id != null">
+                id= #{id,jdbcType=INTEGER},
             </if>
-                     <if test="delFlag != null" >
-               del_flag= #{delFlag,jdbcType=CHAR},
+            <if test="delFlag != null">
+                del_flag= #{delFlag,jdbcType=CHAR},
             </if>
-                     <if test="updateTime != null" >
-               update_time= #{updateTime,jdbcType=TIMESTAMP},
+            <if test="updateTime != null">
+                update_time= #{updateTime,jdbcType=TIMESTAMP},
             </if>
-                     <if test="updateUser != null" >
-               update_user= #{updateUser,jdbcType=VARCHAR},
+            <if test="updateUser != null">
+                update_user= #{updateUser,jdbcType=VARCHAR},
             </if>
-                     <if test="createTime != null" >
-               create_time= #{createTime,jdbcType=TIMESTAMP},
+            <if test="createTime != null">
+                create_time= #{createTime,jdbcType=TIMESTAMP},
             </if>
-                     <if test="createUser != null" >
-               create_user= #{createUser,jdbcType=VARCHAR},
+            <if test="createUser != null">
+                create_user= #{createUser,jdbcType=VARCHAR},
             </if>
-                     <if test="storeId != null" >
-               store_id= #{storeId,jdbcType=VARCHAR},
+            <if test="storeId != null">
+                store_id= #{storeId,jdbcType=VARCHAR},
             </if>
-                     <if test="serviceName != null" >
-               service_name= #{serviceName,jdbcType=VARCHAR},
+            <if test="serviceName != null">
+                service_name= #{serviceName,jdbcType=VARCHAR},
             </if>
-                     <if test="password != null" >
-               password= #{password,jdbcType=VARCHAR},
+            <if test="password != null">
+                password= #{password,jdbcType=VARCHAR},
             </if>
-                     <if test="username != null" >
-               username= #{username,jdbcType=VARCHAR},
+            <if test="username != null">
+                username= #{username,jdbcType=VARCHAR},
             </if>
-                     <if test="icon != null" >
-               icon= #{icon,jdbcType=VARCHAR},
+            <if test="icon != null">
+                icon= #{icon,jdbcType=VARCHAR},
             </if>
-                     <if test="useFlag != null" >
-               use_flag= #{useFlag,jdbcType=CHAR},
+            <if test="useFlag != null">
+                use_flag= #{useFlag,jdbcType=CHAR},
             </if>
-                     <if test="statusFlag != null" >
-               status_flag= #{statusFlag,jdbcType=INTEGER},
+            <if test="statusFlag != null">
+                status_flag= #{statusFlag,jdbcType=INTEGER},
             </if>
-                     <if test="loginTime != null" >
-               login_time= #{loginTime,jdbcType=TIMESTAMP},
+            <if test="loginTime != null">
+                login_time= #{loginTime,jdbcType=TIMESTAMP},
             </if>
-                 </set>
+        </set>
         where
         <if test="id != null and !&quot;&quot;.equals(id)">
             id = #{id,jdbcType=INTEGER}
@@ -206,67 +207,70 @@
         </if>
 
     </update>
-    <select id="queryCustomerServiceByPage" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.CustomerService">
-        select <include refid="Base_Column_List"/> from customer_service
+    <select id="queryCustomerServiceByPage" parameterType="java.util.Map"
+            resultType="com.izouma.awesomeadmin.model.CustomerService">
+        select
+        <include refid="Base_Column_List"/>
+        from customer_service
         <where>
             and del_flag = 'N'
             <if test="record.idStr != null and !&quot;&quot;.equals(record.idStr)">
                 and id in (${record.idStr})
             </if>
-                    <if test="record.id != null and !&quot;&quot;.equals(record.id)">
-                and  id = #{record.id}
+            <if test="record.id != null and !&quot;&quot;.equals(record.id)">
+                and id = #{record.id}
             </if>
-                     <if test="record.delFlag != null and !&quot;&quot;.equals(record.delFlag)">
-                and  del_flag = #{record.delFlag}
+            <if test="record.delFlag != null and !&quot;&quot;.equals(record.delFlag)">
+                and del_flag = #{record.delFlag}
             </if>
-                     <if test="record.updateTime != null and !&quot;&quot;.equals(record.updateTime)">
-                and  update_time = #{record.updateTime}
+            <if test="record.updateTime != null and !&quot;&quot;.equals(record.updateTime)">
+                and update_time = #{record.updateTime}
             </if>
-                     <if test="record.updateUser != null and !&quot;&quot;.equals(record.updateUser)">
-                and  update_user = #{record.updateUser}
+            <if test="record.updateUser != null and !&quot;&quot;.equals(record.updateUser)">
+                and update_user = #{record.updateUser}
             </if>
-                     <if test="record.createTime != null and !&quot;&quot;.equals(record.createTime)">
-                and  create_time = #{record.createTime}
+            <if test="record.createTime != null and !&quot;&quot;.equals(record.createTime)">
+                and create_time = #{record.createTime}
             </if>
-                     <if test="record.createUser != null and !&quot;&quot;.equals(record.createUser)">
-                and  create_user = #{record.createUser}
+            <if test="record.createUser != null and !&quot;&quot;.equals(record.createUser)">
+                and create_user = #{record.createUser}
             </if>
-                     <if test="record.storeId != null and !&quot;&quot;.equals(record.storeId)">
-                and  store_id = #{record.storeId}
+            <if test="record.storeId != null and !&quot;&quot;.equals(record.storeId)">
+                and store_id = #{record.storeId}
             </if>
-                     <if test="record.serviceName != null and !&quot;&quot;.equals(record.serviceName)">
-                and  service_name = #{record.serviceName}
+            <if test="record.serviceName != null and !&quot;&quot;.equals(record.serviceName)">
+                and service_name = #{record.serviceName}
             </if>
-                     <if test="record.password != null and !&quot;&quot;.equals(record.password)">
-                and  password = #{record.password}
+            <if test="record.password != null and !&quot;&quot;.equals(record.password)">
+                and password = #{record.password}
             </if>
-                     <if test="record.username != null and !&quot;&quot;.equals(record.username)">
-                and  username = #{record.username}
+            <if test="record.username != null and !&quot;&quot;.equals(record.username)">
+                and username = #{record.username}
             </if>
-                     <if test="record.icon != null and !&quot;&quot;.equals(record.icon)">
-                and  icon = #{record.icon}
+            <if test="record.icon != null and !&quot;&quot;.equals(record.icon)">
+                and icon = #{record.icon}
             </if>
-                     <if test="record.useFlag != null and !&quot;&quot;.equals(record.useFlag)">
-                and  use_flag = #{record.useFlag}
+            <if test="record.useFlag != null and !&quot;&quot;.equals(record.useFlag)">
+                and use_flag = #{record.useFlag}
             </if>
-                     <if test="record.statusFlag != null and !&quot;&quot;.equals(record.statusFlag)">
-                and  status_flag = #{record.statusFlag}
+            <if test="record.statusFlag != null and !&quot;&quot;.equals(record.statusFlag)">
+                and status_flag = #{record.statusFlag}
             </if>
-                     <if test="record.loginTime != null and !&quot;&quot;.equals(record.loginTime)">
-                and  login_time = #{record.loginTime}
+            <if test="record.loginTime != null and !&quot;&quot;.equals(record.loginTime)">
+                and login_time = #{record.loginTime}
+            </if>
+            <if test="record.searchKey != null and !&quot;&quot;.equals(record.searchKey)">
+                <trim prefix="and (" suffix=")" prefixOverrides="OR">
+                    OR store_id LIKE concat('%',#{record.searchKey},'%')
+                    OR service_name LIKE concat('%',#{record.searchKey},'%')
+                    OR password LIKE concat('%',#{record.searchKey},'%')
+                    OR username LIKE concat('%',#{record.searchKey},'%')
+                    OR icon LIKE concat('%',#{record.searchKey},'%')
+                    OR use_flag LIKE concat('%',#{record.searchKey},'%')
+                    OR status_flag LIKE concat('%',#{record.searchKey},'%')
+                    OR login_time LIKE concat('%',#{record.searchKey},'%')
+                </trim>
             </if>
-                  <if test="record.searchKey != null and !&quot;&quot;.equals(record.searchKey)">
-             <trim prefix="and (" suffix=")" prefixOverrides="OR" >
-                                                                                                                                                                                                                                                                                                                                                                                                                                    OR  store_id LIKE concat('%',#{record.searchKey},'%')
-                                                                                                    OR  service_name LIKE concat('%',#{record.searchKey},'%')
-                                                                                                    OR  password LIKE concat('%',#{record.searchKey},'%')
-                                                                                                    OR  username LIKE concat('%',#{record.searchKey},'%')
-                                                                                                    OR  icon LIKE concat('%',#{record.searchKey},'%')
-                                                                                                    OR  use_flag LIKE concat('%',#{record.searchKey},'%')
-                                                                                                    OR  status_flag LIKE concat('%',#{record.searchKey},'%')
-                                                                                                    OR  login_time LIKE concat('%',#{record.searchKey},'%')
-                                                             </trim>
-         </if>
 
             <if test="record.advancedQuery != null and !&quot;&quot;.equals(record.advancedQuery)">
                 <foreach item="item" index="index" collection="record.advancedQuery.split('_;')">
@@ -320,101 +324,104 @@
         </if>
         id desc
     </select>
-    <select id="queryAllCustomerService" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.CustomerService">
-        select <include refid="Base_Column_List"/> from customer_service
+    <select id="queryAllCustomerService" parameterType="java.util.Map"
+            resultType="com.izouma.awesomeadmin.model.CustomerService">
+        select
+        <include refid="Base_Column_List"/>
+        from customer_service
         <where>
             and del_flag = 'N'
             <if test="idStr != null and !&quot;&quot;.equals(idStr)">
                 and id in (${idStr})
             </if>
-                    <if test="id != null and !&quot;&quot;.equals(id)">
-                and  id = #{id}
+            <if test="id != null and !&quot;&quot;.equals(id)">
+                and id = #{id}
             </if>
-                    <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
-                and  del_flag = #{delFlag}
+            <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
+                and del_flag = #{delFlag}
             </if>
-                    <if test="updateTime != null and !&quot;&quot;.equals(updateTime)">
-                and  update_time = #{updateTime}
+            <if test="updateTime != null and !&quot;&quot;.equals(updateTime)">
+                and update_time = #{updateTime}
             </if>
-                    <if test="updateUser != null and !&quot;&quot;.equals(updateUser)">
-                and  update_user = #{updateUser}
+            <if test="updateUser != null and !&quot;&quot;.equals(updateUser)">
+                and update_user = #{updateUser}
             </if>
-                    <if test="createTime != null and !&quot;&quot;.equals(createTime)">
-                and  create_time = #{createTime}
+            <if test="createTime != null and !&quot;&quot;.equals(createTime)">
+                and create_time = #{createTime}
             </if>
-                    <if test="createUser != null and !&quot;&quot;.equals(createUser)">
-                and  create_user = #{createUser}
+            <if test="createUser != null and !&quot;&quot;.equals(createUser)">
+                and create_user = #{createUser}
             </if>
-                    <if test="storeId != null and !&quot;&quot;.equals(storeId)">
-                and  store_id = #{storeId}
+            <if test="storeId != null and !&quot;&quot;.equals(storeId)">
+                and store_id = #{storeId}
             </if>
-                    <if test="serviceName != null and !&quot;&quot;.equals(serviceName)">
-                and  service_name = #{serviceName}
+            <if test="serviceName != null and !&quot;&quot;.equals(serviceName)">
+                and service_name = #{serviceName}
             </if>
-                    <if test="password != null and !&quot;&quot;.equals(password)">
-                and  password = #{password}
+            <if test="password != null and !&quot;&quot;.equals(password)">
+                and password = #{password}
             </if>
-                    <if test="username != null and !&quot;&quot;.equals(username)">
-                and  username = #{username}
+            <if test="username != null and !&quot;&quot;.equals(username)">
+                and username = #{username}
             </if>
-                    <if test="icon != null and !&quot;&quot;.equals(icon)">
-                and  icon = #{icon}
+            <if test="icon != null and !&quot;&quot;.equals(icon)">
+                and icon = #{icon}
             </if>
-                    <if test="useFlag != null and !&quot;&quot;.equals(useFlag)">
-                and  use_flag = #{useFlag}
+            <if test="useFlag != null and !&quot;&quot;.equals(useFlag)">
+                and use_flag = #{useFlag}
             </if>
-                    <if test="statusFlag != null and !&quot;&quot;.equals(statusFlag)">
-                and  status_flag = #{statusFlag}
+            <if test="statusFlag != null and !&quot;&quot;.equals(statusFlag)">
+                and status_flag = #{statusFlag}
             </if>
-                    <if test="loginTime != null and !&quot;&quot;.equals(loginTime)">
-                and  login_time = #{loginTime}
+            <if test="loginTime != null and !&quot;&quot;.equals(loginTime)">
+                and login_time = #{loginTime}
             </if>
-                    <if test="searchKey != null and !&quot;&quot;.equals(searchKey)">
-                <trim prefix="and (" suffix=")" prefixOverrides="OR" >
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                OR  store_id LIKE concat('%',#{searchKey},'%')
-                                                                                                                                                        OR  service_name LIKE concat('%',#{searchKey},'%')
-                                                                                                                                                        OR  password LIKE concat('%',#{searchKey},'%')
-                                                                                                                                                        OR  username LIKE concat('%',#{searchKey},'%')
-                                                                                                                                                        OR  icon LIKE concat('%',#{searchKey},'%')
-                                                                                                                                                        OR  use_flag LIKE concat('%',#{searchKey},'%')
-                                                                                                                                                        OR  status_flag LIKE concat('%',#{searchKey},'%')
-                                                                                                                                                        OR  login_time LIKE concat('%',#{searchKey},'%')
-                                                                                        </trim>
+            <if test="searchKey != null and !&quot;&quot;.equals(searchKey)">
+                <trim prefix="and (" suffix=")" prefixOverrides="OR">
+                    OR store_id LIKE concat('%',#{searchKey},'%')
+                    OR service_name LIKE concat('%',#{searchKey},'%')
+                    OR password LIKE concat('%',#{searchKey},'%')
+                    OR username LIKE concat('%',#{searchKey},'%')
+                    OR icon LIKE concat('%',#{searchKey},'%')
+                    OR use_flag LIKE concat('%',#{searchKey},'%')
+                    OR status_flag LIKE concat('%',#{searchKey},'%')
+                    OR login_time LIKE concat('%',#{searchKey},'%')
+                </trim>
             </if>
-<if test="advancedQuery != null and !&quot;&quot;.equals(advancedQuery)">
-    <foreach item="item" index="index" collection="advancedQuery.split('_;')">
-        <choose>
-            <when test="item.indexOf('like') != -1">
-                <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
-                    <if test="detailIndex == 3">
-                        concat('%',#{itemDetail},'%')
-                    </if>
+            <if test="advancedQuery != null and !&quot;&quot;.equals(advancedQuery)">
+                <foreach item="item" index="index" collection="advancedQuery.split('_;')">
+                    <choose>
+                        <when test="item.indexOf('like') != -1">
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    concat('%',#{itemDetail},'%')
+                                </if>
 
-                    <if test="detailIndex &lt; 3">
-                        ${itemDetail}
-                    </if>
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
 
-                </foreach>
-            </when>
-            <otherwise>
-                <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
-                    <if test="detailIndex == 3">
-                        #{itemDetail}
-                    </if>
-
-                    <if test="detailIndex &lt; 3">
-                        ${itemDetail}
-                    </if>
+                            </foreach>
+                        </when>
+                        <otherwise>
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    #{itemDetail}
+                                </if>
 
-                </foreach>
-            </otherwise>
-        </choose>
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
 
+                            </foreach>
+                        </otherwise>
+                    </choose>
 
-    </foreach>
 
+                </foreach>
 
-</if>
+
+            </if>
         </where>
         order by
 
@@ -433,53 +440,56 @@
 
         id desc
     </select>
-    <select id="queryCustomerService" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.CustomerService">
-        select <include refid="Base_Column_List"/> from customer_service
+    <select id="queryCustomerService" parameterType="java.util.Map"
+            resultType="com.izouma.awesomeadmin.model.CustomerService">
+        select
+        <include refid="Base_Column_List"/>
+        from customer_service
         <where>
             and del_flag = 'N'
-                    <if test="id != null and !&quot;&quot;.equals(id)">
+            <if test="id != null and !&quot;&quot;.equals(id)">
                 and id = #{id}
             </if>
-                     <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
+            <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
                 and del_flag = #{delFlag}
             </if>
-                     <if test="updateTime != null and !&quot;&quot;.equals(updateTime)">
+            <if test="updateTime != null and !&quot;&quot;.equals(updateTime)">
                 and update_time = #{updateTime}
             </if>
-                     <if test="updateUser != null and !&quot;&quot;.equals(updateUser)">
+            <if test="updateUser != null and !&quot;&quot;.equals(updateUser)">
                 and update_user = #{updateUser}
             </if>
-                     <if test="createTime != null and !&quot;&quot;.equals(createTime)">
+            <if test="createTime != null and !&quot;&quot;.equals(createTime)">
                 and create_time = #{createTime}
             </if>
-                     <if test="createUser != null and !&quot;&quot;.equals(createUser)">
+            <if test="createUser != null and !&quot;&quot;.equals(createUser)">
                 and create_user = #{createUser}
             </if>
-                     <if test="storeId != null and !&quot;&quot;.equals(storeId)">
+            <if test="storeId != null and !&quot;&quot;.equals(storeId)">
                 and store_id = #{storeId}
             </if>
-                     <if test="serviceName != null and !&quot;&quot;.equals(serviceName)">
+            <if test="serviceName != null and !&quot;&quot;.equals(serviceName)">
                 and service_name = #{serviceName}
             </if>
-                     <if test="password != null and !&quot;&quot;.equals(password)">
+            <if test="password != null and !&quot;&quot;.equals(password)">
                 and password = #{password}
             </if>
-                     <if test="username != null and !&quot;&quot;.equals(username)">
+            <if test="username != null and !&quot;&quot;.equals(username)">
                 and username = #{username}
             </if>
-                     <if test="icon != null and !&quot;&quot;.equals(icon)">
+            <if test="icon != null and !&quot;&quot;.equals(icon)">
                 and icon = #{icon}
             </if>
-                     <if test="useFlag != null and !&quot;&quot;.equals(useFlag)">
+            <if test="useFlag != null and !&quot;&quot;.equals(useFlag)">
                 and use_flag = #{useFlag}
             </if>
-                     <if test="statusFlag != null and !&quot;&quot;.equals(statusFlag)">
+            <if test="statusFlag != null and !&quot;&quot;.equals(statusFlag)">
                 and status_flag = #{statusFlag}
             </if>
-                     <if test="loginTime != null and !&quot;&quot;.equals(loginTime)">
+            <if test="loginTime != null and !&quot;&quot;.equals(loginTime)">
                 and login_time = #{loginTime}
             </if>
-         
+
         </where>
         LIMIT 1
     </select>
@@ -495,11 +505,28 @@
         </if>
     </update>
     <select id="query" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.CustomerService">
-        select <include refid="Base_Column_List"/> from customer_service
+        select
+        <include refid="Base_Column_List"/>
+        from customer_service
         <where>
             and del_flag = 'N'
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </where>
+        </where>
         order by id desc
     </select>
+    <select id="getRecentlyLoginList" parameterType="java.util.Map"
+            resultType="com.izouma.awesomeadmin.model.CustomerService">
+        select
+        <include refid="Base_Column_List"/>
+        from customer_service
+        <where>
+            and del_flag = 'N'
+            and use_flag = 'Y'
+            <if test="storeId != null and !&quot;&quot;.equals(storeId)">
+                and store_id = #{storeId}
+            </if>
+        </where>
+        order by login_time desc
+        LIMIT 3
+    </select>
 </mapper>
 

+ 87 - 63
src/main/java/com/izouma/awesomeadmin/model/CustomerService.java

@@ -1,13 +1,15 @@
 package com.izouma.awesomeadmin.model;
 
 import java.util.*;
+
 import com.fasterxml.jackson.annotation.JsonAutoDetect;
 import com.fasterxml.jackson.annotation.JsonInclude;
+import io.rong.models.CheckOnlineResult;
 
 
 @JsonAutoDetect
 @JsonInclude(JsonInclude.Include.NON_NULL)
-public class CustomerService{
+public class CustomerService {
     private Integer id;
     private String delFlag;
     private Date updateTime;
@@ -23,150 +25,172 @@ public class CustomerService{
     private Integer statusFlag;
     private Date loginTime;
 
-private String idStr;
+    private String idStr;
+
+    private CheckOnlineResult checkOnlineResult;
 
-private String searchKey;
+    private String searchKey;
 
-/**
-* and,test_name,like,value;or,remark,=,123
-*/
-private String advancedQuery;
+    /**
+     * and,test_name,like,value;or,remark,=,123
+     */
+    private String advancedQuery;
 
-/**
-* column_name_,desc_;column_name_,asc
-*/
-private String orderByStr;
+    /**
+     * column_name_,desc_;column_name_,asc
+     */
+    private String orderByStr;
 
-    public Integer getId(){
+    public Integer getId() {
         return this.id;
     }
 
-    public void setId(Integer id){
+    public void setId(Integer id) {
         this.id = id;
     }
-    public String getDelFlag(){
+
+    public String getDelFlag() {
         return this.delFlag;
     }
 
-    public void setDelFlag(String delFlag){
+    public void setDelFlag(String delFlag) {
         this.delFlag = delFlag;
     }
-    public Date getUpdateTime(){
+
+    public Date getUpdateTime() {
         return this.updateTime;
     }
 
-    public void setUpdateTime(Date updateTime){
+    public void setUpdateTime(Date updateTime) {
         this.updateTime = updateTime;
     }
-    public String getUpdateUser(){
+
+    public String getUpdateUser() {
         return this.updateUser;
     }
 
-    public void setUpdateUser(String updateUser){
+    public void setUpdateUser(String updateUser) {
         this.updateUser = updateUser;
     }
-    public Date getCreateTime(){
+
+    public Date getCreateTime() {
         return this.createTime;
     }
 
-    public void setCreateTime(Date createTime){
+    public void setCreateTime(Date createTime) {
         this.createTime = createTime;
     }
-    public String getCreateUser(){
+
+    public String getCreateUser() {
         return this.createUser;
     }
 
-    public void setCreateUser(String createUser){
+    public void setCreateUser(String createUser) {
         this.createUser = createUser;
     }
-    public String getStoreId(){
+
+    public String getStoreId() {
         return this.storeId;
     }
 
-    public void setStoreId(String storeId){
+    public void setStoreId(String storeId) {
         this.storeId = storeId;
     }
-    public String getServiceName(){
+
+    public String getServiceName() {
         return this.serviceName;
     }
 
-    public void setServiceName(String serviceName){
+    public void setServiceName(String serviceName) {
         this.serviceName = serviceName;
     }
-    public String getPassword(){
+
+    public String getPassword() {
         return this.password;
     }
 
-    public void setPassword(String password){
+    public void setPassword(String password) {
         this.password = password;
     }
-    public String getUsername(){
+
+    public String getUsername() {
         return this.username;
     }
 
-    public void setUsername(String username){
+    public void setUsername(String username) {
         this.username = username;
     }
-    public String getIcon(){
+
+    public String getIcon() {
         return this.icon;
     }
 
-    public void setIcon(String icon){
+    public void setIcon(String icon) {
         this.icon = icon;
     }
-    public String getUseFlag(){
+
+    public String getUseFlag() {
         return this.useFlag;
     }
 
-    public void setUseFlag(String useFlag){
+    public void setUseFlag(String useFlag) {
         this.useFlag = useFlag;
     }
-    public Integer getStatusFlag(){
+
+    public Integer getStatusFlag() {
         return this.statusFlag;
     }
 
-    public void setStatusFlag(Integer statusFlag){
+    public void setStatusFlag(Integer statusFlag) {
         this.statusFlag = statusFlag;
     }
-    public Date getLoginTime(){
+
+    public Date getLoginTime() {
         return this.loginTime;
     }
 
-    public void setLoginTime(Date loginTime){
+    public void setLoginTime(Date loginTime) {
         this.loginTime = loginTime;
     }
 
-public String getSearchKey() {
-    return searchKey;
-}
+    public String getSearchKey() {
+        return searchKey;
+    }
 
-public void setSearchKey(String searchKey) {
-    this.searchKey = searchKey;
-}
+    public void setSearchKey(String searchKey) {
+        this.searchKey = searchKey;
+    }
 
-public String getAdvancedQuery() {
-    return advancedQuery;
-}
+    public String getAdvancedQuery() {
+        return advancedQuery;
+    }
 
-public void setAdvancedQuery(String advancedQuery) {
-    this.advancedQuery = advancedQuery;
-}
+    public void setAdvancedQuery(String advancedQuery) {
+        this.advancedQuery = advancedQuery;
+    }
 
-public String getOrderByStr() {
-    return orderByStr;
-}
+    public String getOrderByStr() {
+        return orderByStr;
+    }
 
-public void setOrderByStr(String orderByStr) {
-    this.orderByStr = orderByStr;
-}
+    public void setOrderByStr(String orderByStr) {
+        this.orderByStr = orderByStr;
+    }
 
-public String getIdStr() {
-    return idStr;
-}
+    public String getIdStr() {
+        return idStr;
+    }
 
-public void setIdStr(String idStr) {
-    this.idStr = idStr;
-}
+    public void setIdStr(String idStr) {
+        this.idStr = idStr;
+    }
+
+    public CheckOnlineResult getCheckOnlineResult() {
+        return checkOnlineResult;
+    }
 
+    public void setCheckOnlineResult(CheckOnlineResult checkOnlineResult) {
+        this.checkOnlineResult = checkOnlineResult;
+    }
 }
 

+ 2 - 0
src/main/java/com/izouma/awesomeadmin/service/CustomerServiceService.java

@@ -23,5 +23,7 @@ public interface CustomerServiceService{
     boolean deleteCustomerService(String id);
 
     boolean updateCustomerService(CustomerService record);
+
+    List<CustomerService> getRecentlyLoginList(CustomerService record);
 }
 

+ 34 - 18
src/main/java/com/izouma/awesomeadmin/service/impl/CustomerServiceServiceImpl.java

@@ -1,6 +1,7 @@
 package com.izouma.awesomeadmin.service.impl;
 
 import java.util.*;
+
 import org.apache.log4j.Logger;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -11,10 +12,10 @@ import com.izouma.awesomeadmin.service.CustomerServiceService;
 import com.izouma.awesomeadmin.dao.CustomerServiceMapper;
 
 /**
-*  service接口实现类
-*/
+ * service接口实现类
+ */
 @Service
-public class CustomerServiceServiceImpl implements CustomerServiceService{
+public class CustomerServiceServiceImpl implements CustomerServiceService {
 
     private static Logger logger = Logger.getLogger(CustomerServiceServiceImpl.class);
 
@@ -27,26 +28,27 @@ public class CustomerServiceServiceImpl implements CustomerServiceService{
         logger.info("getCustomerServiceList");
         try {
 
-        return customerServiceMapper.queryAllCustomerService(record);
+            return customerServiceMapper.queryAllCustomerService(record);
         } catch (Exception e) {
-        logger.error("getCustomerServiceList", e);
+            logger.error("getCustomerServiceList", e);
         }
 
         return null;
     }
+
     @Override
     public List<CustomerService> getCustomerServiceByPage(Page page, CustomerService record) {
 
         logger.info("getCustomerServiceByPage");
         try {
 
-        Map<String, Object> parameter = new HashMap<String, Object>();
-        parameter.put("record", record);
-        parameter.put(AppConstant.PAGE, page);
+            Map<String, Object> parameter = new HashMap<String, Object>();
+            parameter.put("record", record);
+            parameter.put(AppConstant.PAGE, page);
 
-        return customerServiceMapper.queryCustomerServiceByPage(parameter);
+            return customerServiceMapper.queryCustomerServiceByPage(parameter);
         } catch (Exception e) {
-        logger.error("getCustomerServiceByPage", e);
+            logger.error("getCustomerServiceByPage", e);
         }
 
         return null;
@@ -60,7 +62,7 @@ public class CustomerServiceServiceImpl implements CustomerServiceService{
 
             return customerServiceMapper.selectByPrimaryKey(Integer.valueOf(id));
         } catch (Exception e) {
-        logger.error("getCustomerServiceById", e);
+            logger.error("getCustomerServiceById", e);
         }
 
         return null;
@@ -74,7 +76,7 @@ public class CustomerServiceServiceImpl implements CustomerServiceService{
 
             return customerServiceMapper.queryCustomerService(record);
         } catch (Exception e) {
-        logger.error("getCustomerService", e);
+            logger.error("getCustomerService", e);
         }
 
         return null;
@@ -89,7 +91,7 @@ public class CustomerServiceServiceImpl implements CustomerServiceService{
             int updates = customerServiceMapper.insertSelective(record);
 
             if (updates > 0) {
-                 return true;
+                return true;
             }
         } catch (Exception e) {
             logger.error("createCustomerService", e);
@@ -104,13 +106,13 @@ public class CustomerServiceServiceImpl implements CustomerServiceService{
         logger.info("deleteCustomerService");
         try {
 
-             int updates = customerServiceMapper.delete(id);
+            int updates = customerServiceMapper.delete(id);
 
             if (updates > 0) {
-                 return true;
+                return true;
             }
         } catch (Exception e) {
-             logger.error("deleteCustomerService", e);
+            logger.error("deleteCustomerService", e);
         }
 
         return false;
@@ -125,13 +127,27 @@ public class CustomerServiceServiceImpl implements CustomerServiceService{
             int updates = customerServiceMapper.updateByPrimaryKeySelective(record);
 
             if (updates > 0) {
-                 return true;
+                return true;
             }
         } catch (Exception e) {
-             logger.error("updateCustomerService", e);
+            logger.error("updateCustomerService", e);
         }
 
         return false;
     }
+
+    @Override
+    public List<CustomerService> getRecentlyLoginList(CustomerService record) {
+
+        logger.info("getRecentlyLoginList");
+        try {
+
+            return customerServiceMapper.getRecentlyLoginList(record);
+        } catch (Exception e) {
+            logger.error("getRecentlyLoginList", e);
+        }
+
+        return null;
+    }
 }
 

+ 31 - 0
src/main/java/com/izouma/awesomeadmin/web/CustomerServiceController.java

@@ -3,6 +3,9 @@ package com.izouma.awesomeadmin.web;
 import java.util.*;
 
 import com.izouma.awesomeadmin.util.ExportExcelUtil;
+import com.izouma.awesomeadmin.util.PropertiesFileLoader;
+import io.rong.RongCloud;
+import io.rong.models.CheckOnlineResult;
 import org.apache.commons.lang.StringUtils;
 import org.apache.shiro.authz.annotation.RequiresAuthentication;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -27,6 +30,8 @@ public class CustomerServiceController {
     @Autowired
     private CustomerServiceService customerServiceService;
 
+    private RongCloud rongCloud = RongCloud.getInstance(PropertiesFileLoader.getProperties("rongyunappkey"), PropertiesFileLoader.getProperties("rongyunappsecret"));
+
     /**
      * <p>获取全部记录。</p>
      */
@@ -187,5 +192,31 @@ public class CustomerServiceController {
         return new Result(false, "用户名或密码错误");
     }
 
+    /**
+     * 获取最近登录客服
+     *
+     * @param record
+     * @return
+     */
+    @RequestMapping(value = "/recently", method = RequestMethod.GET)
+    @ResponseBody
+    public Result recently(CustomerService record) {
+        List<CustomerService> pp = customerServiceService.getRecentlyLoginList(record);
+
+        for (CustomerService customerService : pp) {
+            try {
+
+                CheckOnlineResult checkOnlineResult = rongCloud.user.checkOnline(customerService.getUsername());
+                customerService.setCheckOnlineResult(checkOnlineResult);
+
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+
+        return new Result(true, pp);
+    }
+
+
 }
 

+ 1 - 1
src/main/vue/src/pages/AboutUs.vue

@@ -1,6 +1,6 @@
 <template>
     <div>
-        <el-form :model="formData" :rules="rules" ref="form" label-width="80px" label-position="right" size="small" style="max-width: 500px;">
+        <el-form :model="formData" :rules="rules" ref="form" label-width="80px" label-position="right" size="small" style="max-width: 800px;">
             <el-form-item prop="title" label="标题">
                 <el-input v-model="formData.title" :disabled="'title'==subColumn"></el-input>
             </el-form-item>

+ 6 - 1
src/main/vue/src/pages/CustomerService.vue

@@ -24,7 +24,12 @@
                 <el-input v-model="formData.statusFlag" :disabled="'statusFlag'==subColumn"></el-input>
             </el-form-item>
             <el-form-item prop="loginTime" label="登录时间">
-                <el-input v-model="formData.loginTime" :disabled="'loginTime'==subColumn"></el-input>
+                <template>
+                    <div class="block">
+                        <el-date-picker v-model="formData.loginTime" type="datetime" value-format="timestamp" placeholder="选择日期" >
+                        </el-date-picker>
+                    </div>
+                </template>
             </el-form-item>
             <el-form-item>
                 <el-button @click="onSave" :loading="$store.state.fetchingData" type="primary">保存</el-button>

+ 303 - 366
src/main/vue/src/pages/CustomerServices.vue

@@ -1,25 +1,22 @@
 <template>
     <div>
         <div class="filters-container">
-        
+
             <el-input placeholder="关键字" size="small" v-model="filter1" clearable class="filter-item"></el-input>
             <el-button @click="searchData" type="primary" size="small" icon="el-icon-search" class="filter-item">搜索
             </el-button>
-            <el-button @click="showAdvancedQueryDialog = !showAdvancedQueryDialog" type="primary" size="small"
-                       icon="el-icon-search" class="filter-item">高级查询
+            <el-button @click="showAdvancedQueryDialog = !showAdvancedQueryDialog" type="primary" size="small" icon="el-icon-search" class="filter-item">高级查询
             </el-button>
-            <el-button @click="showTableSortDialog = !showTableSortDialog" type="primary" size="small"
-                       icon="el-icon-sort" class="filter-item">排序
+            <el-button @click="showTableSortDialog = !showTableSortDialog" type="primary" size="small" icon="el-icon-sort" class="filter-item">排序
             </el-button>
-            <el-button @click="$router.push({path:'/customerService',query:{column:$route.query.column}})" type="primary"
-                       size="small" icon="el-icon-edit"
-                       class="filter-item">添加
+            <el-button @click="$router.push({path:'/customerService',query:{column:$route.query.column}})" type="primary" size="small" icon="el-icon-edit" class="filter-item">添加
             </el-button>
             <el-button @click="exportExcel" type="primary" size="small" icon="el-icon-share" class="filter-item">导出EXCEL
             </el-button>
             <el-dropdown trigger="click" size="medium" class="table-column-filter">
                 <span>
-                  筛选数据<i class="el-icon-arrow-down el-icon--right"></i>
+                    筛选数据
+                    <i class="el-icon-arrow-down el-icon--right"></i>
                 </span>
                 <el-dropdown-menu slot="dropdown" class="table-column-filter-wrapper">
                     <el-checkbox v-for="item in tableColumns" :key="item.value" v-model="item.show">{{item.label}}
@@ -27,90 +24,42 @@
                 </el-dropdown-menu>
             </el-dropdown>
         </div>
-        <el-table
-                :data="tableData"
-                :height="tableHeight"
-                row-key="id"
-                ref="table">
-            <el-table-column
-                    v-if="multipleMode"
-                    align="center"
-                    type="selection"
-                    width="50">
+        <el-table :data="tableData" :height="tableHeight" row-key="id" ref="table">
+            <el-table-column v-if="multipleMode" align="center" type="selection" width="50">
+            </el-table-column>
+            <el-table-column type="index" min-width="50" align="center">
+            </el-table-column>
+
+            <el-table-column v-if="isColumnShow('storeId')" prop="storeId" label="店铺" min-width="100">
+            </el-table-column>
+
+            <el-table-column v-if="isColumnShow('serviceName')" prop="serviceName" label="客服名" min-width="100">
+            </el-table-column>
+
+            <el-table-column v-if="isColumnShow('password')" prop="password" label="密码" min-width="100">
+            </el-table-column>
+
+            <el-table-column v-if="isColumnShow('username')" prop="username" label="登录名" min-width="100">
             </el-table-column>
-            <el-table-column
-                    type="index"
-                    min-width="50"
-                    align="center">
+
+            <el-table-column v-if="isColumnShow('icon')" prop="icon" label="头像" min-width="100">
+                <template slot-scope="{row}">
+                    <img :src="row.icon" @click="showImg(row.icon)" style="width: 100px;height: 100px;vertical-align: middle;" />
+                </template>
+
+            </el-table-column>
+
+            <el-table-column v-if="isColumnShow('useFlag')" prop="useFlag" label="可用标识" min-width="100">
             </el-table-column>
-                                                                                                                                                                                                    
-                                            <el-table-column
-                                v-if="isColumnShow('storeId')"
-                                prop="storeId"
-                                label="店铺"
-                                min-width="100">
-                        </el-table-column>
-                                                                
-                                            <el-table-column
-                                v-if="isColumnShow('serviceName')"
-                                prop="serviceName"
-                                label="客服名"
-                                min-width="100">
-                        </el-table-column>
-                                                                
-                                            <el-table-column
-                                v-if="isColumnShow('password')"
-                                prop="password"
-                                label="密码"
-                                min-width="100">
-                        </el-table-column>
-                                                                
-                                            <el-table-column
-                                v-if="isColumnShow('username')"
-                                prop="username"
-                                label="登录名"
-                                min-width="100">
-                        </el-table-column>
-                                                                
-                                            <el-table-column
-                                v-if="isColumnShow('icon')"
-                                prop="icon"
-                                label="头像"
-                                min-width="100">
-                            <template slot-scope="{row}">
-                                <img :src="row.icon" @click="showImg(row.icon)" style="width: 100px;height: 100px;vertical-align: middle;" />
-                            </template>
-
-                        </el-table-column>
-                                                                    
-                                            <el-table-column
-                                v-if="isColumnShow('useFlag')"
-                                prop="useFlag"
-                                label="可用标识"
-                                min-width="100">
-                        </el-table-column>
-                                                                
-                                            <el-table-column
-                                v-if="isColumnShow('statusFlag')"
-                                prop="statusFlag"
-                                label="状态"
-                                min-width="100">
-                        </el-table-column>
-                                                                
-                                            <el-table-column
-                                v-if="isColumnShow('loginTime')"
-                                prop="loginTime"
-                                label="登录时间"
-                                min-width="100">
-                        </el-table-column>
-                                                            <el-table-column
-                    label="操作"
-                    align="center"
-                    fixed="right"
-                    min-width="150"
-            >
+
+            <el-table-column v-if="isColumnShow('statusFlag')" prop="statusFlag" label="状态" min-width="100">
+            </el-table-column>
+
+            <el-table-column v-if="isColumnShow('loginTime')" prop="loginTime" :formatter="DateTimeFormatter" label="登录时间" min-width="100">
+            </el-table-column>
+            <el-table-column label="操作" align="center" fixed="right" min-width="150">
                 <template slot-scope="scope">
-                            <el-button @click="editRow(scope.row)" type="primary" size="mini" plain>编辑</el-button>
+                    <el-button @click="editRow(scope.row)" type="primary" size="mini" plain>编辑</el-button>
                     <el-button @click="deleteRow(scope.row)" type="danger" size="mini" plain>删除</el-button>
                 </template>
             </el-table-column>
@@ -124,15 +73,7 @@
                     <el-button size="small" @click="toggleMultipleMode(false)">取消</el-button>
                 </el-button-group>
             </div>
-            <el-pagination
-                    background
-                    @size-change="pageSizeChange"
-                    @current-change="currentPageChange"
-                    :current-page="currentPage"
-                    :page-sizes="[10, 20, 30, 40, 50]"
-                    :page-size="pageSize"
-                    layout="total, sizes, prev, pager, next, jumper"
-                    :total="totalNumber">
+            <el-pagination background @size-change="pageSizeChange" @current-change="currentPageChange" :current-page="currentPage" :page-sizes="[10, 20, 30, 40, 50]" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="totalNumber">
             </el-pagination>
         </div>
         <el-dialog title="高级查询" :visible.sync="showAdvancedQueryDialog">
@@ -153,16 +94,14 @@
                     <template slot-scope="{row}">
                         <el-select v-model="row.name">
 
-                            <el-option v-for="item in advancedQueryColumns" :label="item.label" :value="item.value"
-                                       :key="item.value"></el-option>
+                            <el-option v-for="item in advancedQueryColumns" :label="item.label" :value="item.value" :key="item.value"></el-option>
                         </el-select>
                     </template>
                 </el-table-column>
                 <el-table-column prop="searchMethod" label="搜索方式" width="150" align="center">
                     <template slot-scope="{row}">
                         <el-select v-model="row.searchMethod">
-                            <el-option v-for="item in searchMethods" :label="item" :value="item"
-                                       :key="item"></el-option>
+                            <el-option v-for="item in searchMethods" :label="item" :value="item" :key="item"></el-option>
                         </el-select>
                     </template>
                 </el-table-column>
@@ -192,8 +131,7 @@
                     <template slot-scope="{row}">
                         <el-select v-model="row.name">
 
-                            <el-option v-for="item in advancedQueryColumns" :label="item.label" :value="item.value"
-                                       :key="item.value"></el-option>
+                            <el-option v-for="item in advancedQueryColumns" :label="item.label" :value="item.value" :key="item.value"></el-option>
                         </el-select>
                     </template>
                 </el-table-column>
@@ -227,297 +165,296 @@
     </div>
 </template>
 <script>
-    import {mapState} from 'vuex'
-    import {format} from 'date-fns'
-    import zh from 'date-fns/locale/zh_cn'
-
-    export default {
-        created() {
+import { mapState } from 'vuex'
+import { format } from 'date-fns'
+import zh from 'date-fns/locale/zh_cn'
+
+export default {
+    created() {
+        this.getData();
+    },
+    data() {
+        return {
+            totalNumber: 0,
+            totalPage: 10,
+            currentPage: 1,
+            pageSize: 20,
+            tableData: [],
+            filter1: '',
+            filter2: '',
+            tableColumns: [
+                {
+                    label: '店铺',
+                    value: 'storeId',
+                    show: true
+                },
+                {
+                    label: '客服名',
+                    value: 'serviceName',
+                    show: true
+                },
+                {
+                    label: '密码',
+                    value: 'password',
+                    show: true
+                },
+                {
+                    label: '登录名',
+                    value: 'username',
+                    show: true
+                },
+                {
+                    label: '头像',
+                    value: 'icon',
+                    show: true
+                },
+                {
+                    label: '可用标识',
+                    value: 'useFlag',
+                    show: true
+                },
+                {
+                    label: '状态',
+                    value: 'statusFlag',
+                    show: true
+                },
+                {
+                    label: '登录时间',
+                    value: 'loginTime',
+                    show: true
+                },
+            ],
+            multipleMode: false,
+            showAdvancedQueryDialog: false,
+            advancedQueryFields: [],
+            showTableSortDialog: false,
+            tableSortFields: [],
+            searchMethods: ['=', '!=', '>', '>=', '<', '<=', 'like'],
+            advancedQueryColumns: [
+                {
+                    label: '店铺',
+                    value: 'store_id'
+                },
+                {
+                    label: '客服名',
+                    value: 'service_name'
+                },
+                {
+                    label: '密码',
+                    value: 'password'
+                },
+                {
+                    label: '登录名',
+                    value: 'username'
+                },
+                {
+                    label: '头像',
+                    value: 'icon'
+                },
+                {
+                    label: '可用标识',
+                    value: 'use_flag'
+                },
+                {
+                    label: '状态',
+                    value: 'status_flag'
+                },
+                {
+                    label: '登录时间',
+                    value: 'login_time'
+                },
+            ],
+            advancedQuerySearchKey: '',
+            orderByStr: '',
+            imgSrc: '',
+            imageDialogVisible: false,
+        }
+    },
+    computed: {
+        ...mapState(['tableHeight']),
+        selection() {
+            return this.$refs.table.selection.map(i => i.id);
+        }
+    },
+    methods: {
+        pageSizeChange(size) {
+            this.currentPage = 1;
+            this.pageSize = size;
             this.getData();
         },
-        data() {
-            return {
-                totalNumber: 0,
-                totalPage: 10,
-                currentPage: 1,
-                pageSize: 20,
-                tableData: [],
-                filter1: '',
-                filter2: '',
-                tableColumns: [
-                                                                                                                                                                                                                                                                                                                                                {
-                                label: '店铺',
-                                value: 'storeId',
-                                show: true
-                            },
-                                                                                                {
-                                label: '客服名',
-                                value: 'serviceName',
-                                show: true
-                            },
-                                                                                                {
-                                label: '密码',
-                                value: 'password',
-                                show: true
-                            },
-                                                                                                {
-                                label: '登录名',
-                                value: 'username',
-                                show: true
-                            },
-                                                                                                {
-                                label: '头像',
-                                value: 'icon',
-                                show: true
-                            },
-                                                                                                {
-                                label: '可用标识',
-                                value: 'useFlag',
-                                show: true
-                            },
-                                                                                                {
-                                label: '状态',
-                                value: 'statusFlag',
-                                show: true
-                            },
-                                                                                                {
-                                label: '登录时间',
-                                value: 'loginTime',
-                                show: true
-                            },
-                                                            ],
-                multipleMode: false,
-                showAdvancedQueryDialog: false,
-                advancedQueryFields: [],
-                showTableSortDialog: false,
-                tableSortFields: [],
-                searchMethods: ['=', '!=', '>', '>=', '<', '<=', 'like'],
-                advancedQueryColumns: [
-                                                                                                                                                                                                                                                                                                                                                {
-                                label: '店铺',
-                                value: 'store_id'
-                            },
-                                                                                                {
-                                label: '客服名',
-                                value: 'service_name'
-                            },
-                                                                                                {
-                                label: '密码',
-                                value: 'password'
-                            },
-                                                                                                {
-                                label: '登录名',
-                                value: 'username'
-                            },
-                                                                                                {
-                                label: '头像',
-                                value: 'icon'
-                            },
-                                                                                                {
-                                label: '可用标识',
-                                value: 'use_flag'
-                            },
-                                                                                                {
-                                label: '状态',
-                                value: 'status_flag'
-                            },
-                                                                                                {
-                                label: '登录时间',
-                                value: 'login_time'
-                            },
-                                                            ],
-                advancedQuerySearchKey: '',
-                orderByStr: '',
-                imgSrc: '',
-                imageDialogVisible: false,
-            }
+        currentPageChange(page) {
+            this.currentPage = page;
+            this.getData();
         },
-        computed: {
-            ...mapState(['tableHeight']),
-            selection() {
-                return this.$refs.table.selection.map(i => i.id);
+        getData() {
+
+            var data = {
+                currentPage: this.currentPage,
+                pageNumber: this.pageSize,
+                searchKey: this.filter1,
+                advancedQuery: this.advancedQuerySearchKey,
+                orderByStr: this.orderByStr,
             }
-        },
-        methods: {
-            pageSizeChange(size) {
-                this.currentPage = 1;
-                this.pageSize = size;
-                this.getData();
-            },
-            currentPageChange(page) {
-                this.currentPage = page;
-                this.getData();
-            },
-            getData() {
-
-                var data = {
-                    currentPage: this.currentPage,
-                    pageNumber: this.pageSize,
-                    searchKey: this.filter1,
-                    advancedQuery: this.advancedQuerySearchKey,
-                    orderByStr: this.orderByStr,
-                }
 
-                if (this.$route.query.column) {
-                    var tempColumn = this.$route.query.column;
-                    data[tempColumn.split(',')[1]] = tempColumn.split(',')[0];
-                }
+            if (this.$route.query.column) {
+                var tempColumn = this.$route.query.column;
+                data[tempColumn.split(',')[1]] = tempColumn.split(',')[0];
+            }
 
-                this.$http.get({
-                    url: '/customerService/page',
-                    data: data
-                }).then(res => {
-                    if (res.success) {
-                        this.totalNumber = res.data.page.totalNumber;
-                        this.tableData = res.data.pp;
-                    }
-                })
-            },
-            isColumnShow(column) {
-                var row = this.tableColumns.find(i => i.value === column);
-                return row ? row.show : false;
-            },
-            toggleMultipleMode(multipleMode) {
-                this.multipleMode = multipleMode;
-                if (!multipleMode) {
-                    this.$refs.table.clearSelection();
+            this.$http.get({
+                url: '/customerService/page',
+                data: data
+            }).then(res => {
+                if (res.success) {
+                    this.totalNumber = res.data.page.totalNumber;
+                    this.tableData = res.data.pp;
                 }
-            },
-            editRow(row) {
-                this.$router.push({
-                    path: '/customerService',
-                    query: {
-                        id: row.id,
-                        column: this.$route.query.column,
-                    }
-                })
-            },
-            operation1() {
-                this.$notify({
-                    title: '提示',
-                    message: this.selection
-                });
-            },
-            operation2() {
-                this.$message('操作2');
-            },
-            addField() {
-                this.advancedQueryFields.push({
-                    link: 'AND',
-                    name: '',
-                    searchMethod: '=',
-                    value: '',
-                });
-            },
-            removeField(i) {
-                if (this.advancedQueryFields.length > 0) {
-                    this.advancedQueryFields.splice(i, 1);
+            })
+        },
+        isColumnShow(column) {
+            var row = this.tableColumns.find(i => i.value === column);
+            return row ? row.show : false;
+        },
+        toggleMultipleMode(multipleMode) {
+            this.multipleMode = multipleMode;
+            if (!multipleMode) {
+                this.$refs.table.clearSelection();
+            }
+        },
+        editRow(row) {
+            this.$router.push({
+                path: '/customerService',
+                query: {
+                    id: row.id,
+                    column: this.$route.query.column,
                 }
-            },
-            advancedQuery() {
+            })
+        },
+        operation1() {
+            this.$notify({
+                title: '提示',
+                message: this.selection
+            });
+        },
+        operation2() {
+            this.$message('操作2');
+        },
+        addField() {
+            this.advancedQueryFields.push({
+                link: 'AND',
+                name: '',
+                searchMethod: '=',
+                value: '',
+            });
+        },
+        removeField(i) {
+            if (this.advancedQueryFields.length > 0) {
+                this.advancedQueryFields.splice(i, 1);
+            }
+        },
+        advancedQuery() {
 
-                this.advancedQuerySearchKey = '';
+            this.advancedQuerySearchKey = '';
 
-                if (this.advancedQueryFields.length > 0) {
+            if (this.advancedQueryFields.length > 0) {
 
-                    var templist = [];
+                var templist = [];
 
-                    this.advancedQueryFields.forEach(item => {
-                        if (item.link && item.name && item.searchMethod && item.value) {
-                            var tempItem = item.link + '_,' + item.name + '_,' + item.searchMethod + '_,' + item.value;
-                            templist.push(tempItem);
-                        }
-                    })
+                this.advancedQueryFields.forEach(item => {
+                    if (item.link && item.name && item.searchMethod && item.value) {
+                        var tempItem = item.link + '_,' + item.name + '_,' + item.searchMethod + '_,' + item.value;
+                        templist.push(tempItem);
+                    }
+                })
 
-                    if (templist.length > 0) {
+                if (templist.length > 0) {
 
-                        this.advancedQuerySearchKey = templist.join('_;');
-                    }
+                    this.advancedQuerySearchKey = templist.join('_;');
                 }
+            }
 
-                this.getData();
-                this.showAdvancedQueryDialog = false;
-            },
-            addSortField() {
-                this.tableSortFields.push({
-                    name: '',
-                    order: 'asc',
-                });
-            },
-            removeSortField(i) {
-                if (this.tableSortFields.length > 0) {
-                    this.tableSortFields.splice(i, 1);
-                }
-            },
-            tableSortQuery() {
+            this.getData();
+            this.showAdvancedQueryDialog = false;
+        },
+        addSortField() {
+            this.tableSortFields.push({
+                name: '',
+                order: 'asc',
+            });
+        },
+        removeSortField(i) {
+            if (this.tableSortFields.length > 0) {
+                this.tableSortFields.splice(i, 1);
+            }
+        },
+        tableSortQuery() {
 
-                this.orderByStr = '';
+            this.orderByStr = '';
 
-                if (this.tableSortFields.length > 0) {
+            if (this.tableSortFields.length > 0) {
 
-                    var templist = [];
+                var templist = [];
 
-                    this.tableSortFields.forEach(item => {
-                        if (item.name && item.order) {
-                            var tempItem = item.name + '_,' + item.order;
-                            templist.push(tempItem);
-                        }
-                    })
+                this.tableSortFields.forEach(item => {
+                    if (item.name && item.order) {
+                        var tempItem = item.name + '_,' + item.order;
+                        templist.push(tempItem);
+                    }
+                })
 
-                    if (templist.length > 0) {
+                if (templist.length > 0) {
 
-                        this.orderByStr = templist.join('_;');
-                    }
+                    this.orderByStr = templist.join('_;');
                 }
+            }
 
-                this.getData();
-                this.showTableSortDialog = false;
-            },
-            exportExcel() {
-                window.location.href = this.$baseUrl + "/customerService/exportExcel?searchKey="
-                        + this.filter1 + "&advancedQuery=" + this.advancedQuerySearchKey+"&orderByStr=" + this.orderByStr;
-            },
-            searchData() {
-                this.currentPage = 1;
-                this.getData();
-            },
-            deleteRow(row) {
-                this.$alert('删除将无法恢复,确认要删除么?', '警告', {type: 'error'}).then(() => {
-                    return this.$http.post({
-                        url: '/customerService/del',
-                        data: {id: row.id}
-                    })
-                }).then(() => {
-                    this.$message.success('删除成功');
-                    this.getData();
-                }).catch(action => {
-                    if (action === 'cancel') {
-                        this.$message.info('删除取消');
-                    } else {
-                        this.$message.error('删除失败');
-                    }
+            this.getData();
+            this.showTableSortDialog = false;
+        },
+        exportExcel() {
+            window.location.href = this.$baseUrl + "/customerService/exportExcel?searchKey="
+                + this.filter1 + "&advancedQuery=" + this.advancedQuerySearchKey + "&orderByStr=" + this.orderByStr;
+        },
+        searchData() {
+            this.currentPage = 1;
+            this.getData();
+        },
+        deleteRow(row) {
+            this.$alert('删除将无法恢复,确认要删除么?', '警告', { type: 'error' }).then(() => {
+                return this.$http.post({
+                    url: '/customerService/del',
+                    data: { id: row.id }
                 })
-            },
-            DateTimeFormatter(row, column, cellValue) {
-                if (cellValue) {
-                    return format(cellValue, 'YYYY/MM/DD HH:mm', {locale: zh})
+            }).then(() => {
+                this.$message.success('删除成功');
+                this.getData();
+            }).catch(action => {
+                if (action === 'cancel') {
+                    this.$message.info('删除取消');
+                } else {
+                    this.$message.error('删除失败');
                 }
+            })
+        },
+        DateTimeFormatter(row, column, cellValue) {
+            if (cellValue) {
+                return format(cellValue, 'YYYY/MM/DD HH:mm', { locale: zh })
+            }
 
-            },
-            DateFormatter(row, column, cellValue) {
-                if (cellValue) {
-                    return format(cellValue, 'YYYY/MM/DD', {locale: zh})
-                }
+        },
+        DateFormatter(row, column, cellValue) {
+            if (cellValue) {
+                return format(cellValue, 'YYYY/MM/DD', { locale: zh })
+            }
 
-            },
-            showImg(img) {
-                this.imgSrc = img;
-                this.imageDialogVisible = true;
-            },
+        },
+        showImg(img) {
+            this.imgSrc = img;
+            this.imageDialogVisible = true;
+        },
 
-        }
     }
+}
 </script>
 <style lang="less" scoped>
-
 </style>

+ 6 - 2
src/main/vue/src/pages/JoinUs.vue

@@ -1,8 +1,8 @@
 <template>
     <div>
-        <el-form :model="formData" :rules="rules" ref="form" label-width="80px" label-position="right" size="small" style="max-width: 500px;">
+        <el-form :model="formData" :rules="rules" ref="form" label-width="80px" label-position="right" size="small" style="max-width: 800px;">
             <el-form-item prop="manifesto" label="招聘宣言">
-                <el-input type="textarea" v-model="formData.manifesto" :disabled="'manifesto'==subColumn" :autosize="{ minRows: 2, maxRows: 20}"></el-input>
+                <rich-text :height='500' v-model="formData.manifesto"></rich-text>
             </el-form-item>
             <el-form-item prop="email" label="邮箱">
                 <el-input v-model="formData.email" :disabled="'email'==subColumn"></el-input>
@@ -21,6 +21,7 @@
 </template>
 <script>
 import formValidator from '../formValidator'
+import RichText from '../components/RichText'
 
 export default {
     created() {
@@ -103,6 +104,9 @@ export default {
                 }
             })
         },
+    },
+    components: {
+        RichText
     }
 }
 </script>

+ 76 - 82
src/main/vue/src/pages/UserCoupon.vue

@@ -1,30 +1,24 @@
 <template>
     <div>
-        <el-form :model="formData" :rules="rules" ref="form" label-width="80px" label-position="right" size="small"
-                 style="max-width: 500px;">
-                                                                                                                                                                                                                                    <el-form-item prop="couponId" label="优惠券">
+        <el-form :model="formData" :rules="rules" ref="form" label-width="80px" label-position="right" size="small" style="max-width: 500px;">
+            <el-form-item prop="couponId" label="优惠券">
                 <el-input v-model="formData.couponId" :disabled="'couponId'==subColumn"></el-input>
             </el-form-item>
-                                                                                                                                                                                                                                                                                                                            <el-form-item prop="userId" label="用户">
+            <el-form-item prop="userId" label="用户">
                 <el-input v-model="formData.userId" :disabled="'userId'==subColumn"></el-input>
             </el-form-item>
-                                                                                                                                                                                                                                                                                                                            <el-form-item prop="isUsed" label="是否使用">
+            <el-form-item prop="isUsed" label="是否使用">
                 <el-input v-model="formData.isUsed" :disabled="'isUsed'==subColumn"></el-input>
             </el-form-item>
-                                                                                                                                                                                                                                                                                                                                                                                        <el-form-item prop="endTime" label="到期时间">
+            <el-form-item prop="endTime" label="到期时间">
                 <template>
                     <div class="block">
-                        <el-date-picker
-                                v-model="formData.endTime"
-                                type="date"
-                                value-format="timestamp"
-                                placeholder="选择日期"
-                                :disabled="'endTime'==subColumn">
+                        <el-date-picker v-model="formData.endTime" type="date" value-format="timestamp" placeholder="选择日期" :disabled="'endTime'==subColumn">
                         </el-date-picker>
                     </div>
                 </template>
             </el-form-item>
-                                                                                                                                                                                                                            <el-form-item>
+            <el-form-item>
                 <el-button @click="onSave" :loading="$store.state.fetchingData" type="primary">保存</el-button>
                 <el-button @click="onDelete" v-if="formData.id" type="danger">删除</el-button>
                 <el-button @click="$router.go(-1)">取消</el-button>
@@ -33,92 +27,92 @@
     </div>
 </template>
 <script>
-    import formValidator from '../formValidator'
+import formValidator from '../formValidator'
 
-    export default {
-        created() {
-            if (this.$route.query.column) {
-                this.subColumn = this.$route.query.column.split(',')[1];
-                this.subValue = this.$route.query.column.split(',')[0];
-            }
+export default {
+    created() {
+        if (this.$route.query.column) {
+            this.subColumn = this.$route.query.column.split(',')[1];
+            this.subValue = this.$route.query.column.split(',')[0];
+        }
+
+        if (this.$route.query.id) {
+            this.$http.get({
+                url: '/userCoupon/getOne',
+                data: {
+                    id: this.$route.query.id
+                }
+            }).then(res => {
+                if (res.success) {
 
-            if (this.$route.query.id) {
-                this.$http.get({
-                    url: '/userCoupon/getOne',
-                    data: {
-                        id: this.$route.query.id
-                    }
-                }).then(res => {
-                    if (res.success) {
 
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
-                        this.formData = res.data;
+                    this.formData = res.data;
 
                     if (this.$route.query.column) {
                         this.formData[this.subColumn] = this.subValue;
                     }
-                    }
-                })
-            }else {
-                if (this.$route.query.column) {
-                    this.formData[this.subColumn] = this.subValue;
                 }
+            })
+        } else {
+            if (this.$route.query.column) {
+                this.formData[this.subColumn] = this.subValue;
             }
+        }
 
-                                                                                                                                                                                                                                                                                                            },
-        data() {
-            return {
-                saving: false,
-                formData: {},
-                rules: {
-                                                                                                                                                                                                                                                                                                            },
-                                                                                            subColumn: '',
+    },
+    data() {
+        return {
+            saving: false,
+            formData: {},
+            rules: {
+            },
+            subColumn: '',
             subValue: '',
         }
+    },
+    methods: {
+        onSave() {
+            this.$refs.form.validate((valid) => {
+                if (valid) {
+                    this.submit();
+                } else {
+                    return false;
+                }
+            });
         },
-        methods: {
-            onSave() {
-                this.$refs.form.validate((valid) => {
-                    if (valid) {
-                        this.submit();
-                    } else {
-                        return false;
-                    }
-                });
-            },
-            submit() {
-                var data = JSON.parse(JSON.stringify(this.formData));
-                this.$http.post({
-                    url: this.formData.id ? '/userCoupon/update' : '/userCoupon/save',
-                    data: data
-                }).then(res => {
-                    if (res.success) {
-                        this.$message.success('成功');
-                        this.$router.go(-1);
-                    } else {
-                        this.$message.warning('失败')
-                    }
-                });
-            },
-            onDelete() {
-                this.$alert('删除将无法恢复,确认要删除么?', '警告', { type: 'error' }).then(() => {
-                    return this.$http.post({
+        submit() {
+            var data = JSON.parse(JSON.stringify(this.formData));
+            this.$http.post({
+                url: this.formData.id ? '/userCoupon/update' : '/userCoupon/save',
+                data: data
+            }).then(res => {
+                if (res.success) {
+                    this.$message.success('成功');
+                    this.$router.go(-1);
+                } else {
+                    this.$message.warning('失败')
+                }
+            });
+        },
+        onDelete() {
+            this.$alert('删除将无法恢复,确认要删除么?', '警告', { type: 'error' }).then(() => {
+                return this.$http.post({
                     url: '/userCoupon/del',
                     data: { id: this.formData.id }
-                    })
-                }).then(() => {
-                    this.$message.success('删除成功');
-                    this.$router.go(-1);
-                }).catch(action => {
-                    if (action === 'cancel') {
-                        this.$message.info('删除取消');
-                    } else {
-                        this.$message.error('删除失败');
-                    }
                 })
-            },
-        }
+            }).then(() => {
+                this.$message.success('删除成功');
+                this.$router.go(-1);
+            }).catch(action => {
+                if (action === 'cancel') {
+                    this.$message.info('删除取消');
+                } else {
+                    this.$message.error('删除失败');
+                }
+            })
+        },
     }
+}
 </script>
 <style lang="less" scoped>
 </style>