Merge pull request '修改会员专区和积分专区的逻辑' (#2) from main-cx into main

Reviewed-on: #2
This commit is contained in:
2025-02-17 10:14:57 +08:00
9 changed files with 117 additions and 29 deletions

View File

@@ -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("批量修改删除状态")
@RequestMapping(value = "/update/deleteStatus", method = RequestMethod.POST)
@ResponseBody

View File

@@ -60,6 +60,17 @@ public interface PmsProductService {
*/
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);
}

View File

@@ -264,6 +264,27 @@ public class PmsProductServiceImpl implements PmsProductService {
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
public int updateDeleteStatus(List<Long> ids, Integer deleteStatus) {
PmsProduct record = new PmsProduct();
@@ -273,6 +294,7 @@ public class PmsProductServiceImpl implements PmsProductService {
return productMapper.updateByExampleSelective(record, example);
}
@Override
public List<PmsProduct> list(String keyword) {
PmsProductExample productExample = new PmsProductExample();
@@ -285,6 +307,8 @@ public class PmsProductServiceImpl implements PmsProductService {
return productMapper.selectByExample(productExample);
}
/**
* @deprecated 旧版创建
*/

View File

@@ -23,9 +23,6 @@ public class SmsHomeNewProductServiceImpl implements SmsHomeNewProductService {
for (SmsHomeNewProduct SmsHomeNewProduct : homeNewProductList) {
SmsHomeNewProduct.setRecommendStatus(1);
SmsHomeNewProduct.setSort(0);
SmsHomeNewProduct.setVipStatus(1);
SmsHomeNewProduct.setPointsAreaStatus(1);
SmsHomeNewProduct.setPointsExchangeStatus(1);
homeNewProductMapper.insert(SmsHomeNewProduct);
}
return homeNewProductList.size();

View File

@@ -29,9 +29,4 @@ public interface SmsHomeNewProductMapper {
int updateByPrimaryKey(SmsHomeNewProduct record);
/**
* 通过 productId 查询 SmsHomeNewProduct
*/
@Select("SELECT * FROM pms_product WHERE product_id = #{productId} LIMIT 1")
SmsHomeNewProduct selectByProductId(@Param("productId") Long productId);
}

View File

@@ -174,6 +174,15 @@ public class PmsProduct implements Serializable {
@Transient
@ApiModelProperty(value = "好评比例")
private PmsComment commentBiLi;
// 会员专区状态
private Integer vipStatus;
// 积分专区状态
private Integer pointsAreaStatus;
// 积分兑换专区状态
private Integer pointsExchangeStatus;
@@ -618,6 +627,33 @@ public class PmsProduct implements Serializable {
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
public String toString() {
StringBuilder sb = new StringBuilder();
@@ -670,4 +706,7 @@ public class PmsProduct implements Serializable {
sb.append("]");
return sb.toString();
}
}

View File

@@ -493,6 +493,12 @@
<if test="record.publishStatus != null">
publish_status = #{record.publishStatus,jdbcType=INTEGER},
</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">
new_status = #{record.newStatus,jdbcType=INTEGER},
</if>

View File

@@ -11,6 +11,7 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.alipay.api.AlipayApiException;
import com.buy507.mall.model.PmsProduct;
import com.buy507.mall.model.SmsHomeNewProduct;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
@@ -200,9 +201,7 @@ public class OmsPortalOrderController {
response.sendRedirect("http://49.233.215.129/#/pages/order/order?state=6");
return "支付宝回调";
}
@ApiOperation("加速订单")
@RequestMapping(value = "/accelerateOrder",method = RequestMethod.POST)
@@ -217,9 +216,9 @@ public class OmsPortalOrderController {
@RequestMapping("/orderQueue/info")
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("该商品不参与排队流程");
}
//否则进行排队
@@ -232,9 +231,9 @@ public class OmsPortalOrderController {
@ApiOperation(" 加速单排队信息")
@RequestMapping("/accelerateOrder/info")
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 portalOrderService.accelerateOrderInfo(orderId);

View File

@@ -739,20 +739,6 @@ public class OmsPortalOrderServiceImpl implements OmsPortalOrderService {
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查询商品信息
PmsProduct product = productMapper.selectByPrimaryKey(skuStock.getProductId());
Map<String, Object> result = new HashMap<>();