mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 11:35:12 +08:00
add 联联平台相关工具类
This commit is contained in:
@@ -9,15 +9,12 @@ import com.jsowell.common.core.domain.ykc.TransactionRecordsData;
|
||||
import com.jsowell.common.core.redis.RedisCache;
|
||||
import com.jsowell.common.enums.ykc.OrderStatusEnum;
|
||||
import com.jsowell.common.exception.BusinessException;
|
||||
import com.jsowell.common.util.BytesUtil;
|
||||
import com.jsowell.common.util.DateUtils;
|
||||
import com.jsowell.common.util.DictUtils;
|
||||
import com.jsowell.common.util.JWTUtils;
|
||||
import com.jsowell.common.util.StringUtils;
|
||||
import com.jsowell.common.util.YKCUtils;
|
||||
import com.jsowell.common.util.*;
|
||||
import com.jsowell.common.util.http.HttpUtils;
|
||||
import com.jsowell.common.util.id.SnUtils;
|
||||
import com.jsowell.common.util.id.SnowflakeIdWorker;
|
||||
import com.jsowell.common.util.ip.AddressUtils;
|
||||
import com.jsowell.common.util.lianlian.LianLianUtils;
|
||||
import com.jsowell.netty.command.ykc.IssueQRCodeCommand;
|
||||
import com.jsowell.netty.command.ykc.ProofreadTimeCommand;
|
||||
import com.jsowell.netty.handler.HeartbeatRequestHandler;
|
||||
@@ -29,14 +26,7 @@ import com.jsowell.pile.domain.PileBillingDetail;
|
||||
import com.jsowell.pile.domain.PileBillingTemplate;
|
||||
import com.jsowell.pile.domain.PileStationInfo;
|
||||
import com.jsowell.pile.domain.WxpayCallbackRecord;
|
||||
import com.jsowell.pile.dto.BasicPileDTO;
|
||||
import com.jsowell.pile.dto.BatchCreatePileDTO;
|
||||
import com.jsowell.pile.dto.ImportBillingTemplateDTO;
|
||||
import com.jsowell.pile.dto.QueryOrderDTO;
|
||||
import com.jsowell.pile.dto.QueryPileDTO;
|
||||
import com.jsowell.pile.dto.QueryStationDTO;
|
||||
import com.jsowell.pile.dto.RefundableWxPayOrderData;
|
||||
import com.jsowell.pile.dto.WeixinPayDTO;
|
||||
import com.jsowell.pile.dto.*;
|
||||
import com.jsowell.pile.mapper.MemberBasicInfoMapper;
|
||||
import com.jsowell.pile.mapper.PileBillingTemplateMapper;
|
||||
import com.jsowell.pile.service.IOrderBasicInfoService;
|
||||
@@ -55,6 +45,8 @@ import com.jsowell.service.MemberService;
|
||||
import com.jsowell.service.OrderService;
|
||||
import com.jsowell.service.PileRemoteService;
|
||||
import com.jsowell.service.PileService;
|
||||
import com.jsowell.thirdparty.domain.StationInfo;
|
||||
import com.jsowell.thirdparty.service.LianLianService;
|
||||
import com.jsowell.wxpay.common.WeChatPayParameter;
|
||||
import com.jsowell.wxpay.dto.AppletTemplateMessageSendDTO;
|
||||
import com.jsowell.wxpay.dto.WeChatRefundDTO;
|
||||
@@ -73,13 +65,7 @@ import org.springframework.util.StopWatch;
|
||||
import java.math.BigDecimal;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
|
||||
@ActiveProfiles("dev")
|
||||
@SpringBootTest(classes = JsowellApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
|
||||
@@ -154,6 +140,13 @@ public class SpringBootTestController {
|
||||
@Autowired
|
||||
private IPileAuthCardService pileAuthCardService;
|
||||
|
||||
@Autowired
|
||||
private LianLianService lianLianService;
|
||||
|
||||
static final String MAC_KEY = "53TtFpc4gdVZbF3x";
|
||||
|
||||
static final String ALGORITHM_MAC = "HmacMD5";
|
||||
|
||||
@Test
|
||||
public void testupdateElecAmount() {
|
||||
orderBasicInfoService.updateElecAmount();
|
||||
@@ -165,6 +158,70 @@ public class SpringBootTestController {
|
||||
System.out.println(pileAuthCard);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLianLian() throws Exception {
|
||||
// Long stationId = 2L;
|
||||
// // 通过id查询站点相关信息
|
||||
// PileStationInfo pileStationInfo = pileStationInfoService.selectPileStationInfoById(stationId);
|
||||
// // 组装联联平台所需要的数据格式
|
||||
// StationInfo info = StationInfo.builder()
|
||||
// .StationID(String.valueOf(stationId))
|
||||
// .OperatorID(Constants.OPERATORID_LIANLIAN)
|
||||
// .EquipmentOwnerID(Constants.OPERATORID_LIANLIAN)
|
||||
// .StationName(pileStationInfo.getStationName())
|
||||
// .IsAloneApply(Integer.valueOf(pileStationInfo.getAloneApply()))
|
||||
// .IsPublicParkingLot(Integer.valueOf(pileStationInfo.getPublicParking()))
|
||||
// .CountryCode(pileStationInfo.getCountryCode())
|
||||
// .AreaCode(pileStationInfo.getAreaCode())
|
||||
// .Address(pileStationInfo.getAddress())
|
||||
// .ServiceTel(pileStationInfo.getServiceTel())
|
||||
// .StationType(Integer.valueOf(pileStationInfo.getStationType()))
|
||||
// .StationStatus(Integer.valueOf(pileStationInfo.getStationStatus()))
|
||||
// .ParkNums(Integer.valueOf(pileStationInfo.getParkNums()))
|
||||
// .StationLng(new BigDecimal(pileStationInfo.getStationLng()))
|
||||
// .StationLat(new BigDecimal(pileStationInfo.getStationLat()))
|
||||
// .Construction(Integer.valueOf(pileStationInfo.getConstruction()))
|
||||
// .OpenAllDay(Integer.valueOf(pileStationInfo.getOpenAllDay()))
|
||||
// // .MinElectricityPrice()
|
||||
// // .ElectricityFee()
|
||||
// // .ServiceFee()
|
||||
// .ParkFree(Integer.valueOf(pileStationInfo.getParkFree()))
|
||||
// // .ParkFee()
|
||||
// .Payment(pileStationInfo.getPayment())
|
||||
// .SupportOrder(Integer.valueOf(pileStationInfo.getSupportOrder()))
|
||||
// // .equipmentInfos()
|
||||
// // .ParkFeeType()
|
||||
// .ToiletFlag(Integer.valueOf(pileStationInfo.getToiletFlag()))
|
||||
// .StoreFlag(Integer.valueOf(pileStationInfo.getStoreFlag()))
|
||||
// .RestaurantFlag(Integer.valueOf(pileStationInfo.getRestaurantFlag()))
|
||||
// .LoungeFlag(Integer.valueOf(pileStationInfo.getLoungeFlag()))
|
||||
// .CanopyFlag(Integer.valueOf(pileStationInfo.getCanopyFlag()))
|
||||
// .PrinterFlag(Integer.valueOf(pileStationInfo.getPrinterFlag()))
|
||||
// .BarrierFlag(Integer.valueOf(pileStationInfo.getBarrierFlag()))
|
||||
// .ParkingLockFlag(Integer.valueOf(pileStationInfo.getParkingLockFlag()))
|
||||
//
|
||||
// .build();
|
||||
|
||||
// List<EquipmentInfo> pileList = lianLianService.getPileList(pileStationInfo);
|
||||
// if (CollectionUtils.isNotEmpty(pileList)) {
|
||||
// info.setEquipmentInfos(pileList); // 充电设备信息列表
|
||||
// }
|
||||
|
||||
String url = "http://testdataexchange.evchargeonline.com:82/shevcs/v1/" + "notification_stationInfo";
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("OperatorID", "MA1JLFUU8");
|
||||
json.put("OperatorSecret", "Nh62XxllR5OjAzFj");
|
||||
// json.put("StationInfo", info);
|
||||
|
||||
LianLianGetTokenDTO dto = new LianLianGetTokenDTO();
|
||||
dto.setOperatorId("987654321");
|
||||
dto.setOperatorSecret("1234567890abcdef");
|
||||
String token = lianLianService.getToken(dto);
|
||||
System.out.println("token:" + token);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testRefundForBalance() {
|
||||
BigDecimal refundAmount = new BigDecimal("2");
|
||||
|
||||
Reference in New Issue
Block a user