作者 朱兆平

增加FWB电子运单实体类

正在显示 25 个修改的文件 包含 1588 行增加0 行删除
  1 +package com.sunyo.wlpt.base.model.efreight.fwb;
  2 +
  3 +/**
  4 + * 电子运单主运单
  5 + * @author mrz
  6 + * @date 2023-05-30
  7 + *
  8 + */
  9 +public class FWB {
  10 + /**
  11 + * 版本号
  12 + * 默认16
  13 + */
  14 + public String ver = "16";
  15 + /**
  16 + * 主运单格式
  17 + */
  18 + private String waybillNum;
  19 + /**
  20 + * 运单起始站
  21 + */
  22 + private String origin;
  23 + /**
  24 + * 运单目的站
  25 + */
  26 + private String destination;
  27 + /**
  28 + * 运单总件数
  29 + * number of pieces
  30 + */
  31 + private String quantity_picecs;
  32 + /**
  33 + * 运单毛重,运单的实际称重
  34 + */
  35 + private String quantity_weight;
  36 + /**
  37 + * 计重单位,
  38 + * K 代表KG 公斤
  39 + * L 代表公升
  40 + */
  41 + private String quantity_weight_code;
  42 + /**
  43 + * 体积
  44 + */
  45 + private String quantity_volume;
  46 + /**
  47 + * 体积单位
  48 + * MC 代表 立方米 Cubic Metres
  49 + * CC 代表 立方厘米 Cubic Centimeters
  50 + * CF 代表 立方英尺 Cubic Feet
  51 + * CI 代表 立方英寸 Cubic Inches
  52 + */
  53 + private String quantity_volume_code;
  54 + /**
  55 + * 密度
  56 + * 可选节点
  57 + */
  58 + private String quantity_density ;
  59 + /**
  60 + * 密度
  61 + * 可选节点
  62 + */
  63 + private String quantity_density_code = "DG";
  64 +
  65 +
  66 +
  67 +
  68 +}
  1 +package com.sunyo.wlpt.base.model.efreight.fwb;
  2 +
  3 +/**
  4 + * Accounting Information
  5 + * 财务信息
  6 + * O 可选节点
  7 + * 可重复6次
  8 + * DEMO:
  9 + * ACC/GEN/FREIGHT PREPAID
  10 + * CRLF
  11 + */
  12 +public class FWB_ACC {
  13 + /**
  14 + *
  15 + * 财务信息ID标识
  16 + * [A-Z]{1,3}
  17 + * M
  18 + * DEMO:
  19 + * /GEN
  20 + */
  21 + private String acc_info_id;
  22 + /**
  23 + *
  24 + * 财务信息内容
  25 + * [A-Z0-9-<=/\s\.]{1,34}
  26 + * M
  27 + * DEMO:
  28 + * /GEN/FREIGHT PREPAID
  29 + */
  30 + private String acc_info;
  31 +}
  1 +package com.sunyo.wlpt.base.model.efreight.fwb;
  2 +
  3 +/**
  4 + * 代理人信息
  5 + * 代理人信息有IATA代码 则名称与地址也为必填项
  6 + * conditional (must be included if the indicated condition is met);C
  7 + * (满足指定条件必须包含在内)
  8 + * (中性运单包含代理人IATA信息 则必填)
  9 + */
  10 +public class FWB_AGT {
  11 +
  12 + /**
  13 + * 代理人账号信息
  14 + * [A-Z0-9-<=/\s\.]{0,14}
  15 + */
  16 + private String agt_account_number;
  17 +
  18 + /**
  19 + * 代理人IATA代码
  20 + * \d{7}
  21 + *
  22 + */
  23 + private String agt_IATA_number;
  24 +
  25 + /**
  26 + * code issued by IATA to identify individual agent locations for CASS billing purposes
  27 + * 由国际航空运输协会发布的代码,用于标识用于CASS计费的各个代理位置,闹求不机密啥意思
  28 + * \d{0,4} 有就是4位,没有就0位
  29 + *
  30 + */
  31 + private String agt_CASS_ADR;
  32 + /**
  33 + * participant identifier 参与者标识符
  34 + * [A-Z0-9]{0,3}
  35 + */
  36 + private String agt_participant_id;
  37 + /**
  38 + * 代理人名称
  39 + * [A-Z0-9-<=/\s\.]{1,35}
  40 + */
  41 + private String agt_name;
  42 + /**
  43 + * 代理人地址
  44 + * [A-Z0-9-<=/\s\.]{1,17}
  45 + */
  46 + private String agt_ADR;
  47 +}
  1 +package com.sunyo.wlpt.base.model.efreight.fwb;
  2 +
  3 +import com.sunyo.wlpt.base.model.efreight.fwb.exception.FWBException;
  4 +
  5 +public interface FWB_BASE {
  6 +
  7 + String getFWBNodeText() throws FWBException;
  8 +
  9 + String getNodeName();
  10 +}
  1 +package com.sunyo.wlpt.base.model.efreight.fwb;
  2 +
  3 +/**
  4 + * CER
  5 + * Shipper's Certification
  6 + * 托运人认证
  7 + * O 可选节点
  8 + *
  9 + * DEMO:(括号里面的是可选项)
  10 + * CER/ZHENGZHOU NAVITRANS
  11 + * CRLF
  12 + */
  13 +public class FWB_CER {
  14 +
  15 + /**
  16 + * NODE:CER
  17 + * Signature
  18 + * 签名
  19 + * [A-Z0-9-<=/\s\.]{0,20}
  20 + * O (可选节点)
  21 + * DEMO:
  22 + * CER/ZHENGZHOU NAVITRANS
  23 + */
  24 + private String cer_signature;
  25 +}
  1 +package com.sunyo.wlpt.base.model.efreight.fwb;
  2 +
  3 +/**
  4 + * 主单收货人
  5 + * mandatory (must be included);M
  6 + */
  7 +public class FWB_CNE {
  8 +
  9 + /**
  10 + * 收货人账号信息
  11 + * [A-Z0-9-<=/\s\.]{0,14}
  12 + * 禁止字符正则 [^A-Z0-9-.<=\s\/]
  13 + */
  14 + private String cne_account_number;
  15 + /**
  16 + * 收货人名称
  17 + * [A-Z0-9-<=/\s\.]{1,35}
  18 + * 名称信息可最多重复2次
  19 + */
  20 + private String cne_name;
  21 + /**
  22 + * 收货人地址
  23 + * [A-Z0-9-<=/\s\.]{1,35}
  24 + * 地址信息最多可重复两次
  25 + */
  26 + private String cne_adr;
  27 + /**
  28 + * 收货人城市
  29 + * [A-Z0-9-<=/\s\.]{1,17}
  30 + */
  31 + private String cne_loc_place;
  32 + /**
  33 + * 收货人省
  34 + * [A-Z0-9-<=/\s\.]{0,9}
  35 + */
  36 + private String cne_loc_province;
  37 + /**
  38 + * 收货人国家
  39 + * [A-Z]{2}
  40 + */
  41 + private String cne_country;
  42 + /**
  43 + * 收货人邮编
  44 + * [A-Z0-9-<=/\s\.]{0,9}
  45 + */
  46 + private String cne_postcode;
  47 + /**
  48 + * 收货人联系方式类别
  49 + * FX|TE|TL
  50 + * 传真|电话|电传(电报)
  51 + * 可重复未标识重复次数
  52 + */
  53 + private String cne_contact_id;
  54 + /**
  55 + * 收货人联系方式具体信息(号码)
  56 + * [A-Z0-9]{1,25}
  57 + */
  58 + private String cne_contact_number;
  59 +
  60 +
  61 +}
  62 +
  1 +package com.sunyo.wlpt.base.model.efreight.fwb;
  2 +
  3 +/**
  4 + * COL
  5 + * Collect Charge Summary
  6 + * 到付费用汇总
  7 + * O 可选节点
  8 + * 到付节点与预付PPD节点字段相同
  9 + * DEMO:(括号里面的是可选项)
  10 + * COL/WT22213.8/VC0/TX0
  11 + * /OA0/OC14/CT22227.8
  12 + * CRLF
  13 + */
  14 +public class FWB_COL {
  15 +
  16 + /**
  17 + * NODE:WT
  18 + * ToTal Weight Charge
  19 + * 总重量费用
  20 + * [0-9\.]{0,12}
  21 + * O (可选节点)
  22 + * DEMO:
  23 + * /WT/12306.99
  24 + */
  25 + private String col_weight_amount;
  26 +
  27 + /**
  28 + * NODE:VC
  29 + * Valuation Charge
  30 + * 声明价值附加费
  31 + * [0-9\.]{0,12}
  32 + * O (可选节点)
  33 + * DEMO:
  34 + * /VC/12306.99
  35 + */
  36 + private String col_valuation_amount;
  37 +
  38 + /**
  39 + * NODE:TX
  40 + * Taxes
  41 + * 税费
  42 + * [0-9\.]{0,12}
  43 + * O (可选节点)
  44 + * DEMO:
  45 + * /TX/12306.99
  46 + */
  47 + private String col_taxes_amount;
  48 +
  49 + /**
  50 + * NODE:OA
  51 + * Other Charges Due Agent
  52 + * 交代理人的其它费用总额
  53 + * [0-9\.]{0,12}
  54 + * O (可选节点)
  55 + * DEMO:
  56 + * /OA/12306.99
  57 + */
  58 + private String col_other_charges_due_agent;
  59 +
  60 + /**
  61 + * NODE:OC
  62 + * Other Charges Due Carrier
  63 + * 交承运人的其它费用总额
  64 + * [0-9\.]{0,12}
  65 + * O (可选节点)
  66 + * DEMO:
  67 + * /OC/12306.99
  68 + */
  69 + private String col_other_charges_due_carrier;
  70 +
  71 + /**
  72 + * NODE:CT
  73 + * Charge Summary Total
  74 + * 收费汇总
  75 + * [0-9\.]{0,12}
  76 + * O (可选节点)
  77 + * DEMO:
  78 + * /CT/12306.99
  79 + */
  80 + private String col_charge_summary_total;
  81 +
  82 +}
  1 +package com.sunyo.wlpt.base.model.efreight.fwb;
  2 +
  3 +
  4 +/**
  5 + * COR
  6 + * Customs Origin
  7 + * 海关起始信息 (飞机驶离的航站楼信息:如T1)
  8 + * O (O 可选, M 必填, C 指定条件下可选)
  9 + *
  10 + * DEMO:(括号里面的是可选项)
  11 + * COR/T1 OR COR/X
  12 + * CRLF
  13 + */
  14 +public class FWB_COR {
  15 +
  16 + /**
  17 + * Parent NODE:COR
  18 + * Par Node Des(EN):
  19 + * Par Node Des(CN):
  20 + * This Node Des EN: Customs Origin Code
  21 + * This Node Des CN: 海关起始代码
  22 + * [0-9A-Z]{0,2}
  23 + * O (O 可选, M 必填, C 指定条件下可选)
  24 + * DEMO:
  25 + * X
  26 + */
  27 + private String cor_code;
  28 +}
  1 +package com.sunyo.wlpt.base.model.efreight.fwb;
  2 +/**
  3 + * CVD
  4 + * Charge Declarations
  5 + * 收费声明
  6 + * M 必填节点
  7 + *
  8 + * DEMO:(括号里面的是可选项)
  9 + * CVD/CNY/(PX)/PP/NVD/NCV/XXX
  10 + * CRLF
  11 + */
  12 +public class FWB_CVD {
  13 +
  14 + /**
  15 + * 货币单位
  16 + * [A-Z]{1,3}
  17 + * M
  18 + * DEMO:
  19 + * CNY
  20 + */
  21 + private String cvd_currency_code;
  22 +
  23 + /**
  24 + * Charge Code
  25 + * 收费代码
  26 + * [A-Z]{2}
  27 + * C 可选
  28 + * DEMO:
  29 + * PP CC CZ CG PX ...太多了 看字典吧
  30 + * 大多数时候空着
  31 + */
  32 + private String cvd_charge_code;
  33 +
  34 + /**
  35 + * Prepaid/Collect Charge Declarations
  36 + * 预付/到付声明
  37 + * PP|CC
  38 + * M
  39 + * DEMO:
  40 + * PP
  41 + */
  42 + private String cvd_charge_prepaid;
  43 +
  44 + /**
  45 + * Value For Carriage Declaration
  46 + * 运费申报价值
  47 + * [0-9.]{1,12}
  48 + * M 必填
  49 + * DEMO:
  50 + * 123.31 OR NVD
  51 + */
  52 + private String cvd_value_for_carriage;
  53 +
  54 + /**
  55 + * Value For Carriage Declaration
  56 + * 海关声明价值
  57 + * [0-9.]{1,12}
  58 + * M 必填
  59 + * DEMO:
  60 + * 123.05 OR NCV
  61 + */
  62 + private String cvd_value_for_customs;
  63 +
  64 + /**
  65 + * Value For insurance Declaration
  66 + * 保险声明价值
  67 + * [0-9.]{1,11}
  68 + * M 必填
  69 + * DEMO:
  70 + * 123.05 OR XXX
  71 + */
  72 + private String getCvd_value_for_customs;
  73 +}
  1 +package com.sunyo.wlpt.base.model.efreight.fwb;
  2 +
  3 +/**
  4 + * Flight Bookings
  5 + * FLT
  6 + * 运单航程航班
  7 + */
  8 +public class FWB_FLT {
  9 + /**
  10 + * 承运人代码 mm
  11 + * [A-Z]{2}
  12 + */
  13 + private String cariier;
  14 + /**
  15 + * 航班号 nnn(n)(a)
  16 + * [0-9]{3}\d?[A-Z0-9]?
  17 + */
  18 + private String flightNumber;
  19 + /**
  20 + * 航班日期 - 按日标识
  21 + * [0-9]{2}
  22 + */
  23 + private String day;
  24 +
  25 +}
  1 +package com.sunyo.wlpt.base.model.efreight.fwb;
  2 +
  3 +
  4 +/**
  5 + * ISU
  6 + * Carrier's Execution
  7 + * 承运人的执行信息
  8 + * M 必填节点
  9 + *
  10 + * DEMO:(括号里面的是可选项)
  11 + * ISU/29MAY23/ZHENGZHOU/ZHU YUAN ZHANG
  12 + * CRLF
  13 + */
  14 +public class FWB_ISU {
  15 + /**
  16 + * NODE:ISU
  17 + * Day Mounth Year
  18 + * 签名日期
  19 + * [0-9]{2}[A-Z]{3}[0-9]{2}
  20 + * M (必填节点)
  21 + * DEMO:
  22 + * 29MAY23
  23 + */
  24 + private String isu_day_mounth_year;
  25 +
  26 + /**
  27 + * NODE:ISU
  28 + * Place Or Airport/City Code
  29 + * 签订地址 或 机场代码 或城市代码
  30 + * [A-Z0-9-<=/\s\.]{1,17}
  31 + * M (必填节点)
  32 + * DEMO:
  33 + * ZHENGZHOU OR CGO OR BJS
  34 + */
  35 + private String isu_place_or_airport_code;
  36 +
  37 + /**
  38 + * NODE:ISU
  39 + * Authorisation
  40 + * Signature
  41 + * 许可签名
  42 + * [A-Z0-9-<=/\s\.]{0,20}
  43 + * O (可选节点)
  44 + * DEMO:
  45 + * ZHU YUANZHANG
  46 + */
  47 + private String isu_signature;
  48 +}
  1 +package com.sunyo.wlpt.base.model.efreight.fwb;
  2 +
  3 +/**
  4 + * NFY
  5 + * Also Notify
  6 + * 另外通知
  7 + * optional (may be included) 可选(有可能包含)
  8 + * 请求最多可重复2次
  9 + * DEMO:
  10 + * /NFY/
  11 + */
  12 +public class FWB_NFY {
  13 + /**
  14 + * 被通知人名称
  15 + * [A-Z0-9-<=/\s\.]{1,35}
  16 + * 最多重复两次,一行装不下装两行
  17 + * /NAME TEXT
  18 + * /NAME TEXT
  19 + */
  20 + private String nfy_name;
  21 +
  22 + /**
  23 + * 被通知人地址
  24 + * [A-Z0-9-<=/\s\.]{1,35}
  25 + * 最多重复两次,一行装不下装两行
  26 + * /ADR TXT
  27 + * /ADR TXT
  28 + */
  29 + private String nfy_ADR;
  30 + /**
  31 + * 被通知人城市
  32 + * [A-Z0-9-<=/\s\.]{1,17}
  33 + * /CITY NAME
  34 + */
  35 + private String nfy_LOC_city;
  36 + /**
  37 + *
  38 + * 被通知人省
  39 + * [A-Z0-9-<=/\s\.]{0,9}
  40 + * /PROVINCE NAME
  41 + * O 可选
  42 + */
  43 + private String nfy_LOC_province;
  44 +
  45 + /**
  46 + * 被通知人国家
  47 + * [A-Z]{2}
  48 + * /CN
  49 + * M
  50 + */
  51 + private String nfy_country;
  52 + /**
  53 + * 邮编
  54 + * [A-Z0-9-<=/\s\.]{0,9}
  55 + * O 可选
  56 + */
  57 + private String nfy_postcode;
  58 + /**
  59 + * Contact Detail 可重复多次
  60 + * 联系方式代码
  61 + * TE|FX|TL
  62 + * M
  63 + */
  64 + private String nfy_contact_id;
  65 + /**
  66 + * 联系方式号码
  67 + * [A-Z0-9]{1,25}
  68 + * M
  69 + */
  70 + private String nfy_contact_NUM;
  71 +}
  1 +package com.sunyo.wlpt.base.model.efreight.fwb;
  2 +
  3 +import com.sunyo.wlpt.base.model.efreight.fwb.exception.FWBException;
  4 +import com.sunyo.wlpt.base.model.efreight.fwb.exception.FWBExceptionType;
  5 +import org.springframework.util.StringUtils;
  6 +
  7 +import java.util.regex.Matcher;
  8 +import java.util.regex.Pattern;
  9 +
  10 +/**
  11 + * OCI
  12 + * Other Customs,Security And Regulatory Control Information
  13 + * 其他海关、安全和监管信息
  14 + * O 可选节点
  15 + * OCI 内节点可重复次数不限
  16 + * DEMO:(括号里面的是可选项)
  17 + * OCI/CN/SHP/T/USCI91440101MA9Y9E79XG
  18 + * /CN/SHP/CT/862086277592
  19 + * /NL/CNE/T/NL857752108
  20 + * /NL/CNE/CP/PLANNING AEROEXPRESSGROUP.COM
  21 + * /NL/CNE/CT/029 774 5540
  22 + * CRLF
  23 + */
  24 +public class FWB_OCI implements FWB_BASE {
  25 +
  26 + /**
  27 + * NODE:OCI
  28 + * ISO Country Code
  29 + * 国际标准国家代码二字码
  30 + *
  31 + * [A-Z]{0,2}
  32 + * C (可选节点,主节点存在的情况下)
  33 + * DEMO:
  34 + * /CN
  35 + */
  36 + private String oci_country_code ="";
  37 +
  38 + /**
  39 + * NODE:OCI
  40 + * Information Identifier
  41 + * 信息业务类型标识
  42 + *
  43 + * [A-Z]{0,3}
  44 + * C (可选节点,主节点存在的情况下)
  45 + * DEMO:
  46 + * /SHP OR /CNE
  47 + */
  48 + private String oci_information_id="";
  49 +
  50 + /**
  51 + * NODE:OCI
  52 + * Other Customs,Security And Regulatory Control Information Identifier
  53 + * 其他海关、安全和监管信息ID业务标识
  54 + *
  55 + * [A-Z]{0,2}
  56 + * C (可选节点,主节点存在的情况下)
  57 + * DEMO:
  58 + * /T OR /CP OR /CT ...
  59 + */
  60 + private String oci_csrc_id="";
  61 +
  62 +
  63 + /**
  64 + * NODE:OCI
  65 + * Supplementary Customs,Security And Regulatory Control Information
  66 + * 补充海关、安全及管制资料
  67 + * 此节点有值的话 上一个节点oci_csrc_id也必须有值
  68 + * [A-Z]{0,35}
  69 + * M (可选节点,主节点存在的情况下)
  70 + * DEMO:
  71 + * /USCI91440101MA9Y9E79XG (商业注册编码) OR /PLANNING AEROEXPRESSGROUP.COM (具体联系人联系信息) ...
  72 + */
  73 + private String oci_csrc_info="";
  74 +
  75 +
  76 + /**
  77 + * ---------------------------------------------------------------------------------------------------
  78 + *
  79 + */
  80 + public String getOci_country_code() {
  81 + //校验正则
  82 + String patternStr = "^[A-Z]{2}$";
  83 + Pattern pattern = Pattern.compile(patternStr);
  84 + Matcher matcher = pattern.matcher(oci_country_code);
  85 + if (!matcher.find()){
  86 + System.out.println("[OCI-WARN]-缺少国家代码信息,或未通过规则校验");
  87 + }
  88 + return oci_country_code;
  89 + }
  90 +
  91 + public void setOci_country_code(String oci_country_code) {
  92 + this.oci_country_code = oci_country_code;
  93 + }
  94 +
  95 + public String getOci_information_id() {
  96 + //校验正则
  97 + String patternStr = "^[A-Z]{3}$";
  98 + Pattern pattern = Pattern.compile(patternStr);
  99 + Matcher matcher = pattern.matcher(oci_information_id);
  100 + if (!matcher.find()){
  101 + System.out.println("[OCI-WARN]-缺少业务代码信息ID,或未通过规则校验");
  102 + }
  103 + return oci_information_id;
  104 + }
  105 +
  106 + public void setOci_information_id(String oci_information_id) {
  107 + this.oci_information_id = oci_information_id;
  108 + }
  109 +
  110 + public String getOci_csrc_id() {
  111 + String patternStr = "^[A-Z]{1,2}$";
  112 + Pattern pattern = Pattern.compile(patternStr);
  113 + Matcher matcher = pattern.matcher(oci_csrc_id);
  114 + if (!matcher.find()){
  115 + System.out.println("[OCI-WARN]-缺少CSCR ID,或未通过规则校验");
  116 + }
  117 + return oci_csrc_id;
  118 + }
  119 +
  120 + public void setOci_csrc_id(String oci_csrc_id) {
  121 + this.oci_csrc_id = oci_csrc_id;
  122 + }
  123 +
  124 + /**
  125 + * 在必填项字段进行 所需相关信息数据的检查
  126 + * @return
  127 + */
  128 + public String getOci_csrc_info() throws FWBException {
  129 + if (StringUtils.hasText(oci_csrc_info)){
  130 + if (
  131 + !StringUtils.hasLength(this.oci_csrc_id)
  132 + ){
  133 + throw new FWBException(FWBExceptionType.OCI_CSRC_ERROR);
  134 + }
  135 + }
  136 +
  137 + return oci_csrc_info;
  138 + }
  139 +
  140 +
  141 + public void setOci_csrc_info(String oci_csrc_info) {
  142 + this.oci_csrc_info = oci_csrc_info;
  143 + }
  144 +
  145 + @Override
  146 + public String getFWBNodeText() throws FWBException {
  147 + String SPLIT_CODE = "/";
  148 + String CRLF = "\n";
  149 + StringBuilder sb = new StringBuilder("");
  150 + if (StringUtils.hasLength(getOci_csrc_info())){
  151 + sb.append(SPLIT_CODE)
  152 + .append(getOci_country_code())
  153 + .append(SPLIT_CODE)
  154 + .append(getOci_information_id())
  155 + .append(SPLIT_CODE)
  156 + .append(getOci_csrc_id())
  157 + .append(SPLIT_CODE)
  158 + .append(getOci_csrc_info())
  159 + .append(CRLF);
  160 + return sb.toString();
  161 + }
  162 +
  163 + return "";
  164 + }
  165 +
  166 + @Override
  167 + public String getNodeName() {
  168 + return "OCI";
  169 + }
  170 +
  171 +
  172 +}
  1 +package com.sunyo.wlpt.base.model.efreight.fwb;
  2 +
  3 +
  4 +/**
  5 + * OSI
  6 + * Other Service Infomation
  7 + * 其他服务信息
  8 + * O (O 可选, M 必填, C 指定条件下可选)
  9 + *
  10 + * DEMO:(括号里面的是可选项)
  11 + * OSI/SAY TOTAL 8 PACKAGES PLEASE NOTIFY CONSIGNEE UPON FLIGHT ARRIVAL
  12 + * CRLF
  13 + */
  14 +public class FWB_OSI {
  15 +
  16 + /**
  17 + * Parent NODE:OSI
  18 + * Par Node Des(EN):
  19 + * Par Node Des(CN):
  20 + * This Node Des EN: Other Service Information Text
  21 + * This Node Des CN: 其他服务信息内容
  22 + * [A-Z0-9-<=/\s\.]{0,65}
  23 + * O (O 可选, M 必填, C 指定条件下可选)
  24 + * 可重复次数:3
  25 + * DEMO:
  26 + * OSI/ZV EA FILED SPX PER ATTACHED LIST CH RA 00195-01 31-05-23 13 27
  27 + * /ZV EA FILED SPX PER ATTACHED LIST CH RA 00195-01 31-05-23 16 46
  28 + */
  29 + private String osi_text;
  30 +}
  1 +package com.sunyo.wlpt.base.model.efreight.fwb;
  2 +
  3 +
  4 +/**
  5 + * OTH
  6 + * Other Charges
  7 + * 其他费用
  8 + * O 可选节点
  9 + *
  10 + * DEMO:(括号里面的是可选项)
  11 + * OTH/P/NEC14
  12 + * CRLF
  13 + */
  14 +public class FWB_OTH {
  15 + /**
  16 + * NODE:P OR C
  17 + * Other Charge Code
  18 + * 其他费用代码
  19 + * [A-Z]{2}
  20 + * M (主节点存在则子节点必须有)
  21 + * DEMO:
  22 + * NE
  23 + */
  24 + private String oth_charge_code;
  25 +
  26 + /**
  27 + * NODE:P OR C
  28 + * Entitlement Code
  29 + * 授权代码
  30 + * [A-Z]{1}
  31 + * M (主节点存在则子节点必须有)
  32 + * DEMO:
  33 + * C
  34 + */
  35 + private String oth_entitlement_code;
  36 +
  37 + /**
  38 + * NODE:P OR C
  39 + * Charge Amount
  40 + * 收费金额
  41 + * [0-9\.]{12}
  42 + * M (主节点存在则子节点必须有)
  43 + * 此节点可重复复出现3次
  44 + * DEMO:
  45 + * 22.73
  46 + */
  47 + private String oth_amount;
  48 +}
  1 +package com.sunyo.wlpt.base.model.efreight.fwb;
  2 +
  3 +/**
  4 + * PPD
  5 + * Prepaid Charge Summary
  6 + * 预付费用汇总
  7 + * O 可选节点
  8 + *
  9 + * DEMO:(括号里面的是可选项)
  10 + * PPD/WT22213.8/VC0/TX0
  11 + * /OA0/OC14/CT22227.8
  12 + * CRLF
  13 + */
  14 +public class FWB_PPD {
  15 +
  16 + /**
  17 + * NODE:WT
  18 + * ToTal Weight Charge
  19 + * 总重量费用
  20 + * [0-9\.]{0,12}
  21 + * O (可选节点)
  22 + * DEMO:
  23 + * /WT/12306.99
  24 + */
  25 + private String ppd_weight_amount;
  26 +
  27 + /**
  28 + * NODE:VC
  29 + * Valuation Charge
  30 + * 声明价值附加费
  31 + * [0-9\.]{0,12}
  32 + * O (可选节点)
  33 + * DEMO:
  34 + * /VC/12306.99
  35 + */
  36 + private String ppd_valuation_amount;
  37 +
  38 + /**
  39 + * NODE:TX
  40 + * Taxes
  41 + * 税费
  42 + * [0-9\.]{0,12}
  43 + * O (可选节点)
  44 + * DEMO:
  45 + * /TX/12306.99
  46 + */
  47 + private String ppd_taxes_amount;
  48 +
  49 + /**
  50 + * NODE:OA
  51 + * Other Charges Due Agent
  52 + * 交代理人的其它费用总额
  53 + * [0-9\.]{0,12}
  54 + * O (可选节点)
  55 + * DEMO:
  56 + * /OA/12306.99
  57 + */
  58 + private String ppd_other_charges_due_agent;
  59 +
  60 + /**
  61 + * NODE:OC
  62 + * Other Charges Due Carrier
  63 + * 交承运人的其它费用总额
  64 + * [0-9\.]{0,12}
  65 + * O (可选节点)
  66 + * DEMO:
  67 + * /OC/12306.99
  68 + */
  69 + private String ppd_other_charges_due_carrier;
  70 +
  71 + /**
  72 + * NODE:CT
  73 + * Charge Summary Total
  74 + * 收费汇总
  75 + * [0-9\.]{0,12}
  76 + * O (可选节点)
  77 + * DEMO:
  78 + * /CT/12306.99
  79 + */
  80 + private String ppd_charge_summary_total;
  81 +
  82 +}
  1 +package com.sunyo.wlpt.base.model.efreight.fwb;
  2 +
  3 +import com.sunyo.wlpt.base.model.efreight.fwb.exception.FWBException;
  4 +import com.sunyo.wlpt.base.model.efreight.fwb.exception.FWBExceptionType;
  5 +import org.springframework.util.StringUtils;
  6 +
  7 +import java.util.regex.Matcher;
  8 +import java.util.regex.Pattern;
  9 +
  10 +/**
  11 + * REF
  12 + * Sender Reference
  13 + * 发送者参考信息
  14 + * M 必填节点
  15 + *
  16 + * DEMO:(括号里面的是可选项)
  17 + * REF/CGOFD1E/EC1A2C4CBC3D/AGT/MECCGO01/CGO
  18 + * CRLF
  19 + */
  20 +public class FWB_REF implements FWB_BASE{
  21 +
  22 + /**
  23 + * NODE:REF
  24 + * Sender Office Message Address
  25 + * 发送人办公室电报地址
  26 + * Air Port Code And Office Function Designator And Company Designator
  27 + * [A-Z]{3}[0-9A-Z]{2}[0-9A-Z]{2}
  28 + * M (必填节点)
  29 + * DEMO:
  30 + * CGOFD1E
  31 + */
  32 + private String ref_address = "";
  33 +
  34 + /**
  35 + * NODE:REF
  36 + * Sender Office File Reference
  37 + * 发件人办公室文件参考
  38 + * File Reference
  39 + * [A-Z0-9-<=/\s\.]{0,15}
  40 + * O (可选节点)
  41 + * DEMO:
  42 + * EC1A2C4CBC3D
  43 + */
  44 + private String ref_file_reference ="";
  45 +
  46 + /**
  47 + * NODE:REF
  48 + * Sender Participan Identification
  49 + * 发送方参与者身份
  50 + * Participan Identification
  51 + * [A-Z0-9]{0,3}
  52 + * O (可选节点)
  53 + * DEMO:
  54 + * EC1
  55 + */
  56 + private String ref_participant_id = "";
  57 +
  58 + /**
  59 + * NODE:REF
  60 + * Sender Participan Identification
  61 + * 发送方参与者身份
  62 + * Participan Code
  63 + * [A-Z0-9]{0,17}
  64 + * O (可选节点)
  65 + * DEMO:
  66 + * EC1A2C4CBC3D
  67 + */
  68 + private String ref_participant_code="";
  69 +
  70 + /**
  71 + * NODE:REF
  72 + * Sender Participan Identification
  73 + * 发送方参与者身份
  74 + * Airport/City Code
  75 + * [A-Z]{0,3}
  76 + * O (可选节点)
  77 + * DEMO:
  78 + * CGO OR BJS
  79 + */
  80 + private String ref_participant_airport="";
  81 +
  82 + public String getRef_address() throws FWBException {
  83 + if (!StringUtils.hasText(ref_address)){
  84 + throw new FWBException(FWBExceptionType.REF_ERROR);
  85 + }
  86 + String patternStr = "^[A-Z]{3}[0-9A-Z]{2}[0-9A-Z]{2}$";
  87 + Pattern pattern = Pattern.compile(patternStr);
  88 + Matcher matcher = pattern.matcher(ref_address);
  89 + if (!matcher.find()){
  90 + throw new FWBException(FWBExceptionType.REF_SOMA_REGEX_FAILD);
  91 + }
  92 + return ref_address;
  93 + }
  94 +
  95 + public void setRef_address(String ref_address) {
  96 + this.ref_address = ref_address;
  97 + }
  98 +
  99 + public String getRef_file_reference() {
  100 + String patternStr = "^[A-Z0-9-<=/\\s\\.]{0,15}$";
  101 + Pattern pattern = Pattern.compile(patternStr);
  102 + Matcher matcher = pattern.matcher(ref_file_reference);
  103 + if (!matcher.find()){
  104 + System.out.println("[REF-WARN]-缺少file_reference,或未通过规则校验");
  105 + }
  106 + return ref_file_reference;
  107 + }
  108 +
  109 + public void setRef_file_reference(String ref_file_reference) {
  110 + this.ref_file_reference = ref_file_reference;
  111 + }
  112 +
  113 + public String getRef_participant_id() throws FWBException {
  114 + if (StringUtils.hasText(ref_participant_id) || StringUtils.hasText(ref_participant_code) || StringUtils.hasText(ref_participant_airport)){
  115 + if (!StringUtils.hasText(ref_participant_id) || !StringUtils.hasText(ref_participant_code) || !StringUtils.hasText(ref_participant_airport)){{
  116 + throw new FWBException(FWBExceptionType.REF_SPID_REGEX_FAILD);
  117 + }}
  118 + }
  119 + String patternStr = "^[A-Z0-9]{0,3}$";
  120 + Pattern pattern = Pattern.compile(patternStr);
  121 + Matcher matcher = pattern.matcher(ref_participant_id);
  122 + if (!matcher.find()){
  123 + System.out.println("[REF-WARN]-participant_id 未通过规则校验");
  124 + }
  125 + return ref_participant_id;
  126 + }
  127 +
  128 + public void setRef_participant_id(String ref_participant_id) {
  129 + this.ref_participant_id = ref_participant_id;
  130 + }
  131 +
  132 + public String getRef_participant_code() {
  133 +
  134 + String patternStr = "^[A-Z0-9]{0,17}$";
  135 + Pattern pattern = Pattern.compile(patternStr);
  136 + Matcher matcher = pattern.matcher(ref_participant_code);
  137 + if (!matcher.find()){
  138 + System.out.println("[REF-WARN]-participant_code 未通过规则校验");
  139 + }
  140 +
  141 + return ref_participant_code;
  142 + }
  143 +
  144 + public void setRef_participant_code(String ref_participant_code) {
  145 + this.ref_participant_code = ref_participant_code;
  146 + }
  147 +
  148 + public String getRef_participant_airport() {
  149 +
  150 + String patternStr = "^[A-Z]{0,3}$";
  151 + Pattern pattern = Pattern.compile(patternStr);
  152 + Matcher matcher = pattern.matcher(ref_participant_airport);
  153 + if (!matcher.find()){
  154 + System.out.println("[REF-WARN]- participant_airport 未通过规则校验");
  155 + }
  156 +
  157 + return ref_participant_airport;
  158 + }
  159 +
  160 + public void setRef_participant_airport(String ref_participant_airport) {
  161 + this.ref_participant_airport = ref_participant_airport;
  162 + }
  163 +
  164 + @Override
  165 + public String getFWBNodeText() throws FWBException {
  166 + String SPLIT_CODE = "/";
  167 + String CRLF = "\n";
  168 + StringBuilder sb = new StringBuilder("");
  169 +
  170 + try {
  171 + sb.append(SPLIT_CODE)
  172 + .append(getRef_address());
  173 +
  174 +
  175 +
  176 + if (StringUtils.hasLength(getRef_file_reference())){
  177 + sb.append(SPLIT_CODE)
  178 + .append(getRef_file_reference());
  179 + }else {
  180 + sb.append(SPLIT_CODE);
  181 + }
  182 +
  183 + if (StringUtils.hasLength(getRef_participant_id())
  184 + && StringUtils.hasLength(getRef_participant_code())
  185 + && StringUtils.hasLength(getRef_participant_airport())
  186 + ){
  187 + sb.append(SPLIT_CODE)
  188 + .append(getRef_participant_id());
  189 + sb.append(SPLIT_CODE)
  190 + .append(getRef_participant_code());
  191 + sb.append(SPLIT_CODE)
  192 + .append(getRef_participant_airport());
  193 + }
  194 +
  195 + sb.append(CRLF);
  196 +
  197 + } catch (FWBException e) {
  198 + e.printStackTrace();
  199 + }
  200 +
  201 + return sb.toString();
  202 +
  203 + }
  204 +
  205 + @Override
  206 + public String getNodeName() {
  207 + return "REF";
  208 + }
  209 +}
  1 +package com.sunyo.wlpt.base.model.efreight.fwb;
  2 +/**
  3 + * RTD
  4 + * Rate Description
  5 + * 费率说明
  6 + * M 必填节点
  7 + *
  8 + * DEMO:(括号里面的是可选项)
  9 + * RTD/1/P8/K60/CQ/W94
  10 + * /NG/SHIPMENT AS PER ATTD
  11 + * /2/NC/CONSOL
  12 + * /3/ND//CMT1.63-34-33/8
  13 + * /4/NV/MC0.56
  14 + * CTLF
  15 + */
  16 +public class FWB_RTD {
  17 + /**
  18 + * NODE:P
  19 + * Number of Pieces
  20 + * 件数
  21 + * [0-9]{1,4}
  22 + * M
  23 + * DEMO:
  24 + * 1230
  25 + */
  26 + private String rtd_number_pieces;
  27 +
  28 + /**
  29 + * Rate Combination Point
  30 + * 费率组合点
  31 + * [A-Z]{0,3}
  32 + * O
  33 + * DEMO:
  34 + * ABC
  35 + */
  36 + private String rtd_combination_point;
  37 +
  38 + /**
  39 + * NODE:K/L
  40 + * K/公斤(固体) L/公升(液体)
  41 + * Gross Weight Details
  42 + * 毛重
  43 + * 重量单位
  44 + * [0-9\.]{0,7}
  45 + * O
  46 + * DEMO:
  47 + * K185.07
  48 + */
  49 + private String rtd_gross_weight;
  50 +
  51 + /**
  52 + * NODE:C
  53 + * Rate Class Details
  54 + * 费率类别详情,运费级别
  55 + * [A-Z]{0,1}
  56 + * O
  57 + * DEMO:
  58 + * CQ
  59 + */
  60 + private String rtd_rate_class;
  61 +
  62 + /**
  63 + * NODE:S
  64 + * Commodity Item Number Details
  65 + * 商品编号详细信息
  66 + * Commodity Item Number OR ULD Rate Class Type OR [Rate Class Code(Basis) Class Rate Percentage]
  67 + * [0-9]{0,7} | [0-9][A-Z]{0,2} | [A-Z][0-9]{0,3}
  68 + * O
  69 + * DEMO:
  70 + * S3476 | S9AF | SD345
  71 + */
  72 + private String rtd_commodity_NUM;
  73 +
  74 + /**
  75 + * NODE:W
  76 + * Chargeable Weight Details
  77 + * 计费重量信息
  78 + *
  79 + * [0-9\.]{0,7}
  80 + * O
  81 + * DEMO:
  82 + * W637.09
  83 + */
  84 + private String rtd_charge_weight;
  85 +
  86 + /**
  87 + * NODE:R
  88 + * Rate/Charge Details
  89 + * 率/收费细节,运费信息,如 没公斤的收费费率
  90 + * Rate or Charge Or Discount(折扣)
  91 + * [0-9\.]{0,8}
  92 + * O
  93 + * DEMO:
  94 + * R34.73
  95 + */
  96 + private String rtd_rate_charge;
  97 +
  98 + /**
  99 + * NODE:T
  100 + * Total Details
  101 + * 总计信息
  102 + * 如运费单价(Rate/Charge)x公斤/计费重量(W)的结果值
  103 + * Charge Amount or Discount Amount
  104 + * [0-9\.]{0,8}
  105 + * O
  106 + * DEMO:
  107 + * T2334.73
  108 + */
  109 + private String rtd_rate_total;
  110 +
  111 + /**
  112 + * NODE:NG
  113 + * Goods Description
  114 + * 货物信息描述
  115 + * Nature and Quantity of Goods
  116 + * 实际货物信息/货物的性质和数量
  117 + * [A-Z0-9-<=/\s\.]{0,20}
  118 + * O
  119 + * DEMO:
  120 + * DELL COMPUTER
  121 + */
  122 + private String rtd_goods_DES;
  123 +
  124 + /**
  125 + * NODE:NC
  126 + * Consolidation
  127 + * 集拼集运货物
  128 + * Nature and Quantity of Goods
  129 + * 实际货物信息/货物的性质和数量
  130 + * [A-Z0-9-<=/\s\.]{0,20}
  131 + * O
  132 + * DEMO:
  133 + * COSOLE GOODS
  134 + */
  135 + private String rtd_goods_consol_DES;
  136 +
  137 + /**
  138 + * NODE:ND
  139 + * Dimensions [C]
  140 + * 尺寸信息
  141 + * Weight Code
  142 + * 重量单位
  143 + * [A-Z]{0,1}
  144 + * O
  145 + * DEMO:
  146 + * K
  147 + */
  148 + private String rtd_goods_DIM_weightcode;
  149 +
  150 + /**
  151 + * NODE:ND
  152 + * Dimensions
  153 + * 尺寸信息
  154 + * Weight
  155 + * 重量
  156 + * [0-9\.]{0,7}
  157 + * O
  158 + * DEMO:
  159 + * 21.11
  160 + */
  161 + private String rtd_goods_DIM_weight;
  162 +
  163 + /**
  164 + * NODE:ND
  165 + * Dimensions
  166 + * 尺寸信息
  167 + * Measurement Unit Code
  168 + * 尺寸单位
  169 + * [A-Z]{0,3}
  170 + * O
  171 + * DEMO:
  172 + * CBM OR NDA(没有尺寸信息)
  173 + */
  174 + private String rtd_measurement_code;
  175 +
  176 + /**
  177 + * Parent NODE:ND
  178 + * Dimensions
  179 + * 尺寸信息
  180 + * Measurement info
  181 + * 尺寸具体信息,这个节点比较麻烦在前端交互以及长宽高的识别及处理,多个体积信息可重复节点标识
  182 + * [0-9]{0,5}x[0-9]{0,5}x[0-9]{0,5}/[0-9]{0,4} | [0-9]{0,5}-[0-9]{0,5}-[0-9]{0,5}/[0-9]{0,4}
  183 + * 长-宽-高/件数
  184 + * O
  185 + * DEMO:
  186 + * 100-100-50/4
  187 + */
  188 + private String rtd_measurement_info;
  189 +
  190 + /**
  191 + * Parent NODE:NV
  192 + * VOLUME
  193 + * 体积
  194 + * Valume Code
  195 + * 体积代码
  196 + * [A-Z]{2}
  197 + * MC 平方米
  198 + * O
  199 + * DEMO:
  200 + * MC
  201 + */
  202 + private String rtd_volume_code;
  203 +
  204 + /**
  205 + * Parent NODE:NV
  206 + * VOLUME
  207 + * 体积
  208 + * Valume Amount
  209 + * 体积
  210 + * [0-9\.]{0,9}
  211 + *
  212 + * O
  213 + * DEMO:
  214 + * 12.31
  215 + */
  216 + private String rtd_volume;
  217 +
  218 + //todo: 还有NU,NS,NH,NO等信息后面完善
  219 +}
  1 +package com.sunyo.wlpt.base.model.efreight.fwb;
  2 +
  3 +/**
  4 + * Flight Bookings
  5 + * Routing
  6 + * RTG
  7 + * 运单航程目的地承运人
  8 + */
  9 +public class FWB_RTG {
  10 + /**
  11 + * 首程目的站
  12 + * [A-Z]{3}
  13 + * 可选节点
  14 + */
  15 + private String destinationAirport;
  16 + /**
  17 + * 首程目的站对应承运人
  18 + * [A-Z0-9]{2}
  19 + */
  20 + private String destinationCarrier;
  21 + /**
  22 + * 下一航程起始航站
  23 + * 可选节点
  24 + * 下一航程节点最多可重复两次,结合首程一共三个航程
  25 + */
  26 + private String onwardAirport;
  27 + /**
  28 + * 下一航程起始航站承运人
  29 + */
  30 + private String onwardCarrier;
  31 +}
  1 +package com.sunyo.wlpt.base.model.efreight.fwb;
  2 +
  3 +/**
  4 + * 主单发货人
  5 + * mandatory (must be included); M
  6 + */
  7 +public class FWB_SHP {
  8 +
  9 + /**
  10 + * 发货人账号信息
  11 + * [A-Z0-9-<=/\s\.]{0,14}
  12 + * 禁止 [^A-Z0-9-.<=\s\/]
  13 + */
  14 + private String shp_account_number;
  15 + /**
  16 + * 发货人名称
  17 + * [A-Z0-9-<=/\s\.]{1,35}
  18 + * 名称信息可最多重复2次
  19 + */
  20 + private String shp_name;
  21 + /**
  22 + * 发货人地址
  23 + * [A-Z0-9-<=/\s\.]{1,35}
  24 + */
  25 + private String shp_adr;
  26 + /**
  27 + * 发货人城市
  28 + * [A-Z0-9-<=/\s\.]{1,17}
  29 + */
  30 + private String shp_loc_place;
  31 + /**
  32 + * 发货人省
  33 + * [A-Z0-9-<=/\s\.]{0,9}
  34 + */
  35 + private String shp_loc_province;
  36 + /**
  37 + * 发货人国家
  38 + * [A-Z]{2}
  39 + */
  40 + private String shp_country;
  41 + /**
  42 + * 发货人邮编
  43 + * [A-Z0-9-<=/\s\.]{0,9}
  44 + */
  45 + private String shp_postcode;
  46 + /**
  47 + * 发货人联系方式类别
  48 + * FX|TE|TL
  49 + * 传真|电话|电传(电报)
  50 + * 可重复未标识重复次数
  51 + */
  52 + private String shp_contact_id;
  53 + /**
  54 + * 发货人联系方式具体信息(号码)
  55 + * [A-Z0-9]{1,25}
  56 + */
  57 + private String shp_contact_number;
  58 +
  59 +
  60 +}
  61 +
  1 +package com.sunyo.wlpt.base.model.efreight.fwb;
  2 +
  3 +
  4 +/**
  5 + * SPH
  6 + * Special Handing Details
  7 + * 特殊操作信息
  8 + * O 可选节点
  9 + * 可最多出现9次
  10 + * DEMO:(括号里面的是可选项)
  11 + * SPH/ECC/ELI
  12 + * CRLF
  13 + */
  14 +public class FWB_SPH {
  15 +
  16 + /**
  17 + * NODE:SPH
  18 + * Special Handing Requirements
  19 + * 特殊处理要求
  20 + * Special Handing Code
  21 + * [A-Z]{0,3}
  22 + * M (必填节点,主节点存在的情况下)
  23 + * DEMO:
  24 + * /ELI
  25 + */
  26 + private String sph_code;
  27 +}
  1 +package com.sunyo.wlpt.base.model.efreight.fwb;
  2 +
  3 +/**
  4 + * SSR
  5 + * special service request
  6 + * 特殊服务请求
  7 + * optional (may be included) 可选(有可能包含)
  8 + * 请求最多可重复3次
  9 + * DEMO:
  10 + * /SSR/RQUEST TXT/REQUST TXT/REQUEST TXT
  11 + */
  12 +public class FWB_SSR {
  13 + /**
  14 + * 特殊服务请求内容
  15 + * [A-Z0-9-<=/\s\.]{0,65}
  16 + */
  17 + private String ssr_request_content;
  18 +}
  1 +package com.sunyo.wlpt.base.model.efreight.fwb.exception;
  2 +
  3 +public class FWBException extends Exception {
  4 +
  5 + private static final long serialVersionUID = 6098063244016154220L;
  6 +
  7 + /**
  8 + * 异常错误编码
  9 + */
  10 + private String code;
  11 +
  12 + /**
  13 + * 异常信息
  14 + */
  15 + private String message;
  16 +
  17 + public FWBException(FWBExceptionType exceptionTypeEnum, String message) {
  18 + this.code = exceptionTypeEnum.getCode();
  19 + this.message = message;
  20 + }
  21 +
  22 + public FWBException(FWBExceptionType exceptionTypeEnum) {
  23 + this.code = exceptionTypeEnum.getCode();
  24 + this.message = exceptionTypeEnum.getMsg();
  25 + }
  26 +
  27 + public String getCode() {
  28 + return code;
  29 + }
  30 +
  31 + @Override
  32 + public String getMessage() {
  33 + return message;
  34 + }
  35 +}
  1 +package com.sunyo.wlpt.base.model.efreight.fwb.exception;
  2 +
  3 +/**
  4 + * @author 子诚
  5 + * Description:枚举,定制异常类型
  6 + * 时间:2020/7/17 16:27
  7 + */
  8 +
  9 +public enum FWBExceptionType {
  10 + REF_ERROR("203", "缺少 REF Sender Reference - Sender Office Message Address"),
  11 + REF_SOMA_REGEX_FAILD("2031", "REF- Sender Office Message Address RegEx Faild"),
  12 + REF_SPID_REGEX_FAILD("206", "REF- Sender Participant Idenfitication RegEx Faild,缺少关联节点信息"),
  13 +
  14 + OCI_CSRC_ERROR("297", "缺少 Other Customs,Security And Regulatory Control Information Identifier");
  15 +
  16 + /**
  17 + * 响应业务状态
  18 + */
  19 + private String code;
  20 + /**
  21 + * 响应消息
  22 + */
  23 + private String msg;
  24 +
  25 + FWBExceptionType(String code, String msg)
  26 + {
  27 + this.code = code;
  28 + this.msg = msg;
  29 + }
  30 +
  31 + public String getCode()
  32 + {
  33 + return code;
  34 + }
  35 +
  36 + public String getMsg()
  37 + {
  38 + return msg;
  39 + }
  40 +
  41 +}
  1 +import com.sunyo.wlpt.base.model.efreight.fwb.FWB_OCI;
  2 +import com.sunyo.wlpt.base.model.efreight.fwb.FWB_REF;
  3 +import com.sunyo.wlpt.base.model.efreight.fwb.exception.FWBException;
  4 +
  5 +public class FWBTest {
  6 +
  7 + public static void main(String[] args) {
  8 +
  9 + REF_TEST();
  10 +
  11 +// OCI_TEST();
  12 +
  13 +
  14 + }
  15 +
  16 + static void OCI_TEST(){
  17 + FWB_OCI fwb_oci = new FWB_OCI();
  18 + fwb_oci.setOci_csrc_id("T");
  19 + fwb_oci.setOci_csrc_info("USCI91440101MA9Y9E79XG");
  20 + fwb_oci.setOci_country_code("CN");
  21 + fwb_oci.setOci_information_id("SHP");
  22 + try {
  23 + String oci = fwb_oci.getFWBNodeText();
  24 + System.out.println(oci);
  25 + } catch (FWBException e) {
  26 + e.printStackTrace();
  27 + }
  28 + }
  29 +
  30 + static void REF_TEST(){
  31 + FWB_REF fwb_ref = new FWB_REF();
  32 + fwb_ref.setRef_address("CGOFDIE");
  33 + fwb_ref.setRef_file_reference("EC1A2C4CBC3D1");
  34 + fwb_ref.setRef_participant_id("AGT");
  35 + fwb_ref.setRef_participant_code("MECCGO01");
  36 + fwb_ref.setRef_participant_airport("CGO");
  37 +
  38 + try {
  39 + String oci = fwb_ref.getFWBNodeText();
  40 + System.out.println(oci);
  41 + } catch (FWBException e) {
  42 + e.printStackTrace();
  43 + }
  44 + }
  45 +}