Browse Source

1、方法内部单行注释,在被注释语句上方另起一行,使用//注释。方法内部多行注释使用/* */注释。注意与代码对齐;

zk 2 years ago
parent
commit
b864de1f4c
18 changed files with 124 additions and 68 deletions
  1. 2 1
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/utils/CollectionUtils.java
  2. 26 13
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/utils/DateUtils.java
  3. 2 1
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/utils/FileUtils.java
  4. 10 6
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/utils/ListUtils.java
  5. 6 4
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/utils/StringUtils.java
  6. 3 3
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/utils/workerUtils.java
  7. 6 6
      sckw-common/sckw-common-redis/src/main/java/com/sckw/redis/utils/TestService.java
  8. 2 2
      sckw-common/sckw-common-stream/src/main/java/com/sckw/stream/utils/SmsUtil.java
  9. 10 2
      sckw-modules-api/sckw-payment-api/src/main/java/com/sckw/payment/api/model/constant/ChannelEnum.java
  10. 2 1
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/constant/SettlementEnum.java
  11. 2 1
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/constant/SettlementOrderTypeEnum.java
  12. 1 1
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/constant/TradingEnum.java
  13. 10 5
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/constant/WalletChannelEnum.java
  14. 12 6
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/KwpLedgerLogisticsService.java
  15. 6 4
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/KwpLedgerTradeService.java
  16. 4 2
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/KwpSettlementLogisticsService.java
  17. 10 5
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/KwpSettlementOfflineService.java
  18. 10 5
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/KwpSettlementWalletService.java

+ 2 - 1
sckw-common/sckw-common-core/src/main/java/com/sckw/core/utils/CollectionUtils.java

