Upd:App查看交易流水汇总异常处理

master
duLingLing 5 years ago
parent d6074bc055
commit f7c049a2d6

@ -9,7 +9,7 @@
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>manage</artifactId>
<version>1.2.84</version>
<version>1.2.85</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jib-maven-plugin.version>1.4.0</jib-maven-plugin.version>

@ -964,9 +964,6 @@ public class RetailAppServiceImp implements RetailAppService {
ArrayList<String> dateContains = new ArrayList<>();
for (JSONObject order : orders) {
Calendar calendar = (Calendar) order.get("transaction_time");
if (timezone != null) {
calendar.setTimeZone(TimeZone.getTimeZone(timezone));
}
String tradeDate = DateFormatUtils.format(calendar, "yyyy-MM-dd", calendar.getTimeZone());
String tradeTime = DateFormatUtils.format(calendar, "HH:mm:ss", calendar.getTimeZone());
order.put("trade_date", tradeDate);

@ -2,16 +2,15 @@ package au.com.royalpay.payment.manage.tradelog.beans;
import au.com.royalpay.payment.core.beans.OrderStatus;
import au.com.royalpay.payment.core.beans.PayChannel;
import au.com.royalpay.payment.core.exceptions.ParamInvalidException;
import au.com.royalpay.payment.tools.defines.TradeType;
import au.com.royalpay.payment.tools.utils.TimeZoneUtils;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateUtils;
import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;
import org.joda.time.format.DateTimeFormat;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
@ -53,19 +52,16 @@ public class TradeLogQuery {
public JSONObject toParams(String timezone) {
JSONObject params = new JSONObject();
if (datefrom != null) {
try {
params.put("from", TimeZoneUtils.formatTime(format.parse(datefrom),"yyyy-MM-dd HH:mm:ss",timezone!=null?timezone:"Australia/Melbourne"));
} catch (ParseException e) {
throw new ParamInvalidException("datefrom", "error.payment.valid.invalid_date_format");
}
DateTime fromDate = DateTime.parse(datefrom, DateTimeFormat.forPattern("yyyyMMdd"))
.withZoneRetainFields(DateTimeZone.forTimeZone(TimeZone.getTimeZone(StringUtils.isNotBlank(timezone) ? timezone : "Australia/Melbourne"))).withZone(DateTimeZone.getDefault());
params.put("from", fromDate.toDate());
}
if (dateto != null) {
try {
params.put("to", TimeZoneUtils.formatTime(DateUtils.addDays(format.parse(dateto), 1),"yyyy-MM-dd HH:mm:ss",timezone!=null?timezone:"Australia/Melbourne"));
} catch (ParseException e) {
throw new ParamInvalidException("dateto", "error.payment.valid.invalid_date_format");
}
DateTime toDate = DateTime.parse(dateto, DateTimeFormat.forPattern("yyyyMMdd"))
.withZoneRetainFields(DateTimeZone.forTimeZone(TimeZone.getTimeZone(StringUtils.isNotBlank(timezone) ? timezone : "Australia/Melbourne"))).withZone(DateTimeZone.getDefault());
params.put("to", DateUtils.addDays(toDate.toDate(), 1));
}
if (StringUtils.isNotBlank(searchText)) {
params.put("search_text", searchText);
if (StringUtils.isNotBlank(textType)) {

Loading…
Cancel
Save