Просмотр исходного кода

Merge remote-tracking branch 'origin/master'

lyx 3 месяцев назад
Родитель
Сommit
4750c0e40c

+ 2 - 0
alien-entity/src/main/java/shop/alien/entity/store/vo/StoreInfoVo.java

@@ -178,4 +178,6 @@ public class StoreInfoVo extends StoreInfo {
 
     private String storeClockInCount;
 
+    private String commitCount;
+
 }

+ 3 - 3
alien-entity/src/main/java/shop/alien/mapper/LifeFansMapper.java

@@ -36,7 +36,7 @@ public interface LifeFansMapper extends BaseMapper<LifeFans> {
             "    where foll.flag = 'user' and user.delete_flag = 0   " +
             ") foll   " +
             "left join life_fans fans on fans.fans_id = foll.phoneId and fans.followed_id = #{fansId} and fans.delete_flag = 0 " +
-            "left join life_blacklist lb on lb.blocked_type = foll.blockedType and lb.blocked_id = foll.blockedId and lb.blocker_type = #{blockerType} and lb.blocker_id = #{blockerId} and lb.delete_flag = 0" +
+            "left join life_blacklist lb on lb.blocked_type = foll.blockedType and lb.blocked_id = foll.blockedId and lb.blocker_type = #{blockerType} and lb.blocker_id = #{blockerId} and lb.delete_flag = 0 " +
             "${ew.customSqlSegment} ")
     IPage<LifeFansVo> getMyFollowed(IPage<LifeFansVo> iPage, @Param("fansId") String fansId, @Param("blockerType") String blockerType, @Param("blockerId") String blockerId, @Param(Constants.WRAPPER) QueryWrapper<LifeFansVo> wrapper);
 
@@ -84,7 +84,7 @@ public interface LifeFansMapper extends BaseMapper<LifeFans> {
             "    where foll.flag = 'user' and user.delete_flag = 0 " +
             ") foll " +
             "left join life_fans fans on fans.followed_id = foll.phoneId and fans.fans_id = #{fansId} and fans.delete_flag = 0 " +
-            "left join life_blacklist lb on lb.blocked_type = foll.blockedType and lb.blocked_id = foll.blockedId and lb.blocker_type = #{blockerType} and lb.blocker_id = #{blockerId} and lb.delete_flag = 0" +
+            "left join life_blacklist lb on lb.blocked_type = foll.blockedType and lb.blocked_id = foll.blockedId and lb.blocker_type = #{blockerType} and lb.blocker_id = #{blockerId} and lb.delete_flag = 0 " +
             "${ew.customSqlSegment} ")
     IPage<LifeFansVo> getMyFans(IPage<LifeFansVo> iPage, @Param("fansId") String fansId, @Param("blockerType") String blockerType, @Param("blockerId") String blockerId, @Param(Constants.WRAPPER) QueryWrapper<LifeFansVo> wrapper);
 
@@ -147,7 +147,7 @@ public interface LifeFansMapper extends BaseMapper<LifeFans> {
             "    join life_user user on foll.phone = user.user_phone " +
             "    where foll.flag = 'user' and user.delete_flag = 0 " +
             ") foll " +
-            "left join life_blacklist lb on lb.blocked_type = foll.blockedType and lb.blocked_id = foll.blockedId and lb.blocker_type = #{blockerType} and lb.blocker_id = #{blockerId} and lb.delete_flag = 0" +
+            "left join life_blacklist lb on lb.blocked_type = foll.blockedType and lb.blocked_id = foll.blockedId and lb.blocker_type = #{blockerType} and lb.blocker_id = #{blockerId} and lb.delete_flag = 0 " +
             "${ew.customSqlSegment} ")
     IPage<LifeFansVo> getMutualAttention(IPage<LifeFansVo> iPage, @Param("fansId") String fansId, @Param("blockerType") String blockerType, @Param("blockerId") String blockerId, @Param(Constants.WRAPPER) QueryWrapper<LifeFansVo> wrapper);
 

+ 1 - 0
alien-store/src/main/java/shop/alien/store/service/impl/StoreCommentServiceImpl.java

