suochencheng 7 سال پیش
والد
کامیت
2eceb4ea82

+ 33 - 0
src/main/java/com/izouma/awesomeadmin/dao/UserFileInfoMapper.java

@@ -0,0 +1,33 @@
+package com.izouma.awesomeadmin.dao;
+
+import java.util.*;
+import com.izouma.awesomeadmin.datasource.DataSource;
+import org.springframework.stereotype.Repository;
+import com.izouma.awesomeadmin.model.UserFileInfo;
+
+
+/**
+*  Dao接口
+*/
+@Repository("com.zoumaframe.dao.UserFileInfoMapper")
+public interface UserFileInfoMapper{
+
+    int deleteByPrimaryKey(Integer id);
+
+    int insertSelective(UserFileInfo record);
+
+    UserFileInfo selectByPrimaryKey(Integer id);
+
+    int updateByPrimaryKeySelective(UserFileInfo record);
+
+    List<UserFileInfo> queryAllUserFileInfo(UserFileInfo record);
+
+    List<UserFileInfo> queryUserFileInfoByPage(Map<String, Object> parameter);
+
+    int delete(UserFileInfo record);
+
+    UserFileInfo queryUserFileInfo(UserFileInfo record);
+
+    List<UserFileInfo> query(UserFileInfo record);
+}
+

+ 478 - 0
src/main/java/com/izouma/awesomeadmin/dao/UserFileInfoMapper.xml

