suochencheng 6 years ago
parent
commit
6b29b7575c

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

@@ -38,5 +38,7 @@ public interface PayCodeOrderMapper {
     List<PayCodeOrder> queryReportPayCodeOrder(PayCodeOrder record);
 
     BigDecimal getTotalPayMoney(PayCodeOrder record);
+
+    PayCodeOrder getDayPayMoney(PayCodeOrder checkPay);
 }
 

+ 37 - 0
src/main/java/com/izouma/awesomeadmin/dao/PayCodeOrderMapper.xml

@@ -696,6 +696,43 @@
             and pay_time  <![CDATA[ <= ]]> #{searchEndTime}
         </if>
 
+    </select>
+    <select id="getDayPayMoney" parameterType="java.util.Map"
+            resultType="com.izouma.awesomeadmin.model.PayCodeOrder">
+        SELECT
+        code_id,
+        COUNT(1) paytimes,
+        SUM(pay_money) pay_money
+        FROM
+        pay_code_order
+        WHERE
+        del_flag = 'N'
+        AND status_flag = 1
+        <if test="codeId != null and !&quot;&quot;.equals(codeId)">
+            and code_id  = #{codeId}
+        </if>
+        <if test="stockId != null and !&quot;&quot;.equals(stockId)">
+            and stock_id = #{stockId}
+        </if>
+        <if test="searchBeginTime != null and !&quot;&quot;.equals(searchBeginTime)">
+            and pay_time  <![CDATA[ >= ]]> #{searchBeginTime}
+        </if>
+        <if test="searchEndTime != null and !&quot;&quot;.equals(searchEndTime)">
+            and pay_time  <![CDATA[ <= ]]> #{searchEndTime}
+        </if>
+
+        <if test="dayType != null and !&quot;&quot;.equals(dayType)">
+                <choose>
+                    <when test="dayType=='day'">
+                        and    to_days(create_time) = to_days(now())
+                    </when>
+                    <otherwise>
+                        and  DATE_FORMAT( create_time, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )
+                    </otherwise>
+                </choose>
+        </if>
+
+
     </select>
 
     <resultMap id="PagePayCodeOrderResult" type="com.izouma.awesomeadmin.model.PayCodeOrder" extends="BaseResultMap">

+ 35 - 0
src/main/java/com/izouma/awesomeadmin/dao/RiskControlMapper.java

@@ -0,0 +1,35 @@
+package com.izouma.awesomeadmin.dao;
+
+import java.util.*;
+import com.izouma.awesomeadmin.datasource.DataSource;
+import org.springframework.stereotype.Repository;
+import com.izouma.awesomeadmin.model.RiskControl;
+
+
+/**
+*  Dao接口
+*/
+@Repository("com.zoumaframe.dao.RiskControlMapper")
+public interface RiskControlMapper{
+    /*generatedStart*/
+    int deleteByPrimaryKey(Integer id);
+
+    int insertSelective(RiskControl record);
+
+    RiskControl selectByPrimaryKey(Integer id);
+
+    int updateByPrimaryKeySelective(RiskControl record);
+
+    List<RiskControl> queryAllRiskControl(RiskControl record);
+
+    List<RiskControl> queryRiskControlByPage(Map<String, Object> parameter);
+
+    int delete(RiskControl record);
+
+    RiskControl queryRiskControl(RiskControl record);
+
+    List<RiskControl> query(RiskControl record);
+    /*generatedEnd*/
+
+}
+

+ 419 - 0
src/main/java/com/izouma/awesomeadmin/dao/RiskControlMapper.xml

