|  |  |  | 
|---|
|  |  |  | package com.matrix.system.shopXcx.api.action; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.matrix.system.hive.bean.SysVipInfo; | 
|---|
|  |  |  | import com.matrix.component.redis.RedisUserLoginUtils; | 
|---|
|  |  |  | import com.matrix.core.pojo.AjaxResult; | 
|---|
|  |  |  | import com.matrix.system.shopXcx.api.service.WXShopOrderService; | 
|---|
|  |  |  | import com.matrix.system.shopXcx.api.service.WxShopActivitiesSecKillService; | 
|---|
|  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private WXShopOrderService wxShopOrderService; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private WxShopActivitiesSecKillService wxShopActivitiesSecKillService; | 
|---|
|  |  |  | private WxShopActivitiesSecKillService wxShopActvitiesSecKillService; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private RedisUserLoginUtils redisUserLoginUtils; | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @PostMapping(value = "/calSecKillPrice") | 
|---|
|  |  |  | public AjaxResult calSecKillPrice(@RequestBody SecKillVO secKillVO) { | 
|---|
|  |  |  | SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); | 
|---|
|  |  |  | 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); | 
|---|
|  |  |  | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @PostMapping(value = "/createSecKill") | 
|---|
|  |  |  | public AjaxResult createSecKill(@RequestBody CreateSecKillDTO secKillDTO) throws Exception { | 
|---|
|  |  |  | return wxShopActivitiesSecKillService.createSecKillOrder(secKillDTO); | 
|---|
|  |  |  | return wxShopActvitiesSecKillService.createSecKillOrder(secKillDTO); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|