Upd:商户端WEB,APP查询数据异常修复

master
duLingLing 5 years ago
parent a8f659549c
commit 451310fc22

@ -42,20 +42,20 @@ public class AppQueryBean {
public JSONObject toParams() {
JSONObject params = new JSONObject();
if (begin != null) {
try {
params.put("begin", format.parse(begin));
params.put("from", format.parse(begin));
} catch (ParseException e) {
throw new ParamInvalidException("begin", "error.payment.valid.invalid_date_format");
}
DateTime fromDate = DateTime.parse(begin, DateTimeFormat.forPattern("yyyyMMdd"))
.withZoneRetainFields(DateTimeZone.forTimeZone(TimeZone.getTimeZone(StringUtils.isNotBlank(timezone)?timezone:"Australia/Melbourne"))).withZone(DateTimeZone.getDefault());
params.put("begin", fromDate.toDate());
params.put("from", fromDate.toDate());
}
if (end != null) {
try {
params.put("end", DateUtils.addDays(format.parse(end), 1));
params.put("to", DateUtils.addDays(format.parse(end), 1));
} catch (ParseException e) {
throw new ParamInvalidException("end", "error.payment.valid.invalid_date_format");
}
/* DateTime toDate = DateTime.parse(end, DateTimeFormat.forPattern("yyyyMMdd")).withZoneRetainFields(DateTimeZone.forTimeZone(TimeZone.getTimeZone(timezone))).plusDays(1).withZone(DateTimeZone.getDefault());
params.put("end", toDate.toDate());
params.put("to", toDate.toDate());*/
DateTime toDate = DateTime.parse(end, DateTimeFormat.forPattern("yyyyMMdd"))
.withZoneRetainFields(DateTimeZone.forTimeZone(TimeZone.getTimeZone(StringUtils.isNotBlank(timezone)?timezone:"Australia/Melbourne"))).withZone(DateTimeZone.getDefault());
params.put("end", DateUtils.addDays(toDate.toDate(), 1));
params.put("to", DateUtils.addDays(toDate.toDate(), 1));
}
if (gateway != null && gateway.length > 0) {
List<Integer> tradeTypes = new ArrayList<>();

@ -964,6 +964,9 @@ 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);

@ -57,9 +57,8 @@ public class TradeLogQuery {
params.put("from", fromDate.toDate());
}
if (dateto != null) {
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));
DateTime toDate = DateTime.parse(dateto, DateTimeFormat.forPattern("yyyyMMdd")).withZoneRetainFields(DateTimeZone.forTimeZone(TimeZone.getTimeZone(timezone))).plusDays(1).withZone(DateTimeZone.getDefault());
params.put("to", toDate.toDate());
}
if (StringUtils.isNotBlank(searchText)) {

Loading…
Cancel
Save