1
0
suochencheng 7 жил өмнө
parent
commit
224dcc84b7

+ 33 - 0
src/main/java/com/izouma/awesomeadmin/dao/ImageDownLogMapper.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.ImageDownLog;
+
+
+/**
+*  Dao接口
+*/
+@Repository("com.zoumaframe.dao.ImageDownLogMapper")
+public interface ImageDownLogMapper{
+
+    int deleteByPrimaryKey(Integer id);
+
+    int insertSelective(ImageDownLog record);
+
+    ImageDownLog selectByPrimaryKey(Integer id);
+
+    int updateByPrimaryKeySelective(ImageDownLog record);
+
+    List<ImageDownLog> queryAllImageDownLog(ImageDownLog record);
+
+    List<ImageDownLog> queryImageDownLogByPage(Map<String, Object> parameter);
+
+    int delete(ImageDownLog record);
+
+    ImageDownLog queryImageDownLog(ImageDownLog record);
+
+    List<ImageDownLog> query(ImageDownLog record);
+}
+

+ 505 - 0
src/main/java/com/izouma/awesomeadmin/dao/ImageDownLogMapper.xml

@@ -0,0 +1,505 @@
+<?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.ImageDownLogMapper" >
+    <resultMap id="BaseResultMap" type="com.izouma.awesomeadmin.model.ImageDownLog" >
+                <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="order_id" property="orderId" jdbcType="VARCHAR" />
+                                <result column="type_flag" property="typeFlag" jdbcType="VARCHAR" />
+                                <result column="image_name" property="imageName" jdbcType="VARCHAR" />
+                                <result column="status_flag" property="statusFlag" jdbcType="INTEGER" />
+                                <result column="image_size" property="imageSize" jdbcType="DECIMAL" />
+                                <result column="image_code" property="imageCode" jdbcType="VARCHAR" />
+                                <result column="total_num" property="totalNum" jdbcType="INTEGER" />
+                                <result column="now_num" property="nowNum" jdbcType="INTEGER" />
+            </resultMap>
+    <sql id="Base_Column_List" >
+        <trim  suffixOverrides="," >
+            id,
+
+            del_flag,
+
+            update_time,
+
+            update_user,
+
+            create_time,
+
+            create_user,
+
+            order_id,
+
+            type_flag,
+
+            image_name,
+
+            status_flag,
+
+            image_size,
+
+            image_code,
+
+            total_num,
+
+            now_num,
+
+            </trim>
+    </sql>
+    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
+        select
+        <include refid="Base_Column_List" />
+        from image_down_log
+        where id = #{id,jdbcType=INTEGER}
+    </select>
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
+        delete from image_down_log
+        where id = #{id,jdbcType=INTEGER}
+    </delete>
+    <insert id="insertSelective" parameterType="com.izouma.awesomeadmin.model.ImageDownLog" useGeneratedKeys="true" keyProperty="id">
+        insert into image_down_log
+        <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="orderId!= null" >
+                order_id,
+            </if>
+                <if test="typeFlag!= null" >
+                type_flag,
+            </if>
+                <if test="imageName!= null" >
+                image_name,
+            </if>
+                <if test="statusFlag!= null" >
+                status_flag,
+            </if>
+                <if test="imageSize!= null" >
+                image_size,
+            </if>
+                <if test="imageCode!= null" >
+                image_code,
+            </if>
+                <if test="totalNum!= null" >
+                total_num,
+            </if>
+                <if test="nowNum!= null" >
+                now_num,
+            </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="orderId != null" >
+                #{orderId,jdbcType=VARCHAR},
+            </if>
+                    <if test="typeFlag != null" >
+                #{typeFlag,jdbcType=VARCHAR},
+            </if>
+                    <if test="imageName != null" >
+                #{imageName,jdbcType=VARCHAR},
+            </if>
+                    <if test="statusFlag != null" >
+                #{statusFlag,jdbcType=INTEGER},
+            </if>
+                    <if test="imageSize != null" >
+                #{imageSize,jdbcType=DECIMAL},
+            </if>
+                    <if test="imageCode != null" >
+                #{imageCode,jdbcType=VARCHAR},
+            </if>
+                    <if test="totalNum != null" >
+                #{totalNum,jdbcType=INTEGER},
+            </if>
+                    <if test="nowNum != null" >
+                #{nowNum,jdbcType=INTEGER},
+            </if>
+                </trim>
+    </insert>
+    <update id="updateByPrimaryKeySelective" parameterType="com.izouma.awesomeadmin.model.ImageDownLog" >
+        update image_down_log
+        <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="orderId != null" >
+               order_id= #{orderId,jdbcType=VARCHAR},
+            </if>
+                     <if test="typeFlag != null" >
+               type_flag= #{typeFlag,jdbcType=VARCHAR},
+            </if>
+                     <if test="imageName != null" >
+               image_name= #{imageName,jdbcType=VARCHAR},
+            </if>
+                     <if test="statusFlag != null" >
+               status_flag= #{statusFlag,jdbcType=INTEGER},
+            </if>
+                     <if test="imageSize != null" >
+               image_size= #{imageSize,jdbcType=DECIMAL},
+            </if>
+                     <if test="imageCode != null" >
+               image_code= #{imageCode,jdbcType=VARCHAR},
+            </if>
+                     <if test="totalNum != null" >
+               total_num= #{totalNum,jdbcType=INTEGER},
+            </if>
+                     <if test="nowNum != null" >
+               now_num= #{nowNum,jdbcType=INTEGER},
+            </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="queryImageDownLogByPage" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.ImageDownLog">
+        select <include refid="Base_Column_List"/> from image_down_log
+        <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.orderId != null and !&quot;&quot;.equals(record.orderId)">
+                and  order_id = #{record.orderId}
+            </if>
+                     <if test="record.typeFlag != null and !&quot;&quot;.equals(record.typeFlag)">
+                and  type_flag = #{record.typeFlag}
+            </if>
+                     <if test="record.imageName != null and !&quot;&quot;.equals(record.imageName)">
+                and  image_name = #{record.imageName}
+            </if>
+                     <if test="record.statusFlag != null and !&quot;&quot;.equals(record.statusFlag)">
+                and  status_flag = #{record.statusFlag}
+            </if>
+                     <if test="record.imageSize != null and !&quot;&quot;.equals(record.imageSize)">
+                and  image_size = #{record.imageSize}
+            </if>
+                     <if test="record.imageCode != null and !&quot;&quot;.equals(record.imageCode)">
+                and  image_code = #{record.imageCode}
+            </if>
+                     <if test="record.totalNum != null and !&quot;&quot;.equals(record.totalNum)">
+                and  total_num = #{record.totalNum}
+            </if>
+                     <if test="record.nowNum != null and !&quot;&quot;.equals(record.nowNum)">
+                and  now_num = #{record.nowNum}
+            </if>
+                  <if test="record.searchKey != null and !&quot;&quot;.equals(record.searchKey)">
+             <trim prefix="and (" suffix=")" prefixOverrides="OR" >
+                                                                                                                                                                                                                                                                                                                                                                                                                                    OR  order_id LIKE concat('%',#{record.searchKey},'%')
+                                                                                                    OR  type_flag LIKE concat('%',#{record.searchKey},'%')
+                                                                                                    OR  image_name LIKE concat('%',#{record.searchKey},'%')
+                                                                                                    OR  status_flag LIKE concat('%',#{record.searchKey},'%')
+                                                                                                    OR  image_size LIKE concat('%',#{record.searchKey},'%')
+                                                                                                    OR  image_code LIKE concat('%',#{record.searchKey},'%')
+                                                                                                    OR  total_num LIKE concat('%',#{record.searchKey},'%')
+                                                                                                    OR  now_num 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="queryAllImageDownLog" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.ImageDownLog">
+        select <include refid="Base_Column_List"/> from image_down_log
+        <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="orderId != null and !&quot;&quot;.equals(orderId)">
+                and  order_id = #{orderId}
+            </if>
+                    <if test="typeFlag != null and !&quot;&quot;.equals(typeFlag)">
+                and  type_flag = #{typeFlag}
+            </if>
+                    <if test="imageName != null and !&quot;&quot;.equals(imageName)">
+                and  image_name = #{imageName}
+            </if>
+                    <if test="statusFlag != null and !&quot;&quot;.equals(statusFlag)">
+                and  status_flag = #{statusFlag}
+            </if>
+                    <if test="imageSize != null and !&quot;&quot;.equals(imageSize)">
+                and  image_size = #{imageSize}
+            </if>
+                    <if test="imageCode != null and !&quot;&quot;.equals(imageCode)">
+                and  image_code = #{imageCode}
+            </if>
+                    <if test="totalNum != null and !&quot;&quot;.equals(totalNum)">
+                and  total_num = #{totalNum}
+            </if>
+                    <if test="nowNum != null and !&quot;&quot;.equals(nowNum)">
+                and  now_num = #{nowNum}
+            </if>
+                    <if test="searchKey != null and !&quot;&quot;.equals(searchKey)">
+                <trim prefix="and (" suffix=")" prefixOverrides="OR" >
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                OR  order_id LIKE concat('%',#{searchKey},'%')
+                                                                                                                                                        OR  type_flag LIKE concat('%',#{searchKey},'%')
+                                                                                                                                                        OR  image_name LIKE concat('%',#{searchKey},'%')
+                                                                                                                                                        OR  status_flag LIKE concat('%',#{searchKey},'%')
+                                                                                                                                                        OR  image_size LIKE concat('%',#{searchKey},'%')
+                                                                                                                                                        OR  image_code LIKE concat('%',#{searchKey},'%')
+                                                                                                                                                        OR  total_num LIKE concat('%',#{searchKey},'%')
+                                                                                                                                                        OR  now_num 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="queryImageDownLog" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.ImageDownLog">
+        select <include refid="Base_Column_List"/> from image_down_log
+        <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="orderId != null and !&quot;&quot;.equals(orderId)">
+                and order_id = #{orderId}
+            </if>
+                     <if test="typeFlag != null and !&quot;&quot;.equals(typeFlag)">
+                and type_flag = #{typeFlag}
+            </if>
+                     <if test="imageName != null and !&quot;&quot;.equals(imageName)">
+                and image_name = #{imageName}
+            </if>
+                     <if test="statusFlag != null and !&quot;&quot;.equals(statusFlag)">
+                and status_flag = #{statusFlag}
+            </if>
+                     <if test="imageSize != null and !&quot;&quot;.equals(imageSize)">
+                and image_size = #{imageSize}
+            </if>
+                     <if test="imageCode != null and !&quot;&quot;.equals(imageCode)">
+                and image_code = #{imageCode}
+            </if>
+                     <if test="totalNum != null and !&quot;&quot;.equals(totalNum)">
+                and total_num = #{totalNum}
+            </if>
+                     <if test="nowNum != null and !&quot;&quot;.equals(nowNum)">
+                and now_num = #{nowNum}
+            </if>
+         
+        </where>
+        LIMIT 1
+    </select>
+    <update id="delete">
+        UPDATE image_down_log 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.ImageDownLog">
+        select <include refid="Base_Column_List"/> from image_down_log
+        <where>
+            and del_flag = 'N'
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </where>
+        order by id desc
+    </select>
+</mapper>
+

+ 173 - 0
src/main/java/com/izouma/awesomeadmin/model/ImageDownLog.java

@@ -0,0 +1,173 @@
+package com.izouma.awesomeadmin.model;
+
+import java.math.BigDecimal;
+import java.util.*;
+import com.fasterxml.jackson.annotation.JsonAutoDetect;
+import com.fasterxml.jackson.annotation.JsonInclude;
+
+
+@JsonAutoDetect
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class ImageDownLog{
+    private Integer id;
+    private String delFlag;
+    private Date updateTime;
+    private String updateUser;
+    private Date createTime;
+    private String createUser;
+    private String orderId;
+    private String typeFlag;
+    private String imageName;
+    private Integer statusFlag;
+    private BigDecimal imageSize;
+    private String imageCode;
+    private Integer totalNum;
+    private Integer nowNum;
+
+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 getOrderId(){
+        return this.orderId;
+    }
+
+    public void setOrderId(String orderId){
+        this.orderId = orderId;
+    }
+    public String getTypeFlag(){
+        return this.typeFlag;
+    }
+
+    public void setTypeFlag(String typeFlag){
+        this.typeFlag = typeFlag;
+    }
+    public String getImageName(){
+        return this.imageName;
+    }
+
+    public void setImageName(String imageName){
+        this.imageName = imageName;
+    }
+    public Integer getStatusFlag(){
+        return this.statusFlag;
+    }
+
+    public void setStatusFlag(Integer statusFlag){
+        this.statusFlag = statusFlag;
+    }
+    public BigDecimal getImageSize(){
+        return this.imageSize;
+    }
+
+    public void setImageSize(BigDecimal imageSize){
+        this.imageSize = imageSize;
+    }
+    public String getImageCode(){
+        return this.imageCode;
+    }
+
+    public void setImageCode(String imageCode){
+        this.imageCode = imageCode;
+    }
+    public Integer getTotalNum(){
+        return this.totalNum;
+    }
+
+    public void setTotalNum(Integer totalNum){
+        this.totalNum = totalNum;
+    }
+    public Integer getNowNum(){
+        return this.nowNum;
+    }
+
+    public void setNowNum(Integer nowNum){
+        this.nowNum = nowNum;
+    }
+
+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/ImageDownLogService.java

@@ -0,0 +1,27 @@
+package com.izouma.awesomeadmin.service;
+
+import java.util.*;
+import com.izouma.awesomeadmin.dto.Page;
+import com.izouma.awesomeadmin.model.ImageDownLog;
+
+
+/**
+*  service接口类
+*/
+public interface ImageDownLogService{
+
+    List<ImageDownLog> getImageDownLogList(ImageDownLog record);
+
+    List<ImageDownLog> getImageDownLogByPage(Page page, ImageDownLog record);
+
+    ImageDownLog getImageDownLogById(String id);
+
+    ImageDownLog getImageDownLog(ImageDownLog record);
+
+    boolean createImageDownLog(ImageDownLog record);
+
+    boolean deleteImageDownLog(ImageDownLog record);
+
+    boolean updateImageDownLog(ImageDownLog record);
+}
+

+ 137 - 0
src/main/java/com/izouma/awesomeadmin/service/impl/ImageDownLogServiceImpl.java

@@ -0,0 +1,137 @@
+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;
+import com.izouma.awesomeadmin.constant.AppConstant;
+import com.izouma.awesomeadmin.dto.Page;
+import com.izouma.awesomeadmin.model.ImageDownLog;
+import com.izouma.awesomeadmin.service.ImageDownLogService;
+import com.izouma.awesomeadmin.dao.ImageDownLogMapper;
+
+/**
+*  service接口实现类
+*/
+@Service
+public class ImageDownLogServiceImpl implements ImageDownLogService{
+
+    private static Logger logger = Logger.getLogger(ImageDownLogServiceImpl.class);
+
+    @Autowired
+    private ImageDownLogMapper imageDownLogMapper;
+
+    @Override
+    public List<ImageDownLog> getImageDownLogList(ImageDownLog record) {
+
+        logger.info("getImageDownLogList");
+        try {
+
+        return imageDownLogMapper.queryAllImageDownLog(record);
+        } catch (Exception e) {
+        logger.error("getImageDownLogList", e);
+        }
+
+        return null;
+    }
+    @Override
+    public List<ImageDownLog> getImageDownLogByPage(Page page, ImageDownLog record) {
+
+        logger.info("getImageDownLogByPage");
+        try {
+
+        Map<String, Object> parameter = new HashMap<String, Object>();
+        parameter.put("record", record);
+        parameter.put(AppConstant.PAGE, page);
+
+        return imageDownLogMapper.queryImageDownLogByPage(parameter);
+        } catch (Exception e) {
+        logger.error("getImageDownLogByPage", e);
+        }
+
+        return null;
+    }
+
+    @Override
+    public ImageDownLog getImageDownLogById(String id) {
+
+        logger.info("getImageDownLogyId");
+        try {
+
+            return imageDownLogMapper.selectByPrimaryKey(Integer.valueOf(id));
+        } catch (Exception e) {
+        logger.error("getImageDownLogById", e);
+        }
+
+        return null;
+    }
+
+    @Override
+    public ImageDownLog getImageDownLog(ImageDownLog record) {
+
+        logger.info("getImageDownLog");
+        try {
+
+            return imageDownLogMapper.queryImageDownLog(record);
+        } catch (Exception e) {
+        logger.error("getImageDownLog", e);
+        }
+
+        return null;
+    }
+
+    @Override
+    public boolean createImageDownLog(ImageDownLog record) {
+
+        logger.info("createImageDownLog");
+        try {
+
+            int updates = imageDownLogMapper.insertSelective(record);
+
+            if (updates > 0) {
+                 return true;
+            }
+        } catch (Exception e) {
+            logger.error("createImageDownLog", e);
+        }
+
+        return false;
+    }
+
+    @Override
+    public boolean deleteImageDownLog(ImageDownLog record) {
+
+        logger.info("deleteImageDownLog");
+        try {
+
+             int updates = imageDownLogMapper.delete(record);
+
+            if (updates > 0) {
+                 return true;
+            }
+        } catch (Exception e) {
+             logger.error("deleteImageDownLog", e);
+        }
+
+        return false;
+    }
+
+    @Override
+    public boolean updateImageDownLog(ImageDownLog record) {
+
+        logger.info("updateImageDownLog");
+        try {
+
+            int updates = imageDownLogMapper.updateByPrimaryKeySelective(record);
+
+            if (updates > 0) {
+                 return true;
+            }
+        } catch (Exception e) {
+             logger.error("updateImageDownLog", e);
+        }
+
+        return false;
+    }
+}
+

+ 165 - 0
src/main/java/com/izouma/awesomeadmin/web/ImageDownLogController.java

@@ -0,0 +1,165 @@
+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.ImageDownLog;
+import com.izouma.awesomeadmin.service.ImageDownLogService;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+*  controller类
+*/
+@Controller
+@RequestMapping("/imageDownLog")
+public class ImageDownLogController {
+
+    @Autowired
+    private ImageDownLogService imageDownLogService;
+
+    /**
+    * <p>获取全部记录。</p>
+    */
+    @RequiresAuthentication
+    @RequestMapping(value = "/all", method = RequestMethod.GET)
+    @ResponseBody
+    public Result all(ImageDownLog record) {
+        List<ImageDownLog> pp = imageDownLogService.getImageDownLogList(record);
+        return new Result(true, pp);
+    }
+
+    /**
+    * <p>根据Id。</p>
+    */
+    @RequestMapping(value = "/getImageDownLog", method = RequestMethod.GET)
+    @ResponseBody
+    public Result getImageDownLog(@RequestParam(required = false, value = "id") String id) {
+        ImageDownLog data = imageDownLogService.getImageDownLogById(id);
+        return new Result(true, data);
+    }
+
+    /**
+    * <p>根据条件获取。</p>
+    */
+    @RequestMapping(value = "/getOne", method = RequestMethod.GET)
+    @ResponseBody
+    public Result getOne(ImageDownLog record) {
+        ImageDownLog data = imageDownLogService.getImageDownLog(record);
+        return new Result(true, data);
+    }
+
+
+    /**
+    * <p>分页查询。</p>
+    */
+    @RequestMapping(value = "/page", method = RequestMethod.GET)
+    @ResponseBody
+    public Result page(Page page, ImageDownLog record) {
+        Map<String, Object> result = new HashMap<>();
+
+        List<ImageDownLog> pp =imageDownLogService.getImageDownLogByPage(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(ImageDownLog record) {
+        boolean num = imageDownLogService.createImageDownLog(record);
+        if (num) {
+        return new Result(true, record.getId());
+        }
+        return new Result(false, "保存异常");
+    }
+
+    /**
+    * <p>更新信息。</p>
+    */
+    @RequestMapping(value = "/update", method = RequestMethod.POST)
+    @ResponseBody
+    public Result updateImageDownLog(ImageDownLog record) {
+        boolean num = imageDownLogService.updateImageDownLog(record);
+        if (num) {
+        return new Result(true, "保存成功");
+        }
+        return new Result(false, "保存异常");
+    }
+
+    /**
+    * <p>删除。</p>
+    */
+    @RequestMapping(value = "/del", method = RequestMethod.POST)
+    @ResponseBody
+    public Result deleteImageDownLog(ImageDownLog record) {
+
+        boolean num = imageDownLogService.deleteImageDownLog(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, ImageDownLog record) throws Exception {
+
+    List<ImageDownLog> imageDownLogs = imageDownLogService.getImageDownLogList(record);
+
+
+        String sheetName = "image_down_log";
+        String titleName = "图片下载日志数据表";
+        String fileName = "图片下载日志表";
+        int columnNumber = 14;
+        int[] columnWidth = { 20,  20,  20,  20,  20,  20,  20,  20,  20,  20,  20,  20,  20,  20 };
+        String[] columnName = {  "" ,   "删除标识" ,   "更新时间" ,   "更新人" ,   "创建时间" ,   "创建人" ,   "订单" ,   "类型" ,   "图片名" ,   "状态" ,   "大小" ,   "下载编号" ,   "总数量" ,   "当前数量"  };
+        String[][] dataList = new String[imageDownLogs.size()][14];
+
+        for (int i = 0; i < imageDownLogs.size(); i++) {
+
+                        dataList[i][0] = String.valueOf(imageDownLogs.get(i).getId());
+                        dataList[i][1] = String.valueOf(imageDownLogs.get(i).getDelFlag());
+                        dataList[i][2] = String.valueOf(imageDownLogs.get(i).getUpdateTime());
+                        dataList[i][3] = String.valueOf(imageDownLogs.get(i).getUpdateUser());
+                        dataList[i][4] = String.valueOf(imageDownLogs.get(i).getCreateTime());
+                        dataList[i][5] = String.valueOf(imageDownLogs.get(i).getCreateUser());
+                        dataList[i][6] = String.valueOf(imageDownLogs.get(i).getOrderId());
+                        dataList[i][7] = String.valueOf(imageDownLogs.get(i).getTypeFlag());
+                        dataList[i][8] = String.valueOf(imageDownLogs.get(i).getImageName());
+                        dataList[i][9] = String.valueOf(imageDownLogs.get(i).getStatusFlag());
+                        dataList[i][10] = String.valueOf(imageDownLogs.get(i).getImageSize());
+                        dataList[i][11] = String.valueOf(imageDownLogs.get(i).getImageCode());
+                        dataList[i][12] = String.valueOf(imageDownLogs.get(i).getTotalNum());
+                        dataList[i][13] = String.valueOf(imageDownLogs.get(i).getNowNum());
+                    }
+
+
+        ExportExcelUtil.ExportWithResponse(sheetName, titleName, fileName,
+        columnNumber, columnWidth, columnName, dataList, response);
+
+
+        }
+    }
+

+ 119 - 6
src/main/java/com/izouma/awesomeadmin/web/OrderImageController.java

@@ -1,15 +1,15 @@
 package com.izouma.awesomeadmin.web;
 
+import com.aliyun.oss.OSSClient;
+import com.aliyun.oss.model.OSSObject;
 import com.izouma.awesomeadmin.constant.AppConstant;
 import com.izouma.awesomeadmin.dto.Page;
 import com.izouma.awesomeadmin.dto.Result;
+import com.izouma.awesomeadmin.model.ImageDownLog;
 import com.izouma.awesomeadmin.model.ImageUploadLog;
 import com.izouma.awesomeadmin.model.OrderImage;
 import com.izouma.awesomeadmin.model.UserOrder;
-import com.izouma.awesomeadmin.service.ImageUploadLogService;
-import com.izouma.awesomeadmin.service.OSSFileService;
-import com.izouma.awesomeadmin.service.OrderImageService;
-import com.izouma.awesomeadmin.service.UserOrderService;
+import com.izouma.awesomeadmin.service.*;
 import com.izouma.awesomeadmin.util.ExportExcelUtil;
 import com.izouma.awesomeadmin.util.ImagesUtil;
 import com.izouma.awesomeadmin.util.PropertiesFileLoader;
@@ -28,9 +28,14 @@ import org.springframework.web.multipart.commons.CommonsMultipartResolver;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
+import java.io.*;
 import java.math.BigDecimal;
+import java.net.URLEncoder;
 import java.util.*;
+import java.util.zip.Adler32;
+import java.util.zip.CheckedOutputStream;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipOutputStream;
 
 /**
  * controller类
@@ -58,6 +63,9 @@ public class OrderImageController {
     @Autowired
     private ImageUploadLogService imageUploadLogService;
 
+    @Autowired
+    private ImageDownLogService imageDownLogService;
+
     /**
      * <p>获取全部记录。</p>
      */
@@ -430,6 +438,7 @@ public class OrderImageController {
      *
      * @param orderId  订单ID
      * @param typeFlag 类型  original / finished
+     * @param code     编码 下载标识
      * @param request
      * @param response
      * @return
@@ -438,6 +447,7 @@ public class OrderImageController {
     @ResponseBody
     public void zipFilesDown(@RequestParam(required = true, value = "orderId") String orderId,
                              @RequestParam(required = true, value = "typeFlag") String typeFlag,
+                             @RequestParam(required = true, value = "code") String code,
                              HttpServletRequest request, HttpServletResponse response) {
 
         try {
@@ -485,7 +495,110 @@ public class OrderImageController {
                     }
 
                     if (keyList.size() > 0) {
-                        OSSFileService.zipFilesDown(keyList, zipName, request, response);
+                        //OSSFileService.zipFilesDown(keyList, zipName, request, response);
+
+                        String accessKeyId = PropertiesFileLoader.getDefaultProperties("aliossid", "");
+                        String accessKeySecret = PropertiesFileLoader.getDefaultProperties("aliosskey", "");
+                        String endpoint = PropertiesFileLoader.getDefaultProperties("aliossendpoit", "");
+                        String bucketName = PropertiesFileLoader.getDefaultProperties("alibucketname", "");
+
+                        // endpoint以杭州为例,其它region请按实际情况填写
+                        // 云账号AccessKey有所有API访问权限,建议遵循阿里云安全最佳实践,创建并使用RAM子账号进行API访问或日常运维,请登录 https://ram.console.aliyun.com 创建
+                        try {
+                            // 初始化
+                            OSSClient ossClient = new OSSClient(endpoint, accessKeyId, accessKeySecret);
+                            String fileName = zipName + ".zip";
+                            // 创建临时文件
+                            File zipFile = File.createTempFile(zipName, ".zip");
+                            FileOutputStream f = new FileOutputStream(zipFile);
+                            /**
+                             * 作用是为任何OutputStream产生校验和
+                             * 第一个参数是制定产生校验和的输出流,第二个参数是指定Checksum的类型 (Adler32(较快)和CRC32两种)
+                             */
+                            CheckedOutputStream csum = new CheckedOutputStream(f, new Adler32());
+                            // 用于将数据压缩成Zip文件格式
+                            ZipOutputStream zos = new ZipOutputStream(csum);
+
+                            for (int i = 0; i < keyList.size(); i++) {
+                                try {
+                                    String ossfile = keyList.get(i);
+
+                                    ImageDownLog imageDownLog = new ImageDownLog();
+
+                                    imageDownLog.setOrderId(orderId);
+                                    imageDownLog.setTypeFlag(typeFlag);
+                                    imageDownLog.setImageCode(code);
+                                    imageDownLog.setImageName(ossfile.split("/")[ossfile.split("/").length - 1]);
+                                    imageDownLog.setTotalNum(keyList.size());
+                                    imageDownLog.setNowNum(i + 1);
+
+                                    imageDownLogService.createImageDownLog(imageDownLog);
+
+
+                                    // 获取Object,返回结果为OSSObject对象
+                                    OSSObject ossObject = ossClient.getObject(bucketName, ossfile);
+
+                                    imageDownLog.setImageSize(BigDecimal.valueOf(ossObject.getObjectMetadata().getContentLength()));
+
+                                    // 读去Object内容  返回
+                                    InputStream inputStream = ossObject.getObjectContent();
+                                    // 对于每一个要被存放到压缩包的文件,都必须调用ZipOutputStream对象的putNextEntry()方法,确保压缩包里面文件不同名
+
+                                    zos.putNextEntry(new ZipEntry(ossfile.split("/")[ossfile.split("/").length - 1]));
+                                    int bytesRead = 0;
+                                    // 向压缩文件中输出数据
+                                    while ((bytesRead = inputStream.read()) != -1) {
+                                        zos.write(bytesRead);
+                                    }
+                                    inputStream.close();
+                                    zos.closeEntry(); // 当前文件写完,定位为写入下一条项目
+
+
+                                    imageDownLog.setStatusFlag(1);
+
+                                    imageDownLogService.updateImageDownLog(imageDownLog);
+
+
+                                } catch (Exception e) {
+                                    logger.error("ossfile, 压缩失败", e);
+                                }
+                            }
+                            zos.close();
+                            String header = request.getHeader("User-Agent").toUpperCase();
+                            if (header.contains("MSIE") || header.contains("TRIDENT") || header.contains("EDGE")) {
+                                fileName = URLEncoder.encode(fileName, "utf-8");
+                                fileName = fileName.replace("+", "%20");    //IE下载文件名空格变+号问题
+                            } else {
+                                fileName = new String(fileName.getBytes(), "ISO8859-1");
+                            }
+                            response.reset();
+                            response.setContentType("text/plain");
+                            response.setContentType("application/octet-stream; charset=utf-8");
+                            response.setHeader("Location", fileName);
+                            response.setHeader("Cache-Control", "max-age=0");
+                            response.setHeader("Content-Disposition", "attachment; filename=" + fileName);
+
+                            FileInputStream fis = new FileInputStream(zipFile);
+                            BufferedInputStream buff = new BufferedInputStream(fis);
+                            BufferedOutputStream out = new BufferedOutputStream(response.getOutputStream());
+                            byte[] car = new byte[1024];
+                            int l = 0;
+                            while (l < zipFile.length()) {
+                                int j = buff.read(car, 0, 1024);
+                                l += j;
+                                out.write(car, 0, j);
+                            }
+                            // 关闭流
+                            fis.close();
+                            buff.close();
+                            out.close();
+
+                            ossClient.shutdown();
+                            // 删除临时文件
+                            zipFile.delete();
+                        } catch (Exception e) {
+                            logger.error("压缩失败", e);
+                        }
 
                     }
 

+ 126 - 0
src/main/vue/src/pages/ImageDownLog.vue

@@ -0,0 +1,126 @@
+<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="orderId" label="订单">
+                <el-input v-model="formData.orderId" :disabled="'orderId'==subColumn"></el-input>
+            </el-form-item>
+                                                                                                                                                                                                                                                                                                                            <el-form-item prop="typeFlag" label="类型">
+                <el-input v-model="formData.typeFlag" :disabled="'typeFlag'==subColumn"></el-input>
+            </el-form-item>
+                                                                                                                                                                                                                                                                                                                            <el-form-item prop="imageName" label="图片名">
+                <el-input v-model="formData.imageName" :disabled="'imageName'==subColumn"></el-input>
+            </el-form-item>
+                                                                                                                                                                                                                                                                                                                            <el-form-item prop="statusFlag" label="状态">
+                <el-input v-model="formData.statusFlag" :disabled="'statusFlag'==subColumn"></el-input>
+            </el-form-item>
+                                                                                                                                                                                                                                                                                                                            <el-form-item prop="imageSize" label="大小">
+                <el-input v-model="formData.imageSize" :disabled="'imageSize'==subColumn"></el-input>
+            </el-form-item>
+                                                                                                                                                                                                                                                                                                                            <el-form-item prop="imageCode" label="下载编号">
+                <el-input v-model="formData.imageCode" :disabled="'imageCode'==subColumn"></el-input>
+            </el-form-item>
+                                                                                                                                                                                                                                                                                                                            <el-form-item prop="totalNum" label="总数量">
+                <el-input v-model="formData.totalNum" :disabled="'totalNum'==subColumn"></el-input>
+            </el-form-item>
+                                                                                                                                                                                                                                                                                                                            <el-form-item prop="nowNum" label="当前数量">
+                <el-input v-model="formData.nowNum" :disabled="'nowNum'==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: '/imageDownLog/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;
+                    }
+                    }
+                })
+            }else {
+                if (this.$route.query.column) {
+                    this.formData[this.subColumn] = this.subValue;
+                }
+            }
+
+                                                                                                                                                                                                                                                                                                                                                                                                                            },
+        data() {
+            return {
+                saving: false,
+                formData: {},
+                rules: {
+                                                                                                                                                                                                                                                                                                                                                                                                                            },
+                                                                                                                            subColumn: '',
+            subValue: '',
+        }
+        },
+        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 ? '/imageDownLog/update' : '/imageDownLog/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: '/imageDownLog/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('删除失败');
+                    }
+                })
+            },
+        }
+    }
+</script>
+<style lang="less" scoped>
+</style>

+ 519 - 0
src/main/vue/src/pages/ImageDownLogs.vue

@@ -0,0 +1,519 @@
+<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:'/imageDownLog',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('orderId')"
+                                prop="orderId"
+                                label="订单"
+                                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('imageName')"
+                                prop="imageName"
+                                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('imageSize')"
+                                prop="imageSize"
+                                label="大小"
+                                min-width="100">
+                        </el-table-column>
+                                                                
+                                            <el-table-column
+                                v-if="isColumnShow('imageCode')"
+                                prop="imageCode"
+                                label="下载编号"
+                                min-width="100">
+                        </el-table-column>
+                                                                
+                                            <el-table-column
+                                v-if="isColumnShow('totalNum')"
+                                prop="totalNum"
+                                label="总数量"
+                                min-width="100">
+                        </el-table-column>
+                                                                
+                                            <el-table-column
+                                v-if="isColumnShow('nowNum')"
+                                prop="nowNum"
+                                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: '订单',
+                                value: 'orderId',
+                                show: true
+                            },
+                                                                                                {
+                                label: '类型',
+                                value: 'typeFlag',
+                                show: true
+                            },
+                                                                                                {
+                                label: '图片名',
+                                value: 'imageName',
+                                show: true
+                            },
+                                                                                                {
+                                label: '状态',
+                                value: 'statusFlag',
+                                show: true
+                            },
+                                                                                                {
+                                label: '大小',
+                                value: 'imageSize',
+                                show: true
+                            },
+                                                                                                {
+                                label: '下载编号',
+                                value: 'imageCode',
+                                show: true
+                            },
+                                                                                                {
+                                label: '总数量',
+                                value: 'totalNum',
+                                show: true
+                            },
+                                                                                                {
+                                label: '当前数量',
+                                value: 'nowNum',
+                                show: true
+                            },
+                                                            ],
+                multipleMode: false,
+                showAdvancedQueryDialog: false,
+                advancedQueryFields: [],
+                showTableSortDialog: false,
+                tableSortFields: [],
+                searchMethods: ['=', '!=', '>', '>=', '<', '<=', 'like'],
+                advancedQueryColumns: [
+                                                                                                                                                                                                                                                                                                                                                {
+                                label: '订单',
+                                value: 'order_id'
+                            },
+                                                                                                {
+                                label: '类型',
+                                value: 'type_flag'
+                            },
+                                                                                                {
+                                label: '图片名',
+                                value: 'image_name'
+                            },
+                                                                                                {
+                                label: '状态',
+                                value: 'status_flag'
+                            },
+                                                                                                {
+                                label: '大小',
+                                value: 'image_size'
+                            },
+                                                                                                {
+                                label: '下载编号',
+                                value: 'image_code'
+                            },
+                                                                                                {
+                                label: '总数量',
+                                value: 'total_num'
+                            },
+                                                                                                {
+                                label: '当前数量',
+                                value: 'now_num'
+                            },
+                                                            ],
+                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: '/imageDownLog/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: '/imageDownLog',
+                    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 + "/imageDownLog/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: '/imageDownLog/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>

+ 10 - 0
src/main/vue/src/router/index.js

@@ -609,6 +609,16 @@ const router = new Router({
                     path: '/imageUploadLogs',
                     name: 'ImageUploadLogs',
                     component: () => import('../pages/ImageUploadLogs')
+                },
+                {
+                    path: '/imageDownLog',
+                    name: 'ImageDownLog',
+                    component: () => import('../pages/ImageDownLog')
+                },
+                {
+                    path: '/imageDownLogs',
+                    name: 'ImageDownLogs',
+                    component: () => import('../pages/ImageDownLogs')
                 }
                 /**INSERT_LOCATION**/
             ]