|
@@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollUtil;
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
|
import com.txz.cif.dto.Result;
|
|
|
import com.txz.cif.dto.UserDTO;
|
|
@@ -103,7 +104,9 @@ public class StorePinkServiceImpl extends AbstractService<StorePink> implements
|
|
|
|
|
|
//理论上在支付环节调用的时候不会出现拼团人数校验异常,所以这块调用这个方法的目的在于维护成团状态。 如果支付环节抛出了
|
|
|
//拼团校验异常则证明在 add时就有问题,没有挡住异常的拼团数据
|
|
|
+ log.info("storePinkSummaryService.maintainQuantityStatusOfTheStorePinkSummary SpsId"+teamPink.getSpsId());
|
|
|
Boolean b = storePinkSummaryService.maintainQuantityStatusOfTheStorePinkSummary(teamPink.getSpsId());
|
|
|
+ log.info("storePinkSummaryService.maintainQuantityStatusOfTheStorePinkSummary b"+b);
|
|
|
if(b){
|
|
|
|
|
|
// 算出天选 同时推进订单状态到 代发货状态/订单关闭状态/未中奖成员退款
|
|
@@ -161,6 +164,7 @@ public class StorePinkServiceImpl extends AbstractService<StorePink> implements
|
|
|
|
|
|
@Override
|
|
|
public void theSelection(Long spsId,Date date) {
|
|
|
+ log.info("theSelection"+spsId);
|
|
|
// 假设只有1个用户是天选
|
|
|
long luckNum = 1;
|
|
|
|
|
@@ -238,7 +242,7 @@ public class StorePinkServiceImpl extends AbstractService<StorePink> implements
|
|
|
param.setTransTime(date);
|
|
|
//将所有参团成员的status设置为 已开奖
|
|
|
list.forEach(a->{
|
|
|
-
|
|
|
+ log.info("forEach a:"+JSONObject.toJSONString(a));
|
|
|
StoreOrder storeOrder = storeOrderService.findById(a.getOrderIdKey());
|
|
|
PinkOrderStatusEnum pinkOrderStatusEnum = OrderStateMachine.handleEvent(storeOrder, OrderEventsEnum.GROUP_PURCHASE_NOT_WIN, null);
|
|
|
if(ObjectUtils.isEmpty(pinkOrderStatusEnum)){
|
|
@@ -253,14 +257,18 @@ public class StorePinkServiceImpl extends AbstractService<StorePink> implements
|
|
|
update(unLuckPink);
|
|
|
|
|
|
//推进订单状态到未中奖关闭状态
|
|
|
+ log.info("storeOrderService.updateOrderStatus"+JSONObject.toJSONString(a));
|
|
|
+
|
|
|
storeOrderService.updateOrderStatus(a.getOrderIdKey(),pinkOrderStatusEnum.getKey());
|
|
|
storeOrderStatusService.createLog(storeOrder.getId(), Constants.ORDER_STATUS_PINK_SUCCESS_ORDER, "拼团成功");
|
|
|
//库存回退
|
|
|
// 拼团商品扣库存
|
|
|
+ log.info("storeCombinationService.operationStock"+JSONObject.toJSONString(a));
|
|
|
storeCombinationService.operationStock(a.getCid(), a.getTotalNum(), "add");
|
|
|
// 拼团商品规格扣库存
|
|
|
// productAttrValueService.operationStock(skuRecord.getInt("activityAttrValueId"), skuRecord.getInt("num"), "sub", Constants.PRODUCT_TYPE_PINGTUAN);
|
|
|
// 普通商品口库存
|
|
|
+ log.info("storeProductService.operationStock"+JSONObject.toJSONString(a));
|
|
|
storeProductService.operationStock(a.getPid(), a.getTotalNum(), "add");
|
|
|
|
|
|
|
|
@@ -281,10 +289,12 @@ public class StorePinkServiceImpl extends AbstractService<StorePink> implements
|
|
|
orderParamList.add(orderParam);
|
|
|
|
|
|
});
|
|
|
+ log.info("orderParamList"+orderParamList);
|
|
|
param.setUserIds(orderParamList);
|
|
|
+ log.info("cifAccountDubboServiceClient.accomplishGroup"+JSONObject.toJSONString(param));
|
|
|
|
|
|
Result result = cifAccountDubboServiceClient.accomplishGroup(param);
|
|
|
-
|
|
|
+ log.info("cifAccountDubboServiceClient.accomplishGroup result"+result);
|
|
|
if(!result.getCode().equals("200")){
|
|
|
throw new ServiceException("拼团成团未中奖用户退款失败message:"+result.getMessage());
|
|
|
}
|