修改bug
This commit is contained in:
parent
57c3422180
commit
8cc44016d7
@ -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")){
|
||||
|
@ -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配置");
|
||||
|
@ -55,4 +55,6 @@ public interface SysBannerService {
|
||||
*/
|
||||
boolean deleteById(Integer id);
|
||||
|
||||
SysBanner queryByName(String bannerName);
|
||||
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user