商品模块代码提交
This commit is contained in:
@@ -42,26 +42,26 @@ public class ShopProdUnitServiceImpl extends ServiceImpl<ShopProdUnitMapper, Sho
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<ShopProdUnitDTO> page(ShopProdUnitDTO param) {
|
||||
public Page<ShopProdUnitDTO> getShopProdUnitPage(ShopProdUnitDTO param) {
|
||||
QueryWrapper queryWrapper = buildQueryWrapper(param);
|
||||
return super.pageAs(PageUtil.buildPage(), queryWrapper, ShopProdUnitDTO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ShopProdUnitDTO> list(ShopProdUnitDTO param) {
|
||||
public List<ShopProdUnitDTO> getShopProdUnitList(ShopProdUnitDTO param) {
|
||||
QueryWrapper queryWrapper = buildQueryWrapper(param);
|
||||
queryWrapper.eq(ShopProdUnit::getStatus, StatusEnum.ENABLED.value());
|
||||
return super.listAs(queryWrapper, ShopProdUnitDTO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ShopProdUnitDTO get(Long id) {
|
||||
public ShopProdUnitDTO getShopProdUnitById(Long id) {
|
||||
Long shopId = StpKit.USER.getLoginIdAsLong();
|
||||
return super.getOneAs(query().eq(ShopProdUnit::getId, id).eq(ShopProdUnit::getShopId, shopId), ShopProdUnitDTO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean save(ShopProdUnitDTO dto) {
|
||||
public boolean addShopProdUnit(ShopProdUnitDTO dto) {
|
||||
Long shopId = StpKit.USER.getLoginIdAsLong();
|
||||
boolean exists = super.exists(query().eq(ShopProdUnit::getName, dto.getName()).eq(ShopProdUnit::getShopId, shopId));
|
||||
if (exists) {
|
||||
@@ -78,7 +78,7 @@ public class ShopProdUnitServiceImpl extends ServiceImpl<ShopProdUnitMapper, Sho
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean update(ShopProdUnitDTO dto) {
|
||||
public boolean updateShopProdUnit(ShopProdUnitDTO dto) {
|
||||
Long shopId = StpKit.USER.getLoginIdAsLong();
|
||||
boolean exists = super.exists(query().eq(ShopProdUnit::getName, dto.getName()).eq(ShopProdUnit::getShopId, shopId).ne(ShopProdUnit::getId, dto.getId()));
|
||||
if (exists) {
|
||||
@@ -89,7 +89,13 @@ public class ShopProdUnitServiceImpl extends ServiceImpl<ShopProdUnitMapper, Sho
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean disable(Long id) {
|
||||
public boolean deleteShopProdUnit(Long id) {
|
||||
Long shopId = StpKit.USER.getLoginIdAsLong();
|
||||
return super.remove(query().eq(ShopProdUnit::getId, id).eq(ShopProdUnit::getShopId, shopId));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean disableShopProdUnit(Long id) {
|
||||
Long shopId = StpKit.USER.getLoginIdAsLong();
|
||||
return UpdateChain.of(ShopProdUnit.class)
|
||||
.set(ShopProdUnit::getStatus, StatusEnum.DISABLE.value())
|
||||
@@ -99,7 +105,7 @@ public class ShopProdUnitServiceImpl extends ServiceImpl<ShopProdUnitMapper, Sho
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enable(Long id) {
|
||||
public boolean enableShopProdUnit(Long id) {
|
||||
Long shopId = StpKit.USER.getLoginIdAsLong();
|
||||
return UpdateChain.of(ShopProdUnit.class)
|
||||
.set(ShopProdUnit::getStatus, StatusEnum.ENABLED.value())
|
||||
|
||||
Reference in New Issue
Block a user