Merge branch 'hotfix-hanyin' into develop

# Conflicts:
#	src/main/java/au/com/royalpay/payment/manage/citypartner/core/impls/CityPartnerPrizeServiceImpl.java
master
yixian 6 years ago
commit 88a98f1e9e

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

@ -532,7 +532,7 @@ public class CityPartnerPrizeServiceImpl implements CityPartnerPrizeService {
String channel = oneChannel.getKey(); String channel = oneChannel.getKey();
if ("hf".equals(oneChannel.getKey().toLowerCase()) || "yeepay".equals(oneChannel.getKey().toLowerCase())) { if ("hf".equals(oneChannel.getKey().toLowerCase()) || "yeepay".equals(oneChannel.getKey().toLowerCase())) {
channel = "cbbankpay"; channel = "cb_bankpay";
} }
for (JSONObject params : oneChannel.getValue()) { for (JSONObject params : oneChannel.getValue()) {
//增加货币判断 //增加货币判断
@ -586,7 +586,7 @@ public class CityPartnerPrizeServiceImpl implements CityPartnerPrizeService {
JSONObject json = new JSONObject(); JSONObject json = new JSONObject();
String channel = oneChannel.getKey(); String channel = oneChannel.getKey();
if ("hf".equals(oneChannel.getKey().toLowerCase()) || "yeepay".equals(oneChannel.getKey().toLowerCase())) { if ("hf".equals(oneChannel.getKey().toLowerCase()) || "yeepay".equals(oneChannel.getKey().toLowerCase())) {
channel = "cbbankpay"; channel = "cb_bankpay";
} }
for (JSONObject params : oneChannel.getValue()) { for (JSONObject params : oneChannel.getValue()) {

@ -458,9 +458,8 @@ public class TestController implements ApplicationEventPublisherAware {
} }
@ManagerMapping(value = "/secure/hanyin_reports/{date}", role = ManagerRole.DEVELOPER, method = RequestMethod.GET) @ManagerMapping(value = "/secure/hanyin_reports/{date}", role = ManagerRole.DEVELOPER, method = RequestMethod.GET)
public void downloadHanyinSecureReports(@PathVariable String date, HttpServletResponse response) { public void downloadHanyinSecureReports(@PathVariable String date) {
TradeSecureFile file = tradeSecureService.getSecureReportFile(DateTime.parse(date).toDate()); tradeSecureService.uploadSecureReport(DateTime.parse(date).toDate());
file.writeToHttp(response);
} }
} }

@ -112,6 +112,7 @@ import org.apache.commons.lang3.RandomUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils; import org.apache.commons.lang3.time.DateFormatUtils;
import org.apache.commons.lang3.time.DateUtils; import org.apache.commons.lang3.time.DateUtils;
import org.apache.el.parser.AstNot;
import org.dom4j.Element; import org.dom4j.Element;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;

@ -13,21 +13,18 @@ import au.com.royalpay.payment.tools.locale.LocaleSupport;
import au.com.royalpay.payment.tools.merchants.core.MerchantInfoProvider; import au.com.royalpay.payment.tools.merchants.core.MerchantInfoProvider;
import au.com.royalpay.payment.tools.permission.enums.PartnerRole; import au.com.royalpay.payment.tools.permission.enums.PartnerRole;
import au.com.royalpay.payment.tools.utils.CurrencyAmountUtils; import au.com.royalpay.payment.tools.utils.CurrencyAmountUtils;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.time.DateFormatUtils; import org.apache.commons.lang3.time.DateFormatUtils;
import org.apache.commons.lang3.time.DateUtils; import org.apache.commons.lang3.time.DateUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Calendar; import java.util.Calendar;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import javax.annotation.Resource;
/** /**
* Create by yixian at 2018-03-20 17:44 * Create by yixian at 2018-03-20 17:44
*/ */
@ -93,10 +90,16 @@ public class ManualSettleSupportImpl implements ManualSettleSupport {
} else { } else {
todayTask = new JSONObject(); todayTask = new JSONObject();
} }
Date nextSettle = calendarMapper.findNextClearingDate(DateUtils.truncate(new Date(), Calendar.DATE));
boolean locked = DateUtils.isSameDay(nextSettle, new Date());
//今天是清算日
if (locked) {
List<JSONObject> settleLogs = clearingLogMapper.findByDate(new Date()); List<JSONObject> settleLogs = clearingLogMapper.findByDate(new Date());
//清算日但无清算记录
locked = locked && settleLogs.isEmpty();
}
//今天未清算则锁定 //今天未清算则锁定
todayTask.put("locked", settleLogs.isEmpty()); todayTask.put("locked", locked);
if (includingUnsettleData) { if (includingUnsettleData) {
Date end = findSettleTo(clientId); Date end = findSettleTo(clientId);
List<JSONObject> unsettleReports = transactionMapper.listClientUnsettleDataByDate(clientId, end); List<JSONObject> unsettleReports = transactionMapper.listClientUnsettleDataByDate(clientId, end);

@ -21,6 +21,7 @@ import java.io.ByteArrayInputStream;
import java.io.IOException; import java.io.IOException;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Vector;
/** /**
* Create by yixian at 2019-01-08 3:26 * Create by yixian at 2019-01-08 3:26
@ -66,15 +67,15 @@ public class TradeSecureServiceHanyinImpl implements TradeSecureService {
Channel channel = session.openChannel("sftp"); Channel channel = session.openChannel("sftp");
channel.connect(); channel.connect();
command = (ChannelSftp) channel; command = (ChannelSftp) channel;
command.ls("/royalpay"); String dateString = file.getTransDate().toString("yyyyMMdd");
String dir = "/royalpay/" + file.getTransDate().toString("yyyyMMdd"); Vector<ChannelSftp.LsEntry> folders = command.ls("/royalpay");
logger.debug("removing dir:{}", dir); String dir = "/royalpay/" + dateString;
command.rmdir(dir); if (folders.parallelStream().noneMatch(entry -> entry.getFilename().endsWith(dateString))) {
logger.debug("rmdir success");
logger.debug("mk dir:{}", dir); logger.debug("mk dir:{}", dir);
command.mkdir(dir); command.mkdir(dir);
}
String dest = dir + file.filename(); String dest = dir + file.filename();
logger.debug("rmdir success, start uploading file:{}", dest); logger.debug("find dir, start uploading file:{}", dest);
command.put(new ByteArrayInputStream(file.content()), dest); command.put(new ByteArrayInputStream(file.content()), dest);
} catch (IOException | JSchException | SftpException e) { } catch (IOException | JSchException | SftpException e) {
throw new ChannelNetworkException("Upload Secure file failed", e); throw new ChannelNetworkException("Upload Secure file failed", e);

@ -37,7 +37,7 @@
margin-top: 6px; margin-top: 6px;
} }
.weui-wepay-details__bd { .weui-wepay-details__bd {
padding: 12px 0; /*padding: 8px 0;*/
} }
.weui-wepay-details__line { .weui-wepay-details__line {
margin-top: 7px; margin-top: 7px;
@ -63,7 +63,7 @@
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
font-size: 14px; font-size: 14px;
line-height: 30px; line-height: 26px;
} }
.weui-wepay-detail__hd { .weui-wepay-detail__hd {
text-align: left; text-align: left;

@ -1,5 +1,5 @@
.pagehead { .pagehead {
padding: 10px 0; padding: 5px 0;
color: white; color: white;
background-color: #09bb07; background-color: #09bb07;
} }
@ -13,8 +13,8 @@
background-color: #23ac38; background-color: #23ac38;
} }
.pagehead img { .pagehead img {
width: 40px; width: 30px;
height: 40px; height: 30px;
border: 3px solid white; border: 3px solid white;
border-radius: 50%; border-radius: 50%;
vertical-align: middle; vertical-align: middle;
@ -31,15 +31,15 @@
} }
.pright { .pright {
font-size: 24px; font-size: 20px;
position: absolute; position: absolute;
right: 10%; right: 10%;
padding-top: 5px; padding-top: 2px;
vertical-align: middle; vertical-align: middle;
} }
.afterhr { .afterhr {
padding: 5px 0; /*padding: 5px 0;*/
content: " "; content: " ";
position: relative; position: relative;
bottom: 0; bottom: 0;
@ -51,7 +51,7 @@
} }
.ad { .ad {
padding: 15px 0; /*padding: 5px 0 0 0;*/
text-align: center; text-align: center;
margin: auto; margin: auto;

@ -19,7 +19,7 @@ public class AESTest {
@Test @Test
public void testEncrypt() { public void testEncrypt() {
String keyStr = "EPrfsM2JE69ZPR7BhXn34g=="; String keyStr = "EPrfsM2JE69ZPR7BhXn34g==";
String source = "123456"; String source = "P8k2rA7N:GcE/{Rn";
Key key = AESCrypt.fromKeyString(Base64.decodeBase64(keyStr)); Key key = AESCrypt.fromKeyString(Base64.decodeBase64(keyStr));
byte[] encrypted = AESCrypt.encrypt(source.getBytes(StandardCharsets.UTF_8), key); byte[] encrypted = AESCrypt.encrypt(source.getBytes(StandardCharsets.UTF_8), key);
System.out.println("encrypted: " + Base64.encodeBase64String(encrypted)); System.out.println("encrypted: " + Base64.encodeBase64String(encrypted));

Loading…
Cancel
Save