PI-11-HS CODE接口-01:
接口调整 新增HS CODE通用模糊查询接口 mt 2023年2月22日15:24:19
Showing
29 changed files
with
224 additions
and
221 deletions
No preview for this file type
| 1 | +package com.erry.iclear.dateInterface; | ||
| 2 | + | ||
| 3 | + | ||
| 4 | +/** | ||
| 5 | + * 异常编码枚举类 | ||
| 6 | + * mt | ||
| 7 | + * 2023年2月21日16:03:16 | ||
| 8 | + */ | ||
| 9 | +public enum ErrorCodeEnum { | ||
| 10 | + SUCCESS("0","成功"), | ||
| 11 | + ERROR_7("10001","请求信息不能为空"), | ||
| 12 | + ERROR_10001("10001","Appid错误(Appid不存在)"), | ||
| 13 | + ERROR_10002("10002","Appkey错误(Appkey不存在)"), | ||
| 14 | + ERROR_10004("10004","凭证已过期"), | ||
| 15 | + ERROR_10013("10013","无Token(缺少参数)"), | ||
| 16 | + ERROR_10014("10014","Token无效(Token值验证失败)"), | ||
| 17 | + ERROR_10016("10016","无Appid(缺少参数)"), | ||
| 18 | + ERROR_10017("10017","无Appkey(缺少参数)"), | ||
| 19 | + ERROR_10018("10018","无TimeStamp(缺少参数)"), | ||
| 20 | + ERROR_10019("10019","未指定hscode编码,10分钟之内只允许查询一次。"), | ||
| 21 | + ERROR_30001("30001","数据格式不正确"), | ||
| 22 | + ERROR_30002("30002","缺少必填项"), | ||
| 23 | + ERROR_30003("30003","数据校验不通过"), | ||
| 24 | + ERROR_30100("30100","hscode编码个数超过100个"), | ||
| 25 | + ERROR_30101("30101","数据查询异常(访问数据库超时或者其他数据库异常)"), | ||
| 26 | + ERROR_30102("30102","hscode编码字段长度超过2000字符"), | ||
| 27 | + ERROR_30103("30103","skuCode与skuName必须传递一项"), | ||
| 28 | + ERROR_30104("30104","skuCode或skuName长度超出限制"); | ||
| 29 | + | ||
| 30 | + ErrorCodeEnum(String code,String name){ | ||
| 31 | + this.code = code; | ||
| 32 | + this.name = name; | ||
| 33 | + } | ||
| 34 | + | ||
| 35 | + private String code; | ||
| 36 | + private String name; | ||
| 37 | + public String getCode() { | ||
| 38 | + return code; | ||
| 39 | + } | ||
| 40 | + public String getName() { | ||
| 41 | + return name; | ||
| 42 | + } | ||
| 43 | +} |
| ... | @@ -36,8 +36,4 @@ public class IClearApiApplication extends SpringBootServletInitializer { | ... | @@ -36,8 +36,4 @@ public class IClearApiApplication extends SpringBootServletInitializer { |
| 36 | protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { | 36 | protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { |
| 37 | return builder.sources(IClearApiApplication.class); | 37 | return builder.sources(IClearApiApplication.class); |
| 38 | } | 38 | } |
| 39 | - | ||
| 40 | - public String test(){ | ||
| 41 | - return "test"; | ||
| 42 | - } | ||
| 43 | } | 39 | } | ... | ... |
| 1 | -//package com.erry.iclear.dateInterface; | ||
| 2 | -// | ||
| 3 | -//import org.springframework.boot.builder.SpringApplicationBuilder; | ||
| 4 | -//import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; | ||
| 5 | -// | ||
| 6 | -///** | ||
| 7 | -// * @author Administrator | ||
| 8 | -// */ | ||
| 9 | -//public class SpringBootStartApplication extends SpringBootServletInitializer { | ||
| 10 | -// @Override | ||
| 11 | -// protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { | ||
| 12 | -// return builder.sources(IClearApiApplication.class); | ||
| 13 | -// } | ||
| 14 | -//} |
| 1 | package com.erry.iclear.dateInterface.api; | 1 | package com.erry.iclear.dateInterface.api; |
| 2 | 2 | ||
| 3 | +import com.erry.iclear.dateInterface.ErrorCodeEnum; | ||
| 3 | import com.erry.iclear.dateInterface.api.response.ResultRS; | 4 | import com.erry.iclear.dateInterface.api.response.ResultRS; |
| 4 | import lombok.extern.slf4j.Slf4j; | 5 | import lombok.extern.slf4j.Slf4j; |
| 5 | import org.springframework.beans.factory.annotation.Autowired; | 6 | import org.springframework.beans.factory.annotation.Autowired; |
| ... | @@ -37,8 +38,6 @@ public class CommonExceptionAdvice { | ... | @@ -37,8 +38,6 @@ public class CommonExceptionAdvice { |
| 37 | String itemMessage= messageSource.getMessage(x.getDefaultMessage(), null, x.getDefaultMessage(), LocaleContextHolder.getLocale()); | 38 | String itemMessage= messageSource.getMessage(x.getDefaultMessage(), null, x.getDefaultMessage(), LocaleContextHolder.getLocale()); |
| 38 | return String.format("%s", itemMessage); | 39 | return String.format("%s", itemMessage); |
| 39 | }).collect(Collectors.toList()); | 40 | }).collect(Collectors.toList()); |
| 40 | - | 41 | + return new ResultRS(Boolean.FALSE, ErrorCodeEnum.ERROR_30002.getCode(),errorMessages.toString()); |
| 41 | - | ||
| 42 | - return new ResultRS(Boolean.FALSE,"30002",errorMessages.toString()); | ||
| 43 | } | 42 | } |
| 44 | } | 43 | } | ... | ... |
| 1 | package com.erry.iclear.dateInterface.api; | 1 | package com.erry.iclear.dateInterface.api; |
| 2 | 2 | ||
| 3 | +import com.erry.iclear.dateInterface.ErrorCodeEnum; | ||
| 3 | import com.erry.iclear.dateInterface.api.request.Mawb; | 4 | import com.erry.iclear.dateInterface.api.request.Mawb; |
| 4 | import com.erry.iclear.dateInterface.api.response.ResultRS; | 5 | import com.erry.iclear.dateInterface.api.response.ResultRS; |
| 5 | import com.erry.iclear.dateInterface.entity.IClearApiLog; | 6 | import com.erry.iclear.dateInterface.entity.IClearApiLog; |
| ... | @@ -52,19 +53,18 @@ public class CustomsDataInterface { | ... | @@ -52,19 +53,18 @@ public class CustomsDataInterface { |
| 52 | ResultRS result = new ResultRS(Boolean.FALSE,"",""); | 53 | ResultRS result = new ResultRS(Boolean.FALSE,"",""); |
| 53 | 54 | ||
| 54 | if(Objects.equals(mawb,null)){ | 55 | if(Objects.equals(mawb,null)){ |
| 55 | - result.setCode("-7"); | 56 | + result.setCode(ErrorCodeEnum.ERROR_7.getCode()); |
| 56 | - result.setMsg("请求信息不能为空"); | 57 | + result.setMsg(ErrorCodeEnum.ERROR_7.getName()); |
| 57 | return result; | 58 | return result; |
| 58 | } | 59 | } |
| 59 | 60 | ||
| 60 | String checkrs = mawbService.checkMawbBaseInfo(mawb); | 61 | String checkrs = mawbService.checkMawbBaseInfo(mawb); |
| 61 | if(StringUtil.isNotEmpty(checkrs)){ | 62 | if(StringUtil.isNotEmpty(checkrs)){ |
| 62 | - result.setCode("-7"); | 63 | + result.setCode(ErrorCodeEnum.ERROR_7.getCode()); |
| 63 | result.setMsg(checkrs); | 64 | result.setMsg(checkrs); |
| 64 | return result; | 65 | return result; |
| 65 | } | 66 | } |
| 66 | 67 | ||
| 67 | - | ||
| 68 | //1、保存请求信息,保存到iClear的 SQLServer | 68 | //1、保存请求信息,保存到iClear的 SQLServer |
| 69 | 69 | ||
| 70 | StopWatch sw = new StopWatch("receice mawb"); | 70 | StopWatch sw = new StopWatch("receice mawb"); |
| ... | @@ -75,9 +75,6 @@ public class CustomsDataInterface { | ... | @@ -75,9 +75,6 @@ public class CustomsDataInterface { |
| 75 | String timeStamp=(String) request.getHeader("TimeStamp"); | 75 | String timeStamp=(String) request.getHeader("TimeStamp"); |
| 76 | IClearApiLog saveIClearApiLogResult = iClearApiLogService.saveIClearApiLog(iClearApiLogService.convertToIClearApiLog(mawb,appId,appKey,new Date(Long.valueOf(timeStamp)))); | 76 | IClearApiLog saveIClearApiLogResult = iClearApiLogService.saveIClearApiLog(iClearApiLogService.convertToIClearApiLog(mawb,appId,appKey,new Date(Long.valueOf(timeStamp)))); |
| 77 | 77 | ||
| 78 | - | ||
| 79 | - | ||
| 80 | - | ||
| 81 | mawb.setAppId(appId); | 78 | mawb.setAppId(appId); |
| 82 | if(!Objects.equals(saveIClearApiLogResult,null)){ | 79 | if(!Objects.equals(saveIClearApiLogResult,null)){ |
| 83 | log.info("请求保存成功,msgId:"+saveIClearApiLogResult.getMsgId()); | 80 | log.info("请求保存成功,msgId:"+saveIClearApiLogResult.getMsgId()); |
| ... | @@ -102,7 +99,7 @@ public class CustomsDataInterface { | ... | @@ -102,7 +99,7 @@ public class CustomsDataInterface { |
| 102 | } | 99 | } |
| 103 | } | 100 | } |
| 104 | sw.stop(); | 101 | sw.stop(); |
| 105 | - result.setCode("30001"); | 102 | + result.setCode(ErrorCodeEnum.ERROR_30001.getCode()); |
| 106 | result.setMsg(msg); | 103 | result.setMsg(msg); |
| 107 | return result; | 104 | return result; |
| 108 | } | 105 | } |
| ... | @@ -128,7 +125,6 @@ public class CustomsDataInterface { | ... | @@ -128,7 +125,6 @@ public class CustomsDataInterface { |
| 128 | // } | 125 | // } |
| 129 | // sw.stop(); | 126 | // sw.stop(); |
| 130 | 127 | ||
| 131 | - | ||
| 132 | //4、保存运单到iclear中 | 128 | //4、保存运单到iclear中 |
| 133 | sw.start("processChmConsignment"); | 129 | sw.start("processChmConsignment"); |
| 134 | result = chmConsignmentService.processChmConsignment(mawb, timeStamp,appId); | 130 | result = chmConsignmentService.processChmConsignment(mawb, timeStamp,appId); |
| ... | @@ -137,7 +133,6 @@ public class CustomsDataInterface { | ... | @@ -137,7 +133,6 @@ public class CustomsDataInterface { |
| 137 | } | 133 | } |
| 138 | sw.stop(); | 134 | sw.stop(); |
| 139 | 135 | ||
| 140 | - | ||
| 141 | //5、更新日志 | 136 | //5、更新日志 |
| 142 | sw.start("updateIClearApiLog"); | 137 | sw.start("updateIClearApiLog"); |
| 143 | if(!Objects.equals(saveIClearApiLogResult,null)){ | 138 | if(!Objects.equals(saveIClearApiLogResult,null)){ |
| ... | @@ -154,7 +149,7 @@ public class CustomsDataInterface { | ... | @@ -154,7 +149,7 @@ public class CustomsDataInterface { |
| 154 | 149 | ||
| 155 | //6、return result | 150 | //6、return result |
| 156 | result.setSuccess(Boolean.TRUE); | 151 | result.setSuccess(Boolean.TRUE); |
| 157 | - result.setCode("0"); | 152 | + result.setCode(ErrorCodeEnum.SUCCESS.getCode()); |
| 158 | result.setMsg("操作成功"); | 153 | result.setMsg("操作成功"); |
| 159 | return result; | 154 | return result; |
| 160 | } | 155 | } | ... | ... |
| ... | @@ -5,6 +5,7 @@ import com.arronlong.httpclientutil.HttpClientUtil; | ... | @@ -5,6 +5,7 @@ import com.arronlong.httpclientutil.HttpClientUtil; |
| 5 | import com.arronlong.httpclientutil.common.HttpConfig; | 5 | import com.arronlong.httpclientutil.common.HttpConfig; |
| 6 | import com.arronlong.httpclientutil.common.HttpHeader; | 6 | import com.arronlong.httpclientutil.common.HttpHeader; |
| 7 | import com.arronlong.httpclientutil.exception.HttpProcessException; | 7 | import com.arronlong.httpclientutil.exception.HttpProcessException; |
| 8 | +import com.erry.iclear.dateInterface.ErrorCodeEnum; | ||
| 8 | import com.erry.iclear.dateInterface.api.request.*; | 9 | import com.erry.iclear.dateInterface.api.request.*; |
| 9 | import com.erry.iclear.dateInterface.api.response.FedexResultChmRS; | 10 | import com.erry.iclear.dateInterface.api.response.FedexResultChmRS; |
| 10 | import com.erry.iclear.dateInterface.api.response.FedexResultRS; | 11 | import com.erry.iclear.dateInterface.api.response.FedexResultRS; |
| ... | @@ -65,7 +66,6 @@ public class FedexDataInterface { | ... | @@ -65,7 +66,6 @@ public class FedexDataInterface { |
| 65 | @Value("${api.address.iclear-submit-url}") | 66 | @Value("${api.address.iclear-submit-url}") |
| 66 | String iclearCSubmitUrl; | 67 | String iclearCSubmitUrl; |
| 67 | 68 | ||
| 68 | - | ||
| 69 | @ApiOperation(value = "C类运单数据校验接口", httpMethod = "POST", notes = "ex: http://192.168.1.75:8080/fedex/checkBASFMawbFedex") | 69 | @ApiOperation(value = "C类运单数据校验接口", httpMethod = "POST", notes = "ex: http://192.168.1.75:8080/fedex/checkBASFMawbFedex") |
| 70 | @PostMapping("/checkMawbFedexC") | 70 | @PostMapping("/checkMawbFedexC") |
| 71 | @ResponseBody | 71 | @ResponseBody |
| ... | @@ -77,7 +77,6 @@ public class FedexDataInterface { | ... | @@ -77,7 +77,6 @@ public class FedexDataInterface { |
| 77 | String token=(String) request.getHeader("Token"); | 77 | String token=(String) request.getHeader("Token"); |
| 78 | String addr = request.getRemoteAddr(); | 78 | String addr = request.getRemoteAddr(); |
| 79 | 79 | ||
| 80 | - | ||
| 81 | TIClearApiCheckLog tIclearApiCheckLog = new TIClearApiCheckLog(); | 80 | TIClearApiCheckLog tIclearApiCheckLog = new TIClearApiCheckLog(); |
| 82 | tIclearApiCheckLog.setRequestAppid(appId); | 81 | tIclearApiCheckLog.setRequestAppid(appId); |
| 83 | tIclearApiCheckLog.setRequestAppkey(appKey); | 82 | tIclearApiCheckLog.setRequestAppkey(appKey); |
| ... | @@ -117,7 +116,7 @@ public class FedexDataInterface { | ... | @@ -117,7 +116,7 @@ public class FedexDataInterface { |
| 117 | log.info(sw.prettyPrint()); | 116 | log.info(sw.prettyPrint()); |
| 118 | if(result.getSuccess()){ | 117 | if(result.getSuccess()){ |
| 119 | result.setSuccess(Boolean.TRUE); | 118 | result.setSuccess(Boolean.TRUE); |
| 120 | - result.setCode("0"); | 119 | + result.setCode(ErrorCodeEnum.SUCCESS.getCode()); |
| 121 | } | 120 | } |
| 122 | tiClearApiCheckLogSave.setResponseText(result.getMsg()); | 121 | tiClearApiCheckLogSave.setResponseText(result.getMsg()); |
| 123 | tiClearApiCheckLogSave.setCode(result.getCode()); | 122 | tiClearApiCheckLogSave.setCode(result.getCode()); |
| ... | @@ -128,8 +127,6 @@ public class FedexDataInterface { | ... | @@ -128,8 +127,6 @@ public class FedexDataInterface { |
| 128 | return result; | 127 | return result; |
| 129 | } | 128 | } |
| 130 | 129 | ||
| 131 | - | ||
| 132 | - | ||
| 133 | @ApiOperation(value = "Fedex推送运单数据", httpMethod = "POST", notes = "ex: http://192.168.1.75:8080/fedex/sendMawbFedex") | 130 | @ApiOperation(value = "Fedex推送运单数据", httpMethod = "POST", notes = "ex: http://192.168.1.75:8080/fedex/sendMawbFedex") |
| 134 | @PostMapping("/sendMawbFedex") | 131 | @PostMapping("/sendMawbFedex") |
| 135 | @ResponseBody | 132 | @ResponseBody |
| ... | @@ -139,8 +136,8 @@ public class FedexDataInterface { | ... | @@ -139,8 +136,8 @@ public class FedexDataInterface { |
| 139 | ResultRS result = new ResultRS(Boolean.FALSE,"",""); | 136 | ResultRS result = new ResultRS(Boolean.FALSE,"",""); |
| 140 | 137 | ||
| 141 | if(Objects.equals(fedexc,null)){ | 138 | if(Objects.equals(fedexc,null)){ |
| 142 | - result.setCode("-7"); | 139 | + result.setCode(ErrorCodeEnum.ERROR_7.getCode()); |
| 143 | - result.setMsg("请求信息不能为空"); | 140 | + result.setMsg(ErrorCodeEnum.ERROR_7.getName()); |
| 144 | return result; | 141 | return result; |
| 145 | } | 142 | } |
| 146 | //1、保存请求信息,保存到iClear的 SQLServer | 143 | //1、保存请求信息,保存到iClear的 SQLServer |
| ... | @@ -189,7 +186,6 @@ public class FedexDataInterface { | ... | @@ -189,7 +186,6 @@ public class FedexDataInterface { |
| 189 | // } | 186 | // } |
| 190 | // sw.stop(); | 187 | // sw.stop(); |
| 191 | 188 | ||
| 192 | - | ||
| 193 | //4、保存运单到iclear中 | 189 | //4、保存运单到iclear中 |
| 194 | sw.start("processChmConsignment"); | 190 | sw.start("processChmConsignment"); |
| 195 | result = chmConsignmentService.processChmConsignmentFedex(saveMawbFedexResult, timeStamp,appId); | 191 | result = chmConsignmentService.processChmConsignmentFedex(saveMawbFedexResult, timeStamp,appId); |
| ... | @@ -216,10 +212,8 @@ public class FedexDataInterface { | ... | @@ -216,10 +212,8 @@ public class FedexDataInterface { |
| 216 | headerMap.put("Content-Type", "application/json"); | 212 | headerMap.put("Content-Type", "application/json"); |
| 217 | String json = HttpUtils.doPost(this.iclearCSubmitUrl,objJson,headerMap); | 213 | String json = HttpUtils.doPost(this.iclearCSubmitUrl,objJson,headerMap); |
| 218 | 214 | ||
| 219 | - | ||
| 220 | log.info("<<<<<<<< checkfedexMawb start >>>>>>>>>> result :" +result.getSuccess() +" iclear check response : " + json + " status : " + result.getSuccess()); | 215 | log.info("<<<<<<<< checkfedexMawb start >>>>>>>>>> result :" +result.getSuccess() +" iclear check response : " + json + " status : " + result.getSuccess()); |
| 221 | 216 | ||
| 222 | - | ||
| 223 | //5、更新日志 | 217 | //5、更新日志 |
| 224 | sw.start("updateIClearApiLog"); | 218 | sw.start("updateIClearApiLog"); |
| 225 | if(!Objects.equals(saveIClearApiLogResult,null)){ | 219 | if(!Objects.equals(saveIClearApiLogResult,null)){ |
| ... | @@ -236,7 +230,7 @@ public class FedexDataInterface { | ... | @@ -236,7 +230,7 @@ public class FedexDataInterface { |
| 236 | 230 | ||
| 237 | //6、return result | 231 | //6、return result |
| 238 | result.setSuccess(Boolean.TRUE); | 232 | result.setSuccess(Boolean.TRUE); |
| 239 | - result.setCode("0"); | 233 | + result.setCode(ErrorCodeEnum.SUCCESS.getCode()); |
| 240 | return result; | 234 | return result; |
| 241 | } | 235 | } |
| 242 | 236 | ||
| ... | @@ -250,13 +244,13 @@ public class FedexDataInterface { | ... | @@ -250,13 +244,13 @@ public class FedexDataInterface { |
| 250 | //获取请求的运单号 | 244 | //获取请求的运单号 |
| 251 | String[] splitConsignment = StringUtil.split(consignmentCode.getConsignmentCode(),","); | 245 | String[] splitConsignment = StringUtil.split(consignmentCode.getConsignmentCode(),","); |
| 252 | if(splitConsignment.length > 20){ | 246 | if(splitConsignment.length > 20){ |
| 253 | - result.setCode("30001"); | 247 | + result.setCode(ErrorCodeEnum.ERROR_30001.getCode()); |
| 254 | result.setMsg("请求信息不能大于20条运单"); | 248 | result.setMsg("请求信息不能大于20条运单"); |
| 255 | return result; | 249 | return result; |
| 256 | } | 250 | } |
| 257 | if(splitConsignment.length<1){ | 251 | if(splitConsignment.length<1){ |
| 258 | - result.setCode("-7"); | 252 | + result.setCode(ErrorCodeEnum.ERROR_7.getCode()); |
| 259 | - result.setMsg("请求信息不能为空"); | 253 | + result.setMsg(ErrorCodeEnum.ERROR_7.getName()); |
| 260 | return result; | 254 | return result; |
| 261 | } | 255 | } |
| 262 | StopWatch sw = new StopWatch("receice mawbFedex"); | 256 | StopWatch sw = new StopWatch("receice mawbFedex"); |
| ... | @@ -295,7 +289,7 @@ public class FedexDataInterface { | ... | @@ -295,7 +289,7 @@ public class FedexDataInterface { |
| 295 | log.info("Fedex申报数据请求成功!"); | 289 | log.info("Fedex申报数据请求成功!"); |
| 296 | //6、return result | 290 | //6、return result |
| 297 | result.setSuccess(Boolean.TRUE); | 291 | result.setSuccess(Boolean.TRUE); |
| 298 | - result.setCode("0"); | 292 | + result.setCode(ErrorCodeEnum.SUCCESS.getCode()); |
| 299 | return result; | 293 | return result; |
| 300 | } | 294 | } |
| 301 | 295 | ||
| ... | @@ -309,13 +303,13 @@ public class FedexDataInterface { | ... | @@ -309,13 +303,13 @@ public class FedexDataInterface { |
| 309 | //获取请求的运单号 | 303 | //获取请求的运单号 |
| 310 | String[] splitConsignment = StringUtil.split(consignmentCode.getConsignmentCode(),","); | 304 | String[] splitConsignment = StringUtil.split(consignmentCode.getConsignmentCode(),","); |
| 311 | if(splitConsignment.length > 20){ | 305 | if(splitConsignment.length > 20){ |
| 312 | - result.setCode("30001"); | 306 | + result.setCode(ErrorCodeEnum.ERROR_30001.getCode()); |
| 313 | result.setMsg("请求信息不能大于20条运单"); | 307 | result.setMsg("请求信息不能大于20条运单"); |
| 314 | return result; | 308 | return result; |
| 315 | } | 309 | } |
| 316 | if(splitConsignment.length<1){ | 310 | if(splitConsignment.length<1){ |
| 317 | - result.setCode("-7"); | 311 | + result.setCode(ErrorCodeEnum.ERROR_7.getCode()); |
| 318 | - result.setMsg("请求信息不能为空"); | 312 | + result.setMsg(ErrorCodeEnum.ERROR_7.getName()); |
| 319 | return result; | 313 | return result; |
| 320 | } | 314 | } |
| 321 | StopWatch sw = new StopWatch("receice mawbFedex"); | 315 | StopWatch sw = new StopWatch("receice mawbFedex"); |
| ... | @@ -354,8 +348,7 @@ public class FedexDataInterface { | ... | @@ -354,8 +348,7 @@ public class FedexDataInterface { |
| 354 | log.info("Fedex回执数据请求成功!"); | 348 | log.info("Fedex回执数据请求成功!"); |
| 355 | //6、return result | 349 | //6、return result |
| 356 | result.setSuccess(Boolean.TRUE); | 350 | result.setSuccess(Boolean.TRUE); |
| 357 | - result.setCode("0"); | 351 | + result.setCode(ErrorCodeEnum.SUCCESS.getCode()); |
| 358 | return result; | 352 | return result; |
| 359 | } | 353 | } |
| 360 | - | ||
| 361 | } | 354 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| 1 | package com.erry.iclear.dateInterface.api; | 1 | package com.erry.iclear.dateInterface.api; |
| 2 | 2 | ||
| 3 | +import com.erry.iclear.dateInterface.ErrorCodeEnum; | ||
| 3 | import com.erry.iclear.dateInterface.api.request.HsCodeParam; | 4 | import com.erry.iclear.dateInterface.api.request.HsCodeParam; |
| 4 | import com.erry.iclear.dateInterface.api.response.ResultHsCode; | 5 | import com.erry.iclear.dateInterface.api.response.ResultHsCode; |
| 5 | import com.erry.iclear.dateInterface.entity.IClearApiHsCodeLog; | 6 | import com.erry.iclear.dateInterface.entity.IClearApiHsCodeLog; |
| ... | @@ -28,7 +29,7 @@ public class HsCodeInterface { | ... | @@ -28,7 +29,7 @@ public class HsCodeInterface { |
| 28 | @Autowired | 29 | @Autowired |
| 29 | IClearApiHsCodeLogService iClearApiHsCodeLogService; | 30 | IClearApiHsCodeLogService iClearApiHsCodeLogService; |
| 30 | 31 | ||
| 31 | - @ApiOperation(value = "获取hscode数据", httpMethod = "POST", notes = "ex: http://192.168.1.71:8080/hscode/hscodeRequest") | 32 | + @ApiOperation(value = "获取最新HS Code信息接口", httpMethod = "POST", notes = "ex: http://192.168.1.71:8080/hscode/hscodeRequest") |
| 32 | @PostMapping("/hscodeRequest") | 33 | @PostMapping("/hscodeRequest") |
| 33 | @ResponseBody | 34 | @ResponseBody |
| 34 | public ResultHsCode hscodeRequest(HttpServletRequest request | 35 | public ResultHsCode hscodeRequest(HttpServletRequest request |
| ... | @@ -48,11 +49,10 @@ public class HsCodeInterface { | ... | @@ -48,11 +49,10 @@ public class HsCodeInterface { |
| 48 | resultHsCode = hsCodeService.findHsCodeListByCode(hscode.getHscode()); | 49 | resultHsCode = hsCodeService.findHsCodeListByCode(hscode.getHscode()); |
| 49 | return resultHsCode; | 50 | return resultHsCode; |
| 50 | } else { | 51 | } else { |
| 51 | - | ||
| 52 | //如果没有传hscode需要限制10分钟只能查询一次 | 52 | //如果没有传hscode需要限制10分钟只能查询一次 |
| 53 | - boolean rs = iClearApiHsCodeLogService.findIClearApiHsCodeLog(); | 53 | + boolean rs = iClearApiHsCodeLogService.findIClearApiHsCodeLog(appId); |
| 54 | if(rs == true){ | 54 | if(rs == true){ |
| 55 | - resultHsCode = new ResultHsCode(Boolean.FALSE,"10019","未指定hscode编码,10分钟之内只允许查询一次",null); | 55 | + resultHsCode = new ResultHsCode(Boolean.FALSE, ErrorCodeEnum.ERROR_10019.getCode(),ErrorCodeEnum.ERROR_10019.getName(),null); |
| 56 | }else{ | 56 | }else{ |
| 57 | resultHsCode = hsCodeService.findAllHsCodeList(); | 57 | resultHsCode = hsCodeService.findAllHsCodeList(); |
| 58 | } | 58 | } |
| ... | @@ -60,7 +60,7 @@ public class HsCodeInterface { | ... | @@ -60,7 +60,7 @@ public class HsCodeInterface { |
| 60 | } | 60 | } |
| 61 | }catch(Exception ex){ | 61 | }catch(Exception ex){ |
| 62 | log.error(ex.getMessage(),ex); | 62 | log.error(ex.getMessage(),ex); |
| 63 | - resultHsCode = new ResultHsCode(Boolean.FALSE,"30101","数据查询异常",null); | 63 | + resultHsCode = new ResultHsCode(Boolean.FALSE,ErrorCodeEnum.ERROR_30101.getCode(),ErrorCodeEnum.ERROR_30101.getName(),null); |
| 64 | return resultHsCode; | 64 | return resultHsCode; |
| 65 | }finally { | 65 | }finally { |
| 66 | iclearApiHsCodeLog.setReceiveResult(resultHsCode.getMsg()); | 66 | iclearApiHsCodeLog.setReceiveResult(resultHsCode.getMsg()); |
| ... | @@ -69,10 +69,51 @@ public class HsCodeInterface { | ... | @@ -69,10 +69,51 @@ public class HsCodeInterface { |
| 69 | long end = System.currentTimeMillis(); | 69 | long end = System.currentTimeMillis(); |
| 70 | iclearApiHsCodeLog.setSpendTime(end-begin); | 70 | iclearApiHsCodeLog.setSpendTime(end-begin); |
| 71 | //如果异常为hscode长度超过2000,将截取0到2000字符 | 71 | //如果异常为hscode长度超过2000,将截取0到2000字符 |
| 72 | - if(resultHsCode.getCode().equals("30102")){ | 72 | + if(resultHsCode.getCode().equals(ErrorCodeEnum.ERROR_30102.getCode())){ |
| 73 | - iclearApiHsCodeLog.setCode(iclearApiHsCodeLog.getCode().substring(0,2000)); | 73 | + iclearApiHsCodeLog.setCode(hscode.getHscode().substring(0,2000)); |
| 74 | + } | ||
| 75 | + iClearApiHsCodeLogService.saveIClearApiHsCodeLog(iclearApiHsCodeLog); | ||
| 76 | + } | ||
| 77 | + } | ||
| 78 | + | ||
| 79 | + @ApiOperation(value = "HSCODE通用模糊查询接口", httpMethod = "POST", notes = "ex: http://192.168.1.71:8080/hscode/fuzzyQuery") | ||
| 80 | + @PostMapping("/fuzzyQuery") | ||
| 81 | + @ResponseBody | ||
| 82 | + public ResultHsCode fuzzyQueryHsCode(HttpServletRequest request | ||
| 83 | + , @RequestBody HsCodeParam hscode) { | ||
| 84 | + log.info("接收到请求数据skuCode:【"+hscode.getSkuCode()+"】,skuName:【"+hscode.getSkuName()+"】"); | ||
| 85 | + String appId = (String) request.getHeader("Appid"); | ||
| 86 | + String appkey = (String) request.getHeader("Appkey"); | ||
| 87 | + IClearApiHsCodeLog iclearApiHsCodeLog = new IClearApiHsCodeLog(); | ||
| 88 | + ResultHsCode resultHsCode = null; | ||
| 89 | + long begin = System.currentTimeMillis(); | ||
| 90 | + try { | ||
| 91 | + iclearApiHsCodeLog.setAppId(appId); | ||
| 92 | + iclearApiHsCodeLog.setAppKey(appkey); | ||
| 93 | + iclearApiHsCodeLog.setCreateTime(new Date()); | ||
| 94 | + resultHsCode = hsCodeService.fuzzyQueryHsCode(hscode); | ||
| 95 | + iclearApiHsCodeLog.setReceiveResult(resultHsCode.getMsg()); | ||
| 96 | + iclearApiHsCodeLog.setErrorCode(resultHsCode.getCode()); | ||
| 97 | + iclearApiHsCodeLog.setResponseTime(new Date()); | ||
| 98 | + long end = System.currentTimeMillis(); | ||
| 99 | + iclearApiHsCodeLog.setSpendTime(end-begin); | ||
| 100 | + String skuCode = hscode.getSkuCode(); | ||
| 101 | + if(!StringUtil.isEmpty(skuCode)){ | ||
| 102 | + skuCode = skuCode.substring(0,50); | ||
| 103 | + } | ||
| 104 | + String skuName = hscode.getSkuName(); | ||
| 105 | + if(!StringUtil.isEmpty(skuName)){ | ||
| 106 | + skuName = skuName.substring(0,50); | ||
| 74 | } | 107 | } |
| 108 | + iclearApiHsCodeLog.setCode("[skuCode="+skuCode+"],[skuName="+skuName+"]"); | ||
| 75 | iClearApiHsCodeLogService.saveIClearApiHsCodeLog(iclearApiHsCodeLog); | 109 | iClearApiHsCodeLogService.saveIClearApiHsCodeLog(iclearApiHsCodeLog); |
| 110 | + return resultHsCode; | ||
| 111 | + }catch(Exception ex){ | ||
| 112 | + log.error(ex.getMessage(),ex); | ||
| 113 | + resultHsCode = new ResultHsCode(Boolean.FALSE,ErrorCodeEnum.ERROR_30101.getCode(),ErrorCodeEnum.ERROR_30101.getName(),null); | ||
| 114 | + return resultHsCode; | ||
| 115 | + }finally{ | ||
| 116 | + return resultHsCode; | ||
| 76 | } | 117 | } |
| 77 | } | 118 | } |
| 78 | } | 119 | } | ... | ... |
| ... | @@ -15,4 +15,8 @@ import java.io.Serializable; | ... | @@ -15,4 +15,8 @@ import java.io.Serializable; |
| 15 | public class HsCodeParam implements Serializable { | 15 | public class HsCodeParam implements Serializable { |
| 16 | private static final long serialVersionUID = 786697399667065141L; | 16 | private static final long serialVersionUID = 786697399667065141L; |
| 17 | String hscode; | 17 | String hscode; |
| 18 | + //hscode编码 | ||
| 19 | + String skuCode; | ||
| 20 | + //商品名称 | ||
| 21 | + String skuName; | ||
| 18 | } | 22 | } | ... | ... |
| ... | @@ -21,6 +21,4 @@ public class BaseModel implements Serializable { | ... | @@ -21,6 +21,4 @@ public class BaseModel implements Serializable { |
| 21 | public void setId(Long id) { | 21 | public void setId(Long id) { |
| 22 | this.id = id; | 22 | this.id = id; |
| 23 | } | 23 | } |
| 24 | - | ||
| 25 | - | ||
| 26 | } | 24 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| 1 | -package com.erry.iclear.dateInterface.common; | ||
| 2 | - | ||
| 3 | -/** | ||
| 4 | - * 常量 | ||
| 5 | - * mt | ||
| 6 | - * 2021年7月29日13:34:15 | ||
| 7 | - */ | ||
| 8 | -public interface Constants { | ||
| 9 | - /** | ||
| 10 | - * api响应码 | ||
| 11 | - */ | ||
| 12 | - public static interface ApiResponseKeys{ | ||
| 13 | - //成功 | ||
| 14 | - public static final String SUCCESS = "0"; | ||
| 15 | - //用户或密码不正确 | ||
| 16 | - public static final String KEY_10001 = "10001"; | ||
| 17 | - //用户不存在 | ||
| 18 | - public static final String KEY_10002 = "10002"; | ||
| 19 | - //账号已过期 | ||
| 20 | - public static final String KEY_10003 = "10003"; | ||
| 21 | - //凭证已过期 | ||
| 22 | - public static final String KEY_10004 = "10004"; | ||
| 23 | - //账号已禁用 | ||
| 24 | - public static final String KEY_10005 = "10005"; | ||
| 25 | - //用户凭证无效 | ||
| 26 | - public static final String KEY_10013 = "10013"; | ||
| 27 | - } | ||
| 28 | -} |
| ... | @@ -16,9 +16,7 @@ public class JsonDateTimeSerializer extends JsonSerializer<Date> { | ... | @@ -16,9 +16,7 @@ public class JsonDateTimeSerializer extends JsonSerializer<Date> { |
| 16 | @Override | 16 | @Override |
| 17 | public void serialize(Date date, JsonGenerator gen, SerializerProvider provider) | 17 | public void serialize(Date date, JsonGenerator gen, SerializerProvider provider) |
| 18 | throws IOException, JsonProcessingException { | 18 | throws IOException, JsonProcessingException { |
| 19 | - | ||
| 20 | String formattedDate = dateFormat.format(date); | 19 | String formattedDate = dateFormat.format(date); |
| 21 | - | ||
| 22 | gen.writeString(formattedDate); | 20 | gen.writeString(formattedDate); |
| 23 | } | 21 | } |
| 24 | } | 22 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -48,7 +48,6 @@ public class IClearExportInterface { | ... | @@ -48,7 +48,6 @@ public class IClearExportInterface { |
| 48 | public String refreshSendMawbe() { | 48 | public String refreshSendMawbe() { |
| 49 | try{ | 49 | try{ |
| 50 | 50 | ||
| 51 | - | ||
| 52 | return "Success"; | 51 | return "Success"; |
| 53 | }catch (Exception e){ | 52 | }catch (Exception e){ |
| 54 | log.error("refreshCache() error:"+e.getMessage()); | 53 | log.error("refreshCache() error:"+e.getMessage()); | ... | ... |
| 1 | package com.erry.iclear.dateInterface.interceptor; | 1 | package com.erry.iclear.dateInterface.interceptor; |
| 2 | 2 | ||
| 3 | import com.alibaba.fastjson.JSON; | 3 | import com.alibaba.fastjson.JSON; |
| 4 | +import com.erry.iclear.dateInterface.ErrorCodeEnum; | ||
| 4 | import com.erry.iclear.dateInterface.api.response.ResultHsCode; | 5 | import com.erry.iclear.dateInterface.api.response.ResultHsCode; |
| 5 | import com.erry.iclear.dateInterface.api.response.ResultRS; | 6 | import com.erry.iclear.dateInterface.api.response.ResultRS; |
| 6 | import com.erry.iclear.dateInterface.common.Constant; | 7 | import com.erry.iclear.dateInterface.common.Constant; |
| ... | @@ -36,40 +37,40 @@ public class HsCodeInterceptor extends HandlerInterceptorAdapter { | ... | @@ -36,40 +37,40 @@ public class HsCodeInterceptor extends HandlerInterceptorAdapter { |
| 36 | //String uri = request.getRequestURI(); | 37 | //String uri = request.getRequestURI(); |
| 37 | 38 | ||
| 38 | if(StringUtils.isBlank(appId)){ | 39 | if(StringUtils.isBlank(appId)){ |
| 39 | - this.returnJson(response,false,"10016","Appid 不能为空"); | 40 | + this.returnJson(response,false, ErrorCodeEnum.ERROR_10016.getCode(),ErrorCodeEnum.ERROR_10016.getName()); |
| 40 | return false; | 41 | return false; |
| 41 | } | 42 | } |
| 42 | 43 | ||
| 43 | if(StringUtils.isBlank(appkey)){ | 44 | if(StringUtils.isBlank(appkey)){ |
| 44 | - this.returnJson(response,false,"10017","Appkey 不能为空"); | 45 | + this.returnJson(response,false,ErrorCodeEnum.ERROR_10017.getCode(),ErrorCodeEnum.ERROR_10017.getName()); |
| 45 | return false; | 46 | return false; |
| 46 | } | 47 | } |
| 47 | 48 | ||
| 48 | if(StringUtils.isBlank(timeStamp)){ | 49 | if(StringUtils.isBlank(timeStamp)){ |
| 49 | - this.returnJson(response,false,"10018","TimeStamp 不能为空"); | 50 | + this.returnJson(response,false,ErrorCodeEnum.ERROR_10018.getCode(),ErrorCodeEnum.ERROR_10018.getName()); |
| 50 | return false; | 51 | return false; |
| 51 | } | 52 | } |
| 52 | 53 | ||
| 53 | if(StringUtils.isBlank(token)){ | 54 | if(StringUtils.isBlank(token)){ |
| 54 | - this.returnJson(response,false,"10013","token 不能为空"); | 55 | + this.returnJson(response,false,ErrorCodeEnum.ERROR_10013.getCode(),ErrorCodeEnum.ERROR_10013.getName()); |
| 55 | return false; | 56 | return false; |
| 56 | } | 57 | } |
| 57 | 58 | ||
| 58 | HashMap<String,String> secretMap = Constant.appIdSecurityCache.get(appId); | 59 | HashMap<String,String> secretMap = Constant.appIdSecurityCache.get(appId); |
| 59 | if(secretMap==null){ | 60 | if(secretMap==null){ |
| 60 | - this.returnJson(response,false,"10001","系统异常,该appId没有注册"); | 61 | + this.returnJson(response,false,ErrorCodeEnum.ERROR_10001.getCode(),ErrorCodeEnum.ERROR_10001.getName()); |
| 61 | return false; | 62 | return false; |
| 62 | } | 63 | } |
| 63 | 64 | ||
| 64 | String secretInSys = secretMap.get(appkey); | 65 | String secretInSys = secretMap.get(appkey); |
| 65 | if (StringUtils.isBlank(secretInSys)) { | 66 | if (StringUtils.isBlank(secretInSys)) { |
| 66 | - this.returnJson(response,false,"10002","系统异常,该appId没有当前Appkey的权限"); | 67 | + this.returnJson(response,false,ErrorCodeEnum.ERROR_10002.getCode(),ErrorCodeEnum.ERROR_10002.getName()); |
| 67 | return false; | 68 | return false; |
| 68 | } | 69 | } |
| 69 | 70 | ||
| 70 | String sha256Str = SHA256Util.getSHA256String(appId+appkey+secretInSys+timeStamp); | 71 | String sha256Str = SHA256Util.getSHA256String(appId+appkey+secretInSys+timeStamp); |
| 71 | if(!token.equals(sha256Str)){ | 72 | if(!token.equals(sha256Str)){ |
| 72 | - this.returnJson(response,false,"10014","Token验证失败"); | 73 | + this.returnJson(response,false,ErrorCodeEnum.ERROR_10014.getCode(),ErrorCodeEnum.ERROR_10014.getName()); |
| 73 | return false; | 74 | return false; |
| 74 | } | 75 | } |
| 75 | return true; | 76 | return true; |
| ... | @@ -99,5 +100,4 @@ public class HsCodeInterceptor extends HandlerInterceptorAdapter { | ... | @@ -99,5 +100,4 @@ public class HsCodeInterceptor extends HandlerInterceptorAdapter { |
| 99 | } | 100 | } |
| 100 | } | 101 | } |
| 101 | } | 102 | } |
| 102 | - | ||
| 103 | } | 103 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| 1 | package com.erry.iclear.dateInterface.interceptor; | 1 | package com.erry.iclear.dateInterface.interceptor; |
| 2 | 2 | ||
| 3 | import com.alibaba.fastjson.JSON; | 3 | import com.alibaba.fastjson.JSON; |
| 4 | +import com.erry.iclear.dateInterface.ErrorCodeEnum; | ||
| 4 | import com.erry.iclear.dateInterface.api.response.ResultRS; | 5 | import com.erry.iclear.dateInterface.api.response.ResultRS; |
| 5 | import com.erry.iclear.dateInterface.common.Constant; | 6 | import com.erry.iclear.dateInterface.common.Constant; |
| 6 | import com.erry.iclear.dateInterface.util.SHA256Util; | 7 | import com.erry.iclear.dateInterface.util.SHA256Util; |
| ... | @@ -35,40 +36,40 @@ public class SignInterceptor extends HandlerInterceptorAdapter { | ... | @@ -35,40 +36,40 @@ public class SignInterceptor extends HandlerInterceptorAdapter { |
| 35 | 36 | ||
| 36 | 37 | ||
| 37 | if(StringUtils.isBlank(appId)){ | 38 | if(StringUtils.isBlank(appId)){ |
| 38 | - this.returnJson(response,false,"10016","Appid 不能为空"); | 39 | + this.returnJson(response,false, ErrorCodeEnum.ERROR_10016.getCode(),ErrorCodeEnum.ERROR_10016.getName()); |
| 39 | return false; | 40 | return false; |
| 40 | } | 41 | } |
| 41 | 42 | ||
| 42 | if(StringUtils.isBlank(appkey)){ | 43 | if(StringUtils.isBlank(appkey)){ |
| 43 | - this.returnJson(response,false,"10017","Appkey 不能为空"); | 44 | + this.returnJson(response,false,ErrorCodeEnum.ERROR_10017.getCode(),ErrorCodeEnum.ERROR_10017.getName()); |
| 44 | return false; | 45 | return false; |
| 45 | } | 46 | } |
| 46 | 47 | ||
| 47 | if(StringUtils.isBlank(timeStamp)){ | 48 | if(StringUtils.isBlank(timeStamp)){ |
| 48 | - this.returnJson(response,false,"10018","TimeStamp 不能为空"); | 49 | + this.returnJson(response,false,ErrorCodeEnum.ERROR_10018.getCode(),ErrorCodeEnum.ERROR_10018.getName()); |
| 49 | return false; | 50 | return false; |
| 50 | } | 51 | } |
| 51 | 52 | ||
| 52 | if(StringUtils.isBlank(token)){ | 53 | if(StringUtils.isBlank(token)){ |
| 53 | - this.returnJson(response,false,"10013","token 不能为空"); | 54 | + this.returnJson(response,false,ErrorCodeEnum.ERROR_10013.getCode(),ErrorCodeEnum.ERROR_10013.getName()); |
| 54 | return false; | 55 | return false; |
| 55 | } | 56 | } |
| 56 | 57 | ||
| 57 | HashMap<String,String> secretMap = Constant.appIdSecurityCache.get(appId); | 58 | HashMap<String,String> secretMap = Constant.appIdSecurityCache.get(appId); |
| 58 | if(secretMap==null){ | 59 | if(secretMap==null){ |
| 59 | - this.returnJson(response,false,"10001","系统异常,该appId没有注册"); | 60 | + this.returnJson(response,false,ErrorCodeEnum.ERROR_10001.getCode(),ErrorCodeEnum.ERROR_10001.getName()); |
| 60 | return false; | 61 | return false; |
| 61 | } | 62 | } |
| 62 | 63 | ||
| 63 | String secretInSys = secretMap.get(appkey); | 64 | String secretInSys = secretMap.get(appkey); |
| 64 | if (StringUtils.isBlank(secretInSys)) { | 65 | if (StringUtils.isBlank(secretInSys)) { |
| 65 | - this.returnJson(response,false,"10002","系统异常,该appId没有当前Appkey的权限"); | 66 | + this.returnJson(response,false,ErrorCodeEnum.ERROR_10002.getCode(),ErrorCodeEnum.ERROR_10002.getName()); |
| 66 | return false; | 67 | return false; |
| 67 | } | 68 | } |
| 68 | 69 | ||
| 69 | String sha256Str = SHA256Util.getSHA256String(appId+appkey+secretInSys+timeStamp); | 70 | String sha256Str = SHA256Util.getSHA256String(appId+appkey+secretInSys+timeStamp); |
| 70 | if(!token.equals(sha256Str)){ | 71 | if(!token.equals(sha256Str)){ |
| 71 | - this.returnJson(response,false,"10014","Token验证失败"); | 72 | + this.returnJson(response,false,ErrorCodeEnum.ERROR_10014.getCode(),ErrorCodeEnum.ERROR_10014.getName()); |
| 72 | return false; | 73 | return false; |
| 73 | } | 74 | } |
| 74 | return true; | 75 | return true; |
| ... | @@ -98,5 +99,4 @@ public class SignInterceptor extends HandlerInterceptorAdapter { | ... | @@ -98,5 +99,4 @@ public class SignInterceptor extends HandlerInterceptorAdapter { |
| 98 | } | 99 | } |
| 99 | } | 100 | } |
| 100 | } | 101 | } |
| 101 | - | ||
| 102 | } | 102 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -28,6 +28,6 @@ public interface IClearApiHsCodeLogRepository extends JpaRepository<IClearApiHsC | ... | @@ -28,6 +28,6 @@ public interface IClearApiHsCodeLogRepository extends JpaRepository<IClearApiHsC |
| 28 | * @param createTime yyyy-MM-dd HH:mm | 28 | * @param createTime yyyy-MM-dd HH:mm |
| 29 | * @return | 29 | * @return |
| 30 | */ | 30 | */ |
| 31 | - @Query(nativeQuery = true,value = "select count(1) from T_ICLEAR_API_HSCODE_LOG where CREATE_TIME > ? AND (CODE IS NULL OR CODE = '')") | 31 | + @Query(nativeQuery = true,value = "select count(1) from T_ICLEAR_API_HSCODE_LOG where CREATE_TIME > ?1 AND APPID = ?2 AND (CODE IS NULL OR CODE = '')") |
| 32 | - public Long findIClearApiHsCodeLog(String createTime); | 32 | + public Long findIClearApiHsCodeLog(String createTime,String appId); |
| 33 | } | 33 | } | ... | ... |
| 1 | package com.erry.iclear.dateInterface.service; | 1 | package com.erry.iclear.dateInterface.service; |
| 2 | 2 | ||
| 3 | +import com.erry.iclear.dateInterface.ErrorCodeEnum; | ||
| 3 | import com.erry.iclear.dateInterface.api.request.Mawb; | 4 | import com.erry.iclear.dateInterface.api.request.Mawb; |
| 4 | import com.erry.iclear.dateInterface.api.request.MawbDetail; | 5 | import com.erry.iclear.dateInterface.api.request.MawbDetail; |
| 5 | import com.erry.iclear.dateInterface.api.request.ReceiptMessage; | 6 | import com.erry.iclear.dateInterface.api.request.ReceiptMessage; |
| 6 | import com.erry.iclear.dateInterface.api.response.TokenResult; | 7 | import com.erry.iclear.dateInterface.api.response.TokenResult; |
| 7 | -import com.erry.iclear.dateInterface.common.Constants; | ||
| 8 | import com.erry.iclear.dateInterface.entity.ChmConsignment; | 8 | import com.erry.iclear.dateInterface.entity.ChmConsignment; |
| 9 | import com.erry.iclear.dateInterface.entity.ChmConsignmentDetail; | 9 | import com.erry.iclear.dateInterface.entity.ChmConsignmentDetail; |
| 10 | import com.erry.iclear.dateInterface.entity.DeclearTask; | 10 | import com.erry.iclear.dateInterface.entity.DeclearTask; |
| ... | @@ -16,28 +16,12 @@ import com.erry.iclear.dateInterface.util.DateUtils; | ... | @@ -16,28 +16,12 @@ import com.erry.iclear.dateInterface.util.DateUtils; |
| 16 | import com.erry.iclear.dateInterface.util.HttpUtils; | 16 | import com.erry.iclear.dateInterface.util.HttpUtils; |
| 17 | import com.erry.iclear.dateInterface.util.JsonToJava; | 17 | import com.erry.iclear.dateInterface.util.JsonToJava; |
| 18 | import lombok.extern.slf4j.Slf4j; | 18 | import lombok.extern.slf4j.Slf4j; |
| 19 | -import org.apache.http.Header; | ||
| 20 | -import org.apache.http.HttpEntity; | ||
| 21 | -import org.apache.http.HttpResponse; | ||
| 22 | -import org.apache.http.client.config.RequestConfig; | ||
| 23 | -import org.apache.http.client.methods.HttpPost; | ||
| 24 | -import org.apache.http.conn.ssl.SSLConnectionSocketFactory; | ||
| 25 | -import org.apache.http.entity.ContentType; | ||
| 26 | -import org.apache.http.entity.StringEntity; | ||
| 27 | -import org.apache.http.impl.client.CloseableHttpClient; | ||
| 28 | -import org.apache.http.impl.client.HttpClients; | ||
| 29 | -import org.apache.http.ssl.SSLContexts; | ||
| 30 | -import org.apache.http.util.EntityUtils; | ||
| 31 | import org.springframework.beans.factory.annotation.Autowired; | 19 | import org.springframework.beans.factory.annotation.Autowired; |
| 32 | import org.springframework.beans.factory.annotation.Value; | 20 | import org.springframework.beans.factory.annotation.Value; |
| 33 | import org.springframework.stereotype.Service; | 21 | import org.springframework.stereotype.Service; |
| 34 | 22 | ||
| 35 | -import javax.net.ssl.SSLContext; | ||
| 36 | import javax.transaction.Transactional; | 23 | import javax.transaction.Transactional; |
| 37 | -import java.io.IOException; | ||
| 38 | import java.math.BigDecimal; | 24 | import java.math.BigDecimal; |
| 39 | -import java.security.KeyManagementException; | ||
| 40 | -import java.security.NoSuchAlgorithmException; | ||
| 41 | import java.util.*; | 25 | import java.util.*; |
| 42 | 26 | ||
| 43 | /** | 27 | /** |
| ... | @@ -160,12 +144,12 @@ public class ApiService { | ... | @@ -160,12 +144,12 @@ public class ApiService { |
| 160 | //接口响应时间 | 144 | //接口响应时间 |
| 161 | declearTask.setResponseTime(new Date()); | 145 | declearTask.setResponseTime(new Date()); |
| 162 | TokenResult tokenResult = JsonToJava.parseJson(json,TokenResult.class); | 146 | TokenResult tokenResult = JsonToJava.parseJson(json,TokenResult.class); |
| 163 | - if(tokenResult.getErrorcode().equals(Constants.ApiResponseKeys.SUCCESS)){ | 147 | + if(tokenResult.getErrorcode().equals(ErrorCodeEnum.SUCCESS.getCode())){ |
| 164 | //推送成功,记录推送状态 | 148 | //推送成功,记录推送状态 |
| 165 | declearTask.setResponseResults(tokenResult.getErrorcode()); | 149 | declearTask.setResponseResults(tokenResult.getErrorcode()); |
| 166 | declearTask.setResponseContent(tokenResult.getErrormessage()); | 150 | declearTask.setResponseContent(tokenResult.getErrormessage()); |
| 167 | declearTaskList.add(declearTask); | 151 | declearTaskList.add(declearTask); |
| 168 | - }else if(tokenResult.getErrorcode().equals(Constants.ApiResponseKeys.KEY_10004) || tokenResult.getErrorcode().equals(Constants.ApiResponseKeys.KEY_10013)){ | 152 | + }else if(tokenResult.getErrorcode().equals(ErrorCodeEnum.ERROR_10004.getCode()) || tokenResult.getErrorcode().equals(ErrorCodeEnum.ERROR_10013.getCode())){ |
| 169 | //如果凭证失效,则刷新凭证 | 153 | //如果凭证失效,则刷新凭证 |
| 170 | refreshToken(token); | 154 | refreshToken(token); |
| 171 | }else{ | 155 | }else{ |
| ... | @@ -259,12 +243,12 @@ public class ApiService { | ... | @@ -259,12 +243,12 @@ public class ApiService { |
| 259 | //接口响应时间 | 243 | //接口响应时间 |
| 260 | declearTask.setResponseTime(new Date()); | 244 | declearTask.setResponseTime(new Date()); |
| 261 | TokenResult tokenResult = JsonToJava.parseJson(json,TokenResult.class); | 245 | TokenResult tokenResult = JsonToJava.parseJson(json,TokenResult.class); |
| 262 | - if(tokenResult.getErrorcode().equals(Constants.ApiResponseKeys.SUCCESS)){ | 246 | + if(tokenResult.getErrorcode().equals(ErrorCodeEnum.SUCCESS.getCode())){ |
| 263 | //推送成功,记录推送状态 | 247 | //推送成功,记录推送状态 |
| 264 | declearTask.setResponseResults(tokenResult.getErrorcode()); | 248 | declearTask.setResponseResults(tokenResult.getErrorcode()); |
| 265 | declearTask.setResponseContent(tokenResult.getErrormessage()); | 249 | declearTask.setResponseContent(tokenResult.getErrormessage()); |
| 266 | declearTaskList.add(declearTask); | 250 | declearTaskList.add(declearTask); |
| 267 | - }else if(tokenResult.getErrorcode().equals(Constants.ApiResponseKeys.KEY_10004) || tokenResult.getErrorcode().equals(Constants.ApiResponseKeys.KEY_10013)){ | 251 | + }else if(tokenResult.getErrorcode().equals(ErrorCodeEnum.ERROR_10004.getCode()) || tokenResult.getErrorcode().equals(ErrorCodeEnum.ERROR_10013.getCode())){ |
| 268 | //如果凭证失效,则刷新凭证 | 252 | //如果凭证失效,则刷新凭证 |
| 269 | refreshToken(token); | 253 | refreshToken(token); |
| 270 | }else{ | 254 | }else{ | ... | ... |
| 1 | package com.erry.iclear.dateInterface.service; | 1 | package com.erry.iclear.dateInterface.service; |
| 2 | 2 | ||
| 3 | //import cn.hutool.core.date.DateUtil; | 3 | //import cn.hutool.core.date.DateUtil; |
| 4 | +import com.erry.iclear.dateInterface.ErrorCodeEnum; | ||
| 4 | import com.erry.iclear.dateInterface.api.request.FedexMawb; | 5 | import com.erry.iclear.dateInterface.api.request.FedexMawb; |
| 5 | import com.erry.iclear.dateInterface.api.request.FedexReceipt; | 6 | import com.erry.iclear.dateInterface.api.request.FedexReceipt; |
| 6 | import com.erry.iclear.dateInterface.api.request.Mawb; | 7 | import com.erry.iclear.dateInterface.api.request.Mawb; |
| ... | @@ -493,8 +494,8 @@ public class ChmConsignmentService { | ... | @@ -493,8 +494,8 @@ public class ChmConsignmentService { |
| 493 | Date pushTime = DateUtils.timeStampToDate(Long.valueOf(timeStamp)); | 494 | Date pushTime = DateUtils.timeStampToDate(Long.valueOf(timeStamp)); |
| 494 | ChmConsignment chmConsignment=this.convertToChmConsignment(mawb,pushTime,creator); | 495 | ChmConsignment chmConsignment=this.convertToChmConsignment(mawb,pushTime,creator); |
| 495 | if(Objects.equals(chmConsignment,null)){ | 496 | if(Objects.equals(chmConsignment,null)){ |
| 496 | - result.setCode("30001"); | 497 | + result.setCode(ErrorCodeEnum.ERROR_30001.getCode()); |
| 497 | - result.setMsg("数据格式不正确"); | 498 | + result.setMsg(ErrorCodeEnum.ERROR_30001.getName()); |
| 498 | return result; | 499 | return result; |
| 499 | } | 500 | } |
| 500 | List<ChmConsignmentDetail> chmConsignmentDetailList = new ArrayList<>(); | 501 | List<ChmConsignmentDetail> chmConsignmentDetailList = new ArrayList<>(); |
| ... | @@ -522,7 +523,7 @@ public class ChmConsignmentService { | ... | @@ -522,7 +523,7 @@ public class ChmConsignmentService { |
| 522 | log.info("主单"+ mawb.getBillNo()+" 保存成功,chmConsignmentId:"+chmConsignmentSaveResult.getId()); | 523 | log.info("主单"+ mawb.getBillNo()+" 保存成功,chmConsignmentId:"+chmConsignmentSaveResult.getId()); |
| 523 | }else{ | 524 | }else{ |
| 524 | log.info("主单"+ mawb.getBillNo()+" 保存失败"); | 525 | log.info("主单"+ mawb.getBillNo()+" 保存失败"); |
| 525 | - result.setCode("30002"); | 526 | + result.setCode(ErrorCodeEnum.ERROR_30002.getCode()); |
| 526 | result.setMsg("主单"+ mawb.getBillNo()+" 保存失败"); | 527 | result.setMsg("主单"+ mawb.getBillNo()+" 保存失败"); |
| 527 | return result; | 528 | return result; |
| 528 | } | 529 | } |
| ... | @@ -579,8 +580,8 @@ public class ChmConsignmentService { | ... | @@ -579,8 +580,8 @@ public class ChmConsignmentService { |
| 579 | Date pushTime = DateUtils.timeStampToDate(Long.valueOf(timeStamp)); | 580 | Date pushTime = DateUtils.timeStampToDate(Long.valueOf(timeStamp)); |
| 580 | ChmConsignment chmConsignment = this.convertToChmConsignmentFedex(fedexMawb,pushTime,creator); | 581 | ChmConsignment chmConsignment = this.convertToChmConsignmentFedex(fedexMawb,pushTime,creator); |
| 581 | if(Objects.equals(chmConsignment,null)){ | 582 | if(Objects.equals(chmConsignment,null)){ |
| 582 | - result.setCode("30001"); | 583 | + result.setCode(ErrorCodeEnum.ERROR_30001.getCode()); |
| 583 | - result.setMsg("数据格式不正确"); | 584 | + result.setMsg(ErrorCodeEnum.ERROR_30001.getName()); |
| 584 | return result; | 585 | return result; |
| 585 | } | 586 | } |
| 586 | List<ChmConsignmentDetail> chmConsignmentDetailList = new ArrayList<>(); | 587 | List<ChmConsignmentDetail> chmConsignmentDetailList = new ArrayList<>(); |
| ... | @@ -602,7 +603,7 @@ public class ChmConsignmentService { | ... | @@ -602,7 +603,7 @@ public class ChmConsignmentService { |
| 602 | log.info("主单"+ fedexMawb.getBillNo()+" 保存成功,chmConsignmentId:"+chmConsignmentSaveResult.getId()); | 603 | log.info("主单"+ fedexMawb.getBillNo()+" 保存成功,chmConsignmentId:"+chmConsignmentSaveResult.getId()); |
| 603 | }else{ | 604 | }else{ |
| 604 | log.info("主单"+ fedexMawb.getBillNo()+" 保存失败"); | 605 | log.info("主单"+ fedexMawb.getBillNo()+" 保存失败"); |
| 605 | - result.setCode("30002"); | 606 | + result.setCode(ErrorCodeEnum.ERROR_30002.getCode()); |
| 606 | result.setMsg("主单"+ fedexMawb.getBillNo()+" 保存失败"); | 607 | result.setMsg("主单"+ fedexMawb.getBillNo()+" 保存失败"); |
| 607 | return result; | 608 | return result; |
| 608 | } | 609 | } |
| ... | @@ -635,7 +636,7 @@ public class ChmConsignmentService { | ... | @@ -635,7 +636,7 @@ public class ChmConsignmentService { |
| 635 | log.info("主单"+ fedexMawb.getBillNo()+" 更新成功,chmConsignmentId:"+updateResult.getId()); | 636 | log.info("主单"+ fedexMawb.getBillNo()+" 更新成功,chmConsignmentId:"+updateResult.getId()); |
| 636 | }else{ | 637 | }else{ |
| 637 | log.info("主单"+ fedexMawb.getBillNo()+" 更新失败"); | 638 | log.info("主单"+ fedexMawb.getBillNo()+" 更新失败"); |
| 638 | - result.setCode("30003"); | 639 | + result.setCode(ErrorCodeEnum.ERROR_30003.getCode()); |
| 639 | result.setMsg("主单"+ fedexMawb.getBillNo()+" 更新失败"); | 640 | result.setMsg("主单"+ fedexMawb.getBillNo()+" 更新失败"); |
| 640 | return result; | 641 | return result; |
| 641 | } | 642 | } | ... | ... |
| 1 | package com.erry.iclear.dateInterface.service; | 1 | package com.erry.iclear.dateInterface.service; |
| 2 | 2 | ||
| 3 | -import com.alibaba.fastjson.JSON; | 3 | +import com.erry.iclear.dateInterface.ErrorCodeEnum; |
| 4 | -import com.arronlong.httpclientutil.HttpClientUtil; | ||
| 5 | -import com.arronlong.httpclientutil.common.HttpConfig; | ||
| 6 | -import com.arronlong.httpclientutil.common.HttpHeader; | ||
| 7 | import com.erry.iclear.dateInterface.api.request.*; | 4 | import com.erry.iclear.dateInterface.api.request.*; |
| 8 | import com.erry.iclear.dateInterface.api.response.IClearCheckResponseResult; | 5 | import com.erry.iclear.dateInterface.api.response.IClearCheckResponseResult; |
| 9 | import com.erry.iclear.dateInterface.api.response.ResultRS; | 6 | import com.erry.iclear.dateInterface.api.response.ResultRS; |
| ... | @@ -13,22 +10,11 @@ import com.erry.iclear.dateInterface.repository.FedexMawbRepository; | ... | @@ -13,22 +10,11 @@ import com.erry.iclear.dateInterface.repository.FedexMawbRepository; |
| 13 | import com.erry.iclear.dateInterface.util.HttpUtils; | 10 | import com.erry.iclear.dateInterface.util.HttpUtils; |
| 14 | import com.erry.iclear.dateInterface.util.JsonToJava; | 11 | import com.erry.iclear.dateInterface.util.JsonToJava; |
| 15 | import com.google.gson.Gson; | 12 | import com.google.gson.Gson; |
| 16 | -import io.swagger.annotations.ApiModelProperty; | ||
| 17 | import lombok.extern.slf4j.Slf4j; | 13 | import lombok.extern.slf4j.Slf4j; |
| 18 | import org.apache.commons.lang3.StringUtils; | 14 | import org.apache.commons.lang3.StringUtils; |
| 19 | -import org.apache.http.Header; | ||
| 20 | import org.springframework.beans.factory.annotation.Autowired; | 15 | import org.springframework.beans.factory.annotation.Autowired; |
| 21 | import org.springframework.beans.factory.annotation.Value; | 16 | import org.springframework.beans.factory.annotation.Value; |
| 22 | -import org.springframework.http.HttpEntity; | ||
| 23 | -import org.springframework.http.HttpHeaders; | ||
| 24 | -import org.springframework.http.HttpMethod; | ||
| 25 | -import org.springframework.http.ResponseEntity; | ||
| 26 | import org.springframework.stereotype.Service; | 17 | import org.springframework.stereotype.Service; |
| 27 | - | ||
| 28 | -import javax.persistence.*; | ||
| 29 | -import javax.validation.Valid; | ||
| 30 | -import javax.validation.constraints.NotBlank; | ||
| 31 | -import javax.validation.constraints.NotNull; | ||
| 32 | import java.util.*; | 18 | import java.util.*; |
| 33 | import java.util.stream.Collectors; | 19 | import java.util.stream.Collectors; |
| 34 | 20 | ||
| ... | @@ -134,8 +120,8 @@ public class FedexService { | ... | @@ -134,8 +120,8 @@ public class FedexService { |
| 134 | //1、将请求转换为运单 | 120 | //1、将请求转换为运单 |
| 135 | ChmConsignment chmConsignment=consignmentService.convertToChmConsignmentFedex(fedexMawb,null,"IDE-ICLEAR-API"); | 121 | ChmConsignment chmConsignment=consignmentService.convertToChmConsignmentFedex(fedexMawb,null,"IDE-ICLEAR-API"); |
| 136 | if(Objects.equals(chmConsignment,null)){ | 122 | if(Objects.equals(chmConsignment,null)){ |
| 137 | - result.setCode("30001"); | 123 | + result.setCode(ErrorCodeEnum.ERROR_7.getCode()); |
| 138 | - result.setMsg("数据格式不正确"); | 124 | + result.setMsg(ErrorCodeEnum.ERROR_7.getName()); |
| 139 | return result; | 125 | return result; |
| 140 | } | 126 | } |
| 141 | List<ChmConsignmentDetail> chmConsignmentDetailList = new ArrayList<>(); | 127 | List<ChmConsignmentDetail> chmConsignmentDetailList = new ArrayList<>(); |
| ... | @@ -185,8 +171,8 @@ public class FedexService { | ... | @@ -185,8 +171,8 @@ public class FedexService { |
| 185 | ResultRS result = new ResultRS(Boolean.FALSE,"",""); | 171 | ResultRS result = new ResultRS(Boolean.FALSE,"",""); |
| 186 | 172 | ||
| 187 | if(Objects.equals(fedexc,null)){ | 173 | if(Objects.equals(fedexc,null)){ |
| 188 | - result.setCode("-7"); | 174 | + result.setCode(ErrorCodeEnum.ERROR_7.getCode()); |
| 189 | - result.setMsg("请求信息不能为空"); | 175 | + result.setMsg(ErrorCodeEnum.ERROR_7.getName()); |
| 190 | }else{ | 176 | }else{ |
| 191 | List<String> msgList = new ArrayList<>(); | 177 | List<String> msgList = new ArrayList<>(); |
| 192 | // 参数consignmentCode不能为空 | 178 | // 参数consignmentCode不能为空 | ... | ... |
| 1 | package com.erry.iclear.dateInterface.service; | 1 | package com.erry.iclear.dateInterface.service; |
| 2 | 2 | ||
| 3 | +import com.erry.iclear.dateInterface.ErrorCodeEnum; | ||
| 4 | +import com.erry.iclear.dateInterface.api.request.HsCodeParam; | ||
| 3 | import com.erry.iclear.dateInterface.api.response.ResultHsCode; | 5 | import com.erry.iclear.dateInterface.api.response.ResultHsCode; |
| 4 | import com.erry.iclear.dateInterface.entity.HsCode; | 6 | import com.erry.iclear.dateInterface.entity.HsCode; |
| 5 | import com.erry.iclear.dateInterface.repository.HsCodeRepository; | 7 | import com.erry.iclear.dateInterface.repository.HsCodeRepository; |
| 8 | +import com.erry.iclear.dateInterface.util.StringUtil; | ||
| 6 | import lombok.extern.slf4j.Slf4j; | 9 | import lombok.extern.slf4j.Slf4j; |
| 7 | import org.springframework.beans.factory.annotation.Autowired; | 10 | import org.springframework.beans.factory.annotation.Autowired; |
| 8 | import org.springframework.stereotype.Service; | 11 | import org.springframework.stereotype.Service; |
| ... | @@ -28,14 +31,14 @@ public class HsCodeService { | ... | @@ -28,14 +31,14 @@ public class HsCodeService { |
| 28 | ResultHsCode resultHsCode = new ResultHsCode(Boolean.FALSE,"","",null); | 31 | ResultHsCode resultHsCode = new ResultHsCode(Boolean.FALSE,"","",null); |
| 29 | try{ | 32 | try{ |
| 30 | if(hscode.length() > 2000){ | 33 | if(hscode.length() > 2000){ |
| 31 | - resultHsCode.setCode("30102"); | 34 | + resultHsCode.setCode(ErrorCodeEnum.ERROR_30102.getCode()); |
| 32 | - resultHsCode.setMsg("参数:hscode编码字段长度超过2000"); | 35 | + resultHsCode.setMsg(ErrorCodeEnum.ERROR_30102.getName()); |
| 33 | return resultHsCode; | 36 | return resultHsCode; |
| 34 | } | 37 | } |
| 35 | String[] hscodeArrays = hscode.split(","); | 38 | String[] hscodeArrays = hscode.split(","); |
| 36 | if(hscodeArrays.length > 100){ | 39 | if(hscodeArrays.length > 100){ |
| 37 | - resultHsCode.setCode("30100"); | 40 | + resultHsCode.setCode(ErrorCodeEnum.ERROR_30100.getCode()); |
| 38 | - resultHsCode.setMsg("hscode编码个数超过100个"); | 41 | + resultHsCode.setMsg(ErrorCodeEnum.ERROR_30100.getName()); |
| 39 | return resultHsCode; | 42 | return resultHsCode; |
| 40 | } | 43 | } |
| 41 | List<String> skuCodeList = Arrays.asList(hscodeArrays); | 44 | List<String> skuCodeList = Arrays.asList(hscodeArrays); |
| ... | @@ -57,14 +60,53 @@ public class HsCodeService { | ... | @@ -57,14 +60,53 @@ public class HsCodeService { |
| 57 | } | 60 | } |
| 58 | }); | 61 | }); |
| 59 | resultHsCode.setSuccess(Boolean.TRUE); | 62 | resultHsCode.setSuccess(Boolean.TRUE); |
| 60 | - resultHsCode.setCode("0"); | 63 | + resultHsCode.setCode(ErrorCodeEnum.SUCCESS.getCode()); |
| 61 | - resultHsCode.setMsg("操作成功"); | 64 | + resultHsCode.setMsg(ErrorCodeEnum.SUCCESS.getName()); |
| 62 | resultHsCode.setHsCodeResultList(hsCodeList); | 65 | resultHsCode.setHsCodeResultList(hsCodeList); |
| 63 | }catch(Exception ex){ | 66 | }catch(Exception ex){ |
| 64 | log.error(ex.getMessage(),ex); | 67 | log.error(ex.getMessage(),ex); |
| 65 | resultHsCode.setSuccess(Boolean.FALSE); | 68 | resultHsCode.setSuccess(Boolean.FALSE); |
| 66 | - resultHsCode.setCode("30101"); | 69 | + resultHsCode.setCode(ErrorCodeEnum.ERROR_30101.getCode()); |
| 67 | - resultHsCode.setMsg("数据查询异常"); | 70 | + resultHsCode.setMsg(ErrorCodeEnum.ERROR_30101.getName()); |
| 71 | + } | ||
| 72 | + return resultHsCode; | ||
| 73 | + } | ||
| 74 | + | ||
| 75 | + /** | ||
| 76 | + * 根据hscode编码或者商品名称进行模糊查询 | ||
| 77 | + * @param hscode | ||
| 78 | + * @return | ||
| 79 | + */ | ||
| 80 | + public ResultHsCode fuzzyQueryHsCode(HsCodeParam hscode){ | ||
| 81 | + ResultHsCode resultHsCode = new ResultHsCode(Boolean.FALSE,"","",null); | ||
| 82 | + try{ | ||
| 83 | + if(StringUtil.isEmpty(hscode.getSkuCode()) && StringUtil.isEmpty(hscode.getSkuName())){ | ||
| 84 | + resultHsCode.setCode(ErrorCodeEnum.ERROR_30103.getCode()); | ||
| 85 | + resultHsCode.setMsg(ErrorCodeEnum.ERROR_30103.getName()); | ||
| 86 | + return resultHsCode; | ||
| 87 | + } | ||
| 88 | + if(!StringUtil.isEmpty(hscode.getSkuCode()) && hscode.getSkuCode().length() > 50){ | ||
| 89 | + resultHsCode.setCode(ErrorCodeEnum.ERROR_30104.getCode()); | ||
| 90 | + resultHsCode.setMsg(ErrorCodeEnum.ERROR_30104.getName()); | ||
| 91 | + return resultHsCode; | ||
| 92 | + } | ||
| 93 | + if(!StringUtil.isEmpty(hscode.getSkuName()) && hscode.getSkuName().length() > 1000){ | ||
| 94 | + resultHsCode.setCode(ErrorCodeEnum.ERROR_30104.getCode()); | ||
| 95 | + resultHsCode.setMsg(ErrorCodeEnum.ERROR_30104.getName()); | ||
| 96 | + return resultHsCode; | ||
| 97 | + } | ||
| 98 | + List<HsCode> hsCodeList = null; | ||
| 99 | + | ||
| 100 | + | ||
| 101 | + resultHsCode.setSuccess(Boolean.TRUE); | ||
| 102 | + resultHsCode.setCode(ErrorCodeEnum.SUCCESS.getCode()); | ||
| 103 | + resultHsCode.setMsg(ErrorCodeEnum.SUCCESS.getName()); | ||
| 104 | + resultHsCode.setHsCodeResultList(hsCodeList); | ||
| 105 | + }catch(Exception ex){ | ||
| 106 | + log.error(ex.getMessage(),ex); | ||
| 107 | + resultHsCode.setSuccess(Boolean.FALSE); | ||
| 108 | + resultHsCode.setCode(ErrorCodeEnum.ERROR_30101.getCode()); | ||
| 109 | + resultHsCode.setMsg(ErrorCodeEnum.ERROR_30101.getName()); | ||
| 68 | } | 110 | } |
| 69 | return resultHsCode; | 111 | return resultHsCode; |
| 70 | } | 112 | } |
| ... | @@ -78,16 +120,14 @@ public class HsCodeService { | ... | @@ -78,16 +120,14 @@ public class HsCodeService { |
| 78 | try{ | 120 | try{ |
| 79 | List<HsCode> hsCodeList = this.hsCodeRepository.findAllHsCodeList(); | 121 | List<HsCode> hsCodeList = this.hsCodeRepository.findAllHsCodeList(); |
| 80 | resultHsCode.setSuccess(Boolean.TRUE); | 122 | resultHsCode.setSuccess(Boolean.TRUE); |
| 81 | - resultHsCode.setCode("0"); | 123 | + resultHsCode.setCode(ErrorCodeEnum.SUCCESS.getCode()); |
| 82 | - resultHsCode.setMsg("操作成功"); | 124 | + resultHsCode.setMsg(ErrorCodeEnum.SUCCESS.getName()); |
| 83 | resultHsCode.setHsCodeResultList(hsCodeList); | 125 | resultHsCode.setHsCodeResultList(hsCodeList); |
| 84 | }catch(Exception ex){ | 126 | }catch(Exception ex){ |
| 85 | - log.error(ex.getMessage()); | ||
| 86 | - | ||
| 87 | log.error(ex.getMessage(),ex); | 127 | log.error(ex.getMessage(),ex); |
| 88 | resultHsCode.setSuccess(Boolean.FALSE); | 128 | resultHsCode.setSuccess(Boolean.FALSE); |
| 89 | - resultHsCode.setCode("30101"); | 129 | + resultHsCode.setCode(ErrorCodeEnum.ERROR_30101.getCode()); |
| 90 | - resultHsCode.setMsg("数据查询异常"); | 130 | + resultHsCode.setMsg(ErrorCodeEnum.ERROR_30101.getName()); |
| 91 | } | 131 | } |
| 92 | return resultHsCode; | 132 | return resultHsCode; |
| 93 | } | 133 | } | ... | ... |
| ... | @@ -36,10 +36,10 @@ public class IClearApiHsCodeLogService { | ... | @@ -36,10 +36,10 @@ public class IClearApiHsCodeLogService { |
| 36 | * 查询日志,最近10分钟如果有查询过全量hscode则返回true | 36 | * 查询日志,最近10分钟如果有查询过全量hscode则返回true |
| 37 | * @return | 37 | * @return |
| 38 | */ | 38 | */ |
| 39 | - public boolean findIClearApiHsCodeLog(){ | 39 | + public boolean findIClearApiHsCodeLog(String appId){ |
| 40 | boolean rs = false; | 40 | boolean rs = false; |
| 41 | try{ | 41 | try{ |
| 42 | - Long count = iClearApiHsCodeLogRepository.findIClearApiHsCodeLog(DateUtils.getAfter10()); | 42 | + Long count = iClearApiHsCodeLogRepository.findIClearApiHsCodeLog(DateUtils.getAfter10(),appId); |
| 43 | if(count > 0){ | 43 | if(count > 0){ |
| 44 | rs = true; | 44 | rs = true; |
| 45 | } | 45 | } | ... | ... |
| ... | @@ -16,31 +16,21 @@ import java.util.List; | ... | @@ -16,31 +16,21 @@ import java.util.List; |
| 16 | @Service | 16 | @Service |
| 17 | @Slf4j | 17 | @Slf4j |
| 18 | public class MawbDetailService { | 18 | public class MawbDetailService { |
| 19 | - | ||
| 20 | @Autowired | 19 | @Autowired |
| 21 | private MawbDetailRepository mawbDetailRepository; | 20 | private MawbDetailRepository mawbDetailRepository; |
| 22 | 21 | ||
| 23 | public void saveMawbDetail(List<MawbDetail> mawbDetailList){ | 22 | public void saveMawbDetail(List<MawbDetail> mawbDetailList){ |
| 24 | log.info(""); | 23 | log.info(""); |
| 25 | - | ||
| 26 | log.info(""); | 24 | log.info(""); |
| 27 | - | ||
| 28 | } | 25 | } |
| 29 | 26 | ||
| 30 | - | ||
| 31 | public ResultRS checkMawbDetail(Mawb mawb){ | 27 | public ResultRS checkMawbDetail(Mawb mawb){ |
| 32 | ResultRS result = new ResultRS(Boolean.FALSE,null,null); | 28 | ResultRS result = new ResultRS(Boolean.FALSE,null,null); |
| 33 | try{ | 29 | try{ |
| 34 | - | ||
| 35 | - | ||
| 36 | - | ||
| 37 | result.setSuccess(Boolean.TRUE); | 30 | result.setSuccess(Boolean.TRUE); |
| 38 | }catch (Exception e){ | 31 | }catch (Exception e){ |
| 39 | log.error("checkMawbDetail() error:"+e.getMessage()); | 32 | log.error("checkMawbDetail() error:"+e.getMessage()); |
| 40 | } | 33 | } |
| 41 | - | ||
| 42 | return result; | 34 | return result; |
| 43 | } | 35 | } |
| 44 | - | ||
| 45 | - | ||
| 46 | } | 36 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -3,6 +3,7 @@ package com.erry.iclear.dateInterface.service; | ... | @@ -3,6 +3,7 @@ package com.erry.iclear.dateInterface.service; |
| 3 | import com.arronlong.httpclientutil.HttpClientUtil; | 3 | import com.arronlong.httpclientutil.HttpClientUtil; |
| 4 | import com.arronlong.httpclientutil.common.HttpConfig; | 4 | import com.arronlong.httpclientutil.common.HttpConfig; |
| 5 | import com.arronlong.httpclientutil.common.HttpHeader; | 5 | import com.arronlong.httpclientutil.common.HttpHeader; |
| 6 | +import com.erry.iclear.dateInterface.ErrorCodeEnum; | ||
| 6 | import com.erry.iclear.dateInterface.api.request.Mawb; | 7 | import com.erry.iclear.dateInterface.api.request.Mawb; |
| 7 | import com.erry.iclear.dateInterface.api.request.MawbDetail; | 8 | import com.erry.iclear.dateInterface.api.request.MawbDetail; |
| 8 | import com.erry.iclear.dateInterface.api.response.IClearCheckResponseResult; | 9 | import com.erry.iclear.dateInterface.api.response.IClearCheckResponseResult; |
| ... | @@ -166,11 +167,9 @@ public class MawbService { | ... | @@ -166,11 +167,9 @@ public class MawbService { |
| 166 | } | 167 | } |
| 167 | } | 168 | } |
| 168 | } | 169 | } |
| 169 | - | ||
| 170 | return ""; | 170 | return ""; |
| 171 | } | 171 | } |
| 172 | 172 | ||
| 173 | - | ||
| 174 | /** | 173 | /** |
| 175 | * 校验主单 | 174 | * 校验主单 |
| 176 | * @param mawb | 175 | * @param mawb |
| ... | @@ -180,12 +179,11 @@ public class MawbService { | ... | @@ -180,12 +179,11 @@ public class MawbService { |
| 180 | ResultRS result = new ResultRS(Boolean.FALSE,null,null); | 179 | ResultRS result = new ResultRS(Boolean.FALSE,null,null); |
| 181 | try{ | 180 | try{ |
| 182 | log.info("checkMawb start>>>>>>>>>> mawb:"+gson.toJson(mawb)); | 181 | log.info("checkMawb start>>>>>>>>>> mawb:"+gson.toJson(mawb)); |
| 183 | - | ||
| 184 | //1、将请求转换为运单 | 182 | //1、将请求转换为运单 |
| 185 | ChmConsignment chmConsignment=consignmentService.convertToChmConsignment(mawb,null,"IDE-ICLEAR-API"); | 183 | ChmConsignment chmConsignment=consignmentService.convertToChmConsignment(mawb,null,"IDE-ICLEAR-API"); |
| 186 | if(Objects.equals(chmConsignment,null)){ | 184 | if(Objects.equals(chmConsignment,null)){ |
| 187 | - result.setCode("30001"); | 185 | + result.setCode(ErrorCodeEnum.ERROR_30001.getCode()); |
| 188 | - result.setMsg("数据格式不正确"); | 186 | + result.setMsg(ErrorCodeEnum.ERROR_30001.getName()); |
| 189 | return result; | 187 | return result; |
| 190 | } | 188 | } |
| 191 | //校验成交方式 成交方式为CIF时 '参数feeCurr不能为空','参数feeMark不能为空'',参数feeRate不能为空','参数insurCurr不能为空', '参数insurRate不能为空' | 189 | //校验成交方式 成交方式为CIF时 '参数feeCurr不能为空','参数feeMark不能为空'',参数feeRate不能为空','参数insurCurr不能为空', '参数insurRate不能为空' |
| ... | @@ -193,13 +191,11 @@ public class MawbService { | ... | @@ -193,13 +191,11 @@ public class MawbService { |
| 193 | if(!result.getSuccess()){ | 191 | if(!result.getSuccess()){ |
| 194 | return result; | 192 | return result; |
| 195 | } | 193 | } |
| 196 | - | ||
| 197 | List<ChmConsignmentDetail> chmConsignmentDetailList = new ArrayList<>(); | 194 | List<ChmConsignmentDetail> chmConsignmentDetailList = new ArrayList<>(); |
| 198 | mawb.getMawbDetailList().forEach(detail ->{ | 195 | mawb.getMawbDetailList().forEach(detail ->{ |
| 199 | chmConsignmentDetailList.add(consignmentDetailService.convertToChmConsignmentDetail(detail,chmConsignment)); | 196 | chmConsignmentDetailList.add(consignmentDetailService.convertToChmConsignmentDetail(detail,chmConsignment)); |
| 200 | }); | 197 | }); |
| 201 | chmConsignment.setChmConsignmentDetailList(chmConsignmentDetailList); | 198 | chmConsignment.setChmConsignmentDetailList(chmConsignmentDetailList); |
| 202 | - | ||
| 203 | //调用IClear接口进行运单数据校验 | 199 | //调用IClear接口进行运单数据校验 |
| 204 | String objJson = JsonToJava.toJson(chmConsignment); | 200 | String objJson = JsonToJava.toJson(chmConsignment); |
| 205 | // Header[] headers = HttpHeader.custom() | 201 | // Header[] headers = HttpHeader.custom() |
| ... | @@ -213,13 +209,9 @@ public class MawbService { | ... | @@ -213,13 +209,9 @@ public class MawbService { |
| 213 | // .encoding("utf-8") | 209 | // .encoding("utf-8") |
| 214 | // .json(objJson); | 210 | // .json(objJson); |
| 215 | // String json = HttpClientUtil.post(config); | 211 | // String json = HttpClientUtil.post(config); |
| 216 | - | ||
| 217 | Map<String,String> headerMap = new HashMap<>(); | 212 | Map<String,String> headerMap = new HashMap<>(); |
| 218 | headerMap.put("Content-Type", "application/json"); | 213 | headerMap.put("Content-Type", "application/json"); |
| 219 | String json = HttpUtils.doPost(this.iclearCheckUrl,objJson,headerMap); | 214 | String json = HttpUtils.doPost(this.iclearCheckUrl,objJson,headerMap); |
| 220 | - | ||
| 221 | - | ||
| 222 | - | ||
| 223 | IClearCheckResponseResult iclearCheckResponseResult = JsonToJava.parseJson(json, IClearCheckResponseResult.class); | 215 | IClearCheckResponseResult iclearCheckResponseResult = JsonToJava.parseJson(json, IClearCheckResponseResult.class); |
| 224 | result.setSuccess(iclearCheckResponseResult.getSuccess()); | 216 | result.setSuccess(iclearCheckResponseResult.getSuccess()); |
| 225 | result.setCode(iclearCheckResponseResult.getCode()); | 217 | result.setCode(iclearCheckResponseResult.getCode()); |
| ... | @@ -243,23 +235,23 @@ public class MawbService { | ... | @@ -243,23 +235,23 @@ public class MawbService { |
| 243 | if(dealMode.equals("CIF、CIP、DDP、DDU、DAP")){ | 235 | if(dealMode.equals("CIF、CIP、DDP、DDU、DAP")){ |
| 244 | if(StringUtil.isEmpty(mawb.getFeeCurr())){ | 236 | if(StringUtil.isEmpty(mawb.getFeeCurr())){ |
| 245 | result.setSuccess(false); | 237 | result.setSuccess(false); |
| 246 | - result.setCode("30002"); | 238 | + result.setCode(ErrorCodeEnum.ERROR_30002.getCode()); |
| 247 | result.setMsg("运费币制不能为空"); | 239 | result.setMsg("运费币制不能为空"); |
| 248 | }else if(StringUtil.isEmpty(mawb.getFeeMark())){ | 240 | }else if(StringUtil.isEmpty(mawb.getFeeMark())){ |
| 249 | result.setSuccess(false); | 241 | result.setSuccess(false); |
| 250 | - result.setCode("30002"); | 242 | + result.setCode(ErrorCodeEnum.ERROR_30002.getCode()); |
| 251 | result.setMsg("运费标记不能为空"); | 243 | result.setMsg("运费标记不能为空"); |
| 252 | }else if(mawb.getFeeRate() == null){ | 244 | }else if(mawb.getFeeRate() == null){ |
| 253 | result.setSuccess(false); | 245 | result.setSuccess(false); |
| 254 | - result.setCode("30002"); | 246 | + result.setCode(ErrorCodeEnum.ERROR_30002.getCode()); |
| 255 | result.setMsg("运费/率不能为空"); | 247 | result.setMsg("运费/率不能为空"); |
| 256 | }else if(StringUtil.isEmpty(mawb.getInsurCurr())){ | 248 | }else if(StringUtil.isEmpty(mawb.getInsurCurr())){ |
| 257 | result.setSuccess(false); | 249 | result.setSuccess(false); |
| 258 | - result.setCode("30002"); | 250 | + result.setCode(ErrorCodeEnum.ERROR_30002.getCode()); |
| 259 | result.setMsg("保险费币制不能为空"); | 251 | result.setMsg("保险费币制不能为空"); |
| 260 | }else if(mawb.getInsurRate() == null){ | 252 | }else if(mawb.getInsurRate() == null){ |
| 261 | result.setSuccess(false); | 253 | result.setSuccess(false); |
| 262 | - result.setCode("30002"); | 254 | + result.setCode(ErrorCodeEnum.ERROR_30002.getCode()); |
| 263 | result.setMsg("保险费/率不能为空"); | 255 | result.setMsg("保险费/率不能为空"); |
| 264 | } | 256 | } |
| 265 | } | 257 | } | ... | ... |
| ... | @@ -34,8 +34,6 @@ public class OrigplacecodeMappingService { | ... | @@ -34,8 +34,6 @@ public class OrigplacecodeMappingService { |
| 34 | return result; | 34 | return result; |
| 35 | } | 35 | } |
| 36 | 36 | ||
| 37 | - | ||
| 38 | - | ||
| 39 | /** | 37 | /** |
| 40 | * 初始化DomesticDestinationMapping | 38 | * 初始化DomesticDestinationMapping |
| 41 | */ | 39 | */ |
| ... | @@ -50,13 +48,4 @@ public class OrigplacecodeMappingService { | ... | @@ -50,13 +48,4 @@ public class OrigplacecodeMappingService { |
| 50 | log.error("initDomesticDestinationMapping() error" + e.getMessage()); | 48 | log.error("initDomesticDestinationMapping() error" + e.getMessage()); |
| 51 | } | 49 | } |
| 52 | } | 50 | } |
| 53 | - | ||
| 54 | - | ||
| 55 | - | ||
| 56 | - | ||
| 57 | - | ||
| 58 | - | ||
| 59 | - | ||
| 60 | - | ||
| 61 | - | ||
| 62 | } | 51 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| 1 | package com.erry.iclear.dateInterface.task; | 1 | package com.erry.iclear.dateInterface.task; |
| 2 | 2 | ||
| 3 | -import com.alibaba.fastjson.JSONObject; | 3 | +import com.erry.iclear.dateInterface.ErrorCodeEnum; |
| 4 | import com.erry.iclear.dateInterface.api.response.TokenResult; | 4 | import com.erry.iclear.dateInterface.api.response.TokenResult; |
| 5 | -import com.erry.iclear.dateInterface.common.Constants; | ||
| 6 | -import com.erry.iclear.dateInterface.entity.HsCode; | ||
| 7 | -import com.erry.iclear.dateInterface.repository.HsCodeRepository; | ||
| 8 | import com.erry.iclear.dateInterface.service.ApiService; | 5 | import com.erry.iclear.dateInterface.service.ApiService; |
| 9 | import lombok.extern.slf4j.Slf4j; | 6 | import lombok.extern.slf4j.Slf4j; |
| 10 | import org.springframework.beans.factory.annotation.Autowired; | 7 | import org.springframework.beans.factory.annotation.Autowired; |
| ... | @@ -62,7 +59,7 @@ public class IClearApiTask { | ... | @@ -62,7 +59,7 @@ public class IClearApiTask { |
| 62 | try { | 59 | try { |
| 63 | //获取token | 60 | //获取token |
| 64 | TokenResult tokenResult = apiService.getToken(); | 61 | TokenResult tokenResult = apiService.getToken(); |
| 65 | - if(tokenResult.getErrorcode().equals(Constants.ApiResponseKeys.SUCCESS)){ | 62 | + if(tokenResult.getErrorcode().equals(ErrorCodeEnum.SUCCESS.getCode())){ |
| 66 | this.token = tokenResult.getData().getToken(); | 63 | this.token = tokenResult.getData().getToken(); |
| 67 | } | 64 | } |
| 68 | }catch(Exception ex){ | 65 | }catch(Exception ex){ | ... | ... |
| ... | @@ -8,9 +8,9 @@ spring.datasource.type=com.alibaba.druid.pool.DruidDataSource | ... | @@ -8,9 +8,9 @@ spring.datasource.type=com.alibaba.druid.pool.DruidDataSource |
| 8 | #spring.datasource.jndi-name=jdbc/iclearProdTestDS | 8 | #spring.datasource.jndi-name=jdbc/iclearProdTestDS |
| 9 | 9 | ||
| 10 | #推送海关回执 | 10 | #推送海关回执 |
| 11 | -task.pushCustomsTask=0 0/1 * 1 * ? | 11 | +task.pushCustomsTask=0 0/1 * * * ? |
| 12 | #推送完整报文 | 12 | #推送完整报文 |
| 13 | -task.pushMawbTask=0 0/1 * 1 * ? | 13 | +task.pushMawbTask=0 0/1 * * * ? |
| 14 | #推送失败的回执数据 | 14 | #推送失败的回执数据 |
| 15 | task.pushErrorReturnDate=0 0/3 * 1 * ? | 15 | task.pushErrorReturnDate=0 0/3 * 1 * ? |
| 16 | #推送失败的申报数据 | 16 | #推送失败的申报数据 | ... | ... |
| ... | @@ -3,7 +3,7 @@ spring.datasource.jndi-name=jdbc/iclearDS | ... | @@ -3,7 +3,7 @@ spring.datasource.jndi-name=jdbc/iclearDS |
| 3 | #推送海关回执 | 3 | #推送海关回执 |
| 4 | task.pushCustomsTask=0 0/1 * * * ? | 4 | task.pushCustomsTask=0 0/1 * * * ? |
| 5 | #推送完整报文 | 5 | #推送完整报文 |
| 6 | -task.pushMawbTask=0 0/1 * 1 * ? | 6 | +task.pushMawbTask=0 0/1 * * * ? |
| 7 | #推送失败的回执数据 | 7 | #推送失败的回执数据 |
| 8 | task.pushErrorReturnDate=0 0/30 * * * ? | 8 | task.pushErrorReturnDate=0 0/30 * * * ? |
| 9 | #推送失败的申报数据 | 9 | #推送失败的申报数据 | ... | ... |
| ... | @@ -3,7 +3,7 @@ spring.datasource.jndi-name=jdbc/iclearDS | ... | @@ -3,7 +3,7 @@ spring.datasource.jndi-name=jdbc/iclearDS |
| 3 | #推送海关回执 | 3 | #推送海关回执 |
| 4 | task.pushCustomsTask=0 0/1 * * * ? | 4 | task.pushCustomsTask=0 0/1 * * * ? |
| 5 | #推送完整报文 | 5 | #推送完整报文 |
| 6 | -task.pushMawbTask=0 0/1 * 1 * ? | 6 | +task.pushMawbTask=0 0/1 * * * ? |
| 7 | #推送失败的回执数据 | 7 | #推送失败的回执数据 |
| 8 | task.pushErrorReturnDate=0 0/3 * * * ? | 8 | task.pushErrorReturnDate=0 0/3 * * * ? |
| 9 | #推送失败的申报数据 | 9 | #推送失败的申报数据 | ... | ... |
| ... | @@ -24,7 +24,7 @@ public class ApiTest { | ... | @@ -24,7 +24,7 @@ public class ApiTest { |
| 24 | //获取HSCODE接口地址 | 24 | //获取HSCODE接口地址 |
| 25 | public static String hscodeRequest = "hscode/hscodeRequest"; | 25 | public static String hscodeRequest = "hscode/hscodeRequest"; |
| 26 | 26 | ||
| 27 | - public static String timeStamp = "1645153943"; | 27 | + public static String timeStamp = "1649839249891"; |
| 28 | public static String appId = "IDE"; | 28 | public static String appId = "IDE"; |
| 29 | public static String appKey = "iClearExport"; | 29 | public static String appKey = "iClearExport"; |
| 30 | //需要申请 | 30 | //需要申请 |
| ... | @@ -33,7 +33,7 @@ public class ApiTest { | ... | @@ -33,7 +33,7 @@ public class ApiTest { |
| 33 | public static void main(String[] args) throws Exception{ | 33 | public static void main(String[] args) throws Exception{ |
| 34 | // BASF,iClearExportC,6db193cb4165a71b | 34 | // BASF,iClearExportC,6db193cb4165a71b |
| 35 | System.out.println(new Date(Long.valueOf(timeStamp))); | 35 | System.out.println(new Date(Long.valueOf(timeStamp))); |
| 36 | - String token = SHA256Util.getSHA256String("BASF" + "iClearExportC" + "b92131f03f19a348" + ApiTest.timeStamp); | 36 | + String token = SHA256Util.getSHA256String("DEMO2" + "iClearExportDemo2" + "fe9f015bd9f12c82" + ApiTest.timeStamp); |
| 37 | System.out.println(token); | 37 | System.out.println(token); |
| 38 | 38 | ||
| 39 | //D类申报的数据落地接口 | 39 | //D类申报的数据落地接口 | ... | ... |
-
Please register or login to post a comment