Compare commits

..

3 Commits

Author SHA1 Message Date
zhaotianfeng
3327bece3c Merge branch 'main' of http://122.51.230.86:3000/dianliang/oil-station 2024-09-25 11:54:09 +08:00
zhaotianfeng
6833b81a2b 修改bug 2024-09-25 11:53:41 +08:00
zhaotianfeng
8cc44016d7 修改bug 2024-09-25 11:53:05 +08:00
6 changed files with 41 additions and 8 deletions

View File

@ -125,12 +125,12 @@
@click="handleUpdate(scope.row)"
>修改</el-button>
<el-button
size="mini"
type="text"
@click="handleDelete(scope.row)"
>删除
</el-button>
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- @click="handleDelete(scope.row)"-->
<!-- >删除-->
<!-- </el-button>-->
<el-button
size="mini"
type="text"

View File

@ -115,7 +115,12 @@
</div>
<el-dialog :title="title" :close-on-click-modal="false" :visible.sync="open" width="28%" append-to-body>
<el-dialog
@close="close()"
:title="title"
:close-on-click-modal="false"
:visible.sync="open" width="28%"
append-to-body>
<el-form ref="form" :model="deviceInfo" label-width="80px" :rules="rules">
<el-form :model="deviceInfo" ref="deviceForm" label-width="120px" :rules="rules">
<el-form-item label="banner名称" prop="bannerName">
@ -168,6 +173,7 @@
</el-form-item>
<el-form-item>
<el-button type="primary" @click="submitForm('deviceForm')">提交</el-button>
<el-button @click="open=false">取消</el-button>
</el-form-item>
</el-form>
</el-form>
@ -250,6 +256,12 @@ export default {
this.getList()
},
methods: {
//
close(){
//
this.$refs['deviceForm'].resetFields();
},
getList(){
getBannerListApi(this.queryParams).then(res=>{
this.tableData = res.data.records;

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;
}
}