Browse Source

Merge branch 'sit' of alien/alien_cloud into store-plantform

wxd 1 month ago
parent
commit
01c6109463

+ 9 - 0
alien-entity/src/main/java/shop/alien/entity/store/vo/ActivityInviteLogVo.java

@@ -35,4 +35,13 @@ public class ActivityInviteLogVo extends ActivityInviteLog {
 
     @ApiModelProperty(value = "被邀请人奖励信息")
     private String invitedRewardInfo;
+
+    @ApiModelProperty(value = "邀请人真实姓名")
+    private String inviteRealName;
+
+    @ApiModelProperty(value = "被邀请人真实姓名")
+    private String invitedRealName;
+
+    @ApiModelProperty(value = "邀请人昵称")
+    private String inviteNickName;
 }

+ 6 - 0
alien-entity/src/main/java/shop/alien/entity/store/vo/LifeFansVo.java

@@ -50,4 +50,10 @@ public class LifeFansVo {
 
     @ApiModelProperty(value = "拉黑id")
     public String blackListid;
+
+    @ApiModelProperty(value = "用户名")
+    public String username;
+
+    @ApiModelProperty(value = "用户简介")
+    public String accountBlurb;
 }

+ 31 - 24
alien-entity/src/main/java/shop/alien/mapper/ActivityInviteLogMapper.java

@@ -17,30 +17,37 @@ import shop.alien.entity.store.vo.ActivityInviteLogVo;
 public interface ActivityInviteLogMapper extends BaseMapper<ActivityInviteLog> {
 
     @Select("SELECT " +
-            "    ail.*, " +
-            "    lu.user_phone AS invitePhone, " +
-            "    lu1.user_phone AS invitedPhone, " +
-            "    lu1.user_image, " +
-            "    lu1.user_name AS invitedNickName, " +
-            "    CASE " +
-            "        WHEN ail.invite_reward_type = 1 AND lc_invite.id IS NOT NULL THEN " +
-            "            CONCAT('优惠券:', lc_invite.name, '(', IFNULL(lc_invite.offprice, lc_invite.price), '元)') " +
-            "        WHEN ail.invite_reward_type = 2 AND ail.invite_reward_point IS NOT NULL THEN " +
-            "            CONCAT('积分:', ail.invite_reward_point, '分') " +
-            "        ELSE '' " +
-            "    END AS inviteRewardInfo, " +
-            "    CASE " +
-            "        WHEN ail.invited_reward_type = 1 AND lc_invited.id IS NOT NULL THEN " +
-            "            CONCAT('优惠券:', lc_invited.name, '(', IFNULL(lc_invited.offprice, lc_invited.price), '元)') " +
-            "        WHEN ail.invited_reward_type = 2 AND ail.invited_reward_point IS NOT NULL THEN " +
-            "            CONCAT('积分:', ail.invited_reward_point, '分') " +
-            "        ELSE '' " +
-            "    END AS invitedRewardInfo " +
-            "FROM activity_invite_log ail " +
-            "LEFT JOIN life_user lu ON lu.id = ail.invite_user_id AND lu.delete_flag = 0 " +
-            "LEFT JOIN life_user lu1 ON lu1.id = ail.invited_user_id AND lu1.delete_flag = 0 " +
-            "LEFT JOIN life_coupon lc_invite ON lc_invite.id = ail.invite_reward_coupon AND lc_invite.delete_flag = 0 " +
-            "LEFT JOIN life_coupon lc_invited ON lc_invited.id = ail.invited_reward_coupon AND lc_invited.delete_flag = 0 " +
+            "  ail.*," +
+            " lud.real_name as invitedRealName," +
+            " lud.user_name as invitedNickName," +
+            " lu.user_phone AS invitePhone," +
+            " lu.real_name as inviteRealName," +
+            " lu.user_name as inviteNickName," +
+            " lu1.user_phone AS invitedPhone," +
+            " lu1.user_image," +
+            " lu1.user_name AS invitedNickName," +
+            " CASE " +
+            " WHEN ail.invite_reward_type = 1 AND lc_invite.id IS NOT NULL THEN " +
+            " CONCAT('优惠券:', lc_invite.name, '(', IFNULL(lc_invite.offprice, lc_invite.price), '元)') " +
+            " WHEN ail.invite_reward_type = 2 AND ail.invite_reward_point IS NOT NULL THEN " +
+            " CONCAT('积分:', ail.invite_reward_point, '分') " +
+            " ELSE '' " +
+            " END AS inviteRewardInfo, " +
+            " CASE " +
+            " WHEN ail.invited_reward_type = 1 AND lc_invited.id IS NOT NULL THEN " +
+            " CONCAT('优惠券:', lc_invited.name, '(', IFNULL(lc_invited.offprice, lc_invited.price), '元)') " +
+            " WHEN ail.invited_reward_type = 2 AND ail.invited_reward_point IS NOT NULL THEN " +
+            " CONCAT('积分:', ail.invited_reward_point, '分') " +
+            " ELSE '' " +
+            " END AS invitedRewardInfo " +
+            " FROM activity_invite_log ail " +
+            " LEFT JOIN life_user lu ON lu.id = ail.invite_user_id " +
+            " AND lu.delete_flag = 0 " +
+            " LEFT JOIN life_user lud ON lud.id = ail.invited_user_id " +
+            " AND lud.delete_flag = 0 " +
+            " LEFT JOIN life_user lu1 ON lu1.id = ail.invited_user_id AND lu1.delete_flag = 0 " +
+            " LEFT JOIN life_coupon lc_invite ON lc_invite.id = ail.invite_reward_coupon AND lc_invite.delete_flag = 0 " +
+            " LEFT JOIN life_coupon lc_invited ON lc_invited.id = ail.invited_reward_coupon AND lc_invited.delete_flag = 0 " +
             "${ew.customSqlSegment}")
     IPage<ActivityInviteLogVo> getInviteActivityLogList(IPage<ActivityInviteLogVo> iPage, @Param(Constants.WRAPPER) QueryWrapper<ActivityInviteLogVo> wrapper);
 }

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

