935090232@qq.com
2022-02-22 bbe0a2fd03063316e50cf141986bda984599bbda
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopActivitiesSecKillAction.java
@@ -1,5 +1,7 @@
package com.matrix.system.shopXcx.api.action;
import com.matrix.system.hive.bean.SysVipInfo;
import com.matrix.system.common.init.UserCacheManager;
import com.matrix.core.pojo.AjaxResult;
import com.matrix.system.shopXcx.api.service.WXShopOrderService;
import com.matrix.system.shopXcx.api.service.WxShopActivitiesSecKillService;
@@ -37,7 +39,10 @@
    @Autowired
    private WXShopOrderService wxShopOrderService;
    @Autowired
    private WxShopActivitiesSecKillService wxShopActivitiesSecKillService;
    private WxShopActivitiesSecKillService wxShopActvitiesSecKillService;
    @Autowired
    private UserCacheManager userCacheManager;
    /**
@@ -106,12 +111,13 @@
     */
    @PostMapping(value = "/calSecKillPrice")
    public AjaxResult calSecKillPrice(@RequestBody SecKillVO secKillVO) {
        SysVipInfo sysVipInfo = userCacheManager.getLoginUser();
        ShopActivitiesSeckillInfo seckillInfo = shopActivitiesSeckillInfoDao.selectById(secKillVO.getId());
        if (seckillInfo == null) {
            return AjaxResult.buildFailInstance("参数有误");
        }
        BigDecimal postage = wxShopOrderService.calculationPostage(secKillVO.getAddressId(), seckillInfo.getSiPrice());
        BigDecimal postage = wxShopOrderService.calculationPostage(seckillInfo.getSiPrice(),sysVipInfo.getCompanyId());
        BigDecimal payPrice = seckillInfo.getSiPrice().multiply(BigDecimal.valueOf(secKillVO.getCount())).add(postage);
        AjaxResult ajaxResult = new AjaxResult(AjaxResult.STATUS_SUCCESS, null);
        ajaxResult.putInMap("totalPrice", payPrice);
@@ -128,6 +134,6 @@
     */
    @PostMapping(value = "/createSecKill")
    public AjaxResult createSecKill(@RequestBody CreateSecKillDTO secKillDTO) throws Exception {
        return wxShopActivitiesSecKillService.createSecKillOrder(secKillDTO);
        return wxShopActvitiesSecKillService.createSecKillOrder(secKillDTO);
    }
}