From 5f0cb7bfdfbbca6ff22f02ce27c43a4b41ca6bfb Mon Sep 17 00:00:00 2001
From: xuhy <3313886187@qq.com>
Date: 星期三, 12 三月 2025 13:53:26 +0800
Subject: [PATCH] bug修改

---
 ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TBillServiceImpl.java |   22 +++++++++++++++-------
 1 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TBillServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TBillServiceImpl.java
index 896ea36..6fab5c1 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TBillServiceImpl.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TBillServiceImpl.java
@@ -1,15 +1,14 @@
 package com.ruoyi.system.service.impl;
 
+import cn.hutool.core.date.DateUtil;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ruoyi.common.basic.PageInfo;
+import com.ruoyi.common.config.SmsProperties;
 import com.ruoyi.common.constant.AmountConstant;
 import com.ruoyi.common.constant.CacheConstants;
 import com.ruoyi.common.core.redis.RedisCache;
 import com.ruoyi.common.exception.ServiceException;
-import com.ruoyi.common.utils.DateUtils;
-import com.ruoyi.common.utils.SmsUtil;
-import com.ruoyi.common.utils.StringUtils;
-import com.ruoyi.common.utils.TencentMailUtil;
+import com.ruoyi.common.utils.*;
 import com.ruoyi.common.utils.uuid.UUID;
 import com.ruoyi.system.dto.*;
 import com.ruoyi.system.mapper.TBillMapper;
@@ -251,7 +250,7 @@
             throw new ServiceException("实付金额不能高于于流水可抵扣剩余金额");
         }
         //如果实付金额大于欠费金额
-        if (dto.getAmount().compareTo(bill.getOutstandingMoney())>=0){
+        if (dto.getAmount().compareTo(bill.getOutstandingMoney())>0){
             throw new ServiceException("实付金额不能高于该账单欠费金额");
         }
 
@@ -275,6 +274,7 @@
         save.setPayType(3);
         save.setPayer(dto.getPayer());
         save.setPayTime(bankflow.getPayTime());
+        save.setSysSerialNumber(OrderNos.getDid(30));
         save.setBankSerialNumber(bankflow.getBankSerialNumber());
         save.setFlowType(2);
         save.setPaymentBillId(back.getId());
@@ -331,6 +331,7 @@
                 saveFlow.setPayType(1);
                 saveFlow.setPayer(order.getUserId());
                 saveFlow.setPayTime(DateUtils.dateToLocalDateTime(save.getPayTime()));
+                saveFlow.setSysSerialNumber(OrderNos.getDid(30));
                 saveFlow.setBankSerialNumber(save.getPayNo());
                 saveFlow.setFlowType(2);
                 saveFlow.setPaymentBillId(bill.getId());
@@ -394,7 +395,8 @@
             TBill save = new TBill();
             save.setId(bill.getId());
             try {
-                smsUtil.sendSms(bill.getPhone(), "2365726", new String[]{bill.getPartyTwoName()});
+                String name = bill.getPartyTwoName().length()>5?bill.getPartyTwoName().substring(0,5):bill.getPartyTwoName();
+                smsUtil.sendSms(bill.getPhone(), "2365726", new String[]{name});
                 save.setSmsStatus(1);
             }catch (ServiceException e){
                 failNum++;
@@ -463,7 +465,7 @@
                 throw new ServiceException("实付金额不能高于于流水可抵扣剩余金额");
             }
             //如果实付金额大于欠费金额
-            if (dto.getAmount().compareTo(bill.getOutstandingMoney())>=0){
+            if (dto.getAmount().compareTo(bill.getOutstandingMoney())>0){
                 throw new ServiceException("实付金额不能高于该账单欠费金额");
             }
         }
@@ -489,6 +491,7 @@
         save.setPayType(3);
         save.setPayer(dto.getPayer());
         save.setPayTime(bankflow!=null?bankflow.getPayTime():DateUtils.dateToLocalDateTime(new Date()));
+        save.setSysSerialNumber(OrderNos.getDid());
         save.setBankSerialNumber(bankflow!=null?bankflow.getBankSerialNumber():null);
         save.setFlowType(dto.getPayType()==1?2:1);
         save.setPaymentBillId(back.getId());
@@ -510,5 +513,10 @@
         return dto;
     }
 
+    @Override
+    public Integer batchBillCount(String userId, List<String> billIds) {
+        return this.baseMapper.batchBillCount(userId,billIds);
+    }
+
 
 }

--
Gitblit v1.7.1