mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-05-11 21:40:19 +08:00
新增 后管修改鉴权卡绑定
This commit is contained in:
@@ -42,10 +42,10 @@ public class PileAuthCardController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('pile:card:list')")
|
@PreAuthorize("@ss.hasPermi('pile:card:list')")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo list(PileAuthCard pileAuthCard) {
|
public TableDataInfo list(PileAuthCardDTO dto) {
|
||||||
startPage();
|
startPage();
|
||||||
// List<PileAuthCard> list = pileAuthCardService.selectPileAuthCardList(pileAuthCard);
|
// List<PileAuthCard> list = pileAuthCardService.selectPileAuthCardList(pileAuthCard);
|
||||||
List<PileAuthCardVO> list = pileAuthCardService.getPileAuthCardInfoList(pileAuthCard);
|
List<PileAuthCardVO> list = pileAuthCardService.getPileAuthCardInfoList(dto);
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -67,7 +67,7 @@ public class PileAuthCardController extends BaseController {
|
|||||||
@PreAuthorize("@ss.hasPermi('pile:card:query')")
|
@PreAuthorize("@ss.hasPermi('pile:card:query')")
|
||||||
@GetMapping(value = "/{id}")
|
@GetMapping(value = "/{id}")
|
||||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||||
return AjaxResult.success(pileAuthCardService.selectPileAuthCardById(id));
|
return AjaxResult.success(pileAuthCardService.getCardInfoById(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -96,8 +96,8 @@ public class PileAuthCardController extends BaseController {
|
|||||||
@PreAuthorize("@ss.hasPermi('pile:card:edit')")
|
@PreAuthorize("@ss.hasPermi('pile:card:edit')")
|
||||||
@Log(title = "充电站鉴权卡", businessType = BusinessType.UPDATE)
|
@Log(title = "充电站鉴权卡", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public AjaxResult edit(@RequestBody PileAuthCard pileAuthCard) {
|
public AjaxResult edit(@RequestBody PileAuthCardDTO dto) {
|
||||||
return toAjax(pileAuthCardService.updatePileAuthCard(pileAuthCard));
|
return toAjax(pileAuthCardService.updateCardInfo(dto));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.jsowell.pile.domain;
|
package com.jsowell.pile.domain;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.jsowell.common.annotation.Excel;
|
import com.jsowell.common.annotation.Excel;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
@@ -55,6 +56,7 @@ public class PileAuthCard {
|
|||||||
*/
|
*/
|
||||||
private String delFlag;
|
private String delFlag;
|
||||||
|
|
||||||
|
@JsonFormat( pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
|
|
||||||
private String createBy;
|
private String createBy;
|
||||||
|
|||||||
@@ -10,7 +10,15 @@ import lombok.Data;
|
|||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class PileAuthCardDTO {
|
public class PileAuthCardDTO {
|
||||||
|
private Long id;
|
||||||
|
|
||||||
private String logicCard;
|
private String logicCard;
|
||||||
|
|
||||||
|
private String physicsCard;
|
||||||
|
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
private String memberId;
|
||||||
|
|
||||||
private String phoneNumber;
|
private String phoneNumber;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package com.jsowell.pile.mapper;
|
|||||||
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;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
@@ -20,8 +21,9 @@ public interface PileAuthCardMapper {
|
|||||||
* @param id 充电站鉴权卡主键
|
* @param id 充电站鉴权卡主键
|
||||||
* @return 充电站鉴权卡
|
* @return 充电站鉴权卡
|
||||||
*/
|
*/
|
||||||
public PileAuthCard selectPileAuthCardById(Long id);
|
// public PileAuthCard selectPileAuthCardById(Long id);
|
||||||
|
|
||||||
|
PileAuthCardVO getCardInfoById(Long id);
|
||||||
/**
|
/**
|
||||||
* 查询充电站鉴权卡信息
|
* 查询充电站鉴权卡信息
|
||||||
* @param pileAuthCard
|
* @param pileAuthCard
|
||||||
@@ -40,10 +42,10 @@ public interface PileAuthCardMapper {
|
|||||||
/**
|
/**
|
||||||
* 查询充电站鉴权卡列表
|
* 查询充电站鉴权卡列表
|
||||||
*
|
*
|
||||||
* @param pileAuthCard 充电站鉴权卡
|
* @param dto 充电站鉴权卡
|
||||||
* @return 充电站鉴权卡集合
|
* @return 充电站鉴权卡集合
|
||||||
*/
|
*/
|
||||||
public List<PileAuthCardVO> getPileAuthCardInfoList(PileAuthCard pileAuthCard);
|
public List<PileAuthCardVO> getPileAuthCardInfoList(PileAuthCardDTO dto);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增充电站鉴权卡
|
* 新增充电站鉴权卡
|
||||||
|
|||||||
@@ -19,7 +19,9 @@ public interface IPileAuthCardService {
|
|||||||
* @param id 充电站鉴权卡主键
|
* @param id 充电站鉴权卡主键
|
||||||
* @return 充电站鉴权卡
|
* @return 充电站鉴权卡
|
||||||
*/
|
*/
|
||||||
public PileAuthCard selectPileAuthCardById(Long id);
|
// public PileAuthCard selectPileAuthCardById(Long id);
|
||||||
|
|
||||||
|
PileAuthCardVO getCardInfoById(Long id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询充电站鉴权卡信息
|
* 查询充电站鉴权卡信息
|
||||||
@@ -39,10 +41,10 @@ public interface IPileAuthCardService {
|
|||||||
/**
|
/**
|
||||||
* 查询充电站鉴权卡列表
|
* 查询充电站鉴权卡列表
|
||||||
*
|
*
|
||||||
* @param pileAuthCard 充电站鉴权卡
|
* @param dto 充电站鉴权卡
|
||||||
* @return 充电站鉴权卡集合
|
* @return 充电站鉴权卡集合
|
||||||
*/
|
*/
|
||||||
public List<PileAuthCardVO> getPileAuthCardInfoList(PileAuthCard pileAuthCard);
|
public List<PileAuthCardVO> getPileAuthCardInfoList(PileAuthCardDTO dto);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增充电站鉴权卡
|
* 新增充电站鉴权卡
|
||||||
@@ -68,6 +70,8 @@ public interface IPileAuthCardService {
|
|||||||
*/
|
*/
|
||||||
public int updatePileAuthCard(PileAuthCard pileAuthCard);
|
public int updatePileAuthCard(PileAuthCard pileAuthCard);
|
||||||
|
|
||||||
|
public int updateCardInfo(PileAuthCardDTO dto);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除充电站鉴权卡
|
* 批量删除充电站鉴权卡
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -35,9 +35,14 @@ public class PileAuthCardServiceImpl implements IPileAuthCardService {
|
|||||||
* @param id 充电站鉴权卡主键
|
* @param id 充电站鉴权卡主键
|
||||||
* @return 充电站鉴权卡
|
* @return 充电站鉴权卡
|
||||||
*/
|
*/
|
||||||
|
// @Override
|
||||||
|
// public PileAuthCard selectPileAuthCardById(Long id) {
|
||||||
|
// return pileAuthCardMapper.selectPileAuthCardById(id);
|
||||||
|
// }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PileAuthCard selectPileAuthCardById(Long id) {
|
public PileAuthCardVO getCardInfoById(Long id) {
|
||||||
return pileAuthCardMapper.selectPileAuthCardById(id);
|
return pileAuthCardMapper.getCardInfoById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -64,12 +69,12 @@ public class PileAuthCardServiceImpl implements IPileAuthCardService {
|
|||||||
/**
|
/**
|
||||||
* 查询充电站鉴权卡列表
|
* 查询充电站鉴权卡列表
|
||||||
*
|
*
|
||||||
* @param pileAuthCard 充电站鉴权卡
|
* @param dto 充电站鉴权卡
|
||||||
* @return 充电站鉴权卡集合
|
* @return 充电站鉴权卡集合
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<PileAuthCardVO> getPileAuthCardInfoList(PileAuthCard pileAuthCard) {
|
public List<PileAuthCardVO> getPileAuthCardInfoList(PileAuthCardDTO dto) {
|
||||||
return pileAuthCardMapper.getPileAuthCardInfoList(pileAuthCard);
|
return pileAuthCardMapper.getPileAuthCardInfoList(dto);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -116,6 +121,22 @@ public class PileAuthCardServiceImpl implements IPileAuthCardService {
|
|||||||
return pileAuthCardMapper.updatePileAuthCard(pileAuthCard);
|
return pileAuthCardMapper.updatePileAuthCard(pileAuthCard);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int updateCardInfo(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()
|
||||||
|
.id(dto.getId())
|
||||||
|
.logicCard(dto.getLogicCard())
|
||||||
|
.memberId(memberBasicInfo.getMemberId())
|
||||||
|
.build();
|
||||||
|
return pileAuthCardMapper.updatePileAuthCard(pileAuthCard);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除充电站鉴权卡
|
* 批量删除充电站鉴权卡
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ package com.jsowell.pile.vo.web;
|
|||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 鉴权卡VO
|
* 鉴权卡VO
|
||||||
*
|
*
|
||||||
@@ -16,7 +18,13 @@ public class PileAuthCardVO {
|
|||||||
|
|
||||||
private String physicsCard;
|
private String physicsCard;
|
||||||
|
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
private String createTime;
|
||||||
|
|
||||||
private String memberId;
|
private String memberId;
|
||||||
|
|
||||||
|
private String phoneNumber;
|
||||||
|
|
||||||
private String nickName;
|
private String nickName;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,11 +35,28 @@
|
|||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectPileAuthCardById" parameterType="Long" resultMap="PileAuthCardResult">
|
<!-- <select id="selectPileAuthCardById" parameterType="Long" resultMap="PileAuthCardResult">-->
|
||||||
<include refid="selectPileAuthCardVo"/>
|
<!-- <include refid="selectPileAuthCardVo"/>-->
|
||||||
where id = #{id}
|
<!-- where id = #{id}-->
|
||||||
|
<!-- </select>-->
|
||||||
|
|
||||||
|
<select id="getCardInfoById" parameterType="Long" resultType="com.jsowell.pile.vo.web.PileAuthCardVO">
|
||||||
|
select
|
||||||
|
t1.id,
|
||||||
|
t1.logic_card as logicCard,
|
||||||
|
t1.physics_card as physicsCard,
|
||||||
|
t1.status,
|
||||||
|
t1.create_time as createTime,
|
||||||
|
t1.member_id as memberId,
|
||||||
|
t2.mobile_number as phoneNumber,
|
||||||
|
t2.nick_name as nickName
|
||||||
|
from pile_auth_card t1
|
||||||
|
join member_basic_info t2 on t1.member_id = t2.member_id
|
||||||
|
where t1.del_flag = '0'
|
||||||
|
and t1.id = #{id}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
<insert id="insertPileAuthCard" parameterType="com.jsowell.pile.domain.PileAuthCard" useGeneratedKeys="true" keyProperty="id">
|
<insert id="insertPileAuthCard" parameterType="com.jsowell.pile.domain.PileAuthCard" useGeneratedKeys="true" keyProperty="id">
|
||||||
insert into pile_auth_card
|
insert into pile_auth_card
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
@@ -73,7 +90,6 @@
|
|||||||
<if test="physicsCard != null">physics_card = #{physicsCard},</if>
|
<if test="physicsCard != null">physics_card = #{physicsCard},</if>
|
||||||
<if test="status != null">status = #{status},</if>
|
<if test="status != null">status = #{status},</if>
|
||||||
<if test="memberId != null">member_id = #{memberId},</if>
|
<if test="memberId != null">member_id = #{memberId},</if>
|
||||||
<if test="createTime != null">create_time = #{createTime},</if>
|
|
||||||
<if test="createBy != null">create_by = #{createBy},</if>
|
<if test="createBy != null">create_by = #{createBy},</if>
|
||||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||||
@@ -122,14 +138,18 @@
|
|||||||
t1.id,
|
t1.id,
|
||||||
t1.logic_card as logicCard,
|
t1.logic_card as logicCard,
|
||||||
t1.physics_card as physicsCard,
|
t1.physics_card as physicsCard,
|
||||||
|
t1.status,
|
||||||
|
t1.create_time as createTime,
|
||||||
t1.member_id as memberId,
|
t1.member_id as memberId,
|
||||||
|
t2.mobile_number as phoneNumber,
|
||||||
t2.nick_name as nickName
|
t2.nick_name as nickName
|
||||||
from pile_auth_card t1
|
from pile_auth_card t1
|
||||||
join member_basic_info t2 on t1.member_id = t2.member_id
|
join member_basic_info t2 on t1.member_id = t2.member_id
|
||||||
where t1.del_flag = '0'
|
where t1.del_flag = '0'
|
||||||
<if test="logicCard != null and logicCard != ''"> and logic_card = #{logicCard}</if>
|
<if test="logicCard != null and logicCard != ''"> and t1.logic_card = #{logicCard}</if>
|
||||||
<if test="physicsCard != null and physicsCard != ''"> and physics_card = #{physicsCard}</if>
|
<if test="physicsCard != null and physicsCard != ''"> and t1.physics_card = #{physicsCard}</if>
|
||||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
<if test="status != null and status != ''"> and t1.status = #{status}</if>
|
||||||
<if test="memberId != null and memberId != ''"> and member_id = #{memberId}</if>
|
<if test="phoneNumber != null and phoneNumber != ''"> and t2.mobile_number = #{phoneNumber}</if>
|
||||||
|
<if test="memberId != null and memberId != ''"> and t1.member_id = #{memberId}</if>
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -9,18 +9,18 @@
|
|||||||
@keyup.enter.native="handleQuery"
|
@keyup.enter.native="handleQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="物理卡号" prop="physicsCard">
|
<!-- <el-form-item label="物理卡号" prop="physicsCard">-->
|
||||||
|
<!-- <el-input-->
|
||||||
|
<!-- v-model="queryParams.physicsCard"-->
|
||||||
|
<!-- placeholder="请输入物理卡号"-->
|
||||||
|
<!-- clearable-->
|
||||||
|
<!-- @keyup.enter.native="handleQuery"-->
|
||||||
|
<!-- />-->
|
||||||
|
<!-- </el-form-item>-->
|
||||||
|
<el-form-item label="手机号码" prop="phoneNumber">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.physicsCard"
|
v-model="queryParams.phoneNumber"
|
||||||
placeholder="请输入物理卡号"
|
placeholder="请输入手机号码"
|
||||||
clearable
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="所属用户的会员id" prop="memberId">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.memberId"
|
|
||||||
placeholder="请输入所属用户的会员id"
|
|
||||||
clearable
|
clearable
|
||||||
@keyup.enter.native="handleQuery"
|
@keyup.enter.native="handleQuery"
|
||||||
/>
|
/>
|
||||||
@@ -81,7 +81,8 @@
|
|||||||
<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="逻辑卡号" align="center" prop="logicCard" />
|
<el-table-column label="逻辑卡号" align="center" prop="logicCard" />
|
||||||
<el-table-column label="物理卡号" align="center" prop="physicsCard" />
|
<el-table-column label="卡状态" align="center" prop="status" />
|
||||||
|
<!-- <el-table-column label="物理卡号" align="center" prop="physicsCard" />-->
|
||||||
<el-table-column label="所属用户" align="center" prop="nickName" >
|
<el-table-column label="所属用户" align="center" prop="nickName" >
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<router-link
|
<router-link
|
||||||
@@ -92,6 +93,8 @@
|
|||||||
</router-link>
|
</router-link>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column label="手机号码" align="center" prop="phoneNumber" />
|
||||||
|
<el-table-column label="创建时间" align="center" prop="createTime" />
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
@@ -179,6 +182,7 @@ export default {
|
|||||||
logicCard: null,
|
logicCard: null,
|
||||||
physicsCard: null,
|
physicsCard: null,
|
||||||
memberId: null,
|
memberId: null,
|
||||||
|
phoneNumber: null
|
||||||
},
|
},
|
||||||
// 表单参数
|
// 表单参数
|
||||||
form: {},
|
form: {},
|
||||||
|
|||||||
Reference in New Issue
Block a user