Commit 58ada22e by 徐高华

朋友圈

parent c2869c9a
......@@ -31,7 +31,7 @@ public interface QwMomentPlanAttendService {
ServiceResponse<Void> finishTask(SendResultQDTO qdto);
void updateMomentId(Long attendId) ;
void updateMomentId(Long attendId, int times) ;
void updateStatusFlag(TabQwMomentPlan plan) ;
......
......@@ -215,7 +215,7 @@ public class QwMomentPlanAttendServiceImpl implements QwMomentPlanAttendService
return ServiceResponse.failure("9999","任务不存在");
}
this.finishTaskUpdateData(dto.getAttendId(),planId,qdto.getSendTime()) ;
String momentId = this.getMomentId(qdto.getStaffId() , qdto.getSendTime()) ;
String momentId = this.getMomentId(qdto.getStaffId() , qdto.getSendTime() , 0) ;
if(StringUtils.isNotBlank(momentId)) {
this.qwMomentPlanAttendMapper.updateMomentId(dto.getAttendId(),momentId);
}else {
......@@ -224,18 +224,31 @@ public class QwMomentPlanAttendServiceImpl implements QwMomentPlanAttendService
mq.setType(7) ;
Map<String,String> map = new HashMap<>() ;
map.put("attendId",dto.getAttendId()+"") ;
map.put("times", "1");
mq.setParams(map);
this.haobanCommonMQApiService.putCommonDelayMessage(mq, 60);
this.haobanCommonMQApiService.putCommonDelayMessage(mq, 10);
}
return ServiceResponse.success() ;
}
@Override
public void updateMomentId(Long attendId) {
public void updateMomentId(Long attendId , int times) {
TabQwMomentPlanAttend tab = this.qwMomentPlanAttendMapper.getById(attendId) ;
String momentId = this.getMomentId(tab.getStaffId() , tab.getSendTime()) ;
if(times > 10) {
return;
}
String momentId = this.getMomentId(tab.getStaffId() , tab.getSendTime() , times) ;
if(StringUtils.isNotBlank(momentId)) {
this.qwMomentPlanAttendMapper.updateMomentId(attendId, momentId);
}else {
logger.info("未获取到,延迟获取={},{}",tab.getPlanId(),tab.getStaffId()) ;
CommonMQDTO mq = new CommonMQDTO() ;
mq.setType(7) ;
Map<String,String> map = new HashMap<>() ;
map.put("attendId",attendId+"") ;
map.put("times", (times+1)+"");
mq.setParams(map);
this.haobanCommonMQApiService.putCommonDelayMessage(mq, 10);
}
}
......@@ -251,8 +264,8 @@ public class QwMomentPlanAttendServiceImpl implements QwMomentPlanAttendService
this.pendingTaskService.updateFinish(attendId+"") ;
}
public String getMomentId(String staffId , Date sendTime) {
Date startTime = DateUtil.addNumForSecond(sendTime,-10) ;
private String getMomentId(String staffId , Date sendTime , int times) {
Date startTime = DateUtil.addNumForSecond(sendTime,-60 + times * 60) ;
Date endTime = DateUtil.addNumForMinute(sendTime,1) ;
TabHaobanStaff staff = this.staffMapper.selectByPrimaryKey(staffId) ;
String wxEnterpriseId = staff.getWxEnterpriseId() ;
......
......@@ -163,7 +163,8 @@ public class HaobanCommonMQApiServiceImpl implements HaobanCommonMQApiService {
break;
case 7 :
Long attendId = Long.valueOf(map.get("attendId")) ;
this.qwMomentPlanAttendService.updateMomentId(attendId);
int times = Integer.valueOf(map.get("times")) ;
this.qwMomentPlanAttendService.updateMomentId(attendId,times);
break;
default:
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment