|
@@ -19,6 +19,7 @@ import com.yonge.cooleshow.biz.dal.service.CourseRepliedService;
|
|
import com.yonge.cooleshow.biz.dal.service.SysMessageService;
|
|
import com.yonge.cooleshow.biz.dal.service.SysMessageService;
|
|
import com.yonge.cooleshow.biz.dal.vo.CourseRepliedVo;
|
|
import com.yonge.cooleshow.biz.dal.vo.CourseRepliedVo;
|
|
import com.yonge.cooleshow.biz.dal.vo.MyRepliedVo;
|
|
import com.yonge.cooleshow.biz.dal.vo.MyRepliedVo;
|
|
|
|
+import com.yonge.cooleshow.biz.dal.vo.RepliedCountVo;
|
|
import com.yonge.toolset.thirdparty.message.MessageSenderPluginContext;
|
|
import com.yonge.toolset.thirdparty.message.MessageSenderPluginContext;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.slf4j.LoggerFactory;
|
|
@@ -26,7 +27,10 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
|
+import java.util.Date;
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
|
|
+import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -177,7 +181,29 @@ public class CourseRepliedServiceImpl extends ServiceImpl<CourseScheduleRepliedD
|
|
return page.setRecords(repliedDao.myReplied(page, search));
|
|
return page.setRecords(repliedDao.myReplied(page, search));
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * @Description: 当日陪练课未对老师评价(每晚9点,已评价不发)
|
|
|
|
+ * @Author: cy
|
|
|
|
+ * @Date: 2022/5/6
|
|
|
|
+ */
|
|
public void noRepliedTeacher(){
|
|
public void noRepliedTeacher(){
|
|
-
|
|
|
|
|
|
+ String today = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
|
|
|
|
+ //统计当日所有购课学员
|
|
|
|
+ List<RepliedCountVo> repliedCounts=scheduleDao.countAllReplie(today);
|
|
|
|
+ for (RepliedCountVo repliedCount : repliedCounts) {
|
|
|
|
+ Long userId = repliedCount.getUserId();
|
|
|
|
+
|
|
|
|
+ Integer expCount = repliedCount.getCount();//应该评论课程数
|
|
|
|
+ Integer actCount=scheduleDao.countReplies(userId);//已评论课程数
|
|
|
|
+ int count = expCount - actCount;
|
|
|
|
+ if (count>0){//有课程未评价
|
|
|
|
+ Map<Long, String> studentReceivers = new HashMap<>();
|
|
|
|
+ studentReceivers.put(userId, repliedCount.getPhone());
|
|
|
|
+ sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG, MessageTypeEnum.NOT_EVALUATE_TEACHER_PRACTICE,
|
|
|
|
+ studentReceivers, null, 0, null, ClientEnum.STUDENT.getCode(),
|
|
|
|
+ count);
|
|
|
|
+ log.info("send success {}",MessageTypeEnum.NOT_EVALUATE_TEACHER_PRACTICE);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|