From df1e2d997ac152a7122ccb7a079d2c0debb173c2 Mon Sep 17 00:00:00 2001
From: admin <2780501319@qq.com>
Date: 星期二, 18 二月 2020 12:47:57 +0800
Subject: [PATCH] 小程序相关接口bug修改
---
fanli/src/main/java/com/yeshi/fanli/service/impl/tlj/UserTaoLiJinReportServiceImpl.java | 111 +------------------------------------------------------
1 files changed, 2 insertions(+), 109 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 a769f1c..bbc0e3a 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
@@ -2,7 +2,6 @@
import java.math.BigDecimal;
import java.util.Date;
-import java.util.List;
import javax.annotation.Resource;
@@ -10,13 +9,9 @@
import com.yeshi.fanli.dao.mybatis.tlj.UserTaoLiJinReportMapper;
import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinReport;
-import com.yeshi.fanli.exception.tlj.UserTaoLiJinOriginException;
-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;
@Service
public class UserTaoLiJinReportServiceImpl implements UserTaoLiJinReportService{
@@ -51,8 +46,6 @@
}
-
-
@Override
public void updateByPrimaryKeySelective(UserTaoLiJinReport record) {
if (record == null || record.getId() == null) {
@@ -63,110 +56,10 @@
userTaoLiJinReportMapper.updateByPrimaryKeySelective(record);
}
- @Override
- public void needUpdateReport() {
- List<UserTaoLiJinReport> list = userTaoLiJinReportMapper.needUpdateReport();
- if (list == null || list.size() == 0) {
- return;
- }
-
- for (UserTaoLiJinReport report: list) {
- UserTaoLiJinReport taoLiJinReport = null;
- try {
- taoLiJinReport = TaoKeApiUtil.getTaoLiJinEffective(report.getId());
- } catch (Exception e) {
- LogHelper.errorDetailInfo(e);
- continue;
- }
-
- if (taoLiJinReport == null) {
- continue;
- }
-
- // 鏄惁闇�瑕佹洿鏂�
- boolean needUpdate = false;
-
- if(taoLiJinReport.getWinNum() != report.getWinNum()){
- needUpdate = true;
- }
- if(taoLiJinReport.getWinAmount() != report.getWinAmount()){
- needUpdate = true;
- }
- if(taoLiJinReport.getUnfreezeNum() != report.getUnfreezeNum()){
- needUpdate = true;
- }
- if(taoLiJinReport.getUnfreezeAmount() != report.getUnfreezeAmount()){
- needUpdate = true;
- }
- if(taoLiJinReport.getPreCommissionAmount() != report.getPreCommissionAmount()){
- needUpdate = true;
- }
- if(taoLiJinReport.getUseNum() != report.getUseNum()){
- needUpdate = true;
- }
- if(taoLiJinReport.getUseAmount() != report.getUseAmount()){
- needUpdate = true;
- }
-
- if(taoLiJinReport.getAlipayAmount() != report.getAlipayAmount()){
- needUpdate = true;
- }
-
- if(taoLiJinReport.getRefundNum() != report.getRefundNum()){
- needUpdate = true;
- }
-
- // 澶辨晥閫�鍥為噾棰濆彂鐢熷彉鍖�
- BigDecimal refundAmount = taoLiJinReport.getRefundAmount();
- if(refundAmount.compareTo(report.getRefundAmount()) > 0) {
- needUpdate = true;
- try {
- userTaoLiJinOriginService.refundMoney(taoLiJinReport);
- } catch (UserTaoLiJinOriginException e) {
- e.printStackTrace();
- }
- }
-
- // 鏇存柊鎶ュ憡
- if(needUpdate) {
- taoLiJinReport.setUpdateTime(new Date());
- userTaoLiJinReportMapper.updateByPrimaryKeySelective(taoLiJinReport);
- }
- }
- }
-
@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);
- }
+ public UserTaoLiJinReport selectByPrimaryKey(String id) {
+ return userTaoLiJinReportMapper.selectByPrimaryKeyStr(id);
}
}
--
Gitblit v1.8.0