4 次代碼提交 5e489f7871 ... f473e4a9b4

作者 SHA1 備註 提交日期
  yangdamao f473e4a9b4 Merge branch 'dev' 10 月之前
  yangdamao f64a3485d6 submit 10 月之前
  yangdamao 772aaf0059 submit 10 月之前
  yangdamao 68bcd49087 submit 10 月之前
共有 18 個文件被更改,包括 140 次插入3 次删除
  1. 9 0
      zhongzheng-api/src/main/java/com/zhongzheng/controller/user/UserStudyRecordController.java
  2. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/domain/UserPeriod.java
  3. 6 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/ClassGradeUserServiceImpl.java
  4. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/ClassPeriodChapterVo.java
  5. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/ClassPeriodSectionVo.java
  6. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/ClassPeriodVo.java
  7. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/UserPeriodStatusVo.java
  8. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/bo/UserStudyConditionBo.java
  9. 4 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/mapper/OrderMapper.java
  10. 12 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/impl/OrderServiceImpl.java
  11. 6 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/vo/UserStudyConditionVo.java
  12. 17 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/bo/StudyAbnormalSignBo.java
  13. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/IUserStudyRecordService.java
  14. 18 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserStudyRecordServiceImpl.java
  15. 2 2
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserSubscribeServiceImpl.java
  16. 2 0
      zhongzheng-system/src/main/resources/mapper/modules/grade/UserPeriodStatusMapper.xml
  17. 1 0
      zhongzheng-system/src/main/resources/mapper/modules/order/OrderGoodsRefundMapper.xml
  18. 46 0
      zhongzheng-system/src/main/resources/mapper/modules/order/OrderMapper.xml

+ 9 - 0
zhongzheng-api/src/main/java/com/zhongzheng/controller/user/UserStudyRecordController.java

@@ -103,6 +103,15 @@ public class UserStudyRecordController extends BaseController {
         return AjaxResult.success(iUserStudyRecordService.insertByAddBo(bo));
     }
 
+    /**
+     * 标记某一个视频学习异常
+     */
+    @ApiOperation("标记某一个视频学习异常")
+    @PostMapping("/abnormal")
+    public AjaxResult<Void> studyAbnormalSign(@RequestBody StudyAbnormalSignBo bo) {
+        return toAjax(iUserStudyRecordService.studyAbnormalSign(bo) ? 1 : 0);
+    }
+
     /**
      * 重置用户学习某一节课程
      */

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/domain/UserPeriod.java

@@ -52,4 +52,6 @@ private static final long serialVersionUID=1L;
     private Long gradeId;
     /** 订单商品ID */
     private Long orderGoodsId;
+    /** 是否异常:1是 0否 */
+    private Integer abnormalSign;
 }

+ 6 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/ClassGradeUserServiceImpl.java

@@ -3471,6 +3471,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                                     classPeriodSectionVo.setNumList(Convert.toLong(userPeriodStatusVos.size()));
                                     classPeriodSectionVo.setStudyEndTime(userPeriodStatusVo.getRecordEndTime());
                                     classPeriodSectionVo.setStudyStartTime(userPeriodStatusVo.getRecordStartTime());
