he2802 %!s(int64=3) %!d(string=hai) anos
pai
achega
c83b77b727
Modificáronse 64 ficheiros con 1516 adicións e 98 borrados
  1. 9 18
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/course/CourseBusinessController.java
  2. 13 0
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/grade/ClassGradeController.java
  3. 22 0
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/inform/InformSysUserController.java
  4. 40 0
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/schedule/ScheduleController.java
  5. 1 0
      zhongzheng-admin/src/main/resources/application-dev.yml
  6. 1 0
      zhongzheng-admin/src/main/resources/application-pre.yml
  7. 1 0
      zhongzheng-admin/src/main/resources/application-prod.yml
  8. 4 0
      zhongzheng-admin/src/main/resources/application.yml
  9. 61 24
      zhongzheng-api/src/main/java/com/zhongzheng/controller/cmmon/CommonController.java
  10. 8 0
      zhongzheng-api/src/main/java/com/zhongzheng/controller/inform/InformUserController.java
  11. 10 1
      zhongzheng-api/src/main/java/com/zhongzheng/controller/order/OrderController.java
  12. 9 0
      zhongzheng-api/src/main/java/com/zhongzheng/controller/user/UserController.java
  13. 0 2
      zhongzheng-api/src/main/java/com/zhongzheng/controller/wx/WxLoginController.java
  14. 1 0
      zhongzheng-api/src/main/resources/application-dev.yml
  15. 1 0
      zhongzheng-api/src/main/resources/application-pre.yml
  16. 1 0
      zhongzheng-api/src/main/resources/application-prod.yml
  17. 5 1
      zhongzheng-api/src/main/resources/application.yml
  18. 10 0
      zhongzheng-common/pom.xml
  19. 61 4
      zhongzheng-common/src/main/java/com/zhongzheng/common/utils/ToolsUtils.java
  20. 27 1
      zhongzheng-common/src/main/java/com/zhongzheng/common/utils/http/HttpUtils.java
  21. 111 4
      zhongzheng-framework/src/main/java/com/zhongzheng/framework/web/service/WxLoginService.java
  22. 6 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/activity/bo/ActivityRecommendAddBo.java
  23. 8 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/activity/bo/ActivityRecommendEditBo.java
  24. 4 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/activity/domain/ActivityRecommend.java
  25. 21 11
      zhongzheng-system/src/main/java/com/zhongzheng/modules/activity/service/impl/ActivityRecommendServiceImpl.java
  26. 6 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/activity/vo/ActivityRecommendVo.java
  27. 1 5
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/mapper/CourseBusinessMapper.java
  28. 4 4
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/ICourseBusinessService.java
  29. 1 2
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseBusinessServiceImpl.java
  30. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/bo/GoodsQueryBo.java
  31. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/bo/InformSysUserEditBo.java
  32. 1 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/bo/InformUserEditBo.java
  33. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/mapper/InformUserMapper.java
  34. 5 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/service/IInformSysUserService.java
  35. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/service/IInformUserService.java
  36. 22 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/service/impl/InformSysUserServiceImpl.java
  37. 9 4
      zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/service/impl/InformUserServiceImpl.java
  38. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/bo/OrderInputQueryBo.java
  39. 5 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/mapper/OrderGoodsMapper.java
  40. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/IOrderGoodsService.java
  41. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/IOrderService.java
  42. 1 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/impl/OrderGoodsRefundServiceImpl.java
  43. 11 4
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/impl/OrderGoodsServiceImpl.java
  44. 38 2
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/impl/OrderServiceImpl.java
  45. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/vo/OrderGoodsVo.java
  46. 12 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/schedule/service/IScheduleService.java
  47. 493 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/schedule/service/impl/ScheduleServiceImpl.java
  48. 7 2
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/IUserWxFollowService.java
  49. 12 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserWxFollowServiceImpl.java
  50. 23 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/wx/bo/TemplatData.java
  51. 39 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/wx/bo/WxServerBody.java
  52. 39 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/wx/domain/AllMessage.java
  53. 14 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/wx/domain/ContentEnum.java
  54. 15 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/wx/domain/EventType.java
  55. 22 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/wx/domain/MessageTypeEnum.java
  56. 142 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/wx/domain/MessageUtil.java
  57. 48 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/wx/service/IWxLoginService.java
  58. 0 4
      zhongzheng-system/src/main/java/com/zhongzheng/modules/wx/service/impl/WxPayServiceImpl.java
  59. 4 1
      zhongzheng-system/src/main/resources/mapper/modules/activity/ActivityRecommendMapper.xml
  60. 0 1
      zhongzheng-system/src/main/resources/mapper/modules/course/CourseBusinessMapper.xml
  61. 12 0
      zhongzheng-system/src/main/resources/mapper/modules/goods/GoodsMapper.xml
  62. 17 1
      zhongzheng-system/src/main/resources/mapper/modules/inform/InformUserMapper.xml
  63. 50 0
      zhongzheng-system/src/main/resources/mapper/modules/order/OrderGoodsMapper.xml
  64. 7 0
      zhongzheng-system/src/main/resources/mapper/modules/order/OrderInputMapper.xml

+ 9 - 18
zhongzheng-admin/src/main/java/com/zhongzheng/controller/course/CourseBusinessController.java

@@ -1,32 +1,23 @@
 package com.zhongzheng.controller.course;
 
-import java.util.List;
-import java.util.Arrays;
-
-import lombok.RequiredArgsConstructor;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
 import com.zhongzheng.common.annotation.Log;
 import com.zhongzheng.common.core.controller.BaseController;
 import com.zhongzheng.common.core.domain.AjaxResult;
+import com.zhongzheng.common.core.page.TableDataInfo;
 import com.zhongzheng.common.enums.BusinessType;
-import com.zhongzheng.modules.course.vo.CourseBusinessVo;
-import com.zhongzheng.modules.course.bo.CourseBusinessQueryBo;
 import com.zhongzheng.modules.course.bo.CourseBusinessAddBo;
 import com.zhongzheng.modules.course.bo.CourseBusinessEditBo;
+import com.zhongzheng.modules.course.bo.CourseBusinessQueryBo;
 import com.zhongzheng.modules.course.service.ICourseBusinessService;
-import com.zhongzheng.common.utils.poi.ExcelUtil;
-import com.zhongzheng.common.core.page.TableDataInfo;
+import com.zhongzheng.modules.course.vo.CourseBusinessVo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import lombok.RequiredArgsConstructor;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
 
 /**
  * 业务层次Controller

+ 13 - 0
zhongzheng-admin/src/main/java/com/zhongzheng/controller/grade/ClassGradeController.java

@@ -11,6 +11,7 @@ import cn.afterturn.easypoi.excel.entity.ExportParams;
 import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
 import cn.hutool.core.lang.Validator;
 import com.github.pagehelper.PageInfo;
+import com.zhongzheng.common.core.domain.entity.SysRole;
 import com.zhongzheng.common.core.redis.RedisCache;
 import com.zhongzheng.common.utils.SecurityUtils;
 import com.zhongzheng.common.utils.ServletUtils;
@@ -143,6 +144,18 @@ public class ClassGradeController extends BaseController {
         return getDataTable(list);
     }
 
+    /**
+     * 导出班级学员列表
+     */
+    @ApiOperation("导出班级学员列表")
+//    @PreAuthorize("@ss.hasPermi('grade:grade:list')")
+    @GetMapping("/exportListGrade")
+    public AjaxResult exportListGrade(ClassGradeUserQueryBo bo) {
+        List<ClassGradeStudentVo> list = iClassGradeService.listGrade(bo);
+        ExcelUtil<ClassGradeStudentVo> util = new ExcelUtil<ClassGradeStudentVo>(ClassGradeStudentVo.class);
+        return util.exportExcel(list, "班级学员列表");
+    }
+
     /**
      * 学员进入新的班级
      */

+ 22 - 0
zhongzheng-admin/src/main/java/com/zhongzheng/controller/inform/InformSysUserController.java

@@ -61,6 +61,17 @@ public class InformSysUserController extends BaseController {
         return getDataTable(list);
     }
 
+    /**
+     * 获取通知绑定系统用户详细信息
+     */
+    @ApiOperation("获取通知绑定教务用户未读消息数量")
+    @PreAuthorize("@ss.hasPermi('system:user:query')")
+    @GetMapping("/informUnReadSum")
+    public AjaxResult<Integer> informUnReadSum() {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        return AjaxResult.success(iInformSysUserService.informUnReadSum(loginUser.getUser().getUserId()));
+    }
+
 
 
     /**
@@ -96,4 +107,15 @@ public class InformSysUserController extends BaseController {
     }
 
 
+    /**
+     * 修改通知绑定系统用户
+     */
+    @ApiOperation("批量修改通知绑定系统用户状态")
+    @PreAuthorize("@ss.hasPermi('system:user:edit')")
+    @Log(title = "批量修改通知绑定系统用户状态", businessType = BusinessType.UPDATE)
+    @PostMapping("/updateReadStatusBatch")
+    public AjaxResult<Void> updateReadStatusBatch(@RequestBody InformSysUserEditBo bo) {
+        return toAjax(iInformSysUserService.updateReadStatusBatch(bo) ? 1 : 0);
+    }
+
 }

+ 40 - 0
zhongzheng-admin/src/main/java/com/zhongzheng/controller/schedule/ScheduleController.java

@@ -245,5 +245,45 @@ public class ScheduleController extends BaseController {
         return AjaxResult.success();
     }
 
+    @ApiOperation("学生购买2天未学习提醒")
+    @GetMapping("/buyNotReadToStudentTwo")
+    public AjaxResult buyNotReadToStudentTwo(UserQueryBo bo){
+        iScheduleService.buyNotReadToStudentTwo(bo);
+        return AjaxResult.success();
+    }
+
+    @ApiOperation("学生购买5天未学习提醒")
+    @GetMapping("/buyNotReadToStudentFive")
+    public AjaxResult buyNotReadToStudentFive(UserQueryBo bo){
+        iScheduleService.buyNotReadToStudentFive(bo);
+        return AjaxResult.success();
+    }
+
+    @ApiOperation("学生购买7天未学习教务提醒")
+    @GetMapping("/buyNotReadToTeacher")
+    public AjaxResult buyNotReadToTeacher(UserQueryBo bo){
+        iScheduleService.buyNotReadToTeacher(bo);
+        return AjaxResult.success();
+    }
 
+    @ApiOperation("学生长时间3天未学习提醒")
+    @GetMapping("/longNotReadToStudentThree")
+    public AjaxResult longNotReadToStudentThree(UserQueryBo bo){
+        iScheduleService.longNotReadToStudentThree(bo);
+        return AjaxResult.success();
+    }
+
+    @ApiOperation("学生长时间5天未学习提醒")
+    @GetMapping("/longNotReadToStudentFive")
+    public AjaxResult longNotReadToStudentFive(UserQueryBo bo){
+        iScheduleService.longNotReadToStudentFive(bo);
+        return AjaxResult.success();
+    }
+
+    @ApiOperation("学生长时间7天未学习教务提醒")
+    @GetMapping("/longNotReadToTeacher")
+    public AjaxResult longNotReadToTeacher(UserQueryBo bo){
+        iScheduleService.longNotReadToTeacher(bo);
+        return AjaxResult.success();
+    }
 }

+ 1 - 0
zhongzheng-admin/src/main/resources/application-dev.yml

@@ -104,6 +104,7 @@ wx:
     gzh:
         appid: wx6f48f721d18244eb
         appsecret: 2f8b2b4ff66e2f6adfb9f08ae22d7474
+        studyNoteTpId: DndIixcAp15Sqgb4KOGTMf73VLF09NlCUifPSel5Y_s
     wepay:
         mchid: 1342013901
         key: GdXyPxYjZx1234123yJzXgDxYpXyjpx9

+ 1 - 0
zhongzheng-admin/src/main/resources/application-pre.yml

@@ -104,6 +104,7 @@ wx:
     gzh:
         appid: wx6f48f721d18244eb
         appsecret: 2f8b2b4ff66e2f6adfb9f08ae22d7474
+        studyNoteTpId: DndIixcAp15Sqgb4KOGTMf73VLF09NlCUifPSel5Y_s
     wepay:
         mchid: 1342013901
         key: GdXyPxYjZx1234123yJzXgDxYpXyjpx9

+ 1 - 0
zhongzheng-admin/src/main/resources/application-prod.yml

@@ -104,6 +104,7 @@ wx:
     gzh:
         appid: wx6f48f721d18244eb
         appsecret: 2f8b2b4ff66e2f6adfb9f08ae22d7474
+        studyNoteTpId: DndIixcAp15Sqgb4KOGTMf73VLF09NlCUifPSel5Y_s
     wepay:
         mchid: 1342013901
         key: GdXyPxYjZx1234123yJzXgDxYpXyjpx9

+ 4 - 0
zhongzheng-admin/src/main/resources/application.yml

@@ -294,3 +294,7 @@ aliyun:
     mockBookingReminder: SMS_243430276     #模考预约提醒
     mockRemind: SMS_243355276      #模考开始提醒
     liveStartRemind: SMS_243345514      #直播开课提醒
+    buyNotStudyStudentRemind : SMS_247745294  #学生购买未学习
+    buyNotStudyTeacherRemind : SMS_247935257  #学生购买未学习老师
+    longNotStudyStudentRemind: SMS_247910221  #学生长时间未学习
+    longNotStudyTeacherRemind: SMS_247765294  #学生长时间未学习老师

+ 61 - 24
zhongzheng-api/src/main/java/com/zhongzheng/controller/cmmon/CommonController.java

@@ -1,48 +1,29 @@
 package com.zhongzheng.controller.cmmon;
 
 import cn.hutool.core.lang.Validator;
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
 import com.zhongzheng.common.core.controller.BaseController;
 import com.zhongzheng.common.core.domain.AjaxResult;
 import com.zhongzheng.common.core.page.TableDataInfo;
 import com.zhongzheng.common.core.redis.RedisCache;
 import com.zhongzheng.common.utils.ServletUtils;
-import com.zhongzheng.framework.web.service.WxTokenService;
+import com.zhongzheng.common.utils.ToolsUtils;
+import com.zhongzheng.framework.web.service.WxLoginService;
 import com.zhongzheng.modules.base.bo.ConfigQueryBo;
-import com.zhongzheng.modules.course.bo.CourseMenuQueryBo;
 import com.zhongzheng.modules.course.bo.CourseQueryBo;
-import com.zhongzheng.modules.course.service.ICourseChapterSectionService;
-import com.zhongzheng.modules.course.service.ICourseMenuService;
-import com.zhongzheng.modules.course.service.ICourseModuleChapterService;
 import com.zhongzheng.modules.course.service.ICourseService;
-import com.zhongzheng.modules.course.vo.CourseUserChapterSectionVo;
-import com.zhongzheng.modules.course.vo.CourseUserMenuVo;
-import com.zhongzheng.modules.course.vo.CourseUserModuleChapterVo;
 import com.zhongzheng.modules.course.vo.CourseUserVo;
