update:
1.change category attribution
This commit is contained in:
@@ -103,7 +103,7 @@ public class PriceListController extends BladeController {
|
||||
@ApiOperationSupport(order = 4)
|
||||
@Operation(summary = "新增", description = "传入priceList")
|
||||
public R save(@Valid @RequestBody PriceListEntity priceList) {
|
||||
return R.status(priceListService.save(priceList));
|
||||
return R.status(priceListService.savePriceList(priceList));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -54,4 +54,6 @@ public interface IPriceListService extends BaseService<PriceListEntity> {
|
||||
IPage<PriceListSummaryVO> selectSummaryListPage(IPage<PriceListSummaryVO> page, Long deptId);
|
||||
|
||||
List<PriceListVO> selectDetailList(PriceListVO priceList);
|
||||
|
||||
boolean savePriceList(PriceListEntity priceList);
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
*/
|
||||
package org.springblade.modules.kiosk.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springblade.core.log.exception.ServiceException;
|
||||
@@ -82,4 +83,19 @@ public class PriceListServiceImpl extends BaseServiceImpl<PriceListMapper, Price
|
||||
return baseMapper.selectPriceList(priceList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean savePriceList(PriceListEntity priceList) {
|
||||
long count = count(Wrappers.<PriceListEntity>lambdaQuery()
|
||||
.eq(priceList.getCategoryId() != null, PriceListEntity::getCategoryId, priceList.getCategoryId())
|
||||
.eq(priceList.getShape() != null, PriceListEntity::getShape, priceList.getShape())
|
||||
.eq(priceList.getSize() != null, PriceListEntity::getSize, priceList.getSize())
|
||||
.eq(priceList.getMaterial() != null, PriceListEntity::getMaterial, priceList.getMaterial())
|
||||
.eq(priceList.getStyle() != null, PriceListEntity::getStyle, priceList.getStyle())
|
||||
);
|
||||
if (count > 0) {
|
||||
throw new ServiceException("The price list already exists");
|
||||
}
|
||||
return save(priceList);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user