From 13cf5a68e9d64b722c1c38bb3d675b462ec19d5e Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Tue, 18 May 2021 15:58:59 +0800
Subject: [PATCH] 20210518  申诉

---
 src/main/resources/templates/index.html                                     |    2 
 src/main/resources/mapper/modules/OtcOrderAppealMapper.xml                  |   27 ++++
 src/main/java/com/xcong/excoin/modules/otc/controller/OtcController.java    |   29 ++++
 src/main/java/com/xcong/excoin/modules/otc/entity/OtcOrderAppealEntity.java |   46 +++++++
 src/main/resources/templates/febs/views/modules/otc/otcAppealList.html      |  159 ++++++++++++++++++++++++++
 src/main/java/com/xcong/excoin/modules/otc/controller/ViewController.java   |    9 +
 src/main/java/com/xcong/excoin/modules/otc/service/impl/OtcServiceImpl.java |   38 ++++++
 src/main/java/com/xcong/excoin/modules/otc/mapper/OtcOrderAppealMapper.java |   15 ++
 src/main/java/com/xcong/excoin/modules/otc/service/OtcService.java          |    7 +
 src/main/resources/templates/febs/views/layout.html                         |    2 
 src/main/resources/templates/febs/views/login.html                          |    4 
 11 files changed, 334 insertions(+), 4 deletions(-)

diff --git a/src/main/java/com/xcong/excoin/modules/otc/controller/OtcController.java b/src/main/java/com/xcong/excoin/modules/otc/controller/OtcController.java
index 3050bdc..57dbe5d 100644
--- a/src/main/java/com/xcong/excoin/modules/otc/controller/OtcController.java
+++ b/src/main/java/com/xcong/excoin/modules/otc/controller/OtcController.java
@@ -6,6 +6,7 @@
 import com.xcong.excoin.common.entity.QueryRequest;
 import com.xcong.excoin.modules.member.entity.MemberAccountMoneyChangeEntity;
 import com.xcong.excoin.modules.otc.entity.OtcMarketBussinessEntity;
+import com.xcong.excoin.modules.otc.entity.OtcOrderAppealEntity;
 import com.xcong.excoin.modules.otc.service.OtcService;
 import lombok.RequiredArgsConstructor;
 import org.springframework.validation.annotation.Validated;
@@ -54,5 +55,33 @@
         return otcService.disagreeShop(id);
     }
 
+    /**
+     * 订单申诉列表
+     */
+    @GetMapping("otcAppealList")
+    public FebsResponse otcAppealList(OtcOrderAppealEntity otcOrderAppealEntity, QueryRequest request) {
+        Map<String, Object> data = getDataTable(otcService.otcAppealList(otcOrderAppealEntity, request));
+        return new FebsResponse().success().data(data);
+    }
+
+    /**
+     * 申诉---处理中
+     * @return
+     */
+    @GetMapping("dealIng/{id}")
+    @ControllerEndpoint(operation = "申诉---处理中", exceptionMessage = "失败")
+    public FebsResponse dealIng(@NotNull(message = "{required}") @PathVariable Long id) {
+        return otcService.dealIng(id);
+    }
+
+    /**
+     * 申诉---处理完
+     * @return
+     */
+    @GetMapping("dealDone/{id}")
+    @ControllerEndpoint(operation = "申诉---处理完", exceptionMessage = "失败")
+    public FebsResponse dealDone(@NotNull(message = "{required}") @PathVariable Long id) {
+        return otcService.dealDone(id);
+    }
 
 }
diff --git a/src/main/java/com/xcong/excoin/modules/otc/controller/ViewController.java b/src/main/java/com/xcong/excoin/modules/otc/controller/ViewController.java
index 377dfbf..0b8ffcc 100644
--- a/src/main/java/com/xcong/excoin/modules/otc/controller/ViewController.java
+++ b/src/main/java/com/xcong/excoin/modules/otc/controller/ViewController.java
@@ -25,4 +25,13 @@
         return FebsUtil.view("modules/otc/otcShopList");
     }
 
+    /**
+     * 获取商户审核列表
+     */
+    @GetMapping("otcAppealList")
+    @RequiresPermissions("otcAppealList:view")
+    public String otcAppealList() {
+        return FebsUtil.view("modules/otc/otcAppealList");
+    }
+
 }
