Merge branch 'dev-new-rabbitmq' of http://192.168.2.2:8099/jsowell/jsowell-charger-web into dev-new-rabbitmq

This commit is contained in:
Guoqs
2025-01-07 15:13:44 +08:00
8 changed files with 84 additions and 18 deletions

View File

@@ -7,6 +7,7 @@ import com.jsowell.common.annotation.Log;
import com.jsowell.common.constant.Constants;
import com.jsowell.common.core.controller.BaseController;
import com.jsowell.common.core.domain.AjaxResult;
import com.jsowell.common.core.domain.vo.AuthorizedDeptVO;
import com.jsowell.common.core.page.TableDataInfo;
import com.jsowell.common.enums.BusinessType;
import com.jsowell.common.enums.uniapp.BalanceChangesEnum;
@@ -14,12 +15,11 @@ import com.jsowell.common.enums.ykc.ReturnCodeEnum;
import com.jsowell.common.exception.BusinessException;
import com.jsowell.common.response.RestApiResponse;
import com.jsowell.common.util.StringUtils;
import com.jsowell.common.util.poi.ExcelUtil;
import com.jsowell.pile.domain.MemberBasicInfo;
import com.jsowell.pile.domain.MemberPlateNumberRelation;
import com.jsowell.pile.dto.CreateMerchantVipDTO;
import com.jsowell.pile.dto.PlatformTesterDTO;
import com.jsowell.pile.dto.QueryMemberInfoDTO;
import com.jsowell.pile.dto.UniAppQueryMemberBalanceDTO;
import com.jsowell.pile.domain.PileMerchantInfo;
import com.jsowell.pile.dto.*;
import com.jsowell.pile.service.MemberBasicInfoService;
import com.jsowell.pile.service.MemberPlateNumberRelationService;
import com.jsowell.pile.service.MemberTransactionRecordService;
@@ -29,6 +29,7 @@ import com.jsowell.pile.vo.uniapp.customer.MemberVO;
import com.jsowell.pile.vo.uniapp.customer.MemberWalletLogVO;
import com.jsowell.pile.vo.uniapp.customer.MerchantVipVO;
import com.jsowell.pile.vo.web.MemberTransactionVO;
import com.jsowell.pile.vo.web.OrderListVO;
import com.jsowell.pile.vo.web.PlatformTesterVO;
import com.jsowell.pile.vo.web.UpdateMemberBalanceDTO;
import org.apache.commons.collections4.CollectionUtils;
@@ -36,6 +37,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;
@@ -262,6 +264,24 @@ public class MemberBasicInfoController extends BaseController {
return toAjax(i);
}
/**
* 导出会员钱包列表
*/
@PreAuthorize("@ss.hasPermi('member:info:export')")
@Log(title = "钱包数据", businessType = BusinessType.EXPORT)
@PostMapping("/exportWalletList")
public void exportWalletList(HttpServletResponse response, UniAppQueryMemberBalanceDTO dto) {
// 权限过滤
AuthorizedDeptVO authorizedMap = UserUtils.getAuthorizedMap();
if (authorizedMap == null) {
// 为空表示没有权限,返回空数组
return;
}
List<MemberWalletLogVO> list = memberBasicInfoService.getMemberWalletDetail(dto);
ExcelUtil<MemberWalletLogVO> util = new ExcelUtil<MemberWalletLogVO>(MemberWalletLogVO.class);
util.exportExcel(response, list, "会员钱包数据");
}
/**
* 修改平台测试员状态
* http://localhost:8080/member/info/updatePlatformTester

View File

@@ -195,6 +195,11 @@ public class CacheConstants {
*/
public static final String THIRD_PARTY_TOKEN_BY_OPERATOR_SECRET = "third_party_token_by_operator_secret:";
/**
* 推送设备充电状态信息数据缓存
*/
public static final String NOTIFICATION_EQUIP_CHARGE_STATUS_BY_ORDER_CODE = "notification_equip_charge_status_by_order_code:";
/**
* 充电桩状态前缀
*/

