Merge branch 'ww' into test

This commit is contained in:
2024-08-21 10:16:37 +08:00
3 changed files with 16 additions and 11 deletions

View File

@@ -16,5 +16,7 @@ public interface TbShopExtendService extends IService<TbShopExtend> {
Map<String, Object> queryAll(TbShopExtendQueryCriteria criteria);
void saveInfo(TbShopExtend tbShopExtend);
}

View File

@@ -1,5 +1,6 @@
package cn.ysk.cashier.mybatis.service.impl;
import cn.ysk.cashier.exception.BadRequestException;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.ysk.cashier.mybatis.mapper.TbShopExtendMapper;
@@ -41,5 +42,16 @@ public class TbShopExtendServiceImpl extends ServiceImpl<TbShopExtendMapper, TbS
Page<TbShopExtend> ipage = tbShopExtendmapper.selectPage(page, wrapper);
return PageUtil.toPage(ipage.getRecords(), ipage.getTotal());
}
@Override
public void saveInfo(TbShopExtend tbShopExtend) {
QueryWrapper<TbShopExtend> wrapper = new QueryWrapper<>();
wrapper.eq("shop_id", tbShopExtend.getShopId());
wrapper.like("autokey",tbShopExtend.getAutokey());
if(tbShopExtendmapper.exists(wrapper)){
throw new BadRequestException("该自定义key已存在");
}
tbShopExtendmapper.insert(tbShopExtend);
}
}