diff --git a/src/main/java/com/xcong/excoin/modules/otc/entity/OtcOrderAppealEntity.java b/src/main/java/com/xcong/excoin/modules/otc/entity/OtcOrderAppealEntity.java
new file mode 100644
index 0000000..7ddc04a
--- /dev/null
+++ b/src/main/java/com/xcong/excoin/modules/otc/entity/OtcOrderAppealEntity.java
@@ -0,0 +1,46 @@
+package com.xcong.excoin.modules.otc.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.xcong.excoin.common.entity.BaseEntity;
+import lombok.Data;
+
+//订单申诉表
+@Data
+@TableName("otc_order_appeal")
+public class OtcOrderAppealEntity extends BaseEntity {
+
+    //会员ID
+    private long memberId;
+
+    //订单ID
+    private long order_id;
+
+    //申诉原因
+    private long reason;
+
+    //申诉内容
+    private long content;
+
+    //申诉状态  1:待处理 2:处理中 3:已处理
+    private Integer status;
+    public static final Integer STATUS_ONE = 1;
+    public static final Integer STATUS_TWO = 2;
+    public static final Integer STATUS_THREE = 3;
+
+    @TableField(exist = false)
+    private String account;
+
+    @TableField(exist = false)
+    private String phone;
+
+    @TableField(exist = false)
+    private String inviteId;
+
+    @TableField(exist = false)
+    private String realName;
+
+    @TableField(exist = false)
+    private String orderNo;
+
+}
diff --git a/src/main/java/com/xcong/excoin/modules/otc/mapper/OtcOrderAppealMapper.java b/src/main/java/com/xcong/excoin/modules/otc/mapper/OtcOrderAppealMapper.java
new file mode 100644
index 0000000..713c3d3
--- /dev/null
+++ b/src/main/java/com/xcong/excoin/modules/otc/mapper/OtcOrderAppealMapper.java
@@ -0,0 +1,15 @@
+package com.xcong.excoin.modules.otc.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.xcong.excoin.modules.otc.entity.OtcMarketBussinessEntity;
+import com.xcong.excoin.modules.otc.entity.OtcOrderAppealEntity;
+import org.apache.ibatis.annotations.Param;
+
+public interface OtcOrderAppealMapper extends BaseMapper<OtcOrderAppealEntity> {
+
+    IPage<OtcOrderAppealEntity> otcAppealList(Page<OtcOrderAppealEntity> page,
+                                              @Param("record")OtcOrderAppealEntity otcOrderAppealEntity);
+
+}
diff --git a/src/main/java/com/xcong/excoin/modules/otc/service/OtcService.java b/src/main/java/com/xcong/excoin/modules/otc/service/OtcService.java
index 2f78dab..463f996 100644
--- a/src/main/java/com/xcong/excoin/modules/otc/service/OtcService.java
+++ b/src/main/java/com/xcong/excoin/modules/otc/service/OtcService.java
@@ -5,6 +5,7 @@
 import com.xcong.excoin.common.entity.FebsResponse;
 import com.xcong.excoin.common.entity.QueryRequest;
 import com.xcong.excoin.modules.otc.entity.OtcMarketBussinessEntity;
+import com.xcong.excoin.modules.otc.entity.OtcOrderAppealEntity;
 
 public interface OtcService extends IService<OtcMarketBussinessEntity> {
 
@@ -13,4 +14,10 @@
     FebsResponse agreeShop(Long id);
 
     FebsResponse disagreeShop(Long id);
+
+    IPage<OtcOrderAppealEntity> otcAppealList(OtcOrderAppealEntity otcOrderAppealEntity, QueryRequest request);
+
+    FebsResponse dealDone(Long id);
+
+    FebsResponse dealIng(Long id);
 }
diff --git a/src/main/java/com/xcong/excoin/modules/otc/service/impl/OtcServiceImpl.java b/src/main/java/com/xcong/excoin/modules/otc/service/impl/OtcServiceImpl.java
index e2128f7..c38d754 100644
--- a/src/main/java/com/xcong/excoin/modules/otc/service/impl/OtcServiceImpl.java
+++ b/src/main/java/com/xcong/excoin/modules/otc/service/impl/OtcServiceImpl.java
@@ -9,7 +9,9 @@
 import com.xcong.excoin.modules.member.entity.MemberEntity;
 import com.xcong.excoin.modules.member.mapper.MemberMapper;
 import com.xcong.excoin.modules.otc.entity.OtcMarketBussinessEntity;
