change 4 vuotta sitten
vanhempi
commit
de88f12896
17 muutettua tiedostoa jossa 304 lisäystä ja 7 poistoa
  1. 150 2
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/grade/SaticScheduleTask.java
  2. 21 0
      zhongzheng-admin/src/main/resources/application.yml
  3. 21 0
      zhongzheng-api/src/main/resources/application.yml
  4. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/alisms/service/IAliSmsService.java
  5. 12 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/alisms/service/impl/AliSmsServiceImpl.java
  6. 4 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/bo/InformUserAddBo.java
  7. 4 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/bo/InformUserEditBo.java
  8. 4 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/bo/InformUserQueryBo.java
  9. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/domain/InformUser.java
  10. 4 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/service/impl/InformUserServiceImpl.java
  11. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/vo/InformUserVo.java
  12. 4 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/mapper/OrderGoodsMapper.java
  13. 4 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/IOrderGoodsService.java
  14. 14 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/impl/OrderGoodsServiceImpl.java
  15. 20 5
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/impl/OrderServiceImpl.java
  16. 5 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/vo/OrderGoodsVo.java
  17. 30 0
      zhongzheng-system/src/main/resources/mapper/modules/order/OrderGoodsMapper.xml

+ 150 - 2
zhongzheng-admin/src/main/java/com/zhongzheng/controller/grade/SaticScheduleTask.java

@@ -1,14 +1,38 @@
 package com.zhongzheng.controller.grade;
 
+import com.alibaba.fastjson.JSON;
+import com.zhongzheng.common.utils.DateUtils;
+import com.zhongzheng.modules.base.service.IProfileTpService;
+import com.zhongzheng.modules.base.vo.ProfileTpVo;
+import com.zhongzheng.modules.goods.service.IGoodsService;
+import com.zhongzheng.modules.goods.vo.GoodsVo;
+import com.zhongzheng.modules.grade.service.IClassGradeGoodsService;
+import com.zhongzheng.modules.grade.service.IClassGradeService;
+import com.zhongzheng.modules.grade.service.IClassGradeUserService;
+import com.zhongzheng.modules.inform.bo.InformUserAddBo;
 import com.zhongzheng.modules.inform.domain.Inform;
+import com.zhongzheng.modules.inform.service.IInformRemindService;
 import com.zhongzheng.modules.inform.service.IInformService;
+import com.zhongzheng.modules.inform.service.IInformUserService;
+import com.zhongzheng.modules.inform.vo.InformRemindVo;
+import com.zhongzheng.modules.order.bo.OrderGoodsAddBo;
+import com.zhongzheng.modules.order.mapper.OrderMapper;
+import com.zhongzheng.modules.order.service.IOrderBusinessService;
+import com.zhongzheng.modules.order.service.IOrderGoodsService;
+import com.zhongzheng.modules.order.vo.OrderGoodsVo;
+import com.zhongzheng.modules.user.service.IUserService;
+import com.zhongzheng.modules.user.vo.UserVo;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.scheduling.annotation.EnableScheduling;
 import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.util.CollectionUtils;
 
 import java.time.LocalDateTime;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 @Configuration      //1.主要用于标记配置类,兼备Component的效果。
 @EnableScheduling   // 2.开启定时任务
