From 795a2386c9fef02a43baa640af096a741213d065 Mon Sep 17 00:00:00 2001
From: KKSU <15274802129@163.com>
Date: Wed, 15 May 2024 17:11:18 +0800
Subject: [PATCH] 错误流水恢复

---
 src/main/resources/templates/febs/views/dapp/member-withdraw-daibi.html    |   23 ++++++++++-
 src/main/resources/templates/febs/views/modules/banner/zhiyaAdd.html       |    9 ++++
 src/main/resources/templates/febs/views/dapp/member-withdraw.html          |   33 ++++++++++++----
 src/main/java/cc/mrbird/febs/dapp/service/impl/AdminBannerServiceImpl.java |   25 ++++++++++++
 src/main/java/cc/mrbird/febs/dapp/service/IAdminBannerService.java         |    3 +
 src/main/java/cc/mrbird/febs/dapp/controller/AdminBannerController.java    |   10 ++++
 6 files changed, 90 insertions(+), 13 deletions(-)

diff --git a/src/main/java/cc/mrbird/febs/dapp/controller/AdminBannerController.java b/src/main/java/cc/mrbird/febs/dapp/controller/AdminBannerController.java
index efe950b..e929a0a 100644
--- a/src/main/java/cc/mrbird/febs/dapp/controller/AdminBannerController.java
+++ b/src/main/java/cc/mrbird/febs/dapp/controller/AdminBannerController.java
@@ -18,7 +18,6 @@
 import cc.mrbird.febs.rabbit.producer.ChainProducer;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
@@ -43,6 +42,15 @@
     /**
      * 质押恢复
      */
+    @PostMapping("zhiyaAddNew")
+    @ControllerEndpoint(operation = "质押恢复", exceptionMessage = "操作失败")
+    public FebsResponse zhiyaAddNew() {
+        return iAdminBannerService.zhiyaAddNew();
+    }
+
+    /**
+     * 质押恢复
+     */
     @PostMapping("zhiyaAdd")
     @ControllerEndpoint(operation = "质押恢复", exceptionMessage = "操作失败")
     public FebsResponse zhiyaAdd(@Valid ZhiyaAddDto zhiyaAddDto) {
diff --git a/src/main/java/cc/mrbird/febs/dapp/service/IAdminBannerService.java b/src/main/java/cc/mrbird/febs/dapp/service/IAdminBannerService.java
index bfb3146..7fbda83 100644
--- a/src/main/java/cc/mrbird/febs/dapp/service/IAdminBannerService.java
+++ b/src/main/java/cc/mrbird/febs/dapp/service/IAdminBannerService.java
@@ -12,7 +12,6 @@
 
 import javax.validation.Valid;
 import javax.validation.constraints.NotNull;
-import java.math.BigDecimal;
 
 public interface IAdminBannerService extends IService<PlatformBanner> {
     IPage<PlatformBanner> findPlatformBannerInPage(PlatformBanner platformBannerEntity, QueryRequest request);
@@ -34,4 +33,6 @@
     IPage<DappMemberEntity> inviteList(DappMemberEntity dappMemberEntity, QueryRequest request);
 
     FebsResponse zhiyaAdd(ZhiyaAddDto zhiyaAddDto);
+
+    FebsResponse zhiyaAddNew();
 }
diff --git a/src/main/java/cc/mrbird/febs/dapp/service/impl/AdminBannerServiceImpl.java b/src/main/java/cc/mrbird/febs/dapp/service/impl/AdminBannerServiceImpl.java
index 9c94019..1c8c980 100644
--- a/src/main/java/cc/mrbird/febs/dapp/service/impl/AdminBannerServiceImpl.java
+++ b/src/main/java/cc/mrbird/febs/dapp/service/impl/AdminBannerServiceImpl.java
@@ -239,4 +239,29 @@
 //        asyncCjService.calculateAchieve(dappAchieve);
         return new FebsResponse().success();
     }
+
+    @Override
+    public FebsResponse zhiyaAddNew() {
+        List<DappFundFlowEntity> dappFundFlowEntities = dappFundFlowDao.selectList(
+                new QueryWrapper<DappFundFlowEntity>()
+                        .ge("id", 7599L)
+                        .lt("id", 7688L));
+
+        if(CollUtil.isNotEmpty(dappFundFlowEntities)){
+            for(DappFundFlowEntity dappFundFlowEntity : dappFundFlowEntities){
+                Integer type = dappFundFlowEntity.getType();
+                if(FlowTypeEnum.HUA_DIAN_GEREN.getValue() == type || FlowTypeEnum.HUA_DIAN_TUANDUI_USDT.getValue() == type){
+                    Long memberId = dappFundFlowEntity.getMemberId();
+                    BigDecimal amount = dappFundFlowEntity.getAmount();
+                    DappMemberEntity dappMemberEntity = dappMemberDao.selectById(memberId);
+                    BigDecimal usdtBalance = dappMemberEntity.getUsdtBalance();
+                    dappMemberEntity.setUsdtBalance(usdtBalance.subtract(amount));
+                    dappMemberDao.updateUsdtBalanceWithVersion(dappMemberEntity);
+                    log.info("流水处理中。。。。。。"+dappFundFlowEntity.getId()+",处理金额"+amount+",账户余额:"+usdtBalance+",操作后余额:"+dappMemberEntity.getUsdtBalance());
+                    dappFundFlowDao.deleteById(dappFundFlowEntity.getId());
+                }
+            }
+        }
+        return null;
+    }
 }