@@ -230,7 +230,8 @@ public class CollectionUtils extends CollectionUtil {
 		if (list.size() == 0) {
 			return null;
 		}
-		Integer count = list.size(); // 记录总数
+		// 记录总数
+		Integer count = list.size();
 		int fromIndex = Math.min((page - 1) * pageSize,count);
 		int toIndex = Math.min(fromIndex + pageSize,count);
 

+ 26 - 13
sckw-common/sckw-common-core/src/main/java/com/sckw/core/utils/DateUtils.java

@@ -215,7 +215,8 @@ public class DateUtils extends DateUtil {
      * @return
      */
     public static String numberDateFormat(String timestamp, String simpleDateFormatType) {
-        SimpleDateFormat sdf = new SimpleDateFormat(simpleDateFormatType);//要转换的时间格式
+        //要转换的时间格式
+        SimpleDateFormat sdf = new SimpleDateFormat(simpleDateFormatType);
         String date = null;
         if (timestamp.length() == THIRTEEN) {
             date = sdf.format(Long.parseLong(timestamp));
@@ -233,7 +234,8 @@ public class DateUtils extends DateUtil {
      * @return
      */
     public static Date numberDateFormatToDate(String timestamp, String simpleDateFormatType) {
-        SimpleDateFormat sdf = new SimpleDateFormat(simpleDateFormatType);//要转换的时间格式
+        //要转换的时间格式
+        SimpleDateFormat sdf = new SimpleDateFormat(simpleDateFormatType);
         Date date = null;
         try {
             if (timestamp.length() == THIRTEEN) {
@@ -271,12 +273,18 @@ public class DateUtils extends DateUtil {
      * @Date: 2019/7/18 0018 16:46
      */
     public static String getTimeBySecond(long seconds) {
-        long days = seconds / 86400;//转换天数
-        seconds = seconds % 86400;//剩余秒数
-        long hours = seconds / 3600;//转换小时数
-        seconds = seconds % 3600;//剩余秒数
-        long minutes = seconds / 60;//转换分钟
-        seconds = seconds % 60;//剩余秒数
+        //转换天数
+        long days = seconds / 86400;
+        //剩余秒数
+        seconds = seconds % 86400;
+        //转换小时数
+        long hours = seconds / 3600;
+        //剩余秒数
+        seconds = seconds % 3600;
+        //转换分钟
+        long minutes = seconds / 60;
+        //剩余秒数
+        seconds = seconds % 60;
         if (0 < days) {
             return days + "天," + hours + "小时," + minutes + "分," + seconds + "秒";
         } else {
@@ -428,17 +436,22 @@ public class DateUtils extends DateUtil {
             endCalendar.set(Calendar.DATE, 1);
             endCalendar.roll(Calendar.DATE, -1);
             if (day == (endCalendar.get(Calendar.DATE) - startCalendar.get(Calendar.DATE))) {
-                monthCount = 1;// 两日期间满一个月
+                // 两日期间满一个月
+                monthCount = 1;
             } else {
-                monthCount = 0;// 两日期间不足一个月
+                // 两日期间不足一个月
+                monthCount = 0;
             }
-        } else if (year != 0 && month == 0) {// 年份不同月份相同
-            if (startCalendar.get(Calendar.DATE) < endCalendar.get(Calendar.DATE)) {// 两日期间的天数,小于等于当月
+            // 年份不同月份相同
+        } else if (year != 0 && month == 0) {
+            // 两日期间的天数,小于等于当月
+            if (startCalendar.get(Calendar.DATE) < endCalendar.get(Calendar.DATE)) {
                 monthCount = 1;
             }
             monthCount += year * 12 + month;
         } else {
-            if (startCalendar.get(Calendar.DATE) >= endCalendar.get(Calendar.DATE)) {// 起始日期DATE 大于等于结束日期DATE
+            // 起始日期DATE 大于等于结束日期DATE
+            if (startCalendar.get(Calendar.DATE) >= endCalendar.get(Calendar.DATE)) {
                 monthCount = year * 12 + month;
             } else {
                 monthCount = year * 12 + month + 1;

+ 2 - 1
sckw-common/sckw-common-core/src/main/java/com/sckw/core/utils/FileUtils.java

@@ -947,7 +947,8 @@ public class FileUtils {
         try {
             br = new BufferedReader(new StringReader(text));
             bw = new BufferedWriter(new FileWriter(file));
-            char[] buf = new char[1024 * 64];          //字符缓冲区
+            //字符缓冲区
+            char[] buf = new char[1024 * 64];
             int len;
             while ((len = br.read(buf)) != -1) {
                 bw.write(buf, 0, len);

+ 10 - 6
sckw-common/sckw-common-core/src/main/java/com/sckw/core/utils/ListUtils.java

@@ -48,7 +48,8 @@ public class ListUtils {
     }
 
     public static void main(String[] args) {
-        String sortTyp = "asc"; // desc-倒叙  asc-正序
+        // desc-倒叙  asc-正序
+        String sortTyp = "asc";
         // 组装测试数据
         List<Map<String, Object>> list = initMapList();
 
@@ -105,18 +106,21 @@ public class ListUtils {
     public static Map<String, Object> sortMap(Map<String, Object> map, String sortTyp) {
         try {
             if ("desc".equals(sortTyp)) {
-
-                Set<String> sortSet = new TreeSet<>(Comparator.reverseOrder()); // 定义个倒叙的set
-                sortSet.addAll(map.keySet()); // 获取全部key,添加后就自然倒序了
+                // 定义个倒叙的set
+                Set<String> sortSet = new TreeSet<>(Comparator.reverseOrder());
+                // 获取全部key,添加后就自然倒序了
+                sortSet.addAll(map.keySet());
 
                 Map<String, Object> resp = new LinkedHashMap<>();
                 for (String key : sortSet) {
-                    resp.put(key, map.get(key)); // 按顺序放入新map
+                    // 按顺序放入新map
+                    resp.put(key, map.get(key));
                 }
 
                 return resp;
             } else {
-                return new TreeMap<>(map); // TreeMap 本身就是正序的
+                // TreeMap 本身就是正序的
+                return new TreeMap<>(map);
             }
         } catch (Exception e) {
             e.printStackTrace();

+ 6 - 4
sckw-common/sckw-common-core/src/main/java/com/sckw/core/utils/StringUtils.java

@@ -714,13 +714,15 @@ public class StringUtils {
             // already capitalized
             return str;
         }
-
-        final int newCodePoints[] = new int[strLen]; // cannot be longer than the char array
+        // cannot be longer than the char array
+        final int newCodePoints[] = new int[strLen];
         int outOffset = 0;
-        newCodePoints[outOffset++] = newCodePoint; // copy the first codepoint
+        // copy the first codepoint
+        newCodePoints[outOffset++] = newCodePoint;
         for (int inOffset = Character.charCount(firstCodepoint); inOffset < strLen; ) {
             final int codepoint = str.codePointAt(inOffset);
-            newCodePoints[outOffset++] = codepoint; // copy the remaining ones
+            // copy the remaining ones
+            newCodePoints[outOffset++] = codepoint;
             inOffset += Character.charCount(codepoint);
         }
         return new String(newCodePoints, 0, outOffset);

+ 3 - 3
sckw-common/sckw-common-core/src/main/java/com/sckw/core/utils/workerUtils.java

@@ -121,9 +121,9 @@ public class workerUtils {
         // 上次生成ID的时间截
         lastTimestamp = timestamp;
         // 移位并通过或运算拼到一起组成64位的ID
-        return ((timestamp - twepoch) << timestampLeftShift) //
-                | (datacenterId << datacenterIdShift) //
-                | (workerId << workerIdShift) //
+        return ((timestamp - twepoch) << timestampLeftShift)
+                | (datacenterId << datacenterIdShift)
+                | (workerId << workerIdShift)
                 | sequence;
     }
 

+ 6 - 6
sckw-common/sckw-common-redis/src/main/java/com/sckw/redis/utils/TestService.java

@@ -21,13 +21,13 @@ public class TestService {
 
         RBucket<Object> mytest = redisson.getBucket("mytest");
         mytest.set("value");
-        System.out.println(mytest.get());//value
+        System.out.println(mytest.get());
         mytest.set("value2");
-        System.out.println(mytest.get());//value2
-        boolean b = mytest.compareAndSet("value2", "value3"); //true
-        System.out.println(mytest.get());//value3
-        boolean b1 = mytest.compareAndSet("value2", "value4"); //flase
-        System.out.println(mytest.get());//value3
+        System.out.println(mytest.get());
+        boolean b = mytest.compareAndSet("value2", "value3");
+        System.out.println(mytest.get());
+        boolean b1 = mytest.compareAndSet("value2", "value4");
+        System.out.println(mytest.get());
     }
 
     public static void main(String[] args) {

+ 2 - 2
sckw-common/sckw-common-stream/src/main/java/com/sckw/stream/utils/SmsUtil.java

@@ -13,8 +13,8 @@ import com.sckw.stream.model.SckwSms;
 import java.util.HashMap;
 
 public class SmsUtil {
-    //替换成自己申请的accessKeyId
-    private static String accessKeyId = "LTAI5tEyvh6N9HhxDMkW2MqT"; //替换成自己申请的accessKeySecret
+    //替换成自己申请的accessKeySecret
+    private static String accessKeyId = "LTAI5tEyvh6N9HhxDMkW2MqT";
     private static String accessKeySecret = "ClQ2q9fxytnhDraX7axAOjlK0zGJAP";
     static final String product = "Dysmsapi";
     static final String domain = "dysmsapi.aliyuncs.com";

+ 10 - 2
sckw-modules-api/sckw-payment-api/src/main/java/com/sckw/payment/api/model/constant/ChannelEnum.java

@@ -9,8 +9,16 @@ public enum ChannelEnum {
     HF("11", "1", "huifu", "汇付渠道"),
     XS("12", "2", "newpay", "新生渠道"),
     ZX("13", "3", "citic", "中信渠道");
-    private final String code;//预付款+支付渠道
-    private final String value;//渠道对应的字典值
+
+    /**
+     * 预付款+支付渠道
+     */
+    private final String code;
+
+    /**
+     * 渠道对应的字典值
+     */
+    private final String value;
     private final String channel;
     private final String desc;
 

+ 2 - 1
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/constant/SettlementEnum.java

@@ -43,7 +43,8 @@ public enum SettlementEnum {
                 return settlementEnum.getDesc();
             }
         }
-        return null; // 可根据实际需求返回默认值或其他处理
+        // 可根据实际需求返回默认值或其他处理
+        return null;
     }
 
 

+ 2 - 1
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/constant/SettlementOrderTypeEnum.java

@@ -39,7 +39,8 @@ public enum SettlementOrderTypeEnum {
                     return settlementOrderTypeEnum.getDesc();
                 }
             }
-            return null; // 可根据实际需求返回默认值或其他处理
+            // 可根据实际需求返回默认值或其他处理
+            return null;
         }
 
 

+ 1 - 1
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/constant/TradingEnum.java

@@ -23,7 +23,7 @@ public enum TradingEnum {
     OFFLINE_PAY(3, "3", "线下付款");
 
     private final int status;
-    private final String value;//字典值
+    private final String value;
     private final String desc;
 
     TradingEnum(int status, String value, String desc) {

+ 10 - 5
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/constant/WalletChannelEnum.java

@@ -7,9 +7,12 @@ import org.apache.commons.lang3.StringUtils;
  * @date 2023-07-27 12:54
  */
 public enum WalletChannelEnum {
-    HF(1, "1", "huifu"),//汇付
-    XS(2, "2", "xinsheng"),//新生
-    ZX(3, "3", "zhongxin");//中信
+    //汇付
+    HF(1, "1", "huifu"),
+    //新生
+    XS(2, "2", "xinsheng"),
+    //中信
+    ZX(3, "3", "zhongxin");
 
     private final int status;
     private final String value;
@@ -40,7 +43,8 @@ public enum WalletChannelEnum {
                 return walletChannelEnum.getDesc();
             }
         }
-        return null; // 可根据实际需求返回默认值或其他处理
+        // 可根据实际需求返回默认值或其他处理
+        return null;
     }
 
     /**
@@ -59,7 +63,8 @@ public enum WalletChannelEnum {
                 return walletChannelEnum.getValue();
             }
         }
-        return null; // 可根据实际需求返回默认值或其他处理
+        // 可根据实际需求返回默认值或其他处理
+        return null;
     }
 
 }

+ 12 - 6
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/KwpLedgerLogisticsService.java

@@ -219,7 +219,8 @@ public class KwpLedgerLogisticsService extends AbsLedger {
         kwpLedgerLogistics.setTaxRate(logisticsSendReq.getTaxRate());
         kwpLedgerLogistics.setTrading(logisticsSendReq.getTrading());
         kwpLedgerLogistics.setTotalPrice(logisticsSendReq.getTotalPrice());
-        kwpLedgerLogistics.setExTaxPrice(logisticsSendReq.getTotalPrice());//todo-xcq 不含税金额计算方式:订单含税金额总和/1.13(税率)
+        //todo-xcq 不含税金额计算方式:订单含税金额总和/1.13(税率)
+        kwpLedgerLogistics.setExTaxPrice(logisticsSendReq.getTotalPrice());
         kwpLedgerLogistics.setSettlePrice(logisticsSendReq.getSettlePrice());
         kwpLedgerLogistics.setActualPrice(new BigDecimal("0.0"));
         kwpLedgerLogistics.setAuditUser(Global.EMPTY_STRING);
@@ -325,8 +326,10 @@ public class KwpLedgerLogisticsService extends AbsLedger {
         carrierUnit.setLLedgerId(kwpLedgerLogistics.getId());
         carrierUnit.setLLedgerNo(kwpLedgerLogistics.getLLedgerNo());
         carrierUnit.setUnitType(LogisticsUnitType.CARRIER);
-        carrierUnit.setEntId(entId);//顶级企业id
-        carrierUnit.setTopEntId(entCacheResDto1.getId());//顶级企业id
+        //顶级企业id
+        carrierUnit.setEntId(entId);
+        //顶级企业id
+        carrierUnit.setTopEntId(entCacheResDto1.getId());
         carrierUnit.setFirmName(entCacheResDto1.getFirmName());
         carrierUnit.setContacts(entCacheResDto1.getContacts());
         carrierUnit.setPhone(entCacheResDto1.getPhone());
@@ -498,8 +501,10 @@ public class KwpLedgerLogisticsService extends AbsLedger {
         kwpSettlementLogistics.setEntId(LoginUserHolder.getEntId());
         kwpSettlementLogistics.setLLedgerId(kwpLedgerLogistics.getId());
         kwpSettlementLogistics.setSlOrderNo(OrderGenerateUtils.generateOrderNo("TP"));
-        kwpSettlementLogistics.setName(kwpLedgerLogistics.getName());//取物流对账单名称
-        kwpSettlementLogistics.setTotalPrice(kwpLedgerLogistics.getSettlePrice());//实际结算金额就是结算单实际需付金额
+        //取物流对账单名称
+        kwpSettlementLogistics.setName(kwpLedgerLogistics.getName());
+        //实际结算金额就是结算单实际需付金额
+        kwpSettlementLogistics.setTotalPrice(kwpLedgerLogistics.getSettlePrice());
         kwpSettlementLogistics.setActualPrice(kwpLedgerLogistics.getActualPrice());
         kwpSettlementLogistics.setRemark(Global.EMPTY_STRING);
         kwpSettlementLogistics.setAuditUser(kwpLedgerLogistics.getAuditUser());
@@ -507,7 +512,8 @@ public class KwpLedgerLogisticsService extends AbsLedger {
         kwpSettlementLogistics.setSuccessUser(ledgerReq.getSuccessUser());
         kwpSettlementLogistics.setSuccessPhone(ledgerReq.getSuccessPhone());
         kwpSettlementLogistics.setReceiptTime(receiptTime);
-        kwpSettlementLogistics.setStatus(SettlementEnum.WAITING_PAYMENT.getStatus());//1-待结算
+        //1-待结算
+        kwpSettlementLogistics.setStatus(SettlementEnum.WAITING_PAYMENT.getStatus());
         kwpSettlementLogistics.setCreateBy(LoginUserHolder.getUserId());
         kwpSettlementLogistics.setCreateTime(LocalDateTime.now());
         kwpSettlementLogistics.setUpdateBy(LoginUserHolder.getUserId());

+ 6 - 4
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/KwpLedgerTradeService.java

@@ -191,7 +191,8 @@ public class KwpLedgerTradeService extends AbsLedger {
         kwpLedgerTrade.setTaxRate(tradeSendReq.getTaxRate());
         kwpLedgerTrade.setTrading(tradeSendReq.getTrading());
         kwpLedgerTrade.setTotalPrice(tradeSendReq.getTotalPrice());
-        kwpLedgerTrade.setExTaxPrice(tradeSendReq.getTotalPrice());//todo-xcq 不含税金额计算方式:订单含税金额总和/1.13(税率)
+        //todo-xcq 不含税金额计算方式:订单含税金额总和/1.13(税率)
+        kwpLedgerTrade.setExTaxPrice(tradeSendReq.getTotalPrice());
         kwpLedgerTrade.setSettlePrice(tradeSendReq.getSettlePrice());
         kwpLedgerTrade.setActualPrice(new BigDecimal("0.0"));
         kwpLedgerTrade.setAuditUser(Global.EMPTY_STRING);
@@ -517,7 +518,8 @@ public class KwpLedgerTradeService extends AbsLedger {
         kwpSettlementTrade.setSuccessUser(ledgerReq.getSuccessUser());
         kwpSettlementTrade.setSuccessPhone(ledgerReq.getSuccessPhone());
         kwpSettlementTrade.setReceiptTime(receiptTime);
-        kwpSettlementTrade.setStatus(SettlementEnum.WAITING_PAYMENT.getStatus());//1-待结算
+        //1-待结算
+        kwpSettlementTrade.setStatus(SettlementEnum.WAITING_PAYMENT.getStatus());
         kwpSettlementTrade.setCreateBy(LoginUserHolder.getUserId());
         kwpSettlementTrade.setCreateTime(LocalDateTime.now());
         kwpSettlementTrade.setUpdateBy(LoginUserHolder.getUserId());
@@ -615,10 +617,10 @@ public class KwpLedgerTradeService extends AbsLedger {
         ledgerTradeDetailVo.setFirmName(ledgerTradeDto.getFirmName());
         SysDictResDto trading = remoteSystemService.queryDictByTypeAndValue(DictTypeEnum.TRADE_TYPE.getType(), ledgerTradeDto.getTrading());
         ledgerTradeDetailVo.setTrading(ledgerTradeDto.getTrading());
-        ledgerTradeDetailVo.setTradingLabel(Objects.nonNull(trading) ? trading.getLabel() : "");//
+        ledgerTradeDetailVo.setTradingLabel(Objects.nonNull(trading) ? trading.getLabel() : "");
         SysDictResDto taxRate = remoteSystemService.queryDictByTypeAndValue(DictTypeEnum.TAX_RATE.getType(), String.valueOf(ledgerTradeDto.getTaxRate()));
         ledgerTradeDetailVo.setTaxRate(ledgerTradeDto.getTaxRate());
-        ledgerTradeDetailVo.setTaxRateLabel(Objects.nonNull(taxRate) ? taxRate.getLabel() : "");//
+        ledgerTradeDetailVo.setTaxRateLabel(Objects.nonNull(taxRate) ? taxRate.getLabel() : "");
         ledgerTradeDetailVo.setTotalPrice(ledgerTradeDto.getTotalPrice());
         ledgerTradeDetailVo.setSettlePrice(ledgerTradeDto.getSettlePrice());
         ledgerTradeDetailVo.setActualPrice(ledgerTradeDto.getActualPrice());

+ 4 - 2
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/KwpSettlementLogisticsService.java

@@ -302,8 +302,10 @@ public class KwpSettlementLogisticsService {
         } else {
             settlementLogisticsDto.setWaitPrice(new BigDecimal(0));
         }
-        settlementLogisticsDto.setCreateByLabel("创建人名称");//"创建人名称"
-        settlementLogisticsDto.setUpdateByLabel("更新人名称");//"更新人名称"
+        //"创建人名称"
+        settlementLogisticsDto.setCreateByLabel("创建人名称");
+        //"更新人名称"
+        settlementLogisticsDto.setUpdateByLabel("更新人名称");
 
         Map<Long, UserCacheResDto> map = new HashMap<>(Global.NUMERICAL_SIXTEEN);
         Long createBy = settlementLogisticsDto.getCreateBy();

+ 10 - 5
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/KwpSettlementOfflineService.java

@@ -165,11 +165,13 @@ public class KwpSettlementOfflineService {
             throw new BusinessException("该订单已结算完成,无法操作");
         }
         BigDecimal remainingReceivables = settlementLogisticsDto.getTotalPrice();
-        if (settlementLogisticsDto.getActualPrice() != null) {//剩余金额
+        if (settlementLogisticsDto.getActualPrice() != null) {
+            //剩余金额
             remainingReceivables = settlementLogisticsDto.getTotalPrice().subtract(settlementLogisticsDto.getActualPrice());
         }
 
-        if (remainingReceivables.compareTo(price) < 0) {//-1表示小于,0是等于,1是大于
+        //-1表示小于,0是等于,1是大于
+        if (remainingReceivables.compareTo(price) < 0) {
             log.error("本次结算输入金额比剩余付款金额大:ID:" + id + " 剩余金额:" + remainingReceivables + " 本次输入金额:" + price);
             throw new BusinessException("参数错误:输入金额过大 " + price + " 剩余金额最大值:" + remainingReceivables);
         }
@@ -177,10 +179,12 @@ public class KwpSettlementOfflineService {
         KwpSettlementLogistics settlementLogistics = new KwpSettlementLogistics();
         settlementLogistics.setId(settlementLogisticsDto.getId());
         settlementLogistics.setUpdateTime(LocalDateTime.now());
-        if (remainingReceivables.compareTo(price) == 0) {//全部结算
+        //全部结算
+        if (remainingReceivables.compareTo(price) == 0) {
             settlementLogistics.setStatus(SettlementEnum.ALL_PAYMENT.getStatus());
         }
-        if (remainingReceivables.compareTo(price) > 0) {//部分结算
+        //部分结算
+        if (remainingReceivables.compareTo(price) > 0) {
             settlementLogistics.setStatus(SettlementEnum.PARTIAL_PAYMENT.getStatus());
         }
         BigDecimal actualPrice = settlementLogisticsDto.getActualPrice();
@@ -313,7 +317,8 @@ public class KwpSettlementOfflineService {
                 //更新结算单记录
                 KwpSettlementTrade kwpSettlementTrade = new KwpSettlementTrade();
                 kwpSettlementTrade.setId(byId.getId());
-                kwpSettlementTrade.setActualPrice(actualPrice.add(payPrice));//已收款加本次收款
+                //已收款加本次收款
+                kwpSettlementTrade.setActualPrice(actualPrice.add(payPrice));
                 int status = 0;
                 //全部结算,修改贸易订单状态
                 if (subtract1.compareTo(new BigDecimal("0.0")) == NumberConstant.ZERO) {

+ 10 - 5
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/KwpSettlementWalletService.java

@@ -174,11 +174,13 @@ public class KwpSettlementWalletService {
             throw new BusinessException("该订单已结算完成,无法操作");
         }
         BigDecimal remainingReceivables = settlementLogisticsDto.getTotalPrice();
-        if (settlementLogisticsDto.getActualPrice() != null) {//剩余金额
+        //剩余金额
+        if (settlementLogisticsDto.getActualPrice() != null) {
             remainingReceivables = settlementLogisticsDto.getTotalPrice().subtract(settlementLogisticsDto.getActualPrice());
         }
 
-        if (remainingReceivables.compareTo(price) < 0) {//-1表示小于,0是等于,1是大于
+        //-1表示小于,0是等于,1是大于
+        if (remainingReceivables.compareTo(price) < 0) {
             log.error("本次结算输入金额比剩余付款金额大:ID:" + id + " 剩余金额:" + remainingReceivables + " 本次输入金额:" + price);
             throw new BusinessException("参数错误:输入金额过大 " + price + " 剩余金额最大值:" + remainingReceivables);
         }
@@ -186,10 +188,12 @@ public class KwpSettlementWalletService {
         KwpSettlementLogistics settlementLogistics = new KwpSettlementLogistics();
         settlementLogistics.setId(settlementLogisticsDto.getId());
         settlementLogistics.setUpdateTime(LocalDateTime.now());
-        if (remainingReceivables.compareTo(price) == 0) {//全部结算
+        //全部结算
+        if (remainingReceivables.compareTo(price) == 0) {
             settlementLogistics.setStatus(SettlementEnum.ALL_PAYMENT.getStatus());
         }
-        if (remainingReceivables.compareTo(price) > 0) {//部分结算
+        //部分结算
+        if (remainingReceivables.compareTo(price) > 0) {
             settlementLogistics.setStatus(SettlementEnum.PARTIAL_PAYMENT.getStatus());
         }
         BigDecimal actualPrice = settlementLogisticsDto.getActualPrice();
@@ -217,7 +221,8 @@ public class KwpSettlementWalletService {
             kwpSettlementWallet.setEntId(settlementLogisticsDto.getEntId());
             kwpSettlementWallet.setSettlementId(settlementLogisticsDto.getId());
             kwpSettlementWallet.setOrderType(SettlementOrderTypeEnum.LOGISTICS.getStatus());
-            kwpSettlementWallet.setChannel(WalletChannelEnum.getValue(settlementLogisticsDto.getTrading()));//先用数字默认定义为1
+            //先用数字默认定义为1
+            kwpSettlementWallet.setChannel(WalletChannelEnum.getValue(settlementLogisticsDto.getTrading()));
             kwpSettlementWallet.setPayTime(LocalDateTime.now());
             kwpSettlementWallet.setPayPrice(price);
             kwpSettlementWallet.setTopayPrice(remainingReceivables);