Browse Source

feature:处方,核酸,挂号

wuyongyi 2 years ago
parent
commit
9833b23f99

+ 12 - 1
src/main/java/com/ywt/mg/services/NatOrderService.java

@@ -301,7 +301,8 @@ public class NatOrderService {
             String col3 = "交易日期*";
             String col4 = "订单号";
             String col5 = "类型";
-            String[] columns = new String[]{col0, col1, col2, col3, col4, col5};
+            String col6 = "支付渠道";
+            String[] columns = new String[]{col0, col1, col2, col3, col4, col5, col6};
             List<NatOrder> natOrderList = queryNatOrderList(request);
             ExcelDataMap map = new ExcelDataMap(columns);
             int payTotal = 0, refundTotal = 0, realityTotal = 0;
@@ -331,6 +332,10 @@ public class NatOrderService {
                             // 订单号
                             String orderNo = Checker.getStringValue(p.getOrderNo());
                             // 类型
+                            // 支付渠道
+                            int paymentChannelInt = Checker.getIntegerValue(p.getPaymentChannel());
+                            String paymentChannel = PaymentChannelEnum.getDisplayName(paymentChannelInt);
+
                             String typeStr = "核酸检测缴费";
 
                             map.getStringListSafely(col0).add(type);
@@ -342,6 +347,7 @@ public class NatOrderService {
                             if (Checker.getIntegerValue(p.getPaymentStatus()) == PaymentStatusEnum.Success.getValue()) {
                                 payTotal += Checker.getIntegerValue(p.getAmount());
                             }
+                            map.getStringListSafely(col6).add(paymentChannel);
 
                         }
                     }
@@ -362,6 +368,10 @@ public class NatOrderService {
                             String refundTimeStr = FormatUtil.createTimeFormatDetail(p.getRefundTime());
                             // 订单号
                             String orderNo = Checker.getStringValue(p.getOrderNo());
+                            // 支付渠道
+                            int paymentChannelInt = Checker.getIntegerValue(p.getPaymentChannel());
+                            String paymentChannel = PaymentChannelEnum.getDisplayName(paymentChannelInt);
+
                             // 类型
                             String typeName = "核酸检测缴费";
 
@@ -375,6 +385,7 @@ public class NatOrderService {
                             if (Checker.getIntegerValue(p.getRefundStatus()) == RefundStatusEnum.SUCCESS.getValue()) {
                                 refundTotal += Checker.getIntegerValue(p.getAmount());
                             }
+                            map.getStringListSafely(col6).add(paymentChannel);
                         }
                     }
                 }

+ 11 - 2
src/main/java/com/ywt/mg/services/PrescriptionServices.java

