WeGroupMsgTaskEventService.java
1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package com.linkwechat.wecom.service.callback;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONObject;
import com.linkwechat.wecom.domain.WeTaskFission;
import com.linkwechat.wecom.domain.query.WeTaskEventQuery;
import com.linkwechat.wecom.service.IWeTaskFissionService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationListener;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
/**
* @author danmo
* @description 群发回调通知处理
* @date 2021/11/21 19:57
**/
@Service
@Slf4j
public class WeGroupMsgTaskEventService implements ApplicationListener<WeTaskEventQuery> {
@Autowired
private IWeTaskFissionService weTaskFissionService;
@Override
@Async
public void onApplicationEvent(WeTaskEventQuery weTaskEventQuery) {
log.info("群发回调通知处理:weTaskEventQuery:{}", JSONObject.toJSONString(weTaskEventQuery));
Long businessId = weTaskEventQuery.getBusinessId();
Integer taskSource = weTaskEventQuery.getTaskSource();
Integer resultCode = weTaskEventQuery.getResultCode();
if(ObjectUtil.equal(1,taskSource)){
WeTaskFission fission = new WeTaskFission();
fission.setId(businessId);
fission.setFissStatus(resultCode);
weTaskFissionService.updateById(fission);
}
}
}