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

@@ -30,8 +30,7 @@ import java.util.List;
*/ */
@RestController @RestController
@RequestMapping("/pile/whitelist") @RequestMapping("/pile/whitelist")
public class PileStationWhitelistController extends BaseController public class PileStationWhitelistController extends BaseController {
{
@Autowired @Autowired
private IPileStationWhitelistService pileStationWhitelistService; private IPileStationWhitelistService pileStationWhitelistService;
@@ -40,8 +39,7 @@ public class PileStationWhitelistController extends BaseController
*/ */
@PreAuthorize("@ss.hasPermi('pile:whitelist:list')") @PreAuthorize("@ss.hasPermi('pile:whitelist:list')")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(PileStationWhitelist pileStationWhitelist) public TableDataInfo list(PileStationWhitelist pileStationWhitelist) {
{
startPage(); startPage();
List<PileStationWhitelist> list = pileStationWhitelistService.selectPileStationWhitelistList(pileStationWhitelist); List<PileStationWhitelist> list = pileStationWhitelistService.selectPileStationWhitelistList(pileStationWhitelist);
return getDataTable(list); return getDataTable(list);
@@ -53,8 +51,7 @@ public class PileStationWhitelistController extends BaseController
@PreAuthorize("@ss.hasPermi('pile:whitelist:export')") @PreAuthorize("@ss.hasPermi('pile:whitelist:export')")
@Log(title = "站点白名单", businessType = BusinessType.EXPORT) @Log(title = "站点白名单", businessType = BusinessType.EXPORT)
@PostMapping("/export") @PostMapping("/export")
public void export(HttpServletResponse response, PileStationWhitelist pileStationWhitelist) public void export(HttpServletResponse response, PileStationWhitelist pileStationWhitelist) {
{
List<PileStationWhitelist> list = pileStationWhitelistService.selectPileStationWhitelistList(pileStationWhitelist); List<PileStationWhitelist> list = pileStationWhitelistService.selectPileStationWhitelistList(pileStationWhitelist);
ExcelUtil<PileStationWhitelist> util = new ExcelUtil<PileStationWhitelist>(PileStationWhitelist.class); ExcelUtil<PileStationWhitelist> util = new ExcelUtil<PileStationWhitelist>(PileStationWhitelist.class);
util.exportExcel(response, list, "站点白名单数据"); util.exportExcel(response, list, "站点白名单数据");
@@ -65,8 +62,7 @@ public class PileStationWhitelistController extends BaseController
*/ */
@PreAuthorize("@ss.hasPermi('pile:whitelist:query')") @PreAuthorize("@ss.hasPermi('pile:whitelist:query')")
@GetMapping(value = "/{id}") @GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) public AjaxResult getInfo(@PathVariable("id") Long id) {
{
return AjaxResult.success(pileStationWhitelistService.selectPileStationWhitelistById(id)); return AjaxResult.success(pileStationWhitelistService.selectPileStationWhitelistById(id));
} }
@@ -76,8 +72,7 @@ public class PileStationWhitelistController extends BaseController
@PreAuthorize("@ss.hasPermi('pile:whitelist:add')") @PreAuthorize("@ss.hasPermi('pile:whitelist:add')")
@Log(title = "站点白名单", businessType = BusinessType.INSERT) @Log(title = "站点白名单", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
public AjaxResult add(@RequestBody PileStationWhitelist pileStationWhitelist) public AjaxResult add(@RequestBody PileStationWhitelist pileStationWhitelist) {
{
return toAjax(pileStationWhitelistService.insertPileStationWhitelist(pileStationWhitelist)); return toAjax(pileStationWhitelistService.insertPileStationWhitelist(pileStationWhitelist));
} }
@@ -87,8 +82,7 @@ public class PileStationWhitelistController extends BaseController
@PreAuthorize("@ss.hasPermi('pile:whitelist:edit')") @PreAuthorize("@ss.hasPermi('pile:whitelist:edit')")
@Log(title = "站点白名单", businessType = BusinessType.UPDATE) @Log(title = "站点白名单", businessType = BusinessType.UPDATE)
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody PileStationWhitelist pileStationWhitelist) public AjaxResult edit(@RequestBody PileStationWhitelist pileStationWhitelist) {
{
return toAjax(pileStationWhitelistService.updatePileStationWhitelist(pileStationWhitelist)); return toAjax(pileStationWhitelistService.updatePileStationWhitelist(pileStationWhitelist));
} }
@@ -98,8 +92,7 @@ public class PileStationWhitelistController extends BaseController
@PreAuthorize("@ss.hasPermi('pile:whitelist:remove')") @PreAuthorize("@ss.hasPermi('pile:whitelist:remove')")
@Log(title = "站点白名单", businessType = BusinessType.DELETE) @Log(title = "站点白名单", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}") @DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) public AjaxResult remove(@PathVariable Long[] ids) {
{
return toAjax(pileStationWhitelistService.deletePileStationWhitelistByIds(ids)); return toAjax(pileStationWhitelistService.deletePileStationWhitelistByIds(ids));
} }
} }

View File

@@ -1,8 +1,11 @@
package com.jsowell.pile.service.impl; package com.jsowell.pile.service.impl;
import com.jsowell.common.util.DateUtils; 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.domain.PileStationWhitelist;
import com.jsowell.pile.mapper.PileStationWhitelistMapper; import com.jsowell.pile.mapper.PileStationWhitelistMapper;
import com.jsowell.pile.service.IMemberBasicInfoService;
import com.jsowell.pile.service.IPileStationWhitelistService; import com.jsowell.pile.service.IPileStationWhitelistService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@@ -20,6 +23,9 @@ public class PileStationWhitelistServiceImpl implements IPileStationWhitelistSer
@Autowired @Autowired
private PileStationWhitelistMapper pileStationWhitelistMapper; private PileStationWhitelistMapper pileStationWhitelistMapper;
@Autowired
private IMemberBasicInfoService memberBasicInfoService;
/** /**
* 查询站点白名单 * 查询站点白名单
* *
@@ -50,7 +56,15 @@ public class PileStationWhitelistServiceImpl implements IPileStationWhitelistSer
*/ */
@Override @Override
public int insertPileStationWhitelist(PileStationWhitelist pileStationWhitelist) { 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); return pileStationWhitelistMapper.insertPileStationWhitelist(pileStationWhitelist);
} }

View File

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