Merge branch 'develop'

# Conflicts:
#	pom.xml
master
luoyang 5 years ago
commit c752d2c33f

@ -9,7 +9,7 @@
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>manage</artifactId>
<version>1.3.15</version>
<version>1.3.16</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jib-maven-plugin.version>1.4.0</jib-maven-plugin.version>

@ -4,6 +4,7 @@ import au.com.royalpay.payment.manage.pushMessage.bean.AppManagerMessageBuilder;
import au.com.royalpay.payment.manage.pushMessage.bean.AppMessageType;
import au.com.royalpay.payment.tools.device.message.AppMessage;
import au.com.royalpay.payment.tools.env.RequestEnvironment;
import au.com.royalpay.payment.tools.permission.enums.PartnerRole;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.StringUtils;
@ -21,7 +22,7 @@ public class RetailAppMessage {
JSONObject msg = new JSONObject();
msg.put("appid", appid);
msg.put("client_id", clientId);
msg.put("role", "admin");
msg.put("role", PartnerRole.ADMIN.getCode());
msg.put("title", title);
msg.put("body", body);
msg.put("send_time", new Date());

@ -2507,6 +2507,12 @@ public class RetailAppServiceImp implements RetailAppService {
if (PartnerRole.getRole(account.getIntValue("role")) == PartnerRole.CASHIER) {
authFileStatus.put("client_less_file", false);
}
JSONObject compliance = clientComplianceCompanyMapper.findFileByClientId(account.getIntValue("client_id"));
if (compliance != null) {
if (compliance.getIntValue("status")==0 || compliance.getIntValue("status")==1) {
authFileStatus.put("client_less_file", false);
}
}
return authFileStatus;
}
@ -2620,6 +2626,9 @@ public class RetailAppServiceImp implements RetailAppService {
complianceFilesNotice.put("type", messageSource.getMessage("client.auth.file.compliance.type", null, RequestEnvironment.getLocale()));
complianceFilesNotice.put("client_less_file",complianceFileStatus.getBoolean("client_less_file"));
if(compliance != null){
if (compliance.getIntValue("status")==0 || compliance.getIntValue("status")==1) {
complianceFilesNotice.put("client_less_file", false);
}
if(complianceFileStatus.getBoolean("client_less_file")){
complianceFilesNotice.put("client_refuse_reason",compliance.getString("description"));
}

@ -838,7 +838,7 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
int rowNum = 0;
Row row = sheet.createRow(rowNum);
String[] title = {"order Id", "Client Order Id", "Transaction Time", "Channel", "Gateway", "Exchange Rate", "Transaction Type", "Currency",
"Input Amount", "Total Amount", "Clearing Amount(AUD)", "Sruchange Rate", "Surcharge(AUD)", "GST(AUD)", "Settle Amount(AUD)", "Remark", "Dev No"};
"Input Amount", "Total Amount", "Clearing Amount(AUD)", "Sruchange Rate", "Surcharge(AUD)", "GST(AUD)", "Settle Amount(AUD)", "Remark", "Dev No","Dev Remark"};
String[] analysis = {"Total Credit(AUD)", "Total Debit(AUD)", "Gross Amount(AUD)", "Total GST(AUD)", "Total Charge(AUD)", "Net Amount(AUD)"};
for (int i = 0; i < title.length; i++) {
row.createCell(i, Cell.CELL_TYPE_STRING).setCellValue(title[i]);
@ -900,9 +900,13 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
row.createCell(15, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("order_detail"));
String clientDevId = StringUtils.defaultString(settle.getString("dev_id"), "-");
JSONObject device = clientDeviceMapper.find(settle.getString("dev_id"));
if (device != null)
String clientDevRemark = "-";
if (device != null) {
clientDevId = device.getString("client_dev_id");
clientDevRemark = device.getString("remark");
}
row.createCell(16, Cell.CELL_TYPE_STRING).setCellValue(clientDevId);
row.createCell(17, Cell.CELL_TYPE_STRING).setCellValue(clientDevRemark);
}
row = sheet.createRow(++rowNum);
for (int i = 0; i < analysis.length; i++) {

@ -24,7 +24,7 @@ public interface ClientDeviceTokenMapper {
List<JSONObject> listTokensByClient_id(@Param("client_id") int client_id);
List<JSONObject> listTokensByAccountId(@Param("client_id") String accountId);
List<JSONObject> listTokensByAccountId(@Param("account_id") String accountId);
List<JSONObject> listAllTokens(JSONObject devToken);

@ -3,14 +3,12 @@ package au.com.royalpay.payment.manage.pushMessage;
import com.alibaba.fastjson.JSONObject;
import com.notnoop.apns.APNS;
import com.notnoop.apns.ApnsService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.Resource;
import org.springframework.stereotype.Service;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
@ -21,28 +19,28 @@ import java.io.InputStream;
public class APNSMessageHelper {
private Logger logger = LoggerFactory.getLogger(getClass());
@Value("classpath:apple_message_cert_dev.p12")
private org.springframework.core.io.Resource appleMessageFileDev;
@Value("${apple.message.apns.file}")
private String appleApnsFile;
@Value("${apple.message.apns.file:classpath:apple_message_cert_dev.p12}")
private Resource appleApnsFile;
@Value("${apple.message.apns.password}")
private String appleMessagePassword;
public void sendAppleMessage(String title, String body, String token, JSONObject data, JSONObject type) throws IOException {
/**设置参数,发送数据**/
InputStream keyIns = new FileInputStream(new File(appleApnsFile));
ApnsService service = APNS.newService().withCert(keyIns, appleMessagePassword).withProductionDestination().build();
String payload = APNS.newPayload().alertTitle(title).alertBody(body).badge(1).sound("default").customField("data", data).customField("type", type).build();
service.push(token, payload);
logger.debug("推送信息已发送!");
try (InputStream keyIns = appleApnsFile.getInputStream()) {
ApnsService service = APNS.newService().withCert(keyIns, appleMessagePassword).withProductionDestination().build();
String payload = APNS.newPayload().alertTitle(title).alertBody(body).badge(1).sound("default").customField("data", data).customField("type", type).build();
service.push(token, payload);
logger.debug("推送信息已发送!");
}
}
public void sendAppleMessageDetail(String title, String body, String token, JSONObject data, JSONObject type) throws IOException {
/**设置参数,发送数据**/
InputStream keyIns = new FileInputStream(new File(appleApnsFile));
ApnsService service = APNS.newService().withCert(keyIns, appleMessagePassword).withProductionDestination().build();
String payload = APNS.newPayload().alertTitle(title).alertBody(body).category("myNotificationCategory").badge(1).sound("default").customField("data", data).customField("type", type).build();
service.push(token, payload);
logger.debug("推送信息已发送!");
try (InputStream keyIns = appleApnsFile.getInputStream()) {
ApnsService service = APNS.newService().withCert(keyIns, appleMessagePassword).withProductionDestination().build();
String payload = APNS.newPayload().alertTitle(title).alertBody(body).category("myNotificationCategory").badge(1).sound("default").customField("data", data).customField("type", type).build();
service.push(token, payload);
logger.debug("推送信息已发送!");
}
}
}

@ -20,7 +20,6 @@
FROM sys_clients_devices_token t
INNER JOIN sys_clients_devices d ON t.dev_id = d.dev_id and d.account_id=#{account_id} and d.is_offline=0
WHERE t.is_valid = 1
GROUP BY token
</select>
<select id="listAllTokensByClient_id" resultType="com.alibaba.fastjson.JSONObject">

@ -92,12 +92,12 @@
<select class="form-control" ng-model="file.file_company.id_type" style="width: 250px" ng-change="setSession(file.file_company.id_type)">
<option value="">Please Choose</option>
<option value="passport" >Passport</option>
<option value="driver_license">Driver's license</option>
<option value="driver_license">Driver license</option>
</select>
<p class="text-info">
<i class="fa fa-info"></i> Please select the file type for uploading the ID.<br>
<i class="fa fa-info"></i> Uploading your passport file requires you to upload your utility bill file. <br>
<i class="fa fa-info"></i> You can upload your driver's license and leave the utility bill file blank. <br>
<i class="fa fa-info"></i> You can upload your driver license and leave the utility bill file blank. <br>
<i class="fa fa-info"></i> 请选择上传ID的文件类型.<br>
<i class="fa fa-info"></i> 上传护照文件需要您上传水电煤账单文件.<br>
<i class="fa fa-info"></i> 上传驾照,水电煤账单文件可以不填.

@ -62,16 +62,16 @@
ng-model="file.id_type" style="width: 250px" ng-change="setSession(file.id_type)">
<option value="">Please Choose</option>
<option value="passport" >Passport</option>
<option value="driver_license">Driver's license</option>
<option value="driver_license">Driver license</option>
</select>
<div ng-if="!currentUser.lessKycFiles">
<p ng-if="file.id_type == 'passport'" >Passport</p>
<p ng-if="file.id_type == 'driver_license' ">Driver's license</p>
<p ng-if="file.id_type == 'driver_license' ">Driver license</p>
</div>
<p class="text-info">
<i class="fa fa-info"></i> Please select the file type for uploading the ID.<br>
<i class="fa fa-info"></i> Uploading your passport file requires you to upload your utility bill file. <br>
<i class="fa fa-info"></i> You can upload your driver's license and leave the utility bill file blank. <br>
<i class="fa fa-info"></i> You can upload your driver license and leave the utility bill file blank. <br>
<i class="fa fa-info"></i> 请选择上传ID的文件类型.<br>
<i class="fa fa-info"></i> 上传护照文件需要您上传水电煤账单文件.<br>
<i class="fa fa-info"></i> 上传驾照,水电煤账单文件可以不填.

@ -59,7 +59,7 @@
<div class="col-sm-4">
<div class="form-control-static">
<p ng-if="file.companyFile.id_type == 'passport'" >Passport</p>
<p ng-if="file.companyFile.id_type == 'driver_license' ">Driver's license</p>
<p ng-if="file.companyFile.id_type == 'driver_license' ">Driver license</p>
</select>
</div>
</div>

@ -70,7 +70,7 @@
ng-model="file.id_type" style="width: 250px" ng-change="setSession(file.id_type)">
<option value="">Please Choose</option>
<option value="passport" >Passport</option>
<option value="driver_license">Driver's license</option>
<option value="driver_license">Driver license</option>
</select>
<p class="text-info">
<i class="fa fa-info"></i> If client have already attached surcharge in their own system, ignore this choice.<br>

@ -79,7 +79,7 @@
<div class="col-sm-6">
<div class="form-control-static">
<p ng-if="file.file_company.id_type == 'passport'" >Passport</p>
<p ng-if="file.file_company.id_type == 'driver_license' ">Driver's license</p>
<p ng-if="file.file_company.id_type == 'driver_license' ">Driver license</p>
</select>
</div>
</div>

@ -0,0 +1,46 @@
package au.com.royalpay.payment.manage.valid;
import au.com.royalpay.payment.tools.device.message.AppMessage;
import au.com.royalpay.payment.tools.exceptions.ServerErrorException;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.notnoop.apns.APNS;
import com.notnoop.apns.ApnsService;
import org.apache.commons.lang3.StringUtils;
import org.junit.Test;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.UUID;
/**
* Create by davep at 2020-01-06 16:04
*/
public class APNSTest {
@Test
public void test() throws IOException {
String appleMessagePassword = "BSNMNkxPq0AT";
AppMessage msg = new AppMessage("MESSAGE","test","test content");
JSONObject data = new JSONObject();
data.put("send_type","rloan_creditFinished");
msg.setData(data);
JSONObject typeData = new JSONObject();
typeData.put("send_type","MESSAGE");
typeData.put("id", UUID.randomUUID().toString());
msg.setTypeData(typeData);
URL cert = getClass().getClassLoader().getResource("rloan_dev_apns.p12");
try(InputStream keyIns = cert.openStream()) {
ApnsService service = APNS.newService().withCert(keyIns, appleMessagePassword)
.withSandboxDestination().build();
String payload = APNS.newPayload().alertTitle("test").alertBody("test")
.badge(1).sound("default").customField("data", msg.getData()).customField("type", msg.getTypeData()).build();
JSONObject p = JSON.parseObject(payload);
JSONObject aps = p.getJSONObject("aps");
aps.put("mutable-content", "1");
service.push("486A623E9A5AC2EB28DFBF3C827979293E9E9F9E1252603E7E1F8C878695FA57", p.toJSONString());
}
}
}
Loading…
Cancel
Save