Ver código fonte

fix 学习记录

he2802 3 anos atrás
pai
commit
c8377c196b

+ 9 - 4
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserStudyRecordServiceImpl.java

@@ -36,10 +36,7 @@ import com.zhongzheng.modules.inform.service.IInformUserService;
 import com.zhongzheng.modules.inform.vo.InformRemindBusinessVo;
 import com.zhongzheng.modules.inform.vo.InformRemindVo;
 import com.zhongzheng.modules.user.bo.*;
-import com.zhongzheng.modules.user.domain.UserBankRecord;
-import com.zhongzheng.modules.user.domain.UserExamRecord;
-import com.zhongzheng.modules.user.domain.UserPlan;
-import com.zhongzheng.modules.user.domain.UserStudyRecord;
+import com.zhongzheng.modules.user.domain.*;
 import com.zhongzheng.modules.user.mapper.UserStudyRecordMapper;
 import com.zhongzheng.modules.user.service.*;
 import com.zhongzheng.modules.user.vo.*;
@@ -92,6 +89,9 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
 
     @Autowired
     private IClassGradeUserService iClassGradeUserService;
+    @Autowired
+    private IUserSubscribeService iUserSubscribeService;
+
 
     @Autowired
     private com.zhongzheng.modules.alisms.service.IAliSmsService IAliSmsService;
@@ -177,6 +177,11 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
         lqw3.eq(UserPeriod::getGoodsId, goodsId);
         lqw3.eq( UserPeriod::getUserId, userId);
         iUserPeriodService.remove(lqw3);
+        //清除报考数据
+        LambdaQueryWrapper<UserSubscribe> lqw4 = Wrappers.lambdaQuery();
+        lqw4.eq(UserSubscribe::getGoodsId, goodsId);
+        lqw4.eq( UserSubscribe::getUserId, userId);
+        iUserSubscribeService.remove(lqw4);
         return null;
     }
 

+ 4 - 4
zhongzheng-system/src/main/resources/mapper/modules/bank/QuestionMapper.xml

@@ -236,7 +236,7 @@
 
     <select id="listGoodsUserQuestionVo" parameterType="com.zhongzheng.modules.bank.bo.QuestionQueryBo" resultMap="GoodsUserQuestionVo">
         SELECT
-            g.*,
+            DISTINCT g.*,
             ps.supply_name,
             cet.education_name,
             cpt.project_name,
@@ -246,7 +246,8 @@
             ot.type AS template_type,
             ( SELECT gs.goods_name FROM goods gs WHERE 1 = 1 AND g.make_goods_id = gs.goods_id ) AS make_goods_name,
             ( SELECT gs.CODE FROM goods gs WHERE 1 = 1 AND g.make_goods_id = gs.goods_id ) AS make_goods_code,
-            o.user_id
+            o.user_id,
+            og.create_time
         FROM
             goods g
                 LEFT JOIN pay_supply ps ON g.supply_id = ps.supply_id
@@ -267,7 +268,6 @@
           AND og.`status` =1
           and og.pay_status in (2,3)
           AND og.refund_status in (0,3,1)
-        GROUP BY g.goods_id
-        ORDER BY g.update_time DESC
+        ORDER BY og.create_time DESC
     </select>
 </mapper>

+ 1 - 1
zhongzheng-system/src/main/resources/mapper/modules/user/UserStudyRecordMapper.xml

@@ -398,7 +398,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         WHERE
         g.goods_type =2
         <if test="userId != null and userId !=''">
-          AND o.user_id = #{userId}
+            AND o.user_id = #{userId}
         </if>
         ORDER BY s.create_time DESC
     </select>