@@ -16,11 +40,135 @@ public class SaticScheduleTask {
 
     @Autowired
     private IInformService informService;
+
+    @Autowired
+    private IInformRemindService informRemindService;
+
+    @Autowired
+    private IProfileTpService iProfileTpService;
+
+
+    @Autowired
+    private OrderMapper orderMapper;
+
+    @Autowired
+    private com.zhongzheng.modules.alisms.service.IAliSmsService IAliSmsService;
+
+    @Autowired
+    private IInformUserService iInformUserService;
+
+    @Autowired
+    private IOrderGoodsService iOrderGoodsService;
+
+    @Autowired
+    private IOrderBusinessService iOrderBusinessService;
+    @Autowired
+    private IGoodsService iGoodsService;
+    @Autowired
+    private IClassGradeService iClassGradeService;
+    @Autowired
+    private IClassGradeUserService iClassGradeUserService;
+    @Autowired
+    private IClassGradeGoodsService iClassGradeGoodsService;
+
+    @Autowired
+    private IUserService iUserService;
+
+    @Value("${aliyun.sms.OpenTheGoodsCode}")
+    private String OpenTheGoodsCode;
+
+    @Value("${aliyun.sms.informationNotificationCode}")
+    private String informationNotificationCode;
+
     //3.添加定时任务
     //@Scheduled(cron = "0/2 * * * * ?")
     //或直接指定时间间隔,例如:5秒
-    @Scheduled(fixedRate=5000)
+    @Scheduled(fixedRate = 5000)
     private void configureTasks() {
-        //List<Inform> informs = informService.selectTasks();
+        InformRemindVo informRemindVo = informRemindService.queryById(1L);
+        List<OrderGoodsVo> orderGoodsVo = iOrderGoodsService.selectOrderGoods();
+
+        InformRemindVo informRemindTwoVo = informRemindService.queryById(2L);
+        if (!CollectionUtils.isEmpty(orderGoodsVo)) {
+            for (OrderGoodsVo goodsVo : orderGoodsVo) {
+                ProfileTpVo profileTpVo = iProfileTpService.queryByGoodsId(goodsVo.getGoodsId());
+                if (informRemindVo.getWayStatus() == 1 && profileTpVo == null) {
+                    InformUserAddBo informUserAddBo = new InformUserAddBo();
+                    informUserAddBo.setUserId(goodsVo.getUserId());
+                    informUserAddBo.setSendStatus(1);
+                    informUserAddBo.setCreateTime(DateUtils.getNowTime());
+                    informUserAddBo.setUpdateTime(DateUtils.getNowTime());
+                    informUserAddBo.setRemindId(1L);
+                    informUserAddBo.setSystemStatus(1);
+                    informUserAddBo.setRemind("商品开通提醒");
+                    informUserAddBo.setGoodsId(goodsVo.getGoodsId());
+                    GoodsVo goodsVo1 = iGoodsService.queryById(goodsVo.getGoodsId());
+                    informUserAddBo.setText("尊敬的用户:您购买的" + goodsVo1.getGoodsName() + "已经开通,请尽快去学习吧。");
+                    iInformUserService.insertByAddBo(informUserAddBo);
+                }
+                if (informRemindTwoVo.getWayStatus() == 1 && profileTpVo != null) {
+                    InformUserAddBo informUserAddBo = new InformUserAddBo();
+                    informUserAddBo.setUserId(goodsVo.getUserId());
+                    informUserAddBo.setSendTime(DateUtils.getNowTime());
+                    informUserAddBo.setSendStatus(1);
+                    informUserAddBo.setCreateTime(DateUtils.getNowTime());
+                    informUserAddBo.setUpdateTime(DateUtils.getNowTime());
+                    informUserAddBo.setRemindId(2L);
+                    informUserAddBo.setSystemStatus(1);
+                    informUserAddBo.setRemind("完善报名资料通知");
+                    informUserAddBo.setGoodsId(goodsVo.getGoodsId());
+                    GoodsVo goodsVo1 = iGoodsService.queryById(goodsVo.getGoodsId());
+                    informUserAddBo.setText("尊敬的用户:已为您开通了" + goodsVo1.getGoodsName() + "课程,本课程需完善信息方可学习,请尽快去完善资料吧");
+                    iInformUserService.insertByAddBo(informUserAddBo);
+                }
+            }
+        }
+        List<OrderGoodsVo> orderGoodsTwoVo = iOrderGoodsService.selectOrderTwoGoods();
+        if (!CollectionUtils.isEmpty(orderGoodsTwoVo)) {
+            for (OrderGoodsVo goodsVo : orderGoodsTwoVo) {
+                ProfileTpVo profileTpVo = iProfileTpService.queryByGoodsId(goodsVo.getGoodsId());
+                if (informRemindVo.getNoteStatus() == 1 && profileTpVo == null) {
+                    InformUserAddBo informUserAddBo = new InformUserAddBo();
+                    informUserAddBo.setUserId(goodsVo.getUserId());
+                    informUserAddBo.setSendTime(DateUtils.getNowTime());
+                    informUserAddBo.setSendStatus(1);
+                    informUserAddBo.setCreateTime(DateUtils.getNowTime());
+                    informUserAddBo.setUpdateTime(DateUtils.getNowTime());
+                    informUserAddBo.setRemindId(1L);
+                    informUserAddBo.setSystemStatus(3);
+                    informUserAddBo.setRemind("商品开通提醒");
+                    informUserAddBo.setGoodsId(goodsVo.getGoodsId());
+                    GoodsVo goodsVo1 = iGoodsService.queryById(goodsVo.getGoodsId());
+                    informUserAddBo.setText("尊敬的用户:您购买的" + goodsVo1.getGoodsName() + "已经开通,请尽快去学习吧。");
+                    iInformUserService.insertByAddBo(informUserAddBo);
+                    UserVo userVo = iUserService.queryById(goodsVo.getUserId());
+                    Map<String, Object> param = new HashMap<>();
+                    param.put("goods", goodsVo1.getGoodsName());
+                    IAliSmsService.sendInformSms(userVo.getTelphone(), JSON.toJSONString(param), OpenTheGoodsCode);
+                }
+                if (informRemindTwoVo.getNoteStatus() == 1 && profileTpVo != null) {
+                    InformUserAddBo informUserAddBo = new InformUserAddBo();
+                    informUserAddBo.setUserId(goodsVo.getUserId());
+                    informUserAddBo.setSendTime(DateUtils.getNowTime());
+                    informUserAddBo.setSendStatus(1);
+                    informUserAddBo.setCreateTime(DateUtils.getNowTime());
+                    informUserAddBo.setUpdateTime(DateUtils.getNowTime());
+                    informUserAddBo.setRemindId(1L);
+                    informUserAddBo.setSystemStatus(3);
+                    informUserAddBo.setRemind("商品开通提醒");
+                    informUserAddBo.setGoodsId(goodsVo.getGoodsId());
+                    GoodsVo goodsVo1 = iGoodsService.queryById(goodsVo.getGoodsId());
+                    informUserAddBo.setText("尊敬的用户:您购买的" + goodsVo1.getGoodsName() + "已经开通,请尽快去学习吧。");
+                    iInformUserService.insertByAddBo(informUserAddBo);
+                    UserVo userVo = iUserService.queryById(goodsVo.getUserId());
+                    Map<String, Object> param = new HashMap<>();
+                    param.put("goods", goodsVo1.getGoodsName());
+                    IAliSmsService.sendInformSms(userVo.getTelphone(), JSON.toJSONString(param), informationNotificationCode);
+                }
+            }
+        }
+
+
     }
+
 }

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

