|
|
|
@ -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);
|
|
|
|
|