# Conflicts:
#	jsowell-ui/src/views/financial/merchant.vue
This commit is contained in:
admin-lmm
2023-07-07 13:34:34 +08:00
14 changed files with 228 additions and 32 deletions

View File

@@ -909,6 +909,28 @@ public class OrderService {
// 使用微信支付
payInfo.setPayMode(OrderPayModeEnum.PAYMENT_OF_WECHATPAY.getValue());
payInfo.setPayModeDesc(OrderPayModeEnum.PAYMENT_OF_WECHATPAY.getLabel());
// 判断是微信支付还是汇付支付
MemberTransactionRecord record = memberTransactionRecordService.selectByOrderCode(orderCode);
if (record != null) {
String paymentInstitutions = record.getPaymentInstitutions();
if (StringUtils.equals(paymentInstitutions, PaymentInstitutionsEnum.WECHAT_PAY.getValue())) {
// 查微信支付回调记录
WxpayCallbackRecord wxpayCallbackRecord = wxpayCallbackRecordService.selectByOrderCode(orderCode);
if (wxpayCallbackRecord != null) {
payInfo.setOutTradeNo(wxpayCallbackRecord.getOutTradeNo());
payInfo.setTransactionId(wxpayCallbackRecord.getTransactionId());
}
} else if (StringUtils.equals(paymentInstitutions, PaymentInstitutionsEnum.ADAPAY.getValue())) {
// 查询汇付支付回调
AdapayCallbackRecord adapayCallbackRecord = adapayCallbackRecordService.selectByOrderCode(orderCode);
if (adapayCallbackRecord != null) {
payInfo.setOutTradeNo(adapayCallbackRecord.getPaymentId());
payInfo.setTransactionId(adapayCallbackRecord.getOutTransId());
}
}
}
// 查微信支付回调记录
WxpayCallbackRecord wxpayCallbackRecord = wxpayCallbackRecordService.selectByOrderCode(orderCode);
if (wxpayCallbackRecord != null) {

View File

@@ -156,7 +156,6 @@ public class OrderBasicInfoController extends BaseController {
@PreAuthorize("@ss.hasPermi('order:order:list')")
@PostMapping("/getMerchantOrderList")
public TableDataInfo getMerchantOrderList(@RequestBody QueryOrderDTO dto) {
PageUtils.startPage();
return getDataTable(orderBasicInfoService.getMerchantOrderInfoList(dto));
}
}

View File

@@ -5,14 +5,17 @@ import com.jsowell.common.annotation.Log;
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.PageResponse;
import com.jsowell.common.core.page.TableDataInfo;
import com.jsowell.common.enums.BusinessType;
import com.jsowell.common.exception.BusinessException;
import com.jsowell.common.util.PageUtils;
import com.jsowell.common.util.SecurityUtils;
import com.jsowell.common.util.StringUtils;
import com.jsowell.common.util.poi.ExcelUtil;
import com.jsowell.pile.domain.PileMerchantInfo;
import com.jsowell.pile.dto.CreateMerchantDTO;
import com.jsowell.pile.dto.PageDTO;
import com.jsowell.pile.service.IPileMerchantInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
@@ -120,14 +123,17 @@ public class PileMerchantInfoController extends BaseController {
* @return
*/
@PreAuthorize("@ss.hasPermi('pile:merchant:query')")
@GetMapping("/getFinancialMerchantList")
public TableDataInfo getFinancialMerchantList() {
@PostMapping("/getFinancialMerchantList")
public TableDataInfo getFinancialMerchantList(@RequestBody PageDTO dto) {
int pageNum = dto.getPageNum() == 0 ? 1 : dto.getPageNum();
int pageSize = dto.getPageSize() == 0 ? 10 : dto.getPageSize();
// 权限过滤
AuthorizedDeptVO authorizedMap = SecurityUtils.getAuthorizedMap();
if (authorizedMap == null) {
// 为空表示没有权限,返回空数组
return new TableDataInfo();
}
PageUtils.startPage(pageNum, pageSize);
return getDataTable(pileMerchantInfoService.queryInfoListByIds(authorizedMap));
}
}

View File

@@ -40,7 +40,9 @@ public class CacheConstants {
public static final String PILE_PROGRAM_VERSION = "pile_program_version_";
// 查询订单回调
public static final String QUERY_ORDER_CALLBACK = "query_order_callback:";
public static final String QUERY_ORDER_WECHAT_CALLBACK = "query_order_wechat_callback:";
public static final String QUERY_ORDER_ADAPAY_CALLBACK = "query_order_adapay_callback:";
// 汇付支付参数
public static final String ADAPAY_ORDER_PARAM = "adapay_order_param:";

View File

@@ -53,6 +53,63 @@ public class LoginRequestHandler extends AbstractHandler{
YKCOperateFactory.register(type, this);
}
public static void main(String[] args) {
String msg = "8800000000009000020f56312e323035303000898604940121c138531304";
byte[] msgBody = BytesUtil.str2Bcd(msg);
int startIndex = 0;
int length = 7;
// 桩编码
byte[] pileSnByte = BytesUtil.copyBytes(msgBody, startIndex, length);
String pileSn = BytesUtil.binary(pileSnByte, 16);
// log.info("桩号:{}", pileSn);
// 桩类型 0 表示直流桩, 1 表示交流桩
startIndex += length;
length = 1;
byte[] pileTypeByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
String pileType = BytesUtil.bcd2Str(pileTypeByteArr);
// 充电枪数量
startIndex += length;
byte[] connectorNumByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
String connectorNum = BytesUtil.bcd2Str(connectorNumByteArr);
// 通信协议版本 版本号乘 10v1.0 表示 0x0A
startIndex += length;
byte[] communicationVersionByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
// int i = Integer.parseInt(BytesUtil.bcd2Str(communicationVersionByteArr)); // 0F --> 15
BigDecimal bigDecimal = new BigDecimal(BytesUtil.bcd2Str(communicationVersionByteArr));
BigDecimal communicationVersionTemp = bigDecimal.divide(new BigDecimal(10));
String communicationVersion = "v" + communicationVersionTemp;
// 程序版本
startIndex += length;
length = 8;
byte[] programVersionByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
String programVersion = BytesUtil.ascii2Str(programVersionByteArr);
log.info("程序版本:{} length:{}", programVersion, programVersion.length());
// 网络连接类型 0x00 SIM 卡 0x01 LAN 0x02 WAN 0x03 其他
startIndex += length;
length = 1;
byte[] internetConnectionTypeByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
String internetConnection = BytesUtil.bcd2Str(internetConnectionTypeByteArr);
// sim卡
startIndex += length;
length = 10;
byte[] simCardNumByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
String iccid = BytesUtil.bin2HexStr(simCardNumByteArr);
// 运营商 0x00 移动 0x02 电信 0x03 联通 0x04 其他
startIndex += length;
length = 1;
byte[] businessTypeByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
String business = BytesUtil.bcd2Str(businessTypeByteArr);
}
@Override
public byte[] supplyProcess(YKCDataProtocol ykcDataProtocol, Channel channel) {
log.info("[===执行登录逻辑===] param:{}, channel:{}", JSONObject.toJSONString(ykcDataProtocol), channel.toString());

View File

@@ -0,0 +1,16 @@
package com.jsowell.pile.dto;
import lombok.Data;
/**
* TODO
*
* @author Lemon
* @Date 2023/7/7 13:27
*/
@Data
public class PageDTO {
private Integer pageSize;
private Integer pageNum;
}

View File

@@ -63,4 +63,8 @@ public class QueryOrderDTO extends BaseEntity {
* 结束时间
*/
private String endTime;
private int pageSize;
private int pageNum;
}

View File

@@ -64,7 +64,7 @@ public class AdapayCallbackRecordServiceImpl implements AdapayCallbackRecordServ
if (StringUtils.isBlank(orderCode)) {
return null;
}
String redisKey = CacheConstants.QUERY_ORDER_CALLBACK + orderCode;
String redisKey = CacheConstants.QUERY_ORDER_ADAPAY_CALLBACK + orderCode;
AdapayCallbackRecord record = redisCache.getCacheObject(redisKey);
if (record != null) {
return record;

View File

@@ -1987,11 +1987,14 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
*/
@Override
public List<MerchantOrderInfoVO> getMerchantOrderInfoList(QueryOrderDTO dto) {
int pageNum = dto.getPageNum() == 0 ? 1 : dto.getPageNum();
int pageSize = dto.getPageSize() == 0 ? 10 : dto.getPageSize();
String startTime = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, DateUtils.addDays(new Date(), -7));
startTime = dto.getStartTime() == null ? startTime : dto.getStartTime();
dto.setStartTime(startTime);
PageUtils.startPage(pageNum, pageSize);
return orderBasicInfoMapper.getMerchantOrderInfoList(dto);
}
}

View File

@@ -262,7 +262,6 @@ public class PileMerchantInfoServiceImpl implements IPileMerchantInfoService {
String deptId = authorizedMap.getDeptId();
deptIds.add(deptId);
}
PageUtils.startPage();
return pileMerchantInfoMapper.queryInfoListByIds(deptIds);
}
}

View File

@@ -61,7 +61,7 @@ public class WxpayCallbackRecordServiceImpl implements WxpayCallbackRecordServic
if (StringUtils.isBlank(orderCode)) {
return null;
}
String redisKey = CacheConstants.QUERY_ORDER_CALLBACK + orderCode;
String redisKey = CacheConstants.QUERY_ORDER_WECHAT_CALLBACK + orderCode;
WxpayCallbackRecord wxpayCallbackRecord = redisCache.getCacheObject(redisKey);
if (wxpayCallbackRecord != null) {
return wxpayCallbackRecord;

View File

@@ -53,9 +53,10 @@ export function getMerchantList(query) {
}
// 财务管理页面获取运营商列表
export function getFinancialMerchantList() {
export function getFinancialMerchantList(data) {
return request({
url: '/pile/merchant/getFinancialMerchantList',
method: 'get'
method: 'post',
data: data
})
}

View File

@@ -172,7 +172,7 @@ export const constantRoutes = [
hidden: true,
children: [
{
path: "merchantVirtual",
path: "merchantVirtual/:id",
component: () => import("@/views/financial/components/virtualFinance"),
name: "merchantVirtual",
meta: { title: "虚拟财务",activeMenu: "/financial/merchant"},

View File

@@ -1,36 +1,106 @@
<template>
<div class="app-container">
<!-- <el-form
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
label-width="110px"
label-width="168px"
@submit.native.prevent
>
<el-form-item label="运营商名称" prop="merchantName">
<el-form-item label="订单编号" prop="orderCode">
<el-input
v-model="queryParams.merchantName"
placeholder="请输入运营商名称"
v-model="queryParams.orderCode"
placeholder="请输入订单编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-form-item label="手机号码" prop="mobileNumber">
<el-input
v-model="queryParams.mobileNumber"
placeholder="请输入手机号码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<div v-if="buttonBoolean">
<el-form-item label="订单编号" prop="orderCode">
<el-input
v-model="queryParams.orderCode"
placeholder="请输入订单编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="订单编号" prop="orderCode">
<el-input
v-model="queryParams.orderCode"
placeholder="请输入订单编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="订单编号" prop="orderCode">
<el-input
v-model="queryParams.orderCode"
placeholder="请输入订单编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
</div>
<el-button
@click="showOrHide()"
style="
border-color: white;
background-color: white;
font-size: x-small;
color: #50bfff;
padding: 1px 2px;
margin-left: 40%;
margin-top: 0px;
margin-bottom: 15px;
"
:icon="icon"
>{{ showOrHideText }}
</el-button>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>搜索
</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
icon="el-icon-refresh"
size="mini"
@click="resetQuery"
>重置</el-button
>重置
</el-button
>
</el-form-item>
</el-form> -->
</el-col>
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['order:order:export']"
>导出
</el-button
>
</el-row>
<el-table
:data="merchantList"
stripe
@@ -83,7 +153,7 @@
<template slot-scope="scope">
<!-- :to="'/merchant/detail/index/' + scope.row.id" -->
<router-link
:to="'/financial/merchant/merchantVirtual/'+scope.row.id"
to="/financial/merchant/merchantVirtual"
class="link-type"
>
<span>虚拟财务</span>
@@ -102,7 +172,7 @@
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
@pagination="getFinancialMerchantList"
/>
</div>
@@ -137,10 +207,27 @@ export default {
servicePhone: null,
logoUrl: null,
},
tableData: [{
date: '2016-05-02',
name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄'
}, {
date: '2016-05-04',
name: '王小虎',
address: '上海市普陀区金沙江路 1517 弄'
}, {
date: '2016-05-01',
name: '王小虎',
address: '上海市普陀区金沙江路 1519 弄'
}, {
date: '2016-05-03',
name: '王小虎',
address: '上海市普陀区金沙江路 1516 弄'
}]
};
},
created() {
this.getList();
this.getFinancialMerchantList();
},
methods: {
showOrHide() {
@@ -155,16 +242,15 @@ export default {
}
},
// 获取运营商列表
getList() {
getFinancialMerchantList() {
const params = {
pageNum:1,
pageSize:2
}
getFinancialMerchantList(params).then((response) => {
// console.log("response", response)
console.log("response", response)
this.merchantList = response.rows;
console.log('this.merchantList',this.merchantList)
// console.log("response.total", response.total)
console.log("response.total", response.total)
this.total = response.total;
})
},
@@ -173,17 +259,18 @@ export default {
this.open = false;
this.reset();
},
/** 搜索按钮操作 */
/** 搜索按钮操作 */
handleQuery() {
console.log('搜索事件');
this.queryParams.pageNum = 1;
this.getList();
// 获取订单列表
// this.getList();
// 获取订单总金额
// this.getOrderTotalData();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
// this.handleQuery();
},
/** 导出按钮操作 */
handleExport() {