|
@@ -14,6 +14,7 @@ import com.txz.mall.constants.Constants;
|
|
|
import com.txz.mall.core.AbstractService;
|
|
|
import com.txz.mall.core.ServiceException;
|
|
|
import com.txz.mall.dao.StorePinkMapper;
|
|
|
+import com.txz.mall.dao.StoreProductMapper;
|
|
|
import com.txz.mall.dubbo.client.CifAccountDubboServiceClient;
|
|
|
import com.txz.mall.enums.NoticeEnum;
|
|
|
import com.txz.mall.enums.OrderEventsEnum;
|
|
@@ -23,6 +24,7 @@ import com.txz.mall.enums.StorePinkStatusEnum;
|
|
|
import com.txz.mall.model.StoreOrder;
|
|
|
import com.txz.mall.model.StorePink;
|
|
|
import com.txz.mall.model.StorePinkSummary;
|
|
|
+import com.txz.mall.model.StoreProduct;
|
|
|
import com.txz.mall.service.*;
|
|
|
import com.txz.mall.util.I18nUtil;
|
|
|
import com.txz.mall.util.OrderStateMachine;
|
|
@@ -63,6 +65,9 @@ public class StorePinkServiceImpl extends AbstractService<StorePink> implements
|
|
|
@Resource
|
|
|
private NoticeService noticeService;
|
|
|
|
|
|
+ @Resource
|
|
|
+ private StoreProductMapper storeProductMapper;
|
|
|
+
|
|
|
@Override
|
|
|
public List<StorePink> getListByCidAndKid(Long cid, Long kid) {
|
|
|
Condition condition = new Condition(StorePink.class);
|
|
@@ -101,6 +106,23 @@ public class StorePinkServiceImpl extends AbstractService<StorePink> implements
|
|
|
storeOrderStatusService.createLog(storeOrder.getId(), Constants.ORDER_LOG_PAY_SUCCESS, "支付成功");
|
|
|
noticeService.addOrderNotice(NoticeEnum.ORDER_GROUP_BUY_PAYMENT_SUCCESS,storeOrder.getOrderId(),storeOrder.getUid());
|
|
|
|
|
|
+ //累计虚拟销量,虚拟销量和下单数挂钩,和是否退款或者成团或者是否中奖都无关 只累加不扣减
|
|
|
+ Long pid = teamPink.getPid();
|
|
|
+
|
|
|
+ StoreProduct storeProduct = storeProductService.findById(pid);
|
|
|
+
|
|
|
+ StoreProduct storeProductForUpdate = new StoreProduct();
|
|
|
+ storeProductForUpdate.setFicti(storeProduct.getFicti()+teamPink.getTotalNum());
|
|
|
+ storeProductForUpdate.setVersion(storeProduct.getVersion()+1);
|
|
|
+
|
|
|
+
|
|
|
+ Example exampleStoreProduct = new Example(StoreProduct.class);
|
|
|
+ exampleStoreProduct.createCriteria().andEqualTo("id", pid).andEqualTo(storeProduct.getVersion());
|
|
|
+ int i = storeProductMapper.updateByConditionSelective(storeProductForUpdate, exampleStoreProduct);
|
|
|
+ if(i==0){
|
|
|
+ throw new ServiceException(I18nUtil.get("failed.to.increase.virtual.sales.during.payment")+pid);
|
|
|
+ }
|
|
|
+
|
|
|
memberList.add(teamPink);
|
|
|
// memberList.forEach(i -> {
|
|
|
// i.setStatus(2);
|