手动清算提现规则调整

master
yixian 6 years ago
parent 7f8b16cd29
commit bb6a296387

@ -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.permission.enums.PartnerRole;
import au.com.royalpay.payment.tools.utils.CurrencyAmountUtils;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.apache.commons.lang3.time.DateUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import javax.annotation.Resource;
/**
* Create by yixian at 2018-03-20 17:44
*/
@ -93,10 +90,16 @@ public class ManualSettleSupportImpl implements ManualSettleSupport {
} else {
todayTask = new JSONObject();
}
List<JSONObject> settleLogs = clearingLogMapper.findByDate(new Date());
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());
//清算日但无清算记录
locked = locked && settleLogs.isEmpty();
}
//今天未清算则锁定
todayTask.put("locked", settleLogs.isEmpty());
todayTask.put("locked", locked);
if (includingUnsettleData) {
Date end = findSettleTo(clientId);
List<JSONObject> unsettleReports = transactionMapper.listClientUnsettleDataByDate(clientId, end);
@ -135,7 +138,7 @@ public class ManualSettleSupportImpl implements ManualSettleSupport {
public List<JSONObject> listWithClearInfo() {
List<JSONObject> manuals = taskManualSettleMapper.getEveryLatestRecord();
List<Integer> client_ids = new ArrayList<>(manuals.size());
manuals.parallelStream().forEach(p->{
manuals.parallelStream().forEach(p -> {
client_ids.add(p.getInteger("client_id"));
});
List<JSONObject> clientUnsettle = transactionMapper.getClientsUnClearedAmount(client_ids);

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

Loading…
Cancel
Save