修改bug

This commit is contained in:
zhaotianfeng 2024-09-25 11:53:05 +08:00
parent 57c3422180
commit 8cc44016d7
4 changed files with 22 additions and 1 deletions

View File

@ -63,7 +63,7 @@ public class CardGiftActiveServiceImpl extends ServiceImpl<CardGiftActiveMapper,
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
if (CollectionUtil.isNotEmpty(list)) {
LambdaQueryWrapper<CardGiftActive> queryWrapperActive = new LambdaQueryWrapper<>();
queryWrapperActive.eq(CardGiftActive::getActiveNum,activeNum)
queryWrapperActive.eq(CardGiftActive::getActiveName,activeNum)
.eq(CardGiftActive::getStoreId,nowAccountInfo.getStoreId()).last("limit 1");
CardGiftActive giftActive = this.getOne(queryWrapperActive);
if (interType.equals("1")){

View File

@ -70,6 +70,10 @@ public class SysBannerController extends BaseController {
@PostMapping
public ResponseObject add(@RequestBody SysBanner sysBanner) {
try {
// 先查询名称是否存在
if(this.sysBannerService.queryByName(sysBanner.getBannerName())!=null){
return getFailureResult(500,"名称已存在");
}
SysLog sysLog =new SysLog();
sysLog.setSystemName("1");
sysLog.setMoudle("banner配置");
@ -88,6 +92,10 @@ public class SysBannerController extends BaseController {
@PutMapping
public ResponseObject edit(@RequestBody SysBanner sysBanner) {
try {
// 先查询名称是否存在
if(this.sysBannerService.queryByName(sysBanner.getBannerName())!=null){
return getFailureResult(500,"名称已存在");
}
SysLog sysLog =new SysLog();
sysLog.setSystemName("1");
sysLog.setMoudle("banner配置");

View File

@ -55,4 +55,6 @@ public interface SysBannerService {
*/
boolean deleteById(Integer id);
SysBanner queryByName(String bannerName);
}

View File

@ -13,6 +13,8 @@ import com.fuint.common.dto.AccountInfo;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
/**
* 存储Banner信息的表(SysBanner)表服务实现类
@ -88,4 +90,13 @@ public class SysBannerServiceImpl implements SysBannerService {
public boolean deleteById(Integer id) {
return this.sysBannerMapper.deleteById(id) > 0;
}
@Override
public SysBanner queryByName(String bannerName) {
HashMap<String, Object> objectObjectHashMap = new HashMap<>();
objectObjectHashMap.put("banner_name",bannerName);
List<SysBanner> sysBanners = sysBannerMapper.selectByMap(objectObjectHashMap);
return sysBanners.size() > 0 ? sysBanners.get(0) : null;
}
}