View File

@@ -37,6 +37,8 @@ public class UniAppQueryMemberBalanceDTO extends BaseMemberDTO{
*/
private String walletCode;
private String memberId;
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.JSON_STYLE)

View File

@@ -1,5 +1,6 @@
package com.jsowell.pile.vo.uniapp.customer;
import com.jsowell.common.annotation.Excel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
@@ -18,6 +19,7 @@ public class MemberWalletLogVO {
/**
* 会员id
*/
@Excel(name = "会员id")
private String memberId;
/**
@@ -28,6 +30,7 @@ public class MemberWalletLogVO {
/**
* 子类型 10-充值, 11-赠送, 12-订单结算退款20-后管扣款, 21-订单付款, 22-用户退款
*/
@Excel(name = "操作类型(10-充值, 11-赠送, 12-订单结算退款20-后管扣款, 21-订单付款, 22-用户退款)")
private String subType;
/**
@@ -38,6 +41,7 @@ public class MemberWalletLogVO {
/**
* 交易时间
*/
@Excel(name = "交易时间")
private String transactionTime;
/**
@@ -53,16 +57,19 @@ public class MemberWalletLogVO {
/**
* 支付金额
*/
@Excel(name = "支付金额")
private BigDecimal payAmount;
/**
* 订单金额
*/
@Excel(name = "订单金额")
private BigDecimal orderAmount;
/**
* 退款金额
*/
@Excel(name = "退款金额")
private BigDecimal refundAmount;
/**

View File

@@ -490,11 +490,23 @@
t1.create_time as transactionTime
from member_wallet_log t1
left join order_basic_info t2 on t1.related_order_code = t2.order_code
where t1.member_id = #{dto.memberId,jdbcType=VARCHAR}
and t1.wallet_code = #{dto.walletCode,jdbcType=VARCHAR}
and t1.create_time <![CDATA[ >= ]]> #{dto.tradeDate,jdbcType=VARCHAR}
and t1.create_time <![CDATA[ < ]]> #{dto.endDate,jdbcType=VARCHAR}
and t1.sub_type != '12'
where t1.sub_type != '12'
<if test="dto.memberId != null and dto.memberId != ''">
and t1.member_id = #{dto.memberId,jdbcType=VARCHAR}
</if>
<if test="dto.walletCode != null and dto.walletCode != ''">
and t1.wallet_code = #{dto.walletCode,jdbcType=VARCHAR}
</if>
<if test="dto.tradeDate != null and dto.tradeDate != ''">
and t1.create_time <![CDATA[ >= ]]> #{dto.tradeDate,jdbcType=VARCHAR}
</if>
<if test="dto.endDate != null and dto.endDate != ''">
and t1.create_time <![CDATA[ < ]]> #{dto.endDate,jdbcType=VARCHAR}
</if>
<!-- where t1.member_id = #{dto.memberId,jdbcType=VARCHAR}-->
<!-- and t1.wallet_code = #{dto.walletCode,jdbcType=VARCHAR}-->
<!-- and t1.create_time <![CDATA[ >= ]]> #{dto.tradeDate,jdbcType=VARCHAR}-->
<!-- and t1.create_time <![CDATA[ < ]]> #{dto.endDate,jdbcType=VARCHAR}-->
order by t1.create_time desc
</select>

View File

@@ -4,6 +4,7 @@ import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject;
import com.github.pagehelper.PageInfo;
import com.google.common.collect.Lists;
import com.jsowell.common.constant.CacheConstants;
import com.jsowell.common.constant.Constants;
import com.jsowell.common.core.domain.ykc.RealTimeMonitorData;
import com.jsowell.common.core.redis.RedisCache;
@@ -604,8 +605,12 @@ public class GuangXiPlatformServiceImpl implements ThirdPartyPlatformService {
*/
@Override
public String notificationEquipChargeStatus(String orderCode) {
// 根据订单号查询订单信息
OrderBasicInfo orderInfo = orderBasicInfoService.getOrderInfoByOrderCode(orderCode);
// 先查缓存中是否有数据
String redisKey = CacheConstants.NOTIFICATION_EQUIP_CHARGE_STATUS_BY_ORDER_CODE + orderCode;
Object cacheObject = redisCache.getCacheObject(redisKey);
if (cacheObject != null) {
return "距上次推送未超过5分钟本次不予推送";
}
// 查询相关配置信息
ThirdPartySecretInfoVO thirdPartySecretInfoVO = getGuangXiSecretInfo();
@@ -616,6 +621,8 @@ public class GuangXiPlatformServiceImpl implements ThirdPartyPlatformService {
String dataSecretIv = thirdPartySecretInfoVO.getTheirDataSecretIv();
String urlAddress = thirdPartySecretInfoVO.getTheirUrlPrefix();
// 根据订单号查询订单信息
OrderBasicInfo orderInfo = orderBasicInfoService.getOrderInfoByOrderCode(orderCode);
// 查询枪口实时状态
List<RealTimeMonitorData> chargingRealTimeData = orderBasicInfoService.getChargingRealTimeData(orderInfo.getTransactionCode());
RealTimeMonitorData realTimeMonitorData;
@@ -653,20 +660,14 @@ public class GuangXiPlatformServiceImpl implements ThirdPartyPlatformService {
SupEquipChargeStatusInfo supEquipChargeStatusInfo = SupEquipChargeStatusInfo.builder()
.startChargeSeq(startChargeSeq)
.startChargeSeqStat(Integer.parseInt(orderStatus))
// .startChargeSeqStat(2)
.connectorID(orderInfo.getPileConnectorCode())
.connectorStatus(Integer.parseInt(realTimeMonitorData.getConnectorStatus())) // 3-充电中
// .connectorStatus(3) // 3-充电中
.currentA(current.setScale(1, RoundingMode.HALF_UP))
// .currentA(new BigDecimal("20.3"))
.voltageA(voltage.setScale(1, RoundingMode.HALF_UP))
// .voltageA(new BigDecimal("260.7"))
.soc(new BigDecimal(soc))
// .soc(new BigDecimal("79"))
.startTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, orderInfo.getChargeStartTime()))
.endTime(dateTime)
.totalPower(new BigDecimal(realTimeMonitorData.getChargingDegree()))
// .totalPower(new BigDecimal("5292.21"))
.build();
@@ -677,6 +678,10 @@ public class GuangXiPlatformServiceImpl implements ThirdPartyPlatformService {
// 获取令牌
String token = getToken(urlAddress, operatorId, operatorSecret, dataSecretIv, signSecret, dataSecret);
String result = HttpRequestUtil.sendPost(token, jsonString, url, dataSecret, dataSecretIv, operatorId, signSecret);
if (StringUtils.equals("成功", result)) {
// 将数据存入缓存5分钟失效
redisCache.setCacheObject(redisKey, result, 5, TimeUnit.MINUTES);
}
return result;
}

View File

@@ -148,3 +148,12 @@ export function getMemberBalanceChangesV2(data) {
data: data
});
}
// 导出会员钱包明细
export function exportWalletList(data) {
return request({
url: '/member/info/exportWalletList',
method: 'post',
data: data
});
}

View File

@@ -175,6 +175,12 @@
</el-form-item>
<el-form-item style="margin-left: 10px;">
<el-button type="primary" icon="el-icon-search" size="mini" @click="getDetails">搜索</el-button>
<el-button
type="warning"
plain
icon="Download"
@click="handleExport"
>导出</el-button>
</el-form-item>
<el-col :span="24">
<el-form-item label="充值余额:"> {{ totalRechargeAmount }} </el-form-item>
@@ -473,7 +479,7 @@ export default {
},
/** 导出按钮操作 */
handleExport() {
this.download('member/info/export', {
this.download('member/info/exportWalletList', {
...this.queryParams
}, `info_${new Date().getTime()}.xlsx`)
},