@@ -267,3 +267,24 @@ aliyun:
     pwdTemplateCode: SMS_230220381
     accessKeyId: LTAIgC8O2WUXvXuR
     accessKeySecret: 1yyCazuT1M6MruBXzgFjP0p9gdMlwX
+    OpenTheGoodsCode: SMS_230970155     #商品开通提醒
+    informationNotificationCode: SMS_230965149  #完善报名资料通知
+    materialReviewCode: SMS_230980165         #报名资料审核通过通知
+    NotificationOfFailureCode: SMS_230980172  #报名资料审核不通过通知
+    remainingDaysValidityCode: SMS_230960174  #开通班级有效期还剩天数
+    completionReminderCode: SMS_230965157   #学时学习完成提醒
+    schoolHoursCode: SMS_230970166    #学时机构审核通过提醒
+    auditFailedCode: SMS_230970167  #学时机构审核不通过提醒
+    ReminderApproval: SMS_230970171 #学时机构审核通过提醒
+    passTheReminder: SMS_230980180  #学时机构审核不通过提醒
+    bookingReminder: SMS_230980181  #考试预约提醒
+    cancellationReminder: SMS_230980183 #考试预约取消提醒
+    reservationSuccess: SMS_230980186 #考试预约成功提醒
+    examinationRemind: SMS_230960195  #考试提醒
+    newExamPass: SMS_230970179  #七大员新考考试通过提醒
+    newExamFail: SMS_230960198  #七大员新考考试不通过提醒
+    openingReminder: SMS_230970209  #七大员题库开通提醒(12-22
+    classRemind: SMS_230965224  #二建继教开班提醒
+    OverdueReminder: SMS_230980259  #班级过期提醒
+    OverdueReminderHave: SMS_230965228  #班级过期提醒有学习次数
+    planReminder: SMS_230970248     #学习计划提醒

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

