|  |  |  | 
|---|
|  |  |  | import com.matrix.component.redis.RedisUserLoginUtils; | 
|---|
|  |  |  | import com.matrix.core.pojo.AjaxResult; | 
|---|
|  |  |  | import com.matrix.system.common.interceptor.HostInterceptor; | 
|---|
|  |  |  | import com.matrix.system.hive.dao.SysVipInfoDao; | 
|---|
|  |  |  | import com.matrix.system.shopXcx.api.service.WXShopOrderService; | 
|---|
|  |  |  | import com.matrix.system.shopXcx.api.service.WxShopActivitiesGroupService; | 
|---|
|  |  |  | import com.matrix.system.shopXcx.api.vo.WxActivitiesGroupBuyVO; | 
|---|
|  |  |  | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.*; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.math.BigDecimal; | 
|---|
|  |  |  | import java.util.Calendar; | 
|---|
|  |  |  | import java.util.Date; | 
|---|
|  |  |  | import java.util.List; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @PostMapping(value = "/calPrice") | 
|---|
|  |  |  | public AjaxResult calPrice(@RequestBody CreateGroupBuyDTO createGroupBuyDTO) { | 
|---|
|  |  |  | BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); | 
|---|
|  |  |  | ShopActivitiesGroupPrice groupPrice = shopActivitiesGroupPriceDao.selectById(createGroupBuyDTO.getGpId()); | 
|---|
|  |  |  | // 判断参数中gjId是否为空,若为空则为团长开团。再判断团长价是否为空,如果不为空则拥有团长价 | 
|---|
|  |  |  | if (createGroupBuyDTO.getGjId() == null) { | 
|---|
|  |  |  | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | createGroupBuyDTO.setPrice(groupPrice.getGpPrice()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | BigDecimal postage = wxShopOrderService.calculationPostage(createGroupBuyDTO.getAddressId(), createGroupBuyDTO.getPrice()); | 
|---|
|  |  |  | BigDecimal postage = wxShopOrderService.calculationPostage(createGroupBuyDTO.getPrice(),bizUser.getCompanyId()); | 
|---|
|  |  |  | BigDecimal payPrice = createGroupBuyDTO.getPrice().multiply(BigDecimal.valueOf(createGroupBuyDTO.getCount())).add(postage); | 
|---|
|  |  |  | AjaxResult ajaxResult = new AjaxResult(AjaxResult.STATUS_SUCCESS, null); | 
|---|
|  |  |  | ajaxResult.putInMap("billPrice", createGroupBuyDTO.getPrice().multiply(BigDecimal.valueOf(createGroupBuyDTO.getCount()))); | 
|---|