Pārlūkot izejas kodu

Merge remote-tracking branch 'origin/master'

zyp 1 nedēļu atpakaļ
vecāks
revīzija
4e29a1e49b

+ 2 - 0
fs-admin/src/main/java/com/fs/course/controller/FsUserCoursePeriodController.java

@@ -189,6 +189,7 @@ public class FsUserCoursePeriodController extends BaseController {
         return R.ok().put("data", periodRedPacketList);
     }
 
+    @Log(title = "按课程批量保存设置红包金额", businessType = BusinessType.UPDATE)
     @PreAuthorize("@ss.hasPermi('course:period:setCourseRedPacket')")
     @ApiOperation("按课程批量保存设置红包金额")
     @PostMapping("/batchRedPacket")
@@ -202,6 +203,7 @@ public class FsUserCoursePeriodController extends BaseController {
         return R.ok();
     }
 
+    @Log(title = "按营期批量保存设置红包金额", businessType = BusinessType.UPDATE)
     @PreAuthorize("@ss.hasPermi('course:period:setRedPacket')")
     @ApiOperation("按营期批量保存设置红包金额")
     @PostMapping("/batchRedPacket/byPeriod")

+ 9 - 0
fs-admin/src/test/java/com/fs/course/controller/FsCourseDomainNameControllerTest.java

@@ -4,6 +4,8 @@ import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.json.JSONUtil;
 import com.fs.FSAdminApplication;
 import com.fs.course.config.RedPacketConfig;
+import com.fs.statis.service.IStatisticsCompanyService;
+import com.fs.statis.service.impl.StatisticsCompanyServiceImpl;
 import com.fs.system.service.ISysConfigService;
 import com.github.binarywang.wxpay.bean.request.WxPayRefundRequest;
 import com.github.binarywang.wxpay.bean.request.WxPayUnifiedOrderRequest;
