From ff76ba9c9c56aa2dd1c6a96d5d6365fbb3db1fad Mon Sep 17 00:00:00 2001
From: wzp <2040239371@qq.com>
Date: 星期六, 03 五月 2025 19:12:04 +0800
Subject: [PATCH] feat: 新增支付记录前端展示
---
ruoyi-system/src/main/resources/mapper/system/PayInfoMapper.xml | 31 +++++++
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/PayInfoServiceImpl.java | 32 ++++++++
ruoyi-ui/src/views/system/order/detail.vue | 42 +++++++++-
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/ServiceOrderController.java | 17 ++-
ruoyi-system/src/main/java/com/ruoyi/system/service/IPayInfoService.java | 17 ++++
ruoyi-system/src/main/java/com/ruoyi/system/domain/PayInfo.java | 34 ++++++++
ruoyi-system/src/main/java/com/ruoyi/system/mapper/PayInfoMapper.java | 19 ++++
7 files changed, 181 insertions(+), 11 deletions(-)
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/ServiceOrderController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/ServiceOrderController.java
index 1e80c70..2fa6031 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/ServiceOrderController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/ServiceOrderController.java
@@ -13,10 +13,9 @@
import com.ruoyi.common.constant.HttpStatus;
import com.ruoyi.common.enums.DataSourceType;
-import com.ruoyi.system.domain.DictionaryCondition;
-import com.ruoyi.system.domain.DispatchOrd;
-import com.ruoyi.system.domain.TbOrders;
+import com.ruoyi.system.domain.*;
import com.ruoyi.system.service.IDispatchOrdService;
+import com.ruoyi.system.service.IPayInfoService;
import com.ruoyi.system.service.ITbOrdersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
@@ -35,7 +34,6 @@
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
-import com.ruoyi.system.domain.ServiceOrder;
import com.ruoyi.system.service.IServiceOrderService;
@@ -58,6 +56,9 @@
@Autowired
private IDispatchOrdService dispatchOrdService;
+
+ @Autowired
+ private IPayInfoService payInfoService;
/**
* 鑾峰彇鏈嶅姟璁㈠崟鍒楄〃
@@ -98,9 +99,9 @@
//鏌ヨ鏈嶅姟鍗�
ServiceOrder mingServiceOrder = serviceOrderService.selectServiceOrderById(Long.valueOf(orderDetail.getServiceOrdID()));
+
DispatchOrd dispatchOrd = dispatchOrdService.selectDispatchOrdByServiceOrdIDDt(mingServiceOrder.getServiceOrdId().toString());
-
Map<String, Object> data = new HashMap<>();
// 鏋勫缓璁㈠崟鍩烘湰淇℃伅
@@ -260,12 +261,16 @@
medicalInfo.put("useVentilator", useVentilator);
+ //鏀粯淇℃伅
+// List<PayInfo> payInfoList = payInfoService.selectPayInfoByServiceOrdIDDt(orderDetail.getServiceOrdID()); //1016302788
+ List<PayInfo> payInfoList = payInfoService.selectPayInfoByServiceOrdIDDt("1016302788");
+
data.put("orderInfo", orderInfo);
data.put("patientInfo", patientInfo);
data.put("serviceInfo", serviceInfo);
data.put("medicalInfo", medicalInfo); // 鏆傛椂涓虹┖
data.put("dispatchInfo", dispatchInfo); // 鏇存柊涓哄寘鍚汉鍛樹俊鎭殑dispatchInfo
- data.put("paymentInfo", new ArrayList<>()); // 鏆傛椂涓虹┖
+ data.put("paymentInfo", payInfoList); // 鏆傛椂涓虹┖
data.put("operationInfo", new ArrayList<>()); // 鏆傛椂涓虹┖
return AjaxResult.success(data);
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/PayInfo.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/PayInfo.java
new file mode 100644
index 0000000..8f00df5
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/PayInfo.java
@@ -0,0 +1,34 @@
+package com.ruoyi.system.domain;
+
+import java.math.BigDecimal;
+import java.util.Date;
+import com.ruoyi.common.core.domain.BaseEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 鏀粯淇℃伅瀵硅薄 pay_info
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class PayInfo extends BaseEntity {
+ private static final long serialVersionUID = 1L;
+
+ /** 鏈嶅姟璁㈠崟ID */
+ private String serviceOrdIDDt;
+
+ /** 鏀粯ID */
+ private Long id;
+
+ /** 澶囨敞鏂囨湰 */
+ private String vtext;
+
+ /** 鏀粯閲戦 */
+ private BigDecimal paidMoney;
+
+ /** 鏀粯鏃堕棿 */
+ private Date paidMoneyTime;
+
+ /** 鏀粯澶囨敞 */
+ private String paidMoneyMono;
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/PayInfoMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/PayInfoMapper.java
new file mode 100644
index 0000000..9930221
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/PayInfoMapper.java
@@ -0,0 +1,19 @@
+package com.ruoyi.system.mapper;
+
+import java.util.List;
+import com.ruoyi.system.domain.PayInfo;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 鏀粯淇℃伅Mapper鎺ュ彛
+ */
+@Mapper
+public interface PayInfoMapper {
+ /**
+ * 鏍规嵁鏈嶅姟璁㈠崟ID鏌ヨ鏀粯淇℃伅鍒楄〃
+ *
+ * @param serviceOrdIDDt 鏈嶅姟璁㈠崟ID
+ * @return 鏀粯淇℃伅鍒楄〃
+ */
+ public List<PayInfo> selectPayInfoByServiceOrdIDDt(String serviceOrdIDDt);
+}
\ No newline at end of file
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/IPayInfoService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/IPayInfoService.java
new file mode 100644
index 0000000..db43e29
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/IPayInfoService.java
@@ -0,0 +1,17 @@
+package com.ruoyi.system.service;
+
+import java.util.List;
+import com.ruoyi.system.domain.PayInfo;
+
+/**
+ * 鏀粯淇℃伅Service鎺ュ彛
+ */
+public interface IPayInfoService {
+ /**
+ * 鏍规嵁鏈嶅姟璁㈠崟ID鏌ヨ鏀粯淇℃伅鍒楄〃
+ *
+ * @param serviceOrdIDDt 鏈嶅姟璁㈠崟ID
+ * @return 鏀粯淇℃伅鍒楄〃
+ */
+ public List<PayInfo> selectPayInfoByServiceOrdIDDt(String serviceOrdIDDt);
+}
\ No newline at end of file
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/PayInfoServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/PayInfoServiceImpl.java
new file mode 100644
index 0000000..a8ae516
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/PayInfoServiceImpl.java
@@ -0,0 +1,32 @@
+package com.ruoyi.system.service.impl;
+
+import java.util.List;
+
+import com.ruoyi.common.annotation.DataSource;
+import com.ruoyi.common.enums.DataSourceType;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.system.mapper.PayInfoMapper;
+import com.ruoyi.system.domain.PayInfo;
+import com.ruoyi.system.service.IPayInfoService;
+
+/**
+ * 鏀粯淇℃伅Service涓氬姟灞傚鐞�
+ */
+@DataSource(DataSourceType.SQLSERVER)
+@Service
+public class PayInfoServiceImpl implements IPayInfoService {
+ @Autowired
+ private PayInfoMapper payInfoMapper;
+
+ /**
+ * 鏍规嵁鏈嶅姟璁㈠崟ID鏌ヨ鏀粯淇℃伅鍒楄〃
+ *
+ * @param serviceOrdIDDt 鏈嶅姟璁㈠崟ID
+ * @return 鏀粯淇℃伅鍒楄〃
+ */
+ @Override
+ public List<PayInfo> selectPayInfoByServiceOrdIDDt(String serviceOrdIDDt) {
+ return payInfoMapper.selectPayInfoByServiceOrdIDDt(serviceOrdIDDt);
+ }
+}
\ No newline at end of file
diff --git a/ruoyi-system/src/main/resources/mapper/system/PayInfoMapper.xml b/ruoyi-system/src/main/resources/mapper/system/PayInfoMapper.xml
new file mode 100644
index 0000000..26574a8
--- /dev/null
+++ b/ruoyi-system/src/main/resources/mapper/system/PayInfoMapper.xml
@@ -0,0 +1,31 @@
+<?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.ruoyi.system.mapper.PayInfoMapper">
+
+ <resultMap type="com.ruoyi.system.domain.PayInfo" id="PayInfoResult">
+ <result property="serviceOrdIDDt" column="ServiceOrdIDDt"/>
+ <result property="id" column="id"/>
+ <result property="vtext" column="vtext"/>
+ <result property="paidMoney" column="PaidMoney"/>
+ <result property="paidMoneyTime" column="PaidMoneyTime"/>
+ <result property="paidMoneyMono" column="PaidMoneyMono"/>
+ </resultMap>
+
+ <sql id="selectPayInfoVo">
+ select ServiceOrdIDDt, PaidMoney.id, vtext, PaidMoney, PaidMoneyTime, PaidMoneyMono
+ from PaidMoney,dictionary
+ where vtitle = 'PaidMoneyType'
+ and vType >= 1
+ and vID = PaidMoneyType
+ and PaidMoney <> 0
+ </sql>
+
+ <select id="selectPayInfoByServiceOrdIDDt" parameterType="String" resultMap="PayInfoResult">
+ <include refid="selectPayInfoVo"/>
+ and ServiceOrdIDDt = #{serviceOrdIDDt}
+ order by PaidMoneyTime desc
+ </select>
+
+</mapper>
\ No newline at end of file
diff --git a/ruoyi-ui/src/views/system/order/detail.vue b/ruoyi-ui/src/views/system/order/detail.vue
index b2aded4..22aab2e 100644
--- a/ruoyi-ui/src/views/system/order/detail.vue
+++ b/ruoyi-ui/src/views/system/order/detail.vue
@@ -97,11 +97,16 @@
style="width: 100%"
:size="isMobile ? 'mini' : 'medium'"
class="responsive-table">
- <el-table-column prop="paymentNo" label="鏀舵娴佹按" min-width="120" />
- <el-table-column prop="paymentTime" label="鏀舵鏃堕棿" min-width="140" />
- <el-table-column prop="amount" label="閲戦" min-width="100" />
- <el-table-column prop="method" label="鏂瑰紡" min-width="100" />
- <el-table-column prop="remark" label="澶囨敞" min-width="120" />
+ <el-table-column prop="id" label="鏀舵娴佹按" min-width="120" />
+ <el-table-column
+ prop="paidMoneyTime"
+ label="鏀舵鏃堕棿"
+ min-width="140"
+ :formatter="(row, column, cellValue) => formatDateTime(cellValue)"
+ />
+ <el-table-column prop="paidMoney" label="閲戦(鍏�)" min-width="100" />
+ <el-table-column prop="vtext" label="鏂瑰紡" min-width="100" />
+ <el-table-column prop="paidMoneyMono" label="澶囨敞" min-width="120" />
</el-table>
</el-card>
</el-col>
@@ -129,12 +134,33 @@
</el-card>
</el-col>
</el-row>
+
+ <!-- 璁㈠崟鎯呭喌 -->
+ <el-row :gutter="20">
+ <!-- 璋冨害淇℃伅 -->
+ <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+ <el-card class="inner-card">
+ <div slot="header"><b>璋冨害淇℃伅</b></div>
+ <el-descriptions :column="isMobile ? 1 : 2" border>
+ <el-descriptions-item label="鏈嶅姟璇勪环">{{ dispatchInfo.dispatchTime }}</el-descriptions-item>
+ <el-descriptions-item label="鍙戠エ鐘舵��">{{ dispatchInfo.dispatchStatus }}</el-descriptions-item>
+ <el-descriptions-item label="鏀粯鐘舵��">{{ dispatchInfo.driver }}</el-descriptions-item>
+ <el-descriptions-item label="杞︾墝">{{ dispatchInfo.carLicense }}</el-descriptions-item>
+ <el-descriptions-item label="鍖荤敓">{{ dispatchInfo.doctor }}</el-descriptions-item>
+ <!-- <el-descriptions-item label="鑱屼綅">{{ dispatchInfo.doctorPosition }}</el-descriptions-item> -->
+ <el-descriptions-item label="鎶ゅ+">{{ dispatchInfo.nurse }}</el-descriptions-item>
+ </el-descriptions>
+ </el-card>
+ </el-col>
+ </el-row>
+
</el-card>
</div>
</template>
<script>
import { getOrderDetail } from '@/api/system/order'
+import { parseTime } from '@/utils/ruoyi'
export default {
name: 'OrderDetail',
@@ -187,6 +213,12 @@
// 澶勭悊绐楀彛澶у皬鍙樺寲
handleResize() {
this.screenWidth = document.documentElement.clientWidth
+ },
+ formatDateTime(time) {
+ if (!time) {
+ return '';
+ }
+ return parseTime(time, '{y}-{m}-{d} {h}:{i}:{s}');
}
}
}
--
Gitblit v1.9.1