From f4a0f2acc63d7785eab108419a4e16f5f688cb95 Mon Sep 17 00:00:00 2001 From: yujian <yujian@163.com> Date: 星期六, 18 一月 2020 12:06:27 +0800 Subject: [PATCH] 用户注册信息 --- fanli/src/main/java/com/yeshi/fanli/service/impl/order/HongBaoV2ServiceImpl.java | 23 ++++++++++++++++++----- 1 files changed, 18 insertions(+), 5 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/order/HongBaoV2ServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/order/HongBaoV2ServiceImpl.java index b6cfc24..7c88661 100644 --- a/fanli/src/main/java/com/yeshi/fanli/service/impl/order/HongBaoV2ServiceImpl.java +++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/order/HongBaoV2ServiceImpl.java @@ -34,6 +34,7 @@ import com.yeshi.fanli.entity.order.CommonOrderGoods; import com.yeshi.fanli.entity.order.HongBaoOrder; import com.yeshi.fanli.entity.order.ShareGoodsActivityOrder; +import com.yeshi.fanli.entity.system.ConfigKeyEnum; import com.yeshi.fanli.entity.taobao.TaoBaoOrder; import com.yeshi.fanli.exception.order.HongBaoException; import com.yeshi.fanli.exception.order.ShareGoodsActivityOrderException; @@ -146,7 +147,7 @@ return hongBaoV2Mapper.selectByPrimaryKey(id); } - @Transactional + @Transactional(rollbackFor=Exception.class) @Override public int addHongBao(List<CommonOrder> commonOrderList, int type) throws HongBaoException, UserAccountException { Set<Integer> stateSet = new HashSet<>();// 璁㈠崟鐘舵�丼et @@ -276,7 +277,7 @@ return CommonOrder.STATE_SX; } - @Transactional + @Transactional(rollbackFor=Exception.class) private boolean updateHongBao(HongBaoOrder hongBaoOrder, CommonOrder commonOrder, int type, Map<Integer, HongBaoOrder> notificationMap) throws HongBaoException, UserAccountException { System.out.println(commonOrder.getOrderNo()); @@ -285,7 +286,7 @@ if (oldHongBao == null) throw new HongBaoException(10, "绾㈠寘瀵硅薄涓嶅瓨鍦�"); // 宸茬粡澶辨晥锛屽凡缁忛鍙栵紝鏂拌�佺姸鎬佷竴鑷寸殑绾㈠寘涓嶅仛澶勭悊 - if (oldHongBao.getState() == HongBaoV2.STATE_SHIXIAO||oldHongBao.getState() == HongBaoV2.STATE_YILINGQU) + if (oldHongBao.getState() == HongBaoV2.STATE_SHIXIAO || oldHongBao.getState() == HongBaoV2.STATE_YILINGQU) return false; if (type == HongBaoV2.TYPE_ZIGOU) {// 鑾峰彇鑷喘鐨勮繑鍒╂瘮渚� @@ -371,6 +372,9 @@ List<HongBaoV2> children = hongBaoV2Mapper.listChildrenById(hongBao.getId()); if (children != null && children.size() > 0) for (HongBaoV2 child : children) { + if (child.getState() == HongBaoV2.STATE_YILINGQU) + continue; + HongBaoV2 childUpdate = new HongBaoV2(child.getId()); childUpdate.setState(hongBao.getState()); childUpdate.setUpdateTime(new Date()); @@ -592,6 +596,9 @@ List<HongBaoV2> children = hongBaoV2Mapper.listChildrenById(hongBao.getId()); if (children != null) for (HongBaoV2 child : children) { + if (child.getState() == HongBaoV2.STATE_YILINGQU) + continue; + HongBaoV2 childUpdate = new HongBaoV2(child.getId()); // 缁熶竴璁剧疆鐘舵�� childUpdate.setState(hongBao.getState()); @@ -657,7 +664,7 @@ return true; } - @Transactional + @Transactional(rollbackFor=Exception.class) private void saveHongBao(CommonOrder commonOrder, int type, Map<Integer, HongBaoOrder> notificationMap) throws HongBaoException, UserAccountException { if (type == HongBaoV2.TYPE_ZIGOU) {// 鑾峰彇鑷喘鐨勮繑鍒╂瘮渚� @@ -879,7 +886,7 @@ shareRate = hongBaoManageService.getShareRate(commonOrder.getCreateTime().getTime()); // 鍒ゆ柇璁㈠崟鍒嗕韩娲诲姩鏄惁寮�鍚� - if ("1".equalsIgnoreCase(configService.get("share_goods_activity_open"))) { + if ("1".equalsIgnoreCase(configService.get(ConfigKeyEnum.shareGoodsActivityOpen.getKey()))) { // 娌℃湁璁㈠崟锛屽苟涓旀槸娓犻亾ID鏉ョ殑锛屽苟涓� UserExtraTaoBaoInfo taoBaoExtraInfo = userExtraTaoBaoInfoService .getByUid(commonOrder.getUserInfo().getId()); @@ -1170,5 +1177,11 @@ public List<HongBaoV2> listByIds(List<Long> idList) { return hongBaoV2Mapper.listByIds(idList); } + + + @Override + public List<HongBaoDTO> listByOrderTradeId(String tradeId) { + return hongBaoV2Mapper.listByOrderTradeId(tradeId); + } } -- Gitblit v1.8.0