diff --git a/src/main/resources/templates/febs/views/dapp/member-withdraw-daibi.html b/src/main/resources/templates/febs/views/dapp/member-withdraw-daibi.html
index 6e6aaf5..91c46fa 100644
--- a/src/main/resources/templates/febs/views/dapp/member-withdraw-daibi.html
+++ b/src/main/resources/templates/febs/views/dapp/member-withdraw-daibi.html
@@ -36,6 +36,23 @@
                         </div>
                     </form>
                     <table lay-filter="withdrawDbTable" lay-data="{id: 'withdrawDbTable'}"></table>
+
+                    <style type="text/css">
+                        /*.layui-table-cell{*/
+                        /*    text-align:center;*/
+                        /*    height: auto;*/
+                        /*    white-space: nowrap; !*文本不会换行,在同一行显示*!*/
+                        /*    overflow: hidden; !*超出隐藏*!*/
+                        /*    text-overflow: ellipsis; !*省略号显示*!*/
+                        /*}*/
+                        /*.layui-table img{*/
+                        /*    max-width:100px*/
+                        /*}*/
+                        ::-webkit-scrollbar {
+                            height: 20px !important;
+                            background-color: #f4f4f4;
+                        }
+                    </style>
                 </div>
             </div>
         </div>
@@ -206,10 +223,10 @@
                 toolbar: '#tableToolBarOrderDB',
                 cols: [[
                     {type: 'checkbox', fixed: 'left'},
-                    {title: '地址', templet: '#approve-list', minWidth: 130},
-                    {field: 'createTime', title: '创建时间', minWidth: 180},
+                    {title: '地址', templet: '#approve-list', minWidth: 400},
+                    {field: 'createTime', title: '创建时间', minWidth: 200},
                     {field: 'amount', title: '金额(代币)', minWidth: 130},
-                    {title: '提现状态', templet: '#withdraw-status'},
+                    {title: '提现状态', templet: '#withdraw-status', minWidth: 130},
                     // {field: 'fee', title: '手续费', minWidth: 130},
                     // {title: '操作', toolbar: '#withdraw-option', minWidth: 200}
                 ]]
diff --git a/src/main/resources/templates/febs/views/dapp/member-withdraw.html b/src/main/resources/templates/febs/views/dapp/member-withdraw.html
index b6c742d..404153d 100644
--- a/src/main/resources/templates/febs/views/dapp/member-withdraw.html
+++ b/src/main/resources/templates/febs/views/dapp/member-withdraw.html
@@ -36,16 +36,33 @@
                         </div>
                     </form>
                     <table lay-filter="withdrawTable" lay-data="{id: 'withdrawTable'}"></table>
+
+                    <style type="text/css">
+                        /*.layui-table-cell{*/
+                        /*    text-align:center;*/
+                        /*    height: auto;*/
+                        /*    white-space: nowrap; !*文本不会换行,在同一行显示*!*/
+                        /*    overflow: hidden; !*超出隐藏*!*/
+                        /*    text-overflow: ellipsis; !*省略号显示*!*/
+                        /*}*/
+                        /*.layui-table img{*/
+                        /*    max-width:100px*/
+                        /*}*/
+                        ::-webkit-scrollbar {
+                            height: 20px !important;
+                            background-color: #f4f4f4;
+                        }
+                    </style>
                 </div>
             </div>
         </div>
     </div>
 </div>
-<style>
-    .layui-table-cell {
-        height: auto !important;
-    }
-</style>
+<!--<style>-->
+<!--    .layui-table-cell {-->
+<!--        height: auto !important;-->
+<!--    }-->
+<!--</style>-->
 <script type="text/html" id="withdraw-status">
     {{#
     var status = {
@@ -206,10 +223,10 @@
                 toolbar: '#tableToolBarOrder',
                 cols: [[
                     {type: 'checkbox', fixed: 'left'},
-                    {title: '地址', templet: '#approve-list', minWidth: 130},
-                    {field: 'createTime', title: '创建时间', minWidth: 180},
+                    {title: '地址', templet: '#approve-list', minWidth: 400},
+                    {field: 'createTime', title: '创建时间', minWidth: 200},
                     {field: 'amount', title: '金额(USDT)', minWidth: 130},
-                    {title: '提现状态', templet: '#withdraw-status'},
+                    {title: '提现状态', templet: '#withdraw-status', minWidth: 130},
                     // {field: 'fee', title: '手续费', minWidth: 130},
                     // {title: '操作', toolbar: '#withdraw-option', minWidth: 200}
                 ]]
diff --git a/src/main/resources/templates/febs/views/modules/banner/zhiyaAdd.html b/src/main/resources/templates/febs/views/modules/banner/zhiyaAdd.html
index 7561ced..fa26c05 100644
--- a/src/main/resources/templates/febs/views/modules/banner/zhiyaAdd.html
+++ b/src/main/resources/templates/febs/views/modules/banner/zhiyaAdd.html
@@ -31,6 +31,7 @@
                 </div>
                 <div class="layui-card-footer">
                     <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="zhiya-add-form-submit" id="submit">保存</button>
+                    <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="zhiya-add-form-submitBtn" id="submitBtn">流水恢复</button>
                 </div>
             </div>
         </form>
@@ -68,5 +69,13 @@
             return false;
         });
 
+        form.on('submit(zhiya-add-form-submitBtn)', function (data) {
+            console.log(data);
+            febs.post(ctx + 'admin/banner/zhiyaAddNew', null, function (res) {
+                febs.alert.success('操作成功');
+            });
+            return false;
+        });
+
     });
 </script>
\ No newline at end of file

--
Gitblit v1.9.1