增加会员专区 积分专区 积分兑换内容 增加三个专区的字段
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
package com.buy507.mall.service.impl;
|
package com.buy507.mall.service.impl;
|
||||||
|
|
||||||
import com.github.pagehelper.PageHelper;
|
|
||||||
import com.buy507.mall.component.RedisLock;
|
import com.buy507.mall.component.RedisLock;
|
||||||
import com.buy507.mall.dao.*;
|
import com.buy507.mall.dao.*;
|
||||||
import com.buy507.mall.dto.PmsProductParam;
|
import com.buy507.mall.dto.PmsProductParam;
|
||||||
@@ -9,6 +8,7 @@ import com.buy507.mall.dto.PmsProductResult;
|
|||||||
import com.buy507.mall.mapper.*;
|
import com.buy507.mall.mapper.*;
|
||||||
import com.buy507.mall.model.*;
|
import com.buy507.mall.model.*;
|
||||||
import com.buy507.mall.service.PmsProductService;
|
import com.buy507.mall.service.PmsProductService;
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|||||||
@@ -23,6 +23,9 @@ public class SmsHomeNewProductServiceImpl implements SmsHomeNewProductService {
|
|||||||
for (SmsHomeNewProduct SmsHomeNewProduct : homeNewProductList) {
|
for (SmsHomeNewProduct SmsHomeNewProduct : homeNewProductList) {
|
||||||
SmsHomeNewProduct.setRecommendStatus(1);
|
SmsHomeNewProduct.setRecommendStatus(1);
|
||||||
SmsHomeNewProduct.setSort(0);
|
SmsHomeNewProduct.setSort(0);
|
||||||
|
SmsHomeNewProduct.setVipStatus(1);
|
||||||
|
SmsHomeNewProduct.setPointsAreaStatus(1);
|
||||||
|
SmsHomeNewProduct.setPointsExchangeStatus(1);
|
||||||
homeNewProductMapper.insert(SmsHomeNewProduct);
|
homeNewProductMapper.insert(SmsHomeNewProduct);
|
||||||
}
|
}
|
||||||
return homeNewProductList.size();
|
return homeNewProductList.size();
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import com.buy507.mall.model.SmsHomeNewProduct;
|
|||||||
import com.buy507.mall.model.SmsHomeNewProductExample;
|
import com.buy507.mall.model.SmsHomeNewProductExample;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.apache.ibatis.annotations.Select;
|
||||||
|
|
||||||
public interface SmsHomeNewProductMapper {
|
public interface SmsHomeNewProductMapper {
|
||||||
long countByExample(SmsHomeNewProductExample example);
|
long countByExample(SmsHomeNewProductExample example);
|
||||||
@@ -27,4 +28,10 @@ public interface SmsHomeNewProductMapper {
|
|||||||
int updateByPrimaryKeySelective(SmsHomeNewProduct record);
|
int updateByPrimaryKeySelective(SmsHomeNewProduct record);
|
||||||
|
|
||||||
int updateByPrimaryKey(SmsHomeNewProduct record);
|
int updateByPrimaryKey(SmsHomeNewProduct record);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过 productId 查询 SmsHomeNewProduct
|
||||||
|
*/
|
||||||
|
@Select("SELECT * FROM pms_product WHERE product_id = #{productId} LIMIT 1")
|
||||||
|
SmsHomeNewProduct selectByProductId(@Param("productId") Long productId);
|
||||||
}
|
}
|
||||||
@@ -16,6 +16,17 @@ public class SmsHomeNewProduct implements Serializable {
|
|||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
// 会员专区状态
|
||||||
|
private Integer vipStatus;
|
||||||
|
|
||||||
|
// 积分专区状态
|
||||||
|
private Integer pointsAreaStatus;
|
||||||
|
|
||||||
|
// 积分兑换专区状态
|
||||||
|
private Integer pointsExchangeStatus;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public Long getId() {
|
public Long getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
@@ -56,6 +67,35 @@ public class SmsHomeNewProduct implements Serializable {
|
|||||||
this.sort = sort;
|
this.sort = sort;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Integer getVipStatus() {
|
||||||
|
return vipStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVipStatus(Integer vipStatus) {
|
||||||
|
this.vipStatus = vipStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public Integer getPointsAreaStatus() {
|
||||||
|
return pointsAreaStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPointsAreaStatus(Integer pointsAreaStatus) {
|
||||||
|
this.pointsAreaStatus = pointsAreaStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public Integer getPointsExchangeStatus() {
|
||||||
|
return pointsExchangeStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void setPointsExchangeStatus(Integer pointsExchangeStatus) {
|
||||||
|
this.pointsExchangeStatus = pointsExchangeStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import javax.servlet.http.HttpServletRequest;
|
|||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import com.alipay.api.AlipayApiException;
|
import com.alipay.api.AlipayApiException;
|
||||||
|
import com.buy507.mall.model.SmsHomeNewProduct;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
@@ -215,6 +216,13 @@ public class OmsPortalOrderController {
|
|||||||
@ApiOperation("普通单排队信息")
|
@ApiOperation("普通单排队信息")
|
||||||
@RequestMapping("/orderQueue/info")
|
@RequestMapping("/orderQueue/info")
|
||||||
public CommonResult orderQueueInfo() {
|
public CommonResult orderQueueInfo() {
|
||||||
|
|
||||||
|
SmsHomeNewProduct smsHomeNewProduct = new SmsHomeNewProduct();
|
||||||
|
//如果是积分专区的商品和积分兑换的商品则不进行排队
|
||||||
|
if(smsHomeNewProduct.getPointsAreaStatus() == 1 || smsHomeNewProduct.getPointsExchangeStatus() == 1){
|
||||||
|
return CommonResult.success("该商品不参与排队流程");
|
||||||
|
}
|
||||||
|
//否则进行排队
|
||||||
return portalOrderService.orderQueueInfo();
|
return portalOrderService.orderQueueInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -224,6 +232,11 @@ public class OmsPortalOrderController {
|
|||||||
@ApiOperation(" 加速单排队信息")
|
@ApiOperation(" 加速单排队信息")
|
||||||
@RequestMapping("/accelerateOrder/info")
|
@RequestMapping("/accelerateOrder/info")
|
||||||
public CommonResult accelerateOrderInfo(@RequestParam Long orderId) {
|
public CommonResult accelerateOrderInfo(@RequestParam Long orderId) {
|
||||||
|
SmsHomeNewProduct smsHomeNewProduct = new SmsHomeNewProduct();
|
||||||
|
//如果是积分专区的商品和积分兑换的商品则不进行排队
|
||||||
|
if(smsHomeNewProduct.getPointsAreaStatus() == 1 || smsHomeNewProduct.getPointsExchangeStatus() == 1){
|
||||||
|
return CommonResult.success("该商品不参与排队流程");
|
||||||
|
}
|
||||||
return portalOrderService.accelerateOrderInfo(orderId);
|
return portalOrderService.accelerateOrderInfo(orderId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -137,6 +137,9 @@ public class OmsPortalOrderServiceImpl implements OmsPortalOrderService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private UmsMemberOrderQueueMapper umsMemberOrderQueueMapper;
|
private UmsMemberOrderQueueMapper umsMemberOrderQueueMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SmsHomeNewProductMapper homeNewProductMapper;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Value("${kuaidi100.url}")
|
@Value("${kuaidi100.url}")
|
||||||
@@ -438,6 +441,8 @@ public class OmsPortalOrderServiceImpl implements OmsPortalOrderService {
|
|||||||
UmsMember member = memberMapper.selectByPrimaryKey(loginMember.getId());
|
UmsMember member = memberMapper.selectByPrimaryKey(loginMember.getId());
|
||||||
orderResult.setShareUrl("http://49.233.215.129:688/#/pages/public/register?inviteCode="+member.getInvitationCode());
|
orderResult.setShareUrl("http://49.233.215.129:688/#/pages/public/register?inviteCode="+member.getInvitationCode());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
UmsMemberOrderQueueExample example1 = new UmsMemberOrderQueueExample();
|
UmsMemberOrderQueueExample example1 = new UmsMemberOrderQueueExample();
|
||||||
example1.createCriteria().andQuitQueueMarkEqualTo(UmsMemberOrderQueue.QUEUE_STATUS_WAIT).andQueueTypeEqualTo(UmsMemberOrderQueue.QUEUE_TYPE_ORDINARY);
|
example1.createCriteria().andQuitQueueMarkEqualTo(UmsMemberOrderQueue.QUEUE_STATUS_WAIT).andQueueTypeEqualTo(UmsMemberOrderQueue.QUEUE_TYPE_ORDINARY);
|
||||||
long allQueue = umsMemberOrderQueueMapper.countByExample(example1);
|
long allQueue = umsMemberOrderQueueMapper.countByExample(example1);
|
||||||
@@ -697,6 +702,9 @@ public class OmsPortalOrderServiceImpl implements OmsPortalOrderService {
|
|||||||
*/
|
*/
|
||||||
@Transactional
|
@Transactional
|
||||||
@Override
|
@Override
|
||||||
|
/**
|
||||||
|
* 创建订单
|
||||||
|
*/
|
||||||
public CommonResult createOrder(OrderParam orderParam) {
|
public CommonResult createOrder(OrderParam orderParam) {
|
||||||
//orderParam.setSkuId(98L);
|
//orderParam.setSkuId(98L);
|
||||||
if(orderParam.getSkuId() == null) {
|
if(orderParam.getSkuId() == null) {
|
||||||
@@ -731,6 +739,20 @@ public class OmsPortalOrderServiceImpl implements OmsPortalOrderService {
|
|||||||
return CommonResult.validateFailed("库存不足,无法下单");
|
return CommonResult.validateFailed("库存不足,无法下单");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//通过productId查询专区信息
|
||||||
|
SmsHomeNewProduct homeNewProduct = homeNewProductMapper.selectByProductId(skuStock.getProductId());
|
||||||
|
if (homeNewProduct == null) {
|
||||||
|
return CommonResult.validateFailed("未查询到商品所属专区");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 积分兑换专区逻辑
|
||||||
|
if (homeNewProduct.getPointsExchangeStatus() != null && homeNewProduct.getPointsExchangeStatus() == 1) {
|
||||||
|
log.info("当前商品属于【积分兑换专区】");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//根据商品id查询商品信息
|
//根据商品id查询商品信息
|
||||||
PmsProduct product = productMapper.selectByPrimaryKey(skuStock.getProductId());
|
PmsProduct product = productMapper.selectByPrimaryKey(skuStock.getProductId());
|
||||||
Map<String, Object> result = new HashMap<>();
|
Map<String, Object> result = new HashMap<>();
|
||||||
@@ -764,6 +786,7 @@ public class OmsPortalOrderServiceImpl implements OmsPortalOrderService {
|
|||||||
return CommonResult.validateFailed("森态积分不足,无法抵扣");
|
return CommonResult.validateFailed("森态积分不足,无法抵扣");
|
||||||
}*/
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
while(true) {
|
while(true) {
|
||||||
long time = System.currentTimeMillis() + RedisLock.TIMEOUT;
|
long time = System.currentTimeMillis() + RedisLock.TIMEOUT;
|
||||||
if(redisLock.lock(String.valueOf(skuStock.getProductId()), String.valueOf(time))) {
|
if(redisLock.lock(String.valueOf(skuStock.getProductId()), String.valueOf(time))) {
|
||||||
@@ -783,6 +806,7 @@ public class OmsPortalOrderServiceImpl implements OmsPortalOrderService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//生成订单信息
|
//生成订单信息
|
||||||
OmsOrder order = new OmsOrder();
|
OmsOrder order = new OmsOrder();
|
||||||
order.setTotalAmount(totalAmount); // 订单总金额
|
order.setTotalAmount(totalAmount); // 订单总金额
|
||||||
@@ -905,6 +929,11 @@ public class OmsPortalOrderServiceImpl implements OmsPortalOrderService {
|
|||||||
return CommonResult.success(result, "下单成功");
|
return CommonResult.success(result, "下单成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单超时取消
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
@Transactional
|
@Transactional
|
||||||
@Override
|
@Override
|
||||||
public CommonResult cancelTimeOutOrder() {
|
public CommonResult cancelTimeOutOrder() {
|
||||||
@@ -927,6 +956,11 @@ public class OmsPortalOrderServiceImpl implements OmsPortalOrderService {
|
|||||||
return CommonResult.success(null);
|
return CommonResult.success(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除订单
|
||||||
|
* @param orderId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
@Transactional
|
@Transactional
|
||||||
@Override
|
@Override
|
||||||
public CommonResult cancelOrder(Long orderId) {
|
public CommonResult cancelOrder(Long orderId) {
|
||||||
@@ -1680,6 +1714,11 @@ public class OmsPortalOrderServiceImpl implements OmsPortalOrderService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 加速订单
|
||||||
|
* @param orderId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public CommonResult accelerateOrder(Long orderId) {
|
public CommonResult accelerateOrder(Long orderId) {
|
||||||
OmsOrder order = orderMapper.selectByPrimaryKey(orderId);
|
OmsOrder order = orderMapper.selectByPrimaryKey(orderId);
|
||||||
@@ -1738,6 +1777,10 @@ public class OmsPortalOrderServiceImpl implements OmsPortalOrderService {
|
|||||||
@Value("${alipay.signType}")
|
@Value("${alipay.signType}")
|
||||||
private String signType;
|
private String signType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付宝支付回调
|
||||||
|
* @param params
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void alipayCallback(Map<String, String> params) {
|
public void alipayCallback(Map<String, String> params) {
|
||||||
LOGGER.info("============开始处理支付宝的支付异步通知 接收到参数 {}", JSONUtil.toJsonStr(params));
|
LOGGER.info("============开始处理支付宝的支付异步通知 接收到参数 {}", JSONUtil.toJsonStr(params));
|
||||||
|
|||||||
@@ -61,6 +61,11 @@
|
|||||||
WHERE
|
WHERE
|
||||||
hp.recommend_status = 1
|
hp.recommend_status = 1
|
||||||
AND p.publish_status = 1
|
AND p.publish_status = 1
|
||||||
|
AND (
|
||||||
|
p.vip_status = 1 OR
|
||||||
|
p.points_area_status = 1 OR
|
||||||
|
p.points_exchange_status = 1
|
||||||
|
)
|
||||||
ORDER BY
|
ORDER BY
|
||||||
hp.sort DESC
|
hp.sort DESC
|
||||||
LIMIT #{offset}, #{limit};
|
LIMIT #{offset}, #{limit};
|
||||||
|
|||||||
Reference in New Issue
Block a user