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