|
@@ -4,6 +4,7 @@ import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.core.lang.Validator;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.zhongzheng.common.exception.CustomException;
|
|
|
import com.zhongzheng.common.utils.DateUtils;
|
|
|
import com.zhongzheng.common.utils.ToolsUtils;
|
|
@@ -129,6 +130,11 @@ public class TopOrderRecNoteServiceImpl extends ServiceImpl<TopOrderRecNoteMappe
|
|
|
} catch (IOException e) {
|
|
|
throw new CustomException("同步请求错误"+e.getMessage());
|
|
|
}
|
|
|
+ LambdaUpdateWrapper<TopOrderRecNote> objectLambdaUpdateWrapper = Wrappers.lambdaUpdate();
|
|
|
+ objectLambdaUpdateWrapper.eq(TopOrderRecNote::getOrderSn, orderSn);
|
|
|
+ objectLambdaUpdateWrapper.set(TopOrderRecNote::getLastTime, nowTime);
|
|
|
+ objectLambdaUpdateWrapper.set(TopOrderRecNote::getUpdateTime, DateUtils.getNowTime());
|
|
|
+ this.update(null, objectLambdaUpdateWrapper);
|
|
|
return true;
|
|
|
}
|
|
|
|
|
@@ -163,7 +169,49 @@ public class TopOrderRecNoteServiceImpl extends ServiceImpl<TopOrderRecNoteMappe
|
|
|
Long time = DateUtils.dateTimeSec(DateUtils.YYYY_MM_DD_HH_MM_SS,timeStr);
|
|
|
if(DateUtils.getNowTime().longValue()>time.longValue()){
|
|
|
//推送
|
|
|
- System.out.println("推送");
|
|
|
+ pushOldNote(vo.getOrderSn());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //每周
|
|
|
+ TopOrderRecNoteQueryBo queryBo2 = new TopOrderRecNoteQueryBo();
|
|
|
+ queryBo1.setNoteType(3L);
|
|
|
+ queryBo1.setStatus(1);
|
|
|
+ queryBo1.setLastTime(DateUtils.getNowTime()-(24*3600));//一天只推一次
|
|
|
+ List<TopOrderRecNoteVo> list2 = queryList(queryBo2);
|
|
|
+ for(TopOrderRecNoteVo vo : list2){
|
|
|
+ String[] splitWeek=vo.getWeekTime().split(",");
|
|
|
+ for(String week : splitWeek){
|
|
|
+ if(DateUtils.getTodayWeek()==Integer.parseInt(week)){
|
|
|
+ String dayStr = DateUtils.getDate();
|
|
|
+ String timeStr = dayStr+" "+vo.getDayTime()+":00";
|
|
|
+ Long time = DateUtils.dateTimeSec(DateUtils.YYYY_MM_DD_HH_MM_SS,timeStr);
|
|
|
+ if(DateUtils.getNowTime().longValue()>time.longValue()){
|
|
|
+ //推送
|
|
|
+ pushOldNote(vo.getOrderSn());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //每月
|
|
|
+ TopOrderRecNoteQueryBo queryBo3 = new TopOrderRecNoteQueryBo();
|
|
|
+ queryBo1.setNoteType(4L);
|
|
|
+ queryBo1.setStatus(1);
|
|
|
+ queryBo1.setLastTime(DateUtils.getNowTime()-(24*3600));//一天只推一次
|
|
|
+ List<TopOrderRecNoteVo> list3 = queryList(queryBo3);
|
|
|
+ for(TopOrderRecNoteVo vo : list3){
|
|
|
+ String[] splitMonth=vo.getMonthTime().split(",");
|
|
|
+ for(String month : splitMonth){
|
|
|
+ Calendar cal = Calendar.getInstance();
|
|
|
+ Integer day_moneth=cal.get(Calendar.DAY_OF_MONTH);
|
|
|
+ if(day_moneth==Integer.parseInt(month)){
|
|
|
+ String dayStr = DateUtils.getDate();
|
|
|
+ String timeStr = dayStr+" "+vo.getDayTime()+":00";
|
|
|
+ Long time = DateUtils.dateTimeSec(DateUtils.YYYY_MM_DD_HH_MM_SS,timeStr);
|
|
|
+ if(DateUtils.getNowTime().longValue()>time.longValue()){
|
|
|
+ //推送
|
|
|
+ pushOldNote(vo.getOrderSn());
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
return null;
|