From ca08c1252a57544c56d75e4492cb7a846d6880d1 Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Wed, 21 Dec 2022 17:11:45 +0800
Subject: [PATCH] 20221221

---
 src/main/resources/templates/febs/views/modules/mallMember/mallSystemPay.html  |   12 -----
 src/main/resources/templates/febs/views/modules/mallMember/moneyFlowList.html  |    9 ++++
 src/main/java/cc/mrbird/febs/common/enumerates/MemberAgentLevelEnum.java       |    4 +-
 src/main/java/cc/mrbird/febs/mall/mapper/MallMemberMapper.java                 |    2 +
 src/main/resources/mapper/modules/MallMemberMapper.xml                         |   22 +++++++---
 src/main/resources/application-dev.yml                                         |   17 +++-----
 src/main/resources/templates/febs/views/modules/mallMember/moneyFlow.html      |    6 +++
 src/main/java/cc/mrbird/febs/common/enumerates/MallMoneyFlowTypeEnum.java      |    2 +
 src/main/java/cc/mrbird/febs/mall/service/impl/AdminMallMemberServiceImpl.java |   26 +++++++++++--
 src/main/resources/templates/febs/views/modules/mallMember/mallMemberList.html |   17 ++++----
 10 files changed, 73 insertions(+), 44 deletions(-)

diff --git a/src/main/java/cc/mrbird/febs/common/enumerates/MallMoneyFlowTypeEnum.java b/src/main/java/cc/mrbird/febs/common/enumerates/MallMoneyFlowTypeEnum.java
index dce75cd..ad8dc7d 100644
--- a/src/main/java/cc/mrbird/febs/common/enumerates/MallMoneyFlowTypeEnum.java
+++ b/src/main/java/cc/mrbird/febs/common/enumerates/MallMoneyFlowTypeEnum.java
@@ -5,6 +5,8 @@
 @Getter
 public enum MallMoneyFlowTypeEnum {
 
+    SYSTEM_CHARGE("系统拨付",100),
+    CHARGE("充值",10),
     WITHDRAW("提现",9),
     RETURN_MARKET_STAR("星级保证金返还",8),
     BUY_MARKET_STAR("购买星级",7),
diff --git a/src/main/java/cc/mrbird/febs/common/enumerates/MemberAgentLevelEnum.java b/src/main/java/cc/mrbird/febs/common/enumerates/MemberAgentLevelEnum.java
index 4d1daf8..950aba7 100644
--- a/src/main/java/cc/mrbird/febs/common/enumerates/MemberAgentLevelEnum.java
+++ b/src/main/java/cc/mrbird/febs/common/enumerates/MemberAgentLevelEnum.java
@@ -78,7 +78,7 @@
     public String getNameByCode(String code){
         String name = null;
         for (MemberAgentLevelEnum memberAgentLevelEnum : MemberAgentLevelEnum.values()) {
-            if(memberAgentLevelEnum.getCode() == code){
+            if(memberAgentLevelEnum.getCode().equals(code)){
                 name = memberAgentLevelEnum.getName();
             }
         }
@@ -93,7 +93,7 @@
     public String getCodeByName(String name){
         String code = null;
         for (MemberAgentLevelEnum memberAgentLevelEnum : MemberAgentLevelEnum.values()) {
-            if(memberAgentLevelEnum.getName() == name){
+            if(memberAgentLevelEnum.getName().equals(name)){
                 code = memberAgentLevelEnum.getCode();
             }
         }
diff --git a/src/main/java/cc/mrbird/febs/mall/mapper/MallMemberMapper.java b/src/main/java/cc/mrbird/febs/mall/mapper/MallMemberMapper.java
index 1cfd489..dac179f 100644
--- a/src/main/java/cc/mrbird/febs/mall/mapper/MallMemberMapper.java
+++ b/src/main/java/cc/mrbird/febs/mall/mapper/MallMemberMapper.java
@@ -97,4 +97,6 @@
     Integer selectByReferersIdAndLevel(@Param("inviteId")String inviteId, @Param("level")String minLevel);
 
     void updateAccountLevelById(@Param("accountLevel")String accountLevel, @Param("id")Long id);
+
+    void updateLevelStatusById(@Param("levelStatus")int i, @Param("id")Long memberId);
 }
diff --git a/src/main/java/cc/mrbird/febs/mall/service/impl/AdminMallMemberServiceImpl.java b/src/main/java/cc/mrbird/febs/mall/service/impl/AdminMallMemberServiceImpl.java
index d446b78..0ff708d 100644
--- a/src/main/java/cc/mrbird/febs/mall/service/impl/AdminMallMemberServiceImpl.java
+++ b/src/main/java/cc/mrbird/febs/mall/service/impl/AdminMallMemberServiceImpl.java
@@ -398,13 +398,32 @@
         } else {
             iApiMallMemberWalletService.add(mallSystemPayDto.getAddBalance(), mallSystemPayDto.getId(), filedType);
         }
-        mallMoneyFlowService.addMoneyFlow(memberId, bigDecimal, MoneyFlowTypeEnum.SYSTEM.getValue(), null, type);
+
+        mallMoneyFlowService.addMoneyFlow(
+                memberId,
+                null,
+                bigDecimal,
+                MallMoneyFlowTypeEnum.SYSTEM_CHARGE.getCode(),
+                MallMoneyFlow.STATUS_SUCCESS,
+                MallMoneyFlow.IS_RETURN_Y,
+                memberId,
+                FlowTypeEnum.BALANCE.getValue(),
+                MallMoneyFlowTypeEnum.SYSTEM_CHARGE.getName()
+        );
         return new FebsResponse().success();
     }
 
     @Override
     public AdminAgentLevelSetInfoVo getAgentLevelSetInfoByMemberId(long id) {
-        AdminAgentLevelSetInfoVo adminAgentLevelSetInfoVo = mallMemberMapper.getAgentLevelSetInfoByMemberId(id);
+        AdminAgentLevelSetInfoVo adminAgentLevelSetInfoVo = new AdminAgentLevelSetInfoVo();
+        AdminAgentLevelSetInfoVo adminAgentLevelSetInfo = mallMemberMapper.getAgentLevelSetInfoByMemberId(id);
+        if(ObjectUtil.isEmpty(adminAgentLevelSetInfo)){
+            adminAgentLevelSetInfoVo.setId(id);
+            adminAgentLevelSetInfoVo.setLevelCode(MemberAgentLevelEnum.AGENT.getCodeByName(MemberAgentLevelEnum.AGENT.getName()));
+        }else{
+            adminAgentLevelSetInfoVo.setId(id);
+            adminAgentLevelSetInfoVo.setLevelCode(MemberAgentLevelEnum.AGENT.getCodeByName(adminAgentLevelSetInfo.getLevelCode()));
+        }
         return adminAgentLevelSetInfoVo;
     }
 
@@ -417,8 +436,7 @@
         }
         String levelCode = agentLevelSetUpdateDto.getLevelCode();
         String nameByCode = MemberAgentLevelEnum.AGENT.getNameByCode(levelCode);
-        mallMember.setLevelStatus(1);
-        mallMemberMapper.updateById(mallMember);
+        mallMemberMapper.updateLevelStatusById(1,memberId);
         mallMemberMapper.updateLevelById(nameByCode,memberId);
         return new FebsResponse().success();
     }
diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml
index 832744d..b85e6fb 100644
--- a/src/main/resources/application-dev.yml
+++ b/src/main/resources/application-dev.yml
@@ -15,25 +15,20 @@
       datasource:
         # 数据源-1,名称为 base
         base:
-          username: ct_test
-          password: 123456
+          username: db_mall_coin
+          password: db_mall_coin!@#123
           driver-class-name: com.mysql.cj.jdbc.Driver
-          url: jdbc:mysql://120.27.238.55:3306/db_amz?useUnicode=true&characterEncoding=UTF-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2b8
-
-  #          username: db_mall_coin
-  #          password: db_mall_coin123!@#
-  #          driver-class-name: com.mysql.cj.jdbc.Driver
-  #          url: jdbc:mysql://154.91.195.148:3306/db_mall_coin?useUnicode=true&characterEncoding=UTF-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2b8
+          url: jdbc:mysql://154.91.195.148:3306/db_mall_coin?useUnicode=true&characterEncoding=UTF-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2b8
 
   redis:
     # Redis数据库索引(默认为 0)
