mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 02:55:04 +08:00
3955 lines
184 KiB
Java
3955 lines
184 KiB
Java
import cn.hutool.json.JSONUtil;
|
||
import com.alibaba.fastjson2.JSON;
|
||
import com.alibaba.fastjson2.JSONArray;
|
||
import com.alibaba.fastjson2.JSONObject;
|
||
import com.alipay.easysdk.factory.Factory;
|
||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||
import com.fasterxml.jackson.databind.PropertyNamingStrategies;
|
||
import com.google.common.collect.ImmutableMap;
|
||
import com.google.common.collect.Lists;
|
||
import com.google.common.collect.Maps;
|
||
import com.google.common.collect.Sets;
|
||
import com.google.common.primitives.Bytes;
|
||
import com.huifu.adapay.core.exception.BaseAdaPayException;
|
||
import com.huifu.adapay.model.Payment;
|
||
import com.huifu.adapay.model.PaymentReverse;
|
||
import com.huifu.adapay.model.Refund;
|
||
import com.jsowell.JsowellApplication;
|
||
import com.jsowell.adapay.common.DivMember;
|
||
import com.jsowell.adapay.config.AbstractAdapayConfig;
|
||
import com.jsowell.adapay.dto.*;
|
||
import com.jsowell.adapay.factory.AdapayConfigFactory;
|
||
import com.jsowell.adapay.operation.PaymentReverseOperation;
|
||
import com.jsowell.adapay.response.*;
|
||
import com.jsowell.adapay.service.AdapayService;
|
||
import com.jsowell.adapay.vo.AdapayCorpMemberVO;
|
||
import com.jsowell.adapay.vo.DrawCashDetailVO;
|
||
import com.jsowell.adapay.vo.PaymentInfo;
|
||
import com.jsowell.common.constant.CacheConstants;
|
||
import com.jsowell.common.constant.Constants;
|
||
import com.jsowell.common.constant.RabbitConstants;
|
||
import com.jsowell.common.core.domain.entity.SysDictData;
|
||
import com.jsowell.common.core.domain.ykc.LoginRequestData;
|
||
import com.jsowell.common.core.domain.ykc.TransactionRecordsData;
|
||
import com.jsowell.common.core.redis.RedisCache;
|
||
import com.jsowell.common.enums.AcquirerEnum;
|
||
import com.jsowell.common.enums.DelFlagEnum;
|
||
import com.jsowell.common.enums.thirdparty.ThirdPlatformTypeEnum;
|
||
import com.jsowell.common.enums.ykc.*;
|
||
import com.jsowell.common.exception.BusinessException;
|
||
import com.jsowell.common.util.*;
|
||
import com.jsowell.common.util.Cp56Time2a.Cp56Time2aUtil;
|
||
import com.jsowell.common.util.http.HttpUtils;
|
||
import com.jsowell.common.util.id.IdUtils;
|
||
import com.jsowell.common.util.id.SnowflakeIdWorker;
|
||
import com.jsowell.common.util.ip.AddressUtils;
|
||
import com.jsowell.netty.handler.yunkuaichong.HeartbeatRequestHandler;
|
||
import com.jsowell.netty.handler.yunkuaichong.TransactionRecordsRequestHandler;
|
||
import com.jsowell.netty.service.camera.impl.CameraBusinessServiceImpl;
|
||
import com.jsowell.netty.service.yunkuaichong.YKCBusinessService;
|
||
import com.jsowell.pile.domain.*;
|
||
import com.jsowell.pile.domain.ykcCommond.IssueQRCodeCommand;
|
||
import com.jsowell.pile.domain.ykcCommond.ProofreadTimeCommand;
|
||
import com.jsowell.pile.dto.*;
|
||
import com.jsowell.pile.dto.amap.GetStationInfoDTO;
|
||
import com.jsowell.pile.dto.lutongyunting.BindCouponDTO;
|
||
import com.jsowell.pile.mapper.MemberBasicInfoMapper;
|
||
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.vo.base.ConnectorInfoVO;
|
||
import com.jsowell.pile.vo.base.MemberWalletVO;
|
||
import com.jsowell.pile.vo.base.PileInfoVO;
|
||
import com.jsowell.pile.vo.uniapp.customer.*;
|
||
import com.jsowell.pile.vo.web.*;
|
||
import com.jsowell.service.MemberService;
|
||
import com.jsowell.service.OrderService;
|
||
import com.jsowell.service.PileService;
|
||
import com.jsowell.service.TempService;
|
||
import com.jsowell.thirdparty.amap.service.AMapService;
|
||
import com.jsowell.thirdparty.common.NotificationDTO;
|
||
import com.jsowell.thirdparty.common.NotificationService;
|
||
import com.jsowell.thirdparty.huawei.HuaWeiService;
|
||
import com.jsowell.thirdparty.lianlian.service.LianLianService;
|
||
import com.jsowell.thirdparty.lutongyunting.service.LTYTService;
|
||
import com.jsowell.thirdparty.platform.service.ThirdPartyPlatformService;
|
||
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.zhongdianlian.service.ZDLService;
|
||
import com.jsowell.wxpay.common.WeChatPayParameter;
|
||
import com.jsowell.wxpay.dto.AppletTemplateMessageSendDTO;
|
||
import com.jsowell.wxpay.response.WechatPayRefundRequest;
|
||
import com.jsowell.wxpay.service.WxAppletRemoteService;
|
||
import org.apache.commons.collections4.CollectionUtils;
|
||
import org.apache.commons.lang3.RandomStringUtils;
|
||
import org.junit.Test;
|
||
import org.junit.runner.RunWith;
|
||
import org.slf4j.Logger;
|
||
import org.slf4j.LoggerFactory;
|
||
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
||
import org.springframework.beans.factory.annotation.Autowired;
|
||
import org.springframework.beans.factory.annotation.Qualifier;
|
||
import org.springframework.boot.test.context.SpringBootTest;
|
||
import org.springframework.test.context.ActiveProfiles;
|
||
import org.springframework.test.context.junit4.SpringRunner;
|
||
import org.springframework.util.StopWatch;
|
||
|
||
import java.io.UnsupportedEncodingException;
|
||
import java.math.BigDecimal;
|
||
import java.nio.charset.StandardCharsets;
|
||
import java.text.ParseException;
|
||
import java.text.SimpleDateFormat;
|
||
import java.util.*;
|
||
import java.util.stream.Collectors;
|
||
|
||
@ActiveProfiles("dev")
|
||
@SpringBootTest(classes = JsowellApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
|
||
@RunWith(SpringRunner.class)
|
||
public class SpringBootTestController {
|
||
protected final Logger logger = LoggerFactory.getLogger(this.getClass());
|
||
|
||
private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||
|
||
String wechatAppId1 = "wxbb3e0d474569481d"; // 万车充
|
||
|
||
String wechatAppId2 = "wx20abc5210391649c"; // 嘉佳充电
|
||
|
||
@Autowired
|
||
private PileSnGenerateService snUtils;
|
||
|
||
@Autowired
|
||
private PileService pileService;
|
||
|
||
@Autowired
|
||
private YKCPushCommandService ykcPushCommandService;
|
||
|
||
@Autowired
|
||
private AdapayMemberAccountService adapayMemberAccountService;
|
||
|
||
@Autowired
|
||
private PileMsgRecordService pileMsgRecordService;
|
||
|
||
@Autowired
|
||
private PileStationInfoService pileStationInfoService;
|
||
|
||
@Autowired
|
||
private YKCPushCommandService ykcPushBusinessService;
|
||
|
||
@Autowired
|
||
private HeartbeatRequestHandler heartbeatRequestHandler;
|
||
|
||
@Autowired
|
||
private YKCBusinessService ykcBusinessService;
|
||
|
||
@Autowired
|
||
private PileBillingTemplateMapper pileBillingTemplateMapper;
|
||
|
||
@Autowired
|
||
private PileRemoteService pileRemoteService;
|
||
|
||
@Autowired
|
||
private MemberService memberService;
|
||
|
||
@Autowired
|
||
private StationSplitConfigService stationSplitConfigService;
|
||
|
||
@Autowired
|
||
private OrderService orderService;
|
||
|
||
@Autowired
|
||
private PileBillingTemplateService pileBillingTemplateService;
|
||
|
||
@Autowired
|
||
private MemberBasicInfoMapper memberBasicInfoMapper;
|
||
|
||
@Autowired
|
||
private SimCardService simCardService;
|
||
|
||
@Autowired
|
||
private PileBasicInfoService pileBasicInfoService;
|
||
|
||
@Autowired
|
||
private WechatPayService wechatPayService;
|
||
|
||
@Autowired
|
||
private OrderBasicInfoService orderBasicInfoService;
|
||
|
||
@Autowired
|
||
private WxpayCallbackRecordService wxpayCallbackRecordService;
|
||
|
||
@Autowired
|
||
private WxAppletRemoteService wxAppletRemoteService;
|
||
|
||
@Autowired
|
||
private RedisCache redisCache;
|
||
|
||
@Autowired
|
||
private PileAuthCardService pileAuthCardService;
|
||
|
||
@Autowired
|
||
private LianLianService lianLianService;
|
||
|
||
@Autowired
|
||
private MemberPlateNumberRelationService memberPlateNumberRelationService;
|
||
|
||
static final String MAC_KEY = "53TtFpc4gdVZbF3x";
|
||
|
||
static final String ALGORITHM_MAC = "HmacMD5";
|
||
|
||
@Autowired
|
||
private AdapayCallbackRecordService adapayCallbackRecordService;
|
||
|
||
@Autowired
|
||
private AdapayRefundRecordService adapayRefundRecordService;
|
||
|
||
@Autowired
|
||
private AdapayService adapayService;
|
||
|
||
@Autowired
|
||
private AMapService aMapService;
|
||
|
||
@Autowired
|
||
private PileConnectorInfoService pileConnectorInfoService;
|
||
|
||
@Autowired
|
||
private TransactionRecordsRequestHandler transactionRecordsRequestHandler;
|
||
|
||
@Autowired
|
||
private MemberBasicInfoService memberBasicInfoService;
|
||
|
||
@Autowired
|
||
private ClearingWithdrawInfoService clearingWithdrawInfoService;
|
||
|
||
@Autowired
|
||
private OrderPileOccupyService orderPileOccupyService;
|
||
|
||
@Autowired
|
||
private CameraBusinessServiceImpl cameraBusinessServiceImpl;
|
||
|
||
@Autowired
|
||
private LTYTService ltytService;
|
||
|
||
@Autowired
|
||
private PileMerchantInfoService pileMerchantInfoService;
|
||
|
||
@Autowired
|
||
private MemberAdapayRecordService memberAdapayRecordService;
|
||
|
||
@Autowired
|
||
private TransactionService transactionService;
|
||
|
||
@Autowired
|
||
private OrderPayRecordService orderPayRecordService;
|
||
|
||
@Autowired
|
||
private TempService tempService;
|
||
|
||
@Autowired
|
||
private MemberWalletInfoService memberWalletInfoService;
|
||
|
||
@Autowired
|
||
private MemberGroupService memberGroupService;
|
||
|
||
@Autowired
|
||
private HuaWeiService huaWeiService;
|
||
|
||
@Autowired
|
||
private NotificationService notificationService;
|
||
|
||
@Autowired
|
||
private PileReservationInfoService pileReservationInfoService;
|
||
|
||
@Autowired
|
||
private ZDLService zdlService;
|
||
|
||
@Autowired
|
||
private PileSnGenerateService pileSnGenerateService;
|
||
|
||
@Autowired
|
||
private CarCouponRecordService carCouponRecordService;
|
||
|
||
@Autowired
|
||
private RabbitTemplate rabbitTemplate;
|
||
|
||
@Qualifier("zhongDianLianPlatformServiceImpl")
|
||
private ThirdPartyPlatformService platformLogic;
|
||
|
||
@Test
|
||
public void saveSOCTest() {
|
||
String transactionCode = "12345";
|
||
YKCUtils.saveSOC(transactionCode, "4");
|
||
YKCUtils.saveSOC(transactionCode, "1");
|
||
YKCUtils.saveSOC(transactionCode, "3");
|
||
YKCUtils.saveSOC(transactionCode, "5");
|
||
YKCUtils.saveSOC(transactionCode, "10");
|
||
YKCUtils.saveSOC(transactionCode, "20");
|
||
YKCUtils.saveSOC(transactionCode, "19.9");
|
||
YKCUtils.saveSOC(transactionCode, "29.9");
|
||
System.out.println(redisCache.getCacheMap(CacheConstants.GET_THE_SOC + transactionCode));
|
||
}
|
||
|
||
@Test
|
||
public void queryStationStatus() {
|
||
QueryStationInfoDTO dto = new QueryStationInfoDTO();
|
||
dto.setStationIds(Lists.newArrayList("19"));
|
||
Map<String, String> map = platformLogic.queryStationStatus(dto);
|
||
System.out.println(map);
|
||
}
|
||
|
||
@Test
|
||
public void batchSelectConnectorList() {
|
||
ArrayList<String> stationIds = Lists.newArrayList("19", "2", "14");
|
||
List<ConnectorInfoVO> connectorInfoVOS = pileConnectorInfoService.batchSelectConnectorList(stationIds);
|
||
System.out.println(connectorInfoVOS);
|
||
}
|
||
|
||
@Test
|
||
public void selectPileConnectorInfoListByPileSnListTest() {
|
||
List<String> pileSnList = Lists.newArrayList();
|
||
pileSnList.add("88230000000249");
|
||
pileSnList.add("88230000000573");
|
||
pileSnList.add("88230000000735");
|
||
pileSnList.add("88230000001122");
|
||
pileSnList.add("88230000001124");
|
||
pileSnList.add("88230000001125");
|
||
pileSnList.add("88230000001126");
|
||
pileSnList.add("88230000001127");
|
||
pileSnList.add("88230000001128");
|
||
pileSnList.add("88230000001129");
|
||
pileSnList.add("88230000001130");
|
||
pileSnList.add("88230000001131");
|
||
|
||
// pileConnectorInfoService.selectPileConnectorInfoList("88000000000028");
|
||
// Map<String, String> pileStatus = pileConnectorInfoService.getPileStatus(pileSnList);
|
||
|
||
Map<String, String> pileStatusV2 = pileConnectorInfoService.getPileStatusV2(pileSnList);
|
||
}
|
||
|
||
@Test
|
||
public void sendRabbitMqTest() {
|
||
OrderBasicInfo orderBasicInfo = OrderBasicInfo.builder()
|
||
.orderCode("C123456789")
|
||
.merchantId("1")
|
||
.stationId("2")
|
||
.payAmount(new BigDecimal(100))
|
||
.orderAmount(new BigDecimal(100))
|
||
.settleAmount(new BigDecimal(100))
|
||
.refundAmount(new BigDecimal(0))
|
||
.build();
|
||
OrderDetail orderDetail = OrderDetail.builder()
|
||
.totalElectricityAmount(new BigDecimal(50))
|
||
.discountElectricityAmount(new BigDecimal(0))
|
||
.totalServiceAmount(new BigDecimal(50))
|
||
.discountElectricityAmount(new BigDecimal(0))
|
||
.build();
|
||
|
||
AfterSettleOrderDTO afterSettleOrderDTO = AfterSettleOrderDTO.builder()
|
||
.orderCode(orderBasicInfo.getOrderCode())
|
||
.merchantId(orderBasicInfo.getMerchantId())
|
||
.stationId(orderBasicInfo.getStationId())
|
||
.orderPayAmount(orderBasicInfo.getPayAmount())
|
||
.orderConsumeAmount(orderBasicInfo.getOrderAmount())
|
||
.orderSettleAmount(orderBasicInfo.getSettleAmount())
|
||
.orderElectricityAmount(orderDetail.getTotalElectricityAmount())
|
||
.orderElectricityDiscountAmount(orderDetail.getDiscountElectricityAmount())
|
||
.orderServiceAmount(orderDetail.getTotalServiceAmount())
|
||
.orderServiceDiscountAmount(orderDetail.getDiscountServiceAmount())
|
||
.orderRefundAmount(orderBasicInfo.getRefundAmount())
|
||
.build();
|
||
|
||
for (int i = 0; i < 10; i++) {
|
||
rabbitTemplate.convertAndSend(RabbitConstants.YKC_EXCHANGE_NAME, RabbitConstants.QUEUE_CHARGE_ORDER_DATA, afterSettleOrderDTO);
|
||
}
|
||
}
|
||
|
||
@Test
|
||
public void getEBikePileSnTest() {
|
||
List<String> strings = pileSnGenerateService.generateEBikeSN(8);
|
||
System.out.println(strings);
|
||
}
|
||
|
||
@Test
|
||
public void testInsetCarCoupon() {
|
||
CarCouponRecord carCouponRecord = new CarCouponRecord();
|
||
carCouponRecord.setOrderCode("123456");
|
||
carCouponRecord.setReturnCode("10004");
|
||
carCouponRecord.setReturnMsg("该车牌已领取过该券包中的优惠券");
|
||
carCouponRecord.setPlateNumber("粤BD26691");
|
||
carCouponRecord.setStationId(Long.parseLong("19"));
|
||
|
||
carCouponRecordService.insertCarCouponRecord(carCouponRecord);
|
||
}
|
||
|
||
@Test
|
||
public void getListByMemberIdAndOrderStatusTest() {
|
||
String memberId = "12345678";
|
||
List<String> orderStatusList = Lists.newArrayList();
|
||
List<OrderVO> list = orderBasicInfoService.getListByMemberIdAndOrderStatus(memberId, orderStatusList);
|
||
System.out.println(list);
|
||
}
|
||
|
||
@Test
|
||
public void selectPileDetailByPileSnTest() {
|
||
String pileSn = "13273881";
|
||
// 查询桩信息
|
||
PileDetailVO pileDetailVO = pileBasicInfoService.selectPileDetailByPileSn(pileSn);
|
||
System.out.println(pileDetailVO);
|
||
}
|
||
|
||
@Test
|
||
public void thirdPartyTest() {
|
||
QueryStationInfoDTO dto = new QueryStationInfoDTO();
|
||
dto.setOperatorId("14405899X");
|
||
dto.setThirdPlatformType(ThirdPlatformTypeEnum.NING_BO_PLATFORM.getTypeCode());
|
||
zdlService.queryStationsInfo(dto);
|
||
}
|
||
|
||
|
||
@Test
|
||
public void personPileStopChargingTest() {
|
||
String memberId = "84085683";
|
||
String pileConnectorCode = "8823000000141001";
|
||
PersonPileStopChargingDTO dto = PersonPileStopChargingDTO.builder()
|
||
.memberId(memberId)
|
||
.pileConnectorCode(pileConnectorCode)
|
||
.build();
|
||
pileReservationInfoService.personPileStopCharging(dto);
|
||
}
|
||
|
||
@Test
|
||
public void selectMemberPlateNumberRelationTest() {
|
||
String memberId = "25950857";
|
||
List<MemberPlateNumberVO> plateNumberVOList = memberPlateNumberRelationService.selectMemberPlateNumberRelation(memberId);
|
||
System.out.println(JSON.toJSONString(plateNumberVOList));
|
||
}
|
||
|
||
@Test
|
||
public void activateReservedTest() {
|
||
PileReservationDTO dto = new PileReservationDTO();
|
||
dto.setReservedId("15");
|
||
dto.setMemberId("25950857");
|
||
// 启用
|
||
pileReservationInfoService.activateReserved(dto);
|
||
}
|
||
|
||
@Test
|
||
public void payOrderV2Test() {
|
||
String s = "{\n" +
|
||
" \"alipayAppId\": \"2021004145642756\",\n" +
|
||
" \"code\": \"10bb693b0f2346dcb9b70d92322dNC91\",\n" +
|
||
" \"goodsDesc\": \"充电桩预付款金额\",\n" +
|
||
" \"goodsTitle\": \"充电费用\",\n" +
|
||
" \"lockValue\": \"f0f6a356-a720-49d1-ad21-bb685af91703\",\n" +
|
||
" \"memberId\": \"65622699\",\n" +
|
||
" \"orderCode\": \"C84239627240\",\n" +
|
||
" \"payAmount\": 50,\n" +
|
||
" \"payMode\": \"5\",\n" +
|
||
" \"requestSource\": \"alipay_lite\",\n" +
|
||
" \"type\": \"order\"\n" +
|
||
"}";
|
||
PayOrderDTO dto = JSON.parseObject(s, PayOrderDTO.class);
|
||
orderService.payOrderV2(dto);
|
||
}
|
||
|
||
@Test
|
||
public void queryPaymentReverseTest2() {
|
||
String paymentId = "002212024061717243610648707836701741056";
|
||
try {
|
||
adapayService.queryPaymentReverse(paymentId, wechatAppId1);
|
||
} catch (BaseAdaPayException e) {
|
||
throw new RuntimeException(e);
|
||
}
|
||
}
|
||
|
||
@Test
|
||
public void createBalancePaymentRequestTest() {
|
||
String outMemberId = "ACM42875164"; // 出账memberId
|
||
String inMemberId = "0"; // 入账memberId
|
||
String transAmt = "798.20"; // 金额
|
||
String title = "提取余额到自己账户"; // 标题
|
||
String desc = "2024年7月31日08点55分,售后需求:客户重新添加结算账户, 原账户余额无法提取, 由现下打款给客户"; // 描述
|
||
String wechatAppId = wechatAppId1; // 万车充id
|
||
adapayService.createBalancePaymentRequest(outMemberId, inMemberId, transAmt, title, desc, wechatAppId);
|
||
}
|
||
|
||
/**
|
||
*
|
||
*/
|
||
@Test
|
||
public void createBalancePaymentRequestTest2() {
|
||
String outMemberId = "0"; // 出账memberId
|
||
String inMemberId = "ACM25158725"; // 入账memberId
|
||
String transAmt = "42.7"; // 金额
|
||
String title = "订单金额补分账"; // 标题
|
||
String desc = "补C69401257710,C86364369573结算金额"; // 描述
|
||
String wechatAppId = wechatAppId1; // 万车充id
|
||
adapayService.createBalancePaymentRequest(outMemberId, inMemberId, transAmt, title, desc, wechatAppId);
|
||
}
|
||
|
||
@Test
|
||
public void decryptPhoneNum() throws Exception {
|
||
|
||
String content = "/CunEGSbDxsQaKllc35Q+4lJdLiprZhrHFt9er/ZriETVHv2IrtZsmC8cA6DE5l8GgzvgHCPdGp1iUJQhNyKog==";
|
||
// 通过密文解密 获取手机号码
|
||
String mobileNumber = Factory.Util.AES().decrypt(content);
|
||
System.out.println(mobileNumber);
|
||
}
|
||
|
||
@Test
|
||
public void getOrderRefundInfoListTest() {
|
||
String orderCode = "C44565166677";
|
||
OrderBasicInfo orderBasicInfo = new OrderBasicInfo();
|
||
orderBasicInfo.setOrderCode(orderCode);
|
||
orderBasicInfo.setMerchantId("33");
|
||
orderBasicInfo.setPayMode("4");
|
||
// 查询退款明细
|
||
List<OrderDetailInfoVO.OrderRefundInfo> orderRefundInfoList = orderBasicInfoService.getOrderRefundInfoList(orderBasicInfo);
|
||
System.out.println(JSON.toJSONString(orderRefundInfoList));
|
||
}
|
||
|
||
@Test
|
||
public void getSnowflakeIdTest() {
|
||
for (int i = 0; i < 100; i++) {
|
||
String snowflakeId = SnowflakeIdWorker.getSnowflakeId();
|
||
System.out.println("第" + i + "个snowflakeId:" + snowflakeId);
|
||
}
|
||
}
|
||
|
||
@Test
|
||
public void getOrderCodeTest() {
|
||
for (int i = 0; i < 10; i++) {
|
||
String orderCode = IdUtils.getOrderCode();
|
||
System.out.println("第" + i + 1 + "个orderCode:" + orderCode);
|
||
}
|
||
}
|
||
|
||
@Test
|
||
public void notificationStationInfoTest() {
|
||
String stationId = "19";
|
||
NotificationDTO dto = new NotificationDTO();
|
||
dto.setStationId(stationId);
|
||
dto.setPlatformType("1");
|
||
notificationService.notificationStationInfo(dto);
|
||
}
|
||
|
||
@Test
|
||
public void queryBillingPriceTest() {
|
||
String stationId = "1";
|
||
// List<BillingPriceVO> billingPriceVOS = pileBillingTemplateService.queryBillingPriceOld(stationId);
|
||
// System.out.println("老版:" + JSON.toJSONString(billingPriceVOS));
|
||
//
|
||
List<BillingPriceVO> billingPriceVOS1 = pileBillingTemplateService.queryBillingPrice(stationId);
|
||
System.out.println("新版:" + JSON.toJSONString(billingPriceVOS1));
|
||
|
||
// CurrentTimePriceDetails currentTimePriceDetails = pileBillingTemplateService.getCurrentTimePriceDetails(stationId);
|
||
// System.out.println("currentTimePriceDetails:" + JSON.toJSONString(currentTimePriceDetails));
|
||
}
|
||
|
||
@Test
|
||
public void queryPaymentRefundTest() {
|
||
String paymentId = "002212023122615542010585629628950949888";
|
||
try {
|
||
adapayService.queryPaymentRefund(paymentId, wechatAppId2);
|
||
} catch (BaseAdaPayException e) {
|
||
throw new RuntimeException(e);
|
||
}
|
||
}
|
||
|
||
@Test
|
||
public void testnotificationOperationSystemInfo() {
|
||
// HWStationInfo hwStationInfo = huaWeiService.notificationOperationSystemInfo("19");
|
||
// String s = JSON.toJSONString(hwStationInfo);
|
||
// System.out.println(s);
|
||
}
|
||
|
||
@Test
|
||
public void selectByMemberWalletListTest() {
|
||
String memberId = "12345678";
|
||
List<MemberWalletVO> memberWalletVOS = memberWalletInfoService.selectByMemberWalletList(memberId);
|
||
System.out.println(JSON.toJSONString(memberWalletVOS));
|
||
}
|
||
|
||
@Test
|
||
public void testMqttSendMsg() throws InterruptedException {
|
||
String channelId = "94dd42b6";
|
||
String topic = "/GroundlockStatus";
|
||
JSONObject jsonObject = new JSONObject();
|
||
jsonObject.put("sign","F4213AD90EBC72C678E03450E4E091EE");
|
||
jsonObject.put("sn","e27f089d-5fadf6c6");
|
||
jsonObject.put("timestamp","2021-07-01 12:00:01");
|
||
jsonObject.put("msg_id","GS2021070112000101");
|
||
jsonObject.put("msg_type","GroundlockStatus");
|
||
jsonObject.put("msg_data",null);
|
||
|
||
// ChannelFuture future = cameraBusinessServiceImpl.sendMsg(channelId, topic, JSON.toJSONString());
|
||
// System.out.println(future.toString());
|
||
}
|
||
|
||
@Test
|
||
public void testDeliverEquipBusinessPolicy() {
|
||
|
||
String result = huaWeiService.deliverEquipBusinessPolicy("test123451694073123456", "8823000000073501");
|
||
|
||
System.out.println(result);
|
||
}
|
||
|
||
|
||
@Test
|
||
public void queryPaymentByOrderNoTest() {
|
||
String orderNo = "C88850447008_20240415083226";
|
||
String orderCode = orderNo.substring(0, orderNo.indexOf("_"));
|
||
String wechatAppId = wechatAppId1;
|
||
try {
|
||
// List<AdaPayment> adaPayments = adapayService.queryPaymentsByOrderNo(orderNo, wechatAppId);
|
||
// System.out.println(JSON.toJSONString(adaPayments));
|
||
|
||
Set<PaymentInfo> paymentInfoSet = Sets.newHashSet();
|
||
|
||
List<PaymentInfo> paymentInfos = adapayService.queryPaymentInfosByOrderNo(orderNo, wechatAppId);
|
||
paymentInfoSet.addAll(paymentInfos);
|
||
System.out.println("1111:" + JSON.toJSONString(paymentInfos));
|
||
|
||
List<OrderPayRecord> orderPayRecordList = orderPayRecordService.getOrderPayRecordList(orderCode);
|
||
if (CollectionUtils.isNotEmpty(orderPayRecordList)) {
|
||
for (OrderPayRecord orderPayRecord : orderPayRecordList) {
|
||
List<PaymentInfo> paymentInfos2 = orderPayRecordService.parseDeductionRecord(orderPayRecord.getDeductionRecord());
|
||
paymentInfoSet.addAll(paymentInfos2);
|
||
System.out.println("2222:" + JSON.toJSONString(paymentInfos2));
|
||
}
|
||
}
|
||
|
||
System.out.println("set:" + JSON.toJSONString(paymentInfoSet));
|
||
|
||
} catch (BaseAdaPayException e) {
|
||
throw new RuntimeException(e);
|
||
}
|
||
}
|
||
|
||
@Test
|
||
public void checkPaymentTest() {
|
||
QueryOrderDTO dto = new QueryOrderDTO();
|
||
String startTime = "2023-09-01 00:00:00";
|
||
String endTime = "2023-09-30 23:59:59";
|
||
dto.setStartTime(startTime);
|
||
dto.setEndTime(endTime);
|
||
|
||
try {
|
||
tempService.checkPayment(dto);
|
||
} catch (BaseAdaPayException e) {
|
||
throw new RuntimeException(e);
|
||
}
|
||
}
|
||
|
||
@Test
|
||
public void toStringTest() {
|
||
String jsonString = "{\"business\":\"00\",\"communicationVersion\":\"v1.5\",\"connectorNum\":\"01\",\"iccid\":\"89860620180085681816\",\"internetConnection\":\"00\",\"pileSn\":\"88230000000259\",\"pileType\":\"01\",\"programVersion\":\"gyk-V29\\u0000\"}";
|
||
LoginRequestData loginRequestData = JSONObject.parseObject(jsonString, LoginRequestData.class);
|
||
System.out.println(loginRequestData.toString());
|
||
}
|
||
|
||
/**
|
||
* 单元测试,测试订单流程
|
||
*/
|
||
@Test
|
||
public void testTheOrderProcess() throws Exception {
|
||
// 生成订单
|
||
// OrderBasicInfo orderBasicInfo = generateAnOrder();
|
||
// System.out.println(orderBasicInfo);
|
||
// // 支付订单
|
||
// int a = payOrder(orderBasicInfo);
|
||
// System.out.println(a);
|
||
// 结算订单
|
||
OrderBasicInfo orderBasicInfo = orderBasicInfoService.getOrderInfoByOrderCode("C46006767636");
|
||
settleOrder(orderBasicInfo);
|
||
// 订单退款
|
||
BigDecimal payAmount = orderBasicInfo.getPayAmount();
|
||
BigDecimal settleAmount = orderBasicInfo.getSettleAmount();
|
||
|
||
BigDecimal refundAmt = payAmount.subtract(settleAmount);
|
||
// 延时分账的,可以部分解冻
|
||
memberAdapayRecordService.updateRefundAmountFromFreezeAmount("1234", refundAmt);
|
||
|
||
// 实时分账,全部解冻
|
||
// memberAdapayRecordService.unfreezeAmountAndUpdateSpendAmount("test01", payAmount, refundAmt);
|
||
}
|
||
|
||
@Test
|
||
public void selectBillingTemplateDetailByPileSnTest() {
|
||
String pileSn = "88000000000001";
|
||
// 查询充电桩的计费模板
|
||
BillingTemplateVO billingTemplateVO = pileBillingTemplateService.selectBillingTemplateDetailByPileSn(pileSn);
|
||
System.out.println(JSON.toJSONString(billingTemplateVO));
|
||
}
|
||
|
||
// 生成订单
|
||
private OrderBasicInfo generateAnOrder() throws ParseException {
|
||
GenerateOrderDTO dto = new GenerateOrderDTO();
|
||
PileConnectorDetailVO vo = new PileConnectorDetailVO();
|
||
vo.setStationId("2");
|
||
dto.setPileConnector(vo);
|
||
|
||
dto.setMemberId("1");
|
||
dto.setStartMode("1");
|
||
dto.setPayMode("4");
|
||
dto.setPileSn("88000000000001");
|
||
dto.setConnectorCode("01");
|
||
dto.setChargeAmount(new BigDecimal("10"));
|
||
// 查询充电桩的计费模板
|
||
BillingTemplateVO billingTemplateVO = pileBillingTemplateService.selectBillingTemplateDetailByPileSn(dto.getPileSn());
|
||
dto.setBillingTemplate(billingTemplateVO);
|
||
OrderBasicInfo orderBasicInfo = orderBasicInfoService.saveOrderForEV(dto);
|
||
|
||
return orderBasicInfo;
|
||
}
|
||
|
||
// 支付订单
|
||
private int payOrder(OrderBasicInfo orderBasicInfo) throws Exception {
|
||
// PayOrderDTO dto = new PayOrderDTO();
|
||
// dto.setMemberId(orderBasicInfo.getMemberId());
|
||
// dto.setOrderCode(orderBasicInfo.getOrderCode());
|
||
// dto.setStartMode(orderBasicInfo.getStartMode());
|
||
// dto.setPayMode(orderBasicInfo.getPayMode());
|
||
// dto.setPayAmount(orderBasicInfo.getPayAmount());
|
||
//
|
||
// Map<String, Object> map = orderBasicInfoService.payOrder(dto);
|
||
// return map;
|
||
String paymentId = "1234";
|
||
BigDecimal amount = orderBasicInfo.getPayAmount();
|
||
String orderCode = orderBasicInfo.getOrderCode();
|
||
|
||
JSONObject json = new JSONObject();
|
||
json.put("paymentId", paymentId);
|
||
json.put("amount", amount);
|
||
|
||
// 记录订单支付流水
|
||
OrderPayRecord orderPayRecord = OrderPayRecord.builder()
|
||
.orderCode(orderCode)
|
||
.payMode(OrderPayRecordEnum.WECHATPAY_PAYMENT.getValue())
|
||
.payAmount(amount)
|
||
.acquirer(AcquirerEnum.ADAPAY.getValue())
|
||
.deductionRecord(json.toJSONString())
|
||
.createBy(null)
|
||
.delFlag(DelFlagEnum.NORMAL.getValue())
|
||
.build();
|
||
orderPayRecordService.batchInsert(Lists.newArrayList(orderPayRecord));
|
||
|
||
// 更新冻结金额 支付成功后全部冻结
|
||
memberAdapayRecordService.updateFreezeAmount(paymentId, amount);
|
||
|
||
// 支付订单成功
|
||
PayOrderSuccessCallbackDTO callbackDTO = PayOrderSuccessCallbackDTO.builder()
|
||
.orderCode(orderCode)
|
||
.payAmount(amount)
|
||
.payMode(OrderPayModeEnum.PAYMENT_OF_WECHATPAY.getValue())
|
||
.acquirer(AcquirerEnum.ADAPAY.getValue())
|
||
.build();
|
||
// 订单支付成功 支付回调
|
||
// orderBasicInfoService.payOrderSuccessCallback(callbackDTO);
|
||
OrderBasicInfo orderInfo = orderBasicInfoService.getOrderInfoByOrderCode(callbackDTO.getOrderCode());
|
||
|
||
// 修改订单
|
||
orderInfo.setPayMode(callbackDTO.getPayMode());
|
||
orderInfo.setPayStatus(Constants.ONE);
|
||
orderInfo.setPayAmount(callbackDTO.getPayAmount());
|
||
orderInfo.setPayTime(new Date());
|
||
orderInfo.setChargeStartTime(new Date());
|
||
orderInfo.setOrderStatus(OrderStatusEnum.IN_THE_CHARGING.getValue());
|
||
return orderBasicInfoService.updateOrderBasicInfo(orderInfo);
|
||
|
||
}
|
||
|
||
// 结算订单
|
||
private void settleOrder(OrderBasicInfo orderBasicInfo) {
|
||
TransactionRecordsData data = TransactionRecordsData.builder()
|
||
.transactionCode(orderBasicInfo.getTransactionCode())
|
||
.pileSn(orderBasicInfo.getPileSn())
|
||
.connectorCode(orderBasicInfo.getConnectorCode())
|
||
.startTime("2023-03-10 17:10:24")
|
||
.endTime("2023-03-10 17:10:46")
|
||
.sharpPrice("1.10000")
|
||
.sharpUsedElectricity("2.0000")
|
||
.sharpAmount("2.2000")
|
||
.peakPrice("1.20000")
|
||
.peakUsedElectricity("0")
|
||
.peakAmount("0")
|
||
.flatPrice("1.30000")
|
||
.flatUsedElectricity("0")
|
||
.flatAmount("0")
|
||
.valleyPrice("1.40000")
|
||
.valleyUsedElectricity("0")
|
||
.valleyAmount("0")
|
||
.totalElectricity("2")
|
||
.consumptionAmount("5.3000")
|
||
.vinCode("\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000")
|
||
.transactionIdentifier("01")
|
||
.transactionTime("2023-03-10 17:10:46")
|
||
.stopReasonMsg("结束充电,APP远程停止")
|
||
.logicCard("0")
|
||
.createTime(new Date())
|
||
|
||
.build();
|
||
|
||
// orderBasicInfoService.settleOrder(data, orderBasicInfo);
|
||
// 获取更新数据后的orderBasicInfo对象
|
||
orderBasicInfoService.returnUpdateOrderBasicInfo(orderBasicInfo, data);
|
||
// 获取更新数据后的orderDetail对象/更新订单详情 查询订单详情 修改订单数据
|
||
OrderDetail orderDetail = orderBasicInfoService.returnUpdateOrderDetail(orderBasicInfo, data);
|
||
// 更新数据库
|
||
OrderTransactionDTO dto = new OrderTransactionDTO();
|
||
dto.setOrderBasicInfo(orderBasicInfo);
|
||
dto.setOrderDetail(orderDetail);
|
||
transactionService.doUpdateOrder(dto);
|
||
}
|
||
|
||
public static List<BigDecimal> calculateRefund(BigDecimal totalAmount, List<BigDecimal> payments) {
|
||
List<BigDecimal> refundList = new ArrayList<>();
|
||
BigDecimal remainingAmount = totalAmount;
|
||
|
||
for (BigDecimal payment : payments) {
|
||
if (remainingAmount.compareTo(BigDecimal.ZERO) <= 0) {
|
||
// refundList.add(BigDecimal.ZERO);
|
||
refundList.add(payment);
|
||
} else {
|
||
BigDecimal refundPerPayment = remainingAmount.min(payment);
|
||
// refundList.add(refundPerPayment);
|
||
refundList.add(payment.subtract(refundPerPayment));
|
||
remainingAmount = remainingAmount.subtract(refundPerPayment);
|
||
}
|
||
}
|
||
|
||
return refundList;
|
||
}
|
||
|
||
/**
|
||
* 测试多笔支付情况,解冻部分金额
|
||
*/
|
||
@Test
|
||
public void calculateUnfreezeAmountTest() {
|
||
BigDecimal orderAmount = new BigDecimal("0.06");
|
||
List<OrderPayRecord> payRecordList = Lists.newArrayList();
|
||
// 第一笔支付记录
|
||
JSONObject jsonObject = new JSONObject();
|
||
jsonObject.put("paymentId", "002212023083114213410543206907226374144");
|
||
jsonObject.put("amount", "0.97");
|
||
|
||
JSONObject jsonObject2 = new JSONObject();
|
||
jsonObject2.put("paymentId", "002212023083114213410543206907226374144");
|
||
jsonObject2.put("amount", "1");
|
||
|
||
JSONArray jsonArray = new JSONArray();
|
||
jsonArray.add(jsonObject);
|
||
jsonArray.add(jsonObject2);
|
||
|
||
OrderPayRecord build = OrderPayRecord.builder()
|
||
.payAmount(new BigDecimal("1.97"))
|
||
.deductionRecord(jsonArray.toJSONString())
|
||
.build();
|
||
payRecordList.add(build);
|
||
|
||
AbstractProgramLogic orderLogic = ProgramLogicFactory.getProgramLogic("1");
|
||
List<Map<String, Object>> maps = orderLogic.calculateUnfreezeAmount(orderAmount, payRecordList);
|
||
System.out.println(maps);
|
||
}
|
||
|
||
@Test
|
||
public void unfreezeAmountAndUpdateSpendAmountTest() {
|
||
String paymentId = "123";
|
||
memberAdapayRecordService.updateRefundAmount(paymentId, new BigDecimal("5"));
|
||
// memberAdapayRecordService.updateRefundAmountFromFreezeAmount(paymentId, new BigDecimal("20"));
|
||
// BigDecimal unfreezeAmount = new BigDecimal("32");
|
||
// BigDecimal spendAmount = new BigDecimal("10");
|
||
// memberAdapayRecordService.unfreezeAmountAndUpdateSpendAmount(paymentId, unfreezeAmount, spendAmount);
|
||
// memberAdapayRecordService.updateRefundAmountFromFreezeAmount(paymentId, new BigDecimal("2"));
|
||
}
|
||
|
||
@Test
|
||
public void getFirstLevelMerchantByMerchantIdTest() {
|
||
String merchantId = "13";
|
||
PileMerchantInfo merchantInfo = pileMerchantInfoService.getFirstLevelMerchantByMerchantId(merchantId);
|
||
System.out.println(JSON.toJSONString(merchantInfo));
|
||
}
|
||
|
||
@Test
|
||
public void queryPaymentInfoTest() throws BaseAdaPayException {
|
||
String paymentId = "002212023082514501110541039779091623936";
|
||
// 在完成初始化设置情况下,调用查询方法,获取 Payment 查询结果
|
||
Map<String, Object> response = Payment.query(paymentId, wechatAppId1);
|
||
System.out.println(response);
|
||
}
|
||
|
||
/**
|
||
* 【用户需要换绑银行卡 1-删除结算账户信息,2-使用新账户信息创建结算账户】
|
||
* 删除结算账户信息
|
||
* @throws BaseAdaPayException
|
||
*/
|
||
@Test
|
||
public void createDeleteSettleAccountRequestTest() throws BaseAdaPayException {
|
||
String adapayMemberId = "AM40919405";
|
||
String settleAccountId = "0540761871278208";
|
||
adapayService.createDeleteSettleAccountRequest(adapayMemberId, settleAccountId, wechatAppId1);
|
||
}
|
||
|
||
/**
|
||
* 手动变更银行卡信息
|
||
*/
|
||
@Test
|
||
public void createSettleAccountRequestTest() throws BaseAdaPayException {
|
||
SettleAccountDTO dto = new SettleAccountDTO();
|
||
dto.setCardId("45050160425000000627");
|
||
dto.setCardName("广西昂晟节能科技有限公司");
|
||
dto.setTelNo("19163816451");
|
||
dto.setBankCode("01050000");
|
||
dto.setBankAcctType("1");
|
||
dto.setProvCode("0045");
|
||
dto.setAreaCode("4501");
|
||
String adapayMemberId = "ACM82792551";
|
||
adapayService.createSettleAccountRequest(dto, adapayMemberId, wechatAppId1);
|
||
}
|
||
|
||
@Test
|
||
public void queryDrawcashDetailTest() throws BaseAdaPayException {
|
||
String orderNo = "drawcash_1692339516947";
|
||
DrawCashDetailVO drawCashDetailVO = adapayService.queryDrawCashDetail(orderNo, wechatAppId1);
|
||
System.out.println(drawCashDetailVO);
|
||
}
|
||
|
||
@Test
|
||
public void refundOrderTest() {
|
||
String orderCode = "C80410085692";
|
||
OrderBasicInfo orderBasicInfo = orderBasicInfoService.getOrderInfoByOrderCode(orderCode);
|
||
String mode = pileMerchantInfoService.getDelayModeByMerchantId(orderBasicInfo.getMerchantId());
|
||
AbstractProgramLogic orderLogic = ProgramLogicFactory.getProgramLogic(mode);
|
||
orderLogic.refundOrder(orderBasicInfo);
|
||
}
|
||
|
||
@Test
|
||
public void queryPaymentConfirmListTest() {
|
||
QueryPaymentConfirmDTO dto = new QueryPaymentConfirmDTO();
|
||
dto.setWechatAppId(wechatAppId1);
|
||
dto.setPaymentId("002212023122208033310584061601344237568");
|
||
QueryPaymentConfirmDetailResponse response = adapayService.queryPaymentConfirmList(dto);
|
||
List<QueryPaymentConfirmDetailResponse.PaymentConfirmInfo> paymentConfirms = response.getPaymentConfirms();
|
||
// 如果没有分账信息,说明没有清分
|
||
String clearingStatus = null;
|
||
if (org.springframework.util.CollectionUtils.isEmpty(paymentConfirms)) {
|
||
clearingStatus = "未清分";
|
||
} else {
|
||
clearingStatus = "已清分";
|
||
}
|
||
System.out.println(clearingStatus);
|
||
}
|
||
|
||
@Test
|
||
public void queryAcctFlowListTest() {
|
||
QueryAcctFlowDTO dto = new QueryAcctFlowDTO();
|
||
try {
|
||
dto.setPageNo(1);
|
||
dto.setPageSize(100);
|
||
dto.setAcctType("01");
|
||
dto.setWechatAppId(wechatAppId1);
|
||
dto.setAdapayMemberId("ACM69424215");
|
||
dto.setBeginDate("20230823");
|
||
dto.setEndDate("20230823");
|
||
adapayService.queryAcctFlowList(dto);
|
||
} catch (BaseAdaPayException e) {
|
||
throw new RuntimeException(e);
|
||
}
|
||
}
|
||
|
||
@Test
|
||
public void testCalculateTheBalanceDeductionAmount() {
|
||
String memberId = "123456";
|
||
BigDecimal amount = new BigDecimal("20");
|
||
|
||
List<BalanceDeductionAmountVO> resultList = Lists.newArrayList();
|
||
// 查询会员的余额充值记录 按照充值时间正序
|
||
List<MemberAdapayRecord> memberAdapayRecords = Lists.newArrayList();
|
||
memberAdapayRecords.add(MemberAdapayRecord.builder().paymentId("1").balanceAmt(new BigDecimal("50")).build());
|
||
memberAdapayRecords.add(MemberAdapayRecord.builder().paymentId("2").balanceAmt(new BigDecimal("60")).build());
|
||
memberAdapayRecords.add(MemberAdapayRecord.builder().paymentId("3").balanceAmt(new BigDecimal("10")).build());
|
||
|
||
// 定义一个临时金额等于消费金额
|
||
BigDecimal tempAmount = new BigDecimal(amount.toString());
|
||
for (MemberAdapayRecord memberAdapayRecord : memberAdapayRecords) {
|
||
// 该笔支付剩余金额 取出一笔判断是否剩余金额够支付订单消费吗
|
||
BigDecimal balanceAmt = memberAdapayRecord.getBalanceAmt();
|
||
// 该笔支付扣除金额
|
||
BigDecimal deductionAmount;
|
||
// 获取延时分账模式 延时分账的使用撤销方法退款,实时分账的使用退款方法
|
||
// AdapayCallbackRecord callbackRecord = adapayCallbackRecordService.selectByPaymentId(memberAdapayRecord.getPaymentId());
|
||
// String payMode = null;
|
||
// if (callbackRecord != null) {
|
||
// JSONObject expendJsonObject = JSON.parseObject(callbackRecord.getExpend());
|
||
// payMode = expendJsonObject.getString("payMode");
|
||
// }
|
||
// 消费金额 - 剩余金额
|
||
tempAmount = tempAmount.subtract(balanceAmt);
|
||
if (tempAmount.compareTo(BigDecimal.ZERO) >= 0) {
|
||
// 计算以后,大于等于0,说明这笔支付剩余金额需要扣完
|
||
deductionAmount = balanceAmt;
|
||
BalanceDeductionAmountVO build = BalanceDeductionAmountVO.builder()
|
||
.memberId(memberId)
|
||
.paymentId(memberAdapayRecord.getPaymentId())
|
||
.deductionAmount(deductionAmount)
|
||
.build();
|
||
resultList.add(build);
|
||
} else {
|
||
// 如果小于0,则说明剩余的钱用不完,扣除金额等于消费金额,并结束循环
|
||
deductionAmount = balanceAmt.add(tempAmount);
|
||
BalanceDeductionAmountVO build = BalanceDeductionAmountVO.builder()
|
||
.memberId(memberId)
|
||
.paymentId(memberAdapayRecord.getPaymentId())
|
||
.deductionAmount(deductionAmount)
|
||
.build();
|
||
resultList.add(build);
|
||
break;
|
||
}
|
||
}
|
||
|
||
System.out.println(JSON.toJSONString(resultList));
|
||
}
|
||
|
||
@Test
|
||
public void testGenerateOccupyPileOrder() {
|
||
String memberId = "67569684";
|
||
String pileSn = "88230000000135";
|
||
String connectorCode = "01";
|
||
GenerateOccupyOrderDTO dto = new GenerateOccupyOrderDTO();
|
||
dto.setMemberId(memberId);
|
||
dto.setPileSn(pileSn);
|
||
dto.setConnectorCode(connectorCode);
|
||
|
||
orderPileOccupyService.generateOccupyPileOrder(dto);
|
||
}
|
||
|
||
@Test
|
||
public void testQueryConfirmReverse() throws BaseAdaPayException {
|
||
QueryConfirmReverseDTO dto = QueryConfirmReverseDTO.builder()
|
||
.paymentConfirmId("0022120231023104957990562360205131259904")
|
||
.wechatAppId(wechatAppId1)
|
||
.build();
|
||
adapayService.queryConfirmReverse(dto);
|
||
}
|
||
|
||
|
||
@Test
|
||
public void testStopOccupyPileOrder() {
|
||
String wechatAppId = "54135135";
|
||
AbstractAdapayConfig config = AdapayConfigFactory.getConfig(wechatAppId);
|
||
System.out.println(JSON.toJSONString(config));
|
||
|
||
AbstractAdapayConfig config2 = AdapayConfigFactory.getConfig(wechatAppId1);
|
||
System.out.println(JSON.toJSONString(config2));
|
||
}
|
||
|
||
// 需要重新分账的订单信息(针对未分账的订单)
|
||
public JSONArray getPaymentList() {
|
||
String jsonArrayString = "[" +
|
||
"{\"orderCode\":\"C25133803815\", \"settleAmount\":\"42.94\", \"paymentId\":\"002212024071413111510658428550211133440\"}" +
|
||
"]";
|
||
return JSONArray.parseArray(jsonArrayString);
|
||
}
|
||
|
||
/**
|
||
* 批量执行分账
|
||
*/
|
||
@Test
|
||
public void batchCreatePaymentConfirm() {
|
||
JSONArray paymentList = getPaymentList();
|
||
// TODO 获取默认结算账户,如需分给对应商户就填写正确的汇付会员id
|
||
// AdapayMemberAccount adapayMemberAccount = adapayMemberAccountService.getDefault();
|
||
AdapayMemberAccount adapayMemberAccount = new AdapayMemberAccount();
|
||
adapayMemberAccount.setAdapayMemberId("ACM25158725");
|
||
for (int i = 0; i < paymentList.size(); i++) {
|
||
JSONObject jsonObject = (JSONObject) paymentList.get(i);
|
||
BigDecimal confirmAmt = jsonObject.getBigDecimal("settleAmount"); // 确认金额就是结算金额
|
||
String paymentId = jsonObject.getString("paymentId"); // 支付id
|
||
String orderCode = jsonObject.getString("orderCode"); // 订单编号
|
||
|
||
// 延时分账,使用确认交易API
|
||
PaymentConfirmResponse paymentConfirmResponse = adapayService.createPaymentConfirmRequest(paymentId,
|
||
adapayMemberAccount, confirmAmt, orderCode, wechatAppId1);
|
||
System.out.println(JSON.toJSONString(paymentConfirmResponse));
|
||
}
|
||
}
|
||
|
||
/**
|
||
* 查询分账信息
|
||
* @throws BaseAdaPayException
|
||
*/
|
||
@Test
|
||
public void queryCreateConfirmReverse() throws BaseAdaPayException {
|
||
List<String> paymentIdList = getPaymentIdList(); // 查询分账信息
|
||
|
||
List<String> unSplitList = Lists.newArrayList(); // 未分帐
|
||
List<String> splitList = Lists.newArrayList(); // 已分帐
|
||
|
||
BigDecimal total = BigDecimal.ZERO;
|
||
List<String> selfList = Lists.newArrayList();
|
||
|
||
Map<String, BigDecimal> map = Maps.newHashMap();
|
||
for (String paymentId : paymentIdList) {
|
||
if (StringUtils.isBlank(paymentId)) {
|
||
continue;
|
||
}
|
||
// 查询支付确认id
|
||
QueryPaymentConfirmDTO dto = new QueryPaymentConfirmDTO();
|
||
dto.setPaymentId(paymentId);
|
||
dto.setWechatAppId(wechatAppId1);
|
||
// 查询分账信息
|
||
QueryPaymentConfirmDetailResponse response = adapayService.queryPaymentConfirmList(dto);
|
||
if (response != null) {
|
||
List<QueryPaymentConfirmDetailResponse.PaymentConfirmInfo> confirms = response.getPaymentConfirms();
|
||
if (CollectionUtils.isEmpty(confirms)) {
|
||
unSplitList.add(paymentId);
|
||
} else {
|
||
splitList.add(paymentId);
|
||
for (QueryPaymentConfirmDetailResponse.PaymentConfirmInfo confirm : confirms) {
|
||
if (queryConfirmReverseStatus(confirm)) {
|
||
System.out.println("支付确认id:" + confirm.getId() + "撤销了。。。");
|
||
continue;
|
||
}
|
||
JSONObject jsonObject = JSON.parseObject(confirm.getDescription());
|
||
String adapayMemberId = jsonObject.getString("adapayMemberId");
|
||
BigDecimal confirmedAmt = new BigDecimal(confirm.getConfirmedAmt());
|
||
|
||
total = total.add(confirmedAmt);
|
||
|
||
// 放map
|
||
map.merge(adapayMemberId, confirmedAmt, BigDecimal::add);
|
||
|
||
if (StringUtils.equals(adapayMemberId, "0")) {
|
||
selfList.add(paymentId);
|
||
}
|
||
}
|
||
}
|
||
} else {
|
||
unSplitList.add(paymentId);
|
||
}
|
||
}
|
||
System.out.println("=================未分账:" + JSON.toJSONString(unSplitList) + ", 数量:" + unSplitList.size());
|
||
System.out.println("=================已分账:" + JSON.toJSONString(map) + ", 总分账:" + total + ", 数量:" + splitList.size());
|
||
System.out.println("=================自己:" + JSON.toJSONString(selfList) + ", 数量:" + selfList.size());
|
||
}
|
||
|
||
private boolean queryConfirmReverseStatus(QueryPaymentConfirmDetailResponse.PaymentConfirmInfo confirm) throws BaseAdaPayException {
|
||
boolean result = false;
|
||
|
||
QueryConfirmReverseDTO dto = QueryConfirmReverseDTO.builder()
|
||
.paymentConfirmId(confirm.getId())
|
||
.wechatAppId(wechatAppId1)
|
||
.build();
|
||
ConfirmReverseResponse confirmReverseResponse = adapayService.queryConfirmReverse(dto);
|
||
if (confirmReverseResponse.isSuccess()) {
|
||
result = true;
|
||
}
|
||
|
||
return result;
|
||
}
|
||
|
||
/**
|
||
* 延迟分账未确认调撤销调撤销接口退款/部分退
|
||
*/
|
||
@Test
|
||
public void createPaymentReverseRequestTest() {
|
||
String paymentId = "002212024092220492810683911016616513536";
|
||
BigDecimal refundAmount = new BigDecimal("33.58");
|
||
String memberId = "84630475";
|
||
String orderCode = "C40138347581";
|
||
|
||
// 延迟分账未确认调撤销调撤销接口退款
|
||
PaymentReverseOperation operation = new PaymentReverseOperation();
|
||
operation.setPaymentId(paymentId);
|
||
operation.setReverseAmt(refundAmount);
|
||
operation.setMerchantKey(wechatAppId1);
|
||
operation.setMemberId(memberId);
|
||
operation.setScenarioType(ScenarioEnum.ORDER.getValue());
|
||
operation.setOrderCode(orderCode);
|
||
PaymentReverseResponse response = adapayService.createPaymentReverseRequest(operation);
|
||
System.out.println(JSON.toJSONString(response));
|
||
}
|
||
|
||
/**
|
||
* 测试创建退款请求
|
||
*/
|
||
@Test
|
||
public void createRefundRequestTest() {
|
||
String paymentId = "0022120231226155420105856296289509498883333";
|
||
BigDecimal refundAmount = new BigDecimal("11.62");
|
||
String memberId = "46487809";
|
||
String orderCode = "C80414417003";
|
||
// 调汇付的交易退款接口
|
||
RefundResponse response = adapayService.createRefundRequest(paymentId, refundAmount,
|
||
wechatAppId2, memberId, ScenarioEnum.ORDER.getValue(), orderCode);
|
||
System.out.println(JSON.toJSONString(response));
|
||
}
|
||
|
||
/**
|
||
* 批量支付确认撤销
|
||
* @throws BaseAdaPayException
|
||
*/
|
||
@Test
|
||
public void testCreateConfirmReverse() throws BaseAdaPayException {
|
||
List<String> list = getPaymentIdList(); // 批量支付确认撤销
|
||
for (String paymentId : list) {
|
||
// 查询支付确认id
|
||
QueryPaymentConfirmDTO dto = new QueryPaymentConfirmDTO();
|
||
dto.setPaymentId(paymentId);
|
||
dto.setWechatAppId(wechatAppId1);
|
||
QueryPaymentConfirmDetailResponse response = adapayService.queryPaymentConfirmList(dto);
|
||
if (response != null) {
|
||
List<QueryPaymentConfirmDetailResponse.PaymentConfirmInfo> confirms = response.getPaymentConfirms();
|
||
System.out.println("支付id:" + paymentId + ", 确认信息:" + JSON.toJSONString(confirms));
|
||
if (CollectionUtils.isNotEmpty(confirms)) {
|
||
for (QueryPaymentConfirmDetailResponse.PaymentConfirmInfo confirm : confirms) {
|
||
adapayService.createConfirmReverse(confirm.getId(), wechatAppId1);
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
/**
|
||
* 查询撤销列表
|
||
* @throws BaseAdaPayException
|
||
*/
|
||
@Test
|
||
public void queryPaymentReverseListTest() throws BaseAdaPayException {
|
||
JSONArray jsonList = getJsonList();
|
||
|
||
List<String> idList = Lists.newArrayList();
|
||
for (int i = 0; i < jsonList.size(); i++) {
|
||
JSONObject jsonObject = (JSONObject) jsonList.get(i);
|
||
// System.out.println(JSON.toJSONString());
|
||
BigDecimal refundAmount = jsonObject.getBigDecimal("refundAmount");
|
||
String paymentId = jsonObject.getString("paymentId");
|
||
|
||
adapayService.createPaymentReverseRequest(paymentId, refundAmount, wechatAppId1, "", ScenarioEnum.ORDER.getValue(), "");
|
||
|
||
}
|
||
System.out.println("需要撤销idList:" + idList);
|
||
}
|
||
|
||
public JSONArray getJsonList() {
|
||
String jsonArrayString = "[{\"refundAmount\":\"354.84\", \"paymentId\":\"002212023102509474610563069333816762368\"}]";
|
||
JSONArray jsonArray = JSONArray.parseArray(jsonArrayString);
|
||
return jsonArray;
|
||
}
|
||
|
||
|
||
private List<String> getPaymentIdList1() {
|
||
List<String> list = Lists.newArrayList();
|
||
list.add("002212024080104094610664815265025318912");
|
||
list.add("002212024080105103710664830576223019008");
|
||
list.add("002212024080108001210664873255346294784");
|
||
list.add("002212024080108412010664883605782069248");
|
||
list.add("002212024080109525010664901597116350464");
|
||
list.add("002212024080110275510664910426482388992");
|
||
list.add("002212024080111083110664920645352226816");
|
||
list.add("002212024080111235510664924521971265536");
|
||
list.add("002212024080112000910664933640326447104");
|
||
list.add("002212024080112013810664934014549938176");
|
||
list.add("002212024080112143010664937250031849472");
|
||
list.add("002212024080112150810664937409924030464");
|
||
list.add("002212024080112301710664941222257934336");
|
||
list.add("002212024080112455010664945135876505600");
|
||
list.add("002212024080113542210664962383167336448");
|
||
list.add("002212024080114212610664969194190352384");
|
||
list.add("002212024080114343110664972488951562240");
|
||
list.add("002212024080114505410664976609326358528");
|
||
list.add("002212024080114560610664977917021642752");
|
||
list.add("002212024080115161610664982992343715840");
|
||
list.add("002212024080115352410664987809193373696");
|
||
list.add("002212024080115443810664990132963819520");
|
||
list.add("002212024080115460810664990511769780224");
|
||
list.add("002212024080115502210664991574988107776");
|
||
list.add("002212024080115551310664992795539759104");
|
||
list.add("002212024080116170310664998291486662656");
|
||
list.add("002212024080116263510665000688016941056");
|
||
list.add("002212024080116340510665002577152114688");
|
||
list.add("002212024080116521410665007142716227584");
|
||
list.add("002212024080116555310665008063851102208");
|
||
list.add("002212024080117021810665009678799724544");
|
||
list.add("002212024080117542410665022790376800256");
|
||
list.add("002212024080118112610665027074774646784");
|
||
list.add("002212024080118114410665027150580506624");
|
||
list.add("002212024080118193810665029138942640128");
|
||
list.add("002212024080118390810665034045501202432");
|
||
list.add("002212024080118473310665036165738332160");
|
||
list.add("002212024080119061010665040848014925824");
|
||
list.add("002212024080119151510665043137811931136");
|
||
list.add("002212024080120433910665065380672110592");
|
||
list.add("002212024080120590410665069262617935872");
|
||
list.add("002212024080121443110665080698558414848");
|
||
list.add("002212024080121473910665081489074274304");
|
||
list.add("002212024080123253010665106112446324736");
|
||
list.add("002212024080200253310665121224583512064");
|
||
list.add("002212024080202251410665151344785674240");
|
||
list.add("002212024080203385610665169893484838912");
|
||
list.add("002212024080209293710665258143690620928");
|
||
list.add("002212024080209585410665265515150540800");
|
||
list.add("002212024080210143810665269471420989440");
|
||
list.add("002212024080210211210665271124075139072");
|
||
list.add("002212024080210233610665271731604127744");
|
||
list.add("002212024080210345810665274589423579136");
|
||
list.add("002212024080211333210665289328886554624");
|
||
list.add("002212024080212193410665300914728271872");
|
||
list.add("002212024080212372010665305386619699200");
|
||
list.add("002212024080213004610665311281768816640");
|
||
list.add("002212024080213220210665316634561327104");
|
||
list.add("002212024080214022710665326804091977728");
|
||
list.add("002212024080214050010665327445220704256");
|
||
list.add("002212024080214114610665329150380466176");
|
||
list.add("002212024080214151510665330026138558464");
|
||
list.add("002212024080214223110665331854134456320");
|
||
list.add("002212024080214283010665333361139892224");
|
||
list.add("002212024080214350610665335020519403520");
|
||
list.add("002212024080214512110665339113114664960");
|
||
list.add("002212024080215034410665342228779352064");
|
||
list.add("002212024080215093910665343715997868032");
|
||
list.add("002212024080215203110665346449251418112");
|
||
list.add("002212024080215341110665349888488620032");
|
||
list.add("002212024080215390810665351134304501760");
|
||
list.add("002212024080216102710665359016776105984");
|
||
list.add("002212024080216155910665360410954555392");
|
||
list.add("002212024080216201310665361475100934144");
|
||
list.add("002212024080216321310665364496530735104");
|
||
list.add("002212024080216454410665367898734931968");
|
||
list.add("002212024080216492010665368802691506176");
|
||
list.add("002212024080217063510665373144279515136");
|
||
list.add("002212024080217155110665375477394800640");
|
||
list.add("002212024080217433010665382435747999744");
|
||
list.add("002212024080217484410665383750525509632");
|
||
list.add("002212024080218032710665387454144643072");
|
||
list.add("002212024080218115610665389589846679552");
|
||
list.add("002212024080218141110665390154025123840");
|
||
list.add("002212024080218142310665390207798005760");
|
||
list.add("002212024080218392510665396504942182400");
|
||
list.add("002212024080218535710665400161620713472");
|
||
list.add("002212024080218571810665401007111888896");
|
||
list.add("002212024080219060910665403231725412352");
|
||
list.add("002212024080219495310665414241440620544");
|
||
list.add("002212024080220015110665417250660626432");
|
||
list.add("002212024080220135810665420301967785984");
|
||
list.add("002212024080220403710665427005615878144");
|
||
list.add("002212024080220441510665427920991772672");
|
||
list.add("002212024080221294010665439350487449600");
|
||
list.add("002212024080221581110665446529006485504");
|
||
list.add("002212024080222064310665448676009566208");
|
||
list.add("002212024080303041710665523558944550912");
|
||
list.add("002212024080308162710665602119980527616");
|
||
list.add("002212024080309092510665615448547901440");
|
||
list.add("002212024080309125710665616336617680896");
|
||
list.add("002212024080309314610665621074962292736");
|
||
list.add("002212024080309524710665626361571672064");
|
||
list.add("002212024080310180810665632743369220096");
|
||
list.add("002212024080310331610665636552024899584");
|
||
list.add("002212024080310422210665638841287114752");
|
||
list.add("002212024080311412910665653716406099968");
|
||
list.add("002212024080312043510665659529736433664");
|
||
list.add("002212024080312090510665660664467632128");
|
||
list.add("002212024080312105210665661111254614016");
|
||
list.add("002212024080312540410665671981626941440");
|
||
list.add("002212024080313212910665678885270970368");
|
||
list.add("002212024080313445410665684776936914944");
|
||
list.add("002212024080313580610665688098869530624");
|
||
list.add("002212024080314020010665689080487960576");
|
||
list.add("002212024080314035010665689542944063488");
|
||
list.add("002212024080314161910665692684595167232");
|
||
list.add("002212024080314215410665694089347170304");
|
||
list.add("002212024080314274510665695559727546368");
|
||
list.add("002212024080314341610665697201267867648");
|
||
list.add("002212024080314542410665702267058569216");
|
||
list.add("002212024080315521610665716828467486720");
|
||
list.add("002212024080315540210665717274259410944");
|
||
list.add("002212024080316553910665732779360903168");
|
||
list.add("002212024080317055910665735379597578240");
|
||
list.add("002212024080317185310665738628437835776");
|
||
list.add("002212024080317190510665738676627824640");
|
||
list.add("002212024080317315910665741922796404736");
|
||
list.add("002212024080317395910665743938544152576");
|
||
list.add("002212024080318075610665750969054625792");
|
||
list.add("002212024080318163110665753131443675136");
|
||
list.add("002212024080318322610665757138359910400");
|
||
list.add("002212024080318531910665762393684410368");
|
||
list.add("002212024080319115810665767083973533696");
|
||
list.add("002212024080319454610665775589695664128");
|
||
list.add("002212024080320440510665790267765477376");
|
||
list.add("002212024080320470710665791029984878592");
|
||
list.add("002212024080321452510665805703280443392");
|
||
list.add("002212024080321560210665808372814237696");
|
||
list.add("002212024080400562810665853780193828864");
|
||
list.add("002212024080401033610665855576057847808");
|
||
list.add("002212024080401282610665861825640976384");
|
||
list.add("002212024080401365510665863961000984576");
|
||
list.add("002212024080402241810665875886119329792");
|
||
list.add("002212024080405202110665920190800904192");
|
||
list.add("002212024080406172310665934542809194496");
|
||
list.add("002212024080408054310665961806835986432");
|
||
list.add("002212024080408224910665966108853133312");
|
||
list.add("002212024080408565410665974688557498368");
|
||
list.add("002212024080409131910665978819158409216");
|
||
list.add("002212024080410071210665992379048329216");
|
||
list.add("002212024080410214610665996042642862080");
|
||
list.add("002212024080411165110666009905000726528");
|
||
list.add("002212024080411333610666014120597749760");
|
||
list.add("002212024080411351010666014513695154176");
|
||
list.add("002212024080411492710666018109418471424");
|
||
list.add("002212024080411535710666019244328812544");
|
||
list.add("002212024080412042810666021889539579904");
|
||
list.add("002212024080412065410666022503438868480");
|
||
list.add("002212024080412312210666028657940836352");
|
||
list.add("002212024080412422810666031451671896064");
|
||
list.add("002212024080412543910666034517279965184");
|
||
list.add("002212024080414385910666060772805148672");
|
||
list.add("002212024080415292810666073477954600960");
|
||
list.add("002212024080416023210666081799051096064");
|
||
list.add("002212024080416214210666086623131140096");
|
||
list.add("002212024080416564310666095435551789056");
|
||
list.add("002212024080417261710666102875463548928");
|
||
list.add("002212024080417283010666103435180834816");
|
||
list.add("002212024080417312710666104175659241472");
|
||
list.add("002212024080417322410666104416193675264");
|
||
list.add("002212024080417355710666105308291383296");
|
||
list.add("002212024080417523310666109488152805376");
|
||
list.add("002212024080417553510666110251735826432");
|
||
list.add("002212024080417595710666111350671343616");
|
||
list.add("002212024080418094310666113805454901248");
|
||
list.add("002212024080418375110666120887968387072");
|
||
list.add("002212024080419043310666127608176623616");
|
||
list.add("002212024080419045310666127690422730752");
|
||
list.add("002212024080419203010666131618770108416");
|
||
list.add("002212024080422071110666173567684235264");
|
||
list.add("002212024080422564010666186019733950464");
|
||
list.add("002212024080423021510666187427632578560");
|
||
list.add("002212024080423501610666199510433640448");
|
||
list.add("002212024080501521810666230221972885504");
|
||
list.add("002212024080502031310666232967372144640");
|
||
list.add("002212024080504283910666269567132291072");
|
||
list.add("002212024080506023210666293192582201344");
|
||
list.add("002212024080508185010666327494886621184");
|
||
list.add("002212024080509495110666350401487732736");
|
||
list.add("002212024080509590310666352716702015488");
|
||
list.add("002212024080510165910666357227676741632");
|
||
list.add("002212024080510353910666361925253685248");
|
||
list.add("002212024080511000510666368075780771840");
|
||
list.add("002212024080511042310666369155222953984");
|
||
list.add("002212024080511442110666379213052690432");
|
||
list.add("002212024080512190810666387966120542208");
|
||
list.add("002212024080512483610666395384411258880");
|
||
list.add("002212024080512581110666397796035907584");
|
||
list.add("002212024080513161810666402354884763648");
|
||
list.add("002212024080513415510666408802698604544");
|
||
list.add("002212024080513495310666410807329751040");
|
||
list.add("002212024080514051110666414658317418496");
|
||
list.add("002212024080514254810666419844345085952");
|
||
list.add("002212024080514354710666422356600356864");
|
||
list.add("002212024080514410810666423704668844032");
|
||
list.add("002212024080514520110666426444328304640");
|
||
list.add("002212024080515063310666430098074730496");
|
||
list.add("002212024080515171310666432784269246464");
|
||
list.add("002212024080515272410666435347695280128");
|
||
list.add("002212024080515443210666439657584275456");
|
||
list.add("002212024080516030410666444322064154624");
|
||
list.add("002212024080516311810666451427728740352");
|
||
list.add("002212024080516452310666454973769179136");
|
||
list.add("002212024080518111710666476591483043840");
|
||
list.add("002212024080518315310666481772834009088");
|
||
list.add("002212024080519393010666498792096538624");
|
||
list.add("002212024080519432210666499763158761472");
|
||
list.add("002212024080520112810666506833171263488");
|
||
list.add("002212024080520285610666511231835537408");
|
||
list.add("002212024080601094010666581877453086720");
|
||
list.add("002212024080602203810666599740264636416");
|
||
list.add("002212024080604170410666629038563590144");
|
||
list.add("002212024080604230710666630561827094528");
|
||
list.add("002212024080605020810666640383466254336");
|
||
list.add("002212024080605374310666649337389744128");
|
||
list.add("002212024080609305010666708001655980032");
|
||
list.add("002212024080610080210666717361663574016");
|
||
list.add("002212024080610361410666724462076633088");
|
||
list.add("002212024080611430110666741265966772224");
|
||
list.add("002212024080611494310666742953381396480");
|
||
list.add("002212024080611502910666743147056185344");
|
||
list.add("002212024080613130210666763919736418304");
|
||
list.add("002212024080613222510666766280198832128");
|
||
list.add("002212024080613403210666770839141449728");
|
||
list.add("002212024080613482910666772841372155904");
|
||
list.add("002212024080614243010666781907290341376");
|
||
list.add("002212024080614501310666788376784363520");
|
||
list.add("002212024080614552310666789677732454400");
|
||
list.add("002212024080614595110666790801674461184");
|
||
list.add("002212024080615055810666792341081653248");
|
||
list.add("002212024080615061810666792426223288320");
|
||
list.add("002212024080615260310666797393876856832");
|
||
list.add("002212024080615474210666802844591116288");
|
||
list.add("002212024080615514010666803839777820672");
|
||
list.add("002212024080616045310666807167221940224");
|
||
list.add("002212024080616501310666818575674490880");
|
||
list.add("002212024080616550610666819803656159232");
|
||
list.add("002212024080617201910666826151189204992");
|
||
list.add("002212024080617234810666827028332535808");
|
||
list.add("002212024080617361710666830171178229760");
|
||
list.add("002212024080618352710666845060948230144");
|
||
list.add("002212024080619192110666856105608839168");
|
||
list.add("002212024080619395710666861291127971840");
|
||
list.add("002212024080621254010666887897211416576");
|
||
list.add("002212024080621335810666889982712139776");
|
||
list.add("002212024080621401110666891550591401984");
|
||
list.add("002212024080622534110666910044120395776");
|
||
list.add("002212024080623570210666925989803442176");
|
||
list.add("002212024080702201810666962041185697792");
|
||
list.add("002212024080705102610667004858573111296");
|
||
list.add("002212024080708482810667059727228710912");
|
||
list.add("002212024080709163110667066785783570432");
|
||
list.add("002212024080712271810667114799679852544");
|
||
list.add("002212024080712291110667115274827386880");
|
||
list.add("002212024080713013110667123411014918144");
|
||
list.add("002212024080713165710667127294088642560");
|
||
list.add("002212024080713261610667129636883451904");
|
||
list.add("002212024080713303510667130724762370048");
|
||
list.add("002212024080713393510667132989553704960");
|
||
list.add("002212024080713451510667134417240772608");
|
||
list.add("002212024080714032810667139000873353216");
|
||
list.add("002212024080714261910667144749458710528");
|
||
list.add("002212024080715182910667157878802071552");
|
||
list.add("002212024080715340410667161801787498496");
|
||
list.add("002212024080715434010667164217245532160");
|
||
list.add("002212024080715523810667166471036428288");
|
||
list.add("002212024080716304310667176058931437568");
|
||
list.add("002212024080717040410667184450251874304");
|
||
list.add("002212024080718210610667203837482881024");
|
||
list.add("002212024080720250510667235036944498688");
|
||
list.add("002212024080720322910667236898726047744");
|
||
list.add("002212024080723012010667274358363840512");
|
||
list.add("002212024080802491010667331693869387776");
|
||
list.add("002212024080808025410667410649889955840");
|
||
list.add("002212024080808313010667417845853294592");
|
||
list.add("002212024080808552810667423875851563008");
|
||
list.add("002212024080809015510667425500338515968");
|
||
list.add("002212024080809502910667437722733961216");
|
||
list.add("002212024080810262410667446763367489536");
|
||
list.add("002212024080811365810667464519517155328");
|
||
list.add("002212024080811412810667465654613368832");
|
||
list.add("002212024080811502310667467898144014336");
|
||
list.add("002212024080811563810667469470052999168");
|
||
list.add("002212024080812231010667476146765791232");
|
||
list.add("002212024080812275910667477358762876928");
|
||
list.add("002212024080812421810667480963001974784");
|
||
list.add("002212024080812565010667484619310989312");
|
||
list.add("002212024080813095010667487889055383553");
|
||
list.add("002212024080813263710667492115130281984");
|
||
list.add("002212024080813440310667496501861101568");
|
||
list.add("002212024080813565110667499721584472064");
|
||
list.add("002212024080814212110667505888473559040");
|
||
list.add("002212024080814253410667506951025258496");
|
||
list.add("002212024080814310610667508343907201024");
|
||
list.add("002212024080814420210667511094261551104");
|
||
list.add("002212024080814422710667511200335499264");
|
||
list.add("002212024080814553710667514510159310848");
|
||
list.add("002212024080815174210667520070443917312");
|
||
list.add("002212024080815215210667521118453686272");
|
||
list.add("002212024080815575310667530182065242112");
|
||
list.add("002212024080816361110667539818737401856");
|
||
list.add("002212024080816392610667540640173481984");
|
||
list.add("002212024080816402010667540866507444224");
|
||
list.add("002212024080817232510667551708565417984");
|
||
list.add("002212024080818022410667561519670743040");
|
||
list.add("002212024080818304110667568634427662336");
|
||
list.add("002212024080818570010667575258180939776");
|
||
list.add("002212024080819401210667586128558919680");
|
||
list.add("002212024080819452510667587442633781248");
|
||
list.add("002212024080820043710667592275754024960");
|
||
list.add("002212024080820163610667595289149239296");
|
||
list.add("002212024080820545110667604915368607744");
|
||
list.add("002212024080823193110667641324547137536");
|
||
list.add("002212024080902265810667688495754608640");
|
||
list.add("002212024080902545510667695527764221952");
|
||
list.add("002212024080904433010667722854777577472");
|
||
list.add("002212024080906582610667756810848907264");
|
||
list.add("002212024080909350010667796213585264640");
|
||
list.add("002212024080909533210667800876103827456");
|
||
list.add("002212024080910491710667814906090459136");
|
||
list.add("002212024080911162910667821755296964608");
|
||
list.add("002212024080911325910667825907358851072");
|
||
list.add("002212024080911490910667829975219933184");
|
||
list.add("002212024080911492310667830031538630656");
|
||
list.add("002212024080911541410667831255008997376");
|
||
list.add("002212024080911541910667831272344358912");
|
||
list.add("002212024080911575810667832190995361792");
|
||
list.add("002212024080912191810667837562428182528");
|
||
list.add("002212024080912403310667842909818531840");
|
||
list.add("002212024080912483110667844915238862848");
|
||
list.add("002212024080913041710667848881661919232");
|
||
list.add("002212024080913193810667852743959310336");
|
||
list.add("002212024080913194610667852778505338880");
|
||
list.add("002212024080913233310667853731039076352");
|
||
list.add("002212024080913252610667854203618709504");
|
||
list.add("002212024080913293010667855228746952704");
|
||
list.add("002212024080913303510667855499504332800");
|
||
list.add("002212024080913330410667856124862476288");
|
||
list.add("002212024080913455510667859361428115456");
|
||
list.add("002212024080914041110667863954462027776");
|
||
list.add("002212024080914120310667865935332343808");
|
||
list.add("002212024080914265810667869688310587392");
|
||
list.add("002212024080915011110667878299966828544");
|
||
list.add("002212024080915020610667878529691353088");
|
||
list.add("002212024080915110910667880810630729728");
|
||
list.add("002212024080915231910667883870716223488");
|
||
list.add("002212024080915374810667887515553468416");
|
||
list.add("002212024080916065410667894840477585408");
|
||
list.add("002212024080916243610667899294173818880");
|
||
list.add("002212024080917021310667908759541485568");
|
||
list.add("002212024080917280410667915266046656512");
|
||
list.add("002212024080917283610667915401071017984");
|
||
list.add("002212024080917385710667918006131720192");
|
||
list.add("002212024080917470410667920045979938816");
|
||
list.add("002212024080918222110667928925300948992");
|
||
list.add("002212024080918551010667937183354175488");
|
||
list.add("002212024080918571410667937704577425408");
|
||
list.add("002212024080919052510667939763110641664");
|
||
list.add("002212024080919320910667946492542816256");
|
||
list.add("002212024080919380410667947979253055488");
|
||
list.add("002212024080919571110667952790359359488");
|
||
list.add("002212024080920243610667959692482433024");
|
||
list.add("002212024080920365310667962781373755392");
|
||
list.add("002212024080920492810667965947836694528");
|
||
list.add("002212024080921011610667968920285057024");
|
||
list.add("002212024080921340810667977190263140352");
|
||
list.add("002212024080921480910667980716171522048");
|
||
list.add("002212024080921594510667983637971963904");
|
||
list.add("002212024081003250910668065525961035776");
|
||
list.add("002212024081004284310668081521272745984");
|
||
list.add("002212024081007255010668126096408772608");
|
||
list.add("002212024081007421110668130209682800640");
|
||
list.add("002212024081009242710668155945002586112");
|
||
list.add("002212024081009535910668163379845230592");
|
||
list.add("002212024081009562610668163995149627392");
|
||
list.add("002212024081010294210668172367766401024");
|
||
list.add("002212024081010302410668172545372782592");
|
||
list.add("002212024081011061310668181558174273536");
|
||
list.add("002212024081011531010668193374540759040");
|
||
list.add("002212024081012004310668195271155879936");
|
||
list.add("002212024081012221210668200678343688192");
|
||
list.add("002212024081012382710668204769365819392");
|
||
list.add("002212024081012442210668206257195286528");
|
||
list.add("002212024081012585610668209922465161216");
|
||
list.add("002212024081013022810668210811524972544");
|
||
list.add("002212024081013043610668211348372258816");
|
||
list.add("002212024081013180610668214745624281088");
|
||
list.add("002212024081013490810668222557000945664");
|
||
list.add("002212024081013522610668223387001257984");
|
||
list.add("002212024081014051710668226620649472000");
|
||
list.add("002212024081014401010668235398563090432");
|
||
list.add("002212024081014445310668236585786880000");
|
||
list.add("002212024081015205710668245665027809280");
|
||
list.add("002212024081015262210668247026286145536");
|
||
list.add("002212024081015343410668249088980770816");
|
||
list.add("002212024081016092910668257876277051392");
|
||
list.add("002212024081016352010668264380398759936");
|
||
list.add("002212024081016355310668264522415837184");
|
||
list.add("002212024081017045110668271812546367488");
|
||
list.add("002212024081018200010668290720659501056");
|
||
list.add("002212024081018351810668294573772038144");
|
||
list.add("002212024081019000410668300807672520704");
|
||
list.add("002212024081019045810668302037707624448");
|
||
list.add("002212024081019132210668304154714529792");
|
||
list.add("002212024081019201110668305868646723584");
|
||
list.add("002212024081019204710668306020817670144");
|
||
list.add("002212024081019361510668309912280481792");
|
||
list.add("002212024081021330710668339322446741504");
|
||
list.add("002212024081022193210668351004296056832");
|
||
list.add("002212024081022351210668354947799175168");
|
||
list.add("002212024081101193910668396332717015040");
|
||
list.add("002212024081102412710668416914698129408");
|
||
list.add("002212024081106130810668470186784559104");
|
||
list.add("002212024081106203910668472078862450688");
|
||
list.add("002212024081106301110668474481311801344");
|
||
list.add("002212024081106363810668476102712287232");
|
||
list.add("002212024081106401610668477014926921728");
|
||
list.add("002212024081106423110668477583490232320");
|
||
list.add("002212024081106442310668478052458737664");
|
||
list.add("002212024081107164910668486215759532032");
|
||
list.add("002212024081108500110668509670922878976");
|
||
list.add("002212024081109212610668517576490848256");
|
||
list.add("002212024081109292110668519566018437120");
|
||
list.add("002212024081109412910668522622886260736");
|
||
list.add("002212024081109443310668523394556727296");
|
||
list.add("002212024081111274510668549365485891584");
|
||
list.add("002212024081111334610668550878459658240");
|
||
list.add("002212024081112033710668558388659838976");
|
||
list.add("002212024081113052110668573925315239936");
|
||
list.add("002212024081113071410668574398197501952");
|
||
list.add("002212024081113222610668578225461514240");
|
||
list.add("002212024081113443610668583802839855104");
|
||
list.add("002212024081113560710668586703196356608");
|
||
list.add("002212024081114190810668592493691334656");
|
||
list.add("002212024081115003510668602926779916288");
|
||
list.add("002212024081115050310668604048988532736");
|
||
list.add("002212024081115402010668612929247043584");
|
||
list.add("002212024081115421310668613402110525440");
|
||
list.add("002212024081115575010668617333729103872");
|
||
list.add("002212024081116212310668623257915211776");
|
||
list.add("002212024081116491910668630287262388224");
|
||
list.add("002212024081117085710668635232123019264");
|
||
list.add("002212024081117125010668636208560254976");
|
||
list.add("002212024081117321710668641102336331776");
|
||
list.add("002212024081117380010668642541875351552");
|
||
list.add("002212024081117473410668644946984013824");
|
||
list.add("002212024081118131810668651426396594176");
|
||
list.add("002212024081118363010668657263781728256");
|
||
list.add("002212024081118394810668658095298359296");
|
||
list.add("002212024081118452810668659520506023936");
|
||
list.add("002212024081119082110668665276622090240");
|
||
list.add("002212024081119200710668668237850988544");
|
||
list.add("002212024081119243310668669356159909888");
|
||
list.add("002212024081119392410668673093475094528");
|
||
list.add("002212024081120191210668683108023894016");
|
||
list.add("002212024081120333310668686720689156096");
|
||
list.add("002212024081120405310668688565791424512");
|
||
list.add("002212024081120470810668690136223801344");
|
||
list.add("002212024081121050110668694639610257408");
|
||
list.add("002212024081122010410668708745313226752");
|
||
list.add("002212024081122305010668716232835510272");
|
||
list.add("002212024081201200010668758805243990016");
|
||
list.add("002212024081202215310668774382098280448");
|
||
list.add("002212024081208110710668862266700558336");
|
||
list.add("002212024081208150810668863277108269056");
|
||
list.add("002212024081209482710668886761105874944");
|
||
list.add("002212024081209593210668889552820727808");
|
||
list.add("002212024081210522110668902844377042944");
|
||
list.add("002212024081211380510668914353231159296");
|
||
list.add("002212024081211592510668919720750583808");
|
||
list.add("002212024081212053810668921285809127424");
|
||
list.add("002212024081212284910668927120206299136");
|
||
list.add("002212024081213215310668940474241875968");
|
||
list.add("002212024081213271410668941820800184320");
|
||
list.add("002212024081213400210668945043156484096");
|
||
list.add("002212024081213420810668945571223011328");
|
||
list.add("002212024081213484510668947234078560256");
|
||
list.add("002212024081213495710668947539752484864");
|
||
list.add("002212024081213511610668947870276620288");
|
||
list.add("002212024081214304110668957787465302016");
|
||
list.add("002212024081214412510668960490947174400");
|
||
list.add("002212024081214560110668964164608651264");
|
||
list.add("002212024081215152710668969053223452672");
|
||
list.add("002212024081215422010668975821578362880");
|
||
list.add("002212024081216003010668980392123666432");
|
||
list.add("002212024081216232610668986164098035712");
|
||
list.add("002212024081217154710668999339711328256");
|
||
list.add("002212024081217155310668999364178984960");
|
||
list.add("002212024081217172110668999729857097728");
|
||
list.add("002212024081217182510669000000175796224");
|
||
list.add("002212024081217231110669001200040882176");
|
||
list.add("002212024081217414810669005885425758208");
|
||
list.add("002212024081218031310669011274895028224");
|
||
list.add("002212024081218225310669016223554588672");
|
||
list.add("002212024081218532410669023904177946624");
|
||
list.add("002212024081219004410669025749778104320");
|
||
list.add("002212024081219162910669029714316288000");
|
||
list.add("002212024081219202210669030689491619840");
|
||
list.add("002212024081219465610669037376271118336");
|
||
list.add("002212024081219590510669040433235062784");
|
||
list.add("002212024081220173510669045087873622016");
|
||
list.add("002212024081220245510669046933137043456");
|
||
list.add("002212024081220315510669048697127088128");
|
||
list.add("002212024081222471510669082755191070720");
|
||
list.add("002212024081223021510669086529090314240");
|
||
list.add("002212024081223194310669090924252422144");
|
||
list.add("002212024081300011110669101358962618368");
|
||
list.add("002212024081300283310669108246639210496");
|
||
list.add("002212024081304494410669173974388150272");
|
||
list.add("002212024081309045810669238209035751424");
|
||
list.add("002212024081309231910669242825882324992");
|
||
list.add("002212024081310512610669265002396504064");
|
||
list.add("002212024081310543010669265772634935296");
|
||
list.add("002212024081311145110669270895572258816");
|
||
list.add("002212024081311210710669272468786442240");
|
||
list.add("002212024081311412410669277575118962688");
|
||
list.add("002212024081312035610669283245977210880");
|
||
list.add("002212024081312500710669294867963011072");
|
||
list.add("002212024081312532010669295679427547136");
|
||
list.add("002212024081313251910669303726297677824");
|
||
list.add("002212024081313280310669304414745755648");
|
||
list.add("002212024081313484410669309621279457280");
|
||
list.add("002212024081314301910669320082529017856");
|
||
list.add("002212024081314365710669321754465243136");
|
||
list.add("002212024081314394010669322435989311488");
|
||
list.add("002212024081315140110669331082623934464");
|
||
list.add("002212024081315250510669333866354139136");
|
||
list.add("002212024081315350610669336386869723136");
|
||
list.add("002212024081316310110669350461496569856");
|
||
list.add("002212024081316340510669351230767198208");
|
||
list.add("002212024081316520710669355769381613568");
|
||
list.add("002212024081316592910669357625566134272");
|
||
list.add("002212024081317073710669359668385873920");
|
||
list.add("002212024081317563010669371972120571904");
|
||
list.add("002212024081317590810669372634905796608");
|
||
list.add("002212024081318000910669372890114785280");
|
||
list.add("002212024081318060610669374387898667008");
|
||
list.add("002212024081318072110669374702887038976");
|
||
list.add("002212024081318283910669380064224833536");
|
||
list.add("002212024081318303210669380538628018176");
|
||
list.add("002212024081318384210669382593199681536");
|
||
list.add("002212024081318500710669385465488834560");
|
||
list.add("002212024081318544810669386643735937024");
|
||
list.add("002212024081319015610669388439426117632");
|
||
list.add("002212024081319254510669394431360077824");
|
||
list.add("002212024081320030010669403805627920384");
|
||
list.add("002212024081320121610669406138784477184");
|
||
list.add("002212024081320402010669413203991183360");
|
||
list.add("002212024081320453610669414529683107840");
|
||
list.add("002212024081321035310669419129812385792");
|
||
list.add("002212024081321385510669427945539342336");
|
||
list.add("002212024081323114910669451323022946304");
|
||
list.add("002212024081401193510669483477956886528");
|
||
list.add("002212024081406324710669562298277916672");
|
||
list.add("002212024081408104510669586950488297472");
|
||
list.add("002212024081408161110669588320069562368");
|
||
list.add("002212024081409371010669608699237597184");
|
||
list.add("002212024081410311610669622313806528512");
|
||
list.add("002212024081410424110669625188332834816");
|
||
list.add("002212024081411330510669637870372433920");
|
||
list.add("002212024081411422710669640228558962688");
|
||
list.add("002212024081411582410669644241326923776");
|
||
list.add("002212024081412113210669647545528659968");
|
||
list.add("002212024081412573910669659150237511680");
|
||
list.add("002212024081413190010669664526980464640");
|
||
list.add("002212024081413332410669668147474530304");
|
||
list.add("002212024081414030410669675614206222336");
|
||
list.add("002212024081414312410669682745420255232");
|
||
list.add("002212024081416311710669712916524740608");
|
||
list.add("002212024081416361310669714155138805760");
|
||
list.add("002212024081417473010669732096660062208");
|
||
list.add("002212024081417482010669732306207469568");
|
||
list.add("002212024081418035210669736212799012864");
|
||
list.add("002212024081418222210669740870588751872");
|
||
list.add("002212024081419303210669758023860576256");
|
||
list.add("002212024081419385510669760132881149952");
|
||
list.add("002212024081419475810669762412710256640");
|
||
list.add("002212024081420435110669776476881670144");
|
||
list.add("002212024081508223210669952304580325376");
|
||
list.add("002212024081508411710669957024677801984");
|
||
list.add("002212024081508595610669961717060415488");
|
||
list.add("002212024081509512210669974661518946304");
|
||
list.add("002212024081510000510669976855456108544");
|
||
list.add("002212024081511442010670003090716856320");
|
||
list.add("002212024081511453310670003395982098432");
|
||
list.add("002212024081511485610670004245062676480");
|
||
list.add("002212024081511495310670004487397629952");
|
||
list.add("002212024081511561010670006065033469952");
|
||
list.add("002212024081512421610670017668468015104");
|
||
list.add("002212024081513082210670024236038287360");
|
||
list.add("002212024081514194610670042206877372416");
|
||
list.add("002212024081515010410670052600021368832");
|
||
list.add("002212024081515130010670055603639595008");
|
||
list.add("002212024081515135110670055816771518464");
|
||
list.add("002212024081515181110670056908062523392");
|
||
list.add("002212024081516102610670070055734435840");
|
||
list.add("002212024081516190110670072213811466240");
|
||
list.add("002212024081516375310670076962279493632");
|
||
list.add("002212024081517123210670085683821469696");
|
||
list.add("002212024081517204410670087747150905344");
|
||
list.add("002212024081517343010670091209521037312");
|
||
list.add("002212024081517424410670093281946861568");
|
||
list.add("002212024081517512410670095464969601024");
|
||
list.add("002212024081518201710670102732796424192");
|
||
list.add("002212024081518230910670103453287510016");
|
||
list.add("002212024081519083810670114902681006080");
|
||
list.add("002212024081519191510670117571079892992");
|
||
list.add("002212024081519222410670118365992497152");
|
||
list.add("002212024081519533010670126191930699776");
|
||
list.add("002212024081520005810670128072351383552");
|
||
list.add("002212024081521024910670143634692751360");
|
||
list.add("002212024081521232210670148806412189696");
|
||
list.add("002212024081606421610670289458420629504");
|
||
list.add("002212024081607233610670299860747747328");
|
||
list.add("002212024081607284610670301162578063360");
|
||
list.add("002212024081611145210670358059802755072");
|
||
list.add("002212024081612151510670373258689343488");
|
||
list.add("002212024081612163710670373602760683520");
|
||
list.add("002212024081612444310670380674516631552");
|
||
list.add("002212024081613114710670387483918303232");
|
||
list.add("002212024081613224010670390222652768256");
|
||
list.add("002212024081613232710670390422058135552");
|
||
list.add("002212024081613265410670391286923100160");
|
||
list.add("002212024081614030810670400408841039872");
|
||
list.add("002212024081614171810670403974289260544");
|
||
list.add("002212024081614451410670411002042331136");
|
||
list.add("002212024081614541310670413263479857152");
|
||
list.add("002212024081615091810670417059379793920");
|
||
list.add("002212024081615504810670427503509209088");
|
||
list.add("002212024081616000310670429830685749248");
|
||
list.add("002212024081616254310670436287820431360");
|
||
list.add("002212024081616331810670438198463225856");
|
||
list.add("002212024081617054210670446353451757568");
|
||
list.add("002212024081617362810670454096099192832");
|
||
list.add("002212024081618175910670464541565333504");
|
||
list.add("002212024081618224810670465753762729984");
|
||
list.add("002212024081619363110670484304710307840");
|
||
list.add("002212024081619374810670484629554376704");
|
||
list.add("002212024081619491710670487520081969152");
|
||
list.add("002212024081621312510670513220540116992");
|
||
list.add("002212024081622391810670530306019516416");
|
||
list.add("002212024081623080410670537544067362816");
|
||
list.add("002212024081623204910670540751059386368");
|
||
list.add("002212024081623294810670543014356156416");
|
||
list.add("002212024081623345110670544283342045184");
|
||
list.add("002212024081623410110670545835678818304");
|
||
list.add("002212024081700004110670550786296610816");
|
||
list.add("002212024081700193210670555530503225344");
|
||
list.add("002212024081701154210670569664637136896");
|
||
list.add("002212024081701452210670577131407900672");
|
||
list.add("002212024081705245210670632370572455936");
|
||
list.add("002212024081707022410670656915062304768");
|
||
list.add("002212024081707232810670662216224575488");
|
||
list.add("002212024081708134610670674875522842624");
|
||
list.add("002212024081708454210670682908471037952");
|
||
list.add("002212024081708524810670684696098582528");
|
||
list.add("002212024081708574410670685939688206336");
|
||
list.add("002212024081709573710670701010011525120");
|
||
list.add("002212024081710020610670702137511440384");
|
||
list.add("002212024081710043710670702771950792704");
|
||
list.add("002212024081710111110670704424149176320");
|
||
list.add("002212024081710193810670706547442909184");
|
||
list.add("002212024081710354410670710600123461632");
|
||
list.add("002212024081711430010670727528745099264");
|
||
list.add("002212024081712043010670732937986666496");
|
||
list.add("002212024081712062310670733413971451904");
|
||
list.add("002212024081712163110670735962120073216");
|
||
list.add("002212024081712292510670739212199903232");
|
||
list.add("002212024081712313910670739773035089920");
|
||
list.add("002212024081712431710670742700643942400");
|
||
list.add("002212024081712543110670745526908981248");
|
||
list.add("002212024081712553910670745813882077184");
|
||
list.add("002212024081713051510670748226926501889");
|
||
list.add("002212024081713133010670750304825217024");
|
||
list.add("002212024081713162910670751054592040960");
|
||
list.add("002212024081713182610670751547673346048");
|
||
list.add("002212024081713252110670753286818336768");
|
||
list.add("002212024081713341010670755505180889088");
|
||
list.add("002212024081713341510670755528136372224");
|
||
list.add("002212024081713452110670758318427287552");
|
||
list.add("002212024081714124410670765208906596352");
|
||
list.add("002212024081714142410670765629614182400");
|
||
list.add("002212024081714353210670770950699597824");
|
||
list.add("002212024081714412810670772442311520256");
|
||
list.add("002212024081714530610670775367974432768");
|
||
list.add("002212024081715082010670779202615443456");
|
||
list.add("002212024081715104310670779803706707968");
|
||
list.add("002212024081715181110670781679974715392");
|
||
list.add("002212024081715243510670783291413147648");
|
||
list.add("002212024081715275510670784132059086848");
|
||
list.add("002212024081715295210670784623635922944");
|
||
list.add("002212024081715384710670786865738121216");
|
||
list.add("002212024081715533610670790594973499392");
|
||
list.add("002212024081716255610670798730817789952");
|
||
list.add("002212024081716292210670799597804306432");
|
||
list.add("002212024081717131010670810619147026432");
|
||
list.add("002212024081717175010670811792625602561");
|
||
list.add("002212024081718065210670824131347931136");
|
||
list.add("002212024081718151210670826229141659648");
|
||
list.add("002212024081718294410670829887559421952");
|
||
list.add("002212024081718505710670835224647741440");
|
||
list.add("002212024081719100510670840042880208896");
|
||
list.add("002212024081719243910670843708845162496");
|
||
list.add("002212024081720084110670854788960337920");
|
||
list.add("002212024081720340910670861199140286464");
|
||
list.add("002212024081721322610670875863739887616");
|
||
list.add("002212024081723012710670898266643222528");
|
||
list.add("002212024081801513510670941080610115584");
|
||
list.add("002212024081801564510670942383308603392");
|
||
list.add("002212024081802063610670944862099570688");
|
||
list.add("002212024081802480110670955285536927744");
|
||
list.add("002212024081804102510670976019943227392");
|
||
list.add("002212024081808081910671035889879711744");
|
||
list.add("002212024081808420910671044403943538688");
|
||
list.add("002212024081809114110671051836242358272");
|
||
list.add("002212024081810060310671065517019222016");
|
||
list.add("002212024081810383410671073703166447616");
|
||
list.add("002212024081812063210671095841585819648");
|
||
list.add("002212024081812233110671100113163743232");
|
||
list.add("002212024081812444810671105469440823296");
|
||
list.add("002212024081812493710671106680195502080");
|
||
list.add("002212024081812590810671109078119677952");
|
||
list.add("002212024081813320210671117354777509888");
|
||
list.add("002212024081813441910671120447598325760");
|
||
list.add("002212024081813492810671121744806211584");
|
||
list.add("002212024081813544610671123077190443008");
|
||
list.add("002212024081814052210671125746774294528");
|
||
list.add("002212024081814233910671130345882615808");
|
||
list.add("002212024081814261410671130997240160256");
|
||
list.add("002212024081814343010671133075381010432");
|
||
list.add("002212024081814393610671134360525778944");
|
||
list.add("002212024081814451610671135784379559936");
|
||
list.add("002212024081814481910671136552465436672");
|
||
list.add("002212024081814580110671138996187942912");
|
||
list.add("002212024081815111610671142328609595392");
|
||
list.add("002212024081815251610671145854508658688");
|
||
list.add("002212024081816461410671166226547458048");
|
||
list.add("002212024081816472310671166519652069376");
|
||
list.add("002212024081817101810671172284259303424");
|
||
list.add("002212024081817183210671174357431713792");
|
||
list.add("002212024081817270610671176513073283072");
|
||
list.add("002212024081817335610671178231838904320");
|
||
list.add("002212024081818020210671185305787813888");
|
||
list.add("002212024081818123410671187953762271232");
|
||
list.add("002212024081818152510671188672878931968");
|
||
list.add("002212024081818294510671192279494135808");
|
||
list.add("002212024081819070910671201692962902016");
|
||
list.add("002212024081819333010671208320330203136");
|
||
list.add("002212024081819374810671209405623537664");
|
||
list.add("002212024081820030510671215768414121984");
|
||
list.add("002212024081821244510671236317307383808");
|
||
list.add("002212024081821245110671236343876665344");
|
||
list.add("002212024081822243410671251374234071040");
|
||
list.add("002212024081823443010671271488453197824");
|
||
list.add("002212024081900300110671282944504090624");
|
||
list.add("002212024081900322510671283547138785280");
|
||
list.add("002212024081900353510671284342715695104");
|
||
list.add("002212024081908071610671398014695862272");
|
||
list.add("002212024081910351710671435264874196992");
|
||
list.add("002212024081910435810671437447325216768");
|
||
list.add("002212024081911134710671444952040456192");
|
||
list.add("002212024081911234610671447465929969664");
|
||
list.add("002212024081911422910671452173836312576");
|
||
list.add("002212024081912283210671463762054709248");
|
||
list.add("002212024081912341810671465214669840384");
|
||
list.add("002212024081912401810671466723921199104");
|
||
list.add("002212024081913101210671474250156957696");
|
||
list.add("002212024081913143310671475343957110784");
|
||
list.add("002212024081913382210671481339695427584");
|
||
list.add("002212024081913430610671482528406011904");
|
||
list.add("002212024081913535310671485243749629952");
|
||
list.add("002212024081914084010671488962858418176");
|
||
list.add("002212024081914284110671494000782462976");
|
||
list.add("002212024081914333610671495236560715776");
|
||
list.add("002212024081914491110671499159554084864");
|
||
list.add("002212024081915052110671503229866070016");
|
||
list.add("002212024081915190910671506701626585088");
|
||
list.add("002212024081915432710671512816254922752");
|
||
list.add("002212024081915535310671515443889909760");
|
||
list.add("002212024081915561110671516020583284736");
|
||
list.add("002212024081915582010671516560687464448");
|
||
list.add("002212024081915585010671516689658871808");
|
||
list.add("002212024081916095810671519487463620608");
|
||
list.add("002212024081916110210671519757666185216");
|
||
list.add("002212024081916242910671523141173350400");
|
||
list.add("002212024081916253210671523405305806848");
|
||
list.add("002212024081916321210671525085665267712");
|
||
list.add("002212024081916544010671530738913497088");
|
||
list.add("002212024081916544910671530776842924032");
|
||
list.add("002212024081917052010671533421342871552");
|
||
list.add("002212024081917071510671533905566588928");
|
||
list.add("002212024081917101310671534650161573888");
|
||
list.add("002212024081917174010671536526824927232");
|
||
list.add("002212024081918051610671548504739590144");
|
||
list.add("002212024081918124110671550371453263872");
|
||
list.add("002212024081918233410671553111992156160");
|
||
list.add("002212024081918531810671560592468795392");
|
||
list.add("002212024081919070910671564077964431360");
|
||
list.add("002212024081919363010671571465918189568");
|
||
list.add("002212024081919580510671576895895228416");
|
||
list.add("002212024081920204010671582579936653312");
|
||
list.add("002212024081921355510671601515843481600");
|
||
list.add("002212024081921492210671604903077593088");
|
||
list.add("002212024082000155510671641784572391424");
|
||
list.add("002212024082002042910671669103782625280");
|
||
list.add("002212024082005095010671715749411278848");
|
||
list.add("002212024082005125310671716517647024128");
|
||
list.add("002212024082007122810671746609782808576");
|
||
list.add("002212024082009145410671777421578567680");
|
||
list.add("002212024082009350610671782504368631808");
|
||
list.add("002212024082010105110671791500769984512");
|
||
list.add("002212024082011204410671809090011627520");
|
||
list.add("002212024082011513710671816860424941568");
|
||
list.add("002212024082012274110671825936938500096");
|
||
list.add("002212024082012305610671826753827995648");
|
||
list.add("002212024082013034510671835014838063104");
|
||
list.add("002212024082013080010671836083545538560");
|
||
list.add("002212024082013185810671838844615458816");
|
||
list.add("002212024082013250410671840379576897536");
|
||
list.add("002212024082013372610671843490339581952");
|
||
list.add("002212024082013472210671845988735479808");
|
||
list.add("002212024082014134310671852622924857344");
|
||
list.add("002212024082014213610671854606627581952");
|
||
list.add("002212024082014220810671854739446132736");
|
||
list.add("002212024082014302010671856804941180928");
|
||
list.add("002212024082015110810671867073230655488");
|
||
list.add("002212024082015361410671873389891215360");
|
||
list.add("002212024082016160510671883418297761792");
|
||
list.add("002212024082016564010671893629760368640");
|
||
list.add("002212024082017241110671900553977122816");
|
||
list.add("002212024082018112910671912456319991808");
|
||
list.add("002212024082018491410671921959431426048");
|
||
list.add("002212024082019420910671935276813180928");
|
||
list.add("002212024082020204710671944996808146944");
|
||
list.add("002212024082020453810671951253023461376");
|
||
list.add("002212024082021402910671965056562167808");
|
||
list.add("002212024082101552110672029192848789504");
|
||
list.add("002212024082108503810672133702554841088");
|
||
list.add("002212024082110424010672161897670701056");
|
||
list.add("002212024082110581810672165830275600384");
|
||
list.add("002212024082111252910672172670472392704");
|
||
list.add("002212024082111513010672179219942838272");
|
||
list.add("002212024082111534110672179768360669184");
|
||
list.add("002212024082112182410672185990444310528");
|
||
list.add("002212024082113011010672196750814072832");
|
||
list.add("002212024082113064210672198142855315456");
|
||
list.add("002212024082114463010672223261089652736");
|
||
list.add("002212024082115543210672240383268028416");
|
||
list.add("002212024082116230610672247568475684864");
|
||
list.add("002212024082116265710672248537489575936");
|
||
list.add("002212024082116403910672251986384465920");
|
||
list.add("002212024082118420910672282565320085504");
|
||
list.add("002212024082118455210672283500100423680");
|
||
list.add("002212024082119092210672289412814966784");
|
||
list.add("002212024082119162310672291178815512576");
|
||
list.add("002212024082120552410672316096606732288");
|
||
list.add("002212024082122500510672344958887321600");
|
||
list.add("002212024082200585710672377389260042240");
|
||
list.add("002212024082202510710672405615587459072");
|
||
list.add("002212024082205351910672446936411246592");
|
||
list.add("002212024082208533510672496834867458048");
|
||
list.add("002212024082210172510672517929806159872");
|
||
list.add("002212024082211272710672535553908244480");
|
||
list.add("002212024082211312810672536566183849984");
|
||
list.add("002212024082211442510672539826464141312");
|
||
list.add("002212024082211470610672540498856861696");
|
||
list.add("002212024082214095410672576437038002176");
|
||
list.add("002212024082214370510672583276149288960");
|
||
list.add("002212024082214484610672586218227466240");
|
||
list.add("002212024082215202110672594164802748416");
|
||
list.add("002212024082215272210672595933436641280");
|
||
list.add("002212024082215451110672600417142669312");
|
||
list.add("002212024082216280410672611206149758976");
|
||
list.add("002212024082216364910672613410956029952");
|
||
list.add("002212024082217035210672620216928231424");
|
||
list.add("002212024082217140410672622786121273344");
|
||
list.add("002212024082217384110672628979766226944");
|
||
list.add("002212024082218140710672637894658736128");
|
||
list.add("002212024082218172010672638706703069184");
|
||
list.add("002212024082218185410672639101888479232");
|
||
list.add("002212024082219000610672649467777835008");
|
||
list.add("002212024082219092310672651804319625216");
|
||
list.add("002212024082219500610672662051264106496");
|
||
list.add("002212024082219542010672663117900476416");
|
||
list.add("002212024082220200210672669582861623296");
|
||
list.add("002212024082221083110672681787368058880");
|
||
list.add("002212024082221491410672692032247402496");
|
||
list.add("002212024082221491810672692048205242368");
|
||
list.add("002212024082222014410672695179089600512");
|
||
list.add("002212024082222221210672700328977989632");
|
||
list.add("002212024082302061010672756690242592768");
|
||
list.add("002212024082306523410672828764729208832");
|
||
list.add("002212024082307400110672840706617573376");
|
||
list.add("002212024082308141410672849317102714880");
|
||
list.add("002212024082310002410672876034359148544");
|
||
list.add("002212024082310552010672889860714725376");
|
||
list.add("002212024082311011910672891365742403584");
|
||
list.add("002212024082311291710672898406521044992");
|
||
list.add("002212024082312140910672909693823279104");
|
||
list.add("002212024082312235910672912171441684480");
|
||
list.add("002212024082312392510672916054826123264");
|
||
list.add("002212024082312560210672920235689496576");
|
||
list.add("002212024082312564810672920427732496384");
|
||
list.add("002212024082313182410672925865470164992");
|
||
list.add("002212024082313280910672928317283708928");
|
||
list.add("002212024082313345810672930032807694336");
|
||
list.add("002212024082313524310672934502337179648");
|
||
list.add("002212024082313574010672935747361566720");
|
||
list.add("002212024082314272610672943237681926144");
|
||
list.add("002212024082314302510672943986406293504");
|
||
list.add("002212024082314400110672946403230912512");
|
||
list.add("002212024082314565010672950636291325952");
|
||
list.add("002212024082315004010672951602831183872");
|
||
list.add("002212024082315095810672953941008613376");
|
||
list.add("002212024082315431310672962309234581504");
|
||
list.add("002212024082315524710672964718359044096");
|
||
list.add("002212024082316030110672967293662433280");
|
||
list.add("002212024082316264110672973249648877568");
|
||
list.add("002212024082316343610672975240594628608");
|
||
list.add("002212024082316432010672977436093485056");
|
||
list.add("002212024082317442710672992816477413376");
|
||
list.add("002212024082318134310673000181658460160");
|
||
list.add("002212024082318413010673007174334128128");
|
||
list.add("002212024082319052610673013198796447744");
|
||
list.add("002212024082319055010673013300145442816");
|
||
list.add("002212024082320581010673041569572753408");
|
||
list.add("002212024082321202710673047175370285056");
|
||
list.add("002212024082321382710673051705302958080");
|
||
list.add("002212024082322111110673059943912607744");
|
||
list.add("002212024082322264010673063841947017216");
|
||
list.add("002212024082323320710673080310533017600");
|
||
list.add("002212024082400353310673096275145089024");
|
||
list.add("002212024082400503810673100071304785920");
|
||
list.add("002212024082401401710673112567752982528");
|
||
list.add("002212024082401511010673115303009865728");
|
||
list.add("002212024082413515310673296679484608512");
|
||
list.add("002212024082414155110673302708300042240");
|
||
list.add("002212024082416040410673329942928683008");
|
||
list.add("002212024082416114410673331874325983232");
|
||
list.add("002212024082416380710673338513939283968");
|
||
list.add("002212024082419015110673374686272724992");
|
||
list.add("002212024082419122910673377362454638592");
|
||
list.add("002212024082419333210673382657427894272");
|
||
list.add("002212024082419504510673386989792894976");
|
||
list.add("002212024082419554210673388234616307712");
|
||
list.add("002212024082419562710673388426954383360");
|
||
list.add("002212024082420005810673389559933214720");
|
||
list.add("002212024082420400710673399413550739456");
|
||
list.add("002212024082420590510673404187180625920");
|
||
list.add("002212024082420590610673404193299980288");
|
||
list.add("002212024082421342210673413067494739968");
|
||
list.add("002212024082421473210673416378948079616");
|
||
list.add("002212024082421530810673417788495532032");
|
||
list.add("002212024082422580210673434120149753856");
|
||
list.add("002212024082423402010673444766392119296");
|
||
list.add("002212024082423432010673445520792313856");
|
||
list.add("002212024082500073910673451641854316544");
|
||
list.add("002212024082502064410673481610618073088");
|
||
list.add("002212024082508242410673576653049843712");
|
||
list.add("002212024082510272710673607618244165632");
|
||
list.add("002212024082510405010673610987399979008");
|
||
list.add("002212024082511242610673621957903351808");
|
||
list.add("002212024082511363210673625003889086464");
|
||
list.add("002212024082512263610673637606588174336");
|
||
list.add("002212024082512584710673645705491402752");
|
||
list.add("002212024082513084310673648203606282240");
|
||
list.add("002212024082514002710673661222501347328");
|
||
list.add("002212024082514102110673663712101486592");
|
||
list.add("002212024082514370510673670443307401216");
|
||
list.add("002212024082515352910673685140192751616");
|
||
list.add("002212024082515595810673691300906516480");
|
||
list.add("002212024082516264710673698050618392576");
|
||
list.add("002212024082516324010673699530720710656");
|
||
list.add("002212024082516365510673700598930702336");
|
||
list.add("002212024082517113910673709339983069185");
|
||
list.add("002212024082517233110673712325576269824");
|
||
list.add("002212024082517392810673716341527932928");
|
||
list.add("002212024082518170910673725825269415936");
|
||
list.add("002212024082518551810673735423010889728");
|
||
list.add("002212024082600153310673816018736926720");
|
||
list.add("002212024082605381910673897244331900928");
|
||
list.add("002212024082605415510673898149860573184");
|
||
list.add("002212024082606102310673905314032476160");
|
||
list.add("002212024082607510610673930660142759936");
|
||
list.add("002212024082608481710673945051812904960");
|
||
list.add("002212024082608534710673946436701364224");
|
||
list.add("002212024082609452910673959444868059136");
|
||
list.add("002212024082609595210673963063890243584");
|
||
list.add("002212024082610463510673974821784559616");
|
||
list.add("002212024082611112210673981060432130048");
|
||
list.add("002212024082611404110673988436719788032");
|
||
list.add("002212024082612405510674003596039454720");
|
||
list.add("002212024082612551710674007210526019584");
|
||
list.add("002212024082613032510674009259126050816");
|
||
list.add("002212024082614230710674029313849925632");
|
||
list.add("002212024082614534310674037015166107648");
|
||
list.add("002212024082615140710674042149753622528");
|
||
list.add("002212024082616372310674063105348894720");
|
||
list.add("002212024082617023510674069447236616192");
|
||
list.add("002212024082617251910674075167328477184");
|
||
list.add("002212024082617494710674081326091563008");
|
||
list.add("002212024082617504410674081561622700032");
|
||
list.add("002212024082619191810674103853341696000");
|
||
list.add("002212024082619212010674104361557123072");
|
||
list.add("002212024082620351410674122962621988865");
|
||
list.add("002212024082620481210674126222785073152");
|
||
list.add("002212024082621051610674130518827122688");
|
||
list.add("002212024082621290610674136515282489344");
|
||
list.add("002212024082622492810674156743246835712");
|
||
list.add("002212024082707184110674284890709516288");
|
||
list.add("002212024082709270610674317207794384896");
|
||
list.add("002212024082710150310674329274870157312");
|
||
list.add("002212024082712593810674370692674244608");
|
||
list.add("002212024082713584810674385582413537280");
|
||
list.add("002212024082715511210674413871156817920");
|
||
list.add("002212024082716444310674427339473506304");
|
||
list.add("002212024082717031910674432019516190720");
|
||
list.add("002212024082717340610674439763553964032");
|
||
list.add("002212024082717493810674443676340224000");
|
||
list.add("002212024082718101210674448850159964160");
|
||
list.add("002212024082719560710674475505674186752");
|
||
list.add("002212024082721441610674502721719586816");
|
||
list.add("002212024082807361910674651715794391040");
|
||
list.add("002212024082814415510674758822426083328");
|
||
list.add("002212024082815403010674773565165707264");
|
||
list.add("002212024082820220410674844423546826752");
|
||
list.add("002212024082820373810674848342790750208");
|
||
list.add("002212024082821222510674859611067080704");
|
||
list.add("002212024082822163210674873228287123456");
|
||
list.add("002212024082900035210674900239143178240");
|
||
list.add("002212024082900352410674908175986638848");
|
||
list.add("002212024082911563910675079619899662336");
|
||
list.add("002212024082913390310675105388980727808");
|
||
|
||
return list;
|
||
}
|
||
|
||
public List<String> getPaymentIdList() {
|
||
List<String> paymentIdList1 = getPaymentIdList1();
|
||
List<String> resultList = Lists.newArrayList();
|
||
resultList.addAll(paymentIdList1);
|
||
return resultList;
|
||
}
|
||
|
||
public List<String> getPaymentIdListForFile() {
|
||
return null;
|
||
}
|
||
|
||
@Test
|
||
public void testClearingWithdraw() {
|
||
// 保存提现记录
|
||
ClearingWithdrawInfo record = new ClearingWithdrawInfo();
|
||
record.setWithdrawCode("132321354");
|
||
record.setWithdrawStatus(Constants.ZERO);
|
||
Date now = new Date();
|
||
record.setApplicationTime(now);
|
||
record.setCreateTime(now);
|
||
record.setDelFlag(DelFlagEnum.NORMAL.getValue());
|
||
clearingWithdrawInfoService.insertOrUpdate(record);
|
||
}
|
||
|
||
@Test
|
||
public void testGetPileTypeNum() {
|
||
Long stationId = 201L;
|
||
pileConnectorInfoService.getPileTypeNum(stationId);
|
||
}
|
||
|
||
@Test
|
||
public void testUpdateStatus() {
|
||
String pileConnectorCode = "8800000000012601";
|
||
String status = "0";
|
||
pileConnectorInfoService.updateConnectorStatus(pileConnectorCode, status);
|
||
}
|
||
|
||
@Test
|
||
public void testRedisSet() {
|
||
String redisKey = "push_station_connector";
|
||
redisCache.setCacheSet(redisKey, Sets.newHashSet("1"));
|
||
|
||
redisCache.setCacheSet(redisKey, Sets.newHashSet("3"));
|
||
|
||
redisCache.setCacheSet(redisKey, Sets.newHashSet("5"));
|
||
|
||
redisCache.setCacheSet(redisKey, Sets.newHashSet("1"));
|
||
|
||
redisCache.setCacheSet(redisKey, Sets.newHashSet("1"));
|
||
|
||
redisCache.setCacheSet(redisKey, Sets.newHashSet("7"));
|
||
|
||
redisCache.setCacheSet(redisKey, Sets.newHashSet("3"));
|
||
|
||
|
||
Set<Object> cacheSet = redisCache.getCacheSet(redisKey);
|
||
System.out.println(cacheSet);
|
||
}
|
||
|
||
@Test
|
||
public void testSettleOrder() {
|
||
Map<String, BigDecimal> returnAmountMap = Maps.newHashMap();
|
||
returnAmountMap.put("returnPrincipal", new BigDecimal("16.8700"));
|
||
// 更新会员钱包
|
||
BigDecimal returnPrincipal = returnAmountMap.get("returnPrincipal");
|
||
// if (returnPrincipal != null && principalPayRecord != null) {
|
||
// principalPayRecord.setRefundAmount(returnPrincipal);
|
||
// updatePayRecordList.add(principalPayRecord);
|
||
// }
|
||
BigDecimal returnGift = returnAmountMap.get("returnGift");
|
||
|
||
System.out.println(returnPrincipal);
|
||
// if (returnGift != null && giftPayRecord != null) {
|
||
// giftPayRecord.setRefundAmount(returnGift);
|
||
// updatePayRecordList.add(giftPayRecord);
|
||
// // 支付的赠送金额-退回的赠送金额 = 实际使用赠送金额消费的部分
|
||
// virtualAmount = giftPay.subtract(returnGift);
|
||
// }
|
||
// UpdateMemberBalanceDTO updateMemberBalanceDTO = UpdateMemberBalanceDTO.builder()
|
||
// .memberId(orderBasicInfo.getMemberId())
|
||
// .type(MemberWalletEnum.TYPE_IN.getValue()) // 进账
|
||
// .subType(MemberWalletEnum.SUBTYPE_ORDER_SETTLEMENT_REFUND.getValue()) // 订单结算退款
|
||
// .updatePrincipalBalance(returnPrincipal)
|
||
// .updateGiftBalance(returnGift)
|
||
// .relatedOrderCode(orderBasicInfo.getOrderCode())
|
||
// .build();
|
||
// memberBasicInfoService.updateMemberBalance(updateMemberBalanceDTO);
|
||
}
|
||
|
||
|
||
@Test
|
||
public void testVin() {
|
||
String vinCode = "tango";
|
||
MemberPlateNumberRelation memberPlateInfoByVinCode = memberPlateNumberRelationService.getMemberPlateInfoByVinCode(vinCode);
|
||
System.out.println(memberPlateInfoByVinCode);
|
||
}
|
||
|
||
@Test
|
||
public void testParking() throws UnsupportedEncodingException {
|
||
// GetTokenDTO dto = new GetTokenDTO();
|
||
// dto.setAppId("I2qa3hdr116100dc");
|
||
// dto.setSecretKey("2qa3hdr13754a8e");
|
||
// String token = ltytService.getToken(dto);
|
||
// System.out.println(token);
|
||
|
||
BindCouponDTO dto = new BindCouponDTO();
|
||
dto.setAppId("I2qa3hdr116100dc");
|
||
dto.setSecretKey("2qa3hdr13754a8e");
|
||
dto.setMerchantId("3prv98bm8db70a9");
|
||
dto.setCouponId("3prvd0q7a4817bf");
|
||
dto.setPlateNumber("贵A12345");
|
||
dto.setPlateColor(1);
|
||
String s = ltytService.bindCoupon(dto);
|
||
System.out.println(s);
|
||
}
|
||
|
||
@Test
|
||
public void testUpdateConnectorStatus() {
|
||
String pileConnectorCode = "8800000000000101";
|
||
String status = PileConnectorStatusEnum.FREE.getValue();
|
||
pileConnectorInfoService.updateConnectorStatus(pileConnectorCode, status);
|
||
}
|
||
|
||
@Test
|
||
public void testOrder() throws Exception {
|
||
// 通过vin码查询数据库绑定用户信息
|
||
MemberPlateNumberRelation plateInfo = memberPlateNumberRelationService.getMemberPlateInfoByVinCode("LNBSCC4H1LT107646");
|
||
GenerateOrderDTO dto = new GenerateOrderDTO();
|
||
dto.setMemberPlateNumberRelation(plateInfo);
|
||
dto.setPileSn("88000000000126");
|
||
dto.setConnectorCode("01");
|
||
dto.setStartMode(StartModeEnum.VIN_CODE.getValue());
|
||
dto.setMemberId(plateInfo.getMemberId());
|
||
// 通过memberId获取账户余额
|
||
MemberVO memberVO = memberBasicInfoService.queryMemberInfoByMemberId(dto.getMemberId());
|
||
if (memberVO == null) {
|
||
throw new BusinessException(ReturnCodeEnum.CODE_GET_MEMBER_ACCOUNT_AMOUNT_ERROR);
|
||
}
|
||
BigDecimal totalAccountAmount = memberVO.getTotalBalance();
|
||
if (totalAccountAmount.compareTo(BigDecimal.ZERO) <= 0) {
|
||
throw new BusinessException(ReturnCodeEnum.CODE_BALANCE_IS_INSUFFICIENT);
|
||
}
|
||
|
||
dto.setChargeAmount(totalAccountAmount); // 充电金额
|
||
dto.setPayMode(OrderPayModeEnum.PAYMENT_OF_PRINCIPAL_BALANCE.getValue()); // 1-余额支付
|
||
|
||
OrderBasicInfo basicInfo = orderBasicInfoService.generateOrder(dto);
|
||
|
||
// 支付订单
|
||
// PayOrderDTO payOrderDTO = new PayOrderDTO();
|
||
// payOrderDTO.setOrderCode(basicInfo.getOrderCode());
|
||
// payOrderDTO.setPayAmount(totalAccountAmount);
|
||
// payOrderDTO.setPayMode(dto.getPayMode());
|
||
// payOrderDTO.setMemberId(dto.getMemberId());
|
||
// payOrderDTO.setCode();
|
||
// payOrderDTO.setLockValue();
|
||
// payOrderDTO.setOrderBasicInfo(basicInfo);
|
||
|
||
PayOrderDTO build = PayOrderDTO.builder()
|
||
.orderCode(basicInfo.getOrderCode())
|
||
.payAmount(totalAccountAmount)
|
||
.payMode(dto.getPayMode())
|
||
.memberId(dto.getMemberId())
|
||
.build();
|
||
|
||
// Map<String, Object> map = orderBasicInfoService.payOrder(payOrderDTO);
|
||
// System.out.println(map);
|
||
}
|
||
|
||
@Test
|
||
public void testTransactionRecord() {
|
||
// 获取消息体
|
||
String msg = "8823000000123302230707215317078588230000001233020000341507071763023615070717b02a0200a00f0000000000003016000090dc010000000000000000000000000020c50100000000000000000000000000888a0100000000000000000000000000b0220749005032074900a00f000000000000e01500004c4e425343433448314c543130373634360563023615070717450000000000000000";
|
||
byte[] msgBody = BytesUtil.str2Bcd(msg);
|
||
|
||
int startIndex = 0;
|
||
int length = 16;
|
||
|
||
// 交易流水号
|
||
byte[] orderCodeByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
||
String transactionCode = BytesUtil.bcd2Str(orderCodeByteArr);
|
||
|
||
// 桩编码
|
||
startIndex += length;
|
||
length = 7;
|
||
byte[] pileSnByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
||
String pileSn = BytesUtil.bcd2Str(pileSnByteArr);
|
||
|
||
// 枪号
|
||
startIndex += length;
|
||
length = 1;
|
||
byte[] connectorCodeByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
||
String connectorCode = BytesUtil.bcd2Str(connectorCodeByteArr);
|
||
|
||
|
||
// 开始时间 CP56Time2a 格式
|
||
startIndex += length;
|
||
length = 7;
|
||
byte[] startTimeByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
||
// String binary = BytesUtil.binary(startTimeByteArr, 16);
|
||
Date startDate = Cp56Time2aUtil.byte2Hdate(startTimeByteArr);
|
||
String startTime = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, startDate);
|
||
|
||
|
||
// 结束时间 CP56Time2a 格式
|
||
startIndex += length;
|
||
byte[] endTimeByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
||
Date endDate = Cp56Time2aUtil.byte2Hdate(endTimeByteArr);
|
||
String endTime = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, endDate);
|
||
|
||
// 尖单价 精确到小数点后五位(尖电费+尖服务费,见费率帧)
|
||
startIndex += length;
|
||
length = 4;
|
||
byte[] sharpPriceByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
||
String sharpPrice = YKCUtils.convertDecimalPoint(sharpPriceByteArr, 5);
|
||
|
||
// 尖电量 精确到小数点后四位
|
||
startIndex += length;
|
||
length = 4;
|
||
byte[] sharpUsedElectricityByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
||
String sharpUsedElectricity = YKCUtils.convertDecimalPoint(sharpUsedElectricityByteArr, 4);
|
||
|
||
// 计损尖电量
|
||
startIndex += length;
|
||
byte[] sharpPlanLossElectricityByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
||
String sharpPlanLossElectricity = YKCUtils.convertDecimalPoint(sharpPlanLossElectricityByteArr, 4);
|
||
|
||
// 尖金额
|
||
startIndex += length;
|
||
byte[] sharpAmountByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
||
String sharpAmount = YKCUtils.convertDecimalPoint(sharpAmountByteArr, 4);
|
||
|
||
// 峰单价 精确到小数点后五位(峰电费+峰服务费)
|
||
startIndex += length;
|
||
byte[] peakPriceByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
||
String peakPrice = YKCUtils.convertDecimalPoint(peakPriceByteArr, 5);
|
||
|
||
// 峰电量
|
||
startIndex += length;
|
||
byte[] peakUsedElectricityByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
||
String peakUsedElectricity = YKCUtils.convertDecimalPoint(peakUsedElectricityByteArr, 4);
|
||
|
||
// 计损峰电量
|
||
startIndex += length;
|
||
byte[] peakPlanLossElectricityByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
||
String peakPlanLossElectricity = YKCUtils.convertDecimalPoint(peakPlanLossElectricityByteArr, 4);
|
||
|
||
// 峰金额
|
||
startIndex += length;
|
||
byte[] peakAmountByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
||
String peakAmount = YKCUtils.convertDecimalPoint(peakAmountByteArr, 4);
|
||
|
||
// 平单价 精确到小数点后五位(平电费+平服务费)
|
||
startIndex += length;
|
||
byte[] flatPriceByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
||
String flatPrice = YKCUtils.convertDecimalPoint(flatPriceByteArr, 5);
|
||
|
||
// 平电量
|
||
startIndex += length;
|
||
byte[] flatUsedElectricityByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
||
String flatUsedElectricity = YKCUtils.convertDecimalPoint(flatUsedElectricityByteArr, 4);
|
||
|
||
// 计损平电量
|
||
startIndex += length;
|
||
byte[] flatPlanLossElectricityByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
||
String flatPlanLossElectricity = YKCUtils.convertDecimalPoint(flatPlanLossElectricityByteArr, 4);
|
||
|
||
// 平金额
|
||
startIndex += length;
|
||
byte[] flatAmountByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
||
String flatAmount = YKCUtils.convertDecimalPoint(flatAmountByteArr, 4);
|
||
|
||
// 谷单价 精确到小数点后五位(谷电费+谷 服务费)
|
||
startIndex += length;
|
||
byte[] valleyPriceByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
||
String valleyPrice = YKCUtils.convertDecimalPoint(valleyPriceByteArr, 5);
|
||
|
||
// 谷电量
|
||
startIndex += length;
|
||
byte[] valleyUsedElectricityByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
||
String valleyUsedElectricity = YKCUtils.convertDecimalPoint(valleyUsedElectricityByteArr, 4);
|
||
|
||
// 计损谷电量
|
||
startIndex += length;
|
||
byte[] valleyPlanLossElectricityByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
||
String valleyPlanLossElectricity = YKCUtils.convertDecimalPoint(valleyPlanLossElectricityByteArr, 4);
|
||
|
||
// 谷金额
|
||
startIndex += length;
|
||
byte[] valleyAmountByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
||
String valleyAmount = YKCUtils.convertDecimalPoint(valleyAmountByteArr, 4);
|
||
|
||
// 电表总起值
|
||
startIndex += length;
|
||
length = 5;
|
||
byte[] ammeterTotalStartByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
||
String ammeterTotalStart = YKCUtils.convertDecimalPoint(ammeterTotalStartByteArr, 4);
|
||
|
||
// 电表总止值
|
||
startIndex += length;
|
||
byte[] ammeterTotalEndByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
||
String ammeterTotalEnd = YKCUtils.convertDecimalPoint(ammeterTotalEndByteArr, 4);
|
||
|
||
// 总电量
|
||
startIndex += length;
|
||
length = 4;
|
||
byte[] totalElectricityByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
||
String totalElectricity = YKCUtils.convertDecimalPoint(totalElectricityByteArr, 4);
|
||
|
||
// 计损总电量
|
||
startIndex += length;
|
||
byte[] planLossTotalElectricityByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
||
String planLossTotalElectricity = YKCUtils.convertDecimalPoint(planLossTotalElectricityByteArr, 4);
|
||
|
||
// 消费金额 精确到小数点后四位,包含电费、 服务费
|
||
startIndex += length;
|
||
byte[] consumptionAmountByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
||
String consumptionAmount = YKCUtils.convertDecimalPoint(consumptionAmountByteArr, 4);
|
||
|
||
// VIN 码 VIN 码,此处 VIN 码和充电时 VIN 码不同, 正序直接上传, 无需补 0 和反序
|
||
startIndex += length;
|
||
length = 17;
|
||
byte[] vinCodeByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
||
String vinCode = BytesUtil.ascii2Str(vinCodeByteArr);
|
||
|
||
/**
|
||
* 交易标识
|
||
* 0x01: app 启动
|
||
* 0x02:卡启动
|
||
* 0x04:离线卡启动
|
||
* 0x05: vin 码启动充电
|
||
*/
|
||
startIndex += length;
|
||
length = 1;
|
||
byte[] transactionIdentifierByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
||
String transactionIdentifier = BytesUtil.bcd2Str(transactionIdentifierByteArr);
|
||
|
||
// 交易时间 CP56Time2a 格式
|
||
startIndex += length;
|
||
length = 7;
|
||
byte[] transactionTimeByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
||
Date transactionDate = Cp56Time2aUtil.byte2Hdate(transactionTimeByteArr);
|
||
String transactionTime = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, transactionDate);
|
||
|
||
// 停止原因
|
||
startIndex += length;
|
||
length = 1;
|
||
byte[] stopReasonByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
||
String stopReason = BytesUtil.bin2HexStr(stopReasonByteArr);
|
||
String stopReasonMsg = YKCChargingStopReasonEnum.getMsgByCode(Integer.parseInt(stopReason, 16));
|
||
|
||
// 物理卡号 不足 8 位补 0
|
||
startIndex += length;
|
||
length = 8;
|
||
byte[] cardNumByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
||
// byte[] logicCardNum = BytesUtil.checkLengthAndBehindAppendZero(cardNumByteArr, 16);
|
||
String logicCard = BytesUtil.binary(cardNumByteArr, 16);
|
||
// log.info("桩号:{}发送交易记录物理卡号:{}", pileSn, logicCard);
|
||
//
|
||
// log.info("[===交易记录===]交易流水号:{}, 桩编号:{}, 枪号:{}, 开始时间:{}, 结束时间:{}, 尖单价:{}, 尖电量:{}, 计损尖电量:{}, 尖金额:{}, " +
|
||
// "峰单价:{}, 峰电量:{}, 计损峰电量:{}, 峰金额:{}, 平单价:{}, 平电量:{}, 计损平电量:{}, 平金额:{}, " +
|
||
// "谷单价:{}, 谷电量:{}, 计损谷电量:{}, 谷金额:{}, 电表总起值:{}, 电表总止值:{}, 总电量:{}, 计损总电量:{}, 消费金额:{}, " +
|
||
// "电动汽车唯一标识:{}, 交易标识:{}, 交易日期、时间:{}, 停止原因码:{}, 停止原因描述:{}, 物理卡号:{}",
|
||
// transactionCode, pileSn, connectorCode, startTime, endTime, sharpPrice, sharpUsedElectricity, sharpPlanLossElectricity, sharpAmount,
|
||
// peakPrice, peakUsedElectricity, peakPlanLossElectricity, peakAmount, flatPrice, flatUsedElectricity, flatPlanLossElectricity, flatAmount,
|
||
// valleyPrice, valleyUsedElectricity, valleyPlanLossElectricity, valleyAmount, ammeterTotalStart, ammeterTotalEnd, totalElectricity, planLossTotalElectricity,
|
||
// consumptionAmount, vinCode, transactionIdentifier, transactionTime, stopReason, stopReasonMsg, logicCard);
|
||
|
||
// 交易记录封装到对象里
|
||
TransactionRecordsData data = TransactionRecordsData.builder()
|
||
// .orderCode(transactionCode)
|
||
.transactionCode(transactionCode)
|
||
.pileSn(pileSn)
|
||
.connectorCode(connectorCode)
|
||
.startTime(startTime)
|
||
.endTime(endTime)
|
||
.sharpPrice(sharpPrice)
|
||
.sharpUsedElectricity(sharpUsedElectricity)
|
||
.sharpPlanLossElectricity(sharpPlanLossElectricity)
|
||
.sharpAmount(sharpAmount)
|
||
.peakPrice(peakPrice)
|
||
.peakUsedElectricity(peakUsedElectricity)
|
||
.peakPlanLossElectricity(peakPlanLossElectricity)
|
||
.peakAmount(peakAmount)
|
||
.flatPrice(flatPrice)
|
||
.flatUsedElectricity(flatUsedElectricity)
|
||
.flatPlanLossElectricity(flatPlanLossElectricity)
|
||
.flatAmount(flatAmount)
|
||
.valleyPrice(valleyPrice)
|
||
.valleyUsedElectricity(valleyUsedElectricity)
|
||
.valleyPlanLossElectricity(valleyPlanLossElectricity)
|
||
.valleyAmount(valleyAmount)
|
||
.ammeterTotalStart(ammeterTotalStart)
|
||
.ammeterTotalEnd(ammeterTotalEnd)
|
||
.totalElectricity(totalElectricity)
|
||
.planLossTotalElectricity(planLossTotalElectricity)
|
||
.consumptionAmount(consumptionAmount)
|
||
.vinCode(vinCode)
|
||
.transactionIdentifier(transactionIdentifier)
|
||
.transactionTime(transactionTime)
|
||
.stopReasonMsg(stopReasonMsg)
|
||
.logicCard(logicCard)
|
||
.build();
|
||
|
||
// boolean flag = !StringUtils.equals("0000000000000000", "a511101970000000");
|
||
// System.out.println(flag);
|
||
|
||
// 处理订单加锁
|
||
String lockKey = "settle_order_" + transactionCode;
|
||
String uuid = IdUtils.fastUUID();
|
||
try {
|
||
// redis锁
|
||
Boolean isLock = redisCache.lock(lockKey, uuid, 1500);
|
||
if (isLock) {
|
||
// transactionRecordsRequestHandler.processOrder(data);
|
||
}
|
||
} catch (Exception e) {
|
||
System.out.println("处理订单发生异常: " + e);
|
||
} finally {
|
||
if (uuid.equals(redisCache.getCacheObject(lockKey).toString())) {
|
||
redisCache.unLock(lockKey);
|
||
}
|
||
}
|
||
}
|
||
|
||
@Test
|
||
public void testFault() {
|
||
StringBuffer sb = new StringBuffer("0100");
|
||
String lowOrder = sb.substring(0, 2);
|
||
String highOrder = sb.substring(2, 4);
|
||
|
||
// String hardwareFault = highOrder + lowOrder;
|
||
byte[] hardwareFaultByteArr = BytesUtil.str2Bcd(highOrder + lowOrder);
|
||
String binStr = BytesUtil.bytes2BinStr(hardwareFaultByteArr);
|
||
// log.info("binStr:{}", binStr); // 0000 0000 0000 0001
|
||
int faultCode = 0;
|
||
for (int i = 0; i < binStr.length(); i++) {
|
||
if (binStr.charAt(i) == '1') {
|
||
faultCode = 15 - i;
|
||
break;
|
||
}
|
||
}
|
||
String faultReason = YKCPileFaultReasonEnum.getValueByCode(faultCode);
|
||
System.out.println(faultReason);
|
||
}
|
||
|
||
|
||
@Test
|
||
public void testQueryCorpMember() {
|
||
List<AdapayMemberAccount> accountList = adapayMemberAccountService.selectAdapayMemberAccountList(new AdapayMemberAccount());
|
||
if (CollectionUtils.isNotEmpty(accountList)) {
|
||
List<String> ids = accountList.stream().map(x -> x.getId() + "").collect(Collectors.toList());
|
||
adapayMemberAccountService.deleteAdapayMemberAccountByIds(ids);
|
||
}
|
||
|
||
// try {
|
||
// Map<String, Object> map = adapayMemberService.selectAdapayMember("5");
|
||
//
|
||
// String adapayMemberId = "ACM29562569";
|
||
// AdapayCorpMemberVO adapayCorpMemberVO = adapayMemberService.queryCorpAdapayMemberInfo(adapayMemberId);
|
||
// System.out.println(adapayCorpMemberVO);
|
||
//
|
||
//
|
||
// } catch (BaseAdaPayException e) {
|
||
// throw new RuntimeException(e);
|
||
// }
|
||
}
|
||
|
||
@Test
|
||
public void testGetPileListByStationIdList() {
|
||
|
||
// List<String> stationIdList = Lists.newArrayList("2");
|
||
// Map<String, List<AMapEquipmentInfo>> pileListByStationIdList = aMapService.getPileListByStationIdList(stationIdList);
|
||
// System.out.println(pileListByStationIdList);
|
||
|
||
GetStationInfoDTO dto = new GetStationInfoDTO();
|
||
dto.setType("page");
|
||
dto.setCurrentPage(12);
|
||
dto.setPageSize(10);
|
||
// dto.setIdList(Lists.newArrayList("395"));
|
||
aMapService.getStationInfosV2(dto);
|
||
}
|
||
|
||
@Test
|
||
public void testMultiSave() {
|
||
String prefix = "test_multi_save:";
|
||
|
||
Map<String, Object> redisMap = Maps.newHashMap();
|
||
|
||
for (int i = 0; i < 1000; i++) {
|
||
redisMap.put(prefix + i, PileInfoVO.builder().pileSn(i + "").build());
|
||
}
|
||
redisCache.multiSave(redisMap, 60);
|
||
}
|
||
|
||
|
||
@Test
|
||
public void testBillingTemplate() {
|
||
pileBillingTemplateService.queryStationBillingTemplateListForUniApp("2");
|
||
}
|
||
|
||
|
||
/**
|
||
* 查询汇付会员信息
|
||
*/
|
||
@Test
|
||
public void testQueryAdapayMemberInfo() {
|
||
String adapayMemberId = "ACM82792551";
|
||
String settleAccountId = null;
|
||
try {
|
||
AdapayCorpMemberVO adapayCorpMemberVO = adapayService.queryCorpAdapayMemberInfo(adapayMemberId, wechatAppId1);
|
||
// AdapaySettleAccountVO vo = adapayService.queryAdapaySettleAccount(adapayMemberId, settleAccountId, wechatAppId1);
|
||
System.out.println(JSON.toJSONString(adapayCorpMemberVO));
|
||
} catch (BaseAdaPayException e) {
|
||
throw new RuntimeException(e);
|
||
}
|
||
}
|
||
|
||
@Test
|
||
public void testSaveAdapayCallbackRecord() throws JsonProcessingException {
|
||
String data = "{\n" +
|
||
" \"object\": \"refund\",\n" +
|
||
" \"status\": \"succeeded\",\n" +
|
||
" \"prod_mode\": \"true\",\n" +
|
||
" \"id\": \"0022120230531111946980509821471137853440\",\n" +
|
||
" \"refund_order_no\": \"823725974557265920\",\n" +
|
||
" \"payment_id\": \"002212023053110524210509814658135928832\",\n" +
|
||
" \"payment_order_no\": \"C27262970851\",\n" +
|
||
" \"refund_amt\": \"7.82\",\n" +
|
||
" \"fee_amt\": \"0.04\",\n" +
|
||
" \"channel_no\": \"2023053121R064uj\",\n" +
|
||
" \"created_time\": \"1685503187000\",\n" +
|
||
" \"succeed_time\": \"1685503199000\",\n" +
|
||
" \"app_id\": \"app_d0c80cb1-ffc8-48cb-a030-fe9bec823aaa\",\n" +
|
||
" \"reason\": \"\",\n" +
|
||
" \"notify_url\": \"https://api.jsowellcloud.com/uniapp/pay/adapayRefundCallback\"\n" +
|
||
"}";
|
||
|
||
JSONObject jsonObject = JSON.parseObject(data);
|
||
ObjectMapper mapper = new ObjectMapper();
|
||
mapper.setPropertyNamingStrategy(PropertyNamingStrategies.SNAKE_CASE);
|
||
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
||
AdapayRefundRecord adapayRefundRecord = mapper.readValue(jsonObject.toJSONString(), AdapayRefundRecord.class);
|
||
adapayRefundRecord.setRefundId(jsonObject.getString("id"));
|
||
// 保存到数据库
|
||
adapayRefundRecordService.insertAdapayRefundRecord(adapayRefundRecord);
|
||
}
|
||
|
||
@Test
|
||
public void testQueryCallback() {
|
||
AdapayCallbackRecord aaaa = adapayCallbackRecordService.selectByOrderCode("aaaa");
|
||
System.out.println(aaaa);
|
||
}
|
||
|
||
@Test
|
||
public void testAdapayRefund() {
|
||
// 创建汇付退款对象 在完成初始化设置情况下,调用方法,获取 Refund对象
|
||
try {
|
||
String id = "002212023052710075810508353847861903360";
|
||
String refundAmount = "0.01";
|
||
Map<String, Object> refundParams = Maps.newHashMap();
|
||
refundParams.put("refund_amt", AdapayUtil.formatAmount(refundAmount));
|
||
refundParams.put("refund_order_no", SnowflakeIdWorker.getSnowflakeId());
|
||
refundParams.put("notify_url", "https://api.jsowellcloud.com/uniapp/pay/adapayRefundCallback");
|
||
Map<String, Object> response = Refund.create(id, refundParams);
|
||
System.out.println(JSON.toJSONString(response));
|
||
// if (response != null && !response.isEmpty()) {
|
||
// JSONObject jsonObject = JSONObject.parseObject(response.get("expend").toString());
|
||
// JSONObject pay_info = jsonObject.getJSONObject("pay_info");
|
||
// Map<String, Object> resultMap = JSONObject.parseObject(pay_info.toJSONString(), new TypeReference<Map<String, Object>>() {});
|
||
// }
|
||
} catch (Exception e) {
|
||
System.out.println(e);
|
||
}
|
||
}
|
||
|
||
@Test
|
||
public void testSaveCallback() throws JsonProcessingException {
|
||
String data = "{\"app_id2\":\"app_d0c80cb1-ffc8-48cb-a030-fe9bec823aaa\",\"created_time\":\"20230530132956\",\"description\":\"{\\\"orderCode\\\":\\\"C29505932783\\\",\\\"type\\\":\\\"order\\\"}\",\"end_time\":\"20230530133027\",\"expend\":{\"bank_type\":\"OTHERS\",\"open_id\":\"o8jhot6PJF93EPhNISsXi28dKdS8\",\"sub_open_id\":\"o4REX5MprZfTaLnVNxfdOY-wnwGI\"},\"fee_amt\":\"0.11\",\"id\":\"002212023053013295610509491838664794112\",\"order_no\":\"C29505932783\",\"out_trans_id\":\"4200001855202305308670391485\",\"party_order_id\":\"02212305304859640306711\",\"pay_amt\":\"20.00\",\"pay_channel\":\"wx_lite\",\"real_amt\":\"20.00\",\"share_eq\":\"Y\",\"status\":\"succeeded\",\"wx_user_id\":\"\"}";
|
||
JSONObject jsonObject = JSON.parseObject(data);
|
||
ObjectMapper mapper = new ObjectMapper();
|
||
mapper.setPropertyNamingStrategy(PropertyNamingStrategies.SNAKE_CASE);
|
||
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
||
AdapayCallbackRecord adapayCallbackRecord = mapper.readValue(jsonObject.toJSONString(), AdapayCallbackRecord.class);
|
||
adapayCallbackRecord.setExpend(jsonObject.getString("expend"));
|
||
adapayCallbackRecord.setPaymentId(jsonObject.getString("id"));
|
||
// adapayCallbackRecordService.saveAdapayCallbackRecord(adapayCallbackRecord);
|
||
|
||
}
|
||
|
||
@Test
|
||
public void testAMap() throws Exception {
|
||
String pileConnectorCode = "8800000000012601";
|
||
// String s = aMapService.pushChargingDeviceDynamics(pileConnectorCode);
|
||
GetStationInfoDTO dto = new GetStationInfoDTO();
|
||
dto.setType("page");
|
||
// aMapService.getStationInfos(dto);
|
||
}
|
||
|
||
@Test
|
||
public void testVinCode() {
|
||
String msg = "880000000000210203000000000000000000000000000000000000000000000000004C5257594743454B584D43303437313434";
|
||
// 获取消息体
|
||
byte[] msgBody = BytesUtil.str2Bcd(msg);
|
||
|
||
int startIndex = 0;
|
||
int length = 7;
|
||
|
||
// 桩编码
|
||
byte[] pileSnByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
||
String pileSn = BytesUtil.binary(pileSnByteArr, 16);
|
||
|
||
// 保存时间
|
||
// saveLastTime(pileSn, channel);
|
||
|
||
// 枪号
|
||
startIndex += length;
|
||
length = 1;
|
||
byte[] connectorNumByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
||
String connectorCode = BytesUtil.bcd2Str(connectorNumByteArr);
|
||
|
||
// 启动方式
|
||
// 0x01 表示通过刷卡启动充电
|
||
// 0x02 表求通过帐号启动充电 (暂不支持)
|
||
// 0x03 表示vin码启动充电
|
||
startIndex += length;
|
||
byte[] startModeByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
||
String startMode = BytesUtil.bcd2Str(startModeByteArr);
|
||
|
||
// 是否需要密码 0x00 不需要 0x01 需要
|
||
startIndex += length;
|
||
byte[] needPasswordFlagByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
||
String needPasswordFlag = BytesUtil.bcd2Str(needPasswordFlagByteArr);
|
||
|
||
// 物理卡号 不足 8 位补 0
|
||
startIndex += length;
|
||
length = 8;
|
||
byte[] cardNumByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
||
String physicsCard = BytesUtil.binary(cardNumByteArr, 16);
|
||
|
||
// 输入密码 对用户输入的密码进行16 位MD5 加密,采用小写上传
|
||
startIndex += length;
|
||
length = 16;
|
||
byte[] inputPasswordByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
||
|
||
// VIN码
|
||
startIndex += length;
|
||
length = 17;
|
||
byte[] vinCodeByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
||
String vinCode = BytesUtil.ascii2Str(vinCodeByteArr);
|
||
System.out.println("桩号:" + pileSn + "申请充电VIN码:" + vinCode);
|
||
|
||
/**
|
||
* 刷卡启动充电
|
||
*/
|
||
String logicCard = "";
|
||
byte[] authenticationFlagByteArr = Constants.zeroByteArray; // 鉴权成功标识
|
||
byte[] accountBalanceByteArr = Constants.zeroByteArray; // 账户余额
|
||
String transactionCode = "";
|
||
|
||
try {
|
||
/**
|
||
* VIN码启动充电
|
||
*/
|
||
if (StringUtils.equals("03", startMode)) {
|
||
// 通过vin码查询数据库绑定用户信息
|
||
MemberPlateNumberRelation plateInfo = memberPlateNumberRelationService.getMemberPlateInfoByVinCode(vinCode);
|
||
if (plateInfo == null) {
|
||
throw new BusinessException("", "未查到绑定用户信息");
|
||
}
|
||
if (!StringUtils.equals("1", plateInfo.getVinStatus())) {
|
||
// 1- 正常使用
|
||
throw new BusinessException("", "vin状态不正确");
|
||
}
|
||
// vin码生成订单 vin启动充电
|
||
GenerateOrderDTO dto = new GenerateOrderDTO();
|
||
dto.setMemberPlateNumberRelation(plateInfo);
|
||
dto.setPileSn(pileSn);
|
||
dto.setConnectorCode(connectorCode);
|
||
dto.setStartMode(StartModeEnum.VIN_CODE.getValue());
|
||
Map<String, Object> map = orderBasicInfoService.generateOrderByCard(dto);
|
||
if (map != null) {
|
||
transactionCode = (String) map.get("transactionCode");
|
||
accountBalanceByteArr = YKCUtils.getPriceByte(String.valueOf(map.get("accountBalance")), 2);
|
||
// 鉴权成功标识 0x00 失败 0x01 成功
|
||
authenticationFlagByteArr = Constants.oneByteArray;
|
||
} else {
|
||
throw new BusinessException("", "生成vin订单失败");
|
||
}
|
||
}
|
||
} catch (BusinessException e) {
|
||
e.printStackTrace();
|
||
System.out.println("1");
|
||
// log.error("VIN码启动充电鉴权 error:{}, {}", e.getCode(), e.getMessage());
|
||
} catch (Exception e) {
|
||
e.printStackTrace();
|
||
System.out.println("2");
|
||
transactionCode = "00000000000000000000000000000000";
|
||
accountBalanceByteArr = BytesUtil.checkLengthAndBehindAppendZero(accountBalanceByteArr, 8);
|
||
authenticationFlagByteArr = Constants.zeroByteArray;
|
||
// log.error("VIN码启动充电鉴权 error", e);
|
||
}
|
||
byte[] serialNumByteArr = BytesUtil.str2Bcd(transactionCode);
|
||
|
||
byte[] defeatReasonByteArr = Constants.zeroByteArray;
|
||
|
||
// 不足位数的值补零
|
||
// cardNumByteArr = BytesUtil.checkLengthAndBehindAppendZero(cardNumByteArr, 16);
|
||
// serialNumByteArr = BytesUtil.checkLengthAndBehindAppendZero(serialNumByteArr, 32);
|
||
// pileSnByteArr = BytesUtil.checkLengthAndBehindAppendZero(pileSnByteArr, 14);
|
||
// accountBalanceByteArr = BytesUtil.checkLengthAndBehindAppendZero(accountBalanceByteArr, 8);
|
||
|
||
// 拼装消息体
|
||
byte[] msgBodyByteArr = Bytes.concat(serialNumByteArr, pileSnByteArr, connectorNumByteArr, cardNumByteArr, accountBalanceByteArr,
|
||
authenticationFlagByteArr, defeatReasonByteArr);
|
||
|
||
String s = BytesUtil.bin2HexStr(msgBodyByteArr);
|
||
System.out.println(s);
|
||
}
|
||
|
||
@Test
|
||
public void testGenerateLianlianToken() throws UnsupportedEncodingException {
|
||
String OperatorID = "425010765";
|
||
String OperatorSecret = "123123123123aaaa"; // 1234567890abcdef
|
||
|
||
//请求dataX
|
||
Map<String, String> data = new HashMap<>();
|
||
data.put("OperatorID", OperatorID);
|
||
data.put("OperatorSecret", OperatorSecret);
|
||
String dataJson = JSONUtil.toJsonStr(data);
|
||
|
||
//加密
|
||
byte[] encryptText = Cryptos.aesEncrypt(dataJson.getBytes(StandardCharsets.UTF_8),
|
||
OperatorSecret.getBytes(), OperatorSecret.getBytes());
|
||
String strData = Encodes.encodeBase64(encryptText);
|
||
|
||
Map<String, String> request = new LinkedHashMap<>();
|
||
request.put("OperatorID", OperatorID);
|
||
request.put("Data", strData);
|
||
request.put("TimeStamp", System.currentTimeMillis() + "");
|
||
request.put("Seq", "0001");
|
||
|
||
//生成签名
|
||
String sig = GBSignUtils.sign(request, OperatorSecret);
|
||
request.put("Sig", sig);
|
||
String tokenRequest = JSONUtil.toJsonStr(request);
|
||
|
||
CommonParamsDTO dto = JSONObject.parseObject(tokenRequest, CommonParamsDTO.class);
|
||
|
||
lianLianService.generateToken(dto);
|
||
}
|
||
|
||
@Test
|
||
public void testupdateElecAmount() {
|
||
// orderBasicInfoService.updateElecAmount();
|
||
}
|
||
|
||
@Test
|
||
public void testSelectSomeStatusCardInfo() {
|
||
PileAuthCard pileAuthCard = pileAuthCardService.selectCardInfoByLogicCard("1111111111111111");
|
||
System.out.println(pileAuthCard);
|
||
}
|
||
|
||
@Test
|
||
public void testLianLian() throws UnsupportedEncodingException {
|
||
// 获取令牌
|
||
// LianLianGetTokenDTO dto = new LianLianGetTokenDTO();
|
||
// dto.setOperatorId("MA1JLFUU8");
|
||
// dto.setOperatorSecret("Nh62XxlIR5OjAzFj");
|
||
// String token = lianLianService.getToken("", "MA1JLFUU8", "fGwLsxW1HdzLw7jp");
|
||
// System.out.println("token:" + token);
|
||
|
||
String operatorId = "425010765";
|
||
String operatorSecret = "3DSBTWHVIC6KVCKI";
|
||
// 请求data
|
||
// Map<String, String> data = new HashMap<>();
|
||
// data.put("OperatorID", operatorId);
|
||
// data.put("OperatorSecret", operatorSecret);
|
||
// String dataJson = JSONUtil.toJsonStr(data);
|
||
|
||
JSONObject json = new JSONObject();
|
||
// json.put("StationIDs", com.google.common.collect.Lists.newArrayList("1", "2"));
|
||
json.put("LastQueryTime", "2023-05-29 10:00:00");
|
||
json.put("PageNo", 1);
|
||
json.put("PageSize", 10);
|
||
|
||
String dataJson = JSON.toJSONString(json);
|
||
// 加密
|
||
byte[] encryptText = Cryptos.aesEncrypt(dataJson.getBytes(StandardCharsets.UTF_8),
|
||
operatorSecret.getBytes(), operatorSecret.getBytes());
|
||
String strData = Encodes.encodeBase64(encryptText);
|
||
String timeStamp = DateUtils.parseDateToStr(DateUtils.YYYYMMDDHHMMSS, new Date());
|
||
Map<String, String> request = new LinkedHashMap<>();
|
||
request.put("OperatorID", operatorId);
|
||
request.put("Data", strData);
|
||
request.put("TimeStamp", timeStamp);
|
||
request.put("Seq", "0001");
|
||
|
||
// 生成签名
|
||
String sig = GBSignUtils.sign(request, operatorSecret);
|
||
request.put("Sig", sig);
|
||
JSONObject jsonObject = new JSONObject(request);
|
||
System.out.println(jsonObject);
|
||
// CommonParamsDTO dto = new CommonParamsDTO();
|
||
// dto.setOperatorID(operatorId);
|
||
// dto.setData(strData);
|
||
// dto.setTimeStamp(timeStamp);
|
||
// dto.setSeq("0001");
|
||
// dto.setSig(sig);
|
||
// Map<String, String> map = lianLianService.generateToken(dto);
|
||
QueryStationInfoDTO dto = new QueryStationInfoDTO();
|
||
dto.setOperatorId(operatorId);
|
||
Map<String, String> map = lianLianService.query_stations_info(dto);
|
||
// String data1 = map.get("Data");
|
||
// 解密data
|
||
// String data1 = "JudlP17tnYuQc2zwOzmjJAb9hgghIymefG5v3ZzSOlPDh5+bJHIedsYzKMD56tHlmlg6Cb7vG+o6KjMSSpn1fyqBH3UVaEFF7uEc+lOuEc9c1vUzq20vBQ7N3EpDKqVBKjZbOezMsKYaCX7Br8XTsCYT8VCQui/np3cn+phi3VC+0s1coNxBX7xoEDZ7iuPjPoSWL7g3J0uOw2SoGaIdBQG3eTxaZJ5L+vBmuDF0pEXgazTMnuKml1mx1QHkig2F7h/ILT0VEKVXWMmmogYgiBk5ItO0DyzRl+ASb184gOhYGo82GJmWRiXrAXmceCiSNvTGg6aL26imIGKkJNfOx9/9mTqjGvy6kzxvWJ29PBU=";
|
||
// byte[] plainText = Cryptos.aesDecrypt(Encodes.decodeBase64(data1),
|
||
// operatorSecret.getBytes(), operatorSecret.getBytes());
|
||
// String dataStr = new String(plainText, "UTF-8");
|
||
// Map<String, String> resultMap = (Map<String, String>) JSON.parse(dataStr);
|
||
//
|
||
// String token = resultMap.get("AccessToken");
|
||
//
|
||
// System.out.println("解密后token:" + token);
|
||
|
||
// LianLianPushStationInfoDTO dto1 = LianLianPushStationInfoDTO.builder()
|
||
// .OperatorID("MA1JLFUU8")
|
||
// .DataSecret("HVicnbRZbhPdIdpF")
|
||
// .DataSecretIV("JNvcjSOn1vhrE11M")
|
||
// .SigSecret("53TtFpc4gdVZbF3x")
|
||
// // .token(token)
|
||
// .stationId(2L)
|
||
//
|
||
// .build();
|
||
// lianLianService.pushStationInfo(dto1);
|
||
|
||
// 推送订单状态
|
||
// lianLianService.pushConnectorStatus("8800000000000101", "1");
|
||
|
||
// 推送订单信息
|
||
// lianLianService.pushOrderInfo("C27680791529");
|
||
|
||
// 推送启动充电结果
|
||
// lianLianService.pushStartChargeResult("C27680791529");
|
||
|
||
// 推送充电状态
|
||
// lianLianService.pushChargeStatus("C27680791529");
|
||
|
||
// 推送停止充电结果
|
||
// lianLianService.pushStopChargeResult("C27680791529");
|
||
|
||
// 推送充电订单信息
|
||
// lianLianService.pushChargeOrderInfo("C27680791529");
|
||
|
||
// 推送订单结算信息
|
||
// lianLianService.pushOrderSettlementInfo("C27680791529");
|
||
|
||
// 查询订单结算信息
|
||
// lianLianService.queryOrderSettlementInfo("C27680791529");
|
||
|
||
// 推送订单对账结果信息
|
||
// lianLianService.pushOrderReconciliationInfo("C27680791529");
|
||
|
||
// 测试生成、解密令牌
|
||
// long ttlMillis = 60 * 60 * 24 * 1000;
|
||
// String token = JWTUtils.createToken(operatorId, operatorSecret, ttlMillis);
|
||
// System.out.println(JWTUtils.checkThirdPartyToken(token));
|
||
|
||
JSONObject jsonObject1 = new JSONObject(map);
|
||
jsonObject1.put("OperatorID", "425010765");
|
||
jsonObject1.put("Data", "Ntu99RpveEOm2VUNq6RpD7OuOPXRbNxMOPmaBl67nkLk0nD/VmhipdSpq/Qfswhe1o55YMT+3Z7e6xe3fiJA3cZcvetxOEUF6sjvKLRq2rU=");
|
||
jsonObject1.put("TimeStamp", "20230530090132");
|
||
jsonObject1.put("Seq", "0001");
|
||
jsonObject1.put("Sig", "1568D2D35B245A0205B33D0EF92E7981");
|
||
|
||
String jsonString = JSON.toJSONString(jsonObject1);
|
||
|
||
String result = HttpUtils.sendPostContentType("http://localhost:8080/LianLian/v1/query_stations_info", jsonString, "application/json");
|
||
JSONObject object = JSONObject.parseObject(result);
|
||
String data1 = (String) object.get("data");
|
||
// 解密data
|
||
byte[] plainText = Cryptos.aesDecrypt(Encodes.decodeBase64(data1),
|
||
operatorSecret.getBytes(), operatorSecret.getBytes());
|
||
String dataStr = new String(plainText, StandardCharsets.UTF_8);
|
||
Map<String, String> resultMap = (Map<String, String>) JSON.parse(dataStr);
|
||
}
|
||
|
||
|
||
@Test
|
||
public void testRefundForBalance() {
|
||
BigDecimal refundAmount = new BigDecimal("2");
|
||
// 退款金额 元转分 123
|
||
int refundTotalCents = refundAmount.multiply(new BigDecimal(100)).intValue();
|
||
|
||
// 查询用户充值余额订单 过滤掉已经退款的充值订单 refundableOrder
|
||
List<RefundableWxPayOrderData> recordList = Lists.newArrayList();
|
||
// recordList.add(RefundableWxPayOrderData.builder().outTradeNo("1").transactionId("1").payerAmount(new BigDecimal("1000")).refundableAmount(new BigDecimal("0")).build());
|
||
// recordList.add(RefundableWxPayOrderData.builder().outTradeNo("2").transactionId("2").payerAmount(new BigDecimal("1000")).refundableAmount(new BigDecimal("0")).build());
|
||
recordList.add(RefundableWxPayOrderData.builder().outTradeNo("3").transactionId("3").payerAmount(Constants.WHITELIST_DEFAULT_AMOUNT).refundableAmount(new BigDecimal("300")).build());
|
||
|
||
// 也许需要多笔支付订单才够退款
|
||
List<WechatPayRefundRequest> requestList = com.google.common.collect.Lists.newArrayList();
|
||
WechatPayRefundRequest request;
|
||
for (RefundableWxPayOrderData record : recordList) {
|
||
int refundableTotal = record.getRefundableAmount().intValue(); // 该笔支付订单的可退金额,单位分
|
||
int payerTotal = record.getPayerAmount().intValue(); // 该笔支付订单的支付金额,单位分
|
||
// 用户申请退款金额-可退金额
|
||
refundTotalCents = refundTotalCents - refundableTotal; // 123 - 100
|
||
request = new WechatPayRefundRequest();
|
||
request.setTransaction_id(record.getTransactionId()); // 微信支付单号
|
||
request.setOut_trade_no(record.getOutTradeNo()); // 商户订单号
|
||
request.setOut_refund_no(SnowflakeIdWorker.getSnowflakeId()); // 商户退款单号
|
||
request.setNotify_url(WeChatPayParameter.refundNotifyUrl); // 回调接口
|
||
request.setReason("用户余额退款");
|
||
request.setFunds_account("AVAILABLE");
|
||
if (refundTotalCents > 0) {
|
||
// 如果大于0说明,这笔单退完也不够
|
||
WechatPayRefundRequest.Amount amount = new WechatPayRefundRequest.Amount();
|
||
amount.setRefund(refundableTotal); // 退款金额
|
||
amount.setTotal(payerTotal); // 原订单金额
|
||
request.setAmount(amount);
|
||
requestList.add(request);
|
||
} else {
|
||
// 如果小于0,这笔单退一部分
|
||
// 生成退款单号
|
||
WechatPayRefundRequest.Amount amount = new WechatPayRefundRequest.Amount();
|
||
// 部分退
|
||
int i = refundableTotal + refundTotalCents;
|
||
amount.setRefund(i); // 退款金额
|
||
amount.setTotal(payerTotal); // 原订单金额
|
||
request.setAmount(amount);
|
||
requestList.add(request);
|
||
break;
|
||
}
|
||
}
|
||
|
||
System.out.println(requestList);
|
||
}
|
||
|
||
@Test
|
||
public void testCloseStartFailedOrder() {
|
||
String startTime = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, DateUtils.addDays(new Date(), -2));
|
||
String endTime = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, new Date());
|
||
orderBasicInfoService.closeStartFailedOrder(startTime, endTime);
|
||
}
|
||
|
||
@Test
|
||
public void testRedisSaveRealTimeData() {
|
||
String pileSn = "88000000000001";
|
||
String connectorCode = "01";
|
||
String orderCode = "88000000000001012211161342359448";
|
||
|
||
String pileConnectorCode = pileSn + connectorCode;
|
||
String redisKey = CacheConstants.PILE_REAL_TIME_MONITOR_DATA + pileConnectorCode + "_" + orderCode;
|
||
|
||
// for (int i = 0; i < 10; i++) {
|
||
// try {
|
||
// Thread.sleep(10000);
|
||
// } catch (InterruptedException e) {
|
||
// e.printStackTrace();
|
||
// }
|
||
// Date now = new Date();
|
||
// redisCache.hset(redisKey, DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:00", now), i + ":" + DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss", now));
|
||
// }
|
||
|
||
orderBasicInfoService.getChargingRealTimeData(orderCode);
|
||
}
|
||
|
||
@Test
|
||
public void testuniformMessageSend() {
|
||
AppletTemplateMessageSendDTO appletTemplateMessageSendDTO = new AppletTemplateMessageSendDTO();
|
||
// String openId = wxAppletRemoteService.getOpenIdByCode("0537u2100jTXsP1Y0Y300j426t47u210");
|
||
// System.out.println("openId:" + openId);
|
||
|
||
appletTemplateMessageSendDTO.setTouser("o4REX5MprZfTaLnVNxfdOY-wnwGI"); // openid
|
||
|
||
String templateId = "UyBPbADlZfsCj89rh_xvfZGlxTW5J5KURpZtt9CNFrY";
|
||
appletTemplateMessageSendDTO.setTemplate_id(templateId);
|
||
// appletTemplateMessageSendDTO.setPage("跳转的页面");
|
||
Map<String, Object> map = new HashMap<>();
|
||
map.put("amount17", ImmutableMap.of("value", "¥100")); // 结束时间
|
||
map.put("time3", ImmutableMap.of("value", "2022-12-30")); // 结束时间
|
||
map.put("thing7", ImmutableMap.of("value", "thing7")); // 结束原因
|
||
|
||
// map.put("thing5", ImmutableMap.of("value", "thing5")); // 结束原因
|
||
// map.put("time2", ImmutableMap.of("value", "time2")); // 结束原因
|
||
appletTemplateMessageSendDTO.setData(map);
|
||
|
||
wxAppletRemoteService.uniformMessageSend(appletTemplateMessageSendDTO);
|
||
}
|
||
|
||
@Test
|
||
public void testWeChatRefund() {
|
||
ApplyRefundDTO dto = new ApplyRefundDTO();
|
||
dto.setRefundType("2");
|
||
dto.setMemberId("82100864");
|
||
dto.setRefundAmount(new BigDecimal("1.23"));
|
||
// orderBasicInfoService.weChatRefund(dto);
|
||
}
|
||
|
||
@Test
|
||
public void testSelectBalanceRechargeRecord() {
|
||
List<WxpayCallbackRecord> list = wxpayCallbackRecordService.queryBalanceRechargeRecordOfTheLatestYear("82100864");
|
||
System.out.println(list);
|
||
}
|
||
|
||
@Test
|
||
public void testSelectOrderBasicInfoList() {
|
||
QueryOrderDTO orderBasicInfo = new QueryOrderDTO();
|
||
orderBasicInfo.setPileSn("88000000000001");
|
||
orderBasicInfo.setOrderStatus(OrderStatusEnum.IN_THE_CHARGING.getValue());
|
||
List<OrderListVO> orderListVOS = orderBasicInfoService.selectOrderBasicInfoList(orderBasicInfo);
|
||
System.out.println(orderListVOS);
|
||
for (OrderListVO orderListVO : orderListVOS) {
|
||
if (StringUtils.equals(orderListVO.getOrderStatus(), OrderStatusEnum.IN_THE_CHARGING.getValue())) {
|
||
// 修改数据库订单状态
|
||
OrderBasicInfo info = OrderBasicInfo.builder()
|
||
.id(Integer.parseInt(orderListVO.getId()))
|
||
.orderStatus(OrderStatusEnum.ABNORMAL.getValue())
|
||
.build();
|
||
orderBasicInfoService.updateOrderBasicInfo(info);
|
||
}
|
||
}
|
||
}
|
||
|
||
@Test
|
||
public void testWechatRefund() throws JsonProcessingException {
|
||
WechatPayRefundRequest request = new WechatPayRefundRequest();
|
||
request.setTransaction_id("4200001656202212302746036536"); // 微信支付单号
|
||
request.setOut_trade_no("768677222373363712"); // 商户订单号
|
||
// 生成退款单号
|
||
request.setOut_refund_no(SnowflakeIdWorker.getSnowflakeId()); // 商户退款单号
|
||
request.setNotify_url(WeChatPayParameter.refundNotifyUrl); // 回调接口
|
||
WechatPayRefundRequest.Amount amount = new WechatPayRefundRequest.Amount();
|
||
amount.setRefund(10 * 100); // 退款金额
|
||
amount.setTotal(10 * 100); // 原订单金额
|
||
request.setAmount(amount);
|
||
request.setReason("结算退款");
|
||
request.setFunds_account("AVAILABLE");
|
||
|
||
// wechatPayService.ApplyForWechatPayRefundV3(request);
|
||
|
||
// 退款方法
|
||
|
||
}
|
||
|
||
@Test
|
||
public void testUpdatePileSimInfo() {
|
||
String pileSn = "88000000000001";
|
||
String iccid = "89860402102091089943";
|
||
pileBasicInfoService.updatePileSimInfo(pileSn, iccid);
|
||
}
|
||
|
||
@Test
|
||
public void testPay() {
|
||
// String code = "081zIoGa11GamE0iVVIa1aaJ4G0zIoGE";
|
||
// String openId = memberService.getOpenIdByCode(code);
|
||
// Map<String, Object> pay = null;
|
||
// try {
|
||
// WeixinPayDTO dto = new WeixinPayDTO();
|
||
// dto.setOpenId(openId);
|
||
// dto.setAmount("0.01");
|
||
// pay = orderService.weixinPayV3(dto);
|
||
// } catch (Exception e) {
|
||
// e.printStackTrace();
|
||
// }
|
||
// System.out.println(JSON.toJSONString(pay));
|
||
}
|
||
|
||
@Test
|
||
public void testMemberRegisterAndLogin() throws BaseAdaPayException {
|
||
|
||
|
||
}
|
||
|
||
@Test
|
||
public void testMemberBasicInfoMapper() {
|
||
// String memberId = "21772870";
|
||
// BigDecimal principalBalance = new BigDecimal("-10");
|
||
// BigDecimal giftBalance = new BigDecimal("-110");
|
||
// Integer version = 2;
|
||
// int i = memberBasicInfoMapper.updateMemberBalance(memberId, principalBalance, giftBalance, version);
|
||
// if (i == 1) {
|
||
// System.out.println("更新余额成功");
|
||
// } else {
|
||
// System.out.println("更新余额失败");
|
||
// }
|
||
|
||
Map<String, Object> refundParams = new HashMap<>(2);
|
||
refundParams.put("payment_id", "002212023071011321210524320114191904768");
|
||
// refundParams.put("refund_id", refund_id);
|
||
// refundParams.put("refund_order_no", refund_order_no);
|
||
try {
|
||
Map<String, Object> refund = Refund.query(refundParams);
|
||
System.out.println(refund);
|
||
} catch (BaseAdaPayException e) {
|
||
throw new RuntimeException(e);
|
||
}
|
||
}
|
||
|
||
/**
|
||
* 查询退款信息
|
||
*/
|
||
@Test
|
||
public void queryRefundTest() {
|
||
List<String> list = getPaymentIdList(); // 查询退款信息
|
||
for (String paymentId : list) {
|
||
Map<String, Object> refundParams = Maps.newHashMap();
|
||
refundParams.put("payment_id", paymentId);
|
||
try {
|
||
Map<String, Object> refund = Refund.query(refundParams, wechatAppId2);
|
||
System.out.println("支付id:" + paymentId + ", 退款信息:" + JSON.toJSONString(refund));
|
||
System.out.println();
|
||
} catch (BaseAdaPayException e) {
|
||
throw new RuntimeException(e);
|
||
}
|
||
}
|
||
}
|
||
|
||
/**
|
||
* 查询支付撤销信息
|
||
*/
|
||
@Test
|
||
public void queryPaymentReverseTest() {
|
||
List<String> list = getPaymentIdList(); // 查询支付撤销信息
|
||
for (String paymentId : list) {
|
||
try {
|
||
Map<String, Object> reverse = Maps.newHashMap();
|
||
reverse.put("payment_id", paymentId);
|
||
reverse.put("app_id", wechatAppId2);
|
||
Map<String, Object> response = PaymentReverse.queryList(reverse, wechatAppId2);
|
||
System.out.printf("支付id: %s, 支付撤销信息: %s%n", paymentId, JSON.toJSONString(response));
|
||
System.out.println();
|
||
} catch (BaseAdaPayException e) {
|
||
throw new RuntimeException(e);
|
||
}
|
||
}
|
||
}
|
||
|
||
@Test
|
||
public void testGenerateBillingTemplateMsgBody() {
|
||
String pileSn = "13273881";
|
||
// 根据桩号查询计费模板
|
||
BillingTemplateVO billingTemplateVO = pileBillingTemplateService.queryUsedBillingTemplateForEBike("2");
|
||
System.out.println(billingTemplateVO);
|
||
// byte[] messageBody = pileBillingTemplateService.generateBillingTemplateMsgBody(pileSn, billingTemplateVO);
|
||
// System.out.println(BytesUtil.binary(messageBody, 16));
|
||
}
|
||
|
||
@Test
|
||
public void testAnalysisPileParameter() {
|
||
BasicPileDTO dto = new BasicPileDTO();
|
||
// 3个都不传的情况
|
||
try {
|
||
System.out.println("3个都不传的情况");
|
||
dto.setPileSn("");
|
||
dto.setConnectorCode("");
|
||
dto.setPileConnectorCode("");
|
||
// orderService.analysisPileParameter(dto);
|
||
System.out.println("数据正确");
|
||
} catch (BusinessException e) {
|
||
System.out.println(e.getMessage());
|
||
}
|
||
System.out.println();
|
||
|
||
// 只传sn的情况
|
||
try {
|
||
System.out.println("只传sn的情况");
|
||
dto.setConnectorCode("");
|
||
dto.setPileConnectorCode("");
|
||
dto.setPileSn("88000000000001");
|
||
// orderService.analysisPileParameter(dto);
|
||
System.out.println("数据正确");
|
||
} catch (BusinessException e) {
|
||
System.out.println(e.getMessage());
|
||
}
|
||
System.out.println();
|
||
|
||
//
|
||
try {
|
||
System.out.println("只穿枪口号的情况");
|
||
dto.setConnectorCode("01");
|
||
dto.setPileConnectorCode("");
|
||
dto.setPileSn("");
|
||
// orderService.analysisPileParameter(dto);
|
||
System.out.println("数据正确");
|
||
} catch (BusinessException e) {
|
||
System.out.println(e.getMessage());
|
||
}
|
||
System.out.println();
|
||
|
||
// 只传充电桩枪口编号的情况
|
||
try {
|
||
System.out.println("只传充电桩枪口编号的情况");
|
||
dto.setPileConnectorCode("8800000000000101");
|
||
dto.setConnectorCode("");
|
||
dto.setPileSn("");
|
||
// orderService.analysisPileParameter(dto);
|
||
System.out.println("数据正确");
|
||
} catch (BusinessException e) {
|
||
System.out.println(e.getMessage());
|
||
}
|
||
|
||
try {
|
||
System.out.println();
|
||
System.out.println("传充电桩枪sn+枪口号的情况");
|
||
dto.setPileConnectorCode("");
|
||
dto.setConnectorCode("01");
|
||
dto.setPileSn("88000000000001");
|
||
// orderService.analysisPileParameter(dto);
|
||
System.out.println("数据正确");
|
||
} catch (BusinessException e) {
|
||
System.out.println(e.getMessage());
|
||
}
|
||
}
|
||
|
||
@Test
|
||
public void testImportBillingTemplate() {
|
||
ImportBillingTemplateDTO dto = new ImportBillingTemplateDTO();
|
||
dto.setBillingTemplateId("1");
|
||
// 查询公共计费模板是否存在
|
||
PileBillingTemplate pileBillingTemplate = pileBillingTemplateMapper.selectPileBillingTemplateById(Long.valueOf(dto.getBillingTemplateId()));
|
||
if (pileBillingTemplate == null) {
|
||
|
||
}
|
||
List<PileBillingDetail> billingDetailList = pileBillingTemplate.getPileBillingDetailList();
|
||
}
|
||
|
||
@Test
|
||
public void testProcess() {
|
||
// 62 68
|
||
String msgString = "680da300000388000000000001010020d06840a40000130000000000000000000000000000000088000000000001010202000000000000000000000000000000000000000000000000000000000000000000001516";
|
||
byte[] msg = BytesUtil.str2Bcd(msgString);
|
||
boolean b = YKCUtils.checkMsg(msg);
|
||
// ykcBusinessService.process(msg, null);
|
||
}
|
||
|
||
@Test
|
||
public void testHeartbeat() {
|
||
// heartbeatRequestHandler.updateStatus("88000000000001", "01", "0");
|
||
|
||
// heartbeatRequestHandler.updateStatus("88000000000001", "02", "0");
|
||
}
|
||
|
||
@Test
|
||
public void testPush() {
|
||
byte[] msg = new byte[]{};
|
||
String pileSn = "88000000000001";
|
||
// ykcPushBusinessService.push(msg, pileSn, YKCFrameTypeCode.READ_REAL_TIME_MONITOR_DATA_CODE);
|
||
}
|
||
|
||
@Test
|
||
public void TestMapUtils() {
|
||
String address = "淀山湖镇黄浦江南路278号";
|
||
String areaCode = "320000,320500,320583";
|
||
Map<String, String> longitudeAndLatitude = AddressUtils.getLongitudeAndLatitude(areaCode, address);
|
||
System.out.println(longitudeAndLatitude);
|
||
}
|
||
|
||
@Test
|
||
public void testCreatePile() {
|
||
BatchCreatePileDTO dto = BatchCreatePileDTO.builder()
|
||
.merchantId("1")
|
||
.stationId("1")
|
||
.softwareProtocol("1")
|
||
// .connectorNum(1)
|
||
// .num(10)
|
||
// .productionDate(new Date())
|
||
.build();
|
||
pileService.batchCreatePile(dto);
|
||
}
|
||
|
||
@Test
|
||
public void testGetIncre() {
|
||
StopWatch stopWatch = new StopWatch();
|
||
|
||
// 生成100个
|
||
stopWatch.start("生成100个sn号");
|
||
List<String> list2 = snUtils.generateEVPileSN(1);
|
||
stopWatch.stop();
|
||
System.out.println(list2);
|
||
|
||
System.out.println(stopWatch.getLastTaskTimeMillis());
|
||
}
|
||
|
||
@Test
|
||
public void testDict() {
|
||
// String dictValue = DictUtils.getDictValue("query_pile_info", "url");
|
||
// String station_type = DictUtils.getDictLabel("station_type", "1");
|
||
// System.out.println(station_type);
|
||
// System.out.println("123");
|
||
|
||
List<SysDictData> adapay_station = DictUtils.getDictCache("adapay_station");
|
||
List<String> stationIdList = com.google.common.collect.Lists.newArrayList();
|
||
if (CollectionUtils.isNotEmpty(adapay_station)) {
|
||
for (SysDictData sysDictData : adapay_station) {
|
||
stationIdList.add(sysDictData.getDictValue());
|
||
}
|
||
}
|
||
System.out.println(stationIdList);
|
||
}
|
||
|
||
@Test
|
||
public void testSelectByMerchantId() {
|
||
List<PileStationInfo> list = pileStationInfoService.selectStationListByMerchantId(Long.valueOf(Constants.ONE));
|
||
System.out.println(list);
|
||
}
|
||
|
||
@Test
|
||
public void testStr2Bcd() {
|
||
String logicCardNum = "00000000";
|
||
byte[] logicCardNumByteArr = BytesUtil.str2Bcd(logicCardNum);
|
||
System.out.println(Arrays.toString(logicCardNumByteArr));
|
||
}
|
||
|
||
@Test
|
||
public void testBigDecimalMultiply() {
|
||
BigDecimal a = new BigDecimal("216.5");
|
||
BigDecimal b = new BigDecimal("11.5");
|
||
|
||
BigDecimal result = a.multiply(b).setScale(2, BigDecimal.ROUND_HALF_UP);
|
||
System.out.println(result);
|
||
}
|
||
|
||
@Test
|
||
public void testRemoteUpdate() {
|
||
ArrayList<String> list = new ArrayList<>();
|
||
list.add("88000000000001");
|
||
// pileRemoteService.updateFirmware(list);
|
||
}
|
||
|
||
@Test
|
||
public void testGetUserPhoneNum() {
|
||
String code = "0e5394cfa4eb41c6181ed257f2368a86dfe4ebdac0a4fac85df63657637e6cc3";
|
||
wxAppletRemoteService.getMobileNumberByCode(code);
|
||
}
|
||
|
||
@Test
|
||
public void testDistance() {
|
||
QueryStationDTO dto = new QueryStationDTO();
|
||
dto.setStationLat("123.2222");
|
||
dto.setStationLng("55.6232");
|
||
|
||
// pileStationInfoService.uniAppQueryStationInfos(dto);
|
||
}
|
||
|
||
/**
|
||
* 生成英文字母随机数 RandomStringUtils.randomAlphabetic(10);
|
||
* 生成数字随机数 RandomStringUtils.randomNumeric(10);
|
||
* 字母+数字结合 RandomStringUtils.randomAlphanumeric(10);
|
||
*/
|
||
@Test
|
||
public void Test() throws ParseException {
|
||
/*String s = RandomStringUtils.randomAlphanumeric(32);
|
||
System.out.println(s); // PuLe4Tyyg1jSFNPhF5d2Ts9ejRn6E8KQ
|
||
String str = "JS160829";
|
||
System.out.println(Md5Utils.hash(str).toUpperCase(Locale.ROOT));
|
||
*/
|
||
String s = RandomStringUtils.randomAlphanumeric(16).toUpperCase(Locale.ROOT);
|
||
System.out.println(s);
|
||
|
||
Date startTimeDate = sdf.parse("2022-11-26 10:44:11");
|
||
Date endTimeDate = sdf.parse("2022-11-27 12:45:11");
|
||
|
||
System.out.println(DateUtils.getDatePoor(endTimeDate, startTimeDate)); // 1天2小时1分钟
|
||
|
||
|
||
|
||
|
||
/*String stra = "sp_mchid=1632405339&sub_mchid=1632405339&out_trade_no=1217752501201407033233368318&sp_appid=wxbb3e0d474569481d&sub_appid=wxbb3e0d474569481d" +
|
||
"bbac689f4654b209de4d6944808ec80b";
|
||
System.out.println(Md5Utils.hash(stra).toUpperCase(Locale.ROOT));*/
|
||
}
|
||
|
||
@Test
|
||
public void testSimCard() throws ParseException {
|
||
ArrayList<String> list = Lists.newArrayList();
|
||
Collections.addAll(list, "898607B9102090253556", "898607B9102090253560");
|
||
// String s = list.toString().replaceAll("(?:\\[|null|\\]| +)", "");
|
||
// System.out.println(s);
|
||
// List<SimCardVO> simCardVOList = simCardService.selectSimCardInfoByIccId(list);
|
||
// System.out.println(simCardVOList.toString());
|
||
|
||
// simCardService.XunZhongSimRenewal(list, 12);
|
||
// System.out.println(s);
|
||
|
||
// SimCardVO simCardVO = simCardService.searchByLoop("898607B9102090253556");
|
||
//
|
||
// System.out.println(simCardVO.toString());
|
||
|
||
simCardService.WuLianSimRenew(list, 1);
|
||
|
||
|
||
}
|
||
|
||
@Test
|
||
public void testRefund() {
|
||
OrderBasicInfo orderInfo = orderBasicInfoService.getOrderInfoByOrderCode("88000000000001012212171045412218");
|
||
orderInfo.setReason("充电异常中止,急停开入");
|
||
|
||
TransactionRecordsData data = TransactionRecordsData.builder()
|
||
.transactionCode("88000000000001012212171045412218")
|
||
.consumptionAmount(String.valueOf(0.00))
|
||
.stopReasonMsg(orderInfo.getReason())
|
||
.totalElectricity("0")
|
||
.sharpUsedElectricity("0")
|
||
.peakUsedElectricity("0")
|
||
.flatUsedElectricity("0")
|
||
.valleyUsedElectricity("0")
|
||
.build();
|
||
|
||
// orderBasicInfoService.settleOrder(data, orderInfo);
|
||
}
|
||
|
||
|
||
@Test
|
||
public void testLoginHandler() {
|
||
String msg = "8800000000001001010f63362d333000000000898604b319227036282200";
|
||
byte[] msgBody = BytesUtil.str2Bcd(msg);
|
||
|
||
int startIndex = 0;
|
||
int length = 7;
|
||
|
||
// 桩编码
|
||
byte[] pileSnByte = BytesUtil.copyBytes(msgBody, startIndex, length);
|
||
String pileSn = BytesUtil.binary(pileSnByte, 16);
|
||
// log.info("桩号:{}", pileSn);
|
||
|
||
|
||
// 桩类型 0 表示直流桩, 1 表示交流桩
|
||
startIndex += length;
|
||
length = 1;
|
||
byte[] pileTypeByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
||
String pileType = BytesUtil.bcd2Str(pileTypeByteArr);
|
||
|
||
// 充电枪数量
|
||
startIndex += length;
|
||
byte[] connectorNumByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
||
String connectorNum = BytesUtil.bcd2Str(connectorNumByteArr);
|
||
|
||
// 通信协议版本 版本号乘 10,v1.0 表示 0x0A
|
||
startIndex += length;
|
||
byte[] communicationVersionByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
||
// int i = Integer.parseInt(BytesUtil.bcd2Str(communicationVersionByteArr)); // 0F --> 15
|
||
BigDecimal bigDecimal = new BigDecimal(BytesUtil.bcd2Str(communicationVersionByteArr));
|
||
BigDecimal communicationVersionTemp = bigDecimal.divide(new BigDecimal(10));
|
||
String communicationVersion = "v" + communicationVersionTemp;
|
||
|
||
// 程序版本
|
||
startIndex += length;
|
||
length = 8;
|
||
byte[] programVersionByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
||
String programVersion = BytesUtil.bcd2Str(programVersionByteArr);
|
||
|
||
// 网络连接类型 0x00 SIM 卡 0x01 LAN 0x02 WAN 0x03 其他
|
||
startIndex += length;
|
||
length = 1;
|
||
byte[] internetConnectionTypeByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
||
String internetConnection = BytesUtil.bcd2Str(internetConnectionTypeByteArr);
|
||
|
||
// sim卡
|
||
startIndex += length;
|
||
length = 10;
|
||
byte[] simCardNumByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
||
String iccid = BytesUtil.bin2HexStr(simCardNumByteArr);
|
||
|
||
// 运营商 0x00 移动 0x02 电信 0x03 联通 0x04 其他
|
||
startIndex += length;
|
||
length = 1;
|
||
byte[] businessTypeByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
||
String business = BytesUtil.bcd2Str(businessTypeByteArr);
|
||
|
||
LoginRequestData loginRequestData = LoginRequestData.builder()
|
||
.pileSn(pileSn)
|
||
.pileType(pileType)
|
||
.connectorNum(connectorNum)
|
||
.communicationVersion(communicationVersion)
|
||
.programVersion(programVersion)
|
||
.internetConnection(internetConnection)
|
||
.iccid(iccid)
|
||
.business(business)
|
||
.build();
|
||
|
||
// 结果(默认 0x01:登录失败)
|
||
byte[] flag = Constants.oneByteArray;
|
||
|
||
// 通过桩编码SN查询数据库,如果有数据,则登录成功,否则登录失败
|
||
QueryPileDTO dto = new QueryPileDTO();
|
||
dto.setPileSn(pileSn);
|
||
List<PileDetailVO> list = pileBasicInfoService.queryPileInfos(dto);
|
||
if (CollectionUtils.isNotEmpty(list)) {
|
||
flag = Constants.zeroByteArray;
|
||
// 登录成功,保存桩号和channel的关系
|
||
|
||
// PileChannelEntity.put(pileSn, channel);
|
||
// 更改桩和该桩下的枪口状态分别为 在线、空闲
|
||
// pileBasicInfoService.updatePileStatus(pileSn, PileStatusEnum.ON_LINE.getValue());
|
||
// pileConnectorInfoService.updateConnectorStatusByPileSn(pileSn, PileConnectorDataBaseStatusEnum.FREE.getValue());
|
||
|
||
// 对时
|
||
ProofreadTimeCommand command = ProofreadTimeCommand.builder().pileSn(pileSn).build();
|
||
ykcPushCommandService.pushProofreadTimeCommand(command);
|
||
|
||
// 公共方法修改状态
|
||
pileBasicInfoService.updateStatus(BytesUtil.bcd2Str(new byte[]{0x01}), pileSn, null, null, null);
|
||
|
||
|
||
// 下发二维码
|
||
IssueQRCodeCommand issueQRCodeCommand = IssueQRCodeCommand.builder().pileSn(pileSn).build();
|
||
ykcPushCommandService.pushIssueQRCodeCommand(issueQRCodeCommand);
|
||
|
||
}
|
||
|
||
|
||
// 充电桩使用的sim卡,把信息存库
|
||
if (StringUtils.equals("00", internetConnection)) {
|
||
try {
|
||
pileBasicInfoService.updatePileSimInfo(pileSn, iccid);
|
||
} catch (Exception e) {
|
||
// log.error("更新充电桩sim卡信息失败", e);
|
||
System.out.println(e.getMessage());
|
||
}
|
||
}
|
||
|
||
// 保存报文
|
||
String jsonMsg = JSON.toJSONString(loginRequestData);
|
||
// pileMsgRecordService.save(pileSn, pileSn, type, jsonMsg, ykcDataProtocol.getHEXString());
|
||
|
||
// // 消息体
|
||
// byte[] messageBody = Bytes.concat(pileSnByte, flag);
|
||
// return getResult(ykcDataProtocol, messageBody);
|
||
}
|
||
|
||
@Test
|
||
public void testGetMemberToken() {
|
||
String memberId = JWTUtils.getMemberId("eyJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE2NzY1MTY5MzgsImV4cCI6MTY3OTEwODkzOH0.4MwhZIOpnCfQloR7zEm2hwPOh2yyI2qxbBbTcv_SnZ4");
|
||
System.out.println(memberId);
|
||
}
|
||
|
||
/**
|
||
* 测试更新银行卡
|
||
*/
|
||
@Test
|
||
public void changeBankCardTest() throws BaseAdaPayException {
|
||
ChangeBankCardDTO dto = new ChangeBankCardDTO();
|
||
dto.setCardId("1018810800000168");
|
||
dto.setCardName("海南信祥物业管理有限公司");
|
||
dto.setTelNo("17384941319");
|
||
dto.setBankCode("88000835");
|
||
dto.setBankAcctType("1");
|
||
dto.setProvCode("0046");
|
||
dto.setAreaCode("4601");
|
||
|
||
String wechatAppId = wechatAppId1;
|
||
// 1-删除结算账户信息
|
||
// String adapayMemberId = account.getAdapayMemberId();
|
||
String adapayMemberId = "ACM69867986";
|
||
String settleAccountId = null;
|
||
AdapayCorpMemberVO adapayCorpMemberVO = adapayService.queryCorpAdapayMemberInfo(adapayMemberId, wechatAppId);
|
||
if (adapayCorpMemberVO != null) {
|
||
settleAccountId = adapayCorpMemberVO.getSettleAccountId();
|
||
}
|
||
adapayService.createDeleteSettleAccountRequest(adapayMemberId, settleAccountId, wechatAppId);
|
||
// 2-使用新账户信息创建结算账户
|
||
SettleAccountDTO settleAccountDTO = new SettleAccountDTO();
|
||
settleAccountDTO.setCardId(dto.getCardId());
|
||
settleAccountDTO.setCardName(dto.getCardName());
|
||
settleAccountDTO.setTelNo(dto.getTelNo());
|
||
settleAccountDTO.setBankCode(dto.getBankCode());
|
||
settleAccountDTO.setBankAcctType(dto.getBankAcctType());
|
||
settleAccountDTO.setProvCode(dto.getProvCode());
|
||
settleAccountDTO.setAreaCode(dto.getAreaCode());
|
||
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));
|
||
}
|
||
|
||
@Test
|
||
public void addPileMsgTest() {
|
||
String redisKey = "pile_msg_list:" + "88000000000002";
|
||
for (int i = 0; i < 30; i++) {
|
||
redisCache.addPileMsg(redisKey, "充电桩报文第" + i + "条") ;
|
||
}
|
||
System.out.println(redisCache.getCacheList(redisKey));
|
||
}
|
||
|
||
@Test
|
||
public void afterSettleOrderDTOTest() {
|
||
String orderCode = "C21187302032";
|
||
OrderBasicInfo orderBasicInfo = orderBasicInfoService.getOrderInfoByOrderCode(orderCode);
|
||
OrderDetail orderDetail = orderBasicInfoService.getOrderDetailByOrderCode(orderCode);
|
||
// 组装after参数
|
||
AfterSettleOrderDTO afterSettleOrderDTO = AfterSettleOrderDTO.builder()
|
||
.orderCode(orderBasicInfo.getOrderCode())
|
||
.merchantId(orderBasicInfo.getMerchantId())
|
||
.stationId(orderBasicInfo.getStationId())
|
||
.orderPayAmount(orderBasicInfo.getPayAmount())
|
||
.orderConsumeAmount(orderBasicInfo.getOrderAmount())
|
||
.orderSettleAmount(orderBasicInfo.getSettleAmount())
|
||
.orderElectricityAmount(orderDetail.getTotalElectricityAmount())
|
||
.orderElectricityDiscountAmount(orderDetail.getDiscountElectricityAmount())
|
||
.orderServiceAmount(orderDetail.getTotalServiceAmount())
|
||
.orderServiceDiscountAmount(orderDetail.getDiscountServiceAmount())
|
||
.orderRefundAmount(orderBasicInfo.getRefundAmount())
|
||
.build();
|
||
System.out.println(JSON.toJSONString(afterSettleOrderDTO));
|
||
|
||
// for (int i = 0; i < 30; i++) {
|
||
// // try {
|
||
// // Thread.sleep(5000);
|
||
// // } catch (InterruptedException e) {
|
||
// // throw new RuntimeException(e);
|
||
// // }
|
||
// afterSettleOrderDTO.setOrderCode(orderCode + "_" + i);
|
||
// rabbitTemplate.convertAndSend(RabbitConstants.YKC_EXCHANGE_NAME, RabbitConstants.QUEUE_CHARGE_ORDER_DATA, afterSettleOrderDTO);
|
||
// }
|
||
}
|
||
|
||
/**
|
||
* 测试计算分账方法
|
||
*/
|
||
@Test
|
||
public void calculationOfSplitAmountTest() {
|
||
AfterSettleOrderDTO afterSettleOrderDTO = AfterSettleOrderDTO.builder().build();
|
||
afterSettleOrderDTO.setOrderCode("112233112233");
|
||
afterSettleOrderDTO.setMerchantId("1");
|
||
afterSettleOrderDTO.setStationId("2");
|
||
afterSettleOrderDTO.setOrderPayAmount(new BigDecimal("50")); // 支付金额
|
||
afterSettleOrderDTO.setOrderConsumeAmount(new BigDecimal("38")); // 消费金额
|
||
afterSettleOrderDTO.setOrderSettleAmount(new BigDecimal("30")); // 结算金额
|
||
afterSettleOrderDTO.setOrderElectricityAmount(new BigDecimal("28")); // 电费金额
|
||
afterSettleOrderDTO.setOrderElectricityDiscountAmount(new BigDecimal("6")); // 电费优惠金额
|
||
afterSettleOrderDTO.setOrderServiceAmount(new BigDecimal("10")); // 服务费金额
|
||
afterSettleOrderDTO.setOrderServiceDiscountAmount(new BigDecimal("2")); // 服务费优惠金额
|
||
afterSettleOrderDTO.setOrderRefundAmount(new BigDecimal("21")); // 退款金额
|
||
|
||
List<StationSplitConfig> stationSplitConfigList = stationSplitConfigService.queryByStationId(afterSettleOrderDTO.getStationId());
|
||
List<DivMember> divMemberList = orderBasicInfoService.calculationOfSplitAmount(stationSplitConfigList, afterSettleOrderDTO, null);
|
||
System.out.println(JSON.toJSONString(divMemberList));
|
||
}
|
||
}
|