正在显示
6 个修改的文件
包含
296 行增加
和
451 行删除
| @@ -2,6 +2,11 @@ package com.sunyo.wlpt.base.model.efreight.fwb; | @@ -2,6 +2,11 @@ package com.sunyo.wlpt.base.model.efreight.fwb; | ||
| 2 | 2 | ||
| 3 | import com.sunyo.wlpt.base.model.efreight.BASE; | 3 | import com.sunyo.wlpt.base.model.efreight.BASE; |
| 4 | import com.sunyo.wlpt.base.model.efreight.fwb.exception.FWBException; | 4 | import com.sunyo.wlpt.base.model.efreight.fwb.exception.FWBException; |
| 5 | +import com.sunyo.wlpt.base.model.efreight.fwb.exception.FWBExceptionType; | ||
| 6 | + | ||
| 7 | +import java.util.List; | ||
| 8 | +import java.util.regex.Matcher; | ||
| 9 | +import java.util.regex.Pattern; | ||
| 5 | 10 | ||
| 6 | /** | 11 | /** |
| 7 | * RTD | 12 | * RTD |
| @@ -138,58 +143,7 @@ public class FWB_RTD extends BASE implements FWB_BASE{ | @@ -138,58 +143,7 @@ public class FWB_RTD extends BASE implements FWB_BASE{ | ||
| 138 | */ | 143 | */ |
| 139 | private String rtd_goods_consol_DES; | 144 | private String rtd_goods_consol_DES; |
| 140 | 145 | ||
| 141 | - /** | ||
| 142 | - * NODE:ND | ||
| 143 | - * Dimensions [C] | ||
| 144 | - * 尺寸信息 | ||
| 145 | - * Weight Code | ||
| 146 | - * 重量单位 | ||
| 147 | - * [A-Z]{0,1} | ||
| 148 | - * O | ||
| 149 | - * DEMO: | ||
| 150 | - * K | ||
| 151 | - */ | ||
| 152 | - private String rtd_goods_DIM_weightcode; | ||
| 153 | - | ||
| 154 | - /** | ||
| 155 | - * NODE:ND | ||
| 156 | - * Dimensions | ||
| 157 | - * 尺寸信息 | ||
| 158 | - * Weight | ||
| 159 | - * 重量 | ||
| 160 | - * [0-9\.]{0,7} | ||
| 161 | - * O | ||
| 162 | - * DEMO: | ||
| 163 | - * 21.11 | ||
| 164 | - */ | ||
| 165 | - private String rtd_goods_DIM_weight; | ||
| 166 | - | ||
| 167 | - /** | ||
| 168 | - * NODE:ND | ||
| 169 | - * Dimensions | ||
| 170 | - * 尺寸信息 | ||
| 171 | - * Measurement Unit Code | ||
| 172 | - * 尺寸单位 | ||
| 173 | - * [A-Z]{0,3} | ||
| 174 | - * O | ||
| 175 | - * DEMO: | ||
| 176 | - * CBM OR NDA(没有尺寸信息) | ||
| 177 | - */ | ||
| 178 | - private String rtd_measurement_code; | ||
| 179 | - | ||
| 180 | - /** | ||
| 181 | - * Parent NODE:ND | ||
| 182 | - * Dimensions | ||
| 183 | - * 尺寸信息 | ||
| 184 | - * Measurement info | ||
| 185 | - * 尺寸具体信息,这个节点比较麻烦在前端交互以及长宽高的识别及处理,多个体积信息可重复节点标识 | ||
| 186 | - * [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} | ||
| 187 | - * 长-宽-高/件数 | ||
| 188 | - * O | ||
| 189 | - * DEMO: | ||
| 190 | - * 100-100-50/4 | ||
| 191 | - */ | ||
| 192 | - private String rtd_measurement_info; | 146 | + private List<FWB_RTD_Dimension> dimensions; |
| 193 | 147 | ||
| 194 | /** | 148 | /** |
| 195 | * Parent NODE:NV | 149 | * Parent NODE:NV |
| @@ -299,36 +253,12 @@ public class FWB_RTD extends BASE implements FWB_BASE{ | @@ -299,36 +253,12 @@ public class FWB_RTD extends BASE implements FWB_BASE{ | ||
| 299 | this.rtd_goods_consol_DES = rtd_goods_consol_DES; | 253 | this.rtd_goods_consol_DES = rtd_goods_consol_DES; |
| 300 | } | 254 | } |
| 301 | 255 | ||
| 302 | - public String getRtd_goods_DIM_weightcode() { | ||
| 303 | - return rtd_goods_DIM_weightcode; | ||
| 304 | - } | ||
| 305 | - | ||
| 306 | - public void setRtd_goods_DIM_weightcode(String rtd_goods_DIM_weightcode) { | ||
| 307 | - this.rtd_goods_DIM_weightcode = rtd_goods_DIM_weightcode; | ||
| 308 | - } | ||
| 309 | - | ||
| 310 | - public String getRtd_goods_DIM_weight() { | ||
| 311 | - return rtd_goods_DIM_weight; | ||
| 312 | - } | ||
| 313 | - | ||
| 314 | - public void setRtd_goods_DIM_weight(String rtd_goods_DIM_weight) { | ||
| 315 | - this.rtd_goods_DIM_weight = rtd_goods_DIM_weight; | ||
| 316 | - } | ||
| 317 | - | ||
| 318 | - public String getRtd_measurement_code() { | ||
| 319 | - return rtd_measurement_code; | ||
| 320 | - } | ||
| 321 | - | ||
| 322 | - public void setRtd_measurement_code(String rtd_measurement_code) { | ||
| 323 | - this.rtd_measurement_code = rtd_measurement_code; | ||
| 324 | - } | ||
| 325 | - | ||
| 326 | - public String getRtd_measurement_info() { | ||
| 327 | - return rtd_measurement_info; | 256 | + public List<FWB_RTD_Dimension> getDimensions() { |
| 257 | + return dimensions; | ||
| 328 | } | 258 | } |
| 329 | 259 | ||
| 330 | - public void setRtd_measurement_info(String rtd_measurement_info) { | ||
| 331 | - this.rtd_measurement_info = rtd_measurement_info; | 260 | + public void setDimensions(List<FWB_RTD_Dimension> dimensions) { |
| 261 | + this.dimensions = dimensions; | ||
| 332 | } | 262 | } |
| 333 | 263 | ||
| 334 | public String getRtd_volume_code() { | 264 | public String getRtd_volume_code() { |
| @@ -404,15 +334,19 @@ public class FWB_RTD extends BASE implements FWB_BASE{ | @@ -404,15 +334,19 @@ public class FWB_RTD extends BASE implements FWB_BASE{ | ||
| 404 | sb.append(CRLF); | 334 | sb.append(CRLF); |
| 405 | } | 335 | } |
| 406 | 336 | ||
| 407 | - if (hasText(getRtd_measurement_info())){ | ||
| 408 | - sb.append(SPLIT_CODE).append(lineNumber++).append(SPLIT_CODE).append("ND"); | ||
| 409 | - sb.append(SPLIT_CODE); | ||
| 410 | - if (hasText(rtd_goods_DIM_weight)){ | ||
| 411 | - sb.append(getRtd_goods_DIM_weightcode()).append(getRtd_goods_DIM_weight()); | 337 | + if (!dimensions.isEmpty()){ |
| 338 | + for (FWB_RTD_Dimension item : dimensions) { | ||
| 339 | + sb.append(SPLIT_CODE).append(lineNumber++).append(SPLIT_CODE).append("ND"); | ||
| 340 | + sb.append(SPLIT_CODE); | ||
| 341 | + if (hasText(item.getDim_weight())){ | ||
| 342 | + sb.append(item.getDim_weightcode()).append(item.getDim_weight()); | ||
| 343 | + } | ||
| 344 | + sb.append(SPLIT_CODE); | ||
| 345 | + | ||
| 346 | + sb.append(item.getDim_measurement_code()).append(item.getDim_measurement_info()); | ||
| 347 | + sb.append(CRLF); | ||
| 412 | } | 348 | } |
| 413 | - sb.append(SPLIT_CODE); | ||
| 414 | - sb.append(getRtd_measurement_code()).append(getRtd_measurement_info()); | ||
| 415 | - sb.append(CRLF); | 349 | + |
| 416 | } | 350 | } |
| 417 | 351 | ||
| 418 | sb.append(SPLIT_CODE).append(lineNumber++).append(SPLIT_CODE).append("NV").append(SPLIT_CODE) | 352 | sb.append(SPLIT_CODE).append(lineNumber++).append(SPLIT_CODE).append("NV").append(SPLIT_CODE) |
| @@ -429,3 +363,4 @@ public class FWB_RTD extends BASE implements FWB_BASE{ | @@ -429,3 +363,4 @@ public class FWB_RTD extends BASE implements FWB_BASE{ | ||
| 429 | return "RTD"; | 363 | return "RTD"; |
| 430 | } | 364 | } |
| 431 | } | 365 | } |
| 366 | + |
| 1 | +package com.sunyo.wlpt.base.model.efreight.fwb; | ||
| 2 | + | ||
| 3 | +import com.sunyo.wlpt.base.model.efreight.BASE; | ||
| 4 | +import com.sunyo.wlpt.base.model.efreight.fwb.exception.FWBException; | ||
| 5 | +import com.sunyo.wlpt.base.model.efreight.fwb.exception.FWBExceptionType; | ||
| 6 | + | ||
| 7 | +import java.util.regex.Matcher; | ||
| 8 | +import java.util.regex.Pattern; | ||
| 9 | + | ||
| 10 | +public class FWB_RTD_Dimension extends BASE { | ||
| 11 | + /** | ||
| 12 | + * NODE:ND | ||
| 13 | + * Dimensions [C] | ||
| 14 | + * 尺寸信息 | ||
| 15 | + * Weight Code | ||
| 16 | + * 重量单位 | ||
| 17 | + * K|L | ||
| 18 | + * O | ||
| 19 | + * DEMO: | ||
| 20 | + * K|L | ||
| 21 | + */ | ||
| 22 | + private String dim_weightcode="K"; | ||
| 23 | + | ||
| 24 | + /** | ||
| 25 | + * NODE:ND | ||
| 26 | + * Dimensions | ||
| 27 | + * 尺寸信息 | ||
| 28 | + * Weight | ||
| 29 | + * 重量 | ||
| 30 | + * [0-9\.]{0,7} | ||
| 31 | + * O | ||
| 32 | + * DEMO: | ||
| 33 | + * 21.11 | ||
| 34 | + */ | ||
| 35 | + private String dim_weight=""; | ||
| 36 | + | ||
| 37 | + /** | ||
| 38 | + * NODE:ND | ||
| 39 | + * Dimensions | ||
| 40 | + * 尺寸信息 | ||
| 41 | + * Measurement Unit Code | ||
| 42 | + * 尺寸单位 | ||
| 43 | + * [A-Z]{0,3} | ||
| 44 | + * O | ||
| 45 | + * DEMO: | ||
| 46 | + * CMT OR NDA(没有尺寸信息) | ||
| 47 | + */ | ||
| 48 | + private String dim_measurement_code="CMT"; | ||
| 49 | + | ||
| 50 | + /** | ||
| 51 | + * Parent NODE:ND | ||
| 52 | + * Dimensions | ||
| 53 | + * 尺寸信息 | ||
| 54 | + * Measurement info | ||
| 55 | + * 尺寸具体信息,这个节点比较麻烦在前端交互以及长宽高的识别及处理,多个体积信息可重复节点标识 | ||
| 56 | + * [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} | ||
| 57 | + * 长-宽-高/件数 | ||
| 58 | + * O | ||
| 59 | + * Repeat times N次 | ||
| 60 | + * DEMO: | ||
| 61 | + * 100-100-50/4 | ||
| 62 | + */ | ||
| 63 | + private String dim_measurement_info=""; | ||
| 64 | + | ||
| 65 | + public FWB_RTD_Dimension(String dim_measurement_info) { | ||
| 66 | + this.dim_measurement_info = dim_measurement_info; | ||
| 67 | + } | ||
| 68 | + | ||
| 69 | + public FWB_RTD_Dimension(String dim_weight, String dim_measurement_info) { | ||
| 70 | + this.dim_weight = dim_weight; | ||
| 71 | + this.dim_measurement_info = dim_measurement_info; | ||
| 72 | + } | ||
| 73 | + | ||
| 74 | + public FWB_RTD_Dimension(String dim_weightcode, String dim_weight, String dim_measurement_code, String dim_measurement_info) { | ||
| 75 | + this.dim_weightcode = dim_weightcode; | ||
| 76 | + this.dim_weight = dim_weight; | ||
| 77 | + this.dim_measurement_code = dim_measurement_code; | ||
| 78 | + this.dim_measurement_info = dim_measurement_info; | ||
| 79 | + } | ||
| 80 | + | ||
| 81 | + public String getDim_weightcode() throws FWBException { | ||
| 82 | + | ||
| 83 | + if (hasText(dim_weight)){ | ||
| 84 | + String patternStr = "^K|L$"; | ||
| 85 | + Pattern pattern = Pattern.compile(patternStr); | ||
| 86 | + Matcher matcher = pattern.matcher(dim_weightcode); | ||
| 87 | + if (!matcher.find()){ | ||
| 88 | + throw new FWBException(FWBExceptionType.RTD_DIM_WEIGHT_CODE_ERROR,dim_weightcode); | ||
| 89 | + } | ||
| 90 | + } | ||
| 91 | + | ||
| 92 | + return dim_weightcode; | ||
| 93 | + } | ||
| 94 | + | ||
| 95 | + public void setDim_weightcode(String dim_weightcode) { | ||
| 96 | + this.dim_weightcode = dim_weightcode; | ||
| 97 | + } | ||
| 98 | + | ||
| 99 | + public String getDim_weight() throws FWBException { | ||
| 100 | + if (hasText(dim_weight)){ | ||
| 101 | + String patternStr = "^[0-9\\.]{1,7}$"; | ||
| 102 | + Pattern pattern = Pattern.compile(patternStr); | ||
| 103 | + Matcher matcher = pattern.matcher(dim_weight); | ||
| 104 | + if (!matcher.find()){ | ||
| 105 | + throw new FWBException(FWBExceptionType.RTD_DIM_WEIGHT_VAL_ERROR,dim_weight); | ||
| 106 | + } | ||
| 107 | + } | ||
| 108 | + return dim_weight; | ||
| 109 | + } | ||
| 110 | + | ||
| 111 | + public void setDim_weight(String dim_weight) { | ||
| 112 | + this.dim_weight = dim_weight; | ||
| 113 | + } | ||
| 114 | + | ||
| 115 | + public String getDim_measurement_code() throws FWBException { | ||
| 116 | + if (hasText(dim_measurement_info)){ | ||
| 117 | + String patternStr = "^[A-Z]{3}$"; | ||
| 118 | + Pattern pattern = Pattern.compile(patternStr); | ||
| 119 | + Matcher matcher = pattern.matcher(dim_measurement_code); | ||
| 120 | + if (!matcher.find()){ | ||
| 121 | + throw new FWBException(FWBExceptionType.RTD_MEASUREMENT_CODE_ERROR); | ||
| 122 | + } | ||
| 123 | + } | ||
| 124 | + return dim_measurement_code; | ||
| 125 | + } | ||
| 126 | + | ||
| 127 | + public void setDim_measurement_code(String dim_measurement_code) { | ||
| 128 | + this.dim_measurement_code = dim_measurement_code; | ||
| 129 | + } | ||
| 130 | + | ||
| 131 | + public String getDim_measurement_info() throws FWBException { | ||
| 132 | + if (hasText(dim_measurement_info) ){ | ||
| 133 | + String patternStr = "^\\d{1,5}\\-\\d{1,5}\\-\\d{1,5}/\\d{1,4}$"; | ||
| 134 | + Pattern pattern = Pattern.compile(patternStr); | ||
| 135 | + | ||
| 136 | + Matcher matcher = pattern.matcher(dim_measurement_info); | ||
| 137 | + if (!matcher.find()){ | ||
| 138 | + throw new FWBException(FWBExceptionType.RTD_DIMENSION_INFO_ERROR,dim_measurement_info); | ||
| 139 | + } | ||
| 140 | + | ||
| 141 | + | ||
| 142 | + } | ||
| 143 | + return dim_measurement_info; | ||
| 144 | + } | ||
| 145 | + | ||
| 146 | + public void setDim_measurement_info(String dim_measurement_info) { | ||
| 147 | + this.dim_measurement_info = dim_measurement_info; | ||
| 148 | + } | ||
| 149 | + | ||
| 150 | +} |
| @@ -16,7 +16,7 @@ public class FWBException extends Exception { | @@ -16,7 +16,7 @@ public class FWBException extends Exception { | ||
| 16 | 16 | ||
| 17 | public FWBException(FWBExceptionType exceptionTypeEnum, String message) { | 17 | public FWBException(FWBExceptionType exceptionTypeEnum, String message) { |
| 18 | this.code = exceptionTypeEnum.getCode(); | 18 | this.code = exceptionTypeEnum.getCode(); |
| 19 | - this.message = message; | 19 | + this.message = exceptionTypeEnum.getMsg() + "-[ERROR-VALUE]-" + message; |
| 20 | } | 20 | } |
| 21 | 21 | ||
| 22 | public FWBException(FWBExceptionType exceptionTypeEnum) { | 22 | public FWBException(FWBExceptionType exceptionTypeEnum) { |
| @@ -72,7 +72,7 @@ public enum FWBExceptionType { | @@ -72,7 +72,7 @@ public enum FWBExceptionType { | ||
| 72 | FWB_NFY_CN_ERR("974"," 被通知人联系方式信息格式有误"), | 72 | FWB_NFY_CN_ERR("974"," 被通知人联系方式信息格式有误"), |
| 73 | 73 | ||
| 74 | FWB_ACC_ID_ERR ("1022","ACC财务信息ID格式有误"), | 74 | FWB_ACC_ID_ERR ("1022","ACC财务信息ID格式有误"), |
| 75 | - FWB_ACC_INFO_ERR("1024","ACC财务信息内容格式有误"), | 75 | + FWB_ACC_INFO_ERR("1024","ACC财务信息内容格式有误,^[A-Z0-9-<=/\\s\\.]{1,34}$"), |
| 76 | 76 | ||
| 77 | FWB_CVD_CUR_ERR("1130","CVD收费声明货币单位格式有误"), | 77 | FWB_CVD_CUR_ERR("1130","CVD收费声明货币单位格式有误"), |
| 78 | FWB_CVD_CC_ERR("1150","CVD收费代码格式有误"), | 78 | FWB_CVD_CC_ERR("1150","CVD收费代码格式有误"), |
| @@ -81,6 +81,10 @@ public enum FWBExceptionType { | @@ -81,6 +81,10 @@ public enum FWBExceptionType { | ||
| 81 | FWB_CVD_DVC_ERR("11101","海关声明价值格式有误"), | 81 | FWB_CVD_DVC_ERR("11101","海关声明价值格式有误"), |
| 82 | FWB_CVD_VID_ERR("11112","保险声明价值格式有误"), | 82 | FWB_CVD_VID_ERR("11112","保险声明价值格式有误"), |
| 83 | 83 | ||
| 84 | + RTD_DIM_WEIGHT_CODE_ERROR("12135","RTD-DIM重量代码有误,K|L"), | ||
| 85 | + RTD_DIM_WEIGHT_VAL_ERROR("12136","RTD-DIM重量信息有误,[0-9\\.]{1,7}"), | ||
| 86 | + RTD_MEASUREMENT_CODE_ERROR("12138","RTD尺寸代码有误,[A-Z]{3}"), | ||
| 87 | + RTD_DIMENSION_INFO_ERROR("12139","RTD尺寸信息有误,长-宽-高/件数,^\\d{1,5}\\-\\d{1,5}\\-\\d{1,5}/\\d{1,4}$"), | ||
| 84 | 88 | ||
| 85 | OTH_CHARGES_ERROR("1322", "其他费用信息格式有误"), | 89 | OTH_CHARGES_ERROR("1322", "其他费用信息格式有误"), |
| 86 | OTH_CHARGE_CODE_ERROR("1331", "其他费用代码信息格式有误"), | 90 | OTH_CHARGE_CODE_ERROR("1331", "其他费用代码信息格式有误"), |
| @@ -95,14 +99,15 @@ public enum FWBExceptionType { | @@ -95,14 +99,15 @@ public enum FWBExceptionType { | ||
| 95 | 99 | ||
| 96 | OSI_TEXT_ERROR("1830", "其他服务信息格式有误"), | 100 | OSI_TEXT_ERROR("1830", "其他服务信息格式有误"), |
| 97 | 101 | ||
| 98 | - REF_ERROR("203", "缺少 REF Sender Reference - Sender Office Message Address"), | 102 | + REF_ERROR("2030", "缺少 REF Sender Reference - Sender Office Message Address"), |
| 99 | REF_SOMA_REGEX_FAILD("2031", "REF- Sender Office Message Address RegEx Faild"), | 103 | REF_SOMA_REGEX_FAILD("2031", "REF- Sender Office Message Address RegEx Faild"), |
| 100 | - REF_SPID_REGEX_FAILD("206", "REF- Sender Participant Idenfitication RegEx Faild,缺少关联节点信息"), | 104 | + REF_SPID_REGEX_FAILD("2060", "REF- Sender Participant Idenfitication RegEx Faild,缺少关联节点信息"), |
| 101 | 105 | ||
| 102 | SPH_LENGTH_FAILD("2520", "SPH-最多只支持9个操作代码信息"), | 106 | SPH_LENGTH_FAILD("2520", "SPH-最多只支持9个操作代码信息"), |
| 103 | SPH_CODE_FAILD("2522", "SPH-代码格式信息有误"), | 107 | SPH_CODE_FAILD("2522", "SPH-代码格式信息有误"), |
| 104 | 108 | ||
| 105 | - OCI_CSRC_ERROR("297", "缺少 Other Customs,Security And Regulatory Control Information Identifier"); | 109 | + |
| 110 | + OCI_CSRC_ERROR("2970", "缺少 Other Customs,Security And Regulatory Control Information Identifier"); | ||
| 106 | 111 | ||
| 107 | /** | 112 | /** |
| 108 | * 参照字典FWB节点位置 | 113 | * 参照字典FWB节点位置 |
src/test/java/FWB_804_31118150.java
已删除
100644 → 0
| 1 | - | ||
| 2 | -import com.sunyo.wlpt.base.model.efreight.fwb.*; | ||
| 3 | -import com.sunyo.wlpt.base.model.efreight.fwb.exception.FWBException; | ||
| 4 | - | ||
| 5 | -public class FWB_804_31118150 { | ||
| 6 | - public static void main(String[] args) { | ||
| 7 | - | ||
| 8 | - | ||
| 9 | - System.out.println( | ||
| 10 | - FWB_WAYBILL_TEST() | ||
| 11 | - + FWB_FLT_TEST() | ||
| 12 | - + FWB_RTG_TEST() | ||
| 13 | - + FWB_SHP_TEST() | ||
| 14 | - + FWB_CNE_TEST() | ||
| 15 | - + FWB_AGT_TEST() | ||
| 16 | - + FWB_SSR_TEST() | ||
| 17 | - + FWB_NFY_TEST() | ||
| 18 | - + FWB_ACC_TEST() | ||
| 19 | - + FWB_CVD_TEST() | ||
| 20 | - + FWB_RTD_TEST() | ||
| 21 | - + FWB_CER_TEST() | ||
| 22 | - + FWB_ISU_TEST() | ||
| 23 | - + FWB_OSI_TEST() | ||
| 24 | - + REF_TEST() | ||
| 25 | - + OCI_TEST() | ||
| 26 | - ); | ||
| 27 | -// REF_TEST(); | ||
| 28 | - | ||
| 29 | -// OCI_TEST(); | ||
| 30 | - | ||
| 31 | - | ||
| 32 | - } | ||
| 33 | - | ||
| 34 | - static String FWB_WAYBILL_TEST(){ | ||
| 35 | - FWB fwb = new FWB(); | ||
| 36 | - fwb.setWaybillNum("804-31118150"); | ||
| 37 | - fwb.setOrigin("CGO"); | ||
| 38 | - fwb.setDestination("ICN"); | ||
| 39 | - fwb.setQuantity_picecs("22"); | ||
| 40 | - fwb.setQuantity_weight("330"); | ||
| 41 | - fwb.setQuantity_weight_code("K"); | ||
| 42 | - fwb.setQuantity_volume("1.47"); | ||
| 43 | - fwb.setQuantity_volume_code("MC"); | ||
| 44 | -// fwb.setQuantity_density("22"); | ||
| 45 | - try { | ||
| 46 | - fwb.getWaybillNum(); | ||
| 47 | - String nodeText = fwb.getNodeName() + fwb.getFWBNodeText(); | ||
| 48 | -// System.out.println(nodeText); | ||
| 49 | - return nodeText; | ||
| 50 | - } catch (FWBException e) { | ||
| 51 | - e.printStackTrace(); | ||
| 52 | - } | ||
| 53 | - return ""; | ||
| 54 | - } | ||
| 55 | - | ||
| 56 | - static String FWB_FLT_TEST(){ | ||
| 57 | - FWB_FLT flt = new FWB_FLT(); | ||
| 58 | - flt.setCariier("CF"); | ||
| 59 | - flt.setFlightNumber("221"); | ||
| 60 | - flt.setDay("08"); | ||
| 61 | - | ||
| 62 | - try { | ||
| 63 | - String nodeText = flt.getNodeName() + flt.getFWBNodeText() + "\n"; | ||
| 64 | - return nodeText; | ||
| 65 | - } catch (FWBException e) { | ||
| 66 | - e.printStackTrace(); | ||
| 67 | - } | ||
| 68 | - return ""; | ||
| 69 | - } | ||
| 70 | - | ||
| 71 | - static String FWB_RTG_TEST(){ | ||
| 72 | - FWB_RTG var = new FWB_RTG(); | ||
| 73 | - var.setDestinationAirport("ICN"); | ||
| 74 | - var.setDestinationCarrier("CF"); | ||
| 75 | -// var.setOnwardAirport("SIN"); | ||
| 76 | -// var.setOnwardCarrier("K9"); | ||
| 77 | - | ||
| 78 | - try { | ||
| 79 | - String nodeText = var.getNodeName() + var.getFWBNodeText() + "\n"; | ||
| 80 | -// System.out.println(FWB_WAYBILL_TEST()+nodeText); | ||
| 81 | - return nodeText; | ||
| 82 | - } catch (FWBException e) { | ||
| 83 | - e.printStackTrace(); | ||
| 84 | - } | ||
| 85 | - return ""; | ||
| 86 | - } | ||
| 87 | - | ||
| 88 | - static String FWB_SHP_TEST(){ | ||
| 89 | - FWB_SHP var = new FWB_SHP(); | ||
| 90 | - var.setShp_name("KERRY EAS LOGISTICS LIMITED HENAN"); | ||
| 91 | -// var.setShp_account_number("ABC"); | ||
| 92 | - var.setShp_adr("KERRY LOGISTICS PARK 500M TO XINAN"); | ||
| 93 | - var.setShp_loc_place("ZHENGZHOU"); | ||
| 94 | -// var.setShp_loc_province("HENAN"); | ||
| 95 | - var.setShp_country("CN"); | ||
| 96 | - var.setShp_postcode("450000"); | ||
| 97 | - var.setShp_contact_id("TE"); | ||
| 98 | - var.setShp_contact_number("8637155528940"); | ||
| 99 | - | ||
| 100 | - | ||
| 101 | - try { | ||
| 102 | - String nodeText = var.getNodeName() + var.getFWBNodeText(); | ||
| 103 | - return nodeText; | ||
| 104 | - } catch (FWBException e) { | ||
| 105 | - e.printStackTrace(); | ||
| 106 | - } | ||
| 107 | - return ""; | ||
| 108 | - } | ||
| 109 | - | ||
| 110 | - static String FWB_CNE_TEST(){ | ||
| 111 | - FWB_CNE var = new FWB_CNE(); | ||
| 112 | - var.setCne_name("SAMSUNG ELECTRONICS LOGITECH CO LTD"); | ||
| 113 | -// var.setShp_account_number("ABC"); | ||
| 114 | - var.setCne_adr("416 MAETAN DONG YOUNGTONG GU"); | ||
| 115 | - var.setCne_loc_place("SUWON"); | ||
| 116 | -// var.setCne_loc_province("HENAN"); | ||
| 117 | - var.setCne_country("KR"); | ||
| 118 | -// var.setCne_postcode("07217"); | ||
| 119 | - var.setCne_contact_id("TE"); | ||
| 120 | - var.setCne_contact_number("82312703625"); | ||
| 121 | - | ||
| 122 | - | ||
| 123 | - try { | ||
| 124 | - String nodeText = var.getNodeName() + var.getFWBNodeText(); | ||
| 125 | - return nodeText; | ||
| 126 | - } catch (FWBException e) { | ||
| 127 | - e.printStackTrace(); | ||
| 128 | - } | ||
| 129 | - return ""; | ||
| 130 | - } | ||
| 131 | - | ||
| 132 | - static String FWB_AGT_TEST(){ | ||
| 133 | - FWB_AGT var = new FWB_AGT(); | ||
| 134 | -// var.setAgt_account_number(""); | ||
| 135 | -// var.setAgt_IATA_number("0831714"); | ||
| 136 | -// var.setAgt_CASS_ADR("0215"); | ||
| 137 | -// var.setAgt_participant_id("CAG"); | ||
| 138 | -// var.setAgt_name("BOLLORE LOGISTICS CHINA CO LTD "); | ||
| 139 | -// var.setAgt_ADR("SHANGHAI"); | ||
| 140 | - | ||
| 141 | - | ||
| 142 | - try { | ||
| 143 | - String nodeText = var.getFWBNodeText() ; | ||
| 144 | - return nodeText; | ||
| 145 | - } catch (FWBException e) { | ||
| 146 | - e.printStackTrace(); | ||
| 147 | - } | ||
| 148 | - return ""; | ||
| 149 | - } | ||
| 150 | - | ||
| 151 | - static String FWB_SSR_TEST(){ | ||
| 152 | - FWB_SSR var = new FWB_SSR(); | ||
| 153 | -// var.setSsr_request_content("SAY TOTAL 22 PACKAGES PLEASE NOTIFY CONSIGNEE UPON FLIGHT ARRIVAL"); | ||
| 154 | - | ||
| 155 | - try { | ||
| 156 | - String nodeText = var.getFWBNodeText() ; | ||
| 157 | - return nodeText; | ||
| 158 | - } catch (FWBException e) { | ||
| 159 | - e.printStackTrace(); | ||
| 160 | - } | ||
| 161 | - return ""; | ||
| 162 | - } | ||
| 163 | - | ||
| 164 | - static String FWB_NFY_TEST(){ | ||
| 165 | - FWB_NFY var = new FWB_NFY(); | ||
| 166 | -// var.setNfy_name("DSV AIR SEA AB - I200"); | ||
| 167 | -// var.setNfy_ADR("NO.3 UNIT 2F-W2 WAREHOUSE NO.83 SH"); | ||
| 168 | -// var.setNfy_LOC_city("SHANGHAI"); | ||
| 169 | -// var.setNfy_LOC_province(""); | ||
| 170 | -// var.setNfy_country("CN"); | ||
| 171 | -// var.setNfy_postcode(""); | ||
| 172 | -// var.setNfy_contact_id("TE"); | ||
| 173 | -// var.setNfy_contact_NUM("TE00862160278315"); | ||
| 174 | - try { | ||
| 175 | - String nodeText = var.getFWBNodeText() ; | ||
| 176 | - return nodeText; | ||
| 177 | - } catch (FWBException e) { | ||
| 178 | - e.printStackTrace(); | ||
| 179 | - } | ||
| 180 | - return ""; | ||
| 181 | - } | ||
| 182 | - | ||
| 183 | - static String FWB_ACC_TEST(){ | ||
| 184 | - FWB_ACC var = new FWB_ACC(); | ||
| 185 | - var.setAcc_info_id("GEN"); | ||
| 186 | - var.setAcc_info("FREIGHT PREPAID"); | ||
| 187 | - try { | ||
| 188 | - String nodeText = var.getFWBNodeText() ; | ||
| 189 | - return nodeText; | ||
| 190 | - } catch (FWBException e) { | ||
| 191 | - e.printStackTrace(); | ||
| 192 | - } | ||
| 193 | - return ""; | ||
| 194 | - } | ||
| 195 | - | ||
| 196 | - static String FWB_CVD_TEST(){ | ||
| 197 | - FWB_CVD var = new FWB_CVD(); | ||
| 198 | - var.setCvd_currency_code("CNY"); | ||
| 199 | -// var.setCvd_charge_code("PP"); | ||
| 200 | - var.setCvd_charge_prepaid("PP"); | ||
| 201 | - var.setCvd_value_for_carriage("NVD"); | ||
| 202 | - var.setCvd_value_for_customs("NCV"); | ||
| 203 | - var.setCvd_amount_of_insurance("XXX"); | ||
| 204 | - | ||
| 205 | - try { | ||
| 206 | - String nodeText = var.getFWBNodeText() ; | ||
| 207 | - return nodeText; | ||
| 208 | - } catch (FWBException e) { | ||
| 209 | - e.printStackTrace(); | ||
| 210 | - } | ||
| 211 | - return ""; | ||
| 212 | - } | ||
| 213 | - | ||
| 214 | - static String FWB_RTD_TEST(){ | ||
| 215 | - //todo:做个计费单价x计费重量 与 total 总价的对比验证 | ||
| 216 | - FWB_RTD var = new FWB_RTD(); | ||
| 217 | - var.setRtd_number_pieces("22"); | ||
| 218 | - var.setRtd_gross_weight("330"); | ||
| 219 | - var.setRtd_rate_class("Q"); | ||
| 220 | -// var.setRtd_commodity_NUM("12398"); | ||
| 221 | - var.setRtd_charge_weight("330"); | ||
| 222 | -// var.setRtd_rate_charge("21.23"); | ||
| 223 | -// var.setRtd_total("198732.22"); | ||
| 224 | - var.setRtd_goods_DES("CONSOLIDATED AS PER ATTACHED MANIFEST"); | ||
| 225 | - var.setRtd_goods_consol_DES("CONSOL"); | ||
| 226 | -// var.setRtd_goods_DIM_weightcode("K"); | ||
| 227 | -// var.setRtd_goods_DIM_weight("302.33"); | ||
| 228 | - var.setRtd_measurement_code("CMT"); | ||
| 229 | - var.setRtd_measurement_info("110-110-82/1"); | ||
| 230 | - var.setRtd_volume_code("MC"); | ||
| 231 | - var.setRtd_volume("1.47"); | ||
| 232 | - try { | ||
| 233 | - String nodeText = var.getFWBNodeText() ; | ||
| 234 | - return nodeText; | ||
| 235 | - } catch (FWBException e) { | ||
| 236 | - e.printStackTrace(); | ||
| 237 | - } | ||
| 238 | - return ""; | ||
| 239 | - } | ||
| 240 | - | ||
| 241 | - static String FWB_CER_TEST(){ | ||
| 242 | - FWB_CER var = new FWB_CER(); | ||
| 243 | - var.setCer_signature("KERRY EAS LOGISTICS"); | ||
| 244 | - | ||
| 245 | - | ||
| 246 | - try { | ||
| 247 | - String nodeText = var.getFWBNodeText() ; | ||
| 248 | - return nodeText; | ||
| 249 | - } catch (FWBException e) { | ||
| 250 | - e.printStackTrace(); | ||
| 251 | - } | ||
| 252 | - return ""; | ||
| 253 | - } | ||
| 254 | - | ||
| 255 | - static String FWB_ISU_TEST(){ | ||
| 256 | - FWB_ISU var = new FWB_ISU(); | ||
| 257 | - var.setIsu_day_mounth_year("07JUL23"); | ||
| 258 | - var.setIsu_place_or_airport_code("ZHENGZHOU"); | ||
| 259 | - | ||
| 260 | - | ||
| 261 | - try { | ||
| 262 | - String nodeText = var.getFWBNodeText() ; | ||
| 263 | - return nodeText; | ||
| 264 | - } catch (FWBException e) { | ||
| 265 | - e.printStackTrace(); | ||
| 266 | - } | ||
| 267 | - return ""; | ||
| 268 | - } | ||
| 269 | - | ||
| 270 | - static String FWB_OSI_TEST(){ | ||
| 271 | - FWB_OSI var = new FWB_OSI(); | ||
| 272 | -// var.setOsi_text("SAY TOTAL 22 PACKAGES PLEASE NOTIFY CONSIGNEE UPON FLIGHT ARRIVAL"); | ||
| 273 | - | ||
| 274 | - try { | ||
| 275 | - String nodeText = var.getFWBNodeText() ; | ||
| 276 | - return nodeText; | ||
| 277 | - } catch (FWBException e) { | ||
| 278 | - e.printStackTrace(); | ||
| 279 | - } | ||
| 280 | - return ""; | ||
| 281 | - } | ||
| 282 | - | ||
| 283 | - | ||
| 284 | - | ||
| 285 | - static String OCI_TEST(){ | ||
| 286 | - FWB_OCI var = new FWB_OCI(); | ||
| 287 | - var.setOci_csrc_id("T"); | ||
| 288 | - var.setOci_csrc_info("USCI91410100712647021U"); | ||
| 289 | - var.setOci_country_code("CN"); | ||
| 290 | - var.setOci_information_id("SHP"); | ||
| 291 | - | ||
| 292 | - try { | ||
| 293 | - String nodeText= var.getFWBNodeText(); | ||
| 294 | - return nodeText; | ||
| 295 | - } catch (FWBException e) { | ||
| 296 | - e.printStackTrace(); | ||
| 297 | - } | ||
| 298 | - return ""; | ||
| 299 | - } | ||
| 300 | - | ||
| 301 | - static String REF_TEST(){ | ||
| 302 | - FWB_REF var = new FWB_REF(); | ||
| 303 | - var.setRef_address("CGOFDIE"); | ||
| 304 | -// fwb_ref.setRef_file_reference("EC1A2C4CBC3D1"); | ||
| 305 | -// fwb_ref.setRef_participant_id("AGT"); | ||
| 306 | -// fwb_ref.setRef_participant_code("MECCGO01"); | ||
| 307 | -// fwb_ref.setRef_participant_airport("CGO"); | ||
| 308 | - | ||
| 309 | - try { | ||
| 310 | - String nodeText = var.getFWBNodeText(); | ||
| 311 | - return nodeText; | ||
| 312 | - } catch (FWBException e) { | ||
| 313 | - e.printStackTrace(); | ||
| 314 | - } | ||
| 315 | - return ""; | ||
| 316 | - } | ||
| 317 | - | ||
| 318 | - | ||
| 319 | -} |
| @@ -2,7 +2,10 @@ | @@ -2,7 +2,10 @@ | ||
| 2 | import com.sunyo.wlpt.base.model.efreight.fwb.*; | 2 | import com.sunyo.wlpt.base.model.efreight.fwb.*; |
| 3 | import com.sunyo.wlpt.base.model.efreight.fwb.exception.FWBException; | 3 | import com.sunyo.wlpt.base.model.efreight.fwb.exception.FWBException; |
| 4 | 4 | ||
| 5 | -public class FWBTest { | 5 | +import java.util.ArrayList; |
| 6 | +import java.util.List; | ||
| 7 | + | ||
| 8 | +public class FWB_804_31118511 { | ||
| 6 | public static void main(String[] args) { | 9 | public static void main(String[] args) { |
| 7 | 10 | ||
| 8 | 11 | ||
| @@ -18,6 +21,8 @@ public class FWBTest { | @@ -18,6 +21,8 @@ public class FWBTest { | ||
| 18 | + FWB_ACC_TEST() | 21 | + FWB_ACC_TEST() |
| 19 | + FWB_CVD_TEST() | 22 | + FWB_CVD_TEST() |
| 20 | + FWB_RTD_TEST() | 23 | + FWB_RTD_TEST() |
| 24 | + + FWB_OTH_TEST() | ||
| 25 | + + FWB_PPD_TEST() | ||
| 21 | + FWB_CER_TEST() | 26 | + FWB_CER_TEST() |
| 22 | + FWB_ISU_TEST() | 27 | + FWB_ISU_TEST() |
| 23 | + FWB_OSI_TEST() | 28 | + FWB_OSI_TEST() |
| @@ -33,14 +38,15 @@ public class FWBTest { | @@ -33,14 +38,15 @@ public class FWBTest { | ||
| 33 | 38 | ||
| 34 | static String FWB_WAYBILL_TEST(){ | 39 | static String FWB_WAYBILL_TEST(){ |
| 35 | FWB fwb = new FWB(); | 40 | FWB fwb = new FWB(); |
| 36 | - fwb.setWaybillNum("804-31118500"); | 41 | + fwb.setWaybillNum("804-31118485"); |
| 37 | fwb.setOrigin("CGO"); | 42 | fwb.setOrigin("CGO"); |
| 38 | fwb.setDestination("ICN"); | 43 | fwb.setDestination("ICN"); |
| 39 | - fwb.setQuantity_picecs("22"); | ||
| 40 | - fwb.setQuantity_weight("196"); | 44 | + fwb.setQuantity_picecs("2"); |
| 41 | fwb.setQuantity_weight_code("K"); | 45 | fwb.setQuantity_weight_code("K"); |
| 42 | - fwb.setQuantity_volume("0.78"); | 46 | + fwb.setQuantity_weight("10"); |
| 43 | fwb.setQuantity_volume_code("MC"); | 47 | fwb.setQuantity_volume_code("MC"); |
| 48 | + fwb.setQuantity_volume("0.10"); | ||
| 49 | + | ||
| 44 | // fwb.setQuantity_density("22"); | 50 | // fwb.setQuantity_density("22"); |
| 45 | try { | 51 | try { |
| 46 | fwb.getWaybillNum(); | 52 | fwb.getWaybillNum(); |
| @@ -57,7 +63,7 @@ public class FWBTest { | @@ -57,7 +63,7 @@ public class FWBTest { | ||
| 57 | FWB_FLT flt = new FWB_FLT(); | 63 | FWB_FLT flt = new FWB_FLT(); |
| 58 | flt.setCariier("CF"); | 64 | flt.setCariier("CF"); |
| 59 | flt.setFlightNumber("221"); | 65 | flt.setFlightNumber("221"); |
| 60 | - flt.setDay("08"); | 66 | + flt.setDay("13"); |
| 61 | 67 | ||
| 62 | try { | 68 | try { |
| 63 | String nodeText = flt.getNodeName() + flt.getFWBNodeText() + "\n"; | 69 | String nodeText = flt.getNodeName() + flt.getFWBNodeText() + "\n"; |
| @@ -87,15 +93,15 @@ public class FWBTest { | @@ -87,15 +93,15 @@ public class FWBTest { | ||
| 87 | 93 | ||
| 88 | static String FWB_SHP_TEST(){ | 94 | static String FWB_SHP_TEST(){ |
| 89 | FWB_SHP var = new FWB_SHP(); | 95 | FWB_SHP var = new FWB_SHP(); |
| 90 | - var.setShp_name("DIMERCO INTERNATIONAL TRANSPORTA"); | 96 | + var.setShp_name("MCL ELECTRONIC MATERIALS CO LTD"); |
| 91 | // var.setShp_account_number("ABC"); | 97 | // var.setShp_account_number("ABC"); |
| 92 | - var.setShp_adr("LTD ZHENGZHOU BRANCH 607 608"); | ||
| 93 | - var.setShp_loc_place("ZHENGZHOU"); | 98 | + var.setShp_adr("NO99 BINHEBEI ROAD GAOXIN DISTRICT"); |
| 99 | + var.setShp_loc_place("LUOYANG"); | ||
| 94 | var.setShp_loc_province("HENAN"); | 100 | var.setShp_loc_province("HENAN"); |
| 95 | var.setShp_country("CN"); | 101 | var.setShp_country("CN"); |
| 96 | - var.setShp_postcode("450000"); | 102 | + var.setShp_postcode("471000"); |
| 97 | var.setShp_contact_id("TE"); | 103 | var.setShp_contact_id("TE"); |
| 98 | - var.setShp_contact_number("8637155629366"); | 104 | + var.setShp_contact_number("86037963390432"); |
| 99 | 105 | ||
| 100 | 106 | ||
| 101 | try { | 107 | try { |
| @@ -109,15 +115,15 @@ public class FWBTest { | @@ -109,15 +115,15 @@ public class FWBTest { | ||
| 109 | 115 | ||
| 110 | static String FWB_CNE_TEST(){ | 116 | static String FWB_CNE_TEST(){ |
| 111 | FWB_CNE var = new FWB_CNE(); | 117 | FWB_CNE var = new FWB_CNE(); |
| 112 | - var.setCne_name("DIMERCO EXPRESS KOREA CORP."); | 118 | + var.setCne_name("EASY TRADING CO LTD"); |
| 113 | // var.setShp_account_number("ABC"); | 119 | // var.setShp_account_number("ABC"); |
| 114 | - var.setCne_adr("1501 1502 BLDG. E SKV1 CENTER 11"); | ||
| 115 | - var.setCne_loc_place("SEOUL"); | 120 | + var.setCne_adr("201 111 BALLYONG RO DEOKJIN GU"); |
| 121 | + var.setCne_loc_place("JEONJU SI"); | ||
| 116 | // var.setCne_loc_province("HENAN"); | 122 | // var.setCne_loc_province("HENAN"); |
| 117 | var.setCne_country("KR"); | 123 | var.setCne_country("KR"); |
| 118 | - var.setCne_postcode("07217"); | 124 | + var.setCne_postcode("54853"); |
| 119 | var.setCne_contact_id("TE"); | 125 | var.setCne_contact_id("TE"); |
| 120 | - var.setCne_contact_number("828223370905"); | 126 | + var.setCne_contact_number("82637143737"); |
| 121 | 127 | ||
| 122 | 128 | ||
| 123 | try { | 129 | try { |
| @@ -150,7 +156,7 @@ public class FWBTest { | @@ -150,7 +156,7 @@ public class FWBTest { | ||
| 150 | 156 | ||
| 151 | static String FWB_SSR_TEST(){ | 157 | static String FWB_SSR_TEST(){ |
| 152 | FWB_SSR var = new FWB_SSR(); | 158 | FWB_SSR var = new FWB_SSR(); |
| 153 | - var.setSsr_request_content("SAY TOTAL 22 PACKAGES PLEASE NOTIFY CONSIGNEE UPON FLIGHT ARRIVAL"); | 159 | +// var.setSsr_request_content("SAY TOTAL 10 PACKAGE PLEASE NOTIFY CONSIGNEE UPON FLIGHT ARRIVAL"); |
| 154 | 160 | ||
| 155 | try { | 161 | try { |
| 156 | String nodeText = var.getFWBNodeText() ; | 162 | String nodeText = var.getFWBNodeText() ; |
| @@ -163,14 +169,14 @@ public class FWBTest { | @@ -163,14 +169,14 @@ public class FWBTest { | ||
| 163 | 169 | ||
| 164 | static String FWB_NFY_TEST(){ | 170 | static String FWB_NFY_TEST(){ |
| 165 | FWB_NFY var = new FWB_NFY(); | 171 | FWB_NFY var = new FWB_NFY(); |
| 166 | -// var.setNfy_name("DSV AIR SEA AB - I200"); | ||
| 167 | -// var.setNfy_ADR("NO.3 UNIT 2F-W2 WAREHOUSE NO.83 SH"); | ||
| 168 | -// var.setNfy_LOC_city("SHANGHAI"); | 172 | +// var.setNfy_name("KYUNGDONG CHEMICAL CORP"); |
| 173 | +// var.setNfy_ADR("704 BYUCKSAN SUNYOUNG TECHNOPIA 13"); | ||
| 174 | +// var.setNfy_LOC_city("UIWANG SI"); | ||
| 169 | // var.setNfy_LOC_province(""); | 175 | // var.setNfy_LOC_province(""); |
| 170 | -// var.setNfy_country("CN"); | ||
| 171 | -// var.setNfy_postcode(""); | 176 | +// var.setNfy_country("KR"); |
| 177 | +// var.setNfy_postcode("16072"); | ||
| 172 | // var.setNfy_contact_id("TE"); | 178 | // var.setNfy_contact_id("TE"); |
| 173 | -// var.setNfy_contact_NUM("TE00862160278315"); | 179 | +// var.setNfy_contact_NUM("0313873573"); |
| 174 | try { | 180 | try { |
| 175 | String nodeText = var.getFWBNodeText() ; | 181 | String nodeText = var.getFWBNodeText() ; |
| 176 | return nodeText; | 182 | return nodeText; |
| @@ -196,7 +202,7 @@ public class FWBTest { | @@ -196,7 +202,7 @@ public class FWBTest { | ||
| 196 | static String FWB_CVD_TEST(){ | 202 | static String FWB_CVD_TEST(){ |
| 197 | FWB_CVD var = new FWB_CVD(); | 203 | FWB_CVD var = new FWB_CVD(); |
| 198 | var.setCvd_currency_code("CNY"); | 204 | var.setCvd_currency_code("CNY"); |
| 199 | - var.setCvd_charge_code("PP"); | 205 | + var.setCvd_charge_code(""); |
| 200 | var.setCvd_charge_prepaid("PP"); | 206 | var.setCvd_charge_prepaid("PP"); |
| 201 | var.setCvd_value_for_carriage("NVD"); | 207 | var.setCvd_value_for_carriage("NVD"); |
| 202 | var.setCvd_value_for_customs("NCV"); | 208 | var.setCvd_value_for_customs("NCV"); |
| @@ -214,21 +220,57 @@ public class FWBTest { | @@ -214,21 +220,57 @@ public class FWBTest { | ||
| 214 | static String FWB_RTD_TEST(){ | 220 | static String FWB_RTD_TEST(){ |
| 215 | //todo:做个计费单价x计费重量 与 total 总价的对比验证 | 221 | //todo:做个计费单价x计费重量 与 total 总价的对比验证 |
| 216 | FWB_RTD var = new FWB_RTD(); | 222 | FWB_RTD var = new FWB_RTD(); |
| 217 | - var.setRtd_number_pieces("22"); | ||
| 218 | - var.setRtd_gross_weight("194"); | 223 | + var.setRtd_number_pieces("2"); |
| 224 | + var.setRtd_gross_weight("10"); | ||
| 219 | var.setRtd_rate_class("Q"); | 225 | var.setRtd_rate_class("Q"); |
| 220 | // var.setRtd_commodity_NUM("12398"); | 226 | // var.setRtd_commodity_NUM("12398"); |
| 221 | - var.setRtd_charge_weight("194"); | ||
| 222 | -// var.setRtd_rate_charge("21.23"); | ||
| 223 | -// var.setRtd_total("198732.22"); | ||
| 224 | -// var.setRtd_goods_DES("DELL COMPUTY"); | ||
| 225 | - var.setRtd_goods_consol_DES("CONSOL"); | 227 | + var.setRtd_charge_weight("45"); |
| 228 | + var.setRtd_rate_charge("14.32"); | ||
| 229 | + var.setRtd_total("644.40"); | ||
| 230 | + var.setRtd_goods_DES("POLISHED SILICON WAFER"); | ||
| 231 | +// var.setRtd_goods_consol_DES("CONSOL"); | ||
| 226 | // var.setRtd_goods_DIM_weightcode("W"); | 232 | // var.setRtd_goods_DIM_weightcode("W"); |
| 227 | // var.setRtd_goods_DIM_weight("302.33"); | 233 | // var.setRtd_goods_DIM_weight("302.33"); |
| 228 | - var.setRtd_measurement_code("CMT"); | ||
| 229 | - var.setRtd_measurement_info("33-33-34/21"); | 234 | + |
| 235 | + List<FWB_RTD_Dimension> measurement_list = new ArrayList(); | ||
| 236 | + measurement_list.add(new FWB_RTD_Dimension("136.73","47-42-26/4")); | ||
| 237 | + measurement_list.add(new FWB_RTD_Dimension("22.08","27-33-44/1")); | ||
| 238 | + var.setDimensions(measurement_list); | ||
| 239 | + | ||
| 230 | var.setRtd_volume_code("MC"); | 240 | var.setRtd_volume_code("MC"); |
| 231 | - var.setRtd_volume("0.78"); | 241 | + var.setRtd_volume("0.10"); |
| 242 | + try { | ||
| 243 | + String nodeText = var.getFWBNodeText() ; | ||
| 244 | + return nodeText; | ||
| 245 | + } catch (FWBException e) { | ||
| 246 | + e.printStackTrace(); | ||
| 247 | + } | ||
| 248 | + return ""; | ||
| 249 | + } | ||
| 250 | + | ||
| 251 | + static String FWB_OTH_TEST(){ | ||
| 252 | + //todo:做个计费单价x计费重量 与 total 总价的对比验证 | ||
| 253 | + FWB_OTH var = new FWB_OTH(); | ||
| 254 | + | ||
| 255 | + try { | ||
| 256 | + String nodeText = var.getFWBNodeText() ; | ||
| 257 | + return nodeText; | ||
| 258 | + } catch (FWBException e) { | ||
| 259 | + e.printStackTrace(); | ||
| 260 | + } | ||
| 261 | + return ""; | ||
| 262 | + } | ||
| 263 | + | ||
| 264 | + static String FWB_PPD_TEST(){ | ||
| 265 | + //todo:做个计费单价x计费重量 与 total 总价的对比验证 | ||
| 266 | + FWB_PPD var = new FWB_PPD(); | ||
| 267 | + var.setPpd_weight_amount("1"); | ||
| 268 | + var.setPpd_valuation_amount("2"); | ||
| 269 | + var.setPpd_taxes_amount("3"); | ||
| 270 | + var.setPpd_other_charges_due_agent("4"); | ||
| 271 | + var.setPpd_other_charges_due_carrier("5"); | ||
| 272 | + var.setPpd_charge_summary_total("6"); | ||
| 273 | + | ||
| 232 | try { | 274 | try { |
| 233 | String nodeText = var.getFWBNodeText() ; | 275 | String nodeText = var.getFWBNodeText() ; |
| 234 | return nodeText; | 276 | return nodeText; |
| @@ -254,8 +296,9 @@ public class FWBTest { | @@ -254,8 +296,9 @@ public class FWBTest { | ||
| 254 | 296 | ||
| 255 | static String FWB_ISU_TEST(){ | 297 | static String FWB_ISU_TEST(){ |
| 256 | FWB_ISU var = new FWB_ISU(); | 298 | FWB_ISU var = new FWB_ISU(); |
| 257 | - var.setIsu_day_mounth_year("07JUL23"); | 299 | + var.setIsu_day_mounth_year("12JUL23"); |
| 258 | var.setIsu_place_or_airport_code("ZHENGZHOU"); | 300 | var.setIsu_place_or_airport_code("ZHENGZHOU"); |
| 301 | +// var.setIsu_signature("JUNWEI WANG"); | ||
| 259 | 302 | ||
| 260 | 303 | ||
| 261 | try { | 304 | try { |
| @@ -281,17 +324,48 @@ public class FWBTest { | @@ -281,17 +324,48 @@ public class FWBTest { | ||
| 281 | } | 324 | } |
| 282 | 325 | ||
| 283 | 326 | ||
| 284 | - | 327 | + /** |
| 328 | + * OCI节点应为数组节点 | ||
| 329 | + * @return | ||
| 330 | + */ | ||
| 285 | static String OCI_TEST(){ | 331 | static String OCI_TEST(){ |
| 332 | + List<FWB_OCI> ociList = new ArrayList(); | ||
| 333 | + | ||
| 286 | FWB_OCI var = new FWB_OCI(); | 334 | FWB_OCI var = new FWB_OCI(); |
| 287 | var.setOci_csrc_id("T"); | 335 | var.setOci_csrc_id("T"); |
| 288 | - var.setOci_csrc_info("USCI91410100349422169R"); | 336 | + var.setOci_csrc_info("USCI91410300623912049A"); |
| 289 | var.setOci_country_code("CN"); | 337 | var.setOci_country_code("CN"); |
| 290 | var.setOci_information_id("SHP"); | 338 | var.setOci_information_id("SHP"); |
| 291 | 339 | ||
| 340 | + FWB_OCI var_CP = new FWB_OCI(); | ||
| 341 | + var_CP.setOci_csrc_id("CP"); | ||
| 342 | + var_CP.setOci_csrc_info("LI"); | ||
| 343 | + var_CP.setOci_country_code("CN"); | ||
| 344 | + var_CP.setOci_information_id("SHP"); | ||
| 345 | + | ||
| 346 | + FWB_OCI var_CT = new FWB_OCI(); | ||
| 347 | + var_CT.setOci_csrc_id("CT"); | ||
| 348 | + var_CT.setOci_csrc_info("12384511"); | ||
| 349 | + var_CT.setOci_country_code("CN"); | ||
| 350 | + var_CT.setOci_information_id("SHP"); | ||
| 351 | + | ||
| 352 | + ociList.add(var); | ||
| 353 | + ociList.add(var_CP); | ||
| 354 | + ociList.add(var_CT); | ||
| 355 | + | ||
| 292 | try { | 356 | try { |
| 293 | - String nodeText= var.getFWBNodeText(); | ||
| 294 | - return nodeText; | 357 | + StringBuilder nodeText= new StringBuilder(); |
| 358 | + for (FWB_OCI oci : ociList) { | ||
| 359 | + String nodeTextLine = oci.getFWBNodeText(); | ||
| 360 | + /** | ||
| 361 | + * 每行的OCI都会生成OCI标识,所以要去掉除了第一行OCI以外的其他标识 | ||
| 362 | + */ | ||
| 363 | + if (nodeText.indexOf(oci.getNodeName(),0)>-1){ | ||
| 364 | + nodeTextLine = nodeTextLine.replace(oci.getNodeName(),""); | ||
| 365 | + } | ||
| 366 | + nodeText.append(nodeTextLine); | ||
| 367 | + } | ||
| 368 | + return nodeText.toString(); | ||
| 295 | } catch (FWBException e) { | 369 | } catch (FWBException e) { |
| 296 | e.printStackTrace(); | 370 | e.printStackTrace(); |
| 297 | } | 371 | } |
-
请 注册 或 登录 后发表评论