From 28f0aa9453ac157a9af5280833b0e265c57660a2 Mon Sep 17 00:00:00 2001
From: yujian <yujian@163.com>
Date: 星期二, 21 四月 2020 14:28:13 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/div' into div

---
 fanli/src/main/java/com/yeshi/fanli/service/impl/order/OrderProcessServiceImpl.java |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 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 19643e6..eee6671 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
@@ -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);

--
Gitblit v1.8.0