-import com.zhongzheng.modules.goods.bo.GoodsAttachedQueryBo;
-import com.zhongzheng.modules.goods.service.IGoodsAttachedService;
-import com.zhongzheng.modules.goods.vo.GoodsAttachedVo;
 import com.zhongzheng.modules.goods.vo.GoodsUserVo;
-import com.zhongzheng.modules.order.bo.OrderAddBo;
 import com.zhongzheng.modules.order.domain.Printer;
-import com.zhongzheng.modules.order.service.IOrderGoodsService;
-import com.zhongzheng.modules.order.service.IOrderService;
-import com.zhongzheng.modules.user.entity.ClientLoginUser;
+import com.zhongzheng.modules.wx.bo.WxServerBody;
+import com.zhongzheng.modules.wx.domain.*;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.RequiredArgsConstructor;
-import org.apache.commons.compress.utils.IOUtils;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.util.ResourceUtils;
 import org.springframework.web.bind.annotation.*;
 
-import java.io.ByteArrayInputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.InputStream;
-import java.security.KeyStore;
 import java.text.ParseException;
-import java.text.SimpleDateFormat;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -61,6 +42,8 @@ public class CommonController extends BaseController {
 
     private final ICourseService iCourseService;
 
+    private final WxLoginService wxLoginService;
+
     @Autowired
     private RedisCache redisCache;
 
@@ -107,4 +90,58 @@ public class CommonController extends BaseController {
         return AjaxResult.success(map);
     }
 
+    /**
+     * 公众号服务接口
+     */
+    @ApiOperation("公众号服务接口")
+    @GetMapping("/wxGzhServer")
+    public String wxGzhServer(WxServerBody bo) {
+        try {
+            System.out.println(bo);
+            String token = "511A23101c826G90T1";
+            String EncodingAESKey = "ybzse4DNAMj9oGzZ9kQqOX0F7nKjebGZ3xNesVFInPP";
+            String echostr = bo.getEchostr();
+            if (ToolsUtils.checkGzhServerSignature(token,bo.getSignature(), bo.getTimestamp(), bo.getNonce())) {
+                return echostr;
+            }
+        } catch (Exception e) {
+           //验证公众号token失败
+        }
+        return null;
+    }
+
+    @ApiOperation("公众号服务接口")
+    @PostMapping("/wxGzhServer")
+    public String wxGzhServer(@RequestBody String xmlData) {
+        // 将xml格式的数据,转换为 AllMessage 对象
+        AllMessage allMessage = MessageUtil.xmlToAllMessage(xmlData);
+        String TenantId = "867735392558919680";
+        ServletUtils.getRequestAttributes().getResponse().setHeader("TenantId", TenantId);
+        // 是否是文本消息类型
+        if (allMessage.getMsgType().equals(MessageTypeEnum.MSG_TEXT.getMsgType())) {
+            // 自动回复用户所发送的文本消息
+            return MessageUtil.autoReply(allMessage, ContentEnum.CONTENT_PREFIX.getContent() + allMessage.getContent());
+        }
+        // 是否是事件推送类型
+        else if (allMessage.getMsgType().equals(MessageTypeEnum.MSG_EVENT.getMsgType())) {
+            // 是否为订阅事件,即公众号被关注时所触发的事件
+            if (EventType.EVENT_SUBSCRIBE.getEventType().equals(allMessage.getEvent())) {
+            //    System.out.println("关注");
+                String openId = allMessage.getFromUserName();
+                wxLoginService.subGzh(openId);
+                // 自动回复欢迎语
+                return MessageUtil.autoReply(allMessage, ContentEnum.CONTENT_SUBSCRIBE.getContent());
+            }
+            else if (EventType.EVENT_UNSUBSCRIBE.getEventType().equals(allMessage.getEvent())) {
+                String openId = allMessage.getFromUserName();
+                wxLoginService.unsubGzh(openId);
+            //    System.out.println("取消关注");
+            }
+        } else {
+            // 暂不支持文本以外的消息回复
+            return MessageUtil.autoReply(allMessage, ContentEnum.CONTENT_NONSUPPORT.getContent());
+        }
+        return MessageUtil.autoReply(allMessage, ContentEnum.CONTENT_NONSUPPORT.getContent());
+    }
+
 }

+ 8 - 0
zhongzheng-api/src/main/java/com/zhongzheng/controller/inform/InformUserController.java

@@ -104,4 +104,12 @@ public class InformUserController extends BaseController {
         return toAjax(iInformUserService.removeAll(bo) ? 1 : 0);
     }
 
+    @ApiOperation("获取未读督学最新一条信息")
+    @Log(title = "获取未读督学最新一条信息", businessType = BusinessType.UPDATE)
+    @GetMapping("/selectLastUnStudyMsg")
+    public AjaxResult<InformUserVo> selectLastUnStudyMsg() {
+        ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
+        return AjaxResult.success(iInformUserService.selectLastUnStudyMsg(loginUser.getUser().getUserId()));
+    }
+
 }

+ 10 - 1
zhongzheng-api/src/main/java/com/zhongzheng/controller/order/OrderController.java

@@ -178,5 +178,14 @@ public class OrderController extends BaseController {
         return AjaxResult.success(iOrderGoodsService.selectDetail(bo));
     }
 
-
+    /**
+     * 获取是否有未过期的购买商品
+     */
+    @ApiOperation("获取是否有未过期的购买商品")
+    @PreAuthorize("@ss.hasPermi('system:goods:query')")
+    @GetMapping("/buyGoodsNotExpired")
+    public AjaxResult<OrderGoodsVo> getHaveBuyGoodsNotExpired(OrderGoodsQueryBo bo) {
+        ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
+        return AjaxResult.success(iOrderService.getHaveBuyGoodsNotExpired(bo.getGoodsId(),loginUser.getUser().getUserId()));
+    }
 }

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

@@ -1,5 +1,6 @@
 package com.zhongzheng.controller.user;
 
+import cn.hutool.core.lang.Validator;
 import com.zhongzheng.common.annotation.Log;
 import com.zhongzheng.common.core.controller.BaseController;
 import com.zhongzheng.common.core.domain.AjaxResult;
@@ -7,8 +8,10 @@ import com.zhongzheng.common.enums.BusinessType;
 import com.zhongzheng.common.utils.ServletUtils;
 import com.zhongzheng.framework.web.service.WxTokenService;
 import com.zhongzheng.modules.user.bo.*;
+import com.zhongzheng.modules.user.domain.UserWxFollow;
 import com.zhongzheng.modules.user.entity.ClientLoginUser;
 import com.zhongzheng.modules.user.service.IUserService;
+import com.zhongzheng.modules.user.service.IUserWxFollowService;
 import com.zhongzheng.modules.user.vo.RanKingUser;
 import com.zhongzheng.modules.user.vo.UserVo;
 import io.swagger.annotations.Api;
@@ -36,6 +39,8 @@ public class UserController extends BaseController {
 
     private final WxTokenService wxTokenService;
 
+    private final IUserWxFollowService iUserWxFollowService;
+
 
     /**
      * 修改客户端用户
@@ -94,6 +99,10 @@ public class UserController extends BaseController {
     {
         ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
         UserVo vo = iUserService.queryById(loginUser.getUser().getUserId());
+        UserWxFollow userWxFollow = iUserWxFollowService.queryByUnionId(loginUser.getUser().getUnionId());
+        if(Validator.isNotEmpty(userWxFollow)){
+            vo.setUserFollowWx(1);
+        }
         vo.setNull();
         return AjaxResult.success(vo);
     }

+ 0 - 2
zhongzheng-api/src/main/java/com/zhongzheng/controller/wx/WxLoginController.java

@@ -53,8 +53,6 @@ public class WxLoginController
     @PostMapping("/testLogin")
     public AjaxResult testLogin(@RequestBody WxLoginBody loginBody)
     {
-        String token = wxLoginService.getWxGzhAccessToken();
-        System.out.println(token);
         Map<String,String> map = new HashMap<>();
         return AjaxResult.success(null);
     }

+ 1 - 0
zhongzheng-api/src/main/resources/application-dev.yml

@@ -104,6 +104,7 @@ wx:
     gzh:
         appid: wx6f48f721d18244eb
         appsecret: 2f8b2b4ff66e2f6adfb9f08ae22d7474
+        studyNoteTpId: DndIixcAp15Sqgb4KOGTMf73VLF09NlCUifPSel5Y_s
     wepay:
         mchid: 1342013901
         key: GdXyPxYjZx1234123yJzXgDxYpXyjpx9

+ 1 - 0
zhongzheng-api/src/main/resources/application-pre.yml

@@ -104,6 +104,7 @@ wx:
     gzh:
         appid: wx6f48f721d18244eb
         appsecret: 2f8b2b4ff66e2f6adfb9f08ae22d7474
+        studyNoteTpId: DndIixcAp15Sqgb4KOGTMf73VLF09NlCUifPSel5Y_s
     wepay:
         mchid: 1342013901
         key: GdXyPxYjZx1234123yJzXgDxYpXyjpx9

+ 1 - 0
zhongzheng-api/src/main/resources/application-prod.yml

@@ -116,6 +116,7 @@ wx:
     gzh:
         appid: wx6f48f721d18244eb
         appsecret: 2f8b2b4ff66e2f6adfb9f08ae22d7474
+        studyNoteTpId: DndIixcAp15Sqgb4KOGTMf73VLF09NlCUifPSel5Y_s
     wepay:
         mchid: 1342013901
         key: GdXyPxYjZx1234123yJzXgDxYpXyjpx9

+ 5 - 1
zhongzheng-api/src/main/resources/application.yml

@@ -288,4 +288,8 @@ aliyun:
     commitmentFailsCode: SMS_231215516     #承诺书审核不通过通知
     mockBookingReminder: SMS_243430276     #模考预约提醒
     mockRemind: SMS_243355276      #模考开始提醒
-    liveStartRemind: SMS_243345514      #直播开课提醒
+    liveStartRemind: SMS_243345514      #直播开课提醒
+    buyNotStudyStudentRemind: SMS_247745294  #学生购买未学习
+    buyNotStudyTeacherRemind: SMS_247935257  #学生购买未学习老师
+    longNotStudyStudentRemind: SMS_247910221  #学生长时间未学习
+    longNotStudyTeacherRemind: SMS_247765294  #学生长时间未学习老师

+ 10 - 0
zhongzheng-common/pom.xml

@@ -58,6 +58,16 @@
             <groupId>com.fasterxml.jackson.core</groupId>
             <artifactId>jackson-databind</artifactId>
         </dependency>
+        <dependency>
+            <groupId>dom4j</groupId>
+            <artifactId>dom4j</artifactId>
+            <version>1.6.1</version>
+        </dependency>
+        <dependency>
+            <groupId>com.thoughtworks.xstream</groupId>
+            <artifactId>xstream</artifactId>
+            <version>1.4.17</version>
+        </dependency>
 
         <!-- 保利威 -->
         <dependency>

+ 61 - 4
zhongzheng-common/src/main/java/com/zhongzheng/common/utils/ToolsUtils.java

@@ -9,10 +9,7 @@ import java.io.UnsupportedEncodingException;
 import java.nio.charset.StandardCharsets;
 import java.security.MessageDigest;
 import java.security.NoSuchAlgorithmException;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Random;
+import java.util.*;
 
 public class ToolsUtils {
 
@@ -179,4 +176,64 @@ public class ToolsUtils {
         return result;
     }
 
+    /**
+     * 校验签名
+     *
+     * @param token token
+     * @param signature 签名
+     * @param timestamp 时间戳
+     * @param nonce     随机数
+     * @return 布尔值
+     */
+    public static boolean checkGzhServerSignature(String token,String signature, String timestamp, String nonce) {
+        String checktext = null;
+        if (null != signature) {
+            //对ToKen,timestamp,nonce 按字典排序
+            String[] paramArr = new String[]{token, timestamp, nonce};
+            Arrays.sort(paramArr);
+            //将排序后的结果拼成一个字符串
+            String content = paramArr[0].concat(paramArr[1]).concat(paramArr[2]);
+
+            try {
+                MessageDigest md = MessageDigest.getInstance("SHA-1");
+                //对接后的字符串进行sha1加密
+                byte[] digest = md.digest(content.toString().getBytes());
+                checktext = byteToStr(digest);
+            } catch (NoSuchAlgorithmException e) {
+                e.printStackTrace();
+            }
+        }
+        //将加密后的字符串与signature进行对比
+        return checktext != null ? checktext.equals(signature.toUpperCase()) : false;
+    }
+
+    /**
+     * 将字节数组转化我16进制字符串
+     *
+     * @param byteArrays 字符数组
+     * @return 字符串
+     */
+    private static String byteToStr(byte[] byteArrays) {
+        String str = "";
+        for (int i = 0; i < byteArrays.length; i++) {
+            str += byteToHexStr(byteArrays[i]);
+        }
+        return str;
+    }
+
+    /**
+     * 将字节转化为十六进制字符串
+     *
+     * @param myByte 字节
+     * @return 字符串
+     */
+    private static String byteToHexStr(byte myByte) {
+        char[] Digit = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
+        char[] tampArr = new char[2];
+        tampArr[0] = Digit[(myByte >>> 4) & 0X0F];
+        tampArr[1] = Digit[myByte & 0X0F];
+        String str = new String(tampArr);
+        return str;
+    }
+
 }

+ 27 - 1
zhongzheng-common/src/main/java/com/zhongzheng/common/utils/http/HttpUtils.java

@@ -12,10 +12,12 @@ import javax.net.ssl.TrustManager;
 import javax.net.ssl.X509TrustManager;
 
 
+import com.alibaba.fastjson.JSONObject;
 import org.apache.http.Consts;
 import org.apache.http.Header;
 import cn.hutool.core.lang.Validator;
 import org.apache.http.*;
+import org.apache.http.client.HttpClient;
 import org.apache.http.client.config.RequestConfig;
 import org.apache.http.client.entity.UrlEncodedFormEntity;
 import org.apache.http.client.methods.CloseableHttpResponse;
@@ -125,7 +127,30 @@ public class HttpUtils
 
     }
 
