Fix:湖南电信

This commit is contained in:
Owen 2025-03-05 15:56:33 +08:00
parent b6360e5c5e
commit 1a8b730e71
4 changed files with 34 additions and 1 deletions

View File

@ -50,4 +50,7 @@ public interface ErrorCodeConstants {
ErrorCode ORDER_OPERATE_LOG_NOT_EXISTS = new ErrorCode(1_826_001_001, "订单操作日志不存在");
ErrorCode ORDER_SYNC_LOG_NOT_EXISTS = new ErrorCode(1_827_001_001, "抓单记录不存在");
ErrorCode PRODUCT_EXITS = new ErrorCode(1_827_001_021, "产品已经存在");
}

View File

@ -36,7 +36,7 @@ import java.util.List;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.invalidParamException;
import static cn.iocoder.yudao.module.haoka.enums.ErrorCodeConstants.ON_SALE_PRODUCT_NOT_EXISTS;
import static cn.iocoder.yudao.module.haoka.enums.ErrorCodeConstants.*;
/**
* 在售产品 Service 实现类
@ -75,6 +75,16 @@ public class OnSaleProductServiceImpl extends ServiceImpl<OnSaleProductMapper,On
public Long createOnSaleProduct(OnSaleProductSaveReqVO createReqVO) {
// 插入
OnSaleProductDO onSaleProduct = BeanUtils.toBean(createReqVO, OnSaleProductDO.class);
if ( createReqVO.getSku()!=null){
OnSaleProductDO onSaleProductDO =
onSaleProductMapper.selectOne(new LambdaQueryWrapperX<OnSaleProductDO>().eq(OnSaleProductDO::getSku, createReqVO.getSku()));
if (onSaleProductDO!=null){
throw exception(PRODUCT_EXITS);
}
}
onSaleProductMapper.insert(onSaleProduct);
onSaleProduct.setId(SnowflakeId.generate());

View File

@ -64,6 +64,14 @@ public class HaoKaProductServiceImpl extends ServiceImpl<HaoKaProductMapper, Hao
bizNo = "{{#haoKaProduct.id}}",
success = LogRecordConstants.HAOKA_PRODUCT_CREATE_SUCCESS)
public Long createHaoKaProduct(HaoKaProductSaveReqVO createReqVO) {
if ( createReqVO.getSku()!=null){
HaoKaProductDO onSaleProductDO =
haoKaProductMapper.selectOne(new LambdaQueryWrapperX<HaoKaProductDO>().eq(HaoKaProductDO::getSku, createReqVO.getSku()));
if (onSaleProductDO!=null){
throw exception(PRODUCT_EXITS);
}
}
// 插入
HaoKaProductDO haoKaProduct = BeanUtils.toBean(createReqVO, HaoKaProductDO.class);
haoKaProduct.setId(SnowflakeId.generate());

View File

@ -1,5 +1,7 @@
package cn.iocoder.yudao.module.haoka.service.superiorproductconfig;
import cn.iocoder.yudao.framework.common.exception.ErrorCode;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import jakarta.annotation.Resource;
@ -35,6 +37,16 @@ public class SuperiorProductConfigServiceImpl
@Override
public Long createSuperiorProductConfig(SuperiorProductConfigSaveReqVO createReqVO) {
Long haokaProductId = createReqVO.getHaokaProductId();
Long haokaSuperiorApiId = createReqVO.getHaokaSuperiorApiId();
if (haokaProductId!=null&& haokaSuperiorApiId!=null){
SuperiorProductConfigDO superiorProductConfigDO = superiorProductConfigMapper.selectOne(new LambdaQueryWrapperX<SuperiorProductConfigDO>()
.eq(SuperiorProductConfigDO::getHaokaProductId, haokaProductId)
.eq(SuperiorProductConfigDO::getHaokaSuperiorApiId, haokaSuperiorApiId));
if (superiorProductConfigDO!=null){
throw exception(new ErrorCode(10012,"配置已经存在"));
}
}
// 插入
SuperiorProductConfigDO superiorProductConfig = BeanUtils.toBean(createReqVO, SuperiorProductConfigDO.class);
superiorProductConfigMapper.insert(superiorProductConfig);