@@ -0,0 +1,478 @@
+<?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.UserFileInfoMapper" >
+    <resultMap id="BaseResultMap" type="com.izouma.awesomeadmin.model.UserFileInfo" >
+                <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="power" property="power" jdbcType="VARCHAR" />
+                                <result column="user_id" property="userId" jdbcType="INTEGER" />
+                                <result column="type_flag" property="typeFlag" jdbcType="VARCHAR" />
+                                <result column="file_name" property="fileName" jdbcType="VARCHAR" />
+                                <result column="url" property="url" jdbcType="VARCHAR" />
+                                <result column="file_size" property="fileSize" jdbcType="VARCHAR" />
+                                <result column="remark" property="remark" jdbcType="VARCHAR" />
+            </resultMap>
+    <sql id="Base_Column_List" >
+        <trim  suffixOverrides="," >
+            id,
+
+            del_flag,
+
+            update_time,
+
+            update_user,
+
+            create_time,
+
+            create_user,
+
+            power,
+
+            user_id,
+
+            type_flag,
+
+            file_name,
+
+            url,
+
+            file_size,
+
+            remark,
+
+            </trim>
+    </sql>
+    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
+        select
+        <include refid="Base_Column_List" />
+        from user_file_info
+        where id = #{id,jdbcType=INTEGER}
+    </select>
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
+        delete from user_file_info
+        where id = #{id,jdbcType=INTEGER}
+    </delete>
+    <insert id="insertSelective" parameterType="com.izouma.awesomeadmin.model.UserFileInfo" useGeneratedKeys="true" keyProperty="id">
+        insert into user_file_info
+        <trim prefix="(" suffix=")" suffixOverrides="," >
+                <if test="id!= null" >
+                id,
+            </if>
+                <if test="delFlag!= null" >
+                del_flag,
+            </if>
+                <if test="updateTime!= null" >
+                update_time,
+            </if>
+                <if test="updateUser!= null" >
+                update_user,
+            </if>
+                <if test="createTime!= null" >
+                create_time,
+            </if>
+                <if test="createUser!= null" >
+                create_user,
+            </if>
+                <if test="power!= null" >
+                power,
+            </if>
+                <if test="userId!= null" >
+                user_id,
+            </if>
+                <if test="typeFlag!= null" >
+                type_flag,
+            </if>
+                <if test="fileName!= null" >
+                file_name,
+            </if>
+                <if test="url!= null" >
+                url,
+            </if>
+                <if test="fileSize!= null" >
+                file_size,
+            </if>
+                <if test="remark!= null" >
+                remark,
+            </if>
+            </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides="," >
+                    <if test="id != null" >
+                #{id,jdbcType=INTEGER},
+            </if>
+                    <if test="delFlag != null" >
+                #{delFlag,jdbcType=CHAR},
+            </if>
+                    <if test="updateTime != null" >
+                #{updateTime,jdbcType=TIMESTAMP},
+            </if>
+                    <if test="updateUser != null" >
+                #{updateUser,jdbcType=VARCHAR},
+            </if>
+                    <if test="createTime != null" >
+                #{createTime,jdbcType=TIMESTAMP},
+            </if>
+                    <if test="createUser != null" >
+                #{createUser,jdbcType=VARCHAR},
+            </if>
+                    <if test="power != null" >
+                #{power,jdbcType=VARCHAR},
+            </if>
+                    <if test="userId != null" >
+                #{userId,jdbcType=INTEGER},
+            </if>
+                    <if test="typeFlag != null" >
+                #{typeFlag,jdbcType=VARCHAR},
+            </if>
+                    <if test="fileName != null" >
+                #{fileName,jdbcType=VARCHAR},
+            </if>
+                    <if test="url != null" >
+                #{url,jdbcType=VARCHAR},
+            </if>
+                    <if test="fileSize != null" >
+                #{fileSize,jdbcType=VARCHAR},
+            </if>
+                    <if test="remark != null" >
+                #{remark,jdbcType=VARCHAR},
+            </if>
+                </trim>
+    </insert>
+    <update id="updateByPrimaryKeySelective" parameterType="com.izouma.awesomeadmin.model.UserFileInfo" >
+        update user_file_info
+        <set >
+                    <if test="id != null" >
+               id= #{id,jdbcType=INTEGER},
+            </if>
+                     <if test="delFlag != null" >
+               del_flag= #{delFlag,jdbcType=CHAR},
+            </if>
+                     <if test="updateTime != null" >
+               update_time= #{updateTime,jdbcType=TIMESTAMP},
+            </if>
+                     <if test="updateUser != null" >
+               update_user= #{updateUser,jdbcType=VARCHAR},
+            </if>
+                     <if test="createTime != null" >
+               create_time= #{createTime,jdbcType=TIMESTAMP},
+            </if>
+                     <if test="createUser != null" >
+               create_user= #{createUser,jdbcType=VARCHAR},
+            </if>
+                     <if test="power != null" >
+               power= #{power,jdbcType=VARCHAR},
+            </if>
+                     <if test="userId != null" >
+               user_id= #{userId,jdbcType=INTEGER},
+            </if>
+                     <if test="typeFlag != null" >
+               type_flag= #{typeFlag,jdbcType=VARCHAR},
+            </if>
+                     <if test="fileName != null" >
+               file_name= #{fileName,jdbcType=VARCHAR},
+            </if>
+                     <if test="url != null" >
+               url= #{url,jdbcType=VARCHAR},
+            </if>
+                     <if test="fileSize != null" >
+               file_size= #{fileSize,jdbcType=VARCHAR},
+            </if>
+                     <if test="remark != null" >
+               remark= #{remark,jdbcType=VARCHAR},
+            </if>
+                 </set>
+        where
+        <if test="id != null and !&quot;&quot;.equals(id)">
+            id = #{id,jdbcType=INTEGER}
+        </if>
+
+        <if test="idStr != null and !&quot;&quot;.equals(idStr)">
+            id in (${idStr})
+        </if>
+
+    </update>
+    <select id="queryUserFileInfoByPage" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.UserFileInfo">
+        select <include refid="Base_Column_List"/> from user_file_info
+        <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>
+                     <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>
+                     <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>
+                     <if test="record.createUser != null and !&quot;&quot;.equals(record.createUser)">
+                and  create_user = #{record.createUser}
+            </if>
+                     <if test="record.power != null and !&quot;&quot;.equals(record.power)">
+                and  power = #{record.power}
+            </if>
+                     <if test="record.userId != null and !&quot;&quot;.equals(record.userId)">
+                and  user_id = #{record.userId}
+            </if>
+                     <if test="record.typeFlag != null and !&quot;&quot;.equals(record.typeFlag)">
+                and  type_flag = #{record.typeFlag}
+            </if>
+                     <if test="record.fileName != null and !&quot;&quot;.equals(record.fileName)">
+                and  file_name = #{record.fileName}
+            </if>
+                     <if test="record.url != null and !&quot;&quot;.equals(record.url)">
+                and  url = #{record.url}
+            </if>
+                     <if test="record.fileSize != null and !&quot;&quot;.equals(record.fileSize)">
+                and  file_size = #{record.fileSize}
+            </if>
+                     <if test="record.remark != null and !&quot;&quot;.equals(record.remark)">
+                and  remark = #{record.remark}
+            </if>
+                  <if test="record.searchKey != null and !&quot;&quot;.equals(record.searchKey)">
+             <trim prefix="and (" suffix=")" prefixOverrides="OR" >
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      OR  type_flag LIKE concat('%',#{record.searchKey},'%')
+                                                                                                    OR  file_name LIKE concat('%',#{record.searchKey},'%')
+                                                                                                    OR  url LIKE concat('%',#{record.searchKey},'%')
+                                                                                                    OR  file_size LIKE concat('%',#{record.searchKey},'%')
+                                                                                                    OR  remark 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('_;')">
+                    <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>
+
+                            </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>
+                        </otherwise>
+                    </choose>
+
+
+                </foreach>
+
+
+            </if>
+
+        </where>
+        order by
+
+        <if test="record.orderByStr != null and !&quot;&quot;.equals(record.orderByStr)">
+
+
+            <trim suffixOverrides=",">
+                <foreach item="item" index="index" separator="," collection="record.orderByStr.split('_;')">
+                    <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                        ${itemDetail}
+                    </foreach>
+                </foreach>
+            </trim>
+            ,
+        </if>
+        id desc
+    </select>
+    <select id="queryAllUserFileInfo" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.UserFileInfo">
+        select <include refid="Base_Column_List"/> from user_file_info
+        <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>
+                    <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>
+                    <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>
+                    <if test="createUser != null and !&quot;&quot;.equals(createUser)">
+                and  create_user = #{createUser}
+            </if>
+                    <if test="power != null and !&quot;&quot;.equals(power)">
+                and  power = #{power}
+            </if>
+                    <if test="userId != null and !&quot;&quot;.equals(userId)">
+                and  user_id = #{userId}
+            </if>
+                    <if test="typeFlag != null and !&quot;&quot;.equals(typeFlag)">
+                and  type_flag = #{typeFlag}
+            </if>
+                    <if test="fileName != null and !&quot;&quot;.equals(fileName)">
+                and  file_name = #{fileName}
+            </if>
+                    <if test="url != null and !&quot;&quot;.equals(url)">
+                and  url = #{url}
+            </if>
+                    <if test="fileSize != null and !&quot;&quot;.equals(fileSize)">
+                and  file_size = #{fileSize}
+            </if>
+                    <if test="remark != null and !&quot;&quot;.equals(remark)">
+                and  remark = #{remark}
+            </if>
+                    <if test="searchKey != null and !&quot;&quot;.equals(searchKey)">
+                <trim prefix="and (" suffix=")" prefixOverrides="OR" >
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                OR  type_flag LIKE concat('%',#{searchKey},'%')
+                                                                                                                                                        OR  file_name LIKE concat('%',#{searchKey},'%')
+                                                                                                                                                        OR  url LIKE concat('%',#{searchKey},'%')
+                                                                                                                                                        OR  file_size LIKE concat('%',#{searchKey},'%')
+                                                                                                                                                        OR  remark 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="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>
+            </otherwise>
+        </choose>
+
+
+    </foreach>
+
+
+</if>
+        </where>
+        order by
+
+        <if test="orderByStr != null and !&quot;&quot;.equals(orderByStr)">
+
+
+            <trim suffixOverrides=",">
+                <foreach item="item" index="index" separator="," collection="orderByStr.split('_;')">
+                    <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                        ${itemDetail}
+                    </foreach>
+                </foreach>
+            </trim>
+            ,
+        </if>
+
+        id desc
+    </select>
+    <select id="queryUserFileInfo" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.UserFileInfo">
+        select <include refid="Base_Column_List"/> from user_file_info
+        <where>
+            and del_flag = 'N'
+                    <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>
+                     <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>
+                     <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>
+                     <if test="power != null and !&quot;&quot;.equals(power)">
+                and power = #{power}
+            </if>
+                     <if test="userId != null and !&quot;&quot;.equals(userId)">
+                and user_id = #{userId}
+            </if>
+                     <if test="typeFlag != null and !&quot;&quot;.equals(typeFlag)">
+                and type_flag = #{typeFlag}
+            </if>
+                     <if test="fileName != null and !&quot;&quot;.equals(fileName)">
+                and file_name = #{fileName}
+            </if>
+                     <if test="url != null and !&quot;&quot;.equals(url)">
+                and url = #{url}
+            </if>
+                     <if test="fileSize != null and !&quot;&quot;.equals(fileSize)">
+                and file_size = #{fileSize}
+            </if>
+                     <if test="remark != null and !&quot;&quot;.equals(remark)">
+                and remark = #{remark}
+            </if>
+         
+        </where>
+        LIMIT 1
+    </select>
+    <update id="delete">
+        UPDATE user_file_info SET del_flag = 'Y'
+        where
+        <if test="id != null and !&quot;&quot;.equals(id)">
+            id = #{id,jdbcType=INTEGER}
+        </if>
+
+        <if test="idStr != null and !&quot;&quot;.equals(idStr)">
+            id in (${idStr})
+        </if>
+    </update>
+    <select id="query" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.UserFileInfo">
+        select <include refid="Base_Column_List"/> from user_file_info
+        <where>
+            and del_flag = 'N'
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    </where>
+        order by id desc
+    </select>
+</mapper>
+

+ 164 - 0
src/main/java/com/izouma/awesomeadmin/model/UserFileInfo.java

@@ -0,0 +1,164 @@
+package com.izouma.awesomeadmin.model;
+
+import java.util.*;
+import com.fasterxml.jackson.annotation.JsonAutoDetect;
+import com.fasterxml.jackson.annotation.JsonInclude;
+
+
+@JsonAutoDetect
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class UserFileInfo{
+    private Integer id;
+    private String delFlag;
+    private Date updateTime;
+    private String updateUser;
+    private Date createTime;
+    private String createUser;
+    private String power;
+    private Integer userId;
+    private String typeFlag;
+    private String fileName;
+    private String url;
+    private String fileSize;
+    private String remark;
+
+private String idStr;
+
+private String searchKey;
+
+/**
+* and,test_name,like,value;or,remark,=,123
+*/
+private String advancedQuery;
+
+/**
+* column_name_,desc_;column_name_,asc
+*/
+private String orderByStr;
+
+    public Integer getId(){
+        return this.id;
+    }
+
+    public void setId(Integer id){
+        this.id = id;
+    }
+    public String getDelFlag(){
+        return this.delFlag;
+    }
+
+    public void setDelFlag(String delFlag){
+        this.delFlag = delFlag;
+    }
+    public Date getUpdateTime(){
+        return this.updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime){
+        this.updateTime = updateTime;
+    }
+    public String getUpdateUser(){
+        return this.updateUser;
+    }
+
+    public void setUpdateUser(String updateUser){
+        this.updateUser = updateUser;
+    }
+    public Date getCreateTime(){
+        return this.createTime;
+    }
+
+    public void setCreateTime(Date createTime){
+        this.createTime = createTime;
+    }
+    public String getCreateUser(){
+        return this.createUser;
+    }
+
+    public void setCreateUser(String createUser){
+        this.createUser = createUser;
+    }
+    public String getPower(){
+        return this.power;
+    }
+
+    public void setPower(String power){
+        this.power = power;
+    }
+    public Integer getUserId(){
+        return this.userId;
+    }
+
+    public void setUserId(Integer userId){
+        this.userId = userId;
+    }
+    public String getTypeFlag(){
+        return this.typeFlag;
+    }
+
+    public void setTypeFlag(String typeFlag){
+        this.typeFlag = typeFlag;
+    }
+    public String getFileName(){
+        return this.fileName;
+    }
+
+    public void setFileName(String fileName){
+        this.fileName = fileName;
+    }
+    public String getUrl(){
+        return this.url;
+    }
+
+    public void setUrl(String url){
+        this.url = url;
+    }
+    public String getFileSize(){
+        return this.fileSize;
+    }
+
+    public void setFileSize(String fileSize){
+        this.fileSize = fileSize;
+    }
+    public String getRemark(){
+        return this.remark;
+    }
+
+    public void setRemark(String remark){
+        this.remark = remark;
+    }
+
+public String getSearchKey() {
+    return searchKey;
+}
+
+public void setSearchKey(String searchKey) {
+    this.searchKey = searchKey;
+}
+
+public String getAdvancedQuery() {
+    return advancedQuery;
+}
+
+public void setAdvancedQuery(String advancedQuery) {
+    this.advancedQuery = advancedQuery;
+}
+
+public String getOrderByStr() {
+    return orderByStr;
+}
+
+public void setOrderByStr(String orderByStr) {
+    this.orderByStr = orderByStr;
+}
+
+public String getIdStr() {
+    return idStr;
+}
+
+public void setIdStr(String idStr) {
+    this.idStr = idStr;
+}
+
+}
+

+ 27 - 0
src/main/java/com/izouma/awesomeadmin/service/UserFileInfoService.java

@@ -0,0 +1,27 @@
+package com.izouma.awesomeadmin.service;
+
+import java.util.*;
+import com.izouma.awesomeadmin.dto.Page;
+import com.izouma.awesomeadmin.model.UserFileInfo;
+
+
+/**
+*  service接口类
+*/
+public interface UserFileInfoService{
+
+    List<UserFileInfo> getUserFileInfoList(UserFileInfo record);
+
+    List<UserFileInfo> getUserFileInfoByPage(Page page, UserFileInfo record);
+
+    UserFileInfo getUserFileInfoById(String id);
+
+    UserFileInfo getUserFileInfo(UserFileInfo record);
+
+    boolean createUserFileInfo(UserFileInfo record);
+
+    boolean deleteUserFileInfo(UserFileInfo record);
+
+    boolean updateUserFileInfo(UserFileInfo record);
+}
+

+ 157 - 0
src/main/java/com/izouma/awesomeadmin/service/impl/UserFileInfoServiceImpl.java

@@ -0,0 +1,157 @@
+package com.izouma.awesomeadmin.service.impl;
+
+import java.util.*;
+
+import com.izouma.awesomeadmin.service.OSSFileService;
+import com.izouma.awesomeadmin.util.PropertiesFileLoader;
+import org.apache.commons.lang.StringUtils;
+import org.apache.log4j.Logger;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.izouma.awesomeadmin.constant.AppConstant;
+import com.izouma.awesomeadmin.dto.Page;
+import com.izouma.awesomeadmin.model.UserFileInfo;
+import com.izouma.awesomeadmin.service.UserFileInfoService;
+import com.izouma.awesomeadmin.dao.UserFileInfoMapper;
+
+/**
+ * service接口实现类
+ */
+@Service
+public class UserFileInfoServiceImpl implements UserFileInfoService {
+
+    private static Logger logger = Logger.getLogger(UserFileInfoServiceImpl.class);
+
+    @Autowired
+    private UserFileInfoMapper userFileInfoMapper;
+
+    @Autowired
+    private OSSFileService oSSFileService;
+
+    @Override
+    public List<UserFileInfo> getUserFileInfoList(UserFileInfo record) {
+
+        logger.info("getUserFileInfoList");
+        try {
+
+            return userFileInfoMapper.queryAllUserFileInfo(record);
+        } catch (Exception e) {
+            logger.error("getUserFileInfoList", e);
+        }
+
+        return null;
+    }
+
+    @Override
+    public List<UserFileInfo> getUserFileInfoByPage(Page page, UserFileInfo record) {
+
+        logger.info("getUserFileInfoByPage");
+        try {
+
+            Map<String, Object> parameter = new HashMap<String, Object>();
+            parameter.put("record", record);
+            parameter.put(AppConstant.PAGE, page);
+
+            return userFileInfoMapper.queryUserFileInfoByPage(parameter);
+        } catch (Exception e) {
+            logger.error("getUserFileInfoByPage", e);
+        }
+
+        return null;
+    }
+
+    @Override
+    public UserFileInfo getUserFileInfoById(String id) {
+
+        logger.info("getUserFileInfoyId");
+        try {
+
+            return userFileInfoMapper.selectByPrimaryKey(Integer.valueOf(id));
+        } catch (Exception e) {
+            logger.error("getUserFileInfoById", e);
+        }
+
+        return null;
+    }
+
+    @Override
+    public UserFileInfo getUserFileInfo(UserFileInfo record) {
+
+        logger.info("getUserFileInfo");
+        try {
+
+            return userFileInfoMapper.queryUserFileInfo(record);
+        } catch (Exception e) {
+            logger.error("getUserFileInfo", e);
+        }
+
+        return null;
+    }
+
+    @Override
+    public boolean createUserFileInfo(UserFileInfo record) {
+
+        logger.info("createUserFileInfo");
+        try {
+
+            int updates = userFileInfoMapper.insertSelective(record);
+
+            if (updates > 0) {
+                return true;
+            }
+        } catch (Exception e) {
+            logger.error("createUserFileInfo", e);
+        }
+
+        return false;
+    }
+
+    @Override
+    public boolean deleteUserFileInfo(UserFileInfo record) {
+
+        logger.info("deleteUserFileInfo");
+        try {
+            if (record.getId() != null || StringUtils.isNotEmpty(record.getIdStr())) {
+
+                List<UserFileInfo> userFileInfoList = userFileInfoMapper.queryAllUserFileInfo(record);
+                for (UserFileInfo fileInfo : userFileInfoList) {
+                    if (StringUtils.isNotEmpty(fileInfo.getUrl())) {
+
+                        String artwork = fileInfo.getUrl().replace(PropertiesFileLoader.getProperties("aliImageSever") + "/", "");
+                        oSSFileService.deleteObject(artwork);
+                    }
+                }
+
+            }
+
+            int updates = userFileInfoMapper.delete(record);
+
+            if (updates > 0) {
+                return true;
+            }
+        } catch (Exception e) {
+            logger.error("deleteUserFileInfo", e);
+        }
+
+        return false;
+    }
+
+    @Override
+    public boolean updateUserFileInfo(UserFileInfo record) {
+
+        logger.info("updateUserFileInfo");
+        try {
+
+            int updates = userFileInfoMapper.updateByPrimaryKeySelective(record);
+
+            if (updates > 0) {
+                return true;
+            }
+        } catch (Exception e) {
+            logger.error("updateUserFileInfo", e);
+        }
+
+        return false;
+    }
+}
+

+ 3 - 1
src/main/java/com/izouma/awesomeadmin/web/AssetsController.java

@@ -58,7 +58,9 @@ public class AssetsController {
                         for (int i = 0; i < 8; i++) {
                             randomCode.append(Integer.toString(random.nextInt(36), 36));
                         }
-                        String uploadPath = String.format("images/%s-%s.jpg", new SimpleDateFormat("yyyy-MM-dd-hh-mm-ss").format(new Date()), randomCode);
+                        String ext = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
+                        String fileType = file.getContentType().substring(0, file.getContentType().indexOf("/"));
+                        String uploadPath = String.format("%s/%s-%s%s", fileType, new SimpleDateFormat("yyyy-MM-dd-hh-mm-ss").format(new Date()), randomCode, ext);
                         String path = OSSFileService.upload(file.getInputStream(), uploadPath);
                         paths.add(path);
                     } catch (IOException e) {

+ 164 - 0
src/main/java/com/izouma/awesomeadmin/web/UserFileInfoController.java

@@ -0,0 +1,164 @@
+package com.izouma.awesomeadmin.web;
+
+import java.util.*;
+
+import com.izouma.awesomeadmin.util.ExportExcelUtil;
+import org.apache.commons.lang.StringUtils;
+import org.apache.shiro.authz.annotation.RequiresAuthentication;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.*;
+import com.izouma.awesomeadmin.constant.AppConstant;
+import com.izouma.awesomeadmin.dto.Page;
+import com.izouma.awesomeadmin.dto.Result;
+import com.izouma.awesomeadmin.model.UserFileInfo;
+import com.izouma.awesomeadmin.service.UserFileInfoService;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+*  controller类
+*/
+@Controller
+@RequestMapping("/userFileInfo")
+public class UserFileInfoController {
+
+    @Autowired
+    private UserFileInfoService userFileInfoService;
+
+    /**
+    * <p>获取全部记录。</p>
+    */
+    @RequiresAuthentication
+    @RequestMapping(value = "/all", method = RequestMethod.GET)
+    @ResponseBody
+    public Result all(UserFileInfo record) {
+        List<UserFileInfo> pp = userFileInfoService.getUserFileInfoList(record);
+        return new Result(true, pp);
+    }
+
+    /**
+    * <p>根据Id。</p>
+    */
+    @RequestMapping(value = "/getUserFileInfo", method = RequestMethod.GET)
+    @ResponseBody
+    public Result getUserFileInfo(@RequestParam(required = false, value = "id") String id) {
+        UserFileInfo data = userFileInfoService.getUserFileInfoById(id);
+        return new Result(true, data);
+    }
+
+    /**
+    * <p>根据条件获取。</p>
+    */
+    @RequestMapping(value = "/getOne", method = RequestMethod.GET)
+    @ResponseBody
+    public Result getOne(UserFileInfo record) {
+        UserFileInfo data = userFileInfoService.getUserFileInfo(record);
+        return new Result(true, data);
+    }
+
+
+    /**
+    * <p>分页查询。</p>
+    */
+    @RequestMapping(value = "/page", method = RequestMethod.GET)
+    @ResponseBody
+    public Result page(Page page, UserFileInfo record) {
+        Map<String, Object> result = new HashMap<>();
+
+        List<UserFileInfo> pp =userFileInfoService.getUserFileInfoByPage(page, record);
+
+        result.put(AppConstant.PAGE, page);
+        result.put("pp", pp);
+        return new Result(true, result);
+    }
+
+
+    /**
+    * <p>保存。</p>
+    */
+    @RequestMapping(value = "/save", method = RequestMethod.POST)
+    @ResponseBody
+    public Result save(UserFileInfo record) {
+        boolean num = userFileInfoService.createUserFileInfo(record);
+        if (num) {
+        return new Result(true, record.getId());
+        }
+        return new Result(false, "保存异常");
+    }
+
+    /**
+    * <p>更新信息。</p>
+    */
+    @RequestMapping(value = "/update", method = RequestMethod.POST)
+    @ResponseBody
+    public Result updateUserFileInfo(UserFileInfo record) {
+        boolean num = userFileInfoService.updateUserFileInfo(record);
+        if (num) {
+        return new Result(true, "保存成功");
+        }
+        return new Result(false, "保存异常");
+    }
+
+    /**
+    * <p>删除。</p>
+    */
+    @RequestMapping(value = "/del", method = RequestMethod.POST)
+    @ResponseBody
+    public Result deleteUserFileInfo(UserFileInfo record) {
+
+        boolean num = userFileInfoService.deleteUserFileInfo(record);
+        if (num) {
+        return new Result(true, "删除成功");
+        }
+        return new Result(false, "删除异常");
+    }
+
+    /**
+    * 导出Excel
+    * @param request
+    * @param response
+    * @param record
+    * @throws Exception
+    */
+    @RequestMapping(value = "/exportExcel", method = RequestMethod.GET)
+    @ResponseBody
+    public void exportExcel(HttpServletRequest request, HttpServletResponse response, UserFileInfo record) throws Exception {
+
+    List<UserFileInfo> userFileInfos = userFileInfoService.getUserFileInfoList(record);
+
+
+        String sheetName = "user_file_info";
+        String titleName = "文件管理数据表";
+        String fileName = "文件管理表";
+        int columnNumber = 13;
+        int[] columnWidth = { 20,  20,  20,  20,  20,  20,  20,  20,  20,  20,  20,  20,  20 };
+        String[] columnName = {  "ID" ,   "删除标识" ,   "更新时间" ,   "更新人" ,   "创建时间" ,   "创建人" ,   "权限" ,   "用户" ,   "类型" ,   "文件名" ,   "URL" ,   "大小" ,   "备注"  };
+        String[][] dataList = new String[userFileInfos.size()][13];
+
+        for (int i = 0; i < userFileInfos.size(); i++) {
+
+                        dataList[i][0] = String.valueOf(userFileInfos.get(i).getId());
+                        dataList[i][1] = String.valueOf(userFileInfos.get(i).getDelFlag());
+                        dataList[i][2] = String.valueOf(userFileInfos.get(i).getUpdateTime());
+                        dataList[i][3] = String.valueOf(userFileInfos.get(i).getUpdateUser());
+                        dataList[i][4] = String.valueOf(userFileInfos.get(i).getCreateTime());
+                        dataList[i][5] = String.valueOf(userFileInfos.get(i).getCreateUser());
+                        dataList[i][6] = String.valueOf(userFileInfos.get(i).getPower());
+                        dataList[i][7] = String.valueOf(userFileInfos.get(i).getUserId());
+                        dataList[i][8] = String.valueOf(userFileInfos.get(i).getTypeFlag());
+                        dataList[i][9] = String.valueOf(userFileInfos.get(i).getFileName());
+                        dataList[i][10] = String.valueOf(userFileInfos.get(i).getUrl());
+                        dataList[i][11] = String.valueOf(userFileInfos.get(i).getFileSize());
+                        dataList[i][12] = String.valueOf(userFileInfos.get(i).getRemark());
+                    }
+
+
+        ExportExcelUtil.ExportWithResponse(sheetName, titleName, fileName,
+        columnNumber, columnWidth, columnName, dataList, response);
+
+
+        }
+    }
+

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

@@ -1,7 +1,7 @@
 <template>
     <div>
         <div class="filters-container">
-
+            <el-button size="small" @click="$router.go(-1)">返回</el-button>
             <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>

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

@@ -1,7 +1,7 @@
 <template>
     <div>
         <div class="filters-container">
-
+            <el-button size="small" @click="$router.go(-1)">返回</el-button>
             <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>

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

@@ -1,7 +1,7 @@
 <template>
     <div>
         <div class="filters-container">
-
+            <el-button size="small" @click="$router.go(-1)">返回</el-button>
             <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>

+ 6 - 6
src/main/vue/src/pages/AreaInfos.vue

@@ -1,7 +1,7 @@
 <template>
     <div>
         <div class="filters-container">
-
+            <el-button size="small" @click="$router.go(-1)">返回</el-button>
             <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>
@@ -13,7 +13,7 @@
             </el-button>
             <el-button @click="exportExcel" type="primary" size="small" icon="el-icon-share" class="filter-item">导出EXCEL
             </el-button>
-             <el-button @click="goArea" type="success" size="small" class="filter-item">区域地图
+            <el-button @click="goArea" type="success" size="small" class="filter-item">区域地图
             </el-button>
             <el-dropdown trigger="click" size="medium" class="table-column-filter">
                 <span>
@@ -420,11 +420,11 @@ export default {
         }
     },
     methods: {
-        goArea(){
-          
+        goArea() {
+
             this.$router.push({
-                name:'drugArea',
-                query:{
+                name: 'drugArea',
+                query: {
                     column: this.$route.query.column
                 }
             })

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

@@ -1,7 +1,7 @@
 <template>
     <div>
         <div class="filters-container">
-
+            <el-button size="small" @click="$router.go(-1)">返回</el-button>
             <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>

+ 2 - 2
src/main/vue/src/pages/LandMarks.vue

@@ -1,7 +1,7 @@
 <template>
     <div>
         <div class="filters-container">
-
+            <el-button size="small"  @click="$router.go(-1)">返回</el-button>
             <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>
@@ -271,7 +271,7 @@ export default {
                 {
                     label: '地标简介',
                     value: 'markDescribe',
-                    show: true
+                    show: false
                 },
                 {
                     label: '识别图组名称',

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

@@ -1,7 +1,7 @@
 <template>
     <div>
         <div class="filters-container">
-
+            <el-button size="small" @click="$router.go(-1)">返回</el-button>
             <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>

+ 152 - 0
src/main/vue/src/pages/UserFileInfo.vue

@@ -0,0 +1,152 @@
+<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="typeFlag" label="类型">
+                <el-input v-model="formData.typeFlag" :disabled="'typeFlag'==subColumn"></el-input>
+            </el-form-item>
+            <el-form-item prop="url" label="文件">
+                <el-upload class="upload-demo" :action="$baseUrl+'/assets/uploadFile'" :on-success='haleSuccess' :before-upload='beforeUpload' :multiple="false" :file-list="fileList">
+                    <el-button size="small" type="primary" :disabled="'url'==subColumn">点击上传</el-button>
+                    <div slot="tip" class="el-upload__tip">只能上传单个文件 ,且不超过500kb</div>
+                </el-upload>
+            </el-form-item>
+            <el-form-item prop="url" label="URL">
+                <el-input v-model="formData.url" :disabled="'url'==subColumn"></el-input>
+            </el-form-item>
+            <el-form-item prop="fileName" label="文件名">
+                <el-input v-model="formData.fileName" :disabled="'fileName'==subColumn"></el-input>
+            </el-form-item>
+            <el-form-item prop="fileSize" label="大小(KB)">
+                <el-input v-model="formData.fileSize" :disabled="'fileSize'==subColumn"></el-input>
+            </el-form-item>
+            <el-form-item prop="remark" label="备注">
+                <el-input v-model="formData.remark" :disabled="'remark'==subColumn"></el-input>
+            </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>
+            </el-form-item>
+        </el-form>
+    </div>
+</template>
+<script>
+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];
+        }
+
+        if (this.$route.query.id) {
+            this.$http.get({
+                url: '/userFileInfo/getOne',
+                data: {
+                    id: this.$route.query.id
+                }
+            }).then(res => {
+                if (res.success) {
+
+
+                    this.formData = res.data;
+
+                    if (this.$route.query.column) {
+                        this.formData[this.subColumn] = this.subValue;
+                    }
+
+                    var jsonp = {
+                        name: res.data.fileName,
+                        url: res.data.url
+                    }
+                    this.fileList.push(jsonp)
+
+                }
+            })
+        } else {
+            if (this.$route.query.column) {
+                this.formData[this.subColumn] = this.subValue;
+            }
+        }
+
+    },
+    data() {
+        return {
+            saving: false,
+            formData: {},
+            rules: {
+                typeFlag:
+                    [
+                        { required: true, message: '请输入 类型', trigger: 'blur' },
+                    ],
+            },
+            subColumn: '',
+            subValue: '',
+            fileList: [],
+        }
+    },
+    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 ? '/userFileInfo/update' : '/userFileInfo/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: '/userFileInfo/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('删除失败');
+                }
+            })
+        },
+        haleSuccess(file) {
+            console.log(file)
+            file.data.forEach(item => {
+                var nameList = item.split('/')
+                var jsonp = {
+                    name: nameList[nameList.length - 1],
+                    url: item
+                }
+                this.fileList.splice(0, 1, jsonp)
+                this.formData.url = item
+
+            })
+        },
+        beforeUpload(file) {
+            this.formData.fileName = file.name;
+            this.formData.fileSize = (file.size/1024).toFixed(2);
+            console.log(file)
+        }
+    }
+}
+</script>
+<style lang="less" scoped>
+</style>

+ 444 - 0
src/main/vue/src/pages/UserFileInfos.vue

@@ -0,0 +1,444 @@
+<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>
+            <el-button @click="showTableSortDialog = !showTableSortDialog" type="primary" size="small" icon="el-icon-sort" class="filter-item">排序
+            </el-button>
+            <el-button @click="$router.push({path:'/userFileInfo',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>
+                </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}}
+                    </el-checkbox>
+                </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-column>
+            <el-table-column type="index" min-width="50" align="center">
+            </el-table-column>
+
+            <el-table-column v-if="isColumnShow('id')" prop="id" label="ID" min-width="100">
+            </el-table-column>
+
+            <el-table-column v-if="isColumnShow('updateTime')" prop="updateTime" label="更新时间" :formatter="DateTimeFormatter" min-width="100">
+            </el-table-column>
+
+            <el-table-column v-if="isColumnShow('typeFlag')" prop="typeFlag" label="类型" min-width="100">
+            </el-table-column>
+
+            <el-table-column v-if="isColumnShow('fileName')" prop="fileName" label="文件名" min-width="100">
+            </el-table-column>
+
+            <el-table-column v-if="isColumnShow('url')" prop="url" label="URL" min-width="100">
+            </el-table-column>
+
+            <el-table-column v-if="isColumnShow('fileSize')" prop="fileSize" label="大小(kb)" min-width="100">
+            </el-table-column>
+
+            <el-table-column v-if="isColumnShow('remark')" prop="remark" 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="deleteRow(scope.row)" type="danger" size="mini" plain>删除</el-button>
+                </template>
+            </el-table-column>
+        </el-table>
+        <div class="pagination-wrapper">
+            <div class="multiple-mode-wrapper" v-if="0">
+                <el-button size="small" v-if="!multipleMode" @click="toggleMultipleMode(true)">批量编辑</el-button>
+                <el-button-group v-else>
+                    <el-button size="small" @click="operation1">批量操作1</el-button>
+                    <el-button size="small" @click="operation2">批量操作2</el-button>
+                    <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>
+        </div>
+        <el-dialog title="高级查询" :visible.sync="showAdvancedQueryDialog">
+            <el-button @click="addField" type="text" icon="el-icon-plus">添加</el-button>
+            <el-table :data="advancedQueryFields">
+
+                <el-table-column prop="link" label="链接符" align="center">
+                    <template slot-scope="{row}">
+                        <el-select placeholder="链接" size="small" v-model="row.link" class="filter-item">
+                            <el-option label="AND" value="AND">
+                            </el-option>
+                            <el-option label="OR" value="OR">
+                            </el-option>
+                        </el-select>
+                    </template>
+                </el-table-column>
+                <el-table-column prop="name" label="字段" align="center">
+                    <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-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-select>
+                    </template>
+                </el-table-column>
+                <el-table-column prop="value" label="参数" align="center">
+                    <template slot-scope="{row}">
+                        <el-input v-model="row.value"></el-input>
+                    </template>
+                </el-table-column>
+                <el-table-column width="60" align="center">
+                    <template slot-scope="{ row, column, $index }">
+                        <el-button @click="removeField($index)" size="small" type="text">删除</el-button>
+                    </template>
+                </el-table-column>
+            </el-table>
+
+            <span slot="footer" class="dialog-footer">
+
+                <el-button @click="advancedQuery" :loading="$store.state.fetchingData">确定</el-button>
+            </span>
+        </el-dialog>
+
+        <el-dialog title="排序" :visible.sync="showTableSortDialog">
+            <el-button @click="addSortField" type="text" icon="el-icon-plus">添加</el-button>
+            <el-table :data="tableSortFields">
+
+                <el-table-column prop="name" label="字段" align="center">
+                    <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-select>
+                    </template>
+                </el-table-column>
+                <el-table-column prop="order" label="排序" align="center">
+                    <template slot-scope="{row}">
+                        <el-select v-model="row.order">
+                            <el-option label="降序" value="desc">
+                            </el-option>
+                            <el-option label="升序" value="asc">
+                            </el-option>
+                        </el-select>
+                    </template>
+                </el-table-column>
+                <el-table-column width="60" align="center">
+                    <template slot-scope="{ row, column, $index }">
+                        <el-button @click="removeSortField($index)" size="small" type="text">删除</el-button>
+                    </template>
+                </el-table-column>
+            </el-table>
+
+            <span slot="footer" class="dialog-footer">
+
+                <el-button @click="tableSortQuery" :loading="$store.state.fetchingData">确定</el-button>
+            </span>
+        </el-dialog>
+
+        <el-dialog title="查看图片" :visible.sync="imageDialogVisible" size="small">
+            <img width="100%" :src="imgSrc" alt="">
+        </el-dialog>
+
+    </div>
+</template>
+<script>
+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: 'ID',
+                    value: 'id',
+                    show: true
+                },
+                {
+                    label: '更新时间',
+                    value: 'updateTime',
+                    show: true
+                },
+                {
+                    label: '类型',
+                    value: 'typeFlag',
+                    show: true
+                },
+                {
+                    label: '文件名',
+                    value: 'fileName',
+                    show: true
+                },
+                {
+                    label: 'URL',
+                    value: 'url',
+                    show: true
+                },
+                {
+                    label: '大小',
+                    value: 'fileSize',
+                    show: true
+                },
+                {
+                    label: '备注',
+                    value: 'remark',
+                    show: true
+                },
+            ],
+            multipleMode: false,
+            showAdvancedQueryDialog: false,
+            advancedQueryFields: [],
+            showTableSortDialog: false,
+            tableSortFields: [],
+            searchMethods: ['=', '!=', '>', '>=', '<', '<=', 'like'],
+            advancedQueryColumns: [
+                {
+                    label: 'ID',
+                    value: 'id'
+                },
+                {
+                    label: '更新时间',
+                    value: 'update_time'
+                },
+                {
+                    label: '类型',
+                    value: 'type_flag'
+                },
+                {
+                    label: '文件名',
+                    value: 'file_name'
+                },
+                {
+                    label: 'URL',
+                    value: 'url'
+                },
+                {
+                    label: '大小',
+                    value: 'file_size'
+                },
+                {
+                    label: '备注',
+                    value: 'remark'
+                },
+            ],
+            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();
+        },
+        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];
+            }
+
+            this.$http.get({
+                url: '/userFileInfo/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();
+            }
+        },
+        editRow(row) {
+            this.$router.push({
+                path: '/userFileInfo',
+                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);
+            }
+        },
+        advancedQuery() {
+
+            this.advancedQuerySearchKey = '';
+
+            if (this.advancedQueryFields.length > 0) {
+
+                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);
+                    }
+                })
+
+                if (templist.length > 0) {
+
+                    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.orderByStr = '';
+
+            if (this.tableSortFields.length > 0) {
+
+                var templist = [];
+
+                this.tableSortFields.forEach(item => {
+                    if (item.name && item.order) {
+                        var tempItem = item.name + '_,' + item.order;
+                        templist.push(tempItem);
+                    }
+                })
+
+                if (templist.length > 0) {
+
+                    this.orderByStr = templist.join('_;');
+                }
+            }
+
+            this.getData();
+            this.showTableSortDialog = false;
+        },
+        exportExcel() {
+            window.location.href = this.$baseUrl + "/userFileInfo/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: '/userFileInfo/del',
+                    data: { id: row.id }
+                })
+            }).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 })
+            }
+
+        },
+        showImg(img) {
+            this.imgSrc = img;
+            this.imageDialogVisible = true;
+        },
+
+    }
+}
+</script>
+<style lang="less" scoped>
+</style>

+ 11 - 1
src/main/vue/src/router/index.js

@@ -529,6 +529,16 @@ const router = new Router({
                     path: '/aimPlaceInfos',
                         name: 'AimPlaceInfos',
                     component: () => import('../pages/AimPlaceInfos')
+                },
+                {
+                    path: '/userFileInfo',
+                    name: 'UserFileInfo',
+                    component: () => import('../pages/UserFileInfo')
+                },
+                {
+                    path: '/userFileInfos',
+                    name: 'UserFileInfos',
+                    component: () => import('../pages/UserFileInfos')
                 }
                 /**INSERT_LOCATION**/
             ]
@@ -583,4 +593,4 @@ router.afterEach((to, from) => {
     window.onresize();
 });
 
-export default router;
+export default router;