fix settle_month

master
luoyang 6 years ago
parent 4ad021d020
commit 8b8ba802ad

@ -11,6 +11,8 @@ import au.com.royalpay.payment.tools.exceptions.ServerErrorException;
import au.com.royalpay.payment.tools.lock.Locker;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.apache.commons.lang3.time.DateUtils;
import org.joda.time.DateTime;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -19,6 +21,7 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.text.DateFormat;
import java.util.Comparator;
import java.util.Date;
import java.util.List;
@ -53,7 +56,7 @@ public class SurchargeAccountServiceImpl implements SurchargeAccountService {
surchargeTrans.sort(Comparator.comparing(trans -> trans.getDate("create_time")));
JSONObject detail = new JSONObject();
detail.put("client_id", clientId);
detail.put("settle_month", dateTo.toString("yyyy-MM"));
detail.put("settle_month", dateTo.plusMonths(-1).toString("yyyy-MM"));
BigDecimal creditAmount = surchargeTrans.stream()
.filter(trans -> "Credit".equals(trans.getString("type")))
.map(trans -> trans.getBigDecimal("amount"))

Loading…
Cancel
Save