add paymentAmount logic

This commit is contained in:
Carl 2022-01-28 15:47:23 +08:00
parent 9b1f623be0
commit d42c9546ec
2 changed files with 11 additions and 7 deletions

View File

@ -15,6 +15,7 @@ import net.lab1024.smartadmin.module.system.wxpay.wxPayModel.WxPayEntity;
import net.lab1024.smartadmin.util.MapRemoveNullUtil;
import net.lab1024.smartadmin.util.SmartHttpUtil;
import net.lab1024.smartadmin.util.SmartIPUtil;
import org.apache.poi.hpsf.Decimal;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -24,9 +25,11 @@ import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.math.BigDecimal;
import java.net.Inet4Address;
import java.net.InetAddress;
import java.net.URLEncoder;
import java.text.DecimalFormat;
import java.util.*;
@Service
@ -117,7 +120,8 @@ public class WxpayService {
// 更新订单状态
if ("SUCCESS".equals(sortedMap.get("result_code"))) {
String outTradeNo = sortedMap.get("out_trade_no"); // 流水号
String totalFee = sortedMap.get("total_fee"); // 交易金额
DecimalFormat df = new DecimalFormat("0.00");
String totalFee = StringUtil.toString(df.format(df.format(Double.parseDouble(sortedMap.get("total_fee")) / 100))); // 交易金额
OrderEntity orderEntity = orderService.findByOrderId(outTradeNo);
String [] products = orderEntity.getProductCode().split(",");
ProductMasterQueryEntity productMasterQueryEntity = new ProductMasterQueryEntity();

View File

@ -1,10 +1,10 @@
######################### server ###################
server.servlet.context-path=/smart-admin-api
server.port=10088
server.servlet.context-path=/royalcanin
server.port=10086
spring.profiles.active=@profiles.active@
######################### tomcat ###################
server.tomcat.basedir=/home/logs/smart-admin/tomcat-logs
server.tomcat.basedir=/home/royalcanin-prod/tomcat-9/smart-admin/tomcat-logs
server.tomcat.accesslog.enabled=true
server.tomcat.accesslog.pattern=%t %{X-Forwarded-For}i %a "%r" %s %D (%D ms)
@ -23,9 +23,9 @@ spring.servlet.multipart.max-request-size=30MB
file-upload-service.path=/home/upload/smart-admin-file
######################### database #########################
spring.datasource.url=jdbc:mysql://172.16.0.201:3306/smart-admin-prod?autoReconnect=true&useServerPreparedStmts=false&rewriteBatchedStatements=true&characterEncoding=UTF-8&useSSL=false&allowMultiQueries=true
spring.datasource.username=smart-admin
spring.datasource.password=Admin@123457
spring.datasource.url=jdbc:mysql://rc-hub-mysql.mysql.database.chinacloudapi.cn/smart-admin-prod?autoReconnect=true&useServerPreparedStmts=false&rewriteBatchedStatements=true&characterEncoding=UTF-8&useSSL=false&allowMultiQueries=true
spring.datasource.username=azureuser@rc-hub-mysql
spring.datasource.password=(G=q0D5ez2Fz
spring.datasource.initial-size=2
spring.datasource.min-idle=1
spring.datasource.max-active=100