This commit is contained in:
2024-04-01 09:57:23 +08:00
parent e45012b252
commit 4b4fe4f124
2 changed files with 22 additions and 11 deletions

View File

@@ -56,6 +56,7 @@ import com.jsowell.pile.mapper.PileBillingTemplateMapper;
import com.jsowell.pile.service.*;
import com.jsowell.pile.service.programlogic.AbstractProgramLogic;
import com.jsowell.pile.service.programlogic.ProgramLogicFactory;
import com.jsowell.pile.thirdparty.CommonParamsDTO;
import com.jsowell.pile.transaction.dto.OrderTransactionDTO;
import com.jsowell.pile.transaction.service.TransactionService;
import com.jsowell.pile.util.SnUtils;
@@ -71,12 +72,11 @@ import com.jsowell.service.PileService;
import com.jsowell.service.TempService;
import com.jsowell.thirdparty.amap.service.AMapService;
import com.jsowell.thirdparty.huawei.HuaWeiService;
import com.jsowell.pile.thirdparty.CommonParamsDTO;
import com.jsowell.thirdparty.lianlian.service.LianLianService;
import com.jsowell.thirdparty.lutongyunting.service.LTYTService;
import com.jsowell.thirdparty.platform.util.Cryptos;
import com.jsowell.thirdparty.platform.util.Encodes;
import com.jsowell.thirdparty.platform.util.GBSignUtils;
import com.jsowell.thirdparty.lutongyunting.service.LTYTService;
import com.jsowell.wxpay.common.WeChatPayParameter;
import com.jsowell.wxpay.dto.AppletTemplateMessageSendDTO;
import com.jsowell.wxpay.response.WechatPayRefundRequest;
@@ -595,14 +595,6 @@ public class SpringBootTestController {
return refundList;
}
public static void main(String[] args) {
BigDecimal totalAmount = new BigDecimal("0.1");
List<BigDecimal> payments = Lists.newArrayList(new BigDecimal("0.97"), new BigDecimal("1.00"));
List<BigDecimal> refunds = calculateRefund(totalAmount, payments);
System.out.println("每笔单需要退还的金额: " + refunds);
}
/**
* 测试多笔支付情况,解冻部分金额
*/
@@ -10028,4 +10020,23 @@ public class SpringBootTestController {
adapayService.createSettleAccountRequest(settleAccountDTO, adapayMemberId, wechatAppId);
}
public static void main(String[] args) {
String data = "{\"total\":1,\"stationStatusInfo\":{\"operationID\":\"123456789\",\"stationID\":\"111111111111111\",\"connectorStatusInfos\":{\"connectorID\":1,\"equipmentID\":\"10000000000000000000001\",\"status\":4,\"currentA\":0,\"currentB\":0,\"currentC\":0,\"voltageA\":0,\"voltageB\":0,\"voltageC\":0,\"soc\":10}}}";
String dataSecret = "1234567890abcdef";
String dataSecretIv = "1234567890abcdef";
// 加密数据
String encryptData = Cryptos.encrypt(JSON.toJSONString(data), dataSecret, dataSecretIv);
String encryptData2 = Cryptos.aesEncrypt(JSON.toJSONString(data), dataSecret, dataSecretIv);
System.out.println(StringUtils.equals(encryptData, encryptData2));
String str = "il7B0BSEjFdzpyKzfOFpvg/Se1CP802RItKYFPfSLRxJ3jf0bVl9hvYOEktPAYW2nd7S8MBcyHYyacHKbI" +
"Sq5iTmDzG+ivnR+SZJv3USNTYVMz9rCQVSxd0cLlqsJauko79NnwQJbzDTyLooYoIwz75qBOH2/x" +
"OMirpeEqRJrF/EQjWekJmGk9RtboXePu2rka+Xm51syBPhiXJAq0GfbfaFu9tNqs/e2Vjja/ltE1M0lq" +
"vxfXQ6da6HrThsm5id4ClZFIi0acRfrsPLRixS/IQYtksxghvJwbqOsbIsITail9Ayy4tKcogeEZiOO+4Ed2" +
"64NSKmk7l3wKwJLAFjCFogBx8GE3OBz4pqcAn/ydA=";
System.out.println(StringUtils.equals(encryptData, str));
System.out.println(StringUtils.equals(encryptData2, str));
}
}