Commit 58ada22e by 徐高华

朋友圈

parent c2869c9a
...@@ -31,7 +31,7 @@ public interface QwMomentPlanAttendService { ...@@ -31,7 +31,7 @@ public interface QwMomentPlanAttendService {
ServiceResponse<Void> finishTask(SendResultQDTO qdto); ServiceResponse<Void> finishTask(SendResultQDTO qdto);
void updateMomentId(Long attendId) ; void updateMomentId(Long attendId, int times) ;
void updateStatusFlag(TabQwMomentPlan plan) ; void updateStatusFlag(TabQwMomentPlan plan) ;
......
...@@ -215,7 +215,7 @@ public class QwMomentPlanAttendServiceImpl implements QwMomentPlanAttendService ...@@ -215,7 +215,7 @@ public class QwMomentPlanAttendServiceImpl implements QwMomentPlanAttendService
return ServiceResponse.failure("9999","任务不存在"); return ServiceResponse.failure("9999","任务不存在");
} }
this.finishTaskUpdateData(dto.getAttendId(),planId,qdto.getSendTime()) ; 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)) { if(StringUtils.isNotBlank(momentId)) {
this.qwMomentPlanAttendMapper.updateMomentId(dto.getAttendId(),momentId); this.qwMomentPlanAttendMapper.updateMomentId(dto.getAttendId(),momentId);
}else { }else {
...@@ -224,18 +224,31 @@ public class QwMomentPlanAttendServiceImpl implements QwMomentPlanAttendService ...@@ -224,18 +224,31 @@ public class QwMomentPlanAttendServiceImpl implements QwMomentPlanAttendService
mq.setType(7) ; mq.setType(7) ;
Map<String,String> map = new HashMap<>() ; Map<String,String> map = new HashMap<>() ;
map.put("attendId",dto.getAttendId()+"") ; map.put("attendId",dto.getAttendId()+"") ;
map.put("times", "1");
mq.setParams(map); mq.setParams(map);
this.haobanCommonMQApiService.putCommonDelayMessage(mq, 60); this.haobanCommonMQApiService.putCommonDelayMessage(mq, 10);
} }
return ServiceResponse.success() ; return ServiceResponse.success() ;
} }
@Override @Override
public void updateMomentId(Long attendId) { public void updateMomentId(Long attendId , int times) {
TabQwMomentPlanAttend tab = this.qwMomentPlanAttendMapper.getById(attendId) ; 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)) { if(StringUtils.isNotBlank(momentId)) {
this.qwMomentPlanAttendMapper.updateMomentId(attendId, 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 ...@@ -251,8 +264,8 @@ public class QwMomentPlanAttendServiceImpl implements QwMomentPlanAttendService
this.pendingTaskService.updateFinish(attendId+"") ; this.pendingTaskService.updateFinish(attendId+"") ;
} }
public String getMomentId(String staffId , Date sendTime) { private String getMomentId(String staffId , Date sendTime , int times) {
Date startTime = DateUtil.addNumForSecond(sendTime,-10) ; Date startTime = DateUtil.addNumForSecond(sendTime,-60 + times * 60) ;
Date endTime = DateUtil.addNumForMinute(sendTime,1) ; Date endTime = DateUtil.addNumForMinute(sendTime,1) ;
TabHaobanStaff staff = this.staffMapper.selectByPrimaryKey(staffId) ; TabHaobanStaff staff = this.staffMapper.selectByPrimaryKey(staffId) ;
String wxEnterpriseId = staff.getWxEnterpriseId() ; String wxEnterpriseId = staff.getWxEnterpriseId() ;
......
...@@ -163,7 +163,8 @@ public class HaobanCommonMQApiServiceImpl implements HaobanCommonMQApiService { ...@@ -163,7 +163,8 @@ public class HaobanCommonMQApiServiceImpl implements HaobanCommonMQApiService {
break; break;
case 7 : case 7 :
Long attendId = Long.valueOf(map.get("attendId")) ; Long attendId = Long.valueOf(map.get("attendId")) ;
this.qwMomentPlanAttendService.updateMomentId(attendId); int times = Integer.valueOf(map.get("times")) ;
this.qwMomentPlanAttendService.updateMomentId(attendId,times);
break; break;
default: default:
break; 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