-    database: 10
+    database: 0
     # Redis服务器地址
     host: 127.0.0.1
     # Redis服务器连接端口
     port: 6379
     # Redis 密码
-    password: dapp!@#123
+#    password: dapp!@#123
     lettuce:
       pool:
         # 连接池中的最小空闲连接
@@ -47,7 +42,7 @@
     # 连接超时时间(毫秒)
     timeout: 5000
   rabbitmq:
-    host: 127.0.0.1
+    host: 154.91.195.148
     port: 5672
     username: xc_rabbit
     password: xuncong123
diff --git a/src/main/resources/mapper/modules/MallMemberMapper.xml b/src/main/resources/mapper/modules/MallMemberMapper.xml
index 898fee9..8784cea 100644
--- a/src/main/resources/mapper/modules/MallMemberMapper.xml
+++ b/src/main/resources/mapper/modules/MallMemberMapper.xml
@@ -31,6 +31,9 @@
                 <if test="record.level!=null and record.level!=''">
                     and m.level=#{record.level}
                 </if>
+                <if test="record.accountLevel!=null and record.accountLevel!=''">
+                    and m.account_level=#{record.accountLevel}
+                </if>
             </if>
         </where>
         order by m.CREATED_TIME desc
@@ -47,16 +50,13 @@
                a.account_status,
                a.CREATED_TIME,
                IFNULL(c.balance,0) balance,
-               IFNULL(c.score,0) score,
-               IFNULL(c.prize_score,0) prizeScore,
                d.description levelName,
                b.name
                FROM mall_member a
             LEFT JOIN mall_member b on a.referrer_id = b.invite_id
             LEFT JOIN mall_member_wallet c on c.member_id = a.id
-            LEFT JOIN data_dictionary_custom d on d.code = a.level
+            LEFT JOIN data_dictionary_custom d on d.description = a.level
             where a.id = #{id}
-            GROUP BY a.id
     </select>
 
     <select id="selectInfoByAccount" resultType="cc.mrbird.febs.mall.entity.MallMember">
@@ -261,10 +261,10 @@
 
 
     <select id="getAgentLevelSetInfoByMemberId" resultType="cc.mrbird.febs.mall.vo.AdminAgentLevelSetInfoVo">
-        SELECT a.id,d.code levelCode
+        SELECT d.description levelCode
         FROM mall_member a
-                 LEFT JOIN data_dictionary_custom d on d.code = a.level
-        where a.id = #{id} and d.type = 'AGENT_LEVEL'
+                 LEFT JOIN data_dictionary_custom d on d.description = a.level
+        where a.id = #{id} and d.type = 'MEMBER_AGENT_LEVEL'
         GROUP BY a.id
     </select>
 
@@ -437,4 +437,12 @@
         where
             id = #{id}
     </update>
+
+    <update id="updateLevelStatusById">
+        update mall_member
+        set
+            level_status = #{levelStatus}
+        where
+            id = #{id}
+    </update>
 </mapper>
\ No newline at end of file
diff --git a/src/main/resources/templates/febs/views/modules/mallMember/mallMemberList.html b/src/main/resources/templates/febs/views/modules/mallMember/mallMemberList.html
index f461f34..2da3abb 100644
--- a/src/main/resources/templates/febs/views/modules/mallMember/mallMemberList.html
+++ b/src/main/resources/templates/febs/views/modules/mallMember/mallMemberList.html
@@ -30,13 +30,12 @@
                                     <div class="layui-inline">
                                         <label class="layui-form-label layui-form-label-sm">会员类型</label>
                                         <div class="layui-input-inline">
-                                            <select name="level">
+                                            <select name="accountLevel">
                                                 <option value="">请选择</option>
-                                                <option value="FIRST_LEVEL">普通会员</option>
-                                                <option value="SECOND_LEVEL">一星</option>
-                                                <option value="THIRD_LEVEL">二星</option>
-                                                <option value="FOUR_LEVEL">三星</option>
-                                                <option value="FIFTH_LEVEL">四星</option>
+                                                <option value="普通">普通</option>
+                                                <option value="一星">一星</option>
+                                                <option value="二星">二星</option>
+                                                <option value="三星">三星</option>
                                             </select>
                                         </div>
                                     </div>