@@ -565,7 +565,6 @@ public class PrescriptionServices {
         customExcelItemList.add(new ExcelCollectPojo(startColumn + 3, startRows , new String[]{"退款总额", FormatUtil.intShrink100ToStr(refundTotal)}));
         customExcelItemList.add(new ExcelCollectPojo(startColumn + 5, startRows , new String[]{"实际支付金额", FormatUtil.intShrink100ToStr(payTotal - refundTotal)}));
 
-        startRows += 1;
 
         if (!Checker.isNone(itemList)) {
 
@@ -922,7 +921,8 @@ public class PrescriptionServices {
             String col3 = "交易日期*";
             String col4 = "订单号";
             String col5 = "类型";
-            String[] columns = new String[]{col0, col1, col2, col3, col4, col5};
+            String col6 = "支付渠道";
+            String[] columns = new String[]{col0, col1, col2, col3, col4, col5, col6};
             request.setPaymentStatus(PaymentStatusEnum.Success.getValue() + "");
             request.setPaymentChannel(PaymentChannelEnum.WeChat.getValue() + "");
             List<PrescriptionInfo> prescriptionInfoList = downloadPrescriptionlistNew(request);
@@ -960,6 +960,9 @@ public class PrescriptionServices {
                             String paymentTimeStr = FormatUtil.createTimeFormatDetail(p.getPayTime());
                             // 订单号
                             String orderNo = Checker.getStringValue(p.getOrderNo());
+
+                            int paymentChannelInt = Checker.getIntegerValue(p.getPaymentChannel());
+                            String paymentChannel = PaymentChannelEnum.getDisplayName(paymentChannelInt);
                             // 类型
                             String typeStr = "处方";
 
@@ -969,6 +972,8 @@ public class PrescriptionServices {
                             map.getStringListSafely(col3).add(paymentTimeStr);
                             map.getStringListSafely(col4).add(orderNo);
                             map.getStringListSafely(col5).add(typeStr);
+                            map.getStringListSafely(col6).add(paymentChannel);
+
                         }
                     }
                 }
@@ -991,6 +996,9 @@ public class PrescriptionServices {
                             String refundTimeStr = FormatUtil.createTimeFormatDetail(p.getRefundTime());
                             // 订单号
                             String orderNo = Checker.getStringValue(p.getOrderNo());
+
+                            int paymentChannelInt = Checker.getIntegerValue(p.getPaymentChannel());
+                            String paymentChannel = PaymentChannelEnum.getDisplayName(paymentChannelInt);
                             // 类型
                             String typeName = "处方";
 
@@ -1001,6 +1009,7 @@ public class PrescriptionServices {
                             map.getStringListSafely(col3).add(refundTimeStr);
                             map.getStringListSafely(col4).add(orderNo);
                             map.getStringListSafely(col5).add(typeName);
+                            map.getStringListSafely(col6).add(paymentChannel);
                         }
                     }
 

+ 21 - 10
src/main/java/com/ywt/mg/services/RegisteredOrderService.java

@@ -3,7 +3,6 @@ package com.ywt.mg.services;
 import com.ywt.mg.core.SqlHelper;
 import com.ywt.mg.core.utils.Checker;
 import com.ywt.mg.core.utils.DateUtil;
-import com.ywt.mg.core.utils.ExcelHelper;
 import com.ywt.mg.core.utils.FormatUtil;
 import com.ywt.mg.domain.entities.*;
 import com.ywt.mg.domain.models.ConstantDef;
@@ -396,6 +395,9 @@ public class RegisteredOrderService {
                     }
                     String transactionId = orderPaymentService.getTransactionIdByOrderId(orderPaymentList, Checker.getIntegerValue(p.getOrderId()));
                     String paymentChannel = PaymentChannelEnum.getDisplayName(Checker.getIntegerValue(p.getPaymentChannel()));
+                    if (p.getPaymentChannel() == PaymentChannelEnum.FREE.getValue()) {
+                        paymentChannel = "";
+                    }
                     if (hosp > 0) {
                         map.getStringListSafely(col0).add(p.getOrderNo());
                         map.getStringListSafely(col1).add(p.getPaymentNo());
@@ -590,15 +592,17 @@ public class RegisteredOrderService {
             if (!Checker.isNone(paymentChannelList)) {
                 for (int i = 0, j = paymentChannelList.size(); i < j; i++) {
                     int paymentChannel = paymentChannelList.get(i).intValue();
-                    if (paymentChannel <= 0) continue;
-                    startRows += 1;
-                    String paymentChannelName = PaymentChannelEnum.getDisplayName(paymentChannel);
-                    // 按支付渠道统计
-                    int paymentAmount = paymentList.stream().filter(p -> Checker.getIntegerValue(p.getPaymentChannel()) == paymentChannel).mapToInt(RegisteredOrder::getTotal).sum();
-                    int refundAmount = refundList.stream().filter(p -> Checker.getIntegerValue(p.getPaymentChannel()) == paymentChannel).mapToInt(RegisteredOrder::getTotal).sum();
-                    customExcelItemList.add(new ExcelCollectPojo(startColumn + 1, startRows, new String[]{paymentChannelName + "支付总额", FormatUtil.intShrink100ToStr(paymentAmount)}));
-                    customExcelItemList.add(new ExcelCollectPojo(startColumn + 3, startRows, new String[]{paymentChannelName + "退款总额", FormatUtil.intShrink100ToStr(refundAmount)}));
-                    customExcelItemList.add(new ExcelCollectPojo(startColumn + 5, startRows, new String[]{paymentChannelName + "实际支付金额", FormatUtil.intShrink100ToStr(paymentAmount - refundAmount)}));
+                    if (paymentChannel != PaymentChannelEnum.FREE.getValue()) {
+                        if (paymentChannel <= 0) continue;
+                        startRows += 1;
+                        String paymentChannelName = PaymentChannelEnum.getDisplayName(paymentChannel);
+                        // 按支付渠道统计
+                        int paymentAmount = paymentList.stream().filter(p -> Checker.getIntegerValue(p.getPaymentChannel()) == paymentChannel).mapToInt(RegisteredOrder::getTotal).sum();
+                        int refundAmount = refundList.stream().filter(p -> Checker.getIntegerValue(p.getPaymentChannel()) == paymentChannel).mapToInt(RegisteredOrder::getTotal).sum();
+                        customExcelItemList.add(new ExcelCollectPojo(startColumn + 1, startRows, new String[]{paymentChannelName + "支付总额", FormatUtil.intShrink100ToStr(paymentAmount)}));
+                        customExcelItemList.add(new ExcelCollectPojo(startColumn + 3, startRows, new String[]{paymentChannelName + "退款总额", FormatUtil.intShrink100ToStr(refundAmount)}));
+                        customExcelItemList.add(new ExcelCollectPojo(startColumn + 5, startRows, new String[]{paymentChannelName + "实际支付金额", FormatUtil.intShrink100ToStr(paymentAmount - refundAmount)}));
+                    }
                 }
             }
         }
@@ -649,6 +653,9 @@ public class RegisteredOrderService {
                             // 支付渠道
                             int paymentChannelInt = Checker.getIntegerValue(p.getPaymentChannel());
                             String paymentChannel = PaymentChannelEnum.getDisplayName(paymentChannelInt);
+                            if (p.getPaymentChannel() == PaymentChannelEnum.FREE.getValue()) {
+                                paymentChannel = "";
+                            }
 
                             map.getStringListSafely(col0).add(type);
                             map.getStringListSafely(col1).add(transactionId);
@@ -681,6 +688,10 @@ public class RegisteredOrderService {
                             // 支付渠道
                             int paymentChannelInt = Checker.getIntegerValue(p.getPaymentChannel());
                             String paymentChannel = PaymentChannelEnum.getDisplayName(paymentChannelInt);
+                            if (p.getPaymentChannel() == PaymentChannelEnum.FREE.getValue()) {
+                                paymentChannel = "";
+                            }
+
                             map.getStringListSafely(col0).add(type);
                             map.getStringListSafely(col1).add(transactionId);
                             map.getStringListSafely(col2).add(totalStr);