@@ -32,11 +34,18 @@ import static org.junit.jupiter.api.Assertions.*;
 @Slf4j
 class FsCourseDomainNameControllerTest {
 
+    @Autowired
+    private StatisticsCompanyServiceImpl statisticsCompanyService;
     @Autowired
     private WxPayService wxPayService;
 
     @Autowired
     private ISysConfigService configService;
+
+    @Test
+    public void test(){
+        statisticsCompanyService.rewardMoneyTaskEverydayCompanyUser();
+    }
     @Test
     public void nativePay() throws WxPayException {
 

+ 1 - 1
fs-company-app/src/main/java/com/fs/app/controller/FsUserController.java

@@ -316,7 +316,7 @@ public class FsUserController extends AppBaseController {
         return fsUserService.becomeMember(param);
     }
 
-    //    @Login
+    @Login
     @PostMapping("/userImage")
     @ApiOperation("生成分享会员海报")
     public R createCourseImage(@RequestBody FsUserCourseBeMemberImageParam param) {

+ 36 - 5
fs-company/src/main/java/com/fs/company/controller/IndexStatisticsController.java

@@ -8,6 +8,7 @@ import com.fs.core.web.service.TokenService;
 import com.fs.statis.StatisticsRedisConstant;
 import com.fs.statis.dto.*;
 import io.jsonwebtoken.lang.Assert;
+import lombok.extern.slf4j.Slf4j;
 import org.apache.http.util.Asserts;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
@@ -20,6 +21,7 @@ import static com.fs.statis.StatisticsRedisConstant.*;
 /**
  * 首页-统计
  */
+@Slf4j
 @RestController
 @RequestMapping("/index/statistics")
 public class IndexStatisticsController {
@@ -161,20 +163,32 @@ public class IndexStatisticsController {
      */
     @PostMapping("/rewardMoneyTopTen")
     public R rewardMoneyTopTen(@RequestBody AnalysisPreviewQueryDTO param){
+        log.info("开始处理奖励金额top10请求");
+
         Integer type = param.getType();
         Integer dataType = param.getDataType();
         Integer userType = param.getUserType();
         LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
         Long companyId = loginUser.getCompany().getCompanyId();
         Long companyUserId = loginUser.getUser().getUserId();
+        log.info("请求参数: type={}, dataType={}, userType={}, companyId={}, companyUserId={}",
+                type, dataType, userType, companyId, companyUserId);
 
         param.setCompanyId(companyId);
         List<RewardMoneyTopTenDTO> rewardMoneyTopTenDTOS;
+        String cacheKey;
+
         if(loginUser.getUser().isAdmin()) {
-            rewardMoneyTopTenDTOS = redisCache.getCacheObject( String.format("%s:%d:%d:%d:%d", CHARTS_REWARD_MONEY_TOP_TEN, type,dataType,userType,param.getCompanyId()));
+            cacheKey = String.format("%s:%d:%d:%d:%d", CHARTS_REWARD_MONEY_TOP_TEN, type,dataType,userType,param.getCompanyId());
+            log.info("管理员用户,使用缓存key: {}", cacheKey);
+
         } else {
-            rewardMoneyTopTenDTOS = redisCache.getCacheObject( String.format("%s:%d:%d:%d:%d:%d", CHARTS_REWARD_MONEY_TOP_TEN, type,dataType,userType,param.getCompanyId(),companyUserId));
+            cacheKey = String.format("%s:%d:%d:%d:%d:%d", CHARTS_REWARD_MONEY_TOP_TEN, type,dataType,userType,param.getCompanyId(),companyUserId);
+            log.info("普通用户,使用缓存key: {}", cacheKey);
+
         }
+        rewardMoneyTopTenDTOS = redisCache.getCacheObject(cacheKey);
+        log.info("从Redis缓存中获取到的数据大小: {}", rewardMoneyTopTenDTOS != null ? rewardMoneyTopTenDTOS.size() : 0);
 
         return R.ok().put("data", rewardMoneyTopTenDTOS);
     }
@@ -189,8 +203,13 @@ public class IndexStatisticsController {
         LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
         Long companyId = loginUser.getCompany().getCompanyId();
         param.setCompanyId(companyId);
+        List<RewardMoneyTrendDTO> rewardMoneyTrendDTOS;
+        if(loginUser.getUser().isAdmin()) {
+            rewardMoneyTrendDTOS = redisCache.getCacheObject( String.format("%s:%d:%d:%d", CHARTS_REWARD_MONEY_TREND, type,userType,param.getCompanyId()));
+        } else {
+            rewardMoneyTrendDTOS = redisCache.getCacheObject( String.format("%s:%d:%d:%d:%d", CHARTS_REWARD_MONEY_TREND, type,userType,param.getCompanyId(),loginUser.getUser().getUserId()));
+        }
 
-        List<RewardMoneyTrendDTO> rewardMoneyTrendDTOS = redisCache.getCacheObject( String.format("%s:%d:%d:%d", CHARTS_REWARD_MONEY_TREND, type,userType,param.getCompanyId()));
         return R.ok().put("data", rewardMoneyTrendDTOS);
     }
 
@@ -206,8 +225,13 @@ public class IndexStatisticsController {
         LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
         Long companyId = loginUser.getCompany().getCompanyId();
         param.setCompanyId(companyId);
+        List<CourseStatsDTO> courseStatsDTOS;
+        if(loginUser.getUser().isAdmin()) {
+            courseStatsDTOS = redisCache.getCacheObject(String.format("%s:%d:%d:%d:%s:%d", CHARTS_WATCH_TOP_TEN, type,statisticalType,userType,sort,param.getCompanyId()));
+        } else {
+            courseStatsDTOS = redisCache.getCacheObject(String.format("%s:%d:%d:%d:%s:%d:%d", CHARTS_WATCH_TOP_TEN, type,statisticalType,userType,sort,param.getCompanyId(),loginUser.getUser().getUserId()));
+        }
 
-        List<CourseStatsDTO> courseStatsDTOS = redisCache.getCacheObject(String.format("%s:%d:%d:%d:%s:%d", CHARTS_WATCH_TOP_TEN, type,statisticalType,userType,sort,param.getCompanyId()));
         return R.ok().put("data", courseStatsDTOS);
     }
 
@@ -219,7 +243,14 @@ public class IndexStatisticsController {
         LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
         Long companyId = loginUser.getCompany().getCompanyId();
 
-        DealerAggregatedDTO dealerAggregatedDTO = redisCache.getCacheObject(String.format("%s:%d",StatisticsRedisConstant.DATA_OVERVIEW_DEALER_AGGREGATED,companyId));
+        DealerAggregatedDTO dealerAggregatedDTO;
+
+        if(loginUser.getUser().isAdmin()) {
+            dealerAggregatedDTO = redisCache.getCacheObject(String.format("%s:%d",StatisticsRedisConstant.DATA_OVERVIEW_DEALER_AGGREGATED,companyId));
+        } else {
+            dealerAggregatedDTO = redisCache.getCacheObject(String.format("%s:%d:%d",StatisticsRedisConstant.DATA_OVERVIEW_DEALER_AGGREGATED,companyId,loginUser.getUser().getUserId()));
+        }
+
 
         return R.ok().put("data",dealerAggregatedDTO);
     }

+ 3 - 0
fs-service-system/src/main/java/com/fs/course/param/PeriodCountParam.java

@@ -30,5 +30,8 @@ public class PeriodCountParam implements Serializable {
 
     private LocalDate maxDate;
 
+    @ApiModelProperty(value = "公司ID")
+    private Long companyId;
+
 }
 

+ 5 - 1
fs-service-system/src/main/java/com/fs/course/service/impl/FsUserCoursePeriodDaysServiceImpl.java

@@ -35,7 +35,10 @@ import java.math.BigDecimal;
 import java.math.BigInteger;
 import java.time.LocalDate;
 import java.time.LocalDateTime;
-import java.util.*;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.function.Function;
 import java.util.stream.Collectors;
@@ -238,6 +241,7 @@ public class FsUserCoursePeriodDaysServiceImpl extends ServiceImpl<FsUserCourseP
         CourseAnalysisParam courseAnalysisParam = new CourseAnalysisParam();
         courseAnalysisParam.setPeriodId(param.getPeriodId());
         courseAnalysisParam.setVideoIdList(param.getVideoIdList());
+        courseAnalysisParam.setCompanyId(param.getCompanyId());
         List<FsCourseAnalysisCountVO> courseCountList = fsUserMapper.courseAnalysisWatchLog(courseAnalysisParam);
         List<FsCourseAnalysisCountVO> redPacketCountList = fsUserMapper.courseAnalysisRedPacketCount(courseAnalysisParam);
         List<FsCourseAnalysisCountVO> answerCountList = fsUserMapper.courseAnalysisAnswerCount(courseAnalysisParam);

+ 1 - 1
fs-service-system/src/main/java/com/fs/course/service/impl/FsUserCourseVideoServiceImpl.java

@@ -1451,7 +1451,7 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
         //读取配置给前端返回
         String json = sysConfigService.selectConfigByKey("course.config");
         CourseConfig config = JSONUtil.toBean(json, CourseConfig.class);
-        if (user.getNickname()!=null){
+        if (StringUtils.isEmpty(user.getNickname())){
             Map<String,Object> map = new HashMap<>();
             map.put("authType",config.getMiniAppAuthType());
             if (config.getMiniAppAuthType()==2){

+ 2 - 2
fs-service-system/src/main/java/com/fs/statis/service/impl/StatisticsCompanyServiceImpl.java

@@ -438,7 +438,7 @@ public class StatisticsCompanyServiceImpl implements IStatisticsCompanyService {
         param.setUserType(userType);
         List<WatchEndPlayTrendDTO> watchEndPlayTrendDTOS = this.watchEndPlayTrend(param);
 
-        redisCache.setCacheObject(String.format("%s:%d:%d",DATA_OVERVIEW_DEALER_CHARTS,type,userType),watchEndPlayTrendDTOS);
+        redisCache.setCacheObject(String.format("%s:%d:%d:%d",DATA_OVERVIEW_DEALER_CHARTS,type,userType,companyId),watchEndPlayTrendDTOS);
     }
 
     @Override
@@ -497,7 +497,7 @@ public class StatisticsCompanyServiceImpl implements IStatisticsCompanyService {
         param.setCompanyUserId(companyUserId);
         List<WatchEndPlayTrendDTO> watchEndPlayTrendDTOS = this.watchEndPlayTrend(param);
 
-        redisCache.setCacheObject(String.format("%s:%d:%d:%d",DATA_OVERVIEW_DEALER_CHARTS,type,userType,companyUserId),watchEndPlayTrendDTOS);
+        redisCache.setCacheObject(String.format("%s:%d:%d:%d:%d",DATA_OVERVIEW_DEALER_CHARTS,type,userType,companyId,companyUserId),watchEndPlayTrendDTOS);
     }
 
     @Override

+ 3 - 0
fs-service-system/src/main/java/com/fs/store/mapper/FsUserMapper.java

@@ -314,4 +314,7 @@ public interface FsUserMapper
     List<FsUser> selectFsUserListByJointUserNameKey(String userNameKey);
 
     Map<String, Long> countUserCourse2(UserStatisticsCommonParam param);
+
+    Map<String, Long> countCourseDetailsNew(UserStatisticsCommonParam param);
+
 }

+ 5 - 4
fs-service-system/src/main/java/com/fs/store/service/impl/FsUserServiceImpl.java

@@ -761,7 +761,8 @@ public class FsUserServiceImpl implements IFsUserService
             param.setCompanyId(companyUser.getCompanyId());
         }
         // 获取课程统计
-        Map<String, Long> couserMap = fsUserMapper.countUserCourse(param);
+//        Map<String, Long> couserMap = fsUserMapper.countUserCourse(param);
+        Map<String, Long> couserMap = fsUserMapper.countUserCourse2(param);
         if (couserMap != null) {
             fsUserStatisticsVO.setCourseWatchNum(couserMap.get("courseWatchNum").intValue()).setCourseCompleteNum(couserMap.get("courseCompleteNum").intValue());
 
@@ -799,8 +800,8 @@ public class FsUserServiceImpl implements IFsUserService
 
     @Override
     public FsUserStatisticsVO userStatisticsDetails(UserStatisticsCommonParam param) {
-//        FsUserStatisticsVO userStatisticsVO = getUserStatistics(param);
-        FsUserStatisticsVO userStatisticsVO = getUserStatistics2(param);
+        FsUserStatisticsVO userStatisticsVO = getUserStatistics(param);
+//        FsUserStatisticsVO userStatisticsVO = getUserStatistics2(param);
 
         // 判断是否是管理员
         CompanyUser companyUser = companyUserMapper.selectCompanyUserById(param.getUserId());
@@ -808,7 +809,7 @@ public class FsUserServiceImpl implements IFsUserService
             param.setUserId(0L);
         }
         //统计课程数据详情,在查询统计详情的时候需要显示
-        Map<String, Long> courseDetailsMap = fsUserMapper.countCourseDetails(param);
+        Map<String, Long> courseDetailsMap = fsUserMapper.countCourseDetailsNew(param);
         if(courseDetailsMap != null && courseDetailsMap.get("courseNum") != null && courseDetailsMap.get("videoNum") != null && courseDetailsMap.get("courseUserNum") != null){
             userStatisticsVO.setCourseNum(Integer.parseInt(courseDetailsMap.get("courseNum").toString()))
                     .setVideoNum(Integer.parseInt(courseDetailsMap.get("videoNum").toString()))

+ 1 - 0
fs-service-system/src/main/resources/mapper/course/FsUserWatchStatisticsMapper.xml

@@ -119,6 +119,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             fwl.company_id
         FROM
             fs_course_watch_log fwl
+
         WHERE
             fwl.send_type = 1
         GROUP BY

+ 12 - 0
fs-service-system/src/main/resources/mapper/statis/ConsumptionBalanceMapper.xml

@@ -213,6 +213,12 @@
             <if test="userType != null">
                 AND send_type = ${userType}
             </if>
+            <if test="companyId != null">
+                AND company_id = #{companyId}
+            </if>
+            <if test="companyUserId != null">
+                AND company_user_id = #{companyUserId}
+            </if>
         </where>
         GROUP BY
         start_date
@@ -322,6 +328,9 @@
             <if test="companyId != null">
                 and log.company_id = ${companyId}
             </if>
+            <if test="companyUserId != null">
+                and log.company_user_id = #{companyUserId}
+            </if>
         </where>
         GROUP BY
             <if test="dataType == 0">
@@ -361,6 +370,9 @@
             <if test="companyId != null">
                 and log.company_id = ${companyId}
             </if>
+            <if test="companyUserId != null">
+                and log.company_user_id = #{companyUserId}
+            </if>
         </where>
         group by start_date
     </select>

+ 0 - 1
fs-service-system/src/main/resources/mapper/store/FsUserCourseCountMapper.xml

@@ -61,7 +61,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             ifnull ( sum( fs_user_course_count.miss_course_count ), 0 ) AS miss_course_count,
             ifnull ( sum( fs_user_course_count.part_course_count ), 0 ) AS part_course_count,
             Max( fs_user_course_count.last_watch_date ) AS last_watch_date,
-            ifnull ( sum( fs_user_course_count.stop_watch_days ), 0 ) AS stop_watch_days,
             Max( fs_user_course_count.complete_watch_date) AS complete_watch_date
             from fs_user_course_count where user_id = ${userId}
     </select>

+ 88 - 20
fs-service-system/src/main/resources/mapper/store/FsUserMapper.xml

@@ -525,10 +525,12 @@
         fs_user.*,
         fs_user_course_count.id,
         fs_user_course_count.watch_course_count,
+--         fs_course_watch_log.watch_course_count,
         fs_user_course_count.miss_course_count,
         fs_user_course_count.miss_course_status,
         fs_user_course_count.course_ids,
         fs_user_course_count.part_course_count,
+--         fs_course_watch_log.part_course_count,
         fs_user_course_count.last_watch_date,
         fs_user_course_count.STATUS AS courseCountStatus,
         fs_user_course_count.stop_watch_days,
@@ -543,6 +545,17 @@
         LEFT JOIN company_tag_user ON fs_user.user_id = company_tag_user.user_id
         LEFT JOIN company_tag ON FIND_IN_SET(company_tag.tag_id, company_tag_user.tag_ids) > 0
         LEFT JOIN fs_user_company_user ON fs_user_company_user.user_id = fs_user.user_id
+        LEFT JOIN company_user ON company_user.user_id = fs_user_company_user.company_user_id
+--         LEFT JOIN (
+--         SELECT
+--         fs_course_watch_log.user_id,
+--         count( DISTINCT fs_course_watch_log.video_id ) watch_course_count,
+--         count( DISTINCT fs_course_watch_log.period_id ) part_course_count
+--         FROM
+--         fs_course_watch_log
+--         GROUP BY
+--         fs_course_watch_log.user_id
+--         ) fs_course_watch_log ON fs_course_watch_log.user_id = fs_user.user_id
         LEFT JOIN company_user ON company_user.user_id = fs_user.company_user_id
         where fs_user.is_del = 0
         <if test="userId != null and userId!= 0 ">
@@ -1418,6 +1431,9 @@
                     #{videoId}
                 </foreach>
             </if>
+            <if test="companyId != null">
+                AND flog.company_id = #{companyId}
+            </if>
         </where>
         GROUP BY
         flog.video_id
@@ -1462,7 +1478,9 @@
                     #{videoId}
                 </foreach>
             </if>
-
+            <if test="companyId != null">
+                AND fs_course_answer_logs.company_id = #{companyId}
+            </if>
         </where>
         GROUP BY
         fs_course_answer_logs.video_id
@@ -1582,6 +1600,9 @@
                     #{videoId}
                 </foreach>
             </if>
+            <if test="companyId != null">
+                AND fwl.company_id = #{companyId}
+            </if>
         </where>
         GROUP BY
         fwl.video_id
@@ -1667,6 +1688,7 @@
             fwl.period_id, fwl.video_id, fwl.company_user_id, fwl.company_id
         FROM
             fs_course_watch_log fwl
+
         WHERE
             fwl.send_type = 1
         GROUP BY
@@ -1765,37 +1787,47 @@
             and company_user_id = #{companyUserId}
         </if>
     </select>
+
     <select id="countUserCourse2" resultType="java.util.Map">
         SELECT
         (
         SELECT
-        count(1)
+        count(DISTINCT l.user_id)
         FROM
         fs_course_watch_log l
+        LEFT JOIN fs_user on fs_user.user_id = l.user_id
         LEFT JOIN company_user ON l.company_user_id = company_user.user_id
         where
-            l.log_type != 3 and send_type = 1
-            <if test="userId != null and userId != 0 ">
-                and (l.company_user_id = #{userId} OR company_user.parent_id = #{userId} )
-            </if>
-            <if test="userId != null and userId == 0 ">
-                and l.company_id = #{companyId}
-            </if>
-            <if test="periodId != null and periodId != ''">
-                AND l.period_id = #{periodId}
-            </if>
-            <if test="videoId != null and videoId != ''">
-                AND l.video_id = #{videoId}
-            </if>
-            <if test="companyUserId != null and companyUserId != ''">
-                AND l.user_id = #{companyUserId}
-            </if>
+        l.log_type != 3 and send_type = 1
+        <if test="userId != null and userId != 0 ">
+            and (l.company_user_id = #{userId} OR company_user.parent_id = #{userId} )
+        </if>
+        <if test="userId != null and userId == 0 ">
+            and l.company_id = #{companyId}
+        </if>
+        <if test="periodId != null and periodId != ''">
+            AND l.period_id = #{periodId}
+        </if>
+        <if test="videoId != null and videoId != ''">
+            AND l.video_id = #{videoId}
+        </if>
+        <if test="startTime != null and startTime !='' ">
+            and l.create_time &gt;= #{startTime}
+        </if>
+        <if test="endTime != null and endTime != ''">
+            and l.create_time &lt;= #{endTime}
+        </if>
+        -- 单独通过销售id查询
+        <if test="companyUserId != null and companyUserId != ''">
+            AND l.company_user_id = #{companyUserId}
+        </if>
         ) as courseWatchNum,
         (
         SELECT
-        count(1)
+        count(DISTINCT l.user_id)
         FROM
         fs_course_watch_log l
+        LEFT JOIN fs_user on fs_user.user_id = l.user_id
         LEFT JOIN company_user ON l.company_user_id = company_user.user_id
         where
         l.log_type = 2 and send_type = 1
@@ -1811,11 +1843,47 @@
         <if test="videoId != null and videoId != ''">
             AND l.video_id = #{videoId}
         </if>
+        <if test="startTime != null and startTime !='' ">
+            and l.create_time &gt;= #{startTime}
+        </if>
+        <if test="endTime != null and endTime != ''">
+            and l.create_time &lt;= #{endTime}
+        </if>
         -- 单独通过销售id查询
         <if test="companyUserId != null and companyUserId != ''">
-            AND l.user_id = #{companyUserId}
+            AND l.company_user_id = #{companyUserId}
         </if>
         ) as courseCompleteNum
     </select>
 
+    <select id="countCourseDetailsNew" resultType="Map">
+        SELECT
+        count( DISTINCT l.period_id ) as courseNum,
+        count( DISTINCT l.video_id ) as videoNum,
+        count( DISTINCT l.user_id ) as courseUserNum
+        FROM
+        fs_course_watch_log l
+        left join fs_user on fs_user.user_id = l.user_id
+        LEFT JOIN company_user ON l.company_user_id = company_user.user_id
+        WHERE
+        l.log_type != 3
+        AND send_type = 1
+        <if test="userId != null and userId != 0 ">
+            AND l.company_user_id = #{userId}
+        </if>
+        <if test="userId != null and userId == 0 ">
+            and l.company_id = #{companyId}
+        </if>
+        <if test="periodId != null and periodId != ''">
+            AND l.period_id =  #{periodId}
+        </if>
+        <if test="videoId != null and videoId != ''">
+            AND l.video_id = #{videoId}
+        </if>
+        -- 单独通过销售id查询
+        <if test="companyUserId != null and companyUserId != ''">
+            AND l.company_user_id = #{companyUserId}
+        </if>
+    </select>
+
 </mapper>

+ 3 - 0
fs-user-app/src/main/java/com/fs/app/controller/UserController.java

@@ -300,6 +300,9 @@ public class UserController extends  AppBaseController {
         if (param.getNickname().length()>50){
             return R.error("请授权正确的昵称!");
         }
+        if (StringUtils.isEmpty(param.getAvatar())){
+            param.setAvatar("https://zkzh-2025.oss-cn-beijing.aliyuncs.com/fs/20250715/533c6f87cc2e4ba4a9504374bb58416d.png");
+        }
         FsUser user=new FsUser();
         user.setUserId(Long.parseLong(getUserId()));
         user.setAvatar(param.getAvatar());