Browse Source

资料审核

change 3 years ago
parent
commit
e73d43bb51

+ 1 - 20
zhongzheng-api/src/main/java/com/zhongzheng/controller/user/UserController.java

@@ -60,30 +60,11 @@ public class UserController extends BaseController {
     @GetMapping("/infoAttached")
     public AjaxResult infoAttached() {
         ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
-        int collectTotal = iUserService.getCollectTotal(loginUser.getUser().getUserId());
-        Integer rank = iUserService.getRank(loginUser.getUser().getUserId());
-        Integer issue = iUserService.getIssue(loginUser.getUser().getUserId());
-        Integer lookNum = iUserService.getLookNum(loginUser.getUser().getUserId());
         Map<String,Object> map = new HashMap<>();
-        map.put("collectTotal",collectTotal);
-        map.put("rank",rank);
-        map.put("issue",issue);
-        map.put("lookNum",lookNum);
+        Long planSum = iUserService.planSum(loginUser.getUser().getUserId());
         return AjaxResult.success(map);
     }
 
-    /**
-     * 排行榜
-     */
-    @ApiOperation("排行榜")
-    @GetMapping("/rankingList")
-    public AjaxResult<RanKingUser> rankingList(RanKingUserQuery bo) {
-        ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
-        bo.setUserId(loginUser.getUser().getUserId());
-        RanKingUser list = iUserService.rankingList(bo);
-        return AjaxResult.success(list);
-    }
-
     @ApiOperation("绑定身份证信息")
     @PostMapping("/bind_idcard")
     public AjaxResult<Void> bind_id(@RequestBody UserAppBindIdBo bo) {

+ 14 - 0
zhongzheng-framework/src/main/java/com/zhongzheng/framework/web/service/UserServiceImpl.java

@@ -34,8 +34,10 @@ import com.zhongzheng.modules.user.domain.UserBankRecord;
 import com.zhongzheng.modules.user.domain.UserSchoolInfo;
 import com.zhongzheng.modules.user.entity.ClientLoginUser;
 import com.zhongzheng.modules.user.mapper.UserMapper;
+import com.zhongzheng.modules.user.service.IUserPlanService;
 import com.zhongzheng.modules.user.service.IUserService;
 import com.zhongzheng.modules.user.vo.RanKingUser;
+import com.zhongzheng.modules.user.vo.UserPlanVo;
 import com.zhongzheng.modules.user.vo.UserStudyRecordVo;
 import com.zhongzheng.modules.user.vo.UserVo;
 import io.swagger.models.auth.In;
@@ -87,6 +89,9 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
     @Autowired
     private IClassGradeUserService iClassGradeUserService;
 
+    @Autowired
+    private IUserPlanService userPlanService;
+
     @Autowired
     private RedisCache redisCache;
 
@@ -609,6 +614,15 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
         return userService.updateById(user);
     }
 
+    @Override
+    public Long planSum(Long userId) {
+        UserPlanQueryBo userPlanQueryBo = new UserPlanQueryBo();
+        userPlanQueryBo.setUserId(userId);
+        userPlanQueryBo.setStatus(new ArrayList<Integer>(Arrays.asList(1)));
+        List<UserPlanVo> userPlanVos = userPlanService.queryList(userPlanQueryBo);
+        return null;
+    }
+
 
     /**
      * 获取当前月第一天

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/mapper/CourseMapper.java

@@ -13,6 +13,7 @@ import com.zhongzheng.modules.goods.vo.GoodsPeriodVo;
 import com.zhongzheng.modules.goods.vo.GoodsUserVo;
 import com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo;
 import com.zhongzheng.modules.user.bo.UserPlanQueryBo;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 import java.util.Map;
@@ -41,4 +42,6 @@ public interface CourseMapper extends BaseMapper<Course> {
     CourseUserVo getCourseUserVoInfo(Long id);
 
     Long rebuildNext(ClassGradeUserQueryBo bo);
+
+    Long gradeIdSelect(@Param("userId") Long userId,@Param("goodsId") Long goodsId);
 }

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseServiceImpl.java

@@ -259,6 +259,9 @@ public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> impleme
     public List<GoodsUserVo> goodsList(CourseQueryBo bo) {
         List<GoodsUserVo> goodsUserVos = baseMapper.goodsList(bo);
         for (GoodsUserVo goodsUserVo : goodsUserVos) {
+            //获得当前所在班级
+            Long gradeId = baseMapper.gradeIdSelect(goodsUserVo.getUserId(),goodsUserVo.getGoodsId());
+            goodsUserVo.setGradeId(gradeId);
             Long secLong = 0L;
             Long studyLong = 0L;
             SubjectStudyRecordQueryBo subjectStudyRecordQueryBo = new SubjectStudyRecordQueryBo();

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/IUserService.java

@@ -86,4 +86,6 @@ public interface IUserService extends IService<User> {
 	Map<String,Object> accountLogin(UserAppAccountLoginBo bo);
 
 	Boolean bindIdCard(UserAppBindIdBo bo);
+
+	Long planSum(Long userId);
 }

+ 28 - 15
zhongzheng-system/src/main/resources/mapper/modules/course/CourseMapper.xml

@@ -398,29 +398,28 @@
 
     <select id="goodsList" parameterType="com.zhongzheng.modules.course.bo.CourseQueryBo"  resultMap="GoodsUserVo">
         SELECT
-            g.*,
-            cgu.grade_id,
-               cgu.user_id,
+        g.*,
+        o.user_id,
         (SELECT cet.education_name FROM  course_education_type cet  where cet.id = g.education_type_id) as education_name,
         (SELECT cet.project_name FROM  course_project_type cet where cet.id = g.project_id) as project_name,
         (SELECT cet.business_name FROM  course_business cet  where cet.id = g.business_id) as business_name,
         (SELECT COUNT(1) FROM goods_course gc where gc.goods_id = g.goods_id) as course_num,
-        (case WHEN (SELECT COUNT(1) FROM exam_apply_goods eag LEFT JOIN exam_apply ea on eag.apply_id = ea.apply_id where eag.goods_id = cgg.goods_id and ea.`status` = 1 and unix_timestamp(now()) BETWEEN ea.apply_start_time and ea.apply_end_time) >0 then 1 ELSE 0 end) as apply_status,
-        (case WHEN (SELECT COUNT(1) FROM exam_before_goods ebg LEFT JOIN exam_before eb on ebg.before_id = eb.before_id where ebg.goods_id = cgg.goods_id and eb.`status` = 1 and unix_timestamp(now()) BETWEEN eb.before_start_time and eb.before_end_time) >0 then 1 ELSE 0 end) as before_status,
-        (SELECT ea.apply_name FROM exam_apply_goods eag LEFT JOIN exam_apply ea on eag.apply_id = ea.apply_id where eag.goods_id = cgg.goods_id and ea.`status` = 1 and unix_timestamp(now()) BETWEEN ea.apply_start_time and ea.apply_end_time) as apply_name,
-        (SELECT eb.before_name FROM exam_before_goods ebg LEFT JOIN exam_before eb on ebg.before_id = eb.before_id where ebg.goods_id = cgg.goods_id and eb.`status` = 1 and unix_timestamp(now()) BETWEEN eb.before_start_time and eb.before_end_time) as before_name
+        (case WHEN (SELECT COUNT(1) FROM exam_apply_goods eag LEFT JOIN exam_apply ea on eag.apply_id = ea.apply_id where eag.goods_id = g.goods_id and ea.`status` = 1 and unix_timestamp(now()) BETWEEN ea.apply_start_time and ea.apply_end_time) >0 then 1 ELSE 0 end) as apply_status,
+        (case WHEN (SELECT COUNT(1) FROM exam_before_goods ebg LEFT JOIN exam_before eb on ebg.before_id = eb.before_id where ebg.goods_id = g.goods_id and eb.`status` = 1 and unix_timestamp(now()) BETWEEN eb.before_start_time and eb.before_end_time) >0 then 1 ELSE 0 end) as before_status,
+        (SELECT ea.apply_name FROM exam_apply_goods eag LEFT JOIN exam_apply ea on eag.apply_id = ea.apply_id where eag.goods_id = g.goods_id and ea.`status` = 1 and unix_timestamp(now()) BETWEEN ea.apply_start_time and ea.apply_end_time) as apply_name,
+        (SELECT eb.before_name FROM exam_before_goods ebg LEFT JOIN exam_before eb on ebg.before_id = eb.before_id where ebg.goods_id = g.goods_id and eb.`status` = 1 and unix_timestamp(now()) BETWEEN eb.before_start_time and eb.before_end_time) as before_name
         FROM
-            class_grade_user cgu
-                LEFT JOIN class_grade_goods cgg ON cgu.grade_id = cgg.grade_id
-                LEFT JOIN goods g on cgg.goods_id = g.goods_id
-                LEFT JOIN class_grade cg on cg.grade_id = cgu.grade_id
+        `order` o
+        LEFT JOIN order_goods og ON og.order_sn = o.order_sn
+        LEFT JOIN goods g on og.goods_id = g.goods_id
         where 1=1
+        AND og.`status` = 1
+        AND og.refund_status in (0,1,3)
+        AND og.pay_status in (2,3)
+        AND g.goods_type =1
         <if test="userId != null and userId != ''">
-            and cgu.user_id = #{userId}
+            and o.user_id = #{userId}
         </if>
-          and unix_timestamp(now()) BETWEEN cg.class_start_time and cg.class_end_time
-          and cg.status =1
-          and cgu.status =1
     </select>
     <select id="courseList" parameterType="com.zhongzheng.modules.course.bo.CourseQueryBo"  resultMap="CourseUserVo">
         SELECT
@@ -446,4 +445,18 @@
           AND ups.`status` = 0
           AND ups.period_status = 1
     </select>
+    <select id="gradeIdSelect" parameterType="map"  resultType="Long">
+        SELECT
+            cgu.grade_id
+        FROM
+            class_grade_user cgu
+                LEFT JOIN class_grade cg on cgu.grade_id = cg.grade_id
+                LEFT JOIN class_grade_goods cgg on cg.grade_id = cgg.grade_id
+        WHERE
+            cgu.user_id=#{userId}
+
+          and cg.`status` =1
+          and cgg.goods_id = #{goodsId}
+        order by cg.create_time desc LIMIT 1
+    </select>
 </mapper>