@@ -24,14 +24,14 @@ public interface LifeFansMapper extends BaseMapper<LifeFans> {
             "        where delete_flag = 0 and fans_id = #{fansId} " +
             "    )   " +
             "    select info.id, IF(info.store_application_status = 0, user.nick_name, info.store_name) AS NAME," +
-            "    user.head_img image, concat('store_', user.phone) phoneId, IF(info.store_application_status = 0, user.account_blurb, info.store_blurb) AS blurb, 1 blockedType,user.id blockedId" +
+            "    user.head_img image, concat('store_', user.phone) phoneId, IF(info.store_application_status = 0, user.account_blurb, info.store_blurb) AS blurb, 1 blockedType,user.id blockedId ,IFNULL(user.nick_name, user.name) username, user.account_blurb accountBlurb " +
             "    from follow foll " +
             "    join store_user user on foll.phone = user.phone " +
             "    join store_info info on info.id = user.store_id " +
             "    left join store_img img on img.store_id = user.store_id and img.img_type = '10' and img.delete_flag = 0 " +
             "    where foll.flag = 'store' and user.delete_flag = 0 and info.delete_flag = 0 " +
             "    union " +
-            "    select user.id, user.user_name name, user.user_image image, concat('user_', user.user_phone) phoneId, user.jianjie blurb, 2 blockedType,user.id blockedId" +
+            "    select user.id, user.user_name name, user.user_image image, concat('user_', user.user_phone) phoneId, user.jianjie blurb, 2 blockedType,user.id blockedId,'' username, '' accountBlurb " +
             "    from follow foll " +
             "    join life_user user on foll.phone = user.user_phone   " +
             "    where foll.flag = 'user' and user.delete_flag = 0   " +
@@ -95,7 +95,7 @@ public interface LifeFansMapper extends BaseMapper<LifeFans> {
             "    from life_fans " +
             "    where delete_flag = 0 and followed_id = #{fansId} " +
             "    ) " +
-            "    select info.id, info.store_name name, user.head_img image, concat('store_', user.phone) phoneId, info.store_blurb blurb " +
+            "    select info.id, info.store_name name, user.head_img image, concat('store_', user.phone) phoneId, info.store_blurb blurb ,IFNULL(user.nick_name, user.name) username, user.account_blurb accountBlurb  " +
             "    from follow foll " +
             "    join store_user user on foll.phone = user.phone " +
             "    join store_info info on info.id = user.store_id " +
@@ -136,14 +136,14 @@ public interface LifeFansMapper extends BaseMapper<LifeFans> {
             "        join life_fans fans2 on fans1.followed_id = fans2.fans_id and fans1.fans_id = fans2.followed_id " +
             "        where fans1.delete_flag = 0 and fans2.delete_flag = 0 and fans1.fans_id = #{fansId} " +
             "    ) " +
-            "    select info.id, info.store_name name, user.head_img image, concat('store_', user.phone) phoneId, info.store_blurb blurb, 1 blockedType,user.id blockedId " +
+            "    select info.id, info.store_name name, user.head_img image, concat('store_', user.phone) phoneId, info.store_blurb blurb, 1 blockedType,user.id blockedId ,IFNULL(user.nick_name, user.name) username, user.account_blurb accountBlurb " +
             "    from follow foll " +
             "    join store_user user on foll.phone = user.phone " +
             "    join store_info info on info.id = user.store_id " +
             "    left join store_img img on img.store_id = user.store_id and img.img_type = '10' and img.delete_flag = 0 " +
             "    where foll.flag = 'store' and user.delete_flag = 0 and info.delete_flag = 0 " +
             "    union " +
-            "    select user.id, user.user_name name, user.user_image image, concat('user_', user.user_phone) phoneId, user.jianjie blurb, 2 blockedType,user.id blockedId " +
+            "    select user.id, user.user_name name, user.user_image image, concat('user_', user.user_phone) phoneId, user.jianjie blurb, 2 blockedType,user.id blockedId,'' username, '' accountBlurb " +
             "    from follow foll " +
             "    join life_user user on foll.phone = user.user_phone " +
             "    where foll.flag = 'user' and user.delete_flag = 0 " +

+ 30 - 30
alien-store/src/main/java/shop/alien/store/controller/AliController.java

@@ -80,36 +80,36 @@ public class AliController {
     @GetMapping("/getIdInfo")
     public R getIdInfo(@RequestParam("name") String name, @RequestParam("idCard") String idCard, @RequestParam("appType") Integer appType) {
         log.info("AliController.getIdInfo?name={}&idCard={}", name, idCard);
-        int size = 0;
-        if (appType == 0) {
-            //根据身份查询未注销的用户
-            size = lifeUserService
-                    .list(new LambdaQueryWrapper<LifeUser>()
-                            .eq(LifeUser::getIdCard, idCard)
-                            .eq(LifeUser::getRealName, name)
-                            .eq(LifeUser::getLogoutFlag, 0))
-                    .size();
-        } else {
-            //根据身份查询已入住或审核中的商家
-            List<StoreUser> storeUserList = storeUserService
-                    .list(new LambdaQueryWrapper<StoreUser>()
-                            .eq(StoreUser::getIdCard, idCard)
-                            .eq(StoreUser::getName, name));
-            List<Integer> storeIds = storeUserList.stream()
-                    .map(StoreUser::getStoreId)
-                    .filter(Objects::nonNull)
-                    .collect(Collectors.toList());
-            if (!storeIds.isEmpty()) {
-                size = storeInfoService
-                        .list(new LambdaQueryWrapper<StoreInfo>()
-                                .in(StoreInfo::getId, storeIds)
-                                .notIn(StoreInfo::getStoreApplicationStatus, 2))
-                        .size();
-            }
-        }
-        if (size > 0) {
-            return R.fail("该身份证已实名认证过");
-        }
+//        int size = 0;
+//        if (appType == 0) {
+//            //根据身份查询未注销的用户
+//            size = lifeUserService
+//                    .list(new LambdaQueryWrapper<LifeUser>()
+//                            .eq(LifeUser::getIdCard, idCard)
+//                            .eq(LifeUser::getRealName, name)
+//                            .eq(LifeUser::getLogoutFlag, 0))
+//                    .size();
+//        } else {
+//            //根据身份查询已入住或审核中的商家
+//            List<StoreUser> storeUserList = storeUserService
+//                    .list(new LambdaQueryWrapper<StoreUser>()
+//                            .eq(StoreUser::getIdCard, idCard)
+//                            .eq(StoreUser::getName, name));
+//            List<Integer> storeIds = storeUserList.stream()
+//                    .map(StoreUser::getStoreId)
+//                    .filter(Objects::nonNull)
+//                    .collect(Collectors.toList());
+//            if (!storeIds.isEmpty()) {
+//                size = storeInfoService
+//                        .list(new LambdaQueryWrapper<StoreInfo>()
+//                                .in(StoreInfo::getId, storeIds)
+//                                .notIn(StoreInfo::getStoreApplicationStatus, 2))
+//                        .size();
+//            }
+//        }
+//        if (size > 0) {
+//            return R.fail("该身份证已实名认证过");
+//        }
         if (aliPayConfig.getIdInfo(name, idCard)) {
             return R.success("身份验证成功");
         }

+ 12 - 4
alien-store/src/main/java/shop/alien/store/service/impl/ActivityInviteConfigServiceImpl.java

@@ -243,9 +243,11 @@ public class ActivityInviteConfigServiceImpl extends ServiceImpl<ActivityInviteC
 
            if(invitedLifeUser == null){
                return "被邀请用户异常";
-           } else if (StringUtils.isNotBlank(invitedLifeUser.getBindInviteCode())){
+           }
+           else if (StringUtils.isNotBlank(invitedLifeUser.getBindInviteCode())){
                return "已经绑定邀请码不能重复绑定";
-           } else if (StringUtils.isNotBlank(invitedLifeUser.getInviteCode()) && invitedLifeUser.getInviteCode().equals(inviteCode)){
+           }
+           else if (StringUtils.isNotBlank(invitedLifeUser.getInviteCode()) && invitedLifeUser.getInviteCode().equals(inviteCode)){
                return "不能绑定自己的邀请码";
            }else {
                LambdaQueryWrapper<ActivityInviteConfig> activityInviteConfigLambdaQueryWrapper = new LambdaQueryWrapper<>();
@@ -290,14 +292,20 @@ public class ActivityInviteConfigServiceImpl extends ServiceImpl<ActivityInviteC
                    activityInviteLog.setDistributionStatus(0);
                    activityInviteLogMapper.insert(activityInviteLog);
 
+                   //邀请奖励类型:2 积分
                    if(activityInviteConfig.getInviteRewardType() == 2){
                        userPointService.addPoint(inviteUserId, activityInviteConfig.getInviteRewardPoint());
-                   } else if(activityInviteConfig.getInviteRewardType() == 1 && activityInviteConfig.getInviteRewardCoupon() > 0){
+                   }
+                   //邀请奖励类型:1 优惠券
+                   else if(activityInviteConfig.getInviteRewardType() == 1 && activityInviteConfig.getInviteRewardCoupon() > 0){
                        lifeDiscountCouponService.issuePlatformCoupon(Collections.singletonList(inviteUserId), activityInviteConfig.getInviteRewardCoupon());
                    }
+                   //被邀请奖励类型:2 积分
                    if(activityInviteConfig.getInvitedRewardType() == 2){
                        userPointService.addPoint(invitedUserId, activityInviteConfig.getInvitedRewardPoint());
-                   } else if (activityInviteConfig.getInvitedRewardType() == 1 && activityInviteConfig.getInvitedRewardCoupon() > 0) {
+                   }
+                   //被邀请奖励类型:1 优惠券
+                   else if (activityInviteConfig.getInvitedRewardType() == 1 && activityInviteConfig.getInvitedRewardCoupon() > 0) {
                        lifeDiscountCouponService.issuePlatformCoupon(Collections.singletonList(invitedUserId), activityInviteConfig.getInvitedRewardCoupon());
                    }