From 35ed374879219fa2134e47e0c37b363d2a020db6 Mon Sep 17 00:00:00 2001 From: Stormeye Wu Date: Fri, 9 Nov 2018 10:56:31 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=88=B7=E5=8D=A1=E6=94=AF=E4=BB=98][?= =?UTF-8?q?=E6=94=B6=E9=93=B6=E5=8F=B0]:=E6=AF=8F=E6=97=A5amount+=E4=BA=A4?= =?UTF-8?q?=E6=98=93=E6=B5=81=E6=B0=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/iformall/controller/WxMicroPayController.java | 8 ++++++++ .../com/iformall/schedule/DaliyAmountSchedule.java | 11 ++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/mallinkBApi/src/main/java/com/iformall/controller/WxMicroPayController.java b/mallinkBApi/src/main/java/com/iformall/controller/WxMicroPayController.java index 22a1932d4..e7dc45ec6 100644 --- a/mallinkBApi/src/main/java/com/iformall/controller/WxMicroPayController.java +++ b/mallinkBApi/src/main/java/com/iformall/controller/WxMicroPayController.java @@ -214,6 +214,14 @@ public class WxMicroPayController extends BaseController { return wxOrderService.microPayListOnDateAsPage(getUser().getId(), EnumOrderType.MICROPAY.getCode(), date, pageNum, pageSize); } + @ApiOperation("刷卡支付某日期交易总流水") + @GetMapping("getMicroPayAmountOnDate") + @ApiImplicitParams({ + @ApiImplicitParam(name = "date", value = "日期yyyy-MM-dd", dataType = "string", paramType = "query")}) + public ResultData getMicroPayAmountOnDate(String date) { + return wxOrderService.microPayListOnDateAsPage(getUser().getId(), EnumOrderType.MICROPAY.getCode(), date, null, null); + } + @ApiOperation(value = "刷卡支付退款", notes = "{\"orderId\":\"string\"}") @PostMapping("/microPayRefund") diff --git a/mallinkSchedule/src/main/java/com/iformall/schedule/DaliyAmountSchedule.java b/mallinkSchedule/src/main/java/com/iformall/schedule/DaliyAmountSchedule.java index 00d52fdba..3c4db504a 100644 --- a/mallinkSchedule/src/main/java/com/iformall/schedule/DaliyAmountSchedule.java +++ b/mallinkSchedule/src/main/java/com/iformall/schedule/DaliyAmountSchedule.java @@ -14,6 +14,7 @@ import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; +import java.math.BigDecimal; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.*; @@ -42,8 +43,8 @@ public class DaliyAmountSchedule { - @Scheduled(cron = "0 0 1 * * ?") // 每天凌晨1点盘点前一天的数据 - //@Scheduled(cron = "*/30 * * * * ?") // 测试10秒中一次 + //@Scheduled(cron = "0 0 1 * * ?") // 每天凌晨1点盘点前一天的数据 + @Scheduled(cron = "*/30 * * * * ?") // 测试10秒中一次 @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) public void daliyAmountSchedule() { @@ -125,13 +126,13 @@ public class DaliyAmountSchedule { wxDateAmountRecordService.saveAmount(dateAmountRecord); Map microPayMap = wxOrderMapper.dayMicroPayAmountList(dateMap); - int countMic = (int) microPayMap.get("count"); - int totalPriceMic = (int) microPayMap.get("totalPrice"); + Long countMic = (Long) microPayMap.get("count"); + BigDecimal totalPriceMic = (BigDecimal) microPayMap.get("total_price"); logger.info("find " + countMic + " order " + "\n" + "from " + startDate + " to " + new Date() + "\n" + "TOTAL Payment=" + totalPriceMic); - dateAmountRecord.setPayPrice(totalPriceMic); + dateAmountRecord.setPayPrice(totalPriceMic.intValue()); dateAmountRecord.setType(EnumDateAmtType.MICROPAY_RECORD.getCode()); wxDateAmountRecordService.saveAmount(dateAmountRecord);