Merge remote-tracking branch 'origin/develop' into develop

master
yixian 5 years ago
commit 5f381ae17e

@ -5,11 +5,11 @@
<parent> <parent>
<groupId>au.com.royalpay.payment</groupId> <groupId>au.com.royalpay.payment</groupId>
<artifactId>payment-parent</artifactId> <artifactId>payment-parent</artifactId>
<version>2.1.3</version> <version>2.1.6</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>manage</artifactId> <artifactId>manage</artifactId>
<version>2.1.2</version> <version>2.1.3</version>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jib-maven-plugin.version>1.8.0</jib-maven-plugin.version> <jib-maven-plugin.version>1.8.0</jib-maven-plugin.version>
@ -77,7 +77,7 @@
<dependency> <dependency>
<groupId>com.alibaba</groupId> <groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId> <artifactId>fastjson</artifactId>
<version>1.2.62</version> <version>1.2.68</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>

@ -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"));
sendRServiceNotifyMessage(client, title, body, url); if (StringUtils.equalsIgnoreCase("PINE", client.getString("client_moniker"))||
StringUtils.equalsIgnoreCase("TUTU", client.getString("client_moniker"))) {
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,45 +257,43 @@ 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) {
// Runnable task = () -> {
// } String token = tokenJson.getString("token");
JSONObject devToken = clientDeviceTokenMapper.getTestTokens(); JSONObject log = saveAppMessageLog(tokenJson.getString("dev_id"),
Runnable task = () -> { tokenJson.getIntValue("client_id"),
String token = devToken.getString("token"); "annual_bill" + tokenJson.getString("client_type"),
JSONObject log = saveAppMessageLog(devToken.getString("dev_id"), token,
devToken.getIntValue("client_id"), "跨境商城推送"
"annual_bill" + devToken.getString("client_type"), );
token, try {
"跨境商城推送" JSONObject type = new JSONObject();
); type.put("send_type", "annual_bill");
try { type.put("id", tokenJson.getString("dev_token_id"));
JSONObject type = new JSONObject(); AppMsgSender sender = senderMap.get((tokenJson.getString("client_type")));
type.put("send_type", "annual_bill"); if (StringUtils.isBlank(token) || sender == null) {
type.put("id", devToken.getString("dev_token_id")); return;
AppMsgSender sender = senderMap.get((devToken.getString("client_type"))); }
if (StringUtils.isBlank(token) || sender == null) { JSONObject managerMsg = new JSONObject();
return; managerMsg.put("title", title);
managerMsg.put("body", body);
managerMsg.put("type", type);
JSONObject messageData = new JSONObject();
messageData.put("url", url);
managerMsg.put("data", messageData);
managerMsg.put("msgType", "annual_bill");
AppMessage appMessage = new AppManagerMessageBuilder(managerMsg).buildMessage();
sender.sendMessage(appMessage, tokenJson);
log.put("status", 2);
appMessageLogMapper.update(log);
} catch (Exception e) {
logger.error("出错了:" + e.getMessage());
appMessageLogMapper.updateStatus(log.getString("send_id"), 1, e.getMessage());
} }
JSONObject managerMsg = new JSONObject(); };
managerMsg.put("title", title); sendingAppleMsgPool.execute(task);
managerMsg.put("body", body); }
managerMsg.put("type", type);
JSONObject messageData = new JSONObject();
messageData.put("url", url);
managerMsg.put("data", messageData);
managerMsg.put("msgType", "annual_bill");
AppMessage appMessage = new AppManagerMessageBuilder(managerMsg).buildMessage();
sender.sendMessage(appMessage, devToken);
log.put("status", 2);
appMessageLogMapper.update(log);
} catch (Exception e) {
logger.error("出错了:" + e.getMessage());
appMessageLogMapper.updateStatus(log.getString("send_id"), 1, e.getMessage());
}
};
sendingAppleMsgPool.execute(task);
} }
private String encData(String data, Key key, String publicKey) { private String encData(String data, Key key, String publicKey) {

@ -1,12 +1,12 @@
package au.com.royalpay.payment.manage.mappers.system; package au.com.royalpay.payment.manage.mappers.system;
import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
import com.yixsoft.support.mybatis.autosql.annotations.AdvanceSelect; import com.yixsoft.support.mybatis.autosql.annotations.AdvanceSelect;
import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper;
import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; import com.yixsoft.support.mybatis.autosql.annotations.AutoSql;
import com.yixsoft.support.mybatis.autosql.annotations.SqlType; import com.yixsoft.support.mybatis.autosql.annotations.SqlType;
import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator; import org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator;
@ -24,7 +24,7 @@ public interface ClientMapper {
JSONObject findClient(@Param("client_id") int clientId); JSONObject findClient(@Param("client_id") int clientId);
@AutoSql(SqlType.SELECT) @AutoSql(SqlType.SELECT)
@AdvanceSelect(addonWhereClause = "is_valid=1 and length( client_moniker ) > 5") @AdvanceSelect(addonWhereClause = "is_valid=1 and length( client_moniker ) > 5 and sub_merchant_id='321888408'")
List<JSONObject> findApClient(); List<JSONObject> findApClient();
List<JSONObject> listValidClient(); List<JSONObject> listValidClient();

Loading…
Cancel
Save