@@ -0,0 +1,419 @@
+<?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.RiskControlMapper">
+    <resultMap id="BaseResultMap" type="com.izouma.awesomeadmin.model.RiskControl">
+        <!--generatedStart-->
+        <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="codeId" property="codeid" jdbcType="INTEGER"/>
+        <result column="code_name" property="codeName" jdbcType="VARCHAR"/>
+        <result column="pay_type" property="payType" jdbcType="VARCHAR"/>
+        <result column="risk_type" property="riskType" jdbcType="VARCHAR"/>
+        <result column="remark" property="remark" jdbcType="VARCHAR"/>
+        <!--generatedEnd-->
+    </resultMap>
+
+    <sql id="Base_Column_List">
+        <!--generatedStart-->
+        id, del_flag, update_time, update_user, create_time, create_user, codeId, code_name, pay_type, risk_type, remark        <!--generatedEnd-->
+    </sql>
+
+    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer">
+        SELECT
+        <include refid="Base_Column_List"/>
+        FROM risk_control
+        WHERE id = #{id,jdbcType=INTEGER}
+    </select>
+
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
+        DELETE
+        FROM risk_control
+        WHERE id = #{id,jdbcType=INTEGER}
+    </delete>
+
+    <insert id="insertSelective" parameterType="com.izouma.awesomeadmin.model.RiskControl" useGeneratedKeys="true" keyProperty="id">
+        INSERT INTO risk_control
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <!--generatedStart-->
+            <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="codeid!= null">
+                codeId,
+            </if>
+            <if test="codeName!= null">
+                code_name,
+            </if>
+            <if test="payType!= null">
+                pay_type,
+            </if>
+            <if test="riskType!= null">
+                risk_type,
+            </if>
+            <if test="remark!= null">
+                remark,
+            </if>
+            <!--generatedEnd-->
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <!--generatedStart-->
+            <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="codeid != null">
+                #{codeid,jdbcType=INTEGER},
+            </if>
+            <if test="codeName != null">
+                #{codeName,jdbcType=VARCHAR},
+            </if>
+            <if test="payType != null">
+                #{payType,jdbcType=VARCHAR},
+            </if>
+            <if test="riskType != null">
+                #{riskType,jdbcType=VARCHAR},
+            </if>
+            <if test="remark != null">
+                #{remark,jdbcType=VARCHAR},
+            </if>
+            <!--generatedEnd-->
+        </trim>
+    </insert>
+
+    <update id="updateByPrimaryKeySelective" parameterType="com.izouma.awesomeadmin.model.RiskControl">
+        UPDATE risk_control
+        <set>
+            <!--generatedStart-->
+            <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="codeid != null">
+                codeId= #{codeid,jdbcType=INTEGER},
+            </if>
+            <if test="codeName != null">
+                code_name= #{codeName,jdbcType=VARCHAR},
+            </if>
+            <if test="payType != null">
+                pay_type= #{payType,jdbcType=VARCHAR},
+            </if>
+            <if test="riskType != null">
+                risk_type= #{riskType,jdbcType=VARCHAR},
+            </if>
+            <if test="remark != null">
+                remark= #{remark,jdbcType=VARCHAR},
+            </if>
+            <!--generatedEnd-->
+        </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="queryRiskControlByPage" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.RiskControl">
+        SELECT <include refid="Base_Column_List"/> FROM risk_control
+        <where>
+            AND del_flag = 'N'
+            <if test="record.idStr != null and !&quot;&quot;.equals(record.idStr)">
+                AND id IN (${record.idStr})
+            </if>
+            <!--generatedStart-->
+            <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.codeid != null and !&quot;&quot;.equals(record.codeid)">
+                AND codeId = #{record.codeid}
+            </if>
+            <if test="record.codeName != null and !&quot;&quot;.equals(record.codeName)">
+                AND code_name = #{record.codeName}
+            </if>
+            <if test="record.payType != null and !&quot;&quot;.equals(record.payType)">
+                AND pay_type = #{record.payType}
+            </if>
+            <if test="record.riskType != null and !&quot;&quot;.equals(record.riskType)">
+                AND risk_type = #{record.riskType}
+            </if>
+            <if test="record.remark != null and !&quot;&quot;.equals(record.remark)">
+                AND remark = #{record.remark}
+            </if>
+            <!--generatedEnd-->
+            <if test="record.searchKey != null and !&quot;&quot;.equals(record.searchKey)">
+                <trim prefix="and (" suffix=")" prefixOverrides="OR">
+                    <!--generatedStart-->
+                    OR codeId LIKE concat('%',#{record.searchKey},'%')
+                    OR code_name LIKE concat('%',#{record.searchKey},'%')
+                    OR pay_type LIKE concat('%',#{record.searchKey},'%')
+                    OR risk_type LIKE concat('%',#{record.searchKey},'%')
+                    OR remark LIKE concat('%',#{record.searchKey},'%')
+                    <!--generatedEnd-->
+                </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="queryAllRiskControl" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.RiskControl">
+        SELECT <include refid="Base_Column_List"/> FROM risk_control
+        <where>
+            AND del_flag = 'N'
+            <if test="idStr != null and !&quot;&quot;.equals(idStr)">
+                AND id IN (${idStr})
+            </if>
+            <!--generatedStart-->
+            <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="codeid != null and !&quot;&quot;.equals(codeid)">
+                AND codeId = #{codeid}
+            </if>
+            <if test="codeName != null and !&quot;&quot;.equals(codeName)">
+                AND code_name = #{codeName}
+            </if>
+            <if test="payType != null and !&quot;&quot;.equals(payType)">
+                AND pay_type = #{payType}
+            </if>
+            <if test="riskType != null and !&quot;&quot;.equals(riskType)">
+                AND risk_type = #{riskType}
+            </if>
+            <if test="remark != null and !&quot;&quot;.equals(remark)">
+                AND remark = #{remark}
+            </if>
+            <!--generatedEnd-->
+            <if test="searchKey != null and !&quot;&quot;.equals(searchKey)">
+                <trim prefix="and (" suffix=")" prefixOverrides="OR">
+                    <!--generatedStart-->
+                    OR codeId LIKE concat('%',#{searchKey},'%')
+                    OR code_name LIKE concat('%',#{searchKey},'%')
+                    OR pay_type LIKE concat('%',#{searchKey},'%')
+                    OR risk_type LIKE concat('%',#{searchKey},'%')
+                    OR remark LIKE concat('%',#{searchKey},'%')
+                    <!--generatedEnd-->
+                </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="queryRiskControl" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.RiskControl">
+        SELECT <include refid="Base_Column_List"/> FROM risk_control
+        <where>
+            AND del_flag = 'N'
+            <!--generatedStart-->
+            <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="codeid != null and !&quot;&quot;.equals(codeid)">
+                AND codeId = #{codeid}
+            </if>
+            <if test="codeName != null and !&quot;&quot;.equals(codeName)">
+                AND code_name = #{codeName}
+            </if>
+            <if test="payType != null and !&quot;&quot;.equals(payType)">
+                AND pay_type = #{payType}
+            </if>
+            <if test="riskType != null and !&quot;&quot;.equals(riskType)">
+                AND risk_type = #{riskType}
+            </if>
+            <if test="remark != null and !&quot;&quot;.equals(remark)">
+                AND remark = #{remark}
+            </if>
+            <!--generatedEnd-->
+        </where>
+        LIMIT 1
+    </select>
+
+    <update id="delete">
+        UPDATE risk_control 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.RiskControl">
+        SELECT
+        <include refid="Base_Column_List"/>
+        FROM risk_control
+        <where>
+            AND del_flag = 'N'
+            <!--generatedStart-->
+            <!--generatedEnd-->
+        </where>
+        ORDER BY id DESC
+    </select>
+</mapper>
+

+ 19 - 0
src/main/java/com/izouma/awesomeadmin/model/PayCodeOrder.java

@@ -70,6 +70,9 @@ public class PayCodeOrder {
      */
     private Integer codeowner;
 
+    private Integer paytimes;
+
+    private String dayType;
 
     /*generatedStart*/
     public Integer getId() {
@@ -305,5 +308,21 @@ public class PayCodeOrder {
     public void setCodeowner(Integer codeowner) {
         this.codeowner = codeowner;
     }
+
+    public Integer getPaytimes() {
+        return paytimes;
+    }
+
+    public void setPaytimes(Integer paytimes) {
+        this.paytimes = paytimes;
+    }
+
+    public String getDayType() {
+        return dayType;
+    }
+
+    public void setDayType(String dayType) {
+        this.dayType = dayType;
+    }
 }
 

+ 152 - 0
src/main/java/com/izouma/awesomeadmin/model/RiskControl.java

@@ -0,0 +1,152 @@
+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 RiskControl{
+    /*generatedStart*/
+    private Integer id;
+    private String delFlag;
+    private Date updateTime;
+    private String updateUser;
+    private Date createTime;
+    private String createUser;
+    private Integer codeid;
+    private String codeName;
+    private String payType;
+    private String riskType;
+    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;
+    /*generatedEnd*/
+
+    /*generatedStart*/
+    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 Integer getCodeid(){
+        return this.codeid;
+    }
+
+    public void setCodeid(Integer codeid){
+        this.codeid = codeid;
+    }
+    public String getCodeName(){
+        return this.codeName;
+    }
+
+    public void setCodeName(String codeName){
+        this.codeName = codeName;
+    }
+    public String getPayType(){
+        return this.payType;
+    }
+
+    public void setPayType(String payType){
+        this.payType = payType;
+    }
+    public String getRiskType(){
+        return this.riskType;
+    }
+
+    public void setRiskType(String riskType){
+        this.riskType = riskType;
+    }
+    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;
+    }
+    /*generatedEnd*/
+
+}
+

+ 28 - 0
src/main/java/com/izouma/awesomeadmin/service/RiskControlService.java

@@ -0,0 +1,28 @@
+package com.izouma.awesomeadmin.service;
+
+import java.util.*;
+import com.izouma.awesomeadmin.dto.Page;
+import com.izouma.awesomeadmin.model.RiskControl;
+
+
+/**
+*  service接口类
+*/
+public interface RiskControlService{
+    /*generatedStart*/
+    List<RiskControl> getRiskControlList(RiskControl record);
+
+    List<RiskControl> getRiskControlByPage(Page page, RiskControl record);
+
+    RiskControl getRiskControlById(String id);
+
+    RiskControl getRiskControl(RiskControl record);
+
+    boolean createRiskControl(RiskControl record);
+
+    boolean deleteRiskControl(RiskControl record);
+
+    boolean updateRiskControl(RiskControl record);
+    /*generatedEnd*/
+}
+

+ 81 - 5
src/main/java/com/izouma/awesomeadmin/service/impl/PayCodeOrderServiceImpl.java

@@ -46,6 +46,9 @@ public class PayCodeOrderServiceImpl implements PayCodeOrderService {
     @Autowired
     private MemberCoinMapper memberCoinMapper;
 
+    @Autowired
+    private RiskControlMapper riskControlMapper;
+
     /*generatedStart*/
 
     @Override
@@ -226,12 +229,85 @@ public class PayCodeOrderServiceImpl implements PayCodeOrderService {
             payCodeOrderMapper.updateByPrimaryKeySelective(record);
 
 
-            PayCodeStock payCodeStock = payCodeOrder.getPayCodeStock();
-            if (payCodeStock != null) {
-                if ("Y".equals(payCodeStock.getRegenerate())) {//再生
-                    payCodeStock.setAmount(payCodeStock.getAmount() + 1);
-                    payCodeStockMapper.updateByPrimaryKeySelective(payCodeStock);
+            //风险控制
+            PayCodeInfo payCodeInfo = payCodeOrder.getPayCodeInfo();
+            if (payCodeInfo != null) {
+
+                int dayTimes = 0;
+                int monthTimes = 0;
+                BigDecimal dayMoney = BigDecimal.ZERO;
+                BigDecimal monthMoney = BigDecimal.ZERO;
+
+                PayCodeOrder checkPay = new PayCodeOrder();
+                checkPay.setCodeId(payCodeInfo.getId());
+                checkPay.setDayType("day");
+                PayCodeOrder dayPayCodeOrder = payCodeOrderMapper.getDayPayMoney(checkPay);
+
+                if (dayPayCodeOrder != null) {
+                    dayTimes = dayPayCodeOrder.getPaytimes();
+                    dayMoney = dayPayCodeOrder.getPayMoney();
                 }
+
+                checkPay.setDayType("month");
+                PayCodeOrder monthPayCodeOrder = payCodeOrderMapper.getDayPayMoney(checkPay);
+
+                if (monthPayCodeOrder != null) {
+                    monthTimes = monthPayCodeOrder.getPaytimes();
+                    monthMoney = monthPayCodeOrder.getPayMoney();
+                }
+
+                RiskControl riskControl = new RiskControl();
+                riskControl.setCodeid(payCodeInfo.getId());
+                riskControl.setCodeName(payCodeInfo.getCodeName());
+                riskControl.setPayType(payCodeInfo.getPayType());
+                riskControl.setCreateUser("支付风控");
+
+                if (payCodeInfo.getDaymoney() > 0 && dayMoney.compareTo(BigDecimal.valueOf(payCodeInfo.getDaymoney())) >= 0) {
+                    payCodeInfo.setUseFlag("N");
+                    payCodeInfo.setRemark("超出单日限制金额,更新为不可以");
+                    payCodeInfoMapper.updateByPrimaryKeySelective(payCodeInfo);
+
+                    riskControl.setRiskType("daymoney");
+                    riskControl.setRemark("超出单日限制金额");
+                    riskControlMapper.insertSelective(riskControl);
+
+                } else if (payCodeInfo.getDaytimes() > 0 && (dayTimes >= payCodeInfo.getDaytimes())) {
+                    payCodeInfo.setUseFlag("N");
+                    payCodeInfo.setRemark("超出单日限制次数,更新为不可以");
+                    payCodeInfoMapper.updateByPrimaryKeySelective(payCodeInfo);
+
+                    riskControl.setRiskType("daytimes");
+                    riskControl.setRemark("超出单日限制次数");
+                    riskControlMapper.insertSelective(riskControl);
+
+                } else if (payCodeInfo.getMonthmoney() > 0 && monthMoney.compareTo(BigDecimal.valueOf(payCodeInfo.getMonthmoney())) >= 0) {
+                    payCodeInfo.setUseFlag("N");
+                    payCodeInfo.setRemark("超出单月限制金额,更新为不可以");
+                    payCodeInfoMapper.updateByPrimaryKeySelective(payCodeInfo);
+
+                    riskControl.setRiskType("monthmoney");
+                    riskControl.setRemark("超出单月限制金额");
+                    riskControlMapper.insertSelective(riskControl);
+
+                } else if (payCodeInfo.getMonthtimes() > 0 && (monthTimes >= payCodeInfo.getMonthtimes())) {
+                    payCodeInfo.setUseFlag("N");
+                    payCodeInfo.setRemark("超出单月限制次数,更新为不可以");
+                    payCodeInfoMapper.updateByPrimaryKeySelective(payCodeInfo);
+
+                    riskControl.setRiskType("monthtimes");
+                    riskControl.setRemark("超出单月限制次数");
+                    riskControlMapper.insertSelective(riskControl);
+                } else {
+                    PayCodeStock payCodeStock = payCodeOrder.getPayCodeStock();
+                    if (payCodeStock != null) {
+                        if ("Y".equals(payCodeStock.getRegenerate())) {//再生
+                            payCodeStock.setAmount(payCodeStock.getAmount() + 1);
+                            payCodeStockMapper.updateByPrimaryKeySelective(payCodeStock);
+                        }
+                    }
+                }
+
+
             }
 
 

+ 117 - 0
src/main/java/com/izouma/awesomeadmin/service/impl/RiskControlServiceImpl.java

@@ -0,0 +1,117 @@
+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.RiskControl;
+import com.izouma.awesomeadmin.service.RiskControlService;
+import com.izouma.awesomeadmin.dao.RiskControlMapper;
+
+/**
+*  service接口实现类
+*/
+@Service
+public class RiskControlServiceImpl implements RiskControlService{
+    /*generatedStart*/
+    private static Logger logger = Logger.getLogger(RiskControlServiceImpl.class);
+
+    @Autowired
+    private RiskControlMapper riskControlMapper;
+    /*generatedEnd*/
+
+    /*generatedStart*/
+    @Override
+    public List<RiskControl> getRiskControlList(RiskControl record) {
+        logger.info("getRiskControlList");
+        try {
+            return riskControlMapper.queryAllRiskControl(record);
+        } catch (Exception e) {
+            logger.error("getRiskControlList", e);
+        }
+        return null;
+    }
+
+    @Override
+    public List<RiskControl> getRiskControlByPage(Page page, RiskControl record) {
+        logger.info("getRiskControlByPage");
+        try {
+            Map<String, Object> parameter = new HashMap<String, Object>();
+            parameter.put("record", record);
+            parameter.put(AppConstant.PAGE, page);
+
+            return riskControlMapper.queryRiskControlByPage(parameter);
+        } catch (Exception e) {
+            logger.error("getRiskControlByPage", e);
+        }
+        return null;
+    }
+
+    @Override
+    public RiskControl getRiskControlById(String id) {
+        logger.info("getRiskControlyId");
+        try {
+            return riskControlMapper.selectByPrimaryKey(Integer.valueOf(id));
+        } catch (Exception e) {
+            logger.error("getRiskControlById", e);
+        }
+        return null;
+    }
+
+    @Override
+    public RiskControl getRiskControl(RiskControl record) {
+        logger.info("getRiskControl");
+        try {
+            return riskControlMapper.queryRiskControl(record);
+        } catch (Exception e) {
+            logger.error("getRiskControl", e);
+        }
+        return null;
+    }
+
+    @Override
+    public boolean createRiskControl(RiskControl record) {
+        logger.info("createRiskControl");
+        try {
+            int updates = riskControlMapper.insertSelective(record);
+            if (updates > 0) {
+                 return true;
+            }
+        } catch (Exception e) {
+            logger.error("createRiskControl", e);
+        }
+        return false;
+    }
+
+    @Override
+    public boolean deleteRiskControl(RiskControl record) {
+        logger.info("deleteRiskControl");
+        try {
+            int updates = riskControlMapper.delete(record);
+            if (updates > 0) {
+                 return true;
+            }
+        } catch (Exception e) {
+             logger.error("deleteRiskControl", e);
+        }
+        return false;
+    }
+
+    @Override
+    public boolean updateRiskControl(RiskControl record) {
+        logger.info("updateRiskControl");
+        try {
+            int updates = riskControlMapper.updateByPrimaryKeySelective(record);
+            if (updates > 0) {
+                 return true;
+            }
+        } catch (Exception e) {
+             logger.error("updateRiskControl", e);
+        }
+        return false;
+    }
+    /*generatedEnd*/
+}
+

+ 127 - 0
src/main/java/com/izouma/awesomeadmin/web/RiskControlController.java

@@ -0,0 +1,127 @@
+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.RiskControl;
+import com.izouma.awesomeadmin.service.RiskControlService;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@Controller
+@RequestMapping("/riskControl")
+public class RiskControlController {
+    /*generatedStart*/
+    @Autowired
+    private RiskControlService riskControlService;
+    /*generatedEnd*/
+
+    /*generatedStart*/
+    @RequiresAuthentication
+    @RequestMapping(value = "/all", method = RequestMethod.GET)
+    @ResponseBody
+    public Result all(RiskControl record) {
+        List<RiskControl> pp = riskControlService.getRiskControlList(record);
+        return new Result(true, pp);
+    }
+
+    @RequestMapping(value = "/getRiskControl", method = RequestMethod.GET)
+    @ResponseBody
+    public Result getRiskControl(@RequestParam(required = false, value = "id") String id) {
+        RiskControl data = riskControlService.getRiskControlById(id);
+        return new Result(true, data);
+    }
+
+    @RequestMapping(value = "/getOne", method = RequestMethod.GET)
+    @ResponseBody
+    public Result getOne(RiskControl record) {
+        RiskControl data = riskControlService.getRiskControl(record);
+        return new Result(true, data);
+    }
+
+    @RequestMapping(value = "/page", method = RequestMethod.GET)
+    @ResponseBody
+    public Result page(Page page, RiskControl record) {
+        Map<String, Object> result = new HashMap<>();
+
+        List<RiskControl> pp =riskControlService.getRiskControlByPage(page, record);
+
+        result.put(AppConstant.PAGE, page);
+        result.put("pp", pp);
+        return new Result(true, result);
+    }
+
+    @RequestMapping(value = "/save", method = RequestMethod.POST)
+    @ResponseBody
+    public Result save(RiskControl record) {
+        boolean num = riskControlService.createRiskControl(record);
+        if (num) {
+        return new Result(true, record.getId());
+        }
+        return new Result(false, "保存异常");
+    }
+
+    @RequestMapping(value = "/update", method = RequestMethod.POST)
+    @ResponseBody
+    public Result updateRiskControl(RiskControl record) {
+        boolean num = riskControlService.updateRiskControl(record);
+        if (num) {
+        return new Result(true, "保存成功");
+        }
+        return new Result(false, "保存异常");
+    }
+
+    @RequestMapping(value = "/del", method = RequestMethod.POST)
+    @ResponseBody
+    public Result deleteRiskControl(RiskControl record) {
+
+        boolean num = riskControlService.deleteRiskControl(record);
+        if (num) {
+        return new Result(true, "删除成功");
+        }
+        return new Result(false, "删除异常");
+    }
+
+    @RequestMapping(value = "/exportExcel", method = RequestMethod.GET)
+    @ResponseBody
+    public void exportExcel(HttpServletRequest request, HttpServletResponse response, RiskControl record) throws Exception {
+
+        List<RiskControl> riskControls = riskControlService.getRiskControlList(record);
+
+        String sheetName = "risk_control";
+        String titleName = "风险控制数据表";
+        String fileName = "风险控制表";
+        int columnNumber = 11;
+        int[] columnWidth = { 20,  20,  20,  20,  20,  20,  20,  20,  20,  20,  20 };
+        String[] columnName = {  "" ,   "删除标识" ,   "更新时间" ,   "更新人" ,   "创建时间" ,   "创建人" ,   "" ,   "" ,   "" ,   "" ,   ""  };
+        String[][] dataList = new String[riskControls.size()][11];
+
+        for (int i = 0; i < riskControls.size(); i++) {
+                        dataList[i][0] = String.valueOf(riskControls.get(i).getId());
+                        dataList[i][1] = String.valueOf(riskControls.get(i).getDelFlag());
+                        dataList[i][2] = String.valueOf(riskControls.get(i).getUpdateTime());
+                        dataList[i][3] = String.valueOf(riskControls.get(i).getUpdateUser());
+                        dataList[i][4] = String.valueOf(riskControls.get(i).getCreateTime());
+                        dataList[i][5] = String.valueOf(riskControls.get(i).getCreateUser());
+                        dataList[i][6] = String.valueOf(riskControls.get(i).getCodeid());
+                        dataList[i][7] = String.valueOf(riskControls.get(i).getCodeName());
+                        dataList[i][8] = String.valueOf(riskControls.get(i).getPayType());
+                        dataList[i][9] = String.valueOf(riskControls.get(i).getRiskType());
+                        dataList[i][10] = String.valueOf(riskControls.get(i).getRemark());
+                    }
+
+        ExportExcelUtil.ExportWithResponse(sheetName, titleName, fileName,
+                columnNumber, columnWidth, columnName, dataList, response);
+    }
+    /*generatedEnd*/
+}
+

+ 2 - 2
src/main/resources/properties/log4j.properties

@@ -11,7 +11,7 @@ log4j.appender.fileout.layout.ConversionPattern=Time    \:\t%d{yyyy-MM-dd HH\:mm
 log4j.appender.fileout.encoding=UTF-8
 
 
-log4j.logger.com.izouma=ERROR
+log4j.logger.com.izouma=debug
 log4j.logger.test.com.izouma=ERROR
 
 #spring
@@ -22,7 +22,7 @@ log4j.logger.org.springframework.jdbc.core=ERROR
 log4j.logger.org.mybatis=ERROR
 
 #sql
-log4j.logger.java.sql=ERROR
+log4j.logger.java.sql=debug
 
 #apache
 log4j.logger.org.apache=ERROR

+ 160 - 0
src/main/vue/src/pages/RiskControl.vue

@@ -0,0 +1,160 @@
+<template>
+    <div>
+        <el-form :model="formData" :rules="rules" ref="form" label-width="120px" label-position="right" size="small"
+                 style="max-width: 500px;">
+            <el-form-item prop="codeid" label="付款码">
+                <el-input v-model="formData.codeid" :disabled="'codeid'==subColumn"></el-input>
+            </el-form-item>
+            <el-form-item prop="codeName" label="付款名称">
+                <el-input v-model="formData.codeName" :disabled="'codeName'==subColumn"></el-input>
+            </el-form-item>
+            <el-form-item prop="payType" label="付款类型">
+                <el-input v-model="formData.payType" :disabled="'payType'==subColumn"></el-input>
+            </el-form-item>
+            <el-form-item prop="riskType" label="风险类型">
+                <el-input v-model="formData.riskType" :disabled="'riskType'==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'
+    import { mapState } from 'vuex'
+    import { format } from 'date-fns'
+    import zh from 'date-fns/locale/zh_cn'
+
+    export default {
+        name: 'RiskControl',
+        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: '/riskControl/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: '',
+            }
+        },
+        computed: {
+            ...mapState(['userInfo']),
+        },
+        methods: {
+            onSave() {
+                this.$refs.form.validate((valid) => {
+                    if (valid) {
+                        this.logicalValidate();
+                    } else {
+                        return false;
+                    }
+                });
+            },
+            logicalValidate() {
+                let logicalData = {
+                };
+
+                if (JSON.stringify(logicalData) == '{}') {
+                    this.submit();
+                } else {
+                    this.$http.get({
+                        url: '/riskControl/getOne',
+                        data: logicalData
+                    }).then(res => {
+                        if (res.success) {
+                            let logicalFlag = true;
+                            if (res.data) {
+                                if (this.formData.id) {
+                                    if (res.data.id != this.formData.id) {
+                                        logicalFlag = false;
+                                    }
+                                } else {
+                                    logicalFlag = false;
+                                }
+                            }
+
+                            if (logicalFlag) {
+                                this.submit();
+                            } else {
+                                this.$message.warning('逻辑关键字:'+''+'验证失败')
+                            }
+
+                        } else {
+                            this.$message.warning('逻辑关键字:'+''+'验证失败')
+                        }
+                    });
+                }
+            },
+            submit() {
+                let data = {...this.formData};
+
+                                                                                                                                                                                                
+                this.$http.post({
+                    url: this.formData.id ? '/riskControl/update' : '/riskControl/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: '/riskControl/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>

+ 505 - 0
src/main/vue/src/pages/RiskControls.vue

@@ -0,0 +1,505 @@
+<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:'/riskControl',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('createTime')"
+                                prop="createTime"
+                                label="创建时间"
+                                :formatter="DateTimeFormatter"
+                                min-width="100">
+                        </el-table-column>
+                                                                                            
+                                            <el-table-column
+                                v-if="isColumnShow('codeid')"
+                                prop="codeid"
+                                label="付款码"
+                                min-width="100">
+                        </el-table-column>
+                                                                
+                                            <el-table-column
+                                v-if="isColumnShow('codeName')"
+                                prop="codeName"
+                                label="付款名称"
+                                min-width="100">
+                        </el-table-column>
+                                                                
+                                            <el-table-column
+                                v-if="isColumnShow('payType')"
+                                prop="payType"
+                                label="付款类型"
+                                min-width="100">
+                        </el-table-column>
+                                                                
+                                            <el-table-column
+                                v-if="isColumnShow('riskType')"
+                                prop="riskType"
+                                label="风险类型"
+                                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 {
+        name: 'RiskControls',
+        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: 'createTime',
+                                show: true
+                            },
+                                                                                                                                            {
+                                label: '付款码',
+                                value: 'codeid',
+                                show: true
+                            },
+                                                                                                {
+                                label: '付款名称',
+                                value: 'codeName',
+                                show: true
+                            },
+                                                                                                {
+                                label: '付款类型',
+                                value: 'payType',
+                                show: true
+                            },
+                                                                                                {
+                                label: '风险类型',
+                                value: 'riskType',
+                                show: true
+                            },
+                                                                                                {
+                                label: '备注',
+                                value: 'remark',
+                                show: true
+                            },
+                                                            ],
+                multipleMode: false,
+                showAdvancedQueryDialog: false,
+                advancedQueryFields: [],
+                showTableSortDialog: false,
+                tableSortFields: [],
+                searchMethods: ['=', '!=', '>', '>=', '<', '<=', 'like'],
+                advancedQueryColumns: [
+                                                                        {
+                                label: 'ID',
+                                value: 'id'
+                            },
+                                                                                                                                                                                                                                    {
+                                label: '创建时间',
+                                value: 'create_time'
+                            },
+                                                                                                                                            {
+                                label: '付款码',
+                                value: 'codeId'
+                            },
+                                                                                                {
+                                label: '付款名称',
+                                value: 'code_name'
+                            },
+                                                                                                {
+                                label: '付款类型',
+                                value: 'pay_type'
+                            },
+                                                                                                {
+                                label: '风险类型',
+                                value: 'risk_type'
+                            },
+                                                                                                {
+                                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: '/riskControl/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: '/riskControl',
+                    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 + "/riskControl/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: '/riskControl/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

@@ -299,6 +299,16 @@ const router = new Router({
                     path: '/tixianConfigs',
                     name: 'TixianConfigs',
                     component: () => import('../pages/TixianConfigs')
+                },
+                {
+                    path: '/riskControl',
+                    name: 'RiskControl',
+                    component: () => import('../pages/RiskControl')
+                },
+                {
+                    path: '/riskControls',
+                    name: 'RiskControls',
+                    component: () => import('../pages/RiskControls')
                 }
                 /**INSERT_LOCATION**/
             ],