|
|
@ -217,7 +217,10 @@ public class RetailRSvcServiceImpl implements RetailRSvcService {
|
|
|
|
String title = params.getString("title");
|
|
|
|
String title = params.getString("title");
|
|
|
|
String body = params.getString("body");
|
|
|
|
String body = params.getString("body");
|
|
|
|
String url = decData(params.getString("url"), key, svcInfo.getString("platform_pri_key"));
|
|
|
|
String url = decData(params.getString("url"), key, svcInfo.getString("platform_pri_key"));
|
|
|
|
|
|
|
|
if (StringUtils.equalsIgnoreCase("PINE", client.getString("client_moniker"))||
|
|
|
|
|
|
|
|
StringUtils.equalsIgnoreCase("TUTU", client.getString("client_moniker"))) {
|
|
|
|
sendRServiceNotifyMessage(client, title, body, url);
|
|
|
|
sendRServiceNotifyMessage(client, title, body, url);
|
|
|
|
|
|
|
|
}
|
|
|
|
result.put("result_status", "SUCCESS");
|
|
|
|
result.put("result_status", "SUCCESS");
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
|
logger.error("geek notify app fail:{} - {}",sourceCode,e.getMessage());
|
|
|
|
logger.error("geek notify app fail:{} - {}",sourceCode,e.getMessage());
|
|
|
@ -254,24 +257,21 @@ public class RetailRSvcServiceImpl implements RetailRSvcService {
|
|
|
|
|
|
|
|
|
|
|
|
private void sendRServiceNotifyMessage(JSONObject client, String title, String body, String url) {
|
|
|
|
private void sendRServiceNotifyMessage(JSONObject client, String title, String body, String url) {
|
|
|
|
logger.debug("sendGeekMessage Begin");
|
|
|
|
logger.debug("sendGeekMessage Begin");
|
|
|
|
// List<JSONObject> clientTokens = clientDeviceTokenMapper.listTokensByClient_id(client.getIntValue("client_id"));
|
|
|
|
List<JSONObject> clientTokens = clientDeviceTokenMapper.listTokensByClient_id(client.getIntValue("client_id"));
|
|
|
|
// for (JSONObject token : clientTokens) {
|
|
|
|
for (JSONObject tokenJson : clientTokens) {
|
|
|
|
//
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
JSONObject devToken = clientDeviceTokenMapper.getTestTokens();
|
|
|
|
|
|
|
|
Runnable task = () -> {
|
|
|
|
Runnable task = () -> {
|
|
|
|
String token = devToken.getString("token");
|
|
|
|
String token = tokenJson.getString("token");
|
|
|
|
JSONObject log = saveAppMessageLog(devToken.getString("dev_id"),
|
|
|
|
JSONObject log = saveAppMessageLog(tokenJson.getString("dev_id"),
|
|
|
|
devToken.getIntValue("client_id"),
|
|
|
|
tokenJson.getIntValue("client_id"),
|
|
|
|
"annual_bill" + devToken.getString("client_type"),
|
|
|
|
"annual_bill" + tokenJson.getString("client_type"),
|
|
|
|
token,
|
|
|
|
token,
|
|
|
|
"跨境商城推送"
|
|
|
|
"跨境商城推送"
|
|
|
|
);
|
|
|
|
);
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
JSONObject type = new JSONObject();
|
|
|
|
JSONObject type = new JSONObject();
|
|
|
|
type.put("send_type", "annual_bill");
|
|
|
|
type.put("send_type", "annual_bill");
|
|
|
|
type.put("id", devToken.getString("dev_token_id"));
|
|
|
|
type.put("id", tokenJson.getString("dev_token_id"));
|
|
|
|
AppMsgSender sender = senderMap.get((devToken.getString("client_type")));
|
|
|
|
AppMsgSender sender = senderMap.get((tokenJson.getString("client_type")));
|
|
|
|
if (StringUtils.isBlank(token) || sender == null) {
|
|
|
|
if (StringUtils.isBlank(token) || sender == null) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -284,7 +284,7 @@ public class RetailRSvcServiceImpl implements RetailRSvcService {
|
|
|
|
managerMsg.put("data", messageData);
|
|
|
|
managerMsg.put("data", messageData);
|
|
|
|
managerMsg.put("msgType", "annual_bill");
|
|
|
|
managerMsg.put("msgType", "annual_bill");
|
|
|
|
AppMessage appMessage = new AppManagerMessageBuilder(managerMsg).buildMessage();
|
|
|
|
AppMessage appMessage = new AppManagerMessageBuilder(managerMsg).buildMessage();
|
|
|
|
sender.sendMessage(appMessage, devToken);
|
|
|
|
sender.sendMessage(appMessage, tokenJson);
|
|
|
|
log.put("status", 2);
|
|
|
|
log.put("status", 2);
|
|
|
|
appMessageLogMapper.update(log);
|
|
|
|
appMessageLogMapper.update(log);
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
@ -294,6 +294,7 @@ public class RetailRSvcServiceImpl implements RetailRSvcService {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
sendingAppleMsgPool.execute(task);
|
|
|
|
sendingAppleMsgPool.execute(task);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private String encData(String data, Key key, String publicKey) {
|
|
|
|
private String encData(String data, Key key, String publicKey) {
|
|
|
|
String pubKeyEncData = SignUtils.encData(data, publicKey);
|
|
|
|
String pubKeyEncData = SignUtils.encData(data, publicKey);
|
|
|
|