更新河小象逻辑

master
土豆兄弟 4 years ago
parent b20182354e
commit 8c285593af

@ -41,6 +41,11 @@ public interface ABMessageService {
*/ */
boolean updateSendPDSatus(Long recId, boolean sucess); boolean updateSendPDSatus(Long recId, boolean sucess);
/**
* -
*/
boolean updateSendHeXXSatus(Long recId, boolean sucess);
/** /**
* - * -

@ -35,6 +35,8 @@ public class ABMessageServiceImpl implements ABMessageService {
private PandaMessageRepository pandaMessageRepository; private PandaMessageRepository pandaMessageRepository;
@Autowired @Autowired
private WxFansMessageRepository wxFansMessageRepository; private WxFansMessageRepository wxFansMessageRepository;
@Autowired
private HeXiaoXiangMessageRepository heXiaoXiangMessageRepository;
@Override @Override
@Transactional(readOnly = false, propagation = Propagation.REQUIRES_NEW) @Transactional(readOnly = false, propagation = Propagation.REQUIRES_NEW)
@ -106,6 +108,20 @@ public class ABMessageServiceImpl implements ABMessageService {
return Boolean.TRUE; return Boolean.TRUE;
} }
@Override
@Transactional(readOnly = false, propagation = Propagation.REQUIRES_NEW)
public boolean updateSendHeXXSatus(Long recId, boolean sucess) {
if (recId == null) {
return Boolean.FALSE;
}
if (sucess) {
heXiaoXiangMessageRepository.updateSendStatus(1, recId);
}else {
heXiaoXiangMessageRepository.updateSendStatus(0, recId);
}
return Boolean.TRUE;
}
@Override @Override
@Transactional(readOnly = false, propagation = Propagation.REQUIRES_NEW) @Transactional(readOnly = false, propagation = Propagation.REQUIRES_NEW)
public boolean updateSendWxFansSatus(Long recId, boolean sucess) { public boolean updateSendWxFansSatus(Long recId, boolean sucess) {

@ -114,6 +114,18 @@ public class ABDownTask {
@Value("${ab.wxfans.secret}") @Value("${ab.wxfans.secret}")
private String wxSecretKey; private String wxSecretKey;
/**
* -
*/
@Value("${ab.hexx.appId}")
private String hexxAppId;
@Value("${ab.hexx.url}")
private String hexxUrl;
@Value("${ab.hexx.secretKey}")
private String hexxSecretKey;
/** /**
* , * ,
* *
@ -504,8 +516,8 @@ public class ABDownTask {
// 补充其他的下游请求字段 // 补充其他的下游请求字段
long time = System.currentTimeMillis() / 1000; long time = System.currentTimeMillis() / 1000;
heXXMessageCovDTO.setTimestamp(time); heXXMessageCovDTO.setTimestamp(time);
heXXMessageCovDTO.setAppId(panDaAppId); heXXMessageCovDTO.setAppId(hexxAppId);
heXXMessageCovDTO.setSignature(SecureUtil.sha1("app_id="+ panDaAppId +"&timestamp="+ time + "&secret=" + panDaSecretKey)); heXXMessageCovDTO.setSignature(SecureUtil.sha1("app_id="+ hexxAppId +"&timestamp="+ time + "&secret=" + hexxSecretKey));
// 数据实体转成Json 不忽略空kv 有序 // 数据实体转成Json 不忽略空kv 有序
String jsonStr = JSON.toJSONString(heXXMessageCovDTO); String jsonStr = JSON.toJSONString(heXXMessageCovDTO);
log.info("========== [ready send json is {} ] =============", jsonStr); log.info("========== [ready send json is {} ] =============", jsonStr);
@ -513,7 +525,7 @@ public class ABDownTask {
// todo 失败重发请求3次 // todo 失败重发请求3次
while (count <= 3){ while (count <= 3){
// 调用HTTP请求发送数据 // 调用HTTP请求发送数据
HttpResponse httpResponse = sendPandaReq(jsonStr); HttpResponse httpResponse = sendHXXReq(jsonStr);
if (httpResponse.isOk() && httpResponse.body().contains("success")){ if (httpResponse.isOk() && httpResponse.body().contains("success")){
log.info("========== [request success, response is {} ] ==========", httpResponse.body()); log.info("========== [request success, response is {} ] ==========", httpResponse.body());
break; break;
@ -742,6 +754,20 @@ public class ABDownTask {
return httpResponse; return httpResponse;
} }
/**
* HTTP
*
* @param json body
* @return
*/
private HttpResponse sendHXXReq(String json){
HttpResponse httpResponse = HttpRequest
.post(hexxUrl)
.body(json)
.execute();
return httpResponse;
}
/** /**
* HTTP * HTTP
* *

@ -48,6 +48,10 @@ ab:
appId: 10671792 appId: 10671792
url: https://pre-api.aircourses.com/common/open/n/stuClue/add/callback url: https://pre-api.aircourses.com/common/open/n/stuClue/add/callback
secretKey: fee2824fb2e0d1f166084cb66fc9d391 secretKey: fee2824fb2e0d1f166084cb66fc9d391
hexx:
appId: 9067cf8713cb5518
url: https://apitest.hexiaoxiang.com/managerportal/clue
secretKey: c0990e72836828ab
wxfans: wxfans:
url: https://api.wooxin.cn/tketong/ url: https://api.wooxin.cn/tketong/
taskid: taskid:
@ -92,6 +96,10 @@ ab:
appId: 10671792 appId: 10671792
url: https://api.aircourses.com/common/open/n/stuClue/add/callback url: https://api.aircourses.com/common/open/n/stuClue/add/callback
secretKey: fee2824fb2e0d1f166084cb66fc9d391 secretKey: fee2824fb2e0d1f166084cb66fc9d391
hexx:
appId: 9067cf8713cb5518
url: https://api.hexiaoxiang.com/managerportal/clue
secretKey: c0990e72836828ab
wxfans: wxfans:
url: https://api.wooxin.cn/tketong/ url: https://api.wooxin.cn/tketong/
taskid: taskid:
@ -138,6 +146,10 @@ ab:
appId: Hangzhouyunuo appId: Hangzhouyunuo
url: https://data.hzluoshi.cn/index/phoneapi url: https://data.hzluoshi.cn/index/phoneapi
secretKey: fee2824fb2e0d1f166084cb66fc9d391 secretKey: fee2824fb2e0d1f166084cb66fc9d391
hexx:
appId: 9067cf8713cb5518
url: https://api.hexiaoxiang.com/managerportal/clue
secretKey: c0990e72836828ab
wxfans: wxfans:
url: https://api.wooxin.cn/tketong/ url: https://api.wooxin.cn/tketong/
taskid: taskid:

Loading…
Cancel
Save