hide bank details according to device

master
yixian 5 years ago
parent 65fca63a03
commit 996a6a3d42

@ -5,7 +5,7 @@
<parent>
<groupId>au.com.royalpay.payment</groupId>
<artifactId>payment-parent</artifactId>
<version>1.1.1</version>
<version>1.1.3</version>
</parent>
<modelVersion>4.0.0</modelVersion>

@ -61,16 +61,12 @@ import au.com.royalpay.payment.tools.merchants.core.MerchantInfoProvider;
import au.com.royalpay.payment.tools.permission.enums.PartnerRole;
import au.com.royalpay.payment.tools.threadpool.RoyalThreadPoolExecutor;
import au.com.royalpay.payment.tools.utils.*;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.Order;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
import com.github.qcloudsms.httpclient.HTTPException;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.RandomStringUtils;
import org.apache.commons.lang3.RandomUtils;
@ -81,7 +77,6 @@ import org.joda.time.DateTime;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;
@ -91,30 +86,20 @@ import org.springframework.web.multipart.MultipartFile;
import org.thymeleaf.context.Context;
import org.thymeleaf.spring5.SpringTemplateEngine;
import java.awt.image.BufferedImage;
import javax.annotation.Resource;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.TimeZone;
import java.util.*;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import javax.annotation.Resource;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
/**
* Created by yishuqian on 28/03/2017.
*/
@ -291,7 +276,7 @@ public class RetailAppServiceImp implements RetailAppService {
params.put("client_id", client_id);
List<JSONObject> res = transactionAnalysisMapper.getWeekClientTransaction(params);
res.forEach(r -> {
r.put("date",r.getDate("date").toString());
r.put("date", r.getDate("date").toString());
});
res.remove(res.size() - 1);
return res;
@ -1454,9 +1439,11 @@ public class RetailAppServiceImp implements RetailAppService {
@Override
public JSONObject bankAccountInfo(JSONObject device) {
String clientType = device.getString("client_type");
deviceSupport.findRegister(clientType);
DeviceRegister register = deviceSupport.findRegister(clientType);
JSONObject bankInfo = clientManager.getBankAccountByClientId(device.getIntValue("client_id"));
bankInfo.put("account_no", "***" + StringUtils.substring(bankInfo.getString("account_no"), -4));
if (register.hideBankDetails()) {
bankInfo.put("account_no", "***" + StringUtils.substring(bankInfo.getString("account_no"), -4));
}
return bankInfo;
}
@ -2345,7 +2332,7 @@ public class RetailAppServiceImp implements RetailAppService {
}
@Override
public JSONObject getClientAggregateFile(JSONObject device,MultipartFile file, String userAgent) throws IOException{
public JSONObject getClientAggregateFile(JSONObject device, MultipartFile file, String userAgent) throws IOException {
String clientType = device.getString("client_type");
deviceSupport.findRegister(clientType);
@ -2384,7 +2371,7 @@ public class RetailAppServiceImp implements RetailAppService {
JSONObject client = clientManager.getClientInfo(device.getIntValue("client_id"));
JSONObject account = clientAccountMapper.findById(device.getString("account_id"));
account.put("photo_info", photoInfo);
clientManager.commitAuthFilesToCompliance(client.getString("client_moniker"), account,"App");
clientManager.commitAuthFilesToCompliance(client.getString("client_moniker"), account, "App");
}

@ -37,6 +37,11 @@ public class GatewayOAuthRegister implements DeviceRegister {
return CLIENT_TYPE;
}
@Override
public boolean hideBankDetails() {
return false;
}
@Override
public JSONObject register(String encrypted, int type) {
return null;

@ -209,17 +209,17 @@ public class RetailAppController {
}
@GetMapping("/bank_account")
public JSONObject getBankAccountInfo(@ModelAttribute("RETAIL_DEVICE") JSONObject device) {
public JSONObject getBankAccountInfo(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) {
return retailAppService.bankAccountInfo(device);
}
@GetMapping("/current_rate")
public JSONObject getClientRate(@ModelAttribute("RETAIL_DEVICE") JSONObject device) {
public JSONObject getClientRate(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) {
return retailAppService.getClientCurrentRate(device);
}
@GetMapping("/current_rate_new")
public JSONObject getClientCurrentRateNew(@ModelAttribute("RETAIL_DEVICE") JSONObject device) {
public JSONObject getClientCurrentRateNew(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) {
return retailAppService.getClientCurrentRateNew(device);
}

Loading…
Cancel
Save