he2802 1 سال پیش
والد
کامیت
98e7a3ac54

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

@@ -303,6 +303,7 @@ aliyun:
     todayExamNotRecordWarn: SMS_257713140  #学员打卡提醒(每日一练)
     todayExamNotRecordTeachWarn: SMS_257702971  #学员打卡教务提醒(每日一练)
     noFinishExamNoteCode: SMS_262460267  #未做完试卷通知
+    orderServiceEndRemind : SMS_465555251  #学生购买未学习
 
 distributionOldPay:
       host: http://test.jqbao.net/System/BussinessApi/AddRedPackData

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

@@ -93,6 +93,13 @@ public class ScheduleController extends BaseController {
         return AjaxResult.success();
     }
 
+    @ApiOperation("二建服务到期提醒")
+    @GetMapping("/sendServiceEnd")
+    public AjaxResult sendServiceEnd() {
+        iScheduleService.sendServiceEnd();
+        return AjaxResult.success();
+    }
+
     /**
      * 考试提醒
      * @return

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

@@ -303,3 +303,4 @@ aliyun:
     todayExamNotRecordWarn: SMS_257713140  #学员打卡提醒(每日一练)
     todayExamNotRecordTeachWarn: SMS_257702971  #学员打卡教务提醒(每日一练)
     noFinishExamNoteCode: SMS_262460267  #未做完试卷通知
+    orderServiceEndRemind : SMS_465555251  #学生购买未学习

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

@@ -301,3 +301,4 @@ aliyun:
     todayExamNotRecordWarn: SMS_257713140  #学员打卡提醒(每日一练)
     todayExamNotRecordTeachWarn: SMS_257702971  #学员打卡教务提醒(每日一练)
     noFinishExamNoteCode: SMS_262460267  #未做完试卷通知
+    orderServiceEndRemind : SMS_465555251  #学生购买未学习

+ 2 - 0
zhongzheng-common/src/main/java/com/zhongzheng/common/utils/DateUtils.java

@@ -32,6 +32,8 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
 
     public static String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss";
 
+    public static String YYYY__MM__DD = "yyyy年MM月dd日";
+
     private static String[] parsePatterns = {
             "yyyy-MM-dd", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy-MM",
             "yyyy/MM/dd", "yyyy/MM/dd HH:mm:ss", "yyyy/MM/dd HH:mm", "yyyy/MM",

+ 3 - 3
zhongzheng-system/src/main/java/com/zhongzheng/modules/alisms/service/impl/AliSmsServiceImpl.java

@@ -41,8 +41,9 @@ import java.util.concurrent.TimeUnit;
 public class AliSmsServiceImpl implements IAliSmsService {
     private static final Logger LOGGER = LoggerFactory.getLogger(AliSmsServiceImpl.class);
 
-    @Value("${aliyun.sms.signName}")
     private String SIGNNAME;
+    @Value("${aliyun.sms.signName}")
+    private String DEFAULT_SIGNNAME;
     @Value("${aliyun.sms.registerTemplateCode}")
     private String REGISTERTEMPLATECODE;
     @Value("${aliyun.sms.accessKeyId}")
@@ -83,8 +84,7 @@ public class AliSmsServiceImpl implements IAliSmsService {
         if(Validator.isNotEmpty(configService.selectConfigByKeyNoCache("sms.signName"))){
             SIGNNAME = configService.selectConfigByKeyNoCache("sms.signName");
         }else{
-            SysConfig config = configService.getSysConfigByKeyTenant("sms.signName",867735392558919680L);
-            SIGNNAME = config.getConfigValue();
+            SIGNNAME = DEFAULT_SIGNNAME;
         }
 
     }

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/IGoodsService.java

@@ -14,6 +14,7 @@ import com.zhongzheng.modules.goods.bo.*;
 import com.zhongzheng.modules.goods.domain.Goods;
 import com.zhongzheng.modules.goods.vo.*;
 import com.zhongzheng.modules.grade.vo.SyncGoodsExport;
+import com.zhongzheng.modules.order.domain.OrderGoods;
 import com.zhongzheng.modules.system.domain.SysTenant;
 
 import java.util.Collection;
@@ -164,4 +165,6 @@ public interface IGoodsService extends IService<Goods> {
 	List<Goods> getRelGoodsNoTenant(String businessName, String categoryName, Long tenantId);
 
 
+
+
 }

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

@@ -80,4 +80,6 @@ public interface OrderGoodsMapper extends BaseMapper<OrderGoods> {
     OrderGoods getByIdNoTenant(Long orderGoodsId);
 
     List<MailOrderVo> getMailList(MailOrderBo bo);
+
+    List<OrderGoodsVo> sendTenOrderGoods(Long remindId);
 }

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

@@ -22,6 +22,8 @@ public interface IScheduleService extends IService<PolyvVideo> {
 
     void timeSend(UserQueryBo bo);
 
+    void sendServiceEnd();
+
     void closeTimeOutOrder();
 
     void updateIssue(UserQueryBo bo) throws ParseException;

+ 53 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/schedule/service/impl/ScheduleServiceImpl.java

@@ -399,6 +399,9 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
     @Value("${aliyun.sms.noFinishExamNoteCode}")
     private String noFinishExamNoteCode;
 
+    @Value("${aliyun.sms.orderServiceEndRemind}")
+    private String orderServiceEndRemind;
+
     @Autowired
     private RedisCache redisCache;
 
@@ -586,6 +589,56 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
         sendClassEnd();
     }
 
+    @Override
+    public void sendServiceEnd() {
+        InformRemindVo informRemindVo = informRemindService.queryByName("二建继教学习服务还剩10天");
+        if(Validator.isNotEmpty(informRemindVo)){
+            List<OrderGoodsVo> list = orderGoodsMapper.sendTenOrderGoods(informRemindVo.getId());
+            for (OrderGoodsVo goodsVo : list) {
+                GoodsVo goods = iGoodsService.queryById(goodsVo.getGoodsId());
+                    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(informRemindVo.getId());
+                        informUserAddBo.setSystemStatus(1);
+                        informUserAddBo.setGradeId(goodsVo.getGradeId());
+                        informUserAddBo.setOrderGoodsId(goodsVo.getOrderGoodsId());
+                        informUserAddBo.setRemind("二建继教学习服务还剩10天提醒");
+                        informUserAddBo.setGoodsId(goodsVo.getGoodsId());
+                        informUserAddBo.setText("尊敬的用户:您购买的课程二建继教学习服务还剩10天,请在"+DateUtils.timestampToDateFormat(goodsVo.getServiceEndTime(),DateUtils.YYYY__MM__DD)+"前完成学习,避免课程过期作废,无法学习给您带来不便。");
+                        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(informRemindVo.getId());
+                        informUserAddBo.setSystemStatus(3);
+                        informUserAddBo.setOrderGoodsId(goodsVo.getOrderGoodsId());
+                        informUserAddBo.setGradeId(goodsVo.getGradeId());
+                        informUserAddBo.setRemind("二建继教学习服务还剩10天提醒");
+                        informUserAddBo.setGoodsId(goodsVo.getGoodsId());
+                        informUserAddBo.setText("尊敬的用户:您购买的课程二建继教学习服务还剩10天,请在"+DateUtils.timestampToDateFormat(goodsVo.getServiceEndTime(),DateUtils.YYYY__MM__DD)+"前完成学习,避免课程过期作废,无法学习给您带来不便。");
+                        Map<String, Object> param = new HashMap<>();
+                        param.put("date", DateUtils.timestampToDateFormat(goodsVo.getServiceEndTime(),DateUtils.YYYY__MM__DD));
+                        param.put("day", "10");
+                        if (Validator.isNotEmpty(IAliSmsService.sendInformSms(userVo.getTelphone(), JSON.toJSONString(param), orderServiceEndRemind))) {
+                            iInformUserService.insertByAddBo(informUserAddBo);
+                        }
+                    }
+            }
+        }
+
+    }
+
     private void sendClassEnd() {
         List<ClassGradeUserGoodsVo> classTwentyGradeUserVos = iClassGradeUserService.sendTwentyClassGradeUser();
         List<ClassGradeUserGoodsVo> classTenGradeUserVos = iClassGradeUserService.sendTenClassGradeUser();

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

@@ -968,4 +968,19 @@
           order by create_time DESC
     </select>
 
+    <select id="sendTenOrderGoods" parameterType="java.lang.Long"   resultMap="OrderGoodsResultVo">
+
+        SELECT
+            og.*,o.user_id
+        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 inform_remind_business irb on  irb.business_id = g.business_id
+        where 1=1
+          and irb.remind_id =#{remindId}
+          and og.status = 1
+          AND og.service_end_time BETWEEN ( unix_timestamp(now()) + 864000) AND (unix_timestamp(now()) + 950400)
+    </select>
+
 </mapper>