Explorar o código

金额类型改为decimal,同步开始时间更新到20220810

lzm %!s(int64=3) %!d(string=hai) anos
pai
achega
47e0a5dec7

+ 1 - 1
sp-server/src/main/java/com/pj/api/pushfee/Demo.java

@@ -2,7 +2,7 @@ package com.pj.api.pushfee;
 
 import cn.hutool.core.date.DateUtil;
 import com.pj.api.pushfee.tools.EncryptTools;
-import tools.http.HttpUtils;
+import com.pj.api.pushfee.tools.http.HttpUtils;
 import com.pj.api.pushfee.tools.message.MessageInter;
 import com.pj.api.pushfee.tools.message.api.OdsOrderPayDetailDTO;
 import com.pj.api.pushfee.tools.message.api.OrderPayDetailMessage;

+ 6 - 5
sp-server/src/main/java/com/pj/api/pushfee/task/FeeDetailSyncTask.java

@@ -6,6 +6,7 @@ import cn.hutool.json.JSONObject;
 import cn.hutool.json.JSONUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.pj.api.pushfee.tools.EncryptTools;
+import com.pj.api.pushfee.tools.http.HttpUtils;
 import com.pj.api.pushfee.tools.message.api.OdsOrderPayDetailDTO;
 import com.pj.api.pushfee.tools.message.api.OrderPayDetailMessage;
 import com.pj.current.config.PartConfig;
@@ -93,7 +94,7 @@ public class FeeDetailSyncTask {
             //String response = "{\"msg\":\"测试\",\"code\":200,\"timestamp\":\"2022-07-27 18:13:17\"}";
             String response = "{}";
             try {
-                response = tools.http.HttpUtils.doPost(pushfeeConfig.getSyncUrl(), encryptMessage);
+                response = HttpUtils.doPost(pushfeeConfig.getSyncUrl(), encryptMessage);
                 log.info("pushfee_response: " + response);
             } catch (IOException e) {
                 log.error("pushfee_error: " + e.getMessage());
@@ -144,11 +145,11 @@ public class FeeDetailSyncTask {
                 .setCarNo(fd.getCarNo())
                 .setWeight(fd.getWeight() != null ? fd.getWeight()+"": "0")
                 .setNum(fd.getNum()+"")
-                .setPrice(fd.getUnitPrice().toString()).setTotalPrice(fd.getItemPrice().toString())
+                .setPrice(fd.getUnitPrice()).setTotalPrice(fd.getItemPrice())
                 .setSettleStatusName("已结算").setSettleStatusId(fd.getIsSettle()+"")
-                .setTaxRate(fd.getTaxRate().multiply(BigDecimal.valueOf(100)).toString())
-                .setTaxPayment(fd.getTaxPrice().toString())
-                .setTaxAmount(fd.getItemPrice().toString()).setNoTaxAmount(fd.getNoTaxPrice().toString())
+                .setTaxRate(fd.getTaxRate().multiply(BigDecimal.valueOf(100)))
+                .setTaxPayment(fd.getTaxPrice())
+                .setTaxAmount(fd.getItemPrice()).setNoTaxAmount(fd.getNoTaxPrice())
                 .setPaymentWayName("微信支付").setPaymentWayId(fd.getPayType()+"")
                 .setSysSerialNo(fd.getOutTradeNo())
                 .setPayNo(fd.getTransactionId())

+ 1 - 1
sp-server/src/main/java/com/pj/api/pushfee/tools/http/HttpUtils.java

@@ -1,4 +1,4 @@
-package tools.http;
+package com.pj.api.pushfee.tools.http;
 
 import org.apache.http.HttpEntity;
 import org.apache.http.HttpResponse;

+ 7 - 6
sp-server/src/main/java/com/pj/api/pushfee/tools/message/api/OdsOrderPayDetailDTO.java

@@ -5,6 +5,7 @@ import lombok.NoArgsConstructor;
 import lombok.experimental.Accessors;
 
 import java.io.Serializable;
+import java.math.BigDecimal;
 
 @Data
 @NoArgsConstructor
@@ -48,9 +49,9 @@ public class OdsOrderPayDetailDTO implements Serializable {
 
     private String num;
 
-    private String price;
+    private BigDecimal price;
 
-    private String totalPrice;
+    private BigDecimal totalPrice;
 
     private String settleStatusId;
 
@@ -60,13 +61,13 @@ public class OdsOrderPayDetailDTO implements Serializable {
 
     private String checkStatusName;
 
-    private String taxRate;
+    private BigDecimal taxRate;
 
-    private String taxPayment;
+    private BigDecimal taxPayment;
 
-    private String taxAmount;
+    private BigDecimal taxAmount;
 
-    private String noTaxAmount;
+    private BigDecimal noTaxAmount;
 
     private String paymentWayId;