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

master
duLingLing 5 years ago
parent a8f659549c
commit 451310fc22

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

@ -964,6 +964,9 @@ public class RetailAppServiceImp implements RetailAppService {
ArrayList<String> dateContains = new ArrayList<>(); ArrayList<String> dateContains = new ArrayList<>();
for (JSONObject order : orders) { for (JSONObject order : orders) {
Calendar calendar = (Calendar) order.get("transaction_time"); 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 tradeDate = DateFormatUtils.format(calendar, "yyyy-MM-dd", calendar.getTimeZone());
String tradeTime = DateFormatUtils.format(calendar, "HH:mm:ss", calendar.getTimeZone()); String tradeTime = DateFormatUtils.format(calendar, "HH:mm:ss", calendar.getTimeZone());
order.put("trade_date", tradeDate); order.put("trade_date", tradeDate);

@ -57,9 +57,8 @@ public class TradeLogQuery {
params.put("from", fromDate.toDate()); params.put("from", fromDate.toDate());
} }
if (dateto != null) { if (dateto != null) {
DateTime toDate = DateTime.parse(dateto, DateTimeFormat.forPattern("yyyyMMdd")) DateTime toDate = DateTime.parse(dateto, DateTimeFormat.forPattern("yyyyMMdd")).withZoneRetainFields(DateTimeZone.forTimeZone(TimeZone.getTimeZone(timezone))).plusDays(1).withZone(DateTimeZone.getDefault());
.withZoneRetainFields(DateTimeZone.forTimeZone(TimeZone.getTimeZone(StringUtils.isNotBlank(timezone) ? timezone : "Australia/Melbourne"))).withZone(DateTimeZone.getDefault()); params.put("to", toDate.toDate());
params.put("to", DateUtils.addDays(toDate.toDate(), 1));
} }
if (StringUtils.isNotBlank(searchText)) { if (StringUtils.isNotBlank(searchText)) {

Loading…
Cancel
Save