@@ -265,3 +265,24 @@ aliyun:
     pwdTemplateCode: SMS_230220381
     accessKeyId: LTAIgC8O2WUXvXuR
     accessKeySecret: 1yyCazuT1M6MruBXzgFjP0p9gdMlwX
+    OpenTheGoodsCode: SMS_230970155     #商品开通提醒
+    informationNotificationCode: SMS_230965149  #完善报名资料通知
+    materialReviewCode: SMS_230980165         #报名资料审核通过通知
+    NotificationOfFailureCode: SMS_230980172  #报名资料审核不通过通知
+    remainingDaysValidityCode: SMS_230960174  #开通班级有效期还剩天数
+    completionReminderCode: SMS_230965157   #学时学习完成提醒
+    schoolHoursCode: SMS_230970166    #学时机构审核通过提醒
+    auditFailedCode: SMS_230970167  #学时机构审核不通过提醒
+    ReminderApproval: SMS_230970171 #学时机构审核通过提醒
+    passTheReminder: SMS_230980180  #学时机构审核不通过提醒
+    bookingReminder: SMS_230980181  #考试预约提醒
+    cancellationReminder: SMS_230980183 #考试预约取消提醒
+    reservationSuccess: SMS_230980186 #考试预约成功提醒
+    examinationRemind: SMS_230960195  #考试提醒
+    newExamPass: SMS_230970179  #七大员新考考试通过提醒
+    newExamFail: SMS_230960198  #七大员新考考试不通过提醒
+    openingReminder: SMS_230970209  #七大员题库开通提醒(12-22
+    classRemind: SMS_230965224  #二建继教开班提醒
+    OverdueReminder: SMS_230980259  #班级过期提醒
+    OverdueReminderHave: SMS_230965228  #班级过期提醒有学习次数
+    planReminder: SMS_230970248     #学习计划提醒

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/alisms/service/IAliSmsService.java

