|
|
|
@ -20,9 +20,11 @@ import au.com.royalpay.payment.manage.mappers.payment.OrderMapper;
|
|
|
|
|
import au.com.royalpay.payment.manage.mappers.payment.TransactionMapper;
|
|
|
|
|
import au.com.royalpay.payment.manage.mappers.system.ClientAccountMapper;
|
|
|
|
|
import au.com.royalpay.payment.manage.mappers.system.ClientDeviceTokenMapper;
|
|
|
|
|
import au.com.royalpay.payment.manage.mappers.system.ClientMapper;
|
|
|
|
|
import au.com.royalpay.payment.manage.mappers.system.ClientSettleDelayConfMapper;
|
|
|
|
|
import au.com.royalpay.payment.manage.mappers.system.CustomerMapper;
|
|
|
|
|
import au.com.royalpay.payment.manage.mappers.system.ManagerCustomerRelationAlipayMapper;
|
|
|
|
|
import au.com.royalpay.payment.manage.merchants.beans.ClientAuthFilesInfo;
|
|
|
|
|
import au.com.royalpay.payment.manage.merchants.core.ClientConfigService;
|
|
|
|
|
import au.com.royalpay.payment.manage.merchants.core.ClientManager;
|
|
|
|
|
import au.com.royalpay.payment.manage.notice.beans.NoticeInfo;
|
|
|
|
@ -156,8 +158,13 @@ public class RetailAppServiceImp implements RetailAppService {
|
|
|
|
|
private CleanService cleanService;
|
|
|
|
|
@Resource
|
|
|
|
|
private ClientConfigService clientConfigService;
|
|
|
|
|
@Resource
|
|
|
|
|
private ClientMapper clientMapper;
|
|
|
|
|
private Map<String, AppMsgSender> senderMap = new HashMap<>();
|
|
|
|
|
|
|
|
|
|
private final String fileName[] = { "source_agree_file", "client_bank_file", "client_id_file", "client_agree_file", "client_company_file",
|
|
|
|
|
"client_apply_file" };
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
public void setAppMsgSenders(AppMsgSender[] senders) {
|
|
|
|
|
Arrays.stream(senders).forEach(appMsgSender -> senderMap.put(appMsgSender.devType(), appMsgSender));
|
|
|
|
@ -255,7 +262,8 @@ public class RetailAppServiceImp implements RetailAppService {
|
|
|
|
|
JSONObject res = new JSONObject();
|
|
|
|
|
res.put("url", url);
|
|
|
|
|
res.put("qrcode", QRCodeUtils.qrcodeImageCode(url, 250, false));
|
|
|
|
|
// res.put("qrcode_board", merchantInfoProvider.getQrCodeBoard(client, config,clientAccountMapper.findById(device.getString("account_id")),"APP"));
|
|
|
|
|
// res.put("qrcode_board", merchantInfoProvider.getQrCodeBoard(client,
|
|
|
|
|
// config,clientAccountMapper.findById(device.getString("account_id")),"APP"));
|
|
|
|
|
res.put("qrcode_board", merchantInfoProvider.getQrCodeBoard(client, config));
|
|
|
|
|
return res;
|
|
|
|
|
}
|
|
|
|
@ -308,6 +316,20 @@ public class RetailAppServiceImp implements RetailAppService {
|
|
|
|
|
return cleanService.channelAndDayOfAnalysis(client_id, clearingDetailId, channel, device.getJSONObject("client"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public JSONObject getAuthFiles(JSONObject device) {
|
|
|
|
|
JSONObject client = clientManager.getClientInfo(device.getIntValue("client_id"));
|
|
|
|
|
JSONObject account = clientAccountMapper.findById(device.getString("account_id"));
|
|
|
|
|
return clientManager.getAuthFiles(account,client.getString("client_moniker"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void uploadAuthFiles(JSONObject device, ClientAuthFilesInfo clientAuthFilesInfo) {
|
|
|
|
|
JSONObject client = clientManager.getClientInfo(device.getIntValue("client_id"));
|
|
|
|
|
JSONObject account = clientAccountMapper.findById(device.getString("account_id"));
|
|
|
|
|
clientManager.uploadAuthFiles(account,client.getString("client_moniker"),clientAuthFilesInfo);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void updateClient(JSONObject device, AppClientBean appClientBean) {
|
|
|
|
|
String clientType = device.getString("client_type");
|
|
|
|
@ -334,6 +356,27 @@ public class RetailAppServiceImp implements RetailAppService {
|
|
|
|
|
return res;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public JSONObject getClientInfoRealtime(JSONObject device) {
|
|
|
|
|
return clientMapper.findClient(device.getIntValue("client_id"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public JSONObject getClientInfoMe(JSONObject device) {
|
|
|
|
|
JSONObject result = new JSONObject();
|
|
|
|
|
JSONObject client = clientMapper.findClient(device.getIntValue("client_id"));
|
|
|
|
|
if (client.getString("store_photo") == null || client.getString("logo_url") == null || client.getString("company_photo") == null) {
|
|
|
|
|
result.put("base_info_lack", true);
|
|
|
|
|
}
|
|
|
|
|
JSONObject file = clientManager.getAuthFiles(null, client.getString("client_moniker"));
|
|
|
|
|
for (String s : fileName) {
|
|
|
|
|
if (file.getString(s) == null) {
|
|
|
|
|
result.put("compliance_info_lack", true);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public JSONObject updateRetailConfig(JSONObject device, boolean clientPaySurcharge) {
|
|
|
|
|
JSONObject user = userInfo(device);
|
|
|
|
@ -1175,8 +1218,6 @@ public class RetailAppServiceImp implements RetailAppService {
|
|
|
|
|
JSONObject res = new JSONObject();
|
|
|
|
|
res.put("transactions", transactions);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
JSONObject analysis = transactionMapper.analysisRetailDailyReport(date, to, devId, device.getIntValue("client_id"), param_client_ids);
|
|
|
|
|
analysis.put("date", TimeZoneUtils.formatTime(date, "dd/MMM/yyyy", timezone));
|
|
|
|
|
analysis.put("display_amount", display_amount);
|
|
|
|
@ -1544,10 +1585,10 @@ public class RetailAppServiceImp implements RetailAppService {
|
|
|
|
|
@Override
|
|
|
|
|
public void changeManualSettle(JSONObject device, boolean manual_settle) {
|
|
|
|
|
JSONObject account = clientAccountMapper.findById(device.getString("account_id"));
|
|
|
|
|
clientManager.changeManualSettle(account,device.getIntValue("client_id"), manual_settle, device.getString("account_id"), 1, "商户"+(manual_settle?"打开":"关闭")+"手动清算");
|
|
|
|
|
clientManager.changeManualSettle(account, device.getIntValue("client_id"), manual_settle, device.getString("account_id"), 1,
|
|
|
|
|
"商户" + (manual_settle ? "打开" : "关闭") + "手动清算");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static boolean mathchLetterorNum(String str) {
|
|
|
|
|
String regex = "[A-Za-z0-9]{8}";
|
|
|
|
|
return str.matches(regex);
|
|
|
|
|