mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-06-13 11:49:49 +08:00
新增 后管页面新增鉴权卡绑定用户
This commit is contained in:
@@ -3,6 +3,8 @@ package com.jsowell.web.controller.pile;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import com.jsowell.common.exception.BusinessException;
|
||||||
|
import com.jsowell.pile.dto.PileAuthCardDTO;
|
||||||
import com.jsowell.pile.vo.web.PileAuthCardVO;
|
import com.jsowell.pile.vo.web.PileAuthCardVO;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -68,14 +70,24 @@ public class PileAuthCardController extends BaseController {
|
|||||||
return AjaxResult.success(pileAuthCardService.selectPileAuthCardById(id));
|
return AjaxResult.success(pileAuthCardService.selectPileAuthCardById(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增充电站鉴权卡
|
||||||
|
*/
|
||||||
|
// @PreAuthorize("@ss.hasPermi('pile:card:add')")
|
||||||
|
// @Log(title = "充电站鉴权卡", businessType = BusinessType.INSERT)
|
||||||
|
// @PostMapping
|
||||||
|
// public AjaxResult add(@RequestBody PileAuthCard pileAuthCard) {
|
||||||
|
// return toAjax(pileAuthCardService.insertPileAuthCard(pileAuthCard));
|
||||||
|
// }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增充电站鉴权卡
|
* 新增充电站鉴权卡
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('pile:card:add')")
|
@PreAuthorize("@ss.hasPermi('pile:card:add')")
|
||||||
@Log(title = "充电站鉴权卡", businessType = BusinessType.INSERT)
|
@Log(title = "充电站鉴权卡", businessType = BusinessType.INSERT)
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public AjaxResult add(@RequestBody PileAuthCard pileAuthCard) {
|
public AjaxResult add(@RequestBody PileAuthCardDTO dto) {
|
||||||
return toAjax(pileAuthCardService.insertPileAuthCard(pileAuthCard));
|
return toAjax(pileAuthCardService.insertPileAuthCardForWeb(dto));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.jsowell.pile.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 鉴权卡查询dto
|
||||||
|
*
|
||||||
|
* @author JS-ZZA
|
||||||
|
* @date 2023/3/24 9:29
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class PileAuthCardDTO {
|
||||||
|
private String logicCard;
|
||||||
|
|
||||||
|
private String phoneNumber;
|
||||||
|
}
|
||||||
@@ -3,6 +3,7 @@ package com.jsowell.pile.service;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.jsowell.pile.domain.PileAuthCard;
|
import com.jsowell.pile.domain.PileAuthCard;
|
||||||
|
import com.jsowell.pile.dto.PileAuthCardDTO;
|
||||||
import com.jsowell.pile.vo.web.PileAuthCardVO;
|
import com.jsowell.pile.vo.web.PileAuthCardVO;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -51,6 +52,14 @@ public interface IPileAuthCardService {
|
|||||||
*/
|
*/
|
||||||
public int insertPileAuthCard(PileAuthCard pileAuthCard);
|
public int insertPileAuthCard(PileAuthCard pileAuthCard);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增充电站鉴权卡
|
||||||
|
*
|
||||||
|
* @param dto 充电站鉴权卡
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int insertPileAuthCardForWeb(PileAuthCardDTO dto);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改充电站鉴权卡
|
* 修改充电站鉴权卡
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -2,7 +2,12 @@ package com.jsowell.pile.service.impl;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.jsowell.common.enums.ykc.ReturnCodeEnum;
|
||||||
|
import com.jsowell.common.exception.BusinessException;
|
||||||
import com.jsowell.common.util.DateUtils;
|
import com.jsowell.common.util.DateUtils;
|
||||||
|
import com.jsowell.pile.domain.MemberBasicInfo;
|
||||||
|
import com.jsowell.pile.dto.PileAuthCardDTO;
|
||||||
|
import com.jsowell.pile.service.IMemberBasicInfoService;
|
||||||
import com.jsowell.pile.vo.web.PileAuthCardVO;
|
import com.jsowell.pile.vo.web.PileAuthCardVO;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -21,6 +26,9 @@ public class PileAuthCardServiceImpl implements IPileAuthCardService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private PileAuthCardMapper pileAuthCardMapper;
|
private PileAuthCardMapper pileAuthCardMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IMemberBasicInfoService memberBasicInfoService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询充电站鉴权卡
|
* 查询充电站鉴权卡
|
||||||
*
|
*
|
||||||
@@ -75,6 +83,28 @@ public class PileAuthCardServiceImpl implements IPileAuthCardService {
|
|||||||
return pileAuthCardMapper.insertPileAuthCard(pileAuthCard);
|
return pileAuthCardMapper.insertPileAuthCard(pileAuthCard);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增充电站鉴权卡(后管用)
|
||||||
|
*
|
||||||
|
* @param dto 充电站鉴权卡
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertPileAuthCardForWeb(PileAuthCardDTO dto) {
|
||||||
|
// 通过手机号查询memberId
|
||||||
|
MemberBasicInfo memberBasicInfo = memberBasicInfoService.selectInfoByMobileNumber(dto.getPhoneNumber());
|
||||||
|
if (memberBasicInfo == null) {
|
||||||
|
// 为空则说明未查到该用户的注册信息
|
||||||
|
throw new BusinessException(ReturnCodeEnum.CODE_USER_IS_NOT_REGISTER);
|
||||||
|
}
|
||||||
|
PileAuthCard pileAuthCard = PileAuthCard.builder()
|
||||||
|
.logicCard(dto.getLogicCard())
|
||||||
|
.memberId(memberBasicInfo.getMemberId())
|
||||||
|
.status("1")
|
||||||
|
.build();
|
||||||
|
return pileAuthCardMapper.insertPileAuthCard(pileAuthCard);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改充电站鉴权卡
|
* 修改充电站鉴权卡
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -32,16 +32,16 @@
|
|||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<!-- <el-col :span="1.5">-->
|
<el-col :span="1.5">
|
||||||
<!-- <el-button-->
|
<el-button
|
||||||
<!-- type="primary"-->
|
type="primary"
|
||||||
<!-- plain-->
|
plain
|
||||||
<!-- icon="el-icon-plus"-->
|
icon="el-icon-plus"
|
||||||
<!-- size="mini"-->
|
size="mini"
|
||||||
<!-- @click="handleAdd"-->
|
@click="handleAdd"
|
||||||
<!-- v-hasPermi="['pile:card:add']"-->
|
v-hasPermi="['pile:card:add']"
|
||||||
<!-- >新增</el-button>-->
|
>新增</el-button>
|
||||||
<!-- </el-col>-->
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
type="success"
|
type="success"
|
||||||
@@ -126,15 +126,18 @@
|
|||||||
<el-form-item label="逻辑卡号" prop="logicCard">
|
<el-form-item label="逻辑卡号" prop="logicCard">
|
||||||
<el-input v-model="form.logicCard" placeholder="请输入逻辑卡号" />
|
<el-input v-model="form.logicCard" placeholder="请输入逻辑卡号" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="物理卡号" prop="physicsCard">
|
<el-form-item label="手机号码" prop="phoneNumber">
|
||||||
<el-input v-model="form.physicsCard" placeholder="请输入物理卡号" />
|
<el-input v-model="form.phoneNumber" placeholder="请输入会员的手机号码" />
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="会员id" prop="memberId">
|
|
||||||
<el-input v-model="form.memberId" placeholder="请输入所属用户" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="删除标识" prop="delFlag">
|
|
||||||
<el-input v-model="form.delFlag" placeholder="请输入删除标识" />
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<!-- <el-form-item label="物理卡号" prop="physicsCard">-->
|
||||||
|
<!-- <el-input v-model="form.physicsCard" placeholder="请输入物理卡号" />-->
|
||||||
|
<!-- </el-form-item>-->
|
||||||
|
<!-- <el-form-item label="会员id" prop="memberId">-->
|
||||||
|
<!-- <el-input v-model="form.memberId" placeholder="请输入所属用户" />-->
|
||||||
|
<!-- </el-form-item>-->
|
||||||
|
<!-- <el-form-item label="删除标识" prop="delFlag">-->
|
||||||
|
<!-- <el-input v-model="form.delFlag" placeholder="请输入删除标识" />-->
|
||||||
|
<!-- </el-form-item>-->
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
@@ -181,6 +184,13 @@ export default {
|
|||||||
form: {},
|
form: {},
|
||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {
|
rules: {
|
||||||
|
phoneNumber: [
|
||||||
|
{
|
||||||
|
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
|
||||||
|
message: "请输入正确的手机号码",
|
||||||
|
trigger: "blur"
|
||||||
|
}
|
||||||
|
],
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -209,6 +219,7 @@ export default {
|
|||||||
logicCard: null,
|
logicCard: null,
|
||||||
physicsCard: null,
|
physicsCard: null,
|
||||||
memberId: null,
|
memberId: null,
|
||||||
|
phoneNumber: null,
|
||||||
createTime: null,
|
createTime: null,
|
||||||
createBy: null,
|
createBy: null,
|
||||||
updateTime: null,
|
updateTime: null,
|
||||||
|
|||||||
Reference in New Issue
Block a user