@@ -393,6 +393,7 @@ public class StoreCommentServiceImpl extends ServiceImpl<StoreCommentMapper, Sto
             });
         }
         map.put("commitCount", count.toString());
+        map.put("img", storeCommentVoList.stream().map(StoreCommentVo::getUserImage).limit(6).collect(Collectors.joining(",")));
         if (sumScore == 0 || storeCommentVoList.isEmpty()) {
             map.put("score", "0");
         } else {

+ 5 - 1
alien-store/src/main/java/shop/alien/store/service/impl/StoreIncomeDetailsRecordServiceImpl.java

@@ -24,6 +24,7 @@ import shop.alien.store.service.StoreUserService;
 import shop.alien.store.util.ali.AliApi;
 import shop.alien.util.common.DateUtils;
 import shop.alien.util.common.ListToPage;
+import shop.alien.util.common.constant.CouponTypeEnum;
 
 import java.math.BigDecimal;
 import java.math.RoundingMode;
@@ -314,6 +315,9 @@ public class StoreIncomeDetailsRecordServiceImpl extends ServiceImpl<StoreIncome
             Date endDate = DateUtils.calcDays(now, -4);
             jsonObject.put("date", df.format(startDate) + " ~ " + df.format(endDate));
         }
+        if(storeId!=null){
+            wrapper.eq(StoreIncomeDetailsRecord::getStoreId,storeId);
+        }
         //未绑定提现记录的
         LocalDate startDate = LocalDate.parse(startTime);
         LocalDate endDate = LocalDate.parse(endTime);
@@ -324,7 +328,7 @@ public class StoreIncomeDetailsRecordServiceImpl extends ServiceImpl<StoreIncome
                 .orderByDesc(StoreIncomeDetailsRecord::getCreatedTime);
         if(null != incomeType) {
             if (0 == incomeType) {
-                wrapper.in(StoreIncomeDetailsRecord::getIncomeType, "2", "3");
+                wrapper.in(StoreIncomeDetailsRecord::getIncomeType, CouponTypeEnum.COUPON,CouponTypeEnum.GROUP_BUY);
             } else {
                 wrapper.eq(StoreIncomeDetailsRecord::getIncomeType, incomeType);
             }

+ 10 - 2
alien-store/src/main/java/shop/alien/store/service/impl/StoreInfoServiceImpl.java

@@ -35,6 +35,7 @@ import shop.alien.store.config.BaseRedisService;
 import shop.alien.store.config.GaoDeMapUtil;
 import shop.alien.store.service.NearMeService;
 import shop.alien.store.service.StoreClockInService;
+import shop.alien.store.service.StoreCommentService;
 import shop.alien.store.service.StoreInfoService;
 import shop.alien.store.util.FileUploadUtil;
 import shop.alien.store.util.GroupConstant;
@@ -117,6 +118,8 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
 
     private final StoreClockInService storeClockInService;
 
+    private final StoreCommentService storeCommentService;
+
     private final AliOSSUtil aliOSSUtil;
 
     @Value("${spring.web.resources.excel-path}")
@@ -994,10 +997,15 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
         }
 
         // 店铺平均分
-        Map<Object, List<Map<String, Object>>> avgScoreMap = storeEvaluationMapper.allStoreAvgScore().stream().collect(Collectors.groupingBy(o -> o.get("store_id")));
+        /*Map<Object, List<Map<String, Object>>> avgScoreMap = storeEvaluationMapper.allStoreAvgScore().stream().collect(Collectors.groupingBy(o -> o.get("store_id")));
         if (avgScoreMap.containsKey(String.valueOf(result.getId()))) {
             result.setScore(Double.parseDouble(avgScoreMap.get(String.valueOf(result.getId())).get(0).get("avg_score").toString()));
-        }
+        }*/
+
+        Map<String, String> commitCountAndScore = storeCommentService.getCommitCountAndScore(null, 5, Integer.parseInt(storeId), null, null);
+        result.setScore(Double.parseDouble(commitCountAndScore.get("score")));
+        result.setCommitCount(commitCountAndScore.get("commitCount"));
+
 
         // 在该店铺的打卡次数
         result.setClockInStoreNum(clockStoreList.size());