update 站点白名单

This commit is contained in:
2023-04-20 15:20:07 +08:00
parent 582640e5a0
commit a89870bea9
3 changed files with 80 additions and 70 deletions

View File

@@ -24,82 +24,75 @@ import java.util.List;
/**
* 站点白名单Controller
*
*
* @author jsowell
* @date 2023-04-20
*/
@RestController
@RequestMapping("/pile/whitelist")
public class PileStationWhitelistController extends BaseController
{
@Autowired
private IPileStationWhitelistService pileStationWhitelistService;
public class PileStationWhitelistController extends BaseController {
@Autowired
private IPileStationWhitelistService pileStationWhitelistService;
/**
* 查询站点白名单列表
*/
@PreAuthorize("@ss.hasPermi('pile:whitelist:list')")
@GetMapping("/list")
public TableDataInfo list(PileStationWhitelist pileStationWhitelist)
{
startPage();
List<PileStationWhitelist> list = pileStationWhitelistService.selectPileStationWhitelistList(pileStationWhitelist);
return getDataTable(list);
}
/**
* 查询站点白名单列表
*/
@PreAuthorize("@ss.hasPermi('pile:whitelist:list')")
@GetMapping("/list")
public TableDataInfo list(PileStationWhitelist pileStationWhitelist) {
startPage();
List<PileStationWhitelist> list = pileStationWhitelistService.selectPileStationWhitelistList(pileStationWhitelist);
return getDataTable(list);
}
/**
* 导出站点白名单列表
*/
@PreAuthorize("@ss.hasPermi('pile:whitelist:export')")
@Log(title = "站点白名单", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, PileStationWhitelist pileStationWhitelist)
{
List<PileStationWhitelist> list = pileStationWhitelistService.selectPileStationWhitelistList(pileStationWhitelist);
ExcelUtil<PileStationWhitelist> util = new ExcelUtil<PileStationWhitelist>(PileStationWhitelist.class);
util.exportExcel(response, list, "站点白名单数据");
}
/**
* 导出站点白名单列表
*/
@PreAuthorize("@ss.hasPermi('pile:whitelist:export')")
@Log(title = "站点白名单", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, PileStationWhitelist pileStationWhitelist) {
List<PileStationWhitelist> list = pileStationWhitelistService.selectPileStationWhitelistList(pileStationWhitelist);
ExcelUtil<PileStationWhitelist> util = new ExcelUtil<PileStationWhitelist>(PileStationWhitelist.class);
util.exportExcel(response, list, "站点白名单数据");
}
/**
* 获取站点白名单详细信息
*/
@PreAuthorize("@ss.hasPermi('pile:whitelist:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(pileStationWhitelistService.selectPileStationWhitelistById(id));
}
/**
* 获取站点白名单详细信息
*/
@PreAuthorize("@ss.hasPermi('pile:whitelist:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return AjaxResult.success(pileStationWhitelistService.selectPileStationWhitelistById(id));
}
/**
* 新增站点白名单
*/
@PreAuthorize("@ss.hasPermi('pile:whitelist:add')")
@Log(title = "站点白名单", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody PileStationWhitelist pileStationWhitelist)
{
return toAjax(pileStationWhitelistService.insertPileStationWhitelist(pileStationWhitelist));
}
/**
* 新增站点白名单
*/
@PreAuthorize("@ss.hasPermi('pile:whitelist:add')")
@Log(title = "站点白名单", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody PileStationWhitelist pileStationWhitelist) {
return toAjax(pileStationWhitelistService.insertPileStationWhitelist(pileStationWhitelist));
}
/**
* 修改站点白名单
*/
@PreAuthorize("@ss.hasPermi('pile:whitelist:edit')")
@Log(title = "站点白名单", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody PileStationWhitelist pileStationWhitelist)
{
return toAjax(pileStationWhitelistService.updatePileStationWhitelist(pileStationWhitelist));
}
/**
* 修改站点白名单
*/
@PreAuthorize("@ss.hasPermi('pile:whitelist:edit')")
@Log(title = "站点白名单", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody PileStationWhitelist pileStationWhitelist) {
return toAjax(pileStationWhitelistService.updatePileStationWhitelist(pileStationWhitelist));
}
/**
* 删除站点白名单
*/
@PreAuthorize("@ss.hasPermi('pile:whitelist:remove')")
@Log(title = "站点白名单", businessType = BusinessType.DELETE)
/**
* 删除站点白名单
*/
@PreAuthorize("@ss.hasPermi('pile:whitelist:remove')")
@Log(title = "站点白名单", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(pileStationWhitelistService.deletePileStationWhitelistByIds(ids));
}
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(pileStationWhitelistService.deletePileStationWhitelistByIds(ids));
}
}