@@ -284,7 +283,7 @@
             }
 
             if (layEvent === 'resetPwd') {
-                febs.modal.confirm('重置登录密码', '是否重置选中账号登录密码?', function () {
+                febs.modal.confirm('重置登录密码', '是否重置选中账号登录密码为【a123456】?', function () {
                     var ids = [];
                     layui.each(checkData, function (key, item) {
                         ids.push(item.id)
@@ -294,7 +293,7 @@
             }
 
             if (layEvent === 'resetPayPwd') {
-                febs.modal.confirm('重置交易密码', '是否重置选中账号交易密码?', function () {
+                febs.modal.confirm('重置交易密码', '是否重置选中账号交易密码为【654321】?', function () {
                     var ids = [];
                     layui.each(checkData, function (key, item) {
                         ids.push(item.id)
@@ -356,7 +355,7 @@
                 name: $searchForm.find('input[name="name"]').val().trim(),
                 account: $searchForm.find('input[name="account"]').val().trim(),
                 accountStatus: $searchForm.find("select[name='accountStatus']").val(),
-                level: $searchForm.find("select[name='level']").val(),
+                accountLevel: $searchForm.find("select[name='accountLevel']").val(),
             };
         }
 
diff --git a/src/main/resources/templates/febs/views/modules/mallMember/mallSystemPay.html b/src/main/resources/templates/febs/views/modules/mallMember/mallSystemPay.html
index 6cdd4de..adae2e3 100644
--- a/src/main/resources/templates/febs/views/modules/mallMember/mallSystemPay.html
+++ b/src/main/resources/templates/febs/views/modules/mallMember/mallSystemPay.html
@@ -73,19 +73,9 @@
         initUserValue();
 
         function initUserValue() {
-            var balance;
-            if (type == 1) {
-                balance = systemPay.balance
-            } else if (type == 2) {
-                balance = systemPay.score
-            } else if (type ==3) {
-                balance = systemPay.prizeScore
-            } else {
-
-            }
             form.val("systemPay-update-form", {
                 "id": systemPay.id,
-                "balance": balance,
+                "balance": systemPay.balance,
             });
         }
 
diff --git a/src/main/resources/templates/febs/views/modules/mallMember/moneyFlow.html b/src/main/resources/templates/febs/views/modules/mallMember/moneyFlow.html
index cc8303b..4d6dd9d 100644
--- a/src/main/resources/templates/febs/views/modules/mallMember/moneyFlow.html
+++ b/src/main/resources/templates/febs/views/modules/mallMember/moneyFlow.html
@@ -62,6 +62,12 @@
                                 return '<span>购买星级</span>'
                             }else if (d.type === 8) {
                                 return '<span>星级保证金返还</span>'
+                            }else if (d.type === 9) {
+                                return '<span>提现</span>'
+                            }else if (d.type === 10) {
+                                return '<span>充值</span>'
+                            }else if (d.type === 100) {
+                                return '<span>系统拨付</span>'
                             }else{
                                 return ''
                             }
diff --git a/src/main/resources/templates/febs/views/modules/mallMember/moneyFlowList.html b/src/main/resources/templates/febs/views/modules/mallMember/moneyFlowList.html
index 1215858..ee7f4f9 100644
--- a/src/main/resources/templates/febs/views/modules/mallMember/moneyFlowList.html
+++ b/src/main/resources/templates/febs/views/modules/mallMember/moneyFlowList.html
@@ -30,6 +30,9 @@
                                                 <option value="6">团队管理补贴</option>
                                                 <option value="7">购买星级</option>
                                                 <option value="8">星级保证金返还</option>
+                                                <option value="9">提现</option>
+                                                <option value="10">充值</option>
+                                                <option value="100">系统拨付</option>
                                             </select>
                                         </div>
                                     </div>
@@ -129,6 +132,12 @@
                                 return '<span>购买星级</span>'
                             }else if (d.type === 8) {
                                 return '<span>星级保证金返还</span>'
+                            }else if (d.type === 9) {
+                                return '<span>提现</span>'
+                            }else if (d.type === 10) {
+                                return '<span>充值</span>'
+                            }else if (d.type === 100) {
+                                return '<span>系统拨付</span>'
                             }else{
                                 return ''
                             }

--
Gitblit v1.9.1