@@ -8,6 +8,8 @@ import javax.servlet.http.HttpServletRequest;
 public interface IAliSmsService {
     ResultBean sendSms(String tel,String param);
 
+    ResultBean sendInformSms(String tel,String param,String code);
+
     Boolean sendRegisterSms(String tel);
 
     Boolean sendForgetSms(String tel);

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

@@ -70,6 +70,18 @@ public class AliSmsServiceImpl implements IAliSmsService {
         return null;
     }
 
+    @Override
+    public ResultBean sendInformSms(String tel, String param,String code) {
+        try{
+            SendSmsResponse response = SmsUtils.sendSms(tel,SIGNNAME,code,param,ACCESSKEYID,ACCESSKEYSECRET);
+            System.out.println(response);
+        }catch (Exception e){
+
+        }
+
+        return null;
+    }
+
     @Override
     public Boolean sendRegisterSms(String tel) {
         if(tel==null){

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/bo/InformUserAddBo.java

@@ -54,4 +54,8 @@ public class InformUserAddBo {
     /** 提醒项 */
     @ApiModelProperty("提醒项")
     private String remind;
+    /** 绑定商品ID */
+    @ApiModelProperty("绑定商品ID")
+    private Long goodsId;
+
 }

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

@@ -60,5 +60,9 @@ public class InformUserEditBo {
     @ApiModelProperty("提醒项")
     private String remind;
 
+    /** 绑定商品ID */
+    @ApiModelProperty("绑定商品ID")
+    private Long goodsId;
+
 
 }

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/bo/InformUserQueryBo.java

@@ -73,4 +73,8 @@ public class InformUserQueryBo extends BaseEntity {
 	/** 提醒项 */
 	@ApiModelProperty("提醒项")
 	private String remind;
+
+	/** 绑定商品ID */
+	@ApiModelProperty("绑定商品ID")
+	private Long goodsId;
 }

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/domain/InformUser.java

@@ -53,4 +53,7 @@ private static final long serialVersionUID=1L;
 
     /** 系统通知内容 */
     private String text;
+
+    /** 绑定商品ID */
+    private Long goodsId;
 }

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

@@ -74,10 +74,14 @@ public class InformUserServiceImpl extends ServiceImpl<InformUserMapper, InformU
     @Override
     public List<InformUserVo> queryList(InformUserQueryBo bo) {
         LambdaQueryWrapper<InformUser> lqw = Wrappers.lambdaQuery();
+        List<Long> status = new ArrayList<>();
+        status.add(1L);
+        status.add(2L);
         lqw.eq(bo.getUserId() != null, InformUser::getUserId, bo.getUserId());
         lqw.eq(bo.getSendTime() != null, InformUser::getSendTime, bo.getSendTime());
         lqw.eq(bo.getSendStatus() != null, InformUser::getSendStatus, bo.getSendStatus());
         lqw.eq(bo.getReceiptStatus() != null, InformUser::getReceiptStatus, bo.getReceiptStatus());
+        lqw.in(bo.getSystemStatus() != null, InformUser::getSystemStatus, status);
         List<InformUserVo> informUserVos = entity2Vo(this.list(lqw));
         for (InformUserVo informUserVo : informUserVos) {
             if (informUserVo.getSystemStatus() == 2) {

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/vo/InformUserVo.java

@@ -85,4 +85,6 @@ public class InformUserVo {
 	@Excel(name = "班级名称")
 	@ApiModelProperty("班级名称")
 	private List<String> className;
+
+
 }

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

@@ -18,4 +18,8 @@ import java.util.List;
 public interface OrderGoodsMapper extends BaseMapper<OrderGoods> {
     List<OrderGoodsVo> selectList(OrderGoodsQueryBo bo);
     OrderGoodsVo selectDetail(OrderGoodsQueryBo bo);
+
+    List<OrderGoodsVo> selectOrderGoods(OrderGoodsQueryBo orderGoodsQueryBo);
+
+    List<OrderGoodsVo> selectOrderTwoGoods(OrderGoodsQueryBo orderGoodsQueryBo);
 }

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

@@ -53,4 +53,8 @@ public interface IOrderGoodsService extends IService<OrderGoods> {
 	 * @return
 	 */
 	Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
+
+	List<OrderGoodsVo> selectOrderGoods();
+
+	List<OrderGoodsVo> selectOrderTwoGoods();
 }

+ 14 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/impl/OrderGoodsServiceImpl.java

@@ -171,6 +171,20 @@ public class OrderGoodsServiceImpl extends ServiceImpl<OrderGoodsMapper, OrderGo
         return this.removeByIds(ids);
     }
 
+    @Override
+    public List<OrderGoodsVo> selectOrderGoods() {
+        OrderGoodsQueryBo orderGoodsQueryBo = new OrderGoodsQueryBo();
+        orderGoodsQueryBo.setGoodsId(1L);
+        List<OrderGoodsVo> orderGoodsVos = baseMapper.selectOrderGoods(orderGoodsQueryBo);
+        return orderGoodsVos;
+    }
+
+    @Override
+    public List<OrderGoodsVo> selectOrderTwoGoods() {
+        OrderGoodsQueryBo orderGoodsQueryBo = new OrderGoodsQueryBo();
+        return baseMapper.selectOrderTwoGoods(orderGoodsQueryBo);
+    }
+
     public boolean joinGrade(Long orderGoodsId,Long gradeId,Long userId,Long goodsId){
         ClassGradeVo classGradeVo = iClassGradeService.queryById(gradeId);
         if(classGradeVo==null){

+ 20 - 5
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/impl/OrderServiceImpl.java

@@ -7,9 +7,13 @@ import com.zhongzheng.common.exception.CustomException;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.common.utils.SecurityUtils;
 import com.zhongzheng.common.utils.ServletUtils;
+import com.zhongzheng.modules.alisms.service.IAliSmsService;
 import com.zhongzheng.modules.bank.domain.QuestionBusiness;
+import com.zhongzheng.modules.base.service.IProfileTpService;
+import com.zhongzheng.modules.base.vo.ProfileTpVo;
 import com.zhongzheng.modules.goods.domain.Goods;
 import com.zhongzheng.modules.goods.service.IGoodsService;
+import com.zhongzheng.modules.goods.vo.GoodsVo;
 import com.zhongzheng.modules.grade.bo.ClassGradeQueryBo;
 import com.zhongzheng.modules.grade.domain.ClassGrade;
 import com.zhongzheng.modules.grade.domain.ClassGradeGoods;
@@ -19,6 +23,10 @@ import com.zhongzheng.modules.grade.service.IClassGradeGoodsService;
 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.inform.bo.InformUserAddBo;
+import com.zhongzheng.modules.inform.service.IInformRemindService;
+import com.zhongzheng.modules.inform.service.IInformUserService;
+import com.zhongzheng.modules.inform.vo.InformRemindVo;
 import com.zhongzheng.modules.order.bo.*;
 import com.zhongzheng.modules.order.domain.Order;
 import com.zhongzheng.modules.order.domain.OrderBusiness;
@@ -66,10 +74,22 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
     @Autowired
     private IClassGradeGoodsService iClassGradeGoodsService;
 
+    @Autowired
+    private IInformRemindService informRemindService;
+
+    @Autowired
+    private IProfileTpService iProfileTpService;
+
 
     @Autowired
     private OrderMapper orderMapper;
 
+    @Autowired
+    private com.zhongzheng.modules.alisms.service.IAliSmsService IAliSmsService;
+
+    @Autowired
+    private IInformUserService iInformUserService;
+
     @Override
     public OrderVo queryById(Long orderId){
         Order db = this.baseMapper.selectById(orderId);
@@ -223,14 +243,9 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
         Map<String, Object> result = new HashMap<>();
         result.put("oderId",add.getOrderId());
         result.put("orderSn",out_trade_no);
-        //发送购买商品成功
-        sendMessage(bo);
         return result;
     }
 
-    private void sendMessage(OrderAddBo bo) {
-        /*if ()*/
-    }
 
     @Override
     public Boolean updateByEditBo(OrderEditBo bo) {

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

@@ -32,6 +32,11 @@ public class OrderGoodsVo {
 	@Excel(name = "商品id")
 	@ApiModelProperty("商品id")
 	private Long goodsId;
+	/** 用户ID */
+	@Excel(name = "用户ID")
+	@ApiModelProperty("用户ID")
+	private Long userId;
+
 	/** 商品采集数据 */
 	@Excel(name = "商品采集数据")
 	@ApiModelProperty("商品采集数据")

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

@@ -46,6 +46,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="company" column="company"/>
         <result property="createTime" column="create_time"/>
         <result property="remark" column="remark"/>
+        <result property="userId" column="user_id"/>
 
         <result property="code" column="code"/>
         <result property="goodsName" column="goods_name"/>
@@ -108,4 +109,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
          og.order_sn =  #{orderSn} AND og.goods_id =  #{goodsId}
 
     </select>
+
+    <select id="selectOrderGoods" parameterType="com.zhongzheng.modules.order.bo.OrderGoodsQueryBo" resultMap="OrderGoodsResultVo">
+        SELECT
+        og.*,
+        o.user_id
+        FROM
+        `order` o
+        LEFT JOIN order_goods og on o.order_sn = og.order_sn
+        where 1=1
+        and og.`status` = 1
+        and og.refund_status in (0,1,3)
+        and og.pay_status in (2,3)
+        AND (SELECT COUNT(1) FROM inform_user iu where iu.user_id = o.user_id and iu.goods_id = og.goods_id and system_status = 1) &lt; 1
+    </select>
+
+    <select id="selectOrderTwoGoods" parameterType="com.zhongzheng.modules.order.bo.OrderGoodsQueryBo" resultMap="OrderGoodsResultVo">
+        SELECT
+        og.*,
+        o.user_id
+        FROM
+        `order` o
+        LEFT JOIN order_goods og on o.order_sn = og.order_sn
+        where 1=1
+        and og.`status` = 1
+        and og.refund_status in (0,1,3)
+        and og.pay_status in (2,3)
+        AND (SELECT COUNT(1) FROM inform_user iu where iu.user_id = o.user_id and iu.goods_id = og.goods_id and system_status = 3) &lt; 1
+
+    </select>
 </mapper>