Browse Source

台州免费领取VIP

花田厝 3 months ago
parent
commit
d7637664f3

+ 27 - 30
jsjp-admin/src/main/java/com/miaxis/app/controller/gzpt/GzptUserInfoController.java

@@ -82,13 +82,13 @@ public class GzptUserInfoController extends BaseController {
         int isActiva = 0;
         GzptUserInfo gzptUserInfo = userInfoService.getInfoById(gzptVideoVipDTO.getUserId());
 
-        if(gzptUserInfo == null){
+        if (gzptUserInfo == null) {
             throw new CustomException("查不到用户数据");
         }
         //获取合作驾校配置表
         isShare = schPayConfigService.isSchPayConfigByUser(gzptUserInfo);
         //如果是合作驾校,查询激活状态
-        if(isShare==1) {
+        if (isShare == 1) {
             isActiva = schActivationService.isSchActivation(gzptUserInfo.getId());
         }
         GzptSchActivationVO vo = new GzptSchActivationVO();
@@ -102,15 +102,16 @@ public class GzptUserInfoController extends BaseController {
 
     /**
      * 根据学员stuOutId获取学员考试成绩信息
+     *
      * @return
      */
     @GetMapping("/getUserScoreByOutId")
     @ApiOperation("根据学员stuOutId获取学员考试成绩信息")
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "pageNum",value = "当前页码" ,dataType = "int", paramType = "query", required = false),
-            @ApiImplicitParam(name = "pageSize",value = "每页数据量" , dataType = "int", paramType = "query", required = false),
+            @ApiImplicitParam(name = "pageNum", value = "当前页码", dataType = "int", paramType = "query", required = false),
+            @ApiImplicitParam(name = "pageSize", value = "每页数据量", dataType = "int", paramType = "query", required = false),
     })
-    public ResponsePageInfo<GzptExamInfoVO> getUserScoreByOutId(Long stuOutId)   {
+    public ResponsePageInfo<GzptExamInfoVO> getUserScoreByOutId(Long stuOutId) {
         startPage();
         List<GzptExamInfoVO> scoreList = userInfoService.getUserScoreByOutId(stuOutId);
         return toResponsePageInfo(scoreList);
@@ -118,8 +119,6 @@ public class GzptUserInfoController extends BaseController {
     }
 
 
-
-
     /**
      * (测试专用)清除学员激活状态与会员信息接口
      */
@@ -149,17 +148,18 @@ public class GzptUserInfoController extends BaseController {
         Date now = new Date();
 
         //修改会员信息
-        Date km1Date = userVip.getSubject1();
-        Date km4Date = userVip.getSubject4();
-        if (km1Date != null || km4Date != null) {  //存在会员时间
-            Response response = new Response(40001,"新用户才可以领取会员!");
+        if (userVip != null) {  //存在会员时间
+            Response response = new Response(40001, "新用户才可以领取会员!");
             return response;
         } else {
             long x = now.getTime() + threeMonthLong;
             Date threeMonth = new Date(x);
-            userVip.setSubject1(threeMonth);
-            userVip.setSubject4(threeMonth);
-            userVipService.updateById(userVip);
+            UserVip userVipDb = new UserVip();
+            userVipDb.setUserId(gzptVideoVipDTO.getUserId());
+            userVipDb.setUserName(gzptUserInfo.getUserName());
+            userVipDb.setSubject1(threeMonth);
+            userVipDb.setSubject4(threeMonth);
+            userVipService.save(userVipDb);
             //插入获取日志
             FreeUserLog freeUserLog = new FreeUserLog();
             freeUserLog.setJxbh(gzptUserInfo.getSchool());
@@ -191,25 +191,22 @@ public class GzptUserInfoController extends BaseController {
     }
 
 
-
-
     /**
      * 获取用户vip信息
 
-    @GetMapping
-    @ApiOperation("获取用户vip信息")
-    public Response<GzptVideoVipVO> getVideoVip(GzptVideoVipDTO gzptVideoVipDTO) throws Exception {
-        GzptVideoVip gzptVideoVip  = gzptVideoVipService.getGzptVideoVipByUserId(gzptVideoVipDTO);
-        GzptVideoVipVO vo = new GzptVideoVipVO();
-        if(gzptVideoVip!=null) {
-            BeanUtils.copyProperties(gzptVideoVip, vo);
-            String sign = getSign(vo.getUserId(), vo.getSubject2(), vo.getSubject3());
-            vo.setSign(sign);
-            return Response.success(vo);
-        } else {
-            return Response.success(vo);
-        }
-    }
+     @GetMapping
+     @ApiOperation("获取用户vip信息") public Response<GzptVideoVipVO> getVideoVip(GzptVideoVipDTO gzptVideoVipDTO) throws Exception {
+     GzptVideoVip gzptVideoVip  = gzptVideoVipService.getGzptVideoVipByUserId(gzptVideoVipDTO);
+     GzptVideoVipVO vo = new GzptVideoVipVO();
+     if(gzptVideoVip!=null) {
+     BeanUtils.copyProperties(gzptVideoVip, vo);
+     String sign = getSign(vo.getUserId(), vo.getSubject2(), vo.getSubject3());
+     vo.setSign(sign);
+     return Response.success(vo);
+     } else {
+     return Response.success(vo);
+     }
+     }
      */