存酒接口
This commit is contained in:
@@ -1,14 +0,0 @@
|
||||
package com.czg.service.account.mapper;
|
||||
|
||||
import com.mybatisflex.core.BaseMapper;
|
||||
import com.czg.account.entity.ShopStorageGood;
|
||||
|
||||
/**
|
||||
* 酒品表 映射层。
|
||||
*
|
||||
* @author zs
|
||||
* @since 2025-02-26
|
||||
*/
|
||||
public interface ShopStorageGoodMapper extends BaseMapper<ShopStorageGood> {
|
||||
|
||||
}
|
||||
@@ -130,6 +130,8 @@ public class ShopInfoServiceImpl extends ServiceImpl<ShopInfoMapper, ShopInfo> i
|
||||
if (!StpKit.USER.isAdmin() && !Objects.equals(StpKit.USER.getShopId(), shopInfo.getId())) {
|
||||
throw new ApiNotPrintException("店铺信息不存在");
|
||||
}
|
||||
|
||||
SysUser sysUser = sysUserService.getById(shopInfo.getId());
|
||||
return shopInfo;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
package com.czg.service.account.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.czg.account.dto.storage.ShopStorageGoodDTO;
|
||||
import com.czg.exception.ApiNotPrintException;
|
||||
import com.mybatisflex.core.query.QueryWrapper;
|
||||
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
||||
import com.czg.account.entity.ShopStorageGood;
|
||||
import com.czg.account.service.ShopStorageGoodService;
|
||||
import com.czg.service.account.mapper.ShopStorageGoodMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 酒品表 服务层实现。
|
||||
*
|
||||
* @author zs
|
||||
* @since 2025-02-26
|
||||
*/
|
||||
@Service
|
||||
public class ShopStorageGoodServiceImpl extends ServiceImpl<ShopStorageGoodMapper, ShopStorageGood> implements ShopStorageGoodService{
|
||||
|
||||
@Override
|
||||
public Boolean edit(Long shopId, ShopStorageGoodDTO shopStorageGoodDTO) {
|
||||
ShopStorageGood storageGood = getOne(new QueryWrapper().eq(ShopStorageGood::getShopId, shopId).eq(ShopStorageGood::getId, shopStorageGoodDTO.getId()));
|
||||
if (storageGood == null) {
|
||||
throw new ApiNotPrintException("商品不存在");
|
||||
}
|
||||
|
||||
BeanUtil.copyProperties(shopStorageGoodDTO, storageGood);
|
||||
storageGood.setSource(null);
|
||||
return updateById(storageGood);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean saveInfo(Long shopId, ShopStorageGoodDTO shopStorageGoodDTO) {
|
||||
ShopStorageGood shopStorageGood = BeanUtil.copyProperties(shopStorageGoodDTO, ShopStorageGood.class);
|
||||
shopStorageGood.setShopId(shopId);
|
||||
return save(shopStorageGood);
|
||||
}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
<?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="com.czg.service.account.mapper.ShopStorageGoodMapper">
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user