From bb58e108a9da48d84b84d30b73c01106dd642550 Mon Sep 17 00:00:00 2001
From: jiangqs <jiangqs>
Date: 星期三, 02 八月 2023 19:58:49 +0800
Subject: [PATCH] bug

---
 ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/service/impl/member/MemberServiceImpl.java |   25 ++++++++++++++++++++++---
 1 files changed, 22 insertions(+), 3 deletions(-)

diff --git a/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/service/impl/member/MemberServiceImpl.java b/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/service/impl/member/MemberServiceImpl.java
index e881a20..ca03532 100644
--- a/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/service/impl/member/MemberServiceImpl.java
+++ b/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/service/impl/member/MemberServiceImpl.java
@@ -377,6 +377,7 @@
      */
     @Override
     public List<MerMemberPageVo> pageMerMember(Page page, MerMemberPageDto merMemberPageDto) {
+        //处理活跃度
         List<Activeness> activenessList = remoteConfigService.listActiveness().getData();
         if (StringUtils.isNotBlank(merMemberPageDto.getMemberActiveness())) {
             if(!activenessList.isEmpty()){
@@ -390,6 +391,19 @@
                         break;
                     }
                 }
+            }
+        }
+        //处理剩余次数
+        if(merMemberPageDto.getSurpNum()!=null){
+            if(merMemberPageDto.getSurpNum()==1){
+                merMemberPageDto.setSurpStartNum(0);
+                merMemberPageDto.setSurpEndNum(5);
+            }else if(merMemberPageDto.getSurpNum()==2){
+                merMemberPageDto.setSurpStartNum(5);
+                merMemberPageDto.setSurpEndNum(10);
+            }else if(merMemberPageDto.getSurpNum()==3){
+                merMemberPageDto.setSurpStartNum(10);
+                merMemberPageDto.setSurpEndNum(999999999);
             }
         }
         List<MerMemberPageVo> merMemberPageVoList = memberMapper.pageMerMember(page, merMemberPageDto);
@@ -637,7 +651,7 @@
             // Get shop information and set it to the member
             Shop shop = remoteShopService.getShop(merMemberAddDto.getShopId()).getData();
             member.setRelationShopName(shop.getShopName());
-            member.setCustomerSource("商户添加");
+            member.setCustomerSource(merMemberAddDto.getCustomerSource());
             member.setCreateTime(new Date());
             // Save the member and initialize member total
             this.saveOrUpdate(member);
@@ -685,6 +699,11 @@
     member.setBirthday(merMemberEditDto.getBirthday());
     member.setUpdateUserId(merMemberEditDto.getUserId());
     member.setUpdateTime(new Date());
+    List<String> memberNurse = merMemberEditDto.getMemberNurse();
+    if(memberNurse!=null&&!memberNurse.isEmpty()){
+        String memberNurseString = String.join(",", memberNurse);
+        member.setMemberNurse(memberNurseString);
+    }
     this.saveOrUpdate(member);
      // 更新用户手机号
     SysUser sysUser = new SysUser();
@@ -876,7 +895,7 @@
         }
         if(merMemberPageDto.getEndAge()!=null){
             LocalDate currentDate = LocalDate.now();
-            LocalDate startBirthday = currentDate.minusYears(merMemberPageDto.getEndAge());
+            LocalDate startBirthday = currentDate.minusYears(merMemberPageDto.getEndAge()+1);
             DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
             merMemberPageDto.setStartBirthday(startBirthday.format(formatter));
         }
@@ -1578,7 +1597,7 @@
             menPercent = new BigDecimal("100.00");
             womenPercent = new BigDecimal("0.00");
         }else{
-            menPercent = manTotalBig.divide(personTotalBig).setScale(0,BigDecimal.ROUND_HALF_UP);
+            menPercent = manTotalBig.divide(personTotalBig,0,BigDecimal.ROUND_HALF_UP);
             womenPercent = bigTen.subtract(menPercent);
         }
         memberFixedTotalVo.setManPercent(menPercent);

--
Gitblit v1.7.1