| | |
| | | package com.gs.xiaomi; |
| | | |
| | | import cn.hutool.crypto.digest.DigestUtil; |
| | | import com.gs.xiaomi.dto.BCS101Request; |
| | | import com.gs.xiaomi.service.BCS101ApiService; |
| | | import com.gs.xiaomi.service.XM104Service; |
| | | import org.junit.jupiter.api.Test; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | @Autowired |
| | | private XM104Service xm104Service; |
| | | |
| | | @Autowired |
| | | private BCS101ApiService bcs101ApiService; |
| | | |
| | | @Test |
| | | void contextLoads() throws Exception { |
| | | xm104Service.getDb(); |
| | |
| | | |
| | | @Test |
| | | void test() { |
| | | String str = ",,"; |
| | | String[] parts = str.split(","); |
| | | for (String part : parts) { |
| | | System.out.println(part); |
| | | // String str = ",,"; |
| | | // String[] parts = str.split(","); |
| | | // for (String part : parts) { |
| | | // System.out.println(part); |
| | | // } |
| | | System.out.println(DigestUtil.md5Hex("VDATA.XM104/177301/c5Kl}xN&i(").toUpperCase()); |
| | | } |
| | | |
| | | @Test |
| | | void testBCS101ApiService() throws Exception { |
| | | // 创建测试请求参数 |
| | | BCS101Request request = new BCS101Request(); |
| | | request.setSupplierId("100071"); |
| | | request.setDocNo("9311991542"); |
| | | request.setDocType("ASNGR"); |
| | | request.setPageNo(1); |
| | | request.setPageSize(1000); |
| | | |
| | | try { |
| | | // 调用BCS101 API服务 |
| | | String response = bcs101ApiService.getBCS101Data(request); |
| | | System.out.println("BCS101 API Response: " + response); |
| | | } catch (Exception e) { |
| | | System.out.println("BCS101 API调用异常: " + e.getMessage()); |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |