From 92c681fabac989d1a9f16fa13202d7f5ccac52d9 Mon Sep 17 00:00:00 2001 From: yujian <yujian> Date: 星期一, 14 一月 2019 10:22:22 +0800 Subject: [PATCH] 订单优化 + 后台提现曲线图 --- fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/TaoBaoWeiQuanDrawBackServiceImpl.java | 34 ++++++++++++++++++++++++++++++---- 1 files changed, 30 insertions(+), 4 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/TaoBaoWeiQuanDrawBackServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/TaoBaoWeiQuanDrawBackServiceImpl.java index 945f3a3..630b4be 100644 --- a/fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/TaoBaoWeiQuanDrawBackServiceImpl.java +++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/TaoBaoWeiQuanDrawBackServiceImpl.java @@ -25,6 +25,7 @@ import com.yeshi.fanli.entity.bus.user.HongBaoV2; import com.yeshi.fanli.entity.bus.user.UserInfo; import com.yeshi.fanli.entity.money.UserMoneyDetail; +import com.yeshi.fanli.entity.order.CommonOrder; import com.yeshi.fanli.entity.order.HongBaoOrder; import com.yeshi.fanli.entity.taobao.TaoBaoOrder; import com.yeshi.fanli.entity.taobao.TaoBaoWeiQuanDrawBack; @@ -104,18 +105,26 @@ cv.setOrderNo(orderId); typeList.add(cv); - List<CommonOrderVO> commonOrderList = commonOrderMapper.listByOrderNoAndType(typeList); + List<CommonOrderVO> commonOrderList = commonOrderMapper.listOrderGoodsInfo(typeList); List<HongBaoV2> mainHongBaoList = new ArrayList<>(); if (commonOrderList != null) for (CommonOrderVO vo : commonOrderList) { + // 淇敼璁㈠崟鐘舵�佷负缁存潈 + CommonOrder co = new CommonOrder(vo.getId()); + co.setState(CommonOrder.STATE_WQ); + co.setUpdateTime(new Date()); + commonOrderMapper.updateByPrimaryKeySelective(co); + HongBaoOrder hongBaoOrder = hongBaoOrderMapper.selectByCommonOrderId(vo.getId()); mainHongBaoList.add(hongBaoOrder.getHongBaoV2()); } if (mainHongBaoList == null || mainHongBaoList.size() == 0) return; for (int i = 0; i < mainHongBaoList.size(); i++) { + HongBaoV2 hb = hongBaoV2Mapper.selectByPrimaryKey(mainHongBaoList.get(i).getId()); + mainHongBaoList.set(i, hb); // 鍙鐞嗚繑鍒╄鍗� - if (mainHongBaoList.get(i).getType() != HongBaoV2.TYPE_ZIGOU) { + if (hb.getType() != HongBaoV2.TYPE_ZIGOU) { mainHongBaoList.remove(i); i--; } @@ -218,10 +227,16 @@ cv.setOrderNo(orderId); typeList.add(cv); - List<CommonOrderVO> commonOrderList = commonOrderMapper.listByOrderNoAndType(typeList); + List<CommonOrderVO> commonOrderList = commonOrderMapper.listOrderGoodsInfo(typeList); List<HongBaoV2> mainHongBaoList = new ArrayList<>(); if (commonOrderList != null) for (CommonOrderVO vo : commonOrderList) { + // 鏇存敼璁㈠崟鐘舵�� + CommonOrder co = new CommonOrder(vo.getId()); + co.setState(CommonOrder.STATE_WQ); + co.setUpdateTime(new Date()); + commonOrderMapper.updateByPrimaryKeySelective(co); + HongBaoOrder hongBaoOrder = hongBaoOrderMapper.selectByCommonOrderId(vo.getId()); mainHongBaoList.add(hongBaoOrder.getHongBaoV2()); } @@ -340,10 +355,18 @@ cv.setOrderNo(orderId); typeList.add(cv); - List<CommonOrderVO> commonOrderList = commonOrderMapper.listByOrderNoAndType(typeList); + List<CommonOrderVO> commonOrderList = commonOrderMapper.listOrderGoodsInfo(typeList); List<HongBaoV2> mainHongBaoList = new ArrayList<>(); if (commonOrderList != null) for (CommonOrderVO vo : commonOrderList) { + CommonOrder co = commonOrderMapper.selectByPrimaryKey(vo.getId()); + if (co.getState() != CommonOrder.STATE_WQ) { + co = new CommonOrder(vo.getId()); + co.setState(CommonOrder.STATE_WQ); + co.setUpdateTime(new Date()); + commonOrderMapper.updateByPrimaryKeySelective(co); + } + HongBaoOrder hongBaoOrder = hongBaoOrderMapper.selectByCommonOrderId(vo.getId()); mainHongBaoList.add(hongBaoOrder.getHongBaoV2()); } @@ -355,6 +378,9 @@ if (mainHongBaoList != null) for (HongBaoV2 hongBao : mainHongBaoList) { + HongBaoV2 hb = hongBaoV2Mapper.selectByPrimaryKey(hongBao.getId()); + hongBao = hb; + if (hongBao.getState() == HongBaoV2.STATE_SHIXIAO) continue; // 杩斿埄绾㈠寘涓嶈鍏� -- Gitblit v1.8.0