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