update:
1. fix
This commit is contained in:
@@ -14,13 +14,13 @@ import org.springblade.modules.api.request.SubmitMerchantProductRequest;
|
||||
import org.springblade.modules.api.request.SubmitPayoutAccountRequest;
|
||||
import org.springblade.modules.api.request.VerifyMerchantRequest;
|
||||
import org.springblade.modules.api.response.MerchantStatusResponse;
|
||||
import org.springblade.modules.api.vo.MarketMerchantProductApiVO;
|
||||
import org.springblade.modules.api.vo.MarketMerchantCatalogApiVO;
|
||||
import org.springblade.modules.api.vo.MarketMerchantInventoryApiVO;
|
||||
import org.springblade.modules.api.vo.MerchantPayoutAccountApiVO;
|
||||
import org.springblade.modules.market.service.IMarketMerchantApplicationService;
|
||||
import org.springblade.modules.market.service.IMerchantInventoryService;
|
||||
import org.springblade.modules.market.service.IMerchantPayoutAccountService;
|
||||
import org.springblade.modules.market.service.IMerchantProductService;
|
||||
import org.springblade.modules.market.service.IMerchantCatalogService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
@@ -35,7 +35,7 @@ public class MarketMerchantController {
|
||||
|
||||
private final IMarketMerchantApplicationService applicationService;
|
||||
|
||||
private final IMerchantProductService merchantProductService;
|
||||
private final IMerchantCatalogService merchantProductService;
|
||||
|
||||
private final IMerchantInventoryService inventoryService;
|
||||
|
||||
@@ -62,18 +62,18 @@ public class MarketMerchantController {
|
||||
return R.data(applicationService.merchantType(AuthUtil.getUserId()));
|
||||
}
|
||||
|
||||
@GetMapping("/product-list")
|
||||
@GetMapping("/catalog-list")
|
||||
@ApiOperationSupport(order = 4)
|
||||
@Operation(summary = "商品列表")
|
||||
public R<List<MarketMerchantProductApiVO>> productList() {
|
||||
return R.data(merchantProductService.productListByUserId(AuthUtil.getUserId()));
|
||||
@Operation(summary = "商品目录列表")
|
||||
public R<List<MarketMerchantCatalogApiVO>> catalogList() {
|
||||
return R.data(merchantProductService.catalogListByUserId(AuthUtil.getUserId()));
|
||||
}
|
||||
|
||||
@PostMapping("/submit-product")
|
||||
@ApiOperationSupport(order = 5)
|
||||
@Operation(summary = "提交商品")
|
||||
public R addProduct(@RequestBody @Valid SubmitMerchantProductRequest request) {
|
||||
return R.status(merchantProductService.submitMerchantProduct(AuthUtil.getUserId(), request.getId(), request.getProductName(), request.getThumbImageUrl(), request.getMainImageUrls(), request.getDetailImageUrls(), request.getSpecs()));
|
||||
return R.status(merchantProductService.submitMerchantCatalog(AuthUtil.getUserId(), request.getId(), request.getProductName(), request.getThumbImageUrl(), request.getMainImageUrls(), request.getDetailImageUrls(), request.getSpecs()));
|
||||
}
|
||||
|
||||
@GetMapping("/inventory-list")
|
||||
@@ -87,7 +87,7 @@ public class MarketMerchantController {
|
||||
@ApiOperationSupport(order = 7)
|
||||
@Operation(summary = "增加库存")
|
||||
public R increaseInventory(@RequestBody @Valid IncreaseInventoryRequest request) {
|
||||
return R.status(inventoryService.increase(AuthUtil.getUserId(), request.getProductId(), request.getNum()));
|
||||
return R.status(inventoryService.increase(AuthUtil.getUserId(), request.getProductId(), request.getNum(),request.getPrice(), request.getGiftType(), request.getGiftAmount()));
|
||||
}
|
||||
|
||||
@GetMapping("/is-available")
|
||||
|
||||
@@ -4,6 +4,7 @@ import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class IncreaseInventoryRequest implements Serializable {
|
||||
@@ -14,4 +15,10 @@ public class IncreaseInventoryRequest implements Serializable {
|
||||
@NotNull(message = "无效参数")
|
||||
private Integer num;
|
||||
|
||||
private BigDecimal price;
|
||||
|
||||
private Integer giftType;
|
||||
|
||||
private BigDecimal giftAmount;
|
||||
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ package org.springblade.modules.api.request;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import org.springblade.modules.market.pojo.entity.MerchantProductEntity;
|
||||
import org.springblade.modules.market.pojo.entity.MerchantCatalogEntity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
@@ -25,7 +25,7 @@ public class SubmitMerchantProductRequest implements Serializable {
|
||||
@NotEmpty(message = "无效参数")
|
||||
private String thumbImageUrl;
|
||||
|
||||
private List<MerchantProductEntity.Spec> specs;
|
||||
private List<MerchantCatalogEntity.Spec> specs;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class MarketMerchantProductApiVO implements Serializable {
|
||||
public class MarketMerchantCatalogApiVO implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
@@ -36,9 +36,9 @@ import org.springblade.core.mp.support.Condition;
|
||||
import org.springblade.core.mp.support.Query;
|
||||
import org.springblade.core.tool.api.R;
|
||||
import org.springblade.core.tool.utils.Func;
|
||||
import org.springblade.modules.market.pojo.entity.MerchantProductEntity;
|
||||
import org.springblade.modules.market.pojo.vo.MerchantProductVO;
|
||||
import org.springblade.modules.market.service.IMerchantProductService;
|
||||
import org.springblade.modules.market.pojo.entity.MerchantCatalogEntity;
|
||||
import org.springblade.modules.market.pojo.vo.MerchantCatalogVO;
|
||||
import org.springblade.modules.market.service.IMerchantCatalogService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.core.boot.ctrl.BladeController;
|
||||
@@ -53,20 +53,20 @@ import java.util.Map;
|
||||
*/
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/market/merchant-product")
|
||||
@RequestMapping("/market/merchant-catalog")
|
||||
@Tag(name = "自营商家商品表", description = "自营商家商品表接口")
|
||||
public class MerchantProductController extends BladeController {
|
||||
public class MerchantCatalogController extends BladeController {
|
||||
|
||||
private final IMerchantProductService productService;
|
||||
private final IMerchantCatalogService catalogService;
|
||||
|
||||
/**
|
||||
* 自营商家商品表 详情
|
||||
*/
|
||||
@GetMapping("/detail")
|
||||
@ApiOperationSupport(order = 1)
|
||||
@Operation(summary = "详情", description = "传入product")
|
||||
public R<MerchantProductEntity> detail(MerchantProductEntity product) {
|
||||
MerchantProductEntity detail = productService.getById(product.getId());
|
||||
@Operation(summary = "详情", description = "传入catalog")
|
||||
public R<MerchantCatalogEntity> detail(MerchantCatalogEntity catalog) {
|
||||
MerchantCatalogEntity detail = catalogService.getById(catalog.getId());
|
||||
return R.data(detail);
|
||||
}
|
||||
|
||||
@@ -75,9 +75,9 @@ public class MerchantProductController extends BladeController {
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
@ApiOperationSupport(order = 2)
|
||||
@Operation(summary = "分页", description = "传入product")
|
||||
public R<IPage<MerchantProductEntity>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> product, Query query) {
|
||||
IPage<MerchantProductEntity> pages = productService.page(Condition.getPage(query), Condition.getQueryWrapper(product, MerchantProductEntity.class));
|
||||
@Operation(summary = "分页", description = "传入catalog")
|
||||
public R<IPage<MerchantCatalogEntity>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> catalog, Query query) {
|
||||
IPage<MerchantCatalogEntity> pages = catalogService.page(Condition.getPage(query), Condition.getQueryWrapper(catalog, MerchantCatalogEntity.class));
|
||||
return R.data(pages);
|
||||
}
|
||||
|
||||
@@ -86,9 +86,9 @@ public class MerchantProductController extends BladeController {
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
@ApiOperationSupport(order = 3)
|
||||
@Operation(summary = "分页", description = "传入product")
|
||||
public R<IPage<MerchantProductVO>> page(MerchantProductVO product, Query query) {
|
||||
IPage<MerchantProductVO> pages = productService.selectMerchantProductPage(Condition.getPage(query), product);
|
||||
@Operation(summary = "分页", description = "传入catalog")
|
||||
public R<IPage<MerchantCatalogVO>> page(MerchantCatalogVO catalog, Query query) {
|
||||
IPage<MerchantCatalogVO> pages = catalogService.selectMerchantCatalogPage(Condition.getPage(query), catalog);
|
||||
return R.data(pages);
|
||||
}
|
||||
|
||||
@@ -97,9 +97,9 @@ public class MerchantProductController extends BladeController {
|
||||
*/
|
||||
@PostMapping("/save")
|
||||
@ApiOperationSupport(order = 4)
|
||||
@Operation(summary = "新增", description = "传入product")
|
||||
public R save(@Valid @RequestBody MerchantProductEntity product) {
|
||||
return R.status(productService.save(product));
|
||||
@Operation(summary = "新增", description = "传入catalog")
|
||||
public R save(@Valid @RequestBody MerchantCatalogEntity catalog) {
|
||||
return R.status(catalogService.save(catalog));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -107,9 +107,9 @@ public class MerchantProductController extends BladeController {
|
||||
*/
|
||||
@PostMapping("/update")
|
||||
@ApiOperationSupport(order = 5)
|
||||
@Operation(summary = "修改", description = "传入product")
|
||||
public R update(@Valid @RequestBody MerchantProductEntity product) {
|
||||
return R.status(productService.updateById(product));
|
||||
@Operation(summary = "修改", description = "传入catalog")
|
||||
public R update(@Valid @RequestBody MerchantCatalogEntity catalog) {
|
||||
return R.status(catalogService.updateById(catalog));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -117,9 +117,9 @@ public class MerchantProductController extends BladeController {
|
||||
*/
|
||||
@PostMapping("/submit")
|
||||
@ApiOperationSupport(order = 6)
|
||||
@Operation(summary = "新增或修改", description = "传入product")
|
||||
public R submit(@Valid @RequestBody MerchantProductEntity product) {
|
||||
return R.status(productService.saveOrUpdate(product));
|
||||
@Operation(summary = "新增或修改", description = "传入catalog")
|
||||
public R submit(@Valid @RequestBody MerchantCatalogEntity catalog) {
|
||||
return R.status(catalogService.saveOrUpdate(catalog));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -129,17 +129,17 @@ public class MerchantProductController extends BladeController {
|
||||
@ApiOperationSupport(order = 7)
|
||||
@Operation(summary = "逻辑删除", description = "传入ids")
|
||||
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
|
||||
return R.status(productService.deleteLogic(Func.toLongList(ids)));
|
||||
return R.status(catalogService.deleteLogic(Func.toLongList(ids)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 自营商家商品表 新增平台商品
|
||||
*/
|
||||
@PostMapping("/submit-product")
|
||||
@PostMapping("/submit-catalog")
|
||||
@ApiOperationSupport(order = 8)
|
||||
@Operation(summary = "新增平台商品", description = "传入product")
|
||||
public R submitProduct(@Valid @RequestBody MerchantProductEntity product) {
|
||||
return R.status(productService.submitPlatformProduct(product));
|
||||
@Operation(summary = "新增平台商品", description = "传入catalog")
|
||||
public R submitCatalog(@Valid @RequestBody MerchantCatalogEntity catalog) {
|
||||
return R.status(catalogService.submitPlatformCatalog(catalog));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
package org.springblade.modules.market.convert;
|
||||
|
||||
import org.mapstruct.Mapper;
|
||||
import org.springblade.modules.api.vo.MarketMerchantProductApiVO;
|
||||
import org.springblade.modules.api.vo.MarketMerchantCatalogApiVO;
|
||||
import org.springblade.modules.api.vo.MerchantPayoutAccountApiVO;
|
||||
import org.springblade.modules.market.pojo.entity.MerchantPayoutAccountEntity;
|
||||
import org.springblade.modules.market.pojo.entity.MerchantProductEntity;
|
||||
import org.springblade.modules.market.pojo.entity.MerchantCatalogEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -13,9 +13,9 @@ public interface MarketMerchantConvert {
|
||||
|
||||
MarketMerchantConvert INSTANCE = MarketMerchantConvert.INSTANCE;
|
||||
|
||||
MarketMerchantProductApiVO convertMerchantProductEntityToApiVO(MerchantProductEntity marketMerchantProductEntity);
|
||||
MarketMerchantCatalogApiVO convertMerchantProductEntityToApiVO(MerchantCatalogEntity marketMerchantCatalogEntity);
|
||||
|
||||
List<MarketMerchantProductApiVO> convertMerchantProductEntityToApiVOList(List<MerchantProductEntity> marketMerchantProductEntityList);
|
||||
List<MarketMerchantCatalogApiVO> convertMerchantProductEntityToApiVOList(List<MerchantCatalogEntity> marketMerchantCatalogEntityList);
|
||||
|
||||
MerchantPayoutAccountApiVO convertMerchantPayoutAccountEntityToApiVO(MerchantPayoutAccountEntity merchantPayoutAccountEntity);
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ public enum MarketBusinessModule {
|
||||
CASH_UPGRADE("现金动态升级", "cash_upgrade"),
|
||||
CASH_ACCELERATION("现金动态加速", "cash_acceleration"),
|
||||
MERCHANT_PURCHASING("自营商城进货", "merchant_purchasing"),
|
||||
MERCHANT_PUBLISH("自营商城上架商品", "merchant_publish")
|
||||
;
|
||||
|
||||
@Getter
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
package org.springblade.modules.market.eums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
public enum MerchantGiftType {
|
||||
|
||||
BENEFIT_POINT(1, "福利积分"),
|
||||
CASH_COUPON(2, "现金券"),
|
||||
COMMISSION(3, "佣金");
|
||||
|
||||
private final int code;
|
||||
|
||||
private final String desc;
|
||||
|
||||
MerchantGiftType(int code, String desc){
|
||||
this.code = code;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public static MerchantGiftType getByCode(int code) {
|
||||
for (MerchantGiftType merchantGiftType : MerchantGiftType.values()) {
|
||||
if (merchantGiftType.getCode() == code) {
|
||||
return merchantGiftType;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -27,8 +27,8 @@ package org.springblade.modules.market.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.modules.market.pojo.entity.MerchantProductEntity;
|
||||
import org.springblade.modules.market.pojo.vo.MerchantProductVO;
|
||||
import org.springblade.modules.market.pojo.entity.MerchantCatalogEntity;
|
||||
import org.springblade.modules.market.pojo.vo.MerchantCatalogVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -38,7 +38,7 @@ import java.util.List;
|
||||
* @author RayL
|
||||
* @since 2026-04-24
|
||||
*/
|
||||
public interface MerchantProductMapper extends BaseMapper<MerchantProductEntity> {
|
||||
public interface MerchantCatalogMapper extends BaseMapper<MerchantCatalogEntity> {
|
||||
|
||||
/**
|
||||
* 自定义分页
|
||||
@@ -47,7 +47,7 @@ public interface MerchantProductMapper extends BaseMapper<MerchantProductEntity>
|
||||
* @param product 查询参数
|
||||
* @return List<MerchantProductVO>
|
||||
*/
|
||||
List<MerchantProductVO> selectMerchantProductPage(IPage page, MerchantProductVO product);
|
||||
List<MerchantCatalogVO> selectMerchantCatalogPage(IPage page, MerchantCatalogVO product);
|
||||
|
||||
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.springblade.modules.market.mapper.MerchantProductMapper">
|
||||
<mapper namespace="org.springblade.modules.market.mapper.MerchantCatalogMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="merchantproductResultMap" type="org.springblade.modules.market.pojo.entity.MerchantProductEntity">
|
||||
<resultMap id="merchantCatalogResultMap" type="org.springblade.modules.market.pojo.entity.MerchantCatalogEntity">
|
||||
<result column="id" property="id"/>
|
||||
<result column="user_id" property="userId"/>
|
||||
<result column="user_account" property="userAccount"/>
|
||||
@@ -25,7 +25,7 @@
|
||||
</resultMap>
|
||||
|
||||
|
||||
<select id="selectMerchantProductPage" resultMap="merchantproductResultMap">
|
||||
<select id="selectMerchantCatalogPage" resultMap="merchantCatalogResultMap">
|
||||
select * from merchant_product where is_deleted = 0
|
||||
<if test="product.type !=null">
|
||||
and type = #{product.type}
|
||||
@@ -10,7 +10,12 @@
|
||||
<result column="type" property="type"/>
|
||||
<result column="product_name" property="productName"/>
|
||||
<result column="product_id" property="productId"/>
|
||||
<result column="quantity" property="quantity"/>
|
||||
<result column="store_name" property="storeName"/>
|
||||
<result column="thumb_image_url" property="thumbImageUrl"/>
|
||||
<result column="unit_price" property="unitPrice"/>
|
||||
<result column="gift_type" property="giftType"/>
|
||||
<result column="unit_gift_amount" property="unitGiftAmount"/>
|
||||
<result column="stock" property="stock"/>
|
||||
<result column="remark" property="remark"/>
|
||||
<result column="create_user" property="createUser"/>
|
||||
<result column="create_dept" property="createDept"/>
|
||||
@@ -27,33 +32,26 @@
|
||||
</select>
|
||||
|
||||
<select id="selectProductInventoryApiList" resultType="org.springblade.modules.api.vo.MarketMerchantInventoryApiVO">
|
||||
select mpi.id as id,
|
||||
mp.id as productId,
|
||||
mpi.type as type,
|
||||
mpi.product_name as productName,
|
||||
mp.thumb_image_url as thumbImageUrl,
|
||||
mpi.quantity as stock,
|
||||
mpi.remark as remark
|
||||
from merchant_product_inventory mpi
|
||||
left join merchant_product mp on mpi.product_id = mp.id
|
||||
where mpi.user_id = #{userId}
|
||||
and mpi.is_deleted = 0
|
||||
select *
|
||||
from merchant_product_inventory
|
||||
where user_id = #{userId}
|
||||
and is_deleted = 0
|
||||
</select>
|
||||
|
||||
<update id="increaseInventory">
|
||||
update
|
||||
merchant_product_inventory
|
||||
set quantity = quantity + #{num} , version = version + 1
|
||||
set stock = stock + #{num} , version = version + 1
|
||||
where id = #{id} and version = #{version}
|
||||
</update>
|
||||
|
||||
<update id="reduceInventory">
|
||||
update
|
||||
merchant_product_inventory
|
||||
set quantity = quantity - #{num},
|
||||
set stock = stock - #{num},
|
||||
version = version + 1
|
||||
where id = #{userId}
|
||||
and version = #{version}
|
||||
and (quantity - #{num}) >= 0
|
||||
and (stock - #{num}) >= 0
|
||||
</update>
|
||||
</mapper>
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
package org.springblade.modules.market.pojo.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springblade.modules.market.eums.MarketBusinessModule;
|
||||
import org.springblade.modules.market.pojo.entity.MarketBenefitPointLogEntity;
|
||||
@@ -11,6 +13,8 @@ import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class MarketBenefitPointApiDTO {
|
||||
|
||||
/**
|
||||
|
||||
@@ -27,7 +27,7 @@ package org.springblade.modules.market.pojo.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.springblade.modules.market.pojo.entity.MerchantProductEntity;
|
||||
import org.springblade.modules.market.pojo.entity.MerchantCatalogEntity;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
@@ -39,7 +39,7 @@ import java.io.Serial;
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class MerchantProductDTO extends MerchantProductEntity {
|
||||
public class MerchantCatalogDTO extends MerchantCatalogEntity {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@@ -34,8 +34,6 @@ import lombok.EqualsAndHashCode;
|
||||
import org.springblade.common.handler.PgJsonbTypeHandler;
|
||||
import org.springblade.common.handler.PgStringArrayToListTypeHandler;
|
||||
import org.springblade.core.mp.base.BaseEntity;
|
||||
import org.springblade.core.tenant.mp.TenantEntity;
|
||||
import org.springblade.modules.mall.pojo.entity.MallProductEntity;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
@@ -49,10 +47,10 @@ import java.util.List;
|
||||
* @since 2026-04-24
|
||||
*/
|
||||
@Data
|
||||
@TableName(value = "merchant_product", autoResultMap = true)
|
||||
@Schema(description = "MerchantProduct对象")
|
||||
@TableName(value = "merchant_catalog", autoResultMap = true)
|
||||
@Schema(description = "MerchantCatalog对象")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class MerchantProductEntity extends BaseEntity {
|
||||
public class MerchantCatalogEntity extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
@@ -34,6 +34,7 @@ import org.springblade.core.mp.base.BaseEntity;
|
||||
import org.springblade.core.tenant.mp.TenantEntity;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 自营商家库存表 实体类
|
||||
@@ -75,11 +76,36 @@ public class MerchantInventoryEntity extends BaseEntity {
|
||||
*/
|
||||
@Schema(description = "商品id")
|
||||
private Long productId;
|
||||
/**
|
||||
* 店铺名称
|
||||
*/
|
||||
@Schema(description = "店铺名称")
|
||||
private String storeName;
|
||||
/**
|
||||
* 缩略图
|
||||
*/
|
||||
@Schema(description = "缩略图")
|
||||
private String thumbImageUrl;
|
||||
/**
|
||||
* 单价
|
||||
*/
|
||||
@Schema(description = "单价")
|
||||
private BigDecimal unitPrice;
|
||||
/**
|
||||
* 赠品类型
|
||||
*/
|
||||
@Schema(description = "赠品类型")
|
||||
private Integer giftType;
|
||||
/**
|
||||
* 赠品数量
|
||||
*/
|
||||
@Schema(description = "赠品数量")
|
||||
private BigDecimal unitGiftAmount;
|
||||
/**
|
||||
* 库存数量
|
||||
*/
|
||||
@Schema(description = "库存数量")
|
||||
private Integer quantity;
|
||||
private Integer stock;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
|
||||
@@ -27,7 +27,7 @@ package org.springblade.modules.market.pojo.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.springblade.modules.market.pojo.entity.MerchantProductEntity;
|
||||
import org.springblade.modules.market.pojo.entity.MerchantCatalogEntity;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
@@ -39,7 +39,7 @@ import java.io.Serial;
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class MerchantProductVO extends MerchantProductEntity {
|
||||
public class MerchantCatalogVO extends MerchantCatalogEntity {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@@ -27,9 +27,9 @@ package org.springblade.modules.market.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.core.mp.base.BaseService;
|
||||
import org.springblade.modules.api.vo.MarketMerchantProductApiVO;
|
||||
import org.springblade.modules.market.pojo.entity.MerchantProductEntity;
|
||||
import org.springblade.modules.market.pojo.vo.MerchantProductVO;
|
||||
import org.springblade.modules.api.vo.MarketMerchantCatalogApiVO;
|
||||
import org.springblade.modules.market.pojo.entity.MerchantCatalogEntity;
|
||||
import org.springblade.modules.market.pojo.vo.MerchantCatalogVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -39,20 +39,20 @@ import java.util.List;
|
||||
* @author RayL
|
||||
* @since 2026-04-24
|
||||
*/
|
||||
public interface IMerchantProductService extends BaseService<MerchantProductEntity> {
|
||||
public interface IMerchantCatalogService extends BaseService<MerchantCatalogEntity> {
|
||||
/**
|
||||
* 自定义分页
|
||||
*
|
||||
* @param page 分页参数
|
||||
* @param productVO 查询参数
|
||||
* @param catalogVO 查询参数
|
||||
* @return IPage<MerchantProductVO>
|
||||
*/
|
||||
IPage<MerchantProductVO> selectMerchantProductPage(IPage<MerchantProductVO> page, MerchantProductVO productVO);
|
||||
IPage<MerchantCatalogVO> selectMerchantCatalogPage(IPage<MerchantCatalogVO> page, MerchantCatalogVO catalogVO);
|
||||
|
||||
boolean submitPlatformProduct(MerchantProductEntity product);
|
||||
boolean submitPlatformCatalog(MerchantCatalogEntity catalog);
|
||||
|
||||
List<MarketMerchantProductApiVO> productListByUserId(Long userId);
|
||||
List<MarketMerchantCatalogApiVO> catalogListByUserId(Long userId);
|
||||
|
||||
boolean submitMerchantProduct(Long userId, Long productId, String productName, String thumbImageUrl, List<String> mainImageUrls, List<String> detailImageUrls, List<MerchantProductEntity.Spec> specs);
|
||||
boolean submitMerchantCatalog(Long userId, Long productId, String productName, String thumbImageUrl, List<String> mainImageUrls, List<String> detailImageUrls, List<MerchantCatalogEntity.Spec> specs);
|
||||
|
||||
}
|
||||
@@ -31,6 +31,7 @@ import org.springblade.modules.api.vo.MarketMerchantInventoryApiVO;
|
||||
import org.springblade.modules.market.pojo.entity.MerchantInventoryEntity;
|
||||
import org.springblade.modules.market.pojo.vo.MerchantInventoryVO;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -51,6 +52,6 @@ public interface IMerchantInventoryService extends BaseService<MerchantInventory
|
||||
|
||||
List<MarketMerchantInventoryApiVO> inventoryListByUserId(Long userId);
|
||||
|
||||
boolean increase(Long userId, Long productId, Integer num);
|
||||
boolean increase(Long userId, Long productId, Integer num, BigDecimal price,Integer giftType, BigDecimal giftAmount);
|
||||
|
||||
}
|
||||
|
||||
@@ -34,14 +34,14 @@ import org.springblade.core.log.exception.ServiceException;
|
||||
import org.springblade.core.mp.base.BaseServiceImpl;
|
||||
import org.springblade.core.redis.ratelimiter.RateLimiter;
|
||||
import org.springblade.core.tool.utils.StringUtil;
|
||||
import org.springblade.modules.api.vo.MarketMerchantProductApiVO;
|
||||
import org.springblade.modules.api.vo.MarketMerchantCatalogApiVO;
|
||||
import org.springblade.modules.market.convert.MarketMerchantConvert;
|
||||
import org.springblade.modules.market.eums.MerchantProductType;
|
||||
import org.springblade.modules.market.eums.MerchantType;
|
||||
import org.springblade.modules.market.mapper.MerchantProductMapper;
|
||||
import org.springblade.modules.market.pojo.entity.MerchantProductEntity;
|
||||
import org.springblade.modules.market.pojo.vo.MerchantProductVO;
|
||||
import org.springblade.modules.market.service.IMerchantProductService;
|
||||
import org.springblade.modules.market.mapper.MerchantCatalogMapper;
|
||||
import org.springblade.modules.market.pojo.entity.MerchantCatalogEntity;
|
||||
import org.springblade.modules.market.pojo.vo.MerchantCatalogVO;
|
||||
import org.springblade.modules.market.service.IMerchantCatalogService;
|
||||
import org.springblade.modules.system.pojo.entity.User;
|
||||
import org.springblade.modules.system.service.IUserService;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -59,44 +59,44 @@ import java.util.concurrent.TimeUnit;
|
||||
*/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class MerchantProductServiceImpl extends BaseServiceImpl<MerchantProductMapper, MerchantProductEntity> implements IMerchantProductService {
|
||||
public class MerchantCatalogServiceImpl extends BaseServiceImpl<MerchantCatalogMapper, MerchantCatalogEntity> implements IMerchantCatalogService {
|
||||
|
||||
private final IUserService userService;
|
||||
|
||||
private static final String MERCHANT_PRODUCT_QUANTITY_LIMIT = "merchant.product.quantity.limit";
|
||||
private static final String MERCHANT_CATALOG_QUANTITY_LIMIT = "merchant.catalog.quantity.limit";
|
||||
|
||||
@Override
|
||||
public IPage<MerchantProductVO> selectMerchantProductPage(IPage<MerchantProductVO> page, MerchantProductVO productVO) {
|
||||
return page.setRecords(baseMapper.selectMerchantProductPage(page, productVO));
|
||||
public IPage<MerchantCatalogVO> selectMerchantCatalogPage(IPage<MerchantCatalogVO> page, MerchantCatalogVO catalogVO) {
|
||||
return page.setRecords(baseMapper.selectMerchantCatalogPage(page, catalogVO));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean submitPlatformProduct(MerchantProductEntity product) {
|
||||
if (product.getCostPrice() == null || product.getCostPrice().compareTo(BigDecimal.ZERO) < 1 || StringUtil.isBlank(product.getProductName())) {
|
||||
public boolean submitPlatformCatalog(MerchantCatalogEntity catalog) {
|
||||
if (catalog.getCostPrice() == null || catalog.getCostPrice().compareTo(BigDecimal.ZERO) < 1 || StringUtil.isBlank(catalog.getProductName())) {
|
||||
throw new ServiceException("必填参数不能为空");
|
||||
}
|
||||
if (product.getId() != null) {
|
||||
MerchantProductEntity entity = getById(product.getId());
|
||||
if (catalog.getId() != null) {
|
||||
MerchantCatalogEntity entity = getById(catalog.getId());
|
||||
if (entity != null) {
|
||||
if (!Objects.equals(entity.getType(), MerchantProductType.PLATFORM.getCode()) || product.getUserId() != null) {
|
||||
if (!Objects.equals(entity.getType(), MerchantProductType.PLATFORM.getCode()) || catalog.getUserId() != null) {
|
||||
throw new ServiceException("企业商品不可修改");
|
||||
}
|
||||
}
|
||||
}
|
||||
product.setType(MerchantProductType.PLATFORM.getCode());
|
||||
return saveOrUpdate(product);
|
||||
catalog.setType(MerchantProductType.PLATFORM.getCode());
|
||||
return saveOrUpdate(catalog);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MarketMerchantProductApiVO> productListByUserId(Long userId) {
|
||||
public List<MarketMerchantCatalogApiVO> catalogListByUserId(Long userId) {
|
||||
if (Objects.isNull(userId)) {
|
||||
throw new ServiceException("无效用户");
|
||||
}
|
||||
List<MerchantProductEntity> list = list(Wrappers.lambdaQuery(MerchantProductEntity.class).eq(MerchantProductEntity::getIsDeleted, 0)
|
||||
List<MerchantCatalogEntity> list = list(Wrappers.lambdaQuery(MerchantCatalogEntity.class).eq(MerchantCatalogEntity::getIsDeleted, 0)
|
||||
.and(wrapper -> wrapper
|
||||
.eq(MerchantProductEntity::getType, MerchantProductType.PLATFORM.getCode())
|
||||
.eq(MerchantCatalogEntity::getType, MerchantProductType.PLATFORM.getCode())
|
||||
.or()
|
||||
.eq(MerchantProductEntity::getType, MerchantProductType.MERCHANT.getCode()).eq(MerchantProductEntity::getUserId, userId)
|
||||
.eq(MerchantCatalogEntity::getType, MerchantProductType.MERCHANT.getCode()).eq(MerchantCatalogEntity::getUserId, userId)
|
||||
)
|
||||
);
|
||||
return MarketMerchantConvert.INSTANCE.convertMerchantProductEntityToApiVOList(list);
|
||||
@@ -104,7 +104,7 @@ public class MerchantProductServiceImpl extends BaseServiceImpl<MerchantProductM
|
||||
|
||||
@Override
|
||||
@RateLimiter(value = "merchant:product", param = "#userId", max = 1, ttl = 10, timeUnit = TimeUnit.SECONDS)
|
||||
public boolean submitMerchantProduct(Long userId, Long productId, String productName, String thumbImageUrl, List<String> mainImageUrls, List<String> detailImageUrls, List<MerchantProductEntity.Spec> specs) {
|
||||
public boolean submitMerchantCatalog(Long userId, Long productId, String productName, String thumbImageUrl, List<String> mainImageUrls, List<String> detailImageUrls, List<MerchantCatalogEntity.Spec> specs) {
|
||||
if (Objects.isNull(userId)) {
|
||||
throw new ServiceException("无效用户");
|
||||
}
|
||||
@@ -122,17 +122,17 @@ public class MerchantProductServiceImpl extends BaseServiceImpl<MerchantProductM
|
||||
|
||||
boolean isNew = (productId == null);
|
||||
if (isNew) {
|
||||
String limit = ParamCache.getValue(MERCHANT_PRODUCT_QUANTITY_LIMIT);
|
||||
String limit = ParamCache.getValue(MERCHANT_CATALOG_QUANTITY_LIMIT);
|
||||
if (StringUtil.isBlank(limit)) {
|
||||
throw new ServiceException("系统配置异常:商品数量上限未设置");
|
||||
}
|
||||
long count = count(Wrappers.lambdaQuery(MerchantProductEntity.class).eq(MerchantProductEntity::getUserId, userId).eq(MerchantProductEntity::getIsDeleted, 0));
|
||||
long count = count(Wrappers.lambdaQuery(MerchantCatalogEntity.class).eq(MerchantCatalogEntity::getUserId, userId).eq(MerchantCatalogEntity::getIsDeleted, 0));
|
||||
if (count >= Long.parseLong(limit)) {
|
||||
throw new ServiceException("商品数量已经超过上限");
|
||||
}
|
||||
}
|
||||
|
||||
MerchantProductEntity entity = new MerchantProductEntity();
|
||||
MerchantCatalogEntity entity = new MerchantCatalogEntity();
|
||||
entity.setType(MerchantProductType.MERCHANT.getCode());
|
||||
entity.setUserId(userId);
|
||||
entity.setUserAccount(user.getAccount());
|
||||
@@ -142,7 +142,7 @@ public class MerchantProductServiceImpl extends BaseServiceImpl<MerchantProductM
|
||||
entity.setDetailImageUrls(detailImageUrls);
|
||||
entity.setSpecs(specs);
|
||||
if (productId != null) {
|
||||
MerchantProductEntity p = getById(productId);
|
||||
MerchantCatalogEntity p = getById(productId);
|
||||
if (p != null) {
|
||||
if (!Objects.equals(p.getUserId(), entity.getUserId())) {
|
||||
throw new ServiceException("无效参数");
|
||||
@@ -34,16 +34,17 @@ import org.springblade.core.mp.base.BaseServiceImpl;
|
||||
import org.springblade.core.redis.ratelimiter.RateLimiter;
|
||||
import org.springblade.modules.api.vo.MarketMerchantInventoryApiVO;
|
||||
import org.springblade.modules.market.eums.MarketBusinessModule;
|
||||
import org.springblade.modules.market.eums.MerchantGiftType;
|
||||
import org.springblade.modules.market.eums.MerchantProductType;
|
||||
import org.springblade.modules.market.eums.MerchantType;
|
||||
import org.springblade.modules.market.mapper.MerchantInventoryMapper;
|
||||
import org.springblade.modules.market.pojo.dto.MarketBenefitPointApiDTO;
|
||||
import org.springblade.modules.market.pojo.dto.MarketCashCouponApiDTO;
|
||||
import org.springblade.modules.market.pojo.entity.MarketInfoEntity;
|
||||
import org.springblade.modules.market.pojo.entity.MerchantInventoryEntity;
|
||||
import org.springblade.modules.market.pojo.entity.MerchantProductEntity;
|
||||
import org.springblade.modules.market.pojo.entity.MerchantCatalogEntity;
|
||||
import org.springblade.modules.market.pojo.vo.MerchantInventoryVO;
|
||||
import org.springblade.modules.market.service.IMarketCashCouponService;
|
||||
import org.springblade.modules.market.service.IMerchantInventoryService;
|
||||
import org.springblade.modules.market.service.IMerchantProductService;
|
||||
import org.springblade.modules.market.service.*;
|
||||
import org.springblade.modules.system.pojo.entity.User;
|
||||
import org.springblade.modules.system.service.IUserService;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -67,10 +68,14 @@ public class MerchantInventoryServiceImpl extends BaseServiceImpl<MerchantInvent
|
||||
|
||||
private final IUserService userService;
|
||||
|
||||
private final IMerchantProductService productService;
|
||||
private final IMerchantCatalogService productService;
|
||||
|
||||
private final IMarketCashCouponService cashCouponService;
|
||||
|
||||
private final IMarketInfoService infoService;
|
||||
|
||||
private final IMarketBenefitPointService benefitPointService;
|
||||
|
||||
@Override
|
||||
public IPage<MerchantInventoryVO> selectProductInventoryPage(IPage<MerchantInventoryVO> page, MerchantInventoryVO inventory) {
|
||||
return page.setRecords(baseMapper.selectProductInventoryPage(page, inventory));
|
||||
@@ -87,7 +92,7 @@ public class MerchantInventoryServiceImpl extends BaseServiceImpl<MerchantInvent
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@RateLimiter(value = "inventory:limiter", param = "#userId", max = 1, ttl = 10, timeUnit = TimeUnit.SECONDS)
|
||||
public boolean increase(Long userId, Long productId, Integer num) {
|
||||
public boolean increase(Long userId, Long productId, Integer num, BigDecimal price, Integer giftType, BigDecimal giftAmount) {
|
||||
if (Objects.isNull(userId)) {
|
||||
throw new ServiceException("无效用户");
|
||||
}
|
||||
@@ -99,7 +104,7 @@ public class MerchantInventoryServiceImpl extends BaseServiceImpl<MerchantInvent
|
||||
throw new IllegalArgumentException("无效数量");
|
||||
}
|
||||
Integer merchantType = MarketInfoCache.checkMerchantType(userId);
|
||||
MerchantProductEntity product = productService.getById(productId);
|
||||
MerchantCatalogEntity product = productService.getById(productId);
|
||||
if (Objects.isNull(product)) {
|
||||
throw new ServiceException("无效商品");
|
||||
}
|
||||
@@ -107,54 +112,58 @@ public class MerchantInventoryServiceImpl extends BaseServiceImpl<MerchantInvent
|
||||
if (userType.getCode() == MerchantType.UNREVIEWED.getCode()) {
|
||||
throw new ServiceException("用户没有该操作权限");
|
||||
}
|
||||
switch (MerchantProductType.fromCode(product.getType())) {
|
||||
|
||||
MerchantProductType currentType = MerchantProductType.fromCode(product.getType());
|
||||
switch (currentType) {
|
||||
case PLATFORM -> {
|
||||
BigDecimal totalAmount = product.getCostPrice().multiply(BigDecimal.valueOf(num));
|
||||
cashCouponService.deductCashCoupon(new MarketCashCouponApiDTO(userId, totalAmount, MarketBusinessModule.MERCHANT_PURCHASING, null, "", String.format("采购商品[%s],ID[%d],数量[%d]", product.getProductName(), product.getId(), num)));
|
||||
MerchantInventoryEntity inventory = getOne(Wrappers.lambdaQuery(MerchantInventoryEntity.class).eq(MerchantInventoryEntity::getUserId, userId).eq(MerchantInventoryEntity::getType, MerchantProductType.PLATFORM.getCode()).eq(MerchantInventoryEntity::getProductId, productId).eq(MerchantInventoryEntity::getIsDeleted, 0).orderByDesc(MerchantInventoryEntity::getId));
|
||||
if (Objects.nonNull(inventory)) {
|
||||
if (baseMapper.increaseInventory(inventory.getId(), num, inventory.getVersion()) < 1) {
|
||||
throw new ServiceException("操作失败");
|
||||
}
|
||||
} else {
|
||||
MerchantInventoryEntity entity = new MerchantInventoryEntity();
|
||||
entity.setUserId(userId);
|
||||
entity.setUserAccount(user.getAccount());
|
||||
entity.setType(MerchantProductType.PLATFORM.getCode());
|
||||
entity.setProductId(productId);
|
||||
entity.setProductName(product.getProductName());
|
||||
entity.setQuantity(num);
|
||||
if (!save(entity)) {
|
||||
throw new ServiceException("操作失败");
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
case MERCHANT -> {
|
||||
if (userType.getCode() != MerchantType.ENTERPRISE.getCode()) {
|
||||
throw new ServiceException("无法添加该类型商品");
|
||||
}
|
||||
MerchantInventoryEntity inventory = getOne(Wrappers.lambdaQuery(MerchantInventoryEntity.class).eq(MerchantInventoryEntity::getUserId, userId).eq(MerchantInventoryEntity::getType, MerchantProductType.MERCHANT.getCode()).eq(MerchantInventoryEntity::getProductId, productId).eq(MerchantInventoryEntity::getIsDeleted, 0).orderByDesc(MerchantInventoryEntity::getId));
|
||||
if (Objects.nonNull(inventory)) {
|
||||
if (baseMapper.increaseInventory(inventory.getId(), num, inventory.getVersion()) < 1) {
|
||||
throw new ServiceException("操作失败");
|
||||
}
|
||||
} else {
|
||||
MerchantInventoryEntity entity = new MerchantInventoryEntity();
|
||||
entity.setUserId(userId);
|
||||
entity.setUserAccount(user.getAccount());
|
||||
entity.setType(MerchantProductType.MERCHANT.getCode());
|
||||
entity.setProductId(productId);
|
||||
entity.setProductName(product.getProductName());
|
||||
entity.setQuantity(num);
|
||||
if (!save(entity)) {
|
||||
throw new ServiceException("操作失败");
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
throw new ServiceException("操作失败");
|
||||
MerchantInventoryEntity inventory = getOne(Wrappers.lambdaQuery(MerchantInventoryEntity.class).eq(MerchantInventoryEntity::getUserId, userId).eq(MerchantInventoryEntity::getType, currentType.getCode()).eq(MerchantInventoryEntity::getProductId, productId).eq(MerchantInventoryEntity::getIsDeleted, 0).orderByDesc(MerchantInventoryEntity::getId));
|
||||
BigDecimal totalBenefitPointAmount = BigDecimal.ZERO;
|
||||
if (Objects.nonNull(inventory)) {
|
||||
BigDecimal multiply = inventory.getUnitGiftAmount().multiply(BigDecimal.valueOf(num));
|
||||
totalBenefitPointAmount = totalBenefitPointAmount.add(multiply);
|
||||
if (baseMapper.increaseInventory(inventory.getId(), num, inventory.getVersion()) < 1) {
|
||||
throw new ServiceException("操作失败");
|
||||
}
|
||||
} else {
|
||||
if (Objects.isNull(price) || price.compareTo(BigDecimal.ZERO) < 1 || Objects.isNull(giftAmount) || giftAmount.compareTo(BigDecimal.ZERO) < 1) {
|
||||
throw new ServiceException("无效参数");
|
||||
}
|
||||
MerchantInventoryEntity entity = new MerchantInventoryEntity();
|
||||
entity.setUserId(userId);
|
||||
entity.setUserAccount(user.getAccount());
|
||||
entity.setType(currentType.getCode());
|
||||
entity.setProductName(product.getProductName());
|
||||
entity.setProductId(productId);
|
||||
MarketInfoEntity info = infoService.getById(userId);
|
||||
if (Objects.nonNull(info)) {
|
||||
entity.setStoreName(info.getStoreName());
|
||||
}
|
||||
entity.setThumbImageUrl(product.getThumbImageUrl());
|
||||
entity.setUnitPrice(price);
|
||||
entity.setGiftType(MerchantGiftType.BENEFIT_POINT.getCode());
|
||||
entity.setUnitGiftAmount(giftAmount);
|
||||
entity.setStock(num);
|
||||
BigDecimal multiply = giftAmount.multiply(BigDecimal.valueOf(num));
|
||||
totalBenefitPointAmount = totalBenefitPointAmount.add(multiply);
|
||||
if (!save(entity)) {
|
||||
throw new ServiceException("操作失败");
|
||||
}
|
||||
}
|
||||
BigDecimal fee = totalBenefitPointAmount.multiply(BigDecimal.valueOf(0.2));
|
||||
totalBenefitPointAmount = totalBenefitPointAmount.add(fee);
|
||||
if (!benefitPointService.deductBenefitPoint(new MarketBenefitPointApiDTO(userId, totalBenefitPointAmount, fee, MarketBusinessModule.MERCHANT_PUBLISH, null, String.format("上架商品[%s],ID[%d],数量[%d]", product.getProductName(), product.getId(), num), ""))) {
|
||||
throw new ServiceException("操作失败");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user