+                                    classPeriodSectionVo.setAbnormalSign(userPeriodStatusVo.getAbnormalSign());
                                     if (Validator.isNotEmpty(photoList) && photoList.size() > 0) {
                                         if((fullName.contains("继续教育")&&fullName.contains("施工现场专业人员"))||fullName.equals("继续教育一级建造师")){
                                             classPeriodSectionVo.setStudyStartTime(userPeriodStatusVo.getRecordStartTime());
@@ -3533,6 +3534,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                                     classPeriodSectionVo.setNumList(Convert.toLong(userPeriodStatusVos.size()));
                                     classPeriodSectionVo.setStudyEndTime(userPeriodStatusVo.getRecordEndTime());
                                     classPeriodSectionVo.setStudyStartTime(userPeriodStatusVo.getRecordStartTime());
+                                    classPeriodSectionVo.setAbnormalSign(userPeriodStatusVo.getAbnormalSign());
                                     if ((startTotalTime == 0L && Validator.isNotEmpty(classPeriodSectionVo.getStudyStartTime())) || (Validator.isNotEmpty(classPeriodSectionVo.getStudyStartTime()) && startTotalTime.longValue() > classPeriodSectionVo.getStudyStartTime().longValue())) {
                                         startTotalTime = classPeriodSectionVo.getStudyStartTime();
                                     }
@@ -3589,6 +3591,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                             classPeriodChapterVo.setAuditTime(userPeriodStatusVo.getAuditTime());
                             classPeriodChapterVo.setAuditUserName(userPeriodStatusVo.getAuditUserName());
                             classPeriodChapterVo.setPeriodStatusId(userPeriodStatusVo.getId());
+                            classPeriodChapterVo.setAbnormalSign(userPeriodStatusVo.getAbnormalSign());
                             classPeriodChapterVo.setPerformance(Convert.toBigDecimal(userPeriodStatusVo.getPerformance()));
                             if ((startTotalTime == 0L&&Validator.isNotEmpty(classPeriodChapterVo.getStudyStartTime())) || (Validator.isNotEmpty(classPeriodChapterVo.getStudyStartTime())&&startTotalTime.longValue() > classPeriodChapterVo.getStudyStartTime().longValue())) {
                                 startTotalTime = classPeriodChapterVo.getStudyStartTime();
@@ -3650,6 +3653,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                         classPeriodSectionVo.setNumList(Convert.toLong(userPeriodStatusVos.size()));
                         classPeriodSectionVo.setStudyEndTime(userPeriodStatusVo.getRecordEndTime());
                         classPeriodSectionVo.setStudyStartTime(userPeriodStatusVo.getRecordStartTime());
+                        classPeriodSectionVo.setAbnormalSign(userPeriodStatusVo.getAbnormalSign());
                         if (Validator.isNotEmpty(photoList) && photoList.size() > 0) {
                             if((fullName.contains("继续教育")&&fullName.contains("施工现场专业人员"))||fullName.equals("继续教育一级建造师")){
                                 classPeriodSectionVo.setStudyStartTime(userPeriodStatusVo.getRecordStartTime());
@@ -3713,6 +3717,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                         classPeriodSectionVo.setNumList(Convert.toLong(userPeriodStatusVos.size()));
                         classPeriodSectionVo.setStudyEndTime(userPeriodStatusVo.getRecordEndTime());
                         classPeriodSectionVo.setStudyStartTime(userPeriodStatusVo.getRecordStartTime());
+                        classPeriodSectionVo.setAbnormalSign(userPeriodStatusVo.getAbnormalSign());
                         if ((startTotalTime == 0L && Validator.isNotEmpty(classPeriodSectionVo.getStudyStartTime())) || (Validator.isNotEmpty(classPeriodSectionVo.getStudyStartTime()) && startTotalTime.longValue() > classPeriodSectionVo.getStudyStartTime().longValue())) {
                             startTotalTime = classPeriodSectionVo.getStudyStartTime();
                         }
@@ -3788,6 +3793,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                     classPeriodVo.setNumList(Convert.toLong(userPeriodStatusVos.size()));
                     classPeriodVo.setStudyEndTime(userPeriodStatusVo.getRecordEndTime());
                     classPeriodVo.setStudyStartTime(userPeriodStatusVo.getRecordStartTime());
+                    classPeriodVo.setAbnormalSign(userPeriodStatusVo.getAbnormalSign());
                     if (photoList.size() > 0) {
                         if((fullName.contains("继续教育")&&fullName.contains("施工现场专业人员"))||fullName.equals("继续教育一级建造师")){
                             classPeriodVo.setStudyStartTime(userPeriodStatusVo.getRecordStartTime());

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/ClassPeriodChapterVo.java

@@ -142,6 +142,8 @@ public class ClassPeriodChapterVo implements Comparable<ClassPeriodChapterVo> {
 	@ApiModelProperty("公共标识:1公共章 0非公共章")
 	private Integer commonSign;
 
+	@ApiModelProperty("是否异常:1是 0否")
+	private Integer abnormalSign;
 
 	@Override
 	public int compareTo(ClassPeriodChapterVo o) {

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/ClassPeriodSectionVo.java

@@ -194,6 +194,9 @@ public class ClassPeriodSectionVo implements Comparable<ClassPeriodSectionVo> {
 	@ApiModelProperty("视频当前播放时刻")
 	private Long videoCurrentTime;
 
+	@ApiModelProperty("是否异常:1是 0否")
+	private Integer abnormalSign;
+
 	@ApiModelProperty("试卷ID")
 	private Long examId;
 	@Override

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/ClassPeriodVo.java

@@ -227,6 +227,9 @@ public class ClassPeriodVo implements Comparable<ClassPeriodVo> {
 	@ApiModelProperty("视频地址")
 	private String videoTime;
 
+	@ApiModelProperty("是否异常:1是 0否")
+	private Integer abnormalSign;
+
 	@ApiModelProperty("视频当前播放时刻")
 	private Long videoCurrentTime;
 	@Override

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/UserPeriodStatusVo.java

@@ -101,4 +101,7 @@ public class UserPeriodStatusVo {
 	@ApiModelProperty("访问IP")
 	private String ip;
 
+	@ApiModelProperty("是否异常:1是 0否")
+	private Integer abnormalSign;
+
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/bo/UserStudyConditionBo.java

@@ -24,6 +24,8 @@ public class UserStudyConditionBo implements Serializable {
 
     private String userName;
 
+    private String sevenYear;
+
     private String companyName;
 
     private String businessName;

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/mapper/OrderMapper.java

@@ -88,4 +88,8 @@ public interface OrderMapper extends BaseMapper<Order> {
 
     @InterceptorIgnore(tenantLine = "true")
     List<UserStudyConditionVo> getUserStudyCondition(UserStudyConditionBo bo);
+
+    @InterceptorIgnore(tenantLine = "true")
+    String getOrderSnByXY(UserStudyConditionVo item);
+
 }

+ 12 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/impl/OrderServiceImpl.java

@@ -3755,7 +3755,18 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
 
     @Override
     public List<UserStudyConditionVo> getUserStudyCondition(UserStudyConditionBo bo) {
-        return baseMapper.getUserStudyCondition(bo);
+        List<UserStudyConditionVo> userStudyCondition = baseMapper.getUserStudyCondition(bo);
+        if (CollectionUtils.isNotEmpty(userStudyCondition)){
+            userStudyCondition.forEach(item -> {
+                if (StringUtils.isNotBlank(item.getUserPassword())){
+                    item.setUserPassword(EncryptHandler.decryptTwo(item.getUserPassword()));
+                }
+                //查询学校订单号
+                String orderSn = baseMapper.getOrderSnByXY(item);
+                item.setOrderSnXY(orderSn);
+            });
+        }
+        return userStudyCondition;
     }
 
     /**

+ 6 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/vo/UserStudyConditionVo.java

@@ -24,6 +24,9 @@ public class UserStudyConditionVo implements Serializable {
     @ApiModelProperty("手机号码")
     private String userPhone;
 
+    @ApiModelProperty("用户登入密码")
+    private String userPassword;
+
     @ApiModelProperty("公司名称")
     private String companyName;
 
@@ -50,4 +53,7 @@ public class UserStudyConditionVo implements Serializable {
 
     @ApiModelProperty("学习进度")
     private String studySchedule;
+
+    @ApiModelProperty("学校订单号")
+    private String orderSnXY;
 }

+ 17 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/bo/StudyAbnormalSignBo.java

@@ -0,0 +1,17 @@
+package com.zhongzheng.modules.user.bo;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+public class StudyAbnormalSignBo implements Serializable {
+
+    private Long orderGoodsId;
+    private Long chapterId;
+    private Long courseId;
+    private Long goodsId;
+    private Long gradeId;
+    private Long moduleId;
+    private Long sectionId;
+}

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

@@ -167,4 +167,6 @@ public interface IUserStudyRecordService extends IService<UserStudyRecord> {
 	boolean saveUserVideo(SaveUserVideoBo bo);
 
 	boolean resetCourseSection(UserStudyRecordAddBo bo);
+
+	boolean studyAbnormalSign(StudyAbnormalSignBo bo);
 }

+ 18 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserStudyRecordServiceImpl.java

@@ -1804,6 +1804,24 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
         return true;
     }
 
+    @Override
+    public boolean studyAbnormalSign(StudyAbnormalSignBo bo) {
+        UserPeriod period = iUserPeriodService.getOne(new LambdaQueryWrapper<UserPeriod>()
+                .eq(UserPeriod::getOrderGoodsId, bo.getOrderGoodsId())
+                .eq(UserPeriod::getGradeId, bo.getGradeId())
+                .eq(UserPeriod::getGoodsId, bo.getGoodsId())
+                .eq(ObjectUtils.isNotNull(bo.getModuleId()), UserPeriod::getModuleId, bo.getModuleId())
+                .eq(ObjectUtils.isNotNull(bo.getChapterId()), UserPeriod::getChapterId, bo.getChapterId())
+                .eq(ObjectUtils.isNotNull(bo.getSectionId()), UserPeriod::getSectionId, bo.getSectionId())
+                .eq(ObjectUtils.isNotNull(bo.getCourseId()), UserPeriod::getCourseId, bo.getCourseId())
+                .last("limit 1"));
+        if (ObjectUtils.isNull(period)){
+            throw new CustomException("标记视频观看异常失败");
+        }
+        period.setAbnormalSign(1);
+        return iUserPeriodService.updateById(period);
+    }
+
 
     /**
      * 获取最后一次看完的节

+ 2 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserSubscribeServiceImpl.java

@@ -3096,7 +3096,7 @@ public class UserSubscribeServiceImpl extends ServiceImpl<UserSubscribeMapper, U
         order.setOrderSn(out_trade_no);
         //学员预约信息
         order.setUserId(user.getUserId());
-        order.setOrderPrice(orderGoods.getGoodsRealPrice());
+        order.setOrderPrice(goods.getStandPrice());
         order.setOrderStatus(0);
         order.setCreateTime(DateUtils.getNowTime());
         order.setUpdateTime(DateUtils.getNowTime());
@@ -3110,7 +3110,7 @@ public class UserSubscribeServiceImpl extends ServiceImpl<UserSubscribeMapper, U
         order.setOrderRefundStatus(1);
         order.setInvoiceStatus(0);
         order.setFinishStatus(0);
-        order.setOperationType(1);
+        order.setOperationType(2);
         iOrderService.save(order);
         //订单商品
         OrderGoods add = new OrderGoods();

+ 2 - 0
zhongzheng-system/src/main/resources/mapper/modules/grade/UserPeriodStatusMapper.xml

@@ -35,11 +35,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="auditUserName" column="audit_user_name"/>
         <result property="durationTime" column="duration_time"/>
         <result property="ip" column="ip"/>
+        <result property="abnormalSign" column="abnormal_sign"/>
     </resultMap>
 
     <select id="selectPeriodStatus" parameterType="com.zhongzheng.modules.grade.bo.UserPeriodQueryBo" resultMap="UserPeriodStatusVo">
         SELECT
         ups.*,
+        up.abnormal_sign,
         (select realname from `user` u where up.user_id = u.user_id) as  realname
         <if test="examId != null ">
             ,(SELECT exam_name FROM exam e where e.exam_id= up.exam_id) as type_name

+ 1 - 0
zhongzheng-system/src/main/resources/mapper/modules/order/OrderGoodsRefundMapper.xml

@@ -139,6 +139,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         LEFT JOIN order_goods og ON gr.order_goods_id = og.order_goods_id
         WHERE
         1 = 1
+        AND  (SELECT COUNT(o.order_sn) FROM `order` o WHERE o.order_sn = og.order_sn AND o.order_type = 3 AND o.order_from = 7) = 0
         AND (SELECT COUNT(o.order_sn) FROM `order` o WHERE o.order_sn = og.order_sn AND o.handle_order_sn IS NULL) > 0
         <if test="userId != null and userId != ''">
             AND gr.user_id = #{userId}

+ 46 - 0
zhongzheng-system/src/main/resources/mapper/modules/order/OrderMapper.xml

@@ -1165,6 +1165,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         u.realname AS userName,
         AES_DECRYPT(UNHEX(u.id_card),'base20230213zzkj') AS userCard,
         AES_DECRYPT(UNHEX(u.telphone),'base20230213zzkj') AS userPhone,
+        u.password_aes AS userPassword,
         u.company_name AS companyName,
         g.goods_name AS goodsName,
         g.seven_year AS sevenYear,
@@ -1219,6 +1220,50 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="userName != null and userName != ''">
             AND u.realname = #{userName}
         </if>
+        <if test="sevenYear != null and sevenYear != ''">
+            AND og.seven_year = #{sevenYear}
+        </if>
+        <if test="companyName != null and companyName != ''">
+            AND u.company_name = #{companyName}
+        </if>
+        <if test="businessName != null and businessName != ''">
+            AND INSTR(CONCAT(cet.education_name,cb.business_name,cpt.project_name),#{businessName})
+        </if>
+        <if test="majorName != null and majorName != ''">
+            AND m.category_name = #{majorName}
+        </if>
+    </select>
+    <select id="getOrderSnByXY" parameterType="com.zhongzheng.modules.order.vo.UserStudyConditionVo" resultType="java.lang.String">
+        SELECT
+        o.order_sn
+        FROM
+        `order` o
+        LEFT JOIN order_goods og ON o.order_sn = og.order_sn
+        LEFT JOIN goods g ON og.goods_id = g.goods_id
+        LEFT JOIN course_education_type cet ON g.education_type_id = cet.id
+        LEFT JOIN course_project_type cpt ON g.project_id = cpt.id
+        LEFT JOIN course_business cb ON g.business_id = cb.id
+        LEFT JOIN major m ON g.major_id = m.id
+        LEFT JOIN `user` u ON o.user_id = u.user_id
+        LEFT JOIN class_grade_user cgu ON og.order_goods_id = cgu.order_goods_id
+        LEFT JOIN class_grade cg ON cgu.grade_id = cg.grade_id
+        WHERE
+        1=1
+        AND og.pay_status != 1
+        AND og.refund_status != 2
+        AND o.`status` = 1
+        AND og.`status` = 1
+        AND cgu.`status` = 1
+        AND o.tenant_id = 867735392558919680
+        <if test="userCard != null and userCard != ''">
+            AND AES_DECRYPT(UNHEX(u.id_card),'base20230213zzkj') = #{userCard}
+        </if>
+        <if test="userName != null and userName != ''">
+            AND u.realname = #{userName}
+        </if>
+        <if test="sevenYear != null and sevenYear != ''">
+            AND og.seven_year = #{sevenYear}
+        </if>
         <if test="companyName != null and companyName != ''">
             AND u.company_name = #{companyName}
         </if>
@@ -1228,6 +1273,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="majorName != null and majorName != ''">
             AND m.category_name = #{majorName}
         </if>
+        LIMIT 1
     </select>
 
 </mapper>