修改会员专区和积分专区的逻辑 #2
@@ -138,6 +138,32 @@ public class PmsProductController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量设为积分专区")
|
||||||
|
@RequestMapping(value = "/update/integrationStatus", method = RequestMethod.POST)
|
||||||
|
@ResponseBody
|
||||||
|
public CommonResult updateIntegrationStatus(@RequestParam("ids") List<Long> ids,
|
||||||
|
@RequestParam("pointsAreaStatus") Integer pointsAreaStatus) {
|
||||||
|
int count = productService.updatepointsAreaStatus(ids, pointsAreaStatus);
|
||||||
|
if (count > 0) {
|
||||||
|
return CommonResult.success(count);
|
||||||
|
} else {
|
||||||
|
return CommonResult.failed();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量设为积分兑换专区")
|
||||||
|
@RequestMapping(value = "/update/integrationExchangeStatus", method = RequestMethod.POST)
|
||||||
|
@ResponseBody
|
||||||
|
public CommonResult updateIntegrationExchangeStatus(@RequestParam("ids") List<Long> ids,
|
||||||
|
@RequestParam("pointsExchangeStatus") Integer pointsExchangeStatus) {
|
||||||
|
int count = productService.updatepointsExchangeStatus(ids, pointsExchangeStatus);
|
||||||
|
if (count > 0) {
|
||||||
|
return CommonResult.success(count);
|
||||||
|
} else {
|
||||||
|
return CommonResult.failed();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@ApiOperation("批量修改删除状态")
|
@ApiOperation("批量修改删除状态")
|
||||||
@RequestMapping(value = "/update/deleteStatus", method = RequestMethod.POST)
|
@RequestMapping(value = "/update/deleteStatus", method = RequestMethod.POST)
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
|
|||||||
@@ -60,6 +60,17 @@ public interface PmsProductService {
|
|||||||
*/
|
*/
|
||||||
int updateNewStatus(List<Long> ids, Integer newStatus);
|
int updateNewStatus(List<Long> ids, Integer newStatus);
|
||||||
|
|
||||||
|
/**
|
||||||
|
*批量设为积分专区
|
||||||
|
*/
|
||||||
|
int updatepointsAreaStatus(List<Long> ids, Integer pointsAreaStatus);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量设为积分兑换专区
|
||||||
|
*/
|
||||||
|
int updatepointsExchangeStatus(List<Long> ids, Integer pointsExchangeStatus);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除商品
|
* 批量删除商品
|
||||||
*/
|
*/
|
||||||
@@ -69,4 +80,9 @@ public interface PmsProductService {
|
|||||||
* 根据商品名称或者货号模糊查询
|
* 根据商品名称或者货号模糊查询
|
||||||
*/
|
*/
|
||||||
List<PmsProduct> list(String keyword);
|
List<PmsProduct> list(String keyword);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -264,6 +264,27 @@ public class PmsProductServiceImpl implements PmsProductService {
|
|||||||
return productMapper.updateByExampleSelective(record, example);
|
return productMapper.updateByExampleSelective(record, example);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//积分区域
|
||||||
|
@Override
|
||||||
|
public int updatepointsAreaStatus(List<Long> ids, Integer pointsAreaStatus) {
|
||||||
|
PmsProduct record = new PmsProduct();
|
||||||
|
record.setPointsAreaStatus(pointsAreaStatus);
|
||||||
|
PmsProductExample example = new PmsProductExample();
|
||||||
|
example.createCriteria().andIdIn(ids);
|
||||||
|
return productMapper.updateByExampleSelective(record, example);
|
||||||
|
}
|
||||||
|
|
||||||
|
//积分兑换区域
|
||||||
|
@Override
|
||||||
|
public int updatepointsExchangeStatus(List<Long> ids, Integer pointsExchangeStatus) {
|
||||||
|
PmsProduct record = new PmsProduct();
|
||||||
|
record.setPointsExchangeStatus(pointsExchangeStatus);
|
||||||
|
PmsProductExample example = new PmsProductExample();
|
||||||
|
example.createCriteria().andIdIn(ids);
|
||||||
|
return productMapper.updateByExampleSelective(record, example);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int updateDeleteStatus(List<Long> ids, Integer deleteStatus) {
|
public int updateDeleteStatus(List<Long> ids, Integer deleteStatus) {
|
||||||
PmsProduct record = new PmsProduct();
|
PmsProduct record = new PmsProduct();
|
||||||
@@ -273,6 +294,7 @@ public class PmsProductServiceImpl implements PmsProductService {
|
|||||||
return productMapper.updateByExampleSelective(record, example);
|
return productMapper.updateByExampleSelective(record, example);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<PmsProduct> list(String keyword) {
|
public List<PmsProduct> list(String keyword) {
|
||||||
PmsProductExample productExample = new PmsProductExample();
|
PmsProductExample productExample = new PmsProductExample();
|
||||||
@@ -285,6 +307,8 @@ public class PmsProductServiceImpl implements PmsProductService {
|
|||||||
return productMapper.selectByExample(productExample);
|
return productMapper.selectByExample(productExample);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated 旧版创建
|
* @deprecated 旧版创建
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -23,9 +23,6 @@ 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();
|
||||||
|
|||||||
@@ -29,9 +29,4 @@ public interface SmsHomeNewProductMapper {
|
|||||||
|
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
@@ -175,6 +175,15 @@ public class PmsProduct implements Serializable {
|
|||||||
@ApiModelProperty(value = "好评比例")
|
@ApiModelProperty(value = "好评比例")
|
||||||
private PmsComment commentBiLi;
|
private PmsComment commentBiLi;
|
||||||
|
|
||||||
|
// 会员专区状态
|
||||||
|
private Integer vipStatus;
|
||||||
|
|
||||||
|
// 积分专区状态
|
||||||
|
private Integer pointsAreaStatus;
|
||||||
|
|
||||||
|
// 积分兑换专区状态
|
||||||
|
private Integer pointsExchangeStatus;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -618,6 +627,33 @@ public class PmsProduct implements Serializable {
|
|||||||
this.distributionFlag = distributionFlag;
|
this.distributionFlag = distributionFlag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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();
|
||||||
@@ -670,4 +706,7 @@ public class PmsProduct implements Serializable {
|
|||||||
sb.append("]");
|
sb.append("]");
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -493,6 +493,12 @@
|
|||||||
<if test="record.publishStatus != null">
|
<if test="record.publishStatus != null">
|
||||||
publish_status = #{record.publishStatus,jdbcType=INTEGER},
|
publish_status = #{record.publishStatus,jdbcType=INTEGER},
|
||||||
</if>
|
</if>
|
||||||
|
<if test="record.pointsAreaStatus != null">
|
||||||
|
points_area_status = #{record.pointsAreaStatus,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="record.pointsExchangeStatus != null">
|
||||||
|
points_exchange_status = #{record.pointsExchangeStatus,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
<if test="record.newStatus != null">
|
<if test="record.newStatus != null">
|
||||||
new_status = #{record.newStatus,jdbcType=INTEGER},
|
new_status = #{record.newStatus,jdbcType=INTEGER},
|
||||||
</if>
|
</if>
|
||||||
|
|||||||
@@ -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.PmsProduct;
|
||||||
import com.buy507.mall.model.SmsHomeNewProduct;
|
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;
|
||||||
@@ -202,8 +203,6 @@ public class OmsPortalOrderController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ApiOperation("加速订单")
|
@ApiOperation("加速订单")
|
||||||
@RequestMapping(value = "/accelerateOrder",method = RequestMethod.POST)
|
@RequestMapping(value = "/accelerateOrder",method = RequestMethod.POST)
|
||||||
public CommonResult accelerateOrder(@RequestParam Long orderId){
|
public CommonResult accelerateOrder(@RequestParam Long orderId){
|
||||||
@@ -217,9 +216,9 @@ public class OmsPortalOrderController {
|
|||||||
@RequestMapping("/orderQueue/info")
|
@RequestMapping("/orderQueue/info")
|
||||||
public CommonResult orderQueueInfo() {
|
public CommonResult orderQueueInfo() {
|
||||||
|
|
||||||
SmsHomeNewProduct smsHomeNewProduct = new SmsHomeNewProduct();
|
PmsProduct pmsProduct = new PmsProduct();
|
||||||
//如果是积分专区的商品和积分兑换的商品则不进行排队
|
//如果是积分专区的商品和积分兑换的商品则不进行排队
|
||||||
if(smsHomeNewProduct.getPointsAreaStatus() == 1 || smsHomeNewProduct.getPointsExchangeStatus() == 1){
|
if(pmsProduct.getPointsAreaStatus() == 1 || pmsProduct.getPointsExchangeStatus() == 1){
|
||||||
return CommonResult.success("该商品不参与排队流程");
|
return CommonResult.success("该商品不参与排队流程");
|
||||||
}
|
}
|
||||||
//否则进行排队
|
//否则进行排队
|
||||||
@@ -232,9 +231,9 @@ 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();
|
PmsProduct pmsProduct = new PmsProduct();
|
||||||
//如果是积分专区的商品和积分兑换的商品则不进行排队
|
//如果是积分专区的商品和积分兑换的商品则不进行排队
|
||||||
if(smsHomeNewProduct.getPointsAreaStatus() == 1 || smsHomeNewProduct.getPointsExchangeStatus() == 1){
|
if(pmsProduct.getPointsAreaStatus() == 1 || pmsProduct.getPointsExchangeStatus() == 1){
|
||||||
return CommonResult.success("该商品不参与排队流程");
|
return CommonResult.success("该商品不参与排队流程");
|
||||||
}
|
}
|
||||||
return portalOrderService.accelerateOrderInfo(orderId);
|
return portalOrderService.accelerateOrderInfo(orderId);
|
||||||
|
|||||||
@@ -739,20 +739,6 @@ 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<>();
|
||||||
|
|||||||
Reference in New Issue
Block a user