+import com.xcong.excoin.modules.otc.entity.OtcOrderAppealEntity;
 import com.xcong.excoin.modules.otc.mapper.OtcMarketBussinessMapper;
+import com.xcong.excoin.modules.otc.mapper.OtcOrderAppealMapper;
 import com.xcong.excoin.modules.otc.service.OtcService;
 import lombok.RequiredArgsConstructor;
 import org.springframework.stereotype.Service;
@@ -23,6 +25,8 @@
 
     @Resource
     private OtcMarketBussinessMapper otcMarketBussinessMapper;
+    @Resource
+    private OtcOrderAppealMapper otcOrderAppealMapper;
     @Resource
     private MemberMapper memberMapper;
 
@@ -69,4 +73,38 @@
         return new FebsResponse().success();
     }
 
+    @Override
+    public IPage<OtcOrderAppealEntity> otcAppealList(OtcOrderAppealEntity otcOrderAppealEntity, QueryRequest request) {
+        Page<OtcOrderAppealEntity> page = new Page<>(request.getPageNum(), request.getPageSize());
+        IPage<OtcOrderAppealEntity> otcOrderAppealEntitys = otcOrderAppealMapper.otcAppealList(page, otcOrderAppealEntity);
+        return otcOrderAppealEntitys;
+    }
+
+    @Override
+    @Transactional
+    public FebsResponse dealDone(Long id) {
+        OtcOrderAppealEntity otcOrderAppealEntity = otcOrderAppealMapper.selectById(id);
+        Integer status = otcOrderAppealEntity.getStatus();
+        if(OtcOrderAppealEntity.STATUS_TWO != status){
+            return new FebsResponse().fail().message("当前状态不是处理中");
+        }
+
+        otcOrderAppealEntity.setStatus(OtcOrderAppealEntity.STATUS_THREE);
+        otcOrderAppealMapper.updateById(otcOrderAppealEntity);
+        return new FebsResponse().success();
+    }
+
+    @Override
+    public FebsResponse dealIng(Long id) {
+        OtcOrderAppealEntity otcOrderAppealEntity = otcOrderAppealMapper.selectById(id);
+        Integer status = otcOrderAppealEntity.getStatus();
+        if(OtcOrderAppealEntity.STATUS_ONE != status){
+            return new FebsResponse().fail().message("当前状态不是待处理");
+        }
+
+        otcOrderAppealEntity.setStatus(OtcOrderAppealEntity.STATUS_TWO);
+        otcOrderAppealMapper.updateById(otcOrderAppealEntity);
+        return new FebsResponse().success();
+    }
+
 }
