2023-05-26 19:25:35 +08:00
|
|
|
|
import cn.hutool.json.JSONUtil;
|
2023-05-27 11:55:45 +08:00
|
|
|
|
import com.alibaba.fastjson2.JSON;
|
2023-09-14 17:36:45 +08:00
|
|
|
|
import com.alibaba.fastjson2.JSONArray;
|
2023-03-04 16:29:55 +08:00
|
|
|
|
import com.alibaba.fastjson2.JSONObject;
|
2024-06-07 11:33:26 +08:00
|
|
|
|
import com.alipay.easysdk.factory.Factory;
|
2023-03-04 16:29:55 +08:00
|
|
|
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
2023-05-31 16:05:18 +08:00
|
|
|
|
import com.fasterxml.jackson.databind.DeserializationFeature;
|
2023-05-30 16:33:49 +08:00
|
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
|
|
|
import com.fasterxml.jackson.databind.PropertyNamingStrategies;
|
2023-03-04 16:29:55 +08:00
|
|
|
|
import com.google.common.collect.ImmutableMap;
|
2023-06-26 17:10:36 +08:00
|
|
|
|
import com.google.common.collect.Lists;
|
2023-05-27 16:01:27 +08:00
|
|
|
|
import com.google.common.collect.Maps;
|
2023-07-17 16:44:04 +08:00
|
|
|
|
import com.google.common.collect.Sets;
|
2023-06-12 17:38:16 +08:00
|
|
|
|
import com.google.common.primitives.Bytes;
|
2023-06-15 14:06:33 +08:00
|
|
|
|
import com.huifu.adapay.core.exception.BaseAdaPayException;
|
2023-08-25 16:07:15 +08:00
|
|
|
|
import com.huifu.adapay.model.Payment;
|
2023-10-08 16:42:56 +08:00
|
|
|
|
import com.huifu.adapay.model.PaymentReverse;
|
2023-05-27 16:01:27 +08:00
|
|
|
|
import com.huifu.adapay.model.Refund;
|
2023-03-04 16:29:55 +08:00
|
|
|
|
import com.jsowell.JsowellApplication;
|
2023-08-15 11:02:02 +08:00
|
|
|
|
import com.jsowell.adapay.config.AbstractAdapayConfig;
|
2024-03-14 11:40:11 +08:00
|
|
|
|
import com.jsowell.adapay.dto.*;
|
2023-08-15 11:02:02 +08:00
|
|
|
|
import com.jsowell.adapay.factory.AdapayConfigFactory;
|
2023-09-28 16:48:24 +08:00
|
|
|
|
import com.jsowell.adapay.operation.PaymentReverseOperation;
|
2024-01-03 17:07:01 +08:00
|
|
|
|
import com.jsowell.adapay.response.*;
|
2023-08-18 09:52:12 +08:00
|
|
|
|
import com.jsowell.adapay.service.AdapayService;
|
2024-01-19 16:59:54 +08:00
|
|
|
|
import com.jsowell.adapay.vo.AdapayCorpMemberVO;
|
2023-08-21 13:20:17 +08:00
|
|
|
|
import com.jsowell.adapay.vo.DrawCashDetailVO;
|
2024-03-26 09:18:09 +08:00
|
|
|
|
import com.jsowell.adapay.vo.PaymentInfo;
|
2023-03-04 16:29:55 +08:00
|
|
|
|
import com.jsowell.common.constant.CacheConstants;
|
|
|
|
|
|
import com.jsowell.common.constant.Constants;
|
2023-05-30 13:45:56 +08:00
|
|
|
|
import com.jsowell.common.core.domain.entity.SysDictData;
|
2023-03-04 16:29:55 +08:00
|
|
|
|
import com.jsowell.common.core.domain.ykc.LoginRequestData;
|
|
|
|
|
|
import com.jsowell.common.core.domain.ykc.TransactionRecordsData;
|
|
|
|
|
|
import com.jsowell.common.core.redis.RedisCache;
|
2023-08-30 10:13:56 +08:00
|
|
|
|
import com.jsowell.common.enums.AcquirerEnum;
|
2023-08-01 16:16:34 +08:00
|
|
|
|
import com.jsowell.common.enums.DelFlagEnum;
|
2024-08-01 09:26:01 +08:00
|
|
|
|
import com.jsowell.common.enums.thirdparty.ThirdPlatformTypeEnum;
|
2023-07-08 11:33:45 +08:00
|
|
|
|
import com.jsowell.common.enums.ykc.*;
|
2023-03-04 16:29:55 +08:00
|
|
|
|
import com.jsowell.common.exception.BusinessException;
|
2023-05-10 08:49:01 +08:00
|
|
|
|
import com.jsowell.common.util.*;
|
2023-07-08 09:58:20 +08:00
|
|
|
|
import com.jsowell.common.util.Cp56Time2a.Cp56Time2aUtil;
|
2023-05-30 14:22:34 +08:00
|
|
|
|
import com.jsowell.common.util.http.HttpUtils;
|
2023-07-08 09:58:20 +08:00
|
|
|
|
import com.jsowell.common.util.id.IdUtils;
|
2023-03-04 16:29:55 +08:00
|
|
|
|
import com.jsowell.common.util.id.SnowflakeIdWorker;
|
|
|
|
|
|
import com.jsowell.common.util.ip.AddressUtils;
|
2024-07-10 15:39:19 +08:00
|
|
|
|
import com.jsowell.netty.handler.yunkuaichong.HeartbeatRequestHandler;
|
|
|
|
|
|
import com.jsowell.netty.handler.yunkuaichong.TransactionRecordsRequestHandler;
|
2023-12-20 16:17:34 +08:00
|
|
|
|
import com.jsowell.netty.service.camera.impl.CameraBusinessServiceImpl;
|
2023-03-04 16:29:55 +08:00
|
|
|
|
import com.jsowell.netty.service.yunkuaichong.YKCBusinessService;
|
2023-05-26 19:25:35 +08:00
|
|
|
|
import com.jsowell.pile.domain.*;
|
2023-06-26 17:10:36 +08:00
|
|
|
|
import com.jsowell.pile.domain.ykcCommond.IssueQRCodeCommand;
|
|
|
|
|
|
import com.jsowell.pile.domain.ykcCommond.ProofreadTimeCommand;
|
2023-05-10 08:49:01 +08:00
|
|
|
|
import com.jsowell.pile.dto.*;
|
2023-06-26 17:10:36 +08:00
|
|
|
|
import com.jsowell.pile.dto.amap.GetStationInfoDTO;
|
2023-08-24 10:33:26 +08:00
|
|
|
|
import com.jsowell.pile.dto.lutongyunting.BindCouponDTO;
|
2023-03-04 16:29:55 +08:00
|
|
|
|
import com.jsowell.pile.mapper.MemberBasicInfoMapper;
|
|
|
|
|
|
import com.jsowell.pile.mapper.PileBillingTemplateMapper;
|
2023-05-26 19:25:35 +08:00
|
|
|
|
import com.jsowell.pile.service.*;
|
2023-12-07 11:01:45 +08:00
|
|
|
|
import com.jsowell.pile.service.programlogic.AbstractProgramLogic;
|
|
|
|
|
|
import com.jsowell.pile.service.programlogic.ProgramLogicFactory;
|
2024-04-01 09:57:23 +08:00
|
|
|
|
import com.jsowell.pile.thirdparty.CommonParamsDTO;
|
2023-08-29 16:03:43 +08:00
|
|
|
|
import com.jsowell.pile.transaction.dto.OrderTransactionDTO;
|
|
|
|
|
|
import com.jsowell.pile.transaction.service.TransactionService;
|
|
|
|
|
|
import com.jsowell.pile.util.SnUtils;
|
2023-11-21 14:57:58 +08:00
|
|
|
|
import com.jsowell.pile.vo.base.MemberWalletVO;
|
2023-06-26 14:40:03 +08:00
|
|
|
|
import com.jsowell.pile.vo.base.PileInfoVO;
|
2024-07-16 16:00:15 +08:00
|
|
|
|
import com.jsowell.pile.vo.uniapp.customer.CurrentTimePriceDetails;
|
|
|
|
|
|
import com.jsowell.pile.vo.uniapp.customer.MemberPlateNumberVO;
|
|
|
|
|
|
import com.jsowell.pile.vo.uniapp.customer.MemberVO;
|
|
|
|
|
|
import com.jsowell.pile.vo.uniapp.customer.PileConnectorDetailVO;
|
2024-01-13 15:28:02 +08:00
|
|
|
|
import com.jsowell.pile.vo.web.*;
|
2023-03-04 16:29:55 +08:00
|
|
|
|
import com.jsowell.service.MemberService;
|
|
|
|
|
|
import com.jsowell.service.OrderService;
|
|
|
|
|
|
import com.jsowell.service.PileService;
|
2023-10-24 13:14:33 +08:00
|
|
|
|
import com.jsowell.service.TempService;
|
2023-06-17 10:37:02 +08:00
|
|
|
|
import com.jsowell.thirdparty.amap.service.AMapService;
|
2024-04-22 11:10:17 +08:00
|
|
|
|
import com.jsowell.thirdparty.common.NotificationDTO;
|
2024-04-20 15:55:35 +08:00
|
|
|
|
import com.jsowell.thirdparty.common.NotificationService;
|
2024-01-14 16:36:30 +08:00
|
|
|
|
import com.jsowell.thirdparty.huawei.HuaWeiService;
|
2023-05-26 16:14:45 +08:00
|
|
|
|
import com.jsowell.thirdparty.lianlian.service.LianLianService;
|
2024-04-01 09:57:23 +08:00
|
|
|
|
import com.jsowell.thirdparty.lutongyunting.service.LTYTService;
|
2024-03-27 16:13:43 +08:00
|
|
|
|
import com.jsowell.thirdparty.platform.util.Cryptos;
|
|
|
|
|
|
import com.jsowell.thirdparty.platform.util.Encodes;
|
|
|
|
|
|
import com.jsowell.thirdparty.platform.util.GBSignUtils;
|
2024-08-01 09:26:01 +08:00
|
|
|
|
import com.jsowell.thirdparty.zhongdianlian.service.ZDLService;
|
2023-03-04 16:29:55 +08:00
|
|
|
|
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;
|
2023-07-28 14:47:26 +08:00
|
|
|
|
import org.apache.commons.lang3.RandomStringUtils;
|
2023-03-04 16:29:55 +08:00
|
|
|
|
import org.junit.Test;
|
|
|
|
|
|
import org.junit.runner.RunWith;
|
2024-06-11 15:12:02 +08:00
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
|
|
import org.slf4j.LoggerFactory;
|
2023-03-04 16:29:55 +08:00
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
2023-05-26 19:25:35 +08:00
|
|
|
|
import java.io.UnsupportedEncodingException;
|
2023-03-04 16:29:55 +08:00
|
|
|
|
import java.math.BigDecimal;
|
2024-01-13 15:28:02 +08:00
|
|
|
|
import java.math.RoundingMode;
|
2023-06-08 11:50:06 +08:00
|
|
|
|
import java.nio.charset.StandardCharsets;
|
2023-03-04 16:29:55 +08:00
|
|
|
|
import java.text.ParseException;
|
|
|
|
|
|
import java.text.SimpleDateFormat;
|
2023-05-10 08:49:01 +08:00
|
|
|
|
import java.util.*;
|
2024-07-31 14:38:06 +08:00
|
|
|
|
import java.util.concurrent.CompletableFuture;
|
|
|
|
|
|
import java.util.concurrent.TimeUnit;
|
2023-12-01 13:29:35 +08:00
|
|
|
|
import java.util.stream.Collectors;
|
2023-03-04 16:29:55 +08:00
|
|
|
|
|
|
|
|
|
|
@ActiveProfiles("dev")
|
|
|
|
|
|
@SpringBootTest(classes = JsowellApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
|
|
|
|
|
|
@RunWith(SpringRunner.class)
|
|
|
|
|
|
public class SpringBootTestController {
|
2024-06-11 15:12:02 +08:00
|
|
|
|
protected final Logger logger = LoggerFactory.getLogger(this.getClass());
|
2023-03-04 16:29:55 +08:00
|
|
|
|
|
2023-08-30 11:02:18 +08:00
|
|
|
|
private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
2023-03-04 16:29:55 +08:00
|
|
|
|
|
2023-10-31 15:17:39 +08:00
|
|
|
|
String wechatAppId1 = "wxbb3e0d474569481d"; // 万车充
|
|
|
|
|
|
|
|
|
|
|
|
String wechatAppId2 = "wx20abc5210391649c"; // 嘉佳充电
|
|
|
|
|
|
|
2023-08-30 11:02:18 +08:00
|
|
|
|
@Autowired
|
|
|
|
|
|
private SnUtils snUtils;
|
2023-03-04 16:29:55 +08:00
|
|
|
|
|
2023-08-30 11:02:18 +08:00
|
|
|
|
@Autowired
|
|
|
|
|
|
private PileService pileService;
|
2023-03-04 16:29:55 +08:00
|
|
|
|
|
2023-08-30 11:02:18 +08:00
|
|
|
|
@Autowired
|
|
|
|
|
|
private YKCPushCommandService ykcPushCommandService;
|
2023-03-04 16:29:55 +08:00
|
|
|
|
|
2023-08-30 11:02:18 +08:00
|
|
|
|
@Autowired
|
2023-11-29 11:55:33 +08:00
|
|
|
|
private AdapayMemberAccountService adapayMemberAccountService;
|
2023-07-13 15:27:09 +08:00
|
|
|
|
|
2023-08-30 11:02:18 +08:00
|
|
|
|
@Autowired
|
2024-01-06 15:20:28 +08:00
|
|
|
|
private PileMsgRecordService pileMsgRecordService;
|
2023-03-04 16:29:55 +08:00
|
|
|
|
|
2023-08-30 11:02:18 +08:00
|
|
|
|
@Autowired
|
2024-01-06 15:20:28 +08:00
|
|
|
|
private PileStationInfoService pileStationInfoService;
|
2023-03-04 16:29:55 +08:00
|
|
|
|
|
2023-08-30 11:02:18 +08:00
|
|
|
|
@Autowired
|
|
|
|
|
|
private YKCPushCommandService ykcPushBusinessService;
|
2023-03-04 16:29:55 +08:00
|
|
|
|
|
2023-08-30 11:02:18 +08:00
|
|
|
|
@Autowired
|
|
|
|
|
|
private HeartbeatRequestHandler heartbeatRequestHandler;
|
2023-03-04 16:29:55 +08:00
|
|
|
|
|
2023-08-30 11:02:18 +08:00
|
|
|
|
@Autowired
|
|
|
|
|
|
private YKCBusinessService ykcBusinessService;
|
2023-03-04 16:29:55 +08:00
|
|
|
|
|
2023-08-30 11:02:18 +08:00
|
|
|
|
@Autowired
|
|
|
|
|
|
private PileBillingTemplateMapper pileBillingTemplateMapper;
|
2023-03-04 16:29:55 +08:00
|
|
|
|
|
2023-08-30 11:02:18 +08:00
|
|
|
|
@Autowired
|
|
|
|
|
|
private PileRemoteService pileRemoteService;
|
2023-03-04 16:29:55 +08:00
|
|
|
|
|
2023-08-30 11:02:18 +08:00
|
|
|
|
@Autowired
|
|
|
|
|
|
private MemberService memberService;
|
2023-03-04 16:29:55 +08:00
|
|
|
|
|
2023-08-30 11:02:18 +08:00
|
|
|
|
@Autowired
|
|
|
|
|
|
private OrderService orderService;
|
2023-03-04 16:29:55 +08:00
|
|
|
|
|
2023-08-30 11:02:18 +08:00
|
|
|
|
@Autowired
|
2024-01-06 15:20:28 +08:00
|
|
|
|
private PileBillingTemplateService pileBillingTemplateService;
|
2023-03-04 16:29:55 +08:00
|
|
|
|
|
2023-08-30 11:02:18 +08:00
|
|
|
|
@Autowired
|
|
|
|
|
|
private MemberBasicInfoMapper memberBasicInfoMapper;
|
2023-03-04 16:29:55 +08:00
|
|
|
|
|
2023-08-30 11:02:18 +08:00
|
|
|
|
@Autowired
|
|
|
|
|
|
private SimCardService simCardService;
|
2023-03-04 16:29:55 +08:00
|
|
|
|
|
2023-08-30 11:02:18 +08:00
|
|
|
|
@Autowired
|
2024-01-06 15:20:28 +08:00
|
|
|
|
private PileBasicInfoService pileBasicInfoService;
|
2023-03-04 16:29:55 +08:00
|
|
|
|
|
2023-08-30 11:02:18 +08:00
|
|
|
|
@Autowired
|
|
|
|
|
|
private WechatPayService wechatPayService;
|
2023-03-04 16:29:55 +08:00
|
|
|
|
|
2023-08-30 11:02:18 +08:00
|
|
|
|
@Autowired
|
2024-01-06 15:13:50 +08:00
|
|
|
|
private OrderBasicInfoService orderBasicInfoService;
|
2023-03-04 16:29:55 +08:00
|
|
|
|
|
2023-08-30 11:02:18 +08:00
|
|
|
|
@Autowired
|
|
|
|
|
|
private WxpayCallbackRecordService wxpayCallbackRecordService;
|
2023-03-04 16:29:55 +08:00
|
|
|
|
|
2023-08-30 11:02:18 +08:00
|
|
|
|
@Autowired
|
|
|
|
|
|
private WxAppletRemoteService wxAppletRemoteService;
|
2023-03-04 16:29:55 +08:00
|
|
|
|
|
2023-08-30 11:02:18 +08:00
|
|
|
|
@Autowired
|
|
|
|
|
|
private RedisCache redisCache;
|
2023-03-04 16:29:55 +08:00
|
|
|
|
|
2023-08-30 11:02:18 +08:00
|
|
|
|
@Autowired
|
2023-12-01 13:29:35 +08:00
|
|
|
|
private PileAuthCardService pileAuthCardService;
|
2023-04-01 15:33:36 +08:00
|
|
|
|
|
2023-08-30 11:02:18 +08:00
|
|
|
|
@Autowired
|
|
|
|
|
|
private LianLianService lianLianService;
|
2023-05-10 08:49:01 +08:00
|
|
|
|
|
2023-08-30 11:02:18 +08:00
|
|
|
|
@Autowired
|
2024-01-06 15:20:28 +08:00
|
|
|
|
private MemberPlateNumberRelationService memberPlateNumberRelationService;
|
2023-06-12 17:38:16 +08:00
|
|
|
|
|
2023-08-30 11:02:18 +08:00
|
|
|
|
static final String MAC_KEY = "53TtFpc4gdVZbF3x";
|
2023-05-10 08:49:01 +08:00
|
|
|
|
|
2023-08-30 11:02:18 +08:00
|
|
|
|
static final String ALGORITHM_MAC = "HmacMD5";
|
2023-05-10 08:49:01 +08:00
|
|
|
|
|
2023-08-30 11:02:18 +08:00
|
|
|
|
@Autowired
|
|
|
|
|
|
private AdapayCallbackRecordService adapayCallbackRecordService;
|
2023-05-27 11:20:43 +08:00
|
|
|
|
|
2023-08-30 11:02:18 +08:00
|
|
|
|
@Autowired
|
2024-01-06 15:20:28 +08:00
|
|
|
|
private AdapayRefundRecordService adapayRefundRecordService;
|
2023-05-31 16:05:18 +08:00
|
|
|
|
|
2023-08-30 11:02:18 +08:00
|
|
|
|
@Autowired
|
|
|
|
|
|
private AdapayService adapayService;
|
2023-06-15 14:06:33 +08:00
|
|
|
|
|
2023-08-30 11:02:18 +08:00
|
|
|
|
@Autowired
|
|
|
|
|
|
private AMapService aMapService;
|
2023-06-17 10:37:02 +08:00
|
|
|
|
|
2023-08-30 11:02:18 +08:00
|
|
|
|
@Autowired
|
2024-01-06 15:20:28 +08:00
|
|
|
|
private PileConnectorInfoService pileConnectorInfoService;
|
2023-07-08 15:37:53 +08:00
|
|
|
|
|
2023-08-30 11:02:18 +08:00
|
|
|
|
@Autowired
|
|
|
|
|
|
private TransactionRecordsRequestHandler transactionRecordsRequestHandler;
|
2023-07-08 09:58:20 +08:00
|
|
|
|
|
2023-08-30 11:02:18 +08:00
|
|
|
|
@Autowired
|
2024-01-06 15:20:28 +08:00
|
|
|
|
private MemberBasicInfoService memberBasicInfoService;
|
2023-07-08 11:33:45 +08:00
|
|
|
|
|
2023-08-30 11:02:18 +08:00
|
|
|
|
@Autowired
|
|
|
|
|
|
private ClearingWithdrawInfoService clearingWithdrawInfoService;
|
2023-08-01 16:16:34 +08:00
|
|
|
|
|
2023-08-30 11:02:18 +08:00
|
|
|
|
@Autowired
|
|
|
|
|
|
private OrderPileOccupyService orderPileOccupyService;
|
2023-08-08 08:43:50 +08:00
|
|
|
|
|
2023-12-20 16:17:34 +08:00
|
|
|
|
@Autowired
|
|
|
|
|
|
private CameraBusinessServiceImpl cameraBusinessServiceImpl;
|
|
|
|
|
|
|
2023-08-30 11:02:18 +08:00
|
|
|
|
@Autowired
|
|
|
|
|
|
private LTYTService ltytService;
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
2024-01-06 15:20:28 +08:00
|
|
|
|
private PileMerchantInfoService pileMerchantInfoService;
|
2023-08-30 11:02:18 +08:00
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
|
private MemberAdapayRecordService memberAdapayRecordService;
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
|
private TransactionService transactionService;
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
|
private OrderPayRecordService orderPayRecordService;
|
|
|
|
|
|
|
2023-10-24 13:14:33 +08:00
|
|
|
|
@Autowired
|
|
|
|
|
|
private TempService tempService;
|
|
|
|
|
|
|
2023-11-21 14:57:58 +08:00
|
|
|
|
@Autowired
|
|
|
|
|
|
private MemberWalletInfoService memberWalletInfoService;
|
|
|
|
|
|
|
2024-01-13 15:28:02 +08:00
|
|
|
|
@Autowired
|
|
|
|
|
|
private MemberGroupService memberGroupService;
|
|
|
|
|
|
|
2024-01-14 16:36:30 +08:00
|
|
|
|
@Autowired
|
|
|
|
|
|
private HuaWeiService huaWeiService;
|
|
|
|
|
|
|
2024-04-20 15:55:35 +08:00
|
|
|
|
@Autowired
|
|
|
|
|
|
private NotificationService notificationService;
|
|
|
|
|
|
|
2024-07-02 15:24:36 +08:00
|
|
|
|
@Autowired
|
|
|
|
|
|
private PileReservationInfoService pileReservationInfoService;
|
|
|
|
|
|
|
2024-08-01 09:26:01 +08:00
|
|
|
|
@Autowired
|
|
|
|
|
|
private ZDLService zdlService;
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
|
public void thirdPartyTest() {
|
|
|
|
|
|
QueryStationInfoDTO dto = new QueryStationInfoDTO();
|
|
|
|
|
|
dto.setOperatorId("14405899X");
|
|
|
|
|
|
dto.setThirdPlatformType(ThirdPlatformTypeEnum.NING_BO_PLATFORM.getTypeCode());
|
|
|
|
|
|
zdlService.queryStationsInfo(dto);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-07-26 10:52:40 +08:00
|
|
|
|
@Test
|
|
|
|
|
|
public void personPileStopChargingTest() {
|
|
|
|
|
|
String memberId = "84085683";
|
|
|
|
|
|
String pileConnectorCode = "8823000000141001";
|
|
|
|
|
|
PersonPileStopChargingDTO dto = PersonPileStopChargingDTO.builder()
|
|
|
|
|
|
.memberId(memberId)
|
|
|
|
|
|
.pileConnectorCode(pileConnectorCode)
|
|
|
|
|
|
.build();
|
|
|
|
|
|
pileReservationInfoService.personPileStopCharging(dto);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-07-05 14:36:57 +08:00
|
|
|
|
@Test
|
|
|
|
|
|
public void selectMemberPlateNumberRelationTest() {
|
|
|
|
|
|
String memberId = "25950857";
|
|
|
|
|
|
List<MemberPlateNumberVO> plateNumberVOList = memberPlateNumberRelationService.selectMemberPlateNumberRelation(memberId);
|
|
|
|
|
|
System.out.println(JSON.toJSONString(plateNumberVOList));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-07-02 15:24:36 +08:00
|
|
|
|
@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);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-06-18 16:03:23 +08:00
|
|
|
|
@Test
|
|
|
|
|
|
public void queryPaymentReverseTest2() {
|
|
|
|
|
|
String paymentId = "002212024061717243610648707836701741056";
|
|
|
|
|
|
try {
|
|
|
|
|
|
adapayService.queryPaymentReverse(paymentId, wechatAppId1);
|
|
|
|
|
|
} catch (BaseAdaPayException e) {
|
|
|
|
|
|
throw new RuntimeException(e);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-06-12 15:38:44 +08:00
|
|
|
|
@Test
|
|
|
|
|
|
public void createBalancePaymentRequestTest() {
|
2024-07-31 09:25:13 +08:00
|
|
|
|
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
|
2024-06-12 15:38:44 +08:00
|
|
|
|
adapayService.createBalancePaymentRequest(outMemberId, inMemberId, transAmt, title, desc, wechatAppId);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-06-07 11:33:26 +08:00
|
|
|
|
@Test
|
2024-06-11 17:01:44 +08:00
|
|
|
|
public void decryptPhoneNum() throws Exception {
|
|
|
|
|
|
|
|
|
|
|
|
String content = "/CunEGSbDxsQaKllc35Q+4lJdLiprZhrHFt9er/ZriETVHv2IrtZsmC8cA6DE5l8GgzvgHCPdGp1iUJQhNyKog==";
|
|
|
|
|
|
// 通过密文解密 获取手机号码
|
|
|
|
|
|
String mobileNumber = Factory.Util.AES().decrypt(content);
|
|
|
|
|
|
System.out.println(mobileNumber);
|
2024-06-07 11:33:26 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-06-04 15:26:08 +08:00
|
|
|
|
@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));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-05-28 10:51:51 +08:00
|
|
|
|
@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);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-04-20 15:55:35 +08:00
|
|
|
|
@Test
|
|
|
|
|
|
public void notificationStationInfoTest() {
|
|
|
|
|
|
String stationId = "19";
|
2024-04-22 11:10:17 +08:00
|
|
|
|
NotificationDTO dto = new NotificationDTO();
|
|
|
|
|
|
dto.setStationId(stationId);
|
|
|
|
|
|
dto.setPlatformType("1");
|
|
|
|
|
|
notificationService.notificationStationInfo(dto);
|
2024-04-20 15:55:35 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-02-22 14:46:54 +08:00
|
|
|
|
@Test
|
|
|
|
|
|
public void queryBillingPriceTest() {
|
|
|
|
|
|
String stationId = "19";
|
2024-02-22 17:04:41 +08:00
|
|
|
|
// 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));
|
2024-02-22 14:46:54 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2023-12-27 16:27:14 +08:00
|
|
|
|
@Test
|
|
|
|
|
|
public void queryPaymentRefundTest() {
|
|
|
|
|
|
String paymentId = "002212023122615542010585629628950949888";
|
|
|
|
|
|
try {
|
|
|
|
|
|
adapayService.queryPaymentRefund(paymentId, wechatAppId2);
|
|
|
|
|
|
} catch (BaseAdaPayException e) {
|
|
|
|
|
|
throw new RuntimeException(e);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-01-17 11:08:16 +08:00
|
|
|
|
@Test
|
|
|
|
|
|
public void testnotificationOperationSystemInfo() {
|
|
|
|
|
|
// HWStationInfo hwStationInfo = huaWeiService.notificationOperationSystemInfo("19");
|
2024-03-19 16:22:40 +08:00
|
|
|
|
// String s = JSON.toJSONString(hwStationInfo);
|
2024-01-17 11:08:16 +08:00
|
|
|
|
// System.out.println(s);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-11-21 14:57:58 +08:00
|
|
|
|
@Test
|
|
|
|
|
|
public void selectByMemberWalletListTest() {
|
|
|
|
|
|
String memberId = "12345678";
|
|
|
|
|
|
List<MemberWalletVO> memberWalletVOS = memberWalletInfoService.selectByMemberWalletList(memberId);
|
|
|
|
|
|
System.out.println(JSON.toJSONString(memberWalletVOS));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-12-20 16:17:34 +08:00
|
|
|
|
@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);
|
|
|
|
|
|
|
2024-03-19 16:22:40 +08:00
|
|
|
|
// ChannelFuture future = cameraBusinessServiceImpl.sendMsg(channelId, topic, JSON.toJSONString());
|
2023-12-20 16:17:34 +08:00
|
|
|
|
// System.out.println(future.toString());
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-01-14 16:36:30 +08:00
|
|
|
|
@Test
|
|
|
|
|
|
public void testDeliverEquipBusinessPolicy() {
|
|
|
|
|
|
|
|
|
|
|
|
String result = huaWeiService.deliverEquipBusinessPolicy("test123451694073123456", "8823000000073501");
|
|
|
|
|
|
|
|
|
|
|
|
System.out.println(result);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-01-13 15:28:02 +08:00
|
|
|
|
@Test
|
|
|
|
|
|
public void testDiscount() {
|
|
|
|
|
|
OrderBasicInfo orderBasicInfo = new OrderBasicInfo();
|
|
|
|
|
|
orderBasicInfo.setMemberId("12345678");
|
|
|
|
|
|
orderBasicInfo.setMerchantId("1");
|
|
|
|
|
|
orderBasicInfo.setStationId("19");
|
|
|
|
|
|
orderBasicInfo.setPayAmount(new BigDecimal("200"));
|
|
|
|
|
|
|
|
|
|
|
|
OrderDetail orderDetail = new OrderDetail();
|
|
|
|
|
|
orderDetail.setTotalElectricityAmount(new BigDecimal("3"));
|
|
|
|
|
|
orderDetail.setTotalServiceAmount(new BigDecimal("0.18"));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String memberId = orderBasicInfo.getMemberId(); // 会员id
|
|
|
|
|
|
String merchantId = orderBasicInfo.getMerchantId(); // 运营商id
|
|
|
|
|
|
String stationId = orderBasicInfo.getStationId(); // 站点id
|
|
|
|
|
|
|
|
|
|
|
|
// 电费折扣金额
|
|
|
|
|
|
BigDecimal discountElectricityAmount = BigDecimal.ZERO;
|
|
|
|
|
|
// 服务费折扣金额
|
|
|
|
|
|
BigDecimal discountServiceAmount = BigDecimal.ZERO;
|
|
|
|
|
|
|
|
|
|
|
|
BigDecimal afterServiceAmountDiscount = BigDecimal.ZERO;
|
|
|
|
|
|
BigDecimal afterElectricityAmountDiscount = BigDecimal.ZERO;
|
|
|
|
|
|
|
|
|
|
|
|
// 查询会员在此站点会员折扣
|
|
|
|
|
|
MemberDiscountVO memberDiscountVO = memberGroupService.queryMemberDiscount(merchantId, stationId, memberId);
|
|
|
|
|
|
if (memberDiscountVO != null) {
|
|
|
|
|
|
BigDecimal discount = memberDiscountVO.getDiscount(); // 折扣率
|
|
|
|
|
|
String groupType = memberDiscountVO.getGroupType(); // 类型(1-服务费折扣,2-电费折扣 ,3-电费和服务费一起折扣)
|
|
|
|
|
|
BigDecimal totalElectricityAmount = orderDetail.getTotalElectricityAmount(); // 电费
|
|
|
|
|
|
BigDecimal totalServiceAmount = orderDetail.getTotalServiceAmount(); // 服务费
|
|
|
|
|
|
|
|
|
|
|
|
afterServiceAmountDiscount = totalServiceAmount;
|
|
|
|
|
|
afterElectricityAmountDiscount = totalElectricityAmount;
|
|
|
|
|
|
if (Constants.ONE.equals(groupType)) {
|
|
|
|
|
|
afterServiceAmountDiscount = totalServiceAmount.multiply(discount).setScale(4, RoundingMode.DOWN);
|
|
|
|
|
|
discountServiceAmount = totalServiceAmount.subtract(afterServiceAmountDiscount);
|
|
|
|
|
|
} else if (Constants.TWO.equals(groupType)) {
|
|
|
|
|
|
afterElectricityAmountDiscount = totalElectricityAmount.multiply(discount).setScale(4, RoundingMode.DOWN);
|
|
|
|
|
|
discountElectricityAmount = totalElectricityAmount.subtract(afterElectricityAmountDiscount);
|
|
|
|
|
|
} else {
|
|
|
|
|
|
// BigDecimal afterServiceAmountDiscount = totalServiceAmount.multiply(discount).setScale(2, RoundingMode.DOWN);
|
|
|
|
|
|
// discountServiceAmount = totalServiceAmount.subtract(afterServiceAmountDiscount);
|
|
|
|
|
|
// BigDecimal afterElectricityAmountDiscount = totalElectricityAmount.multiply(discount).setScale(2, RoundingMode.DOWN);
|
|
|
|
|
|
// discountElectricityAmount = totalElectricityAmount.subtract(afterElectricityAmountDiscount);
|
|
|
|
|
|
afterServiceAmountDiscount = totalServiceAmount.multiply(discount).setScale(4, RoundingMode.DOWN);
|
|
|
|
|
|
afterElectricityAmountDiscount = totalElectricityAmount.multiply(discount).setScale(4, RoundingMode.DOWN);
|
|
|
|
|
|
|
|
|
|
|
|
discountServiceAmount = totalServiceAmount.subtract(afterServiceAmountDiscount);
|
|
|
|
|
|
discountElectricityAmount = totalElectricityAmount.subtract(afterElectricityAmountDiscount);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
// 订单折扣金额
|
|
|
|
|
|
BigDecimal discountAmount = discountServiceAmount.add(discountElectricityAmount);
|
|
|
|
|
|
orderBasicInfo.setDiscountAmount(discountAmount);
|
|
|
|
|
|
// 更新退款金额 = 退款金额 - 折扣金额
|
|
|
|
|
|
// BigDecimal refundAmount = orderBasicInfo.getRefundAmount().subtract(discountAmount);
|
|
|
|
|
|
|
|
|
|
|
|
// 总消费金额 = 折扣后电费 + 折扣后服务费
|
|
|
|
|
|
BigDecimal totalConsumeAmount = afterServiceAmountDiscount.add(afterElectricityAmountDiscount);
|
|
|
|
|
|
// 更新退款金额
|
|
|
|
|
|
BigDecimal refundAmount = orderBasicInfo.getPayAmount().subtract(totalConsumeAmount).setScale(2, RoundingMode.DOWN);
|
|
|
|
|
|
orderBasicInfo.setRefundAmount(refundAmount);
|
|
|
|
|
|
|
|
|
|
|
|
orderDetail.setDiscountElectricityAmount(discountElectricityAmount);
|
|
|
|
|
|
orderDetail.setDiscountServiceAmount(discountServiceAmount);
|
|
|
|
|
|
}
|
2023-12-20 16:17:34 +08:00
|
|
|
|
|
2023-11-03 16:07:28 +08:00
|
|
|
|
@Test
|
|
|
|
|
|
public void queryPaymentByOrderNoTest() {
|
2024-04-15 10:29:13 +08:00
|
|
|
|
String orderNo = "C88850447008_20240415083226";
|
|
|
|
|
|
String orderCode = orderNo.substring(0, orderNo.indexOf("_"));
|
2024-03-26 09:18:09 +08:00
|
|
|
|
String wechatAppId = wechatAppId1;
|
2023-11-03 16:07:28 +08:00
|
|
|
|
try {
|
2024-03-26 09:18:09 +08:00
|
|
|
|
// 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));
|
|
|
|
|
|
|
2024-04-15 10:29:13 +08:00
|
|
|
|
List<OrderPayRecord> orderPayRecordList = orderPayRecordService.getOrderPayRecordList(orderCode);
|
2024-03-26 09:18:09 +08:00
|
|
|
|
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));
|
|
|
|
|
|
|
2023-11-03 16:07:28 +08:00
|
|
|
|
} catch (BaseAdaPayException e) {
|
|
|
|
|
|
throw new RuntimeException(e);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-10-24 13:14:33 +08:00
|
|
|
|
@Test
|
|
|
|
|
|
public void checkPaymentTest() {
|
|
|
|
|
|
QueryOrderDTO dto = new QueryOrderDTO();
|
2023-10-26 16:54:50 +08:00
|
|
|
|
String startTime = "2023-09-01 00:00:00";
|
|
|
|
|
|
String endTime = "2023-09-30 23:59:59";
|
2023-10-24 14:49:49 +08:00
|
|
|
|
dto.setStartTime(startTime);
|
|
|
|
|
|
dto.setEndTime(endTime);
|
2023-10-24 13:14:33 +08:00
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
tempService.checkPayment(dto);
|
|
|
|
|
|
} catch (BaseAdaPayException e) {
|
|
|
|
|
|
throw new RuntimeException(e);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-10-13 14:57:28 +08:00
|
|
|
|
@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());
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-08-30 11:02:18 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 单元测试,测试订单流程
|
|
|
|
|
|
*/
|
|
|
|
|
|
@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);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 生成订单
|
|
|
|
|
|
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.saveOrder2Database(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)
|
2023-08-31 10:30:05 +08:00
|
|
|
|
.delFlag(DelFlagEnum.NORMAL.getValue())
|
2023-08-30 11:02:18 +08:00
|
|
|
|
.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);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-09-14 17:36:45 +08:00
|
|
|
|
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;
|
|
|
|
|
|
}
|
2023-08-30 11:02:18 +08:00
|
|
|
|
|
2024-01-05 15:26:22 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 测试多笔支付情况,解冻部分金额
|
|
|
|
|
|
*/
|
2023-08-30 11:02:18 +08:00
|
|
|
|
@Test
|
|
|
|
|
|
public void calculateUnfreezeAmountTest() {
|
2023-09-14 17:36:45 +08:00
|
|
|
|
BigDecimal orderAmount = new BigDecimal("0.06");
|
2023-08-30 11:02:18 +08:00
|
|
|
|
List<OrderPayRecord> payRecordList = Lists.newArrayList();
|
|
|
|
|
|
// 第一笔支付记录
|
|
|
|
|
|
JSONObject jsonObject = new JSONObject();
|
2023-08-31 18:35:16 +08:00
|
|
|
|
jsonObject.put("paymentId", "002212023083114213410543206907226374144");
|
2023-09-14 17:36:45 +08:00
|
|
|
|
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);
|
|
|
|
|
|
|
2023-08-30 11:02:18 +08:00
|
|
|
|
OrderPayRecord build = OrderPayRecord.builder()
|
2023-09-14 17:36:45 +08:00
|
|
|
|
.payAmount(new BigDecimal("1.97"))
|
|
|
|
|
|
.deductionRecord(jsonArray.toJSONString())
|
2023-08-30 11:02:18 +08:00
|
|
|
|
.build();
|
|
|
|
|
|
payRecordList.add(build);
|
|
|
|
|
|
|
2023-12-07 11:01:45 +08:00
|
|
|
|
AbstractProgramLogic orderLogic = ProgramLogicFactory.getProgramLogic("1");
|
2023-09-14 17:36:45 +08:00
|
|
|
|
List<Map<String, Object>> maps = orderLogic.calculateUnfreezeAmount(orderAmount, payRecordList);
|
2023-08-30 11:02:18 +08:00
|
|
|
|
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 查询结果
|
2023-10-31 15:17:39 +08:00
|
|
|
|
Map<String, Object> response = Payment.query(paymentId, wechatAppId1);
|
2023-08-30 11:02:18 +08:00
|
|
|
|
System.out.println(response);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-01-19 15:38:38 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 【用户需要换绑银行卡 1-删除结算账户信息,2-使用新账户信息创建结算账户】
|
|
|
|
|
|
* 删除结算账户信息
|
|
|
|
|
|
* @throws BaseAdaPayException
|
|
|
|
|
|
*/
|
|
|
|
|
|
@Test
|
|
|
|
|
|
public void createDeleteSettleAccountRequestTest() throws BaseAdaPayException {
|
2024-04-24 17:08:14 +08:00
|
|
|
|
String adapayMemberId = "AM40919405";
|
|
|
|
|
|
String settleAccountId = "0540761871278208";
|
2024-01-19 15:38:38 +08:00
|
|
|
|
adapayService.createDeleteSettleAccountRequest(adapayMemberId, settleAccountId, wechatAppId1);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-08-30 11:02:18 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 手动变更银行卡信息
|
|
|
|
|
|
*/
|
|
|
|
|
|
@Test
|
|
|
|
|
|
public void createSettleAccountRequestTest() throws BaseAdaPayException {
|
|
|
|
|
|
SettleAccountDTO dto = new SettleAccountDTO();
|
2024-01-19 15:38:38 +08:00
|
|
|
|
dto.setCardId("45050160425000000627");
|
|
|
|
|
|
dto.setCardName("广西昂晟节能科技有限公司");
|
|
|
|
|
|
dto.setTelNo("19163816451");
|
|
|
|
|
|
dto.setBankCode("01050000");
|
2023-08-30 11:02:18 +08:00
|
|
|
|
dto.setBankAcctType("1");
|
2024-01-19 15:38:38 +08:00
|
|
|
|
dto.setProvCode("0045");
|
|
|
|
|
|
dto.setAreaCode("4501");
|
|
|
|
|
|
String adapayMemberId = "ACM82792551";
|
2023-10-31 15:17:39 +08:00
|
|
|
|
adapayService.createSettleAccountRequest(dto, adapayMemberId, wechatAppId1);
|
2023-08-30 11:02:18 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
|
public void queryDrawcashDetailTest() throws BaseAdaPayException {
|
|
|
|
|
|
String orderNo = "drawcash_1692339516947";
|
2023-10-31 15:17:39 +08:00
|
|
|
|
DrawCashDetailVO drawCashDetailVO = adapayService.queryDrawCashDetail(orderNo, wechatAppId1);
|
2023-08-30 11:02:18 +08:00
|
|
|
|
System.out.println(drawCashDetailVO);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-01-11 17:28:45 +08:00
|
|
|
|
@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);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-08-30 11:02:18 +08:00
|
|
|
|
@Test
|
|
|
|
|
|
public void queryPaymentConfirmListTest() {
|
|
|
|
|
|
QueryPaymentConfirmDTO dto = new QueryPaymentConfirmDTO();
|
2023-10-31 15:17:39 +08:00
|
|
|
|
dto.setWechatAppId(wechatAppId1);
|
2024-01-11 14:26:02 +08:00
|
|
|
|
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);
|
2023-08-30 11:02:18 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
|
public void queryAcctFlowListTest() {
|
|
|
|
|
|
QueryAcctFlowDTO dto = new QueryAcctFlowDTO();
|
|
|
|
|
|
try {
|
|
|
|
|
|
dto.setPageNo(1);
|
|
|
|
|
|
dto.setPageSize(100);
|
|
|
|
|
|
dto.setAcctType("01");
|
2023-10-31 15:17:39 +08:00
|
|
|
|
dto.setWechatAppId(wechatAppId1);
|
2023-08-30 11:02:18 +08:00
|
|
|
|
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);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-01-03 17:07:01 +08:00
|
|
|
|
@Test
|
|
|
|
|
|
public void testQueryConfirmReverse() throws BaseAdaPayException {
|
|
|
|
|
|
QueryConfirmReverseDTO dto = QueryConfirmReverseDTO.builder()
|
|
|
|
|
|
.paymentConfirmId("0022120231023104957990562360205131259904")
|
|
|
|
|
|
.wechatAppId(wechatAppId1)
|
|
|
|
|
|
.build();
|
|
|
|
|
|
adapayService.queryConfirmReverse(dto);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-12-27 13:46:37 +08:00
|
|
|
|
|
2023-08-30 11:02:18 +08:00
|
|
|
|
@Test
|
|
|
|
|
|
public void testStopOccupyPileOrder() {
|
|
|
|
|
|
String wechatAppId = "54135135";
|
|
|
|
|
|
AbstractAdapayConfig config = AdapayConfigFactory.getConfig(wechatAppId);
|
|
|
|
|
|
System.out.println(JSON.toJSONString(config));
|
|
|
|
|
|
|
2023-10-31 15:17:39 +08:00
|
|
|
|
AbstractAdapayConfig config2 = AdapayConfigFactory.getConfig(wechatAppId1);
|
2023-08-30 11:02:18 +08:00
|
|
|
|
System.out.println(JSON.toJSONString(config2));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-12-26 13:16:15 +08:00
|
|
|
|
// 需要重新分账的订单信息(针对未分账的订单)
|
|
|
|
|
|
public JSONArray getPaymentList() {
|
|
|
|
|
|
String jsonArrayString = "[" +
|
2024-07-24 13:27:39 +08:00
|
|
|
|
"{\"orderCode\":\"C67926008811\", \"settleAmount\":\"14.91\", \"paymentId\":\"002212024020312191210599708616768860160\"}" +
|
|
|
|
|
|
"{\"orderCode\":\"C42430351162\", \"settleAmount\":\"29.91\", \"paymentId\":\"002212024020417400510600151759191855104\"}" +
|
|
|
|
|
|
"{\"orderCode\":\"C46840673835\", \"settleAmount\":\"49.91\", \"paymentId\":\"002212024020508232410600374051907993600\"}" +
|
|
|
|
|
|
"{\"orderCode\":\"C80418255104\", \"settleAmount\":\"49.91\", \"paymentId\":\"002212024020519172410600538637863464960\"}" +
|
|
|
|
|
|
"{\"orderCode\":\"C27663220132\", \"settleAmount\":\"49.92\", \"paymentId\":\"002212024020615260710600842821125234688\"}" +
|
|
|
|
|
|
"{\"orderCode\":\"C46848081446\", \"settleAmount\":\"24.36\", \"paymentId\":\"002212024020708224510601098662578515968\"}" +
|
|
|
|
|
|
"{\"orderCode\":\"C61630340544\", \"settleAmount\":\"49.91\", \"paymentId\":\"002212024020813363810601540042416410624\"}" +
|
|
|
|
|
|
"{\"orderCode\":\"C80011863345\", \"settleAmount\":\"14.91\", \"paymentId\":\"002212024021416374510603759951855538176\"}" +
|
|
|
|
|
|
"{\"orderCode\":\"C25198228680\", \"settleAmount\":\"4.91\", \"paymentId\":\"002212024021513502010604080206798815232\"}" +
|
|
|
|
|
|
"{\"orderCode\":\"C29771066410\", \"settleAmount\":\"49.92\", \"paymentId\":\"002212024021719245910604889199513939968\"}" +
|
|
|
|
|
|
"{\"orderCode\":\"C29391457129\", \"settleAmount\":\"9.90\", \"paymentId\":\"002212024022016543010605938491023716352\"}" +
|
2023-12-26 13:16:15 +08:00
|
|
|
|
"]";
|
|
|
|
|
|
return JSONArray.parseArray(jsonArrayString);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 批量执行分账
|
|
|
|
|
|
*/
|
|
|
|
|
|
@Test
|
|
|
|
|
|
public void batchCreatePaymentConfirm() {
|
|
|
|
|
|
JSONArray paymentList = getPaymentList();
|
|
|
|
|
|
// TODO 获取默认结算账户,如需分给对应商户就填写正确的汇付会员id
|
|
|
|
|
|
// AdapayMemberAccount adapayMemberAccount = adapayMemberAccountService.getDefault();
|
|
|
|
|
|
AdapayMemberAccount adapayMemberAccount = new AdapayMemberAccount();
|
2024-07-24 13:27:39 +08:00
|
|
|
|
adapayMemberAccount.setAdapayMemberId("ACM21943395");
|
2023-12-26 13:16:15 +08:00
|
|
|
|
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));
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-09-20 14:57:59 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 查询分账信息
|
|
|
|
|
|
* @throws BaseAdaPayException
|
|
|
|
|
|
*/
|
2023-08-30 11:02:18 +08:00
|
|
|
|
@Test
|
2023-09-11 16:43:26 +08:00
|
|
|
|
public void queryCreateConfirmReverse() throws BaseAdaPayException {
|
2023-12-13 17:11:35 +08:00
|
|
|
|
List<String> paymentIdList = getPaymentIdList(); // 查询分账信息
|
2023-09-11 16:43:26 +08:00
|
|
|
|
|
2024-06-19 15:42:57 +08:00
|
|
|
|
List<String> unSplitList = Lists.newArrayList(); // 未分帐
|
|
|
|
|
|
List<String> splitList = Lists.newArrayList(); // 已分帐
|
2023-09-06 14:30:06 +08:00
|
|
|
|
|
2023-12-13 16:48:07 +08:00
|
|
|
|
BigDecimal total = BigDecimal.ZERO;
|
2023-12-14 20:17:15 +08:00
|
|
|
|
List<String> selfList = Lists.newArrayList();
|
2023-12-13 16:48:07 +08:00
|
|
|
|
|
|
|
|
|
|
Map<String, BigDecimal> map = Maps.newHashMap();
|
2023-12-13 17:11:35 +08:00
|
|
|
|
for (String paymentId : paymentIdList) {
|
|
|
|
|
|
if (StringUtils.isBlank(paymentId)) {
|
|
|
|
|
|
continue;
|
|
|
|
|
|
}
|
2023-09-06 14:30:06 +08:00
|
|
|
|
// 查询支付确认id
|
|
|
|
|
|
QueryPaymentConfirmDTO dto = new QueryPaymentConfirmDTO();
|
2023-12-13 17:11:35 +08:00
|
|
|
|
dto.setPaymentId(paymentId);
|
2023-10-31 15:17:39 +08:00
|
|
|
|
dto.setWechatAppId(wechatAppId1);
|
2024-03-14 16:42:19 +08:00
|
|
|
|
// 查询分账信息
|
2023-09-06 14:30:06 +08:00
|
|
|
|
QueryPaymentConfirmDetailResponse response = adapayService.queryPaymentConfirmList(dto);
|
|
|
|
|
|
if (response != null) {
|
|
|
|
|
|
List<QueryPaymentConfirmDetailResponse.PaymentConfirmInfo> confirms = response.getPaymentConfirms();
|
2023-09-08 14:26:13 +08:00
|
|
|
|
if (CollectionUtils.isEmpty(confirms)) {
|
2023-12-14 20:17:15 +08:00
|
|
|
|
unSplitList.add(paymentId);
|
2023-09-27 11:25:01 +08:00
|
|
|
|
} else {
|
2024-01-04 15:39:25 +08:00
|
|
|
|
splitList.add(paymentId);
|
2023-09-28 09:16:44 +08:00
|
|
|
|
for (QueryPaymentConfirmDetailResponse.PaymentConfirmInfo confirm : confirms) {
|
2024-01-03 17:07:01 +08:00
|
|
|
|
if (queryConfirmReverseStatus(confirm)) {
|
|
|
|
|
|
System.out.println("支付确认id:" + confirm.getId() + "撤销了。。。");
|
|
|
|
|
|
continue;
|
|
|
|
|
|
}
|
2023-09-28 09:16:44 +08:00
|
|
|
|
JSONObject jsonObject = JSON.parseObject(confirm.getDescription());
|
|
|
|
|
|
String adapayMemberId = jsonObject.getString("adapayMemberId");
|
2023-12-13 16:48:07 +08:00
|
|
|
|
BigDecimal confirmedAmt = new BigDecimal(confirm.getConfirmedAmt());
|
|
|
|
|
|
|
|
|
|
|
|
total = total.add(confirmedAmt);
|
|
|
|
|
|
|
|
|
|
|
|
// 放map
|
|
|
|
|
|
map.merge(adapayMemberId, confirmedAmt, BigDecimal::add);
|
2023-12-14 20:17:15 +08:00
|
|
|
|
|
|
|
|
|
|
if (StringUtils.equals(adapayMemberId, "0")) {
|
|
|
|
|
|
selfList.add(paymentId);
|
|
|
|
|
|
}
|
2023-09-28 09:16:44 +08:00
|
|
|
|
}
|
2023-09-06 14:30:06 +08:00
|
|
|
|
}
|
2024-01-04 15:39:25 +08:00
|
|
|
|
} else {
|
|
|
|
|
|
unSplitList.add(paymentId);
|
2023-09-06 14:30:06 +08:00
|
|
|
|
}
|
2023-08-30 11:02:18 +08:00
|
|
|
|
}
|
2024-01-04 15:39:25 +08:00
|
|
|
|
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());
|
2023-08-30 11:02:18 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-01-03 17:07:01 +08:00
|
|
|
|
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;
|
|
|
|
|
|
}
|
2023-12-13 16:48:07 +08:00
|
|
|
|
|
2024-01-03 17:07:01 +08:00
|
|
|
|
return result;
|
|
|
|
|
|
}
|
2023-12-13 16:48:07 +08:00
|
|
|
|
|
2023-10-08 16:42:56 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 延迟分账未确认调撤销调撤销接口退款
|
|
|
|
|
|
*/
|
2023-09-28 16:48:24 +08:00
|
|
|
|
@Test
|
|
|
|
|
|
public void createPaymentReverseRequestTest() {
|
2024-08-06 14:39:09 +08:00
|
|
|
|
String paymentId = "002212024080614142410666779361873702912";
|
|
|
|
|
|
BigDecimal refundAmount = new BigDecimal("0.64");
|
2023-10-08 16:42:56 +08:00
|
|
|
|
String memberId = null;
|
2023-09-28 16:48:24 +08:00
|
|
|
|
|
|
|
|
|
|
// 延迟分账未确认调撤销调撤销接口退款
|
|
|
|
|
|
PaymentReverseOperation operation = new PaymentReverseOperation();
|
|
|
|
|
|
operation.setPaymentId(paymentId);
|
|
|
|
|
|
operation.setReverseAmt(refundAmount);
|
2024-06-18 14:21:20 +08:00
|
|
|
|
operation.setMerchantKey(wechatAppId1);
|
2023-09-28 16:48:24 +08:00
|
|
|
|
operation.setMemberId(memberId);
|
|
|
|
|
|
operation.setScenarioType(ScenarioEnum.ORDER.getValue());
|
2024-06-18 14:21:20 +08:00
|
|
|
|
operation.setOrderCode("C82929272783");
|
2023-09-28 16:48:24 +08:00
|
|
|
|
PaymentReverseResponse response = adapayService.createPaymentReverseRequest(operation);
|
|
|
|
|
|
System.out.println(JSON.toJSONString(response));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-10-31 15:17:39 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 测试创建退款请求
|
|
|
|
|
|
*/
|
2023-09-28 16:48:24 +08:00
|
|
|
|
@Test
|
|
|
|
|
|
public void createRefundRequestTest() {
|
2023-12-27 14:25:20 +08:00
|
|
|
|
String paymentId = "0022120231226155420105856296289509498883333";
|
|
|
|
|
|
BigDecimal refundAmount = new BigDecimal("11.62");
|
|
|
|
|
|
String memberId = "46487809";
|
|
|
|
|
|
String orderCode = "C80414417003";
|
2023-09-28 16:48:24 +08:00
|
|
|
|
// 调汇付的交易退款接口
|
|
|
|
|
|
RefundResponse response = adapayService.createRefundRequest(paymentId, refundAmount,
|
2023-12-27 14:25:20 +08:00
|
|
|
|
wechatAppId2, memberId, ScenarioEnum.ORDER.getValue(), orderCode);
|
2023-09-28 16:48:24 +08:00
|
|
|
|
System.out.println(JSON.toJSONString(response));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-09-25 15:05:12 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 批量支付确认撤销
|
|
|
|
|
|
* @throws BaseAdaPayException
|
|
|
|
|
|
*/
|
2023-09-08 14:26:13 +08:00
|
|
|
|
@Test
|
2023-09-11 16:43:26 +08:00
|
|
|
|
public void testCreateConfirmReverse() throws BaseAdaPayException {
|
2023-12-13 17:11:35 +08:00
|
|
|
|
List<String> list = getPaymentIdList(); // 批量支付确认撤销
|
2023-10-31 15:17:39 +08:00
|
|
|
|
for (String paymentId : list) {
|
2023-09-08 14:26:13 +08:00
|
|
|
|
// 查询支付确认id
|
|
|
|
|
|
QueryPaymentConfirmDTO dto = new QueryPaymentConfirmDTO();
|
2023-10-31 15:17:39 +08:00
|
|
|
|
dto.setPaymentId(paymentId);
|
|
|
|
|
|
dto.setWechatAppId(wechatAppId1);
|
2023-09-08 14:26:13 +08:00
|
|
|
|
QueryPaymentConfirmDetailResponse response = adapayService.queryPaymentConfirmList(dto);
|
|
|
|
|
|
if (response != null) {
|
|
|
|
|
|
List<QueryPaymentConfirmDetailResponse.PaymentConfirmInfo> confirms = response.getPaymentConfirms();
|
2023-10-31 15:17:39 +08:00
|
|
|
|
System.out.println("支付id:" + paymentId + ", 确认信息:" + JSON.toJSONString(confirms));
|
2023-10-11 17:01:23 +08:00
|
|
|
|
if (CollectionUtils.isNotEmpty(confirms)) {
|
|
|
|
|
|
for (QueryPaymentConfirmDetailResponse.PaymentConfirmInfo confirm : confirms) {
|
2023-10-31 15:17:39 +08:00
|
|
|
|
adapayService.createConfirmReverse(confirm.getId(), wechatAppId1);
|
2023-10-11 17:01:23 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2023-09-08 14:26:13 +08:00
|
|
|
|
}
|
2023-08-30 11:02:18 +08:00
|
|
|
|
}
|
2023-09-08 14:26:13 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2023-10-31 15:17:39 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 查询撤销列表
|
|
|
|
|
|
* @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);
|
2024-03-19 16:22:40 +08:00
|
|
|
|
// System.out.println(JSON.toJSONString());
|
2023-10-31 15:17:39 +08:00
|
|
|
|
BigDecimal refundAmount = jsonObject.getBigDecimal("refundAmount");
|
|
|
|
|
|
String paymentId = jsonObject.getString("paymentId");
|
|
|
|
|
|
|
2023-11-24 15:40:26 +08:00
|
|
|
|
adapayService.createPaymentReverseRequest(paymentId, refundAmount, wechatAppId1, "", ScenarioEnum.ORDER.getValue(), "");
|
2023-10-31 15:17:39 +08:00
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
System.out.println("需要撤销idList:" + idList);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public JSONArray getJsonList() {
|
2023-11-24 15:40:26 +08:00
|
|
|
|
String jsonArrayString = "[{\"refundAmount\":\"354.84\", \"paymentId\":\"002212023102509474610563069333816762368\"}]";
|
2023-10-31 15:17:39 +08:00
|
|
|
|
JSONArray jsonArray = JSONArray.parseArray(jsonArrayString);
|
|
|
|
|
|
return jsonArray;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-08-30 11:02:18 +08:00
|
|
|
|
|
2024-05-15 11:32:08 +08:00
|
|
|
|
private List<String> getPaymentIdList1() {
|
2024-03-14 11:40:11 +08:00
|
|
|
|
List<String> list = Lists.newArrayList();
|
2024-08-02 10:48:07 +08:00
|
|
|
|
list.add("002212024063019153910653446823208845312");
|
|
|
|
|
|
list.add("002212024063019333910653451354565480448");
|
|
|
|
|
|
list.add("002212024063020120010653461003825848320");
|
|
|
|
|
|
list.add("002212024063020164610653462203656101888");
|
|
|
|
|
|
list.add("002212024063021540510653486694827216896");
|
|
|
|
|
|
list.add("002212024063022090910653490489297354752");
|
|
|
|
|
|
list.add("002212024063023152510653507166029918208");
|
|
|
|
|
|
list.add("002212024070100032010653519223591591936");
|
|
|
|
|
|
list.add("002212024070100070510653520164398272512");
|
|
|
|
|
|
list.add("002212024070100100910653520939317780480");
|
|
|
|
|
|
list.add("002212024070101520910653546608303972352");
|
|
|
|
|
|
list.add("002212024070107295910653631624618889216");
|
|
|
|
|
|
list.add("002212024070108141010653642747079180288");
|
|
|
|
|
|
list.add("002212024070109504010653667030322298880");
|
|
|
|
|
|
list.add("002212024070111252110653690855937368064");
|
|
|
|
|
|
list.add("002212024070112022410653700181202190336");
|
|
|
|
|
|
list.add("002212024070114425510653740575734018048");
|
|
|
|
|
|
list.add("002212024070117300010653782623067541504");
|
|
|
|
|
|
list.add("002212024070117420010653785643043704832");
|
|
|
|
|
|
list.add("002212024070118002210653790265628086272");
|
|
|
|
|
|
list.add("002212024070119182010653809888832753664");
|
|
|
|
|
|
list.add("002212024070119363410653814474845339648");
|
|
|
|
|
|
list.add("002212024070120195710653825394154700800");
|
|
|
|
|
|
list.add("002212024070121081110653837532633198592");
|
|
|
|
|
|
list.add("002212024070122582010653865253213540352");
|
|
|
|
|
|
list.add("002212024070123234110653871633297018880");
|
|
|
|
|
|
list.add("002212024070123250310653871977170296832");
|
|
|
|
|
|
list.add("002212024070200003010653880896310394880");
|
|
|
|
|
|
list.add("002212024070200085910653883033759162368");
|
|
|
|
|
|
list.add("002212024070200300810653888354992791552");
|
|
|
|
|
|
list.add("002212024070208370510654010898954469376");
|
|
|
|
|
|
list.add("002212024070210403310654041973098725376");
|
|
|
|
|
|
list.add("002212024070211281710654053983767203840");
|
|
|
|
|
|
list.add("002212024070211551710654060777452396544");
|
|
|
|
|
|
list.add("002212024070211594410654061899120934912");
|
|
|
|
|
|
list.add("002212024070213274310654084039234379776");
|
|
|
|
|
|
list.add("002212024070215594910654122315480485888");
|
|
|
|
|
|
list.add("002212024070217441810654148612768575488");
|
|
|
|
|
|
list.add("002212024070217501510654150108051107840");
|
|
|
|
|
|
list.add("002212024070218042710654153683651616768");
|
|
|
|
|
|
list.add("002212024070218285810654159850489430016");
|
|
|
|
|
|
list.add("002212024070218333910654161030190116864");
|
|
|
|
|
|
list.add("002212024070218511810654165472050327552");
|
|
|
|
|
|
list.add("002212024070219210810654172982117371904");
|
|
|
|
|
|
list.add("002212024070220350910654191607741448192");
|
|
|
|
|
|
list.add("002212024070221574610654212396526522368");
|
|
|
|
|
|
list.add("002212024070222331610654221330641330176");
|
|
|
|
|
|
list.add("002212024070222423010654223656797429760");
|
|
|
|
|
|
list.add("002212024070222484110654225211178000384");
|
|
|
|
|
|
list.add("002212024070223093010654230450027110400");
|
|
|
|
|
|
list.add("002212024070300391810654253051071258624");
|
|
|
|
|
|
list.add("002212024070301091910654260603666358272");
|
|
|
|
|
|
list.add("002212024070307070010654350616367173632");
|
|
|
|
|
|
list.add("002212024070308093310654366360100323328");
|
|
|
|
|
|
list.add("002212024070313312810654447370082865152");
|
|
|
|
|
|
list.add("002212024070313331010654447800708177920");
|
|
|
|
|
|
list.add("002212024070313410210654449777592664064");
|
|
|
|
|
|
list.add("002212024070313412210654449862338576384");
|
|
|
|
|
|
list.add("002212024070315331910654478037165064192");
|
|
|
|
|
|
list.add("002212024070316305710654492540400992256");
|
|
|
|
|
|
list.add("002212024070316321810654492878030213120");
|
|
|
|
|
|
list.add("002212024070317494010654512352134430720");
|
|
|
|
|
|
list.add("002212024070317585210654514664594317312");
|
|
|
|
|
|
list.add("002212024070317595310654514920050614272");
|
|
|
|
|
|
list.add("002212024070318205410654520211465994240");
|
|
|
|
|
|
list.add("002212024070318304310654522682393120768");
|
|
|
|
|
|
list.add("002212024070318453010654526401123450880");
|
|
|
|
|
|
list.add("002212024070318464410654526710800498688");
|
|
|
|
|
|
list.add("002212024070319151110654533871735717888");
|
|
|
|
|
|
list.add("002212024070319205510654535312017399808");
|
|
|
|
|
|
list.add("002212024070319410910654540406954569728");
|
|
|
|
|
|
list.add("002212024070320055210654546626492547072");
|
|
|
|
|
|
list.add("002212024070320075510654547139866599424");
|
|
|
|
|
|
list.add("002212024070320494410654557664153866240");
|
|
|
|
|
|
list.add("002212024070322065210654577075991044096");
|
|
|
|
|
|
list.add("002212024070322463310654587064410398720");
|
|
|
|
|
|
list.add("002212024070322500410654587946865631232");
|
|
|
|
|
|
list.add("002212024070323055310654591927182647296");
|
|
|
|
|
|
list.add("002212024070323083110654592592834088960");
|
|
|
|
|
|
list.add("002212024070323182210654595071746613248");
|
|
|
|
|
|
list.add("002212024070400043510654606700514279424");
|
|
|
|
|
|
list.add("002212024070401070110654622413509582848");
|
|
|
|
|
|
list.add("002212024070411202610654776785829150720");
|
|
|
|
|
|
list.add("002212024070411452510654783073156247552");
|
|
|
|
|
|
list.add("002212024070414215310654822445935337472");
|
|
|
|
|
|
list.add("002212024070415295710654839576183922688");
|
|
|
|
|
|
list.add("002212024070415352210654840942190563328");
|
|
|
|
|
|
list.add("002212024070415533810654845536025968640");
|
|
|
|
|
|
list.add("002212024070416200710654852201766096896");
|
|
|
|
|
|
list.add("002212024070417134910654865715534544896");
|
|
|
|
|
|
list.add("002212024070417244110654868449402511360");
|
|
|
|
|
|
list.add("002212024070418125410654880586149617664");
|
|
|
|
|
|
list.add("002212024070418211110654882671140974592");
|
|
|
|
|
|
list.add("002212024070418221110654882919225192448");
|
|
|
|
|
|
list.add("002212024070418531410654890734787076096");
|
|
|
|
|
|
list.add("002212024070419015410654892917545984000");
|
|
|
|
|
|
list.add("002212024070419271510654899294473785344");
|
|
|
|
|
|
list.add("002212024070420544210654921301937737728");
|
|
|
|
|
|
list.add("002212024070422553510654951724405956608");
|
|
|
|
|
|
list.add("002212024070422585010654952541457440768");
|
|
|
|
|
|
list.add("002212024070423031110654953637526859776");
|
|
|
|
|
|
list.add("002212024070500321510654976053021728768");
|
|
|
|
|
|
list.add("002212024070507361410655082748140490752");
|
|
|
|
|
|
list.add("002212024070507414910655084155359305728");
|
|
|
|
|
|
list.add("002212024070507540210655087229685989376");
|
|
|
|
|
|
list.add("002212024070508461810655100382228094976");
|
|
|
|
|
|
list.add("002212024070509343710655112542049214464");
|
|
|
|
|
|
list.add("002212024070509372810655113259535613952");
|
|
|
|
|
|
list.add("002212024070512023910655149796289646592");
|
|
|
|
|
|
list.add("002212024070512182110655153748099960832");
|
|
|
|
|
|
list.add("002212024070513131710655167572507729920");
|
|
|
|
|
|
list.add("002212024070516282010655216656372092928");
|
|
|
|
|
|
list.add("002212024070517193210655229540392153088");
|
|
|
|
|
|
list.add("002212024070517242110655230753206145024");
|
|
|
|
|
|
list.add("002212024070518071010655241528445198336");
|
|
|
|
|
|
list.add("002212024070518234510655245703651835904");
|
|
|
|
|
|
list.add("002212024070518331910655248109020557312");
|
|
|
|
|
|
list.add("002212024070519112710655257706414387200");
|
|
|
|
|
|
list.add("002212024070519125410655258073885941760");
|
|
|
|
|
|
list.add("002212024070519240710655260893953613824");
|
|
|
|
|
|
list.add("002212024070519255010655261328764526592");
|
|
|
|
|
|
list.add("002212024070519303310655262514976915456");
|
|
|
|
|
|
list.add("002212024070519330510655263150606909440");
|
|
|
|
|
|
list.add("002212024070519392610655264748257562624");
|
|
|
|
|
|
list.add("002212024070520405010655280199963615232");
|
|
|
|
|
|
list.add("002212024070521091010655287331636322304");
|
|
|
|
|
|
list.add("002212024070521111110655287840426328064");
|
|
|
|
|
|
list.add("002212024070521545210655298833732075520");
|
|
|
|
|
|
list.add("002212024070522281210655307219839967232");
|
|
|
|
|
|
list.add("002212024070522334310655308609772818432");
|
|
|
|
|
|
list.add("002212024070522413110655310572729257984");
|
|
|
|
|
|
list.add("002212024070522484310655312385309196288");
|
|
|
|
|
|
list.add("002212024070600115910655333338944000000");
|
|
|
|
|
|
list.add("002212024070601465610655357233207402496");
|
|
|
|
|
|
list.add("002212024070608150310655454906787037184");
|
|
|
|
|
|
list.add("002212024070609443210655477425073000448");
|
|
|
|
|
|
list.add("002212024070609470210655478055367917568");
|
|
|
|
|
|
list.add("002212024070610025010655482031497805824");
|
|
|
|
|
|
list.add("002212024070610133310655484726802616320");
|
|
|
|
|
|
list.add("002212024070611124110655499611523194880");
|
|
|
|
|
|
list.add("002212024070611492310655508845049634816");
|
|
|
|
|
|
list.add("002212024070612244210655517734433681408");
|
|
|
|
|
|
list.add("002212024070612522810655524719983185920");
|
|
|
|
|
|
list.add("002212024070615224910655562557442396160");
|
|
|
|
|
|
list.add("002212024070616444310655583170279395328");
|
|
|
|
|
|
list.add("002212024070617184010655591713568108544");
|
|
|
|
|
|
list.add("002212024070617594610655602054681550848");
|
|
|
|
|
|
list.add("002212024070618121310655605190602571776");
|
|
|
|
|
|
list.add("002212024070618280810655609193977581568");
|
|
|
|
|
|
list.add("002212024070618344710655610866438918144");
|
|
|
|
|
|
list.add("002212024070619121910655620313005850624");
|
|
|
|
|
|
list.add("002212024070619292710655624624479141888");
|
|
|
|
|
|
list.add("002212024070620475410655644368126713856");
|
|
|
|
|
|
list.add("002212024070621285010655654667959623680");
|
|
|
|
|
|
list.add("002212024070622032910655663388524433408");
|
|
|
|
|
|
list.add("002212024070622133210655665917259415552");
|
|
|
|
|
|
list.add("002212024070622494410655675027426115584");
|
|
|
|
|
|
list.add("002212024070622531710655675919249608704");
|
|
|
|
|
|
list.add("002212024070622532710655675964148113408");
|
|
|
|
|
|
list.add("002212024070623375810655687168240619520");
|
|
|
|
|
|
list.add("002212024070623571010655691996148473856");
|
|
|
|
|
|
list.add("002212024070701064310655709501076217856");
|
|
|
|
|
|
list.add("002212024070703170210655742298149986304");
|
|
|
|
|
|
list.add("002212024070711241010655864885930844160");
|
|
|
|
|
|
list.add("002212024070711333910655867272184057856");
|
|
|
|
|
|
list.add("002212024070711391210655868668839624704");
|
|
|
|
|
|
list.add("002212024070711464610655870576101601280");
|
|
|
|
|
|
list.add("002212024070712342910655882584466964480");
|
|
|
|
|
|
list.add("002212024070713145110655892741667278848");
|
|
|
|
|
|
list.add("002212024070714180110655908638340378624");
|
|
|
|
|
|
list.add("002212024070714182810655908749871321088");
|
|
|
|
|
|
list.add("002212024070714255410655910621177098240");
|
|
|
|
|
|
list.add("002212024070714581210655918751400493056");
|
|
|
|
|
|
list.add("002212024070715042010655920295677222912");
|
|
|
|
|
|
list.add("002212024070716433010655945250131255296");
|
|
|
|
|
|
list.add("002212024070716563110655948526360162304");
|
|
|
|
|
|
list.add("002212024070717073910655951327763152896");
|
|
|
|
|
|
list.add("002212024070717275510655956430003945472");
|
|
|
|
|
|
list.add("002212024070719105510655982349233311744");
|
|
|
|
|
|
list.add("002212024070720000710655994729787527168");
|
|
|
|
|
|
list.add("002212024070720065010655996419065630720");
|
|
|
|
|
|
list.add("002212024070720230310656000500815364096");
|
|
|
|
|
|
list.add("002212024070720231410656000549828632576");
|
|
|
|
|
|
list.add("002212024070720412810656005137347293184");
|
|
|
|
|
|
list.add("002212024070720524610656007981028315136");
|
|
|
|
|
|
list.add("002212024070721025310656010527680757760");
|
|
|
|
|
|
list.add("002212024070721263210656016476817637376");
|
|
|
|
|
|
list.add("002212024070722111310656027721786421248");
|
|
|
|
|
|
list.add("002212024070723320610656048078178660352");
|
|
|
|
|
|
list.add("002212024070800244810656061338556272640");
|
|
|
|
|
|
list.add("002212024070801101010656072755464343552");
|
|
|
|
|
|
list.add("002212024070801284310656077424099065856");
|
|
|
|
|
|
list.add("002212024070812511910656249205153554432");
|
|
|
|
|
|
list.add("002212024070812555110656250349805801472");
|
|
|
|
|
|
list.add("002212024070813190810656256205966327808");
|
|
|
|
|
|
list.add("002212024070814440510656277585945124864");
|
|
|
|
|
|
list.add("002212024070818265710656333670815485952");
|
|
|
|
|
|
list.add("002212024070818324110656335114252750848");
|
|
|
|
|
|
list.add("002212024070818340910656335483692851200");
|
|
|
|
|
|
list.add("002212024070818375310656336421887311872");
|
|
|
|
|
|
list.add("002212024070819095910656344502896340992");
|
|
|
|
|
|
list.add("002212024070819114910656344964292460544");
|
|
|
|
|
|
list.add("002212024070819185610656346755184693248");
|
|
|
|
|
|
list.add("002212024070819243810656348187279462400");
|
|
|
|
|
|
list.add("002212024070819390110656351807508783104");
|
|
|
|
|
|
list.add("002212024070821202610656377331394506752");
|
|
|
|
|
|
list.add("002212024070822141410656390870672564224");
|
|
|
|
|
|
list.add("002212024070822155610656391296960634880");
|
|
|
|
|
|
list.add("002212024070822260210656393837772189696");
|
|
|
|
|
|
list.add("002212024070822443310656398499647442944");
|
|
|
|
|
|
list.add("002212024070822531210656400677518401536");
|
|
|
|
|
|
list.add("002212024070823373910656411861952978944");
|
|
|
|
|
|
list.add("002212024070823463010656414091182231552");
|
|
|
|
|
|
list.add("002212024070823524210656415649555595264");
|
|
|
|
|
|
list.add("002212024070912035710656599673915797504");
|
|
|
|
|
|
list.add("002212024070912201710656603786087604224");
|
|
|
|
|
|
list.add("002212024070915434410656654984798711808");
|
|
|
|
|
|
list.add("002212024070918170510656693575173496832");
|
|
|
|
|
|
list.add("002212024070918214610656694754481741824");
|
|
|
|
|
|
list.add("002212024070918274610656696263882096640");
|
|
|
|
|
|
list.add("002212024070918512910656702233019113472");
|
|
|
|
|
|
list.add("002212024070918514810656702312949190656");
|
|
|
|
|
|
list.add("002212024070919005010656704585385349120");
|
|
|
|
|
|
list.add("002212024070919120010656707395706834944");
|
|
|
|
|
|
list.add("002212024070919460810656715984938586112");
|
|
|
|
|
|
list.add("002212024070919473210656716339923083264");
|
|
|
|
|
|
list.add("002212024070919540110656717971815313408");
|
|
|
|
|
|
list.add("002212024070920050110656720739976454144");
|
|
|
|
|
|
list.add("002212024070920484110656731726689861632");
|
|
|
|
|
|
list.add("002212024070921292110656741961891745793");
|
|
|
|
|
|
list.add("002212024070921480410656746673746595840");
|
|
|
|
|
|
list.add("002212024070922272610656756578458640384");
|
|
|
|
|
|
list.add("002212024070922525910656763011069554688");
|
|
|
|
|
|
list.add("002212024070923393210656774725237637120");
|
|
|
|
|
|
list.add("002212024070923544210656778540210192384");
|
|
|
|
|
|
list.add("002212024071000383510656789584638902272");
|
|
|
|
|
|
list.add("002212024071010133010656934265967042560");
|
|
|
|
|
|
list.add("002212024071011060810656947514322423808");
|
|
|
|
|
|
list.add("002212024071012221210656966657260175360");
|
|
|
|
|
|
list.add("002212024071012302010656968702566031360");
|
|
|
|
|
|
list.add("002212024071013083510656978329889058816");
|
|
|
|
|
|
list.add("002212024071015563010657020587005562880");
|
|
|
|
|
|
list.add("002212024071016040010657022473409445888");
|
|
|
|
|
|
list.add("002212024071017292010657043947560738816");
|
|
|
|
|
|
list.add("002212024071017373010657046004543426560");
|
|
|
|
|
|
list.add("002212024071018230510657057476182970368");
|
|
|
|
|
|
list.add("002212024071018362410657060823931191296");
|
|
|
|
|
|
list.add("002212024071019002110657066853582655488");
|
|
|
|
|
|
list.add("002212024071019174310657071222014869504");
|
|
|
|
|
|
list.add("002212024071020144710657085583465877504");
|
|
|
|
|
|
list.add("002212024071020395010657091890486648832");
|
|
|
|
|
|
list.add("002212024071021072710657098839364636672");
|
|
|
|
|
|
list.add("002212024071021162410657101090939895808");
|
|
|
|
|
|
list.add("002212024071021375810657106519018090496");
|
|
|
|
|
|
list.add("002212024071021391210657106827129872384");
|
|
|
|
|
|
list.add("002212024071022223010657117725882015744");
|
|
|
|
|
|
list.add("002212024071023350710657136000491229184");
|
|
|
|
|
|
list.add("002212024071100112610657145139130765312");
|
|
|
|
|
|
list.add("002212024071109021710657278734080118784");
|
|
|
|
|
|
list.add("002212024071111034110657309285941104640");
|
|
|
|
|
|
list.add("002212024071112520110657336548354646016");
|
|
|
|
|
|
list.add("002212024071113385310657348339878768640");
|
|
|
|
|
|
list.add("002212024071115045910657370007443517440");
|
|
|
|
|
|
list.add("002212024071115192510657373640100581376");
|
|
|
|
|
|
list.add("002212024071115511710657381659649204224");
|
|
|
|
|
|
list.add("002212024071116221610657389459108839424");
|
|
|
|
|
|
list.add("002212024071117413510657409419432124416");
|
|
|
|
|
|
list.add("002212024071117584910657413755782991872");
|
|
|
|
|
|
list.add("002212024071118531310657427446852374528");
|
|
|
|
|
|
list.add("002212024071119012510657429507929165824");
|
|
|
|
|
|
list.add("002212024071119212510657434542920171520");
|
|
|
|
|
|
list.add("002212024071119282410657436301489807360");
|
|
|
|
|
|
list.add("002212024071119335110657437672744587264");
|
|
|
|
|
|
list.add("002212024071119394610657439158669053952");
|
|
|
|
|
|
list.add("002212024071119395910657439214293913600");
|
|
|
|
|
|
list.add("002212024071120585810657459093215793152");
|
|
|
|
|
|
list.add("002212024071121435210657470389454344192");
|
|
|
|
|
|
list.add("002212024071122154510657478413626028032");
|
|
|
|
|
|
list.add("002212024071122513010657487413303808000");
|
|
|
|
|
|
list.add("002212024071123561410657503703519944704");
|
|
|
|
|
|
list.add("002212024071200340710657513234679115776");
|
|
|
|
|
|
list.add("002212024071202043410657536000580612096");
|
|
|
|
|
|
list.add("002212024071204333010657573477580443648");
|
|
|
|
|
|
list.add("002212024071211323310657678935035699200");
|
|
|
|
|
|
list.add("002212024071211380410657680324959830016");
|
|
|
|
|
|
list.add("002212024071213554910657714989515104256");
|
|
|
|
|
|
list.add("002212024071214010010657716296226398208");
|
|
|
|
|
|
list.add("002212024071217172810657765737572249600");
|
|
|
|
|
|
list.add("002212024071217182110657765957822173184");
|
|
|
|
|
|
list.add("002212024071218094110657778878196183041");
|
|
|
|
|
|
list.add("002212024071218144710657780159988068352");
|
|
|
|
|
|
list.add("002212024071218570810657790818915876864");
|
|
|
|
|
|
list.add("002212024071219324010657799762957209600");
|
|
|
|
|
|
list.add("002212024071219400110657801610545221632");
|
|
|
|
|
|
list.add("002212024071220132610657810021746913280");
|
|
|
|
|
|
list.add("002212024071220210810657811957216407552");
|
|
|
|
|
|
list.add("002212024071221381110657831350571474944");
|
|
|
|
|
|
list.add("002212024071221551810657835654929354752");
|
|
|
|
|
|
list.add("002212024071222421510657847470173151232");
|
|
|
|
|
|
list.add("002212024071222583910657851600559046656");
|
|
|
|
|
|
list.add("002212024071223510910657864810678603776");
|
|
|
|
|
|
list.add("002212024071300200310657872082335666176");
|
|
|
|
|
|
list.add("002212024071300404210657877282689286144");
|
|
|
|
|
|
list.add("002212024071300583010657881761235968000");
|
|
|
|
|
|
list.add("002212024071302302910657904909738156032");
|
|
|
|
|
|
list.add("002212024071307403610657982953855766528");
|
|
|
|
|
|
list.add("002212024071309591010658017822784200704");
|
|
|
|
|
|
list.add("002212024071312015010658048692860080128");
|
|
|
|
|
|
list.add("002212024071312380310658057806120980480");
|
|
|
|
|
|
list.add("002212024071316233510658114564513452032");
|
|
|
|
|
|
list.add("002212024071316254810658115121511026688");
|
|
|
|
|
|
list.add("002212024071316445110658119918843379712");
|
|
|
|
|
|
list.add("002212024071317335010658132244744523776");
|
|
|
|
|
|
list.add("002212024071317541010658137359831638016");
|
|
|
|
|
|
list.add("002212024071319373410658163382800240640");
|
|
|
|
|
|
list.add("002212024071319502610658166621430575104");
|
|
|
|
|
|
list.add("002212024071320183010658173685240401920");
|
|
|
|
|
|
list.add("002212024071320260710658175600118902784");
|
|
|
|
|
|
list.add("002212024071320341010658177625419988992");
|
|
|
|
|
|
list.add("002212024071320384010658178759129993216");
|
|
|
|
|
|
list.add("002212024071320542710658182730569650176");
|
|
|
|
|
|
list.add("002212024071320555710658183108601053184");
|
|
|
|
|
|
list.add("002212024071321021310658184687082713088");
|
|
|
|
|
|
list.add("002212024071322073110658201118324867072");
|
|
|
|
|
|
list.add("002212024071322103610658201895744425984");
|
|
|
|
|
|
list.add("002212024071322104610658201937978433536");
|
|
|
|
|
|
list.add("002212024071322242710658205378722357248");
|
|
|
|
|
|
list.add("002212024071322383910658208953166929920");
|
|
|
|
|
|
list.add("002212024071323065510658216065751580672");
|
|
|
|
|
|
list.add("002212024071323201810658219435336974336");
|
|
|
|
|
|
list.add("002212024071323534810658227866867773440");
|
|
|
|
|
|
list.add("002212024071401135710658248034367266816");
|
|
|
|
|
|
list.add("002212024071402574710658274165264183296");
|
|
|
|
|
|
list.add("002212024071409464210658377075400003584");
|
|
|
|
|
|
list.add("002212024071410333610658388877494882304");
|
|
|
|
|
|
list.add("002212024071411305410658403297631100928");
|
|
|
|
|
|
list.add("002212024071415143610658459592126996480");
|
|
|
|
|
|
list.add("002212024071416203610658476203262287872");
|
|
|
|
|
|
list.add("002212024071416290210658478325575602176");
|
|
|
|
|
|
list.add("002212024071416330210658479331466170368");
|
|
|
|
|
|
list.add("002212024071416442310658482188440481792");
|
|
|
|
|
|
list.add("002212024071417222310658491748499324928");
|
|
|
|
|
|
list.add("002212024071417463110658497824297807872");
|
|
|
|
|
|
list.add("002212024071418095210658503700136697856");
|
|
|
|
|
|
list.add("002212024071418241910658507337462292480");
|
|
|
|
|
|
list.add("002212024071418520910658514340199268352");
|
|
|
|
|
|
list.add("002212024071419065410658518053344296960");
|
|
|
|
|
|
list.add("002212024071419093610658518730817785856");
|
|
|
|
|
|
list.add("002212024071420000910658531454371991552");
|
|
|
|
|
|
list.add("002212024071420440110658542494894174208");
|
|
|
|
|
|
list.add("002212024071421410710658556864312266752");
|
|
|
|
|
|
list.add("002212024071421533610658560004148953088");
|
|
|
|
|
|
list.add("002212024071421534710658560051303829504");
|
|
|
|
|
|
list.add("002212024071422205310658566870639534080");
|
|
|
|
|
|
list.add("002212024071422292510658569018839027712");
|
|
|
|
|
|
list.add("002212024071422293510658569058408697856");
|
|
|
|
|
|
list.add("002212024071422483210658573829309059072");
|
|
|
|
|
|
list.add("002212024071423385310658586499360448512");
|
|
|
|
|
|
list.add("002212024071500084010658593995683635200");
|
|
|
|
|
|
list.add("002212024071501090910658609217545293824");
|
|
|
|
|
|
list.add("002212024071511161410658761994496540672");
|
|
|
|
|
|
list.add("002212024071513280410658795172632420352");
|
|
|
|
|
|
list.add("002212024071513441810658799254744453120");
|
|
|
|
|
|
list.add("002212024071514134010658806644448399360");
|
|
|
|
|
|
list.add("002212024071514322410658811358983069696");
|
|
|
|
|
|
list.add("002212024071516152310658837279305076736");
|
|
|
|
|
|
list.add("002212024071516571010658847792281640960");
|
|
|
|
|
|
list.add("002212024071517344110658857233118822400");
|
|
|
|
|
|
list.add("002212024071518335110658872124857171968");
|
|
|
|
|
|
list.add("002212024071519145310658882450216890368");
|
|
|
|
|
|
list.add("002212024071519151110658882526294532096");
|
|
|
|
|
|
list.add("002212024071519251010658885039130062848");
|
|
|
|
|
|
list.add("002212024071519270910658885535523086336");
|
|
|
|
|
|
list.add("002212024071519303010658886379672903680");
|
|
|
|
|
|
list.add("002212024071520292110658901191358373888");
|
|
|
|
|
|
list.add("002212024071521030510658909677543014400");
|
|
|
|
|
|
list.add("002212024071522295810658931544999493632");
|
|
|
|
|
|
list.add("002212024071522424710658934770277769216");
|
|
|
|
|
|
list.add("002212024071523074010658941031189741568");
|
|
|
|
|
|
list.add("002212024071600000410658954218836901888");
|
|
|
|
|
|
list.add("002212024071603434610659010515370684416");
|
|
|
|
|
|
list.add("002212024071606254010659051257723785216");
|
|
|
|
|
|
list.add("002212024071606312010659052682687021056");
|
|
|
|
|
|
list.add("002212024071611313710659128254829215744");
|
|
|
|
|
|
list.add("002212024071611474810659132327465963520");
|
|
|
|
|
|
list.add("002212024071613412510659160920036331520");
|
|
|
|
|
|
list.add("002212024071614202210659170718330302464");
|
|
|
|
|
|
list.add("002212024071614455310659177142450769920");
|
|
|
|
|
|
list.add("002212024071616120110659198817581924352");
|
|
|
|
|
|
list.add("002212024071617402210659221053621665792");
|
|
|
|
|
|
list.add("002212024071618360110659235057642184704");
|
|
|
|
|
|
list.add("002212024071618581310659240642243567616");
|
|
|
|
|
|
list.add("002212024071620560710659270313064173568");
|
|
|
|
|
|
list.add("002212024071621181610659275887985033216");
|
|
|
|
|
|
list.add("002212024071621183310659275958260293632");
|
|
|
|
|
|
list.add("002212024071621225310659277048132362240");
|
|
|
|
|
|
list.add("002212024071622011010659286684718043136");
|
|
|
|
|
|
list.add("002212024071622283510659293584995241984");
|
|
|
|
|
|
list.add("002212024071623282610659308644488142848");
|
|
|
|
|
|
list.add("002212024071623480510659313589164646400");
|
|
|
|
|
|
list.add("002212024071700220910659322163814879232");
|
|
|
|
|
|
list.add("002212024071700535410659330153477775360");
|
|
|
|
|
|
list.add("002212024071707214210659427746084458496");
|
|
|
|
|
|
list.add("002212024071708594610659452427842617344");
|
|
|
|
|
|
list.add("002212024071711003510659482829413117952");
|
|
|
|
|
|
list.add("002212024071712094910659500253107081216");
|
|
|
|
|
|
list.add("002212024071712183410659502455532601344");
|
|
|
|
|
|
list.add("002212024071713530510659526239962578944");
|
|
|
|
|
|
list.add("002212024071714262810659534643640029184");
|
|
|
|
|
|
list.add("002212024071716220510659563737027678208");
|
|
|
|
|
|
list.add("002212024071717502710659585976355422208");
|
|
|
|
|
|
list.add("002212024071717541810659586948200550400");
|
|
|
|
|
|
list.add("002212024071718140210659591910154731520");
|
|
|
|
|
|
list.add("002212024071718261510659594987159101440");
|
|
|
|
|
|
list.add("002212024071718285910659595676147216384");
|
|
|
|
|
|
list.add("002212024071718385110659598156935901184");
|
|
|
|
|
|
list.add("002212024071718462610659600064509554688");
|
|
|
|
|
|
list.add("002212024071718561810659602547476238336");
|
|
|
|
|
|
list.add("002212024071719115810659606489581707265");
|
|
|
|
|
|
list.add("002212024071719263910659610186310455296");
|
|
|
|
|
|
list.add("002212024071719275610659610511448432640");
|
|
|
|
|
|
list.add("002212024071719532810659616936728170496");
|
|
|
|
|
|
list.add("002212024071719543310659617209810993152");
|
|
|
|
|
|
list.add("002212024071720280610659625649236770816");
|
|
|
|
|
|
list.add("002212024071720333810659627042321727488");
|
|
|
|
|
|
list.add("002212024071720421310659629204341755904");
|
|
|
|
|
|
list.add("002212024071721111310659636502437666816");
|
|
|
|
|
|
list.add("002212024071721593710659648680759861248");
|
|
|
|
|
|
list.add("002212024071722022710659649394210971648");
|
|
|
|
|
|
list.add("002212024071722451410659660160519536640");
|
|
|
|
|
|
list.add("002212024071723043810659665046152114176");
|
|
|
|
|
|
list.add("002212024071723083410659666033322491904");
|
|
|
|
|
|
list.add("002212024071800142710659682613491306496");
|
|
|
|
|
|
list.add("002212024071800571210659693370750214144");
|
|
|
|
|
|
list.add("002212024071802195510659714189578956800");
|
|
|
|
|
|
list.add("002212024071812473910659872164945903616");
|
|
|
|
|
|
list.add("002212024071813220610659880830803808256");
|
|
|
|
|
|
list.add("002212024071814462810659902064822030336");
|
|
|
|
|
|
list.add("002212024071816351710659929448841175040");
|
|
|
|
|
|
list.add("002212024071817535710659949244943396864");
|
|
|
|
|
|
list.add("002212024071817582210659950358319030272");
|
|
|
|
|
|
list.add("002212024071818334610659959267898687489");
|
|
|
|
|
|
list.add("002212024071818483310659962988370812928");
|
|
|
|
|
|
list.add("002212024071819032810659966741164240896");
|
|
|
|
|
|
list.add("002212024071819242610659972015167315968");
|
|
|
|
|
|
list.add("002212024071819394310659975862358790144");
|
|
|
|
|
|
list.add("002212024071820260210659987517399076864");
|
|
|
|
|
|
list.add("002212024071820324410659989203875385344");
|
|
|
|
|
|
list.add("002212024071821363610660005278326939648");
|
|
|
|
|
|
list.add("002212024071821381710660005699964858368");
|
|
|
|
|
|
list.add("002212024071821400910660006171053805568");
|
|
|
|
|
|
list.add("002212024071821434910660007095399399424");
|
|
|
|
|
|
list.add("002212024071822152910660015062249082880");
|
|
|
|
|
|
list.add("002212024071823502310660038944565121024");
|
|
|
|
|
|
list.add("002212024071823554310660040288344625152");
|
|
|
|
|
|
list.add("002212024071901330110660064775793647616");
|
|
|
|
|
|
list.add("002212024071908362310660171316458123264");
|
|
|
|
|
|
list.add("002212024071910070310660194134058074112");
|
|
|
|
|
|
list.add("002212024071912325810660230856912101376");
|
|
|
|
|
|
list.add("002212024071912510610660235418379923456");
|
|
|
|
|
|
list.add("002212024071912533010660236023805366272");
|
|
|
|
|
|
list.add("002212024071914133210660256164214112256");
|
|
|
|
|
|
list.add("002212024071915062610660269477543239680");
|
|
|
|
|
|
list.add("002212024071915423610660278578141376512");
|
|
|
|
|
|
list.add("002212024071916085410660285196926353408");
|
|
|
|
|
|
list.add("002212024071917520310660311154555666432");
|
|
|
|
|
|
list.add("002212024071918313710660321113217404928");
|
|
|
|
|
|
list.add("002212024071918345710660321951587139584");
|
|
|
|
|
|
list.add("002212024071919112210660331117254279168");
|
|
|
|
|
|
list.add("002212024071919164110660332454306119680");
|
|
|
|
|
|
list.add("002212024071919283610660335453217918976");
|
|
|
|
|
|
list.add("002212024071919334110660336731753504768");
|
|
|
|
|
|
list.add("002212024071919431410660339134941831168");
|
|
|
|
|
|
list.add("002212024071919432810660339194256531456");
|
|
|
|
|
|
list.add("002212024071920091210660345672701313024");
|
|
|
|
|
|
list.add("002212024071920154110660347300766244864");
|
|
|
|
|
|
list.add("002212024071920223610660349042645901312");
|
|
|
|
|
|
list.add("002212024071921470610660370309860970496");
|
|
|
|
|
|
list.add("002212024071922233010660379466675695616");
|
|
|
|
|
|
list.add("002212024071922301010660381147116228608");
|
|
|
|
|
|
list.add("002212024071922560310660387658671693825");
|
|
|
|
|
|
list.add("002212024071923210310660393951240331264");
|
|
|
|
|
|
list.add("002212024072001563710660433101498777600");
|
|
|
|
|
|
list.add("002212024072008340510660533125984202752");
|
|
|
|
|
|
list.add("002212024072010335110660563267700805632");
|
|
|
|
|
|
list.add("002212024072010385610660564544769073152");
|
|
|
|
|
|
list.add("002212024072010411310660565122622529536");
|
|
|
|
|
|
list.add("002212024072011052010660571188585873408");
|
|
|
|
|
|
list.add("002212024072011552210660583781464236032");
|
|
|
|
|
|
list.add("002212024072011555710660583928339677184");
|
|
|
|
|
|
list.add("002212024072013572910660614512231366656");
|
|
|
|
|
|
list.add("002212024072014424810660625916837466112");
|
|
|
|
|
|
list.add("002212024072015510710660643111617110016");
|
|
|
|
|
|
list.add("002212024072016435810660656410357051392");
|
|
|
|
|
|
list.add("002212024072017321210660668547296620544");
|
|
|
|
|
|
list.add("002212024072017511710660673352314359808");
|
|
|
|
|
|
list.add("002212024072018195710660680562863726592");
|
|
|
|
|
|
list.add("002212024072019311810660698519623143424");
|
|
|
|
|
|
list.add("002212024072021184910660725578040832000");
|
|
|
|
|
|
list.add("002212024072022060610660737478827663360");
|
|
|
|
|
|
list.add("002212024072022095110660738422694383616");
|
|
|
|
|
|
list.add("002212024072022285410660743215805366272");
|
|
|
|
|
|
list.add("002212024072022434410660746945973559296");
|
|
|
|
|
|
list.add("002212024072101061510660782811850182656");
|
|
|
|
|
|
list.add("002212024072101415610660791794814595072");
|
|
|
|
|
|
list.add("002212024072108352310660895839786311680");
|
|
|
|
|
|
list.add("002212024072109241810660908150468497408");
|
|
|
|
|
|
list.add("002212024072111115210660935222133784576");
|
|
|
|
|
|
list.add("002212024072111190310660937031436382208");
|
|
|
|
|
|
list.add("002212024072112101910660949930262884352");
|
|
|
|
|
|
list.add("002212024072112103410660949993850638336");
|
|
|
|
|
|
list.add("002212024072112172110660951702897594368");
|
|
|
|
|
|
list.add("002212024072114130110660980811018010624");
|
|
|
|
|
|
list.add("002212024072114411210660987900811956224");
|
|
|
|
|
|
list.add("002212024072114580110660992134161047552");
|
|
|
|
|
|
list.add("002212024072116463310661019446894366720");
|
|
|
|
|
|
list.add("002212024072117135610661026337405698048");
|
|
|
|
|
|
list.add("002212024072117203210661028001354309632");
|
|
|
|
|
|
list.add("002212024072117523610661036069702033408");
|
|
|
|
|
|
list.add("002212024072117534110661036340577800192");
|
|
|
|
|
|
list.add("002212024072118293110661045361061969920");
|
|
|
|
|
|
list.add("002212024072119335810661061580418076672");
|
|
|
|
|
|
list.add("002212024072119364710661062289260331008");
|
|
|
|
|
|
list.add("002212024072119370910661062379868172288");
|
|
|
|
|
|
list.add("002212024072121453010661094681760387072");
|
|
|
|
|
|
list.add("002212024072122025410661099061711646720");
|
|
|
|
|
|
list.add("002212024072122475510661110387772448768");
|
|
|
|
|
|
list.add("002212024072123500110661126014958792704");
|
|
|
|
|
|
list.add("002212024072200060910661130077043736576");
|
|
|
|
|
|
list.add("002212024072200405110661138810633162752");
|
|
|
|
|
|
list.add("002212024072200455010661140061427240960");
|
|
|
|
|
|
list.add("002212024072211055510661296112135413760");
|
|
|
|
|
|
list.add("002212024072211192110661299494831640576");
|
|
|
|
|
|
list.add("002212024072212401410661319848941703168");
|
|
|
|
|
|
list.add("002212024072213072510661326687296077824");
|
|
|
|
|
|
list.add("002212024072213424910661335598480433152");
|
|
|
|
|
|
list.add("002212024072214205510661345186060656640");
|
|
|
|
|
|
list.add("002212024072214360110661348986164310016");
|
|
|
|
|
|
list.add("002212024072217462910661396919777718272");
|
|
|
|
|
|
list.add("002212024072218295610661407851657142272");
|
|
|
|
|
|
list.add("002212024072219034810661416374111789056");
|
|
|
|
|
|
list.add("002212024072219253410661421855267524608");
|
|
|
|
|
|
list.add("002212024072220000510661430540861878272");
|
|
|
|
|
|
list.add("002212024072220244310661436740307431424");
|
|
|
|
|
|
list.add("002212024072220341810661439151171031040");
|
|
|
|
|
|
list.add("002212024072220444710661441787717443584");
|
|
|
|
|
|
list.add("002212024072220504010661443267925426176");
|
|
|
|
|
|
list.add("002212024072220570110661444866881839104");
|
|
|
|
|
|
list.add("002212024072222121310661463790457397248");
|
|
|
|
|
|
list.add("002212024072222204810661465951628427264");
|
|
|
|
|
|
list.add("002212024072222343410661469418185719808");
|
|
|
|
|
|
list.add("002212024072223223110661481482059689984");
|
|
|
|
|
|
list.add("002212024072300460410661502509520146432");
|
|
|
|
|
|
list.add("002212024072308211510661617060238065664");
|
|
|
|
|
|
list.add("002212024072308461010661623330723762176");
|
|
|
|
|
|
list.add("002212024072310130110661645187749687296");
|
|
|
|
|
|
list.add("002212024072312422810661682799113842688");
|
|
|
|
|
|
list.add("002212024072313162610661691345359196160");
|
|
|
|
|
|
list.add("002212024072314285910661709602762747904");
|
|
|
|
|
|
list.add("002212024072315342310661726063310610432");
|
|
|
|
|
|
list.add("002212024072316012910661732883531419648");
|
|
|
|
|
|
list.add("002212024072317565210661761918588276736");
|
|
|
|
|
|
list.add("002212024072318030410661763480097177601");
|
|
|
|
|
|
list.add("002212024072319094010661780240724353024");
|
|
|
|
|
|
list.add("002212024072319154510661781770336673792");
|
|
|
|
|
|
list.add("002212024072319231910661783676281327616");
|
|
|
|
|
|
list.add("002212024072320284910661800160531013632");
|
|
|
|
|
|
list.add("002212024072320433610661803880117866496");
|
|
|
|
|
|
list.add("002212024072322300310661830669448163328");
|
|
|
|
|
|
list.add("002212024072322363110661832295173169152");
|
|
|
|
|
|
list.add("002212024072322373210661832551203020800");
|
|
|
|
|
|
list.add("002212024072322393310661833057128648704");
|
|
|
|
|
|
list.add("002212024072322594010661838121214935040");
|
|
|
|
|
|
list.add("002212024072323114710661841170223771648");
|
|
|
|
|
|
list.add("002212024072323140110661841734526455808");
|
|
|
|
|
|
list.add("002212024072323263010661844874588282880");
|
|
|
|
|
|
list.add("002212024072401121010661871466556805120");
|
|
|
|
|
|
list.add("002212024072402380710661893096266473472");
|
|
|
|
|
|
list.add("002212024072411213010662024810671636480");
|
|
|
|
|
|
list.add("002212024072411314310662027382244204544");
|
|
|
|
|
|
list.add("002212024072411444410662030657385623552");
|
|
|
|
|
|
list.add("002212024072412421310662045123676442624");
|
|
|
|
|
|
list.add("002212024072414252810662071106696224768");
|
|
|
|
|
|
list.add("002212024072414353810662073663728492544");
|
|
|
|
|
|
list.add("002212024072415114710662082764211982336");
|
|
|
|
|
|
list.add("002212024072416360110662103959310434304");
|
|
|
|
|
|
list.add("002212024072417243810662116195447447552");
|
|
|
|
|
|
list.add("002212024072418244010662131301192192000");
|
|
|
|
|
|
list.add("002212024072418323010662133275245838336");
|
|
|
|
|
|
list.add("002212024072419412310662150609387126784");
|
|
|
|
|
|
list.add("002212024072420191210662160126138560512");
|
|
|
|
|
|
list.add("002212024072420331810662163674097827840");
|
|
|
|
|
|
list.add("002212024072421150610662174195163295744");
|
|
|
|
|
|
list.add("002212024072421191410662175234400411648");
|
|
|
|
|
|
list.add("002212024072421524910662183685548322816");
|
|
|
|
|
|
list.add("002212024072422054210662186928072663040");
|
|
|
|
|
|
list.add("002212024072422391410662195366426624000");
|
|
|
|
|
|
list.add("002212024072422451410662196875497746432");
|
|
|
|
|
|
list.add("002212024072423544610662214375649517568");
|
|
|
|
|
|
list.add("002212024072500013910662216107302846464");
|
|
|
|
|
|
list.add("002212024072500141410662219275458801664");
|
|
|
|
|
|
list.add("002212024072501203410662235969809752064");
|
|
|
|
|
|
list.add("002212024072501391810662240683988004864");
|
|
|
|
|
|
list.add("002212024072512201010662401963658539008");
|
|
|
|
|
|
list.add("002212024072513434710662423002989350912");
|
|
|
|
|
|
list.add("002212024072514312210662434978347003904");
|
|
|
|
|
|
list.add("002212024072515273610662449131530653696");
|
|
|
|
|
|
list.add("002212024072517585610662487213909737472");
|
|
|
|
|
|
list.add("002212024072518514010662500486880911360");
|
|
|
|
|
|
list.add("002212024072519022610662503194177249280");
|
|
|
|
|
|
list.add("002212024072519120310662505614073618432");
|
|
|
|
|
|
list.add("002212024072519345310662511363568340992");
|
|
|
|
|
|
list.add("002212024072519364510662511829930708992");
|
|
|
|
|
|
list.add("002212024072519374810662512095916691456");
|
|
|
|
|
|
list.add("002212024072520511310662530572639584256");
|
|
|
|
|
|
list.add("002212024072521275310662539798382342144");
|
|
|
|
|
|
list.add("002212024072522122810662551018453831680");
|
|
|
|
|
|
list.add("002212024072522521310662561022518697984");
|
|
|
|
|
|
list.add("002212024072523001210662563030722383872");
|
|
|
|
|
|
list.add("002212024072523122110662566090312040448");
|
|
|
|
|
|
list.add("002212024072600172610662582468216201216");
|
|
|
|
|
|
list.add("002212024072600190210662582869410873344");
|
|
|
|
|
|
list.add("002212024072601344110662601908745101312");
|
|
|
|
|
|
list.add("002212024072611422710662754857725452288");
|
|
|
|
|
|
list.add("002212024072612290910662766611114344448");
|
|
|
|
|
|
list.add("002212024072612430110662770098166218752");
|
|
|
|
|
|
list.add("002212024072613315610662782411633713152");
|
|
|
|
|
|
list.add("002212024072614282610662796629251555328");
|
|
|
|
|
|
list.add("002212024072614484010662801720243642368");
|
|
|
|
|
|
list.add("002212024072614500510662802075453935616");
|
|
|
|
|
|
list.add("002212024072614543010662803188519251968");
|
|
|
|
|
|
list.add("002212024072616072910662821554372837376");
|
|
|
|
|
|
list.add("002212024072617284110662841989332434944");
|
|
|
|
|
|
list.add("002212024072617422910662845463691198464");
|
|
|
|
|
|
list.add("002212024072618024710662850573449814016");
|
|
|
|
|
|
list.add("002212024072618104110662852560895598592");
|
|
|
|
|
|
list.add("002212024072618423610662860591497150464");
|
|
|
|
|
|
list.add("002212024072618481810662862027435245568");
|
|
|
|
|
|
list.add("002212024072618532410662863311535456256");
|
|
|
|
|
|
list.add("002212024072618591110662864765108101120");
|
|
|
|
|
|
list.add("002212024072619062710662866595653345280");
|
|
|
|
|
|
list.add("002212024072619151210662868796523266048");
|
|
|
|
|
|
list.add("002212024072619170310662869261451186176");
|
|
|
|
|
|
list.add("002212024072620120410662883108109074432");
|
|
|
|
|
|
list.add("002212024072620344910662888833099153408");
|
|
|
|
|
|
list.add("002212024072620505310662892876711788544");
|
|
|
|
|
|
list.add("002212024072621520010662908255929827328");
|
|
|
|
|
|
list.add("002212024072622263010662916936528527360");
|
|
|
|
|
|
list.add("002212024072622313610662918219964448768");
|
|
|
|
|
|
list.add("002212024072622424510662921027761700864");
|
|
|
|
|
|
list.add("002212024072623204610662930595696197632");
|
|
|
|
|
|
list.add("002212024072623451910662936771811540992");
|
|
|
|
|
|
list.add("002212024072700460010662952045679136768");
|
|
|
|
|
|
list.add("002212024072702111310662973492050010112");
|
|
|
|
|
|
list.add("002212024072708482010663073426228838400");
|
|
|
|
|
|
list.add("002212024072712573010663136130998476800");
|
|
|
|
|
|
list.add("002212024072713305910663144558488829952");
|
|
|
|
|
|
list.add("002212024072713595810663151851537817600");
|
|
|
|
|
|
list.add("002212024072714024110663152536007311360");
|
|
|
|
|
|
list.add("002212024072714152110663155725185499136");
|
|
|
|
|
|
list.add("002212024072714423710663162586565128192");
|
|
|
|
|
|
list.add("002212024072715003810663167120806084608");
|
|
|
|
|
|
list.add("002212024072715380510663176546879504384");
|
|
|
|
|
|
list.add("002212024072717262810663203821630177280");
|
|
|
|
|
|
list.add("002212024072717435810663208223953920000");
|
|
|
|
|
|
list.add("002212024072717481710663209312427098112");
|
|
|
|
|
|
list.add("002212024072719025210663228078236827648");
|
|
|
|
|
|
list.add("002212024072719301310663234962318942208");
|
|
|
|
|
|
list.add("002212024072719452610663238790849855488");
|
|
|
|
|
|
list.add("002212024072721175310663262059237933056");
|
|
|
|
|
|
list.add("002212024072721253310663263985865187328");
|
|
|
|
|
|
list.add("002212024072721451410663268939213504512");
|
|
|
|
|
|
list.add("002212024072722162810663276800488759296");
|
|
|
|
|
|
list.add("002212024072722190310663277453268942848");
|
|
|
|
|
|
list.add("002212024072722220010663278195291152384");
|
|
|
|
|
|
list.add("002212024072722335310663281184663265280");
|
|
|
|
|
|
list.add("002212024072722422810663283344554786816");
|
|
|
|
|
|
list.add("002212024072723245310663294019568873472");
|
|
|
|
|
|
list.add("002212024072800131410663306185077653504");
|
|
|
|
|
|
list.add("002212024072801535110663331505630588928");
|
|
|
|
|
|
list.add("002212024072808394210663433641836130304");
|
|
|
|
|
|
list.add("002212024072811283610663476148493361152");
|
|
|
|
|
|
list.add("002212024072812204410663489267949875200");
|
|
|
|
|
|
list.add("002212024072813420310663509730340089856");
|
|
|
|
|
|
list.add("002212024072814010210663514507537506304");
|
|
|
|
|
|
list.add("002212024072814163510663518422364438528");
|
|
|
|
|
|
list.add("002212024072814290610663521570372648960");
|
|
|
|
|
|
list.add("002212024072814402810663524432623919104");
|
|
|
|
|
|
list.add("002212024072815402010663539499842850816");
|
|
|
|
|
|
list.add("002212024072816491910663556859089321984");
|
|
|
|
|
|
list.add("002212024072817525310663572858029850625");
|
|
|
|
|
|
list.add("002212024072818080910663576697455693824");
|
|
|
|
|
|
list.add("002212024072818272410663581540980031488");
|
|
|
|
|
|
list.add("002212024072818591510663589559566532608");
|
|
|
|
|
|
list.add("002212024072819080610663591783213424640");
|
|
|
|
|
|
list.add("002212024072819372810663599174219825152");
|
|
|
|
|
|
list.add("002212024072820054710663606301289021440");
|
|
|
|
|
|
list.add("002212024072820213110663610259744423936");
|
|
|
|
|
|
list.add("002212024072820295010663612354917048320");
|
|
|
|
|
|
list.add("002212024072820433810663615825347850240");
|
|
|
|
|
|
list.add("002212024072820470510663616696720678912");
|
|
|
|
|
|
list.add("002212024072821035310663620921002491904");
|
|
|
|
|
|
list.add("002212024072821331210663628300301565952");
|
|
|
|
|
|
list.add("002212024072821533310663633422290235392");
|
|
|
|
|
|
list.add("002212024072822243510663641233208557568");
|
|
|
|
|
|
list.add("002212024072822285610663642328485539840");
|
|
|
|
|
|
list.add("002212024072823294010663657612256862208");
|
|
|
|
|
|
list.add("002212024072900034510663666188039872512");
|
|
|
|
|
|
list.add("002212024072900274510663672229277433856");
|
|
|
|
|
|
list.add("002212024072906485210663768138442264576");
|
|
|
|
|
|
list.add("002212024072910472010663828148988510208");
|
|
|
|
|
|
list.add("002212024072914102010663879235867500544");
|
|
|
|
|
|
list.add("002212024072916031510663907653475053568");
|
|
|
|
|
|
list.add("002212024072918070710663938826113306624");
|
|
|
|
|
|
list.add("002212024072918422210663947697234038784");
|
|
|
|
|
|
list.add("002212024072919074210663954070626598912");
|
|
|
|
|
|
list.add("002212024072919075610663954132222816256");
|
|
|
|
|
|
list.add("002212024072919084210663954323615494144");
|
|
|
|
|
|
list.add("002212024072919282910663959304597364736");
|
|
|
|
|
|
list.add("002212024072919295410663959659570536448");
|
|
|
|
|
|
list.add("002212024072919425410663962931520274432");
|
|
|
|
|
|
list.add("002212024072920210410663972535940374528");
|
|
|
|
|
|
list.add("002212024072920285110663974493530304512");
|
|
|
|
|
|
list.add("002212024072921244610663988564858187776");
|
|
|
|
|
|
list.add("002212024072921312210663990228635344896");
|
|
|
|
|
|
list.add("002212024072922343810664006147944210432");
|
|
|
|
|
|
list.add("002212024072922531010664010811004796928");
|
|
|
|
|
|
list.add("002212024072922540410664011039579168768");
|
|
|
|
|
|
list.add("002212024072923175610664017047036866560");
|
|
|
|
|
|
list.add("002212024072923382310664022193383067648");
|
|
|
|
|
|
list.add("002212024073001412910664053170718384128");
|
|
|
|
|
|
list.add("002212024073012140510664212369414488064");
|
|
|
|
|
|
list.add("002212024073015423010664264820845654016");
|
|
|
|
|
|
list.add("002212024073017263310664291004912435200");
|
|
|
|
|
|
list.add("002212024073018174110664303873070673920");
|
|
|
|
|
|
list.add("002212024073018255210664305933879529472");
|
|
|
|
|
|
list.add("002212024073018473110664311380141629440");
|
|
|
|
|
|
list.add("002212024073018542910664313133895368704");
|
|
|
|
|
|
list.add("002212024073019391410664324395507843072");
|
|
|
|
|
|
list.add("002212024073019510510664327376421003264");
|
|
|
|
|
|
list.add("002212024073022340310664368388547796992");
|
|
|
|
|
|
list.add("002212024073023121110664377984430047232");
|
|
|
|
|
|
list.add("002212024073100175010664394509192200192");
|
|
|
|
|
|
list.add("002212024073100222210664395650593636352");
|
|
|
|
|
|
list.add("002212024073100413910664400499374227456");
|
|
|
|
|
|
list.add("002212024073102491810664432626716073984");
|
|
|
|
|
|
list.add("002212024073104022910664451042307407872");
|
|
|
|
|
|
list.add("002212024073111253410664562548772954112");
|
|
|
|
|
|
list.add("002212024073111452110664567525092032512");
|
|
|
|
|
|
list.add("002212024073118043010664662942944002048");
|
|
|
|
|
|
list.add("002212024073118140810664665367261749248");
|
|
|
|
|
|
list.add("002212024073118214610664667288861138944");
|
|
|
|
|
|
list.add("002212024073118381910664671452108894208");
|
|
|
|
|
|
list.add("002212024073118390910664671663595708416");
|
|
|
|
|
|
list.add("002212024073119371110664686269646602240");
|
|
|
|
|
|
list.add("002212024073119475410664688964712390656");
|
|
|
|
|
|
list.add("002212024073120524910664705300197199872");
|
|
|
|
|
|
list.add("002212024073121223810664712805447860224");
|
|
|
|
|
|
list.add("002212024073123052910664738687723356160");
|
|
|
|
|
|
list.add("002212024073123090910664739609386516480");
|
2024-07-24 13:27:39 +08:00
|
|
|
|
|
2024-03-14 11:40:11 +08:00
|
|
|
|
return list;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public List<String> getPaymentIdList() {
|
|
|
|
|
|
List<String> paymentIdList1 = getPaymentIdList1();
|
|
|
|
|
|
List<String> resultList = Lists.newArrayList();
|
|
|
|
|
|
resultList.addAll(paymentIdList1);
|
|
|
|
|
|
return resultList;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-08-30 11:02:18 +08:00
|
|
|
|
@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 = 1L;
|
|
|
|
|
|
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);
|
|
|
|
|
|
}
|
2024-07-12 17:28:21 +08:00
|
|
|
|
BigDecimal totalAccountAmount = memberVO.getTotalBalance();
|
2023-08-30 11:02:18 +08:00
|
|
|
|
if (totalAccountAmount.compareTo(BigDecimal.ZERO) <= 0) {
|
|
|
|
|
|
throw new BusinessException(ReturnCodeEnum.CODE_BALANCE_IS_INSUFFICIENT);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
dto.setChargeAmount(totalAccountAmount); // 充电金额
|
|
|
|
|
|
dto.setPayMode(OrderPayModeEnum.PAYMENT_OF_BALANCE.getValue()); // 1-余额支付
|
|
|
|
|
|
|
|
|
|
|
|
OrderBasicInfo basicInfo = orderBasicInfoService.generateOrder(dto);
|
|
|
|
|
|
|
|
|
|
|
|
// 支付订单
|
2024-06-17 09:31:47 +08:00
|
|
|
|
// PayOrderDTO payOrderDTO = new PayOrderDTO();
|
|
|
|
|
|
// payOrderDTO.setOrderCode(basicInfo.getOrderCode());
|
|
|
|
|
|
// payOrderDTO.setPayAmount(totalAccountAmount);
|
|
|
|
|
|
// payOrderDTO.setPayMode(dto.getPayMode());
|
|
|
|
|
|
// payOrderDTO.setMemberId(dto.getMemberId());
|
2023-08-30 11:02:18 +08:00
|
|
|
|
// payOrderDTO.setCode();
|
|
|
|
|
|
// payOrderDTO.setLockValue();
|
|
|
|
|
|
// payOrderDTO.setOrderBasicInfo(basicInfo);
|
|
|
|
|
|
|
2024-06-17 09:31:47 +08:00
|
|
|
|
PayOrderDTO build = PayOrderDTO.builder()
|
|
|
|
|
|
.orderCode(basicInfo.getOrderCode())
|
|
|
|
|
|
.payAmount(totalAccountAmount)
|
|
|
|
|
|
.payMode(dto.getPayMode())
|
|
|
|
|
|
.memberId(dto.getMemberId())
|
|
|
|
|
|
.build();
|
|
|
|
|
|
|
2024-01-22 12:32:22 +08:00
|
|
|
|
// Map<String, Object> map = orderBasicInfoService.payOrder(payOrderDTO);
|
|
|
|
|
|
// System.out.println(map);
|
2023-08-30 11:02:18 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@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)) {
|
2023-12-01 13:29:35 +08:00
|
|
|
|
List<String> ids = accountList.stream().map(x -> x.getId() + "").collect(Collectors.toList());
|
2023-08-30 11:02:18 +08:00
|
|
|
|
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");
|
2024-07-05 11:35:54 +08:00
|
|
|
|
dto.setIdList(Lists.newArrayList("395"));
|
2023-08-30 11:02:18 +08:00
|
|
|
|
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");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-01-19 16:59:54 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 查询汇付会员信息
|
|
|
|
|
|
*/
|
2023-08-30 11:02:18 +08:00
|
|
|
|
@Test
|
|
|
|
|
|
public void testQueryAdapayMemberInfo() {
|
2024-01-19 16:59:54 +08:00
|
|
|
|
String adapayMemberId = "ACM82792551";
|
|
|
|
|
|
String settleAccountId = null;
|
2023-08-30 11:02:18 +08:00
|
|
|
|
try {
|
2024-01-19 16:59:54 +08:00
|
|
|
|
AdapayCorpMemberVO adapayCorpMemberVO = adapayService.queryCorpAdapayMemberInfo(adapayMemberId, wechatAppId1);
|
|
|
|
|
|
// AdapaySettleAccountVO vo = adapayService.queryAdapaySettleAccount(adapayMemberId, settleAccountId, wechatAppId1);
|
|
|
|
|
|
System.out.println(JSON.toJSONString(adapayCorpMemberVO));
|
2023-08-30 11:02:18 +08:00
|
|
|
|
} 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 {
|
2023-10-26 16:54:50 +08:00
|
|
|
|
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\":\"\"}";
|
2023-08-30 11:02:18 +08:00
|
|
|
|
JSONObject jsonObject = JSON.parseObject(data);
|
|
|
|
|
|
ObjectMapper mapper = new ObjectMapper();
|
|
|
|
|
|
mapper.setPropertyNamingStrategy(PropertyNamingStrategies.SNAKE_CASE);
|
2023-10-26 16:54:50 +08:00
|
|
|
|
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
2023-08-30 11:02:18 +08:00
|
|
|
|
AdapayCallbackRecord adapayCallbackRecord = mapper.readValue(jsonObject.toJSONString(), AdapayCallbackRecord.class);
|
|
|
|
|
|
adapayCallbackRecord.setExpend(jsonObject.getString("expend"));
|
|
|
|
|
|
adapayCallbackRecord.setPaymentId(jsonObject.getString("id"));
|
2023-10-26 16:54:50 +08:00
|
|
|
|
// adapayCallbackRecordService.saveAdapayCallbackRecord(adapayCallbackRecord);
|
2023-08-30 11:02:18 +08:00
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
|
public void testAMap() throws Exception {
|
|
|
|
|
|
String pileConnectorCode = "8800000000012601";
|
|
|
|
|
|
// String s = aMapService.pushChargingDeviceDynamics(pileConnectorCode);
|
|
|
|
|
|
GetStationInfoDTO dto = new GetStationInfoDTO();
|
|
|
|
|
|
dto.setType("page");
|
2024-06-27 14:10:03 +08:00
|
|
|
|
// aMapService.getStationInfos(dto);
|
2023-08-30 11:02:18 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@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);
|
|
|
|
|
|
|
|
|
|
|
|
// 保存时间
|
2023-11-24 11:30:53 +08:00
|
|
|
|
// saveLastTime(pileSn, channel);
|
2023-08-30 11:02:18 +08:00
|
|
|
|
|
|
|
|
|
|
// 枪号
|
|
|
|
|
|
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);
|
|
|
|
|
|
|
2024-03-19 16:22:40 +08:00
|
|
|
|
String dataJson = JSON.toJSONString(json);
|
2023-08-30 11:02:18 +08:00
|
|
|
|
// 加密
|
|
|
|
|
|
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");
|
|
|
|
|
|
|
2024-03-19 16:22:40 +08:00
|
|
|
|
String jsonString = JSON.toJSONString(jsonObject1);
|
2023-08-30 11:02:18 +08:00
|
|
|
|
|
|
|
|
|
|
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());
|
2023-12-15 16:06:21 +08:00
|
|
|
|
String dataStr = new String(plainText, StandardCharsets.UTF_8);
|
2023-08-30 11:02:18 +08:00
|
|
|
|
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());
|
2024-05-09 10:15:44 +08:00
|
|
|
|
recordList.add(RefundableWxPayOrderData.builder().outTradeNo("3").transactionId("3").payerAmount(Constants.WHITELIST_DEFAULT_AMOUNT).refundableAmount(new BigDecimal("300")).build());
|
2023-08-30 11:02:18 +08:00
|
|
|
|
|
|
|
|
|
|
// 也许需要多笔支付订单才够退款
|
|
|
|
|
|
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()
|
2024-01-14 15:55:53 +08:00
|
|
|
|
.id(Integer.parseInt(orderListVO.getId()))
|
2023-08-30 11:02:18 +08:00
|
|
|
|
.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() {
|
2024-06-11 16:30:42 +08:00
|
|
|
|
// 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));
|
2023-08-30 11:02:18 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@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);
|
|
|
|
|
|
}
|
2023-10-08 16:42:56 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 查询退款信息
|
|
|
|
|
|
*/
|
|
|
|
|
|
@Test
|
|
|
|
|
|
public void queryRefundTest() {
|
2023-12-13 17:11:35 +08:00
|
|
|
|
List<String> list = getPaymentIdList(); // 查询退款信息
|
2023-10-08 16:42:56 +08:00
|
|
|
|
for (String paymentId : list) {
|
|
|
|
|
|
Map<String, Object> refundParams = Maps.newHashMap();
|
|
|
|
|
|
refundParams.put("payment_id", paymentId);
|
|
|
|
|
|
try {
|
2023-10-31 15:17:39 +08:00
|
|
|
|
Map<String, Object> refund = Refund.query(refundParams, wechatAppId2);
|
2023-10-08 16:42:56 +08:00
|
|
|
|
System.out.println("支付id:" + paymentId + ", 退款信息:" + JSON.toJSONString(refund));
|
|
|
|
|
|
System.out.println();
|
|
|
|
|
|
} catch (BaseAdaPayException e) {
|
|
|
|
|
|
throw new RuntimeException(e);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 查询支付撤销信息
|
|
|
|
|
|
*/
|
|
|
|
|
|
@Test
|
|
|
|
|
|
public void queryPaymentReverseTest() {
|
2023-12-13 17:11:35 +08:00
|
|
|
|
List<String> list = getPaymentIdList(); // 查询支付撤销信息
|
2023-10-08 16:42:56 +08:00
|
|
|
|
for (String paymentId : list) {
|
|
|
|
|
|
try {
|
|
|
|
|
|
Map<String, Object> reverse = Maps.newHashMap();
|
|
|
|
|
|
reverse.put("payment_id", paymentId);
|
2023-10-31 15:17:39 +08:00
|
|
|
|
reverse.put("app_id", wechatAppId2);
|
|
|
|
|
|
Map<String, Object> response = PaymentReverse.queryList(reverse, wechatAppId2);
|
2023-10-08 16:42:56 +08:00
|
|
|
|
System.out.printf("支付id: %s, 支付撤销信息: %s%n", paymentId, JSON.toJSONString(response));
|
|
|
|
|
|
System.out.println();
|
|
|
|
|
|
} catch (BaseAdaPayException e) {
|
|
|
|
|
|
throw new RuntimeException(e);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2023-08-30 11:02:18 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
|
public void testGenerateBillingTemplateMsgBody() {
|
|
|
|
|
|
String pileSn = "88000000000001";
|
|
|
|
|
|
// 根据桩号查询计费模板
|
|
|
|
|
|
BillingTemplateVO billingTemplateVO = pileBillingTemplateService.selectBillingTemplateDetailByPileSn(pileSn);
|
|
|
|
|
|
|
|
|
|
|
|
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.generateSN(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 {
|
2023-03-04 16:29:55 +08:00
|
|
|
|
/*String s = RandomStringUtils.randomAlphanumeric(32);
|
|
|
|
|
|
System.out.println(s); // PuLe4Tyyg1jSFNPhF5d2Ts9ejRn6E8KQ
|
|
|
|
|
|
String str = "JS160829";
|
|
|
|
|
|
System.out.println(Md5Utils.hash(str).toUpperCase(Locale.ROOT));
|
|
|
|
|
|
*/
|
2023-10-19 11:21:02 +08:00
|
|
|
|
String s = RandomStringUtils.randomAlphanumeric(16).toUpperCase(Locale.ROOT);
|
2023-08-30 11:02:18 +08:00
|
|
|
|
System.out.println(s);
|
2023-03-04 16:29:55 +08:00
|
|
|
|
|
2023-08-30 11:02:18 +08:00
|
|
|
|
Date startTimeDate = sdf.parse("2022-11-26 10:44:11");
|
|
|
|
|
|
Date endTimeDate = sdf.parse("2022-11-27 12:45:11");
|
2023-03-04 16:29:55 +08:00
|
|
|
|
|
2023-08-30 11:02:18 +08:00
|
|
|
|
System.out.println(DateUtils.getDatePoor(endTimeDate, startTimeDate)); // 1天2小时1分钟
|
2023-03-04 16:29:55 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*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));*/
|
2023-08-30 11:02:18 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@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();
|
|
|
|
|
|
|
2023-09-01 15:45:04 +08:00
|
|
|
|
// orderBasicInfoService.settleOrder(data, orderInfo);
|
2023-08-30 11:02:18 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@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());
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 保存报文
|
2024-03-19 16:22:40 +08:00
|
|
|
|
String jsonMsg = JSON.toJSONString(loginRequestData);
|
2023-08-30 11:02:18 +08:00
|
|
|
|
// 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);
|
|
|
|
|
|
}
|
2023-03-04 16:29:55 +08:00
|
|
|
|
|
2024-03-14 11:40:11 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 测试更新银行卡
|
|
|
|
|
|
*/
|
|
|
|
|
|
@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);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-04-01 09:57:23 +08:00
|
|
|
|
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));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-03-04 16:29:55 +08:00
|
|
|
|
}
|