View File

@@ -1,8 +1,11 @@
package com.jsowell.pile.service.impl;
import com.jsowell.common.util.DateUtils;
import com.jsowell.common.util.StringUtils;
import com.jsowell.pile.domain.MemberBasicInfo;
import com.jsowell.pile.domain.PileStationWhitelist;
import com.jsowell.pile.mapper.PileStationWhitelistMapper;
import com.jsowell.pile.service.IMemberBasicInfoService;
import com.jsowell.pile.service.IPileStationWhitelistService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -20,6 +23,9 @@ public class PileStationWhitelistServiceImpl implements IPileStationWhitelistSer
@Autowired
private PileStationWhitelistMapper pileStationWhitelistMapper;
@Autowired
private IMemberBasicInfoService memberBasicInfoService;
/**
* 查询站点白名单
*
@@ -50,7 +56,15 @@ public class PileStationWhitelistServiceImpl implements IPileStationWhitelistSer
*/
@Override
public int insertPileStationWhitelist(PileStationWhitelist pileStationWhitelist) {
pileStationWhitelist.setCreateTime(DateUtils.getNowDate());
// pileStationWhitelist.setCreateTime(DateUtils.getNowDate());
if (StringUtils.isBlank(pileStationWhitelist.getMobileNumber())) {
return 0;
}
MemberBasicInfo info = memberBasicInfoService.selectInfoByMobileNumber(pileStationWhitelist.getMobileNumber());
if (info == null) {
return 0;
}
pileStationWhitelist.setMemberId(info.getMemberId());
return pileStationWhitelistMapper.insertPileStationWhitelist(pileStationWhitelist);
}

View File

@@ -72,7 +72,7 @@
<el-table v-loading="loading" :data="whitelistList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<!--<el-table-column label="主键" align="center" prop="id" />-->
<el-table-column label="站点id" align="center" prop="stationId" />
<!--<el-table-column label="站点id" align="center" prop="stationId" />-->
<el-table-column label="会员id" align="center" prop="memberId" />
<el-table-column label="手机号" align="center" prop="mobileNumber" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
@@ -109,9 +109,9 @@
<!--<el-form-item label="站点id" prop="stationId">
<el-input v-model="form.stationId" placeholder="请输入站点id" />
</el-form-item>-->
<el-form-item label="会员id" prop="memberId">
<!--<el-form-item label="会员id" prop="memberId">
<el-input v-model="form.memberId" placeholder="请输入会员id" />
</el-form-item>
</el-form-item>-->
<el-form-item label="手机号" prop="mobileNumber">
<el-input v-model="form.mobileNumber" placeholder="请输入手机号" />
</el-form-item>
@@ -152,6 +152,7 @@ export default {
title: "",
// 是否显示弹出层
open: false,
stationId: this.$route.params.id,
// 查询参数
queryParams: {
pageNum: 1,
@@ -174,6 +175,7 @@ export default {
/** 查询站点白名单列表 */
getList() {
this.loading = true;
this.queryParams.stationId = this.stationId;
listWhitelist(this.queryParams).then(response => {
this.whitelistList = response.rows;
this.total = response.total;
@@ -243,6 +245,7 @@ export default {
this.getList();
});
} else {
this.form.stationId = this.stationId;
addWhitelist(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;