|
@@ -34,38 +34,12 @@ public class TestJson {
|
|
// public static final String sendUrl = "http://wlhy.org.cn/wlhy-exchange-kafka/message/send";
|
|
// public static final String sendUrl = "http://wlhy.org.cn/wlhy-exchange-kafka/message/send";
|
|
|
|
|
|
public static void sendTest() {
|
|
public static void sendTest() {
|
|
- System.out.println("start");
|
|
|
|
- for (int i = 0; i < 1; i++) {
|
|
|
|
- System.out.println(i);
|
|
|
|
- try {
|
|
|
|
- List<Root> roots = new ArrayList<>();
|
|
|
|
- roots.add(getFinancialRoot());
|
|
|
|
- roots.add(testDispatch());
|
|
|
|
- roots.add(testDriverRoot(null));
|
|
|
|
- roots.add(testVehicleRoot(null));
|
|
|
|
- for (Root root : roots) {
|
|
|
|
- System.out.println("================================消息分割线================================");
|
|
|
|
- String messageJson = JSON.toJSONString(root);
|
|
|
|
- System.out.println("发送报文的内容:" + messageJson);
|
|
|
|
- String result = PostUtils.post(sendUrl, messageJson);
|
|
|
|
- System.out.println("服务器返回消息:" + result);
|
|
|
|
- }
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- e.printStackTrace();
|
|
|
|
- }
|
|
|
|
|
|
+ for (String[] user1 : usersArr) {
|
|
|
|
+ users.add(user1);
|
|
|
|
+ }
|
|
|
|
+ for (int i = 0; i < users.size(); i++) {
|
|
|
|
+ roots.add(loginRoot(users.get(i)[0], users.get(i)[1], users.get(i)[2], debugStr));
|
|
}
|
|
}
|
|
-// ExecutorService threads = Executors.newFixedThreadPool(100);
|
|
|
|
-// threads.execute(new Runnable() {
|
|
|
|
-// @Override
|
|
|
|
-// public void run() {
|
|
|
|
-//
|
|
|
|
-// }
|
|
|
|
-// });
|
|
|
|
-// try{
|
|
|
|
-// Thread.sleep(Integer.MAX_VALUE);
|
|
|
|
-// }catch (Exception e){
|
|
|
|
-// e.printStackTrace();
|
|
|
|
-// }
|
|
|
|
}
|
|
}
|
|
|
|
|
|
public static Root testDispatch() {
|
|
public static Root testDispatch() {
|
|
@@ -88,7 +62,7 @@ public class TestJson {
|
|
FinancialRoot financialRoot = new FinancialRoot();
|
|
FinancialRoot financialRoot = new FinancialRoot();
|
|
financialRoot.setActualCarrierID("SHTYXY" + new Random().nextInt(1200000000));
|
|
financialRoot.setActualCarrierID("SHTYXY" + new Random().nextInt(1200000000));
|
|
financialRoot.setCarrier(names[new Random().nextInt(names.length)]);
|
|
financialRoot.setCarrier(names[new Random().nextInt(names.length)]);
|
|
- financialRoot.setVehiclePlateColorCode(FormatChecks.licensePlateTypeCodeList.get(r.nextInt(FormatChecks.licensePlateTypeCodeList.size())));
|
|
|
|
|
|
+ financialRoot.setVehiclePlateColorCode("2");
|
|
financialRoot.setSendToProDateTime("20190505122559");
|
|
financialRoot.setSendToProDateTime("20190505122559");
|
|
financialRoot.setVehicleNumber("晋A" + (new Random().nextInt(80000) + 10000));
|
|
financialRoot.setVehicleNumber("晋A" + (new Random().nextInt(80000) + 10000));
|
|
financialRoot.setDocumentNumber("ZJLSDH" + new Date().getTime());
|
|
financialRoot.setDocumentNumber("ZJLSDH" + new Date().getTime());
|
|
@@ -110,29 +84,13 @@ public class TestJson {
|
|
|
|
|
|
List<Financial> financiallist = new ArrayList<>();
|
|
List<Financial> financiallist = new ArrayList<>();
|
|
Financial financial1 = new Financial();
|
|
Financial financial1 = new Financial();
|
|
- financial1.setBankCode(FormatChecks.bankCodeList.get(Constants.R.nextInt(FormatChecks.bankCodeList.size())));
|
|
|
|
|
|
+ financial1.setBankCode("CBOC");
|
|
financial1.setDateTime("20190505111259");
|
|
financial1.setDateTime("20190505111259");
|
|
financial1.setMonetaryAmount(r.nextInt(100000) + 1000 + "." + (r.nextInt(888) + 100));
|
|
financial1.setMonetaryAmount(r.nextInt(100000) + 1000 + "." + (r.nextInt(888) + 100));
|
|
- financial1.setPaymentMeansCode(FormatChecks.paymentMeansCodeList.get(r.nextInt(FormatChecks.paymentMeansCodeList.size())));
|
|
|
|
|
|
+ financial1.setPaymentMeansCode("32");
|
|
financial1.setReceiptAccount(new Random().nextInt(1200000000) + "");
|
|
financial1.setReceiptAccount(new Random().nextInt(1200000000) + "");
|
|
financial1.setRecipient(names[r.nextInt(names.length)]);
|
|
financial1.setRecipient(names[r.nextInt(names.length)]);
|
|
financial1.setSequenceCode("lsh" + new Random().nextInt(1200000000));
|
|
financial1.setSequenceCode("lsh" + new Random().nextInt(1200000000));
|
|
- Financial financial2 = new Financial();
|
|
|
|
- financial2.setBankCode(FormatChecks.bankCodeList.get(Constants.R.nextInt(FormatChecks.bankCodeList.size())));
|
|
|
|
- financial2.setDateTime("20190505111259");
|
|
|
|
- financial2.setMonetaryAmount(r.nextInt(100000) + 1000 + "." + (r.nextInt(888) + 100));
|
|
|
|
- financial2.setPaymentMeansCode(FormatChecks.paymentMeansCodeList.get(r.nextInt(FormatChecks.paymentMeansCodeList.size())));
|
|
|
|
- financial2.setReceiptAccount(new Random().nextInt(1200000000) + "");
|
|
|
|
- financial2.setRecipient(names[r.nextInt(names.length)]);
|
|
|
|
- financial2.setSequenceCode("lsh" + new Random().nextInt(1200000000));
|
|
|
|
- Financial financial3 = new Financial();
|
|
|
|
- financial3.setBankCode(FormatChecks.bankCodeList.get(Constants.R.nextInt(FormatChecks.bankCodeList.size())));
|
|
|
|
- financial3.setDateTime("20190505111259");
|
|
|
|
- financial3.setMonetaryAmount(r.nextInt(100000) + 1000 + "." + (r.nextInt(888) + 100));
|
|
|
|
- financial3.setPaymentMeansCode(FormatChecks.paymentMeansCodeList.get(r.nextInt(FormatChecks.paymentMeansCodeList.size())));
|
|
|
|
- financial3.setReceiptAccount(new Random().nextInt(1200000000) + "");
|
|
|
|
- financial3.setRecipient(names[r.nextInt(names.length)]);
|
|
|
|
- financial3.setSequenceCode("lsh" + new Random().nextInt(1200000000));
|
|
|
|
financiallist.add(financial1);
|
|
financiallist.add(financial1);
|
|
// financiallist.add(financial2);
|
|
// financiallist.add(financial2);
|
|
// financiallist.add(financial3);
|
|
// financiallist.add(financial3);
|
|
@@ -482,13 +440,6 @@ public class TestJson {
|
|
|
|
|
|
static {
|
|
static {
|
|
|
|
|
|
- for (String[] user1 : usersArr) {
|
|
|
|
- users.add(user1);
|
|
|
|
- }
|
|
|
|
- for (int i = 0; i < users.size(); i++) {
|
|
|
|
- roots.add(loginRoot(users.get(i)[0], users.get(i)[1], users.get(i)[2], debugStr));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
classTypes.add("A1");
|
|
classTypes.add("A1");
|
|
classTypes.add("A2");
|
|
classTypes.add("A2");
|
|
classTypes.add("B1");
|
|
classTypes.add("B1");
|