From d28bed1a1275131a5ca37f7da37961e2b518ac07 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期一, 26 八月 2019 13:44:00 +0800 Subject: [PATCH] 淘礼金创建异常处理 --- fanli/src/main/java/com/yeshi/fanli/service/impl/tlj/UserTaoLiJinReportServiceImpl.java | 40 ++++++++++++++++++++++++++++++++++++++++ 1 files changed, 40 insertions(+), 0 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/tlj/UserTaoLiJinReportServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/tlj/UserTaoLiJinReportServiceImpl.java index bcde9dc..f29e2a1 100644 --- a/fanli/src/main/java/com/yeshi/fanli/service/impl/tlj/UserTaoLiJinReportServiceImpl.java +++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/tlj/UserTaoLiJinReportServiceImpl.java @@ -14,6 +14,7 @@ import com.yeshi.fanli.log.LogHelper; import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinOriginService; import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinReportService; +import com.yeshi.fanli.util.MoneyBigDecimalUtil; import com.yeshi.fanli.util.StringUtil; import com.yeshi.fanli.util.taobao.TaoKeApiUtil; @@ -134,4 +135,43 @@ } } + + @Override + public void refundNotWin() { + List<UserTaoLiJinReport> list = userTaoLiJinReportMapper.refundNotWin(); + if (list == null || list.size() == 0) { + return; + } + + for (UserTaoLiJinReport report: list) { + // 鎬讳釜鏁� + Integer totalNum = report.getTotalNum(); + BigDecimal preFace = report.getPreFace(); + + // 鎬婚噾棰� + BigDecimal money = MoneyBigDecimalUtil.mul(new BigDecimal(totalNum), preFace); + + report.setRefundNum(totalNum); + report.setRefundAmount(money); + report.setUpdateTime(new Date()); + + try { + // 閫�鍥炴窐绀奸噾 + userTaoLiJinOriginService.refundMoney(report); + + } catch (UserTaoLiJinOriginException e) { + LogHelper.errorDetailInfo(e); + continue; + } + + // 鏇存柊鎶ュ憡 + userTaoLiJinReportMapper.updateByPrimaryKeySelective(report); + } + } + + @Override + public UserTaoLiJinReport selectByPrimaryKey(String id) { + return userTaoLiJinReportMapper.selectByPrimaryKeyStr(id); + } + } -- Gitblit v1.8.0