Merge branch 'poster-update' into develop

master
Yixian 3 years ago
commit 59a651e4e3

@ -603,10 +603,10 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
client.put("aps_config_id", apsConfig.getId());
client.put("alipay_cn_switch", apsConfig.getAlipayCnSwitch());
}
Boolean overseaSwitch= overseaSwitchConfigMapper.getOverseaSwitch(client.getInteger("client_id"));
if(overseaSwitch==null||overseaSwitch){
Boolean overseaSwitch = overseaSwitchConfigMapper.getOverseaSwitch(client.getInteger("client_id"));
if (overseaSwitch == null || overseaSwitch) {
client.put("oversea_wallet_switch", true);
}else{
} else {
client.put("oversea_wallet_switch", false);
}
return client;
@ -2189,7 +2189,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
JSONObject configJson = config.toJSON();
BigDecimal transactionFeeDecimal = config.getTransactionFee();
TransactionFee transFee = Optional.ofNullable(paymentApi.channelCalculator(config.getRateName()))
.map(calculator->calculator.convertTransactionFee(transactionFeeDecimal))
.map(calculator -> calculator.convertTransactionFee(transactionFeeDecimal))
.orElse(TransactionFee.ZERO);
configJson.put("transaction_fee", transFee.storeValue());
JSONObject org = orgMapper.findOne(client.getIntValue("org_id"));
@ -2709,6 +2709,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
ImageIO.write(background, "jpeg", ous);
ous.flush();
IOUtils.closeQuietly(ous);
} else {
logger.error("get aggregate poster file failed:[{}]", boardBackgroundResult.getStatusCode(),
boardBackgroundResult.getResponseContentString(), boardBackgroundResult.getException());
}
} catch (IOException e) {
throw new ServerErrorException("Error", e);
@ -4982,6 +4985,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
/**
* aps
*
* @param manager
* @param clientMoniker
* @param enableOverseaWallet
@ -4994,19 +4998,19 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
checkOrgPermission(manager, client);
Boolean overseaSwitch= overseaSwitchConfigMapper.getOverseaSwitch(client.getIntValue("client_id"));
logger.info("======>overseaSwitch:{}",overseaSwitch);
if(overseaSwitch==null){
ApsOverseasConfigData data = ApsOverseasConfigData.saveData(manager.getString("manager_id"),client.getString("client_id"),enableOverseaWallet);
logger.info("=======>data:OverseasSwitch:{}",data.getOverseasSwitch());
overseaSwitchConfigMapper.save(data);
}else{
JSONObject config=new JSONObject();
config.put("clientId", client.getString("client_id"));
config.put("modifier", manager.getString("manager_id"));
config.put("overseas_switch", enableOverseaWallet);
overseaSwitchConfigMapper.updateApsOverseasConfigByClientId(config);
}
Boolean overseaSwitch = overseaSwitchConfigMapper.getOverseaSwitch(client.getIntValue("client_id"));
logger.info("======>overseaSwitch:{}", overseaSwitch);
if (overseaSwitch == null) {
ApsOverseasConfigData data = ApsOverseasConfigData.saveData(manager.getString("manager_id"), client.getString("client_id"), enableOverseaWallet);
logger.info("=======>data:OverseasSwitch:{}", data.getOverseasSwitch());
overseaSwitchConfigMapper.save(data);
} else {
JSONObject config = new JSONObject();
config.put("clientId", client.getString("client_id"));
config.put("modifier", manager.getString("manager_id"));
config.put("overseas_switch", enableOverseaWallet);
overseaSwitchConfigMapper.updateApsOverseasConfigByClientId(config);
}
}
@Override

@ -0,0 +1,42 @@
package au.com.royalpay.payment.manage.valid;
import au.com.royalpay.payment.tools.env.PlatformEnvironment;
import au.com.royalpay.payment.tools.exceptions.ServerErrorException;
import cn.yixblog.platform.http.HttpRequestGenerator;
import cn.yixblog.platform.http.HttpRequestResult;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.io.IOUtils;
import org.junit.Test;
import org.springframework.web.bind.annotation.RequestMethod;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
public class ImageTest {
@Test
public void test() throws IOException {
try (ByteArrayOutputStream ous = new ByteArrayOutputStream()){
HttpRequestResult boardBackgroundResult = new HttpRequestGenerator("https://au.rpaygroup.com/static/images/post.jpg",
RequestMethod.GET).execute();
if (boardBackgroundResult.isSuccess()) {
InputStream ins = boardBackgroundResult.getResponseContentStream();
BufferedImage background = ImageIO.read(ins);
IOUtils.closeQuietly(ins);
// Graphics g = background.getGraphics();
// drawPosterLogo(client, g);
// g.dispose();
ImageIO.write(background, "jpeg", ous);
ous.flush();
System.out.println(ous.toByteArray().length);
}
} catch (IOException e) {
throw new ServerErrorException("Error", e);
}
}
}
Loading…
Cancel
Save