This commit is contained in:
Lemon
2023-08-10 09:40:46 +08:00
10 changed files with 800 additions and 87 deletions

View File

@@ -57,8 +57,11 @@ public class PayController extends BaseController {
logger.info("微信支付 param:{}", dto.toString());
RestApiResponse<?> response;
try {
if (dto != null) {
throw new BusinessException("00500005", "充值功能维护,已有余额可用,推荐使用在线支付");
}
if (StringUtils.isBlank(dto.getCode()) || StringUtils.isBlank(dto.getAmount())) {
return new RestApiResponse<>(ReturnCodeEnum.CODE_PARAM_NOT_NULL_ERROR);
throw new BusinessException(ReturnCodeEnum.CODE_PARAM_NOT_NULL_ERROR);
}
// 鉴权
String memberId = getMemberIdByAuthorization(request);
@@ -79,7 +82,11 @@ public class PayController extends BaseController {
dto.setDescription("会员充值余额");
Map<String, Object> weixinMap = orderService.weixinPayV3(dto);
response = new RestApiResponse<>(ImmutableMap.of("weixinMap", weixinMap));
} catch (BusinessException e) {
logger.warn("充值余额支付warn", e);
response = new RestApiResponse<>(e.getCode(), e.getMessage());
} catch (Exception e) {
logger.warn("充值余额支付error", e);
response = new RestApiResponse<>();
}
return response;

View File

@@ -83,7 +83,7 @@ public class AdapayMemberService {
* @throws Exception
*/
@Transactional(readOnly = false, propagation = Propagation.REQUIRED)
public void createMember(SettleAccountDTO dto) throws BaseAdaPayException, BusinessException {
public void createMember(SettleAccountDTO dto) throws BaseAdaPayException, BusinessException {
AdapayMemberAccount adapayMemberAccount = adapayMemberAccountService.selectByMerchantId(dto.getMerchantId());
if (adapayMemberAccount != null) {
log.error("通过merchantId:{}, 没有查询到结算账户配置", dto.getMerchantId());

View File

@@ -0,0 +1,81 @@
package com.jsowell.pile.domain;
import java.math.BigDecimal;
import java.util.Date;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
/**
* 会员汇付支付记录表
*/
@Getter
@Setter
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class MemberAdapayRecord {
private Integer id;
/**
* 会员id
*/
private String memberId;
/**
* 场景类型order, balance
*/
private String scenarioType;
/**
* 汇付支付id
*/
private String paymentId;
/**
* 汇付支付单号
*/
private String paymentOrderNo;
/**
* 支付金额
*/
private BigDecimal payAmt;
/**
* 退款金额
*/
private BigDecimal refundAmt;
/**
* 消费金额
*/
private BigDecimal spendAmt;
/**
* 创建人
*/
private String createBy;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新人
*/
private String updateBy;
/**
* 更新时间
*/
private Date updateTime;
/**
* 删除标识
*/
private String delFlag;
}

View File

@@ -0,0 +1,36 @@
package com.jsowell.pile.mapper;
import com.jsowell.pile.domain.MemberAdapayRecord;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface MemberAdapayRecordMapper {
/**
* insert record to table selective
* @param record the record
* @return insert count
*/
int insertSelective(MemberAdapayRecord record);
/**
* select by primary key
* @param id primary key
* @return object by primary key
*/
MemberAdapayRecord selectByPrimaryKey(Integer id);
/**
* update record selective
* @param record the updated record
* @return update count
*/
int updateByPrimaryKeySelective(MemberAdapayRecord record);
int updateBatch(List<MemberAdapayRecord> list);
int batchInsert(@Param("list") List<MemberAdapayRecord> list);
int insertOrUpdate(MemberAdapayRecord record);
int insertOrUpdateSelective(MemberAdapayRecord record);
}

View File

@@ -0,0 +1,22 @@
package com.jsowell.pile.service;
import java.util.List;
import com.jsowell.pile.domain.MemberAdapayRecord;
public interface MemberAdapayRecordService{
int insertSelective(MemberAdapayRecord record);
MemberAdapayRecord selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(MemberAdapayRecord record);
int updateBatch(List<MemberAdapayRecord> list);
int batchInsert(List<MemberAdapayRecord> list);
int insertOrUpdate(MemberAdapayRecord record);
int insertOrUpdateSelective(MemberAdapayRecord record);
}

View File

@@ -0,0 +1,50 @@
package com.jsowell.pile.service.impl;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import com.jsowell.pile.domain.MemberAdapayRecord;
import com.jsowell.pile.mapper.MemberAdapayRecordMapper;
import com.jsowell.pile.service.MemberAdapayRecordService;
@Service
public class MemberAdapayRecordServiceImpl implements MemberAdapayRecordService{
@Resource
private MemberAdapayRecordMapper memberAdapayRecordMapper;
@Override
public int insertSelective(MemberAdapayRecord record) {
return memberAdapayRecordMapper.insertSelective(record);
}
@Override
public MemberAdapayRecord selectByPrimaryKey(Integer id) {
return memberAdapayRecordMapper.selectByPrimaryKey(id);
}
@Override
public int updateByPrimaryKeySelective(MemberAdapayRecord record) {
return memberAdapayRecordMapper.updateByPrimaryKeySelective(record);
}
@Override
public int updateBatch(List<MemberAdapayRecord> list) {
return memberAdapayRecordMapper.updateBatch(list);
}
@Override
public int batchInsert(List<MemberAdapayRecord> list) {
return memberAdapayRecordMapper.batchInsert(list);
}
@Override
public int insertOrUpdate(MemberAdapayRecord record) {
return memberAdapayRecordMapper.insertOrUpdate(record);
}
@Override
public int insertOrUpdateSelective(MemberAdapayRecord record) {
return memberAdapayRecordMapper.insertOrUpdateSelective(record);
}
}

View File

@@ -815,12 +815,12 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
BigDecimal principalPay = null;
BigDecimal giftPay = null;
OrderPayRecord principalPayRecord = payRecordMap.get("1");
OrderPayRecord principalPayRecord = payRecordMap.get(Constants.ONE);
if (principalPayRecord != null) {
principalPay = principalPayRecord.getPayAmount();
}
OrderPayRecord giftPayRecord = payRecordMap.get("2");
OrderPayRecord giftPayRecord = payRecordMap.get(Constants.TWO);
if (giftPayRecord != null) {
giftPay = giftPayRecord.getPayAmount();
}
@@ -854,7 +854,7 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
// 微信退款逻辑
ApplyRefundDTO weChatRefundDTO = new ApplyRefundDTO();
weChatRefundDTO.setOrderCode(orderCode);
weChatRefundDTO.setRefundType("1");
weChatRefundDTO.setRefundType(Constants.ONE);
weChatRefundDTO.setRefundAmount(residue);
// 查到该笔订单付款金额到哪里了
@@ -869,8 +869,6 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
OrderPayRecord orderPayRecord = payRecordList.get(0);
orderPayRecord.setRefundAmount(residue);
updatePayRecordList.add(orderPayRecord);
} else if (StringUtils.equals(payMode, OrderPayModeEnum.PAYMENT_OF_ALIPAY.getValue())) { // 支付宝支付
// 支付宝退款逻辑
} else {
// 白名单支付
logger.info("订单:{}使用白名单支付,不进行退款处理", orderCode);

View File

@@ -0,0 +1,401 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.jsowell.pile.mapper.MemberAdapayRecordMapper">
<resultMap id="BaseResultMap" type="com.jsowell.pile.domain.MemberAdapayRecord">
<!--@mbg.generated-->
<!--@Table member_adapay_record-->
<id column="id" jdbcType="INTEGER" property="id" />
<result column="member_id" jdbcType="VARCHAR" property="memberId" />
<result column="scenario_type" jdbcType="VARCHAR" property="scenarioType" />
<result column="payment_id" jdbcType="VARCHAR" property="paymentId" />
<result column="payment_order_no" jdbcType="VARCHAR" property="paymentOrderNo" />
<result column="pay_amt" jdbcType="DECIMAL" property="payAmt" />
<result column="refund_amt" jdbcType="DECIMAL" property="refundAmt" />
<result column="spend_amt" jdbcType="DECIMAL" property="spendAmt" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="del_flag" jdbcType="VARCHAR" property="delFlag" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, member_id, scenario_type, payment_id, payment_order_no, pay_amt, refund_amt,
spend_amt, create_by, create_time, update_by, update_time, del_flag
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
<!--@mbg.generated-->
select
<include refid="Base_Column_List" />
from member_adapay_record
where id = #{id,jdbcType=INTEGER}
</select>
<insert id="insertSelective" parameterType="com.jsowell.pile.domain.MemberAdapayRecord">
<!--@mbg.generated-->
insert into member_adapay_record
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="memberId != null">
member_id,
</if>
<if test="scenarioType != null">
scenario_type,
</if>
<if test="paymentId != null">
payment_id,
</if>
<if test="paymentOrderNo != null">
payment_order_no,
</if>
<if test="payAmt != null">
pay_amt,
</if>
<if test="refundAmt != null">
refund_amt,
</if>
<if test="spendAmt != null">
spend_amt,
</if>
<if test="createBy != null">
create_by,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateBy != null">
update_by,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="delFlag != null">
del_flag,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="memberId != null">
#{memberId,jdbcType=VARCHAR},
</if>
<if test="scenarioType != null">
#{scenarioType,jdbcType=VARCHAR},
</if>
<if test="paymentId != null">
#{paymentId,jdbcType=VARCHAR},
</if>
<if test="paymentOrderNo != null">
#{paymentOrderNo,jdbcType=VARCHAR},
</if>
<if test="payAmt != null">
#{payAmt,jdbcType=DECIMAL},
</if>
<if test="refundAmt != null">
#{refundAmt,jdbcType=DECIMAL},
</if>
<if test="spendAmt != null">
#{spendAmt,jdbcType=DECIMAL},
</if>
<if test="createBy != null">
#{createBy,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateBy != null">
#{updateBy,jdbcType=VARCHAR},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="delFlag != null">
#{delFlag,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.jsowell.pile.domain.MemberAdapayRecord">
<!--@mbg.generated-->
update member_adapay_record
<set>
<if test="memberId != null">
member_id = #{memberId,jdbcType=VARCHAR},
</if>
<if test="scenarioType != null">
scenario_type = #{scenarioType,jdbcType=VARCHAR},
</if>
<if test="paymentId != null">
payment_id = #{paymentId,jdbcType=VARCHAR},
</if>
<if test="paymentOrderNo != null">
payment_order_no = #{paymentOrderNo,jdbcType=VARCHAR},
</if>
<if test="payAmt != null">
pay_amt = #{payAmt,jdbcType=DECIMAL},
</if>
<if test="refundAmt != null">
refund_amt = #{refundAmt,jdbcType=DECIMAL},
</if>
<if test="spendAmt != null">
spend_amt = #{spendAmt,jdbcType=DECIMAL},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateBy != null">
update_by = #{updateBy,jdbcType=VARCHAR},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="delFlag != null">
del_flag = #{delFlag,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateBatch" parameterType="java.util.List">
<!--@mbg.generated-->
update member_adapay_record
<trim prefix="set" suffixOverrides=",">
<trim prefix="member_id = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.memberId,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="scenario_type = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.scenarioType,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="payment_id = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.paymentId,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="payment_order_no = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.paymentOrderNo,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="pay_amt = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.payAmt,jdbcType=DECIMAL}
</foreach>
</trim>
<trim prefix="refund_amt = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.refundAmt,jdbcType=DECIMAL}
</foreach>
</trim>
<trim prefix="spend_amt = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.spendAmt,jdbcType=DECIMAL}
</foreach>
</trim>
<trim prefix="create_by = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.createBy,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="create_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP}
</foreach>
</trim>
<trim prefix="update_by = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.updateBy,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="update_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.updateTime,jdbcType=TIMESTAMP}
</foreach>
</trim>
<trim prefix="del_flag = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.delFlag,jdbcType=VARCHAR}
</foreach>
</trim>
</trim>
where id in
<foreach close=")" collection="list" item="item" open="(" separator=", ">
#{item.id,jdbcType=INTEGER}
</foreach>
</update>
<insert id="batchInsert" parameterType="map">
<!--@mbg.generated-->
insert into member_adapay_record
(id, member_id, scenario_type, payment_id, payment_order_no, pay_amt, refund_amt,
spend_amt, create_by, create_time, update_by, update_time, del_flag)
values
<foreach collection="list" item="item" separator=",">
(#{item.id,jdbcType=INTEGER}, #{item.memberId,jdbcType=VARCHAR}, #{item.scenarioType,jdbcType=VARCHAR},
#{item.paymentId,jdbcType=VARCHAR}, #{item.paymentOrderNo,jdbcType=VARCHAR}, #{item.payAmt,jdbcType=DECIMAL},
#{item.refundAmt,jdbcType=DECIMAL}, #{item.spendAmt,jdbcType=DECIMAL}, #{item.createBy,jdbcType=VARCHAR},
#{item.createTime,jdbcType=TIMESTAMP}, #{item.updateBy,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
#{item.delFlag,jdbcType=VARCHAR})
</foreach>
</insert>
<insert id="insertOrUpdate" parameterType="com.jsowell.pile.domain.MemberAdapayRecord">
<!--@mbg.generated-->
insert into member_adapay_record
(id, member_id, scenario_type, payment_id, payment_order_no, pay_amt, refund_amt,
spend_amt, create_by, create_time, update_by, update_time, del_flag)
values
(#{id,jdbcType=INTEGER}, #{memberId,jdbcType=VARCHAR}, #{scenarioType,jdbcType=VARCHAR},
#{paymentId,jdbcType=VARCHAR}, #{paymentOrderNo,jdbcType=VARCHAR}, #{payAmt,jdbcType=DECIMAL},
#{refundAmt,jdbcType=DECIMAL}, #{spendAmt,jdbcType=DECIMAL}, #{createBy,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
#{delFlag,jdbcType=VARCHAR})
on duplicate key update
id = #{id,jdbcType=INTEGER},
member_id = #{memberId,jdbcType=VARCHAR},
scenario_type = #{scenarioType,jdbcType=VARCHAR},
payment_id = #{paymentId,jdbcType=VARCHAR},
payment_order_no = #{paymentOrderNo,jdbcType=VARCHAR},
pay_amt = #{payAmt,jdbcType=DECIMAL},
refund_amt = #{refundAmt,jdbcType=DECIMAL},
spend_amt = #{spendAmt,jdbcType=DECIMAL},
create_by = #{createBy,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_by = #{updateBy,jdbcType=VARCHAR},
update_time = #{updateTime,jdbcType=TIMESTAMP},
del_flag = #{delFlag,jdbcType=VARCHAR}
</insert>
<insert id="insertOrUpdateSelective" parameterType="com.jsowell.pile.domain.MemberAdapayRecord">
<!--@mbg.generated-->
insert into member_adapay_record
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="memberId != null">
member_id,
</if>
<if test="scenarioType != null">
scenario_type,
</if>
<if test="paymentId != null">
payment_id,
</if>
<if test="paymentOrderNo != null">
payment_order_no,
</if>
<if test="payAmt != null">
pay_amt,
</if>
<if test="refundAmt != null">
refund_amt,
</if>
<if test="spendAmt != null">
spend_amt,
</if>
<if test="createBy != null">
create_by,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateBy != null">
update_by,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="delFlag != null">
del_flag,
</if>
</trim>
values
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="memberId != null">
#{memberId,jdbcType=VARCHAR},
</if>
<if test="scenarioType != null">
#{scenarioType,jdbcType=VARCHAR},
</if>
<if test="paymentId != null">
#{paymentId,jdbcType=VARCHAR},
</if>
<if test="paymentOrderNo != null">
#{paymentOrderNo,jdbcType=VARCHAR},
</if>
<if test="payAmt != null">
#{payAmt,jdbcType=DECIMAL},
</if>
<if test="refundAmt != null">
#{refundAmt,jdbcType=DECIMAL},
</if>
<if test="spendAmt != null">
#{spendAmt,jdbcType=DECIMAL},
</if>
<if test="createBy != null">
#{createBy,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateBy != null">
#{updateBy,jdbcType=VARCHAR},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="delFlag != null">
#{delFlag,jdbcType=VARCHAR},
</if>
</trim>
on duplicate key update
<trim suffixOverrides=",">
<if test="id != null">
id = #{id,jdbcType=INTEGER},
</if>
<if test="memberId != null">
member_id = #{memberId,jdbcType=VARCHAR},
</if>
<if test="scenarioType != null">
scenario_type = #{scenarioType,jdbcType=VARCHAR},
</if>
<if test="paymentId != null">
payment_id = #{paymentId,jdbcType=VARCHAR},
</if>
<if test="paymentOrderNo != null">
payment_order_no = #{paymentOrderNo,jdbcType=VARCHAR},
</if>
<if test="payAmt != null">
pay_amt = #{payAmt,jdbcType=DECIMAL},
</if>
<if test="refundAmt != null">
refund_amt = #{refundAmt,jdbcType=DECIMAL},
</if>
<if test="spendAmt != null">
spend_amt = #{spendAmt,jdbcType=DECIMAL},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateBy != null">
update_by = #{updateBy,jdbcType=VARCHAR},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="delFlag != null">
del_flag = #{delFlag,jdbcType=VARCHAR},
</if>
</trim>
</insert>
</mapper>

View File

@@ -1,22 +1,31 @@
<template>
<div class="app-container">
<!-- 标签页 -->
<el-tabs
value="first"
type="border-card"
@tab-click="handleClick"
>
<el-tabs value="first" type="border-card" @tab-click="handleClick">
<el-tab-pane label="基本信息" name="first">
<el-row type="flex" justify="space-between">
<!-- 左侧内容 -->
<el-col :span="5">
<!-- 充电设备 -->
<div class="advContent">
<el-card class="box-card" shadow="hover" v-loading="pileDetailLoading">
<el-card
class="box-card"
shadow="hover"
v-loading="pileDetailLoading"
>
<div slot="header" class="clearfix">
<span>充电设备(<span style="color: #bf1c1c">{{ status }}</span>)</span>
<el-button icon="el-icon-refresh-right" style="float: right; padding: 3px 0"
type="text" @click="getPileDetail">刷新
<span
>充电设备(<span
style="color: #bf1c1c"
>{{ status }}</span
>)</span
>
<el-button
icon="el-icon-refresh-right"
style="float: right; padding: 3px 0"
type="text"
@click="getPileDetail"
>刷新
</el-button>
</div>
<!--二维码-->
@@ -37,29 +46,44 @@
label="SN"
labelStyle="width: 80px"
contentStyle="width: 150px"
>{{ pileDetail.pileSn }}
>{{ pileDetail.pileSn }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
别名
<el-button type="text" icon="el-icon-edit" size="medium" circle
@click="openEdit" v-hasPermi="['pile:basic:edit']"/>
<el-button
type="text"
icon="el-icon-edit"
size="medium"
circle
@click="openEdit"
v-hasPermi="[
'pile:basic:edit',
]"
/>
</template>
<el-input v-model="pileDetail.name" size="medium" clearable
:disabled="clearableFlag">
<el-input
v-model="pileDetail.name"
size="medium"
clearable
:disabled="clearableFlag"
>
<template slot="append">
<el-button type="text" icon="el-icon-check" size="medium"
circle @click="updateName"/>
<el-button
type="text"
size="medium"
circle
@click="updateName"
>保存</el-button
>
</template>
</el-input>
</el-descriptions-item>
<el-descriptions-item label="运营商">{{
pileDetail.merchantName
}}
<el-descriptions-item label="运营商"
>{{ pileDetail.merchantName }}
</el-descriptions-item>
<el-descriptions-item label="站点">{{
pileDetail.stationName
}}
<el-descriptions-item label="站点"
>{{ pileDetail.stationName }}
</el-descriptions-item>
<!--<el-descriptions-item label="厂商">
<el-tag size="small">举视</el-tag>
@@ -67,33 +91,37 @@
<!-- <el-descriptions-item label="使用车辆类型">{{
pileDetail.matchCars
}}</el-descriptions-item>-->
<el-descriptions-item label="设备型号">{{ pileDetail.modelName }}
<el-descriptions-item label="设备型号"
>{{ pileDetail.modelName }}
</el-descriptions-item>
<el-descriptions-item label="额定功率(kW)">{{
pileDetail.ratedPower
}}
<el-descriptions-item
label="额定功率(kW)"
>{{ pileDetail.ratedPower }}
</el-descriptions-item>
<!--<el-descriptions-item label="额定电压(V)">{{pileDetail.sn}}</el-descriptions-item>-->
<el-descriptions-item label="额定电流(A)">{{
pileDetail.ratedCurrent
}}
<el-descriptions-item
label="额定电流(A)"
>{{ pileDetail.ratedCurrent }}
</el-descriptions-item>
<el-descriptions-item label="iccid">{{
pileDetail.iccid
}}
<el-descriptions-item label="iccid"
>{{ pileDetail.iccid }}
</el-descriptions-item>
<el-descriptions-item label="sim卡商">
<dict-tag
:options="dict.type.sim_supplier"
:options="
dict.type.sim_supplier
"
:value="pileDetail.simSupplier"
/>
</el-descriptions-item>
<el-descriptions-item label="卡运营商">
<dict-tag
:options="dict.type.sim_operator"
:options="
dict.type.sim_operator
"
:value="pileDetail.operator"
/>
</el-descriptions-item>
@@ -116,8 +144,12 @@
<el-card class="box-card" shadow="hover">
<div style="margin: 12px 0">
<span>接口列表</span>
<el-button icon="el-icon-refresh-right" style="float: right; padding: 3px 0" type="text"
@click="refreshPileConnectorList">刷新
<el-button
icon="el-icon-refresh-right"
style="float: right; padding: 3px 0"
type="text"
@click="refreshPileConnectorList"
>刷新
</el-button>
</div>
<!--<div style="margin-top: 20px">
@@ -150,10 +182,15 @@
align="center"
>
<template slot-scope="scope">
<el-link @click="qrcodeClick(scope.row)">
<el-link
@click="qrcodeClick(scope.row)"
>
<vue-qr
ref="Qrcode"
:text="scope.row.connectorQrCodeUrl"
:text="
scope.row
.connectorQrCodeUrl
"
qid="scope.row.connectorId"
:width="qrWidth"
/>
@@ -168,7 +205,9 @@
>
<template slot-scope="scope">
<dict-tag
:options="dict.type.connector_status"
:options="
dict.type.connector_status
"
:value="scope.row.status"
/>
</template>
@@ -181,7 +220,9 @@
>
<template slot-scope="scope">
<dict-tag
:options="dict.type.connector_type"
:options="
dict.type.connector_type
"
:value="scope.row.type"
/>
</template>
@@ -192,7 +233,11 @@
prop="instantPower"
label="即时功率kW"
/>
<el-table-column prop="soc" label="SOC(°C)" align="center"/>
<el-table-column
prop="soc"
label="SOC(°C)"
align="center"
/>
<el-table-column
prop="equipmentOrderNum"
label="设备订单号"
@@ -210,14 +255,36 @@
<!-- <span>{{scope.row.businessType === '1' ? '运营桩':'个人桩'}}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="地锁操作" align="center" v-hasRole="['admin', 'common']"
class-name="small-padding fixed-width">
<el-table-column
label="地锁操作"
align="center"
v-hasRole="['admin', 'common']"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-caret-bottom"
@click="remoteControlGroundLock(scope.row, '0')">降锁
<el-button
size="mini"
type="text"
icon="el-icon-caret-bottom"
@click="
remoteControlGroundLock(
scope.row,
'0'
)
"
>降锁
</el-button>
<el-button size="mini" type="text" icon="el-icon-caret-top"
@click="remoteControlGroundLock(scope.row, '1')">升锁
<el-button
size="mini"
type="text"
icon="el-icon-caret-top"
@click="
remoteControlGroundLock(
scope.row,
'1'
)
"
>升锁
</el-button>
</template>
</el-table-column>
@@ -227,14 +294,37 @@
<el-card style="margin-top: 20px" shadow="hover">
<div style="margin: 12px 0">
<span>充电桩通信日志</span>
<el-button icon="el-icon-refresh-right" style="float: right; padding: 3px 0" type="text"
@click="getFeedList">刷新
<el-button
icon="el-icon-refresh-right"
style="float: right; padding: 3px 0"
type="text"
@click="getFeedList"
>刷新
</el-button>
</div>
<el-table :data="feedList" stripe style="width: 100%" v-loading="feedListLoading">
<el-table-column prop="createTime" label="触发时间" align="center" width="200"/>
<el-table-column prop="description" label="描述" align="center" width="200"/>
<el-table-column prop="originalMsg" label="原始报文" align="center"/>
<el-table
:data="feedList"
stripe
style="width: 100%"
v-loading="feedListLoading"
>
<el-table-column
prop="createTime"
label="触发时间"
align="center"
width="200"
/>
<el-table-column
prop="description"
label="描述"
align="center"
width="200"
/>
<el-table-column
prop="originalMsg"
label="原始报文"
align="center"
/>
</el-table>
<!--分页-->
<pagination
@@ -257,22 +347,29 @@
</template>
<script>
import remoteUpgrade from './components/remoteUpgrade.vue';
import remoteUpgrade from "./components/remoteUpgrade.vue";
import {
getPileDetailById,
getPileFeedList,
listBasic, updateBasic, updatePileName,
listBasic,
updateBasic,
updatePileName,
} from "@/api/pile/basic";
import {queryConnectorListByParams} from "@/api/pile/connector";
import { queryConnectorListByParams } from "@/api/pile/connector";
// 二维码组件
import VueQr from "vue-qr";
import {remoteControlGroundLock} from "@/api/pile/pileRemote";
import { remoteControlGroundLock } from "@/api/pile/pileRemote";
import Template from "@/views/billing/template";
export default {
components: {Template, VueQr, remoteUpgrade},
components: { Template, VueQr, remoteUpgrade },
name: "pile-detail",
dicts: ["connector_status", "connector_type", "sim_supplier", "sim_operator"],
dicts: [
"connector_status",
"connector_type",
"sim_supplier",
"sim_operator",
],
data() {
return {
clearableFlag: true,
@@ -285,7 +382,7 @@ export default {
connectorList: [],
stationId: 1,
// 充电桩详情 竖向 表格渲染的数据
pileDetail: {url: ""},
pileDetail: { url: "" },
feedListLoading: false,
qrWidth: 60,
flag: true,
@@ -326,8 +423,7 @@ export default {
this.queryPileConnectorList();
},
mounted() {
setTimeout(() => {
}, 300);
setTimeout(() => {}, 300);
},
methods: {
// 遥控地锁
@@ -337,9 +433,9 @@ export default {
const pileConnectorCode = row.pileConnectorCode;
const connectorCode = pileConnectorCode.replace(pileSn, "");
var data = {
"pileSn": pileSn,
"connectorCode": connectorCode,
"operate": operate
pileSn: pileSn,
connectorCode: connectorCode,
operate: operate,
};
remoteControlGroundLock(data).then((response) => {
console.log("后管遥控地锁结果:", response);
@@ -388,22 +484,22 @@ export default {
id: this.pileDetail.pileId,
name: this.pileDetail.name,
sn: this.pileDetail.pileSn,
stationId: this.pileDetail.stationId
}
console.log("params", params)
stationId: this.pileDetail.stationId,
};
console.log("params", params);
updatePileName(params).then((response) => {
console.log("response", response)
console.log("response", response);
this.resCode = response.resCode;
this.msg = response.msg
if (this.resCode !== '00100000') {
this.msg = response.msg;
if (this.resCode !== "00100000") {
this.$message({
type: 'error',
type: "error",
message: this.msg,
});
}
this.clearableFlag = true;
this.getPileDetail();
})
});
},
// 查询充电桩详情接口
getPileDetail() {
@@ -421,7 +517,7 @@ export default {
},
handleClick(tab) {
// console.log(tab.name, event);
if (tab.name === 'second') {
if (tab.name === "second") {
this.$refs.second.getList();
}
// this.initializeData(tab.name);
@@ -470,4 +566,17 @@ export default {
height: 80px;
width: 80px;
}
::v-deep .el-input-group--append .el-input__inner {
// background-color: #fff;
// border-color: #fff;
color: #606266;
border-top-right-radius: 5px;
border-bottom-right-radius: 5px;
}
::v-deep .el-input-group__append,
.el-input-group__prepend {
background-color: #fff;
border-color: #fff;
color: #606266;
}
</style>

View File

@@ -115,11 +115,6 @@
></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item prop="parkingNumber" label="停车场库编号">
<el-input v-model="station.parkingNumber" required="true"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
@@ -213,6 +208,14 @@
<el-input v-model="station.businessHours"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item prop="parkingNumber" label="停车场库编号">
<el-input
v-model="station.parkingNumber"
required="true"
></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-button
@@ -456,7 +459,7 @@ export default {
},
// 渲染表格数据
async queryStationInfo() {
this.fileList=[];
this.fileList = [];
const res = await getStationInfo(this.stationId);
console.log(res);
this.station = res.data;
@@ -532,3 +535,9 @@ export default {
},
};
</script>
<style lang="scss" scoped>
::v-deep .el-select > .el-input,
::v-deep .el-cascader .el-input {
width: 283px;
}
</style>