From 6b893ec0b17e28d981ec683d6ceb6c9bf4bceda4 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期日, 26 四月 2020 17:39:52 +0800 Subject: [PATCH] 用户会员等级常量修改 --- fanli/src/main/java/com/yeshi/fanli/service/impl/order/OrderProcessServiceImpl.java | 33 +++++++++++++++++++++++++-------- 1 files changed, 25 insertions(+), 8 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/order/OrderProcessServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/order/OrderProcessServiceImpl.java index 682dbe0..7bf2a59 100644 --- a/fanli/src/main/java/com/yeshi/fanli/service/impl/order/OrderProcessServiceImpl.java +++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/order/OrderProcessServiceImpl.java @@ -35,11 +35,11 @@ import com.yeshi.fanli.dto.mq.order.body.OrderMQMsg; import com.yeshi.fanli.dto.mq.order.body.OrderMoneyRecievedMQMsg; import com.yeshi.fanli.dto.order.CommonOrderAddResultDTO; +import com.yeshi.fanli.dto.order.HongBaoAddResult; import com.yeshi.fanli.entity.bus.user.HongBaoV2; import com.yeshi.fanli.entity.bus.user.Order; import com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo; import com.yeshi.fanli.entity.bus.user.UserInfo; -import com.yeshi.fanli.entity.bus.user.UserSystemCoupon; import com.yeshi.fanli.entity.elme.ElmeHongBaoOrderMap; import com.yeshi.fanli.entity.elme.ElmeOrder; import com.yeshi.fanli.entity.jd.JDOrder; @@ -1246,6 +1246,23 @@ @Transactional(rollbackFor = Exception.class) public void invalidHongBaoV2AndGiveGodenCorn(Long hongBaoId, Long uid, String orderId, int sourceType, String beiZhu) throws Exception { + HongBaoOrder hongbaoOrder = hongBaoOrderMapper.selectByHongBaoId(hongBaoId); + if (hongbaoOrder != null) { + CommonOrder commonOrder = commonOrderService.selectByPrimaryKey(hongbaoOrder.getCommonOrder().getId()); + if (commonOrder != null) { + if (commonOrder.getState() == CommonOrder.STATE_FK) { + CommonOrder updateOrder = new CommonOrder(commonOrder.getId()); + updateOrder.setState(CommonOrder.STATE_SX); + updateOrder.setUpdateTime(new Date()); + commonOrderService.updateByPrimaryKeySelective(updateOrder); + } + } + } + + HongBaoV2 hongBao = hongBaoV2Service.selectByPrimaryKey(hongBaoId); + if (hongBao == null || hongBao.getState() == HongBaoV2.STATE_SHIXIAO) + return; + HongBaoV2 v2 = new HongBaoV2(hongBaoId); v2.setState(HongBaoV2.STATE_SHIXIAO); v2.setBeizhu(beiZhu); @@ -1261,8 +1278,8 @@ hongBaoV2Service.updateByPrimaryKeySelective(update); } // TODO 鍟嗗鍏冲簵璺戣矾闇�瑕佽禒閫侀噾甯� -// userSystemCouponService.rewardCouponWin(uid, -// UserSystemCoupon.SOURCE_SYSTEM_PUSH, 1, true, new BigDecimal("31")); + // userSystemCouponService.rewardCouponWin(uid, + // UserSystemCoupon.SOURCE_SYSTEM_PUSH, 1, true, new BigDecimal("31")); } @Transactional @@ -1371,16 +1388,16 @@ private void addHongBaoWithMQ(List<CommonOrderAddResultDTO> commonOrderList, String orderId, Long uid, int sourceType, int hongBaoType) { final List<CommonOrder> coList = convertCommonOrder(commonOrderList); - int resultCode = 0; + HongBaoAddResult result = null; try { long time = TimeUtil.convertToTimeTemp("2019-12-06", "yyyy-MM-dd"); if (!Constant.IS_TEST) time = TimeUtil.convertToTimeTemp("2019-12-20", "yyyy-MM-dd"); if (coList.get(0).getThirdCreateTime().getTime() < time) - resultCode = hongBaoV2Service.addHongBao(coList, hongBaoType); + result = hongBaoV2Service.addHongBao(coList, hongBaoType); else - resultCode = hongBaoV2AddManager.addHongBao(coList, hongBaoType); + result = hongBaoV2AddManager.addHongBao(coList, hongBaoType); } catch (HongBaoException e) { try { LogHelper.errorDetailInfo(e, "addJDOrder鎴朼ddHongBao鍑洪敊", "璁㈠崟鍙�:" + orderId); @@ -1391,9 +1408,9 @@ } if (!Constant.IS_TEST) - if (resultCode == 1) {// 鍙彂閫佹柊澧炴秷鎭� + if (result.getResultCode() == HongBaoAddResult.CODE_ADD) {// 鍙彂閫佹柊澧炴秷鎭� OrderMQMsg mqMsg = new OrderMQMsg(orderId, sourceType, uid, OrderMQMsg.HANDLE_TYPE_ADD, - isCommonOrderValid(coList), 0, new Date()); + isCommonOrderValid(coList), 0, new Date(), result.isMiandan()); Message msg = MQMsgBodyFactory.create(MQTopicName.TOPIC_ORDER, OrderTopicTagEnum.orderStatistic, mqMsg); producer.send(msg); } -- Gitblit v1.8.0