mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-05-18 00:38:33 +08:00
update 鉴权卡启动充电
This commit is contained in:
@@ -278,10 +278,7 @@ public class MemberService {
|
|||||||
.build();
|
.build();
|
||||||
checkVerificationCode(registerAndLoginDTO);
|
checkVerificationCode(registerAndLoginDTO);
|
||||||
// 判断当前鉴权卡是否被绑定过
|
// 判断当前鉴权卡是否被绑定过
|
||||||
PileAuthCard authCard = PileAuthCard.builder()
|
PileAuthCard pileAuthCardInfo = pileAuthCardService.selectCardInfoByLogicCard(dto.getLogicCard());
|
||||||
.logicCard(dto.getLogicCard())
|
|
||||||
.build();
|
|
||||||
PileAuthCard pileAuthCardInfo = pileAuthCardService.selectPileAuthCardInfo(authCard);
|
|
||||||
if (pileAuthCardInfo == null){
|
if (pileAuthCardInfo == null){
|
||||||
// 为空说明没查到此卡信息
|
// 为空说明没查到此卡信息
|
||||||
throw new BusinessException(ReturnCodeEnum.CODE_THIS_CARD_HAS_NO_INFO);
|
throw new BusinessException(ReturnCodeEnum.CODE_THIS_CARD_HAS_NO_INFO);
|
||||||
@@ -294,10 +291,12 @@ public class MemberService {
|
|||||||
// 密钥不一致,不能绑定
|
// 密钥不一致,不能绑定
|
||||||
throw new BusinessException(ReturnCodeEnum.CODE_SECRET_KEY_NOT_SAME);
|
throw new BusinessException(ReturnCodeEnum.CODE_SECRET_KEY_NOT_SAME);
|
||||||
}
|
}
|
||||||
authCard.setMemberId(dto.getMemberId());
|
PileAuthCard authCard = PileAuthCard.builder()
|
||||||
authCard.setStatus("1"); // 1-正常使用
|
.memberId(dto.getMemberId())
|
||||||
authCard.setCreateBy(dto.getMemberId());
|
.status("1") // 1-正常使用
|
||||||
authCard.setId(pileAuthCardInfo.getId());
|
.createBy(dto.getMemberId())
|
||||||
|
.id(pileAuthCardInfo.getId())
|
||||||
|
.build();
|
||||||
return pileAuthCardService.updatePileAuthCard(authCard);
|
return pileAuthCardService.updatePileAuthCard(authCard);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -128,10 +128,7 @@ public class ConfirmStartChargingRequestHandler extends AbstractHandler{
|
|||||||
if (StringUtils.equals("01", startMode)) {
|
if (StringUtils.equals("01", startMode)) {
|
||||||
// 刷卡启动充电
|
// 刷卡启动充电
|
||||||
// 根据传过来的物理卡号查询数据库中此卡信息
|
// 根据传过来的物理卡号查询数据库中此卡信息
|
||||||
PileAuthCard pileAuthCard = PileAuthCard.builder()
|
PileAuthCard pileAuthCardInfo = pileAuthCardService.selectCardInfoByLogicCard(physicsCard);
|
||||||
.logicCard(physicsCard)
|
|
||||||
.build();
|
|
||||||
PileAuthCard pileAuthCardInfo = pileAuthCardService.selectPileAuthCardInfo(pileAuthCard);
|
|
||||||
if (pileAuthCardInfo == null) {
|
if (pileAuthCardInfo == null) {
|
||||||
// 未查到此卡信息
|
// 未查到此卡信息
|
||||||
throw new BusinessException(ReturnCodeEnum.CODE_THIS_CARD_HAS_NO_INFO);
|
throw new BusinessException(ReturnCodeEnum.CODE_THIS_CARD_HAS_NO_INFO);
|
||||||
@@ -202,8 +199,11 @@ public class ConfirmStartChargingRequestHandler extends AbstractHandler{
|
|||||||
pileTransactionService.doCreateOrder(createOrderTransactionDTO);
|
pileTransactionService.doCreateOrder(createOrderTransactionDTO);
|
||||||
|
|
||||||
// 将卡状态改为启动锁定
|
// 将卡状态改为启动锁定
|
||||||
pileAuthCard.setId(pileAuthCardInfo.getId());
|
PileAuthCard pileAuthCard = PileAuthCard.builder()
|
||||||
pileAuthCard.setStatus("2");
|
.id(pileAuthCardInfo.getId())
|
||||||
|
.logicCard(physicsCard)
|
||||||
|
.status("2")
|
||||||
|
.build();
|
||||||
pileAuthCardService.updatePileAuthCard(pileAuthCard);
|
pileAuthCardService.updatePileAuthCard(pileAuthCard);
|
||||||
}
|
}
|
||||||
} catch (BusinessException e){
|
} catch (BusinessException e){
|
||||||
|
|||||||
@@ -546,15 +546,15 @@ public class TransactionRecordsRequestHandler extends AbstractHandler {
|
|||||||
}
|
}
|
||||||
if (!StringUtils.equals("0000000000000000", data.getLogicCard())) {
|
if (!StringUtils.equals("0000000000000000", data.getLogicCard())) {
|
||||||
// 根据物理卡号查出所属用户
|
// 根据物理卡号查出所属用户
|
||||||
PileAuthCard pileAuthCard = PileAuthCard.builder()
|
PileAuthCard cardInfo = pileAuthCardService.selectCardInfoByLogicCard(data.getLogicCard());
|
||||||
.logicCard(data.getLogicCard())
|
|
||||||
.build();
|
|
||||||
PileAuthCard cardInfo = pileAuthCardService.selectPileAuthCardInfo(pileAuthCard);
|
|
||||||
if (cardInfo != null) {
|
if (cardInfo != null) {
|
||||||
orderBasicInfo.setMemberId(cardInfo.getMemberId());
|
orderBasicInfo.setMemberId(cardInfo.getMemberId());
|
||||||
// 将此卡状态改为正常
|
// 将此卡状态改为正常
|
||||||
pileAuthCard.setId(cardInfo.getId());
|
PileAuthCard pileAuthCard = PileAuthCard.builder()
|
||||||
pileAuthCard.setStatus("1");
|
.logicCard(data.getLogicCard())
|
||||||
|
.id(cardInfo.getId())
|
||||||
|
.status("1")
|
||||||
|
.build();
|
||||||
pileAuthCardService.updatePileAuthCard(pileAuthCard);
|
pileAuthCardService.updatePileAuthCard(pileAuthCard);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ 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.dto.PileAuthCardDTO;
|
||||||
import com.jsowell.pile.vo.web.PileAuthCardVO;
|
import com.jsowell.pile.vo.web.PileAuthCardVO;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -87,4 +88,12 @@ public interface PileAuthCardMapper {
|
|||||||
public int deletePileAuthCardByIds(Long[] ids);
|
public int deletePileAuthCardByIds(Long[] ids);
|
||||||
|
|
||||||
int unBindingCard(PileAuthCard pileAuthCard);
|
int unBindingCard(PileAuthCard pileAuthCard);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据逻辑卡号查询某状态的鉴权卡信息
|
||||||
|
* @param status
|
||||||
|
* @param logicCard
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
PileAuthCard selectSomeStatusCardInfo(@Param("status") String status, @Param("logicCard") String logicCard);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -96,4 +96,19 @@ public interface IPileAuthCardService {
|
|||||||
int deactivateCard(Long id);
|
int deactivateCard(Long id);
|
||||||
|
|
||||||
int unBindingCard(PileAuthCard pileAuthCard);
|
int unBindingCard(PileAuthCard pileAuthCard);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据逻辑卡号查询某状态的鉴权卡信息
|
||||||
|
* @param status
|
||||||
|
* @param logicCard
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
PileAuthCard selectSomeStatusCardInfo(String status, String logicCard);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过逻辑卡号查询卡信息
|
||||||
|
* @param logicCard
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
PileAuthCard selectCardInfoByLogicCard(String logicCard);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -180,4 +180,25 @@ public class PileAuthCardServiceImpl implements IPileAuthCardService {
|
|||||||
public int unBindingCard(PileAuthCard pileAuthCard) {
|
public int unBindingCard(PileAuthCard pileAuthCard) {
|
||||||
return pileAuthCardMapper.unBindingCard(pileAuthCard);
|
return pileAuthCardMapper.unBindingCard(pileAuthCard);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据逻辑卡号查询某状态的鉴权卡信息
|
||||||
|
* @param status
|
||||||
|
* @param logicCard
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public PileAuthCard selectSomeStatusCardInfo(String status, String logicCard) {
|
||||||
|
return pileAuthCardMapper.selectSomeStatusCardInfo(status, logicCard);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过逻辑卡号查询卡信息
|
||||||
|
* @param logicCard
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public PileAuthCard selectCardInfoByLogicCard(String logicCard) {
|
||||||
|
return selectSomeStatusCardInfo(null, logicCard);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -144,6 +144,21 @@
|
|||||||
and logic_card = #{logicCard,jdbcType=VARCHAR}
|
and logic_card = #{logicCard,jdbcType=VARCHAR}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<select id="selectSomeStatusCardInfo" resultType="com.jsowell.pile.domain.PileAuthCard">
|
||||||
|
select
|
||||||
|
<include refid="Base_Column_List"/>
|
||||||
|
from
|
||||||
|
pile_auth_card
|
||||||
|
where 1 = 1
|
||||||
|
<if test="status != null and status != ''">
|
||||||
|
and status = #{status,jdbcType=VARCHAR}
|
||||||
|
</if>
|
||||||
|
<if test="logicCard != null and logicCard != ''">
|
||||||
|
and logic_card = #{logicCard,jdbcType=VARCHAR}
|
||||||
|
</if>
|
||||||
|
limit 1
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="getPileAuthCardInfoList" resultType="com.jsowell.pile.vo.web.PileAuthCardVO">
|
<select id="getPileAuthCardInfoList" resultType="com.jsowell.pile.vo.web.PileAuthCardVO">
|
||||||
select
|
select
|
||||||
t1.id,
|
t1.id,
|
||||||
|
|||||||
Reference in New Issue
Block a user