diff --git a/src/main/resources/mapper/modules/OtcOrderAppealMapper.xml b/src/main/resources/mapper/modules/OtcOrderAppealMapper.xml
new file mode 100644
index 0000000..791fa95
--- /dev/null
+++ b/src/main/resources/mapper/modules/OtcOrderAppealMapper.xml
@@ -0,0 +1,27 @@
+<?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.xcong.excoin.modules.otc.mapper.OtcOrderAppealMapper">
+
+    <select id="otcAppealList" resultType="com.xcong.excoin.modules.otc.entity.OtcOrderAppealEntity">
+        SELECT
+        *,
+        concat(b.first_name,b.second_name) realName
+        FROM
+        otc_order_appeal a
+        LEFT JOIN member m ON m.id = a.member_id
+        LEFT JOIN member_authentication b ON b.member_id = a.member_id
+        LEFT JOIN otc_market_bussiness c ON c.member_id = a.member_id
+        <where>
+            <if test="record != null" >
+                <if test="record.account!=null and record.account!=''">
+                    and (m.phone = #{record.account} or m.email = #{record.account} or m.invite_id=#{record.account})
+                </if>
+                <if test="record.status!=null and record.status!=''">
+                    and a.status= #{record.status}
+                </if>
+            </if>
+        </where>
+        order by m.create_time desc
+    </select>
+
+</mapper>
\ No newline at end of file
diff --git a/src/main/resources/templates/febs/views/layout.html b/src/main/resources/templates/febs/views/layout.html
index c2a0266..ec9ee86 100644
--- a/src/main/resources/templates/febs/views/layout.html
+++ b/src/main/resources/templates/febs/views/layout.html
@@ -63,7 +63,7 @@
         <div class="layui-side-scroll">
             <div class="layui-logo" style="cursor: pointer">
                 <img data-th-src="@{febs/images/logo.png}">
-                <span>Hibit 管理系统</span>
+                <span>云顶 管理系统</span>
             </div>
             <script
                     type="text/html"
diff --git a/src/main/resources/templates/febs/views/login.html b/src/main/resources/templates/febs/views/login.html
index 89928ab..6d2e40b 100644
--- a/src/main/resources/templates/febs/views/login.html
+++ b/src/main/resources/templates/febs/views/login.html
@@ -2,7 +2,7 @@
 <html xmlns:th="http://www.thymeleaf.org">
 <head>
     <meta charset="utf-8">
-    <title>Hibit 后台系统</title>
+    <title>云顶 后台系统</title>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
     <meta name="renderer" content="webkit">
     <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
@@ -19,7 +19,7 @@
         <div class="layui-container">
             <div class="layui-row">
                 <div class="layui-col-xs12 layui-col-lg4 layui-col-lg-offset4 febs-tc">
-                    <div class="layui-logo"><span><b>Hibit</b> 后台系统</span></div>
+                    <div class="layui-logo"><span><b>云顶</b> 后台系统</span></div>
                 </div>
                 <div class="layui-col-xs12 layui-col-lg4 layui-col-lg-offset4" id="login-div">
                     <div class="layui-form" lay-filter="login-form">
diff --git a/src/main/resources/templates/febs/views/modules/otc/otcAppealList.html b/src/main/resources/templates/febs/views/modules/otc/otcAppealList.html
new file mode 100644
index 0000000..cc7d869
--- /dev/null
+++ b/src/main/resources/templates/febs/views/modules/otc/otcAppealList.html
@@ -0,0 +1,159 @@
+<div class="layui-fluid layui-anim febs-anim" id="febs-user" lay-title="OTC订单申诉">
+    <div class="layui-row febs-container">
+        <div class="layui-col-md12">
+            <div class="layui-card">
+                <div class="layui-card-body febs-table-full">
+                    <form class="layui-form layui-table-form" lay-filter="user-table-form">
+                        <div class="layui-row">
+                            <div class="layui-col-md10">
+                                <div class="layui-form-item">
+                                    <div class="layui-inline">
+                                        <div class="layui-input-inline">
+                                            <input type="text" placeholder="手机号/邀请码" name="account" autocomplete="off" class="layui-input">
+                                        </div>
+                                    </div>
+                                    <div class="layui-inline">
+                                        <label class="layui-form-label layui-form-label-sm">状态</label>
+                                        <div class="layui-input-inline">
+                                            <select name="status">
+                                                <option value="">请选择</option>
+                                                <option value="1">待处理</option>
+                                                <option value="2">处理中</option>
+                                                <option value="3">已处理</option>
+                                            </select>
+                                        </div>
+                                    </div>
+                                </div>
+                            </div>
+                            <div class="layui-col-md2 layui-col-sm12 layui-col-xs12 table-action-area">
+                                <div class="layui-btn layui-btn-sm layui-btn-primary febs-button-blue-plain table-action" id="query">
+                                    <i class="layui-icon">&#xe848;</i>
+                                </div>
+                                <div class="layui-btn layui-btn-sm layui-btn-primary febs-button-green-plain table-action" id="reset">
+                                    <i class="layui-icon">&#xe79b;</i>
+                                </div>
+                            </div>
+                        </div>
+                    </form>
+                    <table lay-filter="userTable" lay-data="{id: 'userTable'}"></table>
+                </div>
+            </div>
+        </div>
+    </div>
+</div>
+<!-- 表格操作栏 start -->
+<script type="text/html" id="user-option">
+    <span shiro:lacksPermission="user:view,user:update,user:delete">
+        <span class="layui-badge-dot febs-bg-orange"></span> 无权限
+    </span>
+    <a lay-event="edit" shiro:hasPermission="user:update"><i
+            class="layui-icon febs-edit-area febs-blue">&#xe7a5;</i></a>
+</script>
+<!-- 表格操作栏 end -->
+<script data-th-inline="none" type="text/javascript">
+    // 引入组件并初始化
+    layui.use([ 'jquery', 'form', 'table', 'febs'], function () {
+        var $ = layui.jquery,
+            febs = layui.febs,
+            form = layui.form,
+            table = layui.table,
+            $view = $('#febs-user'),
+            $query = $view.find('#query'),
+            $reset = $view.find('#reset'),
+            $searchForm = $view.find('form'),
+            sortObject = {field: 'phone', type: null},
+            tableIns;
+
+        form.render();
+
+        // 表格初始化
+        initTable();
+
+        // 初始化表格操作栏各个按钮功能
+        table.on('tool(userTable)', function (obj) {
+            var data = obj.data,
+                layEvent = obj.event;
+            if (layEvent === 'dealIng') {
+                febs.modal.confirm('处理', '开始处理申诉?', function () {
+                    dealIng(data.id);
+                });
+            }
+            if (layEvent === 'dealDone') {
+                febs.modal.confirm('处理结束', '确认已处理结束?', function () {
+                    dealDone(data.id);
+                });
+            }
+        });
+        function dealIng(id) {
+            febs.get(ctx + 'otc/dealIng/' + id, null, function () {
+                febs.alert.success('成功');
+                $query.click();
+            });
+        }
+        function dealDone(id) {
+            febs.get(ctx + 'otc/dealDone/' + id, null, function () {
+                febs.alert.success('成功');
+                $query.click();
+            });
+        }
+
+
+        // 查询按钮
+        $query.on('click', function () {
+            var params = $.extend(getQueryParams(), {field: sortObject.field, order: sortObject.type});
+            tableIns.reload({where: params, page: {curr: 1}});
+        });
+
+        // 刷新按钮
+        $reset.on('click', function () {
+            $searchForm[0].reset();
+            sortObject.type = 'null';
+            tableIns.reload({where: getQueryParams(), page: {curr: 1}, initSort: sortObject});
+        });
+
+        function initTable() {
+            tableIns = febs.table.init({
+                elem: $view.find('table'),
+                id: 'userTable',
+                url: ctx + 'otc/otcAppealList',
+                cols: [[
+                    {field: 'phone', title: '手机号', minWidth: 150,align:'left'},
+                    {field: 'realName', title: '姓名', minWidth: 100,align:'left'},
+                    {field: 'inviteId', title: '邀请码', minWidth: 80,align:'center'},
+                    {field: 'status', title: '状态',
+                        templet: function (d) {
+                            if (d.status === 1) {
+                                return '<span style="color:red;">待处理</span>'
+                            } else if (d.status === 2) {
+                                return '<span style="color:blue;">处理中</span>'
+                            }  else if (d.status === 3) {
+                                return '<span>已处理</span>'
+                            }else{
+                                return ''
+                            }
+                        }, minWidth: 80,align:'center'},
+                    {field: 'orderNo', title: '订单编号',minWidth: 100,align:'center'},
+                    {field: 'nikename', title: '商户昵称',minWidth: 100,align:'center'},
+                    {title: '操作',templet: function (d) {
+                            if(d.status === 1){
+                                return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="dealIng" shiro:hasPermission="user:update">马上处理</button>'
+                            }else if(d.status === 2){
+                                return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="dealDone" shiro:hasPermission="user:update">已处理</button>'
+                            }else{
+                                return ''
+                            }
+                        },minWidth: 200,align:'center'}
+                ]]
+            });
+        }
+
+        // 获取查询参数
+        function getQueryParams() {
+            return {
+                account: $searchForm.find('input[name="account"]').val().trim(),
+                status: $searchForm.find("select[name='status']").val(),
+            };
+        }
+
+    })
+</script>
\ No newline at end of file
diff --git a/src/main/resources/templates/index.html b/src/main/resources/templates/index.html
index a6aec71..0f61ac6 100644
--- a/src/main/resources/templates/index.html
+++ b/src/main/resources/templates/index.html
@@ -3,7 +3,7 @@
       xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
 <head>
     <meta charset="utf-8">
-    <title>Hibit 后台系统</title>
+    <title>云顶 后台系统</title>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
     <meta name="renderer" content="webkit">
     <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

--
Gitblit v1.9.1