-
+    public static String sendPost(String url, JSONObject param)
+    {
+        HttpClient client = HttpClients.createDefault();
+        HttpPost post = new HttpPost(url);
+        try {
+            //此处应设定参数的编码格式,不然中文会变乱码
+            StringEntity s = new StringEntity(param.toString(), "UTF-8");
+            s.setContentEncoding("UTF-8");
+            s.setContentType("application/json");
+            post.setEntity(s);
+            post.addHeader("content-type", "application/json");
+            HttpResponse res = client.execute(post);
+            if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
+                String result = EntityUtils.toString(res.getEntity());// 返回json格式
+                System.out.println("推送成功" + result);
+                return result;
+            } else {
+                System.out.println("推送失败");
+            }
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+        return null;
+    }
 
     /**
      * 向指定 URL 发送POST方法的请求
@@ -136,6 +161,7 @@ public class HttpUtils
      */
     public static String sendPost(String url, String param)
     {
+        System.out.println(param);
         PrintWriter out = null;
         BufferedReader in = null;
         StringBuilder result = new StringBuilder();

+ 111 - 4
zhongzheng-framework/src/main/java/com/zhongzheng/framework/web/service/WxLoginService.java

@@ -23,9 +23,11 @@ import com.zhongzheng.modules.alisms.service.IAliSmsService;
 import com.zhongzheng.modules.course.domain.CourseMenu;
 import com.zhongzheng.modules.course.mapper.CourseSectionMapper;
 import com.zhongzheng.modules.user.bo.UserAddBo;
+import com.zhongzheng.modules.user.bo.UserWxFollowAddBo;
 import com.zhongzheng.modules.user.domain.User;
 import com.zhongzheng.modules.user.domain.UserBankRecord;
 import com.zhongzheng.modules.user.domain.UserSchoolInfo;
+import com.zhongzheng.modules.user.domain.UserWxFollow;
 import com.zhongzheng.modules.user.entity.ClientLoginUser;
 import com.zhongzheng.modules.user.mapper.UserMapper;
 import com.zhongzheng.modules.user.mapper.UserSchoolInfoMapper;
@@ -33,8 +35,12 @@ import com.zhongzheng.modules.user.mapper.UserWxFollowMapper;
 import com.zhongzheng.modules.user.service.IUserService;
 import com.zhongzheng.modules.user.service.IUserWxFollowService;
 import com.zhongzheng.modules.user.vo.UserVo;
+import com.zhongzheng.modules.wx.bo.TemplatData;
 import com.zhongzheng.modules.wx.bo.WxLoginBody;
+import com.zhongzheng.modules.wx.service.IWxLoginService;
+import net.polyv.common.v1.base.HttpClientUtil;
 import org.apache.commons.codec.binary.Base64;
+import org.apache.http.entity.StringEntity;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -46,6 +52,7 @@ import javax.annotation.Resource;
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.util.HashMap;
+import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.CountDownLatch;
@@ -57,7 +64,7 @@ import java.util.concurrent.TimeUnit;
  * @author zhongzheng
  */
 @Component
-public class WxLoginService
+public class WxLoginService implements IWxLoginService
 {
     private static final Logger log = LoggerFactory.getLogger(WxLoginService.class);
 
@@ -83,6 +90,9 @@ public class WxLoginService
     @Value("${wx.gzh.appsecret}")
     private String gzh_appsrcret;
 
+    @Value("${wx.gzh.studyNoteTpId}")
+    private String studyNoteTpId;
+
     private String gzh_wxTokenUrl = "https://api.weixin.qq.com/cgi-bin/token";
 
     private String gzh_wxTokenParam = "grant_type=client_credential&appid=%s&secret=%s";
@@ -103,6 +113,10 @@ public class WxLoginService
 
     private String gzh_wxUserCgiInfoParam = "access_token=%s&openid=%s&lang=zh_CN";
 
+    private String small_wxSendTpUrl = "https://api.weixin.qq.com/cgi-bin/message/wxopen/template/uniform_send";
+
+    private String small_wxSendTpParam = "access_token=%s";
+
     @Autowired
     private IUserService iUserService;
 
@@ -348,17 +362,44 @@ public class WxLoginService
         return user;
     }
 
+    public String getWxSmallAccessToken() {
+        String key = "WX_SMALL_ACCESS_TOKEN";
+        String accessToken = redisCache.getCacheObject(key);
+        if(Validator.isEmpty(accessToken)||accessToken.equals("null")){
+            String param = String.format(gzh_wxTokenParam, appid, appsrcret);
+            String resultString  = HttpUtils.sendGet(gzh_wxTokenUrl,param);
+            //解析json
+            JSONObject jsonObject = (JSONObject) JSONObject.parse(resultString);
+            if(jsonObject.containsKey("access_token")){
+                accessToken = String.valueOf(jsonObject.get("access_token"));
+                if(Validator.isNotEmpty(accessToken)&&!accessToken.equals("null")){
+                    redisCache.setCacheObject(key, accessToken,7100, TimeUnit.SECONDS);//7200有效期
+                }
+            }else{
+                return null;
+            }
+        }
+        return accessToken;
+    }
+
     public String getWxGzhAccessToken() {
         String key = "WX_GZH_ACCESS_TOKEN";
         String accessToken = redisCache.getCacheObject(key);
         if(Validator.isEmpty(accessToken)||accessToken.equals("null")){
             String param = String.format(gzh_wxTokenParam, gzh_appid, gzh_appsrcret);
             String resultString  = HttpUtils.sendGet(gzh_wxTokenUrl,param);
+            System.out.println(resultString);
             //解析json
             JSONObject jsonObject = (JSONObject) JSONObject.parse(resultString);
-            accessToken = String.valueOf(jsonObject.get("access_token"));
-            if(Validator.isNotEmpty(accessToken)&&!accessToken.equals("null")){
-                redisCache.setCacheObject(key, accessToken,7100, TimeUnit.SECONDS);//7200有效期
+            if(jsonObject.containsKey("access_token")){
+                accessToken = String.valueOf(jsonObject.get("access_token"));
+                System.out.println("获取");
+                System.out.println(accessToken);
+                if(Validator.isNotEmpty(accessToken)&&!accessToken.equals("null")){
+                    redisCache.setCacheObject(key, accessToken,7100, TimeUnit.SECONDS);//7200有效期
+                }
+            }else{
+                return null;
             }
         }
         return accessToken;
@@ -416,6 +457,72 @@ public class WxLoginService
         return null;
     }
 
+    @Override
+    public String sendSmallTpMsg(String openId,Map<String,String> paramMap)  {
+        String accessToken = getWxSmallAccessToken();
+        if(Validator.isEmpty(accessToken)){
+            throw new CustomException("小程序accessToken 错误");
+        }
+        String param = String.format(small_wxSendTpParam, accessToken);
+        String url = small_wxSendTpUrl + "?" + param;
+        JSONObject obj = new JSONObject();
+        JSONObject mp_template_msg = new JSONObject();
+        JSONObject miniprogram = new JSONObject();
+
+        obj.put("touser", openId);
+        paramMap.put("access_token",accessToken);
+        mp_template_msg.put("appid", gzh_appid);
+        mp_template_msg.put("template_id", studyNoteTpId);
+        mp_template_msg.put("url", "http://weixin.qq.com/download");  //公众号模板消息所要跳转的url
+        miniprogram.put("appid", appid); //公众号模板消息所要跳转的小程序appid,小程序的必须与公众号具有绑定关系
+        miniprogram.put("pagepath", paramMap.get("pagepath")); //公众号模板消息所要跳转的小程序页面
+        mp_template_msg.put("miniprogram", miniprogram);
+        Map<String, TemplatData> mapdata = new LinkedHashMap<>();
+        // 封装模板数据
+        TemplatData first = new TemplatData();
+        first.setValue(paramMap.get("first"));
+        first.setColor("#173177");
+        mapdata.put("first", first);
+
+        TemplatData keyword1 = new TemplatData();
+        keyword1.setValue(paramMap.get("keyword1"));
+        keyword1.setColor("#000000");
+        mapdata.put("keyword1", keyword1);
+
+        TemplatData keyword2 = new TemplatData();
+        keyword2.setValue(paramMap.get("keyword2"));
+        keyword2.setColor("#000000");
+        mapdata.put("keyword2", keyword2);
+
+        TemplatData remark = new TemplatData();
+        remark.setValue("↓点我去上课~");
+        remark.setColor("#173177");
+        mapdata.put("remark", remark);
+
+
+        mp_template_msg.put("data", mapdata);
+        obj.put("mp_template_msg", mp_template_msg);
+
+        String result = HttpUtils.sendPost(url, obj);
+        return result;
+    }
+
+    public Boolean subGzh(String openId){
+        String unionId = getWxGzhUserCgiInfo(openId);
+        if(Validator.isNotEmpty(unionId)){
+            unsubGzh(openId);
+            UserWxFollowAddBo addBo = new UserWxFollowAddBo();
+            addBo.setGzhOpenId(openId);
+            addBo.setUnionId(unionId);
+            return iUserWxFollowService.insertByAddBo(addBo);
+        }
+        return false;
+    }
+
+    public Boolean unsubGzh(String openId){
+        return iUserWxFollowService.unsubGzh(openId);
+    }
+
     //公众号获取用户信息
     public User getWxGzhUnionIdUser(WxLoginBody loginBody) {
         String param = String.format(gzh_wxAuthParam, gzh_appid, gzh_appsrcret, loginBody.getCode());

+ 6 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/activity/bo/ActivityRecommendAddBo.java

@@ -33,6 +33,12 @@ public class ActivityRecommendAddBo {
     /** 项目ID */
     @ApiModelProperty("项目ID")
     private Long projectId;
+    /** 项目ID */
+    @ApiModelProperty("专业ID")
+    private Long majorId;
+    /** 项目ID */
+    @ApiModelProperty("科目ID")
+    private List<Long> subjectIds;
     /** 1有效 0无效 */
     @ApiModelProperty("1有效 0无效")
     private Integer status;

+ 8 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/activity/bo/ActivityRecommendEditBo.java

@@ -38,6 +38,14 @@ public class ActivityRecommendEditBo {
     @ApiModelProperty("业务层次id")
     private Long businessId;
 
+    /** 项目ID */
+    @ApiModelProperty("专业ID")
+    private Long majorId;
+
+    /** 项目ID */
+    @ApiModelProperty("科目ID")
+    private List<Long> subjectIds;
+
     /** 项目ID */
     @ApiModelProperty("项目ID")
     private Long projectId;

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/activity/domain/ActivityRecommend.java

@@ -36,6 +36,10 @@ private static final long serialVersionUID=1L;
     private Long businessId;
     /** 项目ID */
     private Long projectId;
+    /** 专业ID */
+    private Long majorId;
+    /** 科目ID */
+    private String subjectIds;
     /** 1有效 0无效 */
     private Integer status;
     /** 创建时间 */

+ 21 - 11
zhongzheng-system/src/main/java/com/zhongzheng/modules/activity/service/impl/ActivityRecommendServiceImpl.java

@@ -2,6 +2,11 @@ package com.zhongzheng.modules.activity.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.github.pagehelper.Page;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.modules.activity.bo.ActivityRecommendAddBo;
 import com.zhongzheng.modules.activity.bo.ActivityRecommendEditBo;
@@ -13,21 +18,13 @@ import com.zhongzheng.modules.activity.mapper.ActivityRecommendMapper;
 import com.zhongzheng.modules.activity.service.IActivityRecommendGoodsService;
 import com.zhongzheng.modules.activity.service.IActivityRecommendService;
 import com.zhongzheng.modules.activity.vo.ActivityRecommendVo;
-import com.zhongzheng.modules.goods.bo.GoodsCourseAddBo;
-import com.zhongzheng.modules.goods.domain.GoodsAttached;
-import com.zhongzheng.modules.goods.domain.GoodsCourse;
-import com.zhongzheng.modules.goods.service.IGoodsAttachedService;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.github.pagehelper.Page;
 import org.springframework.transaction.annotation.Transactional;
 
-
+import java.util.Arrays;
 import java.util.Collection;
-import java.util.Collections;
 import java.util.HashSet;
 import java.util.List;
 import java.util.stream.Collectors;
@@ -44,6 +41,7 @@ public class ActivityRecommendServiceImpl extends ServiceImpl<ActivityRecommendM
     @Autowired
     private IActivityRecommendGoodsService iActivityRecommendGoodsService;
 
+
     @Override
     public ActivityRecommendVo queryById(Long recommendId){
         ActivityRecommend db = this.baseMapper.selectById(recommendId);
@@ -90,6 +88,9 @@ public class ActivityRecommendServiceImpl extends ServiceImpl<ActivityRecommendM
         validEntityBeforeSave(add);
         add.setCreateTime(DateUtils.getNowTime());
         add.setUpdateTime(DateUtils.getNowTime());
+        if (CollectionUtils.isNotEmpty(bo.getSubjectIds())){
+            add.setSubjectIds(StringUtils.join(bo.getSubjectIds(),","));
+        }
         Boolean rs =  this.save(add);
         if(bo.getGoodsList()!=null){
             Collection<ActivityRecommendGoods> coll = new HashSet<>();
@@ -111,7 +112,13 @@ public class ActivityRecommendServiceImpl extends ServiceImpl<ActivityRecommendM
 
     @Override
     public ActivityRecommendVo getDetail(ActivityRecommendQueryBo bo) {
-        return baseMapper.getDetail(bo);
+        ActivityRecommendVo detail = baseMapper.getDetail(bo);
+        //获取科目名称
+        if (StringUtils.isNotBlank(detail.getSubjectIdList())){
+            List<Long> collect = Arrays.stream(detail.getSubjectIdList().split(",")).map(x -> Long.valueOf(x)).collect(Collectors.toList());
+            detail.setSubjectIds(collect);
+        }
+        return detail;
     }
 
     @Override
@@ -119,6 +126,9 @@ public class ActivityRecommendServiceImpl extends ServiceImpl<ActivityRecommendM
         ActivityRecommend update = BeanUtil.toBean(bo, ActivityRecommend.class);
         validEntityBeforeSave(update);
         update.setUpdateTime(DateUtils.getNowTime());
+        if (CollectionUtils.isNotEmpty(bo.getSubjectIds())){
+            update.setSubjectIds(StringUtils.join(bo.getSubjectIds(),","));
+        }
         if(bo.getGoodsList()!=null){
             iActivityRecommendGoodsService.remove(new LambdaQueryWrapper<ActivityRecommendGoods>().eq(ActivityRecommendGoods::getRecommendId, bo.getRecommendId()));
             Collection<ActivityRecommendGoods> coll = new HashSet<>();

+ 6 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/activity/vo/ActivityRecommendVo.java

@@ -41,6 +41,12 @@ public class ActivityRecommendVo {
 	@Excel(name = "业务层次id")
 	@ApiModelProperty("业务层次id")
 	private Long businessId;
+	@ApiModelProperty("专业ID")
+	private Long majorId;
+	@ApiModelProperty("科目IDs")
+	private String subjectIdList;
+	@ApiModelProperty("科目IDs")
+	private List<Long> subjectIds;
 	/** 项目ID */
 	@Excel(name = "项目ID")
 	@ApiModelProperty("项目ID")

+ 1 - 5
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/mapper/CourseBusinessMapper.java

@@ -1,13 +1,11 @@
 package com.zhongzheng.modules.course.mapper;
 
-import com.zhongzheng.common.core.domain.entity.SysUser;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.zhongzheng.modules.course.bo.CourseBusinessQueryBo;
 import com.zhongzheng.modules.course.domain.CourseBusiness;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.zhongzheng.modules.course.vo.CourseBusinessVo;
 
 import java.util.Collection;
-import java.util.List;
 
 /**
  * 业务层次Mapper接口
@@ -18,6 +16,4 @@ import java.util.List;
 public interface CourseBusinessMapper extends BaseMapper<CourseBusiness> {
 
     Collection<CourseBusinessVo> queryList(CourseBusinessQueryBo bo);
-
-
 }

+ 4 - 4
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/ICourseBusinessService.java

@@ -1,11 +1,11 @@
 package com.zhongzheng.modules.course.service;
 
-import com.zhongzheng.modules.course.domain.CourseBusiness;
-import com.zhongzheng.modules.course.vo.CourseBusinessVo;
-import com.zhongzheng.modules.course.bo.CourseBusinessQueryBo;
+import com.baomidou.mybatisplus.extension.service.IService;
 import com.zhongzheng.modules.course.bo.CourseBusinessAddBo;
 import com.zhongzheng.modules.course.bo.CourseBusinessEditBo;
-import com.baomidou.mybatisplus.extension.service.IService;
+import com.zhongzheng.modules.course.bo.CourseBusinessQueryBo;
+import com.zhongzheng.modules.course.domain.CourseBusiness;
+import com.zhongzheng.modules.course.vo.CourseBusinessVo;
 
 import java.util.Collection;
 import java.util.List;

+ 1 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseBusinessServiceImpl.java

@@ -11,7 +11,7 @@ import com.zhongzheng.modules.course.bo.CourseProjectTypeQueryBo;
 import com.zhongzheng.modules.course.domain.CourseProjectType;
 import com.zhongzheng.modules.course.service.ICourseChapterBusinessService;
 import com.zhongzheng.modules.course.service.ICourseProjectTypeService;
-import com.zhongzheng.modules.course.vo.CourseProjectTypeVo;
+import com.zhongzheng.modules.course.vo.*;
 import org.apache.el.util.Validation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -24,7 +24,6 @@ import com.zhongzheng.modules.course.bo.CourseBusinessQueryBo;
 import com.zhongzheng.modules.course.bo.CourseBusinessEditBo;
 import com.zhongzheng.modules.course.domain.CourseBusiness;
 import com.zhongzheng.modules.course.mapper.CourseBusinessMapper;
-import com.zhongzheng.modules.course.vo.CourseBusinessVo;
 import com.zhongzheng.modules.course.service.ICourseBusinessService;
 import org.springframework.util.CollectionUtils;
 

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/bo/GoodsQueryBo.java

@@ -178,6 +178,9 @@ GoodsQueryBo extends BaseEntity {
 	/** 科目ID,拼接 */
 	@ApiModelProperty("科目ID,拼接")
 	private String subjectIds;
+	/** 科目ID,拼接 */
+	@ApiModelProperty("科目ID集合")
+	private List<Long> subjectIdList;
 	/** 证书类型ID */
 	@ApiModelProperty("证书类型ID")
 	private Long certificateTypeId;

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/bo/InformSysUserEditBo.java

@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
 import java.util.Date;
+import java.util.List;
 
 
 /**
@@ -82,4 +83,5 @@ public class InformSysUserEditBo {
     @ApiModelProperty("状态 1有效 0无效")
     private Integer status;
 
+    private List<Long> ids;
 }

+ 1 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/bo/InformUserEditBo.java

@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
 import java.util.Date;
+import java.util.List;
 
 
 /**

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/mapper/InformUserMapper.java

@@ -25,4 +25,6 @@ public interface InformUserMapper extends BaseMapper<InformUser> {
     Long selectGradeId(@Param("goodsId") Long goodsId,@Param("userId") Long userId);
 
     List<MockApplyVo> listMockApply();
+
+    InformUserVo selectLastUnStudyMsg(@Param("time") Long time,@Param("userId") Long userId);
 }

+ 5 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/service/IInformSysUserService.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
 import com.zhongzheng.modules.inform.bo.InformSysUserAddBo;
 import com.zhongzheng.modules.inform.bo.InformSysUserEditBo;
 import com.zhongzheng.modules.inform.bo.InformSysUserQueryBo;
+import com.zhongzheng.modules.inform.bo.InformUserEditBo;
 import com.zhongzheng.modules.inform.domain.InformSysUser;
 import com.zhongzheng.modules.inform.vo.InformSysUserVo;
 
@@ -35,6 +36,10 @@ public interface IInformSysUserService extends IService<InformSysUser> {
 	 */
 	Boolean insertByAddBo(InformSysUserAddBo bo);
 
+	Integer informUnReadSum(Long userId);
+
+	Boolean updateReadStatusBatch(InformSysUserEditBo bo);
+
 	/**
 	 * 根据编辑业务对象修改通知绑定系统用户
 	 * @param bo 通知绑定系统用户编辑业务对象

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/service/IInformUserService.java

@@ -8,6 +8,7 @@ import com.zhongzheng.modules.inform.bo.InformUserAddBo;
 import com.zhongzheng.modules.inform.bo.InformUserEditBo;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.zhongzheng.modules.mock.vo.MockApplyVo;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.Collection;
 import java.util.List;
@@ -63,4 +64,6 @@ public interface IInformUserService extends IService<InformUser> {
 	Boolean removeAll(InformUserEditBo bo);
 
 	List<MockApplyVo> listMockApply();
+
+	InformUserVo selectLastUnStudyMsg(Long userId);
 }

+ 22 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/service/impl/InformSysUserServiceImpl.java

@@ -6,10 +6,13 @@ import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.modules.inform.bo.InformSysUserAddBo;
 import com.zhongzheng.modules.inform.bo.InformSysUserEditBo;
 import com.zhongzheng.modules.inform.bo.InformSysUserQueryBo;
+import com.zhongzheng.modules.inform.bo.InformUserEditBo;
 import com.zhongzheng.modules.inform.domain.InformSysUser;
 import com.zhongzheng.modules.inform.mapper.InformSysUserMapper;
 import com.zhongzheng.modules.inform.service.IInformSysUserService;
 import com.zhongzheng.modules.inform.vo.InformSysUserVo;
+import com.zhongzheng.modules.user.domain.User;
+import io.swagger.models.auth.In;
 import org.springframework.stereotype.Service;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@@ -85,6 +88,25 @@ public class InformSysUserServiceImpl extends ServiceImpl<InformSysUserMapper, I
         return this.save(add);
     }
 
+    @Override
+    public Integer informUnReadSum(Long userId) {
+        return count(new LambdaQueryWrapper<InformSysUser>()
+                .eq(InformSysUser::getUserId,userId).eq(InformSysUser::getReceiptStatus,0).eq(InformSysUser::getSystemStatus,1)
+                .eq(InformSysUser::getStatus,1));
+    }
+
+    @Override
+    public Boolean updateReadStatusBatch(InformSysUserEditBo bo) {
+        boolean result = false;
+        for(Long id : bo.getIds()){
+            InformSysUserEditBo editBo = new InformSysUserEditBo();
+            editBo.setId(id);
+            editBo.setReceiptStatus(bo.getReceiptStatus());
+            result = updateByEditBo(editBo);
+        }
+        return result;
+    }
+
     @Override
     public Boolean updateByEditBo(InformSysUserEditBo bo) {
         InformSysUser update = BeanUtil.toBean(bo, InformSysUser.class);

+ 9 - 4
zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/service/impl/InformUserServiceImpl.java

@@ -36,10 +36,7 @@ import com.zhongzheng.modules.inform.vo.InformUserVo;
 import com.zhongzheng.modules.inform.service.IInformUserService;
 
 import javax.swing.plaf.nimbus.State;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
+import java.util.*;
 import java.util.stream.Collectors;
 
 /**
@@ -264,4 +261,12 @@ public class InformUserServiceImpl extends ServiceImpl<InformUserMapper, InformU
     public List<MockApplyVo> listMockApply() {
         return baseMapper.listMockApply();
     }
+
+    @Override
+    public InformUserVo selectLastUnStudyMsg(Long userId) {
+        Calendar cal = new GregorianCalendar();
+        cal.add(Calendar.DATE, -30);
+        Long time = cal.getTimeInMillis() / 1000;
+        return this.baseMapper.selectLastUnStudyMsg(time,userId);
+    }
 }

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/bo/OrderInputQueryBo.java

@@ -70,4 +70,7 @@ public class OrderInputQueryBo extends BaseEntity {
 	/** 旧业务系统订单号 */
 	@ApiModelProperty("旧业务系统订单号")
 	private String oldOrderSn;
+	/** 订单来源 1业务员录单 */
+	@ApiModelProperty("订单来源 1业务员普通单 2祥粤云学堂小程序 3祥粤云学堂网站 4祥粤e管证小程序 5业务员录单")
+	private Integer orderFrom;
 }

+ 5 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/mapper/OrderGoodsMapper.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.zhongzheng.modules.course.vo.CourseLiveVo;
 import com.zhongzheng.modules.goods.bo.GoodsQueryBo;
 import com.zhongzheng.modules.order.bo.OrderGoodsQueryBo;
+import com.zhongzheng.modules.order.bo.OrderQueryBo;
 import com.zhongzheng.modules.order.domain.OrderGoods;
 import com.zhongzheng.modules.order.vo.OrderGoodsVo;
 
@@ -49,4 +50,8 @@ public interface OrderGoodsMapper extends BaseMapper<OrderGoods> {
     List<OrderGoodsVo> listUserVideoLive(GoodsQueryBo bo);
 
     List<CourseLiveVo> getLiveList(Long userId);
+
+    List<OrderGoodsVo> getBuyNotStudyList(OrderQueryBo bo);
+
+    List<OrderGoodsVo> getLongNotStudyList(OrderQueryBo bo);
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/IOrderGoodsService.java

@@ -91,7 +91,9 @@ public interface IOrderGoodsService extends IService<OrderGoods> {
 
     List<OrderGoodsVo> selectBuyUserList(Long mockMajorSubjectId);
 
+    List<OrderGoodsVo> getBuyNotStudyList(OrderQueryBo bo);
 
+    List<OrderGoodsVo> getLongNotStudyList(OrderQueryBo bo);
     /**
      *
      * @author 获取直播提醒列表

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/IOrderService.java

@@ -7,6 +7,7 @@ import com.zhongzheng.modules.order.bo.OrderEditBo;
 import com.zhongzheng.modules.order.bo.OrderQueryBo;
 import com.zhongzheng.modules.order.bo.OrderUserCheckBuyBo;
 import com.zhongzheng.modules.order.domain.Order;
+import com.zhongzheng.modules.order.vo.OrderGoodsVo;
 import com.zhongzheng.modules.order.vo.OrderListVo;
 import com.zhongzheng.modules.order.vo.OrderVo;
 
@@ -41,6 +42,8 @@ public interface IOrderService extends IService<Order> {
 
 	List<OrderUserCheckBuyBo> userCheckBuyList(List<OrderUserCheckBuyBo> list);
 
+	OrderGoodsVo getHaveBuyGoodsNotExpired(Long goodsId, Long userId);
+
 	/**
 	 * 根据新增业务对象插入订单
 	 * @param bo 订单新增业务对象

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

@@ -237,7 +237,7 @@ public class OrderGoodsRefundServiceImpl extends ServiceImpl<OrderGoodsRefundMap
             if(order.getStatus()==0){
                 throw new CustomException("订单无效");
             }
-            if(order.getOrderFrom()!=5){
+            if(order.getOrderFrom()!=5&&order.getOrderFrom()!=6){
                 throw new CustomException("不支持非录单订单退款");
             }
             //订单商品

+ 11 - 4
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/impl/OrderGoodsServiceImpl.java

@@ -30,10 +30,7 @@ import com.zhongzheng.modules.grade.service.IClassGradeService;
 import com.zhongzheng.modules.grade.service.IClassGradeUserService;
 import com.zhongzheng.modules.grade.vo.ClassGradeVo;
 import com.zhongzheng.modules.grade.vo.ClassPeriodVo;
-import com.zhongzheng.modules.order.bo.OrderGoodsAddBo;
-import com.zhongzheng.modules.order.bo.OrderGoodsEditBo;
-import com.zhongzheng.modules.order.bo.OrderGoodsQueryBo;
-import com.zhongzheng.modules.order.bo.OrderSubjectUserBuyBo;
+import com.zhongzheng.modules.order.bo.*;
 import com.zhongzheng.modules.order.domain.OrderGoods;
 import com.zhongzheng.modules.order.mapper.OrderGoodsMapper;
 import com.zhongzheng.modules.order.service.IOrderGoodsService;
@@ -482,6 +479,16 @@ public class OrderGoodsServiceImpl extends ServiceImpl<OrderGoodsMapper, OrderGo
         return baseMapper.selectBuyUserList(mockMajorSubjectId);
     }
 
+    @Override
+    public List<OrderGoodsVo> getBuyNotStudyList(OrderQueryBo bo) {
+        return baseMapper.getBuyNotStudyList(bo);
+    }
+
+    @Override
+    public List<OrderGoodsVo> getLongNotStudyList(OrderQueryBo bo) {
+        return baseMapper.getLongNotStudyList(bo);
+    }
+
     /**
      * 查询用户拥有视频+直播商品
      * @param bo

+ 38 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/impl/OrderServiceImpl.java

@@ -507,7 +507,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
         //订单0元
         if (payPrice.compareTo(BigDecimal.ZERO) == 0) {
             //完全收费
-            add.setOrderStatus(Order.PAY_FULL);
+            add.setOrderStatus(Order.ORDER_STATUS_PAY);
             add.setStatus(1);
         }
 
@@ -646,7 +646,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
         }
 
         add.setOrderSn(out_trade_no);
-        if(Validator.isNotEmpty(bo.getOrderFrom())){
+        if(Validator.isNotEmpty(bo.getOrderFrom())&&bo.getOrderFrom()==6){
             add.setOrderFrom(bo.getOrderFrom());
         }else{
             add.setOrderFrom(Order.FROM_INPUT);
@@ -1305,6 +1305,42 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
         return baseMapper.getUserGoods(userId);
     }
 
+    //获取未过期的订单商品
+    @Override
+    public OrderGoodsVo getHaveBuyGoodsNotExpired(Long goodsId, Long userId) {
+        OrderGoodsQueryBo orderGoodsQueryBo = new OrderGoodsQueryBo();
+        orderGoodsQueryBo.setUserId(userId);
+        orderGoodsQueryBo.setGoodsId(goodsId);
+        List<Integer> refundStatusList = new ArrayList<>();
+        refundStatusList.add(0);
+        refundStatusList.add(1);
+        refundStatusList.add(3);
+        orderGoodsQueryBo.setRefundStatusList(refundStatusList);
+        List<Integer> payStatusList = new ArrayList<>();
+        payStatusList.add(2);
+        payStatusList.add(3);
+        payStatusList.add(4);
+        orderGoodsQueryBo.setPayStatusList(payStatusList);
+        List<OrderGoodsVo> list1 = iOrderGoodsService.selectList(orderGoodsQueryBo);
+        for(OrderGoodsVo goodsVo : list1){
+            if(Validator.isNotEmpty(goodsVo.getServiceEndTime())&&(goodsVo.getServiceEndTime().longValue()>(System.currentTimeMillis()/1000))){
+                if(goodsVo.getGoodsType()==1){
+                    if(Validator.isNotEmpty(goodsVo.getGradeId())){
+                        ClassGrade grade = iClassGradeService.getOne(new LambdaQueryWrapper<ClassGrade>()
+                                .eq(ClassGrade::getGradeId, goodsVo.getGradeId()));
+                        //不存在班级有效期才校验服务期是否过期
+                        if(Validator.isEmpty(grade.getClassEndTime())){
+                            return goodsVo;
+                        }
+                    }
+                }
+                if(goodsVo.getGoodsType()==2){
+                    return goodsVo;
+                }
+            }
+        }
+        return null;
+    }
     //判断视频商品是否购买过且服务期是否过期
     public Long getHaveBuyGoods(Long goodsId, Long userId) {
         OrderGoodsQueryBo orderGoodsQueryBo = new OrderGoodsQueryBo();

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/vo/OrderGoodsVo.java

@@ -252,4 +252,7 @@ public class OrderGoodsVo {
 	/** 学习进度 */
 	@ApiModelProperty("总节数")
 	private Long secAllNum;
+	/** 班主任ID */
+	@ApiModelProperty("班主任ID")
+	private Long sysUserId;
 }

+ 12 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/schedule/service/IScheduleService.java

@@ -58,4 +58,16 @@ public interface IScheduleService extends IService<PolyvVideo> {
     void mockTimeSend(UserQueryBo bo);
 
     void mockLiveSend(UserQueryBo bo);
+
+    void buyNotReadToStudentTwo(UserQueryBo bo);
+
+    void buyNotReadToStudentFive(UserQueryBo bo);
+
+    void buyNotReadToTeacher(UserQueryBo bo);
+
+    void longNotReadToStudentThree(UserQueryBo bo);
+
+    void longNotReadToStudentFive(UserQueryBo bo);
+
+    void longNotReadToTeacher(UserQueryBo bo);
 }

+ 493 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/schedule/service/impl/ScheduleServiceImpl.java

@@ -14,6 +14,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.github.pagehelper.Page;
+import com.zhongzheng.common.core.domain.entity.SysUser;
 import com.zhongzheng.common.core.redis.RedisCache;
 import com.zhongzheng.common.exception.CustomException;
 import com.zhongzheng.common.utils.DateUtils;
@@ -60,11 +61,13 @@ import com.zhongzheng.modules.grade.domain.*;
 import com.zhongzheng.modules.grade.service.*;
 import com.zhongzheng.modules.grade.vo.*;
 import com.zhongzheng.modules.inform.bo.InformQueryBo;
+import com.zhongzheng.modules.inform.bo.InformSysUserAddBo;
 import com.zhongzheng.modules.inform.bo.InformUserAddBo;
 import com.zhongzheng.modules.inform.domain.Inform;
 import com.zhongzheng.modules.inform.domain.InformUser;
 import com.zhongzheng.modules.inform.service.IInformRemindService;
 import com.zhongzheng.modules.inform.service.IInformService;
+import com.zhongzheng.modules.inform.service.IInformSysUserService;
 import com.zhongzheng.modules.inform.service.IInformUserService;
 import com.zhongzheng.modules.inform.vo.InformRemindVo;
 import com.zhongzheng.modules.inform.vo.InformVo;
@@ -101,12 +104,14 @@ import com.zhongzheng.modules.polyv.vo.PolyvVideoQuerVo;
 import com.zhongzheng.modules.polyv.vo.PolyvVideoVo;
 import com.zhongzheng.modules.polyv.vo.PolyvVo;
 import com.zhongzheng.modules.schedule.service.IScheduleService;
+import com.zhongzheng.modules.system.service.ISysUserService;
 import com.zhongzheng.modules.user.bo.*;
 import com.zhongzheng.modules.user.domain.*;
 import com.zhongzheng.modules.user.mapper.UserPlanMapper;
 import com.zhongzheng.modules.user.mapper.UserStudyRecordMapper;
 import com.zhongzheng.modules.user.service.*;
 import com.zhongzheng.modules.user.vo.*;
+import com.zhongzheng.modules.wx.service.IWxLoginService;
 import com.zhongzheng.modules.wx.service.IWxPayService;
 import net.polyv.live.v1.entity.channel.playback.LiveChannelVideoListResponse;
 import net.polyv.live.v1.entity.channel.playback.LiveListChannelSessionInfoResponse;
@@ -145,7 +150,6 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
     @Autowired
     private IProfileTpService iProfileTpService;
 
-
     @Autowired
     private OrderMapper orderMapper;
 
@@ -158,6 +162,9 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
     @Autowired
     private IInformUserService iInformUserService;
 
+    @Autowired
+    private IInformSysUserService iInformSysUserService;
+
     @Autowired
     private IOrderGoodsService iOrderGoodsService;
 
@@ -239,6 +246,9 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
     @Autowired
     private IMockApplyService iMockApplyService;
 
+    @Autowired
+    private ISysUserService iSysUserService;
+
     @Autowired
     private IUserMockSubscribeService iUserMockSubscribeService;
 
@@ -254,6 +264,9 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
     @Autowired
     private ICourseSubjectService iCourseSubjectService;
 
+    @Autowired
+    private IWxLoginService iWxLoginService;
+
     @Value("${aliyun.sms.OpenTheGoodsCode}")
     private String OpenTheGoodsCode;
 
@@ -278,6 +291,18 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
     @Value("${aliyun.sms.liveStartRemind}")
     private String liveStartRemind;
 
+    @Value("${aliyun.sms.buyNotStudyStudentRemind}")
+    private String buyNotStudyStudentRemind;
+
+    @Value("${aliyun.sms.buyNotStudyTeacherRemind}")
+    private String buyNotStudyTeacherRemind;
+
+    @Value("${aliyun.sms.longNotStudyStudentRemind}")
+    private String longNotStudyStudentRemind;
+
+    @Value("${aliyun.sms.longNotStudyTeacherRemind}")
+    private String longNotStudyTeacherRemind;
+
     @Override
     public String updateGoodsSend(UserQueryBo bo) {
         InformRemindVo informRemindVo = informRemindService.queryById(1L);
@@ -1545,6 +1570,473 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
 
     }
 
+    @Override
+    public void buyNotReadToStudentTwo(UserQueryBo bo) {
+        //购买2天未学提醒
+        Calendar cal1 = new GregorianCalendar();
+        cal1.add(Calendar.DATE, -3);
+        Long startTime = cal1.getTimeInMillis() / 1000;
+        Calendar cal2 = new GregorianCalendar();
+        cal2.add(Calendar.DATE, -2);
+        Long endTime = cal2.getTimeInMillis() / 1000;
+        //购买2天未学习
+        OrderQueryBo queryBo2 = new OrderQueryBo();
+        queryBo2.setStartTime(startTime);
+        queryBo2.setEndTime(endTime);
+        List<OrderGoodsVo> list2 = iOrderGoodsService.getBuyNotStudyList(queryBo2);
+        InformRemindVo informRemindVo = informRemindService.queryById(28L);
+        for(OrderGoodsVo goodsVo : list2){
+            GoodsVo goods = iGoodsService.queryById(goodsVo.getGoodsId());
+            if (!com.baomidou.mybatisplus.core.toolkit.CollectionUtils.isEmpty(informRemindVo.getInformRemindBusiness()) && !com.baomidou.mybatisplus.core.toolkit.CollectionUtils.isEmpty(informRemindVo.getInformRemindBusiness().stream().filter(informRemindBusinessVo -> informRemindBusinessVo.getBusinessId().equals(goods.getBusinessId())).collect(Collectors.toList()))) {
+                UserVo userVo = iUserService.queryById(goodsVo.getUserId());
+                if (informRemindVo.getWayStatus().equals(1))  {
+                    InformUserAddBo informUserAddBo = new InformUserAddBo();
+                    informUserAddBo.setUserId(goodsVo.getUserId());
+                    informUserAddBo.setSendStatus(1);
+                    informUserAddBo.setSendTime(DateUtils.getNowTime());
+                    informUserAddBo.setCreateTime(DateUtils.getNowTime());
+                    informUserAddBo.setUpdateTime(DateUtils.getNowTime());
+                    informUserAddBo.setRemindId(28L);
+                    informUserAddBo.setSystemStatus(1);
+                    informUserAddBo.setGradeId(goodsVo.getGradeId());
+                    informUserAddBo.setOrderGoodsId(goodsVo.getOrderGoodsId());
+                    informUserAddBo.setRemind("您新开通的课程已有2天,尽快去学习吧");
+                    informUserAddBo.setGoodsId(goodsVo.getGoodsId());
+                    informUserAddBo.setText("您开通《"+goods.getGoodsName()+"》课程已有2天,但未开始学习,请尽快去学习吧。");
+                    iInformUserService.insertByAddBo(informUserAddBo);
+                }
+                if (informRemindVo.getNoteStatus().equals(1)) {
+                    InformUserAddBo informUserAddBo = new InformUserAddBo();
+                    informUserAddBo.setUserId(goodsVo.getUserId());
+                    informUserAddBo.setSendStatus(1);
+                    informUserAddBo.setSendTime(DateUtils.getNowTime());
+                    informUserAddBo.setCreateTime(DateUtils.getNowTime());
+                    informUserAddBo.setUpdateTime(DateUtils.getNowTime());
+                    informUserAddBo.setRemindId(28L);
+                    informUserAddBo.setSystemStatus(3);
+                    informUserAddBo.setOrderGoodsId(goodsVo.getOrderGoodsId());
+                    informUserAddBo.setGradeId(goodsVo.getGradeId());
+                    informUserAddBo.setRemind("您新开通的课程已有2天,尽快去学习吧");
+                    informUserAddBo.setGoodsId(goodsVo.getGoodsId());
+                    informUserAddBo.setText("您开通《"+goods.getGoodsName()+"》课程已有2天,但未开始学习,请尽快去学习吧。");
+                    Map<String, Object> param = new HashMap<>();
+                    param.put("goodsName", goods.getGoodsName());
+                    param.put("day", "2");
+                    if (Validator.isNotEmpty(IAliSmsService.sendInformSms(userVo.getTelphone(), JSON.toJSONString(param), buyNotStudyStudentRemind))) {
+                        iInformUserService.insertByAddBo(informUserAddBo);
+                    }
+                }
+                if (informRemindVo.getGzhTpStatus().equals(1)) {
+                    InformUserAddBo informUserAddBo = new InformUserAddBo();
+                    informUserAddBo.setUserId(goodsVo.getUserId());
+                    informUserAddBo.setSendStatus(1);
+                    informUserAddBo.setSendTime(DateUtils.getNowTime());
+                    informUserAddBo.setCreateTime(DateUtils.getNowTime());
+                    informUserAddBo.setUpdateTime(DateUtils.getNowTime());
+                    informUserAddBo.setGradeId(goodsVo.getGradeId());
+                    informUserAddBo.setRemindId(28L);
+                    informUserAddBo.setSystemStatus(4);
+                    informUserAddBo.setOrderGoodsId(goodsVo.getOrderGoodsId());
+                    informUserAddBo.setRemind("您新开通的课程已有2天,尽快去学习吧");
+                    informUserAddBo.setGoodsId(goodsVo.getGoodsId());
+                    informUserAddBo.setText("您开通《"+goods.getGoodsName()+"》课程已有2天,但未开始学习,请尽快去学习吧。");
+                    iInformUserService.insertByAddBo(informUserAddBo);
+                    if(Validator.isNotEmpty(userVo.getOpenId())){
+                        Map<String,String> paramMap = new HashMap<>();
+                        paramMap.put("first","您新开通的课程已超过2天没有学习,请合理安排学习时间!");
+                        paramMap.put("keyword1",goods.getGoodsName());
+                        paramMap.put("keyword2","未开始学习");
+                        paramMap.put("pagepath","pages2/wd/course?id="+goodsVo.getGoodsId()+"&gid="+goodsVo.getGradeId()+"&orderGoodsId="+goodsVo.getOrderGoodsId());
+                        iWxLoginService.sendSmallTpMsg(userVo.getOpenId(),paramMap);
+                    }
+                }
+            }
+        }
+    }
+
+    @Override
+    public void buyNotReadToStudentFive(UserQueryBo bo) {
+        //购买5天未学提醒
+        Calendar cal1 = new GregorianCalendar();
+        cal1.add(Calendar.DATE, -6);
+        Long startTime = cal1.getTimeInMillis() / 1000;
+        Calendar cal2 = new GregorianCalendar();
+        cal2.add(Calendar.DATE, -5);
+        Long endTime = cal2.getTimeInMillis() / 1000;
+        //购买5天未学习
+        OrderQueryBo queryBo2 = new OrderQueryBo();
+        queryBo2.setStartTime(startTime);
+        queryBo2.setEndTime(endTime);
+        List<OrderGoodsVo> list2 = iOrderGoodsService.getBuyNotStudyList(queryBo2);
+        InformRemindVo informRemindVo = informRemindService.queryById(29L);
+        for(OrderGoodsVo goodsVo : list2){
+            GoodsVo goods = iGoodsService.queryById(goodsVo.getGoodsId());
+            if (!com.baomidou.mybatisplus.core.toolkit.CollectionUtils.isEmpty(informRemindVo.getInformRemindBusiness()) && !com.baomidou.mybatisplus.core.toolkit.CollectionUtils.isEmpty(informRemindVo.getInformRemindBusiness().stream().filter(informRemindBusinessVo -> informRemindBusinessVo.getBusinessId().equals(goods.getBusinessId())).collect(Collectors.toList()))) {
+                UserVo userVo = iUserService.queryById(goodsVo.getUserId());
+                if (informRemindVo.getWayStatus().equals(1))  {
+                    InformUserAddBo informUserAddBo = new InformUserAddBo();
+                    informUserAddBo.setUserId(goodsVo.getUserId());
+                    informUserAddBo.setSendStatus(1);
+                    informUserAddBo.setSendTime(DateUtils.getNowTime());
+                    informUserAddBo.setCreateTime(DateUtils.getNowTime());
+                    informUserAddBo.setUpdateTime(DateUtils.getNowTime());
+                    informUserAddBo.setRemindId(29L);
+                    informUserAddBo.setGradeId(goodsVo.getGradeId());
+                    informUserAddBo.setSystemStatus(1);
+                    informUserAddBo.setOrderGoodsId(goodsVo.getOrderGoodsId());
+                    informUserAddBo.setRemind("您新开通的课程已有5天,尽快去学习吧");
+                    informUserAddBo.setGoodsId(goodsVo.getGoodsId());
+                    informUserAddBo.setText("您开通《"+goods.getGoodsName()+"》课程已有5天,但未开始学习,请尽快去学习吧。");
+                    iInformUserService.insertByAddBo(informUserAddBo);
+                }
+                if (informRemindVo.getNoteStatus().equals(1)) {
+                    InformUserAddBo informUserAddBo = new InformUserAddBo();
+                    informUserAddBo.setUserId(goodsVo.getUserId());
+                    informUserAddBo.setSendStatus(1);
+                    informUserAddBo.setSendTime(DateUtils.getNowTime());
+                    informUserAddBo.setCreateTime(DateUtils.getNowTime());
+                    informUserAddBo.setUpdateTime(DateUtils.getNowTime());
+                    informUserAddBo.setRemindId(29L);
+                    informUserAddBo.setGradeId(goodsVo.getGradeId());
+                    informUserAddBo.setSystemStatus(3);
+                    informUserAddBo.setOrderGoodsId(goodsVo.getOrderGoodsId());
+                    informUserAddBo.setRemind("您新开通的课程已有5天,尽快去学习吧");
+                    informUserAddBo.setGoodsId(goodsVo.getGoodsId());
+                    informUserAddBo.setText("您开通《"+goods.getGoodsName()+"》课程已有5天,但未开始学习,请尽快去学习吧。");
+                    Map<String, Object> param = new HashMap<>();
+                    param.put("goodsName", goods.getGoodsName());
+                    param.put("day", "5");
+                    if (Validator.isNotEmpty(IAliSmsService.sendInformSms(userVo.getTelphone(), JSON.toJSONString(param), buyNotStudyStudentRemind))) {
+                        iInformUserService.insertByAddBo(informUserAddBo);
+                    }
+                }
+                if (informRemindVo.getGzhTpStatus().equals(1)) {
+                    InformUserAddBo informUserAddBo = new InformUserAddBo();
+                    informUserAddBo.setUserId(goodsVo.getUserId());
+                    informUserAddBo.setSendStatus(1);
+                    informUserAddBo.setSendTime(DateUtils.getNowTime());
+                    informUserAddBo.setCreateTime(DateUtils.getNowTime());
+                    informUserAddBo.setUpdateTime(DateUtils.getNowTime());
+                    informUserAddBo.setRemindId(29L);
+                    informUserAddBo.setGradeId(goodsVo.getGradeId());
+                    informUserAddBo.setSystemStatus(4);
+                    informUserAddBo.setOrderGoodsId(goodsVo.getOrderGoodsId());
+                    informUserAddBo.setRemind("您新开通的课程已有5天,尽快去学习吧");
+                    informUserAddBo.setGoodsId(goodsVo.getGoodsId());
+                    informUserAddBo.setText("您开通《"+goods.getGoodsName()+"》课程已有5天,但未开始学习,请尽快去学习吧。");
+                    iInformUserService.insertByAddBo(informUserAddBo);
+                    if(Validator.isNotEmpty(userVo.getOpenId())){
+                        Map<String,String> paramMap = new HashMap<>();
+                        paramMap.put("first","您新开通的课程已超过5天没有学习,请合理安排学习时间!");
+                        paramMap.put("keyword1",goods.getGoodsName());
+                        paramMap.put("keyword2","未开始学习");
+                        paramMap.put("pagepath","pages2/wd/course?id="+goodsVo.getGoodsId()+"&gid="+goodsVo.getGradeId()+"&orderGoodsId="+goodsVo.getOrderGoodsId());
+                        iWxLoginService.sendSmallTpMsg(userVo.getOpenId(),paramMap);
+                    }
+                }
+            }
+        }
+    }
+
+    @Override
+    public void buyNotReadToTeacher(UserQueryBo bo) {
+        //购买7天未学教务提醒
+        Calendar cal1 = new GregorianCalendar();
+        cal1.add(Calendar.DATE, -8);
+        Long startTime = cal1.getTimeInMillis() / 1000;
+        Calendar cal2 = new GregorianCalendar();
+        cal2.add(Calendar.DATE, -7);
+        Long endTime = cal2.getTimeInMillis() / 1000;
+        //购买5天未学习
+        OrderQueryBo queryBo2 = new OrderQueryBo();
+        queryBo2.setStartTime(startTime);
+        queryBo2.setEndTime(endTime);
+        List<OrderGoodsVo> list2 = iOrderGoodsService.getBuyNotStudyList(queryBo2);
+        InformRemindVo informRemindVo = informRemindService.queryById(30L);
+        for(OrderGoodsVo goodsVo : list2){
+            if(Validator.isEmpty(goodsVo.getSysUserId())){
+                continue;
+            }
+            GoodsVo goods = iGoodsService.queryById(goodsVo.getGoodsId());
+            if (!com.baomidou.mybatisplus.core.toolkit.CollectionUtils.isEmpty(informRemindVo.getInformRemindBusiness()) && !com.baomidou.mybatisplus.core.toolkit.CollectionUtils.isEmpty(informRemindVo.getInformRemindBusiness().stream().filter(informRemindBusinessVo -> informRemindBusinessVo.getBusinessId().equals(goods.getBusinessId())).collect(Collectors.toList()))) {
+                UserVo userVo = iUserService.queryById(goodsVo.getUserId());//学生
+                SysUser teacher = iSysUserService.selectUserById(goodsVo.getSysUserId());//教务信息
+                if (informRemindVo.getWayStatus().equals(1))  {
+                    InformSysUserAddBo informUserAddBo = new InformSysUserAddBo();
+                    informUserAddBo.setUserId(teacher.getUserId());
+                    informUserAddBo.setSendStatus(1);
+                    informUserAddBo.setSendTime(DateUtils.getNowTime());
+                    informUserAddBo.setCreateTime(DateUtils.getNowTime());
+                    informUserAddBo.setUpdateTime(DateUtils.getNowTime());
+                    informUserAddBo.setRemindId(30L);
+                    informUserAddBo.setGradeId(goodsVo.getGradeId());
+                    informUserAddBo.setSystemStatus(1);
+                    informUserAddBo.setOrderGoodsId(goodsVo.getOrderGoodsId());
+                    informUserAddBo.setRemind("学员学习提醒,请尽快处理");
+                    informUserAddBo.setGoodsId(goodsVo.getGoodsId());
+                    informUserAddBo.setText("学员"+userVo.getRealname()+",开通《"+goods.getGoodsName()+"》课程已有7天,但未开始学习,请尽快与学员沟通情况。");
+                    iInformSysUserService.insertByAddBo(informUserAddBo);
+                }
+                if (informRemindVo.getNoteStatus().equals(1)) {
+                    InformSysUserAddBo informUserAddBo = new InformSysUserAddBo();
+                    informUserAddBo.setUserId(teacher.getUserId());
+                    informUserAddBo.setSendStatus(1);
+                    informUserAddBo.setSendTime(DateUtils.getNowTime());
+                    informUserAddBo.setCreateTime(DateUtils.getNowTime());
+                    informUserAddBo.setUpdateTime(DateUtils.getNowTime());
+                    informUserAddBo.setRemindId(30L);
+                    informUserAddBo.setGradeId(goodsVo.getGradeId());
+                    informUserAddBo.setSystemStatus(3);
+                    informUserAddBo.setOrderGoodsId(goodsVo.getOrderGoodsId());
+                    informUserAddBo.setRemind("学员学习提醒,请尽快处理");
+                    informUserAddBo.setGoodsId(goodsVo.getGoodsId());
+                    informUserAddBo.setText("学员"+userVo.getRealname()+",开通《"+goods.getGoodsName()+"》课程已有7天,但未开始学习,请尽快与学员沟通情况。");
+                    Map<String, Object> param = new HashMap<>();
+                    param.put("name", userVo.getRealname());
+                    param.put("goodsName", goods.getGoodsName());
+                    param.put("day", "7");
+                    if(Validator.isNotEmpty(teacher.getPhonenumber())){
+                        if (Validator.isNotEmpty(IAliSmsService.sendInformSms(teacher.getPhonenumber(), JSON.toJSONString(param), buyNotStudyTeacherRemind))) {
+                            iInformSysUserService.insertByAddBo(informUserAddBo);
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+    @Override
+    public void longNotReadToStudentThree(UserQueryBo bo) {
+        //3天未学提醒
+        Calendar cal1 = new GregorianCalendar();
+        cal1.add(Calendar.DATE, -4);
+        Long startTime = cal1.getTimeInMillis() / 1000;
+        Calendar cal2 = new GregorianCalendar();
+        cal2.add(Calendar.DATE, -3);
+        Long endTime = cal2.getTimeInMillis() / 1000;
+        OrderQueryBo queryBo2 = new OrderQueryBo();
+        queryBo2.setStartTime(startTime);
+        queryBo2.setEndTime(endTime);
+        List<OrderGoodsVo> list2 = iOrderGoodsService.getLongNotStudyList(queryBo2);
+        InformRemindVo informRemindVo = informRemindService.queryById(31L);
+        for(OrderGoodsVo goodsVo : list2){
+            GoodsVo goods = iGoodsService.queryById(goodsVo.getGoodsId());
+            if (!com.baomidou.mybatisplus.core.toolkit.CollectionUtils.isEmpty(informRemindVo.getInformRemindBusiness()) && !com.baomidou.mybatisplus.core.toolkit.CollectionUtils.isEmpty(informRemindVo.getInformRemindBusiness().stream().filter(informRemindBusinessVo -> informRemindBusinessVo.getBusinessId().equals(goods.getBusinessId())).collect(Collectors.toList()))) {
+                UserVo userVo = iUserService.queryById(goodsVo.getUserId());
+                if (informRemindVo.getWayStatus().equals(1))  {
+                    InformUserAddBo informUserAddBo = new InformUserAddBo();
+                    informUserAddBo.setUserId(goodsVo.getUserId());
+                    informUserAddBo.setSendStatus(1);
+                    informUserAddBo.setSendTime(DateUtils.getNowTime());
+                    informUserAddBo.setCreateTime(DateUtils.getNowTime());
+                    informUserAddBo.setUpdateTime(DateUtils.getNowTime());
+                    informUserAddBo.setRemindId(31L);
+                    informUserAddBo.setGradeId(goodsVo.getGradeId());
+                    informUserAddBo.setSystemStatus(1);
+                    informUserAddBo.setOrderGoodsId(goodsVo.getOrderGoodsId());
+                    informUserAddBo.setRemind("您已超过3天没有学习课程,尽快去学习吧");
+                    informUserAddBo.setGoodsId(goodsVo.getGoodsId());
+                    informUserAddBo.setText("您已超过3天没有学习《"+goods.getGoodsName()+"》课程,为了您的学习效果,请尽快去学习吧。");
+                    iInformUserService.insertByAddBo(informUserAddBo);
+                }
+                if (informRemindVo.getNoteStatus().equals(1)) {
+                    InformUserAddBo informUserAddBo = new InformUserAddBo();
+                    informUserAddBo.setUserId(goodsVo.getUserId());
+                    informUserAddBo.setSendStatus(1);
+                    informUserAddBo.setSendTime(DateUtils.getNowTime());
+                    informUserAddBo.setCreateTime(DateUtils.getNowTime());
+                    informUserAddBo.setUpdateTime(DateUtils.getNowTime());
+                    informUserAddBo.setRemindId(31L);
+                    informUserAddBo.setGradeId(goodsVo.getGradeId());
+                    informUserAddBo.setSystemStatus(3);
+                    informUserAddBo.setOrderGoodsId(goodsVo.getOrderGoodsId());
+                    informUserAddBo.setRemind("您已超过3天没有学习课程,尽快去学习吧");
+                    informUserAddBo.setGoodsId(goodsVo.getGoodsId());
+                    informUserAddBo.setText("您已超过3天没有学习《"+goods.getGoodsName()+"》课程,为了您的学习效果,请尽快去学习吧。");
+                    Map<String, Object> param = new HashMap<>();
+                    param.put("goodsName", goods.getGoodsName());
+                    param.put("day", "3");
+                    if (Validator.isNotEmpty(IAliSmsService.sendInformSms(userVo.getTelphone(), JSON.toJSONString(param), longNotStudyStudentRemind))) {
+                        iInformUserService.insertByAddBo(informUserAddBo);
+                    }
+                }
+                if (informRemindVo.getGzhTpStatus().equals(1)) {
+                    InformUserAddBo informUserAddBo = new InformUserAddBo();
+                    informUserAddBo.setUserId(goodsVo.getUserId());
+                    informUserAddBo.setSendStatus(1);
+                    informUserAddBo.setSendTime(DateUtils.getNowTime());
+                    informUserAddBo.setCreateTime(DateUtils.getNowTime());
+                    informUserAddBo.setUpdateTime(DateUtils.getNowTime());
+                    informUserAddBo.setRemindId(31L);
+                    informUserAddBo.setGradeId(goodsVo.getGradeId());
+                    informUserAddBo.setSystemStatus(4);
+                    informUserAddBo.setOrderGoodsId(goodsVo.getOrderGoodsId());
+                    informUserAddBo.setRemind("您已超过3天没有学习课程,尽快去学习吧");
+                    informUserAddBo.setGoodsId(goodsVo.getGoodsId());
+                    informUserAddBo.setText("您已超过3天没有学习《"+goods.getGoodsName()+"》课程,为了您的学习效果,请尽快去学习吧。");
+                    iInformUserService.insertByAddBo(informUserAddBo);
+                    if(Validator.isNotEmpty(userVo.getOpenId())){
+                        Map<String,String> paramMap = new HashMap<>();
+                        paramMap.put("first","您已超过3天没有学习,请合理安排学习时间!");
+                        paramMap.put("keyword1",goods.getGoodsName());
+                        paramMap.put("keyword2","已超过3天没有学习");
+                        paramMap.put("pagepath","pages2/wd/course?id="+goodsVo.getGoodsId()+"&gid="+goodsVo.getGradeId()+"&orderGoodsId="+goodsVo.getOrderGoodsId());
+                        iWxLoginService.sendSmallTpMsg(userVo.getOpenId(),paramMap);
+                    }
+                }
+            }
+        }
+    }
+
+    @Override
+    public void longNotReadToStudentFive(UserQueryBo bo) {
+        //5天未学提醒
+        Calendar cal1 = new GregorianCalendar();
+        cal1.add(Calendar.DATE, -6);
+        Long startTime = cal1.getTimeInMillis() / 1000;
+        Calendar cal2 = new GregorianCalendar();
+        cal2.add(Calendar.DATE, -5);
+        Long endTime = cal2.getTimeInMillis() / 1000;
+        OrderQueryBo queryBo2 = new OrderQueryBo();
+        queryBo2.setStartTime(startTime);
+        queryBo2.setEndTime(endTime);
+        List<OrderGoodsVo> list2 = iOrderGoodsService.getLongNotStudyList(queryBo2);
+        InformRemindVo informRemindVo = informRemindService.queryById(32L);
+        for(OrderGoodsVo goodsVo : list2){
+            GoodsVo goods = iGoodsService.queryById(goodsVo.getGoodsId());
+            if (!com.baomidou.mybatisplus.core.toolkit.CollectionUtils.isEmpty(informRemindVo.getInformRemindBusiness()) && !com.baomidou.mybatisplus.core.toolkit.CollectionUtils.isEmpty(informRemindVo.getInformRemindBusiness().stream().filter(informRemindBusinessVo -> informRemindBusinessVo.getBusinessId().equals(goods.getBusinessId())).collect(Collectors.toList()))) {
+                UserVo userVo = iUserService.queryById(goodsVo.getUserId());
+                if (informRemindVo.getWayStatus().equals(1))  {
+                    InformUserAddBo informUserAddBo = new InformUserAddBo();
+                    informUserAddBo.setUserId(goodsVo.getUserId());
+                    informUserAddBo.setSendStatus(1);
+                    informUserAddBo.setSendTime(DateUtils.getNowTime());
+                    informUserAddBo.setCreateTime(DateUtils.getNowTime());
+                    informUserAddBo.setUpdateTime(DateUtils.getNowTime());
+                    informUserAddBo.setRemindId(32L);
+                    informUserAddBo.setGradeId(goodsVo.getGradeId());
+                    informUserAddBo.setSystemStatus(1);
+                    informUserAddBo.setOrderGoodsId(goodsVo.getOrderGoodsId());
+                    informUserAddBo.setRemind("您已超过5天没有学习课程,尽快去学习吧");
+                    informUserAddBo.setGoodsId(goodsVo.getGoodsId());
+                    informUserAddBo.setText("您已超过5天没有学习《"+goods.getGoodsName()+"》课程,为了您的学习效果,请尽快去学习吧。");
+                    iInformUserService.insertByAddBo(informUserAddBo);
+                }
+                if (informRemindVo.getNoteStatus().equals(1)) {
+                    InformUserAddBo informUserAddBo = new InformUserAddBo();
+                    informUserAddBo.setUserId(goodsVo.getUserId());
+                    informUserAddBo.setSendStatus(1);
+                    informUserAddBo.setSendTime(DateUtils.getNowTime());
+                    informUserAddBo.setCreateTime(DateUtils.getNowTime());
+                    informUserAddBo.setUpdateTime(DateUtils.getNowTime());
+                    informUserAddBo.setRemindId(32L);
+                    informUserAddBo.setGradeId(goodsVo.getGradeId());
+                    informUserAddBo.setSystemStatus(3);
+                    informUserAddBo.setOrderGoodsId(goodsVo.getOrderGoodsId());
+                    informUserAddBo.setRemind("您已超过5天没有学习课程,尽快去学习吧");
+                    informUserAddBo.setGoodsId(goodsVo.getGoodsId());
+                    informUserAddBo.setText("您已超过5天没有学习《"+goods.getGoodsName()+"》课程,为了您的学习效果,请尽快去学习吧。");
+                    Map<String, Object> param = new HashMap<>();
+                    param.put("goodsName", goods.getGoodsName());
+                    param.put("day", "5");
+                    if (Validator.isNotEmpty(IAliSmsService.sendInformSms(userVo.getTelphone(), JSON.toJSONString(param), longNotStudyStudentRemind))) {
+                        iInformUserService.insertByAddBo(informUserAddBo);
+                    }
+                }
+                if (informRemindVo.getGzhTpStatus().equals(1)) {
+                    InformUserAddBo informUserAddBo = new InformUserAddBo();
+                    informUserAddBo.setUserId(goodsVo.getUserId());
+                    informUserAddBo.setSendStatus(1);
+                    informUserAddBo.setSendTime(DateUtils.getNowTime());
+                    informUserAddBo.setCreateTime(DateUtils.getNowTime());
+                    informUserAddBo.setUpdateTime(DateUtils.getNowTime());
+                    informUserAddBo.setRemindId(32L);
+                    informUserAddBo.setSystemStatus(4);
+                    informUserAddBo.setOrderGoodsId(goodsVo.getOrderGoodsId());
+                    informUserAddBo.setRemind("您已超过5天没有学习课程,尽快去学习吧");
+                    informUserAddBo.setGoodsId(goodsVo.getGoodsId());
+                    informUserAddBo.setText("您已超过5天没有学习《"+goods.getGoodsName()+"》课程,为了您的学习效果,请尽快去学习吧。");
+                    iInformUserService.insertByAddBo(informUserAddBo);
+                    if(Validator.isNotEmpty(userVo.getOpenId())){
+                        Map<String,String> paramMap = new HashMap<>();
+                        paramMap.put("first","您已超过5天没有学习,请合理安排学习时间!");
+                        paramMap.put("keyword1",goods.getGoodsName());
+                        paramMap.put("keyword2","已超过5天没有学习");
+                        paramMap.put("pagepath","pages2/wd/course?id="+goodsVo.getGoodsId()+"&gid="+goodsVo.getGradeId()+"&orderGoodsId="+goodsVo.getOrderGoodsId());
+                        iWxLoginService.sendSmallTpMsg(userVo.getOpenId(),paramMap);
+                    }
+                }
+            }
+        }
+    }
+
+    @Override
+    public void longNotReadToTeacher(UserQueryBo bo) {
+        //购买7天未学教务提醒
+        Calendar cal1 = new GregorianCalendar();
+        cal1.add(Calendar.DATE, -8);
+        Long startTime = cal1.getTimeInMillis() / 1000;
+        Calendar cal2 = new GregorianCalendar();
+        cal2.add(Calendar.DATE, -7);
+        Long endTime = cal2.getTimeInMillis() / 1000;
+        //购买5天未学习
+        OrderQueryBo queryBo2 = new OrderQueryBo();
+        queryBo2.setStartTime(startTime);
+        queryBo2.setEndTime(endTime);
+        List<OrderGoodsVo> list2 = iOrderGoodsService.getLongNotStudyList(queryBo2);
+        InformRemindVo informRemindVo = informRemindService.queryById(33L);
+        for(OrderGoodsVo goodsVo : list2){
+            if(Validator.isEmpty(goodsVo.getSysUserId())){
+                continue;
+            }
+            GoodsVo goods = iGoodsService.queryById(goodsVo.getGoodsId());
+            if (!com.baomidou.mybatisplus.core.toolkit.CollectionUtils.isEmpty(informRemindVo.getInformRemindBusiness()) && !com.baomidou.mybatisplus.core.toolkit.CollectionUtils.isEmpty(informRemindVo.getInformRemindBusiness().stream().filter(informRemindBusinessVo -> informRemindBusinessVo.getBusinessId().equals(goods.getBusinessId())).collect(Collectors.toList()))) {
+                UserVo userVo = iUserService.queryById(goodsVo.getUserId());//学生
+                SysUser teacher = iSysUserService.selectUserById(goodsVo.getSysUserId());//教务信息
+                if (informRemindVo.getWayStatus().equals(1))  {
+                    InformSysUserAddBo informUserAddBo = new InformSysUserAddBo();
+                    informUserAddBo.setUserId(teacher.getUserId());
+                    informUserAddBo.setSendStatus(1);
+                    informUserAddBo.setSendTime(DateUtils.getNowTime());
+                    informUserAddBo.setCreateTime(DateUtils.getNowTime());
+                    informUserAddBo.setUpdateTime(DateUtils.getNowTime());
+                    informUserAddBo.setRemindId(33L);
+                    informUserAddBo.setGradeId(goodsVo.getGradeId());
+                    informUserAddBo.setSystemStatus(1);
+                    informUserAddBo.setOrderGoodsId(goodsVo.getOrderGoodsId());
+                    informUserAddBo.setRemind("学员学习提醒,请尽快处理");
+                    informUserAddBo.setGoodsId(goodsVo.getGoodsId());
+                    informUserAddBo.setText("学员"+userVo.getRealname()+",已超过7天没有学习《"+goods.getGoodsName()+"》课程,请尽快与学员沟通情况。");
+                    iInformSysUserService.insertByAddBo(informUserAddBo);
+                }
+                if (informRemindVo.getNoteStatus().equals(1)) {
+                    InformSysUserAddBo informUserAddBo = new InformSysUserAddBo();
+                    informUserAddBo.setUserId(teacher.getUserId());
+                    informUserAddBo.setSendStatus(1);
+                    informUserAddBo.setSendTime(DateUtils.getNowTime());
+                    informUserAddBo.setCreateTime(DateUtils.getNowTime());
+                    informUserAddBo.setUpdateTime(DateUtils.getNowTime());
+                    informUserAddBo.setRemindId(33L);
+                    informUserAddBo.setGradeId(goodsVo.getGradeId());
+                    informUserAddBo.setSystemStatus(3);
+                    informUserAddBo.setOrderGoodsId(goodsVo.getOrderGoodsId());
+                    informUserAddBo.setRemind("学员学习提醒,请尽快处理");
+                    informUserAddBo.setGoodsId(goodsVo.getGoodsId());
+                    informUserAddBo.setText("学员"+userVo.getRealname()+",已超过7天没有学习《"+goods.getGoodsName()+"》课程,请尽快与学员沟通情况。");
+                    Map<String, Object> param = new HashMap<>();
+                    param.put("goodsName", goods.getGoodsName());
+                    param.put("day", "7");
+                    param.put("name", userVo.getRealname());
+                    if(Validator.isNotEmpty(teacher.getPhonenumber())){
+                        if (Validator.isNotEmpty(IAliSmsService.sendInformSms(teacher.getPhonenumber(), JSON.toJSONString(param), longNotStudyTeacherRemind))) {
+                            iInformSysUserService.insertByAddBo(informUserAddBo);
+                        }
+                    }
+                }
+            }
+        }
+    }
+
     private Long formatTime(Long startTime, String addTime) throws ParseException{
         Long times = startTime*1000;//时间戳
         SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");

+ 7 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/IUserWxFollowService.java

@@ -25,7 +25,9 @@ public interface IUserWxFollowService extends IService<UserWxFollow> {
 	 * 查询单个
 	 * @return
 	 */
-	UserWxFollowVo queryById(String unionId);
+	UserWxFollowVo queryById(String id);
+
+	UserWxFollow queryByUnionId(String unionId);
 
 	/**
 	 * 查询列表
@@ -60,5 +62,8 @@ public interface IUserWxFollowService extends IService<UserWxFollow> {
 	 */
 	Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
 
-	public void updateInfofor(UserWxFollow userWxFollow);
+	void updateInfofor(UserWxFollow userWxFollow);
+
+	Boolean unsubGzh(String openId);
+
 }

+ 12 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserWxFollowServiceImpl.java

@@ -4,9 +4,11 @@ import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.zhongzheng.common.utils.DateUtils;
+import com.zhongzheng.modules.course.domain.CourseChapterBusiness;
 import com.zhongzheng.modules.user.bo.UserWxFollowAddBo;
 import com.zhongzheng.modules.user.bo.UserWxFollowEditBo;
 import com.zhongzheng.modules.user.bo.UserWxFollowQueryBo;
+import com.zhongzheng.modules.user.domain.User;
 import com.zhongzheng.modules.user.domain.UserWxFollow;
 import com.zhongzheng.modules.user.mapper.UserWxFollowMapper;
 import com.zhongzheng.modules.user.service.IUserWxFollowService;
@@ -41,6 +43,11 @@ public class UserWxFollowServiceImpl extends ServiceImpl<UserWxFollowMapper, Use
         return BeanUtil.toBean(db, UserWxFollowVo.class);
     }
 
+    @Override
+    public UserWxFollow queryByUnionId(String unionId) {
+        return getOne(new LambdaQueryWrapper<UserWxFollow>().eq(UserWxFollow::getUnionId, unionId).last("limit 1"));
+    }
+
     @Override
     public List<UserWxFollowVo> queryList(UserWxFollowQueryBo bo) {
         LambdaQueryWrapper<UserWxFollow> lqw = Wrappers.lambdaQuery();
@@ -153,4 +160,9 @@ public class UserWxFollowServiceImpl extends ServiceImpl<UserWxFollowMapper, Use
         userWxFollow.setUpdateTime(DateUtils.getNowTime());
         updateById(userWxFollow);
     }
+
+    @Override
+    public Boolean unsubGzh(String openId) {
+        return remove(new LambdaQueryWrapper<UserWxFollow>().eq(UserWxFollow::getGzhOpenId, openId));
+    }
 }

+ 23 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/wx/bo/TemplatData.java

@@ -0,0 +1,23 @@
+package com.zhongzheng.modules.wx.bo;
+
+public class TemplatData {
+    private String value;
+    private String color;
+
+    public String getValue() {
+        return value;
+    }
+
+    public void setValue(String value) {
+        this.value = value;
+    }
+
+    public String getColor() {
+        return color;
+    }
+
+    public void setColor(String color) {
+        this.color = color;
+    }
+
+}

+ 39 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/wx/bo/WxServerBody.java

@@ -0,0 +1,39 @@
+package com.zhongzheng.modules.wx.bo;
+
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import lombok.experimental.Accessors;
+
+/**
+ * 微信登录
+ *
+ * @author hjl
+ * @date 2021-06-11
+ */
+
+@ApiModel("登录用户")
+@Data
+@NoArgsConstructor
+@Accessors(chain = true)
+public class WxServerBody {
+
+
+    @ApiModelProperty("signature")
+    private String signature;
+
+
+    @ApiModelProperty("timestamp")
+    private String timestamp;
+
+
+    @ApiModelProperty("nonce")
+    private String nonce;
+
+    @ApiModelProperty("echostr")
+    private String echostr;
+
+
+}

+ 39 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/wx/domain/AllMessage.java

@@ -0,0 +1,39 @@
+package com.zhongzheng.modules.wx.domain;
+
+import lombok.Data;
+
+@Data
+public class AllMessage {
+    /**
+     * 属性名首字母大写的原因是因为返回的xml中标签的名称是需要大写的,否则微信解析不了
+     */
+    private String ToUserName;  // 接收方账号
+    private String FromUserName;  // 发送方账号
+    private long CreateTime;  // 消息创建时间 (整型)
+    private String MsgType;  // 消息类型
+    private String PicUrl;  // 消息内容
+    private String Content;  // 消息内容
+    private String MediaId;  // 消息媒体id,可以调用多媒体文件下载接口拉取数据。
+    private String Format;  // 语音格式,如amr,speex等
+    private String Recognition;  // 语音识别结果,UTF8编码
+    private String MsgId;  // 消息id,64位整型
+    private String ThumbMediaId;  // 视频消息缩略图的媒体id,可以调用多媒体文件下载接口拉取数据。
+    private String Location_X;  // 地理位置维度
+    private String Location_Y;  // 地理位置经度
+    private String Scale;  // 地图缩放大小
+    private String Label;  // 地理位置信息
+    private String Title;  // 消息标题
+    private String Description;  // 消息描述
+    private String Url;  // 消息链接
+    private String Event;  // 事件类型
+    private String EventKey; // 事件KEY值
+    private String Ticket;  // 二维码的ticket
+    private String MenuId; // 指菜单ID,如果是个性化菜单,则可以通过这个字段,知道是哪个规则的菜单被点击了
+    private ScanCodeInfo ScanCodeInfo;
+
+    // 扫描信息
+    public static class ScanCodeInfo {
+        private String ScanType;  // 扫描类型,一般是qrcode
+        private String ScanResult;  // 扫描结果,即二维码对应的字符串信息
+    }
+}

+ 14 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/wx/domain/ContentEnum.java

@@ -0,0 +1,14 @@
+package com.zhongzheng.modules.wx.domain;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+@AllArgsConstructor
+@Getter
+public enum ContentEnum {
+    CONTENT_SUBSCRIBE("你好,欢迎关注~"),
+    CONTENT_NONSUPPORT("暂不支持文本以外的消息回复!"),
+    CONTENT_PREFIX("你发送的消息是:"),
+    ;
+    private String content;
+}

+ 15 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/wx/domain/EventType.java

@@ -0,0 +1,15 @@
+package com.zhongzheng.modules.wx.domain;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+@Getter
+@AllArgsConstructor
+public enum EventType {
+
+    EVENT_SUBSCRIBE("subscribe"),  // 订阅事件类型
+    EVENT_UNSUBSCRIBE("unsubscribe"),  // 取消订阅事件类型
+    ;
+
+    private String eventType;
+}

+ 22 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/wx/domain/MessageTypeEnum.java

@@ -0,0 +1,22 @@
+package com.zhongzheng.modules.wx.domain;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+
+@Getter
+@AllArgsConstructor
+public enum MessageTypeEnum {
+
+    MSG_TEXT("text"),  // 文本消息类型
+    MSG_IMAGE("image"), // 图片消息类型
+    MSG_VOICE("voice"), // 语音消息类型
+    MSG_VIDEO("video"), // 视频消息类型
+    MSG_SHORTVIDEO("shortvideo"), // 小视频消息类型
+    MSG_LOCATION("location"), // 地理位置消息类型
+    MSG_LINK("link"), // 链接消息类型
+    MSG_EVENT("event"), // 事件消息类型
+    ;
+
+    private String msgType;
+}

+ 142 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/wx/domain/MessageUtil.java

@@ -0,0 +1,142 @@
+package com.zhongzheng.modules.wx.domain;
+
+import com.thoughtworks.xstream.XStream;
+import com.thoughtworks.xstream.security.NoTypePermission;
+import com.thoughtworks.xstream.security.NullPermission;
+import com.thoughtworks.xstream.security.PrimitiveTypePermission;
+import org.dom4j.Document;
+import org.dom4j.DocumentException;
+import org.dom4j.Element;
+import org.dom4j.io.SAXReader;
+
+import javax.servlet.http.HttpServletRequest;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.*;
+
+public class MessageUtil {
+    private final static String XML = "xml";
+
+    /**
+     * xml转换为map集合
+     *
+     * @param request
+     * @return
+     * @throws IOException
+     * @throws DocumentException
+     */
+    public static Map<String, String> xmlToMap(HttpServletRequest request) throws IOException, DocumentException {
+        Map<String, String> map = new HashMap<>();
+        SAXReader reader = new SAXReader();
+
+        InputStream inputStream = request.getInputStream();
+        Document document = reader.read(inputStream);
+
+        Element root = document.getRootElement();
+
+        List<Element> elementList = root.elements();
+
+        for (Element element : elementList) {
+            map.put(element.getName(), element.getText());
+        }
+        inputStream.close();
+
+        return map;
+    }
+
+    /**
+     * 将 AllMessage 消息对象,转换为xml
+     *
+     * @param allMessage
+     * @return
+     */
+    public static String allMessageToXml(AllMessage allMessage) {
+        XStream xStream = new XStream();
+        xStream.alias(XML, allMessage.getClass());
+
+        return xStream.toXML(allMessage);
+    }
+
+    /**
+     * 将 AllMessage 消息对象,转换为xml,并指定content的内容
+     *
+     * @param allMessage
+     * @return
+     */
+    public static String allMessageToXml(AllMessage allMessage, String content) {
+        allMessage.setContent(content);
+
+        return allMessageToXml(allMessage);
+    }
+
+    /**
+     * 将xml转换为 AllMessage消息对象
+     *
+     * @param xmlStr
+     * @return
+     */
+    public static AllMessage xmlToAllMessage(String xmlStr) {
+        XStream xStream = new XStream();
+        // clear out existing permissions and set own ones
+        xStream.addPermission(NoTypePermission.NONE);
+        // allow some basics
+        xStream.addPermission(NullPermission.NULL);
+        xStream.addPermission(PrimitiveTypePermission.PRIMITIVES);
+        xStream.allowTypeHierarchy(Collection.class);
+        // allow any type from the same package
+        xStream.allowTypesByWildcard(new String[] {
+                "com.zhongzheng.**"
+        });
+        AllMessage allMessage = new AllMessage();
+        xStream.aliasType(XML, allMessage.getClass());
+        allMessage = (AllMessage) xStream.fromXML(xmlStr);
+
+        return allMessage;
+    }
+
+    /**
+     * 将xml转换为 AllMessage 消息对象,并指定content的内容
+     *
+     * @param xmlStr
+     * @param content
+     * @return
+     */
+    public static AllMessage xmlToAllMessage(String xmlStr, String content) {
+        AllMessage allMessage = xmlToAllMessage(xmlStr);
+        allMessage.setContent(content);
+
+        return allMessage;
+    }
+
+    /**
+     * 设置并获取文本消息类型的 AllMessage 对象
+     * @param fromUserName
+     * @param toUserName
+     * @param content
+     * @return
+     */
+    public static AllMessage setGetTextMsg(String fromUserName, String toUserName, String content) {
+        AllMessage allMessage = new AllMessage();
+        allMessage.setFromUserName(toUserName);
+        allMessage.setToUserName(fromUserName);
+        allMessage.setMsgType(MessageTypeEnum.MSG_TEXT.getMsgType());
+        allMessage.setCreateTime(new Date().getTime());
+        allMessage.setContent(content);
+
+        return allMessage;
+    }
+
+    /**
+     * 自动回复
+     * @param allMessage
+     * @param content
+     * @return
+     */
+    public static String autoReply(AllMessage allMessage,String content) {
+        allMessage = setGetTextMsg(allMessage.getFromUserName(), allMessage.getToUserName(), content);
+
+        return allMessageToXml(allMessage);
+    }
+
+
+}

+ 48 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/wx/service/IWxLoginService.java

@@ -0,0 +1,48 @@
+package com.zhongzheng.modules.wx.service;
+
+
+import cn.hutool.core.lang.Validator;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.google.zxing.BarcodeFormat;
+import com.google.zxing.client.j2se.MatrixToImageWriter;
+import com.google.zxing.common.BitMatrix;
+import com.google.zxing.qrcode.QRCodeWriter;
+import com.zhongzheng.common.constant.Constants;
+import com.zhongzheng.common.core.redis.RedisCache;
+import com.zhongzheng.common.exception.CustomException;
+import com.zhongzheng.common.utils.*;
+import com.zhongzheng.common.utils.http.HttpUtils;
+import com.zhongzheng.common.utils.ip.IpUtils;
+import com.zhongzheng.modules.alisms.service.IAliSmsService;
+import com.zhongzheng.modules.user.bo.UserWxFollowAddBo;
+import com.zhongzheng.modules.user.domain.User;
+import com.zhongzheng.modules.user.entity.ClientLoginUser;
+import com.zhongzheng.modules.user.mapper.UserMapper;
+import com.zhongzheng.modules.user.service.IUserService;
+import com.zhongzheng.modules.user.service.IUserWxFollowService;
+import com.zhongzheng.modules.wx.bo.TemplatData;
+import com.zhongzheng.modules.wx.bo.WxLoginBody;
+import org.apache.commons.codec.binary.Base64;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.io.ByteArrayOutputStream;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+
+
+public interface IWxLoginService
+{
+    String sendSmallTpMsg(String openId,Map<String,String> paramMap);
+}

+ 0 - 4
zhongzheng-system/src/main/java/com/zhongzheng/modules/wx/service/impl/WxPayServiceImpl.java

@@ -191,9 +191,7 @@ public class WxPayServiceImpl implements IWxPayService {
             data.put("trade_type", "JSAPI");
             String TenantId = ServletUtils.getRequest().getHeader("TenantId");
             data.put("attach", TenantId);
-            System.out.println(data);
             Map<String, String> resp = wxpay.unifiedOrder(data);
-            System.out.println(resp);
             Map<String, String> result = new HashMap<>();
             //         result.put("provider","wxpay");
             result.put("appId", appid);
@@ -201,8 +199,6 @@ public class WxPayServiceImpl implements IWxPayService {
             result.put("nonceStr", resp.get("nonce_str"));
             result.put("package", "prepay_id=" + resp.get("prepay_id"));
             result.put("signType", "MD5");
-            System.out.println(result);
-            System.out.println(key);
             result.put("sign", WXPayUtil.generateSignature(result, key, WXPayConstants.SignType.MD5));
             return result;
         } catch (Exception e) {

+ 4 - 1
zhongzheng-system/src/main/resources/mapper/modules/activity/ActivityRecommendMapper.xml

@@ -31,6 +31,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="educationName" column="education_name"/>
         <result property="projectName" column="project_name"/>
         <result property="businessName" column="business_name"/>
+        <result property="majorId" column="major_id"/>
+        <result property="subjectIdList" column="subject_ids"/>
         <collection property="goodsList" column="recommend_id" select="findGoodsList"/>
     </resultMap>
 
@@ -84,7 +86,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="getDetail" parameterType="com.zhongzheng.modules.activity.bo.ActivityRecommendQueryBo" resultMap="ActivityRecommendVoResult">
         SELECT ar.*, cet.education_name,
                cpt.project_name,
-               cb.business_name from activity_recommend ar
+               cb.business_name
+               from activity_recommend ar
                                          LEFT JOIN course_education_type cet ON ar.education_type_id = cet.id
                                          LEFT JOIN course_project_type cpt ON ar.project_id = cpt.id
                                          LEFT JOIN course_business cb ON ar.business_id = cb.id

+ 0 - 1
zhongzheng-system/src/main/resources/mapper/modules/course/CourseBusinessMapper.xml

@@ -88,5 +88,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         order by b.sort
     </select>
 
-
 </mapper>

+ 12 - 0
zhongzheng-system/src/main/resources/mapper/modules/goods/GoodsMapper.xml

@@ -270,6 +270,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="subjectId != null and subjectId >0">
             AND FIND_IN_SET(#{subjectId},g.subject_ids)
         </if>
+        <if test="subjectIdList != null and subjectIdList.size > 0 ">
+            AND (
+            <foreach collection="subjectIdList" item="item" index="index">
+                <if test=" index == 0 ">
+                    FIND_IN_SET(#{item},g.subject_ids)
+                </if>
+                <if test=" index != 0 ">
+                    OR FIND_IN_SET(#{item},g.subject_ids)
+                </if>
+            </foreach>
+            )
+        </if>
         <if test="goodsType ==1 and haveCourse != null and haveCourse == 1">
             AND (SELECT count(*) from goods_course gc LEFT JOIN course c ON gc.course_id = c.course_id where gc.goods_id = g.goods_id and c.`status` = 1
             ) >0

+ 17 - 1
zhongzheng-system/src/main/resources/mapper/modules/inform/InformUserMapper.xml

@@ -149,6 +149,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             LIMIT 1
     </select>
     <select id="listMockApply" resultType="com.zhongzheng.modules.mock.vo.MockApplyVo">
-        
+
+    </select>
+
+    <select id="selectLastUnStudyMsg" parameterType="map" resultMap="InformUserVo">
+        SELECT
+            iu.*
+        FROM
+            inform_user iu
+        where 1=1
+          and iu.user_id = #{userId}
+          and iu.receipt_status = 0
+          and iu.`status` =1
+          and iu.system_status = 1
+          and iu.remind_id in (28,29,31,32)
+        and iu.create_time >= #{time}
+        ORDER BY iu.create_time desc
+            LIMIT 1
     </select>
 </mapper>

+ 50 - 0
zhongzheng-system/src/main/resources/mapper/modules/order/OrderGoodsMapper.xml

@@ -89,6 +89,7 @@
         <result property="businessId" column="business_id"/>
         <result property="examNum" column="exam_num"/>
         <result property="recordNum" column="record_num"/>
+        <result property="sysUserId" column="sys_user_id"/>
     </resultMap>
 
     <select id="selectList" parameterType="com.zhongzheng.modules.order.bo.OrderGoodsQueryBo"
@@ -604,4 +605,53 @@
         ORDER BY
             a.live_start_time ASC
     </select>
+
+    <select id="getBuyNotStudyList" parameterType="com.zhongzheng.modules.order.bo.OrderQueryBo" resultMap="OrderGoodsResultVo">
+        SELECT
+            og.order_goods_id,
+            g.goods_id,
+            og.grade_id,
+            o.user_id,
+            cg.sys_user_id,
+            g.goods_name
+        FROM
+            order_goods og
+                LEFT JOIN `order` o ON og.order_sn = o.order_sn
+                LEFT JOIN goods g ON og.goods_id = g.goods_id
+                LEFT JOIN class_grade cg ON og.grade_id = cg.grade_id
+                LEFT JOIN ( SELECT count(*) study_num, usr.user_id, usr.grade_id FROM user_study_record usr GROUP BY usr.user_id, usr.grade_id ) r ON r.grade_id = og.grade_id
+                AND r.user_id = o.user_id
+        WHERE
+            og.refund_status != 2
+	AND og.pay_status IN ( 2, 3, 4 )
+	AND og.`status` = 1
+	AND g.goods_type = 1
+	AND r.study_num IS NULL
+    AND og.create_time > #{startTime}
+    AND #{endTime} >= og.create_time
+    </select>
+
+    <select id="getLongNotStudyList" parameterType="com.zhongzheng.modules.order.bo.OrderQueryBo" resultMap="OrderGoodsResultVo">
+        SELECT
+            og.order_goods_id,
+            g.goods_id,
+            og.grade_id,
+            o.user_id,
+            cg.sys_user_id,
+            g.goods_name
+        FROM
+            order_goods og
+                LEFT JOIN `order` o ON og.order_sn = o.order_sn
+                LEFT JOIN goods g ON og.goods_id = g.goods_id
+                LEFT JOIN class_grade cg ON og.grade_id = cg.grade_id
+                LEFT JOIN ( SELECT MAX(usr.update_time) last_time, usr.user_id, usr.grade_id FROM user_study_record usr GROUP BY usr.user_id, usr.grade_id ) r ON r.grade_id = og.grade_id
+                AND r.user_id = o.user_id
+        WHERE
+            og.refund_status != 2
+        AND og.pay_status IN ( 2, 3, 4 )
+        AND og.`status` = 1
+        AND g.goods_type = 1
+        AND r.last_time > #{startTime}
+        AND #{endTime} >= r.last_time
+    </select>
 </mapper>

+ 7 - 0
zhongzheng-system/src/main/resources/mapper/modules/order/OrderInputMapper.xml

@@ -53,6 +53,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="selectList" parameterType="com.zhongzheng.modules.order.bo.OrderInputQueryBo" resultMap="OrderInputVoResult">
         SELECT  u.input_order_sn,
         u.order_from,
+        any_value (u.old_order_sn ) old_order_sn,
         any_value(g.goods_type) goods_type,
         count( DISTINCT u.user_id ) user_num,
         count( DISTINCT og.goods_id ) goods_num,
@@ -75,12 +76,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         order_input oi
         LEFT JOIN `order` o ON oi.input_order_sn = o.input_order_sn
         where 1=1
+        <if test="orderFrom != null and orderFrom != ''">
+            AND o.order_from = #{orderFrom}
+        </if>
         <if test="businessId != null and businessId != ''">
         AND oi.business_id = #{businessId}
         </if>
         <if test="educationTypeId != null and educationTypeId != ''">
             AND oi.education_type_id = #{educationTypeId}
         </if>
+        <if test="oldOrderSn != null and oldOrderSn != ''">
+            AND oi.old_order_sn = #{oldOrderSn}
+        </if>
         <if test="searchKey != null and searchKey != ''">
             AND (oi.create_username like concat('%', #{searchKey}, '%') or oi.input_order_sn = #{searchKey})
         </if>