From e3630931fd42db00db2bf4fe544292bbc7640447 Mon Sep 17 00:00:00 2001
From: yujian <yujian>
Date: 星期五, 04 一月 2019 10:03:10 +0800
Subject: [PATCH] 去掉订单筛选返回“今日”字样
---
fanli/src/main/java/com/yeshi/fanli/service/impl/order/OrderProcessServiceImpl.java | 362 +++++++++++++++++++++++++++++++++++++++++++++------
1 files changed, 318 insertions(+), 44 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 de532c1..f4dce2c 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
@@ -13,6 +13,7 @@
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import com.yeshi.fanli.dao.mybatis.AccountDetailsMapper;
@@ -23,6 +24,7 @@
import com.yeshi.fanli.dao.mybatis.ThreeSaleGiftMapper;
import com.yeshi.fanli.dao.mybatis.UserInfoMapper;
import com.yeshi.fanli.dao.mybatis.hongbao.HongBaoMapper;
+import com.yeshi.fanli.dao.mybatis.money.UserMoneyDetailMapper;
import com.yeshi.fanli.dao.mybatis.order.OrderItemMapper;
import com.yeshi.fanli.dao.mybatis.order.OrderMapper;
import com.yeshi.fanli.dao.mybatis.share.PidUserMapper;
@@ -30,10 +32,13 @@
import com.yeshi.fanli.entity.bus.user.AccountDetails;
import com.yeshi.fanli.entity.bus.user.HongBao;
import com.yeshi.fanli.entity.bus.user.HongBaoExtra;
+import com.yeshi.fanli.entity.bus.user.HongBaoV2;
import com.yeshi.fanli.entity.bus.user.MoneyRecord;
import com.yeshi.fanli.entity.bus.user.Order;
import com.yeshi.fanli.entity.bus.user.OrderItem;
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.taobao.PidOrder;
import com.yeshi.fanli.entity.taobao.PidUser;
import com.yeshi.fanli.entity.taobao.TaoBaoOrder;
@@ -44,8 +49,14 @@
import com.yeshi.fanli.exception.ObjectStateException;
import com.yeshi.fanli.exception.OrderItemException;
import com.yeshi.fanli.exception.TaoBaoWeiQuanException;
+import com.yeshi.fanli.exception.money.UserMoneyDetailException;
+import com.yeshi.fanli.exception.order.CommonOrderException;
import com.yeshi.fanli.log.LogHelper;
+import com.yeshi.fanli.service.inter.hongbao.AccountDetailsHongBaoMapService;
+import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
import com.yeshi.fanli.service.inter.hongbao.HongBaoService;
+import com.yeshi.fanli.service.inter.hongbao.HongBaoV2Service;
+import com.yeshi.fanli.service.inter.order.CommonOrderService;
import com.yeshi.fanli.service.inter.order.LostOrderService;
import com.yeshi.fanli.service.inter.order.OrderItemServcie;
import com.yeshi.fanli.service.inter.order.OrderProcessService;
@@ -62,6 +73,7 @@
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.TimeUtil;
import com.yeshi.fanli.util.factory.AccountDetailsFactory;
+import com.yeshi.fanli.util.factory.UserMoneyDetailFactory;
import com.yeshi.fanli.util.taobao.TaoBaoOrderUtil;
@Service
@@ -136,6 +148,15 @@
@Resource
private TaoBaoWeiQuanOrderMapper taoBaoWeiQuanOrderMapper;
+ @Resource
+ private HongBaoManageService hongBaoManageService;
+
+ @Resource
+ private AccountDetailsHongBaoMapService accountDetailsHongBaoMapService;
+
+ @Resource
+ private UserMoneyDetailMapper userMoneyDetailMapper;
+
@Override
public void processOrder(Map<String, List<TaoBaoOrder>> orders) {
List<TaoBaoUnionConfig> configList = taoBaoUnionConfigService.getConfigByTypeCache(PidUser.TYPE_FANLI_ANDROID);
@@ -143,7 +164,8 @@
// 鍒嗙鍑鸿繑鍒╄鍗曚笌鍒嗕韩璧氳鍗�
Iterator<String> its = orders.keySet().iterator();
Map<String, List<TaoBaoOrder>> fanliOrderMap = new HashMap<>();
- Map<String, List<PidOrder>> shareOrderMap = new HashMap<>();
+ Map<String, List<PidOrder>> sharePidOrderMap = new HashMap<>();
+ Map<String, List<TaoBaoOrder>> shareOrderMap = new HashMap<>();
while (its.hasNext()) {
String orderId = its.next();
if (orders.get(orderId) != null && orders.get(orderId).size() > 0) {
@@ -152,11 +174,12 @@
list.get(0).getSourceMediaId(), list.get(0).getAdPositionId());
PidUser pidUser = pidUserMapper.selectByPid(pid);
if (pidUser != null && pidUser.getType() == PidUser.TYPE_SHARE_GOODS) {// 鍟嗗搧鍒嗕韩璁㈠崟
- List<PidOrder> pidOrderList = new ArrayList<>();
- for (TaoBaoOrder order : list) {
- pidOrderList.add(TaoBaoOrderUtil.convertToPidOrder(order));
- }
- shareOrderMap.put(orderId, pidOrderList);
+ // List<PidOrder> pidOrderList = new ArrayList<>();
+ // for (TaoBaoOrder order : list) {
+ // pidOrderList.add(TaoBaoOrderUtil.convertToPidOrder(order));
+ // }
+ // sharePidOrderMap.put(orderId, pidOrderList);
+ shareOrderMap.put(orderId, list);
} else {// 鏅�氳繑鍒╄鍗�
fanliOrderMap.put(orderId, list);
}
@@ -204,19 +227,20 @@
return false;
}
- @Transactional
@Override
public void processShopingFanliOrder(Map<String, List<TaoBaoOrder>> orders) {
// 鏌ヨ鍦∣rder涓槸鍚﹀瓨鍦ㄨ璁㈠崟鍙�
Iterator<String> its = orders.keySet().iterator();
+ String tempOrderId = "";
while (its.hasNext()) {
try {
String orderId = its.next();
+ tempOrderId = orderId;
// 澶勭悊绾㈠寘涓庡瓙绾㈠寘
// if (isRedisLockOrder(orderId))
// continue;
// redisLockOrder(orderId);
- processShopingFanliOrder(orderId, orders.get(orderId));
+ processShopingFanliOrderNew(orderId, orders.get(orderId));
// redisUnlockOrder(orderId);
// 鍑洪敊浜嗗氨涓嶅鐞嗚璁㈠崟浜嗭紝闇�瑕佸畾鏈熸鏌�
@@ -228,15 +252,27 @@
} catch (OrderItemException e2) {
e2.printStackTrace();
} catch (Exception e) {
-
+ e.printStackTrace();
+ try {
+ LogHelper.errorDetailInfo(e, null, tempOrderId);
+ } catch (Exception e1) {
+ e1.printStackTrace();
+ }
}
}
}
@Transactional
@Override
- public void processShareGoodsOrder(Map<String, List<PidOrder>> orders) {
- pidOrderService.addPidOrderFromTaoBao(orders);
+ public void processShareGoodsOrder(Map<String, List<TaoBaoOrder>> orders) {
+ // pidOrderService.addPidOrderFromTaoBao(orders);
+ if (orders != null) {
+ Iterator<String> its = orders.keySet().iterator();
+ while (its.hasNext()) {
+ String orderId = its.next();
+ processShareGoodsOrderNew(orderId, orders.get(orderId));
+ }
+ }
}
/**
@@ -417,7 +453,7 @@
orderMapper.updateByPrimaryKeySelective(updateOrder);
Order order = oldOrder;
// 璁㈠崟杩斿埄姣斾緥
- BigDecimal rate = new BigDecimal(hongBaoManageMapper.selectByKey("hongbao_goods_proportion").getValue());
+ BigDecimal rate = hongBaoManageService.getFanLiRate();
// 鏌ユ壘鏄惁瀛樺湪绾㈠寘
List<HongBao> hongBaoList = hongBaoMapper.selectByOid(order.getId());
@@ -501,6 +537,23 @@
AccountDetailsFactory.FANLI, orderItem, null, hb.getUserInfo());
accountDetailsMapper.insertSelective(accountDetails);
+ // 鎻掑叆鏂扮増璧勯噾鏄庣粏
+ try {
+ UserMoneyDetail userMoneyDetail = UserMoneyDetailFactory.createFanLi(hb.getUserInfo().getId(),
+ hb.getOrderId(), 1, hb.getId(), hb.getMoney());
+ userMoneyDetail.setId(accountDetails.getId());
+ userMoneyDetailMapper.insert(userMoneyDetail);
+ } catch (UserMoneyDetailException e1) {
+ try {
+ LogHelper.errorDetailInfo(e1);
+ } catch (Exception e2) {
+ e2.printStackTrace();
+ }
+ }
+
+ // 娣诲姞璧勯噾鏄庣粏涓庣孩鍖呯殑鏄犲皠鍏崇郴
+ accountDetailsHongBaoMapService.saveAccountDetailsHongBaoMap(hb.getId(), accountDetails.getId());
+
// 缁存潈鎵f锛�2018-08-05鍚庡紑濮嬪疄琛岋級
if (hb.getBalanceTime() != null
&& hb.getBalanceTime().getTime() >= TimeUtil.convertToTimeTemp("2018-08-05", "yyyy-MM-dd")) {
@@ -573,25 +626,49 @@
}
}
+ private HongBao filterWeiQuanINGHongBao(HongBao hongBao) {
+
+ List<TaoBaoWeiQuanOrder> taoBaoWeiQuanList = taoBaoWeiQuanOrderMapper
+ .selectListByOrderIdAndState(hongBao.getOrderId(), "缁存潈鍒涘缓");
+
+ List<TaoBaoWeiQuanOrder> taoBaoWeiQuanList1 = taoBaoWeiQuanOrderMapper
+ .selectListByOrderIdAndState(hongBao.getOrderId(), "绛夊緟澶勭悊");
+ if ((taoBaoWeiQuanList != null && taoBaoWeiQuanList.size() > 0)
+ || (taoBaoWeiQuanList1 != null && taoBaoWeiQuanList1.size() > 0)) {
+ return null;
+ }
+ return hongBao;
+ }
+
@Override
@Transactional
public void fanliInvaiteAndShare(Long uid) throws TaoBaoWeiQuanException {
+ /**
+ * 澶勭悊閭�璇疯禋璁㈠崟
+ */
// 鏌ヨUID鐨勯個璇疯禋璁㈠崟
List<HongBao> hongBaoList = hongBaoMapper.selectCanBalanceHongBaoByChildHongBaoAndUid(uid);
- BigDecimal money = new BigDecimal(0);
+ List<Long> hbIdList = new ArrayList<>();
+
+ BigDecimal invitemoney = new BigDecimal(0);
// 闇�瑕佸垽鏂��娆剧殑璁㈠崟鍙�
Set<String> drawBackOrders = new HashSet<String>();
-
for (HongBao hongBao : hongBaoList) {
+ hongBao = filterWeiQuanINGHongBao(hongBao);
+ if (hongBao == null)
+ continue;
+
hongBao = hongBaoMapper.selectByPrimaryKeyForUpdate(hongBao.getId());
if (hongBao.getState() == HongBao.STATE_BUKELINGQU || hongBao.getState() == HongBao.STATE_KELINGQU) {
- money = money.add(hongBao.getMoney());
+ invitemoney = invitemoney.add(hongBao.getMoney());
HongBao updateHongBao = new HongBao();
updateHongBao.setId(hongBao.getId());
updateHongBao.setGetTime(System.currentTimeMillis());
updateHongBao.setState(HongBao.STATE_YILINGQU);
hongBaoMapper.updateByPrimaryKeySelective(updateHongBao);
+ // 娣诲姞鍒扮孩鍖呰繑鍒╄褰曢泦鍚�
+ hbIdList.add(hongBao.getId());
// 2018-08-05 杩囧悗鐨勮鍗曟墠澶勭悊缁存潈
Date balanceTime = null;
if (hongBao.getParent() != null)
@@ -608,17 +685,101 @@
}
}
+ /**
+ * 澶勭悊涓�绾т簩绾у垎浜禋(灞炰簬閭�璇疯禋绫诲瀷)
+ */
+
+ List<HongBao> totalHongBaoList = new ArrayList<>();
+ // 鏌ヨUID鐨勪簩绾ф垨鑰呬笁绾у垎浜禋璁㈠崟
+ // TODO 鏆傛椂鏌ヨ10000鏉℃暟鎹紝鍚庨潰鍐嶅仛鍒嗛〉
+ List<HongBao> hbList = hongBaoMapper.selectCanBalanceHongBaoByTypeAndUid(HongBao.TYPE_SHARE_YIJI, uid, 10000);
+
+ if (hbList != null && hbList.size() > 0)
+ totalHongBaoList.addAll(hbList);
+
+ hbList = hongBaoMapper.selectCanBalanceHongBaoByTypeAndUid(HongBao.TYPE_SHARE_ERJI, uid, 10000);
+ if (hbList != null && hbList.size() > 0)
+ totalHongBaoList.addAll(hbList);
+
+ for (HongBao hb : totalHongBaoList) {
+ if (hb.getState() == HongBao.STATE_BUKELINGQU || hb.getState() == HongBao.STATE_KELINGQU) {
+ hb = filterWeiQuanINGHongBao(hb);
+ if (hb == null)
+ continue;
+ invitemoney = invitemoney.add(hb.getMoney());
+ HongBao updateHongBao = new HongBao();
+ updateHongBao.setId(hb.getId());
+ updateHongBao.setGetTime(System.currentTimeMillis());
+ updateHongBao.setState(HongBao.STATE_YILINGQU);
+ hongBaoMapper.updateByPrimaryKeySelective(updateHongBao);
+ // 娣诲姞鍒扮孩鍖呰繑鍒╄褰曢泦鍚�
+ hbIdList.add(hb.getId());
+ if (!StringUtil.isNullOrEmpty(hb.getOrderId()))
+ drawBackOrders.add(hb.getOrderId());
+ }
+ }
+
+ // 閭�璇疯禋鍒拌处
+ if (invitemoney.compareTo(new BigDecimal(0)) > 0) {
+ userInfoMapper.addHongBaoByUid(uid, invitemoney);
+ // 娣诲姞璁板綍
+ AccountDetails accountDetails = AccountDetailsFactory.create("+" + invitemoney,
+ AccountDetailsFactory.TICHENG, null, null, new UserInfo(uid));
+ accountDetailsMapper.insertSelective(accountDetails);
+
+ // 娣诲姞鏂扮増璇︽儏璁板綍
+ try {
+ UserMoneyDetail userMoneyDetail = UserMoneyDetailFactory.createInvite(uid, 0, 0, 0, invitemoney,
+ new Date());
+ userMoneyDetail.setId(accountDetails.getId());
+ userMoneyDetailMapper.insert(userMoneyDetail);
+ } catch (UserMoneyDetailException e) {
+ try {
+ LogHelper.errorDetailInfo(e);
+ } catch (Exception e1) {
+ e1.printStackTrace();
+ }
+ }
+
+ // 璁板綍杩斿埄绾㈠寘涓庤祫閲戣鎯呯殑瀵瑰簲鍏崇郴
+
+ // 娣诲姞鍒扮孩鍖呰繑鍒╄褰曢泦鍚�
+ accountDetailsHongBaoMapService.saveAccountDetailsHongBaoMap(hbIdList, accountDetails.getId());
+
+ // 鍙戦�佹帹閫�
+ try {
+ // 鎻愭垚鍒拌处娑堟伅閫氱煡
+ userNotificationService.tiChengInviteRecieved(uid, invitemoney);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ for (String orderId : drawBackOrders)
+ taoBaoWeiQuanDrawBackService.doWeiQuanInvite(orderId);
+ }
+
+ hbIdList.clear();
+ drawBackOrders.clear();
+
+ /**
+ * 澶勭悊鍒嗕韩璧�
+ */
+ BigDecimal sharemoney = new BigDecimal(0);
// 鏌ヨUID鐨勫垎浜禋璁㈠崟
List<PidOrder> pidOrderList = pidOrderMapper.getCanBalanceListByUid(uid);
for (PidOrder pidOrder : pidOrderList) {
HongBao hongBao = hongBaoMapper.selectByPrimaryKeyForUpdate(pidOrder.getHongBao().getId());
+ hongBao = filterWeiQuanINGHongBao(hongBao);
+ if (hongBao == null)
+ continue;
if (hongBao.getState() == HongBao.STATE_BUKELINGQU || hongBao.getState() == HongBao.STATE_KELINGQU) {
- money = money.add(hongBao.getMoney());
+ sharemoney = sharemoney.add(hongBao.getMoney());
HongBao updateHongBao = new HongBao();
updateHongBao.setId(hongBao.getId());
updateHongBao.setGetTime(System.currentTimeMillis());
updateHongBao.setState(HongBao.STATE_YILINGQU);
hongBaoMapper.updateByPrimaryKeySelective(updateHongBao);
+ // 娣诲姞鍒扮孩鍖呰繑鍒╄褰曢泦鍚�
+ hbIdList.add(hongBao.getId());
// 2018-08-05 杩囧悗鐨勮鍗曟墠澶勭悊缁存潈
Date balanceTime = null;
if (hongBao.getParent() != null)
@@ -632,47 +793,160 @@
}
}
- List<HongBao> totalHongBaoList = new ArrayList<>();
- // 鏌ヨUID鐨勪簩绾ф垨鑰呬笁绾у垎浜禋璁㈠崟
- // TODO 鏆傛椂鏌ヨ10000鏉℃暟鎹紝鍚庨潰鍐嶅仛鍒嗛〉
- List<HongBao> hbList = hongBaoMapper.selectCanBalanceHongBaoByTypeAndUid(HongBao.TYPE_SHARE_YIJI, uid, 10000);
- if (hbList != null && hbList.size() > 0)
- totalHongBaoList.addAll(hbList);
+ /**
+ * 鍒嗕韩璧氬埌璐�
+ */
- hbList = hongBaoMapper.selectCanBalanceHongBaoByTypeAndUid(HongBao.TYPE_SHARE_ERJI, uid, 10000);
- if (hbList != null && hbList.size() > 0)
- totalHongBaoList.addAll(hbList);
-
- for (HongBao hb : totalHongBaoList) {
- if (hb.getState() == HongBao.STATE_BUKELINGQU || hb.getState() == HongBao.STATE_KELINGQU) {
- money = money.add(hb.getMoney());
- HongBao updateHongBao = new HongBao();
- updateHongBao.setId(hb.getId());
- updateHongBao.setGetTime(System.currentTimeMillis());
- updateHongBao.setState(HongBao.STATE_YILINGQU);
- hongBaoMapper.updateByPrimaryKeySelective(updateHongBao);
- if (!StringUtil.isNullOrEmpty(hb.getOrderId()))
- drawBackOrders.add(hb.getOrderId());
- }
- }
-
- if (money.compareTo(new BigDecimal(0)) > 0) {
- userInfoMapper.addHongBaoByUid(uid, money);
+ if (sharemoney.compareTo(new BigDecimal(0)) > 0) {
+ userInfoMapper.addHongBaoByUid(uid, sharemoney);
// 娣诲姞璁板綍
- AccountDetails accountDetails = AccountDetailsFactory.create("+" + money, AccountDetailsFactory.TICHENG,
- null, null, new UserInfo(uid));
+ AccountDetails accountDetails = AccountDetailsFactory.create("+" + sharemoney,
+ AccountDetailsFactory.SHARE_GOODS, null, null, new UserInfo(uid));
accountDetailsMapper.insertSelective(accountDetails);
+
+ // 娣诲姞鏂扮増璇︽儏璁板綍
+ try {
+ UserMoneyDetail userMoneyDetail = UserMoneyDetailFactory.createShare(uid, 0, 0, 0, sharemoney,
+ new Date());
+ userMoneyDetail.setId(accountDetails.getId());
+ userMoneyDetailMapper.insert(userMoneyDetail);
+ } catch (UserMoneyDetailException e) {
+ try {
+ LogHelper.errorDetailInfo(e);
+ } catch (Exception e1) {
+ e1.printStackTrace();
+ }
+ }
+ // 璁板綍杩斿埄绾㈠寘涓庤祫閲戣鎯呯殑瀵瑰簲鍏崇郴
+
+ // 娣诲姞鍒扮孩鍖呰繑鍒╄褰曢泦鍚�
+ accountDetailsHongBaoMapService.saveAccountDetailsHongBaoMap(hbIdList, accountDetails.getId());
// 鍙戦�佹帹閫�
try {
// 鎻愭垚鍒拌处娑堟伅閫氱煡
- userNotificationService.tiChengRecieved(uid, money);
+ userNotificationService.tiChengShareRecieved(uid, sharemoney);
} catch (Exception e) {
e.printStackTrace();
}
for (String orderId : drawBackOrders)
taoBaoWeiQuanDrawBackService.doWeiQuanShare(orderId);
}
+
+ }
+
+ @Resource
+ private CommonOrderService commonOrderService;
+
+ @Resource
+ private HongBaoV2Service hongBaoV2Service;
+
+ @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
+ @Override
+ public void processShopingFanliOrderNew(String orderId, List<TaoBaoOrder> orderList)
+ throws HongBaoException, OrderItemException {
+ List<TaoBaoUnionConfig> configList = taoBaoUnionConfigService.getConfigByTypeCache(PidUser.TYPE_FANLI_ANDROID);
+
+ if (orderList != null && orderList.size() > 0) {
+ String pid = String.format("mm_%s_%s_%s", configList.get(0).getAccountId(),
+ orderList.get(0).getSourceMediaId(), orderList.get(0).getAdPositionId());
+
+ Order oldOrder = orderMapper.selectOrderByOrderId(orderId);
+ // 鍘熸潵涓嶅瓨鍦ㄨ鍗�
+ Long uid = null;
+ if (oldOrder == null) {
+ PidUser pidUser = pidUserMapper.selectByPid(pid);
+ if (pidUser != null) {
+ uid = pidUser.getUid();
+
+ // 鎻掑叆鍒癘rder涓�
+ // 娣诲姞鍒拌鍗曚腑鍘�
+ Order order = new Order();
+ order.setBeizhu("PID杩斿埄璁㈠崟");
+ order.setCreatetime(System.currentTimeMillis());
+ order.setOrderId(orderId);
+ order.setOrderType(1);
+ order.setState(Order.STATE_YIZHIFU);
+ order.setUserInfo(new UserInfo(uid));
+ order.setVersion(2);
+ // 鍔犲叆鍒拌鍗曡〃
+ orderMapper.insertSelective(order);
+ oldOrder = order;
+ }
+ } else {
+ uid = oldOrder.getUserInfo().getId();
+
+ }
+ // 灏氭湭鎵惧埌鍜孭ID瀵瑰簲鐨勭敤鎴�
+ if (uid == null)
+ return;
+
+ // 璁$畻璁㈠崟鎬婚搴�
+ Order updateOrder = new Order();
+ updateOrder.setId(oldOrder.getId());
+ BigDecimal money = new BigDecimal(0);
+ for (TaoBaoOrder o : orderList) {
+ if (o.getOrderState().equalsIgnoreCase("璁㈠崟缁撶畻"))
+ money = money.add(o.getSettlement());
+ else {
+ money = money.add(o.getPayment());
+ }
+ }
+ updateOrder.setMoney(money);
+ String thirdState = null;
+ for (TaoBaoOrder o : orderList)
+ if (!o.getOrderState().equalsIgnoreCase("璁㈠崟澶辨晥")) {
+ thirdState = o.getOrderState();
+ break;
+ }
+ updateOrder.setThirdState(thirdState);
+ updateOrder.setThirdCreateTime(
+ new Date(TimeUtil.convertToTimeTemp(orderList.get(0).getCreateTime(), "yyyy-MM-dd HH:mm:ss")));
+ orderMapper.updateByPrimaryKeySelective(updateOrder);
+
+ // 鐢ㄧ涓�涓瓙璁㈠崟閿佸畾鐢ㄦ埛
+ for (TaoBaoOrder taoBaoOrder : orderList) {
+ try {
+ CommonOrder commonOrder = commonOrderService.addTaoBaoOrder(taoBaoOrder, uid);
+ hongBaoV2Service.addHongBao(commonOrder, HongBaoV2.TYPE_ZIGOU);
+ } catch (CommonOrderException e) {
+ e.printStackTrace();
+ } catch (HongBaoException e1) {
+ e1.printStackTrace();
+ }
+ }
+ }
+ }
+
+ @Override
+ public void processShareGoodsOrderNew(String orderId, List<TaoBaoOrder> orderList) {
+ List<TaoBaoUnionConfig> configList = taoBaoUnionConfigService.getConfigByTypeCache(PidUser.TYPE_FANLI_ANDROID);
+ if (orderList != null && orderList.size() > 0) {
+ String pid = String.format("mm_%s_%s_%s", configList.get(0).getAccountId(),
+ orderList.get(0).getSourceMediaId(), orderList.get(0).getAdPositionId());
+ // 鍘熸潵涓嶅瓨鍦ㄨ鍗�
+ Long uid = null;
+ PidUser pidUser = pidUserMapper.selectByPid(pid);
+ if (pidUser != null)
+ uid = pidUser.getUid();
+
+ // 灏氭湭鎵惧埌鍜孭ID瀵瑰簲鐨勭敤鎴�
+ if (uid == null)
+ return;
+
+ // 鐢ㄧ涓�涓瓙璁㈠崟閿佸畾鐢ㄦ埛
+ for (TaoBaoOrder taoBaoOrder : orderList) {
+ try {
+ CommonOrder commonOrder = commonOrderService.addTaoBaoOrder(taoBaoOrder, uid);
+ hongBaoV2Service.addHongBao(commonOrder, HongBaoV2.TYPE_SHARE_GOODS);
+ } catch (CommonOrderException e) {
+ e.printStackTrace();
+ } catch (HongBaoException e1) {
+ e1.printStackTrace();
+ }
+ }
+ }
+
}
}
--
Gitblit v1.8.0